@aegis-framework/pandora 0.7.0 → 0.8.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 +12 -2
- package/dist/pandora.browser.js +6 -6
- package/dist/pandora.browser.js.map +5 -5
- package/dist/pandora.js +7 -7
- package/dist/pandora.js.map +5 -5
- package/dist/types/Component.d.ts.map +1 -1
- package/dist/types/Decorators.d.ts +19 -1
- package/dist/types/Decorators.d.ts.map +1 -1
- package/dist/types/Util.d.ts +23 -0
- package/dist/types/Util.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/pandora.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var
|
|
1
|
+
var It=Object.defineProperty;var Nt=(e)=>e;function Ht(e,t){this[e]=Nt.bind(null,t)}var Be=(e,t)=>{for(var n in t)It(e,n,{get:t[n],enumerable:!0,configurable:!0,set:Ht.bind(t,n)})};var bt={};Be(bt,{ATTR_HANDLERS:()=>j,DECORATOR_EFFECTS:()=>F,DECORATOR_TEARDOWNS:()=>W,LISTEN_HANDLERS:()=>H,PENDING_ATTRIBUTE_WRITES:()=>Y,PROP_ATTRIBUTES:()=>A,REACTIVE_FIELDS:()=>v,STYLE_METADATA:()=>ce,SUBSCRIBE_HANDLERS:()=>M,WATCH_HANDLERS:()=>w,addDecoratorEffect:()=>R,addTeardown:()=>Z,callAsync:()=>ue,deserializeCSS:()=>X,findDelegateMatch:()=>je,isTemplateResult:()=>_e,parseAttributeValue:()=>P,reactive:()=>gt,reactiveFields:()=>yt,recordBatchedChange:()=>he,resolveListenerTarget:()=>He,writePendingAttributes:()=>Ne});var Mt={};Be(Mt,{flush:()=>Wn,mount:()=>Kn,resetRegistry:()=>Gn,whenReady:()=>Dt});var Yn={};var Ee=globalThis,Ue=(e)=>e,pe=Ee.trustedTypes,ze=pe?pe.createPolicy("lit-html",{createHTML:(e)=>e}):void 0;var D=`lit$${Math.random().toFixed(9).slice(2)}$`,Te="?"+D,jt=`<${Te}>`,B=document,te=()=>B.createComment(""),ne=(e)=>e===null||typeof e!="object"&&typeof e!="function",$e=Array.isArray,Ye=(e)=>$e(e)||typeof e?.[Symbol.iterator]=="function";var ee=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Fe=/-->/g,We=/>/g,V=RegExp(`>|[
|
|
2
2
|
\f\r](?:([^\\s"'>=/]+)([
|
|
3
3
|
\f\r]*=[
|
|
4
4
|
\f\r]*(?:[^
|
|
5
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),We=/'/g,Ge=/"/g,Ye=/^(?:script|style|textarea|title)$/i,Re=(e)=>(t,...n)=>({_$litType$:e,strings:t,values:n}),jt=Re(1),Vt=Re(2),Yn=Re(3),y=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Ke=new WeakMap,q=B.createTreeWalker(B,129);function Xe(e,t){if(!$e(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ue!==void 0?Ue.createHTML(t):t}var Ze=(e,t)=>{let n=e.length-1,s=[],o,i=t===2?"<svg>":t===3?"<math>":"",r=ee;for(let a=0;a<n;a++){let l=e[a],u,d,c=-1,h=0;for(;h<l.length&&(r.lastIndex=h,d=r.exec(l),d!==null);)h=r.lastIndex,r===ee?d[1]==="!--"?r=ze:d[1]!==void 0?r=Fe:d[2]!==void 0?(Ye.test(d[2])&&(o=RegExp("</"+d[2],"g")),r=V):d[3]!==void 0&&(r=V):r===V?d[0]===">"?(r=o??ee,c=-1):d[1]===void 0?c=-2:(c=r.lastIndex-d[2].length,u=d[1],r=d[3]===void 0?V:d[3]==='"'?Ge:We):r===Ge||r===We?r=V:r===ze||r===Fe?r=ee:(r=V,o=void 0);let p=r===V&&e[a+1].startsWith("/>")?" ":"";i+=r===ee?l+Ht:c>=0?(s.push(u),l.slice(0,c)+"$lit$"+l.slice(c)+D+p):l+D+(c===-2?a:p)}return[Xe(e,i+(e[n]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class se{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let o=0,i=0,r=e.length-1,a=this.parts,[l,u]=Ze(e,t);if(this.el=se.createElement(l,n),q.currentNode=this.el.content,t===2||t===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(s=q.nextNode())!==null&&a.length<r;){if(s.nodeType===1){if(s.hasAttributes())for(let d of s.getAttributeNames())if(d.endsWith("$lit$")){let c=u[i++],h=s.getAttribute(d).split(D),p=/([.?@])?(.*)/.exec(c);a.push({type:1,index:o,name:p[2],strings:h,ctor:p[1]==="."?Le:p[1]==="?"?xe:p[1]==="@"?Pe:K}),s.removeAttribute(d)}else d.startsWith(D)&&(a.push({type:6,index:o}),s.removeAttribute(d));if(Ye.test(s.tagName)){let d=s.textContent.split(D),c=d.length-1;if(c>0){s.textContent=pe?pe.emptyScript:"";for(let h=0;h<c;h++)s.append(d[h],te()),q.nextNode(),a.push({type:2,index:++o});s.append(d[c],te())}}}else if(s.nodeType===8)if(s.data===Te)a.push({type:2,index:o});else{let d=-1;for(;(d=s.data.indexOf(D,d+1))!==-1;)a.push({type:7,index:o}),d+=D.length-1}o++}}static createElement(e,t){let n=B.createElement("template");return n.innerHTML=e,n}}function U(e,t,n=e,s){if(t===y)return t;let o=s!==void 0?n._$Co?.[s]:n._$Cl,i=ne(t)?void 0:t._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),i===void 0?o=void 0:(o=new i(e),o._$AT(e,n,s)),s!==void 0?(n._$Co??=[])[s]=o:n._$Cl=o),o!==void 0&&(t=U(e,o._$AS(e,t.values),o,s)),t}class ke{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,s=(e?.creationScope??B).importNode(t,!0);q.currentNode=s;let o=q.nextNode(),i=0,r=0,a=n[0];for(;a!==void 0;){if(i===a.index){let l;a.type===2?l=new G(o,o.nextSibling,this,e):a.type===1?l=new a.ctor(o,a.name,a.strings,this,e):a.type===6&&(l=new Oe(o,this,e)),this._$AV.push(l),a=n[++r]}i!==a?.index&&(o=q.nextNode(),i++)}return q.currentNode=B,s}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class G{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=U(this,e,t),ne(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==y&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Qe(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==f&&ne(this._$AH)?this._$AA.nextSibling.data=e:this.T(B.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=se.createElement(Xe(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(t);else{let o=new ke(s,this),i=o.u(this.options);o.p(t),this.T(i),this._$AH=o}}_$AC(e){let t=Ke.get(e.strings);return t===void 0&&Ke.set(e.strings,t=new se(e)),t}k(e){$e(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,s=0;for(let o of e)s===t.length?t.push(n=new G(this.O(te()),this.O(te()),this,this.options)):n=t[s],n._$AI(o),s++;s<t.length&&(this._$AR(n&&n._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=Be(e).nextSibling;Be(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class K{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,o){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=f}_$AI(e,t=this,n,s){let o=this.strings,i=!1;if(o===void 0)e=U(this,e,t,0),i=!ne(e)||e!==this._$AH&&e!==y,i&&(this._$AH=e);else{let r=e,a,l;for(e=o[0],a=0;a<o.length-1;a++)l=U(this,r[n+a],t,a),l===y&&(l=this._$AH[a]),i||=!ne(l)||l!==this._$AH[a],l===f?e=f:e!==f&&(e+=(l??"")+o[a+1]),this._$AH[a]=l}i&&!s&&this.j(e)}j(e){e===f?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Le extends K{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===f?void 0:e}}class xe extends K{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==f)}}class Pe extends K{constructor(e,t,n,s,o){super(e,t,n,s,o),this.type=5}_$AI(e,t=this){if((e=U(this,e,t,0)??f)===y)return;let n=this._$AH,s=e===f&&n!==f||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,o=e!==f&&(n===f||s);s&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Oe{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){U(this,e)}}var Je={M:"$lit$",P:D,A:Te,C:1,L:Ze,R:ke,D:Qe,V:U,I:G,H:K,N:xe,U:Pe,B:Le,F:Oe},qt=Ee.litHtmlPolyfillSupport;qt?.(se,G),(Ee.litHtmlVersions??=[]).push("3.3.3");var z=(e,t,n)=>{let s=n?.renderBefore??t,o=s._$litPart$;if(o===void 0){let i=n?.renderBefore??null;s._$litPart$=o=new G(t.insertBefore(te(),i),i,void 0,n??{})}return o._$AI(e),o};var{I:Bt}=Je,et=(e)=>e,De=(e)=>e===null||typeof e!="object"&&typeof e!="function",Ut={HTML:1,SVG:2,MATHML:3},fe=(e,t)=>t===void 0?e?._$litType$!==void 0:e?._$litType$===t,Me=(e)=>e?._$litType$?.h!=null,zt=(e)=>e?._$litDirective$!==void 0,Ft=(e)=>e?._$litDirective$,oe=(e)=>e.strings===void 0,tt=()=>document.createComment(""),k=(e,t,n)=>{let s=e._$AA.parentNode,o=t===void 0?e._$AB:t._$AA;if(n===void 0){let i=s.insertBefore(tt(),o),r=s.insertBefore(tt(),o);n=new Bt(i,r,e,e.options)}else{let i=n._$AB.nextSibling,r=n._$AM,a=r!==e;if(a){let l;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(l=e._$AU)!==r._$AU&&n._$AP(l)}if(i!==o||a){let l=n._$AA;for(;l!==i;){let u=et(l).nextSibling;et(s).insertBefore(l,o),l=u}}}return n},L=(e,t,n=e)=>(e._$AI(t,n),e),Wt={},x=(e,t=Wt)=>e._$AH=t,Q=(e)=>e._$AH,re=(e)=>{e._$AR(),e._$AA.remove()},ie=(e)=>{e._$AR()};var b={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},m=(e)=>(...t)=>({_$litDirective$:e,values:t});class _{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}var ae=(e,t)=>{let n=e._$AN;if(n===void 0)return!1;for(let s of n)s._$AO?.(t,!1),ae(s,t);return!0},me=(e)=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},nt=(e)=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),Qt(t)}};function Gt(e){this._$AN!==void 0?(me(this),this._$AM=e,nt(this)):this._$AM=e}function Kt(e,t=!1,n=0){let s=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(s))for(let i=n;i<s.length;i++)ae(s[i],!1),me(s[i]);else s!=null&&(ae(s,!1),me(s));else ae(this,e)}var Qt=(e)=>{e.type==b.CHILD&&(e._$AP??=Kt,e._$AQ??=Gt)};class I extends _{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),nt(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(ae(this,e),me(this))}setValue(e){if(oe(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}var st=async(e,t)=>{for await(let n of e)if(await t(n)===!1)return};class le{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}}class de{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise((e)=>this.Z=e)}resume(){this.Z?.(),this.Y=this.Z=void 0}}class ye extends I{constructor(){super(...arguments),this._$CK=new le(this),this._$CX=new de}render(e,t){return y}update(e,[t,n]){if(this.isConnected||this.disconnected(),t===this._$CJ)return y;this._$CJ=t;let s=0,{_$CK:o,_$CX:i}=this;return st(t,async(r)=>{for(;i.get();)await i.get();let a=o.deref();if(a!==void 0){if(a._$CJ!==t)return!1;n!==void 0&&(r=n(r,s)),a.commitValue(r,s),s++}return!0}),y}commitValue(e,t){this.setValue(e)}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}}var Yt=m(ye);var Xt=m(class extends ye{constructor(e){if(super(e),e.type!==b.CHILD)throw Error("asyncAppend can only be used in child expressions")}update(e,t){return this._$Ctt=e,super.update(e,t)}commitValue(e,t){t===0&&ie(this._$Ctt);let n=k(this._$Ctt);L(n,e)}});var ot=(e)=>Me(e)?e._$litType$.h:e.strings,Zt=m(class extends _{constructor(e){super(e),this.et=new WeakMap}render(e){return[e]}update(e,[t]){let n=fe(this.it)?ot(this.it):null,s=fe(t)?ot(t):null;if(n!==null&&(s===null||n!==s)){let o=Q(e).pop(),i=this.et.get(n);if(i===void 0){let r=document.createDocumentFragment();i=z(f,r),i.setConnected(!1),this.et.set(n,i)}x(i,[o]),k(i,void 0,o)}if(s!==null){if(n===null||n!==s){let o=this.et.get(s);if(o!==void 0){let i=Q(o).pop();ie(e),k(e,void 0,i),x(e,[i])}}this.it=t}else this.it=void 0;return this.render(t)}});var Jt=(e,t,n)=>{for(let s of t)if(s[0]===e)return(0,s[1])();return n?.()};var en=m(class extends _{constructor(e){if(super(e),e.type!==b.ATTRIBUTE||e.name!=="class"||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t)=>e[t]).join(" ")+" "}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter((s)=>s!=="")));for(let s in t)t[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(t)}let n=e.element.classList;for(let s of this.st)s in t||(n.remove(s),this.st.delete(s));for(let s in t){let o=!!t[s];o===this.st.has(s)||this.nt?.has(s)||(o?(n.add(s),this.st.add(s)):(n.remove(s),this.st.delete(s)))}return y}});var tn={},nn=m(class extends _{constructor(){super(...arguments),this.ot=tn}render(e,t){return t()}update(e,[t,n]){if(Array.isArray(t)){if(Array.isArray(this.ot)&&this.ot.length===t.length&&t.every((s,o)=>s===this.ot[o]))return y}else if(this.ot===t)return y;return this.ot=Array.isArray(t)?Array.from(t):t,this.render(t,n)}});var sn=(e)=>e??f;function*on(e,t){let n=typeof t=="function";if(e!==void 0){let s=-1;for(let o of e)s>-1&&(yield n?t(s):t),s++,yield o}}var rn=m(class extends _{constructor(){super(...arguments),this.key=f}render(e,t){return this.key=e,t}update(e,[t,n]){return t!==this.key&&(x(e),this.key=t),n}});var an=m(class extends _{constructor(e){if(super(e),e.type!==b.PROPERTY&&e.type!==b.ATTRIBUTE&&e.type!==b.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!oe(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===y||t===f)return t;let{element:n,name:s}=e;if(e.type===b.PROPERTY){if(t===n[s])return y}else if(e.type===b.BOOLEAN_ATTRIBUTE){if(!!t===n.hasAttribute(s))return y}else if(e.type===b.ATTRIBUTE&&n.getAttribute(s)===t+"")return y;return x(e),t}});function*ln(e,t){if(e!==void 0){let n=0;for(let s of e)yield t(s,n++)}}function*dn(e,t,n=1){let s=t===void 0?0:e;t??=e;for(let o=s;n>0?o<t:t<o;o+=n)yield o}var cn=()=>new rt;class rt{}var Ie=new WeakMap,un=m(class extends I{render(e){return f}update(e,[t]){let n=t!==this.G;return n&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),f}rt(e){if(this.G!==void 0)if(this.isConnected||(e=void 0),typeof this.G=="function"){let t=this.ht??globalThis,n=Ie.get(t);n===void 0&&(n=new WeakMap,Ie.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G=="function"?Ie.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var it=(e,t,n)=>{let s=new Map;for(let o=t;o<=n;o++)s.set(e[o],o);return s},hn=m(class extends _{constructor(e){if(super(e),e.type!==b.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,n){let s;n===void 0?n=t:t!==void 0&&(s=t);let o=[],i=[],r=0;for(let a of e)o[r]=s?s(a,r):r,i[r]=n(a,r),r++;return{values:i,keys:o}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,s]){let o=Q(e),{values:i,keys:r}=this.dt(t,n,s);if(!Array.isArray(o))return this.ut=r,i;let a=this.ut??=[],l=[],u,d,c=0,h=o.length-1,p=0,S=i.length-1;for(;c<=h&&p<=S;)if(o[c]===null)c++;else if(o[h]===null)h--;else if(a[c]===r[p])l[p]=L(o[c],i[p]),c++,p++;else if(a[h]===r[S])l[S]=L(o[h],i[S]),h--,S--;else if(a[c]===r[S])l[S]=L(o[c],i[S]),k(e,l[S+1],o[c]),c++,S--;else if(a[h]===r[p])l[p]=L(o[h],i[p]),k(e,o[c],o[h]),h--,p++;else if(u===void 0&&(u=it(r,p,S),d=it(a,c,h)),u.has(a[c]))if(u.has(a[h])){let O=d.get(r[p]),Ae=O!==void 0?o[O]:null;if(Ae===null){let Ve=k(e,o[c]);L(Ve,i[p]),l[p]=Ve}else l[p]=L(Ae,i[p]),k(e,o[c],Ae),o[O]=null;p++}else re(o[h]),h--;else re(o[c]),c++;for(;p<=S;){let O=k(e,l[S+1]);L(O,i[p]),l[p++]=O}for(;c<=h;){let O=o[c++];O!==null&&re(O)}return this.ut=r,x(e,l),y}});var at="important",pn=" !"+at,fn=m(class extends _{constructor(e){if(super(e),e.type!==b.ATTRIBUTE||e.name!=="style"||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,n)=>{let s=e[n];return s==null?t:t+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(e,[t]){let{style:n}=e.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let s of this.ft)t[s]==null&&(this.ft.delete(s),s.includes("-")?n.removeProperty(s):n[s]=null);for(let s in t){let o=t[s];if(o!=null){this.ft.add(s);let i=typeof o=="string"&&o.endsWith(pn);s.includes("-")||i?n.setProperty(s,i?o.slice(0,-11):o,i?at:""):n[s]=o}}return y}});var mn=m(class extends _{constructor(e){if(super(e),e.type!==b.CHILD)throw Error("templateContent can only be used in child bindings")}render(e){return this.vt===e?y:(this.vt=e,document.importNode(e.content,!0))}});class N extends _{constructor(e){if(super(e),this.it=f,e.type!==b.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===f||e==null)return this._t=void 0,this.it=e;if(e===y)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}N.directiveName="unsafeHTML",N.resultType=1;var yn=m(N);class ge extends N{}ge.directiveName="unsafeMath",ge.resultType=3;var gn=m(ge);class be extends N{}be.directiveName="unsafeSVG",be.resultType=2;var bn=m(be);var lt=(e)=>!De(e)&&typeof e.then=="function",dt=1073741823;class ct extends I{constructor(){super(...arguments),this._$Cwt=dt,this._$Cbt=[],this._$CK=new le(this),this._$CX=new de}render(...e){return e.find((t)=>!lt(t))??y}update(e,t){let n=this._$Cbt,s=n.length;this._$Cbt=t;let o=this._$CK,i=this._$CX;this.isConnected||this.disconnected();for(let r=0;r<t.length&&!(r>this._$Cwt);r++){let a=t[r];if(!lt(a))return this._$Cwt=r,a;r<s&&a===n[r]||(this._$Cwt=dt,s=0,Promise.resolve(a).then(async(l)=>{for(;i.get();)await i.get();let u=o.deref();if(u!==void 0){let d=u._$Cbt.indexOf(a);d>-1&&d<u._$Cwt&&(u._$Cwt=d,u.setValue(l))}}))}return y}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}}var _n=m(ct);function vn(e,t,n){return e?t(e):n?.(e)}var ut=(e,t)=>{let n=t.getAttribute("data-key"),s=null;if(n!==null)s=`[data-key="${CSS.escape(n)}"]`;else if(t.id!=="")s=`#${CSS.escape(t.id)}`;let o=[],i=t;while(!0){let r=i.parentNode;if(r===null)return null;if(o.unshift({index:Array.prototype.indexOf.call(r.children,i),tagName:i.tagName}),r===e)return{selector:s,path:o};i=r}},ht=(e,t)=>{if(t.selector!==null){let s=e.querySelector(t.selector);if(s!==null)return s}let n=e;for(let s of t.path){let o=n.children[s.index];if(o===void 0||o.tagName!==s.tagName)return null;n=o}return n===e?null:n},wn=(e)=>{if(!(e instanceof HTMLInputElement)&&!(e instanceof HTMLTextAreaElement))return null;if(e.selectionStart===null||e.selectionEnd===null)return null;return{start:e.selectionStart,end:e.selectionEnd,direction:e.selectionDirection??"none"}},Sn=(e)=>{if(e instanceof ShadowRoot)return e.activeElement;let t=document.activeElement;return t!==null&&t!==e&&e.contains(t)?t:null},pt=(e,t)=>{let n=Sn(e),s=n===null?null:ut(e,n),o=n===null?null:wn(n),i=[];for(let r of t){if(t.delete(r),!e.contains(r)||r.scrollTop===0&&r.scrollLeft===0)continue;let a=ut(e,r);if(a!==null)i.push({locator:a,top:r.scrollTop,left:r.scrollLeft})}return()=>{for(let{locator:a,top:l,left:u}of i){let d=ht(e,a);if(d!==null)d.scrollTop=l,d.scrollLeft=u,t.add(d)}if(s===null||n?.isConnected)return;let r=ht(e,s);if(!(r instanceof HTMLElement||r instanceof SVGElement))return;if(r.focus({preventScroll:!0}),o!==null&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement))try{r.setSelectionRange(o.start,o.end,o.direction)}catch{}}};var A=Symbol("pandora:propAttributes"),F=Symbol("pandora:decoratorEffects"),W=Symbol("pandora:decoratorTeardowns"),w=Symbol("pandora:watchHandlers"),v=Symbol("pandora:reactiveFields"),H=Symbol("pandora:listenHandlers"),ce=Symbol("pandora:styleMetadata"),j=Symbol("pandora:attrHandlers"),M=Symbol("pandora:subscribeHandlers"),Y=Symbol("pandora:pendingAttributeWrites"),ft=new Map,ue=(e,t,...n)=>{try{let s=e.apply(t,n);return s instanceof Promise?s:Promise.resolve(s)}catch(s){return Promise.reject(s)}},_e=(e)=>e!==null&&typeof e==="object"&&("_$litType$"in e),X=(e,t="",n=0)=>{let s=Object.keys(e),o="";for(let i of s){let r=e[i];if(typeof r==="object"&&r!==null){if(t&&!i.startsWith("@"))if(i.startsWith("&"))o+=`${i.replace(/&/g,t)} {
|
|
5
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ge=/'/g,Ke=/"/g,Xe=/^(?:script|style|textarea|title)$/i,Re=(e)=>(t,...n)=>({_$litType$:e,strings:t,values:n}),Vt=Re(1),qt=Re(2),Zn=Re(3),y=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),Qe=new WeakMap,q=B.createTreeWalker(B,129);function Ze(e,t){if(!$e(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return ze!==void 0?ze.createHTML(t):t}var Je=(e,t)=>{let n=e.length-1,s=[],o,i=t===2?"<svg>":t===3?"<math>":"",r=ee;for(let a=0;a<n;a++){let d=e[a],u,l,c=-1,h=0;for(;h<d.length&&(r.lastIndex=h,l=r.exec(d),l!==null);)h=r.lastIndex,r===ee?l[1]==="!--"?r=Fe:l[1]!==void 0?r=We:l[2]!==void 0?(Xe.test(l[2])&&(o=RegExp("</"+l[2],"g")),r=V):l[3]!==void 0&&(r=V):r===V?l[0]===">"?(r=o??ee,c=-1):l[1]===void 0?c=-2:(c=r.lastIndex-l[2].length,u=l[1],r=l[3]===void 0?V:l[3]==='"'?Ke:Ge):r===Ke||r===Ge?r=V:r===Fe||r===We?r=ee:(r=V,o=void 0);let p=r===V&&e[a+1].startsWith("/>")?" ":"";i+=r===ee?d+jt:c>=0?(s.push(u),d.slice(0,c)+"$lit$"+d.slice(c)+D+p):d+D+(c===-2?a:p)}return[Ze(e,i+(e[n]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class se{constructor({strings:e,_$litType$:t},n){let s;this.parts=[];let o=0,i=0,r=e.length-1,a=this.parts,[d,u]=Je(e,t);if(this.el=se.createElement(d,n),q.currentNode=this.el.content,t===2||t===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(s=q.nextNode())!==null&&a.length<r;){if(s.nodeType===1){if(s.hasAttributes())for(let l of s.getAttributeNames())if(l.endsWith("$lit$")){let c=u[i++],h=s.getAttribute(l).split(D),p=/([.?@])?(.*)/.exec(c);a.push({type:1,index:o,name:p[2],strings:h,ctor:p[1]==="."?Le:p[1]==="?"?xe:p[1]==="@"?Pe:K}),s.removeAttribute(l)}else l.startsWith(D)&&(a.push({type:6,index:o}),s.removeAttribute(l));if(Xe.test(s.tagName)){let l=s.textContent.split(D),c=l.length-1;if(c>0){s.textContent=pe?pe.emptyScript:"";for(let h=0;h<c;h++)s.append(l[h],te()),q.nextNode(),a.push({type:2,index:++o});s.append(l[c],te())}}}else if(s.nodeType===8)if(s.data===Te)a.push({type:2,index:o});else{let l=-1;for(;(l=s.data.indexOf(D,l+1))!==-1;)a.push({type:7,index:o}),l+=D.length-1}o++}}static createElement(e,t){let n=B.createElement("template");return n.innerHTML=e,n}}function U(e,t,n=e,s){if(t===y)return t;let o=s!==void 0?n._$Co?.[s]:n._$Cl,i=ne(t)?void 0:t._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),i===void 0?o=void 0:(o=new i(e),o._$AT(e,n,s)),s!==void 0?(n._$Co??=[])[s]=o:n._$Cl=o),o!==void 0&&(t=U(e,o._$AS(e,t.values),o,s)),t}class ke{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,s=(e?.creationScope??B).importNode(t,!0);q.currentNode=s;let o=q.nextNode(),i=0,r=0,a=n[0];for(;a!==void 0;){if(i===a.index){let d;a.type===2?d=new G(o,o.nextSibling,this,e):a.type===1?d=new a.ctor(o,a.name,a.strings,this,e):a.type===6&&(d=new Oe(o,this,e)),this._$AV.push(d),a=n[++r]}i!==a?.index&&(o=q.nextNode(),i++)}return q.currentNode=B,s}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}}class G{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,s){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=U(this,e,t),ne(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==y&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ye(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==f&&ne(this._$AH)?this._$AA.nextSibling.data=e:this.T(B.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=se.createElement(Ze(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(t);else{let o=new ke(s,this),i=o.u(this.options);o.p(t),this.T(i),this._$AH=o}}_$AC(e){let t=Qe.get(e.strings);return t===void 0&&Qe.set(e.strings,t=new se(e)),t}k(e){$e(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,s=0;for(let o of e)s===t.length?t.push(n=new G(this.O(te()),this.O(te()),this,this.options)):n=t[s],n._$AI(o),s++;s<t.length&&(this._$AR(n&&n._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=Ue(e).nextSibling;Ue(e).remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class K{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,s,o){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=o,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=f}_$AI(e,t=this,n,s){let o=this.strings,i=!1;if(o===void 0)e=U(this,e,t,0),i=!ne(e)||e!==this._$AH&&e!==y,i&&(this._$AH=e);else{let r=e,a,d;for(e=o[0],a=0;a<o.length-1;a++)d=U(this,r[n+a],t,a),d===y&&(d=this._$AH[a]),i||=!ne(d)||d!==this._$AH[a],d===f?e=f:e!==f&&(e+=(d??"")+o[a+1]),this._$AH[a]=d}i&&!s&&this.j(e)}j(e){e===f?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Le extends K{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===f?void 0:e}}class xe extends K{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==f)}}class Pe extends K{constructor(e,t,n,s,o){super(e,t,n,s,o),this.type=5}_$AI(e,t=this){if((e=U(this,e,t,0)??f)===y)return;let n=this._$AH,s=e===f&&n!==f||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,o=e!==f&&(n===f||s);s&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Oe{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){U(this,e)}}var et={M:"$lit$",P:D,A:Te,C:1,L:Je,R:ke,D:Ye,V:U,I:G,H:K,N:xe,U:Pe,B:Le,F:Oe},Bt=Ee.litHtmlPolyfillSupport;Bt?.(se,G),(Ee.litHtmlVersions??=[]).push("3.3.3");var z=(e,t,n)=>{let s=n?.renderBefore??t,o=s._$litPart$;if(o===void 0){let i=n?.renderBefore??null;s._$litPart$=o=new G(t.insertBefore(te(),i),i,void 0,n??{})}return o._$AI(e),o};var{I:Ut}=et,tt=(e)=>e,De=(e)=>e===null||typeof e!="object"&&typeof e!="function",zt={HTML:1,SVG:2,MATHML:3},fe=(e,t)=>t===void 0?e?._$litType$!==void 0:e?._$litType$===t,Me=(e)=>e?._$litType$?.h!=null,Ft=(e)=>e?._$litDirective$!==void 0,Wt=(e)=>e?._$litDirective$,oe=(e)=>e.strings===void 0,nt=()=>document.createComment(""),k=(e,t,n)=>{let s=e._$AA.parentNode,o=t===void 0?e._$AB:t._$AA;if(n===void 0){let i=s.insertBefore(nt(),o),r=s.insertBefore(nt(),o);n=new Ut(i,r,e,e.options)}else{let i=n._$AB.nextSibling,r=n._$AM,a=r!==e;if(a){let d;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(d=e._$AU)!==r._$AU&&n._$AP(d)}if(i!==o||a){let d=n._$AA;for(;d!==i;){let u=tt(d).nextSibling;tt(s).insertBefore(d,o),d=u}}}return n},L=(e,t,n=e)=>(e._$AI(t,n),e),Gt={},x=(e,t=Gt)=>e._$AH=t,Q=(e)=>e._$AH,re=(e)=>{e._$AR(),e._$AA.remove()},ie=(e)=>{e._$AR()};var b={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},m=(e)=>(...t)=>({_$litDirective$:e,values:t});class _{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}var ae=(e,t)=>{let n=e._$AN;if(n===void 0)return!1;for(let s of n)s._$AO?.(t,!1),ae(s,t);return!0},me=(e)=>{let t,n;do{if((t=e._$AM)===void 0)break;n=t._$AN,n.delete(e),e=t}while(n?.size===0)},st=(e)=>{for(let t;t=e._$AM;e=t){let n=t._$AN;if(n===void 0)t._$AN=n=new Set;else if(n.has(e))break;n.add(e),Yt(t)}};function Kt(e){this._$AN!==void 0?(me(this),this._$AM=e,st(this)):this._$AM=e}function Qt(e,t=!1,n=0){let s=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(s))for(let i=n;i<s.length;i++)ae(s[i],!1),me(s[i]);else s!=null&&(ae(s,!1),me(s));else ae(this,e)}var Yt=(e)=>{e.type==b.CHILD&&(e._$AP??=Qt,e._$AQ??=Kt)};class I extends _{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),st(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(ae(this,e),me(this))}setValue(e){if(oe(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}var ot=async(e,t)=>{for await(let n of e)if(await t(n)===!1)return};class de{constructor(e){this.G=e}disconnect(){this.G=void 0}reconnect(e){this.G=e}deref(){return this.G}}class le{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise((e)=>this.Z=e)}resume(){this.Z?.(),this.Y=this.Z=void 0}}class ye extends I{constructor(){super(...arguments),this._$CK=new de(this),this._$CX=new le}render(e,t){return y}update(e,[t,n]){if(this.isConnected||this.disconnected(),t===this._$CJ)return y;this._$CJ=t;let s=0,{_$CK:o,_$CX:i}=this;return ot(t,async(r)=>{for(;i.get();)await i.get();let a=o.deref();if(a!==void 0){if(a._$CJ!==t)return!1;n!==void 0&&(r=n(r,s)),a.commitValue(r,s),s++}return!0}),y}commitValue(e,t){this.setValue(e)}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}}var Xt=m(ye);var Zt=m(class extends ye{constructor(e){if(super(e),e.type!==b.CHILD)throw Error("asyncAppend can only be used in child expressions")}update(e,t){return this._$Ctt=e,super.update(e,t)}commitValue(e,t){t===0&&ie(this._$Ctt);let n=k(this._$Ctt);L(n,e)}});var rt=(e)=>Me(e)?e._$litType$.h:e.strings,Jt=m(class extends _{constructor(e){super(e),this.et=new WeakMap}render(e){return[e]}update(e,[t]){let n=fe(this.it)?rt(this.it):null,s=fe(t)?rt(t):null;if(n!==null&&(s===null||n!==s)){let o=Q(e).pop(),i=this.et.get(n);if(i===void 0){let r=document.createDocumentFragment();i=z(f,r),i.setConnected(!1),this.et.set(n,i)}x(i,[o]),k(i,void 0,o)}if(s!==null){if(n===null||n!==s){let o=this.et.get(s);if(o!==void 0){let i=Q(o).pop();ie(e),k(e,void 0,i),x(e,[i])}}this.it=t}else this.it=void 0;return this.render(t)}});var en=(e,t,n)=>{for(let s of t)if(s[0]===e)return(0,s[1])();return n?.()};var tn=m(class extends _{constructor(e){if(super(e),e.type!==b.ATTRIBUTE||e.name!=="class"||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter((t)=>e[t]).join(" ")+" "}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter((s)=>s!=="")));for(let s in t)t[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(t)}let n=e.element.classList;for(let s of this.st)s in t||(n.remove(s),this.st.delete(s));for(let s in t){let o=!!t[s];o===this.st.has(s)||this.nt?.has(s)||(o?(n.add(s),this.st.add(s)):(n.remove(s),this.st.delete(s)))}return y}});var nn={},sn=m(class extends _{constructor(){super(...arguments),this.ot=nn}render(e,t){return t()}update(e,[t,n]){if(Array.isArray(t)){if(Array.isArray(this.ot)&&this.ot.length===t.length&&t.every((s,o)=>s===this.ot[o]))return y}else if(this.ot===t)return y;return this.ot=Array.isArray(t)?Array.from(t):t,this.render(t,n)}});var on=(e)=>e??f;function*rn(e,t){let n=typeof t=="function";if(e!==void 0){let s=-1;for(let o of e)s>-1&&(yield n?t(s):t),s++,yield o}}var an=m(class extends _{constructor(){super(...arguments),this.key=f}render(e,t){return this.key=e,t}update(e,[t,n]){return t!==this.key&&(x(e),this.key=t),n}});var dn=m(class extends _{constructor(e){if(super(e),e.type!==b.PROPERTY&&e.type!==b.ATTRIBUTE&&e.type!==b.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!oe(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===y||t===f)return t;let{element:n,name:s}=e;if(e.type===b.PROPERTY){if(t===n[s])return y}else if(e.type===b.BOOLEAN_ATTRIBUTE){if(!!t===n.hasAttribute(s))return y}else if(e.type===b.ATTRIBUTE&&n.getAttribute(s)===t+"")return y;return x(e),t}});function*ln(e,t){if(e!==void 0){let n=0;for(let s of e)yield t(s,n++)}}function*cn(e,t,n=1){let s=t===void 0?0:e;t??=e;for(let o=s;n>0?o<t:t<o;o+=n)yield o}var un=()=>new it;class it{}var Ie=new WeakMap,hn=m(class extends I{render(e){return f}update(e,[t]){let n=t!==this.G;return n&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),f}rt(e){if(this.G!==void 0)if(this.isConnected||(e=void 0),typeof this.G=="function"){let t=this.ht??globalThis,n=Ie.get(t);n===void 0&&(n=new WeakMap,Ie.set(t,n)),n.get(this.G)!==void 0&&this.G.call(this.ht,void 0),n.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G=="function"?Ie.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var at=(e,t,n)=>{let s=new Map;for(let o=t;o<=n;o++)s.set(e[o],o);return s},pn=m(class extends _{constructor(e){if(super(e),e.type!==b.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,n){let s;n===void 0?n=t:t!==void 0&&(s=t);let o=[],i=[],r=0;for(let a of e)o[r]=s?s(a,r):r,i[r]=n(a,r),r++;return{values:i,keys:o}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,s]){let o=Q(e),{values:i,keys:r}=this.dt(t,n,s);if(!Array.isArray(o))return this.ut=r,i;let a=this.ut??=[],d=[],u,l,c=0,h=o.length-1,p=0,S=i.length-1;for(;c<=h&&p<=S;)if(o[c]===null)c++;else if(o[h]===null)h--;else if(a[c]===r[p])d[p]=L(o[c],i[p]),c++,p++;else if(a[h]===r[S])d[S]=L(o[h],i[S]),h--,S--;else if(a[c]===r[S])d[S]=L(o[c],i[S]),k(e,d[S+1],o[c]),c++,S--;else if(a[h]===r[p])d[p]=L(o[h],i[p]),k(e,o[c],o[h]),h--,p++;else if(u===void 0&&(u=at(r,p,S),l=at(a,c,h)),u.has(a[c]))if(u.has(a[h])){let O=l.get(r[p]),Ae=O!==void 0?o[O]:null;if(Ae===null){let qe=k(e,o[c]);L(qe,i[p]),d[p]=qe}else d[p]=L(Ae,i[p]),k(e,o[c],Ae),o[O]=null;p++}else re(o[h]),h--;else re(o[c]),c++;for(;p<=S;){let O=k(e,d[S+1]);L(O,i[p]),d[p++]=O}for(;c<=h;){let O=o[c++];O!==null&&re(O)}return this.ut=r,x(e,d),y}});var dt="important",fn=" !"+dt,mn=m(class extends _{constructor(e){if(super(e),e.type!==b.ATTRIBUTE||e.name!=="style"||e.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(e){return Object.keys(e).reduce((t,n)=>{let s=e[n];return s==null?t:t+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(e,[t]){let{style:n}=e.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let s of this.ft)t[s]==null&&(this.ft.delete(s),s.includes("-")?n.removeProperty(s):n[s]=null);for(let s in t){let o=t[s];if(o!=null){this.ft.add(s);let i=typeof o=="string"&&o.endsWith(fn);s.includes("-")||i?n.setProperty(s,i?o.slice(0,-11):o,i?dt:""):n[s]=o}}return y}});var yn=m(class extends _{constructor(e){if(super(e),e.type!==b.CHILD)throw Error("templateContent can only be used in child bindings")}render(e){return this.vt===e?y:(this.vt=e,document.importNode(e.content,!0))}});class N extends _{constructor(e){if(super(e),this.it=f,e.type!==b.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===f||e==null)return this._t=void 0,this.it=e;if(e===y)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}N.directiveName="unsafeHTML",N.resultType=1;var gn=m(N);class ge extends N{}ge.directiveName="unsafeMath",ge.resultType=3;var bn=m(ge);class be extends N{}be.directiveName="unsafeSVG",be.resultType=2;var _n=m(be);var lt=(e)=>!De(e)&&typeof e.then=="function",ct=1073741823;class ut extends I{constructor(){super(...arguments),this._$Cwt=ct,this._$Cbt=[],this._$CK=new de(this),this._$CX=new le}render(...e){return e.find((t)=>!lt(t))??y}update(e,t){let n=this._$Cbt,s=n.length;this._$Cbt=t;let o=this._$CK,i=this._$CX;this.isConnected||this.disconnected();for(let r=0;r<t.length&&!(r>this._$Cwt);r++){let a=t[r];if(!lt(a))return this._$Cwt=r,a;r<s&&a===n[r]||(this._$Cwt=ct,s=0,Promise.resolve(a).then(async(d)=>{for(;i.get();)await i.get();let u=o.deref();if(u!==void 0){let l=u._$Cbt.indexOf(a);l>-1&&l<u._$Cwt&&(u._$Cwt=l,u.setValue(d))}}))}return y}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}}var vn=m(ut);function wn(e,t,n){return e?t(e):n?.(e)}var ht=(e,t)=>{let n=t.getAttribute("data-key"),s=null;if(n!==null)s=`[data-key="${CSS.escape(n)}"]`;else if(t.id!=="")s=`#${CSS.escape(t.id)}`;let o=[],i=t;while(!0){let r=i.parentNode;if(r===null)return null;if(o.unshift({index:Array.prototype.indexOf.call(r.children,i),tagName:i.tagName}),r===e)return{selector:s,path:o};i=r}},pt=(e,t)=>{if(t.selector!==null){let s=e.querySelector(t.selector);if(s!==null)return s}let n=e;for(let s of t.path){let o=n.children[s.index];if(o===void 0||o.tagName!==s.tagName)return null;n=o}return n===e?null:n},Sn=(e)=>{if(!(e instanceof HTMLInputElement)&&!(e instanceof HTMLTextAreaElement))return null;if(e.selectionStart===null||e.selectionEnd===null)return null;return{start:e.selectionStart,end:e.selectionEnd,direction:e.selectionDirection??"none"}},Cn=(e)=>{if(e instanceof ShadowRoot)return e.activeElement;let t=document.activeElement;return t!==null&&t!==e&&e.contains(t)?t:null},ft=(e,t)=>{let n=Cn(e),s=n===null?null:ht(e,n),o=n===null?null:Sn(n),i=[];for(let r of t){if(t.delete(r),!e.contains(r)||r.scrollTop===0&&r.scrollLeft===0)continue;let a=ht(e,r);if(a!==null)i.push({locator:a,top:r.scrollTop,left:r.scrollLeft})}return()=>{for(let{locator:a,top:d,left:u}of i){let l=pt(e,a);if(l!==null)l.scrollTop=d,l.scrollLeft=u,t.add(l)}if(s===null||n?.isConnected)return;let r=pt(e,s);if(!(r instanceof HTMLElement||r instanceof SVGElement))return;if(r.focus({preventScroll:!0}),o!==null&&(r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement))try{r.setSelectionRange(o.start,o.end,o.direction)}catch{}}};var A=Symbol("pandora:propAttributes"),F=Symbol("pandora:decoratorEffects"),W=Symbol("pandora:decoratorTeardowns"),w=Symbol("pandora:watchHandlers"),v=Symbol("pandora:reactiveFields"),H=Symbol("pandora:listenHandlers"),ce=Symbol("pandora:styleMetadata"),j=Symbol("pandora:attrHandlers"),M=Symbol("pandora:subscribeHandlers"),Y=Symbol("pandora:pendingAttributeWrites"),mt=new Map,ue=(e,t,...n)=>{try{let s=e.apply(t,n);return s instanceof Promise?s:Promise.resolve(s)}catch(s){return Promise.reject(s)}},_e=(e)=>e!==null&&typeof e==="object"&&("_$litType$"in e),X=(e,t="",n=0)=>{let s=Object.keys(e),o="";for(let i of s){let r=e[i];if(typeof r==="object"&&r!==null){if(t&&!i.startsWith("@"))if(i.startsWith("&"))o+=`${i.replace(/&/g,t)} {
|
|
6
6
|
`;else if(i===":host")o+=`${t} {
|
|
7
7
|
`;else o+=`${t} ${i} {
|
|
8
8
|
`;else o+=`${i} {
|
|
9
|
-
`;let a=Object.keys(r);for(let
|
|
9
|
+
`;let a=Object.keys(r);for(let d of a){o+="\t".repeat(n);let u=r[d];if(typeof u==="object"&&u!==null){let l={};l[d]=u,o+=X(l,t,n+1)}else o+=` ${d}: ${u};
|
|
10
10
|
`}o+=`}
|
|
11
11
|
`}else o+="\t".repeat(n),o+=` ${i}: ${r};
|
|
12
|
-
`}return o},R=(e,t)=>{if(!Object.hasOwn(e,F)){let n=e[F];e[F]=n?[...n]:[]}e[F].push(t)},Z=(e,t)=>{if(!e[W])e[W]=[];e[W].push(t)},Ne=(e)=>{let t=e,n=t[Y];if(n===void 0)return;delete t[Y];for(let s of n.values())s()},
|
|
12
|
+
`}return o},R=(e,t)=>{if(!Object.hasOwn(e,F)){let n=e[F];e[F]=n?[...n]:[]}e[F].push(t)},Z=(e,t)=>{if(!e[W])e[W]=[];e[W].push(t)},Ne=(e)=>{let t=e,n=t[Y];if(n===void 0)return;delete t[Y];for(let s of n.values())s()},yt=(e)=>{let n=e[Symbol.metadata]?.[v];return new Set(n??[])},he=(e,t)=>{let n=e;if(!n._batching||!n._batchedChanges)return!1;let s=n._batchedChanges.find((o)=>o.property===t.property);if(s){if(s.newValue=t.newValue,t.shouldRender)s.shouldRender=!0}else n._batchedChanges.push({...t});return!0},An=(e)=>{let t=mt.get(e);if(!t)t=Symbol(`__pandora_reactive_${e}`),mt.set(e,t);return t},gt=(e,t,n={})=>{let s=An(t),o=n.equals??((r,a)=>r===a),i=n.render!==!1;if(e[s]===void 0)if(n.initialValue!==void 0)e[s]=n.initialValue;else{let r=Object.getOwnPropertyDescriptor(e,t);if(r&&"value"in r)e[s]=r.value}Object.defineProperty(e,t,{get(){return e[s]},set(r){let a=e[s];if(o(a,r))return;if(e[s]=r,n.onChange)n.onChange(r,a);if(he(e,{property:t,oldValue:a,newValue:r,shouldRender:i,source:"reactive"}))return;if(typeof Symbol.metadata<"u"){let u=e.constructor[Symbol.metadata]?.[w];if(u){for(let l of u)if(l.property===t){let c=e[l.methodName];if(typeof c==="function")c.call(e,r,a)}}}if(typeof e.didChange==="function")e.didChange(t,a,r,"reactive");if(i&&typeof e._queueRender==="function")e._queueRender()},enumerable:!0,configurable:!0})},P=(e)=>{if(e===null)return;if(e===""||e==="true")return!0;if(e==="false")return!1;let t=e.trim();if(/^[+-]?(?:0|[1-9]\d*)(?:\.\d+)?$/.test(t)){let n=Number(t);if(Number.isFinite(n))return n}return e},He=(e,t,n)=>{if(t==="window")return window;if(t==="document")return document;if(t&&t!=="self")return n?n(t):e.querySelector(t);return e},En=(e)=>e.nodeType===1,je=(e,t,n)=>{let s=e.currentTarget;if(s===null)return null;let o=typeof s.getRootNode==="function"?s.getRootNode():n.ownerDocument??document,i=new Set([o]);if(s===n&&n.shadowRoot)i.add(n.shadowRoot);for(let r of e.composedPath()){if(En(r)&&i.has(r.getRootNode())&&r.matches(t))return r;if(r===s)break}return null};var ve=new WeakMap,Tn=new Set,$n=(e)=>{let t=Object.keys(e);if(t.length===0)return;let n=e,s=new Map;for(let o of t)s.set(o,n[o]),delete n[o];return s};class g extends HTMLElement{_valuesBeforeUpgrade=$n(this);_scrolledElements=new Set;_connectedAs;_children;_connected;_isReady;_hasBeenMounted;_initRenderDone;_renderId;_renderQueued;_lastRenderType;_style;_batching;_batchedChanges;static _tag;static _template;static keepFocusAndScroll=!1;static _observedAttributes=[];static _styleSheet=null;static _sharedStyle={};static _onMount;static _onUnmount;static _onError;static _applyMiddleware;static _hasMiddleware;static _subscribe;static _getGlobalState;static _applyCurrentImplementation;static _activateSubscription(e,t){if(!g._subscribe)return;let n=e;if(n[t.unsubKey])n[t.unsubKey](),n[t.unsubKey]=void 0;n[t.unsubKey]=g._subscribe(t.stateKey,(o)=>{let i=n[t.valueKey];if(i===o)return;if(n[t.valueKey]=o,e.didChange(t.propertyKey,i,o,"consumer"),e.isReady)e._queueRender()});let s=g._getGlobalState?.(t.stateKey);if(s!==void 0)n[t.valueKey]=s}static get observedAttributes(){if(typeof Symbol.metadata<"u"){let t=this[Symbol.metadata]?.[A];if(t?.length)return[...new Set([...this._observedAttributes,...t])]}return this._observedAttributes}static set observedAttributes(e){this._observedAttributes=e}static get tag(){if(typeof this._tag>"u"){let e=this.name,t=e.match(/([A-Z])/g);if(t!==null)for(let n of t)e=e.replace(n,`-${n}`.toLowerCase());this._tag=e.slice(1)}return this._tag}static set tag(e){this._tag=e}static get template(){return this._template}static set template(e){if(this._template=e,e!==void 0)document.querySelectorAll(this.tag).forEach((t)=>{if(t instanceof g&&t._isReady)t.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=[],this._trackScrolling(this)}static connectedInstances(){return ve.get(this)??Tn}_renderRoot(){return this}_trackScrolling(e){e.addEventListener("scroll",(t)=>{if(t.target instanceof Element&&t.target!==this)this._scrolledElements.add(t.target)},{capture:!0,passive:!0})}_assignValuesBeforeUpgrade(){let e=this._valuesBeforeUpgrade;if(e===void 0)return;this._valuesBeforeUpgrade=void 0;let t=this.constructor.tag;for(let[n,s]of e)try{this[n]=s}catch(o){console.warn(`[Pandora] <${t}> was given \`${n}\` before it was defined, and the value couldn't be kept: ${o.message}`)}}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(g._registryRegister)g._registryRegister(this.tag,this);else window.customElements.define(this.tag,this)}get isBatching(){return this._batching}batch(e){this._batching=!0,this._batchedChanges=[];try{e()}finally{this._batching=!1;let t=this._batchedChanges;if(this._batchedChanges=[],t.length>0){let n=!1;for(let{property:s,oldValue:o,newValue:i,shouldRender:r,source:a}of t){if(o===i)continue;if(r)n=!0;if(typeof Symbol.metadata<"u"){let u=this.constructor[Symbol.metadata]?.[w];if(u){for(let l of u)if(l.property===s){let c=this[l.methodName];if(typeof c==="function")c.call(this,i,o)}}}this.didChange(s,o,i,a)}if(n&&this._initRenderDone&&this._connected)this._queueRender()}}}_queueRender(){if(this._renderQueued||!this._connected)return;this._renderQueued=!0,queueMicrotask(()=>{if(this._renderQueued=!1,this._connected)this._render().catch((e)=>{let t=this.constructor.tag;if(g._onError)g._onError(e,this,t,"render");else{let n=this.id?`#${this.id}`:this.className?`.${this.className.split(/\s+/).join(".")}`:"";console.error(`[Pandora] Unhandled render error in <${t}${n}>:`,e,this)}})})}forceRender(){return this._render()}render(){}_applyLitRender(e){if(!this.hasAttribute("data-lit-rendered"))this.innerHTML="",this.setAttribute("data-lit-rendered","");z(e,this,{host:this})}_applyStringRender(e){if(e===""){this.innerHTML="";return}let t=document.createElement("template");t.innerHTML=e;let n=t.content.querySelector("slot");if(n!==null){let s=document.createElement("template");s.innerHTML=this._children,n.replaceWith(s.content),this.innerHTML="",this.appendChild(t.content)}else if(this.innerHTML=e,this._children!==""&&e.indexOf(this._children)===-1)this.innerHTML+=this._children}_resetRenderRoot(){this.innerHTML="",this.removeAttribute("data-lit-rendered"),delete this._$litPart$}async _render(){let e=++this._renderId,t=this.constructor,n=this.render;if(t._template!==void 0)n=()=>{if(typeof t._template==="function")return t._template.call(this,this);return t._template};let s=await ue(n,this);if(e!==this._renderId)return;if(s===void 0||s===null){this._syncListenersAfterRender(),await ue(this.didRender,this);return}let o=_e(s)||s===f?"lit":"string";if(g._hasMiddleware?.("render")&&g._applyMiddleware)s=g._applyMiddleware("render",this,s,o);let i=_e(s)||s===f,r=i?"lit":"string";if(!i&&typeof s!=="string"){let d=Array.isArray(s)?"an array":`a ${typeof s}`;throw TypeError(`[Pandora] <${t.tag}>'s render() returned ${d}. Return a string, an html\`\` template, \`nothing\` (to clear the content) or undefined (to leave it as it is). To render a list, put it in a template: html\`\${items}\`.`)}let a=!i&&t.keepFocusAndScroll?ft(this._renderRoot(),this._scrolledElements):null;if(this._lastRenderType!==void 0&&this._lastRenderType!==r)this._resetRenderRoot();if(i)this._applyLitRender(s);else this._applyStringRender(s.trim()),a?.();this._lastRenderType=r,this._syncListenersAfterRender(),await ue(this.didRender,this)}setStyle(e,t=!1){let n=this.constructor;if(!n._styleSheet)n._styleSheet=new CSSStyleSheet;let s="";if(typeof e==="object"){if(!Object.hasOwn(n,"_sharedStyle"))n._sharedStyle={};if(!t)n._sharedStyle={...n._sharedStyle,...e};else n._sharedStyle={...e};this._style=n._sharedStyle,s=X(n._sharedStyle,n.tag)}else if(typeof e==="string")if(!t)s=Array.from(n._styleSheet.cssRules||[]).map((i)=>i.cssText).join(`
|
|
13
13
|
`)+`
|
|
14
|
-
`+e;else s=e,n._sharedStyle={},this._style={};if(n._styleSheet.replaceSync(s),!document.adoptedStyleSheets.includes(n._styleSheet))document.adoptedStyleSheets=[...document.adoptedStyleSheets,n._styleSheet];return n._sharedStyle}on(e,t,n){return this.addEventListener(e,t,n),this}off(e,t,n){return this.removeEventListener(e,t,n),this}once(e,t,n){let s=typeof n==="boolean"?{capture:n,once:!0}:{...n,once:!0};return this.addEventListener(e,t,s),this}emit(e,t,n){let s=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0,composed:!0,...n});return this.dispatchEvent(s)}query(e){return this.querySelector(e)}queryAll(e){return this.querySelectorAll(e)}_readyCallbacks;ready(e){if(this._isReady)queueMicrotask(e);else this._readyCallbacks??=[],this._readyCallbacks.push(e)}willMount(){}didMount(){}didRender(){}didReconnect(){}willUnmount(){}didUnmount(){}didChange(e,t,n,s){}_countAsConnected(){let e=this.constructor,t=ve.get(e);if(t===void 0)t=new Set,ve.set(e,t);t.add(this),this._connectedAs=e}_stopCountingAsConnected(){if(this._connectedAs!==void 0)ve.get(this._connectedAs)?.delete(this),this._connectedAs=void 0}async connectedCallback(){let e=this.constructor,t=e.tag;try{if(this._connected=!0,this._countAsConnected(),this.dataset.component=t,g._applyCurrentImplementation?.(this,t),typeof Symbol.metadata<"u"){let o=this.constructor[Symbol.metadata]?.[M];if(o)for(let i of o)g._activateSubscription(this,i)}let n=!this._hasBeenMounted;if(n)this._children=this.innerHTML.trim(),this._assignValuesBeforeUpgrade();if(Ne(this),n&&e._template===void 0){let s=document.querySelector(`template#${t}`);if(s)e._template=s.innerHTML}if(n&&typeof Symbol.metadata<"u"&&!Object.hasOwn(e,"_styleMetaApplied")){let o=e[Symbol.metadata]?.[ce];if(o)e._styleMetaApplied=!0,this.setStyle(o,!0)}if(await this.willMount(),await this._render(),this._initRenderDone=!0,n)await this.didMount();else await this.didReconnect();if(this._hasBeenMounted=!0,this._isReady=!0,this._readyCallbacks){for(let s of this._readyCallbacks)s();this._readyCallbacks=void 0}g._onMount?.(this,t),this.emit("pandora:ready",{firstMount:n,tag:t},{bubbles:!0,composed:!0})}catch(n){if(g._onError)g._onError(n,this,t,"connectedCallback");else throw n}}async disconnectedCallback(){let e=this.constructor,t=e.tag;this._connected=!1,this._isReady=!1,this._stopCountingAsConnected();try{if(this.emit("pandora:unmount",{tag:t},{bubbles:!0,composed:!0}),typeof Symbol.metadata<"u"){let s=e[Symbol.metadata]?.[M];if(s){let o=this;for(let i of s)if(o[i.unsubKey])o[i.unsubKey](),o[i.unsubKey]=void 0}}this._detachListeners(),await this.willUnmount(),await this.didUnmount(),g._onUnmount?.(this,t)}catch(n){if(g._onError)g._onError(n,this,t,"disconnectedCallback");else throw n}}attributeChangedCallback(e,t,n){if(typeof Symbol.metadata>"u")return;let o=this.constructor[Symbol.metadata],i=o?.[j];if(!i)return;let r=this;for(let a of i){if(a.attrName!==e)continue;if(r[a.settingKey])continue;let l=n!==null?P(n):void 0,u=r[a.valueKey];if(a.equals(u,l))continue;r[a.valueKey]=l;let d=o?.[w];if(d){for(let c of d)if(c.property===a.propertyKey){let h=this[c.methodName];if(typeof h==="function")h.call(this,l,u)}}if(this.didChange(a.propertyKey,u,l,"prop-attribute"),a.shouldRender&&this._initRenderDone&&this._connected)this._queueRender()}}_activeListeners=[];_listenersAttached=!1;_consumedOnceListeners=new Set;_listenerMetadata(){if(typeof Symbol.metadata>"u")return;return this.constructor[Symbol.metadata]?.[H]}static _isDynamicListenerTarget(e){return!!(e&&e!=="self"&&e!=="window"&&e!=="document")}_bindListener(e,t){let n=e.options;if(n?.once&&this._consumedOnceListeners.has(t))return!1;let s=this[e.methodName];if(typeof s!=="function")return!1;let o=g._isDynamicListenerTarget(n?.target),i=He(this,n?.target,(u)=>this.query(u));if(!i)return!1;let r=s.bind(this),a={};if(n?.capture)a.capture=!0;if(n?.passive)a.passive=!0;let l;if(n?.delegate){let u=n.delegate,d=n?.once;l=(c)=>{if(c.target?.closest(u)){if(d)this._consumedOnceListeners.add(t),i.removeEventListener(e.event,l,a),this._activeListeners=this._activeListeners.filter((p)=>p.handler!==l);r(c)}}}else if(n?.once)l=(u)=>{this._consumedOnceListeners.add(t),this._activeListeners=this._activeListeners.filter((d)=>d.handler!==l),r(u)},a.once=!0;else l=r;return i.addEventListener(e.event,l,a),this._activeListeners.push({target:i,event:e.event,handler:l,options:a,dynamic:o,index:t}),!0}_attachListeners(){let e=this._listenerMetadata();if(!e)return;e.forEach((t,n)=>this._bindListener(t,n))}_refreshDynamicListeners(){let e=[];for(let n of this._activeListeners)if(n.dynamic)n.target.removeEventListener(n.event,n.handler,n.options);else e.push(n);this._activeListeners=e;let t=this._listenerMetadata();if(!t)return;t.forEach((n,s)=>{if(g._isDynamicListenerTarget(n.options?.target))this._bindListener(n,s)})}_syncListenersAfterRender(){if(this._listenersAttached)this._refreshDynamicListeners();else this._attachListeners(),this._listenersAttached=!0}_detachListeners(){for(let{target:e,event:t,handler:n,options:s}of this._activeListeners)e.removeEventListener(t,n,s);this._activeListeners=[],this._listenersAttached=!1,this._consumedOnceListeners.clear()}}var C=g;var bt=Symbol("pandora:appliedImpl"),_t=Symbol.for("@aegis-framework/pandora"),vt="0.7.0";class J{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 lazyLoadPromises={};static middleware={render:new Set};static _initialized=!1;static _init(){if(this._initialized)return;this._initialized=!0,C._onMount=(e,t)=>this._notifyMount(e,t),C._onUnmount=(e,t)=>this._notifyUnmount(e,t),C._onError=(e,t,n,s)=>this._notifyError(e,t,n,s),C._applyMiddleware=(e,t,n,s)=>this._applyMiddleware(e,t,n,s),C._hasMiddleware=(e)=>this._hasMiddleware(e),C._subscribe=(e,t)=>this.subscribe(e,t),C._getGlobalState=(e)=>this.getState(e),C._applyCurrentImplementation=(e,t)=>{let n=this.implementations[t];if(!n)return;let i=e[bt]??e.constructor;if(n===i)return;this._applyImplementation(e,n,!1)}}static register(e,t){if(this._init(),typeof this.components[e]>"u")this.components[e]=t,this.implementations[e]=t,t.tag=e,window.customElements.define(e,t),this.components[e]._registered=!0,this.log(`Registered: <${e}>`);else throw Error(`[Pandora] <${e}> is already registered. Use Registry.evolve('${e}', NewClass) to swap its implementation.`)}static define(e,t){this.register(e,t)}static getImplementation(e){return this.implementations[e]||this.components[e]}static _applyImplementation(e,t,n=!1){let s=t.prototype,o=Object.getOwnPropertyNames(s),i=e;e[bt]=t;for(let r of o){if(r==="constructor")continue;let a=Object.getOwnPropertyDescriptor(s,r);if(!a)continue;if(typeof a.value==="function")i[r]=a.value.bind(e);else if(a.get||a.set)Object.defineProperty(Object.getPrototypeOf(e),r,a)}try{let r=customElements.get(e.localName)??e.constructor??t,a=Reflect.construct(t,[],r);for(let l of Object.keys(a))if(!(l in i)||i[l]===void 0)i[l]=a[l]}catch(r){console.warn(`[Pandora] Could not construct temp instance of <${t.tag}> for default extraction:`,r)}if(typeof Symbol.metadata<"u"){let r=t[Symbol.metadata];if(r){let a=e.constructor;a[Symbol.metadata]=r}}if(typeof Symbol.metadata<"u"){let a=t[Symbol.metadata]?.[F];if(a?.length){let l=i[W];if(l)for(let u of l)u();i[W]=[];for(let u of a)u(e)}}e._detachListeners()}static evolve(e,t,n=!1){if(typeof this.components[e]>"u")throw Error(`[Pandora] Cannot evolve <${e}>: no component with that tag has been registered.`);this.implementations[e]=t,t._registered=!0;let s=[];for(let[o,i]of Object.entries(this.aliases))if(i===e)s.push(o),this.implementations[o]=t;if(this.log(`Evolved: <${e}>`),n){let o=[e,...s];for(let i of o)document.querySelectorAll(i).forEach((r)=>{if(r instanceof C&&r.isReady)this._applyImplementation(r,t,!0),r.forceRender()})}}static instances(e,t){if(typeof this.components[e]>"u")throw Error(`[Pandora] No component with tag <${e}> has been registered.`);if(typeof t==="function")document.querySelectorAll(e).forEach(t);else return document.querySelectorAll(e)}static instantiate(e,t={}){if(!this.has(e))throw Error(`[Pandora] No component with tag <${e}> has been registered.`);if(!this.components[e]._registered)this.register(e,this.components[e]);let n=document.createElement(this.components[e].tag);for(let[s,o]of Object.entries(t)){if(o===void 0||o===null)continue;if(n[s]=o,Object.getOwnPropertyDescriptor(n,s)?.set!==void 0)continue;if(typeof o==="boolean"){if(o)n.setAttribute(s,"")}else if(typeof o==="string"||typeof o==="number")n.setAttribute(s,String(o))}return n}static has(e){return typeof this.components[e]<"u"}static get(e){return this.components[e]}static setState(e,t){let n=this.state[e];if(this.state[e]=t,this.subscribers[e])this.subscribers[e].forEach((s)=>{s(t,n)})}static getState(e){return this.state[e]}static hasState(e){return e in this.state}static deleteState(e){if(e in this.state){let t=this.state[e];if(delete this.state[e],this.subscribers[e])this.subscribers[e].forEach((n)=>{n(void 0,t)});return!0}return!1}static subscribe(e,t){if(!this.subscribers[e])this.subscribers[e]=new Set;return this.subscribers[e].add(t),()=>{this.unsubscribe(e,t)}}static unsubscribe(e,t){if(this.subscribers[e])this.subscribers[e].delete(t)}static getAllState(){return{...this.state}}static clearState(){let e=Object.keys(this.state);for(let t of e)this.deleteState(t)}static clearSubscriptions(){for(let e of Object.keys(this.subscribers))this.subscribers[e]=new Set}static clearMiddleware(){for(let e of Object.keys(this.middleware))this.middleware[e]=new Set}static get debug(){return this._debug}static set debug(e){this._debug=e}static log(e,t){if(this._debug)if(t!==void 0)console.log(`[Pandora] ${e}`,t);else console.log(`[Pandora] ${e}`)}static list(){return Object.keys(this.components)}static stats(e){if(e){if(!this.has(e))throw Error(`[Pandora] No component with tag <${e}> has been registered.`);return{tag:e,instanceCount:document.querySelectorAll(e).length,isRegistered:this.components[e]?._registered??!1,isLazy:e in this.lazyLoaders}}return this.list().map((t)=>({tag:t,instanceCount:document.querySelectorAll(t).length,isRegistered:this.components[t]?._registered??!1,isLazy:t in this.lazyLoaders}))}static onMount(e){return this._init(),this.mountCallbacks.add(e),()=>this.mountCallbacks.delete(e)}static onUnmount(e){return this._init(),this.unmountCallbacks.add(e),()=>this.unmountCallbacks.delete(e)}static _notifyMount(e,t){this.log(`Mounted: <${t}>`),this.mountCallbacks.forEach((n)=>{try{n(e,t)}catch(s){console.error("[Pandora] Error in onMount callback:",s)}})}static _notifyUnmount(e,t){this.log(`Unmounted: <${t}>`),this.unmountCallbacks.forEach((n)=>{try{n(e,t)}catch(s){console.error("[Pandora] Error in onUnmount callback:",s)}})}static onError(e){return this._init(),this.errorCallbacks.add(e),()=>this.errorCallbacks.delete(e)}static _notifyError(e,t,n,s){if(this.log(`Error in <${n}> during ${s}:`,e),this.errorCallbacks.size===0)throw e;this.errorCallbacks.forEach((o)=>{try{o(e,t,n,s)}catch(i){console.error("[Pandora] Error in onError callback:",i)}})}static alias(e,t){if(!this.has(t))throw Error(`[Pandora] Cannot alias <${e}>: no component with tag <${t}> has been registered.`);if(this.has(e))throw Error(`[Pandora] Cannot alias <${e}>: a component with that tag already exists.`);this.aliases[e]=t;let n=this.getImplementation(t)??this.components[t],s=class extends n{static _tag=e};this.components[e]=s,this.implementations[e]=s,window.customElements.define(e,s),s._registered=!0,this.log(`Created alias: <${e}> -> <${t}>`)}static getOriginalTag(e){return this.aliases[e]}static isAlias(e){return e in this.aliases}static lazy(e,t){if(this._init(),this.has(e))throw Error(`[Pandora] Cannot register lazy <${e}>: a component with that tag already exists.`);this.lazyLoaders[e]=t;let n=J;class s extends C{static _tag=e;_lazyLoaded=!1;async connectedCallback(){await n._loadLazyComponent(e);let o=n.getImplementation(e);if(o&&o!==s)J._applyImplementation(this,o,!1),this._lazyLoaded=!0;await super.connectedCallback()}}this.components[e]=s,window.customElements.define(e,s),this.log(`Registered lazy component: <${e}>`)}static async _loadLazyComponent(e){if(this.lazyLoadPromises[e])return this.lazyLoadPromises[e];if(!(e in this.lazyLoaders))return;let t=this.lazyLoaders[e];return this.log(`Loading lazy component: <${e}>`),this.lazyLoadPromises[e]=(async()=>{try{let n=await t(),s="default"in n?n.default:n;delete this.lazyLoaders[e],this.implementations[e]=s,s._registered=!0,this.log(`Loaded lazy component: <${e}>`)}catch(n){throw console.error(`[Pandora] Failed to load lazy component <${e}>:`,n),n}finally{delete this.lazyLoadPromises[e]}})(),this.lazyLoadPromises[e]}static isLazy(e){return e in this.lazyLoaders}static async preload(e){if(this.isLazy(e))await this._loadLazyComponent(e)}static use(e,t){return this._init(),this.middleware[e].add(t),()=>this.middleware[e].delete(t)}static _applyMiddleware(e,t,n,s){let o=n;return this.middleware[e].forEach((i)=>{try{o=i(t,o,s)}catch(r){console.error(`[Pandora] Error in ${e} middleware:`,r)}}),o}static _hasMiddleware(e){return this.middleware[e].size>0}}C._registryRegister=(e,t)=>J.register(e,t);var Tn=(e,t,n=globalThis)=>{let s=n,o=s[_t];if(o===void 0||o===null)return s[_t]={version:t,registry:e},!0;if(o.registry===e)return!0;let i=o.version===t?`both are version ${t}`:`the first is version ${o.version}, this one is version ${t}`;return console.error(`[Pandora] Two copies of @aegis-framework/pandora are loaded (${i}). Each copy has its own Registry, so components, global state and middleware registered with one are unknown to the other, and a tag both define throws. To fix it, install a single copy (run \`npm ls @aegis-framework/pandora\` and dedupe it), import Pandora only by its package name, and don't load the browser bundle (pandora.browser.js) on a page that also bundles the package.`),!1};Tn(J,vt);var E=J;var $n=new Set(["accessKey","autocapitalize","autocorrect","autofocus","className","contentEditable","dir","draggable","enterKeyHint","hidden","id","inert","innerHTML","innerText","inputMode","lang","nonce","outerHTML","part","popover","role","slot","spellcheck","style","tabIndex","textContent","title","translate","writingSuggestions"]),wt=new WeakMap;Symbol.metadata??=Symbol("Symbol.metadata");var T=(e,t)=>{if(typeof t==="object"&&t!==null&&"kind"in t)return;throw TypeError(`[Pandora] @${e} was called as a legacy decorator. Pandora's decorators are standard decorators: remove "experimentalDecorators" from tsconfig.json (or set it to false), and if Babel compiles your code, set @babel/plugin-proposal-decorators to { version: "2023-11" }.`)},Rn=(e,t)=>(n,s)=>{T("Register",s);let o=s.metadata;if(o?.[A]){if(!Object.hasOwn(n,"_observedAttributes"))n._observedAttributes=[];for(let i of o[A])if(!n._observedAttributes.includes(i))n._observedAttributes.push(i)}if(o&&n[Symbol.metadata]===void 0)n[Symbol.metadata]=o;if(n.tag=e,!t?.defer)E.register(e,n);return n},kn=(e)=>(t,n)=>{T("Style",n);let s=n.metadata;return s[ce]=e,t},Ln=(e)=>(t,n)=>{T("Watch",n);let s=String(n.name),o=n.metadata;if(!Object.hasOwn(o,w)){let r=o[w];o[w]=r?[...r]:[]}o[w].push({property:e,methodName:s});let i=!1;n.addInitializer(function(){if(i)return;i=!0;let r=this;queueMicrotask(()=>{if(o[v]?.has(e)||Object.getOwnPropertyDescriptor(r,e)?.set)return;let l=r.constructor?.name||"<anonymous>";console.warn(`[Pandora] @Watch('${e}') on ${l}.${s}(): '${e}' is not reactive. Add @State, @Attribute, @Property, or @Subscribe to '${e}', or call reactive(this, '${e}') in the constructor — otherwise the watcher will never fire.`)})})},kt=(e,t)=>{if(typeof Symbol.metadata>"u")return[];let s=e.constructor[Symbol.metadata]?.[w];if(!s)return[];let o=[];for(let i of s)if(i.property===t){let r=e[i.methodName];if(typeof r==="function")o.push(r.bind(e))}return o},xn=(e)=>{if($n.has(e)||/^aria[A-Z]/.test(e))return!0;return typeof HTMLElement<"u"&&e in HTMLElement.prototype},je=(e,t,n)=>{if(!xn(t))return;n.addInitializer(function(){let s=this.constructor,o=wt.get(s);if(o===void 0)o=new Set,wt.set(s,o);if(o.has(t))return;o.add(t),console.warn(`[Pandora] ${s.name||"A component"}: @${e}() ${t} has the name of the element's own \`${t}\` property and replaces it, so the browser's behavior for \`${t}\` stops working on this element and code that uses \`element.${t}\` gets the field instead. Rename the field.`)})},Lt=(e,t,n)=>{let s=Object.getOwnPropertyDescriptor(e,t);if(s&&"value"in s&&s.value!==void 0&&e[n]===void 0)e[n]=s.value},xt=(e,t)=>{if(!Object.hasOwn(e,j)){let n=e[j];e[j]=n?[...n]:[]}e[j].push(t)},St=(e,t,n)=>{if(typeof n==="boolean")if(n)e.setAttribute(t,"");else e.removeAttribute(t);else if(typeof n==="string"||typeof n==="number")e.setAttribute(t,String(n))},we=(e,t,n)=>{if(e.isConnected){St(e,t,e[n]);return}let s=e[Y];if(s===void 0)s=new Map,e[Y]=s;s.set(t,()=>{if(!e.hasAttribute(t))St(e,t,e[n])})},Se=(e,t,n,s,o,i=!0,r=(a,l)=>a===l)=>{if(Lt(e,n,s),Object.defineProperty(e,n,{get(){if(e[s]!==void 0)return e[s];if(e.hasAttribute(t))return P(e.getAttribute(t));return},set(a){let l=e[s];if(e[s]=a,e[o]=!0,a===void 0||a===null)e.removeAttribute(t);else if(typeof a==="string"||typeof a==="number"||typeof a==="boolean")if(typeof a==="boolean")if(a)e.setAttribute(t,"");else e.removeAttribute(t);else e.setAttribute(t,String(a));if(e[o]=!1,!r(l,a)){if(!he(e,{property:n,oldValue:l,newValue:a,shouldRender:i,source:"prop"})){let u=kt(e,n);for(let d of u)d(a,l);if(e.didChange(n,l,a,"prop"),i&&e._initRenderDone&&e.isConnected)e._queueRender()}}},enumerable:!0,configurable:!0}),e.isConnected&&e.hasAttribute(t))e[s]=P(e.getAttribute(t));Z(e,()=>{delete e[n]})},Ce=(e,t,n,s,o="state",i=(r,a)=>r===a)=>{Lt(e,t,n),Object.defineProperty(e,t,{get(){return e[n]},set(r){let a=e[n];if(i(a,r))return;if(e[n]=r,he(e,{property:t,oldValue:a,newValue:r,shouldRender:s,source:o}))return;let l=kt(e,t);for(let u of l)u(r,a);if(e.didChange(t,a,r,o),s&&e._initRenderDone&&e.isConnected)e._queueRender()},enumerable:!0,configurable:!0}),Z(e,()=>{delete e[t]})},Pn=(e)=>(t,n)=>{T("State",n);let s=String(n.name);je("State",s,n);let o=e?.render!==!1,i=Symbol(`__pandora_state_${s}`),r,a=!1,l=n.metadata;if(!Object.hasOwn(l,v)){let u=l[v];l[v]=u?new Set(u):new Set}l[v].add(s),R(l,(u)=>{if(Ce(u,s,i,o),a&&u[i]===void 0)u[i]=r}),n.addInitializer(function(){let u=this,d=u[s];if(Ce(u,s,i,o),d!==void 0){if(u[i]=d,!a)r=d,a=!0}})},On=(e)=>(t,n)=>{T("Property",n);let s=String(n.name);je("Property",s,n);let o=Symbol(`__pandora_property_${s}`),i=e?.equals??((d,c)=>d===c),r=e?.attribute===!0?s:e?.attribute??!1,a,l=!1,u=n.metadata;if(!Object.hasOwn(u,v)){let d=u[v];u[v]=d?new Set(d):new Set}if(u[v].add(s),r!==!1){let d=Symbol(`__pandora_propSetting_${s}`);if(!Object.hasOwn(u,A)){let c=u[A];u[A]=c?[...c]:[]}if(!u[A].includes(r))u[A].push(r);xt(u,{attrName:r,propertyKey:s,valueKey:o,settingKey:d,shouldRender:!1,equals:i}),R(u,(c)=>{if(Se(c,r,s,o,d,!1,i),l&&c[o]===void 0)if(c.hasAttribute(r))c[o]=P(c.getAttribute(r));else c[o]=a,we(c,r,s)}),n.addInitializer(function(){let c=this,h=c[s],p=c.hasAttribute(r),S=p?P(c.getAttribute(r)):void 0;if(Se(c,r,s,o,d,!1,i),h!==void 0&&!l)a=h,l=!0;if(p)c[o]=S;else if(h!==void 0)c[o]=h,we(c,r,s)})}else R(u,(d)=>{if(Ce(d,s,o,!1,"property",i),l&&d[o]===void 0)d[o]=a}),n.addInitializer(function(){let d=this,c=d[s];if(Ce(d,s,o,!1,"property",i),c!==void 0){if(d[o]=c,!l)a=c,l=!0}})},Dn=(e)=>(t,n)=>{T("Attribute",n);let s=String(n.name);je("Attribute",s,n);let o,i=!0;if(typeof e==="object")o=s,i=e.render!==!1;else o=e??s;let r=Symbol(`__pandora_attr_${s}`),a=n.metadata;if(!Object.hasOwn(a,v)){let d=a[v];a[v]=d?new Set(d):new Set}a[v].add(s);let l,u=!1;{let d=Symbol(`__pandora_propSetting_${s}`);if(!Object.hasOwn(a,A)){let c=a[A];a[A]=c?[...c]:[]}if(!a[A].includes(o))a[A].push(o);xt(a,{attrName:o,propertyKey:s,valueKey:r,settingKey:d,shouldRender:i,equals:(c,h)=>c===h}),R(a,(c)=>{if(Se(c,o,s,r,d,i),u&&c[r]===void 0)if(c.hasAttribute(o))c[r]=P(c.getAttribute(o));else c[r]=l,we(c,o,s)}),n.addInitializer(function(){let c=this,h=c[s],p=c.hasAttribute(o),S=p?P(c.getAttribute(o)):void 0;if(Se(c,o,s,r,d,i),h!==void 0&&!u)l=h,u=!0;if(p)c[r]=S;else if(h!==void 0)c[r]=h,we(c,o,s)})}},Ct=(e,t,n,s,o)=>{if(Object.defineProperty(e,n,{get(){return e[o]},set(i){let r=e[o];if(r===i)return;if(e[o]=i,E.setState(t,i),e.didChange(n,r,i,"consumer"),e.isReady)e._queueRender()},enumerable:!0,configurable:!0}),e.isConnected)C._activateSubscription?.(e,{stateKey:t,propertyKey:n,unsubKey:s,valueKey:o});Z(e,()=>{if(e[s])e[s](),e[s]=void 0;delete e[n]})},Mn=(e)=>(t,n)=>{T("Subscribe",n);let s=String(n.name),o=Symbol(`__pandora_unsub_${s}`),i=Symbol(`__pandora_value_${s}`),r=n.metadata;if(!Object.hasOwn(r,v)){let a=r[v];r[v]=a?new Set(a):new Set}if(r[v].add(s),!Object.hasOwn(r,M)){let a=r[M];r[M]=a?[...a]:[]}r[M].push({stateKey:e,propertyKey:s,unsubKey:o,valueKey:i}),R(r,(a)=>{Ct(a,e,s,o,i)}),n.addInitializer(function(){Ct(this,e,s,o,i)})},At=(e,t,n)=>{Object.defineProperty(e,t,{get(){return e.query(n)},enumerable:!0,configurable:!0})},In=(e)=>(t,n)=>{T("Query",n);let s=String(n.name),o=n.metadata;R(o,(i)=>{At(i,s,e)}),n.addInitializer(function(){At(this,s,e)})},Et=(e,t,n)=>{Object.defineProperty(e,t,{get(){return e.queryAll(n)},enumerable:!0,configurable:!0})},Nn=(e)=>(t,n)=>{T("QueryAll",n);let s=String(n.name),o=n.metadata;R(o,(i)=>{Et(i,s,e)}),n.addInitializer(function(){Et(this,s,e)})},Tt=(e,t,n)=>{Object.defineProperty(e,t,{get(){return(e._shadowDOM||e.shadowRoot)?.querySelector(n)??null},enumerable:!0,configurable:!0})},Hn=(e)=>(t,n)=>{T("Slot",n);let s=String(n.name),o=e?`slot[name="${e}"]`:"slot:not([name])",i=n.metadata;R(i,(r)=>{Tt(r,s,o)}),n.addInitializer(function(){Tt(this,s,o)})},jn=(e,t)=>(n,s)=>{T("Listen",s);let o=String(s.name),i=s.metadata;if(!Object.hasOwn(i,H)){let r=i[H];i[H]=r?[...r]:[]}i[H].push({event:e,methodName:o,options:t})},$t=(e,t,n,s,o)=>{e[`__invalidate_${t}`]=()=>{e[s]=!1},Object.defineProperty(e,t,{get(){if(!e[s])e[n]=o.call(e),e[s]=!0;return e[n]},enumerable:!0,configurable:!0})},Vn=(...e)=>(t,n)=>{T("Computed",n);let s=String(n.name),o=Symbol(`__pandora_computed_cache_${s}`),i=Symbol(`__pandora_computed_valid_${s}`),r=n.metadata;for(let l of e){if(!Object.hasOwn(r,w)){let u=r[w];r[w]=u?[...u]:[]}r[w].push({property:l,methodName:`__invalidate_${s}`})}let a=t;return R(r,(l)=>{$t(l,s,o,i,a)}),n.addInitializer(function(){$t(this,s,o,i,a)}),t},qn=(e)=>(t,n)=>{T("ClassList",n);let s=n.metadata,o=[],i=[];for(let[a,l]of Object.entries(e))if(typeof l==="string"){if(o.push({className:a,propertyName:l}),!Object.hasOwn(s,w)){let d=s[w];s[w]=d?[...d]:[]}let u=`__classlist_${a}_${l}`;s[w].push({property:l,methodName:u}),t.prototype[u]=function(){this.classList.toggle(a,!!this[l])}}else i.push({className:a,conditionFn:l});if(i.length>0){let a=t.prototype.didChange;t.prototype.didChange=function(l,u,d,c){a?.call(this,l,u,d,c);for(let{className:h,conditionFn:p}of i)this.classList.toggle(h,p(this))}}let r=t.prototype.connectedCallback;return t.prototype.connectedCallback=async function(){await r?.call(this);for(let{className:a,propertyName:l}of o)this.classList.toggle(a,!!this[l]);for(let{className:a,conditionFn:l}of i)this.classList.toggle(a,l(this))},t},Rt=(e,t,n)=>{Object.defineProperty(e,t,{value:(s)=>e.emit(n,s),writable:!1,enumerable:!0,configurable:!0})},Bn=(e)=>(t,n)=>{T("Emitter",n);let s=String(n.name),o=n.metadata;R(o,(i)=>{Rt(i,s,e)}),n.addInitializer(function(){Rt(this,s,e)})};class Pt extends C{_shadowDOM;static _styleSheet=null;static _sharedStyle={};constructor(){super();this._shadowDOM=this.attachShadow({mode:"open"}),this._trackScrolling(this._shadowDOM)}setStyle(e,t=!1){let n=this.constructor;if(!n._styleSheet)n._styleSheet=new CSSStyleSheet;let s="";if(typeof e==="object"){if(!Object.hasOwn(n,"_sharedStyle"))n._sharedStyle={};if(!t)n._sharedStyle={...n._sharedStyle,...e};else n._sharedStyle={...e};this._style=n._sharedStyle,s=X(n._sharedStyle)}else if(typeof e==="string")if(!t)s=Array.from(n._styleSheet.cssRules||[]).map((i)=>i.cssText).join(`
|
|
14
|
+
`+e;else s=e,n._sharedStyle={},this._style={};if(n._styleSheet.replaceSync(s),!document.adoptedStyleSheets.includes(n._styleSheet))document.adoptedStyleSheets=[...document.adoptedStyleSheets,n._styleSheet];return n._sharedStyle}on(e,t,n){return this.addEventListener(e,t,n),this}off(e,t,n){return this.removeEventListener(e,t,n),this}once(e,t,n){let s=typeof n==="boolean"?{capture:n,once:!0}:{...n,once:!0};return this.addEventListener(e,t,s),this}emit(e,t,n){let s=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0,composed:!0,...n});return this.dispatchEvent(s)}query(e){return this.querySelector(e)}queryAll(e){return this.querySelectorAll(e)}_readyCallbacks;ready(e){if(this._isReady)queueMicrotask(e);else this._readyCallbacks??=[],this._readyCallbacks.push(e)}willMount(){}didMount(){}didRender(){}didReconnect(){}willUnmount(){}didUnmount(){}didChange(e,t,n,s){}_countAsConnected(){let e=this.constructor,t=ve.get(e);if(t===void 0)t=new Set,ve.set(e,t);t.add(this),this._connectedAs=e}_stopCountingAsConnected(){if(this._connectedAs!==void 0)ve.get(this._connectedAs)?.delete(this),this._connectedAs=void 0}async connectedCallback(){let e=this.constructor,t=e.tag;try{if(this._connected=!0,this._countAsConnected(),this.dataset.component=t,g._applyCurrentImplementation?.(this,t),typeof Symbol.metadata<"u"){let o=this.constructor[Symbol.metadata]?.[M];if(o)for(let i of o)g._activateSubscription(this,i)}let n=!this._hasBeenMounted;if(n)this._children=this.innerHTML.trim(),this._assignValuesBeforeUpgrade();if(Ne(this),n&&e._template===void 0){let s=document.querySelector(`template#${t}`);if(s)e._template=s.innerHTML}if(n&&typeof Symbol.metadata<"u"&&!Object.hasOwn(e,"_styleMetaApplied")){let o=e[Symbol.metadata]?.[ce];if(o)e._styleMetaApplied=!0,this.setStyle(o,!0)}if(await this.willMount(),await this._render(),this._initRenderDone=!0,n)await this.didMount();else await this.didReconnect();if(this._hasBeenMounted=!0,this._isReady=!0,this._readyCallbacks){for(let s of this._readyCallbacks)s();this._readyCallbacks=void 0}g._onMount?.(this,t),this.emit("pandora:ready",{firstMount:n,tag:t},{bubbles:!0,composed:!0})}catch(n){if(g._onError)g._onError(n,this,t,"connectedCallback");else throw n}}async disconnectedCallback(){let e=this.constructor,t=e.tag;this._connected=!1,this._isReady=!1,this._stopCountingAsConnected();try{if(this.emit("pandora:unmount",{tag:t},{bubbles:!0,composed:!0}),typeof Symbol.metadata<"u"){let s=e[Symbol.metadata]?.[M];if(s){let o=this;for(let i of s)if(o[i.unsubKey])o[i.unsubKey](),o[i.unsubKey]=void 0}}this._detachListeners(),await this.willUnmount(),await this.didUnmount(),g._onUnmount?.(this,t)}catch(n){if(g._onError)g._onError(n,this,t,"disconnectedCallback");else throw n}}attributeChangedCallback(e,t,n){if(typeof Symbol.metadata>"u")return;let o=this.constructor[Symbol.metadata],i=o?.[j];if(!i)return;let r=this;for(let a of i){if(a.attrName!==e)continue;if(r[a.settingKey])continue;let d=n!==null?P(n):void 0,u=r[a.valueKey];if(a.equals(u,d))continue;r[a.valueKey]=d;let l=o?.[w];if(l){for(let c of l)if(c.property===a.propertyKey){let h=this[c.methodName];if(typeof h==="function")h.call(this,d,u)}}if(this.didChange(a.propertyKey,u,d,"prop-attribute"),a.shouldRender&&this._initRenderDone&&this._connected)this._queueRender()}}_activeListeners=[];_listenersAttached=!1;_consumedOnceListeners=new Set;_listenerMetadata(){if(typeof Symbol.metadata>"u")return;return this.constructor[Symbol.metadata]?.[H]}static _isDynamicListenerTarget(e){return!!(e&&e!=="self"&&e!=="window"&&e!=="document")}_bindListener(e,t){let n=e.options;if(n?.once&&this._consumedOnceListeners.has(t))return!1;let s=this[e.methodName];if(typeof s!=="function")return!1;let o=g._isDynamicListenerTarget(n?.target),i=He(this,n?.target,(u)=>this.query(u));if(!i)return!1;let r=s.bind(this),a={};if(n?.capture)a.capture=!0;if(n?.passive)a.passive=!0;let d;if(n?.delegate){let u=n.delegate,l=n?.once;d=(c)=>{let h=je(c,u,this);if(h){if(l)this._consumedOnceListeners.add(t),i.removeEventListener(e.event,d,a),this._activeListeners=this._activeListeners.filter((p)=>p.handler!==d);r(c,h)}}}else if(n?.once)d=(u)=>{this._consumedOnceListeners.add(t),this._activeListeners=this._activeListeners.filter((l)=>l.handler!==d),r(u)},a.once=!0;else d=r;return i.addEventListener(e.event,d,a),this._activeListeners.push({target:i,event:e.event,handler:d,options:a,dynamic:o,index:t}),!0}_attachListeners(){let e=this._listenerMetadata();if(!e)return;e.forEach((t,n)=>this._bindListener(t,n))}_refreshDynamicListeners(){let e=[];for(let n of this._activeListeners)if(n.dynamic)n.target.removeEventListener(n.event,n.handler,n.options);else e.push(n);this._activeListeners=e;let t=this._listenerMetadata();if(!t)return;t.forEach((n,s)=>{if(g._isDynamicListenerTarget(n.options?.target))this._bindListener(n,s)})}_syncListenersAfterRender(){if(this._listenersAttached)this._refreshDynamicListeners();else this._attachListeners(),this._listenersAttached=!0}_detachListeners(){for(let{target:e,event:t,handler:n,options:s}of this._activeListeners)e.removeEventListener(t,n,s);this._activeListeners=[],this._listenersAttached=!1,this._consumedOnceListeners.clear()}}var C=g;var _t=Symbol("pandora:appliedImpl"),vt=Symbol.for("@aegis-framework/pandora"),wt="0.8.0";class J{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 lazyLoadPromises={};static middleware={render:new Set};static _initialized=!1;static _init(){if(this._initialized)return;this._initialized=!0,C._onMount=(e,t)=>this._notifyMount(e,t),C._onUnmount=(e,t)=>this._notifyUnmount(e,t),C._onError=(e,t,n,s)=>this._notifyError(e,t,n,s),C._applyMiddleware=(e,t,n,s)=>this._applyMiddleware(e,t,n,s),C._hasMiddleware=(e)=>this._hasMiddleware(e),C._subscribe=(e,t)=>this.subscribe(e,t),C._getGlobalState=(e)=>this.getState(e),C._applyCurrentImplementation=(e,t)=>{let n=this.implementations[t];if(!n)return;let i=e[_t]??e.constructor;if(n===i)return;this._applyImplementation(e,n,!1)}}static register(e,t){if(this._init(),typeof this.components[e]>"u")this.components[e]=t,this.implementations[e]=t,t.tag=e,window.customElements.define(e,t),this.components[e]._registered=!0,this.log(`Registered: <${e}>`);else throw Error(`[Pandora] <${e}> is already registered. Use Registry.evolve('${e}', NewClass) to swap its implementation.`)}static define(e,t){this.register(e,t)}static getImplementation(e){return this.implementations[e]||this.components[e]}static _applyImplementation(e,t,n=!1){let s=t.prototype,o=Object.getOwnPropertyNames(s),i=e;e[_t]=t;for(let r of o){if(r==="constructor")continue;let a=Object.getOwnPropertyDescriptor(s,r);if(!a)continue;if(typeof a.value==="function")i[r]=a.value.bind(e);else if(a.get||a.set)Object.defineProperty(Object.getPrototypeOf(e),r,a)}try{let r=customElements.get(e.localName)??e.constructor??t,a=Reflect.construct(t,[],r);for(let d of Object.keys(a))if(!(d in i)||i[d]===void 0)i[d]=a[d]}catch(r){console.warn(`[Pandora] Could not construct temp instance of <${t.tag}> for default extraction:`,r)}if(typeof Symbol.metadata<"u"){let r=t[Symbol.metadata];if(r){let a=e.constructor;a[Symbol.metadata]=r}}if(typeof Symbol.metadata<"u"){let a=t[Symbol.metadata]?.[F];if(a?.length){let d=i[W];if(d)for(let u of d)u();i[W]=[];for(let u of a)u(e)}}e._detachListeners()}static evolve(e,t,n=!1){if(typeof this.components[e]>"u")throw Error(`[Pandora] Cannot evolve <${e}>: no component with that tag has been registered.`);this.implementations[e]=t,t._registered=!0;let s=[];for(let[o,i]of Object.entries(this.aliases))if(i===e)s.push(o),this.implementations[o]=t;if(this.log(`Evolved: <${e}>`),n){let o=[e,...s];for(let i of o)document.querySelectorAll(i).forEach((r)=>{if(r instanceof C&&r.isReady)this._applyImplementation(r,t,!0),r.forceRender()})}}static instances(e,t){if(typeof this.components[e]>"u")throw Error(`[Pandora] No component with tag <${e}> has been registered.`);if(typeof t==="function")document.querySelectorAll(e).forEach(t);else return document.querySelectorAll(e)}static instantiate(e,t={}){if(!this.has(e))throw Error(`[Pandora] No component with tag <${e}> has been registered.`);if(!this.components[e]._registered)this.register(e,this.components[e]);let n=document.createElement(this.components[e].tag);for(let[s,o]of Object.entries(t)){if(o===void 0||o===null)continue;if(n[s]=o,Object.getOwnPropertyDescriptor(n,s)?.set!==void 0)continue;if(typeof o==="boolean"){if(o)n.setAttribute(s,"")}else if(typeof o==="string"||typeof o==="number")n.setAttribute(s,String(o))}return n}static has(e){return typeof this.components[e]<"u"}static get(e){return this.components[e]}static setState(e,t){let n=this.state[e];if(this.state[e]=t,this.subscribers[e])this.subscribers[e].forEach((s)=>{s(t,n)})}static getState(e){return this.state[e]}static hasState(e){return e in this.state}static deleteState(e){if(e in this.state){let t=this.state[e];if(delete this.state[e],this.subscribers[e])this.subscribers[e].forEach((n)=>{n(void 0,t)});return!0}return!1}static subscribe(e,t){if(!this.subscribers[e])this.subscribers[e]=new Set;return this.subscribers[e].add(t),()=>{this.unsubscribe(e,t)}}static unsubscribe(e,t){if(this.subscribers[e])this.subscribers[e].delete(t)}static getAllState(){return{...this.state}}static clearState(){let e=Object.keys(this.state);for(let t of e)this.deleteState(t)}static clearSubscriptions(){for(let e of Object.keys(this.subscribers))this.subscribers[e]=new Set}static clearMiddleware(){for(let e of Object.keys(this.middleware))this.middleware[e]=new Set}static get debug(){return this._debug}static set debug(e){this._debug=e}static log(e,t){if(this._debug)if(t!==void 0)console.log(`[Pandora] ${e}`,t);else console.log(`[Pandora] ${e}`)}static list(){return Object.keys(this.components)}static stats(e){if(e){if(!this.has(e))throw Error(`[Pandora] No component with tag <${e}> has been registered.`);return{tag:e,instanceCount:document.querySelectorAll(e).length,isRegistered:this.components[e]?._registered??!1,isLazy:e in this.lazyLoaders}}return this.list().map((t)=>({tag:t,instanceCount:document.querySelectorAll(t).length,isRegistered:this.components[t]?._registered??!1,isLazy:t in this.lazyLoaders}))}static onMount(e){return this._init(),this.mountCallbacks.add(e),()=>this.mountCallbacks.delete(e)}static onUnmount(e){return this._init(),this.unmountCallbacks.add(e),()=>this.unmountCallbacks.delete(e)}static _notifyMount(e,t){this.log(`Mounted: <${t}>`),this.mountCallbacks.forEach((n)=>{try{n(e,t)}catch(s){console.error("[Pandora] Error in onMount callback:",s)}})}static _notifyUnmount(e,t){this.log(`Unmounted: <${t}>`),this.unmountCallbacks.forEach((n)=>{try{n(e,t)}catch(s){console.error("[Pandora] Error in onUnmount callback:",s)}})}static onError(e){return this._init(),this.errorCallbacks.add(e),()=>this.errorCallbacks.delete(e)}static _notifyError(e,t,n,s){if(this.log(`Error in <${n}> during ${s}:`,e),this.errorCallbacks.size===0)throw e;this.errorCallbacks.forEach((o)=>{try{o(e,t,n,s)}catch(i){console.error("[Pandora] Error in onError callback:",i)}})}static alias(e,t){if(!this.has(t))throw Error(`[Pandora] Cannot alias <${e}>: no component with tag <${t}> has been registered.`);if(this.has(e))throw Error(`[Pandora] Cannot alias <${e}>: a component with that tag already exists.`);this.aliases[e]=t;let n=this.getImplementation(t)??this.components[t],s=class extends n{static _tag=e};this.components[e]=s,this.implementations[e]=s,window.customElements.define(e,s),s._registered=!0,this.log(`Created alias: <${e}> -> <${t}>`)}static getOriginalTag(e){return this.aliases[e]}static isAlias(e){return e in this.aliases}static lazy(e,t){if(this._init(),this.has(e))throw Error(`[Pandora] Cannot register lazy <${e}>: a component with that tag already exists.`);this.lazyLoaders[e]=t;let n=J;class s extends C{static _tag=e;_lazyLoaded=!1;async connectedCallback(){await n._loadLazyComponent(e);let o=n.getImplementation(e);if(o&&o!==s)J._applyImplementation(this,o,!1),this._lazyLoaded=!0;await super.connectedCallback()}}this.components[e]=s,window.customElements.define(e,s),this.log(`Registered lazy component: <${e}>`)}static async _loadLazyComponent(e){if(this.lazyLoadPromises[e])return this.lazyLoadPromises[e];if(!(e in this.lazyLoaders))return;let t=this.lazyLoaders[e];return this.log(`Loading lazy component: <${e}>`),this.lazyLoadPromises[e]=(async()=>{try{let n=await t(),s="default"in n?n.default:n;delete this.lazyLoaders[e],this.implementations[e]=s,s._registered=!0,this.log(`Loaded lazy component: <${e}>`)}catch(n){throw console.error(`[Pandora] Failed to load lazy component <${e}>:`,n),n}finally{delete this.lazyLoadPromises[e]}})(),this.lazyLoadPromises[e]}static isLazy(e){return e in this.lazyLoaders}static async preload(e){if(this.isLazy(e))await this._loadLazyComponent(e)}static use(e,t){return this._init(),this.middleware[e].add(t),()=>this.middleware[e].delete(t)}static _applyMiddleware(e,t,n,s){let o=n;return this.middleware[e].forEach((i)=>{try{o=i(t,o,s)}catch(r){console.error(`[Pandora] Error in ${e} middleware:`,r)}}),o}static _hasMiddleware(e){return this.middleware[e].size>0}}C._registryRegister=(e,t)=>J.register(e,t);var Rn=(e,t,n=globalThis)=>{let s=n,o=s[vt];if(o===void 0||o===null)return s[vt]={version:t,registry:e},!0;if(o.registry===e)return!0;let i=o.version===t?`both are version ${t}`:`the first is version ${o.version}, this one is version ${t}`;return console.error(`[Pandora] Two copies of @aegis-framework/pandora are loaded (${i}). Each copy has its own Registry, so components, global state and middleware registered with one are unknown to the other, and a tag both define throws. To fix it, install a single copy (run \`npm ls @aegis-framework/pandora\` and dedupe it), import Pandora only by its package name, and don't load the browser bundle (pandora.browser.js) on a page that also bundles the package.`),!1};Rn(J,wt);var E=J;var kn=new Set(["accessKey","autocapitalize","autocorrect","autofocus","className","contentEditable","dir","draggable","enterKeyHint","hidden","id","inert","innerHTML","innerText","inputMode","lang","nonce","outerHTML","part","popover","role","slot","spellcheck","style","tabIndex","textContent","title","translate","writingSuggestions"]),St=new WeakMap;Symbol.metadata??=Symbol("Symbol.metadata");var T=(e,t)=>{if(typeof t==="object"&&t!==null&&"kind"in t)return;throw TypeError(`[Pandora] @${e} was called as a legacy decorator. Pandora's decorators are standard decorators: remove "experimentalDecorators" from tsconfig.json (or set it to false), and if Babel compiles your code, set @babel/plugin-proposal-decorators to { version: "2023-11" }.`)},Ln=(e,t)=>(n,s)=>{T("Register",s);let o=s.metadata;if(o?.[A]){if(!Object.hasOwn(n,"_observedAttributes"))n._observedAttributes=[];for(let i of o[A])if(!n._observedAttributes.includes(i))n._observedAttributes.push(i)}if(o&&n[Symbol.metadata]===void 0)n[Symbol.metadata]=o;if(n.tag=e,!t?.defer)E.register(e,n);return n},xn=(e)=>(t,n)=>{T("Style",n);let s=n.metadata;return s[ce]=e,t},Pn=(e)=>(t,n)=>{T("Watch",n);let s=String(n.name),o=n.metadata;if(!Object.hasOwn(o,w)){let r=o[w];o[w]=r?[...r]:[]}o[w].push({property:e,methodName:s});let i=!1;n.addInitializer(function(){if(i)return;i=!0;let r=this;queueMicrotask(()=>{if(o[v]?.has(e)||Object.getOwnPropertyDescriptor(r,e)?.set)return;let d=r.constructor?.name||"<anonymous>";console.warn(`[Pandora] @Watch('${e}') on ${d}.${s}(): '${e}' is not reactive. Add @State, @Attribute, @Property, or @Subscribe to '${e}', or call reactive(this, '${e}') in the constructor — otherwise the watcher will never fire.`)})})},Lt=(e,t)=>{if(typeof Symbol.metadata>"u")return[];let s=e.constructor[Symbol.metadata]?.[w];if(!s)return[];let o=[];for(let i of s)if(i.property===t){let r=e[i.methodName];if(typeof r==="function")o.push(r.bind(e))}return o},On=(e)=>{if(kn.has(e)||/^aria[A-Z]/.test(e))return!0;return typeof HTMLElement<"u"&&e in HTMLElement.prototype},Ve=(e,t,n)=>{if(!On(t))return;n.addInitializer(function(){let s=this.constructor,o=St.get(s);if(o===void 0)o=new Set,St.set(s,o);if(o.has(t))return;o.add(t),console.warn(`[Pandora] ${s.name||"A component"}: @${e}() ${t} has the name of the element's own \`${t}\` property and replaces it, so the browser's behavior for \`${t}\` stops working on this element and code that uses \`element.${t}\` gets the field instead. Rename the field.`)})},xt=(e,t,n)=>{let s=Object.getOwnPropertyDescriptor(e,t);if(s&&"value"in s&&s.value!==void 0&&e[n]===void 0)e[n]=s.value},Pt=(e,t)=>{if(!Object.hasOwn(e,j)){let n=e[j];e[j]=n?[...n]:[]}e[j].push(t)},Ct=(e,t,n)=>{if(typeof n==="boolean")if(n)e.setAttribute(t,"");else e.removeAttribute(t);else if(typeof n==="string"||typeof n==="number")e.setAttribute(t,String(n))},we=(e,t,n)=>{if(e.isConnected){Ct(e,t,e[n]);return}let s=e[Y];if(s===void 0)s=new Map,e[Y]=s;s.set(t,()=>{if(!e.hasAttribute(t))Ct(e,t,e[n])})},Se=(e,t,n,s,o,i=!0,r=(a,d)=>a===d)=>{if(xt(e,n,s),Object.defineProperty(e,n,{get(){if(e[s]!==void 0)return e[s];if(e.hasAttribute(t))return P(e.getAttribute(t));return},set(a){let d=e[s];if(e[s]=a,e[o]=!0,a===void 0||a===null)e.removeAttribute(t);else if(typeof a==="string"||typeof a==="number"||typeof a==="boolean")if(typeof a==="boolean")if(a)e.setAttribute(t,"");else e.removeAttribute(t);else e.setAttribute(t,String(a));if(e[o]=!1,!r(d,a)){if(!he(e,{property:n,oldValue:d,newValue:a,shouldRender:i,source:"prop"})){let u=Lt(e,n);for(let l of u)l(a,d);if(e.didChange(n,d,a,"prop"),i&&e._initRenderDone&&e.isConnected)e._queueRender()}}},enumerable:!0,configurable:!0}),e.isConnected&&e.hasAttribute(t))e[s]=P(e.getAttribute(t));Z(e,()=>{delete e[n]})},Ce=(e,t,n,s,o="state",i=(r,a)=>r===a)=>{xt(e,t,n),Object.defineProperty(e,t,{get(){return e[n]},set(r){let a=e[n];if(i(a,r))return;if(e[n]=r,he(e,{property:t,oldValue:a,newValue:r,shouldRender:s,source:o}))return;let d=Lt(e,t);for(let u of d)u(r,a);if(e.didChange(t,a,r,o),s&&e._initRenderDone&&e.isConnected)e._queueRender()},enumerable:!0,configurable:!0}),Z(e,()=>{delete e[t]})},Dn=(e)=>(t,n)=>{T("State",n);let s=String(n.name);Ve("State",s,n);let o=e?.render!==!1,i=Symbol(`__pandora_state_${s}`),r,a=!1,d=n.metadata;if(!Object.hasOwn(d,v)){let u=d[v];d[v]=u?new Set(u):new Set}d[v].add(s),R(d,(u)=>{if(Ce(u,s,i,o),a&&u[i]===void 0)u[i]=r}),n.addInitializer(function(){let u=this,l=u[s];if(Ce(u,s,i,o),l!==void 0){if(u[i]=l,!a)r=l,a=!0}})},Mn=(e)=>(t,n)=>{T("Property",n);let s=String(n.name);Ve("Property",s,n);let o=Symbol(`__pandora_property_${s}`),i=e?.equals??((l,c)=>l===c),r=e?.attribute===!0?s:e?.attribute??!1,a,d=!1,u=n.metadata;if(!Object.hasOwn(u,v)){let l=u[v];u[v]=l?new Set(l):new Set}if(u[v].add(s),r!==!1){let l=Symbol(`__pandora_propSetting_${s}`);if(!Object.hasOwn(u,A)){let c=u[A];u[A]=c?[...c]:[]}if(!u[A].includes(r))u[A].push(r);Pt(u,{attrName:r,propertyKey:s,valueKey:o,settingKey:l,shouldRender:!1,equals:i}),R(u,(c)=>{if(Se(c,r,s,o,l,!1,i),d&&c[o]===void 0)if(c.hasAttribute(r))c[o]=P(c.getAttribute(r));else c[o]=a,we(c,r,s)}),n.addInitializer(function(){let c=this,h=c[s],p=c.hasAttribute(r),S=p?P(c.getAttribute(r)):void 0;if(Se(c,r,s,o,l,!1,i),h!==void 0&&!d)a=h,d=!0;if(p)c[o]=S;else if(h!==void 0)c[o]=h,we(c,r,s)})}else R(u,(l)=>{if(Ce(l,s,o,!1,"property",i),d&&l[o]===void 0)l[o]=a}),n.addInitializer(function(){let l=this,c=l[s];if(Ce(l,s,o,!1,"property",i),c!==void 0){if(l[o]=c,!d)a=c,d=!0}})},In=(e)=>(t,n)=>{T("Attribute",n);let s=String(n.name);Ve("Attribute",s,n);let o,i=!0;if(typeof e==="object")o=s,i=e.render!==!1;else o=e??s;let r=Symbol(`__pandora_attr_${s}`),a=n.metadata;if(!Object.hasOwn(a,v)){let l=a[v];a[v]=l?new Set(l):new Set}a[v].add(s);let d,u=!1;{let l=Symbol(`__pandora_propSetting_${s}`);if(!Object.hasOwn(a,A)){let c=a[A];a[A]=c?[...c]:[]}if(!a[A].includes(o))a[A].push(o);Pt(a,{attrName:o,propertyKey:s,valueKey:r,settingKey:l,shouldRender:i,equals:(c,h)=>c===h}),R(a,(c)=>{if(Se(c,o,s,r,l,i),u&&c[r]===void 0)if(c.hasAttribute(o))c[r]=P(c.getAttribute(o));else c[r]=d,we(c,o,s)}),n.addInitializer(function(){let c=this,h=c[s],p=c.hasAttribute(o),S=p?P(c.getAttribute(o)):void 0;if(Se(c,o,s,r,l,i),h!==void 0&&!u)d=h,u=!0;if(p)c[r]=S;else if(h!==void 0)c[r]=h,we(c,o,s)})}},At=(e,t,n,s,o)=>{if(Object.defineProperty(e,n,{get(){return e[o]},set(i){let r=e[o];if(r===i)return;if(e[o]=i,E.setState(t,i),e.didChange(n,r,i,"consumer"),e.isReady)e._queueRender()},enumerable:!0,configurable:!0}),e.isConnected)C._activateSubscription?.(e,{stateKey:t,propertyKey:n,unsubKey:s,valueKey:o});Z(e,()=>{if(e[s])e[s](),e[s]=void 0;delete e[n]})},Nn=(e)=>(t,n)=>{T("Subscribe",n);let s=String(n.name),o=Symbol(`__pandora_unsub_${s}`),i=Symbol(`__pandora_value_${s}`),r=n.metadata;if(!Object.hasOwn(r,v)){let a=r[v];r[v]=a?new Set(a):new Set}if(r[v].add(s),!Object.hasOwn(r,M)){let a=r[M];r[M]=a?[...a]:[]}r[M].push({stateKey:e,propertyKey:s,unsubKey:o,valueKey:i}),R(r,(a)=>{At(a,e,s,o,i)}),n.addInitializer(function(){At(this,e,s,o,i)})},Et=(e,t,n)=>{Object.defineProperty(e,t,{get(){return e.query(n)},enumerable:!0,configurable:!0})},Hn=(e)=>(t,n)=>{T("Query",n);let s=String(n.name),o=n.metadata;R(o,(i)=>{Et(i,s,e)}),n.addInitializer(function(){Et(this,s,e)})},Tt=(e,t,n)=>{Object.defineProperty(e,t,{get(){return e.queryAll(n)},enumerable:!0,configurable:!0})},jn=(e)=>(t,n)=>{T("QueryAll",n);let s=String(n.name),o=n.metadata;R(o,(i)=>{Tt(i,s,e)}),n.addInitializer(function(){Tt(this,s,e)})},$t=(e,t,n)=>{Object.defineProperty(e,t,{get(){return(e._shadowDOM||e.shadowRoot)?.querySelector(n)??null},enumerable:!0,configurable:!0})},Vn=(e)=>(t,n)=>{T("Slot",n);let s=String(n.name),o=e?`slot[name="${e}"]`:"slot:not([name])",i=n.metadata;R(i,(r)=>{$t(r,s,o)}),n.addInitializer(function(){$t(this,s,o)})},qn=(e,t)=>(n,s)=>{T("Listen",s);let o=String(s.name),i=s.metadata;if(!Object.hasOwn(i,H)){let r=i[H];i[H]=r?[...r]:[]}i[H].push({event:e,methodName:o,options:t})},Rt=(e,t,n,s,o)=>{e[`__invalidate_${t}`]=()=>{e[s]=!1},Object.defineProperty(e,t,{get(){if(!e[s])e[n]=o.call(e),e[s]=!0;return e[n]},enumerable:!0,configurable:!0})},Bn=(...e)=>(t,n)=>{T("Computed",n);let s=String(n.name),o=Symbol(`__pandora_computed_cache_${s}`),i=Symbol(`__pandora_computed_valid_${s}`),r=n.metadata;for(let d of e){if(!Object.hasOwn(r,w)){let u=r[w];r[w]=u?[...u]:[]}r[w].push({property:d,methodName:`__invalidate_${s}`})}let a=t;return R(r,(d)=>{Rt(d,s,o,i,a)}),n.addInitializer(function(){Rt(this,s,o,i,a)}),t},Un=(e)=>(t,n)=>{T("ClassList",n);let s=n.metadata,o=[],i=[];for(let[a,d]of Object.entries(e))if(typeof d==="string"){if(o.push({className:a,propertyName:d}),!Object.hasOwn(s,w)){let l=s[w];s[w]=l?[...l]:[]}let u=`__classlist_${a}_${d}`;s[w].push({property:d,methodName:u}),t.prototype[u]=function(){this.classList.toggle(a,!!this[d])}}else i.push({className:a,conditionFn:d});if(i.length>0){let a=t.prototype.didChange;t.prototype.didChange=function(d,u,l,c){a?.call(this,d,u,l,c);for(let{className:h,conditionFn:p}of i)this.classList.toggle(h,p(this))}}let r=t.prototype.connectedCallback;return t.prototype.connectedCallback=async function(){await r?.call(this);for(let{className:a,propertyName:d}of o)this.classList.toggle(a,!!this[d]);for(let{className:a,conditionFn:d}of i)this.classList.toggle(a,d(this))},t},kt=(e,t,n)=>{Object.defineProperty(e,t,{value:(s)=>e.emit(n,s),writable:!1,enumerable:!0,configurable:!0})},zn=(e)=>(t,n)=>{T("Emitter",n);let s=String(n.name),o=n.metadata;R(o,(i)=>{kt(i,s,e)}),n.addInitializer(function(){kt(this,s,e)})};class Ot extends C{_shadowDOM;static _styleSheet=null;static _sharedStyle={};constructor(){super();this._shadowDOM=this.attachShadow({mode:"open"}),this._trackScrolling(this._shadowDOM)}setStyle(e,t=!1){let n=this.constructor;if(!n._styleSheet)n._styleSheet=new CSSStyleSheet;let s="";if(typeof e==="object"){if(!Object.hasOwn(n,"_sharedStyle"))n._sharedStyle={};if(!t)n._sharedStyle={...n._sharedStyle,...e};else n._sharedStyle={...e};this._style=n._sharedStyle,s=X(n._sharedStyle)}else if(typeof e==="string")if(!t)s=Array.from(n._styleSheet.cssRules||[]).map((i)=>i.cssText).join(`
|
|
15
15
|
`)+`
|
|
16
|
-
`+e;else s=e,n._sharedStyle={},this._style={};return n._styleSheet.replaceSync(s),this._shadowDOM.adoptedStyleSheets=[n._styleSheet],n._sharedStyle}_renderRoot(){return this._shadowDOM}_applyLitRender(e){z(e,this._shadowDOM,{host:this})}_resetRenderRoot(){while(this._shadowDOM.firstChild)this._shadowDOM.firstChild.remove();delete this._shadowDOM._$litPart$}_applyStringRender(e){while(this._shadowDOM.firstChild)this._shadowDOM.firstChild.remove();if(e==="")return;let t=document.createElement("template");t.innerHTML=e,this._shadowDOM.appendChild(t.content)}get shadowRoot(){return this._shadowDOM}set shadowRoot(e){throw Error("ShadowComponent shadowRoot can not be overwritten.")}query(e){return this._shadowDOM.querySelector(e)}queryAll(e){return this._shadowDOM.querySelectorAll(e)}}var
|
|
16
|
+
`+e;else s=e,n._sharedStyle={},this._style={};return n._styleSheet.replaceSync(s),this._shadowDOM.adoptedStyleSheets=[n._styleSheet],n._sharedStyle}_renderRoot(){return this._shadowDOM}_applyLitRender(e){z(e,this._shadowDOM,{host:this})}_resetRenderRoot(){while(this._shadowDOM.firstChild)this._shadowDOM.firstChild.remove();delete this._shadowDOM._$litPart$}_applyStringRender(e){while(this._shadowDOM.firstChild)this._shadowDOM.firstChild.remove();if(e==="")return;let t=document.createElement("template");t.innerHTML=e,this._shadowDOM.appendChild(t.content)}get shadowRoot(){return this._shadowDOM}set shadowRoot(e){throw Error("ShadowComponent shadowRoot can not be overwritten.")}query(e){return this._shadowDOM.querySelector(e)}queryAll(e){return this._shadowDOM.querySelectorAll(e)}}var Fn=Ot;var Wn=async()=>{await new Promise((e)=>queueMicrotask(e)),await new Promise((e)=>queueMicrotask(e))},Dt=(e,t=5000)=>{let n=e;if(n.isReady)return Promise.resolve();return new Promise((s,o)=>{let i=()=>{clearTimeout(a),clearInterval(d),e.removeEventListener("pandora:ready",r)},r=()=>{if(n.isReady)i(),s()},a=setTimeout(()=>{i(),o(Error(`Component <${e.tagName.toLowerCase()}> did not become ready within ${t}ms`))},t);e.addEventListener("pandora:ready",r);let d=setInterval(r,16)})},Gn=()=>{E.clearState(),E.clearSubscriptions(),E.clearMiddleware()},Kn=async(e,t,n)=>{let s=t??document.body,o=document.createElement("div");o.innerHTML=`<${e}>${n??""}</${e}>`;let i=o.firstElementChild;return s.appendChild(i),await Dt(i),i};var Qn=(e,t)=>{if(t!==void 0&&!E.hasState(e))E.setState(e,t);return{key:e,get(){return E.getState(e)},set(n){E.setState(e,n)},subscribe(n){return E.subscribe(e,n)},has(){return E.hasState(e)},delete(){E.deleteState(e)}}};export{I as AsyncDirective,In as Attribute,Un as ClassList,C as Component,Bn as Computed,_ as Directive,zn as Emitter,qn as Listen,b as PartType,Mn as Property,Hn as Query,jn as QueryAll,Ln as Register,E as Registry,Fn as ShadowComponent,Vn as Slot,Dn as State,xn as Style,Nn as Subscribe,zt as TemplateResultType,Yn as Types,bt as Util,wt as VERSION,Pn as Watch,R as addDecoratorEffect,Z as addTeardown,Zt as asyncAppend,Xt as asyncReplace,Jt as cache,en as choose,tn as classMap,ie as clearPart,un as createRef,Qn as createState,m as directive,Q as getCommittedValue,Wt as getDirectiveClass,sn as guard,Vt as html,on as ifDefined,k as insertPart,Me as isCompiledTemplateResult,Ft as isDirectiveResult,De as isPrimitive,oe as isSingleExpression,fe as isTemplateResult,rn as join,an as keyed,dn as live,ln as map,y as noChange,f as nothing,cn as range,gt as reactive,yt as reactiveFields,hn as ref,re as removePart,z as render,pn as repeat,L as setChildPartValue,x as setCommittedValue,mn as styleMap,qt as svg,yn as templateContent,Mt as testing,gn as unsafeHTML,bn as unsafeMathML,_n as unsafeSVG,vn as until,wn as when};
|
|
17
17
|
|
|
18
|
-
//# debugId=
|
|
18
|
+
//# debugId=8CA82B289575A68864756E2164756E21
|
|
19
19
|
//# sourceMappingURL=pandora.js.map
|