/*! For license information please see camus-536eaa00.1747852246895.Chunk.min.mjs.LICENSE.txt */ (self.webpackChunkmilenio_assets_bundle=self.webpackChunkmilenio_assets_bundle||[]).push([[8],{172:function(e,t,n){"use strict";n.r(t),n.d(t,{Component:function(){return C},Fragment:function(){return A},cloneElement:function(){return Y},createContext:function(){return J},createElement:function(){return w},createRef:function(){return k},h:function(){return w},hydrate:function(){return q},isValidElement:function(){return o},options:function(){return s},render:function(){return W},toChildArray:function(){return L}});var r,s,i,o,c,a,l,u,h,d,f,p,m,v={},g=[],b=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_=Array.isArray;function y(e,t){for(var n in t)e[n]=t[n];return e}function O(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function w(e,t,n){var s,i,o,c={};for(o in t)"key"==o?s=t[o]:"ref"==o?i=t[o]:c[o]=t[o];if(arguments.length>2&&(c.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)null==c[o]&&(c[o]=e.defaultProps[o]);return E(e,c,s,i,null)}function E(e,t,n,r,o){var c={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++i:o,__i:-1,__u:0};return null==o&&null!=s.vnode&&s.vnode(c),c}function k(){return{current:null}}function A(e){return e.children}function C(e,t){this.props=e,this.context=t}function M(e,t){if(null==t)return e.__?M(e.__,e.__i+1):null;for(var n;tl&&c.sort(u),e=c.shift(),l=c.length,e.__d&&(n=void 0,i=(r=(t=e).__v).__e,o=[],a=[],t.__P&&((n=y({},r)).__v=r.__v+1,s.vnode&&s.vnode(n),V(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[i]:null,o,null==i?M(r):i,!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,I(o,n,a),n.__e!=i&&x(n)));S.__r=0}function F(e,t,n,r,s,i,o,c,a,l,u){var h,d,f,p,m,b,_=r&&r.__k||g,y=t.length;for(a=N(n,t,_,a,y),h=0;h0?E(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,c=null,-1!=(l=o.__i=j(o,n,a,h))&&(h--,(c=n[l])&&(c.__u|=2)),null==c||null==c.__v?(-1==l&&(s>u?d--:sa?d--:d++,o.__u|=4))):e.__k[i]=null;if(h)for(i=0;i(null==a||2&a.__u?0:1))for(s=n-1,i=n+1;s>=0||i=0){if((a=t[s])&&!(2&a.__u)&&o==a.key&&c==a.type)return s;s--}if(i0?e:_(e)?e.map(U):y({},e)}function K(e,t,n,i,o,c,a,l,u){var h,d,f,p,m,g,b,y=n.props,w=t.props,E=t.type;if("svg"==E?o="http://www.w3.org/2000/svg":"math"==E?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=c)for(h=0;h2&&(a.children=arguments.length>3?r.call(arguments,2):n),E(e.type,a,s||e.key,i||e.ref,null)}function J(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach((function(e){e.__e=!0,$(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+m++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}r=g.slice,s={__e:function(e,t,n,r){for(var s,i,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&null!=i.getDerivedStateFromError&&(s.setState(i.getDerivedStateFromError(e)),o=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e,r||{}),o=s.__d),o)return s.__E=s}catch(t){e=t}throw e}},i=0,o=function(e){return null!=e&&null==e.constructor},C.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=y({},this.state),"function"==typeof e&&(e=e(y({},n),this.props)),e&&y(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),$(this))},C.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$(this))},C.prototype.render=A,c=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=function(e,t){return e.__v.__b-t.__v.__b},S.__r=0,h=/(PointerCapture)$|Capture$/i,d=0,f=P(!1),p=P(!0),m=0},201:function(e,t,n){"use strict";n.r(t),n.d(t,{Fragment:function(){return r.Fragment},jsx:function(){return l},jsxAttr:function(){return f},jsxDEV:function(){return l},jsxEscape:function(){return p},jsxTemplate:function(){return u},jsxs:function(){return l}});var r=n(172),s=/["&<]/;function i(e){if(0===e.length||!1===s.test(e))return e;for(var t=0,n=0,r="",i="";n'},Object.defineProperty(e,"__esModule",{value:!0})}(t)},1864:function(e,t,n){"use strict";n.r(t),n.d(t,{Signal:function(){return V},batch:function(){return $},computed:function(){return z},effect:function(){return Q},signal:function(){return I},untracked:function(){return F},useComputed:function(){return ne},useSignal:function(){return te},useSignalEffect:function(){return re}});var r,s,i,o,c=n(172),a=0,l=[],u=c.options,h=u.__b,d=u.__r,f=u.diffed,p=u.__c,m=u.unmount,v=u.__;function g(e,t){u.__h&&u.__h(s,e,a||t),a=0;var n=s.__H||(s.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function b(e,t){var n=g(r++,3);!u.__s&&C(n.__H,t)&&(n.__=e,n.u=t,s.__H.__h.push(n))}function _(e){return a=5,y((function(){return{current:e}}),[])}function y(e,t){var n=g(r++,7);return C(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function O(){for(var e;e=l.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(k),e.__H.__h.forEach(A),e.__H.__h=[]}catch(t){e.__H.__h=[],u.__e(t,e.__v)}}u.__b=function(e){s=null,h&&h(e)},u.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),v&&v(e,t)},u.__r=function(e){d&&d(e),r=0;var t=(s=e.__c).__H;t&&(i===s?(t.__h=[],s.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(k),t.__h.forEach(A),t.__h=[],r=0)),i=s},u.diffed=function(e){f&&f(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==l.push(t)&&o===u.requestAnimationFrame||((o=u.requestAnimationFrame)||E)(O)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),i=s=null},u.__c=function(e,t){t.some((function(e){try{e.__h.forEach(k),e.__h=e.__h.filter((function(e){return!e.__||A(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],u.__e(n,e.__v)}})),p&&p(e,t)},u.unmount=function(e){m&&m(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{k(e)}catch(e){t=e}})),n.__H=void 0,t&&u.__e(t,n.__v))};var w="function"==typeof requestAnimationFrame;function E(e){var t,n=function(){clearTimeout(r),w&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);w&&(t=requestAnimationFrame(n))}function k(e){var t=s,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),s=t}function A(e){var t=s;e.__c=e.__(),s=t}function C(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}var M=Symbol.for("preact-signals");function x(){if(j>1)j--;else{for(var e,t=!1;void 0!==L;){var n=L;for(L=void 0,D++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&U(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(D=0,j--,t)throw e}}function $(e){if(j>0)return e();j++;try{return e()}finally{x()}}var S=void 0;function F(e){var t=S;S=void 0;try{return e()}finally{S=t}}var N,T,L=void 0,j=0,D=0,B=0;function P(e){if(void 0!==S){var t=e.n;if(void 0===t||t.t!==S)return t={i:0,S:e,p:S.s,n:void 0,t:S,e:void 0,x:void 0,r:t},void 0!==S.s&&(S.s.n=t),S.s=t,e.n=t,32&S.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=S.s,t.n=void 0,S.s.n=t,S.s=t),t}}function V(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function I(e){return new V(e)}function U(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function K(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function R(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function H(e){V.call(this,void 0),this.x=e,this.s=void 0,this.g=B-1,this.f=4}function z(e){return new H(e)}function W(e){var t=e.u;if(e.u=void 0,"function"==typeof t){j++;var n=S;S=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,q(e),t}finally{S=n,x()}}}function q(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,W(e)}function Y(e){if(S!==this)throw new Error("Out-of-order effect");R(this),S=e,this.f&=-2,8&this.f&&q(this),x()}function J(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function Q(e){var t=new J(e);try{t.c()}catch(e){throw t.d(),e}return t.d.bind(t)}function Z(e,t){c.options[e]=t.bind(null,c.options[e]||function(){})}function G(e){T&&T(),T=e&&e.S()}function X(e){var t=this,n=e.data,r=te(n);r.value=n;var s=y((function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e;(0,c.isValidElement)(s.peek())||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=s.peek()},z((function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""}))}),[]);return s.value}function ee(e,t,n,r){var s=t in e&&void 0===e.ownerSVGElement,i=I(n);return{o:function(e,t){i.value=e,r=t},d:Q((function(){var n=i.value.value;r[t]!==n&&(r[t]=n,s?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))}))}}function te(e){return y((function(){return I(e)}),[])}function ne(e){var t=_(e);return t.current=e,N.__$f|=4,y((function(){return z((function(){return t.current()}))}),[])}function re(e){var t=_(e);t.current=e,b((function(){return Q((function(){return t.current()}))}),[])}V.prototype.brand=M,V.prototype.h=function(){return!0},V.prototype.S=function(e){this.t!==e&&void 0===e.e&&(e.x=this.t,void 0!==this.t&&(this.t.e=e),this.t=e)},V.prototype.U=function(e){if(void 0!==this.t){var t=e.e,n=e.x;void 0!==t&&(t.x=n,e.e=void 0),void 0!==n&&(n.e=t,e.x=void 0),e===this.t&&(this.t=n)}},V.prototype.subscribe=function(e){var t=this;return Q((function(){var n=t.value,r=S;S=void 0;try{e(n)}finally{S=r}}))},V.prototype.valueOf=function(){return this.value},V.prototype.toString=function(){return this.value+""},V.prototype.toJSON=function(){return this.value},V.prototype.peek=function(){var e=S;S=void 0;try{return this.value}finally{S=e}},Object.defineProperty(V.prototype,"value",{get:function(){var e=P(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(D>100)throw new Error("Cycle detected");this.v=e,this.i++,B++,j++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{x()}}}}),(H.prototype=new V).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===B)return!0;if(this.g=B,this.f|=1,this.i>0&&!U(this))return this.f&=-2,!0;var e=S;try{K(this),S=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return S=e,R(this),this.f&=-2,!0},H.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}V.prototype.S.call(this,e)},H.prototype.U=function(e){if(void 0!==this.t&&(V.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},H.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(H.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=P(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),J.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},J.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,W(this),K(this),j++;var e=S;return S=this,Y.bind(this,e)},J.prototype.N=function(){2&this.f||(this.f|=2,this.o=L,L=this)},J.prototype.d=function(){this.f|=8,1&this.f||q(this)},X.displayName="_st",Object.defineProperties(V.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:X},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),Z("__b",(function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var s in r)if("children"!==s){var i=r[s];i instanceof V&&(n||(t.__np=n={}),n[s]=i,r[s]=i.peek())}}e(t)})),Z("__r",(function(e,t){G();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(){var e;return Q((function(){e=this})),e.c=function(){r.__$f|=1,r.setState({})},e}())),N=r,G(n),e(t)})),Z("__e",(function(e,t,n,r){G(),N=void 0,e(t,n,r)})),Z("diffed",(function(e,t){var n;if(G(),N=void 0,"string"==typeof t.type&&(n=t.__e)){var r=t.__np,s=t.props;if(r){var i=n.U;if(i)for(var o in i){var c=i[o];void 0===c||o in r||(c.d(),i[o]=void 0)}else n.U=i={};for(var a in r){var l=i[a],u=r[a];void 0===l?(l=ee(n,a,u,s),i[a]=l):l.o(u,s)}}}e(t)})),Z("unmount",(function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var s in n.U=void 0,r){var i=r[s];i&&i.d()}}}else{var o=t.__c;if(o){var c=o.__$u;c&&(o.__$u=void 0,c.d())}}e(t)})),Z("__h",(function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)})),c.Component.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var r in t)return!0;for(var s in e)if("__source"!==s&&e[s]!==this.props[s])return!0;for(var i in this.props)if(!(i in e))return!0;return!1}},2891:function(e,t,n){"use strict";n.r(t),n.d(t,{Application:function(){return te},AttributeObserver:function(){return O},Context:function(){return V},Controller:function(){return he},ElementObserver:function(){return y},IndexedMultimap:function(){return M},Multimap:function(){return C},SelectorObserver:function(){return x},StringMapObserver:function(){return $},TokenListObserver:function(){return S},ValueListObserver:function(){return F},add:function(){return w},defaultSchema:function(){return X},del:function(){return E},fetch:function(){return k},prune:function(){return A}});class r{constructor(e,t,n){this.eventTarget=e,this.eventName=t,this.eventOptions=n,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){const t=function(e){if("immediatePropagationStopped"in e)return e;{const{stopImmediatePropagation:t}=e;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}(e);for(const e of this.bindings){if(t.immediatePropagationStopped)break;e.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort(((e,t)=>{const n=e.index,r=t.index;return nr?1:0}))}}class s{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach((e=>e.connect())))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach((e=>e.disconnect())))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce(((e,t)=>e.concat(Array.from(t.values()))),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,n={}){this.application.handleError(e,`Error ${t}`,n)}clearEventListenersForBinding(e){const t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){const{eventTarget:t,eventName:n,eventOptions:r}=e,s=this.fetchEventListenerMapForEventTarget(t),i=this.cacheKey(n,r);s.delete(i),0==s.size&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){const{eventTarget:t,eventName:n,eventOptions:r}=e;return this.fetchEventListener(t,n,r)}fetchEventListener(e,t,n){const r=this.fetchEventListenerMapForEventTarget(e),s=this.cacheKey(t,n);let i=r.get(s);return i||(i=this.createEventListener(e,t,n),r.set(s,i)),i}createEventListener(e,t,n){const s=new r(e,t,n);return this.started&&s.connect(),s}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){const n=[e];return Object.keys(t).sort().forEach((e=>{n.push(`${t[e]?"":"!"}${e}`)})),n.(":")}}const i={stop({event:e,value:t}){return t&&e.stopPropagation(),!0},prevent({event:e,value:t}){return t&&e.preventDefault(),!0},self({event:e,value:t,element:n}){return!t||n===e.target}},o=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function c(e){return"window"==e?window:"document"==e?document:void 0}function a(e){return e.replace(/(?:[_-])([a-z0-9])/g,((e,t)=>t.toUpperCase()))}function l(e){return a(e.replace(/--/g,"-").replace(/__/g,"_"))}function u(e){return e.charAt(0).toUpperCase()+e.slice(1)}function h(e){return e.replace(/([A-Z])/g,((e,t)=>`-${t.toLowerCase()}`))}function d(e){return null!=e}function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const p=["meta","ctrl","alt","shift"];class m{constructor(e,t,n,r){this.element=e,this.index=t,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||function(e){const t=e.tagName.toLowerCase();if(t in v)return v[t](e)}(e)||g("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||g("missing identifier"),this.methodName=n.methodName||g("missing method name"),this.keyFilter=n.keyFilter||"",this.schema=r}static forToken(e,t){return new this(e.element,e.index,function(e){const t=e.trim().match(o)||[];let n=t[2],r=t[3];return r&&!["keydown","keyup","keypress"].includes(n)&&(n+=`.${r}`,r=""),{eventTarget:c(t[4]),eventName:n,eventOptions:t[7]?(s=t[7],s.split(":").reduce(((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)})),{})):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||r};var s}(e.content),t)}toString(){const e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;const t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;const n=t.filter((e=>!p.includes(e)))[0];return!!n&&(f(this.keyMappings,n)||g(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[n].toLowerCase()!==e.key.toLowerCase())}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;const t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){const e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:n,value:r}of Array.from(this.element.attributes)){const s=n.match(t),i=s&&s[1];i&&(e[a(i)]=b(r))}return e}get eventTargetName(){return(e=this.eventTarget)==window?"window":e==document?"document":void 0;var e}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){const[n,r,s,i]=p.map((e=>t.includes(e)));return e.metaKey!==n||e.ctrlKey!==r||e.altKey!==s||e.shiftKey!==i}}const v={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:e=>"submit"==e.getAttribute("type")?"click":"input",select:()=>"change",textarea:()=>"input"};function g(e){throw new Error(e)}function b(e){try{return JSON.parse(e)}catch(t){return e}}class _{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){const t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){const e=this.controller[this.methodName];if("function"==typeof e)return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){const{element:t}=this.action,{actionDescriptorFilters:n}=this.context.application,{controller:r}=this.context;let s=!0;for(const[i,o]of Object.entries(this.eventOptions))if(i in n){const c=n[i];s=s&&c({name:i,value:o,event:e,element:t,controller:r})}return s}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){const{target:t,currentTarget:n}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:n,action:this.methodName})}catch(t){const{identifier:n,controller:r,element:s,index:i}=this,o={identifier:n,controller:r,element:s,index:i,event:e};this.context.handleError(t,`invoking action "${this.action}"`,o)}}willBeInvokedByEvent(e){const t=e.target;return!(e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e))&&(!(e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e))&&(this.element===t||(t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element))))}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}}class y{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){const e=new Set(this.matchElementsInTree());for(const t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(const t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){"attributes"==e.type?this.processAttributeChange(e.target,e.attributeName):"childList"==e.type&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.processTree(e,this.removeElement)}}processAddedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.elementIsActive(e)&&this.processTree(e,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(const n of this.matchElementsInTree(e))t.call(this,n)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}}class O{constructor(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new y(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){const t=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector));return t.concat(n)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}}function w(e,t,n){k(e,t).add(n)}function E(e,t,n){k(e,t).delete(n),A(e,t)}function k(e,t){let n=e.get(t);return n||(n=new Set,e.set(t,n)),n}function A(e,t){const n=e.get(t);null!=n&&0==n.size&&e.delete(t)}class C{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce(((e,t)=>e.concat(Array.from(t))),[])}get size(){return Array.from(this.valuesByKey.values()).reduce(((e,t)=>e+t.size),0)}add(e,t){w(this.valuesByKey,e,t)}delete(e,t){E(this.valuesByKey,e,t)}has(e,t){const n=this.valuesByKey.get(e);return null!=n&&n.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some((t=>t.has(e)))}getValuesForKey(e){const t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter((([t,n])=>n.has(e))).map((([e,t])=>e))}}class M extends C{constructor(){super(),this.keysByValue=new Map}get values(){return Array.from(this.keysByValue.keys())}add(e,t){super.add(e,t),w(this.keysByValue,t,e)}delete(e,t){super.delete(e,t),E(this.keysByValue,t,e)}hasValue(e){return this.keysByValue.has(e)}getKeysForValue(e){const t=this.keysByValue.get(e);return t?Array.from(t):[]}}class x{constructor(e,t,n,r){this._selector=t,this.details=r,this.elementObserver=new y(e,this),this.delegate=n,this.matchesByElement=new C}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){const{selector:t}=this;if(t){const n=e.matches(t);return this.delegate.selectorMatchElement?n&&this.delegate.selectorMatchElement(e,this.details):n}return!1}matchElementsInTree(e){const{selector:t}=this;if(t){const n=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(t)).filter((e=>this.matchElement(e)));return n.concat(r)}return[]}elementMatched(e){const{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){const t=this.matchesByElement.getKeysForValue(e);for(const n of t)this.selectorUnmatched(e,n)}elementAttributeChanged(e,t){const{selector:n}=this;if(n){const t=this.matchElement(e),r=this.matchesByElement.has(n,e);t&&!r?this.selectorMatched(e,n):!t&&r&&this.selectorUnmatched(e,n)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}}class ${constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver((e=>this.processMutations(e)))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(const e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){const t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){const n=this.delegate.getStringMapKeyForAttribute(e);if(null!=n){this.stringMap.has(e)||this.stringMapKeyAdded(n,e);const r=this.element.getAttribute(e);if(this.stringMap.get(e)!=r&&this.stringMapValueChanged(r,n,t),null==r){const t=this.stringMap.get(e);this.stringMap.delete(e),t&&this.stringMapKeyRemoved(n,e,t)}else this.stringMap.set(e,r)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,n){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,n)}stringMapKeyRemoved(e,t,n){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,n)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map((e=>e.name))}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class S{constructor(e,t,n){this.attributeObserver=new O(e,t,this),this.delegate=n,this.tokensByElement=new C}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){const[t,n]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(n)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach((e=>this.tokenMatched(e)))}tokensUnmatched(e){e.forEach((e=>this.tokenUnmatched(e)))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){const t=this.tokensByElement.getValuesForKey(e),n=this.readTokensForElement(e),r=function(e,t){const n=Math.max(e.length,t.length);return Array.from({length:n},((n,r)=>[e[r],t[r]]))}(t,n).findIndex((([e,t])=>{return r=t,!((n=e)&&r&&n.index==r.index&&n.content==r.content);var n,r}));return-1==r?[[],[]]:[t.slice(r),n.slice(r)]}readTokensForElement(e){const t=this.attributeName;return function(e,t,n){return e.trim().split(/\s+/).filter((e=>e.length)).map(((e,r)=>({element:t,attributeName:n,content:e,index:r})))}(e.getAttribute(t)||"",e,t)}}class F{constructor(e,t,n){this.tokenListObserver=new S(e,t,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).set(e,n),this.delegate.elementMatchedValue(t,n))}tokenUnmatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,n))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}}}class N{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new F(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){const t=new _(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){const t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach((e=>this.delegate.bindingDisconnected(e,!0))),this.bindingsByAction.clear()}parseValueForToken(e){const t=m.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}}class T{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new $(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){const n=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,n.writer(this.receiver[e]),n.writer(n.defaultValue))}stringMapValueChanged(e,t,n){const r=this.valueDescriptorNameMap[t];null!==e&&(null===n&&(n=r.writer(r.defaultValue)),this.invokeChangedCallback(t,e,n))}stringMapKeyRemoved(e,t,n){const r=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,r.writer(this.receiver[e]),n):this.invokeChangedCallback(e,r.writer(r.defaultValue),n)}invokeChangedCallbacksForDefaultValues(){for(const{key:e,name:t,defaultValue:n,writer:r}of this.valueDescriptors)null==n||this.controller.data.has(e)||this.invokeChangedCallback(t,r(n),void 0)}invokeChangedCallback(e,t,n){const r=`${e}Changed`,s=this.receiver[r];if("function"==typeof s){const r=this.valueDescriptorNameMap[e];try{const e=r.reader(t);let i=n;n&&(i=r.reader(n)),s.call(this.receiver,e,i)}catch(e){throw e instanceof TypeError&&(e.message=`Stimulus Value "${this.context.identifier}.${r.name}" - ${e.message}`),e}}}get valueDescriptors(){const{valueDescriptorMap:e}=this;return Object.keys(e).map((t=>e[t]))}get valueDescriptorNameMap(){const e={};return Object.keys(this.valueDescriptorMap).forEach((t=>{const n=this.valueDescriptorMap[t];e[n.name]=n})),e}hasValue(e){const t=`has${u(this.valueDescriptorNameMap[e].name)}`;return this.receiver[t]}}class L{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new C}start(){this.tokenListObserver||(this.tokenListObserver=new S(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var n;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause((()=>this.delegate.targetConnected(e,t))))}disconnectTarget(e,t){var n;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause((()=>this.delegate.targetDisconnected(e,t))))}disconnectAllTargets(){for(const e of this.targetsByName.keys)for(const t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function j(e,t){const n=B(e);return Array.from(n.reduce(((e,n)=>(function(e,t){const n=e[t];return Array.isArray(n)?n:[]}(n,t).forEach((t=>e.add(t))),e)),new Set))}function D(e,t){return B(e).reduce(((e,n)=>(e.push(...function(e,t){const n=e[t];return n?Object.keys(n).map((e=>[e,n[e]])):[]}(n,t)),e)),[])}function B(e){const t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}class P{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new C,this.outletElementsByName=new C,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach((e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)})),this.started=!0,this.dependentContexts.forEach((e=>e.refresh())))}refresh(){this.selectorObserverMap.forEach((e=>e.refresh())),this.attributeObserverMap.forEach((e=>e.refresh()))}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach((e=>e.stop())),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach((e=>e.stop())),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:n}){const r=this.getOutlet(e,n);r&&this.connectOutlet(r,e,n)}selectorUnmatched(e,t,{outletName:n}){const r=this.getOutletFromMap(e,n);r&&this.disconnectOutlet(r,e,n)}selectorMatchElement(e,{outletName:t}){const n=this.selector(t),r=this.hasOutlet(e,t),s=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return!!n&&(r&&s&&e.matches(n))}elementMatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementAttributeValueChanged(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementUnmatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}connectOutlet(e,t,n){var r;this.outletElementsByName.has(n,t)||(this.outletsByName.add(n,e),this.outletElementsByName.add(n,t),null===(r=this.selectorObserverMap.get(n))||void 0===r||r.pause((()=>this.delegate.outletConnected(e,t,n))))}disconnectOutlet(e,t,n){var r;this.outletElementsByName.has(n,t)&&(this.outletsByName.delete(n,e),this.outletElementsByName.delete(n,t),null===(r=this.selectorObserverMap.get(n))||void 0===r||r.pause((()=>this.delegate.outletDisconnected(e,t,n))))}disconnectAllOutlets(){for(const e of this.outletElementsByName.keys)for(const t of this.outletElementsByName.getValuesForKey(e))for(const n of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(n,t,e)}updateSelectorObserverForOutlet(e){const t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){const t=this.selector(e),n=new x(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,n),n.start()}setupAttributeObserverForOutlet(e){const t=this.attributeNameForOutletName(e),n=new O(this.scope.element,t,this);this.attributeObserverMap.set(e,n),n.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find((t=>this.attributeNameForOutletName(t)===e))}get outletDependencies(){const e=new C;return this.router.modules.forEach((t=>{j(t.definition.controllerConstructor,"outlets").forEach((n=>e.add(n,t.identifier)))})),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const e=this.dependentControllerIdentifiers;return this.router.contexts.filter((t=>e.includes(t.identifier)))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find((t=>t.element===e))}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}}class V{constructor(e,t){this.logDebugActivity=(e,t={})=>{const{identifier:n,controller:r,element:s}=this;t=Object.assign({identifier:n,controller:r,element:s},t),this.application.logDebugActivity(this.identifier,e,t)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new N(this,this.dispatcher),this.valueObserver=new T(this,this.controller),this.targetObserver=new L(this,this),this.outletObserver=new P(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(e){this.handleError(e,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,n={}){const{identifier:r,controller:s,element:i}=this;n=Object.assign({identifier:r,controller:s,element:i},n),this.application.handleError(e,`Error ${t}`,n)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,n){this.invokeControllerMethod(`${l(n)}OutletConnected`,e,t)}outletDisconnected(e,t,n){this.invokeControllerMethod(`${l(n)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){const n=this.controller;"function"==typeof n[e]&&n[e](...t)}}function I(e){return function(e,t){const n=K(e),r=function(e,t){return U(t).reduce(((n,r)=>{const s=function(e,t,n){const r=Object.getOwnPropertyDescriptor(e,n);if(!r||!("value"in r)){const e=Object.getOwnPropertyDescriptor(t,n).value;return r&&(e.get=r.get||e.get,e.set=r.set||e.set),e}}(e,t,r);return s&&Object.assign(n,{[r]:s}),n}),{})}(e.prototype,t);return Object.defineProperties(n.prototype,r),n}(e,function(e){const t=j(e,"blessings");return t.reduce(((t,n)=>{const r=n(e);for(const e in r){const n=t[e]||{};t[e]=Object.assign(n,r[e])}return t}),{})}(e))}const U="function"==typeof Object.getOwnPropertySymbols?e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]:Object.getOwnPropertyNames,K=(()=>{function e(e){function t(){return Reflect.construct(e,arguments,new.target)}return t.prototype=Object.create(e.prototype,{constructor:{value:t}}),Reflect.setPrototypeOf(t,e),t}try{return function(){const t=e((function(){this.a.call(this)}));t.prototype.a=function(){},new t}(),e}catch(e){return e=>class extends e{}}})();class R{constructor(e,t){this.application=e,this.definition=function(e){return{identifier:e.identifier,controllerConstructor:I(e.controllerConstructor)}}(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){const t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){const t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new V(this,e),this.contextsByScope.set(e,t)),t}}class H{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){const t=this.data.get(this.getDataKey(e))||"";return t.match(/[^\s]+/g)||[]}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}}class z{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){const t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){const n=this.getAttributeNameForKey(e);return this.element.setAttribute(n,t),this.get(e)}has(e){const t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){const t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${h(e)}`}}class W{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,n){let r=this.warnedKeysByObject.get(e);r||(r=new Set,this.warnedKeysByObject.set(e,r)),r.has(t)||(r.add(t),this.logger.warn(n,e))}}function q(e,t){return`[${e}~="${t}"]`}class Y{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findTarget(t)||this.findLegacyTarget(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllTargets(t),...this.findAllLegacyTargets(t)]),[])}findTarget(e){const t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){const t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){return q(this.schema.targetAttributeForScope(this.identifier),e)}findLegacyTarget(e){const t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){const t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map((t=>this.deprecate(t,e)))}getLegacySelectorForTargetName(e){const t=`${this.identifier}.${e}`;return q(this.schema.targetAttribute,t)}deprecate(e,t){if(e){const{identifier:n}=this,r=this.schema.targetAttribute,s=this.schema.targetAttributeForScope(n);this.guide.warn(e,`target:${t}`,`Please replace ${r}="${n}.${t}" with ${s}="${t}". The ${r} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}}class J{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce(((e,t)=>e||this.findOutlet(t)),void 0)}findAll(...e){return e.reduce(((e,t)=>[...e,...this.findAllOutlets(t)]),[])}getSelectorForOutletName(e){const t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){const t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){const t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter((n=>this.matchesElement(n,e,t)))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter((n=>this.matchesElement(n,e,t)))}matchesElement(e,t,n){const r=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&r.split(" ").includes(n)}}class Q{constructor(e,t,n,r){this.targets=new Y(this),this.classes=new H(this),this.data=new z(this),this.containsElement=e=>e.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=n,this.guide=new W(r),this.outlets=new J(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return q(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new Q(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class Z{constructor(e,t,n){this.element=e,this.schema=t,this.delegate=n,this.valueListObserver=new F(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){const{element:t,content:n}=e;return this.parseValueForElementAndIdentifier(t,n)}parseValueForElementAndIdentifier(e,t){const n=this.fetchScopesByIdentifierForElement(e);let r=n.get(t);return r||(r=this.delegate.createScopeForElementAndIdentifier(e,t),n.set(t,r)),r}elementMatchedValue(e,t){const n=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,n),1==n&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){const n=this.scopeReferenceCounts.get(t);n&&(this.scopeReferenceCounts.set(t,n-1),1==n&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}}class G{constructor(e){this.application=e,this.scopeObserver=new Z(this.element,this.schema,this),this.scopesByIdentifier=new C,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce(((e,t)=>e.concat(t.contexts)),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);const t=new R(this.application,e);this.connectModule(t);const n=e.controllerConstructor.afterLoad;n&&n.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){const t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){const n=this.modulesByIdentifier.get(t);if(n)return n.contexts.find((t=>t.element==e))}proposeToConnectScopeForElementAndIdentifier(e,t){const n=this.scopeObserver.parseValueForElementAndIdentifier(e,t);n?this.scopeObserver.elementMatchedValue(n.element,n):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,n){this.application.handleError(e,t,n)}createScopeForElementAndIdentifier(e,t){return new Q(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e);this.scopesByIdentifier.getValuesForKey(e.identifier).forEach((t=>e.connectContextForScope(t)))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier);this.scopesByIdentifier.getValuesForKey(e.identifier).forEach((t=>e.disconnectContextForScope(t)))}}const X={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:e=>`data-${e}-target`,outletAttributeForScope:(e,t)=>`data-${e}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},ee("abcdefghijklmnopqrstuvwxyz".split("").map((e=>[e,e])))),ee("0123456789".split("").map((e=>[e,e]))))};function ee(e){return e.reduce(((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n})),{})}class te{constructor(e=document.documentElement,t=X){this.logger=console,this.debug=!1,this.logDebugActivity=(e,t,n={})=>{this.debug&&this.logFormattedMessage(e,t,n)},this.element=e,this.schema=t,this.dispatcher=new s(this),this.router=new G(this),this.actionDescriptorFilters=Object.assign({},i)}static start(e,t){const n=new this(e,t);return n.start(),n}async start(){await new Promise((e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",(()=>e())):e()})),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}(e,t){this.load({identifier:e,controllerConstructor:t})}ActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach((e=>{e.controllerConstructor.shouldLoad&&this.router.loadDefinition(e)}))}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach((e=>this.router.unloadIdentifier(e)))}get controllers(){return this.router.contexts.map((e=>e.controller))}getControllerForElementAndIdentifier(e,t){const n=this.router.getContextForElementAndIdentifier(e,t);return n?n.controller:null}handleError(e,t,n){var r;this.logger.error("%s\n\n%o\n\n%o",t,e,n),null===(r=window.onerror)||void 0===r||r.call(window,t,"",0,0,e)}logFormattedMessage(e,t,n={}){n=Object.assign({application:this},n),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},n)),this.logger.groupEnd()}}function ne(e,t,n){return e.application.getControllerForElementAndIdentifier(t,n)}function re(e,t,n){let r=ne(e,t,n);return r||(e.application.router.proposeToConnectScopeForElementAndIdentifier(t,n),r=ne(e,t,n),r||void 0)}function se([e,t],n){return function(e){const{token:t,typeDefinition:n}=e,r=`${h(t)}-value`,s=function(e){const{controller:t,token:n,typeDefinition:r}=e,s={controller:t,token:n,typeObject:r},i=function(e){const{controller:t,token:n,typeObject:r}=e,s=d(r.type),i=d(r.default),o=s&&i,c=s&&!i,a=!s&&i,l=ie(r.type),u=oe(e.typeObject.default);if(c)return l;if(a)return u;if(l!==u){throw new Error(`The specified default value for the Stimulus Value "${t?`${t}.${n}`:n}" must match the defined type "${l}". The provided default value of "${r.default}" is of type "${u}".`)}if(o)return l}(s),o=oe(r),c=ie(r),a=i||o||c;if(a)return a;const l=t?`${t}.${r}`:n;throw new Error(`Unknown value type "${l}" for "${n}" value`)}(e);return{type:s,key:r,name:a(r),get defaultValue(){return function(e){const t=ie(e);if(t)return ce[t];const n=f(e,"default"),r=f(e,"type"),s=e;if(n)return s.default;if(r){const{type:e}=s,t=ie(e);if(t)return ce[t]}return e}(n)},get hasCustomDefaultValue(){return void 0!==oe(n)},reader:ae[s],writer:le[s]||le.default}}({controller:n,token:e,typeDefinition:t})}function ie(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function oe(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(e)?"array":"[object Object]"===Object.prototype.toString.call(e)?"object":void 0}const ce={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},ae={array(e){const t=JSON.parse(e);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${e}" of type "${oe(t)}"`);return t},boolean(e){return!("0"==e||"false"==String(e).toLowerCase())},number(e){return Number(e.replace(/_/g,""))},object(e){const t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${e}" of type "${oe(t)}"`);return t},string(e){return e}},le={default:function(e){return`${e}`},array:ue,object:ue};function ue(e){return JSON.stringify(e)}class he{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:n={},prefix:r=this.identifier,bubbles:s=!0,cancelable:i=!0}={}){const o=new CustomEvent(r?`${r}:${e}`:e,{detail:n,bubbles:s,cancelable:i});return t.dispatchEvent(o),o}}he.blessings=[function(e){return j(e,"classes").reduce(((e,t)=>{return Object.assign(e,(n=t,{[`${n}Class`]:{get(){const{classes:e}=this;if(e.has(n))return e.get(n);{const t=e.getAttributeName(n);throw new Error(`Missing attribute "${t}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${u(n)}Class`]:{get(){return this.classes.has(n)}}}));var n}),{})},function(e){return j(e,"targets").reduce(((e,t)=>{return Object.assign(e,(n=t,{[`${n}Target`]:{get(){const e=this.targets.find(n);if(e)return e;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${u(n)}Target`]:{get(){return this.targets.has(n)}}}));var n}),{})},function(e){const t=D(e,"values"),n={valueDescriptorMap:{get(){return t.reduce(((e,t)=>{const n=se(t,this.identifier),r=this.data.getAttributeNameForKey(n.key);return Object.assign(e,{[r]:n})}),{})}}};return t.reduce(((e,t)=>Object.assign(e,function(e,t){const n=se(e,t),{key:r,name:s,reader:i,writer:o}=n;return{[s]:{get(){const e=this.data.get(r);return null!==e?i(e):n.defaultValue},set(e){void 0===e?this.data.delete(r):this.data.set(r,o(e))}},[`has${u(s)}`]:{get(){return this.data.has(r)||n.hasCustomDefaultValue}}}}(t))),n)},function(e){return j(e,"outlets").reduce(((e,t)=>Object.assign(e,function(e){const t=l(e);return{[`${t}Outlet`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t){const n=re(this,t,e);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}Outlets`]:{get(){const t=this.outlets.findAll(e);return t.length>0?t.map((t=>{const n=re(this,t,e);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`,t)})).filter((e=>e)):[]}},[`${t}OutletElement`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t)return t;throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(e)}},[`has${u(t)}Outlet`]:{get(){return this.outlets.has(e)}}}}(t))),{})}],he.targets=[],he.outlets=[],he.values={}},4353:function(e){e.exports=function(){"use strict";var e=1e3,t=6e4,n=36e5,r="millisecond",s="second",i="minute",o="hour",c="day",a="week",l="month",u="quarter",h="year",d="date",f="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},g=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).(n)+e},b={s:g,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),s=n%60;return(t<=0?"+":"-")+g(r,2,"0")+":"+g(s,2,"0")},m:function e(t,n){if(t.date()1)return e(o[0])}else{var c=t.name;y[c]=t,s=c}return!r&&s&&(_=s),s||!r&&_},k=function(e,t){if(w(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new C(n)},A=b;A.l=E,A.i=w,A.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var C=function(){function v(e){this.$L=E(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[O]=!0}var g=v.prototype;return g.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(A.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var s=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],s,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(t)}(e),this.init()},g.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},g.$utils=function(){return A},g.isValid=function(){return!(this.$d.toString()===f)},g.isSame=function(e,t){var n=k(e);return this.startOf(t)<=n&&n<=this.endOf(t)},g.isAfter=function(e,t){return k(e)'},Object.defineProperty(e,"__esModule",{value:!0})}(t)},5790:function(e,t,n){"use strict";let r;function s(e,t){return r||(r=function(e){const t="atchesSelector";for(const n of["matches",`m${t}`,`webkitM${t}`,`mozM${t}`,`msM${t}`,`oM${t}`])if(e[n])return n}(e)),e[r](t)}function i(e,t){let n=e;for(;n&&(1!==n.nodeType||!s(n,t));)n=n.parentNode;return n}function o(e,t){if(t&&"object"==typeof t)for(const n in t)e[n]=t[n];return e}function c(e){return"function"==typeof e}function a(e,t,n){const r=n.document,s=r.defaultView,i=function(e){if(e.isCollapsed)return!0;const t=e.anchorNode.compareDocumentPosition(e.focusNode);return t?(4&t)>0:e.anchorOffsete)break;e=n.left}n=s(t+1)}else{let e=-1/0,t=0;for(;te.top))),bottom:Math.max(...n.map((e=>e.bottom))),left:n[0].left,right:n[n.length-1].right}}(t,i),c=function(e){const t=e.document.body;return("static"===e.getComputedStyle(t).position?t.parentNode:t).getBoundingClientRect()}(s),a=e.style;i?a.right=`${r.documentElement.clientWidth-o.right+c.left}px`:a.left=o.left-c.left+"px",a.width=o.right-o.left+"px",a.height=o.bottom-o.top+"px",a.top=o.top-c.top+"px",a.position="absolute",e.className=n.popoverClass}n.r(t),n.d(t,{default:function(){return f}});const l="data-share-via";function u(e){return{createPopover(){const t=e.createElement("div");return t.addEventListener("click",(function(e){!function(e,t){const n=i(t.target,`[${l}]`);if(!n)return;const r=function(e,t){for(let n=0;n{const t=(Object.assign||o)({document:document,selector:"body",sharers:[],popoverClass:"share-this-popover",transformer:e=>e.trim().replace(/\s+/g," ")},e||{});let n=!1,r=!1,s=h,l=h,f=h,p=h;return{init(){return!n&&(s=t.document,l=s.defaultView,l.getSelection?(d.forEach(m),l.addEventListener("resize",g),p=u(s),n=!0):(console.warn("share-this: Selection API isn't ed"),!1))},destroy(){return!(!n||r)&&(d.forEach(v),l.removeEventListener("resize",g),y(),s=h,l=h,r=!0)},reposition(){return f&&a(f,_(),t),!!f}};function m(e){s.addEventListener(e,b)}function v(e){s.removeEventListener(e,b)}function g(){f&&a(f,_(),t)}function b({type:e}){!f!==("selectionchange"===e)&&setTimeout((()=>{if(l){const e=_();e?function(e){const n=!f,r=e.toString(),s=t.transformer(r),i=t.sharers.filter(O.bind(null,s,r));if(!i.length)return void(f&&y());n&&(f=p.createPopover());if(f.sharers=i,f.innerHTML=((e,t,n,r)=>{const s=e.shareUrl||e.document.defaultView.location;return"
    "+t.map((e=>`
  • ${e.render.call(e,n,r,s)}
  • `)).("")+"
"})(t,i,s,r),a(f,e,t),!n)return;p.attachPopover(f),c(t.onOpen)&&t.onOpen(f,s,r)}(e):y()}}),10)}function _(){const e=l.getSelection(),n=e.rangeCount&&e.getRangeAt(0);if(!n)return;const r=function(e,t){const n=e.cloneRange();if(e.collapsed||!t)return n;let r=i(e.startContainer,t);return r?function(e,t){const n=e.compareDocumentPosition(t);return!n||(16&n)>0}(r,e.endContainer)||n.setEnd(r,r.childNodes.length):(r=i(e.endContainer,t),r?n.setStart(r,0):n.collapse()),n}(n,t.selector);return!r.collapsed&&r.getClientRects().length?r:void 0}function y(){f&&(p.removePopover(f),f=h,c(t.onClose)&&t.onClose())}function O(e,t,n){const r=n.active;return c(r)?r(e,t):r===h||r}}},9693:function(e,t,n){"use strict";n.r(t),n.d(t,{ApplicationController:function(){return ne},ClickOutsideController:function(){return W},HoverController:function(){return pe},IdleController:function(){return oe},IntersectionController:function(){return j},LazyLoadController:function(){return P},MutationController:function(){return be},ResizeController:function(){return K},TargetMutationController:function(){return we},TransitionController:function(){return Ue},UseHover:function(){return he},UseMutation:function(){return me},UseTargetMutation:function(){return _e},UseVisibility:function(){return ce},VisibilityController:function(){return ue},WindowFocusController:function(){return Ze},WindowResizeController:function(){return Ae},useApplication:function(){return te},useClickOutside:function(){return H},useDebounce:function(){return $e},useDispatch:function(){return X},useHotkeys:function(){return He},useHover:function(){return de},useIdle:function(){return se},useIntersection:function(){return T},useLazyLoad:function(){return D},useMatchMedia:function(){return qe},useMemo:function(){return Ce},useMeta:function(){return je},useMutation:function(){return ve},esize:function(){return I},useTargetMutation:function(){return ye},useThrottle:function(){return Ne},useTransition:function(){return Pe},useVisibility:function(){return ae},useWindowFocus:function(){return Je},useWindowResize:function(){return Ee}});var r=n(2891),s="undefined"!=typeof navigator&&navigator.Agent.toLowerCase().indexOf("firefox")>0;function i(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r):e.attachEvent&&e.attachEvent("on".concat(t),(function(){n(window.event)}))}function o(e,t){for(var n=t.slice(0,t.length-1),r=0;r=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var a={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":s?173:189,"=":s?61:187,";":s?59:186,"'":222,"[":219,"]":221,"\\":220},l={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},u={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},h={16:!1,18:!1,17:!1,91:!1},d={},f=1;f<20;f++)a["f".concat(f)]=111+f;var p=[],m=!1,v="all",g=[],b=function(e){return a[e.toLowerCase()]||l[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function _(e){v=e||"all"}function y(){return v||"all"}var O=function(e){var t=e.key,n=e.scope,r=e.method,s=e.splitKey,i=void 0===s?"+":s;c(t).forEach((function(e){var t=e.split(i),s=t.length,c=t[s-1],a="*"===c?"*":b(c);if(d[a]){n||(n=y());var u=s>1?o(l,t):[];d[a]=d[a].filter((function(e){return!((!r||e.method===r)&&e.scope===n&&function(e,t){for(var n=e.length>=t.length?e:t,r=e.length>=t.length?t:e,s=!0,i=0;i0,h)Object.prototype.hasOwnProperty.call(h,i)&&(!h[i]&&t.mods.indexOf(+i)>-1||h[i]&&-1===t.mods.indexOf(+i))&&(s=!1);(0!==t.mods.length||h[16]||h[18]||h[17]||h[91])&&!s&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function E(e,t){var n=d["*"],r=e.keyCode||e.which||e.charCode;if(k.filter.call(this,e)){if(93!==r&&224!==r||(r=91),-1===p.indexOf(r)&&229!==r&&p.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(t){var n=u[t];e[t]&&-1===p.indexOf(n)?p.push(n):!e[t]&&p.indexOf(n)>-1?p.splice(p.indexOf(n),1):"metaKey"===t&&e[t]&&3===p.length&&(e.ctrlKey||e.shiftKey||e.altKey||(p=p.slice(p.indexOf(n))))})),r in h){for(var s in h[r]=!0,l)l[s]===r&&(k[s]=!0);if(!n)return}for(var i in h)Object.prototype.hasOwnProperty.call(h,i)&&(h[i]=e[u[i]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===p.indexOf(17)&&p.push(17),-1===p.indexOf(18)&&p.push(18),h[17]=!0,h[18]=!0);var o=y();if(n)for(var c=0;c1&&(s=o(l,e)),(e="*"===(e=e[e.length-1])?"*":b(e))in d||(d[e]=[]),d[e].push({keyup:v,keydown:_,scope:a,mods:s,shortcut:r[f],method:n,key:r[f],splitKey:y,element:u});void 0!==u&&!function(e){return g.indexOf(e)>-1}(u)&&window&&(g.push(u),i(u,"keydown",(function(e){E(e,u)}),O),m||(m=!0,i(window,"focus",(function(){p=[]}),O)),i(u,"keyup",(function(e){E(e,u),function(e){var t=e.keyCode||e.which||e.charCode,n=p.indexOf(t);if(n>=0&&p.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&p.splice(0,p.length),93!==t&&224!==t||(t=91),t in h)for(var r in h[t]=!1,l)l[r]===t&&(k[r]=!1)}(e)}),O))}var A={getPressedKeyString:function(){return p.map((function(e){return t=e,Object.keys(a).find((function(e){return a[e]===t}))||function(e){return Object.keys(l).find((function(t){return l[t]===e}))}(e)||String.fromCharCode(e);var t}))},setScope:_,getScope:y,deleteScope:function(e,t){var n,r;for(var s in e||(e=y()),d)if(Object.prototype.hasOwnProperty.call(d,s))for(n=d[s],r=0;r1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(d).forEach((function(n){d[n].filter((function(n){return n.scope===t&&n.shortcut===e})).forEach((function(e){e&&e.method&&e.method()}))}))},unbind:function(e){if(void 0===e)Object.keys(d).forEach((function(e){return delete d[e]}));else if(Array.isArray(e))e.forEach((function(e){e.key&&O(e)}));else if("object"==typeof e)e.key&&O(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const n=e[t];return"function"==typeof n?n:(...e)=>{}},$=(e,t,n)=>{let r=e;return!0===n?r=`${t.identifier}:${e}`:"string"==typeof n&&(r=`${n}:${e}`),r},S=(e,t,n)=>{const{bubbles:r,cancelable:s,composed:i}=t||{bubbles:!0,cancelable:!0,composed:!0};t&&Object.assign(n,{originalEvent:t});return new CustomEvent(e,{bubbles:r,cancelable:s,composed:i,detail:n})};function F(e){return e.replace(/(?:[_-])([a-z0-9])/g,((e,t)=>t.toUpperCase()))}const N={dispatchEvent:!0,eventPrefix:!0,visibleAttribute:"isVisible"},T=(e,t={})=>{const n=e,{dispatchEvent:r,eventPrefix:s,visibleAttribute:i}=Object.assign({},N,t),o=(null==t?void 0:t.element)||n.element;n.intersectionElements||(n.intersectionElements=[]),n.intersectionElements.push(o);const c=e=>{if(o.setAttribute(i,"true"),x(n,"appear").call(n,e),r){const t=$("appear",n,s),r=S(t,null,{controller:n,entry:e});o.dispatchEvent(r)}},a=e=>{if(o.removeAttribute(i),x(n,"disappear").call(n,e),r){const t=$("disappear",n,s),r=S(t,null,{controller:n,entry:e});o.dispatchEvent(r)}},l=n.disconnect.bind(n),u=new IntersectionObserver((e=>{const[t]=e;t.isIntersecting?c(t):o.hasAttribute(i)&&a(t)}),t),h=()=>{u.observe(o)},d=()=>{u.unobserve(o)},f=()=>n.intersectionElements.every((e=>e.hasAttribute(i))),p=f;return Object.assign(n,{isVisible:p,noneVisible:()=>0===n.intersectionElements.filter((e=>e.hasAttribute(i))).length,oneVisible:()=>1===n.intersectionElements.filter((e=>e.hasAttribute(i))).length,atLeastOneVisible:()=>n.intersectionElements.some((e=>e.hasAttribute(i))),allVisible:f,disconnect(){d(),l()}}),h(),[h,d]};class L extends r.Controller{}class j extends L{constructor(e){super(e),requestAnimationFrame((()=>{const[e,t]=T(this,this.options);Object.assign(this,{observe:e,unobserve:t})}))}}const D=(e,t)=>{const n=t=>{const n=e.data.get("src");if(!n)return;const s=e.element;e.isLoading=!0,x(e,"loading").call(e,n),s.onload=()=>{r(n)},s.src=n},r=t=>{e.isLoading=!1,e.isLoaded=!0,x(e,"loaded").call(e,t)},s=e.disconnect.bind(e),i=new IntersectionObserver((t=>{const[r]=t;r.isIntersecting&&!e.isLoaded&&n()}),t),o=()=>{i.observe(e.element)},c=()=>{i.unobserve(e.element)};return Object.assign(e,{isVisible:!1,disconnect(){c(),s()}}),o(),[o,c]};class B extends r.Controller{constructor(){super(...arguments),this.isLoading=!1,this.isLoaded=!1}}class P extends B{constructor(e){super(e),this.options={rootMargin:"10%"},requestAnimationFrame((()=>{const[e,t]=D(this,this.options);Object.assign(this,{observe:e,unobserve:t})}))}}const V={dispatchEvent:!0,eventPrefix:!0},I=(e,t={})=>{const n=e,{dispatchEvent:r,eventPrefix:s}=Object.assign({},V,t),i=(null==t?void 0:t.element)||n.element,o=n.disconnect.bind(n),c=new ResizeObserver((e=>{const[t]=e;if(x(n,"resize").call(n,t.contentRect),r){const e=$("resize",n,s),r=S(e,null,{controller:n,entry:t});i.dispatchEvent(r)}})),a=()=>{c.observe(i)},l=()=>{c.unobserve(i)};return Object.assign(n,{disconnect(){l(),o()}}),a(),[a,l]};class U extends r.Controller{}class K extends U{constructor(e){super(e),requestAnimationFrame((()=>{const[e,t]=I(this,this.options);Object.assign(this,{observe:e,unobserve:t})}))}}const R={events:["click","touchend"],onlyVisible:!0,dispatchEvent:!0,eventPrefix:!0},H=(e,t={})=>{const n=e,{onlyVisible:r,dispatchEvent:s,events:i,eventPrefix:o}=Object.assign({},R,t),c=e=>{const i=(null==t?void 0:t.element)||n.element;if(!(i.contains(e.target)||!function(e){const t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth,s=t.top<=n&&t.top+t.height>0,i=t.left<=r&&t.left+t.width>0;return s&&i}(i)&&r)&&(n.clickOutside&&n.clickOutside(e),s)){const t=$("click:outside",n,o),r=S(t,e,{controller:n});i.dispatchEvent(r)}},a=()=>{null==i||i.forEach((e=>{window.addEventListener(e,c,!1)}))},l=()=>{null==i||i.forEach((e=>{window.removeEventListener(e,c,!1)}))},u=n.disconnect.bind(n);return Object.assign(n,{disconnect(){l(),u()}}),a(),[a,l]};class z extends r.Controller{}class W extends z{constructor(e){super(e),requestAnimationFrame((()=>{const[e,t]=H(this,this.options);Object.assign(this,{observe:e,unobserve:t})}))}}const q={debug:!1,logger:console,dispatchEvent:!0,eventPrefix:!0};class Y{constructor(e,t={}){var n,r,s;this.log=(e,t)=>{this.debug&&(this.logger.groupCollapsed(`%c${this.controller.identifier} %c#${e}`,"color: #3B82F6","color: unset"),this.logger.log(Object.assign({controllerId:this.controllerId},t)),this.logger.groupEnd())},this.warn=e=>{this.logger.warn(`%c${this.controller.identifier} %c${e}`,"color: #3B82F6; font-weight: bold","color: unset")},this.dispatch=(e,t={})=>{if(this.dispatchEvent){const{event:n}=t,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s{const n=this.controller[e];if("function"==typeof n)return n.call(this.controller,t)},this.extendedEvent=(e,t,n)=>{const{bubbles:r,cancelable:s,composed:i}=t||{bubbles:!0,cancelable:!0,composed:!0};t&&Object.assign(n,{originalEvent:t});return new CustomEvent(this.composeEventName(e),{bubbles:r,cancelable:s,composed:i,detail:n})},this.composeEventName=e=>{let t=e;return!0===this.eventPrefix?t=`${this.controller.identifier}:${e}`:"string"==typeof this.eventPrefix&&(t=`${this.eventPrefix}:${e}`),t},this.debug=null!==(r=null!==(n=null==t?void 0:t.debug)&&void 0!==n?n:e.application.stimulusUseDebug)&&void 0!==r?r:q.debug,this.logger=null!==(s=null==t?void 0:t.logger)&&void 0!==s?s:q.logger,this.controller=e,this.controllerId=e.element.id||e.element.dataset.id,this.targetElement=(null==t?void 0:t.element)||e.element;const{dispatchEvent:i,eventPrefix:o}=Object.assign({},q,t);Object.assign(this,{dispatchEvent:i,eventPrefix:o}),this.controllerInitialize=e.initialize.bind(e),this.controllerConnect=e.connect.bind(e),this.controllerDisconnect=e.disconnect.bind(e)}}const J=!0,Q=!0,Z=!0;class G extends Y{constructor(e,t={}){var n,r,s,i;super(e,t),this.dispatch=(e,t={})=>{const{controller:n,targetElement:r,eventPrefix:s,bubbles:i,cancelable:o,log:c,warn:a}=this;Object.assign(t,{controller:n});const l=$(e,this.controller,s),u=new CustomEvent(l,{detail:t,bubbles:i,cancelable:o});return r.dispatchEvent(u),a("`useDispatch()` is deprecated. Please use the built-in `this.dispatch()` function from Stimulus. You can find more information on how to upgrade at: https://stimulus-use.github.io/stimulus-use/#/use-dispatch"),c("dispatch",{eventName:l,detail:t,bubbles:i,cancelable:o}),u},this.targetElement=null!==(n=t.element)&&void 0!==n?n:e.element,this.eventPrefix=null!==(r=t.eventPrefix)&&void 0!==r?r:J,this.bubbles=null!==(s=t.bubbles)&&void 0!==s?s:Q,this.cancelable=null!==(i=t.cancelable)&&void 0!==i?i:Z,this.enhanceController()}enhanceController(){Object.assign(this.controller,{dispatch:this.dispatch})}}const X=(e,t={})=>new G(e,t),ee={overwriteDispatch:!0},te=(e,t={})=>{const{overwriteDispatch:n}=Object.assign({},ee,t);Object.defineProperty(e,"isPreview",{get(){return document.documentElement.hasAttribute("data-turbolinks-preview")||document.documentElement.hasAttribute("data-turbo-preview")}}),Object.defineProperty(e,"isConnected",{get(){return!!Array.from(this.context.module.connectedContexts).find((e=>e===this.context))}}),Object.defineProperty(e,"csrfToken",{get(){return this.metaValue("csrf-token")}}),n&&X(e,t),Object.assign(e,{metaValue(e){const t=document.head.querySelector(`meta[name="${e}"]`);return t&&t.getAttribute("content")}})};class ne extends r.Controller{constructor(e){super(e),this.isPreview=!1,this.isConnected=!1,this.csrfToken="",te(this,this.options)}}const re={ms:6e4,initialState:!1,events:["mousemove","mousedown","resize","keydown","touchstart","wheel"],dispatchEvent:!0,eventPrefix:!0},se=(e,t={})=>{const n=e,{ms:r,initialState:s,events:i,dispatchEvent:o,eventPrefix:c}=Object.assign({},re,t);let a=s,l=setTimeout((()=>{a=!0,u()}),r);const u=e=>{const t=$("away",n,c);if(n.isIdle=!0,x(n,"away").call(n,e),o){const r=S(t,e||null,{controller:n});n.element.dispatchEvent(r)}},h=e=>{const t=$("back",n,c);if(n.isIdle=!1,x(n,"back").call(n,e),o){const r=S(t,e||null,{controller:n});n.element.dispatchEvent(r)}},d=e=>{a&&h(e),a=!1,clearTimeout(l),l=setTimeout((()=>{a=!0,u(e)}),r)},f=e=>{document.hidden||d(e)};a?u():h();const p=n.disconnect.bind(n),m=()=>{i.forEach((e=>{window.addEventListener(e,d)})),document.addEventListener("visibilitychange",f)},v=()=>{clearTimeout(l),i.forEach((e=>{window.removeEventListener(e,d)})),document.removeEventListener("visibilitychange",f)};return Object.assign(n,{disconnect(){v(),p()}}),m(),[m,v]};class ie extends r.Controller{constructor(){super(...arguments),this.isIdle=!1}}class oe extends ie{constructor(e){super(e),requestAnimationFrame((()=>{const[e,t]=se(this,this.options);Object.assign(this,{observe:e,unobserve:t})}))}}class ce extends Y{constructor(e,t={}){super(e,t),this.observe=()=>{this.controller.isVisible=!document.hidden,document.addEventListener("visibilitychange",this.handleVisibilityChange),this.handleVisibilityChange()},this.unobserve=()=>{document.removeEventListener("visibilitychange",this.handleVisibilityChange)},this.becomesInvisible=e=>{this.controller.isVisible=!1,this.call("invisible",e),this.log("invisible",{isVisible:!1}),this.dispatch("invisible",{event:e,isVisible:!1})},this.becomesVisible=e=>{this.controller.isVisible=!0,this.call("visible",e),this.log("visible",{isVisible:!0}),this.dispatch("visible",{event:e,isVisible:!0})},this.handleVisibilityChange=e=>{document.hidden?this.becomesInvisible(e):this.becomesVisible(e)},this.controller=e,this.enhanceController(),this.observe()}enhanceController(){const e=this.controllerDisconnect;Object.assign(this.controller,{disconnect:()=>{this.unobserve(),e()}})}}const ae=(e,t={})=>{const n=new ce(e,t);return[n.observe,n.unobserve]};class le extends r.Controller{constructor(){super(...arguments),this.isVisible=!1}}class ue extends le{constructor(e){super(e),requestAnimationFrame((()=>{const[e,t]=ae(this,this.options);Object.assign(this,{observe:e,unobserve:t})}))}}class he extends Y{constructor(e,t={}){super(e,t),this.observe=()=>{this.targetElement.addEventListener("mouseenter",this.onEnter),this.targetElement.addEventListener("mouseleave",this.onLeave)},this.unobserve=()=>{this.targetElement.removeEventListener("mouseenter",this.onEnter),this.targetElement.removeEventListener("mouseleave",this.onLeave)},this.onEnter=e=>{this.call("mouseEnter",e),this.log("mouseEnter",{hover:!0}),this.dispatch("mouseEnter",{hover:!1})},this.onLeave=e=>{this.call("mouseLeave",e),this.log("mouseLeave",{hover:!1}),this.dispatch("mouseLeave",{hover:!1})},this.controller=e,this.enhanceController(),this.observe()}enhanceController(){const e=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:()=>{this.unobserve(),e()}})}}const de=(e,t={})=>{const n=new he(e,t);return[n.observe,n.unobserve]};class fe extends r.Controller{}class pe extends fe{constructor(e){super(e),requestAnimationFrame((()=>{const[e,t]=de(this,this.options);Object.assign(this,{observe:e,unobserve:t})}))}}class me extends Y{constructor(e,t={}){super(e,t),this.observe=()=>{try{this.observer.observe(this.targetElement,this.options)}catch(e){this.controller.application.handleError(e,"At a minimum, one of childList, attributes, and/or characterData must be true",{})}},this.unobserve=()=>{this.observer.disconnect()},this.mutation=e=>{this.call("mutate",e),this.log("mutate",{entries:e}),this.dispatch("mutate",{entries:e})},this.targetElement=(null==t?void 0:t.element)||e.element,this.controller=e,this.options=t,this.observer=new MutationObserver(this.mutation),this.enhanceController(),this.observe()}enhanceController(){const e=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:()=>{this.unobserve(),e()}})}}const ve=(e,t={})=>{const n=new me(e,t);return[n.observe,n.unobserve]};class ge extends r.Controller{}class be extends ge{constructor(e){super(e),requestAnimationFrame((()=>{const[e,t]=ve(this,this.options);Object.assign(this,{observe:e,unobserve:t})}))}}class _e extends Y{constructor(e,t={}){super(e,t),this.observe=()=>{this.observer.observe(this.targetElement,{subtree:!0,characterData:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:[this.targetSelector,this.scopedTargetSelector]})},this.unobserve=()=>{this.observer.disconnect()},this.mutation=e=>{for(const t of e)switch(t.type){case"attributes":let e=t.target.getAttribute(t.attributeName),n=t.oldValue;if(t.attributeName===this.targetSelector||t.attributeName===this.scopedTargetSelector){let r=this.targetsUsedByThisController(n),s=this.targetsUsedByThisController(e),i=r.filter((e=>!s.includes(e))),o=s.filter((e=>!r.includes(e)));i.forEach((e=>this.targetRemoved(this.stripIdentifierPrefix(e),t.target,"attributeChange"))),o.forEach((e=>this.targetAdded(this.stripIdentifierPrefix(e),t.target,"attributeChange")))}break;case"characterData":let r=this.findTargetInAncestry(t.target);if(null==r)return;this.targetsUsedByThisControllerFromNode(r).forEach((e=>{this.targetChanged(this.stripIdentifierPrefix(e),r,"domMutation")}));break;case"childList":let{addedNodes:s,removedNodes:i}=t;s.forEach((e=>this.processNodeDOMMutation(e,this.targetAdded))),i.forEach((e=>this.processNodeDOMMutation(e,this.targetRemoved)))}},this.controller=e,this.options=t,this.targetElement=e.element,this.identifier=e.scope.identifier,this.identifierPrefix=`${this.identifier}.`,this.targetSelector=e.scope.schema.targetAttribute,this.scopedTargetSelector=`data-${this.identifier}-target`,this.targets=t.targets||e.constructor.targets,this.prefixedTargets=this.targets.map((e=>`${this.identifierPrefix}${e}`)),this.observer=new MutationObserver(this.mutation),this.enhanceController(),this.observe()}processNodeDOMMutation(e,t){let n=e,r=t,s=[];"#text"==n.nodeName||0==this.targetsUsedByThisControllerFromNode(n).length?(r=this.targetChanged,n=this.findTargetInAncestry(e)):s=this.targetsUsedByThisControllerFromNode(n),null!=n&&(0==s.length&&(s=this.targetsUsedByThisControllerFromNode(n)),s.forEach((e=>{r.call(this,this.stripIdentifierPrefix(e),n,"domMutation")})))}findTargetInAncestry(e){let t=e,n=[];for("#text"!=t.nodeName&&(n=this.targetsUsedByThisControllerFromNode(t));null!==t.parentNode&&t.parentNode!=this.targetElement&&0==n.length;)if(t=t.parentNode,"#text"!==t.nodeName){if(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}targetAdded(e,t,n){let r=`${e}TargetAdded`;this.controller[r]&&x(this.controller,r).call(this.controller,t),this.log("targetAdded",{target:e,node:t,trigger:n})}targetRemoved(e,t,n){let r=`${e}TargetRemoved`;this.controller[r]&&x(this.controller,r).call(this.controller,t),this.log("targetRemoved",{target:e,node:t,trigger:n})}targetChanged(e,t,n){let r=`${e}TargetChanged`;this.controller[r]&&x(this.controller,r).call(this.controller,t),this.log("targetChanged",{target:e,node:t,trigger:n})}targetsUsedByThisControllerFromNode(e){if("#text"==e.nodeName||"#comment"==e.nodeName)return[];let t=e;return this.targetsUsedByThisController(t.getAttribute(this.scopedTargetSelector)||t.getAttribute(this.targetSelector))}targetsUsedByThisController(e){e=e||"";let t=this.stripIdentifierPrefix(e).split(" ");return this.targets.filter((e=>-1!==t.indexOf(e)))}stripIdentifierPrefix(e){return e.replace(new RegExp(this.identifierPrefix,"g"),"")}enhanceController(){const e=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:()=>{this.unobserve(),e()}})}}const ye=(e,t={})=>{const n=new _e(e,t);return[n.observe,n.unobserve]};class Oe extends r.Controller{}class we extends Oe{constructor(e){super(e),requestAnimationFrame((()=>{const[e,t]=ye(this,this.options);Object.assign(this,{observe:e,unobserve:t})}))}}const Ee=e=>{const t=e,n=e=>{const{innerWidth:n,innerHeight:r}=window,s={height:r||1/0,width:n||1/0,event:e};x(t,"windowResize").call(t,s)},r=t.disconnect.bind(t),s=()=>{window.addEventListener("resize",n),n()},i=()=>{window.removeEventListener("resize",n)};return Object.assign(t,{disconnect(){i(),r()}}),s(),[s,i]};class ke extends r.Controller{}class Ae extends ke{constructor(e){super(e),requestAnimationFrame((()=>{const[e,t]=Ee(this);Object.assign(this,{observe:e,unobserve:t})}))}}const Ce=e=>{var t;null===(t=e.constructor.memos)||void 0===t||t.forEach((t=>{((e,t,n)=>{Object.defineProperty(e,t,{value:n})})(e,t,e[t])}))};class Me extends r.Controller{}Me.debounces=[];const xe=(e,t=200)=>{let n=null;return function(){const r=Array.from(arguments),s=this,i=r.map((e=>e.params));n&&clearTimeout(n),n=setTimeout((()=>(r.forEach(((e,t)=>e.params=i[t])),e.apply(s,r))),t)}},$e=(e,t)=>{const n=e;n.constructor.debounces.forEach((e=>{if("string"==typeof e&&(n[e]=xe(n[e],null==t?void 0:t.wait)),"object"==typeof e){const{name:r,wait:s}=e;if(!r)return;n[r]=xe(n[r],s||(null==t?void 0:t.wait))}}))};class Se extends r.Controller{}Se.throttles=[];function Fe(e,t=200){let n;return function(){const r=arguments,s=this;n||(n=!0,e.apply(s,r),setTimeout((()=>n=!1),t))}}const Ne=(e,t={})=>{var n;const r=e;null===(n=r.constructor.throttles)||void 0===n||n.forEach((e=>{if("string"==typeof e&&(r[e]=Fe(r[e],null==t?void 0:t.wait)),"object"==typeof e){const{name:n,wait:s}=e;if(!n)return;r[n]=Fe(r[n],s||(null==t?void 0:t.wait))}}))};function Te(e){const t=document.head.querySelector(`meta[name="${e}"]`);return t&&t.getAttribute("content")}function Le(e){try{return JSON.parse(e)}catch(t){return e}}const je=(e,t={suffix:!0})=>{const n=e.constructor.metaNames,r=t.suffix;null==n||n.forEach((t=>{((e,t,n)=>{const r=n?`${F(t)}Meta`:F(t);Object.defineProperty(e,r,{get(){return Le(Te(t))}})})(e,t,r)})),Object.defineProperty(e,"metas",{get(){const e={};return null==n||n.forEach((t=>{const n=Le(Te(t));null!=n&&(e[F(t)]=n)})),e}})},De={enterFromClass:"enter",enterActiveClass:"enterStart",enterToClass:"enterEnd",leaveFromClass:"leave",leaveActiveClass:"leaveStart",leaveToClass:"leaveEnd"},Be={transitioned:!1,hiddenClass:"hidden",preserveOriginalClass:!0,removeToClasses:!0},Pe=(e,t={})=>{var n,r,s;const i=e,o=i.element.dataset.transitionTarget;let c;o&&(c=i[`${o}Target`]);const a=(null==t?void 0:t.element)||c||i.element;if(!(a instanceof HTMLElement||a instanceof SVGElement))return;const l=a.dataset,u=parseInt(l.leaveAfter||"")||t.leaveAfter||0,{transitioned:h,hiddenClass:d,preserveOriginalClass:f,removeToClasses:p}=Object.assign({},Be,t),m=null===(n=i.enter)||void 0===n?void 0:n.bind(i),v=null===(r=i.leave)||void 0===r?void 0:r.bind(i),g=null===(s=i.toggleTransition)||void 0===s?void 0:s.bind(i);async function b(e){if(i.transitioned)return;i.transitioned=!0,m&&m(e);const n=Ve("enterFrom",t,l),r=Ve("enterActive",t,l),s=Ve("enterTo",t,l),o=Ve("leaveTo",t,l);d&&a.classList.remove(d),p||E(a,o),await O(a,n,r,s,d,f,p),u>0&&setTimeout((()=>{_(e)}),u)}async function _(e){if(!i.transitioned)return;i.transitioned=!1,v&&v(e);const n=Ve("leaveFrom",t,l),r=Ve("leaveActive",t,l),s=Ve("leaveTo",t,l),o=Ve("enterTo",t,l);p||E(a,o),await O(a,n,r,s,d,f,p),d&&a.classList.add(d)}function y(e){g&&g(e),i.transitioned?_():b()}async function O(e,t,n,r,s,i,o){const c=[];i&&(t.forEach((t=>e.classList.contains(t)&&t!==s&&c.push(t))),n.forEach((t=>e.classList.contains(t)&&t!==s&&c.push(t))),r.forEach((t=>e.classList.contains(t)&&t!==s&&c.push(t)))),w(e,t),E(e,c),w(e,n),await async function(){return new Promise((e=>{requestAnimationFrame((()=>{requestAnimationFrame(e)}))}))}(),E(e,t),w(e,r),await async function(e){return new Promise((t=>{const n=1e3*Number(getComputedStyle(e).transitionDuration.split(",")[0].replace("s",""));setTimeout((()=>{t(n)}),n)}))}(e),E(e,n),o&&E(e,r),w(e,c)}function w(e,t){t.length>0&&e.classList.add(...t)}function E(e,t){t.length>0&&e.classList.remove(...t)}return i.transitioned=h,h?(d&&a.classList.remove(d),b()):(d&&a.classList.add(d),_()),Object.assign(i,{enter:b,leave:_,toggleTransition:y}),[b,_,y]};function Ve(e,t,n){const r=`transition${e[0].toUpperCase()}${e.substr(1)}`,s=De[e],i=t[e]||n[r]||n[s]||" ";return 0!==(o=i).length&&o.trim()?i.split(" "):[];var o}class Ie extends r.Controller{constructor(){super(...arguments),this.transitioned=!1}}class Ue extends Ie{constructor(e){super(e),requestAnimationFrame((()=>{Pe(this,this.options)}))}}class Ke extends Y{constructor(e,t){super(e,t),this.bind=()=>{for(const[e,t]of Object.entries(this.hotkeysOptions.hotkeys)){const n=t.handler.bind(this.controller);k(e,t.options,(e=>n(e,e)))}},this.unbind=()=>{for(const e in this.hotkeysOptions.hotkeys)k.unbind(e)},this.controller=e,this.hotkeysOptions=t,this.enhanceController(),this.bind()}enhanceController(){this.hotkeysOptions.filter&&(k.filter=this.hotkeysOptions.filter);const e=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:()=>{this.unbind(),e()}})}}const Re=e=>({handler:e[0],options:{element:e[1]}}),He=(e,t)=>new Ke(e,(e=>{if(!e.hotkeys){const t={};Object.entries(e).forEach((([e,n])=>{Object.defineProperty(t,e,{value:Re(n),writable:!1,enumerable:!0})})),e={hotkeys:t}}return e})(t)),ze={mediaQueries:{},dispatchEvent:!0,eventPrefix:!0,debug:!1};class We extends Y{constructor(e,t={}){var n,r,s,i;super(e,t),this.matches=[],this.callback=e=>{const t=Object.keys(this.mediaQueries).find((t=>this.mediaQueries[t]===e.media));if(!t)return;const{media:n,matches:r}=e;this.changed({name:t,media:n,matches:r,event:e})},this.changed=e=>{const{name:t}=e;e.event&&(this.call(F(`${t}_changed`),e),this.dispatch(`${t}:changed`,e),this.log(`media query "${t}" changed`,e)),e.matches?(this.call(F(`is_${t}`),e),this.dispatch(`is:${t}`,e)):(this.call(F(`not_${t}`),e),this.dispatch(`not:${t}`,e))},this.observe=()=>{Object.keys(this.mediaQueries).forEach((e=>{const t=this.mediaQueries[e],n=window.matchMedia(t);n.addListener(this.callback),this.matches.push(n),this.changed({name:e,media:t,matches:n.matches})}))},this.unobserve=()=>{this.matches.forEach((e=>e.removeListener(this.callback)))},this.controller=e,this.mediaQueries=null!==(n=t.mediaQueries)&&void 0!==n?n:ze.mediaQueries,this.dispatchEvent=null!==(r=t.dispatchEvent)&&void 0!==r?r:ze.dispatchEvent,this.eventPrefix=null!==(s=t.eventPrefix)&&void 0!==s?s:ze.eventPrefix,this.debug=null!==(i=t.debug)&&void 0!==i?i:ze.debug,window.matchMedia?(this.enhanceController(),this.observe()):console.error("window.matchMedia() is not available")}enhanceController(){const e=this.controller.disconnect.bind(this.controller);Object.assign(this.controller,{disconnect:()=>{this.unobserve(),e()}})}}const qe=(e,t={})=>{const n=new We(e,t);return[n.observe,n.unobserve]};class Ye extends Y{constructor(e,t={}){super(e,t),this.observe=()=>{document.hasFocus()?this.becomesFocused():this.becomesUnfocused(),this.interval=setInterval((()=>{this.handleWindowFocusChange()}),this.intervalDuration)},this.unobserve=()=>{clearInterval(this.interval)},this.becomesUnfocused=e=>{this.controller.hasFocus=!1,this.call("unfocus",e),this.log("unfocus",{hasFocus:!1}),this.dispatch("unfocus",{event:e,hasFocus:!1})},this.becomesFocused=e=>{this.controller.hasFocus=!0,this.call("focus",e),this.log("focus",{hasFocus:!0}),this.dispatch("focus",{event:e,hasFocus:!0})},this.handleWindowFocusChange=e=>{document.hasFocus()&&!this.controller.hasFocus?this.becomesFocused(e):!document.hasFocus()&&this.controller.hasFocus&&this.becomesUnfocused(e)},this.controller=e,this.intervalDuration=t.interval||200,this.enhanceController(),this.observe()}enhanceController(){const e=this.controllerDisconnect;Object.assign(this.controller,{disconnect:()=>{this.unobserve(),e()}})}}const Je=(e,t={})=>{const n=new Ye(e,t);return[n.observe,n.unobserve]};class Qe extends r.Controller{constructor(){super(...arguments),this.hasFocus=!1}}class Ze extends Qe{constructor(e){super(e),requestAnimationFrame((()=>{const[e,t]=Je(this,this.options);Object.assign(this,{observe:e,unobserve:t})}))}}}}]);