(()=>{var pe=Object.defineProperty;var ve=(s,e,t)=>e in s?pe(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var o=(s,e,t)=>(ve(s,typeof e!="symbol"?e+"":e,t),t);var E=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=be(e);for(let r of this.bindings){if(t.immediatePropagationStopped)break;r.handleEvent(t)}}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{let r=e.index,i=t.index;return ri?1:0})}};function be(s){if("immediatePropagationStopped"in s)return s;{let{stopImmediatePropagation:e}=s;return Object.assign(s,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,e.call(this)}})}}var T=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){this.fetchEventListenerForBinding(e).bindingDisconnected(e)}handleError(e,t,r={}){this.application.handleError(e,`Error ${t}`,r)}fetchEventListenerForBinding(e){let{eventTarget:t,eventName:r,eventOptions:i}=e;return this.fetchEventListener(t,r,i)}fetchEventListener(e,t,r){let i=this.fetchEventListenerMapForEventTarget(e),n=this.cacheKey(t,r),a=i.get(n);return a||(a=this.createEventListener(e,t,r),i.set(n,a)),a}createEventListener(e,t,r){let i=new E(e,t,r);return this.started&&i.connect(),i}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){let r=[e];return Object.keys(t).sort().forEach(i=>{r.push(`${t[i]?"":"!"}${i}`)}),r.join(":")}},ye=/^((.+?)(@(window|document))?->)?(.+?)(#([^:]+?))(:(.+))?$/;function Ae(s){let t=s.trim().match(ye)||[];return{eventTarget:we(t[4]),eventName:t[2],eventOptions:t[9]?Ee(t[9]):{},identifier:t[5],methodName:t[7]}}function we(s){if(s=="window")return window;if(s=="document")return document}function Ee(s){return s.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})}function Te(s){if(s==window)return"window";if(s==document)return"document"}function ee(s){return s.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function A(s){return s.charAt(0).toUpperCase()+s.slice(1)}function te(s){return s.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function Ce(s){return s.match(/[^\s]+/g)||[]}var C=class{constructor(e,t,r){this.element=e,this.index=t,this.eventTarget=r.eventTarget||e,this.eventName=r.eventName||Oe(e)||w("missing event name"),this.eventOptions=r.eventOptions||{},this.identifier=r.identifier||w("missing identifier"),this.methodName=r.methodName||w("missing method name")}static forToken(e){return new this(e.element,e.index,Ae(e.content))}toString(){let e=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}->${this.identifier}#${this.methodName}`}get params(){return this.eventTarget instanceof Element?this.getParamsFromEventTargetAttributes(this.eventTarget):{}}getParamsFromEventTargetAttributes(e){let t={},r=new RegExp(`^data-${this.identifier}-(.+)-param$`);return Array.from(e.attributes).forEach(({name:n,value:a})=>{let c=n.match(r),l=c&&c[1];l&&Object.assign(t,{[ee(l)]:ke(a)})}),t}get eventTargetName(){return Te(this.eventTarget)}},Y={a:s=>"click",button:s=>"click",form:s=>"submit",details:s=>"toggle",input:s=>s.getAttribute("type")=="submit"?"click":"input",select:s=>"change",textarea:s=>"input"};function Oe(s){let e=s.tagName.toLowerCase();if(e in Y)return Y[e](s)}function w(s){throw new Error(s)}function ke(s){try{return JSON.parse(s)}catch{return s}}var O=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){this.willBeInvokedByEvent(e)&&this.invokeWithEvent(e)}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}"`)}invokeWithEvent(e){let{target:t,currentTarget:r}=e;try{let{params:i}=this.action,n=Object.assign(e,{params:i});this.method.call(this.controller,n),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:r,action:this.methodName})}catch(i){let{identifier:n,controller:a,element:c,index:l}=this,fe={identifier:n,controller:a,element:c,index:l,event:e};this.context.handleError(i,`invoking action "${this.action}"`,fe)}}willBeInvokedByEvent(e){let t=e.target;return 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}},k=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){let r=e;this.elements.has(r)?this.delegate.elementAttributeChanged&&this.matchElement(r)?this.delegate.elementAttributeChanged(r,t):this.removeElement(r):this.matchElement(r)&&this.addElement(r)}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))}},L=class{constructor(e,t,r){this.attributeName=t,this.delegate=r,this.elementObserver=new k(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)}},S=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 i=this.element.getAttribute(e);if(this.stringMap.get(e)!=i&&this.stringMapValueChanged(i,r,t),i==null){let n=this.stringMap.get(e);this.stringMap.delete(e),n&&this.stringMapKeyRemoved(r,e,n)}else this.stringMap.set(e,i)}}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())}};function Le(s,e,t){se(s,e).add(t)}function Se(s,e,t){se(s,e).delete(t),Ve(s,e)}function se(s,e){let t=s.get(e);return t||(t=new Set,s.set(e,t)),t}function Ve(s,e){let t=s.get(e);t!=null&&t.size==0&&s.delete(e)}var v=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){Le(this.valuesByKey,e,t)}delete(e,t){Se(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 b=class{constructor(e,t,r){this.attributeObserver=new L(e,t,this),this.delegate=r,this.tokensByElement=new v}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),i=Be(t,r).findIndex(([n,a])=>!xe(n,a));return i==-1?[[],[]]:[t.slice(i),r.slice(i)]}readTokensForElement(e){let t=this.attributeName,r=e.getAttribute(t)||"";return Me(r,e,t)}};function Me(s,e,t){return s.trim().split(/\s+/).filter(r=>r.length).map((r,i)=>({element:e,attributeName:t,content:r,index:i}))}function Be(s,e){let t=Math.max(s.length,e.length);return Array.from({length:t},(r,i)=>[s[i],e[i]])}function xe(s,e){return s&&e&&s.index==e.index&&s.content==e.content}var y=class{constructor(e,t,r){this.tokenListObserver=new b(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}}}},V=class{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new y(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 O(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)),this.bindingsByAction.clear()}parseValueForToken(e){let t=C.forToken(e);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},M=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new S(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap,this.invokeChangedCallbacksForDefaultValues()}start(){this.stringMapObserver.start()}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 i=this.valueDescriptorNameMap[t];e!==null&&(r===null&&(r=i.writer(i.defaultValue)),this.invokeChangedCallback(t,e,r))}stringMapKeyRemoved(e,t,r){let i=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,i.writer(this.receiver[e]),r):this.invokeChangedCallback(e,i.writer(i.defaultValue),r)}invokeChangedCallbacksForDefaultValues(){for(let{key:e,name:t,defaultValue:r,writer:i}of this.valueDescriptors)r!=null&&!this.controller.data.has(e)&&this.invokeChangedCallback(t,i(r),void 0)}invokeChangedCallback(e,t,r){let i=`${e}Changed`,n=this.receiver[i];if(typeof n=="function"){let a=this.valueDescriptorNameMap[e],c=a.reader(t),l=r;r&&(l=a.reader(r)),n.call(this.receiver,c,l)}}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${A(t.name)}`;return this.receiver[r]}},B=class{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new v}start(){this.tokenListObserver||(this.tokenListObserver=new b(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}},x=class{constructor(e,t){this.logDebugActivity=(r,i={})=>{let{identifier:n,controller:a,element:c}=this;i=Object.assign({identifier:n,controller:a,element:c},i),this.application.logDebugActivity(this.identifier,r,i)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new V(this,this.dispatcher),this.valueObserver=new M(this,this.controller),this.targetObserver=new B(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();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}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:i,controller:n,element:a}=this;r=Object.assign({identifier:i,controller:n,element:a},r),this.application.handleError(e,`Error ${t}`,r)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}invokeControllerMethod(e,...t){let r=this.controller;typeof r[e]=="function"&&r[e](...t)}};function U(s,e){let t=re(s);return Array.from(t.reduce((r,i)=>(Fe(i,e).forEach(n=>r.add(n)),r),new Set))}function Ne(s,e){return re(s).reduce((r,i)=>(r.push(...Ie(i,e)),r),[])}function re(s){let e=[];for(;s;)e.push(s),s=Object.getPrototypeOf(s);return e.reverse()}function Fe(s,e){let t=s[e];return Array.isArray(t)?t:[]}function Ie(s,e){let t=s[e];return t?Object.keys(t).map(r=>[r,t[r]]):[]}function De(s){return $e(s,Pe(s))}function $e(s,e){let t=Ue(s),r=Ke(s.prototype,e);return Object.defineProperties(t.prototype,r),t}function Pe(s){return U(s,"blessings").reduce((t,r)=>{let i=r(s);for(let n in i){let a=t[n]||{};t[n]=Object.assign(a,i[n])}return t},{})}function Ke(s,e){return Re(e).reduce((t,r)=>{let i=je(s,e,r);return i&&Object.assign(t,{[r]:i}),t},{})}function je(s,e,t){let r=Object.getOwnPropertyDescriptor(s,t);if(!(r&&"value"in r)){let n=Object.getOwnPropertyDescriptor(e,t).value;return r&&(n.get=r.get||n.get,n.set=r.set||n.set),n}}var Re=(()=>typeof Object.getOwnPropertySymbols=="function"?s=>[...Object.getOwnPropertyNames(s),...Object.getOwnPropertySymbols(s)]:Object.getOwnPropertyNames)(),Ue=(()=>{function s(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=s(function(){this.a.call(this)});return r.prototype.a=function(){},new r}try{return e(),s}catch{return r=>class extends r{}}})();function _e(s){return{identifier:s.identifier,controllerConstructor:De(s.controllerConstructor)}}var N=class{constructor(e,t){this.application=e,this.definition=_e(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 x(this,e),this.contextsByScope.set(e,t)),t}},F=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 Ce(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},I=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}-${te(e)}`}},D=class{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,r){let i=this.warnedKeysByObject.get(e);i||(i=new Set,this.warnedKeysByObject.set(e,i)),i.has(t)||(i.add(t),this.logger.warn(r,e))}};function $(s,e){return`[${s}~="${e}"]`}var P=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 $(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 $(this.schema.targetAttribute,t)}deprecate(e,t){if(e){let{identifier:r}=this,i=this.schema.targetAttribute,n=this.schema.targetAttributeForScope(r);this.guide.warn(e,`target:${t}`,`Please replace ${i}="${r}.${t}" with ${n}="${t}". The ${i} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}},K=class{constructor(e,t,r,i){this.targets=new P(this),this.classes=new F(this),this.data=new I(this),this.containsElement=n=>n.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=r,this.guide=new D(i)}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 $(this.schema.controllerAttribute,this.identifier)}},j=class{constructor(e,t,r){this.element=e,this.schema=t,this.delegate=r,this.valueListObserver=new y(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,i=this.fetchScopesByIdentifierForElement(t),n=i.get(r);return n||(n=this.delegate.createScopeForElementAndIdentifier(t,r),i.set(r,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}},R=class{constructor(e){this.application=e,this.scopeObserver=new j(this.element,this.schema,this),this.scopesByIdentifier=new v,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 N(this.application,e);this.connectModule(t)}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(i=>i.element==e)}handleError(e,t,r){this.application.handleError(e,t,r)}createScopeForElementAndIdentifier(e,t){return new K(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))}},ze={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:s=>`data-${s}-target`},m=class{constructor(e=document.documentElement,t=ze){this.logger=console,this.debug=!1,this.logDebugActivity=(r,i,n={})=>{this.debug&&this.logFormattedMessage(r,i,n)},this.element=e,this.schema=t,this.dispatcher=new T(this),this.router=new R(this)}static start(e,t){let r=new m(e,t);return r.start(),r}async start(){await qe(),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){t.shouldLoad&&this.load({identifier:e,controllerConstructor:t})}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(i=>this.router.loadDefinition(i))}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(i=>this.router.unloadIdentifier(i))}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 i;this.logger.error(`%s %o %o`,t,e,r),(i=window.onerror)===null||i===void 0||i.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 qe(){return new Promise(s=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>s()):s()})}function We(s){return U(s,"classes").reduce((t,r)=>Object.assign(t,Je(r)),{})}function Je(s){return{[`${s}Class`]:{get(){let{classes:e}=this;if(e.has(s))return e.get(s);{let t=e.getAttributeName(s);throw new Error(`Missing attribute "${t}"`)}}},[`${s}Classes`]:{get(){return this.classes.getAll(s)}},[`has${A(s)}Class`]:{get(){return this.classes.has(s)}}}}function Ze(s){return U(s,"targets").reduce((t,r)=>Object.assign(t,Ge(r)),{})}function Ge(s){return{[`${s}Target`]:{get(){let e=this.targets.find(s);if(e)return e;throw new Error(`Missing target element "${s}" for "${this.identifier}" controller`)}},[`${s}Targets`]:{get(){return this.targets.findAll(s)}},[`has${A(s)}Target`]:{get(){return this.targets.has(s)}}}}function He(s){let e=Ne(s,"values"),t={valueDescriptorMap:{get(){return e.reduce((r,i)=>{let n=ie(i),a=this.data.getAttributeNameForKey(n.key);return Object.assign(r,{[a]:n})},{})}}};return e.reduce((r,i)=>Object.assign(r,Ye(i)),t)}function Ye(s){let e=ie(s),{key:t,name:r,reader:i,writer:n}=e;return{[r]:{get(){let a=this.data.get(t);return a!==null?i(a):e.defaultValue},set(a){a===void 0?this.data.delete(t):this.data.set(t,n(a))}},[`has${A(r)}`]:{get(){return this.data.has(t)||e.hasCustomDefaultValue}}}}function ie([s,e]){return tt(s,e)}function _(s){switch(s){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function z(s){switch(typeof s){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(s))return"array";if(Object.prototype.toString.call(s)==="[object Object]")return"object"}function Qe(s){let e=_(s.type);if(e){let t=z(s.default);if(e!==t)throw new Error(`Type "${e}" must match the type of the default value. Given default value: "${s.default}" as "${t}"`);return e}}function Xe(s){let e=Qe(s),t=z(s),r=_(s),i=e||t||r;if(i)return i;throw new Error(`Unknown value type "${s}"`)}function et(s){let e=_(s);if(e)return st[e];let t=s.default;return t!==void 0?t:s}function tt(s,e){let t=`${te(s)}-value`,r=Xe(e);return{type:r,key:t,name:ee(t),get defaultValue(){return et(e)},get hasCustomDefaultValue(){return z(e)!==void 0},reader:rt[r],writer:Q[r]||Q.default}}var st={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},rt={array(s){let e=JSON.parse(s);if(!Array.isArray(e))throw new TypeError("Expected array");return e},boolean(s){return!(s=="0"||s=="false")},number(s){return Number(s)},object(s){let e=JSON.parse(s);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError("Expected object");return e},string(s){return s}},Q={default:it,array:X,object:X};function X(s){return JSON.stringify(s)}function it(s){return`${s}`}var h=class{constructor(e){this.context=e}static get shouldLoad(){return!0}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 classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:r={},prefix:i=this.identifier,bubbles:n=!0,cancelable:a=!0}={}){let c=i?`${i}:${e}`:e,l=new CustomEvent(c,{detail:r,bubbles:n,cancelable:a});return t.dispatchEvent(l),l}};h.blessings=[We,Ze,He];h.targets=[];h.values={};var u=class extends h{initialize(){let s=new URL(document.location);this.currentSearchValue=s.searchParams.get("q")?s.searchParams.get("q"):"",this.currentSortOrderValue=s.searchParams.get("o")?s.searchParams.get("o"):-1,this.currentSortValue=s.searchParams.get("s")?s.searchParams.get("s"):"coveredpercent",this.currentViewValue=s.searchParams.get("tabName")?s.searchParams.get("tabName"):"All Files"}connect(){this.currentSearchValue!=""&&this.search(),this.currentSortValue!=""&&this.order()}sortEvent(s){let e=new URL(document.location);this.currentSortValue=s.currentTarget.value,e.searchParams.set("s",s.currentTarget.value),window.history.pushState({},"",e),this.currentViewValue=e.searchParams.get("tabName")?e.searchParams.get("tabName"):"All Files",this.sort()}orderEvent(s){let e=new URL(document.location);this.currentSortOrderValue=s.currentTarget.value,e.searchParams.set("o",s.currentTarget.value),window.history.pushState({},"",e),this.currentViewValue=e.searchParams.get("tabName")?e.searchParams.get("tabName"):"All Files",this.order()}order(){this.currentSortOrderValue===-1?(this.ascTarget.classList.remove(...this.buttonInactiveClasses),this.ascTarget.classList.add(this.buttonActiveClasses),this.descTarget.classList.remove(this.buttonActiveClasses),this.descTarget.classList.add(...this.buttonInactiveClasses)):this.currentSortOrderValue===1&&(this.ascTarget.classList.remove(this.buttonActiveClasses),this.ascTarget.classList.add(...this.buttonInactiveClasses),this.descTarget.classList.remove(...this.buttonInactiveClasses),this.descTarget.classList.add(this.buttonActiveClasses)),this.sort()}sort(){let s=this.currentSortValue,e=this.currentSortOrderValue;this.sortTarget.value=this.currentSortValue;let t=Array.from(document.getElementById(this.currentViewValue+"-list").children).filter(r=>r.id!=this.currentViewValue+"-hideListItem");t.sort(function(r,i){let n,a;switch(s){case"coveredpercent":n=r.dataset.coveredPercent,a=i.dataset.coveredPercent;break;case"lines":n=r.dataset.lines,a=i.dataset.lines;break;case"releventlines":n=r.dataset.releventLines,a=i.dataset.releventLines;break;case"coveredlines":n=r.dataset.coveredLines,a=i.dataset.coveredLines;break;case"missedlines":n=r.dataset.missedLines,a=i.dataset.missedLines;break;case"coveredstrength":n=r.dataset.coveredStrength,a=i.dataset.coveredStrength;break;case"branchcoveredpercentches":n=r.dataset.branchCoveredPercent,a=i.dataset.branchCoveredPercent;break;case"branches":n=r.dataset.branches,a=i.dataset.branches;break;case"branchescoveredes":n=r.dataset.branchesCovered,a=i.dataset.branchesCovered;break;case"branchesmisseds":n=r.dataset.branchesMissed,a=i.dataset.branchesMissed;break;default:n=0,a=0;break}return e*n.localeCompare(a,void 0,{numeric:!0})});for(let r=0;ri.id!=this.currentViewValue+"-hideListItem");for(let i=0;i-1?n.classList.remove(this.hideClass):n.classList.add(this.hideClass)}let e=s.length,t=Array.from(s).filter(i=>i.classList.contains(this.hideClass)).length,r=document.getElementById(this.currentViewValue+"-hideListItem");e==t?r.classList.remove(this.hideClass):r.classList.add(this.hideClass)}};o(u,"targets",["asc","desc","sort"]),o(u,"classes",["hide","buttonActive","buttonInactive"]),o(u,"values",{currentSearch:String,currentSort:String,currentSortOrder:Number,currentView:String});var f=class extends h{initialize(){let s=new URL(document.location);this.currentActiveValue=s.searchParams.get("tabName")?s.searchParams.get("tabName"):""}connect(){this.currentActiveValue!=""&&this.navigate()}navigateEvent(s){let e=new URL(document.location);this.currentActiveValue=s.currentTarget.dataset.index,e.searchParams.set("tabName",s.currentTarget.dataset.index),window.history.pushState({},"",e),this.navigate()}navigate(){document.querySelectorAll(".navBody").forEach(t=>{t.classList.contains(this.hideClass)||t.classList.add(this.hideClass)});let e=document.querySelectorAll(".nav");e.forEach(t=>{t.classList.contains(...this.activeClasses)&&(t.classList.remove(...this.activeClasses),t.classList.add(...this.inactiveClasses))}),e.forEach(t=>{t.dataset.index==this.currentActiveValue&&(t.classList.remove(...this.inactiveClasses),t.classList.add(...this.activeClasses))}),document.getElementById(this.currentActiveValue).classList.remove(this.hideClass)}};o(f,"classes",["hide","active","inactive"]),o(f,"values",{currentActive:String});var p=class extends h{initialize(){window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?(localStorage.setItem("color-theme","dark"),this.bodyTarget.classList.add(this.darkClass)):localStorage.setItem("color-theme","light")}toggle(){localStorage.getItem("color-theme")?localStorage.getItem("color-theme")==="light"?(this.bodyTarget.classList.add(this.darkClass),localStorage.setItem("color-theme","dark")):(this.bodyTarget.classList.remove(this.darkClass),localStorage.setItem("color-theme","light")):this.bodyTarget.classList.contains("dark")?(this.bodyTarget.classList.remove(this.darkClass),localStorage.setItem("color-theme","light")):(this.bodyTarget.classList.add(this.darkClass),localStorage.setItem("color-theme","dark"))}};o(p,"targets",["body"]),o(p,"classes",["dark"]);var d=class extends h{initialize(){this.currentActiveValue=window.location.hash.replace("#","")}connect(){this.currentActiveValue!=""&&this.open()}disconnect(){this.close()}openEvent(s){this.currentActiveValue=s.currentTarget.dataset.index,this.open()}open(){document.getElementById(this.currentActiveValue).classList.remove(this.hideClass),this.containerTarget.classList.remove(this.hideClass),requestAnimationFrame(()=>{this.backgroundTarget.classList.add(this.toBackgroundClass),this.viewTarget.classList.add(this.toViewClass),setTimeout(()=>{this.backgroundTarget.classList.remove(this.fromBackgroundClass),this.viewTarget.classList.remove(this.fromViewClass)},this.openTimeoutValue)})}close(){this.backgroundTarget.classList.remove(this.toBackgroundClass),this.backgroundTarget.classList.add(this.fromBackgroundClass),this.viewTarget.classList.remove(this.toViewClass),this.viewTarget.classList.add(this.fromViewClass),requestAnimationFrame(()=>{setTimeout(()=>{this.containerTarget.classList.add(this.hideClass),document.getElementById(this.currentActiveValue).classList.add(this.hideClass),this.currentActiveValue="",this.remove_hash_from_url()},this.closeTimeoutValue)})}closeBackground(s){this.allowCloseValue&&s.target===this.backgroundTarget&&this.close()}closeWithKeyboard(s){s.keyCode===27&&!this.containerTarget.classList.contains(this.hideClass)&&this.close()}remove_hash_from_url(){var s=window.location.toString();if(s.indexOf("#")>0){var e=s.substring(0,s.indexOf("#"));window.history.replaceState({},document.title,e)}}};o(d,"targets",["container","background","view"]),o(d,"classes",["hide","toBackground","fromBackground","toView","fromView"]),o(d,"values",{allowClose:Boolean,openTimeout:Number,closeTimeout:Number,currentActive:String});var nt=["second","minute","hour","day","week","month","year"];function ne(s,e){if(e===0)return["just now","right now"];var t=nt[Math.floor(e/2)];return s>1&&(t+="s"),[s+" "+t+" ago","in "+s+" "+t]}var at=["\u79D2","\u5206\u949F","\u5C0F\u65F6","\u5929","\u5468","\u4E2A\u6708","\u5E74"];function ae(s,e){if(e===0)return["\u521A\u521A","\u7247\u523B\u540E"];var t=at[~~(e/2)];return[s+" "+t+"\u524D",s+" "+t+"\u540E"]}var q={},W=function(s,e){q[s]=e},J=function(s){return q[s]||q.en_US};var g=[60,60,24,7,4.345238095238096,12];function oe(s){return s instanceof Date?s:!isNaN(s)||/^\d+$/.test(s)?new Date(parseInt(s)):(s=(s||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(s))}function Z(s,e){var t=s<0?1:0;s=Math.abs(s);for(var r=s,i=0;s>=g[i]&&i(i===0?9:1)&&(i+=1),e(s,i,r)[t].replace("%s",s.toString())}function G(s,e){var t=e?oe(e):new Date;return(+t-+oe(s))/1e3}function ce(s){for(var e=1,t=0,r=Math.abs(s);s>=g[t]&&t