@stackoverflow/stacks 0.70.0 → 0.73.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +1 -1
  2. package/dist/css/stacks.css +1742 -681
  3. package/dist/css/stacks.min.css +1 -1
  4. package/dist/js/stacks.js +167 -92
  5. package/dist/js/stacks.min.js +1 -1
  6. package/lib/css/atomic/_stacks-borders.less +18 -0
  7. package/lib/css/atomic/_stacks-flex.less +2 -7
  8. package/lib/css/atomic/_stacks-grid.less +2 -0
  9. package/lib/css/atomic/_stacks-misc.less +6 -2
  10. package/lib/css/atomic/_stacks-typography.less +23 -8
  11. package/lib/css/base/_stacks-configuration-dynamic.less +5 -15
  12. package/lib/css/components/_stacks-activity-indicator.less +26 -2
  13. package/lib/css/components/_stacks-avatars.less +9 -0
  14. package/lib/css/components/_stacks-badges.less +18 -6
  15. package/lib/css/components/_stacks-breadcrumbs.less +2 -0
  16. package/lib/css/components/_stacks-button-groups.less +11 -0
  17. package/lib/css/components/_stacks-buttons.less +111 -10
  18. package/lib/css/components/_stacks-cards.less +9 -13
  19. package/lib/css/components/_stacks-code-blocks.less +1 -1
  20. package/lib/css/components/_stacks-inputs.less +78 -9
  21. package/lib/css/components/_stacks-link-previews.less +7 -3
  22. package/lib/css/components/_stacks-links.less +25 -2
  23. package/lib/css/components/_stacks-menu.less +4 -4
  24. package/lib/css/components/_stacks-modals.less +1 -1
  25. package/lib/css/components/_stacks-navigation.less +18 -0
  26. package/lib/css/components/_stacks-notices.less +40 -3
  27. package/lib/css/components/_stacks-page-titles.less +1 -1
  28. package/lib/css/components/_stacks-pagination.less +4 -2
  29. package/lib/css/components/_stacks-popovers.less +22 -2
  30. package/lib/css/components/_stacks-post-summary.less +134 -3
  31. package/lib/css/components/_stacks-progress-bars.less +29 -6
  32. package/lib/css/components/_stacks-prose.less +16 -2
  33. package/lib/css/components/_stacks-tables.less +10 -6
  34. package/lib/css/components/_stacks-tags.less +22 -19
  35. package/lib/css/components/_stacks-toggle-switches.less +12 -0
  36. package/lib/css/components/_stacks-topbar.less +440 -0
  37. package/lib/css/components/_stacks-uploader.less +22 -0
  38. package/lib/css/components/_stacks-widget-static.less +15 -3
  39. package/lib/css/exports/_stacks-constants-colors.less +443 -35
  40. package/lib/css/exports/_stacks-constants-helpers.less +1 -2
  41. package/lib/css/exports/_stacks-mixins.less +26 -0
  42. package/lib/css/stacks-dynamic.less +0 -1
  43. package/lib/css/stacks-static.less +15 -0
  44. package/lib/ts/controllers/s-tooltip.ts +4 -0
  45. package/package.json +15 -12
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Stimulus={})}(this,function(e){"use strict";var r=(t.prototype.connect=function(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)},t.prototype.disconnect=function(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)},t.prototype.bindingConnected=function(e){this.unorderedBindings.add(e)},t.prototype.bindingDisconnected=function(e){this.unorderedBindings.delete(e)},t.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(t.prototype,"bindings",{get:function(){return Array.from(this.unorderedBindings).sort(function(e,t){e=e.index,t=t.index;return e<t?-1:t<e?1:0})},enumerable:!1,configurable:!0}),t);function t(e,t,n){this.eventTarget=e,this.eventName=t,this.eventOptions=n,this.unorderedBindings=new Set}var n=(o.prototype.start=function(){this.started||(this.started=!0,this.eventListeners.forEach(function(e){return e.connect()}))},o.prototype.stop=function(){this.started&&(this.started=!1,this.eventListeners.forEach(function(e){return e.disconnect()}))},Object.defineProperty(o.prototype,"eventListeners",{get:function(){return Array.from(this.eventListenerMaps.values()).reduce(function(e,t){return e.concat(Array.from(t.values()))},[])},enumerable:!1,configurable:!0}),o.prototype.bindingConnected=function(e){this.fetchEventListenerForBinding(e).bindingConnected(e)},o.prototype.bindingDisconnected=function(e){this.fetchEventListenerForBinding(e).bindingDisconnected(e)},o.prototype.handleError=function(e,t,n){this.application.handleError(e,"Error "+t,n=void 0===n?{}:n)},o.prototype.fetchEventListenerForBinding=function(e){var t=e.eventTarget,n=e.eventName,e=e.eventOptions;return this.fetchEventListener(t,n,e)},o.prototype.fetchEventListener=function(e,t,n){var r=this.fetchEventListenerMapForEventTarget(e),o=this.cacheKey(t,n),i=r.get(o);return i||(i=this.createEventListener(e,t,n),r.set(o,i)),i},o.prototype.createEventListener=function(e,t,n){n=new r(e,t,n);return this.started&&n.connect(),n},o.prototype.fetchEventListenerMapForEventTarget=function(e){var t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t},o.prototype.cacheKey=function(e,t){var n=[e];return Object.keys(t).sort().forEach(function(e){n.push((t[e]?"":"!")+e)}),n.join(":")},o);function o(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}var i=/^((.+?)(@(window|document))?->)?(.+?)(#([^:]+?))(:(.+))?$/;function s(e){e=e.trim().match(i)||[];return{eventTarget:function(e){{if("window"==e)return window;if("document"==e)return document}}(e[4]),eventName:e[2],eventOptions:e[9]?e[9].split(":").reduce(function(e,t){return Object.assign(e,((e={})[t.replace(/^!/,"")]=!/^!/.test(t),e))},{}):{},identifier:e[5],methodName:e[7]}}var a=(c.forToken=function(e){return new this(e.element,e.index,s(e.content))},c.prototype.toString=function(){var e=this.eventTargetName?"@"+this.eventTargetName:"";return this.eventName+e+"->"+this.identifier+"#"+this.methodName},Object.defineProperty(c.prototype,"eventTargetName",{get:function(){return(e=this.eventTarget)==window?"window":e==document?"document":void 0;var e},enumerable:!1,configurable:!0}),c);function c(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 u)return u[t](e)}(e)||l("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||l("missing identifier"),this.methodName=n.methodName||l("missing method name")}var u={a:function(e){return"click"},button:function(e){return"click"},form:function(e){return"submit"},input:function(e){return"submit"==e.getAttribute("type")?"click":"input"},select:function(e){return"change"},textarea:function(e){return"input"}};function l(e){throw new Error(e)}var p=(Object.defineProperty(f.prototype,"index",{get:function(){return this.action.index},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"eventTarget",{get:function(){return this.action.eventTarget},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"eventOptions",{get:function(){return this.action.eventOptions},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!1,configurable:!0}),f.prototype.handleEvent=function(e){this.willBeInvokedByEvent(e)&&this.invokeWithEvent(e)},Object.defineProperty(f.prototype,"eventName",{get:function(){return this.action.eventName},enumerable:!1,configurable:!0}),Object.defineProperty(f.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:!1,configurable:!0}),f.prototype.invokeWithEvent=function(t){try{this.method.call(this.controller,t)}catch(e){var n=this.identifier,r=this.controller,o=this.element,i=this.index;this.context.handleError(e,'invoking action "'+this.action+'"',{identifier:n,controller:r,element:o,index:i,event:t})}},f.prototype.willBeInvokedByEvent=function(e){e=e.target;return this.element===e||(e instanceof Element&&this.element.contains(e)?this.scope.containsElement(e):this.scope.containsElement(this.action.element))},Object.defineProperty(f.prototype,"controller",{get:function(){return this.context.controller},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"methodName",{get:function(){return this.action.methodName},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"scope",{get:function(){return this.context.scope},enumerable:!1,configurable:!0}),f);function f(e,t){this.context=e,this.action=t}var d=(h.prototype.start=function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,childList:!0,subtree:!0}),this.refresh())},h.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},h.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)}}},h.prototype.processMutations=function(e){if(this.started)for(var t=0,n=e;t<n.length;t++){var r=n[t];this.processMutation(r)}},h.prototype.processMutation=function(e){"attributes"==e.type?this.processAttributeChange(e.target,e.attributeName):"childList"==e.type&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))},h.prototype.processAttributeChange=function(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)},h.prototype.processRemovedNodes=function(e){for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t],r=this.elementFromNode(r);r&&this.processTree(r,this.removeElement)}},h.prototype.processAddedNodes=function(e){for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t],r=this.elementFromNode(r);r&&this.elementIsActive(r)&&this.processTree(r,this.addElement)}},h.prototype.matchElement=function(e){return this.delegate.matchElement(e)},h.prototype.matchElementsInTree=function(e){return void 0===e&&(e=this.element),this.delegate.matchElementsInTree(e)},h.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)}},h.prototype.elementFromNode=function(e){if(e.nodeType==Node.ELEMENT_NODE)return e},h.prototype.elementIsActive=function(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)},h.prototype.addElement=function(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))},h.prototype.removeElement=function(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))},h);function h(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)})}var m=(Object.defineProperty(y.prototype,"element",{get:function(){return this.elementObserver.element},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"selector",{get:function(){return"["+this.attributeName+"]"},enumerable:!1,configurable:!0}),y.prototype.start=function(){this.elementObserver.start()},y.prototype.stop=function(){this.elementObserver.stop()},y.prototype.refresh=function(){this.elementObserver.refresh()},Object.defineProperty(y.prototype,"started",{get:function(){return this.elementObserver.started},enumerable:!1,configurable:!0}),y.prototype.matchElement=function(e){return e.hasAttribute(this.attributeName)},y.prototype.matchElementsInTree=function(e){var t=this.matchElement(e)?[e]:[],e=Array.from(e.querySelectorAll(this.selector));return t.concat(e)},y.prototype.elementMatched=function(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)},y.prototype.elementUnmatched=function(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)},y.prototype.elementAttributeChanged=function(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)},y);function y(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new d(e,this)}var g=(b.prototype.start=function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0}),this.refresh())},b.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},b.prototype.refresh=function(){if(this.started)for(var e=0,t=this.knownAttributeNames;e<t.length;e++){var n=t[e];this.refreshAttribute(n)}},b.prototype.processMutations=function(e){if(this.started)for(var t=0,n=e;t<n.length;t++){var r=n[t];this.processMutation(r)}},b.prototype.processMutation=function(e){e=e.attributeName;e&&this.refreshAttribute(e)},b.prototype.refreshAttribute=function(e){var t,n=this.delegate.getStringMapKeyForAttribute(e);null!=n&&(this.stringMap.has(e)||this.stringMapKeyAdded(n,e),t=this.element.getAttribute(e),this.stringMap.get(e)!=t&&this.stringMapValueChanged(t,n),null==t?(this.stringMap.delete(e),this.stringMapKeyRemoved(n,e)):this.stringMap.set(e,t))},b.prototype.stringMapKeyAdded=function(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)},b.prototype.stringMapValueChanged=function(e,t){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t)},b.prototype.stringMapKeyRemoved=function(e,t){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t)},Object.defineProperty(b.prototype,"knownAttributeNames",{get:function(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"currentAttributeNames",{get:function(){return Array.from(this.element.attributes).map(function(e){return e.name})},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"recordedAttributeNames",{get:function(){return Array.from(this.stringMap.keys())},enumerable:!1,configurable:!0}),b);function b(e,t){var n=this;this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(function(e){return n.processMutations(e)})}function v(e,t,n){O(e,t).add(n)}function w(e,t,n){O(e,t).delete(n),n=t,null!=(e=(t=e).get(n))&&0==e.size&&t.delete(n)}function O(e,t){var n=e.get(t);return n||(n=new Set,e.set(t,n)),n}var E=(Object.defineProperty(A.prototype,"values",{get:function(){return Array.from(this.valuesByKey.values()).reduce(function(e,t){return e.concat(Array.from(t))},[])},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"size",{get:function(){return Array.from(this.valuesByKey.values()).reduce(function(e,t){return e+t.size},0)},enumerable:!1,configurable:!0}),A.prototype.add=function(e,t){v(this.valuesByKey,e,t)},A.prototype.delete=function(e,t){w(this.valuesByKey,e,t)},A.prototype.has=function(e,t){e=this.valuesByKey.get(e);return null!=e&&e.has(t)},A.prototype.hasKey=function(e){return this.valuesByKey.has(e)},A.prototype.hasValue=function(t){return Array.from(this.valuesByKey.values()).some(function(e){return e.has(t)})},A.prototype.getValuesForKey=function(e){e=this.valuesByKey.get(e);return e?Array.from(e):[]},A.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})},A);function A(){this.valuesByKey=new Map}var x,_;(window&&window.__extends||(x=function(e,t){return(x=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])})(e,t)},function(e,t){function n(){this.constructor=e}x(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}))(k,_=E),Object.defineProperty(k.prototype,"values",{get:function(){return Array.from(this.keysByValue.keys())},enumerable:!1,configurable:!0}),k.prototype.add=function(e,t){_.prototype.add.call(this,e,t),v(this.keysByValue,t,e)},k.prototype.delete=function(e,t){_.prototype.delete.call(this,e,t),w(this.keysByValue,t,e)},k.prototype.hasValue=function(e){return this.keysByValue.has(e)},k.prototype.getKeysForValue=function(e){e=this.keysByValue.get(e);return e?Array.from(e):[]};function k(){var e=_.call(this)||this;return e.keysByValue=new Map,e}var T=(Object.defineProperty(P.prototype,"started",{get:function(){return this.attributeObserver.started},enumerable:!1,configurable:!0}),P.prototype.start=function(){this.attributeObserver.start()},P.prototype.stop=function(){this.attributeObserver.stop()},P.prototype.refresh=function(){this.attributeObserver.refresh()},Object.defineProperty(P.prototype,"element",{get:function(){return this.attributeObserver.element},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"attributeName",{get:function(){return this.attributeObserver.attributeName},enumerable:!1,configurable:!0}),P.prototype.elementMatchedAttribute=function(e){this.tokensMatched(this.readTokensForElement(e))},P.prototype.elementAttributeValueChanged=function(e){var t=this.refreshTokensForElement(e),e=t[0],t=t[1];this.tokensUnmatched(e),this.tokensMatched(t)},P.prototype.elementUnmatchedAttribute=function(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))},P.prototype.tokensMatched=function(e){var t=this;e.forEach(function(e){return t.tokenMatched(e)})},P.prototype.tokensUnmatched=function(e){var t=this;e.forEach(function(e){return t.tokenUnmatched(e)})},P.prototype.tokenMatched=function(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)},P.prototype.tokenUnmatched=function(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)},P.prototype.refreshTokensForElement=function(e){var n,r,t=this.tokensByElement.getValuesForKey(e),o=this.readTokensForElement(e),e=(n=t,r=o,e=Math.max(n.length,r.length),Array.from({length:e},function(e,t){return[n[t],r[t]]}).findIndex(function(e){var t=e[0],e=e[1];return e=e,!((t=t)&&e&&t.index==e.index&&t.content==e.content)}));return-1==e?[[],[]]:[t.slice(e),o.slice(e)]},P.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}})},P);function P(e,t,n){this.attributeObserver=new m(e,t,this),this.delegate=n,this.tokensByElement=new E}var S=(Object.defineProperty(j.prototype,"started",{get:function(){return this.tokenListObserver.started},enumerable:!1,configurable:!0}),j.prototype.start=function(){this.tokenListObserver.start()},j.prototype.stop=function(){this.tokenListObserver.stop()},j.prototype.refresh=function(){this.tokenListObserver.refresh()},Object.defineProperty(j.prototype,"element",{get:function(){return this.tokenListObserver.element},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"attributeName",{get:function(){return this.tokenListObserver.attributeName},enumerable:!1,configurable:!0}),j.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))},j.prototype.tokenUnmatched=function(e){var t=e.element,n=this.fetchParseResultForToken(e).value;n&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,n))},j.prototype.fetchParseResultForToken=function(e){var t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t},j.prototype.fetchValuesByTokenForElement=function(e){var t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t},j.prototype.parseToken=function(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}},j);function j(e,t,n){this.tokenListObserver=new T(e,t,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}var C=(L.prototype.start=function(){this.valueListObserver||(this.valueListObserver=new S(this.element,this.actionAttribute,this),this.valueListObserver.start())},L.prototype.stop=function(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())},Object.defineProperty(L.prototype,"element",{get:function(){return this.context.element},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"actionAttribute",{get:function(){return this.schema.actionAttribute},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"schema",{get:function(){return this.context.schema},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"bindings",{get:function(){return Array.from(this.bindingsByAction.values())},enumerable:!1,configurable:!0}),L.prototype.connectAction=function(e){var t=new p(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)},L.prototype.disconnectAction=function(e){var t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))},L.prototype.disconnectAllActions=function(){var t=this;this.bindings.forEach(function(e){return t.delegate.bindingDisconnected(e)}),this.bindingsByAction.clear()},L.prototype.parseValueForToken=function(e){e=a.forToken(e);if(e.identifier==this.identifier)return e},L.prototype.elementMatchedValue=function(e,t){this.connectAction(t)},L.prototype.elementUnmatchedValue=function(e,t){this.disconnectAction(t)},L);function L(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}var M=(B.prototype.start=function(){this.stringMapObserver.start()},B.prototype.stop=function(){this.stringMapObserver.stop()},Object.defineProperty(B.prototype,"element",{get:function(){return this.context.element},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"controller",{get:function(){return this.context.controller},enumerable:!1,configurable:!0}),B.prototype.getStringMapKeyForAttribute=function(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name},B.prototype.stringMapValueChanged=function(e,t){this.invokeChangedCallbackForValue(t)},B.prototype.invokeChangedCallbacksForDefaultValues=function(){for(var e=0,t=this.valueDescriptors;e<t.length;e++){var n=t[e],r=n.key,o=n.name;null==n.defaultValue||this.controller.data.has(r)||this.invokeChangedCallbackForValue(o)}},B.prototype.invokeChangedCallbackForValue=function(e){var t=this.receiver[e+"Changed"];"function"==typeof t&&(e=this.receiver[e],t.call(this.receiver,e))},Object.defineProperty(B.prototype,"valueDescriptors",{get:function(){var t=this.valueDescriptorMap;return Object.keys(t).map(function(e){return t[e]})},enumerable:!1,configurable:!0}),B);function B(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new g(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap,this.invokeChangedCallbacksForDefaultValues()}var D=(F.prototype.connect=function(){this.bindingObserver.start(),this.valueObserver.start();try{this.controller.connect()}catch(e){this.handleError(e,"connecting controller")}},F.prototype.disconnect=function(){try{this.controller.disconnect()}catch(e){this.handleError(e,"disconnecting controller")}this.valueObserver.stop(),this.bindingObserver.stop()},Object.defineProperty(F.prototype,"application",{get:function(){return this.module.application},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"identifier",{get:function(){return this.module.identifier},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"schema",{get:function(){return this.application.schema},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"dispatcher",{get:function(){return this.application.dispatcher},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"parentElement",{get:function(){return this.element.parentElement},enumerable:!1,configurable:!0}),F.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)},F);function F(e,t){this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new C(this,this.dispatcher),this.valueObserver=new M(this,this.controller);try{this.controller.initialize()}catch(e){this.handleError(e,"initializing controller")}}function N(e,n){e=V(e);return Array.from(e.reduce(function(t,e){return function(e,t){t=e[t];return Array.isArray(t)?t:[]}(e,n).forEach(function(e){return t.add(e)}),t},new Set))}function I(e,r){return V(e).reduce(function(e,t){var n;return e.push.apply(e,(n=t[r])?Object.keys(n).map(function(e){return[e,n[e]]}):[]),e},[])}function V(e){for(var t=[];e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}var K,H=window&&window.__extends||(K=function(e,t){return(K=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])})(e,t)},function(e,t){function n(){this.constructor=e}K(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),R=window&&window.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r};function U(e){return n=N(i=t=e,"blessings").reduce(function(e,t){var n,r=t(i);for(n in r){var o=e[n]||{};e[n]=Object.assign(o,r[n])}return e},{}),e=W(t),n=function(o,i){return q(i).reduce(function(e,t){var n,r=function(e,t,n){e=Object.getOwnPropertyDescriptor(e,n);if(!(e&&"value"in e)){n=Object.getOwnPropertyDescriptor(t,n).value;return e&&(n.get=e.get||n.get,n.set=e.set||n.set),n}}(o,i,t);return r&&Object.assign(e,((n={})[t]=r,n)),e},{})}(t.prototype,n),Object.defineProperties(e.prototype,n),e;var t,n,i}var q="function"==typeof Object.getOwnPropertySymbols?function(e){return R(Object.getOwnPropertyNames(e),Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,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 H(t,n=e),t;function t(){return null!==n&&n.apply(this,arguments)||this}var n}}var t}();var z=(Object.defineProperty(G.prototype,"identifier",{get:function(){return this.definition.identifier},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"controllerConstructor",{get:function(){return this.definition.controllerConstructor},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"contexts",{get:function(){return Array.from(this.connectedContexts)},enumerable:!1,configurable:!0}),G.prototype.connectContextForScope=function(e){e=this.fetchContextForScope(e);this.connectedContexts.add(e),e.connect()},G.prototype.disconnectContextForScope=function(e){e=this.contextsByScope.get(e);e&&(this.connectedContexts.delete(e),e.disconnect())},G.prototype.fetchContextForScope=function(e){var t=this.contextsByScope.get(e);return t||(t=new D(this,e),this.contextsByScope.set(e,t)),t},G);function G(e,t){this.application=e,this.definition={identifier:(t=t).identifier,controllerConstructor:U(t.controllerConstructor)},this.contextsByScope=new WeakMap,this.connectedContexts=new Set}var J=(X.prototype.has=function(e){return this.data.has(this.getDataKey(e))},X.prototype.get=function(e){return this.data.get(this.getDataKey(e))},X.prototype.getAttributeName=function(e){return this.data.getAttributeNameForKey(this.getDataKey(e))},X.prototype.getDataKey=function(e){return e+"-class"},Object.defineProperty(X.prototype,"data",{get:function(){return this.scope.data},enumerable:!1,configurable:!0}),X);function X(e){this.scope=e}function Y(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Z(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()})}var $=(Object.defineProperty(Q.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!1,configurable:!0}),Q.prototype.get=function(e){e=this.getAttributeNameForKey(e);return this.element.getAttribute(e)},Q.prototype.set=function(e,t){var n=this.getAttributeNameForKey(e);return this.element.setAttribute(n,t),this.get(e)},Q.prototype.has=function(e){e=this.getAttributeNameForKey(e);return this.element.hasAttribute(e)},Q.prototype.delete=function(e){if(this.has(e)){e=this.getAttributeNameForKey(e);return this.element.removeAttribute(e),!0}return!1},Q.prototype.getAttributeNameForKey=function(e){return"data-"+this.identifier+"-"+Z(e)},Q);function Q(e){this.scope=e}var ee=(te.prototype.warn=function(e,t,n){var r=this.warnedKeysByObject.get(e);r||(r=new Set,this.warnedKeysByObject.set(e,r)),r.has(t)||(r.add(t),this.logger.warn(n,e))},te);function te(e){this.warnedKeysByObject=new WeakMap,this.logger=e}function ne(e,t){return"["+e+'~="'+t+'"]'}var re=window&&window.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},oe=(Object.defineProperty(ie.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"schema",{get:function(){return this.scope.schema},enumerable:!1,configurable:!0}),ie.prototype.has=function(e){return null!=this.find(e)},ie.prototype.find=function(){for(var n=this,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(function(e,t){return e||n.findTarget(t)||n.findLegacyTarget(t)},void 0)},ie.prototype.findAll=function(){for(var n=this,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(function(e,t){return re(e,n.findAllTargets(t),n.findAllLegacyTargets(t))},[])},ie.prototype.findTarget=function(e){e=this.getSelectorForTargetName(e);return this.scope.findElement(e)},ie.prototype.findAllTargets=function(e){e=this.getSelectorForTargetName(e);return this.scope.findAllElements(e)},ie.prototype.getSelectorForTargetName=function(e){return ne("data-"+this.identifier+"-target",e)},ie.prototype.findLegacyTarget=function(e){var t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)},ie.prototype.findAllLegacyTargets=function(t){var n=this,e=this.getLegacySelectorForTargetName(t);return this.scope.findAllElements(e).map(function(e){return n.deprecate(e,t)})},ie.prototype.getLegacySelectorForTargetName=function(e){e=this.identifier+"."+e;return ne(this.schema.targetAttribute,e)},ie.prototype.deprecate=function(e,t){var n,r;return e&&(n=this.identifier,r=this.schema.targetAttribute,this.guide.warn(e,"target:"+t,"Please replace "+r+'="'+n+"."+t+'" with data-'+n+'-target="'+t+'". The '+r+" attribute is deprecated and will be removed in a future version of Stimulus.")),e},Object.defineProperty(ie.prototype,"guide",{get:function(){return this.scope.guide},enumerable:!1,configurable:!0}),ie);function ie(e){this.scope=e}var se=window&&window.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},ae=(ce.prototype.findElement=function(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)},ce.prototype.findAllElements=function(e){return se(this.element.matches(e)?[this.element]:[],this.queryElements(e).filter(this.containsElement))},ce.prototype.queryElements=function(e){return Array.from(this.element.querySelectorAll(e))},Object.defineProperty(ce.prototype,"controllerSelector",{get:function(){return ne(this.schema.controllerAttribute,this.identifier)},enumerable:!1,configurable:!0}),ce);function ce(e,t,n,r){var o=this;this.targets=new oe(this),this.classes=new J(this),this.data=new $(this),this.containsElement=function(e){return e.closest(o.controllerSelector)===o.element},this.schema=e,this.element=t,this.identifier=n,this.guide=new ee(r)}var ue=(le.prototype.start=function(){this.valueListObserver.start()},le.prototype.stop=function(){this.valueListObserver.stop()},Object.defineProperty(le.prototype,"controllerAttribute",{get:function(){return this.schema.controllerAttribute},enumerable:!1,configurable:!0}),le.prototype.parseValueForToken=function(e){var t=e.element,n=e.content,r=this.fetchScopesByIdentifierForElement(t),e=r.get(n);return e||(e=this.delegate.createScopeForElementAndIdentifier(t,n),r.set(n,e)),e},le.prototype.elementMatchedValue=function(e,t){var n=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,n),1==n&&this.delegate.scopeConnected(t)},le.prototype.elementUnmatchedValue=function(e,t){var n=this.scopeReferenceCounts.get(t);n&&(this.scopeReferenceCounts.set(t,n-1),1==n&&this.delegate.scopeDisconnected(t))},le.prototype.fetchScopesByIdentifierForElement=function(e){var t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t},le);function le(e,t,n){this.element=e,this.schema=t,this.delegate=n,this.valueListObserver=new S(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}var pe=(Object.defineProperty(fe.prototype,"element",{get:function(){return this.application.element},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"schema",{get:function(){return this.application.schema},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"logger",{get:function(){return this.application.logger},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"controllerAttribute",{get:function(){return this.schema.controllerAttribute},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"modules",{get:function(){return Array.from(this.modulesByIdentifier.values())},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"contexts",{get:function(){return this.modules.reduce(function(e,t){return e.concat(t.contexts)},[])},enumerable:!1,configurable:!0}),fe.prototype.start=function(){this.scopeObserver.start()},fe.prototype.stop=function(){this.scopeObserver.stop()},fe.prototype.loadDefinition=function(e){this.unloadIdentifier(e.identifier);e=new z(this.application,e);this.connectModule(e)},fe.prototype.unloadIdentifier=function(e){e=this.modulesByIdentifier.get(e);e&&this.disconnectModule(e)},fe.prototype.getContextForElementAndIdentifier=function(t,e){e=this.modulesByIdentifier.get(e);if(e)return e.contexts.find(function(e){return e.element==t})},fe.prototype.handleError=function(e,t,n){this.application.handleError(e,t,n)},fe.prototype.createScopeForElementAndIdentifier=function(e,t){return new ae(this.schema,e,t,this.logger)},fe.prototype.scopeConnected=function(e){this.scopesByIdentifier.add(e.identifier,e);var t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)},fe.prototype.scopeDisconnected=function(e){this.scopesByIdentifier.delete(e.identifier,e);var t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)},fe.prototype.connectModule=function(t){this.modulesByIdentifier.set(t.identifier,t),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(function(e){return t.connectContextForScope(e)})},fe.prototype.disconnectModule=function(t){this.modulesByIdentifier.delete(t.identifier),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(function(e){return t.disconnectContextForScope(e)})},fe);function fe(e){this.application=e,this.scopeObserver=new ue(this.element,this.schema,this),this.scopesByIdentifier=new E,this.modulesByIdentifier=new Map}var de={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target"},he=window&&window.__awaiter||function(e,s,a,c){return new(a=a||Promise)(function(n,t){function r(e){try{i(c.next(e))}catch(e){t(e)}}function o(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?n(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,o)}i((c=c.apply(e,s||[])).next())})},me=window&&window.__generator||function(n,r){var o,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"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(;a;)try{if(o=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=r.call(n,a)}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])}}},ye=window&&window.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},ge=(be.start=function(e,t){t=new be(e,t);return t.start(),t},be.prototype.start=function(){return he(this,void 0,void 0,function(){return me(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.dispatcher.start(),this.router.start(),[2]}})})},be.prototype.stop=function(){this.dispatcher.stop(),this.router.stop()},be.prototype.register=function(e,t){this.load({identifier:e,controllerConstructor:t})},be.prototype.load=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(Array.isArray(e)?e:ye([e],n)).forEach(function(e){return t.router.loadDefinition(e)})},be.prototype.unload=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(Array.isArray(e)?e:ye([e],n)).forEach(function(e){return t.router.unloadIdentifier(e)})},Object.defineProperty(be.prototype,"controllers",{get:function(){return this.router.contexts.map(function(e){return e.controller})},enumerable:!1,configurable:!0}),be.prototype.getControllerForElementAndIdentifier=function(e,t){t=this.router.getContextForElementAndIdentifier(e,t);return t?t.controller:null},be.prototype.handleError=function(e,t,n){this.logger.error("%s\n\n%o\n\n%o",t,e,n)},be);function be(e,t){void 0===e&&(e=document.documentElement),void 0===t&&(t=de),this.logger=console,this.element=e,this.schema=t,this.dispatcher=new n(this),this.router=new pe(this)}function ve(e){return N(e,"classes").reduce(function(e,t){return Object.assign(e,((e={})[t=(n=t)+"Class"]={get:function(){var e=this.classes;if(e.has(n))return e.get(n);e=e.getAttributeName(n);throw new Error('Missing attribute "'+e+'"')}},e["has"+Y(t)]={get:function(){return this.classes.has(n)}},e));var n},{})}function we(e){return N(e,"targets").reduce(function(e,t){return Object.assign(e,((e={})[(n=t)+"Target"]={get:function(){var e=this.targets.find(n);if(e)return e;throw new Error('Missing target element "'+this.identifier+"."+n+'"')}},e[n+"Targets"]={get:function(){return this.targets.findAll(n)}},e["has"+Y(n)+"Target"]={get:function(){return this.targets.has(n)}},e));var n},{})}function Oe(e){var t=I(e,"values"),e={valueDescriptorMap:{get:function(){var r=this;return t.reduce(function(e,t){var n=Ee(t),t=r.data.getAttributeNameForKey(n.key);return Object.assign(e,((e={})[t]=n,e))},{})}}};return t.reduce(function(e,t){return Object.assign(e,(n=Ee(e=t),t=n.type,r=n.key,e=n.name,o=xe[t],i=_e[t]||_e.default,(t={})[e]={get:function(){var e=this.data.get(r);return null!==e?o(e):n.defaultValue},set:function(e){void 0===e?this.data.delete(r):this.data.set(r,i(e))}},t["has"+Y(e)]={get:function(){return this.data.has(r)}},t));var n,r,o,i},e)}function Ee(e){return function(e,t){e=Z(e)+"-value";return{type:t,key:e,name:function(e){return e.replace(/(?:[_-])([a-z0-9])/g,function(e,t){return t.toUpperCase()})}(e),get defaultValue(){return Ae[t]}}}(e[0],function(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}throw new Error('Unknown value type constant "'+e+'"')}(e[1]))}var Ae={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},xe={array:function(e){e=JSON.parse(e);if(!Array.isArray(e))throw new TypeError("Expected array");return e},boolean:function(e){return!("0"==e||"false"==e)},number:function(e){return parseFloat(e)},object:function(e){e=JSON.parse(e);if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("Expected object");return e},string:function(e){return e}},_e={default:function(e){return""+e},array:ke,object:ke};function ke(e){return JSON.stringify(e)}var Te=(Object.defineProperty(Pe.prototype,"application",{get:function(){return this.context.application},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"scope",{get:function(){return this.context.scope},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"targets",{get:function(){return this.scope.targets},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"classes",{get:function(){return this.scope.classes},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"data",{get:function(){return this.scope.data},enumerable:!1,configurable:!0}),Pe.prototype.initialize=function(){},Pe.prototype.connect=function(){},Pe.prototype.disconnect=function(){},Pe.blessings=[ve,we,Oe],Pe.targets=[],Pe.values={},Pe);function Pe(e){this.context=e}e.Application=ge,e.Context=D,e.Controller=Te,e.defaultSchema=de,Object.defineProperty(e,"__esModule",{value:!0})}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,function(e){"use strict";function p(e){e=e.getBoundingClientRect();return{width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function y(e){if(null==e)return window;if("[object Window]"===e.toString())return e;e=e.ownerDocument;return e&&e.defaultView||window}function l(e){e=y(e);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function m(e){return e instanceof y(e).Element||e instanceof Element}function f(e){return e instanceof y(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof y(e).ShadowRoot||e instanceof ShadowRoot)}function a(e){return e?(e.nodeName||"").toLowerCase():null}function g(e){return((m(e)?e.ownerDocument:e.document)||window.document).documentElement}function d(e){return p(g(e)).left+l(e).scrollLeft}function b(e){return y(e).getComputedStyle(e)}function c(e){var t=b(e),n=t.overflow,e=t.overflowX,t=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+t+e)}function v(e,t,n){void 0===n&&(n=!1);var r=g(t),o=p(e),i=f(t),s={scrollLeft:0,scrollTop:0},e={x:0,y:0};return!i&&(i||n)||("body"===a(t)&&!c(r)||(s=(i=t)!==y(i)&&f(i)?{scrollLeft:(n=i).scrollLeft,scrollTop:n.scrollTop}:l(i)),f(t)?((e=p(t)).x+=t.clientLeft,e.y+=t.clientTop):r&&(e.x=d(r))),{x:o.left+s.scrollLeft-e.x,y:o.top+s.scrollTop-e.y,width:o.width,height:o.height}}function x(e){var t=p(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function s(e){return"html"===a(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||g(e)}function w(e,t){void 0===t&&(t=[]);var n=function e(t){return 0<=["html","body","#document"].indexOf(a(t))?t.ownerDocument.body:f(t)&&c(t)?t:e(s(t))}(e),e=n===(null==(r=e.ownerDocument)?void 0:r.body),r=y(n),n=e?[r].concat(r.visualViewport||[],c(n)?n:[]):n,t=t.concat(n);return e?t:t.concat(w(s(n)))}function r(e){return f(e)&&"fixed"!==b(e).position?e.offsetParent:null}function _(e){for(var t=y(e),n=r(e);n&&0<=["table","td","th"].indexOf(a(n))&&"static"===b(n).position;)n=r(n);return(!n||"html"!==a(n)&&("body"!==a(n)||"static"!==b(n).position))&&(n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),n=-1!==navigator.userAgent.indexOf("Trident");if(n&&f(e)&&"fixed"===b(e).position)return null;for(var r=s(e);f(r)&&["html","body"].indexOf(a(r))<0;){var o=b(r);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return r;r=r.parentNode}return null}(e))||t}var T="top",P="bottom",S="right",j="left",C="auto",L=[T,P,S,j],M="start",u="end",h="clippingParents",O="viewport",E="popper",A="reference",B=L.reduce(function(e,t){return e.concat([t+"-"+M,t+"-"+u])},[]),D=[].concat(L,[C]).reduce(function(e,t){return e.concat([t,t+"-"+M,t+"-"+u])},[]),k=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function F(e){var n=new Map,r=new Set,o=[];return e.forEach(function(e){n.set(e.name,e)}),e.forEach(function(e){r.has(e.name)||!function t(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){r.has(e)||(e=n.get(e))&&t(e)}),o.push(e)}(e)}),o}function N(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return[].concat(n).reduce(function(e,t){return e.replace(/%s/,t)},e)}var I='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',V='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',K=["name","enabled","phase","fn","effect","requires","options"];function H(e){return e.split("-")[0]}var R=Math.max,U=Math.min,q=Math.round;function W(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0}while(r=r.parentNode||r.host)}return!1}function z(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function G(e,t){return t===O?z((i=y(o=e),s=g(o),a=i.visualViewport,c=s.clientWidth,u=s.clientHeight,s=i=0,a&&(c=a.width,u=a.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(i=a.offsetLeft,s=a.offsetTop)),{width:c,height:u,x:i+d(o),y:s})):f(t)?((r=p(n=t)).top=r.top+n.clientTop,r.left=r.left+n.clientLeft,r.bottom=r.top+n.clientHeight,r.right=r.left+n.clientWidth,r.width=n.clientWidth,r.height=n.clientHeight,r.x=r.left,r.y=r.top,r):z((o=g(e),s=g(o),t=l(o),r=null==(n=o.ownerDocument)?void 0:n.body,e=R(s.scrollWidth,s.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),n=R(s.scrollHeight,s.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-t.scrollLeft+d(o),t=-t.scrollTop,"rtl"===b(r||s).direction&&(o+=R(s.clientWidth,r?r.clientWidth:0)-e),{width:e,height:n,x:o,y:t}));var n,r,o,i,s,a,c,u}function J(n,e,t){var r,o,i,e="clippingParents"===e?(o=w(s(r=n)),m(i=0<=["absolute","fixed"].indexOf(b(r).position)&&f(r)?_(r):r)?o.filter(function(e){return m(e)&&W(e,i)&&"body"!==a(e)}):[]):[].concat(e),e=[].concat(e,[t]),t=e[0],t=e.reduce(function(e,t){t=G(n,t);return e.top=R(t.top,e.top),e.right=U(t.right,e.right),e.bottom=U(t.bottom,e.bottom),e.left=R(t.left,e.left),e},G(n,t));return t.width=t.right-t.left,t.height=t.bottom-t.top,t.x=t.left,t.y=t.top,t}function X(e){return e.split("-")[1]}function Y(e){return 0<=["top","bottom"].indexOf(e)?"x":"y"}function Z(e){var t,n=e.reference,r=e.element,o=e.placement,e=o?H(o):null,o=o?X(o):null,i=n.x+n.width/2-r.width/2,s=n.y+n.height/2-r.height/2;switch(e){case T:t={x:i,y:n.y-r.height};break;case P:t={x:i,y:n.y+n.height};break;case S:t={x:n.x+n.width,y:s};break;case j:t={x:n.x-r.width,y:s};break;default:t={x:n.x,y:n.y}}var a=e?Y(e):null;if(null!=a){var c="y"===a?"height":"width";switch(o){case M:t[a]=t[a]-(n[c]/2-r[c]/2);break;case u:t[a]=t[a]+(n[c]/2-r[c]/2)}}return t}function $(){return{top:0,right:0,bottom:0,left:0}}function Q(e){return Object.assign({},$(),e)}function ee(n,e){return e.reduce(function(e,t){return e[t]=n,e},{})}function te(e,t){var r,n=(t=void 0===t?{}:t).placement,o=void 0===n?e.placement:n,i=t.boundary,s=void 0===i?h:i,a=t.rootBoundary,c=void 0===a?O:a,u=t.elementContext,n=void 0===u?E:u,i=t.altBoundary,a=void 0!==i&&i,u=t.padding,i=void 0===u?0:u,t=Q("number"!=typeof i?i:ee(i,L)),u=e.elements.reference,i=e.rects.popper,a=e.elements[a?n===E?A:E:n],s=J(m(a)?a:a.contextElement||g(e.elements.popper),s,c),c=p(u),u=Z({reference:c,element:i,strategy:"absolute",placement:o}),u=z(Object.assign({},i,u)),c=n===E?u:c,l={top:s.top-c.top+t.top,bottom:c.bottom-s.bottom+t.bottom,left:s.left-c.left+t.left,right:c.right-s.right+t.right},e=e.modifiersData.offset;return n===E&&e&&(r=e[o],Object.keys(l).forEach(function(e){var t=0<=[S,P].indexOf(e)?1:-1,n=0<=[T,P].indexOf(e)?"y":"x";l[e]+=r[n]*t})),l}var ne="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",i={placement:"bottom",modifiers:[],strategy:"absolute"};function re(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function t(e){var t=(e=void 0===e?{}:e).defaultModifiers,d=void 0===t?[]:t,e=e.defaultOptions,h=void 0===e?i:e;return function(s,a,t){void 0===t&&(t=h);var n,r,c={placement:"bottom",orderedModifiers:[],options:Object.assign({},i,h),modifiersData:{},elements:{reference:s,popper:a},attributes:{},styles:{}},u=[],l=!1,p={state:c,setOptions:function(e){f(),c.options=Object.assign({},h,c.options,e),c.scrollParents={reference:m(s)?w(s):s.contextElement?w(s.contextElement):[],popper:w(a)};var n,t,e=(e=[].concat(d,c.options.modifiers),t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{}),e=Object.keys(t).map(function(e){return t[e]}),n=F(e),k.reduce(function(e,t){return e.concat(n.filter(function(e){return e.phase===t}))},[]));c.orderedModifiers=e.filter(function(e){return e.enabled});e=[].concat(e,c.options.modifiers),o=function(e){return e.name},i=new Set,e=e.filter(function(e){e=o(e);if(!i.has(e))return i.add(e),!0});(r=e).forEach(function(n){Object.keys(n).forEach(function(e){switch(e){case"name":"string"!=typeof n.name&&console.error(N(I,String(n.name),'"name"','"string"','"'+String(n.name)+'"'));break;case"enabled":"boolean"!=typeof n.enabled&&console.error(N(I,n.name,'"enabled"','"boolean"','"'+String(n.enabled)+'"'));case"phase":k.indexOf(n.phase)<0&&console.error(N(I,n.name,'"phase"',"either "+k.join(", "),'"'+String(n.phase)+'"'));break;case"fn":"function"!=typeof n.fn&&console.error(N(I,n.name,'"fn"','"function"','"'+String(n.fn)+'"'));break;case"effect":"function"!=typeof n.effect&&console.error(N(I,n.name,'"effect"','"function"','"'+String(n.fn)+'"'));break;case"requires":Array.isArray(n.requires)||console.error(N(I,n.name,'"requires"','"array"','"'+String(n.requires)+'"'));break;case"requiresIfExists":Array.isArray(n.requiresIfExists)||console.error(N(I,n.name,'"requiresIfExists"','"array"','"'+String(n.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+n.name+'" modifier, valid properties are '+K.map(function(e){return'"'+e+'"'}).join(", ")+'; but "'+e+'" was provided.')}n.requires&&n.requires.forEach(function(t){null==r.find(function(e){return e.name===t})&&console.error(N(V,String(n.name),t,t))})})}),H(c.options.placement)===C&&(c.orderedModifiers.find(function(e){return"flip"===e.name})||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" ")));var r,o,i,e=b(a);return[e.marginTop,e.marginRight,e.marginBottom,e.marginLeft].some(function(e){return parseFloat(e)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" ")),c.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,e=e.effect;"function"==typeof e&&(n=e({state:c,name:t,instance:p,options:void 0===n?{}:n}),u.push(n||function(){}))}),p.update()},forceUpdate:function(){if(!l){var e=c.elements,t=e.reference,e=e.popper;if(re(t,e)){c.rects={reference:v(t,_(e),"fixed"===c.options.strategy),popper:x(e)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(e){return c.modifiersData[e.name]=Object.assign({},e.data)});for(var n,r,o,i=0,s=0;s<c.orderedModifiers.length;s++){if(100<(i+=1)){console.error("Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.");break}!0!==c.reset?(n=(o=c.orderedModifiers[s]).fn,r=o.options,o=o.name,"function"==typeof n&&(c=n({state:c,options:void 0===r?{}:r,name:o,instance:p})||c)):(c.reset=!1,s=-1)}}else console.error(ne)}},update:(n=function(){return new Promise(function(e){p.forceUpdate(),e(c)})},function(){return r=r||new Promise(function(e){Promise.resolve().then(function(){r=void 0,e(n())})})}),destroy:function(){f(),l=!0}};return re(s,a)?p.setOptions(t).then(function(e){!l&&t.onFirstUpdate&&t.onFirstUpdate(e)}):console.error(ne),p;function f(){u.forEach(function(e){return e()}),u=[]}}}var oe={passive:!0};var n={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=void 0===(e=r.scroll)||e,i=void 0===(r=r.resize)||r,s=y(t.elements.popper),a=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&a.forEach(function(e){e.addEventListener("scroll",n.update,oe)}),i&&s.addEventListener("resize",n.update,oe),function(){o&&a.forEach(function(e){e.removeEventListener("scroll",n.update,oe)}),i&&s.removeEventListener("resize",n.update,oe)}},data:{}};var ie={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,e=e.name;t.modifiersData[e]=Z({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ae(e){var t=e.popper,n=e.popperRect,r=e.placement,o=e.offsets,i=e.position,s=e.gpuAcceleration,a=e.adaptive,c=e.roundOffsets,u=!0===c?(d=(m=o).x,h=m.y,m=window.devicePixelRatio||1,{x:q(q(d*m)/m)||0,y:q(q(h*m)/m)||0}):"function"==typeof c?c(o):o,l=u.x,p=void 0===l?0:l,f=u.y,e=void 0===f?0:f,d=o.hasOwnProperty("x"),h=o.hasOwnProperty("y"),m=j,c=T,l=window;a&&(u="clientHeight",f="clientWidth",(o=_(t))===y(t)&&"static"!==b(o=g(t)).position&&(u="scrollHeight",f="scrollWidth"),r===T&&(c=P,e-=o[u]-n.height,e*=s?1:-1),r===j&&(m=S,p-=o[f]-n.width,p*=s?1:-1));var a=Object.assign({position:i},a&&se);return s?Object.assign({},a,((s={})[c]=h?"0":"",s[m]=d?"0":"",s.transform=(l.devicePixelRatio||1)<2?"translate("+p+"px, "+e+"px)":"translate3d("+p+"px, "+e+"px, 0)",s)):Object.assign({},a,((a={})[c]=h?e+"px":"",a[m]=d?p+"px":"",a.transform="",a))}var ce={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,e=void 0===(r=n.gpuAcceleration)||r,r=void 0===(r=n.adaptive)||r,n=void 0===(n=n.roundOffsets)||n,o=b(t.elements.popper).transitionProperty||"";r&&["transform","top","right","bottom","left"].some(function(e){return 0<=o.indexOf(e)})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',"\n\n",'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.","\n\n","We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" ")),e={placement:H(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:e},null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ae(Object.assign({},e,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:n})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ae(Object.assign({},e,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:n})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var ue={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var o=e.state;Object.keys(o.elements).forEach(function(e){var t=o.styles[e]||{},n=o.attributes[e]||{},r=o.elements[e];f(r)&&a(r)&&(Object.assign(r.style,t),Object.keys(n).forEach(function(e){var t=n[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var r=e.state,o={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(r.elements.popper.style,o.popper),r.styles=o,r.elements.arrow&&Object.assign(r.elements.arrow.style,o.arrow),function(){Object.keys(r.elements).forEach(function(e){var t=r.elements[e],n=r.attributes[e]||{},e=Object.keys((r.styles.hasOwnProperty(e)?r.styles:o)[e]).reduce(function(e,t){return e[t]="",e},{});f(t)&&a(t)&&(Object.assign(t.style,e),Object.keys(n).forEach(function(e){t.removeAttribute(e)}))})}},requires:["computeStyles"]};var le={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var s=e.state,t=e.options,n=e.name,a=void 0===(r=t.offset)?[0,0]:r,e=D.reduce(function(e,t){var n,r,o,i;return e[t]=(n=t,r=s.rects,o=a,i=H(n),t=0<=[j,T].indexOf(i)?-1:1,o=(o=(n="function"==typeof o?o(Object.assign({},r,{placement:n})):o)[0])||0,n=((n=n[1])||0)*t,0<=[j,S].indexOf(i)?{x:n,y:o}:{x:o,y:n}),e},{}),r=(t=e[s.placement]).x,t=t.y;null!=s.modifiersData.popperOffsets&&(s.modifiersData.popperOffsets.x+=r,s.modifiersData.popperOffsets.y+=t),s.modifiersData[n]=e}},pe={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,function(e){return pe[e]})}var de={start:"end",end:"start"};function he(e){return e.replace(/start|end/g,function(e){return de[e]})}var me={name:"flip",enabled:!0,phase:"main",fn:function(e){var n=e.state,t=e.options,r=e.name;if(!n.modifiersData[r]._skip){for(var o=t.mainAxis,i=void 0===o||o,e=t.altAxis,s=void 0===e||e,o=t.fallbackPlacements,a=t.padding,c=t.boundary,u=t.rootBoundary,l=t.altBoundary,e=t.flipVariations,p=void 0===e||e,f=t.allowedAutoPlacements,e=n.options.placement,t=H(e),t=o||(t===e||!p?[fe(e)]:function(e){if(H(e)===C)return[];var t=fe(e);return[he(e),t,he(t)]}(e)),d=[e].concat(t).reduce(function(e,t){return e.concat(H(t)===C?function(n,e){var t=(e=void 0===e?{}:e).placement,r=e.boundary,o=e.rootBoundary,i=e.padding,s=e.flipVariations,a=void 0===(e=e.allowedAutoPlacements)?D:e,c=X(t),t=c?s?B:B.filter(function(e){return X(e)===c}):L;0===(s=t.filter(function(e){return 0<=a.indexOf(e)})).length&&(s=t,console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var u=s.reduce(function(e,t){return e[t]=te(n,{placement:t,boundary:r,rootBoundary:o,padding:i})[H(t)],e},{});return Object.keys(u).sort(function(e,t){return u[e]-u[t]})}(n,{placement:t,boundary:c,rootBoundary:u,padding:a,flipVariations:p,allowedAutoPlacements:f}):t)},[]),h=n.rects.reference,m=n.rects.popper,y=new Map,g=!0,b=d[0],v=0;v<d.length;v++){var w=d[v],O=H(w),E=X(w)===M,A=0<=[T,P].indexOf(O),x=A?"width":"height",_=te(n,{placement:w,boundary:c,rootBoundary:u,altBoundary:l,padding:a}),A=A?E?S:j:E?P:T;h[x]>m[x]&&(A=fe(A));E=fe(A),x=[];if(i&&x.push(_[O]<=0),s&&x.push(_[A]<=0,_[E]<=0),x.every(function(e){return e})){b=w,g=!1;break}y.set(w,x)}if(g)for(var k=p?3:1;0<k;k--)if("break"===function(t){var e=d.find(function(e){e=y.get(e);if(e)return e.slice(0,t).every(function(e){return e})});if(e)return b=e,"break"}(k))break;n.placement!==b&&(n.modifiersData[r]._skip=!0,n.placement=b,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ye(e,t,n){return R(e,U(t,n))}var ge={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=void 0===(E=n.mainAxis)||E,i=void 0!==(A=n.altAxis)&&A,s=n.boundary,a=n.rootBoundary,c=n.altBoundary,u=n.padding,l=n.tether,p=void 0===l||l,f=n.tetherOffset,d=void 0===f?0:f,h=te(t,{boundary:s,rootBoundary:a,padding:u,altBoundary:c}),m=H(t.placement),y=X(t.placement),g=!y,b=Y(m),v="x"===b?"y":"x",w=t.modifiersData.popperOffsets,O=t.rects.reference,e=t.rects.popper,E="function"==typeof d?d(Object.assign({},t.rects,{placement:t.placement})):d,A={x:0,y:0};w&&((o||i)&&(l="y"===b?"height":"width",n=w[b],s=w[b]+h[f="y"===b?T:j],u=w[b]-h[a="y"===b?P:S],c=p?-e[l]/2:0,m=(y===M?O:e)[l],d=y===M?-e[l]:-O[l],y=t.elements.arrow,e=p&&y?x(y):{width:0,height:0},f=(y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:$())[f],a=y[a],e=ye(0,O[l],e[l]),f=g?O[l]/2-c-e-f-E:m-e-f-E,e=g?-O[l]/2+c+e+a+E:d+e+a+E,E=(a=t.elements.arrow&&_(t.elements.arrow))?"y"===b?a.clientTop||0:a.clientLeft||0:0,a=t.modifiersData.offset?t.modifiersData.offset[t.placement][b]:0,E=w[b]+f-a-E,a=w[b]+e-a,o&&(u=ye(p?U(s,E):s,n,p?R(u,a):u),w[b]=u,A[b]=u-n),i&&(i=(n=w[v])+h["x"===b?T:j],b=n-h["x"===b?P:S],b=ye(p?U(i,E):i,n,p?R(b,a):b),w[v]=b,A[v]=b-n)),t.modifiersData[r]=A)},requiresIfExists:["offset"]};var be={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n,r=e.state,o=e.name,i=e.options,s=r.elements.arrow,a=r.modifiersData.popperOffsets,c=H(r.placement),u=Y(c),l=0<=[j,S].indexOf(c)?"height":"width";s&&a&&(t=i.padding,n=r,e=Q("number"!=typeof(t="function"==typeof t?t(Object.assign({},n.rects,{placement:n.placement})):t)?t:ee(t,L)),c=x(s),i="y"===u?T:j,n="y"===u?P:S,t=r.rects.reference[l]+r.rects.reference[u]-a[u]-r.rects.popper[l],a=a[u]-r.rects.reference[u],s=(s=_(s))?"y"===u?s.clientHeight||0:s.clientWidth||0:0,i=e[i],n=s-c[l]-e[n],n=ye(i,a=s/2-c[l]/2+(t/2-a/2),n),r.modifiersData[o]=((o={})[u]=n,o.centerOffset=n-a,o))},effect:function(e){var t=e.state;null!=(e=void 0===(e=e.options.element)?"[data-popper-arrow]":e)&&("string"==typeof e&&!(e=t.elements.popper.querySelector(e))||(f(e)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" ")),W(t.elements.popper,e)?t.elements.arrow=e:console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "))))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ve(e,t,n){return{top:e.top-t.height-(n=void 0===n?{x:0,y:0}:n).y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function we(t){return[T,S,P,j].some(function(e){return 0<=t[e]})}var Oe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=te(t,{elementContext:"reference"}),e=te(t,{altBoundary:!0}),r=ve(s,r),e=ve(e,o,i),o=we(r),i=we(e);t.modifiersData[n]={referenceClippingOffsets:r,popperEscapeOffsets:e,isReferenceHidden:o,hasPopperEscaped:i},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":o,"data-popper-escaped":i})}},Ee=t({defaultModifiers:[n,ie,ce,ue]}),Ae=[n,ie,ce,ue,le,me,ge,be,Oe],xe=t({defaultModifiers:Ae});e.applyStyles=ue,e.arrow=be,e.computeStyles=ce,e.createPopper=xe,e.createPopperLite=Ee,e.defaultModifiers=Ae,e.detectOverflow=te,e.eventListeners=n,e.flip=me,e.hide=Oe,e.offset=le,e.popperGenerator=t,e.popperOffsets=ie,e.preventOverflow=ge,Object.defineProperty(e,"__esModule",{value:!0})});var __extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),__spreadArray=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e};!function(a){var c,e=(c=Stimulus.Application,__extends(n,c),n.prototype.load=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=Array.isArray(e)?e:__spreadArray([e],t),o=0,i=r;o<i.length;o++){var s=i[o],s=/^s-/.test(s.identifier);if(a._initializing&&!s)throw'Stacks-created Stimulus controller names must start with "s-".';if(!a._initializing&&s)throw'The "s-" prefix on Stimulus controller names is reserved for Stacks-created controllers.'}c.prototype.load.call(this,r)},n.start=function(e,t){t=new n(e,t);return t.start(),t},n);function n(){return null!==c&&c.apply(this,arguments)||this}a.application=e.start(),a._initializing=!0;var t,u=(t=Stimulus.Controller,__extends(r,t),r.prototype.getElementData=function(e,t){return e.getAttribute("data-"+this.identifier+"-"+t)},r.prototype.setElementData=function(e,t,n){e.setAttribute("data-"+this.identifier+"-"+t,n)},r.prototype.removeElementData=function(e,t){e.removeAttribute("data-"+this.identifier+"-"+t)},r.prototype.triggerEvent=function(t,n,e){var r,t=this.identifier+":"+t;try{r=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n})}catch(e){(r=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n)}return(e||this.element).dispatchEvent(r),r},r);function r(){return null!==t&&t.apply(this,arguments)||this}function o(e){var t,n,r,o,i=e.hasOwnProperty("targets")?(__extends(a,r=u),(t=a).targets=e.targets,t):(__extends(s,n=u),s);function s(){return null!==n&&n.apply(this,arguments)||this}function a(){return null!==r&&r.apply(this,arguments)||this}for(o in e)"targets"!==o&&e.hasOwnProperty(o)&&Object.defineProperty(i.prototype,o,Object.getOwnPropertyDescriptor(e,o));return i}a.StacksController=u,a.createController=o,a.addController=function(e,t){a.application.register(e,o(t))}}(Stacks=Stacks||{});__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();!function(e){var t,n=(t=e.StacksController,__extends(r,t),r.prototype.copy=function(){this.sourceTarget.select(),document.execCommand("copy")},r.targets=["source"],r);function r(){return null!==t&&t.apply(this,arguments)||this}e.CopyController=n}(Stacks=Stacks||{}),Stacks.application.register("s-copy",Stacks.CopyController);__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();!function(){var r="s-expandable-control:radio-off";function t(n){var e=n.target;e instanceof HTMLInputElement&&"INPUT"===e.nodeName&&"radio"===e.type&&document.querySelectorAll('input[type="radio"][name="'+e.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,o=0;function i(e){e?1===++o&&document.body.addEventListener("change",t):0===--o&&document.body.removeEventListener("change",t)}function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.lastKeydownClickTimestamp=0,e}Stacks.application.register("s-expandable-control",(n=Stacks.StacksController,__extends(e,n),e.prototype.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)},e.prototype._isCollapsedForClickable=function(){var e=this.controlledCollapsibles;return 0<e.length?!e.every(function(e){return e.classList.contains("is-expanded")}):"false"===this.element.getAttribute("aria-expanded")},e.prototype._isCollapsedForCheckable=function(){return!this.element.checked},Object.defineProperty(e.prototype,"controlledCollapsibles",{get:function(){var e=this.element.getAttribute("aria-controls");if(!e)throw'[aria-controls="targetId1 ... targetIdN"] attribute required';e=e.split(/\s+/g).map(function(e){return document.getElementById(e)}).filter(function(e){return!!e});if(!e.length)throw"couldn't find controls";return e},enumerable:!1,configurable:!0}),e.prototype._dispatchShowHideEvent=function(e){this.triggerEvent(e?"show":"hide")},e.prototype._toggleClass=function(t){if(this.data.has("toggle-class")){var n=this.element.classList,e=this.data.get("toggle-class");if(!e)throw"couldn't find toggle class";e.split(/\s+/).forEach(function(e){n.toggle(e,!!t)})}},e.prototype.listener=function(e){var t;if(this.isCheckable)t=!this.element.checked;else{if("keydown"==e.type&&e instanceof KeyboardEvent&&13!=e.keyCode&&32!=e.keyCode)return;if(e.target!==e.currentTarget&&0<=["A","BUTTON"].indexOf(e.target.nodeName))return;if(e.preventDefault(),"keydown"==e.type)this.lastKeydownClickTimestamp=Date.now();else if("click"==e.type&&Date.now()-this.lastKeydownClickTimestamp<300)return;t="true"===this.element.getAttribute("aria-expanded"),"click"===e.type&&this.element.blur()}this.element.setAttribute("aria-expanded",t?"false":"true");for(var n=0,r=this.controlledCollapsibles;n<r.length;n++)r[n].classList.toggle("is-expanded",!t);this._dispatchShowHideEvent(!t),this._toggleClass(!t)},e.prototype.connect=function(){var t=this;if(this.events.forEach(function(e){t.element.addEventListener(e,t.listener)},this),this.isRadio&&i(!0),this.element.setAttribute("aria-expanded",this.isCollapsed()?"false":"true"),this.isCheckable){var e=this.controlledCollapsibles;if(e.length){var n=!this.isCollapsed();if(e.some(function(e){return e.classList.contains("is-expanded")!==n})){for(var r=0,o=this.controlledCollapsibles;r<o.length;r++)o[r].classList.toggle("is-expanded",n);this._dispatchShowHideEvent(n),this._toggleClass(n)}}}},e.prototype.disconnect=function(){var t=this;this.events.forEach(function(e){t.element.removeEventListener(e,t.listener)},this),this.isRadio&&i(!1)},e))}();__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),__spreadArray=this&&this.__spreadArray||function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e};!function(n){var e,t=(e=n.StacksController,__extends(r,e),r.prototype.connect=function(){this.validate()},r.prototype.disconnect=function(){this.unbindDocumentEvents()},r.prototype.toggle=function(e){this._toggle(void 0,e=void 0===e?null:e)},r.prototype.show=function(e){this._toggle(!0,e=void 0===e?null:e)},r.prototype.hide=function(e){this._toggle(!1,e=void 0===e?null:e)},r.prototype.validate=function(){var e=this.data.get("return-element");if(e&&(this.returnElement=document.querySelector(e),!this.returnElement))throw"Unable to find element by return-element selector: "+e},r.prototype._toggle=function(e,t){var n=this;void 0===t&&(t=null);var r,o=e,e="false"===this.modalTarget.getAttribute("aria-hidden");(o=void 0===o?!e:o)&&e||!o&&!e||(r=this.getDispatcher(t),(t=this.triggerEvent(o?"show":"hide",{returnElement:this.returnElement,dispatcher:this.getDispatcher(r)},this.modalTarget)).defaultPrevented||(this.returnElement=t.detail.returnElement,this.modalTarget.setAttribute("aria-hidden",o?"false":"true"),o?(this.bindDocumentEvents(),this.focusInsideModal()):(this.unbindDocumentEvents(),this.focusReturnElement(),this.removeModalOnHide()),void 0!==this.modalTarget.ontransitionend?this.modalTarget.addEventListener("transitionend",function(){n.triggerEvent(o?"shown":"hidden",{dispatcher:r},n.modalTarget)},{once:!0}):this.triggerEvent(o?"shown":"hidden",{dispatcher:r},this.modalTarget)))},r.prototype.focusReturnElement=function(){var e=this;this.returnElement&&this.modalTarget.addEventListener("s-modal:hidden",function(){e.returnElement&&document.body.contains(e.returnElement)&&e.returnElement.focus()},{once:!0})},r.prototype.removeModalOnHide=function(){var e=this;"true"===this.data.get("remove-when-hidden")&&this.modalTarget.addEventListener("s-modal:hidden",function(){e.element.remove()},{once:!0})},r.prototype.getAllTabbables=function(){return Array.from(this.modalTarget.querySelectorAll("[href], input, select, textarea, button, [tabindex]")).filter(function(e){return e.matches(":not([disabled]):not([tabindex='-1'])")})},r.prototype.firstVisible=function(e){return e.find(function(e){return null!==e.offsetParent})},r.prototype.lastVisible=function(e){return this.firstVisible(__spreadArray([],e).reverse())},r.prototype.focusInsideModal=function(){var t=this;this.modalTarget.addEventListener("s-modal:shown",function(){var e=null!==(e=t.firstVisible(t.initialFocusTargets))&&void 0!==e?e:t.firstVisible(t.getAllTabbables());null!=e&&e.focus()},{once:!0})},r.prototype.keepFocusWithinModal=function(e){var t,n;this.modalTarget.contains(e.target)?"Tab"===e.key&&(t=this.getAllTabbables(),n=this.firstVisible(t),t=this.lastVisible(t),n&&t&&(n===t?(e.preventDefault(),n.focus()):e.shiftKey&&e.target===n?(e.preventDefault(),t.focus()):e.shiftKey||e.target!==t||(e.preventDefault(),n.focus()))):(n=this.firstVisible(this.getAllTabbables()))&&(e.preventDefault(),n.focus())},r.prototype.bindDocumentEvents=function(){this._boundClickFn=this._boundClickFn||this.hideOnOutsideClick.bind(this),this._boundKeypressFn=this._boundKeypressFn||this.hideOnEscapePress.bind(this),this._boundTabTrap=this._boundTabTrap||this.keepFocusWithinModal.bind(this),document.addEventListener("mousedown",this._boundClickFn),document.addEventListener("keyup",this._boundKeypressFn),document.addEventListener("keydown",this._boundTabTrap)},r.prototype.unbindDocumentEvents=function(){document.removeEventListener("mousedown",this._boundClickFn),document.removeEventListener("keyup",this._boundKeypressFn),document.removeEventListener("keydown",this._boundTabTrap)},r.prototype.hideOnOutsideClick=function(e){var t=e.target;!this.modalTarget.querySelector(".s-modal--dialog").contains(t)&&document.body.contains(t)&&this._toggle(!1,e)},r.prototype.hideOnEscapePress=function(e){27===e.which&&"true"!==this.modalTarget.getAttribute("aria-hidden")&&this._toggle(!1,e)},r.prototype.getDispatcher=function(e){return(e=void 0===e?null:e)instanceof Event?e.target:e instanceof Element?e:this.element},r.targets=["modal","initialFocus"],r);function r(){return null!==e&&e.apply(this,arguments)||this}function o(e,t){e=n.application.getControllerForElementAndIdentifier(e,"s-modal");if(!e)throw"Unable to get s-modal controller from element";t?e.show():e.hide()}n.ModalController=t,n.showModal=function(e){o(e,!0)},n.hideModal=function(e){o(e,!1)}}(Stacks=Stacks||{}),Stacks.application.register("s-modal",Stacks.ModalController);__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();!function(e){var r,t=(r=e.StacksController,__extends(n,r),n.prototype.connect=function(){r.prototype.connect.call(this),this.boundSelectTab=this.selectTab.bind(this),this.boundHandleKeydown=this.handleKeydown.bind(this);for(var e=0,t=this.tabTargets;e<t.length;e++){var n=t[e];n.addEventListener("click",this.boundSelectTab),n.addEventListener("keydown",this.boundHandleKeydown)}},n.prototype.disconnect=function(){r.prototype.disconnect.call(this);for(var e=0,t=this.tabTargets;e<t.length;e++){var n=t[e];n.removeEventListener("click",this.boundSelectTab),n.removeEventListener("keydown",this.boundHandleKeydown)}},Object.defineProperty(n.prototype,"tabTargets",{get:function(){return Array.from(this.element.querySelectorAll("[role=tab]"))},enumerable:!1,configurable:!0}),n.prototype.selectTab=function(e){this.switchToTab(e.currentTarget)},n.prototype.handleKeydown=function(e){var t=e.currentTarget,n=this.tabTargets,r=n.indexOf(t);if("ArrowRight"===e.key)r++;else{if("ArrowLeft"!==e.key)return;r--}t=n[r=(r=r<0?n.length-1:r)>=n.length?0:r],this.switchToTab(t),null!==(t=this.selectedTab)&&void 0!==t&&t.focus()},n.prototype.switchToTab=function(e){var t=this.selectedTab;t!==e&&(this.triggerEvent("select",{oldTab:t,newTab:e}).defaultPrevented||(this.selectedTab=e,this.triggerEvent("selected",{oldTab:t,newTab:e})))},Object.defineProperty(n.prototype,"selectedTab",{get:function(){return this.tabTargets.find(function(e){return"true"===e.getAttribute("aria-selected")})||null},set:function(e){for(var t=0,n=this.tabTargets;t<n.length;t++){var r=n[t],o=r.getAttribute("aria-controls"),o=o?document.getElementById(o):null;r===e?(r.classList.add("is-selected"),r.setAttribute("aria-selected","true"),r.removeAttribute("tabindex"),null!=o&&o.classList.remove("d-none")):(r.classList.remove("is-selected"),r.setAttribute("aria-selected","false"),r.setAttribute("tabindex","-1"),null!=o&&o.classList.add("d-none"))}},enumerable:!1,configurable:!0}),n);function n(){return null!==r&&r.apply(this,arguments)||this}e.TabListController=t}(Stacks=Stacks||{}),Stacks.application.register("s-navigation-tablist",Stacks.TabListController);__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();!function(o){var e,t=(e=o.StacksController,__extends(n,e),Object.defineProperty(n.prototype,"isVisible",{get:function(){var e=this.popoverElement;return!!e&&e.classList.contains("is-visible")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isInViewport",{get:function(){var e=this.popoverElement;if(!this.isVisible||!e)return!1;var t=e.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight),e=Math.max(document.documentElement.clientWidth,window.innerWidth);return 0<t.bottom&&t.top<n&&0<t.right&&t.left<e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shouldHideOnOutsideClick",{get:function(){switch(this.data.get("hide-on-outside-click")){case"after-dismissal":case"never":return!1;case"if-in-viewport":return this.isInViewport;default:return!0}},enumerable:!1,configurable:!0}),n.prototype.connect=function(){e.prototype.connect.call(this),this.validate(),this.isVisible?this.initializePopper():"true"===this.data.get("auto-show")&&this.show(null),this.data.delete("auto-show")},n.prototype.disconnect=function(){this.hide(),this.popper&&(this.popper.destroy(),delete this.popper),e.prototype.disconnect.call(this)},n.prototype.toggle=function(e){void 0===e&&(e=null),this.isVisible?this.hide(e):this.show(e)},n.prototype.show=function(e){void 0===e&&(e=null),this.isVisible||(e=this.getDispatcher(e),this.triggerEvent("show",{dispatcher:e}).defaultPrevented||(this.popper||this.initializePopper(),this.popoverElement.classList.add("is-visible"),this.scheduleUpdate(),this.shown(e)))},n.prototype.hide=function(e){void 0===e&&(e=null),this.isVisible&&(e=this.getDispatcher(e),this.triggerEvent("hide",{dispatcher:e}).defaultPrevented||(this.popoverElement.classList.remove("is-visible"),this.popper&&(this.popper.destroy(),delete this.popper),"after-dismissal"===this.data.get("hide-on-outside-click")&&this.data.delete("hide-on-outside-click"),this.hidden(e)))},n.prototype.shown=function(e){void 0===e&&(e=null),this.bindDocumentEvents(),this.triggerEvent("shown",{dispatcher:e})},n.prototype.hidden=function(e){void 0===e&&(e=null),this.unbindDocumentEvents(),this.triggerEvent("hidden",{dispatcher:e})},n.prototype.generatePopover=function(){return null},n.prototype.initializePopper=function(){this.popper=Popper.createPopper(this.referenceElement,this.popoverElement,{placement:this.data.get("placement")||"bottom",modifiers:[{name:"offset",options:{offset:[0,10]}},{name:"arrow",options:{element:".s-popover--arrow"}}]})},n.prototype.validate=function(){var e=this.data.get("reference-selector");if(this.referenceElement=this.element,e&&(this.referenceElement=this.element.querySelector(e),!this.referenceElement))throw"Unable to find element by reference selector: "+e;var t=this.referenceElement.getAttribute(this.popoverSelectorAttribute),e=null;if(t){if(!(e=document.getElementById(t)))throw"["+this.popoverSelectorAttribute+'="{POPOVER_ID}"] required'}else e=this.generatePopover();if(!e)throw"unable to find or generate popover element";this.popoverElement=e},n.prototype.getDispatcher=function(e){return(e=void 0===e?null:e)instanceof Event?e.target:e instanceof Element?e:this.element},n.prototype.scheduleUpdate=function(){this.popper&&this.isVisible&&this.popper.update()},n);function n(){return null!==e&&e.apply(this,arguments)||this}o.BasePopoverController=t;var r,t=(__extends(i,r=t),i.prototype.shown=function(e){void 0===e&&(e=null),this.toggleOptionalClasses(!0),r.prototype.shown.call(this,e)},i.prototype.hidden=function(e){void 0===e&&(e=null),this.toggleOptionalClasses(!1),r.prototype.hidden.call(this,e)},i.prototype.bindDocumentEvents=function(){this.boundHideOnOutsideClick=this.boundHideOnOutsideClick||this.hideOnOutsideClick.bind(this),this.boundHideOnEscapePress=this.boundHideOnEscapePress||this.hideOnEscapePress.bind(this),document.addEventListener("mousedown",this.boundHideOnOutsideClick),document.addEventListener("keyup",this.boundHideOnEscapePress)},i.prototype.unbindDocumentEvents=function(){document.removeEventListener("mousedown",this.boundHideOnOutsideClick),document.removeEventListener("keyup",this.boundHideOnEscapePress)},i.prototype.hideOnOutsideClick=function(e){var t=e.target;this.shouldHideOnOutsideClick&&!this.referenceElement.contains(t)&&!this.popoverElement.contains(t)&&document.body.contains(t)&&this.hide(e)},i.prototype.hideOnEscapePress=function(e){27===e.which&&this.isVisible&&(this.popoverElement.contains(e.target)&&this.referenceElement.focus(),this.hide(e))},i.prototype.toggleOptionalClasses=function(t){var n;this.data.has("toggle-class")&&(n=this.referenceElement.classList,this.data.get("toggle-class").split(/\s+/).forEach(function(e){n.toggle(e,t)}))},i.targets=[],i);function i(){var e=null!==r&&r.apply(this,arguments)||this;return e.popoverSelectorAttribute="aria-controls",e}function s(e){var t=(null===(r=e.getAttribute("data-controller"))||void 0===r?void 0:r.includes("s-popover"))||!1,n=o.application.getControllerForElementAndIdentifier(e,"s-popover"),r=e.getAttribute("data-s-popover-reference-selector"),r=r?e.querySelector(r):e,e=r?r.getAttribute("aria-controls"):null;return{isPopover:t,controller:n,referenceElement:r,popover:e?document.getElementById(e):null}}function a(e,t,n){var r=new Set(null===(r=e.getAttribute("data-controller"))||void 0===r?void 0:r.split(/\s+/));n?r.add(t):r.delete(t),e.setAttribute("data-controller",Array.from(r).join(" "))}o.PopoverController=t,o.showPopover=function(e){var t=s(e),n=t.isPopover;if(t=t.controller)t.show();else{if(!n)throw'element does not have data-controller="s-popover"';e.setAttribute("data-s-popover-auto-show","true")}},o.hidePopover=function(e){var t=(r=s(e)).isPopover,n=r.controller,r=r.popover;if(n)n.hide();else{if(!t)throw'element does not have data-controller="s-popover"';e.removeAttribute("data-s-popover-auto-show"),r&&r.classList.remove("is-visible")}},o.attachPopover=function(e,t,n){var r=s(e),o=r.referenceElement;if(r=r.popover)throw'element already has popover with id="'+r.id+'"';if(!o)throw"element has invalid data-s-popover-reference-selector attribute";if("string"==typeof t){var i=document.createRange().createContextualFragment(t).children;if(1!==i.length)throw"popover should contain a single element";t=i[0]}if(r=o.getAttribute("aria-controls"),i=t.id,!t.classList.contains("s-popover"))throw'popover should have the "s-popover" class but had class="'+t.className+'"';if(r&&r!==i)throw'element has aria-controls="'+r+'" but popover has id="'+i+'"';i||(i="--stacks-s-popover-"+Math.random().toString(36).substring(2,10),t.id=i),r||o.setAttribute("aria-controls",i),!t.parentElement&&e.parentElement&&o.insertAdjacentElement("afterend",t),a(e,"s-popover",!0),n&&(n.toggleOnClick&&o.setAttribute("data-action","click->s-popover#toggle"),n.placement&&e.setAttribute("data-s-popover-placement",n.placement),n.autoShow&&e.setAttribute("data-s-popover-auto-show","true"))},o.detachPopover=function(e){var t=(o=s(e)).isPopover,n=o.controller,r=o.referenceElement,o=o.popover;return null!=n&&n.hide(),null!=o&&o.remove(),t&&(a(e,"s-popover",!1),r&&r.removeAttribute("aria-controls")),o}}(Stacks=Stacks||{}),Stacks.application.register("s-popover",Stacks.PopoverController);__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();!function(){var e,t;function n(){return null!==t&&t.apply(this,arguments)||this}function p(e,t){for(var n=[],r=e.children[0],o=[],i=[];r||i.some(function(e){return 0!==e});){var s=[];n.push(s);var a=0;if(r)for(var c=0;c<r.children.length;c++){for(;i[a];)i[a]--,s[a]=o[a],a++;var u=r.children[c];if(!(u instanceof HTMLTableCellElement))throw"invalid table";if("none"!==getComputedStyle(u).display){if(u===t)return a;for(var l=a+u.colSpan;a<l;a++)i[a]=u.rowSpan-1,o[a]=u,s[a]=u}}for(;a<o.length;)i[a]&&(i[a]--,s[a]=o[a]),a++;r=r&&r.nextElementSibling}return t?-1:n}Stacks.application.register("s-table",(t=Stacks.StacksController,__extends(n,t),n.prototype.setCurrentSort=function(n,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 t=e===n;e.classList.toggle("is-sorted",t&&"none"!==r),e.querySelectorAll(".js-sorting-indicator").forEach(function(e){e.classList.toggle("d-none",!e.classList.contains("js-sorting-indicator-"+(t?r:"none")))}),t&&"none"!==r?o.setElementData(e,"sort-direction",r):o.removeElementData(e,"sort-direction")})},n.prototype.sort=function(e){var o=this,t=e.currentTarget;if(!(t instanceof HTMLTableCellElement))throw"invalid event target";var i,n,r,s,a,c,e=this.element,u=e.tBodies[0],l=function(e){if(!(e.parentElement&&e.parentElement.parentElement instanceof HTMLTableSectionElement))throw"invalid table";e=p(e.parentElement.parentElement,e);if("number"==typeof e)return e;throw"shouldn't happen"}(t);l<0||(i=function(e){e=p(e);if(e instanceof Array)return e;throw"shouldn't happen"}(u),n="asc"===this.getElementData(t,"sort-direction")?-1:1,r=Array.from(e.tBodies[0].rows),s=!1,a=[],r.forEach(function(e,t){var n,r=o.getElementData(e,"sort-to");"top"!==r&&("bottom"!==r?(n=i[t][l])?(""!==(n="string"==typeof(r=o.getElementData(n,"sort-val"))?r:n.textContent.trim())&&parseInt(n,10)+""!==n&&(s=!0),a.push([n,t])):a.push(["",t]):c=c||e)}),s||a.forEach(function(e){e[0]=""===e[0]?Number.MIN_VALUE:parseInt(e[0],10)}),a.sort(function(e,t){return e[0]>t[0]?n:e[0]<t[0]?-1*n:e[1]>t[1]?1:-1}),a.forEach(function(e){e=r[e[1]];e.parentElement.removeChild(e),c?u.insertBefore(e,c):u.appendChild(e)}),this.setCurrentSort(t,1==n?"asc":"desc"))},(e=n).targets=["column"],e))}();__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();!function(n){var r,e=(r=n.BasePopoverController,__extends(o,r),o.prototype.connect=function(){r.prototype.connect.call(this),window.matchMedia("(hover: hover)").matches&&this.bindMouseEvents()},o.prototype.disconnect=function(){this.unbindMouseEvents(),r.prototype.disconnect.call(this)},o.prototype.show=function(e){void 0===e&&(e=null);var t=n.application.getControllerForElementAndIdentifier(this.element,"s-popover");t&&t.isVisible||r.prototype.show.call(this,e)},o.prototype.scheduleShow=function(e){var t=this;void 0===e&&(e=null),window.clearTimeout(this.activeTimeout),this.activeTimeout=window.setTimeout(function(){return t.show(e)},300)},o.prototype.hide=function(e){void 0===e&&(e=null),window.clearTimeout(this.activeTimeout),this.activeTimeout=null,r.prototype.hide.call(this,e)},o.prototype.applyTitleAttributes=function(){var e,t=this.data.get("html-title");if(t)e=document.createRange().createContextualFragment(t);else{var n=this.element.getAttribute("title");if(!n)return null;e=document.createTextNode(n)}this.data.delete("html-title"),this.element.removeAttribute("title");t=this.element.getAttribute("aria-describedby");t||(t=o.generateId(),this.element.setAttribute("aria-describedby",t));n=document.getElementById(t);n||((n=document.createElement("div")).id=t,n.className="s-popover s-popover__tooltip pe-none",n.setAttribute("aria-hidden","true"),n.setAttribute("role","tooltip"),(r=this.element.parentNode)?r.insertBefore(n,this.element.nextSibling):document.body.appendChild(n));var r=n.querySelector(".s-popover--arrow");return n.innerHTML="",n.appendChild(e),r?n.appendChild(r):n.insertAdjacentHTML("beforeend",'<div class="s-popover--arrow"></div>'),this.scheduleUpdate(),n},o.prototype.bindDocumentEvents=function(){this.boundHideIfWithin=this.boundHideIfWithin||this.hideIfWithin.bind(this),document.addEventListener("s-popover:shown",this.boundHideIfWithin)},o.prototype.unbindDocumentEvents=function(){document.removeEventListener("s-popover:shown",this.boundHideIfWithin)},o.prototype.generatePopover=function(){return this.applyTitleAttributes()},o.prototype.hideIfWithin=function(e){e.target.contains(this.referenceElement)&&this.hide()},o.prototype.bindMouseEvents=function(){this.boundScheduleShow=this.boundScheduleShow||this.scheduleShow.bind(this),this.boundHide=this.boundHide||this.hide.bind(this),this.referenceElement.addEventListener("mouseover",this.boundScheduleShow),this.referenceElement.addEventListener("mouseout",this.boundHide)},o.prototype.unbindMouseEvents=function(){this.referenceElement.removeEventListener("mouseover",this.boundScheduleShow),this.referenceElement.removeEventListener("mouseout",this.boundHide)},o.generateId=function(){return"--stacks-s-tooltip-"+Math.random().toString(36).substring(2,10)},o.targets=[],o);function o(){var e=null!==r&&r.apply(this,arguments)||this;return e.popoverSelectorAttribute="aria-describedby",e}function i(e,t){t&&t.placement&&e.setAttribute("data-s-tooltip-placement",t.placement);t=n.application.getControllerForElementAndIdentifier(e,"s-tooltip");t?t.applyTitleAttributes():e.setAttribute("data-controller",e.getAttribute("data-controller")+" s-tooltip")}n.TooltipController=e,n.setTooltipHtml=function(e,t,n){e.setAttribute("data-s-tooltip-html-title",t),e.removeAttribute("title"),i(e,n)},n.setTooltipText=function(e,t,n){e.setAttribute("title",t),e.removeAttribute("data-s-tooltip-html-title"),i(e,n)}}(Stacks=Stacks||{}),Stacks.application.register("s-tooltip",Stacks.TooltipController);var Stacks,__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();!function(e){var t,n=(t=e.StacksController,__extends(s,t),s.prototype.connect=function(){t.prototype.connect.call(this),this.boundDragEnter=this.handleUploaderActive.bind(this,!0),this.boundDragLeave=this.handleUploaderActive.bind(this,!1),this.inputTarget.addEventListener("dragenter",this.boundDragEnter),this.inputTarget.addEventListener("dragleave",this.boundDragLeave)},s.prototype.disconnect=function(){this.inputTarget.removeEventListener("dragenter",this.boundDragEnter),this.inputTarget.removeEventListener("dragleave",this.boundDragLeave),t.prototype.disconnect.call(this)},s.prototype.handleInput=function(){var n,r=this;this.previewsTarget.innerHTML="",this.inputTarget.files&&(n=this.inputTarget.files.length,this.getDataURLs(this.inputTarget.files,s.FILE_DISPLAY_LIMIT).then(function(e){var t;r.handleVisible(!0),1<e.length?((t=document.createElement("div")).classList.add("s-uploader--previews-heading"),t.innerText=e.length<n?"Showing "+e.length+" of "+n+" files":n+" items",r.previewsTarget.appendChild(t),r.previewsTarget.classList.add("has-multiple")):r.previewsTarget.classList.remove("has-multiple"),e.forEach(function(e){return r.addFilePreview(e)}),r.handleUploaderActive(!0)}))},s.prototype.reset=function(){this.inputTarget.value="",this.previewsTarget.innerHTML="",this.handleVisible(!1)},s.prototype.handleVisible=function(e){var t=this.targets.scope,n=t.findAllElements("[data-s-uploader-hide-on-input]"),r=t.findAllElements("[data-s-uploader-show-on-input]"),t=t.findAllElements("[data-s-uploader-enable-on-input]");e?(n.map(function(e){return e.classList.add("d-none")}),r.map(function(e){return e.classList.remove("d-none")}),t.map(function(e){return e.removeAttribute("disabled")})):(n.map(function(e){return e.classList.remove("d-none")}),r.map(function(e){return e.classList.add("d-none")}),t.map(function(e){return e.setAttribute("disabled","true")}),this.handleUploaderActive(!1))},s.prototype.addFilePreview=function(e){var t,n;e&&(t=document.createElement("div"),e.type.match("image/*")&&e.data?((n=document.createElement("img")).src=e.data.toString(),n.alt=e.name):(n=document.createElement("div")).innerText=e.name,n.classList.add("s-uploader--preview-thumbnail"),t.appendChild(n),t.classList.add("s-uploader--preview"),t.setAttribute("data-filename",e.name),this.previewsTarget.appendChild(t))},s.prototype.handleUploaderActive=function(e){this.uploaderTarget.classList.toggle("is-active",e)},s.prototype.fileToDataURL=function(e){var r=new FileReader,o=e.name,t=e.size,i=e.type;return t<s.MAX_FILE_SIZE&&-1<i.indexOf("image")?new Promise(function(t,n){r.onload=function(e){e=null===(e=null==e?void 0:e.target)||void 0===e?void 0:e.result;e?t({data:e,name:o,type:i}):n()},r.readAsDataURL(e)}):Promise.resolve({name:o,type:i})},s.prototype.getDataURLs=function(e,t){var n=this,e=Array.from(e).slice(0,Math.min(t,e.length)).map(function(e){return n.fileToDataURL(e)});return Promise.all(e)},s.targets=["input","previews","uploader"],s.FILE_DISPLAY_LIMIT=10,s.MAX_FILE_SIZE=10485760,s);function s(){return null!==t&&t.apply(this,arguments)||this}e.UploaderController=n}(Stacks=Stacks||{}),Stacks.application.register("s-uploader",Stacks.UploaderController),Stacks._initializing=!1;
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Stimulus={})}(this,function(e){"use strict";var r=(t.prototype.connect=function(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)},t.prototype.disconnect=function(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)},t.prototype.bindingConnected=function(e){this.unorderedBindings.add(e)},t.prototype.bindingDisconnected=function(e){this.unorderedBindings.delete(e)},t.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(t.prototype,"bindings",{get:function(){return Array.from(this.unorderedBindings).sort(function(e,t){e=e.index,t=t.index;return e<t?-1:t<e?1:0})},enumerable:!1,configurable:!0}),t);function t(e,t,n){this.eventTarget=e,this.eventName=t,this.eventOptions=n,this.unorderedBindings=new Set}var n=(o.prototype.start=function(){this.started||(this.started=!0,this.eventListeners.forEach(function(e){return e.connect()}))},o.prototype.stop=function(){this.started&&(this.started=!1,this.eventListeners.forEach(function(e){return e.disconnect()}))},Object.defineProperty(o.prototype,"eventListeners",{get:function(){return Array.from(this.eventListenerMaps.values()).reduce(function(e,t){return e.concat(Array.from(t.values()))},[])},enumerable:!1,configurable:!0}),o.prototype.bindingConnected=function(e){this.fetchEventListenerForBinding(e).bindingConnected(e)},o.prototype.bindingDisconnected=function(e){this.fetchEventListenerForBinding(e).bindingDisconnected(e)},o.prototype.handleError=function(e,t,n){this.application.handleError(e,"Error "+t,n=void 0===n?{}:n)},o.prototype.fetchEventListenerForBinding=function(e){var t=e.eventTarget,n=e.eventName,e=e.eventOptions;return this.fetchEventListener(t,n,e)},o.prototype.fetchEventListener=function(e,t,n){var r=this.fetchEventListenerMapForEventTarget(e),o=this.cacheKey(t,n),i=r.get(o);return i||(i=this.createEventListener(e,t,n),r.set(o,i)),i},o.prototype.createEventListener=function(e,t,n){n=new r(e,t,n);return this.started&&n.connect(),n},o.prototype.fetchEventListenerMapForEventTarget=function(e){var t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t},o.prototype.cacheKey=function(e,t){var n=[e];return Object.keys(t).sort().forEach(function(e){n.push((t[e]?"":"!")+e)}),n.join(":")},o);function o(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}var i=/^((.+?)(@(window|document))?->)?(.+?)(#([^:]+?))(:(.+))?$/;function s(e){e=e.trim().match(i)||[];return{eventTarget:function(e){{if("window"==e)return window;if("document"==e)return document}}(e[4]),eventName:e[2],eventOptions:e[9]?e[9].split(":").reduce(function(e,t){return Object.assign(e,((e={})[t.replace(/^!/,"")]=!/^!/.test(t),e))},{}):{},identifier:e[5],methodName:e[7]}}var a=(c.forToken=function(e){return new this(e.element,e.index,s(e.content))},c.prototype.toString=function(){var e=this.eventTargetName?"@"+this.eventTargetName:"";return this.eventName+e+"->"+this.identifier+"#"+this.methodName},Object.defineProperty(c.prototype,"eventTargetName",{get:function(){return(e=this.eventTarget)==window?"window":e==document?"document":void 0;var e},enumerable:!1,configurable:!0}),c);function c(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 u)return u[t](e)}(e)||l("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||l("missing identifier"),this.methodName=n.methodName||l("missing method name")}var u={a:function(e){return"click"},button:function(e){return"click"},form:function(e){return"submit"},input:function(e){return"submit"==e.getAttribute("type")?"click":"input"},select:function(e){return"change"},textarea:function(e){return"input"}};function l(e){throw new Error(e)}var p=(Object.defineProperty(f.prototype,"index",{get:function(){return this.action.index},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"eventTarget",{get:function(){return this.action.eventTarget},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"eventOptions",{get:function(){return this.action.eventOptions},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!1,configurable:!0}),f.prototype.handleEvent=function(e){this.willBeInvokedByEvent(e)&&this.invokeWithEvent(e)},Object.defineProperty(f.prototype,"eventName",{get:function(){return this.action.eventName},enumerable:!1,configurable:!0}),Object.defineProperty(f.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:!1,configurable:!0}),f.prototype.invokeWithEvent=function(t){try{this.method.call(this.controller,t)}catch(e){var n=this.identifier,r=this.controller,o=this.element,i=this.index;this.context.handleError(e,'invoking action "'+this.action+'"',{identifier:n,controller:r,element:o,index:i,event:t})}},f.prototype.willBeInvokedByEvent=function(e){e=e.target;return this.element===e||(e instanceof Element&&this.element.contains(e)?this.scope.containsElement(e):this.scope.containsElement(this.action.element))},Object.defineProperty(f.prototype,"controller",{get:function(){return this.context.controller},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"methodName",{get:function(){return this.action.methodName},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"scope",{get:function(){return this.context.scope},enumerable:!1,configurable:!0}),f);function f(e,t){this.context=e,this.action=t}var d=(h.prototype.start=function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,childList:!0,subtree:!0}),this.refresh())},h.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},h.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)}}},h.prototype.processMutations=function(e){if(this.started)for(var t=0,n=e;t<n.length;t++){var r=n[t];this.processMutation(r)}},h.prototype.processMutation=function(e){"attributes"==e.type?this.processAttributeChange(e.target,e.attributeName):"childList"==e.type&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))},h.prototype.processAttributeChange=function(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)},h.prototype.processRemovedNodes=function(e){for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t],r=this.elementFromNode(r);r&&this.processTree(r,this.removeElement)}},h.prototype.processAddedNodes=function(e){for(var t=0,n=Array.from(e);t<n.length;t++){var r=n[t],r=this.elementFromNode(r);r&&this.elementIsActive(r)&&this.processTree(r,this.addElement)}},h.prototype.matchElement=function(e){return this.delegate.matchElement(e)},h.prototype.matchElementsInTree=function(e){return void 0===e&&(e=this.element),this.delegate.matchElementsInTree(e)},h.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)}},h.prototype.elementFromNode=function(e){if(e.nodeType==Node.ELEMENT_NODE)return e},h.prototype.elementIsActive=function(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)},h.prototype.addElement=function(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))},h.prototype.removeElement=function(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))},h);function h(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)})}var m=(Object.defineProperty(y.prototype,"element",{get:function(){return this.elementObserver.element},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"selector",{get:function(){return"["+this.attributeName+"]"},enumerable:!1,configurable:!0}),y.prototype.start=function(){this.elementObserver.start()},y.prototype.stop=function(){this.elementObserver.stop()},y.prototype.refresh=function(){this.elementObserver.refresh()},Object.defineProperty(y.prototype,"started",{get:function(){return this.elementObserver.started},enumerable:!1,configurable:!0}),y.prototype.matchElement=function(e){return e.hasAttribute(this.attributeName)},y.prototype.matchElementsInTree=function(e){var t=this.matchElement(e)?[e]:[],e=Array.from(e.querySelectorAll(this.selector));return t.concat(e)},y.prototype.elementMatched=function(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)},y.prototype.elementUnmatched=function(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)},y.prototype.elementAttributeChanged=function(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)},y);function y(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new d(e,this)}var g=(v.prototype.start=function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0}),this.refresh())},v.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},v.prototype.refresh=function(){if(this.started)for(var e=0,t=this.knownAttributeNames;e<t.length;e++){var n=t[e];this.refreshAttribute(n)}},v.prototype.processMutations=function(e){if(this.started)for(var t=0,n=e;t<n.length;t++){var r=n[t];this.processMutation(r)}},v.prototype.processMutation=function(e){e=e.attributeName;e&&this.refreshAttribute(e)},v.prototype.refreshAttribute=function(e){var t,n=this.delegate.getStringMapKeyForAttribute(e);null!=n&&(this.stringMap.has(e)||this.stringMapKeyAdded(n,e),t=this.element.getAttribute(e),this.stringMap.get(e)!=t&&this.stringMapValueChanged(t,n),null==t?(this.stringMap.delete(e),this.stringMapKeyRemoved(n,e)):this.stringMap.set(e,t))},v.prototype.stringMapKeyAdded=function(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)},v.prototype.stringMapValueChanged=function(e,t){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t)},v.prototype.stringMapKeyRemoved=function(e,t){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t)},Object.defineProperty(v.prototype,"knownAttributeNames",{get:function(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"currentAttributeNames",{get:function(){return Array.from(this.element.attributes).map(function(e){return e.name})},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"recordedAttributeNames",{get:function(){return Array.from(this.stringMap.keys())},enumerable:!1,configurable:!0}),v);function v(e,t){var n=this;this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(function(e){return n.processMutations(e)})}function b(e,t,n){E(e,t).add(n)}function w(e,t,n){E(e,t).delete(n),n=t,null!=(e=(t=e).get(n))&&0==e.size&&t.delete(n)}function E(e,t){var n=e.get(t);return n||(n=new Set,e.set(t,n)),n}var O=(Object.defineProperty(A.prototype,"values",{get:function(){return Array.from(this.valuesByKey.values()).reduce(function(e,t){return e.concat(Array.from(t))},[])},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"size",{get:function(){return Array.from(this.valuesByKey.values()).reduce(function(e,t){return e+t.size},0)},enumerable:!1,configurable:!0}),A.prototype.add=function(e,t){b(this.valuesByKey,e,t)},A.prototype.delete=function(e,t){w(this.valuesByKey,e,t)},A.prototype.has=function(e,t){e=this.valuesByKey.get(e);return null!=e&&e.has(t)},A.prototype.hasKey=function(e){return this.valuesByKey.has(e)},A.prototype.hasValue=function(t){return Array.from(this.valuesByKey.values()).some(function(e){return e.has(t)})},A.prototype.getValuesForKey=function(e){e=this.valuesByKey.get(e);return e?Array.from(e):[]},A.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})},A);function A(){this.valuesByKey=new Map}var x,k;(window&&window.__extends||(x=function(e,t){return(x=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])})(e,t)},function(e,t){function n(){this.constructor=e}x(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}))(_,k=O),Object.defineProperty(_.prototype,"values",{get:function(){return Array.from(this.keysByValue.keys())},enumerable:!1,configurable:!0}),_.prototype.add=function(e,t){k.prototype.add.call(this,e,t),b(this.keysByValue,t,e)},_.prototype.delete=function(e,t){k.prototype.delete.call(this,e,t),w(this.keysByValue,t,e)},_.prototype.hasValue=function(e){return this.keysByValue.has(e)},_.prototype.getKeysForValue=function(e){e=this.keysByValue.get(e);return e?Array.from(e):[]};function _(){var e=k.call(this)||this;return e.keysByValue=new Map,e}var T=(Object.defineProperty(P.prototype,"started",{get:function(){return this.attributeObserver.started},enumerable:!1,configurable:!0}),P.prototype.start=function(){this.attributeObserver.start()},P.prototype.stop=function(){this.attributeObserver.stop()},P.prototype.refresh=function(){this.attributeObserver.refresh()},Object.defineProperty(P.prototype,"element",{get:function(){return this.attributeObserver.element},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"attributeName",{get:function(){return this.attributeObserver.attributeName},enumerable:!1,configurable:!0}),P.prototype.elementMatchedAttribute=function(e){this.tokensMatched(this.readTokensForElement(e))},P.prototype.elementAttributeValueChanged=function(e){var t=this.refreshTokensForElement(e),e=t[0],t=t[1];this.tokensUnmatched(e),this.tokensMatched(t)},P.prototype.elementUnmatchedAttribute=function(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))},P.prototype.tokensMatched=function(e){var t=this;e.forEach(function(e){return t.tokenMatched(e)})},P.prototype.tokensUnmatched=function(e){var t=this;e.forEach(function(e){return t.tokenUnmatched(e)})},P.prototype.tokenMatched=function(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)},P.prototype.tokenUnmatched=function(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)},P.prototype.refreshTokensForElement=function(e){var n,r,t=this.tokensByElement.getValuesForKey(e),o=this.readTokensForElement(e),e=(n=t,r=o,e=Math.max(n.length,r.length),Array.from({length:e},function(e,t){return[n[t],r[t]]}).findIndex(function(e){var t=e[0],e=e[1];return e=e,!((t=t)&&e&&t.index==e.index&&t.content==e.content)}));return-1==e?[[],[]]:[t.slice(e),o.slice(e)]},P.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}})},P);function P(e,t,n){this.attributeObserver=new m(e,t,this),this.delegate=n,this.tokensByElement=new O}var S=(Object.defineProperty(j.prototype,"started",{get:function(){return this.tokenListObserver.started},enumerable:!1,configurable:!0}),j.prototype.start=function(){this.tokenListObserver.start()},j.prototype.stop=function(){this.tokenListObserver.stop()},j.prototype.refresh=function(){this.tokenListObserver.refresh()},Object.defineProperty(j.prototype,"element",{get:function(){return this.tokenListObserver.element},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"attributeName",{get:function(){return this.tokenListObserver.attributeName},enumerable:!1,configurable:!0}),j.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))},j.prototype.tokenUnmatched=function(e){var t=e.element,n=this.fetchParseResultForToken(e).value;n&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,n))},j.prototype.fetchParseResultForToken=function(e){var t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t},j.prototype.fetchValuesByTokenForElement=function(e){var t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t},j.prototype.parseToken=function(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}},j);function j(e,t,n){this.tokenListObserver=new T(e,t,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}var C=(L.prototype.start=function(){this.valueListObserver||(this.valueListObserver=new S(this.element,this.actionAttribute,this),this.valueListObserver.start())},L.prototype.stop=function(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())},Object.defineProperty(L.prototype,"element",{get:function(){return this.context.element},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"actionAttribute",{get:function(){return this.schema.actionAttribute},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"schema",{get:function(){return this.context.schema},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"bindings",{get:function(){return Array.from(this.bindingsByAction.values())},enumerable:!1,configurable:!0}),L.prototype.connectAction=function(e){var t=new p(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)},L.prototype.disconnectAction=function(e){var t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))},L.prototype.disconnectAllActions=function(){var t=this;this.bindings.forEach(function(e){return t.delegate.bindingDisconnected(e)}),this.bindingsByAction.clear()},L.prototype.parseValueForToken=function(e){e=a.forToken(e);if(e.identifier==this.identifier)return e},L.prototype.elementMatchedValue=function(e,t){this.connectAction(t)},L.prototype.elementUnmatchedValue=function(e,t){this.disconnectAction(t)},L);function L(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}var M=(B.prototype.start=function(){this.stringMapObserver.start()},B.prototype.stop=function(){this.stringMapObserver.stop()},Object.defineProperty(B.prototype,"element",{get:function(){return this.context.element},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"controller",{get:function(){return this.context.controller},enumerable:!1,configurable:!0}),B.prototype.getStringMapKeyForAttribute=function(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name},B.prototype.stringMapValueChanged=function(e,t){this.invokeChangedCallbackForValue(t)},B.prototype.invokeChangedCallbacksForDefaultValues=function(){for(var e=0,t=this.valueDescriptors;e<t.length;e++){var n=t[e],r=n.key,o=n.name;null==n.defaultValue||this.controller.data.has(r)||this.invokeChangedCallbackForValue(o)}},B.prototype.invokeChangedCallbackForValue=function(e){var t=this.receiver[e+"Changed"];"function"==typeof t&&(e=this.receiver[e],t.call(this.receiver,e))},Object.defineProperty(B.prototype,"valueDescriptors",{get:function(){var t=this.valueDescriptorMap;return Object.keys(t).map(function(e){return t[e]})},enumerable:!1,configurable:!0}),B);function B(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new g(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap,this.invokeChangedCallbacksForDefaultValues()}var D=(F.prototype.connect=function(){this.bindingObserver.start(),this.valueObserver.start();try{this.controller.connect()}catch(e){this.handleError(e,"connecting controller")}},F.prototype.disconnect=function(){try{this.controller.disconnect()}catch(e){this.handleError(e,"disconnecting controller")}this.valueObserver.stop(),this.bindingObserver.stop()},Object.defineProperty(F.prototype,"application",{get:function(){return this.module.application},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"identifier",{get:function(){return this.module.identifier},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"schema",{get:function(){return this.application.schema},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"dispatcher",{get:function(){return this.application.dispatcher},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"parentElement",{get:function(){return this.element.parentElement},enumerable:!1,configurable:!0}),F.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)},F);function F(e,t){this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new C(this,this.dispatcher),this.valueObserver=new M(this,this.controller);try{this.controller.initialize()}catch(e){this.handleError(e,"initializing controller")}}function N(e,n){e=V(e);return Array.from(e.reduce(function(t,e){return function(e,t){t=e[t];return Array.isArray(t)?t:[]}(e,n).forEach(function(e){return t.add(e)}),t},new Set))}function I(e,r){return V(e).reduce(function(e,t){var n;return e.push.apply(e,(n=t[r])?Object.keys(n).map(function(e){return[e,n[e]]}):[]),e},[])}function V(e){for(var t=[];e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}var K,H=window&&window.__extends||(K=function(e,t){return(K=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])})(e,t)},function(e,t){function n(){this.constructor=e}K(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),R=window&&window.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r};function U(e){return n=N(i=t=e,"blessings").reduce(function(e,t){var n,r=t(i);for(n in r){var o=e[n]||{};e[n]=Object.assign(o,r[n])}return e},{}),e=W(t),n=function(o,i){return q(i).reduce(function(e,t){var n,r=function(e,t,n){e=Object.getOwnPropertyDescriptor(e,n);if(!(e&&"value"in e)){n=Object.getOwnPropertyDescriptor(t,n).value;return e&&(n.get=e.get||n.get,n.set=e.set||n.set),n}}(o,i,t);return r&&Object.assign(e,((n={})[t]=r,n)),e},{})}(t.prototype,n),Object.defineProperties(e.prototype,n),e;var t,n,i}var q="function"==typeof Object.getOwnPropertySymbols?function(e){return R(Object.getOwnPropertyNames(e),Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,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 H(t,n=e),t;function t(){return null!==n&&n.apply(this,arguments)||this}var n}}var t}();var z=(Object.defineProperty(G.prototype,"identifier",{get:function(){return this.definition.identifier},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"controllerConstructor",{get:function(){return this.definition.controllerConstructor},enumerable:!1,configurable:!0}),Object.defineProperty(G.prototype,"contexts",{get:function(){return Array.from(this.connectedContexts)},enumerable:!1,configurable:!0}),G.prototype.connectContextForScope=function(e){e=this.fetchContextForScope(e);this.connectedContexts.add(e),e.connect()},G.prototype.disconnectContextForScope=function(e){e=this.contextsByScope.get(e);e&&(this.connectedContexts.delete(e),e.disconnect())},G.prototype.fetchContextForScope=function(e){var t=this.contextsByScope.get(e);return t||(t=new D(this,e),this.contextsByScope.set(e,t)),t},G);function G(e,t){this.application=e,this.definition={identifier:(t=t).identifier,controllerConstructor:U(t.controllerConstructor)},this.contextsByScope=new WeakMap,this.connectedContexts=new Set}var J=(X.prototype.has=function(e){return this.data.has(this.getDataKey(e))},X.prototype.get=function(e){return this.data.get(this.getDataKey(e))},X.prototype.getAttributeName=function(e){return this.data.getAttributeNameForKey(this.getDataKey(e))},X.prototype.getDataKey=function(e){return e+"-class"},Object.defineProperty(X.prototype,"data",{get:function(){return this.scope.data},enumerable:!1,configurable:!0}),X);function X(e){this.scope=e}function Y(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Z(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()})}var $=(Object.defineProperty(Q.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!1,configurable:!0}),Q.prototype.get=function(e){e=this.getAttributeNameForKey(e);return this.element.getAttribute(e)},Q.prototype.set=function(e,t){var n=this.getAttributeNameForKey(e);return this.element.setAttribute(n,t),this.get(e)},Q.prototype.has=function(e){e=this.getAttributeNameForKey(e);return this.element.hasAttribute(e)},Q.prototype.delete=function(e){if(this.has(e)){e=this.getAttributeNameForKey(e);return this.element.removeAttribute(e),!0}return!1},Q.prototype.getAttributeNameForKey=function(e){return"data-"+this.identifier+"-"+Z(e)},Q);function Q(e){this.scope=e}var ee=(te.prototype.warn=function(e,t,n){var r=this.warnedKeysByObject.get(e);r||(r=new Set,this.warnedKeysByObject.set(e,r)),r.has(t)||(r.add(t),this.logger.warn(n,e))},te);function te(e){this.warnedKeysByObject=new WeakMap,this.logger=e}function ne(e,t){return"["+e+'~="'+t+'"]'}var re=window&&window.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},oe=(Object.defineProperty(ie.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!1,configurable:!0}),Object.defineProperty(ie.prototype,"schema",{get:function(){return this.scope.schema},enumerable:!1,configurable:!0}),ie.prototype.has=function(e){return null!=this.find(e)},ie.prototype.find=function(){for(var n=this,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(function(e,t){return e||n.findTarget(t)||n.findLegacyTarget(t)},void 0)},ie.prototype.findAll=function(){for(var n=this,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(function(e,t){return re(e,n.findAllTargets(t),n.findAllLegacyTargets(t))},[])},ie.prototype.findTarget=function(e){e=this.getSelectorForTargetName(e);return this.scope.findElement(e)},ie.prototype.findAllTargets=function(e){e=this.getSelectorForTargetName(e);return this.scope.findAllElements(e)},ie.prototype.getSelectorForTargetName=function(e){return ne("data-"+this.identifier+"-target",e)},ie.prototype.findLegacyTarget=function(e){var t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)},ie.prototype.findAllLegacyTargets=function(t){var n=this,e=this.getLegacySelectorForTargetName(t);return this.scope.findAllElements(e).map(function(e){return n.deprecate(e,t)})},ie.prototype.getLegacySelectorForTargetName=function(e){e=this.identifier+"."+e;return ne(this.schema.targetAttribute,e)},ie.prototype.deprecate=function(e,t){var n,r;return e&&(n=this.identifier,r=this.schema.targetAttribute,this.guide.warn(e,"target:"+t,"Please replace "+r+'="'+n+"."+t+'" with data-'+n+'-target="'+t+'". The '+r+" attribute is deprecated and will be removed in a future version of Stimulus.")),e},Object.defineProperty(ie.prototype,"guide",{get:function(){return this.scope.guide},enumerable:!1,configurable:!0}),ie);function ie(e){this.scope=e}var se=window&&window.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},ae=(ce.prototype.findElement=function(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)},ce.prototype.findAllElements=function(e){return se(this.element.matches(e)?[this.element]:[],this.queryElements(e).filter(this.containsElement))},ce.prototype.queryElements=function(e){return Array.from(this.element.querySelectorAll(e))},Object.defineProperty(ce.prototype,"controllerSelector",{get:function(){return ne(this.schema.controllerAttribute,this.identifier)},enumerable:!1,configurable:!0}),ce);function ce(e,t,n,r){var o=this;this.targets=new oe(this),this.classes=new J(this),this.data=new $(this),this.containsElement=function(e){return e.closest(o.controllerSelector)===o.element},this.schema=e,this.element=t,this.identifier=n,this.guide=new ee(r)}var ue=(le.prototype.start=function(){this.valueListObserver.start()},le.prototype.stop=function(){this.valueListObserver.stop()},Object.defineProperty(le.prototype,"controllerAttribute",{get:function(){return this.schema.controllerAttribute},enumerable:!1,configurable:!0}),le.prototype.parseValueForToken=function(e){var t=e.element,n=e.content,r=this.fetchScopesByIdentifierForElement(t),e=r.get(n);return e||(e=this.delegate.createScopeForElementAndIdentifier(t,n),r.set(n,e)),e},le.prototype.elementMatchedValue=function(e,t){var n=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,n),1==n&&this.delegate.scopeConnected(t)},le.prototype.elementUnmatchedValue=function(e,t){var n=this.scopeReferenceCounts.get(t);n&&(this.scopeReferenceCounts.set(t,n-1),1==n&&this.delegate.scopeDisconnected(t))},le.prototype.fetchScopesByIdentifierForElement=function(e){var t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t},le);function le(e,t,n){this.element=e,this.schema=t,this.delegate=n,this.valueListObserver=new S(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}var pe=(Object.defineProperty(fe.prototype,"element",{get:function(){return this.application.element},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"schema",{get:function(){return this.application.schema},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"logger",{get:function(){return this.application.logger},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"controllerAttribute",{get:function(){return this.schema.controllerAttribute},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"modules",{get:function(){return Array.from(this.modulesByIdentifier.values())},enumerable:!1,configurable:!0}),Object.defineProperty(fe.prototype,"contexts",{get:function(){return this.modules.reduce(function(e,t){return e.concat(t.contexts)},[])},enumerable:!1,configurable:!0}),fe.prototype.start=function(){this.scopeObserver.start()},fe.prototype.stop=function(){this.scopeObserver.stop()},fe.prototype.loadDefinition=function(e){this.unloadIdentifier(e.identifier);e=new z(this.application,e);this.connectModule(e)},fe.prototype.unloadIdentifier=function(e){e=this.modulesByIdentifier.get(e);e&&this.disconnectModule(e)},fe.prototype.getContextForElementAndIdentifier=function(t,e){e=this.modulesByIdentifier.get(e);if(e)return e.contexts.find(function(e){return e.element==t})},fe.prototype.handleError=function(e,t,n){this.application.handleError(e,t,n)},fe.prototype.createScopeForElementAndIdentifier=function(e,t){return new ae(this.schema,e,t,this.logger)},fe.prototype.scopeConnected=function(e){this.scopesByIdentifier.add(e.identifier,e);var t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)},fe.prototype.scopeDisconnected=function(e){this.scopesByIdentifier.delete(e.identifier,e);var t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)},fe.prototype.connectModule=function(t){this.modulesByIdentifier.set(t.identifier,t),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(function(e){return t.connectContextForScope(e)})},fe.prototype.disconnectModule=function(t){this.modulesByIdentifier.delete(t.identifier),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(function(e){return t.disconnectContextForScope(e)})},fe);function fe(e){this.application=e,this.scopeObserver=new ue(this.element,this.schema,this),this.scopesByIdentifier=new O,this.modulesByIdentifier=new Map}var de={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target"},he=window&&window.__awaiter||function(e,s,a,c){return new(a=a||Promise)(function(n,t){function r(e){try{i(c.next(e))}catch(e){t(e)}}function o(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?n(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,o)}i((c=c.apply(e,s||[])).next())})},me=window&&window.__generator||function(n,r){var o,i,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"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(;a;)try{if(o=1,i&&(s=2&t[0]?i.return:t[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,t[1])).done)return s;switch(i=0,(t=s?[2&t[0],s.value]:t)[0]){case 0:case 1:s=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){a=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){a.label=t[1];break}if(6===t[0]&&a.label<s[1]){a.label=s[1],s=t;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(t);break}s[2]&&a.ops.pop(),a.trys.pop();continue}t=r.call(n,a)}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])}}},ye=window&&window.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var i=arguments[t],s=0,a=i.length;s<a;s++,o++)r[o]=i[s];return r},ge=(ve.start=function(e,t){t=new ve(e,t);return t.start(),t},ve.prototype.start=function(){return he(this,void 0,void 0,function(){return me(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.dispatcher.start(),this.router.start(),[2]}})})},ve.prototype.stop=function(){this.dispatcher.stop(),this.router.stop()},ve.prototype.register=function(e,t){this.load({identifier:e,controllerConstructor:t})},ve.prototype.load=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(Array.isArray(e)?e:ye([e],n)).forEach(function(e){return t.router.loadDefinition(e)})},ve.prototype.unload=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];(Array.isArray(e)?e:ye([e],n)).forEach(function(e){return t.router.unloadIdentifier(e)})},Object.defineProperty(ve.prototype,"controllers",{get:function(){return this.router.contexts.map(function(e){return e.controller})},enumerable:!1,configurable:!0}),ve.prototype.getControllerForElementAndIdentifier=function(e,t){t=this.router.getContextForElementAndIdentifier(e,t);return t?t.controller:null},ve.prototype.handleError=function(e,t,n){this.logger.error("%s\n\n%o\n\n%o",t,e,n)},ve);function ve(e,t){void 0===e&&(e=document.documentElement),void 0===t&&(t=de),this.logger=console,this.element=e,this.schema=t,this.dispatcher=new n(this),this.router=new pe(this)}function be(e){return N(e,"classes").reduce(function(e,t){return Object.assign(e,((e={})[t=(n=t)+"Class"]={get:function(){var e=this.classes;if(e.has(n))return e.get(n);e=e.getAttributeName(n);throw new Error('Missing attribute "'+e+'"')}},e["has"+Y(t)]={get:function(){return this.classes.has(n)}},e));var n},{})}function we(e){return N(e,"targets").reduce(function(e,t){return Object.assign(e,((e={})[(n=t)+"Target"]={get:function(){var e=this.targets.find(n);if(e)return e;throw new Error('Missing target element "'+this.identifier+"."+n+'"')}},e[n+"Targets"]={get:function(){return this.targets.findAll(n)}},e["has"+Y(n)+"Target"]={get:function(){return this.targets.has(n)}},e));var n},{})}function Ee(e){var t=I(e,"values"),e={valueDescriptorMap:{get:function(){var r=this;return t.reduce(function(e,t){var n=Oe(t),t=r.data.getAttributeNameForKey(n.key);return Object.assign(e,((e={})[t]=n,e))},{})}}};return t.reduce(function(e,t){return Object.assign(e,(n=Oe(e=t),t=n.type,r=n.key,e=n.name,o=xe[t],i=ke[t]||ke.default,(t={})[e]={get:function(){var e=this.data.get(r);return null!==e?o(e):n.defaultValue},set:function(e){void 0===e?this.data.delete(r):this.data.set(r,i(e))}},t["has"+Y(e)]={get:function(){return this.data.has(r)}},t));var n,r,o,i},e)}function Oe(e){return function(e,t){e=Z(e)+"-value";return{type:t,key:e,name:function(e){return e.replace(/(?:[_-])([a-z0-9])/g,function(e,t){return t.toUpperCase()})}(e),get defaultValue(){return Ae[t]}}}(e[0],function(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}throw new Error('Unknown value type constant "'+e+'"')}(e[1]))}var Ae={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},xe={array:function(e){e=JSON.parse(e);if(!Array.isArray(e))throw new TypeError("Expected array");return e},boolean:function(e){return!("0"==e||"false"==e)},number:function(e){return parseFloat(e)},object:function(e){e=JSON.parse(e);if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("Expected object");return e},string:function(e){return e}},ke={default:function(e){return""+e},array:_e,object:_e};function _e(e){return JSON.stringify(e)}var Te=(Object.defineProperty(Pe.prototype,"application",{get:function(){return this.context.application},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"scope",{get:function(){return this.context.scope},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"element",{get:function(){return this.scope.element},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"targets",{get:function(){return this.scope.targets},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"classes",{get:function(){return this.scope.classes},enumerable:!1,configurable:!0}),Object.defineProperty(Pe.prototype,"data",{get:function(){return this.scope.data},enumerable:!1,configurable:!0}),Pe.prototype.initialize=function(){},Pe.prototype.connect=function(){},Pe.prototype.disconnect=function(){},Pe.blessings=[be,we,Ee],Pe.targets=[],Pe.values={},Pe);function Pe(e){this.context=e}e.Application=ge,e.Context=D,e.Controller=Te,e.defaultSchema=de,Object.defineProperty(e,"__esModule",{value:!0})}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,function(e){"use strict";function v(e){if(null==e)return window;if("[object Window]"===e.toString())return e;e=e.ownerDocument;return e&&e.defaultView||window}function m(e){return e instanceof v(e).Element||e instanceof Element}function a(e){return e instanceof v(e).HTMLElement||e instanceof HTMLElement}function o(e){return"undefined"!=typeof ShadowRoot&&(e instanceof v(e).ShadowRoot||e instanceof ShadowRoot)}var _=Math.max,T=Math.min,b=Math.round;function l(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,o=1;return a(e)&&t&&(t=e.offsetHeight,0<(e=e.offsetWidth)&&(r=b(n.width)/e||1),0<t&&(o=b(n.height)/t||1)),{width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function p(e){e=v(e);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function c(e){return e?(e.nodeName||"").toLowerCase():null}function w(e){return((m(e)?e.ownerDocument:e.document)||window.document).documentElement}function f(e){return l(w(e)).left+p(e).scrollLeft}function E(e){return v(e).getComputedStyle(e)}function u(e){var t=E(e),n=t.overflow,e=t.overflowX,t=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+t+e)}function y(e,t,n){void 0===n&&(n=!1);var r=a(t),o=a(t)&&(o=(s=t).getBoundingClientRect(),i=b(o.width)/s.offsetWidth||1,s=b(o.height)/s.offsetHeight||1,1!==i||1!==s),i=w(t),s=l(e,o),e={scrollLeft:0,scrollTop:0},o={x:0,y:0};return!r&&(r||n)||("body"===c(t)&&!u(i)||(e=(r=t)!==v(r)&&a(r)?{scrollLeft:(n=r).scrollLeft,scrollTop:n.scrollTop}:p(r)),a(t)?((o=l(t,!0)).x+=t.clientLeft,o.y+=t.clientTop):i&&(o.x=f(i))),{x:s.left+e.scrollLeft-o.x,y:s.top+e.scrollTop-o.y,width:s.width,height:s.height}}function P(e){var t=l(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function d(e){return"html"===c(e)?e:e.assignedSlot||e.parentNode||(o(e)?e.host:null)||w(e)}function g(e,t){void 0===t&&(t=[]);var n=function e(t){return 0<=["html","body","#document"].indexOf(c(t))?t.ownerDocument.body:a(t)&&u(t)?t:e(d(t))}(e),e=n===(null==(r=e.ownerDocument)?void 0:r.body),r=v(n),n=e?[r].concat(r.visualViewport||[],u(n)?n:[]):n,t=t.concat(n);return e?t:t.concat(g(d(n)))}function r(e){return a(e)&&"fixed"!==E(e).position?e.offsetParent:null}function S(e){for(var t=v(e),n=r(e);n&&0<=["table","td","th"].indexOf(c(n))&&"static"===E(n).position;)n=r(n);return(!n||"html"!==c(n)&&("body"!==c(n)||"static"!==E(n).position))&&(n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),n=-1!==navigator.userAgent.indexOf("Trident");if(n&&a(e)&&"fixed"===E(e).position)return null;for(var r=d(e);a(r)&&["html","body"].indexOf(c(r))<0;){var o=E(r);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return r;r=r.parentNode}return null}(e))||t}var j="top",C="bottom",L="right",M="left",B="auto",D=[j,C,L,M],F="start",O="end",h="clippingParents",A="viewport",x="popper",k="reference",N=D.reduce(function(e,t){return e.concat([t+"-"+F,t+"-"+O])},[]),I=[].concat(D,[B]).reduce(function(e,t){return e.concat([t,t+"-"+F,t+"-"+O])},[]),V=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function K(e){var n=new Map,r=new Set,o=[];return e.forEach(function(e){n.set(e.name,e)}),e.forEach(function(e){r.has(e.name)||!function t(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){r.has(e)||(e=n.get(e))&&t(e)}),o.push(e)}(e)}),o}function H(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return[].concat(n).reduce(function(e,t){return e.replace(/%s/,t)},e)}var R='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',U='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',q=["name","enabled","phase","fn","effect","requires","options"];function W(e){return e.split("-")[0]}function z(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&o(n)){var r=t;do{if(r&&e.isSameNode(r))return!0}while(r=r.parentNode||r.host)}return!1}function G(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function J(e,t){return t===A?G((i=v(o=e),s=w(o),a=i.visualViewport,c=s.clientWidth,u=s.clientHeight,s=i=0,a&&(c=a.width,u=a.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(i=a.offsetLeft,s=a.offsetTop)),{width:c,height:u,x:i+f(o),y:s})):m(t)?((r=l(n=t)).top=r.top+n.clientTop,r.left=r.left+n.clientLeft,r.bottom=r.top+n.clientHeight,r.right=r.left+n.clientWidth,r.width=n.clientWidth,r.height=n.clientHeight,r.x=r.left,r.y=r.top,r):G((o=w(e),s=w(o),t=p(o),r=null==(n=o.ownerDocument)?void 0:n.body,e=_(s.scrollWidth,s.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),n=_(s.scrollHeight,s.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),o=-t.scrollLeft+f(o),t=-t.scrollTop,"rtl"===E(r||s).direction&&(o+=_(s.clientWidth,r?r.clientWidth:0)-e),{width:e,height:n,x:o,y:t}));var n,r,o,i,s,a,c,u}function X(n,e,t){var r,o,i,s,e="clippingParents"===e?(o=g(d(r=n)),i=0<=["absolute","fixed"].indexOf(E(r).position),m(s=i&&a(r)?S(r):r)?o.filter(function(e){return m(e)&&z(e,s)&&"body"!==c(e)&&(!i||"static"!==E(e).position)}):[]):[].concat(e),e=[].concat(e,[t]),t=e[0],t=e.reduce(function(e,t){t=J(n,t);return e.top=_(t.top,e.top),e.right=T(t.right,e.right),e.bottom=T(t.bottom,e.bottom),e.left=_(t.left,e.left),e},J(n,t));return t.width=t.right-t.left,t.height=t.bottom-t.top,t.x=t.left,t.y=t.top,t}function Y(e){return e.split("-")[1]}function Z(e){return 0<=["top","bottom"].indexOf(e)?"x":"y"}function $(e){var t,n=e.reference,r=e.element,o=e.placement,e=o?W(o):null,o=o?Y(o):null,i=n.x+n.width/2-r.width/2,s=n.y+n.height/2-r.height/2;switch(e){case j:t={x:i,y:n.y-r.height};break;case C:t={x:i,y:n.y+n.height};break;case L:t={x:n.x+n.width,y:s};break;case M:t={x:n.x-r.width,y:s};break;default:t={x:n.x,y:n.y}}var a=e?Z(e):null;if(null!=a){var c="y"===a?"height":"width";switch(o){case F:t[a]=t[a]-(n[c]/2-r[c]/2);break;case O:t[a]=t[a]+(n[c]/2-r[c]/2)}}return t}function Q(){return{top:0,right:0,bottom:0,left:0}}function ee(e){return Object.assign({},Q(),e)}function te(n,e){return e.reduce(function(e,t){return e[t]=n,e},{})}function ne(e,t){var r,n=(t=void 0===t?{}:t).placement,o=void 0===n?e.placement:n,i=t.boundary,s=void 0===i?h:i,a=t.rootBoundary,c=void 0===a?A:a,n=t.elementContext,i=void 0===n?x:n,a=t.altBoundary,n=void 0!==a&&a,a=t.padding,t=void 0===a?0:a,a=ee("number"!=typeof t?t:te(t,D)),t=e.rects.popper,n=e.elements[n?i===x?k:x:i],n=X(m(n)?n:n.contextElement||w(e.elements.popper),s,c),s=l(e.elements.reference),c=$({reference:s,element:t,strategy:"absolute",placement:o}),c=G(Object.assign({},t,c)),s=i===x?c:s,u={top:n.top-s.top+a.top,bottom:s.bottom-n.bottom+a.bottom,left:n.left-s.left+a.left,right:s.right-n.right+a.right},e=e.modifiersData.offset;return i===x&&e&&(r=e[o],Object.keys(u).forEach(function(e){var t=0<=[L,C].indexOf(e)?1:-1,n=0<=[j,C].indexOf(e)?"y":"x";u[e]+=r[n]*t})),u}var re="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",i={placement:"bottom",modifiers:[],strategy:"absolute"};function oe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function t(e){var t=(e=void 0===e?{}:e).defaultModifiers,d=void 0===t?[]:t,e=e.defaultOptions,h=void 0===e?i:e;return function(s,a,t){void 0===t&&(t=h);var n,r,c={placement:"bottom",orderedModifiers:[],options:Object.assign({},i,h),modifiersData:{},elements:{reference:s,popper:a},attributes:{},styles:{}},u=[],l=!1,p={state:c,setOptions:function(e){e="function"==typeof e?e(c.options):e;f(),c.options=Object.assign({},h,c.options,e),c.scrollParents={reference:m(s)?g(s):s.contextElement?g(s.contextElement):[],popper:g(a)};var n,t,e=(e=[].concat(d,c.options.modifiers),t=e.reduce(function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e},{}),e=Object.keys(t).map(function(e){return t[e]}),n=K(e),V.reduce(function(e,t){return e.concat(n.filter(function(e){return e.phase===t}))},[]));c.orderedModifiers=e.filter(function(e){return e.enabled});e=[].concat(e,c.options.modifiers),o=function(e){return e.name},i=new Set,e=e.filter(function(e){e=o(e);if(!i.has(e))return i.add(e),!0});(r=e).forEach(function(n){[].concat(Object.keys(n),q).filter(function(e,t,n){return n.indexOf(e)===t}).forEach(function(e){switch(e){case"name":"string"!=typeof n.name&&console.error(H(R,String(n.name),'"name"','"string"','"'+String(n.name)+'"'));break;case"enabled":"boolean"!=typeof n.enabled&&console.error(H(R,n.name,'"enabled"','"boolean"','"'+String(n.enabled)+'"'));break;case"phase":V.indexOf(n.phase)<0&&console.error(H(R,n.name,'"phase"',"either "+V.join(", "),'"'+String(n.phase)+'"'));break;case"fn":"function"!=typeof n.fn&&console.error(H(R,n.name,'"fn"','"function"','"'+String(n.fn)+'"'));break;case"effect":null!=n.effect&&"function"!=typeof n.effect&&console.error(H(R,n.name,'"effect"','"function"','"'+String(n.fn)+'"'));break;case"requires":null==n.requires||Array.isArray(n.requires)||console.error(H(R,n.name,'"requires"','"array"','"'+String(n.requires)+'"'));break;case"requiresIfExists":Array.isArray(n.requiresIfExists)||console.error(H(R,n.name,'"requiresIfExists"','"array"','"'+String(n.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+n.name+'" modifier, valid properties are '+q.map(function(e){return'"'+e+'"'}).join(", ")+'; but "'+e+'" was provided.')}n.requires&&n.requires.forEach(function(t){null==r.find(function(e){return e.name===t})&&console.error(H(U,String(n.name),t,t))})})}),W(c.options.placement)===B&&(c.orderedModifiers.find(function(e){return"flip"===e.name})||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" ")));var r,o,i,e=E(a);return[e.marginTop,e.marginRight,e.marginBottom,e.marginLeft].some(function(e){return parseFloat(e)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" ")),c.orderedModifiers.forEach(function(e){var t=e.name,n=e.options,e=e.effect;"function"==typeof e&&(n=e({state:c,name:t,instance:p,options:void 0===n?{}:n}),u.push(n||function(){}))}),p.update()},forceUpdate:function(){if(!l){var e=c.elements,t=e.reference,e=e.popper;if(oe(t,e)){c.rects={reference:y(t,S(e),"fixed"===c.options.strategy),popper:P(e)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(e){return c.modifiersData[e.name]=Object.assign({},e.data)});for(var n,r,o,i=0,s=0;s<c.orderedModifiers.length;s++){if(100<(i+=1)){console.error("Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.");break}!0!==c.reset?(n=(o=c.orderedModifiers[s]).fn,r=o.options,o=o.name,"function"==typeof n&&(c=n({state:c,options:void 0===r?{}:r,name:o,instance:p})||c)):(c.reset=!1,s=-1)}}else console.error(re)}},update:(n=function(){return new Promise(function(e){p.forceUpdate(),e(c)})},function(){return r=r||new Promise(function(e){Promise.resolve().then(function(){r=void 0,e(n())})})}),destroy:function(){f(),l=!0}};return oe(s,a)?p.setOptions(t).then(function(e){!l&&t.onFirstUpdate&&t.onFirstUpdate(e)}):console.error(re),p;function f(){u.forEach(function(e){return e()}),u=[]}}}var ie={passive:!0};var n={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=void 0===(e=r.scroll)||e,i=void 0===(r=r.resize)||r,s=v(t.elements.popper),a=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&a.forEach(function(e){e.addEventListener("scroll",n.update,ie)}),i&&s.addEventListener("resize",n.update,ie),function(){o&&a.forEach(function(e){e.removeEventListener("scroll",n.update,ie)}),i&&s.removeEventListener("resize",n.update,ie)}},data:{}};var s={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,e=e.name;t.modifiersData[e]=$({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ae(e){var t=e.popper,n=e.popperRect,r=e.placement,o=e.variation,i=e.offsets,s=e.position,a=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,l=e.isFixed,p=!0===u?(m=(g=i).x,y=g.y,g=window.devicePixelRatio||1,{x:b(m*g)/g||0,y:b(y*g)/g||0}):"function"==typeof u?u(i):i,f=p.x,d=void 0===f?0:f,h=p.y,e=void 0===h?0:h,m=i.hasOwnProperty("x"),y=i.hasOwnProperty("y"),g=M,u=j,f=window;c&&(p="clientHeight",h="clientWidth",(i=S(t))===v(t)&&"static"!==E(i=w(t)).position&&"absolute"===s&&(p="scrollHeight",h="scrollWidth"),r!==j&&(r!==M&&r!==L||o!==O)||(u=C,e-=(l&&f.visualViewport?f.visualViewport.height:i[p])-n.height,e*=a?1:-1),r!==M&&(r!==j&&r!==C||o!==O)||(g=L,d-=(l&&f.visualViewport?f.visualViewport.width:i[h])-n.width,d*=a?1:-1));var c=Object.assign({position:s},c&&se);return a?Object.assign({},c,((a={})[u]=y?"0":"",a[g]=m?"0":"",a.transform=(f.devicePixelRatio||1)<=1?"translate("+d+"px, "+e+"px)":"translate3d("+d+"px, "+e+"px, 0)",a)):Object.assign({},c,((c={})[u]=y?e+"px":"",c[g]=m?d+"px":"",c.transform="",c))}var ce={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,e=void 0===(r=n.gpuAcceleration)||r,r=void 0===(r=n.adaptive)||r,n=void 0===(n=n.roundOffsets)||n,o=E(t.elements.popper).transitionProperty||"";r&&["transform","top","right","bottom","left"].some(function(e){return 0<=o.indexOf(e)})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',"\n\n",'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.","\n\n","We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" ")),e={placement:W(t.placement),variation:Y(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:e,isFixed:"fixed"===t.options.strategy},null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ae(Object.assign({},e,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:n})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ae(Object.assign({},e,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:n})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var ue={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var o=e.state;Object.keys(o.elements).forEach(function(e){var t=o.styles[e]||{},n=o.attributes[e]||{},r=o.elements[e];a(r)&&c(r)&&(Object.assign(r.style,t),Object.keys(n).forEach(function(e){var t=n[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var r=e.state,o={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(r.elements.popper.style,o.popper),r.styles=o,r.elements.arrow&&Object.assign(r.elements.arrow.style,o.arrow),function(){Object.keys(r.elements).forEach(function(e){var t=r.elements[e],n=r.attributes[e]||{},e=Object.keys((r.styles.hasOwnProperty(e)?r.styles:o)[e]).reduce(function(e,t){return e[t]="",e},{});a(t)&&c(t)&&(Object.assign(t.style,e),Object.keys(n).forEach(function(e){t.removeAttribute(e)}))})}},requires:["computeStyles"]};var le={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var s=e.state,t=e.options,n=e.name,a=void 0===(r=t.offset)?[0,0]:r,e=I.reduce(function(e,t){var n,r,o,i;return e[t]=(n=t,r=s.rects,o=a,i=W(n),t=0<=[M,j].indexOf(i)?-1:1,o=(o=(n="function"==typeof o?o(Object.assign({},r,{placement:n})):o)[0])||0,n=((n=n[1])||0)*t,0<=[M,L].indexOf(i)?{x:n,y:o}:{x:o,y:n}),e},{}),r=(t=e[s.placement]).x,t=t.y;null!=s.modifiersData.popperOffsets&&(s.modifiersData.popperOffsets.x+=r,s.modifiersData.popperOffsets.y+=t),s.modifiersData[n]=e}},pe={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,function(e){return pe[e]})}var de={start:"end",end:"start"};function he(e){return e.replace(/start|end/g,function(e){return de[e]})}var me={name:"flip",enabled:!0,phase:"main",fn:function(e){var n=e.state,t=e.options,r=e.name;if(!n.modifiersData[r]._skip){for(var o=t.mainAxis,i=void 0===o||o,e=t.altAxis,s=void 0===e||e,o=t.fallbackPlacements,a=t.padding,c=t.boundary,u=t.rootBoundary,l=t.altBoundary,e=t.flipVariations,p=void 0===e||e,f=t.allowedAutoPlacements,e=n.options.placement,t=W(e),t=o||(t===e||!p?[fe(e)]:function(e){if(W(e)===B)return[];var t=fe(e);return[he(e),t,he(t)]}(e)),d=[e].concat(t).reduce(function(e,t){return e.concat(W(t)===B?function(n,e){var t=(e=void 0===e?{}:e).placement,r=e.boundary,o=e.rootBoundary,i=e.padding,s=e.flipVariations,a=void 0===(e=e.allowedAutoPlacements)?I:e,c=Y(t),t=c?s?N:N.filter(function(e){return Y(e)===c}):D;0===(s=t.filter(function(e){return 0<=a.indexOf(e)})).length&&(s=t,console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var u=s.reduce(function(e,t){return e[t]=ne(n,{placement:t,boundary:r,rootBoundary:o,padding:i})[W(t)],e},{});return Object.keys(u).sort(function(e,t){return u[e]-u[t]})}(n,{placement:t,boundary:c,rootBoundary:u,padding:a,flipVariations:p,allowedAutoPlacements:f}):t)},[]),h=n.rects.reference,m=n.rects.popper,y=new Map,g=!0,v=d[0],b=0;b<d.length;b++){var w=d[b],E=W(w),O=Y(w)===F,A=0<=[j,C].indexOf(E),x=A?"width":"height",k=ne(n,{placement:w,boundary:c,rootBoundary:u,altBoundary:l,padding:a}),A=A?O?L:M:O?C:j;h[x]>m[x]&&(A=fe(A));O=fe(A),x=[];if(i&&x.push(k[E]<=0),s&&x.push(k[A]<=0,k[O]<=0),x.every(function(e){return e})){v=w,g=!1;break}y.set(w,x)}if(g)for(var _=p?3:1;0<_;_--)if("break"===function(t){var e=d.find(function(e){e=y.get(e);if(e)return e.slice(0,t).every(function(e){return e})});if(e)return v=e,"break"}(_))break;n.placement!==v&&(n.modifiersData[r]._skip=!0,n.placement=v,n.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ye(e,t,n){return _(e,T(t,n))}var ge={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t,n,r,o=e.state,i=e.options,s=e.name,a=i.mainAxis,c=void 0===a||a,u=void 0!==(x=i.altAxis)&&x,l=i.boundary,p=i.rootBoundary,f=i.altBoundary,d=i.padding,h=void 0===(k=i.tether)||k,m=i.tetherOffset,y=void 0===m?0:m,g=ne(o,{boundary:l,rootBoundary:p,padding:d,altBoundary:f}),v=W(o.placement),b=Y(o.placement),w=!b,E="x"===(r=Z(v))?"y":"x",O=o.modifiersData.popperOffsets,A=o.rects.reference,e=o.rects.popper,x="number"==typeof(a="function"==typeof y?y(Object.assign({},o.rects,{placement:o.placement})):y)?{mainAxis:a,altAxis:a}:Object.assign({mainAxis:0,altAxis:0},a),k=o.modifiersData.offset?o.modifiersData.offset[o.placement]:null,i={x:0,y:0};O&&(c&&(m="y"===r?"height":"width",p=(t=O[r])+g[l="y"===r?j:M],n=t-g[d="y"===r?C:L],f=h?-e[m]/2:0,y=(b===F?A:e)[m],a=b===F?-e[m]:-A[m],c=o.elements.arrow,b=h&&c?P(c):{width:0,height:0},l=(c=o.modifiersData["arrow#persistent"]?o.modifiersData["arrow#persistent"].padding:Q())[l],d=c[d],b=ye(0,A[m],b[m]),l=w?A[m]/2-f-b-l-x.mainAxis:y-b-l-x.mainAxis,a=w?-A[m]/2+f+b+d+x.mainAxis:a+b+d+x.mainAxis,d=(b=o.elements.arrow&&S(o.elements.arrow))?"y"===r?b.clientTop||0:b.clientLeft||0:0,b=t+a-(a=null!=(b=null==k?void 0:k[r])?b:0),n=ye(h?T(p,t+l-a-d):p,t,h?_(n,b):n),O[r]=n,i[r]=n-t),u&&(n="y"==E?"height":"width",u=(t=O[E])+g["x"===r?j:M],g=t-g["x"===r?C:L],r=-1!==[j,M].indexOf(v),k=null!=(v=null==k?void 0:k[E])?v:0,v=r?u:t-A[n]-e[n]-k+x.altAxis,k=r?t+A[n]+e[n]-k-x.altAxis:g,g=h&&r?(x=ye(v,x=t,r=k),r<x?r:x):ye(h?v:u,t,h?k:g),O[E]=g,i[E]=g-t),o.modifiersData[s]=i)},requiresIfExists:["offset"]};var ve={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n,r=e.state,o=e.name,i=e.options,s=r.elements.arrow,a=r.modifiersData.popperOffsets,c=W(r.placement),u=Z(c),l=0<=[M,L].indexOf(c)?"height":"width";s&&a&&(t=i.padding,n=r,e=ee("number"!=typeof(t="function"==typeof t?t(Object.assign({},n.rects,{placement:n.placement})):t)?t:te(t,D)),c=P(s),i="y"===u?j:M,n="y"===u?C:L,t=r.rects.reference[l]+r.rects.reference[u]-a[u]-r.rects.popper[l],a=a[u]-r.rects.reference[u],s=(s=S(s))?"y"===u?s.clientHeight||0:s.clientWidth||0:0,i=e[i],n=s-c[l]-e[n],n=ye(i,a=s/2-c[l]/2+(t/2-a/2),n),r.modifiersData[o]=((o={})[u]=n,o.centerOffset=n-a,o))},effect:function(e){var t=e.state;null!=(e=void 0===(e=e.options.element)?"[data-popper-arrow]":e)&&("string"==typeof e&&!(e=t.elements.popper.querySelector(e))||(a(e)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" ")),z(t.elements.popper,e)?t.elements.arrow=e:console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "))))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function be(e,t,n){return{top:e.top-t.height-(n=void 0===n?{x:0,y:0}:n).y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function we(t){return[j,L,C,M].some(function(e){return 0<=t[e]})}var Ee={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=ne(t,{elementContext:"reference"}),e=ne(t,{altBoundary:!0}),r=be(s,r),e=be(e,o,i),o=we(r),i=we(e);t.modifiersData[n]={referenceClippingOffsets:r,popperEscapeOffsets:e,isReferenceHidden:o,hasPopperEscaped:i},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":o,"data-popper-escaped":i})}},Oe=t({defaultModifiers:[n,s,ce,ue]}),Ae=[n,s,ce,ue,le,me,ge,ve,Ee],xe=t({defaultModifiers:Ae});e.applyStyles=ue,e.arrow=ve,e.computeStyles=ce,e.createPopper=xe,e.createPopperLite=Oe,e.defaultModifiers=Ae,e.detectOverflow=ne,e.eventListeners=n,e.flip=me,e.hide=Ee,e.offset=le,e.popperGenerator=t,e.popperOffsets=s,e.preventOverflow=ge,Object.defineProperty(e,"__esModule",{value:!0})});var __extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),__spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||((r=r||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};!function(a){var c,e=(c=Stimulus.Application,__extends(n,c),n.prototype.load=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=Array.isArray(e)?e:__spreadArray([e],t,!0),o=0,i=r;o<i.length;o++){var s=i[o],s=/^s-/.test(s.identifier);if(a._initializing&&!s)throw'Stacks-created Stimulus controller names must start with "s-".';if(!a._initializing&&s)throw'The "s-" prefix on Stimulus controller names is reserved for Stacks-created controllers.'}c.prototype.load.call(this,r)},n.start=function(e,t){t=new n(e,t);return t.start(),t},n);function n(){return null!==c&&c.apply(this,arguments)||this}a.application=e.start(),a._initializing=!0;var t,u=(t=Stimulus.Controller,__extends(r,t),r.prototype.getElementData=function(e,t){return e.getAttribute("data-"+this.identifier+"-"+t)},r.prototype.setElementData=function(e,t,n){e.setAttribute("data-"+this.identifier+"-"+t,n)},r.prototype.removeElementData=function(e,t){e.removeAttribute("data-"+this.identifier+"-"+t)},r.prototype.triggerEvent=function(t,n,e){var r,t=this.identifier+":"+t;try{r=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n})}catch(e){(r=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n)}return(e||this.element).dispatchEvent(r),r},r);function r(){return null!==t&&t.apply(this,arguments)||this}function o(e){var t,n,r,o,i=e.hasOwnProperty("targets")?(__extends(a,r=u),(t=a).targets=e.targets,t):(__extends(s,n=u),s);function s(){return null!==n&&n.apply(this,arguments)||this}function a(){return null!==r&&r.apply(this,arguments)||this}for(o in e)"targets"!==o&&e.hasOwnProperty(o)&&Object.defineProperty(i.prototype,o,Object.getOwnPropertyDescriptor(e,o));return i}a.StacksController=u,a.createController=o,a.addController=function(e,t){a.application.register(e,o(t))}}(Stacks=Stacks||{});__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();!function(e){var t,n=(t=e.StacksController,__extends(r,t),r.prototype.copy=function(){this.sourceTarget.select(),document.execCommand("copy")},r.targets=["source"],r);function r(){return null!==t&&t.apply(this,arguments)||this}e.CopyController=n}(Stacks=Stacks||{}),Stacks.application.register("s-copy",Stacks.CopyController);__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();!function(){var r="s-expandable-control:radio-off";function t(n){var e=n.target;e instanceof HTMLInputElement&&"INPUT"===e.nodeName&&"radio"===e.type&&document.querySelectorAll('input[type="radio"][name="'+e.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,o=0;function i(e){e?1===++o&&document.body.addEventListener("change",t):0===--o&&document.body.removeEventListener("change",t)}function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.lastKeydownClickTimestamp=0,e}Stacks.application.register("s-expandable-control",(n=Stacks.StacksController,__extends(e,n),e.prototype.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)},e.prototype._isCollapsedForClickable=function(){var e=this.controlledCollapsibles;return 0<e.length?!e.every(function(e){return e.classList.contains("is-expanded")}):"false"===this.element.getAttribute("aria-expanded")},e.prototype._isCollapsedForCheckable=function(){return!this.element.checked},Object.defineProperty(e.prototype,"controlledCollapsibles",{get:function(){var e=this.element.getAttribute("aria-controls");if(!e)throw'[aria-controls="targetId1 ... targetIdN"] attribute required';e=e.split(/\s+/g).map(function(e){return document.getElementById(e)}).filter(function(e){return!!e});if(!e.length)throw"couldn't find controls";return e},enumerable:!1,configurable:!0}),e.prototype._dispatchShowHideEvent=function(e){this.triggerEvent(e?"show":"hide")},e.prototype._toggleClass=function(t){if(this.data.has("toggle-class")){var n=this.element.classList,e=this.data.get("toggle-class");if(!e)throw"couldn't find toggle class";e.split(/\s+/).forEach(function(e){n.toggle(e,!!t)})}},e.prototype.listener=function(e){var t;if(this.isCheckable)t=!this.element.checked;else{if("keydown"==e.type&&e instanceof KeyboardEvent&&13!=e.keyCode&&32!=e.keyCode)return;if(e.target!==e.currentTarget&&0<=["A","BUTTON"].indexOf(e.target.nodeName))return;if(e.preventDefault(),"keydown"==e.type)this.lastKeydownClickTimestamp=Date.now();else if("click"==e.type&&Date.now()-this.lastKeydownClickTimestamp<300)return;t="true"===this.element.getAttribute("aria-expanded"),"click"===e.type&&this.element.blur()}this.element.setAttribute("aria-expanded",t?"false":"true");for(var n=0,r=this.controlledCollapsibles;n<r.length;n++)r[n].classList.toggle("is-expanded",!t);this._dispatchShowHideEvent(!t),this._toggleClass(!t)},e.prototype.connect=function(){var t=this;if(this.events.forEach(function(e){t.element.addEventListener(e,t.listener)},this),this.isRadio&&i(!0),this.element.setAttribute("aria-expanded",this.isCollapsed()?"false":"true"),this.isCheckable){var e=this.controlledCollapsibles;if(e.length){var n=!this.isCollapsed();if(e.some(function(e){return e.classList.contains("is-expanded")!==n})){for(var r=0,o=this.controlledCollapsibles;r<o.length;r++)o[r].classList.toggle("is-expanded",n);this._dispatchShowHideEvent(n),this._toggleClass(n)}}}},e.prototype.disconnect=function(){var t=this;this.events.forEach(function(e){t.element.removeEventListener(e,t.listener)},this),this.isRadio&&i(!1)},e))}();__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}(),__spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||((r=r||Array.prototype.slice.call(t,0,o))[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};!function(n){var e,t=(e=n.StacksController,__extends(r,e),r.prototype.connect=function(){this.validate()},r.prototype.disconnect=function(){this.unbindDocumentEvents()},r.prototype.toggle=function(e){this._toggle(void 0,e=void 0===e?null:e)},r.prototype.show=function(e){this._toggle(!0,e=void 0===e?null:e)},r.prototype.hide=function(e){this._toggle(!1,e=void 0===e?null:e)},r.prototype.validate=function(){var e=this.data.get("return-element");if(e&&(this.returnElement=document.querySelector(e),!this.returnElement))throw"Unable to find element by return-element selector: "+e},r.prototype._toggle=function(e,t){var n=this;void 0===t&&(t=null);var r,o=e,e="false"===this.modalTarget.getAttribute("aria-hidden");(o=void 0===o?!e:o)&&e||!o&&!e||(r=this.getDispatcher(t),(t=this.triggerEvent(o?"show":"hide",{returnElement:this.returnElement,dispatcher:this.getDispatcher(r)},this.modalTarget)).defaultPrevented||(this.returnElement=t.detail.returnElement,this.modalTarget.setAttribute("aria-hidden",o?"false":"true"),o?(this.bindDocumentEvents(),this.focusInsideModal()):(this.unbindDocumentEvents(),this.focusReturnElement(),this.removeModalOnHide()),void 0!==this.modalTarget.ontransitionend?this.modalTarget.addEventListener("transitionend",function(){n.triggerEvent(o?"shown":"hidden",{dispatcher:r},n.modalTarget)},{once:!0}):this.triggerEvent(o?"shown":"hidden",{dispatcher:r},this.modalTarget)))},r.prototype.focusReturnElement=function(){var e=this;this.returnElement&&this.modalTarget.addEventListener("s-modal:hidden",function(){e.returnElement&&document.body.contains(e.returnElement)&&e.returnElement.focus()},{once:!0})},r.prototype.removeModalOnHide=function(){var e=this;"true"===this.data.get("remove-when-hidden")&&this.modalTarget.addEventListener("s-modal:hidden",function(){e.element.remove()},{once:!0})},r.prototype.getAllTabbables=function(){return Array.from(this.modalTarget.querySelectorAll("[href], input, select, textarea, button, [tabindex]")).filter(function(e){return e.matches(":not([disabled]):not([tabindex='-1'])")})},r.prototype.firstVisible=function(e){return e.find(function(e){return null!==e.offsetParent})},r.prototype.lastVisible=function(e){return this.firstVisible(__spreadArray([],e,!0).reverse())},r.prototype.focusInsideModal=function(){var t=this;this.modalTarget.addEventListener("s-modal:shown",function(){var e=null!==(e=t.firstVisible(t.initialFocusTargets))&&void 0!==e?e:t.firstVisible(t.getAllTabbables());null!=e&&e.focus()},{once:!0})},r.prototype.keepFocusWithinModal=function(e){var t,n;this.modalTarget.contains(e.target)?"Tab"===e.key&&(t=this.getAllTabbables(),n=this.firstVisible(t),t=this.lastVisible(t),n&&t&&(n===t?(e.preventDefault(),n.focus()):e.shiftKey&&e.target===n?(e.preventDefault(),t.focus()):e.shiftKey||e.target!==t||(e.preventDefault(),n.focus()))):(n=this.firstVisible(this.getAllTabbables()))&&(e.preventDefault(),n.focus())},r.prototype.bindDocumentEvents=function(){this._boundClickFn=this._boundClickFn||this.hideOnOutsideClick.bind(this),this._boundKeypressFn=this._boundKeypressFn||this.hideOnEscapePress.bind(this),this._boundTabTrap=this._boundTabTrap||this.keepFocusWithinModal.bind(this),document.addEventListener("mousedown",this._boundClickFn),document.addEventListener("keyup",this._boundKeypressFn),document.addEventListener("keydown",this._boundTabTrap)},r.prototype.unbindDocumentEvents=function(){document.removeEventListener("mousedown",this._boundClickFn),document.removeEventListener("keyup",this._boundKeypressFn),document.removeEventListener("keydown",this._boundTabTrap)},r.prototype.hideOnOutsideClick=function(e){var t=e.target;!this.modalTarget.querySelector(".s-modal--dialog").contains(t)&&document.body.contains(t)&&this._toggle(!1,e)},r.prototype.hideOnEscapePress=function(e){27===e.which&&"true"!==this.modalTarget.getAttribute("aria-hidden")&&this._toggle(!1,e)},r.prototype.getDispatcher=function(e){return(e=void 0===e?null:e)instanceof Event?e.target:e instanceof Element?e:this.element},r.targets=["modal","initialFocus"],r);function r(){return null!==e&&e.apply(this,arguments)||this}function o(e,t){e=n.application.getControllerForElementAndIdentifier(e,"s-modal");if(!e)throw"Unable to get s-modal controller from element";t?e.show():e.hide()}n.ModalController=t,n.showModal=function(e){o(e,!0)},n.hideModal=function(e){o(e,!1)}}(Stacks=Stacks||{}),Stacks.application.register("s-modal",Stacks.ModalController);__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();!function(e){var r,t=(r=e.StacksController,__extends(n,r),n.prototype.connect=function(){r.prototype.connect.call(this),this.boundSelectTab=this.selectTab.bind(this),this.boundHandleKeydown=this.handleKeydown.bind(this);for(var e=0,t=this.tabTargets;e<t.length;e++){var n=t[e];n.addEventListener("click",this.boundSelectTab),n.addEventListener("keydown",this.boundHandleKeydown)}},n.prototype.disconnect=function(){r.prototype.disconnect.call(this);for(var e=0,t=this.tabTargets;e<t.length;e++){var n=t[e];n.removeEventListener("click",this.boundSelectTab),n.removeEventListener("keydown",this.boundHandleKeydown)}},Object.defineProperty(n.prototype,"tabTargets",{get:function(){return Array.from(this.element.querySelectorAll("[role=tab]"))},enumerable:!1,configurable:!0}),n.prototype.selectTab=function(e){this.switchToTab(e.currentTarget)},n.prototype.handleKeydown=function(e){var t=e.currentTarget,n=this.tabTargets,r=n.indexOf(t);if("ArrowRight"===e.key)r++;else{if("ArrowLeft"!==e.key)return;r--}t=n[r=(r=r<0?n.length-1:r)>=n.length?0:r],this.switchToTab(t),null!==(t=this.selectedTab)&&void 0!==t&&t.focus()},n.prototype.switchToTab=function(e){var t=this.selectedTab;t!==e&&(this.triggerEvent("select",{oldTab:t,newTab:e}).defaultPrevented||(this.selectedTab=e,this.triggerEvent("selected",{oldTab:t,newTab:e})))},Object.defineProperty(n.prototype,"selectedTab",{get:function(){return this.tabTargets.find(function(e){return"true"===e.getAttribute("aria-selected")})||null},set:function(e){for(var t=0,n=this.tabTargets;t<n.length;t++){var r=n[t],o=r.getAttribute("aria-controls"),o=o?document.getElementById(o):null;r===e?(r.classList.add("is-selected"),r.setAttribute("aria-selected","true"),r.removeAttribute("tabindex"),null!=o&&o.classList.remove("d-none")):(r.classList.remove("is-selected"),r.setAttribute("aria-selected","false"),r.setAttribute("tabindex","-1"),null!=o&&o.classList.add("d-none"))}},enumerable:!1,configurable:!0}),n);function n(){return null!==r&&r.apply(this,arguments)||this}e.TabListController=t}(Stacks=Stacks||{}),Stacks.application.register("s-navigation-tablist",Stacks.TabListController);__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();!function(o){var e,t=(e=o.StacksController,__extends(n,e),Object.defineProperty(n.prototype,"isVisible",{get:function(){var e=this.popoverElement;return!!e&&e.classList.contains("is-visible")},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isInViewport",{get:function(){var e=this.popoverElement;if(!this.isVisible||!e)return!1;var t=e.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight),e=Math.max(document.documentElement.clientWidth,window.innerWidth);return 0<t.bottom&&t.top<n&&0<t.right&&t.left<e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"shouldHideOnOutsideClick",{get:function(){switch(this.data.get("hide-on-outside-click")){case"after-dismissal":case"never":return!1;case"if-in-viewport":return this.isInViewport;default:return!0}},enumerable:!1,configurable:!0}),n.prototype.connect=function(){e.prototype.connect.call(this),this.validate(),this.isVisible?this.initializePopper():"true"===this.data.get("auto-show")&&this.show(null),this.data.delete("auto-show")},n.prototype.disconnect=function(){this.hide(),this.popper&&(this.popper.destroy(),delete this.popper),e.prototype.disconnect.call(this)},n.prototype.toggle=function(e){void 0===e&&(e=null),this.isVisible?this.hide(e):this.show(e)},n.prototype.show=function(e){void 0===e&&(e=null),this.isVisible||(e=this.getDispatcher(e),this.triggerEvent("show",{dispatcher:e}).defaultPrevented||(this.popper||this.initializePopper(),this.popoverElement.classList.add("is-visible"),this.scheduleUpdate(),this.shown(e)))},n.prototype.hide=function(e){void 0===e&&(e=null),this.isVisible&&(e=this.getDispatcher(e),this.triggerEvent("hide",{dispatcher:e}).defaultPrevented||(this.popoverElement.classList.remove("is-visible"),this.popper&&(this.popper.destroy(),delete this.popper),"after-dismissal"===this.data.get("hide-on-outside-click")&&this.data.delete("hide-on-outside-click"),this.hidden(e)))},n.prototype.shown=function(e){void 0===e&&(e=null),this.bindDocumentEvents(),this.triggerEvent("shown",{dispatcher:e})},n.prototype.hidden=function(e){void 0===e&&(e=null),this.unbindDocumentEvents(),this.triggerEvent("hidden",{dispatcher:e})},n.prototype.generatePopover=function(){return null},n.prototype.initializePopper=function(){this.popper=Popper.createPopper(this.referenceElement,this.popoverElement,{placement:this.data.get("placement")||"bottom",modifiers:[{name:"offset",options:{offset:[0,10]}},{name:"arrow",options:{element:".s-popover--arrow"}}]})},n.prototype.validate=function(){var e=this.data.get("reference-selector");if(this.referenceElement=this.element,e&&(this.referenceElement=this.element.querySelector(e),!this.referenceElement))throw"Unable to find element by reference selector: "+e;var t=this.referenceElement.getAttribute(this.popoverSelectorAttribute),e=null;if(t){if(!(e=document.getElementById(t)))throw"[".concat(this.popoverSelectorAttribute,'="{POPOVER_ID}"] required')}else e=this.generatePopover();if(!e)throw"unable to find or generate popover element";this.popoverElement=e},n.prototype.getDispatcher=function(e){return(e=void 0===e?null:e)instanceof Event?e.target:e instanceof Element?e:this.element},n.prototype.scheduleUpdate=function(){this.popper&&this.isVisible&&this.popper.update()},n);function n(){return null!==e&&e.apply(this,arguments)||this}o.BasePopoverController=t;var r,t=(__extends(i,r=t),i.prototype.shown=function(e){void 0===e&&(e=null),this.toggleOptionalClasses(!0),r.prototype.shown.call(this,e)},i.prototype.hidden=function(e){void 0===e&&(e=null),this.toggleOptionalClasses(!1),r.prototype.hidden.call(this,e)},i.prototype.bindDocumentEvents=function(){this.boundHideOnOutsideClick=this.boundHideOnOutsideClick||this.hideOnOutsideClick.bind(this),this.boundHideOnEscapePress=this.boundHideOnEscapePress||this.hideOnEscapePress.bind(this),document.addEventListener("mousedown",this.boundHideOnOutsideClick),document.addEventListener("keyup",this.boundHideOnEscapePress)},i.prototype.unbindDocumentEvents=function(){document.removeEventListener("mousedown",this.boundHideOnOutsideClick),document.removeEventListener("keyup",this.boundHideOnEscapePress)},i.prototype.hideOnOutsideClick=function(e){var t=e.target;this.shouldHideOnOutsideClick&&!this.referenceElement.contains(t)&&!this.popoverElement.contains(t)&&document.body.contains(t)&&this.hide(e)},i.prototype.hideOnEscapePress=function(e){27===e.which&&this.isVisible&&(this.popoverElement.contains(e.target)&&this.referenceElement.focus(),this.hide(e))},i.prototype.toggleOptionalClasses=function(t){var n;this.data.has("toggle-class")&&(n=this.referenceElement.classList,this.data.get("toggle-class").split(/\s+/).forEach(function(e){n.toggle(e,t)}))},i.targets=[],i);function i(){var e=null!==r&&r.apply(this,arguments)||this;return e.popoverSelectorAttribute="aria-controls",e}function s(e){var t=(null===(r=e.getAttribute("data-controller"))||void 0===r?void 0:r.includes("s-popover"))||!1,n=o.application.getControllerForElementAndIdentifier(e,"s-popover"),r=e.getAttribute("data-s-popover-reference-selector"),r=r?e.querySelector(r):e,e=r?r.getAttribute("aria-controls"):null;return{isPopover:t,controller:n,referenceElement:r,popover:e?document.getElementById(e):null}}function a(e,t,n){var r=new Set(null===(r=e.getAttribute("data-controller"))||void 0===r?void 0:r.split(/\s+/));n?r.add(t):r.delete(t),e.setAttribute("data-controller",Array.from(r).join(" "))}o.PopoverController=t,o.showPopover=function(e){var t=s(e),n=t.isPopover;if(t=t.controller)t.show();else{if(!n)throw'element does not have data-controller="s-popover"';e.setAttribute("data-s-popover-auto-show","true")}},o.hidePopover=function(e){var t=(r=s(e)).isPopover,n=r.controller,r=r.popover;if(n)n.hide();else{if(!t)throw'element does not have data-controller="s-popover"';e.removeAttribute("data-s-popover-auto-show"),r&&r.classList.remove("is-visible")}},o.attachPopover=function(e,t,n){var r=s(e),o=r.referenceElement;if(r=r.popover)throw'element already has popover with id="'.concat(r.id,'"');if(!o)throw"element has invalid data-s-popover-reference-selector attribute";if("string"==typeof t){var i=document.createRange().createContextualFragment(t).children;if(1!==i.length)throw"popover should contain a single element";t=i[0]}if(r=o.getAttribute("aria-controls"),i=t.id,!t.classList.contains("s-popover"))throw'popover should have the "s-popover" class but had class="'.concat(t.className,'"');if(r&&r!==i)throw'element has aria-controls="'.concat(r,'" but popover has id="').concat(i,'"');i||(i="--stacks-s-popover-"+Math.random().toString(36).substring(2,10),t.id=i),r||o.setAttribute("aria-controls",i),!t.parentElement&&e.parentElement&&o.insertAdjacentElement("afterend",t),a(e,"s-popover",!0),n&&(n.toggleOnClick&&o.setAttribute("data-action","click->s-popover#toggle"),n.placement&&e.setAttribute("data-s-popover-placement",n.placement),n.autoShow&&e.setAttribute("data-s-popover-auto-show","true"))},o.detachPopover=function(e){var t=(o=s(e)).isPopover,n=o.controller,r=o.referenceElement,o=o.popover;return null!=n&&n.hide(),null!=o&&o.remove(),t&&(a(e,"s-popover",!1),r&&r.removeAttribute("aria-controls")),o}}(Stacks=Stacks||{}),Stacks.application.register("s-popover",Stacks.PopoverController);__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();!function(){var e,t;function n(){return null!==t&&t.apply(this,arguments)||this}function p(e,t){for(var n=[],r=e.children[0],o=[],i=[];r||i.some(function(e){return 0!==e});){var s=[];n.push(s);var a=0;if(r)for(var c=0;c<r.children.length;c++){for(;i[a];)i[a]--,s[a]=o[a],a++;var u=r.children[c];if(!(u instanceof HTMLTableCellElement))throw"invalid table";if("none"!==getComputedStyle(u).display){if(u===t)return a;for(var l=a+u.colSpan;a<l;a++)i[a]=u.rowSpan-1,o[a]=u,s[a]=u}}for(;a<o.length;)i[a]&&(i[a]--,s[a]=o[a]),a++;r=r&&r.nextElementSibling}return t?-1:n}Stacks.application.register("s-table",(t=Stacks.StacksController,__extends(n,t),n.prototype.setCurrentSort=function(n,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 t=e===n;e.classList.toggle("is-sorted",t&&"none"!==r),e.querySelectorAll(".js-sorting-indicator").forEach(function(e){e.classList.toggle("d-none",!e.classList.contains("js-sorting-indicator-"+(t?r:"none")))}),t&&"none"!==r?o.setElementData(e,"sort-direction",r):o.removeElementData(e,"sort-direction")})},n.prototype.sort=function(e){var o=this,t=e.currentTarget;if(!(t instanceof HTMLTableCellElement))throw"invalid event target";var i,n,r,s,a,c,e=this.element,u=e.tBodies[0],l=function(e){if(!(e.parentElement&&e.parentElement.parentElement instanceof HTMLTableSectionElement))throw"invalid table";e=p(e.parentElement.parentElement,e);if("number"==typeof e)return e;throw"shouldn't happen"}(t);l<0||(i=function(e){e=p(e);if(e instanceof Array)return e;throw"shouldn't happen"}(u),n="asc"===this.getElementData(t,"sort-direction")?-1:1,r=Array.from(e.tBodies[0].rows),s=!1,a=[],r.forEach(function(e,t){var n,r=o.getElementData(e,"sort-to");"top"!==r&&("bottom"!==r?(n=i[t][l])?(""!==(n="string"==typeof(r=o.getElementData(n,"sort-val"))?r:n.textContent.trim())&&parseInt(n,10)+""!==n&&(s=!0),a.push([n,t])):a.push(["",t]):c=c||e)}),s||a.forEach(function(e){e[0]=""===e[0]?Number.MIN_VALUE:parseInt(e[0],10)}),a.sort(function(e,t){return e[0]>t[0]?n:e[0]<t[0]?-1*n:e[1]>t[1]?1:-1}),a.forEach(function(e){e=r[e[1]];e.parentElement.removeChild(e),c?u.insertBefore(e,c):u.appendChild(e)}),this.setCurrentSort(t,1==n?"asc":"desc"))},(e=n).targets=["column"],e))}();__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();!function(n){var r,e=(r=n.BasePopoverController,__extends(o,r),o.prototype.connect=function(){r.prototype.connect.call(this),window.matchMedia("(hover: hover)").matches&&this.bindMouseEvents()},o.prototype.disconnect=function(){this.unbindMouseEvents(),r.prototype.disconnect.call(this)},o.prototype.show=function(e){void 0===e&&(e=null);var t=n.application.getControllerForElementAndIdentifier(this.element,"s-popover");t&&t.isVisible||r.prototype.show.call(this,e)},o.prototype.scheduleShow=function(e){var t=this;void 0===e&&(e=null),window.clearTimeout(this.activeTimeout),this.activeTimeout=window.setTimeout(function(){return t.show(e)},300)},o.prototype.hide=function(e){void 0===e&&(e=null),window.clearTimeout(this.activeTimeout),this.activeTimeout=null,r.prototype.hide.call(this,e)},o.prototype.applyTitleAttributes=function(){var e,t=this.data.get("html-title");if(t)e=document.createRange().createContextualFragment(t);else{var n=this.element.getAttribute("title");if(!n)return null;e=document.createTextNode(n)}this.data.delete("html-title"),this.element.removeAttribute("title");t=this.element.getAttribute("aria-describedby");t||(t=o.generateId(),this.element.setAttribute("aria-describedby",t));n=document.getElementById(t);n||((n=document.createElement("div")).id=t,n.className="s-popover s-popover__tooltip pe-none",n.setAttribute("aria-hidden","true"),n.setAttribute("role","tooltip"),(r=this.element.parentNode)?r.insertBefore(n,this.element.nextSibling):document.body.appendChild(n));var r=n.querySelector(".s-popover--arrow");return n.innerHTML="",n.appendChild(e),r?n.appendChild(r):n.insertAdjacentHTML("beforeend",'<div class="s-popover--arrow"></div>'),this.scheduleUpdate(),n},o.prototype.bindDocumentEvents=function(){this.boundHideIfWithin=this.boundHideIfWithin||this.hideIfWithin.bind(this),document.addEventListener("s-popover:shown",this.boundHideIfWithin)},o.prototype.unbindDocumentEvents=function(){document.removeEventListener("s-popover:shown",this.boundHideIfWithin)},o.prototype.generatePopover=function(){return this.applyTitleAttributes()},o.prototype.hideIfWithin=function(e){e.target.contains(this.referenceElement)&&this.hide()},o.prototype.bindMouseEvents=function(){this.boundScheduleShow=this.boundScheduleShow||this.scheduleShow.bind(this),this.boundHide=this.boundHide||this.hide.bind(this),this.referenceElement.addEventListener("mouseover",this.boundScheduleShow),this.referenceElement.addEventListener("mouseout",this.boundHide),this.referenceElement.addEventListener("focus",this.boundScheduleShow),this.referenceElement.addEventListener("blur",this.boundHide)},o.prototype.unbindMouseEvents=function(){this.referenceElement.removeEventListener("mouseover",this.boundScheduleShow),this.referenceElement.removeEventListener("mouseout",this.boundHide),this.referenceElement.removeEventListener("focus",this.boundScheduleShow),this.referenceElement.removeEventListener("blur",this.boundHide)},o.generateId=function(){return"--stacks-s-tooltip-"+Math.random().toString(36).substring(2,10)},o.targets=[],o);function o(){var e=null!==r&&r.apply(this,arguments)||this;return e.popoverSelectorAttribute="aria-describedby",e}function i(e,t){t&&t.placement&&e.setAttribute("data-s-tooltip-placement",t.placement);t=n.application.getControllerForElementAndIdentifier(e,"s-tooltip");t?t.applyTitleAttributes():e.setAttribute("data-controller",e.getAttribute("data-controller")+" s-tooltip")}n.TooltipController=e,n.setTooltipHtml=function(e,t,n){e.setAttribute("data-s-tooltip-html-title",t),e.removeAttribute("title"),i(e,n)},n.setTooltipText=function(e,t,n){e.setAttribute("title",t),e.removeAttribute("data-s-tooltip-html-title"),i(e,n)}}(Stacks=Stacks||{}),Stacks.application.register("s-tooltip",Stacks.TooltipController);var Stacks,__extends=this&&this.__extends||function(){var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}}();!function(e){var t,n=(t=e.StacksController,__extends(s,t),s.prototype.connect=function(){t.prototype.connect.call(this),this.boundDragEnter=this.handleUploaderActive.bind(this,!0),this.boundDragLeave=this.handleUploaderActive.bind(this,!1),this.inputTarget.addEventListener("dragenter",this.boundDragEnter),this.inputTarget.addEventListener("dragleave",this.boundDragLeave)},s.prototype.disconnect=function(){this.inputTarget.removeEventListener("dragenter",this.boundDragEnter),this.inputTarget.removeEventListener("dragleave",this.boundDragLeave),t.prototype.disconnect.call(this)},s.prototype.handleInput=function(){var n,r=this;this.previewsTarget.innerHTML="",this.inputTarget.files&&(n=this.inputTarget.files.length,this.getDataURLs(this.inputTarget.files,s.FILE_DISPLAY_LIMIT).then(function(e){var t;r.handleVisible(!0),1<e.length?((t=document.createElement("div")).classList.add("s-uploader--previews-heading"),t.innerText=e.length<n?"Showing ".concat(e.length," of ").concat(n," files"):"".concat(n," items"),r.previewsTarget.appendChild(t),r.previewsTarget.classList.add("has-multiple")):r.previewsTarget.classList.remove("has-multiple"),e.forEach(function(e){return r.addFilePreview(e)}),r.handleUploaderActive(!0)}))},s.prototype.reset=function(){this.inputTarget.value="",this.previewsTarget.innerHTML="",this.handleVisible(!1)},s.prototype.handleVisible=function(e){var t=this.targets.scope,n=t.findAllElements("[data-s-uploader-hide-on-input]"),r=t.findAllElements("[data-s-uploader-show-on-input]"),t=t.findAllElements("[data-s-uploader-enable-on-input]");e?(n.map(function(e){return e.classList.add("d-none")}),r.map(function(e){return e.classList.remove("d-none")}),t.map(function(e){return e.removeAttribute("disabled")})):(n.map(function(e){return e.classList.remove("d-none")}),r.map(function(e){return e.classList.add("d-none")}),t.map(function(e){return e.setAttribute("disabled","true")}),this.handleUploaderActive(!1))},s.prototype.addFilePreview=function(e){var t,n;e&&(t=document.createElement("div"),e.type.match("image/*")&&e.data?((n=document.createElement("img")).src=e.data.toString(),n.alt=e.name):(n=document.createElement("div")).innerText=e.name,n.classList.add("s-uploader--preview-thumbnail"),t.appendChild(n),t.classList.add("s-uploader--preview"),t.setAttribute("data-filename",e.name),this.previewsTarget.appendChild(t))},s.prototype.handleUploaderActive=function(e){this.uploaderTarget.classList.toggle("is-active",e)},s.prototype.fileToDataURL=function(e){var r=new FileReader,o=e.name,t=e.size,i=e.type;return t<s.MAX_FILE_SIZE&&-1<i.indexOf("image")?new Promise(function(t,n){r.onload=function(e){e=null===(e=null==e?void 0:e.target)||void 0===e?void 0:e.result;e?t({data:e,name:o,type:i}):n()},r.readAsDataURL(e)}):Promise.resolve({name:o,type:i})},s.prototype.getDataURLs=function(e,t){var n=this,e=Array.from(e).slice(0,Math.min(t,e.length)).map(function(e){return n.fileToDataURL(e)});return Promise.all(e)},s.targets=["input","previews","uploader"],s.FILE_DISPLAY_LIMIT=10,s.MAX_FILE_SIZE=10485760,s);function s(){return null!==t&&t.apply(this,arguments)||this}e.UploaderController=n}(Stacks=Stacks||{}),Stacks.application.register("s-uploader",Stacks.UploaderController),Stacks._initializing=!1;
@@ -188,6 +188,11 @@
188
188
  .bc-white-3,
189
189
  .bc-white { border-color: var(--white) !important; }
190
190
 
191
+ .highcontrast-mode({
192
+ .bc-white-1 { border-color: var(--black-025) !important; }
193
+ .bc-white-2 { border-color: var(--black-050) !important; }
194
+ });
195
+
191
196
  // $$ BLACK
192
197
  // ----------------------------------------------------------------------------
193
198
  .bc-black-025 { border-color: var(--black-025) !important; }
@@ -216,6 +221,19 @@
216
221
  .bc-black-10, // Deprecated
217
222
  .bc-black-900 { border-color: var(--black-900) !important; }
218
223
 
224
+ .highcontrast-mode({
225
+ .bc-black-025,
226
+ .bc-black-1, // Deprecated
227
+ .bc-black-050,
228
+ .bc-black-2, // Deprecated
229
+ .bc-black-075,
230
+ .bc-black-3, // Deprecated
231
+ .bc-black-100,
232
+ .bc-black-150,
233
+ .bc-black-4, // Deprecated
234
+ .bc-black-200 { border-color: var(--black-300) !important; }
235
+ });
236
+
219
237
  // $$ ORANGE
220
238
  // ----------------------------------------------------------------------------
221
239
  .bc-orange-050 { border-color: var(--orange-050) !important; }
@@ -44,7 +44,6 @@
44
44
  // all child elements will automatically be sized.
45
45
  // ----------------------------------------------------------------------------
46
46
  .create-flex-count-cols(@num, @count: 1) when (@count =< @num) {
47
- .flex__allcells@{count},
48
47
  .flex__allitems@{count} {
49
48
  > .d-flex,
50
49
  > .flex--item {
@@ -101,7 +100,7 @@
101
100
  //
102
101
  // ----------------------------------------------------------------------------
103
102
  .flex-fixed-item-spacing(@spacing, @num, @count: 1) when (@count =< @num) {
104
- @item-width: (@count * 100% / @num);
103
+ @itemWidth: (@count * 100% / @num);
105
104
 
106
105
  > .flex--item@{count} {
107
106
  margin: (@spacing / 2);
@@ -117,11 +116,9 @@
117
116
  // and max-width here to account for gutters.
118
117
  // ------------------------------------------------------------------------
119
118
  > .flex--item@{count}, // [1]
120
- &.flex__allcells@{count} > .d-flex, // [2]
121
119
  &.flex__allitems@{count} > .d-flex, // [2]
122
- &.flex__allcells@{count} > .flex--item, // [2]
123
120
  &.flex__allitems@{count} > .flex--item { // [2]
124
- flex-basis: calc(~"@{item-width} - @{spacing}");
121
+ flex-basis: calc(~"@{itemWidth} - @{spacing}");
125
122
  }
126
123
 
127
124
  #stacks-internals #flex-builder-helpers .flex-fixed-item-spacing(@spacing, @num, (@count + 1));
@@ -160,7 +157,6 @@
160
157
  // -- UNIVERSAL FLEX WIDTHS
161
158
  // This applies a flex value it to all of a flex's direct children.
162
159
  // --------------------------------------------------------------------------
163
- .flex__fl0,
164
160
  .flex__fl-shrink0 {
165
161
  &,
166
162
  > .d-flex,
@@ -177,7 +173,6 @@
177
173
  }
178
174
  }
179
175
 
180
- .flex__fl1,
181
176
  .flex__fl-grow1 {
182
177
  &,
183
178
  > .d-flex,
@@ -20,6 +20,8 @@
20
20
  // When this is available in flex layouts, this can be separated
21
21
  // into its own section and documentation
22
22
  // ----------------------------------------------------------------------------
23
+ #stacks-internals #responsify('.g0', { gap: 0 });
24
+ #stacks-internals #responsify('.g1', { gap: @su1 });
23
25
  #stacks-internals #responsify('.g2', { gap: @su2 });
24
26
  #stacks-internals #responsify('.g4', { gap: @su4; });
25
27
  #stacks-internals #responsify('.g6', { gap: @su6; });