mates 0.0.6 → 0.0.7

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/dist/index.js CHANGED
@@ -3,22 +3,17 @@
3
3
  * @license
4
4
  * Copyright 2017 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
- */const t=globalThis,e=t.trustedTypes,s=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,n="$lit$",i=`lit$${Math.random().toFixed(9).slice(2)}$`,o="?"+i,r=`<${o}>`,l=document,c=()=>l.createComment(""),h=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,u="[ \t\n\f\r]",d=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,p=/-->/g,_=/>/g,f=RegExp(`>|${u}(?:([^\\s"'>=/]+)(${u}*=${u}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),$=/'/g,A=/"/g,y=/^(?:script|style|textarea|title)$/i,g=(t=>(e,...s)=>({_$litType$:t,strings:e,values:s}))(1),v=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),b=new WeakMap,w=l.createTreeWalker(l,129);function x(t,e){if(!a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(e):e}let C=class t{constructor({strings:s,_$litType$:l},h){let a;this.parts=[];let u=0,g=0;const v=s.length-1,m=this.parts,[b,C]=((t,e)=>{const s=t.length-1,o=[];let l,c=2===e?"<svg>":3===e?"<math>":"",h=d;for(let e=0;e<s;e++){const s=t[e];let a,u,g=-1,v=0;for(;v<s.length&&(h.lastIndex=v,u=h.exec(s),null!==u);)v=h.lastIndex,h===d?"!--"===u[1]?h=p:void 0!==u[1]?h=_:void 0!==u[2]?(y.test(u[2])&&(l=RegExp("</"+u[2],"g")),h=f):void 0!==u[3]&&(h=f):h===f?">"===u[0]?(h=l??d,g=-1):void 0===u[1]?g=-2:(g=h.lastIndex-u[2].length,a=u[1],h=void 0===u[3]?f:'"'===u[3]?A:$):h===A||h===$?h=f:h===p||h===_?h=d:(h=f,l=void 0);const m=h===f&&t[e+1].startsWith("/>")?" ":"";c+=h===d?s+r:g>=0?(o.push(a),s.slice(0,g)+n+s.slice(g)+i+m):s+i+(-2===g?e:m)}return[x(t,c+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),o]})(s,l);if(this.el=t.createElement(b,h),w.currentNode=this.el.content,2===l||3===l){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(a=w.nextNode())&&m.length<v;){if(1===a.nodeType){if(a.hasAttributes())for(const t of a.getAttributeNames())if(t.endsWith(n)){const e=C[g++],s=a.getAttribute(t).split(i),n=/([.?@])?(.*)/.exec(e);m.push({type:1,index:u,name:n[2],strings:s,ctor:"."===n[1]?N:"?"===n[1]?T:"@"===n[1]?O:M}),a.removeAttribute(t)}else t.startsWith(i)&&(m.push({type:6,index:u}),a.removeAttribute(t));if(y.test(a.tagName)){const t=a.textContent.split(i),s=t.length-1;if(s>0){a.textContent=e?e.emptyScript:"";for(let e=0;e<s;e++)a.append(t[e],c()),w.nextNode(),m.push({type:2,index:++u});a.append(t[s],c())}}}else if(8===a.nodeType)if(a.data===o)m.push({type:2,index:u});else{let t=-1;for(;-1!==(t=a.data.indexOf(i,t+1));)m.push({type:7,index:u}),t+=i.length-1}u++}}static createElement(t,e){const s=l.createElement("template");return s.innerHTML=t,s}};function E(t,e,s=t,n){if(e===v)return e;let i=void 0!==n?s._$Co?.[n]:s._$Cl;const o=h(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),void 0===o?i=void 0:(i=new o(t),i._$AT(t,s,n)),void 0!==n?(s._$Co??=[])[n]=i:s._$Cl=i),void 0!==i&&(e=E(t,i._$AS(t,e.values),i,n)),e}let H=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,n=(t?.creationScope??l).importNode(e,!0);w.currentNode=n;let i=w.nextNode(),o=0,r=0,c=s[0];for(;void 0!==c;){if(o===c.index){let e;2===c.type?e=new S(i,i.nextSibling,this,t):1===c.type?e=new c.ctor(i,c.name,c.strings,this,t):6===c.type&&(e=new P(i,this,t)),this._$AV.push(e),c=s[++r]}o!==c?.index&&(i=w.nextNode(),o++)}return w.currentNode=l,n}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},S=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=m,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=E(this,t,e),h(t)?t===m||null==t||""===t?(this._$AH!==m&&this._$AR(),this._$AH=m):t!==this._$AH&&t!==v&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>a(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==m&&h(this._$AH)?this._$AA.nextSibling.data=t:this.T(l.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=C.createElement(x(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new H(n,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=b.get(t.strings);return void 0===e&&b.set(t.strings,e=new C(t)),e}k(e){a(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let n,i=0;for(const o of e)i===s.length?s.push(n=new t(this.O(c()),this.O(c()),this,this.options)):n=s[i],n._$AI(o),i++;i<s.length&&(this._$AR(n&&n._$AB.nextSibling,i),s.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}},M=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,i){this.type=1,this._$AH=m,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=m}_$AI(t,e=this,s,n){const i=this.strings;let o=!1;if(void 0===i)t=E(this,t,e,0),o=!h(t)||t!==this._$AH&&t!==v,o&&(this._$AH=t);else{const n=t;let r,l;for(t=i[0],r=0;r<i.length-1;r++)l=E(this,n[s+r],e,r),l===v&&(l=this._$AH[r]),o||=!h(l)||l!==this._$AH[r],l===m?t=m:t!==m&&(t+=(l??"")+i[r+1]),this._$AH[r]=l}o&&!n&&this.j(t)}j(t){t===m?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},N=class extends M{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===m?void 0:t}},T=class extends M{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==m)}},O=class extends M{constructor(t,e,s,n,i){super(t,e,s,n,i),this.type=5}_$AI(t,e=this){if((t=E(this,t,e,0)??m)===v)return;const s=this._$AH,n=t===m&&s!==m||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==m&&(s===m||n);n&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},P=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){E(this,t)}};const j=t.litHtmlPolyfillSupport;j?.(C,S),(t.litHtmlVersions??=[]).push("3.3.1");let k=!1;const U=()=>k;const V=new class{constructor(){this.pendingComponents=new Set,this.isScheduled=!1}schedule(t){this.pendingComponents.add(t),this.isScheduled||(this.isScheduled=!0,queueMicrotask(()=>{this.pendingComponents.forEach(t=>t._render()),this.pendingComponents.clear(),this.isScheduled=!1}))}};class B extends HTMLElement{onEachUpdate(t){this.onEachUpdateCallbacks.push(t)}constructor(){super(),this.lastVersion=-1,this.onEachUpdateCallbacks=[],this._isViewLoading=!1,this._props={},this._propsFn=()=>this._props,this._view=null,this._componentFn=null,this._hasMounted=!1,this._renderScheduled=!1,this.componentId=Math.random(),this.cleanups=new Map,this._xviewRender=()=>{}}setter(t){const e=this;return(...s)=>(et(),V.schedule(e),t(...s))}set props(t){"function"==typeof t?this._propsFn=t:(this._props=t,this._propsFn=()=>this._props),V.schedule(this)}get props(){return this._props}set view(t){if("AsyncFunction"===t.constructor.name||t instanceof Promise)return this._isViewLoading=!0,void("function"==typeof t?t():t).then(t=>{this._isViewLoading=!1,this.view=t.default||t});this.oldView!==t&&(this.oldView=t,this._view=t,this._hasMounted&&(this.cleanups.forEach(t=>t()),this.cleanups.clear(),this._hasMounted=!1),V.schedule(this))}get view(){return this._view}callOnEachUpdate(){this.onEachUpdateCallbacks.forEach(t=>t())}disconnectedCallback(){this.cleanups.forEach(t=>t()),this.cleanups.clear()}addToCleanUps(t,e){this.cleanups.set(t,e)}_render(){if(this._view&&!this._isViewLoading&&!this._renderScheduled){if(!this._hasMounted){const t=this._view;return this._componentFn=I(this,()=>t(this._propsFn,this.setter.bind(this))),void("function"==typeof this._componentFn&&(this._xviewRender=()=>{if(console.log("render",this.lastVersion,exports.globalVersion),k=!0,this.lastVersion===exports.globalVersion)return;((t,e,s)=>{const n=s?.renderBefore??e;let i=n._$litPart$;if(void 0===i){const t=s?.renderBefore??null;n._$litPart$=i=new S(e.insertBefore(c(),t),t,void 0,s??{})}i._$AI(t)})(I(this,this._componentFn),this),this.lastVersion=exports.globalVersion,k=!1},this.callOnEachUpdate(),this._xviewRender(),this._hasMounted=!0))}this._xviewRender&&(this.callOnEachUpdate(),this._xviewRender())}}}customElements.define("x-view",B);const R=[];function I(t,e){R.push(t);let s=null;try{s=e()}finally{R.pop()}return s}function D(t=!0){const e=R[R.length-1];if(!e){if(t)throw new Error("getCurrentHost(): No active host context");return null}return e}function L(t,e=!0,s){const n=D(e);if(n&&t&&!n.cleanups.has(t)){const e=(s||t.subscribe)?.(()=>{V.schedule(n)});n.addToCleanUps(t,e)}}const W=t=>{if(K)return z;J();const e=new Set;try{const s=D(),n=(...n)=>{t(...n),et(),e.forEach(t=>t()),s&&V.schedule(s)};return n.subscribe=t=>(e.add(t),()=>e.delete(t)),n}catch(t){throw new Error("You can only use setter or _ inside a view or component.")}},F=W,q=()=>{J();const t=D();return e=>{e?.(),et(),V.schedule(t)}};let z,K=!1;const Z=t=>{K=t},X=t=>{z=t},G=()=>K,J=()=>{if(U())throw Error("atoms, units, bubbles, getters, setters and actions can't be created inside the template function, you can create them in view function. Because template function gets called everytime the view updates.")};let Y=!1,Q=new Set;function tt(t){let e=null,s=1;J();const n=()=>{if(e)try{let t=!1;for(const[s,n]of e.storeDeps){if(s.__version__!==n){t=!0;break}}if(!t)for(const[s,n]of e.getterDeps){if(s.areVersionsChanged(n)){t=!0;break}}if(!t)return Y&&Q.add(i),e.value}catch(t){console.error(t)}const n=Q,o=Y;let r;Q=new Set,Y=!0;let l=new Map,c=new Map;try{r=t(),Q.forEach(t=>{"function"==typeof t&&"function"==typeof t.areVersionsChanged?c.set(t,t.version):t&&"number"==typeof t.__version__&&l.set(t,t.__version__)}),e={value:r,storeDeps:new Map(l),getterDeps:new Map(c)},s++}catch(t){throw e=null,s++,Q=n,Y=o,t}finally{Q=n,Y=o,o&&Q.add(i)}return r},i=()=>n();return Object.defineProperty(i,"val",{get:()=>n()}),Object.defineProperty(i,"version",{get:()=>s}),Object.defineProperty(i,"areVersionsChanged",{value:t=>{if(!e)return!0;if(void 0!==t){let n=!1;for(const[t,s]of e.storeDeps){if(t.__version__!==s){n=!0;break}}if(!n)for(const[t,s]of e.getterDeps){if(t.areVersionsChanged(s)){n=!0;break}}return!!n||s!==t}for(const[t,s]of e.storeDeps){if(t.__version__!==s)return!0}for(const[t,s]of e.getterDeps){if(t.areVersionsChanged(s))return!0}return!1}}),i}exports.globalVersion=0;const et=()=>{exports.globalVersion++};function st(t,e=!1){J();let s=t;e&&nt(s);let n=!1,i=new Set,o=!1,r=1;const l=()=>{r++,n||(n=!0,queueMicrotask(()=>{console.log("notify",i.size),[...i].forEach(t=>{try{t?.()}catch(t){console.error(t)}}),n=!1}))},c=()=>(L(h,!1),Y&&Q.add(h),s),h=()=>c();return h.get=()=>c(),h.set=t=>{if(o)return;const n="function"==typeof t?t(s):t;s=n,e&&nt(s),et(),l()},h.update=t=>{if(!o&&"object"==typeof s&&null!==s){if(e)throw new Error("update() is not supported for iAtoms or iAtom with deepFreeze enabled");t(s),et(),l()}},h.subscribe=t=>(i.add(t),()=>i.delete(t)),h.lock=()=>{o=!0},h.unlock=()=>{o=!1},Object.defineProperty(h,"__isAtom___",{value:!0,writable:!1}),Object.defineProperty(h,"val",{get:()=>h.get()}),Object.defineProperty(h,"__version__",{get:()=>(L(h,!1),r)}),Object.defineProperty(h,"toJSON",{value:()=>JSON.stringify(s)}),Object.defineProperty(h,"__id__",{value:Math.random().toString(36).substring(2,15),writable:!1}),h.select=(t,n=void 0)=>{if(!e)throw Error("select() can only be used with iAtoms");let i=n;try{i=t(s)}catch(t){i=n}const o=()=>i,r=D(),l=h.subscribe(()=>{const e=i;try{i=t(s)}catch(t){i=n}e!==i&&r&&V.schedule(r)});return r&&!r?.cleanups?.has?.(o)&&r?.addToCleanUps?.(o,l),o},h}function nt(t){try{return Object.keys(t).forEach(e=>{"object"!=typeof t[e]||null===t[e]||Object.isFrozen(t[e])||nt(t[e])}),Object.freeze(t)}catch(t){console.error(t)}}function it(t,e){let s=t;const n=new Set;let i=null,o=null,r=null,l=null,c=null,h=null,a=null,u=0,d=null,p=null;const _=t=>{n.forEach(e=>{try{e(t)}catch(t){console.error(t)}})},f=(t,e)=>{if(i){return i((...e)=>{const n=s.call(t,...e);return _(n),n},...e)}const n=s.call(t,...e);return _(n),n};function $(...t){const s=this;return e?.debounce?((t,s)=>(o&&clearTimeout(o),r||(r=new Promise(n=>{l=n,o=setTimeout(()=>{const e=f(t,s);n(e),o=null,r=null,l=null},e?.debounce||0)}),r)))(s,t):e?.throttle?((t,s)=>{const n=Date.now(),i=n-u,o=e?.throttle||0;return i>=o?(u=n,f(t,s)):(d=s,p=t,h||(h=new Promise(t=>{a=t,c=setTimeout(()=>{if(d&&p){u=Date.now();const e=f(p,d);t(e),d=null,p=null}c=null,h=null,a=null},o-i)}),h))})(s,t):f(s,t)}return $.subscribe=t=>(n.add(t),()=>n.delete(t)),$.set=t=>{s=t},$.intercept=t=>{i=t},$.cancel=()=>{o&&(clearTimeout(o),o=null),r&&l&&(l(void 0),r=null,l=null),c&&(clearTimeout(c),c=null,u=0,d=null,p=null),h&&a&&(a(void 0),h=null,a=null)},$}const ot={path:st(window.location.pathname),navigateTo(t,e){e?window.history.replaceState({},"",t):window.history.pushState({},"",t),this.path.set(t)},matchPath:t=>rt(t)};window.addEventListener("popstate",()=>{ot.path.set(window.location.pathname)}),window.addEventListener("hashchange",()=>{ot.path.set(window.location.pathname)}),window.addEventListener("navigate",()=>{ot.path.set(window.location.pathname)});const rt=t=>{const e=window.location.pathname;if(e===t)return!0;const s=t.split("/").filter(Boolean),n=e.split("/").filter(Boolean);if(s.length!==n.length)return!1;for(let t=0;t<s.length;t++){const e=s[t],i=n[t];if(e.startsWith(":")){if(!i)return!1}else if(e!==i)return!1}return!0};function lt(t){const e=new Set,s=[Object.prototype,Array.prototype,Function.prototype,String.prototype,Number.prototype,Boolean.prototype,Symbol.prototype,Date.prototype,RegExp.prototype,Map.prototype,Set.prototype,WeakMap.prototype,WeakSet.prototype,Promise.prototype,Error.prototype];for(;t&&!s.includes(t);){for(const s of Reflect.ownKeys(t))"constructor"!==s&&e.add(s);t=Object.getPrototypeOf(t)}return Array.from(e)}const ct=function(t){if("function"!=typeof t)throw Error("molecule must be a class");let e=new t;lt(e).forEach(t=>{if("function"==typeof e[t]){const s=e[t];e[t]=it((...t)=>s.apply(e,t))}});const s=()=>e;return s.reset=()=>{const s=new t;lt(s).forEach(t=>{const n=s[t];n.__isAtom___||n.__isUnit___?e[t].set(n()):n.__isBubble___?e[t].reset():e[t]=n})},s};function ht(t){const e=new Set,s=[Object.prototype,Array.prototype,Function.prototype,String.prototype,Number.prototype,Boolean.prototype,Symbol.prototype,Date.prototype,RegExp.prototype,Map.prototype,Set.prototype,WeakMap.prototype,WeakSet.prototype,Promise.prototype,Error.prototype];for(;t&&!s.includes(t);){for(const s of Reflect.ownKeys(t))"constructor"!==s&&e.add(s);t=Object.getPrototypeOf(t)}return Array.from(e)}const at=function(t){if(null===t||"object"!=typeof t)throw Error("unit must be an object");J();const e=ht(t),s=()=>(L(s,!1),Y&&Q.add(s),t),n=new Set;s.__isUnit___=!0,Object.defineProperty(s,"__version__",{get:()=>(L(s,!1),1)}),s.subscribe=t=>(n.add(t),()=>{n.delete(t)});let i=!1;return e.forEach(e=>{const s=Object.getOwnPropertyDescriptor(t,e);if(s&&s.get&&"function"==typeof s.get){const n=s.get,i=tt(()=>n.call(t));Object.defineProperty(t,e,{get:function(){return i()},enumerable:s.enumerable,configurable:s.configurable})}if("function"==typeof t[e]&&e.toString().startsWith("_")){const s=t[e];if("AsyncFunction"===s.constructor.name)throw new Error("Async method's name can't start with _. you can use "+e.toString().replace(/^_/,"")+" instead and move set operations to a setter function");t[e]=function(...e){const o=s.apply(t,e);return function(){try{i||(i=!0,queueMicrotask(()=>{et(),n.forEach(t=>t())}),i=!1)}catch(t){"production"!==process?.env?.NODE_ENV&&console.error(t)}}(),o}}}),Object.preventExtensions(t),s};class ut extends HTMLElement{constructor(){super(...arguments),this._onRequestContext=t=>{const e=t,s=e.detail?.contextClass;if(!s||null==this._value)return;this._value.constructor===s&&(e.stopPropagation(),e.detail.resolve(this._value))}}connectedCallback(){this.addEventListener("request-context",this._onRequestContext)}disconnectedCallback(){this.removeEventListener("request-context",this._onRequestContext)}set value(t){this._value=t}get value(){return this._value}}customElements.define("x-provider",ut);const dt=globalThis,pt=dt.trustedTypes,_t=pt?pt.createPolicy("lit-html",{createHTML:t=>t}):void 0,ft="$lit$",$t=`lit$${Math.random().toFixed(9).slice(2)}$`,At="?"+$t,yt=`<${At}>`,gt=document,vt=()=>gt.createComment(""),mt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,bt=Array.isArray,wt=t=>bt(t)||"function"==typeof t?.[Symbol.iterator],xt="[ \t\n\f\r]",Ct=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Et=/-->/g,Ht=/>/g,St=RegExp(`>|${xt}(?:([^\\s"'>=/]+)(${xt}*=${xt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Mt=/'/g,Nt=/"/g,Tt=/^(?:script|style|textarea|title)$/i,Ot=(t=>(e,...s)=>({_$litType$:t,strings:e,values:s}))(1),Pt=Symbol.for("lit-noChange"),jt=Symbol.for("lit-nothing"),kt=new WeakMap,Ut=gt.createTreeWalker(gt,129);
6
+ */const t=globalThis,e=t.trustedTypes,s=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,n="$lit$",i=`lit$${Math.random().toFixed(9).slice(2)}$`,o="?"+i,r=`<${o}>`,l=document,c=()=>l.createComment(""),h=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,u="[ \t\n\f\r]",d=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,p=/-->/g,_=/>/g,f=RegExp(`>|${u}(?:([^\\s"'>=/]+)(${u}*=${u}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),$=/'/g,A=/"/g,y=/^(?:script|style|textarea|title)$/i,g=(t=>(e,...s)=>({_$litType$:t,strings:e,values:s}))(1),v=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),b=new WeakMap,w=l.createTreeWalker(l,129);function x(t,e){if(!a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(e):e}let C=class t{constructor({strings:s,_$litType$:l},h){let a;this.parts=[];let u=0,g=0;const v=s.length-1,m=this.parts,[b,C]=((t,e)=>{const s=t.length-1,o=[];let l,c=2===e?"<svg>":3===e?"<math>":"",h=d;for(let e=0;e<s;e++){const s=t[e];let a,u,g=-1,v=0;for(;v<s.length&&(h.lastIndex=v,u=h.exec(s),null!==u);)v=h.lastIndex,h===d?"!--"===u[1]?h=p:void 0!==u[1]?h=_:void 0!==u[2]?(y.test(u[2])&&(l=RegExp("</"+u[2],"g")),h=f):void 0!==u[3]&&(h=f):h===f?">"===u[0]?(h=l??d,g=-1):void 0===u[1]?g=-2:(g=h.lastIndex-u[2].length,a=u[1],h=void 0===u[3]?f:'"'===u[3]?A:$):h===A||h===$?h=f:h===p||h===_?h=d:(h=f,l=void 0);const m=h===f&&t[e+1].startsWith("/>")?" ":"";c+=h===d?s+r:g>=0?(o.push(a),s.slice(0,g)+n+s.slice(g)+i+m):s+i+(-2===g?e:m)}return[x(t,c+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),o]})(s,l);if(this.el=t.createElement(b,h),w.currentNode=this.el.content,2===l||3===l){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(a=w.nextNode())&&m.length<v;){if(1===a.nodeType){if(a.hasAttributes())for(const t of a.getAttributeNames())if(t.endsWith(n)){const e=C[g++],s=a.getAttribute(t).split(i),n=/([.?@])?(.*)/.exec(e);m.push({type:1,index:u,name:n[2],strings:s,ctor:"."===n[1]?N:"?"===n[1]?T:"@"===n[1]?O:M}),a.removeAttribute(t)}else t.startsWith(i)&&(m.push({type:6,index:u}),a.removeAttribute(t));if(y.test(a.tagName)){const t=a.textContent.split(i),s=t.length-1;if(s>0){a.textContent=e?e.emptyScript:"";for(let e=0;e<s;e++)a.append(t[e],c()),w.nextNode(),m.push({type:2,index:++u});a.append(t[s],c())}}}else if(8===a.nodeType)if(a.data===o)m.push({type:2,index:u});else{let t=-1;for(;-1!==(t=a.data.indexOf(i,t+1));)m.push({type:7,index:u}),t+=i.length-1}u++}}static createElement(t,e){const s=l.createElement("template");return s.innerHTML=t,s}};function E(t,e,s=t,n){if(e===v)return e;let i=void 0!==n?s._$Co?.[n]:s._$Cl;const o=h(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),void 0===o?i=void 0:(i=new o(t),i._$AT(t,s,n)),void 0!==n?(s._$Co??=[])[n]=i:s._$Cl=i),void 0!==i&&(e=E(t,i._$AS(t,e.values),i,n)),e}let H=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,n=(t?.creationScope??l).importNode(e,!0);w.currentNode=n;let i=w.nextNode(),o=0,r=0,c=s[0];for(;void 0!==c;){if(o===c.index){let e;2===c.type?e=new S(i,i.nextSibling,this,t):1===c.type?e=new c.ctor(i,c.name,c.strings,this,t):6===c.type&&(e=new P(i,this,t)),this._$AV.push(e),c=s[++r]}o!==c?.index&&(i=w.nextNode(),o++)}return w.currentNode=l,n}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},S=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=m,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=E(this,t,e),h(t)?t===m||null==t||""===t?(this._$AH!==m&&this._$AR(),this._$AH=m):t!==this._$AH&&t!==v&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>a(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==m&&h(this._$AH)?this._$AA.nextSibling.data=t:this.T(l.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=C.createElement(x(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new H(n,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=b.get(t.strings);return void 0===e&&b.set(t.strings,e=new C(t)),e}k(e){a(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let n,i=0;for(const o of e)i===s.length?s.push(n=new t(this.O(c()),this.O(c()),this,this.options)):n=s[i],n._$AI(o),i++;i<s.length&&(this._$AR(n&&n._$AB.nextSibling,i),s.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}},M=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,i){this.type=1,this._$AH=m,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=m}_$AI(t,e=this,s,n){const i=this.strings;let o=!1;if(void 0===i)t=E(this,t,e,0),o=!h(t)||t!==this._$AH&&t!==v,o&&(this._$AH=t);else{const n=t;let r,l;for(t=i[0],r=0;r<i.length-1;r++)l=E(this,n[s+r],e,r),l===v&&(l=this._$AH[r]),o||=!h(l)||l!==this._$AH[r],l===m?t=m:t!==m&&(t+=(l??"")+i[r+1]),this._$AH[r]=l}o&&!n&&this.j(t)}j(t){t===m?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},N=class extends M{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===m?void 0:t}},T=class extends M{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==m)}},O=class extends M{constructor(t,e,s,n,i){super(t,e,s,n,i),this.type=5}_$AI(t,e=this){if((t=E(this,t,e,0)??m)===v)return;const s=this._$AH,n=t===m&&s!==m||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==m&&(s===m||n);n&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},P=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){E(this,t)}};const j=t.litHtmlPolyfillSupport;j?.(C,S),(t.litHtmlVersions??=[]).push("3.3.1");const k=(t,e,s)=>{const n=s?.renderBefore??e;let i=n._$litPart$;if(void 0===i){const t=s?.renderBefore??null;n._$litPart$=i=new S(e.insertBefore(c(),t),t,void 0,s??{})}return i._$AI(t),i};let U=!1;const V=()=>U;const B=new class{constructor(){this.pendingComponents=new Set,this.isScheduled=!1}schedule(t){this.pendingComponents.add(t),this.isScheduled||(this.isScheduled=!0,queueMicrotask(()=>{this.pendingComponents.forEach(t=>t._render()),this.pendingComponents.clear(),this.isScheduled=!1}))}};class I extends HTMLElement{onEachUpdate(t){this.onEachUpdateCallbacks.push(t)}constructor(){super(),this.lastVersion=-1,this.onEachUpdateCallbacks=[],this._isViewLoading=!1,this._props={},this._propsFn=()=>this._props,this._view=null,this._componentFn=null,this._hasMounted=!1,this._renderScheduled=!1,this.componentId=Math.random(),this.cleanups=new Map,this._xviewRender=()=>{}}setter(t){const e=this;return(...s)=>(st(),B.schedule(e),t(...s))}set props(t){"function"==typeof t?this._propsFn=t:(this._props=t,this._propsFn=()=>this._props),B.schedule(this)}get props(){return this._props}set view(t){if("AsyncFunction"===t.constructor.name||t instanceof Promise)return this._isViewLoading=!0,void("function"==typeof t?t():t).then(t=>{this._isViewLoading=!1,this.view=t.default||t});this.oldView!==t&&(this.oldView=t,this._view=t,this._hasMounted&&(this.cleanups.forEach(t=>t()),this.cleanups.clear(),this._hasMounted=!1),B.schedule(this))}get view(){return this._view}callOnEachUpdate(){this.onEachUpdateCallbacks.forEach(t=>t())}disconnectedCallback(){this.cleanups.forEach(t=>t()),this.cleanups.clear()}addToCleanUps(t,e){this.cleanups.set(t,e)}_render(){if(this._view&&!this._isViewLoading&&!this._renderScheduled){if(!this._hasMounted){const t=this._view;return this._componentFn=D(this,()=>t(this._propsFn,this.setter.bind(this))),void("function"==typeof this._componentFn&&(this._xviewRender=()=>{if(console.log("render",this.lastVersion,exports.globalVersion),U=!0,this.lastVersion===exports.globalVersion)return;const t=D(this,this._componentFn);k(t,this),this.lastVersion=exports.globalVersion,U=!1},this.callOnEachUpdate(),this._xviewRender(),this._hasMounted=!0))}this._xviewRender&&(this.callOnEachUpdate(),this._xviewRender())}}}customElements.define("x-view",I);const R=[];function D(t,e){R.push(t);let s=null;try{s=e()}finally{R.pop()}return s}function L(t=!0){const e=R[R.length-1];if(!e){if(t)throw new Error("getCurrentHost(): No active host context");return null}return e}function W(t,e=!0,s){const n=L(e);if(n&&t&&!n.cleanups.has(t)){const e=(s||t.subscribe)?.(()=>{B.schedule(n)});n.addToCleanUps(t,e)}}const F=t=>{if(Z)return K;Y();const e=new Set;try{const s=L(),n=(...n)=>{t(...n),st(),e.forEach(t=>t()),s&&B.schedule(s)};return n.subscribe=t=>(e.add(t),()=>e.delete(t)),n}catch(t){throw new Error("You can only use setter or _ inside a view or component.")}},q=F,z=()=>{Y();const t=L();return e=>{e?.(),st(),B.schedule(t)}};let K,Z=!1;const X=t=>{Z=t},G=t=>{K=t},J=()=>Z,Y=()=>{if(V())throw Error("atoms, units, bubbles, getters, setters and actions can't be created inside the template function, you can create them in view function. Because template function gets called everytime the view updates.")};let Q=!1,tt=new Set;function et(t){let e=null,s=1;Y();const n=()=>{if(e)try{let t=!1;for(const[s,n]of e.storeDeps){if(s.__version__!==n){t=!0;break}}if(!t)for(const[s,n]of e.getterDeps){if(s.areVersionsChanged(n)){t=!0;break}}if(!t)return Q&&tt.add(i),e.value}catch(t){console.error(t)}const n=tt,o=Q;let r;tt=new Set,Q=!0;let l=new Map,c=new Map;try{r=t(),tt.forEach(t=>{"function"==typeof t&&"function"==typeof t.areVersionsChanged?c.set(t,t.version):t&&"number"==typeof t.__version__&&l.set(t,t.__version__)}),e={value:r,storeDeps:new Map(l),getterDeps:new Map(c)},s++}catch(t){throw e=null,s++,tt=n,Q=o,t}finally{tt=n,Q=o,o&&tt.add(i)}return r},i=()=>n();return Object.defineProperty(i,"val",{get:()=>n()}),Object.defineProperty(i,"version",{get:()=>s}),Object.defineProperty(i,"areVersionsChanged",{value:t=>{if(!e)return!0;if(void 0!==t){let n=!1;for(const[t,s]of e.storeDeps){if(t.__version__!==s){n=!0;break}}if(!n)for(const[t,s]of e.getterDeps){if(t.areVersionsChanged(s)){n=!0;break}}return!!n||s!==t}for(const[t,s]of e.storeDeps){if(t.__version__!==s)return!0}for(const[t,s]of e.getterDeps){if(t.areVersionsChanged(s))return!0}return!1}}),i}exports.globalVersion=0;const st=()=>{exports.globalVersion++};function nt(t,e=!1){Y();let s=t;e&&it(s);let n=!1,i=new Set,o=!1,r=1;const l=()=>{r++,n||(n=!0,queueMicrotask(()=>{console.log("notify",i.size),[...i].forEach(t=>{try{t?.()}catch(t){console.error(t)}}),n=!1}))},c=()=>(W(h,!1),Q&&tt.add(h),s),h=()=>c();return h.get=()=>c(),h.set=t=>{if(o)return;const n="function"==typeof t?t(s):t;s=n,e&&it(s),st(),l()},h.update=t=>{if(!o&&"object"==typeof s&&null!==s){if(e)throw new Error("update() is not supported for iAtoms or iAtom with deepFreeze enabled");t(s),st(),l()}},h.subscribe=t=>(i.add(t),()=>i.delete(t)),h.lock=()=>{o=!0},h.unlock=()=>{o=!1},Object.defineProperty(h,"__isAtom___",{value:!0,writable:!1}),Object.defineProperty(h,"val",{get:()=>h.get()}),Object.defineProperty(h,"__version__",{get:()=>(W(h,!1),r)}),Object.defineProperty(h,"toJSON",{value:()=>JSON.stringify(s)}),Object.defineProperty(h,"__id__",{value:Math.random().toString(36).substring(2,15),writable:!1}),h.select=(t,n=void 0)=>{if(!e)throw Error("select() can only be used with iAtoms");let i=n;try{i=t(s)}catch(t){i=n}const o=()=>i,r=L(),l=h.subscribe(()=>{const e=i;try{i=t(s)}catch(t){i=n}e!==i&&r&&B.schedule(r)});return r&&!r?.cleanups?.has?.(o)&&r?.addToCleanUps?.(o,l),o},h}function it(t){try{return Object.keys(t).forEach(e=>{"object"!=typeof t[e]||null===t[e]||Object.isFrozen(t[e])||it(t[e])}),Object.freeze(t)}catch(t){console.error(t)}}function ot(t,e){let s=t;const n=new Set;let i=null,o=null,r=null,l=null,c=null,h=null,a=null,u=0,d=null,p=null;const _=t=>{n.forEach(e=>{try{e(t)}catch(t){console.error(t)}})},f=(t,e)=>{if(i){return i((...e)=>{const n=s.call(t,...e);return _(n),n},...e)}const n=s.call(t,...e);return _(n),n};function $(...t){const s=this;return e?.debounce?((t,s)=>(o&&clearTimeout(o),r||(r=new Promise(n=>{l=n,o=setTimeout(()=>{const e=f(t,s);n(e),o=null,r=null,l=null},e?.debounce||0)}),r)))(s,t):e?.throttle?((t,s)=>{const n=Date.now(),i=n-u,o=e?.throttle||0;return i>=o?(u=n,f(t,s)):(d=s,p=t,h||(h=new Promise(t=>{a=t,c=setTimeout(()=>{if(d&&p){u=Date.now();const e=f(p,d);t(e),d=null,p=null}c=null,h=null,a=null},o-i)}),h))})(s,t):f(s,t)}return $.subscribe=t=>(n.add(t),()=>n.delete(t)),$.set=t=>{s=t},$.intercept=t=>{i=t},$.cancel=()=>{o&&(clearTimeout(o),o=null),r&&l&&(l(void 0),r=null,l=null),c&&(clearTimeout(c),c=null,u=0,d=null,p=null),h&&a&&(a(void 0),h=null,a=null)},$}const rt={path:nt(window.location.pathname),navigateTo(t,e){e?window.history.replaceState({},"",t):window.history.pushState({},"",t),this.path.set(t)},matchPath:t=>lt(t)};window.addEventListener("popstate",()=>{rt.path.set(window.location.pathname)}),window.addEventListener("hashchange",()=>{rt.path.set(window.location.pathname)}),window.addEventListener("navigate",()=>{rt.path.set(window.location.pathname)});const lt=t=>{const e=window.location.pathname;if(e===t)return!0;const s=t.split("/").filter(Boolean),n=e.split("/").filter(Boolean);if(s.length!==n.length)return!1;for(let t=0;t<s.length;t++){const e=s[t],i=n[t];if(e.startsWith(":")){if(!i)return!1}else if(e!==i)return!1}return!0};function ct(t){const e=new Set,s=[Object.prototype,Array.prototype,Function.prototype,String.prototype,Number.prototype,Boolean.prototype,Symbol.prototype,Date.prototype,RegExp.prototype,Map.prototype,Set.prototype,WeakMap.prototype,WeakSet.prototype,Promise.prototype,Error.prototype];for(;t&&!s.includes(t);){for(const s of Reflect.ownKeys(t))"constructor"!==s&&e.add(s);t=Object.getPrototypeOf(t)}return Array.from(e)}const ht=function(t){if("function"!=typeof t)throw Error("molecule must be a class");let e=new t;ct(e).forEach(t=>{if("function"==typeof e[t]){const s=e[t];e[t]=ot((...t)=>s.apply(e,t))}});const s=()=>e;return s.reset=()=>{const s=new t;ct(s).forEach(t=>{const n=s[t];n.__isAtom___||n.__isUnit___?e[t].set(n()):n.__isBubble___?e[t].reset():e[t]=n})},s};function at(t){const e=new Set,s=[Object.prototype,Array.prototype,Function.prototype,String.prototype,Number.prototype,Boolean.prototype,Symbol.prototype,Date.prototype,RegExp.prototype,Map.prototype,Set.prototype,WeakMap.prototype,WeakSet.prototype,Promise.prototype,Error.prototype];for(;t&&!s.includes(t);){for(const s of Reflect.ownKeys(t))"constructor"!==s&&e.add(s);t=Object.getPrototypeOf(t)}return Array.from(e)}const ut=function(t){if(null===t||"object"!=typeof t)throw Error("unit must be an object");Y();const e=at(t),s=()=>(W(s,!1),Q&&tt.add(s),t),n=new Set;s.__isUnit___=!0,Object.defineProperty(s,"__version__",{get:()=>(W(s,!1),1)}),s.subscribe=t=>(n.add(t),()=>{n.delete(t)});let i=!1;return e.forEach(e=>{const s=Object.getOwnPropertyDescriptor(t,e);if(s&&s.get&&"function"==typeof s.get){const n=s.get,i=et(()=>n.call(t));Object.defineProperty(t,e,{get:function(){return i()},enumerable:s.enumerable,configurable:s.configurable})}if("function"==typeof t[e]&&e.toString().startsWith("_")){const s=t[e];if("AsyncFunction"===s.constructor.name)throw new Error("Async method's name can't start with _. you can use "+e.toString().replace(/^_/,"")+" instead and move set operations to a setter function");t[e]=function(...e){const o=s.apply(t,e);return function(){try{i||(i=!0,queueMicrotask(()=>{st(),n.forEach(t=>t())}),i=!1)}catch(t){"production"!==process?.env?.NODE_ENV&&console.error(t)}}(),o}}}),Object.preventExtensions(t),s};class dt extends HTMLElement{constructor(){super(...arguments),this._onRequestContext=t=>{const e=t,s=e.detail?.contextClass;if(!s||null==this._value)return;this._value.constructor===s&&(e.stopPropagation(),e.detail.resolve(this._value))}}connectedCallback(){this.addEventListener("request-context",this._onRequestContext)}disconnectedCallback(){this.removeEventListener("request-context",this._onRequestContext)}set value(t){this._value=t}get value(){return this._value}}customElements.define("x-provider",dt);const pt=(t,e={})=>g`<x-view .view=${t} .props=${()=>e}></x-view>`,_t=globalThis,ft=_t.trustedTypes,$t=ft?ft.createPolicy("lit-html",{createHTML:t=>t}):void 0,At="$lit$",yt=`lit$${Math.random().toFixed(9).slice(2)}$`,gt="?"+yt,vt=`<${gt}>`,mt=document,bt=()=>mt.createComment(""),wt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,xt=Array.isArray,Ct=t=>xt(t)||"function"==typeof t?.[Symbol.iterator],Et="[ \t\n\f\r]",Ht=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,St=/-->/g,Mt=/>/g,Nt=RegExp(`>|${Et}(?:([^\\s"'>=/]+)(${Et}*=${Et}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Tt=/'/g,Ot=/"/g,Pt=/^(?:script|style|textarea|title)$/i,jt=(t=>(e,...s)=>({_$litType$:t,strings:e,values:s}))(1),kt=Symbol.for("lit-noChange"),Ut=Symbol.for("lit-nothing"),Vt=new WeakMap,Bt=mt.createTreeWalker(mt,129);function It(t,e){if(!xt(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==$t?$t.createHTML(e):e}const Rt=(t,e)=>{const s=t.length-1,n=[];let i,o=2===e?"<svg>":3===e?"<math>":"",r=Ht;for(let e=0;e<s;e++){const s=t[e];let l,c,h=-1,a=0;for(;a<s.length&&(r.lastIndex=a,c=r.exec(s),null!==c);)a=r.lastIndex,r===Ht?"!--"===c[1]?r=St:void 0!==c[1]?r=Mt:void 0!==c[2]?(Pt.test(c[2])&&(i=RegExp("</"+c[2],"g")),r=Nt):void 0!==c[3]&&(r=Nt):r===Nt?">"===c[0]?(r=i??Ht,h=-1):void 0===c[1]?h=-2:(h=r.lastIndex-c[2].length,l=c[1],r=void 0===c[3]?Nt:'"'===c[3]?Ot:Tt):r===Ot||r===Tt?r=Nt:r===St||r===Mt?r=Ht:(r=Nt,i=void 0);const u=r===Nt&&t[e+1].startsWith("/>")?" ":"";o+=r===Ht?s+vt:h>=0?(n.push(l),s.slice(0,h)+At+s.slice(h)+yt+u):s+yt+(-2===h?e:u)}return[It(t,o+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class Dt{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,o=0;const r=t.length-1,l=this.parts,[c,h]=Rt(t,e);if(this.el=Dt.createElement(c,s),Bt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=Bt.nextNode())&&l.length<r;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(At)){const e=h[o++],s=n.getAttribute(t).split(yt),r=/([.?@])?(.*)/.exec(e);l.push({type:1,index:i,name:r[2],strings:s,ctor:"."===r[1]?zt:"?"===r[1]?Kt:"@"===r[1]?Zt:qt}),n.removeAttribute(t)}else t.startsWith(yt)&&(l.push({type:6,index:i}),n.removeAttribute(t));if(Pt.test(n.tagName)){const t=n.textContent.split(yt),e=t.length-1;if(e>0){n.textContent=ft?ft.emptyScript:"";for(let s=0;s<e;s++)n.append(t[s],bt()),Bt.nextNode(),l.push({type:2,index:++i});n.append(t[e],bt())}}}else if(8===n.nodeType)if(n.data===gt)l.push({type:2,index:i});else{let t=-1;for(;-1!==(t=n.data.indexOf(yt,t+1));)l.push({type:7,index:i}),t+=yt.length-1}i++}}static createElement(t,e){const s=mt.createElement("template");return s.innerHTML=t,s}}function Lt(t,e,s=t,n){if(e===kt)return e;let i=void 0!==n?s._$Co?.[n]:s._$Cl;const o=wt(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),void 0===o?i=void 0:(i=new o(t),i._$AT(t,s,n)),void 0!==n?(s._$Co??=[])[n]=i:s._$Cl=i),void 0!==i&&(e=Lt(t,i._$AS(t,e.values),i,n)),e}let Wt=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,n=(t?.creationScope??mt).importNode(e,!0);Bt.currentNode=n;let i=Bt.nextNode(),o=0,r=0,l=s[0];for(;void 0!==l;){if(o===l.index){let e;2===l.type?e=new Ft(i,i.nextSibling,this,t):1===l.type?e=new l.ctor(i,l.name,l.strings,this,t):6===l.type&&(e=new Xt(i,this,t)),this._$AV.push(e),l=s[++r]}o!==l?.index&&(i=Bt.nextNode(),o++)}return Bt.currentNode=mt,n}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}};class Ft{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=Ut,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Lt(this,t,e),wt(t)?t===Ut||null==t||""===t?(this._$AH!==Ut&&this._$AR(),this._$AH=Ut):t!==this._$AH&&t!==kt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):Ct(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==Ut&&wt(this._$AH)?this._$AA.nextSibling.data=t:this.T(mt.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=Dt.createElement(It(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new Wt(n,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=Vt.get(t.strings);return void 0===e&&Vt.set(t.strings,e=new Dt(t)),e}k(t){xt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new Ft(this.O(bt()),this.O(bt()),this,this.options)):s=e[n],s._$AI(i),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class qt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,i){this.type=1,this._$AH=Ut,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=Ut}_$AI(t,e=this,s,n){const i=this.strings;let o=!1;if(void 0===i)t=Lt(this,t,e,0),o=!wt(t)||t!==this._$AH&&t!==kt,o&&(this._$AH=t);else{const n=t;let r,l;for(t=i[0],r=0;r<i.length-1;r++)l=Lt(this,n[s+r],e,r),l===kt&&(l=this._$AH[r]),o||=!wt(l)||l!==this._$AH[r],l===Ut?t=Ut:t!==Ut&&(t+=(l??"")+i[r+1]),this._$AH[r]=l}o&&!n&&this.j(t)}j(t){t===Ut?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class zt extends qt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Ut?void 0:t}}class Kt extends qt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==Ut)}}class Zt extends qt{constructor(t,e,s,n,i){super(t,e,s,n,i),this.type=5}_$AI(t,e=this){if((t=Lt(this,t,e,0)??Ut)===kt)return;const s=this._$AH,n=t===Ut&&s!==Ut||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==Ut&&(s===Ut||n);n&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Xt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Lt(this,t)}}const Gt={M:At,P:yt,A:gt,C:1,L:Rt,R:Wt,D:Ct,V:Lt,I:Ft,H:qt,N:Kt,U:Zt,B:zt,F:Xt},Jt=_t.litHtmlPolyfillSupport;Jt?.(Dt,Ft),(_t.litHtmlVersions??=[]).push("3.3.1");const Yt=(t,e,s)=>{const n=s?.renderBefore??e;let i=n._$litPart$;if(void 0===i){const t=s?.renderBefore??null;n._$litPart$=i=new Ft(e.insertBefore(bt(),t),t,void 0,s??{})}return i._$AI(t),i
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
- */function Vt(t,e){if(!bt(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==_t?_t.createHTML(e):e}const Bt=(t,e)=>{const s=t.length-1,n=[];let i,o=2===e?"<svg>":3===e?"<math>":"",r=Ct;for(let e=0;e<s;e++){const s=t[e];let l,c,h=-1,a=0;for(;a<s.length&&(r.lastIndex=a,c=r.exec(s),null!==c);)a=r.lastIndex,r===Ct?"!--"===c[1]?r=Et:void 0!==c[1]?r=Ht:void 0!==c[2]?(Tt.test(c[2])&&(i=RegExp("</"+c[2],"g")),r=St):void 0!==c[3]&&(r=St):r===St?">"===c[0]?(r=i??Ct,h=-1):void 0===c[1]?h=-2:(h=r.lastIndex-c[2].length,l=c[1],r=void 0===c[3]?St:'"'===c[3]?Nt:Mt):r===Nt||r===Mt?r=St:r===Et||r===Ht?r=Ct:(r=St,i=void 0);const u=r===St&&t[e+1].startsWith("/>")?" ":"";o+=r===Ct?s+yt:h>=0?(n.push(l),s.slice(0,h)+ft+s.slice(h)+$t+u):s+$t+(-2===h?e:u)}return[Vt(t,o+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class Rt{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let i=0,o=0;const r=t.length-1,l=this.parts,[c,h]=Bt(t,e);if(this.el=Rt.createElement(c,s),Ut.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=Ut.nextNode())&&l.length<r;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(ft)){const e=h[o++],s=n.getAttribute(t).split($t),r=/([.?@])?(.*)/.exec(e);l.push({type:1,index:i,name:r[2],strings:s,ctor:"."===r[1]?Ft:"?"===r[1]?qt:"@"===r[1]?zt:Wt}),n.removeAttribute(t)}else t.startsWith($t)&&(l.push({type:6,index:i}),n.removeAttribute(t));if(Tt.test(n.tagName)){const t=n.textContent.split($t),e=t.length-1;if(e>0){n.textContent=pt?pt.emptyScript:"";for(let s=0;s<e;s++)n.append(t[s],vt()),Ut.nextNode(),l.push({type:2,index:++i});n.append(t[e],vt())}}}else if(8===n.nodeType)if(n.data===At)l.push({type:2,index:i});else{let t=-1;for(;-1!==(t=n.data.indexOf($t,t+1));)l.push({type:7,index:i}),t+=$t.length-1}i++}}static createElement(t,e){const s=gt.createElement("template");return s.innerHTML=t,s}}function It(t,e,s=t,n){if(e===Pt)return e;let i=void 0!==n?s._$Co?.[n]:s._$Cl;const o=mt(e)?void 0:e._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),void 0===o?i=void 0:(i=new o(t),i._$AT(t,s,n)),void 0!==n?(s._$Co??=[])[n]=i:s._$Cl=i),void 0!==i&&(e=It(t,i._$AS(t,e.values),i,n)),e}let Dt=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,n=(t?.creationScope??gt).importNode(e,!0);Ut.currentNode=n;let i=Ut.nextNode(),o=0,r=0,l=s[0];for(;void 0!==l;){if(o===l.index){let e;2===l.type?e=new Lt(i,i.nextSibling,this,t):1===l.type?e=new l.ctor(i,l.name,l.strings,this,t):6===l.type&&(e=new Kt(i,this,t)),this._$AV.push(e),l=s[++r]}o!==l?.index&&(i=Ut.nextNode(),o++)}return Ut.currentNode=gt,n}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}};class Lt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,n){this.type=2,this._$AH=jt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=It(this,t,e),mt(t)?t===jt||null==t||""===t?(this._$AH!==jt&&this._$AR(),this._$AH=jt):t!==this._$AH&&t!==Pt&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):wt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==jt&&mt(this._$AH)?this._$AA.nextSibling.data=t:this.T(gt.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=Rt.createElement(Vt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new Dt(n,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=kt.get(t.strings);return void 0===e&&kt.set(t.strings,e=new Rt(t)),e}k(t){bt(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,n=0;for(const i of t)n===e.length?e.push(s=new Lt(this.O(vt()),this.O(vt()),this,this.options)):s=e[n],s._$AI(i),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class Wt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,n,i){this.type=1,this._$AH=jt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=i,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=jt}_$AI(t,e=this,s,n){const i=this.strings;let o=!1;if(void 0===i)t=It(this,t,e,0),o=!mt(t)||t!==this._$AH&&t!==Pt,o&&(this._$AH=t);else{const n=t;let r,l;for(t=i[0],r=0;r<i.length-1;r++)l=It(this,n[s+r],e,r),l===Pt&&(l=this._$AH[r]),o||=!mt(l)||l!==this._$AH[r],l===jt?t=jt:t!==jt&&(t+=(l??"")+i[r+1]),this._$AH[r]=l}o&&!n&&this.j(t)}j(t){t===jt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ft extends Wt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===jt?void 0:t}}class qt extends Wt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==jt)}}class zt extends Wt{constructor(t,e,s,n,i){super(t,e,s,n,i),this.type=5}_$AI(t,e=this){if((t=It(this,t,e,0)??jt)===Pt)return;const s=this._$AH,n=t===jt&&s!==jt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==jt&&(s===jt||n);n&&this.element.removeEventListener(this.name,this,s),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Kt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){It(this,t)}}const Zt={M:ft,P:$t,A:At,C:1,L:Bt,R:Dt,D:wt,V:It,I:Lt,H:Wt,N:qt,U:zt,B:Ft,F:Kt},Xt=dt.litHtmlPolyfillSupport;Xt?.(Rt,Lt),(dt.litHtmlVersions??=[]).push("3.3.1");const Gt=(t,e,s)=>{const n=s?.renderBefore??e;let i=n._$litPart$;if(void 0===i){const t=s?.renderBefore??null;n._$litPart$=i=new Lt(e.insertBefore(vt(),t),t,void 0,s??{})}return i._$AI(t),i
12
- /**
13
- * @license
14
- * Copyright 2017 Google LLC
15
- * SPDX-License-Identifier: BSD-3-Clause
16
- */},Jt=1,Yt=2,Qt=3,te=4,ee=t=>(...e)=>({_$litDirective$:t,values:e});let se=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
11
+ */},Qt=1,te=2,ee=3,se=4,ne=t=>(...e)=>({_$litDirective$:t,values:e});let ie=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
17
12
  /**
18
13
  * @license
19
14
  * Copyright 2020 Google LLC
20
15
  * SPDX-License-Identifier: BSD-3-Clause
21
- */const{I:ne}=Zt,ie=(t,e)=>void 0===e?void 0!==t?._$litType$:t?._$litType$===e,oe=t=>void 0===t.strings,re=()=>document.createComment(""),le=(t,e,s)=>{const n=t._$AA.parentNode,i=void 0===e?t._$AB:e._$AA;if(void 0===s){const e=n.insertBefore(re(),i),o=n.insertBefore(re(),i);s=new ne(e,o,t,t.options)}else{const e=s._$AB.nextSibling,o=s._$AM,r=o!==t;if(r){let e;s._$AQ?.(t),s._$AM=t,void 0!==s._$AP&&(e=t._$AU)!==o._$AU&&s._$AP(e)}if(e!==i||r){let t=s._$AA;for(;t!==e;){const e=t.nextSibling;n.insertBefore(t,i),t=e}}}return s},ce=(t,e,s=t)=>(t._$AI(e,s),t),he={},ae=(t,e=he)=>t._$AH=e,ue=t=>t._$AH,de=t=>{t._$AR(),t._$AA.remove()},pe=t=>{t._$AR()},_e=(t,e,s)=>{const n=new Map;for(let i=e;i<=s;i++)n.set(t[i],i);return n},fe=ee(class extends se{constructor(t){if(super(t),t.type!==Yt)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let n;void 0===s?s=e:void 0!==e&&(n=e);const i=[],o=[];let r=0;for(const e of t)i[r]=n?n(e,r):r,o[r]=s(e,r),r++;return{values:o,keys:i}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,n]){const i=ue(t),{values:o,keys:r}=this.dt(e,s,n);if(!Array.isArray(i))return this.ut=r,o;const l=this.ut??=[],c=[];let h,a,u=0,d=i.length-1,p=0,_=o.length-1;for(;u<=d&&p<=_;)if(null===i[u])u++;else if(null===i[d])d--;else if(l[u]===r[p])c[p]=ce(i[u],o[p]),u++,p++;else if(l[d]===r[_])c[_]=ce(i[d],o[_]),d--,_--;else if(l[u]===r[_])c[_]=ce(i[u],o[_]),le(t,c[_+1],i[u]),u++,_--;else if(l[d]===r[p])c[p]=ce(i[d],o[p]),le(t,i[u],i[d]),d--,p++;else if(void 0===h&&(h=_e(r,p,_),a=_e(l,u,d)),h.has(l[u]))if(h.has(l[d])){const e=a.get(r[p]),s=void 0!==e?i[e]:null;if(null===s){const e=le(t,i[u]);ce(e,o[p]),c[p]=e}else c[p]=ce(s,o[p]),le(t,i[u],s),i[e]=null;p++}else de(i[d]),d--;else de(i[u]),u++;for(;p<=_;){const e=le(t,c[_+1]);ce(e,o[p]),c[p++]=e}for(;u<=d;){const t=i[u++];null!==t&&de(t)}return this.ut=r,ae(t,c),Pt}}),$e={},Ae=ee(class extends se{constructor(){super(...arguments),this.ot=$e}render(t,e){return e()}update(t,[e,s]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every((t,e)=>t===this.ot[e]))return Pt}else if(this.ot===e)return Pt;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,s)}}),ye="important",ge=" !"+ye,ve=ee(class extends se{constructor(t){if(super(t),t.type!==Jt||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,s)=>{const n=t[s];return null==n?e:e+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(t,[e]){const{style:s}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?s.removeProperty(t):s[t]=null);for(const t in e){const n=e[t];if(null!=n){this.ft.add(t);const e="string"==typeof n&&n.endsWith(ge);t.includes("-")||e?s.setProperty(t,e?n.slice(0,-11):n,e?ye:""):s[t]=n}}return Pt}}),me=ee(class extends se{constructor(t){if(super(t),t.type!==Jt||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const s=t.element.classList;for(const t of this.st)t in e||(s.remove(t),this.st.delete(t));for(const t in e){const n=!!e[t];n===this.st.has(t)||this.nt?.has(t)||(n?(s.add(t),this.st.add(t)):(s.remove(t),this.st.delete(t)))}return Pt}});
16
+ */const{I:oe}=Gt,re=(t,e)=>void 0===e?void 0!==t?._$litType$:t?._$litType$===e,le=t=>void 0===t.strings,ce=()=>document.createComment(""),he=(t,e,s)=>{const n=t._$AA.parentNode,i=void 0===e?t._$AB:e._$AA;if(void 0===s){const e=n.insertBefore(ce(),i),o=n.insertBefore(ce(),i);s=new oe(e,o,t,t.options)}else{const e=s._$AB.nextSibling,o=s._$AM,r=o!==t;if(r){let e;s._$AQ?.(t),s._$AM=t,void 0!==s._$AP&&(e=t._$AU)!==o._$AU&&s._$AP(e)}if(e!==i||r){let t=s._$AA;for(;t!==e;){const e=t.nextSibling;n.insertBefore(t,i),t=e}}}return s},ae=(t,e,s=t)=>(t._$AI(e,s),t),ue={},de=(t,e=ue)=>t._$AH=e,pe=t=>t._$AH,_e=t=>{t._$AR(),t._$AA.remove()},fe=t=>{t._$AR()},$e=(t,e,s)=>{const n=new Map;for(let i=e;i<=s;i++)n.set(t[i],i);return n},Ae=ne(class extends ie{constructor(t){if(super(t),t.type!==te)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let n;void 0===s?s=e:void 0!==e&&(n=e);const i=[],o=[];let r=0;for(const e of t)i[r]=n?n(e,r):r,o[r]=s(e,r),r++;return{values:o,keys:i}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,n]){const i=pe(t),{values:o,keys:r}=this.dt(e,s,n);if(!Array.isArray(i))return this.ut=r,o;const l=this.ut??=[],c=[];let h,a,u=0,d=i.length-1,p=0,_=o.length-1;for(;u<=d&&p<=_;)if(null===i[u])u++;else if(null===i[d])d--;else if(l[u]===r[p])c[p]=ae(i[u],o[p]),u++,p++;else if(l[d]===r[_])c[_]=ae(i[d],o[_]),d--,_--;else if(l[u]===r[_])c[_]=ae(i[u],o[_]),he(t,c[_+1],i[u]),u++,_--;else if(l[d]===r[p])c[p]=ae(i[d],o[p]),he(t,i[u],i[d]),d--,p++;else if(void 0===h&&(h=$e(r,p,_),a=$e(l,u,d)),h.has(l[u]))if(h.has(l[d])){const e=a.get(r[p]),s=void 0!==e?i[e]:null;if(null===s){const e=he(t,i[u]);ae(e,o[p]),c[p]=e}else c[p]=ae(s,o[p]),he(t,i[u],s),i[e]=null;p++}else _e(i[d]),d--;else _e(i[u]),u++;for(;p<=_;){const e=he(t,c[_+1]);ae(e,o[p]),c[p++]=e}for(;u<=d;){const t=i[u++];null!==t&&_e(t)}return this.ut=r,de(t,c),kt}}),ye={},ge=ne(class extends ie{constructor(){super(...arguments),this.ot=ye}render(t,e){return e()}update(t,[e,s]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every((t,e)=>t===this.ot[e]))return kt}else if(this.ot===e)return kt;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,s)}}),ve="important",me=" !"+ve,be=ne(class extends ie{constructor(t){if(super(t),t.type!==Qt||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,s)=>{const n=t[s];return null==n?e:e+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(t,[e]){const{style:s}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?s.removeProperty(t):s[t]=null);for(const t in e){const n=e[t];if(null!=n){this.ft.add(t);const e="string"==typeof n&&n.endsWith(me);t.includes("-")||e?s.setProperty(t,e?n.slice(0,-11):n,e?ve:""):s[t]=n}}return kt}}),we=ne(class extends ie{constructor(t){if(super(t),t.type!==Qt||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const s=t.element.classList;for(const t of this.st)t in e||(s.remove(t),this.st.delete(t));for(const t in e){const n=!!e[t];n===this.st.has(t)||this.nt?.has(t)||(n?(s.add(t),this.st.add(t)):(s.remove(t),this.st.delete(t)))}return kt}});
22
17
  /**
23
18
  * @license
24
19
  * Copyright 2017 Google LLC
@@ -29,22 +24,22 @@
29
24
  * Copyright 2018 Google LLC
30
25
  * SPDX-License-Identifier: BSD-3-Clause
31
26
  */
32
- const be=ee(class extends se{constructor(t){if(super(t),t.type!==Qt&&t.type!==Jt&&t.type!==te)throw Error("The `live` directive is not allowed on child or event bindings");if(!oe(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===Pt||e===jt)return e;const s=t.element,n=t.name;if(t.type===Qt){if(e===s[n])return Pt}else if(t.type===te){if(!!e===s.hasAttribute(n))return Pt}else if(t.type===Jt&&s.getAttribute(n)===e+"")return Pt;return ae(t),e}}),we=(t,e)=>{const s=t._$AN;if(void 0===s)return!1;for(const t of s)t._$AO?.(e,!1),we(t,e);return!0},xe=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===s?.size)},Ce=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),Se(e)}};
27
+ const xe=ne(class extends ie{constructor(t){if(super(t),t.type!==ee&&t.type!==Qt&&t.type!==se)throw Error("The `live` directive is not allowed on child or event bindings");if(!le(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===kt||e===Ut)return e;const s=t.element,n=t.name;if(t.type===ee){if(e===s[n])return kt}else if(t.type===se){if(!!e===s.hasAttribute(n))return kt}else if(t.type===Qt&&s.getAttribute(n)===e+"")return kt;return de(t),e}}),Ce=(t,e)=>{const s=t._$AN;if(void 0===s)return!1;for(const t of s)t._$AO?.(e,!1),Ce(t,e);return!0},Ee=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===s?.size)},He=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),Ne(e)}};
33
28
  /**
34
29
  * @license
35
30
  * Copyright 2020 Google LLC
36
31
  * SPDX-License-Identifier: BSD-3-Clause
37
- */function Ee(t){void 0!==this._$AN?(xe(this),this._$AM=t,Ce(this)):this._$AM=t}function He(t,e=!1,s=0){const n=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(e)if(Array.isArray(n))for(let t=s;t<n.length;t++)we(n[t],!1),xe(n[t]);else null!=n&&(we(n,!1),xe(n));else we(this,t)}const Se=t=>{t.type==Yt&&(t._$AP??=He,t._$AQ??=Ee)};class Me extends se{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),Ce(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(we(this,t),xe(this))}setValue(t){if(oe(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}
32
+ */function Se(t){void 0!==this._$AN?(Ee(this),this._$AM=t,He(this)):this._$AM=t}function Me(t,e=!1,s=0){const n=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(e)if(Array.isArray(n))for(let t=s;t<n.length;t++)Ce(n[t],!1),Ee(n[t]);else null!=n&&(Ce(n,!1),Ee(n));else Ce(this,t)}const Ne=t=>{t.type==te&&(t._$AP??=Me,t._$AQ??=Se)};class Te extends ie{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),He(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(Ce(this,t),Ee(this))}setValue(t){if(le(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}
38
33
  /**
39
34
  * @license
40
35
  * Copyright 2021 Google LLC
41
36
  * SPDX-License-Identifier: BSD-3-Clause
42
- */class Ne{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}let Te=class{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(t=>this.Z=t)}resume(){this.Z?.(),this.Y=this.Z=void 0}};
37
+ */class Oe{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}let Pe=class{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(t=>this.Z=t)}resume(){this.Z?.(),this.Y=this.Z=void 0}};
43
38
  /**
44
39
  * @license
45
40
  * Copyright 2017 Google LLC
46
41
  * SPDX-License-Identifier: BSD-3-Clause
47
- */const Oe=t=>!(t=>null===t||"object"!=typeof t&&"function"!=typeof t)(t)&&"function"==typeof t.then,Pe=1073741823;const je=ee(class extends Me{constructor(){super(...arguments),this._$Cwt=Pe,this._$Cbt=[],this._$CK=new Ne(this),this._$CX=new Te}render(...t){return t.find(t=>!Oe(t))??Pt}update(t,e){const s=this._$Cbt;let n=s.length;this._$Cbt=e;const i=this._$CK,o=this._$CX;this.isConnected||this.disconnected();for(let t=0;t<e.length&&!(t>this._$Cwt);t++){const r=e[t];if(!Oe(r))return this._$Cwt=t,r;t<n&&r===s[t]||(this._$Cwt=Pe,n=0,Promise.resolve(r).then(async t=>{for(;o.get();)await o.get();const e=i.deref();if(void 0!==e){const s=e._$Cbt.indexOf(r);s>-1&&s<e._$Cwt&&(e._$Cwt=s,e.setValue(t))}}))}return Pt}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}}),ke=ee(class extends se{constructor(){super(...arguments),this.key=jt}render(t,e){return this.key=t,e}update(t,[e,s]){return e!==this.key&&(ae(t),this.key=e),s}}),Ue=t=>(t=>null!=t?._$litType$?.h)(t)?t._$litType$.h:t.strings,Ve=ee(class extends se{constructor(t){super(t),this.et=new WeakMap}render(t){return[t]}update(t,[e]){const s=ie(this.it)?Ue(this.it):null,n=ie(e)?Ue(e):null;if(null!==s&&(null===n||s!==n)){const e=ue(t).pop();let n=this.et.get(s);if(void 0===n){const t=document.createDocumentFragment();n=Gt(jt,t),n.setConnected(!1),this.et.set(s,n)}ae(n,[e]),le(n,void 0,e)}if(null!==n){if(null===s||s!==n){const e=this.et.get(n);if(void 0!==e){const s=ue(e).pop();pe(t),le(t,void 0,s),ae(t,[s])}}this.it=e}else this.it=void 0;return this.render(e)}});
42
+ */const je=t=>!(t=>null===t||"object"!=typeof t&&"function"!=typeof t)(t)&&"function"==typeof t.then,ke=1073741823;const Ue=ne(class extends Te{constructor(){super(...arguments),this._$Cwt=ke,this._$Cbt=[],this._$CK=new Oe(this),this._$CX=new Pe}render(...t){return t.find(t=>!je(t))??kt}update(t,e){const s=this._$Cbt;let n=s.length;this._$Cbt=e;const i=this._$CK,o=this._$CX;this.isConnected||this.disconnected();for(let t=0;t<e.length&&!(t>this._$Cwt);t++){const r=e[t];if(!je(r))return this._$Cwt=t,r;t<n&&r===s[t]||(this._$Cwt=ke,n=0,Promise.resolve(r).then(async t=>{for(;o.get();)await o.get();const e=i.deref();if(void 0!==e){const s=e._$Cbt.indexOf(r);s>-1&&s<e._$Cwt&&(e._$Cwt=s,e.setValue(t))}}))}return kt}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}}),Ve=ne(class extends ie{constructor(){super(...arguments),this.key=Ut}render(t,e){return this.key=t,e}update(t,[e,s]){return e!==this.key&&(de(t),this.key=e),s}}),Be=t=>(t=>null!=t?._$litType$?.h)(t)?t._$litType$.h:t.strings,Ie=ne(class extends ie{constructor(t){super(t),this.et=new WeakMap}render(t){return[t]}update(t,[e]){const s=re(this.it)?Be(this.it):null,n=re(e)?Be(e):null;if(null!==s&&(null===n||s!==n)){const e=pe(t).pop();let n=this.et.get(s);if(void 0===n){const t=document.createDocumentFragment();n=Yt(Ut,t),n.setConnected(!1),this.et.set(s,n)}de(n,[e]),he(n,void 0,e)}if(null!==n){if(null===s||s!==n){const e=this.et.get(n);if(void 0!==e){const s=pe(e).pop();fe(t),he(t,void 0,s),de(t,[s])}}this.it=e}else this.it=void 0;return this.render(e)}});
48
43
  /**
49
44
  * @license
50
45
  * Copyright 2021 Google LLC
@@ -55,7 +50,7 @@ const be=ee(class extends se{constructor(t){if(super(t),t.type!==Qt&&t.type!==Jt
55
50
  * Copyright 2017 Google LLC
56
51
  * SPDX-License-Identifier: BSD-3-Clause
57
52
  */
58
- let Be=class extends Me{constructor(){super(...arguments),this._$CK=new Ne(this),this._$CX=new Te}render(t,e){return Pt}update(t,[e,s]){if(this.isConnected||this.disconnected(),e===this._$CJ)return Pt;this._$CJ=e;let n=0;const{_$CK:i,_$CX:o}=this;return(async(t,e)=>{for await(const s of t)if(!1===await e(s))return})(e,async t=>{for(;o.get();)await o.get();const r=i.deref();if(void 0!==r){if(r._$CJ!==e)return!1;void 0!==s&&(t=s(t,n)),r.commitValue(t,n),n++}return!0}),Pt}commitValue(t,e){this.setValue(t)}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}};const Re=ee(Be);
53
+ let Re=class extends Te{constructor(){super(...arguments),this._$CK=new Oe(this),this._$CX=new Pe}render(t,e){return kt}update(t,[e,s]){if(this.isConnected||this.disconnected(),e===this._$CJ)return kt;this._$CJ=e;let n=0;const{_$CK:i,_$CX:o}=this;return(async(t,e)=>{for await(const s of t)if(!1===await e(s))return})(e,async t=>{for(;o.get();)await o.get();const r=i.deref();if(void 0!==r){if(r._$CJ!==e)return!1;void 0!==s&&(t=s(t,n)),r.commitValue(t,n),n++}return!0}),kt}commitValue(t,e){this.setValue(t)}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}};const De=ne(Re);
59
54
  /**
60
55
  * @license
61
56
  * Copyright 2021 Google LLC
@@ -66,16 +61,16 @@ let Be=class extends Me{constructor(){super(...arguments),this._$CK=new Ne(this)
66
61
  * Copyright 2017 Google LLC
67
62
  * SPDX-License-Identifier: BSD-3-Clause
68
63
  */
69
- const Ie=ee(class extends Be{constructor(t){if(super(t),t.type!==Yt)throw Error("asyncAppend can only be used in child expressions")}update(t,e){return this._$Ctt=t,super.update(t,e)}commitValue(t,e){0===e&&pe(this._$Ctt);const s=le(this._$Ctt);ce(s,t)}});exports._=W,exports.action=it,exports.asyncAppend=Ie,exports.asyncAtom=function(t,e){let s=t,n=null,i=null,o="init",r=!1,l=null;const c=new Set,h=()=>{c.forEach(t=>{try{t()}catch(t){console.error(t)}})},a=()=>{l&&(l.abort(),l=null),r=!1,o="init",h()},u=t=>{L(d,!1),Y&&Q.add(t)},d={getData:()=>(u(d),n),getError:()=>(u(d),i),getStatus:()=>(u(d),o),isLoading:()=>(u(d),r),set(t){s=t},cancel:a,run:async(...t)=>{a(),r=!0,o="loading",l=new AbortController;const c=l;h();try{const a=await s.call(e,...t,c);if(c.signal.aborted||l!==c)return;n=a,i=null,o="success",r=!1,h()}catch(t){if(c.signal.aborted||l!==c)return;n=null,i=t,o="error",r=!1,h()}finally{l===c&&(l=null)}},subscribe:t=>(c.add(t),()=>c.delete(t))};return d},exports.asyncReplace=Re,exports.atom=st,exports.bubble=t=>{if(G())throw new Error("you can't create a bubble in another bubble.");J(),Z(!0);let e=!1,s=1;const n=t=>(...n)=>{const i=t(...n);return e||(e=!0,queueMicrotask(()=>{e=!1,et(),s++,o.forEach(t=>t())})),i};X(n);let i=t(n);const o=new Set,r=()=>(L(r,!1),Y&&Q.add(r),i());return r.__isBubble___=!0,r.__id__=Math.random().toString(36).substring(2,15),Object.defineProperty(r,"__version__",{get:()=>(L(r,!1),s)}),r.reset=()=>{i=t(n)},r.subscribe=t=>(o.add(t),()=>o.delete(t)),Z(!1),X(null),r},exports.cache=Ve,exports.classMap=me,exports.df=nt,exports.getCurrentHost=D,exports.getStoreProps=ht,exports.getTemplateIsRunning=U,exports.getbubbleInProgress=G,exports.getbubblesSetter=()=>z,exports.getter=tt,exports.globalScheduler=V,exports.guard=Ae,exports.html=Ot,exports.iAtom=function(t){return st(t,!0)},exports.ifDefined=t=>t??jt,exports.incrGlobalVersion=et,exports.isPathMatching=rt,exports.join=function*(t,e){const s="function"==typeof e;if(void 0!==t){let n=-1;for(const i of t)n>-1&&(yield s?e(n):e),n++,yield i}}
64
+ const Le=ne(class extends Re{constructor(t){if(super(t),t.type!==te)throw Error("asyncAppend can only be used in child expressions")}update(t,e){return this._$Ctt=t,super.update(t,e)}commitValue(t,e){0===e&&fe(this._$Ctt);const s=he(this._$Ctt);ae(s,t)}});exports._=F,exports.action=ot,exports.asyncAppend=Le,exports.asyncAtom=function(t,e){let s=t,n=null,i=null,o="init",r=!1,l=null;const c=new Set,h=()=>{c.forEach(t=>{try{t()}catch(t){console.error(t)}})},a=()=>{l&&(l.abort(),l=null),r=!1,o="init",h()},u=t=>{W(d,!1),Q&&tt.add(t)},d={getData:()=>(u(d),n),getError:()=>(u(d),i),getStatus:()=>(u(d),o),isLoading:()=>(u(d),r),set(t){s=t},cancel:a,run:async(...t)=>{a(),r=!0,o="loading",l=new AbortController;const c=l;h();try{const a=await s.call(e,...t,c);if(c.signal.aborted||l!==c)return;n=a,i=null,o="success",r=!1,h()}catch(t){if(c.signal.aborted||l!==c)return;n=null,i=t,o="error",r=!1,h()}finally{l===c&&(l=null)}},subscribe:t=>(c.add(t),()=>c.delete(t))};return d},exports.asyncReplace=De,exports.atom=nt,exports.bubble=t=>{if(J())throw new Error("you can't create a bubble in another bubble.");Y(),X(!0);let e=!1,s=1;const n=t=>(...n)=>{const i=t(...n);return e||(e=!0,queueMicrotask(()=>{e=!1,st(),s++,o.forEach(t=>t())})),i};G(n);let i=t(n);const o=new Set,r=()=>(W(r,!1),Q&&tt.add(r),i());return r.__isBubble___=!0,r.__id__=Math.random().toString(36).substring(2,15),Object.defineProperty(r,"__version__",{get:()=>(W(r,!1),s)}),r.reset=()=>{i=t(n)},r.subscribe=t=>(o.add(t),()=>o.delete(t)),X(!1),G(null),r},exports.cache=Ie,exports.classMap=we,exports.df=it,exports.getCurrentHost=L,exports.getStoreProps=at,exports.getTemplateIsRunning=V,exports.getbubbleInProgress=J,exports.getbubblesSetter=()=>K,exports.getter=et,exports.globalScheduler=B,exports.guard=ge,exports.html=jt,exports.iAtom=function(t){return nt(t,!0)},exports.ifDefined=t=>t??Ut,exports.incrGlobalVersion=st,exports.isPathMatching=lt,exports.join=function*(t,e){const s="function"==typeof e;if(void 0!==t){let n=-1;for(const i of t)n>-1&&(yield s?e(n):e),n++,yield i}}
70
65
  /**
71
66
  * @license
72
67
  * Copyright 2021 Google LLC
73
68
  * SPDX-License-Identifier: BSD-3-Clause
74
- */,exports.keyed=ke,exports.live=be,exports.location=ot,exports.molecule=ct,exports.range=function*(t,e,s=1){const n=void 0===e?0:t;e??=t;for(let t=n;s>0?t<e:e<t;t+=s)yield t},exports.render=Gt,exports.repeat=fe,exports.safetyCheck=J,exports.setBubbleInProgress=Z,exports.setBubblesSetter=X,exports.setter=F,exports.styleMap=ve,exports.subscribe=L,exports.unit=at,exports.until=je,exports.useContext=function(t){let e=null;const s=new CustomEvent("request-context",{bubbles:!0,composed:!0,detail:{contextClass:t,resolve(t){e=t}}});return D().dispatchEvent(s),e},exports.useForceUpdate=q,exports.useMutable=function(t){const e=t,s=D();if(!s)throw new Error("useStore must be called inside a component");if("object"!=typeof e||null===e)throw new Error("state must be an object");return[e,t=>{t(e),et(),V.schedule(s)}]},exports.useOnMount=function(t){J();const e=D();queueMicrotask(()=>{try{const s=t();e&&s&&e.addToCleanUps(t,s)}catch(t){console.error(t)}})},exports.useOnUnmount=t=>{J();D().addToCleanUps(t,t)},exports.useRefEffect=(t,e)=>{const s=D();if(!s)throw new Error("refEffect must be called inside a component");let n=[];t(),n=e(),s.onEachUpdate(()=>{const s=e();n.some((t,e)=>t!==s[e])&&(t(),n=s)})},exports.useState=t=>{if(J(),"object"!=typeof t||null===t)throw new Error("state must be an object");const e=D();if(!e)throw new Error("useState must be called inside a component");return[t,t=>(et(),V.schedule(e),t?.())]},exports.useStore=function(t){return L(t,!0),t},exports.useSubscribe=function(t,e){J();const s=D();e.map(e=>e.subscribe(t)).forEach(t=>s.addToCleanUps(e,t))},exports.useUpdate=q,exports.view=(t,e={})=>g`<x-view .view=${t} .props=${()=>e}></x-view>`,exports.when=
69
+ */,exports.keyed=Ve,exports.live=xe,exports.location=rt,exports.molecule=ht,exports.range=function*(t,e,s=1){const n=void 0===e?0:t;e??=t;for(let t=n;s>0?t<e:e<t;t+=s)yield t},exports.render=Yt,exports.renderView=(t,e)=>{const s=document.getElementById(e);if(!s)throw new Error(`Element with id ${e} not found`);return k(pt(t,{}),s)},exports.repeat=Ae,exports.safetyCheck=Y,exports.setBubbleInProgress=X,exports.setBubblesSetter=G,exports.setter=q,exports.styleMap=be,exports.subscribe=W,exports.unit=ut,exports.until=Ue,exports.useContext=function(t){let e=null;const s=new CustomEvent("request-context",{bubbles:!0,composed:!0,detail:{contextClass:t,resolve(t){e=t}}});return L().dispatchEvent(s),e},exports.useForceUpdate=z,exports.useMutable=function(t){const e=t,s=L();if(!s)throw new Error("useStore must be called inside a component");if("object"!=typeof e||null===e)throw new Error("state must be an object");return[e,t=>{t(e),st(),B.schedule(s)}]},exports.useOnMount=function(t){Y();const e=L();queueMicrotask(()=>{try{const s=t();e&&s&&e.addToCleanUps(t,s)}catch(t){console.error(t)}})},exports.useOnUnmount=t=>{Y();L().addToCleanUps(t,t)},exports.useRefEffect=(t,e)=>{const s=L();if(!s)throw new Error("refEffect must be called inside a component");let n=[];t(),n=e(),s.onEachUpdate(()=>{const s=e();n.some((t,e)=>t!==s[e])&&(t(),n=s)})},exports.useState=t=>{if(Y(),"object"!=typeof t||null===t)throw new Error("state must be an object");const e=L();if(!e)throw new Error("useState must be called inside a component");return[t,t=>(st(),B.schedule(e),t?.())]},exports.useStore=function(t){return W(t,!0),t},exports.useSubscribe=function(t,e){Y();const s=L();e.map(e=>e.subscribe(t)).forEach(t=>s.addToCleanUps(e,t))},exports.useUpdate=z,exports.view=pt,exports.when=
75
70
  /**
76
71
  * @license
77
72
  * Copyright 2021 Google LLC
78
73
  * SPDX-License-Identifier: BSD-3-Clause
79
74
  */
80
- function(t,e,s){return t?e(t):s?.(t)},exports.withHost=I;
75
+ function(t,e,s){return t?e(t):s?.(t)},exports.withHost=D;
81
76
  //# sourceMappingURL=index.js.map