jq79 0.3.23 → 0.3.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- var jq79=(()=>{var j=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var $t=Object.getOwnPropertyNames;var wt=Object.prototype.hasOwnProperty;var Rt=(t,e,n)=>e in t?j(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var xt=(t,e)=>{for(var n in e)j(t,n,{get:e[n],enumerable:!0})},Tt=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of $t(e))!wt.call(t,r)&&r!==n&&j(t,r,{get:()=>e[r],enumerable:!(s=bt(e,r))||s.enumerable});return t};var Ct=t=>Tt(j({},"__esModule",{value:!0}),t);var w=(t,e,n)=>Rt(t,typeof e!="symbol"?e+"":e,n);var oe={};xt(oe,{$:()=>v,$$:()=>M,$create:()=>D,$reactive:()=>O,Component79:()=>L,parseComponent:()=>re,renderComponent:()=>Ht});function v(t,e){return typeof t=="string"?document.querySelector(t):t.querySelector(e)}function M(t,e){return Array.from(typeof t=="string"?document.querySelectorAll(t):t.querySelectorAll(e))}var D=(t,e={})=>{let n=document.createElement(t);for(let[s,r]of Object.entries(e))if(s==="className")n.className=Array.isArray(r)?r.join(" "):r;else if(s==="textContent")n.textContent=r;else if(s==="children")for(let o of r)n.appendChild(o);else n.setAttribute(s,r);return n},Nt=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),Z={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},Lt=new Set(["http:","https:","mailto:"]);function vt(t){try{let e=new URL(t,"https://example.com");return Lt.has(e.protocol)}catch{return!1}}function X(t,e){for(let n of Array.from(t.childNodes))if(n.nodeType===Node.ELEMENT_NODE){let s=_t(n);s&&e.appendChild(s)}else n.nodeType===Node.TEXT_NODE&&e.appendChild(n.cloneNode())}function _t(t){let e=t.tagName.toLowerCase();if(!Nt.has(e))return null;let n=document.createElement(e);for(let s of Array.from(t.attributes)){let r=s.name.toLowerCase(),o=Z[e]?.has(r),i=Z["*"]?.has(r);!o&&!i||(r==="href"||r==="src")&&!vt(s.value)||n.setAttribute(r,s.value)}return e==="a"&&n.setAttribute("rel","noopener noreferrer"),X(t,n),n}function J(t){let e=new DOMParser().parseFromString(t,"text/html"),n=document.createElement("div");return X(e.body,n),n.innerHTML}var At=(t,e)=>e.split(".").reduce((n,s)=>n?.[s],t),Y=t=>{if(Array.isArray(t))return!0;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null},Q=(t,e,n)=>{Object.entries(t).forEach(([s,r])=>{let o=e?`${e}.${s}`:s;r&&typeof r=="object"&&Y(r)?Q(r,o,n):n(o,r)})},Ot=(t,e)=>t===e||t.startsWith(`${e}.`)||e.startsWith(`${t}.`),q=Symbol("jq79.raw"),I=t=>{let e=t;for(;e!==null&&typeof e=="object"&&e[q];)e=e[q];return e},tt=Symbol("jq79.store"),W=t=>t!==null&&typeof t=="object"&&t[tt]===!0,_=[],et=t=>{_.push(new Set);try{return t()}finally{_.pop()}},O=t=>{let e=new Map,n=new Set,s=new Set,r=new WeakMap,o=Object.create(null),i=(u,d,b=!1)=>{e.get(u)?.forEach(S=>S(d,u)),n.forEach(S=>S(u,d)),s.forEach(S=>{(b||Array.from(S.deps).some(f=>Ot(f,u)))&&S.run()})},c=u=>u!==null&&typeof u=="object"&&Y(u),l=(u,d)=>{let b=r.get(u);if(b)return b;let S=new Proxy(u,{get(f,m,E){if(m===q)return f;if(m===tt)return d==="";if(typeof m!="string")return Reflect.get(f,m,E);if(d===""&&m in o)return o[m];let g=d?`${d}.${m}`:m;_[_.length-1]?.add(g);let R=Reflect.get(f,m,E);if(W(R))return R;let $=I(R);return c($)?l($,g):$},set(f,m,E,g){if(g!==S&&!Object.prototype.hasOwnProperty.call(f,m))return Reflect.set(f,m,E,g);let R=d?`${d}.${m}`:m,$=W(E)?E:I(E),C=!Object.prototype.hasOwnProperty.call(f,m);f[m]=$;let T=W($)||!c($)?$:l($,R);return i(R,T,C),!0}});return r.set(u,S),S},h=l(I(t),""),a=(u,d,{immediate:b=!1}={})=>(e.has(u)||e.set(u,new Set),e.get(u).add(d),b&&d(At(h,u),u),()=>e.get(u)?.delete(d)),p=(u,{immediate:d=!1}={})=>(n.add(u),d&&Q(h,"",(b,S)=>u(b,S)),()=>n.delete(u)),y=u=>{let d={deps:new Set,run:()=>{let b=new Set;_.push(b);try{u()}finally{_.pop(),d.deps=b}}};return s.add(d),d.run(),()=>{s.delete(d)}};return o.$on=a,o.$onAny=p,o.$effect=y,h},A=t=>{let e=[];return{effect:n=>{e.push(t.$effect(n))},onDispose:n=>{e.push(n)},dispose:()=>{e.splice(0).forEach(n=>n())}}};var nt=/(?:let|var|const)\s+([A-Za-z_$][\w$]*)/y,st=/\$:\s*/y,k=/import(?=\s*\()/y,rt=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,U=(t,e)=>{let n=t[e],s=e+1;for(;s<t.length;){if(t[s]==="\\"){s+=2;continue}if(t[s]===n)return s+1;s++}return t.length},P=(t,e)=>{let n=t.indexOf(`
1
+ var jq79=(()=>{var j=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var $t=Object.getOwnPropertyNames;var wt=Object.prototype.hasOwnProperty;var Rt=(t,e,n)=>e in t?j(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var xt=(t,e)=>{for(var n in e)j(t,n,{get:e[n],enumerable:!0})},Tt=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of $t(e))!wt.call(t,r)&&r!==n&&j(t,r,{get:()=>e[r],enumerable:!(s=bt(e,r))||s.enumerable});return t};var Ct=t=>Tt(j({},"__esModule",{value:!0}),t);var w=(t,e,n)=>Rt(t,typeof e!="symbol"?e+"":e,n);var oe={};xt(oe,{$:()=>N,$$:()=>M,$create:()=>D,$reactive:()=>O,Component79:()=>v,parseComponent:()=>re,renderComponent:()=>Ht});function N(t,e){return typeof t=="string"?document.querySelector(t):t.querySelector(e)}function M(t,e){return Array.from(typeof t=="string"?document.querySelectorAll(t):t.querySelectorAll(e))}var D=(t,e={})=>{let n=document.createElement(t);for(let[s,r]of Object.entries(e))if(s==="className")n.className=Array.isArray(r)?r.join(" "):r;else if(s==="textContent")n.textContent=r;else if(s==="children")for(let o of r)n.appendChild(o);else n.setAttribute(s,r);return n},Lt=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),Z={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},vt=new Set(["http:","https:","mailto:"]);function Nt(t){try{let e=new URL(t,"https://example.com");return vt.has(e.protocol)}catch{return!1}}function X(t,e){for(let n of Array.from(t.childNodes))if(n.nodeType===Node.ELEMENT_NODE){let s=_t(n);s&&e.appendChild(s)}else n.nodeType===Node.TEXT_NODE&&e.appendChild(n.cloneNode())}function _t(t){let e=t.tagName.toLowerCase();if(!Lt.has(e))return null;let n=document.createElement(e);for(let s of Array.from(t.attributes)){let r=s.name.toLowerCase(),o=Z[e]?.has(r),i=Z["*"]?.has(r);!o&&!i||(r==="href"||r==="src")&&!Nt(s.value)||n.setAttribute(r,s.value)}return e==="a"&&n.setAttribute("rel","noopener noreferrer"),X(t,n),n}function J(t){let e=new DOMParser().parseFromString(t,"text/html"),n=document.createElement("div");return X(e.body,n),n.innerHTML}var At=(t,e)=>e.split(".").reduce((n,s)=>n?.[s],t),Y=t=>{if(Array.isArray(t))return!0;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null},Q=(t,e,n)=>{Object.entries(t).forEach(([s,r])=>{let o=e?`${e}.${s}`:s;r&&typeof r=="object"&&Y(r)?Q(r,o,n):n(o,r)})},Ot=(t,e)=>t===e||t.startsWith(`${e}.`)||e.startsWith(`${t}.`),q=Symbol("jq79.raw"),I=t=>{let e=t;for(;e!==null&&typeof e=="object"&&e[q];)e=e[q];return e},tt=Symbol("jq79.store"),W=t=>t!==null&&typeof t=="object"&&t[tt]===!0,_=[],et=t=>{_.push(new Set);try{return t()}finally{_.pop()}},O=t=>{let e=new Map,n=new Set,s=new Set,r=new WeakMap,o=Object.create(null),i=(f,h,b=!1)=>{e.get(f)?.forEach(S=>S(h,f)),n.forEach(S=>S(f,h)),s.forEach(S=>{(b||Array.from(S.deps).some(d=>Ot(d,f)))&&S.run()})},c=f=>f!==null&&typeof f=="object"&&Y(f),l=(f,h)=>{let b=r.get(f);if(b)return b;let S=new Proxy(f,{get(d,m,E){if(m===q)return d;if(m===tt)return h==="";if(typeof m!="string")return Reflect.get(d,m,E);if(h===""&&m in o)return o[m];let g=h?`${h}.${m}`:m;_[_.length-1]?.add(g);let R=Reflect.get(d,m,E);if(W(R))return R;let $=I(R);return c($)?l($,g):$},set(d,m,E,g){if(g!==S&&!Object.prototype.hasOwnProperty.call(d,m))return Reflect.set(d,m,E,g);let R=h?`${h}.${m}`:m,$=W(E)?E:I(E),C=!Object.prototype.hasOwnProperty.call(d,m);d[m]=$;let T=W($)||!c($)?$:l($,R);return i(R,T,C),!0}});return r.set(f,S),S},p=l(I(t),""),a=(f,h,{immediate:b=!1}={})=>(e.has(f)||e.set(f,new Set),e.get(f).add(h),b&&h(At(p,f),f),()=>e.get(f)?.delete(h)),u=(f,{immediate:h=!1}={})=>(n.add(f),h&&Q(p,"",(b,S)=>f(b,S)),()=>n.delete(f)),y=f=>{let h={deps:new Set,run:()=>{let b=new Set;_.push(b);try{f()}finally{_.pop(),h.deps=b}}};return s.add(h),h.run(),()=>{s.delete(h)}};return o.$on=a,o.$onAny=u,o.$effect=y,p},A=t=>{let e=[];return{effect:n=>{e.push(t.$effect(n))},onDispose:n=>{e.push(n)},dispose:()=>{e.splice(0).forEach(n=>n())}}};var nt=/(?:let|var|const)\s+([A-Za-z_$][\w$]*)/y,st=/\$:\s*/y,k=/import(?=\s*\()/y,rt=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,U=(t,e)=>{let n=t[e],s=e+1;for(;s<t.length;){if(t[s]==="\\"){s+=2;continue}if(t[s]===n)return s+1;s++}return t.length},P=(t,e)=>{let n=t.indexOf(`
2
2
  `,e);return n===-1?t.length:n},F=(t,e)=>{let n=t.indexOf("*/",e+2);return n===-1?t.length:n+2},jt=(t,e)=>{let n=e;for(;n<t.length;){if(/\s/.test(t[n])){n++;continue}if(t[n]==="/"&&t[n+1]==="/"){n=P(t,n);continue}if(t[n]==="/"&&t[n+1]==="*"){n=F(t,n);continue}break}return n},Mt=/^(\?\.|\?\?|&&|\|\||\*\*|[.,+\-*/%&|^<>=?:([])/,Dt=(t,e)=>{let n=0,s=e;for(;s<t.length;){let r=t[s];if(r==="'"||r==='"'||r==="`"){s=U(t,s);continue}if(r==="/"&&t[s+1]==="/"){s=P(t,s);continue}if(r==="/"&&t[s+1]==="*"){s=F(t,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else{if(n<=0&&r===";")return s;if(n<=0&&r===`
3
- `){let o=jt(t,s+1);if(o>=t.length||!Mt.test(t.slice(o,o+2)))return s;s=o;continue}}s++}return t.length},ct=t=>{let e=[],n="",s=0,r=0,o=!0;for(;s<t.length;){let i=t[s],c=t[s+1];if(i==="'"||i==='"'||i==="`"){let l=U(t,s);n+=t.slice(s,l),s=l,o=!1;continue}if(i==="/"&&(c==="/"||c==="*")){let l=c==="/"?P(t,s):F(t,s);n+=t.slice(s,l),s=l;continue}if(i==="i"&&(s===0||!/[\w$.]/.test(t[s-1]))&&(k.lastIndex=s,k.test(t))){n+="$__import",s+=6,o=!1;continue}if(r===0&&o){nt.lastIndex=s;let l=nt.exec(t);if(l){e.push(l[1]),n+=l[1],s+=l[0].length,o=!1;continue}st.lastIndex=s;let h=st.exec(t);if(h){rt.lastIndex=s;let a=rt.exec(t);a&&e.push(a[1]);let p=s+h[0].length,y=Dt(t,p);n+=`$__effect(() => { ${t.slice(p,y)} });`,s=y;continue}}"([{".includes(i)?r++:")]}".includes(i)&&(r=Math.max(0,r-1)),i===`
4
- `||i===";"||i==="}"?o=!0:/\s/.test(i)||(o=!1),n+=i,s++}return{vars:e,code:n}},ot=/export\s+default(?![\w$])/y,it=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,kt=t=>{let e=[],n=0,s=0;for(let r=0;r<=t.length;r++){let o=t[r];if(o==="{")n++;else if(o==="}")n--;else if(r===t.length||o===","&&n===0){let i=t.slice(s,r).trim();i&&e.push(i),s=r+1}}return e},Pt=(t,e,n)=>{let s=`await $__import(${JSON.stringify(e)})`;if(t===void 0)return s;let r=kt(t),o=[],i=s;if(r.length>1){let c=`$__mod${n}`;o.push(`${c} = ${s}`),i=c}for(let c of r)c.startsWith("{")?o.push(`${c.replace(/\s+as\s+/g,": ")} = ${i}`):c.startsWith("*")?o.push(`${c.replace(/^\*\s*as\s+/,"")} = ${i}`):o.push(`${c} = $__default(${i})`);return`const ${o.join(", ")}`},at=t=>{let e="",n=0,s=0,r=!0,o=!1,i=0;for(;n<t.length;){let c=t[n],l=t[n+1],h=n===0||!/[\w$.]/.test(t[n-1]);if(c==="'"||c==='"'||c==="`"){let a=U(t,n);e+=t.slice(n,a),n=a,r=!1;continue}if(c==="/"&&(l==="/"||l==="*")){let a=l==="/"?P(t,n):F(t,n);e+=t.slice(n,a),n=a;continue}if(c==="i"&&h){if(k.lastIndex=n,k.test(t)){e+="$__import",n+=6,r=!1;continue}if(s===0&&r){it.lastIndex=n;let a=it.exec(t);if(a){e+=Pt(a[1],a[3],i++),n+=a[0].length,r=!1;continue}}}if(c==="e"&&h&&s===0&&r){ot.lastIndex=n;let a=ot.exec(t);if(a){o=!0,e+="$__exports.default =",n+=a[0].length,r=!1;continue}}"([{".includes(c)?s++:")]}".includes(c)&&(s=Math.max(0,s-1)),c===`
5
- `||c===";"||c==="}"?r=!0:/\s/.test(c)||(r=!1),e+=c,n++}return o?e:null};var pt=t=>Object.fromEntries(Array.from(t.attributes).map(e=>[e.name,e.value])),ht=t=>({tag:t.tagName.toLowerCase(),attrs:pt(t),children:Array.from(t.childNodes).flatMap(e=>{if(e.nodeType===Node.TEXT_NODE){let n=e.textContent?.trim()??"";return n?[n]:[]}return e.nodeType===Node.ELEMENT_NODE?[ht(e)]:[]})}),x=(t,e,n)=>{try{return new Function("$scope",...Object.keys(n??{}),`with ($scope) { return (${t}); }`)(e,...Object.values(n??{}))}catch{return}},Ft=(t,e)=>t.replace(/{{\s*([\s\S]+?)\s*}}/g,(n,s)=>x(s,e)??""),mt=new Set([":attrs",":if",":elseif",":else",":each",":key",":with",":text",":html"]),Bt=/^\s*(\w+)\s+in\s+([\s\S]+)$/,It=(t,e,n,s)=>{let[r,...o]=e.slice(1).split("."),i=new Set(o);t.addEventListener(r,c=>{if(i.has("self")&&c.target!==t)return;i.has("prevent")&&c.preventDefault(),i.has("stop")&&c.stopPropagation();let l=x(n,s,{$event:c});typeof l=="function"&&l.call(t,c)},{once:i.has("once"),capture:i.has("capture")})},lt=t=>t.replace(/-(\w)/g,(e,n)=>n.toUpperCase()),ft=(t,e)=>{let n=e.replace(/-/g,"").toLowerCase();for(let s=t;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},ut=(t,e,n,s)=>{let r=document.createComment(t),o=document.createDocumentFragment();o.appendChild(r);let i={};Object.entries(e.attrs).forEach(([a,p])=>{if(!(a===K||mt.has(a)||a.startsWith("@")))if(a.startsWith(":")){let y=lt(a.slice(1));i[y]=p||y}else i[lt(a)]=JSON.stringify(p)});let c=null,l=null,h=null;return s.effect(()=>{let a=x(t,n),p=a instanceof L?a:null;if(p===l||(h?.dispose(),h=null,c?.destroy(),c=null,l=p,!p))return;let y=new L({template:p.template,scripts:p.scripts,styles:p.styles,modules:p.modules,filename:p.filename}),u=et(()=>Object.fromEntries(Object.entries(i).map(([S,f])=>[S,x(f,n)]))),d=document.createDocumentFragment();y.render(u).mount(d),r.parentNode.insertBefore(d,r.nextSibling);let b=A(n);Object.entries(i).forEach(([S,f])=>{b.effect(()=>{y.data[S]=x(f,n)})}),h=b,c=y}),s.onDispose(()=>{h?.dispose(),c?.destroy()}),o},Wt=(t,e)=>{let n=()=>{let s=x(t,e);return s!==null&&typeof s=="object"?s:null};return new Proxy(e,{has(s,r){let o=n();return o!==null&&Reflect.has(o,r)||Reflect.has(s,r)},get(s,r){let o=n();return o!==null&&Reflect.has(o,r)?o[r]:Reflect.get(s,r)},set(s,r,o){let i=n();return i!==null&&Reflect.has(i,r)?(i[r]=o,!0):Reflect.set(s,r,o)}})},z=(t,e,n)=>{let s=t.attrs[":with"],r=s!==void 0?Wt(s,e):e,o=ft(r,t.tag);if(o)return ut(o,t,r,n);let i=document.createElement(t.tag);if(i instanceof HTMLUnknownElement||t.tag.includes("-")){let a=!1;n.effect(()=>{if(a)return;let p=ft(r,t.tag);p&&(a=!0,i.replaceWith(ut(p,t,r,n)))})}Object.entries(t.attrs).forEach(([a,p])=>{a.startsWith("@")?It(i,a,p,r):mt.has(a)||i.setAttribute(a,p)});let c=t.attrs[":attrs"];if(c!==void 0){let a=[];n.effect(()=>{a.forEach(y=>i.removeAttribute(y));let p=x(c,r);a=p&&typeof p=="object"?Object.keys(p):[],a.forEach(y=>{let u=p[y];u!=null&&u!==!1&&i.setAttribute(y,String(u))})})}let l=t.attrs[":text"],h=t.attrs[":html"];return l!==void 0?n.effect(()=>{i.textContent=String(x(l,r)??"")}):h!==void 0?n.effect(()=>{i.innerHTML=J(String(x(h,r)??""))}):i.appendChild(G(t.children,r,n)),i},qt=(t,e,n)=>{let s=document.createComment("if"),r=document.createDocumentFragment();r.appendChild(s);let o=null,i=null,c=null;return n.effect(()=>{let l=t.find(h=>h.expr===void 0||x(h.expr,e))??null;l!==i&&(c?.dispose(),o&&o.parentNode?.removeChild(o),o=null,i=l,l&&(c=A(e),o=z(l.node,e,c),s.parentNode.insertBefore(o,s.nextSibling)))}),r},H=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})},Ut=(t,e,n)=>{let s=t.attrs[":each"].match(Bt);if(!s)return document.createComment(`invalid :each expression "${t.attrs[":each"]}"`);let[,r,o]=s,i=t.attrs[":key"],{[":each"]:c,[":key"]:l,...h}=t.attrs,a={...t,attrs:h},p=document.createComment("each"),y=document.createDocumentFragment();y.appendChild(p);let u=[];return n.effect(()=>{let d=x(o,e),b=Array.isArray(d)?d:[],S=new Map(u.map(g=>[g.key,g])),f=b.map((g,R)=>{let $=Object.create(e);H($,r,g),H($,"$index",R);let C=i!==void 0?x(i,$):R,T=S.get(C);if(T&&Object.is(T.item,g))return H(T.scope,"$index",R),T;T?.fx.dispose(),T?.node.parentNode?.removeChild(T.node);let N=A(e);return{key:C,item:g,scope:$,fx:N,node:z(a,$,N)}}),m=new Set(f.map(g=>g.key));u.forEach(g=>{m.has(g.key)||(g.fx.dispose(),g.node.parentNode?.removeChild(g.node))});let E=p;f.forEach(g=>{E.nextSibling!==g.node&&p.parentNode.insertBefore(g.node,E.nextSibling),E=g.node}),u=f}),y},G=(t,e,n)=>{let s=document.createDocumentFragment(),r=0;for(;r<t.length;){let o=t[r];if(typeof o=="string"){let i=document.createTextNode("");n.effect(()=>{i.textContent=Ft(o,e)}),s.appendChild(i),r++;continue}if(":each"in o.attrs){s.appendChild(Ut(o,e,n)),r++;continue}if(":if"in o.attrs){let i=[{expr:o.attrs[":if"],node:o}];for(r++;r<t.length&&typeof t[r]!="string"&&":elseif"in t[r].attrs;){let c=t[r];i.push({expr:c.attrs[":elseif"],node:c}),r++}r<t.length&&typeof t[r]!="string"&&":else"in t[r].attrs&&(i.push({node:t[r]}),r++),s.appendChild(qt(i,e,n));continue}s.appendChild(z(o,e,n)),r++}return s},Ht=(t,e)=>G(t.template,e,A(e)),zt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Gt=/<([A-Za-z][\w-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,Kt=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,Vt=t=>t.split(Kt).map((e,n)=>n%2===1?e:e.replace(Gt,(s,r,o)=>zt.has(r.toLowerCase())?s:`<${r}${o}></${r}>`)).join(""),K="data-jq79",Zt=t=>{let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return(e>>>0).toString(36)},gt=(t,e)=>{t.forEach(n=>{typeof n!="string"&&(n.attrs[K]=e,gt(n.children,e))})},Xt=(t,e)=>t.split(",").map(n=>{let s=n.trim(),r=s.indexOf("::"),o=r===-1?s:s.slice(0,r),i=r===-1?"":s.slice(r);return`${o}[${K}="${e}"]${i}`}).join(", "),yt=(t,e)=>{Array.from(t).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=Xt(n.selectorText,e):n instanceof CSSGroupingRule&&yt(n.cssRules,e)})},Jt=(t,e)=>{/:deep\(|::v-deep|>>>/.test(t)&&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(t),yt(n.cssRules,e),Array.from(n.cssRules).map(s=>s.cssText).join(`
6
- `)},Yt=t=>{let n=new DOMParser().parseFromString(`<template>${Vt(t)}</template>`,"text/html").querySelector("template"),s=[],r=[],o=[];Array.from(n.content.children).forEach(c=>{let l={attrs:pt(c),content:c.textContent??""};c.tagName==="SCRIPT"?s.push(l):c.tagName==="STYLE"?r.push(l):o.push(ht(c))}),r.forEach(c=>{"lang"in c.attrs&&console.warn(`jq79: <style lang="${c.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.`)});let i=c=>"scoped"in c.attrs&&!("lang"in c.attrs);if(r.some(i)){let c=Zt(t);gt(o,c),r.forEach(l=>{i(l)&&(l.scoped=Jt(l.content,c))})}return{template:o,scripts:s,styles:r}},V=t=>/\.html?([?#]|$)/.test(t)?L.fetch(t):import(t),Et=(t,e)=>t?`
7
- //# sourceURL=${t}?jq79-script=${e}`:"",dt=t=>t.scoped??t.content,B=new Map,Qt=t=>{let e=B.get(t);if(!e){let n=document.createElement("style");n.textContent=t,document.head.appendChild(n),e={el:n,count:0},B.set(t,e)}e.count++},te=t=>{let e=B.get(t);e&&--e.count<=0&&(e.el.remove(),B.delete(t))},St={$:v,$$:M,$create:D,$reactive:O},ee=(t,e,n,s={},r=V,o={})=>{let i={...St,...s},c=new Proxy(e,{has:(h,a)=>a!=="$__effect"&&a!=="$__import"&&(Reflect.has(h,a)||!(a in globalThis)&&!(a in i))});new Function("$scope","$__effect","$__import",...Object.keys(i),`return (async () => { with ($scope) { ${t} } })()${Et(o.filename,o.index??0)}`)(c,n,r,...Object.values(i)).catch(h=>console.error("jq79: error in :setup script",h))},ne=t=>t&&t.default!==void 0?t.default:t,se=(t,e,n,s={},r=V,o={})=>{let i={...St,...s},c={},l=new Function("$__exports","$__default","$__import",...Object.keys(i),`return (async () => { "use strict";
3
+ `){let o=jt(t,s+1);if(o>=t.length||!Mt.test(t.slice(o,o+2)))return s;s=o;continue}}s++}return t.length},ct=t=>{let e=[],n="",s=0,r=0,o=!0;for(;s<t.length;){let i=t[s],c=t[s+1];if(i==="'"||i==='"'||i==="`"){let l=U(t,s);n+=t.slice(s,l),s=l,o=!1;continue}if(i==="/"&&(c==="/"||c==="*")){let l=c==="/"?P(t,s):F(t,s);n+=t.slice(s,l),s=l;continue}if(i==="i"&&(s===0||!/[\w$.]/.test(t[s-1]))&&(k.lastIndex=s,k.test(t))){n+="$__import",s+=6,o=!1;continue}if(r===0&&o){nt.lastIndex=s;let l=nt.exec(t);if(l){e.push(l[1]),n+=l[1],s+=l[0].length,o=!1;continue}st.lastIndex=s;let p=st.exec(t);if(p){rt.lastIndex=s;let a=rt.exec(t);a&&e.push(a[1]);let u=s+p[0].length,y=Dt(t,u);n+=`$__effect(() => { ${t.slice(u,y)} });`,s=y;continue}}"([{".includes(i)?r++:")]}".includes(i)&&(r=Math.max(0,r-1)),i===`
4
+ `||i===";"||i==="}"?o=!0:/\s/.test(i)||(o=!1),n+=i,s++}return{vars:e,code:n}},ot=/export\s+default(?![\w$])/y,it=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,kt=t=>{let e=[],n=0,s=0;for(let r=0;r<=t.length;r++){let o=t[r];if(o==="{")n++;else if(o==="}")n--;else if(r===t.length||o===","&&n===0){let i=t.slice(s,r).trim();i&&e.push(i),s=r+1}}return e},Pt=(t,e,n)=>{let s=`await $__import(${JSON.stringify(e)})`;if(t===void 0)return s;let r=kt(t),o=[],i=s;if(r.length>1){let c=`$__mod${n}`;o.push(`${c} = ${s}`),i=c}for(let c of r)c.startsWith("{")?o.push(`${c.replace(/\s+as\s+/g,": ")} = ${i}`):c.startsWith("*")?o.push(`${c.replace(/^\*\s*as\s+/,"")} = ${i}`):o.push(`${c} = $__default(${i})`);return`const ${o.join(", ")}`},at=t=>{let e="",n=0,s=0,r=!0,o=!1,i=0;for(;n<t.length;){let c=t[n],l=t[n+1],p=n===0||!/[\w$.]/.test(t[n-1]);if(c==="'"||c==='"'||c==="`"){let a=U(t,n);e+=t.slice(n,a),n=a,r=!1;continue}if(c==="/"&&(l==="/"||l==="*")){let a=l==="/"?P(t,n):F(t,n);e+=t.slice(n,a),n=a;continue}if(c==="i"&&p){if(k.lastIndex=n,k.test(t)){e+="$__import",n+=6,r=!1;continue}if(s===0&&r){it.lastIndex=n;let a=it.exec(t);if(a){e+=Pt(a[1],a[3],i++),n+=a[0].length,r=!1;continue}}}if(c==="e"&&p&&s===0&&r){ot.lastIndex=n;let a=ot.exec(t);if(a){o=!0,e+="$__exports.default =",n+=a[0].length,r=!1;continue}}"([{".includes(c)?s++:")]}".includes(c)&&(s=Math.max(0,s-1)),c===`
5
+ `||c===";"||c==="}"?r=!0:/\s/.test(c)||(r=!1),e+=c,n++}return o?e:null};var pt=t=>Object.fromEntries(Array.from(t.attributes).map(e=>[e.name,e.value])),ht=t=>({tag:t.tagName.toLowerCase(),attrs:pt(t),children:Array.from(t.childNodes).flatMap(e=>{if(e.nodeType===Node.TEXT_NODE){let n=e.textContent??"";return n?[n]:[]}return e.nodeType===Node.ELEMENT_NODE?[ht(e)]:[]})}),x=(t,e,n)=>{try{return new Function("$scope",...Object.keys(n??{}),`with ($scope) { return (${t}); }`)(e,...Object.values(n??{}))}catch{return}},Ft=(t,e)=>t.replace(/{{\s*([\s\S]+?)\s*}}/g,(n,s)=>x(s,e)??""),mt=new Set([":attrs",":if",":elseif",":else",":each",":key",":with",":text",":html"]),Bt=/^\s*(\w+)\s+in\s+([\s\S]+)$/,It=(t,e,n,s)=>{let[r,...o]=e.slice(1).split("."),i=new Set(o);t.addEventListener(r,c=>{if(i.has("self")&&c.target!==t)return;i.has("prevent")&&c.preventDefault(),i.has("stop")&&c.stopPropagation();let l=x(n,s,{$event:c});typeof l=="function"&&l.call(t,c)},{once:i.has("once"),capture:i.has("capture")})},lt=t=>t.replace(/-(\w)/g,(e,n)=>n.toUpperCase()),dt=(t,e)=>{let n=e.replace(/-/g,"").toLowerCase();for(let s=t;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},ft=(t,e,n,s)=>{let r=document.createComment(t),o=document.createDocumentFragment();o.appendChild(r);let i={};Object.entries(e.attrs).forEach(([a,u])=>{if(!(a===K||mt.has(a)||a.startsWith("@")))if(a.startsWith(":")){let y=lt(a.slice(1));i[y]=u||y}else i[lt(a)]=JSON.stringify(u)});let c=null,l=null,p=null;return s.effect(()=>{let a=x(t,n),u=a instanceof v?a:null;if(u===l||(p?.dispose(),p=null,c?.destroy(),c=null,l=u,!u))return;let y=new v({template:u.template,scripts:u.scripts,styles:u.styles,modules:u.modules,filename:u.filename}),f=et(()=>Object.fromEntries(Object.entries(i).map(([S,d])=>[S,x(d,n)]))),h=document.createDocumentFragment();y.render(f).mount(h),r.parentNode.insertBefore(h,r.nextSibling);let b=A(n);Object.entries(i).forEach(([S,d])=>{b.effect(()=>{y.data[S]=x(d,n)})}),p=b,c=y}),s.onDispose(()=>{p?.dispose(),c?.destroy()}),o},Wt=(t,e)=>{let n=()=>{let s=x(t,e);return s!==null&&typeof s=="object"?s:null};return new Proxy(e,{has(s,r){let o=n();return o!==null&&Reflect.has(o,r)||Reflect.has(s,r)},get(s,r){let o=n();return o!==null&&Reflect.has(o,r)?o[r]:Reflect.get(s,r)},set(s,r,o){let i=n();return i!==null&&Reflect.has(i,r)?(i[r]=o,!0):Reflect.set(s,r,o)}})},z=(t,e,n)=>{let s=t.attrs[":with"],r=s!==void 0?Wt(s,e):e,o=dt(r,t.tag);if(o)return ft(o,t,r,n);let i=document.createElement(t.tag);if(i instanceof HTMLUnknownElement||t.tag.includes("-")){let a=!1;n.effect(()=>{if(a)return;let u=dt(r,t.tag);u&&(a=!0,i.replaceWith(ft(u,t,r,n)))})}Object.entries(t.attrs).forEach(([a,u])=>{a.startsWith("@")?It(i,a,u,r):mt.has(a)||i.setAttribute(a,u)});let c=t.attrs[":attrs"];if(c!==void 0){let a=[];n.effect(()=>{a.forEach(y=>i.removeAttribute(y));let u=x(c,r);a=u&&typeof u=="object"?Object.keys(u):[],a.forEach(y=>{let f=u[y];f!=null&&f!==!1&&i.setAttribute(y,String(f))})})}let l=t.attrs[":text"],p=t.attrs[":html"];return l!==void 0?n.effect(()=>{i.textContent=String(x(l,r)??"")}):p!==void 0?n.effect(()=>{i.innerHTML=J(String(x(p,r)??""))}):i.appendChild(G(t.children,r,n)),i},qt=(t,e,n)=>{let s=document.createComment("if"),r=document.createDocumentFragment();r.appendChild(s);let o=null,i=null,c=null;return n.effect(()=>{let l=t.find(p=>p.expr===void 0||x(p.expr,e))??null;l!==i&&(c?.dispose(),o&&o.parentNode?.removeChild(o),o=null,i=l,l&&(c=A(e),o=z(l.node,e,c),s.parentNode.insertBefore(o,s.nextSibling)))}),r},H=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})},Ut=(t,e,n)=>{let s=t.attrs[":each"].match(Bt);if(!s)return document.createComment(`invalid :each expression "${t.attrs[":each"]}"`);let[,r,o]=s,i=t.attrs[":key"],{[":each"]:c,[":key"]:l,...p}=t.attrs,a={...t,attrs:p},u=document.createComment("each"),y=document.createDocumentFragment();y.appendChild(u);let f=[];return n.effect(()=>{let h=x(o,e),b=Array.isArray(h)?h:[],S=new Map(f.map(g=>[g.key,g])),d=b.map((g,R)=>{let $=Object.create(e);H($,r,g),H($,"$index",R);let C=i!==void 0?x(i,$):R,T=S.get(C);if(T&&Object.is(T.item,g))return H(T.scope,"$index",R),T;T?.fx.dispose(),T?.node.parentNode?.removeChild(T.node);let L=A(e);return{key:C,item:g,scope:$,fx:L,node:z(a,$,L)}}),m=new Set(d.map(g=>g.key));f.forEach(g=>{m.has(g.key)||(g.fx.dispose(),g.node.parentNode?.removeChild(g.node))});let E=u;d.forEach(g=>{E.nextSibling!==g.node&&u.parentNode.insertBefore(g.node,E.nextSibling),E=g.node}),f=d}),y},G=(t,e,n)=>{let s=document.createDocumentFragment(),r=0;for(;r<t.length;){let o=t[r];if(typeof o=="string"){let i=document.createTextNode(o);o.includes("{{")&&n.effect(()=>{i.textContent=Ft(o,e)}),s.appendChild(i),r++;continue}if(":each"in o.attrs){s.appendChild(Ut(o,e,n)),r++;continue}if(":if"in o.attrs){let i=[{expr:o.attrs[":if"],node:o}];r++;let c=p=>{let a=r;for(;a<t.length&&typeof t[a]=="string"&&!t[a].trim();)a++;let u=t[a];if(typeof u=="object"&&p in u.attrs)return r=a+1,u};for(let p=c(":elseif");p;p=c(":elseif"))i.push({expr:p.attrs[":elseif"],node:p});let l=c(":else");l&&i.push({node:l}),s.appendChild(qt(i,e,n));continue}s.appendChild(z(o,e,n)),r++}return s},Ht=(t,e)=>G(t.template,e,A(e)),zt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Gt=/<([A-Za-z][\w-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,Kt=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,Vt=t=>t.split(Kt).map((e,n)=>n%2===1?e:e.replace(Gt,(s,r,o)=>zt.has(r.toLowerCase())?s:`<${r}${o}></${r}>`)).join(""),K="data-jq79",Zt=t=>{let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return(e>>>0).toString(36)},gt=(t,e)=>{t.forEach(n=>{typeof n!="string"&&(n.attrs[K]=e,gt(n.children,e))})},Xt=(t,e)=>t.split(",").map(n=>{let s=n.trim(),r=s.indexOf("::"),o=r===-1?s:s.slice(0,r),i=r===-1?"":s.slice(r);return`${o}[${K}="${e}"]${i}`}).join(", "),yt=(t,e)=>{Array.from(t).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=Xt(n.selectorText,e):n instanceof CSSGroupingRule&&yt(n.cssRules,e)})},Jt=(t,e)=>{/:deep\(|::v-deep|>>>/.test(t)&&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(t),yt(n.cssRules,e),Array.from(n.cssRules).map(s=>s.cssText).join(`
6
+ `)},Yt=t=>{let n=new DOMParser().parseFromString(`<template>${Vt(t)}</template>`,"text/html").querySelector("template"),s=[],r=[],o=[];Array.from(n.content.children).forEach(c=>{let l={attrs:pt(c),content:c.textContent??""};c.tagName==="SCRIPT"?s.push(l):c.tagName==="STYLE"?r.push(l):o.push(ht(c))}),r.forEach(c=>{"lang"in c.attrs&&console.warn(`jq79: <style lang="${c.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.`)});let i=c=>"scoped"in c.attrs&&!("lang"in c.attrs);if(r.some(i)){let c=Zt(t);gt(o,c),r.forEach(l=>{i(l)&&(l.scoped=Jt(l.content,c))})}return{template:o,scripts:s,styles:r}},V=t=>/\.html?([?#]|$)/.test(t)?v.fetch(t):import(t),Et=(t,e)=>t?`
7
+ //# sourceURL=${t}?jq79-script=${e}`:"",ut=t=>t.scoped??t.content,B=new Map,Qt=t=>{let e=B.get(t);if(!e){let n=document.createElement("style");n.textContent=t,document.head.appendChild(n),e={el:n,count:0},B.set(t,e)}e.count++},te=t=>{let e=B.get(t);e&&--e.count<=0&&(e.el.remove(),B.delete(t))},St={$:N,$$:M,$create:D,$reactive:O},ee=(t,e,n,s={},r=V,o={})=>{let i={...St,...s},c=new Proxy(e,{has:(p,a)=>a!=="$__effect"&&a!=="$__import"&&(Reflect.has(p,a)||!(a in globalThis)&&!(a in i))});new Function("$scope","$__effect","$__import",...Object.keys(i),`return (async () => { with ($scope) { ${t} } })()${Et(o.filename,o.index??0)}`)(c,n,r,...Object.values(i)).catch(p=>console.error("jq79: error in :setup script",p))},ne=t=>t&&t.default!==void 0?t.default:t,se=(t,e,n,s={},r=V,o={})=>{let i={...St,...s},c={},l=new Function("$__exports","$__default","$__import",...Object.keys(i),`return (async () => { "use strict";
8
8
  ${t}
9
- ;$__exports.done = true })()${Et(o.filename,o.index??0)}`)(c,ne,r,...Object.values(i)),h=y=>console.error("jq79: error in factory script",y),a=!1,p=()=>{if(a)return;a=!0;let y=c.default;if(typeof y!="function")return;let u=d=>{d&&typeof d=="object"&&Object.assign(e,d)};try{let d=y({$data:e,$effect:n,...s});d instanceof Promise?d.then(u).catch(h):u(d)}catch(d){h(d)}};l.then(p,h),c.done&&p()},L=class t{constructor(e,n={}){w(this,"template");w(this,"scripts");w(this,"styles");w(this,"modules");w(this,"filename");w(this,"data",null);w(this,"fx",null);w(this,"content",null);w(this,"startMarker",null);w(this,"endMarker",null);w(this,"styleEls",[]);w(this,"ownsSharedStyles",!1);w(this,"useShadow",!1);w(this,"mountRoot",null);w(this,"resolveMounted",null);w(this,"emitListeners",new Map);let s=typeof e=="string"?Yt(e):e;this.template=s.template,this.scripts=s.scripts,this.styles=s.styles,this.modules=n.modules??(typeof e=="string"?void 0:e.modules),this.filename=n.filename??(typeof e=="string"?void 0:e.filename)}static async fetch(e){let n=await fetch(e);if(!n.ok)throw new Error(`failed to fetch component from ${e}: ${n.status}`);return new t(await n.text(),{filename:e})}on(e,n){return this.emitListeners.has(e)||this.emitListeners.set(e,new Set),this.emitListeners.get(e).add(n),this}off(e,n){return this.emitListeners.get(e)?.delete(n),this}render(e={}){return this.renderWith(e,!1)}renderShadow(e={}){return this.renderWith(e,!0)}renderWith(e,n){this.destroy();let s=O({...e}),r=A(s);this.data=s,this.fx=r,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let o=this.startMarker,i=(f,m)=>{let E=new CustomEvent(f,{detail:m,bubbles:!0,composed:!0}),g=o.dispatchEvent(E);return o===this.startMarker&&this.emitListeners.get(f)?.forEach(R=>R(E,m)),g},c,l=new Promise(f=>{c=f});this.resolveMounted=c;let h=()=>l,a=this.endMarker,p=f=>{let m=[];for(let E=o.nextSibling;E&&E!==a;E=E.nextSibling)E instanceof Element&&(E.matches(f)&&m.push(E),m.push(...Array.from(E.querySelectorAll(f))));return m},y=f=>p(f)[0]??null,u=this.modules,d=f=>u&&f in u?Promise.resolve(u[f]):V(f),b=f=>`await $mounted();${f}`;this.scripts.forEach((f,m)=>{let E={$emit:i,$mounted:h,$self:y,$$self:p},g={filename:this.filename,index:m},R=at(f.content);if(R!==null){let N=":mounted"in f.attrs?b(R):R;se(N,s,r.effect,E,d,g);return}let{vars:$,code:C}=ct(f.content);$.forEach(N=>{N in s||(s[N]=void 0)});let T=":mounted"in f.attrs?b(C):C;ee(T,s,r.effect,E,d,g)});let S=document.createDocumentFragment();return S.append(this.startMarker,G(this.template,s,r),this.endMarker),this.content=S,n?this.styleEls=this.styles.map(f=>{let m=document.createElement("style");return m.textContent=f.content,m}):(this.styles.forEach(f=>Qt(dt(f))),this.ownsSharedStyles=!0),this}mount(e,n){let s=typeof e=="string"?v(e):e;if(!s)throw new Error(`mount target not found: ${e}`);return(!this.content||n!==void 0)&&this.renderWith(n??{},this.useShadow),this.attach(s)}mountShadow(e,n){let s=typeof e=="string"?v(e):e;if(!s)throw new Error(`mount target not found: ${e}`);return(!this.content||n!==void 0||!this.useShadow)&&this.renderWith(n??{},!0),this.attach(s)}attach(e){this.mountRoot&&this.detach();let n=this.useShadow&&e instanceof Element?e.shadowRoot??e.attachShadow({mode:"open"}):e;return this.useShadow&&this.styleEls.forEach(s=>n.appendChild(s)),n.appendChild(this.content),this.mountRoot=n,this.resolveMounted?.(),this}detach(){if(!this.mountRoot||!this.content||!this.startMarker||!this.endMarker)return this;let e=this.startMarker;for(;e;){let n=e.nextSibling;if(this.content.appendChild(e),e===this.endMarker)break;e=n}return this.mountRoot=null,this}destroy(){return this.detach(),this.fx?.dispose(),this.fx=null,this.styleEls.forEach(e=>e.parentNode?.removeChild(e)),this.styleEls=[],this.ownsSharedStyles&&(this.styles.forEach(e=>te(dt(e))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.data=null,this.resolveMounted=null,this}},re=t=>new L(t);return Ct(oe);})();
9
+ ;$__exports.done = true })()${Et(o.filename,o.index??0)}`)(c,ne,r,...Object.values(i)),p=y=>console.error("jq79: error in factory script",y),a=!1,u=()=>{if(a)return;a=!0;let y=c.default;if(typeof y!="function")return;let f=h=>{h&&typeof h=="object"&&Object.assign(e,h)};try{let h=y({$data:e,$effect:n,...s});h instanceof Promise?h.then(f).catch(p):f(h)}catch(h){p(h)}};l.then(u,p),c.done&&u()},v=class t{constructor(e,n={}){w(this,"template");w(this,"scripts");w(this,"styles");w(this,"modules");w(this,"filename");w(this,"data",null);w(this,"fx",null);w(this,"content",null);w(this,"startMarker",null);w(this,"endMarker",null);w(this,"styleEls",[]);w(this,"ownsSharedStyles",!1);w(this,"useShadow",!1);w(this,"mountRoot",null);w(this,"resolveMounted",null);w(this,"emitListeners",new Map);let s=typeof e=="string"?Yt(e):e;this.template=s.template,this.scripts=s.scripts,this.styles=s.styles,this.modules=n.modules??(typeof e=="string"?void 0:e.modules),this.filename=n.filename??(typeof e=="string"?void 0:e.filename)}static async fetch(e){let n=await fetch(e);if(!n.ok)throw new Error(`failed to fetch component from ${e}: ${n.status}`);return new t(await n.text(),{filename:e})}on(e,n){return this.emitListeners.has(e)||this.emitListeners.set(e,new Set),this.emitListeners.get(e).add(n),this}off(e,n){return this.emitListeners.get(e)?.delete(n),this}render(e={}){return this.renderWith(e,!1)}renderShadow(e={}){return this.renderWith(e,!0)}renderWith(e,n){this.destroy();let s=O({...e}),r=A(s);this.data=s,this.fx=r,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let o=this.startMarker,i=(d,m)=>{let E=new CustomEvent(d,{detail:m,bubbles:!0,composed:!0}),g=o.dispatchEvent(E);return o===this.startMarker&&this.emitListeners.get(d)?.forEach(R=>R(E,m)),g},c,l=new Promise(d=>{c=d});this.resolveMounted=c;let p=()=>l,a=this.endMarker,u=d=>{let m=[];for(let E=o.nextSibling;E&&E!==a;E=E.nextSibling)E instanceof Element&&(E.matches(d)&&m.push(E),m.push(...Array.from(E.querySelectorAll(d))));return m},y=d=>u(d)[0]??null,f=this.modules,h=d=>f&&d in f?Promise.resolve(f[d]):V(d),b=d=>`await $mounted();${d}`;this.scripts.forEach((d,m)=>{let E={$emit:i,$mounted:p,$self:y,$$self:u},g={filename:this.filename,index:m},R=at(d.content);if(R!==null){let L=":mounted"in d.attrs?b(R):R;se(L,s,r.effect,E,h,g);return}let{vars:$,code:C}=ct(d.content);$.forEach(L=>{L in s||(s[L]=void 0)});let T=":mounted"in d.attrs?b(C):C;ee(T,s,r.effect,E,h,g)});let S=document.createDocumentFragment();return S.append(this.startMarker,G(this.template,s,r),this.endMarker),this.content=S,n?this.styleEls=this.styles.map(d=>{let m=document.createElement("style");return m.textContent=d.content,m}):(this.styles.forEach(d=>Qt(ut(d))),this.ownsSharedStyles=!0),this}mount(e,n){let s=typeof e=="string"?N(e):e;if(!s)throw new Error(`mount target not found: ${e}`);return(!this.content||n!==void 0)&&this.renderWith(n??{},this.useShadow),this.attach(s)}mountShadow(e,n){let s=typeof e=="string"?N(e):e;if(!s)throw new Error(`mount target not found: ${e}`);return(!this.content||n!==void 0||!this.useShadow)&&this.renderWith(n??{},!0),this.attach(s)}attach(e){this.mountRoot&&this.detach();let n=this.useShadow&&e instanceof Element?e.shadowRoot??e.attachShadow({mode:"open"}):e;return this.useShadow&&this.styleEls.forEach(s=>n.appendChild(s)),n.appendChild(this.content),this.mountRoot=n,this.resolveMounted?.(),this}detach(){if(!this.mountRoot||!this.content||!this.startMarker||!this.endMarker)return this;let e=this.startMarker;for(;e;){let n=e.nextSibling;if(this.content.appendChild(e),e===this.endMarker)break;e=n}return this.mountRoot=null,this}destroy(){return this.detach(),this.fx?.dispose(),this.fx=null,this.styleEls.forEach(e=>e.parentNode?.removeChild(e)),this.styleEls=[],this.ownsSharedStyles&&(this.styles.forEach(e=>te(ut(e))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.data=null,this.resolveMounted=null,this}},re=t=>new v(t);return Ct(oe);})();
10
10
  //# sourceMappingURL=jq79.global.js.map