sproutjs-core 2.5.0 → 2.6.0
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.
- package/package.json +1 -1
- package/sprout-core.js +4005 -1800
- package/sprout-core.js.map +1 -1
- package/sprout-core.min.js +1 -1
- package/sprout-core.min.js.gz +0 -0
- package/sprout-core.min.js.map +1 -1
- package/sprout-core.strict.js +3885 -0
- package/sprout-core.strict.js.map +1 -0
- package/sprout-core.strict.min.js +2 -0
- package/sprout-core.strict.min.js.map +1 -0
- package/sprout_core.js +0 -2575
- package/sprout_core.js.map +0 -1
package/sprout-core.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var t=["hidden","checked"],e=["hidden","value","checked"],n=["value","checked"],r=[null,"text","color","date","datetime-local","email","month","number","password","range","search","tel","time","url","week"],o=["_global","_gettingDependenciesFor","_localStateManager","_stateManager","_binding","_populate","_isActive"],i="getGlobalState",a=function(t){return"State set hook, must include a dependencies array! None was found for ".concat(t)},l=[{class:HTMLAnchorElement,element:"a"},{class:HTMLAreaElement,element:"area"},{class:HTMLAudioElement,element:"audio"},{class:HTMLBodyElement,element:"body"},{class:HTMLBRElement,element:"br"},{class:HTMLButtonElement,element:"button"},{class:HTMLCanvasElement,element:"canvas"},{class:HTMLDataElement,element:"data"},{class:HTMLDataListElement,element:"datalist"},{class:HTMLDetailsElement,element:"details"},{class:HTMLDialogElement,element:"dialog"},{class:HTMLDivElement,element:"div"},{class:HTMLDListElement,element:"dl"},{class:HTMLEmbedElement,element:"embed"},{class:HTMLFieldSetElement,element:"fieldset"},{class:HTMLFormElement,element:"form"},{class:HTMLHRElement,element:"hr"},{class:HTMLHtmlElement,element:"html"},{class:HTMLIFrameElement,element:"iframe"},{class:HTMLImageElement,element:"img"},{class:HTMLInputElement,element:"input"},{class:HTMLLabelElement,element:"label"},{class:HTMLLegendElement,element:"legend"},{class:HTMLLIElement,element:"li"},{class:HTMLLinkElement,element:"link"},{class:HTMLMapElement,element:"map"},{class:HTMLMetaElement,element:"meta"},{class:HTMLMeterElement,element:"meter"},{class:HTMLObjectElement,element:"object"},{class:HTMLOListElement,element:"ol"},{class:HTMLOptGroupElement,element:"optgroup"},{class:HTMLOptionElement,element:"option"},{class:HTMLParagraphElement,element:"p"},{class:HTMLPictureElement,element:"picture"},{class:HTMLPreElement,element:"pre"},{class:HTMLProgressElement,element:"progress"},{class:HTMLQuoteElement,element:"blockquote"},{class:HTMLQuoteElement,element:"q"},{class:HTMLSelectElement,element:"select"},{class:HTMLSourceElement,element:"source"},{class:HTMLSpanElement,element:"span"},{class:HTMLTableElement,element:"table"},{class:HTMLTableCellElement,element:"td"},{class:HTMLTableCellElement,element:"th"},{class:HTMLTableRowElement,element:"tr"},{class:HTMLTableSectionElement,element:"thead"},{class:HTMLTableSectionElement,element:"tbody"},{class:HTMLTableSectionElement,element:"tfoot"},{class:HTMLTextAreaElement,element:"textarea"},{class:HTMLTimeElement,element:"time"},{class:HTMLTitleElement,element:"title"},{class:HTMLTrackElement,element:"track"},{class:HTMLUListElement,element:"ul"},{class:HTMLVideoElement,element:"video"},{class:HTMLSlotElement,element:"slot"}],u=!1,c=document.createElement("div"),s={nodeActionsMap:new Map,eventBindingFunctions:new Map,conditionalRenders:new Map,paintRafId:null,eventBindRafId:null,conditionalRenderRafId:null,activateRafId:null,elementActivateFunctions:new Map},f=["=","==","!=","!==","<","<=",">",">="],p=100;function h(t){return"OL"===t.tagName||"UL"===t.tagName}var y=s.paintRafId,d=s.eventBindingFunctions,v=s.eventBindRafId,b=s.conditionalRenderRafId,m=s.conditionalRenders,g=s.nodeActionsMap;s.activateRafId,s.elementActivateFunctions;function w(){g.size<p&&(y&&cancelAnimationFrame(y),y=null),y||(y=requestAnimationFrame((function(){y=null,function(){var t=s.nodeActionsMap;if(t.size){var e=function(){var t=[],e=[],n=s.nodeActionsMap;return n.forEach((function(n,r){if(n.hasOwnProperty("setAttribute")){var o=n.setAttribute;"boolean"==typeof o?(r.hasOwnProperty("originalOwnerElement"),!1===o?r.originalOwnerElement.hasAttribute(r.name)&&t.push((function(){r.originalOwnerElement.removeAttributeNode(r)})):r.originalOwnerElement.hasAttribute(r.name)||t.push((function(){r.originalOwnerElement.setAttributeNode(r)}))):"string"==typeof o&&r.nodeValue!==o&&t.push((function(){return r.nodeValue=o}))}else if(n.hasOwnProperty("textContent")){var i=String(n.textContent);if(r.nodeValue===i)return;e.push((function(){return r.nodeValue=i}))}else if(n.switch)e.push((function(){return r.replaceWith(n.switch)}));else{n.replace.forEach((function(t,n){e.push((function(){return r.replaceChild(t,n)}))}));var a,l=O(n.remove.values());try{for(l.s();!(a=l.n()).done;){var u,c=O(a.value);try{var s=function(){var t=u.value;t.parentNode&&t.parentNode===r&&e.push((function(){return r.removeChild(t)}))};for(c.s();!(u=c.n()).done;)s()}catch(t){c.e(t)}finally{c.f()}}}catch(t){l.e(t)}finally{l.f()}var f,p=O(n.append.values());try{for(p.s();!(f=p.n()).done;){var h,y=O(f.value);try{var d=function(){var t=h.value;e.push((function(){return r.appendChild(t)}))};for(y.s();!(h=y.n()).done;)d()}catch(t){y.e(t)}finally{y.f()}}}catch(t){p.e(t)}finally{p.f()}}})),[].concat(t,e)}();e.forEach((function(t){return t()})),s.nodeActionsMap=new Map}}()})))}function S(t,e){m.set(t,e),m.size<p&&(b&&cancelAnimationFrame(b),b=null),b||(b=requestAnimationFrame((function(){b=null,m.forEach((function(t){return t()})),m.clear()})))}function O(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=E(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function E(t,e){if(t){if("string"==typeof t)return A(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(t,e):void 0}}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function P(t,e,n){t.nodeType===Node.ATTRIBUTE_NODE?e.setAttribute=n:t.nodeType===Node.TEXT_NODE&&(e.textContent=n)}function j(t,e,n){t.append.has(n)||t.append.set(n,new Set),t.append.get(n).add(e)}function M(){return{append:new Map,replace:new Map,after:new Map,remove:new Map,switch:null,get hasPendingActions(){return null!==this.switch||this.append.size||this.replace.size||this.after.size||this.remove.size}}}function T(t,e){var n=this,r=s.nodeActionsMap,o=t.state[e],i=t.stateNodes[e],a=t.stateArrayMaps[e],l=t.conditionallyRenderingElements[e];if(i&&i.forEach((function(t){r.has(t)||r.set(t,{}),P(t,r.get(t),o)})),a){var u=o;a.forEach((function(t,e){var n=M(),o=-1,i=h(e);e.children.length&&Array.prototype.forEach.call(e.children,(function(r,a){var l,c=r;i&&(c=r.firstElementChild);var s,f,p,y=u[a];if(null!==(l=y)&&void 0!==l&&l.hasOwnProperty("state")&&(y=y.state),y){if(c.state!==y){var d=H(y,t,h(e)?"li":void 0);!function(t,e,n){t.replace.set(e,n)}(n,r,d)}}else f=r,(s=n).remove.has(p)||s.remove.set(p,new Set),s.remove.get(p).add(f);o=a}));for(var a=++o,l=u.length;a<l;a++){var c=u[a];if(c){var s=H(c,t,h(e)?"li":void 0);j(n,s,c)}}n.hasPendingActions&&r.set(e,n)}))}l&&l.forEach((function(t){S(n,(function(){return t.render()}))})),r.size&&w()}function _(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object.defineProperty(t,e,{value:n,configurable:!1,writable:!1,enumerable:r})}function L(t){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L(t)}function k(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return C(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}"undefined"==typeof HTMLElement||Object.defineProperty(globalThis,"elementSetAttribute",{value:HTMLElement.prototype.setAttribute,writable:!1,configurable:!1});var R=function(e,n){t.includes(e)?"false"===n?this.removeAttribute(e):elementSetAttribute.call(this,e,""):elementSetAttribute.call(this,e,n)},x=function(t,e){var n=null;if(-1!==e.indexOf(":")&&0===e.indexOf("is_")){var r=e.indexOf(":");if(-1===r)throw Error("When using conditional equality state attribute, you must include a colon character followed by an equality value!");n=e.substring(r+1),e=e.substring(3,r)}var o=k(this.getState(e,!0),2),i=o[0],a=o[1];if(void 0!==i&&a){if(n){var l="is_"+e+n,u=e;Object.defineProperty(a,l,{get:function(){return this[u]===n},enumerable:!1}),a._stateManager.addStateDependency(e,l),i=a[l],e=l}var c=i;this.removeAttribute(t);var s=document.createAttribute(t);s.nodeValue=c,_(s,"isStateAttribute",!0),_(s,"originalOwnerElement",this),"boolean"==typeof c&&(s.nodeValue=""),!1!==c&&this.setAttributeNode(s),a._stateManager.addStateNode(e,s,"boolean"==typeof c)}},N=function(t){var e=k(this.getState(t,!0),2),n=e[0],r=e[1];if(null!=n&&r){var o=n,i=document.createTextNode(o);_(i,"isStateAttribute",!0),this.appendChild(i),r._stateManager.addStateNode(t,i)}};function H(t,e,n){var r,o=document.createElement(e);return o.setInitialState(t),n?(r=document.createElement(n)).appendChild(o):r=o,r}function I(t,e){if(!o.includes(e)){T(t,e);var n=t.state;n.hasOwnProperty("on_".concat(e,"Change"))&&"function"==typeof n["on_".concat(e,"Change")]&&n["on_".concat(e,"Change")].call(n);var r=t.stateDependencies[e];if(r&&r.forEach((function(e){if(0===e.indexOf("set_")){var r=e.substring(4),o=n[e][0];if(o&&"function"==typeof o)return void(n[r]=o.call(n))}T(t,e),n.hasOwnProperty("on".concat(e,"Change"))&&"function"==typeof n["on".concat(e,"Change")]&&n["on".concat(e,"Change")].call(n)})),!n._global){var i=t.globalStateDependencies[e];null==i||i.forEach((function(t,e){var r=e.state;t.forEach((function(t){if(0===t.indexOf("set_")){var o=t.substring(4),i=n[t][0];if(i&&"function"==typeof i)return void(r[o]=i.call(r))}T(e,t),n.hasOwnProperty("on".concat(t,"Change"))&&"function"==typeof n["on".concat(t,"Change")]&&r["on".concat(t,"Change")].call(r)}))}))}}}function D(t){return function(t){if(Array.isArray(t))return B(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||F(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,e)||F(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(t,e){if(t){if("string"==typeof t)return B(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?B(t,e):void 0}}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function W(t,e,n){var r=$(n.getState(t,!0),2),o=r[0],i=r[1];if(!o||!Array.isArray(o))return null;var a=function(t,e,n){return t.map((function(t){return t.hasOwnProperty("state")&&(t=t.state),"object"!==L(t)?{}:H(t,e,n)}))}(o,e,h(n)?"li":void 0);return n.innerHTML="",a.length&&n.append.apply(n,D(a)),i}var G={map:function(t){var e=$(t.split(":"),2),n=e[0],r=e[1],o=W(n,r,this);o&&o._stateManager.addStateMap(n,r,this)},text:function(t){var e=t;this.initialSetText(e)},bind:function(t){var o=this,i=$(t.split(":"),2),a=i[0],l=i[1];a&&l&&(!a in e||(this.bindAttributeToState(a,l),n.includes(a)&&("value"===a&&"INPUT"===this.tagName&&r.includes(this.getAttribute("type"))?this.addEventListener("input",(function(){return o.updateStateFromProperty("value")})):"checked"===a&&"INPUT"===this.tagName&&"checkbox"===this.getAttribute("type")&&this.addEventListener("change",(function(){return o.updateStateFromProperty("checked")})))))}};function U(t){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},U(t)}function q(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,e)||z(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(t,e){if(t){if("string"==typeof t)return V(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?V(t,e):void 0}}function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Q(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,nt(r.key),r)}}function Y(t,e,n){return e=J(e),function(t,e){if(e&&("object"==U(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,X()?Reflect.construct(e,n||[],J(t).constructor):e.apply(t,n))}function X(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(X=function(){return!!t})()}function J(t){return J=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},J(t)}function K(t,e){return K=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},K(t,e)}function Z(t,e,n){tt(t,e),e.set(t,n)}function tt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function et(t,e,n){return(e=nt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function nt(t){var e=function(t,e){if("object"!=U(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=U(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==U(e)?e:e+""}function rt(t,e,n){return t.set(it(t,e),n),n}function ot(t,e){return t.get(it(t,e))}function it(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function at(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,o=new WeakMap,a=new WeakMap,l=new WeakMap,u=new WeakSet,c=function(t){function e(){var t,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var i=arguments.length,c=new Array(i),s=0;s<i;s++)c[s]=arguments[s];return t=Y(this,e,[].concat(c)),tt(n=t,r=u),r.add(n),et(t,"host",null),Z(t,o,void 0),Z(t,a,!1),Z(t,l,{}),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&K(t,e)}(e,t),n=e,c=[{key:"bindAttributeToState",value:function(t,e){ot(l,this)[t]=e}},{key:"unbindAttributeToState",value:function(t){delete ot(l,this)[t]}},{key:"updateStateFromProperty",value:function(t){var e=this[t],n=ot(l,this)[t],r=q(this.getState(n,!0),2),o=r[0],i=r[1];o!==e&&(i[n]=e)}},{key:"disconnectedCallback",value:function(){var t;ot(o,this)&&this.removeEventListener("change",ot(o,this));var e=null!==(t=this.host)&&void 0!==t?t:this;if(e.ref){var n=this.getAttribute("ref");n&&(delete e.ref[n],delete e.events[n])}rt(l,this,{})}},{key:"activate",value:function(){var t=this;"INPUT"===(null==this?void 0:this.tagName)&&(rt(o,this,(function(){var t=new Event("inputChange",{bubbles:!0,composed:!0});this.dispatchEvent(t)})),this.addEventListener("change",ot(o,this),!1));var e,n=[],r=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=z(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}(this.getAttributeNames());try{for(r.s();!(e=r.n()).done;){var i=e.value,a=this.getAttribute(i);if(this.initialSetAttribute(i,a),0===i.indexOf("_")){var l=i.substring(1);n.push({command:l,args:a})}}}catch(t){r.e(t)}finally{r.f()}n.forEach((function(e){var n,r=e.command,o=e.args;null===(n=G[r])||void 0===n||n.call(t,o)}))}},{key:"connectedCallback",value:function(){var t=this;ot(a,this)||(this.host=this.getRootNode().host,this.host?this.host.addEventListener("connected",(function(){return t.activate()})):queueMicrotask((function(){return t.activate()})),rt(a,this,!0))}},{key:"attributeChangedCallback",value:function(t,e,n){if(e!==n&&this.isConnected)if("ref"!==t){if(t in ot(l,this))it(u,this,s).call(this,t);else if(0===t.indexOf("@")){var r=t.substring(1),o=this.getAttributeNode(t);o.nodeValue=this.host.getAttribute(r),this.host.propAttributes.has(r)||this.host.propAttributes.set(r,new Set),this.host.propAttributes.get(r).add(o)}}else{var i=n;(this.isNativeElement?this.host:this).ref[i]=this}}},{key:"getState",value:function(t){var e,n,o,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.isNativeElement&&this.host?this.host:this;l&&l.state&&(n=null===(o=l.state)||void 0===o?void 0:o[t]);for(var u,c=!1;void 0===n&&void 0!==l.host&&null!==l.host;){var s;n=null===(s=(l=l.host).state)||void 0===s?void 0:s[t]}return void 0!==n?e=l.state:void 0!==(n=null===(u=c=r[i]())||void 0===u?void 0:u[t])&&(e=c),a?[n,e]:n}},{key:"findElement",value:function(t){var e=this.host||this,n=e;return r.SPROUT_CONFIG.useShadow&&(n=e.shadowRoot),e.ref.hasOwnProperty(t)?e.ref[t]:n.querySelector('[ref="'.concat(t,'"]'))}},{key:"initialSetText",value:function(t){N.call(this,t)}},{key:"initialSetAttribute",value:function(t,e){var n=e=String(e);if(0===e.indexOf("$")&&this.isConnected){var r=e.substring(1);x.call(this,t,r)}else R.call(this,t,n)}}],c&&Q(n.prototype,c),f&&Q(n,f),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,c,f}(n);function s(e){var n=this.getAttribute(e);t.includes(e)&&(n=null!==n);var r=ot(l,this)[e],o=q(this.getState(r,!0),2),i=o[0],a=o[1];i!==n&&(a[r]=n)}return et(c,"observedAttributes",["ref"].concat(e).concat(Object.keys(G).map((function(t){return"_"+t.toLowerCase()})))),c}function lt(t){return function(t){if(Array.isArray(t))return ut(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ut(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ut(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ut(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ct(t){return ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ct(t)}function st(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,bt(r.key),r)}}function ft(t,e){if(e&&("object"==ct(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function pt(){return pt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=vt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},pt.apply(null,arguments)}function ht(t){var e="function"==typeof Map?new Map:void 0;return ht=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(yt())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&dt(o,n.prototype),o}(t,arguments,vt(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),dt(n,t)},ht(t)}function yt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(yt=function(){return!!t})()}function dt(t,e){return dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},dt(t,e)}function vt(t){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vt(t)}function bt(t){var e=function(t,e){if("object"!=ct(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=ct(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ct(e)?e:e+""}var mt=function(t){function e(t,n,r){var o,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var l=a.SPROUT_CONFIG.stateManagerClass;if(!Array.isArray(t))throw Error("Argument for StateFulArray constructor must be an array!");var u,c,s,f,p=t;return i||(u=p.map((function(t,e){return null!=t&&t.hasOwnProperty("state")||Array.isArray(t)?t:"object"===ct(t)?new l(t,r,n._stateManager,!1,a):t}))),c=this,s=e,f=lt(u),s=vt(s),function(t,e,n){(e=bt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(o=ft(c,yt()?Reflect.construct(s,f||[],vt(c).constructor):s.apply(c,f)),"dependencyProps",new Map),o.parentStateObject=n,o.arrayStateProp=r,o.rawArray=p,ft(o,u=new Proxy(o,St(null==n?void 0:n._stateManager,r,a)))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&dt(t,e)}(e,t),n=e,r=[{key:"splice",value:function(){var t;this.$$operation="splice";for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=(t=pt(vt(e.prototype),"splice",this)).call.apply(t,[this].concat(r));return delete this.$$operation,i}},{key:"shift",value:function(){var t;this.$$operation="shift";for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=(t=pt(vt(e.prototype),"shift",this)).call.apply(t,[this].concat(r));return delete this.$$operation,i}},{key:"unshift",value:function(){var t;this.$$operation="splice";for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=(t=pt(vt(e.prototype),"unshift",this)).call.apply(t,[this].concat(r));return delete this.$$operation,i}},{key:"sort",value:function(){var t;this.$$operation="sort";for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=(t=pt(vt(e.prototype),"sort",this)).call.apply(t,[this].concat(r));return delete this.$$operation,I(this.parentStateObject._stateManager,this.arrayStateProp),i}},{key:"reverse",value:function(){var t;this.$$operation="reverse";for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=(t=pt(vt(e.prototype),"reverse",this)).call.apply(t,[this].concat(r));return delete this.$$operation,I(this.parentStateObject._stateManager,this.arrayStateProp),i}},{key:"fill",value:function(){var t;this.$$operation="fill";for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=(t=pt(vt(e.prototype),"fill",this)).call.apply(t,[this].concat(r));return delete this.$$operation,I(this.parentStateObject._stateManager,this.arrayStateProp),i}},{key:"copyWithin",value:function(){var t;this.$$operation="copyWithin";for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=(t=pt(vt(e.prototype),"sort",this)).call.apply(t,[this].concat(r));return delete this.$$operation,I(this.parentStateObject._stateManager,this.arrayStateProp),i}},{key:"slice",value:function(){var t;this.$$operation="slice";for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=(t=pt(vt(e.prototype),"slice",this)).call.apply(t,[this].concat(r));return delete this.$$operation,i}},{key:"toArray",value:function(){this.$$operation="toArray";var t=this.rawArray;return delete this.$$operation,t}}],o=[{key:Symbol.species,get:function(){return Array}}],r&&st(n.prototype,r),o&&st(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(ht(Array));const gt=mt;function wt(t){return wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wt(t)}var St=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,r=n.SPROUT_CONFIG.stateManagerClass;return{set:function(o,i,a){if("length"===i){var l=Reflect.set(o,i,a);return t.setDirtyProp(e),l}if(o[i]===a)return!0;var u=Number(i);if(!isNaN(u)&&("object"!==wt(a)||a.hasOwnProperty("_stateManager")||a.hasOwnProperty("state")||(a=new r(a,e,t,!1,n)),a.hasOwnProperty("_stateManager")&&(a=a._stateManager),!o.hasOwnProperty("$$operation"))){var c=!1;u<o.length&&(c=!0);var s=Reflect.set(o,i,a);return c&&t.setDirtyProp(e),s}return Reflect.set(o,i,a)},get:function(t,e,n){var r=Number(e);if(!isNaN(r)){if(!t[r])return;return t[r].hasOwnProperty("state")?t[r].state:t[r]}return Reflect.get.apply(Reflect,arguments)}}},Ot=function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;return{defineProperty:function(o,i,a){if(void 0!==(null==a?void 0:a.value)){var l,u=a.value;if(Array.isArray(u))null!=u&&null!==(l=u[0])&&void 0!==l&&l._stateManager||(a.value=new gt(a.value,e,n,!1,r));else"object"===wt(u)&&(a.value=new Proxy(a.value,t(e,n,r)))}else"function"==typeof(null==a?void 0:a.get)&&a.get.call(o);var c=Reflect.defineProperty(o,i,a);return e._stateManager.setDirtyProp(n),c}}},Et=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;return{defineProperty:function(n,r,i){var l;if(o.includes(r)||null!==(l=n)&&void 0!==l&&l._binding)return Reflect.defineProperty.apply(Reflect,arguments);var u,c=n,s=new Set;if(n=new Proxy(n,{get:function(t,e,n){return"_global"===e&&(t._global._gettingDependenciesFor=r,t._global._localStateManager=t._stateManager),o.includes(e)||(Array.isArray(t[e])&&(t[e]._gettingDependenciesFor=r),s.add(e)),Reflect.get.apply(Reflect,arguments)}}),void 0!==(null==i?void 0:i.value)){var f,p=i.value;if(Array.isArray(p))if(0===r.indexOf("set_")){if(!(null==p?void 0:p[1]))throw Error(a(r));if(null==p||p[1].forEach((function(t){s.add(t)})),!0===(null==p?void 0:p[2])){u=r.substring(4);var h=null==p?void 0:p[0];h&&"function"==typeof h&&(t[u]=h.call(t))}else null!=p&&p[3]&&(t[u]=p[3])}else null!=p&&null!==(f=p[0])&&void 0!==f&&f._stateManager||(i.value=new gt(i.value,t,r,!1,e));else"object"===wt(p)&&(i.value=new Proxy(i.value,Ot(t,r,e)))}else"function"==typeof(null==i?void 0:i.get)&&i.get.call(n);s.size&&s.forEach((function(e){return t._stateManager.addStateDependency(e,r)}));var y=Reflect.defineProperty(c,r,i),d=t._stateManager;return u&&(r=u),c.hasOwnProperty("_populate")||d.setDirtyProp(r),y},get:function(t,e,n){if("hasOwnProperty"===e)return Reflect.get.apply(Reflect,arguments);if(!t.hasOwnProperty("_global")&&t.hasOwnProperty("_gettingDependenciesFor"))return t._stateManager.addGlobalStateDependency(e,t._gettingDependenciesFor,t._localStateManager),delete t._gettingDependenciesFor,delete t._localStateManager,Reflect.get.apply(Reflect,arguments);if("function"==typeof(null==e?void 0:e.indexOf)&&0===(null==e?void 0:e.indexOf("!"))){var r=e.substring(1);if(t.hasOwnProperty(r))return!t[r]}return Reflect.get.apply(Reflect,arguments)}}};function At(t){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(t)}function Pt(t){return function(t){if(Array.isArray(t))return jt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return jt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Mt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Lt(r.key),r)}}function Tt(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function _t(t,e,n){return(e=Lt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lt(t){var e=function(t,e){if("object"!=At(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=At(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==At(e)?e:e+""}function kt(t,e,n){return t.set(Rt(t,e),n),n}function Ct(t,e){return t.get(Rt(t,e))}function Rt(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var xt=new WeakMap,Nt=function(){return t=function t(e,n,r){var a=this,l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:window;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),_t(this,"privateState",{}),_t(this,"state",{}),_t(this,"stateArrayMaps",{}),_t(this,"stateDependencies",{}),_t(this,"conditionallyRenderingElements",{}),_t(this,"stateNodes",{}),_t(this,"parentStateProp",void 0),_t(this,"parentStateManager",void 0),_t(this,"dirtyProps",new Set),Tt(this,xt,null),this.parentStateProp=n,this.parentStateManager=r,_(this.state,"_stateManager",this,!0),this.state=new Proxy(this.state,Et(this.state,u)),l?(this.globalStateDependencies={},this.addGlobalStateDependency=function(t,e,n){a.globalStateDependencies.hasOwnProperty(t)||(a.globalStateDependencies[t]=new Map),a.globalStateDependencies[t].has(n)||a.globalStateDependencies[t].set(n,new Set),a.globalStateDependencies[t].get(n).add(e)}):_(this.state,"_global",u[i](),!0),e&&function(t,e){t._populate=!0;var n,r=Object.getOwnPropertyDescriptors(e);for(var i in r)if(o.includes(i))delete r[i];else if((n=r[i]).hasOwnProperty("get")&&"function"==typeof n.get&&n.get.bind(t),n.hasOwnProperty("value")){var a=n.value;if("function"==typeof a)n.value.bind(t);else if(Array.isArray(a)&&0===i.indexOf("set_")){var l=null==a?void 0:a[0];l&&"function"==typeof l&&l.bind(t)}}Object.defineProperties(t,r),delete t._populate}(this.state,e),_(this.state,"_isActive",this,!0)},e=[{key:"setDirtyProp",value:function(t){var e=this;this.dirtyProps.add(t),Ct(xt,this)&&cancelAnimationFrame(Ct(xt,this)),kt(xt,this,requestAnimationFrame((function(){kt(xt,e,null),e.dirtyProps.size>0&&e.handleStateChanges()})))}},{key:"handleStateChanges",value:function(){var t=this,e=Pt(this.dirtyProps);this.dirtyProps.clear(),e.forEach((function(e){I(t,e)}))}},{key:"addStateDependency",value:function(t,e){this.stateDependencies.hasOwnProperty(t)||(this.stateDependencies[t]=new Set),this.stateDependencies[t].add(e)}},{key:"addStateMap",value:function(t,e,n){this.stateArrayMaps.hasOwnProperty(t)||(this.stateArrayMaps[t]=new Map),this.stateArrayMaps[t].set(n,e)}},{key:"addConditionallyRenderingElements",value:function(t,e){var n;this.conditionallyRenderingElements.hasOwnProperty(t)||(this.conditionallyRenderingElements[t]=new Set),e.originalParentElement=e.parentElement||(null===(n=e.host)||void 0===n?void 0:n.shadowRoot),this.conditionallyRenderingElements[t].add(e)}},{key:"addStateNode",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.stateNodes.hasOwnProperty(t)||(this.stateNodes[t]=new Set,this.setAndBindStateProperty(t,n)),this.stateNodes[t].add(e)}},{key:"setAndBindStateProperty",value:function(t){var e=this.state,n=t,r=0===t.indexOf("!");r&&(n=t.substring(1));var o=Object.getOwnPropertyDescriptor(e,n);if(!(o||(e=e._global,o=Object.getOwnPropertyDescriptor(e,n))))throw Error("Could not bind state prop ".concat(t,". State prop ").concat(n," not defined!"));e._binding=!0;var i=o.hasOwnProperty("value"),a=e._stateManager;if(r){var l=t;i?a.privateState.hasOwnProperty(l)||(Object.defineProperty(e,l,{get:function(){return!a.privateState[n]},set:function(){throw Error("Cannot directly set a negation State property!")},enumerable:!0}),a.addStateDependency(n,l)):a.state.hasOwnProperty(l)||(Object.defineProperty(e,l,{get:function(){return!a.state[n]},set:function(){throw Error("Cannot directly set a negation State property!")},enumerable:!0}),a.addStateDependency(n,l))}else i&&(a.privateState.hasOwnProperty(t)||(a.privateState[t]=e[t]),Object.defineProperty(e,t,{set:function(e){e!==a.privateState[t]&&(a.privateState[t]=e,I(a,t),a.parentStateManager&&I(a.parentStateManager,a.parentStateProp))},get:function(){return a.privateState[t]}}));delete this.state._binding}}],e&&Mt(t.prototype,e),n&&Mt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();const Ht=Nt;function It(t){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(t)}function Dt(){Dt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,a=Object.create(i.prototype),l=new L(r||[]);return o(a,"_invoke",{value:j(t,n,l)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function b(){}function m(){}function g(){}var w={};c(w,a,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(k([])));O&&O!==n&&r.call(O,a)&&(w=O);var E=g.prototype=b.prototype=Object.create(w);function A(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function n(o,i,a,l){var u=f(t[o],t,i);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==It(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,l)}),(function(t){n("throw",t,a,l)})):e.resolve(s).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,l)}))}l(u.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function j(e,n,r){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var l=r.delegate;if(l){var u=M(l,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=y;var c=f(e,n,r);if("normal"===c.type){if(o=r.done?d:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=d,r.method="throw",r.arg=c.arg)}}}function M(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,M(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function k(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(It(e)+" is not iterable")}return m.prototype=g,o(E,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:m,configurable:!0}),m.displayName=c(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},A(P.prototype),c(P.prototype,l,(function(){return this})),e.AsyncIterator=P,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new P(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(E),c(E,u,"Generator"),c(E,a,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=k,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(_),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return l.type="throw",l.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;_(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function $t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Ft(r.key),r)}}function Ft(t){var e=function(t,e){if("object"!=It(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=It(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==It(e)?e:e+""}function Bt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wt(t,e,n){return e=Ut(e),function(t,e){if(e&&("object"==It(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Gt()?Reflect.construct(e,n||[],Ut(t).constructor):e.apply(t,n))}function Gt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Gt=function(){return!!t})()}function Ut(t){return Ut=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ut(t)}function qt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zt(t,e)}function zt(t,e){return zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zt(t,e)}function Vt(t,e,n,r,o,i,a){try{var l=t[i](a),u=l.value}catch(t){return void n(t)}l.done?e(u):Promise.resolve(u).then(r,o)}function Qt(t,e){function n(){var e;return e=Dt().mark((function e(n,r,o){var i,a,l;return Dt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=document.importNode(n.content,!0),(a=i.querySelector("style"))&&i.removeChild(a),(l=i.querySelector("script"))&&i.removeChild(l),customElements.define(r,function(t){function e(){return Bt(this,e),Wt(this,e,[i,l,null==a?void 0:a.textContent,o])}return qt(e,t),n=e,r&&$t(n.prototype,r),u&&$t(n,u),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,u}(t.ReactiveCustomElement));case 6:case"end":return e.stop()}}),e)})),n=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(t){Vt(i,r,o,a,l,"next",t)}function l(t){Vt(i,r,o,a,l,"throw",t)}a(void 0)}))},n.apply(this,arguments)}var r,o;(o=document.querySelector('head > style[app="'.concat(e,'"]')))&&(r=new CSSStyleSheet).replaceSync(o.textContent),Array.prototype.forEach.call(document.querySelectorAll('template[app="'.concat(e,'"]')),(function(t){!function(t,e,r){n.apply(this,arguments)}(t,t.getAttribute("for"),r)})),"function"==typeof globalThis["".concat(e,"_runtime")]&&globalThis["".concat(e,"_runtime")].call(t)}function Yt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],u=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(t,e)||Jt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xt(t){return function(t){if(Array.isArray(t))return Kt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Jt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jt(t,e){if(t){if("string"==typeof t)return Kt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kt(t,e):void 0}}function Kt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Zt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,te(r.key),r)}}function te(t){var e=function(t,e){if("object"!=ce(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=ce(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ce(e)?e:e+""}function ee(t,e,n){return e=re(e),function(t,e){if(e&&("object"==ce(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ne()?Reflect.construct(e,n||[],re(t).constructor):e.apply(t,n))}function ne(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ne=function(){return!!t})()}function re(t){return re=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},re(t)}function oe(t,e){return oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},oe(t,e)}function ie(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function ae(t,e,n){return t.set(ue(t,e),n),n}function le(t,e){return t.get(ue(t,e))}function ue(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function ce(t){return ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ce(t)}function se(t){var e=new WeakMap,n=new WeakMap,r=new WeakMap,o=function(t){function o(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return ie(t=ee(this,o,[].concat(a)),e,void 0),ie(t,n,void 0),ie(t,r,!1),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&oe(t,e)}(o,t),i=o,a=[{key:"render",value:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=this.getState(le(e,this));if(void 0===o)throw Error("State value for ".concat(le(e,this)," not found while rendering conditional-render element:"),this);var i=[];le(n,this).forEach((function(t,e){(function(t,e){return"string"!==ce(t)?e===t:"always"===t||(f.includes(t[0])?new Function("return ".concat(e).concat(t))():e===t)})(e,o)&&i.push.apply(i,Xt(t))})),r?(this.innerHTML="",this.append.apply(this,i)):i.length&&S(this,(function(){t.innerHTML="",t.append.apply(t,i)}))}},{key:"connectedCallback",value:function(){if(this.host=this.getRootNode().host,!this.host)throw Error("<conditional-render> must be used as part of a custom element template! Cannot be used outside of a custom element.");if(!le(r,this)){var t=this.getAttribute("_condition");if(!t)throw Error("conditional-render elements must have a _condition command attribute");!this.children||this.children.length;var o=t;ae(e,this,o);var i=Yt(this.getState(o,!0),2),a=i[0],l=i[1];if(void 0===a)throw Error("State property ".concat(o," not defined for _condition command!"));var u=new Map;u.set("always",[]),Xt(this.children).forEach((function(t){var e,n,r=t.getAttribute("_if");if(r){var o=(n=e=r,"true"===e?n=!0:"false"===e?n=!1:isNaN(Number(e))||(n=Number(e)),n);u.has(o)||u.set(o,[]),u.get(o).push(t)}else u.get("always").push(t)})),ae(n,this,u),l._stateManager.addConditionallyRenderingElements(o,this),this.render(!0),ae(r,this,!0)}}}],a&&Zt(i.prototype,a),l&&Zt(i,l),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,a,l}(t);return o}function fe(t){return fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fe(t)}function pe(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return he(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?he(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function he(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ye(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Oe(r.key),r)}}function de(t,e){if(e&&("object"==fe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function ve(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ve=function(){return!!t})()}function be(t){return be=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},be(t)}function me(t,e){return me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},me(t,e)}function ge(t,e,n){we(t,e),e.set(t,n)}function we(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Se(t,e,n){return(e=Oe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oe(t){var e=function(t,e){if("object"!=fe(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=fe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==fe(e)?e:e+""}function Ee(t,e){return t.get(Pe(t,e))}function Ae(t,e,n){return t.set(Pe(t,e),n),n}function Pe(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function je(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,e=at(HTMLElement,t),n=t.SPROUT_CONFIG.stateManagerClass,r=new WeakMap,o=new WeakMap,a=new WeakMap,l=new WeakMap,u=new WeakMap,s=new WeakMap,f=new WeakMap,h=new WeakMap,y=new WeakMap,b=new WeakSet,m=function(e){function n(){var t,e,i,p,d=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,v=arguments.length>1?arguments[1]:void 0,m=arguments.length>2?arguments[2]:void 0,w=arguments.length>3?arguments[3]:void 0;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e=this,i=be(i=n),function(t,e){we(t,e),e.add(t)}(t=de(e,ve()?Reflect.construct(i,p||[],be(e).constructor):i.apply(e,p)),b),Se(t,"host",null),ge(t,r,!1),ge(t,o,void 0),ge(t,a,void 0),ge(t,l,void 0),ge(t,u,void 0),ge(t,s,void 0),ge(t,f,void 0),Se(t,"events",void 0),ge(t,h,[]),ge(t,y,void 0),Se(t,"propAttributes",new Map),"CONDITIONAL-ELEMENT"===t.tagName)return de(t);if(v){var S=new Function(v.textContent)();Pe(b,t,g).call(t,S)}if(m){var O=new CSSStyleSheet;O.replaceSync(m),Ae(s,t,O)}return w&&Ae(f,t,w),Ae(u,t,(null==d?void 0:d.cloneNode(!0))||c.cloneNode()),t.ref={},t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&me(t,e)}(n,e),m=n,(A=[{key:"setInitialState",value:function(t){this.initialState?Object.assign(this.initialState,t):this.initialState=t}},{key:"disconnectedCallback",value:function(){Pe(b,this,O).call(this),this.state=void 0}},{key:"activate",value:function(){var e,n,r,a=this,l=pe(this.getAttributeNames());try{for(l.s();!(e=l.n()).done;){var u=e.value,c=this.getAttribute(u);this.initialSetAttribute(u,c)}}catch(t){l.e(t)}finally{l.f()}n=this,r=function(){return Pe(b,a,E).call(a)},d.set(n,r),d.size<p&&(v&&cancelAnimationFrame(v),v=null),v||(v=requestAnimationFrame((function(){v=null,d.forEach((function(t){return t()})),d.clear()}))),Ee(o,this)&&queueMicrotask((function(){return Ee(o,a).call(a,t[i]())}))}},{key:"connectedCallback",value:function(){var e=this;Ee(r,this)||(this.host=this.getRootNode().host,Ee(a,this)&&Ee(a,this).call(this,t[i]()),Pe(b,this,S).call(this),Ee(l,this)&&Ee(l,this).call(this,t[i]()),queueMicrotask((function(){Pe(b,e,w).call(e),e.dispatchEvent(new CustomEvent("connected")),e.activate()})),Ae(r,this,!0))}},{key:"attributeChangedCallback",value:function(t,e,n){e!==n&&this.propAttributes.has(t)&&this.propAttributes.get(t).forEach((function(t){return t.nodeValue=n}))}}])&&ye(m.prototype,A),P&&ye(m,P),Object.defineProperty(m,"prototype",{writable:!1}),m;var m,A,P}(e);function g(t){t.events&&(this.events=t.events,this.isConnected&&Pe(b,this,E).call(this)),t.state&&(this.setInitialState(t.state),this.isConnected&&Pe(b,this,w).call(this)),t.onMount&&Ae(o,this,t.onMount),t.beforeRender&&Ae(a,this,t.beforeRender)}function w(){if(this.initialState){var e=this.initialState;e._stateManager?this.state=e._stateManager.state:this.state=new n(e,void 0,void 0,!1,t).state,delete this.initialState}}function S(){if(t.SPROUT_CONFIG.useShadow){var e=this.attachShadow({mode:"open"});this.shadowRoot.adoptedStyleSheets=[],Ee(f,this)&&this.shadowRoot.adoptedStyleSheets.push(Ee(f,this)),Ee(s,this)&&this.shadowRoot.adoptedStyleSheets.push(Ee(s,this)),e.appendChild(Ee(u,this))}else{var n=new DocumentFragment;n.appendChild(Ee(u,this)),this.appendChild(n)}}function O(){var t=this;if(Ee(h,this).length){var e=this;Ee(h,this).forEach((function(n){e.removeEventListener(n,Ee(y,t),!1)}))}}function E(){var e,n=this;if(this.events){var r=Object.keys(this.events),o={},a={};r.forEach((function(t){var e=n.events[t];if("function"==typeof e)o[t]=e;else if("object"===fe(e)){Object.keys(e).forEach((function(n){"click"===n?o[t]=e[n]:(a[n]||(a[n]={}),a[n][t]=e[n])}))}}));var l=t[i]();Ae(y,this,(function(t){var e,n=this,r=(performance.now(),t.composedPath());if(e=r?r.find((function(t){return t.hasAttribute&&t.hasAttribute("ref")&&t.getAttribute("ref")in n.events})):t.target.hasAttribute&&t.target.hasAttribute("ref")&&t.target.getAttribute("ref")in this.events?t.target:null){var o=e.getAttribute("ref"),i=t.type;if("click"===i){var a="function"==typeof this.events[o]?this.events[o]:null;null==a||a.call(e,t,t.target,l)}else{var u;null===(u=this.events[o][i])||void 0===u||u.call(e,t,t.target,l)}}}));Object.keys(o).length&&(this.addEventListener("click",Ee(y,this)),Ee(h,this).push("click"));for(var u=Object.keys(a),c=0,s=u;c<s.length;c++){var f=s[c];this.addEventListener(f,Ee(y,this))}(e=Ee(h,this)).push.apply(e,u)}}return m}function Me(t){return Me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Me(t)}function Te(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_e(r.key),r)}}function _e(t){var e=function(t,e){if("object"!=Me(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Me(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Me(e)?e:e+""}function Le(t,e,n){return e=Ce(e),function(t,e){if(e&&("object"==Me(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ke()?Reflect.construct(e,n||[],Ce(t).constructor):e.apply(t,n))}function ke(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ke=function(){return!!t})()}function Ce(t){return Ce=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ce(t)}function Re(t,e){return Re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Re(t,e)}var xe=document.currentScript.hasAttribute("allowappscopeaccess"),Ne=Ht;globalThis.SproutInitApp=function(t){var e,n=(window,{window,document:null===(e=window)||void 0===e?void 0:e.document}),r={useShadow:!0,allowAppScopeAccess:xe,stateManagerClass:Ne};r.allowAppScopeAccess&&(Object.defineProperty(globalThis,"sproutApps",{value:{},writable:!1}),Object.defineProperty(globalThis.sproutApps,t,{value:n,writable:!1})),n.SPROUT_CONFIG=Object.seal(r);var o=Object.prototype.hasOwnProperty;_(Object.prototype,"hasOwnProperty",o),n[i]=function(){return{}},n.setGlobalState=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=new n.SPROUT_CONFIG.stateManagerClass(t,void 0,void 0,!0,n).state,r="SproutGlobalState";Object.defineProperty(n,r,{value:e,writable:!1,configurable:!1}),Object.defineProperty(n,i,{value:function(){return n[r]}})};var a={};l.forEach((function(t){return a[t.element]=at(t.class,n,!0)})),n.ReactiveCustomElement=je(n),l.forEach((function(t){customElements.define("reactive-".concat(t.element),a[t.element],{extends:t.element})}));var u=at(HTMLHeadingElement,n);["h1","h2","h3","h4","h5","h6"].forEach((function(t){customElements.define("reactive-".concat(t),function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Le(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Re(t,e)}(e,t),n=e,r&&Te(n.prototype,r),o&&Te(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(u),{extends:t})}));var c=se(at(HTMLElement,n));return customElements.define("conditional-render",c),function(){Qt(n,t)}.bind(n)}})();
|
|
1
|
+
(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,n(o.key),o)}}function n(e){var n=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,n||"default");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==t(n)?n:n+""}function r(e,n,r){return n=l(n),function(e,n){if(n&&("object"==t(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(e)}(e,a()?Reflect.construct(n,r||[],l(e).constructor):n.apply(e,r))}function o(t){var e="function"==typeof Map?new Map:void 0;return o=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(a())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&i(o,n.prototype),o}(t,arguments,l(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,t)},o(t)}function a(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(a=function(){return!!t})()}function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}var u=function(t){function n(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(e=r(this,n,[t])).add=function(){return n.unavailableMethod("add")},e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i(t,e)}(n,t),o=n,l=[{key:"unavailableMethod",value:function(t){throw Error("Can't use ".concat(t," in ReadonlySet"))}}],(a=[{key:"delete",value:function(){n.unavailableMethod("delete")}},{key:"clear",value:function(){n.unavailableMethod("clear")}}])&&e(o.prototype,a),l&&e(o,l),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,a,l}(o(Set)),c=["ref","hidden"],s=new u(["hidden","checked","disabled","required","selected"]),f=new u(["checked","disabled","selected","src"]),p=new u(["value","checked"]),h=new u(["_global","_gettingDependenciesFor","_localStateManager","_stateManager","_binding","_populate","_isActive","_isStateManager","_isStatefulArray","hasOwnProperty"]),d="getGlobalState",y="Global State Not Set Yet",v=(Object.freeze({NO_DEPENDENCIES_ARRAY_IN_SET_HOOK:function(t){return"State set hook, must include a dependencies array! None was found for ".concat(t)}}),Object.freeze([{class:HTMLAnchorElement,element:"a"},{class:HTMLAreaElement,element:"area"},{class:HTMLAudioElement,element:"audio"},{class:HTMLBodyElement,element:"body"},{class:HTMLBRElement,element:"br"},{class:HTMLButtonElement,element:"button"},{class:HTMLCanvasElement,element:"canvas"},{class:HTMLDataElement,element:"data"},{class:HTMLDataListElement,element:"datalist"},{class:HTMLDetailsElement,element:"details"},{class:HTMLDialogElement,element:"dialog"},{class:HTMLDivElement,element:"div"},{class:HTMLDListElement,element:"dl"},{class:HTMLEmbedElement,element:"embed"},{class:HTMLFieldSetElement,element:"fieldset"},{class:HTMLFormElement,element:"form"},{class:HTMLHRElement,element:"hr"},{class:HTMLHtmlElement,element:"html"},{class:HTMLIFrameElement,element:"iframe"},{class:HTMLImageElement,element:"img"},{class:HTMLLabelElement,element:"label"},{class:HTMLLegendElement,element:"legend"},{class:HTMLLIElement,element:"li"},{class:HTMLLinkElement,element:"link"},{class:HTMLMapElement,element:"map"},{class:HTMLMetaElement,element:"meta"},{class:HTMLMeterElement,element:"meter"},{class:HTMLObjectElement,element:"object"},{class:HTMLOListElement,element:"ol"},{class:HTMLOptGroupElement,element:"optgroup"},{class:HTMLOptionElement,element:"option"},{class:HTMLParagraphElement,element:"p"},{class:HTMLPictureElement,element:"picture"},{class:HTMLPreElement,element:"pre"},{class:HTMLProgressElement,element:"progress"},{class:HTMLQuoteElement,element:"blockquote"},{class:HTMLQuoteElement,element:"q"},{class:HTMLSelectElement,element:"select"},{class:HTMLSourceElement,element:"source"},{class:HTMLSpanElement,element:"span"},{class:HTMLTableElement,element:"table"},{class:HTMLTableCellElement,element:"td"},{class:HTMLTableCellElement,element:"th"},{class:HTMLTableRowElement,element:"tr"},{class:HTMLTableSectionElement,element:"thead"},{class:HTMLTableSectionElement,element:"tbody"},{class:HTMLTableSectionElement,element:"tfoot"},{class:HTMLTextAreaElement,element:"textarea"},{class:HTMLTimeElement,element:"time"},{class:HTMLTitleElement,element:"title"},{class:HTMLTrackElement,element:"track"},{class:HTMLUListElement,element:"ul"},{class:HTMLVideoElement,element:"video"},{class:HTMLSlotElement,element:"slot"}])),m=document.createElement("div"),b={nodeActionsMap:new Map,pendingPaintNodeManagers:new Set,eventBindingFunctions:new Map,conditionalRenders:new Map,stateChangeHandlers:new Map,paintRafId:null},g=(new u(["==","===","!=","!==","<","<=",">",">="]),new u(["shift","unshift","pop","push","reverse","sort","splice","copyWithin","fill"])),w=new u(["reverse","sort","copyWithin","fill"]),S=new u(["slice","map","filter","reduce","reduceRight","some","every","forEach","find","findIndex","findLast","findLastIndex","indexOf","lastIndexOf","includes","entries","keys","values","at","join","toString","toLocaleString"]),O=new u(["every","some","filter","forEach","map","reduce","reduceRight","slice"]),E={STATE_NOT_FOUND:"SPROUT_STATE_NOT_FOUND"},A=new u(["checked","value"]),T="sprout-frozen",M="\n .".concat(T," {\n clip-path: inset(100%);\n pointer-events: none;\n opacity: 0;\n }\n"),j=Object.freeze({HIDE_UNHIDE:1,CLONE:2}),P=100,_={ATTRIBUTE_ACTIONS:600,TEXT_ACTIONS:300,ELEMENT_ACTIONS:100,PROPERTY_ACTIONS:50,REATTACH_ACTIONS:10},k=8;function C(t){return"OL"===t.tagName||"UL"===t.tagName}function N(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,i,l=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,e)||I(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(t){return function(t){if(Array.isArray(t))return R(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||I(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(t,e){if(t){if("string"==typeof t)return R(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?R(t,e):void 0}}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var D=b.pendingPaintNodeManagers,x=new Map;function H(t,e,n){var r;if(x.has(e)&&(r=x.get(e),cancelAnimationFrame(r)),t.length<P)r=requestAnimationFrame((function(){x.delete(e),t.forEach((function(t){return t()})),n&&n()})),x.set(e,r);else{x.delete(e);var o=L(t),a=0;requestAnimationFrame((function t(){o.slice(a,a+P).forEach((function(t){return t()})),(a+=P)<o.length&&requestAnimationFrame(t)}))}}var $=b.paintRafId,F=b.conditionalRenders;function U(t,e){F.set(t,e),H(Array.from(F.values()),"CONDITIONAL_RENDER",(function(){return F.clear()}))}function K(){$&&cancelAnimationFrame($),$=requestAnimationFrame((function(){$=null,B()}))}function G(t){t.forEach((function(t){return t()}))}function B(t){var e,n=performance.now(),r=0,o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=I(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}(D);try{for(o.s();!(e=o.n()).done;){var a=e.value,i=N(a.resolveToDOMActions(),5),l=i[0],u=i[1],c=i[2],s=i[3],f=i[4];if(console.log("Running reattach"),G(f.slice(0,_.REATTACH_ACTIONS)),r=performance.now()-n,console.log("took: ",r),r>k)return requestAnimationFrame((function(){return B()}));if(console.log("Running elements"),G(s.slice(0,_.ELEMENT_ACTIONS)),(r=performance.now()-n)>k)return requestAnimationFrame((function(){return B()}));if(console.log("took: ",r),console.log("Running attributes"),G(l.slice(0,_.ATTRIBUTE_ACTIONS)),(r=performance.now()-n)>k)return requestAnimationFrame((function(){return B()}));if(console.log("Running text"),G(u.slice(0,_.TEXT_ACTIONS)),(r=performance.now()-n)>k)return requestAnimationFrame((function(){return B()}));if(G(c.slice(0,_.PROPERTY_ACTIONS)),(r=performance.now()-n)>k)return requestAnimationFrame((function(){return B()}));if(l.length||u.length||c.length||s.length||f.length)return requestAnimationFrame((function(){return B()}));a.paintStatus=null,D.delete(a),console.log("Took ",performance.now()-n)}}catch(t){o.e(t)}finally{o.f()}if(r>k)return requestAnimationFrame((function(){return B()}))}function q(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=V(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function z(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,i,l=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,e)||V(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(t){return function(t){if(Array.isArray(t))return X(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||V(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(t,e){if(t){if("string"==typeof t)return X(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?X(t,e):void 0}}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}"undefined"!=typeof window&&(window.SproutWaitIdle=function(){return new Promise((function(t){requestAnimationFrame((function e(){if(!b.pendingPaintNodeManagers.size)return t();requestAnimationFrame(e)}))}))});function Y(t){switch(t){case Node.ATTRIBUTE_NODE:return{setAttribute:void 0};case Node.TEXT_NODE:return{textContent:void 0};case Node.ELEMENT_NODE:return{append:new Set,reattach:!1,setProperty:new Map,get hasPendingActions(){return this.append.size||this.reattach||this.setProperty.size}}}}function Q(t,e,n){var r=this,o=n;"todosFiltered"===e&&performance.mark("todo-generate-node-actions");var a=t.nodeManager.stateNodes[e],i=t.stateArrayMaps[e],l=t.nodeManager.conditionallyRenderingElements[e];if(a&&a.forEach((function(e){!function(t,e,n){e.nodeType===Node.ATTRIBUTE_NODE?t.addNodeAction(e,{actionType:"setAttribute",actionValue:n}):e.nodeType===Node.TEXT_NODE&&t.addNodeAction(e,{actionType:"textContent",actionValue:n})}(t.nodeManager,e,o)})),i){var u=o;console.log("Reconcile state map, for: "+e),i.forEach((function(e,n){!function(t,e,n,r){var o;console.log("[RECONCILE] LAST OPERATION:",t.lastOperation);var a=null,i=!1,l=C(n),u=new Map,c=n.getAttribute&&n.getAttribute("ref")||n.refName||n.tagName,s=t.map((function(t){return Object.hasOwn(t,"state")?t.state:t})),f=function(t){var e,n=l?null===(e=t.firstElementChild)||void 0===e?void 0:e.state:t.state;return n?n.key:t.stateKey},p=function(t){var e,n=l?null===(e=t.firstElementChild)||void 0===e?void 0:e.state:t.state;return n?n.label:void 0};try{console.log("[RECONCILE] before (ref=".concat(c,"), EXPECTED KEYS:"),s.map((function(t){return null==t?void 0:t.key})),"EXISTING KEYS",W(n.children).map(f),"EXPECTED LABELS",s.map((function(t){return null==t?void 0:t.label})),"EXISTING LABELS",W(n.children).map(p))}catch(t){}if(t.isNewArray){if(t.length){var h;i=!0,a=n.detach();var d=yt(t,e,l?"li":void 0,a);a.innerHTML="",(h=a).append.apply(h,W(d))}}else if(t.lastOperation){i=!0,a||(a=n.detach());var y=a.children,v=z(t.lastOperation,2),m=v[0],b=v[1];switch(m){case"shift":a.removeChild(a.firstElementChild);break;case"unshift":for(var g=b[0]-1;g>=0;g--){var w,S=t[g],O=null===(w=a.keyMap)||void 0===w?void 0:w.get(S.key);if(O){var E=a.firstElementChild;O!==E&&a.insertBefore(O,E)}else{var A=dt(S,e,l?"li":void 0,a);A.stateKey=S.key,a.prepend(A)}}break;case"pop":a.removeChild(a.lastElementChild);break;case"push":for(var T=y.length,M=t.length;T<M;T++){var j=t[T],P=dt(j,e,l?"li":void 0,a);P.stateKey=j.key,a.appendChild(P)}break;case"splice":var _,k,N=y.length,L=null!==(_=b[0])&&void 0!==_?_:0,I=b[1],R=L<0?Math.max(N+L,0):Math.min(L,N);k=void 0===I||I===1/0?N-R:I<0?0:Math.min(I,N-R);var D=b[2]||[],x=t.length;if(0===D.length&&N===x)break;if(0===R&&k>=N&&D.length===x&&N===x)break;for(var H=0;H<k;H++)a.removeChild(y[R]);var $,F=q(D);try{for(F.s();!($=F.n()).done;){var U,K=dt($.value,e,l?"li":void 0,a),G=null!==(U=y[R])&&void 0!==U?U:null;a.insertBefore(K,G),R++}}catch(t){F.e(t)}finally{F.f()}}}else{for(var B,V=null==n?void 0:n.keyMap,X=null!==(B=a)&&void 0!==B?B:n,Y=0;Y<s.length;Y++){var Q,J,Z=s[Y],tt=null==Z?void 0:Z.key,et=X.children[Y];if(!et)break;var nt=l?null===(Q=et.firstElementChild)||void 0===Q?void 0:Q.state:et.state,rt=nt?nt.key:et.stateKey;try{console.log("[RECONCILE][normal] ref=".concat(c," idx=").concat(Y," have=").concat(rt," want=").concat(tt," action=").concat(rt===tt?"keep":"move"))}catch(t){}if(rt!==tt){i=!0,a||(a=n.detach());var ot=null!==(J=u.get(tt))&&void 0!==J?J:V.get(tt);if(ot){var at,it=a.replaceChildWith(et,ot);u.set(rt,it);try{console.log("[RECONCILE][normal] ref=".concat(c," idx=").concat(Y," move via=").concat(u.has(tt)?"replaced":"keyMap"))}catch(t){}if((l?null===(at=ot.firstElementChild)||void 0===at?void 0:at.state:ot.state)!==Z){var lt=dt(Z,e,l?"li":void 0,a);lt.stateKey=tt,a.replaceChildWith(ot,lt);try{console.log("[RECONCILE][normal] ref=".concat(c," idx=").concat(Y," refresh-in-place key=").concat(tt))}catch(t){}}}else{var ut=dt(Z,e,l?"li":void 0,a);ut.stateKey=tt,a.replaceChildWith(et,ut);try{console.log("[RECONCILE][normal] ref=".concat(c," idx=").concat(Y," create key=").concat(tt))}catch(t){}}}else if(nt!==Z){i=!0,a||(a=n.detach());var ct=dt(Z,e,l?"li":void 0,a);ct.stateKey=tt,a.replaceChildWith(et,ct);try{console.log("[RECONCILE][normal] ref=".concat(c," idx=").concat(Y," refresh key=").concat(tt))}catch(t){}}}for(;(null!==(st=a)&&void 0!==st?st:n).children.length>s.length;){var st,ft;i=!0,a||(a=n.detach()),a.removeChild((null!==(ft=a)&&void 0!==ft?ft:n).lastElementChild)}}var pt=a?a.children.length:n.children.length;if(t.length>pt){i=!0,a||(a=n.detach());for(var ht=a.children.length;ht<t.length;ht++){var vt,mt=t[ht];if(null===(vt=a.keyMap)||void 0===vt||!vt.has(mt.key)){var bt=void 0;(bt=u.has(mt.key)?u.get(mt.key):dt(mt,e,l?"li":void 0,a)).stateKey=mt.key,a.appendChild(bt)}}}var gt=null!==(o=a)&&void 0!==o?o:n;try{console.log("[RECONCILE] after (ref=".concat(c,"), EXPECTED KEYS:"),s.map((function(t){return null==t?void 0:t.key})),"EXISTING KEYS",W(gt.children).map(f),"EXPECTED LABELS",s.map((function(t){return null==t?void 0:t.label})),"EXISTING LABELS",W(gt.children).map(p))}catch(t){}i&&r.nodeManager.addNodeAction(a,{actionType:"reattach",actionValue:!0})}(u,e,n,t)}))}l&&l.forEach((function(t){U(r,t.render.bind(r))})),"pending"===t.nodeManager.paintStatus&&t.nodeManager.queuePaint()}function J(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];Object.defineProperty(t,e,{value:n,configurable:!1,writable:!0,enumerable:r})}function Z(t,e,n){n||console.warn("Host element not found when binding prop attribute ".concat(t," to ").concat(e));var r=e.substring(1),o=this.getAttributeNode(t);o.nodeValue=n.getAttribute(r),o.isPropAttribute=!0,n.propAttributes.has(r)||n.propAttributes.set(r,new Set),n.propAttributes.get(r).add(o)}function tt(t){return function(t){if(Array.isArray(t))return et(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return et(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?et(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function et(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function nt(t){if(0===t.indexOf("!"))return["negation",t.substring(1)];for(var e,n=0,r=t[n];n++<t.length;){if(e=t[n],3==n&&"is_"==r)return["equality"].concat(tt(t.substring(3).split(":")));if("?"===e)return["ternary",r].concat(tt(t.substring(n+1).split(":")));r+=e}return["literal",t]}function rt(t){return""===t||null!==t&&t}function ot(t){return ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ot(t)}function at(t,e){return st(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,i,l=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,e)||ut(t,e)||lt()}function it(t){return st(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ut(t)||lt()}function lt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ut(t,e){if(t){if("string"==typeof t)return ct(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ct(t,e):void 0}}function ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function st(t){if(Array.isArray(t))return t}"undefined"==typeof HTMLElement?console.warn("HTMLElement was not found! This probably means you are running in a non-browser environment, and can lead to unexpected results"):Object.defineProperty(globalThis,"elementSetAttribute",{value:HTMLElement.prototype.setAttribute,writable:!1,configurable:!1});var ft=function(t,e){var n;n=t,s.has(n)?"false"===e?this.removeAttribute(t):elementSetAttribute.call(this,t,""):elementSetAttribute.call(this,t,e)},pt=function(t,e){var n=it(nt(e)),r=n[0],o=n.slice(1),a=o[0],i=at(this.getState(a,!0),2),l=i[0],u=i[1];if(l!==Symbol.for(E.STATE_NOT_FOUND))if(u){var c=u._stateManager,s="literal"===r?l:c.bindStatePropExpression(e,r,o);this.removeAttribute(t);var f=document.createAttribute(t);f.nodeValue=s,J(f,"isStateAttribute",!0),J(f,"originalOwnerElement",this),"boolean"==typeof s&&(f.nodeValue=""),c.addStateNode(e,f),!1!==s&&this.setAttributeNode(f),this.addEventListener("disconnected",(function(){u._stateManager.removeStateNode(e,f)}),{once:!0})}else console.warn("No State object with state prop: "+a);else console.warn("State value for ".concat(a," is undefined. State values should never be undefined."))},ht=function(t){var e=it(nt(t)),n=e[0],r=e.slice(1),o=r[0],a=at(this.getState(o,!0),2),i=a[0],l=a[1];if(i!==Symbol.for(E.STATE_NOT_FOUND))if(l){var u=l._stateManager,c="literal"===n?i:u.bindStatePropExpression(t,n,r),s=document.createTextNode(c);J(s,"isStateAttribute",!0),l._stateManager.addStateNode(t,s),this.appendChild(s),this.addEventListener("disconnected",(function(){l._stateManager.removeStateNode(t,s)}),{once:!0})}else console.warn("No State object with state prop: "+o);else console.warn("State value for ".concat(o," is undefined. State values should never be undefined."))};function dt(t,e,n,r){var o,a=document.createElement(e);return a.setInitialState(t),a.ownerMapElement=r,n?(o=document.createElement(n)).appendChild(a):o=a,t.hasOwnProperty("key")&&!o.hasOwnProperty("stateKey")&&(o.stateKey=t.key),o}function yt(t,e,n,r){return t.map((function(t,o){if(Object.hasOwn(t,"state")&&(t=t.state),"object"!==ot(t))return console.warn("item in State array for _map is not an object: ",t),{};Object.hasOwn(t,"key")||(console.warn("State object in elements map has no 'key' property. Adding automatically per index. This can have unexpected results on mutations!"),t.key=o);var a=dt(t,e,n,r);return a.stateKey=t.key,a}))}function vt(t,e,n){var r;if(!mt(e)){console.log("Handling state change for: "+e);var o=null!=n?n:t.state[e],a=Object.getOwnPropertyDescriptor(t.state,e);null==a||null===(r=a.get)||void 0===r||r.isStateGetter;!function(t,e,n){var r=new CustomEvent("stateChange",{bubbles:!1,composed:!1,detail:{property:e,newValue:n}});t.dispatchEvent(r)}(t.state,e,o),Q(t,e,o),e.startsWith("!")||Q(t,"!".concat(e),!o)}}function mt(t){return h.has(t)}function bt(t){return 0===t.indexOf("set_")}function gt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,i,l=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,e)||St(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wt(t){return function(t){if(Array.isArray(t))return Ot(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||St(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function St(t,e){if(t){if("string"==typeof t)return Ot(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ot(t,e):void 0}}function Ot(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Et(t){return Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Et(t)}function At(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Nt(r.key),r)}}function Tt(t,e){if(e&&("object"==Et(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Mt(){return Mt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=kt(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Mt.apply(null,arguments)}function jt(t){var e="function"==typeof Map?new Map:void 0;return jt=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(Pt())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&_t(o,n.prototype),o}(t,arguments,kt(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),_t(n,t)},jt(t)}function Pt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Pt=function(){return!!t})()}function _t(t,e){return _t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_t(t,e)}function kt(t){return kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kt(t)}function Ct(t,e,n){return(e=Nt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Nt(t){var e=function(t,e){if("object"!=Et(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Et(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Et(e)?e:e+""}var Lt=function(t){function e(t,n,r){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);a.SPROUT_CONFIG.stateManagerClass;if(!Array.isArray(t))throw Error("Argument for StateFulArray constructor must be an array!");var l,u,c,s=t,f=s.map((function(t,e){var o=t;return Object.hasOwn(t,"state")||Object.hasOwn(t,"_stateManager")||Array.isArray(t)||"object"===Et(t)&&(o=Vt(t,r,n._stateManager,vt,!1,a)),o}));return l=this,u=e,c=wt(f),u=kt(u),Ct(o=Tt(l,Pt()?Reflect.construct(u,c||[],kt(l).constructor):u.apply(l,c)),"arrayMaps",{}),o.parentStateObject=n,o.arrayStateProp=r,o.appScope=a,o.rawArray=s,i&&o.makeStateMap(),J(f=new Proxy(o,$t(null==n?void 0:n._stateManager,r,a)),"_isStatefulArray",!0),o.statefulArray=f,Tt(o,f)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_t(t,e)}(e,t),n=e,r=[{key:Symbol.iterator,value:function(){return Mt(kt(e.prototype),Symbol.iterator,this).call(this)}},{key:"runArrayOperation",value:function(t,e,n){switch(t){case"shift":return this.lastOperation=["shift"],[e.apply(this,n),!1];case"unshift":return this.lastOperation=["unshift",[n.length]],[e.apply(this,n),!1];case"pop":return this.lastOperation=["pop"],[e.apply(this),!1];case"push":return this.lastOperation=["push",[n.length]],[e.apply(this,n),!1];case"splice":var r=gt(n,2),o=r[0],a=r[1],i=n.slice(2);return this.lastOperation=["splice",[o,a,i]],[e.apply(this,n),!1];default:this.lastOperation=void 0;var l=e.apply(this,n);return[l,Array.isArray(l)]}}},{key:"doArrayOperation",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.$$operation=t;var o,a=this.length,i=!1;if(O.has(t)){var l=n[0];if(this.length&&Object.hasOwn(this.arrayMaps,t)&&this.arrayMaps[t].has(l)){var u=this.arrayMaps[t].get(l);if(this.lastDirtyTimestamp>u.timestamp){var c=gt(this.runArrayOperation(t,Mt(kt(e.prototype),t,this),n),2);o=c[0],i=c[1],this.arrayMaps[t].set(l,{lastResult:o,timestamp:(new Date).getTime()})}else o=u.lastResult}else{var s=gt(this.runArrayOperation(t,Mt(kt(e.prototype),t,this),n),2);o=s[0],i=s[1],Object.hasOwn(this.arrayMaps,t)||(this.arrayMaps[t]=new Map,this.arrayMaps[t].set(l,{lastResult:o,timestamp:(new Date).getTime()}))}}else{var f=gt(this.runArrayOperation(t,Mt(kt(e.prototype),t,this),n),2);o=f[0],i=f[1]}var p=this.length,h=w.has(t)||"splice"===t&&p===a;return r&&h&&this.parentStateObject._stateManager.setDirtyProp("".concat(this.arrayStateProp,".length"),!0),delete this.$$operation,r&&this.parentStateObject._stateManager.setDirtyProp(this.arrayStateProp),[o,i]}},{key:"mapStateKeys",value:function(){var t=this;this.forEach((function(e){var n=Object.hasOwn(e,"state")?e.state:e;Object.hasOwn(n,"key")||console.warn("Items in State Map Array ".concat(t.arrayStateProp," SHOULD have a 'key' property!")),t.keyMap.set(n.key,n)}))}},{key:"makeStateMap",value:function(){this._isStateMap=!0,this.keyMap=new Map,this.mapStateKeys()}}],o=[{key:Symbol.species,get:function(){return Array}}],r&&At(n.prototype,r),o&&At(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(jt(Array));function It(t){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(t)}function Rt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,i,l=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Dt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}Ct(Lt,"functions",new u(["constructor","statifyArray","addDirtyIndex","doArrayOperation","runArrayOperation","makeStateMap","mapStateKeys","toArray"]));var xt=function(){return{get:function(t,e,n){var r;if(mt(e)||0===e.indexOf("$$"))return Reflect.get.apply(Reflect,arguments);var o=Object.getOwnPropertyDescriptor(t,e);return null!=o&&null!==(r=o.get)&&void 0!==r&&r.isStateGetter||(Object.hasOwn(t.$$accessCount,e)?t.$$accessCount[e]++:t.$$accessCount[e]=1),Reflect.get.apply(Reflect,arguments)}}},Ht=function(t,e){arguments.length>2&&void 0!==arguments[2]||window,t.state;return{apply:function(n,r,o){t.clearStateDependencies(e);var a=r._global,i=Rt(Zt(n,r),3),l=i[0],u=i[1],c=i[2];return l.forEach((function(n){t.addStateDependency(n,e)})),null==u||u.forEach((function(n){a._stateManager.addGlobalStateDependency(n,e,t)})),c}}},$t=function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,o=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&t.setDirtyProp(e,!0),n&&t.setDirtyProp("".concat(e,".length"),!0)},a=function(t){var e;if(t)return Object.hasOwn(t,"state")?null===(e=t.state)||void 0===e?void 0:e.key:t.key};return{set:function(i,l,u){if(0===l.indexOf("$$"))return Reflect.set(i,l,u);if("length"===l)return n=Reflect.set(i,l,u),i.hasDirtyItems=!0,i.hasOwnProperty("$$operation")?o(!0,!1):o(!0,!0),n;if(i[l]===u)return!0;var c;Number(l);if(!isNaN(l)){var s=Number(l),f=i[s],p=a(f);if(u=Xt(u,e,t,r),Object.hasOwn(u,"_stateManager")&&(u=u._stateManager),!i.hasOwnProperty("$$operation")){var h=!1;if(s<i.length&&(h=!0),(n=Reflect.set(i,l,u))&&i._isStateMap){void 0!==p&&i.keyMap.delete(p);var d=a(u);void 0!==d&&i.keyMap.set(d,(c=u,Object.hasOwn(c,"state")?c.state:c))}return h&&o(),n}}return Reflect.set(i,l,u)},get:function(e,n,r){if("symbol"===It(n))return Reflect.get.apply(Reflect,arguments);if("length"===n&&Object.hasOwn(e.parentStateObject,"$$accessCount")&&!Object.hasOwn(e,"$$operation")){var o=e.arrayStateProp;Object.hasOwn(e.parentStateObject.$$accessCount,"".concat(o,".length"))?e.parentStateObject.$$accessCount["".concat(o,".length")]++:e.parentStateObject.$$accessCount["".concat(o,".length")]=1}if(n.indexOf&&0===n.indexOf("__")){var a=n.substring(2);return Reflect.get(e,a,r)}if("function"==typeof e[n]&&!Lt.functions.has(n)){var i=e.parentStateObject;if(i&&Object.hasOwn(i,"$$accessCount")){var l=String(n);if(S.has(l)){var u=e.arrayStateProp;i.$$accessCount[u]=(i.$$accessCount[u]||0)+1}}}if(!t.isInitializing&&"function"==typeof e[n]&&!Lt.functions.has(n))return function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var a=Rt(e.doArrayOperation.call(e.statefulArray,n,r,g.has(n)),2),i=a[0];a[1];return i};var c=Number(n);if(!isNaN(c)){var s=e[c];if(void 0===s)return;return s&&Object.hasOwn(s,"state")?s.state:s}return Reflect.get.apply(Reflect,arguments)},deleteProperty:function(t,e){if(isNaN(Number(e)))return Reflect.deleteProperty(t,e);var n=t[Number(e)],r=a(n),o=Reflect.deleteProperty(t,e);return o&&t._isStateMap&&void 0!==r&&t.keyMap.delete(r),o}}};function Ft(){this.conditionallyRenderingElements={},this.addConditionallyRenderingElements=function(t,e){this.nodeManager.addConditionallyRenderingElements(t,e)}}function Ut(){this.stateArrayMaps={},this.addStateMap=function(t,e,n){this.stateArrayMaps.hasOwnProperty(t)||(this.stateArrayMaps[t]=new Map),this.stateArrayMaps[t].set(n,e)},this.clearStateMapsLastOperation=function(){for(var t=0,e=Object.keys(this.stateArrayMaps);t<e.length;t++){var n=e[t];delete this.state[n].lastOperation}}}function Kt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,i,l=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Gt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Bt(t){return Bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bt(t)}function qt(t,e,n){if(Wt())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var o=new(t.bind.apply(t,r));return n&&zt(o,n.prototype),o}function zt(t,e){return zt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zt(t,e)}function Wt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Wt=function(){return!!t})()}function Vt(t,e,n){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:window,o=new Ie(t,e,n,arguments.length>3&&void 0!==arguments[3]?arguments[3]:vt,arguments.length>4&&void 0!==arguments[4]&&arguments[4],r);return o.use(Ft,"conditional-element"),o.use(Ut,"map"),o}function Xt(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return mt(e)||(Array.isArray(t)?t=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(Object.hasOwn(t,"_isStatefulArray"))return t;var a=qt(Lt,[t,n,e,r,o]);return n.hasOwnProperty("".concat(e,".length"))||Object.defineProperty(n,"".concat(e,".length"),{get:function(){return this[e].length}}),a}(t,e,n.state,r,o):"object"!==Bt(t)||null===t||t.hasOwnProperty("_stateManager")||(t=Vt(t,e,n,vt,!1,r).state)),t}function Yt(t,e,n){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,a="set_".concat(e),i=Kt(t,2),l=i[0],u=i[1];if("function"!=typeof l)throw Error("Setter hooks must define a function as the first item!");var c,s=n.state;if(u.deps=null!==(r=u.deps)&&void 0!==r?r:"auto",!u.init||!u.once)if("auto"===u.deps)if(u.reevaluate){var f=Ht(n,a,o);l=new Proxy(l,f),t[0]=l}else{var p,h,d,y=Kt(Zt(l,s),3);h=y[0],d=y[1],c=y[2],h.forEach((function(t){n.addStateDependency(t,a)})),null===(p=d)||void 0===p||p.forEach((function(t){n.addStateDependency(t,a),s._global._stateManager.addGlobalStateDependency(t,a,n)}))}else u.deps.forEach((function(t){if(0===t.indexOf("global")){var e=t.substring(t.indexOf("global.")+7);s._global.addGlobalStateDependency(a,e,n)}else n.addStateDependency(t,a)}));Object.defineProperty(s,e,{get:function(){return Object.hasOwn(s,"$$accessCount")&&(Object.hasOwn(s.$$accessCount,e)?s.$$accessCount[e]++:s.$$accessCount[e]=1),n.privateState[e]},set:function(){throw Error("Cannot directly set the state value of a result of a setter hook function!")}}),u.init&&(c||(c=l.call(s)),(u.statify||u.stateMap)&&(c=Xt(c,e,n,o,u.stateMap)),n.privateState[e]=c,n.setDirtyProp(e))}function Qt(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window,o=n.state,a=n.privateState[e];void 0===a&&Yt(t,e,n,r);var i=Kt(t,2),l=i[0],u=i[1];if("function"!=typeof l)throw Error("Setter hooks must define a function as the first item!");var c=l.call(o),s=!1;if(void 0===c)throw Error("State Set Hook functions MUST return a value");return(u.statify||u.stateMap)&&(c=Xt(c,e,n,r,u.stateMap)),c!==a&&(n.privateState[e]=c,s=!0),u.once&&delete o["set_".concat(e)],s}function Jt(t){var e;for(var n in t)-1!==(e=n.indexOf(".length"))&&t[n.substring(0,e)]--;return new Set(Object.keys(t).filter((function(e){return t[e]>0})))}function Zt(t,e){var n=!1,r=new Proxy(e,xt());r.$$accessCount={},Object.hasOwn(r,"_global")&&r._global!==y&&(n=!0,r._global=new Proxy(r._global,xt),r._global.$$accessCount={});var o=t.call(r),a=Jt(r.$$accessCount);delete r.$$accessCount;var i=null;return n&&(i=Jt(r._global.$$accessCount),delete r._global.$$accessCount),[a,i,o]}function te(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,r=t.state,o=Object.getOwnPropertyDescriptors(e),a=function(e){var a=o[e];if(mt(e))return Object.defineProperty(r,e,a),1;var i=function(t,e){if(t.get&&"function"==typeof t.get)return{nativeGetter:!0,func:t.get,deps:"auto",reevaluate:!1,init:!1,isSetter:!1};if(t.value){var n=t.value;if(0===e.indexOf("set_")){if(!Array.isArray(n))throw Error("State setter hooks must be arrays!");var r=n[1]||{};return{nativeGetter:!1,func:n[0],deps:r.deps&&Array.isArray(r.deps)?r.deps:"auto",reevaluate:!!r.reevaluate,init:!!r.init,once:!!r.once,stateMap:!!r.stateMap,statify:!!r.statify,isSetter:0===e.indexOf("set_")}}}}(a,e);if(i){var l=i.isSetter?e.substring(4):e;if(i.func.bind(r),i.isSetter&&!i.nativeGetter)Yt(a.value,l,t,n),i.once&&(a.configurable=!0),Object.defineProperty(r,e,a);else if(i.nativeGetter){a.get.isStateGetter=!0;var u=Kt(Zt(a.get,r),2),c=u[0],s=u[1];c.forEach((function(n){t.addStateDependency(n,e)})),null==s||s.forEach((function(n){t.addStateDependency(n,e),r._global._stateManager.addGlobalStateDependency(n,e,t)})),a.get.bind(r),Object.defineProperty(r,l,a)}}else if(a.hasOwnProperty("value")){var f=e,p=Xt(a.value,f,t,n);t.privateState.hasOwnProperty(f)||(t.privateState[f]=p),Object.defineProperty(r,f,{set:function(e){e!==t.privateState[f]&&(e=Xt(e,f,t,n),t.privateState[f]=e,t.setDirtyProp(f),t.setDirtyProp("".concat(f,".length")))},get:function(){return t.privateState[f]}})}};for(var i in o)a(i)}function ee(t,e,n,r){Object.defineProperty(e,t,{get:n,set:function(){throw Error("Cannot directly set a State property expression")},enumerable:!0}),e._stateManager.addStateDependency(r,t)}function ne(t){var e=new Set,n=new Set;return t.forEach((function(t){bt(t)?n.add(t):e.add(t)})),[e,n]}function re(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,i,l=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,e)||le(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oe(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=le(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function ae(t){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ae(t)}function ie(t){return function(t){if(Array.isArray(t))return ue(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||le(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function le(t,e){if(t){if("string"==typeof t)return ue(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ue(t,e):void 0}}function ue(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function ce(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,pe(r.key),r)}}function se(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function fe(t,e,n){return(e=pe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function pe(t){var e=function(t,e){if("object"!=ae(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=ae(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ae(e)?e:e+""}function he(t,e){return t.get(function(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}(t,e))}var de=b.pendingPaintNodeManagers,ye=new WeakMap,ve=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),fe(this,"stateNodes",{}),fe(this,"conditionallyRenderingElements",{}),fe(this,"bindableAttributesStateNodes",new Map(ie(A).map((function(t){return[t,new Map]})))),se(this,ye,new Map),fe(this,"paintStatus",null)},(e=[{key:"addStateNode",value:function(t,e){this.stateNodes.hasOwnProperty(t)||(this.stateNodes[t]=new Set),this.stateNodes[t].add(e),p.has(e.nodeName)&&this.bindableAttributesStateNodes.get(e.nodeName).set(e.originalOwnerElement,e)}},{key:"removeStateNode",value:function(t,e){var n;null===(n=this.stateNodes)||void 0===n||n[t].delete(e)}},{key:"addConditionallyRenderingElements",value:function(t,e){var n;this.conditionallyRenderingElements.hasOwnProperty(t)||(this.conditionallyRenderingElements[t]=new Set),e.originalParentElement=e.parentElement||(null===(n=e.host)||void 0===n?void 0:n.shadowRoot),this.conditionallyRenderingElements[t].add(e)}},{key:"addNodeAction",value:function(t,e){he(ye,this).has(t)||he(ye,this).set(t,Y(t.nodeType));var n=he(ye,this).get(t),r=e.actionType,o=e.actionValue;if(t.nodeType===Node.ELEMENT_NODE)switch(r){case"append":n.append.add(o);break;case"setProperty":n.setProperty(o.property,o.value);break;case"reattach":n.reattach=!0}else n[r]=o;this.paintStatus||(this.paintStatus="pending")}},{key:"queuePaint",value:function(){"pending"===this.paintStatus&&(de.add(this),K(),this.paintStatus="queued")}},{key:"resolveToDOMActions",value:function(){var t=[],e=[],n=[],r=[],o=[];return he(ye,this).forEach((function(a,i){switch(i.nodeType){case Node.ATTRIBUTE_NODE:var l=a.setAttribute,u=ae(l);if("undefined"!==u)if("boolean"===u){if(!i.hasOwnProperty("originalOwnerElement"))throw Error("originalOwnerElement not found on boolean attribute node! Should never happen!");!1===l?i.originalOwnerElement.hasAttribute(i.name)&&t.push((function(){i.originalOwnerElement.removeAttributeNode(i)})):i.originalOwnerElement.hasAttribute(i.name)||t.push((function(){i.originalOwnerElement.setAttributeNode(i)}))}else"string"===u&&i.nodeValue!==l&&t.push((function(){return i.nodeValue=l}));break;case Node.TEXT_NODE:if(void 0!==a.textContent){var c=String(a.textContent);i.nodeValue!==c&&e.push((function(){return i.nodeValue=c}))}break;case Node.ELEMENT_NODE:var s,f=oe(a.append.values());try{var p=function(){var t=s.value;n.push((function(){return i.appendChild(t)}))};for(f.s();!(s=f.n()).done;)p()}catch(t){f.e(t)}finally{f.f()}var h,d,y=oe(a.setProperty);try{var v=function(){var t=re(h.value,2),e=t[0],n=t[1];i[e]!==n&&o.push((function(){return i[e]=n}))};for(y.s();!(h=y.n()).done;)v()}catch(t){y.e(t)}finally{y.f()}a.reattach&&(r.push((function(){return i.reattach()})),null!=i&&null!==(d=i.pendingKeyMapActions)&&void 0!==d&&d.size&&r.push((function(){var t,e=oe(i.pendingKeyMapActions);try{for(e.s();!(t=e.n()).done;)(0,t.value)()}catch(t){e.e(t)}finally{e.f()}i.pendingKeyMapActions.clear()})),a.reattach=!1)}})),he(ye,this).clear(),[t,e,o,n,r]}}])&&ce(t.prototype,e),n&&ce(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();function me(t){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;return new Proxy(t,function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window;return{set:function(n,r,o){if(mt(r))return Reflect.set.apply(Reflect,arguments);var a,i=Reflect.set.apply(Reflect,arguments),l=t._stateManager;return l.parentStateManager&&(performance.mark("todo-array-set-dirty-prop"),null===(a=l.parentStateManager)||void 0===a||a.setDirtyProp(e)),i},defineProperty:function(e,r,o){return mt(r)?Reflect.defineProperty.apply(Reflect,arguments):(void 0!==(null==o?void 0:o.value)&&(o.value=Xt(o.value,r,t._stateManager,n)),Reflect.defineProperty(e,r,o))},get:function(t,e,n){var r=Reflect.get.apply(Reflect,arguments);return"function"==typeof r?r.bind(t):r}}}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,e))}function be(t){return be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},be(t)}function ge(t){return function(t){if(Array.isArray(t))return Ae(t)}(t)||we(t)||Ee(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function we(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function Se(t,e){return Te(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,i,l=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,e)||Ee(t,e)||Oe()}function Oe(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ee(t,e){if(t){if("string"==typeof t)return Ae(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ae(t,e):void 0}}function Ae(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Te(t){if(Array.isArray(t))return t}function Me(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_e(r.key),r)}}function je(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function Pe(t,e,n){return(e=_e(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _e(t){var e=function(t,e){if("object"!=be(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=be(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==be(e)?e:e+""}function ke(t,e){return t.get(function(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}(t,e))}var Ce=new Map;var Ne=new WeakMap,Le=function(){return t=function t(e,n,r){var o=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:vt,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:window;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Pe(this,"isInitializing",!1),Pe(this,"privateState",{}),Pe(this,"state",new EventTarget),Pe(this,"stateDependencies",new Map),Pe(this,"parentStateProp",void 0),Pe(this,"parentStateManager",void 0),Pe(this,"dirtyProps",new Set),Pe(this,"nodeManager",new ve),je(this,Ne,new Set),this.isInitializing=!0,this.parentStateProp=n,this.parentStateManager=r,this.handleStateChange=a,this.appScope=l,J(this.state,"_stateManager",this,!0),this.state.$$isInitializing=!0,this.state.populate=function(t){for(var e in t)this.hasOwnProperty(e)&&(this[e]=t[e])},n&&r&&(this.state=me(this.state,n,l)),e&&Object.keys(e).length||console.warn("Empty initial state objects should never be used!"),i)this.globalStateDependencies=new Map,this.addGlobalStateDependency=function(t,e,n){o.globalStateDependencies.has(t)||o.globalStateDependencies.set(t,new Map);var r=o.globalStateDependencies.get(t);r.has(n)||r.set(n,new Set),r.get(n).add(e)};else{var u=l[d]();J(this.state,"_global",u,!0)}!function(t,e){te(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:window)}(this,e,l),delete this.state.$$isInitializing,J(this.state,"_isStateManager",!0),J(this.state,"_isActive",!0,!1),this.isInitializing=!1},e=[{key:"setDirtyProp",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.state.$$isInitializing){var n,r,o=t.indexOf(".length"),a=o>0?t.substring(0,o):t;if(!Object.hasOwn(this.state,a))throw Error("Error in setDirtyProp. State has no property: '".concat(t,"'. This should never happen"));this.dirtyProps.add(t),Array.isArray(this.state[a])&&(this.state[a].lastDirtyTimestamp=(new Date).getTime()),e&&(n=this,r=this.handleStateChanges.bind(this),Ce.set(n,r),H(Array.from(Ce.values()),"STATE_CHANGE",(function(){return Ce.clear()})))}}},{key:"handleStatePropDependencies",value:function(t){var e=this,n=this.stateDependencies,r=null==this?void 0:this.globalStateDependencies;t.forEach((function(t){!function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window,r=t.state;if(bt(e)){var o=r[e],a=e.substring(4);Qt(o,a,t,n)&&vt(t,a,null,n.offscreenContainer)}else if(e.indexOf(".length")>0){var i=e.split(".")[0];vt(t,e,t.state[i].length,n.offscreenContainer)}else vt(t,e,null,n.offscreenContainer)}(e,t,e.appScope);var o=bt(t)?t.substring(4):t;if(null!=n&&n.has(o)){var a=Se(ne(n.get(o)),2),i=a[0],l=a[1];l.size&&e.handleStatePropDependencies(l),i.size&&e.handleStatePropDependencies(i)}null!=r&&r.has(o)&&r.get(o).forEach((function(t,e){var n=Se(ne(t),2),r=n[0],o=n[1];o.size&&e.handleStatePropDependencies(o),r.size&&e.handleStatePropDependencies(r)}))}))}},{key:"isGlobalState",value:function(){return!this.state.hasOwnProperty("_global")}},{key:"topologicalSortStateProps",value:function(t){var e=this;return ge(t).toSorted((function(t,n){var r,o;return t.startsWith(n+".")?1:n.startsWith(t+".")?-1:((null===(r=e.stateDependencies[t])||void 0===r?void 0:r.size)||0)-(null===(o=e.stateDependencies[n])||void 0===o?void 0:o.size)||0}))}},{key:"handleStateChanges",value:function(){var t=this;if(this.dirtyProps.size){performance.mark("todo-topological-sort");var e=this.topologicalSortStateProps(this.dirtyProps);this.dirtyProps.clear(),this.isGlobalState();var n=new Set,r=new Set,o=new Set,a=this,i=a.state;e.forEach((function(e){var l;if(bt(e)){e=e.substring(4);var u=i[e];performance.mark("todo-call-setter-hook"),Qt(u,e,a,t.appScope)&&t.handleStateChange(a,e,null)}else t.handleStateChange(a,e,null);a.stateDependencies.has(e)&&a.stateDependencies.get(e).forEach((function(t){bt(t)?r.add(t):n.add(t)}));var c=null===(l=a.state)||void 0===l?void 0:l._global;if(c===y&&(c=t.appScope[d]()),c!==y){var s,f=(null===(s=c)||void 0===s?void 0:s._stateManager)||a;f.globalStateDependencies.has(e)&&o.add(f.globalStateDependencies.get(e))}})),r.size&&this.handleStatePropDependencies(r),n.size&&this.handleStatePropDependencies(n),o.size&&o.forEach((function(t,e){e.handleStatePropDependencies(t)})),a.clearStateMapsLastOperation(),this.parentStateManager&&this.parentStateManager.setDirtyProp(this.parentStateProp)}}},{key:"addStateDependency",value:function(t,e){this.stateDependencies.has(t)||this.stateDependencies.set(t,new Set),this.stateDependencies.get(t).add(e),Array.isArray(this.state[t])&&this.addStateDependency("".concat(t,".length"),e)}},{key:"clearStateDependencies",value:function(t){this.stateDependencies.has(t)&&this.stateDependencies.set(t,new Set)}},{key:"addStateNode",value:function(t,e){this.nodeManager.addStateNode(t,e)}},{key:"removeStateNode",value:function(t,e){this.nodeManager.removeStateNode(t,e)}},{key:"bindStatePropExpression",value:function(t,e,n){if(!e||!n){var r=nt(t),o=Te(a=r)||we(a)||Ee(a)||Oe();e=o[0],n=o.slice(1)}var a,i=n[0];if(!i)throw Error("Must specify state property name for State expression: ".concat(t));var l=this.state,u=Object.getOwnPropertyDescriptor(l,i);if(u||(l=l._global,u=Object.getOwnPropertyDescriptor(l,i)),!u)throw Error("Could not bind state property ".concat(i,". State property ").concat(i," not defined!"));if(Object.hasOwn(l,t))return l[t];var c=u.hasOwnProperty("value"),s=this;switch(e){case"negation":var f=c?s.privateState:s.state;ee(t,l,(function(){return!f[i]}),i);break;case"equality":var p=n[1];if(!p)throw Error("Must specify equality value for equality expression (is_something:equalToThis)");var h=c?s.privateState:s.state;ee(t,l,(function(){return h[i]===p}),i);break;case"ternary":var d=n[1];if(!d)throw Error("Ternary state expression (prop?truthy:falsy) must include at least a truthy value!");var y=n[2],v=c?s.privateState:s.state;ee(t,l,y?function(){return v[i]?d:y}:function(){return v[i]?d:void 0},i)}return l[t]}},{key:"getStateDependencies",value:function(){return this.stateDependencies}},{key:"use",value:function(t,e){t.call(this),ke(Ne,this).add(e)}},{key:"isUsing",value:function(t){return ke(Ne,this).has(t)}}],e&&Me(t.prototype,e),n&&Me(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}();const Ie=Le;function Re(t){return Object.hasOwn(t,"state")?t:t.firstElementChild}var De={replaceChildWith:function(t,e){var n,r,o,a=Re(t),i=null!==(n=null==a||null===(r=a.state)||void 0===r?void 0:r.key)&&void 0!==n?n:t.stateKey,l=Re(e),u=null!==(o=e.stateKey)&&void 0!==o?o:l.stateKey,c=this.replaceChild(e,t);return this.keyMap.delete(i),this.keyMap.set(u,e),c},swapChildWith:function(t,e){if(t!==e){var n=t.nextSiblingElement,r=e.nextSiblingElement;this.insertBefore(t,r),this.insertBefore(e,n)}},removeChild:function(t){var e,n=Re(t),r=null!==(e=t.stateKey)&&void 0!==e?e:n.stateKey;HTMLElement.prototype.removeChild.call(this,t),this.keyMap.delete(r)},insertBefore:function(t,e){var n;HTMLElement.prototype.insertBefore.call(this,t,e);var r=Re(t),o=null!==(n=t.stateKey)&&void 0!==n?n:r.stateKey;this.keyMap.set(o,t)},append:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(t=HTMLElement.prototype.append).call.apply(t,[this].concat(n));for(var o=0,a=n;o<a.length;o++){var i,l=a[o],u=Re(l),c=null!==(i=l.stateKey)&&void 0!==i?i:u.stateKey;this.keyMap.set(c,l)}},appendChild:function(t){var e;HTMLElement.prototype.appendChild.call(this,t);var n=Re(t),r=null!==(e=t.stateKey)&&void 0!==e?e:n.stateKey;this.keyMap.set(r,t)},prepend:function(t){var e;HTMLElement.prototype.prepend.call(this,t);var n=Re(t),r=null!==(e=t.stateKey)&&void 0!==e?e:n.stateKey;this.keyMap.set(r,t)},detach:function(){var t;if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]){var e=this.cloneNode(!0);e.$$originalElement=this,e.$$detached=j.CLONE,t=e}else this.setAttribute("inert",""),this.classList.add(T),this.$$detached=j.HIDE_UNHIDE,t=this;return t},reattach:function(){this.$$detached?(this.$$detached===j.HIDE_UNHIDE?(this.removeAttribute("inert",""),this.classList.remove(T)):this.$$detached===j.CLONE&&this.$$originalElement.replaceWith(this),this.$$detached=void 0):console.warn("Tried to reattach an undetached element")},initialAppend:function(){for(var t,e=this,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];(t=HTMLElement.prototype.append).call.apply(t,[this].concat(r));for(var a=function(){var t=l[i];e.pendingKeyMapActions.add((function(){var n=Re(t);if(n.isActive){var r,o,a=null!==(r=null==n||null===(o=n.state)||void 0===o?void 0:o.key)&&void 0!==r?r:t.stateKey;e.keyMap.set(a,t)}else n.addEventListener("active",(function(){var r,o,a=null!==(r=null==n||null===(o=n.state)||void 0===o?void 0:o.key)&&void 0!==r?r:t.stateKey;e.keyMap.set(a,t)}),{once:!0})}))},i=0,l=r;i<l.length;i++)a()}};function xe(t){return function(t){if(Array.isArray(t))return Fe(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||$e(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function He(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,i,l=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,e)||$e(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $e(t,e){if(t){if("string"==typeof t)return Fe(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fe(t,e):void 0}}function Fe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var Ue={map:function(t){var e,n=He(t.split(":"),2),r=n[0],o=n[1],a=this;e=a,Object.assign(e,De),e.keyMap=new Map,e.pendingKeyMapActions=new Set,e.style.willChange="opacity",this.onAfterPaint((function(){var t=function(t,e,n){var r=He(n.getState(t,!0),2),o=r[0],a=r[1];if(!o||!Array.isArray(o))throw new Error("State value for _map is not an array, in state property: "+t);if(!o.hasOwnProperty("_isStatefulArray"))throw new Error("Array '".concat(t,"' used for State Map must be a stateful array. Use a direct array value or an SSH with statify:true or stateMap: true "));o.makeStateMap();var i=yt(o,e,C(n)?"li":void 0,n);return n.innerHTML="",i.length&&n.append.apply(n,xe(i)),a}(r,o,a);if(!t)throw new Error("Mapping ".concat(r," to ").concat(o," failed!"));var e=t[r];if(!e||!e.hasOwnProperty("_isStatefulArray"))throw new Error("State array ".concat(r," for State Map must be stateful!"));t._stateManager.addStateMap(r,o,a)}))},text:function(t){var e=t;this.initialSetText(e)},bind:function(t){if("INPUT"===this.tagName){var e=He(t.split(":"),2),n=e[0],r=e[1];n&&r?p.has(n)?this.bindAttributeToState(n,r):console.warn("Attribute ".concat(n," is not supported for _bind command!")):console.warn("Incorrect usage of _bind command! Please pass <attribute-name>:<state-property-name>")}else console.warn("_bind command is only supported on input elements!")},bindprop:function(t){var e=He(t.split(":"),2),n=e[0],r=e[1],o=He(this.getState(n,!0),2),a=(o[0],o[1]);a?this[r]=a[n]:console.warn("State property ".concat(n," not found for bindProp command!"))}};function Ke(t){return Ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ke(t)}function Ge(t){return function(t){if(Array.isArray(t))return We(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ze(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Be(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,i,l=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,e)||ze(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qe(){return qe="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ze(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},qe.apply(null,arguments)}function ze(t,e){if(t){if("string"==typeof t)return We(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?We(t,e):void 0}}function We(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ve(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xe(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,an(r.key),r)}}function Ye(t,e,n){return e&&Xe(t.prototype,e),n&&Xe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Qe(t,e,n){return e=Ze(e),function(t,e){if(e&&("object"==Ke(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Je()?Reflect.construct(e,n||[],Ze(t).constructor):e.apply(t,n))}function Je(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Je=function(){return!!t})()}function Ze(t){return Ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ze(t)}function tn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&en(t,e)}function en(t,e){return en=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},en(t,e)}function nn(t,e,n){rn(t,e),e.set(t,n)}function rn(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function on(t,e,n){return(e=an(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function an(t){var e=function(t,e){if("object"!=Ke(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Ke(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ke(e)?e:e+""}function ln(t,e,n){return t.set(cn(t,e),n),n}function un(t,e){return t.get(cn(t,e))}function cn(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function sn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new WeakMap,o=new WeakSet,a=new WeakMap,i=function(t){function n(){var t,e,i;return Ve(this,n),t=Qe(this,n),rn(e=t,i=o),i.add(e),on(t,"host",null),nn(t,r,!1),on(t,"refName",void 0),nn(t,a,[]),t.isReactiveElement=!0,t.isNativeElement=!0,t}return tn(n,t),Ye(n,[{key:"activate",value:function(){var t,n=this,r=[],o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=ze(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}(this.getAttributeNames());try{for(o.s();!(t=o.n()).done;){var i=t.value,l=this.getAttribute(i);if(this.initialSetAttribute(i,l),0===i.indexOf("_")){var u=i.substring(1);r.push({command:u,args:l})}}}catch(t){o.e(t)}finally{o.f()}r.forEach((function(t){var r,o,a,i,l=t.command,u=t.args;null===(r=Ue[l])||void 0===r||r.call(n,u),null===(o=e.appCommands)||void 0===o||null===(o=o[l])||void 0===o||o.call(n,u);var c=(null===(a=n.host)||void 0===a?void 0:a.commands)||n.commands;null==c||null===(i=c[l])||void 0===i||i.call(n,u)})),un(a,this).forEach((function(t){return t.call(n)})),un(a,this).length=0,this.isActive=!0}},{key:"getHost",value:function(){var t;return this.host||this.parentNode||(null==this||null===(t=this.getRootNode())||void 0===t?void 0:t.host)}},{key:"connectedCallback",value:function(){var t=this;if(!un(r,this)){var e=this.getRootNode();this.host=e===document?this.parentElement:e.host,this.host?this.host.isActive?this.activate():this.host.addEventListener("active",(function(){return t.activate()}),{once:!0}):this.activate(),ln(r,this,!0)}}},{key:"disconnectedCallback",value:function(){var t,e=null!==(t=this.host)&&void 0!==t?t:this;e.ref&&delete e.ref[this.refName]}},{key:"attributeChangedCallback",value:function(t,e,n){var r=this;e!==n&&(this.isConnected?cn(o,this,l).call(this,t,e,n):un(a,this).push((function(){return cn(o,r,l).call(r,t,e,n)})))}},{key:"getState",value:function(t){var n,r,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=this.isNativeElement&&this.host?this.host:this,i=!1;if(a&&a.state&&Object.hasOwn(a.state,t)&&(i=!0,r=(n=a.state)[t]),!i)for(;!i&&a.host;)(a=a.host)&&a.state&&Object.hasOwn(a.state,t)&&(i=!0,r=(n=a.state)[t]);if(!i){var l=e[d]();l&&Object.hasOwn(l,t)&&(i=!0,r=(n=l)[t])}return i||(r=void 0),o?[r,n]:r}},{key:"findElement",value:function(t){var n=this.host||this,r=n;return e.SPROUT_CONFIG.useShadow&&(r=n.shadowRoot),Object.hasOwn(n.ref,t)?n.ref[t]:r.querySelector('[ref="'.concat(t,'"]'))}},{key:"initialSetText",value:function(t){ht.call(this,t)}},{key:"initialSetAttribute",value:function(t,e){e=String(e);var n=0===e.indexOf("@"),r=function(t){return 0===t.indexOf(":")}(t),o=e;if(r){n&&console.warn("Mixing between prop attributes and state attributes can lead to unexpected results!");var a=e,i=t.substring(1);pt.call(this,i,a)}else{if(n){var l=this.getHost();l||console.warn("Host element not found when resolving prop attribute ".concat(t,":").concat(e));var u=e.substring(1);o=l.getAttribute(u)}ft.call(this,t,o)}}},{key:"onAfterPaint",value:function(t){requestAnimationFrame((function(){return requestAnimationFrame(t)}))}}])}(t);function l(t,e,n){var r=this.isNativeElement?this.host||this.getRootNode().host:this;if("ref"===t){var o=n;r.ref[o]=this,this.refName=o}}if(on(i,"observedAttributes",c),n){var u=new WeakMap,s=function(t){function e(){var t;Ve(this,e);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return on(t=Qe(this,e,[].concat(r)),"boundAttributesToState",new Map),nn(t,u,void 0),t}return tn(e,t),Ye(e,[{key:"bindAttributeToState",value:function(t,e){this.boundAttributesToState.set(t,e)}},{key:"updateStateFromAttribute",value:function(t){var e=rt(this.getAttribute(t)),n=this.boundAttributesToState.get(t),r=Be(this.getState(n,!0),2),o=r[0],a=r[1];if(o===Symbol.for(E.STATE_NOT_FOUND))throw Error("updateStateFromAttribute: State property ".concat(n," not found"));o!==e&&(a[n]=e)}},{key:"activate",value:function(){qe(Ze(e.prototype),"activate",this).call(this),ln(u,this,(function(){var t=new Event("inputChange",{bubbles:!0,composed:!0});if("checkbox"===this.type){var e=this.host.state._stateManager.nodeManager.bindableAttributesStateNodes.get("checked"),n=null;e.has(this)&&(n=e.get(this)),this.checked?(n||(n=document.createAttribute("checked")),this.setAttributeNode(n)):(n||(n=this.getAttributeNode("checked")),n&&this.removeAttributeNode(n))}this.dispatchEvent(t)})),this.addEventListener("change",un(u,this),!1)}},{key:"disconnectedCallback",value:function(){qe(Ze(e.prototype),"disconnectedCallback",this).call(this),un(u,this)&&this.removeEventListener("change",un(u,this)),this.boundAttributesToState.clear()}},{key:"attributeChangedCallback",value:function(t,n,r){if(0===t.indexOf(":"))return console.warn("State attributes should never be changed explicitely!"),!1;if(qe(Ze(e.prototype),"attributeChangedCallback",this).apply(this,arguments),f.has(t)){var o=rt(r);this[t]!==o&&(this[t]=o)}this.boundAttributesToState.has(t)&&this.updateStateFromAttribute(t)}}])}(i);return on(s,"observedAttributes",i.observedAttributes.concat(Ge(p))),s}return i}function fn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return pn(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function pn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function hn(t){return hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hn(t)}function dn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,En(r.key),r)}}function yn(t,e){if(e&&("object"==hn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function vn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(vn=function(){return!!t})()}function mn(){return mn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=bn(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},mn.apply(null,arguments)}function bn(t){return bn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bn(t)}function gn(t,e){return gn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},gn(t,e)}function wn(t,e,n){Sn(t,e),e.set(t,n)}function Sn(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function On(t,e,n){return(e=En(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function En(t){var e=function(t,e){if("object"!=hn(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=hn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==hn(e)?e:e+""}function An(t,e){return t.get(Mn(t,e))}function Tn(t,e,n){return t.set(Mn(t,e),n),n}function Mn(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}var jn=new CSSStyleSheet;function Pn(t){return Pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pn(t)}function _n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,a,i,l=[],u=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(t){c=!0,o=t}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(t,e)||Cn(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kn(t){return function(t){if(Array.isArray(t))return Nn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Cn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Cn(t,e){if(t){if("string"==typeof t)return Nn(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Nn(t,e):void 0}}function Nn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Ln(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Hn(r.key),r)}}function In(t,e,n){return e=Dn(e),function(t,e){if(e&&("object"==Pn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Rn()?Reflect.construct(e,n||[],Dn(t).constructor):e.apply(t,n))}function Rn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Rn=function(){return!!t})()}function Dn(t){return Dn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dn(t)}function xn(t,e){return xn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xn(t,e)}function Hn(t){var e=function(t,e){if("object"!=Pn(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Pn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Pn(e)?e:e+""}function $n(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function Fn(t,e,n){return t.set(Kn(t,e),n),n}function Un(t,e){return t.get(Kn(t,e))}function Kn(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function Gn(t){return Gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gn(t)}function Bn(){Bn=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function s(t,e,n,r){var a=e&&e.prototype instanceof m?e:m,i=Object.create(a.prototype),l=new k(r||[]);return o(i,"_invoke",{value:M(t,n,l)}),i}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",v={};function m(){}function b(){}function g(){}var w={};c(w,i,(function(){return this}));var S=Object.getPrototypeOf,O=S&&S(S(C([])));O&&O!==n&&r.call(O,i)&&(w=O);var E=g.prototype=m.prototype=Object.create(w);function A(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function n(o,a,i,l){var u=f(t[o],t,a);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==Gn(s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,i,l)}),(function(t){n("throw",t,i,l)})):e.resolve(s).then((function(t){c.value=t,i(c)}),(function(t){return n("throw",t,i,l)}))}l(u.arg)}var a;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return a=a?a.then(o,o):o()}})}function M(e,n,r){var o=p;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:t,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var u=j(l,r);if(u){if(u===v)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=d;var c=f(e,n,r);if("normal"===c.type){if(o=r.done?y:h,c.arg===v)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=y,r.method="throw",r.arg=c.arg)}}}function j(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var a=f(o,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,v;var i=a.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(Gn(e)+" is not iterable")}return b.prototype=g,o(E,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:b,configurable:!0}),b.displayName=c(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,c(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},A(T.prototype),c(T.prototype,l,(function(){return this})),e.AsyncIterator=T,e.async=function(t,n,r,o,a){void 0===a&&(a=Promise);var i=new T(s(t,n,r,o),a);return e.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},A(E),c(E,u,"Generator"),c(E,i,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=C,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(_),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function o(r,o){return l.type="throw",l.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,v):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;_(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),v}},e}function qn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Wn(r.key),r)}}function zn(t,e,n){return e&&qn(t.prototype,e),n&&qn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Wn(t){var e=function(t,e){if("object"!=Gn(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Gn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Gn(e)?e:e+""}function Vn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xn(t,e,n){return e=Qn(e),function(t,e){if(e&&("object"==Gn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,Yn()?Reflect.construct(e,n||[],Qn(t).constructor):e.apply(t,n))}function Yn(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Yn=function(){return!!t})()}function Qn(t){return Qn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Qn(t)}function Jn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Zn(t,e)}function Zn(t,e){return Zn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Zn(t,e)}function tr(t,e,n,r,o,a,i){try{var l=t[a](i),u=l.value}catch(t){return void n(t)}l.done?e(u):Promise.resolve(u).then(r,o)}function er(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function i(t){tr(a,r,o,i,l,"next",t)}function l(t){tr(a,r,o,i,l,"throw",t)}i(void 0)}))}}function nr(t){return nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nr(t)}function rr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,or(r.key),r)}}function or(t){var e=function(t,e){if("object"!=nr(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=nr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==nr(e)?e:e+""}function ar(t,e,n){return e=lr(e),function(t,e){if(e&&("object"==nr(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ir()?Reflect.construct(e,n||[],lr(t).constructor):e.apply(t,n))}function ir(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ir=function(){return!!t})()}function lr(t){return lr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lr(t)}function ur(t,e){return ur=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ur(t,e)}function cr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}jn.replaceSync(":host { contain: layout paint; }");var sr=document.currentScript,fr=(null==sr?void 0:sr.hasAttribute("strict"))||!1,pr=Ie,hr={useShadow:!0,allowAppScopeAccess:!0,useDSD:!1,strict:fr,appName:(null==sr?void 0:sr.getAttribute("app"))||"sprout-app",stateManagerClass:pr};hr.allowAppScopeAccess&&Object.defineProperty(globalThis,"sproutApps",{value:{},writable:!1});var dr,yr=new CSSStyleSheet;yr.replaceSync(M),document.adoptedStyleSheets=[].concat(function(t){if(Array.isArray(t))return cr(t)}(dr=document.adoptedStyleSheets)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(dr)||function(t,e){if(t){if("string"==typeof t)return cr(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cr(t,e):void 0}}(dr)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[yr]);var vr,mr=(window,{window,document:null===(vr=window)||void 0===vr?void 0:vr.document});hr.allowAppScopeAccess&&Object.defineProperty(globalThis.sproutApps,hr.appName,{value:mr,writable:!1}),mr.SPROUT_CONFIG=Object.seal(hr);var br=Object.prototype.hasOwnProperty;J(Object.prototype,"hasOwnProperty",br),mr[d]=function(){return y},mr.setGlobalState=function(){var t=Vt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},void 0,void 0,vt,!0,mr).state,e="SproutGlobalState";return Object.defineProperty(mr,e,{value:t,writable:!1,configurable:!1}),Object.defineProperty(mr,d,{value:function(){return mr[e]}}),mr[e]},mr.setCommands=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(mr,"appCommands",{value:t,writable:!1,configurable:!1})};var gr={};v.forEach((function(t){return gr[t.element]=sn(t.class,mr,!0)})),mr.ReactiveCustomElement=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window,e=sn(HTMLElement,t),n=(t.SPROUT_CONFIG.stateManagerClass,new WeakMap),r=new WeakMap,o=new WeakMap,a=new WeakMap,i=new WeakMap,l=new WeakMap,u=new WeakMap,c=new WeakMap,s=new WeakSet,f=function(e){function f(){var t,e,h,d,v=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,b=arguments.length>1?arguments[1]:void 0,g=arguments.length>2?arguments[2]:void 0,w=arguments.length>3?arguments[3]:void 0,S=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),e=this,h=bn(h=f),function(t,e){Sn(t,e),e.add(t)}(t=yn(e,vn()?Reflect.construct(h,d||[],bn(e).constructor):h.apply(e,d)),s),On(t,"ownerMapElement",void 0),On(t,"state",void 0),On(t,"stateKey",void 0),wn(t,n,!1),wn(t,r,{init:null,mount:null,stateful:null,active:null,unmount:null}),wn(t,o,void 0),wn(t,a,void 0),wn(t,i,void 0),On(t,"events",void 0),On(t,"eventsMap",new Map),wn(t,l,void 0),On(t,"propAttributes",new Map),wn(t,u,!1),wn(t,c,void 0),On(t,"commands",void 0),On(t,"ref",{}),On(t,"canonicalTagName",void 0),"CONDITIONAL-ELEMENT"===t.tagName)return yn(t);if(t.isNativeElement=!1,Tn(u,t,S),w&&Tn(i,t,w),t.canonicalTagName=t.localName,An(u,t))t.canonicalTagName=t.localName.substring(0,t.localName.indexOf("-dsd"));else{if(g){var O=new CSSStyleSheet;O.replaceSync(g),Tn(a,t,O)}Tn(o,t,v?document.importNode(v,!0):document.importNode(m,!0)),Mn(s,t,y).call(t)}return b&&Mn(s,t,p).call(t,b),An(r,t).init&&An(r,t).init.call(t),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gn(t,e)}(f,e),d=f,(g=[{key:"setInitialState",value:function(t){this.initialState?Object.assign(this.initialState,t):this.initialState=t,t.hasOwnProperty("key")&&(this.stateKey=t.key)}},{key:"disconnectedCallback",value:function(){Mn(s,this,v).call(this),this.state=void 0,this.isActive=!1,An(r,this).unmount&&An(r,this).unmount.call(this)}},{key:"activate",value:function(){mn(bn(f.prototype),"activate",this).call(this),Mn(s,this,b).call(this),An(r,this).active&&An(r,this).active.call(this)}},{key:"findElement",value:function(e){var n,r,o=this,a=this;return t.SPROUT_CONFIG.useShadow&&(a=o.shadowRoot),Object.hasOwn(o.ref,e)?o.ref[e]:(null===(n=a)||void 0===n||null===(r=n.querySelector)||void 0===r?void 0:r.call(n,'[ref="'.concat(e,'"]')))||null}},{key:"connectedCallback",value:function(){var t=this;if(this.setAttribute("tagName",this.canonicalTagName),!An(n,this)){var e=this.getRootNode().host;An(r,this).mount&&An(r,this).mount.call(this);var o=function(){Mn(s,t,h).call(t),t.isActive=!0,t.dispatchEvent(new CustomEvent("active")),An(r,t).stateful&&An(r,t).stateful.call(t),t.activate()};e?e.isActive?o():e.addEventListener("active",o,{once:!0}):setTimeout(o,0),Tn(n,this,!0)}}},{key:"attributeChangedCallback",value:function(t,e,n){e!==n&&("hidden"===t&&(null===n?this.dispatchEvent(new CustomEvent("unhide",{bubbles:!0})):this.dispatchEvent(new CustomEvent("hide",{bubbles:!0}))),this.propAttributes.has(t)&&this.propAttributes.get(t).forEach((function(t){t.nodeValue=n,"CONDITIONAL-RENDER"===t.ownerElement.tagName&&t.ownerElement.render()})))}}])&&dn(d.prototype,g),w&&dn(d,w),Object.defineProperty(d,"prototype",{writable:!1}),d;var d,g,w}(e);function p(t){var e=this;if(Tn(c,this,t.settings),this.commands=t.commands,t.events){var o,a,i=function(t,n,r){e.eventsMap.has(t)||e.eventsMap.set(t,new Map),e.eventsMap.get(t).set(n,r)};for(var l in t.events)if("function"===(a=hn(o=t.events[l])))i("click",l,o);else if("object"===a)for(var u in o)i(u,l,o[u]);this.isConnected&&Mn(s,this,b).call(this)}for(var f in t.state&&(this.setInitialState(t.state),this.isConnected&&An(n,this)&&!this.state&&Mn(s,this,h).call(this)),An(r,this))t.hasOwnProperty(f)&&(An(r,this)[f]=t[f])}function h(){var e;if(this.initialState&&(null===(e=this.state)||void 0===e||!e._isActive)){var n=this.initialState;if(n._stateManager)this.state=n._stateManager.state;else{var r=Vt(n,void 0,void 0,vt,!1,t);this.state=r.state,this.state.$host=this}this.state._isActive=!0}}function y(){if(t.SPROUT_CONFIG.useShadow)this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot.adoptedStyleSheets=[jn],An(i,this)&&this.shadowRoot.adoptedStyleSheets.push(An(i,this)),An(a,this)&&this.shadowRoot.adoptedStyleSheets.push(An(a,this)),this.shadowRoot.appendChild(An(o,this));else{var e=new DocumentFragment;e.appendChild(An(o,this)),this.appendChild(e)}}function v(){if(this.eventsMap.size){var t,e=fn(this.eventsMap.keys());try{for(e.s();!(t=e.n()).done;){var n=t.value;this.shadowRoot.removeEventListener(n,An(l,this),!1)}}catch(t){e.e(t)}finally{e.f()}}}function b(){if(!An(l,this)&&this.eventsMap.size){var e=t[d]();Tn(l,this,(function(t){var n=this.host,r=n.eventsMap.get(t.type);if(!r)return!1;var o,a=fn(t.composedPath());try{for(a.s();!(o=a.n()).done;){var i=o.value;if(i&&i.refName&&r.has(i.refName)){var l=i,u=l.refName;r.get(u).call(l,t,n,e)}}}catch(t){a.e(t)}finally{a.f()}t.stopPropagation()}));var n,r=fn(this.eventsMap.keys());try{for(r.s();!(n=r.n()).done;){var o=n.value;this.shadowRoot.addEventListener(o,An(l,this),{capture:!0})}}catch(t){r.e(t)}finally{r.f()}}}return f}(mr),function(t,e){function n(t,e,n){return r.apply(this,arguments)}function r(){return(r=er(Bn().mark((function e(n,r,o){var a,i,l,u,c;return Bn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.content,(i=a.querySelector("style"))&&a.removeChild(i),(u=a.querySelector("script"))&&(c=u.textContent,a.removeChild(u),c&&0!==c.trim().length))try{l=Function(c)()}catch(t){console.warn("Failed to evaluate runtime for ".concat(r," from template script"),t)}customElements.define(r,function(t){function e(){var t;return Vn(this,e),Xn(this,e,[a,l,null===(t=i)||void 0===t?void 0:t.textContent,o])}return Jn(e,t),zn(e)}(t.ReactiveCustomElement)),customElements.define("".concat(r,"-dsd"),function(t){function e(){return Vn(this,e),Xn(this,e,[a,l,null,o,!0])}return Jn(e,t),zn(e)}(t.ReactiveCustomElement));case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){var r,o=new CSSStyleSheet,a=document.querySelector('head > style[app="'.concat(e,'"]'));if(a)o.replaceSync(a.textContent);else{var i,l=null===(i=globalThis.SPROUT_COMPILED_STYLES)||void 0===i?void 0:i[e];o.replaceSync(l||"")}o.insertRule(M),"function"==typeof globalThis["".concat(e,"_runtime")]&&globalThis["".concat(e,"_runtime")].call(t);var u=null===(r=globalThis.SPROUT_COMPILED_TEMPLATES)||void 0===r?void 0:r[e];u&&"function"==typeof u.forEach?u.forEach((function(t,e){e&&t&&n(t,e,o)})):Array.prototype.forEach.call(document.querySelectorAll('template[app="'.concat(e,'"]')),(function(t){var e=t.getAttribute("for");e&&n(t,e,o)}))}()}(mr,hr.appName),v.forEach((function(t){customElements.define("reactive-".concat(t.element),gr[t.element],{extends:t.element})}));var wr=sn(HTMLHeadingElement,mr);["h1","h2","h3","h4","h5","h6"].forEach((function(t){customElements.define("reactive-".concat(t),function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),ar(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ur(t,e)}(e,t),function(t,e,n){return e&&rr(t.prototype,e),n&&rr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(e)}(wr),{extends:t})}));var Sr=sn(HTMLInputElement,mr,!0);customElements.define("reactive-input",Sr,{extends:"input"});var Or=function(t){var e,n,r,o=new WeakMap,a=new WeakMap,i=new WeakMap,l=function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var n=arguments.length,r=new Array(n),l=0;l<n;l++)r[l]=arguments[l];return $n(t=In(this,e,[].concat(r)),o,void 0),$n(t,a,void 0),$n(t,i,void 0),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&xn(t,e)}(e,t),n=e,r=[{key:"render",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(Un(o,this)){if(void 0===(t=this.getState(Un(a,this))))throw Error("State value for ".concat(Un(a,this)," not found while rendering conditional-render element:"),this)}else if(void 0===(t=this.getAttribute("_condition")))throw Error("_condition value not found while rendering conditional-render element:",this);var r=[];Un(i,this).forEach((function(e){var n=e.condition,o=e.elements;(function(t,e,n){if("always"===t)return!0;switch(t){case"==":default:return n==e;case"===":return n===e;case"!=":return n!=e;case"!==":return n!==e;case"<":return n<e;case"<=":return n<=e;case">":return n>e;case">=":return n>=e}})(n.operator,n.value,t)&&r.push.apply(r,kn(o))})),n?(this.innerHTML="",this.append.apply(this,r)):r.length&&U(this,(function(){e.innerHTML="",e.append.apply(e,r)}))}},{key:"generateRenderMap",value:function(){var t=new Map;t.set("always",[]),kn(this.children).forEach((function(e){var n,r,o=e.getAttribute("_if").replaceAll(" ","");if(o)if(t.has(o))t.get(o).elements.push(e);else{var a=_n(cond.trim().split(CONDITIONAL_OPERATORS_REGEX),3),i=a[1],l=a[2],u={operator:i,value:(r=n=l,"true"===n?r=!0:"false"===n?r=!1:isNaN(Number(n))||(r=Number(n)),r)};t.set(o,{condition:u,elements:[e]})}else t.get("always").elements.push(e)})),Fn(i,this,t)}},{key:"activate",value:function(){var t=this.getAttribute("_condition");if(!t)throw Error("conditional-render elements must have a _condition attribute!");if(0===t.indexOf("@")?(Z.call(this,"_condition",t),Fn(o,this,!1),Fn(a,this,t.substring(1))):(Fn(o,this,!0),Fn(a,this,t)),this.children&&this.children.length||console.warn("Conditional element doesn't have any children!"),Un(o,this)){var e=Un(a,this),n=_n(this.getState(e,!0),2),r=n[0],i=n[1];if(void 0===Pn(r))throw Error("State property ".concat(e," not defined for _condition command!"));var l=i._stateManager;l.has("conditional-element")||l.use(Ft,"conditional-element"),l.addConditionallyRenderingElements(e,this),this.generateRenderMap(),this.render(!0)}else this.render(!0)}}],r&&Ln(n.prototype,r),l&&Ln(n,l),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,l}(t);return e=l,r=["_condition"],(n=Hn(n="observedAttributes"))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,l}(sn(HTMLElement,mr));customElements.define("conditional-render",Or)})();
|
|
2
2
|
//# sourceMappingURL=sprout-core.min.js.map
|
package/sprout-core.min.js.gz
CHANGED
|
Binary file
|