jq79 0.7.2 → 0.7.4

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.cjs CHANGED
@@ -1,16 +1,20 @@
1
- var Ne=Object.defineProperty;var Hn=Object.getOwnPropertyDescriptor;var zn=Object.getOwnPropertyNames;var Gn=Object.prototype.hasOwnProperty;var Zn=(e,t,n)=>t in e?Ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Kn=(e,t)=>{for(var n in t)Ne(e,n,{get:t[n],enumerable:!0})},Vn=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of zn(t))!Gn.call(e,r)&&r!==n&&Ne(e,r,{get:()=>t[r],enumerable:!(s=Hn(t,r))||s.enumerable});return e};var Xn=e=>Vn(Ne({},"__esModule",{value:!0}),e);var k=(e,t,n)=>Zn(e,typeof t!="symbol"?t+"":t,n);var wo={};Kn(wo,{$:()=>me,$$:()=>xe,$create:()=>Ce,$reactive:()=>$e,$toRaw:()=>H,C79:()=>re,Component79:()=>re,PendingComponent79:()=>He,enableHotReload:()=>Un,hotUpdate:()=>Fn,parseComponent:()=>bo,renderComponent:()=>Cr});module.exports=Xn(wo);function me(e,t){return typeof e=="string"?document.querySelector(e):e.querySelector(t)}function xe(e,t){return Array.from(typeof e=="string"?document.querySelectorAll(e):e.querySelectorAll(t))}var Ce=(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},Yn=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),wt={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},Jn=new Set(["http:","https:","mailto:"]);function Qn(e){try{let t=new URL(e,"https://example.com");return Jn.has(t.protocol)}catch{return!1}}var es={"https:":"443","http:":"80"};function ts(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 Rt=e=>{let t=(Array.isArray(e)?e:e.split(",")).map(ts).filter(n=>n!==null);return n=>{let s=n.hostname.toLowerCase(),r=n.port||es[n.protocol]||"";return t.some(i=>i.host.test(s)&&(i.port===null||i.port===r))}};function ns(e,t,n,s){try{return!!e(new URL(t,document.baseURI),n,s)}catch{return!1}}var St=512;function $t(e,t,n,s){if(n>St)throw new RangeError(`jq79: sanitizeHTML input nests deeper than ${St} elements`);for(let r of Array.from(e.childNodes))if(r.nodeType===Node.ELEMENT_NODE){let i=ss(r,n,s);i&&t.appendChild(i)}else r.nodeType===Node.TEXT_NODE&&t.appendChild(r.cloneNode())}function ss(e,t,n){let s=e.tagName.toLowerCase();if(!Yn.has(s))return null;let r=document.createElement(s);for(let i of Array.from(e.attributes)){let o=i.name.toLowerCase(),l=wt[s]?.has(o),a=wt["*"]?.has(o);!l&&!a||(o==="href"||o==="src")&&(!Qn(i.value)||n&&!ns(n,i.value,s,o))||r.setAttribute(o,i.value)}return s==="a"&&r.setAttribute("rel","noopener noreferrer"),$t(e,r,t+1,n),r}function Ke(e,t){let n=document.createElement("template");n.innerHTML=e;let s=document.createElement("div");return $t(n.content,s,0,t?.allowUrl),s.innerHTML}var rs=(e,t)=>t.split(".").reduce((n,s)=>n?.[s],e),_e=e=>{if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},_t=(e,t,n)=>{Object.entries(e).forEach(([s,r])=>{let i=t?`${t}.${s}`:s;r&&typeof r=="object"&&_e(r)?_t(r,i,n):n(i,r)})},os=(e,t)=>{e.own===null?e.own=t:e.own!==t&&(e.ownMany??(e.ownMany=new Set)).add(t)},is=(e,t)=>{e.deep===null?e.deep=t:e.deep!==t&&(e.deepMany??(e.deepMany=new Set)).add(t)},ls=(e,t)=>{e.own===t?e.own=null:e.ownMany?.delete(t)&&e.ownMany.size===0&&(e.ownMany=null)},as=(e,t)=>{e.deep===t?e.deep=null:e.deepMany?.delete(t)&&e.deepMany.size===0&&(e.deepMany=null)},ye=(e,t)=>{e.own!==null&&t(e.own),e.ownMany?.forEach(t)},Se=(e,t)=>{e.deep!==null&&t(e.deep),e.deepMany?.forEach(t)},Tt=" keys",Ve=e=>e?`${e}.${Tt}`:Tt,Nt=".length",xt=(e,t)=>({children:null,own:null,ownMany:null,deep:null,deepMany:null,parent:e,segment:t}),cs=e=>e.own===null&&e.deep===null&&!e.ownMany?.size&&!e.deepMany?.size&&!e.children?.size,Ye=Symbol("jq79.raw"),H=e=>{let t=e;for(;t!==null&&typeof t=="object"&&t[Ye];)t=t[Ye];return t},At=Symbol("jq79.store"),ue=e=>e!==null&&typeof e=="object"&&e[At]===!0,le=[],Re=e=>{le.push(new Set);try{return e()}finally{le.pop()}},us=0,Xe=new Set,Ct="$__attach",Ae=Symbol("jq79.alsoWakenBy"),$e=e=>{let t=new Map,n=new Set,s=new Set,r=new WeakMap,i=Object.create(null),o=xt(null,""),l=(f,d)=>{let g=o;return f.split(".").forEach(h=>{let b=g.children??(g.children=new Map),y=b.get(h);y||(y=xt(g,h),b.set(h,y)),g=y}),d.deep?is(g,d):os(g,d),g},a=(f,d)=>{d.deep?as(f,d):ls(f,d);let g=f;for(;g?.parent&&cs(g);)g.parent.children.delete(g.segment),g=g.parent},u=f=>{let d=o;for(let g of f.split("."))if(d=d.children?.get(g),!d)return;return d},c=f=>{let d=new Set,g=E=>{let $=E.children?[...E.children.values()]:[];for(;$.length;){let N=$.pop();ye(N,O=>d.add(O)),Se(N,O=>d.add(O)),N.children?.forEach(O=>$.push(O))}},h=o,b=f.split("."),y="";for(let E=0;E<b.length-1;E++){if(h=h.children?.get(b[E]),!h)return d;y=y?`${y}.${b[E]}`:b[E],Se(h,$=>d.add($)),C.has(y)&&ye(h,$=>d.add($)),E===b.length-2&&b[E+1]==="length"&&(ye(h,$=>d.add($)),g(h))}return h=h.children?.get(b[b.length-1]),h&&(ye(h,E=>d.add(E)),Se(h,E=>d.add(E)),g(h)),d},p=(f,d,g)=>{if(d===g)return!1;for(let h=d;h<g;h++){let b=f.charCodeAt(h);if(b<48||b>57)return!1}return!0},w=(f,d)=>{if(f.deep||d.size<2)return d;let g=new Set;d.forEach(y=>{y.endsWith(Nt)&&g.add(y.slice(0,-Nt.length))});let h=new Set;if(d.forEach(y=>{let E=0,$="";for(let N=y.indexOf(".");N!==-1;N=y.indexOf(".",N+1)){let O=y.slice(0,N);(!(E>0&&p(y,E,N))||g.has($))&&h.add(O),$=O,E=N+1}}),!h.size)return d;let b=new Set;return d.forEach(y=>{h.has(y)||b.add(y)}),b},v=f=>{let d=null,g=null,h=null,b=Xe,y=x=>h?h.has(x):d===x,E=x=>{let B=l(x,f);h?h.set(x,B):d===null?(d=x,g=B):(h=new Map([[d,g],[x,B]]),d=g=null)},$=x=>{if(h){h.forEach((B,W)=>{x.has(W)||(a(B,f),h.delete(W))});return}d!==null&&!x.has(d)&&(a(g,f),d=g=null)},N=()=>{h?h.forEach(x=>a(x,f)):g&&a(g,f),h=null,d=g=null},O=x=>{if(x.size===b.size){let W=!0;if(x.forEach(ce=>{W&&(W=b.has(ce))}),W)return}b=x;let B=w(f,x);$(B),B.forEach(W=>{y(W)||E(W)})};return f.reindex.add(O),O(f.deps),()=>{f.reindex.delete(O),N(),b=Xe}},I=f=>{let d=u(f);if(d){let g=new Set;ye(d,h=>g.add(h)),Se(d,h=>g.add(h)),M(g)}},U=f=>I(Ve(f)),M=f=>{let d=Array.from(f),g=!0;for(let h=1;g&&h<d.length;h++)g=d[h-1].order<d[h].order;g||d.sort((h,b)=>h.order-b.order),d.forEach(h=>{s.has(h)&&h.run()})},S=(f,d,g=!1)=>{t.get(f)?.forEach(h=>h(d,f)),n.forEach(h=>h(f,d)),g?s.forEach(h=>h.run()):M(c(f))},F=(f,d)=>f!==d&&f!==null&&d!==null&&typeof f=="object"&&typeof d=="object"&&!ue(f)&&!ue(d)&&_e(f)&&_e(d)&&Array.isArray(f)===Array.isArray(d),L=null,D=-1,z=(f,d)=>{let g=d.length>f.length,h=g?f:d,b=g?d:f,y=0;for(;y<h.length&&Object.is(H(h[y]),H(b[y]));)y++;for(let E=y;E<h.length;E++)if(!Object.is(H(h[E]),H(b[E+1])))return D;return y},Y=(f,d)=>{if(Array.isArray(d)){let $=f.length,N=d.length,O=$!==N;if(!$||!N)return L;let x=Math.max($,N);if(Math.abs($-N)===1){let W=z(f,d);if(W!==D){let ce=[];for(let Ze=W;Ze<x;Ze++)ce.push(String(Ze));return{keys:ce,exact:!0,keysChanged:O}}}let B=[];for(let W=0;W<x;W++)if(!Object.is(H(f[W]),H(d[W]))&&(B.push(String(W)),B.length*2>=x))return L;return{keys:B,exact:!1,keysChanged:O}}let g=Object.keys(f),h=Object.keys(d),b=new Set([...g,...h]);if(!b.size)return L;let y=[];b.forEach($=>{Object.is(H(f[$]),H(d[$]))||y.push($)});let E=g.length!==h.length||g.some(($,N)=>$!==h[N]);return y.length*2>=b.size?L:{keys:y,exact:!1,keysChanged:E}},J=(f,d,g,h)=>{let b=new Set,y=$=>{let N=u($);N&&(ye(N,O=>b.add(O)),Se(N,O=>b.add(O)))},E=Y(d,g);if(!E)return S(f,h);if(t.get(f)?.forEach($=>$(h,f)),n.forEach($=>$(f,h)),y(f),E.keys.forEach($=>{let N=`${f}.${$}`,O=t.get(N);if(O){let x=H(g[$]),B=R(x)?A(x,N):x;O.forEach(W=>W(B,N))}E.exact?y(N):c(N).forEach(x=>b.add(x))}),E.keysChanged&&y(Ve(f)),Array.isArray(g)&&d.length!==g.length){let $=`${f}.length`;t.get($)?.forEach(N=>N(g.length,$)),y($)}M(b)},R=f=>f!==null&&typeof f=="object"&&_e(f),C=new Map,m=(f,d)=>{let g=C.get(d);g?.store!==f&&(g?.unsubscribe(),C.set(d,{store:f,unsubscribe:f.$onAny((h,b)=>S(`${d}.${h}`,b))}))},_=f=>{C.get(f)?.unsubscribe(),C.delete(f)},A=(f,d)=>{let g=r.get(f);if(g)return g;let h=null,b=new Proxy(f,{has(y,E){return Reflect.has(y,E)||typeof E=="string"&&h?.has(E)===!0},ownKeys(y){return le[le.length-1]?.add(Ve(d)),Reflect.ownKeys(y)},get(y,E,$){if(E===Ye)return y;if(E===At)return d==="";if(typeof E!="string")return Reflect.get(y,E,$);if(d===""&&E in i)return i[E];let N=d?`${d}.${E}`:E;le[le.length-1]?.add(N);let O=Reflect.get(y,E,$);if(ue(O))return m(O,N),O;let x=H(O);return R(x)?A(x,N):x},set(y,E,$,N){if(N!==b&&!Object.prototype.hasOwnProperty.call(y,E))return Reflect.set(y,E,$,N);let O=d?`${d}.${E}`:E,x=ue($)?$:H($),B=!Object.prototype.hasOwnProperty.call(y,E);if(!B&&Object.is(y[E],x)&&(x===null||typeof x!="object"))return!0;let W=y[E];y[E]=x,h?.delete(E),ue(x)?m(x,O):_(O);let ce=ue(x)||!R(x)?x:A(x,O);return!B&&F(W,x)?J(O,W,x,ce):S(O,ce,B),!0},deleteProperty(y,E){if(typeof E!="string")return Reflect.deleteProperty(y,E);let $=Object.prototype.hasOwnProperty.call(y,E),N=Reflect.deleteProperty(y,E);if(N&&$){let O=d?`${d}.${E}`:E;(h??(h=new Set)).add(E),_(O),S(O,void 0),U(d)}return N}});return r.set(f,b),b},G=A(H(e),"");Object.entries(H(e)).forEach(([f,d])=>{ue(d)&&m(d,f)});let V=(f,d,{immediate:g=!1}={})=>(t.has(f)||t.set(f,new Set),t.get(f).add(d),g&&d(rs(G,f),f),()=>t.get(f)?.delete(d)),K=(f,{immediate:d=!1}={})=>(n.add(f),d&&_t(G,"",(g,h)=>f(g,h)),()=>n.delete(f)),T=(f,{deep:d=!1,alsoWakenBy:g}={})=>{let h=!1,b=!1,y={deps:Xe,reindex:new Set,deep:d,order:us++,run:()=>{if(h){b=!0;return}h=!0;try{let N=0;do{b=!1;let O=new Set;le.push(O);try{f()}finally{le.pop(),y.deps=O}}while(b&&++N<100);b&&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,y.reindex.forEach(N=>N(y.deps))}}};s.add(y);let E=v(y),$=()=>{s.delete(y),E()};return g?.length?q(y,g,$):(y.run(),$)},q=(f,d,g)=>{let h=d.map(b=>b?.[Ct]?.(f)).filter(Boolean);return f.run(),()=>{g(),h.forEach(b=>b())}},P=f=>{s.add(f);let d=v(f);return()=>{s.delete(f),d()}},Z=()=>{C.forEach(({unsubscribe:f})=>f()),C.clear()};return i.$on=V,i.$onAny=K,i.$effect=T,i.$dispose=Z,i[Ct]=P,G},Je=class{constructor(t,n){k(this,"scope",t);k(this,"disposers",null);k(this,"runs",null);k(this,"options");let s=t[Ae];this.options=n||s?{deep:n,alsoWakenBy:s}:void 0}effect(t){(this.disposers??(this.disposers=[])).push(this.scope.$effect(t,this.options)),(this.runs??(this.runs=[])).push(t)}onDispose(t){(this.disposers??(this.disposers=[])).push(t)}refresh(){this.runs?.forEach(t=>t())}dispose(){let t=this.disposers;if(this.disposers=null,this.runs=null,t)for(let n=0;n<t.length;n++)t[n]()}},de=(e,t=!1)=>new Je(e,t);var Ot=/(?:let|var|const)(?:\s+(?=[A-Za-z_$])|\s*(?=[{[]))/y,vt=/\$:\s*/y,ve=/import(?=\s*\()/y,jt=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,te=(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},Q=(e,t)=>{let n=e.indexOf(`
2
- `,t);return n===-1?e.length:n},ee=(e,t)=>{let n=e.indexOf("*/",t+2);return n===-1?e.length:n+2},Oe=(e,t)=>{let n=t;for(;n<e.length;){if(/\s/.test(e[n])){n++;continue}if(e[n]==="/"&&e[n+1]==="/"){n=Q(e,n);continue}if(e[n]==="/"&&e[n+1]==="*"){n=ee(e,n);continue}break}return n},ds=new Set(["return","typeof","case","in","instanceof","new","delete","void","do","else","yield","await"]),ne=(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 ds.has(e.slice(r,n+1))}return(s==="+"||s==="-")&&e[n-1]===s?!1:!")]}\"'`.".includes(s)},se=(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},fs=/^(\?\.|\?\?|&&|\|\||\*\*|[.,+\-*/%&|^<>=?:([])/,ps=(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""},Pt=(e,t)=>{let n=0,s=t;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=te(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=Q(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=ee(e,s);continue}if(r==="/"&&ne(e,s)){s=se(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=Oe(e,s+1);if(!(i<e.length&&(fs.test(e.slice(i,i+2))||[",","="].includes(ps(e,s)))))return s;s=i;continue}}s++}return e.length},hs=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=te(e,o),r=o;continue}if(l==="/"&&e[o+1]==="/"){o=Q(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=ee(e,o);continue}if(l==="/"&&ne(e,o)){o=se(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},Qe=e=>{let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return Pe.test(t)?[t]:[];let n=[];for(let s of tt(t.slice(1,Mt(t)))){s.startsWith("...")&&(s=s.slice(3).trim());let r=nt(s);if(r!==-1&&(s=s.slice(0,r).trim()),t.startsWith("{")){let i=et(s,":");if(i!==-1){n.push(...Qe(s.slice(i+1)));continue}}n.push(...Qe(s))}return n},gs=e=>{let t=[],n=hs(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),u=i.slice(o),c=nt(a),p=(c===-1?a:a.slice(0,c)).trim(),w=a[0]==="{"||a[0]==="[";w?t.push(...Qe(p)):Pe.test(p)&&t.push(p);let v=ke(a).code;return{text:`${l}${w?`(${v})`:v}${u}`,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}},ke=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=te(e,s);n+=e.slice(s,a),s=a,i=!1;continue}if(o==="/"&&(l==="/"||l==="*")){let a=l==="/"?Q(e,s):ee(e,s);n+=e.slice(s,a),s=a;continue}if(o==="/"&&ne(e,s)){let a=se(e,s);n+=e.slice(s,a),s=a,i=!1;continue}if(o==="i"&&(s===0||!/[\w$.]/.test(e[s-1]))&&(ve.lastIndex=s,ve.test(e))){n+="$__import",s+=6,i=!1;continue}if(r===0&&i){Ot.lastIndex=s;let a=Ot.exec(e);if(a){let c=s+a[0].length,p=Pt(e,c),{vars:w,code:v}=gs(e.slice(c,p));t.push(...w),n+=v,s=p,i=!1;continue}vt.lastIndex=s;let u=vt.exec(e);if(u){jt.lastIndex=s;let c=jt.exec(e);c&&t.push(c[1]);let p=s+u[0].length,w=Pt(e,p);n+=`$__effect(() => { ${ke(e.slice(p,w)).code} });`,s=w;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}},je=/export\s+default(?![\w$])/y,kt=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,ms=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},ys=(e,t,n)=>{let s=`await $__import(${JSON.stringify(t)})`;if(e===void 0)return s;let r=ms(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(", ")}`},Pe=/^[A-Za-z_$][\w$]*$/,Mt=e=>{let t=0,n=0;for(;n<e.length;){let s=e[n];if(s==="'"||s==='"'||s==="`"){n=te(e,n);continue}if(s==="/"&&e[n+1]==="/"){n=Q(e,n);continue}if(s==="/"&&e[n+1]==="*"){n=ee(e,n);continue}if(s==="/"&&ne(e,n)){n=se(e,n);continue}if("([{".includes(s))t++;else if(")]}".includes(s)&&--t===0)return n;n++}return e.length},et=(e,t)=>{let n=0,s=0;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=te(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=Q(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=ee(e,s);continue}if(r==="/"&&r!==t&&ne(e,s)){s=se(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else if(n===0&&r===t)return s;s++}return-1},tt=e=>{let t=[],n=0,s=0,r=0;for(;r<=e.length;){let i=e[r];if(i==="'"||i==='"'||i==="`"){r=te(e,r);continue}if(i==="/"&&e[r+1]==="/"){r=Q(e,r);continue}if(i==="/"&&e[r+1]==="*"){r=ee(e,r);continue}if(i==="/"&&ne(e,r)){r=se(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},nt=e=>{let t=0;for(;t<e.length;){let n=et(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},Me=e=>{let t=(e??"").trim();if(!t.startsWith("{"))return null;let n=Mt(t);if(n>=t.length)return null;let s=[];for(let r of tt(t.slice(1,n))){if(r.startsWith("..."))continue;let i=nt(r),o=i===-1?r:r.slice(0,i),l=i===-1?void 0:r.slice(i+1).trim(),a=et(o,":"),u=(a===-1?o:o.slice(0,a)).trim();if(!Pe.test(u))continue;let c={name:u};l!==void 0&&(c.default=l);let p=a===-1?"":o.slice(a+1).trim();Pe.test(p)&&(c.as=p),s.push(c)}return s},Es=e=>{let t=0,n=0,s=!0;for(;t<e.length;){let r=e[t];if(r==="'"||r==='"'||r==="`"){t=te(e,t),s=!1;continue}if(r==="/"&&e[t+1]==="/"){t=Q(e,t);continue}if(r==="/"&&e[t+1]==="*"){t=ee(e,t);continue}if(r==="/"&&ne(e,t)){t=se(e,t),s=!1;continue}if(r==="e"&&n===0&&s&&(t===0||!/[\w$.]/.test(e[t-1]))){je.lastIndex=t;let i=je.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},bs=/^async(?![\w$])/,ws=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,Ss=e=>{let t=Es(e);if(t===-1)return null;let n=Oe(e,t),s=e.slice(n);bs.test(s)&&(n=Oe(e,n+5));let r=ws.exec(e.slice(n));if(r&&(n=Oe(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=te(e,o);continue}if(l==="/"&&e[o+1]==="/"){o=Q(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=ee(e,o);continue}if(l==="/"&&ne(e,o)){o=se(e,o);continue}if("([{".includes(l))i++;else if(")]}".includes(l)&&--i===0)break;o++}return tt(e.slice(n+1,o))[0]??""},Le=e=>{let t=Ss(e);if(t===null)return null;let n=Me(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},Lt=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],u=n===0||!/[\w$.]/.test(e[n-1]);if(l==="'"||l==='"'||l==="`"){let c=te(e,n);t+=e.slice(n,c),n=c,r=!1;continue}if(l==="/"&&(a==="/"||a==="*")){let c=a==="/"?Q(e,n):ee(e,n);t+=e.slice(n,c),n=c;continue}if(l==="/"&&ne(e,n)){let c=se(e,n);t+=e.slice(n,c),n=c,r=!1;continue}if(l==="i"&&u){if(ve.lastIndex=n,ve.test(e)){t+="$__import",n+=6,r=!1;continue}if(s===0&&r){kt.lastIndex=n;let c=kt.exec(e);if(c){t+=ys(c[1],c[3],o++),n+=c[0].length,r=!1;continue}}}if(l==="e"&&u&&s===0&&r){je.lastIndex=n;let c=je.exec(e);if(c){i=!0,t+="$__exports.default =",n+=c[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},Rs=new Set(["true","false","null","undefined","this","typeof","instanceof","in","new","void","delete","of","await","yield","NaN","Infinity","arguments","case","do","else","return"]),$s=new Set(["function","class","let","const","var","eval","with"]),Ts=new Set(["$scope","$r","$t"]),Ns=/^(?:\+\+|--|=>|\*\*=|<<=|>>>=|>>=|&&=|\|\|=|\?\?=|[+\-*/%&|^]=(?!=))/,xs=/^(?:>>>|===|!==|\*\*|<<|>>|==|!=|<=|>=|&&|\|\||\?\?|\?\.)/,Cs=e=>/[A-Za-z_$]/.test(e),_s=/^(?:0[xXbBoO][\da-fA-F_]+|\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?)n?/,st=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=Q(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=ee(e,o);continue}if(l==="/"&&ne(e,o)){o=se(e,o),i="value";continue}if(l==='"'||l==="'"){o=te(e,o),i="value";continue}if(l==="`"){let c=o+1;for(;c<e.length;){if(e[c]==="\\"){c+=2;continue}if(e[c]==="`"){c++;break}if(e[c]==="$"&&e[c+1]==="{"){let p=1,w=c+=2;for(;c<e.length&&p>0;)e[c]==="{"?p++:e[c]==="}"&&p--,c++;let v=st(e.slice(w,c-1));if(v===null)return null;v.forEach(I=>t.add(I));continue}c++}o=c,i="value";continue}if(/\d/.test(l)&&i!=="."&&i!=="?."){let c=_s.exec(e.slice(o));o+=c?c[0].length:1,i="value";continue}if(Cs(l)){let c=o;for(;c<e.length&&/[\w$]/.test(e[c]);)c++;let p=e.slice(o,c);if(o=c,$s.has(p))return null;if(i==="."||i==="?."){i="value";continue}if(Rs.has(p)){i=p==="this"?"value":"op";continue}if(Ts.has(p))return null;let w=o;for(;w<e.length&&/\s/.test(e[w]);)w++;if(e[w]==="(")return null;e[w]===":"&&e[w+1]!==":"&&s[s.length-1]==="{"&&n[n.length-1]===0||t.add(p),i="value";continue}let a=e.slice(o);if(Ns.test(a))return null;let u=xs.exec(a);if(u){(u[0]==="&&"||u[0]==="||"||u[0]==="??")&&(r=!0),i=u[0]==="?."?"?.":"op",o+=u[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]};var As="0.7.2",rn=e=>Object.fromEntries(Array.from(e.attributes).map(t=>[t.name,t.value])),on="http://www.w3.org/1999/xhtml",ln=e=>{let t=rn(e),n=e.namespaceURI,s=t[Ue];delete t[Ue];let r=n!==null&&n!==on;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?[ln(i)]:[]})}},Ie=new Map,rt=(e,t)=>{if(!(t in e)){if(t in globalThis)return globalThis[t];throw new ReferenceError(`${t} is not defined`)}},an=(e,t)=>{try{return new Function("$scope","$r",...t,`with ($scope) { return (${e}
8
- ); }`)}catch{return null}},Os=(e,t)=>{if(!oe.scopedNames)return null;let n=st(e);if(n===null)return null;let s=n.filter(i=>!t.includes(i)),r=s.length===0?"":`let $t; ${s.map(i=>`const ${i} = ($t = $scope.${i}) !== undefined ? $t : $r($scope, ${JSON.stringify(i)});`).join(" ")}`;try{return new Function("$scope","$r",...t,`${r} return (${e}
9
- );`)}catch{return null}},cn=(e,t,n)=>{let s=Ie.get(e);if(s===void 0){let r=Os(t,n);s=r?{fn:r,scoped:!0}:{fn:an(t,n),scoped:!1},Ie.set(e,s)}return s},un=(e,t)=>`${t.join(",")}|${e}`,vs=(e,t)=>cn(un(e,t),e,t).fn,js=(e,t,n)=>{let s=an(t,n);return Ie.set(e,{fn:s,scoped:!1}),s},Ps=/^(?:([\w$]+) is not defined|Can't find variable: ([\w$]+))/,ks=100,pe=new Map,ht=new Set,qe=0,ct=!1,ut=new Set,Ms=()=>{ct=!1,!(qe>0)&&(pe.forEach(({name:e,expr:t,scope:n},s)=>{e in n||(ht.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 = () => {}".`))}),pe.clear())},dn=()=>{ct||qe>0||!pe.size||(ct=!0,queueMicrotask(Ms))},fn=e=>{qe++;let t=()=>{qe--,dn()};e.then(t,t)},Ls=(e,t)=>{if(ut.has(e))return;ut.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.`)},pn=(e,t,n)=>{if(!(n instanceof ReferenceError))return Ls(e,n);let s=Ps.exec(n.message),r=s?.[1]??s?.[2];if(!r)return;let i=`${r}|${e}`;ht.has(i)||pe.has(i)||pe.size>=ks||(pe.set(i,{name:r,expr:e,scope:t}),dn())},hn=(e,t,n)=>{let s=n?Object.keys(n):[],r=un(e,s),{fn:i,scoped:o}=cn(r,e,s);if(!i)return;let l=n?Object.values(n):[];if(!o)return i(t,rt,...l);try{return i(t,rt,...l)}catch(a){if(!(a instanceof ReferenceError))throw a;let u=js(r,e,s);if(!u)throw a;return u(t,rt,...l)}},j=(e,t,n)=>{try{return hn(e,t,n)}catch(s){pn(e,t,s);return}},gn=(e,t,n)=>{try{return hn(e,t,n)}catch(s){if(!(s instanceof ReferenceError))throw s;pn(e,t,s);return}},ot=/{{\s*([\s\S]+?)\s*}}/g,Dt=new Map,mn=e=>{let t=Dt.get(e);if(t)return t;let n=[],s=0;ot.lastIndex=0;for(let r=ot.exec(e);r;r=ot.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)),Dt.set(e,n),n},yn=(e,t)=>{if(e.length===1){let s=e[0];return typeof s=="string"?s:String(j(s.expr,t)??"")}let n="";for(let s of e)n+=typeof s=="string"?s:String(j(s.expr,t)??"");return n},En=new Set([":class",":value",":checked",":selected",":if",":elseif",":else",":each",":key",":with",":text",":html",":html.allowed",":props"]),we=e=>En.has(e)||e.startsWith(":class.")||e.startsWith(":props.")||e===":slot"||e.startsWith(":slot."),Ds=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,bn=(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=gn(n,s,{$event:l});typeof a=="function"&&a.call(e,l)},{once:o.has("once"),capture:o.has("capture")})},Is=(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),Re(()=>{let u=gn(n,s,{$event:a});typeof u=="function"&&u(a)})};e.on(r,l)},ie=e=>e.replace(/-(\w)/g,(t,n)=>n.toUpperCase()),We=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),gt=e=>e instanceof DocumentFragment?{first:e.firstChild,last:e.lastChild}:{first:e,last:e},ze=({first:e,last:t})=>{for(let n=e;n;){let s=n===t?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},qs=e=>{e.forEach(t=>{if(t.first===t.last)return ze(t);if(!t.first.parentNode)return;let s=document.createRange();s.setStartBefore(t.first),s.setEndAfter(t.last),s.deleteContents()})},Ws=(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},Fs=({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}},It=(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},fe=null,Fe=null,wn=new WeakSet,Us=e=>{let t={memo:fe,base:Fe};return fe=new Map,Fe=e,t},Bs=e=>{fe=e.memo,Fe=e.base},qt=(e,t)=>e.component!==void 0?Wt(t,e.component):e.tag.includes("-")?Wt(t,e.tag):null,X=e=>e.component??e.tag,Wt=(e,t)=>{if(!fe)return It(e,t);let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s)){if(s===Fe){if(fe.has(t))return fe.get(t);let r=It(s,t);return fe.set(t,r),r}if(!wn.has(s)){for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r}}return null},Hs=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()},zs=(e,t)=>{let n=Hs(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)"}.`)},Ft=100,it=0,Sn=Symbol("jq79.slots"),Rn=e=>e==="slot"||e.startsWith("slot."),$n=e=>e?ie(e):"default",Te=e=>Object.keys(e.attrs).find(t=>t===":slot"||t.startsWith(":slot.")),Gs=e=>e==="default"?":slot":`:slot.${e}`,Zs=e=>typeof e!="string"||e.trim()!=="",Ks=e=>{let t={},n=[];e.children.forEach(r=>{let i=typeof r=="object"&&r.tag==="template"?Te(r):void 0;if(typeof r=="string"||i===void 0){n.push(r);return}let o=$n(i.slice(6));if(o in t){console.warn(`jq79: two <template ${Gs(o)}> in <${X(e)}>; the second was ignored`);return}t[o]={nodes:r.children,binder:r.attrs[i]||void 0}});let s=n.some(Zs);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},Vs=(e,t,n)=>{Me(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?j(i,e):l},set:()=>console.warn(`jq79: "${o}" is a slot prop - it comes from the component, so assigning to it does nothing`)})})},Xs=e=>{let t=Te(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}`)},Ys=(e,t)=>{let n=Object.entries(Ks(e));if(!n.length)return null;let s={};return n.forEach(([r,i])=>{s[r]=Js(i,t)}),s},Js=(e,t)=>(n,s,r,i)=>{let o=Object.create(t);Vs(o,e.binder,n);let l=o[Ae]??[];Object.defineProperty(o,Ae,{value:[...l,s]});let a=de(o);return r.onDispose(()=>a.dispose()),ge(e.nodes,o,a,i)},Qs=(e,t,n,s)=>{let r=$n(e.tag.slice(5)),i=document.createDocumentFragment(),o=document.createComment(e.tag),l=document.createComment(`/${e.tag}`);i.append(o,l);let a=t[Sn]?.[r];if(!a)return i.insertBefore(ge(e.children,t,n,s),l),i;let u={};return Object.entries(e.attrs).forEach(([c,p])=>{if(!(c===be||we(c)||c.startsWith("@")))if(c.startsWith(":")){let w=p||c.slice(1);u[ie(c.slice(1))]=()=>j(w,t)}else u[ie(c)]=()=>p}),i.insertBefore(a(u,t,n,s),l),i},Tn="data-c79-box",er=(e,t,n)=>{if(t.ns!==void 0)return document.createDocumentFragment();let s=document.createElement(Ge(e));s.setAttribute(Tn,"");let r=t.attrs[be];return r!==void 0&&s.setAttribute(be,r),n||so(),s},Ut=new WeakSet,tr=(e,t)=>{if(e.ns===void 0||Ut.has(e))return;let n=t.template.find(r=>typeof r=="object");if(n===void 0||n.ns!==void 0)return;Ut.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}`)},Bt=(e,t,n,s,r)=>{let i=er(e,t,r),o=!(i instanceof DocumentFragment),l=o?null:document.createComment(`/${e}`);o||i.append(document.createComment(e),l);let a=Ys(t,n),u={},c={},p=[],w=[],v=!1;Object.entries(t.attrs).forEach(([R,C])=>{if(R!==be){if(R===":props"||R.startsWith(":props.")){v=!0,w.push({expr:C});return}if(!we(R))if(R.startsWith("@"))p.push([R,C]);else if(R===":model"||R.startsWith(":model.")){let m=R===":model"?"default":ie(R.slice(7));c[m]=C||(R===":model"?"model":m)}else if(R.startsWith(":")){let m=ie(R.slice(1));u[m]=C||m,w.push({name:m,expr:C||m})}else{let m=ie(R),_=JSON.stringify(C);u[m]=_,w.push({name:m,expr:_})}}});let I=R=>R==="default"?":model":`:model.${R}`,U=R=>R==="default"?"model":R,M=R=>`${R}
10
- = $value`,S=new Set;Object.entries(c).forEach(([R,C])=>{let m=U(R);u[m]!==void 0&&console.warn(`jq79: <${X(t)}> binds prop "${m}" through both :${m} and ${I(R)} - ${I(R)} wins`),u[m]=C,vs(M(C),["$value"])===null&&(S.add(R),console.warn(`jq79: ${I(R)}="${C}" is not assignable - updates from <${X(t)}> will be dropped`))});let F=()=>{let R={};return w.forEach(({name:C,expr:m})=>{if(C!==void 0)R[C]=j(m,n);else{let _=j(m,n);_!==null&&typeof _=="object"&&Object.assign(R,_)}}),Object.entries(c).forEach(([C,m])=>{R[U(C)]=j(m,n)}),R},L=null,D=null,z=null,Y=new Set,J=R=>{if(R==null){if(!n[Wn]?.has(e)||Y.has("unfilled"))return;Y.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}Y.has("type")||(Y.add("type"),console.error(`jq79: <${X(t)}> is ${typeof R}, not a component - nothing renders here`))};return s.effect(()=>{let R=j(e,n),C=R instanceof re?R:null;if(C||J(R),C===D||(z?.dispose(),z=null,L?.destroy(),L=null,D=C,!C))return;tr(t,C);let m=new re({template:C.template,scripts:C.scripts,styles:C.styles,modules:C.modules,filename:C.filename,siblings:C.siblings,name:C.name});if(a&&(m.slots=a),Object.keys(c).length){let K=new Set;m.modelWriteback=(T,q)=>{let P=T==null?"default":ie(String(T)),Z=c[P];return Z===void 0?(K.has(P)||(K.add(P),console.warn(`jq79: <${X(t)}> has no ${I(P)} - bound: ${Object.keys(c).map(I).join(", ")}`)),!1):S.has(P)?!1:(Re(()=>j(M(Z),n,{$value:q})),!0)}}p.forEach(([K,T])=>Is(m,K,T,n));let _=co(m.scripts);uo(t,e,Object.keys(u),_);let A=en(Re(F),_),G=document.createDocumentFragment();if(it>=Ft){console.error(`jq79: <${X(t)}> is ${Ft} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}it++;try{(r?m.renderShadow(A):m.render(A)).mount(G)}finally{it--}l?l.parentNode.insertBefore(G,l):i.appendChild(G);let V=de(n,!0);if(v){let K=[];V.effect(()=>{let T=en(F(),_),q=Object.keys(T);K.forEach(P=>{P in T||(m.data[P]=void 0)}),q.forEach(P=>{m.data[P]=T[P]}),K=q})}else Object.entries(u).forEach(([K,T])=>{_!==null&&!_.has(K)||V.effect(()=>{m.data[K]=j(T,n)})});z=V,L=m}),s.onDispose(()=>{z?.dispose(),L?.destroy()}),i},nr=(e,t)=>{let n=()=>{let s=j(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)}})},ae=e=>typeof e=="string"?e.split(/\s+/).filter(Boolean):Array.isArray(e)?e.flatMap(ae):e!==null&&typeof e=="object"?Object.entries(e).flatMap(([t,n])=>n?ae(t):[]):[],sr=e=>typeof e=="function"?(t,n,s)=>{try{return!!e(t,n,s)}catch{return!1}}:typeof e=="string"||Array.isArray(e)?Rt(e):()=>!1,rr=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"]),Nn=e=>e.ns===void 0?document.createElement(e.tag):document.createElementNS(e.ns,e.tag),or={"http://www.w3.org/2000/svg":["svg","feGaussianBlur"],"http://www.w3.org/1998/Math/MathML":["math","mi"]},Ht=new Map,ir=(e,t)=>{let n=`${e} ${t}`,s=Ht.get(n);if(s!==void 0)return s;let r=or[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(u=>u.toLowerCase()===t)??t}return Ht.set(n,i),i},xn=(e,t)=>{let n=e.namespaceURI;if(n===null||n===on)return t;let s=t.replace(/-/g,"").toLowerCase(),r=ir(n,s);return r===s?t:r},Cn=(e,t,n)=>{let s=rr.has(t);(s?!n:n==null)?e.removeAttribute(t):e.setAttribute(t,s?"":String(n))},oe={cloneSkeletons:!0,scopedNames:!0},lr=new Set([":text",":html",":value",":checked",":selected"]),ar=e=>e.startsWith("@")||e===":class"||e.startsWith(":class.")||lr.has(e)?!0:e.startsWith(":")?e===":model"?!1:!we(e)&&!e.includes("."):e!==Ue,_n=e=>{if(e.component||e.tag.includes("-")||Rn(e.tag)||e.tag==="template"||e.ns===void 0&&document.createElement(e.tag)instanceof HTMLUnknownElement)return!1;for(let t in e.attrs)if(!ar(t))return!1;return e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?!0:e.children.every(t=>typeof t=="string"||_n(t))},An=(e,t,n)=>{let s=Nn(e),r,i=null;for(let p in e.attrs){let w=e.attrs[p];if(p.startsWith("@"))n.push({kind:"event",path:t,attr:p,expr:w});else if(p===":class")r=w;else if(p.startsWith(":class."))(i??(i=[])).push([p.slice(7),w]);else if(!we(p))if(p.startsWith(":")){let v=p.slice(1);n.push({kind:"attr",path:t,name:xn(s,v),expr:w||ie(v)})}else s.setAttribute(p,w)}(r!==void 0||i)&&n.push({kind:"class",path:t,classExpr:r,toggles:i,staticClasses:new Set(ae(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,w)=>{if(typeof p=="string"){p.includes("{{")?(n.push({kind:"text",path:[...t,w],parts:mn(p)}),s.appendChild(document.createTextNode(""))):s.appendChild(document.createTextNode(p));return}s.appendChild(An(p,[...t,w],n))});let a=e.attrs[":value"];a!==void 0&&n.push({kind:"value",path:t,expr:a});let u=e.attrs[":checked"];u!==void 0&&n.push({kind:"checked",path:t,expr:u});let c=e.attrs[":selected"];return c!==void 0&&n.push({kind:"selected",path:t,expr:c}),s},cr=3,On=e=>e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?1:1+e.children.reduce((t,n)=>t+(typeof n=="string"?0:On(n)),0),zt=new WeakMap,Gt=new WeakSet,ur=e=>{let t=zt.get(e);if(t!==void 0)return t;if(!Gt.has(e))return Gt.add(e),null;let n=null;if(_n(e)&&On(e)>=cr){let s=[];n={skeleton:An(e,[],s),ops:s}}return zt.set(e,n),n},dr=(e,t)=>{let n=e;for(let s=0;s<t.length;s++)n=n.childNodes[t[s]];return n},fr=(e,t,n)=>{let s=e.skeleton.cloneNode(!0);for(let r of e.ops){let i=r.path.length===0?s:dr(s,r.path);if(r.kind==="text"){let o=i,l=r.parts;n.effect(()=>{let a=yn(l,t);o.textContent!==a&&(o.textContent=a)})}else if(r.kind==="event")bn(i,r.attr,r.expr,t);else if(r.kind==="attr"){let o=i,{name:l,expr:a}=r;n.effect(()=>Cn(o,l,j(a,t)))}else if(r.kind==="class"){let o=i,{classExpr:l,toggles:a,staticClasses:u}=r,c=[];n.effect(()=>{let p=l!==void 0?ae(j(l,t)):[];a?.forEach(([w,v])=>{j(v,t)&&p.push(...ae(w))}),c.forEach(w=>{!p.includes(w)&&!u.has(w)&&o.classList.remove(w)}),o.classList.add(...p),c=p})}else if(r.kind==="textContent"){let o=i,{expr:l}=r;n.effect(()=>{let a=String(j(l,t)??"");o.textContent!==a&&(o.textContent=a)})}else if(r.kind==="html"){let o=i,{expr:l}=r;n.effect(()=>{o.innerHTML=Ke(String(j(l,t)??""))})}else if(r.kind==="value"){let o=i,{expr:l}=r;n.effect(()=>{let a=String(j(l,t)??"");o.value!==a&&(o.value=a)})}else if(r.kind==="checked"){let o=i,{expr:l}=r;n.effect(()=>{let a=!!j(l,t);o.checked!==a&&(o.checked=a)})}else if(r.kind==="selected"){let o=i,{expr:l}=r;n.effect(()=>{let a=!!j(l,t);o.selected!==a&&(o.selected=a)})}else{let o=r}}return s},mt=(e,t,n,s)=>{let r=e.attrs[":with"],i=r!==void 0?nr(r,t):t;if(Rn(e.tag))return Qs(e,i,n,s);if(e.tag==="template"&&Te(e)!==void 0)return Xs(e);let o=qt(e,i);if(o)return Bt(o,e,i,n,s);if(oe.cloneSkeletons){let S=ur(e);if(S)return fr(S,i,n)}let l=Nn(e);if(e.component!==void 0&&i[ft]?.count===0)throw zs(e.component,i);let a=e.ns===void 0&&(e.component!==void 0||e.tag.includes("-"));if(a){let S=!1;n.effect(()=>{if(S)return;let F=qt(e,i);if(!F)return;S=!0;let L=Bt(F,e,i,n,s),D=gt(L);n.onDispose(()=>ze(D)),l.replaceWith(L)})}for(let S in e.attrs){let F=e.attrs[S];if(S.startsWith("@"))bn(l,S,F,i);else if(S===":model"||S.startsWith(":model."))a||console.warn(`jq79: ${S} on <${X(e)}> does nothing - :model binds component tags only (for now)`);else if(!we(S))if(S.startsWith(":"))if(a)l.setAttribute(S,F);else{let L=S.slice(1),D=F||ie(L),z=xn(l,L);n.effect(()=>Cn(l,z,j(D,i)))}else l.setAttribute(S,F)}let u=e.attrs[":class"],c=null;for(let S in e.attrs)S.startsWith(":class.")&&(c??(c=[])).push([S.slice(7),e.attrs[S]]);if(u!==void 0||c){let S=new Set(ae(e.attrs.class??"")),F=[];n.effect(()=>{let L=u!==void 0?ae(j(u,i)):[];c?.forEach(([D,z])=>{j(z,i)&&L.push(...ae(D))}),F.forEach(D=>{!L.includes(D)&&!S.has(D)&&l.classList.remove(D)}),l.classList.add(...L),F=L})}let p=e.attrs[":text"],w=e.attrs[":html"],v=e.attrs[":html.allowed"];v!==void 0&&w===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),p!==void 0?n.effect(()=>{let S=String(j(p,i)??"");l.textContent!==S&&(l.textContent=S)}):w!==void 0?n.effect(()=>{let S=v!==void 0?{allowUrl:sr(j(v,i))}:void 0;l.innerHTML=Ke(String(j(w,i)??""),S)}):l instanceof HTMLTemplateElement?ge(e.children,i,n,s,l.content):ge(e.children,i,n,s,l);let I=e.attrs[":value"];I!==void 0&&n.effect(()=>{let S=String(j(I,i)??"");l.value!==S&&(l.value=S)});let U=e.attrs[":checked"];U!==void 0&&n.effect(()=>{let S=!!j(U,i);l.checked!==S&&(l.checked=S)});let M=e.attrs[":selected"];return M!==void 0&&n.effect(()=>{let S=!!j(M,i);l.selected!==S&&(l.selected=S)}),l},pr=(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 u=e.find(p=>p.expr===void 0||j(p.expr,t))??null;if(u===l||(a?.dispose(),o&&ze(o),o=null,l=u,!u))return;a=de(t);let c=mt(u.node,t,a,s);o=gt(c),r.parentNode.insertBefore(c,r.nextSibling)}),i},Ee=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})},hr=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},gr=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},vn=(e,t)=>typeof e=="string"?t.some(n=>Kt(e,n)):Object.values(e.attrs).some(n=>t.some(s=>Kt(n,s)))||e.children.some(n=>vn(n,t)),Zt=/[A-Za-z0-9_$]/,mr=/^[A-Za-z_$][\w$]*\.[A-Za-z_$][\w$]*$/,Kt=(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(!Zt.test(s)&&!Zt.test(r))return!0}return!1},lt=new WeakMap,yr=e=>{let t=lt.get(e);if(t!==void 0)return t;let n=e.attrs[":each"].match(Ds);if(!n)return lt.set(e,null),null;let[,s,r,i]=n,o=e.attrs[":key"],l=o===s,a=o!==void 0&&!l&&mr.test(o)&&o.startsWith(`${s}.`)?o.slice(s.length+1):void 0,{[":each"]:u,[":key"]:c,...p}=e.attrs,w={...e,attrs:p},v=["$index",...r?[r]:[]],I=vn(w,v),U=/^[A-Z]/.test(s)||r!==void 0&&/^[A-Z]/.test(r),M={itemName:s,atName:r,listExpr:i,keyExpr:o,keyIsItem:l,keyProp:a,itemNode:w,readsPosition:I,namesComponent:U};return lt.set(e,M),M},Er=(e,t,n,s)=>{let r=yr(e);if(!r)return document.createComment(`invalid :each expression "${e.attrs[":each"]}"`);let{itemName:i,atName:o,listExpr:l,keyExpr:a,keyIsItem:u,keyProp:c,itemNode:p,readsPosition:w,namesComponent:v}=r,I=document.createComment("each"),U=document.createDocumentFragment();U.appendChild(I),(":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 M=[],S=!1;return n.effect(()=>{let F=Us(t);try{let L=j(l,t),D=Array.isArray(L),z=D?null:gr(L)?Object.keys(L):[],Y=D?L.length:z.length,J=new Map;M.forEach((T,q)=>{T.pos=q;let P=J.get(T.key);P?P.push(T):J.set(T.key,[T])});let R=new Set,C=[],m=[],_=[],A;for(let T=0;T<Y;T++){let q=D?T:z[T],P=D?L[T]:L[q],Z=q;u?Z=P:c!==void 0&&P!==null&&typeof P=="object"?Z=P[c]:a!==void 0&&(A===void 0?(A=Object.create(t),Ee(A,i,P),o&&Ee(A,o,q),Ee(A,"$index",T)):(A[i]=P,o&&(A[o]=q),A.$index=T),Z=j(a,A)),R.has(Z)&&!S&&(S=!0,console.warn(`jq79: duplicate :key in :each "${e.attrs[":each"]}"; duplicates pair up by position`)),R.add(Z);let f=J.get(Z)?.shift();if(f&&Object.is(f.item,P)){let b=f.scope;b.$index!==T&&(w&&C.push(f),b.$index=T),o&&b[o]!==q&&(b[o]=q),m.push(f),_.push(f.pos);continue}f&&(f.fx.dispose(),ze(f.range));let d=Object.create(t);Ee(d,i,P),o&&Ee(d,o,q),Ee(d,"$index",T),v||wn.add(d);let g=de(t),h=gt(mt(p,d,g,s));m.push({key:Z,item:P,scope:d,fx:g,range:h,pos:T}),_.push(-1)}let G=new Set;J.forEach(T=>T.forEach(q=>G.add(q))),G.size&&(G.forEach(T=>{T.dead=!0,T.fx.dispose()}),qs(Ws(M,T=>T.dead===!0)));let V=I,K=hr(_);m.forEach((T,q)=>{!K[q]&&V.nextSibling!==T.range.first&&Fs(T.range,V),V=T.range.last}),C.forEach(T=>Re(()=>T.fx.refresh())),M=m}finally{Bs(F)}}),U},jn=(e,t)=>{let n=t;for(;n<e.length&&typeof e[n]=="string"&&!e[n].trim();)n++;return n},at=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`)},br=(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`)},wr=[":if",":elseif",":else",":each"],Sr=(e,t)=>{if(e.tag!=="template"||e.ns!==void 0)return;let n=wr.find(s=>s in e.attrs);if(n!==void 0){if(Te(e)!==void 0){if(t?.component===void 0)return;console.warn(`jq79: ${n} on <template ${Te(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`)}},Rr=[...En,":model",":slot"].map(e=>e.slice(1)),$r={":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'},Tr=e=>{for(let t in e.attrs){let n=$r[t];n!==void 0&&console.warn(`jq79: ${n}`)}},Nr=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=Rr.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`)}},Pn=(e,t)=>{e.forEach(s=>{typeof s!="string"&&(Sr(s,t),Tr(s),Nr(s),Pn(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(at(r),":if"in r.attrs){s++;let i=l=>{let a=jn(e,s),u=e[a];if(typeof u=="object"&&l in u.attrs)return s=a+1,u};for(let l=i(":elseif");l;l=i(":elseif"))at(l);let o=i(":else");o&&at(o),n=o!==void 0;continue}(":elseif"in r.attrs||":else"in r.attrs)&&br(r,n),n=!1,s++}},Vt=new WeakMap,xr=(e,t,n)=>{let s=Vt.get(t);if(s)return s;let r=[{expr:t.attrs[":if"],node:t}],i=n+1,o=u=>{let c=jn(e,i),p=e[c];if(typeof p=="object"&&u in p.attrs)return i=c+1,p};for(let u=o(":elseif");u;u=o(":elseif"))r.push({expr:u.attrs[":elseif"],node:u});let l=o(":else");l&&r.push({node:l});let a={branches:r,next:i};return Vt.set(t,a),a},ge=(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 u=mn(l);n.effect(()=>{let c=yn(u,t);a.textContent!==c&&(a.textContent=c)})}i.appendChild(a),o++;continue}if(":each"in l.attrs){i.appendChild(Er(l,t,n,s)),o++;continue}if(":if"in l.attrs){let a=xr(e,l,o);i.appendChild(pr(a.branches,t,n,s)),o=a.next;continue}i.appendChild(mt(l,t,n,s)),o++}return i},Cr=(e,t,n=!1)=>ge(e.template,t,de(t),n),_r=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ar=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,yt=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,Or=e=>e.split(yt).map((t,n)=>n%2===1?t:t.replace(Ar,(s,r,i)=>_r.has(r.toLowerCase())?s:`<${r}${i}></${r}>`)).join(""),kn=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,vr=/"[^"]*"|'[^']*'|(^|\s)\.\.\.([A-Za-z_$][\w$.]*)/g,jr=e=>e.split(yt).map((t,n)=>n%2===1?t:t.replace(kn,(s,r,i)=>{let o=0,l=i.replace(vr,(a,u,c)=>c===void 0?a:`${u}:props.${o++}="${c}"`);return`<${r}${l}>`})).join(""),Pr=/"[^"]*"|'[^']*'|(^|\s)(:[\w.$-]+)/g,kr=/<\/slot\.([\w.$-]+)(\s*)>/gi,Mr=/^slot\./i,Lr=e=>Mr.test(e)?`slot.${We(e.slice(5))}`:e,Ue=":jq79-component",Mn=/^[A-Z]/,Dr="c79-",Ge=e=>`${Dr}${We(e[0].toLowerCase()+e.slice(1))}`,Ir=e=>Mn.test(e)?Ge(e):Lr(e),qr=/<\/([A-Z][\w.-]*)(\s*)>/g,Wr=/\/\s*$/,Fr=(e,t)=>{if(!Mn.test(e))return t;let n=` ${Ue}="${e}"`,s=Wr.exec(t);return s?`${t.slice(0,s.index)}${n}${s[0]}`:`${t}${n}`},Ur=e=>e.split(yt).map((t,n)=>n%2===1?t:t.replace(kn,(s,r,i)=>{let o=i.replace(Pr,(l,a,u)=>u===void 0?l:`${a}${We(u)}`);return`<${Ir(r)}${Fr(r,o)}>`}).replace(kr,(s,r,i)=>`</slot.${We(r)}${i}>`).replace(qr,(s,r,i)=>`</${Ge(r)}${i}>`)).join(""),be="data-jq79",Br=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)},Ln=(e,t)=>{e.forEach(n=>{typeof n!="string"&&(n.attrs[be]=t,Ln(n.children,t))})},Hr=(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}[${be}="${t}"]${o}`}).join(", "),Dn=(e,t)=>{Array.from(e).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=Hr(n.selectorText,t):n instanceof CSSGroupingRule&&Dn(n.cssRules,t)})},zr=/(^|[\s>+~,(])([A-Z][A-Za-z0-9]*)(?![\w-])/g,Gr=/[a-z]/,Zr=e=>e.replace(zr,(t,n,s)=>Gr.test(s)?`${n}${Ge(s)}`:t),Kr=/^\s*@(media|supports|container|layer|scope|document)\b/i,Vr=/^\s*@/,Xr=e=>{let t="",n="",s="",r=[],i=()=>r.length===0||r[r.length-1],o=()=>{t+=i()&&!Vr.test(s)?Zr(n):n,n=""},l=u=>{o(),t+=u,s+=u},a=(u,c)=>{o(),t+=u,s="",c!==void 0?r.push(c):u==="}"&&r.pop()};for(let u=0;u<e.length;){let c=e[u];if(c==="/"&&e[u+1]==="*"){let p=e.indexOf("*/",u+2),w=p===-1?e.length:p+2;l(e.slice(u,w)),u=w}else if(c==='"'||c==="'"){let p=u+1;for(;p<e.length&&e[p]!==c;)p+=e[p]==="\\"?2:1;l(e.slice(u,Math.min(p+1,e.length))),u=p+1}else c==="{"?(a("{",Kr.test(s)),u++):c==="}"||c===";"?(a(c),u++):(n+=c,s+=c,u++)}return o(),t},Yr=(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),Dn(n.cssRules,t),Array.from(n.cssRules).map(s=>s.cssText).join(`
11
- `)},Jr=/^[A-Z][A-Za-z0-9]*$/,dt=e=>{let t=Or(jr(Ur(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=Xt(r,e),l={};return i.forEach(a=>{let u=a.getAttribute("name");if(u===null){console.warn("jq79: a top-level <template> without a name declares nothing and was ignored");return}if(!Jr.test(u)){console.warn(`jq79: <template name="${u}"> was ignored - a component name has to be PascalCase, or no tag could ever reference it (only capitalized names resolve as components)`);return}if(u in l){console.warn(`jq79: two <template name="${u}"> in one file; the second was ignored`);return}l[u]=new re({...Xt(Array.from(a.content.children),a.innerHTML),siblings:l,name:u})}),Object.keys(l).length&&(o.siblings=l),o},Qr=/^(?:text|application)\/(?:x-)?typescript$/i,eo=e=>"lang"in e?`lang="${e.lang}"`:Qr.test(e.type?.trim()??"")?`type="${e.type}"`:null,Xt=(e,t)=>{let n=[],s=[],r=[];e.forEach(o=>{let l={attrs:rn(o),content:o.textContent??""};o.tagName==="SCRIPT"?n.push(l):o.tagName==="STYLE"?s.push(l):r.push(ln(o))}),n.forEach(o=>{let l=eo(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=Xr(o.content))});let i=o=>"scoped"in o.attrs&&!("lang"in o.attrs);if(s.some(i)){let o=Br(t);Ln(r,o),s.forEach(l=>{i(l)&&(l.scoped=Yr(l.content,o))})}return Pn(r),{template:r,scripts:n,styles:s}},Et=e=>/\.html?([?#]|$)/.test(e)?pt(e):import(e),to=/^(?:\.\.?\/|\/|[a-z][a-z0-9+.-]*:)/i,no=(e,t)=>{if(!to.test(e))return e;try{return new URL(e,new URL(t??"",document.baseURI)).href}catch{return e}},In=(e,t)=>e?`
12
- //# sourceURL=${e}?jq79-script=${t}`:"",Yt=e=>e.scoped??e.content,qn=`:where([${Tn}]) { display: contents }`,De=null,so=()=>{De?.isConnected||(De=document.createElement("style"),De.textContent=qn,document.head.appendChild(De))},Be=new Map,ro=e=>{let t=Be.get(e);if(!t){let n=document.createElement("style");n.textContent=e,document.head.appendChild(n),t={el:n,count:0},Be.set(e,t)}t.count++},oo=e=>{let t=Be.get(e);t&&--t.count<=0&&(t.el.remove(),Be.delete(e))},io=(e,t,n,s={},r=Et,i={})=>{let o={...Bn,...s},l=new Proxy(t,{has:(c,p)=>p!=="$__effect"&&p!=="$__import"&&p!=="$__state"&&(Reflect.has(c,p)||!(p in globalThis)&&!(p in o))}),a={},u=new Function("$scope","$__effect","$__import","$__state",...Object.keys(o),`return (async () => { with ($scope) { ${e} }
13
- ;$__state.done = true })()${In(i.filename,i.index??0)}`)(l,n,r,a,...Object.values(o));return u.catch(c=>console.error("jq79: error in :setup script",c)),fn(u),{settled:u,sync:a.done===!0}},Jt=(e,t)=>{t?.forEach(({name:n,default:s})=>{e[n]===void 0&&(e[n]=s===void 0?void 0:j(s,e))})},bt=e=>{let t=e.attrs[":setup"];if(t===void 0)return null;if(t.trim()==="")return[];let n=Me(t);return n||lo(e,t),n},Qt=new WeakSet,lo=(e,t)=>{t.trim()==="_"||Qt.has(e)||(Qt.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`))},ao=e=>{let t=new Set;return e.forEach(n=>{(Le(n.content)??bt(n))?.forEach(({name:r})=>t.add(r))}),t},co=e=>{let t=null;return e.forEach(n=>{let s=Le(n.content)??bt(n);if(!s)return;let r=t??(t=new Set);s.forEach(({name:i})=>r.add(i))}),t},en=(e,t)=>{if(t===null)return e;let n={};return Object.keys(e).forEach(s=>{t.has(s)&&(n[s]=e[s])}),n},tn=new WeakMap,uo=(e,t,n,s)=>{if(s===null)return;let r=tn.get(e)??new Set;tn.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`))})},fo=(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},Wn=Symbol("jq79.unfilledProps"),ft=Symbol("jq79.pendingScripts"),po=e=>e&&e.default!==void 0?e.default:e,ho=(e,t,n,s={},r=Et,i={})=>{let o={...Bn,...s},l={},a=new Function("$__exports","$__default","$__import",...Object.keys(o),`return (async () => { "use strict";
1
+ var Le=Object.defineProperty;var js=Object.getOwnPropertyDescriptor;var Ls=Object.getOwnPropertyNames;var Ds=Object.prototype.hasOwnProperty;var Is=(e,t,n)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var qs=(e,t)=>{for(var n in t)Le(e,n,{get:t[n],enumerable:!0})},Hs=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ls(t))!Ds.call(e,r)&&r!==n&&Le(e,r,{get:()=>t[r],enumerable:!(s=js(t,r))||s.enumerable});return e};var Ws=e=>Hs(Le({},"__esModule",{value:!0}),e);var A=(e,t,n)=>Is(e,typeof t!="symbol"?t+"":t,n);var yi={};qs(yi,{$:()=>be,$$:()=>De,$computed:()=>We,$create:()=>Ie,$reactive:()=>Re,$toRaw:()=>Z,C79:()=>ce,Component79:()=>ce,PendingComponent79:()=>st,enableHotReload:()=>ks,hotUpdate:()=>As,parseComponent:()=>mi,renderComponent:()=>Io});module.exports=Ws(yi);function be(e,t){return typeof e=="string"?document.querySelector(e):e.querySelector(t)}function De(e,t){return Array.from(typeof e=="string"?document.querySelectorAll(e):e.querySelectorAll(t))}var Ie=(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},Fs=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),Zt={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},Us=new Set(["http:","https:","mailto:"]);function Bs(e){try{let t=new URL(e,"https://example.com");return Us.has(t.protocol)}catch{return!1}}var Ks={"https:":"443","http:":"80"};function zs(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 Xt=e=>{let t=(Array.isArray(e)?e:e.split(",")).map(zs).filter(n=>n!==null);return n=>{let s=n.hostname.toLowerCase(),r=n.port||Ks[n.protocol]||"";return t.some(i=>i.host.test(s)&&(i.port===null||i.port===r))}};function Gs(e,t,n,s){try{return!!e(new URL(t,document.baseURI),n,s)}catch{return!1}}var Qt=512;function Yt(e,t,n,s){if(n>Qt)throw new RangeError(`jq79: sanitizeHTML input nests deeper than ${Qt} elements`);for(let r of Array.from(e.childNodes))if(r.nodeType===Node.ELEMENT_NODE){let i=Vs(r,n,s);i&&t.appendChild(i)}else r.nodeType===Node.TEXT_NODE&&t.appendChild(r.cloneNode())}function Vs(e,t,n){let s=e.tagName.toLowerCase();if(!Fs.has(s))return null;let r=document.createElement(s);for(let i of Array.from(e.attributes)){let o=i.name.toLowerCase(),a=Zt[s]?.has(o),l=Zt["*"]?.has(o);!a&&!l||(o==="href"||o==="src")&&(!Bs(i.value)||n&&!Gs(n,i.value,s,o))||r.setAttribute(o,i.value)}return s==="a"&&r.setAttribute("rel","noopener noreferrer"),Yt(e,r,t+1,n),r}function it(e,t){let n=document.createElement("template");n.innerHTML=e;let s=document.createElement("div");return Yt(n.content,s,0,t?.allowUrl),s.innerHTML}var Zs=(e,t)=>t.split(".").reduce((n,s)=>n?.[s],e),qe=e=>{if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},on=(e,t,n)=>{Object.entries(e).forEach(([s,r])=>{let i=t?`${t}.${s}`:s;r&&typeof r=="object"&&qe(r)?on(r,i,n):n(i,r)})},Qs=(e,t)=>{e.own===null?e.own=t:e.own!==t&&(e.ownMany??(e.ownMany=new Set)).add(t)},Xs=(e,t)=>{e.deep===null?e.deep=t:e.deep!==t&&(e.deepMany??(e.deepMany=new Set)).add(t)},Ys=(e,t)=>{e.own===t?e.own=null:e.ownMany?.delete(t)&&e.ownMany.size===0&&(e.ownMany=null)},Js=(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)},Pe=(e,t)=>{e.deep!==null&&t(e.deep),e.deepMany?.forEach(t)},Jt=" keys",at=e=>e?`${e}.${Jt}`:Jt,en=".length",tn=(e,t)=>({children:null,own:null,ownMany:null,deep:null,deepMany:null,parent:e,segment:t}),er=e=>e.own===null&&e.deep===null&&!e.ownMany?.size&&!e.deepMany?.size&&!e.children?.size,ct=Symbol("jq79.raw"),Z=e=>{let t=e;for(;t!==null&&typeof t=="object"&&t[ct];)t=t[ct];return t},an=Symbol("jq79.store"),he=e=>e!==null&&typeof e=="object"&&e[an]===!0,dt=null,de=[],Y=null,$e=e=>{de.push(new Set);let t=Y;Y=null;try{return e()}finally{de.pop(),Y=t}},tr=e=>{e.adopted.forEach((t,n)=>{e.read?.has(n)||(t(),e.adopted.delete(n))})},nn=e=>{e.adopted?.forEach(t=>t()),e.adopted=null},nr=0,lt=new Set,sn="$__attach",rn="$__holds",He=Symbol("jq79.alsoWakenBy"),ft=Symbol("jq79.owner"),Re=e=>{let t=new Map,n=new Set,s=new Set,r=new WeakMap,i=Object.create(null),o=tn(null,""),a=(c,d)=>{let g=o;return c.split(".").forEach(p=>{let S=g.children??(g.children=new Map),m=S.get(p);m||(m=tn(g,p),S.set(p,m)),g=m}),d.deep?Xs(g,d):Qs(g,d),g},l=(c,d)=>{d.deep?Js(c,d):Ys(c,d);let g=c;for(;g?.parent&&er(g);)g.parent.children.delete(g.segment),g=g.parent},f=c=>{let d=o;for(let g of c.split("."))if(d=d.children?.get(g),!d)return;return d},u=c=>{let d=new Set,g=y=>{let R=y.children?[...y.children.values()]:[];for(;R.length;){let T=R.pop();Te(T,k=>d.add(k)),Pe(T,k=>d.add(k)),T.children?.forEach(k=>R.push(k))}},p=o,S=c.split("."),m="";for(let y=0;y<S.length-1;y++){if(p=p.children?.get(S[y]),!p)return d;m=m?`${m}.${S[y]}`:S[y],Pe(p,T=>d.add(T));let R=N.get(m);R&&Te(p,T=>{R.store[rn](T)||d.add(T)}),y===S.length-2&&S[y+1]==="length"&&(Te(p,T=>d.add(T)),g(p))}return p=p.children?.get(S[S.length-1]),p&&(Te(p,y=>d.add(y)),Pe(p,y=>d.add(y)),g(p)),d},h=(c,d,g)=>{if(d===g)return!1;for(let p=d;p<g;p++){let S=c.charCodeAt(p);if(S<48||S>57)return!1}return!0},w=(c,d)=>{if(c.deep||d.size<2)return d;let g=new Set;d.forEach(m=>{m.endsWith(en)&&g.add(m.slice(0,-en.length))});let p=new Set;if(d.forEach(m=>{let y=0,R="";for(let T=m.indexOf(".");T!==-1;T=m.indexOf(".",T+1)){let k=m.slice(0,T);(!(y>0&&h(m,y,T))||g.has(R))&&p.add(k),R=k,y=T+1}}),!p.size)return d;let S=new Set;return d.forEach(m=>{p.has(m)||S.add(m)}),S},O=c=>{let d=null,g=null,p=null,S=lt,m=x=>p?p.has(x):d===x,y=x=>{let z=a(x,c);p?p.set(x,z):d===null?(d=x,g=z):(p=new Map([[d,g],[x,z]]),d=g=null)},R=x=>{if(p){p.forEach((z,W)=>{x.has(W)||(l(z,c),p.delete(W))});return}d!==null&&!x.has(d)&&(l(g,c),d=g=null)},T=()=>{p?p.forEach(x=>l(x,c)):g&&l(g,c),p=null,d=g=null},k=x=>{if(x.size===S.size){let W=!0;if(x.forEach(pe=>{W&&(W=S.has(pe))}),W)return}S=x;let z=w(c,x);R(z),z.forEach(W=>{m(W)||y(W)})};return c.reindex.add(k),k(c.deps),()=>{c.reindex.delete(k),T(),S=lt}},I=c=>{let d=f(c);if(d){let g=new Set;Te(d,p=>g.add(p)),Pe(d,p=>g.add(p)),j(g)}},G=c=>I(at(c)),j=c=>{let d=Array.from(c),g=!0;for(let p=1;g&&p<d.length;p++)g=d[p-1].order<d[p].order;g||d.sort((p,S)=>p.order-S.order),d.forEach(p=>{s.has(p)&&p.run()})},b=(c,d,g=!1)=>{t.get(c)?.forEach(p=>p(d,c)),n.forEach(p=>p(c,d)),g?s.forEach(p=>p.run()):j(u(c))},q=(c,d)=>c!==d&&c!==null&&d!==null&&typeof c=="object"&&typeof d=="object"&&!he(c)&&!he(d)&&qe(c)&&qe(d)&&Array.isArray(c)===Array.isArray(d),D=null,L=-1,B=(c,d)=>{let g=d.length>c.length,p=g?c:d,S=g?d:c,m=0;for(;m<p.length&&Object.is(Z(p[m]),Z(S[m]));)m++;for(let y=m;y<p.length;y++)if(!Object.is(Z(p[y]),Z(S[y+1])))return L;return m},ie=(c,d)=>{if(Array.isArray(d)){let R=c.length,T=d.length,k=R!==T;if(!R||!T)return D;let x=Math.max(R,T);if(Math.abs(R-T)===1){let W=B(c,d);if(W!==L){let pe=[];for(let ot=W;ot<x;ot++)pe.push(String(ot));return{keys:pe,exact:!0,keysChanged:k}}}let z=[];for(let W=0;W<x;W++)if(!Object.is(Z(c[W]),Z(d[W]))&&(z.push(String(W)),z.length*2>=x))return D;return{keys:z,exact:!1,keysChanged:k}}let g=Object.keys(c),p=Object.keys(d),S=new Set([...g,...p]);if(!S.size)return D;let m=[];S.forEach(R=>{Object.is(Z(c[R]),Z(d[R]))||m.push(R)});let y=g.length!==p.length||g.some((R,T)=>R!==p[T]);return m.length*2>=S.size?D:{keys:m,exact:!1,keysChanged:y}},v=(c,d,g,p)=>{let S=new Set,m=R=>{let T=f(R);T&&(Te(T,k=>S.add(k)),Pe(T,k=>S.add(k)))},y=ie(d,g);if(!y)return b(c,p);if(t.get(c)?.forEach(R=>R(p,c)),n.forEach(R=>R(c,p)),m(c),y.keys.forEach(R=>{let T=`${c}.${R}`,k=t.get(T);if(k){let x=Z(g[R]),z=C(x)?V(x,T):x;k.forEach(W=>W(z,T))}y.exact?m(T):u(T).forEach(x=>S.add(x))}),y.keysChanged&&m(at(c)),Array.isArray(g)&&d.length!==g.length){let R=`${c}.length`;t.get(R)?.forEach(T=>T(g.length,R)),m(R)}j(S)},C=c=>c!==null&&typeof c=="object"&&qe(c),N=new Map,H=(c,d)=>{let g=N.get(d);g?.store!==c&&(g?.unsubscribe(),N.set(d,{store:c,unsubscribe:c.$onAny((p,S)=>b(`${d}.${p}`,S))}))},J=c=>{N.get(c)?.unsubscribe(),N.delete(c)},V=(c,d)=>{let g=r.get(c);if(g)return g;let p=null,S=new Proxy(c,{has(m,y){return Reflect.has(m,y)||typeof y=="string"&&p?.has(y)===!0},ownKeys(m){return de[de.length-1]?.add(at(d)),Y!==null&&Y.home!==s&&F(Y),Reflect.ownKeys(m)},get(m,y,R){if(y===ct)return m;if(y===an)return d==="";if(typeof y!="string")return Reflect.get(m,y,R);if(d===""&&y in i)return i[y];let T=d?`${d}.${y}`:y;de[de.length-1]?.add(T),Y!==null&&Y.home!==s&&F(Y);let k=Reflect.get(m,y,R);if(he(k))return H(k,T),k;let x=Z(k);return C(x)?V(x,T):x},set(m,y,R,T){if(T!==S&&!Object.prototype.hasOwnProperty.call(m,y))return Reflect.set(m,y,R,T);let k=d?`${d}.${y}`:y,x=he(R)?R:Z(R),z=!Object.prototype.hasOwnProperty.call(m,y);if(!z&&Object.is(m[y],x)&&(x===null||typeof x!="object"))return!0;let W=m[y];m[y]=x,p?.delete(y),he(x)?H(x,k):J(k);let pe=he(x)||!C(x)?x:V(x,k);return!z&&q(W,x)?v(k,W,x,pe):b(k,pe,z),!0},deleteProperty(m,y){if(typeof y!="string")return Reflect.deleteProperty(m,y);let R=Object.prototype.hasOwnProperty.call(m,y),T=Reflect.deleteProperty(m,y);if(T&&R){let k=d?`${d}.${y}`:y;(p??(p=new Set)).add(y),J(k),b(k,void 0),G(d)}return T}});return r.set(c,S),S},E=V(Z(e),"");Object.entries(Z(e)).forEach(([c,d])=>{he(d)&&H(d,c)});let $=(c,d,{immediate:g=!1}={})=>(t.has(c)||t.set(c,new Set),t.get(c).add(d),g&&d(Zs(E,c),c),()=>t.get(c)?.delete(d)),P=(c,{immediate:d=!1}={})=>(n.add(c),d&&on(E,"",(g,p)=>c(g,p)),()=>n.delete(c)),Q=(c,{deep:d=!1,alsoWakenBy:g}={})=>{let p=!1,S=!1,m={deps:lt,reindex:new Set,deep:d,order:nr++,home:s,adopted:null,read:null,run:()=>{if(p){S=!0;return}p=!0;try{let T=0;do{S=!1,m.read=null;let k=new Set;de.push(k);let x=Y;Y=m;try{c()}finally{de.pop(),Y=x,m.deps=k}}while(S&&++T<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{p=!1,m.adopted&&tr(m),m.reindex.forEach(T=>T(m.deps))}}};s.add(m);let y=O(m),R=()=>{s.delete(m),y(),nn(m)};return g?.length?U(m,g,R):(m.run(),dt=m,R)},U=(c,d,g)=>{let p=d.map(S=>S?.[sn]?.(c)).filter(Boolean);return c.run(),dt=c,()=>{g(),p.forEach(S=>S())}},M=c=>{s.add(c);let d=O(c);return()=>{s.delete(c),d()}},F=c=>{(c.read??(c.read=new Set)).add(s),!(c.adopted?.has(s)||s.has(c))&&(c.adopted??(c.adopted=new Map)).set(s,M(c))},K=()=>{N.forEach(({unsubscribe:c})=>c()),N.clear(),s.forEach(c=>{c.home===s&&nn(c)})};return i.$on=$,i.$onAny=P,i.$effect=Q,i.$dispose=K,i[sn]=M,i[rn]=c=>s.has(c),E},ut=class{constructor(t,n){A(this,"scope",t);A(this,"disposers",null);A(this,"runs",null);A(this,"children",null);A(this,"owners",null);A(this,"options");let s=t[He];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]()}},ge=(e,t=!1)=>new ut(e,t),We=e=>{let t=Re({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 ln=/(?:let|var|const)(?:\s+(?=[A-Za-z_$])|\s*(?=[{[]))/y,cn=/\$:\s*/y,Ue=/import(?=\s*\()/y,dn=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,ne=(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},Fe=(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},sr=new Set(["return","typeof","case","in","instanceof","new","delete","void","do","else","yield","await"]),se=(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 sr.has(e.slice(r,n+1))}return(s==="+"||s==="-")&&e[n-1]===s?!1:!")]}\"'`.".includes(s)},re=(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},rr=/^(\?\.|\?\?|&&|\|\||\*\*|[.,+\-*/%&|^<>=?:([])/,or=(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""},un=(e,t)=>{let n=0,s=t;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=ne(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==="/"&&se(e,s)){s=re(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=Fe(e,s+1);if(!(i<e.length&&(rr.test(e.slice(i,i+2))||[",","="].includes(or(e,s)))))return s;s=i;continue}}s++}return e.length},ir=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=ne(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==="/"&&se(e,o)){o=re(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},pt=e=>{let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return Ke.test(t)?[t]:[];let n=[];for(let s of gt(t.slice(1,pn(t)))){s.startsWith("...")&&(s=s.slice(3).trim());let r=mt(s);if(r!==-1&&(s=s.slice(0,r).trim()),t.startsWith("{")){let i=ht(s,":");if(i!==-1){n.push(...pt(s.slice(i+1)));continue}}n.push(...pt(s))}return n},ar=e=>{let t=[],n=ir(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),u=mt(l),h=(u===-1?l:l.slice(0,u)).trim(),w=l[0]==="{"||l[0]==="[";w?t.push(...pt(h)):Ke.test(h)&&t.push(h);let O=ze(l).code;return{text:`${a}${w?`(${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}},ze=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=ne(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==="/"&&se(e,s)){let l=re(e,s);n+=e.slice(s,l),s=l,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){ln.lastIndex=s;let l=ln.exec(e);if(l){let u=s+l[0].length,h=un(e,u),{vars:w,code:O}=ar(e.slice(u,h));t.push(...w),n+=O,s=h,i=!1;continue}cn.lastIndex=s;let f=cn.exec(e);if(f){dn.lastIndex=s;let u=dn.exec(e);u&&t.push(u[1]);let h=s+f[0].length,w=un(e,h);n+=`$__effect(() => { ${ze(e.slice(h,w)).code} });`,s=w;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}},Be=/export\s+default(?![\w$])/y,fn=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,lr=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},cr=(e,t,n)=>{let s=`await $__import(${JSON.stringify(t)})`;if(e===void 0)return s;let r=lr(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(", ")}`},Ke=/^[A-Za-z_$][\w$]*$/,pn=e=>{let t=0,n=0;for(;n<e.length;){let s=e[n];if(s==="'"||s==='"'||s==="`"){n=ne(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==="/"&&se(e,n)){n=re(e,n);continue}if("([{".includes(s))t++;else if(")]}".includes(s)&&--t===0)return n;n++}return e.length},ht=(e,t)=>{let n=0,s=0;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=ne(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&&se(e,s)){s=re(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else if(n===0&&r===t)return s;s++}return-1},gt=e=>{let t=[],n=0,s=0,r=0;for(;r<=e.length;){let i=e[r];if(i==="'"||i==='"'||i==="`"){r=ne(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==="/"&&se(e,r)){r=re(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},mt=e=>{let t=0;for(;t<e.length;){let n=ht(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},Me=e=>{let t=(e??"").trim();if(!t.startsWith("{"))return null;let n=pn(t);if(n>=t.length)return null;let s=[];for(let r of gt(t.slice(1,n))){if(r.startsWith("..."))continue;let i=mt(r),o=i===-1?r:r.slice(0,i),a=i===-1?void 0:r.slice(i+1).trim(),l=ht(o,":"),f=(l===-1?o:o.slice(0,l)).trim();if(!Ke.test(f))continue;let u={name:f};a!==void 0&&(u.default=a);let h=l===-1?"":o.slice(l+1).trim();Ke.test(h)&&(u.as=h),s.push(u)}return s},dr=e=>{let t=0,n=0,s=!0;for(;t<e.length;){let r=e[t];if(r==="'"||r==='"'||r==="`"){t=ne(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==="/"&&se(e,t)){t=re(e,t),s=!1;continue}if(r==="e"&&n===0&&s&&(t===0||!/[\w$.]/.test(e[t-1]))){Be.lastIndex=t;let i=Be.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},ur=/^async(?![\w$])/,fr=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,pr=e=>{let t=dr(e);if(t===-1)return null;let n=Fe(e,t),s=e.slice(n);ur.test(s)&&(n=Fe(e,n+5));let r=fr.exec(e.slice(n));if(r&&(n=Fe(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=ne(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==="/"&&se(e,o)){o=re(e,o);continue}if("([{".includes(a))i++;else if(")]}".includes(a)&&--i===0)break;o++}return gt(e.slice(n+1,o))[0]??""},Ae=e=>{let t=pr(e);if(t===null)return null;let n=Me(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},hn=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 u=ne(e,n);t+=e.slice(n,u),n=u,r=!1;continue}if(a==="/"&&(l==="/"||l==="*")){let u=l==="/"?ee(e,n):te(e,n);t+=e.slice(n,u),n=u;continue}if(a==="/"&&se(e,n)){let u=re(e,n);t+=e.slice(n,u),n=u,r=!1;continue}if(a==="i"&&f){if(Ue.lastIndex=n,Ue.test(e)){t+="$__import",n+=6,r=!1;continue}if(s===0&&r){fn.lastIndex=n;let u=fn.exec(e);if(u){t+=cr(u[1],u[3],o++),n+=u[0].length,r=!1;continue}}}if(a==="e"&&f&&s===0&&r){Be.lastIndex=n;let u=Be.exec(e);if(u){i=!0,t+="$__exports.default =",n+=u[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},hr=new Set(["true","false","null","undefined","this","typeof","instanceof","in","new","void","delete","of","await","yield","NaN","Infinity","arguments","case","do","else","return"]),gr=new Set(["function","class","let","const","var","eval","with"]),mr=new Set(["$scope","$r","$t"]),yr=/^(?:\+\+|--|=>|\*\*=|<<=|>>>=|>>=|&&=|\|\|=|\?\?=|[+\-*/%&|^]=(?!=))/,Er=/^(?:>>>|===|!==|\*\*|<<|>>|==|!=|<=|>=|&&|\|\||\?\?|\?\.)/,wr=e=>/[A-Za-z_$]/.test(e),Sr=/^(?:0[xXbBoO][\da-fA-F_]+|\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?)n?/,yt=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==="/"&&se(e,o)){o=re(e,o),i="value";continue}if(a==='"'||a==="'"){o=ne(e,o),i="value";continue}if(a==="`"){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 h=1,w=u+=2;for(;u<e.length&&h>0;)e[u]==="{"?h++:e[u]==="}"&&h--,u++;let O=yt(e.slice(w,u-1));if(O===null)return null;O.forEach(I=>t.add(I));continue}u++}o=u,i="value";continue}if(/\d/.test(a)&&i!=="."&&i!=="?."){let u=Sr.exec(e.slice(o));o+=u?u[0].length:1,i="value";continue}if(wr(a)){let u=o;for(;u<e.length&&/[\w$]/.test(e[u]);)u++;let h=e.slice(o,u);if(o=u,gr.has(h))return null;if(i==="."||i==="?."){i="value";continue}if(hr.has(h)){i=h==="this"?"value":"op";continue}if(mr.has(h))return null;let w=o;for(;w<e.length&&/\s/.test(e[w]);)w++;if(e[w]==="(")return null;e[w]===":"&&e[w+1]!==":"&&s[s.length-1]==="{"&&n[n.length-1]===0||t.add(h),i="value";continue}let l=e.slice(o);if(yr.test(l))return null;let f=Er.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 oe=e=>e.replace(/-(\w)/g,(t,n)=>n.toUpperCase()),Ge=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),br=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Tr=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,wt=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,$r=e=>e.split(wt).map((t,n)=>n%2===1?t:t.replace(Tr,(s,r,i)=>br.has(r.toLowerCase())?s:`<${r}${i}></${r}>`)).join(""),mn=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,Rr=/"[^"]*"|'[^']*'|(^|\s)\.\.\.([A-Za-z_$][\w$.]*)/g,xr=e=>e.split(wt).map((t,n)=>n%2===1?t:t.replace(mn,(s,r,i)=>{let o=0,a=i.replace(Rr,(l,f,u)=>u===void 0?l:`${f}:props.${o++}="${u}"`);return`<${r}${a}>`})).join(""),Nr=/"[^"]*"|'[^']*'|(^|\s)(:[\w.$-]+)/g,vr=/<\/slot\.([\w.$-]+)(\s*)>/gi,Cr=/^slot\./i,Pr=e=>Cr.test(e)?`slot.${Ge(e.slice(5))}`:e,ke=":jq79-component",yn=/^[A-Z]/,Mr="c79-",Oe=e=>`${Mr}${Ge(e[0].toLowerCase()+e.slice(1))}`,Ar=e=>yn.test(e)?Oe(e):Pr(e),kr=/<\/([A-Z][\w.-]*)(\s*)>/g,Or=/\/\s*$/,_r=(e,t)=>{if(!yn.test(e))return t;let n=` ${ke}="${e}"`,s=Or.exec(t);return s?`${t.slice(0,s.index)}${n}${s[0]}`:`${t}${n}`},jr=e=>e.split(wt).map((t,n)=>n%2===1?t:t.replace(mn,(s,r,i)=>{let o=i.replace(Nr,(a,l,f)=>f===void 0?a:`${l}${Ge(f)}`);return`<${Ar(r)}${_r(r,o)}>`}).replace(vr,(s,r,i)=>`</slot.${Ge(r)}${i}>`).replace(kr,(s,r,i)=>`</${Oe(r)}${i}>`)).join(""),En=e=>$r(xr(jr(e))),wn=/^[A-Z][A-Za-z0-9]*$/,Et=/{{\s*([\s\S]+?)\s*}}/g,gn=new Map,St=e=>{let t=gn.get(e);if(t)return t;let n=[],s=0;Et.lastIndex=0;for(let r=Et.exec(e);r;r=Et.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)),gn.set(e,n),n},bt=new Set([":class",":value",":checked",":selected",":if",":elseif",":else",":each",":key",":with",":text",":html",":html.allowed",":props"]),me=e=>bt.has(e)||e.startsWith(":class.")||e.startsWith(":props.")||e===":slot"||e.startsWith(":slot."),Sn=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,Ve=e=>e==="slot"||e.startsWith("slot."),Tt=e=>e?oe(e):"default",$t=e=>`${e}
8
+ = $value`,Rt=["$scope","$r"],bn=e=>`with ($scope) { return (${e}
9
+ ); }`,Tn=(e,t)=>{let n=yt(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}`,xt=e=>`await $mounted();${e}`,$n=e=>["$scope","$__effect","$__import","$__state",...e],Rn=e=>`return (async () => { with ($scope) { ${e} }
12
+ ;$__state.done = true })()`,xn=e=>["$__exports","$__default","$__import",...e],Nn=e=>`return (async () => { "use strict";
14
13
  ${e}
15
- ;$__exports.done = true })()${In(i.filename,i.index??0)}`)(l,po,r,...Object.values(o)),u=I=>console.error("jq79: error in factory script",I),c=!1,p,w=()=>{if(c)return p;c=!0;let I=l.default;if(typeof I!="function")return;let U=M=>{M&&typeof M=="object"&&Object.assign(t,M)};try{let M=I(t,{$data:t,$props:t,$effect:n,...s});M instanceof Promise?p=M.then(U).catch(u):U(M)}catch(M){u(M)}return p},v=a.then(w,u);return fn(v),l.done&&w(),{settled:v,sync:l.done===!0&&p===void 0}},go="__JQ79_HMR_ENABLED__",mo="__JQ79_HMR__",he=null,yo=e=>{if(!he||!e.filename)return;let t=he.get(e.filename);t||he.set(e.filename,t=new Set),t.add(new WeakRef(e))},nn=e=>{try{return new URL(e,document.baseURI).pathname}catch{return e}},Fn=(e,t)=>{if(!he)return 0;let n=nn(e),s=dt(t),r=!1,i=l=>l.name===void 0?s:s.siblings?.[l.name]??null,o=0;for(let[l,a]of he)if(nn(l)===n){for(let u of a){let c=u.deref();if(!c){a.delete(u);continue}let p=i(c);if(!p){r=!0;continue}c.hotReplace(p)&&o++}a.size||he.delete(l)}return r?0:o},Un=()=>{he??(he=new Map),globalThis[mo]={update:Fn}},sn=3e3,Eo=(e,t)=>{let n=setTimeout(()=>{console.warn(`jq79: ${e.name?`<${e.name}>`:"a component"}${e.filename?` (${e.filename})`:""} has been waiting ${sn/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.`)},sn);n?.unref?.(),Promise.all(t).then(()=>clearTimeout(n))},pt=async e=>{let t=await fetch(e);if(!t.ok)throw new Error(`failed to fetch component from ${e}: ${t.status}`);return new re(await t.text(),{filename:e})},re=class{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,"ownsSharedStyles",!1);k(this,"useShadow",!1);k(this,"mountRoot",null);k(this,"resolveMounted",null);k(this,"renderDone",!1);k(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(),yo(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;ht.clear(),pe.clear(),ut.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},u=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,u),!o)?!1:(u&&this.styleEls.forEach(c=>o.insertBefore(c,l)),o.insertBefore(this.content,l),this.mountRoot=o,this.settleMounted(),!0)}static debug(t){if(t){let n=oe.scopedNames;for(let s in t){let r=t[s];Object.prototype.hasOwnProperty.call(oe,s)?typeof r=="boolean"?oe[s]=r:console.warn(`jq79: Component79.debug ignored "${s}" - the flags are booleans, and the ones it knows are: ${Object.keys(oe).join(", ")}`):console.warn(`jq79: Component79.debug does not know "${s}" - the flags it has are: ${Object.keys(oe).join(", ")}`)}oe.scopedNames!==n&&Ie.clear()}return{...oe}}static fetch(t){if(Array.isArray(t))throw new TypeError("Component79.fetch takes one URL; use fetchAll for an array");return new He(pt(t))}static fetchAll(t){return Promise.all(t.map(pt))}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=ao(this.scripts),r=fo(this.siblings,s),i=r?Object.assign(Object.create(r),t):{...t},o=new Set([...s].filter(m=>!(m in t)));o.size&&Object.defineProperty(i,Wn,{value:o}),this.slots&&Object.defineProperty(i,Sn,{value:this.slots}),Object.defineProperty(i,ft,{value:{count:0}});let l=$e(i),a=de(l);this.data=l,this.fx=a,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let u=this.startMarker,c=!1,p=(m,_)=>{m==="model:update"&&!c&&(c=!0,console.warn("jq79: $emit('model:update', \u2026) no longer feeds :model - call $updateModel(value) or $updateModel(name, value) instead"));let A=new CustomEvent(m,{detail:_,bubbles:!0,composed:!0,cancelable:!0});return u===this.startMarker&&this.emitListeners.get(m)?.forEach(G=>G(A,_)),A.cancelBubble||u.dispatchEvent(A),!A.defaultPrevented},w,v=new Promise(m=>{w=m});this.resolveMounted=w,this.renderDone=!1;let I=this.endMarker,U=m=>{let _=[];for(let A=u.nextSibling;A&&A!==I;A=A.nextSibling)A instanceof Element&&(A.matches(m)&&_.push(A),_.push(...Array.from(A.querySelectorAll(m))));return _},M=m=>U(m)[0]??null,S=this.modules,F=m=>S&&m in S?Promise.resolve(S[m]):Et(no(m,this.filename)),D=Object.assign(Object.create(null),{$emit:p,$updateModel:(...m)=>{let[_,A]=m.length>1?m:[void 0,m[0]];return u!==this.startMarker?!1:this.modelWriteback?.(_,A)??!1},$slots:Object.fromEntries(Object.keys(this.slots??{}).map(m=>[m,!0]))}),z=m=>`await $mounted();${m}`,Y=[],J=!0;this.scripts.forEach((m,_)=>{let A;Y.push(new Promise(d=>{A=d}));let G=!1,V=()=>{G=!0,A()},T={$mounted:()=>(V(),v),$self:M,$$self:U,...D,...r},q={filename:this.filename,index:_},P=":mounted"in m.attrs,Z=Lt(m.content),f=(()=>{if(Z!==null){P&&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."),Jt(l,Le(m.content));let b=P?z(Z):Z;return ho(b,l,y=>a.effect(y),T,F,q)}let{vars:d,code:g}=ke(m.content);Jt(l,bt(m)),d.forEach(b=>{b in l||(l[b]=void 0)});let h=P?z(g):g;return io(h,l,b=>a.effect(b),T,F,q)})();if(f.sync)f.settled.then(V,V);else{let d=i[ft];d.count++;let g=()=>{d.count--,V()};f.settled.then(g,g)}!f.sync&&!G&&(J=!1)});let R=document.createDocumentFragment(),C=new Proxy(l,{has:(m,_)=>typeof _=="string"&&_ in D||Reflect.has(m,_),get:(m,_,A)=>typeof _=="string"&&_ in D&&!Reflect.has(m,_)?D[_]:Reflect.get(m,_,A)});if(R.append(this.startMarker,this.endMarker),this.content=R,J?(this.endMarker.parentNode.insertBefore(ge(this.template,C,a,n),this.endMarker),this.renderDone=!0,this.settleMounted()):(Promise.all(Y).then(()=>{u===this.startMarker&&(this.endMarker.parentNode.insertBefore(ge(this.template,C,a,n),this.endMarker),this.renderDone=!0,this.settleMounted())}),Eo(this,Y)),n){let m=document.createElement("style");m.textContent=qn,this.styleEls=[...this.styles.map(_=>{let A=document.createElement("style");return A.textContent=_.content,A}),m]}else this.styles.forEach(m=>ro(Yt(m))),this.ownsSharedStyles=!0;return this}mount(t,n){let s=typeof t=="string"?me(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"?me(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.styleEls.forEach(s=>n.appendChild(s)),n.appendChild(this.content),this.mountRoot=n,this.settleMounted(),this}settleMounted(){this.renderDone&&this.mountRoot&&this.resolveMounted?.()}detach(){if(!this.mountRoot||!this.content||!this.startMarker||!this.endMarker)return this;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(){return this.detach(),this.fx?.dispose(),this.fx=null,this.data?.$dispose(),this.styleEls.forEach(t=>t.parentNode?.removeChild(t)),this.styleEls=[],this.ownsSharedStyles&&(this.styles.forEach(t=>oo(Yt(t))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.renderDone=!1,this.data=null,this.resolveMounted=null,this}};k(re,"version",As);var He=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 bo=e=>new re(e),Bn={$:me,$$:xe,$create:Ce,$reactive:$e,$toRaw:H,Component79:re};typeof globalThis<"u"&&globalThis[go]&&Un();0&&(module.exports={$,$$,$create,$reactive,$toRaw,C79,Component79,PendingComponent79,enableHotReload,hotUpdate,parseComponent,renderComponent});
14
+ ;$__exports.done = true })()`,vn=e=>{let t=e.attrs[":setup"];return t===void 0?null:t.trim()===""?[]:Me(t)},Cn=(e,t)=>{let n=new Set;return e.forEach(s=>{(Ae(s.content)??t(s))?.forEach(({name:i})=>n.add(i))}),n};var Pn="__jq79precompiled",Mn="jq79-precompiled",An=(e,t)=>`function anonymous(${e.join(",")}
15
+ ) {
16
+ ${t}
17
+ }`;var Lr="0.7.4",es=e=>Object.fromEntries(Array.from(e.attributes).map(t=>[t.name,t.value])),ts="http://www.w3.org/1999/xhtml",ns=e=>{let t=es(e),n=e.namespaceURI,s=t[ke];delete t[ke];let r=n!==null&&n!==ts;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?[ns(i)]:[]})}},Ye=new Map,Xe=new Map,Wt=!1,kt,ve=class extends Error{constructor(n,s){super(`${n}. ${s}`);A(this,"reason",n);A(this,"hint",s)}},Dr=()=>new ve("was not precompiled","Safe mode never builds code at runtime: the component's precompiled functions did not reach the page."),Ir=(e,t)=>{let n=globalThis[Pn];if(Array.isArray(n)&&n.length>0)for(let[s,r,i]of n.splice(0))Xe.set(Ze(s,r),i);return Xe.size===0?void 0:Xe.get(Ze(e,t))},Ft=(e,t,n="")=>{let s=Ir(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(kt!==void 0)return qr(e,t,n,kt);if(Wt)throw Dr();return new Function(...e,t+n)},ss=()=>{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}},kn="__jq79built",qr=(e,t,n,s)=>{let r=document.createElement("script");r.setAttribute("nonce",s),r.textContent=`document.currentScript.${kn} = ${An(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[kn];if(typeof a=="function")return Xe.set(Ze(e,t),a),a;throw i!==void 0?i:new ve("could not be built","The page's CSP refused a <script> carrying the nonce jq79 read from the page.")},On=new Set,Hr=(e,t)=>{On.has(e)||(On.add(e),console.error(`jq79: safeEval() is on, and "${e}" ${t.reason}, so it rendered as nothing. ${t.hint}`))},Nt=(e,t)=>{if(!(t in e)){if(t in globalThis)return globalThis[t];throw new ReferenceError(`${t} is not defined`)}},rs=(e,t)=>{try{return Ft([...Rt,...t],bn(e))}catch(n){return n instanceof ve&&Hr(e,n),null}},Wr=(e,t)=>{if(!ae.scopedNames)return null;let n=Tn(e,t);if(n===null)return null;try{return Ft([...Rt,...t],n)}catch{return null}},os=(e,t,n)=>{let s=Ye.get(e);if(s===void 0){let r=Wr(t,n);s=r?{fn:r,scoped:!0}:{fn:rs(t,n),scoped:!1},Ye.set(e,s)}return s},is=(e,t)=>`${t.join(",")}|${e}`,Fr=(e,t)=>os(is(e,t),e,t).fn,Ur=(e,t,n)=>{let s=rs(t,n);return Ye.set(e,{fn:s,scoped:!1}),s},Br=/^(?:([\w$]+) is not defined|Can't find variable: ([\w$]+))/,Kr=100,Ee=new Map,Ut=new Set,Je=0,Ot=!1,_t=new Set,zr=()=>{Ot=!1,!(Je>0)&&(Ee.forEach(({name:e,expr:t,scope:n},s)=>{e in n||(Ut.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 = () => {}".`))}),Ee.clear())},as=()=>{Ot||Je>0||!Ee.size||(Ot=!0,queueMicrotask(zr))},ls=e=>{Je++;let t=()=>{Je--,as()};e.then(t,t)},Gr=(e,t)=>{if(_t.has(e))return;_t.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.`)},cs=(e,t,n)=>{if(!(n instanceof ReferenceError))return Gr(e,n);let s=Br.exec(n.message),r=s?.[1]??s?.[2];if(!r)return;let i=`${r}|${e}`;Ut.has(i)||Ee.has(i)||Ee.size>=Kr||(Ee.set(i,{name:r,expr:e,scope:t}),as())},ds=(e,t,n)=>{let s=n?Object.keys(n):[],r=is(e,s),{fn:i,scoped:o}=os(r,e,s);if(!i)return;let a=n?Object.values(n):[];if(!o)return i(t,Nt,...a);try{return i(t,Nt,...a)}catch(l){if(!(l instanceof ReferenceError))throw l;let f=Ur(r,e,s);if(!f)throw l;return f(t,Nt,...a)}},_=(e,t,n)=>{try{return ds(e,t,n)}catch(s){cs(e,t,s);return}},us=(e,t,n)=>{try{return ds(e,t,n)}catch(s){if(!(s instanceof ReferenceError))throw s;cs(e,t,s);return}},fs=(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},ps=(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=us(n,s,{$event:a});typeof l=="function"&&l.call(e,a)},{once:o.has("once"),capture:o.has("capture")})},Vr=(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=us(n,s,{$event:l});typeof f=="function"&&f(l)})};e.on(r,a)},Bt=e=>e instanceof DocumentFragment?{first:e.firstChild,last:e.lastChild}:{first:e,last:e},rt=({first:e,last:t})=>{for(let n=e;n;){let s=n===t?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},Zr=e=>{e.forEach(t=>{if(t.first===t.last)return rt(t);if(!t.first.parentNode)return;let s=document.createRange();s.setStartBefore(t.first),s.setEndAfter(t.last),s.deleteContents()})},Qr=(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},Xr=({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}},_n=(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},ye=null,et=null,hs=new WeakSet,Yr=e=>{let t={memo:ye,base:et};return ye=new Map,et=e,t},Jr=e=>{ye=e.memo,et=e.base},jn=(e,t)=>e.component!==void 0?Ln(t,e.component):e.tag.includes("-")?Ln(t,e.tag):null,X=e=>e.component??e.tag,Ln=(e,t)=>{if(!ye)return _n(e,t);let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s)){if(s===et){if(ye.has(t))return ye.get(t);let r=_n(s,t);return ye.set(t,r),r}if(!hs.has(s)){for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r}}return null},eo=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()},to=(e,t)=>{let n=eo(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)"}.`)},Dn=100,vt=0,gs=Symbol("jq79.slots"),je=e=>Object.keys(e.attrs).find(t=>t===":slot"||t.startsWith(":slot.")),no=e=>e==="default"?":slot":`:slot.${e}`,so=e=>typeof e!="string"||e.trim()!=="",ro=e=>{let t={},n=[];e.children.forEach(r=>{let i=typeof r=="object"&&r.tag==="template"?je(r):void 0;if(typeof r=="string"||i===void 0){n.push(r);return}let o=Tt(i.slice(6));if(o in t){console.warn(`jq79: two <template ${no(o)}> in <${X(e)}>; the second was ignored`);return}t[o]={nodes:r.children,binder:r.attrs[i]||void 0}});let s=n.some(so);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},oo=(e,t,n)=>{Me(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`)})})},io=e=>{let t=je(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}`)},ao=(e,t)=>{let n=Object.entries(ro(e));if(!n.length)return null;let s={};return n.forEach(([r,i])=>{s[r]=lo(i,t)}),s},lo=(e,t)=>(n,s,r,i)=>{let o=Object.create(t);oo(o,e.binder,n);let a=o[He]??[];Object.defineProperty(o,He,{value:[...a,s]});let l=ge(o);return l.ownedBy(s),r.onDispose(()=>l.dispose()),Se(e.nodes,o,l,i)},co=(e,t,n,s)=>{let r=Tt(e.tag.slice(5)),i=document.createDocumentFragment(),o=document.createComment(e.tag),a=document.createComment(`/${e.tag}`);i.append(o,a);let l=t[gs]?.[r];if(!l)return i.insertBefore(Se(e.children,t,n,s),a),i;let f={};return Object.entries(e.attrs).forEach(([u,h])=>{if(!(u===Ce||me(u)||u.startsWith("@")))if(u.startsWith(":")){let w=h||u.slice(1);f[oe(u.slice(1))]=()=>_(w,t)}else f[oe(u)]=()=>h}),i.insertBefore(l(f,t,n,s),a),i},ms="data-c79-box",uo=(e,t,n)=>{if(t.ns!==void 0)return document.createDocumentFragment();let s=document.createElement(Oe(e));s.setAttribute(ms,"");let r=t.attrs[Ce];return r!==void 0&&s.setAttribute(Ce,r),n||Jo(),s},In=new WeakSet,fo=(e,t)=>{if(e.ns===void 0||In.has(e))return;let n=t.template.find(r=>typeof r=="object");if(n===void 0||n.ns!==void 0)return;In.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}`)},qn=(e,t,n,s,r)=>{let i=uo(e,t,r),o=!(i instanceof DocumentFragment),a=o?null:document.createComment(`/${e}`);o||i.append(document.createComment(e),a);let l=ao(t,n),f={},u={},h=[],w=[],O=!1;Object.entries(t.attrs).forEach(([v,C])=>{if(v!==Ce){if(v===":props"||v.startsWith(":props.")){O=!0,w.push({expr:C});return}if(!me(v))if(v.startsWith("@"))h.push([v,C]);else if(v===":model"||v.startsWith(":model.")){let N=v===":model"?"default":oe(v.slice(7));u[N]=C||(v===":model"?"model":N)}else if(v.startsWith(":")){let N=oe(v.slice(1));f[N]=C||N,w.push({name:N,expr:C||N})}else{let N=oe(v),H=JSON.stringify(C);f[N]=H,w.push({name:N,expr:H})}}});let I=v=>v==="default"?":model":`:model.${v}`,G=v=>v==="default"?"model":v,j=new Set;Object.entries(u).forEach(([v,C])=>{let N=G(v);f[N]!==void 0&&console.warn(`jq79: <${X(t)}> binds prop "${N}" through both :${N} and ${I(v)} - ${I(v)} wins`),f[N]=C,Fr($t(C),["$value"])===null&&(j.add(v),console.warn(`jq79: ${I(v)}="${C}" is not assignable - updates from <${X(t)}> will be dropped`))});let b=()=>{let v={};return w.forEach(({name:C,expr:N})=>{if(C!==void 0)v[C]=_(N,n);else{let H=_(N,n);H!==null&&typeof H=="object"&&Object.assign(v,H)}}),Object.entries(u).forEach(([C,N])=>{v[G(C)]=_(N,n)}),v},q=null,D=null,L=null,B=new Set,ie=v=>{if(v==null){if(!n[Ms]?.has(e)||B.has("unfilled"))return;B.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}B.has("type")||(B.add("type"),console.error(`jq79: <${X(t)}> is ${typeof v}, not a component - nothing renders here`))};return s.effect(()=>{let v=_(e,n),C=v instanceof ce?v:null;if(C||ie(v),C===D||(L?.dispose(),L=null,q?.destroy(),q=null,D=C,!C))return;fo(t,C);let N=new ce({template:C.template,scripts:C.scripts,styles:C.styles,modules:C.modules,filename:C.filename,siblings:C.siblings,name:C.name});if(l&&(N.slots=l),Object.keys(u).length){let $=new Set;N.modelWriteback=(P,Q)=>{let U=P==null?"default":oe(String(P)),M=u[U];return M===void 0?($.has(U)||($.add(U),console.warn(`jq79: <${X(t)}> has no ${I(U)} - bound: ${Object.keys(u).map(I).join(", ")}`)),!1):j.has(U)?!1:($e(()=>_($t(M),n,{$value:Q})),!0)}}h.forEach(([$,P])=>Vr(N,$,P,n));let H=ri(N.scripts);oi(t,e,Object.keys(f),H);let J=Qn($e(b),H),V=document.createDocumentFragment();if(vt>=Dn){console.error(`jq79: <${X(t)}> is ${Dn} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}vt++;try{(r?N.renderShadow(J):N.render(J)).mount(V)}finally{vt--}a?a.parentNode.insertBefore(V,a):i.appendChild(V);let E=ge(n,!0);if(O){let $=[];E.effect(()=>{let P=Qn(b(),H),Q=Object.keys(P);$.forEach(U=>{U in P||(N.data[U]=void 0)}),Q.forEach(U=>{N.data[U]=P[U]}),$=Q})}else Object.entries(f).forEach(([$,P])=>{H!==null&&!H.has($)||E.effect(()=>{N.data[$]=_(P,n)})});L=E,q=N}),s.onDispose(()=>{L?.dispose(),q?.destroy()}),i},po=(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)}})},fe=e=>typeof e=="string"?e.split(/\s+/).filter(Boolean):Array.isArray(e)?e.flatMap(fe):e!==null&&typeof e=="object"?Object.entries(e).flatMap(([t,n])=>n?fe(t):[]):[],ho=e=>typeof e=="function"?(t,n,s)=>{try{return!!e(t,n,s)}catch{return!1}}:typeof e=="string"||Array.isArray(e)?Xt(e):()=>!1,go=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"]),ys=e=>e.ns===void 0?document.createElement(e.tag):document.createElementNS(e.ns,e.tag),mo={"http://www.w3.org/2000/svg":["svg","feGaussianBlur"],"http://www.w3.org/1998/Math/MathML":["math","mi"]},Hn=new Map,yo=(e,t)=>{let n=`${e} ${t}`,s=Hn.get(n);if(s!==void 0)return s;let r=mo[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 Hn.set(n,i),i},Es=(e,t)=>{let n=e.namespaceURI;if(n===null||n===ts)return t;let s=t.replace(/-/g,"").toLowerCase(),r=yo(n,s);return r===s?t:r},ws=(e,t,n)=>{let s=go.has(t);(s?!n:n==null)?e.removeAttribute(t):e.setAttribute(t,s?"":String(n))},ae={cloneSkeletons:!0,scopedNames:!0},Eo=new Set([":text",":html",":value",":checked",":selected"]),wo=e=>e.startsWith("@")||e===":class"||e.startsWith(":class.")||Eo.has(e)?!0:e.startsWith(":")?e===":model"?!1:!me(e)&&!e.includes("."):e!==ke,Ss=e=>{if(e.component||e.tag.includes("-")||Ve(e.tag)||e.tag==="template"||e.ns===void 0&&document.createElement(e.tag)instanceof HTMLUnknownElement)return!1;for(let t in e.attrs)if(!wo(t))return!1;return e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?!0:e.children.every(t=>typeof t=="string"||Ss(t))},bs=(e,t,n)=>{let s=ys(e),r,i=null;for(let h in e.attrs){let w=e.attrs[h];if(h.startsWith("@"))n.push({kind:"event",path:t,attr:h,expr:w});else if(h===":class")r=w;else if(h.startsWith(":class."))(i??(i=[])).push([h.slice(7),w]);else if(!me(h))if(h.startsWith(":")){let O=h.slice(1);n.push({kind:"attr",path:t,name:Es(s,O),expr:w||oe(O)})}else s.setAttribute(h,w)}(r!==void 0||i)&&n.push({kind:"class",path:t,classExpr:r,toggles:i,staticClasses:new Set(fe(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((h,w)=>{if(typeof h=="string"){h.includes("{{")?(n.push({kind:"text",path:[...t,w],parts:St(h)}),s.appendChild(document.createTextNode(""))):s.appendChild(document.createTextNode(h));return}s.appendChild(bs(h,[...t,w],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 u=e.attrs[":selected"];return u!==void 0&&n.push({kind:"selected",path:t,expr:u}),s},So=3,Ts=e=>e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?1:1+e.children.reduce((t,n)=>t+(typeof n=="string"?0:Ts(n)),0),Wn=new WeakMap,Fn=new WeakSet,bo=e=>{let t=Wn.get(e);if(t!==void 0)return t;if(!Fn.has(e))return Fn.add(e),null;let n=null;if(Ss(e)&&Ts(e)>=So){let s=[];n={skeleton:bs(e,[],s),ops:s}}return Wn.set(e,n),n},To=(e,t)=>{let n=e;for(let s=0;s<t.length;s++)n=n.childNodes[t[s]];return n},$o=(e,t,n)=>{let s=e.skeleton.cloneNode(!0);for(let r of e.ops){let i=r.path.length===0?s:To(s,r.path);if(r.kind==="text"){let o=i,a=r.parts;n.effect(()=>{let l=fs(a,t);o.textContent!==l&&(o.textContent=l)})}else if(r.kind==="event")ps(i,r.attr,r.expr,t);else if(r.kind==="attr"){let o=i,{name:a,expr:l}=r;n.effect(()=>ws(o,a,_(l,t)))}else if(r.kind==="class"){let o=i,{classExpr:a,toggles:l,staticClasses:f}=r,u=[];n.effect(()=>{let h=a!==void 0?fe(_(a,t)):[];l?.forEach(([w,O])=>{_(O,t)&&h.push(...fe(w))}),u.forEach(w=>{!h.includes(w)&&!f.has(w)&&o.classList.remove(w)}),o.classList.add(...h),u=h})}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},Kt=(e,t,n,s)=>{let r=e.attrs[":with"],i=r!==void 0?po(r,t):t;if(Ve(e.tag))return co(e,i,n,s);if(e.tag==="template"&&je(e)!==void 0)return io(e);let o=jn(e,i);if(o)return qn(o,e,i,n,s);if(ae.cloneSkeletons){let b=bo(e);if(b)return $o(b,i,n)}let a=ys(e);if(e.component!==void 0&&i[qt]?.count===0)throw to(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 q=jn(e,i);if(!q)return;b=!0;let D=qn(q,e,i,n,s),L=Bt(D);n.onDispose(()=>rt(L)),a.replaceWith(D)})}for(let b in e.attrs){let q=e.attrs[b];if(b.startsWith("@"))ps(a,b,q,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(!me(b))if(b.startsWith(":"))if(l)a.setAttribute(b,q);else{let D=b.slice(1),L=q||oe(D),B=Es(a,D);n.effect(()=>ws(a,B,_(L,i)))}else a.setAttribute(b,q)}let f=e.attrs[":class"],u=null;for(let b in e.attrs)b.startsWith(":class.")&&(u??(u=[])).push([b.slice(7),e.attrs[b]]);if(f!==void 0||u){let b=new Set(fe(e.attrs.class??"")),q=[];n.effect(()=>{let D=f!==void 0?fe(_(f,i)):[];u?.forEach(([L,B])=>{_(B,i)&&D.push(...fe(L))}),q.forEach(L=>{!D.includes(L)&&!b.has(L)&&a.classList.remove(L)}),a.classList.add(...D),q=D})}let h=e.attrs[":text"],w=e.attrs[":html"],O=e.attrs[":html.allowed"];O!==void 0&&w===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),h!==void 0?n.effect(()=>{let b=String(_(h,i)??"");a.textContent!==b&&(a.textContent=b)}):w!==void 0?n.effect(()=>{let b=O!==void 0?{allowUrl:ho(_(O,i))}:void 0;a.innerHTML=it(String(_(w,i)??""),b)}):a instanceof HTMLTemplateElement?Se(e.children,i,n,s,a.content):Se(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 G=e.attrs[":checked"];G!==void 0&&n.effect(()=>{let b=!!_(G,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},Ro=(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(h=>h.expr===void 0||_(h.expr,t))??null;if(f===a||(l?.dispose(),o&&rt(o),o=null,a=f,!f))return;l=ge(t);let u=Kt(f.node,t,l,s);o=Bt(u),r.parentNode.insertBefore(u,r.nextSibling)}),n.onDispose(()=>l?.dispose()),i},xe=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})},xo=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},No=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},$s=(e,t)=>typeof e=="string"?t.some(n=>Bn(e,n)):Object.values(e.attrs).some(n=>t.some(s=>Bn(n,s)))||e.children.some(n=>$s(n,t)),Rs=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("-")||Ve(e.tag)||e.children.some(Rs)),Un=/[A-Za-z0-9_$]/,vo=/^[A-Za-z_$][\w$]*\.[A-Za-z_$][\w$]*$/,Bn=(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(!Un.test(s)&&!Un.test(r))return!0}return!1},Ct=new WeakMap,Co=e=>{let t=Ct.get(e);if(t!==void 0)return t;let n=e.attrs[":each"].match(Sn);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&&vo.test(o)&&o.startsWith(`${s}.`)?o.slice(s.length+1):void 0,{[":each"]:f,[":key"]:u,...h}=e.attrs,w={...e,attrs:h},O=["$index",...r?[r]:[]],I=$s(w,O),G=/^[A-Z]/.test(s)||r!==void 0&&/^[A-Z]/.test(r),j=o!==void 0&&Rs(w),b={itemName:s,atName:r,listExpr:i,keyExpr:o,keyIsItem:a,keyProp:l,itemNode:w,readsPosition:I,namesComponent:G,nestsScopes:j};return Ct.set(e,b),b},Po=(e,t,n,s)=>{let r=Co(e);if(!r)return document.createComment(`invalid :each expression "${e.attrs[":each"]}"`);let{itemName:i,atName:o,listExpr:a,keyExpr:l,keyIsItem:f,keyProp:u,itemNode:h,readsPosition:w,namesComponent:O,nestsScopes:I}=r,G=document.createComment("each"),j=document.createDocumentFragment();j.appendChild(G),(":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=[],q=!1;return n.effect(()=>{let D=Yr(t);try{let L=_(a,t),B=Array.isArray(L),ie=B?null:No(L)?Object.keys(L):[],v=B?L.length:ie.length,C=new Map;b.forEach((M,F)=>{M.pos=F;let K=C.get(M.key);K?K.push(M):C.set(M.key,[M])});let N=new Set,H=[],J=[],V=[],E=[],$;for(let M=0;M<v;M++){let F=B?M:ie[M],K=B?L[M]:L[F],c=F;f?c=K:u!==void 0&&K!==null&&typeof K=="object"?c=K[u]:l!==void 0&&($===void 0?($=Object.create(t),xe($,i,K),o&&xe($,o,F),xe($,"$index",M)):($[i]=K,o&&($[o]=F),$.$index=M),c=_(l,$)),N.has(c)&&!q&&(q=!0,console.warn(`jq79: duplicate :key in :each "${e.attrs[":each"]}"; duplicates pair up by position`)),N.add(c);let d=C.get(c)?.shift();if(d&&Object.is(d.item,K)){let m=d.scope;m.$index!==M&&(w&&H.push(d),m.$index=M),o&&m[o]!==F&&(m[o]=F),V.push(d),E.push(d.pos);continue}if(d&&l!==void 0){let m=d.scope;m[i]=K,m.$index!==M&&(m.$index=M),o&&m[o]!==F&&(m[o]=F),d.item=K,J.push(d),V.push(d),E.push(d.pos);continue}d&&(d.fx.dispose(),rt(d.range));let g=Object.create(t);xe(g,i,K),o&&xe(g,o,F),xe(g,"$index",M),O||hs.add(g);let p=ge(t);I&&Object.defineProperty(g,ft,{value:p});let S=Bt(Kt(h,g,p,s));V.push({key:c,item:K,scope:g,fx:p,range:S,pos:M}),E.push(-1)}let P=new Set;C.forEach(M=>M.forEach(F=>P.add(F))),P.size&&(P.forEach(M=>{M.dead=!0,M.fx.dispose()}),Zr(Qr(b,M=>M.dead===!0)));let Q=G,U=xo(E);V.forEach((M,F)=>{!U[F]&&Q.nextSibling!==M.range.first&&Xr(M.range,Q),Q=M.range.last}),H.forEach(M=>$e(()=>M.fx.refresh())),J.forEach(M=>$e(()=>M.fx.rerun())),b=V}finally{Jr(D)}}),n.onDispose(()=>b.forEach(D=>D.fx.dispose())),j},xs=(e,t)=>{let n=t;for(;n<e.length&&typeof e[n]=="string"&&!e[n].trim();)n++;return n},Pt=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`)},Mo=(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`)},Ao=[":if",":elseif",":else",":each"],ko=(e,t)=>{if(e.tag!=="template"||e.ns!==void 0)return;let n=Ao.find(s=>s in e.attrs);if(n!==void 0){if(je(e)!==void 0){if(t?.component===void 0)return;console.warn(`jq79: ${n} on <template ${je(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`)}},Oo=[...bt,":model",":slot"].map(e=>e.slice(1)),_o={":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'},jo=e=>{for(let t in e.attrs){let n=_o[t];n!==void 0&&console.warn(`jq79: ${n}`)}},Lo=e=>{if(!(e.component!==void 0||e.tag.includes("-")))for(let t in e.attrs){if(!t.startsWith(":")||me(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=Oo.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`)}},Ns=(e,t)=>{e.forEach(s=>{typeof s!="string"&&(ko(s,t),jo(s),Lo(s),Ns(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(Pt(r),":if"in r.attrs){s++;let i=a=>{let l=xs(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"))Pt(a);let o=i(":else");o&&Pt(o),n=o!==void 0;continue}(":elseif"in r.attrs||":else"in r.attrs)&&Mo(r,n),n=!1,s++}},Kn=new WeakMap,Do=(e,t,n)=>{let s=Kn.get(t);if(s)return s;let r=[{expr:t.attrs[":if"],node:t}],i=n+1,o=f=>{let u=xs(e,i),h=e[u];if(typeof h=="object"&&f in h.attrs)return i=u+1,h};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 Kn.set(t,l),l},Se=(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=St(a);n.effect(()=>{let u=fs(f,t);l.textContent!==u&&(l.textContent=u)})}i.appendChild(l),o++;continue}if(":each"in a.attrs){i.appendChild(Po(a,t,n,s)),o++;continue}if(":if"in a.attrs){let l=Do(e,a,o);i.appendChild(Ro(l.branches,t,n,s)),o=l.next;continue}i.appendChild(Kt(a,t,n,s)),o++}return i},Io=(e,t,n=!1)=>Se(e.template,t,ge(t),n),Ce="data-jq79",qo=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)},vs=(e,t)=>{e.forEach(n=>{typeof n!="string"&&(n.attrs[Ce]=t,vs(n.children,t))})},Ho=(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}[${Ce}="${t}"]${o}`}).join(", "),Cs=(e,t)=>{Array.from(e).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=Ho(n.selectorText,t):n instanceof CSSGroupingRule&&Cs(n.cssRules,t)})},Wo=/(^|[\s>+~,(])([A-Z][A-Za-z0-9]*)(?![\w-])/g,Fo=/[a-z]/,Uo=e=>e.replace(Wo,(t,n,s)=>Fo.test(s)?`${n}${Oe(s)}`:t),Bo=/^\s*@(media|supports|container|layer|scope|document)\b/i,Ko=/^\s*@/,zo=e=>{let t="",n="",s="",r=[],i=()=>r.length===0||r[r.length-1],o=()=>{t+=i()&&!Ko.test(s)?Uo(n):n,n=""},a=f=>{o(),t+=f,s+=f},l=(f,u)=>{o(),t+=f,s="",u!==void 0?r.push(u):f==="}"&&r.pop()};for(let f=0;f<e.length;){let u=e[f];if(u==="/"&&e[f+1]==="*"){let h=e.indexOf("*/",f+2),w=h===-1?e.length:h+2;a(e.slice(f,w)),f=w}else if(u==='"'||u==="'"){let h=f+1;for(;h<e.length&&e[h]!==u;)h+=e[h]==="\\"?2:1;a(e.slice(f,Math.min(h+1,e.length))),f=h+1}else u==="{"?(l("{",Bo.test(s)),f++):u==="}"||u===";"?(l(u),f++):(n+=u,s+=u,f++)}return o(),t},Go=(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),Cs(n.cssRules,t),Array.from(n.cssRules).map(s=>s.cssText).join(`
18
+ `)},jt=e=>{let t=En(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=zn(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(!wn.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 ce({...zn(Array.from(l.content.children),l.innerHTML),siblings:a,name:f})}),Object.keys(a).length&&(o.siblings=a),o},Vo=/^(?:text|application)\/(?:x-)?typescript$/i,Zo=e=>"lang"in e?`lang="${e.lang}"`:Vo.test(e.type?.trim()??"")?`type="${e.type}"`:null,zn=(e,t)=>{let n=[],s=[],r=[];e.forEach(o=>{let a={attrs:es(o),content:o.textContent??""};o.tagName==="SCRIPT"?n.push(a):o.tagName==="STYLE"?s.push(a):r.push(ns(o))}),n.forEach(o=>{let a=Zo(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=zo(o.content))});let i=o=>"scoped"in o.attrs&&!("lang"in o.attrs);if(s.some(i)){let o=qo(t);vs(r,o),s.forEach(a=>{i(a)&&(a.scoped=Go(a.content,o))})}return Ns(r),{template:r,scripts:n,styles:s}},zt=e=>/\.html?([?#]|$)/.test(e)?Ht(e):import(e),Qo=/^(?:\.\.?\/|\/|[a-z][a-z0-9+.-]*:)/i,Xo=(e,t)=>{if(!Qo.test(e))return e;try{return new URL(e,new URL(t??"",document.baseURI)).href}catch{return e}},Yo=(e,t)=>e?`
19
+ //# sourceURL=${e}?jq79-script=${t}`:"",Ps=(e,t,n)=>{try{return Ft(e,t,Yo(n.filename,n.index??0))}catch(s){throw s instanceof ve?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}},Gn=e=>e.scoped??e.content,_e=`:where([${ms}]) { display: contents }`,Gt=()=>Wt&&typeof Document<"u"&&"adoptedStyleSheets"in Document.prototype,tt=e=>{let t=new CSSStyleSheet;return t.replaceSync(e),t},Vt=(e,t)=>{e.adoptedStyleSheets.includes(t)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,t])},Lt=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(n=>n!==t)},Qe=null,Dt=null,Jo=()=>{if(Gt()){Vt(document,Dt??(Dt=tt(_e)));return}Qe?.isConnected||(Qe=document.createElement("style"),Qe.textContent=_e,document.head.appendChild(Qe))},nt=new Map,ei=e=>{let t=nt.get(e);if(!t){if(Gt()){let n=tt(e);Vt(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}}nt.set(e,t)}t.count++},ti=e=>{let t=nt.get(e);t&&--t.count<=0&&(t.sheet?Lt(document,t.sheet):t.el?.remove(),nt.delete(e))},ni=(e,t,n,s={},r=zt,i={})=>{let o={..._s,...s},a=new Proxy(t,{has:(u,h)=>h!=="$__effect"&&h!=="$__import"&&h!=="$__state"&&(Reflect.has(u,h)||!(h in globalThis)&&!(h in o))}),l={},f=Ps($n(Object.keys(o)),Rn(e),i)(a,n,r,l,...Object.values(o));return f.catch(u=>console.error("jq79: error in :setup script",u)),ls(f),{settled:f,sync:l.done===!0}},Vn=(e,t)=>{t?.forEach(({name:n,default:s})=>{e[n]===void 0&&(e[n]=s===void 0?void 0:_(s,e))})},It=e=>{let t=vn(e);return!t&&e.attrs[":setup"]!==void 0&&si(e,e.attrs[":setup"]),t},Zn=new WeakSet,si=(e,t)=>{t.trim()==="_"||Zn.has(e)||(Zn.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`))},ri=e=>{let t=null;return e.forEach(n=>{let s=Ae(n.content)??It(n);if(!s)return;let r=t??(t=new Set);s.forEach(({name:i})=>r.add(i))}),t},Qn=(e,t)=>{if(t===null)return e;let n={};return Object.keys(e).forEach(s=>{t.has(s)&&(n[s]=e[s])}),n},Xn=new WeakMap,oi=(e,t,n,s)=>{if(s===null)return;let r=Xn.get(e)??new Set;Xn.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`))})},ii=(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},Ms=Symbol("jq79.unfilledProps"),qt=Symbol("jq79.pendingScripts"),ai=e=>e&&e.default!==void 0?e.default:e,li=(e,t,n,s={},r=zt,i={})=>{let o={..._s,...s},a={},l=Ps(xn(Object.keys(o)),Nn(e),i)(a,ai,r,...Object.values(o)),f=I=>console.error("jq79: error in factory script",I),u=!1,h,w=()=>{if(u)return h;u=!0;let I=a.default;if(typeof I!="function")return;let G=j=>{j&&typeof j=="object"&&Object.assign(t,j)};try{let j=I(t,{$data:t,$props:t,$effect:n,...s});j instanceof Promise?h=j.then(G).catch(f):G(j)}catch(j){f(j)}return h},O=l.then(w,f);return ls(O),a.done&&w(),{settled:O,sync:a.done===!0&&h===void 0}},ci="__JQ79_HMR_ENABLED__",di="__JQ79_HMR__",we=null,ui=e=>{if(!we||!e.filename)return;let t=we.get(e.filename);t||we.set(e.filename,t=new Set),t.add(new WeakRef(e))},Yn=e=>{try{return new URL(e,document.baseURI).pathname}catch{return e}},As=(e,t)=>{if(!we)return 0;let n=Yn(e),s=jt(t),r=!1,i=a=>a.name===void 0?s:s.siblings?.[a.name]??null,o=0;for(let[a,l]of we)if(Yn(a)===n){for(let f of l){let u=f.deref();if(!u){l.delete(f);continue}let h=i(u);if(!h){r=!0;continue}u.hotReplace(h)&&o++}l.size||we.delete(a)}return r?0:o},ks=()=>{we??(we=new Map),globalThis[di]={update:As}},Jn=3e3,fi=(e,t)=>{let n=setTimeout(()=>{console.warn(`jq79: ${e.name?`<${e.name}>`:"a component"}${e.filename?` (${e.filename})`:""} has been waiting ${Jn/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.`)},Jn);n?.unref?.(),Promise.all(t).then(()=>clearTimeout(n))},Ht=async e=>{let[t]=await Promise.all([fetch(e).then(n=>{if(!n.ok)throw new Error(`failed to fetch component from ${e}: ${n.status}`);return n.text()}),Os?.then(()=>gi(e))]);return new ce(t,{filename:e})},Os,pi="/jq79-sw.js",hi=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")})},gi=e=>{let t=new URL(e,document.baseURI);return t.hash="",t.searchParams.set(Mn,""),new Promise((n,s)=>{let r=document.createElement("script"),i=ss();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)})},le=class le{constructor(t,n={}){A(this,"template");A(this,"scripts");A(this,"styles");A(this,"modules");A(this,"filename");A(this,"siblings");A(this,"name");A(this,"slots");A(this,"modelWriteback");A(this,"data",null);A(this,"fx",null);A(this,"content",null);A(this,"startMarker",null);A(this,"endMarker",null);A(this,"styleEls",[]);A(this,"shadowCss",null);A(this,"shadowSheets",[]);A(this,"sheetRoot",null);A(this,"ownsSharedStyles",!1);A(this,"useShadow",!1);A(this,"mountRoot",null);A(this,"resolveMounted",null);A(this,"renderDone",!1);A(this,"destroyHooks",null);A(this,"attachHooks",null);A(this,"detachHooks",null);A(this,"onPage",!1);A(this,"emitListeners",new Map);let s=typeof t=="string"?jt(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(),ui(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"?jt(t):t;Ut.clear(),Ee.clear(),_t.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=ae.scopedNames;for(let s in t){let r=t[s];Object.prototype.hasOwnProperty.call(ae,s)?typeof r=="boolean"?ae[s]=r:console.warn(`jq79: Component79.debug ignored "${s}" - the flags are booleans, and the ones it knows are: ${Object.keys(ae).join(", ")}`):console.warn(`jq79: Component79.debug does not know "${s}" - the flags it has are: ${Object.keys(ae).join(", ")}`)}ae.scopedNames!==n&&Ye.clear()}return{...ae}}static safeEval(t={}){Wt=!0;let n=[];if(t.nonce){let r=ss();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."))):kt=r}let s=t.worker??(t.nonce?!1:pi);return s!==!1&&n.push(Os??(Os=hi(s))),Promise.all(n).then(()=>{})}static fetch(t){if(Array.isArray(t))throw new TypeError("Component79.fetch takes one URL; use fetchAll for an array");return new st(Ht(t))}static fetchAll(t){return Promise.all(t.map(Ht))}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,It),r=ii(this.siblings,s),i=r?Object.assign(Object.create(r),t):{...t},o=new Set([...s].filter(E=>!(E in t)));o.size&&Object.defineProperty(i,Ms,{value:o}),this.slots&&Object.defineProperty(i,gs,{value:this.slots}),Object.defineProperty(i,qt,{value:{count:0}});let a=Re(i),l=ge(a);this.data=a,this.fx=l,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let f=this.startMarker,u=!1,h=(E,$)=>{E==="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(E,{detail:$,bubbles:!0,composed:!0,cancelable:!0});return f===this.startMarker&&this.emitListeners.get(E)?.forEach(Q=>Q(P,$)),P.cancelBubble||f.dispatchEvent(P),!P.defaultPrevented},w,O=new Promise(E=>{w=E});this.resolveMounted=w,this.renderDone=!1;let I=E=>{if(typeof E!="function")throw new TypeError("jq79: $destroyed expects a function");return f!==this.startMarker?(Ne(E,"$destroyed"),()=>{}):Mt(this.destroyHooks??(this.destroyHooks=[]),E)},G=(E,{immediate:$=!0}={})=>{if(typeof E!="function")throw new TypeError("jq79: $attached expects a function");if(f!==this.startMarker)return()=>{};this.watchPage();let P=Mt(this.attachHooks??(this.attachHooks=[]),E);return $&&this.onPage&&Ne(E,"$attached"),P},j=E=>{if(typeof E!="function")throw new TypeError("jq79: $detached expects a function");return f!==this.startMarker?(Ne(E,"$detached"),()=>{}):(this.watchPage(),Mt(this.detachHooks??(this.detachHooks=[]),E))},b=E=>{let $=We(E);return I(()=>$.$dispose()),$},q=this.endMarker,D=(E=>{let $=[];for(let P=f.nextSibling;P&&P!==q;P=P.nextSibling)P instanceof Element&&(P.matches(E)&&$.push(P),$.push(...Array.from(P.querySelectorAll(E))));return $}),L=(E=>D(E)[0]??null),B=this.modules,ie=E=>B&&E in B?Promise.resolve(B[E]):zt(Xo(E,this.filename)),C=Object.assign(Object.create(null),{$emit:h,$updateModel:(...E)=>{let[$,P]=E.length>1?E:[void 0,E[0]];return f!==this.startMarker?!1:this.modelWriteback?.($,P)??!1},$slots:Object.fromEntries(Object.keys(this.slots??{}).map(E=>[E,!0]))}),N=[],H=!0;this.scripts.forEach((E,$)=>{let P;N.push(new Promise(p=>{P=p}));let Q=!1,U=()=>{Q=!0,P()},F={$mounted:()=>(U(),O),$destroyed:I,$attached:G,$detached:j,$computed:b,$self:L,$$self:D,...C,...r},K={filename:this.filename,index:$},c=":mounted"in E.attrs,d=hn(E.content),g=(()=>{if(d!==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."),Vn(a,Ae(E.content));let y=c?xt(d):d;return li(y,a,R=>l.effect(R),F,ie,K)}let{vars:p,code:S}=ze(E.content);Vn(a,It(E)),p.forEach(y=>{y in a||(a[y]=void 0)});let m=c?xt(S):S;return ni(m,a,y=>l.effect(y),F,ie,K)})();if(g.sync)g.settled.then(U,U);else{let p=i[qt];p.count++;let S=()=>{p.count--,U()};g.settled.then(S,S)}!g.sync&&!Q&&(H=!1)});let J=document.createDocumentFragment(),V=new Proxy(a,{has:(E,$)=>typeof $=="string"&&$ in C||Reflect.has(E,$),get:(E,$,P)=>typeof $=="string"&&$ in C&&!Reflect.has(E,$)?C[$]:Reflect.get(E,$,P)});if(J.append(this.startMarker,this.endMarker),this.content=J,H?(this.endMarker.parentNode.insertBefore(Se(this.template,V,l,n),this.endMarker),this.renderDone=!0,this.settleMounted()):(Promise.all(N).then(()=>{f===this.startMarker&&(this.endMarker.parentNode.insertBefore(Se(this.template,V,l,n),this.endMarker),this.renderDone=!0,this.settleMounted(),le.settleAttached())}),fi(this,N)),n)if(Gt())this.shadowCss=[...this.styles.map(E=>E.content),_e];else{let E=document.createElement("style");E.textContent=_e,this.styleEls=[...this.styles.map($=>{let P=document.createElement("style");return P.textContent=$.content,P}),E]}else this.styles.forEach(E=>ei(Gn(E))),this.ownsSharedStyles=!0;return this}mount(t,n){let s=typeof t=="string"?be(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"?be(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(),le.settleAttached(),this}isOnPage(){return this.renderDone&&this.startMarker?.isConnected===!0}watchPage(){ue.has(this)||(ue.add(this),this.onPage=this.isOnPage(),this.onPage||le.queueSettle())}static queueSettle(){At||(At=!0,queueMicrotask(()=>{At=!1,le.settleAttached()}))}static settleAttached(){if(ue.size===0)return;let t=[...ue].filter(n=>!n.onPage&&n.isOnPage());le.inDocumentOrder(t).forEach(n=>{n.onPage||!ue.has(n)||(n.onPage=!0,n.attachHooks?.slice().forEach(s=>Ne(s,"$attached")))})}notifyDetached(){if(ue.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=le.inDocumentOrder([...ue].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=>Ne(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=>Lt(this.sheetRoot,s)),this.shadowSheets.length===0&&(this.shadowSheets=this.shadowCss.map(s=>s===_e?Dt??(Dt=tt(s)):tt(s))),this.shadowSheets.forEach(s=>Vt(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(){this.renderDone&&this.mountRoot&&this.resolveMounted?.()}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(),ue.delete(this),this.attachHooks=null,this.detachHooks=null,this.onPage=!1;let t=this.destroyHooks;return this.destroyHooks=null,t?.forEach(n=>Ne(n,"$destroyed")),this.detach(),this.fx?.dispose(),this.fx=null,this.data?.$dispose(),this.styleEls.forEach(n=>n.parentNode?.removeChild(n)),this.styleEls=[],this.sheetRoot&&this.shadowSheets.forEach(n=>{n!==Dt&&Lt(this.sheetRoot,n)}),this.shadowCss=null,this.shadowSheets=[],this.sheetRoot=null,this.ownsSharedStyles&&(this.styles.forEach(n=>ti(Gn(n))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.renderDone=!1,this.data=null,this.resolveMounted=null,this}};A(le,"version",Lr);var ce=le,st=class{constructor(t){A(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 mi=e=>new ce(e),Ne=(e,t)=>{try{e()}catch(n){console.error(`jq79: error in a ${t} hook`,n)}},Mt=(e,t)=>(e.push(t),()=>{let n=e.indexOf(t);n!==-1&&e.splice(n,1)}),ue=new Set,At=!1,_s={$:be,$$:De,$create:Ie,$reactive:Re,$toRaw:Z,Component79:ce};typeof globalThis<"u"&&globalThis[ci]&&ks();0&&(module.exports={$,$$,$computed,$create,$reactive,$toRaw,C79,Component79,PendingComponent79,enableHotReload,hotUpdate,parseComponent,renderComponent});
16
20
  //# sourceMappingURL=jq79.cjs.map