regor 1.5.4 → 1.5.6

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.
@@ -1,3 +1,3 @@
1
- "use strict";var an=Object.defineProperty;var Er=Object.getOwnPropertyDescriptor;var Rr=Object.getOwnPropertyNames;var vr=Object.prototype.hasOwnProperty;var wr=(t,e)=>{for(var n in e)an(t,n,{get:e[n],enumerable:!0})},Sr=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Rr(e))!vr.call(t,r)&&r!==n&&an(t,r,{get:()=>e[r],enumerable:!(o=Er(e,r))||o.enumerable});return t};var Ar=t=>Sr(an({},"__esModule",{value:!0}),t);var Ci={};wr(Ci,{ComponentHead:()=>qe,ContextRegistry:()=>rn,RegorConfig:()=>ue,addUnbinder:()=>_,batch:()=>Cr,collectRefs:()=>Mt,computeMany:()=>dr,computeRef:()=>hr,computed:()=>mr,createApp:()=>lr,defineComponent:()=>pr,drainUnbind:()=>zn,endBatch:()=>Fn,entangle:()=>Je,flatten:()=>re,getBindData:()=>Oe,html:()=>$n,isDeepRef:()=>De,isRaw:()=>Qe,isRef:()=>x,markRaw:()=>yr,observe:()=>ne,observeMany:()=>xr,observerCount:()=>Tr,onMounted:()=>fr,onUnmounted:()=>te,pause:()=>Kt,persist:()=>gr,pval:()=>Yn,raw:()=>br,ref:()=>be,removeNode:()=>q,resume:()=>Wt,silence:()=>kt,sref:()=>oe,startBatch:()=>_n,toFragment:()=>je,toJsonTemplate:()=>tt,trigger:()=>J,unbind:()=>de,unref:()=>U,useScope:()=>Ot,warningHandler:()=>Ie,watchEffect:()=>Ue});module.exports=Ar(Ci);var _e=Symbol(":regor");var de=t=>{let e=[t];for(let n=0;n<e.length;++n){let o=e[n];Nr(o);for(let r=o.lastChild;r!=null;r=r.previousSibling)e.push(r)}},Nr=t=>{let e=t[_e];if(!e)return;let n=e.unbinders;for(let o=0;o<n.length;++o)n[o]();n.length=0,t[_e]=void 0};var Fe=[],mt=!1,dt,qn=()=>{if(mt=!1,dt=void 0,Fe.length!==0){for(let t=0;t<Fe.length;++t)de(Fe[t]);Fe.length=0}},q=t=>{t.remove(),Fe.push(t),mt||(mt=!0,dt=setTimeout(qn,1))},zn=async()=>{Fe.length===0&&!mt||(dt&&clearTimeout(dt),qn())};var z=t=>typeof t=="function",K=t=>typeof t=="string",Kn=t=>typeof t>"u",le=t=>t==null||typeof t>"u",$=t=>typeof t!="string"||!t?.trim(),Or=Object.prototype.toString,cn=t=>Or.call(t),Se=t=>cn(t)==="[object Map]",ce=t=>cn(t)==="[object Set]",un=t=>cn(t)==="[object Date]",ot=t=>typeof t=="symbol",R=Array.isArray,O=t=>t!==null&&typeof t=="object";var Wn={0:"createApp can't find root element. You must define either a valid `selector` or an `element`. Example: createApp({}, {selector: '#app', html: '...'})",1:t=>`Component template cannot be found. selector: ${t} .`,2:"Use composables in scope. usage: useScope(() => new MyApp()).",3:t=>`${t} requires ref source argument`,4:"computed is readonly.",5:"persist requires a string key."},B=(t,...e)=>{let n=Wn[t];return new Error(z(n)?n.call(Wn,...e):n)};var ht=[],Gn=()=>{let t={onMounted:[],onUnmounted:[]};return ht.push(t),t},Ve=t=>{let e=ht[ht.length-1];if(!e&&!t)throw B(2);return e},Jn=t=>{let e=Ve();return t&&pn(t),ht.pop(),e},ln=Symbol("csp"),pn=t=>{let e=t,n=e[ln];if(n){let o=Ve();if(n===o)return;o.onMounted.length>0&&n.onMounted.push(...o.onMounted),o.onUnmounted.length>0&&n.onUnmounted.push(...o.onUnmounted);return}e[ln]=Ve()},yt=t=>t[ln];var Ae=t=>{yt(t)?.onUnmounted?.forEach(n=>{n()}),t.unmounted?.()};var Qn={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,o)=>({msg:`Failed setting prop "${t}" on <${e.toLowerCase()}>: value ${n} is invalid.`,args:[o]}),5:(t,e)=>`${t} binding missing event type at ${e.outerHTML}`,6:(t,e)=>({msg:t,args:[e]})},D=(t,...e)=>{let n=Qn[t],o=z(n)?n.call(Qn,...e):n,r=Ie.warning;r&&(K(o)?r(o):r(o,...o.args))},Ie={warning:console.warn};var gt=Symbol("ref"),X=Symbol("sref"),bt=Symbol("raw");var x=t=>t!=null&&t[X]===1;var Ne=class extends Error{propPath;detail;constructor(e,n){super(n),this.name="PropValidationError",this.propPath=e,this.detail=n}},ye=(t,e)=>{throw new Ne(t,`${e}.`)},xt=t=>{if(t===null)return"null";if(t===void 0)return"undefined";if(x(t))return`ref<${xt(t())}>`;if(typeof t=="string")return"string";if(typeof t=="number")return"number";if(typeof t=="boolean")return"boolean";if(typeof t=="bigint")return"bigint";if(typeof t=="symbol")return"symbol";if(typeof t=="function")return"function";if(R(t))return"array";if(t instanceof Date)return"Date";if(t instanceof RegExp)return"RegExp";if(t instanceof Map)return"Map";if(t instanceof Set)return"Set";let e=t?.constructor?.name;return e&&e!=="Object"?e:"object"},kr=t=>t.length>60?`${t.slice(0,57)}...`:t,rt=(t,e=0)=>{if(e>1)return"unknown";if(x(t)){let s=t();return`ref(${rt(s,e+1)})`}if(typeof t=="string")return kr(JSON.stringify(t));if(typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"||typeof t=="symbol")return String(t);if(t===null)return"null";if(t===void 0)return"undefined";if(t instanceof Date)return t.toISOString();if(t instanceof RegExp)return String(t);if(R(t)){let s=t.slice(0,5).map(a=>rt(a,e+1)).join(", ");return t.length>5?`[${s}, ...]`:`[${s}]`}if(O(t)){let s=Object.entries(t).slice(0,5);if(s.length===0)return"{}";let a=s.map(([i,c])=>{let l=rt(c,e+1);return`${i}: ${l}`}).join(", ");return Object.keys(t).length>5?`{ ${a}, ... }`:`{ ${a} }`}return"unknown"},ie=t=>{if(x(t))return`got ${xt(t)}(${rt(t())})`;let e=xt(t),n=rt(t);return`got ${e} (${n})`},Mr=t=>t instanceof Ne?t.detail:t instanceof Error?t.message:String(t),Xn=(t,e)=>{let n=`, ${ie(e)}.`;return t.endsWith(n)?t.slice(0,-n.length):t},Lr=(t,e,n)=>{if(e instanceof Ne){if(e.propPath===t)return Xn(e.detail,n);if(e.propPath===`${t}.value`&&x(n)){let o=Xn(e.detail,n());return o.startsWith("expected ")?`expected ref<${o.slice(9)}>`:`expected ref where ${o}`}}return Mr(e)},Vr=(t,e,n)=>{let o=[];for(let r of e){let s=Lr(t,r,n);o.includes(s)||o.push(s)}return o.length===0?ie(n):o.length===1?`${o[0]}, ${ie(n)}`:`${o.join(" or ")}, ${ie(n)}`},Ir=t=>typeof t=="string"?`"${t}"`:typeof t=="number"||typeof t=="boolean"?String(t):t===null?"null":t===void 0?"undefined":xt(t),Pr=(t,e)=>{typeof t!="string"&&ye(e,`expected string, ${ie(t)}`)},Dr=(t,e)=>{typeof t!="number"&&ye(e,`expected number, ${ie(t)}`)},Ur=(t,e)=>{typeof t!="boolean"&&ye(e,`expected boolean, ${ie(t)}`)},Hr=t=>(e,n)=>{e instanceof t||ye(n,`expected instance of ${t.name||"provided class"}, ${ie(e)}`)},Br=t=>(e,n,o)=>{e!==void 0&&t(e,n,o)},jr=t=>(e,n,o)=>{e!==null&&t(e,n,o)},$r=(...t)=>(e,n,o)=>{let r=[];for(let s of t)try{s(e,n,o);return}catch(a){r.push(a)}ye(n,Vr(n,r,e))},_r=t=>(e,n)=>{t.includes(e)||ye(n,`expected one of ${t.map(o=>Ir(o)).join(", ")}, ${ie(e)}`)},Fr=t=>(e,n,o)=>{R(e)||ye(n,`expected array, ${ie(e)}`);let r=e;for(let s=0;s<r.length;++s)t(r[s],`${n}[${s}]`,o)};function qr(t){return(e,n,o)=>{O(e)||ye(n,`expected object, ${ie(e)}`);let r=e;for(let s in t){let a=t[s];if(!a)continue;a(r[s],`${n}.${s}`,o)}}}var zr=t=>(e,n,o)=>{if(x(e)){t(e(),`${n}.value`,o);return}ye(n,`expected ref, ${ie(e)}`)},Yn={fail:ye,describe:ie,isString:Pr,isNumber:Dr,isBoolean:Ur,isClass:Hr,optional:Br,nullable:jr,or:$r,oneOf:_r,arrayOf:Fr,shape:qr,refOf:zr};var Kr=(t,e,n)=>{let o=t.tagName?.toLowerCase?.()||"unknown",r=n instanceof Ne?n.propPath:e,s=n instanceof Ne?n.detail:n instanceof Error?n.message:String(n);return n instanceof Error?new Error(`Invalid prop "${r}" on <${o}>: ${s}`,{cause:n}):new Error(`Invalid prop "${r}" on <${o}>: ${s}`,{cause:n})},qe=class{props;start;end;ctx;autoProps=!0;entangle=!0;enableSwitch=!1;onAutoPropsAssigned;G;J;constructor(e,n,o,r,s,a){this.props=e,this.G=n,this.ctx=o,this.start=r,this.end=s,this.J=a}emit=(e,n)=>{this.G.dispatchEvent(new CustomEvent(e,{detail:n}))};findContext(e,n=0){if(n<0)return;let o=0;for(let r of this.ctx??[])if(r instanceof e){if(o===n)return r;++o}}requireContext(e,n=0){let o=this.findContext(e,n);if(o!==void 0)return o;throw new Error(`${e} was not found in the context stack at occurrence ${n}.`)}validateProps(e){if(this.J==="off")return;let n=this.props;for(let o in e){let r=e[o];if(!r)continue;let s=r;try{s(n[o],o,this)}catch(a){let i=Kr(this.G,o,a);if(this.J==="warn"){Ie.warning(i.message,i);continue}throw i}}}unmount(){let e=this.start.nextSibling,n=this.end;for(;e&&e!==n;)q(e),e=e.nextSibling;for(let o of this.ctx)Ae(o)}};var Oe=t=>{let e=t,n=e[_e];if(n)return n;let o={unbinders:[],data:{}};return e[_e]=o,o};var _=(t,e)=>{Oe(t).unbinders.push(e)};var Ct={},Tt={},Zn=1,eo=t=>{let e=(Zn++).toString();return Ct[e]=t,Tt[e]=0,e},fn=t=>{Tt[t]+=1},mn=t=>{--Tt[t]===0&&(delete Ct[t],delete Tt[t])},to=t=>Ct[t],dn=()=>Zn!==1&&Object.keys(Ct).length>0,st="r-switch",Wr=t=>{let e=t.filter(o=>Te(o)).map(o=>[...o.querySelectorAll("[r-switch]")].map(r=>r.getAttribute(st))),n=new Set;return e.forEach(o=>{o.forEach(r=>r&&n.add(r))}),[...n]},ze=(t,e)=>{if(!dn())return;let n=Wr(e);n.length!==0&&(n.forEach(fn),_(t,()=>{n.forEach(mn)}))};var Et=()=>{},hn=(t,e,n,o)=>{let r=[];for(let s of t){let a=s.cloneNode(!0);n.insertBefore(a,o),r.push(a)}ke(e,r)},yn=Symbol("r-if"),no=Symbol("r-else"),oo=t=>t[no]===1,Rt=class{r;V;ge;Q;X;x;R;constructor(e){this.r=e,this.V=e.o.p.if,this.ge=wt(e.o.p.if),this.Q=e.o.p.else,this.X=e.o.p.elseif,this.x=e.o.p.for,this.R=e.o.p.pre}ot(e,n){let o=e.parentElement;for(;o!==null&&o!==document.documentElement;){if(o.hasAttribute(n))return!0;o=o.parentElement}return!1}k(e){let n=e.hasAttribute(this.V);return n&&this.y(e),this.r.N.j(e,o=>{o.hasAttribute(this.V)&&this.y(o)}),n}Y(e){return e[yn]?!0:(e[yn]=!0,vt(e,this.ge).forEach(n=>n[yn]=!0),!1)}y(e){if(e.hasAttribute(this.R)||this.Y(e)||this.ot(e,this.x))return;let n=e.getAttribute(this.V);if(!n){D(0,this.V,e);return}e.removeAttribute(this.V),this.O(e,n)}U(e,n,o){let r=Ke(e),s=e.parentNode,a=document.createComment(`__begin__ :${n}${o??""}`);s.insertBefore(a,e),ze(a,r),r.forEach(c=>{q(c)}),e.remove(),n!=="if"&&(e[no]=1);let i=document.createComment(`__end__ :${n}${o??""}`);return s.insertBefore(i,a.nextSibling),{nodes:r,parent:s,commentBegin:a,commentEnd:i}}be(e,n){if(!e)return[];let o=e.nextElementSibling;if(e.hasAttribute(this.Q)){e.removeAttribute(this.Q);let{nodes:r,parent:s,commentBegin:a,commentEnd:i}=this.U(e,"else");return[{mount:()=>{hn(r,this.r,s,i)},unmount:()=>{Ce(a,i)},isTrue:()=>!0,isMounted:!1}]}else{let r=e.getAttribute(this.X);if(!r)return[];e.removeAttribute(this.X);let{nodes:s,parent:a,commentBegin:i,commentEnd:c}=this.U(e,"elseif",` => ${r} `),l=this.r.m.M(r),u=l.value,p=this.be(o,n),f=Et;return _(i,()=>{l.stop(),f(),f=Et}),f=l.subscribe(n),[{mount:()=>{hn(s,this.r,a,c)},unmount:()=>{Ce(i,c)},isTrue:()=>!!u()[0],isMounted:!1},...p]}}O(e,n){let o=e.nextElementSibling,{nodes:r,parent:s,commentBegin:a,commentEnd:i}=this.U(e,"if",` => ${n} `),c=this.r.m.M(n),l=c.value,u=!1,p=this.r.m,f=p.L(),h=()=>{p.E(f,()=>{if(l()[0])u||(hn(r,this.r,s,i),u=!0),m.forEach(C=>{C.unmount(),C.isMounted=!1});else{Ce(a,i),u=!1;let C=!1;for(let v of m)!C&&v.isTrue()?(v.isMounted||(v.mount(),v.isMounted=!0),C=!0):(v.unmount(),v.isMounted=!1)}})},m=this.be(o,h),d=Et;_(a,()=>{c.stop(),d(),d=Et}),h(),d=c.subscribe(h)}};var Ke=t=>{let e=pe(t)?t.content.childNodes:[t],n=[];for(let o=0;o<e.length;++o){let r=e[o];if(r.nodeType===1){let s=r?.tagName;if(s==="SCRIPT"||s==="STYLE")continue}n.push(r)}return n},ke=(t,e)=>{for(let n=0;n<e.length;++n){let o=e[n];o.nodeType===Node.ELEMENT_NODE&&(oo(o)||t.$(o))}},vt=(t,e)=>{let n=t.querySelectorAll(e);return t.matches?.(e)?[t,...n]:n},pe=t=>t instanceof HTMLTemplateElement,Te=t=>t.nodeType===Node.ELEMENT_NODE,it=t=>t.nodeType===Node.ELEMENT_NODE,ro=t=>t instanceof HTMLSlotElement,Ee=t=>pe(t)?t.content.childNodes:t.childNodes,Ce=(t,e)=>{let n=t.nextSibling;for(;n!=null&&n!==e;){let o=n.nextSibling;q(n),n=o}},so=function(){return this()},Gr=function(t){return this(t)},Jr=()=>{throw new Error("value is readonly.")},Qr={get:so,set:Gr,enumerable:!0,configurable:!1},Xr={get:so,set:Jr,enumerable:!0,configurable:!1},Me=(t,e)=>{Object.defineProperty(t,"value",e?Xr:Qr)},io=(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},wt=t=>`[${CSS.escape(t)}]`,St=(t,e)=>(t.startsWith("@")&&(t=e.p.on+":"+t.slice(1)),t.includes("[")&&(t=t.replace(/[[\]]/g,e.p.dynamic)),t),gn=t=>{let e=Object.create(null);return n=>e[n]||(e[n]=t(n))},Yr=/-(\w)/g,j=gn(t=>t&&t.replace(Yr,(e,n)=>n?n.toUpperCase():"")),Zr=/\B([A-Z])/g,We=gn(t=>t&&t.replace(Zr,"-$1").toLowerCase()),at=gn(t=>t&&t.charAt(0).toUpperCase()+t.slice(1));var At={mount:()=>{}};var Ge=t=>{let e=t.trim();return e?e.split(/\s+/):[]};var Nt=t=>{yt(t)?.onMounted?.forEach(n=>{n()}),t.mounted?.()};var bn=Symbol("scope"),Ot=t=>{try{Gn();let e=t();pn(e);let n={context:e,unmount:()=>Ae(e),[bn]:1};return n[bn]=1,n}finally{Jn()}},ao=t=>O(t)?bn in t:!1;var xn={collectRefObj:!0,mount:({parseResult:t})=>({update:({values:e})=>{let n=t.context,o=e[0];if(O(o))for(let r of Object.entries(o)){let s=r[0],a=r[1],i=n[s];i!==a&&(x(i)?i(a):n[s]=a)}}})};var te=(t,e)=>{Ve(e)?.onUnmounted.push(t)};var ne=(t,e,n,o=!0)=>{if(!x(t))throw B(3,"observe");n&&e(t());let s=t(void 0,void 0,0,e);return o&&te(s,!0),s};var Je=(t,e)=>{if(t===e)return()=>{};let n=ne(t,r=>e(r)),o=ne(e,r=>t(r));return e(t()),()=>{n(),o()}};var Qe=t=>!!t&&t[bt]===1;var De=t=>t?.[gt]===1;var fe=[],co=t=>{fe.length!==0&&fe[fe.length-1]?.add(t)},Ue=t=>{if(!t)return()=>{};let e={stop:()=>{}};return es(t,e),te(()=>e.stop(),!0),e.stop},es=(t,e)=>{if(!t)return;let n=[],o=!1,r=()=>{for(let s of n)s();n=[],o=!0};e.stop=r;try{let s=new Set;if(fe.push(s),t(a=>n.push(a)),o)return;for(let a of[...s]){let i=ne(a,()=>{r(),Ue(t)});n.push(i)}}finally{fe.pop()}},kt=t=>{let e=fe.length,n=e>0&&fe[e-1];try{return n&&fe.push(null),t()}finally{n&&fe.pop()}},Mt=t=>{try{let e=new Set;return fe.push(e),{value:t(),refs:[...e]}}finally{fe.pop()}};var J=(t,e,n)=>{if(!x(t))return;let o=t;if(o(void 0,e,1),!n)return;let r=o();if(r){if(R(r)||ce(r))for(let s of r)J(s,e,!0);else if(Se(r))for(let s of r)J(s[0],e,!0),J(s[1],e,!0);if(O(r))for(let s in r)J(r[s],e,!0)}};function ts(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}var Xe=(t,e,n)=>{n.forEach(function(o){let r=t[o];ts(e,o,function(...a){let i=r.apply(this,a),c=this[X];for(let l of c)J(l);return i})})},Lt=(t,e)=>{Object.defineProperty(t,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})};var uo=Array.prototype,Tn=Object.create(uo),ns=["push","pop","shift","unshift","splice","sort","reverse"];Xe(uo,Tn,ns);var lo=Map.prototype,Vt=Object.create(lo),os=["set","clear","delete"];Lt(Vt,"Map");Xe(lo,Vt,os);var po=Set.prototype,It=Object.create(po),rs=["add","clear","delete"];Lt(It,"Set");Xe(po,It,rs);var ge={},oe=t=>{if(x(t)||Qe(t))return t;let e={auto:!0,_value:t},n=c=>O(c)?X in c?!0:R(c)?(Object.setPrototypeOf(c,Tn),!0):ce(c)?(Object.setPrototypeOf(c,It),!0):Se(c)?(Object.setPrototypeOf(c,Vt),!0):!1:!1,o=n(t),r=new Set,s=(c,l)=>{if(ge.stack&&ge.stack.length){ge.stack[ge.stack.length-1].add(i);return}r.size!==0&&kt(()=>{for(let u of[...r.keys()])r.has(u)&&u(c,l)})},a=c=>{let l=c[X];l||(c[X]=l=new Set),l.add(i)},i=(...c)=>{if(!(2 in c)){let u=c[0],p=c[1];return 0 in c?e._value===u||x(u)&&(u=u(),e._value===u)?u:(n(u)&&a(u),e._value=u,e.auto&&s(u,p),e._value):(co(i),e._value)}switch(c[2]){case 0:{let u=c[3];if(!u)return()=>{};let p=f=>{r.delete(f)};return r.add(u),()=>{p(u)}}case 1:{let u=c[1],p=e._value;s(p,u);break}case 2:return r.size;case 3:{e.auto=!1;break}case 4:e.auto=!0}return e._value};return i[X]=1,Me(i,!1),o&&a(t),i};var be=t=>{if(Qe(t))return t;let e;if(x(t)?(e=t,t=e()):e=oe(t),t instanceof Node||t instanceof Date||t instanceof RegExp||t instanceof Promise||t instanceof Error)return e;if(e[gt]=1,R(t)){let n=t.length;for(let o=0;o<n;++o){let r=t[o];De(r)||(t[o]=be(r))}return e}if(!O(t))return e;for(let n of Object.entries(t)){let o=n[1];if(De(o))continue;let r=n[0];ot(r)||(t[r]=null,t[r]=be(o))}return e};var fo=Symbol("modelBridge"),Pt=()=>{},ss=t=>!!t?.[fo],is=t=>{t[fo]=1},as=t=>{let e=be(t());return is(e),e},mo={collectRefObj:!0,mount:({parseResult:t,option:e})=>{if(typeof e!="string"||!e)return Pt;let n=j(e),o,r,s=Pt,a=()=>{s(),s=Pt,o=void 0,r=void 0},i=()=>{s(),s=Pt},c=(u,p)=>{o!==u&&(i(),s=Je(u,p),o=u)},l=()=>{let u=t.refs[0]??t.value()[0],p=t.context,f=p[n];if(!x(u)){if(r&&f===r){r(u);return}if(a(),x(f)){f(u);return}p[n]=u;return}if(ss(u)){if(f===u)return;x(f)?c(u,f):p[n]=u;return}r||(r=as(u)),p[n]=r,c(u,r)};return{update:()=>{l()},unmount:()=>{s()}}}};var Dt=class{r;xe;Te="";Re=-1;constructor(e){this.r=e,this.xe=e.o.p.inherit}k(e){this.rt(e)}st(e){if(this.Re!==e.size){let n=[...e.keys()];this.Te=[...n,...n.map(We)].join(","),this.Re=e.size}return this.Te}it(e){for(let n=0;n<e.length;++n){let o=e[n]?.components;if(o)for(let r in o)return!0}return!1}at(e){if(!pe(e))return!1;let n=e.getAttributeNames();return e.hasAttribute("name")?!0:n.some(o=>o.startsWith("#"))}ct(e){return pe(e)&&e.getAttributeNames().length===0}rt(e){let n=this.r,o=n.m,r=n.o.Z,s=n.o._;if(r.size===0&&!this.it(o.l))return;let a=o.ee(),i=this.Ee();if($(i))return;let c=this.pt(e,i);for(let l of c){if(l.hasAttribute(n.R))continue;let u=l.parentNode;if(!u)continue;let p=l.nextSibling,f=j(l.tagName).toUpperCase(),m=a[f]??s.get(f);if(!m)continue;let d=m.template;if(!d)continue;let y=l.parentElement;if(!y)continue;let C=new Comment(" begin component: "+l.tagName),v=new Comment(" end component: "+l.tagName);y.insertBefore(C,l),l.remove();let F=n.o.p.context,W=n.o.p.contextAlias,P=n.o.p.bind,Q=m.props?.map(j)??[],se=(b,M)=>{let E={},T=b.hasAttribute(F);return o.E(M,()=>{if(o.v(E),T?n.y(xn,b,F):b.hasAttribute(W)&&n.y(xn,b,W),Q.length===0)return;let V=new Map(Q.map(A=>[A.toLowerCase(),A]));for(let A of[...Q,...Q.map(We)]){let ae=b.getAttribute(A);ae!==null&&(E[j(A)]=ae,b.removeAttribute(A))}let w=n.F.Ce(b,!1);for(let[A,ae]of w.entries()){let[xe,N]=ae.te;if(!N)continue;let ee=V.get(j(N).toLowerCase());ee&&(xe!=="."&&xe!==":"&&xe!==P||n.y(mo,b,A,!0,ee,ae.ne))}}),E},S=[...o.L()],me=()=>{let b=se(l,S),M=new qe(b,l,S,C,v,n.o.propValidationMode),E=Ot(()=>m.context(M)??{}).context;if(M.autoProps){for(let[T,V]of Object.entries(b))if(T in E){let w=E[T];if(w===V)continue;if(x(w)){x(V)?M.entangle?_(C,Je(V,w)):w(V()):w(V);continue}}else E[T]=V;for(let T of Q)T in E||(E[T]=void 0);M.onAutoPropsAssigned?.()}return{componentCtx:E,head:M}},{componentCtx:g,head:k}=me(),H=[...Ee(d)],$e=H.length,nt=l.childNodes.length===0,pt=b=>{let M=b.parentElement,E=b.name;if($(E)&&(E=b.getAttributeNames().filter(w=>w.startsWith("#"))[0],$(E)?E="default":E=E.substring(1)),nt){if(E==="default"){let w=n.o.p.text,A=l.getAttribute(w);if(!$(A)){let ae=document.createElement("span");ae.setAttribute(w,A),M.insertBefore(ae,b),l.removeAttribute(w);return}}for(let w of[...b.childNodes])M.insertBefore(w,b);return}let T=l.querySelector(`template[name='${E}'], template[\\#${E}]`);!T&&E==="default"&&(T=[...l.querySelectorAll("template:not([name])")].find(A=>this.ct(A))??null);let V=w=>{k.enableSwitch&&o.E(S,()=>{o.v(g);let A=se(b,o.L());o.E(S,()=>{o.v(A);let ae=o.L(),xe=eo(ae);for(let N of w)Te(N)&&(N.setAttribute(st,xe),fn(xe),_(N,()=>{mn(xe)}))})})};if(T){let w=[...Ee(T)];for(let A of w)M.insertBefore(A,b);V(w)}else{if(E!=="default"){for(let A of[...Ee(b)])M.insertBefore(A,b);return}let w=[...Ee(l)].filter(A=>!this.at(A));for(let A of w)M.insertBefore(A,b);V(w)}},I=b=>{if(!Te(b))return;let M=b.querySelectorAll("slot");if(ro(b)){pt(b),b.remove();return}for(let E of M)pt(E),E.remove()};(()=>{for(let b=0;b<$e;++b)H[b]=H[b].cloneNode(!0),u.insertBefore(H[b],p),I(H[b])})(),y.insertBefore(v,p);let G=()=>{if(!m.inheritAttrs)return;let b=H.filter(E=>E.nodeType===Node.ELEMENT_NODE);b.length>1&&(b=b.filter(E=>E.hasAttribute(this.xe)));let M=b[0];if(M)for(let E of l.getAttributeNames()){if(E===F||E===W)continue;let T=l.getAttribute(E);if(E==="class"){let V=Ge(T);V.length>0&&M.classList.add(...V)}else if(E==="style"){let V=M.style,w=l.style;for(let A of w)V.setProperty(A,w.getPropertyValue(A))}else M.setAttribute(St(E,n.o),T)}},Y=()=>{for(let b of l.getAttributeNames())!b.startsWith("@")&&!b.startsWith(n.o.p.on)&&l.removeAttribute(b)},Z=()=>{G(),Y(),o.v(g),n.ve(l,!1),g.$emit=k.emit,ke(n,H),_(l,()=>{Ae(g)}),_(C,()=>{de(l)}),Nt(g)};o.E(S,Z)}}Ee(){let e=this.r,n=e.m,o=e.o.Z,r=n.ut(),s=this.st(o);return[...s?[s]:[],...r,...r.map(We)].join(",")}pt(e,n){let o=[];if($(n))return o;if(e.matches?.(n))return[e];let r=this.q(e).reverse();for(;r.length>0;){let s=r.pop();if(s.matches(n)){o.push(s);continue}r.push(...this.q(s).reverse())}return o}j(e,n){let o=this.Ee(),r=this.q(e).reverse();for(;r.length>0;){let s=r.pop();n(s),!(!$(o)&&s.matches(o))&&r.push(...this.q(s).reverse())}}q(e){let n=e?.children;if(n?.length!=null){let r=[];for(let s=0;s<n.length;++s){let a=n[s];Te(a)&&r.push(a)}return r}let o=e?.childNodes;if(o?.length!=null){let r=[];for(let s=0;s<o.length;++s){let a=o[s];Te(a)&&r.push(a)}return r}return[]}};var Cn=class{te;ne;we=[];constructor(e,n){this.te=e,this.ne=n}},Ut=class{r;Se;Ae;oe;constructor(e){this.r=e,this.Se=e.o.lt(),this.oe=new Map;let n=new Map;for(let o of this.Se){let r=o[0]??"",s=n.get(r);s?s.push(o):n.set(r,[o])}this.Ae=n}ke(e){let n=this.oe.get(e);if(n)return n;let o=e,r=o.startsWith(".");r&&(o=":"+o.slice(1));let s=o.indexOf("."),i=(s<0?o:o.substring(0,s)).split(/[:@]/);$(i[0])&&(i[0]=r?".":o[0]);let c=s>=0?o.slice(s+1).split("."):[],l=!1,u=!1;for(let f=0;f<c.length;++f){let h=c[f];if(!l&&h==="camel"?l=!0:!u&&h==="prop"&&(u=!0),l&&u)break}l&&(i[i.length-1]=j(i[i.length-1])),u&&(i[0]=".");let p={terms:i,flags:c};return this.oe.set(e,p),p}Ce(e,n){let o=new Map;if(!it(e))return o;let r=this.Ae,s=(i,c)=>{let l=r.get(c[0]??"");if(l)for(let u=0;u<l.length;++u){if(!c.startsWith(l[u]))continue;let p=o.get(c);if(!p){let f=this.ke(c);p=new Cn(f.terms,f.flags),o.set(c,p)}p.we.push(i);return}},a=i=>{let c=i.attributes;if(!(!c||c.length===0))for(let l=0;l<c.length;++l){let u=c.item(l)?.name;u&&s(i,u)}};return a(e),!n||!e.firstElementChild||this.r.N.j(e,a),o}};var ho=()=>{},cs=(t,e)=>{for(let n of t){let o=n.cloneNode(!0);e.appendChild(o)}},Ht=class{r;I;constructor(e){this.r=e,this.I=e.o.p.is}k(e){let n=e.hasAttribute(this.I);return(n||e.hasAttribute("is"))&&this.y(e),this.r.N.j(e,o=>{(o.hasAttribute(this.I)||o.hasAttribute("is"))&&this.y(o)}),n}y(e){let n=e.getAttribute(this.I);if(!n){if(n=e.getAttribute("is"),!n)return;if(!n.startsWith("regor:")){if(!n.startsWith("r-"))return;let o=n.slice(2).trim().toLowerCase();if(!o)return;let r=e.parentNode;if(!r)return;let s=document.createElement(o);for(let a of e.getAttributeNames())a!=="is"&&s.setAttribute(a,e.getAttribute(a));for(;e.firstChild;)s.appendChild(e.firstChild);r.insertBefore(s,e),e.remove(),this.r.$(s);return}n=`'${n.slice(6)}'`,e.removeAttribute("is")}e.removeAttribute(this.I),this.O(e,n)}U(e,n){let o=Ke(e),r=e.parentNode,s=document.createComment(`__begin__ dynamic ${n??""}`);r.insertBefore(s,e),ze(s,o),o.forEach(i=>{q(i)}),e.remove();let a=document.createComment(`__end__ dynamic ${n??""}`);return r.insertBefore(a,s.nextSibling),{nodes:o,parent:r,commentBegin:s,commentEnd:a}}O(e,n){let{nodes:o,parent:r,commentBegin:s,commentEnd:a}=this.U(e,` => ${n} `),i=this.r.m.M(n),c=i.value,l=this.r.m,u=l.L(),p={name:""},f=pe(e)?o:[...o[0].childNodes],h=()=>{l.E(u,()=>{let y=c()[0];if(O(y)&&(y.name?y=y.name:y=Object.entries(l.ee()).filter(v=>v[1]===y)[0]?.[0]),!K(y)||$(y)){Ce(s,a);return}if(p.name===y)return;Ce(s,a);let C=document.createElement(y);for(let v of e.getAttributeNames())v!==this.I&&C.setAttribute(v,e.getAttribute(v));cs(f,C),r.insertBefore(C,a),this.r.$(C),p.name=y})},m=ho;_(s,()=>{i.stop(),m(),m=ho}),h(),m=i.subscribe(h)}};var U=t=>{let e=t;return e!=null&&e[X]===1?e():e};var us=(t,e)=>{let[n,o]=e;z(o)?o(t,n):t.innerHTML=n?.toString()},Bt={mount:()=>({update:({el:t,values:e})=>{us(t,e)}})};var jt=class t{re;constructor(e){this.re=e}static ft(e,n){let o=e.m,r=e.o,s=r.p,a=new Set([s.for,s.if,s.else,s.elseif,s.pre]),i=r.B,c=o.ee();if(Object.keys(c).length>0||r._.size>0)return;let l=e.F,u=[],p=0,f=[];for(let h=n.length-1;h>=0;--h)f.push(n[h]);for(;f.length>0;){let h=f.pop();if(h.nodeType===Node.ELEMENT_NODE){let d=h;if(d.tagName==="TEMPLATE"||d.tagName.includes("-"))return;let y=j(d.tagName).toUpperCase();if(r._.has(y)||c[y])return;let C=d.attributes;for(let v=0;v<C.length;++v){let F=C.item(v)?.name;if(!F)continue;if(a.has(F))return;let{terms:W,flags:P}=l.ke(F),[Q,se]=W,S=i[F]??i[Q];if(S){if(S===Bt)return;u.push({nodeIndex:p,attrName:F,directive:S,option:se,flags:P})}}++p}let m=h.childNodes;for(let d=m.length-1;d>=0;--d)f.push(m[d])}if(u.length!==0)return new t(u)}y(e,n){let o=[],r=[];for(let s=n.length-1;s>=0;--s)r.push(n[s]);for(;r.length>0;){let s=r.pop();s.nodeType===Node.ELEMENT_NODE&&o.push(s);let a=s.childNodes;for(let i=a.length-1;i>=0;--i)r.push(a[i])}for(let s=0;s<this.re.length;++s){let a=this.re[s],i=o[a.nodeIndex];i&&e.y(a.directive,i,a.attrName,!1,a.option,a.flags)}}};var ls=(t,e)=>{let n=e.parentNode;if(n)for(let o=0;o<t.items.length;++o)n.insertBefore(t.items[o],e)},ps=t=>{let e=t.length,n=t.slice(),o=[],r,s,a;for(let i=0;i<e;++i){let c=t[i];if(c===0)continue;let l=o[o.length-1];if(l===void 0||t[l]<c){n[i]=l??-1,o.push(i);continue}for(r=0,s=o.length-1;r<s;)a=r+s>>1,t[o[a]]<c?r=a+1:s=a;c<t[o[r]]&&(r>0&&(n[i]=o[r-1]),o[r]=i)}for(r=o.length,s=o[r-1]??-1;r-- >0;)o[r]=s,s=n[s];return o},$t=class{static dt(e){let{oldItems:n,newValues:o,getKey:r,isSameValue:s,mountNewValue:a,removeMountItem:i,endAnchor:c}=e,l=n.length,u=o.length,p=new Array(u),f=new Set;for(let g=0;g<u;++g){let k=r(o[g]);if(k===void 0||f.has(k))return;f.add(k),p[g]=k}let h=new Array(u),m=0,d=l-1,y=u-1;for(;m<=d&&m<=y;){let g=n[m];if(r(g.value)!==p[m]||!s(g.value,o[m]))break;g.value=o[m],h[m]=g,++m}for(;m<=d&&m<=y;){let g=n[d];if(r(g.value)!==p[y]||!s(g.value,o[y]))break;g.value=o[y],h[y]=g,--d,--y}if(m>d){for(let g=y;g>=m;--g){let k=g+1<u?h[g+1].items[0]:c;h[g]=a(g,o[g],k)}return h}if(m>y){for(let g=m;g<=d;++g)i(n[g]);return h}let C=m,v=m,F=y-v+1,W=new Array(F).fill(0),P=new Map;for(let g=v;g<=y;++g)P.set(p[g],g);let Q=!1,se=0;for(let g=C;g<=d;++g){let k=n[g],H=P.get(r(k.value));if(H===void 0){i(k);continue}if(!s(k.value,o[H])){i(k);continue}k.value=o[H],h[H]=k,W[H-v]=g+1,H>=se?se=H:Q=!0}let S=Q?ps(W):[],me=S.length-1;for(let g=F-1;g>=0;--g){let k=v+g,H=k+1<u?h[k+1].items[0]:c;if(W[g]===0){h[k]=a(k,o[k],H);continue}let $e=h[k];Q&&(me>=0&&S[me]===g?--me:$e&&ls($e,H))}return h}};var ct=class{T=[];P=new Map;get w(){return this.T.length}se;constructor(e){this.se=e}ie(e){let n=this.se(e.value);n!==void 0&&this.P.set(n,e)}ae(e){let n=this.se(this.T[e]?.value);n!==void 0&&this.P.delete(n)}static mt(e,n){return{items:[],index:e,value:n,order:-1}}v(e){e.order=this.w,this.T.push(e),this.ie(e)}yt(e,n){let o=this.w;for(let r=e;r<o;++r)this.T[r].order=r+1;n.order=e,this.T.splice(e,0,n),this.ie(n)}D(e){return this.T[e]}ce(e,n){this.ae(e),this.T[e]=n,this.ie(n),n.order=e}Ve(e){this.ae(e),this.T.splice(e,1);let n=this.w;for(let o=e;o<n;++o)this.T[o].order=o}Ne(e){let n=this.w;for(let o=e;o<n;++o)this.ae(o);this.T.splice(e)}en(e){return this.P.has(e)}ht(e){return this.P.get(e)?.order??-1}};var En=Symbol("r-for"),fs=t=>-1,yo=()=>{},_t=class t{r;x;Oe;R;constructor(e){this.r=e,this.x=e.o.p.for,this.Oe=wt(this.x),this.R=e.o.p.pre}k(e){let n=e.hasAttribute(this.x);return n&&this.Me(e),this.r.N.j(e,o=>{o.hasAttribute(this.x)&&this.Me(o)}),n}Y(e){return e[En]?!0:(e[En]=!0,vt(e,this.Oe).forEach(n=>n[En]=!0),!1)}Me(e){if(e.hasAttribute(this.R)||this.Y(e))return;let n=e.getAttribute(this.x);if(!n){D(0,this.x,e);return}e.removeAttribute(this.x),this.gt(e,n)}Le(e){return le(e)?[]:(z(e)&&(e=e()),Symbol.iterator in Object(e)?e:typeof e=="number"?(o=>({*[Symbol.iterator](){for(let r=1;r<=o;r++)yield r}}))(e):Object.entries(e))}gt(e,n){let o=this.bt(n);if(!o?.list){D(1,this.x,n,e);return}let r=this.r.o.p.key,s=this.r.o.p.keyBind,a=e.getAttribute(r)??e.getAttribute(s);e.removeAttribute(r),e.removeAttribute(s);let i=Ke(e),c=jt.ft(this.r,i),l=e.parentNode;if(!l)return;let u=`${this.x} => ${n}`,p=new Comment(`__begin__ ${u}`);l.insertBefore(p,e),ze(p,i),i.forEach(L=>{q(L)}),e.remove();let f=new Comment(`__end__ ${u}`);l.insertBefore(f,p.nextSibling);let h=this.r,m=h.m,d=m.L(),C=d.length===1?[void 0,d[0]]:void 0,v=this.xt(a),F=(L,G)=>v(L)===v(G),W=(L,G)=>L===G,P=(L,G,Y)=>{let Z=o.createContext(G,L),b=ct.mt(Z.index,G),M=()=>{let E=f.parentNode??p.parentNode??l,T=Y.previousSibling,V=[];for(let w=0;w<i.length;++w){let A=i[w].cloneNode(!0);E.insertBefore(A,Y),V.push(A)}for(c?c.y(h,V):ke(h,V),T=T.nextSibling;T!==Y;)b.items.push(T),T=T.nextSibling};return C?(C[0]=Z.ctx,m.E(C,M)):m.E(d,()=>{m.v(Z.ctx),M()}),b},Q=(L,G)=>{let Y=I.D(L).items,Z=Y[Y.length-1].nextSibling;for(let b of Y)q(b);I.ce(L,P(L,G,Z))},se=(L,G)=>{I.v(P(L,G,f))},S=L=>{for(let G of I.D(L).items)q(G)},me=L=>{let G=I.w;for(let Y=L;Y<G;++Y)I.D(Y).index(Y)},g=L=>{let G=p.parentNode,Y=f.parentNode;if(!G||!Y)return;let Z=I.w;z(L)&&(L=L());let b=U(L[0]);if(R(b)&&b.length===0){Ce(p,f),I.Ne(0);return}let M=[];for(let N of this.Le(L[0]))M.push(N);let E=$t.dt({oldItems:I.T,newValues:M,getKey:v,isSameValue:W,mountNewValue:(N,ee,Le)=>P(N,ee,Le),removeMountItem:N=>{for(let ee=0;ee<N.items.length;++ee)q(N.items[ee])},endAnchor:f});if(E){I.T=E,I.P.clear();for(let N=0;N<E.length;++N){let ee=E[N];ee.order=N,ee.index(N);let Le=v(ee.value);Le!==void 0&&I.P.set(Le,ee)}return}let T=0,V=Number.MAX_SAFE_INTEGER,w=Z,A=this.r.o.forGrowThreshold,ae=()=>I.w<w+A;for(let N of M){let ee=()=>{if(T<Z){let Le=I.D(T++);if(F(Le.value,N)){if(W(Le.value,N))return;Q(T-1,N);return}let ft=I.ht(v(N));if(ft>=T&&ft-T<10){if(--T,V=Math.min(V,T),S(T),I.Ve(T),--Z,ft>T+1)for(let sn=T;sn<ft-1&&sn<Z&&!F(I.D(T).value,N);)++sn,S(T),I.Ve(T),--Z;ee();return}ae()?(I.yt(T-1,P(T,N,I.D(T-1).items[0])),V=Math.min(V,T-1),++Z):Q(T-1,N)}else se(T++,N)};ee()}let xe=T;for(Z=I.w;T<Z;)S(T++);I.Ne(xe),me(V)},k=()=>{H.stop(),nt(),nt=yo},H=m.M(o.list),$e=H.value,nt=yo,pt=0,I=new ct(v);for(let L of this.Le($e()[0]))I.v(P(pt++,L,f));_(p,k),nt=H.subscribe(g)}static Tt=/\{?\[?\(?([^)}\]]+)\)?\]?\}?([^)]+)?\s+\b(?:in|of)\b\s+(.*)\s*$/;bt(e){let n=t.Tt.exec(e);if(!n)return;let o=(n[1]+(n[2]??"")).split(",").map(c=>c.trim()),r=o.length>1?o.length-1:-1,s=r!==-1&&(o[r]==="index"||o[r]?.startsWith("#"))?o[r]:"";s&&o.splice(r,1);let a=n[3];if(!a||o.length===0)return;let i=/[{[]/.test(e);return{list:a,createContext:(c,l)=>{let u={},p=U(c);if(!i&&o.length===1)u[o[0]]=c;else if(R(p)){let h=0;for(let m of o)u[m]=p[h++]}else for(let h of o)u[h]=p[h];let f={ctx:u,index:fs};return s&&(f.index=u[s.startsWith("#")?s.substring(1):s]=oe(l)),f}}}xt(e){if(!e)return o=>o;let n=e.trim();if(!n)return o=>o;if(n.includes(".")){let o=this.Rt(n),r=o.length>1?o.slice(1):void 0;return s=>{let a=U(s),i=this.Ie(a,o);return i!==void 0||!r?i:this.Ie(a,r)}}return o=>U(U(o)?.[n])}Rt(e){return e.split(".").filter(n=>n.length>0)}Ie(e,n){let o=e;for(let r of n)o=U(o)?.[r];return U(o)}};var Ft=class{pe=0;ue=new Map;m;Pe;De;Ue;N;F;o;R;Be;constructor(e){this.m=e,this.o=e.o,this.De=new _t(this),this.Pe=new Rt(this),this.Ue=new Ht(this),this.N=new Dt(this),this.F=new Ut(this),this.R=this.o.p.pre,this.Be=this.o.p.dynamic}Et(e){let n=pe(e)?[e]:e.querySelectorAll("template");for(let o of n){if(o.hasAttribute(this.R))continue;let r=o.parentNode;if(!r)continue;let s=o.nextSibling;if(o.remove(),!o.content)continue;let a=[...o.content.childNodes];for(let i of a)r.insertBefore(i,s);ke(this,a)}}$(e){++this.pe;try{if(e.nodeType!==Node.ELEMENT_NODE||e.hasAttribute(this.R)||this.Pe.k(e)||this.De.k(e)||this.Ue.k(e))return;this.N.k(e),this.Et(e),this.ve(e,!0)}finally{--this.pe,this.pe===0&&this.Ct()}}vt(e,n){let o=document;if(!o){let r=e.parentNode;for(;r?.parentNode;)r=r.parentNode;if(!r)return null;o=r}return o.querySelector(n)}He(e,n){let o=this.vt(e,n);if(!o)return!1;let r=e.parentElement;if(!r)return!1;let s=new Comment(`teleported => '${n}'`);return r.insertBefore(s,e),e.teleportedFrom=s,s.teleportedTo=e,_(s,()=>{q(e)}),o.appendChild(e),!0}wt(e,n){this.ue.set(e,n)}Ct(){let e=this.ue;if(e.size!==0){this.ue=new Map;for(let[n,o]of e.entries())this.He(n,o)}}ve(e,n){let o=this.F.Ce(e,n),r=this.o.B;for(let[s,a]of o.entries()){let[i,c]=a.te,l=r[s]??r[i];if(!l){console.error("directive not found:",i);continue}let u=a.we;for(let p=0;p<u.length;++p){let f=u[p];this.y(l,f,s,!1,c,a.ne)}}}y(e,n,o,r,s,a){if(n.hasAttribute(this.R))return;let i=n.getAttribute(o);n.removeAttribute(o);let c=l=>{let u=l;for(;u;){let p=u.getAttribute(st);if(p)return p;u=u.parentElement}return null};if(dn()){let l=c(n);if(l){this.m.E(to(l),()=>{this.O(e,n,i,s,a)});return}}this.O(e,n,i,s,a)}St(e,n,o){return e!==At?!1:($(o)||this.He(n,o)||this.wt(n,o),!0)}O(e,n,o,r,s){if(n.nodeType!==Node.ELEMENT_NODE||o==null||this.St(e,n,o))return;let a=this.At(r,e.once),i=this.kt(e,o),c=this.Vt(i,a);_(n,c.stop);let l=this.Nt(n,o,i,a,r,s),u=this.Ot(e,l,c);if(!u)return;let p=this.Mt(l,i,a,r,u);p(),e.once||(c.result=i.subscribe(p),a&&(c.dynamic=a.subscribe(p)))}At(e,n){let o=io(e,this.Be);if(o)return this.m.M(j(o),void 0,void 0,void 0,n)}kt(e,n){return this.m.M(n,e.isLazy,e.isLazyKey,e.collectRefObj,e.once)}Vt(e,n){let o={stop:()=>{e.stop(),n?.stop(),o.result?.(),o.dynamic?.(),o.mounted?.(),o.result=void 0,o.dynamic=void 0,o.mounted=void 0}};return o}Nt(e,n,o,r,s,a){return{el:e,expr:n,values:o.value(),previousValues:void 0,option:r?r.value()[0]:s,previousOption:void 0,flags:a,parseResult:o,dynamicOption:r}}Ot(e,n,o){let r=e.mount(n);if(typeof r=="function"){o.mounted=r;return}return r?.unmount&&(o.mounted=r.unmount),r?.update}Mt(e,n,o,r,s){let a,i;return()=>{let c=n.value(),l=o?o.value()[0]:r;e.values=c,e.previousValues=a,e.option=l,e.previousOption=i,a=c,i=l,s(e)}}};var go="http://www.w3.org/1999/xlink",ms={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 ds(t){return!!t||t===""}var hs=(t,e,n,o,r,s)=>{if(o){s&&s.includes("camel")&&(o=j(o)),qt(t,o,e[0],r);return}let a=e.length;for(let i=0;i<a;++i){let c=e[i];if(R(c)){let l=n?.[i]?.[0],u=c[0],p=c[1];qt(t,u,p,l)}else if(O(c))for(let l of Object.entries(c)){let u=l[0],p=l[1],f=n?.[i],h=f&&u in f?u:void 0;qt(t,u,p,h)}else{let l=n?.[i],u=e[i++],p=e[i];qt(t,u,p,l)}}},Rn={mount:()=>({update:({el:t,values:e,previousValues:n,option:o,previousOption:r,flags:s})=>{hs(t,e,n,o,r,s)}})},qt=(t,e,n,o)=>{if(o&&o!==e&&t.removeAttribute(o),le(e)){D(3,"r-bind",t);return}if(!K(e)){D(6,`Attribute key is not string at ${t.outerHTML}`,e);return}if(e.startsWith("xlink:")){le(n)?t.removeAttributeNS(go,e.slice(6,e.length)):t.setAttributeNS(go,e,n);return}let r=e in ms;le(n)||r&&!ds(n)?t.removeAttribute(e):t.setAttribute(e,r?"":n)};var ys=(t,e,n)=>{let o=e.length;for(let r=0;r<o;++r){let s=e[r],a=n?.[r];if(R(s)){let i=s.length;for(let c=0;c<i;++c)bo(t,s[c],a?.[c])}else bo(t,s,a)}},vn={mount:()=>({update:({el:t,values:e,previousValues:n})=>{ys(t,e,n)}})},bo=(t,e,n)=>{let o=t.classList,r=K(e),s=K(n);if(e&&!r){if(n&&!s)for(let a in n)(!(a in e)||!e[a])&&o.remove(a);for(let a in e)e[a]&&o.add(a)}else if(r){if(n!==e){let a=s?Ge(n):[],i=Ge(e);a.length>0&&o.remove(...a),i.length>0&&o.add(...i)}}else if(n){let a=s?Ge(n):[];a.length>0&&o.remove(...a)}};function gs(t,e){if(t.length!==e.length)return!1;let n=!0;for(let o=0;n&&o<t.length;o++)n=Re(t[o],e[o]);return n}function Re(t,e){if(t===e)return!0;let n=un(t),o=un(e);if(n||o)return n&&o?t.getTime()===e.getTime():!1;if(n=ot(t),o=ot(e),n||o)return t===e;if(n=R(t),o=R(e),n||o)return n&&o?gs(t,e):!1;if(n=O(t),o=O(e),n||o){if(!n||!o)return!1;let r=Object.keys(t).length,s=Object.keys(e).length;if(r!==s)return!1;for(let a in t){let i=Object.prototype.hasOwnProperty.call(t,a),c=Object.prototype.hasOwnProperty.call(e,a);if(i&&!c||!Re(t[a],e[a]))return!1}return!0}return String(t)===String(e)}function zt(t,e){return t.findIndex(n=>Re(n,e))}var xo=t=>{let e=parseFloat(t);return isNaN(e)?t:e};var Kt=t=>{if(!x(t))throw B(3,"pause");t(void 0,void 0,3)};var Wt=t=>{if(!x(t))throw B(3,"resume");t(void 0,void 0,4)};var Co={mount:({el:t,parseResult:e,flags:n})=>({update:({values:o})=>{bs(t,o[0])},unmount:xs(t,e,n)})},bs=(t,e)=>{let n=wo(t);if(n&&Eo(t))R(e)?e=zt(e,ve(t))>-1:ce(e)?e=e.has(ve(t)):e=ws(t,e),t.checked=e;else if(n&&Ro(t))t.checked=Re(e,ve(t));else if(n||So(t))vo(t)?t.value!==e?.toString()&&(t.value=e):t.value!==e&&(t.value=e);else if(Ao(t)){let o=t.options,r=o.length,s=t.multiple;for(let a=0;a<r;a++){let i=o[a],c=ve(i);if(s)R(e)?i.selected=zt(e,c)>-1:i.selected=e.has(c);else if(Re(ve(i),e)){t.selectedIndex!==a&&(t.selectedIndex=a);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}else D(7,t)},ut=t=>(x(t)&&(t=t()),z(t)&&(t=t()),t?K(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}),Eo=t=>t.type==="checkbox",Ro=t=>t.type==="radio",vo=t=>t.type==="number"||t.type==="range",wo=t=>t.tagName==="INPUT",So=t=>t.tagName==="TEXTAREA",Ao=t=>t.tagName==="SELECT",xs=(t,e,n)=>{let o=e.value,r=ut(n?.join(",")),s=ut(o()[1]),a={int:r.int||s.int,lazy:r.lazy||s.lazy,number:r.number||s.number,trim:r.trim||s.trim};if(!e.refs[0])return D(8,t),()=>{};let i=()=>e.refs[0],c=wo(t);return c&&Eo(t)?Cs(t,i):c&&Ro(t)?Ss(t,i):c||So(t)?Ts(t,a,i,o):Ao(t)?As(t,i,o):(D(7,t),()=>{})},To=/[.,' ·٫]/,Ts=(t,e,n,o)=>{let s=e.lazy?"change":"input",a=vo(t),i=()=>{!e.trim&&!ut(o()[1]).trim||(t.value=t.value.trim())},c=f=>{let h=f.target;h.composing=1},l=f=>{let h=f.target;h.composing&&(h.composing=0,h.dispatchEvent(new Event(s)))},u=()=>{t.removeEventListener(s,p),t.removeEventListener("change",i),t.removeEventListener("compositionstart",c),t.removeEventListener("compositionend",l),t.removeEventListener("change",l)},p=f=>{let h=n();if(!h)return;let m=f.target;if(!m||m.composing)return;let d=m.value,y=ut(o()[1]);if(a||y.number||y.int){if(y.int)d=parseInt(d);else{if(To.test(d[d.length-1])&&d.split(To).length===2){if(d+="0",d=parseFloat(d),isNaN(d))d="";else if(h()===d)return}d=parseFloat(d)}isNaN(d)&&(d=""),t.value=d}else y.trim&&(d=d.trim());h(d)};return t.addEventListener(s,p),t.addEventListener("change",i),t.addEventListener("compositionstart",c),t.addEventListener("compositionend",l),t.addEventListener("change",l),u},Cs=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let a=ve(t),i=t.checked,c=s();if(R(c)){let l=zt(c,a),u=l!==-1;i&&!u?c.push(a):!i&&u&&c.splice(l,1)}else ce(c)?i?c.add(a):c.delete(a):s(vs(t,i))};return t.addEventListener(n,r),o},ve=t=>"_value"in t?t._value:t.value,No="trueValue",Es="falseValue",Oo="true-value",Rs="false-value",vs=(t,e)=>{let n=e?No:Es;if(n in t)return t[n];let o=e?Oo:Rs;return t.hasAttribute(o)?t.getAttribute(o):e},ws=(t,e)=>{if(No in t)return Re(e,t.trueValue);let o=Oo;return t.hasAttribute(o)?Re(e,t.getAttribute(o)):Re(e,!0)},Ss=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let a=ve(t);s(a)};return t.addEventListener(n,r),o},As=(t,e,n)=>{let o="change",r=()=>{t.removeEventListener(o,s)},s=()=>{let a=e();if(!a)return;let c=ut(n()[1]).number,l=Array.prototype.filter.call(t.options,u=>u.selected).map(u=>c?xo(ve(u)):ve(u));if(t.multiple){let u=a();try{if(Kt(a),ce(u)){u.clear();for(let p of l)u.add(p)}else R(u)?(u.splice(0),u.push(...l)):a(l)}finally{Wt(a),J(a)}}else a(l[0])};return t.addEventListener(o,s),r};var Ns=["stop","prevent","capture","self","once","left","right","middle","passive"],Os=t=>{let e={};if($(t))return;let n=t.split(",");for(let o of Ns)e[o]=n.includes(o);return e},ks=(t,e,n,o,r)=>{if(o){let l=e.value(),u=U(o.value()[0]);return K(u)?wn(t,j(u),()=>e.value()[0],r?.join(",")??l[1]):()=>{}}else if(n){let l=e.value();return wn(t,j(n),()=>e.value()[0],r?.join(",")??l[1])}let s=[],a=()=>{s.forEach(l=>l())},i=e.value(),c=i.length;for(let l=0;l<c;++l){let u=i[l];if(z(u)&&(u=u()),O(u))for(let p of Object.entries(u)){let f=p[0],h=()=>{let d=e.value()[l];return z(d)&&(d=d()),d=d[f],z(d)&&(d=d()),d},m=u[f+"_flags"];s.push(wn(t,f,h,m))}else D(2,"r-on",t)}return a},Sn={isLazy:(t,e)=>e===-1&&t%2===0,isLazyKey:(t,e)=>e===0&&!t.endsWith("_flags"),once:!1,collectRefObj:!0,mount:({el:t,parseResult:e,option:n,dynamicOption:o,flags:r})=>ks(t,e,n,o,r)},Ms=(t,e)=>{if(t.startsWith("keydown")||t.startsWith("keyup")||t.startsWith("keypress")){e??="";let n=[...t.split("."),...e.split(",")];t=n[0];let o=n[1],r=n.includes("ctrl"),s=n.includes("shift"),a=n.includes("alt"),i=n.includes("meta"),c=l=>!(r&&!l.ctrlKey||s&&!l.shiftKey||a&&!l.altKey||i&&!l.metaKey);return o?[t,l=>c(l)?l.key.toUpperCase()===o.toUpperCase():!1]:[t,c]}return[t,n=>!0]},wn=(t,e,n,o)=>{if($(e))return D(5,"r-on",t),()=>{};let r=Os(o),s=r?{capture:r.capture,passive:r.passive,once:r.once}:void 0,a;[e,a]=Ms(e,o);let i=u=>{if(!a(u)||!n&&e==="submit"&&r?.prevent)return;let p=n(u);z(p)&&(p=p(u)),z(p)&&p(u)},c=()=>{t.removeEventListener(e,l,s)},l=u=>{if(!r){i(u);return}try{if(r.left&&u.button!==0||r.middle&&u.button!==1||r.right&&u.button!==2||r.self&&u.target!==t)return;r.stop&&u.stopPropagation(),r.prevent&&u.preventDefault(),i(u)}finally{r.once&&c()}};return t.addEventListener(e,l,s),c};var Ls=(t,e,n,o)=>{if(n){o&&o.includes("camel")&&(n=j(n)),Ye(t,n,e[0]);return}let r=e.length;for(let s=0;s<r;++s){let a=e[s];if(R(a)){let i=a[0],c=a[1];Ye(t,i,c)}else if(O(a))for(let i of Object.entries(a)){let c=i[0],l=i[1];Ye(t,c,l)}else{let i=e[s++],c=e[s];Ye(t,i,c)}}},ko={mount:()=>({update:({el:t,values:e,option:n,flags:o})=>{Ls(t,e,n,o)}})};function Vs(t){return!!t||t===""}var Ye=(t,e,n)=>{if(le(e)){D(3,":prop",t);return}if(e==="innerHTML"||e==="textContent"){let s=[...t.childNodes];setTimeout(()=>s.forEach(de),1),t[e]=n??"";return}let o=t.tagName;if(e==="value"&&o!=="PROGRESS"&&!o.includes("-")){t._value=n;let s=o==="OPTION"?t.getAttribute("value"):t.value,a=n??"";s!==a&&(t.value=a),n==null&&t.removeAttribute(e);return}let r=!1;if(n===""||n==null){let s=typeof t[e];s==="boolean"?n=Vs(n):n==null&&s==="string"?(n="",r=!0):s==="number"&&(n=0,r=!0)}try{t[e]=n}catch(s){r||D(4,e,o,n,s)}r&&t.removeAttribute(e)};var Mo={once:!0,mount:({el:t,parseResult:e,expr:n})=>{let o=e,r=o.value()[0],s=R(r),a=o.refs[0];return s?r.push(t):a?a?.(t):o.context[n]=t,()=>{if(s){let i=r.indexOf(t);i!==-1&&r.splice(i,1)}else a?.(null)}}};var Is=(t,e)=>{let n=Oe(t).data,o=n._ord;Kn(o)&&(o=n._ord=t.style.display),!!e[0]?t.style.display=o:t.style.display="none"},Lo={mount:()=>({update:({el:t,values:e})=>{Is(t,e)}})};var Ps=(t,e,n)=>{let o=e.length;for(let r=0;r<o;++r){let s=e[r],a=n?.[r];if(R(s)){let i=s.length;for(let c=0;c<i;++c)Vo(t,s[c],a?.[c])}else Vo(t,s,a)}},Gt={mount:()=>({update:({el:t,values:e,previousValues:n})=>{Ps(t,e,n)}})},Vo=(t,e,n)=>{let o=t.style,r=K(e);if(e&&!r){if(n&&!K(n))for(let s in n)e[s]==null&&Nn(o,s,"");for(let s in e)Nn(o,s,e[s])}else{let s=o.display;if(r?n!==e&&(o.cssText=e):n&&t.removeAttribute("style"),"_ord"in Oe(t).data)return;o.display=s}},Io=/\s*!important$/;function Nn(t,e,n){if(R(n))n.forEach(o=>{Nn(t,e,o)});else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{let o=Ds(t,e);Io.test(n)?t.setProperty(We(o),n.replace(Io,""),"important"):t[o]=n}}var Po=["Webkit","Moz","ms"],An={};function Ds(t,e){let n=An[e];if(n)return n;let o=j(e);if(o!=="filter"&&o in t)return An[e]=o;o=at(o);for(let r=0;r<Po.length;r++){let s=Po[r]+o;if(s in t)return An[e]=s}return e}var re=t=>Do(U(t)),Do=(t,e=new WeakMap)=>{if(!t||!O(t))return t;if(R(t))return t.map(re);if(ce(t)){let o=new Set;for(let r of t.keys())o.add(re(r));return o}if(Se(t)){let o=new Map;for(let r of t)o.set(re(r[0]),re(r[1]));return o}if(e.has(t))return U(e.get(t));let n={...t};e.set(t,n);for(let o of Object.entries(n))n[o[0]]=Do(U(o[1]),e);return n};var Us=(t,e)=>{let n=e[0];t.textContent=ce(n)?JSON.stringify(re([...n])):Se(n)?JSON.stringify(re([...n])):O(n)?JSON.stringify(re(n)):n?.toString()??""},Uo={mount:()=>({update:({el:t,values:e})=>{Us(t,e)}})};var Ho={mount:()=>({update:({el:t,values:e})=>{Ye(t,"value",e[0])}})};var ue=class t{static getDefault(){return t.je??(t.je=new t)}B={};p={};lt=()=>Object.keys(this.B).filter(e=>e.length===1||!e.startsWith(":"));Z=new Map;_=new Map;static je;static Lt="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;propValidationMode="throw";constructor(e){if(this.setDirectives("r-"),e){this.globalContext=e;return}this.globalContext=this.It()}It(){let e={},n=globalThis;for(let o of t.Lt.split(","))e[o]=n[o];return e.ref=be,e.sref=oe,e.flatten=re,e}addComponent(...e){for(let n of e){if(!n.defaultName){Ie.warning("Registered component's default name is not defined",n);continue}this.Z.set(at(n.defaultName),n),this._.set(at(n.defaultName).toLocaleUpperCase(),n)}}setDirectives(e){this.B={".":ko,":":Rn,"@":Sn,[`${e}on`]:Sn,[`${e}bind`]:Rn,[`${e}html`]:Bt,[`${e}text`]:Uo,[`${e}show`]:Lo,[`${e}model`]:Co,":style":Gt,[`${e}style`]:Gt,[`${e}bind:style`]:Gt,":class":vn,[`${e}bind:class`]:vn,":ref":Mo,":value":Ho,[`${e}teleport`]:At},this.p={for:`${e}for`,if:`${e}if`,else:`${e}else`,elseif:`${e}else-if`,pre:`${e}pre`,inherit:`${e}inherit`,text:`${e}text`,context:":context",contextAlias:`${e}context`,bind:`${e}bind`,on:`${e}on`,keyBind:":key",key:"key",is:":is",teleport:`${e}teleport`,dynamic:"_d_"}}updateDirectives(e){e(this.B,this.p)}};var Jt=(t,e)=>{if(!t)return;let o=(e??ue.getDefault()).p,r=/(\{\{[^]*?\}\}|\[\[[^]*?\]\])/g,s=[{start:"{{",end:"}}"},{start:"[[",end:"]]"}];for(let a of Bs(t,o.pre,s))Hs(a,o.text,r,s)},Hs=(t,e,n,o)=>{let r=t.textContent;if(!r)return;let s=n,a=r.split(s);if(a.length<=1)return;if(t.parentElement?.childNodes.length===1&&a.length===3){let c=a[1],l=Bo(c,o);if(l&&$(a[0])&&$(a[2])){let u=t.parentElement;u.setAttribute(e,c.substring(l.start.length,c.length-l.end.length)),u.innerText="";return}}let i=document.createDocumentFragment();for(let c of a){let l=Bo(c,o);if(l){let u=document.createElement("span");u.setAttribute(e,c.substring(l.start.length,c.length-l.end.length)),i.appendChild(u)}else i.appendChild(document.createTextNode(c))}t.replaceWith(i)},Bs=(t,e,n)=>{let o=[],r=s=>{if(s.nodeType===Node.TEXT_NODE)n.some(a=>s.textContent?.includes(a.start))&&o.push(s);else{if(s?.hasAttribute?.(e))return;for(let a of Ee(s))r(a)}};return r(t),o},Bo=(t,e)=>e.find(n=>t.startsWith(n.start)&&t.endsWith(n.end));var js=9,$s=10,_s=13,Fs=32,we=46,Qt=44,qs=39,zs=34,Xt=40,Ze=41,Yt=91,On=93,kn=63,Ks=59,jo=58,$o=123,Zt=125,He=43,en=45,Mn=96,_o=47,Ln=92,Fo=new Set([2,3]),Jo={"=":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},Ws={"=>":2,...Jo,"||":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},Qo=Object.keys(Jo),Gs=new Set(Qo),In=new Set(["=>"]);Qo.forEach(t=>In.add(t));var qo={true:!0,false:!1,null:null},Js="this",et="Expected ",Be="Unexpected ",Dn="Unclosed ",Qs=et+":",zo=et+"expression",Xs="missing }",Ys=Be+"object property",Zs=Dn+"(",Ko=et+"comma",Wo=Be+"token ",ei=Be+"period",Vn=et+"expression after ",ti="missing unaryOp argument",ni=Dn+"[",oi=et+"exponent (",ri="Variable names cannot start with a number (",si=Dn+'quote after "',lt=t=>t>=48&&t<=57,Go=t=>Ws[t],Pn=class{u;e;get H(){return this.u.charAt(this.e)}get h(){return this.u.charCodeAt(this.e)}f(e){return this.u.charCodeAt(this.e)===e}constructor(e){this.u=e,this.e=0}K(e){return e>=65&&e<=90||e>=97&&e<=122||e===36||e===95||e>=128}le(e){return this.K(e)||lt(e)}i(e){return new Error(`${e} at character ${this.e}`)}g(){let e=this.h,n=this.u,o=this.e;for(;e===Fs||e===js||e===$s||e===_s;)e=n.charCodeAt(++o);this.e=o}parse(){let e=this.fe();return e.length===1?e[0]:{type:0,body:e}}fe(e){let n=[];for(;this.e<this.u.length;){let o=this.h;if(o===Ks||o===Qt)this.e++;else{let r=this.S();if(r)n.push(r);else if(this.e<this.u.length){if(o===e)break;throw this.i(Be+'"'+this.H+'"')}}}return n}S(){let e=this.Pt()??this.$e();return this.g(),this.Dt(e)}de(){this.g();let e=this.u,n=this.e,o=e.charCodeAt(n),r=e.charCodeAt(n+1),s=e.charCodeAt(n+2),a=e.charCodeAt(n+3);if(isNaN(o))return!1;let i=!1,c=0;return o===62&&r===62&&s===62&&a===61?(i=">>>=",c=4):o===61&&r===61&&s===61?(i="===",c=3):o===33&&r===61&&s===61?(i="!==",c=3):o===62&&r===62&&s===62?(i=">>>",c=3):o===60&&r===60&&s===61?(i="<<=",c=3):o===62&&r===62&&s===61?(i=">>=",c=3):o===42&&r===42&&s===61?(i="**=",c=3):o===61&&r===62?(i="=>",c=2):o===124&&r===124?(i="||",c=2):o===63&&r===63?(i="??",c=2):o===38&&r===38?(i="&&",c=2):o===61&&r===61?(i="==",c=2):o===33&&r===61?(i="!=",c=2):o===60&&r===61?(i="<=",c=2):o===62&&r===61?(i=">=",c=2):o===60&&r===60?(i="<<",c=2):o===62&&r===62?(i=">>",c=2):o===43&&r===61?(i="+=",c=2):o===45&&r===61?(i="-=",c=2):o===42&&r===61?(i="*=",c=2):o===47&&r===61?(i="/=",c=2):o===37&&r===61?(i="%=",c=2):o===38&&r===61?(i="&=",c=2):o===94&&r===61?(i="^=",c=2):o===124&&r===61?(i="|=",c=2):o===42&&r===42?(i="**",c=2):o===105&&r===110?this.le(e.charCodeAt(n+2))||(i="in",c=2):o===61?(i="=",c=1):o===124?(i="|",c=1):o===94?(i="^",c=1):o===38?(i="&",c=1):o===60?(i="<",c=1):o===62?(i=">",c=1):o===43?(i="+",c=1):o===45?(i="-",c=1):o===42?(i="*",c=1):o===47?(i="/",c=1):o===37&&(i="%",c=1),i?(this.e+=c,i):!1}$e(){let e,n,o,r,s,a,i,c;if(s=this.z(),!s||(n=this.de(),!n))return s;if(r={value:n,prec:Go(n),right_a:In.has(n)},a=this.z(),!a)throw this.i(Vn+n);let l=[s,r,a];for(;n=this.de();){o=Go(n),r={value:n,prec:o,right_a:In.has(n)},c=n;let u=p=>r.right_a&&p.right_a?o>p.prec:o<=p.prec;for(;l.length>2&&u(l[l.length-2]);)a=l.pop(),n=l.pop().value,s=l.pop(),e=this._e(n,s,a),l.push(e);if(e=this.z(),!e)throw this.i(Vn+c);l.push(r,e)}for(i=l.length-1,e=l[i];i>1;)e=this._e(l[i-1].value,l[i-2],e),i-=2;return e}z(){let e;if(this.g(),e=this.Ut(),e)return this.me(e);let n=this.h;if(lt(n)||n===we)return this.Bt();if(n===qs||n===zs)e=this.Ht();else if(n===Yt)e=this.jt();else{let o=this.$t();if(o){let r=this.z();if(!r)throw this.i(ti);return this.me({type:7,operator:o,argument:r})}this.K(n)?(e=this.ye(),e.name in qo?e={type:4,value:qo[e.name],raw:e.name}:e.name===Js&&(e={type:5})):n===Xt&&(e=this._t())}return e?(e=this.W(e),this.me(e)):!1}_e(e,n,o){if(e==="=>"){let r=n.type===1?n.expressions:[n];return{type:15,params:r,body:o}}return Gs.has(e)?{type:16,operator:e,left:n,right:o}:{type:8,operator:e,left:n,right:o}}Ut(){let e={node:!1};return this.Ft(e),e.node||(this.qt(e),e.node)||(this.Kt(e),e.node)||(this.Fe(e),e.node)||this.zt(e),e.node}me(e){let n={node:e};return this.Wt(n),this.Gt(n),this.Jt(n),n.node}$t(){let e=this.u,n=this.e,o=e.charCodeAt(n),r=e.charCodeAt(n+1),s=e.charCodeAt(n+2),a=e.charCodeAt(n+3);return o===en?(this.e++,"-"):o===33?(this.e++,"!"):o===126?(this.e++,"~"):o===He?(this.e++,"+"):o===110&&r===101&&s===119&&!this.le(a)?(this.e+=3,"new"):!1}Pt(){let e={};return this.Qt(e),e.node}Dt(e){let n={node:e};return this.Xt(n),n.node}W(e){this.g();let n=this.h;for(;n===we||n===Yt||n===Xt||n===kn;){let o;if(n===kn){if(this.u.charCodeAt(this.e+1)!==we)break;o=!0,this.e+=2,this.g(),n=this.h}if(this.e++,n===Yt){if(e={type:3,computed:!0,object:e,property:this.S()},this.g(),n=this.h,n!==On)throw this.i(ni);this.e++}else n===Xt?e={type:6,arguments:this.qe(Ze),callee:e}:(o&&this.e--,this.g(),e={type:3,computed:!1,object:e,property:this.ye()});o&&(e.optional=!0),this.g(),n=this.h}return e}Bt(){let e=this.u,n=this.e,o=n;for(;lt(e.charCodeAt(o));)o++;if(e.charCodeAt(o)===we)for(o++;lt(e.charCodeAt(o));)o++;let r=e.charCodeAt(o);if(r===101||r===69){o++;let i=e.charCodeAt(o);(i===He||i===en)&&o++;let c=o;for(;lt(e.charCodeAt(o));)o++;if(c===o){this.e=o;let l=e.slice(n,o);throw this.i(oi+l+this.H+")")}}this.e=o;let s=e.slice(n,o),a=e.charCodeAt(o);if(this.K(a))throw this.i(ri+s+this.H+")");if(a===we||s.length===1&&s.charCodeAt(0)===we)throw this.i(ei);return{type:4,value:parseFloat(s),raw:s}}Ht(){let e=this.u,n=e.length,o=this.e,r=e.charCodeAt(this.e++),s=this.e,a=s,i=[],c=!1,l=!1;for(;s<n;){let p=e.charCodeAt(s);if(p===r){l=!0,this.e=s+1;break}if(p===Ln){c||(c=!0),i.push(e.slice(a,s));let f=e.charCodeAt(s+1);i.push(this.Ke(f)),s+=2,a=s}else s++}let u=c?i.join("")+e.slice(a,l?s:n):e.slice(a,l?s:n);if(!l)throw this.e=s,this.i(si+u+'"');return{type:4,value:u,raw:e.substring(o,this.e)}}Ke(e){switch(e){case 110:return`
2
- `;case 114:return"\r";case 116:return" ";case 98:return"\b";case 102:return"\f";case 118:return"\v";default:return isNaN(e)?"":String.fromCharCode(e)}}ye(){let e=this.h,n=this.e;if(this.K(e))this.e++;else throw this.i(Be+this.H);for(;this.e<this.u.length&&(e=this.h,this.le(e));)this.e++;return{type:2,name:this.u.slice(n,this.e)}}qe(e){let n=[],o=!1,r=0;for(;this.e<this.u.length;){this.g();let s=this.h;if(s===e){if(o=!0,this.e++,e===Ze&&r&&r>=n.length)throw this.i(Wo+String.fromCharCode(e));break}else if(s===Qt){if(this.e++,r++,r!==n.length){if(e===Ze)throw this.i(Wo+",");for(let a=n.length;a<r;a++)n.push(null)}}else{if(n.length!==r&&r!==0)throw this.i(Ko);{let a=this.S();if(!a||a.type===0)throw this.i(Ko);n.push(a)}}}if(!o)throw this.i(et+String.fromCharCode(e));return n}_t(){this.e++;let e=this.fe(Ze);if(this.f(Ze))return this.e++,e.length===1?e[0]:e.length?{type:1,expressions:e}:!1;throw this.i(Zs)}jt(){return this.e++,{type:9,elements:this.qe(On)}}Ft(e){if(this.f($o)){this.e++;let n=[];for(;!isNaN(this.h);){if(this.g(),this.f(Zt)){this.e++,e.node=this.W({type:10,properties:n});return}let o=this.S();if(!o)break;if(this.g(),o.type===2&&(this.f(Qt)||this.f(Zt)))n.push({type:12,computed:!1,key:o,value:o,shorthand:!0});else if(this.f(jo)){this.e++;let r=this.S();if(!r)throw this.i(Ys);let s=o.type===9;n.push({type:12,computed:s,key:s?o.elements[0]:o,value:r,shorthand:!1}),this.g()}else n.push(o);this.f(Qt)&&this.e++}throw this.i(Xs)}}qt(e){let n=this.h;if((n===He||n===en)&&n===this.u.charCodeAt(this.e+1)){this.e+=2;let o=e.node={type:13,operator:n===He?"++":"--",argument:this.W(this.ye()),prefix:!0};if(!o.argument||!Fo.has(o.argument.type))throw this.i(Be+o.operator)}}Gt(e){let n=e.node,o=this.h;if((o===He||o===en)&&o===this.u.charCodeAt(this.e+1)){if(!Fo.has(n.type))throw this.i(Be+(o===He?"++":"--"));this.e+=2,e.node={type:13,operator:o===He?"++":"--",argument:n,prefix:!1}}}Kt(e){this.u.charCodeAt(this.e)===we&&this.u.charCodeAt(this.e+1)===we&&this.u.charCodeAt(this.e+2)===we&&(this.e+=3,e.node={type:14,argument:this.S()})}Xt(e){if(e.node&&this.f(kn)){this.e++;let n=e.node,o=this.S();if(!o)throw this.i(zo);if(this.g(),this.f(jo)){this.e++;let r=this.S();if(!r)throw this.i(zo);e.node={type:11,test:n,consequent:o,alternate:r}}else throw this.i(Qs)}}Qt(e){if(this.g(),this.f(Xt)){let n=this.e;if(this.e++,this.g(),this.f(Ze)){this.e++;let o=this.de();if(o==="=>"){let r=this.$e();if(!r)throw this.i(Vn+o);e.node={type:15,params:null,body:r};return}}this.e=n}}Jt(e){let n=e.node,o=n.type;(o===2||o===3)&&this.f(Mn)&&(e.node={type:17,tag:n,quasi:this.Fe(e)})}Fe(e){if(!this.f(Mn))return;let n=this.u,o=n.length,r={type:19,quasis:[],expressions:[]},s=++this.e,a=[],i=[],c=!1,l=u=>{if(!c){let h=n.slice(s,this.e);return r.quasis.push({type:18,value:{raw:h,cooked:h},tail:u})}a.push(n.slice(s,this.e)),i.push(n.slice(s,this.e));let p=a.join(""),f=i.join("");return a.length=0,i.length=0,c=!1,r.quasis.push({type:18,value:{raw:p,cooked:f},tail:u})};for(;this.e<o;){let u=n.charCodeAt(this.e);if(u===Mn)return l(!0),this.e+=1,e.node=r,r;if(u===36&&n.charCodeAt(this.e+1)===$o){if(l(!1),this.e+=2,r.expressions.push(...this.fe(Zt)),!this.f(Zt))throw this.i("unclosed ${");this.e+=1,s=this.e}else if(u===Ln){c||(c=!0),a.push(n.slice(s,this.e)),i.push(n.slice(s,this.e));let p=n.charCodeAt(this.e+1);a.push(n.slice(this.e,this.e+2)),i.push(this.Ke(p)),this.e+=2,s=this.e}else this.e+=1}throw this.i("Unclosed `")}Wt(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 o=e.node;for(;o.type===3||o.type===6&&o.callee.type===3;)o=o.type===3?o.object:o.callee.object;o.type=20}zt(e){if(!this.f(_o))return;let n=++this.e,o=!1;for(;this.e<this.u.length;){if(this.h===_o&&!o){let r=this.u.slice(n,this.e),s="";for(;++this.e<this.u.length;){let i=this.h;if(i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57)s+=this.H;else break}let a;try{a=new RegExp(r,s)}catch(i){throw this.i(i.message)}return e.node={type:4,value:a,raw:this.u.slice(n-1,this.e)},e.node=this.W(e.node),e.node}this.f(Yt)?o=!0:o&&this.f(On)&&(o=!1),this.e+=this.f(Ln)?2:1}throw this.i("Unclosed Regex")}},Xo=t=>new Pn(t).parse();var ii={"=>":(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},ai={"-":t=>-t,"+":t=>+t,"!":t=>!t,"~":t=>~t,new:t=>t},tr=t=>{if(!t?.some(er))return t;let e=[];return t.forEach(n=>er(n)?e.push(...n):e.push(n)),e},Yo=(...t)=>tr(t),Un=(t,e)=>{if(!t)return e;let n=Object.create(e??{});return n.$event=t,n},ci={"++":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(++o),o}return++t[e]},"--":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(--o),o}return--t[e]}},ui={"++":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(o+1),o}return t[e]++},"--":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(o-1),o}return t[e]--}},Zo={"=":(t,e,n)=>{let o=t[e];return x(o)?o(n):t[e]=n},"+=":(t,e,n)=>{let o=t[e];return x(o)?o(o()+n):t[e]+=n},"-=":(t,e,n)=>{let o=t[e];return x(o)?o(o()-n):t[e]-=n},"*=":(t,e,n)=>{let o=t[e];return x(o)?o(o()*n):t[e]*=n},"/=":(t,e,n)=>{let o=t[e];return x(o)?o(o()/n):t[e]/=n},"%=":(t,e,n)=>{let o=t[e];return x(o)?o(o()%n):t[e]%=n},"**=":(t,e,n)=>{let o=t[e];return x(o)?o(o()**n):t[e]**=n},"<<=":(t,e,n)=>{let o=t[e];return x(o)?o(o()<<n):t[e]<<=n},">>=":(t,e,n)=>{let o=t[e];return x(o)?o(o()>>n):t[e]>>=n},">>>=":(t,e,n)=>{let o=t[e];return x(o)?o(o()>>>n):t[e]>>>=n},"|=":(t,e,n)=>{let o=t[e];return x(o)?o(o()|n):t[e]|=n},"&=":(t,e,n)=>{let o=t[e];return x(o)?o(o()&n):t[e]&=n},"^=":(t,e,n)=>{let o=t[e];return x(o)?o(o()^n):t[e]^=n}},tn=(t,e)=>z(t)?t.bind(e):t,Hn=class{l;ze;We;Ge;A;Je;Qe;constructor(e,n,o,r,s){this.l=R(e)?e:[e],this.ze=n,this.We=o,this.Ge=r,this.Qe=!!s}Xe(e,n){if(n&&e in n)return n;for(let o of this.l)if(e in o)return o}2(e,n,o){let r=e.name;if(r==="$root")return this.l[this.l.length-1];if(r==="$parent")return this.l[1];if(r==="$ctx")return[...this.l];if(o&&r in o)return this.A=o[r],tn(U(o[r]),o);for(let a of this.l)if(r in a)return this.A=a[r],tn(U(a[r]),a);let s=this.ze;if(s&&r in s)return this.A=s[r],tn(U(s[r]),s)}5(e,n,o){return this.l[0]}0(e,n,o){return this.Ye(n,o,Yo,...e.body)}1(e,n,o){return this.C(n,o,(...r)=>r.pop(),...e.expressions)}3(e,n,o){let{obj:r,key:s}=this.he(e,n,o),a=r?.[s];return this.A=a,tn(U(a),r)}4(e,n,o){return e.value}6(e,n,o){let r=(a,...i)=>z(a)?a(...tr(i)):a,s=this.C(++n,o,r,e.callee,...e.arguments);return this.A=s,s}7(e,n,o){return this.C(n,o,ai[e.operator],e.argument)}8(e,n,o){let r=ii[e.operator];switch(e.operator){case"||":case"&&":case"??":return r(()=>this.b(e.left,n,o),()=>this.b(e.right,n,o))}return this.C(n,o,r,e.left,e.right)}9(e,n,o){return this.Ye(++n,o,Yo,...e.elements)}10(e,n,o){let r={},s=(...a)=>{a.forEach(i=>{Object.assign(r,i)})};return this.C(++n,o,s,...e.properties),r}11(e,n,o){return this.C(n,o,r=>this.b(r?e.consequent:e.alternate,n,o),e.test)}12(e,n,o){let r={},s=u=>u?.type!==15,a=this.Ge??(()=>!1),i=n===0&&this.Qe,c=u=>this.Ze(i,e.key,n,Un(u,o)),l=u=>this.Ze(i,e.value,n,Un(u,o));if(e.shorthand){let u=e.key.name;r[u]=s(e.key)&&a(u,n)?c:c()}else if(e.computed){let u=U(c());r[u]=s(e.value)&&a(u,n)?l:l()}else{let u=e.key.type===4?e.key.value:e.key.name;r[u]=s(e.value)&&a(u,n)?()=>l:l()}return r}he(e,n,o){let r=this.b(e.object,n,o),s=e.computed?this.b(e.property,n,o):e.property.name;return{obj:r,key:s}}13(e,n,o){let r=e.argument,s=e.operator,a=e.prefix?ci:ui;if(r.type===2){let i=r.name,c=this.Xe(i,o);return le(c)?void 0:a[s](c,i)}if(r.type===3){let{obj:i,key:c}=this.he(r,n,o);return a[s](i,c)}}16(e,n,o){let r=e.left,s=e.operator;if(r.type===2){let a=r.name,i=this.Xe(a,o);if(le(i))return;let c=this.b(e.right,n,o);return Zo[s](i,a,c)}if(r.type===3){let{obj:a,key:i}=this.he(r,n,o),c=this.b(e.right,n,o);return Zo[s](a,i,c)}}14(e,n,o){let r=this.b(e.argument,n,o);return R(r)&&(r.s=nr),r}17(e,n,o){return this[6]({type:6,callee:e.tag,arguments:[{type:9,elements:e.quasi.quasis},...e.quasi.expressions]},n,o)}19(e,n,o){let r=(...s)=>s.reduce((a,i,c)=>a+=i+e.quasis[c+1].value.cooked,e.quasis[0].value.cooked);return this.C(n,o,r,...e.expressions)}18(e,n,o){return e.value.cooked}20(e,n,o){let r=(s,...a)=>new s(...a);return this.C(n,o,r,e.callee,...e.arguments)}15(e,n,o){return(...r)=>{let s=Object.create(o??{}),a=e.params;if(a){let i=0;for(let c of a)s[c.name]=r[i++]}return this.b(e.body,n,s)}}b(e,n,o){let r=U(this[e.type](e,n,o));return this.Je=e.type,r}Ze(e,n,o,r){let s=this.b(n,o,r);return e&&this.et()?this.A:s}et(){let e=this.Je;return(e===2||e===3||e===6)&&x(this.A)}eval(e,n){let{value:o,refs:r}=Mt(()=>this.b(e,-1,n)),s={value:o,refs:r};return this.et()&&(s.ref=this.A),s}C(e,n,o,...r){let s=r.map(a=>a&&this.b(a,e,n));return o(...s)}Ye(e,n,o,...r){let s=this.We;if(!s)return this.C(e,n,o,...r);let a=r.map((i,c)=>i&&(i.type!==15&&s(c,e)?l=>this.b(i,e,Un(l,n)):this.b(i,e,n)));return o(...a)}},nr=Symbol("s"),er=t=>t?.s===nr,or=(t,e,n,o,r,s,a)=>new Hn(e,n,o,r,a).eval(t,s);var rr={},sr=t=>!!t,nn=class{l;o;constructor(e,n){this.l=e,this.o=n}v(e){this.l=[e,...this.l]}ee(){return this.l.map(n=>n.components).filter(sr).reverse().reduce((n,o)=>{for(let[r,s]of Object.entries(o))n[r.toUpperCase()]=s;return n},{})}ut(){let e=[],n=new Set,o=this.l.map(r=>r.components).filter(sr).reverse();for(let r of o)for(let s of Object.keys(r))n.has(s)||(n.add(s),e.push(s));return e}M(e,n,o,r,s){let a=[],i=[],c=new Set,l=()=>{for(let C=0;C<i.length;++C)i[C]();i.length=0},f={value:()=>a,stop:()=>{l(),c.clear()},subscribe:(C,v)=>(c.add(C),v&&C(a),()=>{c.delete(C)}),refs:[],context:this.l[0]};if($(e))return f;let h=this.o.globalContext,m=[],d=new Set,y=(C,v,F,W)=>{try{let P=or(C,v,h,n,o,W,r);return F&&P.refs.length>0&&m.push(...P.refs),{value:P.value,refs:P.refs,ref:P.ref}}catch(P){D(6,`evaluation error: ${e}`,P)}return{value:void 0,refs:[]}};try{let C=rr[e]??Xo("["+e+"]");rr[e]=C;let v=this.l.slice(),F=C.elements,W=F.length,P=new Array(W);f.refs=P;let Q=()=>{m.length=0,s||(d.clear(),l());let se=new Array(W);for(let S=0;S<W;++S){let me=F[S];if(n?.(S,-1)){se[S]=k=>y(me,v,!1,{$event:k}).value;continue}let g=y(me,v,!0);se[S]=g.value,P[S]=g.ref}if(!s)for(let S of m)d.has(S)||(d.add(S),i.push(ne(S,Q)));if(a=se,c.size!==0)for(let S of c)c.has(S)&&S(a)};Q()}catch(C){D(6,`parse error: ${e}`,C)}return f}L(){return this.l.slice()}tt=[];ce(e){this.tt.push(this.l),this.l=e}E(e,n){try{this.ce(e),n()}finally{this.Yt()}}Yt(){this.l=this.tt.pop()??[]}};var ir=t=>{let e=t.charCodeAt(0);return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||t==="-"||t==="_"||t===":"},li=(t,e)=>{let n="";for(let o=e;o<t.length;++o){let r=t[o];if(n){r===n&&(n="");continue}if(r==='"'||r==="'"){n=r;continue}if(r===">")return o}return-1},pi=(t,e)=>{let n=e?2:1;for(;n<t.length&&(t[n]===" "||t[n]===`
3
- `);)++n;if(n>=t.length||!ir(t[n]))return null;let o=n;for(;n<t.length&&ir(t[n]);)++n;return{start:o,end:n}},ar=new Set(["table","thead","tbody","tfoot"]),fi=new Set(["thead","tbody","tfoot"]),mi=new Set(["caption","colgroup","thead","tbody","tfoot","tr"]),di=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),cr=(t,e)=>`${t.slice(0,t.length-2)}></${e}>`,on=t=>{let e=0,n=[],o=[],r=0;for(;e<t.length;){let s=t.indexOf("<",e);if(s===-1){n.push(t.slice(e));break}if(n.push(t.slice(e,s)),t.startsWith("<!--",s)){let y=t.indexOf("-->",s+4);if(y===-1){n.push(t.slice(s));break}n.push(t.slice(s,y+3)),e=y+3;continue}let a=li(t,s);if(a===-1){n.push(t.slice(s));break}let i=t.slice(s,a+1),c=i.startsWith("</");if(i.startsWith("<!")||i.startsWith("<?")){n.push(i),e=a+1;continue}let u=pi(i,c);if(!u){n.push(i),e=a+1;continue}let p=i.slice(u.start,u.end);if(c){let y=o[o.length-1];y?(o.pop(),n.push(y.replacementHost?`</${y.replacementHost}>`:i),ar.has(y.effectiveTag)&&--r):n.push(i),e=a+1;continue}let f=i.charCodeAt(i.length-2)===47,h=o[o.length-1],m=null;r===0?p==="tr"?m="trx":p==="td"?m="tdx":p==="th"&&(m="thx"):fi.has(h?.effectiveTag??"")?m=p==="tr"?null:"tr":h?.effectiveTag==="table"?m=mi.has(p)?null:"tr":h?.effectiveTag==="tr"&&(m=p==="td"||p==="th"?null:"td");let d=f&&!di.has(m||p);if(m){let y=m==="trx"||m==="tdx"||m==="thx",C=`${i.slice(0,u.start)}${m} is="${y?`r-${p}`:`regor:${p}`}"${i.slice(u.end)}`;n.push(d?cr(C,m):C)}else n.push(d?cr(i,p):i);if(!f){let y=m==="trx"?"tr":m==="tdx"?"td":m==="thx"?"th":m||p;o.push({replacementHost:m,effectiveTag:y}),ar.has(y)&&++r}e=a+1}return n.join("")};var hi="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",yi=new Set(hi.toUpperCase().split(",")),gi="http://www.w3.org/2000/svg",ur=(t,e)=>{pe(t)?t.content.appendChild(e):t.appendChild(e)},Bn=(t,e,n,o)=>{let r=t.t;if(r){let a=n&&yi.has(r.toUpperCase())?document.createElementNS(gi,r.toLowerCase()):document.createElement(r),i=t.a;if(i)for(let l of Object.entries(i)){let u=l[0],p=l[1];u.startsWith("#")&&(p=u.substring(1),u="name"),a.setAttribute(St(u,o),p)}let c=t.c;if(c)for(let l of c)Bn(l,a,n,o);ur(e,a);return}let s=t.d;if(s){let a;switch(t.n??Node.TEXT_NODE){case Node.COMMENT_NODE:a=document.createComment(s);break;case Node.TEXT_NODE:a=document.createTextNode(s);break}if(a)ur(e,a);else throw new Error("unsupported node type.")}},je=(t,e,n)=>{n??=ue.getDefault();let o=document.createDocumentFragment();if(!R(t))return Bn(t,o,!!e,n),o;for(let r of t)Bn(r,o,!!e,n);return o};var lr=(t,e={selector:"#app"},n)=>{K(e)&&(e={selector:"#app",template:e}),ao(t)&&(t=t.context);let o=e.element?e.element:e.selector?document.querySelector(e.selector):null;if(!o||!Te(o))throw B(0);n||(n=ue.getDefault());let r=()=>{for(let i of[...o.childNodes])q(i)},s=i=>{for(let c of i)o.appendChild(c)};if(e.template){let i=document.createRange().createContextualFragment(on(e.template));r(),s(i.childNodes),e.element=i}else if(e.json){let i=je(e.json,e.isSVG,n);r(),s(i.childNodes)}return n.useInterpolation&&Jt(o,n),new jn(t,o,n).y(),_(o,()=>{Ae(t)}),Nt(t),{context:t,unmount:()=>{q(o)},unbind:()=>{de(o)}}},jn=class{Zt;nt;o;m;r;constructor(e,n,o){this.Zt=e,this.nt=n,this.o=o,this.m=new nn([e],o),this.r=new Ft(this.m)}y(){this.r.$(this.nt)}};var tt=t=>{if(R(t))return t.map(r=>tt(r));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(r=>[r,t.getAttribute(r)??""])));let o=Ee(t);return o.length>0&&(e.c=[...o].map(r=>tt(r))),e};var pr=(t,e={})=>{R(e)&&(e={props:e}),K(t)&&(t={template:t});let n=e.context??(()=>({})),o=!1;if(t.element){let s=t.element;s.remove(),t.element=s}else if(t.selector){let s=document.querySelector(t.selector);if(!s)throw B(1,t.selector);s.remove(),t.element=s}else if(t.template){let s=document.createRange().createContextualFragment(on(t.template));t.element=s}else t.json&&(t.element=je(t.json,t.isSVG,e.config),o=!0);t.element||(t.element=document.createDocumentFragment()),(e.useInterpolation??!0)&&Jt(t.element,e.config??ue.getDefault());let r=t.element;if(!o&&((t.isSVG??(it(r)&&r.hasAttribute?.("isSVG")))||it(r)&&r.querySelector("[isSVG]"))){let s=r.content,a=s?[...s.childNodes]:[...r.childNodes],i=tt(a);t.element=je(i,!0,e.config)}return{context:n,template:t.element,inheritAttrs:e.inheritAttrs??!0,props:e.props,defaultName:e.defaultName}};var rn=class{byConstructor=new Map;register(e){this.byConstructor.set(e.constructor,e)}unregisterByClass(e){this.byConstructor.delete(e)}unregister(e){let n=e.constructor;this.byConstructor.get(n)===e&&this.byConstructor.delete(n)}find(e){for(let n of this.byConstructor.values())if(n instanceof e)return n}require(e){let n=this.find(e);if(n)return n;throw new Error(`${e.name} is not registered in ContextRegistry.`)}};var fr=t=>{Ve()?.onMounted.push(t)};var mr=t=>{let e,n={},o=(...r)=>{if(r.length<=2&&0 in r)throw B(4);return e&&!n.isStopped?e(...r):(e=bi(t,n),e(...r))};return o[X]=1,Me(o,!0),o.stop=()=>n.ref?.stop?.(),te(()=>o.stop(),!0),o},bi=(t,e)=>{let n=e.ref??oe(null);e.ref=n,e.isStopped=!1;let o=0,r=Ue(()=>{if(o>0){r(),e.isStopped=!0,J(n);return}n(t()),++o});return n.stop=r,n};var dr=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw B(4);return o&&!n.isStopped?o(...s):(o=xi(t,e,n),o(...s))};return r[X]=1,Me(r,!0),r.stop=()=>n.ref?.stop?.(),te(()=>r.stop(),!0),r},xi=(t,e,n)=>{let o=n.ref??oe(null);n.ref=o,n.isStopped=!1;let r=0,s=i=>{if(r>0){o.stop(),n.isStopped=!0,J(o);return}let c=t.map(l=>l());o(e(...c)),++r},a=[];for(let i of t){let c=ne(i,s);a.push(c)}return s(null),o.stop=()=>{a.forEach(i=>{i()})},o};var hr=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw B(4);return o&&!n.isStopped?o(...s):(o=Ti(t,e,n),o(...s))};return r[X]=1,Me(r,!0),r.stop=()=>n.ref?.stop?.(),te(()=>r.stop(),!0),r},Ti=(t,e,n)=>{let o=n.ref??oe(null);n.ref=o,n.isStopped=!1;let r=0;return o.stop=ne(t,s=>{if(r>0){o.stop(),n.isStopped=!0,J(o);return}o(e(s)),++r},!0),o};var yr=t=>(t[bt]=1,t);var gr=(t,e)=>{if(!e)throw B(5);let o=De(t)?be:i=>i,r=()=>localStorage.setItem(e,JSON.stringify(re(t()))),s=localStorage.getItem(e);if(s!=null)try{t(o(JSON.parse(s)))}catch(i){D(6,`persist: failed to parse data for key ${e}`,i),r()}else r();let a=Ue(r);return te(a,!0),t};var $n=(t,...e)=>{let n="",o=t,r=e,s=o.length,a=r.length;for(let i=0;i<s;++i)n+=o[i],i<a&&(n+=r[i]);return n},br=$n;var xr=(t,e,n)=>{let o=[],r=()=>{e(t.map(a=>a()))};for(let a of t)o.push(ne(a,r));n&&r();let s=()=>{for(let a of o)a()};return te(s,!0),s};var Tr=t=>{if(!x(t))throw B(3,"observerCount");return t(void 0,void 0,2)};var Cr=t=>{_n();try{t()}finally{Fn()}},_n=()=>{ge.stack||(ge.stack=[]),ge.stack.push(new Set)},Fn=()=>{let t=ge.stack;if(!t||t.length===0)return;let e=t.pop();if(t.length){let n=t[t.length-1];for(let o of e)n.add(o);return}delete ge.stack;for(let n of e)try{J(n)}catch(o){console.error(o)}};
1
+ "use strict";var un=Object.defineProperty;var vr=Object.getOwnPropertyDescriptor;var wr=Object.getOwnPropertyNames;var Sr=Object.prototype.hasOwnProperty;var Ar=(t,e)=>{for(var n in e)un(t,n,{get:e[n],enumerable:!0})},Nr=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of wr(e))!Sr.call(t,r)&&r!==n&&un(t,r,{get:()=>e[r],enumerable:!(o=vr(e,r))||o.enumerable});return t};var Or=t=>Nr(un({},"__esModule",{value:!0}),t);var Ri={};Ar(Ri,{ComponentHead:()=>qe,ContextRegistry:()=>sn,RegorConfig:()=>ue,addUnbinder:()=>_,batch:()=>Rr,collectRefs:()=>Lt,computeMany:()=>hr,computeRef:()=>yr,computed:()=>dr,createApp:()=>fr,defineComponent:()=>pr,drainUnbind:()=>Kn,endBatch:()=>qn,entangle:()=>Je,flatten:()=>re,getBindData:()=>Oe,html:()=>an,isDeepRef:()=>De,isRaw:()=>Qe,isRef:()=>x,markRaw:()=>gr,observe:()=>ne,observeMany:()=>Cr,observerCount:()=>Er,onMounted:()=>mr,onUnmounted:()=>te,pause:()=>Wt,persist:()=>br,pval:()=>Zn,raw:()=>xr,ref:()=>be,removeNode:()=>q,resume:()=>Gt,silence:()=>Mt,sref:()=>oe,startBatch:()=>Fn,svg:()=>Tr,toFragment:()=>je,toJsonTemplate:()=>tt,trigger:()=>J,unbind:()=>de,unref:()=>U,useScope:()=>kt,warningHandler:()=>Ie,watchEffect:()=>Ue});module.exports=Or(Ri);var _e=Symbol(":regor");var de=t=>{let e=[t];for(let n=0;n<e.length;++n){let o=e[n];kr(o);for(let r=o.lastChild;r!=null;r=r.previousSibling)e.push(r)}},kr=t=>{let e=t[_e];if(!e)return;let n=e.unbinders;for(let o=0;o<n.length;++o)n[o]();n.length=0,t[_e]=void 0};var Fe=[],dt=!1,ht,zn=()=>{if(dt=!1,ht=void 0,Fe.length!==0){for(let t=0;t<Fe.length;++t)de(Fe[t]);Fe.length=0}},q=t=>{t.remove(),Fe.push(t),dt||(dt=!0,ht=setTimeout(zn,1))},Kn=async()=>{Fe.length===0&&!dt||(ht&&clearTimeout(ht),zn())};var z=t=>typeof t=="function",K=t=>typeof t=="string",Wn=t=>typeof t>"u",le=t=>t==null||typeof t>"u",$=t=>typeof t!="string"||!t?.trim(),Mr=Object.prototype.toString,ln=t=>Mr.call(t),Se=t=>ln(t)==="[object Map]",ce=t=>ln(t)==="[object Set]",fn=t=>ln(t)==="[object Date]",ot=t=>typeof t=="symbol",R=Array.isArray,O=t=>t!==null&&typeof t=="object";var Gn={0:"createApp can't find root element. You must define either a valid `selector` or an `element`. Example: createApp({}, {selector: '#app', html: '...'})",1:t=>`Component template cannot be found. selector: ${t} .`,2:"Use composables in scope. usage: useScope(() => new MyApp()).",3:t=>`${t} requires ref source argument`,4:"computed is readonly.",5:"persist requires a string key."},B=(t,...e)=>{let n=Gn[t];return new Error(z(n)?n.call(Gn,...e):n)};var yt=[],Jn=()=>{let t={onMounted:[],onUnmounted:[]};return yt.push(t),t},Ve=t=>{let e=yt[yt.length-1];if(!e&&!t)throw B(2);return e},Qn=t=>{let e=Ve();return t&&mn(t),yt.pop(),e},pn=Symbol("csp"),mn=t=>{let e=t,n=e[pn];if(n){let o=Ve();if(n===o)return;o.onMounted.length>0&&n.onMounted.push(...o.onMounted),o.onUnmounted.length>0&&n.onUnmounted.push(...o.onUnmounted);return}e[pn]=Ve()},gt=t=>t[pn];var Ae=t=>{gt(t)?.onUnmounted?.forEach(n=>{n()}),t.unmounted?.()};var Xn={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,o)=>({msg:`Failed setting prop "${t}" on <${e.toLowerCase()}>: value ${n} is invalid.`,args:[o]}),5:(t,e)=>`${t} binding missing event type at ${e.outerHTML}`,6:(t,e)=>({msg:t,args:[e]})},D=(t,...e)=>{let n=Xn[t],o=z(n)?n.call(Xn,...e):n,r=Ie.warning;r&&(K(o)?r(o):r(o,...o.args))},Ie={warning:console.warn};var bt=Symbol("ref"),X=Symbol("sref"),xt=Symbol("raw");var x=t=>t!=null&&t[X]===1;var Ne=class extends Error{propPath;detail;constructor(e,n){super(n),this.name="PropValidationError",this.propPath=e,this.detail=n}},ye=(t,e)=>{throw new Ne(t,`${e}.`)},Tt=t=>{if(t===null)return"null";if(t===void 0)return"undefined";if(x(t))return`ref<${Tt(t())}>`;if(typeof t=="string")return"string";if(typeof t=="number")return"number";if(typeof t=="boolean")return"boolean";if(typeof t=="bigint")return"bigint";if(typeof t=="symbol")return"symbol";if(typeof t=="function")return"function";if(R(t))return"array";if(t instanceof Date)return"Date";if(t instanceof RegExp)return"RegExp";if(t instanceof Map)return"Map";if(t instanceof Set)return"Set";let e=t?.constructor?.name;return e&&e!=="Object"?e:"object"},Lr=t=>t.length>60?`${t.slice(0,57)}...`:t,rt=(t,e=0)=>{if(e>1)return"unknown";if(x(t)){let s=t();return`ref(${rt(s,e+1)})`}if(typeof t=="string")return Lr(JSON.stringify(t));if(typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"||typeof t=="symbol")return String(t);if(t===null)return"null";if(t===void 0)return"undefined";if(t instanceof Date)return t.toISOString();if(t instanceof RegExp)return String(t);if(R(t)){let s=t.slice(0,5).map(a=>rt(a,e+1)).join(", ");return t.length>5?`[${s}, ...]`:`[${s}]`}if(O(t)){let s=Object.entries(t).slice(0,5);if(s.length===0)return"{}";let a=s.map(([i,c])=>{let l=rt(c,e+1);return`${i}: ${l}`}).join(", ");return Object.keys(t).length>5?`{ ${a}, ... }`:`{ ${a} }`}return"unknown"},ie=t=>{if(x(t))return`got ${Tt(t)}(${rt(t())})`;let e=Tt(t),n=rt(t);return`got ${e} (${n})`},Vr=t=>t instanceof Ne?t.detail:t instanceof Error?t.message:String(t),Yn=(t,e)=>{let n=`, ${ie(e)}.`;return t.endsWith(n)?t.slice(0,-n.length):t},Ir=(t,e,n)=>{if(e instanceof Ne){if(e.propPath===t)return Yn(e.detail,n);if(e.propPath===`${t}.value`&&x(n)){let o=Yn(e.detail,n());return o.startsWith("expected ")?`expected ref<${o.slice(9)}>`:`expected ref where ${o}`}}return Vr(e)},Pr=(t,e,n)=>{let o=[];for(let r of e){let s=Ir(t,r,n);o.includes(s)||o.push(s)}return o.length===0?ie(n):o.length===1?`${o[0]}, ${ie(n)}`:`${o.join(" or ")}, ${ie(n)}`},Dr=t=>typeof t=="string"?`"${t}"`:typeof t=="number"||typeof t=="boolean"?String(t):t===null?"null":t===void 0?"undefined":Tt(t),Ur=(t,e)=>{typeof t!="string"&&ye(e,`expected string, ${ie(t)}`)},Hr=(t,e)=>{typeof t!="number"&&ye(e,`expected number, ${ie(t)}`)},Br=(t,e)=>{typeof t!="boolean"&&ye(e,`expected boolean, ${ie(t)}`)},jr=t=>(e,n)=>{e instanceof t||ye(n,`expected instance of ${t.name||"provided class"}, ${ie(e)}`)},$r=t=>(e,n,o)=>{e!==void 0&&t(e,n,o)},_r=t=>(e,n,o)=>{e!==null&&t(e,n,o)},Fr=(...t)=>(e,n,o)=>{let r=[];for(let s of t)try{s(e,n,o);return}catch(a){r.push(a)}ye(n,Pr(n,r,e))},qr=t=>(e,n)=>{t.includes(e)||ye(n,`expected one of ${t.map(o=>Dr(o)).join(", ")}, ${ie(e)}`)},zr=t=>(e,n,o)=>{R(e)||ye(n,`expected array, ${ie(e)}`);let r=e;for(let s=0;s<r.length;++s)t(r[s],`${n}[${s}]`,o)};function Kr(t){return(e,n,o)=>{O(e)||ye(n,`expected object, ${ie(e)}`);let r=e;for(let s in t){let a=t[s];if(!a)continue;a(r[s],`${n}.${s}`,o)}}}var Wr=t=>(e,n,o)=>{if(x(e)){t(e(),`${n}.value`,o);return}ye(n,`expected ref, ${ie(e)}`)},Zn={fail:ye,describe:ie,isString:Ur,isNumber:Hr,isBoolean:Br,isClass:jr,optional:$r,nullable:_r,or:Fr,oneOf:qr,arrayOf:zr,shape:Kr,refOf:Wr};var Gr=(t,e,n)=>{let o=t.tagName?.toLowerCase?.()||"unknown",r=n instanceof Ne?n.propPath:e,s=n instanceof Ne?n.detail:n instanceof Error?n.message:String(n);return n instanceof Error?new Error(`Invalid prop "${r}" on <${o}>: ${s}`,{cause:n}):new Error(`Invalid prop "${r}" on <${o}>: ${s}`,{cause:n})},qe=class{props;start;end;ctx;autoProps=!0;entangle=!0;enableSwitch=!1;onAutoPropsAssigned;G;J;constructor(e,n,o,r,s,a){this.props=e,this.G=n,this.ctx=o,this.start=r,this.end=s,this.J=a}emit=(e,n)=>{this.G.dispatchEvent(new CustomEvent(e,{detail:n}))};findContext(e,n=0){if(n<0)return;let o=0;for(let r of this.ctx??[])if(r instanceof e){if(o===n)return r;++o}}requireContext(e,n=0){let o=this.findContext(e,n);if(o!==void 0)return o;throw new Error(`${e} was not found in the context stack at occurrence ${n}.`)}validateProps(e){if(this.J==="off")return;let n=this.props;for(let o in e){let r=e[o];if(!r)continue;let s=r;try{s(n[o],o,this)}catch(a){let i=Gr(this.G,o,a);if(this.J==="warn"){Ie.warning(i.message,i);continue}throw i}}}unmount(){let e=this.start.nextSibling,n=this.end;for(;e&&e!==n;)q(e),e=e.nextSibling;for(let o of this.ctx)Ae(o)}};var Oe=t=>{let e=t,n=e[_e];if(n)return n;let o={unbinders:[],data:{}};return e[_e]=o,o};var _=(t,e)=>{Oe(t).unbinders.push(e)};var st=t=>{if(typeof t=="string"){let e=t.trim().toLowerCase();if(e===""||e==="0"||e==="false")return!1;if(e==="true")return!0}return!!t};var Et={},Ct={},eo=1,to=t=>{let e=(eo++).toString();return Et[e]=t,Ct[e]=0,e},dn=t=>{Ct[t]+=1},hn=t=>{--Ct[t]===0&&(delete Et[t],delete Ct[t])},no=t=>Et[t],yn=()=>eo!==1&&Object.keys(Et).length>0,it="r-switch",Jr=t=>{let e=t.filter(o=>Te(o)).map(o=>[...o.querySelectorAll("[r-switch]")].map(r=>r.getAttribute(it))),n=new Set;return e.forEach(o=>{o.forEach(r=>r&&n.add(r))}),[...n]},ze=(t,e)=>{if(!yn())return;let n=Jr(e);n.length!==0&&(n.forEach(dn),_(t,()=>{n.forEach(hn)}))};var Rt=()=>{},gn=(t,e,n,o)=>{let r=[];for(let s of t){let a=s.cloneNode(!0);n.insertBefore(a,o),r.push(a)}ke(e,r)},bn=Symbol("r-if"),oo=Symbol("r-else"),ro=t=>t[oo]===1,vt=class{r;V;ge;Q;X;x;R;constructor(e){this.r=e,this.V=e.o.p.if,this.ge=St(e.o.p.if),this.Q=e.o.p.else,this.X=e.o.p.elseif,this.x=e.o.p.for,this.R=e.o.p.pre}ot(e,n){let o=e.parentElement;for(;o!==null&&o!==document.documentElement;){if(o.hasAttribute(n))return!0;o=o.parentElement}return!1}k(e){let n=e.hasAttribute(this.V);return n&&this.y(e),this.r.N.j(e,o=>{o.hasAttribute(this.V)&&this.y(o)}),n}Y(e){return e[bn]?!0:(e[bn]=!0,wt(e,this.ge).forEach(n=>n[bn]=!0),!1)}y(e){if(e.hasAttribute(this.R)||this.Y(e)||this.ot(e,this.x))return;let n=e.getAttribute(this.V);if(!n){D(0,this.V,e);return}e.removeAttribute(this.V),this.O(e,n)}U(e,n,o){let r=Ke(e),s=e.parentNode,a=document.createComment(`__begin__ :${n}${o??""}`);s.insertBefore(a,e),ze(a,r),r.forEach(c=>{q(c)}),e.remove(),n!=="if"&&(e[oo]=1);let i=document.createComment(`__end__ :${n}${o??""}`);return s.insertBefore(i,a.nextSibling),{nodes:r,parent:s,commentBegin:a,commentEnd:i}}be(e,n){if(!e)return[];let o=e.nextElementSibling;if(e.hasAttribute(this.Q)){e.removeAttribute(this.Q);let{nodes:r,parent:s,commentBegin:a,commentEnd:i}=this.U(e,"else");return[{mount:()=>{gn(r,this.r,s,i)},unmount:()=>{Ce(a,i)},isTrue:()=>!0,isMounted:!1}]}else{let r=e.getAttribute(this.X);if(!r)return[];e.removeAttribute(this.X);let{nodes:s,parent:a,commentBegin:i,commentEnd:c}=this.U(e,"elseif",` => ${r} `),l=this.r.m.M(r),u=l.value,f=this.be(o,n),p=Rt;return _(i,()=>{l.stop(),p(),p=Rt}),p=l.subscribe(n),[{mount:()=>{gn(s,this.r,a,c)},unmount:()=>{Ce(i,c)},isTrue:()=>st(u()[0]),isMounted:!1},...f]}}O(e,n){let o=e.nextElementSibling,{nodes:r,parent:s,commentBegin:a,commentEnd:i}=this.U(e,"if",` => ${n} `),c=this.r.m.M(n),l=c.value,u=!1,f=this.r.m,p=f.L(),h=()=>{f.E(p,()=>{if(st(l()[0]))u||(gn(r,this.r,s,i),u=!0),m.forEach(C=>{C.unmount(),C.isMounted=!1});else{Ce(a,i),u=!1;let C=!1;for(let v of m)!C&&v.isTrue()?(v.isMounted||(v.mount(),v.isMounted=!0),C=!0):(v.unmount(),v.isMounted=!1)}})},m=this.be(o,h),d=Rt;_(a,()=>{c.stop(),d(),d=Rt}),h(),d=c.subscribe(h)}};var Ke=t=>{let e=fe(t)?t.content.childNodes:[t],n=[];for(let o=0;o<e.length;++o){let r=e[o];if(r.nodeType===1){let s=r?.tagName;if(s==="SCRIPT"||s==="STYLE")continue}n.push(r)}return n},ke=(t,e)=>{for(let n=0;n<e.length;++n){let o=e[n];o.nodeType===Node.ELEMENT_NODE&&(ro(o)||t.$(o))}},wt=(t,e)=>{let n=t.querySelectorAll(e);return t.matches?.(e)?[t,...n]:n},fe=t=>t instanceof HTMLTemplateElement,Te=t=>t.nodeType===Node.ELEMENT_NODE,at=t=>t.nodeType===Node.ELEMENT_NODE,so=t=>t instanceof HTMLSlotElement,Ee=t=>fe(t)?t.content.childNodes:t.childNodes,Ce=(t,e)=>{let n=t.nextSibling;for(;n!=null&&n!==e;){let o=n.nextSibling;q(n),n=o}},io=function(){return this()},Qr=function(t){return this(t)},Xr=()=>{throw new Error("value is readonly.")},Yr={get:io,set:Qr,enumerable:!0,configurable:!1},Zr={get:io,set:Xr,enumerable:!0,configurable:!1},Me=(t,e)=>{Object.defineProperty(t,"value",e?Zr:Yr)},ao=(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},St=t=>`[${CSS.escape(t)}]`,At=(t,e)=>(t.startsWith("@")&&(t=e.p.on+":"+t.slice(1)),t.includes("[")&&(t=t.replace(/[[\]]/g,e.p.dynamic)),t),xn=t=>{let e=Object.create(null);return n=>e[n]||(e[n]=t(n))},es=/-(\w)/g,j=xn(t=>t&&t.replace(es,(e,n)=>n?n.toUpperCase():"")),ts=/\B([A-Z])/g,We=xn(t=>t&&t.replace(ts,"-$1").toLowerCase()),ct=xn(t=>t&&t.charAt(0).toUpperCase()+t.slice(1));var Nt={mount:()=>{}};var Ge=t=>{let e=t.trim();return e?e.split(/\s+/):[]};var Ot=t=>{gt(t)?.onMounted?.forEach(n=>{n()}),t.mounted?.()};var Tn=Symbol("scope"),kt=t=>{try{Jn();let e=t();mn(e);let n={context:e,unmount:()=>Ae(e),[Tn]:1};return n[Tn]=1,n}finally{Qn()}},co=t=>O(t)?Tn in t:!1;var Cn={collectRefObj:!0,mount:({parseResult:t})=>({update:({values:e})=>{let n=t.context,o=e[0];if(O(o))for(let r of Object.entries(o)){let s=r[0],a=r[1],i=n[s];i!==a&&(x(i)?i(a):n[s]=a)}}})};var te=(t,e)=>{Ve(e)?.onUnmounted.push(t)};var ne=(t,e,n,o=!0)=>{if(!x(t))throw B(3,"observe");n&&e(t());let s=t(void 0,void 0,0,e);return o&&te(s,!0),s};var Je=(t,e)=>{if(t===e)return()=>{};let n=ne(t,r=>e(r)),o=ne(e,r=>t(r));return e(t()),()=>{n(),o()}};var Qe=t=>!!t&&t[xt]===1;var De=t=>t?.[bt]===1;var pe=[],uo=t=>{pe.length!==0&&pe[pe.length-1]?.add(t)},Ue=t=>{if(!t)return()=>{};let e={stop:()=>{}};return ns(t,e),te(()=>e.stop(),!0),e.stop},ns=(t,e)=>{if(!t)return;let n=[],o=!1,r=()=>{for(let s of n)s();n=[],o=!0};e.stop=r;try{let s=new Set;if(pe.push(s),t(a=>n.push(a)),o)return;for(let a of[...s]){let i=ne(a,()=>{r(),Ue(t)});n.push(i)}}finally{pe.pop()}},Mt=t=>{let e=pe.length,n=e>0&&pe[e-1];try{return n&&pe.push(null),t()}finally{n&&pe.pop()}},Lt=t=>{try{let e=new Set;return pe.push(e),{value:t(),refs:[...e]}}finally{pe.pop()}};var J=(t,e,n)=>{if(!x(t))return;let o=t;if(o(void 0,e,1),!n)return;let r=o();if(r){if(R(r)||ce(r))for(let s of r)J(s,e,!0);else if(Se(r))for(let s of r)J(s[0],e,!0),J(s[1],e,!0);if(O(r))for(let s in r)J(r[s],e,!0)}};function os(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}var Xe=(t,e,n)=>{n.forEach(function(o){let r=t[o];os(e,o,function(...a){let i=r.apply(this,a),c=this[X];for(let l of c)J(l);return i})})},Vt=(t,e)=>{Object.defineProperty(t,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})};var lo=Array.prototype,En=Object.create(lo),rs=["push","pop","shift","unshift","splice","sort","reverse"];Xe(lo,En,rs);var fo=Map.prototype,It=Object.create(fo),ss=["set","clear","delete"];Vt(It,"Map");Xe(fo,It,ss);var po=Set.prototype,Pt=Object.create(po),is=["add","clear","delete"];Vt(Pt,"Set");Xe(po,Pt,is);var ge={},oe=t=>{if(x(t)||Qe(t))return t;let e={auto:!0,_value:t},n=c=>O(c)?X in c?!0:R(c)?(Object.setPrototypeOf(c,En),!0):ce(c)?(Object.setPrototypeOf(c,Pt),!0):Se(c)?(Object.setPrototypeOf(c,It),!0):!1:!1,o=n(t),r=new Set,s=(c,l)=>{if(ge.stack&&ge.stack.length){ge.stack[ge.stack.length-1].add(i);return}r.size!==0&&Mt(()=>{for(let u of[...r.keys()])r.has(u)&&u(c,l)})},a=c=>{let l=c[X];l||(c[X]=l=new Set),l.add(i)},i=(...c)=>{if(!(2 in c)){let u=c[0],f=c[1];return 0 in c?e._value===u||x(u)&&(u=u(),e._value===u)?u:(n(u)&&a(u),e._value=u,e.auto&&s(u,f),e._value):(uo(i),e._value)}switch(c[2]){case 0:{let u=c[3];if(!u)return()=>{};let f=p=>{r.delete(p)};return r.add(u),()=>{f(u)}}case 1:{let u=c[1],f=e._value;s(f,u);break}case 2:return r.size;case 3:{e.auto=!1;break}case 4:e.auto=!0}return e._value};return i[X]=1,Me(i,!1),o&&a(t),i};var be=t=>{if(Qe(t))return t;let e;if(x(t)?(e=t,t=e()):e=oe(t),t instanceof Node||t instanceof Date||t instanceof RegExp||t instanceof Promise||t instanceof Error)return e;if(e[bt]=1,R(t)){let n=t.length;for(let o=0;o<n;++o){let r=t[o];De(r)||(t[o]=be(r))}return e}if(!O(t))return e;for(let n of Object.entries(t)){let o=n[1];if(De(o))continue;let r=n[0];ot(r)||(t[r]=null,t[r]=be(o))}return e};var mo=Symbol("modelBridge"),Dt=()=>{},as=t=>!!t?.[mo],cs=t=>{t[mo]=1},us=t=>{let e=be(t());return cs(e),e},ho={collectRefObj:!0,mount:({parseResult:t,option:e})=>{if(typeof e!="string"||!e)return Dt;let n=j(e),o,r,s=Dt,a=()=>{s(),s=Dt,o=void 0,r=void 0},i=()=>{s(),s=Dt},c=(u,f)=>{o!==u&&(i(),s=Je(u,f),o=u)},l=()=>{let u=t.refs[0]??t.value()[0],f=t.context,p=f[n];if(!x(u)){if(r&&p===r){r(u);return}if(a(),x(p)){p(u);return}f[n]=u;return}if(as(u)){if(p===u)return;x(p)?c(u,p):f[n]=u;return}r||(r=us(u)),f[n]=r,c(u,r)};return{update:()=>{l()},unmount:()=>{s()}}}};var Ut=class{r;xe;Te="";Re=-1;constructor(e){this.r=e,this.xe=e.o.p.inherit}k(e){this.rt(e)}st(e){if(this.Re!==e.size){let n=[...e.keys()];this.Te=[...n,...n.map(We)].join(","),this.Re=e.size}return this.Te}it(e){for(let n=0;n<e.length;++n){let o=e[n]?.components;if(o)for(let r in o)return!0}return!1}at(e){if(!fe(e))return!1;let n=e.getAttributeNames();return e.hasAttribute("name")?!0:n.some(o=>o.startsWith("#"))}ct(e){return fe(e)&&e.getAttributeNames().length===0}rt(e){let n=this.r,o=n.m,r=n.o.Z,s=n.o._;if(r.size===0&&!this.it(o.l))return;let a=o.ee(),i=this.Ee();if($(i))return;let c=this.pt(e,i);for(let l of c){if(l.hasAttribute(n.R))continue;let u=l.parentNode;if(!u)continue;let f=l.nextSibling,p=j(l.tagName).toUpperCase(),m=a[p]??s.get(p);if(!m)continue;let d=m.template;if(!d)continue;let y=l.parentElement;if(!y)continue;let C=new Comment(" begin component: "+l.tagName),v=new Comment(" end component: "+l.tagName);y.insertBefore(C,l),l.remove();let F=n.o.p.context,W=n.o.p.contextAlias,P=n.o.p.bind,Q=m.props?.map(j)??[],se=(b,M)=>{let E={},T=b.hasAttribute(F);return o.E(M,()=>{if(o.v(E),T?n.y(Cn,b,F):b.hasAttribute(W)&&n.y(Cn,b,W),Q.length===0)return;let V=new Map(Q.map(A=>[A.toLowerCase(),A]));for(let A of[...Q,...Q.map(We)]){let ae=b.getAttribute(A);ae!==null&&(E[j(A)]=ae,b.removeAttribute(A))}let w=n.F.Ce(b,!1);for(let[A,ae]of w.entries()){let[xe,N]=ae.te;if(!N)continue;let ee=V.get(j(N).toLowerCase());ee&&(xe!=="."&&xe!==":"&&xe!==P||n.y(ho,b,A,!0,ee,ae.ne))}}),E},S=[...o.L()],me=()=>{let b=se(l,S),M=new qe(b,l,S,C,v,n.o.propValidationMode),E=kt(()=>m.context(M)??{}).context;if(M.autoProps){for(let[T,V]of Object.entries(b))if(T in E){let w=E[T];if(w===V)continue;if(x(w)){x(V)?M.entangle?_(C,Je(V,w)):w(V()):w(V);continue}}else E[T]=V;for(let T of Q)T in E||(E[T]=void 0);M.onAutoPropsAssigned?.()}return{componentCtx:E,head:M}},{componentCtx:g,head:k}=me(),H=[...Ee(d)],$e=H.length,nt=l.childNodes.length===0,pt=b=>{let M=b.parentElement,E=b.name;if($(E)&&(E=b.getAttributeNames().filter(w=>w.startsWith("#"))[0],$(E)?E="default":E=E.substring(1)),nt){if(E==="default"){let w=n.o.p.text,A=l.getAttribute(w);if(!$(A)){let ae=document.createElement("span");ae.setAttribute(w,A),M.insertBefore(ae,b),l.removeAttribute(w);return}}for(let w of[...b.childNodes])M.insertBefore(w,b);return}let T=l.querySelector(`template[name='${E}'], template[\\#${E}]`);!T&&E==="default"&&(T=[...l.querySelectorAll("template:not([name])")].find(A=>this.ct(A))??null);let V=w=>{k.enableSwitch&&o.E(S,()=>{o.v(g);let A=se(b,o.L());o.E(S,()=>{o.v(A);let ae=o.L(),xe=to(ae);for(let N of w)Te(N)&&(N.setAttribute(it,xe),dn(xe),_(N,()=>{hn(xe)}))})})};if(T){let w=[...Ee(T)];for(let A of w)M.insertBefore(A,b);V(w)}else{if(E!=="default"){for(let A of[...Ee(b)])M.insertBefore(A,b);return}let w=[...Ee(l)].filter(A=>!this.at(A));for(let A of w)M.insertBefore(A,b);V(w)}},I=b=>{if(!Te(b))return;let M=b.querySelectorAll("slot");if(so(b)){pt(b),b.remove();return}for(let E of M)pt(E),E.remove()};(()=>{for(let b=0;b<$e;++b)H[b]=H[b].cloneNode(!0),u.insertBefore(H[b],f),I(H[b])})(),y.insertBefore(v,f);let G=()=>{if(!m.inheritAttrs)return;let b=H.filter(E=>E.nodeType===Node.ELEMENT_NODE);b.length>1&&(b=b.filter(E=>E.hasAttribute(this.xe)));let M=b[0];if(M)for(let E of l.getAttributeNames()){if(E===F||E===W)continue;let T=l.getAttribute(E);if(E==="class"){let V=Ge(T);V.length>0&&M.classList.add(...V)}else if(E==="style"){let V=M.style,w=l.style;for(let A of w)V.setProperty(A,w.getPropertyValue(A))}else M.setAttribute(At(E,n.o),T)}},Y=()=>{for(let b of l.getAttributeNames())!b.startsWith("@")&&!b.startsWith(n.o.p.on)&&l.removeAttribute(b)},Z=()=>{G(),Y(),o.v(g),n.ve(l,!1),g.$emit=k.emit,ke(n,H),_(l,()=>{Ae(g)}),_(C,()=>{de(l)}),Ot(g)};o.E(S,Z)}}Ee(){let e=this.r,n=e.m,o=e.o.Z,r=n.ut(),s=this.st(o);return[...s?[s]:[],...r,...r.map(We)].join(",")}pt(e,n){let o=[];if($(n))return o;if(e.matches?.(n))return[e];let r=this.q(e).reverse();for(;r.length>0;){let s=r.pop();if(s.matches(n)){o.push(s);continue}r.push(...this.q(s).reverse())}return o}j(e,n){let o=this.Ee(),r=this.q(e).reverse();for(;r.length>0;){let s=r.pop();n(s),!(!$(o)&&s.matches(o))&&r.push(...this.q(s).reverse())}}q(e){let n=e?.children;if(n?.length!=null){let r=[];for(let s=0;s<n.length;++s){let a=n[s];Te(a)&&r.push(a)}return r}let o=e?.childNodes;if(o?.length!=null){let r=[];for(let s=0;s<o.length;++s){let a=o[s];Te(a)&&r.push(a)}return r}return[]}};var Rn=class{te;ne;we=[];constructor(e,n){this.te=e,this.ne=n}},Ht=class{r;Se;Ae;oe;constructor(e){this.r=e,this.Se=e.o.lt(),this.oe=new Map;let n=new Map;for(let o of this.Se){let r=o[0]??"",s=n.get(r);s?s.push(o):n.set(r,[o])}this.Ae=n}ke(e){let n=this.oe.get(e);if(n)return n;let o=e,r=o.startsWith(".");r&&(o=":"+o.slice(1));let s=o.indexOf("."),i=(s<0?o:o.substring(0,s)).split(/[:@]/);$(i[0])&&(i[0]=r?".":o[0]);let c=s>=0?o.slice(s+1).split("."):[],l=!1,u=!1;for(let p=0;p<c.length;++p){let h=c[p];if(!l&&h==="camel"?l=!0:!u&&h==="prop"&&(u=!0),l&&u)break}l&&(i[i.length-1]=j(i[i.length-1])),u&&(i[0]=".");let f={terms:i,flags:c};return this.oe.set(e,f),f}Ce(e,n){let o=new Map;if(!at(e))return o;let r=this.Ae,s=(i,c)=>{let l=r.get(c[0]??"");if(l)for(let u=0;u<l.length;++u){if(!c.startsWith(l[u]))continue;let f=o.get(c);if(!f){let p=this.ke(c);f=new Rn(p.terms,p.flags),o.set(c,f)}f.we.push(i);return}},a=i=>{let c=i.attributes;if(!(!c||c.length===0))for(let l=0;l<c.length;++l){let u=c.item(l)?.name;u&&s(i,u)}};return a(e),!n||!e.firstElementChild||this.r.N.j(e,a),o}};var yo=()=>{},ls=(t,e)=>{for(let n of t){let o=n.cloneNode(!0);e.appendChild(o)}},Bt=class{r;I;constructor(e){this.r=e,this.I=e.o.p.is}k(e){let n=e.hasAttribute(this.I);return(n||e.hasAttribute("is"))&&this.y(e),this.r.N.j(e,o=>{(o.hasAttribute(this.I)||o.hasAttribute("is"))&&this.y(o)}),n}y(e){let n=e.getAttribute(this.I);if(!n){if(n=e.getAttribute("is"),!n)return;if(!n.startsWith("regor:")){if(!n.startsWith("r-"))return;let o=n.slice(2).trim().toLowerCase();if(!o)return;let r=e.parentNode;if(!r)return;let s=document.createElement(o);for(let a of e.getAttributeNames())a!=="is"&&s.setAttribute(a,e.getAttribute(a));for(;e.firstChild;)s.appendChild(e.firstChild);r.insertBefore(s,e),e.remove(),this.r.$(s);return}n=`'${n.slice(6)}'`,e.removeAttribute("is")}e.removeAttribute(this.I),this.O(e,n)}U(e,n){let o=Ke(e),r=e.parentNode,s=document.createComment(`__begin__ dynamic ${n??""}`);r.insertBefore(s,e),ze(s,o),o.forEach(i=>{q(i)}),e.remove();let a=document.createComment(`__end__ dynamic ${n??""}`);return r.insertBefore(a,s.nextSibling),{nodes:o,parent:r,commentBegin:s,commentEnd:a}}O(e,n){let{nodes:o,parent:r,commentBegin:s,commentEnd:a}=this.U(e,` => ${n} `),i=this.r.m.M(n),c=i.value,l=this.r.m,u=l.L(),f={name:""},p=fe(e)?o:[...o[0].childNodes],h=()=>{l.E(u,()=>{let y=c()[0];if(O(y)&&(y.name?y=y.name:y=Object.entries(l.ee()).filter(v=>v[1]===y)[0]?.[0]),!K(y)||$(y)){Ce(s,a);return}if(f.name===y)return;Ce(s,a);let C=document.createElement(y);for(let v of e.getAttributeNames())v!==this.I&&C.setAttribute(v,e.getAttribute(v));ls(p,C),r.insertBefore(C,a),this.r.$(C),f.name=y})},m=yo;_(s,()=>{i.stop(),m(),m=yo}),h(),m=i.subscribe(h)}};var U=t=>{let e=t;return e!=null&&e[X]===1?e():e};var fs=(t,e)=>{let[n,o]=e;z(o)?o(t,n):t.innerHTML=n?.toString()},jt={mount:()=>({update:({el:t,values:e})=>{fs(t,e)}})};var $t=class t{re;constructor(e){this.re=e}static ft(e,n){let o=e.m,r=e.o,s=r.p,a=new Set([s.for,s.if,s.else,s.elseif,s.pre]),i=r.B,c=o.ee();if(Object.keys(c).length>0||r._.size>0)return;let l=e.F,u=[],f=0,p=[];for(let h=n.length-1;h>=0;--h)p.push(n[h]);for(;p.length>0;){let h=p.pop();if(h.nodeType===Node.ELEMENT_NODE){let d=h;if(d.tagName==="TEMPLATE"||d.tagName.includes("-"))return;let y=j(d.tagName).toUpperCase();if(r._.has(y)||c[y])return;let C=d.attributes;for(let v=0;v<C.length;++v){let F=C.item(v)?.name;if(!F)continue;if(a.has(F))return;let{terms:W,flags:P}=l.ke(F),[Q,se]=W,S=i[F]??i[Q];if(S){if(S===jt)return;u.push({nodeIndex:f,attrName:F,directive:S,option:se,flags:P})}}++f}let m=h.childNodes;for(let d=m.length-1;d>=0;--d)p.push(m[d])}if(u.length!==0)return new t(u)}y(e,n){let o=[],r=[];for(let s=n.length-1;s>=0;--s)r.push(n[s]);for(;r.length>0;){let s=r.pop();s.nodeType===Node.ELEMENT_NODE&&o.push(s);let a=s.childNodes;for(let i=a.length-1;i>=0;--i)r.push(a[i])}for(let s=0;s<this.re.length;++s){let a=this.re[s],i=o[a.nodeIndex];i&&e.y(a.directive,i,a.attrName,!1,a.option,a.flags)}}};var ps=(t,e)=>{let n=e.parentNode;if(n)for(let o=0;o<t.items.length;++o)n.insertBefore(t.items[o],e)},ms=t=>{let e=t.length,n=t.slice(),o=[],r,s,a;for(let i=0;i<e;++i){let c=t[i];if(c===0)continue;let l=o[o.length-1];if(l===void 0||t[l]<c){n[i]=l??-1,o.push(i);continue}for(r=0,s=o.length-1;r<s;)a=r+s>>1,t[o[a]]<c?r=a+1:s=a;c<t[o[r]]&&(r>0&&(n[i]=o[r-1]),o[r]=i)}for(r=o.length,s=o[r-1]??-1;r-- >0;)o[r]=s,s=n[s];return o},_t=class{static dt(e){let{oldItems:n,newValues:o,getKey:r,isSameValue:s,mountNewValue:a,removeMountItem:i,endAnchor:c}=e,l=n.length,u=o.length,f=new Array(u),p=new Set;for(let g=0;g<u;++g){let k=r(o[g]);if(k===void 0||p.has(k))return;p.add(k),f[g]=k}let h=new Array(u),m=0,d=l-1,y=u-1;for(;m<=d&&m<=y;){let g=n[m];if(r(g.value)!==f[m]||!s(g.value,o[m]))break;g.value=o[m],h[m]=g,++m}for(;m<=d&&m<=y;){let g=n[d];if(r(g.value)!==f[y]||!s(g.value,o[y]))break;g.value=o[y],h[y]=g,--d,--y}if(m>d){for(let g=y;g>=m;--g){let k=g+1<u?h[g+1].items[0]:c;h[g]=a(g,o[g],k)}return h}if(m>y){for(let g=m;g<=d;++g)i(n[g]);return h}let C=m,v=m,F=y-v+1,W=new Array(F).fill(0),P=new Map;for(let g=v;g<=y;++g)P.set(f[g],g);let Q=!1,se=0;for(let g=C;g<=d;++g){let k=n[g],H=P.get(r(k.value));if(H===void 0){i(k);continue}if(!s(k.value,o[H])){i(k);continue}k.value=o[H],h[H]=k,W[H-v]=g+1,H>=se?se=H:Q=!0}let S=Q?ms(W):[],me=S.length-1;for(let g=F-1;g>=0;--g){let k=v+g,H=k+1<u?h[k+1].items[0]:c;if(W[g]===0){h[k]=a(k,o[k],H);continue}let $e=h[k];Q&&(me>=0&&S[me]===g?--me:$e&&ps($e,H))}return h}};var ut=class{T=[];P=new Map;get w(){return this.T.length}se;constructor(e){this.se=e}ie(e){let n=this.se(e.value);n!==void 0&&this.P.set(n,e)}ae(e){let n=this.se(this.T[e]?.value);n!==void 0&&this.P.delete(n)}static mt(e,n){return{items:[],index:e,value:n,order:-1}}v(e){e.order=this.w,this.T.push(e),this.ie(e)}yt(e,n){let o=this.w;for(let r=e;r<o;++r)this.T[r].order=r+1;n.order=e,this.T.splice(e,0,n),this.ie(n)}D(e){return this.T[e]}ce(e,n){this.ae(e),this.T[e]=n,this.ie(n),n.order=e}Ve(e){this.ae(e),this.T.splice(e,1);let n=this.w;for(let o=e;o<n;++o)this.T[o].order=o}Ne(e){let n=this.w;for(let o=e;o<n;++o)this.ae(o);this.T.splice(e)}en(e){return this.P.has(e)}ht(e){return this.P.get(e)?.order??-1}};var vn=Symbol("r-for"),ds=t=>-1,go=()=>{},Ft=class t{r;x;Oe;R;constructor(e){this.r=e,this.x=e.o.p.for,this.Oe=St(this.x),this.R=e.o.p.pre}k(e){let n=e.hasAttribute(this.x);return n&&this.Me(e),this.r.N.j(e,o=>{o.hasAttribute(this.x)&&this.Me(o)}),n}Y(e){return e[vn]?!0:(e[vn]=!0,wt(e,this.Oe).forEach(n=>n[vn]=!0),!1)}Me(e){if(e.hasAttribute(this.R)||this.Y(e))return;let n=e.getAttribute(this.x);if(!n){D(0,this.x,e);return}e.removeAttribute(this.x),this.gt(e,n)}Le(e){return le(e)?[]:(z(e)&&(e=e()),Symbol.iterator in Object(e)?e:typeof e=="number"?(o=>({*[Symbol.iterator](){for(let r=1;r<=o;r++)yield r}}))(e):Object.entries(e))}gt(e,n){let o=this.bt(n);if(!o?.list){D(1,this.x,n,e);return}let r=this.r.o.p.key,s=this.r.o.p.keyBind,a=e.getAttribute(r)??e.getAttribute(s);e.removeAttribute(r),e.removeAttribute(s);let i=Ke(e),c=$t.ft(this.r,i),l=e.parentNode;if(!l)return;let u=`${this.x} => ${n}`,f=new Comment(`__begin__ ${u}`);l.insertBefore(f,e),ze(f,i),i.forEach(L=>{q(L)}),e.remove();let p=new Comment(`__end__ ${u}`);l.insertBefore(p,f.nextSibling);let h=this.r,m=h.m,d=m.L(),C=d.length===1?[void 0,d[0]]:void 0,v=this.xt(a),F=(L,G)=>v(L)===v(G),W=(L,G)=>L===G,P=(L,G,Y)=>{let Z=o.createContext(G,L),b=ut.mt(Z.index,G),M=()=>{let E=p.parentNode??f.parentNode??l,T=Y.previousSibling,V=[];for(let w=0;w<i.length;++w){let A=i[w].cloneNode(!0);E.insertBefore(A,Y),V.push(A)}for(c?c.y(h,V):ke(h,V),T=T.nextSibling;T!==Y;)b.items.push(T),T=T.nextSibling};return C?(C[0]=Z.ctx,m.E(C,M)):m.E(d,()=>{m.v(Z.ctx),M()}),b},Q=(L,G)=>{let Y=I.D(L).items,Z=Y[Y.length-1].nextSibling;for(let b of Y)q(b);I.ce(L,P(L,G,Z))},se=(L,G)=>{I.v(P(L,G,p))},S=L=>{for(let G of I.D(L).items)q(G)},me=L=>{let G=I.w;for(let Y=L;Y<G;++Y)I.D(Y).index(Y)},g=L=>{let G=f.parentNode,Y=p.parentNode;if(!G||!Y)return;let Z=I.w;z(L)&&(L=L());let b=U(L[0]);if(R(b)&&b.length===0){Ce(f,p),I.Ne(0);return}let M=[];for(let N of this.Le(L[0]))M.push(N);let E=_t.dt({oldItems:I.T,newValues:M,getKey:v,isSameValue:W,mountNewValue:(N,ee,Le)=>P(N,ee,Le),removeMountItem:N=>{for(let ee=0;ee<N.items.length;++ee)q(N.items[ee])},endAnchor:p});if(E){I.T=E,I.P.clear();for(let N=0;N<E.length;++N){let ee=E[N];ee.order=N,ee.index(N);let Le=v(ee.value);Le!==void 0&&I.P.set(Le,ee)}return}let T=0,V=Number.MAX_SAFE_INTEGER,w=Z,A=this.r.o.forGrowThreshold,ae=()=>I.w<w+A;for(let N of M){let ee=()=>{if(T<Z){let Le=I.D(T++);if(F(Le.value,N)){if(W(Le.value,N))return;Q(T-1,N);return}let mt=I.ht(v(N));if(mt>=T&&mt-T<10){if(--T,V=Math.min(V,T),S(T),I.Ve(T),--Z,mt>T+1)for(let cn=T;cn<mt-1&&cn<Z&&!F(I.D(T).value,N);)++cn,S(T),I.Ve(T),--Z;ee();return}ae()?(I.yt(T-1,P(T,N,I.D(T-1).items[0])),V=Math.min(V,T-1),++Z):Q(T-1,N)}else se(T++,N)};ee()}let xe=T;for(Z=I.w;T<Z;)S(T++);I.Ne(xe),me(V)},k=()=>{H.stop(),nt(),nt=go},H=m.M(o.list),$e=H.value,nt=go,pt=0,I=new ut(v);for(let L of this.Le($e()[0]))I.v(P(pt++,L,p));_(f,k),nt=H.subscribe(g)}static Tt=/\{?\[?\(?([^)}\]]+)\)?\]?\}?([^)]+)?\s+\b(?:in|of)\b\s+(.*)\s*$/;bt(e){let n=t.Tt.exec(e);if(!n)return;let o=(n[1]+(n[2]??"")).split(",").map(c=>c.trim()),r=o.length>1?o.length-1:-1,s=r!==-1&&(o[r]==="index"||o[r]?.startsWith("#"))?o[r]:"";s&&o.splice(r,1);let a=n[3];if(!a||o.length===0)return;let i=/[{[]/.test(e);return{list:a,createContext:(c,l)=>{let u={},f=U(c);if(!i&&o.length===1)u[o[0]]=c;else if(R(f)){let h=0;for(let m of o)u[m]=f[h++]}else for(let h of o)u[h]=f[h];let p={ctx:u,index:ds};return s&&(p.index=u[s.startsWith("#")?s.substring(1):s]=oe(l)),p}}}xt(e){if(!e)return o=>o;let n=e.trim();if(!n)return o=>o;if(n.includes(".")){let o=this.Rt(n),r=o.length>1?o.slice(1):void 0;return s=>{let a=U(s),i=this.Ie(a,o);return i!==void 0||!r?i:this.Ie(a,r)}}return o=>U(U(o)?.[n])}Rt(e){return e.split(".").filter(n=>n.length>0)}Ie(e,n){let o=e;for(let r of n)o=U(o)?.[r];return U(o)}};var qt=class{pe=0;ue=new Map;m;Pe;De;Ue;N;F;o;R;Be;constructor(e){this.m=e,this.o=e.o,this.De=new Ft(this),this.Pe=new vt(this),this.Ue=new Bt(this),this.N=new Ut(this),this.F=new Ht(this),this.R=this.o.p.pre,this.Be=this.o.p.dynamic}Et(e){let n=fe(e)?[e]:e.querySelectorAll("template");for(let o of n){if(o.hasAttribute(this.R))continue;let r=o.parentNode;if(!r)continue;let s=o.nextSibling;if(o.remove(),!o.content)continue;let a=[...o.content.childNodes];for(let i of a)r.insertBefore(i,s);ke(this,a)}}$(e){++this.pe;try{if(e.nodeType!==Node.ELEMENT_NODE||e.hasAttribute(this.R)||this.Pe.k(e)||this.De.k(e)||this.Ue.k(e))return;this.N.k(e),this.Et(e),this.ve(e,!0)}finally{--this.pe,this.pe===0&&this.Ct()}}vt(e,n){let o=document;if(!o){let r=e.parentNode;for(;r?.parentNode;)r=r.parentNode;if(!r)return null;o=r}return o.querySelector(n)}He(e,n){let o=this.vt(e,n);if(!o)return!1;let r=e.parentElement;if(!r)return!1;let s=new Comment(`teleported => '${n}'`);return r.insertBefore(s,e),e.teleportedFrom=s,s.teleportedTo=e,_(s,()=>{q(e)}),o.appendChild(e),!0}wt(e,n){this.ue.set(e,n)}Ct(){let e=this.ue;if(e.size!==0){this.ue=new Map;for(let[n,o]of e.entries())this.He(n,o)}}ve(e,n){let o=this.F.Ce(e,n),r=this.o.B;for(let[s,a]of o.entries()){let[i,c]=a.te,l=r[s]??r[i];if(!l){console.error("directive not found:",i);continue}let u=a.we;for(let f=0;f<u.length;++f){let p=u[f];this.y(l,p,s,!1,c,a.ne)}}}y(e,n,o,r,s,a){if(n.hasAttribute(this.R))return;let i=n.getAttribute(o);n.removeAttribute(o);let c=l=>{let u=l;for(;u;){let f=u.getAttribute(it);if(f)return f;u=u.parentElement}return null};if(yn()){let l=c(n);if(l){this.m.E(no(l),()=>{this.O(e,n,i,s,a)});return}}this.O(e,n,i,s,a)}St(e,n,o){return e!==Nt?!1:($(o)||this.He(n,o)||this.wt(n,o),!0)}O(e,n,o,r,s){if(n.nodeType!==Node.ELEMENT_NODE||o==null||this.St(e,n,o))return;let a=this.At(r,e.once),i=this.kt(e,o),c=this.Vt(i,a);_(n,c.stop);let l=this.Nt(n,o,i,a,r,s),u=this.Ot(e,l,c);if(!u)return;let f=this.Mt(l,i,a,r,u);f(),e.once||(c.result=i.subscribe(f),a&&(c.dynamic=a.subscribe(f)))}At(e,n){let o=ao(e,this.Be);if(o)return this.m.M(j(o),void 0,void 0,void 0,n)}kt(e,n){return this.m.M(n,e.isLazy,e.isLazyKey,e.collectRefObj,e.once)}Vt(e,n){let o={stop:()=>{e.stop(),n?.stop(),o.result?.(),o.dynamic?.(),o.mounted?.(),o.result=void 0,o.dynamic=void 0,o.mounted=void 0}};return o}Nt(e,n,o,r,s,a){return{el:e,expr:n,values:o.value(),previousValues:void 0,option:r?r.value()[0]:s,previousOption:void 0,flags:a,parseResult:o,dynamicOption:r}}Ot(e,n,o){let r=e.mount(n);if(typeof r=="function"){o.mounted=r;return}return r?.unmount&&(o.mounted=r.unmount),r?.update}Mt(e,n,o,r,s){let a,i;return()=>{let c=n.value(),l=o?o.value()[0]:r;e.values=c,e.previousValues=a,e.option=l,e.previousOption=i,a=c,i=l,s(e)}}};var bo="http://www.w3.org/1999/xlink",hs={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 ys(t){return!!t||t===""}var gs=(t,e,n,o,r,s)=>{if(o){s&&s.includes("camel")&&(o=j(o)),zt(t,o,e[0],r);return}let a=e.length;for(let i=0;i<a;++i){let c=e[i];if(R(c)){let l=n?.[i]?.[0],u=c[0],f=c[1];zt(t,u,f,l)}else if(O(c))for(let l of Object.entries(c)){let u=l[0],f=l[1],p=n?.[i],h=p&&u in p?u:void 0;zt(t,u,f,h)}else{let l=n?.[i],u=e[i++],f=e[i];zt(t,u,f,l)}}},wn={mount:()=>({update:({el:t,values:e,previousValues:n,option:o,previousOption:r,flags:s})=>{gs(t,e,n,o,r,s)}})},zt=(t,e,n,o)=>{if(o&&o!==e&&t.removeAttribute(o),le(e)){D(3,"r-bind",t);return}if(!K(e)){D(6,`Attribute key is not string at ${t.outerHTML}`,e);return}if(e.startsWith("xlink:")){le(n)?t.removeAttributeNS(bo,e.slice(6,e.length)):t.setAttributeNS(bo,e,n);return}let r=e in hs;le(n)||r&&!ys(n)?t.removeAttribute(e):t.setAttribute(e,r?"":n)};var bs=(t,e,n)=>{let o=e.length;for(let r=0;r<o;++r){let s=e[r],a=n?.[r];if(R(s)){let i=s.length;for(let c=0;c<i;++c)xo(t,s[c],a?.[c])}else xo(t,s,a)}},Sn={mount:()=>({update:({el:t,values:e,previousValues:n})=>{bs(t,e,n)}})},xo=(t,e,n)=>{let o=t.classList,r=K(e),s=K(n);if(e&&!r){if(n&&!s)for(let a in n)(!(a in e)||!e[a])&&o.remove(a);for(let a in e)e[a]&&o.add(a)}else if(r){if(n!==e){let a=s?Ge(n):[],i=Ge(e);a.length>0&&o.remove(...a),i.length>0&&o.add(...i)}}else if(n){let a=s?Ge(n):[];a.length>0&&o.remove(...a)}};function xs(t,e){if(t.length!==e.length)return!1;let n=!0;for(let o=0;n&&o<t.length;o++)n=Re(t[o],e[o]);return n}function Re(t,e){if(t===e)return!0;let n=fn(t),o=fn(e);if(n||o)return n&&o?t.getTime()===e.getTime():!1;if(n=ot(t),o=ot(e),n||o)return t===e;if(n=R(t),o=R(e),n||o)return n&&o?xs(t,e):!1;if(n=O(t),o=O(e),n||o){if(!n||!o)return!1;let r=Object.keys(t).length,s=Object.keys(e).length;if(r!==s)return!1;for(let a in t){let i=Object.prototype.hasOwnProperty.call(t,a),c=Object.prototype.hasOwnProperty.call(e,a);if(i&&!c||!Re(t[a],e[a]))return!1}return!0}return String(t)===String(e)}function Kt(t,e){return t.findIndex(n=>Re(n,e))}var To=t=>{let e=parseFloat(t);return isNaN(e)?t:e};var Wt=t=>{if(!x(t))throw B(3,"pause");t(void 0,void 0,3)};var Gt=t=>{if(!x(t))throw B(3,"resume");t(void 0,void 0,4)};var Eo={mount:({el:t,parseResult:e,flags:n})=>({update:({values:o})=>{Ts(t,o[0])},unmount:Cs(t,e,n)})},Ts=(t,e)=>{let n=So(t);if(n&&Ro(t))R(e)?e=Kt(e,ve(t))>-1:ce(e)?e=e.has(ve(t)):e=As(t,e),t.checked=e;else if(n&&vo(t))t.checked=Re(e,ve(t));else if(n||Ao(t))wo(t)?t.value!==e?.toString()&&(t.value=e):t.value!==e&&(t.value=e);else if(No(t)){let o=t.options,r=o.length,s=t.multiple;for(let a=0;a<r;a++){let i=o[a],c=ve(i);if(s)R(e)?i.selected=Kt(e,c)>-1:i.selected=e.has(c);else if(Re(ve(i),e)){t.selectedIndex!==a&&(t.selectedIndex=a);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}else D(7,t)},lt=t=>(x(t)&&(t=t()),z(t)&&(t=t()),t?K(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}),Ro=t=>t.type==="checkbox",vo=t=>t.type==="radio",wo=t=>t.type==="number"||t.type==="range",So=t=>t.tagName==="INPUT",Ao=t=>t.tagName==="TEXTAREA",No=t=>t.tagName==="SELECT",Cs=(t,e,n)=>{let o=e.value,r=lt(n?.join(",")),s=lt(o()[1]),a={int:r.int||s.int,lazy:r.lazy||s.lazy,number:r.number||s.number,trim:r.trim||s.trim};if(!e.refs[0])return D(8,t),()=>{};let i=()=>e.refs[0],c=So(t);return c&&Ro(t)?Rs(t,i):c&&vo(t)?Ns(t,i):c||Ao(t)?Es(t,a,i,o):No(t)?Os(t,i,o):(D(7,t),()=>{})},Co=/[.,' ·٫]/,Es=(t,e,n,o)=>{let s=e.lazy?"change":"input",a=wo(t),i=()=>{!e.trim&&!lt(o()[1]).trim||(t.value=t.value.trim())},c=p=>{let h=p.target;h.composing=1},l=p=>{let h=p.target;h.composing&&(h.composing=0,h.dispatchEvent(new Event(s)))},u=()=>{t.removeEventListener(s,f),t.removeEventListener("change",i),t.removeEventListener("compositionstart",c),t.removeEventListener("compositionend",l),t.removeEventListener("change",l)},f=p=>{let h=n();if(!h)return;let m=p.target;if(!m||m.composing)return;let d=m.value,y=lt(o()[1]);if(a||y.number||y.int){if(y.int)d=parseInt(d);else{if(Co.test(d[d.length-1])&&d.split(Co).length===2){if(d+="0",d=parseFloat(d),isNaN(d))d="";else if(h()===d)return}d=parseFloat(d)}isNaN(d)&&(d=""),t.value=d}else y.trim&&(d=d.trim());h(d)};return t.addEventListener(s,f),t.addEventListener("change",i),t.addEventListener("compositionstart",c),t.addEventListener("compositionend",l),t.addEventListener("change",l),u},Rs=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let a=ve(t),i=t.checked,c=s();if(R(c)){let l=Kt(c,a),u=l!==-1;i&&!u?c.push(a):!i&&u&&c.splice(l,1)}else ce(c)?i?c.add(a):c.delete(a):s(Ss(t,i))};return t.addEventListener(n,r),o},ve=t=>"_value"in t?t._value:t.value,Oo="trueValue",vs="falseValue",ko="true-value",ws="false-value",Ss=(t,e)=>{let n=e?Oo:vs;if(n in t)return t[n];let o=e?ko:ws;return t.hasAttribute(o)?t.getAttribute(o):e},As=(t,e)=>{if(Oo in t)return Re(e,t.trueValue);let o=ko;return t.hasAttribute(o)?Re(e,t.getAttribute(o)):Re(e,!0)},Ns=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let a=ve(t);s(a)};return t.addEventListener(n,r),o},Os=(t,e,n)=>{let o="change",r=()=>{t.removeEventListener(o,s)},s=()=>{let a=e();if(!a)return;let c=lt(n()[1]).number,l=Array.prototype.filter.call(t.options,u=>u.selected).map(u=>c?To(ve(u)):ve(u));if(t.multiple){let u=a();try{if(Wt(a),ce(u)){u.clear();for(let f of l)u.add(f)}else R(u)?(u.splice(0),u.push(...l)):a(l)}finally{Gt(a),J(a)}}else a(l[0])};return t.addEventListener(o,s),r};var ks=["stop","prevent","capture","self","once","left","right","middle","passive"],Ms=t=>{let e={};if($(t))return;let n=t.split(",");for(let o of ks)e[o]=n.includes(o);return e},Ls=(t,e,n,o,r)=>{if(o){let l=e.value(),u=U(o.value()[0]);return K(u)?An(t,j(u),()=>e.value()[0],r?.join(",")??l[1]):()=>{}}else if(n){let l=e.value();return An(t,j(n),()=>e.value()[0],r?.join(",")??l[1])}let s=[],a=()=>{s.forEach(l=>l())},i=e.value(),c=i.length;for(let l=0;l<c;++l){let u=i[l];if(z(u)&&(u=u()),O(u))for(let f of Object.entries(u)){let p=f[0],h=()=>{let d=e.value()[l];return z(d)&&(d=d()),d=d[p],z(d)&&(d=d()),d},m=u[p+"_flags"];s.push(An(t,p,h,m))}else D(2,"r-on",t)}return a},Nn={isLazy:(t,e)=>e===-1&&t%2===0,isLazyKey:(t,e)=>e===0&&!t.endsWith("_flags"),once:!1,collectRefObj:!0,mount:({el:t,parseResult:e,option:n,dynamicOption:o,flags:r})=>Ls(t,e,n,o,r)},Vs=(t,e)=>{if(t.startsWith("keydown")||t.startsWith("keyup")||t.startsWith("keypress")){e??="";let n=[...t.split("."),...e.split(",")];t=n[0];let o=n[1],r=n.includes("ctrl"),s=n.includes("shift"),a=n.includes("alt"),i=n.includes("meta"),c=l=>!(r&&!l.ctrlKey||s&&!l.shiftKey||a&&!l.altKey||i&&!l.metaKey);return o?[t,l=>c(l)?l.key.toUpperCase()===o.toUpperCase():!1]:[t,c]}return[t,n=>!0]},An=(t,e,n,o)=>{if($(e))return D(5,"r-on",t),()=>{};let r=Ms(o),s=r?{capture:r.capture,passive:r.passive,once:r.once}:void 0,a;[e,a]=Vs(e,o);let i=u=>{if(!a(u)||!n&&e==="submit"&&r?.prevent)return;let f=n(u);z(f)&&(f=f(u)),z(f)&&f(u)},c=()=>{t.removeEventListener(e,l,s)},l=u=>{if(!r){i(u);return}try{if(r.left&&u.button!==0||r.middle&&u.button!==1||r.right&&u.button!==2||r.self&&u.target!==t)return;r.stop&&u.stopPropagation(),r.prevent&&u.preventDefault(),i(u)}finally{r.once&&c()}};return t.addEventListener(e,l,s),c};var Is=(t,e,n,o)=>{if(n){o&&o.includes("camel")&&(n=j(n)),Ye(t,n,e[0]);return}let r=e.length;for(let s=0;s<r;++s){let a=e[s];if(R(a)){let i=a[0],c=a[1];Ye(t,i,c)}else if(O(a))for(let i of Object.entries(a)){let c=i[0],l=i[1];Ye(t,c,l)}else{let i=e[s++],c=e[s];Ye(t,i,c)}}},Mo={mount:()=>({update:({el:t,values:e,option:n,flags:o})=>{Is(t,e,n,o)}})};function Ps(t){return!!t||t===""}var Ye=(t,e,n)=>{if(le(e)){D(3,":prop",t);return}if(e==="innerHTML"||e==="textContent"){let s=[...t.childNodes];setTimeout(()=>s.forEach(de),1),t[e]=n??"";return}let o=t.tagName;if(e==="value"&&o!=="PROGRESS"&&!o.includes("-")){t._value=n;let s=o==="OPTION"?t.getAttribute("value"):t.value,a=n??"";s!==a&&(t.value=a),n==null&&t.removeAttribute(e);return}let r=!1;if(n===""||n==null){let s=typeof t[e];s==="boolean"?n=Ps(n):n==null&&s==="string"?(n="",r=!0):s==="number"&&(n=0,r=!0)}try{t[e]=n}catch(s){r||D(4,e,o,n,s)}r&&t.removeAttribute(e)};var Lo={once:!0,mount:({el:t,parseResult:e,expr:n})=>{let o=e,r=o.value()[0],s=R(r),a=o.refs[0];return s?r.push(t):a?a?.(t):o.context[n]=t,()=>{if(s){let i=r.indexOf(t);i!==-1&&r.splice(i,1)}else a?.(null)}}};var Ds=(t,e)=>{let n=Oe(t).data,o=n._ord;Wn(o)&&(o=n._ord=t.style.display),st(e[0])?t.style.display=o:t.style.display="none"},Vo={mount:()=>({update:({el:t,values:e})=>{Ds(t,e)}})};var Us=(t,e,n)=>{let o=e.length;for(let r=0;r<o;++r){let s=e[r],a=n?.[r];if(R(s)){let i=s.length;for(let c=0;c<i;++c)Io(t,s[c],a?.[c])}else Io(t,s,a)}},Jt={mount:()=>({update:({el:t,values:e,previousValues:n})=>{Us(t,e,n)}})},Io=(t,e,n)=>{let o=t.style,r=K(e);if(e&&!r){if(n&&!K(n))for(let s in n)e[s]==null&&kn(o,s,"");for(let s in e)kn(o,s,e[s])}else{let s=o.display;if(r?n!==e&&(o.cssText=e):n&&t.removeAttribute("style"),"_ord"in Oe(t).data)return;o.display=s}},Po=/\s*!important$/;function kn(t,e,n){if(R(n))n.forEach(o=>{kn(t,e,o)});else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{let o=Hs(t,e);Po.test(n)?t.setProperty(We(o),n.replace(Po,""),"important"):t[o]=n}}var Do=["Webkit","Moz","ms"],On={};function Hs(t,e){let n=On[e];if(n)return n;let o=j(e);if(o!=="filter"&&o in t)return On[e]=o;o=ct(o);for(let r=0;r<Do.length;r++){let s=Do[r]+o;if(s in t)return On[e]=s}return e}var re=t=>Uo(U(t)),Uo=(t,e=new WeakMap)=>{if(!t||!O(t))return t;if(R(t))return t.map(re);if(ce(t)){let o=new Set;for(let r of t.keys())o.add(re(r));return o}if(Se(t)){let o=new Map;for(let r of t)o.set(re(r[0]),re(r[1]));return o}if(e.has(t))return U(e.get(t));let n={...t};e.set(t,n);for(let o of Object.entries(n))n[o[0]]=Uo(U(o[1]),e);return n};var Bs=(t,e)=>{let n=e[0];t.textContent=ce(n)?JSON.stringify(re([...n])):Se(n)?JSON.stringify(re([...n])):O(n)?JSON.stringify(re(n)):n?.toString()??""},Ho={mount:()=>({update:({el:t,values:e})=>{Bs(t,e)}})};var Bo={mount:()=>({update:({el:t,values:e})=>{Ye(t,"value",e[0])}})};var ue=class t{static getDefault(){return t.je??(t.je=new t)}B={};p={};lt=()=>Object.keys(this.B).filter(e=>e.length===1||!e.startsWith(":"));Z=new Map;_=new Map;static je;static Lt="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;propValidationMode="throw";constructor(e){if(this.setDirectives("r-"),e){this.globalContext=e;return}this.globalContext=this.It()}It(){let e={},n=globalThis;for(let o of t.Lt.split(","))e[o]=n[o];return e.ref=be,e.sref=oe,e.flatten=re,e}addComponent(...e){for(let n of e){if(!n.defaultName){Ie.warning("Registered component's default name is not defined",n);continue}this.Z.set(ct(n.defaultName),n),this._.set(ct(n.defaultName).toLocaleUpperCase(),n)}}setDirectives(e){this.B={".":Mo,":":wn,"@":Nn,[`${e}on`]:Nn,[`${e}bind`]:wn,[`${e}html`]:jt,[`${e}text`]:Ho,[`${e}show`]:Vo,[`${e}model`]:Eo,":style":Jt,[`${e}style`]:Jt,[`${e}bind:style`]:Jt,":class":Sn,[`${e}bind:class`]:Sn,":ref":Lo,":value":Bo,[`${e}teleport`]:Nt},this.p={for:`${e}for`,if:`${e}if`,else:`${e}else`,elseif:`${e}else-if`,pre:`${e}pre`,inherit:`${e}inherit`,text:`${e}text`,context:":context",contextAlias:`${e}context`,bind:`${e}bind`,on:`${e}on`,keyBind:":key",key:"key",is:":is",teleport:`${e}teleport`,dynamic:"_d_"}}updateDirectives(e){e(this.B,this.p)}};var Qt=(t,e)=>{if(!t)return;let o=(e??ue.getDefault()).p,r=/(\{\{[^]*?\}\}|\[\[[^]*?\]\])/g,s=[{start:"{{",end:"}}"},{start:"[[",end:"]]"}];for(let a of $s(t,o.pre,s))js(a,o.text,r,s)},js=(t,e,n,o)=>{let r=t.textContent;if(!r)return;let s=n,a=r.split(s);if(a.length<=1)return;if(t.parentElement?.childNodes.length===1&&a.length===3){let c=a[1],l=jo(c,o);if(l&&$(a[0])&&$(a[2])){let u=t.parentElement;u.setAttribute(e,c.substring(l.start.length,c.length-l.end.length)),u.innerText="";return}}let i=document.createDocumentFragment();for(let c of a){let l=jo(c,o);if(l){let u=document.createElement("span");u.setAttribute(e,c.substring(l.start.length,c.length-l.end.length)),i.appendChild(u)}else i.appendChild(document.createTextNode(c))}t.replaceWith(i)},$s=(t,e,n)=>{let o=[],r=s=>{if(s.nodeType===Node.TEXT_NODE)n.some(a=>s.textContent?.includes(a.start))&&o.push(s);else{if(s?.hasAttribute?.(e))return;for(let a of Ee(s))r(a)}};return r(t),o},jo=(t,e)=>e.find(n=>t.startsWith(n.start)&&t.endsWith(n.end));var _s=9,Fs=10,qs=13,zs=32,we=46,Xt=44,Ks=39,Ws=34,Yt=40,Ze=41,Zt=91,Mn=93,Ln=63,Gs=59,$o=58,_o=123,en=125,He=43,tn=45,Vn=96,Fo=47,In=92,qo=new Set([2,3]),Qo={"=":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},Js={"=>":2,...Qo,"||":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},Xo=Object.keys(Qo),Qs=new Set(Xo),Dn=new Set(["=>"]);Xo.forEach(t=>Dn.add(t));var zo={true:!0,false:!1,null:null},Xs="this",et="Expected ",Be="Unexpected ",Hn="Unclosed ",Ys=et+":",Ko=et+"expression",Zs="missing }",ei=Be+"object property",ti=Hn+"(",Wo=et+"comma",Go=Be+"token ",ni=Be+"period",Pn=et+"expression after ",oi="missing unaryOp argument",ri=Hn+"[",si=et+"exponent (",ii="Variable names cannot start with a number (",ai=Hn+'quote after "',ft=t=>t>=48&&t<=57,Jo=t=>Js[t],Un=class{u;e;get H(){return this.u.charAt(this.e)}get h(){return this.u.charCodeAt(this.e)}f(e){return this.u.charCodeAt(this.e)===e}constructor(e){this.u=e,this.e=0}K(e){return e>=65&&e<=90||e>=97&&e<=122||e===36||e===95||e>=128}le(e){return this.K(e)||ft(e)}i(e){return new Error(`${e} at character ${this.e}`)}g(){let e=this.h,n=this.u,o=this.e;for(;e===zs||e===_s||e===Fs||e===qs;)e=n.charCodeAt(++o);this.e=o}parse(){let e=this.fe();return e.length===1?e[0]:{type:0,body:e}}fe(e){let n=[];for(;this.e<this.u.length;){let o=this.h;if(o===Gs||o===Xt)this.e++;else{let r=this.S();if(r)n.push(r);else if(this.e<this.u.length){if(o===e)break;throw this.i(Be+'"'+this.H+'"')}}}return n}S(){let e=this.Pt()??this.$e();return this.g(),this.Dt(e)}de(){this.g();let e=this.u,n=this.e,o=e.charCodeAt(n),r=e.charCodeAt(n+1),s=e.charCodeAt(n+2),a=e.charCodeAt(n+3);if(isNaN(o))return!1;let i=!1,c=0;return o===62&&r===62&&s===62&&a===61?(i=">>>=",c=4):o===61&&r===61&&s===61?(i="===",c=3):o===33&&r===61&&s===61?(i="!==",c=3):o===62&&r===62&&s===62?(i=">>>",c=3):o===60&&r===60&&s===61?(i="<<=",c=3):o===62&&r===62&&s===61?(i=">>=",c=3):o===42&&r===42&&s===61?(i="**=",c=3):o===61&&r===62?(i="=>",c=2):o===124&&r===124?(i="||",c=2):o===63&&r===63?(i="??",c=2):o===38&&r===38?(i="&&",c=2):o===61&&r===61?(i="==",c=2):o===33&&r===61?(i="!=",c=2):o===60&&r===61?(i="<=",c=2):o===62&&r===61?(i=">=",c=2):o===60&&r===60?(i="<<",c=2):o===62&&r===62?(i=">>",c=2):o===43&&r===61?(i="+=",c=2):o===45&&r===61?(i="-=",c=2):o===42&&r===61?(i="*=",c=2):o===47&&r===61?(i="/=",c=2):o===37&&r===61?(i="%=",c=2):o===38&&r===61?(i="&=",c=2):o===94&&r===61?(i="^=",c=2):o===124&&r===61?(i="|=",c=2):o===42&&r===42?(i="**",c=2):o===105&&r===110?this.le(e.charCodeAt(n+2))||(i="in",c=2):o===61?(i="=",c=1):o===124?(i="|",c=1):o===94?(i="^",c=1):o===38?(i="&",c=1):o===60?(i="<",c=1):o===62?(i=">",c=1):o===43?(i="+",c=1):o===45?(i="-",c=1):o===42?(i="*",c=1):o===47?(i="/",c=1):o===37&&(i="%",c=1),i?(this.e+=c,i):!1}$e(){let e,n,o,r,s,a,i,c;if(s=this.z(),!s||(n=this.de(),!n))return s;if(r={value:n,prec:Jo(n),right_a:Dn.has(n)},a=this.z(),!a)throw this.i(Pn+n);let l=[s,r,a];for(;n=this.de();){o=Jo(n),r={value:n,prec:o,right_a:Dn.has(n)},c=n;let u=f=>r.right_a&&f.right_a?o>f.prec:o<=f.prec;for(;l.length>2&&u(l[l.length-2]);)a=l.pop(),n=l.pop().value,s=l.pop(),e=this._e(n,s,a),l.push(e);if(e=this.z(),!e)throw this.i(Pn+c);l.push(r,e)}for(i=l.length-1,e=l[i];i>1;)e=this._e(l[i-1].value,l[i-2],e),i-=2;return e}z(){let e;if(this.g(),e=this.Ut(),e)return this.me(e);let n=this.h;if(ft(n)||n===we)return this.Bt();if(n===Ks||n===Ws)e=this.Ht();else if(n===Zt)e=this.jt();else{let o=this.$t();if(o){let r=this.z();if(!r)throw this.i(oi);return this.me({type:7,operator:o,argument:r})}this.K(n)?(e=this.ye(),e.name in zo?e={type:4,value:zo[e.name],raw:e.name}:e.name===Xs&&(e={type:5})):n===Yt&&(e=this._t())}return e?(e=this.W(e),this.me(e)):!1}_e(e,n,o){if(e==="=>"){let r=n.type===1?n.expressions:[n];return{type:15,params:r,body:o}}return Qs.has(e)?{type:16,operator:e,left:n,right:o}:{type:8,operator:e,left:n,right:o}}Ut(){let e={node:!1};return this.Ft(e),e.node||(this.qt(e),e.node)||(this.Kt(e),e.node)||(this.Fe(e),e.node)||this.zt(e),e.node}me(e){let n={node:e};return this.Wt(n),this.Gt(n),this.Jt(n),n.node}$t(){let e=this.u,n=this.e,o=e.charCodeAt(n),r=e.charCodeAt(n+1),s=e.charCodeAt(n+2),a=e.charCodeAt(n+3);return o===tn?(this.e++,"-"):o===33?(this.e++,"!"):o===126?(this.e++,"~"):o===He?(this.e++,"+"):o===110&&r===101&&s===119&&!this.le(a)?(this.e+=3,"new"):!1}Pt(){let e={};return this.Qt(e),e.node}Dt(e){let n={node:e};return this.Xt(n),n.node}W(e){this.g();let n=this.h;for(;n===we||n===Zt||n===Yt||n===Ln;){let o;if(n===Ln){if(this.u.charCodeAt(this.e+1)!==we)break;o=!0,this.e+=2,this.g(),n=this.h}if(this.e++,n===Zt){if(e={type:3,computed:!0,object:e,property:this.S()},this.g(),n=this.h,n!==Mn)throw this.i(ri);this.e++}else n===Yt?e={type:6,arguments:this.qe(Ze),callee:e}:(o&&this.e--,this.g(),e={type:3,computed:!1,object:e,property:this.ye()});o&&(e.optional=!0),this.g(),n=this.h}return e}Bt(){let e=this.u,n=this.e,o=n;for(;ft(e.charCodeAt(o));)o++;if(e.charCodeAt(o)===we)for(o++;ft(e.charCodeAt(o));)o++;let r=e.charCodeAt(o);if(r===101||r===69){o++;let i=e.charCodeAt(o);(i===He||i===tn)&&o++;let c=o;for(;ft(e.charCodeAt(o));)o++;if(c===o){this.e=o;let l=e.slice(n,o);throw this.i(si+l+this.H+")")}}this.e=o;let s=e.slice(n,o),a=e.charCodeAt(o);if(this.K(a))throw this.i(ii+s+this.H+")");if(a===we||s.length===1&&s.charCodeAt(0)===we)throw this.i(ni);return{type:4,value:parseFloat(s),raw:s}}Ht(){let e=this.u,n=e.length,o=this.e,r=e.charCodeAt(this.e++),s=this.e,a=s,i=[],c=!1,l=!1;for(;s<n;){let f=e.charCodeAt(s);if(f===r){l=!0,this.e=s+1;break}if(f===In){c||(c=!0),i.push(e.slice(a,s));let p=e.charCodeAt(s+1);i.push(this.Ke(p)),s+=2,a=s}else s++}let u=c?i.join("")+e.slice(a,l?s:n):e.slice(a,l?s:n);if(!l)throw this.e=s,this.i(ai+u+'"');return{type:4,value:u,raw:e.substring(o,this.e)}}Ke(e){switch(e){case 110:return`
2
+ `;case 114:return"\r";case 116:return" ";case 98:return"\b";case 102:return"\f";case 118:return"\v";default:return isNaN(e)?"":String.fromCharCode(e)}}ye(){let e=this.h,n=this.e;if(this.K(e))this.e++;else throw this.i(Be+this.H);for(;this.e<this.u.length&&(e=this.h,this.le(e));)this.e++;return{type:2,name:this.u.slice(n,this.e)}}qe(e){let n=[],o=!1,r=0;for(;this.e<this.u.length;){this.g();let s=this.h;if(s===e){if(o=!0,this.e++,e===Ze&&r&&r>=n.length)throw this.i(Go+String.fromCharCode(e));break}else if(s===Xt){if(this.e++,r++,r!==n.length){if(e===Ze)throw this.i(Go+",");for(let a=n.length;a<r;a++)n.push(null)}}else{if(n.length!==r&&r!==0)throw this.i(Wo);{let a=this.S();if(!a||a.type===0)throw this.i(Wo);n.push(a)}}}if(!o)throw this.i(et+String.fromCharCode(e));return n}_t(){this.e++;let e=this.fe(Ze);if(this.f(Ze))return this.e++,e.length===1?e[0]:e.length?{type:1,expressions:e}:!1;throw this.i(ti)}jt(){return this.e++,{type:9,elements:this.qe(Mn)}}Ft(e){if(this.f(_o)){this.e++;let n=[];for(;!isNaN(this.h);){if(this.g(),this.f(en)){this.e++,e.node=this.W({type:10,properties:n});return}let o=this.S();if(!o)break;if(this.g(),o.type===2&&(this.f(Xt)||this.f(en)))n.push({type:12,computed:!1,key:o,value:o,shorthand:!0});else if(this.f($o)){this.e++;let r=this.S();if(!r)throw this.i(ei);let s=o.type===9;n.push({type:12,computed:s,key:s?o.elements[0]:o,value:r,shorthand:!1}),this.g()}else n.push(o);this.f(Xt)&&this.e++}throw this.i(Zs)}}qt(e){let n=this.h;if((n===He||n===tn)&&n===this.u.charCodeAt(this.e+1)){this.e+=2;let o=e.node={type:13,operator:n===He?"++":"--",argument:this.W(this.ye()),prefix:!0};if(!o.argument||!qo.has(o.argument.type))throw this.i(Be+o.operator)}}Gt(e){let n=e.node,o=this.h;if((o===He||o===tn)&&o===this.u.charCodeAt(this.e+1)){if(!qo.has(n.type))throw this.i(Be+(o===He?"++":"--"));this.e+=2,e.node={type:13,operator:o===He?"++":"--",argument:n,prefix:!1}}}Kt(e){this.u.charCodeAt(this.e)===we&&this.u.charCodeAt(this.e+1)===we&&this.u.charCodeAt(this.e+2)===we&&(this.e+=3,e.node={type:14,argument:this.S()})}Xt(e){if(e.node&&this.f(Ln)){this.e++;let n=e.node,o=this.S();if(!o)throw this.i(Ko);if(this.g(),this.f($o)){this.e++;let r=this.S();if(!r)throw this.i(Ko);e.node={type:11,test:n,consequent:o,alternate:r}}else throw this.i(Ys)}}Qt(e){if(this.g(),this.f(Yt)){let n=this.e;if(this.e++,this.g(),this.f(Ze)){this.e++;let o=this.de();if(o==="=>"){let r=this.$e();if(!r)throw this.i(Pn+o);e.node={type:15,params:null,body:r};return}}this.e=n}}Jt(e){let n=e.node,o=n.type;(o===2||o===3)&&this.f(Vn)&&(e.node={type:17,tag:n,quasi:this.Fe(e)})}Fe(e){if(!this.f(Vn))return;let n=this.u,o=n.length,r={type:19,quasis:[],expressions:[]},s=++this.e,a=[],i=[],c=!1,l=u=>{if(!c){let h=n.slice(s,this.e);return r.quasis.push({type:18,value:{raw:h,cooked:h},tail:u})}a.push(n.slice(s,this.e)),i.push(n.slice(s,this.e));let f=a.join(""),p=i.join("");return a.length=0,i.length=0,c=!1,r.quasis.push({type:18,value:{raw:f,cooked:p},tail:u})};for(;this.e<o;){let u=n.charCodeAt(this.e);if(u===Vn)return l(!0),this.e+=1,e.node=r,r;if(u===36&&n.charCodeAt(this.e+1)===_o){if(l(!1),this.e+=2,r.expressions.push(...this.fe(en)),!this.f(en))throw this.i("unclosed ${");this.e+=1,s=this.e}else if(u===In){c||(c=!0),a.push(n.slice(s,this.e)),i.push(n.slice(s,this.e));let f=n.charCodeAt(this.e+1);a.push(n.slice(this.e,this.e+2)),i.push(this.Ke(f)),this.e+=2,s=this.e}else this.e+=1}throw this.i("Unclosed `")}Wt(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 o=e.node;for(;o.type===3||o.type===6&&o.callee.type===3;)o=o.type===3?o.object:o.callee.object;o.type=20}zt(e){if(!this.f(Fo))return;let n=++this.e,o=!1;for(;this.e<this.u.length;){if(this.h===Fo&&!o){let r=this.u.slice(n,this.e),s="";for(;++this.e<this.u.length;){let i=this.h;if(i>=97&&i<=122||i>=65&&i<=90||i>=48&&i<=57)s+=this.H;else break}let a;try{a=new RegExp(r,s)}catch(i){throw this.i(i.message)}return e.node={type:4,value:a,raw:this.u.slice(n-1,this.e)},e.node=this.W(e.node),e.node}this.f(Zt)?o=!0:o&&this.f(Mn)&&(o=!1),this.e+=this.f(In)?2:1}throw this.i("Unclosed Regex")}},Yo=t=>new Un(t).parse();var ci={"=>":(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},ui={"-":t=>-t,"+":t=>+t,"!":t=>!t,"~":t=>~t,new:t=>t},nr=t=>{if(!t?.some(tr))return t;let e=[];return t.forEach(n=>tr(n)?e.push(...n):e.push(n)),e},Zo=(...t)=>nr(t),Bn=(t,e)=>{if(!t)return e;let n=Object.create(e??{});return n.$event=t,n},li={"++":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(++o),o}return++t[e]},"--":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(--o),o}return--t[e]}},fi={"++":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(o+1),o}return t[e]++},"--":(t,e)=>{let n=t[e];if(x(n)){let o=n();return n(o-1),o}return t[e]--}},er={"=":(t,e,n)=>{let o=t[e];return x(o)?o(n):t[e]=n},"+=":(t,e,n)=>{let o=t[e];return x(o)?o(o()+n):t[e]+=n},"-=":(t,e,n)=>{let o=t[e];return x(o)?o(o()-n):t[e]-=n},"*=":(t,e,n)=>{let o=t[e];return x(o)?o(o()*n):t[e]*=n},"/=":(t,e,n)=>{let o=t[e];return x(o)?o(o()/n):t[e]/=n},"%=":(t,e,n)=>{let o=t[e];return x(o)?o(o()%n):t[e]%=n},"**=":(t,e,n)=>{let o=t[e];return x(o)?o(o()**n):t[e]**=n},"<<=":(t,e,n)=>{let o=t[e];return x(o)?o(o()<<n):t[e]<<=n},">>=":(t,e,n)=>{let o=t[e];return x(o)?o(o()>>n):t[e]>>=n},">>>=":(t,e,n)=>{let o=t[e];return x(o)?o(o()>>>n):t[e]>>>=n},"|=":(t,e,n)=>{let o=t[e];return x(o)?o(o()|n):t[e]|=n},"&=":(t,e,n)=>{let o=t[e];return x(o)?o(o()&n):t[e]&=n},"^=":(t,e,n)=>{let o=t[e];return x(o)?o(o()^n):t[e]^=n}},nn=(t,e)=>z(t)?t.bind(e):t,jn=class{l;ze;We;Ge;A;Je;Qe;constructor(e,n,o,r,s){this.l=R(e)?e:[e],this.ze=n,this.We=o,this.Ge=r,this.Qe=!!s}Xe(e,n){if(n&&e in n)return n;for(let o of this.l)if(e in o)return o}2(e,n,o){let r=e.name;if(r==="$root")return this.l[this.l.length-1];if(r==="$parent")return this.l[1];if(r==="$ctx")return[...this.l];if(o&&r in o)return this.A=o[r],nn(U(o[r]),o);for(let a of this.l)if(r in a)return this.A=a[r],nn(U(a[r]),a);let s=this.ze;if(s&&r in s)return this.A=s[r],nn(U(s[r]),s)}5(e,n,o){return this.l[0]}0(e,n,o){return this.Ye(n,o,Zo,...e.body)}1(e,n,o){return this.C(n,o,(...r)=>r.pop(),...e.expressions)}3(e,n,o){let{obj:r,key:s}=this.he(e,n,o),a=r?.[s];return this.A=a,nn(U(a),r)}4(e,n,o){return e.value}6(e,n,o){let r=(a,...i)=>z(a)?a(...nr(i)):a,s=this.C(++n,o,r,e.callee,...e.arguments);return this.A=s,s}7(e,n,o){return this.C(n,o,ui[e.operator],e.argument)}8(e,n,o){let r=ci[e.operator];switch(e.operator){case"||":case"&&":case"??":return r(()=>this.b(e.left,n,o),()=>this.b(e.right,n,o))}return this.C(n,o,r,e.left,e.right)}9(e,n,o){return this.Ye(++n,o,Zo,...e.elements)}10(e,n,o){let r={},s=(...a)=>{a.forEach(i=>{Object.assign(r,i)})};return this.C(++n,o,s,...e.properties),r}11(e,n,o){return this.C(n,o,r=>this.b(r?e.consequent:e.alternate,n,o),e.test)}12(e,n,o){let r={},s=u=>u?.type!==15,a=this.Ge??(()=>!1),i=n===0&&this.Qe,c=u=>this.Ze(i,e.key,n,Bn(u,o)),l=u=>this.Ze(i,e.value,n,Bn(u,o));if(e.shorthand){let u=e.key.name;r[u]=s(e.key)&&a(u,n)?c:c()}else if(e.computed){let u=U(c());r[u]=s(e.value)&&a(u,n)?l:l()}else{let u=e.key.type===4?e.key.value:e.key.name;r[u]=s(e.value)&&a(u,n)?()=>l:l()}return r}he(e,n,o){let r=this.b(e.object,n,o),s=e.computed?this.b(e.property,n,o):e.property.name;return{obj:r,key:s}}13(e,n,o){let r=e.argument,s=e.operator,a=e.prefix?li:fi;if(r.type===2){let i=r.name,c=this.Xe(i,o);return le(c)?void 0:a[s](c,i)}if(r.type===3){let{obj:i,key:c}=this.he(r,n,o);return a[s](i,c)}}16(e,n,o){let r=e.left,s=e.operator;if(r.type===2){let a=r.name,i=this.Xe(a,o);if(le(i))return;let c=this.b(e.right,n,o);return er[s](i,a,c)}if(r.type===3){let{obj:a,key:i}=this.he(r,n,o),c=this.b(e.right,n,o);return er[s](a,i,c)}}14(e,n,o){let r=this.b(e.argument,n,o);return R(r)&&(r.s=or),r}17(e,n,o){return this[6]({type:6,callee:e.tag,arguments:[{type:9,elements:e.quasi.quasis},...e.quasi.expressions]},n,o)}19(e,n,o){let r=(...s)=>s.reduce((a,i,c)=>a+=i+e.quasis[c+1].value.cooked,e.quasis[0].value.cooked);return this.C(n,o,r,...e.expressions)}18(e,n,o){return e.value.cooked}20(e,n,o){let r=(s,...a)=>new s(...a);return this.C(n,o,r,e.callee,...e.arguments)}15(e,n,o){return(...r)=>{let s=Object.create(o??{}),a=e.params;if(a){let i=0;for(let c of a)s[c.name]=r[i++]}return this.b(e.body,n,s)}}b(e,n,o){let r=U(this[e.type](e,n,o));return this.Je=e.type,r}Ze(e,n,o,r){let s=this.b(n,o,r);return e&&this.et()?this.A:s}et(){let e=this.Je;return(e===2||e===3||e===6)&&x(this.A)}eval(e,n){let{value:o,refs:r}=Lt(()=>this.b(e,-1,n)),s={value:o,refs:r};return this.et()&&(s.ref=this.A),s}C(e,n,o,...r){let s=r.map(a=>a&&this.b(a,e,n));return o(...s)}Ye(e,n,o,...r){let s=this.We;if(!s)return this.C(e,n,o,...r);let a=r.map((i,c)=>i&&(i.type!==15&&s(c,e)?l=>this.b(i,e,Bn(l,n)):this.b(i,e,n)));return o(...a)}},or=Symbol("s"),tr=t=>t?.s===or,rr=(t,e,n,o,r,s,a)=>new jn(e,n,o,r,a).eval(t,s);var sr={},ir=t=>!!t,on=class{l;o;constructor(e,n){this.l=e,this.o=n}v(e){this.l=[e,...this.l]}ee(){return this.l.map(n=>n.components).filter(ir).reverse().reduce((n,o)=>{for(let[r,s]of Object.entries(o))n[r.toUpperCase()]=s;return n},{})}ut(){let e=[],n=new Set,o=this.l.map(r=>r.components).filter(ir).reverse();for(let r of o)for(let s of Object.keys(r))n.has(s)||(n.add(s),e.push(s));return e}M(e,n,o,r,s){let a=[],i=[],c=new Set,l=()=>{for(let C=0;C<i.length;++C)i[C]();i.length=0},p={value:()=>a,stop:()=>{l(),c.clear()},subscribe:(C,v)=>(c.add(C),v&&C(a),()=>{c.delete(C)}),refs:[],context:this.l[0]};if($(e))return p;let h=this.o.globalContext,m=[],d=new Set,y=(C,v,F,W)=>{try{let P=rr(C,v,h,n,o,W,r);return F&&P.refs.length>0&&m.push(...P.refs),{value:P.value,refs:P.refs,ref:P.ref}}catch(P){D(6,`evaluation error: ${e}`,P)}return{value:void 0,refs:[]}};try{let C=sr[e]??Yo("["+e+"]");sr[e]=C;let v=this.l.slice(),F=C.elements,W=F.length,P=new Array(W);p.refs=P;let Q=()=>{m.length=0,s||(d.clear(),l());let se=new Array(W);for(let S=0;S<W;++S){let me=F[S];if(n?.(S,-1)){se[S]=k=>y(me,v,!1,{$event:k}).value;continue}let g=y(me,v,!0);se[S]=g.value,P[S]=g.ref}if(!s)for(let S of m)d.has(S)||(d.add(S),i.push(ne(S,Q)));if(a=se,c.size!==0)for(let S of c)c.has(S)&&S(a)};Q()}catch(C){D(6,`parse error: ${e}`,C)}return p}L(){return this.l.slice()}tt=[];ce(e){this.tt.push(this.l),this.l=e}E(e,n){try{this.ce(e),n()}finally{this.Yt()}}Yt(){this.l=this.tt.pop()??[]}};var ar=t=>{let e=t.charCodeAt(0);return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||t==="-"||t==="_"||t===":"},pi=(t,e)=>{let n="";for(let o=e;o<t.length;++o){let r=t[o];if(n){r===n&&(n="");continue}if(r==='"'||r==="'"){n=r;continue}if(r===">")return o}return-1},mi=(t,e)=>{let n=e?2:1;for(;n<t.length&&(t[n]===" "||t[n]===`
3
+ `);)++n;if(n>=t.length||!ar(t[n]))return null;let o=n;for(;n<t.length&&ar(t[n]);)++n;return{start:o,end:n}},cr=new Set(["table","thead","tbody","tfoot"]),di=new Set(["thead","tbody","tfoot"]),hi=new Set(["caption","colgroup","thead","tbody","tfoot","tr"]),yi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ur=(t,e)=>`${t.slice(0,t.length-2)}></${e}>`,rn=t=>{let e=0,n=[],o=[],r=0;for(;e<t.length;){let s=t.indexOf("<",e);if(s===-1){n.push(t.slice(e));break}if(n.push(t.slice(e,s)),t.startsWith("<!--",s)){let y=t.indexOf("-->",s+4);if(y===-1){n.push(t.slice(s));break}n.push(t.slice(s,y+3)),e=y+3;continue}let a=pi(t,s);if(a===-1){n.push(t.slice(s));break}let i=t.slice(s,a+1),c=i.startsWith("</");if(i.startsWith("<!")||i.startsWith("<?")){n.push(i),e=a+1;continue}let u=mi(i,c);if(!u){n.push(i),e=a+1;continue}let f=i.slice(u.start,u.end);if(c){let y=o[o.length-1];y?(o.pop(),n.push(y.replacementHost?`</${y.replacementHost}>`:i),cr.has(y.effectiveTag)&&--r):n.push(i),e=a+1;continue}let p=i.charCodeAt(i.length-2)===47,h=o[o.length-1],m=null;r===0?f==="tr"?m="trx":f==="td"?m="tdx":f==="th"&&(m="thx"):di.has(h?.effectiveTag??"")?m=f==="tr"?null:"tr":h?.effectiveTag==="table"?m=hi.has(f)?null:"tr":h?.effectiveTag==="tr"&&(m=f==="td"||f==="th"?null:"td");let d=p&&!yi.has(m||f);if(m){let y=m==="trx"||m==="tdx"||m==="thx",C=`${i.slice(0,u.start)}${m} is="${y?`r-${f}`:`regor:${f}`}"${i.slice(u.end)}`;n.push(d?ur(C,m):C)}else n.push(d?ur(i,f):i);if(!p){let y=m==="trx"?"tr":m==="tdx"?"td":m==="thx"?"th":m||f;o.push({replacementHost:m,effectiveTag:y}),cr.has(y)&&++r}e=a+1}return n.join("")};var gi="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",bi=new Set(gi.toUpperCase().split(",")),xi="http://www.w3.org/2000/svg",lr=(t,e)=>{fe(t)?t.content.appendChild(e):t.appendChild(e)},$n=(t,e,n,o)=>{let r=t.t;if(r){let a=n&&bi.has(r.toUpperCase())?document.createElementNS(xi,r.toLowerCase()):document.createElement(r),i=t.a;if(i)for(let l of Object.entries(i)){let u=l[0],f=l[1];u.startsWith("#")&&(f=u.substring(1),u="name"),a.setAttribute(At(u,o),f)}let c=t.c;if(c)for(let l of c)$n(l,a,n,o);lr(e,a);return}let s=t.d;if(s){let a;switch(t.n??Node.TEXT_NODE){case Node.COMMENT_NODE:a=document.createComment(s);break;case Node.TEXT_NODE:a=document.createTextNode(s);break}if(a)lr(e,a);else throw new Error("unsupported node type.")}},je=(t,e,n)=>{n??=ue.getDefault();let o=document.createDocumentFragment();if(!R(t))return $n(t,o,!!e,n),o;for(let r of t)$n(r,o,!!e,n);return o};var fr=(t,e={selector:"#app"},n)=>{K(e)&&(e={selector:"#app",template:e}),co(t)&&(t=t.context);let o=e.element?e.element:e.selector?document.querySelector(e.selector):null;if(!o||!Te(o))throw B(0);n||(n=ue.getDefault());let r=()=>{for(let i of[...o.childNodes])q(i)},s=i=>{for(;i.length>0;)o.appendChild(i[0])};if(e.template){let i=document.createRange().createContextualFragment(rn(e.template));r(),s(i.childNodes),e.element=i}else if(e.json){let i=je(e.json,e.isSVG,n);r(),s(i.childNodes)}return n.useInterpolation&&Qt(o,n),new _n(t,o,n).y(),_(o,()=>{Ae(t)}),Ot(t),{context:t,unmount:()=>{q(o)},unbind:()=>{de(o)}}},_n=class{Zt;nt;o;m;r;constructor(e,n,o){this.Zt=e,this.nt=n,this.o=o,this.m=new on([e],o),this.r=new qt(this.m)}y(){this.r.$(this.nt)}};var tt=t=>{if(R(t))return t.map(r=>tt(r));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(r=>[r,t.getAttribute(r)??""])));let o=Ee(t);return o.length>0&&(e.c=[...o].map(r=>tt(r))),e};var pr=(t,e={})=>{R(e)&&(e={props:e}),K(t)&&(t={template:t});let n=e.context??(()=>({})),o=!1;if(t.element){let s=t.element;s.remove(),t.element=s}else if(t.selector){let s=document.querySelector(t.selector);if(!s)throw B(1,t.selector);s.remove(),t.element=s}else if(t.template){let s=document.createRange().createContextualFragment(rn(t.template));t.element=s}else t.json&&(t.element=je(t.json,t.isSVG,e.config),o=!0);t.element||(t.element=document.createDocumentFragment()),(e.useInterpolation??!0)&&Qt(t.element,e.config??ue.getDefault());let r=t.element;if(!o&&((t.isSVG??(at(r)&&r.hasAttribute?.("isSVG")))||at(r)&&r.querySelector("[isSVG]"))){let s=r.content,a=s?[...s.childNodes]:[...r.childNodes],i=tt(a);t.element=je(i,!0,e.config)}return{context:n,template:t.element,inheritAttrs:e.inheritAttrs??!0,props:e.props,defaultName:e.defaultName}};var sn=class{byConstructor=new Map;register(e){this.byConstructor.set(e.constructor,e)}unregisterByClass(e){this.byConstructor.delete(e)}unregister(e){let n=e.constructor;this.byConstructor.get(n)===e&&this.byConstructor.delete(n)}find(e){for(let n of this.byConstructor.values())if(n instanceof e)return n}require(e){let n=this.find(e);if(n)return n;throw new Error(`${e.name} is not registered in ContextRegistry.`)}};var mr=t=>{Ve()?.onMounted.push(t)};var dr=t=>{let e,n={},o=(...r)=>{if(r.length<=2&&0 in r)throw B(4);return e&&!n.isStopped?e(...r):(e=Ti(t,n),e(...r))};return o[X]=1,Me(o,!0),o.stop=()=>n.ref?.stop?.(),te(()=>o.stop(),!0),o},Ti=(t,e)=>{let n=e.ref??oe(null);e.ref=n,e.isStopped=!1;let o=0,r=Ue(()=>{if(o>0){r(),e.isStopped=!0,J(n);return}n(t()),++o});return n.stop=r,n};var hr=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw B(4);return o&&!n.isStopped?o(...s):(o=Ci(t,e,n),o(...s))};return r[X]=1,Me(r,!0),r.stop=()=>n.ref?.stop?.(),te(()=>r.stop(),!0),r},Ci=(t,e,n)=>{let o=n.ref??oe(null);n.ref=o,n.isStopped=!1;let r=0,s=i=>{if(r>0){o.stop(),n.isStopped=!0,J(o);return}let c=t.map(l=>l());o(e(...c)),++r},a=[];for(let i of t){let c=ne(i,s);a.push(c)}return s(null),o.stop=()=>{a.forEach(i=>{i()})},o};var yr=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw B(4);return o&&!n.isStopped?o(...s):(o=Ei(t,e,n),o(...s))};return r[X]=1,Me(r,!0),r.stop=()=>n.ref?.stop?.(),te(()=>r.stop(),!0),r},Ei=(t,e,n)=>{let o=n.ref??oe(null);n.ref=o,n.isStopped=!1;let r=0;return o.stop=ne(t,s=>{if(r>0){o.stop(),n.isStopped=!0,J(o);return}o(e(s)),++r},!0),o};var gr=t=>(t[xt]=1,t);var br=(t,e)=>{if(!e)throw B(5);let o=De(t)?be:i=>i,r=()=>localStorage.setItem(e,JSON.stringify(re(t()))),s=localStorage.getItem(e);if(s!=null)try{t(o(JSON.parse(s)))}catch(i){D(6,`persist: failed to parse data for key ${e}`,i),r()}else r();let a=Ue(r);return te(a,!0),t};var an=(t,...e)=>{let n="",o=t,r=e,s=o.length,a=r.length;for(let i=0;i<s;++i)n+=o[i],i<a&&(n+=r[i]);return n},xr=an,Tr=an;var Cr=(t,e,n)=>{let o=[],r=()=>{e(t.map(a=>a()))};for(let a of t)o.push(ne(a,r));n&&r();let s=()=>{for(let a of o)a()};return te(s,!0),s};var Er=t=>{if(!x(t))throw B(3,"observerCount");return t(void 0,void 0,2)};var Rr=t=>{Fn();try{t()}finally{qn()}},Fn=()=>{ge.stack||(ge.stack=[]),ge.stack.push(new Set)},qn=()=>{let t=ge.stack;if(!t||t.length===0)return;let e=t.pop();if(t.length){let n=t[t.length-1];for(let o of e)n.add(o);return}delete ge.stack;for(let n of e)try{J(n)}catch(o){console.error(o)}};
@@ -695,6 +695,17 @@ var addUnbinder = (node, unbinder) => {
695
695
  getBindData(node).unbinders.push(unbinder);
696
696
  };
697
697
 
698
+ // src/common/toBoolean.ts
699
+ var toBoolean = (value) => {
700
+ if (typeof value === "string") {
701
+ const normalized = value.trim().toLowerCase();
702
+ if (normalized === "" || normalized === "0" || normalized === "false")
703
+ return false;
704
+ if (normalized === "true") return true;
705
+ }
706
+ return !!value;
707
+ };
708
+
698
709
  // src/bind/switch.ts
699
710
  var switches = {};
700
711
  var switchCounter = {};
@@ -885,7 +896,7 @@ var IfBinder = class {
885
896
  unmount: () => {
886
897
  unmount(commentBegin, commentEnd);
887
898
  },
888
- isTrue: () => !!value()[0],
899
+ isTrue: () => toBoolean(value()[0]),
889
900
  isMounted: false
890
901
  },
891
902
  ...remainingElses
@@ -906,7 +917,7 @@ var IfBinder = class {
906
917
  const capturedContext = parser.__capture();
907
918
  const refresh = () => {
908
919
  parser.__scoped(capturedContext, () => {
909
- if (value()[0]) {
920
+ if (toBoolean(value()[0])) {
910
921
  if (!isIfMounted) {
911
922
  mount(nodes, this.__binder, parent, commentEnd);
912
923
  isIfMounted = true;
@@ -3880,7 +3891,7 @@ var updateShow = (el, values) => {
3880
3891
  if (isUndefined(originalDisplay)) {
3881
3892
  originalDisplay = data._ord = el.style.display;
3882
3893
  }
3883
- const isVisible = !!values[0];
3894
+ const isVisible = toBoolean(values[0]);
3884
3895
  if (isVisible) el.style.display = originalDisplay;
3885
3896
  else el.style.display = "none";
3886
3897
  };
@@ -6224,8 +6235,8 @@ var createApp = (context, template = { selector: "#app" }, config) => {
6224
6235
  }
6225
6236
  };
6226
6237
  const appendChildren = (childNodes) => {
6227
- for (const child of childNodes) {
6228
- root.appendChild(child);
6238
+ while (childNodes.length > 0) {
6239
+ root.appendChild(childNodes[0]);
6229
6240
  }
6230
6241
  };
6231
6242
  if (template.template) {
@@ -6589,6 +6600,7 @@ var html = (templates, ...args) => {
6589
6600
  return result;
6590
6601
  };
6591
6602
  var raw = html;
6603
+ var svg = html;
6592
6604
 
6593
6605
  // src/observer/observeMany.ts
6594
6606
  var observeMany = (sources, observer, init) => {
@@ -6687,6 +6699,7 @@ export {
6687
6699
  silence,
6688
6700
  sref,
6689
6701
  startBatch,
6702
+ svg,
6690
6703
  toFragment,
6691
6704
  toJsonTemplate,
6692
6705
  trigger,