New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@stackoverflow/stacks

Package Overview
Dependencies
Maintainers
4
Versions
241
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stackoverflow/stacks - npm Package Compare versions

Comparing version 0.35.3 to 0.36.0

2

dist/js/stacks.min.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.Stimulus={})}(this,function(e){"use strict";var r=function(){function e(e,t){this.eventTarget=e,this.eventName=t,this.unorderedBindings=new Set}return e.prototype.connect=function(){this.eventTarget.addEventListener(this.eventName,this,!1)},e.prototype.disconnect=function(){this.eventTarget.removeEventListener(this.eventName,this,!1)},e.prototype.bindingConnected=function(e){this.unorderedBindings.add(e)},e.prototype.bindingDisconnected=function(e){this.unorderedBindings.delete(e)},e.prototype.handleEvent=function(e){for(var t=function(e){{if("immediatePropagationStopped"in e)return e;var t=e.stopImmediatePropagation;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation:function(){this.immediatePropagationStopped=!0,t.call(this)}})}}(e),n=0,r=this.bindings;n<r.length;n++){var o=r[n];if(t.immediatePropagationStopped)break;o.handleEvent(t)}},Object.defineProperty(e.prototype,"bindings",{get:function(){return Array.from(this.unorderedBindings).sort(function(e,t){var n=e.index,r=t.index;return n<r?-1:r<n?1:0})},enumerable:!0,configurable:!0}),e}();var n=function(){function e(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}return e.prototype.start=function(){this.started||(this.started=!0,this.eventListeners.forEach(function(e){return e.connect()}))},e.prototype.stop=function(){this.started&&(this.started=!1,this.eventListeners.forEach(function(e){return e.disconnect()}))},Object.defineProperty(e.prototype,"eventListeners",{get:function(){return Array.from(this.eventListenerMaps.values()).reduce(function(e,t){return e.concat(Array.from(t.values()))},[])},enumerable:!0,configurable:!0}),e.prototype.bindingConnected=function(e){this.fetchEventListenerForBinding(e).bindingConnected(e)},e.prototype.bindingDisconnected=function(e){this.fetchEventListenerForBinding(e).bindingDisconnected(e)},e.prototype.handleError=function(e,t,n){void 0===n&&(n={}),this.application.handleError(e,"Error "+t,n)},e.prototype.fetchEventListenerForBinding=function(e){var t=e.eventTarget,n=e.eventName;return this.fetchEventListener(t,n)},e.prototype.fetchEventListener=function(e,t){var n=this.fetchEventListenerMapForEventTarget(e),r=n.get(t);return r||(r=this.createEventListener(e,t),n.set(t,r)),r},e.prototype.createEventListener=function(e,t){var n=new r(e,t);return this.started&&n.connect(),n},e.prototype.fetchEventListenerMapForEventTarget=function(e){var t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t},e}(),o=/^((.+?)(@(window|document))?->)?(.+?)(#(.+))?$/;function t(e){var t=e.trim().match(o)||[];return{eventTarget:function(e){{if("window"==e)return window;if("document"==e)return document}}(t[4]),eventName:t[2],identifier:t[5],methodName:t[7]}}var i=function(){function e(e,t,n){this.element=e,this.index=t,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||function(e){var t=e.tagName.toLowerCase();if(t in s)return s[t](e)}(e)||c("missing event name"),this.identifier=n.identifier||c("missing identifier"),this.methodName=n.methodName||c("missing method name")}return e.forToken=function(e){return new this(e.element,e.index,t(e.content))},e.prototype.toString=function(){var e=this.eventTargetName?"@"+this.eventTargetName:"";return""+this.eventName+e+"->"+this.identifier+"#"+this.methodName},Object.defineProperty(e.prototype,"eventTargetName",{get:function(){return(e=this.eventTarget)==window?"window":e==document?"document":void 0;var e},enumerable:!0,configurable:!0}),e}(),s={a:function(e){return"click"},button:function(e){return"click"},form:function(e){return"submit"},input:function(e){return"submit"==e.getAttribute("type")?"click":"change"},select:function(e){return"change"},textarea:function(e){return"change"}};function c(e){throw new Error(e)}var a=function(){function e(e,t){this.context=e,this.action=t}return Object.defineProperty(e.prototype,"index",{get:function(){return this.action.index},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"eventTarget",{get:function(){return this.action.eventTarget},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!0,configurable:!0}),e.prototype.handleEvent=function(e){this.willBeInvokedByEvent(e)&&this.invokeWithEvent(e)},Object.defineProperty(e.prototype,"eventName",{get:function(){return this.action.eventName},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){var e=this.controller[this.methodName];if("function"==typeof e)return e;throw new Error('Action "'+this.action+'" references undefined method "'+this.methodName+'"')},enumerable:!0,configurable:!0}),e.prototype.invokeWithEvent=function(t){try{this.method.call(this.controller,t)}catch(e){var n=this,r={identifier:n.identifier,controller:n.controller,element:n.element,index:n.index,event:t};this.context.handleError(e,'invoking action "'+this.action+'"',r)}},e.prototype.willBeInvokedByEvent=function(e){var t=e.target;return this.element===t||(!(t instanceof Element&&this.element.contains(t))||this.scope.containsElement(t))},Object.defineProperty(e.prototype,"controller",{get:function(){return this.context.controller},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"methodName",{get:function(){return this.action.methodName},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scope",{get:function(){return this.context.scope},enumerable:!0,configurable:!0}),e}(),u=function(){function e(e,t){var n=this;this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(function(e){return n.processMutations(e)})}return e.prototype.start=function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,childList:!0,subtree:!0}),this.refresh())},e.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},e.prototype.refresh=function(){if(this.started){for(var e=new Set(this.matchElementsInTree()),t=0,n=Array.from(this.elements);t<n.length;t++){var r=n[t];e.has(r)||this.removeElement(r)}for(var o=0,i=Array.from(e);o<i.length;o++){r=i[o];this.addElement(r)}}},e.prototype.processMutations=function(e){if(this.started)for(var t=0,n=e;t<n.length;t++){var r=n[t];this.processMutation(r)}},e.prototype.processMutation=function(e){"attributes"==e.type?this.processAttributeChange(e.target,e.attributeName):"childList"==e.type&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))},e.prototype.processAttributeChange=function(e,t){var n=e;this.elements.has(n)?this.delegate.elementAttributeChanged&&this.matchElement(n)?this.delegate.elementAttributeChanged(n,t):this.removeElement(n):this.matchElement(n)&&this.addElement(n)},e.prototype.processRemovedNodes=function(e){for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t],o=this.elementFromNode(r);o&&this.processTree(o,this.removeElement)}},e.prototype.processAddedNodes=function(e){for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t],o=this.elementFromNode(r);o&&this.elementIsActive(o)&&this.processTree(o,this.addElement)}},e.prototype.matchElement=function(e){return this.delegate.matchElement(e)},e.prototype.matchElementsInTree=function(e){return void 0===e&&(e=this.element),this.delegate.matchElementsInTree(e)},e.prototype.processTree=function(e,t){for(var n=0,r=this.matchElementsInTree(e);n<r.length;n++){var o=r[n];t.call(this,o)}},e.prototype.elementFromNode=function(e){if(e.nodeType==Node.ELEMENT_NODE)return e},e.prototype.elementIsActive=function(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)},e.prototype.addElement=function(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))},e.prototype.removeElement=function(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))},e}(),l=function(){function e(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new u(e,this)}return Object.defineProperty(e.prototype,"element",{get:function(){return this.elementObserver.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selector",{get:function(){return"["+this.attributeName+"]"},enumerable:!0,configurable:!0}),e.prototype.start=function(){this.elementObserver.start()},e.prototype.stop=function(){this.elementObserver.stop()},e.prototype.refresh=function(){this.elementObserver.refresh()},Object.defineProperty(e.prototype,"started",{get:function(){return this.elementObserver.started},enumerable:!0,configurable:!0}),e.prototype.matchElement=function(e){return e.hasAttribute(this.attributeName)},e.prototype.matchElementsInTree=function(e){var t=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector));return t.concat(n)},e.prototype.elementMatched=function(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)},e.prototype.elementUnmatched=function(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)},e.prototype.elementAttributeChanged=function(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)},e}();function p(e,t,n){h(e,t).add(n)}function f(e,t,n){var r,o,i;h(e,t).delete(n),o=t,null!=(i=(r=e).get(o))&&0==i.size&&r.delete(o)}function h(e,t){var n=e.get(t);return n||(n=new Set,e.set(t,n)),n}var d,m=function(){function e(){this.valuesByKey=new Map}return Object.defineProperty(e.prototype,"values",{get:function(){return Array.from(this.valuesByKey.values()).reduce(function(e,t){return e.concat(Array.from(t))},[])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return Array.from(this.valuesByKey.values()).reduce(function(e,t){return e+t.size},0)},enumerable:!0,configurable:!0}),e.prototype.add=function(e,t){p(this.valuesByKey,e,t)},e.prototype.delete=function(e,t){f(this.valuesByKey,e,t)},e.prototype.has=function(e,t){var n=this.valuesByKey.get(e);return null!=n&&n.has(t)},e.prototype.hasKey=function(e){return this.valuesByKey.has(e)},e.prototype.hasValue=function(t){return Array.from(this.valuesByKey.values()).some(function(e){return e.has(t)})},e.prototype.getValuesForKey=function(e){var t=this.valuesByKey.get(e);return t?Array.from(t):[]},e.prototype.getKeysForValue=function(t){return Array.from(this.valuesByKey).filter(function(e){e[0];return e[1].has(t)}).map(function(e){var t=e[0];e[1];return t})},e}(),y=(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),b=(function(n){function e(){var e=n.call(this)||this;return e.keysByValue=new Map,e}y(e,n),Object.defineProperty(e.prototype,"values",{get:function(){return Array.from(this.keysByValue.keys())},enumerable:!0,configurable:!0}),e.prototype.add=function(e,t){n.prototype.add.call(this,e,t),p(this.keysByValue,t,e)},e.prototype.delete=function(e,t){n.prototype.delete.call(this,e,t),f(this.keysByValue,t,e)},e.prototype.hasValue=function(e){return this.keysByValue.has(e)},e.prototype.getKeysForValue=function(e){var t=this.keysByValue.get(e);return t?Array.from(t):[]}}(m),function(){function e(e,t,n){this.attributeObserver=new l(e,t,this),this.delegate=n,this.tokensByElement=new m}return Object.defineProperty(e.prototype,"started",{get:function(){return this.attributeObserver.started},enumerable:!0,configurable:!0}),e.prototype.start=function(){this.attributeObserver.start()},e.prototype.stop=function(){this.attributeObserver.stop()},e.prototype.refresh=function(){this.attributeObserver.refresh()},Object.defineProperty(e.prototype,"element",{get:function(){return this.attributeObserver.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"attributeName",{get:function(){return this.attributeObserver.attributeName},enumerable:!0,configurable:!0}),e.prototype.elementMatchedAttribute=function(e){this.tokensMatched(this.readTokensForElement(e))},e.prototype.elementAttributeValueChanged=function(e){var t=this.refreshTokensForElement(e),n=t[0],r=t[1];this.tokensUnmatched(n),this.tokensMatched(r)},e.prototype.elementUnmatchedAttribute=function(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))},e.prototype.tokensMatched=function(e){var t=this;e.forEach(function(e){return t.tokenMatched(e)})},e.prototype.tokensUnmatched=function(e){var t=this;e.forEach(function(e){return t.tokenUnmatched(e)})},e.prototype.tokenMatched=function(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)},e.prototype.tokenUnmatched=function(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)},e.prototype.refreshTokensForElement=function(e){var n,r,t,o=this.tokensByElement.getValuesForKey(e),i=this.readTokensForElement(e),s=(n=o,r=i,t=Math.max(n.length,r.length),Array.from({length:t},function(e,t){return[n[t],r[t]]})).findIndex(function(e){var t,n,r=e[0],o=e[1];return n=o,!((t=r)&&n&&t.index==n.index&&t.content==n.content)});return-1==s?[[],[]]:[o.slice(s),i.slice(s)]},e.prototype.readTokensForElement=function(e){var n,r,t=this.attributeName,o=e.getAttribute(t)||"";return n=e,r=t,o.trim().split(/\s+/).filter(function(e){return e.length}).map(function(e,t){return{element:n,attributeName:r,content:e,index:t}})},e}());var g,v=function(){function e(e,t,n){this.tokenListObserver=new b(e,t,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}return Object.defineProperty(e.prototype,"started",{get:function(){return this.tokenListObserver.started},enumerable:!0,configurable:!0}),e.prototype.start=function(){this.tokenListObserver.start()},e.prototype.stop=function(){this.tokenListObserver.stop()},e.prototype.refresh=function(){this.tokenListObserver.refresh()},Object.defineProperty(e.prototype,"element",{get:function(){return this.tokenListObserver.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"attributeName",{get:function(){return this.tokenListObserver.attributeName},enumerable:!0,configurable:!0}),e.prototype.tokenMatched=function(e){var t=e.element,n=this.fetchParseResultForToken(e).value;n&&(this.fetchValuesByTokenForElement(t).set(e,n),this.delegate.elementMatchedValue(t,n))},e.prototype.tokenUnmatched=function(e){var t=e.element,n=this.fetchParseResultForToken(e).value;n&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,n))},e.prototype.fetchParseResultForToken=function(e){var t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t},e.prototype.fetchValuesByTokenForElement=function(e){var t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t},e.prototype.parseToken=function(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}},e}(),E=function(){function e(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}return e.prototype.start=function(){this.valueListObserver||(this.valueListObserver=new v(this.element,this.actionAttribute,this),this.valueListObserver.start())},e.prototype.stop=function(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())},Object.defineProperty(e.prototype,"element",{get:function(){return this.context.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"actionAttribute",{get:function(){return this.schema.actionAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return this.context.schema},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bindings",{get:function(){return Array.from(this.bindingsByAction.values())},enumerable:!0,configurable:!0}),e.prototype.connectAction=function(e){var t=new a(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)},e.prototype.disconnectAction=function(e){var t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))},e.prototype.disconnectAllActions=function(){var t=this;this.bindings.forEach(function(e){return t.delegate.bindingDisconnected(e)}),this.bindingsByAction.clear()},e.prototype.parseValueForToken=function(e){var t=i.forToken(e);if(t.identifier==this.identifier)return t},e.prototype.elementMatchedValue=function(e,t){this.connectAction(t)},e.prototype.elementUnmatchedValue=function(e,t){this.disconnectAction(t)},e}(),O=function(){function e(e,t){this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new E(this,this.dispatcher);try{this.controller.initialize()}catch(e){this.handleError(e,"initializing controller")}}return e.prototype.connect=function(){this.bindingObserver.start();try{this.controller.connect()}catch(e){this.handleError(e,"connecting controller")}},e.prototype.disconnect=function(){try{this.controller.disconnect()}catch(e){this.handleError(e,"disconnecting controller")}this.bindingObserver.stop()},Object.defineProperty(e.prototype,"application",{get:function(){return this.module.application},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return this.module.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return this.application.schema},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dispatcher",{get:function(){return this.application.dispatcher},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return this.element.parentElement},enumerable:!0,configurable:!0}),e.prototype.handleError=function(e,t,n){void 0===n&&(n={});var r=this.identifier,o=this.controller,i=this.element;n=Object.assign({identifier:r,controller:o,element:i},n),this.application.handleError(e,"Error "+t,n)},e}(),A=(g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});function k(e){return{identifier:e.identifier,controllerConstructor:(t=e.controllerConstructor,n=w(t),n.bless(),n)};var t,n}var w=function(){function e(t){function n(){var e=this&&this instanceof n?this.constructor:void 0;return Reflect.construct(t,arguments,e)}return n.prototype=Object.create(t.prototype,{constructor:{value:n}}),Reflect.setPrototypeOf(n,t),n}try{return(t=e(function(){this.a.call(this)})).prototype.a=function(){},new t,e}catch(e){return function(e){return function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t}(e)}}var t}(),P=function(){function e(e,t){this.application=e,this.definition=k(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}return Object.defineProperty(e.prototype,"identifier",{get:function(){return this.definition.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"controllerConstructor",{get:function(){return this.definition.controllerConstructor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contexts",{get:function(){return Array.from(this.connectedContexts)},enumerable:!0,configurable:!0}),e.prototype.connectContextForScope=function(e){var t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()},e.prototype.disconnectContextForScope=function(e){var t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())},e.prototype.fetchContextForScope=function(e){var t=this.contextsByScope.get(e);return t||(t=new O(this,e),this.contextsByScope.set(e,t)),t},e}(),j=function(){function e(e){this.scope=e}return Object.defineProperty(e.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!0,configurable:!0}),e.prototype.get=function(e){return e=this.getFormattedKey(e),this.element.getAttribute(e)},e.prototype.set=function(e,t){return e=this.getFormattedKey(e),this.element.setAttribute(e,t),this.get(e)},e.prototype.has=function(e){return e=this.getFormattedKey(e),this.element.hasAttribute(e)},e.prototype.delete=function(e){return!!this.has(e)&&(e=this.getFormattedKey(e),this.element.removeAttribute(e),!0)},e.prototype.getFormattedKey=function(e){return"data-"+this.identifier+"-"+e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()})},e}();function C(e,t){return"["+e+'~="'+t+'"]'}var B=function(){function e(e){this.scope=e}return Object.defineProperty(e.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return this.scope.schema},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return null!=this.find(e)},e.prototype.find=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.getSelectorForTargetNames(e);return this.scope.findElement(n)},e.prototype.findAll=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.getSelectorForTargetNames(e);return this.scope.findAllElements(n)},e.prototype.getSelectorForTargetNames=function(e){var t=this;return e.map(function(e){return t.getSelectorForTargetName(e)}).join(", ")},e.prototype.getSelectorForTargetName=function(e){var t=this.identifier+"."+e;return C(this.schema.targetAttribute,t)},e}(),x=function(){function e(e,t,n){this.schema=e,this.identifier=t,this.element=n,this.targets=new B(this),this.data=new j(this)}return e.prototype.findElement=function(e){return this.findAllElements(e)[0]},e.prototype.findAllElements=function(e){var t=this.element.matches(e)?[this.element]:[],n=this.filterElements(Array.from(this.element.querySelectorAll(e)));return t.concat(n)},e.prototype.filterElements=function(e){var t=this;return e.filter(function(e){return t.containsElement(e)})},e.prototype.containsElement=function(e){return e.closest(this.controllerSelector)===this.element},Object.defineProperty(e.prototype,"controllerSelector",{get:function(){return C(this.schema.controllerAttribute,this.identifier)},enumerable:!0,configurable:!0}),e}(),S=function(){function e(e,t,n){this.element=e,this.schema=t,this.delegate=n,this.valueListObserver=new v(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}return e.prototype.start=function(){this.valueListObserver.start()},e.prototype.stop=function(){this.valueListObserver.stop()},Object.defineProperty(e.prototype,"controllerAttribute",{get:function(){return this.schema.controllerAttribute},enumerable:!0,configurable:!0}),e.prototype.parseValueForToken=function(e){var t=e.element,n=e.content,r=this.fetchScopesByIdentifierForElement(t),o=r.get(n);return o||(o=new x(this.schema,n,t),r.set(n,o)),o},e.prototype.elementMatchedValue=function(e,t){var n=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,n),1==n&&this.delegate.scopeConnected(t)},e.prototype.elementUnmatchedValue=function(e,t){var n=this.scopeReferenceCounts.get(t);n&&(this.scopeReferenceCounts.set(t,n-1),1==n&&this.delegate.scopeDisconnected(t))},e.prototype.fetchScopesByIdentifierForElement=function(e){var t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t},e}(),T=function(){function e(e){this.application=e,this.scopeObserver=new S(this.element,this.schema,this),this.scopesByIdentifier=new m,this.modulesByIdentifier=new Map}return Object.defineProperty(e.prototype,"element",{get:function(){return this.application.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return this.application.schema},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"controllerAttribute",{get:function(){return this.schema.controllerAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"modules",{get:function(){return Array.from(this.modulesByIdentifier.values())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contexts",{get:function(){return this.modules.reduce(function(e,t){return e.concat(t.contexts)},[])},enumerable:!0,configurable:!0}),e.prototype.start=function(){this.scopeObserver.start()},e.prototype.stop=function(){this.scopeObserver.stop()},e.prototype.loadDefinition=function(e){this.unloadIdentifier(e.identifier);var t=new P(this.application,e);this.connectModule(t)},e.prototype.unloadIdentifier=function(e){var t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)},e.prototype.getContextForElementAndIdentifier=function(t,e){var n=this.modulesByIdentifier.get(e);if(n)return n.contexts.find(function(e){return e.element==t})},e.prototype.handleError=function(e,t,n){this.application.handleError(e,t,n)},e.prototype.scopeConnected=function(e){this.scopesByIdentifier.add(e.identifier,e);var t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)},e.prototype.scopeDisconnected=function(e){this.scopesByIdentifier.delete(e.identifier,e);var t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)},e.prototype.connectModule=function(t){this.modulesByIdentifier.set(t.identifier,t),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(function(e){return t.connectContextForScope(e)})},e.prototype.disconnectModule=function(t){this.modulesByIdentifier.delete(t.identifier),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(function(e){return t.disconnectContextForScope(e)})},e}(),N={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target"},F=function(i,s,c,a){return new(c||(c=Promise))(function(e,t){function n(e){try{o(a.next(e))}catch(e){t(e)}}function r(e){try{o(a.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new c(function(e){e(t.value)}).then(n,r)}o((a=a.apply(i,s||[])).next())})},L=function(n,r){var o,i,s,e,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;c;)try{if(o=1,i&&(s=i[2&t[0]?"return":t[0]?"throw":"next"])&&!(s=s.call(i,t[1])).done)return s;switch(i=0,s&&(t=[0,s.value]),t[0]){case 0:case 1:s=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,i=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){c.label=t[1];break}if(6===t[0]&&c.label<s[1]){c.label=s[1],s=t;break}if(s&&c.label<s[2]){c.label=s[2],c.ops.push(t);break}s[2]&&c.ops.pop(),c.trys.pop();continue}t=r.call(n,c)}catch(e){t=[6,e],i=0}finally{o=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},M=function(){function r(e,t){void 0===e&&(e=document.documentElement),void 0===t&&(t=N),this.element=e,this.schema=t,this.dispatcher=new n(this),this.router=new T(this)}return r.start=function(e,t){var n=new r(e,t);return n.start(),n},r.prototype.start=function(){return F(this,void 0,void 0,function(){return L(this,function(e){switch(e.label){case 0:return[4,new Promise(function(e){"loading"==document.readyState?document.addEventListener("DOMContentLoaded",e):e()})];case 1:return e.sent(),this.router.start(),this.dispatcher.start(),[2]}})})},r.prototype.stop=function(){this.router.stop(),this.dispatcher.stop()},r.prototype.register=function(e,t){this.load({identifier:e,controllerConstructor:t})},r.prototype.load=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(Array.isArray(e)?e:[e].concat(n)).forEach(function(e){return t.router.loadDefinition(e)})},r.prototype.unload=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(Array.isArray(e)?e:[e].concat(n)).forEach(function(e){return t.router.unloadIdentifier(e)})},Object.defineProperty(r.prototype,"controllers",{get:function(){return this.router.contexts.map(function(e){return e.controller})},enumerable:!0,configurable:!0}),r.prototype.getControllerForElementAndIdentifier=function(e,t){var n=this.router.getContextForElementAndIdentifier(e,t);return n?n.controller:null},r.prototype.handleError=function(e,t,n){console.error("%s\n\n%o\n\n%o",t,e,n)},r}();function I(e){var t,i=e.prototype;(t=function(e){var t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t}(e),Array.from(t.reduce(function(t,e){var n,r;return(n=e,r=n.targets,Array.isArray(r)?r:[]).forEach(function(e){return t.add(e)}),t},new Set))).forEach(function(t){var e,n,r,o;return n=i,(e={})[t+"Target"]={get:function(){var e=this.targets.find(t);if(e)return e;throw new Error('Missing target element "'+this.identifier+"."+t+'"')}},e[t+"Targets"]={get:function(){return this.targets.findAll(t)}},e["has"+(o=t,o.charAt(0).toUpperCase()+o.slice(1))+"Target"]={get:function(){return this.targets.has(t)}},r=e,void Object.keys(r).forEach(function(e){if(!(e in n)){var t=r[e];Object.defineProperty(n,e,t)}})})}var V=function(){function e(e){this.context=e}return e.bless=function(){I(this)},Object.defineProperty(e.prototype,"application",{get:function(){return this.context.application},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scope",{get:function(){return this.context.scope},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"targets",{get:function(){return this.scope.targets},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.scope.data},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){},e.prototype.connect=function(){},e.prototype.disconnect=function(){},e.targets=[],e}();e.Application=M,e.Context=O,e.Controller=V,e.defaultSchema=N,Object.defineProperty(e,"__esModule",{value:!0})}),function(){window.Stacks=window.Stacks||Object.create(null),Stacks._initializing=!0;var o=Stacks.stimulusApplication=Stimulus.Application.start();function i(){Stimulus.Controller.apply(this,arguments)}Stacks.controllers=Object.create(null),(i.prototype=Object.create(Stimulus.Controller.prototype,{constructor:{value:i,enumerable:!1,writable:!0}})).getElementData=function(e,t){return e.getAttribute("data-"+this.identifier+"-"+t)},i.prototype.setElementData=function(e,t,n){e.setAttribute("data-"+this.identifier+"-"+t,n)},i.prototype.removeElementData=function(e,t){e.removeAttribute("data-"+this.identifier+"-"+t)},Object.setPrototypeOf(i,Stimulus.Controller),Stacks.addController=function(e,t){var n=/^s-/.test(e);if(Stacks._initializing&&!n)throw'Stacks-created Stimulus controller names must start with "s-".';if(!Stacks._initializing&&n)throw'The "s-" prefix on Stimulus controller names is reserved for Stacks-created controllers.';var r=function(e,t){var n,r=function(){i.apply(this,arguments)};for(var o in r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0}}),Object.setPrototypeOf(r,i),t)t.hasOwnProperty(o)&&("targets"===o?(n=t[o],Object.defineProperty(r,"targets",{get:function(){return n},enumerable:!1})):Object.defineProperty(r.prototype,o,Object.getOwnPropertyDescriptor(t,o)));return r}(0,t);o.register(e,r),Stacks._initializing&&(Stacks.controllers[e]=r)}}(),function(){"use strict";var r="s-expandable-control:radio-off";function t(n){"INPUT"===n.target.nodeName&&"radio"===n.target.type&&document.querySelectorAll('input[type="radio"][name="'+n.target.name+'"]').forEach(function(e){if(e!==n.target){var t;try{t=new Event(r)}catch(e){(t=document.createEvent("Event")).initEvent(r,!0,!0)}e.dispatchEvent(t)}})}var n=0;function o(e){e?1===++n&&document.body.addEventListener("change",t):0===--n&&document.body.removeEventListener("change",t)}Stacks.addController("s-expandable-control",{initialize:function(){"INPUT"===this.element.nodeName&&0<=["radio","checkbox"].indexOf(this.element.type)?(this.isCollapsed=this._isCollapsedForCheckable,this.events=["change",r],this.isCheckable=!0,this.isRadio="radio"===this.element.type):(this.isCollapsed=this._isCollapsedForClickable,this.events=["click","keydown"]),this.listener=this.listener.bind(this)},_isCollapsedForClickable:function(){var e=this.controlledCollapsible;return e?!e.classList.contains("is-expanded"):"false"===this.element.getAttribute("aria-expanded")},_isCollapsedForCheckable:function(){return!this.element.checked},get controlledCollapsible(){return document.getElementById(this.element.getAttribute("aria-controls"))},listener:function(e){var t;if(this.isCheckable)t=!this.element.checked;else{if("keydown"==e.type&&13!=e.keyCode&&32!=e.keyCode)return;if(e.target!==e.currentTarget&&0<=["A","BUTTON"].indexOf(e.target.nodeName))return;t="true"===this.element.getAttribute("aria-expanded"),e.preventDefault(),"click"===e.type&&this.element.blur()}this.element.setAttribute("aria-expanded",t?"false":"true"),this.controlledCollapsible.classList.toggle("is-expanded",!t)},connect:function(){if(this.events.forEach(function(e){this.element.addEventListener(e,this.listener)},this),this.isRadio&&o(!0),this.element.setAttribute("aria-expanded",this.isCollapsed()?"false":"true"),this.isCheckable){var e=this.controlledCollapsible;e&&e.classList.toggle("is-expanded",!this.isCollapsed())}},disconnect:function(){this.events.forEach(function(e){this.element.removeEventListener(e,this.listener)},this),this.isRadio&&o(!1)}})}(),function(){"use strict";function h(e,t){for(var n=[],r=e.children[0],o=[],i=[];r||i.some(function(e){return e});){var s=[];n.push(s);var c=0;if(r)for(var a=0;a<r.children.length;a++){for(;i[c];)i[c]--,s[c]=o[c],c++;var u=r.children[a];if("none"!==getComputedStyle(u).display){if(u===t)return c;for(var l=c+u.colSpan;c<l;c++)i[c]=u.rowSpan-1,o[c]=u,s[c]=u}}for(;c<o.length;)i[c]&&(i[c]--,s[c]=o[c]),c++;r&&(r=r.nextElementSibling)}return t?-1:n}Stacks.addController("s-table",{targets:["column"],setCurrentSort:function(t,r){if(["asc","desc","none"].indexOf(r)<0)throw"direction must be one of asc, desc, or none";var o=this;this.columnTargets.forEach(function(e){var n=e===t;e.classList.toggle("is-sorted",n&&"none"!==r),e.querySelectorAll(".js-sorting-indicator").forEach(function(e){var t=n?r:"none";e.classList.toggle("d-none",!e.classList.contains("js-sorting-indicator-"+t))}),n&&"none"!==r?o.setElementData(e,"sort-direction",r):o.removeElementData(e,"sort-direction")})},sort:function(e){var t,s=this,n=e.currentTarget,r=this.element,o=r.tBodies[0],c=h((t=n).parentElement.parentElement,t);if(!(c<0)){var a,u=h(o),i="asc"===this.getElementData(n,"sort-direction")?-1:1,l=Array.from(r.tBodies[0].rows),p=!1,f=[];l.forEach(function(e,t){var n=s.getElementData(e,"sort-to");if("top"!==n)if("bottom"!==n){var r=u[t][c];if(r){var o=s.getElementData(r,"sort-val"),i="string"==typeof o?o:r.textContent.trim();""!==i&&parseInt(i,10)+""!==i&&(p=!0),f.push([i,t])}else f.push(["",t])}else a||(a=e)}),p||f.forEach(function(e){e[0]=""===e[0]?Number.MIN_VALUE:parseInt(e[0],10)}),f.sort(function(e,t){return e[0]>t[0]?1*i:e[0]<t[0]?-1*i:e[1]>t[1]?1:-1}),f.forEach(function(e){var t=l[e[1]];t.parentElement.removeChild(t),a?o.insertBefore(t,a):o.appendChild(t)}),this.setCurrentSort(n,1===i?"asc":"desc")}}})}(),delete Stacks._initializing;
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.Stimulus={})}(this,function(e){"use strict";var r=function(){function e(e,t){this.eventTarget=e,this.eventName=t,this.unorderedBindings=new Set}return e.prototype.connect=function(){this.eventTarget.addEventListener(this.eventName,this,!1)},e.prototype.disconnect=function(){this.eventTarget.removeEventListener(this.eventName,this,!1)},e.prototype.bindingConnected=function(e){this.unorderedBindings.add(e)},e.prototype.bindingDisconnected=function(e){this.unorderedBindings.delete(e)},e.prototype.handleEvent=function(e){for(var t=function(e){{if("immediatePropagationStopped"in e)return e;var t=e.stopImmediatePropagation;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation:function(){this.immediatePropagationStopped=!0,t.call(this)}})}}(e),n=0,r=this.bindings;n<r.length;n++){var o=r[n];if(t.immediatePropagationStopped)break;o.handleEvent(t)}},Object.defineProperty(e.prototype,"bindings",{get:function(){return Array.from(this.unorderedBindings).sort(function(e,t){var n=e.index,r=t.index;return n<r?-1:r<n?1:0})},enumerable:!0,configurable:!0}),e}();var n=function(){function e(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}return e.prototype.start=function(){this.started||(this.started=!0,this.eventListeners.forEach(function(e){return e.connect()}))},e.prototype.stop=function(){this.started&&(this.started=!1,this.eventListeners.forEach(function(e){return e.disconnect()}))},Object.defineProperty(e.prototype,"eventListeners",{get:function(){return Array.from(this.eventListenerMaps.values()).reduce(function(e,t){return e.concat(Array.from(t.values()))},[])},enumerable:!0,configurable:!0}),e.prototype.bindingConnected=function(e){this.fetchEventListenerForBinding(e).bindingConnected(e)},e.prototype.bindingDisconnected=function(e){this.fetchEventListenerForBinding(e).bindingDisconnected(e)},e.prototype.handleError=function(e,t,n){void 0===n&&(n={}),this.application.handleError(e,"Error "+t,n)},e.prototype.fetchEventListenerForBinding=function(e){var t=e.eventTarget,n=e.eventName;return this.fetchEventListener(t,n)},e.prototype.fetchEventListener=function(e,t){var n=this.fetchEventListenerMapForEventTarget(e),r=n.get(t);return r||(r=this.createEventListener(e,t),n.set(t,r)),r},e.prototype.createEventListener=function(e,t){var n=new r(e,t);return this.started&&n.connect(),n},e.prototype.fetchEventListenerMapForEventTarget=function(e){var t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t},e}(),o=/^((.+?)(@(window|document))?->)?(.+?)(#(.+))?$/;function t(e){var t=e.trim().match(o)||[];return{eventTarget:function(e){{if("window"==e)return window;if("document"==e)return document}}(t[4]),eventName:t[2],identifier:t[5],methodName:t[7]}}var i=function(){function e(e,t,n){this.element=e,this.index=t,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||function(e){var t=e.tagName.toLowerCase();if(t in s)return s[t](e)}(e)||c("missing event name"),this.identifier=n.identifier||c("missing identifier"),this.methodName=n.methodName||c("missing method name")}return e.forToken=function(e){return new this(e.element,e.index,t(e.content))},e.prototype.toString=function(){var e=this.eventTargetName?"@"+this.eventTargetName:"";return""+this.eventName+e+"->"+this.identifier+"#"+this.methodName},Object.defineProperty(e.prototype,"eventTargetName",{get:function(){return(e=this.eventTarget)==window?"window":e==document?"document":void 0;var e},enumerable:!0,configurable:!0}),e}(),s={a:function(e){return"click"},button:function(e){return"click"},form:function(e){return"submit"},input:function(e){return"submit"==e.getAttribute("type")?"click":"change"},select:function(e){return"change"},textarea:function(e){return"change"}};function c(e){throw new Error(e)}var a=function(){function e(e,t){this.context=e,this.action=t}return Object.defineProperty(e.prototype,"index",{get:function(){return this.action.index},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"eventTarget",{get:function(){return this.action.eventTarget},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!0,configurable:!0}),e.prototype.handleEvent=function(e){this.willBeInvokedByEvent(e)&&this.invokeWithEvent(e)},Object.defineProperty(e.prototype,"eventName",{get:function(){return this.action.eventName},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){var e=this.controller[this.methodName];if("function"==typeof e)return e;throw new Error('Action "'+this.action+'" references undefined method "'+this.methodName+'"')},enumerable:!0,configurable:!0}),e.prototype.invokeWithEvent=function(t){try{this.method.call(this.controller,t)}catch(e){var n=this,r={identifier:n.identifier,controller:n.controller,element:n.element,index:n.index,event:t};this.context.handleError(e,'invoking action "'+this.action+'"',r)}},e.prototype.willBeInvokedByEvent=function(e){var t=e.target;return this.element===t||(!(t instanceof Element&&this.element.contains(t))||this.scope.containsElement(t))},Object.defineProperty(e.prototype,"controller",{get:function(){return this.context.controller},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"methodName",{get:function(){return this.action.methodName},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scope",{get:function(){return this.context.scope},enumerable:!0,configurable:!0}),e}(),u=function(){function e(e,t){var n=this;this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(function(e){return n.processMutations(e)})}return e.prototype.start=function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,childList:!0,subtree:!0}),this.refresh())},e.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},e.prototype.refresh=function(){if(this.started){for(var e=new Set(this.matchElementsInTree()),t=0,n=Array.from(this.elements);t<n.length;t++){var r=n[t];e.has(r)||this.removeElement(r)}for(var o=0,i=Array.from(e);o<i.length;o++){r=i[o];this.addElement(r)}}},e.prototype.processMutations=function(e){if(this.started)for(var t=0,n=e;t<n.length;t++){var r=n[t];this.processMutation(r)}},e.prototype.processMutation=function(e){"attributes"==e.type?this.processAttributeChange(e.target,e.attributeName):"childList"==e.type&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))},e.prototype.processAttributeChange=function(e,t){var n=e;this.elements.has(n)?this.delegate.elementAttributeChanged&&this.matchElement(n)?this.delegate.elementAttributeChanged(n,t):this.removeElement(n):this.matchElement(n)&&this.addElement(n)},e.prototype.processRemovedNodes=function(e){for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t],o=this.elementFromNode(r);o&&this.processTree(o,this.removeElement)}},e.prototype.processAddedNodes=function(e){for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t],o=this.elementFromNode(r);o&&this.elementIsActive(o)&&this.processTree(o,this.addElement)}},e.prototype.matchElement=function(e){return this.delegate.matchElement(e)},e.prototype.matchElementsInTree=function(e){return void 0===e&&(e=this.element),this.delegate.matchElementsInTree(e)},e.prototype.processTree=function(e,t){for(var n=0,r=this.matchElementsInTree(e);n<r.length;n++){var o=r[n];t.call(this,o)}},e.prototype.elementFromNode=function(e){if(e.nodeType==Node.ELEMENT_NODE)return e},e.prototype.elementIsActive=function(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)},e.prototype.addElement=function(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))},e.prototype.removeElement=function(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))},e}(),l=function(){function e(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new u(e,this)}return Object.defineProperty(e.prototype,"element",{get:function(){return this.elementObserver.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selector",{get:function(){return"["+this.attributeName+"]"},enumerable:!0,configurable:!0}),e.prototype.start=function(){this.elementObserver.start()},e.prototype.stop=function(){this.elementObserver.stop()},e.prototype.refresh=function(){this.elementObserver.refresh()},Object.defineProperty(e.prototype,"started",{get:function(){return this.elementObserver.started},enumerable:!0,configurable:!0}),e.prototype.matchElement=function(e){return e.hasAttribute(this.attributeName)},e.prototype.matchElementsInTree=function(e){var t=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector));return t.concat(n)},e.prototype.elementMatched=function(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)},e.prototype.elementUnmatched=function(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)},e.prototype.elementAttributeChanged=function(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)},e}();function p(e,t,n){f(e,t).add(n)}function h(e,t,n){var r,o,i;f(e,t).delete(n),o=t,null!=(i=(r=e).get(o))&&0==i.size&&r.delete(o)}function f(e,t){var n=e.get(t);return n||(n=new Set,e.set(t,n)),n}var d,m=function(){function e(){this.valuesByKey=new Map}return Object.defineProperty(e.prototype,"values",{get:function(){return Array.from(this.valuesByKey.values()).reduce(function(e,t){return e.concat(Array.from(t))},[])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return Array.from(this.valuesByKey.values()).reduce(function(e,t){return e+t.size},0)},enumerable:!0,configurable:!0}),e.prototype.add=function(e,t){p(this.valuesByKey,e,t)},e.prototype.delete=function(e,t){h(this.valuesByKey,e,t)},e.prototype.has=function(e,t){var n=this.valuesByKey.get(e);return null!=n&&n.has(t)},e.prototype.hasKey=function(e){return this.valuesByKey.has(e)},e.prototype.hasValue=function(t){return Array.from(this.valuesByKey.values()).some(function(e){return e.has(t)})},e.prototype.getValuesForKey=function(e){var t=this.valuesByKey.get(e);return t?Array.from(t):[]},e.prototype.getKeysForValue=function(t){return Array.from(this.valuesByKey).filter(function(e){e[0];return e[1].has(t)}).map(function(e){var t=e[0];e[1];return t})},e}(),y=(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}d(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),g=(function(n){function e(){var e=n.call(this)||this;return e.keysByValue=new Map,e}y(e,n),Object.defineProperty(e.prototype,"values",{get:function(){return Array.from(this.keysByValue.keys())},enumerable:!0,configurable:!0}),e.prototype.add=function(e,t){n.prototype.add.call(this,e,t),p(this.keysByValue,t,e)},e.prototype.delete=function(e,t){n.prototype.delete.call(this,e,t),h(this.keysByValue,t,e)},e.prototype.hasValue=function(e){return this.keysByValue.has(e)},e.prototype.getKeysForValue=function(e){var t=this.keysByValue.get(e);return t?Array.from(t):[]}}(m),function(){function e(e,t,n){this.attributeObserver=new l(e,t,this),this.delegate=n,this.tokensByElement=new m}return Object.defineProperty(e.prototype,"started",{get:function(){return this.attributeObserver.started},enumerable:!0,configurable:!0}),e.prototype.start=function(){this.attributeObserver.start()},e.prototype.stop=function(){this.attributeObserver.stop()},e.prototype.refresh=function(){this.attributeObserver.refresh()},Object.defineProperty(e.prototype,"element",{get:function(){return this.attributeObserver.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"attributeName",{get:function(){return this.attributeObserver.attributeName},enumerable:!0,configurable:!0}),e.prototype.elementMatchedAttribute=function(e){this.tokensMatched(this.readTokensForElement(e))},e.prototype.elementAttributeValueChanged=function(e){var t=this.refreshTokensForElement(e),n=t[0],r=t[1];this.tokensUnmatched(n),this.tokensMatched(r)},e.prototype.elementUnmatchedAttribute=function(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))},e.prototype.tokensMatched=function(e){var t=this;e.forEach(function(e){return t.tokenMatched(e)})},e.prototype.tokensUnmatched=function(e){var t=this;e.forEach(function(e){return t.tokenUnmatched(e)})},e.prototype.tokenMatched=function(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)},e.prototype.tokenUnmatched=function(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)},e.prototype.refreshTokensForElement=function(e){var n,r,t,o=this.tokensByElement.getValuesForKey(e),i=this.readTokensForElement(e),s=(n=o,r=i,t=Math.max(n.length,r.length),Array.from({length:t},function(e,t){return[n[t],r[t]]})).findIndex(function(e){var t,n,r=e[0],o=e[1];return n=o,!((t=r)&&n&&t.index==n.index&&t.content==n.content)});return-1==s?[[],[]]:[o.slice(s),i.slice(s)]},e.prototype.readTokensForElement=function(e){var n,r,t=this.attributeName,o=e.getAttribute(t)||"";return n=e,r=t,o.trim().split(/\s+/).filter(function(e){return e.length}).map(function(e,t){return{element:n,attributeName:r,content:e,index:t}})},e}());var b,v=function(){function e(e,t,n){this.tokenListObserver=new g(e,t,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}return Object.defineProperty(e.prototype,"started",{get:function(){return this.tokenListObserver.started},enumerable:!0,configurable:!0}),e.prototype.start=function(){this.tokenListObserver.start()},e.prototype.stop=function(){this.tokenListObserver.stop()},e.prototype.refresh=function(){this.tokenListObserver.refresh()},Object.defineProperty(e.prototype,"element",{get:function(){return this.tokenListObserver.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"attributeName",{get:function(){return this.tokenListObserver.attributeName},enumerable:!0,configurable:!0}),e.prototype.tokenMatched=function(e){var t=e.element,n=this.fetchParseResultForToken(e).value;n&&(this.fetchValuesByTokenForElement(t).set(e,n),this.delegate.elementMatchedValue(t,n))},e.prototype.tokenUnmatched=function(e){var t=e.element,n=this.fetchParseResultForToken(e).value;n&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,n))},e.prototype.fetchParseResultForToken=function(e){var t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t},e.prototype.fetchValuesByTokenForElement=function(e){var t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t},e.prototype.parseToken=function(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}},e}(),E=function(){function e(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}return e.prototype.start=function(){this.valueListObserver||(this.valueListObserver=new v(this.element,this.actionAttribute,this),this.valueListObserver.start())},e.prototype.stop=function(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())},Object.defineProperty(e.prototype,"element",{get:function(){return this.context.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"actionAttribute",{get:function(){return this.schema.actionAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return this.context.schema},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bindings",{get:function(){return Array.from(this.bindingsByAction.values())},enumerable:!0,configurable:!0}),e.prototype.connectAction=function(e){var t=new a(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)},e.prototype.disconnectAction=function(e){var t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))},e.prototype.disconnectAllActions=function(){var t=this;this.bindings.forEach(function(e){return t.delegate.bindingDisconnected(e)}),this.bindingsByAction.clear()},e.prototype.parseValueForToken=function(e){var t=i.forToken(e);if(t.identifier==this.identifier)return t},e.prototype.elementMatchedValue=function(e,t){this.connectAction(t)},e.prototype.elementUnmatchedValue=function(e,t){this.disconnectAction(t)},e}(),O=function(){function e(e,t){this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new E(this,this.dispatcher);try{this.controller.initialize()}catch(e){this.handleError(e,"initializing controller")}}return e.prototype.connect=function(){this.bindingObserver.start();try{this.controller.connect()}catch(e){this.handleError(e,"connecting controller")}},e.prototype.disconnect=function(){try{this.controller.disconnect()}catch(e){this.handleError(e,"disconnecting controller")}this.bindingObserver.stop()},Object.defineProperty(e.prototype,"application",{get:function(){return this.module.application},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return this.module.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return this.application.schema},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dispatcher",{get:function(){return this.application.dispatcher},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return this.element.parentElement},enumerable:!0,configurable:!0}),e.prototype.handleError=function(e,t,n){void 0===n&&(n={});var r=this.identifier,o=this.controller,i=this.element;n=Object.assign({identifier:r,controller:o,element:i},n),this.application.handleError(e,"Error "+t,n)},e}(),A=(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});function k(e){return{identifier:e.identifier,controllerConstructor:(t=e.controllerConstructor,n=w(t),n.bless(),n)};var t,n}var w=function(){function e(t){function n(){var e=this&&this instanceof n?this.constructor:void 0;return Reflect.construct(t,arguments,e)}return n.prototype=Object.create(t.prototype,{constructor:{value:n}}),Reflect.setPrototypeOf(n,t),n}try{return(t=e(function(){this.a.call(this)})).prototype.a=function(){},new t,e}catch(e){return function(e){return function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return A(t,e),t}(e)}}var t}(),C=function(){function e(e,t){this.application=e,this.definition=k(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}return Object.defineProperty(e.prototype,"identifier",{get:function(){return this.definition.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"controllerConstructor",{get:function(){return this.definition.controllerConstructor},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contexts",{get:function(){return Array.from(this.connectedContexts)},enumerable:!0,configurable:!0}),e.prototype.connectContextForScope=function(e){var t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()},e.prototype.disconnectContextForScope=function(e){var t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())},e.prototype.fetchContextForScope=function(e){var t=this.contextsByScope.get(e);return t||(t=new O(this,e),this.contextsByScope.set(e,t)),t},e}(),P=function(){function e(e){this.scope=e}return Object.defineProperty(e.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!0,configurable:!0}),e.prototype.get=function(e){return e=this.getFormattedKey(e),this.element.getAttribute(e)},e.prototype.set=function(e,t){return e=this.getFormattedKey(e),this.element.setAttribute(e,t),this.get(e)},e.prototype.has=function(e){return e=this.getFormattedKey(e),this.element.hasAttribute(e)},e.prototype.delete=function(e){return!!this.has(e)&&(e=this.getFormattedKey(e),this.element.removeAttribute(e),!0)},e.prototype.getFormattedKey=function(e){return"data-"+this.identifier+"-"+e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()})},e}();function j(e,t){return"["+e+'~="'+t+'"]'}var B=function(){function e(e){this.scope=e}return Object.defineProperty(e.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return this.scope.schema},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return null!=this.find(e)},e.prototype.find=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.getSelectorForTargetNames(e);return this.scope.findElement(n)},e.prototype.findAll=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this.getSelectorForTargetNames(e);return this.scope.findAllElements(n)},e.prototype.getSelectorForTargetNames=function(e){var t=this;return e.map(function(e){return t.getSelectorForTargetName(e)}).join(", ")},e.prototype.getSelectorForTargetName=function(e){var t=this.identifier+"."+e;return j(this.schema.targetAttribute,t)},e}(),x=function(){function e(e,t,n){this.schema=e,this.identifier=t,this.element=n,this.targets=new B(this),this.data=new P(this)}return e.prototype.findElement=function(e){return this.findAllElements(e)[0]},e.prototype.findAllElements=function(e){var t=this.element.matches(e)?[this.element]:[],n=this.filterElements(Array.from(this.element.querySelectorAll(e)));return t.concat(n)},e.prototype.filterElements=function(e){var t=this;return e.filter(function(e){return t.containsElement(e)})},e.prototype.containsElement=function(e){return e.closest(this.controllerSelector)===this.element},Object.defineProperty(e.prototype,"controllerSelector",{get:function(){return j(this.schema.controllerAttribute,this.identifier)},enumerable:!0,configurable:!0}),e}(),S=function(){function e(e,t,n){this.element=e,this.schema=t,this.delegate=n,this.valueListObserver=new v(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}return e.prototype.start=function(){this.valueListObserver.start()},e.prototype.stop=function(){this.valueListObserver.stop()},Object.defineProperty(e.prototype,"controllerAttribute",{get:function(){return this.schema.controllerAttribute},enumerable:!0,configurable:!0}),e.prototype.parseValueForToken=function(e){var t=e.element,n=e.content,r=this.fetchScopesByIdentifierForElement(t),o=r.get(n);return o||(o=new x(this.schema,n,t),r.set(n,o)),o},e.prototype.elementMatchedValue=function(e,t){var n=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,n),1==n&&this.delegate.scopeConnected(t)},e.prototype.elementUnmatchedValue=function(e,t){var n=this.scopeReferenceCounts.get(t);n&&(this.scopeReferenceCounts.set(t,n-1),1==n&&this.delegate.scopeDisconnected(t))},e.prototype.fetchScopesByIdentifierForElement=function(e){var t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t},e}(),T=function(){function e(e){this.application=e,this.scopeObserver=new S(this.element,this.schema,this),this.scopesByIdentifier=new m,this.modulesByIdentifier=new Map}return Object.defineProperty(e.prototype,"element",{get:function(){return this.application.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return this.application.schema},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"controllerAttribute",{get:function(){return this.schema.controllerAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"modules",{get:function(){return Array.from(this.modulesByIdentifier.values())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contexts",{get:function(){return this.modules.reduce(function(e,t){return e.concat(t.contexts)},[])},enumerable:!0,configurable:!0}),e.prototype.start=function(){this.scopeObserver.start()},e.prototype.stop=function(){this.scopeObserver.stop()},e.prototype.loadDefinition=function(e){this.unloadIdentifier(e.identifier);var t=new C(this.application,e);this.connectModule(t)},e.prototype.unloadIdentifier=function(e){var t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)},e.prototype.getContextForElementAndIdentifier=function(t,e){var n=this.modulesByIdentifier.get(e);if(n)return n.contexts.find(function(e){return e.element==t})},e.prototype.handleError=function(e,t,n){this.application.handleError(e,t,n)},e.prototype.scopeConnected=function(e){this.scopesByIdentifier.add(e.identifier,e);var t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)},e.prototype.scopeDisconnected=function(e){this.scopesByIdentifier.delete(e.identifier,e);var t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)},e.prototype.connectModule=function(t){this.modulesByIdentifier.set(t.identifier,t),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(function(e){return t.connectContextForScope(e)})},e.prototype.disconnectModule=function(t){this.modulesByIdentifier.delete(t.identifier),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(function(e){return t.disconnectContextForScope(e)})},e}(),N={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target"},F=function(i,s,c,a){return new(c||(c=Promise))(function(e,t){function n(e){try{o(a.next(e))}catch(e){t(e)}}function r(e){try{o(a.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new c(function(e){e(t.value)}).then(n,r)}o((a=a.apply(i,s||[])).next())})},L=function(n,r){var o,i,s,e,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;c;)try{if(o=1,i&&(s=i[2&t[0]?"return":t[0]?"throw":"next"])&&!(s=s.call(i,t[1])).done)return s;switch(i=0,s&&(t=[0,s.value]),t[0]){case 0:case 1:s=t;break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,i=t[1],t=[0];continue;case 7:t=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){c=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){c.label=t[1];break}if(6===t[0]&&c.label<s[1]){c.label=s[1],s=t;break}if(s&&c.label<s[2]){c.label=s[2],c.ops.push(t);break}s[2]&&c.ops.pop(),c.trys.pop();continue}t=r.call(n,c)}catch(e){t=[6,e],i=0}finally{o=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}},M=function(){function r(e,t){void 0===e&&(e=document.documentElement),void 0===t&&(t=N),this.element=e,this.schema=t,this.dispatcher=new n(this),this.router=new T(this)}return r.start=function(e,t){var n=new r(e,t);return n.start(),n},r.prototype.start=function(){return F(this,void 0,void 0,function(){return L(this,function(e){switch(e.label){case 0:return[4,new Promise(function(e){"loading"==document.readyState?document.addEventListener("DOMContentLoaded",e):e()})];case 1:return e.sent(),this.router.start(),this.dispatcher.start(),[2]}})})},r.prototype.stop=function(){this.router.stop(),this.dispatcher.stop()},r.prototype.register=function(e,t){this.load({identifier:e,controllerConstructor:t})},r.prototype.load=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(Array.isArray(e)?e:[e].concat(n)).forEach(function(e){return t.router.loadDefinition(e)})},r.prototype.unload=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(Array.isArray(e)?e:[e].concat(n)).forEach(function(e){return t.router.unloadIdentifier(e)})},Object.defineProperty(r.prototype,"controllers",{get:function(){return this.router.contexts.map(function(e){return e.controller})},enumerable:!0,configurable:!0}),r.prototype.getControllerForElementAndIdentifier=function(e,t){var n=this.router.getContextForElementAndIdentifier(e,t);return n?n.controller:null},r.prototype.handleError=function(e,t,n){console.error("%s\n\n%o\n\n%o",t,e,n)},r}();function I(e){var t,i=e.prototype;(t=function(e){var t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t}(e),Array.from(t.reduce(function(t,e){var n,r;return(n=e,r=n.targets,Array.isArray(r)?r:[]).forEach(function(e){return t.add(e)}),t},new Set))).forEach(function(t){var e,n,r,o;return n=i,(e={})[t+"Target"]={get:function(){var e=this.targets.find(t);if(e)return e;throw new Error('Missing target element "'+this.identifier+"."+t+'"')}},e[t+"Targets"]={get:function(){return this.targets.findAll(t)}},e["has"+(o=t,o.charAt(0).toUpperCase()+o.slice(1))+"Target"]={get:function(){return this.targets.has(t)}},r=e,void Object.keys(r).forEach(function(e){if(!(e in n)){var t=r[e];Object.defineProperty(n,e,t)}})})}var _=function(){function e(e){this.context=e}return e.bless=function(){I(this)},Object.defineProperty(e.prototype,"application",{get:function(){return this.context.application},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scope",{get:function(){return this.context.scope},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"targets",{get:function(){return this.scope.targets},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.scope.data},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){},e.prototype.connect=function(){},e.prototype.disconnect=function(){},e.targets=[],e}();e.Application=M,e.Context=O,e.Controller=_,e.defaultSchema=N,Object.defineProperty(e,"__esModule",{value:!0})}),function(){window.Stacks=window.Stacks||Object.create(null),Stacks._initializing=!0;var o=Stacks.stimulusApplication=Stimulus.Application.start();function i(){Stimulus.Controller.apply(this,arguments)}Stacks.controllers=Object.create(null),(i.prototype=Object.create(Stimulus.Controller.prototype,{constructor:{value:i,enumerable:!1,writable:!0}})).getElementData=function(e,t){return e.getAttribute("data-"+this.identifier+"-"+t)},i.prototype.setElementData=function(e,t,n){e.setAttribute("data-"+this.identifier+"-"+t,n)},i.prototype.removeElementData=function(e,t){e.removeAttribute("data-"+this.identifier+"-"+t)},i.prototype.triggerEvent=function(e,t,n){var r,o=this.identifier+":"+e;try{r=new CustomEvent(o,{bubbles:!0,detail:t})}catch(e){(r=document.createEvent("CustomEvent")).initCustomEvent(o,!0,!0,t)}(n||this.element).dispatchEvent(r)},Object.setPrototypeOf(i,Stimulus.Controller),Stacks.addController=function(e,t){var n=/^s-/.test(e);if(Stacks._initializing&&!n)throw'Stacks-created Stimulus controller names must start with "s-".';if(!Stacks._initializing&&n)throw'The "s-" prefix on Stimulus controller names is reserved for Stacks-created controllers.';var r=function(e,t){var n,r=function(){i.apply(this,arguments)};for(var o in r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0}}),Object.setPrototypeOf(r,i),t)t.hasOwnProperty(o)&&("targets"===o?(n=t[o],Object.defineProperty(r,"targets",{get:function(){return n},enumerable:!1})):Object.defineProperty(r.prototype,o,Object.getOwnPropertyDescriptor(t,o)));return r}(0,t);o.register(e,r),Stacks._initializing&&(Stacks.controllers[e]=r)}}(),function(){"use strict";var r="s-expandable-control:radio-off";function t(n){"INPUT"===n.target.nodeName&&"radio"===n.target.type&&document.querySelectorAll('input[type="radio"][name="'+n.target.name+'"]').forEach(function(e){if(e!==n.target){var t;try{t=new Event(r)}catch(e){(t=document.createEvent("Event")).initEvent(r,!0,!0)}e.dispatchEvent(t)}})}var n=0;function o(e){e?1===++n&&document.body.addEventListener("change",t):0===--n&&document.body.removeEventListener("change",t)}Stacks.addController("s-expandable-control",{initialize:function(){"INPUT"===this.element.nodeName&&0<=["radio","checkbox"].indexOf(this.element.type)?(this.isCollapsed=this._isCollapsedForCheckable,this.events=["change",r],this.isCheckable=!0,this.isRadio="radio"===this.element.type):(this.isCollapsed=this._isCollapsedForClickable,this.events=["click","keydown"]),this.listener=this.listener.bind(this)},_isCollapsedForClickable:function(){var e=this.controlledCollapsible;return e?!e.classList.contains("is-expanded"):"false"===this.element.getAttribute("aria-expanded")},_isCollapsedForCheckable:function(){return!this.element.checked},get controlledCollapsible(){return document.getElementById(this.element.getAttribute("aria-controls"))},_dispatchShowHideEvent:function(e){this.triggerEvent(e?"show":"hide")},_toggleClass:function(t){if(this.data.has("toggle-class")){var n=this.element.classList;this.data.get("toggle-class").split(/\s+/).forEach(function(e){n.toggle(e,!!t)})}},listener:function(e){var t;if(this.isCheckable)t=!this.element.checked;else{if("keydown"==e.type&&13!=e.keyCode&&32!=e.keyCode)return;if(e.target!==e.currentTarget&&0<=["A","BUTTON"].indexOf(e.target.nodeName))return;t="true"===this.element.getAttribute("aria-expanded"),e.preventDefault(),"click"===e.type&&this.element.blur()}this.element.setAttribute("aria-expanded",t?"false":"true"),this.controlledCollapsible.classList.toggle("is-expanded",!t),this._dispatchShowHideEvent(!t),this._toggleClass(!t)},connect:function(){if(this.events.forEach(function(e){this.element.addEventListener(e,this.listener)},this),this.isRadio&&o(!0),this.element.setAttribute("aria-expanded",this.isCollapsed()?"false":"true"),this.isCheckable){var e=this.controlledCollapsible;if(e){var t=!this.isCollapsed();t!==e.classList.contains("is-expanded")&&(e.classList.toggle("is-expanded",t),this._dispatchShowHideEvent(t),this._toggleClass(t))}}},disconnect:function(){this.events.forEach(function(e){this.element.removeEventListener(e,this.listener)},this),this.isRadio&&o(!1)}})}(),function(){"use strict";function f(e,t){for(var n=[],r=e.children[0],o=[],i=[];r||i.some(function(e){return e});){var s=[];n.push(s);var c=0;if(r)for(var a=0;a<r.children.length;a++){for(;i[c];)i[c]--,s[c]=o[c],c++;var u=r.children[a];if("none"!==getComputedStyle(u).display){if(u===t)return c;for(var l=c+u.colSpan;c<l;c++)i[c]=u.rowSpan-1,o[c]=u,s[c]=u}}for(;c<o.length;)i[c]&&(i[c]--,s[c]=o[c]),c++;r&&(r=r.nextElementSibling)}return t?-1:n}Stacks.addController("s-table",{targets:["column"],setCurrentSort:function(t,r){if(["asc","desc","none"].indexOf(r)<0)throw"direction must be one of asc, desc, or none";var o=this;this.columnTargets.forEach(function(e){var n=e===t;e.classList.toggle("is-sorted",n&&"none"!==r),e.querySelectorAll(".js-sorting-indicator").forEach(function(e){var t=n?r:"none";e.classList.toggle("d-none",!e.classList.contains("js-sorting-indicator-"+t))}),n&&"none"!==r?o.setElementData(e,"sort-direction",r):o.removeElementData(e,"sort-direction")})},sort:function(e){var t,s=this,n=e.currentTarget,r=this.element,o=r.tBodies[0],c=f((t=n).parentElement.parentElement,t);if(!(c<0)){var a,u=f(o),i="asc"===this.getElementData(n,"sort-direction")?-1:1,l=Array.from(r.tBodies[0].rows),p=!1,h=[];l.forEach(function(e,t){var n=s.getElementData(e,"sort-to");if("top"!==n)if("bottom"!==n){var r=u[t][c];if(r){var o=s.getElementData(r,"sort-val"),i="string"==typeof o?o:r.textContent.trim();""!==i&&parseInt(i,10)+""!==i&&(p=!0),h.push([i,t])}else h.push(["",t])}else a||(a=e)}),p||h.forEach(function(e){e[0]=""===e[0]?Number.MIN_VALUE:parseInt(e[0],10)}),h.sort(function(e,t){return e[0]>t[0]?1*i:e[0]<t[0]?-1*i:e[1]>t[1]?1:-1}),h.forEach(function(e){var t=l[e[1]];t.parentElement.removeChild(t),a?o.insertBefore(t,a):o.appendChild(t)}),this.setCurrentSort(n,1===i?"asc":"desc")}}})}(),delete Stacks._initializing;

@@ -8,3 +8,3 @@ {

},
"version": "0.35.3",
"version": "0.36.0",
"files": [

@@ -15,3 +15,5 @@ "dist"

"scripts": {
"start": "grunt"
"start": "grunt",
"update-icons": "grunt update-icons",
"build": "grunt build"
},

@@ -39,3 +41,3 @@ "license": "MIT",

"dependencies": {
"@stackoverflow/stacks-icons": "^1.15.0",
"@stackoverflow/stacks-icons": "^1.16.0",
"backstopjs": "^3.9.2",

@@ -42,0 +44,0 @@ "stimulus": "^1.1.1"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc