plutonium 0.16.3 → 0.16.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/plutonium.css +1 -1
- data/app/assets/plutonium.js +19 -12
- data/app/assets/plutonium.js.map +2 -2
- data/app/assets/plutonium.min.js +14 -14
- data/app/assets/plutonium.min.js.map +3 -3
- data/app/views/plutonium/_resource_sidebar.html.erb +10 -8
- data/docs/guide/tutorial.md +0 -2
- data/docs/public/templates/pluton8.rb +7 -0
- data/lib/generators/pu/core/assets/templates/tailwind.config.js +7 -6
- data/lib/plutonium/ui/sidebar_menu.rb +149 -0
- data/lib/plutonium/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- data/src/js/controllers/resource_collapse_controller.js +21 -13
- data/tailwind.options.js +46 -0
- metadata +18 -2
data/app/assets/plutonium.min.js
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
(()=>{var Rl=Object.create;var ko=Object.defineProperty;var Ml=Object.getOwnPropertyDescriptor;var Pl=Object.getOwnPropertyNames;var Dl=Object.getPrototypeOf,Fl=Object.prototype.hasOwnProperty;var Bl=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Nl=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Pl(e))!Fl.call(i,n)&&n!==t&&ko(i,n,{get:()=>e[n],enumerable:!(r=Ml(e,n))||r.enumerable});return i};var Hl=(i,e,t)=>(t=i!=null?Rl(Dl(i)):{},Nl(e||!i||!i.__esModule?ko(t,"default",{value:i,enumerable:!0}):t,i));var $o=Bl((Jp,Vo)=>{var Cc="Expected a function",qo=NaN,Ic="[object Symbol]",Oc=/^\s+|\s+$/g,Rc=/^[-+]0x[0-9a-f]+$/i,Mc=/^0b[01]+$/i,Pc=/^0o[0-7]+$/i,Dc=parseInt,Fc=typeof global=="object"&&global&&global.Object===Object&&global,Bc=typeof self=="object"&&self&&self.Object===Object&&self,Nc=Fc||Bc||Function("return this")(),Hc=Object.prototype,qc=Hc.toString,zc=Math.max,Vc=Math.min,Gn=function(){return Nc.Date.now()};function $c(i,e,t){var r,n,s,o,a,l,d=0,p=!1,m=!1,E=!0;if(typeof i!="function")throw new TypeError(Cc);e=zo(e)||0,Xn(t)&&(p=!!t.leading,m="maxWait"in t,s=m?zc(zo(t.maxWait)||0,e):s,E="trailing"in t?!!t.trailing:E);function v(x){var P=r,N=n;return r=n=void 0,d=x,o=i.apply(N,P),o}function C(x){return d=x,a=setTimeout(D,e),p?v(x):o}function _(x){var P=x-l,N=x-d,U=e-P;return m?Vc(U,s-N):U}function k(x){var P=x-l,N=x-d;return l===void 0||P>=e||P<0||m&&N>=s}function D(){var x=Gn();if(k(x))return q(x);a=setTimeout(D,_(x))}function q(x){return a=void 0,E&&r?v(x):(r=n=void 0,o)}function B(){a!==void 0&&clearTimeout(a),d=0,r=l=n=a=void 0}function S(){return a===void 0?o:q(Gn())}function R(){var x=Gn(),P=k(x);if(r=arguments,n=this,l=x,P){if(a===void 0)return C(l);if(m)return a=setTimeout(D,e),v(l)}return a===void 0&&(a=setTimeout(D,e)),o}return R.cancel=B,R.flush=S,R}function Xn(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function jc(i){return!!i&&typeof i=="object"}function Uc(i){return typeof i=="symbol"||jc(i)&&qc.call(i)==Ic}function zo(i){if(typeof i=="number")return i;if(Uc(i))return qo;if(Xn(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=Xn(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(Oc,"");var t=Mc.test(i);return t||Pc.test(i)?Dc(i.slice(2),t?2:8):Rc.test(i)?qo:+i}Vo.exports=$c});var Sn=class{constructor(e,t,r){this.eventTarget=e,this.eventName=t,this.eventOptions=r,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){let t=ql(e);for(let r of this.bindings){if(t.immediatePropagationStopped)break;r.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{let r=e.index,n=t.index;return r<n?-1:r>n?1:0})}};function ql(i){if("immediatePropagationStopped"in i)return i;{let{stopImmediatePropagation:e}=i;return Object.assign(i,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,e.call(this)}})}}var Tn=class{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,r={}){this.application.handleError(e,`Error ${t}`,r)}clearEventListenersForBinding(e){let t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){let{eventTarget:t,eventName:r,eventOptions:n}=e,s=this.fetchEventListenerMapForEventTarget(t),o=this.cacheKey(r,n);s.delete(o),s.size==0&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){let{eventTarget:t,eventName:r,eventOptions:n}=e;return this.fetchEventListener(t,r,n)}fetchEventListener(e,t,r){let n=this.fetchEventListenerMapForEventTarget(e),s=this.cacheKey(t,r),o=n.get(s);return o||(o=this.createEventListener(e,t,r),n.set(s,o)),o}createEventListener(e,t,r){let n=new Sn(e,t,r);return this.started&&n.connect(),n}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){let r=[e];return Object.keys(t).sort().forEach(n=>{r.push(`${t[n]?"":"!"}${n}`)}),r.join(":")}},zl={stop({event:i,value:e}){return e&&i.stopPropagation(),!0},prevent({event:i,value:e}){return e&&i.preventDefault(),!0},self({event:i,value:e,element:t}){return e?t===i.target:!0}},Vl=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function $l(i){let t=i.trim().match(Vl)||[],r=t[2],n=t[3];return n&&!["keydown","keyup","keypress"].includes(r)&&(r+=`.${n}`,n=""),{eventTarget:jl(t[4]),eventName:r,eventOptions:t[7]?Ul(t[7]):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||n}}function jl(i){if(i=="window")return window;if(i=="document")return document}function Ul(i){return i.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})}function Wl(i){if(i==window)return"window";if(i==document)return"document"}function Kn(i){return i.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function kn(i){return Kn(i.replace(/--/g,"-").replace(/__/g,"_"))}function wi(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Fo(i){return i.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function Kl(i){return i.match(/[^\s]+/g)||[]}function xo(i){return i!=null}function xn(i,e){return Object.prototype.hasOwnProperty.call(i,e)}var Lo=["meta","ctrl","alt","shift"],Ln=class{constructor(e,t,r,n){this.element=e,this.index=t,this.eventTarget=r.eventTarget||e,this.eventName=r.eventName||Gl(e)||Zi("missing event name"),this.eventOptions=r.eventOptions||{},this.identifier=r.identifier||Zi("missing identifier"),this.methodName=r.methodName||Zi("missing method name"),this.keyFilter=r.keyFilter||"",this.schema=n}static forToken(e,t){return new this(e.element,e.index,$l(e.content),t)}toString(){let 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;let t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;let r=t.filter(n=>!Lo.includes(n))[0];return r?(xn(this.keyMappings,r)||Zi(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[r].toLowerCase()!==e.key.toLowerCase()):!1}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;let t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){let e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(let{name:r,value:n}of Array.from(this.element.attributes)){let s=r.match(t),o=s&&s[1];o&&(e[Kn(o)]=Xl(n))}return e}get eventTargetName(){return Wl(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){let[r,n,s,o]=Lo.map(a=>t.includes(a));return e.metaKey!==r||e.ctrlKey!==n||e.altKey!==s||e.shiftKey!==o}},Co={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:i=>i.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function Gl(i){let e=i.tagName.toLowerCase();if(e in Co)return Co[e](i)}function Zi(i){throw new Error(i)}function Xl(i){try{return JSON.parse(i)}catch{return i}}var Cn=class{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){let t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){let e=this.controller[this.methodName];if(typeof e=="function")return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){let{element:t}=this.action,{actionDescriptorFilters:r}=this.context.application,{controller:n}=this.context,s=!0;for(let[o,a]of Object.entries(this.eventOptions))if(o in r){let l=r[o];s=s&&l({name:o,value:a,event:e,element:t,controller:n})}else continue;return s}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){let{target:t,currentTarget:r}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:r,action:this.methodName})}catch(n){let{identifier:s,controller:o,element:a,index:l}=this,d={identifier:s,controller:o,element:a,index:l,event:e};this.context.handleError(n,`invoking action "${this.action}"`,d)}}willBeInvokedByEvent(e){let t=e.target;return e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e)||e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e)?!1:this.element===t?!0: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}},Qi=class{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(r=>this.processMutations(r))}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){let e=new Set(this.matchElementsInTree());for(let t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(let t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(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(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.processTree(r,this.removeElement)}}processAddedNodes(e){for(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.elementIsActive(r)&&this.processTree(r,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(let r of this.matchElementsInTree(e))t.call(this,r)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected!=this.element.isConnected?!1: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))}},Ji=class{constructor(e,t,r){this.attributeName=t,this.delegate=r,this.elementObserver=new Qi(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){let t=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(this.selector));return t.concat(r)}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 Yl(i,e,t){Bo(i,e).add(t)}function Zl(i,e,t){Bo(i,e).delete(t),Ql(i,e)}function Bo(i,e){let t=i.get(e);return t||(t=new Set,i.set(e,t)),t}function Ql(i,e){let t=i.get(e);t!=null&&t.size==0&&i.delete(e)}var Ge=class{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t.concat(Array.from(r)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t+r.size,0)}add(e,t){Yl(this.valuesByKey,e,t)}delete(e,t){Zl(this.valuesByKey,e,t)}has(e,t){let r=this.valuesByKey.get(e);return r!=null&&r.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(r=>r.has(e))}getValuesForKey(e){let t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,r])=>r.has(e)).map(([t,r])=>t)}};var In=class{constructor(e,t,r,n){this._selector=t,this.details=n,this.elementObserver=new Qi(e,this),this.delegate=r,this.matchesByElement=new Ge}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){let{selector:t}=this;if(t){let r=e.matches(t);return this.delegate.selectorMatchElement?r&&this.delegate.selectorMatchElement(e,this.details):r}else return!1}matchElementsInTree(e){let{selector:t}=this;if(t){let r=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(t)).filter(s=>this.matchElement(s));return r.concat(n)}else return[]}elementMatched(e){let{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){let t=this.matchesByElement.getKeysForValue(e);for(let r of t)this.selectorUnmatched(e,r)}elementAttributeChanged(e,t){let{selector:r}=this;if(r){let n=this.matchElement(e),s=this.matchesByElement.has(r,e);n&&!s?this.selectorMatched(e,r):!n&&s&&this.selectorUnmatched(e,r)}}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)}},On=class{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(r=>this.processMutations(r))}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(let e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){let t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){let r=this.delegate.getStringMapKeyForAttribute(e);if(r!=null){this.stringMap.has(e)||this.stringMapKeyAdded(r,e);let n=this.element.getAttribute(e);if(this.stringMap.get(e)!=n&&this.stringMapValueChanged(n,r,t),n==null){let s=this.stringMap.get(e);this.stringMap.delete(e),s&&this.stringMapKeyRemoved(r,e,s)}else this.stringMap.set(e,n)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,r){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,r)}stringMapKeyRemoved(e,t,r){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,r)}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())}},er=class{constructor(e,t,r){this.attributeObserver=new Ji(e,t,this),this.delegate=r,this.tokensByElement=new Ge}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){let[t,r]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(r)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(t=>this.tokenMatched(t))}tokensUnmatched(e){e.forEach(t=>this.tokenUnmatched(t))}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){let t=this.tokensByElement.getValuesForKey(e),r=this.readTokensForElement(e),n=ec(t,r).findIndex(([s,o])=>!tc(s,o));return n==-1?[[],[]]:[t.slice(n),r.slice(n)]}readTokensForElement(e){let t=this.attributeName,r=e.getAttribute(t)||"";return Jl(r,e,t)}};function Jl(i,e,t){return i.trim().split(/\s+/).filter(r=>r.length).map((r,n)=>({element:e,attributeName:t,content:r,index:n}))}function ec(i,e){let t=Math.max(i.length,e.length);return Array.from({length:t},(r,n)=>[i[n],e[n]])}function tc(i,e){return i&&e&&i.index==e.index&&i.content==e.content}var tr=class{constructor(e,t,r){this.tokenListObserver=new er(e,t,this),this.delegate=r,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){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).set(e,r),this.delegate.elementMatchedValue(t,r))}tokenUnmatched(e){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,r))}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(t){return{error:t}}}},Rn=class{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new tr(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){let t=new Cn(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){let 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){let t=Ln.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},Mn=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new On(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){let r=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,r.writer(this.receiver[e]),r.writer(r.defaultValue))}stringMapValueChanged(e,t,r){let n=this.valueDescriptorNameMap[t];e!==null&&(r===null&&(r=n.writer(n.defaultValue)),this.invokeChangedCallback(t,e,r))}stringMapKeyRemoved(e,t,r){let n=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,n.writer(this.receiver[e]),r):this.invokeChangedCallback(e,n.writer(n.defaultValue),r)}invokeChangedCallbacksForDefaultValues(){for(let{key:e,name:t,defaultValue:r,writer:n}of this.valueDescriptors)r!=null&&!this.controller.data.has(e)&&this.invokeChangedCallback(t,n(r),void 0)}invokeChangedCallback(e,t,r){let n=`${e}Changed`,s=this.receiver[n];if(typeof s=="function"){let o=this.valueDescriptorNameMap[e];try{let a=o.reader(t),l=r;r&&(l=o.reader(r)),s.call(this.receiver,a,l)}catch(a){throw a instanceof TypeError&&(a.message=`Stimulus Value "${this.context.identifier}.${o.name}" - ${a.message}`),a}}}get valueDescriptors(){let{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){let e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{let r=this.valueDescriptorMap[t];e[r.name]=r}),e}hasValue(e){let t=this.valueDescriptorNameMap[e],r=`has${wi(t.name)}`;return this.receiver[r]}},Pn=class{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new Ge}start(){this.tokenListObserver||(this.tokenListObserver=new er(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 r;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var r;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(let e of this.targetsByName.keys)for(let 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 Ei(i,e){let t=No(i);return Array.from(t.reduce((r,n)=>(rc(n,e).forEach(s=>r.add(s)),r),new Set))}function ic(i,e){return No(i).reduce((r,n)=>(r.push(...nc(n,e)),r),[])}function No(i){let e=[];for(;i;)e.push(i),i=Object.getPrototypeOf(i);return e.reverse()}function rc(i,e){let t=i[e];return Array.isArray(t)?t:[]}function nc(i,e){let t=i[e];return t?Object.keys(t).map(r=>[r,t[r]]):[]}var Dn=class{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new Ge,this.outletElementsByName=new Ge,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:r}){let n=this.getOutlet(e,r);n&&this.connectOutlet(n,e,r)}selectorUnmatched(e,t,{outletName:r}){let n=this.getOutletFromMap(e,r);n&&this.disconnectOutlet(n,e,r)}selectorMatchElement(e,{outletName:t}){let r=this.selector(t),n=this.hasOutlet(e,t),s=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return r?n&&s&&e.matches(r):!1}elementMatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementAttributeValueChanged(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementUnmatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}connectOutlet(e,t,r){var n;this.outletElementsByName.has(r,t)||(this.outletsByName.add(r,e),this.outletElementsByName.add(r,t),(n=this.selectorObserverMap.get(r))===null||n===void 0||n.pause(()=>this.delegate.outletConnected(e,t,r)))}disconnectOutlet(e,t,r){var n;this.outletElementsByName.has(r,t)&&(this.outletsByName.delete(r,e),this.outletElementsByName.delete(r,t),(n=this.selectorObserverMap.get(r))===null||n===void 0||n.pause(()=>this.delegate.outletDisconnected(e,t,r)))}disconnectAllOutlets(){for(let e of this.outletElementsByName.keys)for(let t of this.outletElementsByName.getValuesForKey(e))for(let r of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(r,t,e)}updateSelectorObserverForOutlet(e){let t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){let t=this.selector(e),r=new In(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,r),r.start()}setupAttributeObserverForOutlet(e){let t=this.attributeNameForOutletName(e),r=new Ji(this.scope.element,t,this);this.attributeObserverMap.set(e,r),r.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(){let e=new Ge;return this.router.modules.forEach(t=>{let r=t.definition.controllerConstructor;Ei(r,"outlets").forEach(s=>e.add(s,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){let 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(r=>r.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}},Fn=class{constructor(e,t){this.logDebugActivity=(r,n={})=>{let{identifier:s,controller:o,element:a}=this;n=Object.assign({identifier:s,controller:o,element:a},n),this.application.logDebugActivity(this.identifier,r,n)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new Rn(this,this.dispatcher),this.valueObserver=new Mn(this,this.controller),this.targetObserver=new Pn(this,this),this.outletObserver=new Dn(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(r){this.handleError(r,"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,r={}){let{identifier:n,controller:s,element:o}=this;r=Object.assign({identifier:n,controller:s,element:o},r),this.application.handleError(e,`Error ${t}`,r)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,r){this.invokeControllerMethod(`${kn(r)}OutletConnected`,e,t)}outletDisconnected(e,t,r){this.invokeControllerMethod(`${kn(r)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){let r=this.controller;typeof r[e]=="function"&&r[e](...t)}};function sc(i){return oc(i,ac(i))}function oc(i,e){let t=hc(i),r=lc(i.prototype,e);return Object.defineProperties(t.prototype,r),t}function ac(i){return Ei(i,"blessings").reduce((t,r)=>{let n=r(i);for(let s in n){let o=t[s]||{};t[s]=Object.assign(o,n[s])}return t},{})}function lc(i,e){return uc(e).reduce((t,r)=>{let n=cc(i,e,r);return n&&Object.assign(t,{[r]:n}),t},{})}function cc(i,e,t){let r=Object.getOwnPropertyDescriptor(i,t);if(!(r&&"value"in r)){let s=Object.getOwnPropertyDescriptor(e,t).value;return r&&(s.get=r.get||s.get,s.set=r.set||s.set),s}}var uc=typeof Object.getOwnPropertySymbols=="function"?i=>[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)]:Object.getOwnPropertyNames,hc=(()=>{function i(t){function r(){return Reflect.construct(t,arguments,new.target)}return r.prototype=Object.create(t.prototype,{constructor:{value:r}}),Reflect.setPrototypeOf(r,t),r}function e(){let r=i(function(){this.a.call(this)});return r.prototype.a=function(){},new r}try{return e(),i}catch{return r=>class extends r{}}})();function dc(i){return{identifier:i.identifier,controllerConstructor:sc(i.controllerConstructor)}}var Bn=class{constructor(e,t){this.application=e,this.definition=dc(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){let t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){let t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new Fn(this,e),this.contextsByScope.set(e,t)),t}},Nn=class{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){let t=this.data.get(this.getDataKey(e))||"";return Kl(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},Hn=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){let t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){let r=this.getAttributeNameForKey(e);return this.element.setAttribute(r,t),this.get(e)}has(e){let t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){let t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}else return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${Fo(e)}`}},qn=class{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,r){let n=this.warnedKeysByObject.get(e);n||(n=new Set,this.warnedKeysByObject.set(e,n)),n.has(t)||(n.add(t),this.logger.warn(r,e))}};function zn(i,e){return`[${i}~="${e}"]`}var Vn=class{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 this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findTarget(r)||this.findLegacyTarget(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllTargets(r),...this.findAllLegacyTargets(r)],[])}findTarget(e){let t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){let t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){let t=this.schema.targetAttributeForScope(this.identifier);return zn(t,e)}findLegacyTarget(e){let t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){let t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(r=>this.deprecate(r,e))}getLegacySelectorForTargetName(e){let t=`${this.identifier}.${e}`;return zn(this.schema.targetAttribute,t)}deprecate(e,t){if(e){let{identifier:r}=this,n=this.schema.targetAttribute,s=this.schema.targetAttributeForScope(r);this.guide.warn(e,`target:${t}`,`Please replace ${n}="${r}.${t}" with ${s}="${t}". The ${n} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}},$n=class{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 this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findOutlet(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllOutlets(r)],[])}getSelectorForOutletName(e){let t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){let t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){let 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,r){let n=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&n.split(" ").includes(r)}},jn=class i{constructor(e,t,r,n){this.targets=new Vn(this),this.classes=new Nn(this),this.data=new Hn(this),this.containsElement=s=>s.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=r,this.guide=new qn(n),this.outlets=new $n(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 zn(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new i(this.schema,document.documentElement,this.identifier,this.guide.logger)}},Un=class{constructor(e,t,r){this.element=e,this.schema=t,this.delegate=r,this.valueListObserver=new tr(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){let{element:t,content:r}=e;return this.parseValueForElementAndIdentifier(t,r)}parseValueForElementAndIdentifier(e,t){let r=this.fetchScopesByIdentifierForElement(e),n=r.get(t);return n||(n=this.delegate.createScopeForElementAndIdentifier(e,t),r.set(t,n)),n}elementMatchedValue(e,t){let r=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,r),r==1&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){let r=this.scopeReferenceCounts.get(t);r&&(this.scopeReferenceCounts.set(t,r-1),r==1&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}},Wn=class{constructor(e){this.application=e,this.scopeObserver=new Un(this.element,this.schema,this),this.scopesByIdentifier=new Ge,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);let t=new Bn(this.application,e);this.connectModule(t);let r=e.controllerConstructor.afterLoad;r&&r.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){let t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){let r=this.modulesByIdentifier.get(t);if(r)return r.contexts.find(n=>n.element==e)}proposeToConnectScopeForElementAndIdentifier(e,t){let r=this.scopeObserver.parseValueForElementAndIdentifier(e,t);r?this.scopeObserver.elementMatchedValue(r.element,r):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,r){this.application.handleError(e,t,r)}createScopeForElementAndIdentifier(e,t){return new jn(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.connectContextForScope(r))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.disconnectContextForScope(r))}},pc={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:i=>`data-${i}-target`,outletAttributeForScope:(i,e)=>`data-${i}-${e}-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"},Io("abcdefghijklmnopqrstuvwxyz".split("").map(i=>[i,i]))),Io("0123456789".split("").map(i=>[i,i])))};function Io(i){return i.reduce((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r}),{})}var ir=class{constructor(e=document.documentElement,t=pc){this.logger=console,this.debug=!1,this.logDebugActivity=(r,n,s={})=>{this.debug&&this.logFormattedMessage(r,n,s)},this.element=e,this.schema=t,this.dispatcher=new Tn(this),this.router=new Wn(this),this.actionDescriptorFilters=Object.assign({},zl)}static start(e,t){let r=new this(e,t);return r.start(),r}async start(){await fc(),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(n=>{n.controllerConstructor.shouldLoad&&this.router.loadDefinition(n)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(n=>this.router.unloadIdentifier(n))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){let r=this.router.getContextForElementAndIdentifier(e,t);return r?r.controller:null}handleError(e,t,r){var n;this.logger.error(`%s
|
1
|
+
(()=>{var Ol=Object.create;var To=Object.defineProperty;var Rl=Object.getOwnPropertyDescriptor;var Ml=Object.getOwnPropertyNames;var Pl=Object.getPrototypeOf,Dl=Object.prototype.hasOwnProperty;var Fl=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports);var Bl=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ml(e))!Dl.call(i,n)&&n!==t&&To(i,n,{get:()=>e[n],enumerable:!(r=Rl(e,n))||r.enumerable});return i};var Nl=(i,e,t)=>(t=i!=null?Ol(Pl(i)):{},Bl(e||!i||!i.__esModule?To(t,"default",{value:i,enumerable:!0}):t,i));var Vo=Fl((Qp,zo)=>{var Lc="Expected a function",Ho=NaN,Cc="[object Symbol]",Ic=/^\s+|\s+$/g,Oc=/^[-+]0x[0-9a-f]+$/i,Rc=/^0b[01]+$/i,Mc=/^0o[0-7]+$/i,Pc=parseInt,Dc=typeof global=="object"&&global&&global.Object===Object&&global,Fc=typeof self=="object"&&self&&self.Object===Object&&self,Bc=Dc||Fc||Function("return this")(),Nc=Object.prototype,Hc=Nc.toString,qc=Math.max,zc=Math.min,Kn=function(){return Bc.Date.now()};function Vc(i,e,t){var r,n,s,o,a,l,d=0,p=!1,m=!1,E=!0;if(typeof i!="function")throw new TypeError(Lc);e=qo(e)||0,Gn(t)&&(p=!!t.leading,m="maxWait"in t,s=m?qc(qo(t.maxWait)||0,e):s,E="trailing"in t?!!t.trailing:E);function v(x){var P=r,N=n;return r=n=void 0,d=x,o=i.apply(N,P),o}function C(x){return d=x,a=setTimeout(D,e),p?v(x):o}function _(x){var P=x-l,N=x-d,U=e-P;return m?zc(U,s-N):U}function k(x){var P=x-l,N=x-d;return l===void 0||P>=e||P<0||m&&N>=s}function D(){var x=Kn();if(k(x))return q(x);a=setTimeout(D,_(x))}function q(x){return a=void 0,E&&r?v(x):(r=n=void 0,o)}function B(){a!==void 0&&clearTimeout(a),d=0,r=l=n=a=void 0}function S(){return a===void 0?o:q(Kn())}function R(){var x=Kn(),P=k(x);if(r=arguments,n=this,l=x,P){if(a===void 0)return C(l);if(m)return a=setTimeout(D,e),v(l)}return a===void 0&&(a=setTimeout(D,e)),o}return R.cancel=B,R.flush=S,R}function Gn(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}function $c(i){return!!i&&typeof i=="object"}function jc(i){return typeof i=="symbol"||$c(i)&&Hc.call(i)==Cc}function qo(i){if(typeof i=="number")return i;if(jc(i))return Ho;if(Gn(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=Gn(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(Ic,"");var t=Rc.test(i);return t||Mc.test(i)?Pc(i.slice(2),t?2:8):Oc.test(i)?Ho:+i}zo.exports=Vc});var An=class{constructor(e,t,r){this.eventTarget=e,this.eventName=t,this.eventOptions=r,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){let t=Hl(e);for(let r of this.bindings){if(t.immediatePropagationStopped)break;r.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{let r=e.index,n=t.index;return r<n?-1:r>n?1:0})}};function Hl(i){if("immediatePropagationStopped"in i)return i;{let{stopImmediatePropagation:e}=i;return Object.assign(i,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,e.call(this)}})}}var Sn=class{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,r={}){this.application.handleError(e,`Error ${t}`,r)}clearEventListenersForBinding(e){let t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){let{eventTarget:t,eventName:r,eventOptions:n}=e,s=this.fetchEventListenerMapForEventTarget(t),o=this.cacheKey(r,n);s.delete(o),s.size==0&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){let{eventTarget:t,eventName:r,eventOptions:n}=e;return this.fetchEventListener(t,r,n)}fetchEventListener(e,t,r){let n=this.fetchEventListenerMapForEventTarget(e),s=this.cacheKey(t,r),o=n.get(s);return o||(o=this.createEventListener(e,t,r),n.set(s,o)),o}createEventListener(e,t,r){let n=new An(e,t,r);return this.started&&n.connect(),n}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){let r=[e];return Object.keys(t).sort().forEach(n=>{r.push(`${t[n]?"":"!"}${n}`)}),r.join(":")}},ql={stop({event:i,value:e}){return e&&i.stopPropagation(),!0},prevent({event:i,value:e}){return e&&i.preventDefault(),!0},self({event:i,value:e,element:t}){return e?t===i.target:!0}},zl=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function Vl(i){let t=i.trim().match(zl)||[],r=t[2],n=t[3];return n&&!["keydown","keyup","keypress"].includes(r)&&(r+=`.${n}`,n=""),{eventTarget:$l(t[4]),eventName:r,eventOptions:t[7]?jl(t[7]):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||n}}function $l(i){if(i=="window")return window;if(i=="document")return document}function jl(i){return i.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})}function Ul(i){if(i==window)return"window";if(i==document)return"document"}function Wn(i){return i.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function Tn(i){return Wn(i.replace(/--/g,"-").replace(/__/g,"_"))}function wi(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Do(i){return i.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function Wl(i){return i.match(/[^\s]+/g)||[]}function ko(i){return i!=null}function kn(i,e){return Object.prototype.hasOwnProperty.call(i,e)}var xo=["meta","ctrl","alt","shift"],xn=class{constructor(e,t,r,n){this.element=e,this.index=t,this.eventTarget=r.eventTarget||e,this.eventName=r.eventName||Kl(e)||Zi("missing event name"),this.eventOptions=r.eventOptions||{},this.identifier=r.identifier||Zi("missing identifier"),this.methodName=r.methodName||Zi("missing method name"),this.keyFilter=r.keyFilter||"",this.schema=n}static forToken(e,t){return new this(e.element,e.index,Vl(e.content),t)}toString(){let 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;let t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;let r=t.filter(n=>!xo.includes(n))[0];return r?(kn(this.keyMappings,r)||Zi(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[r].toLowerCase()!==e.key.toLowerCase()):!1}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;let t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){let e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(let{name:r,value:n}of Array.from(this.element.attributes)){let s=r.match(t),o=s&&s[1];o&&(e[Wn(o)]=Gl(n))}return e}get eventTargetName(){return Ul(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){let[r,n,s,o]=xo.map(a=>t.includes(a));return e.metaKey!==r||e.ctrlKey!==n||e.altKey!==s||e.shiftKey!==o}},Lo={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:i=>i.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function Kl(i){let e=i.tagName.toLowerCase();if(e in Lo)return Lo[e](i)}function Zi(i){throw new Error(i)}function Gl(i){try{return JSON.parse(i)}catch{return i}}var Ln=class{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){let t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){let e=this.controller[this.methodName];if(typeof e=="function")return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){let{element:t}=this.action,{actionDescriptorFilters:r}=this.context.application,{controller:n}=this.context,s=!0;for(let[o,a]of Object.entries(this.eventOptions))if(o in r){let l=r[o];s=s&&l({name:o,value:a,event:e,element:t,controller:n})}else continue;return s}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){let{target:t,currentTarget:r}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:r,action:this.methodName})}catch(n){let{identifier:s,controller:o,element:a,index:l}=this,d={identifier:s,controller:o,element:a,index:l,event:e};this.context.handleError(n,`invoking action "${this.action}"`,d)}}willBeInvokedByEvent(e){let t=e.target;return e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e)||e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e)?!1:this.element===t?!0: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}},Qi=class{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(r=>this.processMutations(r))}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){let e=new Set(this.matchElementsInTree());for(let t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(let t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(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(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.processTree(r,this.removeElement)}}processAddedNodes(e){for(let t of Array.from(e)){let r=this.elementFromNode(t);r&&this.elementIsActive(r)&&this.processTree(r,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(let r of this.matchElementsInTree(e))t.call(this,r)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected!=this.element.isConnected?!1: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))}},Ji=class{constructor(e,t,r){this.attributeName=t,this.delegate=r,this.elementObserver=new Qi(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){let t=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(this.selector));return t.concat(r)}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 Xl(i,e,t){Fo(i,e).add(t)}function Yl(i,e,t){Fo(i,e).delete(t),Zl(i,e)}function Fo(i,e){let t=i.get(e);return t||(t=new Set,i.set(e,t)),t}function Zl(i,e){let t=i.get(e);t!=null&&t.size==0&&i.delete(e)}var Ge=class{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t.concat(Array.from(r)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((t,r)=>t+r.size,0)}add(e,t){Xl(this.valuesByKey,e,t)}delete(e,t){Yl(this.valuesByKey,e,t)}has(e,t){let r=this.valuesByKey.get(e);return r!=null&&r.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(r=>r.has(e))}getValuesForKey(e){let t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,r])=>r.has(e)).map(([t,r])=>t)}};var Cn=class{constructor(e,t,r,n){this._selector=t,this.details=n,this.elementObserver=new Qi(e,this),this.delegate=r,this.matchesByElement=new Ge}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){let{selector:t}=this;if(t){let r=e.matches(t);return this.delegate.selectorMatchElement?r&&this.delegate.selectorMatchElement(e,this.details):r}else return!1}matchElementsInTree(e){let{selector:t}=this;if(t){let r=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(t)).filter(s=>this.matchElement(s));return r.concat(n)}else return[]}elementMatched(e){let{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){let t=this.matchesByElement.getKeysForValue(e);for(let r of t)this.selectorUnmatched(e,r)}elementAttributeChanged(e,t){let{selector:r}=this;if(r){let n=this.matchElement(e),s=this.matchesByElement.has(r,e);n&&!s?this.selectorMatched(e,r):!n&&s&&this.selectorUnmatched(e,r)}}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)}},In=class{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(r=>this.processMutations(r))}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(let e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){let t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){let r=this.delegate.getStringMapKeyForAttribute(e);if(r!=null){this.stringMap.has(e)||this.stringMapKeyAdded(r,e);let n=this.element.getAttribute(e);if(this.stringMap.get(e)!=n&&this.stringMapValueChanged(n,r,t),n==null){let s=this.stringMap.get(e);this.stringMap.delete(e),s&&this.stringMapKeyRemoved(r,e,s)}else this.stringMap.set(e,n)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,r){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,r)}stringMapKeyRemoved(e,t,r){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,r)}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())}},er=class{constructor(e,t,r){this.attributeObserver=new Ji(e,t,this),this.delegate=r,this.tokensByElement=new Ge}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){let[t,r]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(r)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(t=>this.tokenMatched(t))}tokensUnmatched(e){e.forEach(t=>this.tokenUnmatched(t))}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){let t=this.tokensByElement.getValuesForKey(e),r=this.readTokensForElement(e),n=Jl(t,r).findIndex(([s,o])=>!ec(s,o));return n==-1?[[],[]]:[t.slice(n),r.slice(n)]}readTokensForElement(e){let t=this.attributeName,r=e.getAttribute(t)||"";return Ql(r,e,t)}};function Ql(i,e,t){return i.trim().split(/\s+/).filter(r=>r.length).map((r,n)=>({element:e,attributeName:t,content:r,index:n}))}function Jl(i,e){let t=Math.max(i.length,e.length);return Array.from({length:t},(r,n)=>[i[n],e[n]])}function ec(i,e){return i&&e&&i.index==e.index&&i.content==e.content}var tr=class{constructor(e,t,r){this.tokenListObserver=new er(e,t,this),this.delegate=r,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){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).set(e,r),this.delegate.elementMatchedValue(t,r))}tokenUnmatched(e){let{element:t}=e,{value:r}=this.fetchParseResultForToken(e);r&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,r))}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(t){return{error:t}}}},On=class{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new tr(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){let t=new Ln(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){let 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){let t=xn.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},Rn=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new In(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){let r=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,r.writer(this.receiver[e]),r.writer(r.defaultValue))}stringMapValueChanged(e,t,r){let n=this.valueDescriptorNameMap[t];e!==null&&(r===null&&(r=n.writer(n.defaultValue)),this.invokeChangedCallback(t,e,r))}stringMapKeyRemoved(e,t,r){let n=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,n.writer(this.receiver[e]),r):this.invokeChangedCallback(e,n.writer(n.defaultValue),r)}invokeChangedCallbacksForDefaultValues(){for(let{key:e,name:t,defaultValue:r,writer:n}of this.valueDescriptors)r!=null&&!this.controller.data.has(e)&&this.invokeChangedCallback(t,n(r),void 0)}invokeChangedCallback(e,t,r){let n=`${e}Changed`,s=this.receiver[n];if(typeof s=="function"){let o=this.valueDescriptorNameMap[e];try{let a=o.reader(t),l=r;r&&(l=o.reader(r)),s.call(this.receiver,a,l)}catch(a){throw a instanceof TypeError&&(a.message=`Stimulus Value "${this.context.identifier}.${o.name}" - ${a.message}`),a}}}get valueDescriptors(){let{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){let e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{let r=this.valueDescriptorMap[t];e[r.name]=r}),e}hasValue(e){let t=this.valueDescriptorNameMap[e],r=`has${wi(t.name)}`;return this.receiver[r]}},Mn=class{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new Ge}start(){this.tokenListObserver||(this.tokenListObserver=new er(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 r;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var r;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(let e of this.targetsByName.keys)for(let 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 Ei(i,e){let t=Bo(i);return Array.from(t.reduce((r,n)=>(ic(n,e).forEach(s=>r.add(s)),r),new Set))}function tc(i,e){return Bo(i).reduce((r,n)=>(r.push(...rc(n,e)),r),[])}function Bo(i){let e=[];for(;i;)e.push(i),i=Object.getPrototypeOf(i);return e.reverse()}function ic(i,e){let t=i[e];return Array.isArray(t)?t:[]}function rc(i,e){let t=i[e];return t?Object.keys(t).map(r=>[r,t[r]]):[]}var Pn=class{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new Ge,this.outletElementsByName=new Ge,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:r}){let n=this.getOutlet(e,r);n&&this.connectOutlet(n,e,r)}selectorUnmatched(e,t,{outletName:r}){let n=this.getOutletFromMap(e,r);n&&this.disconnectOutlet(n,e,r)}selectorMatchElement(e,{outletName:t}){let r=this.selector(t),n=this.hasOutlet(e,t),s=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return r?n&&s&&e.matches(r):!1}elementMatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementAttributeValueChanged(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}elementUnmatchedAttribute(e,t){let r=this.getOutletNameFromOutletAttributeName(t);r&&this.updateSelectorObserverForOutlet(r)}connectOutlet(e,t,r){var n;this.outletElementsByName.has(r,t)||(this.outletsByName.add(r,e),this.outletElementsByName.add(r,t),(n=this.selectorObserverMap.get(r))===null||n===void 0||n.pause(()=>this.delegate.outletConnected(e,t,r)))}disconnectOutlet(e,t,r){var n;this.outletElementsByName.has(r,t)&&(this.outletsByName.delete(r,e),this.outletElementsByName.delete(r,t),(n=this.selectorObserverMap.get(r))===null||n===void 0||n.pause(()=>this.delegate.outletDisconnected(e,t,r)))}disconnectAllOutlets(){for(let e of this.outletElementsByName.keys)for(let t of this.outletElementsByName.getValuesForKey(e))for(let r of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(r,t,e)}updateSelectorObserverForOutlet(e){let t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){let t=this.selector(e),r=new Cn(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,r),r.start()}setupAttributeObserverForOutlet(e){let t=this.attributeNameForOutletName(e),r=new Ji(this.scope.element,t,this);this.attributeObserverMap.set(e,r),r.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(){let e=new Ge;return this.router.modules.forEach(t=>{let r=t.definition.controllerConstructor;Ei(r,"outlets").forEach(s=>e.add(s,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){let 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(r=>r.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}},Dn=class{constructor(e,t){this.logDebugActivity=(r,n={})=>{let{identifier:s,controller:o,element:a}=this;n=Object.assign({identifier:s,controller:o,element:a},n),this.application.logDebugActivity(this.identifier,r,n)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new On(this,this.dispatcher),this.valueObserver=new Rn(this,this.controller),this.targetObserver=new Mn(this,this),this.outletObserver=new Pn(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(r){this.handleError(r,"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,r={}){let{identifier:n,controller:s,element:o}=this;r=Object.assign({identifier:n,controller:s,element:o},r),this.application.handleError(e,`Error ${t}`,r)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,r){this.invokeControllerMethod(`${Tn(r)}OutletConnected`,e,t)}outletDisconnected(e,t,r){this.invokeControllerMethod(`${Tn(r)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){let r=this.controller;typeof r[e]=="function"&&r[e](...t)}};function nc(i){return sc(i,oc(i))}function sc(i,e){let t=uc(i),r=ac(i.prototype,e);return Object.defineProperties(t.prototype,r),t}function oc(i){return Ei(i,"blessings").reduce((t,r)=>{let n=r(i);for(let s in n){let o=t[s]||{};t[s]=Object.assign(o,n[s])}return t},{})}function ac(i,e){return cc(e).reduce((t,r)=>{let n=lc(i,e,r);return n&&Object.assign(t,{[r]:n}),t},{})}function lc(i,e,t){let r=Object.getOwnPropertyDescriptor(i,t);if(!(r&&"value"in r)){let s=Object.getOwnPropertyDescriptor(e,t).value;return r&&(s.get=r.get||s.get,s.set=r.set||s.set),s}}var cc=typeof Object.getOwnPropertySymbols=="function"?i=>[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)]:Object.getOwnPropertyNames,uc=(()=>{function i(t){function r(){return Reflect.construct(t,arguments,new.target)}return r.prototype=Object.create(t.prototype,{constructor:{value:r}}),Reflect.setPrototypeOf(r,t),r}function e(){let r=i(function(){this.a.call(this)});return r.prototype.a=function(){},new r}try{return e(),i}catch{return r=>class extends r{}}})();function hc(i){return{identifier:i.identifier,controllerConstructor:nc(i.controllerConstructor)}}var Fn=class{constructor(e,t){this.application=e,this.definition=hc(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){let t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){let t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new Dn(this,e),this.contextsByScope.set(e,t)),t}},Bn=class{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){let t=this.data.get(this.getDataKey(e))||"";return Wl(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},Nn=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){let t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){let r=this.getAttributeNameForKey(e);return this.element.setAttribute(r,t),this.get(e)}has(e){let t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){let t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}else return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${Do(e)}`}},Hn=class{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,r){let n=this.warnedKeysByObject.get(e);n||(n=new Set,this.warnedKeysByObject.set(e,n)),n.has(t)||(n.add(t),this.logger.warn(r,e))}};function qn(i,e){return`[${i}~="${e}"]`}var zn=class{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 this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findTarget(r)||this.findLegacyTarget(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllTargets(r),...this.findAllLegacyTargets(r)],[])}findTarget(e){let t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){let t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){let t=this.schema.targetAttributeForScope(this.identifier);return qn(t,e)}findLegacyTarget(e){let t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){let t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(r=>this.deprecate(r,e))}getLegacySelectorForTargetName(e){let t=`${this.identifier}.${e}`;return qn(this.schema.targetAttribute,t)}deprecate(e,t){if(e){let{identifier:r}=this,n=this.schema.targetAttribute,s=this.schema.targetAttributeForScope(r);this.guide.warn(e,`target:${t}`,`Please replace ${n}="${r}.${t}" with ${s}="${t}". The ${n} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}},Vn=class{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 this.find(e)!=null}find(...e){return e.reduce((t,r)=>t||this.findOutlet(r),void 0)}findAll(...e){return e.reduce((t,r)=>[...t,...this.findAllOutlets(r)],[])}getSelectorForOutletName(e){let t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){let t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){let 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,r){let n=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&n.split(" ").includes(r)}},$n=class i{constructor(e,t,r,n){this.targets=new zn(this),this.classes=new Bn(this),this.data=new Nn(this),this.containsElement=s=>s.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=r,this.guide=new Hn(n),this.outlets=new Vn(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 qn(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new i(this.schema,document.documentElement,this.identifier,this.guide.logger)}},jn=class{constructor(e,t,r){this.element=e,this.schema=t,this.delegate=r,this.valueListObserver=new tr(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){let{element:t,content:r}=e;return this.parseValueForElementAndIdentifier(t,r)}parseValueForElementAndIdentifier(e,t){let r=this.fetchScopesByIdentifierForElement(e),n=r.get(t);return n||(n=this.delegate.createScopeForElementAndIdentifier(e,t),r.set(t,n)),n}elementMatchedValue(e,t){let r=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,r),r==1&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){let r=this.scopeReferenceCounts.get(t);r&&(this.scopeReferenceCounts.set(t,r-1),r==1&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}},Un=class{constructor(e){this.application=e,this.scopeObserver=new jn(this.element,this.schema,this),this.scopesByIdentifier=new Ge,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);let t=new Fn(this.application,e);this.connectModule(t);let r=e.controllerConstructor.afterLoad;r&&r.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){let t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){let r=this.modulesByIdentifier.get(t);if(r)return r.contexts.find(n=>n.element==e)}proposeToConnectScopeForElementAndIdentifier(e,t){let r=this.scopeObserver.parseValueForElementAndIdentifier(e,t);r?this.scopeObserver.elementMatchedValue(r.element,r):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,r){this.application.handleError(e,t,r)}createScopeForElementAndIdentifier(e,t){return new $n(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.connectContextForScope(r))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(r=>e.disconnectContextForScope(r))}},dc={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:i=>`data-${i}-target`,outletAttributeForScope:(i,e)=>`data-${i}-${e}-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"},Co("abcdefghijklmnopqrstuvwxyz".split("").map(i=>[i,i]))),Co("0123456789".split("").map(i=>[i,i])))};function Co(i){return i.reduce((e,[t,r])=>Object.assign(Object.assign({},e),{[t]:r}),{})}var ir=class{constructor(e=document.documentElement,t=dc){this.logger=console,this.debug=!1,this.logDebugActivity=(r,n,s={})=>{this.debug&&this.logFormattedMessage(r,n,s)},this.element=e,this.schema=t,this.dispatcher=new Sn(this),this.router=new Un(this),this.actionDescriptorFilters=Object.assign({},ql)}static start(e,t){let r=new this(e,t);return r.start(),r}async start(){await pc(),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(n=>{n.controllerConstructor.shouldLoad&&this.router.loadDefinition(n)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(n=>this.router.unloadIdentifier(n))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){let r=this.router.getContextForElementAndIdentifier(e,t);return r?r.controller:null}handleError(e,t,r){var n;this.logger.error(`%s
|
2
2
|
|
3
3
|
%o
|
4
4
|
|
5
|
-
%o`,t,e,r),(n=window.onerror)===null||n===void 0||n.call(window,t,"",0,0,e)}logFormattedMessage(e,t,r={}){r=Object.assign({application:this},r),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},r)),this.logger.groupEnd()}};function fc(){return new Promise(i=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>i()):i()})}function mc(i){return Ei(i,"classes").reduce((t,r)=>Object.assign(t,gc(r)),{})}function gc(i){return{[`${i}Class`]:{get(){let{classes:e}=this;if(e.has(i))return e.get(i);{let t=e.getAttributeName(i);throw new Error(`Missing attribute "${t}"`)}}},[`${i}Classes`]:{get(){return this.classes.getAll(i)}},[`has${wi(i)}Class`]:{get(){return this.classes.has(i)}}}}function vc(i){return Ei(i,"outlets").reduce((t,r)=>Object.assign(t,bc(r)),{})}function Oo(i,e,t){return i.application.getControllerForElementAndIdentifier(e,t)}function Ro(i,e,t){let r=Oo(i,e,t);if(r||(i.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),r=Oo(i,e,t),r))return r}function bc(i){let e=kn(i);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t){let n=Ro(this,t,i);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}Outlets`]:{get(){let t=this.outlets.findAll(i);return t.length>0?t.map(r=>{let n=Ro(this,r,i);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`,r)}).filter(r=>r):[]}},[`${e}OutletElement`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t)return t;throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(i)}},[`has${wi(e)}Outlet`]:{get(){return this.outlets.has(i)}}}}function yc(i){return Ei(i,"targets").reduce((t,r)=>Object.assign(t,wc(r)),{})}function wc(i){return{[`${i}Target`]:{get(){let e=this.targets.find(i);if(e)return e;throw new Error(`Missing target element "${i}" for "${this.identifier}" controller`)}},[`${i}Targets`]:{get(){return this.targets.findAll(i)}},[`has${wi(i)}Target`]:{get(){return this.targets.has(i)}}}}function Ec(i){let e=ic(i,"values"),t={valueDescriptorMap:{get(){return e.reduce((r,n)=>{let s=Ho(n,this.identifier),o=this.data.getAttributeNameForKey(s.key);return Object.assign(r,{[o]:s})},{})}}};return e.reduce((r,n)=>Object.assign(r,_c(n)),t)}function _c(i,e){let t=Ho(i,e),{key:r,name:n,reader:s,writer:o}=t;return{[n]:{get(){let a=this.data.get(r);return a!==null?s(a):t.defaultValue},set(a){a===void 0?this.data.delete(r):this.data.set(r,o(a))}},[`has${wi(n)}`]:{get(){return this.data.has(r)||t.hasCustomDefaultValue}}}}function Ho([i,e],t){return kc({controller:t,token:i,typeDefinition:e})}function rr(i){switch(i){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function yi(i){switch(typeof i){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(i))return"array";if(Object.prototype.toString.call(i)==="[object Object]")return"object"}function Ac(i){let{controller:e,token:t,typeObject:r}=i,n=xo(r.type),s=xo(r.default),o=n&&s,a=n&&!s,l=!n&&s,d=rr(r.type),p=yi(i.typeObject.default);if(a)return d;if(l)return p;if(d!==p){let m=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${m}" must match the defined type "${d}". The provided default value of "${r.default}" is of type "${p}".`)}if(o)return d}function Sc(i){let{controller:e,token:t,typeDefinition:r}=i,s=Ac({controller:e,token:t,typeObject:r}),o=yi(r),a=rr(r),l=s||o||a;if(l)return l;let d=e?`${e}.${r}`:t;throw new Error(`Unknown value type "${d}" for "${t}" value`)}function Tc(i){let e=rr(i);if(e)return Mo[e];let t=xn(i,"default"),r=xn(i,"type"),n=i;if(t)return n.default;if(r){let{type:s}=n,o=rr(s);if(o)return Mo[o]}return i}function kc(i){let{token:e,typeDefinition:t}=i,r=`${Fo(e)}-value`,n=Sc(i);return{type:n,key:r,name:Kn(r),get defaultValue(){return Tc(t)},get hasCustomDefaultValue(){return yi(t)!==void 0},reader:xc[n],writer:Po[n]||Po.default}}var Mo={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},xc={array(i){let e=JSON.parse(i);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${i}" of type "${yi(e)}"`);return e},boolean(i){return!(i=="0"||String(i).toLowerCase()=="false")},number(i){return Number(i.replace(/_/g,""))},object(i){let e=JSON.parse(i);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${i}" of type "${yi(e)}"`);return e},string(i){return i}},Po={default:Lc,array:Do,object:Do};function Do(i){return JSON.stringify(i)}function Lc(i){return`${i}`}var T=class{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:r={},prefix:n=this.identifier,bubbles:s=!0,cancelable:o=!0}={}){let a=n?`${n}:${e}`:e,l=new CustomEvent(a,{detail:r,bubbles:s,cancelable:o});return t.dispatchEvent(l),l}};T.blessings=[mc,yc,Ec,vc];T.targets=[];T.outlets=[];T.values={};var nr=class extends T{connect(){console.log(`resource-layout connected: ${this.element}`)}};var sr=class extends T{connect(){console.log(`nav-grid-menu-item connected: ${this.element}`)}};var or=class extends T{connect(){console.log(`nav-grid-menu connected: ${this.element}`)}};var ar=class extends T{connect(){console.log(`nav-user-section connected: ${this.element}`)}};var lr=class extends T{connect(){console.log(`nav-user-link connected: ${this.element}`)}};var cr=class extends T{connect(){console.log(`nav-user connected: ${this.element}`)}};var ur=class extends T{static targets=["openIcon","closeIcon"];static outlets=["sidebar"];static values={placement:{type:String,default:"left"},bodyScrolling:{type:Boolean,default:!1},backdrop:{type:Boolean,default:!0},edge:{type:Boolean,default:!1},edgeOffset:{type:String,default:"bottom-[60px]"}};static classes={backdrop:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-30"};initialize(){this.visible=!1,this.handleEscapeKey=this.handleEscapeKey.bind(this)}connect(){document.addEventListener("keydown",this.handleEscapeKey)}sidebarOutletConnected(){this.#e(this.sidebarOutlet.element)}disconnect(){this.#i(),document.removeEventListener("keydown",this.handleEscapeKey),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden")}#e(i){i.setAttribute("aria-hidden","true"),i.classList.add("transition-transform"),this.#n(this.placementValue).base.forEach(e=>{i.classList.add(e)})}toggleDrawer(){this.visible?this.hideDrawer():this.showDrawer()}showDrawer(){this.edgeValue?this.#r(`${this.placementValue}-edge`,!0):this.#s(this.placementValue,!0),this.openIconTarget.classList.add("hidden"),this.openIconTarget.setAttribute("aria-hidden","true"),this.closeIconTarget.classList.remove("hidden"),this.closeIconTarget.setAttribute("aria-hidden","false"),this.sidebarOutlet.element.setAttribute("aria-modal","true"),this.sidebarOutlet.element.setAttribute("role","dialog"),this.sidebarOutlet.element.removeAttribute("aria-hidden"),this.bodyScrollingValue||document.body.classList.add("overflow-hidden"),this.backdropValue&&this.#t(),this.visible=!0,this.dispatch("show")}hideDrawer(){this.edgeValue?this.#r(`${this.placementValue}-edge`,!1):this.#s(this.placementValue,!1),this.openIconTarget.classList.remove("hidden"),this.openIconTarget.setAttribute("aria-hidden","false"),this.closeIconTarget.classList.add("hidden"),this.closeIconTarget.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.removeAttribute("aria-modal"),this.sidebarOutlet.element.removeAttribute("role"),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden"),this.backdropValue&&this.#i(),this.visible=!1,this.dispatch("hide")}handleEscapeKey(i){i.key==="Escape"&&this.visible&&this.hideDrawer()}#t(){if(!this.visible){let i=document.createElement("div");i.setAttribute("data-drawer-backdrop",""),i.classList.add(...this.constructor.classes.backdrop.split(" ")),i.addEventListener("click",()=>this.hideDrawer()),document.body.appendChild(i)}}#i(){let i=document.querySelector("[data-drawer-backdrop]");i&&i.remove()}#n(i){let e={top:{base:["top-0","left-0","right-0"],active:["transform-none"],inactive:["-translate-y-full"]},right:{base:["right-0","top-0"],active:["transform-none"],inactive:["translate-x-full"]},bottom:{base:["bottom-0","left-0","right-0"],active:["transform-none"],inactive:["translate-y-full"]},left:{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]},"bottom-edge":{base:["left-0","top-0"],active:["transform-none"],inactive:["translate-y-full",this.edgeOffsetValue]}};return e[i]||e.left}#s(i,e){let t=this.#n(i);e?(t.active.forEach(r=>this.sidebarOutlet.element.classList.add(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.remove(r))):(t.active.forEach(r=>this.sidebarOutlet.element.classList.remove(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.add(r)))}#r(i,e){this.#s(i,e)}};var hr=class extends T{connect(){console.log(`sidebar-menu-item connected: ${this.element}`)}};var dr=class extends T{connect(){console.log(`sidebar-menu connected: ${this.element}`)}};var pr=class extends T{connect(){console.log(`sidebar connected: ${this.element}`)}};var fr=class extends T{connect(){console.log(`has-many-panel connected: ${this.element}`)}};var mr=class extends T{static targets=["target","template","addButton"];static values={wrapperSelector:{type:String,default:".nested-resource-form-fields"},limit:Number};connect(){this.updateState()}add(i){i.preventDefault();let e=this.templateTarget.innerHTML.replace(/NEW_RECORD/g,new Date().getTime().toString());this.targetTarget.insertAdjacentHTML("beforebegin",e);let t=new CustomEvent("nested-resource-form-fields:add",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}remove(i){i.preventDefault();let e=i.target.closest(this.wrapperSelectorValue);if(e.dataset.newRecord!==void 0)e.remove();else{e.style.display="none",e.classList.remove(...e.classList);let r=e.querySelector("input[name*='_destroy']");r.value="1"}let t=new CustomEvent("nested-resource-form-fields:remove",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}updateState(){!this.hasAddButtonTarget||this.limitValue==0||(this.childCount>=this.limitValue?this.addButtonTarget.style.display="none":this.addButtonTarget.style.display="initial")}get childCount(){return this.element.querySelectorAll(this.wrapperSelectorValue).length}};var gr=class extends T{connect(){console.log(`toolbar connected: ${this.element}`)}};var vr=class extends T{connect(){console.log(`table-search-input connected: ${this.element}`)}};var br=class extends T{connect(){console.log(`table-toolbar connected: ${this.element}`)}};var yr=class extends T{connect(){console.log(`table connected: ${this.element}`)}};var tf=Hl($o(),1),wr=class extends T{connect(){console.log(`form connected: ${this.element}`)}submit(){this.element.requestSubmit()}};var Wc=function(){function i(e,t){t===void 0&&(t=[]),this._eventType=e,this._eventFunctions=t}return i.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(t){typeof window<"u"&&window.addEventListener(e._eventType,t)})},i}(),jo=Wc;var Kc=function(){function i(){this._instances={Accordion:{},Carousel:{},Collapse:{},Dial:{},Dismiss:{},Drawer:{},Dropdown:{},Modal:{},Popover:{},Tabs:{},Tooltip:{},InputCounter:{},CopyClipboard:{}}}return i.prototype.addInstance=function(e,t,r,n){if(n===void 0&&(n=!1),!this._instances[e])return console.warn("Flowbite: Component ".concat(e," does not exist.")),!1;if(this._instances[e][r]&&!n){console.warn("Flowbite: Instance with ID ".concat(r," already exists."));return}n&&this._instances[e][r]&&this._instances[e][r].destroyAndRemoveInstance(),this._instances[e][r||this._generateRandomId()]=t},i.prototype.getAllInstances=function(){return this._instances},i.prototype.getInstances=function(e){return this._instances[e]?this._instances[e]:(console.warn("Flowbite: Component ".concat(e," does not exist.")),!1)},i.prototype.getInstance=function(e,t){if(this._componentAndInstanceCheck(e,t)){if(!this._instances[e][t]){console.warn("Flowbite: Instance with ID ".concat(t," does not exist."));return}return this._instances[e][t]}},i.prototype.destroyAndRemoveInstance=function(e,t){this._componentAndInstanceCheck(e,t)&&(this.destroyInstanceObject(e,t),this.removeInstance(e,t))},i.prototype.removeInstance=function(e,t){this._componentAndInstanceCheck(e,t)&&delete this._instances[e][t]},i.prototype.destroyInstanceObject=function(e,t){this._componentAndInstanceCheck(e,t)&&this._instances[e][t].destroy()},i.prototype.instanceExists=function(e,t){return!(!this._instances[e]||!this._instances[e][t])},i.prototype._generateRandomId=function(){return Math.random().toString(36).substr(2,9)},i.prototype._componentAndInstanceCheck=function(e,t){return this._instances[e]?this._instances[e][t]?!0:(console.warn("Flowbite: Instance with ID ".concat(t," does not exist.")),!1):(console.warn("Flowbite: Component ".concat(e," does not exist.")),!1)},i}(),Uo=new Kc,I=Uo;typeof window<"u"&&(window.FlowbiteInstances=Uo);var Er=function(){return Er=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Er.apply(this,arguments)},_r={alwaysOpen:!1,activeClasses:"bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white",inactiveClasses:"text-gray-500 dark:text-gray-400",onOpen:function(){},onClose:function(){},onToggle:function(){}},Gc={id:null,override:!0},Wo=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=_r),n===void 0&&(n=Gc),this._instanceId=n.id?n.id:e.id,this._accordionEl=e,this._items=t,this._options=Er(Er({},_r),r),this._initialized=!1,this.init(),I.addInstance("Accordion",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._items.length&&!this._initialized&&(this._items.forEach(function(t){t.active&&e.open(t.id);var r=function(){e.toggle(t.id)};t.triggerEl.addEventListener("click",r),t.clickHandler=r}),this._initialized=!0)},i.prototype.destroy=function(){this._items.length&&this._initialized&&(this._items.forEach(function(e){e.triggerEl.removeEventListener("click",e.clickHandler),delete e.clickHandler}),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Accordion",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getItem=function(e){return this._items.filter(function(t){return t.id===e})[0]},i.prototype.open=function(e){var t,r,n=this,s=this.getItem(e);this._options.alwaysOpen||this._items.map(function(o){var a,l;o!==s&&((a=o.triggerEl.classList).remove.apply(a,n._options.activeClasses.split(" ")),(l=o.triggerEl.classList).add.apply(l,n._options.inactiveClasses.split(" ")),o.targetEl.classList.add("hidden"),o.triggerEl.setAttribute("aria-expanded","false"),o.active=!1,o.iconEl&&o.iconEl.classList.add("rotate-180"))}),(t=s.triggerEl.classList).add.apply(t,this._options.activeClasses.split(" ")),(r=s.triggerEl.classList).remove.apply(r,this._options.inactiveClasses.split(" ")),s.triggerEl.setAttribute("aria-expanded","true"),s.targetEl.classList.remove("hidden"),s.active=!0,s.iconEl&&s.iconEl.classList.remove("rotate-180"),this._options.onOpen(this,s)},i.prototype.toggle=function(e){var t=this.getItem(e);t.active?this.close(e):this.open(e),this._options.onToggle(this,t)},i.prototype.close=function(e){var t,r,n=this.getItem(e);(t=n.triggerEl.classList).remove.apply(t,this._options.activeClasses.split(" ")),(r=n.triggerEl.classList).add.apply(r,this._options.inactiveClasses.split(" ")),n.targetEl.classList.add("hidden"),n.triggerEl.setAttribute("aria-expanded","false"),n.active=!1,n.iconEl&&n.iconEl.classList.add("rotate-180"),this._options.onClose(this,n)},i.prototype.updateOnOpen=function(e){this._options.onOpen=e},i.prototype.updateOnClose=function(e){this._options.onClose=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Nt(){document.querySelectorAll("[data-accordion]").forEach(function(i){var e=i.getAttribute("data-accordion"),t=i.getAttribute("data-active-classes"),r=i.getAttribute("data-inactive-classes"),n=[];i.querySelectorAll("[data-accordion-target]").forEach(function(s){if(s.closest("[data-accordion]")===i){var o={id:s.getAttribute("data-accordion-target"),triggerEl:s,targetEl:document.querySelector(s.getAttribute("data-accordion-target")),iconEl:s.querySelector("[data-accordion-icon]"),active:s.getAttribute("aria-expanded")==="true"};n.push(o)}}),new Wo(i,n,{alwaysOpen:e==="open",activeClasses:t||_r.activeClasses,inactiveClasses:r||_r.inactiveClasses})})}typeof window<"u"&&(window.Accordion=Wo,window.initAccordions=Nt);var Ar=function(){return Ar=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Ar.apply(this,arguments)},Ko={onCollapse:function(){},onExpand:function(){},onToggle:function(){}},Xc={id:null,override:!0},Sr=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Ko),n===void 0&&(n=Xc),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=Ar(Ar({},Ko),r),this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Collapse",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._triggerEl&&this._targetEl&&!this._initialized&&(this._triggerEl.hasAttribute("aria-expanded")?this._visible=this._triggerEl.getAttribute("aria-expanded")==="true":this._visible=!this._targetEl.classList.contains("hidden"),this._clickHandler=function(){e.toggle()},this._triggerEl.addEventListener("click",this._clickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._initialized&&(this._triggerEl.removeEventListener("click",this._clickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Collapse",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.collapse=function(){this._targetEl.classList.add("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","false"),this._visible=!1,this._options.onCollapse(this)},i.prototype.expand=function(){this._targetEl.classList.remove("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","true"),this._visible=!0,this._options.onExpand(this)},i.prototype.toggle=function(){this._visible?this.collapse():this.expand(),this._options.onToggle(this)},i.prototype.updateOnCollapse=function(e){this._options.onCollapse=e},i.prototype.updateOnExpand=function(e){this._options.onExpand=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Ht(){document.querySelectorAll("[data-collapse-toggle]").forEach(function(i){var e=i.getAttribute("data-collapse-toggle"),t=document.getElementById(e);t?I.instanceExists("Collapse",t.getAttribute("id"))?new Sr(t,i,{},{id:t.getAttribute("id")+"_"+I._generateRandomId()}):new Sr(t,i):console.error('The target element with id "'.concat(e,'" does not exist. Please check the data-collapse-toggle attribute.'))})}typeof window<"u"&&(window.Collapse=Sr,window.initCollapses=Ht);var Yn=Sr;var ut=function(){return ut=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},ut.apply(this,arguments)},Tr={defaultPosition:0,indicators:{items:[],activeClasses:"bg-white dark:bg-gray-800",inactiveClasses:"bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800"},interval:3e3,onNext:function(){},onPrev:function(){},onChange:function(){}},Yc={id:null,override:!0},Go=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=Tr),n===void 0&&(n=Yc),this._instanceId=n.id?n.id:e.id,this._carouselEl=e,this._items=t,this._options=ut(ut(ut({},Tr),r),{indicators:ut(ut({},Tr.indicators),r.indicators)}),this._activeItem=this.getItem(this._options.defaultPosition),this._indicators=this._options.indicators.items,this._intervalDuration=this._options.interval,this._intervalInstance=null,this._initialized=!1,this.init(),I.addInstance("Carousel",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._items.length&&!this._initialized&&(this._items.map(function(t){t.el.classList.add("absolute","inset-0","transition-transform","transform")}),this.getActiveItem()?this.slideTo(this.getActiveItem().position):this.slideTo(0),this._indicators.map(function(t,r){t.el.addEventListener("click",function(){e.slideTo(r)})}),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Carousel",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getItem=function(e){return this._items[e]},i.prototype.slideTo=function(e){var t=this._items[e],r={left:t.position===0?this._items[this._items.length-1]:this._items[t.position-1],middle:t,right:t.position===this._items.length-1?this._items[0]:this._items[t.position+1]};this._rotate(r),this._setActiveItem(t),this._intervalInstance&&(this.pause(),this.cycle()),this._options.onChange(this)},i.prototype.next=function(){var e=this.getActiveItem(),t=null;e.position===this._items.length-1?t=this._items[0]:t=this._items[e.position+1],this.slideTo(t.position),this._options.onNext(this)},i.prototype.prev=function(){var e=this.getActiveItem(),t=null;e.position===0?t=this._items[this._items.length-1]:t=this._items[e.position-1],this.slideTo(t.position),this._options.onPrev(this)},i.prototype._rotate=function(e){if(this._items.map(function(t){t.el.classList.add("hidden")}),this._items.length===1){e.middle.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-10"),e.middle.el.classList.add("translate-x-0","z-20");return}e.left.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-20"),e.left.el.classList.add("-translate-x-full","z-10"),e.middle.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-10"),e.middle.el.classList.add("translate-x-0","z-30"),e.right.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-30"),e.right.el.classList.add("translate-x-full","z-20")},i.prototype.cycle=function(){var e=this;typeof window<"u"&&(this._intervalInstance=window.setInterval(function(){e.next()},this._intervalDuration))},i.prototype.pause=function(){clearInterval(this._intervalInstance)},i.prototype.getActiveItem=function(){return this._activeItem},i.prototype._setActiveItem=function(e){var t,r,n=this;this._activeItem=e;var s=e.position;this._indicators.length&&(this._indicators.map(function(o){var a,l;o.el.setAttribute("aria-current","false"),(a=o.el.classList).remove.apply(a,n._options.indicators.activeClasses.split(" ")),(l=o.el.classList).add.apply(l,n._options.indicators.inactiveClasses.split(" "))}),(t=this._indicators[s].el.classList).add.apply(t,this._options.indicators.activeClasses.split(" ")),(r=this._indicators[s].el.classList).remove.apply(r,this._options.indicators.inactiveClasses.split(" ")),this._indicators[s].el.setAttribute("aria-current","true"))},i.prototype.updateOnNext=function(e){this._options.onNext=e},i.prototype.updateOnPrev=function(e){this._options.onPrev=e},i.prototype.updateOnChange=function(e){this._options.onChange=e},i}();function qt(){document.querySelectorAll("[data-carousel]").forEach(function(i){var e=i.getAttribute("data-carousel-interval"),t=i.getAttribute("data-carousel")==="slide",r=[],n=0;i.querySelectorAll("[data-carousel-item]").length&&Array.from(i.querySelectorAll("[data-carousel-item]")).map(function(d,p){r.push({position:p,el:d}),d.getAttribute("data-carousel-item")==="active"&&(n=p)});var s=[];i.querySelectorAll("[data-carousel-slide-to]").length&&Array.from(i.querySelectorAll("[data-carousel-slide-to]")).map(function(d){s.push({position:parseInt(d.getAttribute("data-carousel-slide-to")),el:d})});var o=new Go(i,r,{defaultPosition:n,indicators:{items:s},interval:e||Tr.interval});t&&o.cycle();var a=i.querySelector("[data-carousel-next]"),l=i.querySelector("[data-carousel-prev]");a&&a.addEventListener("click",function(){o.next()}),l&&l.addEventListener("click",function(){o.prev()})})}typeof window<"u"&&(window.Carousel=Go,window.initCarousels=qt);var kr=function(){return kr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},kr.apply(this,arguments)},Xo={transition:"transition-opacity",duration:300,timing:"ease-out",onHide:function(){}},Zc={id:null,override:!0},Yo=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Xo),n===void 0&&(n=Zc),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=kr(kr({},Xo),r),this._initialized=!1,this.init(),I.addInstance("Dismiss",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._triggerEl&&this._targetEl&&!this._initialized&&(this._clickHandler=function(){e.hide()},this._triggerEl.addEventListener("click",this._clickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._initialized&&(this._triggerEl.removeEventListener("click",this._clickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Dismiss",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){var e=this;this._targetEl.classList.add(this._options.transition,"duration-".concat(this._options.duration),this._options.timing,"opacity-0"),setTimeout(function(){e._targetEl.classList.add("hidden")},this._options.duration),this._options.onHide(this,this._targetEl)},i.prototype.updateOnHide=function(e){this._options.onHide=e},i}();function zt(){document.querySelectorAll("[data-dismiss-target]").forEach(function(i){var e=i.getAttribute("data-dismiss-target"),t=document.querySelector(e);t?new Yo(t,i):console.error('The dismiss element with id "'.concat(e,'" does not exist. Please check the data-dismiss-target attribute.'))})}typeof window<"u"&&(window.Dismiss=Yo,window.initDismisses=zt);var J="top",ie="bottom",te="right",ee="left",xr="auto",et=[J,ie,te,ee],Xe="start",ht="end",Zo="clippingParents",Lr="viewport",Vt="popper",Qo="reference",Zn=et.reduce(function(i,e){return i.concat([e+"-"+Xe,e+"-"+ht])},[]),Cr=[].concat(et,[xr]).reduce(function(i,e){return i.concat([e,e+"-"+Xe,e+"-"+ht])},[]),Qc="beforeRead",Jc="read",eu="afterRead",tu="beforeMain",iu="main",ru="afterMain",nu="beforeWrite",su="write",ou="afterWrite",Jo=[Qc,Jc,eu,tu,iu,ru,nu,su,ou];function oe(i){return i?(i.nodeName||"").toLowerCase():null}function G(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function _e(i){var e=G(i).Element;return i instanceof e||i instanceof Element}function re(i){var e=G(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function $t(i){if(typeof ShadowRoot>"u")return!1;var e=G(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function au(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];!re(s)||!oe(s)||(Object.assign(s.style,r),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function lu(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var n=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=o.reduce(function(l,d){return l[d]="",l},{});!re(n)||!oe(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}var ea={name:"applyStyles",enabled:!0,phase:"write",fn:au,effect:lu,requires:["computeStyles"]};function ae(i){return i.split("-")[0]}var Ce=Math.max,dt=Math.min,Ye=Math.round;function jt(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function _i(){return!/^((?!chrome|android).)*safari/i.test(jt())}function Ae(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=i.getBoundingClientRect(),n=1,s=1;e&&re(i)&&(n=i.offsetWidth>0&&Ye(r.width)/i.offsetWidth||1,s=i.offsetHeight>0&&Ye(r.height)/i.offsetHeight||1);var o=_e(i)?G(i):window,a=o.visualViewport,l=!_i()&&t,d=(r.left+(l&&a?a.offsetLeft:0))/n,p=(r.top+(l&&a?a.offsetTop:0))/s,m=r.width/n,E=r.height/s;return{width:m,height:E,top:p,right:d+m,bottom:p+E,left:d,x:d,y:p}}function pt(i){var e=Ae(i),t=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:r}}function Ai(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&$t(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function me(i){return G(i).getComputedStyle(i)}function Qn(i){return["table","td","th"].indexOf(oe(i))>=0}function he(i){return((_e(i)?i.ownerDocument:i.document)||window.document).documentElement}function Ze(i){return oe(i)==="html"?i:i.assignedSlot||i.parentNode||($t(i)?i.host:null)||he(i)}function ta(i){return!re(i)||me(i).position==="fixed"?null:i.offsetParent}function cu(i){var e=/firefox/i.test(jt()),t=/Trident/i.test(jt());if(t&&re(i)){var r=me(i);if(r.position==="fixed")return null}var n=Ze(i);for($t(n)&&(n=n.host);re(n)&&["html","body"].indexOf(oe(n))<0;){var s=me(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function Ie(i){for(var e=G(i),t=ta(i);t&&Qn(t)&&me(t).position==="static";)t=ta(t);return t&&(oe(t)==="html"||oe(t)==="body"&&me(t).position==="static")?e:t||cu(i)||e}function ft(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function mt(i,e,t){return Ce(i,dt(e,t))}function ia(i,e,t){var r=mt(i,e,t);return r>t?t:r}function Si(){return{top:0,right:0,bottom:0,left:0}}function Ti(i){return Object.assign({},Si(),i)}function ki(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var uu=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Ti(typeof e!="number"?e:ki(e,et))};function hu(i){var e,t=i.state,r=i.name,n=i.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=ae(t.placement),l=ft(a),d=[ee,te].indexOf(a)>=0,p=d?"height":"width";if(!(!s||!o)){var m=uu(n.padding,t),E=pt(s),v=l==="y"?J:ee,C=l==="y"?ie:te,_=t.rects.reference[p]+t.rects.reference[l]-o[l]-t.rects.popper[p],k=o[l]-t.rects.reference[l],D=Ie(s),q=D?l==="y"?D.clientHeight||0:D.clientWidth||0:0,B=_/2-k/2,S=m[v],R=q-E[p]-m[C],x=q/2-E[p]/2+B,P=mt(S,x,R),N=l;t.modifiersData[r]=(e={},e[N]=P,e.centerOffset=P-x,e)}}function du(i){var e=i.state,t=i.options,r=t.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||Ai(e.elements.popper,n)&&(e.elements.arrow=n))}var ra={name:"arrow",enabled:!0,phase:"main",fn:hu,effect:du,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Se(i){return i.split("-")[1]}var pu={top:"auto",right:"auto",bottom:"auto",left:"auto"};function fu(i,e){var t=i.x,r=i.y,n=e.devicePixelRatio||1;return{x:Ye(t*n)/n||0,y:Ye(r*n)/n||0}}function na(i){var e,t=i.popper,r=i.popperRect,n=i.placement,s=i.variation,o=i.offsets,a=i.position,l=i.gpuAcceleration,d=i.adaptive,p=i.roundOffsets,m=i.isFixed,E=o.x,v=E===void 0?0:E,C=o.y,_=C===void 0?0:C,k=typeof p=="function"?p({x:v,y:_}):{x:v,y:_};v=k.x,_=k.y;var D=o.hasOwnProperty("x"),q=o.hasOwnProperty("y"),B=ee,S=J,R=window;if(d){var x=Ie(t),P="clientHeight",N="clientWidth";if(x===G(t)&&(x=he(t),me(x).position!=="static"&&a==="absolute"&&(P="scrollHeight",N="scrollWidth")),x=x,n===J||(n===ee||n===te)&&s===ht){S=ie;var U=m&&x===R&&R.visualViewport?R.visualViewport.height:x[P];_-=U-r.height,_*=l?1:-1}if(n===ee||(n===J||n===ie)&&s===ht){B=te;var X=m&&x===R&&R.visualViewport?R.visualViewport.width:x[N];v-=X-r.width,v*=l?1:-1}}var z=Object.assign({position:a},d&&pu),Y=p===!0?fu({x:v,y:_},G(t)):{x:v,y:_};if(v=Y.x,_=Y.y,l){var W;return Object.assign({},z,(W={},W[S]=q?"0":"",W[B]=D?"0":"",W.transform=(R.devicePixelRatio||1)<=1?"translate("+v+"px, "+_+"px)":"translate3d("+v+"px, "+_+"px, 0)",W))}return Object.assign({},z,(e={},e[S]=q?_+"px":"",e[B]=D?v+"px":"",e.transform="",e))}function mu(i){var e=i.state,t=i.options,r=t.gpuAcceleration,n=r===void 0?!0:r,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,l=a===void 0?!0:a,d={placement:ae(e.placement),variation:Se(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,na(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,na(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var sa={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:mu,data:{}};var Ir={passive:!0};function gu(i){var e=i.state,t=i.instance,r=i.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,l=G(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&d.forEach(function(p){p.addEventListener("scroll",t.update,Ir)}),a&&l.addEventListener("resize",t.update,Ir),function(){s&&d.forEach(function(p){p.removeEventListener("scroll",t.update,Ir)}),a&&l.removeEventListener("resize",t.update,Ir)}}var oa={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:gu,data:{}};var vu={left:"right",right:"left",bottom:"top",top:"bottom"};function Ut(i){return i.replace(/left|right|bottom|top/g,function(e){return vu[e]})}var bu={start:"end",end:"start"};function Or(i){return i.replace(/start|end/g,function(e){return bu[e]})}function gt(i){var e=G(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function vt(i){return Ae(he(i)).left+gt(i).scrollLeft}function Jn(i,e){var t=G(i),r=he(i),n=t.visualViewport,s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;var d=_i();(d||!d&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:s,height:o,x:a+vt(i),y:l}}function es(i){var e,t=he(i),r=gt(i),n=(e=i.ownerDocument)==null?void 0:e.body,s=Ce(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=Ce(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+vt(i),l=-r.scrollTop;return me(n||t).direction==="rtl"&&(a+=Ce(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function bt(i){var e=me(i),t=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+r)}function Rr(i){return["html","body","#document"].indexOf(oe(i))>=0?i.ownerDocument.body:re(i)&&bt(i)?i:Rr(Ze(i))}function tt(i,e){var t;e===void 0&&(e=[]);var r=Rr(i),n=r===((t=i.ownerDocument)==null?void 0:t.body),s=G(r),o=n?[s].concat(s.visualViewport||[],bt(r)?r:[]):r,a=e.concat(o);return n?a:a.concat(tt(Ze(o)))}function Wt(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function yu(i,e){var t=Ae(i,!1,e==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function aa(i,e,t){return e===Lr?Wt(Jn(i,t)):_e(e)?yu(e,t):Wt(es(he(i)))}function wu(i){var e=tt(Ze(i)),t=["absolute","fixed"].indexOf(me(i).position)>=0,r=t&&re(i)?Ie(i):i;return _e(r)?e.filter(function(n){return _e(n)&&Ai(n,r)&&oe(n)!=="body"}):[]}function ts(i,e,t,r){var n=e==="clippingParents"?wu(i):[].concat(e),s=[].concat(n,[t]),o=s[0],a=s.reduce(function(l,d){var p=aa(i,d,r);return l.top=Ce(p.top,l.top),l.right=dt(p.right,l.right),l.bottom=dt(p.bottom,l.bottom),l.left=Ce(p.left,l.left),l},aa(i,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function xi(i){var e=i.reference,t=i.element,r=i.placement,n=r?ae(r):null,s=r?Se(r):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(n){case J:l={x:o,y:e.y-t.height};break;case ie:l={x:o,y:e.y+e.height};break;case te:l={x:e.x+e.width,y:a};break;case ee:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var d=n?ft(n):null;if(d!=null){var p=d==="y"?"height":"width";switch(s){case Xe:l[d]=l[d]-(e[p]/2-t[p]/2);break;case ht:l[d]=l[d]+(e[p]/2-t[p]/2);break;default:}}return l}function Oe(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=r===void 0?i.placement:r,s=t.strategy,o=s===void 0?i.strategy:s,a=t.boundary,l=a===void 0?Zo:a,d=t.rootBoundary,p=d===void 0?Lr:d,m=t.elementContext,E=m===void 0?Vt:m,v=t.altBoundary,C=v===void 0?!1:v,_=t.padding,k=_===void 0?0:_,D=Ti(typeof k!="number"?k:ki(k,et)),q=E===Vt?Qo:Vt,B=i.rects.popper,S=i.elements[C?q:E],R=ts(_e(S)?S:S.contextElement||he(i.elements.popper),l,p,o),x=Ae(i.elements.reference),P=xi({reference:x,element:B,strategy:"absolute",placement:n}),N=Wt(Object.assign({},B,P)),U=E===Vt?N:x,X={top:R.top-U.top+D.top,bottom:U.bottom-R.bottom+D.bottom,left:R.left-U.left+D.left,right:U.right-R.right+D.right},z=i.modifiersData.offset;if(E===Vt&&z){var Y=z[n];Object.keys(X).forEach(function(W){var ye=[te,ie].indexOf(W)>=0?1:-1,xe=[J,ie].indexOf(W)>=0?"y":"x";X[W]+=Y[xe]*ye})}return X}function is(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,d=l===void 0?Cr:l,p=Se(r),m=p?a?Zn:Zn.filter(function(C){return Se(C)===p}):et,E=m.filter(function(C){return d.indexOf(C)>=0});E.length===0&&(E=m);var v=E.reduce(function(C,_){return C[_]=Oe(i,{placement:_,boundary:n,rootBoundary:s,padding:o})[ae(_)],C},{});return Object.keys(v).sort(function(C,_){return v[C]-v[_]})}function Eu(i){if(ae(i)===xr)return[];var e=Ut(i);return[Or(i),e,Or(e)]}function _u(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,d=t.padding,p=t.boundary,m=t.rootBoundary,E=t.altBoundary,v=t.flipVariations,C=v===void 0?!0:v,_=t.allowedAutoPlacements,k=e.options.placement,D=ae(k),q=D===k,B=l||(q||!C?[Ut(k)]:Eu(k)),S=[k].concat(B).reduce(function(ce,H){return ce.concat(ae(H)===xr?is(e,{placement:H,boundary:p,rootBoundary:m,padding:d,flipVariations:C,allowedAutoPlacements:_}):H)},[]),R=e.rects.reference,x=e.rects.popper,P=new Map,N=!0,U=S[0],X=0;X<S.length;X++){var z=S[X],Y=ae(z),W=Se(z)===Xe,ye=[J,ie].indexOf(Y)>=0,xe=ye?"width":"height",u=Oe(e,{placement:z,boundary:p,rootBoundary:m,altBoundary:E,padding:d}),h=ye?W?te:ee:W?ie:J;R[xe]>x[xe]&&(h=Ut(h));var f=Ut(h),y=[];if(s&&y.push(u[Y]<=0),a&&y.push(u[h]<=0,u[f]<=0),y.every(function(ce){return ce})){U=z,N=!1;break}P.set(z,y)}if(N)for(var w=C?3:1,b=function(H){var V=S.find(function(ne){var de=P.get(ne);if(de)return de.slice(0,H).every(function(Le){return Le})});if(V)return U=V,"break"},O=w;O>0;O--){var M=b(O);if(M==="break")break}e.placement!==U&&(e.modifiersData[r]._skip=!0,e.placement=U,e.reset=!0)}}var la={name:"flip",enabled:!0,phase:"main",fn:_u,requiresIfExists:["offset"],data:{_skip:!1}};function ca(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function ua(i){return[J,te,ie,ee].some(function(e){return i[e]>=0})}function Au(i){var e=i.state,t=i.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=Oe(e,{elementContext:"reference"}),a=Oe(e,{altBoundary:!0}),l=ca(o,r),d=ca(a,n,s),p=ua(l),m=ua(d);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:p,hasPopperEscaped:m},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":m})}var ha={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Au};function Su(i,e,t){var r=ae(i),n=[ee,J].indexOf(r)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[ee,te].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Tu(i){var e=i.state,t=i.options,r=i.name,n=t.offset,s=n===void 0?[0,0]:n,o=Cr.reduce(function(p,m){return p[m]=Su(m,e.rects,s),p},{}),a=o[e.placement],l=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=o}var da={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Tu};function ku(i){var e=i.state,t=i.name;e.modifiersData[t]=xi({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var pa={name:"popperOffsets",enabled:!0,phase:"read",fn:ku,data:{}};function rs(i){return i==="x"?"y":"x"}function xu(i){var e=i.state,t=i.options,r=i.name,n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,d=t.rootBoundary,p=t.altBoundary,m=t.padding,E=t.tether,v=E===void 0?!0:E,C=t.tetherOffset,_=C===void 0?0:C,k=Oe(e,{boundary:l,rootBoundary:d,padding:m,altBoundary:p}),D=ae(e.placement),q=Se(e.placement),B=!q,S=ft(D),R=rs(S),x=e.modifiersData.popperOffsets,P=e.rects.reference,N=e.rects.popper,U=typeof _=="function"?_(Object.assign({},e.rects,{placement:e.placement})):_,X=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),z=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,Y={x:0,y:0};if(x){if(s){var W,ye=S==="y"?J:ee,xe=S==="y"?ie:te,u=S==="y"?"height":"width",h=x[S],f=h+k[ye],y=h-k[xe],w=v?-N[u]/2:0,b=q===Xe?P[u]:N[u],O=q===Xe?-N[u]:-P[u],M=e.elements.arrow,ce=v&&M?pt(M):{width:0,height:0},H=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Si(),V=H[ye],ne=H[xe],de=mt(0,P[u],ce[u]),Le=B?P[u]/2-w-de-V-X.mainAxis:b-de-V-X.mainAxis,Ct=B?-P[u]/2+w+de+ne+X.mainAxis:O+de+ne+X.mainAxis,It=e.elements.arrow&&Ie(e.elements.arrow),Je=It?S==="y"?It.clientTop||0:It.clientLeft||0:0,Ot=(W=z?.[S])!=null?W:0,ze=h+Le-Ot-Je,fi=h+Ct-Ot,Rt=mt(v?dt(f,ze):f,h,v?Ce(y,fi):y);x[S]=Rt,Y[S]=Rt-h}if(a){var Ve,Mt=S==="x"?J:ee,Pt=S==="x"?ie:te,Fe=x[R],ct=R==="y"?"height":"width",Ui=Fe+k[Mt],Dt=Fe-k[Pt],$e=[J,ee].indexOf(D)!==-1,je=(Ve=z?.[R])!=null?Ve:0,Ue=$e?Ui:Fe-P[ct]-N[ct]-je+X.altAxis,mi=$e?Fe+P[ct]+N[ct]-je-X.altAxis:Dt,gi=v&&$e?ia(Ue,Fe,mi):mt(v?Ue:Ui,Fe,v?mi:Dt);x[R]=gi,Y[R]=gi-Fe}e.modifiersData[r]=Y}}var fa={name:"preventOverflow",enabled:!0,phase:"main",fn:xu,requiresIfExists:["offset"]};function ns(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function ss(i){return i===G(i)||!re(i)?gt(i):ns(i)}function Lu(i){var e=i.getBoundingClientRect(),t=Ye(e.width)/i.offsetWidth||1,r=Ye(e.height)/i.offsetHeight||1;return t!==1||r!==1}function os(i,e,t){t===void 0&&(t=!1);var r=re(e),n=re(e)&&Lu(e),s=he(e),o=Ae(i,n,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!t)&&((oe(e)!=="body"||bt(s))&&(a=ss(e)),re(e)?(l=Ae(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=vt(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Cu(i){var e=new Map,t=new Set,r=[];i.forEach(function(s){e.set(s.name,s)});function n(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&n(l)}}),r.push(s)}return i.forEach(function(s){t.has(s.name)||n(s)}),r}function as(i){var e=Cu(i);return Jo.reduce(function(t,r){return t.concat(e.filter(function(n){return n.phase===r}))},[])}function ls(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function cs(i){var e=i.reduce(function(t,r){var n=t[r.name];return t[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var ma={placement:"bottom",modifiers:[],strategy:"absolute"};function ga(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function va(i){i===void 0&&(i={});var e=i,t=e.defaultModifiers,r=t===void 0?[]:t,n=e.defaultOptions,s=n===void 0?ma:n;return function(a,l,d){d===void 0&&(d=s);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},ma,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},m=[],E=!1,v={state:p,setOptions:function(D){var q=typeof D=="function"?D(p.options):D;_(),p.options=Object.assign({},s,p.options,q),p.scrollParents={reference:_e(a)?tt(a):a.contextElement?tt(a.contextElement):[],popper:tt(l)};var B=as(cs([].concat(r,p.options.modifiers)));return p.orderedModifiers=B.filter(function(S){return S.enabled}),C(),v.update()},forceUpdate:function(){if(!E){var D=p.elements,q=D.reference,B=D.popper;if(ga(q,B)){p.rects={reference:os(q,Ie(B),p.options.strategy==="fixed"),popper:pt(B)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(X){return p.modifiersData[X.name]=Object.assign({},X.data)});for(var S=0;S<p.orderedModifiers.length;S++){if(p.reset===!0){p.reset=!1,S=-1;continue}var R=p.orderedModifiers[S],x=R.fn,P=R.options,N=P===void 0?{}:P,U=R.name;typeof x=="function"&&(p=x({state:p,options:N,name:U,instance:v})||p)}}}},update:ls(function(){return new Promise(function(k){v.forceUpdate(),k(p)})}),destroy:function(){_(),E=!0}};if(!ga(a,l))return v;v.setOptions(d).then(function(k){!E&&d.onFirstUpdate&&d.onFirstUpdate(k)});function C(){p.orderedModifiers.forEach(function(k){var D=k.name,q=k.options,B=q===void 0?{}:q,S=k.effect;if(typeof S=="function"){var R=S({state:p,name:D,instance:v,options:B}),x=function(){};m.push(R||x)}})}function _(){m.forEach(function(k){return k()}),m=[]}return v}}var Iu=[oa,pa,sa,ea,da,la,fa,ra,ha],yt=va({defaultModifiers:Iu});var it=function(){return it=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},it.apply(this,arguments)},Mr=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,s;r<n;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))},rt={placement:"bottom",triggerType:"click",offsetSkidding:0,offsetDistance:10,delay:300,ignoreClickOutsideClass:!1,onShow:function(){},onHide:function(){},onToggle:function(){}},Ou={id:null,override:!0},us=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=rt),n===void 0&&(n=Ou),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=it(it({},rt),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Dropdown",this,this._instanceId,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._popperInstance=this._createPopperInstance(),this._setupEventListeners(),this._initialized=!0)},i.prototype.destroy=function(){var e=this,t=this._getTriggerEvents();this._options.triggerType==="click"&&t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._clickHandler)}),this._options.triggerType==="hover"&&(t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hoverShowTriggerElHandler),e._targetEl.removeEventListener(r,e._hoverShowTargetElHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hoverHideHandler),e._targetEl.removeEventListener(r,e._hoverHideHandler)})),this._popperInstance.destroy(),this._initialized=!1},i.prototype.removeInstance=function(){I.removeInstance("Dropdown",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var e=this,t=this._getTriggerEvents();this._clickHandler=function(){e.toggle()},this._options.triggerType==="click"&&t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._clickHandler)}),this._hoverShowTriggerElHandler=function(r){r.type==="click"?e.toggle():setTimeout(function(){e.show()},e._options.delay)},this._hoverShowTargetElHandler=function(){e.show()},this._hoverHideHandler=function(){setTimeout(function(){e._targetEl.matches(":hover")||e.hide()},e._options.delay)},this._options.triggerType==="hover"&&(t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hoverShowTriggerElHandler),e._targetEl.addEventListener(r,e._hoverShowTargetElHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hoverHideHandler),e._targetEl.addEventListener(r,e._hoverHideHandler)}))},i.prototype._createPopperInstance=function(){return yt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[this._options.offsetSkidding,this._options.offsetDistance]}}]})},i.prototype._setupClickOutsideListener=function(){var e=this;this._clickOutsideEventListener=function(t){e._handleClickOutside(t,e._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(e,t){var r=e.target,n=this._options.ignoreClickOutsideClass,s=!1;if(n){var o=document.querySelectorAll(".".concat(n));o.forEach(function(a){if(a.contains(r)){s=!0;return}})}r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&!s&&this.isVisible()&&this.hide()},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","click"],hideEvents:["mouseleave"]};case"click":return{showEvents:["click"],hideEvents:[]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["click"],hideEvents:[]}}},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show(),this._options.onToggle(this)},i.prototype.isVisible=function(){return this._visible},i.prototype.show=function(){this._targetEl.classList.remove("hidden"),this._targetEl.classList.add("block"),this._popperInstance.setOptions(function(e){return it(it({},e),{modifiers:Mr(Mr([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("block"),this._targetEl.classList.add("hidden"),this._popperInstance.setOptions(function(e){return it(it({},e),{modifiers:Mr(Mr([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._visible=!1,this._removeClickOutsideListener(),this._options.onHide(this)},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Kt(){document.querySelectorAll("[data-dropdown-toggle]").forEach(function(i){var e=i.getAttribute("data-dropdown-toggle"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-dropdown-placement"),n=i.getAttribute("data-dropdown-offset-skidding"),s=i.getAttribute("data-dropdown-offset-distance"),o=i.getAttribute("data-dropdown-trigger"),a=i.getAttribute("data-dropdown-delay"),l=i.getAttribute("data-dropdown-ignore-click-outside-class");new us(t,i,{placement:r||rt.placement,triggerType:o||rt.triggerType,offsetSkidding:n?parseInt(n):rt.offsetSkidding,offsetDistance:s?parseInt(s):rt.offsetDistance,delay:a?parseInt(a):rt.delay,ignoreClickOutsideClass:l||rt.ignoreClickOutsideClass})}else console.error('The dropdown element with id "'.concat(e,'" does not exist. Please check the data-dropdown-toggle attribute.'))})}typeof window<"u"&&(window.Dropdown=us,window.initDropdowns=Kt);var hs=us;var Pr=function(){return Pr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Pr.apply(this,arguments)},Dr={placement:"center",backdropClasses:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-40",backdrop:"dynamic",closable:!0,onHide:function(){},onShow:function(){},onToggle:function(){}},Ru={id:null,override:!0},ba=function(){function i(e,t,r){e===void 0&&(e=null),t===void 0&&(t=Dr),r===void 0&&(r=Ru),this._eventListenerInstances=[],this._instanceId=r.id?r.id:e.id,this._targetEl=e,this._options=Pr(Pr({},Dr),t),this._isHidden=!0,this._backdropEl=null,this._initialized=!1,this.init(),I.addInstance("Modal",this,this._instanceId,r.override)}return i.prototype.init=function(){var e=this;this._targetEl&&!this._initialized&&(this._getPlacementClasses().map(function(t){e._targetEl.classList.add(t)}),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this.removeAllEventListenerInstances(),this._destroyBackdropEl(),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Modal",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._createBackdrop=function(){var e;if(this._isHidden){var t=document.createElement("div");t.setAttribute("modal-backdrop",""),(e=t.classList).add.apply(e,this._options.backdropClasses.split(" ")),document.querySelector("body").append(t),this._backdropEl=t}},i.prototype._destroyBackdropEl=function(){this._isHidden||document.querySelector("[modal-backdrop]").remove()},i.prototype._setupModalCloseEventListeners=function(){var e=this;this._options.backdrop==="dynamic"&&(this._clickOutsideEventListener=function(t){e._handleOutsideClick(t.target)},this._targetEl.addEventListener("click",this._clickOutsideEventListener,!0)),this._keydownEventListener=function(t){t.key==="Escape"&&e.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeModalCloseEventListeners=function(){this._options.backdrop==="dynamic"&&this._targetEl.removeEventListener("click",this._clickOutsideEventListener,!0),document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._handleOutsideClick=function(e){(e===this._targetEl||e===this._backdropEl&&this.isVisible())&&this.hide()},i.prototype._getPlacementClasses=function(){switch(this._options.placement){case"top-left":return["justify-start","items-start"];case"top-center":return["justify-center","items-start"];case"top-right":return["justify-end","items-start"];case"center-left":return["justify-start","items-center"];case"center":return["justify-center","items-center"];case"center-right":return["justify-end","items-center"];case"bottom-left":return["justify-start","items-end"];case"bottom-center":return["justify-center","items-end"];case"bottom-right":return["justify-end","items-end"];default:return["justify-center","items-center"]}},i.prototype.toggle=function(){this._isHidden?this.show():this.hide(),this._options.onToggle(this)},i.prototype.show=function(){this.isHidden&&(this._targetEl.classList.add("flex"),this._targetEl.classList.remove("hidden"),this._targetEl.setAttribute("aria-modal","true"),this._targetEl.setAttribute("role","dialog"),this._targetEl.removeAttribute("aria-hidden"),this._createBackdrop(),this._isHidden=!1,this._options.closable&&this._setupModalCloseEventListeners(),document.body.classList.add("overflow-hidden"),this._options.onShow(this))},i.prototype.hide=function(){this.isVisible&&(this._targetEl.classList.add("hidden"),this._targetEl.classList.remove("flex"),this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.removeAttribute("aria-modal"),this._targetEl.removeAttribute("role"),this._destroyBackdropEl(),this._isHidden=!0,document.body.classList.remove("overflow-hidden"),this._options.closable&&this._removeModalCloseEventListeners(),this._options.onHide(this))},i.prototype.isVisible=function(){return!this._isHidden},i.prototype.isHidden=function(){return this._isHidden},i.prototype.addEventListenerInstance=function(e,t,r){this._eventListenerInstances.push({element:e,type:t,handler:r})},i.prototype.removeAllEventListenerInstances=function(){this._eventListenerInstances.map(function(e){e.element.removeEventListener(e.type,e.handler)}),this._eventListenerInstances=[]},i.prototype.getAllEventListenerInstances=function(){return this._eventListenerInstances},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Gt(){document.querySelectorAll("[data-modal-target]").forEach(function(i){var e=i.getAttribute("data-modal-target"),t=document.getElementById(e);if(t){var r=t.getAttribute("data-modal-placement"),n=t.getAttribute("data-modal-backdrop");new ba(t,{placement:r||Dr.placement,backdrop:n||Dr.backdrop})}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?."))}),document.querySelectorAll("[data-modal-toggle]").forEach(function(i){var e=i.getAttribute("data-modal-toggle"),t=document.getElementById(e);if(t){var r=I.getInstance("Modal",e);if(r){var n=function(){r.toggle()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(e," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?"))}),document.querySelectorAll("[data-modal-show]").forEach(function(i){var e=i.getAttribute("data-modal-show"),t=document.getElementById(e);if(t){var r=I.getInstance("Modal",e);if(r){var n=function(){r.show()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(e," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?"))}),document.querySelectorAll("[data-modal-hide]").forEach(function(i){var e=i.getAttribute("data-modal-hide"),t=document.getElementById(e);if(t){var r=I.getInstance("Modal",e);if(r){var n=function(){r.hide()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(e," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?"))})}typeof window<"u"&&(window.Modal=ba,window.initModals=Gt);var Fr=function(){return Fr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Fr.apply(this,arguments)},wt={placement:"left",bodyScrolling:!1,backdrop:!0,edge:!1,edgeOffset:"bottom-[60px]",backdropClasses:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-30",onShow:function(){},onHide:function(){},onToggle:function(){}},Mu={id:null,override:!0},ya=function(){function i(e,t,r){e===void 0&&(e=null),t===void 0&&(t=wt),r===void 0&&(r=Mu),this._eventListenerInstances=[],this._instanceId=r.id?r.id:e.id,this._targetEl=e,this._options=Fr(Fr({},wt),t),this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Drawer",this,this._instanceId,r.override)}return i.prototype.init=function(){var e=this;this._targetEl&&!this._initialized&&(this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.classList.add("transition-transform"),this._getPlacementClasses(this._options.placement).base.map(function(t){e._targetEl.classList.add(t)}),this._handleEscapeKey=function(t){t.key==="Escape"&&e.isVisible()&&e.hide()},document.addEventListener("keydown",this._handleEscapeKey),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this.removeAllEventListenerInstances(),this._destroyBackdropEl(),document.removeEventListener("keydown",this._handleEscapeKey),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Drawer",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){var e=this;this._options.edge?(this._getPlacementClasses(this._options.placement+"-edge").active.map(function(t){e._targetEl.classList.remove(t)}),this._getPlacementClasses(this._options.placement+"-edge").inactive.map(function(t){e._targetEl.classList.add(t)})):(this._getPlacementClasses(this._options.placement).active.map(function(t){e._targetEl.classList.remove(t)}),this._getPlacementClasses(this._options.placement).inactive.map(function(t){e._targetEl.classList.add(t)})),this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.removeAttribute("aria-modal"),this._targetEl.removeAttribute("role"),this._options.bodyScrolling||document.body.classList.remove("overflow-hidden"),this._options.backdrop&&this._destroyBackdropEl(),this._visible=!1,this._options.onHide(this)},i.prototype.show=function(){var e=this;this._options.edge?(this._getPlacementClasses(this._options.placement+"-edge").active.map(function(t){e._targetEl.classList.add(t)}),this._getPlacementClasses(this._options.placement+"-edge").inactive.map(function(t){e._targetEl.classList.remove(t)})):(this._getPlacementClasses(this._options.placement).active.map(function(t){e._targetEl.classList.add(t)}),this._getPlacementClasses(this._options.placement).inactive.map(function(t){e._targetEl.classList.remove(t)})),this._targetEl.setAttribute("aria-modal","true"),this._targetEl.setAttribute("role","dialog"),this._targetEl.removeAttribute("aria-hidden"),this._options.bodyScrolling||document.body.classList.add("overflow-hidden"),this._options.backdrop&&this._createBackdrop(),this._visible=!0,this._options.onShow(this)},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show()},i.prototype._createBackdrop=function(){var e,t=this;if(!this._visible){var r=document.createElement("div");r.setAttribute("drawer-backdrop",""),(e=r.classList).add.apply(e,this._options.backdropClasses.split(" ")),document.querySelector("body").append(r),r.addEventListener("click",function(){t.hide()})}},i.prototype._destroyBackdropEl=function(){this._visible&&document.querySelector("[drawer-backdrop]")!==null&&document.querySelector("[drawer-backdrop]").remove()},i.prototype._getPlacementClasses=function(e){switch(e){case"top":return{base:["top-0","left-0","right-0"],active:["transform-none"],inactive:["-translate-y-full"]};case"right":return{base:["right-0","top-0"],active:["transform-none"],inactive:["translate-x-full"]};case"bottom":return{base:["bottom-0","left-0","right-0"],active:["transform-none"],inactive:["translate-y-full"]};case"left":return{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]};case"bottom-edge":return{base:["left-0","top-0"],active:["transform-none"],inactive:["translate-y-full",this._options.edgeOffset]};default:return{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]}}},i.prototype.isHidden=function(){return!this._visible},i.prototype.isVisible=function(){return this._visible},i.prototype.addEventListenerInstance=function(e,t,r){this._eventListenerInstances.push({element:e,type:t,handler:r})},i.prototype.removeAllEventListenerInstances=function(){this._eventListenerInstances.map(function(e){e.element.removeEventListener(e.type,e.handler)}),this._eventListenerInstances=[]},i.prototype.getAllEventListenerInstances=function(){return this._eventListenerInstances},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Xt(){document.querySelectorAll("[data-drawer-target]").forEach(function(i){var e=i.getAttribute("data-drawer-target"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-drawer-placement"),n=i.getAttribute("data-drawer-body-scrolling"),s=i.getAttribute("data-drawer-backdrop"),o=i.getAttribute("data-drawer-edge"),a=i.getAttribute("data-drawer-edge-offset");new ya(t,{placement:r||wt.placement,bodyScrolling:n?n==="true":wt.bodyScrolling,backdrop:s?s==="true":wt.backdrop,edge:o?o==="true":wt.edge,edgeOffset:a||wt.edgeOffset})}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))}),document.querySelectorAll("[data-drawer-toggle]").forEach(function(i){var e=i.getAttribute("data-drawer-toggle"),t=document.getElementById(e);if(t){var r=I.getInstance("Drawer",e);if(r){var n=function(){r.toggle()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(e," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))}),document.querySelectorAll("[data-drawer-dismiss], [data-drawer-hide]").forEach(function(i){var e=i.getAttribute("data-drawer-dismiss")?i.getAttribute("data-drawer-dismiss"):i.getAttribute("data-drawer-hide"),t=document.getElementById(e);if(t){var r=I.getInstance("Drawer",e);if(r){var n=function(){r.hide()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(e," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id"))}),document.querySelectorAll("[data-drawer-show]").forEach(function(i){var e=i.getAttribute("data-drawer-show"),t=document.getElementById(e);if(t){var r=I.getInstance("Drawer",e);if(r){var n=function(){r.show()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(e," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))})}typeof window<"u"&&(window.Drawer=ya,window.initDrawers=Xt);var Br=function(){return Br=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Br.apply(this,arguments)},Nr={defaultTabId:null,activeClasses:"text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500",inactiveClasses:"dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300",onShow:function(){}},Pu={id:null,override:!0},wa=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=Nr),n===void 0&&(n=Pu),this._instanceId=n.id?n.id:e.id,this._tabsEl=e,this._items=t,this._activeTab=r?this.getTab(r.defaultTabId):null,this._options=Br(Br({},Nr),r),this._initialized=!1,this.init(),I.addInstance("Tabs",this,this._tabsEl.id,!0),I.addInstance("Tabs",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._items.length&&!this._initialized&&(this._activeTab||this.setActiveTab(this._items[0]),this.show(this._activeTab.id,!0),this._items.map(function(t){t.triggerEl.addEventListener("click",function(r){r.preventDefault(),e.show(t.id)})}))},i.prototype.destroy=function(){this._initialized&&(this._initialized=!1)},i.prototype.removeInstance=function(){this.destroy(),I.removeInstance("Tabs",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getActiveTab=function(){return this._activeTab},i.prototype.setActiveTab=function(e){this._activeTab=e},i.prototype.getTab=function(e){return this._items.filter(function(t){return t.id===e})[0]},i.prototype.show=function(e,t){var r,n,s=this;t===void 0&&(t=!1);var o=this.getTab(e);o===this._activeTab&&!t||(this._items.map(function(a){var l,d;a!==o&&((l=a.triggerEl.classList).remove.apply(l,s._options.activeClasses.split(" ")),(d=a.triggerEl.classList).add.apply(d,s._options.inactiveClasses.split(" ")),a.targetEl.classList.add("hidden"),a.triggerEl.setAttribute("aria-selected","false"))}),(r=o.triggerEl.classList).add.apply(r,this._options.activeClasses.split(" ")),(n=o.triggerEl.classList).remove.apply(n,this._options.inactiveClasses.split(" ")),o.triggerEl.setAttribute("aria-selected","true"),o.targetEl.classList.remove("hidden"),this.setActiveTab(o),this._options.onShow(this,o))},i.prototype.updateOnShow=function(e){this._options.onShow=e},i}();function Yt(){document.querySelectorAll("[data-tabs-toggle]").forEach(function(i){var e=[],t=i.getAttribute("data-tabs-active-classes"),r=i.getAttribute("data-tabs-inactive-classes"),n=null;i.querySelectorAll('[role="tab"]').forEach(function(s){var o=s.getAttribute("aria-selected")==="true",a={id:s.getAttribute("data-tabs-target"),triggerEl:s,targetEl:document.querySelector(s.getAttribute("data-tabs-target"))};e.push(a),o&&(n=a.id)}),new wa(i,e,{defaultTabId:n,activeClasses:t||Nr.activeClasses,inactiveClasses:r||Nr.inactiveClasses})})}typeof window<"u"&&(window.Tabs=wa,window.initTabs=Yt);var nt=function(){return nt=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},nt.apply(this,arguments)},Hr=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,s;r<n;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))},qr={placement:"top",triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Du={id:null,override:!0},Ea=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=qr),n===void 0&&(n=Du),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=nt(nt({},qr),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Tooltip",this,this._instanceId,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._setupEventListeners(),this._popperInstance=this._createPopperInstance(),this._initialized=!0)},i.prototype.destroy=function(){var e=this;if(this._initialized){var t=this._getTriggerEvents();t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hideHandler)}),this._removeKeydownListener(),this._removeClickOutsideListener(),this._popperInstance&&this._popperInstance.destroy(),this._initialized=!1}},i.prototype.removeInstance=function(){I.removeInstance("Tooltip",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var e=this,t=this._getTriggerEvents();this._showHandler=function(){e.show()},this._hideHandler=function(){e.hide()},t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hideHandler)})},i.prototype._createPopperInstance=function(){return yt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[0,8]}}]})},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype._setupKeydownListener=function(){var e=this;this._keydownEventListener=function(t){t.key==="Escape"&&e.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeKeydownListener=function(){document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._setupClickOutsideListener=function(){var e=this;this._clickOutsideEventListener=function(t){e._handleClickOutside(t,e._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(e,t){var r=e.target;r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&this.isVisible()&&this.hide()},i.prototype.isVisible=function(){return this._visible},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show()},i.prototype.show=function(){this._targetEl.classList.remove("opacity-0","invisible"),this._targetEl.classList.add("opacity-100","visible"),this._popperInstance.setOptions(function(e){return nt(nt({},e),{modifiers:Hr(Hr([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._setupKeydownListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("opacity-100","visible"),this._targetEl.classList.add("opacity-0","invisible"),this._popperInstance.setOptions(function(e){return nt(nt({},e),{modifiers:Hr(Hr([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._removeClickOutsideListener(),this._removeKeydownListener(),this._visible=!1,this._options.onHide(this)},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Zt(){document.querySelectorAll("[data-tooltip-target]").forEach(function(i){var e=i.getAttribute("data-tooltip-target"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-tooltip-trigger"),n=i.getAttribute("data-tooltip-placement");new Ea(t,i,{placement:n||qr.placement,triggerType:r||qr.triggerType})}else console.error('The tooltip element with id "'.concat(e,'" does not exist. Please check the data-tooltip-target attribute.'))})}typeof window<"u"&&(window.Tooltip=Ea,window.initTooltips=Zt);var st=function(){return st=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},st.apply(this,arguments)},zr=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,s;r<n;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))},Li={placement:"top",offset:10,triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Fu={id:null,override:!0},_a=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Li),n===void 0&&(n=Fu),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=st(st({},Li),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Popover",this,n.id?n.id:this._targetEl.id,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._setupEventListeners(),this._popperInstance=this._createPopperInstance(),this._initialized=!0)},i.prototype.destroy=function(){var e=this;if(this._initialized){var t=this._getTriggerEvents();t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._showHandler),e._targetEl.removeEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hideHandler),e._targetEl.removeEventListener(r,e._hideHandler)}),this._removeKeydownListener(),this._removeClickOutsideListener(),this._popperInstance&&this._popperInstance.destroy(),this._initialized=!1}},i.prototype.removeInstance=function(){I.removeInstance("Popover",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var e=this,t=this._getTriggerEvents();this._showHandler=function(){e.show()},this._hideHandler=function(){setTimeout(function(){e._targetEl.matches(":hover")||e.hide()},100)},t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._showHandler),e._targetEl.addEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hideHandler),e._targetEl.addEventListener(r,e._hideHandler)})},i.prototype._createPopperInstance=function(){return yt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[0,this._options.offset]}}]})},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype._setupKeydownListener=function(){var e=this;this._keydownEventListener=function(t){t.key==="Escape"&&e.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeKeydownListener=function(){document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._setupClickOutsideListener=function(){var e=this;this._clickOutsideEventListener=function(t){e._handleClickOutside(t,e._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(e,t){var r=e.target;r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&this.isVisible()&&this.hide()},i.prototype.isVisible=function(){return this._visible},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show(),this._options.onToggle(this)},i.prototype.show=function(){this._targetEl.classList.remove("opacity-0","invisible"),this._targetEl.classList.add("opacity-100","visible"),this._popperInstance.setOptions(function(e){return st(st({},e),{modifiers:zr(zr([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._setupKeydownListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("opacity-100","visible"),this._targetEl.classList.add("opacity-0","invisible"),this._popperInstance.setOptions(function(e){return st(st({},e),{modifiers:zr(zr([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._removeClickOutsideListener(),this._removeKeydownListener(),this._visible=!1,this._options.onHide(this)},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Qt(){document.querySelectorAll("[data-popover-target]").forEach(function(i){var e=i.getAttribute("data-popover-target"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-popover-trigger"),n=i.getAttribute("data-popover-placement"),s=i.getAttribute("data-popover-offset");new _a(t,i,{placement:n||Li.placement,offset:s?parseInt(s):Li.offset,triggerType:r||Li.triggerType})}else console.error('The popover element with id "'.concat(e,'" does not exist. Please check the data-popover-target attribute.'))})}typeof window<"u"&&(window.Popover=_a,window.initPopovers=Qt);var Vr=function(){return Vr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Vr.apply(this,arguments)},ds={triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Bu={id:null,override:!0},Aa=function(){function i(e,t,r,n,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=null),n===void 0&&(n=ds),s===void 0&&(s=Bu),this._instanceId=s.id?s.id:r.id,this._parentEl=e,this._triggerEl=t,this._targetEl=r,this._options=Vr(Vr({},ds),n),this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Dial",this,this._instanceId,s.override)}return i.prototype.init=function(){var e=this;if(this._triggerEl&&this._targetEl&&!this._initialized){var t=this._getTriggerEventTypes(this._options.triggerType);this._showEventHandler=function(){e.show()},t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._showEventHandler),e._targetEl.addEventListener(r,e._showEventHandler)}),this._hideEventHandler=function(){e._parentEl.matches(":hover")||e.hide()},t.hideEvents.forEach(function(r){e._parentEl.addEventListener(r,e._hideEventHandler)}),this._initialized=!0}},i.prototype.destroy=function(){var e=this;if(this._initialized){var t=this._getTriggerEventTypes(this._options.triggerType);t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._showEventHandler),e._targetEl.removeEventListener(r,e._showEventHandler)}),t.hideEvents.forEach(function(r){e._parentEl.removeEventListener(r,e._hideEventHandler)}),this._initialized=!1}},i.prototype.removeInstance=function(){I.removeInstance("Dial",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){this._targetEl.classList.add("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","false"),this._visible=!1,this._options.onHide(this)},i.prototype.show=function(){this._targetEl.classList.remove("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","true"),this._visible=!0,this._options.onShow(this)},i.prototype.toggle=function(){this._visible?this.hide():this.show()},i.prototype.isHidden=function(){return!this._visible},i.prototype.isVisible=function(){return this._visible},i.prototype._getTriggerEventTypes=function(e){switch(e){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Jt(){document.querySelectorAll("[data-dial-init]").forEach(function(i){var e=i.querySelector("[data-dial-toggle]");if(e){var t=e.getAttribute("data-dial-toggle"),r=document.getElementById(t);if(r){var n=e.getAttribute("data-dial-trigger");new Aa(i,e,r,{triggerType:n||ds.triggerType})}else console.error("Dial with id ".concat(t," does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?"))}else console.error("Dial with id ".concat(i.id," does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?"))})}typeof window<"u"&&(window.Dial=Aa,window.initDials=Jt);var $r=function(){return $r=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},$r.apply(this,arguments)},Sa={minValue:null,maxValue:null,onIncrement:function(){},onDecrement:function(){}},Nu={id:null,override:!0},Ta=function(){function i(e,t,r,n,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=null),n===void 0&&(n=Sa),s===void 0&&(s=Nu),this._instanceId=s.id?s.id:e.id,this._targetEl=e,this._incrementEl=t,this._decrementEl=r,this._options=$r($r({},Sa),n),this._initialized=!1,this.init(),I.addInstance("InputCounter",this,this._instanceId,s.override)}return i.prototype.init=function(){var e=this;this._targetEl&&!this._initialized&&(this._inputHandler=function(t){{var r=t.target;/^\d*$/.test(r.value)||(r.value=r.value.replace(/[^\d]/g,"")),e._options.maxValue!==null&&parseInt(r.value)>e._options.maxValue&&(r.value=e._options.maxValue.toString()),e._options.minValue!==null&&parseInt(r.value)<e._options.minValue&&(r.value=e._options.minValue.toString())}},this._incrementClickHandler=function(){e.increment()},this._decrementClickHandler=function(){e.decrement()},this._targetEl.addEventListener("input",this._inputHandler),this._incrementEl&&this._incrementEl.addEventListener("click",this._incrementClickHandler),this._decrementEl&&this._decrementEl.addEventListener("click",this._decrementClickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._targetEl&&this._initialized&&(this._targetEl.removeEventListener("input",this._inputHandler),this._incrementEl&&this._incrementEl.removeEventListener("click",this._incrementClickHandler),this._decrementEl&&this._decrementEl.removeEventListener("click",this._decrementClickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("InputCounter",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getCurrentValue=function(){return parseInt(this._targetEl.value)||0},i.prototype.increment=function(){this._options.maxValue!==null&&this.getCurrentValue()>=this._options.maxValue||(this._targetEl.value=(this.getCurrentValue()+1).toString(),this._options.onIncrement(this))},i.prototype.decrement=function(){this._options.minValue!==null&&this.getCurrentValue()<=this._options.minValue||(this._targetEl.value=(this.getCurrentValue()-1).toString(),this._options.onDecrement(this))},i.prototype.updateOnIncrement=function(e){this._options.onIncrement=e},i.prototype.updateOnDecrement=function(e){this._options.onDecrement=e},i}();function ei(){document.querySelectorAll("[data-input-counter]").forEach(function(i){var e=i.id,t=document.querySelector('[data-input-counter-increment="'+e+'"]'),r=document.querySelector('[data-input-counter-decrement="'+e+'"]'),n=i.getAttribute("data-input-counter-min"),s=i.getAttribute("data-input-counter-max");i?I.instanceExists("InputCounter",i.getAttribute("id"))||new Ta(i,t||null,r||null,{minValue:n?parseInt(n):null,maxValue:s?parseInt(s):null}):console.error('The target element with id "'.concat(e,'" does not exist. Please check the data-input-counter attribute.'))})}typeof window<"u"&&(window.InputCounter=Ta,window.initInputCounters=ei);var jr=function(){return jr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},jr.apply(this,arguments)},Ur={htmlEntities:!1,contentType:"input",onCopy:function(){}},Hu={id:null,override:!0},ka=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Ur),n===void 0&&(n=Hu),this._instanceId=n.id?n.id:t.id,this._triggerEl=e,this._targetEl=t,this._options=jr(jr({},Ur),r),this._initialized=!1,this.init(),I.addInstance("CopyClipboard",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._targetEl&&this._triggerEl&&!this._initialized&&(this._triggerElClickHandler=function(){e.copy()},this._triggerEl&&this._triggerEl.addEventListener("click",this._triggerElClickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._targetEl&&this._initialized&&(this._triggerEl&&this._triggerEl.removeEventListener("click",this._triggerElClickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("CopyClipboard",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getTargetValue=function(){if(this._options.contentType==="input")return this._targetEl.value;if(this._options.contentType==="innerHTML")return this._targetEl.innerHTML;if(this._options.contentType==="textContent")return this._targetEl.textContent.replace(/\s+/g," ").trim()},i.prototype.copy=function(){var e=this.getTargetValue();this._options.htmlEntities&&(e=this.decodeHTML(e));var t=document.createElement("textarea");return t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),this._options.onCopy(this),e},i.prototype.decodeHTML=function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.textContent},i.prototype.updateOnCopyCallback=function(e){this._options.onCopy=e},i}();function ti(){document.querySelectorAll("[data-copy-to-clipboard-target]").forEach(function(i){var e=i.getAttribute("data-copy-to-clipboard-target"),t=document.getElementById(e),r=i.getAttribute("data-copy-to-clipboard-content-type"),n=i.getAttribute("data-copy-to-clipboard-html-entities");t?I.instanceExists("CopyClipboard",t.getAttribute("id"))||new ka(i,t,{htmlEntities:n&&n==="true"?!0:Ur.htmlEntities,contentType:r||Ur.contentType}):console.error('The target element with id "'.concat(e,'" does not exist. Please check the data-copy-to-clipboard-target attribute.'))})}typeof window<"u"&&(window.CopyClipboard=ka,window.initClipboards=ti);function xa(){Nt(),Ht(),qt(),zt(),Kt(),Gt(),Xt(),Yt(),Zt(),Qt(),Jt(),ei(),ti()}typeof window<"u"&&(window.initFlowbite=xa);var qu=new jo("load",[Nt,Ht,qt,zt,Kt,Gt,Xt,Yt,Zt,Qt,Jt,ei,ti]);qu.init();var Wr=class extends T{static targets=["trigger","menu"];connect(){console.log(`resource-drop-down connected: ${this.element}`),this.dropdown=new hs(this.menuTarget,this.triggerTarget)}disconnect(){this.dropdown=null}toggle(){this.dropdown.toggle()}show(){this.dropdown.show()}hide(){this.dropdown.hide()}};var Kr=class extends T{static targets=["trigger","menu"];connect(){console.log(`resource-collapse connected: ${this.element}`),this.collapse=new Yn(this.menuTarget,this.triggerTarget)}disconnect(){this.collapse=null}toggle(){this.collapse.toggle()}show(){this.collapse.show()}hide(){this.collapse.hide()}};var Gr=class extends T{static values={after:Number};connect(){console.log(`resource-dismiss connected: ${this.element}`),this.hasAfterValue&&this.afterValue>0&&(this.autoDismissTimeout=setTimeout(()=>{this.dismiss(),this.autoDismissTimeout=null},this.afterValue))}disconnect(){this.autoDismissTimeout&&clearTimeout(this.autoDismissTimeout),this.autoDismissTimeout=null}dismiss(){this.element.remove()}};var Xr=class extends T{static targets=["frame","refreshButton","backButton","homeButton"];connect(){console.log(`frame-navigator connected: ${this.element}`),this.#e(),this.srcHistory=[],this.originalFrameSrc=this.frameTarget.src,this.hasRefreshButtonTarget&&(this.refreshButtonTarget.style.display="",this.refreshButtonClicked=this.refreshButtonClicked.bind(this),this.refreshButtonTarget.addEventListener("click",this.refreshButtonClicked)),this.hasBackButtonTarget&&(this.backButtonClicked=this.backButtonClicked.bind(this),this.backButtonTarget.addEventListener("click",this.backButtonClicked)),this.hasHomeButtonTarget&&(this.homeButtonClicked=this.homeButtonClicked.bind(this),this.homeButtonTarget.addEventListener("click",this.homeButtonClicked)),this.frameLoaded=this.frameLoaded.bind(this),this.frameTarget.addEventListener("turbo:frame-load",this.frameLoaded),this.frameLoading=this.frameLoading.bind(this),this.frameTarget.addEventListener("turbo:click",this.frameLoading),this.frameTarget.addEventListener("turbo:submit-start",this.frameLoading),this.frameFailed=this.frameFailed.bind(this),this.frameTarget.addEventListener("turbo:fetch-request-error",this.frameFailed)}disconnect(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.removeEventListener("click",this.refreshButtonClicked),this.hasBackButtonTarget&&this.backButtonTarget.removeEventListener("click",this.backButtonClicked),this.hasHomeButtonTarget&&this.homeButtonTarget.removeEventListener("click",this.homeButtonClicked),this.frameTarget.removeEventListener("turbo:frame-load",this.frameLoaded),this.frameTarget.removeEventListener("turbo:click",this.frameLoading),this.frameTarget.removeEventListener("turbo:submit-start",this.frameLoading),this.frameTarget.removeEventListener("turbo:fetch-request-error",this.frameFailed)}frameLoading(i){this.#e()}frameFailed(i){this.#t()}frameLoaded(i){this.#t();let e=i.target.src;e==this.currentSrc||(e==this.originalFrameSrc?this.srcHistory=[e]:this.srcHistory.push(e)),this.#i()}refreshButtonClicked(i){this.frameLoading(null),this.frameTarget.reload()}backButtonClicked(i){this.frameLoading(null),this.srcHistory.pop(),this.frameTarget.src=this.currentSrc}homeButtonClicked(i){this.frameLoading(null),this.frameTarget.src=this.originalFrameSrc}get currentSrc(){return this.srcHistory[this.srcHistory.length-1]}#e(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.add("motion-safe:animate-spin"),this.frameTarget.classList.add("motion-safe:animate-pulse")}#t(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.remove("motion-safe:animate-spin"),this.frameTarget.classList.remove("motion-safe:animate-pulse")}#i(){this.hasHomeButtonTarget&&(this.homeButtonTarget.style.display=this.srcHistory.length>2?"":"none"),this.hasBackButtonTarget&&(this.backButtonTarget.style.display=this.srcHistory.length>1?"":"none")}};var Yr=class extends T{connect(){console.log(`color-mode connected: ${this.element}`),this.updateColorMode()}disconnect(){}updateColorMode(){localStorage.theme==="dark"||!("theme"in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}setLightColorMode(){localStorage.theme="light",this.updateColorMode()}setDarkColorMode(){localStorage.theme="dark",this.updateColorMode()}setSystemColorMode(){localStorage.removeItem("theme"),this.updateColorMode()}};var{entries:Ba,setPrototypeOf:La,isFrozen:zu,getPrototypeOf:Vu,getOwnPropertyDescriptor:$u}=Object,{freeze:ve,seal:Te,create:Na}=Object,{apply:bs,construct:ys}=typeof Reflect<"u"&&Reflect;ve||(ve=function(e){return e});Te||(Te=function(e){return e});bs||(bs=function(e,t,r){return e.apply(t,r)});ys||(ys=function(e,t){return new e(...t)});var Zr=Ee(Array.prototype.forEach),Ca=Ee(Array.prototype.pop),Ci=Ee(Array.prototype.push),Jr=Ee(String.prototype.toLowerCase),ps=Ee(String.prototype.toString),Ia=Ee(String.prototype.match),Ii=Ee(String.prototype.replace),ju=Ee(String.prototype.indexOf),Uu=Ee(String.prototype.trim),Re=Ee(Object.prototype.hasOwnProperty),ge=Ee(RegExp.prototype.test),Oi=Wu(TypeError);function Ee(i){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return bs(i,e,r)}}function Wu(i){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return ys(i,t)}}function F(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Jr;La&&La(i,null);let r=e.length;for(;r--;){let n=e[r];if(typeof n=="string"){let s=t(n);s!==n&&(zu(e)||(e[r]=s),n=s)}i[n]=!0}return i}function Ku(i){for(let e=0;e<i.length;e++)Re(i,e)||(i[e]=null);return i}function Et(i){let e=Na(null);for(let[t,r]of Ba(i))Re(i,t)&&(Array.isArray(r)?e[t]=Ku(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Et(r):e[t]=r);return e}function Ri(i,e){for(;i!==null;){let r=$u(i,e);if(r){if(r.get)return Ee(r.get);if(typeof r.value=="function")return Ee(r.value)}i=Vu(i)}function t(){return null}return t}var Oa=ve(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),fs=ve(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ms=ve(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Gu=ve(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),gs=ve(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Xu=ve(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ra=ve(["#text"]),Ma=ve(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),vs=ve(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Pa=ve(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Qr=ve(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Yu=Te(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Zu=Te(/<%[\w\W]*|[\w\W]*%>/gm),Qu=Te(/\${[\w\W]*}/gm),Ju=Te(/^data-[\-\w.\u00B7-\uFFFF]/),eh=Te(/^aria-[\-\w]+$/),Ha=Te(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),th=Te(/^(?:\w+script|data):/i),ih=Te(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qa=Te(/^html$/i),rh=Te(/^[a-z][.\w]*(-[.\w]+)+$/i),Da=Object.freeze({__proto__:null,ARIA_ATTR:eh,ATTR_WHITESPACE:ih,CUSTOM_ELEMENT:rh,DATA_ATTR:Ju,DOCTYPE_NAME:qa,ERB_EXPR:Zu,IS_ALLOWED_URI:Ha,IS_SCRIPT_OR_DATA:th,MUSTACHE_EXPR:Yu,TMPLIT_EXPR:Qu}),Mi={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},nh=function(){return typeof window>"u"?null:window},sh=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));let s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Fa=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function za(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:nh(),e=L=>za(L);if(e.version="3.2.2",e.removed=[],!i||!i.document||i.document.nodeType!==Mi.document)return e.isSupported=!1,e;let{document:t}=i,r=t,n=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:d,NamedNodeMap:p=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:m,DOMParser:E,trustedTypes:v}=i,C=l.prototype,_=Ri(C,"cloneNode"),k=Ri(C,"remove"),D=Ri(C,"nextSibling"),q=Ri(C,"childNodes"),B=Ri(C,"parentNode");if(typeof o=="function"){let L=t.createElement("template");L.content&&L.content.ownerDocument&&(t=L.content.ownerDocument)}let S,R="",{implementation:x,createNodeIterator:P,createDocumentFragment:N,getElementsByTagName:U}=t,{importNode:X}=r,z=Fa();e.isSupported=typeof Ba=="function"&&typeof B=="function"&&x&&x.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Y,ERB_EXPR:W,TMPLIT_EXPR:ye,DATA_ATTR:xe,ARIA_ATTR:u,IS_SCRIPT_OR_DATA:h,ATTR_WHITESPACE:f,CUSTOM_ELEMENT:y}=Da,{IS_ALLOWED_URI:w}=Da,b=null,O=F({},[...Oa,...fs,...ms,...gs,...Ra]),M=null,ce=F({},[...Ma,...vs,...Pa,...Qr]),H=Object.seal(Na(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),V=null,ne=null,de=!0,Le=!0,Ct=!1,It=!0,Je=!1,Ot=!0,ze=!1,fi=!1,Rt=!1,Ve=!1,Mt=!1,Pt=!1,Fe=!0,ct=!1,Ui="user-content-",Dt=!0,$e=!1,je={},Ue=null,mi=F({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),gi=null,uo=F({},["audio","video","img","source","image","track"]),wn=null,ho=F({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Wi="http://www.w3.org/1998/Math/MathML",Ki="http://www.w3.org/2000/svg",We="http://www.w3.org/1999/xhtml",Ft=We,En=!1,_n=null,Tl=F({},[Wi,Ki,We],ps),Gi=F({},["mi","mo","mn","ms","mtext"]),Xi=F({},["annotation-xml"]),kl=F({},["title","style","font","a","script"]),vi=null,xl=["application/xhtml+xml","text/html"],Ll="text/html",se=null,Bt=null,Cl=t.createElement("form"),po=function(c){return c instanceof RegExp||c instanceof Function},An=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Bt&&Bt===c)){if((!c||typeof c!="object")&&(c={}),c=Et(c),vi=xl.indexOf(c.PARSER_MEDIA_TYPE)===-1?Ll:c.PARSER_MEDIA_TYPE,se=vi==="application/xhtml+xml"?ps:Jr,b=Re(c,"ALLOWED_TAGS")?F({},c.ALLOWED_TAGS,se):O,M=Re(c,"ALLOWED_ATTR")?F({},c.ALLOWED_ATTR,se):ce,_n=Re(c,"ALLOWED_NAMESPACES")?F({},c.ALLOWED_NAMESPACES,ps):Tl,wn=Re(c,"ADD_URI_SAFE_ATTR")?F(Et(ho),c.ADD_URI_SAFE_ATTR,se):ho,gi=Re(c,"ADD_DATA_URI_TAGS")?F(Et(uo),c.ADD_DATA_URI_TAGS,se):uo,Ue=Re(c,"FORBID_CONTENTS")?F({},c.FORBID_CONTENTS,se):mi,V=Re(c,"FORBID_TAGS")?F({},c.FORBID_TAGS,se):{},ne=Re(c,"FORBID_ATTR")?F({},c.FORBID_ATTR,se):{},je=Re(c,"USE_PROFILES")?c.USE_PROFILES:!1,de=c.ALLOW_ARIA_ATTR!==!1,Le=c.ALLOW_DATA_ATTR!==!1,Ct=c.ALLOW_UNKNOWN_PROTOCOLS||!1,It=c.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Je=c.SAFE_FOR_TEMPLATES||!1,Ot=c.SAFE_FOR_XML!==!1,ze=c.WHOLE_DOCUMENT||!1,Ve=c.RETURN_DOM||!1,Mt=c.RETURN_DOM_FRAGMENT||!1,Pt=c.RETURN_TRUSTED_TYPE||!1,Rt=c.FORCE_BODY||!1,Fe=c.SANITIZE_DOM!==!1,ct=c.SANITIZE_NAMED_PROPS||!1,Dt=c.KEEP_CONTENT!==!1,$e=c.IN_PLACE||!1,w=c.ALLOWED_URI_REGEXP||Ha,Ft=c.NAMESPACE||We,Gi=c.MATHML_TEXT_INTEGRATION_POINTS||Gi,Xi=c.HTML_INTEGRATION_POINTS||Xi,H=c.CUSTOM_ELEMENT_HANDLING||{},c.CUSTOM_ELEMENT_HANDLING&&po(c.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=c.CUSTOM_ELEMENT_HANDLING.tagNameCheck),c.CUSTOM_ELEMENT_HANDLING&&po(c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),c.CUSTOM_ELEMENT_HANDLING&&typeof c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(H.allowCustomizedBuiltInElements=c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Je&&(Le=!1),Mt&&(Ve=!0),je&&(b=F({},Ra),M=[],je.html===!0&&(F(b,Oa),F(M,Ma)),je.svg===!0&&(F(b,fs),F(M,vs),F(M,Qr)),je.svgFilters===!0&&(F(b,ms),F(M,vs),F(M,Qr)),je.mathMl===!0&&(F(b,gs),F(M,Pa),F(M,Qr))),c.ADD_TAGS&&(b===O&&(b=Et(b)),F(b,c.ADD_TAGS,se)),c.ADD_ATTR&&(M===ce&&(M=Et(M)),F(M,c.ADD_ATTR,se)),c.ADD_URI_SAFE_ATTR&&F(wn,c.ADD_URI_SAFE_ATTR,se),c.FORBID_CONTENTS&&(Ue===mi&&(Ue=Et(Ue)),F(Ue,c.FORBID_CONTENTS,se)),Dt&&(b["#text"]=!0),ze&&F(b,["html","head","body"]),b.table&&(F(b,["tbody"]),delete V.tbody),c.TRUSTED_TYPES_POLICY){if(typeof c.TRUSTED_TYPES_POLICY.createHTML!="function")throw Oi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof c.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Oi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=c.TRUSTED_TYPES_POLICY,R=S.createHTML("")}else S===void 0&&(S=sh(v,n)),S!==null&&typeof R=="string"&&(R=S.createHTML(""));ve&&ve(c),Bt=c}},fo=F({},[...fs,...ms,...Gu]),mo=F({},[...gs,...Xu]),Il=function(c){let g=B(c);(!g||!g.tagName)&&(g={namespaceURI:Ft,tagName:"template"});let A=Jr(c.tagName),K=Jr(g.tagName);return _n[c.namespaceURI]?c.namespaceURI===Ki?g.namespaceURI===We?A==="svg":g.namespaceURI===Wi?A==="svg"&&(K==="annotation-xml"||Gi[K]):!!fo[A]:c.namespaceURI===Wi?g.namespaceURI===We?A==="math":g.namespaceURI===Ki?A==="math"&&Xi[K]:!!mo[A]:c.namespaceURI===We?g.namespaceURI===Ki&&!Xi[K]||g.namespaceURI===Wi&&!Gi[K]?!1:!mo[A]&&(kl[A]||!fo[A]):!!(vi==="application/xhtml+xml"&&_n[c.namespaceURI]):!1},Be=function(c){Ci(e.removed,{element:c});try{B(c).removeChild(c)}catch{k(c)}},Yi=function(c,g){try{Ci(e.removed,{attribute:g.getAttributeNode(c),from:g})}catch{Ci(e.removed,{attribute:null,from:g})}if(g.removeAttribute(c),c==="is")if(Ve||Mt)try{Be(g)}catch{}else try{g.setAttribute(c,"")}catch{}},go=function(c){let g=null,A=null;if(Rt)c="<remove></remove>"+c;else{let ue=Ia(c,/^[\r\n\t ]+/);A=ue&&ue[0]}vi==="application/xhtml+xml"&&Ft===We&&(c='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+c+"</body></html>");let K=S?S.createHTML(c):c;if(Ft===We)try{g=new E().parseFromString(K,vi)}catch{}if(!g||!g.documentElement){g=x.createDocument(Ft,"template",null);try{g.documentElement.innerHTML=En?R:K}catch{}}let pe=g.body||g.documentElement;return c&&A&&pe.insertBefore(t.createTextNode(A),pe.childNodes[0]||null),Ft===We?U.call(g,ze?"html":"body")[0]:ze?g.documentElement:pe},vo=function(c){return P.call(c.ownerDocument||c,c,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},bo=function(c){return c instanceof m&&(typeof c.nodeName!="string"||typeof c.textContent!="string"||typeof c.removeChild!="function"||!(c.attributes instanceof p)||typeof c.removeAttribute!="function"||typeof c.setAttribute!="function"||typeof c.namespaceURI!="string"||typeof c.insertBefore!="function"||typeof c.hasChildNodes!="function")},yo=function(c){return typeof a=="function"&&c instanceof a};function Ke(L,c,g){Zr(L,A=>{A.call(e,c,g,Bt)})}let wo=function(c){let g=null;if(Ke(z.beforeSanitizeElements,c,null),bo(c))return Be(c),!0;let A=se(c.nodeName);if(Ke(z.uponSanitizeElement,c,{tagName:A,allowedTags:b}),c.hasChildNodes()&&!yo(c.firstElementChild)&&ge(/<[/\w]/g,c.innerHTML)&&ge(/<[/\w]/g,c.textContent)||c.nodeType===Mi.progressingInstruction||Ot&&c.nodeType===Mi.comment&&ge(/<[/\w]/g,c.data))return Be(c),!0;if(!b[A]||V[A]){if(!V[A]&&_o(A)&&(H.tagNameCheck instanceof RegExp&&ge(H.tagNameCheck,A)||H.tagNameCheck instanceof Function&&H.tagNameCheck(A)))return!1;if(Dt&&!Ue[A]){let K=B(c)||c.parentNode,pe=q(c)||c.childNodes;if(pe&&K){let ue=pe.length;for(let we=ue-1;we>=0;--we){let Ne=_(pe[we],!0);Ne.__removalCount=(c.__removalCount||0)+1,K.insertBefore(Ne,D(c))}}}return Be(c),!0}return c instanceof l&&!Il(c)||(A==="noscript"||A==="noembed"||A==="noframes")&&ge(/<\/no(script|embed|frames)/i,c.innerHTML)?(Be(c),!0):(Je&&c.nodeType===Mi.text&&(g=c.textContent,Zr([Y,W,ye],K=>{g=Ii(g,K," ")}),c.textContent!==g&&(Ci(e.removed,{element:c.cloneNode()}),c.textContent=g)),Ke(z.afterSanitizeElements,c,null),!1)},Eo=function(c,g,A){if(Fe&&(g==="id"||g==="name")&&(A in t||A in Cl))return!1;if(!(Le&&!ne[g]&&ge(xe,g))){if(!(de&&ge(u,g))){if(!M[g]||ne[g]){if(!(_o(c)&&(H.tagNameCheck instanceof RegExp&&ge(H.tagNameCheck,c)||H.tagNameCheck instanceof Function&&H.tagNameCheck(c))&&(H.attributeNameCheck instanceof RegExp&&ge(H.attributeNameCheck,g)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(g))||g==="is"&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&ge(H.tagNameCheck,A)||H.tagNameCheck instanceof Function&&H.tagNameCheck(A))))return!1}else if(!wn[g]){if(!ge(w,Ii(A,f,""))){if(!((g==="src"||g==="xlink:href"||g==="href")&&c!=="script"&&ju(A,"data:")===0&&gi[c])){if(!(Ct&&!ge(h,Ii(A,f,"")))){if(A)return!1}}}}}}return!0},_o=function(c){return c!=="annotation-xml"&&Ia(c,y)},Ao=function(c){Ke(z.beforeSanitizeAttributes,c,null);let{attributes:g}=c;if(!g)return;let A={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0},K=g.length;for(;K--;){let pe=g[K],{name:ue,namespaceURI:we,value:Ne}=pe,bi=se(ue),fe=ue==="value"?Ne:Uu(Ne);if(A.attrName=bi,A.attrValue=fe,A.keepAttr=!0,A.forceKeepAttr=void 0,Ke(z.uponSanitizeAttribute,c,A),fe=A.attrValue,ct&&(bi==="id"||bi==="name")&&(Yi(ue,c),fe=Ui+fe),Ot&&ge(/((--!?|])>)|<\/(style|title)/i,fe)){Yi(ue,c);continue}if(A.forceKeepAttr||(Yi(ue,c),!A.keepAttr))continue;if(!It&&ge(/\/>/i,fe)){Yi(ue,c);continue}Je&&Zr([Y,W,ye],To=>{fe=Ii(fe,To," ")});let So=se(c.nodeName);if(Eo(So,bi,fe)){if(S&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!we)switch(v.getAttributeType(So,bi)){case"TrustedHTML":{fe=S.createHTML(fe);break}case"TrustedScriptURL":{fe=S.createScriptURL(fe);break}}try{we?c.setAttributeNS(we,ue,fe):c.setAttribute(ue,fe),bo(c)?Be(c):Ca(e.removed)}catch{}}}Ke(z.afterSanitizeAttributes,c,null)},Ol=function L(c){let g=null,A=vo(c);for(Ke(z.beforeSanitizeShadowDOM,c,null);g=A.nextNode();)Ke(z.uponSanitizeShadowNode,g,null),!wo(g)&&(g.content instanceof s&&L(g.content),Ao(g));Ke(z.afterSanitizeShadowDOM,c,null)};return e.sanitize=function(L){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=null,A=null,K=null,pe=null;if(En=!L,En&&(L="<!-->"),typeof L!="string"&&!yo(L))if(typeof L.toString=="function"){if(L=L.toString(),typeof L!="string")throw Oi("dirty is not a string, aborting")}else throw Oi("toString is not a function");if(!e.isSupported)return L;if(fi||An(c),e.removed=[],typeof L=="string"&&($e=!1),$e){if(L.nodeName){let Ne=se(L.nodeName);if(!b[Ne]||V[Ne])throw Oi("root node is forbidden and cannot be sanitized in-place")}}else if(L instanceof a)g=go("<!---->"),A=g.ownerDocument.importNode(L,!0),A.nodeType===Mi.element&&A.nodeName==="BODY"||A.nodeName==="HTML"?g=A:g.appendChild(A);else{if(!Ve&&!Je&&!ze&&L.indexOf("<")===-1)return S&&Pt?S.createHTML(L):L;if(g=go(L),!g)return Ve?null:Pt?R:""}g&&Rt&&Be(g.firstChild);let ue=vo($e?L:g);for(;K=ue.nextNode();)wo(K)||(K.content instanceof s&&Ol(K.content),Ao(K));if($e)return L;if(Ve){if(Mt)for(pe=N.call(g.ownerDocument);g.firstChild;)pe.appendChild(g.firstChild);else pe=g;return(M.shadowroot||M.shadowrootmode)&&(pe=X.call(r,pe,!0)),pe}let we=ze?g.outerHTML:g.innerHTML;return ze&&b["!doctype"]&&g.ownerDocument&&g.ownerDocument.doctype&&g.ownerDocument.doctype.name&&ge(qa,g.ownerDocument.doctype.name)&&(we="<!DOCTYPE "+g.ownerDocument.doctype.name+`>
|
6
|
-
`+we),Je&&
|
7
|
-
]`).replace("lheading",
|
5
|
+
%o`,t,e,r),(n=window.onerror)===null||n===void 0||n.call(window,t,"",0,0,e)}logFormattedMessage(e,t,r={}){r=Object.assign({application:this},r),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},r)),this.logger.groupEnd()}};function pc(){return new Promise(i=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>i()):i()})}function fc(i){return Ei(i,"classes").reduce((t,r)=>Object.assign(t,mc(r)),{})}function mc(i){return{[`${i}Class`]:{get(){let{classes:e}=this;if(e.has(i))return e.get(i);{let t=e.getAttributeName(i);throw new Error(`Missing attribute "${t}"`)}}},[`${i}Classes`]:{get(){return this.classes.getAll(i)}},[`has${wi(i)}Class`]:{get(){return this.classes.has(i)}}}}function gc(i){return Ei(i,"outlets").reduce((t,r)=>Object.assign(t,vc(r)),{})}function Io(i,e,t){return i.application.getControllerForElementAndIdentifier(e,t)}function Oo(i,e,t){let r=Io(i,e,t);if(r||(i.application.router.proposeToConnectScopeForElementAndIdentifier(e,t),r=Io(i,e,t),r))return r}function vc(i){let e=Tn(i);return{[`${e}Outlet`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t){let n=Oo(this,t,i);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}Outlets`]:{get(){let t=this.outlets.findAll(i);return t.length>0?t.map(r=>{let n=Oo(this,r,i);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`,r)}).filter(r=>r):[]}},[`${e}OutletElement`]:{get(){let t=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(t)return t;throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${e}OutletElements`]:{get(){return this.outlets.findAll(i)}},[`has${wi(e)}Outlet`]:{get(){return this.outlets.has(i)}}}}function bc(i){return Ei(i,"targets").reduce((t,r)=>Object.assign(t,yc(r)),{})}function yc(i){return{[`${i}Target`]:{get(){let e=this.targets.find(i);if(e)return e;throw new Error(`Missing target element "${i}" for "${this.identifier}" controller`)}},[`${i}Targets`]:{get(){return this.targets.findAll(i)}},[`has${wi(i)}Target`]:{get(){return this.targets.has(i)}}}}function wc(i){let e=tc(i,"values"),t={valueDescriptorMap:{get(){return e.reduce((r,n)=>{let s=No(n,this.identifier),o=this.data.getAttributeNameForKey(s.key);return Object.assign(r,{[o]:s})},{})}}};return e.reduce((r,n)=>Object.assign(r,Ec(n)),t)}function Ec(i,e){let t=No(i,e),{key:r,name:n,reader:s,writer:o}=t;return{[n]:{get(){let a=this.data.get(r);return a!==null?s(a):t.defaultValue},set(a){a===void 0?this.data.delete(r):this.data.set(r,o(a))}},[`has${wi(n)}`]:{get(){return this.data.has(r)||t.hasCustomDefaultValue}}}}function No([i,e],t){return Tc({controller:t,token:i,typeDefinition:e})}function rr(i){switch(i){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function yi(i){switch(typeof i){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(i))return"array";if(Object.prototype.toString.call(i)==="[object Object]")return"object"}function _c(i){let{controller:e,token:t,typeObject:r}=i,n=ko(r.type),s=ko(r.default),o=n&&s,a=n&&!s,l=!n&&s,d=rr(r.type),p=yi(i.typeObject.default);if(a)return d;if(l)return p;if(d!==p){let m=e?`${e}.${t}`:t;throw new Error(`The specified default value for the Stimulus Value "${m}" must match the defined type "${d}". The provided default value of "${r.default}" is of type "${p}".`)}if(o)return d}function Ac(i){let{controller:e,token:t,typeDefinition:r}=i,s=_c({controller:e,token:t,typeObject:r}),o=yi(r),a=rr(r),l=s||o||a;if(l)return l;let d=e?`${e}.${r}`:t;throw new Error(`Unknown value type "${d}" for "${t}" value`)}function Sc(i){let e=rr(i);if(e)return Ro[e];let t=kn(i,"default"),r=kn(i,"type"),n=i;if(t)return n.default;if(r){let{type:s}=n,o=rr(s);if(o)return Ro[o]}return i}function Tc(i){let{token:e,typeDefinition:t}=i,r=`${Do(e)}-value`,n=Ac(i);return{type:n,key:r,name:Wn(r),get defaultValue(){return Sc(t)},get hasCustomDefaultValue(){return yi(t)!==void 0},reader:kc[n],writer:Mo[n]||Mo.default}}var Ro={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},kc={array(i){let e=JSON.parse(i);if(!Array.isArray(e))throw new TypeError(`expected value of type "array" but instead got value "${i}" of type "${yi(e)}"`);return e},boolean(i){return!(i=="0"||String(i).toLowerCase()=="false")},number(i){return Number(i.replace(/_/g,""))},object(i){let e=JSON.parse(i);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`expected value of type "object" but instead got value "${i}" of type "${yi(e)}"`);return e},string(i){return i}},Mo={default:xc,array:Po,object:Po};function Po(i){return JSON.stringify(i)}function xc(i){return`${i}`}var T=class{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:r={},prefix:n=this.identifier,bubbles:s=!0,cancelable:o=!0}={}){let a=n?`${n}:${e}`:e,l=new CustomEvent(a,{detail:r,bubbles:s,cancelable:o});return t.dispatchEvent(l),l}};T.blessings=[fc,bc,wc,gc];T.targets=[];T.outlets=[];T.values={};var nr=class extends T{connect(){console.log(`resource-layout connected: ${this.element}`)}};var sr=class extends T{connect(){console.log(`nav-grid-menu-item connected: ${this.element}`)}};var or=class extends T{connect(){console.log(`nav-grid-menu connected: ${this.element}`)}};var ar=class extends T{connect(){console.log(`nav-user-section connected: ${this.element}`)}};var lr=class extends T{connect(){console.log(`nav-user-link connected: ${this.element}`)}};var cr=class extends T{connect(){console.log(`nav-user connected: ${this.element}`)}};var ur=class extends T{static targets=["openIcon","closeIcon"];static outlets=["sidebar"];static values={placement:{type:String,default:"left"},bodyScrolling:{type:Boolean,default:!1},backdrop:{type:Boolean,default:!0},edge:{type:Boolean,default:!1},edgeOffset:{type:String,default:"bottom-[60px]"}};static classes={backdrop:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-30"};initialize(){this.visible=!1,this.handleEscapeKey=this.handleEscapeKey.bind(this)}connect(){document.addEventListener("keydown",this.handleEscapeKey)}sidebarOutletConnected(){this.#e(this.sidebarOutlet.element)}disconnect(){this.#i(),document.removeEventListener("keydown",this.handleEscapeKey),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden")}#e(i){i.setAttribute("aria-hidden","true"),i.classList.add("transition-transform"),this.#n(this.placementValue).base.forEach(e=>{i.classList.add(e)})}toggleDrawer(){this.visible?this.hideDrawer():this.showDrawer()}showDrawer(){this.edgeValue?this.#r(`${this.placementValue}-edge`,!0):this.#s(this.placementValue,!0),this.openIconTarget.classList.add("hidden"),this.openIconTarget.setAttribute("aria-hidden","true"),this.closeIconTarget.classList.remove("hidden"),this.closeIconTarget.setAttribute("aria-hidden","false"),this.sidebarOutlet.element.setAttribute("aria-modal","true"),this.sidebarOutlet.element.setAttribute("role","dialog"),this.sidebarOutlet.element.removeAttribute("aria-hidden"),this.bodyScrollingValue||document.body.classList.add("overflow-hidden"),this.backdropValue&&this.#t(),this.visible=!0,this.dispatch("show")}hideDrawer(){this.edgeValue?this.#r(`${this.placementValue}-edge`,!1):this.#s(this.placementValue,!1),this.openIconTarget.classList.remove("hidden"),this.openIconTarget.setAttribute("aria-hidden","false"),this.closeIconTarget.classList.add("hidden"),this.closeIconTarget.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.setAttribute("aria-hidden","true"),this.sidebarOutlet.element.removeAttribute("aria-modal"),this.sidebarOutlet.element.removeAttribute("role"),this.bodyScrollingValue||document.body.classList.remove("overflow-hidden"),this.backdropValue&&this.#i(),this.visible=!1,this.dispatch("hide")}handleEscapeKey(i){i.key==="Escape"&&this.visible&&this.hideDrawer()}#t(){if(!this.visible){let i=document.createElement("div");i.setAttribute("data-drawer-backdrop",""),i.classList.add(...this.constructor.classes.backdrop.split(" ")),i.addEventListener("click",()=>this.hideDrawer()),document.body.appendChild(i)}}#i(){let i=document.querySelector("[data-drawer-backdrop]");i&&i.remove()}#n(i){let e={top:{base:["top-0","left-0","right-0"],active:["transform-none"],inactive:["-translate-y-full"]},right:{base:["right-0","top-0"],active:["transform-none"],inactive:["translate-x-full"]},bottom:{base:["bottom-0","left-0","right-0"],active:["transform-none"],inactive:["translate-y-full"]},left:{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]},"bottom-edge":{base:["left-0","top-0"],active:["transform-none"],inactive:["translate-y-full",this.edgeOffsetValue]}};return e[i]||e.left}#s(i,e){let t=this.#n(i);e?(t.active.forEach(r=>this.sidebarOutlet.element.classList.add(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.remove(r))):(t.active.forEach(r=>this.sidebarOutlet.element.classList.remove(r)),t.inactive.forEach(r=>this.sidebarOutlet.element.classList.add(r)))}#r(i,e){this.#s(i,e)}};var hr=class extends T{connect(){console.log(`sidebar-menu-item connected: ${this.element}`)}};var dr=class extends T{connect(){console.log(`sidebar-menu connected: ${this.element}`)}};var pr=class extends T{connect(){console.log(`sidebar connected: ${this.element}`)}};var fr=class extends T{connect(){console.log(`has-many-panel connected: ${this.element}`)}};var mr=class extends T{static targets=["target","template","addButton"];static values={wrapperSelector:{type:String,default:".nested-resource-form-fields"},limit:Number};connect(){this.updateState()}add(i){i.preventDefault();let e=this.templateTarget.innerHTML.replace(/NEW_RECORD/g,new Date().getTime().toString());this.targetTarget.insertAdjacentHTML("beforebegin",e);let t=new CustomEvent("nested-resource-form-fields:add",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}remove(i){i.preventDefault();let e=i.target.closest(this.wrapperSelectorValue);if(e.dataset.newRecord!==void 0)e.remove();else{e.style.display="none",e.classList.remove(...e.classList);let r=e.querySelector("input[name*='_destroy']");r.value="1"}let t=new CustomEvent("nested-resource-form-fields:remove",{bubbles:!0});this.element.dispatchEvent(t),this.updateState()}updateState(){!this.hasAddButtonTarget||this.limitValue==0||(this.childCount>=this.limitValue?this.addButtonTarget.style.display="none":this.addButtonTarget.style.display="initial")}get childCount(){return this.element.querySelectorAll(this.wrapperSelectorValue).length}};var gr=class extends T{connect(){console.log(`toolbar connected: ${this.element}`)}};var vr=class extends T{connect(){console.log(`table-search-input connected: ${this.element}`)}};var br=class extends T{connect(){console.log(`table-toolbar connected: ${this.element}`)}};var yr=class extends T{connect(){console.log(`table connected: ${this.element}`)}};var ef=Nl(Vo(),1),wr=class extends T{connect(){console.log(`form connected: ${this.element}`)}submit(){this.element.requestSubmit()}};var Uc=function(){function i(e,t){t===void 0&&(t=[]),this._eventType=e,this._eventFunctions=t}return i.prototype.init=function(){var e=this;this._eventFunctions.forEach(function(t){typeof window<"u"&&window.addEventListener(e._eventType,t)})},i}(),$o=Uc;var Wc=function(){function i(){this._instances={Accordion:{},Carousel:{},Collapse:{},Dial:{},Dismiss:{},Drawer:{},Dropdown:{},Modal:{},Popover:{},Tabs:{},Tooltip:{},InputCounter:{},CopyClipboard:{}}}return i.prototype.addInstance=function(e,t,r,n){if(n===void 0&&(n=!1),!this._instances[e])return console.warn("Flowbite: Component ".concat(e," does not exist.")),!1;if(this._instances[e][r]&&!n){console.warn("Flowbite: Instance with ID ".concat(r," already exists."));return}n&&this._instances[e][r]&&this._instances[e][r].destroyAndRemoveInstance(),this._instances[e][r||this._generateRandomId()]=t},i.prototype.getAllInstances=function(){return this._instances},i.prototype.getInstances=function(e){return this._instances[e]?this._instances[e]:(console.warn("Flowbite: Component ".concat(e," does not exist.")),!1)},i.prototype.getInstance=function(e,t){if(this._componentAndInstanceCheck(e,t)){if(!this._instances[e][t]){console.warn("Flowbite: Instance with ID ".concat(t," does not exist."));return}return this._instances[e][t]}},i.prototype.destroyAndRemoveInstance=function(e,t){this._componentAndInstanceCheck(e,t)&&(this.destroyInstanceObject(e,t),this.removeInstance(e,t))},i.prototype.removeInstance=function(e,t){this._componentAndInstanceCheck(e,t)&&delete this._instances[e][t]},i.prototype.destroyInstanceObject=function(e,t){this._componentAndInstanceCheck(e,t)&&this._instances[e][t].destroy()},i.prototype.instanceExists=function(e,t){return!(!this._instances[e]||!this._instances[e][t])},i.prototype._generateRandomId=function(){return Math.random().toString(36).substr(2,9)},i.prototype._componentAndInstanceCheck=function(e,t){return this._instances[e]?this._instances[e][t]?!0:(console.warn("Flowbite: Instance with ID ".concat(t," does not exist.")),!1):(console.warn("Flowbite: Component ".concat(e," does not exist.")),!1)},i}(),jo=new Wc,I=jo;typeof window<"u"&&(window.FlowbiteInstances=jo);var Er=function(){return Er=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Er.apply(this,arguments)},_r={alwaysOpen:!1,activeClasses:"bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white",inactiveClasses:"text-gray-500 dark:text-gray-400",onOpen:function(){},onClose:function(){},onToggle:function(){}},Kc={id:null,override:!0},Uo=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=_r),n===void 0&&(n=Kc),this._instanceId=n.id?n.id:e.id,this._accordionEl=e,this._items=t,this._options=Er(Er({},_r),r),this._initialized=!1,this.init(),I.addInstance("Accordion",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._items.length&&!this._initialized&&(this._items.forEach(function(t){t.active&&e.open(t.id);var r=function(){e.toggle(t.id)};t.triggerEl.addEventListener("click",r),t.clickHandler=r}),this._initialized=!0)},i.prototype.destroy=function(){this._items.length&&this._initialized&&(this._items.forEach(function(e){e.triggerEl.removeEventListener("click",e.clickHandler),delete e.clickHandler}),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Accordion",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getItem=function(e){return this._items.filter(function(t){return t.id===e})[0]},i.prototype.open=function(e){var t,r,n=this,s=this.getItem(e);this._options.alwaysOpen||this._items.map(function(o){var a,l;o!==s&&((a=o.triggerEl.classList).remove.apply(a,n._options.activeClasses.split(" ")),(l=o.triggerEl.classList).add.apply(l,n._options.inactiveClasses.split(" ")),o.targetEl.classList.add("hidden"),o.triggerEl.setAttribute("aria-expanded","false"),o.active=!1,o.iconEl&&o.iconEl.classList.add("rotate-180"))}),(t=s.triggerEl.classList).add.apply(t,this._options.activeClasses.split(" ")),(r=s.triggerEl.classList).remove.apply(r,this._options.inactiveClasses.split(" ")),s.triggerEl.setAttribute("aria-expanded","true"),s.targetEl.classList.remove("hidden"),s.active=!0,s.iconEl&&s.iconEl.classList.remove("rotate-180"),this._options.onOpen(this,s)},i.prototype.toggle=function(e){var t=this.getItem(e);t.active?this.close(e):this.open(e),this._options.onToggle(this,t)},i.prototype.close=function(e){var t,r,n=this.getItem(e);(t=n.triggerEl.classList).remove.apply(t,this._options.activeClasses.split(" ")),(r=n.triggerEl.classList).add.apply(r,this._options.inactiveClasses.split(" ")),n.targetEl.classList.add("hidden"),n.triggerEl.setAttribute("aria-expanded","false"),n.active=!1,n.iconEl&&n.iconEl.classList.add("rotate-180"),this._options.onClose(this,n)},i.prototype.updateOnOpen=function(e){this._options.onOpen=e},i.prototype.updateOnClose=function(e){this._options.onClose=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Nt(){document.querySelectorAll("[data-accordion]").forEach(function(i){var e=i.getAttribute("data-accordion"),t=i.getAttribute("data-active-classes"),r=i.getAttribute("data-inactive-classes"),n=[];i.querySelectorAll("[data-accordion-target]").forEach(function(s){if(s.closest("[data-accordion]")===i){var o={id:s.getAttribute("data-accordion-target"),triggerEl:s,targetEl:document.querySelector(s.getAttribute("data-accordion-target")),iconEl:s.querySelector("[data-accordion-icon]"),active:s.getAttribute("aria-expanded")==="true"};n.push(o)}}),new Uo(i,n,{alwaysOpen:e==="open",activeClasses:t||_r.activeClasses,inactiveClasses:r||_r.inactiveClasses})})}typeof window<"u"&&(window.Accordion=Uo,window.initAccordions=Nt);var Ar=function(){return Ar=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Ar.apply(this,arguments)},Wo={onCollapse:function(){},onExpand:function(){},onToggle:function(){}},Gc={id:null,override:!0},Xn=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Wo),n===void 0&&(n=Gc),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=Ar(Ar({},Wo),r),this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Collapse",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._triggerEl&&this._targetEl&&!this._initialized&&(this._triggerEl.hasAttribute("aria-expanded")?this._visible=this._triggerEl.getAttribute("aria-expanded")==="true":this._visible=!this._targetEl.classList.contains("hidden"),this._clickHandler=function(){e.toggle()},this._triggerEl.addEventListener("click",this._clickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._initialized&&(this._triggerEl.removeEventListener("click",this._clickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Collapse",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.collapse=function(){this._targetEl.classList.add("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","false"),this._visible=!1,this._options.onCollapse(this)},i.prototype.expand=function(){this._targetEl.classList.remove("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","true"),this._visible=!0,this._options.onExpand(this)},i.prototype.toggle=function(){this._visible?this.collapse():this.expand(),this._options.onToggle(this)},i.prototype.updateOnCollapse=function(e){this._options.onCollapse=e},i.prototype.updateOnExpand=function(e){this._options.onExpand=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Ht(){document.querySelectorAll("[data-collapse-toggle]").forEach(function(i){var e=i.getAttribute("data-collapse-toggle"),t=document.getElementById(e);t?I.instanceExists("Collapse",t.getAttribute("id"))?new Xn(t,i,{},{id:t.getAttribute("id")+"_"+I._generateRandomId()}):new Xn(t,i):console.error('The target element with id "'.concat(e,'" does not exist. Please check the data-collapse-toggle attribute.'))})}typeof window<"u"&&(window.Collapse=Xn,window.initCollapses=Ht);var ut=function(){return ut=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},ut.apply(this,arguments)},Sr={defaultPosition:0,indicators:{items:[],activeClasses:"bg-white dark:bg-gray-800",inactiveClasses:"bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800"},interval:3e3,onNext:function(){},onPrev:function(){},onChange:function(){}},Xc={id:null,override:!0},Ko=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=Sr),n===void 0&&(n=Xc),this._instanceId=n.id?n.id:e.id,this._carouselEl=e,this._items=t,this._options=ut(ut(ut({},Sr),r),{indicators:ut(ut({},Sr.indicators),r.indicators)}),this._activeItem=this.getItem(this._options.defaultPosition),this._indicators=this._options.indicators.items,this._intervalDuration=this._options.interval,this._intervalInstance=null,this._initialized=!1,this.init(),I.addInstance("Carousel",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._items.length&&!this._initialized&&(this._items.map(function(t){t.el.classList.add("absolute","inset-0","transition-transform","transform")}),this.getActiveItem()?this.slideTo(this.getActiveItem().position):this.slideTo(0),this._indicators.map(function(t,r){t.el.addEventListener("click",function(){e.slideTo(r)})}),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Carousel",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getItem=function(e){return this._items[e]},i.prototype.slideTo=function(e){var t=this._items[e],r={left:t.position===0?this._items[this._items.length-1]:this._items[t.position-1],middle:t,right:t.position===this._items.length-1?this._items[0]:this._items[t.position+1]};this._rotate(r),this._setActiveItem(t),this._intervalInstance&&(this.pause(),this.cycle()),this._options.onChange(this)},i.prototype.next=function(){var e=this.getActiveItem(),t=null;e.position===this._items.length-1?t=this._items[0]:t=this._items[e.position+1],this.slideTo(t.position),this._options.onNext(this)},i.prototype.prev=function(){var e=this.getActiveItem(),t=null;e.position===0?t=this._items[this._items.length-1]:t=this._items[e.position-1],this.slideTo(t.position),this._options.onPrev(this)},i.prototype._rotate=function(e){if(this._items.map(function(t){t.el.classList.add("hidden")}),this._items.length===1){e.middle.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-10"),e.middle.el.classList.add("translate-x-0","z-20");return}e.left.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-20"),e.left.el.classList.add("-translate-x-full","z-10"),e.middle.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-10"),e.middle.el.classList.add("translate-x-0","z-30"),e.right.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-30"),e.right.el.classList.add("translate-x-full","z-20")},i.prototype.cycle=function(){var e=this;typeof window<"u"&&(this._intervalInstance=window.setInterval(function(){e.next()},this._intervalDuration))},i.prototype.pause=function(){clearInterval(this._intervalInstance)},i.prototype.getActiveItem=function(){return this._activeItem},i.prototype._setActiveItem=function(e){var t,r,n=this;this._activeItem=e;var s=e.position;this._indicators.length&&(this._indicators.map(function(o){var a,l;o.el.setAttribute("aria-current","false"),(a=o.el.classList).remove.apply(a,n._options.indicators.activeClasses.split(" ")),(l=o.el.classList).add.apply(l,n._options.indicators.inactiveClasses.split(" "))}),(t=this._indicators[s].el.classList).add.apply(t,this._options.indicators.activeClasses.split(" ")),(r=this._indicators[s].el.classList).remove.apply(r,this._options.indicators.inactiveClasses.split(" ")),this._indicators[s].el.setAttribute("aria-current","true"))},i.prototype.updateOnNext=function(e){this._options.onNext=e},i.prototype.updateOnPrev=function(e){this._options.onPrev=e},i.prototype.updateOnChange=function(e){this._options.onChange=e},i}();function qt(){document.querySelectorAll("[data-carousel]").forEach(function(i){var e=i.getAttribute("data-carousel-interval"),t=i.getAttribute("data-carousel")==="slide",r=[],n=0;i.querySelectorAll("[data-carousel-item]").length&&Array.from(i.querySelectorAll("[data-carousel-item]")).map(function(d,p){r.push({position:p,el:d}),d.getAttribute("data-carousel-item")==="active"&&(n=p)});var s=[];i.querySelectorAll("[data-carousel-slide-to]").length&&Array.from(i.querySelectorAll("[data-carousel-slide-to]")).map(function(d){s.push({position:parseInt(d.getAttribute("data-carousel-slide-to")),el:d})});var o=new Ko(i,r,{defaultPosition:n,indicators:{items:s},interval:e||Sr.interval});t&&o.cycle();var a=i.querySelector("[data-carousel-next]"),l=i.querySelector("[data-carousel-prev]");a&&a.addEventListener("click",function(){o.next()}),l&&l.addEventListener("click",function(){o.prev()})})}typeof window<"u"&&(window.Carousel=Ko,window.initCarousels=qt);var Tr=function(){return Tr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Tr.apply(this,arguments)},Go={transition:"transition-opacity",duration:300,timing:"ease-out",onHide:function(){}},Yc={id:null,override:!0},Xo=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Go),n===void 0&&(n=Yc),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=Tr(Tr({},Go),r),this._initialized=!1,this.init(),I.addInstance("Dismiss",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._triggerEl&&this._targetEl&&!this._initialized&&(this._clickHandler=function(){e.hide()},this._triggerEl.addEventListener("click",this._clickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._initialized&&(this._triggerEl.removeEventListener("click",this._clickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Dismiss",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){var e=this;this._targetEl.classList.add(this._options.transition,"duration-".concat(this._options.duration),this._options.timing,"opacity-0"),setTimeout(function(){e._targetEl.classList.add("hidden")},this._options.duration),this._options.onHide(this,this._targetEl)},i.prototype.updateOnHide=function(e){this._options.onHide=e},i}();function zt(){document.querySelectorAll("[data-dismiss-target]").forEach(function(i){var e=i.getAttribute("data-dismiss-target"),t=document.querySelector(e);t?new Xo(t,i):console.error('The dismiss element with id "'.concat(e,'" does not exist. Please check the data-dismiss-target attribute.'))})}typeof window<"u"&&(window.Dismiss=Xo,window.initDismisses=zt);var J="top",ie="bottom",te="right",ee="left",kr="auto",et=[J,ie,te,ee],Xe="start",ht="end",Yo="clippingParents",xr="viewport",Vt="popper",Zo="reference",Yn=et.reduce(function(i,e){return i.concat([e+"-"+Xe,e+"-"+ht])},[]),Lr=[].concat(et,[kr]).reduce(function(i,e){return i.concat([e,e+"-"+Xe,e+"-"+ht])},[]),Zc="beforeRead",Qc="read",Jc="afterRead",eu="beforeMain",tu="main",iu="afterMain",ru="beforeWrite",nu="write",su="afterWrite",Qo=[Zc,Qc,Jc,eu,tu,iu,ru,nu,su];function oe(i){return i?(i.nodeName||"").toLowerCase():null}function G(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var e=i.ownerDocument;return e&&e.defaultView||window}return i}function _e(i){var e=G(i).Element;return i instanceof e||i instanceof Element}function re(i){var e=G(i).HTMLElement;return i instanceof e||i instanceof HTMLElement}function $t(i){if(typeof ShadowRoot>"u")return!1;var e=G(i).ShadowRoot;return i instanceof e||i instanceof ShadowRoot}function ou(i){var e=i.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];!re(s)||!oe(s)||(Object.assign(s.style,r),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function au(i){var e=i.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var n=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=o.reduce(function(l,d){return l[d]="",l},{});!re(n)||!oe(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}var Jo={name:"applyStyles",enabled:!0,phase:"write",fn:ou,effect:au,requires:["computeStyles"]};function ae(i){return i.split("-")[0]}var Ce=Math.max,dt=Math.min,Ye=Math.round;function jt(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function _i(){return!/^((?!chrome|android).)*safari/i.test(jt())}function Ae(i,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=i.getBoundingClientRect(),n=1,s=1;e&&re(i)&&(n=i.offsetWidth>0&&Ye(r.width)/i.offsetWidth||1,s=i.offsetHeight>0&&Ye(r.height)/i.offsetHeight||1);var o=_e(i)?G(i):window,a=o.visualViewport,l=!_i()&&t,d=(r.left+(l&&a?a.offsetLeft:0))/n,p=(r.top+(l&&a?a.offsetTop:0))/s,m=r.width/n,E=r.height/s;return{width:m,height:E,top:p,right:d+m,bottom:p+E,left:d,x:d,y:p}}function pt(i){var e=Ae(i),t=i.offsetWidth,r=i.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:i.offsetLeft,y:i.offsetTop,width:t,height:r}}function Ai(i,e){var t=e.getRootNode&&e.getRootNode();if(i.contains(e))return!0;if(t&&$t(t)){var r=e;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function me(i){return G(i).getComputedStyle(i)}function Zn(i){return["table","td","th"].indexOf(oe(i))>=0}function he(i){return((_e(i)?i.ownerDocument:i.document)||window.document).documentElement}function Ze(i){return oe(i)==="html"?i:i.assignedSlot||i.parentNode||($t(i)?i.host:null)||he(i)}function ea(i){return!re(i)||me(i).position==="fixed"?null:i.offsetParent}function lu(i){var e=/firefox/i.test(jt()),t=/Trident/i.test(jt());if(t&&re(i)){var r=me(i);if(r.position==="fixed")return null}var n=Ze(i);for($t(n)&&(n=n.host);re(n)&&["html","body"].indexOf(oe(n))<0;){var s=me(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function Ie(i){for(var e=G(i),t=ea(i);t&&Zn(t)&&me(t).position==="static";)t=ea(t);return t&&(oe(t)==="html"||oe(t)==="body"&&me(t).position==="static")?e:t||lu(i)||e}function ft(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function mt(i,e,t){return Ce(i,dt(e,t))}function ta(i,e,t){var r=mt(i,e,t);return r>t?t:r}function Si(){return{top:0,right:0,bottom:0,left:0}}function Ti(i){return Object.assign({},Si(),i)}function ki(i,e){return e.reduce(function(t,r){return t[r]=i,t},{})}var cu=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Ti(typeof e!="number"?e:ki(e,et))};function uu(i){var e,t=i.state,r=i.name,n=i.options,s=t.elements.arrow,o=t.modifiersData.popperOffsets,a=ae(t.placement),l=ft(a),d=[ee,te].indexOf(a)>=0,p=d?"height":"width";if(!(!s||!o)){var m=cu(n.padding,t),E=pt(s),v=l==="y"?J:ee,C=l==="y"?ie:te,_=t.rects.reference[p]+t.rects.reference[l]-o[l]-t.rects.popper[p],k=o[l]-t.rects.reference[l],D=Ie(s),q=D?l==="y"?D.clientHeight||0:D.clientWidth||0:0,B=_/2-k/2,S=m[v],R=q-E[p]-m[C],x=q/2-E[p]/2+B,P=mt(S,x,R),N=l;t.modifiersData[r]=(e={},e[N]=P,e.centerOffset=P-x,e)}}function hu(i){var e=i.state,t=i.options,r=t.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||Ai(e.elements.popper,n)&&(e.elements.arrow=n))}var ia={name:"arrow",enabled:!0,phase:"main",fn:uu,effect:hu,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Se(i){return i.split("-")[1]}var du={top:"auto",right:"auto",bottom:"auto",left:"auto"};function pu(i,e){var t=i.x,r=i.y,n=e.devicePixelRatio||1;return{x:Ye(t*n)/n||0,y:Ye(r*n)/n||0}}function ra(i){var e,t=i.popper,r=i.popperRect,n=i.placement,s=i.variation,o=i.offsets,a=i.position,l=i.gpuAcceleration,d=i.adaptive,p=i.roundOffsets,m=i.isFixed,E=o.x,v=E===void 0?0:E,C=o.y,_=C===void 0?0:C,k=typeof p=="function"?p({x:v,y:_}):{x:v,y:_};v=k.x,_=k.y;var D=o.hasOwnProperty("x"),q=o.hasOwnProperty("y"),B=ee,S=J,R=window;if(d){var x=Ie(t),P="clientHeight",N="clientWidth";if(x===G(t)&&(x=he(t),me(x).position!=="static"&&a==="absolute"&&(P="scrollHeight",N="scrollWidth")),x=x,n===J||(n===ee||n===te)&&s===ht){S=ie;var U=m&&x===R&&R.visualViewport?R.visualViewport.height:x[P];_-=U-r.height,_*=l?1:-1}if(n===ee||(n===J||n===ie)&&s===ht){B=te;var X=m&&x===R&&R.visualViewport?R.visualViewport.width:x[N];v-=X-r.width,v*=l?1:-1}}var z=Object.assign({position:a},d&&du),Y=p===!0?pu({x:v,y:_},G(t)):{x:v,y:_};if(v=Y.x,_=Y.y,l){var W;return Object.assign({},z,(W={},W[S]=q?"0":"",W[B]=D?"0":"",W.transform=(R.devicePixelRatio||1)<=1?"translate("+v+"px, "+_+"px)":"translate3d("+v+"px, "+_+"px, 0)",W))}return Object.assign({},z,(e={},e[S]=q?_+"px":"",e[B]=D?v+"px":"",e.transform="",e))}function fu(i){var e=i.state,t=i.options,r=t.gpuAcceleration,n=r===void 0?!0:r,s=t.adaptive,o=s===void 0?!0:s,a=t.roundOffsets,l=a===void 0?!0:a,d={placement:ae(e.placement),variation:Se(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ra(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ra(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}var na={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:fu,data:{}};var Cr={passive:!0};function mu(i){var e=i.state,t=i.instance,r=i.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,l=G(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&d.forEach(function(p){p.addEventListener("scroll",t.update,Cr)}),a&&l.addEventListener("resize",t.update,Cr),function(){s&&d.forEach(function(p){p.removeEventListener("scroll",t.update,Cr)}),a&&l.removeEventListener("resize",t.update,Cr)}}var sa={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:mu,data:{}};var gu={left:"right",right:"left",bottom:"top",top:"bottom"};function Ut(i){return i.replace(/left|right|bottom|top/g,function(e){return gu[e]})}var vu={start:"end",end:"start"};function Ir(i){return i.replace(/start|end/g,function(e){return vu[e]})}function gt(i){var e=G(i),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function vt(i){return Ae(he(i)).left+gt(i).scrollLeft}function Qn(i,e){var t=G(i),r=he(i),n=t.visualViewport,s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;var d=_i();(d||!d&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:s,height:o,x:a+vt(i),y:l}}function Jn(i){var e,t=he(i),r=gt(i),n=(e=i.ownerDocument)==null?void 0:e.body,s=Ce(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=Ce(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+vt(i),l=-r.scrollTop;return me(n||t).direction==="rtl"&&(a+=Ce(t.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function bt(i){var e=me(i),t=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+r)}function Or(i){return["html","body","#document"].indexOf(oe(i))>=0?i.ownerDocument.body:re(i)&&bt(i)?i:Or(Ze(i))}function tt(i,e){var t;e===void 0&&(e=[]);var r=Or(i),n=r===((t=i.ownerDocument)==null?void 0:t.body),s=G(r),o=n?[s].concat(s.visualViewport||[],bt(r)?r:[]):r,a=e.concat(o);return n?a:a.concat(tt(Ze(o)))}function Wt(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function bu(i,e){var t=Ae(i,!1,e==="fixed");return t.top=t.top+i.clientTop,t.left=t.left+i.clientLeft,t.bottom=t.top+i.clientHeight,t.right=t.left+i.clientWidth,t.width=i.clientWidth,t.height=i.clientHeight,t.x=t.left,t.y=t.top,t}function oa(i,e,t){return e===xr?Wt(Qn(i,t)):_e(e)?bu(e,t):Wt(Jn(he(i)))}function yu(i){var e=tt(Ze(i)),t=["absolute","fixed"].indexOf(me(i).position)>=0,r=t&&re(i)?Ie(i):i;return _e(r)?e.filter(function(n){return _e(n)&&Ai(n,r)&&oe(n)!=="body"}):[]}function es(i,e,t,r){var n=e==="clippingParents"?yu(i):[].concat(e),s=[].concat(n,[t]),o=s[0],a=s.reduce(function(l,d){var p=oa(i,d,r);return l.top=Ce(p.top,l.top),l.right=dt(p.right,l.right),l.bottom=dt(p.bottom,l.bottom),l.left=Ce(p.left,l.left),l},oa(i,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function xi(i){var e=i.reference,t=i.element,r=i.placement,n=r?ae(r):null,s=r?Se(r):null,o=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(n){case J:l={x:o,y:e.y-t.height};break;case ie:l={x:o,y:e.y+e.height};break;case te:l={x:e.x+e.width,y:a};break;case ee:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var d=n?ft(n):null;if(d!=null){var p=d==="y"?"height":"width";switch(s){case Xe:l[d]=l[d]-(e[p]/2-t[p]/2);break;case ht:l[d]=l[d]+(e[p]/2-t[p]/2);break;default:}}return l}function Oe(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=r===void 0?i.placement:r,s=t.strategy,o=s===void 0?i.strategy:s,a=t.boundary,l=a===void 0?Yo:a,d=t.rootBoundary,p=d===void 0?xr:d,m=t.elementContext,E=m===void 0?Vt:m,v=t.altBoundary,C=v===void 0?!1:v,_=t.padding,k=_===void 0?0:_,D=Ti(typeof k!="number"?k:ki(k,et)),q=E===Vt?Zo:Vt,B=i.rects.popper,S=i.elements[C?q:E],R=es(_e(S)?S:S.contextElement||he(i.elements.popper),l,p,o),x=Ae(i.elements.reference),P=xi({reference:x,element:B,strategy:"absolute",placement:n}),N=Wt(Object.assign({},B,P)),U=E===Vt?N:x,X={top:R.top-U.top+D.top,bottom:U.bottom-R.bottom+D.bottom,left:R.left-U.left+D.left,right:U.right-R.right+D.right},z=i.modifiersData.offset;if(E===Vt&&z){var Y=z[n];Object.keys(X).forEach(function(W){var ye=[te,ie].indexOf(W)>=0?1:-1,xe=[J,ie].indexOf(W)>=0?"y":"x";X[W]+=Y[xe]*ye})}return X}function ts(i,e){e===void 0&&(e={});var t=e,r=t.placement,n=t.boundary,s=t.rootBoundary,o=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,d=l===void 0?Lr:l,p=Se(r),m=p?a?Yn:Yn.filter(function(C){return Se(C)===p}):et,E=m.filter(function(C){return d.indexOf(C)>=0});E.length===0&&(E=m);var v=E.reduce(function(C,_){return C[_]=Oe(i,{placement:_,boundary:n,rootBoundary:s,padding:o})[ae(_)],C},{});return Object.keys(v).sort(function(C,_){return v[C]-v[_]})}function wu(i){if(ae(i)===kr)return[];var e=Ut(i);return[Ir(i),e,Ir(e)]}function Eu(i){var e=i.state,t=i.options,r=i.name;if(!e.modifiersData[r]._skip){for(var n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!0:o,l=t.fallbackPlacements,d=t.padding,p=t.boundary,m=t.rootBoundary,E=t.altBoundary,v=t.flipVariations,C=v===void 0?!0:v,_=t.allowedAutoPlacements,k=e.options.placement,D=ae(k),q=D===k,B=l||(q||!C?[Ut(k)]:wu(k)),S=[k].concat(B).reduce(function(ce,H){return ce.concat(ae(H)===kr?ts(e,{placement:H,boundary:p,rootBoundary:m,padding:d,flipVariations:C,allowedAutoPlacements:_}):H)},[]),R=e.rects.reference,x=e.rects.popper,P=new Map,N=!0,U=S[0],X=0;X<S.length;X++){var z=S[X],Y=ae(z),W=Se(z)===Xe,ye=[J,ie].indexOf(Y)>=0,xe=ye?"width":"height",u=Oe(e,{placement:z,boundary:p,rootBoundary:m,altBoundary:E,padding:d}),h=ye?W?te:ee:W?ie:J;R[xe]>x[xe]&&(h=Ut(h));var f=Ut(h),y=[];if(s&&y.push(u[Y]<=0),a&&y.push(u[h]<=0,u[f]<=0),y.every(function(ce){return ce})){U=z,N=!1;break}P.set(z,y)}if(N)for(var w=C?3:1,b=function(H){var V=S.find(function(ne){var de=P.get(ne);if(de)return de.slice(0,H).every(function(Le){return Le})});if(V)return U=V,"break"},O=w;O>0;O--){var M=b(O);if(M==="break")break}e.placement!==U&&(e.modifiersData[r]._skip=!0,e.placement=U,e.reset=!0)}}var aa={name:"flip",enabled:!0,phase:"main",fn:Eu,requiresIfExists:["offset"],data:{_skip:!1}};function la(i,e,t){return t===void 0&&(t={x:0,y:0}),{top:i.top-e.height-t.y,right:i.right-e.width+t.x,bottom:i.bottom-e.height+t.y,left:i.left-e.width-t.x}}function ca(i){return[J,te,ie,ee].some(function(e){return i[e]>=0})}function _u(i){var e=i.state,t=i.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=Oe(e,{elementContext:"reference"}),a=Oe(e,{altBoundary:!0}),l=la(o,r),d=la(a,n,s),p=ca(l),m=ca(d);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:p,hasPopperEscaped:m},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":p,"data-popper-escaped":m})}var ua={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:_u};function Au(i,e,t){var r=ae(i),n=[ee,J].indexOf(r)>=0?-1:1,s=typeof t=="function"?t(Object.assign({},e,{placement:i})):t,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[ee,te].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Su(i){var e=i.state,t=i.options,r=i.name,n=t.offset,s=n===void 0?[0,0]:n,o=Lr.reduce(function(p,m){return p[m]=Au(m,e.rects,s),p},{}),a=o[e.placement],l=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=o}var ha={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Su};function Tu(i){var e=i.state,t=i.name;e.modifiersData[t]=xi({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}var da={name:"popperOffsets",enabled:!0,phase:"read",fn:Tu,data:{}};function is(i){return i==="x"?"y":"x"}function ku(i){var e=i.state,t=i.options,r=i.name,n=t.mainAxis,s=n===void 0?!0:n,o=t.altAxis,a=o===void 0?!1:o,l=t.boundary,d=t.rootBoundary,p=t.altBoundary,m=t.padding,E=t.tether,v=E===void 0?!0:E,C=t.tetherOffset,_=C===void 0?0:C,k=Oe(e,{boundary:l,rootBoundary:d,padding:m,altBoundary:p}),D=ae(e.placement),q=Se(e.placement),B=!q,S=ft(D),R=is(S),x=e.modifiersData.popperOffsets,P=e.rects.reference,N=e.rects.popper,U=typeof _=="function"?_(Object.assign({},e.rects,{placement:e.placement})):_,X=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),z=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,Y={x:0,y:0};if(x){if(s){var W,ye=S==="y"?J:ee,xe=S==="y"?ie:te,u=S==="y"?"height":"width",h=x[S],f=h+k[ye],y=h-k[xe],w=v?-N[u]/2:0,b=q===Xe?P[u]:N[u],O=q===Xe?-N[u]:-P[u],M=e.elements.arrow,ce=v&&M?pt(M):{width:0,height:0},H=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Si(),V=H[ye],ne=H[xe],de=mt(0,P[u],ce[u]),Le=B?P[u]/2-w-de-V-X.mainAxis:b-de-V-X.mainAxis,Ct=B?-P[u]/2+w+de+ne+X.mainAxis:O+de+ne+X.mainAxis,It=e.elements.arrow&&Ie(e.elements.arrow),Je=It?S==="y"?It.clientTop||0:It.clientLeft||0:0,Ot=(W=z?.[S])!=null?W:0,ze=h+Le-Ot-Je,fi=h+Ct-Ot,Rt=mt(v?dt(f,ze):f,h,v?Ce(y,fi):y);x[S]=Rt,Y[S]=Rt-h}if(a){var Ve,Mt=S==="x"?J:ee,Pt=S==="x"?ie:te,Fe=x[R],ct=R==="y"?"height":"width",Ui=Fe+k[Mt],Dt=Fe-k[Pt],$e=[J,ee].indexOf(D)!==-1,je=(Ve=z?.[R])!=null?Ve:0,Ue=$e?Ui:Fe-P[ct]-N[ct]-je+X.altAxis,mi=$e?Fe+P[ct]+N[ct]-je-X.altAxis:Dt,gi=v&&$e?ta(Ue,Fe,mi):mt(v?Ue:Ui,Fe,v?mi:Dt);x[R]=gi,Y[R]=gi-Fe}e.modifiersData[r]=Y}}var pa={name:"preventOverflow",enabled:!0,phase:"main",fn:ku,requiresIfExists:["offset"]};function rs(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function ns(i){return i===G(i)||!re(i)?gt(i):rs(i)}function xu(i){var e=i.getBoundingClientRect(),t=Ye(e.width)/i.offsetWidth||1,r=Ye(e.height)/i.offsetHeight||1;return t!==1||r!==1}function ss(i,e,t){t===void 0&&(t=!1);var r=re(e),n=re(e)&&xu(e),s=he(e),o=Ae(i,n,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!t)&&((oe(e)!=="body"||bt(s))&&(a=ns(e)),re(e)?(l=Ae(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=vt(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Lu(i){var e=new Map,t=new Set,r=[];i.forEach(function(s){e.set(s.name,s)});function n(s){t.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&n(l)}}),r.push(s)}return i.forEach(function(s){t.has(s.name)||n(s)}),r}function os(i){var e=Lu(i);return Qo.reduce(function(t,r){return t.concat(e.filter(function(n){return n.phase===r}))},[])}function as(i){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(i())})})),e}}function ls(i){var e=i.reduce(function(t,r){var n=t[r.name];return t[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var fa={placement:"bottom",modifiers:[],strategy:"absolute"};function ma(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function ga(i){i===void 0&&(i={});var e=i,t=e.defaultModifiers,r=t===void 0?[]:t,n=e.defaultOptions,s=n===void 0?fa:n;return function(a,l,d){d===void 0&&(d=s);var p={placement:"bottom",orderedModifiers:[],options:Object.assign({},fa,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},m=[],E=!1,v={state:p,setOptions:function(D){var q=typeof D=="function"?D(p.options):D;_(),p.options=Object.assign({},s,p.options,q),p.scrollParents={reference:_e(a)?tt(a):a.contextElement?tt(a.contextElement):[],popper:tt(l)};var B=os(ls([].concat(r,p.options.modifiers)));return p.orderedModifiers=B.filter(function(S){return S.enabled}),C(),v.update()},forceUpdate:function(){if(!E){var D=p.elements,q=D.reference,B=D.popper;if(ma(q,B)){p.rects={reference:ss(q,Ie(B),p.options.strategy==="fixed"),popper:pt(B)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(X){return p.modifiersData[X.name]=Object.assign({},X.data)});for(var S=0;S<p.orderedModifiers.length;S++){if(p.reset===!0){p.reset=!1,S=-1;continue}var R=p.orderedModifiers[S],x=R.fn,P=R.options,N=P===void 0?{}:P,U=R.name;typeof x=="function"&&(p=x({state:p,options:N,name:U,instance:v})||p)}}}},update:as(function(){return new Promise(function(k){v.forceUpdate(),k(p)})}),destroy:function(){_(),E=!0}};if(!ma(a,l))return v;v.setOptions(d).then(function(k){!E&&d.onFirstUpdate&&d.onFirstUpdate(k)});function C(){p.orderedModifiers.forEach(function(k){var D=k.name,q=k.options,B=q===void 0?{}:q,S=k.effect;if(typeof S=="function"){var R=S({state:p,name:D,instance:v,options:B}),x=function(){};m.push(R||x)}})}function _(){m.forEach(function(k){return k()}),m=[]}return v}}var Cu=[sa,da,na,Jo,ha,aa,pa,ia,ua],yt=ga({defaultModifiers:Cu});var it=function(){return it=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},it.apply(this,arguments)},Rr=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,s;r<n;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))},rt={placement:"bottom",triggerType:"click",offsetSkidding:0,offsetDistance:10,delay:300,ignoreClickOutsideClass:!1,onShow:function(){},onHide:function(){},onToggle:function(){}},Iu={id:null,override:!0},cs=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=rt),n===void 0&&(n=Iu),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=it(it({},rt),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Dropdown",this,this._instanceId,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._popperInstance=this._createPopperInstance(),this._setupEventListeners(),this._initialized=!0)},i.prototype.destroy=function(){var e=this,t=this._getTriggerEvents();this._options.triggerType==="click"&&t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._clickHandler)}),this._options.triggerType==="hover"&&(t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hoverShowTriggerElHandler),e._targetEl.removeEventListener(r,e._hoverShowTargetElHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hoverHideHandler),e._targetEl.removeEventListener(r,e._hoverHideHandler)})),this._popperInstance.destroy(),this._initialized=!1},i.prototype.removeInstance=function(){I.removeInstance("Dropdown",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var e=this,t=this._getTriggerEvents();this._clickHandler=function(){e.toggle()},this._options.triggerType==="click"&&t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._clickHandler)}),this._hoverShowTriggerElHandler=function(r){r.type==="click"?e.toggle():setTimeout(function(){e.show()},e._options.delay)},this._hoverShowTargetElHandler=function(){e.show()},this._hoverHideHandler=function(){setTimeout(function(){e._targetEl.matches(":hover")||e.hide()},e._options.delay)},this._options.triggerType==="hover"&&(t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hoverShowTriggerElHandler),e._targetEl.addEventListener(r,e._hoverShowTargetElHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hoverHideHandler),e._targetEl.addEventListener(r,e._hoverHideHandler)}))},i.prototype._createPopperInstance=function(){return yt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[this._options.offsetSkidding,this._options.offsetDistance]}}]})},i.prototype._setupClickOutsideListener=function(){var e=this;this._clickOutsideEventListener=function(t){e._handleClickOutside(t,e._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(e,t){var r=e.target,n=this._options.ignoreClickOutsideClass,s=!1;if(n){var o=document.querySelectorAll(".".concat(n));o.forEach(function(a){if(a.contains(r)){s=!0;return}})}r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&!s&&this.isVisible()&&this.hide()},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","click"],hideEvents:["mouseleave"]};case"click":return{showEvents:["click"],hideEvents:[]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["click"],hideEvents:[]}}},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show(),this._options.onToggle(this)},i.prototype.isVisible=function(){return this._visible},i.prototype.show=function(){this._targetEl.classList.remove("hidden"),this._targetEl.classList.add("block"),this._popperInstance.setOptions(function(e){return it(it({},e),{modifiers:Rr(Rr([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("block"),this._targetEl.classList.add("hidden"),this._popperInstance.setOptions(function(e){return it(it({},e),{modifiers:Rr(Rr([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._visible=!1,this._removeClickOutsideListener(),this._options.onHide(this)},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Kt(){document.querySelectorAll("[data-dropdown-toggle]").forEach(function(i){var e=i.getAttribute("data-dropdown-toggle"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-dropdown-placement"),n=i.getAttribute("data-dropdown-offset-skidding"),s=i.getAttribute("data-dropdown-offset-distance"),o=i.getAttribute("data-dropdown-trigger"),a=i.getAttribute("data-dropdown-delay"),l=i.getAttribute("data-dropdown-ignore-click-outside-class");new cs(t,i,{placement:r||rt.placement,triggerType:o||rt.triggerType,offsetSkidding:n?parseInt(n):rt.offsetSkidding,offsetDistance:s?parseInt(s):rt.offsetDistance,delay:a?parseInt(a):rt.delay,ignoreClickOutsideClass:l||rt.ignoreClickOutsideClass})}else console.error('The dropdown element with id "'.concat(e,'" does not exist. Please check the data-dropdown-toggle attribute.'))})}typeof window<"u"&&(window.Dropdown=cs,window.initDropdowns=Kt);var us=cs;var Mr=function(){return Mr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Mr.apply(this,arguments)},Pr={placement:"center",backdropClasses:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-40",backdrop:"dynamic",closable:!0,onHide:function(){},onShow:function(){},onToggle:function(){}},Ou={id:null,override:!0},va=function(){function i(e,t,r){e===void 0&&(e=null),t===void 0&&(t=Pr),r===void 0&&(r=Ou),this._eventListenerInstances=[],this._instanceId=r.id?r.id:e.id,this._targetEl=e,this._options=Mr(Mr({},Pr),t),this._isHidden=!0,this._backdropEl=null,this._initialized=!1,this.init(),I.addInstance("Modal",this,this._instanceId,r.override)}return i.prototype.init=function(){var e=this;this._targetEl&&!this._initialized&&(this._getPlacementClasses().map(function(t){e._targetEl.classList.add(t)}),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this.removeAllEventListenerInstances(),this._destroyBackdropEl(),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Modal",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._createBackdrop=function(){var e;if(this._isHidden){var t=document.createElement("div");t.setAttribute("modal-backdrop",""),(e=t.classList).add.apply(e,this._options.backdropClasses.split(" ")),document.querySelector("body").append(t),this._backdropEl=t}},i.prototype._destroyBackdropEl=function(){this._isHidden||document.querySelector("[modal-backdrop]").remove()},i.prototype._setupModalCloseEventListeners=function(){var e=this;this._options.backdrop==="dynamic"&&(this._clickOutsideEventListener=function(t){e._handleOutsideClick(t.target)},this._targetEl.addEventListener("click",this._clickOutsideEventListener,!0)),this._keydownEventListener=function(t){t.key==="Escape"&&e.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeModalCloseEventListeners=function(){this._options.backdrop==="dynamic"&&this._targetEl.removeEventListener("click",this._clickOutsideEventListener,!0),document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._handleOutsideClick=function(e){(e===this._targetEl||e===this._backdropEl&&this.isVisible())&&this.hide()},i.prototype._getPlacementClasses=function(){switch(this._options.placement){case"top-left":return["justify-start","items-start"];case"top-center":return["justify-center","items-start"];case"top-right":return["justify-end","items-start"];case"center-left":return["justify-start","items-center"];case"center":return["justify-center","items-center"];case"center-right":return["justify-end","items-center"];case"bottom-left":return["justify-start","items-end"];case"bottom-center":return["justify-center","items-end"];case"bottom-right":return["justify-end","items-end"];default:return["justify-center","items-center"]}},i.prototype.toggle=function(){this._isHidden?this.show():this.hide(),this._options.onToggle(this)},i.prototype.show=function(){this.isHidden&&(this._targetEl.classList.add("flex"),this._targetEl.classList.remove("hidden"),this._targetEl.setAttribute("aria-modal","true"),this._targetEl.setAttribute("role","dialog"),this._targetEl.removeAttribute("aria-hidden"),this._createBackdrop(),this._isHidden=!1,this._options.closable&&this._setupModalCloseEventListeners(),document.body.classList.add("overflow-hidden"),this._options.onShow(this))},i.prototype.hide=function(){this.isVisible&&(this._targetEl.classList.add("hidden"),this._targetEl.classList.remove("flex"),this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.removeAttribute("aria-modal"),this._targetEl.removeAttribute("role"),this._destroyBackdropEl(),this._isHidden=!0,document.body.classList.remove("overflow-hidden"),this._options.closable&&this._removeModalCloseEventListeners(),this._options.onHide(this))},i.prototype.isVisible=function(){return!this._isHidden},i.prototype.isHidden=function(){return this._isHidden},i.prototype.addEventListenerInstance=function(e,t,r){this._eventListenerInstances.push({element:e,type:t,handler:r})},i.prototype.removeAllEventListenerInstances=function(){this._eventListenerInstances.map(function(e){e.element.removeEventListener(e.type,e.handler)}),this._eventListenerInstances=[]},i.prototype.getAllEventListenerInstances=function(){return this._eventListenerInstances},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Gt(){document.querySelectorAll("[data-modal-target]").forEach(function(i){var e=i.getAttribute("data-modal-target"),t=document.getElementById(e);if(t){var r=t.getAttribute("data-modal-placement"),n=t.getAttribute("data-modal-backdrop");new va(t,{placement:r||Pr.placement,backdrop:n||Pr.backdrop})}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?."))}),document.querySelectorAll("[data-modal-toggle]").forEach(function(i){var e=i.getAttribute("data-modal-toggle"),t=document.getElementById(e);if(t){var r=I.getInstance("Modal",e);if(r){var n=function(){r.toggle()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(e," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?"))}),document.querySelectorAll("[data-modal-show]").forEach(function(i){var e=i.getAttribute("data-modal-show"),t=document.getElementById(e);if(t){var r=I.getInstance("Modal",e);if(r){var n=function(){r.show()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(e," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?"))}),document.querySelectorAll("[data-modal-hide]").forEach(function(i){var e=i.getAttribute("data-modal-hide"),t=document.getElementById(e);if(t){var r=I.getInstance("Modal",e);if(r){var n=function(){r.hide()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(e," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(e," does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?"))})}typeof window<"u"&&(window.Modal=va,window.initModals=Gt);var Dr=function(){return Dr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Dr.apply(this,arguments)},wt={placement:"left",bodyScrolling:!1,backdrop:!0,edge:!1,edgeOffset:"bottom-[60px]",backdropClasses:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-30",onShow:function(){},onHide:function(){},onToggle:function(){}},Ru={id:null,override:!0},ba=function(){function i(e,t,r){e===void 0&&(e=null),t===void 0&&(t=wt),r===void 0&&(r=Ru),this._eventListenerInstances=[],this._instanceId=r.id?r.id:e.id,this._targetEl=e,this._options=Dr(Dr({},wt),t),this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Drawer",this,this._instanceId,r.override)}return i.prototype.init=function(){var e=this;this._targetEl&&!this._initialized&&(this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.classList.add("transition-transform"),this._getPlacementClasses(this._options.placement).base.map(function(t){e._targetEl.classList.add(t)}),this._handleEscapeKey=function(t){t.key==="Escape"&&e.isVisible()&&e.hide()},document.addEventListener("keydown",this._handleEscapeKey),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this.removeAllEventListenerInstances(),this._destroyBackdropEl(),document.removeEventListener("keydown",this._handleEscapeKey),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("Drawer",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){var e=this;this._options.edge?(this._getPlacementClasses(this._options.placement+"-edge").active.map(function(t){e._targetEl.classList.remove(t)}),this._getPlacementClasses(this._options.placement+"-edge").inactive.map(function(t){e._targetEl.classList.add(t)})):(this._getPlacementClasses(this._options.placement).active.map(function(t){e._targetEl.classList.remove(t)}),this._getPlacementClasses(this._options.placement).inactive.map(function(t){e._targetEl.classList.add(t)})),this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.removeAttribute("aria-modal"),this._targetEl.removeAttribute("role"),this._options.bodyScrolling||document.body.classList.remove("overflow-hidden"),this._options.backdrop&&this._destroyBackdropEl(),this._visible=!1,this._options.onHide(this)},i.prototype.show=function(){var e=this;this._options.edge?(this._getPlacementClasses(this._options.placement+"-edge").active.map(function(t){e._targetEl.classList.add(t)}),this._getPlacementClasses(this._options.placement+"-edge").inactive.map(function(t){e._targetEl.classList.remove(t)})):(this._getPlacementClasses(this._options.placement).active.map(function(t){e._targetEl.classList.add(t)}),this._getPlacementClasses(this._options.placement).inactive.map(function(t){e._targetEl.classList.remove(t)})),this._targetEl.setAttribute("aria-modal","true"),this._targetEl.setAttribute("role","dialog"),this._targetEl.removeAttribute("aria-hidden"),this._options.bodyScrolling||document.body.classList.add("overflow-hidden"),this._options.backdrop&&this._createBackdrop(),this._visible=!0,this._options.onShow(this)},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show()},i.prototype._createBackdrop=function(){var e,t=this;if(!this._visible){var r=document.createElement("div");r.setAttribute("drawer-backdrop",""),(e=r.classList).add.apply(e,this._options.backdropClasses.split(" ")),document.querySelector("body").append(r),r.addEventListener("click",function(){t.hide()})}},i.prototype._destroyBackdropEl=function(){this._visible&&document.querySelector("[drawer-backdrop]")!==null&&document.querySelector("[drawer-backdrop]").remove()},i.prototype._getPlacementClasses=function(e){switch(e){case"top":return{base:["top-0","left-0","right-0"],active:["transform-none"],inactive:["-translate-y-full"]};case"right":return{base:["right-0","top-0"],active:["transform-none"],inactive:["translate-x-full"]};case"bottom":return{base:["bottom-0","left-0","right-0"],active:["transform-none"],inactive:["translate-y-full"]};case"left":return{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]};case"bottom-edge":return{base:["left-0","top-0"],active:["transform-none"],inactive:["translate-y-full",this._options.edgeOffset]};default:return{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]}}},i.prototype.isHidden=function(){return!this._visible},i.prototype.isVisible=function(){return this._visible},i.prototype.addEventListenerInstance=function(e,t,r){this._eventListenerInstances.push({element:e,type:t,handler:r})},i.prototype.removeAllEventListenerInstances=function(){this._eventListenerInstances.map(function(e){e.element.removeEventListener(e.type,e.handler)}),this._eventListenerInstances=[]},i.prototype.getAllEventListenerInstances=function(){return this._eventListenerInstances},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Xt(){document.querySelectorAll("[data-drawer-target]").forEach(function(i){var e=i.getAttribute("data-drawer-target"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-drawer-placement"),n=i.getAttribute("data-drawer-body-scrolling"),s=i.getAttribute("data-drawer-backdrop"),o=i.getAttribute("data-drawer-edge"),a=i.getAttribute("data-drawer-edge-offset");new ba(t,{placement:r||wt.placement,bodyScrolling:n?n==="true":wt.bodyScrolling,backdrop:s?s==="true":wt.backdrop,edge:o?o==="true":wt.edge,edgeOffset:a||wt.edgeOffset})}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))}),document.querySelectorAll("[data-drawer-toggle]").forEach(function(i){var e=i.getAttribute("data-drawer-toggle"),t=document.getElementById(e);if(t){var r=I.getInstance("Drawer",e);if(r){var n=function(){r.toggle()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(e," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))}),document.querySelectorAll("[data-drawer-dismiss], [data-drawer-hide]").forEach(function(i){var e=i.getAttribute("data-drawer-dismiss")?i.getAttribute("data-drawer-dismiss"):i.getAttribute("data-drawer-hide"),t=document.getElementById(e);if(t){var r=I.getInstance("Drawer",e);if(r){var n=function(){r.hide()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(e," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id"))}),document.querySelectorAll("[data-drawer-show]").forEach(function(i){var e=i.getAttribute("data-drawer-show"),t=document.getElementById(e);if(t){var r=I.getInstance("Drawer",e);if(r){var n=function(){r.show()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(e," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(e," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))})}typeof window<"u"&&(window.Drawer=ba,window.initDrawers=Xt);var Fr=function(){return Fr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Fr.apply(this,arguments)},Br={defaultTabId:null,activeClasses:"text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500",inactiveClasses:"dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300",onShow:function(){}},Mu={id:null,override:!0},ya=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=[]),r===void 0&&(r=Br),n===void 0&&(n=Mu),this._instanceId=n.id?n.id:e.id,this._tabsEl=e,this._items=t,this._activeTab=r?this.getTab(r.defaultTabId):null,this._options=Fr(Fr({},Br),r),this._initialized=!1,this.init(),I.addInstance("Tabs",this,this._tabsEl.id,!0),I.addInstance("Tabs",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._items.length&&!this._initialized&&(this._activeTab||this.setActiveTab(this._items[0]),this.show(this._activeTab.id,!0),this._items.map(function(t){t.triggerEl.addEventListener("click",function(r){r.preventDefault(),e.show(t.id)})}))},i.prototype.destroy=function(){this._initialized&&(this._initialized=!1)},i.prototype.removeInstance=function(){this.destroy(),I.removeInstance("Tabs",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getActiveTab=function(){return this._activeTab},i.prototype.setActiveTab=function(e){this._activeTab=e},i.prototype.getTab=function(e){return this._items.filter(function(t){return t.id===e})[0]},i.prototype.show=function(e,t){var r,n,s=this;t===void 0&&(t=!1);var o=this.getTab(e);o===this._activeTab&&!t||(this._items.map(function(a){var l,d;a!==o&&((l=a.triggerEl.classList).remove.apply(l,s._options.activeClasses.split(" ")),(d=a.triggerEl.classList).add.apply(d,s._options.inactiveClasses.split(" ")),a.targetEl.classList.add("hidden"),a.triggerEl.setAttribute("aria-selected","false"))}),(r=o.triggerEl.classList).add.apply(r,this._options.activeClasses.split(" ")),(n=o.triggerEl.classList).remove.apply(n,this._options.inactiveClasses.split(" ")),o.triggerEl.setAttribute("aria-selected","true"),o.targetEl.classList.remove("hidden"),this.setActiveTab(o),this._options.onShow(this,o))},i.prototype.updateOnShow=function(e){this._options.onShow=e},i}();function Yt(){document.querySelectorAll("[data-tabs-toggle]").forEach(function(i){var e=[],t=i.getAttribute("data-tabs-active-classes"),r=i.getAttribute("data-tabs-inactive-classes"),n=null;i.querySelectorAll('[role="tab"]').forEach(function(s){var o=s.getAttribute("aria-selected")==="true",a={id:s.getAttribute("data-tabs-target"),triggerEl:s,targetEl:document.querySelector(s.getAttribute("data-tabs-target"))};e.push(a),o&&(n=a.id)}),new ya(i,e,{defaultTabId:n,activeClasses:t||Br.activeClasses,inactiveClasses:r||Br.inactiveClasses})})}typeof window<"u"&&(window.Tabs=ya,window.initTabs=Yt);var nt=function(){return nt=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},nt.apply(this,arguments)},Nr=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,s;r<n;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))},Hr={placement:"top",triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Pu={id:null,override:!0},wa=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Hr),n===void 0&&(n=Pu),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=nt(nt({},Hr),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Tooltip",this,this._instanceId,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._setupEventListeners(),this._popperInstance=this._createPopperInstance(),this._initialized=!0)},i.prototype.destroy=function(){var e=this;if(this._initialized){var t=this._getTriggerEvents();t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hideHandler)}),this._removeKeydownListener(),this._removeClickOutsideListener(),this._popperInstance&&this._popperInstance.destroy(),this._initialized=!1}},i.prototype.removeInstance=function(){I.removeInstance("Tooltip",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var e=this,t=this._getTriggerEvents();this._showHandler=function(){e.show()},this._hideHandler=function(){e.hide()},t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hideHandler)})},i.prototype._createPopperInstance=function(){return yt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[0,8]}}]})},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype._setupKeydownListener=function(){var e=this;this._keydownEventListener=function(t){t.key==="Escape"&&e.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeKeydownListener=function(){document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._setupClickOutsideListener=function(){var e=this;this._clickOutsideEventListener=function(t){e._handleClickOutside(t,e._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(e,t){var r=e.target;r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&this.isVisible()&&this.hide()},i.prototype.isVisible=function(){return this._visible},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show()},i.prototype.show=function(){this._targetEl.classList.remove("opacity-0","invisible"),this._targetEl.classList.add("opacity-100","visible"),this._popperInstance.setOptions(function(e){return nt(nt({},e),{modifiers:Nr(Nr([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._setupKeydownListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("opacity-100","visible"),this._targetEl.classList.add("opacity-0","invisible"),this._popperInstance.setOptions(function(e){return nt(nt({},e),{modifiers:Nr(Nr([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._removeClickOutsideListener(),this._removeKeydownListener(),this._visible=!1,this._options.onHide(this)},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Zt(){document.querySelectorAll("[data-tooltip-target]").forEach(function(i){var e=i.getAttribute("data-tooltip-target"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-tooltip-trigger"),n=i.getAttribute("data-tooltip-placement");new wa(t,i,{placement:n||Hr.placement,triggerType:r||Hr.triggerType})}else console.error('The tooltip element with id "'.concat(e,'" does not exist. Please check the data-tooltip-target attribute.'))})}typeof window<"u"&&(window.Tooltip=wa,window.initTooltips=Zt);var st=function(){return st=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},st.apply(this,arguments)},qr=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,s;r<n;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return i.concat(s||Array.prototype.slice.call(e))},Li={placement:"top",offset:10,triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Du={id:null,override:!0},Ea=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=Li),n===void 0&&(n=Du),this._instanceId=n.id?n.id:e.id,this._targetEl=e,this._triggerEl=t,this._options=st(st({},Li),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Popover",this,n.id?n.id:this._targetEl.id,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._setupEventListeners(),this._popperInstance=this._createPopperInstance(),this._initialized=!0)},i.prototype.destroy=function(){var e=this;if(this._initialized){var t=this._getTriggerEvents();t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._showHandler),e._targetEl.removeEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._hideHandler),e._targetEl.removeEventListener(r,e._hideHandler)}),this._removeKeydownListener(),this._removeClickOutsideListener(),this._popperInstance&&this._popperInstance.destroy(),this._initialized=!1}},i.prototype.removeInstance=function(){I.removeInstance("Popover",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var e=this,t=this._getTriggerEvents();this._showHandler=function(){e.show()},this._hideHandler=function(){setTimeout(function(){e._targetEl.matches(":hover")||e.hide()},100)},t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._showHandler),e._targetEl.addEventListener(r,e._showHandler)}),t.hideEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._hideHandler),e._targetEl.addEventListener(r,e._hideHandler)})},i.prototype._createPopperInstance=function(){return yt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[0,this._options.offset]}}]})},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype._setupKeydownListener=function(){var e=this;this._keydownEventListener=function(t){t.key==="Escape"&&e.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeKeydownListener=function(){document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._setupClickOutsideListener=function(){var e=this;this._clickOutsideEventListener=function(t){e._handleClickOutside(t,e._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(e,t){var r=e.target;r!==t&&!t.contains(r)&&!this._triggerEl.contains(r)&&this.isVisible()&&this.hide()},i.prototype.isVisible=function(){return this._visible},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show(),this._options.onToggle(this)},i.prototype.show=function(){this._targetEl.classList.remove("opacity-0","invisible"),this._targetEl.classList.add("opacity-100","visible"),this._popperInstance.setOptions(function(e){return st(st({},e),{modifiers:qr(qr([],e.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._setupKeydownListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("opacity-100","visible"),this._targetEl.classList.add("opacity-0","invisible"),this._popperInstance.setOptions(function(e){return st(st({},e),{modifiers:qr(qr([],e.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._removeClickOutsideListener(),this._removeKeydownListener(),this._visible=!1,this._options.onHide(this)},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Qt(){document.querySelectorAll("[data-popover-target]").forEach(function(i){var e=i.getAttribute("data-popover-target"),t=document.getElementById(e);if(t){var r=i.getAttribute("data-popover-trigger"),n=i.getAttribute("data-popover-placement"),s=i.getAttribute("data-popover-offset");new Ea(t,i,{placement:n||Li.placement,offset:s?parseInt(s):Li.offset,triggerType:r||Li.triggerType})}else console.error('The popover element with id "'.concat(e,'" does not exist. Please check the data-popover-target attribute.'))})}typeof window<"u"&&(window.Popover=Ea,window.initPopovers=Qt);var zr=function(){return zr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},zr.apply(this,arguments)},hs={triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},Fu={id:null,override:!0},_a=function(){function i(e,t,r,n,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=null),n===void 0&&(n=hs),s===void 0&&(s=Fu),this._instanceId=s.id?s.id:r.id,this._parentEl=e,this._triggerEl=t,this._targetEl=r,this._options=zr(zr({},hs),n),this._visible=!1,this._initialized=!1,this.init(),I.addInstance("Dial",this,this._instanceId,s.override)}return i.prototype.init=function(){var e=this;if(this._triggerEl&&this._targetEl&&!this._initialized){var t=this._getTriggerEventTypes(this._options.triggerType);this._showEventHandler=function(){e.show()},t.showEvents.forEach(function(r){e._triggerEl.addEventListener(r,e._showEventHandler),e._targetEl.addEventListener(r,e._showEventHandler)}),this._hideEventHandler=function(){e._parentEl.matches(":hover")||e.hide()},t.hideEvents.forEach(function(r){e._parentEl.addEventListener(r,e._hideEventHandler)}),this._initialized=!0}},i.prototype.destroy=function(){var e=this;if(this._initialized){var t=this._getTriggerEventTypes(this._options.triggerType);t.showEvents.forEach(function(r){e._triggerEl.removeEventListener(r,e._showEventHandler),e._targetEl.removeEventListener(r,e._showEventHandler)}),t.hideEvents.forEach(function(r){e._parentEl.removeEventListener(r,e._hideEventHandler)}),this._initialized=!1}},i.prototype.removeInstance=function(){I.removeInstance("Dial",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){this._targetEl.classList.add("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","false"),this._visible=!1,this._options.onHide(this)},i.prototype.show=function(){this._targetEl.classList.remove("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","true"),this._visible=!0,this._options.onShow(this)},i.prototype.toggle=function(){this._visible?this.hide():this.show()},i.prototype.isHidden=function(){return!this._visible},i.prototype.isVisible=function(){return this._visible},i.prototype._getTriggerEventTypes=function(e){switch(e){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype.updateOnShow=function(e){this._options.onShow=e},i.prototype.updateOnHide=function(e){this._options.onHide=e},i.prototype.updateOnToggle=function(e){this._options.onToggle=e},i}();function Jt(){document.querySelectorAll("[data-dial-init]").forEach(function(i){var e=i.querySelector("[data-dial-toggle]");if(e){var t=e.getAttribute("data-dial-toggle"),r=document.getElementById(t);if(r){var n=e.getAttribute("data-dial-trigger");new _a(i,e,r,{triggerType:n||hs.triggerType})}else console.error("Dial with id ".concat(t," does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?"))}else console.error("Dial with id ".concat(i.id," does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?"))})}typeof window<"u"&&(window.Dial=_a,window.initDials=Jt);var Vr=function(){return Vr=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},Vr.apply(this,arguments)},Aa={minValue:null,maxValue:null,onIncrement:function(){},onDecrement:function(){}},Bu={id:null,override:!0},Sa=function(){function i(e,t,r,n,s){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=null),n===void 0&&(n=Aa),s===void 0&&(s=Bu),this._instanceId=s.id?s.id:e.id,this._targetEl=e,this._incrementEl=t,this._decrementEl=r,this._options=Vr(Vr({},Aa),n),this._initialized=!1,this.init(),I.addInstance("InputCounter",this,this._instanceId,s.override)}return i.prototype.init=function(){var e=this;this._targetEl&&!this._initialized&&(this._inputHandler=function(t){{var r=t.target;/^\d*$/.test(r.value)||(r.value=r.value.replace(/[^\d]/g,"")),e._options.maxValue!==null&&parseInt(r.value)>e._options.maxValue&&(r.value=e._options.maxValue.toString()),e._options.minValue!==null&&parseInt(r.value)<e._options.minValue&&(r.value=e._options.minValue.toString())}},this._incrementClickHandler=function(){e.increment()},this._decrementClickHandler=function(){e.decrement()},this._targetEl.addEventListener("input",this._inputHandler),this._incrementEl&&this._incrementEl.addEventListener("click",this._incrementClickHandler),this._decrementEl&&this._decrementEl.addEventListener("click",this._decrementClickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._targetEl&&this._initialized&&(this._targetEl.removeEventListener("input",this._inputHandler),this._incrementEl&&this._incrementEl.removeEventListener("click",this._incrementClickHandler),this._decrementEl&&this._decrementEl.removeEventListener("click",this._decrementClickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("InputCounter",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getCurrentValue=function(){return parseInt(this._targetEl.value)||0},i.prototype.increment=function(){this._options.maxValue!==null&&this.getCurrentValue()>=this._options.maxValue||(this._targetEl.value=(this.getCurrentValue()+1).toString(),this._options.onIncrement(this))},i.prototype.decrement=function(){this._options.minValue!==null&&this.getCurrentValue()<=this._options.minValue||(this._targetEl.value=(this.getCurrentValue()-1).toString(),this._options.onDecrement(this))},i.prototype.updateOnIncrement=function(e){this._options.onIncrement=e},i.prototype.updateOnDecrement=function(e){this._options.onDecrement=e},i}();function ei(){document.querySelectorAll("[data-input-counter]").forEach(function(i){var e=i.id,t=document.querySelector('[data-input-counter-increment="'+e+'"]'),r=document.querySelector('[data-input-counter-decrement="'+e+'"]'),n=i.getAttribute("data-input-counter-min"),s=i.getAttribute("data-input-counter-max");i?I.instanceExists("InputCounter",i.getAttribute("id"))||new Sa(i,t||null,r||null,{minValue:n?parseInt(n):null,maxValue:s?parseInt(s):null}):console.error('The target element with id "'.concat(e,'" does not exist. Please check the data-input-counter attribute.'))})}typeof window<"u"&&(window.InputCounter=Sa,window.initInputCounters=ei);var $r=function(){return $r=Object.assign||function(i){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},$r.apply(this,arguments)},jr={htmlEntities:!1,contentType:"input",onCopy:function(){}},Nu={id:null,override:!0},Ta=function(){function i(e,t,r,n){e===void 0&&(e=null),t===void 0&&(t=null),r===void 0&&(r=jr),n===void 0&&(n=Nu),this._instanceId=n.id?n.id:t.id,this._triggerEl=e,this._targetEl=t,this._options=$r($r({},jr),r),this._initialized=!1,this.init(),I.addInstance("CopyClipboard",this,this._instanceId,n.override)}return i.prototype.init=function(){var e=this;this._targetEl&&this._triggerEl&&!this._initialized&&(this._triggerElClickHandler=function(){e.copy()},this._triggerEl&&this._triggerEl.addEventListener("click",this._triggerElClickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._targetEl&&this._initialized&&(this._triggerEl&&this._triggerEl.removeEventListener("click",this._triggerElClickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){I.removeInstance("CopyClipboard",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getTargetValue=function(){if(this._options.contentType==="input")return this._targetEl.value;if(this._options.contentType==="innerHTML")return this._targetEl.innerHTML;if(this._options.contentType==="textContent")return this._targetEl.textContent.replace(/\s+/g," ").trim()},i.prototype.copy=function(){var e=this.getTargetValue();this._options.htmlEntities&&(e=this.decodeHTML(e));var t=document.createElement("textarea");return t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),this._options.onCopy(this),e},i.prototype.decodeHTML=function(e){var t=document.createElement("textarea");return t.innerHTML=e,t.textContent},i.prototype.updateOnCopyCallback=function(e){this._options.onCopy=e},i}();function ti(){document.querySelectorAll("[data-copy-to-clipboard-target]").forEach(function(i){var e=i.getAttribute("data-copy-to-clipboard-target"),t=document.getElementById(e),r=i.getAttribute("data-copy-to-clipboard-content-type"),n=i.getAttribute("data-copy-to-clipboard-html-entities");t?I.instanceExists("CopyClipboard",t.getAttribute("id"))||new Ta(i,t,{htmlEntities:n&&n==="true"?!0:jr.htmlEntities,contentType:r||jr.contentType}):console.error('The target element with id "'.concat(e,'" does not exist. Please check the data-copy-to-clipboard-target attribute.'))})}typeof window<"u"&&(window.CopyClipboard=Ta,window.initClipboards=ti);function ka(){Nt(),Ht(),qt(),zt(),Kt(),Gt(),Xt(),Yt(),Zt(),Qt(),Jt(),ei(),ti()}typeof window<"u"&&(window.initFlowbite=ka);var Hu=new $o("load",[Nt,Ht,qt,zt,Kt,Gt,Xt,Yt,Zt,Qt,Jt,ei,ti]);Hu.init();var Ur=class extends T{static targets=["trigger","menu"];connect(){console.log(`resource-drop-down connected: ${this.element}`),this.dropdown=new us(this.menuTarget,this.triggerTarget)}disconnect(){this.dropdown=null}toggle(){this.dropdown.toggle()}show(){this.dropdown.show()}hide(){this.dropdown.hide()}};var Wr=class extends T{static targets=["trigger","menu"];connect(){console.log(`resource-collapse connected: ${this.element}`),this.element.hasAttribute("data-visible")||this.element.setAttribute("data-visible","false"),this.#e()}toggle(){let i=this.element.getAttribute("data-visible")==="true";this.element.setAttribute("data-visible",(!i).toString()),this.#e()}#e(){this.element.getAttribute("data-visible")==="true"?(this.menuTarget.classList.remove("hidden"),this.triggerTarget.setAttribute("aria-expanded","true"),this.dispatch("expand")):(this.menuTarget.classList.add("hidden"),this.triggerTarget.setAttribute("aria-expanded","false"),this.dispatch("collapse"))}};var Kr=class extends T{static values={after:Number};connect(){console.log(`resource-dismiss connected: ${this.element}`),this.hasAfterValue&&this.afterValue>0&&(this.autoDismissTimeout=setTimeout(()=>{this.dismiss(),this.autoDismissTimeout=null},this.afterValue))}disconnect(){this.autoDismissTimeout&&clearTimeout(this.autoDismissTimeout),this.autoDismissTimeout=null}dismiss(){this.element.remove()}};var Gr=class extends T{static targets=["frame","refreshButton","backButton","homeButton"];connect(){console.log(`frame-navigator connected: ${this.element}`),this.#e(),this.srcHistory=[],this.originalFrameSrc=this.frameTarget.src,this.hasRefreshButtonTarget&&(this.refreshButtonTarget.style.display="",this.refreshButtonClicked=this.refreshButtonClicked.bind(this),this.refreshButtonTarget.addEventListener("click",this.refreshButtonClicked)),this.hasBackButtonTarget&&(this.backButtonClicked=this.backButtonClicked.bind(this),this.backButtonTarget.addEventListener("click",this.backButtonClicked)),this.hasHomeButtonTarget&&(this.homeButtonClicked=this.homeButtonClicked.bind(this),this.homeButtonTarget.addEventListener("click",this.homeButtonClicked)),this.frameLoaded=this.frameLoaded.bind(this),this.frameTarget.addEventListener("turbo:frame-load",this.frameLoaded),this.frameLoading=this.frameLoading.bind(this),this.frameTarget.addEventListener("turbo:click",this.frameLoading),this.frameTarget.addEventListener("turbo:submit-start",this.frameLoading),this.frameFailed=this.frameFailed.bind(this),this.frameTarget.addEventListener("turbo:fetch-request-error",this.frameFailed)}disconnect(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.removeEventListener("click",this.refreshButtonClicked),this.hasBackButtonTarget&&this.backButtonTarget.removeEventListener("click",this.backButtonClicked),this.hasHomeButtonTarget&&this.homeButtonTarget.removeEventListener("click",this.homeButtonClicked),this.frameTarget.removeEventListener("turbo:frame-load",this.frameLoaded),this.frameTarget.removeEventListener("turbo:click",this.frameLoading),this.frameTarget.removeEventListener("turbo:submit-start",this.frameLoading),this.frameTarget.removeEventListener("turbo:fetch-request-error",this.frameFailed)}frameLoading(i){this.#e()}frameFailed(i){this.#t()}frameLoaded(i){this.#t();let e=i.target.src;e==this.currentSrc||(e==this.originalFrameSrc?this.srcHistory=[e]:this.srcHistory.push(e)),this.#i()}refreshButtonClicked(i){this.frameLoading(null),this.frameTarget.reload()}backButtonClicked(i){this.frameLoading(null),this.srcHistory.pop(),this.frameTarget.src=this.currentSrc}homeButtonClicked(i){this.frameLoading(null),this.frameTarget.src=this.originalFrameSrc}get currentSrc(){return this.srcHistory[this.srcHistory.length-1]}#e(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.add("motion-safe:animate-spin"),this.frameTarget.classList.add("motion-safe:animate-pulse")}#t(){this.hasRefreshButtonTarget&&this.refreshButtonTarget.classList.remove("motion-safe:animate-spin"),this.frameTarget.classList.remove("motion-safe:animate-pulse")}#i(){this.hasHomeButtonTarget&&(this.homeButtonTarget.style.display=this.srcHistory.length>2?"":"none"),this.hasBackButtonTarget&&(this.backButtonTarget.style.display=this.srcHistory.length>1?"":"none")}};var Xr=class extends T{connect(){console.log(`color-mode connected: ${this.element}`),this.updateColorMode()}disconnect(){}updateColorMode(){localStorage.theme==="dark"||!("theme"in localStorage)&&window.matchMedia("(prefers-color-scheme: dark)").matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}setLightColorMode(){localStorage.theme="light",this.updateColorMode()}setDarkColorMode(){localStorage.theme="dark",this.updateColorMode()}setSystemColorMode(){localStorage.removeItem("theme"),this.updateColorMode()}};var{entries:Fa,setPrototypeOf:xa,isFrozen:qu,getPrototypeOf:zu,getOwnPropertyDescriptor:Vu}=Object,{freeze:ve,seal:Te,create:Ba}=Object,{apply:vs,construct:bs}=typeof Reflect<"u"&&Reflect;ve||(ve=function(e){return e});Te||(Te=function(e){return e});vs||(vs=function(e,t,r){return e.apply(t,r)});bs||(bs=function(e,t){return new e(...t)});var Yr=Ee(Array.prototype.forEach),La=Ee(Array.prototype.pop),Ci=Ee(Array.prototype.push),Qr=Ee(String.prototype.toLowerCase),ds=Ee(String.prototype.toString),Ca=Ee(String.prototype.match),Ii=Ee(String.prototype.replace),$u=Ee(String.prototype.indexOf),ju=Ee(String.prototype.trim),Re=Ee(Object.prototype.hasOwnProperty),ge=Ee(RegExp.prototype.test),Oi=Uu(TypeError);function Ee(i){return function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return vs(i,e,r)}}function Uu(i){return function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return bs(i,t)}}function F(i,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qr;xa&&xa(i,null);let r=e.length;for(;r--;){let n=e[r];if(typeof n=="string"){let s=t(n);s!==n&&(qu(e)||(e[r]=s),n=s)}i[n]=!0}return i}function Wu(i){for(let e=0;e<i.length;e++)Re(i,e)||(i[e]=null);return i}function Et(i){let e=Ba(null);for(let[t,r]of Fa(i))Re(i,t)&&(Array.isArray(r)?e[t]=Wu(r):r&&typeof r=="object"&&r.constructor===Object?e[t]=Et(r):e[t]=r);return e}function Ri(i,e){for(;i!==null;){let r=Vu(i,e);if(r){if(r.get)return Ee(r.get);if(typeof r.value=="function")return Ee(r.value)}i=zu(i)}function t(){return null}return t}var Ia=ve(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ps=ve(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),fs=ve(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ku=ve(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ms=ve(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Gu=ve(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Oa=ve(["#text"]),Ra=ve(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),gs=ve(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ma=ve(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Zr=ve(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Xu=Te(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Yu=Te(/<%[\w\W]*|[\w\W]*%>/gm),Zu=Te(/\${[\w\W]*}/gm),Qu=Te(/^data-[\-\w.\u00B7-\uFFFF]/),Ju=Te(/^aria-[\-\w]+$/),Na=Te(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),eh=Te(/^(?:\w+script|data):/i),th=Te(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ha=Te(/^html$/i),ih=Te(/^[a-z][.\w]*(-[.\w]+)+$/i),Pa=Object.freeze({__proto__:null,ARIA_ATTR:Ju,ATTR_WHITESPACE:th,CUSTOM_ELEMENT:ih,DATA_ATTR:Qu,DOCTYPE_NAME:Ha,ERB_EXPR:Yu,IS_ALLOWED_URI:Na,IS_SCRIPT_OR_DATA:eh,MUSTACHE_EXPR:Xu,TMPLIT_EXPR:Zu}),Mi={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},rh=function(){return typeof window>"u"?null:window},nh=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(r=t.getAttribute(n));let s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},Da=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function qa(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rh(),e=L=>qa(L);if(e.version="3.2.2",e.removed=[],!i||!i.document||i.document.nodeType!==Mi.document)return e.isSupported=!1,e;let{document:t}=i,r=t,n=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:d,NamedNodeMap:p=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:m,DOMParser:E,trustedTypes:v}=i,C=l.prototype,_=Ri(C,"cloneNode"),k=Ri(C,"remove"),D=Ri(C,"nextSibling"),q=Ri(C,"childNodes"),B=Ri(C,"parentNode");if(typeof o=="function"){let L=t.createElement("template");L.content&&L.content.ownerDocument&&(t=L.content.ownerDocument)}let S,R="",{implementation:x,createNodeIterator:P,createDocumentFragment:N,getElementsByTagName:U}=t,{importNode:X}=r,z=Da();e.isSupported=typeof Fa=="function"&&typeof B=="function"&&x&&x.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Y,ERB_EXPR:W,TMPLIT_EXPR:ye,DATA_ATTR:xe,ARIA_ATTR:u,IS_SCRIPT_OR_DATA:h,ATTR_WHITESPACE:f,CUSTOM_ELEMENT:y}=Pa,{IS_ALLOWED_URI:w}=Pa,b=null,O=F({},[...Ia,...ps,...fs,...ms,...Oa]),M=null,ce=F({},[...Ra,...gs,...Ma,...Zr]),H=Object.seal(Ba(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),V=null,ne=null,de=!0,Le=!0,Ct=!1,It=!0,Je=!1,Ot=!0,ze=!1,fi=!1,Rt=!1,Ve=!1,Mt=!1,Pt=!1,Fe=!0,ct=!1,Ui="user-content-",Dt=!0,$e=!1,je={},Ue=null,mi=F({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),gi=null,co=F({},["audio","video","img","source","image","track"]),yn=null,uo=F({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Wi="http://www.w3.org/1998/Math/MathML",Ki="http://www.w3.org/2000/svg",We="http://www.w3.org/1999/xhtml",Ft=We,wn=!1,En=null,Sl=F({},[Wi,Ki,We],ds),Gi=F({},["mi","mo","mn","ms","mtext"]),Xi=F({},["annotation-xml"]),Tl=F({},["title","style","font","a","script"]),vi=null,kl=["application/xhtml+xml","text/html"],xl="text/html",se=null,Bt=null,Ll=t.createElement("form"),ho=function(c){return c instanceof RegExp||c instanceof Function},_n=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Bt&&Bt===c)){if((!c||typeof c!="object")&&(c={}),c=Et(c),vi=kl.indexOf(c.PARSER_MEDIA_TYPE)===-1?xl:c.PARSER_MEDIA_TYPE,se=vi==="application/xhtml+xml"?ds:Qr,b=Re(c,"ALLOWED_TAGS")?F({},c.ALLOWED_TAGS,se):O,M=Re(c,"ALLOWED_ATTR")?F({},c.ALLOWED_ATTR,se):ce,En=Re(c,"ALLOWED_NAMESPACES")?F({},c.ALLOWED_NAMESPACES,ds):Sl,yn=Re(c,"ADD_URI_SAFE_ATTR")?F(Et(uo),c.ADD_URI_SAFE_ATTR,se):uo,gi=Re(c,"ADD_DATA_URI_TAGS")?F(Et(co),c.ADD_DATA_URI_TAGS,se):co,Ue=Re(c,"FORBID_CONTENTS")?F({},c.FORBID_CONTENTS,se):mi,V=Re(c,"FORBID_TAGS")?F({},c.FORBID_TAGS,se):{},ne=Re(c,"FORBID_ATTR")?F({},c.FORBID_ATTR,se):{},je=Re(c,"USE_PROFILES")?c.USE_PROFILES:!1,de=c.ALLOW_ARIA_ATTR!==!1,Le=c.ALLOW_DATA_ATTR!==!1,Ct=c.ALLOW_UNKNOWN_PROTOCOLS||!1,It=c.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Je=c.SAFE_FOR_TEMPLATES||!1,Ot=c.SAFE_FOR_XML!==!1,ze=c.WHOLE_DOCUMENT||!1,Ve=c.RETURN_DOM||!1,Mt=c.RETURN_DOM_FRAGMENT||!1,Pt=c.RETURN_TRUSTED_TYPE||!1,Rt=c.FORCE_BODY||!1,Fe=c.SANITIZE_DOM!==!1,ct=c.SANITIZE_NAMED_PROPS||!1,Dt=c.KEEP_CONTENT!==!1,$e=c.IN_PLACE||!1,w=c.ALLOWED_URI_REGEXP||Na,Ft=c.NAMESPACE||We,Gi=c.MATHML_TEXT_INTEGRATION_POINTS||Gi,Xi=c.HTML_INTEGRATION_POINTS||Xi,H=c.CUSTOM_ELEMENT_HANDLING||{},c.CUSTOM_ELEMENT_HANDLING&&ho(c.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(H.tagNameCheck=c.CUSTOM_ELEMENT_HANDLING.tagNameCheck),c.CUSTOM_ELEMENT_HANDLING&&ho(c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(H.attributeNameCheck=c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),c.CUSTOM_ELEMENT_HANDLING&&typeof c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(H.allowCustomizedBuiltInElements=c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Je&&(Le=!1),Mt&&(Ve=!0),je&&(b=F({},Oa),M=[],je.html===!0&&(F(b,Ia),F(M,Ra)),je.svg===!0&&(F(b,ps),F(M,gs),F(M,Zr)),je.svgFilters===!0&&(F(b,fs),F(M,gs),F(M,Zr)),je.mathMl===!0&&(F(b,ms),F(M,Ma),F(M,Zr))),c.ADD_TAGS&&(b===O&&(b=Et(b)),F(b,c.ADD_TAGS,se)),c.ADD_ATTR&&(M===ce&&(M=Et(M)),F(M,c.ADD_ATTR,se)),c.ADD_URI_SAFE_ATTR&&F(yn,c.ADD_URI_SAFE_ATTR,se),c.FORBID_CONTENTS&&(Ue===mi&&(Ue=Et(Ue)),F(Ue,c.FORBID_CONTENTS,se)),Dt&&(b["#text"]=!0),ze&&F(b,["html","head","body"]),b.table&&(F(b,["tbody"]),delete V.tbody),c.TRUSTED_TYPES_POLICY){if(typeof c.TRUSTED_TYPES_POLICY.createHTML!="function")throw Oi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof c.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Oi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=c.TRUSTED_TYPES_POLICY,R=S.createHTML("")}else S===void 0&&(S=nh(v,n)),S!==null&&typeof R=="string"&&(R=S.createHTML(""));ve&&ve(c),Bt=c}},po=F({},[...ps,...fs,...Ku]),fo=F({},[...ms,...Gu]),Cl=function(c){let g=B(c);(!g||!g.tagName)&&(g={namespaceURI:Ft,tagName:"template"});let A=Qr(c.tagName),K=Qr(g.tagName);return En[c.namespaceURI]?c.namespaceURI===Ki?g.namespaceURI===We?A==="svg":g.namespaceURI===Wi?A==="svg"&&(K==="annotation-xml"||Gi[K]):!!po[A]:c.namespaceURI===Wi?g.namespaceURI===We?A==="math":g.namespaceURI===Ki?A==="math"&&Xi[K]:!!fo[A]:c.namespaceURI===We?g.namespaceURI===Ki&&!Xi[K]||g.namespaceURI===Wi&&!Gi[K]?!1:!fo[A]&&(Tl[A]||!po[A]):!!(vi==="application/xhtml+xml"&&En[c.namespaceURI]):!1},Be=function(c){Ci(e.removed,{element:c});try{B(c).removeChild(c)}catch{k(c)}},Yi=function(c,g){try{Ci(e.removed,{attribute:g.getAttributeNode(c),from:g})}catch{Ci(e.removed,{attribute:null,from:g})}if(g.removeAttribute(c),c==="is")if(Ve||Mt)try{Be(g)}catch{}else try{g.setAttribute(c,"")}catch{}},mo=function(c){let g=null,A=null;if(Rt)c="<remove></remove>"+c;else{let ue=Ca(c,/^[\r\n\t ]+/);A=ue&&ue[0]}vi==="application/xhtml+xml"&&Ft===We&&(c='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+c+"</body></html>");let K=S?S.createHTML(c):c;if(Ft===We)try{g=new E().parseFromString(K,vi)}catch{}if(!g||!g.documentElement){g=x.createDocument(Ft,"template",null);try{g.documentElement.innerHTML=wn?R:K}catch{}}let pe=g.body||g.documentElement;return c&&A&&pe.insertBefore(t.createTextNode(A),pe.childNodes[0]||null),Ft===We?U.call(g,ze?"html":"body")[0]:ze?g.documentElement:pe},go=function(c){return P.call(c.ownerDocument||c,c,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},vo=function(c){return c instanceof m&&(typeof c.nodeName!="string"||typeof c.textContent!="string"||typeof c.removeChild!="function"||!(c.attributes instanceof p)||typeof c.removeAttribute!="function"||typeof c.setAttribute!="function"||typeof c.namespaceURI!="string"||typeof c.insertBefore!="function"||typeof c.hasChildNodes!="function")},bo=function(c){return typeof a=="function"&&c instanceof a};function Ke(L,c,g){Yr(L,A=>{A.call(e,c,g,Bt)})}let yo=function(c){let g=null;if(Ke(z.beforeSanitizeElements,c,null),vo(c))return Be(c),!0;let A=se(c.nodeName);if(Ke(z.uponSanitizeElement,c,{tagName:A,allowedTags:b}),c.hasChildNodes()&&!bo(c.firstElementChild)&&ge(/<[/\w]/g,c.innerHTML)&&ge(/<[/\w]/g,c.textContent)||c.nodeType===Mi.progressingInstruction||Ot&&c.nodeType===Mi.comment&&ge(/<[/\w]/g,c.data))return Be(c),!0;if(!b[A]||V[A]){if(!V[A]&&Eo(A)&&(H.tagNameCheck instanceof RegExp&&ge(H.tagNameCheck,A)||H.tagNameCheck instanceof Function&&H.tagNameCheck(A)))return!1;if(Dt&&!Ue[A]){let K=B(c)||c.parentNode,pe=q(c)||c.childNodes;if(pe&&K){let ue=pe.length;for(let we=ue-1;we>=0;--we){let Ne=_(pe[we],!0);Ne.__removalCount=(c.__removalCount||0)+1,K.insertBefore(Ne,D(c))}}}return Be(c),!0}return c instanceof l&&!Cl(c)||(A==="noscript"||A==="noembed"||A==="noframes")&&ge(/<\/no(script|embed|frames)/i,c.innerHTML)?(Be(c),!0):(Je&&c.nodeType===Mi.text&&(g=c.textContent,Yr([Y,W,ye],K=>{g=Ii(g,K," ")}),c.textContent!==g&&(Ci(e.removed,{element:c.cloneNode()}),c.textContent=g)),Ke(z.afterSanitizeElements,c,null),!1)},wo=function(c,g,A){if(Fe&&(g==="id"||g==="name")&&(A in t||A in Ll))return!1;if(!(Le&&!ne[g]&&ge(xe,g))){if(!(de&&ge(u,g))){if(!M[g]||ne[g]){if(!(Eo(c)&&(H.tagNameCheck instanceof RegExp&&ge(H.tagNameCheck,c)||H.tagNameCheck instanceof Function&&H.tagNameCheck(c))&&(H.attributeNameCheck instanceof RegExp&&ge(H.attributeNameCheck,g)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(g))||g==="is"&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&ge(H.tagNameCheck,A)||H.tagNameCheck instanceof Function&&H.tagNameCheck(A))))return!1}else if(!yn[g]){if(!ge(w,Ii(A,f,""))){if(!((g==="src"||g==="xlink:href"||g==="href")&&c!=="script"&&$u(A,"data:")===0&&gi[c])){if(!(Ct&&!ge(h,Ii(A,f,"")))){if(A)return!1}}}}}}return!0},Eo=function(c){return c!=="annotation-xml"&&Ca(c,y)},_o=function(c){Ke(z.beforeSanitizeAttributes,c,null);let{attributes:g}=c;if(!g)return;let A={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M,forceKeepAttr:void 0},K=g.length;for(;K--;){let pe=g[K],{name:ue,namespaceURI:we,value:Ne}=pe,bi=se(ue),fe=ue==="value"?Ne:ju(Ne);if(A.attrName=bi,A.attrValue=fe,A.keepAttr=!0,A.forceKeepAttr=void 0,Ke(z.uponSanitizeAttribute,c,A),fe=A.attrValue,ct&&(bi==="id"||bi==="name")&&(Yi(ue,c),fe=Ui+fe),Ot&&ge(/((--!?|])>)|<\/(style|title)/i,fe)){Yi(ue,c);continue}if(A.forceKeepAttr||(Yi(ue,c),!A.keepAttr))continue;if(!It&&ge(/\/>/i,fe)){Yi(ue,c);continue}Je&&Yr([Y,W,ye],So=>{fe=Ii(fe,So," ")});let Ao=se(c.nodeName);if(wo(Ao,bi,fe)){if(S&&typeof v=="object"&&typeof v.getAttributeType=="function"&&!we)switch(v.getAttributeType(Ao,bi)){case"TrustedHTML":{fe=S.createHTML(fe);break}case"TrustedScriptURL":{fe=S.createScriptURL(fe);break}}try{we?c.setAttributeNS(we,ue,fe):c.setAttribute(ue,fe),vo(c)?Be(c):La(e.removed)}catch{}}}Ke(z.afterSanitizeAttributes,c,null)},Il=function L(c){let g=null,A=go(c);for(Ke(z.beforeSanitizeShadowDOM,c,null);g=A.nextNode();)Ke(z.uponSanitizeShadowNode,g,null),!yo(g)&&(g.content instanceof s&&L(g.content),_o(g));Ke(z.afterSanitizeShadowDOM,c,null)};return e.sanitize=function(L){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=null,A=null,K=null,pe=null;if(wn=!L,wn&&(L="<!-->"),typeof L!="string"&&!bo(L))if(typeof L.toString=="function"){if(L=L.toString(),typeof L!="string")throw Oi("dirty is not a string, aborting")}else throw Oi("toString is not a function");if(!e.isSupported)return L;if(fi||_n(c),e.removed=[],typeof L=="string"&&($e=!1),$e){if(L.nodeName){let Ne=se(L.nodeName);if(!b[Ne]||V[Ne])throw Oi("root node is forbidden and cannot be sanitized in-place")}}else if(L instanceof a)g=mo("<!---->"),A=g.ownerDocument.importNode(L,!0),A.nodeType===Mi.element&&A.nodeName==="BODY"||A.nodeName==="HTML"?g=A:g.appendChild(A);else{if(!Ve&&!Je&&!ze&&L.indexOf("<")===-1)return S&&Pt?S.createHTML(L):L;if(g=mo(L),!g)return Ve?null:Pt?R:""}g&&Rt&&Be(g.firstChild);let ue=go($e?L:g);for(;K=ue.nextNode();)yo(K)||(K.content instanceof s&&Il(K.content),_o(K));if($e)return L;if(Ve){if(Mt)for(pe=N.call(g.ownerDocument);g.firstChild;)pe.appendChild(g.firstChild);else pe=g;return(M.shadowroot||M.shadowrootmode)&&(pe=X.call(r,pe,!0)),pe}let we=ze?g.outerHTML:g.innerHTML;return ze&&b["!doctype"]&&g.ownerDocument&&g.ownerDocument.doctype&&g.ownerDocument.doctype.name&&ge(Ha,g.ownerDocument.doctype.name)&&(we="<!DOCTYPE "+g.ownerDocument.doctype.name+`>
|
6
|
+
`+we),Je&&Yr([Y,W,ye],Ne=>{we=Ii(we,Ne," ")}),S&&Pt?S.createHTML(we):we},e.setConfig=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};_n(L),fi=!0},e.clearConfig=function(){Bt=null,fi=!1},e.isValidAttribute=function(L,c,g){Bt||_n({});let A=se(L),K=se(c);return wo(A,K,g)},e.addHook=function(L,c){typeof c=="function"&&Ci(z[L],c)},e.removeHook=function(L){return La(z[L])},e.removeHooks=function(L){z[L]=[]},e.removeAllHooks=function(){z=Da()},e}var ys=qa();function _s(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var At=_s();function Wa(i){At=i}var Fi={exec:()=>null};function j(i,e=""){let t=typeof i=="string"?i:i.source,r={replace:(n,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(be.caret,"$1"),t=t.replace(n,o),r},getRegex:()=>new RegExp(t,e)};return r}var be={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i")},sh=/^(?:[ \t]*(?:\n|$))+/,oh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ah=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ni=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,lh=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ka=/(?:[*+-]|\d{1,9}[.)])/,Ga=j(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,Ka).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),As=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ch=/^[^\n]+/,Ss=/(?!\s*\])(?:\\.|[^\[\]\\])+/,uh=j(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ss).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),hh=j(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ka).getRegex(),tn="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ts=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,dh=j("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ts).replace("tag",tn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Xa=j(As).replace("hr",Ni).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",tn).getRegex(),ph=j(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Xa).getRegex(),ks={blockquote:ph,code:oh,def:uh,fences:ah,heading:lh,hr:Ni,html:dh,lheading:Ga,list:hh,newline:sh,paragraph:Xa,table:Fi,text:ch},za=j("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ni).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",tn).getRegex(),fh={...ks,table:za,paragraph:j(As).replace("hr",Ni).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",za).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",tn).getRegex()},mh={...ks,html:j(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ts).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Fi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:j(As).replace("hr",Ni).replace("heading",` *#{1,6} *[^
|
7
|
+
]`).replace("lheading",Ga).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ya=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,gh=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Za=/^( {2,}|\\)\n(?!\s*$)/,vh=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,rn=/[\p{P}\p{S}]/u,xs=/[\s\p{P}\p{S}]/u,Qa=/[^\s\p{P}\p{S}]/u,bh=j(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,xs).getRegex(),yh=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,wh=j(/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,"u").replace(/punct/g,rn).getRegex(),Eh=j("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,Qa).replace(/punctSpace/g,xs).replace(/punct/g,rn).getRegex(),_h=j("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Qa).replace(/punctSpace/g,xs).replace(/punct/g,rn).getRegex(),Ah=j(/\\(punct)/,"gu").replace(/punct/g,rn).getRegex(),Sh=j(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Th=j(Ts).replace("(?:-->|$)","-->").getRegex(),kh=j("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Th).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),en=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,xh=j(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",en).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ja=j(/^!?\[(label)\]\[(ref)\]/).replace("label",en).replace("ref",Ss).getRegex(),el=j(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ss).getRegex(),Lh=j("reflink|nolink(?!\\()","g").replace("reflink",Ja).replace("nolink",el).getRegex(),Ls={_backpedal:Fi,anyPunctuation:Ah,autolink:Sh,blockSkip:yh,br:Za,code:gh,del:Fi,emStrongLDelim:wh,emStrongRDelimAst:Eh,emStrongRDelimUnd:_h,escape:Ya,link:xh,nolink:el,punctuation:bh,reflink:Ja,reflinkSearch:Lh,tag:kh,text:vh,url:Fi},Ch={...Ls,link:j(/^!?\[(label)\]\((.*?)\)/).replace("label",en).getRegex(),reflink:j(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",en).getRegex()},ws={...Ls,escape:j(Ya).replace("])","~|])").getRegex(),url:j(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ih={...ws,br:j(Za).replace("{2,}","*").getRegex(),text:j(ws.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Jr={normal:ks,gfm:fh,pedantic:mh},Pi={normal:Ls,gfm:ws,breaks:Ih,pedantic:Ch},Oh={"&":"&","<":"<",">":">",'"':""","'":"'"},Va=i=>Oh[i];function He(i,e){if(e){if(be.escapeTest.test(i))return i.replace(be.escapeReplace,Va)}else if(be.escapeTestNoEncode.test(i))return i.replace(be.escapeReplaceNoEncode,Va);return i}function $a(i){try{i=encodeURI(i).replace(be.percentDecode,"%")}catch{return null}return i}function ja(i,e){let t=i.replace(be.findPipe,(s,o,a)=>{let l=!1,d=o;for(;--d>=0&&a[d]==="\\";)l=!l;return l?"|":" |"}),r=t.split(be.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(be.slashPipe,"|");return r}function Di(i,e,t){let r=i.length;if(r===0)return"";let n=0;for(;n<r;){let s=i.charAt(r-n-1);if(s===e&&!t)n++;else if(s!==e&&t)n++;else break}return i.slice(0,r-n)}function Rh(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<i.length;r++)if(i[r]==="\\")r++;else if(i[r]===e[0])t++;else if(i[r]===e[1]&&(t--,t<0))return r;return-1}function Ua(i,e,t,r,n){let s=e.href,o=e.title||null,a=i[1].replace(n.other.outputLinkReplace,"$1");if(i[0].charAt(0)!=="!"){r.state.inLink=!0;let l={type:"link",raw:t,href:s,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}return{type:"image",raw:t,href:s,title:o,text:a}}function Mh(i,e,t){let r=i.match(t.other.indentCodeCompensation);if(r===null)return e;let n=r[1];return e.split(`
|
8
8
|
`).map(s=>{let o=s.match(t.other.beginningSpace);if(o===null)return s;let[a]=o;return a.length>=n.length?s.slice(n.length):s}).join(`
|
9
9
|
`)}var ri=class{options;rules;lexer;constructor(e){this.options=e||At}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Di(r,`
|
10
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],n=
|
10
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let r=t[0],n=Mh(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){let n=Di(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Di(t[0],`
|
11
11
|
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let r=Di(t[0],`
|
12
12
|
`).split(`
|
13
13
|
`),n="",s="",o=[];for(;r.length>0;){let a=!1,l=[],d;for(d=0;d<r.length;d++)if(this.rules.other.blockquoteStart.test(r[d]))l.push(r[d]),a=!0;else if(!a)l.push(r[d]);else break;r=r.slice(d);let p=l.join(`
|
@@ -26,9 +26,9 @@ ${m}`:m;let E=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
26
26
|
`,1)[0],N;if(v=P,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),N=v):N=v.replace(this.rules.other.tabCharGlobal," "),S.test(v)||R.test(v)||x.test(v)||q.test(v)||B.test(v))break;if(N.search(this.rules.other.nonSpaceChar)>=_||!v.trim())m+=`
|
27
27
|
`+N.slice(_);else{if(C||E.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(E)||R.test(E)||B.test(E))break;m+=`
|
28
28
|
`+v}!C&&!v.trim()&&(C=!0),p+=P+`
|
29
|
-
`,e=e.substring(P.length+1),E=N.slice(_)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(a=!0));let k=null,D;this.options.gfm&&(k=this.rules.other.listIsTask.exec(m),k&&(D=k[0]!=="[ ] ",m=m.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:p,task:!!k,checked:D,loose:!1,text:m,tokens:[]}),s.raw+=p}let l=s.items.at(-1);l&&(l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd()),s.raw=s.raw.trimEnd();for(let d=0;d<s.items.length;d++)if(this.lexer.state.top=!1,s.items[d].tokens=this.lexer.blockTokens(s.items[d].text,[]),!s.loose){let p=s.items[d].tokens.filter(E=>E.type==="space"),m=p.length>0&&p.some(E=>this.rules.other.anyLine.test(E.raw));s.loose=m}if(s.loose)for(let d=0;d<s.items.length;d++)s.items[d].loose=!0;return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=
|
30
|
-
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?o.align.push("right"):this.rules.other.tableAlignCenter.test(a)?o.align.push("center"):this.rules.other.tableAlignLeft.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<r.length;a++)o.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:o.align[a]});for(let a of s)o.rows.push(
|
31
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=Di(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=
|
29
|
+
`,e=e.substring(P.length+1),E=N.slice(_)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(a=!0));let k=null,D;this.options.gfm&&(k=this.rules.other.listIsTask.exec(m),k&&(D=k[0]!=="[ ] ",m=m.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:p,task:!!k,checked:D,loose:!1,text:m,tokens:[]}),s.raw+=p}let l=s.items.at(-1);l&&(l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd()),s.raw=s.raw.trimEnd();for(let d=0;d<s.items.length;d++)if(this.lexer.state.top=!1,s.items[d].tokens=this.lexer.blockTokens(s.items[d].text,[]),!s.loose){let p=s.items[d].tokens.filter(E=>E.type==="space"),m=p.length>0&&p.some(E=>this.rules.other.anyLine.test(E.raw));s.loose=m}if(s.loose)for(let d=0;d<s.items.length;d++)s.items[d].loose=!0;return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=ja(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
30
|
+
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?o.align.push("right"):this.rules.other.tableAlignCenter.test(a)?o.align.push("center"):this.rules.other.tableAlignLeft.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<r.length;a++)o.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:o.align[a]});for(let a of s)o.rows.push(ja(a,o.header.length).map((l,d)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[d]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let r=t[1].charAt(t[1].length-1)===`
|
31
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let o=Di(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{let o=Rh(t[2],"()");if(o>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(n);o&&(n=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),Ua(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[n.toLowerCase()];if(!s){let o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return Ua(r,s,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(n[1]||n[2]||"")||!r||this.rules.inline.punctuation.exec(r)){let o=[...n[0]].length-1,a,l,d=o,p=0,m=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,t=t.slice(-1*e.length+o);(n=m.exec(t))!=null;){if(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!a)continue;if(l=[...a].length,n[3]||n[4]){d+=l;continue}else if((n[5]||n[6])&&o%3&&!((o+l)%3)){p+=l;continue}if(d-=l,d>0)continue;l=Math.min(l,l+d+p);let E=[...n[0]][0].length,v=e.slice(0,o+n.index+E+l);if(Math.min(o,l)%2){let _=v.slice(1,-1);return{type:"em",raw:v,text:_,tokens:this.lexer.inlineTokens(_)}}let C=v.slice(2,-2);return{type:"strong",raw:v,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=t[1],n="mailto:"+r):(r=t[1],n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,n;if(t[2]==="@")r=t[0],n="mailto:"+r;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);r=t[0],t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},Me=class i{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||At,this.options.tokenizer=this.options.tokenizer||new ri,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:be,block:Jr.normal,inline:Pi.normal};this.options.pedantic?(t.block=Jr.pedantic,t.inline=Pi.pedantic):this.options.gfm&&(t.block=Jr.gfm,this.options.breaks?t.inline=Pi.breaks:t.inline=Pi.gfm),this.tokenizer.rules=t}static get rules(){return{block:Jr,inline:Pi}}static lex(e,t){return new i(t).lex(e)}static lexInline(e,t){return new i(t).inlineTokens(e)}lex(e){e=e.replace(be.carriageReturn,`
|
32
32
|
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.options.pedantic&&(e=e.replace(be.tabCharGlobal," ").replace(be.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(o=>(n=o.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let o=t.at(-1);n.raw.length===1&&o!==void 0?o.raw+=`
|
33
33
|
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
34
34
|
`+n.raw,o.text+=`
|
@@ -56,11 +56,11 @@ ${this.parser.parse(e)}</blockquote>
|
|
56
56
|
`}tablerow({text:e}){return`<tr>
|
57
57
|
${e}</tr>
|
58
58
|
`}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
|
59
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${He(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),s
|
60
|
-
`+this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):r+=l;continue}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t=this.renderer){let r="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions?.renderers?.[s.type]){let a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=a||"";continue}}let o=s;switch(o.type){case"escape":{r+=t.text(o);break}case"html":{r+=t.html(o);break}case"link":{r+=t.link(o);break}case"image":{r+=t.image(o);break}case"strong":{r+=t.strong(o);break}case"em":{r+=t.em(o);break}case"codespan":{r+=t.codespan(o);break}case"br":{r+=t.br(o);break}case"del":{r+=t.del(o);break}case"text":{r+=t.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},ii=class{options;block;constructor(e){this.options=e||At}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Me.lex:Me.lexInline}provideParser(){return this.block?Pe.parse:Pe.parseInline}},
|
61
|
-
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+He(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},_t=new
|
59
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${He(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),s=$a(e);if(s===null)return n;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+He(t)+'"'),o+=">"+n+"</a>",o}image({href:e,title:t,text:r}){let n=$a(e);if(n===null)return He(r);e=n;let s=`<img src="${e}" alt="${r}"`;return t&&(s+=` title="${He(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:He(e.text)}},Bi=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Pe=class i{options;renderer;textRenderer;constructor(e){this.options=e||At,this.options.renderer=this.options.renderer||new ni,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Bi}static parse(e,t){return new i(t).parse(e)}static parseInline(e,t){return new i(t).parseInline(e)}parse(e,t=!0){let r="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions?.renderers?.[s.type]){let a=s,l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=l||"";continue}}let o=s;switch(o.type){case"space":{r+=this.renderer.space(o);continue}case"hr":{r+=this.renderer.hr(o);continue}case"heading":{r+=this.renderer.heading(o);continue}case"code":{r+=this.renderer.code(o);continue}case"table":{r+=this.renderer.table(o);continue}case"blockquote":{r+=this.renderer.blockquote(o);continue}case"list":{r+=this.renderer.list(o);continue}case"html":{r+=this.renderer.html(o);continue}case"paragraph":{r+=this.renderer.paragraph(o);continue}case"text":{let a=o,l=this.renderer.text(a);for(;n+1<e.length&&e[n+1].type==="text";)a=e[++n],l+=`
|
60
|
+
`+this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):r+=l;continue}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t=this.renderer){let r="";for(let n=0;n<e.length;n++){let s=e[n];if(this.options.extensions?.renderers?.[s.type]){let a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=a||"";continue}}let o=s;switch(o.type){case"escape":{r+=t.text(o);break}case"html":{r+=t.html(o);break}case"link":{r+=t.link(o);break}case"image":{r+=t.image(o);break}case"strong":{r+=t.strong(o);break}case"em":{r+=t.em(o);break}case"codespan":{r+=t.codespan(o);break}case"br":{r+=t.br(o);break}case"del":{r+=t.del(o);break}case"text":{r+=t.text(o);break}default:{let a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},ii=class{options;block;constructor(e){this.options=e||At}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Me.lex:Me.lexInline}provideParser(){return this.block?Pe.parse:Pe.parseInline}},Es=class{defaults=_s();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Pe;Renderer=ni;TextRenderer=Bi;Lexer=Me;Tokenizer=ri;Hooks=ii;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":{let s=n;for(let o of s.header)r=r.concat(this.walkTokens(o.tokens,t));for(let o of s.rows)for(let a of o)r=r.concat(this.walkTokens(a.tokens,t));break}case"list":{let s=n;r=r.concat(this.walkTokens(s.items,t));break}default:{let s=n;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(o=>{let a=s[o].flat(1/0);r=r.concat(this.walkTokens(a,t))}):s.tokens&&(r=r.concat(this.walkTokens(s.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=t.renderers[s.name];o?t.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),n.extensions=t),r.renderer){let s=this.defaults.renderer||new ni(this.defaults);for(let o in r.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,l=r.renderer[a],d=s[a];s[a]=(...p)=>{let m=l.apply(s,p);return m===!1&&(m=d.apply(s,p)),m||""}}n.renderer=s}if(r.tokenizer){let s=this.defaults.tokenizer||new ri(this.defaults);for(let o in r.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,l=r.tokenizer[a],d=s[a];s[a]=(...p)=>{let m=l.apply(s,p);return m===!1&&(m=d.apply(s,p)),m}}n.tokenizer=s}if(r.hooks){let s=this.defaults.hooks||new ii;for(let o in r.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,l=r.hooks[a],d=s[a];ii.passThroughHooks.has(o)?s[a]=p=>{if(this.defaults.async)return Promise.resolve(l.call(s,p)).then(E=>d.call(s,E));let m=l.call(s,p);return d.call(s,m)}:s[a]=(...p)=>{let m=l.apply(s,p);return m===!1&&(m=d.apply(s,p)),m}}n.hooks=s}if(r.walkTokens){let s=this.defaults.walkTokens,o=r.walkTokens;n.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),s&&(l=l.concat(s.call(this,a))),l}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Me.lex(e,t??this.defaults)}parser(e,t){return Pe.parse(e,t??this.defaults)}parseMarkdown(e){return(r,n)=>{let s={...n},o={...this.defaults,...s},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);let l=o.hooks?o.hooks.provideLexer():e?Me.lex:Me.lexInline,d=o.hooks?o.hooks.provideParser():e?Pe.parse:Pe.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(p=>l(p,o)).then(p=>o.hooks?o.hooks.processAllTokens(p):p).then(p=>o.walkTokens?Promise.all(this.walkTokens(p,o.walkTokens)).then(()=>p):p).then(p=>d(p,o)).then(p=>o.hooks?o.hooks.postprocess(p):p).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let p=l(r,o);o.hooks&&(p=o.hooks.processAllTokens(p)),o.walkTokens&&this.walkTokens(p,o.walkTokens);let m=d(p,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(p){return a(p)}}}onError(e,t){return r=>{if(r.message+=`
|
61
|
+
Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+He(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},_t=new Es;function $(i,e){return _t.parse(i,e)}$.options=$.setOptions=function(i){return _t.setOptions(i),$.defaults=_t.defaults,Wa($.defaults),$};$.getDefaults=_s;$.defaults=At;$.use=function(...i){return _t.use(...i),$.defaults=_t.defaults,Wa($.defaults),$};$.walkTokens=function(i,e){return _t.walkTokens(i,e)};$.parseInline=_t.parseInline;$.Parser=Pe;$.parser=Pe.parse;$.Renderer=ni;$.TextRenderer=Bi;$.Lexer=Me;$.lexer=Me.lex;$.Tokenizer=ri;$.Hooks=ii;$.parse=$;var Pw=$.options,Dw=$.setOptions,Fw=$.use,Bw=$.walkTokens,Nw=$.parseInline;var Hw=Pe.parse,qw=Me.lex;var nn=class extends T{connect(){console.log(`easymde connected: ${this.element}`),this.easyMDE=new EasyMDE(this.#e()),this.element.setAttribute("data-action","turbo:morph-element->easymde#reconnect")}disconnect(){this.easyMDE.toTextArea(),this.easyMDE=null}reconnect(){this.disconnect(),this.connect()}#e(){let i={element:this.element,promptURLs:!0,spellChecker:!1,previewRender:e=>{let t=ys.sanitize(e,{ALLOWED_TAGS:["strong","em","sub","sup","details","summary"],ALLOWED_ATTR:[]}),r=$(t);return ys.sanitize(r,{USE_PROFILES:{html:!0}})}};return this.element.attributes.id.value&&(i.autosave={enabled:!0,uniqueId:this.element.attributes.id.value,delay:1e3}),i}};var sn=class extends T{connect(){console.log(`slim-select connected: ${this.element}`),this.slimSelect=new SlimSelect({select:this.element}),this.element.setAttribute("data-action","turbo:morph-element->slim-select#reconnect")}disconnect(){this.slimSelect.destroy(),this.slimSelect=null}reconnect(){this.disconnect(),this.connect()}};var on=class extends T{connect(){console.log(`flatpickr connected: ${this.element}`),this.picker=new flatpickr(this.element,this.#e()),this.element.setAttribute("data-action","turbo:morph-element->flatpickr#reconnect")}disconnect(){this.picker.destroy(),this.picker=null}reconnect(){this.disconnect(),this.connect()}#e(){let i={altInput:!0};return this.element.attributes.type.value=="datetime-local"?i.enableTime=!0:this.element.attributes.type.value=="time"&&(i.enableTime=!0,i.noCalendar=!0),i}};var an=class extends T{static targets=["input"];connect(){console.log(`intl-tel-input connected: ${this.element}`)}disconnect(){this.inputTargetDisconnected()}inputTargetConnected(){this.hasInputTarget&&(this.iti=window.intlTelInput(this.inputTarget,this.#e()),this.inputTarget.setAttribute("data-action","turbo:morph-element->intl-tel-input#reconnect"))}inputTargetDisconnected(){this.iti&&this.iti.destroy(),this.iti=null}reconnect(){this.inputTargetDisconnected(),this.inputTargetConnected()}#e(){return{strictMode:!0,hiddenInput:()=>({phone:this.inputTarget.attributes.name.value}),loadUtilsOnInit:"https://cdn.jsdelivr.net/npm/intl-tel-input@24.8.1/build/js/utils.js"}}};function Cs(i){i.register("resource-layout",nr),i.register("nav-grid-menu-item",sr),i.register("nav-grid-menu",or),i.register("nav-user-section",ar),i.register("nav-user-link",lr),i.register("nav-user",cr),i.register("header",ur),i.register("sidebar-menu-item",hr),i.register("sidebar-menu",dr),i.register("sidebar",pr),i.register("has-many-panel",fr),i.register("nested-resource-form-fields",mr),i.register("toolbar",gr),i.register("table-search-input",vr),i.register("table-toolbar",br),i.register("table",yr),i.register("form",wr),i.register("resource-drop-down",Ur),i.register("resource-collapse",Wr),i.register("resource-dismiss",Kr),i.register("frame-navigator",Gr),i.register("color-mode",Xr),i.register("easymde",nn),i.register("slim-select",sn),i.register("flatpickr",on),i.register("intl-tel-input",an)}(function(i){if(typeof i.requestSubmit=="function")return;i.requestSubmit=function(r){r?(e(r,this),r.click()):(r=document.createElement("input"),r.type="submit",r.hidden=!0,this.appendChild(r),r.click(),this.removeChild(r))};function e(r,n){r instanceof HTMLElement||t(TypeError,"parameter 1 is not of type 'HTMLElement'"),r.type=="submit"||t(TypeError,"The specified element is not a submit button"),r.form==n||t(DOMException,"The specified element is not owned by this form element","NotFoundError")}function t(r,n,s){throw new r("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+n+".",s)}})(HTMLFormElement.prototype);var ol=new WeakMap;function Ph(i){let e=i instanceof Element?i:i instanceof Node?i.parentElement:null,t=e?e.closest("input, button"):null;return t?.type=="submit"?t:null}function Dh(i){let e=Ph(i.target);e&&e.form&&ol.set(e.form,e)}(function(){if("submitter"in Event.prototype)return;let i=window.Event.prototype;if("SubmitEvent"in window){let e=window.SubmitEvent.prototype;if(/Apple Computer/.test(navigator.vendor)&&!("submitter"in e))i=e;else return}addEventListener("click",Dh,!0),Object.defineProperty(i,"submitter",{get(){if(this.type=="submit"&&this.target instanceof HTMLFormElement)return ol.get(this.target)}})})();var oi={eager:"eager",lazy:"lazy"},qe=class i extends HTMLElement{static delegateConstructor=void 0;loaded=Promise.resolve();static get observedAttributes(){return["disabled","loading","src"]}constructor(){super(),this.delegate=new i.delegateConstructor(this)}connectedCallback(){this.delegate.connect()}disconnectedCallback(){this.delegate.disconnect()}reload(){return this.delegate.sourceURLReloaded()}attributeChangedCallback(e){e=="loading"?this.delegate.loadingStyleChanged():e=="src"?this.delegate.sourceURLChanged():e=="disabled"&&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 Fh(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 Fh(i){switch(i.toLowerCase()){case"lazy":return oi.lazy;default:return oi.eager}}function le(i){return new URL(i.toString(),document.baseURI)}function kt(i){let e;if(i.hash)return i.hash.slice(1);if(e=i.href.match(/#(.*)$/))return e[1]}function so(i,e){let t=e?.getAttribute("formaction")||i.getAttribute("action")||i.action;return le(t)}function Bh(i){return(Vh(i).match(/\.[^.]*$/)||[])[0]||""}function Nh(i){return!!Bh(i).match(/^(?:|\.(?:htm|html|xhtml|php))$/)}function Hh(i,e){let t=$h(e);return i.href===le(t).href||i.href.startsWith(t)}function ot(i,e){return Hh(i,e)&&Nh(i)}function Is(i){let e=kt(i);return e!=null?i.href.slice(0,-(e.length+1)):i.href}function ln(i){return Is(i)}function qh(i,e){return le(i).href==le(e).href}function zh(i){return i.pathname.split("/").slice(1)}function Vh(i){return zh(i).slice(-1)[0]}function $h(i){return jh(i.origin+i.pathname)}function jh(i){return i.endsWith("/")?i:i+"/"}var Hi=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 le(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 qi(i){if(i.getAttribute("data-turbo-eval")=="false")return i;{let e=document.createElement("script"),t=hi("csp-nonce");return t&&(e.nonce=t),e.textContent=i.textContent,e.async=!1,Uh(e,i),e}}function Uh(i,e){for(let{name:t,value:r}of e.attributes)i.setAttribute(t,r)}function Wh(i){let e=document.createElement("template");return e.innerHTML=i,e.content}function Q(i,{target:e,cancelable:t,detail:r}={}){let n=new CustomEvent(i,{cancelable:t,bubbles:!0,composed:!0,detail:r});return e&&e.isConnected?e.dispatchEvent(n):document.documentElement.dispatchEvent(n),n}function li(){return document.visibilityState==="hidden"?ll():al()}function al(){return new Promise(i=>requestAnimationFrame(()=>i()))}function ll(){return new Promise(i=>setTimeout(()=>i(),0))}function Kh(){return Promise.resolve()}function cl(i=""){return new DOMParser().parseFromString(i,"text/html")}function ul(i,...e){let t=Gh(i,e).replace(/^\n/,"").split(`
|
62
62
|
`),r=t[0].match(/^\s+/),n=r?r[0].length:0;return t.map(s=>s.slice(n)).join(`
|
63
|
-
`)}function Xh(i,e){return i.reduce((t,r,n)=>{let s=e[n]==null?"":e[n];return t+r+s},"")}function at(){return Array.from({length:36}).map((i,e)=>e==8||e==13||e==18||e==23?"-":e==14?"4":e==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}function hn(i,...e){for(let t of e.map(r=>r?.getAttribute(i)))if(typeof t=="string")return t;return null}function Yh(i,...e){return e.some(t=>t&&t.hasAttribute(i))}function dn(...i){for(let e of i)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function pn(...i){for(let e of i)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function Zh(i,e=2e3){return new Promise(t=>{let r=()=>{i.removeEventListener("error",r),i.removeEventListener("load",r),t()};i.addEventListener("load",r,{once:!0}),i.addEventListener("error",r,{once:!0}),setTimeout(t,e)})}function dl(i){switch(i){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function Qh(i){return i=="advance"||i=="replace"||i=="restore"}function xt(...i){let e=hn("data-turbo-action",...i);return Qh(e)?e:null}function pl(i){return document.querySelector(`meta[name="${i}"]`)}function hi(i){let e=pl(i);return e&&e.content}function Jh(i,e){let t=pl(i);return t||(t=document.createElement("meta"),t.setAttribute("name",i),document.head.appendChild(t)),t.setAttribute("content",e),t}function ci(i,e){if(i instanceof Element)return i.closest(e)||ci(i.assignedSlot||i.getRootNode()?.host,e)}function ao(i){return!!i&&i.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof i.focus=="function"}function fl(i){return Array.from(i.querySelectorAll("[autofocus]")).find(ao)}async function ed(i,e){let t=e();i(),await ll();let r=e();return[t,r]}function td(i){if(i.hasAttribute("target")){for(let e of document.getElementsByName(i.target))if(e instanceof HTMLIFrameElement)return!1}return!0}function id(i){return ci(i,"a[href]:not([target^=_]):not([download])")}function ml(i){return le(i.getAttribute("href")||"")}function rd(i,e){let t=null;return(...r)=>{let n=()=>i.apply(this,r);clearTimeout(t),t=setTimeout(n,e)}}var Rs=class extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){let r=this.values().next().value;this.delete(r)}super.add(e)}},gl=new Rs(20),nd=window.fetch;function vl(i,e={}){let t=new Headers(e.headers||{}),r=at();return gl.add(r),t.append("X-Turbo-Request-Id",r),nd(i,{...e,headers:t})}function lo(i){switch(i.toLowerCase()){case"get":return ke.get;case"post":return ke.post;case"put":return ke.put;case"patch":return ke.patch;case"delete":return ke.delete}}var ke={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function sd(i){switch(i.toLowerCase()){case Tt.multipart:return Tt.multipart;case Tt.plain:return Tt.plain;default:return Tt.urlEncoded}}var Tt={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"},Lt=class{abortController=new AbortController;#e=e=>{};constructor(e,t,r,n=new URLSearchParams,s=null,o=Tt.urlEncoded){let[a,l]=il(le(r),t,n,o);this.delegate=e,this.url=a,this.target=s,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t,headers:{...this.defaultHeaders},body:l,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=o}get method(){return this.fetchOptions.method}set method(e){let t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,r=lo(e)||ke.get;this.url.search="";let[n,s]=il(this.url,r,t,this.enctype);this.url=n,this.fetchOptions.body=s,this.fetchOptions.method=r}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(){let{fetchOptions:e}=this;this.delegate.prepareRequest(this);let t=await this.#t(e);try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=vl(this.url.href,e);let r=await this.response;return await this.receive(r)}catch(r){if(r.name!=="AbortError")throw this.#i(r)&&this.delegate.requestErrored(this,r),r}finally{this.delegate.requestFinished(this)}}async receive(e){let t=new Hi(e);return Q("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 co(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#t(e){let t=new Promise(n=>this.#e=n),r=Q("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#e},target:this.target});return this.url=r.detail.url,r.defaultPrevented&&await t,r}#i(e){return!Q("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}};function co(i){return lo(i)==ke.get}function il(i,e,t,r){let n=Array.from(t).length>0?new URLSearchParams(bl(t)):i.searchParams;return co(e)?[od(i,n),null]:r==Tt.urlEncoded?[i,n]:[i,t]}function bl(i){let e=[];for(let[t,r]of i)r instanceof File||e.push([t,r]);return e}function od(i,e){let t=new URLSearchParams(bl(e));return i.search=t.toString(),i}var Ms=class{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=>{e.slice(-1)[0]?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)}},lt=class{static contentType="text/vnd.turbo-stream.html";static wrap(e){return typeof e=="string"?new this(Kh(e)):e}constructor(e){this.fragment=ad(e)}};function ad(i){for(let e of i.querySelectorAll("turbo-stream")){let t=document.importNode(e,!0);for(let r of t.templateElement.content.querySelectorAll("script"))r.replaceWith(qi(r));e.replaceWith(t)}return i}var ld=100,Ps=class{#e=null;#t=null;get(e){if(this.#t&&this.#t.url===e&&this.#t.expire>Date.now())return this.#t.request}setLater(e,t,r){this.clear(),this.#e=setTimeout(()=>{t.perform(),this.set(e,t,r),this.#e=null},ld)}set(e,t,r){this.#t={url:e,request:t,expire:new Date(new Date().getTime()+r)}}clear(){this.#e&&clearTimeout(this.#e),this.#t=null}},cd=10*1e3,ai=new Ps,si={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"},zi=class i{state=si.initialized;static confirmMethod(e,t,r){return Promise.resolve(confirm(e))}constructor(e,t,r,n=!1){let s=md(t,r),o=fd(pd(t,r),s),a=ud(t,r),l=gd(t,r);this.delegate=e,this.formElement=t,this.submitter=r,this.fetchRequest=new Lt(this,s,o,a,t,l),this.mustRedirect=n}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=le(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(){let{initialized:e,requesting:t}=si,r=hn("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof r=="string"&&!await i.confirmMethod(r,this.formElement,this.submitter))&&this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:t}=si;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){let t=hd(hi("csrf-param"))||hi("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(lt.contentType)}requestStarted(e){this.state=si.waiting,this.submitter?.setAttribute("disabled",""),this.setSubmitsWith(),dn(this.formElement),Q("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){ai.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(ai.clear(),this.requestMustRedirect(e)&&dd(t)){let r=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,r)}else this.state=si.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=si.stopped,this.submitter?.removeAttribute("disabled"),this.resetSubmitterText(),pn(this.formElement),Q("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")){let e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}}resetSubmitterText(){if(!(!this.submitter||!this.originalSubmitText)){if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){let e=this.submitter;e.value=this.originalSubmitText}}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||Yh("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}};function ud(i,e){let t=new FormData(i),r=e?.getAttribute("name"),n=e?.getAttribute("value");return r&&t.append(r,n||""),t}function hd(i){if(i!=null){let t=(document.cookie?document.cookie.split("; "):[]).find(r=>r.startsWith(i));if(t){let r=t.split("=").slice(1).join("=");return r?decodeURIComponent(r):void 0}}}function dd(i){return i.statusCode==200&&!i.redirected}function pd(i,e){let t=typeof i.action=="string"?i.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":i.getAttribute("action")||t||""}function fd(i,e){let t=le(i);return co(e)&&(t.search=""),t}function md(i,e){let t=e?.getAttribute("formmethod")||i.getAttribute("method")||"";return lo(t.toLowerCase())||ke.get}function gd(i,e){return sd(e?.getAttribute("formenctype")||i.enctype)}var di=class{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return this.getElementForAnchor(e)!=null}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return fl(this.element)}get permanentElements(){return wl(this.element)}getPermanentElementById(e){return yl(this.element,e)}getPermanentElementMapForSnapshot(e){let t={};for(let r of this.permanentElements){let{id:n}=r,s=e.getPermanentElementById(n);s&&(t[n]=[r,s])}return t}};function yl(i,e){return i.querySelector(`#${e}[data-turbo-permanent]`)}function wl(i){return i.querySelectorAll("[id][data-turbo-permanent]")}var Vi=class{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){let t=e.target instanceof HTMLFormElement?e.target:void 0,r=e.submitter||void 0;t&&vd(t,r)&&bd(t,r)&&this.delegate.willSubmitForm(t,r)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,r))}}};function vd(i,e){return(e?.getAttribute("formmethod")||i.getAttribute("method"))!="dialog"}function bd(i,e){if(e?.hasAttribute("formtarget")||i.hasAttribute("target")){let t=e?.getAttribute("formtarget")||i.target;for(let r of document.getElementsByName(t))if(r instanceof HTMLIFrameElement)return!1;return!0}else return!0}var fn=class{#e=e=>{};#t=e=>{};constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){let t=this.snapshot.getElementForAnchor(e);t?(this.scrollToElement(t),this.focusElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(kt(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){let{isPreview:t,shouldRender:r,willRender:n,newSnapshot:s}=e,o=n;if(r)try{this.renderPromise=new Promise(p=>this.#e=p),this.renderer=e,await this.prepareToRenderSnapshot(e);let a=new Promise(p=>this.#t=p),l={resume:this.#t,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(s,l)||await a,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(s,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#e(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()}},Ds=class extends fn{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new di(this.element)}},mn=class{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){let t=e instanceof Element?e:e instanceof Node?e.parentElement:null;return t&&t.closest("turbo-frame, html")==this.element}},gn=class{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)){let t=e.composedPath&&e.composedPath()[0]||e.target,r=id(t);if(r&&td(r)){let n=ml(r);this.delegate.willFollowLinkToLocation(r,n,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(r,n))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}},vn=class{constructor(e,t){this.delegate=e,this.linkInterceptor=new gn(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,r){return this.delegate.willSubmitFormLinkToLocation(e,t,r)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,t){let r=document.createElement("form"),n="hidden";for(let[m,E]of t.searchParams)r.append(Object.assign(document.createElement("input"),{type:n,name:m,value:E}));let s=Object.assign(t,{search:""});r.setAttribute("data-turbo","true"),r.setAttribute("action",s.href),r.setAttribute("hidden","");let o=e.getAttribute("data-turbo-method");o&&r.setAttribute("method",o);let a=e.getAttribute("data-turbo-frame");a&&r.setAttribute("data-turbo-frame",a);let l=xt(e);l&&r.setAttribute("data-turbo-action",l);let d=e.getAttribute("data-turbo-confirm");d&&r.setAttribute("data-turbo-confirm",d),e.hasAttribute("data-turbo-stream")&&r.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,r),document.body.appendChild(r),r.addEventListener("turbo:submit-end",()=>r.remove(),{once:!0}),requestAnimationFrame(()=>r.requestSubmit())}},bn=class{static async preservingPermanentElements(e,t,r){let n=new this(e,t);n.enter(),await r(),n.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(let e in this.permanentElementMap){let[t,r]=this.permanentElementMap[e];this.delegate.enteringBardo(t,r),this.replaceNewPermanentElementWithPlaceholder(r)}}leave(){for(let e in this.permanentElementMap){let[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){let t=yd(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){let t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){this.getPlaceholderById(e.id)?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}};function yd(i){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",i.id),e}var $i=class{#e=null;constructor(e,t,r,n,s=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=n,this.willRender=s,this.renderElement=r,this.promise=new Promise((o,a)=>this.resolvingFunctions={resolve:o,reject:a})}get shouldRender(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await bn.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){let e=this.connectedSnapshot.firstAutofocusableElement;e&&e.focus()}enteringBardo(e){this.#e||e.contains(this.currentSnapshot.activeElement)&&(this.#e=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.#e)&&this.#e instanceof HTMLElement&&(this.#e.focus(),this.#e=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"}},ji=class extends $i{static renderElement(e,t){let r=document.createRange();r.selectNodeContents(e),r.deleteContents();let n=t,s=n.ownerDocument?.createRange();s&&(s.selectNodeContents(n),e.appendChild(s.extractContents()))}constructor(e,t,r,n,s,o=!0){super(t,r,n,s,o),this.delegate=e}get shouldRender(){return!0}async render(){await li(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await li(),this.focusFirstAutofocusableElement(),await li(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){let e=this.currentElement.firstElementChild,t=wd(this.currentElement.getAttribute("data-autoscroll-block"),"end"),r=Ed(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:t,behavior:r}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let t=qi(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function wd(i,e){return i=="end"||i=="start"||i=="center"||i=="nearest"?i:e}function Ed(i,e){return i=="auto"||i=="smooth"?i:e}var Fs=class i{static animationDuration=300;static get defaultCSS(){return hl`
|
63
|
+
`)}function Gh(i,e){return i.reduce((t,r,n)=>{let s=e[n]==null?"":e[n];return t+r+s},"")}function at(){return Array.from({length:36}).map((i,e)=>e==8||e==13||e==18||e==23?"-":e==14?"4":e==19?(Math.floor(Math.random()*4)+8).toString(16):Math.floor(Math.random()*15).toString(16)).join("")}function un(i,...e){for(let t of e.map(r=>r?.getAttribute(i)))if(typeof t=="string")return t;return null}function Xh(i,...e){return e.some(t=>t&&t.hasAttribute(i))}function hn(...i){for(let e of i)e.localName=="turbo-frame"&&e.setAttribute("busy",""),e.setAttribute("aria-busy","true")}function dn(...i){for(let e of i)e.localName=="turbo-frame"&&e.removeAttribute("busy"),e.removeAttribute("aria-busy")}function Yh(i,e=2e3){return new Promise(t=>{let r=()=>{i.removeEventListener("error",r),i.removeEventListener("load",r),t()};i.addEventListener("load",r,{once:!0}),i.addEventListener("error",r,{once:!0}),setTimeout(t,e)})}function hl(i){switch(i){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}function Zh(i){return i=="advance"||i=="replace"||i=="restore"}function xt(...i){let e=un("data-turbo-action",...i);return Zh(e)?e:null}function dl(i){return document.querySelector(`meta[name="${i}"]`)}function hi(i){let e=dl(i);return e&&e.content}function Qh(i,e){let t=dl(i);return t||(t=document.createElement("meta"),t.setAttribute("name",i),document.head.appendChild(t)),t.setAttribute("content",e),t}function ci(i,e){if(i instanceof Element)return i.closest(e)||ci(i.assignedSlot||i.getRootNode()?.host,e)}function oo(i){return!!i&&i.closest("[inert], :disabled, [hidden], details:not([open]), dialog:not([open])")==null&&typeof i.focus=="function"}function pl(i){return Array.from(i.querySelectorAll("[autofocus]")).find(oo)}async function Jh(i,e){let t=e();i(),await al();let r=e();return[t,r]}function ed(i){if(i.hasAttribute("target")){for(let e of document.getElementsByName(i.target))if(e instanceof HTMLIFrameElement)return!1}return!0}function td(i){return ci(i,"a[href]:not([target^=_]):not([download])")}function fl(i){return le(i.getAttribute("href")||"")}function id(i,e){let t=null;return(...r)=>{let n=()=>i.apply(this,r);clearTimeout(t),t=setTimeout(n,e)}}var Os=class extends Set{constructor(e){super(),this.maxSize=e}add(e){if(this.size>=this.maxSize){let r=this.values().next().value;this.delete(r)}super.add(e)}},ml=new Os(20),rd=window.fetch;function gl(i,e={}){let t=new Headers(e.headers||{}),r=at();return ml.add(r),t.append("X-Turbo-Request-Id",r),rd(i,{...e,headers:t})}function ao(i){switch(i.toLowerCase()){case"get":return ke.get;case"post":return ke.post;case"put":return ke.put;case"patch":return ke.patch;case"delete":return ke.delete}}var ke={get:"get",post:"post",put:"put",patch:"patch",delete:"delete"};function nd(i){switch(i.toLowerCase()){case Tt.multipart:return Tt.multipart;case Tt.plain:return Tt.plain;default:return Tt.urlEncoded}}var Tt={urlEncoded:"application/x-www-form-urlencoded",multipart:"multipart/form-data",plain:"text/plain"},Lt=class{abortController=new AbortController;#e=e=>{};constructor(e,t,r,n=new URLSearchParams,s=null,o=Tt.urlEncoded){let[a,l]=tl(le(r),t,n,o);this.delegate=e,this.url=a,this.target=s,this.fetchOptions={credentials:"same-origin",redirect:"follow",method:t,headers:{...this.defaultHeaders},body:l,signal:this.abortSignal,referrer:this.delegate.referrer?.href},this.enctype=o}get method(){return this.fetchOptions.method}set method(e){let t=this.isSafe?this.url.searchParams:this.fetchOptions.body||new FormData,r=ao(e)||ke.get;this.url.search="";let[n,s]=tl(this.url,r,t,this.enctype);this.url=n,this.fetchOptions.body=s,this.fetchOptions.method=r}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(){let{fetchOptions:e}=this;this.delegate.prepareRequest(this);let t=await this.#t(e);try{this.delegate.requestStarted(this),t.detail.fetchRequest?this.response=t.detail.fetchRequest.response:this.response=gl(this.url.href,e);let r=await this.response;return await this.receive(r)}catch(r){if(r.name!=="AbortError")throw this.#i(r)&&this.delegate.requestErrored(this,r),r}finally{this.delegate.requestFinished(this)}}async receive(e){let t=new Hi(e);return Q("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 lo(this.method)}get abortSignal(){return this.abortController.signal}acceptResponseType(e){this.headers.Accept=[e,this.headers.Accept].join(", ")}async#t(e){let t=new Promise(n=>this.#e=n),r=Q("turbo:before-fetch-request",{cancelable:!0,detail:{fetchOptions:e,url:this.url,resume:this.#e},target:this.target});return this.url=r.detail.url,r.defaultPrevented&&await t,r}#i(e){return!Q("turbo:fetch-request-error",{target:this.target,cancelable:!0,detail:{request:this,error:e}}).defaultPrevented}};function lo(i){return ao(i)==ke.get}function tl(i,e,t,r){let n=Array.from(t).length>0?new URLSearchParams(vl(t)):i.searchParams;return lo(e)?[sd(i,n),null]:r==Tt.urlEncoded?[i,n]:[i,t]}function vl(i){let e=[];for(let[t,r]of i)r instanceof File||e.push([t,r]);return e}function sd(i,e){let t=new URLSearchParams(vl(e));return i.search=t.toString(),i}var Rs=class{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=>{e.slice(-1)[0]?.isIntersecting&&this.delegate.elementAppearedInViewport(this.element)}},lt=class{static contentType="text/vnd.turbo-stream.html";static wrap(e){return typeof e=="string"?new this(Wh(e)):e}constructor(e){this.fragment=od(e)}};function od(i){for(let e of i.querySelectorAll("turbo-stream")){let t=document.importNode(e,!0);for(let r of t.templateElement.content.querySelectorAll("script"))r.replaceWith(qi(r));e.replaceWith(t)}return i}var ad=100,Ms=class{#e=null;#t=null;get(e){if(this.#t&&this.#t.url===e&&this.#t.expire>Date.now())return this.#t.request}setLater(e,t,r){this.clear(),this.#e=setTimeout(()=>{t.perform(),this.set(e,t,r),this.#e=null},ad)}set(e,t,r){this.#t={url:e,request:t,expire:new Date(new Date().getTime()+r)}}clear(){this.#e&&clearTimeout(this.#e),this.#t=null}},ld=10*1e3,ai=new Ms,si={initialized:"initialized",requesting:"requesting",waiting:"waiting",receiving:"receiving",stopping:"stopping",stopped:"stopped"},zi=class i{state=si.initialized;static confirmMethod(e,t,r){return Promise.resolve(confirm(e))}constructor(e,t,r,n=!1){let s=fd(t,r),o=pd(dd(t,r),s),a=cd(t,r),l=md(t,r);this.delegate=e,this.formElement=t,this.submitter=r,this.fetchRequest=new Lt(this,s,o,a,t,l),this.mustRedirect=n}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=le(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(){let{initialized:e,requesting:t}=si,r=un("data-turbo-confirm",this.submitter,this.formElement);if(!(typeof r=="string"&&!await i.confirmMethod(r,this.formElement,this.submitter))&&this.state==e)return this.state=t,this.fetchRequest.perform()}stop(){let{stopping:e,stopped:t}=si;if(this.state!=e&&this.state!=t)return this.state=e,this.fetchRequest.cancel(),!0}prepareRequest(e){if(!e.isSafe){let t=ud(hi("csrf-param"))||hi("csrf-token");t&&(e.headers["X-CSRF-Token"]=t)}this.requestAcceptsTurboStreamResponse(e)&&e.acceptResponseType(lt.contentType)}requestStarted(e){this.state=si.waiting,this.submitter?.setAttribute("disabled",""),this.setSubmitsWith(),hn(this.formElement),Q("turbo:submit-start",{target:this.formElement,detail:{formSubmission:this}}),this.delegate.formSubmissionStarted(this)}requestPreventedHandlingResponse(e,t){ai.clear(),this.result={success:t.succeeded,fetchResponse:t}}requestSucceededWithResponse(e,t){if(t.clientError||t.serverError){this.delegate.formSubmissionFailedWithResponse(this,t);return}if(ai.clear(),this.requestMustRedirect(e)&&hd(t)){let r=new Error("Form responses must redirect to another location");this.delegate.formSubmissionErrored(this,r)}else this.state=si.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=si.stopped,this.submitter?.removeAttribute("disabled"),this.resetSubmitterText(),dn(this.formElement),Q("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")){let e=this.submitter;this.originalSubmitText=e.value,e.value=this.submitsWith}}}resetSubmitterText(){if(!(!this.submitter||!this.originalSubmitText)){if(this.submitter.matches("button"))this.submitter.innerHTML=this.originalSubmitText;else if(this.submitter.matches("input")){let e=this.submitter;e.value=this.originalSubmitText}}}requestMustRedirect(e){return!e.isSafe&&this.mustRedirect}requestAcceptsTurboStreamResponse(e){return!e.isSafe||Xh("data-turbo-stream",this.submitter,this.formElement)}get submitsWith(){return this.submitter?.getAttribute("data-turbo-submits-with")}};function cd(i,e){let t=new FormData(i),r=e?.getAttribute("name"),n=e?.getAttribute("value");return r&&t.append(r,n||""),t}function ud(i){if(i!=null){let t=(document.cookie?document.cookie.split("; "):[]).find(r=>r.startsWith(i));if(t){let r=t.split("=").slice(1).join("=");return r?decodeURIComponent(r):void 0}}}function hd(i){return i.statusCode==200&&!i.redirected}function dd(i,e){let t=typeof i.action=="string"?i.action:null;return e?.hasAttribute("formaction")?e.getAttribute("formaction")||"":i.getAttribute("action")||t||""}function pd(i,e){let t=le(i);return lo(e)&&(t.search=""),t}function fd(i,e){let t=e?.getAttribute("formmethod")||i.getAttribute("method")||"";return ao(t.toLowerCase())||ke.get}function md(i,e){return nd(e?.getAttribute("formenctype")||i.enctype)}var di=class{constructor(e){this.element=e}get activeElement(){return this.element.ownerDocument.activeElement}get children(){return[...this.element.children]}hasAnchor(e){return this.getElementForAnchor(e)!=null}getElementForAnchor(e){return e?this.element.querySelector(`[id='${e}'], a[name='${e}']`):null}get isConnected(){return this.element.isConnected}get firstAutofocusableElement(){return pl(this.element)}get permanentElements(){return yl(this.element)}getPermanentElementById(e){return bl(this.element,e)}getPermanentElementMapForSnapshot(e){let t={};for(let r of this.permanentElements){let{id:n}=r,s=e.getPermanentElementById(n);s&&(t[n]=[r,s])}return t}};function bl(i,e){return i.querySelector(`#${e}[data-turbo-permanent]`)}function yl(i){return i.querySelectorAll("[id][data-turbo-permanent]")}var Vi=class{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){let t=e.target instanceof HTMLFormElement?e.target:void 0,r=e.submitter||void 0;t&&gd(t,r)&&vd(t,r)&&this.delegate.willSubmitForm(t,r)&&(e.preventDefault(),e.stopImmediatePropagation(),this.delegate.formSubmitted(t,r))}}};function gd(i,e){return(e?.getAttribute("formmethod")||i.getAttribute("method"))!="dialog"}function vd(i,e){if(e?.hasAttribute("formtarget")||i.hasAttribute("target")){let t=e?.getAttribute("formtarget")||i.target;for(let r of document.getElementsByName(t))if(r instanceof HTMLIFrameElement)return!1;return!0}else return!0}var pn=class{#e=e=>{};#t=e=>{};constructor(e,t){this.delegate=e,this.element=t}scrollToAnchor(e){let t=this.snapshot.getElementForAnchor(e);t?(this.scrollToElement(t),this.focusElement(t)):this.scrollToPosition({x:0,y:0})}scrollToAnchorFromLocation(e){this.scrollToAnchor(kt(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){let{isPreview:t,shouldRender:r,willRender:n,newSnapshot:s}=e,o=n;if(r)try{this.renderPromise=new Promise(p=>this.#e=p),this.renderer=e,await this.prepareToRenderSnapshot(e);let a=new Promise(p=>this.#t=p),l={resume:this.#t,render:this.renderer.renderElement,renderMethod:this.renderer.renderMethod};this.delegate.allowsImmediateRender(s,l)||await a,await this.renderSnapshot(e),this.delegate.viewRenderedSnapshot(s,t,this.renderer.renderMethod),this.delegate.preloadOnLoadLinksForView(this.element),this.finishRenderingSnapshot(e)}finally{delete this.renderer,this.#e(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()}},Ps=class extends pn{missing(){this.element.innerHTML='<strong class="turbo-frame-error">Content missing</strong>'}get snapshot(){return new di(this.element)}},fn=class{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){let t=e instanceof Element?e:e instanceof Node?e.parentElement:null;return t&&t.closest("turbo-frame, html")==this.element}},mn=class{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)){let t=e.composedPath&&e.composedPath()[0]||e.target,r=td(t);if(r&&ed(r)){let n=fl(r);this.delegate.willFollowLinkToLocation(r,n,e)&&(e.preventDefault(),this.delegate.followedLinkToLocation(r,n))}}};clickEventIsSignificant(e){return!(e.target&&e.target.isContentEditable||e.defaultPrevented||e.which>1||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)}},gn=class{constructor(e,t){this.delegate=e,this.linkInterceptor=new mn(this,t)}start(){this.linkInterceptor.start()}stop(){this.linkInterceptor.stop()}canPrefetchRequestToLocation(e,t){return!1}prefetchAndCacheRequestToLocation(e,t){}willFollowLinkToLocation(e,t,r){return this.delegate.willSubmitFormLinkToLocation(e,t,r)&&(e.hasAttribute("data-turbo-method")||e.hasAttribute("data-turbo-stream"))}followedLinkToLocation(e,t){let r=document.createElement("form"),n="hidden";for(let[m,E]of t.searchParams)r.append(Object.assign(document.createElement("input"),{type:n,name:m,value:E}));let s=Object.assign(t,{search:""});r.setAttribute("data-turbo","true"),r.setAttribute("action",s.href),r.setAttribute("hidden","");let o=e.getAttribute("data-turbo-method");o&&r.setAttribute("method",o);let a=e.getAttribute("data-turbo-frame");a&&r.setAttribute("data-turbo-frame",a);let l=xt(e);l&&r.setAttribute("data-turbo-action",l);let d=e.getAttribute("data-turbo-confirm");d&&r.setAttribute("data-turbo-confirm",d),e.hasAttribute("data-turbo-stream")&&r.setAttribute("data-turbo-stream",""),this.delegate.submittedFormLinkToLocation(e,t,r),document.body.appendChild(r),r.addEventListener("turbo:submit-end",()=>r.remove(),{once:!0}),requestAnimationFrame(()=>r.requestSubmit())}},vn=class{static async preservingPermanentElements(e,t,r){let n=new this(e,t);n.enter(),await r(),n.leave()}constructor(e,t){this.delegate=e,this.permanentElementMap=t}enter(){for(let e in this.permanentElementMap){let[t,r]=this.permanentElementMap[e];this.delegate.enteringBardo(t,r),this.replaceNewPermanentElementWithPlaceholder(r)}}leave(){for(let e in this.permanentElementMap){let[t]=this.permanentElementMap[e];this.replaceCurrentPermanentElementWithClone(t),this.replacePlaceholderWithPermanentElement(t),this.delegate.leavingBardo(t)}}replaceNewPermanentElementWithPlaceholder(e){let t=bd(e);e.replaceWith(t)}replaceCurrentPermanentElementWithClone(e){let t=e.cloneNode(!0);e.replaceWith(t)}replacePlaceholderWithPermanentElement(e){this.getPlaceholderById(e.id)?.replaceWith(e)}getPlaceholderById(e){return this.placeholders.find(t=>t.content==e)}get placeholders(){return[...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")]}};function bd(i){let e=document.createElement("meta");return e.setAttribute("name","turbo-permanent-placeholder"),e.setAttribute("content",i.id),e}var $i=class{#e=null;constructor(e,t,r,n,s=!0){this.currentSnapshot=e,this.newSnapshot=t,this.isPreview=n,this.willRender=s,this.renderElement=r,this.promise=new Promise((o,a)=>this.resolvingFunctions={resolve:o,reject:a})}get shouldRender(){return!0}get reloadReason(){}prepareToRender(){}render(){}finishRendering(){this.resolvingFunctions&&(this.resolvingFunctions.resolve(),delete this.resolvingFunctions)}async preservingPermanentElements(e){await vn.preservingPermanentElements(this,this.permanentElementMap,e)}focusFirstAutofocusableElement(){let e=this.connectedSnapshot.firstAutofocusableElement;e&&e.focus()}enteringBardo(e){this.#e||e.contains(this.currentSnapshot.activeElement)&&(this.#e=this.currentSnapshot.activeElement)}leavingBardo(e){e.contains(this.#e)&&this.#e instanceof HTMLElement&&(this.#e.focus(),this.#e=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"}},ji=class extends $i{static renderElement(e,t){let r=document.createRange();r.selectNodeContents(e),r.deleteContents();let n=t,s=n.ownerDocument?.createRange();s&&(s.selectNodeContents(n),e.appendChild(s.extractContents()))}constructor(e,t,r,n,s,o=!0){super(t,r,n,s,o),this.delegate=e}get shouldRender(){return!0}async render(){await li(),this.preservingPermanentElements(()=>{this.loadFrameElement()}),this.scrollFrameIntoView(),await li(),this.focusFirstAutofocusableElement(),await li(),this.activateScriptElements()}loadFrameElement(){this.delegate.willRenderFrame(this.currentElement,this.newElement),this.renderElement(this.currentElement,this.newElement)}scrollFrameIntoView(){if(this.currentElement.autoscroll||this.newElement.autoscroll){let e=this.currentElement.firstElementChild,t=yd(this.currentElement.getAttribute("data-autoscroll-block"),"end"),r=wd(this.currentElement.getAttribute("data-autoscroll-behavior"),"auto");if(e)return e.scrollIntoView({block:t,behavior:r}),!0}return!1}activateScriptElements(){for(let e of this.newScriptElements){let t=qi(e);e.replaceWith(t)}}get newScriptElements(){return this.currentElement.querySelectorAll("script")}};function yd(i,e){return i=="end"||i=="start"||i=="center"||i=="nearest"?i:e}function wd(i,e){return i=="auto"||i=="smooth"?i:e}var Ds=class i{static animationDuration=300;static get defaultCSS(){return ul`
|
64
64
|
.turbo-progress-bar {
|
65
65
|
position: fixed;
|
66
66
|
display: block;
|
@@ -74,7 +74,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error
|
|
74
74
|
opacity ${i.animationDuration/2}ms ${i.animationDuration/2}ms ease-in;
|
75
75
|
transform: translate3d(0, 0, 0);
|
76
76
|
}
|
77
|
-
`}hiding=!1;value=0;visible=!1;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,i.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,i.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}trickle=()=>{this.setValue(this.value+Math.random()/100)};refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){let e=document.createElement("style");return e.type="text/css",e.textContent=i.defaultCSS,this.cspNonce&&(e.nonce=this.cspNonce),e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}get cspNonce(){return hi("csp-nonce")}},Bs=class extends di{detailsByOuterHTML=this.children.filter(e=>!Td(e)).map(e=>Ld(e)).reduce((e,t)=>{let{outerHTML:r}=t,n=r in e?e[r]:{type:_d(t),tracked:Ad(t),elements:[]};return{...e,[r]:{...n,elements:[...n.elements,t]}}},{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter(r=>!(r in t.detailsByOuterHTML)).map(r=>this.detailsByOuterHTML[r]).filter(({type:r})=>r==e).map(({elements:[r]})=>r)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:r,tracked:n,elements:s}=this.detailsByOuterHTML[t];return r==null&&!n?[...e,...s]:s.length>1?[...e,...s.slice(1)]:e},[])}getMetaValue(e){let t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,r)=>{let{elements:[n]}=this.detailsByOuterHTML[r];return xd(n,e)?n:t},void 0|void 0)}};function _d(i){if(Sd(i))return"script";if(kd(i))return"stylesheet"}function Ad(i){return i.getAttribute("data-turbo-track")=="reload"}function Sd(i){return i.localName=="script"}function Td(i){return i.localName=="noscript"}function kd(i){let e=i.localName;return e=="style"||e=="link"&&i.getAttribute("rel")=="stylesheet"}function xd(i,e){return i.localName=="meta"&&i.getAttribute("name")==e}function Ld(i){return i.hasAttribute("nonce")&&i.setAttribute("nonce",""),i}var De=class i extends di{static fromHTMLString(e=""){return this.fromDocument(ul(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:r}){return new this(e,t,new Bs(r))}constructor(e,t,r){super(t),this.documentElement=e,this.headSnapshot=r}clone(){let e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),r=e.querySelectorAll("select");for(let[n,s]of t.entries()){let o=r[n];for(let a of o.selectedOptions)a.selected=!1;for(let a of s.selectedOptions)o.options[a.index].selected=!0}for(let n of e.querySelectorAll('input[type="password"]'))n.value="";return new i(this.documentElement,e,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get headElement(){return this.headSnapshot.element}get rootLocation(){let e=this.getSetting("root")??"/";return le(e)}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}get prefersViewTransitions(){return this.headSnapshot.getMetaValue("view-transition")==="same-origin"}get shouldMorphPage(){return this.getSetting("refresh-method")==="morph"}get shouldPreserveScrollPosition(){return this.getSetting("refresh-scroll")==="preserve"}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},Ns=class{#e=!1;#t=Promise.resolve();renderChange(e,t){return e&&this.viewTransitionsAvailable&&!this.#e?(this.#e=!0,this.#t=this.#t.then(async()=>{await document.startViewTransition(t).finished})):this.#t=this.#t.then(t),this.#t}get viewTransitionsAvailable(){return document.startViewTransition}},Cd={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},un={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},Qe={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},ui={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},Id={advance:"forward",restore:"back",replace:"none"},Hs=class{identifier=at();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=Qe.initialized;viewTransitioner=new Ns;constructor(e,t,r,n={}){this.delegate=e,this.location=t,this.restorationIdentifier=r||at();let{action:s,historyChanged:o,referrer:a,snapshot:l,snapshotHTML:d,response:p,visitCachedSnapshot:m,willRender:E,updateHistory:v,shouldCacheSnapshot:C,acceptsStreamResponse:_,direction:k}={...Cd,...n};this.action=s,this.historyChanged=o,this.referrer=a,this.snapshot=l,this.snapshotHTML=d,this.response=p,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=m,this.willRender=E,this.updateHistory=v,this.scrolled=!E,this.shouldCacheSnapshot=C,this.acceptsStreamResponse=_,this.direction=k||Id[s]}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==Qe.initialized&&(this.recordTimingMetric(un.visitStart),this.state=Qe.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==Qe.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=Qe.canceled)}complete(){this.state==Qe.started&&(this.recordTimingMetric(un.visitEnd),this.adapter.visitCompleted(this),this.state=Qe.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==Qe.started&&(this.state=Qe.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){let e=this.location.href===this.referrer?.href?"replace":this.action,t=dl(e);this.history.update(t,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new Lt(this,ke.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(un.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;rl(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(un.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,rl(e)&&t!=null){let r=De.fromHTMLString(t);await this.renderPageSnapshot(r,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(De.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!kt(this.location)||e.hasAnchor(kt(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return De.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){let e=this.getCachedSnapshot();if(e){let t=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage||this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(e,t),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&this.response?.redirected&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)})}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(lt.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let r=await t.responseHTML,{redirected:n,statusCode:s}=t;r==null?this.recordResponse({statusCode:ui.contentTypeMismatch,redirected:n}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:s,responseHTML:r,redirected:n}))}async requestFailedWithResponse(e,t){let r=await t.responseHTML,{redirected:n,statusCode:s}=t;r==null?this.recordResponse({statusCode:ui.contentTypeMismatch,redirected:n}):this.recordResponse({statusCode:s,responseHTML:r,redirected:n})}requestErrored(e,t){this.recordResponse({statusCode:ui.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){!this.scrolled&&!this.view.forceReloaded&&!this.view.shouldPreserveScrollPosition(this)&&(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=kt(this.location);if(e!=null)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=new Date().getTime()}getTimingMetrics(){return{...this.timingMetrics}}getHistoryMethodForAction(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return typeof this.response=="object"}shouldIssueRequest(){return this.isSamePage?!1:this.action=="restore"?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),this.frame=await li(),await e(),delete this.frame}async renderPageSnapshot(e,t){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(e),async()=>{await this.view.renderPage(e,t,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};function rl(i){return i>=200&&i<300}var qs=class{progressBar=new Fs;constructor(e){this.session=e}visitProposedToLocation(e,t){ot(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||at(),t):window.location.href=e.toString()}visitStarted(e){this.location=e.location,e.loadCachedSnapshot(),e.issueRequest(),e.goToSamePageAnchor()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||e.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case ui.networkFailure:case ui.timeoutFailure:case ui.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:t}});default:return e.loadResponse()}}visitRequestFinished(e){}visitCompleted(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(e){this.reload(e)}visitFailed(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(e){}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){this.formProgressBarTimeout==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}showProgressBar=()=>{this.progressBar.show()};reload(e){Q("turbo:reload",{detail:e}),window.location.href=this.location?.toString()||window.location.href}get navigator(){return this.session.navigator}},zs=class{selector="[data-turbo-temporary]";deprecatedSelector="[data-turbo-cache=false]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=e=>{for(let t of this.temporaryElements)t.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){let e=document.querySelectorAll(this.deprecatedSelector);return e.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...e]}},Vs=class{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new mn(this,t),this.formSubmitObserver=new Vi(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,r){return this.#t(e)}linkClickIntercepted(e,t,r){let n=this.#i(e);n&&n.delegate.linkClickIntercepted(e,t,r)}willSubmitForm(e,t){return e.closest("turbo-frame")==null&&this.#e(e,t)&&this.#t(e,t)}formSubmitted(e,t){let r=this.#i(e,t);r&&r.delegate.formSubmitted(e,t)}#e(e,t){let r=oo(e,t),n=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),s=le(n?.content??"/");return this.#t(e,t)&&ot(r,s)}#t(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){let n=this.#i(e,t);return n?n!=e.closest("turbo-frame"):!1}else return!1}#i(e,t){let r=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(r&&r!="_top"){let n=this.element.querySelector(`#${r}:not([disabled])`);if(n instanceof qe)return n}}},$s=class{location;restorationIdentifier=at();restorationData={};started=!1;pageLoaded=!1;currentIndex=0;constructor(e){this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,r=at()){e===history.pushState&&++this.currentIndex;let n={turbo:{restorationIdentifier:r,restorationIndex:this.currentIndex}};e.call(history,n,"",t.href),this.location=t,this.restorationIdentifier=r}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){let{restorationIdentifier:t}=this,r=this.restorationData[t];this.restorationData[t]={...r,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=e=>{if(this.shouldHandlePopState()){let{turbo:t}=e.state||{};if(t){this.location=new URL(window.location.href);let{restorationIdentifier:r,restorationIndex:n}=t;this.restorationIdentifier=r;let s=n>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,r,s),this.currentIndex=n}}};onPageLoad=async e=>{await Gh(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},js=class{started=!1;#e=null;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.readyState==="loading"?this.eventTarget.addEventListener("DOMContentLoaded",this.#t,{once:!0}):this.#t())}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#r,!0),this.started=!1)}#t=()=>{this.eventTarget.addEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#r,!0),this.started=!0};#i=e=>{if(hi("turbo-prefetch")==="false")return;let t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&this.#a(t)){let n=t,s=ml(n);if(this.delegate.canPrefetchRequestToLocation(n,s)){this.#e=n;let o=new Lt(this,ke.get,s,new URLSearchParams,t);ai.setLater(s.toString(),o,this.#o)}}};#n=e=>{e.target===this.#e&&this.#s()};#s=()=>{ai.clear(),this.#e=null};#r=e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="get"){let t=ai.get(e.detail.url.toString());t&&(e.detail.fetchRequest=t),ai.clear()}};prepareRequest(e){let t=e.target;e.headers["X-Sec-Purpose"]="prefetch";let r=t.closest("turbo-frame"),n=t.getAttribute("data-turbo-frame")||r?.getAttribute("target")||r?.id;n&&n!=="_top"&&(e.headers["Turbo-Frame"]=n)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#o(){return Number(hi("turbo-prefetch-cache-time"))||cd}#a(e){return!(!e.getAttribute("href")||Od(e)||Rd(e)||Md(e)||Pd(e)||Fd(e))}},Od=i=>i.origin!==document.location.origin||!["http:","https:"].includes(i.protocol)||i.hasAttribute("target"),Rd=i=>i.pathname+i.search===document.location.pathname+document.location.search||i.href.startsWith("#"),Md=i=>{if(i.getAttribute("data-turbo-prefetch")==="false"||i.getAttribute("data-turbo")==="false")return!0;let e=ci(i,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},Pd=i=>{let e=i.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||Dd(i)||i.hasAttribute("data-turbo-confirm")||i.hasAttribute("data-turbo-stream"))},Dd=i=>i.hasAttribute("data-remote")||i.hasAttribute("data-behavior")||i.hasAttribute("data-confirm")||i.hasAttribute("data-method"),Fd=i=>Q("turbo:before-prefetch",{target:i,cancelable:!0}).defaultPrevented,Us=class{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,r={}){this.stop(),this.currentVisit=new Hs(this,le(e),t,{referrer:this.location,...r}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new zi(this,e,t,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(e){typeof this.adapter.formSubmissionStarted=="function"&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){let r=await t.responseHTML;if(r){let n=e.isSafe;n||this.view.clearSnapshotCache();let{statusCode:s,redirected:o}=t,l={action:this.#e(e,t),shouldCacheSnapshot:n,response:{statusCode:s,responseHTML:r,redirected:o}};this.proposeVisit(t.location,l)}}}async formSubmissionFailedWithResponse(e,t){let r=await t.responseHTML;if(r){let n=De.fromHTMLString(r);t.serverError?await this.view.renderError(n,this.currentVisit):await this.view.renderPage(n,!1,!0,this.currentVisit),n.shouldPreserveScrollPosition||this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e)}locationWithActionIsSamePage(e,t){let r=kt(e),n=kt(this.view.lastRenderedLocation),s=t==="restore"&&typeof r>"u";return t!=="replace"&&Os(e)===Os(this.view.lastRenderedLocation)&&(s||r!=null&&r!==n)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#e(e,t){let{submitter:r,formElement:n}=e;return xt(r,n)||this.#t(t)}#t(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}},St={initial:0,loading:1,interactive:2,complete:3},Ws=class{stage=St.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==St.initial&&(this.stage=St.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=>{let{readyState:e}=this;e=="interactive"?this.pageIsInteractive():e=="complete"&&this.pageIsComplete()};pageIsInteractive(){this.stage==St.loading&&(this.stage=St.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==St.interactive&&(this.stage=St.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}},Ks=class{started=!1;constructor(e){this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}},Gs=class{render({fragment:e}){bn.preservingPermanentElements(this,Bd(e),()=>{Nd(e,()=>{Hd(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}};function Bd(i){let e=wl(document.documentElement),t={};for(let r of e){let{id:n}=r;for(let s of i.querySelectorAll("turbo-stream")){let o=yl(s.templateElement.content,n);o&&(t[n]=[r,o])}}return t}async function Nd(i,e){let t=`turbo-stream-autofocus-${at()}`,r=i.querySelectorAll("turbo-stream"),n=qd(r),s=null;if(n&&(n.id?s=n.id:s=t,n.id=s),e(),await li(),(document.activeElement==null||document.activeElement==document.body)&&s){let a=document.getElementById(s);ao(a)&&a.focus(),a&&a.id==t&&a.removeAttribute("id")}}async function Hd(i){let[e,t]=await ed(i,()=>document.activeElement),r=e&&e.id;if(r){let n=document.getElementById(r);ao(n)&&n!=t&&n.focus()}}function qd(i){for(let e of i){let t=fl(e.templateElement.content);if(t)return t}return null}var Xs=class{sources=new Set;#e=!1;constructor(e){this.delegate=e}start(){this.#e||(this.#e=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.#e&&(this.#e=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}inspectFetchResponse=e=>{let t=zd(e);t&&Vd(t)&&(e.preventDefault(),this.receiveMessageResponse(t))};receiveMessageEvent=e=>{this.#e&&typeof e.data=="string"&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){let t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(lt.wrap(e))}};function zd(i){let e=i.detail?.fetchResponse;if(e instanceof Hi)return e}function Vd(i){return(i.contentType??"").startsWith(lt.contentType)}var yn=class extends $i{static renderElement(e,t){let{documentElement:r,body:n}=document;r.replaceChild(t,n)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){let{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(let e of this.scriptElements){let t=e.parentNode;if(t){let r=qi(e);t.replaceChild(r,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}},$d=function(){let i=new Set,e={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:E,afterNodeAdded:E,beforeNodeMorphed:E,afterNodeMorphed:E,beforeNodeRemoved:E,afterNodeRemoved:E,beforeAttributeUpdated:E},head:{style:"merge",shouldPreserve:function(u){return u.getAttribute("im-preserve")==="true"},shouldReAppend:function(u){return u.getAttribute("im-re-append")==="true"},shouldRemove:E,afterHeadMorphed:E}};function t(u,h,f={}){u instanceof Document&&(u=u.documentElement),typeof h=="string"&&(h=S(h));let y=R(h),w=C(u,y,f);return r(u,y,w)}function r(u,h,f){if(f.head.block){let y=u.querySelector("head"),w=h.querySelector("head");if(y&&w){let b=m(w,y,f);Promise.all(b).then(function(){r(u,h,Object.assign(f,{head:{block:!1,ignore:!0}}))});return}}if(f.morphStyle==="innerHTML")return o(h,u,f),u.children;if(f.morphStyle==="outerHTML"||f.morphStyle==null){let y=P(h,u,f),w=y?.previousSibling,b=y?.nextSibling,O=s(u,y,f);return y?x(w,O,b):[]}else throw"Do not understand how to morph style "+f.morphStyle}function n(u,h){return h.ignoreActiveValue&&u===document.activeElement&&u!==document.body}function s(u,h,f){if(!(f.ignoreActive&&u===document.activeElement))return h==null?f.callbacks.beforeNodeRemoved(u)===!1?u:(u.remove(),f.callbacks.afterNodeRemoved(u),null):k(u,h)?(f.callbacks.beforeNodeMorphed(u,h)===!1||(u instanceof HTMLHeadElement&&f.head.ignore||(u instanceof HTMLHeadElement&&f.head.style!=="morph"?m(h,u,f):(l(h,u,f),n(u,f)||o(h,u,f))),f.callbacks.afterNodeMorphed(u,h)),u):f.callbacks.beforeNodeRemoved(u)===!1||f.callbacks.beforeNodeAdded(h)===!1?u:(u.parentElement.replaceChild(h,u),f.callbacks.afterNodeAdded(h),f.callbacks.afterNodeRemoved(u),h)}function o(u,h,f){let y=u.firstChild,w=h.firstChild,b;for(;y;){if(b=y,y=b.nextSibling,w==null){if(f.callbacks.beforeNodeAdded(b)===!1)return;h.appendChild(b),f.callbacks.afterNodeAdded(b),Y(f,b);continue}if(_(b,w,f)){s(w,b,f),w=w.nextSibling,Y(f,b);continue}let O=q(u,h,b,w,f);if(O){w=D(w,O,f),s(O,b,f),Y(f,b);continue}let M=B(u,h,b,w,f);if(M){w=D(w,M,f),s(M,b,f),Y(f,b);continue}if(f.callbacks.beforeNodeAdded(b)===!1)return;h.insertBefore(b,w),f.callbacks.afterNodeAdded(b),Y(f,b)}for(;w!==null;){let O=w;w=w.nextSibling,U(O,f)}}function a(u,h,f,y){return u==="value"&&y.ignoreActiveValue&&h===document.activeElement?!0:y.callbacks.beforeAttributeUpdated(u,h,f)===!1}function l(u,h,f){let y=u.nodeType;if(y===1){let w=u.attributes,b=h.attributes;for(let O of w)a(O.name,h,"update",f)||h.getAttribute(O.name)!==O.value&&h.setAttribute(O.name,O.value);for(let O=b.length-1;0<=O;O--){let M=b[O];a(M.name,h,"remove",f)||u.hasAttribute(M.name)||h.removeAttribute(M.name)}}(y===8||y===3)&&h.nodeValue!==u.nodeValue&&(h.nodeValue=u.nodeValue),n(h,f)||p(u,h,f)}function d(u,h,f,y){if(u[f]!==h[f]){let w=a(f,h,"update",y);w||(h[f]=u[f]),u[f]?w||h.setAttribute(f,u[f]):a(f,h,"remove",y)||h.removeAttribute(f)}}function p(u,h,f){if(u instanceof HTMLInputElement&&h instanceof HTMLInputElement&&u.type!=="file"){let y=u.value,w=h.value;d(u,h,"checked",f),d(u,h,"disabled",f),u.hasAttribute("value")?y!==w&&(a("value",h,"update",f)||(h.setAttribute("value",y),h.value=y)):a("value",h,"remove",f)||(h.value="",h.removeAttribute("value"))}else if(u instanceof HTMLOptionElement)d(u,h,"selected",f);else if(u instanceof HTMLTextAreaElement&&h instanceof HTMLTextAreaElement){let y=u.value,w=h.value;if(a("value",h,"update",f))return;y!==w&&(h.value=y),h.firstChild&&h.firstChild.nodeValue!==y&&(h.firstChild.nodeValue=y)}}function m(u,h,f){let y=[],w=[],b=[],O=[],M=f.head.style,ce=new Map;for(let V of u.children)ce.set(V.outerHTML,V);for(let V of h.children){let ne=ce.has(V.outerHTML),de=f.head.shouldReAppend(V),Le=f.head.shouldPreserve(V);ne||Le?de?w.push(V):(ce.delete(V.outerHTML),b.push(V)):M==="append"?de&&(w.push(V),O.push(V)):f.head.shouldRemove(V)!==!1&&w.push(V)}O.push(...ce.values());let H=[];for(let V of O){let ne=document.createRange().createContextualFragment(V.outerHTML).firstChild;if(f.callbacks.beforeNodeAdded(ne)!==!1){if(ne.href||ne.src){let de=null,Le=new Promise(function(Ct){de=Ct});ne.addEventListener("load",function(){de()}),H.push(Le)}h.appendChild(ne),f.callbacks.afterNodeAdded(ne),y.push(ne)}}for(let V of w)f.callbacks.beforeNodeRemoved(V)!==!1&&(h.removeChild(V),f.callbacks.afterNodeRemoved(V));return f.head.afterHeadMorphed(h,{added:y,kept:b,removed:w}),H}function E(){}function v(u){let h={};return Object.assign(h,e),Object.assign(h,u),h.callbacks={},Object.assign(h.callbacks,e.callbacks),Object.assign(h.callbacks,u.callbacks),h.head={},Object.assign(h.head,e.head),Object.assign(h.head,u.head),h}function C(u,h,f){return f=v(f),{target:u,newContent:h,config:f,morphStyle:f.morphStyle,ignoreActive:f.ignoreActive,ignoreActiveValue:f.ignoreActiveValue,idMap:xe(u,h),deadIds:new Set,callbacks:f.callbacks,head:f.head}}function _(u,h,f){return u==null||h==null?!1:u.nodeType===h.nodeType&&u.tagName===h.tagName?u.id!==""&&u.id===h.id?!0:W(f,u,h)>0:!1}function k(u,h){return u==null||h==null?!1:u.nodeType===h.nodeType&&u.tagName===h.tagName}function D(u,h,f){for(;u!==h;){let y=u;u=u.nextSibling,U(y,f)}return Y(f,h),h.nextSibling}function q(u,h,f,y,w){let b=W(w,f,h),O=null;if(b>0){let M=y,ce=0;for(;M!=null;){if(_(f,M,w))return M;if(ce+=W(w,M,u),ce>b)return null;M=M.nextSibling}}return O}function B(u,h,f,y,w){let b=y,O=f.nextSibling,M=0;for(;b!=null;){if(W(w,b,u)>0)return null;if(k(f,b))return b;if(k(O,b)&&(M++,O=O.nextSibling,M>=2))return null;b=b.nextSibling}return b}function S(u){let h=new DOMParser,f=u.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(f.match(/<\/html>/)||f.match(/<\/head>/)||f.match(/<\/body>/)){let y=h.parseFromString(u,"text/html");if(f.match(/<\/html>/))return y.generatedByIdiomorph=!0,y;{let w=y.firstChild;return w?(w.generatedByIdiomorph=!0,w):null}}else{let w=h.parseFromString("<body><template>"+u+"</template></body>","text/html").body.querySelector("template").content;return w.generatedByIdiomorph=!0,w}}function R(u){if(u==null)return document.createElement("div");if(u.generatedByIdiomorph)return u;if(u instanceof Node){let h=document.createElement("div");return h.append(u),h}else{let h=document.createElement("div");for(let f of[...u])h.append(f);return h}}function x(u,h,f){let y=[],w=[];for(;u!=null;)y.push(u),u=u.previousSibling;for(;y.length>0;){let b=y.pop();w.push(b),h.parentElement.insertBefore(b,h)}for(w.push(h);f!=null;)y.push(f),w.push(f),f=f.nextSibling;for(;y.length>0;)h.parentElement.insertBefore(y.pop(),h.nextSibling);return w}function P(u,h,f){let y;y=u.firstChild;let w=y,b=0;for(;y;){let O=N(y,h,f);O>b&&(w=y,b=O),y=y.nextSibling}return w}function N(u,h,f){return k(u,h)?.5+W(f,u,h):0}function U(u,h){Y(h,u),h.callbacks.beforeNodeRemoved(u)!==!1&&(u.remove(),h.callbacks.afterNodeRemoved(u))}function X(u,h){return!u.deadIds.has(h)}function z(u,h,f){return(u.idMap.get(f)||i).has(h)}function Y(u,h){let f=u.idMap.get(h)||i;for(let y of f)u.deadIds.add(y)}function W(u,h,f){let y=u.idMap.get(h)||i,w=0;for(let b of y)X(u,b)&&z(u,b,f)&&++w;return w}function ye(u,h){let f=u.parentElement,y=u.querySelectorAll("[id]");for(let w of y){let b=w;for(;b!==f&&b!=null;){let O=h.get(b);O==null&&(O=new Set,h.set(b,O)),O.add(w.id),b=b.parentElement}}}function xe(u,h){let f=new Map;return ye(u,f),ye(h,f),f}return{morph:t,defaults:e}}(),pi=class extends $i{static renderElement(e,t){document.body&&t instanceof HTMLBodyElement?document.body.replaceWith(t):document.documentElement.appendChild(t)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){if(!this.newSnapshot.isVisitable)return{reason:"turbo_visit_control_is_reload"};if(!this.trackedElementsAreIdentical)return{reason:"tracked_element_mismatch"}}async prepareToRender(){this.#e(),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#e(){let{documentElement:e}=this.currentSnapshot,{lang:t}=this.newSnapshot;t?e.setAttribute("lang",t):e.removeAttribute("lang")}async mergeHead(){let e=this.mergeProvisionalElements(),t=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await e,await t,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){let e=[];for(let t of this.newHeadStylesheetElements)e.push(Zh(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(qi(e))}removeUnusedDynamicStylesheetElements(){for(let e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){let e=[...this.newHeadProvisionalElements];for(let t of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(t,e)||document.head.removeChild(t);for(let t of e)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(let[r,n]of t.entries()){if(e.tagName=="TITLE"){if(n.tagName!="TITLE")continue;if(e.innerHTML==n.innerHTML)return t.splice(r,1),!0}if(n.isEqualNode(e))return t.splice(r,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(let e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let t=qi(e);e.replaceWith(t)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(e=>e.getAttribute("data-turbo-track")==="dynamic")}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}},Ys=class extends pi{async render(){this.willRender&&await this.#e()}get renderMethod(){return"morph"}async#e(){this.#t(this.currentElement,this.newElement),this.#a(),Q("turbo:morph",{detail:{currentElement:this.currentElement,newElement:this.newElement}})}#t(e,t,r="outerHTML"){this.isMorphingTurboFrame=this.#l(e),$d.morph(e,t,{morphStyle:r,callbacks:{beforeNodeAdded:this.#i,beforeNodeMorphed:this.#n,beforeAttributeUpdated:this.#s,beforeNodeRemoved:this.#o,afterNodeMorphed:this.#r}})}#i=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));#n=(e,t)=>{if(e instanceof HTMLElement)return!e.hasAttribute("data-turbo-permanent")&&(this.isMorphingTurboFrame||!this.#l(e))?!Q("turbo:before-morph-element",{cancelable:!0,target:e,detail:{newElement:t}}).defaultPrevented:!1};#s=(e,t,r)=>!Q("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:r}}).defaultPrevented;#r=(e,t)=>{t instanceof HTMLElement&&Q("turbo:morph-element",{target:e,detail:{newElement:t}})};#o=e=>this.#n(e);#a(){this.#d().forEach(e=>{this.#l(e)&&(this.#u(e),e.reload())})}#u(e){e.addEventListener("turbo:before-frame-render",t=>{t.detail.render=this.#h},{once:!0})}#h=(e,t)=>{Q("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),this.#t(e,t.children,"innerHTML")};#l(e){return e.src&&e.refresh==="morph"}#d(){return Array.from(document.querySelectorAll("turbo-frame[src]")).filter(e=>!e.closest("[data-turbo-permanent]"))}},Zs=class{keys=[];snapshots={};constructor(e){this.size=e}has(e){return cn(e)in this.snapshots}get(e){if(this.has(e)){let t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){this.snapshots={}}read(e){return this.snapshots[cn(e)]}write(e,t){this.snapshots[cn(e)]=t}touch(e){let t=cn(e),r=this.keys.indexOf(t);r>-1&&this.keys.splice(r,1),this.keys.unshift(t),this.trim()}trim(){for(let e of this.keys.splice(this.size))delete this.snapshots[e]}},Qs=class extends fn{snapshotCache=new Zs(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,r=!0,n){let o=this.isPageRefresh(n)&&this.snapshot.shouldMorphPage?Ys:pi,a=new o(this.snapshot,e,pi.renderElement,t,r);return a.shouldRender?n?.changeHistory():this.forceReloaded=!0,this.render(a)}renderError(e,t){t?.changeHistory();let r=new yn(this.snapshot,e,yn.renderElement,!1);return this.render(r)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();let{lastRenderedLocation:t}=this;await cl();let r=e.clone();return this.snapshotCache.put(t,r),r}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}isPageRefresh(e){return!e||this.lastRenderedLocation.pathname===e.location.pathname&&e.action==="replace"}shouldPreserveScrollPosition(e){return this.isPageRefresh(e)&&this.snapshot.shouldPreserveScrollPosition}get snapshot(){return De.fromElement(this.element)}},Js=class{selector="a[data-turbo-preload]";constructor(e,t){this.delegate=e,this.snapshotCache=t}start(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.#e):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",this.#e)}preloadOnLoadLinksForView(e){for(let t of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(t)&&this.preloadURL(t)}async preloadURL(e){let t=new URL(e.href);if(this.snapshotCache.has(t))return;await new Lt(this,ke.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{let r=await t.responseHTML,n=De.fromHTMLString(r);this.snapshotCache.put(e.url,n)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#e=()=>{this.preloadOnLoadLinksForView(document.body)}},eo=class{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.#e("")}exemptPageFromCache(){this.#e("no-cache")}exemptPageFromPreview(){this.#e("no-preview")}#e(e){Jh("turbo-cache-control",e)}},to=class{navigator=new Us(this);history=new $s(this);view=new Qs(this,document.documentElement);adapter=new qs(this);pageObserver=new Ws(this);cacheObserver=new zs;linkPrefetchObserver=new js(this,document);linkClickObserver=new gn(this,window);formSubmitObserver=new Vi(this,document);scrollObserver=new Ks(this);streamObserver=new Xs(this);formLinkClickObserver=new vn(this,document.documentElement);frameRedirector=new Vs(this,document.documentElement);streamMessageRenderer=new Gs;cache=new eo(this);drive=!0;enabled=!0;progressBarDelay=500;started=!1;formMode="on";#e=150;constructor(e){this.recentRequests=e,this.preloader=new Js(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){let r=t.frame?document.getElementById(t.frame):null;if(r instanceof qe){let n=t.action||xt(r);r.delegate.proposeVisitIfNavigatedWithAction(r,n),r.src=e.toString()}else this.navigator.proposeVisit(le(e),t)}refresh(e,t){t&&this.recentRequests.has(t)||this.visit(e,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(lt.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){this.progressBarDelay=e}setFormMode(e){this.formMode=e}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#e}set pageRefreshDebouncePeriod(e){this.refresh=rd(this.debouncedRefresh.bind(this),e),this.#e=e}shouldPreloadLink(e){let t=e.hasAttribute("data-turbo-method"),r=e.hasAttribute("data-turbo-stream"),n=e.getAttribute("data-turbo-frame"),s=n=="_top"?null:document.getElementById(n)||ci(e,"turbo-frame:not([disabled])");if(t||r||s instanceof qe)return!1;{let o=new URL(e.href);return this.elementIsNavigatable(e)&&ot(o,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,t,r){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0,direction:r}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&ot(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&ot(t,this.snapshot.rootLocation)}willFollowLinkToLocation(e,t,r){return this.elementIsNavigatable(e)&&ot(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,r)}followedLinkToLocation(e,t){let r=this.getActionForLink(e),n=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:r,acceptsStreamResponse:n})}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){nl(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(dn(document.documentElement),this.view.markVisitDirection(e.direction)),nl(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),pn(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){let r=oo(e,t);return this.submissionIsNavigatable(e,t)&&ot(le(r),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){this.navigator.currentVisit?.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){let r=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:n,detail:{render:s}}=r;return this.view.renderer&&s&&(this.view.renderer.renderElement=s),!n}viewRenderedSnapshot(e,t,r){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(r)}preloadOnLoadLinksForView(e){this.preloader.preloadOnLoadLinksForView(e)}viewInvalidated(e){this.adapter.pageInvalidated(e)}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t,r){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,r).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,r){return Q("turbo:click",{target:e,detail:{url:t.href,originalEvent:r},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return Q("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return Q("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return Q("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return Q("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return Q("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return Q("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return Q("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return Q("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if(this.formMode=="off")return!1;{let r=t?this.elementIsNavigatable(t):!0;return this.formMode=="optin"?r&&e.closest('[data-turbo="true"]')!=null:r&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){let t=ci(e,"[data-turbo]"),r=ci(e,"turbo-frame");return this.drive||r?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return xt(e)||"advance"}get snapshot(){return this.view.snapshot}};function nl(i){Object.defineProperties(i,jd)}var jd={absoluteURL:{get(){return this.toString()}}},Z=new to(gl),{cache:Ud,navigator:Wd}=Z;function El(){Z.start()}function Kd(i){Z.registerAdapter(i)}function Gd(i,e){Z.visit(i,e)}function _l(i){Z.connectStreamSource(i)}function Al(i){Z.disconnectStreamSource(i)}function Xd(i){Z.renderStreamMessage(i)}function Yd(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),Z.clearCache()}function Zd(i){Z.setProgressBarDelay(i)}function Qd(i){zi.confirmMethod=i}function Jd(i){Z.setFormMode(i)}var ep=Object.freeze({__proto__:null,navigator:Wd,session:Z,cache:Ud,PageRenderer:pi,PageSnapshot:De,FrameRenderer:ji,fetch:vl,start:El,registerAdapter:Kd,visit:Gd,connectStreamSource:_l,disconnectStreamSource:Al,renderStreamMessage:Xd,clearCache:Yd,setProgressBarDelay:Zd,setConfirmMethod:Qd,setFormMode:Jd}),io=class extends Error{},ro=class{fetchResponseLoaded=e=>Promise.resolve();#e=null;#t=()=>{};#i=!1;#n=!1;#s=new Set;action=null;constructor(e){this.element=e,this.view=new Ds(this,this.element),this.appearanceObserver=new Ms(this,this.element),this.formLinkClickObserver=new vn(this,this.element),this.linkInterceptor=new mn(this,this.element),this.restorationIdentifier=at(),this.formSubmitObserver=new Vi(this,this.element)}connect(){this.#i||(this.#i=!0,this.loadingStyle==oi.lazy?this.appearanceObserver.start():this.#r(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#i&&(this.#i=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==oi.eager&&this.#r()}sourceURLChanged(){this.#v("src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==oi.eager||this.#n)&&this.#r())}sourceURLReloaded(){let{src:e}=this.element;return this.element.removeAttribute("complete"),this.element.src=null,this.element.src=e,this.element.loaded}loadingStyleChanged(){this.loadingStyle==oi.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#r())}async#r(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#a(le(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#n=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{let t=await e.responseHTML;if(t){let r=ul(t);De.fromDocument(r).isVisitable?await this.#o(e,r):await this.#h(e)}}finally{this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,xt(e)),this.#r()}willSubmitFormLinkToLocation(e){return this.#p(e)}submittedFormLinkToLocation(e,t,r){let n=this.#c(e);n&&r.setAttribute("data-turbo-frame",n.id)}shouldInterceptLinkClick(e,t,r){return this.#p(e)}linkClickIntercepted(e,t){this.#u(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.#p(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new zi(this,e,t);let{fetchRequest:r}=this.formSubmission;this.prepareRequest(r),this.formSubmission.start()}prepareRequest(e){e.headers["Turbo-Frame"]=this.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&&e.acceptResponseType(lt.contentType)}requestStarted(e){dn(this.element)}requestPreventedHandlingResponse(e,t){this.#t()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.#t()}async requestFailedWithResponse(e,t){await this.loadResponse(t),this.#t()}requestErrored(e,t){console.error(t),this.#t()}requestFinished(e){pn(this.element)}formSubmissionStarted({formElement:e}){dn(e,this.#c(e))}formSubmissionSucceededWithResponse(e,t){let r=this.#c(e.formElement,e.submitter);r.delegate.proposeVisitIfNavigatedWithAction(r,xt(e.submitter,e.formElement,r)),r.delegate.loadResponse(t),e.isSafe||Z.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),Z.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){pn(e,this.#c(e))}allowsImmediateRender({element:e},t){let r=Q("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0}),{defaultPrevented:n,detail:{render:s}}=r;return this.view.renderer&&s&&(this.view.renderer.renderElement=s),!n}viewRenderedSnapshot(e,t,r){}preloadOnLoadLinksForView(e){Z.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>{let t=e.querySelector("#"+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#o(e,t){let r=await this.extractForeignFrameElement(t.body);if(r){let n=new di(r),s=new ji(this,this.view.snapshot,n,ji.renderElement,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(s),this.complete=!0,Z.frameRendered(e,this.element),Z.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#l(e)&&this.#d(e)}async#a(e){let t=new Lt(this,ke.get,e,new URLSearchParams,this.element);return this.#e?.cancel(),this.#e=t,new Promise(r=>{this.#t=()=>{this.#t=()=>{},this.#e=null,r()},t.perform()})}#u(e,t,r){let n=this.#c(e,r);n.delegate.proposeVisitIfNavigatedWithAction(n,xt(r,e,n)),this.#y(e,()=>{n.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){let r=De.fromElement(e).clone(),{visitCachedSnapshot:n}=e.delegate;e.delegate.fetchResponseLoaded=async s=>{if(e.src){let{statusCode:o,redirected:a}=s,l=await s.responseHTML,p={response:{statusCode:o,redirected:a,responseHTML:l},visitCachedSnapshot:n,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:r};this.action&&(p.action=this.action),Z.visit(e.src,p)}}}}changeHistory(){if(this.action){let e=dl(this.action);Z.history.update(e,le(this.element.src||""),this.restorationIdentifier)}}async#h(e){console.warn(`The response (${e.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await this.#f(e.response)}#l(e){this.element.setAttribute("complete","");let t=e.response,r=async(s,o)=>{s instanceof Response?this.#f(s):Z.visit(s,o)};return!Q("turbo:frame-missing",{target:this.element,detail:{response:t,visit:r},cancelable:!0}).defaultPrevented}#d(e){this.view.missing(),this.#m(e)}#m(e){let t=`The response (${e.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new io(t)}async#f(e){let t=new Hi(e),r=await t.responseHTML,{location:n,redirected:s,statusCode:o}=t;return Z.visit(n,{response:{redirected:s,statusCode:o,responseHTML:r}})}#c(e,t){let r=hn("data-turbo-frame",t,e)||this.element.getAttribute("target");return sl(r)??this.element}async extractForeignFrameElement(e){let t,r=CSS.escape(this.id);try{if(t=ol(e.querySelector(`turbo-frame#${r}`),this.sourceURL),t)return t;if(t=ol(e.querySelector(`turbo-frame[src][recurse~=${r}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(n){return console.error(n),new qe}return null}#g(e,t){let r=oo(e,t);return ot(le(r),this.rootLocation)}#p(e,t){let r=hn("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#g(e,t)||!this.enabled||r=="_top")return!1;if(r){let n=sl(r);if(n)return!n.disabled}return!(!Z.elementIsNavigatable(e)||t&&!Z.elementIsNavigatable(t))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(e){this.#b("src",()=>{this.element.src=e??null})}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||this.#t()!==void 0}get complete(){return this.element.hasAttribute("complete")}set complete(e){e?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&this.#i}get rootLocation(){let t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]')?.content??"/";return le(t)}#v(e){return this.#s.has(e)}#b(e,t){this.#s.add(e),t(),this.#s.delete(e)}#y(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}};function sl(i){if(i!=null){let e=document.getElementById(i);if(e instanceof qe)return e}}function ol(i,e){if(i){let t=i.getAttribute("src");if(t!=null&&e!=null&&zh(t,e))throw new Error(`Matching <turbo-frame id="${i.id}"> element has a source URL which references itself`);if(i.ownerDocument!==document&&(i=document.importNode(i,!0)),i instanceof qe)return i.connectedCallback(),i.disconnectedCallback(),i}}var Sl={after(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.append(this.templateContent))},before(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.prepend(this.templateContent))},remove(){this.targetElements.forEach(i=>i.remove())},replace(){this.targetElements.forEach(i=>i.replaceWith(this.templateContent))},update(){this.targetElements.forEach(i=>{i.innerHTML="",i.append(this.templateContent)})},refresh(){Z.refresh(this.baseURI,this.requestId)}},no=class i extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=>{let e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await li(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){let e=this.targetElements.flatMap(r=>[...r.children]).filter(r=>!!r.id),t=[...this.templateContent?.children||[]].filter(r=>!!r.id).map(r=>r.id);return e.filter(r=>t.includes(r.id))}get performAction(){if(this.action){let e=Sl[this.action];if(e)return e;this.#e("unknown action")}this.#e("action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;this.#e("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild===null){let e=this.ownerDocument.createElement("template");return this.appendChild(e),e}else if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.#e("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}#e(e){throw new Error(`${this.description}: ${e}`)}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:i.renderElement}})}get targetElementsById(){let e=this.ownerDocument?.getElementById(this.target);return e!==null?[e]:[]}get targetElementsByQuery(){let e=this.ownerDocument?.querySelectorAll(this.targets);return e.length!==0?Array.prototype.slice.call(e):[]}},so=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),_l(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),Al(this.streamSource))}get src(){return this.getAttribute("src")||""}};qe.delegateConstructor=ro;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",qe);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",no);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",so);(()=>{let i=document.currentScript;if(i&&!i.hasAttribute("data-turbo-suppress-warning"))for(i=i.parentElement;i;){if(i==document.body)return console.warn(hl`
|
77
|
+
`}hiding=!1;value=0;visible=!1;constructor(){this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement(),this.installStylesheetElement(),this.setValue(0)}show(){this.visible||(this.visible=!0,this.installProgressElement(),this.startTrickling())}hide(){this.visible&&!this.hiding&&(this.hiding=!0,this.fadeProgressElement(()=>{this.uninstallProgressElement(),this.stopTrickling(),this.visible=!1,this.hiding=!1}))}setValue(e){this.value=e,this.refresh()}installStylesheetElement(){document.head.insertBefore(this.stylesheetElement,document.head.firstChild)}installProgressElement(){this.progressElement.style.width="0",this.progressElement.style.opacity="1",document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()}fadeProgressElement(e){this.progressElement.style.opacity="0",setTimeout(e,i.animationDuration*1.5)}uninstallProgressElement(){this.progressElement.parentNode&&document.documentElement.removeChild(this.progressElement)}startTrickling(){this.trickleInterval||(this.trickleInterval=window.setInterval(this.trickle,i.animationDuration))}stopTrickling(){window.clearInterval(this.trickleInterval),delete this.trickleInterval}trickle=()=>{this.setValue(this.value+Math.random()/100)};refresh(){requestAnimationFrame(()=>{this.progressElement.style.width=`${10+this.value*90}%`})}createStylesheetElement(){let e=document.createElement("style");return e.type="text/css",e.textContent=i.defaultCSS,this.cspNonce&&(e.nonce=this.cspNonce),e}createProgressElement(){let e=document.createElement("div");return e.className="turbo-progress-bar",e}get cspNonce(){return hi("csp-nonce")}},Fs=class extends di{detailsByOuterHTML=this.children.filter(e=>!Sd(e)).map(e=>xd(e)).reduce((e,t)=>{let{outerHTML:r}=t,n=r in e?e[r]:{type:Ed(t),tracked:_d(t),elements:[]};return{...e,[r]:{...n,elements:[...n.elements,t]}}},{});get trackedElementSignature(){return Object.keys(this.detailsByOuterHTML).filter(e=>this.detailsByOuterHTML[e].tracked).join("")}getScriptElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("script",e)}getStylesheetElementsNotInSnapshot(e){return this.getElementsMatchingTypeNotInSnapshot("stylesheet",e)}getElementsMatchingTypeNotInSnapshot(e,t){return Object.keys(this.detailsByOuterHTML).filter(r=>!(r in t.detailsByOuterHTML)).map(r=>this.detailsByOuterHTML[r]).filter(({type:r})=>r==e).map(({elements:[r]})=>r)}get provisionalElements(){return Object.keys(this.detailsByOuterHTML).reduce((e,t)=>{let{type:r,tracked:n,elements:s}=this.detailsByOuterHTML[t];return r==null&&!n?[...e,...s]:s.length>1?[...e,...s.slice(1)]:e},[])}getMetaValue(e){let t=this.findMetaElementByName(e);return t?t.getAttribute("content"):null}findMetaElementByName(e){return Object.keys(this.detailsByOuterHTML).reduce((t,r)=>{let{elements:[n]}=this.detailsByOuterHTML[r];return kd(n,e)?n:t},void 0|void 0)}};function Ed(i){if(Ad(i))return"script";if(Td(i))return"stylesheet"}function _d(i){return i.getAttribute("data-turbo-track")=="reload"}function Ad(i){return i.localName=="script"}function Sd(i){return i.localName=="noscript"}function Td(i){let e=i.localName;return e=="style"||e=="link"&&i.getAttribute("rel")=="stylesheet"}function kd(i,e){return i.localName=="meta"&&i.getAttribute("name")==e}function xd(i){return i.hasAttribute("nonce")&&i.setAttribute("nonce",""),i}var De=class i extends di{static fromHTMLString(e=""){return this.fromDocument(cl(e))}static fromElement(e){return this.fromDocument(e.ownerDocument)}static fromDocument({documentElement:e,body:t,head:r}){return new this(e,t,new Fs(r))}constructor(e,t,r){super(t),this.documentElement=e,this.headSnapshot=r}clone(){let e=this.element.cloneNode(!0),t=this.element.querySelectorAll("select"),r=e.querySelectorAll("select");for(let[n,s]of t.entries()){let o=r[n];for(let a of o.selectedOptions)a.selected=!1;for(let a of s.selectedOptions)o.options[a.index].selected=!0}for(let n of e.querySelectorAll('input[type="password"]'))n.value="";return new i(this.documentElement,e,this.headSnapshot)}get lang(){return this.documentElement.getAttribute("lang")}get headElement(){return this.headSnapshot.element}get rootLocation(){let e=this.getSetting("root")??"/";return le(e)}get cacheControlValue(){return this.getSetting("cache-control")}get isPreviewable(){return this.cacheControlValue!="no-preview"}get isCacheable(){return this.cacheControlValue!="no-cache"}get isVisitable(){return this.getSetting("visit-control")!="reload"}get prefersViewTransitions(){return this.headSnapshot.getMetaValue("view-transition")==="same-origin"}get shouldMorphPage(){return this.getSetting("refresh-method")==="morph"}get shouldPreserveScrollPosition(){return this.getSetting("refresh-scroll")==="preserve"}getSetting(e){return this.headSnapshot.getMetaValue(`turbo-${e}`)}},Bs=class{#e=!1;#t=Promise.resolve();renderChange(e,t){return e&&this.viewTransitionsAvailable&&!this.#e?(this.#e=!0,this.#t=this.#t.then(async()=>{await document.startViewTransition(t).finished})):this.#t=this.#t.then(t),this.#t}get viewTransitionsAvailable(){return document.startViewTransition}},Ld={action:"advance",historyChanged:!1,visitCachedSnapshot:()=>{},willRender:!0,updateHistory:!0,shouldCacheSnapshot:!0,acceptsStreamResponse:!1},cn={visitStart:"visitStart",requestStart:"requestStart",requestEnd:"requestEnd",visitEnd:"visitEnd"},Qe={initialized:"initialized",started:"started",canceled:"canceled",failed:"failed",completed:"completed"},ui={networkFailure:0,timeoutFailure:-1,contentTypeMismatch:-2},Cd={advance:"forward",restore:"back",replace:"none"},Ns=class{identifier=at();timingMetrics={};followedRedirect=!1;historyChanged=!1;scrolled=!1;shouldCacheSnapshot=!0;acceptsStreamResponse=!1;snapshotCached=!1;state=Qe.initialized;viewTransitioner=new Bs;constructor(e,t,r,n={}){this.delegate=e,this.location=t,this.restorationIdentifier=r||at();let{action:s,historyChanged:o,referrer:a,snapshot:l,snapshotHTML:d,response:p,visitCachedSnapshot:m,willRender:E,updateHistory:v,shouldCacheSnapshot:C,acceptsStreamResponse:_,direction:k}={...Ld,...n};this.action=s,this.historyChanged=o,this.referrer=a,this.snapshot=l,this.snapshotHTML=d,this.response=p,this.isSamePage=this.delegate.locationWithActionIsSamePage(this.location,this.action),this.isPageRefresh=this.view.isPageRefresh(this),this.visitCachedSnapshot=m,this.willRender=E,this.updateHistory=v,this.scrolled=!E,this.shouldCacheSnapshot=C,this.acceptsStreamResponse=_,this.direction=k||Cd[s]}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get history(){return this.delegate.history}get restorationData(){return this.history.getRestorationDataForIdentifier(this.restorationIdentifier)}get silent(){return this.isSamePage}start(){this.state==Qe.initialized&&(this.recordTimingMetric(cn.visitStart),this.state=Qe.started,this.adapter.visitStarted(this),this.delegate.visitStarted(this))}cancel(){this.state==Qe.started&&(this.request&&this.request.cancel(),this.cancelRender(),this.state=Qe.canceled)}complete(){this.state==Qe.started&&(this.recordTimingMetric(cn.visitEnd),this.adapter.visitCompleted(this),this.state=Qe.completed,this.followRedirect(),this.followedRedirect||this.delegate.visitCompleted(this))}fail(){this.state==Qe.started&&(this.state=Qe.failed,this.adapter.visitFailed(this),this.delegate.visitCompleted(this))}changeHistory(){if(!this.historyChanged&&this.updateHistory){let e=this.location.href===this.referrer?.href?"replace":this.action,t=hl(e);this.history.update(t,this.location,this.restorationIdentifier),this.historyChanged=!0}}issueRequest(){this.hasPreloadedResponse()?this.simulateRequest():this.shouldIssueRequest()&&!this.request&&(this.request=new Lt(this,ke.get,this.location),this.request.perform())}simulateRequest(){this.response&&(this.startRequest(),this.recordResponse(),this.finishRequest())}startRequest(){this.recordTimingMetric(cn.requestStart),this.adapter.visitRequestStarted(this)}recordResponse(e=this.response){if(this.response=e,e){let{statusCode:t}=e;il(t)?this.adapter.visitRequestCompleted(this):this.adapter.visitRequestFailedWithStatusCode(this,t)}}finishRequest(){this.recordTimingMetric(cn.requestEnd),this.adapter.visitRequestFinished(this)}loadResponse(){if(this.response){let{statusCode:e,responseHTML:t}=this.response;this.render(async()=>{if(this.shouldCacheSnapshot&&this.cacheSnapshot(),this.view.renderPromise&&await this.view.renderPromise,il(e)&&t!=null){let r=De.fromHTMLString(t);await this.renderPageSnapshot(r,!1),this.adapter.visitRendered(this),this.complete()}else await this.view.renderError(De.fromHTMLString(t),this),this.adapter.visitRendered(this),this.fail()})}}getCachedSnapshot(){let e=this.view.getCachedSnapshotForLocation(this.location)||this.getPreloadedSnapshot();if(e&&(!kt(this.location)||e.hasAnchor(kt(this.location)))&&(this.action=="restore"||e.isPreviewable))return e}getPreloadedSnapshot(){if(this.snapshotHTML)return De.fromHTMLString(this.snapshotHTML)}hasCachedSnapshot(){return this.getCachedSnapshot()!=null}loadCachedSnapshot(){let e=this.getCachedSnapshot();if(e){let t=this.shouldIssueRequest();this.render(async()=>{this.cacheSnapshot(),this.isSamePage||this.isPageRefresh?this.adapter.visitRendered(this):(this.view.renderPromise&&await this.view.renderPromise,await this.renderPageSnapshot(e,t),this.adapter.visitRendered(this),t||this.complete())})}}followRedirect(){this.redirectedToLocation&&!this.followedRedirect&&this.response?.redirected&&(this.adapter.visitProposedToLocation(this.redirectedToLocation,{action:"replace",response:this.response,shouldCacheSnapshot:!1,willRender:!1}),this.followedRedirect=!0)}goToSamePageAnchor(){this.isSamePage&&this.render(async()=>{this.cacheSnapshot(),this.performScroll(),this.changeHistory(),this.adapter.visitRendered(this)})}prepareRequest(e){this.acceptsStreamResponse&&e.acceptResponseType(lt.contentType)}requestStarted(){this.startRequest()}requestPreventedHandlingResponse(e,t){}async requestSucceededWithResponse(e,t){let r=await t.responseHTML,{redirected:n,statusCode:s}=t;r==null?this.recordResponse({statusCode:ui.contentTypeMismatch,redirected:n}):(this.redirectedToLocation=t.redirected?t.location:void 0,this.recordResponse({statusCode:s,responseHTML:r,redirected:n}))}async requestFailedWithResponse(e,t){let r=await t.responseHTML,{redirected:n,statusCode:s}=t;r==null?this.recordResponse({statusCode:ui.contentTypeMismatch,redirected:n}):this.recordResponse({statusCode:s,responseHTML:r,redirected:n})}requestErrored(e,t){this.recordResponse({statusCode:ui.networkFailure,redirected:!1})}requestFinished(){this.finishRequest()}performScroll(){!this.scrolled&&!this.view.forceReloaded&&!this.view.shouldPreserveScrollPosition(this)&&(this.action=="restore"?this.scrollToRestoredPosition()||this.scrollToAnchor()||this.view.scrollToTop():this.scrollToAnchor()||this.view.scrollToTop(),this.isSamePage&&this.delegate.visitScrolledToSamePageLocation(this.view.lastRenderedLocation,this.location),this.scrolled=!0)}scrollToRestoredPosition(){let{scrollPosition:e}=this.restorationData;if(e)return this.view.scrollToPosition(e),!0}scrollToAnchor(){let e=kt(this.location);if(e!=null)return this.view.scrollToAnchor(e),!0}recordTimingMetric(e){this.timingMetrics[e]=new Date().getTime()}getTimingMetrics(){return{...this.timingMetrics}}getHistoryMethodForAction(e){switch(e){case"replace":return history.replaceState;case"advance":case"restore":return history.pushState}}hasPreloadedResponse(){return typeof this.response=="object"}shouldIssueRequest(){return this.isSamePage?!1:this.action=="restore"?!this.hasCachedSnapshot():this.willRender}cacheSnapshot(){this.snapshotCached||(this.view.cacheSnapshot(this.snapshot).then(e=>e&&this.visitCachedSnapshot(e)),this.snapshotCached=!0)}async render(e){this.cancelRender(),this.frame=await li(),await e(),delete this.frame}async renderPageSnapshot(e,t){await this.viewTransitioner.renderChange(this.view.shouldTransitionTo(e),async()=>{await this.view.renderPage(e,t,this.willRender,this),this.performScroll()})}cancelRender(){this.frame&&(cancelAnimationFrame(this.frame),delete this.frame)}};function il(i){return i>=200&&i<300}var Hs=class{progressBar=new Ds;constructor(e){this.session=e}visitProposedToLocation(e,t){ot(e,this.navigator.rootLocation)?this.navigator.startVisit(e,t?.restorationIdentifier||at(),t):window.location.href=e.toString()}visitStarted(e){this.location=e.location,e.loadCachedSnapshot(),e.issueRequest(),e.goToSamePageAnchor()}visitRequestStarted(e){this.progressBar.setValue(0),e.hasCachedSnapshot()||e.action!="restore"?this.showVisitProgressBarAfterDelay():this.showProgressBar()}visitRequestCompleted(e){e.loadResponse()}visitRequestFailedWithStatusCode(e,t){switch(t){case ui.networkFailure:case ui.timeoutFailure:case ui.contentTypeMismatch:return this.reload({reason:"request_failed",context:{statusCode:t}});default:return e.loadResponse()}}visitRequestFinished(e){}visitCompleted(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}pageInvalidated(e){this.reload(e)}visitFailed(e){this.progressBar.setValue(1),this.hideVisitProgressBar()}visitRendered(e){}formSubmissionStarted(e){this.progressBar.setValue(0),this.showFormProgressBarAfterDelay()}formSubmissionFinished(e){this.progressBar.setValue(1),this.hideFormProgressBar()}showVisitProgressBarAfterDelay(){this.visitProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay)}hideVisitProgressBar(){this.progressBar.hide(),this.visitProgressBarTimeout!=null&&(window.clearTimeout(this.visitProgressBarTimeout),delete this.visitProgressBarTimeout)}showFormProgressBarAfterDelay(){this.formProgressBarTimeout==null&&(this.formProgressBarTimeout=window.setTimeout(this.showProgressBar,this.session.progressBarDelay))}hideFormProgressBar(){this.progressBar.hide(),this.formProgressBarTimeout!=null&&(window.clearTimeout(this.formProgressBarTimeout),delete this.formProgressBarTimeout)}showProgressBar=()=>{this.progressBar.show()};reload(e){Q("turbo:reload",{detail:e}),window.location.href=this.location?.toString()||window.location.href}get navigator(){return this.session.navigator}},qs=class{selector="[data-turbo-temporary]";deprecatedSelector="[data-turbo-cache=false]";started=!1;start(){this.started||(this.started=!0,addEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}stop(){this.started&&(this.started=!1,removeEventListener("turbo:before-cache",this.removeTemporaryElements,!1))}removeTemporaryElements=e=>{for(let t of this.temporaryElements)t.remove()};get temporaryElements(){return[...document.querySelectorAll(this.selector),...this.temporaryElementsWithDeprecation]}get temporaryElementsWithDeprecation(){let e=document.querySelectorAll(this.deprecatedSelector);return e.length&&console.warn(`The ${this.deprecatedSelector} selector is deprecated and will be removed in a future version. Use ${this.selector} instead.`),[...e]}},zs=class{constructor(e,t){this.session=e,this.element=t,this.linkInterceptor=new fn(this,t),this.formSubmitObserver=new Vi(this,t)}start(){this.linkInterceptor.start(),this.formSubmitObserver.start()}stop(){this.linkInterceptor.stop(),this.formSubmitObserver.stop()}shouldInterceptLinkClick(e,t,r){return this.#t(e)}linkClickIntercepted(e,t,r){let n=this.#i(e);n&&n.delegate.linkClickIntercepted(e,t,r)}willSubmitForm(e,t){return e.closest("turbo-frame")==null&&this.#e(e,t)&&this.#t(e,t)}formSubmitted(e,t){let r=this.#i(e,t);r&&r.delegate.formSubmitted(e,t)}#e(e,t){let r=so(e,t),n=this.element.ownerDocument.querySelector('meta[name="turbo-root"]'),s=le(n?.content??"/");return this.#t(e,t)&&ot(r,s)}#t(e,t){if(e instanceof HTMLFormElement?this.session.submissionIsNavigatable(e,t):this.session.elementIsNavigatable(e)){let n=this.#i(e,t);return n?n!=e.closest("turbo-frame"):!1}else return!1}#i(e,t){let r=t?.getAttribute("data-turbo-frame")||e.getAttribute("data-turbo-frame");if(r&&r!="_top"){let n=this.element.querySelector(`#${r}:not([disabled])`);if(n instanceof qe)return n}}},Vs=class{location;restorationIdentifier=at();restorationData={};started=!1;pageLoaded=!1;currentIndex=0;constructor(e){this.delegate=e}start(){this.started||(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.currentIndex=history.state?.turbo?.restorationIndex||0,this.started=!0,this.replace(new URL(window.location.href)))}stop(){this.started&&(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1)}push(e,t){this.update(history.pushState,e,t)}replace(e,t){this.update(history.replaceState,e,t)}update(e,t,r=at()){e===history.pushState&&++this.currentIndex;let n={turbo:{restorationIdentifier:r,restorationIndex:this.currentIndex}};e.call(history,n,"",t.href),this.location=t,this.restorationIdentifier=r}getRestorationDataForIdentifier(e){return this.restorationData[e]||{}}updateRestorationData(e){let{restorationIdentifier:t}=this,r=this.restorationData[t];this.restorationData[t]={...r,...e}}assumeControlOfScrollRestoration(){this.previousScrollRestoration||(this.previousScrollRestoration=history.scrollRestoration??"auto",history.scrollRestoration="manual")}relinquishControlOfScrollRestoration(){this.previousScrollRestoration&&(history.scrollRestoration=this.previousScrollRestoration,delete this.previousScrollRestoration)}onPopState=e=>{if(this.shouldHandlePopState()){let{turbo:t}=e.state||{};if(t){this.location=new URL(window.location.href);let{restorationIdentifier:r,restorationIndex:n}=t;this.restorationIdentifier=r;let s=n>this.currentIndex?"forward":"back";this.delegate.historyPoppedToLocationWithRestorationIdentifierAndDirection(this.location,r,s),this.currentIndex=n}}};onPageLoad=async e=>{await Kh(),this.pageLoaded=!0};shouldHandlePopState(){return this.pageIsLoaded()}pageIsLoaded(){return this.pageLoaded||document.readyState=="complete"}},$s=class{started=!1;#e=null;constructor(e,t){this.delegate=e,this.eventTarget=t}start(){this.started||(this.eventTarget.readyState==="loading"?this.eventTarget.addEventListener("DOMContentLoaded",this.#t,{once:!0}):this.#t())}stop(){this.started&&(this.eventTarget.removeEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.removeEventListener("turbo:before-fetch-request",this.#r,!0),this.started=!1)}#t=()=>{this.eventTarget.addEventListener("mouseenter",this.#i,{capture:!0,passive:!0}),this.eventTarget.addEventListener("mouseleave",this.#n,{capture:!0,passive:!0}),this.eventTarget.addEventListener("turbo:before-fetch-request",this.#r,!0),this.started=!0};#i=e=>{if(hi("turbo-prefetch")==="false")return;let t=e.target;if(t.matches&&t.matches("a[href]:not([target^=_]):not([download])")&&this.#a(t)){let n=t,s=fl(n);if(this.delegate.canPrefetchRequestToLocation(n,s)){this.#e=n;let o=new Lt(this,ke.get,s,new URLSearchParams,t);ai.setLater(s.toString(),o,this.#o)}}};#n=e=>{e.target===this.#e&&this.#s()};#s=()=>{ai.clear(),this.#e=null};#r=e=>{if(e.target.tagName!=="FORM"&&e.detail.fetchOptions.method==="get"){let t=ai.get(e.detail.url.toString());t&&(e.detail.fetchRequest=t),ai.clear()}};prepareRequest(e){let t=e.target;e.headers["X-Sec-Purpose"]="prefetch";let r=t.closest("turbo-frame"),n=t.getAttribute("data-turbo-frame")||r?.getAttribute("target")||r?.id;n&&n!=="_top"&&(e.headers["Turbo-Frame"]=n)}requestSucceededWithResponse(){}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}get#o(){return Number(hi("turbo-prefetch-cache-time"))||ld}#a(e){return!(!e.getAttribute("href")||Id(e)||Od(e)||Rd(e)||Md(e)||Dd(e))}},Id=i=>i.origin!==document.location.origin||!["http:","https:"].includes(i.protocol)||i.hasAttribute("target"),Od=i=>i.pathname+i.search===document.location.pathname+document.location.search||i.href.startsWith("#"),Rd=i=>{if(i.getAttribute("data-turbo-prefetch")==="false"||i.getAttribute("data-turbo")==="false")return!0;let e=ci(i,"[data-turbo-prefetch]");return!!(e&&e.getAttribute("data-turbo-prefetch")==="false")},Md=i=>{let e=i.getAttribute("data-turbo-method");return!!(e&&e.toLowerCase()!=="get"||Pd(i)||i.hasAttribute("data-turbo-confirm")||i.hasAttribute("data-turbo-stream"))},Pd=i=>i.hasAttribute("data-remote")||i.hasAttribute("data-behavior")||i.hasAttribute("data-confirm")||i.hasAttribute("data-method"),Dd=i=>Q("turbo:before-prefetch",{target:i,cancelable:!0}).defaultPrevented,js=class{constructor(e){this.delegate=e}proposeVisit(e,t={}){this.delegate.allowsVisitingLocationWithAction(e,t.action)&&this.delegate.visitProposedToLocation(e,t)}startVisit(e,t,r={}){this.stop(),this.currentVisit=new Ns(this,le(e),t,{referrer:this.location,...r}),this.currentVisit.start()}submitForm(e,t){this.stop(),this.formSubmission=new zi(this,e,t,!0),this.formSubmission.start()}stop(){this.formSubmission&&(this.formSubmission.stop(),delete this.formSubmission),this.currentVisit&&(this.currentVisit.cancel(),delete this.currentVisit)}get adapter(){return this.delegate.adapter}get view(){return this.delegate.view}get rootLocation(){return this.view.snapshot.rootLocation}get history(){return this.delegate.history}formSubmissionStarted(e){typeof this.adapter.formSubmissionStarted=="function"&&this.adapter.formSubmissionStarted(e)}async formSubmissionSucceededWithResponse(e,t){if(e==this.formSubmission){let r=await t.responseHTML;if(r){let n=e.isSafe;n||this.view.clearSnapshotCache();let{statusCode:s,redirected:o}=t,l={action:this.#e(e,t),shouldCacheSnapshot:n,response:{statusCode:s,responseHTML:r,redirected:o}};this.proposeVisit(t.location,l)}}}async formSubmissionFailedWithResponse(e,t){let r=await t.responseHTML;if(r){let n=De.fromHTMLString(r);t.serverError?await this.view.renderError(n,this.currentVisit):await this.view.renderPage(n,!1,!0,this.currentVisit),n.shouldPreserveScrollPosition||this.view.scrollToTop(),this.view.clearSnapshotCache()}}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished(e){typeof this.adapter.formSubmissionFinished=="function"&&this.adapter.formSubmissionFinished(e)}visitStarted(e){this.delegate.visitStarted(e)}visitCompleted(e){this.delegate.visitCompleted(e)}locationWithActionIsSamePage(e,t){let r=kt(e),n=kt(this.view.lastRenderedLocation),s=t==="restore"&&typeof r>"u";return t!=="replace"&&Is(e)===Is(this.view.lastRenderedLocation)&&(s||r!=null&&r!==n)}visitScrolledToSamePageLocation(e,t){this.delegate.visitScrolledToSamePageLocation(e,t)}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}#e(e,t){let{submitter:r,formElement:n}=e;return xt(r,n)||this.#t(t)}#t(e){return e.redirected&&e.location.href===this.location?.href?"replace":"advance"}},St={initial:0,loading:1,interactive:2,complete:3},Us=class{stage=St.initial;started=!1;constructor(e){this.delegate=e}start(){this.started||(this.stage==St.initial&&(this.stage=St.loading),document.addEventListener("readystatechange",this.interpretReadyState,!1),addEventListener("pagehide",this.pageWillUnload,!1),this.started=!0)}stop(){this.started&&(document.removeEventListener("readystatechange",this.interpretReadyState,!1),removeEventListener("pagehide",this.pageWillUnload,!1),this.started=!1)}interpretReadyState=()=>{let{readyState:e}=this;e=="interactive"?this.pageIsInteractive():e=="complete"&&this.pageIsComplete()};pageIsInteractive(){this.stage==St.loading&&(this.stage=St.interactive,this.delegate.pageBecameInteractive())}pageIsComplete(){this.pageIsInteractive(),this.stage==St.interactive&&(this.stage=St.complete,this.delegate.pageLoaded())}pageWillUnload=()=>{this.delegate.pageWillUnload()};get readyState(){return document.readyState}},Ws=class{started=!1;constructor(e){this.delegate=e}start(){this.started||(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)}stop(){this.started&&(removeEventListener("scroll",this.onScroll,!1),this.started=!1)}onScroll=()=>{this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})};updatePosition(e){this.delegate.scrollPositionChanged(e)}},Ks=class{render({fragment:e}){vn.preservingPermanentElements(this,Fd(e),()=>{Bd(e,()=>{Nd(()=>{document.documentElement.appendChild(e)})})})}enteringBardo(e,t){t.replaceWith(e.cloneNode(!0))}leavingBardo(){}};function Fd(i){let e=yl(document.documentElement),t={};for(let r of e){let{id:n}=r;for(let s of i.querySelectorAll("turbo-stream")){let o=bl(s.templateElement.content,n);o&&(t[n]=[r,o])}}return t}async function Bd(i,e){let t=`turbo-stream-autofocus-${at()}`,r=i.querySelectorAll("turbo-stream"),n=Hd(r),s=null;if(n&&(n.id?s=n.id:s=t,n.id=s),e(),await li(),(document.activeElement==null||document.activeElement==document.body)&&s){let a=document.getElementById(s);oo(a)&&a.focus(),a&&a.id==t&&a.removeAttribute("id")}}async function Nd(i){let[e,t]=await Jh(i,()=>document.activeElement),r=e&&e.id;if(r){let n=document.getElementById(r);oo(n)&&n!=t&&n.focus()}}function Hd(i){for(let e of i){let t=pl(e.templateElement.content);if(t)return t}return null}var Gs=class{sources=new Set;#e=!1;constructor(e){this.delegate=e}start(){this.#e||(this.#e=!0,addEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}stop(){this.#e&&(this.#e=!1,removeEventListener("turbo:before-fetch-response",this.inspectFetchResponse,!1))}connectStreamSource(e){this.streamSourceIsConnected(e)||(this.sources.add(e),e.addEventListener("message",this.receiveMessageEvent,!1))}disconnectStreamSource(e){this.streamSourceIsConnected(e)&&(this.sources.delete(e),e.removeEventListener("message",this.receiveMessageEvent,!1))}streamSourceIsConnected(e){return this.sources.has(e)}inspectFetchResponse=e=>{let t=qd(e);t&&zd(t)&&(e.preventDefault(),this.receiveMessageResponse(t))};receiveMessageEvent=e=>{this.#e&&typeof e.data=="string"&&this.receiveMessageHTML(e.data)};async receiveMessageResponse(e){let t=await e.responseHTML;t&&this.receiveMessageHTML(t)}receiveMessageHTML(e){this.delegate.receivedMessageFromStream(lt.wrap(e))}};function qd(i){let e=i.detail?.fetchResponse;if(e instanceof Hi)return e}function zd(i){return(i.contentType??"").startsWith(lt.contentType)}var bn=class extends $i{static renderElement(e,t){let{documentElement:r,body:n}=document;r.replaceChild(t,n)}async render(){this.replaceHeadAndBody(),this.activateScriptElements()}replaceHeadAndBody(){let{documentElement:e,head:t}=document;e.replaceChild(this.newHead,t),this.renderElement(this.currentElement,this.newElement)}activateScriptElements(){for(let e of this.scriptElements){let t=e.parentNode;if(t){let r=qi(e);t.replaceChild(r,e)}}}get newHead(){return this.newSnapshot.headSnapshot.element}get scriptElements(){return document.documentElement.querySelectorAll("script")}},Vd=function(){let i=new Set,e={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:E,afterNodeAdded:E,beforeNodeMorphed:E,afterNodeMorphed:E,beforeNodeRemoved:E,afterNodeRemoved:E,beforeAttributeUpdated:E},head:{style:"merge",shouldPreserve:function(u){return u.getAttribute("im-preserve")==="true"},shouldReAppend:function(u){return u.getAttribute("im-re-append")==="true"},shouldRemove:E,afterHeadMorphed:E}};function t(u,h,f={}){u instanceof Document&&(u=u.documentElement),typeof h=="string"&&(h=S(h));let y=R(h),w=C(u,y,f);return r(u,y,w)}function r(u,h,f){if(f.head.block){let y=u.querySelector("head"),w=h.querySelector("head");if(y&&w){let b=m(w,y,f);Promise.all(b).then(function(){r(u,h,Object.assign(f,{head:{block:!1,ignore:!0}}))});return}}if(f.morphStyle==="innerHTML")return o(h,u,f),u.children;if(f.morphStyle==="outerHTML"||f.morphStyle==null){let y=P(h,u,f),w=y?.previousSibling,b=y?.nextSibling,O=s(u,y,f);return y?x(w,O,b):[]}else throw"Do not understand how to morph style "+f.morphStyle}function n(u,h){return h.ignoreActiveValue&&u===document.activeElement&&u!==document.body}function s(u,h,f){if(!(f.ignoreActive&&u===document.activeElement))return h==null?f.callbacks.beforeNodeRemoved(u)===!1?u:(u.remove(),f.callbacks.afterNodeRemoved(u),null):k(u,h)?(f.callbacks.beforeNodeMorphed(u,h)===!1||(u instanceof HTMLHeadElement&&f.head.ignore||(u instanceof HTMLHeadElement&&f.head.style!=="morph"?m(h,u,f):(l(h,u,f),n(u,f)||o(h,u,f))),f.callbacks.afterNodeMorphed(u,h)),u):f.callbacks.beforeNodeRemoved(u)===!1||f.callbacks.beforeNodeAdded(h)===!1?u:(u.parentElement.replaceChild(h,u),f.callbacks.afterNodeAdded(h),f.callbacks.afterNodeRemoved(u),h)}function o(u,h,f){let y=u.firstChild,w=h.firstChild,b;for(;y;){if(b=y,y=b.nextSibling,w==null){if(f.callbacks.beforeNodeAdded(b)===!1)return;h.appendChild(b),f.callbacks.afterNodeAdded(b),Y(f,b);continue}if(_(b,w,f)){s(w,b,f),w=w.nextSibling,Y(f,b);continue}let O=q(u,h,b,w,f);if(O){w=D(w,O,f),s(O,b,f),Y(f,b);continue}let M=B(u,h,b,w,f);if(M){w=D(w,M,f),s(M,b,f),Y(f,b);continue}if(f.callbacks.beforeNodeAdded(b)===!1)return;h.insertBefore(b,w),f.callbacks.afterNodeAdded(b),Y(f,b)}for(;w!==null;){let O=w;w=w.nextSibling,U(O,f)}}function a(u,h,f,y){return u==="value"&&y.ignoreActiveValue&&h===document.activeElement?!0:y.callbacks.beforeAttributeUpdated(u,h,f)===!1}function l(u,h,f){let y=u.nodeType;if(y===1){let w=u.attributes,b=h.attributes;for(let O of w)a(O.name,h,"update",f)||h.getAttribute(O.name)!==O.value&&h.setAttribute(O.name,O.value);for(let O=b.length-1;0<=O;O--){let M=b[O];a(M.name,h,"remove",f)||u.hasAttribute(M.name)||h.removeAttribute(M.name)}}(y===8||y===3)&&h.nodeValue!==u.nodeValue&&(h.nodeValue=u.nodeValue),n(h,f)||p(u,h,f)}function d(u,h,f,y){if(u[f]!==h[f]){let w=a(f,h,"update",y);w||(h[f]=u[f]),u[f]?w||h.setAttribute(f,u[f]):a(f,h,"remove",y)||h.removeAttribute(f)}}function p(u,h,f){if(u instanceof HTMLInputElement&&h instanceof HTMLInputElement&&u.type!=="file"){let y=u.value,w=h.value;d(u,h,"checked",f),d(u,h,"disabled",f),u.hasAttribute("value")?y!==w&&(a("value",h,"update",f)||(h.setAttribute("value",y),h.value=y)):a("value",h,"remove",f)||(h.value="",h.removeAttribute("value"))}else if(u instanceof HTMLOptionElement)d(u,h,"selected",f);else if(u instanceof HTMLTextAreaElement&&h instanceof HTMLTextAreaElement){let y=u.value,w=h.value;if(a("value",h,"update",f))return;y!==w&&(h.value=y),h.firstChild&&h.firstChild.nodeValue!==y&&(h.firstChild.nodeValue=y)}}function m(u,h,f){let y=[],w=[],b=[],O=[],M=f.head.style,ce=new Map;for(let V of u.children)ce.set(V.outerHTML,V);for(let V of h.children){let ne=ce.has(V.outerHTML),de=f.head.shouldReAppend(V),Le=f.head.shouldPreserve(V);ne||Le?de?w.push(V):(ce.delete(V.outerHTML),b.push(V)):M==="append"?de&&(w.push(V),O.push(V)):f.head.shouldRemove(V)!==!1&&w.push(V)}O.push(...ce.values());let H=[];for(let V of O){let ne=document.createRange().createContextualFragment(V.outerHTML).firstChild;if(f.callbacks.beforeNodeAdded(ne)!==!1){if(ne.href||ne.src){let de=null,Le=new Promise(function(Ct){de=Ct});ne.addEventListener("load",function(){de()}),H.push(Le)}h.appendChild(ne),f.callbacks.afterNodeAdded(ne),y.push(ne)}}for(let V of w)f.callbacks.beforeNodeRemoved(V)!==!1&&(h.removeChild(V),f.callbacks.afterNodeRemoved(V));return f.head.afterHeadMorphed(h,{added:y,kept:b,removed:w}),H}function E(){}function v(u){let h={};return Object.assign(h,e),Object.assign(h,u),h.callbacks={},Object.assign(h.callbacks,e.callbacks),Object.assign(h.callbacks,u.callbacks),h.head={},Object.assign(h.head,e.head),Object.assign(h.head,u.head),h}function C(u,h,f){return f=v(f),{target:u,newContent:h,config:f,morphStyle:f.morphStyle,ignoreActive:f.ignoreActive,ignoreActiveValue:f.ignoreActiveValue,idMap:xe(u,h),deadIds:new Set,callbacks:f.callbacks,head:f.head}}function _(u,h,f){return u==null||h==null?!1:u.nodeType===h.nodeType&&u.tagName===h.tagName?u.id!==""&&u.id===h.id?!0:W(f,u,h)>0:!1}function k(u,h){return u==null||h==null?!1:u.nodeType===h.nodeType&&u.tagName===h.tagName}function D(u,h,f){for(;u!==h;){let y=u;u=u.nextSibling,U(y,f)}return Y(f,h),h.nextSibling}function q(u,h,f,y,w){let b=W(w,f,h),O=null;if(b>0){let M=y,ce=0;for(;M!=null;){if(_(f,M,w))return M;if(ce+=W(w,M,u),ce>b)return null;M=M.nextSibling}}return O}function B(u,h,f,y,w){let b=y,O=f.nextSibling,M=0;for(;b!=null;){if(W(w,b,u)>0)return null;if(k(f,b))return b;if(k(O,b)&&(M++,O=O.nextSibling,M>=2))return null;b=b.nextSibling}return b}function S(u){let h=new DOMParser,f=u.replace(/<svg(\s[^>]*>|>)([\s\S]*?)<\/svg>/gim,"");if(f.match(/<\/html>/)||f.match(/<\/head>/)||f.match(/<\/body>/)){let y=h.parseFromString(u,"text/html");if(f.match(/<\/html>/))return y.generatedByIdiomorph=!0,y;{let w=y.firstChild;return w?(w.generatedByIdiomorph=!0,w):null}}else{let w=h.parseFromString("<body><template>"+u+"</template></body>","text/html").body.querySelector("template").content;return w.generatedByIdiomorph=!0,w}}function R(u){if(u==null)return document.createElement("div");if(u.generatedByIdiomorph)return u;if(u instanceof Node){let h=document.createElement("div");return h.append(u),h}else{let h=document.createElement("div");for(let f of[...u])h.append(f);return h}}function x(u,h,f){let y=[],w=[];for(;u!=null;)y.push(u),u=u.previousSibling;for(;y.length>0;){let b=y.pop();w.push(b),h.parentElement.insertBefore(b,h)}for(w.push(h);f!=null;)y.push(f),w.push(f),f=f.nextSibling;for(;y.length>0;)h.parentElement.insertBefore(y.pop(),h.nextSibling);return w}function P(u,h,f){let y;y=u.firstChild;let w=y,b=0;for(;y;){let O=N(y,h,f);O>b&&(w=y,b=O),y=y.nextSibling}return w}function N(u,h,f){return k(u,h)?.5+W(f,u,h):0}function U(u,h){Y(h,u),h.callbacks.beforeNodeRemoved(u)!==!1&&(u.remove(),h.callbacks.afterNodeRemoved(u))}function X(u,h){return!u.deadIds.has(h)}function z(u,h,f){return(u.idMap.get(f)||i).has(h)}function Y(u,h){let f=u.idMap.get(h)||i;for(let y of f)u.deadIds.add(y)}function W(u,h,f){let y=u.idMap.get(h)||i,w=0;for(let b of y)X(u,b)&&z(u,b,f)&&++w;return w}function ye(u,h){let f=u.parentElement,y=u.querySelectorAll("[id]");for(let w of y){let b=w;for(;b!==f&&b!=null;){let O=h.get(b);O==null&&(O=new Set,h.set(b,O)),O.add(w.id),b=b.parentElement}}}function xe(u,h){let f=new Map;return ye(u,f),ye(h,f),f}return{morph:t,defaults:e}}(),pi=class extends $i{static renderElement(e,t){document.body&&t instanceof HTMLBodyElement?document.body.replaceWith(t):document.documentElement.appendChild(t)}get shouldRender(){return this.newSnapshot.isVisitable&&this.trackedElementsAreIdentical}get reloadReason(){if(!this.newSnapshot.isVisitable)return{reason:"turbo_visit_control_is_reload"};if(!this.trackedElementsAreIdentical)return{reason:"tracked_element_mismatch"}}async prepareToRender(){this.#e(),await this.mergeHead()}async render(){this.willRender&&await this.replaceBody()}finishRendering(){super.finishRendering(),this.isPreview||this.focusFirstAutofocusableElement()}get currentHeadSnapshot(){return this.currentSnapshot.headSnapshot}get newHeadSnapshot(){return this.newSnapshot.headSnapshot}get newElement(){return this.newSnapshot.element}#e(){let{documentElement:e}=this.currentSnapshot,{lang:t}=this.newSnapshot;t?e.setAttribute("lang",t):e.removeAttribute("lang")}async mergeHead(){let e=this.mergeProvisionalElements(),t=this.copyNewHeadStylesheetElements();this.copyNewHeadScriptElements(),await e,await t,this.willRender&&this.removeUnusedDynamicStylesheetElements()}async replaceBody(){await this.preservingPermanentElements(async()=>{this.activateNewBody(),await this.assignNewBody()})}get trackedElementsAreIdentical(){return this.currentHeadSnapshot.trackedElementSignature==this.newHeadSnapshot.trackedElementSignature}async copyNewHeadStylesheetElements(){let e=[];for(let t of this.newHeadStylesheetElements)e.push(Yh(t)),document.head.appendChild(t);await Promise.all(e)}copyNewHeadScriptElements(){for(let e of this.newHeadScriptElements)document.head.appendChild(qi(e))}removeUnusedDynamicStylesheetElements(){for(let e of this.unusedDynamicStylesheetElements)document.head.removeChild(e)}async mergeProvisionalElements(){let e=[...this.newHeadProvisionalElements];for(let t of this.currentHeadProvisionalElements)this.isCurrentElementInElementList(t,e)||document.head.removeChild(t);for(let t of e)document.head.appendChild(t)}isCurrentElementInElementList(e,t){for(let[r,n]of t.entries()){if(e.tagName=="TITLE"){if(n.tagName!="TITLE")continue;if(e.innerHTML==n.innerHTML)return t.splice(r,1),!0}if(n.isEqualNode(e))return t.splice(r,1),!0}return!1}removeCurrentHeadProvisionalElements(){for(let e of this.currentHeadProvisionalElements)document.head.removeChild(e)}copyNewHeadProvisionalElements(){for(let e of this.newHeadProvisionalElements)document.head.appendChild(e)}activateNewBody(){document.adoptNode(this.newElement),this.activateNewBodyScriptElements()}activateNewBodyScriptElements(){for(let e of this.newBodyScriptElements){let t=qi(e);e.replaceWith(t)}}async assignNewBody(){await this.renderElement(this.currentElement,this.newElement)}get unusedDynamicStylesheetElements(){return this.oldHeadStylesheetElements.filter(e=>e.getAttribute("data-turbo-track")==="dynamic")}get oldHeadStylesheetElements(){return this.currentHeadSnapshot.getStylesheetElementsNotInSnapshot(this.newHeadSnapshot)}get newHeadStylesheetElements(){return this.newHeadSnapshot.getStylesheetElementsNotInSnapshot(this.currentHeadSnapshot)}get newHeadScriptElements(){return this.newHeadSnapshot.getScriptElementsNotInSnapshot(this.currentHeadSnapshot)}get currentHeadProvisionalElements(){return this.currentHeadSnapshot.provisionalElements}get newHeadProvisionalElements(){return this.newHeadSnapshot.provisionalElements}get newBodyScriptElements(){return this.newElement.querySelectorAll("script")}},Xs=class extends pi{async render(){this.willRender&&await this.#e()}get renderMethod(){return"morph"}async#e(){this.#t(this.currentElement,this.newElement),this.#a(),Q("turbo:morph",{detail:{currentElement:this.currentElement,newElement:this.newElement}})}#t(e,t,r="outerHTML"){this.isMorphingTurboFrame=this.#l(e),Vd.morph(e,t,{morphStyle:r,callbacks:{beforeNodeAdded:this.#i,beforeNodeMorphed:this.#n,beforeAttributeUpdated:this.#s,beforeNodeRemoved:this.#o,afterNodeMorphed:this.#r}})}#i=e=>!(e.id&&e.hasAttribute("data-turbo-permanent")&&document.getElementById(e.id));#n=(e,t)=>{if(e instanceof HTMLElement)return!e.hasAttribute("data-turbo-permanent")&&(this.isMorphingTurboFrame||!this.#l(e))?!Q("turbo:before-morph-element",{cancelable:!0,target:e,detail:{newElement:t}}).defaultPrevented:!1};#s=(e,t,r)=>!Q("turbo:before-morph-attribute",{cancelable:!0,target:t,detail:{attributeName:e,mutationType:r}}).defaultPrevented;#r=(e,t)=>{t instanceof HTMLElement&&Q("turbo:morph-element",{target:e,detail:{newElement:t}})};#o=e=>this.#n(e);#a(){this.#d().forEach(e=>{this.#l(e)&&(this.#u(e),e.reload())})}#u(e){e.addEventListener("turbo:before-frame-render",t=>{t.detail.render=this.#h},{once:!0})}#h=(e,t)=>{Q("turbo:before-frame-morph",{target:e,detail:{currentElement:e,newElement:t}}),this.#t(e,t.children,"innerHTML")};#l(e){return e.src&&e.refresh==="morph"}#d(){return Array.from(document.querySelectorAll("turbo-frame[src]")).filter(e=>!e.closest("[data-turbo-permanent]"))}},Ys=class{keys=[];snapshots={};constructor(e){this.size=e}has(e){return ln(e)in this.snapshots}get(e){if(this.has(e)){let t=this.read(e);return this.touch(e),t}}put(e,t){return this.write(e,t),this.touch(e),t}clear(){this.snapshots={}}read(e){return this.snapshots[ln(e)]}write(e,t){this.snapshots[ln(e)]=t}touch(e){let t=ln(e),r=this.keys.indexOf(t);r>-1&&this.keys.splice(r,1),this.keys.unshift(t),this.trim()}trim(){for(let e of this.keys.splice(this.size))delete this.snapshots[e]}},Zs=class extends pn{snapshotCache=new Ys(10);lastRenderedLocation=new URL(location.href);forceReloaded=!1;shouldTransitionTo(e){return this.snapshot.prefersViewTransitions&&e.prefersViewTransitions}renderPage(e,t=!1,r=!0,n){let o=this.isPageRefresh(n)&&this.snapshot.shouldMorphPage?Xs:pi,a=new o(this.snapshot,e,pi.renderElement,t,r);return a.shouldRender?n?.changeHistory():this.forceReloaded=!0,this.render(a)}renderError(e,t){t?.changeHistory();let r=new bn(this.snapshot,e,bn.renderElement,!1);return this.render(r)}clearSnapshotCache(){this.snapshotCache.clear()}async cacheSnapshot(e=this.snapshot){if(e.isCacheable){this.delegate.viewWillCacheSnapshot();let{lastRenderedLocation:t}=this;await ll();let r=e.clone();return this.snapshotCache.put(t,r),r}}getCachedSnapshotForLocation(e){return this.snapshotCache.get(e)}isPageRefresh(e){return!e||this.lastRenderedLocation.pathname===e.location.pathname&&e.action==="replace"}shouldPreserveScrollPosition(e){return this.isPageRefresh(e)&&this.snapshot.shouldPreserveScrollPosition}get snapshot(){return De.fromElement(this.element)}},Qs=class{selector="a[data-turbo-preload]";constructor(e,t){this.delegate=e,this.snapshotCache=t}start(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",this.#e):this.preloadOnLoadLinksForView(document.body)}stop(){document.removeEventListener("DOMContentLoaded",this.#e)}preloadOnLoadLinksForView(e){for(let t of e.querySelectorAll(this.selector))this.delegate.shouldPreloadLink(t)&&this.preloadURL(t)}async preloadURL(e){let t=new URL(e.href);if(this.snapshotCache.has(t))return;await new Lt(this,ke.get,t,new URLSearchParams,e).perform()}prepareRequest(e){e.headers["X-Sec-Purpose"]="prefetch"}async requestSucceededWithResponse(e,t){try{let r=await t.responseHTML,n=De.fromHTMLString(r);this.snapshotCache.put(e.url,n)}catch{}}requestStarted(e){}requestErrored(e){}requestFinished(e){}requestPreventedHandlingResponse(e,t){}requestFailedWithResponse(e,t){}#e=()=>{this.preloadOnLoadLinksForView(document.body)}},Js=class{constructor(e){this.session=e}clear(){this.session.clearCache()}resetCacheControl(){this.#e("")}exemptPageFromCache(){this.#e("no-cache")}exemptPageFromPreview(){this.#e("no-preview")}#e(e){Qh("turbo-cache-control",e)}},eo=class{navigator=new js(this);history=new Vs(this);view=new Zs(this,document.documentElement);adapter=new Hs(this);pageObserver=new Us(this);cacheObserver=new qs;linkPrefetchObserver=new $s(this,document);linkClickObserver=new mn(this,window);formSubmitObserver=new Vi(this,document);scrollObserver=new Ws(this);streamObserver=new Gs(this);formLinkClickObserver=new gn(this,document.documentElement);frameRedirector=new zs(this,document.documentElement);streamMessageRenderer=new Ks;cache=new Js(this);drive=!0;enabled=!0;progressBarDelay=500;started=!1;formMode="on";#e=150;constructor(e){this.recentRequests=e,this.preloader=new Qs(this,this.view.snapshotCache),this.debouncedRefresh=this.refresh,this.pageRefreshDebouncePeriod=this.pageRefreshDebouncePeriod}start(){this.started||(this.pageObserver.start(),this.cacheObserver.start(),this.linkPrefetchObserver.start(),this.formLinkClickObserver.start(),this.linkClickObserver.start(),this.formSubmitObserver.start(),this.scrollObserver.start(),this.streamObserver.start(),this.frameRedirector.start(),this.history.start(),this.preloader.start(),this.started=!0,this.enabled=!0)}disable(){this.enabled=!1}stop(){this.started&&(this.pageObserver.stop(),this.cacheObserver.stop(),this.linkPrefetchObserver.stop(),this.formLinkClickObserver.stop(),this.linkClickObserver.stop(),this.formSubmitObserver.stop(),this.scrollObserver.stop(),this.streamObserver.stop(),this.frameRedirector.stop(),this.history.stop(),this.preloader.stop(),this.started=!1)}registerAdapter(e){this.adapter=e}visit(e,t={}){let r=t.frame?document.getElementById(t.frame):null;if(r instanceof qe){let n=t.action||xt(r);r.delegate.proposeVisitIfNavigatedWithAction(r,n),r.src=e.toString()}else this.navigator.proposeVisit(le(e),t)}refresh(e,t){t&&this.recentRequests.has(t)||this.visit(e,{action:"replace",shouldCacheSnapshot:!1})}connectStreamSource(e){this.streamObserver.connectStreamSource(e)}disconnectStreamSource(e){this.streamObserver.disconnectStreamSource(e)}renderStreamMessage(e){this.streamMessageRenderer.render(lt.wrap(e))}clearCache(){this.view.clearSnapshotCache()}setProgressBarDelay(e){this.progressBarDelay=e}setFormMode(e){this.formMode=e}get location(){return this.history.location}get restorationIdentifier(){return this.history.restorationIdentifier}get pageRefreshDebouncePeriod(){return this.#e}set pageRefreshDebouncePeriod(e){this.refresh=id(this.debouncedRefresh.bind(this),e),this.#e=e}shouldPreloadLink(e){let t=e.hasAttribute("data-turbo-method"),r=e.hasAttribute("data-turbo-stream"),n=e.getAttribute("data-turbo-frame"),s=n=="_top"?null:document.getElementById(n)||ci(e,"turbo-frame:not([disabled])");if(t||r||s instanceof qe)return!1;{let o=new URL(e.href);return this.elementIsNavigatable(e)&&ot(o,this.snapshot.rootLocation)}}historyPoppedToLocationWithRestorationIdentifierAndDirection(e,t,r){this.enabled?this.navigator.startVisit(e,t,{action:"restore",historyChanged:!0,direction:r}):this.adapter.pageInvalidated({reason:"turbo_disabled"})}scrollPositionChanged(e){this.history.updateRestorationData({scrollPosition:e})}willSubmitFormLinkToLocation(e,t){return this.elementIsNavigatable(e)&&ot(t,this.snapshot.rootLocation)}submittedFormLinkToLocation(){}canPrefetchRequestToLocation(e,t){return this.elementIsNavigatable(e)&&ot(t,this.snapshot.rootLocation)}willFollowLinkToLocation(e,t,r){return this.elementIsNavigatable(e)&&ot(t,this.snapshot.rootLocation)&&this.applicationAllowsFollowingLinkToLocation(e,t,r)}followedLinkToLocation(e,t){let r=this.getActionForLink(e),n=e.hasAttribute("data-turbo-stream");this.visit(t.href,{action:r,acceptsStreamResponse:n})}allowsVisitingLocationWithAction(e,t){return this.locationWithActionIsSamePage(e,t)||this.applicationAllowsVisitingLocation(e)}visitProposedToLocation(e,t){rl(e),this.adapter.visitProposedToLocation(e,t)}visitStarted(e){e.acceptsStreamResponse||(hn(document.documentElement),this.view.markVisitDirection(e.direction)),rl(e.location),e.silent||this.notifyApplicationAfterVisitingLocation(e.location,e.action)}visitCompleted(e){this.view.unmarkVisitDirection(),dn(document.documentElement),this.notifyApplicationAfterPageLoad(e.getTimingMetrics())}locationWithActionIsSamePage(e,t){return this.navigator.locationWithActionIsSamePage(e,t)}visitScrolledToSamePageLocation(e,t){this.notifyApplicationAfterVisitingSamePageLocation(e,t)}willSubmitForm(e,t){let r=so(e,t);return this.submissionIsNavigatable(e,t)&&ot(le(r),this.snapshot.rootLocation)}formSubmitted(e,t){this.navigator.submitForm(e,t)}pageBecameInteractive(){this.view.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()}pageLoaded(){this.history.assumeControlOfScrollRestoration()}pageWillUnload(){this.history.relinquishControlOfScrollRestoration()}receivedMessageFromStream(e){this.renderStreamMessage(e)}viewWillCacheSnapshot(){this.navigator.currentVisit?.silent||this.notifyApplicationBeforeCachingSnapshot()}allowsImmediateRender({element:e},t){let r=this.notifyApplicationBeforeRender(e,t),{defaultPrevented:n,detail:{render:s}}=r;return this.view.renderer&&s&&(this.view.renderer.renderElement=s),!n}viewRenderedSnapshot(e,t,r){this.view.lastRenderedLocation=this.history.location,this.notifyApplicationAfterRender(r)}preloadOnLoadLinksForView(e){this.preloader.preloadOnLoadLinksForView(e)}viewInvalidated(e){this.adapter.pageInvalidated(e)}frameLoaded(e){this.notifyApplicationAfterFrameLoad(e)}frameRendered(e,t){this.notifyApplicationAfterFrameRender(e,t)}applicationAllowsFollowingLinkToLocation(e,t,r){return!this.notifyApplicationAfterClickingLinkToLocation(e,t,r).defaultPrevented}applicationAllowsVisitingLocation(e){return!this.notifyApplicationBeforeVisitingLocation(e).defaultPrevented}notifyApplicationAfterClickingLinkToLocation(e,t,r){return Q("turbo:click",{target:e,detail:{url:t.href,originalEvent:r},cancelable:!0})}notifyApplicationBeforeVisitingLocation(e){return Q("turbo:before-visit",{detail:{url:e.href},cancelable:!0})}notifyApplicationAfterVisitingLocation(e,t){return Q("turbo:visit",{detail:{url:e.href,action:t}})}notifyApplicationBeforeCachingSnapshot(){return Q("turbo:before-cache")}notifyApplicationBeforeRender(e,t){return Q("turbo:before-render",{detail:{newBody:e,...t},cancelable:!0})}notifyApplicationAfterRender(e){return Q("turbo:render",{detail:{renderMethod:e}})}notifyApplicationAfterPageLoad(e={}){return Q("turbo:load",{detail:{url:this.location.href,timing:e}})}notifyApplicationAfterVisitingSamePageLocation(e,t){dispatchEvent(new HashChangeEvent("hashchange",{oldURL:e.toString(),newURL:t.toString()}))}notifyApplicationAfterFrameLoad(e){return Q("turbo:frame-load",{target:e})}notifyApplicationAfterFrameRender(e,t){return Q("turbo:frame-render",{detail:{fetchResponse:e},target:t,cancelable:!0})}submissionIsNavigatable(e,t){if(this.formMode=="off")return!1;{let r=t?this.elementIsNavigatable(t):!0;return this.formMode=="optin"?r&&e.closest('[data-turbo="true"]')!=null:r&&this.elementIsNavigatable(e)}}elementIsNavigatable(e){let t=ci(e,"[data-turbo]"),r=ci(e,"turbo-frame");return this.drive||r?t?t.getAttribute("data-turbo")!="false":!0:t?t.getAttribute("data-turbo")=="true":!1}getActionForLink(e){return xt(e)||"advance"}get snapshot(){return this.view.snapshot}};function rl(i){Object.defineProperties(i,$d)}var $d={absoluteURL:{get(){return this.toString()}}},Z=new eo(ml),{cache:jd,navigator:Ud}=Z;function wl(){Z.start()}function Wd(i){Z.registerAdapter(i)}function Kd(i,e){Z.visit(i,e)}function El(i){Z.connectStreamSource(i)}function _l(i){Z.disconnectStreamSource(i)}function Gd(i){Z.renderStreamMessage(i)}function Xd(){console.warn("Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"),Z.clearCache()}function Yd(i){Z.setProgressBarDelay(i)}function Zd(i){zi.confirmMethod=i}function Qd(i){Z.setFormMode(i)}var Jd=Object.freeze({__proto__:null,navigator:Ud,session:Z,cache:jd,PageRenderer:pi,PageSnapshot:De,FrameRenderer:ji,fetch:gl,start:wl,registerAdapter:Wd,visit:Kd,connectStreamSource:El,disconnectStreamSource:_l,renderStreamMessage:Gd,clearCache:Xd,setProgressBarDelay:Yd,setConfirmMethod:Zd,setFormMode:Qd}),to=class extends Error{},io=class{fetchResponseLoaded=e=>Promise.resolve();#e=null;#t=()=>{};#i=!1;#n=!1;#s=new Set;action=null;constructor(e){this.element=e,this.view=new Ps(this,this.element),this.appearanceObserver=new Rs(this,this.element),this.formLinkClickObserver=new gn(this,this.element),this.linkInterceptor=new fn(this,this.element),this.restorationIdentifier=at(),this.formSubmitObserver=new Vi(this,this.element)}connect(){this.#i||(this.#i=!0,this.loadingStyle==oi.lazy?this.appearanceObserver.start():this.#r(),this.formLinkClickObserver.start(),this.linkInterceptor.start(),this.formSubmitObserver.start())}disconnect(){this.#i&&(this.#i=!1,this.appearanceObserver.stop(),this.formLinkClickObserver.stop(),this.linkInterceptor.stop(),this.formSubmitObserver.stop())}disabledChanged(){this.loadingStyle==oi.eager&&this.#r()}sourceURLChanged(){this.#v("src")||(this.element.isConnected&&(this.complete=!1),(this.loadingStyle==oi.eager||this.#n)&&this.#r())}sourceURLReloaded(){let{src:e}=this.element;return this.element.removeAttribute("complete"),this.element.src=null,this.element.src=e,this.element.loaded}loadingStyleChanged(){this.loadingStyle==oi.lazy?this.appearanceObserver.start():(this.appearanceObserver.stop(),this.#r())}async#r(){this.enabled&&this.isActive&&!this.complete&&this.sourceURL&&(this.element.loaded=this.#a(le(this.sourceURL)),this.appearanceObserver.stop(),await this.element.loaded,this.#n=!0)}async loadResponse(e){(e.redirected||e.succeeded&&e.isHTML)&&(this.sourceURL=e.response.url);try{let t=await e.responseHTML;if(t){let r=cl(t);De.fromDocument(r).isVisitable?await this.#o(e,r):await this.#h(e)}}finally{this.fetchResponseLoaded=()=>Promise.resolve()}}elementAppearedInViewport(e){this.proposeVisitIfNavigatedWithAction(e,xt(e)),this.#r()}willSubmitFormLinkToLocation(e){return this.#p(e)}submittedFormLinkToLocation(e,t,r){let n=this.#c(e);n&&r.setAttribute("data-turbo-frame",n.id)}shouldInterceptLinkClick(e,t,r){return this.#p(e)}linkClickIntercepted(e,t){this.#u(e,t)}willSubmitForm(e,t){return e.closest("turbo-frame")==this.element&&this.#p(e,t)}formSubmitted(e,t){this.formSubmission&&this.formSubmission.stop(),this.formSubmission=new zi(this,e,t);let{fetchRequest:r}=this.formSubmission;this.prepareRequest(r),this.formSubmission.start()}prepareRequest(e){e.headers["Turbo-Frame"]=this.id,this.currentNavigationElement?.hasAttribute("data-turbo-stream")&&e.acceptResponseType(lt.contentType)}requestStarted(e){hn(this.element)}requestPreventedHandlingResponse(e,t){this.#t()}async requestSucceededWithResponse(e,t){await this.loadResponse(t),this.#t()}async requestFailedWithResponse(e,t){await this.loadResponse(t),this.#t()}requestErrored(e,t){console.error(t),this.#t()}requestFinished(e){dn(this.element)}formSubmissionStarted({formElement:e}){hn(e,this.#c(e))}formSubmissionSucceededWithResponse(e,t){let r=this.#c(e.formElement,e.submitter);r.delegate.proposeVisitIfNavigatedWithAction(r,xt(e.submitter,e.formElement,r)),r.delegate.loadResponse(t),e.isSafe||Z.clearCache()}formSubmissionFailedWithResponse(e,t){this.element.delegate.loadResponse(t),Z.clearCache()}formSubmissionErrored(e,t){console.error(t)}formSubmissionFinished({formElement:e}){dn(e,this.#c(e))}allowsImmediateRender({element:e},t){let r=Q("turbo:before-frame-render",{target:this.element,detail:{newFrame:e,...t},cancelable:!0}),{defaultPrevented:n,detail:{render:s}}=r;return this.view.renderer&&s&&(this.view.renderer.renderElement=s),!n}viewRenderedSnapshot(e,t,r){}preloadOnLoadLinksForView(e){Z.preloadOnLoadLinksForView(e)}viewInvalidated(){}willRenderFrame(e,t){this.previousFrameElement=e.cloneNode(!0)}visitCachedSnapshot=({element:e})=>{let t=e.querySelector("#"+this.element.id);t&&this.previousFrameElement&&t.replaceChildren(...this.previousFrameElement.children),delete this.previousFrameElement};async#o(e,t){let r=await this.extractForeignFrameElement(t.body);if(r){let n=new di(r),s=new ji(this,this.view.snapshot,n,ji.renderElement,!1,!1);this.view.renderPromise&&await this.view.renderPromise,this.changeHistory(),await this.view.render(s),this.complete=!0,Z.frameRendered(e,this.element),Z.frameLoaded(this.element),await this.fetchResponseLoaded(e)}else this.#l(e)&&this.#d(e)}async#a(e){let t=new Lt(this,ke.get,e,new URLSearchParams,this.element);return this.#e?.cancel(),this.#e=t,new Promise(r=>{this.#t=()=>{this.#t=()=>{},this.#e=null,r()},t.perform()})}#u(e,t,r){let n=this.#c(e,r);n.delegate.proposeVisitIfNavigatedWithAction(n,xt(r,e,n)),this.#y(e,()=>{n.src=t})}proposeVisitIfNavigatedWithAction(e,t=null){if(this.action=t,this.action){let r=De.fromElement(e).clone(),{visitCachedSnapshot:n}=e.delegate;e.delegate.fetchResponseLoaded=async s=>{if(e.src){let{statusCode:o,redirected:a}=s,l=await s.responseHTML,p={response:{statusCode:o,redirected:a,responseHTML:l},visitCachedSnapshot:n,willRender:!1,updateHistory:!1,restorationIdentifier:this.restorationIdentifier,snapshot:r};this.action&&(p.action=this.action),Z.visit(e.src,p)}}}}changeHistory(){if(this.action){let e=hl(this.action);Z.history.update(e,le(this.element.src||""),this.restorationIdentifier)}}async#h(e){console.warn(`The response (${e.statusCode}) from <turbo-frame id="${this.element.id}"> is performing a full page visit due to turbo-visit-control.`),await this.#f(e.response)}#l(e){this.element.setAttribute("complete","");let t=e.response,r=async(s,o)=>{s instanceof Response?this.#f(s):Z.visit(s,o)};return!Q("turbo:frame-missing",{target:this.element,detail:{response:t,visit:r},cancelable:!0}).defaultPrevented}#d(e){this.view.missing(),this.#m(e)}#m(e){let t=`The response (${e.statusCode}) did not contain the expected <turbo-frame id="${this.element.id}"> and will be ignored. To perform a full page visit instead, set turbo-visit-control to reload.`;throw new to(t)}async#f(e){let t=new Hi(e),r=await t.responseHTML,{location:n,redirected:s,statusCode:o}=t;return Z.visit(n,{response:{redirected:s,statusCode:o,responseHTML:r}})}#c(e,t){let r=un("data-turbo-frame",t,e)||this.element.getAttribute("target");return nl(r)??this.element}async extractForeignFrameElement(e){let t,r=CSS.escape(this.id);try{if(t=sl(e.querySelector(`turbo-frame#${r}`),this.sourceURL),t)return t;if(t=sl(e.querySelector(`turbo-frame[src][recurse~=${r}]`),this.sourceURL),t)return await t.loaded,await this.extractForeignFrameElement(t)}catch(n){return console.error(n),new qe}return null}#g(e,t){let r=so(e,t);return ot(le(r),this.rootLocation)}#p(e,t){let r=un("data-turbo-frame",t,e)||this.element.getAttribute("target");if(e instanceof HTMLFormElement&&!this.#g(e,t)||!this.enabled||r=="_top")return!1;if(r){let n=nl(r);if(n)return!n.disabled}return!(!Z.elementIsNavigatable(e)||t&&!Z.elementIsNavigatable(t))}get id(){return this.element.id}get enabled(){return!this.element.disabled}get sourceURL(){if(this.element.src)return this.element.src}set sourceURL(e){this.#b("src",()=>{this.element.src=e??null})}get loadingStyle(){return this.element.loading}get isLoading(){return this.formSubmission!==void 0||this.#t()!==void 0}get complete(){return this.element.hasAttribute("complete")}set complete(e){e?this.element.setAttribute("complete",""):this.element.removeAttribute("complete")}get isActive(){return this.element.isActive&&this.#i}get rootLocation(){let t=this.element.ownerDocument.querySelector('meta[name="turbo-root"]')?.content??"/";return le(t)}#v(e){return this.#s.has(e)}#b(e,t){this.#s.add(e),t(),this.#s.delete(e)}#y(e,t){this.currentNavigationElement=e,t(),delete this.currentNavigationElement}};function nl(i){if(i!=null){let e=document.getElementById(i);if(e instanceof qe)return e}}function sl(i,e){if(i){let t=i.getAttribute("src");if(t!=null&&e!=null&&qh(t,e))throw new Error(`Matching <turbo-frame id="${i.id}"> element has a source URL which references itself`);if(i.ownerDocument!==document&&(i=document.importNode(i,!0)),i instanceof qe)return i.connectedCallback(),i.disconnectedCallback(),i}}var Al={after(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i.nextSibling))},append(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.append(this.templateContent))},before(){this.targetElements.forEach(i=>i.parentElement?.insertBefore(this.templateContent,i))},prepend(){this.removeDuplicateTargetChildren(),this.targetElements.forEach(i=>i.prepend(this.templateContent))},remove(){this.targetElements.forEach(i=>i.remove())},replace(){this.targetElements.forEach(i=>i.replaceWith(this.templateContent))},update(){this.targetElements.forEach(i=>{i.innerHTML="",i.append(this.templateContent)})},refresh(){Z.refresh(this.baseURI,this.requestId)}},ro=class i extends HTMLElement{static async renderElement(e){await e.performAction()}async connectedCallback(){try{await this.render()}catch(e){console.error(e)}finally{this.disconnect()}}async render(){return this.renderPromise??=(async()=>{let e=this.beforeRenderEvent;this.dispatchEvent(e)&&(await li(),await e.detail.render(this))})()}disconnect(){try{this.remove()}catch{}}removeDuplicateTargetChildren(){this.duplicateChildren.forEach(e=>e.remove())}get duplicateChildren(){let e=this.targetElements.flatMap(r=>[...r.children]).filter(r=>!!r.id),t=[...this.templateContent?.children||[]].filter(r=>!!r.id).map(r=>r.id);return e.filter(r=>t.includes(r.id))}get performAction(){if(this.action){let e=Al[this.action];if(e)return e;this.#e("unknown action")}this.#e("action attribute is missing")}get targetElements(){if(this.target)return this.targetElementsById;if(this.targets)return this.targetElementsByQuery;this.#e("target or targets attribute is missing")}get templateContent(){return this.templateElement.content.cloneNode(!0)}get templateElement(){if(this.firstElementChild===null){let e=this.ownerDocument.createElement("template");return this.appendChild(e),e}else if(this.firstElementChild instanceof HTMLTemplateElement)return this.firstElementChild;this.#e("first child element must be a <template> element")}get action(){return this.getAttribute("action")}get target(){return this.getAttribute("target")}get targets(){return this.getAttribute("targets")}get requestId(){return this.getAttribute("request-id")}#e(e){throw new Error(`${this.description}: ${e}`)}get description(){return(this.outerHTML.match(/<[^>]+>/)??[])[0]??"<turbo-stream>"}get beforeRenderEvent(){return new CustomEvent("turbo:before-stream-render",{bubbles:!0,cancelable:!0,detail:{newStream:this,render:i.renderElement}})}get targetElementsById(){let e=this.ownerDocument?.getElementById(this.target);return e!==null?[e]:[]}get targetElementsByQuery(){let e=this.ownerDocument?.querySelectorAll(this.targets);return e.length!==0?Array.prototype.slice.call(e):[]}},no=class extends HTMLElement{streamSource=null;connectedCallback(){this.streamSource=this.src.match(/^ws{1,2}:/)?new WebSocket(this.src):new EventSource(this.src),El(this.streamSource)}disconnectedCallback(){this.streamSource&&(this.streamSource.close(),_l(this.streamSource))}get src(){return this.getAttribute("src")||""}};qe.delegateConstructor=io;customElements.get("turbo-frame")===void 0&&customElements.define("turbo-frame",qe);customElements.get("turbo-stream")===void 0&&customElements.define("turbo-stream",ro);customElements.get("turbo-stream-source")===void 0&&customElements.define("turbo-stream-source",no);(()=>{let i=document.currentScript;if(i&&!i.hasAttribute("data-turbo-suppress-warning"))for(i=i.parentElement;i;){if(i==document.body)return console.warn(ul`
|
78
78
|
You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!
|
79
79
|
|
80
80
|
Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.
|
@@ -83,7 +83,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error
|
|
83
83
|
|
84
84
|
——
|
85
85
|
Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: %s
|
86
|
-
`,i.outerHTML);i=i.parentElement}})();window.Turbo={...
|
86
|
+
`,i.outerHTML);i=i.parentElement}})();window.Turbo={...Jd,StreamActions:Al};wl();["turbo:click","turbo:before-visit","turbo:visit","turbo:submit-start","turbo:before-fetch-request","turbo:before-fetch-response","turbo:submit-end","turbo:before-cache","turbo:before-render","turbo:before-stream-render","turbo:render","turbo:load","turbo:before-frame-render","turbo:frame-render","turbo:frame-load","turbo:frame-missing","turbo:fetch-request-error","turbo:reload","turbo:morph","turbo:before-morph-element","turbo:morph-attribute","turbo:morph"].forEach(i=>{document.addEventListener(i,e=>{console.log(e.type,e)})});var ep=ir.start();Cs(ep);})();
|
87
87
|
/*! Bundled license information:
|
88
88
|
|
89
89
|
dompurify/dist/purify.es.mjs:
|