jq79 0.7.10 → 0.7.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/jq79.js CHANGED
@@ -1,20 +1,19 @@
1
- var Ls=Object.defineProperty;var Ds=(e,t,n)=>t in e?Ls(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(e,t,n)=>Ds(e,typeof t!="symbol"?t+"":t,n);function Pe(e,t){return typeof e=="string"?document.querySelector(e):e.querySelector(t)}function rt(e,t){return Array.from(typeof e=="string"?document.querySelectorAll(e):e.querySelectorAll(t))}var ot=(e,t={})=>{let n=document.createElement(e);for(let[s,r]of Object.entries(t))if(s==="className")n.className=Array.isArray(r)?r.join(" "):r;else if(s==="textContent")n.textContent=r;else if(s==="children")for(let i of r)n.appendChild(i);else n.setAttribute(s,r);return n},Is=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),Qt={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},qs=new Set(["http:","https:","mailto:"]);function Hs(e){try{let t=new URL(e,"https://example.com");return qs.has(t.protocol)}catch{return!1}}var Ws={"https:":"443","http:":"80"};function Fs(e){let t=e.trim().toLowerCase().match(/^([a-z\d*][a-z\d.*-]*?)(?::(\d{1,5}|\*))?$/);if(!t)return null;let[,n,s]=t,r=n.split(".");return r.some(o=>o!=="*"&&!/^[a-z\d-]+$/.test(o))?null:{host:new RegExp(`^${r.map(o=>o==="*"?"[^.]+":o).join("\\.")}$`),port:!s||s==="*"?null:s}}var Yt=e=>{let t=(Array.isArray(e)?e:e.split(",")).map(Fs).filter(n=>n!==null);return n=>{let s=n.hostname.toLowerCase(),r=n.port||Ws[n.protocol]||"";return t.some(i=>i.host.test(s)&&(i.port===null||i.port===r))}};function Us(e,t,n,s){try{return!!e(new URL(t,document.baseURI),n,s)}catch{return!1}}var Xt=512;function Jt(e,t,n,s){if(n>Xt)throw new RangeError(`jq79: sanitizeHTML input nests deeper than ${Xt} elements`);for(let r of Array.from(e.childNodes))if(r.nodeType===Node.ELEMENT_NODE){let i=Bs(r,n,s);i&&t.appendChild(i)}else r.nodeType===Node.TEXT_NODE&&t.appendChild(r.cloneNode())}function Bs(e,t,n){let s=e.tagName.toLowerCase();if(!Is.has(s))return null;let r=document.createElement(s);for(let i of Array.from(e.attributes)){let o=i.name.toLowerCase(),a=Qt[s]?.has(o),l=Qt["*"]?.has(o);!a&&!l||(o==="href"||o==="src")&&(!Hs(i.value)||n&&!Us(n,i.value,s,o))||r.setAttribute(o,i.value)}return s==="a"&&r.setAttribute("rel","noopener noreferrer"),Jt(e,r,t+1,n),r}function it(e,t){let n=document.createElement("template");n.innerHTML=e;let s=document.createElement("div");return Jt(n.content,s,0,t?.allowUrl),s.innerHTML}var Ks=(e,t)=>t.split(".").reduce((n,s)=>n?.[s],e),De=e=>{if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},an=(e,t,n)=>{Object.entries(e).forEach(([s,r])=>{let i=t?`${t}.${s}`:s;r&&typeof r=="object"&&De(r)?an(r,i,n):n(i,r)})},zs=(e,t)=>{e.own===null?e.own=t:e.own!==t&&(e.ownMany??(e.ownMany=new Set)).add(t)},Gs=(e,t)=>{e.deep===null?e.deep=t:e.deep!==t&&(e.deepMany??(e.deepMany=new Set)).add(t)},Vs=(e,t)=>{e.own===t?e.own=null:e.ownMany?.delete(t)&&e.ownMany.size===0&&(e.ownMany=null)},Zs=(e,t)=>{e.deep===t?e.deep=null:e.deepMany?.delete(t)&&e.deepMany.size===0&&(e.deepMany=null)},Te=(e,t)=>{e.own!==null&&t(e.own),e.ownMany?.forEach(t)},Ce=(e,t)=>{e.deep!==null&&t(e.deep),e.deepMany?.forEach(t)},en=" keys",at=e=>e?`${e}.${en}`:en,tn=".length",nn=(e,t)=>({children:null,own:null,ownMany:null,deep:null,deepMany:null,parent:e,segment:t}),Qs=e=>e.own===null&&e.deep===null&&!e.ownMany?.size&&!e.deepMany?.size&&!e.children?.size,ct=Symbol("jq79.raw"),V=e=>{let t=e;for(;t!==null&&typeof t=="object"&&t[ct];)t=t[ct];return t},ln=Symbol("jq79.store"),ge=e=>e!==null&&typeof e=="object"&&e[ln]===!0,dt=null,ue=[],Y=null,$e=e=>{ue.push(new Set);let t=Y;Y=null;try{return e()}finally{ue.pop(),Y=t}},Xs=e=>{e.adopted.forEach((t,n)=>{e.read?.has(n)||(t(),e.adopted.delete(n))})},sn=e=>{e.adopted?.forEach(t=>t()),e.adopted=null},Ys=0,lt=new Set,rn="$__attach",on="$__holds",Ie=Symbol("jq79.alsoWakenBy"),ft=Symbol("jq79.owner"),Me=e=>{let t=new Map,n=new Set,s=new Set,r=new WeakMap,i=Object.create(null),o=nn(null,""),a=(u,c)=>{let m=o;return u.split(".").forEach(h=>{let w=m.children??(m.children=new Map),g=w.get(h);g||(g=nn(m,h),w.set(h,g)),m=g}),c.deep?Gs(m,c):zs(m,c),m},l=(u,c)=>{c.deep?Zs(u,c):Vs(u,c);let m=u;for(;m?.parent&&Qs(m);)m.parent.children.delete(m.segment),m=m.parent},f=u=>{let c=o;for(let m of u.split("."))if(c=c.children?.get(m),!c)return;return c},d=u=>{let c=new Set,m=E=>{let T=E.children?[...E.children.values()]:[];for(;T.length;){let R=T.pop();Te(R,k=>c.add(k)),Ce(R,k=>c.add(k)),R.children?.forEach(k=>T.push(k))}},h=o,w=u.split("."),g="";for(let E=0;E<w.length-1;E++){if(h=h.children?.get(w[E]),!h)return c;g=g?`${g}.${w[E]}`:w[E],Ce(h,R=>c.add(R));let T=x.get(g);T&&Te(h,R=>{T.store[on](R)||c.add(R)}),E===w.length-2&&w[E+1]==="length"&&(Te(h,R=>c.add(R)),m(h))}return h=h.children?.get(w[w.length-1]),h&&(Te(h,E=>c.add(E)),Ce(h,E=>c.add(E)),m(h)),c},p=(u,c,m)=>{if(c===m)return!1;for(let h=c;h<m;h++){let w=u.charCodeAt(h);if(w<48||w>57)return!1}return!0},S=(u,c)=>{if(u.deep||c.size<2)return c;let m=new Set;c.forEach(g=>{g.endsWith(tn)&&m.add(g.slice(0,-tn.length))});let h=new Set;if(c.forEach(g=>{let E=0,T="";for(let R=g.indexOf(".");R!==-1;R=g.indexOf(".",R+1)){let k=g.slice(0,R);(!(E>0&&p(g,E,R))||m.has(T))&&h.add(k),T=k,E=R+1}}),!h.size)return c;let w=new Set;return c.forEach(g=>{h.has(g)||w.add(g)}),w},O=u=>{let c=null,m=null,h=null,w=lt,g=N=>h?h.has(N):c===N,E=N=>{let K=a(N,u);h?h.set(N,K):c===null?(c=N,m=K):(h=new Map([[c,m],[N,K]]),c=m=null)},T=N=>{if(h){h.forEach((K,F)=>{N.has(F)||(l(K,u),h.delete(F))});return}c!==null&&!N.has(c)&&(l(m,u),c=m=null)},R=()=>{h?h.forEach(N=>l(N,u)):m&&l(m,u),h=null,c=m=null},k=N=>{if(N.size===w.size){let F=!0;if(N.forEach(he=>{F&&(F=w.has(he))}),F)return}w=N;let K=S(u,N);T(K),K.forEach(F=>{g(F)||E(F)})};return u.reindex.add(k),k(u.deps),()=>{u.reindex.delete(k),R(),w=lt}},I=u=>{let c=f(u);if(c){let m=new Set;Te(c,h=>m.add(h)),Ce(c,h=>m.add(h)),j(m)}},z=u=>I(at(u)),j=u=>{let c=Array.from(u),m=!0;for(let h=1;m&&h<c.length;h++)m=c[h-1].order<c[h].order;m||c.sort((h,w)=>h.order-w.order),c.forEach(h=>{s.has(h)&&h.run()})},b=(u,c,m=!1)=>{t.get(u)?.forEach(h=>h(c,u)),n.forEach(h=>h(u,c)),m?s.forEach(h=>h.run()):j(d(u))},H=(u,c)=>u!==c&&u!==null&&c!==null&&typeof u=="object"&&typeof c=="object"&&!ge(u)&&!ge(c)&&De(u)&&De(c)&&Array.isArray(u)===Array.isArray(c),D=null,L=-1,U=(u,c)=>{let m=c.length>u.length,h=m?u:c,w=m?c:u,g=0;for(;g<h.length&&Object.is(V(h[g]),V(w[g]));)g++;for(let E=g;E<h.length;E++)if(!Object.is(V(h[E]),V(w[E+1])))return L;return g},se=(u,c)=>{if(Array.isArray(c)){let T=u.length,R=c.length,k=T!==R;if(!T||!R)return D;let N=Math.max(T,R);if(Math.abs(T-R)===1){let F=U(u,c);if(F!==L){let he=[];for(let st=F;st<N;st++)he.push(String(st));return{keys:he,exact:!0,keysChanged:k}}}let K=[];for(let F=0;F<N;F++)if(!Object.is(V(u[F]),V(c[F]))&&(K.push(String(F)),K.length*2>=N))return D;return{keys:K,exact:!1,keysChanged:k}}let m=Object.keys(u),h=Object.keys(c),w=new Set([...m,...h]);if(!w.size)return D;let g=[];w.forEach(T=>{Object.is(V(u[T]),V(c[T]))||g.push(T)});let E=m.length!==h.length||m.some((T,R)=>T!==h[R]);return g.length*2>=w.size?D:{keys:g,exact:!1,keysChanged:E}},v=(u,c,m,h)=>{let w=new Set,g=T=>{let R=f(T);R&&(Te(R,k=>w.add(k)),Ce(R,k=>w.add(k)))},E=se(c,m);if(!E)return b(u,h);if(t.get(u)?.forEach(T=>T(h,u)),n.forEach(T=>T(u,h)),g(u),E.keys.forEach(T=>{let R=`${u}.${T}`,k=t.get(R);if(k){let N=V(m[T]),K=A(N)?G(N,R):N;k.forEach(F=>F(K,R))}E.exact?g(R):d(R).forEach(N=>w.add(N))}),E.keysChanged&&g(at(u)),Array.isArray(m)&&c.length!==m.length){let T=`${u}.length`;t.get(T)?.forEach(R=>R(m.length,T)),g(T)}j(w)},A=u=>u!==null&&typeof u=="object"&&De(u),x=new Map,q=(u,c)=>{let m=x.get(c);m?.store!==u&&(m?.unsubscribe(),x.set(c,{store:u,unsubscribe:u.$onAny((h,w)=>b(`${c}.${h}`,w))}))},J=u=>{x.get(u)?.unsubscribe(),x.delete(u)},G=(u,c)=>{let m=r.get(u);if(m)return m;let h=null,w=new Proxy(u,{has(g,E){return Reflect.has(g,E)||typeof E=="string"&&h?.has(E)===!0},ownKeys(g){return ue[ue.length-1]?.add(at(c)),Y!==null&&Y.home!==s&&W(Y),Reflect.ownKeys(g)},get(g,E,T){if(E===ct)return g;if(E===ln)return c==="";if(typeof E!="string")return Reflect.get(g,E,T);if(c===""&&E in i)return i[E];let R=c?`${c}.${E}`:E;ue[ue.length-1]?.add(R),Y!==null&&Y.home!==s&&W(Y);let k=Reflect.get(g,E,T);if(ge(k))return q(k,R),k;let N=V(k);return A(N)?G(N,R):N},set(g,E,T,R){if(R!==w&&!Object.prototype.hasOwnProperty.call(g,E))return Reflect.set(g,E,T,R);let k=c?`${c}.${E}`:E,N=ge(T)?T:V(T),K=!Object.prototype.hasOwnProperty.call(g,E);if(!K&&Object.is(g[E],N)&&(N===null||typeof N!="object"))return!0;let F=g[E];g[E]=N,h?.delete(E),ge(N)?q(N,k):J(k);let he=ge(N)||!A(N)?N:G(N,k);return!K&&H(F,N)?v(k,F,N,he):b(k,he,K),!0},deleteProperty(g,E){if(typeof E!="string")return Reflect.deleteProperty(g,E);let T=Object.prototype.hasOwnProperty.call(g,E),R=Reflect.deleteProperty(g,E);if(R&&T){let k=c?`${c}.${E}`:E;(h??(h=new Set)).add(E),J(k),b(k,void 0),z(c)}return R}});return r.set(u,w),w},Z=G(V(e),"");Object.entries(V(e)).forEach(([u,c])=>{ge(c)&&q(c,u)});let y=(u,c,{immediate:m=!1}={})=>(t.has(u)||t.set(u,new Set),t.get(u).add(c),m&&c(Ks(Z,u),u),()=>t.get(u)?.delete(c)),P=(u,{immediate:c=!1}={})=>(n.add(u),c&&an(Z,"",(m,h)=>u(m,h)),()=>n.delete(u)),C=(u,{deep:c=!1,alsoWakenBy:m}={})=>{let h=!1,w=!1,g={deps:lt,reindex:new Set,deep:c,order:Ys++,home:s,adopted:null,read:null,run:()=>{if(h){w=!0;return}h=!0;try{let R=0;do{w=!1,g.read=null;let k=new Set;ue.push(k);let N=Y;Y=g;try{u()}finally{ue.pop(),Y=N,g.deps=k}}while(w&&++R<100);w&&console.error("jq79: an effect re-woke itself 100 times in a row (it writes what it reads); giving up on it settling")}finally{h=!1,g.adopted&&Xs(g),g.reindex.forEach(R=>R(g.deps))}}};s.add(g);let E=O(g),T=()=>{s.delete(g),E(),sn(g)};return m?.length?Q(g,m,T):(g.run(),dt=g,T)},Q=(u,c,m)=>{let h=c.map(w=>w?.[rn]?.(u)).filter(Boolean);return u.run(),dt=u,()=>{m(),h.forEach(w=>w())}},$=u=>{s.add(u);let c=O(u);return()=>{s.delete(u),c()}},W=u=>{(u.read??(u.read=new Set)).add(s),!(u.adopted?.has(s)||s.has(u))&&(u.adopted??(u.adopted=new Map)).set(s,$(u))},B=()=>{x.forEach(({unsubscribe:u})=>u()),x.clear(),s.forEach(u=>{u.home===s&&sn(u)})};return i.$on=y,i.$onAny=P,i.$effect=C,i.$dispose=B,i[rn]=$,i[on]=u=>s.has(u),Z},ut=class{constructor(t,n){M(this,"scope",t);M(this,"disposers",null);M(this,"runs",null);M(this,"children",null);M(this,"owners",null);M(this,"options");let s=t[Ie];this.options=n||s?{deep:n,alsoWakenBy:s}:void 0,this.ownedBy(t)}ownedBy(t){let n=t[ft];!n||this.owners?.includes(n)||((this.owners??(this.owners=[])).push(n),(n.children??(n.children=new Set)).add(this))}effect(t){(this.disposers??(this.disposers=[])).push(this.scope.$effect(t,this.options)),(this.runs??(this.runs=[])).push(dt)}onDispose(t){(this.disposers??(this.disposers=[])).push(t)}refresh(){this.runs?.forEach(t=>t.run())}rerun(){let t=this.runs?[...this.runs]:null,n=this.children?[...this.children]:null;t?.forEach(s=>{this.runs&&s.run()}),n?.forEach(s=>s.rerun())}dispose(){let t=this.disposers;if(this.disposers=null,this.runs=null,this.children=null,this.owners?.forEach(n=>n.children?.delete(this)),this.owners=null,t)for(let n=0;n<t.length;n++)t[n]()}},me=(e,t=!1)=>new ut(e,t),pt=e=>{let t=Me({value:void 0});t.$effect(()=>{let s;try{s=e()}catch(r){console.error("jq79: error in $computed, keeping its last value",r);return}t.value=s});let n=(s,r)=>(console.warn(`jq79: a $computed is read-only - the write to ${String(r)} was ignored`),!0);return new Proxy(t,{set:n,deleteProperty:n,defineProperty:n})};var cn=/(?:let|var|const)(?:\s+(?=[A-Za-z_$])|\s*(?=[{[]))/y,dn=/\$:\s*/y,He=/import(?=\s*\()/y,un=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,re=(e,t)=>{let n=e[t],s=t+1;for(;s<e.length;){if(e[s]==="\\"){s+=2;continue}if(e[s]===n)return s+1;s++}return e.length},ee=(e,t)=>{let n=e.indexOf(`
2
- `,t);return n===-1?e.length:n},te=(e,t)=>{let n=e.indexOf("*/",t+2);return n===-1?e.length:n+2},qe=(e,t)=>{let n=t;for(;n<e.length;){if(/\s/.test(e[n])){n++;continue}if(e[n]==="/"&&e[n+1]==="/"){n=ee(e,n);continue}if(e[n]==="/"&&e[n+1]==="*"){n=te(e,n);continue}break}return n},Js=new Set(["return","typeof","case","in","instanceof","new","delete","void","do","else","yield","await"]),oe=(e,t)=>{let n=t-1;for(;n>=0;){let r=e[n];if(/\s/.test(r)){n--;continue}if(r==="/"&&e[n-1]==="*"){let i=e.lastIndexOf("/*",n-2);if(i===-1)return!0;n=i-1;continue}break}if(n<0)return!0;let s=e[n];if(/[\w$]/.test(s)){let r=n;for(;r>0&&/[\w$]/.test(e[r-1]);)r--;return Js.has(e.slice(r,n+1))}return(s==="+"||s==="-")&&e[n-1]===s?!1:!")]}\"'`.".includes(s)},ie=(e,t)=>{let n=t+1,s=!1;for(;n<e.length;){let r=e[n];if(r==="\\"){n+=2;continue}if(r===`
3
- `)return n;if(r==="[")s=!0;else if(r==="]")s=!1;else if(r==="/"&&!s){for(n++;n<e.length&&/[a-z]/i.test(e[n]);)n++;return n}n++}return e.length},er=/^(\?\.|\?\?|&&|\|\||\*\*|[.,+\-*/%&|^<>=?:([])/,tr=(e,t)=>{let n=t-1;for(;n>=0;){let s=e[n];if(/\s/.test(s)){n--;continue}if(s==="/"&&e[n-1]==="*"){let r=e.lastIndexOf("/*",n-2);if(r===-1)return"";n=r-1;continue}return s}return""},fn=(e,t)=>{let n=0,s=t;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=re(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=ee(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=te(e,s);continue}if(r==="/"&&oe(e,s)){s=ie(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else{if(n<=0&&r===";")return s;if(n<=0&&r===`
4
- `){let i=qe(e,s+1);if(!(i<e.length&&(er.test(e.slice(i,i+2))||[",","="].includes(tr(e,s)))))return s;s=i;continue}}s++}return e.length},nr=e=>{let t=[],n=0,s=0,r=0,i=a=>{t.push({raw:e.slice(s,a),codeEnd:Math.max(0,r-s)}),s=a+1,r=s},o=0;for(;o<e.length;){let a=e[o];if(a==="'"||a==='"'||a==="`"){o=re(e,o),r=o;continue}if(a==="/"&&e[o+1]==="/"){o=ee(e,o);continue}if(a==="/"&&e[o+1]==="*"){o=te(e,o);continue}if(a==="/"&&oe(e,o)){o=ie(e,o),r=o;continue}if("([{".includes(a))n++;else if(")]}".includes(a))n--;else if(a===","&&n<=0){i(o),o++;continue}/\s/.test(a)||(r=o+1),o++}return i(e.length),t},ht=e=>{let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return Fe.test(t)?[t]:[];let n=[];for(let s of mt(t.slice(1,hn(t)))){s.startsWith("...")&&(s=s.slice(3).trim());let r=yt(s);if(r!==-1&&(s=s.slice(0,r).trim()),t.startsWith("{")){let i=gt(s,":");if(i!==-1){n.push(...ht(s.slice(i+1)));continue}}n.push(...ht(s))}return n},sr=e=>{let t=[],n=nr(e).map(({raw:i,codeEnd:o})=>{let a=i.match(/^\s*/)[0];if(o<=a.length)return{text:i,empty:!0};let l=i.slice(a.length,o),f=i.slice(o),d=yt(l),p=(d===-1?l:l.slice(0,d)).trim(),S=l[0]==="{"||l[0]==="[";S?t.push(...ht(p)):Fe.test(p)&&t.push(p);let O=Ue(l).code;return{text:`${a}${S?`(${O})`:O}${f}`,empty:!1}}),s=[];for(;n.length&&n[n.length-1].empty;)s.unshift(n.pop().text);let r=n.map(i=>i.text).join(",")+s.join("");return r.trimStart().startsWith("(")&&(r=`;${r}`),{vars:t,code:r}},Ue=e=>{let t=[],n="",s=0,r=0,i=!0;for(;s<e.length;){let o=e[s],a=e[s+1];if(o==="'"||o==='"'||o==="`"){let l=re(e,s);n+=e.slice(s,l),s=l,i=!1;continue}if(o==="/"&&(a==="/"||a==="*")){let l=a==="/"?ee(e,s):te(e,s);n+=e.slice(s,l),s=l;continue}if(o==="/"&&oe(e,s)){let l=ie(e,s);n+=e.slice(s,l),s=l,i=!1;continue}if(o==="i"&&(s===0||!/[\w$.]/.test(e[s-1]))&&(He.lastIndex=s,He.test(e))){n+="$__import",s+=6,i=!1;continue}if(r===0&&i){cn.lastIndex=s;let l=cn.exec(e);if(l){let d=s+l[0].length,p=fn(e,d),{vars:S,code:O}=sr(e.slice(d,p));t.push(...S),n+=O,s=p,i=!1;continue}dn.lastIndex=s;let f=dn.exec(e);if(f){un.lastIndex=s;let d=un.exec(e);d&&t.push(d[1]);let p=s+f[0].length,S=fn(e,p);n+=`$__effect(() => { ${Ue(e.slice(p,S)).code} });`,s=S;continue}}"([{".includes(o)?r++:")]}".includes(o)&&(r=Math.max(0,r-1)),o===`
5
- `||o===";"||o==="}"?i=!0:/\s/.test(o)||(i=!1),n+=o,s++}return{vars:t,code:n}},We=/export\s+default(?![\w$])/y,pn=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,rr=e=>{let t=[],n=0,s=0;for(let r=0;r<=e.length;r++){let i=e[r];if(i==="{")n++;else if(i==="}")n--;else if(r===e.length||i===","&&n===0){let o=e.slice(s,r).trim();o&&t.push(o),s=r+1}}return t},or=(e,t,n)=>{let s=`await $__import(${JSON.stringify(t)})`;if(e===void 0)return s;let r=rr(e),i=[],o=s;if(r.length>1){let a=`$__mod${n}`;i.push(`${a} = ${s}`),o=a}for(let a of r)a.startsWith("{")?i.push(`${a.replace(/\s+as\s+/g,": ")} = ${o}`):a.startsWith("*")?i.push(`${a.replace(/^\*\s*as\s+/,"")} = ${o}`):i.push(`${a} = $__default(${o})`);return`const ${i.join(", ")}`},Fe=/^[A-Za-z_$][\w$]*$/,hn=e=>{let t=0,n=0;for(;n<e.length;){let s=e[n];if(s==="'"||s==='"'||s==="`"){n=re(e,n);continue}if(s==="/"&&e[n+1]==="/"){n=ee(e,n);continue}if(s==="/"&&e[n+1]==="*"){n=te(e,n);continue}if(s==="/"&&oe(e,n)){n=ie(e,n);continue}if("([{".includes(s))t++;else if(")]}".includes(s)&&--t===0)return n;n++}return e.length},gt=(e,t)=>{let n=0,s=0;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=re(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=ee(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=te(e,s);continue}if(r==="/"&&r!==t&&oe(e,s)){s=ie(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else if(n===0&&r===t)return s;s++}return-1},mt=e=>{let t=[],n=0,s=0,r=0;for(;r<=e.length;){let i=e[r];if(i==="'"||i==='"'||i==="`"){r=re(e,r);continue}if(i==="/"&&e[r+1]==="/"){r=ee(e,r);continue}if(i==="/"&&e[r+1]==="*"){r=te(e,r);continue}if(i==="/"&&oe(e,r)){r=ie(e,r);continue}if(i!==void 0&&"([{".includes(i))n++;else if(i!==void 0&&")]}".includes(i))n--;else if(r===e.length||i===","&&n===0){let o=e.slice(s,r).trim();o&&t.push(o),s=r+1}r++}return t},yt=e=>{let t=0;for(;t<e.length;){let n=gt(e.slice(t),"=");if(n===-1)return-1;let s=t+n;if(e[s+1]!=="="&&e[s+1]!==">"&&e[s-1]!=="="&&e[s-1]!=="!")return s;t=s+1}return-1},Ae=e=>{let t=(e??"").trim();if(!t.startsWith("{"))return null;let n=hn(t);if(n>=t.length)return null;let s=[];for(let r of mt(t.slice(1,n))){if(r.startsWith("..."))continue;let i=yt(r),o=i===-1?r:r.slice(0,i),a=i===-1?void 0:r.slice(i+1).trim(),l=gt(o,":"),f=(l===-1?o:o.slice(0,l)).trim();if(!Fe.test(f))continue;let d={name:f};a!==void 0&&(d.default=a);let p=l===-1?"":o.slice(l+1).trim();Fe.test(p)&&(d.as=p),s.push(d)}return s},ir=e=>{let t=0,n=0,s=!0;for(;t<e.length;){let r=e[t];if(r==="'"||r==='"'||r==="`"){t=re(e,t),s=!1;continue}if(r==="/"&&e[t+1]==="/"){t=ee(e,t);continue}if(r==="/"&&e[t+1]==="*"){t=te(e,t);continue}if(r==="/"&&oe(e,t)){t=ie(e,t),s=!1;continue}if(r==="e"&&n===0&&s&&(t===0||!/[\w$.]/.test(e[t-1]))){We.lastIndex=t;let i=We.exec(e);if(i)return t+i[0].length}"([{".includes(r)?n++:")]}".includes(r)&&(n=Math.max(0,n-1)),r===`
6
- `||r===";"||r==="}"?s=!0:/\s/.test(r)||(s=!1),t++}return-1},ar=/^async(?![\w$])/,lr=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,cr=e=>{let t=ir(e);if(t===-1)return null;let n=qe(e,t),s=e.slice(n);ar.test(s)&&(n=qe(e,n+5));let r=lr.exec(e.slice(n));if(r&&(n=qe(e,n+r[0].length)),e[n]!=="(")return null;let i=0,o=n;for(;o<e.length;){let a=e[o];if(a==="'"||a==='"'||a==="`"){o=re(e,o);continue}if(a==="/"&&e[o+1]==="/"){o=ee(e,o);continue}if(a==="/"&&e[o+1]==="*"){o=te(e,o);continue}if(a==="/"&&oe(e,o)){o=ie(e,o);continue}if("([{".includes(a))i++;else if(")]}".includes(a)&&--i===0)break;o++}return mt(e.slice(n+1,o))[0]??""},ke=e=>{let t=cr(e);if(t===null)return null;let n=Ae(t),s=n?.find(r=>r.name.startsWith("$"))?.name;if(s)throw new Error(`jq79: the factory signature is (props, ctx), so \`${s}\` can't be destructured from the first parameter. Write \`export default (props, { ${s} }) => \u2026\`, or \`_\` in place of props if the component takes none.`);return n},gn=e=>{let t="",n=0,s=0,r=!0,i=!1,o=0;for(;n<e.length;){let a=e[n],l=e[n+1],f=n===0||!/[\w$.]/.test(e[n-1]);if(a==="'"||a==='"'||a==="`"){let d=re(e,n);t+=e.slice(n,d),n=d,r=!1;continue}if(a==="/"&&(l==="/"||l==="*")){let d=l==="/"?ee(e,n):te(e,n);t+=e.slice(n,d),n=d;continue}if(a==="/"&&oe(e,n)){let d=ie(e,n);t+=e.slice(n,d),n=d,r=!1;continue}if(a==="i"&&f){if(He.lastIndex=n,He.test(e)){t+="$__import",n+=6,r=!1;continue}if(s===0&&r){pn.lastIndex=n;let d=pn.exec(e);if(d){t+=or(d[1],d[3],o++),n+=d[0].length,r=!1;continue}}}if(a==="e"&&f&&s===0&&r){We.lastIndex=n;let d=We.exec(e);if(d){i=!0,t+="$__exports.default =",n+=d[0].length,r=!1;continue}}"([{".includes(a)?s++:")]}".includes(a)&&(s=Math.max(0,s-1)),a===`
7
- `||a===";"||a==="}"?r=!0:/\s/.test(a)||(r=!1),t+=a,n++}return i?t:null},dr=new Set(["true","false","null","undefined","this","typeof","instanceof","in","new","void","delete","of","await","yield","NaN","Infinity","arguments","case","do","else","return"]),ur=new Set(["function","class","let","const","var","eval","with"]),fr=new Set(["$scope","$r","$t"]),pr=/^(?:\+\+|--|=>|\*\*=|<<=|>>>=|>>=|&&=|\|\|=|\?\?=|[+\-*/%&|^]=(?!=))/,hr=/^(?:>>>|===|!==|\*\*|<<|>>|==|!=|<=|>=|&&|\|\||\?\?|\?\.)/,gr=e=>/[A-Za-z_$]/.test(e),mr=/^(?:0[xXbBoO][\da-fA-F_]+|\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?)n?/,Et=e=>{let t=new Set,n=[0],s=[],r=!1,i="",o=0;for(;o<e.length;){let a=e[o];if(/\s/.test(a)){o++;continue}if(a==="/"&&e[o+1]==="/"){o=ee(e,o);continue}if(a==="/"&&e[o+1]==="*"){o=te(e,o);continue}if(a==="/"&&oe(e,o)){o=ie(e,o),i="value";continue}if(a==='"'||a==="'"){o=re(e,o),i="value";continue}if(a==="`"){let d=o+1;for(;d<e.length;){if(e[d]==="\\"){d+=2;continue}if(e[d]==="`"){d++;break}if(e[d]==="$"&&e[d+1]==="{"){let p=1,S=d+=2;for(;d<e.length&&p>0;)e[d]==="{"?p++:e[d]==="}"&&p--,d++;let O=Et(e.slice(S,d-1));if(O===null)return null;O.forEach(I=>t.add(I));continue}d++}o=d,i="value";continue}if(/\d/.test(a)&&i!=="."&&i!=="?."){let d=mr.exec(e.slice(o));o+=d?d[0].length:1,i="value";continue}if(gr(a)){let d=o;for(;d<e.length&&/[\w$]/.test(e[d]);)d++;let p=e.slice(o,d);if(o=d,ur.has(p))return null;if(i==="."||i==="?."){i="value";continue}if(dr.has(p)){i=p==="this"?"value":"op";continue}if(fr.has(p))return null;let S=o;for(;S<e.length&&/\s/.test(e[S]);)S++;if(e[S]==="(")return null;e[S]===":"&&e[S+1]!==":"&&s[s.length-1]==="{"&&n[n.length-1]===0||t.add(p),i="value";continue}let l=e.slice(o);if(pr.test(l))return null;let f=hr.exec(l);if(f){(f[0]==="&&"||f[0]==="||"||f[0]==="??")&&(r=!0),i=f[0]==="?."?"?.":"op",o+=f[0].length;continue}if(a==="=")return null;a==="("||a==="["||a==="{"?(s.push(a),n.push(0)):a===")"||a==="]"||a==="}"?(s.pop(),n.length>1&&n.pop()):a==="?"?(n[n.length-1]++,r=!0):a===":"&&n[n.length-1]>0&&n[n.length-1]--,i=a,o++}return r&&t.size>1?null:[...t]};var ae=e=>e.replace(/-(\w)/g,(t,n)=>n.toUpperCase()),Be=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),yr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Er=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,St=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,wr=e=>e.split(St).map((t,n)=>n%2===1?t:t.replace(Er,(s,r,i)=>yr.has(r.toLowerCase())?s:`<${r}${i}></${r}>`)).join(""),yn=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,Sr=/"[^"]*"|'[^']*'|(^|\s)\.\.\.([A-Za-z_$][\w$.]*)/g,br=e=>e.split(St).map((t,n)=>n%2===1?t:t.replace(yn,(s,r,i)=>{let o=0,a=i.replace(Sr,(l,f,d)=>d===void 0?l:`${f}:props.${o++}="${d}"`);return`<${r}${a}>`})).join(""),Tr=/"[^"]*"|'[^']*'|(^|\s)(:[\w.$-]+)/g,$r=/<\/slot\.([\w.$-]+)(\s*)>/gi,Rr=/^slot\./i,xr=e=>Rr.test(e)?`slot.${Be(e.slice(5))}`:e,Oe=":jq79-component",En=/^[A-Z]/,Nr="c79-",_e=e=>`${Nr}${Be(e[0].toLowerCase()+e.slice(1))}`,vr=e=>En.test(e)?_e(e):xr(e),Pr=/<\/([A-Z][\w.-]*)(\s*)>/g,Cr=/\/\s*$/,Mr=(e,t)=>{if(!En.test(e))return t;let n=` ${Oe}="${e}"`,s=Cr.exec(t);return s?`${t.slice(0,s.index)}${n}${s[0]}`:`${t}${n}`},Ar=e=>e.split(St).map((t,n)=>n%2===1?t:t.replace(yn,(s,r,i)=>{let o=i.replace(Tr,(a,l,f)=>f===void 0?a:`${l}${Be(f)}`);return`<${vr(r)}${Mr(r,o)}>`}).replace($r,(s,r,i)=>`</slot.${Be(r)}${i}>`).replace(Pr,(s,r,i)=>`</${_e(r)}${i}>`)).join(""),wn=e=>wr(br(Ar(e))),Sn=/^[A-Z][A-Za-z0-9]*$/,wt=/{{\s*([\s\S]+?)\s*}}/g,mn=new Map,bt=e=>{let t=mn.get(e);if(t)return t;let n=[],s=0;wt.lastIndex=0;for(let r=wt.exec(e);r;r=wt.exec(e))r.index>s&&n.push(e.slice(s,r.index)),n.push({expr:r[1]}),s=r.index+r[0].length;return s<e.length&&n.push(e.slice(s)),mn.set(e,n),n},Tt=new Set([":class",":value",":checked",":selected",":if",":elseif",":else",":each",":key",":with",":text",":html",":html.allowed",":props"]),ye=e=>Tt.has(e)||e.startsWith(":class.")||e.startsWith(":props.")||e===":slot"||e.startsWith(":slot."),bn=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,Ke=e=>e==="slot"||e.startsWith("slot."),$t=e=>e?ae(e):"default",Rt=e=>`${e}
8
- = $value`,xt=["$scope","$r"],Tn=e=>`with ($scope) { return (${e}
9
- ); }`,$n=(e,t)=>{let n=Et(e);if(n===null)return null;let s=n.filter(i=>!t.includes(i));return`${s.length===0?"":`let $t; ${s.map(i=>`const ${i} = ($t = $scope.${i}) !== undefined ? $t : $r($scope, ${JSON.stringify(i)});`).join(" ")}`} return (${e}
10
- );`},ze=(e,t)=>`${e.join(",")}
11
- ${t}`,Nt=e=>`await $mounted();${e}`,Rn=e=>["$scope","$__effect","$__import","$__state",...e],xn=e=>`return (async () => { with ($scope) { ${e} }
12
- ;$__state.done = true })()`,Nn=e=>["$__exports","$__default","$__import",...e],vn=e=>`return (async () => { "use strict";
1
+ var sr=Object.defineProperty;var rr=(e,t,n)=>t in e?sr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var k=(e,t,n)=>rr(e,typeof t!="symbol"?t+"":t,n);function ke(e,t){return typeof e=="string"?document.querySelector(e):e.querySelector(t)}function ft(e,t){return Array.from(typeof e=="string"?document.querySelectorAll(e):e.querySelectorAll(t))}var pt=(e,t={})=>{let n=document.createElement(e);for(let[s,r]of Object.entries(t))if(s==="className")n.className=Array.isArray(r)?r.join(" "):r;else if(s==="textContent")n.textContent=r;else if(s==="children")for(let i of r)n.appendChild(i);else n.setAttribute(s,r);return n},or=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),un={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},ir=new Set(["http:","https:","mailto:"]);function lr(e){try{let t=new URL(e,"https://example.com");return ir.has(t.protocol)}catch{return!1}}var ar={"https:":"443","http:":"80"};function cr(e){let t=e.trim().toLowerCase().match(/^([a-z\d*][a-z\d.*-]*?)(?::(\d{1,5}|\*))?$/);if(!t)return null;let[,n,s]=t,r=n.split(".");return r.some(o=>o!=="*"&&!/^[a-z\d-]+$/.test(o))?null:{host:new RegExp(`^${r.map(o=>o==="*"?"[^.]+":o).join("\\.")}$`),port:!s||s==="*"?null:s}}var pn=e=>{let t=(Array.isArray(e)?e:e.split(",")).map(cr).filter(n=>n!==null);return n=>{let s=n.hostname.toLowerCase(),r=n.port||ar[n.protocol]||"";return t.some(i=>i.host.test(s)&&(i.port===null||i.port===r))}};function dr(e,t,n,s){try{return!!e(new URL(t,document.baseURI),n,s)}catch{return!1}}var fn=512;function hn(e,t,n,s){if(n>fn)throw new RangeError(`jq79: sanitizeHTML input nests deeper than ${fn} elements`);for(let r of Array.from(e.childNodes))if(r.nodeType===Node.ELEMENT_NODE){let i=ur(r,n,s);i&&t.appendChild(i)}else r.nodeType===Node.TEXT_NODE&&t.appendChild(r.cloneNode())}function ur(e,t,n){let s=e.tagName.toLowerCase();if(!or.has(s))return null;let r=document.createElement(s);for(let i of Array.from(e.attributes)){let o=i.name.toLowerCase(),l=un[s]?.has(o),a=un["*"]?.has(o);!l&&!a||(o==="href"||o==="src")&&(!lr(i.value)||n&&!dr(n,i.value,s,o))||r.setAttribute(o,i.value)}return s==="a"&&r.setAttribute("rel","noopener noreferrer"),hn(e,r,t+1,n),r}function ht(e,t){let n=document.createElement("template");n.innerHTML=e;let s=document.createElement("div");return hn(n.content,s,0,t?.allowUrl),s.innerHTML}var fr=(e,t)=>t.split(".").reduce((n,s)=>n?.[s],e),He=e=>{if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Tn=(e,t,n)=>{Object.entries(e).forEach(([s,r])=>{let i=t?`${t}.${s}`:s;r&&typeof r=="object"&&He(r)?Tn(r,i,n):n(i,r)})},pr=(e,t)=>{e.own===null?e.own=t:e.own!==t&&(e.ownMany??(e.ownMany=new Set)).add(t)},hr=(e,t)=>{e.deep===null?e.deep=t:e.deep!==t&&(e.deepMany??(e.deepMany=new Set)).add(t)},gr=(e,t)=>{e.own===t?e.own=null:e.ownMany?.delete(t)&&e.ownMany.size===0&&(e.ownMany=null)},mr=(e,t)=>{e.deep===t?e.deep=null:e.deepMany?.delete(t)&&e.deepMany.size===0&&(e.deepMany=null)},Re=(e,t)=>{e.own!==null&&t(e.own),e.ownMany?.forEach(t)},Oe=(e,t)=>{e.deep!==null&&t(e.deep),e.deepMany?.forEach(t)},gn=" keys",gt=e=>e?`${e}.${gn}`:gn,mn=".length",yn=(e,t)=>({children:null,own:null,ownMany:null,deep:null,deepMany:null,parent:e,segment:t}),yr=e=>e.own===null&&e.deep===null&&!e.ownMany?.size&&!e.deepMany?.size&&!e.children?.size,yt=Symbol("jq79.raw"),Q=e=>{let t=e;for(;t!==null&&typeof t=="object"&&t[yt];)t=t[yt];return t},$n=Symbol("jq79.store"),ye=e=>e!==null&&typeof e=="object"&&e[$n]===!0,Et=null,fe=[],J=null,Ne=e=>{fe.push(new Set);let t=J;J=null;try{return e()}finally{fe.pop(),J=t}},Er=e=>{e.adopted.forEach((t,n)=>{e.read?.has(n)||(t(),e.adopted.delete(n))})},En=e=>{e.adopted?.forEach(t=>t()),e.adopted=null},wr=0,xe=0,pe=null,wn=(e,t)=>{for(let n of e)pe.has(n)||pe.set(n,t)},Sr=()=>{for(let e=0;pe.size;e++){if(e===100){console.error("jq79: a $batch kept waking effects for 100 rounds (an effect writes what it reads); giving up on it settling"),pe.clear();return}let t=pe;pe=new Map,Array.from(t.keys()).sort((s,r)=>s.order-r.order).forEach(s=>{t.get(s).has(s)&&s.run()})}},We=e=>{xe++===0&&(pe=new Map);try{return e()}finally{if(xe===1)try{Sr()}finally{xe=0,pe=null}else xe--}},mt=new Set,Sn="$__attach",bn="$__holds",Fe=Symbol("jq79.alsoWakenBy"),St=Symbol("jq79.owner"),ve=e=>{let t=new Map,n=new Set,s=new Set,r=new WeakMap,i=Object.create(null),o=yn(null,""),l=(f,d)=>{let m=o;return f.split(".").forEach(h=>{let S=m.children??(m.children=new Map),g=S.get(h);g||(g=yn(m,h),S.set(h,g)),m=g}),d.deep?hr(m,d):pr(m,d),m},a=(f,d)=>{d.deep?mr(f,d):gr(f,d);let m=f;for(;m?.parent&&yr(m);)m.parent.children.delete(m.segment),m=m.parent},c=f=>{let d=o;for(let m of f.split("."))if(d=d.children?.get(m),!d)return;return d},u=f=>{let d=new Set,m=E=>{let $=E.children?[...E.children.values()]:[];for(;$.length;){let x=$.pop();Re(x,v=>d.add(v)),Oe(x,v=>d.add(v)),x.children?.forEach(v=>$.push(v))}},h=o,S=f.split("."),g="";for(let E=0;E<S.length-1;E++){if(h=h.children?.get(S[E]),!h)return d;g=g?`${g}.${S[E]}`:S[E],Oe(h,x=>d.add(x));let $=T.get(g);$&&Re(h,x=>{$.store[bn](x)||d.add(x)}),E===S.length-2&&S[E+1]==="length"&&(Re(h,x=>d.add(x)),m(h))}return h=h.children?.get(S[S.length-1]),h&&(Re(h,E=>d.add(E)),Oe(h,E=>d.add(E)),m(h)),d},p=(f,d,m)=>{if(d===m)return!1;for(let h=d;h<m;h++){let S=f.charCodeAt(h);if(S<48||S>57)return!1}return!0},b=(f,d)=>{if(f.deep||d.size<2)return d;let m=new Set;d.forEach(g=>{g.endsWith(mn)&&m.add(g.slice(0,-mn.length))});let h=new Set;if(d.forEach(g=>{let E=0,$="";for(let x=g.indexOf(".");x!==-1;x=g.indexOf(".",x+1)){let v=g.slice(0,x);(!(E>0&&p(g,E,x))||m.has($))&&h.add(v),$=v,E=x+1}}),!h.size)return d;let S=new Set;return d.forEach(g=>{h.has(g)||S.add(g)}),S},M=f=>{let d=null,m=null,h=null,S=mt,g=C=>h?h.has(C):d===C,E=C=>{let Z=l(C,f);h?h.set(C,Z):d===null?(d=C,m=Z):(h=new Map([[d,m],[C,Z]]),d=m=null)},$=C=>{if(h){h.forEach((Z,U)=>{C.has(U)||(a(Z,f),h.delete(U))});return}d!==null&&!C.has(d)&&(a(m,f),d=m=null)},x=()=>{h?h.forEach(C=>a(C,f)):m&&a(m,f),h=null,d=m=null},v=C=>{if(C.size===S.size){let U=!0;if(C.forEach(me=>{U&&(U=S.has(me))}),U)return}S=C;let Z=b(f,C);$(Z),Z.forEach(U=>{g(U)||E(U)})};return f.reindex.add(v),v(f.deps),()=>{f.reindex.delete(v),x(),S=mt}},H=f=>{let d=c(f);if(d){let m=new Set;Re(d,h=>m.add(h)),Oe(d,h=>m.add(h)),D(m)}},q=f=>H(gt(f)),D=f=>{if(xe)return wn(f,s);let d=Array.from(f),m=!0;for(let h=1;m&&h<d.length;h++)m=d[h-1].order<d[h].order;m||d.sort((h,S)=>h.order-S.order),d.forEach(h=>{s.has(h)&&h.run()})},R=(f,d,m=!1)=>{t.get(f)?.forEach(h=>h(d,f)),n.forEach(h=>h(f,d)),m?xe?wn(s,s):s.forEach(h=>h.run()):D(u(f))},j=(f,d)=>f!==d&&f!==null&&d!==null&&typeof f=="object"&&typeof d=="object"&&!ye(f)&&!ye(d)&&He(f)&&He(d)&&Array.isArray(f)===Array.isArray(d),O=null,W=-1,z=(f,d)=>{let m=d.length>f.length,h=m?f:d,S=m?d:f,g=0;for(;g<h.length&&Object.is(Q(h[g]),Q(S[g]));)g++;for(let E=g;E<h.length;E++)if(!Object.is(Q(h[E]),Q(S[E+1])))return W;return g},K=(f,d)=>{if(Array.isArray(d)){let $=f.length,x=d.length,v=$!==x;if(!$||!x)return O;let C=Math.max($,x);if(Math.abs($-x)===1){let U=z(f,d);if(U!==W){let me=[];for(let ut=U;ut<C;ut++)me.push(String(ut));return{keys:me,exact:!0,keysChanged:v}}}let Z=[];for(let U=0;U<C;U++)if(!Object.is(Q(f[U]),Q(d[U]))&&(Z.push(String(U)),Z.length*2>=C))return O;return{keys:Z,exact:!1,keysChanged:v}}let m=Object.keys(f),h=Object.keys(d),S=new Set([...m,...h]);if(!S.size)return O;let g=[];S.forEach($=>{Object.is(Q(f[$]),Q(d[$]))||g.push($)});let E=m.length!==h.length||m.some(($,x)=>$!==h[x]);return g.length*2>=S.size?O:{keys:g,exact:!1,keysChanged:E}},X=(f,d,m,h)=>{let S=new Set,g=$=>{let x=c($);x&&(Re(x,v=>S.add(v)),Oe(x,v=>S.add(v)))},E=K(d,m);if(!E)return R(f,h);if(t.get(f)?.forEach($=>$(h,f)),n.forEach($=>$(f,h)),g(f),E.keys.forEach($=>{let x=`${f}.${$}`,v=t.get(x);if(v){let C=Q(m[$]),Z=y(C)?F(C,x):C;v.forEach(U=>U(Z,x))}E.exact?g(x):u(x).forEach(C=>S.add(C))}),E.keysChanged&&g(gt(f)),Array.isArray(m)&&d.length!==m.length){let $=`${f}.length`;t.get($)?.forEach(x=>x(m.length,$)),g($)}D(S)},y=f=>f!==null&&typeof f=="object"&&He(f),T=new Map,N=(f,d)=>{let m=T.get(d);m?.store!==f&&(m?.unsubscribe(),T.set(d,{store:f,unsubscribe:f.$onAny((h,S)=>R(`${d}.${h}`,S))}))},I=f=>{T.get(f)?.unsubscribe(),T.delete(f)},F=(f,d)=>{let m=r.get(f);if(m)return m;let h=null,S=new Proxy(f,{has(g,E){return Reflect.has(g,E)||typeof E=="string"&&h?.has(E)===!0},ownKeys(g){return fe[fe.length-1]?.add(gt(d)),J!==null&&J.home!==s&&G(J),Reflect.ownKeys(g)},get(g,E,$){if(E===yt)return g;if(E===$n)return d==="";if(typeof E!="string")return Reflect.get(g,E,$);if(d===""&&E in i)return i[E];let x=d?`${d}.${E}`:E;fe[fe.length-1]?.add(x),J!==null&&J.home!==s&&G(J);let v=Reflect.get(g,E,$);if(ye(v))return N(v,x),v;let C=Q(v);return y(C)?F(C,x):C},set(g,E,$,x){if(x!==S&&!Object.prototype.hasOwnProperty.call(g,E))return Reflect.set(g,E,$,x);let v=d?`${d}.${E}`:E,C=ye($)?$:Q($),Z=!Object.prototype.hasOwnProperty.call(g,E);if(!Z&&Object.is(g[E],C)&&(C===null||typeof C!="object"))return!0;let U=g[E];g[E]=C,h?.delete(E),ye(C)?N(C,v):I(v);let me=ye(C)||!y(C)?C:F(C,v);return!Z&&j(U,C)?X(v,U,C,me):R(v,me,Z),!0},deleteProperty(g,E){if(typeof E!="string")return Reflect.deleteProperty(g,E);let $=Object.prototype.hasOwnProperty.call(g,E),x=Reflect.deleteProperty(g,E);if(x&&$){let v=d?`${d}.${E}`:E;(h??(h=new Set)).add(E),I(v),R(v,void 0),q(d)}return x}});return r.set(f,S),S},V=F(Q(e),"");Object.entries(Q(e)).forEach(([f,d])=>{ye(d)&&N(d,f)});let w=(f,d,{immediate:m=!1}={})=>(t.has(f)||t.set(f,new Set),t.get(f).add(d),m&&d(fr(V,f),f),()=>t.get(f)?.delete(d)),A=(f,{immediate:d=!1}={})=>(n.add(f),d&&Tn(V,"",(m,h)=>f(m,h)),()=>n.delete(f)),P=(f,{deep:d=!1,alsoWakenBy:m}={})=>{let h=!1,S=!1,g={deps:mt,reindex:new Set,deep:d,order:wr++,home:s,adopted:null,read:null,run:()=>{if(h){S=!0;return}h=!0;try{let x=0;do{S=!1,g.read=null;let v=new Set;fe.push(v);let C=J;J=g;try{f()}finally{fe.pop(),J=C,g.deps=v}}while(S&&++x<100);S&&console.error("jq79: an effect re-woke itself 100 times in a row (it writes what it reads); giving up on it settling")}finally{h=!1,g.adopted&&Er(g),g.reindex.forEach(x=>x(g.deps))}}};s.add(g);let E=M(g),$=()=>{s.delete(g),E(),En(g)};return m?.length?L(g,m,$):(g.run(),Et=g,$)},L=(f,d,m)=>{let h=d.map(S=>S?.[Sn]?.(f)).filter(Boolean);return f.run(),Et=f,()=>{m(),h.forEach(S=>S())}},B=f=>{s.add(f);let d=M(f);return()=>{s.delete(f),d()}},G=f=>{(f.read??(f.read=new Set)).add(s),!(f.adopted?.has(s)||s.has(f))&&(f.adopted??(f.adopted=new Map)).set(s,B(f))},te=()=>{T.forEach(({unsubscribe:f})=>f()),T.clear(),s.forEach(f=>{f.home===s&&En(f)})};return i.$on=w,i.$onAny=A,i.$effect=P,i.$dispose=te,i[Sn]=B,i[bn]=f=>s.has(f),V},wt=class{constructor(t,n){k(this,"scope",t);k(this,"disposers",null);k(this,"runs",null);k(this,"children",null);k(this,"owners",null);k(this,"options");let s=t[Fe];this.options=n||s?{deep:n,alsoWakenBy:s}:void 0,this.ownedBy(t)}ownedBy(t){let n=t[St];!n||this.owners?.includes(n)||((this.owners??(this.owners=[])).push(n),(n.children??(n.children=new Set)).add(this))}effect(t){(this.disposers??(this.disposers=[])).push(this.scope.$effect(t,this.options)),(this.runs??(this.runs=[])).push(Et)}onDispose(t){(this.disposers??(this.disposers=[])).push(t)}refresh(){this.runs?.forEach(t=>t.run())}rerun(){let t=this.runs?[...this.runs]:null,n=this.children?[...this.children]:null;t?.forEach(s=>{this.runs&&s.run()}),n?.forEach(s=>s.rerun())}dispose(){let t=this.disposers;if(this.disposers=null,this.runs=null,this.children=null,this.owners?.forEach(n=>n.children?.delete(this)),this.owners=null,t)for(let n=0;n<t.length;n++)t[n]()}},Ee=(e,t=!1)=>new wt(e,t),bt=e=>{let t=ve({value:void 0});t.$effect(()=>{let s;try{s=e()}catch(r){console.error("jq79: error in $computed, keeping its last value",r);return}t.value=s});let n=(s,r)=>(console.warn(`jq79: a $computed is read-only - the write to ${String(r)} was ignored`),!0);return new Proxy(t,{set:n,deleteProperty:n,defineProperty:n})};var Be=/(?:let|var|const)(?:\s+(?=[A-Za-z_$])|\s*(?=[{[]))/y,Rn=/\$:\s*/y,Ue=/import(?=\s*\()/y,xn=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,re=(e,t)=>{let n=e[t],s=t+1;for(;s<e.length;){if(e[s]==="\\"){s+=2;continue}if(e[s]===n)return s+1;s++}return e.length},ne=(e,t)=>{let n=e.indexOf(`
2
+ `,t);return n===-1?e.length:n},se=(e,t)=>{let n=e.indexOf("*/",t+2);return n===-1?e.length:n+2},ae=(e,t)=>{let n=t;for(;n<e.length;){if(/\s/.test(e[n])){n++;continue}if(e[n]==="/"&&e[n+1]==="/"){n=ne(e,n);continue}if(e[n]==="/"&&e[n+1]==="*"){n=se(e,n);continue}break}return n},br=new Set(["return","typeof","case","in","instanceof","new","delete","void","do","else","yield","await"]),oe=(e,t)=>{let n=t-1;for(;n>=0;){let r=e[n];if(/\s/.test(r)){n--;continue}if(r==="/"&&e[n-1]==="*"){let i=e.lastIndexOf("/*",n-2);if(i===-1)return!0;n=i-1;continue}break}if(n<0)return!0;let s=e[n];if(/[\w$]/.test(s)){let r=n;for(;r>0&&/[\w$]/.test(e[r-1]);)r--;return br.has(e.slice(r,n+1))}return(s==="+"||s==="-")&&e[n-1]===s?!1:!")]}\"'`.".includes(s)},ie=(e,t)=>{let n=t+1,s=!1;for(;n<e.length;){let r=e[n];if(r==="\\"){n+=2;continue}if(r===`
3
+ `)return n;if(r==="[")s=!0;else if(r==="]")s=!1;else if(r==="/"&&!s){for(n++;n<e.length&&/[a-z]/i.test(e[n]);)n++;return n}n++}return e.length},Tr=/^(\?\.|\?\?|&&|\|\||\*\*|[.,+\-*/%&|^<>=?:([])/,$r=(e,t)=>{let n=t-1;for(;n>=0;){let s=e[n];if(/\s/.test(s)){n--;continue}if(s==="/"&&e[n-1]==="*"){let r=e.lastIndexOf("/*",n-2);if(r===-1)return"";n=r-1;continue}return s}return""},Rt=(e,t)=>{let n=0,s=t;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=re(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=ne(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=se(e,s);continue}if(r==="/"&&oe(e,s)){s=ie(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else{if(n<=0&&r===";")return s;if(n<=0&&r===`
4
+ `){let i=ae(e,s+1);if(!(i<e.length&&(Tr.test(e.slice(i,i+2))||[",","="].includes($r(e,s)))))return s;s=i;continue}}s++}return e.length},Nn=e=>{let t=[],n=0,s=0,r=0,i=l=>{t.push({raw:e.slice(s,l),codeEnd:Math.max(0,r-s)}),s=l+1,r=s},o=0;for(;o<e.length;){let l=e[o];if(l==="'"||l==='"'||l==="`"){o=re(e,o),r=o;continue}if(l==="/"&&e[o+1]==="/"){o=ne(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=se(e,o);continue}if(l==="/"&&oe(e,o)){o=ie(e,o),r=o;continue}if("([{".includes(l))n++;else if(")]}".includes(l))n--;else if(l===","&&n<=0){i(o),o++;continue}/\s/.test(l)||(r=o+1),o++}return i(e.length),t},ze=e=>{let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return Ve.test(t)?[t]:[];let n=[];for(let s of Nt(t.slice(1,vn(t)))){s.startsWith("...")&&(s=s.slice(3).trim());let r=Qe(s);if(r!==-1&&(s=s.slice(0,r).trim()),t.startsWith("{")){let i=xt(s,":");if(i!==-1){n.push(...ze(s.slice(i+1)));continue}}n.push(...ze(s))}return n},Rr=e=>{let t=[],n=Nn(e).map(({raw:i,codeEnd:o})=>{let l=i.match(/^\s*/)[0];if(o<=l.length)return{text:i,empty:!0};let a=i.slice(l.length,o),c=i.slice(o),u=Qe(a),p=(u===-1?a:a.slice(0,u)).trim(),b=a[0]==="{"||a[0]==="[";b?t.push(...ze(p)):Ve.test(p)&&t.push(p);let M=Ze(a).code;return{text:`${l}${b?`(${M})`:M}${c}`,empty:!1}}),s=[];for(;n.length&&n[n.length-1].empty;)s.unshift(n.pop().text);let r=n.map(i=>i.text).join(",")+s.join("");return r.trimStart().startsWith("(")&&(r=`;${r}`),{vars:t,code:r}},Ze=e=>{let t=[],n="",s=0,r=0,i=!0;for(;s<e.length;){let o=e[s],l=e[s+1];if(o==="'"||o==='"'||o==="`"){let a=re(e,s);n+=e.slice(s,a),s=a,i=!1;continue}if(o==="/"&&(l==="/"||l==="*")){let a=l==="/"?ne(e,s):se(e,s);n+=e.slice(s,a),s=a;continue}if(o==="/"&&oe(e,s)){let a=ie(e,s);n+=e.slice(s,a),s=a,i=!1;continue}if(o==="i"&&(s===0||!/[\w$.]/.test(e[s-1]))&&(Ue.lastIndex=s,Ue.test(e))){n+="$__import",s+=6,i=!1;continue}if(r===0&&i){Be.lastIndex=s;let a=Be.exec(e);if(a){let u=s+a[0].length,p=Rt(e,u),{vars:b,code:M}=Rr(e.slice(u,p));t.push(...b),n+=M,s=p,i=!1;continue}Rn.lastIndex=s;let c=Rn.exec(e);if(c){xn.lastIndex=s;let u=xn.exec(e);u&&t.push(u[1]);let p=s+c[0].length,b=Rt(e,p);n+=`$__effect(() => { ${Ze(e.slice(p,b)).code} });`,s=b;continue}}"([{".includes(o)?r++:")]}".includes(o)&&(r=Math.max(0,r-1)),o===`
5
+ `||o===";"||o==="}"?i=!0:/\s/.test(o)||(i=!1),n+=o,s++}return{vars:t,code:n}},Ke=/export\s+default(?![\w$])/y,Ge=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,xr=e=>{let t=[],n=0,s=0;for(let r=0;r<=e.length;r++){let i=e[r];if(i==="{")n++;else if(i==="}")n--;else if(r===e.length||i===","&&n===0){let o=e.slice(s,r).trim();o&&t.push(o),s=r+1}}return t},Nr=(e,t,n)=>{let s=`await $__import(${JSON.stringify(t)})`;if(e===void 0)return s;let r=xr(e),i=[],o=s;if(r.length>1){let l=`$__mod${n}`;i.push(`${l} = ${s}`),o=l}for(let l of r)l.startsWith("{")?i.push(`${l.replace(/\s+as\s+/g,": ")} = ${o}`):l.startsWith("*")?i.push(`${l.replace(/^\*\s*as\s+/,"")} = ${o}`):i.push(`${l} = $__default(${o})`);return`const ${i.join(", ")}`},Ve=/^[A-Za-z_$][\w$]*$/,vn=e=>{let t=0,n=0;for(;n<e.length;){let s=e[n];if(s==="'"||s==='"'||s==="`"){n=re(e,n);continue}if(s==="/"&&e[n+1]==="/"){n=ne(e,n);continue}if(s==="/"&&e[n+1]==="*"){n=se(e,n);continue}if(s==="/"&&oe(e,n)){n=ie(e,n);continue}if("([{".includes(s))t++;else if(")]}".includes(s)&&--t===0)return n;n++}return e.length},xt=(e,t)=>{let n=0,s=0;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=re(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=ne(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=se(e,s);continue}if(r==="/"&&r!==t&&oe(e,s)){s=ie(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else if(n===0&&r===t)return s;s++}return-1},Nt=e=>{let t=[],n=0,s=0,r=0;for(;r<=e.length;){let i=e[r];if(i==="'"||i==='"'||i==="`"){r=re(e,r);continue}if(i==="/"&&e[r+1]==="/"){r=ne(e,r);continue}if(i==="/"&&e[r+1]==="*"){r=se(e,r);continue}if(i==="/"&&oe(e,r)){r=ie(e,r);continue}if(i!==void 0&&"([{".includes(i))n++;else if(i!==void 0&&")]}".includes(i))n--;else if(r===e.length||i===","&&n===0){let o=e.slice(s,r).trim();o&&t.push(o),s=r+1}r++}return t},Qe=e=>{let t=0;for(;t<e.length;){let n=xt(e.slice(t),"=");if(n===-1)return-1;let s=t+n;if(e[s+1]!=="="&&e[s+1]!==">"&&e[s-1]!=="="&&e[s-1]!=="!")return s;t=s+1}return-1},_e=e=>{let t=(e??"").trim();if(!t.startsWith("{"))return null;let n=vn(t);if(n>=t.length)return null;let s=[];for(let r of Nt(t.slice(1,n))){if(r.startsWith("..."))continue;let i=Qe(r),o=i===-1?r:r.slice(0,i),l=i===-1?void 0:r.slice(i+1).trim(),a=xt(o,":"),c=(a===-1?o:o.slice(0,a)).trim();if(!Ve.test(c))continue;let u={name:c};l!==void 0&&(u.default=l);let p=a===-1?"":o.slice(a+1).trim();Ve.test(p)&&(u.as=p),s.push(u)}return s},vr=e=>{let t=0,n=0,s=!0;for(;t<e.length;){let r=e[t];if(r==="'"||r==='"'||r==="`"){t=re(e,t),s=!1;continue}if(r==="/"&&e[t+1]==="/"){t=ne(e,t);continue}if(r==="/"&&e[t+1]==="*"){t=se(e,t);continue}if(r==="/"&&oe(e,t)){t=ie(e,t),s=!1;continue}if(r==="e"&&n===0&&s&&(t===0||!/[\w$.]/.test(e[t-1]))){Ke.lastIndex=t;let i=Ke.exec(e);if(i)return t+i[0].length}"([{".includes(r)?n++:")]}".includes(r)&&(n=Math.max(0,n-1)),r===`
6
+ `||r===";"||r==="}"?s=!0:/\s/.test(r)||(s=!1),t++}return-1},Pr=/^async(?![\w$])/,Cr=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,Mr=e=>{let t=vr(e);if(t===-1)return null;let n=ae(e,t),s=e.slice(n);Pr.test(s)&&(n=ae(e,n+5));let r=Cr.exec(e.slice(n));if(r&&(n=ae(e,n+r[0].length)),e[n]!=="(")return null;let i=0,o=n;for(;o<e.length;){let l=e[o];if(l==="'"||l==='"'||l==="`"){o=re(e,o);continue}if(l==="/"&&e[o+1]==="/"){o=ne(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=se(e,o);continue}if(l==="/"&&oe(e,o)){o=ie(e,o);continue}if("([{".includes(l))i++;else if(")]}".includes(l)&&--i===0)break;o++}return Nt(e.slice(n+1,o))[0]??""},je=e=>{let t=Mr(e);if(t===null)return null;let n=_e(t),s=n?.find(r=>r.name.startsWith("$"))?.name;if(s)throw new Error(`jq79: the factory signature is (props, ctx), so \`${s}\` can't be destructured from the first parameter. Write \`export default (props, { ${s} }) => \u2026\`, or \`_\` in place of props if the component takes none.`);return n},Pn=e=>{let t="",n=0,s=0,r=!0,i=!1,o=0;for(;n<e.length;){let l=e[n],a=e[n+1],c=n===0||!/[\w$.]/.test(e[n-1]);if(l==="'"||l==='"'||l==="`"){let u=re(e,n);t+=e.slice(n,u),n=u,r=!1;continue}if(l==="/"&&(a==="/"||a==="*")){let u=a==="/"?ne(e,n):se(e,n);t+=e.slice(n,u),n=u;continue}if(l==="/"&&oe(e,n)){let u=ie(e,n);t+=e.slice(n,u),n=u,r=!1;continue}if(l==="i"&&c){if(Ue.lastIndex=n,Ue.test(e)){t+="$__import",n+=6,r=!1;continue}if(s===0&&r){Ge.lastIndex=n;let u=Ge.exec(e);if(u){t+=Nr(u[1],u[3],o++),n+=u[0].length,r=!1;continue}}}if(l==="e"&&c&&s===0&&r){Ke.lastIndex=n;let u=Ke.exec(e);if(u){i=!0,t+="$__exports.default =",n+=u[0].length,r=!1;continue}}"([{".includes(l)?s++:")]}".includes(l)&&(s=Math.max(0,s-1)),l===`
7
+ `||l===";"||l==="}"?r=!0:/\s/.test(l)||(r=!1),t+=l,n++}return i?t:null},Ar=new Set(["true","false","null","undefined","this","typeof","instanceof","in","new","void","delete","of","await","yield","NaN","Infinity","arguments","case","do","else","return"]),kr=new Set(["function","class","let","const","var","eval","with"]),Or=new Set(["$scope","$r","$t"]),_r=/^(?:\+\+|--|=>|\*\*=|<<=|>>>=|>>=|&&=|\|\|=|\?\?=|[+\-*/%&|^]=(?!=))/,jr=/^(?:>>>|===|!==|\*\*|<<|>>|==|!=|<=|>=|&&|\|\||\?\?|\?\.)/,Lr=e=>/[A-Za-z_$]/.test(e),Dr=/^(?:0[xXbBoO][\da-fA-F_]+|\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?)n?/,vt=e=>{let t=new Set,n=[0],s=[],r=!1,i="",o=0;for(;o<e.length;){let l=e[o];if(/\s/.test(l)){o++;continue}if(l==="/"&&e[o+1]==="/"){o=ne(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=se(e,o);continue}if(l==="/"&&oe(e,o)){o=ie(e,o),i="value";continue}if(l==='"'||l==="'"){o=re(e,o),i="value";continue}if(l==="`"){let u=o+1;for(;u<e.length;){if(e[u]==="\\"){u+=2;continue}if(e[u]==="`"){u++;break}if(e[u]==="$"&&e[u+1]==="{"){let p=1,b=u+=2;for(;u<e.length&&p>0;)e[u]==="{"?p++:e[u]==="}"&&p--,u++;let M=vt(e.slice(b,u-1));if(M===null)return null;M.forEach(H=>t.add(H));continue}u++}o=u,i="value";continue}if(/\d/.test(l)&&i!=="."&&i!=="?."){let u=Dr.exec(e.slice(o));o+=u?u[0].length:1,i="value";continue}if(Lr(l)){let u=o;for(;u<e.length&&/[\w$]/.test(e[u]);)u++;let p=e.slice(o,u);if(o=u,kr.has(p))return null;if(i==="."||i==="?."){i="value";continue}if(Ar.has(p)){i=p==="this"?"value":"op";continue}if(Or.has(p))return null;let b=o;for(;b<e.length&&/\s/.test(e[b]);)b++;if(e[b]==="(")return null;e[b]===":"&&e[b+1]!==":"&&s[s.length-1]==="{"&&n[n.length-1]===0||t.add(p),i="value";continue}let a=e.slice(o);if(_r.test(a))return null;let c=jr.exec(a);if(c){(c[0]==="&&"||c[0]==="||"||c[0]==="??")&&(r=!0),i=c[0]==="?."?"?.":"op",o+=c[0].length;continue}if(l==="=")return null;l==="("||l==="["||l==="{"?(s.push(l),n.push(0)):l===")"||l==="]"||l==="}"?(s.pop(),n.length>1&&n.pop()):l==="?"?(n[n.length-1]++,r=!0):l===":"&&n[n.length-1]>0&&n[n.length-1]--,i=l,o++}return r&&t.size>1?null:[...t]},Tt=/(?:await\s+)?(?:import\s*\(|(\$importAll)\s*\(\s*\[|(C79|Component79)\s*\.\s*(fetch|fetchAll|importAll)\s*\(\s*(\[)?)/y,$t=/(["'])([^"'\n\\]+)\1/y,Ir=/^(?:(?:if|for|while|with)\b[\s\S]*\)|[\s\S]*\b(?:else|do))$/,qr=(e,t)=>{Tt.lastIndex=0;let n=Tt.exec(e);if(!n)return[];let[,s,r,i,o]=n;if(t.has(s??r??""))return[];let l=s!==void 0||o!==void 0;if(i!==void 0&&i==="fetch"===l)return[];let a=r===void 0?"component":i==="importAll"?"page":"fetch",c=[],u=ae(e,Tt.lastIndex);for(;;){$t.lastIndex=u;let p=$t.exec(e);if(!p)return c;let b=ae(e,$t.lastIndex),M=e[b];if(!l)return M===")"||M===","?[{spec:p[2],kind:a}]:[];if(M!==","&&M!=="]"||(c.push({spec:p[2],kind:a}),M==="]"))return c;u=ae(e,b+1)}},Cn=e=>{let t=[];for(let o=ae(e,0);o<e.length;o=ae(e,o+1)){let l=Rt(e,o);t.push(e.slice(o,l).trim().replace(/^export\s+(?!default\b)/,"")),o=l}let n=o=>{Be.lastIndex=0;let l=Be.exec(o);return l?Nn(o.slice(l[0].length)).map(({raw:a})=>{let c=a.trim(),u=Qe(c);return u===-1?{target:c,init:""}:{target:c.slice(0,u).trim(),init:c.slice(u+1).trim()}}):null},s=new Set;t.forEach(o=>n(o)?.forEach(({target:l})=>ze(l).forEach(a=>s.add(a))));let r=[],i=!1;for(let o of t){if(!i){Ge.lastIndex=0;let l=Ge.exec(o);if(l)/^type\s/.test(l[1]??"")||r.push({spec:l[3],kind:"component"});else{let a=n(o);for(let c of a?a.map(({init:u})=>u):[o])r.push(...qr(c,s))}}i=Ir.test(o)}return r};var le=e=>e.replace(/-(\w)/g,(t,n)=>n.toUpperCase()),Xe=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Hr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Wr=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,Ct=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,Fr=e=>e.split(Ct).map((t,n)=>n%2===1?t:t.replace(Wr,(s,r,i)=>Hr.has(r.toLowerCase())?s:`<${r}${i}></${r}>`)).join(""),An=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,Br=/"[^"]*"|'[^']*'|(^|\s)\.\.\.([A-Za-z_$][\w$.]*)/g,Ur=e=>e.split(Ct).map((t,n)=>n%2===1?t:t.replace(An,(s,r,i)=>{let o=0,l=i.replace(Br,(a,c,u)=>u===void 0?a:`${c}:props.${o++}="${u}"`);return`<${r}${l}>`})).join(""),zr=/"[^"]*"|'[^']*'|(^|\s)(:[\w.$-]+)/g,Kr=/<\/slot\.([\w.$-]+)(\s*)>/gi,Gr=/^slot\./i,Vr=e=>Gr.test(e)?`slot.${Xe(e.slice(5))}`:e,Le=":jq79-component",kn=/^[A-Z]/,Zr="c79-",De=e=>`${Zr}${Xe(e[0].toLowerCase()+e.slice(1))}`,Qr=e=>kn.test(e)?De(e):Vr(e),Xr=/<\/([A-Z][\w.-]*)(\s*)>/g,Yr=/\/\s*$/,Jr=(e,t)=>{if(!kn.test(e))return t;let n=` ${Le}="${e}"`,s=Yr.exec(t);return s?`${t.slice(0,s.index)}${n}${s[0]}`:`${t}${n}`},eo=e=>e.split(Ct).map((t,n)=>n%2===1?t:t.replace(An,(s,r,i)=>{let o=i.replace(zr,(l,a,c)=>c===void 0?l:`${a}${Xe(c)}`);return`<${Qr(r)}${Jr(r,o)}>`}).replace(Kr,(s,r,i)=>`</slot.${Xe(r)}${i}>`).replace(Xr,(s,r,i)=>`</${De(r)}${i}>`)).join(""),On=e=>Fr(Ur(eo(e))),_n=/^[A-Z][A-Za-z0-9]*$/,Pt=/{{\s*([\s\S]+?)\s*}}/g,Mn=new Map,Mt=e=>{let t=Mn.get(e);if(t)return t;let n=[],s=0;Pt.lastIndex=0;for(let r=Pt.exec(e);r;r=Pt.exec(e))r.index>s&&n.push(e.slice(s,r.index)),n.push({expr:r[1]}),s=r.index+r[0].length;return s<e.length&&n.push(e.slice(s)),Mn.set(e,n),n},At=new Set([":class",":value",":checked",":selected",":if",":elseif",":else",":each",":key",":window",":with",":text",":html",":html.allowed",":props"]),we=e=>At.has(e)||e.startsWith(":class.")||e.startsWith(":props.")||e===":slot"||e.startsWith(":slot."),jn=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,Ye=e=>e==="slot"||e.startsWith("slot."),kt=e=>e?le(e):"default",Ot=e=>`${e}
8
+ = $value`,_t=["$scope","$r"],Ln=e=>`with ($scope) { return (${e}
9
+ ); }`,Dn=(e,t)=>{let n=vt(e);if(n===null)return null;let s=n.filter(i=>!t.includes(i));return`${s.length===0?"":`let $t; ${s.map(i=>`const ${i} = ($t = $scope.${i}) !== undefined ? $t : $r($scope, ${JSON.stringify(i)});`).join(" ")}`} return (${e}
10
+ );`},Je=(e,t)=>`${e.join(",")}
11
+ ${t}`,jt=e=>`await $mounted();${e}`,In=e=>["$scope","$__effect","$__import","$__state",...e],qn=e=>`return (async () => { with ($scope) { ${e} }
12
+ ;$__state.done = true })()`,Hn=e=>["$__exports","$__default","$__import",...e],Wn=e=>`return (async () => { "use strict";
13
13
  ${e}
14
- ;$__exports.done = true })()`,Pn=e=>{let t=e.attrs[":setup"];return t===void 0?null:t.trim()===""?[]:Ae(t)},Cn=(e,t)=>{let n=new Set;return e.forEach(s=>{(ke(s.content)??t(s))?.forEach(({name:i})=>n.add(i))}),n};var Mn="__jq79precompiled",An="jq79-precompiled",kn=(e,t)=>`function anonymous(${e.join(",")}
14
+ ;$__exports.done = true })()`,Fn=e=>{let t=e.attrs[":setup"];return t===void 0?null:t.trim()===""?[]:_e(t)},Bn=(e,t)=>{let n=new Set;return e.forEach(s=>{(je(s.content)??t(s))?.forEach(({name:i})=>n.add(i))}),n};var Un="__jq79precompiled",zn="jq79-precompiled",Kn=(e,t)=>`function anonymous(${e.join(",")}
15
15
  ) {
16
16
  ${t}
17
- }`;var kr="0.7.10",ns=e=>Object.fromEntries(Array.from(e.attributes).map(t=>[t.name,t.value])),ss="http://www.w3.org/1999/xhtml",rs=e=>{let t=ns(e),n=e.namespaceURI,s=t[Oe];delete t[Oe];let r=n!==null&&n!==ss;return{tag:r?e.tagName:e.tagName.toLowerCase(),attrs:t,...s===void 0?{}:{component:s},...r?{ns:n}:{},children:Array.from((e instanceof HTMLTemplateElement?e.content:e).childNodes).flatMap(i=>{if(i.nodeType===Node.TEXT_NODE){let o=i.textContent??"";return o?[o]:[]}return i.nodeType===Node.ELEMENT_NODE?[rs(i)]:[]})}},Ze=new Map,Ve=new Map,Ut=!1,_t,Ne=class extends Error{constructor(n,s){super(`${n}. ${s}`);M(this,"reason",n);M(this,"hint",s)}},Or=()=>new Ne("was not precompiled","Safe mode never builds code at runtime: the component's precompiled functions did not reach the page."),_r=(e,t)=>{let n=globalThis[Mn];if(Array.isArray(n)&&n.length>0)for(let[s,r,i]of n.splice(0))Ve.set(ze(s,r),i);return Ve.size===0?void 0:Ve.get(ze(e,t))},Bt=(e,t,n="")=>{let s=_r(e,t);if(s===null)throw new SyntaxError("jq79: this code did not compile when it was precompiled");if(s!==void 0)return s;if(_t!==void 0)return jr(e,t,n,_t);if(Ut)throw Or();return new Function(...e,t+n)},os=()=>{if(!(typeof document>"u"))for(let e of Array.from(document.querySelectorAll("script[nonce]"))){let t=e.nonce||e.getAttribute("nonce");if(t)return t}},On="__jq79built",jr=(e,t,n,s)=>{let r=document.createElement("script");r.setAttribute("nonce",s),r.textContent=`document.currentScript.${On} = ${kn(e,t)}${n}`;let i,o=l=>{i=l.error??new SyntaxError(l.message),l.preventDefault()};window.addEventListener("error",o);try{(document.head??document.documentElement).append(r)}finally{window.removeEventListener("error",o),r.remove()}let a=r[On];if(typeof a=="function")return Ve.set(ze(e,t),a),a;throw i!==void 0?i:new Ne("could not be built","The page's CSP refused a <script> carrying the nonce jq79 read from the page.")},_n=new Set,Lr=(e,t)=>{_n.has(e)||(_n.add(e),console.error(`jq79: safeEval() is on, and "${e}" ${t.reason}, so it rendered as nothing. ${t.hint}`))},vt=(e,t)=>{if(!(t in e)){if(t in globalThis)return globalThis[t];throw new ReferenceError(`${t} is not defined`)}},is=(e,t)=>{try{return Bt([...xt,...t],Tn(e))}catch(n){return n instanceof Ne&&Lr(e,n),null}},Dr=(e,t)=>{if(!le.scopedNames)return null;let n=$n(e,t);if(n===null)return null;try{return Bt([...xt,...t],n)}catch{return null}},as=(e,t,n)=>{let s=Ze.get(e);if(s===void 0){let r=Dr(t,n);s=r?{fn:r,scoped:!0}:{fn:is(t,n),scoped:!1},Ze.set(e,s)}return s},ls=(e,t)=>`${t.join(",")}|${e}`,Ir=(e,t)=>as(ls(e,t),e,t).fn,qr=(e,t,n)=>{let s=is(t,n);return Ze.set(e,{fn:s,scoped:!1}),s},Hr=/^(?:([\w$]+) is not defined|Can't find variable: ([\w$]+))/,Wr=100,we=new Map,Kt=new Set,Qe=0,jt=!1,Lt=new Set,Fr=()=>{jt=!1,!(Qe>0)&&(we.forEach(({name:e,expr:t,scope:n},s)=>{e in n||(Kt.add(s),console.warn(`jq79: ${e} is not defined - evaluating "${t}". Template expressions resolve against the component store: a top-level let/var/const in a :setup script, a declared prop, or a global. Note a "function name() {}" declaration is not on the store - write "const name = () => {}".`))}),we.clear())},cs=()=>{jt||Qe>0||!we.size||(jt=!0,queueMicrotask(Fr))},ds=e=>{Qe++;let t=()=>{Qe--,cs()};e.then(t,t)},Ur=(e,t)=>{if(Lt.has(e))return;Lt.add(e);let n=t?.message||String(t);console.error(`jq79: ${n} - evaluating "${e}". The expression rendered as nothing. If the value arrives later, guard it - "a?.b", or :if on the element.`)},us=(e,t,n)=>{if(!(n instanceof ReferenceError))return Ur(e,n);let s=Hr.exec(n.message),r=s?.[1]??s?.[2];if(!r)return;let i=`${r}|${e}`;Kt.has(i)||we.has(i)||we.size>=Wr||(we.set(i,{name:r,expr:e,scope:t}),cs())},fs=(e,t,n)=>{let s=n?Object.keys(n):[],r=ls(e,s),{fn:i,scoped:o}=as(r,e,s);if(!i)return;let a=n?Object.values(n):[];if(!o)return i(t,vt,...a);try{return i(t,vt,...a)}catch(l){if(!(l instanceof ReferenceError))throw l;let f=qr(r,e,s);if(!f)throw l;return f(t,vt,...a)}},_=(e,t,n)=>{try{return fs(e,t,n)}catch(s){us(e,t,s);return}},ps=(e,t,n)=>{try{return fs(e,t,n)}catch(s){if(!(s instanceof ReferenceError))throw s;us(e,t,s);return}},hs=(e,t)=>{if(e.length===1){let s=e[0];return typeof s=="string"?s:String(_(s.expr,t)??"")}let n="";for(let s of e)n+=typeof s=="string"?s:String(_(s.expr,t)??"");return n},gs=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i);e.addEventListener(r,a=>{if(o.has("self")&&a.target!==e)return;o.has("prevent")&&a.preventDefault(),o.has("stop")&&a.stopPropagation();let l=ps(n,s,{$event:a});typeof l=="function"&&l.call(e,a)},{once:o.has("once"),capture:o.has("capture")})},Br=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i),a=l=>{o.has("prevent")&&l.preventDefault(),o.has("stop")&&l.stopPropagation(),o.has("once")&&e.off(r,a),$e(()=>{let f=ps(n,s,{$event:l});typeof f=="function"&&f(l)})};e.on(r,a)},zt=e=>e instanceof DocumentFragment?{first:e.firstChild,last:e.lastChild}:{first:e,last:e},nt=({first:e,last:t})=>{for(let n=e;n;){let s=n===t?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},Kr=e=>{e.forEach(t=>{if(t.first===t.last)return nt(t);if(!t.first.parentNode)return;let s=document.createRange();s.setStartBefore(t.first),s.setEndAfter(t.last),s.deleteContents()})},zr=(e,t)=>{let n=[],s=null;return e.forEach(r=>{if(!t(r)){s=null;return}s&&s.last.nextSibling===r.range.first?s.last=r.range.last:n.push(s={first:r.range.first,last:r.range.last})}),n},Gr=({first:e,last:t},n)=>{let s=n.nextSibling;for(let r=e;r;){let i=r===t?null:r.nextSibling;n.parentNode.insertBefore(r,s),r=i}},jn=(e,t)=>{let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s))for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r;return null},Ee=null,Xe=null,ms=new WeakSet,Vr=e=>{let t={memo:Ee,base:Xe};return Ee=new Map,Xe=e,t},Zr=e=>{Ee=e.memo,Xe=e.base},Ln=(e,t)=>e.component!==void 0?Dn(t,e.component):e.tag.includes("-")?Dn(t,e.tag):null,X=e=>e.component??e.tag,Dn=(e,t)=>{if(!Ee)return jn(e,t);let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s)){if(s===Xe){if(Ee.has(t))return Ee.get(t);let r=jn(s,t);return Ee.set(t,r),r}if(!ms.has(s)){for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r}}return null},Qr=e=>{let t=new Set;for(let n=e;n&&n!==Object.prototype;n=Object.getPrototypeOf(n))for(let s of Object.keys(n))/^[A-Z]/.test(s)&&t.add(s);return[...t].sort()},Xr=(e,t)=>{let n=Qr(t);return new Error(`jq79: <${e}> is not defined - no component of that name is in scope, and nothing renders here. Import it in a :setup script, declare it as a prop, or add a <template name="${e}"> to this file. In scope: ${n.length?n.join(", "):"(none)"}.`)},In=100,Pt=0,ys=Symbol("jq79.slots"),Le=e=>Object.keys(e.attrs).find(t=>t===":slot"||t.startsWith(":slot.")),Yr=e=>e==="default"?":slot":`:slot.${e}`,Jr=e=>typeof e!="string"||e.trim()!=="",eo=e=>{let t={},n=[];e.children.forEach(r=>{let i=typeof r=="object"&&r.tag==="template"?Le(r):void 0;if(typeof r=="string"||i===void 0){n.push(r);return}let o=$t(i.slice(6));if(o in t){console.warn(`jq79: two <template ${Yr(o)}> in <${X(e)}>; the second was ignored`);return}t[o]={nodes:r.children,binder:r.attrs[i]||void 0}});let s=n.some(Jr);return s&&"default"in t?console.warn(`jq79: <${X(e)}> has both a <template :slot> and content outside it - the <template> is the default slot's content, and the rest was ignored`):s&&(t.default={nodes:n,binder:e.attrs[":slot"]||void 0}),t},to=(e,t,n)=>{Ae(t)?.forEach(({name:s,as:r,default:i})=>{let o=r??s;Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>{let a=n[s]?.();return a===void 0&&i!==void 0?_(i,e):a},set:()=>console.warn(`jq79: "${o}" is a slot prop - it comes from the component, so assigning to it does nothing`)})})},no=e=>{let t=Le(e);return console.warn(`jq79: <template ${t}> fills a slot only as a direct child of a component tag; here it rendered nothing`),document.createComment(`misplaced ${t}`)},so=(e,t)=>{let n=Object.entries(eo(e));if(!n.length)return null;let s={};return n.forEach(([r,i])=>{s[r]=ro(i,t)}),s},ro=(e,t)=>(n,s,r,i)=>{let o=Object.create(t);to(o,e.binder,n);let a=o[Ie]??[];Object.defineProperty(o,Ie,{value:[...a,s]});let l=me(o);return l.ownedBy(s),r.onDispose(()=>l.dispose()),be(e.nodes,o,l,i)},oo=(e,t,n,s)=>{let r=$t(e.tag.slice(5)),i=document.createDocumentFragment(),o=document.createComment(e.tag),a=document.createComment(`/${e.tag}`);i.append(o,a);let l=t[ys]?.[r];if(!l)return i.insertBefore(be(e.children,t,n,s),a),i;let f={};return Object.entries(e.attrs).forEach(([d,p])=>{if(!(d===ve||ye(d)||d.startsWith("@")))if(d.startsWith(":")){let S=p||d.slice(1);f[ae(d.slice(1))]=()=>_(S,t)}else f[ae(d)]=()=>p}),i.insertBefore(l(f,t,n,s),a),i},Es="data-c79-box",io=(e,t,n)=>{if(t.ns!==void 0)return document.createDocumentFragment();let s=document.createElement(_e(e));s.setAttribute(Es,"");let r=t.attrs[ve];return r!==void 0&&s.setAttribute(ve,r),n||zo(),s},qn=new WeakSet,ao=(e,t)=>{if(e.ns===void 0||qn.has(e))return;let n=t.template.find(r=>typeof r=="object");if(n===void 0||n.ns!==void 0)return;qn.add(e);let s=e.ns==="http://www.w3.org/1998/Math/MathML"?"<math>":"<svg>";console.warn(`jq79: <${X(e)}> is used inside ${s} and its template starts with <${n.tag.toLowerCase()}>, which is parsed as HTML - it renders and never draws. A component's template decides its own namespace, so root it at ${s}`)},Hn=(e,t,n,s,r)=>{let i=io(e,t,r),o=!(i instanceof DocumentFragment),a=o?null:document.createComment(`/${e}`);o||i.append(document.createComment(e),a);let l=so(t,n),f={},d={},p=[],S=[],O=!1;Object.entries(t.attrs).forEach(([v,A])=>{if(v!==ve){if(v===":props"||v.startsWith(":props.")){O=!0,S.push({expr:A});return}if(!ye(v))if(v.startsWith("@"))p.push([v,A]);else if(v===":model"||v.startsWith(":model.")){let x=v===":model"?"default":ae(v.slice(7));d[x]=A||(v===":model"?"model":x)}else if(v.startsWith(":")){let x=ae(v.slice(1));f[x]=A||x,S.push({name:x,expr:A||x})}else{let x=ae(v),q=JSON.stringify(A);f[x]=q,S.push({name:x,expr:q})}}});let I=v=>v==="default"?":model":`:model.${v}`,z=v=>v==="default"?"model":v,j=new Set;Object.entries(d).forEach(([v,A])=>{let x=z(v);f[x]!==void 0&&console.warn(`jq79: <${X(t)}> binds prop "${x}" through both :${x} and ${I(v)} - ${I(v)} wins`),f[x]=A,Ir(Rt(A),["$value"])===null&&(j.add(v),console.warn(`jq79: ${I(v)}="${A}" is not assignable - updates from <${X(t)}> will be dropped`))});let b=()=>{let v={};return S.forEach(({name:A,expr:x})=>{if(A!==void 0)v[A]=_(x,n);else{let q=_(x,n);q!==null&&typeof q=="object"&&Object.assign(v,q)}}),Object.entries(d).forEach(([A,x])=>{v[z(A)]=_(x,n)}),v},H=null,D=null,L=null,U=new Set,se=v=>{if(v==null){if(!n[Os]?.has(e)||U.has("unfilled"))return;U.add("unfilled"),console.error(`jq79: <${X(t)}> is declared as a prop and the parent passed nothing - nothing renders here. Pass it (:${e}="\u2026"), or drop it from the signature to use the one declared in this file.`);return}U.has("type")||(U.add("type"),console.error(`jq79: <${X(t)}> is ${typeof v}, not a component - nothing renders here`))};return s.effect(()=>{let v=_(e,n),A=v instanceof de?v:null;if(A||se(v),A===D||(L?.dispose(),L=null,H?.destroy(),H=null,D=A,!A))return;ao(t,A);let x=new de({template:A.template,scripts:A.scripts,styles:A.styles,modules:A.modules,filename:A.filename,siblings:A.siblings,name:A.name});if(l&&(x.slots=l),Object.keys(d).length){let P=new Set;x.modelWriteback=(C,Q)=>{let $=C==null?"default":ae(String(C)),W=d[$];return W===void 0?(P.has($)||(P.add($),console.warn(`jq79: <${X(t)}> has no ${I($)} - bound: ${Object.keys(d).map(I).join(", ")}`)),!1):j.has($)?!1:($e(()=>_(Rt(W),n,{$value:Q})),!0)}}p.forEach(([P,C])=>Br(x,P,C,n));let q=Xo(x.scripts);Yo(t,e,Object.keys(f),q);let J=Yn($e(b),q),G=document.createDocumentFragment();if(Pt>=In){console.error(`jq79: <${X(t)}> is ${In} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}Pt++;try{(r?x.renderShadow(J):x.render(J)).mount(G)}finally{Pt--}let Z=n[tt];Z&&x.holdOwner(Z.owner),a?a.parentNode.insertBefore(G,a):i.appendChild(G);let y=me(n,!0);if(O){let P=[];y.effect(()=>{let C=Yn(b(),q),Q=Object.keys(C);P.forEach($=>{$ in C||(x.data[$]=void 0)}),Q.forEach($=>{x.data[$]=C[$]}),P=Q})}else Object.entries(f).forEach(([P,C])=>{q!==null&&!q.has(P)||y.effect(()=>{x.data[P]=_(C,n)})});L=y,H=x}),s.onDispose(()=>{L?.dispose(),H?.destroy()}),i},lo=(e,t)=>{let n=()=>{let s=_(e,t);return s!==null&&typeof s=="object"?s:null};return new Proxy(t,{has(s,r){let i=n();return i!==null&&Reflect.has(i,r)||Reflect.has(s,r)},get(s,r){let i=n();return i!==null&&Reflect.has(i,r)?i[r]:Reflect.get(s,r)},set(s,r,i){let o=n();return o!==null&&Reflect.has(o,r)?(o[r]=i,!0):Reflect.set(s,r,i)}})},pe=e=>typeof e=="string"?e.split(/\s+/).filter(Boolean):Array.isArray(e)?e.flatMap(pe):e!==null&&typeof e=="object"?Object.entries(e).flatMap(([t,n])=>n?pe(t):[]):[],co=e=>typeof e=="function"?(t,n,s)=>{try{return!!e(t,n,s)}catch{return!1}}:typeof e=="string"||Array.isArray(e)?Yt(e):()=>!1,uo=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),ws=e=>e.ns===void 0?document.createElement(e.tag):document.createElementNS(e.ns,e.tag),fo={"http://www.w3.org/2000/svg":["svg","feGaussianBlur"],"http://www.w3.org/1998/Math/MathML":["math","mi"]},Wn=new Map,po=(e,t)=>{let n=`${e} ${t}`,s=Wn.get(n);if(s!==void 0)return s;let r=fo[e],i=t;if(r!==void 0&&typeof DOMParser<"u"&&/^[a-z][a-z0-9]*$/.test(t)){let[o,a]=r;i=new DOMParser().parseFromString(`<${o}><${a} ${t}="x"/></${o}>`,"text/html").querySelector(a)?.getAttributeNames().find(f=>f.toLowerCase()===t)??t}return Wn.set(n,i),i},Ss=(e,t)=>{let n=e.namespaceURI;if(n===null||n===ss)return t;let s=t.replace(/-/g,"").toLowerCase(),r=po(n,s);return r===s?t:r},bs=(e,t,n)=>{let s=uo.has(t);(s?!n:n==null)?e.removeAttribute(t):e.setAttribute(t,s?"":String(n))},le={cloneSkeletons:!0,scopedNames:!0},ho=new Set([":text",":html",":value",":checked",":selected"]),go=e=>e.startsWith("@")||e===":class"||e.startsWith(":class.")||ho.has(e)?!0:e.startsWith(":")?e===":model"?!1:!ye(e)&&!e.includes("."):e!==Oe,Ts=e=>{if(e.component||e.tag.includes("-")||Ke(e.tag)||e.tag==="template"||e.ns===void 0&&document.createElement(e.tag)instanceof HTMLUnknownElement)return!1;for(let t in e.attrs)if(!go(t))return!1;return e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?!0:e.children.every(t=>typeof t=="string"||Ts(t))},$s=(e,t,n)=>{let s=ws(e),r,i=null;for(let p in e.attrs){let S=e.attrs[p];if(p.startsWith("@"))n.push({kind:"event",path:t,attr:p,expr:S});else if(p===":class")r=S;else if(p.startsWith(":class."))(i??(i=[])).push([p.slice(7),S]);else if(!ye(p))if(p.startsWith(":")){let O=p.slice(1);n.push({kind:"attr",path:t,name:Ss(s,O),expr:S||ae(O)})}else s.setAttribute(p,S)}(r!==void 0||i)&&n.push({kind:"class",path:t,classExpr:r,toggles:i,staticClasses:new Set(pe(e.attrs.class??""))});let o=e.attrs[":text"],a=e.attrs[":html"];o!==void 0?n.push({kind:"textContent",path:t,expr:o}):a!==void 0?n.push({kind:"html",path:t,expr:a}):e.children.forEach((p,S)=>{if(typeof p=="string"){p.includes("{{")?(n.push({kind:"text",path:[...t,S],parts:bt(p)}),s.appendChild(document.createTextNode(""))):s.appendChild(document.createTextNode(p));return}s.appendChild($s(p,[...t,S],n))});let l=e.attrs[":value"];l!==void 0&&n.push({kind:"value",path:t,expr:l});let f=e.attrs[":checked"];f!==void 0&&n.push({kind:"checked",path:t,expr:f});let d=e.attrs[":selected"];return d!==void 0&&n.push({kind:"selected",path:t,expr:d}),s},mo=3,Rs=e=>e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?1:1+e.children.reduce((t,n)=>t+(typeof n=="string"?0:Rs(n)),0),Fn=new WeakMap,Un=new WeakSet,yo=e=>{let t=Fn.get(e);if(t!==void 0)return t;if(!Un.has(e))return Un.add(e),null;let n=null;if(Ts(e)&&Rs(e)>=mo){let s=[];n={skeleton:$s(e,[],s),ops:s}}return Fn.set(e,n),n},Eo=(e,t)=>{let n=e;for(let s=0;s<t.length;s++)n=n.childNodes[t[s]];return n},wo=(e,t,n)=>{let s=e.skeleton.cloneNode(!0);for(let r of e.ops){let i=r.path.length===0?s:Eo(s,r.path);if(r.kind==="text"){let o=i,a=r.parts;n.effect(()=>{let l=hs(a,t);o.textContent!==l&&(o.textContent=l)})}else if(r.kind==="event")gs(i,r.attr,r.expr,t);else if(r.kind==="attr"){let o=i,{name:a,expr:l}=r;n.effect(()=>bs(o,a,_(l,t)))}else if(r.kind==="class"){let o=i,{classExpr:a,toggles:l,staticClasses:f}=r,d=[];n.effect(()=>{let p=a!==void 0?pe(_(a,t)):[];l?.forEach(([S,O])=>{_(O,t)&&p.push(...pe(S))}),d.forEach(S=>{!p.includes(S)&&!f.has(S)&&o.classList.remove(S)}),o.classList.add(...p),d=p})}else if(r.kind==="textContent"){let o=i,{expr:a}=r;n.effect(()=>{let l=String(_(a,t)??"");o.textContent!==l&&(o.textContent=l)})}else if(r.kind==="html"){let o=i,{expr:a}=r;n.effect(()=>{o.innerHTML=it(String(_(a,t)??""))})}else if(r.kind==="value"){let o=i,{expr:a}=r;n.effect(()=>{let l=String(_(a,t)??"");o.value!==l&&(o.value=l)})}else if(r.kind==="checked"){let o=i,{expr:a}=r;n.effect(()=>{let l=!!_(a,t);o.checked!==l&&(o.checked=l)})}else if(r.kind==="selected"){let o=i,{expr:a}=r;n.effect(()=>{let l=!!_(a,t);o.selected!==l&&(o.selected=l)})}else{let o=r}}return s},Gt=(e,t,n,s)=>{let r=e.attrs[":with"],i=r!==void 0?lo(r,t):t;if(Ke(e.tag))return oo(e,i,n,s);if(e.tag==="template"&&Le(e)!==void 0)return no(e);let o=Ln(e,i);if(o)return Hn(o,e,i,n,s);if(le.cloneSkeletons){let b=yo(e);if(b)return wo(b,i,n)}let a=ws(e);if(e.component!==void 0&&i[tt]?.count===0)throw Xr(e.component,i);let l=e.ns===void 0&&(e.component!==void 0||e.tag.includes("-"));if(l){let b=!1;n.effect(()=>{if(b)return;let H=Ln(e,i);if(!H)return;b=!0;let D=Hn(H,e,i,n,s),L=zt(D);n.onDispose(()=>nt(L)),a.replaceWith(D)})}for(let b in e.attrs){let H=e.attrs[b];if(b.startsWith("@"))gs(a,b,H,i);else if(b===":model"||b.startsWith(":model."))l||console.warn(`jq79: ${b} on <${X(e)}> does nothing - :model binds component tags only (for now)`);else if(!ye(b))if(b.startsWith(":"))if(l)a.setAttribute(b,H);else{let D=b.slice(1),L=H||ae(D),U=Ss(a,D);n.effect(()=>bs(a,U,_(L,i)))}else a.setAttribute(b,H)}let f=e.attrs[":class"],d=null;for(let b in e.attrs)b.startsWith(":class.")&&(d??(d=[])).push([b.slice(7),e.attrs[b]]);if(f!==void 0||d){let b=new Set(pe(e.attrs.class??"")),H=[];n.effect(()=>{let D=f!==void 0?pe(_(f,i)):[];d?.forEach(([L,U])=>{_(U,i)&&D.push(...pe(L))}),H.forEach(L=>{!D.includes(L)&&!b.has(L)&&a.classList.remove(L)}),a.classList.add(...D),H=D})}let p=e.attrs[":text"],S=e.attrs[":html"],O=e.attrs[":html.allowed"];O!==void 0&&S===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),p!==void 0?n.effect(()=>{let b=String(_(p,i)??"");a.textContent!==b&&(a.textContent=b)}):S!==void 0?n.effect(()=>{let b=O!==void 0?{allowUrl:co(_(O,i))}:void 0;a.innerHTML=it(String(_(S,i)??""),b)}):a instanceof HTMLTemplateElement?be(e.children,i,n,s,a.content):be(e.children,i,n,s,a);let I=e.attrs[":value"];I!==void 0&&n.effect(()=>{let b=String(_(I,i)??"");a.value!==b&&(a.value=b)});let z=e.attrs[":checked"];z!==void 0&&n.effect(()=>{let b=!!_(z,i);a.checked!==b&&(a.checked=b)});let j=e.attrs[":selected"];return j!==void 0&&n.effect(()=>{let b=!!_(j,i);a.selected!==b&&(a.selected=b)}),a},So=(e,t,n,s)=>{let r=document.createComment("if"),i=document.createDocumentFragment();i.appendChild(r);let o=null,a=null,l=null;return n.effect(()=>{let f=e.find(p=>p.expr===void 0||_(p.expr,t))??null;if(f===a||(l?.dispose(),o&&nt(o),o=null,a=f,!f))return;l=me(t);let d=Gt(f.node,t,l,s);o=zt(d),r.parentNode.insertBefore(d,r.nextSibling)}),n.onDispose(()=>l?.dispose()),i},Re=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})},bo=e=>{let t=new Uint8Array(e.length),n=[],s=new Int32Array(e.length).fill(-1);for(let r=0;r<e.length;r++){let i=e[r];if(i<0)continue;let o=0,a=n.length;for(;o<a;){let l=o+a>>1;e[n[l]]<i?o=l+1:a=l}o>0&&(s[r]=n[o-1]),n[o]=r}for(let r=n.length?n[n.length-1]:-1;r!==-1;r=s[r])t[r]=1;return t},To=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},xs=(e,t)=>typeof e=="string"?t.some(n=>Kn(e,n)):Object.values(e.attrs).some(n=>t.some(s=>Kn(n,s)))||e.children.some(n=>xs(n,t)),Ns=e=>typeof e!="string"&&(":if"in e.attrs||":elseif"in e.attrs||":else"in e.attrs||":each"in e.attrs||e.component!==void 0||e.tag.includes("-")||Ke(e.tag)||e.children.some(Ns)),Bn=/[A-Za-z0-9_$]/,$o=/^[A-Za-z_$][\w$]*\.[A-Za-z_$][\w$]*$/,Kn=(e,t)=>{for(let n=e.indexOf(t);n!==-1;n=e.indexOf(t,n+1)){let s=n===0?"":e[n-1],r=e[n+t.length]??"";if(!Bn.test(s)&&!Bn.test(r))return!0}return!1},Ct=new WeakMap,Ro=e=>{let t=Ct.get(e);if(t!==void 0)return t;let n=e.attrs[":each"].match(bn);if(!n)return Ct.set(e,null),null;let[,s,r,i]=n,o=e.attrs[":key"],a=o===s,l=o!==void 0&&!a&&$o.test(o)&&o.startsWith(`${s}.`)?o.slice(s.length+1):void 0,{[":each"]:f,[":key"]:d,...p}=e.attrs,S={...e,attrs:p},O=["$index",...r?[r]:[]],I=xs(S,O),z=/^[A-Z]/.test(s)||r!==void 0&&/^[A-Z]/.test(r),j=o!==void 0&&Ns(S),b={itemName:s,atName:r,listExpr:i,keyExpr:o,keyIsItem:a,keyProp:l,itemNode:S,readsPosition:I,namesComponent:z,nestsScopes:j};return Ct.set(e,b),b},xo=(e,t,n,s)=>{let r=Ro(e);if(!r)return document.createComment(`invalid :each expression "${e.attrs[":each"]}"`);let{itemName:i,atName:o,listExpr:a,keyExpr:l,keyIsItem:f,keyProp:d,itemNode:p,readsPosition:S,namesComponent:O,nestsScopes:I}=r,z=document.createComment("each"),j=document.createDocumentFragment();j.appendChild(z),(":if"in e.attrs||":elseif"in e.attrs||":else"in e.attrs)&&console.warn("jq79: :if/:elseif/:else on a :each element is ignored; filter the list expression instead");let b=[],H=!1;return n.effect(()=>{let D=Vr(t);try{let L=_(a,t),U=Array.isArray(L),se=U?null:To(L)?Object.keys(L):[],v=U?L.length:se.length,A=new Map;b.forEach(($,W)=>{$.pos=W;let B=A.get($.key);B?B.push($):A.set($.key,[$])});let x=new Set,q=[],J=[],G=[],Z=[],y;for(let $=0;$<v;$++){let W=U?$:se[$],B=U?L[$]:L[W],u=W;f?u=B:d!==void 0&&B!==null&&typeof B=="object"?u=B[d]:l!==void 0&&(y===void 0?(y=Object.create(t),Re(y,i,B),o&&Re(y,o,W),Re(y,"$index",$)):(y[i]=B,o&&(y[o]=W),y.$index=$),u=_(l,y)),x.has(u)&&!H&&(H=!0,console.warn(`jq79: duplicate :key in :each "${e.attrs[":each"]}"; duplicates pair up by position`)),x.add(u);let c=A.get(u)?.shift();if(c&&Object.is(c.item,B)){let g=c.scope;g.$index!==$&&(S&&q.push(c),g.$index=$),o&&g[o]!==W&&(g[o]=W),G.push(c),Z.push(c.pos);continue}if(c&&l!==void 0){let g=c.scope;g[i]=B,g.$index!==$&&(g.$index=$),o&&g[o]!==W&&(g[o]=W),c.item=B,J.push(c),G.push(c),Z.push(c.pos);continue}c&&(c.fx.dispose(),nt(c.range));let m=Object.create(t);Re(m,i,B),o&&Re(m,o,W),Re(m,"$index",$),O||ms.add(m);let h=me(t);I&&Object.defineProperty(m,ft,{value:h});let w=zt(Gt(p,m,h,s));G.push({key:u,item:B,scope:m,fx:h,range:w,pos:$}),Z.push(-1)}let P=new Set;A.forEach($=>$.forEach(W=>P.add(W))),P.size&&(P.forEach($=>{$.dead=!0,$.fx.dispose()}),Kr(zr(b,$=>$.dead===!0)));let C=z,Q=bo(Z);G.forEach(($,W)=>{!Q[W]&&C.nextSibling!==$.range.first&&Gr($.range,C),C=$.range.last}),q.forEach($=>$e(()=>$.fx.refresh())),J.forEach($=>$e(()=>$.fx.rerun())),b=G}finally{Zr(D)}}),n.onDispose(()=>b.forEach(D=>D.fx.dispose())),j},vs=(e,t)=>{let n=t;for(;n<e.length&&typeof e[n]=="string"&&!e[n].trim();)n++;return n},Mt=e=>{let t=":if"in e.attrs,n=":elseif"in e.attrs,s=":else"in e.attrs;if((t?1:0)+(n?1:0)+(s?1:0)<2)return;let r=[t?":if":null,n?":elseif":null,s?":else":null].filter(Boolean);console.warn(`jq79: ${r.join(" and ")} on the same <${X(e)}> - only ${r[0]} applies; the branches of a chain are sibling elements, one directive each`)},No=(e,t)=>{let n=":elseif"in e.attrs?":elseif":":else";console.warn(t?`jq79: a second ${n} on <${X(e)}> - the chain before it already ended with :else, which closes it. One :if, any number of :elseif, at most one :else`:`jq79: ${n} on <${X(e)}> continues no :if - it renders unconditionally. A chain is :if, then :elseif, then :else, on adjacent siblings: anything but whitespace between them breaks it`)},vo=[":if",":elseif",":else",":each"],Po=(e,t)=>{if(e.tag!=="template"||e.ns!==void 0)return;let n=vo.find(s=>s in e.attrs);if(n!==void 0){if(Le(e)!==void 0){if(t?.component===void 0)return;console.warn(`jq79: ${n} on <template ${Le(e)}> is ignored - a slot is filled with its children as written. Put ${n} on the elements inside it, or on the component's tag`);return}console.warn(`jq79: ${n} on a nested <template> shows nothing - a <template>'s children live in its .content and never reach the page. Put ${n} on the elements themselves`)}},Co=[...Tt,":model",":slot"].map(e=>e.slice(1)),Mo={":attrs":':attrs was removed in 0.7 - it now binds an attribute called "attrs". Bind them one at a time (:disabled="x", :title="y"), or :class for classes'},Ao=e=>{for(let t in e.attrs){let n=Mo[t];n!==void 0&&console.warn(`jq79: ${n}`)}},ko=e=>{if(!(e.component!==void 0||e.tag.includes("-")))for(let t in e.attrs){if(!t.startsWith(":")||ye(t)||t===":model"||t.startsWith(":model."))continue;let n=t.slice(1);if(n.includes(".")){console.warn(`jq79: ${t} is not a directive - it bound an attribute named "${n}". Dotted modifiers belong to an event: if you meant @${n}, that is the spelling`);continue}let s=Co.find(r=>n!==r&&n.startsWith(r));s!==void 0&&console.warn(`jq79: ${t} is not a directive - it bound an attribute named "${n}". A ":name" jq79 does not recognize binds that attribute (which is what :src and :disabled are). If you meant :${s}, that is the spelling`)}},Ps=(e,t)=>{e.forEach(s=>{typeof s!="string"&&(Po(s,t),Ao(s),ko(s),Ps(s.children,s))});let n=!1;for(let s=0;s<e.length;){let r=e[s];if(typeof r=="string"){r.trim()&&(n=!1),s++;continue}if(":each"in r.attrs){n=!1,s++;continue}if(Mt(r),":if"in r.attrs){s++;let i=a=>{let l=vs(e,s),f=e[l];if(typeof f=="object"&&a in f.attrs)return s=l+1,f};for(let a=i(":elseif");a;a=i(":elseif"))Mt(a);let o=i(":else");o&&Mt(o),n=o!==void 0;continue}(":elseif"in r.attrs||":else"in r.attrs)&&No(r,n),n=!1,s++}},zn=new WeakMap,Oo=(e,t,n)=>{let s=zn.get(t);if(s)return s;let r=[{expr:t.attrs[":if"],node:t}],i=n+1,o=f=>{let d=vs(e,i),p=e[d];if(typeof p=="object"&&f in p.attrs)return i=d+1,p};for(let f=o(":elseif");f;f=o(":elseif"))r.push({expr:f.attrs[":elseif"],node:f});let a=o(":else");a&&r.push({node:a});let l={branches:r,next:i};return zn.set(t,l),l},be=(e,t,n,s=!1,r)=>{let i=r??document.createDocumentFragment(),o=0;for(;o<e.length;){let a=e[o];if(typeof a=="string"){let l=document.createTextNode(a);if(a.includes("{{")){let f=bt(a);n.effect(()=>{let d=hs(f,t);l.textContent!==d&&(l.textContent=d)})}i.appendChild(l),o++;continue}if(":each"in a.attrs){i.appendChild(xo(a,t,n,s)),o++;continue}if(":if"in a.attrs){let l=Oo(e,a,o);i.appendChild(So(l.branches,t,n,s)),o=l.next;continue}i.appendChild(Gt(a,t,n,s)),o++}return i},xi=(e,t,n=!1)=>be(e.template,t,me(t),n),ve="data-jq79",_o=e=>{let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return(t>>>0).toString(36)},Cs=(e,t)=>{e.forEach(n=>{typeof n!="string"&&(n.attrs[ve]=t,Cs(n.children,t))})},jo=(e,t)=>e.split(",").map(n=>{let s=n.trim(),r=s.indexOf("::"),i=r===-1?s:s.slice(0,r),o=r===-1?"":s.slice(r);return`${i}[${ve}="${t}"]${o}`}).join(", "),Ms=(e,t)=>{Array.from(e).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=jo(n.selectorText,t):n instanceof CSSGroupingRule&&Ms(n.cssRules,t)})},Lo=/(^|[\s>+~,(])([A-Z][A-Za-z0-9]*)(?![\w-])/g,Do=/[a-z]/,Io=e=>e.replace(Lo,(t,n,s)=>Do.test(s)?`${n}${_e(s)}`:t),qo=/^\s*@(media|supports|container|layer|scope|document)\b/i,Ho=/^\s*@/,Wo=e=>{let t="",n="",s="",r=[],i=()=>r.length===0||r[r.length-1],o=()=>{t+=i()&&!Ho.test(s)?Io(n):n,n=""},a=f=>{o(),t+=f,s+=f},l=(f,d)=>{o(),t+=f,s="",d!==void 0?r.push(d):f==="}"&&r.pop()};for(let f=0;f<e.length;){let d=e[f];if(d==="/"&&e[f+1]==="*"){let p=e.indexOf("*/",f+2),S=p===-1?e.length:p+2;a(e.slice(f,S)),f=S}else if(d==='"'||d==="'"){let p=f+1;for(;p<e.length&&e[p]!==d;)p+=e[p]==="\\"?2:1;a(e.slice(f,Math.min(p+1,e.length))),f=p+1}else d==="{"?(l("{",qo.test(s)),f++):d==="}"||d===";"?(l(d),f++):(n+=d,s+=d,f++)}return o(),t},Fo=(e,t)=>{/:deep\(|::v-deep|>>>/.test(e)&&console.warn("jq79: :deep()/::v-deep/>>> are not supported in <style scoped>; the rule will be dropped by the browser");let n=new CSSStyleSheet;return n.replaceSync(e),Ms(n.cssRules,t),Array.from(n.cssRules).map(s=>s.cssText).join(`
18
- `)},Dt=e=>{let t=wn(e),s=new DOMParser().parseFromString(`<template>${t}</template>`,"text/html").querySelector("template"),r=[],i=[];Array.from(s.content.children).forEach(l=>{l.tagName==="TEMPLATE"?i.push(l):r.push(l)});let o=Gn(r,e),a={};return i.forEach(l=>{let f=l.getAttribute("name");if(f===null){console.warn("jq79: a top-level <template> without a name declares nothing and was ignored");return}if(!Sn.test(f)){console.warn(`jq79: <template name="${f}"> was ignored - a component name has to be PascalCase, or no tag could ever reference it (only capitalized names resolve as components)`);return}if(f in a){console.warn(`jq79: two <template name="${f}"> in one file; the second was ignored`);return}a[f]=new de({...Gn(Array.from(l.content.children),l.innerHTML),siblings:a,name:f})}),Object.keys(a).length&&(o.siblings=a),o},Uo=/^(?:text|application)\/(?:x-)?typescript$/i,Bo=e=>"lang"in e?`lang="${e.lang}"`:Uo.test(e.type?.trim()??"")?`type="${e.type}"`:null,Gn=(e,t)=>{let n=[],s=[],r=[];e.forEach(o=>{let a={attrs:ns(o),content:o.textContent??""};o.tagName==="SCRIPT"?n.push(a):o.tagName==="STYLE"?s.push(a):r.push(rs(o))}),n.forEach(o=>{let a=Bo(o.attrs);a&&console.warn(`jq79: <script ${a}> needs the jq79/vite plugin to compile it. This component didn't go through the bundler, so its types were never stripped: the script will throw, or - for a plain \`let x: T = ...\` - silently fail to declare x.`)}),s.forEach(o=>{"lang"in o.attrs&&console.warn(`jq79: <style lang="${o.attrs.lang}"> needs the jq79/vite plugin to compile it. This component didn't go through the bundler, so its styles were left uncompiled and the browser will ignore them.`)}),s.forEach(o=>{"lang"in o.attrs||(o.content=Wo(o.content))});let i=o=>"scoped"in o.attrs&&!("lang"in o.attrs);if(s.some(i)){let o=_o(t);Cs(r,o),s.forEach(a=>{i(a)&&(a.scoped=Fo(a.content,o))})}return Ps(r),{template:r,scripts:n,styles:s}},Ye=e=>/\.html?([?#]|$)/.test(e)?Wt(e):import(e),As=/^(?:\.\.?\/|\/|[a-z][a-z0-9+.-]*:)/i,Vn=(e,t)=>{if(!As.test(e))return e;try{return new URL(e,new URL(t??"",document.baseURI)).href}catch{return e}},Ko=(e,t)=>e?`
19
- //# sourceURL=${e}?jq79-script=${t}`:"",ks=(e,t,n)=>{try{return Bt(e,t,Ko(n.filename,n.index??0))}catch(s){throw s instanceof Ne?new Error(`jq79: safeEval() is on, and script ${n.index??0} of ${n.filename??"a component built from a string"} ${s.reason}. ${s.hint}`):s}},Zn=e=>e.scoped??e.content,je=`:where([${Es}]) { display: contents }`,Vt=()=>Ut&&typeof Document<"u"&&"adoptedStyleSheets"in Document.prototype,Je=e=>{let t=new CSSStyleSheet;return t.replaceSync(e),t},Zt=(e,t)=>{e.adoptedStyleSheets.includes(t)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,t])},It=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(n=>n!==t)},Ge=null,qt=null,zo=()=>{if(Vt()){Zt(document,qt??(qt=Je(je)));return}Ge?.isConnected||(Ge=document.createElement("style"),Ge.textContent=je,document.head.appendChild(Ge))},et=new Map,Go=e=>{let t=et.get(e);if(!t){if(Vt()){let n=Je(e);Zt(document,n),t={sheet:n,count:0}}else{let n=document.createElement("style");n.textContent=e,document.head.appendChild(n),t={el:n,count:0}}et.set(e,t)}t.count++},Vo=e=>{let t=et.get(e);t&&--t.count<=0&&(t.sheet?It(document,t.sheet):t.el?.remove(),et.delete(e))},Zo=(e,t,n,s={},r=Ye,i={})=>{let o={...js,...s},a=new Proxy(t,{has:(d,p)=>p!=="$__effect"&&p!=="$__import"&&p!=="$__state"&&(Reflect.has(d,p)||!(p in globalThis)&&!(p in o))}),l={},f=ks(Rn(Object.keys(o)),xn(e),i)(a,n,r,l,...Object.values(o));return f.catch(d=>console.error("jq79: error in :setup script",d)),ds(f),{settled:f,sync:l.done===!0}},Qn=(e,t)=>{t?.forEach(({name:n,default:s})=>{e[n]===void 0&&(e[n]=s===void 0?void 0:_(s,e))})},Ht=e=>{let t=Pn(e);return!t&&e.attrs[":setup"]!==void 0&&Qo(e,e.attrs[":setup"]),t},Xn=new WeakSet,Qo=(e,t)=>{t.trim()==="_"||Xn.has(e)||(Xn.add(e),console.warn(`jq79: :setup="${t}" is not a props pattern, so this component declares no signature and takes whatever a parent passes - write the props it takes ("{ a, b }"), a bare :setup for none, or "_" to stay open on purpose`))},Xo=e=>{let t=null;return e.forEach(n=>{let s=ke(n.content)??Ht(n);if(!s)return;let r=t??(t=new Set);s.forEach(({name:i})=>r.add(i))}),t},Yn=(e,t)=>{if(t===null)return e;let n={};return Object.keys(e).forEach(s=>{t.has(s)&&(n[s]=e[s])}),n},Jn=new WeakMap,Yo=(e,t,n,s)=>{if(s===null)return;let r=Jn.get(e)??new Set;Jn.set(e,r),n.forEach(i=>{s.has(i)||r.has(i)||(r.add(i),console.warn(`jq79: :${i} is not declared by <${t}> - add it to the :setup signature, or drop it`))})},Jo=(e,t)=>{if(!e)return null;let n=Object.create(null),s=!1;return Object.entries(e).forEach(([r,i])=>{t.has(r)||(n[r]=i,s=!0)}),s?n:null},Os=Symbol("jq79.unfilledProps"),tt=Symbol("jq79.pendingScripts"),ei=e=>e&&e.default!==void 0?e.default:e,ti=(e,t,n,s={},r=Ye,i={})=>{let o={...js,...s},a={},l=ks(Nn(Object.keys(o)),vn(e),i)(a,ei,r,...Object.values(o)),f=I=>console.error("jq79: error in factory script",I),d=!1,p,S=()=>{if(d)return p;d=!0;let I=a.default;if(typeof I!="function")return;let z=j=>{j&&typeof j=="object"&&Object.assign(t,j)};try{let j=I(t,{$data:t,$props:t,$effect:n,...s});j instanceof Promise?p=j.then(z).catch(f):z(j)}catch(j){f(j)}return p},O=l.then(S,f);return ds(O),a.done&&S(),{settled:O,sync:a.done===!0&&p===void 0}},ni="__JQ79_HMR_ENABLED__",si="__JQ79_HMR__",Se=null,ri=e=>{if(!Se||!e.filename)return;let t=Se.get(e.filename);t||Se.set(e.filename,t=new Set),t.add(new WeakRef(e))},At=e=>{try{return new URL(e,document.baseURI).pathname}catch{return e}},oi=(e,t)=>{if(!Se)return 0;let n=At(e),s=Dt(t);ne?.forEach((a,l)=>{At(l)===n&&ne.set(l,Promise.resolve(t))});let r=!1,i=a=>a.name===void 0?s:s.siblings?.[a.name]??null,o=0;for(let[a,l]of Se)if(At(a)===n){for(let f of l){let d=f.deref();if(!d){l.delete(f);continue}let p=i(d);if(!p){r=!0;continue}d.hotReplace(p)&&o++}l.size||Se.delete(a)}return r?0:o},ii=()=>{Se??(Se=new Map),globalThis[si]={update:oi}},es=3e3,ai=(e,t)=>{let n=setTimeout(()=>{console.warn(`jq79: ${e.name?`<${e.name}>`:"a component"}${e.filename?` (${e.filename})`:""} has been waiting ${es/1e3}s for a :setup script and has rendered nothing. The template waits until every script returns or calls $mounted() - add an await $mounted() above the slow part to render first and fill in after.`)},es);n?.unref?.(),Promise.all(t).then(()=>clearTimeout(n))},li=e=>{if(As.test(e))return e;let t=import.meta.resolve;if(typeof t!="function")return e;try{return t(e)}catch{return e}},ne=new Map,ci=e=>{try{return new URL(e,document.baseURI).href.replace(/#.*$/,"")}catch{return e}},ts=e=>Promise.all([fetch(e).then(t=>{if(!t.ok)throw new Error(`failed to fetch component from ${e}: ${t.status}`);return t.text()}),_s?.then(()=>pi(e))]).then(([t])=>t),di=e=>{if(!ne)return ts(e);let t=ci(e),n=ne.get(t);if(!n){n=ts(e),ne.set(t,n);let s=n;s.catch(()=>{ne?.get(t)===s&&ne.delete(t)})}return n},Wt=async e=>{let t=li(e),n=await di(t);return new de(n,{filename:t})},_s,ui="/jq79-sw.js",fi=async e=>{let t=typeof navigator>"u"?void 0:navigator.serviceWorker;if(!t)throw new Error("jq79: safeEval() compiles components in a service worker, and this page can't have one - service workers need https (or localhost). Precompile with the jq79/vite plugin instead, or use safeEval({ nonce: true }) on a page whose server issues a nonce.");let n;try{n=await t.register(e)}catch(s){throw new Error(`jq79: safeEval() couldn't register its service worker at ${e} (${s.message}). Serve jq79-sw.js from the jq79 package at your site's root, or pass its URL: safeEval({ worker: "/path/jq79-sw.js" }).`)}await t.ready,!t.controller&&await new Promise(s=>{t.addEventListener("controllerchange",()=>s(),{once:!0}),t.controller?s():n.active?.postMessage("jq79:claim")})},pi=e=>{let t=new URL(e,document.baseURI);return t.hash="",t.searchParams.set(An,""),new Promise((n,s)=>{let r=document.createElement("script"),i=os();i&&r.setAttribute("nonce",i),r.src=t.href,r.onload=()=>{r.remove(),n()},r.onerror=()=>{r.remove(),s(new Error(`jq79: the precompiled functions of ${e} did not load, and safeEval() can't render it without them`))},document.head.append(r)})},ce=class ce{constructor(t,n={}){M(this,"template");M(this,"scripts");M(this,"styles");M(this,"modules");M(this,"filename");M(this,"siblings");M(this,"name");M(this,"slots");M(this,"modelWriteback");M(this,"data",null);M(this,"fx",null);M(this,"content",null);M(this,"startMarker",null);M(this,"endMarker",null);M(this,"styleEls",[]);M(this,"shadowCss",null);M(this,"shadowSheets",[]);M(this,"sheetRoot",null);M(this,"ownsSharedStyles",!1);M(this,"useShadow",!1);M(this,"mountRoot",null);M(this,"resolveMounted",null);M(this,"renderDone",!1);M(this,"held",0);M(this,"onPaint",null);M(this,"destroyHooks",null);M(this,"attachHooks",null);M(this,"detachHooks",null);M(this,"onPage",!1);M(this,"emitListeners",new Map);let s=typeof t=="string"?Dt(t):t;this.template=s.template,this.scripts=s.scripts,this.styles=s.styles,this.modules=n.modules??(typeof t=="string"?void 0:t.modules),this.filename=n.filename??(typeof t=="string"?void 0:t.filename),this.siblings=s.siblings,this.name=s.name,this.adoptSiblings(),ri(this)}adoptSiblings(){this.siblings&&Object.entries(this.siblings).forEach(([t,n])=>{n.filename??(n.filename=this.filename),n.modules??(n.modules=this.modules),this.name||(this[t]=n)})}hotReplace(t){let n=typeof t=="string"?Dt(t):t;Kt.clear(),we.clear(),Lt.clear();let s=this.startMarker,r=!!(s&&this.content),i=r&&s.isConnected,o=i?s.parentNode:null,a=i?this.endMarker.nextSibling:null,l={...this.data},f=this.useShadow;return r&&this.destroy(),this.template=n.template,this.scripts=n.scripts,this.styles=n.styles,this.siblings=n.siblings,this.adoptSiblings(),!r||(this.renderWith(l,f),!o)?!1:(f&&this.placeShadowStyles(o,a),o.insertBefore(this.content,a),this.mountRoot=o,this.settleMounted(),!0)}static debug(t){if(t){let n=le.scopedNames;for(let s in t){let r=t[s];Object.prototype.hasOwnProperty.call(le,s)?typeof r=="boolean"?le[s]=r:console.warn(`jq79: Component79.debug ignored "${s}" - the flags are booleans, and the ones it knows are: ${Object.keys(le).join(", ")}`):console.warn(`jq79: Component79.debug does not know "${s}" - the flags it has are: ${Object.keys(le).join(", ")}`)}le.scopedNames!==n&&Ze.clear()}return{...le}}static safeEval(t={}){Ut=!0;let n=[];if(t.nonce){let r=os();r===void 0?n.push(Promise.reject(new Error("jq79: safeEval({ nonce: true }) found no nonce on this page - no <script> carries one. The nonce belongs on the script that loads the page, the one the CSP names."))):_t=r}let s=t.worker??(t.nonce?!1:ui);return s!==!1&&n.push(_s??(_s=fi(s))),Promise.all(n).then(()=>{})}static cache(t){return t===!1?ne=null:t===!0&&(ne??(ne=new Map)),!!ne}static clearCache(){ne?.clear()}static fetch(t){if(Array.isArray(t))throw new TypeError("Component79.fetch takes one URL; use fetchAll for an array");return new Ft(Wt(t))}static fetchAll(t){return Promise.all(t.map(Wt))}static importAll(t){if(!Array.isArray(t))throw new TypeError("Component79.importAll takes an array; use import() for one");return Promise.all(t.map(n=>Ye(Vn(n,void 0))))}on(t,n){return this.emitListeners.has(t)||this.emitListeners.set(t,new Set),this.emitListeners.get(t).add(n),this}off(t,n){return this.emitListeners.get(t)?.delete(n),this}render(t={}){return this.renderWith(t,!1)}renderShadow(t={}){return this.renderWith(t,!0)}renderWith(t,n){this.destroy();let s=Cn(this.scripts,Ht),r=Jo(this.siblings,s),i=r?Object.assign(Object.create(r),t):{...t},o=new Set([...s].filter(y=>!(y in t)));o.size&&Object.defineProperty(i,Os,{value:o}),this.slots&&Object.defineProperty(i,ys,{value:this.slots}),Object.defineProperty(i,tt,{value:{count:0,owner:this}});let a=Me(i),l=me(a);this.data=a,this.fx=l,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let f=this.startMarker,d=!1,p=(y,P)=>{y==="model:update"&&!d&&(d=!0,console.warn("jq79: $emit('model:update', \u2026) no longer feeds :model - call $updateModel(value) or $updateModel(name, value) instead"));let C=new CustomEvent(y,{detail:P,bubbles:!0,composed:!0,cancelable:!0});return f===this.startMarker&&this.emitListeners.get(y)?.forEach(Q=>Q(C,P)),C.cancelBubble||f.dispatchEvent(C),!C.defaultPrevented},S,O=new Promise(y=>{S=y});this.resolveMounted=S,this.renderDone=!1,this.held=0;let I=y=>{if(typeof y!="function")throw new TypeError("jq79: $destroyed expects a function");return f!==this.startMarker?(xe(y,"$destroyed"),()=>{}):kt(this.destroyHooks??(this.destroyHooks=[]),y)},z=(y,{immediate:P=!0}={})=>{if(typeof y!="function")throw new TypeError("jq79: $attached expects a function");if(f!==this.startMarker)return()=>{};this.watchPage();let C=kt(this.attachHooks??(this.attachHooks=[]),y);return P&&this.onPage&&xe(y,"$attached"),C},j=y=>{if(typeof y!="function")throw new TypeError("jq79: $detached expects a function");return f!==this.startMarker?(xe(y,"$detached"),()=>{}):(this.watchPage(),kt(this.detachHooks??(this.detachHooks=[]),y))},b=y=>{let P=pt(y);return I(()=>P.$dispose()),P},H=this.endMarker,D=(y=>{let P=[];for(let C=f.nextSibling;C&&C!==H;C=C.nextSibling)C instanceof Element&&(C.matches(y)&&P.push(C),P.push(...Array.from(C.querySelectorAll(y))));return P}),L=(y=>D(y)[0]??null),U=this.modules,se=y=>U&&y in U?Promise.resolve(U[y]):Ye(Vn(y,this.filename)),v=y=>{if(!Array.isArray(y))throw new TypeError("$importAll takes an array; use import() for one");return Promise.all(y.map(se))},x=Object.assign(Object.create(null),{$emit:p,$updateModel:(...y)=>{let[P,C]=y.length>1?y:[void 0,y[0]];return f!==this.startMarker?!1:this.modelWriteback?.(P,C)??!1},$slots:Object.fromEntries(Object.keys(this.slots??{}).map(y=>[y,!0]))}),q=[],J=!0;this.scripts.forEach((y,P)=>{let C;q.push(new Promise(w=>{C=w}));let Q=!1,$=()=>{Q=!0,C()},B={$mounted:()=>($(),O),$destroyed:I,$attached:z,$detached:j,$computed:b,$self:L,$$self:D,...x,$importAll:v,...r},u={filename:this.filename,index:P},c=":mounted"in y.attrs,m=gn(y.content),h=(()=>{if(m!==null){c&&console.warn("jq79: :mounted on a factory script renders the template before the factory has returned, so none of its bindings exist yet - await $mounted() inside the factory instead."),Qn(a,ke(y.content));let T=c?Nt(m):m;return ti(T,a,R=>l.effect(R),B,se,u)}let{vars:w,code:g}=Ue(y.content);Qn(a,Ht(y)),w.forEach(T=>{T in a||(a[T]=void 0)});let E=c?Nt(g):g;return Zo(E,a,T=>l.effect(T),B,se,u)})();if(h.sync)h.settled.then($,$);else{let w=i[tt];w.count++;let g=()=>{w.count--,$()};h.settled.then(g,g)}!h.sync&&!Q&&(J=!1)});let G=document.createDocumentFragment(),Z=new Proxy(a,{has:(y,P)=>typeof P=="string"&&P in x||Reflect.has(y,P),get:(y,P,C)=>typeof P=="string"&&P in x&&!Reflect.has(y,P)?x[P]:Reflect.get(y,P,C)});if(G.append(this.startMarker,this.endMarker),this.content=G,J?(this.endMarker.parentNode.insertBefore(be(this.template,Z,l,n),this.endMarker),this.renderDone=!0,this.settleMounted()):(Promise.all(q).then(()=>{f===this.startMarker&&(this.endMarker.parentNode.insertBefore(be(this.template,Z,l,n),this.endMarker),this.renderDone=!0,this.settleMounted(),ce.settleAttached())}),ai(this,q)),n)if(Vt())this.shadowCss=[...this.styles.map(y=>y.content),je];else{let y=document.createElement("style");y.textContent=je,this.styleEls=[...this.styles.map(P=>{let C=document.createElement("style");return C.textContent=P.content,C}),y]}else this.styles.forEach(y=>Go(Zn(y))),this.ownsSharedStyles=!0;return this}mount(t,n){let s=typeof t=="string"?Pe(t):t;if(!s)throw new Error(`mount target not found: ${t}`);return(!this.content||n!==void 0)&&this.renderWith(n??{},this.useShadow),this.attach(s)}mountShadow(t,n){let s=typeof t=="string"?Pe(t):t;if(!s)throw new Error(`mount target not found: ${t}`);return(!this.content||n!==void 0||!this.useShadow)&&this.renderWith(n??{},!0),this.attach(s)}attach(t){this.mountRoot&&this.detach();let n=this.useShadow&&t instanceof Element?t.shadowRoot??t.attachShadow({mode:"open"}):t;return this.useShadow&&this.placeShadowStyles(n,null),n.appendChild(this.content),this.mountRoot=n,this.settleMounted(),ce.settleAttached(),this}isOnPage(){return this.renderDone&&this.startMarker?.isConnected===!0}watchPage(){fe.has(this)||(fe.add(this),this.onPage=this.isOnPage(),this.onPage||ce.queueSettle())}static queueSettle(){Ot||(Ot=!0,queueMicrotask(()=>{Ot=!1,ce.settleAttached()}))}static settleAttached(){if(fe.size===0)return;let t=[...fe].filter(n=>!n.onPage&&n.isOnPage());ce.inDocumentOrder(t).forEach(n=>{n.onPage||!fe.has(n)||(n.onPage=!0,n.attachHooks?.slice().forEach(s=>xe(s,"$attached")))})}notifyDetached(){if(fe.size===0)return;let t=[];if(this.startMarker?.isConnected){let n=new Set;for(let r=this.startMarker;r&&(n.add(r),r!==this.endMarker);r=r.nextSibling);let s=r=>{for(;r;r=r.parentNode)if(n.has(r))return!0;return!1};t=ce.inDocumentOrder([...fe].filter(r=>r.onPage&&s(r.startMarker)))}else this.onPage&&(t=[this]);t.forEach(n=>{n.onPage&&(n.onPage=!1,n.detachHooks?.slice().forEach(s=>xe(s,"$detached")))})}static inDocumentOrder(t){return t.sort((n,s)=>n.startMarker.compareDocumentPosition(s.startMarker)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}placeShadowStyles(t,n){if(this.shadowCss&&typeof ShadowRoot<"u"&&t instanceof ShadowRoot){this.sheetRoot&&this.sheetRoot!==t&&this.shadowSheets.forEach(s=>It(this.sheetRoot,s)),this.shadowSheets.length===0&&(this.shadowSheets=this.shadowCss.map(s=>s===je?qt??(qt=Je(s)):Je(s))),this.shadowSheets.forEach(s=>Zt(t,s)),this.sheetRoot=t;return}this.shadowCss&&this.styleEls.length===0&&(this.styleEls=this.shadowCss.map(s=>{let r=document.createElement("style");return r.textContent=s,r})),this.styleEls.forEach(s=>t.insertBefore(s,n))}settleMounted(){if(!this.renderDone||this.held>0)return;let t=this.onPaint;this.onPaint=null,t?.(),this.mountRoot&&this.resolveMounted?.()}holdOwner(t){this.renderDone&&this.held===0||(t.held++,this.onPaint=()=>{t.held--,t.settleMounted()})}detach(){if(!this.mountRoot||!this.content||!this.startMarker||!this.endMarker)return this;this.notifyDetached();let t=this.startMarker;for(;t;){let n=t.nextSibling;if(this.content.appendChild(t),t===this.endMarker)break;t=n}return this.mountRoot=null,this}destroy(){this.notifyDetached(),fe.delete(this),this.attachHooks=null,this.detachHooks=null,this.onPage=!1;let t=this.destroyHooks;this.destroyHooks=null,t?.forEach(s=>xe(s,"$destroyed")),this.resolveMounted=null;let n=this.onPaint;return this.onPaint=null,n?.(),this.detach(),this.fx?.dispose(),this.fx=null,this.data?.$dispose(),this.styleEls.forEach(s=>s.parentNode?.removeChild(s)),this.styleEls=[],this.sheetRoot&&this.shadowSheets.forEach(s=>{s!==qt&&It(this.sheetRoot,s)}),this.shadowCss=null,this.shadowSheets=[],this.sheetRoot=null,this.ownsSharedStyles&&(this.styles.forEach(s=>Vo(Zn(s))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.renderDone=!1,this.data=null,this.resolveMounted=null,this}};M(ce,"version",kr);var de=ce,Ft=class{constructor(t){M(this,"chain");this.chain=t}queue(t){return this.chain=this.chain.then(n=>(t(n),n)),this}then(t,n){return this.chain.then(t,n)}catch(t){return this.chain.catch(t)}finally(t){return this.chain.finally(t)}mount(t,n){return this.queue(s=>s.mount(t,n))}mountShadow(t,n){return this.queue(s=>s.mountShadow(t,n))}render(t={}){return this.queue(n=>n.render(t))}renderShadow(t={}){return this.queue(n=>n.renderShadow(t))}on(t,n){return this.queue(s=>s.on(t,n))}off(t,n){return this.queue(s=>s.off(t,n))}detach(){return this.queue(t=>t.detach())}destroy(){return this.queue(t=>t.destroy())}};var Ni=e=>new de(e),xe=(e,t)=>{try{e()}catch(n){console.error(`jq79: error in a ${t} hook`,n)}},kt=(e,t)=>(e.push(t),()=>{let n=e.indexOf(t);n!==-1&&e.splice(n,1)}),fe=new Set,Ot=!1,js={$:Pe,$$:rt,$create:ot,$reactive:Me,$toRaw:V,Component79:de,C79:de};typeof globalThis<"u"&&globalThis[ni]&&ii();export{Pe as $,rt as $$,pt as $computed,ot as $create,Me as $reactive,V as $toRaw,de as C79,de as Component79,Ft as PendingComponent79,ii as enableHotReload,oi as hotUpdate,Ni as parseComponent,xi as renderComponent};
17
+ }`;var to="0.7.12",Es=e=>Object.fromEntries(Array.from(e.attributes).map(t=>[t.name,t.value])),ws="http://www.w3.org/1999/xhtml",Ss=e=>{let t=Es(e),n=e.namespaceURI,s=t[Le];delete t[Le];let r=n!==null&&n!==ws;return{tag:r?e.tagName:e.tagName.toLowerCase(),attrs:t,...s===void 0?{}:{component:s},...r?{ns:n}:{},children:Array.from((e instanceof HTMLTemplateElement?e.content:e).childNodes).flatMap(i=>{if(i.nodeType===Node.TEXT_NODE){let o=i.textContent??"";return o?[o]:[]}return i.nodeType===Node.ELEMENT_NODE?[Ss(i)]:[]})}},nt=new Map,tt=new Map,en=!1,Ut,Me=class extends Error{constructor(n,s){super(`${n}. ${s}`);k(this,"reason",n);k(this,"hint",s)}},no=()=>new Me("was not precompiled","Safe mode never builds code at runtime: the component's precompiled functions did not reach the page."),so=(e,t)=>{let n=globalThis[Un];if(Array.isArray(n)&&n.length>0)for(let[s,r,i]of n.splice(0))tt.set(Je(s,r),i);return tt.size===0?void 0:tt.get(Je(e,t))},tn=(e,t,n="")=>{let s=so(e,t);if(s===null)throw new SyntaxError("jq79: this code did not compile when it was precompiled");if(s!==void 0)return s;if(Ut!==void 0)return ro(e,t,n,Ut);if(en)throw no();return new Function(...e,t+n)},nn=()=>{if(!(typeof document>"u"))for(let e of Array.from(document.querySelectorAll("script[nonce]"))){let t=e.nonce||e.getAttribute("nonce");if(t)return t}},Gn="__jq79built",ro=(e,t,n,s)=>{let r=document.createElement("script");r.setAttribute("nonce",s),r.textContent=`document.currentScript.${Gn} = ${Kn(e,t)}${n}`;let i,o=a=>{i=a.error??new SyntaxError(a.message),a.preventDefault()};window.addEventListener("error",o);try{(document.head??document.documentElement).append(r)}finally{window.removeEventListener("error",o),r.remove()}let l=r[Gn];if(typeof l=="function")return tt.set(Je(e,t),l),l;throw i!==void 0?i:new Me("could not be built","The page's CSP refused a <script> carrying the nonce jq79 read from the page.")},Vn=new Set,oo=(e,t)=>{Vn.has(e)||(Vn.add(e),console.error(`jq79: safeEval() is on, and "${e}" ${t.reason}, so it rendered as nothing. ${t.hint}`))},Lt=(e,t)=>{if(!(t in e)){if(t in globalThis)return globalThis[t];throw new ReferenceError(`${t} is not defined`)}},bs=(e,t)=>{try{return tn([..._t,...t],Ln(e))}catch(n){return n instanceof Me&&oo(e,n),null}},io=(e,t)=>{if(!ce.scopedNames)return null;let n=Dn(e,t);if(n===null)return null;try{return tn([..._t,...t],n)}catch{return null}},Ts=(e,t,n)=>{let s=nt.get(e);if(s===void 0){let r=io(t,n);s=r?{fn:r,scoped:!0}:{fn:bs(t,n),scoped:!1},nt.set(e,s)}return s},$s=(e,t)=>`${t.join(",")}|${e}`,lo=(e,t)=>Ts($s(e,t),e,t).fn,ao=(e,t,n)=>{let s=bs(t,n);return nt.set(e,{fn:s,scoped:!1}),s},co=/^(?:([\w$]+) is not defined|Can't find variable: ([\w$]+))/,uo=100,be=new Map,sn=new Set,st=0,zt=!1,Kt=new Set,fo=()=>{zt=!1,!(st>0)&&(be.forEach(({name:e,expr:t,scope:n},s)=>{e in n||(sn.add(s),console.warn(`jq79: ${e} is not defined - evaluating "${t}". Template expressions resolve against the component store: a top-level let/var/const in a :setup script, a declared prop, or a global. Note a "function name() {}" declaration is not on the store - write "const name = () => {}".`))}),be.clear())},Rs=()=>{zt||st>0||!be.size||(zt=!0,queueMicrotask(fo))},xs=e=>{st++;let t=()=>{st--,Rs()};e.then(t,t)},po=(e,t)=>{if(Kt.has(e))return;Kt.add(e);let n=t?.message||String(t);console.error(`jq79: ${n} - evaluating "${e}". The expression rendered as nothing. If the value arrives later, guard it - "a?.b", or :if on the element.`)},Ns=(e,t,n)=>{if(!(n instanceof ReferenceError))return po(e,n);let s=co.exec(n.message),r=s?.[1]??s?.[2];if(!r)return;let i=`${r}|${e}`;sn.has(i)||be.has(i)||be.size>=uo||(be.set(i,{name:r,expr:e,scope:t}),Rs())},vs=(e,t,n)=>{let s=n?Object.keys(n):[],r=$s(e,s),{fn:i,scoped:o}=Ts(r,e,s);if(!i)return;let l=n?Object.values(n):[];if(!o)return i(t,Lt,...l);try{return i(t,Lt,...l)}catch(a){if(!(a instanceof ReferenceError))throw a;let c=ao(r,e,s);if(!c)throw a;return c(t,Lt,...l)}},_=(e,t,n)=>{try{return vs(e,t,n)}catch(s){Ns(e,t,s);return}},Ps=(e,t,n)=>{try{return vs(e,t,n)}catch(s){if(!(s instanceof ReferenceError))throw s;Ns(e,t,s);return}},Cs=(e,t)=>{if(e.length===1){let s=e[0];return typeof s=="string"?s:String(_(s.expr,t)??"")}let n="";for(let s of e)n+=typeof s=="string"?s:String(_(s.expr,t)??"");return n},Ms=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i);e.addEventListener(r,l=>{if(o.has("self")&&l.target!==e)return;o.has("prevent")&&l.preventDefault(),o.has("stop")&&l.stopPropagation();let a=Ps(n,s,{$event:l});typeof a=="function"&&a.call(e,l)},{once:o.has("once"),capture:o.has("capture")})},ho=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i),l=a=>{o.has("prevent")&&a.preventDefault(),o.has("stop")&&a.stopPropagation(),o.has("once")&&e.off(r,l),Ne(()=>{let c=Ps(n,s,{$event:a});typeof c=="function"&&c(a)})};e.on(r,l)},rn=e=>e instanceof DocumentFragment?{first:e.firstChild,last:e.lastChild}:{first:e,last:e},dt=({first:e,last:t})=>{for(let n=e;n;){let s=n===t?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},go=e=>{e.forEach(t=>{if(t.first===t.last)return dt(t);if(!t.first.parentNode)return;let s=document.createRange();s.setStartBefore(t.first),s.setEndAfter(t.last),s.deleteContents()})},mo=(e,t)=>{let n=[],s=null;return e.forEach(r=>{if(!t(r)){s=null;return}s&&s.last.nextSibling===r.range.first?s.last=r.range.last:n.push(s={first:r.range.first,last:r.range.last})}),n},yo=({first:e,last:t},n)=>{let s=n.nextSibling;for(let r=e;r;){let i=r===t?null:r.nextSibling;n.parentNode.insertBefore(r,s),r=i}},Zn=(e,t)=>{let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s))for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r;return null},Se=null,rt=null,As=new WeakSet,Eo=e=>{let t={memo:Se,base:rt};return Se=new Map,rt=e,t},wo=e=>{Se=e.memo,rt=e.base},Qn=(e,t)=>e.component!==void 0?Xn(t,e.component):e.tag.includes("-")?Xn(t,e.tag):null,Y=e=>e.component??e.tag,Xn=(e,t)=>{if(!Se)return Zn(e,t);let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s)){if(s===rt){if(Se.has(t))return Se.get(t);let r=Zn(s,t);return Se.set(t,r),r}if(!As.has(s)){for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r}}return null},So=e=>{let t=new Set;for(let n=e;n&&n!==Object.prototype;n=Object.getPrototypeOf(n))for(let s of Object.keys(n))/^[A-Z]/.test(s)&&t.add(s);return[...t].sort()},bo=(e,t)=>{let n=So(t);return new Error(`jq79: <${e}> is not defined - no component of that name is in scope, and nothing renders here. Import it in a :setup script, declare it as a prop, or add a <template name="${e}"> to this file. In scope: ${n.length?n.join(", "):"(none)"}.`)},Yn=100,Dt=0,ks=Symbol("jq79.slots"),qe=e=>Object.keys(e.attrs).find(t=>t===":slot"||t.startsWith(":slot.")),To=e=>e==="default"?":slot":`:slot.${e}`,$o=e=>typeof e!="string"||e.trim()!=="",Ro=e=>{let t={},n=[];e.children.forEach(r=>{let i=typeof r=="object"&&r.tag==="template"?qe(r):void 0;if(typeof r=="string"||i===void 0){n.push(r);return}let o=kt(i.slice(6));if(o in t){console.warn(`jq79: two <template ${To(o)}> in <${Y(e)}>; the second was ignored`);return}t[o]={nodes:r.children,binder:r.attrs[i]||void 0}});let s=n.some($o);return s&&"default"in t?console.warn(`jq79: <${Y(e)}> has both a <template :slot> and content outside it - the <template> is the default slot's content, and the rest was ignored`):s&&(t.default={nodes:n,binder:e.attrs[":slot"]||void 0}),t},xo=(e,t,n)=>{_e(t)?.forEach(({name:s,as:r,default:i})=>{let o=r??s;Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>{let l=n[s]?.();return l===void 0&&i!==void 0?_(i,e):l},set:()=>console.warn(`jq79: "${o}" is a slot prop - it comes from the component, so assigning to it does nothing`)})})},No=e=>{let t=qe(e);return console.warn(`jq79: <template ${t}> fills a slot only as a direct child of a component tag; here it rendered nothing`),document.createComment(`misplaced ${t}`)},vo=(e,t)=>{let n=Object.entries(Ro(e));if(!n.length)return null;let s={};return n.forEach(([r,i])=>{s[r]=Po(i,t)}),s},Po=(e,t)=>(n,s,r,i)=>{let o=Object.create(t);xo(o,e.binder,n);let l=o[Fe]??[];Object.defineProperty(o,Fe,{value:[...l,s]});let a=Ee(o);return a.ownedBy(s),r.onDispose(()=>a.dispose()),$e(e.nodes,o,a,i)},Co=(e,t,n,s)=>{let r=kt(e.tag.slice(5)),i=document.createDocumentFragment(),o=document.createComment(e.tag),l=document.createComment(`/${e.tag}`);i.append(o,l);let a=t[ks]?.[r];if(!a)return i.insertBefore($e(e.children,t,n,s),l),i;let c={};return Object.entries(e.attrs).forEach(([u,p])=>{if(!(u===Ae||we(u)||u.startsWith("@")))if(u.startsWith(":")){let b=p||u.slice(1);c[le(u.slice(1))]=()=>_(b,t)}else c[le(u)]=()=>p}),i.insertBefore(a(c,t,n,s),l),i},Os="data-c79-box",Mo=(e,t,n)=>{if(t.ns!==void 0)return document.createDocumentFragment();let s=document.createElement(De(e));s.setAttribute(Os,"");let r=t.attrs[Ae];return r!==void 0&&s.setAttribute(Ae,r),n||Ei(),s},Jn=new WeakSet,Ao=(e,t)=>{if(e.ns===void 0||Jn.has(e))return;let n=t.template.find(r=>typeof r=="object");if(n===void 0||n.ns!==void 0)return;Jn.add(e);let s=e.ns==="http://www.w3.org/1998/Math/MathML"?"<math>":"<svg>";console.warn(`jq79: <${Y(e)}> is used inside ${s} and its template starts with <${n.tag.toLowerCase()}>, which is parsed as HTML - it renders and never draws. A component's template decides its own namespace, so root it at ${s}`)},es=(e,t,n,s,r)=>{let i=Mo(e,t,r),o=!(i instanceof DocumentFragment),l=o?null:document.createComment(`/${e}`);o||i.append(document.createComment(e),l);let a=vo(t,n),c={},u={},p=[],b=[],M=!1,H;Object.entries(t.attrs).forEach(([y,T])=>{if(y!==Ae){if(y===":props"||y.startsWith(":props.")){M=!0,b.push({expr:T});return}if(we(y)){xi.has(y)&&(H??(H=[])).push(y.slice(1));return}if(y.startsWith("@"))p.push([y,T]);else if(y===":model"||y.startsWith(":model.")){let N=y===":model"?"default":le(y.slice(7));u[N]=T||(y===":model"?"model":N)}else if(y.startsWith(":")){let N=le(y.slice(1));c[N]=T||N,b.push({name:N,expr:T||N})}else{let N=le(y),I=JSON.stringify(T);c[N]=I,b.push({name:N,expr:I})}}});let q=y=>y==="default"?":model":`:model.${y}`,D=y=>y==="default"?"model":y,R=new Set;Object.entries(u).forEach(([y,T])=>{let N=D(y);c[N]!==void 0&&console.warn(`jq79: <${Y(t)}> binds prop "${N}" through both :${N} and ${q(y)} - ${q(y)} wins`),c[N]=T,lo(Ot(T),["$value"])===null&&(R.add(y),console.warn(`jq79: ${q(y)}="${T}" is not assignable - updates from <${Y(t)}> will be dropped`))});let j=()=>{let y={};return b.forEach(({name:T,expr:N})=>{if(T!==void 0)y[T]=_(N,n);else{let I=_(N,n);I!==null&&typeof I=="object"&&Object.assign(y,I)}}),Object.entries(u).forEach(([T,N])=>{y[D(T)]=_(N,n)}),y},O=null,W=null,z=null,K=new Set,X=y=>{if(y==null){if(!n[Qs]?.has(e)||K.has("unfilled"))return;K.add("unfilled"),console.error(`jq79: <${Y(t)}> is declared as a prop and the parent passed nothing - nothing renders here. Pass it (:${e}="\u2026"), or drop it from the signature to use the one declared in this file.`);return}K.has("type")||(K.add("type"),console.error(`jq79: <${Y(t)}> is ${typeof y}, not a component - nothing renders here`))};return s.effect(()=>{let y=_(e,n),T=y instanceof ue?y:null;if(T||X(y),T===W||(z?.dispose(),z=null,O?.destroy(),O=null,W=T,!T))return;Ao(t,T);let N=new ue({template:T.template,scripts:T.scripts,styles:T.styles,modules:T.modules,filename:T.filename,siblings:T.siblings,name:T.name});if(a&&(N.slots=a),Object.keys(u).length){let P=new Set;N.modelWriteback=(L,B)=>{let G=L==null?"default":le(String(L)),te=u[G];return te===void 0?(P.has(G)||(P.add(G),console.warn(`jq79: <${Y(t)}> has no ${q(G)} - bound: ${Object.keys(u).map(q).join(", ")}`)),!1):R.has(G)?!1:(Ne(()=>_(Ot(te),n,{$value:B})),!0)}}p.forEach(([P,L])=>ho(N,P,L,n));let I=$i(N.scripts);Ri(t,e,Object.keys(c),I),H&&Ni(t,e,H,I);let F=us(Ne(j),I),V=document.createDocumentFragment();if(Dt>=Yn){console.error(`jq79: <${Y(t)}> is ${Yn} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}Dt++;try{(r?N.renderShadow(F):N.render(F)).mount(V)}finally{Dt--}let w=n[at];w&&N.holdOwner(w.owner),l?l.parentNode.insertBefore(V,l):i.appendChild(V);let A=Ee(n,!0);if(M){let P=[];A.effect(()=>{let L=us(j(),I),B=Object.keys(L);P.forEach(G=>{G in L||(N.data[G]=void 0)}),B.forEach(G=>{N.data[G]=L[G]}),P=B})}else Object.entries(c).forEach(([P,L])=>{I!==null&&!I.has(P)||A.effect(()=>{N.data[P]=_(L,n)})});z=A,O=N}),s.onDispose(()=>{z?.dispose(),O?.destroy()}),i},ko=(e,t)=>{let n=()=>{let s=_(e,t);return s!==null&&typeof s=="object"?s:null};return new Proxy(t,{has(s,r){let i=n();return i!==null&&Reflect.has(i,r)||Reflect.has(s,r)},get(s,r){let i=n();return i!==null&&Reflect.has(i,r)?i[r]:Reflect.get(s,r)},set(s,r,i){let o=n();return o!==null&&Reflect.has(o,r)?(o[r]=i,!0):Reflect.set(s,r,i)}})},ge=e=>typeof e=="string"?e.split(/\s+/).filter(Boolean):Array.isArray(e)?e.flatMap(ge):e!==null&&typeof e=="object"?Object.entries(e).flatMap(([t,n])=>n?ge(t):[]):[],Oo=e=>typeof e=="function"?(t,n,s)=>{try{return!!e(t,n,s)}catch{return!1}}:typeof e=="string"||Array.isArray(e)?pn(e):()=>!1,_o=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),on=e=>e.ns===void 0?document.createElement(e.tag):document.createElementNS(e.ns,e.tag),jo={"http://www.w3.org/2000/svg":["svg","feGaussianBlur"],"http://www.w3.org/1998/Math/MathML":["math","mi"]},ts=new Map,Lo=(e,t)=>{let n=`${e} ${t}`,s=ts.get(n);if(s!==void 0)return s;let r=jo[e],i=t;if(r!==void 0&&typeof DOMParser<"u"&&/^[a-z][a-z0-9]*$/.test(t)){let[o,l]=r;i=new DOMParser().parseFromString(`<${o}><${l} ${t}="x"/></${o}>`,"text/html").querySelector(l)?.getAttributeNames().find(c=>c.toLowerCase()===t)??t}return ts.set(n,i),i},_s=(e,t)=>{let n=e.namespaceURI;if(n===null||n===ws)return t;let s=t.replace(/-/g,"").toLowerCase(),r=Lo(n,s);return r===s?t:r},js=(e,t,n)=>{let s=_o.has(t);(s?!n:n==null)?e.removeAttribute(t):e.setAttribute(t,s?"":String(n))},ce={cloneSkeletons:!0,scopedNames:!0},Do=new Set([":text",":html",":value",":checked",":selected"]),Io=e=>e.startsWith("@")||e===":class"||e.startsWith(":class.")||Do.has(e)?!0:e.startsWith(":")?e===":model"?!1:!we(e)&&!e.includes("."):e!==Le,Ls=e=>{if(e.component||e.tag.includes("-")||Ye(e.tag)||e.tag==="template"||e.ns===void 0&&document.createElement(e.tag)instanceof HTMLUnknownElement)return!1;for(let t in e.attrs)if(!Io(t))return!1;return e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?!0:e.children.every(t=>typeof t=="string"||Ls(t))},Ds=(e,t,n)=>{let s=on(e),r,i=null;for(let p in e.attrs){let b=e.attrs[p];if(p.startsWith("@"))n.push({kind:"event",path:t,attr:p,expr:b});else if(p===":class")r=b;else if(p.startsWith(":class."))(i??(i=[])).push([p.slice(7),b]);else if(!we(p))if(p.startsWith(":")){let M=p.slice(1);n.push({kind:"attr",path:t,name:_s(s,M),expr:b||le(M)})}else s.setAttribute(p,b)}(r!==void 0||i)&&n.push({kind:"class",path:t,classExpr:r,toggles:i,staticClasses:new Set(ge(e.attrs.class??""))});let o=e.attrs[":text"],l=e.attrs[":html"];o!==void 0?n.push({kind:"textContent",path:t,expr:o}):l!==void 0?n.push({kind:"html",path:t,expr:l}):e.children.forEach((p,b)=>{if(typeof p=="string"){p.includes("{{")?(n.push({kind:"text",path:[...t,b],parts:Mt(p)}),s.appendChild(document.createTextNode(""))):s.appendChild(document.createTextNode(p));return}s.appendChild(Ds(p,[...t,b],n))});let a=e.attrs[":value"];a!==void 0&&n.push({kind:"value",path:t,expr:a});let c=e.attrs[":checked"];c!==void 0&&n.push({kind:"checked",path:t,expr:c});let u=e.attrs[":selected"];return u!==void 0&&n.push({kind:"selected",path:t,expr:u}),s},qo=3,Is=e=>e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?1:1+e.children.reduce((t,n)=>t+(typeof n=="string"?0:Is(n)),0),ns=new WeakMap,ss=new WeakSet,Ho=e=>{let t=ns.get(e);if(t!==void 0)return t;if(!ss.has(e))return ss.add(e),null;let n=null;if(Ls(e)&&Is(e)>=qo){let s=[];n={skeleton:Ds(e,[],s),ops:s}}return ns.set(e,n),n},Wo=(e,t)=>{let n=e;for(let s=0;s<t.length;s++)n=n.childNodes[t[s]];return n},Fo=(e,t,n)=>{let s=e.skeleton.cloneNode(!0);for(let r of e.ops){let i=r.path.length===0?s:Wo(s,r.path);if(r.kind==="text"){let o=i,l=r.parts;n.effect(()=>{let a=Cs(l,t);o.textContent!==a&&(o.textContent=a)})}else if(r.kind==="event")Ms(i,r.attr,r.expr,t);else if(r.kind==="attr"){let o=i,{name:l,expr:a}=r;n.effect(()=>js(o,l,_(a,t)))}else if(r.kind==="class"){let o=i,{classExpr:l,toggles:a,staticClasses:c}=r,u=[];n.effect(()=>{let p=l!==void 0?ge(_(l,t)):[];a?.forEach(([b,M])=>{_(M,t)&&p.push(...ge(b))}),u.forEach(b=>{!p.includes(b)&&!c.has(b)&&o.classList.remove(b)}),o.classList.add(...p),u=p})}else if(r.kind==="textContent"){let o=i,{expr:l}=r;n.effect(()=>{let a=String(_(l,t)??"");o.textContent!==a&&(o.textContent=a)})}else if(r.kind==="html"){let o=i,{expr:l}=r;n.effect(()=>{o.innerHTML=ht(String(_(l,t)??""))})}else if(r.kind==="value"){let o=i,{expr:l}=r;n.effect(()=>{let a=String(_(l,t)??"");o.value!==a&&(o.value=a)})}else if(r.kind==="checked"){let o=i,{expr:l}=r;n.effect(()=>{let a=!!_(l,t);o.checked!==a&&(o.checked=a)})}else if(r.kind==="selected"){let o=i,{expr:l}=r;n.effect(()=>{let a=!!_(l,t);o.selected!==a&&(o.selected=a)})}else{let o=r}}return s},ln=(e,t,n,s)=>{let r=e.attrs[":with"],i=r!==void 0?ko(r,t):t;if(Ye(e.tag))return Co(e,i,n,s);if(e.tag==="template"&&qe(e)!==void 0)return No(e);let o=Qn(e,i);if(o)return es(o,e,i,n,s);if(ce.cloneSkeletons){let R=Ho(e);if(R)return Fo(R,i,n)}let l=on(e);if(e.component!==void 0&&i[at]?.count===0)throw bo(e.component,i);let a=e.ns===void 0&&(e.component!==void 0||e.tag.includes("-"));if(a){let R=!1;n.effect(()=>{if(R)return;let j=Qn(e,i);if(!j)return;R=!0;let O=es(j,e,i,n,s),W=rn(O);n.onDispose(()=>dt(W)),l.replaceWith(O)})}for(let R in e.attrs){let j=e.attrs[R];if(R.startsWith("@"))Ms(l,R,j,i);else if(R===":model"||R.startsWith(":model."))a||console.warn(`jq79: ${R} on <${Y(e)}> does nothing - :model binds component tags only (for now)`);else if(!we(R))if(R.startsWith(":"))if(a)l.setAttribute(R,j);else{let O=R.slice(1),W=j||le(O),z=_s(l,O);n.effect(()=>js(l,z,_(W,i)))}else l.setAttribute(R,j)}let c=e.attrs[":class"],u=null;for(let R in e.attrs)R.startsWith(":class.")&&(u??(u=[])).push([R.slice(7),e.attrs[R]]);if(c!==void 0||u){let R=new Set(ge(e.attrs.class??"")),j=[];n.effect(()=>{let O=c!==void 0?ge(_(c,i)):[];u?.forEach(([W,z])=>{_(z,i)&&O.push(...ge(W))}),j.forEach(W=>{!O.includes(W)&&!R.has(W)&&l.classList.remove(W)}),l.classList.add(...O),j=O})}let p=e.attrs[":text"],b=e.attrs[":html"],M=e.attrs[":html.allowed"];M!==void 0&&b===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),p!==void 0?n.effect(()=>{let R=String(_(p,i)??"");l.textContent!==R&&(l.textContent=R)}):b!==void 0?n.effect(()=>{let R=M!==void 0?{allowUrl:Oo(_(M,i))}:void 0;l.innerHTML=ht(String(_(b,i)??""),R)}):l instanceof HTMLTemplateElement?$e(e.children,i,n,s,l.content):$e(e.children,i,n,s,l);let H=e.attrs[":value"];H!==void 0&&n.effect(()=>{let R=String(_(H,i)??"");l.value!==R&&(l.value=R)});let q=e.attrs[":checked"];q!==void 0&&n.effect(()=>{let R=!!_(q,i);l.checked!==R&&(l.checked=R)});let D=e.attrs[":selected"];return D!==void 0&&n.effect(()=>{let R=!!_(D,i);l.selected!==R&&(l.selected=R)}),l},Bo=(e,t,n,s)=>{let r=document.createComment("if"),i=document.createDocumentFragment();i.appendChild(r);let o=null,l=null,a=null;return n.effect(()=>{let c=e.find(p=>p.expr===void 0||_(p.expr,t))??null;if(c===l||(a?.dispose(),o&&dt(o),o=null,l=c,!c))return;a=Ee(t);let u=ln(c.node,t,a,s);o=rn(u),r.parentNode.insertBefore(u,r.nextSibling)}),n.onDispose(()=>a?.dispose()),i},Pe=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})},Uo=e=>{let t=new Uint8Array(e.length),n=[],s=new Int32Array(e.length).fill(-1);for(let r=0;r<e.length;r++){let i=e[r];if(i<0)continue;let o=0,l=n.length;for(;o<l;){let a=o+l>>1;e[n[a]]<i?o=a+1:l=a}o>0&&(s[r]=n[o-1]),n[o]=r}for(let r=n.length?n[n.length-1]:-1;r!==-1;r=s[r])t[r]=1;return t},zo=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},qs=(e,t)=>typeof e=="string"?t.some(n=>os(e,n)):Object.values(e.attrs).some(n=>t.some(s=>os(n,s)))||e.children.some(n=>qs(n,t)),Hs=e=>typeof e!="string"&&(":if"in e.attrs||":elseif"in e.attrs||":else"in e.attrs||":each"in e.attrs||e.component!==void 0||e.tag.includes("-")||Ye(e.tag)||e.children.some(Hs)),rs=/[A-Za-z0-9_$]/,Ko=/^[A-Za-z_$][\w$]*\.[A-Za-z_$][\w$]*$/,os=(e,t)=>{for(let n=e.indexOf(t);n!==-1;n=e.indexOf(t,n+1)){let s=n===0?"":e[n-1],r=e[n+t.length]??"";if(!rs.test(s)&&!rs.test(r))return!0}return!1},It=new WeakMap,Go=e=>{let t=It.get(e);if(t!==void 0)return t;let n=e.attrs[":each"].match(jn);if(!n)return It.set(e,null),null;let[,s,r,i]=n,o=e.attrs[":key"],l=o===s,a=o!==void 0&&!l&&Ko.test(o)&&o.startsWith(`${s}.`)?o.slice(s.length+1):void 0,{[":each"]:c,[":key"]:u,[":window"]:p,...b}=e.attrs,M={...e,attrs:b},H=["$index",...r?[r]:[]],q=qs(M,H),D=/^[A-Z]/.test(s)||r!==void 0&&/^[A-Z]/.test(r),R=o!==void 0&&Hs(M),j={itemName:s,atName:r,listExpr:i,keyExpr:o,keyIsItem:l,keyProp:a,itemNode:M,readsPosition:q,namesComponent:D,nestsScopes:R,windowExpr:p};return It.set(e,j),j},qt=8,Vo=/^(auto|scroll|overlay)$/,Zo=e=>{for(let t=e;t;t=t instanceof ShadowRoot?t.host:t.parentNode)if(!(!(t instanceof HTMLElement)||t===document.body||t===document.documentElement)&&Vo.test(getComputedStyle(t).overflowY))return t;return null},Qo=(e,t,n,s,r)=>{let i=()=>{let y=e.component!==void 0||e.tag.includes("-")?document.createElement("div"):on(e);return y.setAttribute("aria-hidden","true"),y.setAttribute("style","height: 0px; margin: 0; padding: 0; border: 0; list-style: none; visibility: hidden"),y},o=i(),l=i(),a=ve({start:0,count:-1}),c=0,u=0,p=null,b=!1,M=0,H=null,q=null,D=y=>Math.ceil(y/c)+1+2*qt,R=(y,T)=>{y=Math.max(0,Math.min(y,Math.max(0,u-T))),(a.start!==y||a.count!==T)&&We(()=>{a.start=y,a.count=T})},j=()=>{let y=o.getBoundingClientRect().top;if(p){let T=p.getBoundingClientRect(),N=p.scrollTop;return{listTop:y-T.top-p.clientTop+N,scrollTop:N,height:p.clientHeight||window.innerHeight}}return{listTop:y+window.scrollY,scrollTop:window.scrollY,height:window.innerHeight}},O=()=>{if(M=0,!(c>0)||!o.isConnected)return;let{listTop:y,scrollTop:T,height:N}=j();R(Math.floor((T-y)/c)-qt,D(N))},W=()=>{M||(M=typeof requestAnimationFrame=="function"?requestAnimationFrame(O):setTimeout(O,16))},z=(y,{block:T="nearest"}={})=>{if(K(),c>0&&o.isConnected){let{listTop:F,scrollTop:V,height:w}=j(),A=F+y*c,P=A+c,L=V;T==="start"?L=A:T==="end"?L=P-w:T==="center"?L=A-(w-c)/2:A<V?L=A:P>V+w&&(L=P-w),L!==V&&(p?p.scrollTop=L:window.scrollTo(window.scrollX,L)),O()}let N=a.count>0?a.count:D(window.innerHeight||800);(y<a.start||y>=a.start+N)&&R(y-qt,N);let I=r().find(F=>F.scope.$index===y);return I?I.range.first:null},K=()=>{b||!o.isConnected||(b=!0,q=o.parentElement,p=Zo(o.parentNode),(p??window).addEventListener("scroll",W,{passive:!0}),window.addEventListener("resize",W),p&&typeof ResizeObserver=="function"&&(H=new ResizeObserver(W),H.observe(p)),q&&Object.defineProperty(q,"$scrollTo",{value:z,configurable:!0,writable:!0}),O())};s.onDispose(()=>{M&&(typeof cancelAnimationFrame=="function"?cancelAnimationFrame:clearTimeout)(M),b&&((p??window).removeEventListener("scroll",W),window.removeEventListener("resize",W),H?.disconnect(),q&&q.$scrollTo===z&&delete q.$scrollTo)});let X=!1;return{top:o,bottom:l,range:y=>{u=y;let T=Number(_(t,n));if(c=T>0?T:0,!c)return o.style.height=l.style.height="0px",[0,y];let N=a.count>0?a.count:D(window.innerHeight||800),I=Math.max(0,Math.min(a.start,y-N)),F=Math.min(y,I+N);return o.style.height=`${I*c}px`,l.style.height=`${(y-F)*c}px`,[I,F]},settled:()=>{b||X||(X=!0,queueMicrotask(()=>{X=!1,K()}))}}},Xo=(e,t,n,s)=>{let r=Go(e);if(!r)return document.createComment(`invalid :each expression "${e.attrs[":each"]}"`);let{itemName:i,atName:o,listExpr:l,keyExpr:a,keyIsItem:c,keyProp:u,itemNode:p,readsPosition:b,namesComponent:M,nestsScopes:H,windowExpr:q}=r,D=document.createComment("each"),R=document.createDocumentFragment();R.appendChild(D);let j=q===void 0?null:Qo(p,q,t,n,()=>O);j&&R.append(j.top,j.bottom),(":if"in e.attrs||":elseif"in e.attrs||":else"in e.attrs)&&console.warn("jq79: :if/:elseif/:else on a :each element is ignored; filter the list expression instead");let O=[],W=!1;return n.effect(()=>{let z=Eo(t);try{let K=_(l,t),X=Array.isArray(K),y=X?null:zo(K)?Object.keys(K):[],T=X?K.length:y.length,[N,I]=j?j.range(T):[0,T],F=new Map;O.forEach((d,m)=>{d.pos=m;let h=F.get(d.key);h?h.push(d):F.set(d.key,[d])});let V=new Set,w=[],A=[],P=[],L=[],B;for(let d=N;d<I;d++){let m=X?d:y[d],h=X?K[d]:K[m],S=m;c?S=h:u!==void 0&&h!==null&&typeof h=="object"?S=h[u]:a!==void 0&&(B===void 0?(B=Object.create(t),Pe(B,i,h),o&&Pe(B,o,m),Pe(B,"$index",d)):(B[i]=h,o&&(B[o]=m),B.$index=d),S=_(a,B)),V.has(S)&&!W&&(W=!0,console.warn(`jq79: duplicate :key in :each "${e.attrs[":each"]}"; duplicates pair up by position`)),V.add(S);let g=F.get(S)?.shift();if(g&&Object.is(g.item,h)){let v=g.scope;v.$index!==d&&(b&&w.push(g),v.$index=d),o&&v[o]!==m&&(v[o]=m),P.push(g),L.push(g.pos);continue}if(g&&a!==void 0){let v=g.scope;v[i]=h,v.$index!==d&&(v.$index=d),o&&v[o]!==m&&(v[o]=m),g.item=h,A.push(g),P.push(g),L.push(g.pos);continue}g&&(g.fx.dispose(),dt(g.range));let E=Object.create(t);Pe(E,i,h),o&&Pe(E,o,m),Pe(E,"$index",d),M||As.add(E);let $=Ee(t);H&&Object.defineProperty(E,St,{value:$});let x=rn(ln(p,E,$,s));P.push({key:S,item:h,scope:E,fx:$,range:x,pos:d}),L.push(-1)}let G=new Set;F.forEach(d=>d.forEach(m=>G.add(m))),G.size&&(G.forEach(d=>{d.dead=!0,d.fx.dispose()}),go(mo(O,d=>d.dead===!0)));let te=j?j.top:D,f=Uo(L);P.forEach((d,m)=>{!f[m]&&te.nextSibling!==d.range.first&&yo(d.range,te),te=d.range.last}),w.forEach(d=>Ne(()=>d.fx.refresh())),A.forEach(d=>Ne(()=>d.fx.rerun())),O=P}finally{wo(z)}j?.settled()}),n.onDispose(()=>O.forEach(z=>z.fx.dispose())),R},Ws=(e,t)=>{let n=t;for(;n<e.length&&typeof e[n]=="string"&&!e[n].trim();)n++;return n},Ht=e=>{let t=":if"in e.attrs,n=":elseif"in e.attrs,s=":else"in e.attrs;if((t?1:0)+(n?1:0)+(s?1:0)<2)return;let r=[t?":if":null,n?":elseif":null,s?":else":null].filter(Boolean);console.warn(`jq79: ${r.join(" and ")} on the same <${Y(e)}> - only ${r[0]} applies; the branches of a chain are sibling elements, one directive each`)},Yo=(e,t)=>{let n=":elseif"in e.attrs?":elseif":":else";console.warn(t?`jq79: a second ${n} on <${Y(e)}> - the chain before it already ended with :else, which closes it. One :if, any number of :elseif, at most one :else`:`jq79: ${n} on <${Y(e)}> continues no :if - it renders unconditionally. A chain is :if, then :elseif, then :else, on adjacent siblings: anything but whitespace between them breaks it`)},Jo=[":if",":elseif",":else",":each"],ei=(e,t)=>{if(e.tag!=="template"||e.ns!==void 0)return;let n=Jo.find(s=>s in e.attrs);if(n!==void 0){if(qe(e)!==void 0){if(t?.component===void 0)return;console.warn(`jq79: ${n} on <template ${qe(e)}> is ignored - a slot is filled with its children as written. Put ${n} on the elements inside it, or on the component's tag`);return}console.warn(`jq79: ${n} on a nested <template> shows nothing - a <template>'s children live in its .content and never reach the page. Put ${n} on the elements themselves`)}},ti=[...At,":model",":slot"].map(e=>e.slice(1)),ni={":attrs":':attrs was removed in 0.7 - it now binds an attribute called "attrs". Bind them one at a time (:disabled="x", :title="y"), or :class for classes'},si=e=>{for(let t in e.attrs){let n=ni[t];n!==void 0&&console.warn(`jq79: ${n}`)}},ri=e=>{if(!(e.component!==void 0||e.tag.includes("-")))for(let t in e.attrs){if(!t.startsWith(":")||we(t)||t===":model"||t.startsWith(":model."))continue;let n=t.slice(1);if(n.includes(".")){console.warn(`jq79: ${t} is not a directive - it bound an attribute named "${n}". Dotted modifiers belong to an event: if you meant @${n}, that is the spelling`);continue}let s=ti.find(r=>n!==r&&n.startsWith(r));s!==void 0&&console.warn(`jq79: ${t} is not a directive - it bound an attribute named "${n}". A ":name" jq79 does not recognize binds that attribute (which is what :src and :disabled are). If you meant :${s}, that is the spelling`)}},Fs=(e,t)=>{e.forEach(s=>{typeof s!="string"&&(ei(s,t),si(s),ri(s),Fs(s.children,s))});let n=!1;for(let s=0;s<e.length;){let r=e[s];if(typeof r=="string"){r.trim()&&(n=!1),s++;continue}if(":each"in r.attrs){n=!1,s++;continue}if(Ht(r),":if"in r.attrs){s++;let i=l=>{let a=Ws(e,s),c=e[a];if(typeof c=="object"&&l in c.attrs)return s=a+1,c};for(let l=i(":elseif");l;l=i(":elseif"))Ht(l);let o=i(":else");o&&Ht(o),n=o!==void 0;continue}(":elseif"in r.attrs||":else"in r.attrs)&&Yo(r,n),n=!1,s++}},is=new WeakMap,oi=(e,t,n)=>{let s=is.get(t);if(s)return s;let r=[{expr:t.attrs[":if"],node:t}],i=n+1,o=c=>{let u=Ws(e,i),p=e[u];if(typeof p=="object"&&c in p.attrs)return i=u+1,p};for(let c=o(":elseif");c;c=o(":elseif"))r.push({expr:c.attrs[":elseif"],node:c});let l=o(":else");l&&r.push({node:l});let a={branches:r,next:i};return is.set(t,a),a},$e=(e,t,n,s=!1,r)=>{let i=r??document.createDocumentFragment(),o=0;for(;o<e.length;){let l=e[o];if(typeof l=="string"){let a=document.createTextNode(l);if(l.includes("{{")){let c=Mt(l);n.effect(()=>{let u=Cs(c,t);a.textContent!==u&&(a.textContent=u)})}i.appendChild(a),o++;continue}if(":each"in l.attrs){i.appendChild(Xo(l,t,n,s)),o++;continue}if(":if"in l.attrs){let a=oi(e,l,o);i.appendChild(Bo(a.branches,t,n,s)),o=a.next;continue}i.appendChild(ln(l,t,n,s)),o++}return i},el=(e,t,n=!1)=>$e(e.template,t,Ee(t),n),Ae="data-jq79",ii=e=>{let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return(t>>>0).toString(36)},Bs=(e,t)=>{e.forEach(n=>{typeof n!="string"&&(n.attrs[Ae]=t,Bs(n.children,t))})},li=/^:(before|after|first-line|first-letter)(?![\w-])/i,Us=(e,t)=>{let n=0;for(let s=0;s<e.length;s++){let r=e[s];if(r==="\\")s++;else if(r==='"'||r==="'")for(s++;s<e.length&&e[s]!==r;)s+=e[s]==="\\"?2:1;else if(r==="("||r==="[")n++;else if(r===")"||r==="]")n--;else if(n===0&&t(s))return}},ai=(e,t)=>{let n=e.length;return Us(e,s=>e[s]!==":"||e[s+1]!==":"&&!li.test(e.slice(s))?!1:(n=s,!0)),`${e.slice(0,n)}[${Ae}="${t}"]${e.slice(n)}`},ci=(e,t)=>{let n=zs(e),s=n.match(/^\s*/)[0],r=n.match(/\s*$/)[0],i=n.slice(s.length,n.length-r.length);if(!i)return e;let o=[],l=0;return Us(i,a=>{i[a]===","&&(o.push(i.slice(l,a)),l=a+1)}),o.push(i.slice(l)),s+o.map(a=>a.trim()&&ai(a.trim(),t)).join(", ")+r},zs=e=>{let t="";for(let n=0;n<e.length;){let s=e[n];if(s==="/"&&e[n+1]==="*"){let r=e.indexOf("*/",n+2);n=r===-1?e.length:r+2}else if(s==='"'||s==="'"){let r=n+1;for(;r<e.length&&e[r]!==s;)r+=e[r]==="\\"?2:1;t+=e.slice(n,r+1),n=r+1}else s==="\\"?(t+=e.slice(n,n+2),n+=2):(t+=s,n++)}return t},di=/(^|[\s>+~,(])([A-Z][A-Za-z0-9]*)(?![\w-])/g,ui=/[a-z]/,fi=e=>e.replace(di,(t,n,s)=>ui.test(s)?`${n}${De(s)}`:t),Ks=/^\s*@(media|supports|container|layer|scope|document)\b/i,Gs=/^\s*@/,pi=e=>{let t="",n="",s="",r=[],i=()=>r.length===0||r[r.length-1],o=()=>{t+=i()&&!Gs.test(s)?fi(n):n,n=""},l=c=>{o(),t+=c,s+=c},a=(c,u)=>{o(),t+=c,s="",u!==void 0?r.push(u):c==="}"&&r.pop()};for(let c=0;c<e.length;){let u=e[c];if(u==="/"&&e[c+1]==="*"){let p=e.indexOf("*/",c+2),b=p===-1?e.length:p+2;l(e.slice(c,b)),c=b}else if(u==='"'||u==="'"){let p=c+1;for(;p<e.length&&e[p]!==u;)p+=e[p]==="\\"?2:1;l(e.slice(c,Math.min(p+1,e.length))),c=p+1}else u==="{"?(a("{",Ks.test(s)),c++):u==="}"||u===";"?(a(u),c++):(n+=u,s+=u,c++)}return o(),t},hi=(e,t)=>{/:deep\(|::v-deep|>>>/.test(e)&&console.warn("jq79: :deep()/::v-deep/>>> are not supported in <style scoped>; the rule will be dropped by the browser");let n="",s="",r=[],i=()=>r.length===0||r[r.length-1];for(let o=0;o<e.length;){let l=e[o],a=l;if(l==="/"&&e[o+1]==="*"){let c=e.indexOf("*/",o+2);a=e.slice(o,c===-1?e.length:c+2)}else if(l==='"'||l==="'"){let c=o+1;for(;c<e.length&&e[c]!==l;)c+=e[c]==="\\"?2:1;a=e.slice(o,c+1)}else l==="\\"&&(a=e.slice(o,o+2));if(o+=a.length,!i())n+=a,a==="{"?r.push(!1):a==="}"&&r.pop();else if(a==="{"){let c=zs(s),u=Gs.test(c);n+=(u?s:ci(s,t))+"{",r.push(u&&Ks.test(c)),s=""}else a==="}"||a===";"?(n+=s+a,s="",a==="}"&&r.pop()):s+=a}return n+s},Gt=e=>{let t=On(e),s=new DOMParser().parseFromString(`<template>${t}</template>`,"text/html").querySelector("template"),r=[],i=[];Array.from(s.content.children).forEach(a=>{a.tagName==="TEMPLATE"?i.push(a):r.push(a)});let o=ls(r,e),l={};return i.forEach(a=>{let c=a.getAttribute("name");if(c===null){console.warn("jq79: a top-level <template> without a name declares nothing and was ignored");return}if(!_n.test(c)){console.warn(`jq79: <template name="${c}"> was ignored - a component name has to be PascalCase, or no tag could ever reference it (only capitalized names resolve as components)`);return}if(c in l){console.warn(`jq79: two <template name="${c}"> in one file; the second was ignored`);return}l[c]=new ue({...ls(Array.from(a.content.children),a.innerHTML),siblings:l,name:c})}),Object.keys(l).length&&(o.siblings=l),o},gi=/^(?:text|application)\/(?:x-)?typescript$/i,mi=e=>"lang"in e?`lang="${e.lang}"`:gi.test(e.type?.trim()??"")?`type="${e.type}"`:null,ls=(e,t)=>{let n=[],s=[],r=[];e.forEach(o=>{let l={attrs:Es(o),content:o.textContent??""};o.tagName==="SCRIPT"?n.push(l):o.tagName==="STYLE"?s.push(l):r.push(Ss(o))}),n.forEach(o=>{let l=mi(o.attrs);l&&console.warn(`jq79: <script ${l}> needs the jq79/vite plugin to compile it. This component didn't go through the bundler, so its types were never stripped: the script will throw, or - for a plain \`let x: T = ...\` - silently fail to declare x.`)}),s.forEach(o=>{"lang"in o.attrs&&console.warn(`jq79: <style lang="${o.attrs.lang}"> needs the jq79/vite plugin to compile it. This component didn't go through the bundler, so its styles were left uncompiled and the browser will ignore them.`)}),s.forEach(o=>{"lang"in o.attrs||(o.content=pi(o.content))});let i=o=>"scoped"in o.attrs&&!("lang"in o.attrs);if(s.some(i)){let o=ii(t);Bs(r,o),s.forEach(l=>{i(l)&&(l.scoped=hi(l.content,o))})}return Fs(r),{template:r,scripts:n,styles:s}},Vs=/\.html?([?#]|$)/,ot=e=>Vs.test(e)?Yt(e):import(e),an=/^(?:\.\.?\/|\/|[a-z][a-z0-9+.-]*:)/i,Vt=(e,t)=>{if(!an.test(e))return e;try{return new URL(e,new URL(t??"",document.baseURI)).href}catch{return e}},yi=(e,t)=>e?`
18
+ //# sourceURL=${e}?jq79-script=${t}`:"",Zs=(e,t,n)=>{try{return tn(e,t,yi(n.filename,n.index??0))}catch(s){throw s instanceof Me?new Error(`jq79: safeEval() is on, and script ${n.index??0} of ${n.filename??"a component built from a string"} ${s.reason}. ${s.hint}`):s}},as=e=>e.scoped??e.content,Ie=`:where([${Os}]) { display: contents }`,cn=()=>en&&typeof Document<"u"&&"adoptedStyleSheets"in Document.prototype,it=e=>{let t=new CSSStyleSheet;return t.replaceSync(e),t},dn=(e,t)=>{e.adoptedStyleSheets.includes(t)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,t])},Zt=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(n=>n!==t)},et=null,Qt=null,Ei=()=>{if(cn()){dn(document,Qt??(Qt=it(Ie)));return}et?.isConnected||(et=document.createElement("style"),et.textContent=Ie,document.head.appendChild(et))},lt=new Map,wi=e=>{let t=lt.get(e);if(!t){if(cn()){let n=it(e);dn(document,n),t={sheet:n,count:0}}else{let n=document.createElement("style");n.textContent=e,document.head.appendChild(n),t={el:n,count:0}}lt.set(e,t)}t.count++},Si=e=>{let t=lt.get(e);t&&--t.count<=0&&(t.sheet?Zt(document,t.sheet):t.el?.remove(),lt.delete(e))},bi=(e,t,n,s={},r=ot,i={})=>{let o={...nr,...s},l=new Proxy(t,{has:(u,p)=>p!=="$__effect"&&p!=="$__import"&&p!=="$__state"&&(Reflect.has(u,p)||!(p in globalThis)&&!(p in o))}),a={},c=Zs(In(Object.keys(o)),qn(e),i)(l,n,r,a,...Object.values(o));return c.catch(u=>console.error("jq79: error in :setup script",u)),xs(c),{settled:c,sync:a.done===!0}},cs=(e,t)=>{t?.forEach(({name:n,default:s})=>{e[n]===void 0&&(e[n]=s===void 0?void 0:_(s,e))})},Xt=e=>{let t=Fn(e);return!t&&e.attrs[":setup"]!==void 0&&Ti(e,e.attrs[":setup"]),t},ds=new WeakSet,Ti=(e,t)=>{t.trim()==="_"||ds.has(e)||(ds.add(e),console.warn(`jq79: :setup="${t}" is not a props pattern, so this component declares no signature and takes whatever a parent passes - write the props it takes ("{ a, b }"), a bare :setup for none, or "_" to stay open on purpose`))},$i=e=>{let t=null;return e.forEach(n=>{let s=je(n.content)??Xt(n);if(!s)return;let r=t??(t=new Set);s.forEach(({name:i})=>r.add(i))}),t},us=(e,t)=>{if(t===null)return e;let n={};return Object.keys(e).forEach(s=>{t.has(s)&&(n[s]=e[s])}),n},fs=new WeakMap,Ri=(e,t,n,s)=>{if(s===null)return;let r=fs.get(e)??new Set;fs.set(e,r),n.forEach(i=>{s.has(i)||r.has(i)||(r.add(i),console.warn(`jq79: :${i} is not declared by <${t}> - add it to the :setup signature, or drop it`))})},xi=new Set([":value",":checked",":selected",":text",":html",":class"]),ps=new WeakSet,Ni=(e,t,n,s)=>{if(s===null||ps.has(e))return;let r=n.filter(i=>s.has(i));r.length&&(ps.add(e),r.forEach(i=>console.warn(`jq79: :${i} on <${t}> is a directive, not a prop - <${t}> never receives its "${i}". Rename the prop (${r.map(o=>`:${o}`).join(", ")} are reserved on a component tag), or use :model for a value that goes both ways`)))},vi=(e,t)=>{if(!e)return null;let n=Object.create(null),s=!1;return Object.entries(e).forEach(([r,i])=>{t.has(r)||(n[r]=i,s=!0)}),s?n:null},Qs=Symbol("jq79.unfilledProps"),at=Symbol("jq79.pendingScripts"),Pi=e=>e&&e.default!==void 0?e.default:e,Ci=(e,t,n,s={},r=ot,i={})=>{let o={...nr,...s},l={},a=Zs(Hn(Object.keys(o)),Wn(e),i)(l,Pi,r,...Object.values(o)),c=H=>console.error("jq79: error in factory script",H),u=!1,p,b=()=>{if(u)return p;u=!0;let H=l.default;if(typeof H!="function")return;let q=D=>{D&&typeof D=="object"&&Object.assign(t,D)};try{let D=H(t,{$data:t,$props:t,$effect:n,...s});D instanceof Promise?p=D.then(q).catch(c):q(D)}catch(D){c(D)}return p},M=a.then(b,c);return xs(M),l.done&&b(),{settled:M,sync:l.done===!0&&p===void 0}},Mi="__JQ79_HMR_ENABLED__",Ai="__JQ79_HMR__",Te=null,ki=e=>{if(!Te||!e.filename)return;let t=Te.get(e.filename);t||Te.set(e.filename,t=new Set),t.add(new WeakRef(e))},Wt=e=>{try{return new URL(e,document.baseURI).pathname}catch{return e}},Oi=(e,t)=>{if(!Te)return 0;let n=Wt(e),s=Gt(t);ee?.forEach((l,a)=>{Wt(a)===n&&ee.set(a,Promise.resolve(t))});let r=!1,i=l=>l.name===void 0?s:s.siblings?.[l.name]??null,o=0;for(let[l,a]of Te)if(Wt(l)===n){for(let c of a){let u=c.deref();if(!u){a.delete(c);continue}let p=i(u);if(!p){r=!0;continue}u.hotReplace(p)&&o++}a.size||Te.delete(l)}return r?0:o},_i=()=>{Te??(Te=new Map),globalThis[Ai]={update:Oi}},hs=3e3,ji=(e,t)=>{let n=setTimeout(()=>{console.warn(`jq79: ${e.name?`<${e.name}>`:"a component"}${e.filename?` (${e.filename})`:""} has been waiting ${hs/1e3}s for a :setup script and has rendered nothing. The template waits until every script returns or calls $mounted() - add an await $mounted() above the slow part to render first and fill in after.`)},hs);n?.unref?.(),Promise.all(t).then(()=>clearTimeout(n))},Xs=e=>{if(an.test(e))return e;let t=import.meta.resolve;if(typeof t!="function")return e;try{return t(e)}catch{return e}},ee=new Map,Ys=e=>{try{return new URL(e,document.baseURI).href.replace(/#.*$/,"")}catch{return e}},gs=e=>Promise.all([fetch(e).then(t=>{if(!t.ok)throw new Error(`failed to fetch component from ${e}: ${t.status}`);return t.text()}),tr?.then(()=>Fi(e))]).then(([t])=>t),Js=e=>{if(!ee)return gs(e);let t=Ys(e),n=ee.get(t);if(!n){n=gs(e),ee.set(t,n);let s=n;s.catch(()=>{ee?.get(t)===s&&ee.delete(t)})}return n},Yt=async e=>{let t=Xs(e),n=await Js(t);return new ue(n,{filename:t})},ms=new WeakSet,ys=new Set,Li=e=>{if(ys.has(e))return;ys.add(e);let t=document.createElement("link");t.rel="modulepreload";let n=nn();n&&t.setAttribute("nonce",n),t.href=e,document.head.append(t)},Di=/<script\b(?:"[^"]*"|'[^']*'|[^>"'])*>([\s\S]*?)<\/script\s*>/gi,ct=new Set,er=(e,t,n)=>{for(let{spec:s,kind:r}of Cn(e)){if(r==="component"&&n&&s in n)continue;let i=Xs(r==="fetch"?s:Vt(s,r==="component"?t:void 0));r==="fetch"||Vs.test(i)?ee&&Js(i).then(o=>Ii(o,i),()=>{}):an.test(i)&&Li(i)}},Ii=(e,t)=>{let n=Ys(t);if(!ct.has(n)){ct.add(n);for(let[,s]of e.matchAll(Di))er(s,t,void 0)}},qi=(e,t,n)=>{for(let s of e)ms.has(s)||(ms.add(s),er(s.content,t,n))},tr,Hi="/jq79-sw.js",Wi=async e=>{let t=typeof navigator>"u"?void 0:navigator.serviceWorker;if(!t)throw new Error("jq79: safeEval() compiles components in a service worker, and this page can't have one - service workers need https (or localhost). Precompile with the jq79/vite plugin instead, or use safeEval({ nonce: true }) on a page whose server issues a nonce.");let n;try{n=await t.register(e)}catch(s){throw new Error(`jq79: safeEval() couldn't register its service worker at ${e} (${s.message}). Serve jq79-sw.js from the jq79 package at your site's root, or pass its URL: safeEval({ worker: "/path/jq79-sw.js" }).`)}await t.ready,!t.controller&&await new Promise(s=>{t.addEventListener("controllerchange",()=>s(),{once:!0}),t.controller?s():n.active?.postMessage("jq79:claim")})},Fi=e=>{let t=new URL(e,document.baseURI);return t.hash="",t.searchParams.set(zn,""),new Promise((n,s)=>{let r=document.createElement("script"),i=nn();i&&r.setAttribute("nonce",i),r.src=t.href,r.onload=()=>{r.remove(),n()},r.onerror=()=>{r.remove(),s(new Error(`jq79: the precompiled functions of ${e} did not load, and safeEval() can't render it without them`))},document.head.append(r)})},de=class de{constructor(t,n={}){k(this,"template");k(this,"scripts");k(this,"styles");k(this,"modules");k(this,"filename");k(this,"siblings");k(this,"name");k(this,"slots");k(this,"modelWriteback");k(this,"data",null);k(this,"fx",null);k(this,"content",null);k(this,"startMarker",null);k(this,"endMarker",null);k(this,"styleEls",[]);k(this,"shadowCss",null);k(this,"shadowSheets",[]);k(this,"sheetRoot",null);k(this,"ownsSharedStyles",!1);k(this,"useShadow",!1);k(this,"mountRoot",null);k(this,"resolveMounted",null);k(this,"renderDone",!1);k(this,"held",0);k(this,"onPaint",null);k(this,"destroyHooks",null);k(this,"attachHooks",null);k(this,"detachHooks",null);k(this,"onPage",!1);k(this,"emitListeners",new Map);let s=typeof t=="string"?Gt(t):t;this.template=s.template,this.scripts=s.scripts,this.styles=s.styles,this.modules=n.modules??(typeof t=="string"?void 0:t.modules),this.filename=n.filename??(typeof t=="string"?void 0:t.filename),this.siblings=s.siblings,this.name=s.name,this.adoptSiblings(),ki(this)}adoptSiblings(){this.siblings&&Object.entries(this.siblings).forEach(([t,n])=>{n.filename??(n.filename=this.filename),n.modules??(n.modules=this.modules),this.name||(this[t]=n)})}hotReplace(t){let n=typeof t=="string"?Gt(t):t;sn.clear(),be.clear(),Kt.clear();let s=this.startMarker,r=!!(s&&this.content),i=r&&s.isConnected,o=i?s.parentNode:null,l=i?this.endMarker.nextSibling:null,a={...this.data},c=this.useShadow;return r&&this.destroy(),this.template=n.template,this.scripts=n.scripts,this.styles=n.styles,this.siblings=n.siblings,this.adoptSiblings(),!r||(this.renderWith(a,c),!o)?!1:(c&&this.placeShadowStyles(o,l),o.insertBefore(this.content,l),this.mountRoot=o,this.settleMounted(),!0)}static debug(t){if(t){let n=ce.scopedNames;for(let s in t){let r=t[s];Object.prototype.hasOwnProperty.call(ce,s)?typeof r=="boolean"?ce[s]=r:console.warn(`jq79: Component79.debug ignored "${s}" - the flags are booleans, and the ones it knows are: ${Object.keys(ce).join(", ")}`):console.warn(`jq79: Component79.debug does not know "${s}" - the flags it has are: ${Object.keys(ce).join(", ")}`)}ce.scopedNames!==n&&nt.clear()}return{...ce}}static safeEval(t={}){en=!0;let n=[];if(t.nonce){let r=nn();r===void 0?n.push(Promise.reject(new Error("jq79: safeEval({ nonce: true }) found no nonce on this page - no <script> carries one. The nonce belongs on the script that loads the page, the one the CSP names."))):Ut=r}let s=t.worker??(t.nonce?!1:Hi);return s!==!1&&n.push(tr??(tr=Wi(s))),Promise.all(n).then(()=>{})}static cache(t){return t===!1?(ee=null,ct.clear()):t===!0&&(ee??(ee=new Map)),!!ee}static clearCache(){ee?.clear(),ct.clear()}static fetch(t){if(Array.isArray(t))throw new TypeError("Component79.fetch takes one URL; use fetchAll for an array");return new Jt(Yt(t))}static fetchAll(t){return Promise.all(t.map(Yt))}static importAll(t){if(!Array.isArray(t))throw new TypeError("Component79.importAll takes an array; use import() for one");return Promise.all(t.map(n=>ot(Vt(n,void 0))))}on(t,n){return this.emitListeners.has(t)||this.emitListeners.set(t,new Set),this.emitListeners.get(t).add(n),this}off(t,n){return this.emitListeners.get(t)?.delete(n),this}render(t={}){return this.renderWith(t,!1)}renderShadow(t={}){return this.renderWith(t,!0)}renderWith(t,n){this.destroy();let s=Bn(this.scripts,Xt),r=vi(this.siblings,s),i=r?Object.assign(Object.create(r),t):{...t},o=new Set([...s].filter(w=>!(w in t)));o.size&&Object.defineProperty(i,Qs,{value:o}),this.slots&&Object.defineProperty(i,ks,{value:this.slots}),Object.defineProperty(i,at,{value:{count:0,owner:this}});let l=ve(i),a=Ee(l);this.data=l,this.fx=a,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let c=this.startMarker,u=!1,p=(w,A)=>{w==="model:update"&&!u&&(u=!0,console.warn("jq79: $emit('model:update', \u2026) no longer feeds :model - call $updateModel(value) or $updateModel(name, value) instead"));let P=new CustomEvent(w,{detail:A,bubbles:!0,composed:!0,cancelable:!0});return c===this.startMarker&&this.emitListeners.get(w)?.forEach(L=>L(P,A)),P.cancelBubble||c.dispatchEvent(P),!P.defaultPrevented},b,M=new Promise(w=>{b=w});this.resolveMounted=b,this.renderDone=!1,this.held=0;let H=w=>{if(typeof w!="function")throw new TypeError("jq79: $destroyed expects a function");return c!==this.startMarker?(Ce(w,"$destroyed"),()=>{}):Ft(this.destroyHooks??(this.destroyHooks=[]),w)},q=(w,{immediate:A=!0}={})=>{if(typeof w!="function")throw new TypeError("jq79: $attached expects a function");if(c!==this.startMarker)return()=>{};this.watchPage();let P=Ft(this.attachHooks??(this.attachHooks=[]),w);return A&&this.onPage&&Ce(w,"$attached"),P},D=w=>{if(typeof w!="function")throw new TypeError("jq79: $detached expects a function");return c!==this.startMarker?(Ce(w,"$detached"),()=>{}):(this.watchPage(),Ft(this.detachHooks??(this.detachHooks=[]),w))},R=w=>{let A=bt(w);return H(()=>A.$dispose()),A},j=this.endMarker,O=(w=>{let A=[];for(let P=c.nextSibling;P&&P!==j;P=P.nextSibling)P instanceof Element&&(P.matches(w)&&A.push(P),A.push(...Array.from(P.querySelectorAll(w))));return A}),W=(w=>O(w)[0]??null),z=this.modules,K=w=>z&&w in z?Promise.resolve(z[w]):ot(Vt(w,this.filename)),X=w=>{if(!Array.isArray(w))throw new TypeError("$importAll takes an array; use import() for one");return Promise.all(w.map(K))},T=Object.assign(Object.create(null),{$emit:p,$updateModel:(...w)=>{let[A,P]=w.length>1?w:[void 0,w[0]];return c!==this.startMarker?!1:this.modelWriteback?.(A,P)??!1},$slots:Object.fromEntries(Object.keys(this.slots??{}).map(w=>[w,!0]))}),N=[],I=!0;qi(this.scripts,this.filename,this.modules),this.scripts.forEach((w,A)=>{let P;N.push(new Promise(S=>{P=S}));let L=!1,B=()=>{L=!0,P()},te={$mounted:()=>(B(),M),$destroyed:H,$attached:q,$detached:D,$computed:R,$self:W,$$self:O,...T,$importAll:X,...r},f={filename:this.filename,index:A},d=":mounted"in w.attrs,m=Pn(w.content),h=(()=>{if(m!==null){d&&console.warn("jq79: :mounted on a factory script renders the template before the factory has returned, so none of its bindings exist yet - await $mounted() inside the factory instead."),cs(l,je(w.content));let $=d?jt(m):m;return Ci($,l,x=>a.effect(x),te,K,f)}let{vars:S,code:g}=Ze(w.content);cs(l,Xt(w)),S.forEach($=>{$ in l||(l[$]=void 0)});let E=d?jt(g):g;return bi(E,l,$=>a.effect($),te,K,f)})();if(h.sync)h.settled.then(B,B);else{let S=i[at];S.count++;let g=()=>{S.count--,B()};h.settled.then(g,g)}!h.sync&&!L&&(I=!1)});let F=document.createDocumentFragment(),V=new Proxy(l,{has:(w,A)=>typeof A=="string"&&A in T||Reflect.has(w,A),get:(w,A,P)=>typeof A=="string"&&A in T&&!Reflect.has(w,A)?T[A]:Reflect.get(w,A,P)});if(F.append(this.startMarker,this.endMarker),this.content=F,I?(this.endMarker.parentNode.insertBefore($e(this.template,V,a,n),this.endMarker),this.renderDone=!0,this.settleMounted()):(Promise.all(N).then(()=>{c===this.startMarker&&(this.endMarker.parentNode.insertBefore($e(this.template,V,a,n),this.endMarker),this.renderDone=!0,this.settleMounted(),de.settleAttached())}),ji(this,N)),n)if(cn())this.shadowCss=[...this.styles.map(w=>w.content),Ie];else{let w=document.createElement("style");w.textContent=Ie,this.styleEls=[...this.styles.map(A=>{let P=document.createElement("style");return P.textContent=A.content,P}),w]}else this.styles.forEach(w=>wi(as(w))),this.ownsSharedStyles=!0;return this}mount(t,n){let s=typeof t=="string"?ke(t):t;if(!s)throw new Error(`mount target not found: ${t}`);return(!this.content||n!==void 0)&&this.renderWith(n??{},this.useShadow),this.attach(s)}mountShadow(t,n){let s=typeof t=="string"?ke(t):t;if(!s)throw new Error(`mount target not found: ${t}`);return(!this.content||n!==void 0||!this.useShadow)&&this.renderWith(n??{},!0),this.attach(s)}attach(t){this.mountRoot&&this.detach();let n=this.useShadow&&t instanceof Element?t.shadowRoot??t.attachShadow({mode:"open"}):t;return this.useShadow&&this.placeShadowStyles(n,null),n.appendChild(this.content),this.mountRoot=n,this.settleMounted(),de.settleAttached(),this}isOnPage(){return this.renderDone&&this.startMarker?.isConnected===!0}watchPage(){he.has(this)||(he.add(this),this.onPage=this.isOnPage(),this.onPage||de.queueSettle())}static queueSettle(){Bt||(Bt=!0,queueMicrotask(()=>{Bt=!1,de.settleAttached()}))}static settleAttached(){if(he.size===0)return;let t=[...he].filter(n=>!n.onPage&&n.isOnPage());de.inDocumentOrder(t).forEach(n=>{n.onPage||!he.has(n)||(n.onPage=!0,n.attachHooks?.slice().forEach(s=>Ce(s,"$attached")))})}notifyDetached(){if(he.size===0)return;let t=[];if(this.startMarker?.isConnected){let n=new Set;for(let r=this.startMarker;r&&(n.add(r),r!==this.endMarker);r=r.nextSibling);let s=r=>{for(;r;r=r.parentNode)if(n.has(r))return!0;return!1};t=de.inDocumentOrder([...he].filter(r=>r.onPage&&s(r.startMarker)))}else this.onPage&&(t=[this]);t.forEach(n=>{n.onPage&&(n.onPage=!1,n.detachHooks?.slice().forEach(s=>Ce(s,"$detached")))})}static inDocumentOrder(t){return t.sort((n,s)=>n.startMarker.compareDocumentPosition(s.startMarker)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}placeShadowStyles(t,n){if(this.shadowCss&&typeof ShadowRoot<"u"&&t instanceof ShadowRoot){this.sheetRoot&&this.sheetRoot!==t&&this.shadowSheets.forEach(s=>Zt(this.sheetRoot,s)),this.shadowSheets.length===0&&(this.shadowSheets=this.shadowCss.map(s=>s===Ie?Qt??(Qt=it(s)):it(s))),this.shadowSheets.forEach(s=>dn(t,s)),this.sheetRoot=t;return}this.shadowCss&&this.styleEls.length===0&&(this.styleEls=this.shadowCss.map(s=>{let r=document.createElement("style");return r.textContent=s,r})),this.styleEls.forEach(s=>t.insertBefore(s,n))}settleMounted(){if(!this.renderDone||this.held>0)return;let t=this.onPaint;this.onPaint=null,t?.(),this.mountRoot&&this.resolveMounted?.()}holdOwner(t){this.renderDone&&this.held===0||(t.held++,this.onPaint=()=>{t.held--,t.settleMounted()})}detach(){if(!this.mountRoot||!this.content||!this.startMarker||!this.endMarker)return this;this.notifyDetached();let t=this.startMarker;for(;t;){let n=t.nextSibling;if(this.content.appendChild(t),t===this.endMarker)break;t=n}return this.mountRoot=null,this}destroy(){this.notifyDetached(),he.delete(this),this.attachHooks=null,this.detachHooks=null,this.onPage=!1;let t=this.destroyHooks;this.destroyHooks=null,t?.forEach(s=>Ce(s,"$destroyed")),this.resolveMounted=null;let n=this.onPaint;return this.onPaint=null,n?.(),this.detach(),this.fx?.dispose(),this.fx=null,this.data?.$dispose(),this.styleEls.forEach(s=>s.parentNode?.removeChild(s)),this.styleEls=[],this.sheetRoot&&this.shadowSheets.forEach(s=>{s!==Qt&&Zt(this.sheetRoot,s)}),this.shadowCss=null,this.shadowSheets=[],this.sheetRoot=null,this.ownsSharedStyles&&(this.styles.forEach(s=>Si(as(s))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.renderDone=!1,this.data=null,this.resolveMounted=null,this}};k(de,"version",to);var ue=de,Jt=class{constructor(t){k(this,"chain");this.chain=t}queue(t){return this.chain=this.chain.then(n=>(t(n),n)),this}then(t,n){return this.chain.then(t,n)}catch(t){return this.chain.catch(t)}finally(t){return this.chain.finally(t)}mount(t,n){return this.queue(s=>s.mount(t,n))}mountShadow(t,n){return this.queue(s=>s.mountShadow(t,n))}render(t={}){return this.queue(n=>n.render(t))}renderShadow(t={}){return this.queue(n=>n.renderShadow(t))}on(t,n){return this.queue(s=>s.on(t,n))}off(t,n){return this.queue(s=>s.off(t,n))}detach(){return this.queue(t=>t.detach())}destroy(){return this.queue(t=>t.destroy())}};var tl=e=>new ue(e),Ce=(e,t)=>{try{e()}catch(n){console.error(`jq79: error in a ${t} hook`,n)}},Ft=(e,t)=>(e.push(t),()=>{let n=e.indexOf(t);n!==-1&&e.splice(n,1)}),he=new Set,Bt=!1,nr={$:ke,$$:ft,$create:pt,$reactive:ve,$toRaw:Q,$batch:We,Component79:ue,C79:ue};typeof globalThis<"u"&&globalThis[Mi]&&_i();export{ke as $,ft as $$,We as $batch,bt as $computed,pt as $create,ve as $reactive,Q as $toRaw,ue as C79,ue as Component79,Jt as PendingComponent79,_i as enableHotReload,Oi as hotUpdate,tl as parseComponent,el as renderComponent};
20
19
  //# sourceMappingURL=jq79.js.map