@aegis-framework/pandora 0.4.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1394 -727
- package/dist/pandora.browser.js +16 -15
- package/dist/pandora.browser.js.map +11 -9
- package/dist/pandora.js +16 -15
- package/dist/pandora.js.map +10 -8
- package/dist/types/Component.d.ts +792 -209
- package/dist/types/Component.d.ts.map +1 -1
- package/dist/types/Decorators.d.ts +378 -35
- package/dist/types/Decorators.d.ts.map +1 -1
- package/dist/types/Registry.d.ts +478 -105
- package/dist/types/Registry.d.ts.map +1 -1
- package/dist/types/ShadowComponent.d.ts +128 -23
- package/dist/types/ShadowComponent.d.ts.map +1 -1
- package/dist/types/Testing.d.ts +74 -0
- package/dist/types/Testing.d.ts.map +1 -0
- package/dist/types/TypedState.d.ts +51 -0
- package/dist/types/TypedState.d.ts.map +1 -0
- package/dist/types/Types.d.ts +92 -2
- package/dist/types/Types.d.ts.map +1 -1
- package/dist/types/Util.d.ts +134 -15
- package/dist/types/Util.d.ts.map +1 -1
- package/dist/types/browser.d.ts +14 -0
- package/dist/types/browser.d.ts.map +1 -1
- package/dist/types/index.d.ts +5 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +11 -5
package/dist/pandora.browser.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]`,
|
|
4
|
-
This is probably caused by illegal octal escape sequences.`);if(
|
|
5
|
-
Please use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions`);return{["_$litType$"]:J,strings:
|
|
1
|
+
var PX=Object.defineProperty;var QJ=(J,X)=>{for(var Z in X)PX(J,Z,{get:X[Z],enumerable:!0,configurable:!0,set:($)=>X[Z]=()=>$})};var fJ={};QJ(fJ,{testing:()=>LJ,svg:()=>EJ,render:()=>S,reactive:()=>PJ,nothing:()=>F,noChange:()=>E,html:()=>KJ,createState:()=>FX,addTeardown:()=>g,addDecoratorEffect:()=>f,Watch:()=>eJ,Util:()=>DJ,Types:()=>OX,Subscribe:()=>GX,Style:()=>tJ,State:()=>XX,Slot:()=>qX,ShadowComponent:()=>pJ,Registry:()=>I,Register:()=>aJ,QueryAll:()=>zX,Query:()=>QX,Property:()=>ZX,Listen:()=>WX,Emitter:()=>UX,Computed:()=>BX,Component:()=>D,ClassList:()=>MX,Attribute:()=>$X});var b=globalThis,M=(J)=>{if(!b.emitLitDebugLogEvents)return;b.dispatchEvent(new CustomEvent("lit-debug",{detail:J}))},_X=0,p;b.litIssuedWarnings??=new Set,p=(J,X)=>{if(X+=J?` See https://lit.dev/msg/${J} for more information.`:"",!b.litIssuedWarnings.has(X)&&!b.litIssuedWarnings.has(J))console.warn(X),b.litIssuedWarnings.add(X)},queueMicrotask(()=>{p("dev-mode","Lit is in dev mode. Not recommended for production!")});var k=b.ShadyDOM?.inUse&&b.ShadyDOM?.noPatch===!0?b.ShadyDOM.wrap:(J)=>J,t=b.trustedTypes,bJ=t?t.createPolicy("lit-html",{createHTML:(J)=>J}):void 0,DX=(J)=>J,ZJ=(J,X,Z)=>DX,IX=(J)=>{if(T!==ZJ)throw Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");T=J},LX=()=>{T=ZJ},MJ=(J,X,Z)=>{return T(J,X,Z)},CJ="$lit$",V=`lit$${Math.random().toFixed(9).slice(2)}$`,xJ="?"+V,fX=`<${xJ}>`,K=document,c=()=>K.createComment(""),i=(J)=>J===null||typeof J!="object"&&typeof J!="function",UJ=Array.isArray,bX=(J)=>UJ(J)||typeof J?.[Symbol.iterator]==="function",zJ=`[
|
|
2
|
+
\f\r]`,kX=`[^
|
|
3
|
+
\f\r"'\`<>=]`,VX=`[^\\s"'>=/]`,u=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,kJ=1,qJ=2,SX=3,VJ=/-->/g,SJ=/>/g,w=new RegExp(`>|${zJ}(?:(${VX}+)(${zJ}*=${zJ}*(?:${kX}|("|')|))|$)`,"g"),NX=0,NJ=1,wX=2,wJ=3,WJ=/'/g,BJ=/"/g,RJ=/^(?:script|style|textarea|title)$/i,AX=1,e=2,JJ=3,FJ=1,XJ=2,CX=3,xX=4,RX=5,HJ=6,KX=7,OJ=(J)=>(X,...Z)=>{if(X.some(($)=>$===void 0))console.warn(`Some template strings are undefined.
|
|
4
|
+
This is probably caused by illegal octal escape sequences.`);if(Z.some(($)=>$?._$litStatic$))p("",`Static values 'literal' or 'unsafeStatic' cannot be used as values to non-static templates.
|
|
5
|
+
Please use the static 'html' tag function. See https://lit.dev/docs/templates/expressions/#static-expressions`);return{["_$litType$"]:J,strings:X,values:Z}},KJ=OJ(AX),EJ=OJ(e),uX=OJ(JJ),E=Symbol.for("lit-noChange"),F=Symbol.for("lit-nothing"),AJ=new WeakMap,R=K.createTreeWalker(K,129),T=ZJ;function TJ(J,X){if(!UJ(J)||!J.hasOwnProperty("raw")){let Z="invalid template strings array";throw Z=`
|
|
6
6
|
Internal Error: expected template strings to be an array
|
|
7
7
|
with a 'raw' field. Faking a template strings array by
|
|
8
8
|
calling html or svg like an ordinary function is effectively
|
|
@@ -13,17 +13,18 @@ Please use the static 'html' tag function. See https://lit.dev/docs/templates/ex
|
|
|
13
13
|
https://github.com/lit/lit/issues/new?template=bug_report.md
|
|
14
14
|
and include information about your build tooling, if any.
|
|
15
15
|
`.trim().replace(/\n */g,`
|
|
16
|
-
`),Error(X)}return ZJ!==void 0?ZJ.createHTML(W):W}var iJ=(J,W)=>{let X=J.length-1,Y=[],Z=W===c?"<svg>":W===g?"<math>":"",$,q=h;for(let Q=0;Q<X;Q++){let F=J[Q],B=-1,_,K=0,z;while(K<F.length){if(q.lastIndex=K,z=q.exec(F),z===null)break;if(K=q.lastIndex,q===h){if(z[$J]==="!--")q=qJ;else if(z[$J]!==void 0)q=GJ;else if(z[s]!==void 0){if(UJ.test(z[s]))$=new RegExp(`</${z[s]}`,"g");q=R}else if(z[yJ]!==void 0)throw Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else if(q===R)if(z[dJ]===">")q=$??h,B=-1;else if(z[QJ]===void 0)B=-2;else B=q.lastIndex-z[mJ].length,_=z[QJ],q=z[BJ]===void 0?R:z[BJ]==='"'?r:o;else if(q===r||q===o)q=R;else if(q===qJ||q===GJ)q=h;else q=R,$=void 0}console.assert(B===-1||q===R||q===o||q===r,"unexpected parse state B");let A=q===R&&J[Q+1].startsWith("/>")?" ":"";Z+=q===h?F+wJ:B>=0?(Y.push(_),F.slice(0,B)+FJ+F.slice(B))+S+A:F+S+(B===-2?Q:A)}let G=Z+(J[X]||"<?>")+(W===c?"</svg>":W===g?"</math>":"");return[fJ(J,G),Y]};class k{constructor({strings:J,["_$litType$"]:W},X){this.parts=[];let Y,Z=0,$=0,q=J.length-1,G=this.parts,[Q,F]=iJ(J,W);if(this.el=k.createElement(Q,X),E.currentNode=this.el.content,W===c||W===g){let B=this.el.content.firstChild;B.replaceWith(...B.childNodes)}while((Y=E.nextNode())!==null&&G.length<q){if(Y.nodeType===1){{let B=Y.localName;if(/^(?:textarea|template)$/i.test(B)&&Y.innerHTML.includes(S)){let _=`Expressions are not supported inside \`${B}\` elements. See https://lit.dev/msg/expression-in-${B} for more information.`;if(B==="template")throw Error(_);else w("",_)}}if(Y.hasAttributes()){for(let B of Y.getAttributeNames())if(B.endsWith(FJ)){let _=F[$++],z=Y.getAttribute(B).split(S),A=/([.?@])?(.*)/.exec(_);G.push({type:a,index:Z,name:A[2],strings:z,ctor:A[1]==="."?OJ:A[1]==="?"?SJ:A[1]==="@"?DJ:d}),Y.removeAttribute(B)}else if(B.startsWith(S))G.push({type:t,index:Z}),Y.removeAttribute(B)}if(UJ.test(Y.tagName)){let B=Y.textContent.split(S),_=B.length-1;if(_>0){Y.textContent=v?v.emptyScript:"";for(let K=0;K<_;K++)Y.append(B[K],x()),E.nextNode(),G.push({type:p,index:++Z});Y.append(B[_],x())}}}else if(Y.nodeType===8)if(Y.data===MJ)G.push({type:p,index:Z});else{let _=-1;while((_=Y.data.indexOf(S,_+1))!==-1)G.push({type:uJ,index:Z}),_+=S.length-1}Z++}if(F.length!==$)throw Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+J.join("${...}")+"`");H&&H({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:J})}static createElement(J,W){let X=N.createElement("template");return X.innerHTML=J,X}}function T(J,W,X=J,Y){if(W===L)return W;let Z=Y!==void 0?X.__directives?.[Y]:X.__directive,$=b(W)?void 0:W._$litDirective$;if(Z?.constructor!==$){if(Z?._$notifyDirectiveConnectionChanged?.(!1),$===void 0)Z=void 0;else Z=new $(J),Z._$initialize(J,X,Y);if(Y!==void 0)(X.__directives??=[])[Y]=Z;else X.__directive=Z}if(Z!==void 0)W=T(J,Z._$resolve(J,W.values),Z,Y);return W}class jJ{constructor(J,W){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=J,this._$parent=W}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(J){let{el:{content:W},parts:X}=this._$template,Y=(J?.creationScope??N).importNode(W,!0);E.currentNode=Y;let Z=E.nextNode(),$=0,q=0,G=X[0];while(G!==void 0){if($===G.index){let Q;if(G.type===p)Q=new y(Z,Z.nextSibling,this,J);else if(G.type===a)Q=new G.ctor(Z,G.name,G.strings,this,J);else if(G.type===t)Q=new KJ(Z,this,J);this._$parts.push(Q),G=X[++q]}if($!==G?.index)Z=E.nextNode(),$++}return E.currentNode=N,Y}_update(J){let W=0;for(let X of this._$parts){if(X!==void 0)if(H&&H({kind:"set part",part:X,value:J[W],valueIndex:W,values:J,templateInstance:this}),X.strings!==void 0)X._$setValue(J,X,W),W+=X.strings.length-2;else X._$setValue(J[W]);W++}}}class y{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(J,W,X,Y){this.type=p,this._$committedValue=M,this._$disconnectableChildren=void 0,this._$startNode=J,this._$endNode=W,this._$parent=X,this.options=Y,this.__isConnected=Y?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let J=O(this._$startNode).parentNode,W=this._$parent;if(W!==void 0&&J?.nodeType===11)J=W.parentNode;return J}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(J,W=this){if(this.parentNode===null)throw Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(J=T(this,J,W),b(J)){if(J===M||J==null||J===""){if(this._$committedValue!==M)H&&H({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear();this._$committedValue=M}else if(J!==this._$committedValue&&J!==L)this._commitText(J)}else if(J._$litType$!==void 0)this._commitTemplateResult(J);else if(J.nodeType!==void 0){if(this.options?.host===J){this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),console.warn("Attempted to render the template host",J,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");return}this._commitNode(J)}else if(xJ(J))this._commitIterable(J);else this._commitText(J)}_insert(J){return O(O(this._$startNode).parentNode).insertBefore(J,this._$endNode)}_commitNode(J){if(this._$committedValue!==J){if(this._$clear(),V!==u){let W=this._$startNode.parentNode?.nodeName;if(W==="STYLE"||W==="SCRIPT"){let X="Forbidden";if(W==="STYLE")X="Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.";else X="Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.";throw Error(X)}}H&&H({kind:"commit node",start:this._$startNode,parent:this._$parent,value:J,options:this.options}),this._$committedValue=this._insert(J)}}_commitText(J){if(this._$committedValue!==M&&b(this._$committedValue)){let W=O(this._$startNode).nextSibling;if(this._textSanitizer===void 0)this._textSanitizer=l(W,"data","property");J=this._textSanitizer(J),H&&H({kind:"commit text",node:W,value:J,options:this.options}),W.data=J}else{let W=N.createTextNode("");if(this._commitNode(W),this._textSanitizer===void 0)this._textSanitizer=l(W,"data","property");J=this._textSanitizer(J),H&&H({kind:"commit text",node:W,value:J,options:this.options}),W.data=J}this._$committedValue=J}_commitTemplateResult(J){let{values:W,["_$litType$"]:X}=J,Y=typeof X==="number"?this._$getTemplate(J):(X.el===void 0&&(X.el=k.createElement(fJ(X.h,X.h[0]),this.options)),X);if(this._$committedValue?._$template===Y)H&&H({kind:"template updating",template:Y,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:W}),this._$committedValue._update(W);else{let Z=new jJ(Y,this),$=Z._clone(this.options);H&&H({kind:"template instantiated",template:Y,instance:Z,parts:Z._$parts,options:this.options,fragment:$,values:W}),Z._update(W),H&&H({kind:"template instantiated and updated",template:Y,instance:Z,parts:Z._$parts,options:this.options,fragment:$,values:W}),this._commitNode($),this._$committedValue=Z}}_$getTemplate(J){let W=HJ.get(J.strings);if(W===void 0)HJ.set(J.strings,W=new k(J));return W}_commitIterable(J){if(!n(this._$committedValue))this._$committedValue=[],this._$clear();let W=this._$committedValue,X=0,Y;for(let Z of J){if(X===W.length)W.push(Y=new y(this._insert(x()),this._insert(x()),this,this.options));else Y=W[X];Y._$setValue(Z),X++}if(X<W.length)this._$clear(Y&&O(Y._$endNode).nextSibling,X),W.length=X}_$clear(J=O(this._$startNode).nextSibling,W){this._$notifyConnectionChanged?.(!1,!0,W);while(J!==this._$endNode){let X=O(J).nextSibling;O(J).remove(),J=X}}setConnected(J){if(this._$parent===void 0)this.__isConnected=J,this._$notifyConnectionChanged?.(J);else throw Error("part.setConnected() may only be called on a RootPart returned from render().")}}class d{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(J,W,X,Y,Z){if(this.type=a,this._$committedValue=M,this._$disconnectableChildren=void 0,this.element=J,this.name=W,this._$parent=Y,this.options=Z,X.length>2||X[0]!==""||X[1]!=="")this._$committedValue=Array(X.length-1).fill(new String),this.strings=X;else this._$committedValue=M;this._sanitizer=void 0}_$setValue(J,W=this,X,Y){let Z=this.strings,$=!1;if(Z===void 0){if(J=T(this,J,W,0),$=!b(J)||J!==this._$committedValue&&J!==L,$)this._$committedValue=J}else{let q=J;J=Z[0];let G,Q;for(G=0;G<Z.length-1;G++){if(Q=T(this,q[X+G],W,G),Q===L)Q=this._$committedValue[G];if($||=!b(Q)||Q!==this._$committedValue[G],Q===M)J=M;else if(J!==M)J+=(Q??"")+Z[G+1];this._$committedValue[G]=Q}}if($&&!Y)this._commitValue(J)}_commitValue(J){if(J===M)O(this.element).removeAttribute(this.name);else{if(this._sanitizer===void 0)this._sanitizer=V(this.element,this.name,"attribute");J=this._sanitizer(J??""),H&&H({kind:"commit attribute",element:this.element,name:this.name,value:J,options:this.options}),O(this.element).setAttribute(this.name,J??"")}}}class OJ extends d{constructor(){super(...arguments);this.type=cJ}_commitValue(J){if(this._sanitizer===void 0)this._sanitizer=V(this.element,this.name,"property");J=this._sanitizer(J),H&&H({kind:"commit property",element:this.element,name:this.name,value:J,options:this.options}),this.element[this.name]=J===M?void 0:J}}class SJ extends d{constructor(){super(...arguments);this.type=gJ}_commitValue(J){H&&H({kind:"commit boolean attribute",element:this.element,name:this.name,value:!!(J&&J!==M),options:this.options}),O(this.element).toggleAttribute(this.name,!!J&&J!==M)}}class DJ extends d{constructor(J,W,X,Y,Z){super(J,W,X,Y,Z);if(this.type=pJ,this.strings!==void 0)throw Error(`A \`<${J.localName}>\` has a \`@${W}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(J,W=this){if(J=T(this,J,W,0)??M,J===L)return;let X=this._$committedValue,Y=J===M&&X!==M||J.capture!==X.capture||J.once!==X.once||J.passive!==X.passive,Z=J!==M&&(X===M||Y);if(H&&H({kind:"commit event listener",element:this.element,name:this.name,value:J,options:this.options,removeListener:Y,addListener:Z,oldListener:X}),Y)this.element.removeEventListener(this.name,this,X);if(Z)this.element.addEventListener(this.name,this,J);this._$committedValue=J}handleEvent(J){if(typeof this._$committedValue==="function")this._$committedValue.call(this.options?.host??this.element,J);else this._$committedValue.handleEvent(J)}}class KJ{constructor(J,W,X){this.element=J,this.type=t,this._$disconnectableChildren=void 0,this._$parent=W,this.options=X}get _$isConnected(){return this._$parent._$isConnected}_$setValue(J){H&&H({kind:"commit to element binding",element:this.element,value:J,options:this.options}),T(this,J)}}var sJ=j.litHtmlPolyfillSupportDevMode;sJ?.(k,y);(j.litHtmlVersions??=[]).push("3.3.1");if(j.litHtmlVersions.length>1)queueMicrotask(()=>{w("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});var D=(J,W,X)=>{if(W==null)throw TypeError(`The container to render into may not be ${W}`);let Y=IJ++,Z=X?.renderBefore??W,$=Z._$litPart$;if(H&&H({kind:"begin render",id:Y,value:J,container:W,options:X,part:$}),$===void 0){let q=X?.renderBefore??null;Z._$litPart$=$=new y(W.insertBefore(x(),q),q,void 0,X??{})}return $._$setValue(J),H&&H({kind:"end render",id:Y,value:J,container:W,options:X,part:$}),$};D.setSanitizer=CJ,D.createSanitizer=l,D._testOnlyClearSanitizerFactoryDoNotCallOrElse=hJ;var JJ={};YJ(JJ,{isTemplateResult:()=>P,deserializeCSS:()=>C,callAsync:()=>m});function m(J,W,...X){try{let Y=J.apply(W,X);return Y instanceof Promise?Y:Promise.resolve(Y)}catch(Y){return Promise.reject(Y)}}function P(J){return J!==null&&typeof J==="object"&&"_$litType$"in J}function C(J,W="",X=0){let Y=Object.keys(J),Z="";for(let $ of Y){let q=J[$];if(typeof q==="object"&&q!==null){if(W&&!$.startsWith("@"))if($.startsWith("&"))Z+=`${$.replace(/&/g,W)} {
|
|
17
|
-
`;else
|
|
18
|
-
`;else
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
`}
|
|
22
|
-
`}
|
|
16
|
+
`),Error(Z)}return bJ!==void 0?bJ.createHTML(X):X}var EX=(J,X)=>{let Z=J.length-1,$=[],Y=X===e?"<svg>":X===JJ?"<math>":"",j,G=u;for(let z=0;z<Z;z++){let W=J[z],q=-1,B,U=0,O;while(U<W.length){if(G.lastIndex=U,O=G.exec(W),O===null)break;if(U=G.lastIndex,G===u){if(O[kJ]==="!--")G=VJ;else if(O[kJ]!==void 0)G=SJ;else if(O[qJ]!==void 0){if(RJ.test(O[qJ]))j=new RegExp(`</${O[qJ]}`,"g");G=w}else if(O[SX]!==void 0)throw Error("Bindings in tag names are not supported. Please use static templates instead. See https://lit.dev/docs/templates/expressions/#static-expressions")}else if(G===w)if(O[NX]===">")G=j??u,q=-1;else if(O[NJ]===void 0)q=-2;else q=G.lastIndex-O[wX].length,B=O[NJ],G=O[wJ]===void 0?w:O[wJ]==='"'?BJ:WJ;else if(G===BJ||G===WJ)G=w;else if(G===VJ||G===SJ)G=u;else G=w,j=void 0}console.assert(q===-1||G===w||G===WJ||G===BJ,"unexpected parse state B");let x=G===w&&J[z+1].startsWith("/>")?" ":"";Y+=G===u?W+fX:q>=0?($.push(B),W.slice(0,q)+CJ+W.slice(q))+V+x:W+V+(q===-2?z:x)}let Q=Y+(J[Z]||"<?>")+(X===e?"</svg>":X===JJ?"</math>":"");return[TJ(J,Q),$]};class l{constructor({strings:J,["_$litType$"]:X},Z){this.parts=[];let $,Y=0,j=0,G=J.length-1,Q=this.parts,[z,W]=EX(J,X);if(this.el=l.createElement(z,Z),R.currentNode=this.el.content,X===e||X===JJ){let q=this.el.content.firstChild;q.replaceWith(...q.childNodes)}while(($=R.nextNode())!==null&&Q.length<G){if($.nodeType===1){{let q=$.localName;if(/^(?:textarea|template)$/i.test(q)&&$.innerHTML.includes(V)){let B=`Expressions are not supported inside \`${q}\` elements. See https://lit.dev/msg/expression-in-${q} for more information.`;if(q==="template")throw Error(B);else p("",B)}}if($.hasAttributes()){for(let q of $.getAttributeNames())if(q.endsWith(CJ)){let B=W[j++],O=$.getAttribute(q).split(V),x=/([.?@])?(.*)/.exec(B);Q.push({type:FJ,index:Y,name:x[2],strings:O,ctor:x[1]==="."?vJ:x[1]==="?"?gJ:x[1]==="@"?mJ:s}),$.removeAttribute(q)}else if(q.startsWith(V))Q.push({type:HJ,index:Y}),$.removeAttribute(q)}if(RJ.test($.tagName)){let q=$.textContent.split(V),B=q.length-1;if(B>0){$.textContent=t?t.emptyScript:"";for(let U=0;U<B;U++)$.append(q[U],c()),R.nextNode(),Q.push({type:XJ,index:++Y});$.append(q[B],c())}}}else if($.nodeType===8)if($.data===xJ)Q.push({type:XJ,index:Y});else{let B=-1;while((B=$.data.indexOf(V,B+1))!==-1)Q.push({type:KX,index:Y}),B+=V.length-1}Y++}if(W.length!==j)throw Error('Detected duplicate attribute bindings. This occurs if your template has duplicate attributes on an element tag. For example "<input ?disabled=${true} ?disabled=${false}>" contains a duplicate "disabled" attribute. The error was detected in the following template: \n`'+J.join("${...}")+"`");M&&M({kind:"template prep",template:this,clonableTemplate:this.el,parts:this.parts,strings:J})}static createElement(J,X){let Z=K.createElement("template");return Z.innerHTML=J,Z}}function m(J,X,Z=J,$){if(X===E)return X;let Y=$!==void 0?Z.__directives?.[$]:Z.__directive,j=i(X)?void 0:X._$litDirective$;if(Y?.constructor!==j){if(Y?._$notifyDirectiveConnectionChanged?.(!1),j===void 0)Y=void 0;else Y=new j(J),Y._$initialize(J,Z,$);if($!==void 0)(Z.__directives??=[])[$]=Y;else Z.__directive=Y}if(Y!==void 0)X=m(J,Y._$resolve(J,X.values),Y,$);return X}class hJ{constructor(J,X){this._$parts=[],this._$disconnectableChildren=void 0,this._$template=J,this._$parent=X}get parentNode(){return this._$parent.parentNode}get _$isConnected(){return this._$parent._$isConnected}_clone(J){let{el:{content:X},parts:Z}=this._$template,$=(J?.creationScope??K).importNode(X,!0);R.currentNode=$;let Y=R.nextNode(),j=0,G=0,Q=Z[0];while(Q!==void 0){if(j===Q.index){let z;if(Q.type===XJ)z=new o(Y,Y.nextSibling,this,J);else if(Q.type===FJ)z=new Q.ctor(Y,Q.name,Q.strings,this,J);else if(Q.type===HJ)z=new dJ(Y,this,J);this._$parts.push(z),Q=Z[++G]}if(j!==Q?.index)Y=R.nextNode(),j++}return R.currentNode=K,$}_update(J){let X=0;for(let Z of this._$parts){if(Z!==void 0)if(M&&M({kind:"set part",part:Z,value:J[X],valueIndex:X,values:J,templateInstance:this}),Z.strings!==void 0)Z._$setValue(J,Z,X),X+=Z.strings.length-2;else Z._$setValue(J[X]);X++}}}class o{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(J,X,Z,$){this.type=XJ,this._$committedValue=F,this._$disconnectableChildren=void 0,this._$startNode=J,this._$endNode=X,this._$parent=Z,this.options=$,this.__isConnected=$?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let J=k(this._$startNode).parentNode,X=this._$parent;if(X!==void 0&&J?.nodeType===11)J=X.parentNode;return J}get startNode(){return this._$startNode}get endNode(){return this._$endNode}_$setValue(J,X=this){if(this.parentNode===null)throw Error("This `ChildPart` has no `parentNode` and therefore cannot accept a value. This likely means the element containing the part was manipulated in an unsupported way outside of Lit's control such that the part's marker nodes were ejected from DOM. For example, setting the element's `innerHTML` or `textContent` can do this.");if(J=m(this,J,X),i(J)){if(J===F||J==null||J===""){if(this._$committedValue!==F)M&&M({kind:"commit nothing to child",start:this._$startNode,end:this._$endNode,parent:this._$parent,options:this.options}),this._$clear();this._$committedValue=F}else if(J!==this._$committedValue&&J!==E)this._commitText(J)}else if(J._$litType$!==void 0)this._commitTemplateResult(J);else if(J.nodeType!==void 0){if(this.options?.host===J){this._commitText("[probable mistake: rendered a template's host in itself (commonly caused by writing ${this} in a template]"),console.warn("Attempted to render the template host",J,"inside itself. This is almost always a mistake, and in dev mode ","we render some warning text. In production however, we'll ","render it, which will usually result in an error, and sometimes ","in the element disappearing from the DOM.");return}this._commitNode(J)}else if(bX(J))this._commitIterable(J);else this._commitText(J)}_insert(J){return k(k(this._$startNode).parentNode).insertBefore(J,this._$endNode)}_commitNode(J){if(this._$committedValue!==J){if(this._$clear(),T!==ZJ){let X=this._$startNode.parentNode?.nodeName;if(X==="STYLE"||X==="SCRIPT"){let Z="Forbidden";if(X==="STYLE")Z="Lit does not support binding inside style nodes. This is a security risk, as style injection attacks can exfiltrate data and spoof UIs. Consider instead using css`...` literals to compose styles, and do dynamic styling with css custom properties, ::parts, <slot>s, and by mutating the DOM rather than stylesheets.";else Z="Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.";throw Error(Z)}}M&&M({kind:"commit node",start:this._$startNode,parent:this._$parent,value:J,options:this.options}),this._$committedValue=this._insert(J)}}_commitText(J){if(this._$committedValue!==F&&i(this._$committedValue)){let X=k(this._$startNode).nextSibling;if(this._textSanitizer===void 0)this._textSanitizer=MJ(X,"data","property");J=this._textSanitizer(J),M&&M({kind:"commit text",node:X,value:J,options:this.options}),X.data=J}else{let X=K.createTextNode("");if(this._commitNode(X),this._textSanitizer===void 0)this._textSanitizer=MJ(X,"data","property");J=this._textSanitizer(J),M&&M({kind:"commit text",node:X,value:J,options:this.options}),X.data=J}this._$committedValue=J}_commitTemplateResult(J){let{values:X,["_$litType$"]:Z}=J,$=typeof Z==="number"?this._$getTemplate(J):(Z.el===void 0&&(Z.el=l.createElement(TJ(Z.h,Z.h[0]),this.options)),Z);if(this._$committedValue?._$template===$)M&&M({kind:"template updating",template:$,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:X}),this._$committedValue._update(X);else{let Y=new hJ($,this),j=Y._clone(this.options);M&&M({kind:"template instantiated",template:$,instance:Y,parts:Y._$parts,options:this.options,fragment:j,values:X}),Y._update(X),M&&M({kind:"template instantiated and updated",template:$,instance:Y,parts:Y._$parts,options:this.options,fragment:j,values:X}),this._commitNode(j),this._$committedValue=Y}}_$getTemplate(J){let X=AJ.get(J.strings);if(X===void 0)AJ.set(J.strings,X=new l(J));return X}_commitIterable(J){if(!UJ(this._$committedValue))this._$committedValue=[],this._$clear();let X=this._$committedValue,Z=0,$;for(let Y of J){if(Z===X.length)X.push($=new o(this._insert(c()),this._insert(c()),this,this.options));else $=X[Z];$._$setValue(Y),Z++}if(Z<X.length)this._$clear($&&k($._$endNode).nextSibling,Z),X.length=Z}_$clear(J=k(this._$startNode).nextSibling,X){this._$notifyConnectionChanged?.(!1,!0,X);while(J!==this._$endNode){let Z=k(J).nextSibling;k(J).remove(),J=Z}}setConnected(J){if(this._$parent===void 0)this.__isConnected=J,this._$notifyConnectionChanged?.(J);else throw Error("part.setConnected() may only be called on a RootPart returned from render().")}}class s{get tagName(){return this.element.tagName}get _$isConnected(){return this._$parent._$isConnected}constructor(J,X,Z,$,Y){if(this.type=FJ,this._$committedValue=F,this._$disconnectableChildren=void 0,this.element=J,this.name=X,this._$parent=$,this.options=Y,Z.length>2||Z[0]!==""||Z[1]!=="")this._$committedValue=Array(Z.length-1).fill(new String),this.strings=Z;else this._$committedValue=F;this._sanitizer=void 0}_$setValue(J,X=this,Z,$){let Y=this.strings,j=!1;if(Y===void 0){if(J=m(this,J,X,0),j=!i(J)||J!==this._$committedValue&&J!==E,j)this._$committedValue=J}else{let G=J;J=Y[0];let Q,z;for(Q=0;Q<Y.length-1;Q++){if(z=m(this,G[Z+Q],X,Q),z===E)z=this._$committedValue[Q];if(j||=!i(z)||z!==this._$committedValue[Q],z===F)J=F;else if(J!==F)J+=(z??"")+Y[Q+1];this._$committedValue[Q]=z}}if(j&&!$)this._commitValue(J)}_commitValue(J){if(J===F)k(this.element).removeAttribute(this.name);else{if(this._sanitizer===void 0)this._sanitizer=T(this.element,this.name,"attribute");J=this._sanitizer(J??""),M&&M({kind:"commit attribute",element:this.element,name:this.name,value:J,options:this.options}),k(this.element).setAttribute(this.name,J??"")}}}class vJ extends s{constructor(){super(...arguments);this.type=CX}_commitValue(J){if(this._sanitizer===void 0)this._sanitizer=T(this.element,this.name,"property");J=this._sanitizer(J),M&&M({kind:"commit property",element:this.element,name:this.name,value:J,options:this.options}),this.element[this.name]=J===F?void 0:J}}class gJ extends s{constructor(){super(...arguments);this.type=xX}_commitValue(J){M&&M({kind:"commit boolean attribute",element:this.element,name:this.name,value:!!(J&&J!==F),options:this.options}),k(this.element).toggleAttribute(this.name,!!J&&J!==F)}}class mJ extends s{constructor(J,X,Z,$,Y){super(J,X,Z,$,Y);if(this.type=RX,this.strings!==void 0)throw Error(`A \`<${J.localName}>\` has a \`@${X}=...\` listener with invalid content. Event listeners in templates must have exactly one expression and no surrounding text.`)}_$setValue(J,X=this){if(J=m(this,J,X,0)??F,J===E)return;let Z=this._$committedValue,$=J===F&&Z!==F||J.capture!==Z.capture||J.once!==Z.once||J.passive!==Z.passive,Y=J!==F&&(Z===F||$);if(M&&M({kind:"commit event listener",element:this.element,name:this.name,value:J,options:this.options,removeListener:$,addListener:Y,oldListener:Z}),$)this.element.removeEventListener(this.name,this,Z);if(Y)this.element.addEventListener(this.name,this,J);this._$committedValue=J}handleEvent(J){if(typeof this._$committedValue==="function")this._$committedValue.call(this.options?.host??this.element,J);else this._$committedValue.handleEvent(J)}}class dJ{constructor(J,X,Z){this.element=J,this.type=HJ,this._$disconnectableChildren=void 0,this._$parent=X,this.options=Z}get _$isConnected(){return this._$parent._$isConnected}_$setValue(J){M&&M({kind:"commit to element binding",element:this.element,value:J,options:this.options}),m(this,J)}}var TX=b.litHtmlPolyfillSupportDevMode;TX?.(l,o);(b.litHtmlVersions??=[]).push("3.3.1");if(b.litHtmlVersions.length>1)queueMicrotask(()=>{p("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});var S=(J,X,Z)=>{if(X==null)throw TypeError(`The container to render into may not be ${X}`);let $=_X++,Y=Z?.renderBefore??X,j=Y._$litPart$;if(M&&M({kind:"begin render",id:$,value:J,container:X,options:Z,part:j}),j===void 0){let G=Z?.renderBefore??null;Y._$litPart$=j=new o(X.insertBefore(c(),G),G,void 0,Z??{})}return j._$setValue(J),M&&M({kind:"end render",id:$,value:J,container:X,options:Z,part:j}),j};S.setSanitizer=IX,S.createSanitizer=MJ,S._testOnlyClearSanitizerFactoryDoNotCallOrElse=LX;var DJ={};QJ(DJ,{resolveListenerTarget:()=>_J,reactive:()=>PJ,parseAttributeValue:()=>y,isTemplateResult:()=>$J,deserializeCSS:()=>d,callAsync:()=>r,addTeardown:()=>g,addDecoratorEffect:()=>f,WATCH_HANDLERS:()=>P,SUBSCRIBE_HANDLERS:()=>N,STYLE_METADATA:()=>n,REACTIVE_FIELDS:()=>_,PROP_ATTRIBUTES:()=>L,LISTEN_HANDLERS:()=>A,DECORATOR_TEARDOWNS:()=>v,DECORATOR_EFFECTS:()=>h,ATTR_HANDLERS:()=>C});function r(J,X,...Z){try{let $=J.apply(X,Z);return $ instanceof Promise?$:Promise.resolve($)}catch($){return Promise.reject($)}}function $J(J){return J!==null&&typeof J==="object"&&"_$litType$"in J}function d(J,X="",Z=0){let $=Object.keys(J),Y="";for(let j of $){let G=J[j];if(typeof G==="object"&&G!==null){if(X&&!j.startsWith("@"))if(j.startsWith("&"))Y+=`${j.replace(/&/g,X)} {
|
|
17
|
+
`;else if(j===":host")Y+=`${X} {
|
|
18
|
+
`;else Y+=`${X} ${j} {
|
|
19
|
+
`;else Y+=`${j} {
|
|
20
|
+
`;let Q=Object.keys(G);for(let z of Q){Y+="\t".repeat(Z);let W=G[z];if(typeof W==="object"&&W!==null){let q={};q[z]=W,Y+=d(q,X,Z+1)}else Y+=` ${z}: ${W};
|
|
21
|
+
`}Y+=`}
|
|
22
|
+
`}else Y+="\t".repeat(Z),Y+=` ${j}: ${G};
|
|
23
|
+
`}return Y}var L=Symbol("pandora:propAttributes"),h=Symbol("pandora:decoratorEffects"),v=Symbol("pandora:decoratorTeardowns"),P=Symbol("pandora:watchHandlers"),_=Symbol("pandora:reactiveFields"),A=Symbol("pandora:listenHandlers"),n=Symbol("pandora:styleMetadata"),C=Symbol("pandora:attrHandlers"),N=Symbol("pandora:subscribeHandlers");function f(J,X){if(!Object.hasOwn(J,h)){let Z=J[h];J[h]=Z?[...Z]:[]}J[h].push(X)}function g(J,X){if(!J[v])J[v]=[];J[v].push(X)}var yJ=new Map;function hX(J){let X=yJ.get(J);if(!X)X=Symbol(`__pandora_reactive_${J}`),yJ.set(J,X);return X}function PJ(J,X,Z={}){let $=hX(X),Y=Z.equals??((j,G)=>j===G);if(Z.initialValue!==void 0&&J[$]===void 0)J[$]=Z.initialValue;Object.defineProperty(J,X,{get(){return J[$]},set(j){let G=J[$];if(Y(G,j))return;if(J[$]=j,Z.onChange)Z.onChange(j,G);if(typeof Symbol.metadata<"u"){let z=J.constructor[Symbol.metadata]?.[P];if(z){for(let W of z)if(W.property===X){let q=J[W.methodName];if(typeof q==="function")q.call(J,j,G)}}}if(typeof J.didChange==="function")J.didChange(X,G,j,"reactive");if(Z.render!==!1&&typeof J._queueRender==="function")J._queueRender()},enumerable:!0,configurable:!0})}function y(J){if(J===null)return;if(J===""||J==="true")return!0;if(J==="false")return!1;if(!isNaN(Number(J)))return J.includes(".")?parseFloat(J):parseInt(J,10);return J}function _J(J,X,Z){if(X==="window")return window;if(X==="document")return document;if(X&&X!=="self")return Z?Z(X):J.querySelector(X);return J}class H extends HTMLElement{_children;_connected;_isReady;_hasBeenMounted;_initRenderDone;_renderId;_renderQueued;_style;_batching;_batchedChanges;static _tag;static _template;static _observedAttributes=[];static _styleSheet=null;static _onMount;static _onUnmount;static _onError;static _applyMiddleware;static _hasMiddleware;static _subscribe;static _getGlobalState;static _applyCurrentImplementation;static _activateSubscription(J,X){if(!H._subscribe)return;let Z=J;if(Z[X.unsubKey])Z[X.unsubKey](),Z[X.unsubKey]=void 0;Z[X.unsubKey]=H._subscribe(X.stateKey,(Y)=>{let j=Z[X.valueKey];if(j===Y)return;if(Z[X.valueKey]=Y,J.didChange(X.propertyKey,j,Y,"consumer"),J.isReady)J._queueRender()});let $=H._getGlobalState?.(X.stateKey);if($!==void 0)Z[X.valueKey]=$}static get observedAttributes(){if(typeof Symbol.metadata<"u"){let X=this[Symbol.metadata]?.[L];if(X?.length)return[...new Set([...this._observedAttributes,...X])]}return this._observedAttributes}static set observedAttributes(J){this._observedAttributes=J}static get tag(){if(typeof this._tag>"u"){let J=this.name,X=J.match(/([A-Z])/g);if(X!==null)for(let Z of X)J=J.replace(Z,`-${Z}`.toLowerCase());this._tag=J.slice(1)}return this._tag}static set tag(J){this._tag=J}static get template(){return this._template}static set template(J){if(this._template=J,J!==void 0)document.querySelectorAll(this.tag).forEach((X)=>{if(X instanceof H&&X._isReady)X.forceRender()})}constructor(){super();this._children="",this._connected=!1,this._isReady=!1,this._hasBeenMounted=!1,this._initRenderDone=!1,this._renderId=0,this._renderQueued=!1,this._style={},this._batching=!1,this._batchedChanges=[]}get slotContent(){return this._children}get isConnected(){return this._connected}get isReady(){return this._isReady}get isFirstMount(){return!this._hasBeenMounted}static _registryRegister;static register(){if(H._registryRegister)H._registryRegister(this.tag,this);else window.customElements.define(this.tag,this)}get isBatching(){return this._batching}batch(J){this._batching=!0,this._batchedChanges=[];try{J()}finally{this._batching=!1;let X=this._batchedChanges;if(this._batchedChanges=[],X.length>0){let Z=!1;for(let{property:$,oldValue:Y,newValue:j,shouldRender:G,source:Q}of X){if(Y===j)continue;if(G)Z=!0;if(typeof Symbol.metadata<"u"){let W=this.constructor[Symbol.metadata]?.[P];if(W){for(let q of W)if(q.property===$){let B=this[q.methodName];if(typeof B==="function")B.call(this,j,Y)}}}this.didChange($,Y,j,Q)}if(Z&&this._connected)this._queueRender()}}}_queueRender(){if(this._renderQueued||!this._connected)return;this._renderQueued=!0,queueMicrotask(()=>{if(this._renderQueued=!1,this._connected)this._render().catch((J)=>{let X=this.constructor.tag;if(H._onError)H._onError(J,this,X,"render");else{let Z=this.id?`#${this.id}`:this.className?`.${this.className.split(/\s+/).join(".")}`:"";console.error(`[Pandora] Unhandled render error in <${X}${Z}>:`,J,this)}})})}forceRender(){return this._render()}render(){}_applyLitRender(J){if(!this.hasAttribute("data-lit-rendered"))this.innerHTML="",this.setAttribute("data-lit-rendered","");S(J,this,{host:this})}_applyStringRender(J){if(J===""){this.innerHTML="";return}let X=this.querySelector("slot");if(X!==null){let Z=document.createElement("template");Z.innerHTML=J,X.replaceWith(Z.content)}else if(this.innerHTML=J,this._children!==""&&J.indexOf(this._children)===-1)this.innerHTML+=this._children}async _render(){let J=++this._renderId,X=this.constructor,Z=this.render;if(X._template!==void 0)Z=()=>{if(typeof X._template==="function")return X._template.call(this,this);return X._template};let $=await r(Z,this);if(J!==this._renderId)return;if($===void 0||$===null){this._detachListeners(),this._attachListeners(),await r(this.didRender,this);return}let Y=$J($)||$===F?"lit":"string";if(H._hasMiddleware?.("render")&&H._applyMiddleware)$=H._applyMiddleware("render",this,$,Y);if($J($)||$===F)this._applyLitRender($);else this._applyStringRender($.trim());this._detachListeners(),this._attachListeners(),await r(this.didRender,this)}setStyle(J,X=!1){let Z=this.constructor;if(!Z._styleSheet)Z._styleSheet=new CSSStyleSheet;let $="";if(typeof J==="object"){if(!X)this._style={...this._style,...J};else this._style={...J};$=d(this._style,Z.tag)}else if(typeof J==="string")if(!X)$=Array.from(Z._styleSheet.cssRules||[]).map((j)=>j.cssText).join(`
|
|
23
24
|
`)+`
|
|
24
|
-
`+J;else
|
|
25
|
+
`+J;else $=J;if(Z._styleSheet.replaceSync($),!document.adoptedStyleSheets.includes(Z._styleSheet))document.adoptedStyleSheets=[...document.adoptedStyleSheets,Z._styleSheet];return this._style}on(J,X,Z){return this.addEventListener(J,X,Z),this}off(J,X,Z){return this.removeEventListener(J,X,Z),this}once(J,X,Z){let $=typeof Z==="boolean"?{capture:Z,once:!0}:{...Z,once:!0};return this.addEventListener(J,X,$),this}emit(J,X,Z){let $=new CustomEvent(J,{detail:X,bubbles:!0,cancelable:!0,composed:!0,...Z});return this.dispatchEvent($)}query(J){return this.querySelector(J)}queryAll(J){return this.querySelectorAll(J)}_readyCallbacks;ready(J){if(this._isReady)queueMicrotask(J);else this._readyCallbacks??=[],this._readyCallbacks.push(J)}async willMount(){}async didMount(){}async didRender(){}async didReconnect(){}async willUnmount(){}async didUnmount(){}didChange(J,X,Z,$){}async connectedCallback(){let J=this.constructor,X=J.tag;try{if(this._connected=!0,this.dataset.component=X,H._applyCurrentImplementation?.(this,X),typeof Symbol.metadata<"u"){let Y=this.constructor[Symbol.metadata]?.[N];if(Y)for(let j of Y)H._activateSubscription(this,j)}let Z=!this._hasBeenMounted;if(Z)this._children=this.innerHTML.trim();if(Z&&J._template===void 0){let $=document.querySelector(`template#${X}`);if($)J._template=$.innerHTML}if(Z&&typeof Symbol.metadata<"u"){let Y=J[Symbol.metadata]?.[n];if(Y)this.setStyle(Y,!0)}if(await this.willMount(),await this._render(),this._initRenderDone=!0,Z)await this.didMount();else await this.didReconnect();if(this._hasBeenMounted=!0,this._isReady=!0,this._readyCallbacks){for(let $ of this._readyCallbacks)$();this._readyCallbacks=void 0}H._onMount?.(this,X),this.emit("pandora:ready",{firstMount:Z,tag:X},{bubbles:!0,composed:!0})}catch(Z){if(H._onError)H._onError(Z,this,X,"connectedCallback");else throw Z}}async disconnectedCallback(){let J=this.constructor,X=J.tag;try{if(this.emit("pandora:unmount",{tag:X},{bubbles:!0,composed:!0}),typeof Symbol.metadata<"u"){let $=J[Symbol.metadata]?.[N];if($){let Y=this;for(let j of $)if(Y[j.unsubKey])Y[j.unsubKey](),Y[j.unsubKey]=void 0}}this._detachListeners(),await this.willUnmount(),await this.didUnmount(),this._connected=!1,this._isReady=!1,H._onUnmount?.(this,X)}catch(Z){if(H._onError)H._onError(Z,this,X,"disconnectedCallback");else throw Z}}attributeChangedCallback(J,X,Z){if(typeof Symbol.metadata>"u")return;let Y=this.constructor[Symbol.metadata],j=Y?.[C];if(!j)return;let G=this;for(let Q of j){if(Q.attrName!==J)continue;if(G[Q.settingKey])continue;let z=Z!==null?y(Z):void 0,W=G[Q.valueKey];if(Q.equals(W,z))continue;G[Q.valueKey]=z;let q=Y?.[P];if(q){for(let B of q)if(B.property===Q.propertyKey){let U=this[B.methodName];if(typeof U==="function")U.call(this,z,W)}}if(this.didChange(Q.propertyKey,W,z,"prop-attribute"),Q.shouldRender&&this._initRenderDone&&this._connected)this._queueRender()}}_activeListeners=[];_attachListeners(){if(typeof Symbol.metadata>"u")return;let X=this.constructor[Symbol.metadata]?.[A];if(!X)return;for(let Z of X){let $=this[Z.methodName];if(typeof $!=="function")continue;let Y=$.bind(this),j=Z.options,G=_J(this,j?.target,(W)=>this.query(W));if(!G)continue;let Q={};if(j?.capture)Q.capture=!0;if(j?.passive)Q.passive=!0;let z;if(j?.delegate){let W=j.delegate,q=j?.once;z=(B)=>{if(B.target?.closest(W)){if(Y(B),q)G.removeEventListener(Z.event,z,Q),this._activeListeners=this._activeListeners.filter((O)=>O.handler!==z)}}}else if(z=Y,j?.once)Q.once=!0;G.addEventListener(Z.event,z,Q),this._activeListeners.push({target:G,event:Z.event,handler:z,options:Q})}}_detachListeners(){for(let{target:J,event:X,handler:Z,options:$}of this._activeListeners)J.removeEventListener(X,Z,$);this._activeListeners=[]}}var D=H;class uJ extends D{_shadowDOM;static _styleSheet=null;constructor(){super();this._shadowDOM=this.attachShadow({mode:"open"})}setStyle(J,X=!1){let Z=this.constructor;if(!Z._styleSheet)Z._styleSheet=new CSSStyleSheet;let $="";if(typeof J==="object"){if(!X)this._style={...this._style,...J};else this._style={...J};$=d(this._style)}else if(typeof J==="string")if(!X)$=Array.from(Z._styleSheet.cssRules||[]).map((j)=>j.cssText).join(`
|
|
25
26
|
`)+`
|
|
26
|
-
`+J;else Y=J;return X._styleSheet.replaceSync(Y),this._shadowDOM.adoptedStyleSheets=[X._styleSheet],this._style}async _render(){let J=this.render;if(this.constructor._template!==void 0)J=()=>this.template();let W=await m(J,this),X=P(W)||W===M?"lit":"string";if(f._hasMiddleware?.("render")&&f._applyMiddleware)W=f._applyMiddleware("render",this,W,X);if(P(W)||W===M){D(W,this._shadowDOM,{host:this});return}let Y=W.trim(),Z=Array.from(this._shadowDOM.childNodes);for(let q of Z)q.remove();if(Y==="")return;let $=document.createElement("template");$.innerHTML=Y,this._shadowDOM.appendChild($.content)}get dom(){throw Error("ShadowComponent DOM can not be accessed. Use the `shadowRoot` property instead.")}set dom(J){throw Error("ShadowComponent DOM can not be overwritten.")}get shadowRoot(){return this._shadowDOM}set shadowRoot(J){throw Error("ShadowComponent shadowRoot can not be overwritten.")}query(J){return this._shadowDOM.querySelector(J)}queryAll(J){return this._shadowDOM.querySelectorAll(J)}}var AJ=RJ;class WJ{static _debug=!1;static components={};static implementations={};static state={};static subscribers={};static mountCallbacks=new Set;static unmountCallbacks=new Set;static errorCallbacks=new Set;static aliases={};static lazyLoaders={};static middleware={props:new Set,state:new Set,render:new Set};static _initialized=!1;static _init(){if(this._initialized)return;this._initialized=!0,f._onMount=(J,W)=>this._notifyMount(J,W),f._onUnmount=(J,W)=>this._notifyUnmount(J,W),f._onError=(J,W,X,Y)=>this._notifyError(J,W,X,Y),f._applyMiddleware=(J,W,X,Y)=>this._applyMiddleware(J,W,X,Y),f._hasMiddleware=(J)=>this._hasMiddleware(J)}static register(J,W){if(this._init(),typeof this.components[J]>"u")this.components[J]=W,this.implementations[J]=W,W._tag=J,window.customElements.define(J,W),this.components[J]._registered=!0,this.log(`Registered: <${J}>`);else throw Error("A component with this tag has already been registered. Use the evolve() function to modify the component.")}static getImplementation(J){return this.implementations[J]||this.components[J]}static evolve(J,W,X=!1){if(typeof this.components[J]>"u")throw Error("No component with this tag has been registered. Cannot Evolve.");if(this.implementations[J]=W,W._registered=!0,this.log(`Evolved: <${J}>`),X){let Y=W.prototype,Z=Object.getOwnPropertyNames(Y),$=Object.create(Y);try{W.call($)}catch{}document.querySelectorAll(J).forEach((q)=>{if(q instanceof f&&q.isReady){let G=q;for(let Q of Z)if(Q!=="constructor"&&typeof Y[Q]==="function"){let F=Y[Q];G[Q]=F.bind(q)}if($._state){let Q=G._state||{},F=$._state;for(let B of Object.keys(F))if(!(B in Q))Q[B]=F[B];G._state=Q}if($._props){let Q=G._props||{},F=$._props;for(let B of Object.keys(F))if(!(B in Q))Q[B]=F[B];G._props=Q}q.forceRender()}})}}static instances(J,W){if(typeof this.components[J]<"u")if(typeof W==="function")document.querySelectorAll(J).forEach(W);else return document.querySelectorAll(J);else throw Error("No component with the provided tag has been registered.")}static instantiate(J,W){if(!this.has(J))throw Error(`No component with tag "${J}" has been registered.`);if(!this.components[J]._registered)this.register(J,this.components[J]);let X=document.createElement(this.components[J].tag);return X.setProps(W),X}static has(J){return typeof this.components[J]<"u"}static get(J){return this.components[J]}static setState(J,W){let X=this.state[J];if(this.state[J]=W,this.subscribers[J])this.subscribers[J].forEach((Y)=>{Y(W,X)})}static getState(J){return this.state[J]}static hasState(J){return J in this.state}static deleteState(J){if(J in this.state){let W=this.state[J];if(delete this.state[J],this.subscribers[J])this.subscribers[J].forEach((X)=>{X(void 0,W)});return!0}return!1}static subscribe(J,W){if(!this.subscribers[J])this.subscribers[J]=new Set;return this.subscribers[J].add(W),()=>{this.unsubscribe(J,W)}}static unsubscribe(J,W){if(this.subscribers[J])this.subscribers[J].delete(W)}static getAllState(){return{...this.state}}static clearState(){let J=Object.keys(this.state);for(let W of J)this.deleteState(W)}static get debug(){return this._debug}static set debug(J){this._debug=J}static log(J,W){if(this._debug)if(W!==void 0)console.log(`[Pandora] ${J}`,W);else console.log(`[Pandora] ${J}`)}static list(){return Object.keys(this.components)}static stats(J){if(J){if(!this.has(J))throw Error(`No component with tag "${J}" has been registered.`);return{tag:J,instanceCount:document.querySelectorAll(J).length,isRegistered:this.components[J]?._registered??!1,isLazy:J in this.lazyLoaders}}return this.list().map((W)=>({tag:W,instanceCount:document.querySelectorAll(W).length,isRegistered:this.components[W]?._registered??!1,isLazy:W in this.lazyLoaders}))}static onMount(J){return this._init(),this.mountCallbacks.add(J),()=>this.mountCallbacks.delete(J)}static onUnmount(J){return this._init(),this.unmountCallbacks.add(J),()=>this.unmountCallbacks.delete(J)}static _notifyMount(J,W){this.log(`Mounted: <${W}>`),this.mountCallbacks.forEach((X)=>{try{X(J,W)}catch(Y){console.error("[Pandora] Error in onMount callback:",Y)}})}static _notifyUnmount(J,W){this.log(`Unmounted: <${W}>`),this.unmountCallbacks.forEach((X)=>{try{X(J,W)}catch(Y){console.error("[Pandora] Error in onUnmount callback:",Y)}})}static onError(J){return this._init(),this.errorCallbacks.add(J),()=>this.errorCallbacks.delete(J)}static _notifyError(J,W,X,Y){if(this.log(`Error in <${X}> during ${Y}:`,J),this.errorCallbacks.size===0)throw J;this.errorCallbacks.forEach((Z)=>{try{Z(J,W,X,Y)}catch($){console.error("[Pandora] Error in onError callback:",$)}})}static alias(J,W){if(!this.has(W))throw Error(`Cannot create alias: no component with tag "${W}" has been registered.`);if(this.has(J))throw Error(`Cannot create alias: a component with tag "${J}" already exists.`);this.aliases[J]=W;let X=this.components[W],Y=class extends X{static _tag=J};this.components[J]=Y,window.customElements.define(J,Y),this.log(`Created alias: <${J}> -> <${W}>`)}static getOriginalTag(J){return this.aliases[J]}static isAlias(J){return J in this.aliases}static lazy(J,W){if(this._init(),this.has(J))throw Error(`Cannot register lazy component: a component with tag "${J}" already exists.`);this.lazyLoaders[J]=W;let X=WJ;class Y extends f{static _tag=J;_lazyLoaded=!1;async connectedCallback(){await X._loadLazyComponent(J);let Z=X.getImplementation(J);if(Z&&Z!==Y){let $=Z.prototype,q=Object.getOwnPropertyNames($),G=this;for(let F of q)if(F!=="constructor"&&typeof $[F]==="function"){let B=$[F];G[F]=B.bind(this)}let Q=Object.create($);try{Z.call(Q)}catch{}if(Q._state)G._state={...Q._state};if(Q._props)G._props={...Q._props};this._lazyLoaded=!0}await super.connectedCallback()}}this.components[J]=Y,window.customElements.define(J,Y),this.log(`Registered lazy component: <${J}>`)}static async _loadLazyComponent(J){if(!(J in this.lazyLoaders))return;let W=this.lazyLoaders[J];this.log(`Loading lazy component: <${J}>`);try{let X=await W(),Y="default"in X?X.default:X;delete this.lazyLoaders[J],this.implementations[J]=Y,Y._registered=!0,this.log(`Loaded lazy component: <${J}>`)}catch(X){throw console.error(`[Pandora] Failed to load lazy component <${J}>:`,X),X}}static isLazy(J){return J in this.lazyLoaders}static async preload(J){if(this.isLazy(J))await this._loadLazyComponent(J)}static use(J,W){return this._init(),this.middleware[J].add(W),()=>this.middleware[J].delete(W)}static _applyMiddleware(J,W,X,Y){let Z=X;return this.middleware[J].forEach(($)=>{try{Z=$(W,Z,Y)}catch(q){console.error(`[Pandora] Error in ${J} middleware:`,q)}}),Z}static _hasMiddleware(J){return this.middleware[J].size>0}}var I=WJ;function EJ(J){return function(W){return I.register(J,W),W}}function NJ(J){return function(W,X){let{connectedCallback:Y,disconnectedCallback:Z}=W,$=Symbol(`__pandora_unsub_${X}`),q=Symbol(`__pandora_value_${X}`);W.connectedCallback=async function(){this[$]=I.subscribe(J,(Q)=>{if(this[q]=Q,this._isReady)this.forceRender()});let G=I.getState(J);if(G!==void 0)this[q]=G;if(Y)await Y.call(this)},W.disconnectedCallback=async function(){if(this[$])this[$](),this[$]=void 0;if(Z)await Z.call(this)},Object.defineProperty(W,X,{get:function(){return this[q]},set:function(G){if(this[q]===G)return;if(this[q]=G,I.setState(J,G),this._isReady)this.forceRender()},enumerable:!0,configurable:!0})}}function LJ(J){return function(W,X){let Y=J||X,Z=Symbol(`__pandora_prop_${X}`);if(!W.constructor._observedAttributes)W.constructor._observedAttributes=[];if(!W.constructor._observedAttributes.includes(Y))W.constructor._observedAttributes.push(Y);Object.defineProperty(W,X,{get:function(){if(this[Z]!==void 0)return this[Z];if(this.hasAttribute(Y)){let $=this.getAttribute(Y);return oJ($)}return},set:function($){if(this[Z]=$,typeof $==="string"||typeof $==="number"||typeof $==="boolean")if(typeof $==="boolean")if($)this.setAttribute(Y,"");else this.removeAttribute(Y);else this.setAttribute(Y,String($))},enumerable:!0,configurable:!0})}}function oJ(J){if(J===null)return;if(J===""||J==="true")return!0;if(J==="false")return!1;if(!isNaN(Number(J)))return J.includes(".")?parseFloat(J):parseInt(J,10);return J}var VJ={};if(typeof window==="object")window.Pandora=XJ;
|
|
27
|
+
`+J;else $=J;return Z._styleSheet.replaceSync($),this._shadowDOM.adoptedStyleSheets=[Z._styleSheet],this._style}_applyLitRender(J){S(J,this._shadowDOM,{host:this})}_applyStringRender(J){while(this._shadowDOM.firstChild)this._shadowDOM.firstChild.remove();if(J==="")return;let X=document.createElement("template");X.innerHTML=J,this._shadowDOM.appendChild(X.content)}get shadowRoot(){return this._shadowDOM}set shadowRoot(J){throw Error("ShadowComponent shadowRoot can not be overwritten.")}query(J){return this._shadowDOM.querySelector(J)}queryAll(J){return this._shadowDOM.querySelectorAll(J)}}var pJ=uJ;var cJ=Symbol("pandora:appliedImpl");class a{static _debug=!1;static components={};static implementations={};static state={};static subscribers={};static mountCallbacks=new Set;static unmountCallbacks=new Set;static errorCallbacks=new Set;static aliases={};static lazyLoaders={};static middleware={render:new Set};static _initialized=!1;static _init(){if(this._initialized)return;this._initialized=!0,D._onMount=(J,X)=>this._notifyMount(J,X),D._onUnmount=(J,X)=>this._notifyUnmount(J,X),D._onError=(J,X,Z,$)=>this._notifyError(J,X,Z,$),D._applyMiddleware=(J,X,Z,$)=>this._applyMiddleware(J,X,Z,$),D._hasMiddleware=(J)=>this._hasMiddleware(J),D._subscribe=(J,X)=>this.subscribe(J,X),D._getGlobalState=(J)=>this.getState(J),D._applyCurrentImplementation=(J,X)=>{let Z=this.implementations[X];if(!Z)return;let j=J[cJ]??J.constructor;if(Z===j)return;this._applyImplementation(J,Z,!1)}}static register(J,X){if(this._init(),typeof this.components[J]>"u")this.components[J]=X,this.implementations[J]=X,X.tag=J,window.customElements.define(J,X),this.components[J]._registered=!0,this.log(`Registered: <${J}>`);else throw Error("A component with this tag has already been registered. Use the evolve() function to modify the component.")}static define(J,X){this.register(J,X)}static getImplementation(J){return this.implementations[J]||this.components[J]}static _applyImplementation(J,X,Z=!1){let $=X.prototype,Y=Object.getOwnPropertyNames($),j=J;J[cJ]=X;for(let G of Y){if(G==="constructor")continue;let Q=Object.getOwnPropertyDescriptor($,G);if(!Q)continue;if(typeof Q.value==="function")j[G]=Q.value.bind(J);else if(Q.get||Q.set)Object.defineProperty(Object.getPrototypeOf(J),G,Q)}try{let G=customElements.get(X.tag)??X,Q=Reflect.construct(X,[],G);for(let z of Object.keys(Q))if(!(z in j)||j[z]===void 0)j[z]=Q[z]}catch(G){console.warn(`[Pandora] Could not construct temp instance of <${X.tag}> for default extraction:`,G)}if(typeof Symbol.metadata<"u"){let G=X[Symbol.metadata];if(G){let Q=J.constructor;Q[Symbol.metadata]=G}}if(typeof Symbol.metadata<"u"){let Q=X[Symbol.metadata]?.[h];if(Q?.length){let z=j[v];if(z)for(let W of z)W();j[v]=[];for(let W of Q)W(J)}}}static evolve(J,X,Z=!1){if(typeof this.components[J]>"u")throw Error("No component with this tag has been registered. Cannot Evolve.");this.implementations[J]=X,X._registered=!0;let $=[];for(let[Y,j]of Object.entries(this.aliases))if(j===J)$.push(Y),this.implementations[Y]=X;if(this.log(`Evolved: <${J}>`),Z){let Y=[J,...$];for(let j of Y)document.querySelectorAll(j).forEach((G)=>{if(G instanceof D&&G.isReady)this._applyImplementation(G,X,!0),G.forceRender()})}}static instances(J,X){if(typeof this.components[J]>"u")throw Error("No component with the provided tag has been registered.");if(typeof X==="function")document.querySelectorAll(J).forEach(X);else return document.querySelectorAll(J)}static instantiate(J,X){if(!this.has(J))throw Error(`No component with tag "${J}" has been registered.`);if(!this.components[J]._registered)this.register(J,this.components[J]);let Z=document.createElement(this.components[J].tag);for(let[$,Y]of Object.entries(X)){if(Y===void 0||Y===null)continue;if(Z[$]=Y,Object.getOwnPropertyDescriptor(Z,$)?.set!==void 0)continue;if(typeof Y==="boolean"){if(Y)Z.setAttribute($,"")}else if(typeof Y==="string"||typeof Y==="number")Z.setAttribute($,String(Y))}return Z}static has(J){return typeof this.components[J]<"u"}static get(J){return this.components[J]}static setState(J,X){let Z=this.state[J];if(this.state[J]=X,this.subscribers[J])this.subscribers[J].forEach(($)=>{$(X,Z)})}static getState(J){return this.state[J]}static hasState(J){return J in this.state}static deleteState(J){if(J in this.state){let X=this.state[J];if(delete this.state[J],this.subscribers[J])this.subscribers[J].forEach((Z)=>{Z(void 0,X)});return!0}return!1}static subscribe(J,X){if(!this.subscribers[J])this.subscribers[J]=new Set;return this.subscribers[J].add(X),()=>{this.unsubscribe(J,X)}}static unsubscribe(J,X){if(this.subscribers[J])this.subscribers[J].delete(X)}static getAllState(){return{...this.state}}static clearState(){let J=Object.keys(this.state);for(let X of J)this.deleteState(X)}static clearSubscriptions(){for(let J of Object.keys(this.subscribers))this.subscribers[J]=new Set}static clearMiddleware(){for(let J of Object.keys(this.middleware))this.middleware[J]=new Set}static get debug(){return this._debug}static set debug(J){this._debug=J}static log(J,X){if(this._debug)if(X!==void 0)console.log(`[Pandora] ${J}`,X);else console.log(`[Pandora] ${J}`)}static list(){return Object.keys(this.components)}static stats(J){if(J){if(!this.has(J))throw Error(`No component with tag "${J}" has been registered.`);return{tag:J,instanceCount:document.querySelectorAll(J).length,isRegistered:this.components[J]?._registered??!1,isLazy:J in this.lazyLoaders}}return this.list().map((X)=>({tag:X,instanceCount:document.querySelectorAll(X).length,isRegistered:this.components[X]?._registered??!1,isLazy:X in this.lazyLoaders}))}static onMount(J){return this._init(),this.mountCallbacks.add(J),()=>this.mountCallbacks.delete(J)}static onUnmount(J){return this._init(),this.unmountCallbacks.add(J),()=>this.unmountCallbacks.delete(J)}static _notifyMount(J,X){this.log(`Mounted: <${X}>`),this.mountCallbacks.forEach((Z)=>{try{Z(J,X)}catch($){console.error("[Pandora] Error in onMount callback:",$)}})}static _notifyUnmount(J,X){this.log(`Unmounted: <${X}>`),this.unmountCallbacks.forEach((Z)=>{try{Z(J,X)}catch($){console.error("[Pandora] Error in onUnmount callback:",$)}})}static onError(J){return this._init(),this.errorCallbacks.add(J),()=>this.errorCallbacks.delete(J)}static _notifyError(J,X,Z,$){if(this.log(`Error in <${Z}> during ${$}:`,J),this.errorCallbacks.size===0)throw J;this.errorCallbacks.forEach((Y)=>{try{Y(J,X,Z,$)}catch(j){console.error("[Pandora] Error in onError callback:",j)}})}static alias(J,X){if(!this.has(X))throw Error(`Cannot create alias: no component with tag "${X}" has been registered.`);if(this.has(J))throw Error(`Cannot create alias: a component with tag "${J}" already exists.`);this.aliases[J]=X;let Z=this.components[X],$=class extends Z{static _tag=J};this.components[J]=$,this.implementations[J]=$,window.customElements.define(J,$),$._registered=!0,this.log(`Created alias: <${J}> -> <${X}>`)}static getOriginalTag(J){return this.aliases[J]}static isAlias(J){return J in this.aliases}static lazy(J,X){if(this._init(),this.has(J))throw Error(`Cannot register lazy component: a component with tag "${J}" already exists.`);this.lazyLoaders[J]=X;let Z=a;class $ extends D{static _tag=J;_lazyLoaded=!1;async connectedCallback(){await Z._loadLazyComponent(J);let Y=Z.getImplementation(J);if(Y&&Y!==$)a._applyImplementation(this,Y,!1),this._lazyLoaded=!0;await super.connectedCallback()}}this.components[J]=$,window.customElements.define(J,$),this.log(`Registered lazy component: <${J}>`)}static async _loadLazyComponent(J){if(!(J in this.lazyLoaders))return;let X=this.lazyLoaders[J];this.log(`Loading lazy component: <${J}>`);try{let Z=await X(),$="default"in Z?Z.default:Z;delete this.lazyLoaders[J],this.implementations[J]=$,$._registered=!0,this.log(`Loaded lazy component: <${J}>`)}catch(Z){throw console.error(`[Pandora] Failed to load lazy component <${J}>:`,Z),Z}}static isLazy(J){return J in this.lazyLoaders}static async preload(J){if(this.isLazy(J))await this._loadLazyComponent(J)}static use(J,X){return this._init(),this.middleware[J].add(X),()=>this.middleware[J].delete(X)}static _applyMiddleware(J,X,Z,$){let Y=Z;return this.middleware[J].forEach((j)=>{try{Y=j(X,Y,$)}catch(G){console.error(`[Pandora] Error in ${J} middleware:`,G)}}),Y}static _hasMiddleware(J){return this.middleware[J].size>0}}D._registryRegister=(J,X)=>a.register(J,X);var I=a;Symbol.metadata??=Symbol("Symbol.metadata");function aJ(J,X){return function(Z,$){let Y=$.metadata;if(Y?.[L]){if(!Object.hasOwn(Z,"_observedAttributes"))Z._observedAttributes=[];for(let j of Y[L])if(!Z._observedAttributes.includes(j))Z._observedAttributes.push(j)}if(Y&&Z[Symbol.metadata]===void 0)Z[Symbol.metadata]=Y;if(Z.tag=J,!X?.defer)I.register(J,Z);return Z}}function tJ(J){return function(X,Z){let $=Z.metadata;return $[n]=J,X}}function eJ(J){return function(X,Z){let $=String(Z.name),Y=Z.metadata;if(!Object.hasOwn(Y,P)){let G=Y[P];Y[P]=G?[...G]:[]}Y[P].push({property:J,methodName:$});let j=!1;Z.addInitializer(function(){if(j)return;j=!0;let G=Y[_];if(!G||!G.has(J)){let Q=this?.constructor?.name??"<anonymous>";console.warn(`[Pandora] @Watch('${J}') on ${Q}.${$}(): '${J}' has no @State, @Attribute, or @Property decorator. Add one of those decorators to '${J}', or call reactive(this, '${J}') in the constructor — otherwise the watcher will never fire.`)}})}}function JX(J,X){if(typeof Symbol.metadata>"u")return[];let $=J.constructor[Symbol.metadata]?.[P];if(!$)return[];let Y=[];for(let j of $)if(j.property===X){let G=J[j.methodName];if(typeof G==="function")Y.push(G.bind(J))}return Y}var vX=new Set(["hidden","title","slot","style","id","className","tabIndex","dir","lang","draggable","contentEditable","accessKey","innerHTML","outerHTML","textContent","innerText"]);function IJ(J,X){if(vX.has(X))console.warn(`[Pandora] @${J}('${X}') conflicts with HTMLElement.${X}. This may cause unexpected behavior. Consider renaming to avoid the conflict.`)}function XX(J){return function(X,Z){let $=String(Z.name);IJ("State",$);let Y=J?.render!==!1,j=Symbol(`__pandora_state_${$}`),G,Q=!1,z=Z.metadata;if(!Object.hasOwn(z,_)){let W=z[_];z[_]=W?new Set(W):new Set}z[_].add($),f(z,(W)=>{if(YJ(W,$,j,Y),Q&&W[j]===void 0)W[j]=G}),Z.addInitializer(function(){let W=this,q=W[$];if(YJ(W,$,j,Y),q!==void 0){if(W[j]=q,!Q)G=q,Q=!0}})}}function YJ(J,X,Z,$,Y="state",j=(G,Q)=>G===Q){YX(J,X,Z),Object.defineProperty(J,X,{get(){return J[Z]},set(G){let Q=J[Z];if(j(Q,G))return;if(J[Z]=G,J._batching){let W=J._batchedChanges,q=W.find((B)=>B.property===X);if(q){if(q.newValue=G,$)q.shouldRender=!0}else W.push({property:X,oldValue:Q,newValue:G,shouldRender:$,source:Y});return}let z=JX(J,X);for(let W of z)W(G,Q);if(J.didChange(X,Q,G,Y),$&&J._initRenderDone&&J.isConnected)J._queueRender()},enumerable:!0,configurable:!0}),g(J,()=>{delete J[X]})}function ZX(J){return function(X,Z){let $=String(Z.name);IJ("Property",$);let Y=Symbol(`__pandora_property_${$}`),j=J?.equals??((q,B)=>q===B),G=J?.attribute??!1,Q,z=!1,W=Z.metadata;if(!Object.hasOwn(W,_)){let q=W[_];W[_]=q?new Set(q):new Set}if(W[_].add($),G!==!1){let q=Symbol(`__pandora_propSetting_${$}`);if(!Object.hasOwn(W,L)){let B=W[L];W[L]=B?[...B]:[]}if(!W[L].includes(G))W[L].push(G);jX(W,{attrName:G,propertyKey:$,valueKey:Y,settingKey:q,shouldRender:!1,equals:j}),f(W,(B)=>{if(GJ(B,G,$,Y,q,!1,j),z&&B[Y]===void 0)B[Y]=Q,jJ(B,G,Q)}),Z.addInitializer(function(){let B=this,U=B[$];if(GJ(B,G,$,Y,q,!1,j),U!==void 0){if(B[Y]=U,jJ(B,G,U),!z)Q=U,z=!0}})}else f(W,(q)=>{if(YJ(q,$,Y,!1,"property",j),z&&q[Y]===void 0)q[Y]=Q}),Z.addInitializer(function(){let q=this,B=q[$];if(YJ(q,$,Y,!1,"property",j),B!==void 0){if(q[Y]=B,!z)Q=B,z=!0}})}}function $X(J){return function(X,Z){let $=String(Z.name);IJ("Attribute",$);let Y,j=!0;if(typeof J==="object")Y=$,j=J.render!==!1;else Y=J??$;let G=Symbol(`__pandora_attr_${$}`),Q=Z.metadata;if(!Object.hasOwn(Q,_)){let q=Q[_];Q[_]=q?new Set(q):new Set}Q[_].add($);let z,W=!1;{let q=Symbol(`__pandora_propSetting_${$}`);if(!Object.hasOwn(Q,L)){let B=Q[L];Q[L]=B?[...B]:[]}if(!Q[L].includes(Y))Q[L].push(Y);jX(Q,{attrName:Y,propertyKey:$,valueKey:G,settingKey:q,shouldRender:j,equals:(B,U)=>B===U}),f(Q,(B)=>{if(GJ(B,Y,$,G,q,j),W&&B[G]===void 0)B[G]=z,jJ(B,Y,z)}),Z.addInitializer(function(){let B=this,U=B[$];if(GJ(B,Y,$,G,q,j),U!==void 0){if(B[G]=U,jJ(B,Y,U),!W)z=U,W=!0}})}}}function YX(J,X,Z){let $=Object.getOwnPropertyDescriptor(J,X);if($&&"value"in $&&$.value!==void 0&&J[Z]===void 0)J[Z]=$.value}function jX(J,X){if(!Object.hasOwn(J,C)){let Z=J[C];J[C]=Z?[...Z]:[]}J[C].push(X)}function jJ(J,X,Z){if(typeof Z==="boolean")if(Z)J.setAttribute(X,"");else J.removeAttribute(X);else if(typeof Z==="string"||typeof Z==="number")J.setAttribute(X,String(Z))}function GJ(J,X,Z,$,Y,j=!0,G=(Q,z)=>Q===z){if(YX(J,Z,$),Object.defineProperty(J,Z,{get(){if(J[$]!==void 0)return J[$];if(J.hasAttribute(X))return y(J.getAttribute(X));return},set(Q){let z=J[$];if(J[$]=Q,J[Y]=!0,Q===void 0||Q===null)J.removeAttribute(X);else if(typeof Q==="string"||typeof Q==="number"||typeof Q==="boolean")if(typeof Q==="boolean")if(Q)J.setAttribute(X,"");else J.removeAttribute(X);else J.setAttribute(X,String(Q));if(J[Y]=!1,!G(z,Q))if(J._batching){let W=J._batchedChanges,q=W.find((B)=>B.property===Z);if(q){if(q.newValue=Q,j)q.shouldRender=!0}else W.push({property:Z,oldValue:z,newValue:Q,shouldRender:j,source:"prop"})}else{let W=JX(J,Z);for(let q of W)q(Q,z);if(J.didChange(Z,z,Q,"prop"),j&&J._initRenderDone&&J.isConnected)J._queueRender()}},enumerable:!0,configurable:!0}),J.isConnected&&J.hasAttribute(X))J[$]=y(J.getAttribute(X));g(J,()=>{delete J[Z]})}function GX(J){return function(X,Z){let $=String(Z.name),Y=Symbol(`__pandora_unsub_${$}`),j=Symbol(`__pandora_value_${$}`),G=Z.metadata;if(!Object.hasOwn(G,_)){let Q=G[_];G[_]=Q?new Set(Q):new Set}if(G[_].add($),!Object.hasOwn(G,N)){let Q=G[N];G[N]=Q?[...Q]:[]}G[N].push({stateKey:J,propertyKey:$,unsubKey:Y,valueKey:j}),f(G,(Q)=>{iJ(Q,J,$,Y,j)}),Z.addInitializer(function(){iJ(this,J,$,Y,j)})}}function iJ(J,X,Z,$,Y){if(Object.defineProperty(J,Z,{get(){return J[Y]},set(j){let G=J[Y];if(G===j)return;if(J[Y]=j,I.setState(X,j),J.didChange(Z,G,j,"consumer"),J.isReady)J._queueRender()},enumerable:!0,configurable:!0}),J.isConnected)D._activateSubscription?.(J,{stateKey:X,propertyKey:Z,unsubKey:$,valueKey:Y});g(J,()=>{if(J[$])J[$](),J[$]=void 0;delete J[Z]})}function QX(J){return function(X,Z){let $=String(Z.name),Y=Z.metadata;f(Y,(j)=>{lJ(j,$,J)}),Z.addInitializer(function(){lJ(this,$,J)})}}function zX(J){return function(X,Z){let $=String(Z.name),Y=Z.metadata;f(Y,(j)=>{oJ(j,$,J)}),Z.addInitializer(function(){oJ(this,$,J)})}}function lJ(J,X,Z){Object.defineProperty(J,X,{get(){return J.query(Z)},enumerable:!0,configurable:!0})}function oJ(J,X,Z){Object.defineProperty(J,X,{get(){return J.queryAll(Z)},enumerable:!0,configurable:!0})}function qX(J){return function(X,Z){let $=String(Z.name),Y=J?`slot[name="${J}"]`:"slot:not([name])",j=Z.metadata;f(j,(G)=>{sJ(G,$,Y)}),Z.addInitializer(function(){sJ(this,$,Y)})}}function sJ(J,X,Z){Object.defineProperty(J,X,{get(){return(J._shadowDOM||J.shadowRoot)?.querySelector(Z)??null},enumerable:!0,configurable:!0})}function WX(J,X){return function(Z,$){let Y=String($.name),j=$.metadata;if(!Object.hasOwn(j,A)){let G=j[A];j[A]=G?[...G]:[]}j[A].push({event:J,methodName:Y,options:X})}}function BX(...J){return function(X,Z){let $=String(Z.name),Y=Symbol(`__pandora_computed_cache_${$}`),j=Symbol(`__pandora_computed_valid_${$}`),G=Z.metadata;for(let z of J){if(!Object.hasOwn(G,P)){let W=G[P];G[P]=W?[...W]:[]}G[P].push({property:z,methodName:`__invalidate_${$}`})}let Q=X;return f(G,(z)=>{rJ(z,$,Y,j,Q)}),Z.addInitializer(function(){rJ(this,$,Y,j,Q)}),X}}function rJ(J,X,Z,$,Y){J[`__invalidate_${X}`]=()=>{J[$]=!1},Object.defineProperty(J,X,{get(){if(!J[$])J[Z]=Y.call(J),J[$]=!0;return J[Z]},enumerable:!0,configurable:!0})}function MX(J){return function(X,Z){let $=Z.metadata,Y=[],j=[];for(let[Q,z]of Object.entries(J))if(typeof z==="string"){if(Y.push({className:Q,propertyName:z}),!Object.hasOwn($,P)){let q=$[P];$[P]=q?[...q]:[]}let W=`__classlist_${Q}_${z}`;$[P].push({property:z,methodName:W}),X.prototype[W]=function(){this.classList.toggle(Q,!!this[z])}}else j.push({className:Q,conditionFn:z});if(j.length>0){let Q=X.prototype.didChange;X.prototype.didChange=function(z,W,q,B){Q?.call(this,z,W,q,B);for(let{className:U,conditionFn:O}of j)this.classList.toggle(U,O(this))}}let G=X.prototype.connectedCallback;return X.prototype.connectedCallback=async function(){await G?.call(this);for(let{className:Q,propertyName:z}of Y)this.classList.toggle(Q,!!this[z]);for(let{className:Q,conditionFn:z}of j)this.classList.toggle(Q,z(this))},X}}function UX(J){return function(X,Z){let $=String(Z.name),Y=Z.metadata;f(Y,(j)=>{nJ(j,$,J)}),Z.addInitializer(function(){nJ(this,$,J)})}}function nJ(J,X,Z){Object.defineProperty(J,X,{value:($)=>{return J.emit(Z,$)},writable:!1,enumerable:!0,configurable:!0})}function FX(J,X){if(X!==void 0&&!I.hasState(J))I.setState(J,X);return{key:J,get(){return I.getState(J)},set(Z){I.setState(J,Z)},subscribe(Z){return I.subscribe(J,Z)},has(){return I.hasState(J)},delete(){I.deleteState(J)}}}var LJ={};QJ(LJ,{whenReady:()=>HX,resetRegistry:()=>mX,mount:()=>dX,flush:()=>gX});async function gX(){await new Promise((J)=>queueMicrotask(J)),await new Promise((J)=>queueMicrotask(J))}function HX(J,X=5000){let Z=J;if(Z.isReady)return Promise.resolve();return new Promise(($,Y)=>{let j=setTimeout(()=>{Y(Error(`Component <${J.tagName.toLowerCase()}> did not become ready within ${X}ms`))},X),G=()=>{if(Z.isReady)clearTimeout(j),$();else requestAnimationFrame(G)};requestAnimationFrame(G)})}function mX(){I.clearState(),I.clearSubscriptions(),I.clearMiddleware()}async function dX(J,X,Z){let $=X??document.body,Y=document.createElement("div");Y.innerHTML=`<${J}>${Z??""}</${J}>`;let j=Y.firstElementChild;return $.appendChild(j),await HX(j),j}var OX={};if(typeof window==="object")window.Pandora=fJ;
|
|
27
28
|
|
|
28
|
-
//# debugId=
|
|
29
|
+
//# debugId=882BA5A55C507CDC64756E2164756E21
|
|
29
30
|
//# sourceMappingURL=pandora.browser.js.map
|