mates 0.0.7 → 0.0.9
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.esm.js +5 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/pathResolver.d.ts +3 -1
- package/dist/pathResolver.d.ts.map +1 -1
- package/dist/useStore.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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");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
|
|
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),m=Symbol.for("lit-noChange"),v=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 m=s.length-1,v=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,m=0;for(;m<s.length&&(h.lastIndex=m,u=h.exec(s),null!==u);)m=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 v=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+v):s+i+(-2===g?e:v)}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())&&v.length<m;){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);v.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)&&(v.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(),v.push({type:2,index:++u});a.append(t[s],c())}}}else if(8===a.nodeType)if(a.data===o)v.push({type:2,index:u});else{let t=-1;for(;-1!==(t=a.data.indexOf(i,t+1));)v.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===m)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=v,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===v||null==t||""===t?(this._$AH!==v&&this._$AR(),this._$AH=v):t!==this._$AH&&t!==m&&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!==v&&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=v,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=v}_$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!==m,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===m&&(l=this._$AH[r]),o||=!h(l)||l!==this._$AH[r],l===v?t=v:t!==v&&(t+=(l??"")+i[r+1]),this._$AH[r]=l}o&&!n&&this.j(t)}j(t){t===v?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===v?void 0:t}},T=class extends M{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==v)}},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)??v)===m)return;const s=this._$AH,n=t===v&&s!==v||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,i=t!==v&&(s===v||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,requestAnimationFrame(()=>{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 F(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 W=t=>{if(Z)return K;Y();const e=new Set;try{const s=L(),n=(...n)=>{const i=t(...n);return st(),e.forEach(t=>t()),s&&B.schedule(s),i};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=W,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=()=>(F(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:()=>(F(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={get path(){return this.pathAtom.get()},pathAtom:nt(window.location.pathname),navigateTo(t,e){e?window.history.replaceState({},"",t):window.history.pushState({},"",t),this.pathAtom.set(t)},matchPath:t=>lt(t)};window.addEventListener("popstate",()=>{rt.pathAtom.set(window.location.pathname)}),window.addEventListener("hashchange",()=>{rt.pathAtom.set(window.location.pathname)}),window.addEventListener("navigate",()=>{rt.pathAtom.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=()=>(F(s,!1),Q&&tt.add(s),t),n=new Set;s.__isUnit___=!0,Object.defineProperty(s,"__version__",{get:()=>(F(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,mt=`<${gt}>`,vt=document,bt=()=>vt.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=vt.createTreeWalker(vt,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+mt: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=vt.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 Ft=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??vt).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 Wt(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=vt,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 Wt{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(vt.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 Ft(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 Wt(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:Ft,D:Ct,V:Lt,I:Wt,H:qt,N:Kt,U:Zt,B:zt,F:Xt},Jt=_t.litHtmlPolyfillSupport;Jt?.(Dt,Wt),(_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 Wt(e.insertBefore(bt(),t),t,void 0,s??{})}return i._$AI(t),i
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2020 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
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)}}),
|
|
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)}}),me="important",ve=" !"+me,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(ve);t.includes("-")||e?s.setProperty(t,e?n.slice(0,-11):n,e?me:""):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}});
|
|
17
17
|
/**
|
|
18
18
|
* @license
|
|
19
19
|
* Copyright 2017 Google LLC
|
|
@@ -61,12 +61,12 @@ let Re=class extends Te{constructor(){super(...arguments),this._$CK=new Oe(this)
|
|
|
61
61
|
* Copyright 2017 Google LLC
|
|
62
62
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
63
|
*/
|
|
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._=
|
|
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._=W,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=>{F(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=()=>(F(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:()=>(F(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}}
|
|
65
65
|
/**
|
|
66
66
|
* @license
|
|
67
67
|
* Copyright 2021 Google LLC
|
|
68
68
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
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=
|
|
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=F,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 F(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=
|
|
70
70
|
/**
|
|
71
71
|
* @license
|
|
72
72
|
* Copyright 2021 Google LLC
|