regor 1.6.1 → 1.6.3

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 Regor=(()=>{var un=Object.defineProperty;var wr=Object.getOwnPropertyDescriptor;var Sr=Object.getOwnPropertyNames;var Ar=Object.prototype.hasOwnProperty;var kr=(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 Sr(e))!Ar.call(t,r)&&r!==n&&un(t,r,{get:()=>e[r],enumerable:!(o=wr(e,r))||o.enumerable});return t};var Or=t=>Nr(un({},"__esModule",{value:!0}),t);var Ri={};kr(Ri,{ComponentHead:()=>We,ContextRegistry:()=>sn,RegorConfig:()=>pe,addUnbinder:()=>$,batch:()=>Rr,collectRefs:()=>Lt,computeMany:()=>yr,computeRef:()=>gr,computed:()=>hr,createApp:()=>fr,defineComponent:()=>mr,drainUnbind:()=>Wn,endBatch:()=>qn,entangle:()=>Ye,flatten:()=>ie,getBindData:()=>Ve,html:()=>an,isDeepRef:()=>je,isRaw:()=>Ze,isRef:()=>x,markRaw:()=>br,observe:()=>oe,observeMany:()=>Er,observerCount:()=>vr,onMounted:()=>dr,onUnmounted:()=>te,pause:()=>Wt,persist:()=>xr,pval:()=>eo,raw:()=>Tr,ref:()=>Ce,removeNode:()=>z,resume:()=>Gt,silence:()=>Mt,sref:()=>se,startBatch:()=>Fn,svg:()=>Cr,toFragment:()=>qe,toJsonTemplate:()=>rt,trigger:()=>X,unbind:()=>ge,unref:()=>A,useScope:()=>Ot,warningHandler:()=>He,watchEffect:()=>$e});var ze=Symbol(":regor");var ge=t=>{let e=[t];for(let n=0;n<e.length;++n){let o=e[n];Mr(o);for(let r=o.lastChild;r!=null;r=r.previousSibling)e.push(r)}},Mr=t=>{let e=t[ze];if(!e)return;let n=e.unbinders;for(let o=0;o<n.length;++o)n[o]();n.length=0,t[ze]=void 0};var Ke=[],dt=!1,ht,Kn=()=>{if(dt=!1,ht=void 0,Ke.length!==0){for(let t=0;t<Ke.length;++t)ge(Ke[t]);Ke.length=0}},z=t=>{t.remove(),Ke.push(t),dt||(dt=!0,ht=setTimeout(Kn,1))},Wn=async()=>{Ke.length===0&&!dt||(ht&&clearTimeout(ht),Kn())};var K=t=>typeof t=="function",W=t=>typeof t=="string",Gn=t=>typeof t>"u",de=t=>t==null||typeof t>"u",H=t=>typeof t!="string"||!t?.trim(),Lr=Object.prototype.toString,ln=t=>Lr.call(t),Oe=t=>ln(t)==="[object Map]",le=t=>ln(t)==="[object Set]",pn=t=>ln(t)==="[object Date]",st=t=>typeof t=="symbol",R=Array.isArray,M=t=>t!==null&&typeof t=="object";var Jn={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=Jn[t];return new Error(K(n)?n.call(Jn,...e):n)};var yt=[],Qn=()=>{let t={onMounted:[],onUnmounted:[]};return yt.push(t),t},Ue=t=>{let e=yt[yt.length-1];if(!e&&!t)throw B(2);return e},Xn=t=>{let e=Ue();return t&&mn(t),yt.pop(),e},fn=Symbol("csp"),mn=t=>{let e=t,n=e[fn];if(n){let o=Ue();if(n===o)return;o.onMounted.length>0&&n.onMounted.push(...o.onMounted),o.onUnmounted.length>0&&n.onUnmounted.push(...o.onUnmounted);return}e[fn]=Ue()},gt=t=>t[fn];var Me=t=>{gt(t)?.onUnmounted?.forEach(n=>{n()}),t.unmounted?.()};var Yn={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]})},U=(t,...e)=>{let n=Yn[t],o=K(n)?n.call(Yn,...e):n,r=He.warning;r&&(W(o)?r(o):r(o,...o.args))},He={warning:console.warn};var bt=Symbol("ref"),Z=Symbol("sref"),xt=Symbol("raw");var x=t=>t!=null&&t[Z]===1;var Le=class extends Error{propPath;detail;constructor(e,n){super(n),this.name="PropValidationError",this.propPath=e,this.detail=n}},xe=(t,e)=>{throw new Le(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"},Vr=t=>t.length>60?`${t.slice(0,57)}...`:t,it=(t,e=0)=>{if(e>1)return"unknown";if(x(t)){let s=t();return`ref(${it(s,e+1)})`}if(typeof t=="string")return Vr(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=>it(a,e+1)).join(", ");return t.length>5?`[${s}, ...]`:`[${s}]`}if(M(t)){let s=Object.entries(t).slice(0,5);if(s.length===0)return"{}";let a=s.map(([i,c])=>{let u=it(c,e+1);return`${i}: ${u}`}).join(", ");return Object.keys(t).length>5?`{ ${a}, ... }`:`{ ${a} }`}return"unknown"},ue=t=>{if(x(t))return`got ${Tt(t)}(${it(t())})`;let e=Tt(t),n=it(t);return`got ${e} (${n})`},Ir=t=>t instanceof Le?t.detail:t instanceof Error?t.message:String(t),Zn=(t,e)=>{let n=`, ${ue(e)}.`;return t.endsWith(n)?t.slice(0,-n.length):t},Pr=(t,e,n)=>{if(e instanceof Le){if(e.propPath===t)return Zn(e.detail,n);if(e.propPath===`${t}.value`&&x(n)){let o=Zn(e.detail,n());return o.startsWith("expected ")?`expected ref<${o.slice(9)}>`:`expected ref where ${o}`}}return Ir(e)},Dr=(t,e,n)=>{let o=[];for(let r of e){let s=Pr(t,r,n);o.includes(s)||o.push(s)}return o.length===0?ue(n):o.length===1?`${o[0]}, ${ue(n)}`:`${o.join(" or ")}, ${ue(n)}`},Ur=t=>typeof t=="string"?`"${t}"`:typeof t=="number"||typeof t=="boolean"?String(t):t===null?"null":t===void 0?"undefined":Tt(t),Hr=(t,e)=>{typeof t!="string"&&xe(e,`expected string, ${ue(t)}`)},Br=(t,e)=>{typeof t!="number"&&xe(e,`expected number, ${ue(t)}`)},jr=(t,e)=>{typeof t!="boolean"&&xe(e,`expected boolean, ${ue(t)}`)},$r=t=>(e,n)=>{e instanceof t||xe(n,`expected instance of ${t.name||"provided class"}, ${ue(e)}`)},_r=t=>(e,n,o)=>{e!==void 0&&t(e,n,o)},Fr=t=>(e,n,o)=>{e!==null&&t(e,n,o)},qr=(...t)=>(e,n,o)=>{let r=[];for(let s of t)try{s(e,n,o);return}catch(a){r.push(a)}xe(n,Dr(n,r,e))},zr=t=>(e,n)=>{t.includes(e)||xe(n,`expected one of ${t.map(o=>Ur(o)).join(", ")}, ${ue(e)}`)},Kr=t=>(e,n,o)=>{R(e)||xe(n,`expected array, ${ue(e)}`);let r=e;for(let s=0;s<r.length;++s)t(r[s],`${n}[${s}]`,o)};function Wr(t){return(e,n,o)=>{M(e)||xe(n,`expected object, ${ue(e)}`);let r=e;for(let s in t){let a=t[s];if(!a)continue;a(r[s],`${n}.${s}`,o)}}}var Gr=t=>(e,n,o)=>{if(x(e)){t(e(),`${n}.value`,o);return}xe(n,`expected ref, ${ue(e)}`)},eo={fail:xe,describe:ue,isString:Hr,isNumber:Br,isBoolean:jr,isClass:$r,optional:_r,nullable:Fr,or:qr,oneOf:zr,arrayOf:Kr,shape:Wr,refOf:Gr};var Jr=(t,e,n)=>{let o=t.tagName?.toLowerCase?.()||"unknown",r=n instanceof Le?n.propPath:e,s=n instanceof Le?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})},We=class{props;start;end;ctx;autoProps=!0;entangle=!0;enableSwitch=!1;onAutoPropsAssigned;J;Q;constructor(e,n,o,r,s,a){this.props=e,this.J=n,this.ctx=o,this.start=r,this.end=s,this.Q=a}emit=(e,n)=>{this.J.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.Q==="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=Jr(this.J,o,a);if(this.Q==="warn"){He.warning(i.message,i);continue}throw i}}}unmount(){let e=this.start.nextSibling,n=this.end;for(;e&&e!==n;)z(e),e=e.nextSibling;for(let o of this.ctx)Me(o)}};var Ve=t=>{let e=t,n=e[ze];if(n)return n;let o={unbinders:[],data:{}};return e[ze]=o,o};var $=(t,e)=>{Ve(t).unbinders.push(e)};var at=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={},to=1,no=t=>{let e=(to++).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])},oo=t=>Et[t],yn=()=>to!==1&&Object.keys(Et).length>0,ct="r-switch",Qr=t=>{let e=t.filter(o=>ve(o)).map(o=>[...o.querySelectorAll("[r-switch]")].map(r=>r.getAttribute(ct))),n=new Set;return e.forEach(o=>{o.forEach(r=>r&&n.add(r))}),[...n]},Ge=(t,e)=>{if(!yn())return;let n=Qr(e);n.length!==0&&(n.forEach(dn),$(t,()=>{n.forEach(hn)}))};var vt=()=>{},gn=(t,e,n,o)=>{let r=[];for(let s of t){let a=s.cloneNode(!0);n.insertBefore(a,o),r.push(a)}Ie(e,r)},bn=Symbol("r-if"),ro=Symbol("r-else"),so=t=>t[ro]===1,Rt=class{r;V;be;X;Y;x;R;constructor(e){this.r=e,this.V=e.o.p.if,this.be=St(e.o.p.if),this.X=e.o.p.else,this.Y=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),e.hasAttribute(this.r.o.p.is)||e.hasAttribute("is")||this.r.M.j(e,r=>{r.hasAttribute(this.V)&&this.y(r)}),n}Z(e){return e[bn]?!0:(e[bn]=!0,wt(e,this.be).forEach(n=>n[bn]=!0),!1)}y(e){if(e.hasAttribute(this.R)||this.Z(e)||this.ot(e,this.x))return;let n=e.getAttribute(this.V);if(!n){U(0,this.V,e);return}e.removeAttribute(this.V),this.O(e,n)}U(e,n,o){let r=Je(e),s=e.parentNode,a=document.createComment(`__begin__ :${n}${o??""}`);s.insertBefore(a,e),Ge(a,r),r.forEach(c=>{z(c)}),e.remove(),n!=="if"&&(e[ro]=1);let i=document.createComment(`__end__ :${n}${o??""}`);return s.insertBefore(i,a.nextSibling),{nodes:r,parent:s,commentBegin:a,commentEnd:i}}xe(e,n){if(!e)return[];let o=e.nextElementSibling;if(e.hasAttribute(this.X)){e.removeAttribute(this.X);let{nodes:r,parent:s,commentBegin:a,commentEnd:i}=this.U(e,"else");return[{mount:()=>{gn(r,this.r,s,i)},unmount:()=>{Re(a,i)},isTrue:()=>!0,isMounted:!1}]}else{let r=e.getAttribute(this.Y);if(!r)return[];e.removeAttribute(this.Y);let{nodes:s,parent:a,commentBegin:i,commentEnd:c}=this.U(e,"elseif",` => ${r} `),u=this.r.m.N(r),l=u.value,p=this.xe(o,n),m=vt;return $(i,()=>{u.stop(),m(),m=vt}),m=u.subscribe(n),[{mount:()=>{gn(s,this.r,a,c)},unmount:()=>{Re(i,c)},isTrue:()=>at(l()[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.N(n),u=c.value,l=!1,p=this.r.m,m=p.L(),h=()=>{p.E(m,()=>{if(at(u()[0]))l||(gn(r,this.r,s,i),l=!0),d.forEach(v=>{v.unmount(),v.isMounted=!1});else{Re(a,i),l=!1;let v=!1;for(let w of d)!v&&w.isTrue()?(w.isMounted||(w.mount(),w.isMounted=!0),v=!0):(w.unmount(),w.isMounted=!1)}})},d=this.xe(o,h),f=vt;$(a,()=>{c.stop(),f(),f=vt}),h(),f=c.subscribe(h)}};var Je=t=>{let e=he(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},Ie=(t,e)=>{for(let n=0;n<e.length;++n){let o=e[n];o.nodeType===Node.ELEMENT_NODE&&(so(o)||t.$(o))}},wt=(t,e)=>{let n=t.querySelectorAll(e);return t.matches?.(e)?[t,...n]:n},he=t=>t instanceof HTMLTemplateElement,ve=t=>t.nodeType===Node.ELEMENT_NODE,ut=t=>t.nodeType===Node.ELEMENT_NODE,io=t=>t instanceof HTMLSlotElement,we=t=>he(t)?t.content.childNodes:t.childNodes,Re=(t,e)=>{let n=t.nextSibling;for(;n!=null&&n!==e;){let o=n.nextSibling;z(n),n=o}},ao=function(){return this()},Xr=function(t){return this(t)},Yr=()=>{throw new Error("value is readonly.")},Zr={get:ao,set:Xr,enumerable:!0,configurable:!1},es={get:ao,set:Yr,enumerable:!0,configurable:!1},Pe=(t,e)=>{Object.defineProperty(t,"value",e?es:Zr)},co=(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))},ts=/-(\w)/g,j=xn(t=>t&&t.replace(ts,(e,n)=>n?n.toUpperCase():"")),ns=/\B([A-Z])/g,Qe=xn(t=>t&&t.replace(ns,"-$1").toLowerCase()),lt=xn(t=>t&&t.charAt(0).toUpperCase()+t.slice(1));var kt={mount:()=>{}};var Xe=t=>{let e=t.trim();return e?e.split(/\s+/):[]};var Nt=t=>{gt(t)?.onMounted?.forEach(n=>{n()}),t.mounted?.()};var Tn=Symbol("scope"),Ot=t=>{try{Qn();let e=t();mn(e);let n={context:e,unmount:()=>Me(e),[Tn]:1};return n[Tn]=1,n}finally{Xn()}},uo=t=>M(t)?Tn in t:!1;var Cn={collectRefObj:!0,mount:({parseResult:t})=>({update:({values:e})=>{let n=t.context,o=e[0];if(M(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)=>{Ue(e)?.onUnmounted.push(t)};var oe=(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 Ye=(t,e)=>{if(t===e)return()=>{};let n=oe(t,r=>e(r)),o=oe(e,r=>t(r));return e(t()),()=>{n(),o()}};var Ze=t=>!!t&&t[xt]===1;var je=t=>t?.[bt]===1;var ye=[],lo=t=>{ye.length!==0&&ye[ye.length-1]?.add(t)},$e=t=>{if(!t)return()=>{};let e={stop:()=>{}};return os(t,e),te(()=>e.stop(),!0),e.stop},os=(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(ye.push(s),t(a=>n.push(a)),o)return;for(let a of[...s]){let i=oe(a,()=>{r(),$e(t)});n.push(i)}}finally{ye.pop()}},Mt=t=>{let e=ye.length,n=e>0&&ye[e-1];try{return n&&ye.push(null),t()}finally{n&&ye.pop()}},Lt=t=>{try{let e=new Set;return ye.push(e),{value:t(),refs:[...e]}}finally{ye.pop()}};var X=(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)||le(r))for(let s of r)X(s,e,!0);else if(Oe(r))for(let s of r)X(s[0],e,!0),X(s[1],e,!0);if(M(r))for(let s in r)X(r[s],e,!0)}};function rs(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}var et=(t,e,n)=>{n.forEach(function(o){let r=t[o];rs(e,o,function(...a){let i=r.apply(this,a),c=this[Z];for(let u of c)X(u);return i})})},Vt=(t,e)=>{Object.defineProperty(t,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})};var po=Array.prototype,En=Object.create(po),ss=["push","pop","shift","unshift","splice","sort","reverse"];et(po,En,ss);var fo=Map.prototype,It=Object.create(fo),is=["set","clear","delete"];Vt(It,"Map");et(fo,It,is);var mo=Set.prototype,Pt=Object.create(mo),as=["add","clear","delete"];Vt(Pt,"Set");et(mo,Pt,as);var Te={},se=t=>{if(x(t)||Ze(t))return t;let e={auto:!0,_value:t},n=c=>M(c)?Z in c?!0:R(c)?(Object.setPrototypeOf(c,En),!0):le(c)?(Object.setPrototypeOf(c,Pt),!0):Oe(c)?(Object.setPrototypeOf(c,It),!0):!1:!1,o=n(t),r=new Set,s=(c,u)=>{if(Te.stack&&Te.stack.length){Te.stack[Te.stack.length-1].add(i);return}r.size!==0&&Mt(()=>{for(let l of[...r.keys()])r.has(l)&&l(c,u)})},a=c=>{let u=c[Z];u||(c[Z]=u=new Set),u.add(i)},i=(...c)=>{if(!(2 in c)){let l=c[0],p=c[1];return 0 in c?e._value===l||x(l)&&(l=l(),e._value===l)?l:(n(l)&&a(l),e._value=l,e.auto&&s(l,p),e._value):(lo(i),e._value)}switch(c[2]){case 0:{let l=c[3];if(!l)return()=>{};let p=m=>{r.delete(m)};return r.add(l),()=>{p(l)}}case 1:{let l=c[1],p=e._value;s(p,l);break}case 2:return r.size;case 3:{e.auto=!1;break}case 4:e.auto=!0}return e._value};return i[Z]=1,Pe(i,!1),o&&a(t),i};var Ce=t=>{if(Ze(t))return t;let e;if(x(t)?(e=t,t=e()):e=se(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];je(r)||(t[o]=Ce(r))}return e}if(!M(t))return e;for(let n of Object.entries(t)){let o=n[1];if(je(o))continue;let r=n[0];st(r)||(t[r]=null,t[r]=Ce(o))}return e};var ho=Symbol("modelBridge"),Dt=()=>{},cs=t=>!!t?.[ho],us=t=>{t[ho]=1},ls=t=>{let e=Ce(t());return us(e),e},yo={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=(l,p)=>{o!==l&&(i(),s=Ye(l,p),o=l)},u=()=>{let l=t.refs[0]??t.value()[0],p=t.context,m=p[n];if(!x(l)){if(r&&m===r){r(l);return}if(a(),x(m)){m(l);return}p[n]=l;return}if(cs(l)){if(m===l)return;x(m)?c(l,m):p[n]=l;return}r||(r=ls(l)),p[n]=r,c(l,r)};return{update:()=>{u()},unmount:()=>{s()}}}};var Ut=class{r;_;Te="";Re=-1;constructor(e){this.r=e,this._=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(Qe)].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}ct(e){if(!he(e))return!1;let n=e.getAttributeNames();return e.hasAttribute("name")?!0:n.some(o=>o.startsWith("#"))}pt(e){return he(e)&&e.getAttributeNames().length===0}rt(e){let n=this.r,o=n.m,r=n.o.ee,s=n.o.F;if(r.size===0&&!this.it(o.l))return;let a=o.te(),i=this.Ee();if(H(i))return;let c=this.ut(e,i);for(let u of c){if(u.hasAttribute(n.R))continue;let l=u.parentNode;if(!l)continue;let p=u.nextSibling,m=j(u.tagName).toUpperCase(),d=a[m]??s.get(m);if(!d)continue;let f=d.template;if(!f)continue;let C=u.parentElement;if(!C)continue;let v=new Comment(" begin component: "+u.tagName),w=new Comment(" end component: "+u.tagName);C.insertBefore(v,u),u.remove();let _=n.o.p.context,J=n.o.p.contextAlias,I=n.o.p.bind,Y=d.props?.map(j)??[],re=[],N=g=>g==="class"||g==="style",fe=(g,T,E=!1)=>{let D={},G=g.hasAttribute(_);return o.E(T,()=>{if(o.v(D),G?n.y(Cn,g,_):g.hasAttribute(J)&&n.y(Cn,g,J),Y.length===0)return;let k=new Map(Y.map(y=>[y.toLowerCase(),y]));for(let y of[...Y,...Y.map(Qe)]){let S=g.getAttribute(y);if(S===null)continue;let L=j(y);D[L]=S,E&&d.inheritAttrs===!0&&N(L)&&re.push({name:y,value:S}),g.removeAttribute(y)}let q=n.q.Ce(g,!1);for(let[y,S]of q.entries()){let[L,ae]=S.ne;if(!ae)continue;let ce=k.get(j(ae).toLowerCase());if(ce&&!(L!=="."&&L!==":"&&L!==I)){if(E&&L!=="."&&d.inheritAttrs===!0&&N(ce)){let zn=g.getAttribute(y);zn!==null&&re.push({name:y,value:zn})}n.y(yo,g,y,!0,ce,S.oe)}}}),D},b=[...o.L()],V=()=>{let g=fe(u,b,!0),T=new We(g,u,b,v,w,n.o.propValidationMode),E=Ot(()=>d.context(T)??{}).context;if(T.autoProps){for(let[D,G]of Object.entries(g))if(D in E){let k=E[D];if(k===G)continue;if(x(k)){x(G)?T.entangle?$(v,Ye(G,k)):k(G()):k(G);continue}}else E[D]=G;for(let D of Y)D in E||(E[D]=void 0);T.onAutoPropsAssigned?.()}return{componentCtx:E,head:T}},{componentCtx:F,head:De}=V(),me=[...we(f)],cn=me.length,P=u.childNodes.length===0,O=g=>{let T=g.parentElement,E=g.name;if(H(E)&&(E=g.getAttributeNames().filter(k=>k.startsWith("#"))[0],H(E)?E="default":E=E.substring(1)),P){if(E==="default"){let k=n.o.p.text,q=u.getAttribute(k);if(!H(q)){let y=document.createElement("span");y.setAttribute(k,q),T.insertBefore(y,g),u.removeAttribute(k);return}}for(let k of[...g.childNodes])T.insertBefore(k,g);return}let D=u.querySelector(`template[name='${E}'], template[\\#${E}]`);!D&&E==="default"&&(D=[...u.querySelectorAll("template:not([name])")].find(q=>this.pt(q))??null);let G=k=>{De.enableSwitch&&o.E(b,()=>{o.v(F);let q=fe(g,o.L());o.E(b,()=>{o.v(q);let y=o.L(),S=no(y);for(let L of k)ve(L)&&(L.setAttribute(ct,S),dn(S),$(L,()=>{hn(S)}))})})};if(D){let k=[...we(D)];for(let q of k)T.insertBefore(q,g);G(k)}else{if(E!=="default"){for(let q of[...we(g)])T.insertBefore(q,g);return}let k=[...we(u)].filter(q=>!this.ct(q));for(let q of k)T.insertBefore(q,g);G(k)}},Q=g=>{if(!ve(g))return;let T=g.querySelectorAll("slot");if(io(g)){O(g),g.remove();return}for(let E of T)O(E),E.remove()};(()=>{for(let g=0;g<cn;++g)me[g]=me[g].cloneNode(!0),l.insertBefore(me[g],p),Q(me[g])})(),C.insertBefore(w,p);let ee=()=>{if(!d.inheritAttrs)return;let g=me.filter(y=>y.nodeType===Node.ELEMENT_NODE),E=g.flatMap(y=>[...y.hasAttribute(this._)?[y]:[],...y.querySelectorAll(`[${this._}]`)]).at(0)??(g.length===1?g[0]:void 0);if(!E)return;E.removeAttribute(this._);let D=`${I}:class`,G=`${I}:style`,k=(y,S,L)=>{let ae=E.hasAttribute(y)?y:E.hasAttribute(S)?S:y,ce=E.getAttribute(ae);E.setAttribute(ae,H(ce)?L:`${ce}, ${L}`)},q=(y,S)=>{if(y==="class"){let L=Xe(S);L.length>0&&E.classList.add(...L)}else if(y===":class"||y===D)k(":class",D,S);else if(y==="style"){let L=E.style,ae=u.style;for(let ce of ae)L.setProperty(ce,ae.getPropertyValue(ce))}else y===":style"||y===G?k(":style",G,S):E.setAttribute(At(y,n.o),S)};for(let{name:y,value:S}of re)u.setAttribute(y,S);for(let y of u.getAttributeNames())y===_||y===J||q(y,u.getAttribute(y))},Ee=()=>{for(let g of u.getAttributeNames())!g.startsWith("@")&&!g.startsWith(n.o.p.on)&&u.removeAttribute(g)},Ne=()=>{ee(),Ee(),o.v(F),n.ve(u,!1),F.$emit=De.emit,Ie(n,me),$(u,()=>{Me(F)}),$(v,()=>{ge(u)}),Nt(F)};o.E(b,Ne)}}Ee(){let e=this.r,n=e.m,o=e.o.ee,r=n.lt(),s=this.st(o);return[...s?[s]:[],...r,...r.map(Qe)].join(",")}ut(e,n){let o=[];if(H(n))return o;if(e.matches?.(n))return[e];let r=this.K(e).reverse();for(;r.length>0;){let s=r.pop();if(s.matches(n)){o.push(s);continue}r.push(...this.K(s).reverse())}return o}j(e,n){let o=this.Ee(),r=this.K(e).reverse();for(;r.length>0;){let s=r.pop();n(s),!(!H(o)&&s.matches(o))&&r.push(...this.K(s).reverse())}}K(e){let n=e?.children;if(n?.length!=null){let r=[];for(let s=0;s<n.length;++s){let a=n[s];ve(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];ve(a)&&r.push(a)}return r}return[]}};var vn=class{ne;oe;we=[];constructor(e,n){this.ne=e,this.oe=n}},Ht=class{r;Se;Ae;re;constructor(e){this.r=e,this.Se=e.o.ft(),this.re=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.re.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(/[:@]/);H(i[0])&&(i[0]=r?".":o[0]);let c=s>=0?o.slice(s+1).split("."):[],u=!1,l=!1;for(let m=0;m<c.length;++m){let h=c[m];if(!u&&h==="camel"?u=!0:!l&&h==="prop"&&(l=!0),u&&l)break}u&&(i[i.length-1]=j(i[i.length-1])),l&&(i[0]=".");let p={terms:i,flags:c};return this.re.set(e,p),p}Ce(e,n){let o=new Map;if(!ut(e))return o;let r=this.Ae,s=(i,c)=>{let u=r.get(c[0]??"");if(u)for(let l=0;l<u.length;++l){if(!c.startsWith(u[l]))continue;let p=o.get(c);if(!p){let m=this.ke(c);p=new vn(m.terms,m.flags),o.set(c,p)}p.we.push(i);return}},a=i=>{let c=i.attributes;if(!(!c||c.length===0))for(let u=0;u<c.length;++u){let l=c.item(u)?.name;l&&s(i,l)}};return a(e),!n||!e.firstElementChild||this.r.M.j(e,a),o}};var go=()=>{},ps=(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.M.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=Je(e),r=e.parentNode,s=document.createComment(`__begin__ dynamic ${n??""}`);r.insertBefore(s,e),Ge(s,o),o.forEach(i=>{z(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,commentBegin:r,commentEnd:s}=this.U(e,` => ${n} `),a=this.r.m.N(n),i=a.value,c=this.r.m,u=c.L(),l={name:""},p=he(e)?o:[...o[0].childNodes],m=()=>{c.E(u,()=>{let f=i()[0];if(M(f)&&(f.name?f=f.name:f=Object.entries(c.te()).filter(w=>w[1]===f)[0]?.[0]),!W(f)||H(f)){Re(r,s);return}if(l.name===f)return;Re(r,s);let C=s.parentNode??r.parentNode;if(!C)return;let v=document.createElement(f);for(let w of e.getAttributeNames())w!==this.I&&v.setAttribute(w,e.getAttribute(w));ps(p,v),C.insertBefore(v,s),this.r.$(v),l.name=f})},h=go;$(r,()=>{a.stop(),h(),h=go}),m(),h=a.subscribe(m)}};var A=t=>{let e=t;return e!=null&&e[Z]===1?e():e};var fs=(t,e)=>{let[n,o]=e;K(o)?o(t,n):t.innerHTML=n?.toString()},jt={mount:()=>({update:({el:t,values:e})=>{fs(t,e)}})};var $t=class t{se;constructor(e){this.se=e}static dt(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.te();if(Object.keys(c).length>0||r.F.size>0)return;let u=e.q,l=[],p=0,m=[];for(let h=n.length-1;h>=0;--h)m.push(n[h]);for(;m.length>0;){let h=m.pop();if(h.nodeType===Node.ELEMENT_NODE){let f=h;if(f.tagName==="TEMPLATE"||f.tagName.includes("-"))return;let C=j(f.tagName).toUpperCase();if(r.F.has(C)||c[C])return;let v=f.attributes;for(let w=0;w<v.length;++w){let _=v.item(w)?.name;if(!_)continue;if(a.has(_))return;let{terms:J,flags:I}=u.ke(_),[Y,re]=J,N=i[_]??i[Y];if(N){if(N===jt)return;l.push({nodeIndex:p,attrName:_,directive:N,option:re,flags:I})}}++p}let d=h.childNodes;for(let f=d.length-1;f>=0;--f)m.push(d[f])}if(l.length!==0)return new t(l)}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.se.length;++s){let a=this.se[s],i=o[a.nodeIndex];i&&e.y(a.directive,i,a.attrName,!1,a.option,a.flags)}}};var ms=(t,e)=>{let n=e.parentNode;if(n)for(let o=0;o<t.items.length;++o)n.insertBefore(t.items[o],e)},ds=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 u=o[o.length-1];if(u===void 0||t[u]<c){n[i]=u??-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 mt(e){let{oldItems:n,newValues:o,getKey:r,isSameValue:s,mountNewValue:a,removeMountItem:i,endAnchor:c}=e,u=n.length,l=o.length,p=new Array(l),m=new Set;for(let b=0;b<l;++b){let V=r(o[b]);if(V===void 0||m.has(V))return;m.add(V),p[b]=V}let h=new Array(l),d=0,f=u-1,C=l-1;for(;d<=f&&d<=C;){let b=n[d];if(r(b.value)!==p[d]||!s(b.value,o[d]))break;b.value=o[d],h[d]=b,++d}for(;d<=f&&d<=C;){let b=n[f];if(r(b.value)!==p[C]||!s(b.value,o[C]))break;b.value=o[C],h[C]=b,--f,--C}if(d>f){for(let b=C;b>=d;--b){let V=b+1<l?h[b+1].items[0]:c;h[b]=a(b,o[b],V)}return h}if(d>C){for(let b=d;b<=f;++b)i(n[b]);return h}let v=d,w=d,_=C-w+1,J=new Array(_).fill(0),I=new Map;for(let b=w;b<=C;++b)I.set(p[b],b);let Y=!1,re=0;for(let b=v;b<=f;++b){let V=n[b],F=I.get(r(V.value));if(F===void 0){i(V);continue}if(!s(V.value,o[F])){i(V);continue}V.value=o[F],h[F]=V,J[F-w]=b+1,F>=re?re=F:Y=!0}let N=Y?ds(J):[],fe=N.length-1;for(let b=_-1;b>=0;--b){let V=w+b,F=V+1<l?h[V+1].items[0]:c;if(J[b]===0){h[V]=a(V,o[V],F);continue}let De=h[V];Y&&(fe>=0&&N[fe]===b?--fe:De&&ms(De,F))}return h}};var pt=class{T=[];P=new Map;get w(){return this.T.length}ie;constructor(e){this.ie=e}ae(e){let n=this.ie(e.value);n!==void 0&&this.P.set(n,e)}ce(e){let n=this.ie(this.T[e]?.value);n!==void 0&&this.P.delete(n)}static yt(e,n){return{items:[],index:e,value:n,order:-1}}v(e){e.order=this.w,this.T.push(e),this.ae(e)}ht(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.ae(n)}D(e){return this.T[e]}pe(e,n){this.ce(e),this.T[e]=n,this.ae(n),n.order=e}Ve(e){this.ce(e),this.T.splice(e,1);let n=this.w;for(let o=e;o<n;++o)this.T[o].order=o}Me(e){let n=this.w;for(let o=e;o<n;++o)this.ce(o);this.T.splice(e)}tn(e){return this.P.has(e)}gt(e){return this.P.get(e)?.order??-1}};var Rn=Symbol("r-for"),hs=t=>-1,bo=()=>{},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.Ne(e),e.hasAttribute(this.r.o.p.is)||e.hasAttribute("is")||this.r.M.j(e,r=>{r.hasAttribute(this.x)&&this.Ne(r)}),n}Z(e){return e[Rn]?!0:(e[Rn]=!0,wt(e,this.Oe).forEach(n=>n[Rn]=!0),!1)}Ne(e){if(e.hasAttribute(this.R)||this.Z(e))return;let n=e.getAttribute(this.x);if(!n){U(0,this.x,e);return}e.removeAttribute(this.x),this.bt(e,n)}Le(e){return de(e)?[]:(K(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))}bt(e,n){let o=this.xt(n);if(!o?.list){U(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=Je(e),c=$t.dt(this.r,i),u=e.parentNode;if(!u)return;let l=`${this.x} => ${n}`,p=new Comment(`__begin__ ${l}`);u.insertBefore(p,e),Ge(p,i),i.forEach(O=>{z(O)}),e.remove();let m=new Comment(`__end__ ${l}`);u.insertBefore(m,p.nextSibling);let h=this.r,d=h.m,f=d.L(),v=f.length===1?[void 0,f[0]]:void 0,w=this.Tt(a),_=(O,Q)=>w(O)===w(Q),J=(O,Q)=>O===Q,I=(O,Q,ne)=>{let ee=o.createContext(Q,O),Ee=pt.yt(ee.index,Q),Ne=()=>{let g=m.parentNode??p.parentNode??u,T=ne.previousSibling,E=[];for(let D=0;D<i.length;++D){let G=i[D].cloneNode(!0);g.insertBefore(G,ne),E.push(G)}for(c?c.y(h,E):Ie(h,E),T=T.nextSibling;T!==ne;)Ee.items.push(T),T=T.nextSibling};return v?(v[0]=ee.ctx,d.E(v,Ne)):d.E(f,()=>{d.v(ee.ctx),Ne()}),Ee},Y=(O,Q)=>{let ne=P.D(O).items,ee=ne[ne.length-1].nextSibling;for(let Ee of ne)z(Ee);P.pe(O,I(O,Q,ee))},re=(O,Q)=>{P.v(I(O,Q,m))},N=O=>{for(let Q of P.D(O).items)z(Q)},fe=O=>{let Q=P.w;for(let ne=O;ne<Q;++ne)P.D(ne).index(ne)},b=O=>{let Q=p.parentNode,ne=m.parentNode;if(!Q||!ne)return;let ee=P.w;K(O)&&(O=O());let Ee=A(O[0]);if(R(Ee)&&Ee.length===0){Re(p,m),P.Me(0);return}let Ne=[];for(let y of this.Le(O[0]))Ne.push(y);let g=_t.mt({oldItems:P.T,newValues:Ne,getKey:w,isSameValue:J,mountNewValue:(y,S,L)=>I(y,S,L),removeMountItem:y=>{for(let S=0;S<y.items.length;++S)z(y.items[S])},endAnchor:m});if(g){P.T=g,P.P.clear();for(let y=0;y<g.length;++y){let S=g[y];S.order=y,S.index(y);let L=w(S.value);L!==void 0&&P.P.set(L,S)}return}let T=0,E=Number.MAX_SAFE_INTEGER,D=ee,G=this.r.o.forGrowThreshold,k=()=>P.w<D+G;for(let y of Ne){let S=()=>{if(T<ee){let L=P.D(T++);if(_(L.value,y)){if(J(L.value,y))return;Y(T-1,y);return}let ae=P.gt(w(y));if(ae>=T&&ae-T<10){if(--T,E=Math.min(E,T),N(T),P.Ve(T),--ee,ae>T+1)for(let ce=T;ce<ae-1&&ce<ee&&!_(P.D(T).value,y);)++ce,N(T),P.Ve(T),--ee;S();return}k()?(P.ht(T-1,I(T,y,P.D(T-1).items[0])),E=Math.min(E,T-1),++ee):Y(T-1,y)}else re(T++,y)};S()}let q=T;for(ee=P.w;T<ee;)N(T++);P.Me(q),fe(E)},V=()=>{F.stop(),me(),me=bo},F=d.N(o.list),De=F.value,me=bo,cn=0,P=new pt(w);for(let O of this.Le(De()[0]))P.v(I(cn++,O,m));$(p,V),me=F.subscribe(b)}static Rt=/\{?\[?\(?([^)}\]]+)\)?\]?\}?([^)]+)?\s+\b(?:in|of)\b\s+(.*)\s*$/;xt(e){let n=t.Rt.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,u)=>{let l={},p=A(c);if(!i&&o.length===1)l[o[0]]=c;else if(R(p)){let h=0;for(let d of o)l[d]=p[h++]}else for(let h of o)l[h]=p[h];let m={ctx:l,index:hs};return s&&(m.index=l[s.startsWith("#")?s.substring(1):s]=se(u)),m}}}Tt(e){if(!e)return o=>o;let n=e.trim();if(!n)return o=>o;if(n.includes(".")){let o=this.Et(n),r=o.length>1?o.slice(1):void 0;return s=>{let a=A(s),i=this.Ie(a,o);return i!==void 0||!r?i:this.Ie(a,r)}}return o=>A(A(o)?.[n])}Et(e){return e.split(".").filter(n=>n.length>0)}Ie(e,n){let o=e;for(let r of n)o=A(o)?.[r];return A(o)}};var qt=class{ue=0;le=new Map;m;Pe;De;Ue;M;q;o;R;Be;constructor(e){this.m=e,this.o=e.o,this.De=new Ft(this),this.Pe=new Rt(this),this.Ue=new Bt(this),this.M=new Ut(this),this.q=new Ht(this),this.R=this.o.p.pre,this.Be=this.o.p.dynamic}Ct(e){let n=he(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);Ie(this,a)}}$(e){++this.ue;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.M.k(e),this.Ct(e),this.ve(e,!0)}finally{--this.ue,this.ue===0&&this.vt()}}wt(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.wt(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,()=>{z(e)}),o.appendChild(e),!0}St(e,n){this.le.set(e,n)}vt(){let e=this.le;if(e.size!==0){this.le=new Map;for(let[n,o]of e.entries())this.He(n,o)}}ve(e,n){let o=this.q.Ce(e,n),r=this.o.B;for(let[s,a]of o.entries()){let[i,c]=a.ne,u=r[s]??r[i];if(!u){console.error("directive not found:",i);continue}let l=a.we;for(let p=0;p<l.length;++p){let m=l[p];this.y(u,m,s,!1,c,a.oe)}}}y(e,n,o,r,s,a){if(n.hasAttribute(this.R))return;let i=n.getAttribute(o);n.removeAttribute(o);let c=u=>{let l=u;for(;l;){let p=l.getAttribute(ct);if(p)return p;l=l.parentElement}return null};if(yn()){let u=c(n);if(u){this.m.E(oo(u),()=>{this.O(e,n,i,s,a)});return}}this.O(e,n,i,s,a)}At(e,n,o){return e!==kt?!1:(H(o)||this.He(n,o)||this.St(n,o),!0)}O(e,n,o,r,s){if(n.nodeType!==Node.ELEMENT_NODE||o==null||this.At(e,n,o))return;let a=this.kt(r,e.once),i=this.Vt(e,o),c=this.Mt(i,a);$(n,c.stop);let u=this.Ot(n,o,i,a,r,s),l=this.Nt(e,u,c);if(!l)return;let p=this.Lt(u,i,a,r,l);p(),e.once||(c.result=i.subscribe(p),a&&(c.dynamic=a.subscribe(p)))}kt(e,n){let o=co(e,this.Be);if(o)return this.m.N(j(o),void 0,void 0,void 0,n)}Vt(e,n){return this.m.N(n,e.isLazy,e.isLazyKey,e.collectRefObj,e.once)}Mt(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}Ot(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}}Nt(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}Lt(e,n,o,r,s){let a,i;return()=>{let c=n.value(),u=o?o.value()[0]:r;e.values=c,e.previousValues=a,e.option=u,e.previousOption=i,a=c,i=u,s(e)}}};var xo="http://www.w3.org/1999/xlink",ys={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 gs(t){return!!t||t===""}var bs=(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 u=n?.[i]?.[0],l=c[0],p=c[1];zt(t,l,p,u)}else if(M(c))for(let u of Object.entries(c)){let l=u[0],p=u[1],m=n?.[i],h=m&&l in m?l:void 0;zt(t,l,p,h)}else{let u=n?.[i],l=e[i++],p=e[i];zt(t,l,p,u)}}},wn={mount:()=>({update:({el:t,values:e,previousValues:n,option:o,previousOption:r,flags:s})=>{bs(t,e,n,o,r,s)}})},zt=(t,e,n,o)=>{if(o&&o!==e&&t.removeAttribute(o),de(e)){U(3,"r-bind",t);return}if(!W(e)){U(6,`Attribute key is not string at ${t.outerHTML}`,e);return}if(e.startsWith("xlink:")){de(n)?t.removeAttributeNS(xo,e.slice(6,e.length)):t.setAttributeNS(xo,e,n);return}let r=e in ys;de(n)||r&&!gs(n)?t.removeAttribute(e):t.setAttribute(e,r?"":n)};var xs=(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)To(t,s[c],a?.[c])}else To(t,s,a)}},Sn={mount:()=>({update:({el:t,values:e,previousValues:n})=>{xs(t,e,n)}})},To=(t,e,n)=>{let o=A(e),r=A(n),s=t.classList,a=W(o),i=W(r);if(o&&!a){let c=o;if(r&&!i){let u=r;for(let l in u)(!(l in c)||!A(c[l]))&&s.remove(l)}for(let u in c)A(c[u])&&s.add(u)}else if(a){if(r!==o){let c=i?Xe(r):[],u=Xe(o);c.length>0&&s.remove(...c),u.length>0&&s.add(...u)}}else if(r){let c=i?Xe(r):[];c.length>0&&s.remove(...c)}};function Ts(t,e){if(t.length!==e.length)return!1;let n=!0;for(let o=0;n&&o<t.length;o++)n=Se(t[o],e[o]);return n}function Se(t,e){if(t===e)return!0;let n=pn(t),o=pn(e);if(n||o)return n&&o?t.getTime()===e.getTime():!1;if(n=st(t),o=st(e),n||o)return t===e;if(n=R(t),o=R(e),n||o)return n&&o?Ts(t,e):!1;if(n=M(t),o=M(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||!Se(t[a],e[a]))return!1}return!0}return String(t)===String(e)}function Kt(t,e){return t.findIndex(n=>Se(n,e))}var Co=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 vo={mount:({el:t,parseResult:e,flags:n})=>({update:({values:o})=>{Cs(t,o[0])},unmount:Es(t,e,n)})},Cs=(t,e)=>{let n=Ao(t);if(n&&Ro(t))R(e)?e=Kt(e,Ae(t))>-1:le(e)?e=e.has(Ae(t)):e=ks(t,e),t.checked=e;else if(n&&wo(t))t.checked=Se(e,Ae(t));else if(n||ko(t))So(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=Ae(i);if(s)R(e)?i.selected=Kt(e,c)>-1:i.selected=e.has(c);else if(Se(Ae(i),e)){t.selectedIndex!==a&&(t.selectedIndex=a);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}else U(7,t)},ft=t=>(x(t)&&(t=t()),K(t)&&(t=t()),t?W(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",wo=t=>t.type==="radio",So=t=>t.type==="number"||t.type==="range",Ao=t=>t.tagName==="INPUT",ko=t=>t.tagName==="TEXTAREA",No=t=>t.tagName==="SELECT",Es=(t,e,n)=>{let o=e.value,r=ft(n?.join(",")),s=ft(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 U(8,t),()=>{};let i=()=>e.refs[0],c=Ao(t);return c&&Ro(t)?Rs(t,i):c&&wo(t)?Ns(t,i):c||ko(t)?vs(t,a,i,o):No(t)?Os(t,i,o):(U(7,t),()=>{})},Eo=/[.,' ·٫]/,vs=(t,e,n,o)=>{let s=e.lazy?"change":"input",a=So(t),i=()=>{!e.trim&&!ft(o()[1]).trim||(t.value=t.value.trim())},c=m=>{let h=m.target;h.composing=1},u=m=>{let h=m.target;h.composing&&(h.composing=0,h.dispatchEvent(new Event(s)))},l=()=>{t.removeEventListener(s,p),t.removeEventListener("change",i),t.removeEventListener("compositionstart",c),t.removeEventListener("compositionend",u),t.removeEventListener("change",u)},p=m=>{let h=n();if(!h)return;let d=m.target;if(!d||d.composing)return;let f=d.value,C=ft(o()[1]);if(a||C.number||C.int){if(C.int)f=parseInt(f);else{if(Eo.test(f[f.length-1])&&f.split(Eo).length===2){if(f+="0",f=parseFloat(f),isNaN(f))f="";else if(h()===f)return}f=parseFloat(f)}isNaN(f)&&(f=""),t.value=f}else C.trim&&(f=f.trim());h(f)};return t.addEventListener(s,p),t.addEventListener("change",i),t.addEventListener("compositionstart",c),t.addEventListener("compositionend",u),t.addEventListener("change",u),l},Rs=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let a=Ae(t),i=t.checked,c=s();if(R(c)){let u=Kt(c,a),l=u!==-1;i&&!l?c.push(a):!i&&l&&c.splice(u,1)}else le(c)?i?c.add(a):c.delete(a):s(As(t,i))};return t.addEventListener(n,r),o},Ae=t=>"_value"in t?t._value:t.value,Oo="trueValue",ws="falseValue",Mo="true-value",Ss="false-value",As=(t,e)=>{let n=e?Oo:ws;if(n in t)return t[n];let o=e?Mo:Ss;return t.hasAttribute(o)?t.getAttribute(o):e},ks=(t,e)=>{if(Oo in t)return Se(e,t.trueValue);let o=Mo;return t.hasAttribute(o)?Se(e,t.getAttribute(o)):Se(e,!0)},Ns=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let a=Ae(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=ft(n()[1]).number,u=Array.prototype.filter.call(t.options,l=>l.selected).map(l=>c?Co(Ae(l)):Ae(l));if(t.multiple){let l=a();try{if(Wt(a),le(l)){l.clear();for(let p of u)l.add(p)}else R(l)?(l.splice(0),l.push(...u)):a(u)}finally{Gt(a),X(a)}}else a(u[0])};return t.addEventListener(o,s),r};var Ms=["stop","prevent","capture","self","once","left","right","middle","passive"],Ls=t=>{let e={};if(H(t))return;let n=t.split(",");for(let o of Ms)e[o]=n.includes(o);return e},Vs=(t,e,n,o,r)=>{if(o){let u=e.value(),l=A(o.value()[0]);return W(l)?An(t,j(l),()=>e.value()[0],r?.join(",")??u[1]):()=>{}}else if(n){let u=e.value();return An(t,j(n),()=>e.value()[0],r?.join(",")??u[1])}let s=[],a=()=>{s.forEach(u=>u())},i=e.value(),c=i.length;for(let u=0;u<c;++u){let l=i[u];if(K(l)&&(l=l()),M(l))for(let p of Object.entries(l)){let m=p[0],h=()=>{let f=e.value()[u];return K(f)&&(f=f()),f=f[m],K(f)&&(f=f()),f},d=l[m+"_flags"];s.push(An(t,m,h,d))}else U(2,"r-on",t)}return a},kn={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})=>Vs(t,e,n,o,r)},Is=(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=u=>!(r&&!u.ctrlKey||s&&!u.shiftKey||a&&!u.altKey||i&&!u.metaKey);return o?[t,u=>c(u)?u.key.toUpperCase()===o.toUpperCase():!1]:[t,c]}return[t,n=>!0]},An=(t,e,n,o)=>{if(H(e))return U(5,"r-on",t),()=>{};let r=Ls(o),s=r?{capture:r.capture,passive:r.passive,once:r.once}:void 0,a;[e,a]=Is(e,o);let i=l=>{if(!a(l)||!n&&e==="submit"&&r?.prevent)return;let p=n(l);K(p)&&(p=p(l)),K(p)&&p(l)},c=()=>{t.removeEventListener(e,u,s)},u=l=>{if(!r){i(l);return}try{if(r.left&&l.button!==0||r.middle&&l.button!==1||r.right&&l.button!==2||r.self&&l.target!==t)return;r.stop&&l.stopPropagation(),r.prevent&&l.preventDefault(),i(l)}finally{r.once&&c()}};return t.addEventListener(e,u,s),c};var Ps=(t,e,n,o)=>{if(n){o&&o.includes("camel")&&(n=j(n)),tt(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];tt(t,i,c)}else if(M(a))for(let i of Object.entries(a)){let c=i[0],u=i[1];tt(t,c,u)}else{let i=e[s++],c=e[s];tt(t,i,c)}}},Lo={mount:()=>({update:({el:t,values:e,option:n,flags:o})=>{Ps(t,e,n,o)}})};function Ds(t){return!!t||t===""}var tt=(t,e,n)=>{if(de(e)){U(3,":prop",t);return}if(e==="innerHTML"||e==="textContent"){let s=[...t.childNodes];setTimeout(()=>s.forEach(ge),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=Ds(n):n==null&&s==="string"?(n="",r=!0):s==="number"&&(n=0,r=!0)}try{t[e]=n}catch(s){r||U(4,e,o,n,s)}r&&t.removeAttribute(e)};var Vo={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 Us=(t,e)=>{let n=Ve(t).data,o=n._ord;Gn(o)&&(o=n._ord=t.style.display),at(e[0])?t.style.display=o:t.style.display="none"},Io={mount:()=>({update:({el:t,values:e})=>{Us(t,e)}})};var Hs=(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)Po(t,s[c],a?.[c])}else Po(t,s,a)}},Jt={mount:()=>({update:({el:t,values:e,previousValues:n})=>{Hs(t,e,n)}})},Po=(t,e,n)=>{let o=A(e),r=A(n),s=t.style,a=W(o);if(o&&!a){let i=o;if(r&&!W(r)){let c=r;for(let u in c)A(i[u])==null&&On(s,u,"")}for(let c in i)On(s,c,i[c])}else{let i=s.display;if(a?r!==o&&(s.cssText=o):r&&t.removeAttribute("style"),"_ord"in Ve(t).data)return;s.display=i}},Do=/\s*!important$/;function On(t,e,n){let o=A(n);if(R(o))o.forEach(r=>{On(t,e,r)});else{let r=o==null?"":String(o);if(e.startsWith("--"))t.setProperty(e,r);else{let s=Bs(t,e);Do.test(r)?t.setProperty(Qe(s),r.replace(Do,""),"important"):t[s]=r}}}var Uo=["Webkit","Moz","ms"],Nn={};function Bs(t,e){let n=Nn[e];if(n)return n;let o=j(e);if(o!=="filter"&&o in t)return Nn[e]=o;o=lt(o);for(let r=0;r<Uo.length;r++){let s=Uo[r]+o;if(s in t)return Nn[e]=s}return e}var ie=t=>Ho(A(t)),Ho=(t,e=new WeakMap)=>{if(!t||!M(t))return t;if(R(t))return t.map(ie);if(le(t)){let o=new Set;for(let r of t.keys())o.add(ie(r));return o}if(Oe(t)){let o=new Map;for(let r of t)o.set(ie(r[0]),ie(r[1]));return o}if(e.has(t))return A(e.get(t));let n={...t};e.set(t,n);for(let o of Object.entries(n))n[o[0]]=Ho(A(o[1]),e);return n};var js=(t,e)=>{let n=e[0];t.textContent=le(n)?JSON.stringify(ie([...n])):Oe(n)?JSON.stringify(ie([...n])):M(n)?JSON.stringify(ie(n)):n?.toString()??""},Bo={mount:()=>({update:({el:t,values:e})=>{js(t,e)}})};var jo={mount:()=>({update:({el:t,values:e})=>{tt(t,"value",e[0])}})};var pe=class t{static getDefault(){return t.je??(t.je=new t)}B={};p={};ft=()=>Object.keys(this.B).filter(e=>e.length===1||!e.startsWith(":"));ee=new Map;F=new Map;static je;static It="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.Pt()}Pt(){let e={},n=globalThis;for(let o of t.It.split(","))e[o]=n[o];return e.ref=Ce,e.sref=se,e.flatten=ie,e}addComponent(...e){for(let n of e){if(!n.defaultName){He.warning("Registered component's default name is not defined",n);continue}this.ee.set(lt(n.defaultName),n),this.F.set(lt(n.defaultName).toLocaleUpperCase(),n)}}setDirectives(e){this.B={".":Lo,":":wn,"@":kn,[`${e}on`]:kn,[`${e}bind`]:wn,[`${e}html`]:jt,[`${e}text`]:Bo,[`${e}show`]:Io,[`${e}model`]:vo,":style":Jt,[`${e}style`]:Jt,[`${e}bind:style`]:Jt,":class":Sn,[`${e}bind:class`]:Sn,":ref":Vo,":value":jo,[`${e}teleport`]:kt},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??pe.getDefault()).p,r=/(\{\{[^]*?\}\}|\[\[[^]*?\]\])/g,s=[{start:"{{",end:"}}"},{start:"[[",end:"]]"}];for(let a of _s(t,o.pre,s))$s(a,o.text,r,s)},$s=(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],u=$o(c,o);if(u&&H(a[0])&&H(a[2])){let l=t.parentElement;l.setAttribute(e,c.substring(u.start.length,c.length-u.end.length)),l.innerText="";return}}let i=document.createDocumentFragment();for(let c of a){let u=$o(c,o);if(u){let l=document.createElement("span");l.setAttribute(e,c.substring(u.start.length,c.length-u.end.length)),i.appendChild(l)}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 we(s))r(a)}};return r(t),o},$o=(t,e)=>e.find(n=>t.startsWith(n.start)&&t.endsWith(n.end));var Fs=9,qs=10,zs=13,Ks=32,ke=46,Xt=44,Ws=39,Gs=34,Yt=40,nt=41,Zt=91,Mn=93,Ln=63,Js=59,_o=58,Fo=123,en=125,_e=43,tn=45,Vn=96,qo=47,In=92,zo=new Set([2,3]),Xo={"=":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},Qs={"=>":2,...Xo,"||":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},Yo=Object.keys(Xo),Xs=new Set(Yo),Dn=new Set(["=>"]);Yo.forEach(t=>Dn.add(t));var Ko={true:!0,false:!1,null:null},Ys="this",ot="Expected ",Fe="Unexpected ",Hn="Unclosed ",Zs=ot+":",Wo=ot+"expression",ei="missing }",ti=Fe+"object property",ni=Hn+"(",Go=ot+"comma",Jo=Fe+"token ",oi=Fe+"period",Pn=ot+"expression after ",ri="missing unaryOp argument",si=Hn+"[",ii=ot+"exponent (",ai="Variable names cannot start with a number (",ci=Hn+'quote after "',mt=t=>t>=48&&t<=57,Qo=t=>Qs[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}z(e){return e>=65&&e<=90||e>=97&&e<=122||e===36||e===95||e>=128}fe(e){return this.z(e)||mt(e)}i(e){return new Error(`${e} at character ${this.e}`)}g(){let e=this.h,n=this.u,o=this.e;for(;e===Ks||e===Fs||e===qs||e===zs;)e=n.charCodeAt(++o);this.e=o}parse(){let e=this.de();return e.length===1?e[0]:{type:0,body:e}}de(e){let n=[];for(;this.e<this.u.length;){let o=this.h;if(o===Js||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(Fe+'"'+this.H+'"')}}}return n}S(){let e=this.Dt()??this.$e();return this.g(),this.Ut(e)}me(){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.fe(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.W(),!s||(n=this.me(),!n))return s;if(r={value:n,prec:Qo(n),right_a:Dn.has(n)},a=this.W(),!a)throw this.i(Pn+n);let u=[s,r,a];for(;n=this.me();){o=Qo(n),r={value:n,prec:o,right_a:Dn.has(n)},c=n;let l=p=>r.right_a&&p.right_a?o>p.prec:o<=p.prec;for(;u.length>2&&l(u[u.length-2]);)a=u.pop(),n=u.pop().value,s=u.pop(),e=this._e(n,s,a),u.push(e);if(e=this.W(),!e)throw this.i(Pn+c);u.push(r,e)}for(i=u.length-1,e=u[i];i>1;)e=this._e(u[i-1].value,u[i-2],e),i-=2;return e}W(){let e;if(this.g(),e=this.Bt(),e)return this.ye(e);let n=this.h;if(mt(n)||n===ke)return this.Ht();if(n===Ws||n===Gs)e=this.jt();else if(n===Zt)e=this.$t();else{let o=this._t();if(o){let r=this.W();if(!r)throw this.i(ri);return this.ye({type:7,operator:o,argument:r})}this.z(n)?(e=this.he(),e.name in Ko?e={type:4,value:Ko[e.name],raw:e.name}:e.name===Ys&&(e={type:5})):n===Yt&&(e=this.Ft())}return e?(e=this.G(e),this.ye(e)):!1}_e(e,n,o){if(e==="=>"){let r=n.type===1?n.expressions:[n];return{type:15,params:r,body:o}}return Xs.has(e)?{type:16,operator:e,left:n,right:o}:{type:8,operator:e,left:n,right:o}}Bt(){let e={node:!1};return this.qt(e),e.node||(this.Kt(e),e.node)||(this.zt(e),e.node)||(this.Fe(e),e.node)||this.Wt(e),e.node}ye(e){let n={node:e};return this.Gt(n),this.Jt(n),this.Qt(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===_e?(this.e++,"+"):o===110&&r===101&&s===119&&!this.fe(a)?(this.e+=3,"new"):!1}Dt(){let e={};return this.Xt(e),e.node}Ut(e){let n={node:e};return this.Yt(n),n.node}G(e){this.g();let n=this.h;for(;n===ke||n===Zt||n===Yt||n===Ln;){let o;if(n===Ln){if(this.u.charCodeAt(this.e+1)!==ke)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(si);this.e++}else n===Yt?e={type:6,arguments:this.qe(nt),callee:e}:(o&&this.e--,this.g(),e={type:3,computed:!1,object:e,property:this.he()});o&&(e.optional=!0),this.g(),n=this.h}return e}Ht(){let e=this.u,n=this.e,o=n;for(;mt(e.charCodeAt(o));)o++;if(e.charCodeAt(o)===ke)for(o++;mt(e.charCodeAt(o));)o++;let r=e.charCodeAt(o);if(r===101||r===69){o++;let i=e.charCodeAt(o);(i===_e||i===tn)&&o++;let c=o;for(;mt(e.charCodeAt(o));)o++;if(c===o){this.e=o;let u=e.slice(n,o);throw this.i(ii+u+this.H+")")}}this.e=o;let s=e.slice(n,o),a=e.charCodeAt(o);if(this.z(a))throw this.i(ai+s+this.H+")");if(a===ke||s.length===1&&s.charCodeAt(0)===ke)throw this.i(oi);return{type:4,value:parseFloat(s),raw:s}}jt(){let e=this.u,n=e.length,o=this.e,r=e.charCodeAt(this.e++),s=this.e,a=s,i=[],c=!1,u=!1;for(;s<n;){let p=e.charCodeAt(s);if(p===r){u=!0,this.e=s+1;break}if(p===In){c||(c=!0),i.push(e.slice(a,s));let m=e.charCodeAt(s+1);i.push(this.Ke(m)),s+=2,a=s}else s++}let l=c?i.join("")+e.slice(a,u?s:n):e.slice(a,u?s:n);if(!u)throw this.e=s,this.i(ci+l+'"');return{type:4,value:l,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)}}he(){let e=this.h,n=this.e;if(this.z(e))this.e++;else throw this.i(Fe+this.H);for(;this.e<this.u.length&&(e=this.h,this.fe(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===nt&&r&&r>=n.length)throw this.i(Jo+String.fromCharCode(e));break}else if(s===Xt){if(this.e++,r++,r!==n.length){if(e===nt)throw this.i(Jo+",");for(let a=n.length;a<r;a++)n.push(null)}}else{if(n.length!==r&&r!==0)throw this.i(Go);{let a=this.S();if(!a||a.type===0)throw this.i(Go);n.push(a)}}}if(!o)throw this.i(ot+String.fromCharCode(e));return n}Ft(){this.e++;let e=this.de(nt);if(this.f(nt))return this.e++,e.length===1?e[0]:e.length?{type:1,expressions:e}:!1;throw this.i(ni)}$t(){return this.e++,{type:9,elements:this.qe(Mn)}}qt(e){if(this.f(Fo)){this.e++;let n=[];for(;!isNaN(this.h);){if(this.g(),this.f(en)){this.e++,e.node=this.G({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(ti);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(ei)}}Kt(e){let n=this.h;if((n===_e||n===tn)&&n===this.u.charCodeAt(this.e+1)){this.e+=2;let o=e.node={type:13,operator:n===_e?"++":"--",argument:this.G(this.he()),prefix:!0};if(!o.argument||!zo.has(o.argument.type))throw this.i(Fe+o.operator)}}Jt(e){let n=e.node,o=this.h;if((o===_e||o===tn)&&o===this.u.charCodeAt(this.e+1)){if(!zo.has(n.type))throw this.i(Fe+(o===_e?"++":"--"));this.e+=2,e.node={type:13,operator:o===_e?"++":"--",argument:n,prefix:!1}}}zt(e){this.u.charCodeAt(this.e)===ke&&this.u.charCodeAt(this.e+1)===ke&&this.u.charCodeAt(this.e+2)===ke&&(this.e+=3,e.node={type:14,argument:this.S()})}Yt(e){if(e.node&&this.f(Ln)){this.e++;let n=e.node,o=this.S();if(!o)throw this.i(Wo);if(this.g(),this.f(_o)){this.e++;let r=this.S();if(!r)throw this.i(Wo);e.node={type:11,test:n,consequent:o,alternate:r}}else throw this.i(Zs)}}Xt(e){if(this.g(),this.f(Yt)){let n=this.e;if(this.e++,this.g(),this.f(nt)){this.e++;let o=this.me();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}}Qt(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,u=l=>{if(!c){let h=n.slice(s,this.e);return r.quasis.push({type:18,value:{raw:h,cooked:h},tail:l})}a.push(n.slice(s,this.e)),i.push(n.slice(s,this.e));let p=a.join(""),m=i.join("");return a.length=0,i.length=0,c=!1,r.quasis.push({type:18,value:{raw:p,cooked:m},tail:l})};for(;this.e<o;){let l=n.charCodeAt(this.e);if(l===Vn)return u(!0),this.e+=1,e.node=r,r;if(l===36&&n.charCodeAt(this.e+1)===Fo){if(u(!1),this.e+=2,r.expressions.push(...this.de(en)),!this.f(en))throw this.i("unclosed ${");this.e+=1,s=this.e}else if(l===In){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 `")}Gt(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}Wt(e){if(!this.f(qo))return;let n=++this.e,o=!1;for(;this.e<this.u.length;){if(this.h===qo&&!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.G(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")}},Zo=t=>new Un(t).parse();var ui={"=>":(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},li={"-":t=>-t,"+":t=>+t,"!":t=>!t,"~":t=>~t,new:t=>t},or=t=>{if(!t?.some(nr))return t;let e=[];return t.forEach(n=>nr(n)?e.push(...n):e.push(n)),e},er=(...t)=>or(t),Bn=(t,e)=>{if(!t)return e;let n=Object.create(e??{});return n.$event=t,n},pi={"++":(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]--}},tr={"=":(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)=>K(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(A(o[r]),o);for(let a of this.l)if(r in a)return this.A=a[r],nn(A(a[r]),a);let s=this.ze;if(s&&r in s)return this.A=s[r],nn(A(s[r]),s)}5(e,n,o){return this.l[0]}0(e,n,o){return this.Ye(n,o,er,...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.ge(e,n,o),a=r?.[s];return this.A=a,nn(A(a),r)}4(e,n,o){return e.value}6(e,n,o){let r=(a,...i)=>K(a)?a(...or(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,li[e.operator],e.argument)}8(e,n,o){let r=ui[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,er,...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=l=>l?.type!==15,a=this.Ge??(()=>!1),i=n===0&&this.Qe,c=l=>this.Ze(i,e.key,n,Bn(l,o)),u=l=>this.Ze(i,e.value,n,Bn(l,o));if(e.shorthand){let l=e.key.name;r[l]=s(e.key)&&a(l,n)?c:c()}else if(e.computed){let l=A(c());r[l]=s(e.value)&&a(l,n)?u:u()}else{let l=e.key.type===4?e.key.value:e.key.name;r[l]=s(e.value)&&a(l,n)?()=>u:u()}return r}ge(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?pi:fi;if(r.type===2){let i=r.name,c=this.Xe(i,o);return de(c)?void 0:a[s](c,i)}if(r.type===3){let{obj:i,key:c}=this.ge(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(de(i))return;let c=this.b(e.right,n,o);return tr[s](i,a,c)}if(r.type===3){let{obj:a,key:i}=this.ge(r,n,o),c=this.b(e.right,n,o);return tr[s](a,i,c)}}14(e,n,o){let r=this.b(e.argument,n,o);return R(r)&&(r.s=rr),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=A(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)?u=>this.b(i,e,Bn(u,n)):this.b(i,e,n)));return o(...a)}},rr=Symbol("s"),nr=t=>t?.s===rr,sr=(t,e,n,o,r,s,a)=>new jn(e,n,o,r,a).eval(t,s);var ir={},ar=t=>!!t,on=class{l;o;constructor(e,n){this.l=e,this.o=n}v(e){this.l=[e,...this.l]}te(){return this.l.map(n=>n.components).filter(ar).reverse().reduce((n,o)=>{for(let[r,s]of Object.entries(o))n[r.toUpperCase()]=s;return n},{})}lt(){let e=[],n=new Set,o=this.l.map(r=>r.components).filter(ar).reverse();for(let r of o)for(let s of Object.keys(r))n.has(s)||(n.add(s),e.push(s));return e}N(e,n,o,r,s){let a=[],i=[],c=new Set,u=()=>{for(let v=0;v<i.length;++v)i[v]();i.length=0},m={value:()=>a,stop:()=>{u(),c.clear()},subscribe:(v,w)=>(c.add(v),w&&v(a),()=>{c.delete(v)}),refs:[],context:this.l[0]};if(H(e))return m;let h=this.o.globalContext,d=[],f=new Set,C=(v,w,_,J)=>{try{let I=sr(v,w,h,n,o,J,r);return _&&I.refs.length>0&&d.push(...I.refs),{value:I.value,refs:I.refs,ref:I.ref}}catch(I){U(6,`evaluation error: ${e}`,I)}return{value:void 0,refs:[]}};try{let v=ir[e]??Zo("["+e+"]");ir[e]=v;let w=this.l.slice(),_=v.elements,J=_.length,I=new Array(J);m.refs=I;let Y=()=>{d.length=0,s||(f.clear(),u());let re=new Array(J);for(let N=0;N<J;++N){let fe=_[N];if(n?.(N,-1)){re[N]=V=>C(fe,w,!1,{$event:V}).value;continue}let b=C(fe,w,!0);re[N]=b.value,I[N]=b.ref}if(!s)for(let N of d)f.has(N)||(f.add(N),i.push(oe(N,Y)));if(a=re,c.size!==0)for(let N of c)c.has(N)&&N(a)};Y()}catch(v){U(6,`parse error: ${e}`,v)}return m}L(){return this.l.slice()}tt=[];pe(e){this.tt.push(this.l),this.l=e}E(e,n){try{this.pe(e),n()}finally{this.Zt()}}Zt(){this.l=this.tt.pop()??[]}};var cr=t=>{let e=t.charCodeAt(0);return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||t==="-"||t==="_"||t===":"},mi=(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},di=(t,e)=>{let n=e?2:1;for(;n<t.length&&(t[n]===" "||t[n]===`
3
- `);)++n;if(n>=t.length||!cr(t[n]))return null;let o=n;for(;n<t.length&&cr(t[n]);)++n;return{start:o,end:n}},ur=new Set(["table","thead","tbody","tfoot"]),hi=new Set(["thead","tbody","tfoot"]),yi=new Set(["caption","colgroup","thead","tbody","tfoot","tr"]),gi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),lr=(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 C=t.indexOf("-->",s+4);if(C===-1){n.push(t.slice(s));break}n.push(t.slice(s,C+3)),e=C+3;continue}let a=mi(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 l=di(i,c);if(!l){n.push(i),e=a+1;continue}let p=i.slice(l.start,l.end);if(c){let C=o[o.length-1];C?(o.pop(),n.push(C.replacementHost?`</${C.replacementHost}>`:i),ur.has(C.effectiveTag)&&--r):n.push(i),e=a+1;continue}let m=i.charCodeAt(i.length-2)===47,h=o[o.length-1],d=null;r===0?p==="tr"?d="trx":p==="td"?d="tdx":p==="th"&&(d="thx"):hi.has(h?.effectiveTag??"")?d=p==="tr"?null:"tr":h?.effectiveTag==="table"?d=yi.has(p)?null:"tr":h?.effectiveTag==="tr"&&(d=p==="td"||p==="th"?null:"td");let f=m&&!gi.has(d||p);if(d){let C=d==="trx"||d==="tdx"||d==="thx",v=`${i.slice(0,l.start)}${d} is="${C?`r-${p}`:`regor:${p}`}"${i.slice(l.end)}`;n.push(f?lr(v,d):v)}else n.push(f?lr(i,p):i);if(!m){let C=d==="trx"?"tr":d==="tdx"?"td":d==="thx"?"th":d||p;o.push({replacementHost:d,effectiveTag:C}),ur.has(C)&&++r}e=a+1}return n.join("")};var bi="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",xi=new Set(bi.toUpperCase().split(",")),Ti="http://www.w3.org/2000/svg",pr=(t,e)=>{he(t)?t.content.appendChild(e):t.appendChild(e)},$n=(t,e,n,o)=>{let r=t.t;if(r){let a=n&&xi.has(r.toUpperCase())?document.createElementNS(Ti,r.toLowerCase()):document.createElement(r),i=t.a;if(i)for(let u of Object.entries(i)){let l=u[0],p=u[1];l.startsWith("#")&&(p=l.substring(1),l="name"),a.setAttribute(At(l,o),p)}let c=t.c;if(c)for(let u of c)$n(u,a,n,o);pr(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)pr(e,a);else throw new Error("unsupported node type.")}},qe=(t,e,n)=>{n??=pe.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)=>{W(e)&&(e={selector:"#app",template:e}),uo(t)&&(t=t.context);let o=e.element?e.element:e.selector?document.querySelector(e.selector):null;if(!o||!ve(o))throw B(0);n||(n=pe.getDefault());let r=()=>{for(let i of[...o.childNodes])z(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=qe(e.json,e.isSVG,n);r(),s(i.childNodes)}return n.useInterpolation&&Qt(o,n),new _n(t,o,n).y(),$(o,()=>{Me(t)}),Nt(t),{context:t,unmount:()=>{z(o)},unbind:()=>{ge(o)}}},_n=class{en;nt;o;m;r;constructor(e,n,o){this.en=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 rt=t=>{if(R(t))return t.map(r=>rt(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=we(t);return o.length>0&&(e.c=[...o].map(r=>rt(r))),e};var mr=(t,e={})=>{R(e)&&(e={props:e}),W(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=qe(t.json,t.isSVG,e.config),o=!0);t.element||(t.element=document.createDocumentFragment()),(e.useInterpolation??!0)&&Qt(t.element,e.config??pe.getDefault());let r=t.element;if(!o&&((t.isSVG??(ut(r)&&r.hasAttribute?.("isSVG")))||ut(r)&&r.querySelector("[isSVG]"))){let s=r.content,a=s?[...s.childNodes]:[...r.childNodes],i=rt(a);t.element=qe(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 dr=t=>{Ue()?.onMounted.push(t)};var hr=t=>{let e,n={},o=(...r)=>{if(r.length<=2&&0 in r)throw B(4);return e&&!n.isStopped?e(...r):(e=Ci(t,n),e(...r))};return o[Z]=1,Pe(o,!0),o.stop=()=>n.ref?.stop?.(),te(()=>o.stop(),!0),o},Ci=(t,e)=>{let n=e.ref??se(null);e.ref=n,e.isStopped=!1;let o=0,r=$e(()=>{if(o>0){r(),e.isStopped=!0,X(n);return}n(t()),++o});return n.stop=r,n};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[Z]=1,Pe(r,!0),r.stop=()=>n.ref?.stop?.(),te(()=>r.stop(),!0),r},Ei=(t,e,n)=>{let o=n.ref??se(null);n.ref=o,n.isStopped=!1;let r=0,s=i=>{if(r>0){o.stop(),n.isStopped=!0,X(o);return}let c=t.map(u=>u());o(e(...c)),++r},a=[];for(let i of t){let c=oe(i,s);a.push(c)}return s(null),o.stop=()=>{a.forEach(i=>{i()})},o};var gr=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw B(4);return o&&!n.isStopped?o(...s):(o=vi(t,e,n),o(...s))};return r[Z]=1,Pe(r,!0),r.stop=()=>n.ref?.stop?.(),te(()=>r.stop(),!0),r},vi=(t,e,n)=>{let o=n.ref??se(null);n.ref=o,n.isStopped=!1;let r=0;return o.stop=oe(t,s=>{if(r>0){o.stop(),n.isStopped=!0,X(o);return}o(e(s)),++r},!0),o};var br=t=>(t[xt]=1,t);var xr=(t,e)=>{if(!e)throw B(5);let o=je(t)?Ce:i=>i,r=()=>localStorage.setItem(e,JSON.stringify(ie(t()))),s=localStorage.getItem(e);if(s!=null)try{t(o(JSON.parse(s)))}catch(i){U(6,`persist: failed to parse data for key ${e}`,i),r()}else r();let a=$e(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},Tr=an,Cr=an;var Er=(t,e,n)=>{let o=[],r=()=>{e(t.map(a=>a()))};for(let a of t)o.push(oe(a,r));n&&r();let s=()=>{for(let a of o)a()};return te(s,!0),s};var vr=t=>{if(!x(t))throw B(3,"observerCount");return t(void 0,void 0,2)};var Rr=t=>{Fn();try{t()}finally{qn()}},Fn=()=>{Te.stack||(Te.stack=[]),Te.stack.push(new Set)},qn=()=>{let t=Te.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 Te.stack;for(let n of e)try{X(n)}catch(o){console.error(o)}};return Or(Ri);})();
1
+ "use strict";var Regor=(()=>{var un=Object.defineProperty;var wr=Object.getOwnPropertyDescriptor;var Sr=Object.getOwnPropertyNames;var Ar=Object.prototype.hasOwnProperty;var kr=(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 Sr(e))!Ar.call(t,r)&&r!==n&&un(t,r,{get:()=>e[r],enumerable:!(o=wr(e,r))||o.enumerable});return t};var Or=t=>Nr(un({},"__esModule",{value:!0}),t);var Ri={};kr(Ri,{ComponentHead:()=>We,ContextRegistry:()=>sn,RegorConfig:()=>pe,addUnbinder:()=>$,batch:()=>Rr,collectRefs:()=>Lt,computeMany:()=>yr,computeRef:()=>gr,computed:()=>hr,createApp:()=>fr,defineComponent:()=>mr,drainUnbind:()=>Wn,endBatch:()=>qn,entangle:()=>Ye,flatten:()=>ie,getBindData:()=>Ve,html:()=>an,isDeepRef:()=>je,isRaw:()=>Ze,isRef:()=>x,markRaw:()=>br,observe:()=>oe,observeMany:()=>Er,observerCount:()=>vr,onMounted:()=>dr,onUnmounted:()=>te,pause:()=>Wt,persist:()=>xr,pval:()=>eo,raw:()=>Tr,ref:()=>Ce,removeNode:()=>z,resume:()=>Gt,silence:()=>Mt,sref:()=>se,startBatch:()=>Fn,svg:()=>Cr,toFragment:()=>qe,toJsonTemplate:()=>rt,trigger:()=>X,unbind:()=>ge,unref:()=>A,useScope:()=>Ot,warningHandler:()=>He,watchEffect:()=>$e});var ze=Symbol(":regor");var ge=t=>{let e=[t];for(let n=0;n<e.length;++n){let o=e[n];Mr(o);for(let r=o.lastChild;r!=null;r=r.previousSibling)e.push(r)}},Mr=t=>{let e=t[ze];if(!e)return;let n=e.unbinders;for(let o=0;o<n.length;++o)n[o]();n.length=0,t[ze]=void 0};var Ke=[],dt=!1,ht,Kn=()=>{if(dt=!1,ht=void 0,Ke.length!==0){for(let t=0;t<Ke.length;++t)ge(Ke[t]);Ke.length=0}},z=t=>{t.remove(),Ke.push(t),dt||(dt=!0,ht=setTimeout(Kn,1))},Wn=async()=>{Ke.length===0&&!dt||(ht&&clearTimeout(ht),Kn())};var K=t=>typeof t=="function",W=t=>typeof t=="string",Gn=t=>typeof t>"u",de=t=>t==null||typeof t>"u",U=t=>typeof t!="string"||!t?.trim(),Lr=Object.prototype.toString,ln=t=>Lr.call(t),Oe=t=>ln(t)==="[object Map]",le=t=>ln(t)==="[object Set]",pn=t=>ln(t)==="[object Date]",st=t=>typeof t=="symbol",R=Array.isArray,M=t=>t!==null&&typeof t=="object";var Jn={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=Jn[t];return new Error(K(n)?n.call(Jn,...e):n)};var yt=[],Qn=()=>{let t={onMounted:[],onUnmounted:[]};return yt.push(t),t},Ue=t=>{let e=yt[yt.length-1];if(!e&&!t)throw B(2);return e},Xn=t=>{let e=Ue();return t&&mn(t),yt.pop(),e},fn=Symbol("csp"),mn=t=>{let e=t,n=e[fn];if(n){let o=Ue();if(n===o)return;o.onMounted.length>0&&n.onMounted.push(...o.onMounted),o.onUnmounted.length>0&&n.onUnmounted.push(...o.onUnmounted);return}e[fn]=Ue()},gt=t=>t[fn];var Me=t=>{gt(t)?.onUnmounted?.forEach(n=>{n()}),t.unmounted?.()};var Yn={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]})},H=(t,...e)=>{let n=Yn[t],o=K(n)?n.call(Yn,...e):n,r=He.warning;r&&(W(o)?r(o):r(o,...o.args))},He={warning:console.warn};var bt=Symbol("ref"),Z=Symbol("sref"),xt=Symbol("raw");var x=t=>t!=null&&t[Z]===1;var Le=class extends Error{propPath;detail;constructor(e,n){super(n),this.name="PropValidationError",this.propPath=e,this.detail=n}},xe=(t,e)=>{throw new Le(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"},Vr=t=>t.length>60?`${t.slice(0,57)}...`:t,it=(t,e=0)=>{if(e>1)return"unknown";if(x(t)){let s=t();return`ref(${it(s,e+1)})`}if(typeof t=="string")return Vr(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=>it(a,e+1)).join(", ");return t.length>5?`[${s}, ...]`:`[${s}]`}if(M(t)){let s=Object.entries(t).slice(0,5);if(s.length===0)return"{}";let a=s.map(([i,c])=>{let u=it(c,e+1);return`${i}: ${u}`}).join(", ");return Object.keys(t).length>5?`{ ${a}, ... }`:`{ ${a} }`}return"unknown"},ue=t=>{if(x(t))return`got ${Tt(t)}(${it(t())})`;let e=Tt(t),n=it(t);return`got ${e} (${n})`},Ir=t=>t instanceof Le?t.detail:t instanceof Error?t.message:String(t),Zn=(t,e)=>{let n=`, ${ue(e)}.`;return t.endsWith(n)?t.slice(0,-n.length):t},Pr=(t,e,n)=>{if(e instanceof Le){if(e.propPath===t)return Zn(e.detail,n);if(e.propPath===`${t}.value`&&x(n)){let o=Zn(e.detail,n());return o.startsWith("expected ")?`expected ref<${o.slice(9)}>`:`expected ref where ${o}`}}return Ir(e)},Dr=(t,e,n)=>{let o=[];for(let r of e){let s=Pr(t,r,n);o.includes(s)||o.push(s)}return o.length===0?ue(n):o.length===1?`${o[0]}, ${ue(n)}`:`${o.join(" or ")}, ${ue(n)}`},Ur=t=>typeof t=="string"?`"${t}"`:typeof t=="number"||typeof t=="boolean"?String(t):t===null?"null":t===void 0?"undefined":Tt(t),Hr=(t,e)=>{typeof t!="string"&&xe(e,`expected string, ${ue(t)}`)},Br=(t,e)=>{typeof t!="number"&&xe(e,`expected number, ${ue(t)}`)},jr=(t,e)=>{typeof t!="boolean"&&xe(e,`expected boolean, ${ue(t)}`)},$r=t=>(e,n)=>{e instanceof t||xe(n,`expected instance of ${t.name||"provided class"}, ${ue(e)}`)},_r=t=>(e,n,o)=>{e!==void 0&&t(e,n,o)},Fr=t=>(e,n,o)=>{e!==null&&t(e,n,o)},qr=(...t)=>(e,n,o)=>{let r=[];for(let s of t)try{s(e,n,o);return}catch(a){r.push(a)}xe(n,Dr(n,r,e))},zr=t=>(e,n)=>{t.includes(e)||xe(n,`expected one of ${t.map(o=>Ur(o)).join(", ")}, ${ue(e)}`)},Kr=t=>(e,n,o)=>{R(e)||xe(n,`expected array, ${ue(e)}`);let r=e;for(let s=0;s<r.length;++s)t(r[s],`${n}[${s}]`,o)};function Wr(t){return(e,n,o)=>{M(e)||xe(n,`expected object, ${ue(e)}`);let r=e;for(let s in t){let a=t[s];if(!a)continue;a(r[s],`${n}.${s}`,o)}}}var Gr=t=>(e,n,o)=>{if(x(e)){t(e(),`${n}.value`,o);return}xe(n,`expected ref, ${ue(e)}`)},eo={fail:xe,describe:ue,isString:Hr,isNumber:Br,isBoolean:jr,isClass:$r,optional:_r,nullable:Fr,or:qr,oneOf:zr,arrayOf:Kr,shape:Wr,refOf:Gr};var Jr=(t,e,n)=>{let o=t.tagName?.toLowerCase?.()||"unknown",r=n instanceof Le?n.propPath:e,s=n instanceof Le?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})},We=class{props;start;end;ctx;autoProps=!0;entangle=!0;enableSwitch=!1;onAutoPropsAssigned;J;Q;constructor(e,n,o,r,s,a){this.props=e,this.J=n,this.ctx=o,this.start=r,this.end=s,this.Q=a}emit=(e,n)=>{this.J.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.Q==="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=Jr(this.J,o,a);if(this.Q==="warn"){He.warning(i.message,i);continue}throw i}}}unmount(){let e=this.start.nextSibling,n=this.end;for(;e&&e!==n;)z(e),e=e.nextSibling;for(let o of this.ctx)Me(o)}};var Ve=t=>{let e=t,n=e[ze];if(n)return n;let o={unbinders:[],data:{}};return e[ze]=o,o};var $=(t,e)=>{Ve(t).unbinders.push(e)};var at=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={},to=1,no=t=>{let e=(to++).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])},oo=t=>Et[t],yn=()=>to!==1&&Object.keys(Et).length>0,ct="r-switch",Qr=t=>{let e=t.filter(o=>ve(o)).map(o=>[...o.querySelectorAll("[r-switch]")].map(r=>r.getAttribute(ct))),n=new Set;return e.forEach(o=>{o.forEach(r=>r&&n.add(r))}),[...n]},Ge=(t,e)=>{if(!yn())return;let n=Qr(e);n.length!==0&&(n.forEach(dn),$(t,()=>{n.forEach(hn)}))};var vt=()=>{},gn=(t,e,n,o)=>{let r=[];for(let s of t){let a=s.cloneNode(!0);n.insertBefore(a,o),r.push(a)}Ie(e,r)},bn=Symbol("r-if"),ro=Symbol("r-else"),so=t=>t[ro]===1,Rt=class{o;M;Te;X;Y;x;R;constructor(e){this.o=e,this.M=e.r.p.if,this.Te=St(e.r.p.if),this.X=e.r.p.else,this.Y=e.r.p.elseif,this.x=e.r.p.for,this.R=e.r.p.pre}rt(e,n){let o=e.parentElement;for(;o!==null&&o!==document.documentElement;){if(o.hasAttribute(n))return!0;o=o.parentElement}return!1}V(e){let n=e.hasAttribute(this.M);return n&&this.y(e),e.hasAttribute(this.o.r.p.is)||e.hasAttribute("is")||this.o.E.Z(e)||this.o.E.j(e,r=>{r.hasAttribute(this.M)&&this.y(r)}),n}ee(e){return e[bn]?!0:(e[bn]=!0,wt(e,this.Te).forEach(n=>n[bn]=!0),!1)}y(e){if(e.hasAttribute(this.R)||this.ee(e)||this.rt(e,this.x))return;let n=e.getAttribute(this.M);if(!n){H(0,this.M,e);return}e.removeAttribute(this.M),this.O(e,n)}U(e,n,o){let r=Je(e),s=e.parentNode,a=document.createComment(`__begin__ :${n}${o??""}`);s.insertBefore(a,e),Ge(a,r),r.forEach(c=>{z(c)}),e.remove(),n!=="if"&&(e[ro]=1);let i=document.createComment(`__end__ :${n}${o??""}`);return s.insertBefore(i,a.nextSibling),{nodes:r,parent:s,commentBegin:a,commentEnd:i}}Re(e,n){if(!e)return[];let o=e.nextElementSibling;if(e.hasAttribute(this.X)){e.removeAttribute(this.X);let{nodes:r,parent:s,commentBegin:a,commentEnd:i}=this.U(e,"else");return[{mount:()=>{gn(r,this.o,s,i)},unmount:()=>{Re(a,i)},isTrue:()=>!0,isMounted:!1}]}else{let r=e.getAttribute(this.Y);if(!r)return[];e.removeAttribute(this.Y);let{nodes:s,parent:a,commentBegin:i,commentEnd:c}=this.U(e,"elseif",` => ${r} `),u=this.o.m.N(r),l=u.value,p=this.Re(o,n),m=vt;return $(i,()=>{u.stop(),m(),m=vt}),m=u.subscribe(n),[{mount:()=>{gn(s,this.o,a,c)},unmount:()=>{Re(i,c)},isTrue:()=>at(l()[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.o.m.N(n),u=c.value,l=!1,p=this.o.m,m=p.L(),h=()=>{p.C(m,()=>{if(at(u()[0]))l||(gn(r,this.o,s,i),l=!0),d.forEach(v=>{v.unmount(),v.isMounted=!1});else{Re(a,i),l=!1;let v=!1;for(let w of d)!v&&w.isTrue()?(w.isMounted||(w.mount(),w.isMounted=!0),v=!0):(w.unmount(),w.isMounted=!1)}})},d=this.Re(o,h),f=vt;$(a,()=>{c.stop(),f(),f=vt}),h(),f=c.subscribe(h)}};var Je=t=>{let e=he(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},Ie=(t,e)=>{for(let n=0;n<e.length;++n){let o=e[n];o.nodeType===Node.ELEMENT_NODE&&(so(o)||t.$(o))}},wt=(t,e)=>{let n=t.querySelectorAll(e);return t.matches?.(e)?[t,...n]:n},he=t=>t instanceof HTMLTemplateElement,ve=t=>t.nodeType===Node.ELEMENT_NODE,ut=t=>t.nodeType===Node.ELEMENT_NODE,io=t=>t instanceof HTMLSlotElement,we=t=>he(t)?t.content.childNodes:t.childNodes,Re=(t,e)=>{let n=t.nextSibling;for(;n!=null&&n!==e;){let o=n.nextSibling;z(n),n=o}},ao=function(){return this()},Xr=function(t){return this(t)},Yr=()=>{throw new Error("value is readonly.")},Zr={get:ao,set:Xr,enumerable:!0,configurable:!1},es={get:ao,set:Yr,enumerable:!0,configurable:!1},Pe=(t,e)=>{Object.defineProperty(t,"value",e?es:Zr)},co=(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))},ts=/-(\w)/g,j=xn(t=>t&&t.replace(ts,(e,n)=>n?n.toUpperCase():"")),ns=/\B([A-Z])/g,Qe=xn(t=>t&&t.replace(ns,"-$1").toLowerCase()),lt=xn(t=>t&&t.charAt(0).toUpperCase()+t.slice(1));var kt={mount:()=>{}};var Xe=t=>{let e=t.trim();return e?e.split(/\s+/):[]};var Nt=t=>{gt(t)?.onMounted?.forEach(n=>{n()}),t.mounted?.()};var Tn=Symbol("scope"),Ot=t=>{try{Qn();let e=t();mn(e);let n={context:e,unmount:()=>Me(e),[Tn]:1};return n[Tn]=1,n}finally{Xn()}},uo=t=>M(t)?Tn in t:!1;var Cn={collectRefObj:!0,mount:({parseResult:t})=>({update:({values:e})=>{let n=t.context,o=e[0];if(M(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)=>{Ue(e)?.onUnmounted.push(t)};var oe=(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 Ye=(t,e)=>{if(t===e)return()=>{};let n=oe(t,r=>e(r)),o=oe(e,r=>t(r));return e(t()),()=>{n(),o()}};var Ze=t=>!!t&&t[xt]===1;var je=t=>t?.[bt]===1;var ye=[],lo=t=>{ye.length!==0&&ye[ye.length-1]?.add(t)},$e=t=>{if(!t)return()=>{};let e={stop:()=>{}};return os(t,e),te(()=>e.stop(),!0),e.stop},os=(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(ye.push(s),t(a=>n.push(a)),o)return;for(let a of[...s]){let i=oe(a,()=>{r(),$e(t)});n.push(i)}}finally{ye.pop()}},Mt=t=>{let e=ye.length,n=e>0&&ye[e-1];try{return n&&ye.push(null),t()}finally{n&&ye.pop()}},Lt=t=>{try{let e=new Set;return ye.push(e),{value:t(),refs:[...e]}}finally{ye.pop()}};var X=(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)||le(r))for(let s of r)X(s,e,!0);else if(Oe(r))for(let s of r)X(s[0],e,!0),X(s[1],e,!0);if(M(r))for(let s in r)X(r[s],e,!0)}};function rs(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}var et=(t,e,n)=>{n.forEach(function(o){let r=t[o];rs(e,o,function(...a){let i=r.apply(this,a),c=this[Z];for(let u of c)X(u);return i})})},Vt=(t,e)=>{Object.defineProperty(t,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})};var po=Array.prototype,En=Object.create(po),ss=["push","pop","shift","unshift","splice","sort","reverse"];et(po,En,ss);var fo=Map.prototype,It=Object.create(fo),is=["set","clear","delete"];Vt(It,"Map");et(fo,It,is);var mo=Set.prototype,Pt=Object.create(mo),as=["add","clear","delete"];Vt(Pt,"Set");et(mo,Pt,as);var Te={},se=t=>{if(x(t)||Ze(t))return t;let e={auto:!0,_value:t},n=c=>M(c)?Z in c?!0:R(c)?(Object.setPrototypeOf(c,En),!0):le(c)?(Object.setPrototypeOf(c,Pt),!0):Oe(c)?(Object.setPrototypeOf(c,It),!0):!1:!1,o=n(t),r=new Set,s=(c,u)=>{if(Te.stack&&Te.stack.length){Te.stack[Te.stack.length-1].add(i);return}r.size!==0&&Mt(()=>{for(let l of[...r.keys()])r.has(l)&&l(c,u)})},a=c=>{let u=c[Z];u||(c[Z]=u=new Set),u.add(i)},i=(...c)=>{if(!(2 in c)){let l=c[0],p=c[1];return 0 in c?e._value===l||x(l)&&(l=l(),e._value===l)?l:(n(l)&&a(l),e._value=l,e.auto&&s(l,p),e._value):(lo(i),e._value)}switch(c[2]){case 0:{let l=c[3];if(!l)return()=>{};let p=m=>{r.delete(m)};return r.add(l),()=>{p(l)}}case 1:{let l=c[1],p=e._value;s(p,l);break}case 2:return r.size;case 3:{e.auto=!1;break}case 4:e.auto=!0}return e._value};return i[Z]=1,Pe(i,!1),o&&a(t),i};var Ce=t=>{if(Ze(t))return t;let e;if(x(t)?(e=t,t=e()):e=se(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];je(r)||(t[o]=Ce(r))}return e}if(!M(t))return e;for(let n of Object.entries(t)){let o=n[1];if(je(o))continue;let r=n[0];st(r)||(t[r]=null,t[r]=Ce(o))}return e};var ho=Symbol("modelBridge"),Dt=()=>{},cs=t=>!!t?.[ho],us=t=>{t[ho]=1},ls=t=>{let e=Ce(t());return us(e),e},yo={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=(l,p)=>{o!==l&&(i(),s=Ye(l,p),o=l)},u=()=>{let l=t.refs[0]??t.value()[0],p=t.context,m=p[n];if(!x(l)){if(r&&m===r){r(l);return}if(a(),x(m)){m(l);return}p[n]=l;return}if(cs(l)){if(m===l)return;x(m)?c(l,m):p[n]=l;return}r||(r=ls(l)),p[n]=r,c(l,r)};return{update:()=>{u()},unmount:()=>{s()}}}};var Ut=class{o;_;Ee="";Ce=-1;constructor(e){this.o=e,this._=e.r.p.inherit}V(e){this.st(e)}it(e){if(this.Ce!==e.size){let n=[...e.keys()];this.Ee=[...n,...n.map(Qe)].join(","),this.Ce=e.size}return this.Ee}ct(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}pt(e){if(!he(e))return!1;let n=e.getAttributeNames();return e.hasAttribute("name")?!0:n.some(o=>o.startsWith("#"))}ut(e){return he(e)&&e.getAttributeNames().length===0}st(e){let n=this.o,o=n.m,r=n.r.te,s=n.r.F;if(r.size===0&&!this.ct(o.l))return;let a=o.ne(),i=this.oe();if(U(i))return;let c=this.lt(e,i);for(let u of c){if(u.hasAttribute(n.R))continue;let l=u.parentNode;if(!l)continue;let p=u.nextSibling,m=j(u.tagName).toUpperCase(),d=a[m]??s.get(m);if(!d)continue;let f=d.template;if(!f)continue;let C=u.parentElement;if(!C)continue;let v=new Comment(" begin component: "+u.tagName),w=new Comment(" end component: "+u.tagName);C.insertBefore(v,u),u.remove();let _=n.r.p.context,J=n.r.p.contextAlias,I=n.r.p.bind,Y=d.props?.map(j)??[],re=[],N=g=>g==="class"||g==="style",fe=(g,T,E=!1)=>{let D={},G=g.hasAttribute(_);return o.C(T,()=>{if(o.w(D),G?n.y(Cn,g,_):g.hasAttribute(J)&&n.y(Cn,g,J),Y.length===0)return;let k=new Map(Y.map(y=>[y.toLowerCase(),y]));for(let y of[...Y,...Y.map(Qe)]){let S=g.getAttribute(y);if(S===null)continue;let L=j(y);D[L]=S,E&&d.inheritAttrs===!0&&N(L)&&re.push({name:y,value:S}),g.removeAttribute(y)}let q=n.q.ve(g,!1);for(let[y,S]of q.entries()){let[L,ae]=S.re;if(!ae)continue;let ce=k.get(j(ae).toLowerCase());if(ce&&!(L!=="."&&L!==":"&&L!==I)){if(E&&L!=="."&&d.inheritAttrs===!0&&N(ce)){let zn=g.getAttribute(y);zn!==null&&re.push({name:y,value:zn})}n.y(yo,g,y,!0,ce,S.se)}}}),D},b=[...o.L()],V=()=>{let g=fe(u,b,!0),T=new We(g,u,b,v,w,n.r.propValidationMode),E=Ot(()=>d.context(T)??{}).context;if(T.autoProps){for(let[D,G]of Object.entries(g))if(D in E){let k=E[D];if(k===G)continue;if(x(k)){x(G)?T.entangle?$(v,Ye(G,k)):k(G()):k(G);continue}}else E[D]=G;for(let D of Y)D in E||(E[D]=void 0);T.onAutoPropsAssigned?.()}return{componentCtx:E,head:T}},{componentCtx:F,head:De}=V(),me=[...we(f)],cn=me.length,P=u.childNodes.length===0,O=g=>{let T=g.parentElement,E=g.name;if(U(E)&&(E=g.getAttributeNames().filter(k=>k.startsWith("#"))[0],U(E)?E="default":E=E.substring(1)),P){if(E==="default"){let k=n.r.p.text,q=u.getAttribute(k);if(!U(q)){let y=document.createElement("span");y.setAttribute(k,q),T.insertBefore(y,g),u.removeAttribute(k);return}}for(let k of[...g.childNodes])T.insertBefore(k,g);return}let D=u.querySelector(`template[name='${E}'], template[\\#${E}]`);!D&&E==="default"&&(D=[...u.querySelectorAll("template:not([name])")].find(q=>this.ut(q))??null);let G=k=>{De.enableSwitch&&o.C(b,()=>{o.w(F);let q=fe(g,o.L());o.C(b,()=>{o.w(q);let y=o.L(),S=no(y);for(let L of k)ve(L)&&(L.setAttribute(ct,S),dn(S),$(L,()=>{hn(S)}))})})};if(D){let k=[...we(D)];for(let q of k)T.insertBefore(q,g);G(k)}else{if(E!=="default"){for(let q of[...we(g)])T.insertBefore(q,g);return}let k=[...we(u)].filter(q=>!this.pt(q));for(let q of k)T.insertBefore(q,g);G(k)}},Q=g=>{if(!ve(g))return;let T=g.querySelectorAll("slot");if(io(g)){O(g),g.remove();return}for(let E of T)O(E),E.remove()};(()=>{for(let g=0;g<cn;++g)me[g]=me[g].cloneNode(!0),l.insertBefore(me[g],p),Q(me[g])})(),C.insertBefore(w,p);let ee=()=>{if(!d.inheritAttrs)return;let g=me.filter(y=>y.nodeType===Node.ELEMENT_NODE),E=g.flatMap(y=>[...y.hasAttribute(this._)?[y]:[],...y.querySelectorAll(`[${this._}]`)]).at(0)??(g.length===1?g[0]:void 0);if(!E)return;E.removeAttribute(this._);let D=`${I}:class`,G=`${I}:style`,k=(y,S,L)=>{let ae=E.hasAttribute(y)?y:E.hasAttribute(S)?S:y,ce=E.getAttribute(ae);E.setAttribute(ae,U(ce)?L:`${ce}, ${L}`)},q=(y,S)=>{if(y==="class"){let L=Xe(S);L.length>0&&E.classList.add(...L)}else if(y===":class"||y===D)k(":class",D,S);else if(y==="style"){let L=E.style,ae=u.style;for(let ce of ae)L.setProperty(ce,ae.getPropertyValue(ce))}else y===":style"||y===G?k(":style",G,S):E.setAttribute(At(y,n.r),S)};for(let{name:y,value:S}of re)u.setAttribute(y,S);for(let y of u.getAttributeNames())y===_||y===J||q(y,u.getAttribute(y))},Ee=()=>{for(let g of u.getAttributeNames())!g.startsWith("@")&&!g.startsWith(n.r.p.on)&&u.removeAttribute(g)},Ne=()=>{ee(),Ee(),o.w(F),n.we(u,!1),F.$emit=De.emit,Ie(n,me),$(u,()=>{Me(F)}),$(v,()=>{ge(u)}),Nt(F)};o.C(b,Ne)}}oe(){let e=this.o,n=e.m,o=e.r.te,r=n.ft(),s=this.it(o);return[...s?[s]:[],...r,...r.map(Qe)].join(",")}Z(e){let n=this.oe();return!U(n)&&e.matches?.(n)}lt(e,n){let o=[];if(U(n))return o;if(e.matches?.(n))return[e];let r=this.K(e).reverse();for(;r.length>0;){let s=r.pop();if(s.matches(n)){o.push(s);continue}r.push(...this.K(s).reverse())}return o}j(e,n){let o=this.o,r=this.oe(),s=o.r.p.is,a=this.K(e).reverse();for(;a.length>0;){let i=a.pop();n(i),!(!U(r)&&i.matches(r))&&(i.hasAttribute(s)||i.hasAttribute("is")||a.push(...this.K(i).reverse()))}}K(e){let n=e?.children;if(n?.length!=null){let r=[];for(let s=0;s<n.length;++s){let a=n[s];ve(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];ve(a)&&r.push(a)}return r}return[]}};var vn=class{re;se;Se=[];constructor(e,n){this.re=e,this.se=n}},Ht=class{o;Ae;ke;ie;constructor(e){this.o=e,this.Ae=e.r.dt(),this.ie=new Map;let n=new Map;for(let o of this.Ae){let r=o[0]??"",s=n.get(r);s?s.push(o):n.set(r,[o])}this.ke=n}Ve(e){let n=this.ie.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(/[:@]/);U(i[0])&&(i[0]=r?".":o[0]);let c=s>=0?o.slice(s+1).split("."):[],u=!1,l=!1;for(let m=0;m<c.length;++m){let h=c[m];if(!u&&h==="camel"?u=!0:!l&&h==="prop"&&(l=!0),u&&l)break}u&&(i[i.length-1]=j(i[i.length-1])),l&&(i[0]=".");let p={terms:i,flags:c};return this.ie.set(e,p),p}ve(e,n){let o=new Map;if(!ut(e))return o;let r=this.ke,s=(i,c)=>{let u=r.get(c[0]??"");if(u)for(let l=0;l<u.length;++l){if(!c.startsWith(u[l]))continue;let p=o.get(c);if(!p){let m=this.Ve(c);p=new vn(m.terms,m.flags),o.set(c,p)}p.Se.push(i);return}},a=i=>{let c=i.attributes;if(!(!c||c.length===0))for(let u=0;u<c.length;++u){let l=c.item(u)?.name;l&&s(i,l)}};return a(e),!n||!e.firstElementChild||this.o.E.j(e,a),o}};var go=()=>{},ps=(t,e)=>{for(let n of t){let o=n.cloneNode(!0);e.appendChild(o)}},Bt=class{o;I;constructor(e){this.o=e,this.I=e.r.p.is}V(e){let n=e.hasAttribute(this.I);return(n||e.hasAttribute("is"))&&this.y(e),this.o.E.Z(e)||this.o.E.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.o.$(s);return}n=`'${n.slice(6)}'`,e.removeAttribute("is")}e.removeAttribute(this.I),this.O(e,n)}U(e,n){let o=Je(e),r=e.parentNode,s=document.createComment(`__begin__ dynamic ${n??""}`);r.insertBefore(s,e),Ge(s,o),o.forEach(i=>{z(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,commentBegin:r,commentEnd:s}=this.U(e,` => ${n} `),a=this.o.m.N(n),i=a.value,c=this.o.m,u=c.L(),l={name:""},p=he(e)?o:[...o[0].childNodes],m=()=>{c.C(u,()=>{let f=i()[0];if(M(f)&&(f.name?f=f.name:f=Object.entries(c.ne()).filter(w=>w[1]===f)[0]?.[0]),!W(f)||U(f)){Re(r,s);return}if(l.name===f)return;Re(r,s);let C=s.parentNode??r.parentNode;if(!C)return;let v=document.createElement(f);for(let w of e.getAttributeNames())w!==this.I&&v.setAttribute(w,e.getAttribute(w));ps(p,v),C.insertBefore(v,s),this.o.$(v),l.name=f})},h=go;$(r,()=>{a.stop(),h(),h=go}),m(),h=a.subscribe(m)}};var A=t=>{let e=t;return e!=null&&e[Z]===1?e():e};var fs=(t,e)=>{let[n,o]=e;K(o)?o(t,n):t.innerHTML=n?.toString()},jt={mount:()=>({update:({el:t,values:e})=>{fs(t,e)}})};var $t=class t{ae;constructor(e){this.ae=e}static mt(e,n){let o=e.m,r=e.r,s=r.p,a=new Set([s.for,s.if,s.else,s.elseif,s.pre]),i=r.B,c=o.ne();if(Object.keys(c).length>0||r.F.size>0)return;let u=e.q,l=[],p=0,m=[];for(let h=n.length-1;h>=0;--h)m.push(n[h]);for(;m.length>0;){let h=m.pop();if(h.nodeType===Node.ELEMENT_NODE){let f=h;if(f.tagName==="TEMPLATE"||f.tagName.includes("-"))return;let C=j(f.tagName).toUpperCase();if(r.F.has(C)||c[C])return;let v=f.attributes;for(let w=0;w<v.length;++w){let _=v.item(w)?.name;if(!_)continue;if(a.has(_))return;let{terms:J,flags:I}=u.Ve(_),[Y,re]=J,N=i[_]??i[Y];if(N){if(N===jt)return;l.push({nodeIndex:p,attrName:_,directive:N,option:re,flags:I})}}++p}let d=h.childNodes;for(let f=d.length-1;f>=0;--f)m.push(d[f])}if(l.length!==0)return new t(l)}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.ae.length;++s){let a=this.ae[s],i=o[a.nodeIndex];i&&e.y(a.directive,i,a.attrName,!1,a.option,a.flags)}}};var ms=(t,e)=>{let n=e.parentNode;if(n)for(let o=0;o<t.items.length;++o)n.insertBefore(t.items[o],e)},ds=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 u=o[o.length-1];if(u===void 0||t[u]<c){n[i]=u??-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 yt(e){let{oldItems:n,newValues:o,getKey:r,isSameValue:s,mountNewValue:a,removeMountItem:i,endAnchor:c}=e,u=n.length,l=o.length,p=new Array(l),m=new Set;for(let b=0;b<l;++b){let V=r(o[b]);if(V===void 0||m.has(V))return;m.add(V),p[b]=V}let h=new Array(l),d=0,f=u-1,C=l-1;for(;d<=f&&d<=C;){let b=n[d];if(r(b.value)!==p[d]||!s(b.value,o[d]))break;b.value=o[d],h[d]=b,++d}for(;d<=f&&d<=C;){let b=n[f];if(r(b.value)!==p[C]||!s(b.value,o[C]))break;b.value=o[C],h[C]=b,--f,--C}if(d>f){for(let b=C;b>=d;--b){let V=b+1<l?h[b+1].items[0]:c;h[b]=a(b,o[b],V)}return h}if(d>C){for(let b=d;b<=f;++b)i(n[b]);return h}let v=d,w=d,_=C-w+1,J=new Array(_).fill(0),I=new Map;for(let b=w;b<=C;++b)I.set(p[b],b);let Y=!1,re=0;for(let b=v;b<=f;++b){let V=n[b],F=I.get(r(V.value));if(F===void 0){i(V);continue}if(!s(V.value,o[F])){i(V);continue}V.value=o[F],h[F]=V,J[F-w]=b+1,F>=re?re=F:Y=!0}let N=Y?ds(J):[],fe=N.length-1;for(let b=_-1;b>=0;--b){let V=w+b,F=V+1<l?h[V+1].items[0]:c;if(J[b]===0){h[V]=a(V,o[V],F);continue}let De=h[V];Y&&(fe>=0&&N[fe]===b?--fe:De&&ms(De,F))}return h}};var pt=class{T=[];P=new Map;get S(){return this.T.length}ce;constructor(e){this.ce=e}pe(e){let n=this.ce(e.value);n!==void 0&&this.P.set(n,e)}ue(e){let n=this.ce(this.T[e]?.value);n!==void 0&&this.P.delete(n)}static ht(e,n){return{items:[],index:e,value:n,order:-1}}w(e){e.order=this.S,this.T.push(e),this.pe(e)}gt(e,n){let o=this.S;for(let r=e;r<o;++r)this.T[r].order=r+1;n.order=e,this.T.splice(e,0,n),this.pe(n)}D(e){return this.T[e]}le(e,n){this.ue(e),this.T[e]=n,this.pe(n),n.order=e}Me(e){this.ue(e),this.T.splice(e,1);let n=this.S;for(let o=e;o<n;++o)this.T[o].order=o}Oe(e){let n=this.S;for(let o=e;o<n;++o)this.ue(o);this.T.splice(e)}nn(e){return this.P.has(e)}bt(e){return this.P.get(e)?.order??-1}};var Rn=Symbol("r-for"),hs=t=>-1,bo=()=>{},Ft=class t{o;x;Ne;R;constructor(e){this.o=e,this.x=e.r.p.for,this.Ne=St(this.x),this.R=e.r.p.pre}V(e){let n=e.hasAttribute(this.x);return n&&this.Le(e),e.hasAttribute(this.o.r.p.is)||e.hasAttribute("is")||this.o.E.Z(e)||this.o.E.j(e,r=>{r.hasAttribute(this.x)&&this.Le(r)}),n}ee(e){return e[Rn]?!0:(e[Rn]=!0,wt(e,this.Ne).forEach(n=>n[Rn]=!0),!1)}Le(e){if(e.hasAttribute(this.R)||this.ee(e))return;let n=e.getAttribute(this.x);if(!n){H(0,this.x,e);return}e.removeAttribute(this.x),this.xt(e,n)}Ie(e){return de(e)?[]:(K(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))}xt(e,n){let o=this.Tt(n);if(!o?.list){H(1,this.x,n,e);return}let r=this.o.r.p.key,s=this.o.r.p.keyBind,a=e.getAttribute(r)??e.getAttribute(s);e.removeAttribute(r),e.removeAttribute(s);let i=Je(e),c=$t.mt(this.o,i),u=e.parentNode;if(!u)return;let l=`${this.x} => ${n}`,p=new Comment(`__begin__ ${l}`);u.insertBefore(p,e),Ge(p,i),i.forEach(O=>{z(O)}),e.remove();let m=new Comment(`__end__ ${l}`);u.insertBefore(m,p.nextSibling);let h=this.o,d=h.m,f=d.L(),v=f.length===1?[void 0,f[0]]:void 0,w=this.Rt(a),_=(O,Q)=>w(O)===w(Q),J=(O,Q)=>O===Q,I=(O,Q,ne)=>{let ee=o.createContext(Q,O),Ee=pt.ht(ee.index,Q),Ne=()=>{let g=m.parentNode??p.parentNode??u,T=ne.previousSibling,E=[];for(let D=0;D<i.length;++D){let G=i[D].cloneNode(!0);g.insertBefore(G,ne),E.push(G)}for(c?c.y(h,E):Ie(h,E),T=T.nextSibling;T!==ne;)Ee.items.push(T),T=T.nextSibling};return v?(v[0]=ee.ctx,d.C(v,Ne)):d.C(f,()=>{d.w(ee.ctx),Ne()}),Ee},Y=(O,Q)=>{let ne=P.D(O).items,ee=ne[ne.length-1].nextSibling;for(let Ee of ne)z(Ee);P.le(O,I(O,Q,ee))},re=(O,Q)=>{P.w(I(O,Q,m))},N=O=>{for(let Q of P.D(O).items)z(Q)},fe=O=>{let Q=P.S;for(let ne=O;ne<Q;++ne)P.D(ne).index(ne)},b=O=>{let Q=p.parentNode,ne=m.parentNode;if(!Q||!ne)return;let ee=P.S;K(O)&&(O=O());let Ee=A(O[0]);if(R(Ee)&&Ee.length===0){Re(p,m),P.Oe(0);return}let Ne=[];for(let y of this.Ie(O[0]))Ne.push(y);let g=_t.yt({oldItems:P.T,newValues:Ne,getKey:w,isSameValue:J,mountNewValue:(y,S,L)=>I(y,S,L),removeMountItem:y=>{for(let S=0;S<y.items.length;++S)z(y.items[S])},endAnchor:m});if(g){P.T=g,P.P.clear();for(let y=0;y<g.length;++y){let S=g[y];S.order=y,S.index(y);let L=w(S.value);L!==void 0&&P.P.set(L,S)}return}let T=0,E=Number.MAX_SAFE_INTEGER,D=ee,G=this.o.r.forGrowThreshold,k=()=>P.S<D+G;for(let y of Ne){let S=()=>{if(T<ee){let L=P.D(T++);if(_(L.value,y)){if(J(L.value,y))return;Y(T-1,y);return}let ae=P.bt(w(y));if(ae>=T&&ae-T<10){if(--T,E=Math.min(E,T),N(T),P.Me(T),--ee,ae>T+1)for(let ce=T;ce<ae-1&&ce<ee&&!_(P.D(T).value,y);)++ce,N(T),P.Me(T),--ee;S();return}k()?(P.gt(T-1,I(T,y,P.D(T-1).items[0])),E=Math.min(E,T-1),++ee):Y(T-1,y)}else re(T++,y)};S()}let q=T;for(ee=P.S;T<ee;)N(T++);P.Oe(q),fe(E)},V=()=>{F.stop(),me(),me=bo},F=d.N(o.list),De=F.value,me=bo,cn=0,P=new pt(w);for(let O of this.Ie(De()[0]))P.w(I(cn++,O,m));$(p,V),me=F.subscribe(b)}static Et=/\{?\[?\(?([^)}\]]+)\)?\]?\}?([^)]+)?\s+\b(?:in|of)\b\s+(.*)\s*$/;Tt(e){let n=t.Et.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,u)=>{let l={},p=A(c);if(!i&&o.length===1)l[o[0]]=c;else if(R(p)){let h=0;for(let d of o)l[d]=p[h++]}else for(let h of o)l[h]=p[h];let m={ctx:l,index:hs};return s&&(m.index=l[s.startsWith("#")?s.substring(1):s]=se(u)),m}}}Rt(e){if(!e)return o=>o;let n=e.trim();if(!n)return o=>o;if(n.includes(".")){let o=this.Ct(n),r=o.length>1?o.slice(1):void 0;return s=>{let a=A(s),i=this.Pe(a,o);return i!==void 0||!r?i:this.Pe(a,r)}}return o=>A(A(o)?.[n])}Ct(e){return e.split(".").filter(n=>n.length>0)}Pe(e,n){let o=e;for(let r of n)o=A(o)?.[r];return A(o)}};var qt=class{fe=0;de=new Map;m;De;Ue;Be;E;q;r;R;He;constructor(e){this.m=e,this.r=e.r,this.Ue=new Ft(this),this.De=new Rt(this),this.Be=new Bt(this),this.E=new Ut(this),this.q=new Ht(this),this.R=this.r.p.pre,this.He=this.r.p.dynamic}vt(e){let n=he(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);Ie(this,a)}}$(e){++this.fe;try{if(e.nodeType!==Node.ELEMENT_NODE||e.hasAttribute(this.R)||this.De.V(e)||this.Ue.V(e)||this.Be.V(e))return;this.E.V(e),this.vt(e),this.we(e,!0)}finally{--this.fe,this.fe===0&&this.wt()}}St(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)}je(e,n){let o=this.St(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,()=>{z(e)}),o.appendChild(e),!0}At(e,n){this.de.set(e,n)}wt(){let e=this.de;if(e.size!==0){this.de=new Map;for(let[n,o]of e.entries())this.je(n,o)}}we(e,n){let o=this.q.ve(e,n),r=this.r.B;for(let[s,a]of o.entries()){let[i,c]=a.re,u=r[s]??r[i];if(!u){console.error("directive not found:",i);continue}let l=a.Se;for(let p=0;p<l.length;++p){let m=l[p];this.y(u,m,s,!1,c,a.se)}}}y(e,n,o,r,s,a){if(n.hasAttribute(this.R))return;let i=n.getAttribute(o);n.removeAttribute(o);let c=u=>{let l=u;for(;l;){let p=l.getAttribute(ct);if(p)return p;l=l.parentElement}return null};if(yn()){let u=c(n);if(u){this.m.C(oo(u),()=>{this.O(e,n,i,s,a)});return}}this.O(e,n,i,s,a)}kt(e,n,o){return e!==kt?!1:(U(o)||this.je(n,o)||this.At(n,o),!0)}O(e,n,o,r,s){if(n.nodeType!==Node.ELEMENT_NODE||o==null||this.kt(e,n,o))return;let a=this.Vt(r,e.once),i=this.Mt(e,o),c=this.Ot(i,a);$(n,c.stop);let u=this.Nt(n,o,i,a,r,s),l=this.Lt(e,u,c);if(!l)return;let p=this.It(u,i,a,r,l);p(),e.once||(c.result=i.subscribe(p),a&&(c.dynamic=a.subscribe(p)))}Vt(e,n){let o=co(e,this.He);if(o)return this.m.N(j(o),void 0,void 0,void 0,n)}Mt(e,n){return this.m.N(n,e.isLazy,e.isLazyKey,e.collectRefObj,e.once)}Ot(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}}Lt(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}It(e,n,o,r,s){let a,i;return()=>{let c=n.value(),u=o?o.value()[0]:r;e.values=c,e.previousValues=a,e.option=u,e.previousOption=i,a=c,i=u,s(e)}}};var xo="http://www.w3.org/1999/xlink",ys={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 gs(t){return!!t||t===""}var bs=(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 u=n?.[i]?.[0],l=c[0],p=c[1];zt(t,l,p,u)}else if(M(c))for(let u of Object.entries(c)){let l=u[0],p=u[1],m=n?.[i],h=m&&l in m?l:void 0;zt(t,l,p,h)}else{let u=n?.[i],l=e[i++],p=e[i];zt(t,l,p,u)}}},wn={mount:()=>({update:({el:t,values:e,previousValues:n,option:o,previousOption:r,flags:s})=>{bs(t,e,n,o,r,s)}})},zt=(t,e,n,o)=>{if(o&&o!==e&&t.removeAttribute(o),de(e)){H(3,"r-bind",t);return}if(!W(e)){H(6,`Attribute key is not string at ${t.outerHTML}`,e);return}if(e.startsWith("xlink:")){de(n)?t.removeAttributeNS(xo,e.slice(6,e.length)):t.setAttributeNS(xo,e,n);return}let r=e in ys;de(n)||r&&!gs(n)?t.removeAttribute(e):t.setAttribute(e,r?"":n)};var xs=(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)To(t,s[c],a?.[c])}else To(t,s,a)}},Sn={mount:()=>({update:({el:t,values:e,previousValues:n})=>{xs(t,e,n)}})},To=(t,e,n)=>{let o=A(e),r=A(n),s=t.classList,a=W(o),i=W(r);if(o&&!a){let c=o;if(r&&!i){let u=r;for(let l in u)(!(l in c)||!A(c[l]))&&s.remove(l)}for(let u in c)A(c[u])&&s.add(u)}else if(a){if(r!==o){let c=i?Xe(r):[],u=Xe(o);c.length>0&&s.remove(...c),u.length>0&&s.add(...u)}}else if(r){let c=i?Xe(r):[];c.length>0&&s.remove(...c)}};function Ts(t,e){if(t.length!==e.length)return!1;let n=!0;for(let o=0;n&&o<t.length;o++)n=Se(t[o],e[o]);return n}function Se(t,e){if(t===e)return!0;let n=pn(t),o=pn(e);if(n||o)return n&&o?t.getTime()===e.getTime():!1;if(n=st(t),o=st(e),n||o)return t===e;if(n=R(t),o=R(e),n||o)return n&&o?Ts(t,e):!1;if(n=M(t),o=M(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||!Se(t[a],e[a]))return!1}return!0}return String(t)===String(e)}function Kt(t,e){return t.findIndex(n=>Se(n,e))}var Co=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 vo={mount:({el:t,parseResult:e,flags:n})=>({update:({values:o})=>{Cs(t,o[0])},unmount:Es(t,e,n)})},Cs=(t,e)=>{let n=Ao(t);if(n&&Ro(t))R(e)?e=Kt(e,Ae(t))>-1:le(e)?e=e.has(Ae(t)):e=ks(t,e),t.checked=e;else if(n&&wo(t))t.checked=Se(e,Ae(t));else if(n||ko(t))So(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=Ae(i);if(s)R(e)?i.selected=Kt(e,c)>-1:i.selected=e.has(c);else if(Se(Ae(i),e)){t.selectedIndex!==a&&(t.selectedIndex=a);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}else H(7,t)},ft=t=>(x(t)&&(t=t()),K(t)&&(t=t()),t?W(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",wo=t=>t.type==="radio",So=t=>t.type==="number"||t.type==="range",Ao=t=>t.tagName==="INPUT",ko=t=>t.tagName==="TEXTAREA",No=t=>t.tagName==="SELECT",Es=(t,e,n)=>{let o=e.value,r=ft(n?.join(",")),s=ft(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 H(8,t),()=>{};let i=()=>e.refs[0],c=Ao(t);return c&&Ro(t)?Rs(t,i):c&&wo(t)?Ns(t,i):c||ko(t)?vs(t,a,i,o):No(t)?Os(t,i,o):(H(7,t),()=>{})},Eo=/[.,' ·٫]/,vs=(t,e,n,o)=>{let s=e.lazy?"change":"input",a=So(t),i=()=>{!e.trim&&!ft(o()[1]).trim||(t.value=t.value.trim())},c=m=>{let h=m.target;h.composing=1},u=m=>{let h=m.target;h.composing&&(h.composing=0,h.dispatchEvent(new Event(s)))},l=()=>{t.removeEventListener(s,p),t.removeEventListener("change",i),t.removeEventListener("compositionstart",c),t.removeEventListener("compositionend",u),t.removeEventListener("change",u)},p=m=>{let h=n();if(!h)return;let d=m.target;if(!d||d.composing)return;let f=d.value,C=ft(o()[1]);if(a||C.number||C.int){if(C.int)f=parseInt(f);else{if(Eo.test(f[f.length-1])&&f.split(Eo).length===2){if(f+="0",f=parseFloat(f),isNaN(f))f="";else if(h()===f)return}f=parseFloat(f)}isNaN(f)&&(f=""),t.value=f}else C.trim&&(f=f.trim());h(f)};return t.addEventListener(s,p),t.addEventListener("change",i),t.addEventListener("compositionstart",c),t.addEventListener("compositionend",u),t.addEventListener("change",u),l},Rs=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let a=Ae(t),i=t.checked,c=s();if(R(c)){let u=Kt(c,a),l=u!==-1;i&&!l?c.push(a):!i&&l&&c.splice(u,1)}else le(c)?i?c.add(a):c.delete(a):s(As(t,i))};return t.addEventListener(n,r),o},Ae=t=>"_value"in t?t._value:t.value,Oo="trueValue",ws="falseValue",Mo="true-value",Ss="false-value",As=(t,e)=>{let n=e?Oo:ws;if(n in t)return t[n];let o=e?Mo:Ss;return t.hasAttribute(o)?t.getAttribute(o):e},ks=(t,e)=>{if(Oo in t)return Se(e,t.trueValue);let o=Mo;return t.hasAttribute(o)?Se(e,t.getAttribute(o)):Se(e,!0)},Ns=(t,e)=>{let n="change",o=()=>{t.removeEventListener(n,r)},r=()=>{let s=e();if(!s)return;let a=Ae(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=ft(n()[1]).number,u=Array.prototype.filter.call(t.options,l=>l.selected).map(l=>c?Co(Ae(l)):Ae(l));if(t.multiple){let l=a();try{if(Wt(a),le(l)){l.clear();for(let p of u)l.add(p)}else R(l)?(l.splice(0),l.push(...u)):a(u)}finally{Gt(a),X(a)}}else a(u[0])};return t.addEventListener(o,s),r};var Ms=["stop","prevent","capture","self","once","left","right","middle","passive"],Ls=t=>{let e={};if(U(t))return;let n=t.split(",");for(let o of Ms)e[o]=n.includes(o);return e},Vs=(t,e,n,o,r)=>{if(o){let u=e.value(),l=A(o.value()[0]);return W(l)?An(t,j(l),()=>e.value()[0],r?.join(",")??u[1]):()=>{}}else if(n){let u=e.value();return An(t,j(n),()=>e.value()[0],r?.join(",")??u[1])}let s=[],a=()=>{s.forEach(u=>u())},i=e.value(),c=i.length;for(let u=0;u<c;++u){let l=i[u];if(K(l)&&(l=l()),M(l))for(let p of Object.entries(l)){let m=p[0],h=()=>{let f=e.value()[u];return K(f)&&(f=f()),f=f[m],K(f)&&(f=f()),f},d=l[m+"_flags"];s.push(An(t,m,h,d))}else H(2,"r-on",t)}return a},kn={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})=>Vs(t,e,n,o,r)},Is=(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=u=>!(r&&!u.ctrlKey||s&&!u.shiftKey||a&&!u.altKey||i&&!u.metaKey);return o?[t,u=>c(u)?u.key.toUpperCase()===o.toUpperCase():!1]:[t,c]}return[t,n=>!0]},An=(t,e,n,o)=>{if(U(e))return H(5,"r-on",t),()=>{};let r=Ls(o),s=r?{capture:r.capture,passive:r.passive,once:r.once}:void 0,a;[e,a]=Is(e,o);let i=l=>{if(!a(l)||!n&&e==="submit"&&r?.prevent)return;let p=n(l);K(p)&&(p=p(l)),K(p)&&p(l)},c=()=>{t.removeEventListener(e,u,s)},u=l=>{if(!r){i(l);return}try{if(r.left&&l.button!==0||r.middle&&l.button!==1||r.right&&l.button!==2||r.self&&l.target!==t)return;r.stop&&l.stopPropagation(),r.prevent&&l.preventDefault(),i(l)}finally{r.once&&c()}};return t.addEventListener(e,u,s),c};var Ps=(t,e,n,o)=>{if(n){o&&o.includes("camel")&&(n=j(n)),tt(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];tt(t,i,c)}else if(M(a))for(let i of Object.entries(a)){let c=i[0],u=i[1];tt(t,c,u)}else{let i=e[s++],c=e[s];tt(t,i,c)}}},Lo={mount:()=>({update:({el:t,values:e,option:n,flags:o})=>{Ps(t,e,n,o)}})};function Ds(t){return!!t||t===""}var tt=(t,e,n)=>{if(de(e)){H(3,":prop",t);return}if(e==="innerHTML"||e==="textContent"){let s=[...t.childNodes];setTimeout(()=>s.forEach(ge),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=Ds(n):n==null&&s==="string"?(n="",r=!0):s==="number"&&(n=0,r=!0)}try{t[e]=n}catch(s){r||H(4,e,o,n,s)}r&&t.removeAttribute(e)};var Vo={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 Us=(t,e)=>{let n=Ve(t).data,o=n._ord;Gn(o)&&(o=n._ord=t.style.display),at(e[0])?t.style.display=o:t.style.display="none"},Io={mount:()=>({update:({el:t,values:e})=>{Us(t,e)}})};var Hs=(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)Po(t,s[c],a?.[c])}else Po(t,s,a)}},Jt={mount:()=>({update:({el:t,values:e,previousValues:n})=>{Hs(t,e,n)}})},Po=(t,e,n)=>{let o=A(e),r=A(n),s=t.style,a=W(o);if(o&&!a){let i=o;if(r&&!W(r)){let c=r;for(let u in c)A(i[u])==null&&On(s,u,"")}for(let c in i)On(s,c,i[c])}else{let i=s.display;if(a?r!==o&&(s.cssText=o):r&&t.removeAttribute("style"),"_ord"in Ve(t).data)return;s.display=i}},Do=/\s*!important$/;function On(t,e,n){let o=A(n);if(R(o))o.forEach(r=>{On(t,e,r)});else{let r=o==null?"":String(o);if(e.startsWith("--"))t.setProperty(e,r);else{let s=Bs(t,e);Do.test(r)?t.setProperty(Qe(s),r.replace(Do,""),"important"):t[s]=r}}}var Uo=["Webkit","Moz","ms"],Nn={};function Bs(t,e){let n=Nn[e];if(n)return n;let o=j(e);if(o!=="filter"&&o in t)return Nn[e]=o;o=lt(o);for(let r=0;r<Uo.length;r++){let s=Uo[r]+o;if(s in t)return Nn[e]=s}return e}var ie=t=>Ho(A(t)),Ho=(t,e=new WeakMap)=>{if(!t||!M(t))return t;if(R(t))return t.map(ie);if(le(t)){let o=new Set;for(let r of t.keys())o.add(ie(r));return o}if(Oe(t)){let o=new Map;for(let r of t)o.set(ie(r[0]),ie(r[1]));return o}if(e.has(t))return A(e.get(t));let n={...t};e.set(t,n);for(let o of Object.entries(n))n[o[0]]=Ho(A(o[1]),e);return n};var js=(t,e)=>{let n=e[0];t.textContent=le(n)?JSON.stringify(ie([...n])):Oe(n)?JSON.stringify(ie([...n])):M(n)?JSON.stringify(ie(n)):n?.toString()??""},Bo={mount:()=>({update:({el:t,values:e})=>{js(t,e)}})};var jo={mount:()=>({update:({el:t,values:e})=>{tt(t,"value",e[0])}})};var pe=class t{static getDefault(){return t.$e??(t.$e=new t)}B={};p={};dt=()=>Object.keys(this.B).filter(e=>e.length===1||!e.startsWith(":"));te=new Map;F=new Map;static $e;static Pt="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.Dt()}Dt(){let e={},n=globalThis;for(let o of t.Pt.split(","))e[o]=n[o];return e.ref=Ce,e.sref=se,e.flatten=ie,e}addComponent(...e){for(let n of e){if(!n.defaultName){He.warning("Registered component's default name is not defined",n);continue}this.te.set(lt(n.defaultName),n),this.F.set(lt(n.defaultName).toLocaleUpperCase(),n)}}setDirectives(e){this.B={".":Lo,":":wn,"@":kn,[`${e}on`]:kn,[`${e}bind`]:wn,[`${e}html`]:jt,[`${e}text`]:Bo,[`${e}show`]:Io,[`${e}model`]:vo,":style":Jt,[`${e}style`]:Jt,[`${e}bind:style`]:Jt,":class":Sn,[`${e}bind:class`]:Sn,":ref":Vo,":value":jo,[`${e}teleport`]:kt},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??pe.getDefault()).p,r=/(\{\{[^]*?\}\}|\[\[[^]*?\]\])/g,s=[{start:"{{",end:"}}"},{start:"[[",end:"]]"}];for(let a of _s(t,o.pre,s))$s(a,o.text,r,s)},$s=(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],u=$o(c,o);if(u&&U(a[0])&&U(a[2])){let l=t.parentElement;l.setAttribute(e,c.substring(u.start.length,c.length-u.end.length)),l.innerText="";return}}let i=document.createDocumentFragment();for(let c of a){let u=$o(c,o);if(u){let l=document.createElement("span");l.setAttribute(e,c.substring(u.start.length,c.length-u.end.length)),i.appendChild(l)}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 we(s))r(a)}};return r(t),o},$o=(t,e)=>e.find(n=>t.startsWith(n.start)&&t.endsWith(n.end));var Fs=9,qs=10,zs=13,Ks=32,ke=46,Xt=44,Ws=39,Gs=34,Yt=40,nt=41,Zt=91,Mn=93,Ln=63,Js=59,_o=58,Fo=123,en=125,_e=43,tn=45,Vn=96,qo=47,In=92,zo=new Set([2,3]),Xo={"=":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},Qs={"=>":2,...Xo,"||":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},Yo=Object.keys(Xo),Xs=new Set(Yo),Dn=new Set(["=>"]);Yo.forEach(t=>Dn.add(t));var Ko={true:!0,false:!1,null:null},Ys="this",ot="Expected ",Fe="Unexpected ",Hn="Unclosed ",Zs=ot+":",Wo=ot+"expression",ei="missing }",ti=Fe+"object property",ni=Hn+"(",Go=ot+"comma",Jo=Fe+"token ",oi=Fe+"period",Pn=ot+"expression after ",ri="missing unaryOp argument",si=Hn+"[",ii=ot+"exponent (",ai="Variable names cannot start with a number (",ci=Hn+'quote after "',mt=t=>t>=48&&t<=57,Qo=t=>Qs[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}z(e){return e>=65&&e<=90||e>=97&&e<=122||e===36||e===95||e>=128}me(e){return this.z(e)||mt(e)}i(e){return new Error(`${e} at character ${this.e}`)}g(){let e=this.h,n=this.u,o=this.e;for(;e===Ks||e===Fs||e===qs||e===zs;)e=n.charCodeAt(++o);this.e=o}parse(){let e=this.ye();return e.length===1?e[0]:{type:0,body:e}}ye(e){let n=[];for(;this.e<this.u.length;){let o=this.h;if(o===Js||o===Xt)this.e++;else{let r=this.A();if(r)n.push(r);else if(this.e<this.u.length){if(o===e)break;throw this.i(Fe+'"'+this.H+'"')}}}return n}A(){let e=this.Ut()??this._e();return this.g(),this.Bt(e)}he(){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.me(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.W(),!s||(n=this.he(),!n))return s;if(r={value:n,prec:Qo(n),right_a:Dn.has(n)},a=this.W(),!a)throw this.i(Pn+n);let u=[s,r,a];for(;n=this.he();){o=Qo(n),r={value:n,prec:o,right_a:Dn.has(n)},c=n;let l=p=>r.right_a&&p.right_a?o>p.prec:o<=p.prec;for(;u.length>2&&l(u[u.length-2]);)a=u.pop(),n=u.pop().value,s=u.pop(),e=this.Fe(n,s,a),u.push(e);if(e=this.W(),!e)throw this.i(Pn+c);u.push(r,e)}for(i=u.length-1,e=u[i];i>1;)e=this.Fe(u[i-1].value,u[i-2],e),i-=2;return e}W(){let e;if(this.g(),e=this.Ht(),e)return this.ge(e);let n=this.h;if(mt(n)||n===ke)return this.jt();if(n===Ws||n===Gs)e=this.$t();else if(n===Zt)e=this._t();else{let o=this.Ft();if(o){let r=this.W();if(!r)throw this.i(ri);return this.ge({type:7,operator:o,argument:r})}this.z(n)?(e=this.be(),e.name in Ko?e={type:4,value:Ko[e.name],raw:e.name}:e.name===Ys&&(e={type:5})):n===Yt&&(e=this.qt())}return e?(e=this.G(e),this.ge(e)):!1}Fe(e,n,o){if(e==="=>"){let r=n.type===1?n.expressions:[n];return{type:15,params:r,body:o}}return Xs.has(e)?{type:16,operator:e,left:n,right:o}:{type:8,operator:e,left:n,right:o}}Ht(){let e={node:!1};return this.Kt(e),e.node||(this.zt(e),e.node)||(this.Wt(e),e.node)||(this.qe(e),e.node)||this.Gt(e),e.node}ge(e){let n={node:e};return this.Jt(n),this.Qt(n),this.Xt(n),n.node}Ft(){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===_e?(this.e++,"+"):o===110&&r===101&&s===119&&!this.me(a)?(this.e+=3,"new"):!1}Ut(){let e={};return this.Yt(e),e.node}Bt(e){let n={node:e};return this.Zt(n),n.node}G(e){this.g();let n=this.h;for(;n===ke||n===Zt||n===Yt||n===Ln;){let o;if(n===Ln){if(this.u.charCodeAt(this.e+1)!==ke)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.A()},this.g(),n=this.h,n!==Mn)throw this.i(si);this.e++}else n===Yt?e={type:6,arguments:this.Ke(nt),callee:e}:(o&&this.e--,this.g(),e={type:3,computed:!1,object:e,property:this.be()});o&&(e.optional=!0),this.g(),n=this.h}return e}jt(){let e=this.u,n=this.e,o=n;for(;mt(e.charCodeAt(o));)o++;if(e.charCodeAt(o)===ke)for(o++;mt(e.charCodeAt(o));)o++;let r=e.charCodeAt(o);if(r===101||r===69){o++;let i=e.charCodeAt(o);(i===_e||i===tn)&&o++;let c=o;for(;mt(e.charCodeAt(o));)o++;if(c===o){this.e=o;let u=e.slice(n,o);throw this.i(ii+u+this.H+")")}}this.e=o;let s=e.slice(n,o),a=e.charCodeAt(o);if(this.z(a))throw this.i(ai+s+this.H+")");if(a===ke||s.length===1&&s.charCodeAt(0)===ke)throw this.i(oi);return{type:4,value:parseFloat(s),raw:s}}$t(){let e=this.u,n=e.length,o=this.e,r=e.charCodeAt(this.e++),s=this.e,a=s,i=[],c=!1,u=!1;for(;s<n;){let p=e.charCodeAt(s);if(p===r){u=!0,this.e=s+1;break}if(p===In){c||(c=!0),i.push(e.slice(a,s));let m=e.charCodeAt(s+1);i.push(this.ze(m)),s+=2,a=s}else s++}let l=c?i.join("")+e.slice(a,u?s:n):e.slice(a,u?s:n);if(!u)throw this.e=s,this.i(ci+l+'"');return{type:4,value:l,raw:e.substring(o,this.e)}}ze(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)}}be(){let e=this.h,n=this.e;if(this.z(e))this.e++;else throw this.i(Fe+this.H);for(;this.e<this.u.length&&(e=this.h,this.me(e));)this.e++;return{type:2,name:this.u.slice(n,this.e)}}Ke(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===nt&&r&&r>=n.length)throw this.i(Jo+String.fromCharCode(e));break}else if(s===Xt){if(this.e++,r++,r!==n.length){if(e===nt)throw this.i(Jo+",");for(let a=n.length;a<r;a++)n.push(null)}}else{if(n.length!==r&&r!==0)throw this.i(Go);{let a=this.A();if(!a||a.type===0)throw this.i(Go);n.push(a)}}}if(!o)throw this.i(ot+String.fromCharCode(e));return n}qt(){this.e++;let e=this.ye(nt);if(this.f(nt))return this.e++,e.length===1?e[0]:e.length?{type:1,expressions:e}:!1;throw this.i(ni)}_t(){return this.e++,{type:9,elements:this.Ke(Mn)}}Kt(e){if(this.f(Fo)){this.e++;let n=[];for(;!isNaN(this.h);){if(this.g(),this.f(en)){this.e++,e.node=this.G({type:10,properties:n});return}let o=this.A();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.A();if(!r)throw this.i(ti);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(ei)}}zt(e){let n=this.h;if((n===_e||n===tn)&&n===this.u.charCodeAt(this.e+1)){this.e+=2;let o=e.node={type:13,operator:n===_e?"++":"--",argument:this.G(this.be()),prefix:!0};if(!o.argument||!zo.has(o.argument.type))throw this.i(Fe+o.operator)}}Qt(e){let n=e.node,o=this.h;if((o===_e||o===tn)&&o===this.u.charCodeAt(this.e+1)){if(!zo.has(n.type))throw this.i(Fe+(o===_e?"++":"--"));this.e+=2,e.node={type:13,operator:o===_e?"++":"--",argument:n,prefix:!1}}}Wt(e){this.u.charCodeAt(this.e)===ke&&this.u.charCodeAt(this.e+1)===ke&&this.u.charCodeAt(this.e+2)===ke&&(this.e+=3,e.node={type:14,argument:this.A()})}Zt(e){if(e.node&&this.f(Ln)){this.e++;let n=e.node,o=this.A();if(!o)throw this.i(Wo);if(this.g(),this.f(_o)){this.e++;let r=this.A();if(!r)throw this.i(Wo);e.node={type:11,test:n,consequent:o,alternate:r}}else throw this.i(Zs)}}Yt(e){if(this.g(),this.f(Yt)){let n=this.e;if(this.e++,this.g(),this.f(nt)){this.e++;let o=this.he();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}}Xt(e){let n=e.node,o=n.type;(o===2||o===3)&&this.f(Vn)&&(e.node={type:17,tag:n,quasi:this.qe(e)})}qe(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,u=l=>{if(!c){let h=n.slice(s,this.e);return r.quasis.push({type:18,value:{raw:h,cooked:h},tail:l})}a.push(n.slice(s,this.e)),i.push(n.slice(s,this.e));let p=a.join(""),m=i.join("");return a.length=0,i.length=0,c=!1,r.quasis.push({type:18,value:{raw:p,cooked:m},tail:l})};for(;this.e<o;){let l=n.charCodeAt(this.e);if(l===Vn)return u(!0),this.e+=1,e.node=r,r;if(l===36&&n.charCodeAt(this.e+1)===Fo){if(u(!1),this.e+=2,r.expressions.push(...this.ye(en)),!this.f(en))throw this.i("unclosed ${");this.e+=1,s=this.e}else if(l===In){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.ze(p)),this.e+=2,s=this.e}else this.e+=1}throw this.i("Unclosed `")}Jt(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}Gt(e){if(!this.f(qo))return;let n=++this.e,o=!1;for(;this.e<this.u.length;){if(this.h===qo&&!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.G(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")}},Zo=t=>new Un(t).parse();var ui={"=>":(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},li={"-":t=>-t,"+":t=>+t,"!":t=>!t,"~":t=>~t,new:t=>t},or=t=>{if(!t?.some(nr))return t;let e=[];return t.forEach(n=>nr(n)?e.push(...n):e.push(n)),e},er=(...t)=>or(t),Bn=(t,e)=>{if(!t)return e;let n=Object.create(e??{});return n.$event=t,n},pi={"++":(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]--}},tr={"=":(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)=>K(t)?t.bind(e):t,jn=class{l;We;Ge;Je;k;Qe;Xe;constructor(e,n,o,r,s){this.l=R(e)?e:[e],this.We=n,this.Ge=o,this.Je=r,this.Xe=!!s}Ye(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.k=o[r],nn(A(o[r]),o);for(let a of this.l)if(r in a)return this.k=a[r],nn(A(a[r]),a);let s=this.We;if(s&&r in s)return this.k=s[r],nn(A(s[r]),s)}5(e,n,o){return this.l[0]}0(e,n,o){return this.Ze(n,o,er,...e.body)}1(e,n,o){return this.v(n,o,(...r)=>r.pop(),...e.expressions)}3(e,n,o){let{obj:r,key:s}=this.xe(e,n,o),a=r?.[s];return this.k=a,nn(A(a),r)}4(e,n,o){return e.value}6(e,n,o){let r=(a,...i)=>K(a)?a(...or(i)):a,s=this.v(++n,o,r,e.callee,...e.arguments);return this.k=s,s}7(e,n,o){return this.v(n,o,li[e.operator],e.argument)}8(e,n,o){let r=ui[e.operator];switch(e.operator){case"||":case"&&":case"??":return r(()=>this.b(e.left,n,o),()=>this.b(e.right,n,o))}return this.v(n,o,r,e.left,e.right)}9(e,n,o){return this.Ze(++n,o,er,...e.elements)}10(e,n,o){let r={},s=(...a)=>{a.forEach(i=>{Object.assign(r,i)})};return this.v(++n,o,s,...e.properties),r}11(e,n,o){return this.v(n,o,r=>this.b(r?e.consequent:e.alternate,n,o),e.test)}12(e,n,o){let r={},s=l=>l?.type!==15,a=this.Je??(()=>!1),i=n===0&&this.Xe,c=l=>this.et(i,e.key,n,Bn(l,o)),u=l=>this.et(i,e.value,n,Bn(l,o));if(e.shorthand){let l=e.key.name;r[l]=s(e.key)&&a(l,n)?c:c()}else if(e.computed){let l=A(c());r[l]=s(e.value)&&a(l,n)?u:u()}else{let l=e.key.type===4?e.key.value:e.key.name;r[l]=s(e.value)&&a(l,n)?()=>u:u()}return r}xe(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?pi:fi;if(r.type===2){let i=r.name,c=this.Ye(i,o);return de(c)?void 0:a[s](c,i)}if(r.type===3){let{obj:i,key:c}=this.xe(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.Ye(a,o);if(de(i))return;let c=this.b(e.right,n,o);return tr[s](i,a,c)}if(r.type===3){let{obj:a,key:i}=this.xe(r,n,o),c=this.b(e.right,n,o);return tr[s](a,i,c)}}14(e,n,o){let r=this.b(e.argument,n,o);return R(r)&&(r.s=rr),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.v(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.v(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=A(this[e.type](e,n,o));return this.Qe=e.type,r}et(e,n,o,r){let s=this.b(n,o,r);return e&&this.tt()?this.k:s}tt(){let e=this.Qe;return(e===2||e===3||e===6)&&x(this.k)}eval(e,n){let{value:o,refs:r}=Lt(()=>this.b(e,-1,n)),s={value:o,refs:r};return this.tt()&&(s.ref=this.k),s}v(e,n,o,...r){let s=r.map(a=>a&&this.b(a,e,n));return o(...s)}Ze(e,n,o,...r){let s=this.Ge;if(!s)return this.v(e,n,o,...r);let a=r.map((i,c)=>i&&(i.type!==15&&s(c,e)?u=>this.b(i,e,Bn(u,n)):this.b(i,e,n)));return o(...a)}},rr=Symbol("s"),nr=t=>t?.s===rr,sr=(t,e,n,o,r,s,a)=>new jn(e,n,o,r,a).eval(t,s);var ir={},ar=t=>!!t,on=class{l;r;constructor(e,n){this.l=e,this.r=n}w(e){this.l=[e,...this.l]}ne(){return this.l.map(n=>n.components).filter(ar).reverse().reduce((n,o)=>{for(let[r,s]of Object.entries(o))n[r.toUpperCase()]=s;return n},{})}ft(){let e=[],n=new Set,o=this.l.map(r=>r.components).filter(ar).reverse();for(let r of o)for(let s of Object.keys(r))n.has(s)||(n.add(s),e.push(s));return e}N(e,n,o,r,s){let a=[],i=[],c=new Set,u=()=>{for(let v=0;v<i.length;++v)i[v]();i.length=0},m={value:()=>a,stop:()=>{u(),c.clear()},subscribe:(v,w)=>(c.add(v),w&&v(a),()=>{c.delete(v)}),refs:[],context:this.l[0]};if(U(e))return m;let h=this.r.globalContext,d=[],f=new Set,C=(v,w,_,J)=>{try{let I=sr(v,w,h,n,o,J,r);return _&&I.refs.length>0&&d.push(...I.refs),{value:I.value,refs:I.refs,ref:I.ref}}catch(I){H(6,`evaluation error: ${e}`,I)}return{value:void 0,refs:[]}};try{let v=ir[e]??Zo("["+e+"]");ir[e]=v;let w=this.l.slice(),_=v.elements,J=_.length,I=new Array(J);m.refs=I;let Y=()=>{d.length=0,s||(f.clear(),u());let re=new Array(J);for(let N=0;N<J;++N){let fe=_[N];if(n?.(N,-1)){re[N]=V=>C(fe,w,!1,{$event:V}).value;continue}let b=C(fe,w,!0);re[N]=b.value,I[N]=b.ref}if(!s)for(let N of d)f.has(N)||(f.add(N),i.push(oe(N,Y)));if(a=re,c.size!==0)for(let N of c)c.has(N)&&N(a)};Y()}catch(v){H(6,`parse error: ${e}`,v)}return m}L(){return this.l.slice()}nt=[];le(e){this.nt.push(this.l),this.l=e}C(e,n){try{this.le(e),n()}finally{this.en()}}en(){this.l=this.nt.pop()??[]}};var cr=t=>{let e=t.charCodeAt(0);return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||t==="-"||t==="_"||t===":"},mi=(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},di=(t,e)=>{let n=e?2:1;for(;n<t.length&&(t[n]===" "||t[n]===`
3
+ `);)++n;if(n>=t.length||!cr(t[n]))return null;let o=n;for(;n<t.length&&cr(t[n]);)++n;return{start:o,end:n}},ur=new Set(["table","thead","tbody","tfoot"]),hi=new Set(["thead","tbody","tfoot"]),yi=new Set(["caption","colgroup","thead","tbody","tfoot","tr"]),gi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),lr=(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 C=t.indexOf("-->",s+4);if(C===-1){n.push(t.slice(s));break}n.push(t.slice(s,C+3)),e=C+3;continue}let a=mi(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 l=di(i,c);if(!l){n.push(i),e=a+1;continue}let p=i.slice(l.start,l.end);if(c){let C=o[o.length-1];C?(o.pop(),n.push(C.replacementHost?`</${C.replacementHost}>`:i),ur.has(C.effectiveTag)&&--r):n.push(i),e=a+1;continue}let m=i.charCodeAt(i.length-2)===47,h=o[o.length-1],d=null;r===0?p==="tr"?d="trx":p==="td"?d="tdx":p==="th"&&(d="thx"):hi.has(h?.effectiveTag??"")?d=p==="tr"?null:"tr":h?.effectiveTag==="table"?d=yi.has(p)?null:"tr":h?.effectiveTag==="tr"&&(d=p==="td"||p==="th"?null:"td");let f=m&&!gi.has(d||p);if(d){let C=d==="trx"||d==="tdx"||d==="thx",v=`${i.slice(0,l.start)}${d} is="${C?`r-${p}`:`regor:${p}`}"${i.slice(l.end)}`;n.push(f?lr(v,d):v)}else n.push(f?lr(i,p):i);if(!m){let C=d==="trx"?"tr":d==="tdx"?"td":d==="thx"?"th":d||p;o.push({replacementHost:d,effectiveTag:C}),ur.has(C)&&++r}e=a+1}return n.join("")};var bi="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",xi=new Set(bi.toUpperCase().split(",")),Ti="http://www.w3.org/2000/svg",pr=(t,e)=>{he(t)?t.content.appendChild(e):t.appendChild(e)},$n=(t,e,n,o)=>{let r=t.t;if(r){let a=n&&xi.has(r.toUpperCase())?document.createElementNS(Ti,r.toLowerCase()):document.createElement(r),i=t.a;if(i)for(let u of Object.entries(i)){let l=u[0],p=u[1];l.startsWith("#")&&(p=l.substring(1),l="name"),a.setAttribute(At(l,o),p)}let c=t.c;if(c)for(let u of c)$n(u,a,n,o);pr(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)pr(e,a);else throw new Error("unsupported node type.")}},qe=(t,e,n)=>{n??=pe.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)=>{W(e)&&(e={selector:"#app",template:e}),uo(t)&&(t=t.context);let o=e.element?e.element:e.selector?document.querySelector(e.selector):null;if(!o||!ve(o))throw B(0);n||(n=pe.getDefault());let r=()=>{for(let i of[...o.childNodes])z(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=qe(e.json,e.isSVG,n);r(),s(i.childNodes)}return n.useInterpolation&&Qt(o,n),new _n(t,o,n).y(),$(o,()=>{Me(t)}),Nt(t),{context:t,unmount:()=>{z(o)},unbind:()=>{ge(o)}}},_n=class{tn;ot;r;m;o;constructor(e,n,o){this.tn=e,this.ot=n,this.r=o,this.m=new on([e],o),this.o=new qt(this.m)}y(){this.o.$(this.ot)}};var rt=t=>{if(R(t))return t.map(r=>rt(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=we(t);return o.length>0&&(e.c=[...o].map(r=>rt(r))),e};var mr=(t,e={})=>{R(e)&&(e={props:e}),W(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=qe(t.json,t.isSVG,e.config),o=!0);t.element||(t.element=document.createDocumentFragment()),(e.useInterpolation??!0)&&Qt(t.element,e.config??pe.getDefault());let r=t.element;if(!o&&((t.isSVG??(ut(r)&&r.hasAttribute?.("isSVG")))||ut(r)&&r.querySelector("[isSVG]"))){let s=r.content,a=s?[...s.childNodes]:[...r.childNodes],i=rt(a);t.element=qe(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 dr=t=>{Ue()?.onMounted.push(t)};var hr=t=>{let e,n={},o=(...r)=>{if(r.length<=2&&0 in r)throw B(4);return e&&!n.isStopped?e(...r):(e=Ci(t,n),e(...r))};return o[Z]=1,Pe(o,!0),o.stop=()=>n.ref?.stop?.(),te(()=>o.stop(),!0),o},Ci=(t,e)=>{let n=e.ref??se(null);e.ref=n,e.isStopped=!1;let o=0,r=$e(()=>{if(o>0){r(),e.isStopped=!0,X(n);return}n(t()),++o});return n.stop=r,n};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[Z]=1,Pe(r,!0),r.stop=()=>n.ref?.stop?.(),te(()=>r.stop(),!0),r},Ei=(t,e,n)=>{let o=n.ref??se(null);n.ref=o,n.isStopped=!1;let r=0,s=i=>{if(r>0){o.stop(),n.isStopped=!0,X(o);return}let c=t.map(u=>u());o(e(...c)),++r},a=[];for(let i of t){let c=oe(i,s);a.push(c)}return s(null),o.stop=()=>{a.forEach(i=>{i()})},o};var gr=(t,e)=>{let n={},o,r=(...s)=>{if(s.length<=2&&0 in s)throw B(4);return o&&!n.isStopped?o(...s):(o=vi(t,e,n),o(...s))};return r[Z]=1,Pe(r,!0),r.stop=()=>n.ref?.stop?.(),te(()=>r.stop(),!0),r},vi=(t,e,n)=>{let o=n.ref??se(null);n.ref=o,n.isStopped=!1;let r=0;return o.stop=oe(t,s=>{if(r>0){o.stop(),n.isStopped=!0,X(o);return}o(e(s)),++r},!0),o};var br=t=>(t[xt]=1,t);var xr=(t,e)=>{if(!e)throw B(5);let o=je(t)?Ce:i=>i,r=()=>localStorage.setItem(e,JSON.stringify(ie(t()))),s=localStorage.getItem(e);if(s!=null)try{t(o(JSON.parse(s)))}catch(i){H(6,`persist: failed to parse data for key ${e}`,i),r()}else r();let a=$e(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},Tr=an,Cr=an;var Er=(t,e,n)=>{let o=[],r=()=>{e(t.map(a=>a()))};for(let a of t)o.push(oe(a,r));n&&r();let s=()=>{for(let a of o)a()};return te(s,!0),s};var vr=t=>{if(!x(t))throw B(3,"observerCount");return t(void 0,void 0,2)};var Rr=t=>{Fn();try{t()}finally{qn()}},Fn=()=>{Te.stack||(Te.stack=[]),Te.stack.push(new Set)},qn=()=>{let t=Te.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 Te.stack;for(let n of e)try{X(n)}catch(o){console.error(o)}};return Or(Ri);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "regor",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "A modern UI framework for web and desktop applications, inspired by Vue's concepts and powered by simplicity and flexibility.",
5
5
  "author": "Ahmed Yasin Koculu",
6
6
  "license": "MIT",