app/assets/bundle/trestle/admin.js in trestle-0.10.0.pre vs app/assets/bundle/trestle/admin.js in trestle-0.10.0.pre2

- old
+ new

@@ -1,6 +1,6 @@ -var Trestle;!function(){var e,t,n={2036:function(e,t,n){var r={"./application_controller.js":9044,"./checkbox_select_controller.js":4448,"./confirm_controller.js":6698,"./confirm_delete_controller.js":5512,"./datepicker_controller.js":1724,"./datetimepicker_controller.js":4735,"./deprecated/init_controller.js":8778,"./flatpickr_controller.js":8770,"./follow_url_controller.js":8535,"./form_error_controller.js":9419,"./form_loading_controller.js":4761,"./gallery_controller.js":6023,"./index.js":8619,"./keyboard_submit_controller.js":2596,"./lightbox_controller.js":6229,"./mobile_sidebar_controller.js":8925,"./modal_controller.js":8130,"./modal_frame_controller.js":2323,"./modal_trigger_controller.js":2496,"./navigation_controller.js":3424,"./navigation_tooltip_controller.js":1108,"./popover_controller.js":2489,"./reloadable_controller.js":3414,"./select_controller.js":6986,"./sidebar_controller.js":7854,"./tab_errors_controller.js":3431,"./tabs_controller.js":8702,"./timepicker_controller.js":4323,"./toggle_attr_controller.js":8052,"./toggle_class_controller.js":1595,"./tooltip_controller.js":1891,"./wrapper_controller.js":2443};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=o,e.exports=i,i.id=2036},727:function(e,t){!function(e){"use strict";function t(e){return e.keys().map((t=>n(e,t))).filter((e=>e))}function n(e,t){const n=i(t);if(n)return r(e(t),n)}function r(e,t){const n=e.default;if("function"==typeof n)return{identifier:t,controllerConstructor:n}}function i(e){const t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}e.definitionForModuleAndIdentifier=r,e.definitionForModuleWithContextAndKey=n,e.definitionsFromContext=t,e.identifierForContextKey=i,Object.defineProperty(e,"__esModule",{value:!0})}(t)},6927:function(e,t){!function(e){"use strict";class t{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=n(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 n<r?-1:n>r?1:0}))}}function n(e){if("immediatePropagationStopped"in e)return e;{const{stopImmediatePropagation:t}=e;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}class r{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,i=this.fetchEventListenerMapForEventTarget(t),o=this.cacheKey(n,r);i.delete(o),0==i.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),i=this.cacheKey(t,n);let o=r.get(i);return o||(o=this.createEventListener(e,t,n),r.set(i,o)),o}createEventListener(e,n,r){const i=new t(e,n,r);return this.started&&i.connect(),i}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.join(":")}}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 s(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:a(t[4]),eventName:n,eventOptions:t[7]?c(t[7]):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||r}}function a(e){return"window"==e?window:"document"==e?document:void 0}function c(e){return e.split(":").reduce(((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)})),{})}function l(e){return e==window?"window":e==document?"document":void 0}function u(e){return e.replace(/(?:[_-])([a-z0-9])/g,((e,t)=>t.toUpperCase()))}function f(e){return u(e.replace(/--/g,"-").replace(/__/g,"_"))}function d(e){return e.charAt(0).toUpperCase()+e.slice(1)}function h(e){return e.replace(/([A-Z])/g,((e,t)=>`-${t.toLowerCase()}`))}function p(e){return e.match(/[^\s]+/g)||[]}function m(e){return null!=e}function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const v=["meta","ctrl","alt","shift"];class y{constructor(e,t,n,r){this.element=e,this.index=t,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||w(e)||_("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||_("missing identifier"),this.methodName=n.methodName||_("missing method name"),this.keyFilter=n.keyFilter||"",this.schema=r}static forToken(e,t){return new this(e.element,e.index,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=>!v.includes(e)))[0];return!!n&&(g(this.keyMappings,n)||_(`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 i=n.match(t),o=i&&i[1];o&&(e[u(o)]=S(r))}return e}get eventTargetName(){return l(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){const[n,r,i,o]=v.map((e=>t.includes(e)));return e.metaKey!==n||e.ctrlKey!==r||e.altKey!==i||e.shiftKey!==o}}const b={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:e=>"submit"==e.getAttribute("type")?"click":"input",select:()=>"change",textarea:()=>"input"};function w(e){const t=e.tagName.toLowerCase();if(t in b)return b[t](e)}function _(e){throw new Error(e)}function S(e){try{return JSON.parse(e)}catch(t){return e}}class O{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 i=!0;for(const[o,s]of Object.entries(this.eventOptions))if(o in n){const a=n[o];i=i&&a({name:o,value:s,event:e,element:t,controller:r})}return i}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:i,index:o}=this,s={identifier:n,controller:r,element:i,index:o,event:e};this.context.handleError(t,`invoking action "${this.action}"`,s)}}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 E{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 x{constructor(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new E(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 A(e,t,n){C(e,t).add(n)}function T(e,t,n){C(e,t).delete(n),k(e,t)}function C(e,t){let n=e.get(t);return n||(n=new Set,e.set(t,n)),n}function k(e,t){const n=e.get(t);null!=n&&0==n.size&&e.delete(t)}class j{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){A(this.valuesByKey,e,t)}delete(e,t){T(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 P extends j{constructor(){super(),this.keysByValue=new Map}get values(){return Array.from(this.keysByValue.keys())}add(e,t){super.add(e,t),A(this.keysByValue,t,e)}delete(e,t){super.delete(e,t),T(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 D{constructor(e,t,n,r){this._selector=t,this.details=r,this.elementObserver=new E(e,this),this.delegate=n,this.matchesByElement=new j}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 M{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 L{constructor(e,t,n){this.attributeObserver=new x(e,t,this),this.delegate=n,this.tokensByElement=new j}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=R(t,n).findIndex((([e,t])=>!I(e,t)));return-1==r?[[],[]]:[t.slice(r),n.slice(r)]}readTokensForElement(e){const t=this.attributeName;return N(e.getAttribute(t)||"",e,t)}}function N(e,t,n){return e.trim().split(/\s+/).filter((e=>e.length)).map(((e,r)=>({element:t,attributeName:n,content:e,index:r})))}function R(e,t){const n=Math.max(e.length,t.length);return Array.from({length:n},((n,r)=>[e[r],t[r]]))}function I(e,t){return e&&t&&e.index==t.index&&e.content==t.content}class F{constructor(e,t,n){this.tokenListObserver=new L(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 ${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 O(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=y.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}}class H{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new M(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`,i=this.receiver[r];if("function"==typeof i){const r=this.valueDescriptorNameMap[e];try{const e=r.reader(t);let o=n;n&&(o=r.reader(n)),i.call(this.receiver,e,o)}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${d(this.valueDescriptorNameMap[e].name)}`;return this.receiver[t]}}class B{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new j}start(){this.tokenListObserver||(this.tokenListObserver=new L(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 q(e,t){const n=W(e);return Array.from(n.reduce(((e,n)=>(V(n,t).forEach((t=>e.add(t))),e)),new Set))}function z(e,t){return W(e).reduce(((e,n)=>(e.push(...U(n,t)),e)),[])}function W(e){const t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}function V(e,t){const n=e[t];return Array.isArray(n)?n:[]}function U(e,t){const n=e[t];return n?Object.keys(n).map((e=>[e,n[e]])):[]}class K{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new j,this.outletElementsByName=new j,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),i=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return!!n&&r&&i&&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 D(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,n),n.start()}setupAttributeObserverForOutlet(e){const t=this.attributeNameForOutletName(e),n=new x(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 j;return this.router.modules.forEach((t=>{q(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 Y{constructor(e,t){this.logDebugActivity=(e,t={})=>{const{identifier:n,controller:r,element:i}=this;t=Object.assign({identifier:n,controller:r,element:i},t),this.application.logDebugActivity(this.identifier,e,t)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new $(this,this.dispatcher),this.valueObserver=new H(this,this.controller),this.targetObserver=new B(this,this),this.outletObserver=new K(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:i,element:o}=this;n=Object.assign({identifier:r,controller:i,element:o},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(`${f(n)}OutletConnected`,e,t)}outletDisconnected(e,t,n){this.invokeControllerMethod(`${f(n)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){const n=this.controller;"function"==typeof n[e]&&n[e](...t)}}function G(e){return Z(e,X(e))}function Z(e,t){const n=te(e),r=Q(e.prototype,t);return Object.defineProperties(n.prototype,r),n}function X(e){return q(e,"blessings").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}),{})}function Q(e,t){return ee(t).reduce(((n,r)=>{const i=J(e,t,r);return i&&Object.assign(n,{[r]:i}),n}),{})}function J(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}}const ee="function"==typeof Object.getOwnPropertySymbols?e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]:Object.getOwnPropertyNames,te=(()=>{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}function t(){const t=e((function(){this.a.call(this)}));return t.prototype.a=function(){},new t}try{return t(),e}catch(e){return e=>class extends e{}}})();function ne(e){return{identifier:e.identifier,controllerConstructor:G(e.controllerConstructor)}}class re{constructor(e,t){this.application=e,this.definition=ne(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 Y(this,e),this.contextsByScope.set(e,t)),t}}class ie{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){return p(this.data.get(this.getDataKey(e))||"")}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}}class oe{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 se{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 ae(e,t){return`[${e}~="${t}"]`}class ce{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 ae(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 ae(this.schema.targetAttribute,t)}deprecate(e,t){if(e){const{identifier:n}=this,r=this.schema.targetAttribute,i=this.schema.targetAttributeForScope(n);this.guide.warn(e,`target:${t}`,`Please replace ${r}="${n}.${t}" with ${i}="${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 le{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 ue{constructor(e,t,n,r){this.targets=new ce(this),this.classes=new ie(this),this.data=new oe(this),this.containsElement=e=>e.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=n,this.guide=new se(r),this.outlets=new le(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 ae(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new ue(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class fe{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 de{constructor(e){this.application=e,this.scopeObserver=new fe(this.element,this.schema,this),this.scopesByIdentifier=new j,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 re(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 ue(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 he={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"},pe("abcdefghijklmnopqrstuvwxyz".split("").map((e=>[e,e])))),pe("0123456789".split("").map((e=>[e,e]))))};function pe(e){return e.reduce(((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n})),{})}class me{constructor(e=document.documentElement,t=he){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 r(this),this.router=new de(this),this.actionDescriptorFilters=Object.assign({},i)}static start(e,t){const n=new this(e,t);return n.start(),n}async start(){await ge(),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")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(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 ge(){return new Promise((e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",(()=>e())):e()}))}function ve(e){return q(e,"classes").reduce(((e,t)=>Object.assign(e,ye(t))),{})}function ye(e){return{[`${e}Class`]:{get(){const{classes:t}=this;if(t.has(e))return t.get(e);{const n=t.getAttributeName(e);throw new Error(`Missing attribute "${n}"`)}}},[`${e}Classes`]:{get(){return this.classes.getAll(e)}},[`has${d(e)}Class`]:{get(){return this.classes.has(e)}}}}function be(e){return q(e,"outlets").reduce(((e,t)=>Object.assign(e,Se(t))),{})}function we(e,t,n){return e.application.getControllerForElementAndIdentifier(t,n)}function _e(e,t,n){let r=we(e,t,n);return r||(e.application.router.proposeToConnectScopeForElementAndIdentifier(t,n),r=we(e,t,n),r||void 0)}function Se(e){const t=f(e);return{[`${t}Outlet`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t){const n=_e(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=_e(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${d(t)}Outlet`]:{get(){return this.outlets.has(e)}}}}function Oe(e){return q(e,"targets").reduce(((e,t)=>Object.assign(e,Ee(t))),{})}function Ee(e){return{[`${e}Target`]:{get(){const t=this.targets.find(e);if(t)return t;throw new Error(`Missing target element "${e}" for "${this.identifier}" controller`)}},[`${e}Targets`]:{get(){return this.targets.findAll(e)}},[`has${d(e)}Target`]:{get(){return this.targets.has(e)}}}}function xe(e){const t=z(e,"values"),n={valueDescriptorMap:{get(){return t.reduce(((e,t)=>{const n=Te(t,this.identifier),r=this.data.getAttributeNameForKey(n.key);return Object.assign(e,{[r]:n})}),{})}}};return t.reduce(((e,t)=>Object.assign(e,Ae(t))),n)}function Ae(e,t){const n=Te(e,t),{key:r,name:i,reader:o,writer:s}=n;return{[i]:{get(){const e=this.data.get(r);return null!==e?o(e):n.defaultValue},set(e){void 0===e?this.data.delete(r):this.data.set(r,s(e))}},[`has${d(i)}`]:{get(){return this.data.has(r)||n.hasCustomDefaultValue}}}}function Te([e,t],n){return Me({controller:n,token:e,typeDefinition:t})}function Ce(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function ke(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}function je(e){const{controller:t,token:n,typeObject:r}=e,i=m(r.type),o=m(r.default),s=i&&o,a=i&&!o,c=!i&&o,l=Ce(r.type),u=ke(e.typeObject.default);if(a)return l;if(c)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}".`);return s?l:void 0}function Pe(e){const{controller:t,token:n,typeDefinition:r}=e,i=je({controller:t,token:n,typeObject:r}),o=ke(r),s=Ce(r),a=i||o||s;if(a)return a;throw new Error(`Unknown value type "${t?`${t}.${r}`:n}" for "${n}" value`)}function De(e){const t=Ce(e);if(t)return Le[t];const n=g(e,"default"),r=g(e,"type"),i=e;if(n)return i.default;if(r){const{type:e}=i,t=Ce(e);if(t)return Le[t]}return e}function Me(e){const{token:t,typeDefinition:n}=e,r=`${h(t)}-value`,i=Pe(e);return{type:i,key:r,name:u(r),get defaultValue(){return De(n)},get hasCustomDefaultValue(){return void 0!==ke(n)},reader:Ne[i],writer:Re[i]||Re.default}}const Le={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},Ne={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 "${ke(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 "${ke(t)}"`);return t},string(e){return e}},Re={default:Fe,array:Ie,object:Ie};function Ie(e){return JSON.stringify(e)}function Fe(e){return`${e}`}class $e{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:i=!0,cancelable:o=!0}={}){const s=new CustomEvent(r?`${r}:${e}`:e,{detail:n,bubbles:i,cancelable:o});return t.dispatchEvent(s),s}}$e.blessings=[ve,Oe,xe,be],$e.targets=[],$e.outlets=[],$e.values={},e.Application=me,e.AttributeObserver=x,e.Context=Y,e.Controller=$e,e.ElementObserver=E,e.IndexedMultimap=P,e.Multimap=j,e.SelectorObserver=D,e.StringMapObserver=M,e.TokenListObserver=L,e.ValueListObserver=F,e.add=A,e.defaultSchema=he,e.del=T,e.fetch=C,e.prune=k,Object.defineProperty(e,"__esModule",{value:!0})}(t)},4140:function(e,t){ +var Trestle;!function(){var e,t,n={2036:function(e,t,n){var r={"./application_controller.js":9044,"./batch_action_controller.js":8111,"./checkbox_select_controller.js":4448,"./confirm_controller.js":6698,"./confirm_delete_controller.js":5512,"./datepicker_controller.js":1724,"./datetimepicker_controller.js":4735,"./deprecated/init_controller.js":8778,"./flatpickr_controller.js":8770,"./follow_url_controller.js":8535,"./form_error_controller.js":9419,"./form_loading_controller.js":4761,"./gallery_controller.js":6023,"./index.js":8619,"./keyboard_submit_controller.js":2596,"./lightbox_controller.js":6229,"./mobile_sidebar_controller.js":8925,"./modal_controller.js":8130,"./modal_frame_controller.js":2323,"./modal_trigger_controller.js":2496,"./navigation_controller.js":3424,"./navigation_tooltip_controller.js":1108,"./popover_controller.js":2489,"./reloadable_controller.js":3414,"./select_controller.js":6986,"./sidebar_controller.js":7854,"./tab_errors_controller.js":3431,"./tabs_controller.js":8702,"./timepicker_controller.js":4323,"./toggle_attr_controller.js":8052,"./toggle_class_controller.js":1595,"./tooltip_controller.js":1891,"./wrapper_controller.js":2443};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=o,e.exports=i,i.id=2036},727:function(e,t){!function(e){"use strict";function t(e){return e.keys().map((t=>n(e,t))).filter((e=>e))}function n(e,t){const n=i(t);if(n)return r(e(t),n)}function r(e,t){const n=e.default;if("function"==typeof n)return{identifier:t,controllerConstructor:n}}function i(e){const t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}e.definitionForModuleAndIdentifier=r,e.definitionForModuleWithContextAndKey=n,e.definitionsFromContext=t,e.identifierForContextKey=i,Object.defineProperty(e,"__esModule",{value:!0})}(t)},6927:function(e,t){!function(e){"use strict";class t{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=n(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 n<r?-1:n>r?1:0}))}}function n(e){if("immediatePropagationStopped"in e)return e;{const{stopImmediatePropagation:t}=e;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}class r{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,i=this.fetchEventListenerMapForEventTarget(t),o=this.cacheKey(n,r);i.delete(o),0==i.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),i=this.cacheKey(t,n);let o=r.get(i);return o||(o=this.createEventListener(e,t,n),r.set(i,o)),o}createEventListener(e,n,r){const i=new t(e,n,r);return this.started&&i.connect(),i}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.join(":")}}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 s(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:a(t[4]),eventName:n,eventOptions:t[7]?c(t[7]):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||r}}function a(e){return"window"==e?window:"document"==e?document:void 0}function c(e){return e.split(":").reduce(((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)})),{})}function l(e){return e==window?"window":e==document?"document":void 0}function u(e){return e.replace(/(?:[_-])([a-z0-9])/g,((e,t)=>t.toUpperCase()))}function f(e){return u(e.replace(/--/g,"-").replace(/__/g,"_"))}function d(e){return e.charAt(0).toUpperCase()+e.slice(1)}function h(e){return e.replace(/([A-Z])/g,((e,t)=>`-${t.toLowerCase()}`))}function p(e){return e.match(/[^\s]+/g)||[]}function m(e){return null!=e}function g(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const v=["meta","ctrl","alt","shift"];class y{constructor(e,t,n,r){this.element=e,this.index=t,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||w(e)||_("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||_("missing identifier"),this.methodName=n.methodName||_("missing method name"),this.keyFilter=n.keyFilter||"",this.schema=r}static forToken(e,t){return new this(e.element,e.index,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=>!v.includes(e)))[0];return!!n&&(g(this.keyMappings,n)||_(`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 i=n.match(t),o=i&&i[1];o&&(e[u(o)]=S(r))}return e}get eventTargetName(){return l(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){const[n,r,i,o]=v.map((e=>t.includes(e)));return e.metaKey!==n||e.ctrlKey!==r||e.altKey!==i||e.shiftKey!==o}}const b={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:e=>"submit"==e.getAttribute("type")?"click":"input",select:()=>"change",textarea:()=>"input"};function w(e){const t=e.tagName.toLowerCase();if(t in b)return b[t](e)}function _(e){throw new Error(e)}function S(e){try{return JSON.parse(e)}catch(t){return e}}class O{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 i=!0;for(const[o,s]of Object.entries(this.eventOptions))if(o in n){const a=n[o];i=i&&a({name:o,value:s,event:e,element:t,controller:r})}return i}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:i,index:o}=this,s={identifier:n,controller:r,element:i,index:o,event:e};this.context.handleError(t,`invoking action "${this.action}"`,s)}}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 E{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 x{constructor(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new E(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 A(e,t,n){C(e,t).add(n)}function T(e,t,n){C(e,t).delete(n),k(e,t)}function C(e,t){let n=e.get(t);return n||(n=new Set,e.set(t,n)),n}function k(e,t){const n=e.get(t);null!=n&&0==n.size&&e.delete(t)}class j{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){A(this.valuesByKey,e,t)}delete(e,t){T(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 P extends j{constructor(){super(),this.keysByValue=new Map}get values(){return Array.from(this.keysByValue.keys())}add(e,t){super.add(e,t),A(this.keysByValue,t,e)}delete(e,t){super.delete(e,t),T(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 D{constructor(e,t,n,r){this._selector=t,this.details=r,this.elementObserver=new E(e,this),this.delegate=n,this.matchesByElement=new j}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 M{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 L{constructor(e,t,n){this.attributeObserver=new x(e,t,this),this.delegate=n,this.tokensByElement=new j}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=R(t,n).findIndex((([e,t])=>!I(e,t)));return-1==r?[[],[]]:[t.slice(r),n.slice(r)]}readTokensForElement(e){const t=this.attributeName;return N(e.getAttribute(t)||"",e,t)}}function N(e,t,n){return e.trim().split(/\s+/).filter((e=>e.length)).map(((e,r)=>({element:t,attributeName:n,content:e,index:r})))}function R(e,t){const n=Math.max(e.length,t.length);return Array.from({length:n},((n,r)=>[e[r],t[r]]))}function I(e,t){return e&&t&&e.index==t.index&&e.content==t.content}class F{constructor(e,t,n){this.tokenListObserver=new L(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 ${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 O(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=y.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}}class H{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new M(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`,i=this.receiver[r];if("function"==typeof i){const r=this.valueDescriptorNameMap[e];try{const e=r.reader(t);let o=n;n&&(o=r.reader(n)),i.call(this.receiver,e,o)}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${d(this.valueDescriptorNameMap[e].name)}`;return this.receiver[t]}}class B{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new j}start(){this.tokenListObserver||(this.tokenListObserver=new L(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 q(e,t){const n=W(e);return Array.from(n.reduce(((e,n)=>(V(n,t).forEach((t=>e.add(t))),e)),new Set))}function z(e,t){return W(e).reduce(((e,n)=>(e.push(...U(n,t)),e)),[])}function W(e){const t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}function V(e,t){const n=e[t];return Array.isArray(n)?n:[]}function U(e,t){const n=e[t];return n?Object.keys(n).map((e=>[e,n[e]])):[]}class K{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new j,this.outletElementsByName=new j,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),i=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return!!n&&r&&i&&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 D(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,n),n.start()}setupAttributeObserverForOutlet(e){const t=this.attributeNameForOutletName(e),n=new x(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 j;return this.router.modules.forEach((t=>{q(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 Y{constructor(e,t){this.logDebugActivity=(e,t={})=>{const{identifier:n,controller:r,element:i}=this;t=Object.assign({identifier:n,controller:r,element:i},t),this.application.logDebugActivity(this.identifier,e,t)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new $(this,this.dispatcher),this.valueObserver=new H(this,this.controller),this.targetObserver=new B(this,this),this.outletObserver=new K(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:i,element:o}=this;n=Object.assign({identifier:r,controller:i,element:o},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(`${f(n)}OutletConnected`,e,t)}outletDisconnected(e,t,n){this.invokeControllerMethod(`${f(n)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){const n=this.controller;"function"==typeof n[e]&&n[e](...t)}}function G(e){return Z(e,X(e))}function Z(e,t){const n=te(e),r=Q(e.prototype,t);return Object.defineProperties(n.prototype,r),n}function X(e){return q(e,"blessings").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}),{})}function Q(e,t){return ee(t).reduce(((n,r)=>{const i=J(e,t,r);return i&&Object.assign(n,{[r]:i}),n}),{})}function J(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}}const ee="function"==typeof Object.getOwnPropertySymbols?e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]:Object.getOwnPropertyNames,te=(()=>{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}function t(){const t=e((function(){this.a.call(this)}));return t.prototype.a=function(){},new t}try{return t(),e}catch(e){return e=>class extends e{}}})();function ne(e){return{identifier:e.identifier,controllerConstructor:G(e.controllerConstructor)}}class re{constructor(e,t){this.application=e,this.definition=ne(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 Y(this,e),this.contextsByScope.set(e,t)),t}}class ie{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){return p(this.data.get(this.getDataKey(e))||"")}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}}class oe{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 se{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 ae(e,t){return`[${e}~="${t}"]`}class ce{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 ae(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 ae(this.schema.targetAttribute,t)}deprecate(e,t){if(e){const{identifier:n}=this,r=this.schema.targetAttribute,i=this.schema.targetAttributeForScope(n);this.guide.warn(e,`target:${t}`,`Please replace ${r}="${n}.${t}" with ${i}="${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 le{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 ue{constructor(e,t,n,r){this.targets=new ce(this),this.classes=new ie(this),this.data=new oe(this),this.containsElement=e=>e.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=n,this.guide=new se(r),this.outlets=new le(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 ae(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new ue(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class fe{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 de{constructor(e){this.application=e,this.scopeObserver=new fe(this.element,this.schema,this),this.scopesByIdentifier=new j,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 re(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 ue(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 he={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"},pe("abcdefghijklmnopqrstuvwxyz".split("").map((e=>[e,e])))),pe("0123456789".split("").map((e=>[e,e]))))};function pe(e){return e.reduce(((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n})),{})}class me{constructor(e=document.documentElement,t=he){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 r(this),this.router=new de(this),this.actionDescriptorFilters=Object.assign({},i)}static start(e,t){const n=new this(e,t);return n.start(),n}async start(){await ge(),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")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(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 ge(){return new Promise((e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",(()=>e())):e()}))}function ve(e){return q(e,"classes").reduce(((e,t)=>Object.assign(e,ye(t))),{})}function ye(e){return{[`${e}Class`]:{get(){const{classes:t}=this;if(t.has(e))return t.get(e);{const n=t.getAttributeName(e);throw new Error(`Missing attribute "${n}"`)}}},[`${e}Classes`]:{get(){return this.classes.getAll(e)}},[`has${d(e)}Class`]:{get(){return this.classes.has(e)}}}}function be(e){return q(e,"outlets").reduce(((e,t)=>Object.assign(e,Se(t))),{})}function we(e,t,n){return e.application.getControllerForElementAndIdentifier(t,n)}function _e(e,t,n){let r=we(e,t,n);return r||(e.application.router.proposeToConnectScopeForElementAndIdentifier(t,n),r=we(e,t,n),r||void 0)}function Se(e){const t=f(e);return{[`${t}Outlet`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t){const n=_e(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=_e(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${d(t)}Outlet`]:{get(){return this.outlets.has(e)}}}}function Oe(e){return q(e,"targets").reduce(((e,t)=>Object.assign(e,Ee(t))),{})}function Ee(e){return{[`${e}Target`]:{get(){const t=this.targets.find(e);if(t)return t;throw new Error(`Missing target element "${e}" for "${this.identifier}" controller`)}},[`${e}Targets`]:{get(){return this.targets.findAll(e)}},[`has${d(e)}Target`]:{get(){return this.targets.has(e)}}}}function xe(e){const t=z(e,"values"),n={valueDescriptorMap:{get(){return t.reduce(((e,t)=>{const n=Te(t,this.identifier),r=this.data.getAttributeNameForKey(n.key);return Object.assign(e,{[r]:n})}),{})}}};return t.reduce(((e,t)=>Object.assign(e,Ae(t))),n)}function Ae(e,t){const n=Te(e,t),{key:r,name:i,reader:o,writer:s}=n;return{[i]:{get(){const e=this.data.get(r);return null!==e?o(e):n.defaultValue},set(e){void 0===e?this.data.delete(r):this.data.set(r,s(e))}},[`has${d(i)}`]:{get(){return this.data.has(r)||n.hasCustomDefaultValue}}}}function Te([e,t],n){return Me({controller:n,token:e,typeDefinition:t})}function Ce(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function ke(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}function je(e){const{controller:t,token:n,typeObject:r}=e,i=m(r.type),o=m(r.default),s=i&&o,a=i&&!o,c=!i&&o,l=Ce(r.type),u=ke(e.typeObject.default);if(a)return l;if(c)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}".`);return s?l:void 0}function Pe(e){const{controller:t,token:n,typeDefinition:r}=e,i=je({controller:t,token:n,typeObject:r}),o=ke(r),s=Ce(r),a=i||o||s;if(a)return a;throw new Error(`Unknown value type "${t?`${t}.${r}`:n}" for "${n}" value`)}function De(e){const t=Ce(e);if(t)return Le[t];const n=g(e,"default"),r=g(e,"type"),i=e;if(n)return i.default;if(r){const{type:e}=i,t=Ce(e);if(t)return Le[t]}return e}function Me(e){const{token:t,typeDefinition:n}=e,r=`${h(t)}-value`,i=Pe(e);return{type:i,key:r,name:u(r),get defaultValue(){return De(n)},get hasCustomDefaultValue(){return void 0!==ke(n)},reader:Ne[i],writer:Re[i]||Re.default}}const Le={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},Ne={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 "${ke(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 "${ke(t)}"`);return t},string(e){return e}},Re={default:Fe,array:Ie,object:Ie};function Ie(e){return JSON.stringify(e)}function Fe(e){return`${e}`}class $e{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:i=!0,cancelable:o=!0}={}){const s=new CustomEvent(r?`${r}:${e}`:e,{detail:n,bubbles:i,cancelable:o});return t.dispatchEvent(s),s}}$e.blessings=[ve,Oe,xe,be],$e.targets=[],$e.outlets=[],$e.values={},e.Application=me,e.AttributeObserver=x,e.Context=Y,e.Controller=$e,e.ElementObserver=E,e.IndexedMultimap=P,e.Multimap=j,e.SelectorObserver=D,e.StringMapObserver=M,e.TokenListObserver=L,e.ValueListObserver=F,e.add=A,e.defaultSchema=he,e.del=T,e.fetch=C,e.prune=k,Object.defineProperty(e,"__esModule",{value:!0})}(t)},4140:function(e,t){ /*! Turbo 8.0.4 Copyright © 2024 37signals LLC */ !function(e){"use strict";!function(e){function t(e,t){e instanceof HTMLElement||n(TypeError,"parameter 1 is not of type 'HTMLElement'"),"submit"==e.type||n(TypeError,"The specified element is not a submit button"),e.form==t||n(DOMException,"The specified element is not owned by this form element","NotFoundError")}function n(e,t,n){throw new e("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+t+".",n)}"function"!=typeof e.requestSubmit&&(e.requestSubmit=function(e){e?(t(e,this),e.click()):((e=document.createElement("input")).type="submit",e.hidden=!0,this.appendChild(e),e.click(),this.removeChild(e))})}(HTMLFormElement.prototype);const t=new WeakMap;function n(e){const t=e instanceof Element?e:e instanceof Node?e.parentElement:null,n=t?t.closest("input, button"):null;return"submit"==n?.type?n:null}function r(e){const r=n(e.target);r&&r.form&&t.set(r.form,r)}!function(){if("submitter"in Event.prototype)return;let e=window.Event.prototype;if("SubmitEvent"in window){const t=window.SubmitEvent.prototype;if(!/Apple Computer/.test(navigator.vendor)||"submitter"in t)return;e=t}addEventListener("click",r,!0),Object.defineProperty(e,"submitter",{get(){if("submit"==this.type&&this.target instanceof HTMLFormElement)return t.get(this.target)}})}();const i={eager:"eager",lazy:"lazy"};class o extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new o.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(e){"loading"==e?this.delegate.loadingStyleChanged():"src"==e?this.delegate.sourceURLChanged():"disabled"==e&&this.delegate.disabledChanged()}get src(){return this.getAttribute("src")}set src(e){e?this.setAttribute("src",e):this.removeAttribute("src")}get refresh(){return this.getAttribute("refresh")}set refresh(e){e?this.setAttribute("refresh",e):this.removeAttribute("refresh")}get loading(){return s(this.getAttribute("loading")||"")}set loading(e){e?this.setAttribute("loading",e):this.removeAttribute("loading")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get autoscroll(){return this.hasAttribute("autoscroll")}set autoscroll(e){e?this.setAttribute("autoscroll",""):this.removeAttribute("autoscroll")}get complete(){return!this.delegate.isLoading}get isActive(){return this.ownerDocument===document&&!this.isPreview}get isPreview(){return this.ownerDocument?.documentElement?.hasAttribute("data-turbo-preview")}}function s(e){return"lazy"===e.toLowerCase()?i.lazy:i.eager}function a(e){return new URL(e.toString(),document.baseURI)}function c(e){let t;return e.hash?e.hash.slice(1):(t=e.href.match(/#(.*)$/))?t[1]:void 0}function l(e,t){return a(t?.getAttribute("formaction")||e.getAttribute("action")||e.action)}function u(e){return(y(e).match(/\.[^.]*$/)||[])[0]||""}function f(e){return!!u(e).match(/^(?:|\.(?:htm|html|xhtml|php))$/)}function d(e,t){const n=b(t);return e.href===a(n).href||e.href.startsWith(n)}function h(e,t){return d(e,t)&&f(e)}function p(e){const t=c(e);return null!=t?e.href.slice(0,-(t.length+1)):e.href}function m(e){return p(e)}function g(e,t){return a(e).href==a(t).href}function v(e){return e.pathname.split("/").slice(1)}function y(e){return v(e).slice(-1)[0]}function b(e){return w(e.origin+e.pathname)}function w(e){return e.endsWith("/")?e:e+"/"}class _{constructor(e){this.response=e}get succeeded(){return this.response.ok}get failed(){return!this.succeeded}get clientError(){return this.statusCode>=400&&this.statusCode<=499}get serverError(){return this.statusCode>=500&&this.statusCode<=599}get redirected(){return this.response.redirected}get location(){return a(this.response.url)}get isHTML(){return this.contentType&&this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/)}get statusCode(){return this.response.status}get contentType(){return this.header("Content-Type")}get responseText(){return this.response.clone().text()}get responseHTML(){return this.isHTML?this.response.clone().text():Promise.resolve(void 0)}header(e){return this.response.headers.get(e)}}function S(e){if("false"==e.getAttribute("data-turbo-eval"))return e;{const t=document.createElement("script"),n=z("csp-nonce");return n&&(t.nonce=n),t.textContent=e.textContent,t.async=!1,O(t,e),t}}function O(e,t){for(const{name:n,value:r}of t.attributes)e.setAttribute(n,r)}function E(e){const t=document.createElement("template");return t.innerHTML=e,t.content}function x(e,{target:t,cancelable:n,detail:r}={}){const i=new CustomEvent(e,{cancelable:n,bubbles:!0,composed:!0,detail:r});return t&&t.isConnected?t.dispatchEvent(i):document.documentElement.dispatchEvent(i),i}function A(){return"hidden"===document.visibilityState?C():T()}function T(){return new Promise((e=>requestAnimationFrame((()=>e()))))}function C(){return new Promise((e=>setTimeout((()=>e()),0)))}function k(){return Promise.resolve()}function j(e=""){return(new DOMParser).parseFromString(e,"text/html")}function P(e,...t){const n=D(e,t).replace(/^\n/,"").split("\n"),r=n[0].match(/^\s+/),i=r?r[0].length:0;return n.map((e=>e.slice(i))).join("\n")}function D(e,t){return e.reduce(((e,n,r)=>e+n+(null==t[r]?"":t[r])),"")}function M(){return Array.from({length:36}).map(((e,t)=>8==t||13==t||18==t||23==t?"-":14==t?"4":19==t?(Math.floor(4*Math.random())+8).toString(16):Math.floor(15*Math.random()).toString(16))).join("")}function L(e,...t){for(const n of t.map((t=>t?.getAttribute(e))))if("string"==typeof n)return n;return null}function N(e,...t){return t.some((t=>t&&t.hasAttribute(e)))}function R(...e){for(const t of e)"turbo-frame"==t.localName&&t.setAttribute("busy",""),t.setAttribute("aria-busy","true")}function I(...e){for(const t of e)"turbo-frame"==t.localName&&t.removeAttribute("busy"),t.removeAttribute("aria-busy")}function F(e,t=2e3){return new Promise((n=>{const r=()=>{e.removeEventListener("error",r),e.removeEventListener("load",r),n()};e.addEventListener("load",r,{once:!0}),e.addEventListener("error",r,{once:!0}),setTimeout(n,t)}))}function $(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function H(e){return"advance"==e||"replace"==e||"restore"==e}function B(...e){const t=L("data-turbo-action",...e);return H(t)?t:null}function q(e){return document.querySelector(`meta[name="${e}"]`)}function z(e){const t=q(e);return t&&t.content}function W(e,t){let n=q(e);return n||(n=document.createElement("meta"),n.setAttribute("name",e),document.head.appendChild(n)),n.setAttribute("content",t),n}function V(e,t){if(e instanceof Element)return e.closest(t)||V(e.assignedSlot||e.getRootNode()?.host,t)}function U(e){const t="[inert], :disabled, [hidden], details:not([open]), dialog:not([open])";return!!e&&null==e.closest(t)&&"function"==typeof e.focus}function K(e){return Array.from(e.querySelectorAll("[autofocus]")).find(U)}async function Y(e,t){const n=t();return e(),await T(),[n,t()]}function G(e){if(e.hasAttribute("target"))for(const t of document.getElementsByName(e.target))if(t instanceof HTMLIFrameElement)return!1;return!0}function Z(e){return V(e,"a[href]:not([target^=_]):not([download])")}function X(e){return a(e.getAttribute("href")||"")}function Q(e,t){let n=null;return(...r)=>{const i=()=>e.apply(this,r);clearTimeout(n),n=setTimeout(i,t)}}class J extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){const e=this.values().next().value;this.delete(e)}super.add(e)}}const ee=new J(20),te=window.fetch;function ne(e,t={}){const n=new Headers(t.headers||{}),r=M();return ee.add(r),n.append("X-Turbo-Request-Id",r),te(e,{...t,headers:n})}function re(e){switch(e.toLowerCase()){case"get":return ie.get;case"post":return ie.post;case"put":return ie.put;case"patch":return ie.patch;case"delete":return ie.delete}}const ie={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function oe(e){switch(e.toLowerCase()){case se.multipart:return se.multipart;case se.plain:return se.plain;default:return se.urlEncoded}}const se={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"};class ae{abortController=new AbortController;#e=e=>{};constructor(e,t,n,r=new URLSearchParams,i=null,o=se.urlEncoded){const[s,c]=le(a(n),t,r,o);this.delegate=e,this.url=s,this.target=i,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t,headers:{...this.defaultHeaders},body:c,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=o}get method(){return this.fetchOptions.method}set method(e){const t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,n=re(e)||ie.get;this.url.search="";const[r,i]=le(this.url,n,t,this.enctype);this.url=r,this.fetchOptions.body=i,this.fetchOptions.method=n}get headers(){return this.fetchOptions.headers}set headers(e){this.fetchOptions.headers=e}get body(){return this.isSafe?this.url.searchParams:this.fetchOptions.body}set body(e){this.fetchOptions.body=e}get location(){return this.url}get params(){return this.url.searchParams}get entries(){return this.body?Array.from(this.body.entries()):[]}cancel(){this.abortController.abort()}async perform(){const{fetchOptions:e}=this;this.delegate.prepareRequest(this);const t=await this.#t(e);try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=ne(this.url.href,e);const n=await this.response;return await this.receive(n)}catch(e){if("AbortError"!==e.name)throw this.#n(e)&&this.delegate.requestErrored(this,e),e}finally{this.delegate.requestFinished(this)}}async receive(e){const t=new _(e);return x("turbo:before-fetch-response",{cancelable:!0,detail:{fetchResponse:t},target:this.target}).defaultPrevented?this.delegate.requestPreventedHandlingResponse(this,t):t.succeeded?this.delegate.requestSucceededWithResponse(this,t):this.delegate.requestFailedWithResponse(this,t),t}get defaultHeaders(){return{Accept:"text/html, application/xhtml+xml"}}get isSafe(){return ce(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#t(e){const t=new Promise((e=>this.#e=e)),n=x("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#e},target:this.target});return this.url=n.detail.url,n.defaultPrevented&&await t,n}#n(e){return!x("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}}function ce(e){return re(e)==ie.get}function le(e,t,n,r){const i=Array.from(n).length>0?new URLSearchParams(ue(n)):e.searchParams;return ce(t)?[fe(e,i),null]:r==se.urlEncoded?[e,i]:[e,n]}function ue(e){const t=[];for(const[n,r]of e)r instanceof File||t.push([n,r]);return t}function fe(e,t){const n=new URLSearchParams(ue(t));return e.search=n.toString(),e}class de{started=!1;constructor(e,t){this.delegate=e,this.element=t,this.intersectionObserver=new IntersectionObserver(this.intersect)}start(){this.started||(this.started=!0,this.intersectionObserver.observe(this.element))}stop(){this.started&&(this.started=!1,this.intersectionObserver.unobserve(this.element))}intersect=e=>{const t=e.slice(-1)[0];t?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)}}class he{static contentType="text/vnd.turbo-stream.html";static wrap(e){return"string"==typeof e?new this(E(e)):e}constructor(e){this.fragment=pe(e)}}function pe(e){for(const t of e.querySelectorAll("turbo-stream")){const e=document.importNode(t,!0);for(const t of e.templateElement.content.querySelectorAll("script"))t.replaceWith(S(t));t.replaceWith(e)}return e}const me=100;class ge{#r=null;#i=null;get(e){if(this.#i&&this.#i.url===e&&this.#i.expire>Date.now())return this.#i.request}setLater(e,t,n){this.clear(),this.#r=setTimeout((()=>{t.perform(),this.set(e,t,n),this.#r=null}),me)}set(e,t,n){this.#i={url:e,request:t,expire:new Date((new Date).getTime()+n)}}clear(){this.#r&&clearTimeout(this.#r),this.#i=null}}const ve=1e4,ye=new ge,be={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"};class we{state=be.initialized;static confirmMethod(e,t,n){return Promise.resolve(confirm(e))}constructor(e,t,n,r=!1){const i=Ae(t,n),o=xe(Ee(t,n),i),s=_e(t,n),a=Te(t,n);this.delegate=e,this.formElement=t,this.submitter=n,this.fetchRequest=new ae(this,i,o,s,t,a),this.mustRedirect=r}get method(){return this.fetchRequest.method}set method(e){this.fetchRequest.method=e}get action(){return this.fetchRequest.url.toString()}set action(e){this.fetchRequest.url=a(e)}get body(){return this.fetchRequest.body}get enctype(){return this.fetchRequest.enctype}get isSafe(){return this.fetchRequest.isSafe}get location(){return this.fetchRequest.url}async start(){const{initialized:e,requesting:t}=be,n=L("data-turbo-confirm",this.submitter,this.formElement);if("string"!=typeof n||await we.confirmMethod(n,this.formElement,this.submitter))return this.state==e?(this.state=t,this.fetchRequest.perform()):void 0}stop(){const{stopping:e,stopped:t}=be;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){const t=Se(z("csrf-param"))||z("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(he.contentType)}requestStarted(e){this.state=be.waiting,this.submitter?.setAttribute("disabled",""),this.setSubmitsWith(),R(this.formElement),x("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){ye.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError)this.delegate.formSubmissionFailedWithResponse(this,t);else if(ye.clear(),this.requestMustRedirect(e)&&Oe(t)){const e=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,e)}else this.state=be.receiving,this.result={success:!0,fetchResponse:t},this.delegate.formSubmissionSucceededWithResponse(this,t)}requestFailedWithResponse(e,t){this.result={success:!1,fetchResponse:t},this.delegate.formSubmissionFailedWithResponse(this,t)}requestErrored(e,t){this.result={success:!1,error:t},this.delegate.formSubmissionErrored(this,t)}requestFinished(e){this.state=be.stopped,this.submitter?.removeAttribute("disabled"),this.resetSubmitterText(),I(this.formElement),x("turbo:submit-end",{target:this.formElement,detail:{formSubmission:this,...this.result}}),this.delegate.formSubmissionFinished(this)}setSubmitsWith(){if(this.submitter&&this.submitsWith)if(this.submitter.matches("button"))this.originalSubmitText=this.submitter.innerHTML,this.submitter.innerHTML=this.submitsWith;else if(this.submitter.matches("input")){const e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}resetSubmitterText(){this.submitter&&this.originalSubmitText&&(this.submitter.matches("button")?this.submitter.innerHTML=this.originalSubmitText:this.submitter.matches("input")&&(this.submitter.value=this.originalSubmitText))}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||N("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}}function _e(e,t){const n=new FormData(e),r=t?.getAttribute("name"),i=t?.getAttribute("value");return r&&n.append(r,i||""),n}function Se(e){if(null!=e){const t=(document.cookie?document.cookie.split("; "):[]).find((t=>t.startsWith(e)));if(t){const e=t.split("=").slice(1).join("=");return e?decodeURIComponent(e):void 0}}}function Oe(e){return 200==e.statusCode&&!e.redirected}function Ee(e,t){const n="string"==typeof e.action?e.action:null;return t?.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||n||""}function xe(e,t){const n=a(e);return ce(t)&&(n.search=""),n}function Ae(e,t){return re((t?.getAttribute("formmethod")||e.getAttribute("method")||"").toLowerCase())||ie.get}function Te(e,t){return oe(t?.getAttribute("formenctype")||e.enctype)}class Ce{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return null!=this.getElementForAnchor(e)}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return K(this.element)}get permanentElements(){return je(this.element)}getPermanentElementById(e){return ke(this.element,e)}getPermanentElementMapForSnapshot(e){const t={};for(const n of this.permanentElements){const{id:r}=n,i=e.getPermanentElementById(r);i&&(t[r]=[n,i])}return t}}function ke(e,t){return e.querySelector(`#${t}[data-turbo-permanent]`)}function je(e){return e.querySelectorAll("[id][data-turbo-permanent]")}class Pe{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("submit",this.submitCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("submit",this.submitCaptured,!0),this.started=!1)}submitCaptured=()=>{this.eventTarget.removeEventListener("submit",this.submitBubbled,!1),this.eventTarget.addEventListener("submit",this.submitBubbled,!1)};submitBubbled=e=>{if(!e.defaultPrevented){const t=e.target instanceof HTMLFormElement?e.target:void 0,n=e.submitter||void 0;t&&De(t,n)&&Me(t,n)&&this.delegate.willSubmitForm(t,n)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,n))}}}function De(e,t){return"dialog"!=(t?.getAttribute("formmethod")||e.getAttribute("method"))}function Me(e,t){if(t?.hasAttribute("formtarget")||e.hasAttribute("target")){const n=t?.getAttribute("formtarget")||e.target;for(const e of document.getElementsByName(n))if(e instanceof HTMLIFrameElement)return!1;return!0}return!0}class Le{#o=e=>{};#s=e=>{};constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){const t=this.snapshot.getElementForAnchor(e);t?(this.scrollToElement(t),this.focusElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(c(e))}scrollToElement(e){e.scrollIntoView()}focusElement(e){e instanceof HTMLElement&&(e.hasAttribute("tabindex")?e.focus():(e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")))}scrollToPosition({x:e,y:t}){this.scrollRoot.scrollTo(e,t)}scrollToTop(){this.scrollToPosition({x:0,y:0})}get scrollRoot(){return window}async render(e){const{isPreview:t,shouldRender:n,willRender:r,newSnapshot:i}=e,o=r;if(n)try{this.renderPromise=new Promise((e=>this.#o=e)),this.renderer=e,await this.prepareToRenderSnapshot(e);const n=new Promise((e=>this.#s=e)),r={resume:this.#s,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(i,r)||await n,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(i,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#o(void 0),delete this.renderPromise}else o&&this.invalidate(e.reloadReason)}invalidate(e){this.delegate.viewInvalidated(e)}async prepareToRenderSnapshot(e){this.markAsPreview(e.isPreview),await e.prepareToRender()}markAsPreview(e){e?this.element.setAttribute("data-turbo-preview",""):this.element.removeAttribute("data-turbo-preview")}markVisitDirection(e){this.element.setAttribute("data-turbo-visit-direction",e)}unmarkVisitDirection(){this.element.removeAttribute("data-turbo-visit-direction")}async renderSnapshot(e){await e.render()}finishRenderingSnapshot(e){e.finishRendering()}}class Ne extends Le{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new Ce(this.element)}}class Re{constructor(e,t){this.delegate=e,this.element=t}start(){this.element.addEventListener("click",this.clickBubbled),document.addEventListener("turbo:click",this.linkClicked),document.addEventListener("turbo:before-visit",this.willVisit)}stop(){this.element.removeEventListener("click",this.clickBubbled),document.removeEventListener("turbo:click",this.linkClicked),document.removeEventListener("turbo:before-visit",this.willVisit)}clickBubbled=e=>{this.respondsToEventTarget(e.target)?this.clickEvent=e:delete this.clickEvent};linkClicked=e=>{this.clickEvent&&this.respondsToEventTarget(e.target)&&e.target instanceof Element&&this.delegate.shouldInterceptLinkClick(e.target,e.detail.url,e.detail.originalEvent)&&(this.clickEvent.preventDefault(),e.preventDefault(),this.delegate.linkClickIntercepted(e.target,e.detail.url,e.detail.originalEvent)),delete this.clickEvent};willVisit=e=>{delete this.clickEvent};respondsToEventTarget(e){const t=e instanceof Element?e:e instanceof Node?e.parentElement:null;return t&&t.closest("turbo-frame, html")==this.element}}class Ie{started=!1;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.addEventListener("click",this.clickCaptured,!0),this.started=!0)}stop(){this.started&&(this.eventTarget.removeEventListener("click",this.clickCaptured,!0),this.started=!1)}clickCaptured=()=>{this.eventTarget.removeEventListener("click",this.clickBubbled,!1),this.eventTarget.addEventListener("click",this.clickBubbled,!1)};clickBubbled=e=>{if(e instanceof MouseEvent&&this.clickEventIsSignificant(e)){const t=Z(e.composedPath&&e.composedPath()[0]||e.target);if(t&&G(t)){const n=X(t);this.delegate.willFollowLinkToLocation(t,n,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(t,n))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}}class Fe{constructor(e,t){this.delegate=e,this.linkInterceptor=new Ie(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,n){return this.delegate.willSubmitFormLinkToLocation(e,t,n)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,t){const n=document.createElement("form"),r="hidden";for(const[e,i]of t.searchParams)n.append(Object.assign(document.createElement("input"),{type:r,name:e,value:i}));const i=Object.assign(t,{search:""});n.setAttribute("data-turbo","true"),n.setAttribute("action",i.href),n.setAttribute("hidden","");const o=e.getAttribute("data-turbo-method");o&&n.setAttribute("method",o);const s=e.getAttribute("data-turbo-frame");s&&n.setAttribute("data-turbo-frame",s);const a=B(e);a&&n.setAttribute("data-turbo-action",a);const c=e.getAttribute("data-turbo-confirm");c&&n.setAttribute("data-turbo-confirm",c),e.hasAttribute("data-turbo-stream")&&n.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,n),document.body.appendChild(n),n.addEventListener("turbo:submit-end",(()=>n.remove()),{once:!0}),requestAnimationFrame((()=>n.requestSubmit()))}}class $e{static async preservingPermanentElements(e,t,n){const r=new this(e,t);r.enter(),await n(),r.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(const e in this.permanentElementMap){const[t,n]=this.permanentElementMap[e];this.delegate.enteringBardo(t,n),this.replaceNewPermanentElementWithPlaceholder(n)}}leave(){for(const e in this.permanentElementMap){const[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){const t=He(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){const t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){const t=this.getPlaceholderById(e.id);t?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find((t=>t.content==e))}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}}function He(e){const t=document.createElement("meta");return t.setAttribute("name","turbo-permanent-placeholder"),t.setAttribute("content",e.id),t}class Be{#a=null;constructor(e,t,n,r,i=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=r,this.willRender=i,this.renderElement=n,this.promise=new Promise(((e,t)=>this.resolvingFunctions={resolve:e,reject:t}))}get shouldRender(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await $e.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){const e=this.connectedSnapshot.firstAutofocusableElement;e&&e.focus()}enteringBardo(e){this.#a||e.contains(this.currentSnapshot.activeElement)&&(this.#a=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.#a)&&this.#a instanceof HTMLElement&&(this.#a.focus(),this.#a=null)}get connectedSnapshot(){return this.newSnapshot.isConnected?this.newSnapshot:this.currentSnapshot}get currentElement(){return this.currentSnapshot.element}get newElement(){return this.newSnapshot.element}get permanentElementMap(){return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot)}get renderMethod(){return"replace"}}class qe extends Be{static renderElement(e,t){const n=document.createRange();n.selectNodeContents(e),n.deleteContents();const r=t,i=r.ownerDocument?.createRange();i&&(i.selectNodeContents(r),e.appendChild(i.extractContents()))}constructor(e,t,n,r,i,o=!0){super(t,n,r,i,o),this.delegate=e}get shouldRender(){return!0}async render(){await A(),this.preservingPermanentElements((()=>{this.loadFrameElement()})),this.scrollFrameIntoView(),await A(),this.focusFirstAutofocusableElement(),await A(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){const e=this.currentElement.firstElementChild,t=ze(this.currentElement.getAttribute("data-autoscroll-block"),"end"),n=We(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:t,behavior:n}),!0}return!1}activateScriptElements(){for(const e of this.newScriptElements){const t=S(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}}function ze(e,t){return"end"==e||"start"==e||"center"==e||"nearest"==e?e:t}function We(e,t){return"auto"==e||"smooth"==e?e:t}class Ve{static animationDuration=300;static get defaultCSS(){return P` @@ -24,10 +24,10 @@ For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements —— Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s - `,e.outerHTML);e=e.parentElement}})(),window.Turbo={...nn,StreamActions:cn},Ut(),e.FetchEnctype=se,e.FetchMethod=ie,e.FetchRequest=ae,e.FetchResponse=_,e.FrameElement=o,e.FrameLoadingStyle=i,e.FrameRenderer=qe,e.PageRenderer=Lt,e.PageSnapshot=et,e.StreamActions=cn,e.StreamElement=ln,e.StreamSourceElement=un,e.cache=Wt,e.clearCache=Qt,e.connectStreamSource=Gt,e.disconnectStreamSource=Zt,e.fetch=ne,e.fetchEnctypeFromString=oe,e.fetchMethodFromString=re,e.isSafe=ce,e.navigator=Vt,e.registerAdapter=Kt,e.renderStreamMessage=Xt,e.session=zt,e.setConfirmMethod=en,e.setFormMode=tn,e.setProgressBarDelay=Jt,e.start=Ut,e.visit=Yt,Object.defineProperty(e,"__esModule",{value:!0})}(t)},548:function(e,t){"use strict";function n(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function r(e){return e instanceof n(e).Element||e instanceof Element}function i(e){return e instanceof n(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof n(e).ShadowRoot||e instanceof ShadowRoot)}Object.defineProperty(t,"__esModule",{value:!0});var s=Math.max,a=Math.min,c=Math.round;function l(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function u(){return!/^((?!chrome|android).)*safari/i.test(l())}function f(e,t,o){void 0===t&&(t=!1),void 0===o&&(o=!1);var s=e.getBoundingClientRect(),a=1,l=1;t&&i(e)&&(a=e.offsetWidth>0&&c(s.width)/e.offsetWidth||1,l=e.offsetHeight>0&&c(s.height)/e.offsetHeight||1);var f=(r(e)?n(e):window).visualViewport,d=!u()&&o,h=(s.left+(d&&f?f.offsetLeft:0))/a,p=(s.top+(d&&f?f.offsetTop:0))/l,m=s.width/a,g=s.height/l;return{width:m,height:g,top:p,right:h+m,bottom:p+g,left:h,x:h,y:p}}function d(e){var t=n(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function h(e){return e?(e.nodeName||"").toLowerCase():null}function p(e){return((r(e)?e.ownerDocument:e.document)||window.document).documentElement}function m(e){return f(p(e)).left+d(e).scrollLeft}function g(e){return n(e).getComputedStyle(e)}function v(e){var t=g(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function y(e,t,r){void 0===r&&(r=!1);var o,s,a=i(t),l=i(t)&&function(e){var t=e.getBoundingClientRect(),n=c(t.width)/e.offsetWidth||1,r=c(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),u=p(t),g=f(e,l,r),y={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(a||!a&&!r)&&(("body"!==h(t)||v(u))&&(y=(o=t)!==n(o)&&i(o)?{scrollLeft:(s=o).scrollLeft,scrollTop:s.scrollTop}:d(o)),i(t)?((b=f(t,!0)).x+=t.clientLeft,b.y+=t.clientTop):u&&(b.x=m(u))),{x:g.left+y.scrollLeft-b.x,y:g.top+y.scrollTop-b.y,width:g.width,height:g.height}}function b(e){var t=f(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function w(e){return"html"===h(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||p(e)}function _(e){return["html","body","#document"].indexOf(h(e))>=0?e.ownerDocument.body:i(e)&&v(e)?e:_(w(e))}function S(e,t){var r;void 0===t&&(t=[]);var i=_(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),s=n(i),a=o?[s].concat(s.visualViewport||[],v(i)?i:[]):i,c=t.concat(a);return o?c:c.concat(S(w(a)))}function O(e){return["table","td","th"].indexOf(h(e))>=0}function E(e){return i(e)&&"fixed"!==g(e).position?e.offsetParent:null}function x(e){for(var t=n(e),r=E(e);r&&O(r)&&"static"===g(r).position;)r=E(r);return r&&("html"===h(r)||"body"===h(r)&&"static"===g(r).position)?t:r||function(e){var t=/firefox/i.test(l());if(/Trident/i.test(l())&&i(e)&&"fixed"===g(e).position)return null;var n=w(e);for(o(n)&&(n=n.host);i(n)&&["html","body"].indexOf(h(n))<0;){var r=g(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var A="top",T="bottom",C="right",k="left",j="auto",P=[A,T,C,k],D="start",M="end",L="clippingParents",N="viewport",R="popper",I="reference",F=P.reduce((function(e,t){return e.concat([t+"-"+D,t+"-"+M])}),[]),$=[].concat(P,[j]).reduce((function(e,t){return e.concat([t,t+"-"+D,t+"-"+M])}),[]),H=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function B(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}function q(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function z(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function W(e,t,i){return t===N?z(function(e,t){var r=n(e),i=p(e),o=r.visualViewport,s=i.clientWidth,a=i.clientHeight,c=0,l=0;if(o){s=o.width,a=o.height;var f=u();(f||!f&&"fixed"===t)&&(c=o.offsetLeft,l=o.offsetTop)}return{width:s,height:a,x:c+m(e),y:l}}(e,i)):r(t)?function(e,t){var n=f(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,i):z(function(e){var t,n=p(e),r=d(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=s(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=s(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),c=-r.scrollLeft+m(e),l=-r.scrollTop;return"rtl"===g(i||n).direction&&(c+=s(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:c,y:l}}(p(e)))}function V(e,t,n,o){var c="clippingParents"===t?function(e){var t=S(w(e)),n=["absolute","fixed"].indexOf(g(e).position)>=0&&i(e)?x(e):e;return r(n)?t.filter((function(e){return r(e)&&q(e,n)&&"body"!==h(e)})):[]}(e):[].concat(t),l=[].concat(c,[n]),u=l[0],f=l.reduce((function(t,n){var r=W(e,n,o);return t.top=s(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=s(r.left,t.left),t}),W(e,u,o));return f.width=f.right-f.left,f.height=f.bottom-f.top,f.x=f.left,f.y=f.top,f}function U(e){return e.split("-")[0]}function K(e){return e.split("-")[1]}function Y(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function G(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?U(i):null,s=i?K(i):null,a=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case A:t={x:a,y:n.y-r.height};break;case T:t={x:a,y:n.y+n.height};break;case C:t={x:n.x+n.width,y:c};break;case k:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?Y(o):null;if(null!=l){var u="y"===l?"height":"width";switch(s){case D:t[l]=t[l]-(n[u]/2-r[u]/2);break;case M:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}function Z(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function X(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Q(e,t){void 0===t&&(t={});var n=t,i=n.placement,o=void 0===i?e.placement:i,s=n.strategy,a=void 0===s?e.strategy:s,c=n.boundary,l=void 0===c?L:c,u=n.rootBoundary,d=void 0===u?N:u,h=n.elementContext,m=void 0===h?R:h,g=n.altBoundary,v=void 0!==g&&g,y=n.padding,b=void 0===y?0:y,w=Z("number"!=typeof b?b:X(b,P)),_=m===R?I:R,S=e.rects.popper,O=e.elements[v?_:m],E=V(r(O)?O:O.contextElement||p(e.elements.popper),l,d,a),x=f(e.elements.reference),k=G({reference:x,element:S,strategy:"absolute",placement:o}),j=z(Object.assign({},S,k)),D=m===R?j:x,M={top:E.top-D.top+w.top,bottom:D.bottom-E.bottom+w.bottom,left:E.left-D.left+w.left,right:D.right-E.right+w.right},F=e.modifiersData.offset;if(m===R&&F){var $=F[o];Object.keys(M).forEach((function(e){var t=[C,T].indexOf(e)>=0?1:-1,n=[A,T].indexOf(e)>=0?"y":"x";M[e]+=$[n]*t}))}return M}var J={placement:"bottom",modifiers:[],strategy:"absolute"};function ee(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function te(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,i=void 0===n?[]:n,o=t.defaultOptions,s=void 0===o?J:o;return function(e,t,n){void 0===n&&(n=s);var o,a,c={placement:"bottom",orderedModifiers:[],options:Object.assign({},J,s),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],u=!1,f={state:c,setOptions:function(n){var o="function"==typeof n?n(c.options):n;d(),c.options=Object.assign({},s,c.options,o),c.scrollParents={reference:r(e)?S(e):e.contextElement?S(e.contextElement):[],popper:S(t)};var a,u,h=function(e){var t=B(e);return H.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((a=[].concat(i,c.options.modifiers),u=a.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(u).map((function(e){return u[e]}))));return c.orderedModifiers=h.filter((function(e){return e.enabled})),c.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:c,name:t,instance:f,options:r}),s=function(){};l.push(o||s)}})),f.update()},forceUpdate:function(){if(!u){var e=c.elements,t=e.reference,n=e.popper;if(ee(t,n)){c.rects={reference:y(t,x(n),"fixed"===c.options.strategy),popper:b(n)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach((function(e){return c.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<c.orderedModifiers.length;r++)if(!0!==c.reset){var i=c.orderedModifiers[r],o=i.fn,s=i.options,a=void 0===s?{}:s,l=i.name;"function"==typeof o&&(c=o({state:c,options:a,name:l,instance:f})||c)}else c.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(e){f.forceUpdate(),e(c)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(o())}))}))),a}),destroy:function(){d(),u=!0}};if(!ee(e,t))return f;function d(){l.forEach((function(e){return e()})),l=[]}return f.setOptions(n).then((function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)})),f}}var ne={passive:!0};var re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,i=e.options,o=i.scroll,s=void 0===o||o,a=i.resize,c=void 0===a||a,l=n(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&u.forEach((function(e){e.addEventListener("scroll",r.update,ne)})),c&&l.addEventListener("resize",r.update,ne),function(){s&&u.forEach((function(e){e.removeEventListener("scroll",r.update,ne)})),c&&l.removeEventListener("resize",r.update,ne)}},data:{}};var ie={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=G({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},oe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function se(e){var t,r=e.popper,i=e.popperRect,o=e.placement,s=e.variation,a=e.offsets,l=e.position,u=e.gpuAcceleration,f=e.adaptive,d=e.roundOffsets,h=e.isFixed,m=a.x,v=void 0===m?0:m,y=a.y,b=void 0===y?0:y,w="function"==typeof d?d({x:v,y:b}):{x:v,y:b};v=w.x,b=w.y;var _=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),O=k,E=A,j=window;if(f){var P=x(r),D="clientHeight",L="clientWidth";if(P===n(r)&&"static"!==g(P=p(r)).position&&"absolute"===l&&(D="scrollHeight",L="scrollWidth"),o===A||(o===k||o===C)&&s===M)E=T,b-=(h&&P===j&&j.visualViewport?j.visualViewport.height:P[D])-i.height,b*=u?1:-1;if(o===k||(o===A||o===T)&&s===M)O=C,v-=(h&&P===j&&j.visualViewport?j.visualViewport.width:P[L])-i.width,v*=u?1:-1}var N,R=Object.assign({position:l},f&&oe),I=!0===d?function(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:c(n*i)/i||0,y:c(r*i)/i||0}}({x:v,y:b},n(r)):{x:v,y:b};return v=I.x,b=I.y,u?Object.assign({},R,((N={})[E]=S?"0":"",N[O]=_?"0":"",N.transform=(j.devicePixelRatio||1)<=1?"translate("+v+"px, "+b+"px)":"translate3d("+v+"px, "+b+"px, 0)",N)):Object.assign({},R,((t={})[E]=S?b+"px":"",t[O]=_?v+"px":"",t.transform="",t))}var ae={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,c=void 0===a||a,l={placement:U(t.placement),variation:K(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,se(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,se(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var ce={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];i(o)&&h(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});i(r)&&h(r)&&(Object.assign(r.style,s),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var le={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,s=$.reduce((function(e,n){return e[n]=function(e,t,n){var r=U(e),i=[k,A].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[k,C].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,o),e}),{}),a=s[t.placement],c=a.x,l=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=s}},ue={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,(function(e){return ue[e]}))}var de={start:"end",end:"start"};function he(e){return e.replace(/start|end/g,(function(e){return de[e]}))}function pe(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?$:c,u=K(r),f=u?a?F:F.filter((function(e){return K(e)===u})):P,d=f.filter((function(e){return l.indexOf(e)>=0}));0===d.length&&(d=f);var h=d.reduce((function(t,n){return t[n]=Q(e,{placement:n,boundary:i,rootBoundary:o,padding:s})[U(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var me={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,c=n.fallbackPlacements,l=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=void 0===h||h,m=n.allowedAutoPlacements,g=t.options.placement,v=U(g),y=c||(v===g||!p?[fe(g)]:function(e){if(U(e)===j)return[];var t=fe(e);return[he(e),t,he(t)]}(g)),b=[g].concat(y).reduce((function(e,n){return e.concat(U(n)===j?pe(t,{placement:n,boundary:u,rootBoundary:f,padding:l,flipVariations:p,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,_=t.rects.popper,S=new Map,O=!0,E=b[0],x=0;x<b.length;x++){var P=b[x],M=U(P),L=K(P)===D,N=[A,T].indexOf(M)>=0,R=N?"width":"height",I=Q(t,{placement:P,boundary:u,rootBoundary:f,altBoundary:d,padding:l}),F=N?L?C:k:L?T:A;w[R]>_[R]&&(F=fe(F));var $=fe(F),H=[];if(o&&H.push(I[M]<=0),a&&H.push(I[F]<=0,I[$]<=0),H.every((function(e){return e}))){E=P,O=!1;break}S.set(P,H)}if(O)for(var B=function(e){var t=b.find((function(t){var n=S.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},q=p?3:1;q>0;q--){if("break"===B(q))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ge(e,t,n){return s(e,a(t,n))}var ve={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,c=n.altAxis,l=void 0!==c&&c,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.padding,p=n.tether,m=void 0===p||p,g=n.tetherOffset,v=void 0===g?0:g,y=Q(t,{boundary:u,rootBoundary:f,padding:h,altBoundary:d}),w=U(t.placement),_=K(t.placement),S=!_,O=Y(w),E="x"===O?"y":"x",j=t.modifiersData.popperOffsets,P=t.rects.reference,M=t.rects.popper,L="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,N="number"==typeof L?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(j){if(o){var F,$="y"===O?A:k,H="y"===O?T:C,B="y"===O?"height":"width",q=j[O],z=q+y[$],W=q-y[H],V=m?-M[B]/2:0,G=_===D?P[B]:M[B],Z=_===D?-M[B]:-P[B],X=t.elements.arrow,J=m&&X?b(X):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[$],ne=ee[H],re=ge(0,P[B],J[B]),ie=S?P[B]/2-V-re-te-N.mainAxis:G-re-te-N.mainAxis,oe=S?-P[B]/2+V+re+ne+N.mainAxis:Z+re+ne+N.mainAxis,se=t.elements.arrow&&x(t.elements.arrow),ae=se?"y"===O?se.clientTop||0:se.clientLeft||0:0,ce=null!=(F=null==R?void 0:R[O])?F:0,le=q+oe-ce,ue=ge(m?a(z,q+ie-ce-ae):z,q,m?s(W,le):W);j[O]=ue,I[O]=ue-q}if(l){var fe,de="x"===O?A:k,he="x"===O?T:C,pe=j[E],me="y"===E?"height":"width",ve=pe+y[de],ye=pe-y[he],be=-1!==[A,k].indexOf(w),we=null!=(fe=null==R?void 0:R[E])?fe:0,_e=be?ve:pe-P[me]-M[me]-we+N.altAxis,Se=be?pe+P[me]+M[me]-we-N.altAxis:ye,Oe=m&&be?function(e,t,n){var r=ge(e,t,n);return r>n?n:r}(_e,pe,Se):ge(m?_e:ve,pe,m?Se:ye);j[E]=Oe,I[E]=Oe-pe}t.modifiersData[r]=I}},requiresIfExists:["offset"]};var ye={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=U(n.placement),c=Y(a),l=[k,C].indexOf(a)>=0?"height":"width";if(o&&s){var u=function(e,t){return Z("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:X(e,P))}(i.padding,n),f=b(o),d="y"===c?A:k,h="y"===c?T:C,p=n.rects.reference[l]+n.rects.reference[c]-s[c]-n.rects.popper[l],m=s[c]-n.rects.reference[c],g=x(o),v=g?"y"===c?g.clientHeight||0:g.clientWidth||0:0,y=p/2-m/2,w=u[d],_=v-f[l]-u[h],S=v/2-f[l]/2+y,O=ge(w,S,_),E=c;n.modifiersData[r]=((t={})[E]=O,t.centerOffset=O-S,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&q(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function be(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function we(e){return[A,C,T,k].some((function(t){return e[t]>=0}))}var _e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=Q(t,{elementContext:"reference"}),a=Q(t,{altBoundary:!0}),c=be(s,r),l=be(a,i,o),u=we(c),f=we(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}},Se=te({defaultModifiers:[re,ie,ae,ce]}),Oe=[re,ie,ae,ce,le,me,ve,ye,_e],Ee=te({defaultModifiers:Oe});t.applyStyles=ce,t.arrow=ye,t.computeStyles=ae,t.createPopper=Ee,t.createPopperLite=Se,t.defaultModifiers=Oe,t.detectOverflow=Q,t.eventListeners=re,t.flip=me,t.hide=_e,t.offset=le,t.popperGenerator=te,t.popperOffsets=ie,t.preventOverflow=ve},9044:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var r=n(6927),i=n(2233);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function c(e,t,n){return t=u(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),c(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),n=t,r=[{key:"fetch",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,i.q)(e,t)}},{key:"fetchTurboStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,i.h)(e,t)}},{key:"csrfToken",get:function(){return document.querySelector("[name='csrf-token']").content}}],r&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(r.Controller)},4448:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function o(e,t,n){return t=a(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,n||[],a(e).constructor):t.apply(e,n))}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(s=function(){return!!e})()}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}n.r(t),n.d(t,{default:function(){return h}});var u,f,d,h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),o(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e),n=t,(r=[{key:"toggle",value:function(){this.updateSelectAllState()}},{key:"toggleAll",value:function(){var e=this.selectAllTarget.checked;this.checkboxTargets.forEach((function(t){t.checked=e}))}},{key:"updateSelectAllState",value:function(){var e=this.checked,t=this.checkboxTargets;e.length===t.length?(this.selectAllTarget.indeterminate=!1,this.selectAllTarget.checked=!0):0==e.length?(this.selectAllTarget.indeterminate=!1,this.selectAllTarget.checked=!1):this.selectAllTarget.indeterminate=!0}},{key:"checked",get:function(){return this.checkboxTargets.filter((function(e){return e.checked}))}},{key:"unchecked",get:function(){return this.checkboxTargets.filter((function(e){return!e.checked}))}}])&&i(n.prototype,r),s&&i(n,s),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,s}(n(9044).default);u=h,d=["checkbox","selectAll"],(f=l(f="targets"))in u?Object.defineProperty(u,f,{value:d,enumerable:!0,configurable:!0,writable:!0}):u[f]=d},6698:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return g}});var r=n(2489),i=n(7557);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,m(r.key),r)}}function l(e,t,n){return t=d(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function f(){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},f.apply(null,arguments)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function p(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(t,e),n=t,r=[{key:"initialize",value:function(){f(d(t.prototype),"initialize",this).call(this),this.boundOnClick=this.onClick.bind(this),this.confirmed=!1}},{key:"connect",value:function(){f(d(t.prototype),"connect",this).call(this),this.element.addEventListener("click",this.boundOnClick,{capture:!0})}},{key:"disconnect",value:function(){f(d(t.prototype),"disconnect",this).call(this),this.element.removeEventListener("click",this.boundOnClick,{capture:!0})}},{key:"onClick",value:function(e){this.confirmed||(e.preventDefault(),e.stopImmediatePropagation(),this.toggle())}},{key:"confirm",value:function(){this.popover.dispose(),this.confirmed=!0,this.element.click(),this.confirmed=!1}},{key:"cancel",value:function(){this.popover.hide()}},{key:"popoverOptions",get:function(){return a(a({},f(d(t.prototype),"popoverOptions",this)),{},{html:!0})}},{key:"content",get:function(){var e=document.createElement("div");return e.classList.add("btn-group"),e.appendChild(this.confirmButton),e.appendChild(this.cancelButton),e}},{key:"confirmButton",get:function(){var e=document.createElement("button");return e.classList.add("btn","btn-sm",this.confirmButtonClass),e.textContent=this.confirmLabel,e.addEventListener("click",this.confirm.bind(this)),e}},{key:"cancelButton",get:function(){var e=document.createElement("button");return e.classList.add("btn","btn-sm",this.cancelButtonClass),e.textContent=this.cancelLabel,e.addEventListener("click",this.cancel.bind(this)),e}},{key:"title",get:function(){return this.titleValue||i.R.t("trestle.confirmation.title",{defaultValue:"Are you sure?"})}},{key:"confirmLabel",get:function(){return this.confirmLabelValue||i.R.t("trestle.confirmation.ok",{defaultValue:"OK"})}},{key:"cancelLabel",get:function(){return this.cancelLabelValue||i.R.t("trestle.confirmation.cancel",{defaultValue:"Cancel"})}},{key:"confirmButtonClass",get:function(){return this.hasConfirmClass?this.confirmClass:this.constructor.defaultConfirmClass}},{key:"cancelButtonClass",get:function(){return this.hasCancelClass?this.cancelClass:this.constructor.defaultCancelClass}}],r&&c(n.prototype,r),o&&c(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(r.default);p(g,"values",{confirmLabel:String,cancelLabel:String}),p(g,"classes",["confirm","cancel"]),p(g,"defaultConfirmClass","btn-primary"),p(g,"defaultCancelClass","btn-light")},5512:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var r=n(6698),i=n(7557);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function a(e,t,n){return t=l(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,n||[],l(e).constructor):t.apply(e,n))}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function f(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(t,e),n=t,r&&s(n.prototype,r),i&&s(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(r.default);f(h,"values",{confirmLabel:i.R["trestle.confirmation.delete"]||"Delete"}),f(h,"defaultConfirmClass","btn-danger")},1724:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return g}});var r=n(8770),i=n(7557);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function f(e,t,n){return t=p(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,d()?Reflect.construct(t,n||[],p(e).constructor):t.apply(e,n))}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},h.apply(null,arguments)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}var g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),f(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(t,e),n=t,(r=[{key:"options",get:function(){return a(a({},h(p(t.prototype),"options",this)),{},{altFormat:i.R.t("admin.datepicker.formats.date",{defaultValue:"m/d/Y"})})}}])&&l(n.prototype,r),o&&l(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(r.default)},4735:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return g}});var r=n(8770),i=n(7557);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function f(e,t,n){return t=p(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,d()?Reflect.construct(t,n||[],p(e).constructor):t.apply(e,n))}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},h.apply(null,arguments)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}var g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),f(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(t,e),n=t,(r=[{key:"options",get:function(){return a(a({},h(p(t.prototype),"options",this)),{},{enableTime:!0,altFormat:i.R.t("admin.datepicker.formats.datetime",{defaultValue:"m/d/Y h:i K"})})}}])&&l(n.prototype,r),o&&l(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(r.default)},8778:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var r=n(6927),i=n(826);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function c(e,t,n){return t=u(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),c(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),n=t,(r=[{key:"connect",value:function(){(0,i.BQ)(this.element)}}])&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(r.Controller)},8770:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return g}});var r=n(9044),i=n(8404),o=n.n(i);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function f(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}function d(e,t,n){return t=p(t),function(e,t){if(t&&("object"==s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,n||[],p(e).constructor):t.apply(e,n))}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}var g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),d(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(t,e),n=t,r=[{key:"connect",value:function(){this.flatpickr=o()(this.element,c(c({},this.options),{},{onReady:this.setup.bind(this)}))}},{key:"disconnect",value:function(){this.flatpickr.destroy()}},{key:"clear",value:function(){this.element.disabled||this.element.classList.contains("disabled")||this.flatpickr.clear()}},{key:"setup",value:function(e,t,n){this._createClearButton(n)}},{key:"options",get:function(){return{allowInput:!0,altInput:!0}}},{key:"_createClearButton",value:function(e){var t=this;if(this.element.dataset.allowClear){var n=document.createElement("button");n.classList.add("clear-datepicker"),n.addEventListener("click",(function(e){e.preventDefault(),t.clear()})),e.altInput.parentNode.insertBefore(n,e.altInput)}}}],r&&u(n.prototype,r),i&&u(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(r.default)},8535:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var r=n(9044),i=n(4140),o=n(5204);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}function l(e,t,n){return t=f(t),function(e,t){if(t&&("object"==s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}var h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(t,e),n=t,r=[{key:"follow",value:function(e){!this.ignoreElement(e.target)&&this.url&&(this.isModal?o.A.load(this.url):e.metaKey||e.ctrlKey?window.open(this.url,"_blank"):(0,i.visit)(this.url))}},{key:"url",get:function(){return"auto"===this.element.dataset.url?this.element.querySelector("td:not(.table-actions) a").href:this.element.dataset.url}},{key:"isModal",get:function(){return this.element.dataset.modal}},{key:"ignoreElement",value:function(e){return e.matches("a, input, button, .select-row")}}],r&&a(n.prototype,r),s&&a(n,s),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,s}(r.default)},9419:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var r=n(9044),i=n(2205);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function c(e,t,n){return t=u(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),c(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),n=t,r=[{key:"connect",value:function(){this.element.addEventListener("turbo:before-fetch-response",this.handleFormResponse)}},{key:"disconnect",value:function(){this.element.removeEventListener("turbo:before-fetch-response",this.handleFormResponse)}},{key:"handleFormResponse",value:function(e){var t=e.detail.fetchResponse.response;if(t.status>=500){e.preventDefault();var n="".concat(t.status," (").concat(t.statusText,")");t.text().then((function(e){return i.A.show({title:n,content:e})}))}}}],r&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(r.default)},4761:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var r=n(9044);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}function a(e,t,n){return t=l(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,n||[],l(e).constructor):t.apply(e,n))}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}var f='input[type="submit"], button[type="submit"]',d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(t,e),n=t,r=[{key:"initialize",value:function(){this.boundSubmit=this.submit.bind(this),this.boundReset=this.reset.bind(this)}},{key:"connect",value:function(){this.element.addEventListener("submit",this.boundSubmit),this.element.addEventListener("turbo:before-fetch-response",this.boundReset)}},{key:"disconnect",value:function(){this.element.removeEventListener("submit",this.boundSubmit),this.element.removeEventListener("turbo:before-fetch-response",this.boundReset)}},{key:"submit",value:function(e){this.disableButtons(),this.setLoading(e.submitter||this.element.querySelector(f))}},{key:"reset",value:function(e){this.restoreButtons()}},{key:"setLoading",value:function(e){e.classList.add("loading")}},{key:"disableButtons",value:function(e){this.submitButtons.forEach((function(e){e.disabled=!0}))}},{key:"restoreButtons",value:function(){this.submitButtons.forEach((function(e){e.classList.remove("loading"),e.disabled=!1}))}},{key:"submitButtons",get:function(){return this.element.querySelectorAll(f)}}],r&&o(n.prototype,r),i&&o(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(r.default)},6023:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function l(e,t,n){return t=d(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function f(){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},f.apply(null,arguments)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}n.r(t),n.d(t,{default:function(){return p}});var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(t,e),n=t,(r=[{key:"options",get:function(){return o(o({},f(d(t.prototype),"options",this)),{},{children:this.imageTargets})}}])&&a(n.prototype,r),i&&a(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(n(6229).default)},8619:function(e,t,n){"use strict";n.r(t),n.d(t,{ApplicationController:function(){return o.default},Controllers:function(){return d}});var r=n(6927),i=n(727),o=n(9044);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}window.Stimulus=r.Application.start();var u=n(2036),f=(0,i.definitionsFromContext)(u);Stimulus.load(f);var d=f.reduce((function(e,t){return c(c({},e),{},l({},t.identifier,t.controllerConstructor))}),{})},2596:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function o(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function s(e,t,n){return t=c(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,a()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(a=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}n.r(t),n.d(t,{default:function(){return u}});var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),s(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,r=[{key:"initialize",value:function(){this.boundHandleKeyDown=this.handleKeyDown.bind(this)}},{key:"connect",value:function(){this.element.addEventListener("keydown",this.boundHandleKeyDown)}},{key:"disconnect",value:function(){this.element.removeEventListener("keydown",this.boundHandleKeyDown)}},{key:"handleKeyDown",value:function(e){"Enter"===e.key&&this.preventEnterKey(e.target)&&e.preventDefault()}},{key:"preventEnterKey",value:function(e){return e.matches('input:not([type="submit"])')}}],r&&i(n.prototype,r),o&&i(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(n(9044).default)},6229:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return q}});var r=n(9044),i=n(2460); + `,e.outerHTML);e=e.parentElement}})(),window.Turbo={...nn,StreamActions:cn},Ut(),e.FetchEnctype=se,e.FetchMethod=ie,e.FetchRequest=ae,e.FetchResponse=_,e.FrameElement=o,e.FrameLoadingStyle=i,e.FrameRenderer=qe,e.PageRenderer=Lt,e.PageSnapshot=et,e.StreamActions=cn,e.StreamElement=ln,e.StreamSourceElement=un,e.cache=Wt,e.clearCache=Qt,e.connectStreamSource=Gt,e.disconnectStreamSource=Zt,e.fetch=ne,e.fetchEnctypeFromString=oe,e.fetchMethodFromString=re,e.isSafe=ce,e.navigator=Vt,e.registerAdapter=Kt,e.renderStreamMessage=Xt,e.session=zt,e.setConfirmMethod=en,e.setFormMode=tn,e.setProgressBarDelay=Jt,e.start=Ut,e.visit=Yt,Object.defineProperty(e,"__esModule",{value:!0})}(t)},548:function(e,t){"use strict";function n(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function r(e){return e instanceof n(e).Element||e instanceof Element}function i(e){return e instanceof n(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof n(e).ShadowRoot||e instanceof ShadowRoot)}Object.defineProperty(t,"__esModule",{value:!0});var s=Math.max,a=Math.min,c=Math.round;function l(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function u(){return!/^((?!chrome|android).)*safari/i.test(l())}function f(e,t,o){void 0===t&&(t=!1),void 0===o&&(o=!1);var s=e.getBoundingClientRect(),a=1,l=1;t&&i(e)&&(a=e.offsetWidth>0&&c(s.width)/e.offsetWidth||1,l=e.offsetHeight>0&&c(s.height)/e.offsetHeight||1);var f=(r(e)?n(e):window).visualViewport,d=!u()&&o,h=(s.left+(d&&f?f.offsetLeft:0))/a,p=(s.top+(d&&f?f.offsetTop:0))/l,m=s.width/a,g=s.height/l;return{width:m,height:g,top:p,right:h+m,bottom:p+g,left:h,x:h,y:p}}function d(e){var t=n(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function h(e){return e?(e.nodeName||"").toLowerCase():null}function p(e){return((r(e)?e.ownerDocument:e.document)||window.document).documentElement}function m(e){return f(p(e)).left+d(e).scrollLeft}function g(e){return n(e).getComputedStyle(e)}function v(e){var t=g(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function y(e,t,r){void 0===r&&(r=!1);var o,s,a=i(t),l=i(t)&&function(e){var t=e.getBoundingClientRect(),n=c(t.width)/e.offsetWidth||1,r=c(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),u=p(t),g=f(e,l,r),y={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(a||!a&&!r)&&(("body"!==h(t)||v(u))&&(y=(o=t)!==n(o)&&i(o)?{scrollLeft:(s=o).scrollLeft,scrollTop:s.scrollTop}:d(o)),i(t)?((b=f(t,!0)).x+=t.clientLeft,b.y+=t.clientTop):u&&(b.x=m(u))),{x:g.left+y.scrollLeft-b.x,y:g.top+y.scrollTop-b.y,width:g.width,height:g.height}}function b(e){var t=f(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function w(e){return"html"===h(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||p(e)}function _(e){return["html","body","#document"].indexOf(h(e))>=0?e.ownerDocument.body:i(e)&&v(e)?e:_(w(e))}function S(e,t){var r;void 0===t&&(t=[]);var i=_(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),s=n(i),a=o?[s].concat(s.visualViewport||[],v(i)?i:[]):i,c=t.concat(a);return o?c:c.concat(S(w(a)))}function O(e){return["table","td","th"].indexOf(h(e))>=0}function E(e){return i(e)&&"fixed"!==g(e).position?e.offsetParent:null}function x(e){for(var t=n(e),r=E(e);r&&O(r)&&"static"===g(r).position;)r=E(r);return r&&("html"===h(r)||"body"===h(r)&&"static"===g(r).position)?t:r||function(e){var t=/firefox/i.test(l());if(/Trident/i.test(l())&&i(e)&&"fixed"===g(e).position)return null;var n=w(e);for(o(n)&&(n=n.host);i(n)&&["html","body"].indexOf(h(n))<0;){var r=g(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}var A="top",T="bottom",C="right",k="left",j="auto",P=[A,T,C,k],D="start",M="end",L="clippingParents",N="viewport",R="popper",I="reference",F=P.reduce((function(e,t){return e.concat([t+"-"+D,t+"-"+M])}),[]),$=[].concat(P,[j]).reduce((function(e,t){return e.concat([t,t+"-"+D,t+"-"+M])}),[]),H=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function B(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}function q(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function z(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function W(e,t,i){return t===N?z(function(e,t){var r=n(e),i=p(e),o=r.visualViewport,s=i.clientWidth,a=i.clientHeight,c=0,l=0;if(o){s=o.width,a=o.height;var f=u();(f||!f&&"fixed"===t)&&(c=o.offsetLeft,l=o.offsetTop)}return{width:s,height:a,x:c+m(e),y:l}}(e,i)):r(t)?function(e,t){var n=f(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,i):z(function(e){var t,n=p(e),r=d(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=s(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=s(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),c=-r.scrollLeft+m(e),l=-r.scrollTop;return"rtl"===g(i||n).direction&&(c+=s(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:c,y:l}}(p(e)))}function V(e,t,n,o){var c="clippingParents"===t?function(e){var t=S(w(e)),n=["absolute","fixed"].indexOf(g(e).position)>=0&&i(e)?x(e):e;return r(n)?t.filter((function(e){return r(e)&&q(e,n)&&"body"!==h(e)})):[]}(e):[].concat(t),l=[].concat(c,[n]),u=l[0],f=l.reduce((function(t,n){var r=W(e,n,o);return t.top=s(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=s(r.left,t.left),t}),W(e,u,o));return f.width=f.right-f.left,f.height=f.bottom-f.top,f.x=f.left,f.y=f.top,f}function U(e){return e.split("-")[0]}function K(e){return e.split("-")[1]}function Y(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function G(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?U(i):null,s=i?K(i):null,a=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case A:t={x:a,y:n.y-r.height};break;case T:t={x:a,y:n.y+n.height};break;case C:t={x:n.x+n.width,y:c};break;case k:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var l=o?Y(o):null;if(null!=l){var u="y"===l?"height":"width";switch(s){case D:t[l]=t[l]-(n[u]/2-r[u]/2);break;case M:t[l]=t[l]+(n[u]/2-r[u]/2)}}return t}function Z(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function X(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Q(e,t){void 0===t&&(t={});var n=t,i=n.placement,o=void 0===i?e.placement:i,s=n.strategy,a=void 0===s?e.strategy:s,c=n.boundary,l=void 0===c?L:c,u=n.rootBoundary,d=void 0===u?N:u,h=n.elementContext,m=void 0===h?R:h,g=n.altBoundary,v=void 0!==g&&g,y=n.padding,b=void 0===y?0:y,w=Z("number"!=typeof b?b:X(b,P)),_=m===R?I:R,S=e.rects.popper,O=e.elements[v?_:m],E=V(r(O)?O:O.contextElement||p(e.elements.popper),l,d,a),x=f(e.elements.reference),k=G({reference:x,element:S,strategy:"absolute",placement:o}),j=z(Object.assign({},S,k)),D=m===R?j:x,M={top:E.top-D.top+w.top,bottom:D.bottom-E.bottom+w.bottom,left:E.left-D.left+w.left,right:D.right-E.right+w.right},F=e.modifiersData.offset;if(m===R&&F){var $=F[o];Object.keys(M).forEach((function(e){var t=[C,T].indexOf(e)>=0?1:-1,n=[A,T].indexOf(e)>=0?"y":"x";M[e]+=$[n]*t}))}return M}var J={placement:"bottom",modifiers:[],strategy:"absolute"};function ee(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function te(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,i=void 0===n?[]:n,o=t.defaultOptions,s=void 0===o?J:o;return function(e,t,n){void 0===n&&(n=s);var o,a,c={placement:"bottom",orderedModifiers:[],options:Object.assign({},J,s),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],u=!1,f={state:c,setOptions:function(n){var o="function"==typeof n?n(c.options):n;d(),c.options=Object.assign({},s,c.options,o),c.scrollParents={reference:r(e)?S(e):e.contextElement?S(e.contextElement):[],popper:S(t)};var a,u,h=function(e){var t=B(e);return H.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((a=[].concat(i,c.options.modifiers),u=a.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(u).map((function(e){return u[e]}))));return c.orderedModifiers=h.filter((function(e){return e.enabled})),c.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:c,name:t,instance:f,options:r}),s=function(){};l.push(o||s)}})),f.update()},forceUpdate:function(){if(!u){var e=c.elements,t=e.reference,n=e.popper;if(ee(t,n)){c.rects={reference:y(t,x(n),"fixed"===c.options.strategy),popper:b(n)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach((function(e){return c.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<c.orderedModifiers.length;r++)if(!0!==c.reset){var i=c.orderedModifiers[r],o=i.fn,s=i.options,a=void 0===s?{}:s,l=i.name;"function"==typeof o&&(c=o({state:c,options:a,name:l,instance:f})||c)}else c.reset=!1,r=-1}}},update:(o=function(){return new Promise((function(e){f.forceUpdate(),e(c)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(o())}))}))),a}),destroy:function(){d(),u=!0}};if(!ee(e,t))return f;function d(){l.forEach((function(e){return e()})),l=[]}return f.setOptions(n).then((function(e){!u&&n.onFirstUpdate&&n.onFirstUpdate(e)})),f}}var ne={passive:!0};var re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,i=e.options,o=i.scroll,s=void 0===o||o,a=i.resize,c=void 0===a||a,l=n(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&u.forEach((function(e){e.addEventListener("scroll",r.update,ne)})),c&&l.addEventListener("resize",r.update,ne),function(){s&&u.forEach((function(e){e.removeEventListener("scroll",r.update,ne)})),c&&l.removeEventListener("resize",r.update,ne)}},data:{}};var ie={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=G({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},oe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function se(e){var t,r=e.popper,i=e.popperRect,o=e.placement,s=e.variation,a=e.offsets,l=e.position,u=e.gpuAcceleration,f=e.adaptive,d=e.roundOffsets,h=e.isFixed,m=a.x,v=void 0===m?0:m,y=a.y,b=void 0===y?0:y,w="function"==typeof d?d({x:v,y:b}):{x:v,y:b};v=w.x,b=w.y;var _=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),O=k,E=A,j=window;if(f){var P=x(r),D="clientHeight",L="clientWidth";if(P===n(r)&&"static"!==g(P=p(r)).position&&"absolute"===l&&(D="scrollHeight",L="scrollWidth"),o===A||(o===k||o===C)&&s===M)E=T,b-=(h&&P===j&&j.visualViewport?j.visualViewport.height:P[D])-i.height,b*=u?1:-1;if(o===k||(o===A||o===T)&&s===M)O=C,v-=(h&&P===j&&j.visualViewport?j.visualViewport.width:P[L])-i.width,v*=u?1:-1}var N,R=Object.assign({position:l},f&&oe),I=!0===d?function(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:c(n*i)/i||0,y:c(r*i)/i||0}}({x:v,y:b},n(r)):{x:v,y:b};return v=I.x,b=I.y,u?Object.assign({},R,((N={})[E]=S?"0":"",N[O]=_?"0":"",N.transform=(j.devicePixelRatio||1)<=1?"translate("+v+"px, "+b+"px)":"translate3d("+v+"px, "+b+"px, 0)",N)):Object.assign({},R,((t={})[E]=S?b+"px":"",t[O]=_?v+"px":"",t.transform="",t))}var ae={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,c=void 0===a||a,l={placement:U(t.placement),variation:K(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,se(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,se(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var ce={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];i(o)&&h(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});i(r)&&h(r)&&(Object.assign(r.style,s),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};var le={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,s=$.reduce((function(e,n){return e[n]=function(e,t,n){var r=U(e),i=[k,A].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[k,C].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}(n,t.rects,o),e}),{}),a=s[t.placement],c=a.x,l=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=s}},ue={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,(function(e){return ue[e]}))}var de={start:"end",end:"start"};function he(e){return e.replace(/start|end/g,(function(e){return de[e]}))}function pe(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,l=void 0===c?$:c,u=K(r),f=u?a?F:F.filter((function(e){return K(e)===u})):P,d=f.filter((function(e){return l.indexOf(e)>=0}));0===d.length&&(d=f);var h=d.reduce((function(t,n){return t[n]=Q(e,{placement:n,boundary:i,rootBoundary:o,padding:s})[U(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var me={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,s=n.altAxis,a=void 0===s||s,c=n.fallbackPlacements,l=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=void 0===h||h,m=n.allowedAutoPlacements,g=t.options.placement,v=U(g),y=c||(v===g||!p?[fe(g)]:function(e){if(U(e)===j)return[];var t=fe(e);return[he(e),t,he(t)]}(g)),b=[g].concat(y).reduce((function(e,n){return e.concat(U(n)===j?pe(t,{placement:n,boundary:u,rootBoundary:f,padding:l,flipVariations:p,allowedAutoPlacements:m}):n)}),[]),w=t.rects.reference,_=t.rects.popper,S=new Map,O=!0,E=b[0],x=0;x<b.length;x++){var P=b[x],M=U(P),L=K(P)===D,N=[A,T].indexOf(M)>=0,R=N?"width":"height",I=Q(t,{placement:P,boundary:u,rootBoundary:f,altBoundary:d,padding:l}),F=N?L?C:k:L?T:A;w[R]>_[R]&&(F=fe(F));var $=fe(F),H=[];if(o&&H.push(I[M]<=0),a&&H.push(I[F]<=0,I[$]<=0),H.every((function(e){return e}))){E=P,O=!1;break}S.set(P,H)}if(O)for(var B=function(e){var t=b.find((function(t){var n=S.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},q=p?3:1;q>0;q--){if("break"===B(q))break}t.placement!==E&&(t.modifiersData[r]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ge(e,t,n){return s(e,a(t,n))}var ve={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,c=n.altAxis,l=void 0!==c&&c,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.padding,p=n.tether,m=void 0===p||p,g=n.tetherOffset,v=void 0===g?0:g,y=Q(t,{boundary:u,rootBoundary:f,padding:h,altBoundary:d}),w=U(t.placement),_=K(t.placement),S=!_,O=Y(w),E="x"===O?"y":"x",j=t.modifiersData.popperOffsets,P=t.rects.reference,M=t.rects.popper,L="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,N="number"==typeof L?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(j){if(o){var F,$="y"===O?A:k,H="y"===O?T:C,B="y"===O?"height":"width",q=j[O],z=q+y[$],W=q-y[H],V=m?-M[B]/2:0,G=_===D?P[B]:M[B],Z=_===D?-M[B]:-P[B],X=t.elements.arrow,J=m&&X?b(X):{width:0,height:0},ee=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=ee[$],ne=ee[H],re=ge(0,P[B],J[B]),ie=S?P[B]/2-V-re-te-N.mainAxis:G-re-te-N.mainAxis,oe=S?-P[B]/2+V+re+ne+N.mainAxis:Z+re+ne+N.mainAxis,se=t.elements.arrow&&x(t.elements.arrow),ae=se?"y"===O?se.clientTop||0:se.clientLeft||0:0,ce=null!=(F=null==R?void 0:R[O])?F:0,le=q+oe-ce,ue=ge(m?a(z,q+ie-ce-ae):z,q,m?s(W,le):W);j[O]=ue,I[O]=ue-q}if(l){var fe,de="x"===O?A:k,he="x"===O?T:C,pe=j[E],me="y"===E?"height":"width",ve=pe+y[de],ye=pe-y[he],be=-1!==[A,k].indexOf(w),we=null!=(fe=null==R?void 0:R[E])?fe:0,_e=be?ve:pe-P[me]-M[me]-we+N.altAxis,Se=be?pe+P[me]+M[me]-we-N.altAxis:ye,Oe=m&&be?function(e,t,n){var r=ge(e,t,n);return r>n?n:r}(_e,pe,Se):ge(m?_e:ve,pe,m?Se:ye);j[E]=Oe,I[E]=Oe-pe}t.modifiersData[r]=I}},requiresIfExists:["offset"]};var ye={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=U(n.placement),c=Y(a),l=[k,C].indexOf(a)>=0?"height":"width";if(o&&s){var u=function(e,t){return Z("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:X(e,P))}(i.padding,n),f=b(o),d="y"===c?A:k,h="y"===c?T:C,p=n.rects.reference[l]+n.rects.reference[c]-s[c]-n.rects.popper[l],m=s[c]-n.rects.reference[c],g=x(o),v=g?"y"===c?g.clientHeight||0:g.clientWidth||0:0,y=p/2-m/2,w=u[d],_=v-f[l]-u[h],S=v/2-f[l]/2+y,O=ge(w,S,_),E=c;n.modifiersData[r]=((t={})[E]=O,t.centerOffset=O-S,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&q(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function be(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function we(e){return[A,C,T,k].some((function(t){return e[t]>=0}))}var _e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,s=Q(t,{elementContext:"reference"}),a=Q(t,{altBoundary:!0}),c=be(s,r),l=be(a,i,o),u=we(c),f=we(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}},Se=te({defaultModifiers:[re,ie,ae,ce]}),Oe=[re,ie,ae,ce,le,me,ve,ye,_e],Ee=te({defaultModifiers:Oe});t.applyStyles=ce,t.arrow=ye,t.computeStyles=ae,t.createPopper=Ee,t.createPopperLite=Se,t.defaultModifiers=Oe,t.detectOverflow=Q,t.eventListeners=re,t.flip=me,t.hide=_e,t.offset=le,t.popperGenerator=te,t.popperOffsets=ie,t.preventOverflow=ve},9044:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var r=n(6927),i=n(2233);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function c(e,t,n){return t=u(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),c(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),n=t,r=[{key:"fetch",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,i.q)(e,t)}},{key:"fetchTurboStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,i.h)(e,t)}},{key:"csrfToken",get:function(){return document.querySelector("[name='csrf-token']").content}}],r&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(r.Controller)},8111:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function o(e,t,n){return t=a(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,n||[],a(e).constructor):t.apply(e,n))}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(s=function(){return!!e})()}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}n.r(t),n.d(t,{default:function(){return h}});var u,f,d,h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),o(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e),n=t,(r=[{key:"connect",value:function(){this.hasCheckboxSelectOutlet||this.element.setAttribute("data-".concat(this.identifier,"-checkbox-select-outlet"),".trestle-table"),this.baseHref=this.element.href,this.update()}},{key:"update",value:function(){this.toggleEnabled(),this.updateHref()}},{key:"toggleEnabled",value:function(){this.element.classList.toggle("disabled",0===this.checkboxes.length)}},{key:"updateHref",value:function(){this.element.href=this.hrefWithSelectedIds}},{key:"checkboxes",get:function(){return this.hasCheckboxSelectOutlet?this.checkboxSelectOutlet.checked:[]}},{key:"selectedIds",get:function(){return this.checkboxes.map((function(e){return e.value}))}},{key:"hrefWithSelectedIds",get:function(){var e=this.selectedIds;return e.length?"".concat(this.baseHref,"?ids=").concat(e.join(",")):this.baseHref}},{key:"checkboxSelectOutletConnected",value:function(e,t){t.addEventListener("checkbox-select:change",this.update.bind(this))}},{key:"checkboxSelectOutletDisconnected",value:function(e,t){t.removeEventListener("checkbox-select:change",this.update.bind(this))}}])&&i(n.prototype,r),s&&i(n,s),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,s}(n(9044).default);u=h,d=["checkbox-select"],(f=l(f="outlets"))in u?Object.defineProperty(u,f,{value:d,enumerable:!0,configurable:!0,writable:!0}):u[f]=d},4448:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function o(e,t,n){return t=a(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,n||[],a(e).constructor):t.apply(e,n))}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(s=function(){return!!e})()}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}n.r(t),n.d(t,{default:function(){return h}});var u,f,d,h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),o(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(t,e),n=t,(r=[{key:"toggle",value:function(){this.updateSelectAllState(),this.dispatch("change")}},{key:"toggleAll",value:function(){var e=this.selectAllTarget.checked;this.checkboxTargets.forEach((function(t){t.checked=e})),this.dispatch("change")}},{key:"updateSelectAllState",value:function(){var e=this.checked,t=this.checkboxTargets;e.length===t.length?(this.selectAllTarget.indeterminate=!1,this.selectAllTarget.checked=!0):0==e.length?(this.selectAllTarget.indeterminate=!1,this.selectAllTarget.checked=!1):this.selectAllTarget.indeterminate=!0}},{key:"checked",get:function(){return this.checkboxTargets.filter((function(e){return e.checked}))}},{key:"unchecked",get:function(){return this.checkboxTargets.filter((function(e){return!e.checked}))}}])&&i(n.prototype,r),s&&i(n,s),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,s}(n(9044).default);u=h,d=["checkbox","selectAll"],(f=l(f="targets"))in u?Object.defineProperty(u,f,{value:d,enumerable:!0,configurable:!0,writable:!0}):u[f]=d},6698:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return g}});var r=n(2489),i=n(7557);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,m(r.key),r)}}function l(e,t,n){return t=d(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function f(){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},f.apply(null,arguments)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}function p(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(t,e),n=t,r=[{key:"initialize",value:function(){f(d(t.prototype),"initialize",this).call(this),this.boundOnClick=this.onClick.bind(this),this.confirmed=!1}},{key:"connect",value:function(){f(d(t.prototype),"connect",this).call(this),this.element.addEventListener("click",this.boundOnClick,{capture:!0})}},{key:"disconnect",value:function(){f(d(t.prototype),"disconnect",this).call(this),this.element.removeEventListener("click",this.boundOnClick,{capture:!0})}},{key:"onClick",value:function(e){this.confirmed||(e.preventDefault(),e.stopImmediatePropagation(),this.toggle())}},{key:"confirm",value:function(){this.popover.dispose(),this.confirmed=!0,this.element.click(),this.confirmed=!1}},{key:"cancel",value:function(){this.popover.hide()}},{key:"popoverOptions",get:function(){return a(a({},f(d(t.prototype),"popoverOptions",this)),{},{html:!0})}},{key:"content",get:function(){var e=document.createElement("div");return e.classList.add("btn-group"),e.appendChild(this.confirmButton),e.appendChild(this.cancelButton),e}},{key:"confirmButton",get:function(){var e=document.createElement("button");return e.classList.add("btn","btn-sm",this.confirmButtonClass),e.textContent=this.confirmLabel,e.addEventListener("click",this.confirm.bind(this)),e}},{key:"cancelButton",get:function(){var e=document.createElement("button");return e.classList.add("btn","btn-sm",this.cancelButtonClass),e.textContent=this.cancelLabel,e.addEventListener("click",this.cancel.bind(this)),e}},{key:"title",get:function(){return this.titleValue||i.R.t("trestle.confirmation.title",{defaultValue:"Are you sure?"})}},{key:"confirmLabel",get:function(){return this.confirmLabelValue||i.R.t("trestle.confirmation.ok",{defaultValue:"OK"})}},{key:"cancelLabel",get:function(){return this.cancelLabelValue||i.R.t("trestle.confirmation.cancel",{defaultValue:"Cancel"})}},{key:"confirmButtonClass",get:function(){return this.hasConfirmClass?this.confirmClass:this.constructor.defaultConfirmClass}},{key:"cancelButtonClass",get:function(){return this.hasCancelClass?this.cancelClass:this.constructor.defaultCancelClass}}],r&&c(n.prototype,r),o&&c(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(r.default);p(g,"values",{confirmLabel:String,cancelLabel:String}),p(g,"classes",["confirm","cancel"]),p(g,"defaultConfirmClass","btn-primary"),p(g,"defaultCancelClass","btn-light")},5512:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var r=n(6698),i=n(7557);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function a(e,t,n){return t=l(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,n||[],l(e).constructor):t.apply(e,n))}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function f(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(t,e),n=t,r&&s(n.prototype,r),i&&s(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(r.default);f(h,"values",{confirmLabel:i.R["trestle.confirmation.delete"]||"Delete"}),f(h,"defaultConfirmClass","btn-danger")},1724:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return g}});var r=n(8770),i=n(7557);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function f(e,t,n){return t=p(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,d()?Reflect.construct(t,n||[],p(e).constructor):t.apply(e,n))}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},h.apply(null,arguments)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}var g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),f(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(t,e),n=t,(r=[{key:"options",get:function(){return a(a({},h(p(t.prototype),"options",this)),{},{altFormat:i.R.t("admin.datepicker.formats.date",{defaultValue:"m/d/Y"})})}}])&&l(n.prototype,r),o&&l(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(r.default)},4735:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return g}});var r=n(8770),i=n(7557);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function u(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function f(e,t,n){return t=p(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,d()?Reflect.construct(t,n||[],p(e).constructor):t.apply(e,n))}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(d=function(){return!!e})()}function h(){return h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=p(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},h.apply(null,arguments)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}var g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),f(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(t,e),n=t,(r=[{key:"options",get:function(){return a(a({},h(p(t.prototype),"options",this)),{},{enableTime:!0,altFormat:i.R.t("admin.datepicker.formats.datetime",{defaultValue:"m/d/Y h:i K"})})}}])&&l(n.prototype,r),o&&l(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(r.default)},8778:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var r=n(6927),i=n(826);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function c(e,t,n){return t=u(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),c(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),n=t,(r=[{key:"connect",value:function(){(0,i.BQ)(this.element)}}])&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(r.Controller)},8770:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return g}});var r=n(9044),i=n(8404),o=n.n(i);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}function f(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}function d(e,t,n){return t=p(t),function(e,t){if(t&&("object"==s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,n||[],p(e).constructor):t.apply(e,n))}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(h=function(){return!!e})()}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function m(e,t){return m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},m(e,t)}var g=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),d(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(t,e),n=t,r=[{key:"connect",value:function(){this.flatpickr=o()(this.element,c(c({},this.options),{},{onReady:this.setup.bind(this)}))}},{key:"disconnect",value:function(){this.flatpickr.destroy()}},{key:"clear",value:function(){this.element.disabled||this.element.classList.contains("disabled")||this.flatpickr.clear()}},{key:"setup",value:function(e,t,n){this._createClearButton(n)}},{key:"options",get:function(){return{allowInput:!0,altInput:!0}}},{key:"_createClearButton",value:function(e){var t=this;if(this.element.dataset.allowClear){var n=document.createElement("button");n.classList.add("clear-datepicker"),n.addEventListener("click",(function(e){e.preventDefault(),t.clear()})),e.altInput.parentNode.insertBefore(n,e.altInput)}}}],r&&u(n.prototype,r),i&&u(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(r.default)},8535:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var r=n(9044),i=n(4140),o=n(5204);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}function l(e,t,n){return t=f(t),function(e,t){if(t&&("object"==s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],f(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}var h=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(t,e),n=t,r=[{key:"follow",value:function(e){!this.ignoreElement(e.target)&&this.url&&(this.isModal?o.A.load(this.url):e.metaKey||e.ctrlKey?window.open(this.url,"_blank"):(0,i.visit)(this.url))}},{key:"url",get:function(){return"auto"===this.element.dataset.url?this.element.querySelector("td:not(.table-actions) a").href:this.element.dataset.url}},{key:"isModal",get:function(){return this.element.dataset.modal}},{key:"ignoreElement",value:function(e){return e.matches("a, input, button, .select-row")}}],r&&a(n.prototype,r),s&&a(n,s),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,s}(r.default)},9419:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var r=n(9044),i=n(2205);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function a(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}function c(e,t,n){return t=u(t),function(e,t){if(t&&("object"==o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,n||[],u(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),c(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),n=t,r=[{key:"connect",value:function(){this.element.addEventListener("turbo:before-fetch-response",this.handleFormResponse)}},{key:"disconnect",value:function(){this.element.removeEventListener("turbo:before-fetch-response",this.handleFormResponse)}},{key:"handleFormResponse",value:function(e){var t=e.detail.fetchResponse.response;if(t.status>=500){e.preventDefault();var n="".concat(t.status," (").concat(t.statusText,")");t.text().then((function(e){return i.A.show({title:n,content:e})}))}}}],r&&s(n.prototype,r),o&&s(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(r.default)},4761:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var r=n(9044);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,s(r.key),r)}}function s(e){var t=function(e,t){if("object"!=i(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==i(t)?t:t+""}function a(e,t,n){return t=l(t),function(e,t){if(t&&("object"==i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,c()?Reflect.construct(t,n||[],l(e).constructor):t.apply(e,n))}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(c=function(){return!!e})()}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}var f='input[type="submit"], button[type="submit"]',d=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),a(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(t,e),n=t,r=[{key:"initialize",value:function(){this.boundSubmit=this.submit.bind(this),this.boundReset=this.reset.bind(this)}},{key:"connect",value:function(){this.element.addEventListener("submit",this.boundSubmit),this.element.addEventListener("turbo:before-fetch-response",this.boundReset)}},{key:"disconnect",value:function(){this.element.removeEventListener("submit",this.boundSubmit),this.element.removeEventListener("turbo:before-fetch-response",this.boundReset)}},{key:"submit",value:function(e){this.disableButtons(),this.setLoading(e.submitter||this.element.querySelector(f))}},{key:"reset",value:function(e){this.restoreButtons()}},{key:"setLoading",value:function(e){e.classList.add("loading")}},{key:"disableButtons",value:function(e){this.submitButtons.forEach((function(e){e.disabled=!0}))}},{key:"restoreButtons",value:function(){this.submitButtons.forEach((function(e){e.classList.remove("loading"),e.disabled=!1}))}},{key:"submitButtons",get:function(){return this.element.querySelectorAll(f)}}],r&&o(n.prototype,r),i&&o(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(r.default)},6023:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=c(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function l(e,t,n){return t=d(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,n||[],d(e).constructor):t.apply(e,n))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function f(){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},f.apply(null,arguments)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}n.r(t),n.d(t,{default:function(){return p}});var p=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),l(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(t,e),n=t,(r=[{key:"options",get:function(){return o(o({},f(d(t.prototype),"options",this)),{},{children:this.imageTargets})}}])&&a(n.prototype,r),i&&a(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,i}(n(6229).default)},8619:function(e,t,n){"use strict";n.r(t),n.d(t,{ApplicationController:function(){return o.default},Controllers:function(){return d}});var r=n(6927),i=n(727),o=n(9044);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=s(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==s(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}window.Stimulus=r.Application.start();var u=n(2036),f=(0,i.definitionsFromContext)(u);Stimulus.load(f);var d=f.reduce((function(e,t){return c(c({},e),{},l({},t.identifier,t.controllerConstructor))}),{})},2596:function(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function o(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function s(e,t,n){return t=c(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,a()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(a=function(){return!!e})()}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}n.r(t),n.d(t,{default:function(){return u}});var u=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),s(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),n=t,r=[{key:"initialize",value:function(){this.boundHandleKeyDown=this.handleKeyDown.bind(this)}},{key:"connect",value:function(){this.element.addEventListener("keydown",this.boundHandleKeyDown)}},{key:"disconnect",value:function(){this.element.removeEventListener("keydown",this.boundHandleKeyDown)}},{key:"handleKeyDown",value:function(e){"Enter"===e.key&&this.preventEnterKey(e.target)&&e.preventDefault()}},{key:"preventEnterKey",value:function(e){return e.matches('input:not([type="submit"])')}}],r&&i(n.prototype,r),o&&i(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(n(9044).default)},6229:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return q}});var r=n(9044),i=n(2460); /*! * PhotoSwipe Lightbox 5.4.4 - https://photoswipe.com * (c) 2024 Dmytro Semenov */ function o(e,t,n){const r=document.createElement(t);return e&&(r.className=e),n&&n.appendChild(r),r}function s(e,t,n){e.style.width="number"==typeof t?`${t}px`:t,e.style.height="number"==typeof n?`${n}px`:n}const a="idle",c="loading",l="loaded",u="error";function f(e,t,n=document){let r=[];if(e instanceof Element)r=[e];else if(e instanceof NodeList||Array.isArray(e))r=Array.from(e);else{const i="string"==typeof e?e:t;i&&(r=Array.from(n.querySelectorAll(i)))}return r}function d(){return!(!navigator.vendor||!navigator.vendor.match(/apple/i))}class h{constructor(e,t){this.type=e,this.defaultPrevented=!1,t&&Object.assign(this,t)}preventDefault(){this.defaultPrevented=!0}}class p{constructor(){this._listeners={},this._filters={},this.pswp=void 0,this.options=void 0}addFilter(e,t,n=100){var r,i,o;this._filters[e]||(this._filters[e]=[]),null===(r=this._filters[e])||void 0===r||r.push({fn:t,priority:n}),null===(i=this._filters[e])||void 0===i||i.sort(((e,t)=>e.priority-t.priority)),null===(o=this.pswp)||void 0===o||o.addFilter(e,t,n)}removeFilter(e,t){this._filters[e]&&(this._filters[e]=this._filters[e].filter((e=>e.fn!==t))),this.pswp&&this.pswp.removeFilter(e,t)}applyFilters(e,...t){var n;return null===(n=this._filters[e])||void 0===n||n.forEach((e=>{t[0]=e.fn.apply(this,t)})),t[0]}on(e,t){var n,r;this._listeners[e]||(this._listeners[e]=[]),null===(n=this._listeners[e])||void 0===n||n.push(t),null===(r=this.pswp)||void 0===r||r.on(e,t)}off(e,t){var n;this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter((e=>t!==e))),null===(n=this.pswp)||void 0===n||n.off(e,t)}dispatch(e,t){var n;if(this.pswp)return this.pswp.dispatch(e,t);const r=new h(e,t);return null===(n=this._listeners[e])||void 0===n||n.forEach((e=>{e.call(this,r)})),r}}class m{constructor(e,t){if(this.element=o("pswp__img pswp__img--placeholder",e?"img":"div",t),e){const t=this.element;t.decoding="async",t.alt="",t.src=e,t.setAttribute("role","presentation")}this.element.setAttribute("aria-hidden","true")}setDisplayedSize(e,t){this.element&&("IMG"===this.element.tagName?(s(this.element,250,"auto"),this.element.style.transformOrigin="0 0",this.element.style.transform=function(e,t,n){let r=`translate3d(${e}px,${t||0}px,0)`;return void 0!==n&&(r+=` scale3d(${n},${n},1)`),r}(0,0,e/250)):s(this.element,e,t))}destroy(){var e;null!==(e=this.element)&&void 0!==e&&e.parentNode&&this.element.remove(),this.element=null}}class g{constructor(e,t,n){this.instance=t,this.data=e,this.index=n,this.element=void 0,this.placeholder=void 0,this.slide=void 0,this.displayedImageWidth=0,this.displayedImageHeight=0,this.width=Number(this.data.w)||Number(this.data.width)||0,this.height=Number(this.data.h)||Number(this.data.height)||0,this.isAttached=!1,this.hasSlide=!1,this.isDecoding=!1,this.state=a,this.data.type?this.type=this.data.type:this.data.src?this.type="image":this.type="html",this.instance.dispatch("contentInit",{content:this})}removePlaceholder(){this.placeholder&&!this.keepPlaceholder()&&setTimeout((()=>{this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0)}),1e3)}load(e,t){if(this.slide&&this.usePlaceholder())if(this.placeholder){const e=this.placeholder.element;e&&!e.parentElement&&this.slide.container.prepend(e)}else{const e=this.instance.applyFilters("placeholderSrc",!(!this.data.msrc||!this.slide.isFirstSlide)&&this.data.msrc,this);this.placeholder=new m(e,this.slide.container)}this.element&&!t||this.instance.dispatch("contentLoad",{content:this,isLazy:e}).defaultPrevented||(this.isImageContent()?(this.element=o("pswp__img","img"),this.displayedImageWidth&&this.loadImage(e)):(this.element=o("pswp__content","div"),this.element.innerHTML=this.data.html||""),t&&this.slide&&this.slide.updateContentSize(!0))}loadImage(e){var t,n;if(!this.isImageContent()||!this.element||this.instance.dispatch("contentLoadImage",{content:this,isLazy:e}).defaultPrevented)return;const r=this.element;this.updateSrcsetSizes(),this.data.srcset&&(r.srcset=this.data.srcset),r.src=null!==(t=this.data.src)&&void 0!==t?t:"",r.alt=null!==(n=this.data.alt)&&void 0!==n?n:"",this.state=c,r.complete?this.onLoaded():(r.onload=()=>{this.onLoaded()},r.onerror=()=>{this.onError()})}setSlide(e){this.slide=e,this.hasSlide=!0,this.instance=e.pswp}onLoaded(){this.state=l,this.slide&&this.element&&(this.instance.dispatch("loadComplete",{slide:this.slide,content:this}),this.slide.isActive&&this.slide.heavyAppended&&!this.element.parentNode&&(this.append(),this.slide.updateContentSize(!0)),this.state!==l&&this.state!==u||this.removePlaceholder())}onError(){this.state=u,this.slide&&(this.displayError(),this.instance.dispatch("loadComplete",{slide:this.slide,isError:!0,content:this}),this.instance.dispatch("loadError",{slide:this.slide,content:this}))}isLoading(){return this.instance.applyFilters("isContentLoading",this.state===c,this)}isError(){return this.state===u}isImageContent(){return"image"===this.type}setDisplayedSize(e,t){if(this.element&&(this.placeholder&&this.placeholder.setDisplayedSize(e,t),!this.instance.dispatch("contentResize",{content:this,width:e,height:t}).defaultPrevented&&(s(this.element,e,t),this.isImageContent()&&!this.isError()))){const n=!this.displayedImageWidth&&e;this.displayedImageWidth=e,this.displayedImageHeight=t,n?this.loadImage(!1):this.updateSrcsetSizes(),this.slide&&this.instance.dispatch("imageSizeChange",{slide:this.slide,width:e,height:t,content:this})}}isZoomable(){return this.instance.applyFilters("isContentZoomable",this.isImageContent()&&this.state!==u,this)}updateSrcsetSizes(){if(!this.isImageContent()||!this.element||!this.data.srcset)return;const e=this.element,t=this.instance.applyFilters("srcsetSizesWidth",this.displayedImageWidth,this);(!e.dataset.largestUsedSize||t>parseInt(e.dataset.largestUsedSize,10))&&(e.sizes=t+"px",e.dataset.largestUsedSize=String(t))}usePlaceholder(){return this.instance.applyFilters("useContentPlaceholder",this.isImageContent(),this)}lazyLoad(){this.instance.dispatch("contentLazyLoad",{content:this}).defaultPrevented||this.load(!0)}keepPlaceholder(){return this.instance.applyFilters("isKeepingPlaceholder",this.isLoading(),this)}destroy(){this.hasSlide=!1,this.slide=void 0,this.instance.dispatch("contentDestroy",{content:this}).defaultPrevented||(this.remove(),this.placeholder&&(this.placeholder.destroy(),this.placeholder=void 0),this.isImageContent()&&this.element&&(this.element.onload=null,this.element.onerror=null,this.element=void 0))}displayError(){if(this.slide){var e,t;let n=o("pswp__error-msg","div");n.innerText=null!==(e=null===(t=this.instance.options)||void 0===t?void 0:t.errorMsg)&&void 0!==e?e:"",n=this.instance.applyFilters("contentErrorElement",n,this),this.element=o("pswp__content pswp__error-msg-container","div"),this.element.appendChild(n),this.slide.container.innerText="",this.slide.container.appendChild(this.element),this.slide.updateContentSize(!0),this.removePlaceholder()}}append(){if(this.isAttached||!this.element)return;if(this.isAttached=!0,this.state===u)return void this.displayError();if(this.instance.dispatch("contentAppend",{content:this}).defaultPrevented)return;const e="decode"in this.element;this.isImageContent()?e&&this.slide&&(!this.slide.isActive||d())?(this.isDecoding=!0,this.element.decode().catch((()=>{})).finally((()=>{this.isDecoding=!1,this.appendImage()}))):this.appendImage():this.slide&&!this.element.parentNode&&this.slide.container.appendChild(this.element)}activate(){!this.instance.dispatch("contentActivate",{content:this}).defaultPrevented&&this.slide&&(this.isImageContent()&&this.isDecoding&&!d()?this.appendImage():this.isError()&&this.load(!1,!0),this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","false"))}deactivate(){this.instance.dispatch("contentDeactivate",{content:this}),this.slide&&this.slide.holderElement&&this.slide.holderElement.setAttribute("aria-hidden","true")}remove(){this.isAttached=!1,this.instance.dispatch("contentRemove",{content:this}).defaultPrevented||(this.element&&this.element.parentNode&&this.element.remove(),this.placeholder&&this.placeholder.element&&this.placeholder.element.remove())}appendImage(){this.isAttached&&(this.instance.dispatch("contentAppendImage",{content:this}).defaultPrevented||(this.slide&&this.element&&!this.element.parentNode&&this.slide.container.appendChild(this.element),this.state!==l&&this.state!==u||this.removePlaceholder()))}}function v(e,t,n,r,i){let o=0;if(t.paddingFn)o=t.paddingFn(n,r,i)[e];else if(t.padding)o=t.padding[e];else{const n="padding"+e[0].toUpperCase()+e.slice(1);t[n]&&(o=t[n])}return Number(o)||0}class y{constructor(e,t,n,r){this.pswp=r,this.options=e,this.itemData=t,this.index=n,this.panAreaSize=null,this.elementSize=null,this.fit=1,this.fill=1,this.vFill=1,this.initial=1,this.secondary=1,this.max=1,this.min=1}update(e,t,n){const r={x:e,y:t};this.elementSize=r,this.panAreaSize=n;const i=n.x/r.x,o=n.y/r.y;this.fit=Math.min(1,i<o?i:o),this.fill=Math.min(1,i>o?i:o),this.vFill=Math.min(1,o),this.initial=this._getInitial(),this.secondary=this._getSecondary(),this.max=Math.max(this.initial,this.secondary,this._getMax()),this.min=Math.min(this.fit,this.initial,this.secondary),this.pswp&&this.pswp.dispatch("zoomLevelsUpdate",{zoomLevels:this,slideData:this.itemData})}_parseZoomLevelOption(e){const t=e+"ZoomLevel",n=this.options[t];if(n)return"function"==typeof n?n(this):"fill"===n?this.fill:"fit"===n?this.fit:Number(n)}_getSecondary(){let e=this._parseZoomLevelOption("secondary");return e||(e=Math.min(1,3*this.fit),this.elementSize&&e*this.elementSize.x>4e3&&(e=4e3/this.elementSize.x),e)}_getInitial(){return this._parseZoomLevelOption("initial")||this.fit}_getMax(){return this._parseZoomLevelOption("max")||Math.max(1,4*this.fit)}}function b(e,t,n){const r=t.createContentFromData(e,n);let i;const{options:o}=t;if(o){let s;i=new y(o,e,-1),s=t.pswp?t.pswp.viewportSize:function(e,t){if(e.getViewportSizeFn){const n=e.getViewportSizeFn(e,t);if(n)return n}return{x:document.documentElement.clientWidth,y:window.innerHeight}}(o,t);const a=function(e,t,n,r){return{x:t.x-v("left",e,t,n,r)-v("right",e,t,n,r),y:t.y-v("top",e,t,n,r)-v("bottom",e,t,n,r)}}(o,s,e,n);i.update(r.width,r.height,a)}return r.lazyLoad(),i&&r.setDisplayedSize(Math.ceil(r.width*i.initial),Math.ceil(r.height*i.initial)),r}class w extends p{getNumItems(){var e;let t=0;const n=null===(e=this.options)||void 0===e?void 0:e.dataSource;n&&"length"in n?t=n.length:n&&"gallery"in n&&(n.items||(n.items=this._getGalleryDOMElements(n.gallery)),n.items&&(t=n.items.length));const r=this.dispatch("numItems",{dataSource:n,numItems:t});return this.applyFilters("numItems",r.numItems,n)}createContentFromData(e,t){return new g(e,this,t)}getItemData(e){var t;const n=null===(t=this.options)||void 0===t?void 0:t.dataSource;let r={};Array.isArray(n)?r=n[e]:n&&"gallery"in n&&(n.items||(n.items=this._getGalleryDOMElements(n.gallery)),r=n.items[e]);let i=r;i instanceof Element&&(i=this._domElementToItemData(i));const o=this.dispatch("itemData",{itemData:i||{},index:e});return this.applyFilters("itemData",o.itemData,e)}_getGalleryDOMElements(e){var t,n;return null!==(t=this.options)&&void 0!==t&&t.children||null!==(n=this.options)&&void 0!==n&&n.childSelector?f(this.options.children,this.options.childSelector,e)||[]:[e]}_domElementToItemData(e){const t={element:e},n="A"===e.tagName?e:e.querySelector("a");if(n){t.src=n.dataset.pswpSrc||n.href,n.dataset.pswpSrcset&&(t.srcset=n.dataset.pswpSrcset),t.width=n.dataset.pswpWidth?parseInt(n.dataset.pswpWidth,10):0,t.height=n.dataset.pswpHeight?parseInt(n.dataset.pswpHeight,10):0,t.w=t.width,t.h=t.height,n.dataset.pswpType&&(t.type=n.dataset.pswpType);const i=e.querySelector("img");var r;if(i)t.msrc=i.currentSrc||i.src,t.alt=null!==(r=i.getAttribute("alt"))&&void 0!==r?r:"";(n.dataset.pswpCropped||n.dataset.cropped)&&(t.thumbCropped=!0)}return this.applyFilters("domItemData",t,e,n)}lazyLoadData(e,t){return b(e,this,t)}}class _ extends w{constructor(e){super(),this.options=e||{},this._uid=0,this.shouldOpen=!1,this._preloadedContent=void 0,this.onThumbnailsClick=this.onThumbnailsClick.bind(this)}init(){f(this.options.gallery,this.options.gallerySelector).forEach((e=>{e.addEventListener("click",this.onThumbnailsClick,!1)}))}onThumbnailsClick(e){if(function(e){return"button"in e&&1===e.button||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey}(e)||window.pswp)return;let t={x:e.clientX,y:e.clientY};t.x||t.y||(t=null);let n=this.getClickedIndex(e);n=this.applyFilters("clickedIndex",n,e,this);const r={gallery:e.currentTarget};n>=0&&(e.preventDefault(),this.loadAndOpen(n,r,t))}getClickedIndex(e){if(this.options.getClickedIndexFn)return this.options.getClickedIndexFn.call(this,e);const t=e.target,n=f(this.options.children,this.options.childSelector,e.currentTarget).findIndex((e=>e===t||e.contains(t)));return-1!==n?n:this.options.children||this.options.childSelector?-1:0}loadAndOpen(e,t,n){if(window.pswp||!this.options)return!1;if(!t&&this.options.gallery&&this.options.children){const e=f(this.options.gallery);e[0]&&(t={gallery:e[0]})}return this.options.index=e,this.options.initialPointerPos=n,this.shouldOpen=!0,this.preload(e,t),!0}preload(e,t){const{options:n}=this;t&&(n.dataSource=t);const r=[],i=typeof n.pswpModule;if("function"==typeof(o=n.pswpModule)&&o.prototype&&o.prototype.goTo)r.push(Promise.resolve(n.pswpModule));else{if("string"===i)throw new Error("pswpModule as string is no longer supported");if("function"!==i)throw new Error("pswpModule is not valid");r.push(n.pswpModule())}var o;"function"==typeof n.openPromise&&r.push(n.openPromise()),!1!==n.preloadFirstSlide&&e>=0&&(this._preloadedContent=function(e,t){const n=t.getItemData(e);if(!t.dispatch("lazyLoadSlide",{index:e,itemData:n}).defaultPrevented)return b(n,t,e)}(e,this));const s=++this._uid;Promise.all(r).then((e=>{if(this.shouldOpen){const t=e[0];this._openPhotoswipe(t,s)}}))}_openPhotoswipe(e,t){if(t!==this._uid&&this.shouldOpen)return;if(this.shouldOpen=!1,window.pswp)return;const n="object"==typeof e?new e.default(this.options):new e(this.options);this.pswp=n,window.pswp=n,Object.keys(this._listeners).forEach((e=>{var t;null===(t=this._listeners[e])||void 0===t||t.forEach((t=>{n.on(e,t)}))})),Object.keys(this._filters).forEach((e=>{var t;null===(t=this._filters[e])||void 0===t||t.forEach((t=>{n.addFilter(e,t.fn,t.priority)}))})),this._preloadedContent&&(n.contentLoader.addToCache(this._preloadedContent),this._preloadedContent=void 0),n.on("destroy",(()=>{this.pswp=void 0,delete window.pswp})),n.init()}destroy(){var e;null===(e=this.pswp)||void 0===e||e.destroy(),this.shouldOpen=!1,this._listeners={},f(this.options.gallery,this.options.gallerySelector).forEach((e=>{e.removeEventListener("click",this.onThumbnailsClick,!1)}))}} \ No newline at end of file