regor 1.0.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.
@@ -0,0 +1,3 @@
1
+ "use strict";var Regor=(()=>{var Pt=Object.defineProperty;var zr=Object.getOwnPropertyDescriptor;var Kr=Object.getOwnPropertyNames;var Wr=Object.prototype.hasOwnProperty;var Gr=(t,e)=>{for(var n in e)Pt(t,n,{get:e[n],enumerable:!0})},Jr=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Kr(e))!Wr.call(t,o)&&o!==n&&Pt(t,o,{get:()=>e[o],enumerable:!(r=zr(e,o))||r.enumerable});return t};var Qr=t=>Jr(Pt({},"__esModule",{value:!0}),t);var us={};Gr(us,{ComponentHead:()=>Pe,RegorConfig:()=>re,addUnbinder:()=>k,batch:()=>Fr,collectRefs:()=>lt,computeMany:()=>Hr,computeRef:()=>_r,computed:()=>Ur,createApp:()=>Ir,createComponent:()=>Dr,endBatch:()=>Tn,entangle:()=>bt,flatten:()=>J,getBindData:()=>me,html:()=>gn,isDeepRef:()=>Ne,isRaw:()=>Be,isRef:()=>m,markRaw:()=>Br,observe:()=>C,observeMany:()=>jr,observerCount:()=>$r,onMounted:()=>qr,onUnmounted:()=>K,pause:()=>Dt,persist:()=>Vr,raw:()=>Pr,ref:()=>Te,removeNode:()=>V,resume:()=>Ut,silence:()=>ft,sref:()=>q,startBatch:()=>bn,toFragment:()=>Me,toJsonTemplate:()=>Ke,trigger:()=>$,unbind:()=>te,unref:()=>B,useScope:()=>gt,warningHandler:()=>zt,watchEffect:()=>we});var U=t=>typeof t=="function",z=t=>typeof t=="string",En=t=>typeof t>"u",Y=t=>t==null||typeof t>"u",j=t=>typeof t!="string"||!t?.trim(),Xr=Object.prototype.toString,jt=t=>Xr.call(t),ue=t=>jt(t)==="[object Map]",X=t=>jt(t)==="[object Set]",$t=t=>jt(t)==="[object Date]",Je=t=>typeof t=="symbol",T=Array.isArray,w=t=>t!==null&&typeof t=="object";var vn={0:"App root element is missing",1:t=>`${t} component template cannot be found.`,2:"Use composables in scope. usage: useScope(() => new MyApp()).",3:t=>`${t} requires ref source argument`,4:"computed is readonly.",5:"ref is readonly."},H=(t,...e)=>{let n=vn[t];return new Error(U(n)?n.call(vn,...e):n)};var ke=Symbol(":regor");var me=t=>{let e=t[ke];if(e)return e;let n={unbinders:[],data:{}};return t[ke]=n,n};var k=(t,e)=>{me(t).unbinders.push(e)};var nt=[],xn=()=>{let t={onMounted:[],onUnmounted:[]};return nt.push(t),t},Re=t=>{let e=nt[nt.length-1];if(!e&&!t)throw H(2);return e},Cn=t=>{let e=Re();return t&&qt(t),nt.pop(),e},Ft=Symbol("csp"),qt=t=>{let e=t,n=e[Ft];if(n){let r=Re();if(n===r)return;r.onMounted.length>0&&n.onMounted.push(...r.onMounted),r.onUnmounted.length>0&&n.onUnmounted.push(...r.onUnmounted);return}e[Ft]=Re()},rt=t=>t[Ft];var K=(t,e)=>{Re(e)?.onUnmounted.push(t)};var ot=Symbol("ref"),G=Symbol("sref"),st=Symbol("raw");var m=t=>t?.[G]===1;var C=(t,e,n)=>{if(!m(t))throw H(3,"observe");n&&e(t());let o=t(void 0,void 0,0,e);return K(o,!0),o};var te=t=>{let e=[t];for(;e.length>0;){let n=e.shift();Yr(n);let r=n.childNodes;if(r)for(let o of r)e.push(o)}},Yr=t=>{let e=t[ke];if(e){for(let n of e.unbinders)n();e.unbinders.splice(0),delete t[ke]}};var V=t=>{t.remove(),setTimeout(()=>te(t),1)};var Rn={8:t=>`Model binding requires a ref at ${t.outerHTML}`,7:t=>`Model binding is not supported on ${t.tagName} element at ${t.outerHTML}`,0:(t,e)=>`${t} binding expression is missing at ${e.outerHTML}`,1:(t,e,n)=>`invalid ${t} expression: ${e} at ${n.outerHTML}`,2:(t,e)=>`${t} requires object expression at ${e.outerHTML}`,3:(t,e)=>`${t} binder: key is empty on ${e.outerHTML}.`,4:(t,e,n,r)=>({msg:`Failed setting prop "${t}" on <${e.toLowerCase()}>: value ${n} is invalid.`,args:[r]}),5:(t,e)=>`${t} binding missing event type at ${e.outerHTML}`,6:(t,e)=>({msg:t,args:[e]})},I=(t,...e)=>{let n=Rn[t],r=U(n)?n.call(Rn,...e):n,o=zt.warning;o&&(z(r)?o(r):o(r,...r.args))},zt={warning:console.warn};var at={},it={},Sn=1,wn=t=>{let e=(Sn++).toString();return at[e]=t,it[e]=0,e},Kt=t=>{it[t]+=1},Wt=t=>{--it[t]===0&&(delete at[t],delete it[t])},On=t=>at[t],Gt=()=>Sn!==1&&Object.keys(at).length>0,Qe="r-switch",Zr=t=>{let e=t.filter(r=>Se(r)).map(r=>[...r.querySelectorAll("[r-switch]")].map(o=>o.getAttribute(Qe))),n=new Set;return e.forEach(r=>{r.forEach(o=>o&&n.add(o))}),[...n]},Ie=(t,e)=>{if(!Gt())return;let n=Zr(e);n.length!==0&&(n.forEach(Kt),k(t,()=>{n.forEach(Wt)}))};var Jt=(t,e,n,r)=>{let o=[];for(let s of t){let i=s.cloneNode(!0);n.insertBefore(i,r),o.push(i)}ye(e,o)},Qt=Symbol("r-if"),An=Symbol("r-else"),Nn=t=>t[An]===1,ct=class{p;P;q;K;z;b;x;constructor(e){this.p=e,this.P=e.o.l.if,this.q=He(e.o.l.if),this.K=e.o.l.else,this.z=e.o.l.elseif,this.b=e.o.l.for,this.x=e.o.l.pre}_e(e,n){let r=e.parentElement;for(;r!==null&&r!==document.documentElement;){if(r.hasAttribute(n))return!0;r=r.parentElement}return!1}M(e){let n=e.hasAttribute(this.P),r=de(e,this.q);for(let o of r)this.T(o);return n}W(e){return e[Qt]?!0:(e[Qt]=!0,de(e,this.q).forEach(n=>n[Qt]=!0),!1)}T(e){if(e.hasAttribute(this.x)||this.W(e)||this._e(e,this.b))return;let n=e.getAttribute(this.P);if(!n){I(0,this.P,e);return}e.removeAttribute(this.P),this.k(e,n)}B(e,n,r){let o=Ue(e),s=e.parentNode,i=document.createComment(`__begin__ :${n}${r??""}`);s.insertBefore(i,e),Ie(i,o),o.forEach(c=>{V(c)}),e.remove(),n!=="if"&&(e[An]=1);let a=document.createComment(`__end__ :${n}${r??""}`);return s.insertBefore(a,i.nextSibling),{nodes:o,parent:s,commentBegin:i,commentEnd:a}}ie(e,n){if(!e)return[];let r=e.nextElementSibling;if(e.hasAttribute(this.K)){e.removeAttribute(this.K);let{nodes:o,parent:s,commentBegin:i,commentEnd:a}=this.B(e,"else");return[{mount:()=>{Jt(o,this.p,s,a)},unmount:()=>{ae(i,a)},isTrue:()=>!0,isMounted:!1}]}else{let o=e.getAttribute(this.z);if(!o)return[];e.removeAttribute(this.z);let{nodes:s,parent:i,commentBegin:a,commentEnd:c}=this.B(e,"elseif",` => ${o} `),f=this.p.h.v(o),p=f.value,l=this.ie(r,n),g=[];k(a,()=>{f.stop();for(let v of g)v();g.length=0});let y=C(p,n);return g.push(y),[{mount:()=>{Jt(s,this.p,i,c)},unmount:()=>{ae(a,c)},isTrue:()=>!!p()[0],isMounted:!1}].concat(l)}}k(e,n){let r=e.nextElementSibling,{nodes:o,parent:s,commentBegin:i,commentEnd:a}=this.B(e,"if",` => ${n} `),c=this.p.h.v(n),f=c.value,p=!1,l=this.p.h,g=l.V(),u=()=>{l.C(g,()=>{if(f()[0])p||(Jt(o,this.p,s,a),p=!0),y.forEach(O=>{O.unmount(),O.isMounted=!1});else{ae(i,a),p=!1;let O=!1;for(let M of y)!O&&M.isTrue()?(M.isMounted||(M.mount(),M.isMounted=!0),O=!0):(M.unmount(),M.isMounted=!1)}})},y=this.ie(r,u),v=[];k(i,()=>{c.stop();for(let O of v)O();v.length=0}),u();let b=C(f,u);v.push(b)}};var Ue=t=>{let e=ne(t)?t.content.childNodes:[t];return Array.from(e).filter(n=>{let r=n?.tagName;return r!=="SCRIPT"&&r!=="STYLE"})},ye=(t,e)=>{for(let n of e)!Nn(n)&&t.G(n)},de=(t,e)=>{let n=t.querySelectorAll(e);return t.matches?.(e)?[t,...n]:n},ne=t=>t instanceof HTMLTemplateElement,Se=t=>t.nodeType===Node.ELEMENT_NODE,Xe=t=>t.nodeType===Node.ELEMENT_NODE,Mn=t=>t instanceof HTMLSlotElement,ce=t=>ne(t)?t.content.childNodes:t.childNodes,ae=(t,e)=>{let n=t.nextSibling;for(;n!=null&&n!==e;){let r=n.nextSibling;V(n),n=r}},he=(t,e)=>{Object.defineProperty(t,"value",{get(){return t()},set(n){if(e)throw new Error("value is readonly.");return t(n)},enumerable:!0,configurable:!1})},Ln=(t,e)=>{if(!t)return!1;if(t.startsWith("["))return t.substring(1,t.length-1);let n=e.length;return t.startsWith(e)?t.substring(n,t.length-n):!1},He=t=>`[${CSS.escape(t)}]`,pt=(t,e)=>(t.startsWith("@")&&(t=e.l.on+":"+t.slice(1)),t.includes("[")&&(t=t.replace(/[[\]]/g,e.l.dynamic)),t),Xt=t=>{let e=Object.create(null);return n=>e[n]||(e[n]=t(n))},eo=/-(\w)/g,_=Xt(t=>t&&t.replace(eo,(e,n)=>n?n.toUpperCase():"")),to=/\B([A-Z])/g,_e=Xt(t=>t&&t.replace(to,"-$1").toLowerCase()),Ye=Xt(t=>t&&t.charAt(0).toUpperCase()+t.slice(1));var Z=[],kn=t=>{Z.length!==0&&Z[Z.length-1]?.add(t)},we=t=>{if(!t)return()=>{};let e={stop:()=>{}};return no(t,e),K(()=>e.stop(),!0),e.stop},no=(t,e)=>{if(!t)return;let n=[],r=!1,o=()=>{for(let s of n)s();n=[],r=!0};e.stop=o;try{let s=new Set;if(Z.push(s),t(i=>n.push(i)),r)return;for(let i of[...s]){let a=C(i,()=>{o(),we(t)});n.push(a)}}finally{Z.pop()}},ft=t=>{let e=Z.length,n=e>0&&Z[e-1];try{return n&&Z.push(null),t()}finally{n&&Z.pop()}},lt=t=>{try{let e=new Set;return Z.push(e),{value:t(),refs:[...e]}}finally{Z.pop()}};var Be=t=>!!t&&t[st]===1;var $=(t,e,n)=>{if(!m(t))return;let r=t;if(r(void 0,e,1),!n)return;let o=r();if(o){if(T(o)||X(o))for(let s of o)$(s,e,!0);else if(ue(o))for(let s of o)$(s[0],e,!0),$(s[1],e,!0);if(w(o))for(let s in o)$(o[s],e,!0)}};function ro(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}var Ve=(t,e,n)=>{n.forEach(function(r){let o=t[r];ro(e,r,function(...i){let a=o.apply(this,i),c=this[G];for(let f of c)$(f);return a})})},ut=(t,e)=>{Object.defineProperty(t,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})};var In=Array.prototype,Yt=Object.create(In),oo=["push","pop","shift","unshift","splice","sort","reverse"];Ve(In,Yt,oo);var Dn=Map.prototype,mt=Object.create(Dn),so=["set","clear","delete"];ut(mt,"Map");Ve(Dn,mt,so);var Un=Set.prototype,dt=Object.create(Un),io=["add","clear","delete"];ut(dt,"Set");Ve(Un,dt,io);var Oe={},q=t=>{if(m(t)||Be(t))return t;let e={auto:!0,_value:t},n=c=>w(c)?G in c?!0:T(c)?(Object.setPrototypeOf(c,Yt),!0):X(c)?(Object.setPrototypeOf(c,dt),!0):ue(c)?(Object.setPrototypeOf(c,mt),!0):!1:!1,r=n(t),o=new Set,s=(c,f)=>{if(Oe.set){Oe.set.add(a);return}o.size!==0&&ft(()=>{for(let p of[...o.keys()])o.has(p)&&p(c,f)})},i=c=>{let f=c[G];f||(c[G]=f=new Set),f.add(a)},a=(...c)=>{if(!(2 in c)){let p=c[0],l=c[1];return 0 in c?e._value===p||m(p)&&(p=p(),e._value===p)?p:(n(p)&&i(p),e._value=p,e.auto&&s(p,l),e._value):(kn(a),e._value)}switch(c[2]){case 0:{let p=c[3];if(!p)return()=>{};let l=g=>{o.delete(g)};return o.add(p),()=>{l(p)}}case 1:{let p=c[1],l=e._value;s(l,p);break}case 2:return o.size;case 3:{e.auto=!1;break}case 4:e.auto=!0}return e._value};return a[G]=1,he(a,!1),r&&i(t),a};var B=t=>m(t)?t():t;var Ze=class{E=[];_=new Map;get S(){return this.E.length}J;constructor(e){this.J=e}Q(e){let n=this.J(e.value);n&&this._.set(n,e)}X(e){let n=this.J(this.E[e]?.value);n&&this._.delete(n)}static He(e,n){return{items:[],index:e,value:n,order:-1}}w(e){e.order=this.S,this.E.push(e),this.Q(e)}je(e,n){let r=this.S;for(let o=e;o<r;++o)this.E[o].order=o+1;n.order=e,this.E.splice(e,0,n),this.Q(n)}I(e){return this.E[e]}Y(e,n){this.X(e),this.E[e]=n,this.Q(n),n.order=e}ae(e){this.X(e),this.E.splice(e,1);let n=this.S;for(let r=e;r<n;++r)this.E[r].order=r}pe(e){let n=this.S;for(let r=e;r<n;++r)this.X(r);this.E.splice(e)}bt(e){return this._.has(e)}Fe(e){return this._.get(e)?.order??-1}};var Zt=Symbol("r-for"),yt=class t{p;b;Z;x;constructor(e){this.p=e,this.b=e.o.l.for,this.Z=He(this.b),this.x=e.o.l.pre}M(e){let n=e.hasAttribute(this.b),r=de(e,this.Z);for(let o of r)this.$e(o);return n}W(e){return e[Zt]?!0:(e[Zt]=!0,de(e,this.Z).forEach(n=>n[Zt]=!0),!1)}$e(e){if(e.hasAttribute(this.x)||this.W(e))return;let n=e.getAttribute(this.b);if(!n){I(0,this.b,e);return}e.removeAttribute(this.b),this.qe(e,n)}ce(e){return Y(e)?[]:(U(e)&&(e=e()),Symbol.iterator in Object(e)?e:typeof e=="number"?(r=>({*[Symbol.iterator](){for(let o=1;o<=r;o++)yield o}}))(e):Object.entries(e))}qe(e,n){let r=this.Ke(n);if(!r?.list){I(1,this.b,n,e);return}let o=this.p.o.l.key,s=this.p.o.l.keyBind,i=e.getAttribute(o)??e.getAttribute(s);e.removeAttribute(o),e.removeAttribute(s);let a=i?x=>B(B(x)?.[i]):x=>x,c=(x,A)=>a(x)===a(A),f=Ue(e),p=e.parentNode;if(!p)return;let l=`${this.b} => ${n}`,g=new Comment(`__begin__ ${l}`);p.insertBefore(g,e),Ie(g,f),f.forEach(x=>{V(x)}),e.remove();let u=new Comment(`__end__ ${l}`);p.insertBefore(u,g.nextSibling);let y=this.p,v=y.h,S=v.V(),b=(x,A,F)=>{let R=r.createContext(A,x),Q=Ze.He(R.index,A);return v.C(S,()=>{v.w(R.ctx);let ee=F.previousSibling,Le=[];for(let d of f){let N=d.cloneNode(!0);p.insertBefore(N,F),Le.push(N)}for(ye(y,Le),ee=ee.nextSibling;ee!==F;)Q.items.push(ee),ee=ee.nextSibling}),Q},O=(x,A)=>{let F=L.I(x).items,R=F[F.length-1].nextSibling;for(let Q of F)V(Q);L.Y(x,b(x,A,R))},M=(x,A)=>{L.w(b(x,A,u))},Ee=x=>{for(let A of L.I(x).items)V(A)},We=x=>{let A=L.S;for(let F=x;F<A;++F)L.I(F).index(F)},Bt=x=>{let A=L.S;U(x)&&(x=x());let F=B(x[0]);if(T(F)&&F.length===0){ae(g,u),L.pe(0);return}let R=0,Q=Number.MAX_SAFE_INTEGER,ee=A,Le=this.p.o.forGrowThreshold,d=()=>L.S<ee+Le;for(let h of this.ce(x[0])){let D=()=>{if(R<A){let W=L.I(R++);if(c(W.value,h))return;let E=L.Fe(a(h));if(E>=R&&E-R<10){if(--R,Q=Math.min(Q,R),Ee(R),L.ae(R),--A,E>R+1)for(let P=R;P<E-1&&P<A&&!c(L.I(R).value,h);)++P,Ee(R),L.ae(R),--A;D();return}d()?(L.je(R-1,b(R,h,L.I(R-1).items[0])),Q=Math.min(Q,R-1),++A):O(R-1,h)}else M(R++,h)};D()}let N=R;for(A=L.S;R<A;)Ee(R++);L.pe(N),We(Q)},et=()=>{Ge=C(le,Bt)},ve=()=>{tt.stop(),Ge()},tt=v.v(r.list),le=tt.value,Ge,oe=0,L=new Ze(a);for(let x of this.ce(le()[0]))L.w(b(oe++,x,u));k(g,ve),et()}static ze=/\{?\[?\(?([^)}\]]+)\)?\]?\}?([^)]+)?\s+\b(?:in|of)\b\s+([^\s]+)\s*/;Ke(e){let n=t.ze.exec(e);if(!n)return;let r=(n[1]+(n[2]??"")).split(",").map(c=>c.trim()),o=r.length>1?r.length-1:-1,s=o!==-1&&r[o]?.startsWith("#")?r[o]:"";s&&r.splice(o,1);let i=n[3];if(!i||r.length===0)return;let a=/[{[]/.test(e);return{list:i,createContext:(c,f)=>{let p={},l=B(c);if(!a&&r.length===1)p[r[0]]=c;else if(T(l)){let u=0;for(let y of r)p[y]=l[u++]}else for(let u of r)p[u]=l[u];let g={ctx:p,index:q(-1)};return s&&(g.index=p[s.substring(1)]=q(f)),g}}}};var ao=(t,e)=>{for(let n of t){let r=n.cloneNode(!0);e.appendChild(r)}},ht=class{p;D;le;constructor(e){this.p=e,this.D=e.o.l.is,this.le=He(this.D)+", [is]"}M(e){let n=e.hasAttribute(this.D),r=de(e,this.le);for(let o of r)this.T(o);return n}T(e){let n=e.getAttribute(this.D);if(!n){if(n=e.getAttribute("is"),!n||!n.startsWith("regor:"))return;n=`'${n.slice(6)}'`,e.removeAttribute("is")}e.removeAttribute(this.D),this.k(e,n)}B(e,n){let r=Ue(e),o=e.parentNode,s=document.createComment(`__begin__ dynamic ${n??""}`);o.insertBefore(s,e),Ie(s,r),r.forEach(a=>{V(a)}),e.remove();let i=document.createComment(`__end__ dynamic ${n??""}`);return o.insertBefore(i,s.nextSibling),{nodes:r,parent:o,commentBegin:s,commentEnd:i}}k(e,n){let{nodes:r,parent:o,commentBegin:s,commentEnd:i}=this.B(e,` => ${n} `),a=this.p.h.v(n),c=a.value,f=this.p.h,p=f.V(),l={name:""},g=ne(e)?r:[...r[0].childNodes],u=()=>{f.C(p,()=>{let b=c()[0];if(w(b)&&(b=b.name),!z(b)||j(b)){ae(s,i);return}if(l.name===b)return;ae(s,i);let O=document.createElement(b);for(let M of e.getAttributeNames())M!==this.D&&O.setAttribute(M,e.getAttribute(M));ao(g,O),o.insertBefore(O,i),this.p.G(O),l.name=b})},y=[];k(s,()=>{a.stop();for(let b of y)b();y.length=0}),u();let S=C(c,u);y.push(S)}};var Hn={collectRefObj:!0,onBind:(t,e)=>C(e.value,()=>{let r=e.value(),o=e.context,s=r[0];if(w(s))for(let i of Object.entries(s)){let a=i[0],c=i[1],f=o[a];f!==c&&(m(f)?f(c):o[a]=c)}},!0)};var _n={collectRefObj:!0,once:!0,onBind:(t,e)=>{let n=e.value(),r=e.context,o=n[0];if(!w(o))return()=>{};for(let s of Object.entries(o)){let i=s[0],a=s[1],c=r[i];c!==a&&(m(c)?c(a):r[i]=a)}return()=>{}}};var ge=t=>{rt(t)?.onUnmounted?.forEach(n=>{n()}),t.unmounted?.()};var Pe=class{props;start;end;ctx;autoProps=!0;entangle=!0;disableSwitch=!1;onAutoPropsAssigned;fe;constructor(e,n,r,o,s){this.props=e,this.fe=n,this.ctx=r,this.start=o,this.end=s}emit=(e,n)=>{this.fe.dispatchEvent(new CustomEvent(e,{detail:n}))};unmount(){let e=this.start.nextSibling,n=this.end;for(;e&&e!==n;)V(e),e=e.nextSibling;ge(this)}};var en=Symbol("scope"),gt=t=>{try{xn();let e=t();qt(e);let n={context:e,unmount:()=>ge(e),[en]:1};return n[en]=1,n}finally{Cn()}},Bn=t=>w(t)?en in t:!1;var bt=(t,e)=>{if(t===e)return()=>{};let n=C(t,o=>e(o)),r=C(e,o=>t(o));return e(t()),()=>{n(),r()}};var Tt=t=>{rt(t)?.onMounted?.forEach(n=>{n()}),t.mounted?.()};var Vn={collectRefObj:!0,onBind:(t,e,n,r,o,s)=>{if(!r)return()=>{};let i=_(r);return C(e.value,()=>{let c=e.refs[0]??e.value()[0],f=e.context,p=f[r];p!==c&&(m(p)?p(c):f[i]=c)},!0)}};var Et=class{p;ue;constructor(e){this.p=e,this.ue=e.o.l.inherit}M(e){this.We(e)}We(e){let n=this.p,r=n.h,o=n.o.me,s=n.o.de,i=r.Ge(),a=[...o.keys(),...Object.keys(i),...[...o.keys()].map(_e),...[...Object.keys(i)].map(_e)].join(",");if(j(a))return;let c=e.querySelectorAll(a),f=e.matches?.(a)?[e,...c]:c;for(let p of f){if(p.hasAttribute(n.x))continue;let l=p.parentNode;if(!l)continue;let g=p.nextSibling,u=_(p.tagName).toUpperCase(),v=i[u]??s.get(u);if(!v)continue;let S=v.template.element;if(!S)continue;let b=p.parentElement;if(!b)continue;let O=new Comment(" begin component: "+p.tagName),M=new Comment(" end component: "+p.tagName);b.insertBefore(O,p),p.remove();let Ee=n.o.l.props,We=n.o.l.propsOnce,Bt=n.o.l.bind,et=(d,N)=>{let h={},D=d.hasAttribute(Ee),W=d.hasAttribute(We);return r.C(N,()=>{r.w(h),D&&n.T(Hn,d,Ee),W&&n.T(_n,d,We);let E=v.props;if(!E||E.length===0)return;E=E.map(_);for(let xe of E.concat(E.map(_e))){let se=d.getAttribute(xe);se!==null&&(h[_(xe)]=se,d.removeAttribute(xe))}let P=n.ee.ye(d,!1);for(let[xe,se]of P.entries()){let[Ce,Vt]=se.terms;Vt&&E.includes(_(Vt))&&(Ce!=="."&&Ce!==":"&&Ce!==Bt||n.T(Vn,d,xe,!0,Vt,se.flags))}}),h},ve=[...r.V()],tt=()=>{let d=et(p,ve),N=new Pe(d,p,ve,O,M),h=gt(()=>v.context(N)??{}).context;if(N.autoProps){for(let[D,W]of Object.entries(d))if(D in h){let E=h[D];if(E===W)continue;N.entangle&&m(E)&&m(W)?k(O,bt(W,E)):m(E)?E(W):h[D]=B(W)}else h[D]=W;N.onAutoPropsAssigned?.()}return{componentCtx:h,head:N}},{componentCtx:le,head:Ge}=tt(),oe=[...ce(S)],L=oe.length,x=p.childNodes.length===0,A=d=>{let N=d.parentElement;if(x){for(let E of[...d.childNodes])N.insertBefore(E,d);return}let h=d.name;j(h)&&(h=d.getAttributeNames().filter(E=>E.startsWith("#"))[0],j(h)?h="default":h=h.substring(1));let D=p.querySelector(`template[name='${h}'], template[\\#${h}]`);!D&&h==="default"&&(D=p.querySelector("template:not([name])"),D&&D.getAttributeNames().filter(E=>E.startsWith("#")).length>0&&(D=null));let W=E=>{Ge.disableSwitch||r.C(ve,()=>{r.w(le);let P=et(d,r.V());r.C(ve,()=>{r.w(P);let xe=r.V(),se=wn(xe);for(let Ce of E)Se(Ce)&&(Ce.setAttribute(Qe,se),Kt(se),k(Ce,()=>{Wt(se)}))})})};if(D){let E=[...ce(D)];for(let P of E)N.insertBefore(P,d);W(E)}else{if(h!=="default"){for(let P of[...ce(d)])N.insertBefore(P,d);return}let E=[...ce(p)].filter(P=>!ne(P));for(let P of E)N.insertBefore(P,d);W(E)}},F=d=>{if(!Se(d))return;let N=d.querySelectorAll("slot");if(Mn(d)){A(d),d.remove();return}for(let h of N)A(h),h.remove()};(()=>{for(let d=0;d<L;++d)oe[d]=oe[d].cloneNode(!0),l.insertBefore(oe[d],g),F(oe[d])})(),b.insertBefore(M,g);let Q=()=>{if(!v.inheritAttrs)return;let d=oe.filter(h=>h.nodeType===Node.ELEMENT_NODE);d.length>1&&(d=d.filter(h=>h.hasAttribute(this.ue)));let N=d[0];if(N)for(let h of p.getAttributeNames()){if(h===Ee||h===We)continue;let D=p.getAttribute(h);if(h==="class")N.classList.add(...D.split(" "));else if(h==="style"){let W=N.style,E=p.style;for(let P of E)W.setProperty(P,E.getPropertyValue(P))}else N.setAttribute(pt(h,n.o),D)}},ee=()=>{for(let d of p.getAttributeNames())!d.startsWith("@")&&!d.startsWith(n.o.l.on)&&p.removeAttribute(d)},Le=()=>{Q(),ee(),r.w(le),n.he(p,!1),le.$emit=Ge.emit,ye(n,oe),k(p,()=>{ge(le)}),k(O,()=>{te(p)}),Tt(le)};r.C(ve,Le)}}};var tn=class{name;terms=[];flags=[];elements=[];constructor(e){this.name=e,this.v()}v(){let e=this.name,n=e.startsWith(".");n&&(e=":"+e.slice(1));let r=e.indexOf("."),o=this.terms=(r<0?e:e.substring(0,r)).split(/[:@]/);if(j(o[0])&&(o[0]=n?".":e[0]),r>=0){let s=this.flags=e.slice(r+1).split(".");if(s.includes("camel")){let i=o.length-1;o[i]=_(o[i])}s.includes("prop")&&(o[0]=".")}}},vt=class{p;ge;constructor(e){this.p=e,this.ge=e.o.Je()}ye(e,n){let r=new Map;if(!Xe(e))return r;let o=this.ge,s=a=>{let c=a.getAttributeNames().filter(f=>o.some(p=>f.startsWith(p)));for(let f of c)r.has(f)||r.set(f,new tn(f)),r.get(f).elements.push(a)};if(s(e),!n)return r;let i=e.querySelectorAll("*");for(let a of i)s(a);return r}};var xt={};var Ct=class{h;be;xe;Te;Ee;ee;o;x;Re;constructor(e){this.h=e,this.o=e.o,this.xe=new yt(this),this.be=new ct(this),this.Te=new ht(this),this.Ee=new Et(this),this.ee=new vt(this),this.x=this.o.l.pre,this.Re=this.o.l.dynamic}Qe(e){let n=ne(e)?[e]:e.querySelectorAll("template");for(let r of n){if(r.hasAttribute(this.x))continue;let o=r.parentNode;if(!o)continue;let s=r.nextSibling;if(r.remove(),!r.content)continue;let i=[...r.content.childNodes];for(let a of i)o.insertBefore(a,s);ye(this,i)}}G(e){e.nodeType!==Node.ELEMENT_NODE||e.hasAttribute(this.x)||this.be.M(e)||this.xe.M(e)||this.Te.M(e)||(this.Ee.M(e),this.Qe(e),this.he(e,!0))}he(e,n){let r=this.ee.ye(e,n),o=this.o.H;for(let[s,i]of r.entries()){let[a,c]=i.terms,f=o[s]??o[a];if(!f){console.error("directive not found:",a);continue}i.elements.forEach(p=>{this.T(f,p,s,!1,c,i.flags)})}}T(e,n,r,o,s,i){if(n.hasAttribute(this.x))return;let a=n.getAttribute(r);n.removeAttribute(r);let c=f=>{let p=f.getAttribute(Qe);return p||(f.parentElement?c(f.parentElement):null)};if(Gt()){let f=c(n);if(f){this.h.C(On(f),()=>{this.k(e,n,a,s,i)});return}}this.k(e,n,a,s,i)}Xe(e,n,r){if(e!==xt)return!1;if(j(r))return!0;let o=document.querySelector(r);if(o){let s=n.parentElement;if(!s)return!0;let i=new Comment(`teleported => '${r}'`);s.insertBefore(i,n),n.teleportedFrom=i,i.teleportedTo=n,k(i,()=>{V(n)}),o.appendChild(n)}return!0}k(e,n,r,o,s){if(n.nodeType!==Node.ELEMENT_NODE||r==null||this.Xe(e,n,r))return;let i=this.h.v(r,e.isLazy,e.isLazyKey,e.collectRefObj,e.once),a=[];k(n,()=>{i.stop(),p?.stop();for(let S of a)S();a.length=0});let f=Ln(o,this.Re),p;f&&(p=this.h.v(_(f),void 0,void 0,void 0,e.once));let l,g=()=>(l=i.value(),l),u,y=()=>p?(u=p.value()[0],u):(u=o,o),v=()=>{if(!e.onChange)return;let S=C(i.value,b=>{let O=l,M=u;e.onChange?.(n,g(),O,y(),M,s)});if(a.push(S),p){let b=C(p.value,O=>{let M=u;e.onChange?.(n,g(),M,y(),M,s)});a.push(b)}};e.once||v(),e.onBind&&a.push(e.onBind(n,i,r,o,p,s)),e.onChange?.(n,g(),void 0,y(),void 0,s)}};var co=9,po=10,fo=13,lo=32,be=46,Rt=44,uo=39,mo=34,St=40,je=41,wt=91,Ot=93,nn=63,yo=59,Pn=58,ho=123,At=125,on=43,go=45,jn=96,$n=47,bo=92,Fn=[2,3],qn=[on,go],Qn={"-":1,"!":1,"~":1,"+":1,new:1},Xn={"=":2.5,"*=":2.5,"**=":2.5,"/=":2.5,"%=":2.5,"+=":2.5,"-=":2.5,"<<=":2.5,">>=":2.5,">>>=":2.5,"&=":2.5,"^=":2.5,"|=":2.5},Fe={"=>":2,...Xn,"||":3,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"/":12,"%":12,"**":13},Yn=Object.keys(Xn),To=new Set(Yn),Nt=new Set;Nt.add("=>");Yn.forEach(t=>Nt.add(t));var Eo=new Set(["$","_"]),zn={true:!0,false:!1,null:null},vo="this";function Zn(t){return Math.max(0,...Object.keys(t).map(e=>e.length))}var xo=Zn(Qn),Co=Zn(Fe),qe="Expected ",Ae="Unexpected ",an="Unclosed ",Ro=qe+":",Kn=qe+"expression",So="missing }",wo=Ae+"object property",Oo=an+"(",Wn=qe+"comma",Gn=Ae+"token ",Ao=Ae+"period",rn=qe+"expression after ",No="missing unaryOp argument",Mo=an+"[",Lo=qe+"exponent (",ko="Variable names cannot start with a number (",Io=an+'quote after "';var $e=t=>t>=48&&t<=57,Jn=t=>Fe[t]||0,sn=class{Ye={0:[this.Ze],1:[this.et,this.tt,this.nt],2:[this.rt,this.ot,this.st,this.ve,this.it],3:[this.at,this.pt,this.ct]};r;e;get N(){return this.r.charAt(this.e)}get f(){return this.r.charCodeAt(this.e)}u(e){return this.r.charCodeAt(this.e)===e}constructor(e){this.r=e,this.e=0}U(e){let n=String.fromCharCode(e);return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!(n in Fe)||Eo.has(n)}te(e){return this.U(e)||$e(e)}i(e){return new Error(`${e} at character ${this.e}`)}L(e,n,r){let o=this.Ye[e];if(!o)return r;let s={node:r},i=a=>{a.call(this,s)};return n===0?o.forEach(i):o.find(i),s.node}y(){let e=this.f,n=this.r,r=this.e;for(;e===lo||e===co||e===po||e===fo;)e=n.charCodeAt(++r);this.e=r}parse(){let e=this.ne();return e.length===1?e[0]:{type:0,body:e}}ne(e){let n=[];for(;this.e<this.r.length;){let r=this.f;if(r===yo||r===Rt)this.e++;else{let o=this.O();if(o)n.push(o);else if(this.e<this.r.length){if(r===e)break;throw this.i(Ae+'"'+this.N+'"')}}}return n}O(){let e=this.L(0,1)??this.Ce();return this.y(),this.L(1,0,e)}re(){this.y();let e=this.e,n=this.r,r=n.substr(e,Co),o=r.length;for(;o>0;){if(r in Fe&&(!this.U(this.f)||e+r.length<n.length&&!this.te(n.charCodeAt(e+r.length))))return e+=o,this.e=e,r;r=r.substr(0,--o)}return!1}Ce(){let e,n,r,o,s,i,a,c;if(s=this.j(),!s||(n=this.re(),!n))return s;if(o={value:n,prec:Jn(n),right_a:Nt.has(n)},i=this.j(),!i)throw this.i(rn+n);let f=[s,o,i];for(;n=this.re();){if(r=Jn(n),r===0){this.e-=n.length;break}o={value:n,prec:r,right_a:Nt.has(n)},c=n;let p=l=>o.right_a&&l.right_a?r>l.prec:r<=l.prec;for(;f.length>2&&p(f[f.length-2]);)i=f.pop(),n=f.pop().value,s=f.pop(),e={type:8,operator:n,left:s,right:i},f.push(e);if(e=this.j(),!e)throw this.i(rn+c);f.push(o,e)}for(a=f.length-1,e=f[a];a>1;)e={type:8,operator:f[a-1].value,left:f[a-2],right:e},a-=2;return e}j(){let e,n,r;if(this.y(),r=this.L(2,1),r)return this.L(3,0,r);let o=this.f;if($e(o)||o===be)return this.lt();if(o===uo||o===mo)r=this.ft();else if(o===wt)r=this.ut();else{for(e=this.r.substr(this.e,xo),n=e.length;n>0;){if(Object.prototype.hasOwnProperty.call(Qn,e)&&(!this.U(this.f)||this.e+e.length<this.r.length&&!this.te(this.r.charCodeAt(this.e+e.length)))){this.e+=n;let s=this.j();if(!s)throw this.i(No);return this.L(3,0,{type:7,operator:e,argument:s})}e=e.substr(0,--n)}this.U(o)?(r=this.oe(),r.name in zn?r={type:4,value:zn[r.name],raw:r.name}:r.name===vo&&(r={type:5})):o===St&&(r=this.mt())}return r?(r=this.F(r),this.L(3,0,r)):this.L(3,0,!1)}F(e){this.y();let n=this.f;for(;n===be||n===wt||n===St||n===nn;){let r;if(n===nn){if(this.r.charCodeAt(this.e+1)!==be)break;r=!0,this.e+=2,this.y(),n=this.f}if(this.e++,n===wt){if(e={type:3,computed:!0,object:e,property:this.O()},this.y(),n=this.f,n!==Ot)throw this.i(Mo);this.e++}else n===St?e={type:6,arguments:this.Se(je),callee:e}:(n===be||r)&&(r&&this.e--,this.y(),e={type:3,computed:!1,object:e,property:this.oe()});r&&(e.optional=!0),this.y(),n=this.f}return e}lt(){let e="",n;for(;$e(this.f);)e+=this.r.charAt(this.e++);if(this.u(be))for(e+=this.r.charAt(this.e++);$e(this.f);)e+=this.r.charAt(this.e++);if(n=this.N,n==="e"||n==="E"){for(e+=this.r.charAt(this.e++),n=this.N,(n==="+"||n==="-")&&(e+=this.r.charAt(this.e++));$e(this.f);)e+=this.r.charAt(this.e++);if(!$e(this.r.charCodeAt(this.e-1)))throw this.i(Lo+e+this.N+")")}let r=this.f;if(this.U(r))throw this.i(ko+e+this.N+")");if(r===be||e.length===1&&e.charCodeAt(0)===be)throw this.i(Ao);return{type:4,value:parseFloat(e),raw:e}}ft(){let e="",n=this.e,r=this.r.charAt(this.e++),o=!1;for(;this.e<this.r.length;){let s=this.r.charAt(this.e++);if(s===r){o=!0;break}else if(s==="\\")switch(s=this.r.charAt(this.e++),s){case"n":e+=`
2
+ `;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=s}else e+=s}if(!o)throw this.i(Io+e+'"');return{type:4,value:e,raw:this.r.substring(n,this.e)}}oe(){let e=this.f,n=this.e;if(this.U(e))this.e++;else throw this.i(Ae+this.N);for(;this.e<this.r.length&&(e=this.f,this.te(e));)this.e++;return{type:2,name:this.r.slice(n,this.e)}}Se(e){let n=[],r=!1,o=0;for(;this.e<this.r.length;){this.y();let s=this.f;if(s===e){if(r=!0,this.e++,e===je&&o&&o>=n.length)throw this.i(Gn+String.fromCharCode(e));break}else if(s===Rt){if(this.e++,o++,o!==n.length){if(e===je)throw this.i(Gn+",");if(e===Ot)for(let i=n.length;i<o;i++)n.push(null)}}else{if(n.length!==o&&o!==0)throw this.i(Wn);{let i=this.O();if(!i||i.type===0)throw this.i(Wn);n.push(i)}}}if(!r)throw this.i(qe+String.fromCharCode(e));return n}mt(){this.e++;let e=this.ne(je);if(this.u(je))return this.e++,e.length===1?e[0]:e.length?{type:1,expressions:e}:!1;throw this.i(Oo)}ut(){return this.e++,{type:9,elements:this.Se(Ot)}}rt(e){if(this.u(ho)){this.e++;let n=[];for(;!isNaN(this.f);){if(this.y(),this.u(At)){this.e++,e.node=this.F({type:10,properties:n});return}let r=this.O();if(!r)break;if(this.y(),r.type===2&&(this.u(Rt)||this.u(At)))n.push({type:12,computed:!1,key:r,value:r,shorthand:!0});else if(this.u(Pn)){this.e++;let o=this.O();if(!o)throw this.i(wo);let s=r.type===9;n.push({type:12,computed:s,key:s?r.elements[0]:r,value:o,shorthand:!1}),this.y()}else r&&n.push(r);this.u(Rt)&&this.e++}throw this.i(So)}}ot(e){let n=this.f;if(qn.some(r=>r===n&&r===this.r.charCodeAt(this.e+1))){this.e+=2;let r=e.node={type:13,operator:n===on?"++":"--",argument:this.F(this.oe()),prefix:!0};if(!r.argument||!Fn.includes(r.argument.type))throw this.i(Ae+r.operator)}}pt(e){if(e.node){let n=this.f;if(qn.some(r=>r===n&&r===this.r.charCodeAt(this.e+1))){if(!Fn.includes(e.node.type))throw this.i(Ae+e.node.operator);this.e+=2,e.node={type:13,operator:n===on?"++":"--",argument:e.node,prefix:!1}}}}st(e){[0,1,2].every(n=>this.r.charCodeAt(this.e+n)===be)&&(this.e+=3,e.node={type:14,argument:this.O()})}nt(e){if(e.node&&this.u(nn)){this.e++;let n=e.node,r=this.O();if(!r)throw this.i(Kn);if(this.y(),this.u(Pn)){this.e++;let o=this.O();if(!o)throw this.i(Kn);if(e.node={type:11,test:n,consequent:r,alternate:o},n.operator&&Fe[n.operator]<=.9){let s=n;for(;s.right.operator&&Fe[s.right.operator]<=.9;)s=s.right;e.node.test=s.right,s.right=e.node,e.node=n}}else throw this.i(Ro)}}Ze(e){if(this.y(),this.u(St)){let n=this.e;if(this.e++,this.y(),this.u(je)){this.e++;let r=this.re();if(r==="=>"){let o=this.Ce();if(!o)throw this.i(rn+r);e.node={type:15,params:null,body:o};return}}this.e=n}}et(e){this.we(e.node)}we(e){e&&(Object.values(e).forEach(n=>{n&&typeof n=="object"&&this.we(n)}),e.operator==="=>"&&(e.type=15,e.params=e.left?[e.left]:null,e.body=e.right,e.params&&e.params[0].type===1&&(e.params=e.params[0].expressions),delete e.left,delete e.right,delete e.operator))}tt(e){e.node&&this.$(e.node)}$(e){To.has(e.operator)?(e.type=16,this.$(e.left),this.$(e.right)):e.operator||Object.values(e).forEach(n=>{n&&typeof n=="object"&&this.$(n)})}ct(e){if(!e.node)return;let n=e.node.type;(n===2||n===3)&&this.u(jn)&&(e.node={type:17,tag:e.node,quasi:this.ve(e)})}ve(e){if(!this.u(jn))return;let n={type:19,quasis:[],expressions:[]},r="",o="",s=!1,i=this.r.length,a=()=>n.quasis.push({type:18,value:{raw:o,cooked:r},tail:s});for(;this.e<i;){let c=this.r.charAt(++this.e);if(c==="`")return this.e+=1,s=!0,a(),e.node=n,n;if(c==="$"&&this.r.charAt(this.e+1)==="{"){if(this.e+=2,a(),o="",r="",n.expressions.push(...this.ne(At)),!this.u(At))throw this.i("unclosed ${")}else if(c==="\\")switch(o+=c,c=this.r.charAt(++this.e),o+=c,c){case"n":r+=`
3
+ `;break;case"r":r+="\r";break;case"t":r+=" ";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:r+=c}else r+=c,o+=c}throw this.i("Unclosed `")}at(e){let n=e.node;if(!n||n.operator!=="new"||!n.argument)return;if(!n.argument||![6,3].includes(n.argument.type))throw this.i("Expected new function()");e.node=n.argument;let r=e.node;for(;r.type===3||r.type===6&&r?.callee?.type===3;)r=r.type===3?r.object:r.callee.object;r.type=20}it(e){if(!this.u($n))return;let n=++this.e,r=!1;for(;this.e<this.r.length;){if(this.f===$n&&!r){let o=this.r.slice(n,this.e),s="";for(;++this.e<this.r.length;){let a=this.f;if(a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57)s+=this.N;else break}let i;try{i=new RegExp(o,s)}catch(a){throw this.i(a.message)}return e.node={type:4,value:i,raw:this.r.slice(n-1,this.e)},e.node=this.F(e.node),e.node}this.u(wt)?r=!0:r&&this.u(Ot)&&(r=!1),this.e+=this.u(bo)?2:1}throw this.i("Unclosed Regex")}},er=t=>new sn(t).parse();var Do={"=>":(t,e)=>{},"=":(t,e)=>{},"*=":(t,e)=>{},"**=":(t,e)=>{},"/=":(t,e)=>{},"%=":(t,e)=>{},"+=":(t,e)=>{},"-=":(t,e)=>{},"<<=":(t,e)=>{},">>=":(t,e)=>{},">>>=":(t,e)=>{},"&=":(t,e)=>{},"^=":(t,e)=>{},"|=":(t,e)=>{},"||":(t,e)=>t()||e(),"??":(t,e)=>t()??e(),"&&":(t,e)=>t()&&e(),"|":(t,e)=>t|e,"^":(t,e)=>t^e,"&":(t,e)=>t&e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"<":(t,e)=>t<e,">":(t,e)=>t>e,"<=":(t,e)=>t<=e,">=":(t,e)=>t>=e,in:(t,e)=>t in e,"<<":(t,e)=>t<<e,">>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e,"%":(t,e)=>t%e,"**":(t,e)=>t**e},Uo={"-":t=>-t,"+":t=>+t,"!":t=>!t,"~":t=>~t,new:t=>t},or=t=>{if(!t?.some(rr))return t;let e=[];return t.forEach(n=>rr(n)?e.push(...n):e.push(n)),e},tr=(...t)=>or(t),cn=(t,e)=>{if(!t)return e;let n=Object.create(e??{});return n.$event=t,n},Ho={"++":(t,e)=>{let n=t[e];if(m(n)){let r=n();return n(++r),r}return++t[e]},"--":(t,e)=>{let n=t[e];if(m(n)){let r=n();return n(--r),r}return--t[e]}},_o={"++":(t,e)=>{let n=t[e];if(m(n)){let r=n();return n(r+1),r}return t[e]++},"--":(t,e)=>{let n=t[e];if(m(n)){let r=n();return n(r-1),r}return t[e]--}},nr={"=":(t,e,n)=>{let r=t[e];return m(r)?r(n):t[e]=n},"+=":(t,e,n)=>{let r=t[e];return m(r)?r(r()+n):t[e]+=n},"-=":(t,e,n)=>{let r=t[e];return m(r)?r(r()-n):t[e]-=n},"*=":(t,e,n)=>{let r=t[e];return m(r)?r(r()*n):t[e]*=n},"/=":(t,e,n)=>{let r=t[e];return m(r)?r(r()/n):t[e]/=n},"%=":(t,e,n)=>{let r=t[e];return m(r)?r(r()%n):t[e]%=n},"**=":(t,e,n)=>{let r=t[e];return m(r)?r(r()**n):t[e]**=n},"<<=":(t,e,n)=>{let r=t[e];return m(r)?r(r()<<n):t[e]<<=n},">>=":(t,e,n)=>{let r=t[e];return m(r)?r(r()>>n):t[e]>>=n},">>>=":(t,e,n)=>{let r=t[e];return m(r)?r(r()>>>n):t[e]>>>=n},"|=":(t,e,n)=>{let r=t[e];return m(r)?r(r()|n):t[e]|=n},"&=":(t,e,n)=>{let r=t[e];return m(r)?r(r()&n):t[e]&=n},"^=":(t,e,n)=>{let r=t[e];return m(r)?r(r()^n):t[e]^=n}},Mt=(t,e)=>U(t)?t.bind(e):t,pn=class{m;Oe;Ae;Me;A;Ne;Le;constructor(e,n,r,o,s){this.m=T(e)?e:[e],this.Oe=n,this.Ae=r,this.Me=o,this.Le=!!s}ke(e,n){if(n&&e in n)return n;for(let r of this.m)if(e in r)return r}2(e,n,r){let o=e.name;if(o==="$root")return this.m[this.m.length-1];if(o==="$parent")return this.m[1];if(o==="$ctx")return[...this.m];if(r&&o in r)return this.A=r[o],Mt(B(r[o]),r);for(let i of this.m)if(o in i)return this.A=i[o],Mt(B(i[o]),i);let s=this.Oe;if(s&&o in s)return this.A=s[o],Mt(B(s[o]),s)}5(e,n,r){return this.m[0]}0(e,n,r){return this.Ve(n,r,tr,...e.body)}1(e,n,r){return this.R(n,r,(...o)=>o.pop(),...e.expressions)}3(e,n,r){let{obj:o,key:s}=this.se(e,n,r),i=o?.[s];return this.A=i,Mt(B(i),o)}4(e,n,r){return e.value}6(e,n,r){let o=(i,...a)=>U(i)?i(...or(a)):i,s=this.R(++n,r,o,e.callee,...e.arguments);return this.A=s,s}7(e,n,r){return this.R(n,r,Uo[e.operator],e.argument)}8(e,n,r){let o=Do[e.operator];switch(e.operator){case"||":case"&&":case"??":return o(()=>this.g(e.left,n,r),()=>this.g(e.right,n,r))}return this.R(n,r,o,e.left,e.right)}9(e,n,r){return this.Ve(++n,r,tr,...e.elements)}10(e,n,r){let o={},s=(...i)=>{i.forEach(a=>{Object.assign(o,a)})};return this.R(++n,r,s,...e.properties),o}11(e,n,r){return this.R(n,r,o=>this.g(o?e.consequent:e.alternate,n,r),e.test)}12(e,n,r){let o={},s=p=>p?.type!==15,i=this.Me??(()=>!1),a=n===0&&this.Le,c=p=>this.Ie(a,e.key,n,cn(p,r)),f=p=>this.Ie(a,e.value,n,cn(p,r));if(e.shorthand){let p=e.key.name;o[p]=s(e.key)&&i(p,n)?c:c()}else if(e.computed){let p=B(c());o[p]=s(e.value)&&i(p,n)?f:f()}else{let p=e.key.type===4?e.key.value:e.key.name;o[p]=s(e.value)&&i(p,n)?()=>f:f()}return o}se(e,n,r){let o=this.g(e.object,n,r),s=e.computed?this.g(e.property,n,r):e.property.name;return{obj:o,key:s}}13(e,n,r){let o=e.argument,s=e.operator,i=e.prefix?Ho:_o;if(o.type===2){let a=o.name,c=this.ke(a,r);return Y(c)?void 0:i[s](c,a)}if(o.type===3){let{obj:a,key:c}=this.se(o,n,r);return i[s](a,c)}}16(e,n,r){let o=e.left,s=e.operator;if(o.type===2){let i=o.name,a=this.ke(i,r);if(Y(a))return;let c=this.g(e.right,n,r);return nr[s](a,i,c)}if(o.type===3){let{obj:i,key:a}=this.se(o,n,r),c=this.g(e.right,n,r);return nr[s](i,a,c)}}14(e,n,r){let o=this.g(e.argument,n,r);return T(o)&&(o.s=sr),o}17(e,n,r){return this[6]({type:6,callee:e.tag,arguments:[{type:9,elements:e.quasi.quasis},...e.quasi.expressions]},n,r)}19(e,n,r){let o=(...s)=>s.reduce((i,a,c)=>i+=a+e.quasis[c+1].value.cooked,e.quasis[0].value.cooked);return this.R(n,r,o,...e.expressions)}18(e,n,r){return e.value.cooked}20(e,n,r){let o=(s,...i)=>new s(...i);return this.R(n,r,o,e.callee,...e.arguments)}15(e,n,r){return(...o)=>{let s=Object.create(r??{}),i=e.params;if(i){let a=0;for(let c of i)s[c.name]=o[a++]}return this.g(e.body,n,s)}}g(e,n,r){let o=B(this[e.type](e,n,r));return this.Ne=e.type,o}Ie(e,n,r,o){let s=this.g(n,r,o);return e&&this.De()?this.A:s}De(){let e=this.Ne;return(e===2||e===3||e===6)&&m(this.A)}eval(e,n){let{value:r,refs:o}=lt(()=>this.g(e,-1,n)),s={value:r,refs:o};return this.De()&&(s.ref=this.A),s}R(e,n,r,...o){let s=o.map(i=>i&&this.g(i,e,n));return r(...s)}Ve(e,n,r,...o){let s=this.Ae;if(!s)return this.R(e,n,r,...o);let i=o.map((a,c)=>a&&(a.type!==15&&s(c,e)?f=>this.g(a,e,cn(f,n)):this.g(a,e,n)));return r(...i)}},sr=Symbol("s"),rr=t=>t?.s===sr,ir=(t,e,n,r,o,s,i)=>new pn(e,n,r,o,i).eval(t,s);var ar={},Lt=class{m;o;constructor(e,n){this.m=e,this.o=n}w(e){this.m=[e,...this.m]}Ge(){return this.m.map(n=>n.components).filter(n=>!!n).reverse().reduce((n,r)=>{for(let[o,s]of Object.entries(r))n[o.toUpperCase()]=s;return n},{})}v(e,n,r,o,s){let i=q([]),a=[],c=()=>{for(let u of a)u();a.length=0},f={value:i,stop:c,refs:[],context:this.m[0]};if(j(e))return f;let p=this.o.globalContext,l=[],g=(u,y,v,S)=>{try{let b=ir(u,y,p,n,r,S,o);return v&&l.push(...b.refs),{value:b.value,refs:b.refs,ref:b.ref}}catch(b){I(6,`evaluation error: ${e}`,b)}return{value:void 0,refs:[]}};try{let u=ar[e]??er("["+e+"]");ar[e]=u;let y=this.m,v=()=>{l.splice(0),c();let S=u.elements.map((b,O)=>n?.(O,-1)?{value:M=>g(b,y,!1,{$event:M}).value,refs:[]}:g(b,y,!0));if(!s)for(let b of l){let O=C(b,v);a.push(O)}i(S.map(b=>b.value)),f.refs=S.map(b=>b.ref)};v()}catch(u){I(6,`parse error: ${e}`,u)}return f}V(){return this.m}Ue=[];Y(e){this.Ue.push(this.m),this.m=e}C(e,n){try{this.Y(e),n()}finally{this.dt()}}dt(){this.m=this.Ue.pop()??[]}};var cr="http://www.w3.org/1999/xlink",Bo={itemscope:2,allowfullscreen:2,formnovalidate:2,ismap:2,nomodule:2,novalidate:2,readonly:2,async:1,autofocus:1,autoplay:1,controls:1,default:1,defer:1,disabled:1,hidden:1,inert:1,loop:1,open:1,required:1,reversed:1,scoped:1,seamless:1,checked:1,muted:1,multiple:1,selected:1};function Vo(t){return!!t||t===""}var fn={onChange:(t,e,n,r,o,s)=>{if(r){s&&s.includes("camel")&&(r=_(r)),kt(t,r,e[0],o);return}let i=e.length;for(let a=0;a<i;++a){let c=e[a];if(T(c)){let f=n?.[a]?.[0],p=c[0],l=c[1];kt(t,p,l,f)}else if(w(c))for(let f of Object.entries(c)){let p=f[0],l=f[1],g=n?.[a],u=g&&p in g?p:void 0;kt(t,p,l,u)}else{let f=n?.[a],p=e[a++],l=e[a];kt(t,p,l,f)}}}},kt=(t,e,n,r)=>{if(r&&r!==e&&t.removeAttribute(r),Y(e)){I(3,name,t);return}if(!z(e)){I(6,`Attribute key is not string at ${t.outerHTML}`,e);return}if(e.startsWith("xlink:")){Y(n)?t.removeAttributeNS(cr,e.slice(6,e.length)):t.setAttributeNS(cr,e,n);return}let o=e in Bo;Y(n)||o&&!Vo(n)?t.removeAttribute(e):t.setAttribute(e,o?"":n)};var fr={onChange:(t,e,n)=>{let r=e.length;for(let o=0;o<r;++o){let s=e[o],i=n?.[o];if(T(s)){let a=s.length;for(let c=0;c<a;++c)pr(t,s[c],i?.[c])}else pr(t,s,i)}}},pr=(t,e,n)=>{let r=t.classList,o=z(e),s=z(n);if(e&&!o){if(n&&!s)for(let i in n)i in e||r.remove(i);for(let i in e)e[i]&&r.add(i)}else o?n!==e&&(s&&r.remove(...n?.split(",")),r.add(...e.split(","))):n&&s&&r.remove(...n?.split(","))};var lr={onChange:(t,e)=>{let[n,r]=e;U(r)?r(t,n):t.innerHTML=n?.toString()}};function Po(t,e){if(t.length!==e.length)return!1;let n=!0;for(let r=0;n&&r<t.length;r++)n=pe(t[r],e[r]);return n}function pe(t,e){if(t===e)return!0;let n=$t(t),r=$t(e);if(n||r)return n&&r?t.getTime()===e.getTime():!1;if(n=Je(t),r=Je(e),n||r)return t===e;if(n=T(t),r=T(e),n||r)return n&&r?Po(t,e):!1;if(n=w(t),r=w(e),n||r){if(!n||!r)return!1;let o=Object.keys(t).length,s=Object.keys(e).length;if(o!==s)return!1;for(let i in t){let a=t.hasOwnProperty(i),c=e.hasOwnProperty(i);if(a&&!c||!a&&c||!pe(t[i],e[i]))return!1}}return String(t)===String(e)}function It(t,e){return t.findIndex(n=>pe(n,e))}var ur=t=>{let e=parseFloat(t);return isNaN(e)?t:e};var Dt=t=>{if(!m(t))throw H(3,"pause");t(void 0,void 0,3)};var Ut=t=>{if(!m(t))throw H(3,"resume");t(void 0,void 0,4)};var jo=(t,e)=>{let n=gr(t);if(n&&dr(t))T(e)?e=It(e,fe(t))>-1:X(e)?e=e.has(fe(t)):e=Go(t,e),t.checked=e;else if(n&&yr(t))t.checked=pe(e,fe(t));else if(n||br(t))hr(t)?t.value!==e?.toString()&&(t.value=e):t.value!==e&&(t.value=e);else if(Tr(t)){let r=t.options,o=r.length,s=t.multiple;for(let i=0;i<o;i++){let a=r[i],c=fe(a);if(s)T(e)?a.selected=It(e,c)>-1:a.selected=e.has(c);else if(pe(fe(a),e)){t.selectedIndex!==i&&(t.selectedIndex=i);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}else I(7,t)},Ht=t=>(m(t)&&(t=t()),U(t)&&(t=t()),t?z(t)?{trim:t.includes("trim"),lazy:t.includes("lazy"),number:t.includes("number"),int:t.includes("int")}:{trim:!!t.trim,lazy:!!t.lazy,number:!!t.number,int:!!t.int}:{trim:!1,lazy:!1,number:!1,int:!1}),dr=t=>t.type==="checkbox",yr=t=>t.type==="radio",hr=t=>t.type==="number"||t.type==="range",gr=t=>t.tagName==="INPUT",br=t=>t.tagName==="TEXTAREA",Tr=t=>t.tagName==="SELECT",$o=(t,e)=>{let n=e.value,r=Ht(n()[1]),o=e.refs[0];if(!o)return I(8,t),()=>{};let s=gr(t);return s&&dr(t)?qo(t,o):s&&yr(t)?Jo(t,o):s||br(t)?Fo(t,r,o,n):Tr(t)?Qo(t,o,n):(I(7,t),()=>{})},Er={onChange:(t,e)=>{jo(t,e[0])},onBind:(t,e)=>$o(t,e)},mr=/[.,' ·٫]/,Fo=(t,e,n,r)=>{let s=e.lazy?"change":"input",i=hr(t),a=()=>{Ht(r()[1]).trim&&(t.value=t.value.trim())},c=g=>{let u=g.target;u.composing=1},f=g=>{let u=g.target;u.composing&&(u.composing=0,u.dispatchEvent(new Event(s)))},p=()=>{t.removeEventListener(s,l),t.removeEventListener("change",a),t.removeEventListener("compositionstart",c),t.removeEventListener("compositionend",f),t.removeEventListener("change",f)},l=g=>{let u=g.target;if(!u||u.composing)return;let y=u.value,v=Ht(r()[1]);if(i||v.number||v.int){if(v.int)y=parseInt(y);else{if(mr.test(y[y.length-1])&&y.split(mr).length===2){if(y+="0",y=parseFloat(y),isNaN(y))y="";else if(n()===y)return}y=parseFloat(y)}isNaN(y)&&(y=""),t.value=y}else v.trim&&(y=y.trim());n(y)};return t.addEventListener(s,l),t.addEventListener("change",a),t.addEventListener("compositionstart",c),t.addEventListener("compositionend",f),t.addEventListener("change",f),p},qo=(t,e)=>{let n="change",r=()=>{t.removeEventListener(n,o)},o=()=>{let s=fe(t),i=t.checked,a=e();if(T(a)){let c=It(a,s),f=c!==-1;i&&!f?a.push(s):!i&&f&&a.splice(c,1)}else X(a)?i?a.add(s):a.delete(s):e(Wo(t,i))};return t.addEventListener(n,o),r},fe=t=>"_value"in t?t._value:t.value,vr="trueValue",zo="falseValue",xr="true-value",Ko="false-value",Wo=(t,e)=>{let n=e?vr:zo;if(n in t)return t[n];let r=e?xr:Ko;return t.hasAttribute(r)?t.getAttribute(r):e},Go=(t,e)=>{if(vr in t)return pe(e,t.trueValue);let r=xr;return t.hasAttribute(r)?pe(e,t.getAttribute(r)):pe(e,!0)},Jo=(t,e)=>{let n="change",r=()=>{t.removeEventListener(n,o)},o=()=>{let s=fe(t);e(s)};return t.addEventListener(n,o),r},Qo=(t,e,n)=>{let r="change",o=()=>{t.removeEventListener(r,s)},s=()=>{let a=Ht(n()[1]).number,c=Array.prototype.filter.call(t.options,f=>f.selected).map(f=>a?ur(fe(f)):fe(f));if(t.multiple){let f=e();try{if(Dt(e),X(f)){f.clear();for(let p of c)f.add(p)}else T(f)?(f.splice(0),f.push(...c)):e(c)}finally{Ut(e),$(e)}}else e(c[0])};return t.addEventListener(r,s),o};var Xo=["stop","prevent","capture","self","once","left","right","middle","passive"],Yo=t=>{let e={};if(j(t))return;let n=t.split(",");for(let r of Xo)e[r]=n.includes(r);return e},un={isLazy:(t,e)=>e===-1&&t%2===0,isLazyKey:(t,e)=>e===0&&!t.endsWith("_flags"),once:!1,collectRefObj:!0,onBind:(t,e,n,r,o,s)=>{if(o){let p=e.value(),l=B(o.value()[0]);return z(l)?ln(t,_(l),()=>e.value()[0],s?.join(",")??p[1]):()=>{}}else if(r){let p=e.value();return ln(t,_(r),()=>e.value()[0],s?.join(",")??p[1])}let i=[],a=()=>{i.forEach(p=>p())},c=e.value(),f=c.length;for(let p=0;p<f;++p){let l=c[p];if(U(l)&&(l=l()),w(l))for(let g of Object.entries(l)){let u=g[0],y=()=>{let S=e.value()[p];return U(S)&&(S=S()),S=S[u],U(S)&&(S=S()),S},v=l[u+"_flags"];i.push(ln(t,u,y,v))}else I(2,name,t)}return a}},Zo=(t,e)=>{if(t.startsWith("keydown")||t.startsWith("keyup")||t.startsWith("keypress")){e??="";let n=t.split(".").concat(e.split(","));t=n[0];let r=n[1],o=n.includes("ctrl"),s=n.includes("shift"),i=n.includes("alt"),a=n.includes("meta"),c=f=>!(o&&!f.ctrlKey||s&&!f.shiftKey||i&&!f.altKey||a&&!f.metaKey);return r?[t,f=>c(f)?f.key.toUpperCase()===r.toUpperCase():!1]:[t,c]}return[t,n=>!0]},ln=(t,e,n,r)=>{if(j(e))return I(5,name,t),()=>{};let o=Yo(r),s=o?{capture:o.capture,passive:o.passive,once:o.once}:void 0,i;[e,i]=Zo(e,r);let a=p=>{if(!i(p)||!n&&e==="submit"&&o?.prevent)return;let l=n(p);U(l)&&(l=l(p)),U(l)&&l(p)},c=()=>{t.removeEventListener(e,f,s)},f=p=>{if(!o){a(p);return}try{if(o.left&&p.button!==1||o.middle&&p.button!==2||o.right&&p.button!==3||o.self&&p.target!==t)return;o.stop&&p.stopPropagation(),o.prevent&&p.preventDefault(),a(p)}finally{o.once&&c()}};return t.addEventListener(e,f,s),c};var Cr={onChange:(t,e,n,r,o,s)=>{if(r){s&&s.includes("camel")&&(r=_(r)),ze(t,r,e[0]);return}let i=e.length;for(let a=0;a<i;++a){let c=e[a];if(T(c)){let f=c[0],p=c[1];ze(t,f,p)}else if(w(c))for(let f of Object.entries(c)){let p=f[0],l=f[1];ze(t,p,l)}else{let f=e[a++],p=e[a];ze(t,f,p)}}}};function es(t){return!!t||t===""}var ze=(t,e,n)=>{if(Y(e)){I(3,name,t);return}if(e==="innerHTML"||e==="textContent"){let s=[...t.childNodes];setTimeout(()=>s.forEach(te),1),t[e]=n??"";return}let r=t.tagName;if(e==="value"&&r!=="PROGRESS"&&!r.includes("-")){t._value=n;let s=r==="OPTION"?t.getAttribute("value"):t.value,i=n??"";s!==i&&(t.value=i),n==null&&t.removeAttribute(e);return}let o=!1;if(n===""||n==null){let s=typeof t[e];s==="boolean"?n=es(n):n==null&&s==="string"?(n="",o=!0):s==="number"&&(n=0,o=!0)}try{t[e]=n}catch(s){o||I(4,e,r,n,s)}o&&t.removeAttribute(e)};var Rr={once:!0,onBind:(t,e,n)=>{let r=e.value()[0],o=T(r),s=e.refs[0];return o?r.push(t):s?s?.(t):e.context[n]=t,()=>{if(o){let i=r.indexOf(t);i!==-1&&r.splice(i,1)}else s?.(null)}}};var Sr={onChange:(t,e)=>{let n=me(t).data,r=n._ord;En(r)&&(r=n._ord=t.style.display),!!e[0]?t.style.display=r:t.style.display="none"}};var Nr={onChange:(t,e,n)=>{let r=e.length;for(let o=0;o<r;++o){let s=e[o],i=n?.[o];if(T(s)){let a=s.length;for(let c=0;c<a;++c)wr(t,s[c],i?.[c])}else wr(t,s,i)}}},wr=(t,e,n)=>{let r=t.style,o=z(e);if(e&&!o){if(n&&!z(n))for(let s in n)e[s]==null&&dn(r,s,"");for(let s in e)dn(r,s,e[s])}else{let s=r.display;if(o?n!==e&&(r.cssText=e):n&&t.removeAttribute("style"),"_ord"in me(t).data)return;r.display=s}},Or=/\s*!important$/;function dn(t,e,n){if(T(n))n.forEach(r=>{dn(t,e,r)});else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{let r=ts(t,e);Or.test(n)?t.setProperty(_e(r),n.replace(Or,""),"important"):t[r]=n}}var Ar=["Webkit","Moz","ms"],mn={};function ts(t,e){let n=mn[e];if(n)return n;let r=_(e);if(r!=="filter"&&r in t)return mn[e]=r;r=Ye(r);for(let o=0;o<Ar.length;o++){let s=Ar[o]+r;if(s in t)return mn[e]=s}return e}var J=t=>ns(B(t)),ns=t=>{if(!t||!w(t))return t;if(T(t))return t.map(J);if(X(t)){let n=new Set;for(let r of t.keys())n.add(J(r));return n}if(ue(t)){let n=new Map;for(let r of n)n.set(J(r[0]),J(r[1]));return n}let e={...t};for(let n of Object.entries(e))e[n[0]]=J(n[1]);return e};var Mr={onChange:(t,e)=>{let n=e[0];t.textContent=X(n)?JSON.stringify(J([...n])):ue(n)?JSON.stringify(J([...n])):w(n)?JSON.stringify(J(n)):n?.toString()??""}};var Lr={onChange:(t,e)=>{ze(t,"value",e[0])}};var Ne=t=>t?.[ot]===1;var Te=t=>{if(Be(t))return t;let e;if(m(t)?(e=t,t=e()):e=q(t),t instanceof Node||t instanceof Date||t instanceof RegExp||t instanceof Promise||t instanceof Error)return e;if(e[ot]=1,T(t)){let n=t.length;for(let r=0;r<n;++r){let o=t[r];Ne(o)||(t[r]=Te(o))}return e}if(!w(t))return e;for(let n of Object.entries(t)){let r=n[1];if(Ne(r))continue;let o=n[0];Je(o)||(t[o]=Te(r))}return e};var re=class t{static getDefault(){return t.Pe??(t.Pe=new t)}H={};l={};Je=()=>Object.keys(this.H).filter(e=>e.length===1||!e.startsWith(":"));me=new Map;de=new Map;static Pe;static yt="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";forGrowThreshold=10;globalContext;useInterpolation=!0;constructor(e){if(this.setDirectives("r-"),e){this.globalContext=e;return}this.globalContext=this.ht()}ht(){let e={},n=globalThis;for(let r of t.yt.split(","))e[r]=n[r];return e.ref=Te,e.sref=q,e.flatten=J,e}addComponent(...e){for(let n of e)this.me.set(Ye(n.name),n),this.de.set(Ye(n.name).toLocaleUpperCase(),n)}setDirectives(e){this.H={".":Cr,":":fn,"@":un,[`${e}on`]:un,[`${e}bind`]:fn,[`${e}html`]:lr,[`${e}text`]:Mr,[`${e}show`]:Sr,[`${e}model`]:Er,":style":Nr,":class":fr,":ref":Rr,":value":Lr,teleport:xt},this.l={for:`${e}for`,if:`${e}if`,else:`${e}else`,elseif:`${e}else-if`,pre:`${e}pre`,inherit:`${e}inherit`,text:`${e}text`,props:":props",propsOnce:":props-once",bind:`${e}bind`,on:`${e}on`,keyBind:":key",key:"key",is:":is",teleport:`${e}teleport`,dynamic:"_d_"}}updateDirectives(e){e(this.H,this.l)}};var _t=(t,e)=>{if(!t)return;let n=(e??re.getDefault()).l;for(let r of ss(t,n.pre))os(r,n.text)},rs=/({{[^]*?}})/g,os=(t,e)=>{let n=t.textContent;if(!n)return;let r=rs,o=n.split(r);if(o.length<=1)return;if(t.parentElement?.childNodes.length===1&&o.length===3){let i=o[1];if(j(o[0])&&j(o[2])&&i.startsWith("{{")&&i.endsWith("}}")){t.parentElement.setAttribute(e,i.substring(2,i.length-2));return}}let s=document.createDocumentFragment();for(let i of o)if(i.startsWith("{{")&&i.endsWith("}}")){let a=document.createElement("span");a.setAttribute(e,i.substring(2,i.length-2)),s.appendChild(a)}else s.appendChild(document.createTextNode(i));t.replaceWith(s)},ss=(t,e)=>{let n=[],r=o=>{if(o.nodeType===Node.TEXT_NODE)o.textContent?.includes("{{")&&n.push(o);else{if(o?.hasAttribute?.(e))return;for(let s of ce(o))r(s)}};return r(t),n};var is="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",as=new Set(is.toUpperCase().split(",")),cs="http://www.w3.org/2000/svg",kr=(t,e)=>{ne(t)?t.content.appendChild(e):t.appendChild(e)},yn=(t,e,n,r)=>{let o=t.t;if(o){let i=n&&as.has(o.toUpperCase())?document.createElementNS(cs,o.toLowerCase()):document.createElement(o),a=t.a;if(a)for(let f of Object.entries(a)){let p=f[0],l=f[1];p.startsWith("#")&&(l=p.substring(1),p="name"),i.setAttribute(pt(p,r),l)}let c=t.c;if(c)for(let f of c)yn(f,i,n,r);kr(e,i);return}let s=t.d;if(s){let i;switch(t.n??Node.TEXT_NODE){case Node.COMMENT_NODE:i=document.createComment(s);break;case Node.TEXT_NODE:i=document.createTextNode(s);break}if(i)kr(e,i);else throw new Error("unsupported node type.")}},Me=(t,e,n)=>{n??=re.getDefault();let r=document.createDocumentFragment();if(!T(t))return yn(t,r,!!e,n),r;for(let o of t)yn(o,r,!!e,n);return r};var Ir=(t,e={selector:"#app"},n)=>{Bn(t)&&(t=t.context);let r=e.element?e.element:e.selector?document.querySelector(e.selector):null;if(!r||!Se(r))throw H(0);n||(n=re.getDefault());let o=()=>{for(let a of[...r.childNodes])V(a)},s=a=>{for(let c of a)r.appendChild(c)};if(e.html){let a=document.createRange().createContextualFragment(e.html);o(),s(a.childNodes),e.element=a}else if(e.json){let a=Me(e.json,e.isSVG,n);o(),s(a.childNodes)}return n.useInterpolation&&_t(r,n),new hn(t,r,n).T(),k(r,()=>{ge(t)}),Tt(t),{context:t,unmount:()=>{V(r)},unbind:()=>{te(r)}}},hn=class{gt;Be;o;h;p;constructor(e,n,r){this.gt=e,this.Be=n,this.o=r,this.h=new Lt([e],r),this.p=new Ct(this.h)}T(){this.p.G(this.Be)}};var Ke=t=>{if(T(t))return t.map(o=>Ke(o));let e={};if(t.tagName)e.t=t.tagName;else return t.nodeType===Node.COMMENT_NODE&&(e.n=Node.COMMENT_NODE),t.textContent&&(e.d=t.textContent),e;let n=t.getAttributeNames();n.length>0&&(e.a=Object.fromEntries(n.map(o=>[o,t.getAttribute(o)])));let r=ce(t);return r.length>0&&(e.c=[...r].map(o=>Ke(o))),e};var Dr=(t,e,n,r={})=>{let o=!1;if(n.element){let i=n.element;i.remove(),n.element=i}else if(n.selector){let i=document.querySelector(n.selector);if(!i)throw H(1,t);i.remove(),n.element=i}else if(n.html){let i=document.createRange().createContextualFragment(n.html);n.element=i}else n.json&&(n.element=Me(n.json,n.isSVG,r.config),o=!0);n.element||(n.element=document.createDocumentFragment()),(r.useInterpolation??!0)&&_t(n.element);let s=n.element;if(!o&&((n.isSVG??(Xe(s)&&s.hasAttribute?.("isSVG")))||Xe(s)&&s.querySelector("[isSVG]"))){let i=n.element.content,a=i?[...i.childNodes]:[...s.childNodes],c=Ke(a);n.element=Me(c,!0,r.config)}return{name:t,context:e,template:n,inheritAttrs:r.inheritAttrs??!0,props:r.props}};var Ur=t=>{let e,n={},r=(...o)=>{if(o.length<=2&&0 in o)throw H(4);return e&&!n.isStopped?e(...o):(e=ps(t,n),e(...o))};return r[G]=1,he(r,!0),r.stop=()=>n.ref?.stop?.(),K(()=>r.stop(),!0),r},ps=(t,e)=>{let n=e.ref??q(null);e.ref=n,e.isStopped=!1;let r=0,o=we(()=>{if(r>0){o(),e.isStopped=!0,$(n);return}n(t()),++r});return n.stop=o,n};var Hr=(t,e)=>{let n={},r,o=(...s)=>{if(s.length<=2&&0 in s)throw H(4);return r&&!n.isStopped?r(...s):(r=fs(t,e,n),r(...s))};return o[G]=1,he(o,!0),o.stop=()=>n.ref?.stop?.(),K(()=>o.stop(),!0),o},fs=(t,e,n)=>{let r=n.ref??q(null);n.ref=r,n.isStopped=!1;let o=0,s=a=>{if(o>0){r.stop(),n.isStopped=!0,$(r);return}r(e(...t.map(c=>c()))),++o},i=[];for(let a of t){let c=C(a,s);i.push(c)}return s(null),r.stop=()=>{i.forEach(a=>{a()})},r};var _r=(t,e)=>{let n={},r,o=(...s)=>{if(s.length<=2&&0 in s)throw H(4);return r&&!n.isStopped?r(...s):(r=ls(t,e,n),r(...s))};return o[G]=1,he(o,!0),o.stop=()=>n.ref?.stop?.(),K(()=>o.stop(),!0),o},ls=(t,e,n)=>{let r=n.ref??q(null);n.ref=r,n.isStopped=!1;let o=0;return r.stop=C(t,s=>{if(o>0){r.stop(),n.isStopped=!0,$(r);return}r(e(s)),++o},!0),r};var Br=t=>(t[st]=1,t);var Vr=(t,e)=>{if(!e)throw new Error("persist requires a string key.");let r=Ne(t)?Te:a=>a,o=()=>localStorage.setItem(e,JSON.stringify(J(t()))),s=localStorage.getItem(e);s!=null?t(r(JSON.parse(s))):o();let i=we(o);return K(()=>i,!0),t};var gn=(t,...e)=>{let n="";return e.length===0?t.join():(t.forEach((r,o)=>{n+=r+e[o]}),n)},Pr=gn;var jr=(t,e,n)=>{let r=[],o=()=>{e(t.map(i=>i()))};for(let i of t)r.push(C(i,o));n&&o();let s=()=>{for(let i of r)i()};return K(s,!0),s};var $r=t=>{if(!m(t))throw H(3,"observe");return t(void 0,void 0,2)};var Fr=t=>{bn();try{t()}finally{Tn()}},bn=()=>{Oe.set||(Oe.set=new Set)},Tn=()=>{let t=Oe.set;if(t){delete Oe.set;for(let e of t)try{$(e)}catch(n){console.error(n)}}};var qr=t=>{Re()?.onMounted.push(t)};return Qr(us);})();
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "regor",
3
+ "version": "1.0.0",
4
+ "description": "The JavaScript framework for building modern web UI.",
5
+ "author": "Ahmed Yasin Koculu",
6
+ "license": "MIT",
7
+ "main": "dist/regor.es2022.cjs.js",
8
+ "module": "dist/regor.es2022.esm.js",
9
+ "types": "dist/regor.d.ts",
10
+ "scripts": {
11
+ "build": "yarn tsx scripts/bundle.ts && yarn dts",
12
+ "dts": "yarn dts-bundle-generator src/index.ts -o dist/regor.d.ts",
13
+ "lint": "yarn eslint src/**/*.ts",
14
+ "watch": "yarn tsx scripts/bundle.ts --watch",
15
+ "format": "yarn prettier --write \"**/*.ts\"",
16
+ "test": "vitest"
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "sideEffects": false,
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/koculu/regor.git"
25
+ },
26
+ "keywords": [
27
+ "regor"
28
+ ],
29
+ "bugs": {
30
+ "url": "https://github.com/koculu/regor/issues"
31
+ },
32
+ "homepage": "https://github.com/koculu/regor#readme",
33
+ "devDependencies": {
34
+ "@happy-dom/global-registrator": "^10.11.0",
35
+ "@types/node": "^20.5.1",
36
+ "@typescript-eslint/eslint-plugin": "^6.4.0",
37
+ "@typescript-eslint/parser": "^6.4.1",
38
+ "dts-bundle-generator": "^8.0.1",
39
+ "esbuild": "^0.19.2",
40
+ "eslint": "^8.47.0",
41
+ "eslint-config-standard-with-typescript": "^38.0.0",
42
+ "eslint-plugin-import": "^2.28.1",
43
+ "eslint-plugin-n": "^16.0.1",
44
+ "eslint-plugin-promise": "^6.1.1",
45
+ "happy-dom": "^10.11.0",
46
+ "prettier": "^3.0.2",
47
+ "tsx": "^3.12.7",
48
+ "typescript": "^5.1.6",
49
+ "vitest": "^0.34.2"
50
+ }
51
+ }