stimulus-use
Advanced tools
Comparing version 0.22.1 to 0.23.0
@@ -10,2 +10,3 @@ export { useIntersection, IntersectionController } from './use-intersection/index'; | ||
export { useMutation, UseMutation, MutationController } from './use-mutation/index'; | ||
export { useTargetMutation, UseTargetMutation, TargetMutationController } from './use-target-mutation/index'; | ||
export { useWindowResize, WindowResizeController } from './use-window-resize/index'; | ||
@@ -12,0 +13,0 @@ export { useMemo } from './use-memo/index'; |
@@ -10,2 +10,3 @@ export { useIntersection, IntersectionController } from './use-intersection/index'; | ||
export { useMutation, UseMutation, MutationController } from './use-mutation/index'; | ||
export { useTargetMutation, UseTargetMutation, TargetMutationController } from './use-target-mutation/index'; | ||
export { useWindowResize, WindowResizeController } from './use-window-resize/index'; | ||
@@ -12,0 +13,0 @@ export { useMemo } from './use-memo/index'; |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("stimulus")):"function"==typeof define&&define.amd?define(["exports","stimulus"],n):n((e=e||self).StimulusUse={},e.Stimulus)}(this,function(e,n){var t=function(e,n){var t=e[n];return"function"==typeof t?t:function(){}},i=function(e,n,t){var i=e;return!0===t?i=n.identifier+":"+e:"string"==typeof t&&(i=t+":"+e),i},r=function(e,n,t){var i=n||{bubbles:!0,cancelable:!0,composed:!0},r=i.bubbles,o=i.cancelable,s=i.composed;return n&&Object.assign(t,{originalEvent:n}),new CustomEvent(e,{bubbles:r,cancelable:o,composed:s,detail:t})},o={dispatchEvent:!0,eventPrefix:!0},s=function(e,n){var s;void 0===n&&(n={});var c=Object.assign({},o,n),l=c.dispatchEvent,a=c.eventPrefix,u=(null==(s=n)?void 0:s.element)||e.element,v=e.disconnect.bind(e),f=new IntersectionObserver(function(n){var o=n[0];o.isIntersecting?function(n){if(e.isVisible=!0,t(e,"appear").call(e,n),l){var o=i("appear",e,a),s=r(o,null,{controller:e,entry:n});u.dispatchEvent(s)}}(o):e.isVisible&&function(n){if(e.isVisible=!1,t(e,"disappear").call(e,n),l){var o=i("disappear",e,a),s=r(o,null,{controller:e,entry:n});u.dispatchEvent(s)}}(o)},n),d=function(){f.observe(u)},b=function(){f.unobserve(u)};return Object.assign(e,{isVisible:!1,disconnect:function(){b(),v()}}),d(),[d,b]};function c(){return(c=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)}function l(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var u=function(e){function n(n){var t;return t=e.call(this,n)||this,requestAnimationFrame(function(){var e=s(a(t),t.options),n=e[0],i=e[1];Object.assign(a(t),{observe:n,unobserve:i})}),t}return l(n,e),n}(function(e){function n(){var n;return(n=e.apply(this,arguments)||this).isVisible=!1,n}return l(n,e),n}(n.Controller)),v=function(e,n){var i=e.disconnect.bind(e),r=new IntersectionObserver(function(n){n[0].isIntersecting&&!e.isLoaded&&function(n){var i=e.data.get("src");if(i){var r=e.element;e.isLoading=!0,t(e,"loading").call(e,i),r.onload=function(){!function(n){e.isLoading=!1,e.isLoaded=!0,t(e,"loaded").call(e,n)}(i)},r.src=i}}()},n),o=function(){r.observe(e.element)},s=function(){r.unobserve(e.element)};return Object.assign(e,{isVisible:!1,disconnect:function(){s(),i()}}),o(),[o,s]},f=function(e){function n(n){var t;return(t=e.call(this,n)||this).options={rootMargin:"10%"},requestAnimationFrame(function(){var e=v(a(t),t.options),n=e[0],i=e[1];Object.assign(a(t),{observe:n,unobserve:i})}),t}return l(n,e),n}(function(e){function n(){var n;return(n=e.apply(this,arguments)||this).isLoading=!1,n.isLoaded=!1,n}return l(n,e),n}(n.Controller)),d={dispatchEvent:!0,eventPrefix:!0},b=function(e,n){var o;void 0===n&&(n={});var s=Object.assign({},d,n),c=s.dispatchEvent,l=s.eventPrefix,a=(null==(o=n)?void 0:o.element)||e.element,u=e.disconnect.bind(e),v=new ResizeObserver(function(n){var o=n[0];if(t(e,"resize").call(e,o.contentRect),c){var s=i("resize",e,l),u=r(s,null,{controller:e,entry:o});a.dispatchEvent(u)}}),f=function(){v.observe(a)},b=function(){v.unobserve(a)};return Object.assign(e,{disconnect:function(){b(),u()}}),f(),[f,b]},h=function(e){function n(n){var t;return t=e.call(this,n)||this,requestAnimationFrame(function(){var e=b(a(t),t.options),n=e[0],i=e[1];Object.assign(a(t),{observe:n,unobserve:i})}),t}return l(n,e),n}(function(e){function n(){return e.apply(this,arguments)||this}return l(n,e),n}(n.Controller)),m={events:["click","touchend"],onlyVisible:!0,dispatchEvent:!0,eventPrefix:!0},p=function(e,n){void 0===n&&(n={});var t=Object.assign({},m,n),o=t.onlyVisible,s=t.dispatchEvent,c=t.events,l=t.eventPrefix,a=function(t){var c,a,u,v,f=(null==(c=n)?void 0:c.element)||e.element;if(!f.contains(t.target)&&(a=f.getBoundingClientRect(),u=window.innerHeight||document.documentElement.clientHeight,v=window.innerWidth||document.documentElement.clientWidth,a.top<=u&&a.top+a.height>=0&&a.left<=v&&a.left+a.width>=0||!o)&&(e.clickOutside&&e.clickOutside(t),s)){var d=i("click:outside",e,l),b=r(d,t,{controller:e});f.dispatchEvent(b)}},u=function(){null==c||c.forEach(function(e){window.addEventListener(e,a,!1)})},v=function(){null==c||c.forEach(function(e){window.removeEventListener(e,a,!1)})},f=e.disconnect.bind(e);return Object.assign(e,{disconnect:function(){v(),f()}}),u(),[u,v]},g=function(e){function n(n){var t;return t=e.call(this,n)||this,requestAnimationFrame(function(){var e=p(a(t),t.options),n=e[0],i=e[1];Object.assign(a(t),{observe:n,unobserve:i})}),t}return l(n,e),n}(function(e){function n(){return e.apply(this,arguments)||this}return l(n,e),n}(n.Controller)),y={debug:!1,logger:console},E=function(e,n){var t,i,r,o,s,l=this;void 0===n&&(n={}),this.log=function(e,n){l.debug&&(l.logger.groupCollapsed("%c"+l.controller.identifier+" %c#"+e,"color: #3B82F6","color: unset"),l.logger.log(c({controllerId:l.controllerId},n)),l.logger.groupEnd())},this.debug=null!=(t=null!=(i=null==(r=n)?void 0:r.debug)?i:e.application.stimulusUseDebug)?t:y.debug,this.logger=null!=(o=null==(s=n)?void 0:s.logger)?o:y.logger,this.controller=e,this.controllerId=e.element.id||e.element.dataset.id,this.controllerInitialize=e.initialize.bind(e),this.controllerConnect=e.connect.bind(e),this.controllerDisconnect=e.disconnect.bind(e)},w=function(e){function n(n,t){var r,o,s,c,l;return void 0===t&&(t={}),(l=e.call(this,n,t)||this).dispatch=function(e,n){void 0===n&&(n={});var t=a(l),r=t.targetElement,o=t.eventPrefix,s=t.bubbles,c=t.cancelable,u=t.log;Object.assign(n,{controller:t.controller});var v=i(e,l.controller,o),f=new CustomEvent(v,{detail:n,bubbles:s,cancelable:c});return r.dispatchEvent(f),u("dispatch",{eventName:v,detail:n,bubbles:s,cancelable:c}),f},l.targetElement=null!=(r=t.element)?r:n.element,l.eventPrefix=null==(o=t.eventPrefix)||o,l.bubbles=null==(s=t.bubbles)||s,l.cancelable=null==(c=t.cancelable)||c,l.enhanceController(),l}return l(n,e),n.prototype.enhanceController=function(){Object.assign(this.controller,{dispatch:this.dispatch})},n}(E),C=function(e,n){return void 0===n&&(n={}),new w(e,n)},O=function(e,n){void 0===n&&(n={}),Object.defineProperty(e,"isPreview",{get:function(){return document.documentElement.hasAttribute("data-turbolinks-preview")}}),Object.defineProperty(e,"csrfToken",{get:function(){return this.metaValue("csrf-token")}}),C(e,n),Object.assign(e,{metaValue:function(e){var n=document.head.querySelector('meta[name="'+e+'"]');return n&&n.getAttribute("content")}})},j=function(e){function n(n){var t;return(t=e.call(this,n)||this).isPreview=!1,t.csrfToken="",O(a(t),t.options),t}return l(n,e),n}(n.Controller),L={ms:6e4,initialState:!1,events:["mousemove","mousedown","resize","keydown","touchstart","wheel"],dispatchEvent:!0,eventPrefix:!0},P=function(e,n){void 0===n&&(n={});var o=Object.assign({},L,n),s=o.ms,c=o.events,l=o.dispatchEvent,a=o.eventPrefix,u=o.initialState,v=setTimeout(function(){u=!0,f()},s),f=function(n){var o=i("away",e,a);if(e.isIdle=!0,t(e,"away").call(e,n),l){var s=r(o,n||null,{controller:e});e.element.dispatchEvent(s)}},d=function(n){var o=i("back",e,a);if(e.isIdle=!1,t(e,"back").call(e,n),l){var s=r(o,n||null,{controller:e});e.element.dispatchEvent(s)}},b=function(e){u&&d(e),u=!1,clearTimeout(v),v=setTimeout(function(){u=!0,f(e)},s)},h=function(e){document.hidden||b(e)};u?f():d();var m=e.disconnect.bind(e),p=function(){c.forEach(function(e){window.addEventListener(e,b)}),document.addEventListener("visibilitychange",h)},g=function(){c.forEach(function(e){window.removeEventListener(e,b)}),document.removeEventListener("visibilitychange",h)};return Object.assign(e,{disconnect:function(){g(),m()}}),p(),[p,g]},V=function(e){function n(n){var t;return t=e.call(this,n)||this,requestAnimationFrame(function(){var e=P(a(t),t.options),n=e[0],i=e[1];Object.assign(a(t),{observe:n,unobserve:i})}),t}return l(n,e),n}(function(e){function n(){var n;return(n=e.apply(this,arguments)||this).isIdle=!1,n}return l(n,e),n}(n.Controller)),x={dispatchEvent:!0,eventPrefix:!0},A=function(e){function n(n,o){var s;void 0===o&&(o={}),(s=e.call(this,n,o)||this).observe=function(){s.controller.isVisible=!document.hidden,document.addEventListener("visibilitychange",s.handleVisibilityChange)},s.unobserve=function(){document.removeEventListener("visibilitychange",s.handleVisibilityChange)},s.becomesInvisible=function(e){var n=i("invisible",s.controller,s.eventPrefix);s.controller.isVisible=!1,t(s.controller,"invisible").call(s.controller),s.log("invisible",{isVisible:!1}),s.dispatch(n,e)},s.becomesVisible=function(e){var n=i("visible",s.controller,s.eventPrefix);s.controller.isVisible=!0,t(s.controller,"visible").call(s.controller),s.log("visible",{isVisible:!0}),s.dispatch(n,e)},s.dispatch=function(e,n){if(s.dispatchEvent){var t={controller:s.controller,isVisible:s.controller.isVisible},i=r(e,n||null,t);s.controller.element.dispatchEvent(i),s.log("dispatchEvent",c({eventName:e},t))}},s.handleVisibilityChange=function(e){document.hidden?s.becomesInvisible(e):s.becomesVisible(e)};var l=Object.assign({},x,o),u=l.dispatchEvent,v=l.eventPrefix;return Object.assign(a(s),{dispatchEvent:u,eventPrefix:v}),s.controller=n,Object.assign(n,{disconnect:function(){s.unobserve(),s.controllerDisconnect()}}),s.handleVisibilityChange(),s.observe(),s}return l(n,e),n}(E),T=function(e,n){void 0===n&&(n={});var t=new A(e,n);return[t.observe,t.unobserve]},I=function(e){function n(n){var t;return t=e.call(this,n)||this,requestAnimationFrame(function(){var e=T(a(t),t.options),n=e[0],i=e[1];Object.assign(a(t),{observe:n,unobserve:i})}),t}return l(n,e),n}(function(e){function n(){var n;return(n=e.apply(this,arguments)||this).isVisible=!1,n}return l(n,e),n}(n.Controller)),z=function(e){function n(n,i){var r,o;return void 0===i&&(i={}),(o=e.call(this,n,i)||this).observe=function(){o.targetElement.addEventListener("mouseenter",o.onEnter),o.targetElement.addEventListener("mouseleave",o.onLeave)},o.unobserve=function(){o.targetElement.removeEventListener("mouseenter",o.onEnter),o.targetElement.removeEventListener("mouseleave",o.onLeave)},o.onEnter=function(){t(o.controller,"mouseEnter").call(o.controller),o.log("mouseEnter",{hover:!0})},o.onLeave=function(){t(o.controller,"mouseLeave").call(o.controller),o.log("mouseLeave",{hover:!1})},o.targetElement=(null==(r=i)?void 0:r.element)||n.element,o.controller=n,o.enhanceController(),o.observe(),o}return l(n,e),n.prototype.enhanceController=function(){var e=this,n=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:function(){e.unobserve(),n()}})},n}(E),q=function(e,n){void 0===n&&(n={});var t=new z(e,n);return[t.observe,t.unobserve]},k=function(e){function n(n){var t;return t=e.call(this,n)||this,requestAnimationFrame(function(){var e=q(a(t),t.options),n=e[0],i=e[1];Object.assign(a(t),{observe:n,unobserve:i})}),t}return l(n,e),n}(function(e){function n(){return e.apply(this,arguments)||this}return l(n,e),n}(n.Controller)),F=function(e){function n(n,i){var r,o;return void 0===i&&(i={}),(o=e.call(this,n,i)||this).observe=function(){try{o.observer.observe(o.targetElement,o.options)}catch(e){o.controller.application.handleError(e,"At a minimum, one of childList, attributes, and/or characterData must be true",{})}},o.unobserve=function(){o.observer.disconnect()},o.mutation=function(e){t(o.controller,"mutate").call(o.controller,e),o.log("mutate",{entries:e})},o.targetElement=(null==(r=i)?void 0:r.element)||n.element,o.controller=n,o.options=i,o.observer=new MutationObserver(o.mutation),o.enhanceController(),o.observe(),o}return l(n,e),n.prototype.enhanceController=function(){var e=this,n=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:function(){e.unobserve(),n()}})},n}(E),S=function(e,n){void 0===n&&(n={});var t=new F(e,n);return[t.observe,t.unobserve]},M=function(e){function n(n){var t;return t=e.call(this,n)||this,requestAnimationFrame(function(){var e=S(a(t),t.options),n=e[0],i=e[1];Object.assign(a(t),{observe:n,unobserve:i})}),t}return l(n,e),n}(function(e){function n(){return e.apply(this,arguments)||this}return l(n,e),n}(n.Controller)),R=function(e){var n=function(n){var i=window,r={height:i.innerHeight||Infinity,width:i.innerWidth||Infinity,event:n};t(e,"windowResize").call(e,r)},i=e.disconnect.bind(e),r=function(){window.addEventListener("resize",n),n()},o=function(){window.removeEventListener("resize",n)};return Object.assign(e,{disconnect:function(){o(),i()}}),r(),[r,o]},D=function(e){function n(n){var t;return t=e.call(this,n)||this,requestAnimationFrame(function(){var e=R(a(t)),n=e[0],i=e[1];Object.assign(a(t),{observe:n,unobserve:i})}),t}return l(n,e),n}(function(e){function n(){return e.apply(this,arguments)||this}return l(n,e),n}(n.Controller)),H=function(e,n){void 0===n&&(n=200);var t=null;return function(){var i=arguments,r=this,o=function(){return e.apply(r,i)};t&&clearTimeout(t),t=setTimeout(o,n)}};function U(e,n){var t;return void 0===n&&(n=200),function(){var i=arguments,r=this;t||(t=!0,e.apply(r,i),setTimeout(function(){return t=!1},n))}}function N(e){var n=document.head.querySelector('meta[name="'+e+'"]');return n&&n.getAttribute("content")}function W(e){try{return JSON.parse(e)}catch(n){return e}}function _(e){return e.replace(/(?:[_-])([a-z0-9])/g,function(e,n){return n.toUpperCase()})}var B={enterClass:"enter",enterActiveClass:"enterStart",enterToClass:"enterEnd",leaveClass:"leave",leaveActiveClass:"leaveStart",leaveToClass:"leaveEnd"},G={dispatchEvent:!0,eventPrefix:!0,transitioned:!1,hiddenClass:"hidden"},J=function(e,n){var t,i,r,o,s=function(e,n,t,i){try{var r,o;return(r=e.classList).add.apply(r,n),(o=e.classList).add.apply(o,t),Promise.resolve(function(){try{return Promise.resolve(new Promise(function(e){requestAnimationFrame(function(){requestAnimationFrame(e)})}))}catch(e){return Promise.reject(e)}}()).then(function(){var r,o;return(r=e.classList).remove.apply(r,t),(o=e.classList).add.apply(o,i),Promise.resolve(function(e){try{return Promise.resolve(new Promise(function(n){var t=1e3*Number(getComputedStyle(e).transitionDuration.split(",")[0].replace("s",""));setTimeout(function(){n(t)},t)}))}catch(e){return Promise.reject(e)}}(e)).then(function(){var t;(t=e.classList).remove.apply(t,n)})})}catch(e){return Promise.reject(e)}},c=function(t){try{if(!e.transitioned)return Promise.resolve();e.transitioned=!1,p&&p(t);var i=K("leave",n,f),r=K("leaveActive",n,f),o=K("leaveTo",n,f);return Promise.resolve(s(v,i,r,o)).then(function(){h&&v.classList.add(h)})}catch(e){return Promise.reject(e)}},l=function(t){try{if(e.transitioned)return Promise.resolve();e.transitioned=!0,m&&m(t);var i=K("enter",n,f),r=K("enterActive",n,f),o=K("enterTo",n,f);return h&&v.classList.remove(h),Promise.resolve(s(v,i,r,o)).then(function(){})}catch(e){return Promise.reject(e)}};void 0===n&&(n={});var a,u=e.element.dataset.transitionTarget;u&&(a=e[u+"Target"]);var v=(null==(t=n)?void 0:t.element)||a||e.element;if(v instanceof HTMLElement||v instanceof SVGElement){var f=v.dataset,d=Object.assign(G,n),b=d.transitioned,h=d.hiddenClass,m=null==(i=e.enter)?void 0:i.bind(e),p=null==(r=e.leave)?void 0:r.bind(e),g=null==(o=e.toggleTransition)?void 0:o.bind(e);return e.transitioned=b,b?(h&&v.classList.remove(h),l()):(h&&v.classList.add(h),c()),Object.assign(e,{enter:l,leave:c,toggleTransition:y}),[l,c,y]}function y(n){g&&g(n),e.transitioned?c():l()}};function K(e,n,t){var i="transition"+e[0].toUpperCase()+e.substr(1);return(n[e]||t[i]||t[B[e]]||"").split(" ")}var Q=function(e){function n(n){var t;return t=e.call(this,n)||this,requestAnimationFrame(function(){J(a(t),t.options)}),t}return l(n,e),n}(function(e){function n(){var n;return(n=e.apply(this,arguments)||this).transitioned=!1,n}return l(n,e),n}(n.Controller));e.ApplicationController=j,e.ClickOutsideController=g,e.HoverController=k,e.IdleController=V,e.IntersectionController=u,e.LazyLoadController=f,e.MutationController=M,e.ResizeController=h,e.TransitionController=Q,e.UseHover=z,e.UseMutation=F,e.UseVisibility=A,e.VisibilityController=I,e.WindowResizeController=D,e.useApplication=O,e.useClickOutside=p,e.useDebounce=function(e,n){var t;null==(t=e.constructor.debounces)||t.forEach(function(t){if("string"==typeof t&&(e[t]=H(e[t],null==n?void 0:n.wait)),"object"==typeof t){var i=t.name;if(!i)return;e[i]=H(e[i],t.wait||(null==n?void 0:n.wait))}})},e.useDispatch=C,e.useHover=q,e.useIdle=P,e.useIntersection=s,e.useLazyLoad=v,e.useMemo=function(e){var n;null==(n=e.constructor.memos)||n.forEach(function(n){!function(e,n,t){Object.defineProperty(e,n,{value:t})}(e,n,e[n])})},e.useMeta=function(e,n){void 0===n&&(n={suffix:!0});var t=e.constructor.metaNames,i=n.suffix;null==t||t.forEach(function(n){!function(e,n,t){var i=t?_(n)+"Meta":_(n);Object.defineProperty(e,i,{get:function(){return W(N(n))}})}(e,n,i)}),Object.defineProperty(e,"metas",{get:function(){var e={};return null==t||t.forEach(function(n){var t=W(N(n));null!=t&&(e[_(n)]=t)}),e}})},e.useMutation=S,e.useResize=b,e.useThrottle=function(e,n){var t;void 0===n&&(n={}),null==(t=e.constructor.throttles)||t.forEach(function(t){var i;if("string"==typeof t&&(e[t]=U(e[t],null==(i=n)?void 0:i.wait)),"object"==typeof t){var r,o=t.name;if(!o)return;e[o]=U(e[o],t.wait||(null==(r=n)?void 0:r.wait))}})},e.useTransition=J,e.useVisibility=T,e.useWindowResize=R}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("stimulus")):"function"==typeof define&&define.amd?define(["exports","stimulus"],t):t((e=e||self).StimulusUse={},e.Stimulus)}(this,function(e,t){var n=function(e,t){var n=e[t];return"function"==typeof n?n:function(){}},r=function(e,t,n){var r=e;return!0===n?r=t.identifier+":"+e:"string"==typeof n&&(r=n+":"+e),r},i=function(e,t,n){var r=t||{bubbles:!0,cancelable:!0,composed:!0},i=r.bubbles,o=r.cancelable,s=r.composed;return t&&Object.assign(n,{originalEvent:t}),new CustomEvent(e,{bubbles:i,cancelable:o,composed:s,detail:n})},o={dispatchEvent:!0,eventPrefix:!0},s=function(e,t){var s;void 0===t&&(t={});var a=Object.assign({},o,t),l=a.dispatchEvent,c=a.eventPrefix,u=(null==(s=t)?void 0:s.element)||e.element,d=e.disconnect.bind(e),v=new IntersectionObserver(function(t){var o=t[0];o.isIntersecting?function(t){if(e.isVisible=!0,n(e,"appear").call(e,t),l){var o=r("appear",e,c),s=i(o,null,{controller:e,entry:t});u.dispatchEvent(s)}}(o):e.isVisible&&function(t){if(e.isVisible=!1,n(e,"disappear").call(e,t),l){var o=r("disappear",e,c),s=i(o,null,{controller:e,entry:t});u.dispatchEvent(s)}}(o)},t),f=function(){v.observe(u)},h=function(){v.unobserve(u)};return Object.assign(e,{isVisible:!1,disconnect:function(){h(),d()}}),f(),[f,h]};function a(){return(a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var d=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=s(c(n),n.options),t=e[0],r=e[1];Object.assign(c(n),{observe:t,unobserve:r})}),n}return l(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isVisible=!1,t}return l(t,e),t}(t.Controller)),v=function(e,t){var r=e.disconnect.bind(e),i=new IntersectionObserver(function(t){t[0].isIntersecting&&!e.isLoaded&&function(t){var r=e.data.get("src");if(r){var i=e.element;e.isLoading=!0,n(e,"loading").call(e,r),i.onload=function(){!function(t){e.isLoading=!1,e.isLoaded=!0,n(e,"loaded").call(e,t)}(r)},i.src=r}}()},t),o=function(){i.observe(e.element)},s=function(){i.unobserve(e.element)};return Object.assign(e,{isVisible:!1,disconnect:function(){s(),r()}}),o(),[o,s]},f=function(e){function t(t){var n;return(n=e.call(this,t)||this).options={rootMargin:"10%"},requestAnimationFrame(function(){var e=v(c(n),n.options),t=e[0],r=e[1];Object.assign(c(n),{observe:t,unobserve:r})}),n}return l(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isLoading=!1,t.isLoaded=!1,t}return l(t,e),t}(t.Controller)),h={dispatchEvent:!0,eventPrefix:!0},b=function(e,t){var o;void 0===t&&(t={});var s=Object.assign({},h,t),a=s.dispatchEvent,l=s.eventPrefix,c=(null==(o=t)?void 0:o.element)||e.element,u=e.disconnect.bind(e),d=new ResizeObserver(function(t){var o=t[0];if(n(e,"resize").call(e,o.contentRect),a){var s=r("resize",e,l),u=i(s,null,{controller:e,entry:o});c.dispatchEvent(u)}}),v=function(){d.observe(c)},f=function(){d.unobserve(c)};return Object.assign(e,{disconnect:function(){f(),u()}}),v(),[v,f]},m=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=b(c(n),n.options),t=e[0],r=e[1];Object.assign(c(n),{observe:t,unobserve:r})}),n}return l(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t}(t.Controller)),g={events:["click","touchend"],onlyVisible:!0,dispatchEvent:!0,eventPrefix:!0},p=function(e,t){void 0===t&&(t={});var n=Object.assign({},g,t),o=n.onlyVisible,s=n.dispatchEvent,a=n.events,l=n.eventPrefix,c=function(n){var a,c,u,d,v=(null==(a=t)?void 0:a.element)||e.element;if(!v.contains(n.target)&&(c=v.getBoundingClientRect(),u=window.innerHeight||document.documentElement.clientHeight,d=window.innerWidth||document.documentElement.clientWidth,c.top<=u&&c.top+c.height>=0&&c.left<=d&&c.left+c.width>=0||!o)&&(e.clickOutside&&e.clickOutside(n),s)){var f=r("click:outside",e,l),h=i(f,n,{controller:e});v.dispatchEvent(h)}},u=function(){null==a||a.forEach(function(e){window.addEventListener(e,c,!1)})},d=function(){null==a||a.forEach(function(e){window.removeEventListener(e,c,!1)})},v=e.disconnect.bind(e);return Object.assign(e,{disconnect:function(){d(),v()}}),u(),[u,d]},y=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=p(c(n),n.options),t=e[0],r=e[1];Object.assign(c(n),{observe:t,unobserve:r})}),n}return l(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t}(t.Controller)),E={debug:!1,logger:console},C=function(e,t){var n,r,i,o,s,l=this;void 0===t&&(t={}),this.log=function(e,t){l.debug&&(l.logger.groupCollapsed("%c"+l.controller.identifier+" %c#"+e,"color: #3B82F6","color: unset"),l.logger.log(a({controllerId:l.controllerId},t)),l.logger.groupEnd())},this.debug=null!=(n=null!=(r=null==(i=t)?void 0:i.debug)?r:e.application.stimulusUseDebug)?n:E.debug,this.logger=null!=(o=null==(s=t)?void 0:s.logger)?o:E.logger,this.controller=e,this.controllerId=e.element.id||e.element.dataset.id,this.controllerInitialize=e.initialize.bind(e),this.controllerConnect=e.connect.bind(e),this.controllerDisconnect=e.disconnect.bind(e)},w=function(e){function t(t,n){var i,o,s,a,l;return void 0===n&&(n={}),(l=e.call(this,t,n)||this).dispatch=function(e,t){void 0===t&&(t={});var n=c(l),i=n.targetElement,o=n.eventPrefix,s=n.bubbles,a=n.cancelable,u=n.log;Object.assign(t,{controller:n.controller});var d=r(e,l.controller,o),v=new CustomEvent(d,{detail:t,bubbles:s,cancelable:a});return i.dispatchEvent(v),u("dispatch",{eventName:d,detail:t,bubbles:s,cancelable:a}),v},l.targetElement=null!=(i=n.element)?i:t.element,l.eventPrefix=null==(o=n.eventPrefix)||o,l.bubbles=null==(s=n.bubbles)||s,l.cancelable=null==(a=n.cancelable)||a,l.enhanceController(),l}return l(t,e),t.prototype.enhanceController=function(){Object.assign(this.controller,{dispatch:this.dispatch})},t}(C),O=function(e,t){return void 0===t&&(t={}),new w(e,t)},j=function(e,t){void 0===t&&(t={}),Object.defineProperty(e,"isPreview",{get:function(){return document.documentElement.hasAttribute("data-turbolinks-preview")}}),Object.defineProperty(e,"csrfToken",{get:function(){return this.metaValue("csrf-token")}}),O(e,t),Object.assign(e,{metaValue:function(e){var t=document.head.querySelector('meta[name="'+e+'"]');return t&&t.getAttribute("content")}})},P=function(e){function t(t){var n;return(n=e.call(this,t)||this).isPreview=!1,n.csrfToken="",j(c(n),n.options),n}return l(t,e),t}(t.Controller),T={ms:6e4,initialState:!1,events:["mousemove","mousedown","resize","keydown","touchstart","wheel"],dispatchEvent:!0,eventPrefix:!0},L=function(e,t){void 0===t&&(t={});var o=Object.assign({},T,t),s=o.ms,a=o.events,l=o.dispatchEvent,c=o.eventPrefix,u=o.initialState,d=setTimeout(function(){u=!0,v()},s),v=function(t){var o=r("away",e,c);if(e.isIdle=!0,n(e,"away").call(e,t),l){var s=i(o,t||null,{controller:e});e.element.dispatchEvent(s)}},f=function(t){var o=r("back",e,c);if(e.isIdle=!1,n(e,"back").call(e,t),l){var s=i(o,t||null,{controller:e});e.element.dispatchEvent(s)}},h=function(e){u&&f(e),u=!1,clearTimeout(d),d=setTimeout(function(){u=!0,v(e)},s)},b=function(e){document.hidden||h(e)};u?v():f();var m=e.disconnect.bind(e),g=function(){a.forEach(function(e){window.addEventListener(e,h)}),document.addEventListener("visibilitychange",b)},p=function(){a.forEach(function(e){window.removeEventListener(e,h)}),document.removeEventListener("visibilitychange",b)};return Object.assign(e,{disconnect:function(){p(),m()}}),g(),[g,p]},A=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=L(c(n),n.options),t=e[0],r=e[1];Object.assign(c(n),{observe:t,unobserve:r})}),n}return l(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isIdle=!1,t}return l(t,e),t}(t.Controller)),x={dispatchEvent:!0,eventPrefix:!0},I=function(e){function t(t,o){var s;void 0===o&&(o={}),(s=e.call(this,t,o)||this).observe=function(){s.controller.isVisible=!document.hidden,document.addEventListener("visibilitychange",s.handleVisibilityChange)},s.unobserve=function(){document.removeEventListener("visibilitychange",s.handleVisibilityChange)},s.becomesInvisible=function(e){var t=r("invisible",s.controller,s.eventPrefix);s.controller.isVisible=!1,n(s.controller,"invisible").call(s.controller),s.log("invisible",{isVisible:!1}),s.dispatch(t,e)},s.becomesVisible=function(e){var t=r("visible",s.controller,s.eventPrefix);s.controller.isVisible=!0,n(s.controller,"visible").call(s.controller),s.log("visible",{isVisible:!0}),s.dispatch(t,e)},s.dispatch=function(e,t){if(s.dispatchEvent){var n={controller:s.controller,isVisible:s.controller.isVisible},r=i(e,t||null,n);s.controller.element.dispatchEvent(r),s.log("dispatchEvent",a({eventName:e},n))}},s.handleVisibilityChange=function(e){document.hidden?s.becomesInvisible(e):s.becomesVisible(e)};var l=Object.assign({},x,o),u=l.dispatchEvent,d=l.eventPrefix;return Object.assign(c(s),{dispatchEvent:u,eventPrefix:d}),s.controller=t,Object.assign(t,{disconnect:function(){s.unobserve(),s.controllerDisconnect()}}),s.handleVisibilityChange(),s.observe(),s}return l(t,e),t}(C),N=function(e,t){void 0===t&&(t={});var n=new I(e,t);return[n.observe,n.unobserve]},V=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=N(c(n),n.options),t=e[0],r=e[1];Object.assign(c(n),{observe:t,unobserve:r})}),n}return l(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).isVisible=!1,t}return l(t,e),t}(t.Controller)),S=function(e){function t(t,r){var i,o;return void 0===r&&(r={}),(o=e.call(this,t,r)||this).observe=function(){o.targetElement.addEventListener("mouseenter",o.onEnter),o.targetElement.addEventListener("mouseleave",o.onLeave)},o.unobserve=function(){o.targetElement.removeEventListener("mouseenter",o.onEnter),o.targetElement.removeEventListener("mouseleave",o.onLeave)},o.onEnter=function(){n(o.controller,"mouseEnter").call(o.controller),o.log("mouseEnter",{hover:!0})},o.onLeave=function(){n(o.controller,"mouseLeave").call(o.controller),o.log("mouseLeave",{hover:!1})},o.targetElement=(null==(i=r)?void 0:i.element)||t.element,o.controller=t,o.enhanceController(),o.observe(),o}return l(t,e),t.prototype.enhanceController=function(){var e=this,t=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:function(){e.unobserve(),t()}})},t}(C),F=function(e,t){void 0===t&&(t={});var n=new S(e,t);return[n.observe,n.unobserve]},M=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=F(c(n),n.options),t=e[0],r=e[1];Object.assign(c(n),{observe:t,unobserve:r})}),n}return l(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t}(t.Controller)),U=function(e){function t(t,r){var i,o;return void 0===r&&(r={}),(o=e.call(this,t,r)||this).observe=function(){try{o.observer.observe(o.targetElement,o.options)}catch(e){o.controller.application.handleError(e,"At a minimum, one of childList, attributes, and/or characterData must be true",{})}},o.unobserve=function(){o.observer.disconnect()},o.mutation=function(e){n(o.controller,"mutate").call(o.controller,e),o.log("mutate",{entries:e})},o.targetElement=(null==(i=r)?void 0:i.element)||t.element,o.controller=t,o.options=r,o.observer=new MutationObserver(o.mutation),o.enhanceController(),o.observe(),o}return l(t,e),t.prototype.enhanceController=function(){var e=this,t=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:function(){e.unobserve(),t()}})},t}(C),q=function(e,t){void 0===t&&(t={});var n=new U(e,t);return[n.observe,n.unobserve]},z=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=q(c(n),n.options),t=e[0],r=e[1];Object.assign(c(n),{observe:t,unobserve:r})}),n}return l(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t}(t.Controller)),k=function(e){function t(t,n){var r;return void 0===n&&(n={}),(r=e.call(this,t,n)||this).observe=function(){r.observer.observe(r.targetElement,{subtree:!0,characterData:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:[r.targetSelector,r.scopedTargetSelector]})},r.unobserve=function(){r.observer.disconnect()},r.mutation=function(e){for(var t,n=function(){var e=t.value;switch(e.type){case"attributes":var n=e.target.getAttribute(e.attributeName);if(e.attributeName===r.targetSelector||e.attributeName===r.scopedTargetSelector){var i=r.targetsUsedByThisController(e.oldValue),o=r.targetsUsedByThisController(n),s=i.filter(function(e){return!o.includes(e)}),a=o.filter(function(e){return!i.includes(e)});s.forEach(function(t){return r.targetRemoved(r.stripIdentifierPrefix(t),e.target,"attributeChange")}),a.forEach(function(t){return r.targetAdded(r.stripIdentifierPrefix(t),e.target,"attributeChange")})}break;case"characterData":var l=r.findTargetInAncestry(e.target);if(null==l)return{v:void 0};r.targetsUsedByThisControllerFromNode(l).forEach(function(e){r.targetChanged(r.stripIdentifierPrefix(e),l,"domMutation")});break;case"childList":var c=e.removedNodes;e.addedNodes.forEach(function(e){return r.processNodeDOMMutation(e,r.targetAdded)}),c.forEach(function(e){return r.processNodeDOMMutation(e,r.targetRemoved)})}},i=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,void 0):void 0}}(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(e);!(t=i()).done;){var o=n();if("object"==typeof o)return o.v}},r.controller=t,r.options=n,r.targetElement=t.element,r.identifier=t.scope.identifier,r.identifierPrefix=r.identifier+".",r.targetSelector=t.scope.schema.targetAttribute,r.scopedTargetSelector="data-"+r.identifier+"-target",r.targets=n.targets||t.constructor.targets,r.prefixedTargets=r.targets.map(function(e){return""+r.identifierPrefix+e}),r.observer=new MutationObserver(r.mutation),r.enhanceController(),r.observe(),r}l(t,e);var r=t.prototype;return r.processNodeDOMMutation=function(e,t){var n=this,r=e,i=t,o=[];"#text"==r.nodeName||0==this.targetsUsedByThisControllerFromNode(r).length?(i=this.targetChanged,r=this.findTargetInAncestry(e)):o=this.targetsUsedByThisControllerFromNode(r),null!=r&&(0==o.length&&(o=this.targetsUsedByThisControllerFromNode(r)),o.forEach(function(e){i.call(n,n.stripIdentifierPrefix(e),r,"domMutation")}))},r.findTargetInAncestry=function(e){var t=e,n=[];for("#text"!=t.nodeName&&(n=this.targetsUsedByThisControllerFromNode(t));null!==t.parentNode&&t.parentNode!=this.targetElement&&0==n.length;)if("#text"!==(t=t.parentNode).nodeName&&this.targetsUsedByThisControllerFromNode(t).length>0)return t;return"#text"==t.nodeName||null==t.parentNode?null:t.parentNode==this.targetElement&&this.targetsUsedByThisControllerFromNode(t).length>0?t:null},r.targetAdded=function(e,t,r){var i=e+"TargetAdded";this.controller[i]&&n(this.controller,i).call(this.controller,t),this.log("targetAdded",{target:e,node:t,trigger:r})},r.targetRemoved=function(e,t,r){var i=e+"TargetRemoved";this.controller[i]&&n(this.controller,i).call(this.controller,t),this.log("targetRemoved",{target:e,node:t,trigger:r})},r.targetChanged=function(e,t,r){var i=e+"TargetChanged";this.controller[i]&&n(this.controller,i).call(this.controller,t),this.log("targetChanged",{target:e,node:t,trigger:r})},r.targetsUsedByThisControllerFromNode=function(e){if("#text"==e.nodeName)return[];var t=e;return this.targetsUsedByThisController(t.getAttribute(this.scopedTargetSelector)||t.getAttribute(this.targetSelector))},r.targetsUsedByThisController=function(e){var t=this.stripIdentifierPrefix(e=e||"").split(" ");return this.targets.filter(function(e){return-1!==t.indexOf(e)})},r.stripIdentifierPrefix=function(e){return e.replace(new RegExp(this.identifierPrefix,"g"),"")},r.enhanceController=function(){var e=this,t=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:function(){e.unobserve(),t()}})},t}(C),R=function(e,t){void 0===t&&(t={});var n=new k(e,t);return[n.observe,n.unobserve]},B=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=R(c(n),n.options),t=e[0],r=e[1];Object.assign(c(n),{observe:t,unobserve:r})}),n}return l(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t}(t.Controller)),D=function(e){var t=function(t){var r=window,i={height:r.innerHeight||Infinity,width:r.innerWidth||Infinity,event:t};n(e,"windowResize").call(e,i)},r=e.disconnect.bind(e),i=function(){window.addEventListener("resize",t),t()},o=function(){window.removeEventListener("resize",t)};return Object.assign(e,{disconnect:function(){o(),r()}}),i(),[i,o]},H=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){var e=D(c(n)),t=e[0],r=e[1];Object.assign(c(n),{observe:t,unobserve:r})}),n}return l(t,e),t}(function(e){function t(){return e.apply(this,arguments)||this}return l(t,e),t}(t.Controller)),W=function(e,t){void 0===t&&(t=200);var n=null;return function(){var r=arguments,i=this,o=function(){return e.apply(i,r)};n&&clearTimeout(n),n=setTimeout(o,t)}};function _(e,t){var n;return void 0===t&&(t=200),function(){var r=arguments,i=this;n||(n=!0,e.apply(i,r),setTimeout(function(){return n=!1},t))}}function G(e){var t=document.head.querySelector('meta[name="'+e+'"]');return t&&t.getAttribute("content")}function J(e){try{return JSON.parse(e)}catch(t){return e}}function $(e){return e.replace(/(?:[_-])([a-z0-9])/g,function(e,t){return t.toUpperCase()})}var K={enterClass:"enter",enterActiveClass:"enterStart",enterToClass:"enterEnd",leaveClass:"leave",leaveActiveClass:"leaveStart",leaveToClass:"leaveEnd"},Q={dispatchEvent:!0,eventPrefix:!0,transitioned:!1,hiddenClass:"hidden"},X=function(e,t){var n,r,i,o,s=function(e,t,n,r){try{var i,o;return(i=e.classList).add.apply(i,t),(o=e.classList).add.apply(o,n),Promise.resolve(function(){try{return Promise.resolve(new Promise(function(e){requestAnimationFrame(function(){requestAnimationFrame(e)})}))}catch(e){return Promise.reject(e)}}()).then(function(){var i,o;return(i=e.classList).remove.apply(i,n),(o=e.classList).add.apply(o,r),Promise.resolve(function(e){try{return Promise.resolve(new Promise(function(t){var n=1e3*Number(getComputedStyle(e).transitionDuration.split(",")[0].replace("s",""));setTimeout(function(){t(n)},n)}))}catch(e){return Promise.reject(e)}}(e)).then(function(){var n;(n=e.classList).remove.apply(n,t)})})}catch(e){return Promise.reject(e)}},a=function(n){try{if(!e.transitioned)return Promise.resolve();e.transitioned=!1,g&&g(n);var r=Y("leave",t,v),i=Y("leaveActive",t,v),o=Y("leaveTo",t,v);return Promise.resolve(s(d,r,i,o)).then(function(){b&&d.classList.add(b)})}catch(e){return Promise.reject(e)}},l=function(n){try{if(e.transitioned)return Promise.resolve();e.transitioned=!0,m&&m(n);var r=Y("enter",t,v),i=Y("enterActive",t,v),o=Y("enterTo",t,v);return b&&d.classList.remove(b),Promise.resolve(s(d,r,i,o)).then(function(){})}catch(e){return Promise.reject(e)}};void 0===t&&(t={});var c,u=e.element.dataset.transitionTarget;u&&(c=e[u+"Target"]);var d=(null==(n=t)?void 0:n.element)||c||e.element;if(d instanceof HTMLElement||d instanceof SVGElement){var v=d.dataset,f=Object.assign(Q,t),h=f.transitioned,b=f.hiddenClass,m=null==(r=e.enter)?void 0:r.bind(e),g=null==(i=e.leave)?void 0:i.bind(e),p=null==(o=e.toggleTransition)?void 0:o.bind(e);return e.transitioned=h,h?(b&&d.classList.remove(b),l()):(b&&d.classList.add(b),a()),Object.assign(e,{enter:l,leave:a,toggleTransition:y}),[l,a,y]}function y(t){p&&p(t),e.transitioned?a():l()}};function Y(e,t,n){var r="transition"+e[0].toUpperCase()+e.substr(1);return(t[e]||n[r]||n[K[e]]||"").split(" ")}var Z=function(e){function t(t){var n;return n=e.call(this,t)||this,requestAnimationFrame(function(){X(c(n),n.options)}),n}return l(t,e),t}(function(e){function t(){var t;return(t=e.apply(this,arguments)||this).transitioned=!1,t}return l(t,e),t}(t.Controller));e.ApplicationController=P,e.ClickOutsideController=y,e.HoverController=M,e.IdleController=A,e.IntersectionController=d,e.LazyLoadController=f,e.MutationController=z,e.ResizeController=m,e.TargetMutationController=B,e.TransitionController=Z,e.UseHover=S,e.UseMutation=U,e.UseTargetMutation=k,e.UseVisibility=I,e.VisibilityController=V,e.WindowResizeController=H,e.useApplication=j,e.useClickOutside=p,e.useDebounce=function(e,t){var n;null==(n=e.constructor.debounces)||n.forEach(function(n){if("string"==typeof n&&(e[n]=W(e[n],null==t?void 0:t.wait)),"object"==typeof n){var r=n.name;if(!r)return;e[r]=W(e[r],n.wait||(null==t?void 0:t.wait))}})},e.useDispatch=O,e.useHover=F,e.useIdle=L,e.useIntersection=s,e.useLazyLoad=v,e.useMemo=function(e){var t;null==(t=e.constructor.memos)||t.forEach(function(t){!function(e,t,n){Object.defineProperty(e,t,{value:n})}(e,t,e[t])})},e.useMeta=function(e,t){void 0===t&&(t={suffix:!0});var n=e.constructor.metaNames,r=t.suffix;null==n||n.forEach(function(t){!function(e,t,n){var r=n?$(t)+"Meta":$(t);Object.defineProperty(e,r,{get:function(){return J(G(t))}})}(e,t,r)}),Object.defineProperty(e,"metas",{get:function(){var e={};return null==n||n.forEach(function(t){var n=J(G(t));null!=n&&(e[$(t)]=n)}),e}})},e.useMutation=q,e.useResize=b,e.useTargetMutation=R,e.useThrottle=function(e,t){var n;void 0===t&&(t={}),null==(n=e.constructor.throttles)||n.forEach(function(n){var r;if("string"==typeof n&&(e[n]=_(e[n],null==(r=t)?void 0:r.wait)),"object"==typeof n){var i,o=n.name;if(!o)return;e[o]=_(e[o],n.wait||(null==(i=t)?void 0:i.wait))}})},e.useTransition=X,e.useVisibility=N,e.useWindowResize=D}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "stimulus-use", | ||
"version": "0.22.1", | ||
"version": "0.23.0", | ||
"description": "A collection of standard controllers and utilities for Stimulus", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.umd.js", |
@@ -54,3 +54,3 @@ <p align="center"> | ||
|-----------------------|-------------|---------------------| | ||
|[`useClickOutside`](./docs/use-click-outside.md)|Tracks the clicks outside of the element and adds a new lifecyle callback **clickOutside**.|`clickOutside`| | ||
|[`useClickOutside`](./docs/use-click-outside.md)|Tracks the clicks outside of the element and adds a new lifecycle callback **clickOutside**.|`clickOutside`| | ||
|[`useHover`](./docs/use-hover.md)|Tracks the user's mouse movements over an element and adds **mouseEnter** and **mouseLeave** callbacks to your controller.|`mouseEnter` `mouseLeave`| | ||
@@ -60,5 +60,6 @@ |[`useIdle`](./docs/use-idle.md)| Tracks if the user is idle on your page and adds **away** and **back** callbacks to your controller.|`away`</br> `back`| | ||
|[`useMutation`](./docs/use-mutation.md) | Tracks mutations on an element, its attributes and/or subtree. Adds a **mutate** callback to your controller.|`mutate`| | ||
|[`useResize`](./docs/use-resize.md)|Tracks the element's size and adds a new lifecyle callback **resize**.|`resize`| | ||
|[`useResize`](./docs/use-resize.md)|Tracks the element's size and adds a new lifecycle callback **resize**.|`resize`| | ||
|[`useTargetMutation`](./docs/use-target-mutation.md) | Tracks when targets are added or removed from the controller's scope, or their contents changed. Adds **[target]TargetAdded** , **[target]TargetRemoved** and **[target]TargetChanged** callback to your controller for each specified target.| `[target]TargetAdded` `[target]TargetRemoved` `[target]TargetChanged`| | ||
|[`useVisibility`](./docs/use-visibility.md) </br>| Tracks the page visibility and adds **visible**, **invisible** callbacks to your controller.|`visible`</br> `invisible`| | ||
|[`useWindowResize`](./docs/use-window-resize.md)| Tracks the size of the `window` object and adds a new lifecyle callback **windowResize**.|`windowResize`| | ||
|[`useWindowResize`](./docs/use-window-resize.md)| Tracks the size of the `window` object and adds a new lifecycle callback **windowResize**.|`windowResize`| | ||
@@ -65,0 +66,0 @@ ### Optimization |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
252572
205
1683
183