@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.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:X,values:
|
|
1
|
+
var aJ=Object.defineProperty;var PJ=(J,X)=>{for(var Z in X)aJ(J,Z,{get:X[Z],enumerable:!0,configurable:!0,set:($)=>X[Z]=()=>$})};var k=globalThis,M=(J)=>{if(!k.emitLitDebugLogEvents)return;k.dispatchEvent(new CustomEvent("lit-debug",{detail:J}))},tJ=0,p;k.litIssuedWarnings??=new Set,p=(J,X)=>{if(X+=J?` See https://lit.dev/msg/${J} for more information.`:"",!k.litIssuedWarnings.has(X)&&!k.litIssuedWarnings.has(J))console.warn(X),k.litIssuedWarnings.add(X)},queueMicrotask(()=>{p("dev-mode","Lit is in dev mode. Not recommended for production!")});var S=k.ShadyDOM?.inUse&&k.ShadyDOM?.noPatch===!0?k.ShadyDOM.wrap:(J)=>J,t=k.trustedTypes,DJ=t?t.createPolicy("lit-html",{createHTML:(J)=>J}):void 0,eJ=(J)=>J,ZJ=(J,X,Z)=>eJ,JX=(J)=>{if(E!==ZJ)throw Error("Attempted to overwrite existing lit-html security policy. setSanitizeDOMValueFactory should be called at most once.");E=J},XX=()=>{E=ZJ},BJ=(J,X,Z)=>{return E(J,X,Z)},bJ="$lit$",f=`lit$${Math.random().toFixed(9).slice(2)}$`,NJ="?"+f,ZX=`<${NJ}>`,K=document,c=()=>K.createComment(""),i=(J)=>J===null||typeof J!="object"&&typeof J!="function",MJ=Array.isArray,$X=(J)=>MJ(J)||typeof J?.[Symbol.iterator]==="function",QJ=`[
|
|
2
|
+
\f\r]`,YX=`[^
|
|
3
|
+
\f\r"'\`<>=]`,jX=`[^\\s"'>=/]`,u=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,IJ=1,zJ=2,GX=3,LJ=/-->/g,kJ=/>/g,N=new RegExp(`>|${QJ}(?:(${jX}+)(${QJ}*=${QJ}*(?:${YX}|("|')|))|$)`,"g"),QX=0,VJ=1,zX=2,SJ=3,qJ=/'/g,WJ=/"/g,AJ=/^(?:script|style|textarea|title)$/i,qX=1,e=2,JJ=3,UJ=1,XJ=2,WX=3,BX=4,MX=5,FJ=6,UX=7,HJ=(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}},FX=HJ(qX),HX=HJ(e),yX=HJ(JJ),v=Symbol.for("lit-noChange"),F=Symbol.for("lit-nothing"),fJ=new WeakMap,R=K.createTreeWalker(K,129),E=ZJ;function wJ(J,X){if(!MJ(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(Y)}return XJ!==void 0?XJ.createHTML(X):X}var mJ=(J,X)=>{let Y=J.length-1,Z=[],$=X===c?"<svg>":X===g?"<math>":"",q,W=h;for(let Q=0;Q<Y;Q++){let F=J[Q],B=-1,_,D=0,z;while(D<F.length){if(W.lastIndex=D,z=W.exec(F),z===null)break;if(D=W.lastIndex,W===h){if(z[YJ]==="!--")W=ZJ;else if(z[YJ]!==void 0)W=$J;else if(z[s]!==void 0){if(HJ.test(z[s]))q=new RegExp(`</${z[s]}`,"g");W=K}else if(z[PJ]!==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(W===K)if(z[TJ]===">")W=q??h,B=-1;else if(z[qJ]===void 0)B=-2;else B=W.lastIndex-z[CJ].length,_=z[qJ],W=z[WJ]===void 0?K:z[WJ]==='"'?r:o;else if(W===r||W===o)W=K;else if(W===ZJ||W===$J)W=h;else W=K,q=void 0}console.assert(B===-1||W===K||W===o||W===r,"unexpected parse state B");let A=W===K&&J[Q+1].startsWith("/>")?" ":"";$+=W===h?F+NJ:B>=0?(Z.push(_),F.slice(0,B)+QJ+F.slice(B))+S+A:F+S+(B===-2?Q:A)}let G=$+(J[Y]||"<?>")+(X===c?"</svg>":X===g?"</math>":"");return[FJ(J,G),Z]};class k{constructor({strings:J,["_$litType$"]:X},Y){this.parts=[];let Z,$=0,q=0,W=J.length-1,G=this.parts,[Q,F]=mJ(J,X);if(this.el=k.createElement(Q,Y),E.currentNode=this.el.content,X===c||X===g){let B=this.el.content.firstChild;B.replaceWith(...B.childNodes)}while((Z=E.nextNode())!==null&&G.length<W){if(Z.nodeType===1){{let B=Z.localName;if(/^(?:textarea|template)$/i.test(B)&&Z.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 x("",_)}}if(Z.hasAttributes()){for(let B of Z.getAttributeNames())if(B.endsWith(QJ)){let _=F[q++],z=Z.getAttribute(B).split(S),A=/([.?@])?(.*)/.exec(_);G.push({type:a,index:$,name:A[2],strings:z,ctor:A[1]==="."?UJ:A[1]==="?"?zJ:A[1]==="@"?_J:d}),Z.removeAttribute(B)}else if(B.startsWith(S))G.push({type:t,index:$}),Z.removeAttribute(B)}if(HJ.test(Z.tagName)){let B=Z.textContent.split(S),_=B.length-1;if(_>0){Z.textContent=v?v.emptyScript:"";for(let D=0;D<_;D++)Z.append(B[D],w()),E.nextNode(),G.push({type:p,index:++$});Z.append(B[_],w())}}}else if(Z.nodeType===8)if(Z.data===BJ)G.push({type:p,index:$});else{let _=-1;while((_=Z.data.indexOf(S,_+1))!==-1)G.push({type:kJ,index:$}),_+=S.length-1}$++}if(F.length!==q)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,X){let Y=N.createElement("template");return Y.innerHTML=J,Y}}function P(J,X,Y=J,Z){if(X===I)return X;let $=Z!==void 0?Y.__directives?.[Z]:Y.__directive,q=b(X)?void 0:X._$litDirective$;if($?.constructor!==q){if($?._$notifyDirectiveConnectionChanged?.(!1),q===void 0)$=void 0;else $=new q(J),$._$initialize(J,Y,Z);if(Z!==void 0)(Y.__directives??=[])[Z]=$;else Y.__directive=$}if($!==void 0)X=P(J,$._$resolve(J,X.values),$,Z);return X}class MJ{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:Y}=this._$template,Z=(J?.creationScope??N).importNode(X,!0);E.currentNode=Z;let $=E.nextNode(),q=0,W=0,G=Y[0];while(G!==void 0){if(q===G.index){let Q;if(G.type===p)Q=new y($,$.nextSibling,this,J);else if(G.type===a)Q=new G.ctor($,G.name,G.strings,this,J);else if(G.type===t)Q=new jJ($,this,J);this._$parts.push(Q),G=Y[++W]}if(q!==G?.index)$=E.nextNode(),q++}return E.currentNode=N,Z}_update(J){let X=0;for(let Y of this._$parts){if(Y!==void 0)if(H&&H({kind:"set part",part:Y,value:J[X],valueIndex:X,values:J,templateInstance:this}),Y.strings!==void 0)Y._$setValue(J,Y,X),X+=Y.strings.length-2;else Y._$setValue(J[X]);X++}}}class y{get _$isConnected(){return this._$parent?._$isConnected??this.__isConnected}constructor(J,X,Y,Z){this.type=p,this._$committedValue=M,this._$disconnectableChildren=void 0,this._$startNode=J,this._$endNode=X,this._$parent=Y,this.options=Z,this.__isConnected=Z?.isConnected??!0,this._textSanitizer=void 0}get parentNode(){let J=O(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=P(this,J,X),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!==I)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(LJ(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(),L!==u){let X=this._$startNode.parentNode?.nodeName;if(X==="STYLE"||X==="SCRIPT"){let Y="Forbidden";if(X==="STYLE")Y="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 Y="Lit does not support binding inside script nodes. This is a security risk, as it could allow arbitrary code execution.";throw Error(Y)}}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 X=O(this._$startNode).nextSibling;if(this._textSanitizer===void 0)this._textSanitizer=l(X,"data","property");J=this._textSanitizer(J),H&&H({kind:"commit text",node:X,value:J,options:this.options}),X.data=J}else{let X=N.createTextNode("");if(this._commitNode(X),this._textSanitizer===void 0)this._textSanitizer=l(X,"data","property");J=this._textSanitizer(J),H&&H({kind:"commit text",node:X,value:J,options:this.options}),X.data=J}this._$committedValue=J}_commitTemplateResult(J){let{values:X,["_$litType$"]:Y}=J,Z=typeof Y==="number"?this._$getTemplate(J):(Y.el===void 0&&(Y.el=k.createElement(FJ(Y.h,Y.h[0]),this.options)),Y);if(this._$committedValue?._$template===Z)H&&H({kind:"template updating",template:Z,instance:this._$committedValue,parts:this._$committedValue._$parts,options:this.options,values:X}),this._$committedValue._update(X);else{let $=new MJ(Z,this),q=$._clone(this.options);H&&H({kind:"template instantiated",template:Z,instance:$,parts:$._$parts,options:this.options,fragment:q,values:X}),$._update(X),H&&H({kind:"template instantiated and updated",template:Z,instance:$,parts:$._$parts,options:this.options,fragment:q,values:X}),this._commitNode(q),this._$committedValue=$}}_$getTemplate(J){let X=GJ.get(J.strings);if(X===void 0)GJ.set(J.strings,X=new k(J));return X}_commitIterable(J){if(!n(this._$committedValue))this._$committedValue=[],this._$clear();let X=this._$committedValue,Y=0,Z;for(let $ of J){if(Y===X.length)X.push(Z=new y(this._insert(w()),this._insert(w()),this,this.options));else Z=X[Y];Z._$setValue($),Y++}if(Y<X.length)this._$clear(Z&&O(Z._$endNode).nextSibling,Y),X.length=Y}_$clear(J=O(this._$startNode).nextSibling,X){this._$notifyConnectionChanged?.(!1,!0,X);while(J!==this._$endNode){let Y=O(J).nextSibling;O(J).remove(),J=Y}}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,X,Y,Z,$){if(this.type=a,this._$committedValue=M,this._$disconnectableChildren=void 0,this.element=J,this.name=X,this._$parent=Z,this.options=$,Y.length>2||Y[0]!==""||Y[1]!=="")this._$committedValue=Array(Y.length-1).fill(new String),this.strings=Y;else this._$committedValue=M;this._sanitizer=void 0}_$setValue(J,X=this,Y,Z){let $=this.strings,q=!1;if($===void 0){if(J=P(this,J,X,0),q=!b(J)||J!==this._$committedValue&&J!==I,q)this._$committedValue=J}else{let W=J;J=$[0];let G,Q;for(G=0;G<$.length-1;G++){if(Q=P(this,W[Y+G],X,G),Q===I)Q=this._$committedValue[G];if(q||=!b(Q)||Q!==this._$committedValue[G],Q===M)J=M;else if(J!==M)J+=(Q??"")+$[G+1];this._$committedValue[G]=Q}}if(q&&!Z)this._commitValue(J)}_commitValue(J){if(J===M)O(this.element).removeAttribute(this.name);else{if(this._sanitizer===void 0)this._sanitizer=L(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 UJ extends d{constructor(){super(...arguments);this.type=xJ}_commitValue(J){if(this._sanitizer===void 0)this._sanitizer=L(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 zJ extends d{constructor(){super(...arguments);this.type=wJ}_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 _J extends d{constructor(J,X,Y,Z,$){super(J,X,Y,Z,$);if(this.type=bJ,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=P(this,J,X,0)??M,J===I)return;let Y=this._$committedValue,Z=J===M&&Y!==M||J.capture!==Y.capture||J.once!==Y.once||J.passive!==Y.passive,$=J!==M&&(Y===M||Z);if(H&&H({kind:"commit event listener",element:this.element,name:this.name,value:J,options:this.options,removeListener:Z,addListener:$,oldListener:Y}),Z)this.element.removeEventListener(this.name,this,Y);if($)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 jJ{constructor(J,X,Y){this.element=J,this.type=t,this._$disconnectableChildren=void 0,this._$parent=X,this.options=Y}get _$isConnected(){return this._$parent._$isConnected}_$setValue(J){H&&H({kind:"commit to element binding",element:this.element,value:J,options:this.options}),P(this,J)}}var vJ=f.litHtmlPolyfillSupportDevMode;vJ?.(k,y);(f.litHtmlVersions??=[]).push("3.3.1");if(f.litHtmlVersions.length>1)queueMicrotask(()=>{x("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});var R=(J,X,Y)=>{if(X==null)throw TypeError(`The container to render into may not be ${X}`);let Z=KJ++,$=Y?.renderBefore??X,q=$._$litPart$;if(H&&H({kind:"begin render",id:Z,value:J,container:X,options:Y,part:q}),q===void 0){let W=Y?.renderBefore??null;$._$litPart$=q=new y(X.insertBefore(w(),W),W,void 0,Y??{})}return q._$setValue(J),H&&H({kind:"end render",id:Z,value:J,container:X,options:Y,part:q}),q};R.setSanitizer=AJ,R.createSanitizer=l,R._testOnlyClearSanitizerFactoryDoNotCallOrElse=EJ;var fJ={};DJ(fJ,{isTemplateResult:()=>V,deserializeCSS:()=>T,callAsync:()=>m});function m(J,X,...Y){try{let Z=J.apply(X,Y);return Z instanceof Promise?Z:Promise.resolve(Z)}catch(Z){return Promise.reject(Z)}}function V(J){return J!==null&&typeof J==="object"&&"_$litType$"in J}function T(J,X="",Y=0){let Z=Object.keys(J),$="";for(let q of Z){let W=J[q];if(typeof W==="object"&&W!==null){if(X&&!q.startsWith("@"))if(q.startsWith("&"))$+=`${q.replace(/&/g,X)} {
|
|
17
|
-
`;else
|
|
18
|
-
`;else
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
`}
|
|
22
|
-
`}
|
|
16
|
+
`),Error(Z)}return DJ!==void 0?DJ.createHTML(X):X}var OX=(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[IJ]==="!--")G=LJ;else if(O[IJ]!==void 0)G=kJ;else if(O[zJ]!==void 0){if(AJ.test(O[zJ]))j=new RegExp(`</${O[zJ]}`,"g");G=N}else if(O[GX]!==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===N)if(O[QX]===">")G=j??u,q=-1;else if(O[VJ]===void 0)q=-2;else q=G.lastIndex-O[zX].length,B=O[VJ],G=O[SJ]===void 0?N:O[SJ]==='"'?WJ:qJ;else if(G===WJ||G===qJ)G=N;else if(G===LJ||G===kJ)G=u;else G=N,j=void 0}console.assert(q===-1||G===N||G===qJ||G===WJ,"unexpected parse state B");let x=G===N&&J[z+1].startsWith("/>")?" ":"";Y+=G===u?W+ZX:q>=0?($.push(B),W.slice(0,q)+bJ+W.slice(q))+f+x:W+f+(q===-2?z:x)}let Q=Y+(J[Z]||"<?>")+(X===e?"</svg>":X===JJ?"</math>":"");return[wJ(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]=OX(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(f)){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(bJ)){let B=W[j++],O=$.getAttribute(q).split(f),x=/([.?@])?(.*)/.exec(B);Q.push({type:UJ,index:Y,name:x[2],strings:O,ctor:x[1]==="."?xJ:x[1]==="?"?RJ:x[1]==="@"?KJ:s}),$.removeAttribute(q)}else if(q.startsWith(f))Q.push({type:FJ,index:Y}),$.removeAttribute(q)}if(AJ.test($.tagName)){let q=$.textContent.split(f),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===NJ)Q.push({type:XJ,index:Y});else{let B=-1;while((B=$.data.indexOf(f,B+1))!==-1)Q.push({type:UX,index:Y}),B+=f.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 g(J,X,Z=J,$){if(X===v)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=g(J,Y._$resolve(J,X.values),Y,$);return X}class CJ{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===UJ)z=new Q.ctor(Y,Q.name,Q.strings,this,J);else if(Q.type===FJ)z=new EJ(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=S(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=g(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!==v)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($X(J))this._commitIterable(J);else this._commitText(J)}_insert(J){return S(S(this._$startNode).parentNode).insertBefore(J,this._$endNode)}_commitNode(J){if(this._$committedValue!==J){if(this._$clear(),E!==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=S(this._$startNode).nextSibling;if(this._textSanitizer===void 0)this._textSanitizer=BJ(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=BJ(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(wJ(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 CJ($,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=fJ.get(J.strings);if(X===void 0)fJ.set(J.strings,X=new l(J));return X}_commitIterable(J){if(!MJ(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($&&S($._$endNode).nextSibling,Z),X.length=Z}_$clear(J=S(this._$startNode).nextSibling,X){this._$notifyConnectionChanged?.(!1,!0,X);while(J!==this._$endNode){let Z=S(J).nextSibling;S(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=UJ,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=g(this,J,X,0),j=!i(J)||J!==this._$committedValue&&J!==v,j)this._$committedValue=J}else{let G=J;J=Y[0];let Q,z;for(Q=0;Q<Y.length-1;Q++){if(z=g(this,G[Z+Q],X,Q),z===v)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)S(this.element).removeAttribute(this.name);else{if(this._sanitizer===void 0)this._sanitizer=E(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}),S(this.element).setAttribute(this.name,J??"")}}}class xJ extends s{constructor(){super(...arguments);this.type=WX}_commitValue(J){if(this._sanitizer===void 0)this._sanitizer=E(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 RJ extends s{constructor(){super(...arguments);this.type=BX}_commitValue(J){M&&M({kind:"commit boolean attribute",element:this.element,name:this.name,value:!!(J&&J!==F),options:this.options}),S(this.element).toggleAttribute(this.name,!!J&&J!==F)}}class KJ extends s{constructor(J,X,Z,$,Y){super(J,X,Z,$,Y);if(this.type=MX,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=g(this,J,X,0)??F,J===v)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 EJ{constructor(J,X,Z){this.element=J,this.type=FJ,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}),g(this,J)}}var _X=k.litHtmlPolyfillSupportDevMode;_X?.(l,o);(k.litHtmlVersions??=[]).push("3.3.1");if(k.litHtmlVersions.length>1)queueMicrotask(()=>{p("multiple-versions","Multiple versions of Lit loaded. Loading multiple versions is not recommended.")});var A=(J,X,Z)=>{if(X==null)throw TypeError(`The container to render into may not be ${X}`);let $=tJ++,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};A.setSanitizer=JX,A.createSanitizer=BJ,A._testOnlyClearSanitizerFactoryDoNotCallOrElse=XX;var vJ={};PJ(vJ,{resolveListenerTarget:()=>OJ,reactive:()=>hJ,parseAttributeValue:()=>y,isTemplateResult:()=>$J,deserializeCSS:()=>m,callAsync:()=>r,addTeardown:()=>d,addDecoratorEffect:()=>V,WATCH_HANDLERS:()=>_,SUBSCRIBE_HANDLERS:()=>b,STYLE_METADATA:()=>n,REACTIVE_FIELDS:()=>P,PROP_ATTRIBUTES:()=>I,LISTEN_HANDLERS:()=>w,DECORATOR_TEARDOWNS:()=>h,DECORATOR_EFFECTS:()=>T,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 m(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+=m(q,X,Z+1)}else Y+=` ${z}: ${W};
|
|
21
|
+
`}Y+=`}
|
|
22
|
+
`}else Y+="\t".repeat(Z),Y+=` ${j}: ${G};
|
|
23
|
+
`}return Y}var I=Symbol("pandora:propAttributes"),T=Symbol("pandora:decoratorEffects"),h=Symbol("pandora:decoratorTeardowns"),_=Symbol("pandora:watchHandlers"),P=Symbol("pandora:reactiveFields"),w=Symbol("pandora:listenHandlers"),n=Symbol("pandora:styleMetadata"),C=Symbol("pandora:attrHandlers"),b=Symbol("pandora:subscribeHandlers");function V(J,X){if(!Object.hasOwn(J,T)){let Z=J[T];J[T]=Z?[...Z]:[]}J[T].push(X)}function d(J,X){if(!J[h])J[h]=[];J[h].push(X)}var TJ=new Map;function PX(J){let X=TJ.get(J);if(!X)X=Symbol(`__pandora_reactive_${J}`),TJ.set(J,X);return X}function hJ(J,X,Z={}){let $=PX(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]?.[_];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 OJ(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]?.[I];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]?.[_];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","");A(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};$=m(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]?.[b];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]?.[b];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?.[_];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]?.[w];if(!X)return;for(let Z of X){let $=this[Z.methodName];if(typeof $!=="function")continue;let Y=$.bind(this),j=Z.options,G=OJ(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 gJ 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};$=m(this._style)}else if(typeof J==="string")if(!X)$=Array.from(Z._styleSheet.cssRules||[]).map((j)=>j.cssText).join(`
|
|
25
26
|
`)+`
|
|
26
|
-
`+J;else Z=J;return Y._styleSheet.replaceSync(Z),this._shadowDOM.adoptedStyleSheets=[Y._styleSheet],this._style}async _render(){let J=this.render;if(this.constructor._template!==void 0)J=()=>this.template();let X=await m(J,this),Y=V(X)||X===M?"lit":"string";if(j._hasMiddleware?.("render")&&j._applyMiddleware)X=j._applyMiddleware("render",this,X,Y);if(V(X)||X===M){R(X,this._shadowDOM,{host:this});return}let Z=X.trim(),$=Array.from(this._shadowDOM.childNodes);for(let W of $)W.remove();if(Z==="")return;let q=document.createElement("template");q.innerHTML=Z,this._shadowDOM.appendChild(q.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 cJ=OJ;class JJ{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,j._onMount=(J,X)=>this._notifyMount(J,X),j._onUnmount=(J,X)=>this._notifyUnmount(J,X),j._onError=(J,X,Y,Z)=>this._notifyError(J,X,Y,Z),j._applyMiddleware=(J,X,Y,Z)=>this._applyMiddleware(J,X,Y,Z),j._hasMiddleware=(J)=>this._hasMiddleware(J)}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 getImplementation(J){return this.implementations[J]||this.components[J]}static evolve(J,X,Y=!1){if(typeof this.components[J]>"u")throw Error("No component with this tag has been registered. Cannot Evolve.");if(this.implementations[J]=X,X._registered=!0,this.log(`Evolved: <${J}>`),Y){let Z=X.prototype,$=Object.getOwnPropertyNames(Z),q=Object.create(Z);try{X.call(q)}catch{}document.querySelectorAll(J).forEach((W)=>{if(W instanceof j&&W.isReady){let G=W;for(let Q of $)if(Q!=="constructor"&&typeof Z[Q]==="function"){let F=Z[Q];G[Q]=F.bind(W)}if(q._state){let Q=G._state||{},F=q._state;for(let B of Object.keys(F))if(!(B in Q))Q[B]=F[B];G._state=Q}if(q._props){let Q=G._props||{},F=q._props;for(let B of Object.keys(F))if(!(B in Q))Q[B]=F[B];G._props=Q}W.forceRender()}})}}static instances(J,X){if(typeof this.components[J]<"u")if(typeof X==="function")document.querySelectorAll(J).forEach(X);else return document.querySelectorAll(J);else throw Error("No component with the provided tag has been registered.")}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 Y=document.createElement(this.components[J].tag);return Y.setProps(X),Y}static has(J){return typeof this.components[J]<"u"}static get(J){return this.components[J]}static setState(J,X){let Y=this.state[J];if(this.state[J]=X,this.subscribers[J])this.subscribers[J].forEach((Z)=>{Z(X,Y)})}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((Y)=>{Y(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 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((Y)=>{try{Y(J,X)}catch(Z){console.error("[Pandora] Error in onMount callback:",Z)}})}static _notifyUnmount(J,X){this.log(`Unmounted: <${X}>`),this.unmountCallbacks.forEach((Y)=>{try{Y(J,X)}catch(Z){console.error("[Pandora] Error in onUnmount callback:",Z)}})}static onError(J){return this._init(),this.errorCallbacks.add(J),()=>this.errorCallbacks.delete(J)}static _notifyError(J,X,Y,Z){if(this.log(`Error in <${Y}> during ${Z}:`,J),this.errorCallbacks.size===0)throw J;this.errorCallbacks.forEach(($)=>{try{$(J,X,Y,Z)}catch(q){console.error("[Pandora] Error in onError callback:",q)}})}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 Y=this.components[X],Z=class extends Y{static _tag=J};this.components[J]=Z,window.customElements.define(J,Z),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 Y=JJ;class Z extends j{static _tag=J;_lazyLoaded=!1;async connectedCallback(){await Y._loadLazyComponent(J);let $=Y.getImplementation(J);if($&&$!==Z){let q=$.prototype,W=Object.getOwnPropertyNames(q),G=this;for(let F of W)if(F!=="constructor"&&typeof q[F]==="function"){let B=q[F];G[F]=B.bind(this)}let Q=Object.create(q);try{$.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]=Z,window.customElements.define(J,Z),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 Y=await X(),Z="default"in Y?Y.default:Y;delete this.lazyLoaders[J],this.implementations[J]=Z,Z._registered=!0,this.log(`Loaded lazy component: <${J}>`)}catch(Y){throw console.error(`[Pandora] Failed to load lazy component <${J}>:`,Y),Y}}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,Y,Z){let $=Y;return this.middleware[J].forEach((q)=>{try{$=q(X,$,Z)}catch(W){console.error(`[Pandora] Error in ${J} middleware:`,W)}}),$}static _hasMiddleware(J){return this.middleware[J].size>0}}var C=JJ;function gJ(J){return function(X){return C.register(J,X),X}}function pJ(J){return function(X,Y){let{connectedCallback:Z,disconnectedCallback:$}=X,q=Symbol(`__pandora_unsub_${Y}`),W=Symbol(`__pandora_value_${Y}`);X.connectedCallback=async function(){this[q]=C.subscribe(J,(Q)=>{if(this[W]=Q,this._isReady)this.forceRender()});let G=C.getState(J);if(G!==void 0)this[W]=G;if(Z)await Z.call(this)},X.disconnectedCallback=async function(){if(this[q])this[q](),this[q]=void 0;if($)await $.call(this)},Object.defineProperty(X,Y,{get:function(){return this[W]},set:function(G){if(this[W]===G)return;if(this[W]=G,C.setState(J,G),this._isReady)this.forceRender()},enumerable:!0,configurable:!0})}}function uJ(J){return function(X,Y){let Z=J||Y,$=Symbol(`__pandora_prop_${Y}`);if(!X.constructor._observedAttributes)X.constructor._observedAttributes=[];if(!X.constructor._observedAttributes.includes(Z))X.constructor._observedAttributes.push(Z);Object.defineProperty(X,Y,{get:function(){if(this[$]!==void 0)return this[$];if(this.hasAttribute(Z)){let q=this.getAttribute(Z);return iJ(q)}return},set:function(q){if(this[$]=q,typeof q==="string"||typeof q==="number"||typeof q==="boolean")if(typeof q==="boolean")if(q)this.setAttribute(Z,"");else this.removeAttribute(Z);else this.setAttribute(Z,String(q))},enumerable:!0,configurable:!0})}}function iJ(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 sJ={};export{dJ as svg,R as render,M as nothing,I as noChange,yJ as html,fJ as Util,sJ as Types,cJ as ShadowComponent,C as Registry,gJ as Register,uJ as Prop,pJ as Consumer,j as Component};
|
|
27
|
+
`+J;else $=J;return Z._styleSheet.replaceSync($),this._shadowDOM.adoptedStyleSheets=[Z._styleSheet],this._style}_applyLitRender(J){A(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 DX=gJ;var mJ=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[mJ]??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[mJ]=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]?.[T];if(Q?.length){let z=j[h];if(z)for(let W of z)W();j[h]=[];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 L=a;Symbol.metadata??=Symbol("Symbol.metadata");function IX(J,X){return function(Z,$){let Y=$.metadata;if(Y?.[I]){if(!Object.hasOwn(Z,"_observedAttributes"))Z._observedAttributes=[];for(let j of Y[I])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)L.register(J,Z);return Z}}function LX(J){return function(X,Z){let $=Z.metadata;return $[n]=J,X}}function kX(J){return function(X,Z){let $=String(Z.name),Y=Z.metadata;if(!Object.hasOwn(Y,_)){let G=Y[_];Y[_]=G?[...G]:[]}Y[_].push({property:J,methodName:$});let j=!1;Z.addInitializer(function(){if(j)return;j=!0;let G=Y[P];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 lJ(J,X){if(typeof Symbol.metadata>"u")return[];let $=J.constructor[Symbol.metadata]?.[_];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 _J(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 SX(J){return function(X,Z){let $=String(Z.name);_J("State",$);let Y=J?.render!==!1,j=Symbol(`__pandora_state_${$}`),G,Q=!1,z=Z.metadata;if(!Object.hasOwn(z,P)){let W=z[P];z[P]=W?new Set(W):new Set}z[P].add($),V(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){oJ(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=lJ(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}),d(J,()=>{delete J[X]})}function fX(J){return function(X,Z){let $=String(Z.name);_J("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,P)){let q=W[P];W[P]=q?new Set(q):new Set}if(W[P].add($),G!==!1){let q=Symbol(`__pandora_propSetting_${$}`);if(!Object.hasOwn(W,I)){let B=W[I];W[I]=B?[...B]:[]}if(!W[I].includes(G))W[I].push(G);sJ(W,{attrName:G,propertyKey:$,valueKey:Y,settingKey:q,shouldRender:!1,equals:j}),V(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 V(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 bX(J){return function(X,Z){let $=String(Z.name);_J("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,P)){let q=Q[P];Q[P]=q?new Set(q):new Set}Q[P].add($);let z,W=!1;{let q=Symbol(`__pandora_propSetting_${$}`);if(!Object.hasOwn(Q,I)){let B=Q[I];Q[I]=B?[...B]:[]}if(!Q[I].includes(Y))Q[I].push(Y);sJ(Q,{attrName:Y,propertyKey:$,valueKey:G,settingKey:q,shouldRender:j,equals:(B,U)=>B===U}),V(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 oJ(J,X,Z){let $=Object.getOwnPropertyDescriptor(J,X);if($&&"value"in $&&$.value!==void 0&&J[Z]===void 0)J[Z]=$.value}function sJ(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(oJ(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=lJ(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));d(J,()=>{delete J[Z]})}function NX(J){return function(X,Z){let $=String(Z.name),Y=Symbol(`__pandora_unsub_${$}`),j=Symbol(`__pandora_value_${$}`),G=Z.metadata;if(!Object.hasOwn(G,P)){let Q=G[P];G[P]=Q?new Set(Q):new Set}if(G[P].add($),!Object.hasOwn(G,b)){let Q=G[b];G[b]=Q?[...Q]:[]}G[b].push({stateKey:J,propertyKey:$,unsubKey:Y,valueKey:j}),V(G,(Q)=>{dJ(Q,J,$,Y,j)}),Z.addInitializer(function(){dJ(this,J,$,Y,j)})}}function dJ(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,L.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});d(J,()=>{if(J[$])J[$](),J[$]=void 0;delete J[Z]})}function AX(J){return function(X,Z){let $=String(Z.name),Y=Z.metadata;V(Y,(j)=>{yJ(j,$,J)}),Z.addInitializer(function(){yJ(this,$,J)})}}function wX(J){return function(X,Z){let $=String(Z.name),Y=Z.metadata;V(Y,(j)=>{uJ(j,$,J)}),Z.addInitializer(function(){uJ(this,$,J)})}}function yJ(J,X,Z){Object.defineProperty(J,X,{get(){return J.query(Z)},enumerable:!0,configurable:!0})}function uJ(J,X,Z){Object.defineProperty(J,X,{get(){return J.queryAll(Z)},enumerable:!0,configurable:!0})}function CX(J){return function(X,Z){let $=String(Z.name),Y=J?`slot[name="${J}"]`:"slot:not([name])",j=Z.metadata;V(j,(G)=>{pJ(G,$,Y)}),Z.addInitializer(function(){pJ(this,$,Y)})}}function pJ(J,X,Z){Object.defineProperty(J,X,{get(){return(J._shadowDOM||J.shadowRoot)?.querySelector(Z)??null},enumerable:!0,configurable:!0})}function xX(J,X){return function(Z,$){let Y=String($.name),j=$.metadata;if(!Object.hasOwn(j,w)){let G=j[w];j[w]=G?[...G]:[]}j[w].push({event:J,methodName:Y,options:X})}}function RX(...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,_)){let W=G[_];G[_]=W?[...W]:[]}G[_].push({property:z,methodName:`__invalidate_${$}`})}let Q=X;return V(G,(z)=>{cJ(z,$,Y,j,Q)}),Z.addInitializer(function(){cJ(this,$,Y,j,Q)}),X}}function cJ(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 KX(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($,_)){let q=$[_];$[_]=q?[...q]:[]}let W=`__classlist_${Q}_${z}`;$[_].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 EX(J){return function(X,Z){let $=String(Z.name),Y=Z.metadata;V(Y,(j)=>{iJ(j,$,J)}),Z.addInitializer(function(){iJ(this,$,J)})}}function iJ(J,X,Z){Object.defineProperty(J,X,{value:($)=>{return J.emit(Z,$)},writable:!1,enumerable:!0,configurable:!0})}function TX(J,X){if(X!==void 0&&!L.hasState(J))L.setState(J,X);return{key:J,get(){return L.getState(J)},set(Z){L.setState(J,Z)},subscribe(Z){return L.subscribe(J,Z)},has(){return L.hasState(J)},delete(){L.deleteState(J)}}}var nJ={};PJ(nJ,{whenReady:()=>rJ,resetRegistry:()=>vX,mount:()=>gX,flush:()=>hX});async function hX(){await new Promise((J)=>queueMicrotask(J)),await new Promise((J)=>queueMicrotask(J))}function rJ(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 vX(){L.clearState(),L.clearSubscriptions(),L.clearMiddleware()}async function gX(J,X,Z){let $=X??document.body,Y=document.createElement("div");Y.innerHTML=`<${J}>${Z??""}</${J}>`;let j=Y.firstElementChild;return $.appendChild(j),await rJ(j),j}var mX={};export{nJ as testing,HX as svg,A as render,hJ as reactive,F as nothing,v as noChange,FX as html,TX as createState,d as addTeardown,V as addDecoratorEffect,kX as Watch,vJ as Util,mX as Types,NX as Subscribe,LX as Style,SX as State,CX as Slot,DX as ShadowComponent,L as Registry,IX as Register,wX as QueryAll,AX as Query,fX as Property,xX as Listen,EX as Emitter,RX as Computed,D as Component,KX as ClassList,bX as Attribute};
|
|
27
28
|
|
|
28
|
-
//# debugId=
|
|
29
|
+
//# debugId=CA52246AEA4C810264756E2164756E21
|
|
29
30
|
//# sourceMappingURL=pandora.js.map
|