jq79 0.7.8 → 0.7.10
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/README.md +3 -2
- package/dev/vite.ts +40 -1
- package/dist/jq79-sw.js +1 -1
- package/dist/jq79.cjs +14 -14
- package/dist/jq79.cjs.map +1 -1
- package/dist/jq79.d.ts +4 -0
- package/dist/jq79.global.js +14 -14
- package/dist/jq79.global.js.map +1 -1
- package/dist/jq79.js +14 -14
- package/dist/jq79.js.map +1 -1
- package/dist/precompile.cjs +1 -1
- package/dist/precompile.cjs.map +1 -1
- package/dist/precompile.js +1 -1
- package/dist/precompile.js.map +1 -1
- package/dist/vite.cjs +31 -0
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.js +31 -0
- package/dist/vite.js.map +1 -1
- package/package.json +1 -1
- package/src/jq79.ts +26 -3
- package/src/precompile.ts +1 -1
- package/src/source.ts +3 -3
package/README.md
CHANGED
|
@@ -112,7 +112,8 @@ hands back a pending component you can mount right away:
|
|
|
112
112
|
</script>
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
`fetchAll([...])` fetches several at once instead
|
|
115
|
+
`fetchAll([...])` fetches several at once instead, and `importAll([...])` takes
|
|
116
|
+
components and modules alike, like a `Promise.all` of `import()`s. See
|
|
116
117
|
[loading remote components](docs/components.md#loading-remote-components).
|
|
117
118
|
|
|
118
119
|
The library also exports `parseComponent(source)` as a shorthand for
|
|
@@ -172,7 +173,7 @@ When the fetch resolves, the assignments to `firstName`/`lastName` re-run the `$
|
|
|
172
173
|
## Documentation
|
|
173
174
|
|
|
174
175
|
- [Tutorial](https://jgermade.github.io/jq79/tutorial/) — learn it by doing, in the browser.
|
|
175
|
-
- [Components](docs/components.md) — lifecycle (`mount`, `mountShadow`, `detach`, `destroy`), instance events (`on`/`off`), `<style scoped>`, several components in one file with `<template name>`, loading remote components with `Component79.fetch` (chainable — fetch and mount in one expression) and `
|
|
176
|
+
- [Components](docs/components.md) — lifecycle (`mount`, `mountShadow`, `detach`, `destroy`), instance events (`on`/`off`), `<style scoped>`, several components in one file with `<template name>`, loading remote components with `Component79.fetch` (chainable — fetch and mount in one expression), `fetchAll` and `importAll`, and `Component79.version`.
|
|
176
177
|
- [Template syntax](docs/template-syntax.md) — `{{ }}` interpolation, `:name` attribute bindings, `:text`/`:html`, `:if`/`:elseif`/`:else`, `:each`/`:key`, `:with`, `@event` listeners and modifiers, nested components.
|
|
177
178
|
- [Setup scripts](docs/setup-scripts.md) — `<script :setup>` reactive scripts, `$:` declarations, `$emit`, `await $mounted()`, `$self`/`$$self`, and `export default` factory scripts (plain-JS alternative).
|
|
178
179
|
- [Reactive data](docs/reactive-data.md) — the standalone `$reactive` store: `$on`, `$onAny`, `$effect`, and `$computed` for derived values.
|
package/dev/vite.ts
CHANGED
|
@@ -220,6 +220,13 @@ const IMPORT_CALL_RE = /import\s*\(\s*(["'])([^"'\n]+?)\1\s*\)/y
|
|
|
220
220
|
// specifier. The clause can't contain parens/quotes, so dynamic import()
|
|
221
221
|
// and import.meta never match
|
|
222
222
|
const STATIC_IMPORT_RE = /import\s*(?:[\w$\s,{}*]+?\s*from\s*)?(["'])([^"'\n]+)\1/y
|
|
223
|
+
// the opening of $importAll([...]), the plural of import(): its string
|
|
224
|
+
// entries are import()'s specifiers, one by one (importAllSpecifiers)
|
|
225
|
+
const IMPORT_ALL_RE = /\$importAll\s*\(\s*\[/y
|
|
226
|
+
// what may sit between the entries of that array (whitespace, comments), and
|
|
227
|
+
// an entry the bundle can answer: a string literal
|
|
228
|
+
const ARRAY_GAP_RE = /(?:\s|\/\/[^\n]*|\/\*[\s\S]*?\*\/)*/y
|
|
229
|
+
const ARRAY_ENTRY_RE = /(["'])([^"'\n]+?)\1/y
|
|
223
230
|
|
|
224
231
|
const skipString = (src: string, start: number): number => {
|
|
225
232
|
const quote = src[start]
|
|
@@ -236,6 +243,26 @@ const skipString = (src: string, start: number): number => {
|
|
|
236
243
|
// bare matchAll, because a specifier mentioned in a comment or a string is
|
|
237
244
|
// not an import: hoisting a commented-out `import("./old.html")` would pull
|
|
238
245
|
// dead files into the bundle - or break the build once the file is gone
|
|
246
|
+
// the literal entries of a $importAll([...]) whose "[" ends at `at`, and
|
|
247
|
+
// where the scan goes on from. A literal is hoisted until the first entry that
|
|
248
|
+
// isn't one: from there the array is the runtime's, as a computed import() is
|
|
249
|
+
const importAllSpecifiers = (script: string, at: number): { specs: string[]; end: number } => {
|
|
250
|
+
const specs: string[] = []
|
|
251
|
+
const gap = (i: number) => { ARRAY_GAP_RE.lastIndex = i; ARRAY_GAP_RE.exec(script); return ARRAY_GAP_RE.lastIndex }
|
|
252
|
+
let i = gap(at)
|
|
253
|
+
for (;;) {
|
|
254
|
+
ARRAY_ENTRY_RE.lastIndex = i
|
|
255
|
+
const entry = ARRAY_ENTRY_RE.exec(script)
|
|
256
|
+
if (!entry) return { specs, end: i }
|
|
257
|
+
const next = gap(ARRAY_ENTRY_RE.lastIndex)
|
|
258
|
+
// a literal is an entry only when it's all of one: `"./a" + x` isn't
|
|
259
|
+
if (script[next] !== "," && script[next] !== "]") return { specs, end: i }
|
|
260
|
+
specs.push(entry[2])
|
|
261
|
+
if (script[next] === "]") return { specs, end: next + 1 }
|
|
262
|
+
i = gap(next + 1)
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
239
266
|
const importSpecifiers = (script: string): string[] => {
|
|
240
267
|
const specs: string[] = []
|
|
241
268
|
let i = 0
|
|
@@ -260,6 +287,17 @@ const importSpecifiers = (script: string): string[] => {
|
|
|
260
287
|
const staticImport = STATIC_IMPORT_RE.exec(script)
|
|
261
288
|
if (staticImport) { specs.push(staticImport[2]); i = STATIC_IMPORT_RE.lastIndex; continue }
|
|
262
289
|
}
|
|
290
|
+
// $importAll, not C79.importAll: the static one means the page, so it
|
|
291
|
+
// stays the runtime's (the "." before it is what the guard skips)
|
|
292
|
+
if (ch === "$" && (i === 0 || !/[\w$.]/.test(script[i - 1]))) {
|
|
293
|
+
IMPORT_ALL_RE.lastIndex = i
|
|
294
|
+
if (IMPORT_ALL_RE.exec(script)) {
|
|
295
|
+
const { specs: entries, end } = importAllSpecifiers(script, IMPORT_ALL_RE.lastIndex)
|
|
296
|
+
specs.push(...entries)
|
|
297
|
+
i = end
|
|
298
|
+
continue
|
|
299
|
+
}
|
|
300
|
+
}
|
|
263
301
|
i++
|
|
264
302
|
}
|
|
265
303
|
return specs
|
|
@@ -269,7 +307,8 @@ const isHtmlUrl = (spec: string) => /\.html?([?#]|$)/.test(spec)
|
|
|
269
307
|
const isExternalUrl = (spec: string) => /^[a-z][a-z0-9+.-]*:/i.test(spec) || spec.startsWith("/")
|
|
270
308
|
|
|
271
309
|
// literal import specifiers in the component's script blocks - dynamic
|
|
272
|
-
// `import("...")` calls
|
|
310
|
+
// `import("...")` calls, the entries of `$importAll([...])` and static
|
|
311
|
+
// factory-script imports - that should
|
|
273
312
|
// resolve from the bundle instead of at runtime. Absolute paths and full
|
|
274
313
|
// URLs are left alone (they point at served files, e.g. public/), and so
|
|
275
314
|
// are .html specifiers the plugin wouldn't claim as components
|
package/dist/jq79-sw.js
CHANGED
|
@@ -21,7 +21,7 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
|
|
|
21
21
|
${t}`,nt=e=>`await $mounted();${e}`,Ni=e=>["$scope","$__effect","$__import","$__state",...e],Ti=e=>`return (async () => { with ($scope) { ${e} }
|
|
22
22
|
;$__state.done = true })()`,Ri=e=>["$__exports","$__default","$__import",...e],Li=e=>`return (async () => { "use strict";
|
|
23
23
|
${e}
|
|
24
|
-
;$__exports.done = true })()`,ot=e=>{let t=e.attrs[":setup"];return t===void 0?null:t.trim()===""?[]:ce(t)},Vi=(e,t)=>{let i=new Set;return e.forEach(s=>{(Ne(s.content)??t(s))?.forEach(({name:n})=>i.add(n))}),i},Oi=["$","$$","$create","$reactive","$toRaw","Component79"],Bi=["$mounted","$destroyed","$attached","$detached","$computed","$self","$$self","$emit","$updateModel","$slots"],ut="__jq79precompiled",ht="jq79-precompiled",Le=(e,t)=>`function anonymous(${e.join(",")}
|
|
24
|
+
;$__exports.done = true })()`,ot=e=>{let t=e.attrs[":setup"];return t===void 0?null:t.trim()===""?[]:ce(t)},Vi=(e,t)=>{let i=new Set;return e.forEach(s=>{(Ne(s.content)??t(s))?.forEach(({name:n})=>i.add(n))}),i},Oi=["$","$$","$create","$reactive","$toRaw","Component79","C79"],Bi=["$mounted","$destroyed","$attached","$detached","$computed","$self","$$self","$emit","$updateModel","$slots","$importAll"],ut="__jq79precompiled",ht="jq79-precompiled",Le=(e,t)=>`function anonymous(${e.join(",")}
|
|
25
25
|
) {
|
|
26
26
|
${t}
|
|
27
27
|
}`;var Di=e=>typeof e!="string",Mi=e=>{let{[at]:t,...i}=e.attrs;return{tag:e.tag,attrs:i,...t===void 0?{}:{component:t},children:e.children.map(s=>typeof s=="string"?s:Mi(s))}},Fi=e=>e.children.map(t=>typeof t=="string"?t:Fi(t)).join(""),br=(e,t)=>{let s=(e.component??e.tag).replace(/-/g,"").toLowerCase(),r=new Set(t.filter(n=>/^[A-Z]/.test(n)&&n.replace(/-/g,"").toLowerCase()===s));return r.add(e.component??le(e.tag).replace(/^./,n=>n.toUpperCase())),[...r]},$i=(e,t,i)=>{for(let s of e){if(typeof s=="string"){s.includes("{{")&&Si(s).forEach(n=>{typeof n!="string"&&i(n.expr)});continue}let r=s.attrs;if(":if"in r&&i(r[":if"]),":elseif"in r&&i(r[":elseif"]),":each"in r){let n=r[":each"].match(Ci);n&&i(n[3]),":key"in r&&i(r[":key"])}":with"in r&&i(r[":with"]);for(let n in r)(n===":slot"||n.startsWith(":slot."))&&ce(r[n]||void 0)?.forEach(({default:o})=>{o!==void 0&&i(o)});if(wi(s.tag))for(let n in r)Re(n)||n.startsWith("@")||!n.startsWith(":")||i(r[n]||n.slice(1));else{if(s.component!==void 0||s.tag.includes("-")){br(s,t).forEach(n=>i(n));for(let n in r){let o=r[n];if(n===":props"||n.startsWith(":props."))i(o);else{if(Re(n))continue;if(n.startsWith("@"))i(o,["$event"]);else if(n===":model"||n.startsWith(":model.")){let u=o||(n===":model"?"model":le(n.slice(7)));i(u),i(Ei(u),["$value"])}else n.startsWith(":")?i(o||le(n.slice(1))):i(JSON.stringify(o))}}}for(let n in r){let o=r[n];if(n.startsWith("@"))i(o,["$event"]);else{if(n===":model"||n.startsWith(":model."))continue;if(n===":class"||n.startsWith(":class.")||n===":text"||n===":html"||n===":html.allowed"||n===":value"||n===":checked"||n===":selected")i(o);else{if(Re(n))continue;n.startsWith(":")&&i(o||le(n.slice(1)))}}}}$i(s.children,t,i)}},Ui=e=>{let t=new Map,i=(u,h)=>{t.set(Pi(u,h),[u,h])},s=(u,h=[])=>{let l=[...ki,...h],c=Ii(u,h);c!==null&&i(l,c),i(l,Ai(u))},r=ui(yi(e)).filter(Di),n=[],o=[r.filter(u=>u.tag!=="template")];return r.filter(u=>u.tag==="template").forEach(u=>{let h=u.attrs.name;h===void 0||!_i.test(h)||n.includes(h)||(n.push(h),o.push(u.children.filter(Di)))}),o.forEach(u=>yr(u,n,i,s)),[...t.values()]},yr=(e,t,i,s)=>{let r=e.filter(c=>c.tag==="script").map(c=>({attrs:c.attrs,content:Fi(c)})),n=e.filter(c=>c.tag!=="script"&&c.tag!=="style").map(Mi),o;try{o=Vi(r,ot)}catch{return}let u=Object.fromEntries(t.filter(c=>!o.has(c)).map(c=>[c,!0])),h=Object.keys({...Object.fromEntries(Oi.map(c=>[c,!0])),...Object.fromEntries(Bi.map(c=>[c,!0])),...u}),l=[...t];r.forEach(c=>{let d=":mounted"in c.attrs,m=mi(c.content);if(m!==null)Ne(c.content)?.forEach(({name:E,default:P})=>{l.push(E),P!==void 0&&s(P)}),i(Ri(h),Li(d?nt(m):m));else{let{vars:S,code:E}=Pe(c.content);l.push(...S),ot(c)?.forEach(({name:P,default:N})=>{l.push(P),N!==void 0&&s(N)}),i(Ni(h),Ti(d?nt(E):E))}}),$i(n,l,s)},Wi=(e,t)=>{let i=e.map(([s,r])=>`[${JSON.stringify(s)}, ${JSON.stringify(r)}, ${t(s,r)?Le(s,r):"null"}]`);return`(self.${ut} = self.${ut} || []).push(
|
package/dist/jq79.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var De=Object.defineProperty;var Is=Object.getOwnPropertyDescriptor;var qs=Object.getOwnPropertyNames;var Hs=Object.prototype.hasOwnProperty;var Ws=(e,t,n)=>t in e?De(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Fs=(e,t)=>{for(var n in t)De(e,n,{get:t[n],enumerable:!0})},Us=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of qs(t))!Hs.call(e,r)&&r!==n&&De(e,r,{get:()=>t[r],enumerable:!(s=Is(t,r))||s.enumerable});return e};var Bs=e=>Us(De({},"__esModule",{value:!0}),e);var k=(e,t,n)=>Ws(e,typeof t!="symbol"?t+"":t,n);var Ti={};Fs(Ti,{$:()=>Te,$$:()=>Ie,$computed:()=>Fe,$create:()=>qe,$reactive:()=>xe,$toRaw:()=>Z,C79:()=>de,Component79:()=>de,PendingComponent79:()=>ot,enableHotReload:()=>js,hotUpdate:()=>_s,parseComponent:()=>bi,renderComponent:()=>Wo});module.exports=Bs(Ti);function Te(e,t){return typeof e=="string"?document.querySelector(e):e.querySelector(t)}function Ie(e,t){return Array.from(typeof e=="string"?document.querySelectorAll(e):e.querySelectorAll(t))}var qe=(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},Ks=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),Xt={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},zs=new Set(["http:","https:","mailto:"]);function Gs(e){try{let t=new URL(e,"https://example.com");return zs.has(t.protocol)}catch{return!1}}var Vs={"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 Jt=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||Vs[n.protocol]||"";return t.some(i=>i.host.test(s)&&(i.port===null||i.port===r))}};function Qs(e,t,n,s){try{return!!e(new URL(t,document.baseURI),n,s)}catch{return!1}}var Yt=512;function en(e,t,n,s){if(n>Yt)throw new RangeError(`jq79: sanitizeHTML input nests deeper than ${Yt} elements`);for(let r of Array.from(e.childNodes))if(r.nodeType===Node.ELEMENT_NODE){let i=Xs(r,n,s);i&&t.appendChild(i)}else r.nodeType===Node.TEXT_NODE&&t.appendChild(r.cloneNode())}function Xs(e,t,n){let s=e.tagName.toLowerCase();if(!Ks.has(s))return null;let r=document.createElement(s);for(let i of Array.from(e.attributes)){let o=i.name.toLowerCase(),a=Xt[s]?.has(o),l=Xt["*"]?.has(o);!a&&!l||(o==="href"||o==="src")&&(!Gs(i.value)||n&&!Qs(n,i.value,s,o))||r.setAttribute(o,i.value)}return s==="a"&&r.setAttribute("rel","noopener noreferrer"),en(e,r,t+1,n),r}function lt(e,t){let n=document.createElement("template");n.innerHTML=e;let s=document.createElement("div");return en(n.content,s,0,t?.allowUrl),s.innerHTML}var Ys=(e,t)=>t.split(".").reduce((n,s)=>n?.[s],e),He=e=>{if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},ln=(e,t,n)=>{Object.entries(e).forEach(([s,r])=>{let i=t?`${t}.${s}`:s;r&&typeof r=="object"&&He(r)?ln(r,i,n):n(i,r)})},Js=(e,t)=>{e.own===null?e.own=t:e.own!==t&&(e.ownMany??(e.ownMany=new Set)).add(t)},er=(e,t)=>{e.deep===null?e.deep=t:e.deep!==t&&(e.deepMany??(e.deepMany=new Set)).add(t)},tr=(e,t)=>{e.own===t?e.own=null:e.ownMany?.delete(t)&&e.ownMany.size===0&&(e.ownMany=null)},nr=(e,t)=>{e.deep===t?e.deep=null:e.deepMany?.delete(t)&&e.deepMany.size===0&&(e.deepMany=null)},$e=(e,t)=>{e.own!==null&&t(e.own),e.ownMany?.forEach(t)},Me=(e,t)=>{e.deep!==null&&t(e.deep),e.deepMany?.forEach(t)},tn=" keys",ct=e=>e?`${e}.${tn}`:tn,nn=".length",sn=(e,t)=>({children:null,own:null,ownMany:null,deep:null,deepMany:null,parent:e,segment:t}),sr=e=>e.own===null&&e.deep===null&&!e.ownMany?.size&&!e.deepMany?.size&&!e.children?.size,ut=Symbol("jq79.raw"),Z=e=>{let t=e;for(;t!==null&&typeof t=="object"&&t[ut];)t=t[ut];return t},cn=Symbol("jq79.store"),ge=e=>e!==null&&typeof e=="object"&&e[cn]===!0,ft=null,ue=[],Y=null,Re=e=>{ue.push(new Set);let t=Y;Y=null;try{return e()}finally{ue.pop(),Y=t}},rr=e=>{e.adopted.forEach((t,n)=>{e.read?.has(n)||(t(),e.adopted.delete(n))})},rn=e=>{e.adopted?.forEach(t=>t()),e.adopted=null},or=0,dt=new Set,on="$__attach",an="$__holds",We=Symbol("jq79.alsoWakenBy"),ht=Symbol("jq79.owner"),xe=e=>{let t=new Map,n=new Set,s=new Set,r=new WeakMap,i=Object.create(null),o=sn(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=sn(g,p),S.set(p,m)),g=m}),d.deep?er(g,d):Js(g,d),g},l=(c,d)=>{d.deep?nr(c,d):tr(c,d);let g=c;for(;g?.parent&&sr(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();$e(T,A=>d.add(A)),Me(T,A=>d.add(A)),T.children?.forEach(A=>R.push(A))}},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],Me(p,T=>d.add(T));let R=x.get(m);R&&$e(p,T=>{R.store[an](T)||d.add(T)}),y===S.length-2&&S[y+1]==="length"&&($e(p,T=>d.add(T)),g(p))}return p=p.children?.get(S[S.length-1]),p&&($e(p,y=>d.add(y)),Me(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(nn)&&g.add(m.slice(0,-nn.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 A=m.slice(0,T);(!(y>0&&h(m,y,T))||g.has(R))&&p.add(A),R=A,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=dt,m=N=>p?p.has(N):d===N,y=N=>{let z=a(N,c);p?p.set(N,z):d===null?(d=N,g=z):(p=new Map([[d,g],[N,z]]),d=g=null)},R=N=>{if(p){p.forEach((z,F)=>{N.has(F)||(l(z,c),p.delete(F))});return}d!==null&&!N.has(d)&&(l(g,c),d=g=null)},T=()=>{p?p.forEach(N=>l(N,c)):g&&l(g,c),p=null,d=g=null},A=N=>{if(N.size===S.size){let F=!0;if(N.forEach(he=>{F&&(F=S.has(he))}),F)return}S=N;let z=w(c,N);R(z),z.forEach(F=>{m(F)||y(F)})};return c.reindex.add(A),A(c.deps),()=>{c.reindex.delete(A),T(),S=dt}},I=c=>{let d=f(c);if(d){let g=new Set;$e(d,p=>g.add(p)),Me(d,p=>g.add(p)),j(g)}},G=c=>I(ct(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))},H=(c,d)=>c!==d&&c!==null&&d!==null&&typeof c=="object"&&typeof d=="object"&&!ge(c)&&!ge(d)&&He(c)&&He(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},ae=(c,d)=>{if(Array.isArray(d)){let R=c.length,T=d.length,A=R!==T;if(!R||!T)return D;let N=Math.max(R,T);if(Math.abs(R-T)===1){let F=B(c,d);if(F!==L){let he=[];for(let at=F;at<N;at++)he.push(String(at));return{keys:he,exact:!0,keysChanged:A}}}let z=[];for(let F=0;F<N;F++)if(!Object.is(Z(c[F]),Z(d[F]))&&(z.push(String(F)),z.length*2>=N))return D;return{keys:z,exact:!1,keysChanged:A}}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&&($e(T,A=>S.add(A)),Me(T,A=>S.add(A)))},y=ae(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}`,A=t.get(T);if(A){let N=Z(g[R]),z=P(N)?V(N,T):N;A.forEach(F=>F(z,T))}y.exact?m(T):u(T).forEach(N=>S.add(N))}),y.keysChanged&&m(ct(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)},P=c=>c!==null&&typeof c=="object"&&He(c),x=new Map,W=(c,d)=>{let g=x.get(d);g?.store!==c&&(g?.unsubscribe(),x.set(d,{store:c,unsubscribe:c.$onAny((p,S)=>b(`${d}.${p}`,S))}))},J=c=>{x.get(c)?.unsubscribe(),x.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 ue[ue.length-1]?.add(ct(d)),Y!==null&&Y.home!==s&&q(Y),Reflect.ownKeys(m)},get(m,y,R){if(y===ut)return m;if(y===cn)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;ue[ue.length-1]?.add(T),Y!==null&&Y.home!==s&&q(Y);let A=Reflect.get(m,y,R);if(ge(A))return W(A,T),A;let N=Z(A);return P(N)?V(N,T):N},set(m,y,R,T){if(T!==S&&!Object.prototype.hasOwnProperty.call(m,y))return Reflect.set(m,y,R,T);let A=d?`${d}.${y}`:y,N=ge(R)?R:Z(R),z=!Object.prototype.hasOwnProperty.call(m,y);if(!z&&Object.is(m[y],N)&&(N===null||typeof N!="object"))return!0;let F=m[y];m[y]=N,p?.delete(y),ge(N)?W(N,A):J(A);let he=ge(N)||!P(N)?N:V(N,A);return!z&&H(F,N)?v(A,F,N,he):b(A,he,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 A=d?`${d}.${y}`:y;(p??(p=new Set)).add(y),J(A),b(A,void 0),G(d)}return T}});return r.set(c,S),S},E=V(Z(e),"");Object.entries(Z(e)).forEach(([c,d])=>{ge(d)&&W(d,c)});let C=(c,d,{immediate:g=!1}={})=>(t.has(c)||t.set(c,new Set),t.get(c).add(d),g&&d(Ys(E,c),c),()=>t.get(c)?.delete(d)),M=(c,{immediate:d=!1}={})=>(n.add(c),d&&ln(E,"",(g,p)=>c(g,p)),()=>n.delete(c)),U=(c,{deep:d=!1,alsoWakenBy:g}={})=>{let p=!1,S=!1,m={deps:dt,reindex:new Set,deep:d,order:or++,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 A=new Set;ue.push(A);let N=Y;Y=m;try{c()}finally{ue.pop(),Y=N,m.deps=A}}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&&rr(m),m.reindex.forEach(T=>T(m.deps))}}};s.add(m);let y=O(m),R=()=>{s.delete(m),y(),rn(m)};return g?.length?Q(m,g,R):(m.run(),ft=m,R)},Q=(c,d,g)=>{let p=d.map(S=>S?.[on]?.(c)).filter(Boolean);return c.run(),ft=c,()=>{g(),p.forEach(S=>S())}},$=c=>{s.add(c);let d=O(c);return()=>{s.delete(c),d()}},q=c=>{(c.read??(c.read=new Set)).add(s),!(c.adopted?.has(s)||s.has(c))&&(c.adopted??(c.adopted=new Map)).set(s,$(c))},K=()=>{x.forEach(({unsubscribe:c})=>c()),x.clear(),s.forEach(c=>{c.home===s&&rn(c)})};return i.$on=C,i.$onAny=M,i.$effect=U,i.$dispose=K,i[on]=$,i[an]=c=>s.has(c),E},pt=class{constructor(t,n){k(this,"scope",t);k(this,"disposers",null);k(this,"runs",null);k(this,"children",null);k(this,"owners",null);k(this,"options");let s=t[We];this.options=n||s?{deep:n,alsoWakenBy:s}:void 0,this.ownedBy(t)}ownedBy(t){let n=t[ht];!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(ft)}onDispose(t){(this.disposers??(this.disposers=[])).push(t)}refresh(){this.runs?.forEach(t=>t.run())}rerun(){let t=this.runs?[...this.runs]:null,n=this.children?[...this.children]:null;t?.forEach(s=>{this.runs&&s.run()}),n?.forEach(s=>s.rerun())}dispose(){let t=this.disposers;if(this.disposers=null,this.runs=null,this.children=null,this.owners?.forEach(n=>n.children?.delete(this)),this.owners=null,t)for(let n=0;n<t.length;n++)t[n]()}},me=(e,t=!1)=>new pt(e,t),Fe=e=>{let t=xe({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 dn=/(?:let|var|const)(?:\s+(?=[A-Za-z_$])|\s*(?=[{[]))/y,un=/\$:\s*/y,Be=/import(?=\s*\()/y,fn=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,se=(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},Ue=(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},
|
|
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},
|
|
4
|
-
`){let i=Ue(e,s+1);if(!(i<e.length&&(
|
|
5
|
-
`||o===";"||o==="}"?i=!0:/\s/.test(o)||(i=!1),n+=o,s++}return{vars:t,code:n}},Ke=/export\s+default(?![\w$])/y,hn=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,
|
|
6
|
-
`||r===";"||r==="}"?s=!0:/\s/.test(r)||(s=!1),t++}return-1},
|
|
7
|
-
`||a===";"||a==="}"?r=!0:/\s/.test(a)||(r=!1),t+=a,n++}return i?t:null},
|
|
8
|
-
= $value`,
|
|
9
|
-
); }`,Rn=(e,t)=>{let n=
|
|
1
|
+
var De=Object.defineProperty;var qs=Object.getOwnPropertyDescriptor;var Hs=Object.getOwnPropertyNames;var Ws=Object.prototype.hasOwnProperty;var Fs=(e,t,n)=>t in e?De(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Us=(e,t)=>{for(var n in t)De(e,n,{get:t[n],enumerable:!0})},Bs=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Hs(t))!Ws.call(e,r)&&r!==n&&De(e,r,{get:()=>t[r],enumerable:!(s=qs(t,r))||s.enumerable});return e};var Ks=e=>Bs(De({},"__esModule",{value:!0}),e);var M=(e,t,n)=>Fs(e,typeof t!="symbol"?t+"":t,n);var Ti={};Us(Ti,{$:()=>Te,$$:()=>Ie,$computed:()=>Fe,$create:()=>qe,$reactive:()=>xe,$toRaw:()=>V,C79:()=>le,Component79:()=>le,PendingComponent79:()=>it,enableHotReload:()=>Ls,hotUpdate:()=>js,parseComponent:()=>bi,renderComponent:()=>Fo});module.exports=Ks(Ti);function Te(e,t){return typeof e=="string"?document.querySelector(e):e.querySelector(t)}function Ie(e,t){return Array.from(typeof e=="string"?document.querySelectorAll(e):e.querySelectorAll(t))}var qe=(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},zs=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),Xt={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},Gs=new Set(["http:","https:","mailto:"]);function Vs(e){try{let t=new URL(e,"https://example.com");return Gs.has(t.protocol)}catch{return!1}}var Zs={"https:":"443","http:":"80"};function Qs(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 Jt=e=>{let t=(Array.isArray(e)?e:e.split(",")).map(Qs).filter(n=>n!==null);return n=>{let s=n.hostname.toLowerCase(),r=n.port||Zs[n.protocol]||"";return t.some(i=>i.host.test(s)&&(i.port===null||i.port===r))}};function Xs(e,t,n,s){try{return!!e(new URL(t,document.baseURI),n,s)}catch{return!1}}var Yt=512;function en(e,t,n,s){if(n>Yt)throw new RangeError(`jq79: sanitizeHTML input nests deeper than ${Yt} elements`);for(let r of Array.from(e.childNodes))if(r.nodeType===Node.ELEMENT_NODE){let i=Ys(r,n,s);i&&t.appendChild(i)}else r.nodeType===Node.TEXT_NODE&&t.appendChild(r.cloneNode())}function Ys(e,t,n){let s=e.tagName.toLowerCase();if(!zs.has(s))return null;let r=document.createElement(s);for(let i of Array.from(e.attributes)){let o=i.name.toLowerCase(),a=Xt[s]?.has(o),l=Xt["*"]?.has(o);!a&&!l||(o==="href"||o==="src")&&(!Vs(i.value)||n&&!Xs(n,i.value,s,o))||r.setAttribute(o,i.value)}return s==="a"&&r.setAttribute("rel","noopener noreferrer"),en(e,r,t+1,n),r}function ct(e,t){let n=document.createElement("template");n.innerHTML=e;let s=document.createElement("div");return en(n.content,s,0,t?.allowUrl),s.innerHTML}var Js=(e,t)=>t.split(".").reduce((n,s)=>n?.[s],e),He=e=>{if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},ln=(e,t,n)=>{Object.entries(e).forEach(([s,r])=>{let i=t?`${t}.${s}`:s;r&&typeof r=="object"&&He(r)?ln(r,i,n):n(i,r)})},er=(e,t)=>{e.own===null?e.own=t:e.own!==t&&(e.ownMany??(e.ownMany=new Set)).add(t)},tr=(e,t)=>{e.deep===null?e.deep=t:e.deep!==t&&(e.deepMany??(e.deepMany=new Set)).add(t)},nr=(e,t)=>{e.own===t?e.own=null:e.ownMany?.delete(t)&&e.ownMany.size===0&&(e.ownMany=null)},sr=(e,t)=>{e.deep===t?e.deep=null:e.deepMany?.delete(t)&&e.deepMany.size===0&&(e.deepMany=null)},$e=(e,t)=>{e.own!==null&&t(e.own),e.ownMany?.forEach(t)},Me=(e,t)=>{e.deep!==null&&t(e.deep),e.deepMany?.forEach(t)},tn=" keys",dt=e=>e?`${e}.${tn}`:tn,nn=".length",sn=(e,t)=>({children:null,own:null,ownMany:null,deep:null,deepMany:null,parent:e,segment:t}),rr=e=>e.own===null&&e.deep===null&&!e.ownMany?.size&&!e.deepMany?.size&&!e.children?.size,ft=Symbol("jq79.raw"),V=e=>{let t=e;for(;t!==null&&typeof t=="object"&&t[ft];)t=t[ft];return t},cn=Symbol("jq79.store"),ge=e=>e!==null&&typeof e=="object"&&e[cn]===!0,pt=null,ue=[],Y=null,Re=e=>{ue.push(new Set);let t=Y;Y=null;try{return e()}finally{ue.pop(),Y=t}},or=e=>{e.adopted.forEach((t,n)=>{e.read?.has(n)||(t(),e.adopted.delete(n))})},rn=e=>{e.adopted?.forEach(t=>t()),e.adopted=null},ir=0,ut=new Set,on="$__attach",an="$__holds",We=Symbol("jq79.alsoWakenBy"),gt=Symbol("jq79.owner"),xe=e=>{let t=new Map,n=new Set,s=new Set,r=new WeakMap,i=Object.create(null),o=sn(null,""),a=(u,c)=>{let m=o;return u.split(".").forEach(h=>{let w=m.children??(m.children=new Map),g=w.get(h);g||(g=sn(m,h),w.set(h,g)),m=g}),c.deep?tr(m,c):er(m,c),m},l=(u,c)=>{c.deep?sr(u,c):nr(u,c);let m=u;for(;m?.parent&&rr(m);)m.parent.children.delete(m.segment),m=m.parent},f=u=>{let c=o;for(let m of u.split("."))if(c=c.children?.get(m),!c)return;return c},d=u=>{let c=new Set,m=E=>{let T=E.children?[...E.children.values()]:[];for(;T.length;){let R=T.pop();$e(R,k=>c.add(k)),Me(R,k=>c.add(k)),R.children?.forEach(k=>T.push(k))}},h=o,w=u.split("."),g="";for(let E=0;E<w.length-1;E++){if(h=h.children?.get(w[E]),!h)return c;g=g?`${g}.${w[E]}`:w[E],Me(h,R=>c.add(R));let T=x.get(g);T&&$e(h,R=>{T.store[an](R)||c.add(R)}),E===w.length-2&&w[E+1]==="length"&&($e(h,R=>c.add(R)),m(h))}return h=h.children?.get(w[w.length-1]),h&&($e(h,E=>c.add(E)),Me(h,E=>c.add(E)),m(h)),c},p=(u,c,m)=>{if(c===m)return!1;for(let h=c;h<m;h++){let w=u.charCodeAt(h);if(w<48||w>57)return!1}return!0},S=(u,c)=>{if(u.deep||c.size<2)return c;let m=new Set;c.forEach(g=>{g.endsWith(nn)&&m.add(g.slice(0,-nn.length))});let h=new Set;if(c.forEach(g=>{let E=0,T="";for(let R=g.indexOf(".");R!==-1;R=g.indexOf(".",R+1)){let k=g.slice(0,R);(!(E>0&&p(g,E,R))||m.has(T))&&h.add(k),T=k,E=R+1}}),!h.size)return c;let w=new Set;return c.forEach(g=>{h.has(g)||w.add(g)}),w},O=u=>{let c=null,m=null,h=null,w=ut,g=N=>h?h.has(N):c===N,E=N=>{let K=a(N,u);h?h.set(N,K):c===null?(c=N,m=K):(h=new Map([[c,m],[N,K]]),c=m=null)},T=N=>{if(h){h.forEach((K,F)=>{N.has(F)||(l(K,u),h.delete(F))});return}c!==null&&!N.has(c)&&(l(m,u),c=m=null)},R=()=>{h?h.forEach(N=>l(N,u)):m&&l(m,u),h=null,c=m=null},k=N=>{if(N.size===w.size){let F=!0;if(N.forEach(he=>{F&&(F=w.has(he))}),F)return}w=N;let K=S(u,N);T(K),K.forEach(F=>{g(F)||E(F)})};return u.reindex.add(k),k(u.deps),()=>{u.reindex.delete(k),R(),w=ut}},I=u=>{let c=f(u);if(c){let m=new Set;$e(c,h=>m.add(h)),Me(c,h=>m.add(h)),j(m)}},z=u=>I(dt(u)),j=u=>{let c=Array.from(u),m=!0;for(let h=1;m&&h<c.length;h++)m=c[h-1].order<c[h].order;m||c.sort((h,w)=>h.order-w.order),c.forEach(h=>{s.has(h)&&h.run()})},b=(u,c,m=!1)=>{t.get(u)?.forEach(h=>h(c,u)),n.forEach(h=>h(u,c)),m?s.forEach(h=>h.run()):j(d(u))},H=(u,c)=>u!==c&&u!==null&&c!==null&&typeof u=="object"&&typeof c=="object"&&!ge(u)&&!ge(c)&&He(u)&&He(c)&&Array.isArray(u)===Array.isArray(c),D=null,L=-1,U=(u,c)=>{let m=c.length>u.length,h=m?u:c,w=m?c:u,g=0;for(;g<h.length&&Object.is(V(h[g]),V(w[g]));)g++;for(let E=g;E<h.length;E++)if(!Object.is(V(h[E]),V(w[E+1])))return L;return g},se=(u,c)=>{if(Array.isArray(c)){let T=u.length,R=c.length,k=T!==R;if(!T||!R)return D;let N=Math.max(T,R);if(Math.abs(T-R)===1){let F=U(u,c);if(F!==L){let he=[];for(let lt=F;lt<N;lt++)he.push(String(lt));return{keys:he,exact:!0,keysChanged:k}}}let K=[];for(let F=0;F<N;F++)if(!Object.is(V(u[F]),V(c[F]))&&(K.push(String(F)),K.length*2>=N))return D;return{keys:K,exact:!1,keysChanged:k}}let m=Object.keys(u),h=Object.keys(c),w=new Set([...m,...h]);if(!w.size)return D;let g=[];w.forEach(T=>{Object.is(V(u[T]),V(c[T]))||g.push(T)});let E=m.length!==h.length||m.some((T,R)=>T!==h[R]);return g.length*2>=w.size?D:{keys:g,exact:!1,keysChanged:E}},v=(u,c,m,h)=>{let w=new Set,g=T=>{let R=f(T);R&&($e(R,k=>w.add(k)),Me(R,k=>w.add(k)))},E=se(c,m);if(!E)return b(u,h);if(t.get(u)?.forEach(T=>T(h,u)),n.forEach(T=>T(u,h)),g(u),E.keys.forEach(T=>{let R=`${u}.${T}`,k=t.get(R);if(k){let N=V(m[T]),K=A(N)?G(N,R):N;k.forEach(F=>F(K,R))}E.exact?g(R):d(R).forEach(N=>w.add(N))}),E.keysChanged&&g(dt(u)),Array.isArray(m)&&c.length!==m.length){let T=`${u}.length`;t.get(T)?.forEach(R=>R(m.length,T)),g(T)}j(w)},A=u=>u!==null&&typeof u=="object"&&He(u),x=new Map,q=(u,c)=>{let m=x.get(c);m?.store!==u&&(m?.unsubscribe(),x.set(c,{store:u,unsubscribe:u.$onAny((h,w)=>b(`${c}.${h}`,w))}))},J=u=>{x.get(u)?.unsubscribe(),x.delete(u)},G=(u,c)=>{let m=r.get(u);if(m)return m;let h=null,w=new Proxy(u,{has(g,E){return Reflect.has(g,E)||typeof E=="string"&&h?.has(E)===!0},ownKeys(g){return ue[ue.length-1]?.add(dt(c)),Y!==null&&Y.home!==s&&W(Y),Reflect.ownKeys(g)},get(g,E,T){if(E===ft)return g;if(E===cn)return c==="";if(typeof E!="string")return Reflect.get(g,E,T);if(c===""&&E in i)return i[E];let R=c?`${c}.${E}`:E;ue[ue.length-1]?.add(R),Y!==null&&Y.home!==s&&W(Y);let k=Reflect.get(g,E,T);if(ge(k))return q(k,R),k;let N=V(k);return A(N)?G(N,R):N},set(g,E,T,R){if(R!==w&&!Object.prototype.hasOwnProperty.call(g,E))return Reflect.set(g,E,T,R);let k=c?`${c}.${E}`:E,N=ge(T)?T:V(T),K=!Object.prototype.hasOwnProperty.call(g,E);if(!K&&Object.is(g[E],N)&&(N===null||typeof N!="object"))return!0;let F=g[E];g[E]=N,h?.delete(E),ge(N)?q(N,k):J(k);let he=ge(N)||!A(N)?N:G(N,k);return!K&&H(F,N)?v(k,F,N,he):b(k,he,K),!0},deleteProperty(g,E){if(typeof E!="string")return Reflect.deleteProperty(g,E);let T=Object.prototype.hasOwnProperty.call(g,E),R=Reflect.deleteProperty(g,E);if(R&&T){let k=c?`${c}.${E}`:E;(h??(h=new Set)).add(E),J(k),b(k,void 0),z(c)}return R}});return r.set(u,w),w},Z=G(V(e),"");Object.entries(V(e)).forEach(([u,c])=>{ge(c)&&q(c,u)});let y=(u,c,{immediate:m=!1}={})=>(t.has(u)||t.set(u,new Set),t.get(u).add(c),m&&c(Js(Z,u),u),()=>t.get(u)?.delete(c)),P=(u,{immediate:c=!1}={})=>(n.add(u),c&&ln(Z,"",(m,h)=>u(m,h)),()=>n.delete(u)),C=(u,{deep:c=!1,alsoWakenBy:m}={})=>{let h=!1,w=!1,g={deps:ut,reindex:new Set,deep:c,order:ir++,home:s,adopted:null,read:null,run:()=>{if(h){w=!0;return}h=!0;try{let R=0;do{w=!1,g.read=null;let k=new Set;ue.push(k);let N=Y;Y=g;try{u()}finally{ue.pop(),Y=N,g.deps=k}}while(w&&++R<100);w&&console.error("jq79: an effect re-woke itself 100 times in a row (it writes what it reads); giving up on it settling")}finally{h=!1,g.adopted&&or(g),g.reindex.forEach(R=>R(g.deps))}}};s.add(g);let E=O(g),T=()=>{s.delete(g),E(),rn(g)};return m?.length?Q(g,m,T):(g.run(),pt=g,T)},Q=(u,c,m)=>{let h=c.map(w=>w?.[on]?.(u)).filter(Boolean);return u.run(),pt=u,()=>{m(),h.forEach(w=>w())}},$=u=>{s.add(u);let c=O(u);return()=>{s.delete(u),c()}},W=u=>{(u.read??(u.read=new Set)).add(s),!(u.adopted?.has(s)||s.has(u))&&(u.adopted??(u.adopted=new Map)).set(s,$(u))},B=()=>{x.forEach(({unsubscribe:u})=>u()),x.clear(),s.forEach(u=>{u.home===s&&rn(u)})};return i.$on=y,i.$onAny=P,i.$effect=C,i.$dispose=B,i[on]=$,i[an]=u=>s.has(u),Z},ht=class{constructor(t,n){M(this,"scope",t);M(this,"disposers",null);M(this,"runs",null);M(this,"children",null);M(this,"owners",null);M(this,"options");let s=t[We];this.options=n||s?{deep:n,alsoWakenBy:s}:void 0,this.ownedBy(t)}ownedBy(t){let n=t[gt];!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(pt)}onDispose(t){(this.disposers??(this.disposers=[])).push(t)}refresh(){this.runs?.forEach(t=>t.run())}rerun(){let t=this.runs?[...this.runs]:null,n=this.children?[...this.children]:null;t?.forEach(s=>{this.runs&&s.run()}),n?.forEach(s=>s.rerun())}dispose(){let t=this.disposers;if(this.disposers=null,this.runs=null,this.children=null,this.owners?.forEach(n=>n.children?.delete(this)),this.owners=null,t)for(let n=0;n<t.length;n++)t[n]()}},me=(e,t=!1)=>new ht(e,t),Fe=e=>{let t=xe({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 dn=/(?:let|var|const)(?:\s+(?=[A-Za-z_$])|\s*(?=[{[]))/y,un=/\$:\s*/y,Be=/import(?=\s*\()/y,fn=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,re=(e,t)=>{let n=e[t],s=t+1;for(;s<e.length;){if(e[s]==="\\"){s+=2;continue}if(e[s]===n)return s+1;s++}return e.length},ee=(e,t)=>{let n=e.indexOf(`
|
|
2
|
+
`,t);return n===-1?e.length:n},te=(e,t)=>{let n=e.indexOf("*/",t+2);return n===-1?e.length:n+2},Ue=(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},ar=new Set(["return","typeof","case","in","instanceof","new","delete","void","do","else","yield","await"]),oe=(e,t)=>{let n=t-1;for(;n>=0;){let r=e[n];if(/\s/.test(r)){n--;continue}if(r==="/"&&e[n-1]==="*"){let i=e.lastIndexOf("/*",n-2);if(i===-1)return!0;n=i-1;continue}break}if(n<0)return!0;let s=e[n];if(/[\w$]/.test(s)){let r=n;for(;r>0&&/[\w$]/.test(e[r-1]);)r--;return ar.has(e.slice(r,n+1))}return(s==="+"||s==="-")&&e[n-1]===s?!1:!")]}\"'`.".includes(s)},ie=(e,t)=>{let n=t+1,s=!1;for(;n<e.length;){let r=e[n];if(r==="\\"){n+=2;continue}if(r===`
|
|
3
|
+
`)return n;if(r==="[")s=!0;else if(r==="]")s=!1;else if(r==="/"&&!s){for(n++;n<e.length&&/[a-z]/i.test(e[n]);)n++;return n}n++}return e.length},lr=/^(\?\.|\?\?|&&|\|\||\*\*|[.,+\-*/%&|^<>=?:([])/,cr=(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""},pn=(e,t)=>{let n=0,s=t;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=re(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=ee(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=te(e,s);continue}if(r==="/"&&oe(e,s)){s=ie(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else{if(n<=0&&r===";")return s;if(n<=0&&r===`
|
|
4
|
+
`){let i=Ue(e,s+1);if(!(i<e.length&&(lr.test(e.slice(i,i+2))||[",","="].includes(cr(e,s)))))return s;s=i;continue}}s++}return e.length},dr=e=>{let t=[],n=0,s=0,r=0,i=a=>{t.push({raw:e.slice(s,a),codeEnd:Math.max(0,r-s)}),s=a+1,r=s},o=0;for(;o<e.length;){let a=e[o];if(a==="'"||a==='"'||a==="`"){o=re(e,o),r=o;continue}if(a==="/"&&e[o+1]==="/"){o=ee(e,o);continue}if(a==="/"&&e[o+1]==="*"){o=te(e,o);continue}if(a==="/"&&oe(e,o)){o=ie(e,o),r=o;continue}if("([{".includes(a))n++;else if(")]}".includes(a))n--;else if(a===","&&n<=0){i(o),o++;continue}/\s/.test(a)||(r=o+1),o++}return i(e.length),t},mt=e=>{let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return ze.test(t)?[t]:[];let n=[];for(let s of Et(t.slice(1,gn(t)))){s.startsWith("...")&&(s=s.slice(3).trim());let r=wt(s);if(r!==-1&&(s=s.slice(0,r).trim()),t.startsWith("{")){let i=yt(s,":");if(i!==-1){n.push(...mt(s.slice(i+1)));continue}}n.push(...mt(s))}return n},ur=e=>{let t=[],n=dr(e).map(({raw:i,codeEnd:o})=>{let a=i.match(/^\s*/)[0];if(o<=a.length)return{text:i,empty:!0};let l=i.slice(a.length,o),f=i.slice(o),d=wt(l),p=(d===-1?l:l.slice(0,d)).trim(),S=l[0]==="{"||l[0]==="[";S?t.push(...mt(p)):ze.test(p)&&t.push(p);let O=Ge(l).code;return{text:`${a}${S?`(${O})`:O}${f}`,empty:!1}}),s=[];for(;n.length&&n[n.length-1].empty;)s.unshift(n.pop().text);let r=n.map(i=>i.text).join(",")+s.join("");return r.trimStart().startsWith("(")&&(r=`;${r}`),{vars:t,code:r}},Ge=e=>{let t=[],n="",s=0,r=0,i=!0;for(;s<e.length;){let o=e[s],a=e[s+1];if(o==="'"||o==='"'||o==="`"){let l=re(e,s);n+=e.slice(s,l),s=l,i=!1;continue}if(o==="/"&&(a==="/"||a==="*")){let l=a==="/"?ee(e,s):te(e,s);n+=e.slice(s,l),s=l;continue}if(o==="/"&&oe(e,s)){let l=ie(e,s);n+=e.slice(s,l),s=l,i=!1;continue}if(o==="i"&&(s===0||!/[\w$.]/.test(e[s-1]))&&(Be.lastIndex=s,Be.test(e))){n+="$__import",s+=6,i=!1;continue}if(r===0&&i){dn.lastIndex=s;let l=dn.exec(e);if(l){let d=s+l[0].length,p=pn(e,d),{vars:S,code:O}=ur(e.slice(d,p));t.push(...S),n+=O,s=p,i=!1;continue}un.lastIndex=s;let f=un.exec(e);if(f){fn.lastIndex=s;let d=fn.exec(e);d&&t.push(d[1]);let p=s+f[0].length,S=pn(e,p);n+=`$__effect(() => { ${Ge(e.slice(p,S)).code} });`,s=S;continue}}"([{".includes(o)?r++:")]}".includes(o)&&(r=Math.max(0,r-1)),o===`
|
|
5
|
+
`||o===";"||o==="}"?i=!0:/\s/.test(o)||(i=!1),n+=o,s++}return{vars:t,code:n}},Ke=/export\s+default(?![\w$])/y,hn=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,fr=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},pr=(e,t,n)=>{let s=`await $__import(${JSON.stringify(t)})`;if(e===void 0)return s;let r=fr(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(", ")}`},ze=/^[A-Za-z_$][\w$]*$/,gn=e=>{let t=0,n=0;for(;n<e.length;){let s=e[n];if(s==="'"||s==='"'||s==="`"){n=re(e,n);continue}if(s==="/"&&e[n+1]==="/"){n=ee(e,n);continue}if(s==="/"&&e[n+1]==="*"){n=te(e,n);continue}if(s==="/"&&oe(e,n)){n=ie(e,n);continue}if("([{".includes(s))t++;else if(")]}".includes(s)&&--t===0)return n;n++}return e.length},yt=(e,t)=>{let n=0,s=0;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=re(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=ee(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=te(e,s);continue}if(r==="/"&&r!==t&&oe(e,s)){s=ie(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else if(n===0&&r===t)return s;s++}return-1},Et=e=>{let t=[],n=0,s=0,r=0;for(;r<=e.length;){let i=e[r];if(i==="'"||i==='"'||i==="`"){r=re(e,r);continue}if(i==="/"&&e[r+1]==="/"){r=ee(e,r);continue}if(i==="/"&&e[r+1]==="*"){r=te(e,r);continue}if(i==="/"&&oe(e,r)){r=ie(e,r);continue}if(i!==void 0&&"([{".includes(i))n++;else if(i!==void 0&&")]}".includes(i))n--;else if(r===e.length||i===","&&n===0){let o=e.slice(s,r).trim();o&&t.push(o),s=r+1}r++}return t},wt=e=>{let t=0;for(;t<e.length;){let n=yt(e.slice(t),"=");if(n===-1)return-1;let s=t+n;if(e[s+1]!=="="&&e[s+1]!==">"&&e[s-1]!=="="&&e[s-1]!=="!")return s;t=s+1}return-1},Ae=e=>{let t=(e??"").trim();if(!t.startsWith("{"))return null;let n=gn(t);if(n>=t.length)return null;let s=[];for(let r of Et(t.slice(1,n))){if(r.startsWith("..."))continue;let i=wt(r),o=i===-1?r:r.slice(0,i),a=i===-1?void 0:r.slice(i+1).trim(),l=yt(o,":"),f=(l===-1?o:o.slice(0,l)).trim();if(!ze.test(f))continue;let d={name:f};a!==void 0&&(d.default=a);let p=l===-1?"":o.slice(l+1).trim();ze.test(p)&&(d.as=p),s.push(d)}return s},hr=e=>{let t=0,n=0,s=!0;for(;t<e.length;){let r=e[t];if(r==="'"||r==='"'||r==="`"){t=re(e,t),s=!1;continue}if(r==="/"&&e[t+1]==="/"){t=ee(e,t);continue}if(r==="/"&&e[t+1]==="*"){t=te(e,t);continue}if(r==="/"&&oe(e,t)){t=ie(e,t),s=!1;continue}if(r==="e"&&n===0&&s&&(t===0||!/[\w$.]/.test(e[t-1]))){Ke.lastIndex=t;let i=Ke.exec(e);if(i)return t+i[0].length}"([{".includes(r)?n++:")]}".includes(r)&&(n=Math.max(0,n-1)),r===`
|
|
6
|
+
`||r===";"||r==="}"?s=!0:/\s/.test(r)||(s=!1),t++}return-1},gr=/^async(?![\w$])/,mr=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,yr=e=>{let t=hr(e);if(t===-1)return null;let n=Ue(e,t),s=e.slice(n);gr.test(s)&&(n=Ue(e,n+5));let r=mr.exec(e.slice(n));if(r&&(n=Ue(e,n+r[0].length)),e[n]!=="(")return null;let i=0,o=n;for(;o<e.length;){let a=e[o];if(a==="'"||a==='"'||a==="`"){o=re(e,o);continue}if(a==="/"&&e[o+1]==="/"){o=ee(e,o);continue}if(a==="/"&&e[o+1]==="*"){o=te(e,o);continue}if(a==="/"&&oe(e,o)){o=ie(e,o);continue}if("([{".includes(a))i++;else if(")]}".includes(a)&&--i===0)break;o++}return Et(e.slice(n+1,o))[0]??""},ke=e=>{let t=yr(e);if(t===null)return null;let n=Ae(t),s=n?.find(r=>r.name.startsWith("$"))?.name;if(s)throw new Error(`jq79: the factory signature is (props, ctx), so \`${s}\` can't be destructured from the first parameter. Write \`export default (props, { ${s} }) => \u2026\`, or \`_\` in place of props if the component takes none.`);return n},mn=e=>{let t="",n=0,s=0,r=!0,i=!1,o=0;for(;n<e.length;){let a=e[n],l=e[n+1],f=n===0||!/[\w$.]/.test(e[n-1]);if(a==="'"||a==='"'||a==="`"){let d=re(e,n);t+=e.slice(n,d),n=d,r=!1;continue}if(a==="/"&&(l==="/"||l==="*")){let d=l==="/"?ee(e,n):te(e,n);t+=e.slice(n,d),n=d;continue}if(a==="/"&&oe(e,n)){let d=ie(e,n);t+=e.slice(n,d),n=d,r=!1;continue}if(a==="i"&&f){if(Be.lastIndex=n,Be.test(e)){t+="$__import",n+=6,r=!1;continue}if(s===0&&r){hn.lastIndex=n;let d=hn.exec(e);if(d){t+=pr(d[1],d[3],o++),n+=d[0].length,r=!1;continue}}}if(a==="e"&&f&&s===0&&r){Ke.lastIndex=n;let d=Ke.exec(e);if(d){i=!0,t+="$__exports.default =",n+=d[0].length,r=!1;continue}}"([{".includes(a)?s++:")]}".includes(a)&&(s=Math.max(0,s-1)),a===`
|
|
7
|
+
`||a===";"||a==="}"?r=!0:/\s/.test(a)||(r=!1),t+=a,n++}return i?t:null},Er=new Set(["true","false","null","undefined","this","typeof","instanceof","in","new","void","delete","of","await","yield","NaN","Infinity","arguments","case","do","else","return"]),wr=new Set(["function","class","let","const","var","eval","with"]),Sr=new Set(["$scope","$r","$t"]),br=/^(?:\+\+|--|=>|\*\*=|<<=|>>>=|>>=|&&=|\|\|=|\?\?=|[+\-*/%&|^]=(?!=))/,Tr=/^(?:>>>|===|!==|\*\*|<<|>>|==|!=|<=|>=|&&|\|\||\?\?|\?\.)/,$r=e=>/[A-Za-z_$]/.test(e),Rr=/^(?: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 a=e[o];if(/\s/.test(a)){o++;continue}if(a==="/"&&e[o+1]==="/"){o=ee(e,o);continue}if(a==="/"&&e[o+1]==="*"){o=te(e,o);continue}if(a==="/"&&oe(e,o)){o=ie(e,o),i="value";continue}if(a==='"'||a==="'"){o=re(e,o),i="value";continue}if(a==="`"){let d=o+1;for(;d<e.length;){if(e[d]==="\\"){d+=2;continue}if(e[d]==="`"){d++;break}if(e[d]==="$"&&e[d+1]==="{"){let p=1,S=d+=2;for(;d<e.length&&p>0;)e[d]==="{"?p++:e[d]==="}"&&p--,d++;let O=St(e.slice(S,d-1));if(O===null)return null;O.forEach(I=>t.add(I));continue}d++}o=d,i="value";continue}if(/\d/.test(a)&&i!=="."&&i!=="?."){let d=Rr.exec(e.slice(o));o+=d?d[0].length:1,i="value";continue}if($r(a)){let d=o;for(;d<e.length&&/[\w$]/.test(e[d]);)d++;let p=e.slice(o,d);if(o=d,wr.has(p))return null;if(i==="."||i==="?."){i="value";continue}if(Er.has(p)){i=p==="this"?"value":"op";continue}if(Sr.has(p))return null;let S=o;for(;S<e.length&&/\s/.test(e[S]);)S++;if(e[S]==="(")return null;e[S]===":"&&e[S+1]!==":"&&s[s.length-1]==="{"&&n[n.length-1]===0||t.add(p),i="value";continue}let l=e.slice(o);if(br.test(l))return null;let f=Tr.exec(l);if(f){(f[0]==="&&"||f[0]==="||"||f[0]==="??")&&(r=!0),i=f[0]==="?."?"?.":"op",o+=f[0].length;continue}if(a==="=")return null;a==="("||a==="["||a==="{"?(s.push(a),n.push(0)):a===")"||a==="]"||a==="}"?(s.pop(),n.length>1&&n.pop()):a==="?"?(n[n.length-1]++,r=!0):a===":"&&n[n.length-1]>0&&n[n.length-1]--,i=a,o++}return r&&t.size>1?null:[...t]};var ae=e=>e.replace(/-(\w)/g,(t,n)=>n.toUpperCase()),Ve=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),xr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Nr=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,Tt=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,vr=e=>e.split(Tt).map((t,n)=>n%2===1?t:t.replace(Nr,(s,r,i)=>xr.has(r.toLowerCase())?s:`<${r}${i}></${r}>`)).join(""),En=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,Pr=/"[^"]*"|'[^']*'|(^|\s)\.\.\.([A-Za-z_$][\w$.]*)/g,Cr=e=>e.split(Tt).map((t,n)=>n%2===1?t:t.replace(En,(s,r,i)=>{let o=0,a=i.replace(Pr,(l,f,d)=>d===void 0?l:`${f}:props.${o++}="${d}"`);return`<${r}${a}>`})).join(""),Mr=/"[^"]*"|'[^']*'|(^|\s)(:[\w.$-]+)/g,Ar=/<\/slot\.([\w.$-]+)(\s*)>/gi,kr=/^slot\./i,Or=e=>kr.test(e)?`slot.${Ve(e.slice(5))}`:e,Oe=":jq79-component",wn=/^[A-Z]/,_r="c79-",_e=e=>`${_r}${Ve(e[0].toLowerCase()+e.slice(1))}`,jr=e=>wn.test(e)?_e(e):Or(e),Lr=/<\/([A-Z][\w.-]*)(\s*)>/g,Dr=/\/\s*$/,Ir=(e,t)=>{if(!wn.test(e))return t;let n=` ${Oe}="${e}"`,s=Dr.exec(t);return s?`${t.slice(0,s.index)}${n}${s[0]}`:`${t}${n}`},qr=e=>e.split(Tt).map((t,n)=>n%2===1?t:t.replace(En,(s,r,i)=>{let o=i.replace(Mr,(a,l,f)=>f===void 0?a:`${l}${Ve(f)}`);return`<${jr(r)}${Ir(r,o)}>`}).replace(Ar,(s,r,i)=>`</slot.${Ve(r)}${i}>`).replace(Lr,(s,r,i)=>`</${_e(r)}${i}>`)).join(""),Sn=e=>vr(Cr(qr(e))),bn=/^[A-Z][A-Za-z0-9]*$/,bt=/{{\s*([\s\S]+?)\s*}}/g,yn=new Map,$t=e=>{let t=yn.get(e);if(t)return t;let n=[],s=0;bt.lastIndex=0;for(let r=bt.exec(e);r;r=bt.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)),yn.set(e,n),n},Rt=new Set([":class",":value",":checked",":selected",":if",":elseif",":else",":each",":key",":with",":text",":html",":html.allowed",":props"]),ye=e=>Rt.has(e)||e.startsWith(":class.")||e.startsWith(":props.")||e===":slot"||e.startsWith(":slot."),Tn=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,Ze=e=>e==="slot"||e.startsWith("slot."),xt=e=>e?ae(e):"default",Nt=e=>`${e}
|
|
8
|
+
= $value`,vt=["$scope","$r"],$n=e=>`with ($scope) { return (${e}
|
|
9
|
+
); }`,Rn=(e,t)=>{let n=St(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
10
|
);`},Qe=(e,t)=>`${e.join(",")}
|
|
11
|
-
${t}`,
|
|
11
|
+
${t}`,Pt=e=>`await $mounted();${e}`,xn=e=>["$scope","$__effect","$__import","$__state",...e],Nn=e=>`return (async () => { with ($scope) { ${e} }
|
|
12
12
|
;$__state.done = true })()`,vn=e=>["$__exports","$__default","$__import",...e],Pn=e=>`return (async () => { "use strict";
|
|
13
13
|
${e}
|
|
14
|
-
;$__exports.done = true })()`,Cn=e=>{let t=e.attrs[":setup"];return t===void 0?null:t.trim()===""?[]:
|
|
14
|
+
;$__exports.done = true })()`,Cn=e=>{let t=e.attrs[":setup"];return t===void 0?null:t.trim()===""?[]:Ae(t)},Mn=(e,t)=>{let n=new Set;return e.forEach(s=>{(ke(s.content)??t(s))?.forEach(({name:i})=>n.add(i))}),n};var An="__jq79precompiled",kn="jq79-precompiled",On=(e,t)=>`function anonymous(${e.join(",")}
|
|
15
15
|
) {
|
|
16
16
|
${t}
|
|
17
|
-
}`;var $i={};var qr="0.7.8",ns=e=>Object.fromEntries(Array.from(e.attributes).map(t=>[t.name,t.value])),ss="http://www.w3.org/1999/xhtml",rs=e=>{let t=ns(e),n=e.namespaceURI,s=t[Oe];delete t[Oe];let r=n!==null&&n!==ss;return{tag:r?e.tagName:e.tagName.toLowerCase(),attrs:t,...s===void 0?{}:{component:s},...r?{ns:n}:{},children:Array.from((e instanceof HTMLTemplateElement?e.content:e).childNodes).flatMap(i=>{if(i.nodeType===Node.TEXT_NODE){let o=i.textContent??"";return o?[o]:[]}return i.nodeType===Node.ELEMENT_NODE?[rs(i)]:[]})}},Je=new Map,Ye=new Map,Ut=!1,jt,Pe=class extends Error{constructor(n,s){super(`${n}. ${s}`);k(this,"reason",n);k(this,"hint",s)}},Hr=()=>new Pe("was not precompiled","Safe mode never builds code at runtime: the component's precompiled functions did not reach the page."),Wr=(e,t)=>{let n=globalThis[kn];if(Array.isArray(n)&&n.length>0)for(let[s,r,i]of n.splice(0))Ye.set(Qe(s,r),i);return Ye.size===0?void 0:Ye.get(Qe(e,t))},Bt=(e,t,n="")=>{let s=Wr(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(jt!==void 0)return Fr(e,t,n,jt);if(Ut)throw Hr();return new Function(...e,t+n)},os=()=>{if(!(typeof document>"u"))for(let e of Array.from(document.querySelectorAll("script[nonce]"))){let t=e.nonce||e.getAttribute("nonce");if(t)return t}},_n="__jq79built",Fr=(e,t,n,s)=>{let r=document.createElement("script");r.setAttribute("nonce",s),r.textContent=`document.currentScript.${_n} = ${On(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[_n];if(typeof a=="function")return Ye.set(Qe(e,t),a),a;throw i!==void 0?i:new Pe("could not be built","The page's CSP refused a <script> carrying the nonce jq79 read from the page.")},jn=new Set,Ur=(e,t)=>{jn.has(e)||(jn.add(e),console.error(`jq79: safeEval() is on, and "${e}" ${t.reason}, so it rendered as nothing. ${t.hint}`))},Pt=(e,t)=>{if(!(t in e)){if(t in globalThis)return globalThis[t];throw new ReferenceError(`${t} is not defined`)}},is=(e,t)=>{try{return Bt([...Nt,...t],$n(e))}catch(n){return n instanceof Pe&&Ur(e,n),null}},Br=(e,t)=>{if(!le.scopedNames)return null;let n=Rn(e,t);if(n===null)return null;try{return Bt([...Nt,...t],n)}catch{return null}},as=(e,t,n)=>{let s=Je.get(e);if(s===void 0){let r=Br(t,n);s=r?{fn:r,scoped:!0}:{fn:is(t,n),scoped:!1},Je.set(e,s)}return s},ls=(e,t)=>`${t.join(",")}|${e}`,Kr=(e,t)=>as(ls(e,t),e,t).fn,zr=(e,t,n)=>{let s=is(t,n);return Je.set(e,{fn:s,scoped:!1}),s},Gr=/^(?:([\w$]+) is not defined|Can't find variable: ([\w$]+))/,Vr=100,we=new Map,Kt=new Set,et=0,Lt=!1,Dt=new Set,Zr=()=>{Lt=!1,!(et>0)&&(we.forEach(({name:e,expr:t,scope:n},s)=>{e in n||(Kt.add(s),console.warn(`jq79: ${e} is not defined - evaluating "${t}". Template expressions resolve against the component store: a top-level let/var/const in a :setup script, a declared prop, or a global. Note a "function name() {}" declaration is not on the store - write "const name = () => {}".`))}),we.clear())},cs=()=>{Lt||et>0||!we.size||(Lt=!0,queueMicrotask(Zr))},ds=e=>{et++;let t=()=>{et--,cs()};e.then(t,t)},Qr=(e,t)=>{if(Dt.has(e))return;Dt.add(e);let n=t?.message||String(t);console.error(`jq79: ${n} - evaluating "${e}". The expression rendered as nothing. If the value arrives later, guard it - "a?.b", or :if on the element.`)},us=(e,t,n)=>{if(!(n instanceof ReferenceError))return Qr(e,n);let s=Gr.exec(n.message),r=s?.[1]??s?.[2];if(!r)return;let i=`${r}|${e}`;Kt.has(i)||we.has(i)||we.size>=Vr||(we.set(i,{name:r,expr:e,scope:t}),cs())},fs=(e,t,n)=>{let s=n?Object.keys(n):[],r=ls(e,s),{fn:i,scoped:o}=as(r,e,s);if(!i)return;let a=n?Object.values(n):[];if(!o)return i(t,Pt,...a);try{return i(t,Pt,...a)}catch(l){if(!(l instanceof ReferenceError))throw l;let f=zr(r,e,s);if(!f)throw l;return f(t,Pt,...a)}},_=(e,t,n)=>{try{return fs(e,t,n)}catch(s){us(e,t,s);return}},ps=(e,t,n)=>{try{return fs(e,t,n)}catch(s){if(!(s instanceof ReferenceError))throw s;us(e,t,s);return}},hs=(e,t)=>{if(e.length===1){let s=e[0];return typeof s=="string"?s:String(_(s.expr,t)??"")}let n="";for(let s of e)n+=typeof s=="string"?s:String(_(s.expr,t)??"");return n},gs=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i);e.addEventListener(r,a=>{if(o.has("self")&&a.target!==e)return;o.has("prevent")&&a.preventDefault(),o.has("stop")&&a.stopPropagation();let l=ps(n,s,{$event:a});typeof l=="function"&&l.call(e,a)},{once:o.has("once"),capture:o.has("capture")})},Xr=(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),Re(()=>{let f=ps(n,s,{$event:l});typeof f=="function"&&f(l)})};e.on(r,a)},zt=e=>e instanceof DocumentFragment?{first:e.firstChild,last:e.lastChild}:{first:e,last:e},it=({first:e,last:t})=>{for(let n=e;n;){let s=n===t?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},Yr=e=>{e.forEach(t=>{if(t.first===t.last)return it(t);if(!t.first.parentNode)return;let s=document.createRange();s.setStartBefore(t.first),s.setEndAfter(t.last),s.deleteContents()})},Jr=(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},eo=({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}},Ln=(e,t)=>{let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s))for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r;return null},Ee=null,tt=null,ms=new WeakSet,to=e=>{let t={memo:Ee,base:tt};return Ee=new Map,tt=e,t},no=e=>{Ee=e.memo,tt=e.base},Dn=(e,t)=>e.component!==void 0?In(t,e.component):e.tag.includes("-")?In(t,e.tag):null,X=e=>e.component??e.tag,In=(e,t)=>{if(!Ee)return Ln(e,t);let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s)){if(s===tt){if(Ee.has(t))return Ee.get(t);let r=Ln(s,t);return Ee.set(t,r),r}if(!ms.has(s)){for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r}}return null},so=e=>{let t=new Set;for(let n=e;n&&n!==Object.prototype;n=Object.getPrototypeOf(n))for(let s of Object.keys(n))/^[A-Z]/.test(s)&&t.add(s);return[...t].sort()},ro=(e,t)=>{let n=so(t);return new Error(`jq79: <${e}> is not defined - no component of that name is in scope, and nothing renders here. Import it in a :setup script, declare it as a prop, or add a <template name="${e}"> to this file. In scope: ${n.length?n.join(", "):"(none)"}.`)},qn=100,Ct=0,ys=Symbol("jq79.slots"),Le=e=>Object.keys(e.attrs).find(t=>t===":slot"||t.startsWith(":slot.")),oo=e=>e==="default"?":slot":`:slot.${e}`,io=e=>typeof e!="string"||e.trim()!=="",ao=e=>{let t={},n=[];e.children.forEach(r=>{let i=typeof r=="object"&&r.tag==="template"?Le(r):void 0;if(typeof r=="string"||i===void 0){n.push(r);return}let o=Rt(i.slice(6));if(o in t){console.warn(`jq79: two <template ${oo(o)}> in <${X(e)}>; the second was ignored`);return}t[o]={nodes:r.children,binder:r.attrs[i]||void 0}});let s=n.some(io);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},lo=(e,t,n)=>{ke(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`)})})},co=e=>{let t=Le(e);return console.warn(`jq79: <template ${t}> fills a slot only as a direct child of a component tag; here it rendered nothing`),document.createComment(`misplaced ${t}`)},uo=(e,t)=>{let n=Object.entries(ao(e));if(!n.length)return null;let s={};return n.forEach(([r,i])=>{s[r]=fo(i,t)}),s},fo=(e,t)=>(n,s,r,i)=>{let o=Object.create(t);lo(o,e.binder,n);let a=o[We]??[];Object.defineProperty(o,We,{value:[...a,s]});let l=me(o);return l.ownedBy(s),r.onDispose(()=>l.dispose()),be(e.nodes,o,l,i)},po=(e,t,n,s)=>{let r=Rt(e.tag.slice(5)),i=document.createDocumentFragment(),o=document.createComment(e.tag),a=document.createComment(`/${e.tag}`);i.append(o,a);let l=t[ys]?.[r];if(!l)return i.insertBefore(be(e.children,t,n,s),a),i;let f={};return Object.entries(e.attrs).forEach(([u,h])=>{if(!(u===Ce||ye(u)||u.startsWith("@")))if(u.startsWith(":")){let w=h||u.slice(1);f[ie(u.slice(1))]=()=>_(w,t)}else f[ie(u)]=()=>h}),i.insertBefore(l(f,t,n,s),a),i},Es="data-c79-box",ho=(e,t,n)=>{if(t.ns!==void 0)return document.createDocumentFragment();let s=document.createElement(_e(e));s.setAttribute(Es,"");let r=t.attrs[Ce];return r!==void 0&&s.setAttribute(Ce,r),n||ti(),s},Hn=new WeakSet,go=(e,t)=>{if(e.ns===void 0||Hn.has(e))return;let n=t.template.find(r=>typeof r=="object");if(n===void 0||n.ns!==void 0)return;Hn.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}`)},Wn=(e,t,n,s,r)=>{let i=ho(e,t,r),o=!(i instanceof DocumentFragment),a=o?null:document.createComment(`/${e}`);o||i.append(document.createComment(e),a);let l=uo(t,n),f={},u={},h=[],w=[],O=!1;Object.entries(t.attrs).forEach(([v,P])=>{if(v!==Ce){if(v===":props"||v.startsWith(":props.")){O=!0,w.push({expr:P});return}if(!ye(v))if(v.startsWith("@"))h.push([v,P]);else if(v===":model"||v.startsWith(":model.")){let x=v===":model"?"default":ie(v.slice(7));u[x]=P||(v===":model"?"model":x)}else if(v.startsWith(":")){let x=ie(v.slice(1));f[x]=P||x,w.push({name:x,expr:P||x})}else{let x=ie(v),W=JSON.stringify(P);f[x]=W,w.push({name:x,expr:W})}}});let I=v=>v==="default"?":model":`:model.${v}`,G=v=>v==="default"?"model":v,j=new Set;Object.entries(u).forEach(([v,P])=>{let x=G(v);f[x]!==void 0&&console.warn(`jq79: <${X(t)}> binds prop "${x}" through both :${x} and ${I(v)} - ${I(v)} wins`),f[x]=P,Kr(xt(P),["$value"])===null&&(j.add(v),console.warn(`jq79: ${I(v)}="${P}" is not assignable - updates from <${X(t)}> will be dropped`))});let b=()=>{let v={};return w.forEach(({name:P,expr:x})=>{if(P!==void 0)v[P]=_(x,n);else{let W=_(x,n);W!==null&&typeof W=="object"&&Object.assign(v,W)}}),Object.entries(u).forEach(([P,x])=>{v[G(P)]=_(x,n)}),v},H=null,D=null,L=null,B=new Set,ae=v=>{if(v==null){if(!n[Os]?.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),P=v instanceof de?v:null;if(P||ae(v),P===D||(L?.dispose(),L=null,H?.destroy(),H=null,D=P,!P))return;go(t,P);let x=new de({template:P.template,scripts:P.scripts,styles:P.styles,modules:P.modules,filename:P.filename,siblings:P.siblings,name:P.name});if(l&&(x.slots=l),Object.keys(u).length){let M=new Set;x.modelWriteback=(U,Q)=>{let $=U==null?"default":ie(String(U)),q=u[$];return q===void 0?(M.has($)||(M.add($),console.warn(`jq79: <${X(t)}> has no ${I($)} - bound: ${Object.keys(u).map(I).join(", ")}`)),!1):j.has($)?!1:(Re(()=>_(xt(q),n,{$value:Q})),!0)}}h.forEach(([M,U])=>Xr(x,M,U,n));let W=ii(x.scripts);ai(t,e,Object.keys(f),W);let J=Yn(Re(b),W),V=document.createDocumentFragment();if(Ct>=qn){console.error(`jq79: <${X(t)}> is ${qn} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}Ct++;try{(r?x.renderShadow(J):x.render(J)).mount(V)}finally{Ct--}let E=n[rt];E&&x.holdOwner(E.owner),a?a.parentNode.insertBefore(V,a):i.appendChild(V);let C=me(n,!0);if(O){let M=[];C.effect(()=>{let U=Yn(b(),W),Q=Object.keys(U);M.forEach($=>{$ in U||(x.data[$]=void 0)}),Q.forEach($=>{x.data[$]=U[$]}),M=Q})}else Object.entries(f).forEach(([M,U])=>{W!==null&&!W.has(M)||C.effect(()=>{x.data[M]=_(U,n)})});L=C,H=x}),s.onDispose(()=>{L?.dispose(),H?.destroy()}),i},mo=(e,t)=>{let n=()=>{let s=_(e,t);return s!==null&&typeof s=="object"?s:null};return new Proxy(t,{has(s,r){let i=n();return i!==null&&Reflect.has(i,r)||Reflect.has(s,r)},get(s,r){let i=n();return i!==null&&Reflect.has(i,r)?i[r]:Reflect.get(s,r)},set(s,r,i){let o=n();return o!==null&&Reflect.has(o,r)?(o[r]=i,!0):Reflect.set(s,r,i)}})},pe=e=>typeof e=="string"?e.split(/\s+/).filter(Boolean):Array.isArray(e)?e.flatMap(pe):e!==null&&typeof e=="object"?Object.entries(e).flatMap(([t,n])=>n?pe(t):[]):[],yo=e=>typeof e=="function"?(t,n,s)=>{try{return!!e(t,n,s)}catch{return!1}}:typeof e=="string"||Array.isArray(e)?Jt(e):()=>!1,Eo=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),ws=e=>e.ns===void 0?document.createElement(e.tag):document.createElementNS(e.ns,e.tag),wo={"http://www.w3.org/2000/svg":["svg","feGaussianBlur"],"http://www.w3.org/1998/Math/MathML":["math","mi"]},Fn=new Map,So=(e,t)=>{let n=`${e} ${t}`,s=Fn.get(n);if(s!==void 0)return s;let r=wo[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 Fn.set(n,i),i},Ss=(e,t)=>{let n=e.namespaceURI;if(n===null||n===ss)return t;let s=t.replace(/-/g,"").toLowerCase(),r=So(n,s);return r===s?t:r},bs=(e,t,n)=>{let s=Eo.has(t);(s?!n:n==null)?e.removeAttribute(t):e.setAttribute(t,s?"":String(n))},le={cloneSkeletons:!0,scopedNames:!0},bo=new Set([":text",":html",":value",":checked",":selected"]),To=e=>e.startsWith("@")||e===":class"||e.startsWith(":class.")||bo.has(e)?!0:e.startsWith(":")?e===":model"?!1:!ye(e)&&!e.includes("."):e!==Oe,Ts=e=>{if(e.component||e.tag.includes("-")||Ze(e.tag)||e.tag==="template"||e.ns===void 0&&document.createElement(e.tag)instanceof HTMLUnknownElement)return!1;for(let t in e.attrs)if(!To(t))return!1;return e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?!0:e.children.every(t=>typeof t=="string"||Ts(t))},$s=(e,t,n)=>{let s=ws(e),r,i=null;for(let 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(!ye(h))if(h.startsWith(":")){let O=h.slice(1);n.push({kind:"attr",path:t,name:Ss(s,O),expr:w||ie(O)})}else s.setAttribute(h,w)}(r!==void 0||i)&&n.push({kind:"class",path:t,classExpr:r,toggles:i,staticClasses:new Set(pe(e.attrs.class??""))});let o=e.attrs[":text"],a=e.attrs[":html"];o!==void 0?n.push({kind:"textContent",path:t,expr:o}):a!==void 0?n.push({kind:"html",path:t,expr:a}):e.children.forEach((h,w)=>{if(typeof h=="string"){h.includes("{{")?(n.push({kind:"text",path:[...t,w],parts:Tt(h)}),s.appendChild(document.createTextNode(""))):s.appendChild(document.createTextNode(h));return}s.appendChild($s(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},$o=3,Rs=e=>e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?1:1+e.children.reduce((t,n)=>t+(typeof n=="string"?0:Rs(n)),0),Un=new WeakMap,Bn=new WeakSet,Ro=e=>{let t=Un.get(e);if(t!==void 0)return t;if(!Bn.has(e))return Bn.add(e),null;let n=null;if(Ts(e)&&Rs(e)>=$o){let s=[];n={skeleton:$s(e,[],s),ops:s}}return Un.set(e,n),n},xo=(e,t)=>{let n=e;for(let s=0;s<t.length;s++)n=n.childNodes[t[s]];return n},No=(e,t,n)=>{let s=e.skeleton.cloneNode(!0);for(let r of e.ops){let i=r.path.length===0?s:xo(s,r.path);if(r.kind==="text"){let o=i,a=r.parts;n.effect(()=>{let l=hs(a,t);o.textContent!==l&&(o.textContent=l)})}else if(r.kind==="event")gs(i,r.attr,r.expr,t);else if(r.kind==="attr"){let o=i,{name:a,expr:l}=r;n.effect(()=>bs(o,a,_(l,t)))}else if(r.kind==="class"){let o=i,{classExpr:a,toggles:l,staticClasses:f}=r,u=[];n.effect(()=>{let h=a!==void 0?pe(_(a,t)):[];l?.forEach(([w,O])=>{_(O,t)&&h.push(...pe(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=lt(String(_(a,t)??""))})}else if(r.kind==="value"){let o=i,{expr:a}=r;n.effect(()=>{let l=String(_(a,t)??"");o.value!==l&&(o.value=l)})}else if(r.kind==="checked"){let o=i,{expr:a}=r;n.effect(()=>{let l=!!_(a,t);o.checked!==l&&(o.checked=l)})}else if(r.kind==="selected"){let o=i,{expr:a}=r;n.effect(()=>{let l=!!_(a,t);o.selected!==l&&(o.selected=l)})}else{let o=r}}return s},Gt=(e,t,n,s)=>{let r=e.attrs[":with"],i=r!==void 0?mo(r,t):t;if(Ze(e.tag))return po(e,i,n,s);if(e.tag==="template"&&Le(e)!==void 0)return co(e);let o=Dn(e,i);if(o)return Wn(o,e,i,n,s);if(le.cloneSkeletons){let b=Ro(e);if(b)return No(b,i,n)}let a=ws(e);if(e.component!==void 0&&i[rt]?.count===0)throw ro(e.component,i);let l=e.ns===void 0&&(e.component!==void 0||e.tag.includes("-"));if(l){let b=!1;n.effect(()=>{if(b)return;let H=Dn(e,i);if(!H)return;b=!0;let D=Wn(H,e,i,n,s),L=zt(D);n.onDispose(()=>it(L)),a.replaceWith(D)})}for(let b in e.attrs){let H=e.attrs[b];if(b.startsWith("@"))gs(a,b,H,i);else if(b===":model"||b.startsWith(":model."))l||console.warn(`jq79: ${b} on <${X(e)}> does nothing - :model binds component tags only (for now)`);else if(!ye(b))if(b.startsWith(":"))if(l)a.setAttribute(b,H);else{let D=b.slice(1),L=H||ie(D),B=Ss(a,D);n.effect(()=>bs(a,B,_(L,i)))}else a.setAttribute(b,H)}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(pe(e.attrs.class??"")),H=[];n.effect(()=>{let D=f!==void 0?pe(_(f,i)):[];u?.forEach(([L,B])=>{_(B,i)&&D.push(...pe(L))}),H.forEach(L=>{!D.includes(L)&&!b.has(L)&&a.classList.remove(L)}),a.classList.add(...D),H=D})}let 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:yo(_(O,i))}:void 0;a.innerHTML=lt(String(_(w,i)??""),b)}):a instanceof HTMLTemplateElement?be(e.children,i,n,s,a.content):be(e.children,i,n,s,a);let I=e.attrs[":value"];I!==void 0&&n.effect(()=>{let b=String(_(I,i)??"");a.value!==b&&(a.value=b)});let 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},vo=(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&&it(o),o=null,a=f,!f))return;l=me(t);let u=Gt(f.node,t,l,s);o=zt(u),r.parentNode.insertBefore(u,r.nextSibling)}),n.onDispose(()=>l?.dispose()),i},Ne=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})},Po=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},Co=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},xs=(e,t)=>typeof e=="string"?t.some(n=>zn(e,n)):Object.values(e.attrs).some(n=>t.some(s=>zn(n,s)))||e.children.some(n=>xs(n,t)),Ns=e=>typeof e!="string"&&(":if"in e.attrs||":elseif"in e.attrs||":else"in e.attrs||":each"in e.attrs||e.component!==void 0||e.tag.includes("-")||Ze(e.tag)||e.children.some(Ns)),Kn=/[A-Za-z0-9_$]/,Mo=/^[A-Za-z_$][\w$]*\.[A-Za-z_$][\w$]*$/,zn=(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(!Kn.test(s)&&!Kn.test(r))return!0}return!1},Mt=new WeakMap,ko=e=>{let t=Mt.get(e);if(t!==void 0)return t;let n=e.attrs[":each"].match(Tn);if(!n)return Mt.set(e,null),null;let[,s,r,i]=n,o=e.attrs[":key"],a=o===s,l=o!==void 0&&!a&&Mo.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=xs(w,O),G=/^[A-Z]/.test(s)||r!==void 0&&/^[A-Z]/.test(r),j=o!==void 0&&Ns(w),b={itemName:s,atName:r,listExpr:i,keyExpr:o,keyIsItem:a,keyProp:l,itemNode:w,readsPosition:I,namesComponent:G,nestsScopes:j};return Mt.set(e,b),b},Ao=(e,t,n,s)=>{let r=ko(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=[],H=!1;return n.effect(()=>{let D=to(t);try{let L=_(a,t),B=Array.isArray(L),ae=B?null:Co(L)?Object.keys(L):[],v=B?L.length:ae.length,P=new Map;b.forEach(($,q)=>{$.pos=q;let K=P.get($.key);K?K.push($):P.set($.key,[$])});let x=new Set,W=[],J=[],V=[],E=[],C;for(let $=0;$<v;$++){let q=B?$:ae[$],K=B?L[$]:L[q],c=q;f?c=K:u!==void 0&&K!==null&&typeof K=="object"?c=K[u]:l!==void 0&&(C===void 0?(C=Object.create(t),Ne(C,i,K),o&&Ne(C,o,q),Ne(C,"$index",$)):(C[i]=K,o&&(C[o]=q),C.$index=$),c=_(l,C)),x.has(c)&&!H&&(H=!0,console.warn(`jq79: duplicate :key in :each "${e.attrs[":each"]}"; duplicates pair up by position`)),x.add(c);let d=P.get(c)?.shift();if(d&&Object.is(d.item,K)){let m=d.scope;m.$index!==$&&(w&&W.push(d),m.$index=$),o&&m[o]!==q&&(m[o]=q),V.push(d),E.push(d.pos);continue}if(d&&l!==void 0){let m=d.scope;m[i]=K,m.$index!==$&&(m.$index=$),o&&m[o]!==q&&(m[o]=q),d.item=K,J.push(d),V.push(d),E.push(d.pos);continue}d&&(d.fx.dispose(),it(d.range));let g=Object.create(t);Ne(g,i,K),o&&Ne(g,o,q),Ne(g,"$index",$),O||ms.add(g);let p=me(t);I&&Object.defineProperty(g,ht,{value:p});let S=zt(Gt(h,g,p,s));V.push({key:c,item:K,scope:g,fx:p,range:S,pos:$}),E.push(-1)}let M=new Set;P.forEach($=>$.forEach(q=>M.add(q))),M.size&&(M.forEach($=>{$.dead=!0,$.fx.dispose()}),Yr(Jr(b,$=>$.dead===!0)));let U=G,Q=Po(E);V.forEach(($,q)=>{!Q[q]&&U.nextSibling!==$.range.first&&eo($.range,U),U=$.range.last}),W.forEach($=>Re(()=>$.fx.refresh())),J.forEach($=>Re(()=>$.fx.rerun())),b=V}finally{no(D)}}),n.onDispose(()=>b.forEach(D=>D.fx.dispose())),j},vs=(e,t)=>{let n=t;for(;n<e.length&&typeof e[n]=="string"&&!e[n].trim();)n++;return n},kt=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`)},Oo=(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`)},_o=[":if",":elseif",":else",":each"],jo=(e,t)=>{if(e.tag!=="template"||e.ns!==void 0)return;let n=_o.find(s=>s in e.attrs);if(n!==void 0){if(Le(e)!==void 0){if(t?.component===void 0)return;console.warn(`jq79: ${n} on <template ${Le(e)}> is ignored - a slot is filled with its children as written. Put ${n} on the elements inside it, or on the component's tag`);return}console.warn(`jq79: ${n} on a nested <template> shows nothing - a <template>'s children live in its .content and never reach the page. Put ${n} on the elements themselves`)}},Lo=[...$t,":model",":slot"].map(e=>e.slice(1)),Do={":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'},Io=e=>{for(let t in e.attrs){let n=Do[t];n!==void 0&&console.warn(`jq79: ${n}`)}},qo=e=>{if(!(e.component!==void 0||e.tag.includes("-")))for(let t in e.attrs){if(!t.startsWith(":")||ye(t)||t===":model"||t.startsWith(":model."))continue;let n=t.slice(1);if(n.includes(".")){console.warn(`jq79: ${t} is not a directive - it bound an attribute named "${n}". Dotted modifiers belong to an event: if you meant @${n}, that is the spelling`);continue}let s=Lo.find(r=>n!==r&&n.startsWith(r));s!==void 0&&console.warn(`jq79: ${t} is not a directive - it bound an attribute named "${n}". A ":name" jq79 does not recognize binds that attribute (which is what :src and :disabled are). If you meant :${s}, that is the spelling`)}},Ps=(e,t)=>{e.forEach(s=>{typeof s!="string"&&(jo(s,t),Io(s),qo(s),Ps(s.children,s))});let n=!1;for(let s=0;s<e.length;){let r=e[s];if(typeof r=="string"){r.trim()&&(n=!1),s++;continue}if(":each"in r.attrs){n=!1,s++;continue}if(kt(r),":if"in r.attrs){s++;let i=a=>{let l=vs(e,s),f=e[l];if(typeof f=="object"&&a in f.attrs)return s=l+1,f};for(let a=i(":elseif");a;a=i(":elseif"))kt(a);let o=i(":else");o&&kt(o),n=o!==void 0;continue}(":elseif"in r.attrs||":else"in r.attrs)&&Oo(r,n),n=!1,s++}},Gn=new WeakMap,Ho=(e,t,n)=>{let s=Gn.get(t);if(s)return s;let r=[{expr:t.attrs[":if"],node:t}],i=n+1,o=f=>{let u=vs(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 Gn.set(t,l),l},be=(e,t,n,s=!1,r)=>{let i=r??document.createDocumentFragment(),o=0;for(;o<e.length;){let a=e[o];if(typeof a=="string"){let l=document.createTextNode(a);if(a.includes("{{")){let f=Tt(a);n.effect(()=>{let u=hs(f,t);l.textContent!==u&&(l.textContent=u)})}i.appendChild(l),o++;continue}if(":each"in a.attrs){i.appendChild(Ao(a,t,n,s)),o++;continue}if(":if"in a.attrs){let l=Ho(e,a,o);i.appendChild(vo(l.branches,t,n,s)),o=l.next;continue}i.appendChild(Gt(a,t,n,s)),o++}return i},Wo=(e,t,n=!1)=>be(e.template,t,me(t),n),Ce="data-jq79",Fo=e=>{let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return(t>>>0).toString(36)},Cs=(e,t)=>{e.forEach(n=>{typeof n!="string"&&(n.attrs[Ce]=t,Cs(n.children,t))})},Uo=(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(", "),Ms=(e,t)=>{Array.from(e).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=Uo(n.selectorText,t):n instanceof CSSGroupingRule&&Ms(n.cssRules,t)})},Bo=/(^|[\s>+~,(])([A-Z][A-Za-z0-9]*)(?![\w-])/g,Ko=/[a-z]/,zo=e=>e.replace(Bo,(t,n,s)=>Ko.test(s)?`${n}${_e(s)}`:t),Go=/^\s*@(media|supports|container|layer|scope|document)\b/i,Vo=/^\s*@/,Zo=e=>{let t="",n="",s="",r=[],i=()=>r.length===0||r[r.length-1],o=()=>{t+=i()&&!Vo.test(s)?zo(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("{",Go.test(s)),f++):u==="}"||u===";"?(l(u),f++):(n+=u,s+=u,f++)}return o(),t},Qo=(e,t)=>{/:deep\(|::v-deep|>>>/.test(e)&&console.warn("jq79: :deep()/::v-deep/>>> are not supported in <style scoped>; the rule will be dropped by the browser");let n=new CSSStyleSheet;return n.replaceSync(e),Ms(n.cssRules,t),Array.from(n.cssRules).map(s=>s.cssText).join(`
|
|
18
|
-
`)},
|
|
19
|
-
//# sourceURL=${e}?jq79-script=${t}`:"",As=(e,t,n)=>{try{return Bt(e,t,ei(n.filename,n.index??0))}catch(s){throw s instanceof Pe?new Error(`jq79: safeEval() is on, and script ${n.index??0} of ${n.filename??"a component built from a string"} ${s.reason}. ${s.hint}`):s}},Zn=e=>e.scoped??e.content,je=`:where([${Es}]) { display: contents }`,Zt=()=>Ut&&typeof Document<"u"&&"adoptedStyleSheets"in Document.prototype,nt=e=>{let t=new CSSStyleSheet;return t.replaceSync(e),t},Qt=(e,t)=>{e.adoptedStyleSheets.includes(t)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,t])},qt=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(n=>n!==t)},Xe=null,Ht=null,ti=()=>{if(Zt()){Qt(document,Ht??(Ht=nt(je)));return}Xe?.isConnected||(Xe=document.createElement("style"),Xe.textContent=je,document.head.appendChild(Xe))},st=new Map,ni=e=>{let t=st.get(e);if(!t){if(Zt()){let n=nt(e);Qt(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}}st.set(e,t)}t.count++},si=e=>{let t=st.get(e);t&&--t.count<=0&&(t.sheet?qt(document,t.sheet):t.el?.remove(),st.delete(e))},ri=(e,t,n,s={},r=Vt,i={})=>{let o={...Ds,...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=As(xn(Object.keys(o)),Nn(e),i)(a,n,r,l,...Object.values(o));return f.catch(u=>console.error("jq79: error in :setup script",u)),ds(f),{settled:f,sync:l.done===!0}},Qn=(e,t)=>{t?.forEach(({name:n,default:s})=>{e[n]===void 0&&(e[n]=s===void 0?void 0:_(s,e))})},Wt=e=>{let t=Cn(e);return!t&&e.attrs[":setup"]!==void 0&&oi(e,e.attrs[":setup"]),t},Xn=new WeakSet,oi=(e,t)=>{t.trim()==="_"||Xn.has(e)||(Xn.add(e),console.warn(`jq79: :setup="${t}" is not a props pattern, so this component declares no signature and takes whatever a parent passes - write the props it takes ("{ a, b }"), a bare :setup for none, or "_" to stay open on purpose`))},ii=e=>{let t=null;return e.forEach(n=>{let s=Ae(n.content)??Wt(n);if(!s)return;let r=t??(t=new Set);s.forEach(({name:i})=>r.add(i))}),t},Yn=(e,t)=>{if(t===null)return e;let n={};return Object.keys(e).forEach(s=>{t.has(s)&&(n[s]=e[s])}),n},Jn=new WeakMap,ai=(e,t,n,s)=>{if(s===null)return;let r=Jn.get(e)??new Set;Jn.set(e,r),n.forEach(i=>{s.has(i)||r.has(i)||(r.add(i),console.warn(`jq79: :${i} is not declared by <${t}> - add it to the :setup signature, or drop it`))})},li=(e,t)=>{if(!e)return null;let n=Object.create(null),s=!1;return Object.entries(e).forEach(([r,i])=>{t.has(r)||(n[r]=i,s=!0)}),s?n:null},Os=Symbol("jq79.unfilledProps"),rt=Symbol("jq79.pendingScripts"),ci=e=>e&&e.default!==void 0?e.default:e,di=(e,t,n,s={},r=Vt,i={})=>{let o={...Ds,...s},a={},l=As(vn(Object.keys(o)),Pn(e),i)(a,ci,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 ds(O),a.done&&w(),{settled:O,sync:a.done===!0&&h===void 0}},ui="__JQ79_HMR_ENABLED__",fi="__JQ79_HMR__",Se=null,pi=e=>{if(!Se||!e.filename)return;let t=Se.get(e.filename);t||Se.set(e.filename,t=new Set),t.add(new WeakRef(e))},At=e=>{try{return new URL(e,document.baseURI).pathname}catch{return e}},_s=(e,t)=>{if(!Se)return 0;let n=At(e),s=It(t);ne?.forEach((a,l)=>{At(l)===n&&ne.set(l,Promise.resolve(t))});let r=!1,i=a=>a.name===void 0?s:s.siblings?.[a.name]??null,o=0;for(let[a,l]of Se)if(At(a)===n){for(let f of l){let u=f.deref();if(!u){l.delete(f);continue}let h=i(u);if(!h){r=!0;continue}u.hotReplace(h)&&o++}l.size||Se.delete(a)}return r?0:o},js=()=>{Se??(Se=new Map),globalThis[fi]={update:_s}},es=3e3,hi=(e,t)=>{let n=setTimeout(()=>{console.warn(`jq79: ${e.name?`<${e.name}>`:"a component"}${e.filename?` (${e.filename})`:""} has been waiting ${es/1e3}s for a :setup script and has rendered nothing. The template waits until every script returns or calls $mounted() - add an await $mounted() above the slow part to render first and fill in after.`)},es);n?.unref?.(),Promise.all(t).then(()=>clearTimeout(n))},gi=e=>{if(ks.test(e))return e;let t=$i.resolve;if(typeof t!="function")return e;try{return t(e)}catch{return e}},ne=new Map,mi=e=>{try{return new URL(e,document.baseURI).href.replace(/#.*$/,"")}catch{return e}},ts=e=>Promise.all([fetch(e).then(t=>{if(!t.ok)throw new Error(`failed to fetch component from ${e}: ${t.status}`);return t.text()}),Ls?.then(()=>Si(e))]).then(([t])=>t),yi=e=>{if(!ne)return ts(e);let t=mi(e),n=ne.get(t);if(!n){n=ts(e),ne.set(t,n);let s=n;s.catch(()=>{ne?.get(t)===s&&ne.delete(t)})}return n},Ft=async e=>{let t=gi(e),n=await yi(t);return new de(n,{filename:t})},Ls,Ei="/jq79-sw.js",wi=async e=>{let t=typeof navigator>"u"?void 0:navigator.serviceWorker;if(!t)throw new Error("jq79: safeEval() compiles components in a service worker, and this page can't have one - service workers need https (or localhost). Precompile with the jq79/vite plugin instead, or use safeEval({ nonce: true }) on a page whose server issues a nonce.");let n;try{n=await t.register(e)}catch(s){throw new Error(`jq79: safeEval() couldn't register its service worker at ${e} (${s.message}). Serve jq79-sw.js from the jq79 package at your site's root, or pass its URL: safeEval({ worker: "/path/jq79-sw.js" }).`)}await t.ready,!t.controller&&await new Promise(s=>{t.addEventListener("controllerchange",()=>s(),{once:!0}),t.controller?s():n.active?.postMessage("jq79:claim")})},Si=e=>{let t=new URL(e,document.baseURI);return t.hash="",t.searchParams.set(An,""),new Promise((n,s)=>{let r=document.createElement("script"),i=os();i&&r.setAttribute("nonce",i),r.src=t.href,r.onload=()=>{r.remove(),n()},r.onerror=()=>{r.remove(),s(new Error(`jq79: the precompiled functions of ${e} did not load, and safeEval() can't render it without them`))},document.head.append(r)})},ce=class ce{constructor(t,n={}){k(this,"template");k(this,"scripts");k(this,"styles");k(this,"modules");k(this,"filename");k(this,"siblings");k(this,"name");k(this,"slots");k(this,"modelWriteback");k(this,"data",null);k(this,"fx",null);k(this,"content",null);k(this,"startMarker",null);k(this,"endMarker",null);k(this,"styleEls",[]);k(this,"shadowCss",null);k(this,"shadowSheets",[]);k(this,"sheetRoot",null);k(this,"ownsSharedStyles",!1);k(this,"useShadow",!1);k(this,"mountRoot",null);k(this,"resolveMounted",null);k(this,"renderDone",!1);k(this,"held",0);k(this,"onPaint",null);k(this,"destroyHooks",null);k(this,"attachHooks",null);k(this,"detachHooks",null);k(this,"onPage",!1);k(this,"emitListeners",new Map);let s=typeof t=="string"?It(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(),pi(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"?It(t):t;Kt.clear(),we.clear(),Dt.clear();let s=this.startMarker,r=!!(s&&this.content),i=r&&s.isConnected,o=i?s.parentNode:null,a=i?this.endMarker.nextSibling:null,l={...this.data},f=this.useShadow;return r&&this.destroy(),this.template=n.template,this.scripts=n.scripts,this.styles=n.styles,this.siblings=n.siblings,this.adoptSiblings(),!r||(this.renderWith(l,f),!o)?!1:(f&&this.placeShadowStyles(o,a),o.insertBefore(this.content,a),this.mountRoot=o,this.settleMounted(),!0)}static debug(t){if(t){let n=le.scopedNames;for(let s in t){let r=t[s];Object.prototype.hasOwnProperty.call(le,s)?typeof r=="boolean"?le[s]=r:console.warn(`jq79: Component79.debug ignored "${s}" - the flags are booleans, and the ones it knows are: ${Object.keys(le).join(", ")}`):console.warn(`jq79: Component79.debug does not know "${s}" - the flags it has are: ${Object.keys(le).join(", ")}`)}le.scopedNames!==n&&Je.clear()}return{...le}}static safeEval(t={}){Ut=!0;let n=[];if(t.nonce){let r=os();r===void 0?n.push(Promise.reject(new Error("jq79: safeEval({ nonce: true }) found no nonce on this page - no <script> carries one. The nonce belongs on the script that loads the page, the one the CSP names."))):jt=r}let s=t.worker??(t.nonce?!1:Ei);return s!==!1&&n.push(Ls??(Ls=wi(s))),Promise.all(n).then(()=>{})}static cache(t){return t===!1?ne=null:t===!0&&(ne??(ne=new Map)),!!ne}static clearCache(){ne?.clear()}static fetch(t){if(Array.isArray(t))throw new TypeError("Component79.fetch takes one URL; use fetchAll for an array");return new ot(Ft(t))}static fetchAll(t){return Promise.all(t.map(Ft))}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=Mn(this.scripts,Wt),r=li(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,Os,{value:o}),this.slots&&Object.defineProperty(i,ys,{value:this.slots}),Object.defineProperty(i,rt,{value:{count:0,owner:this}});let a=xe(i),l=me(a);this.data=a,this.fx=l,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let f=this.startMarker,u=!1,h=(E,C)=>{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 M=new CustomEvent(E,{detail:C,bubbles:!0,composed:!0,cancelable:!0});return f===this.startMarker&&this.emitListeners.get(E)?.forEach(U=>U(M,C)),M.cancelBubble||f.dispatchEvent(M),!M.defaultPrevented},w,O=new Promise(E=>{w=E});this.resolveMounted=w,this.renderDone=!1,this.held=0;let I=E=>{if(typeof E!="function")throw new TypeError("jq79: $destroyed expects a function");return f!==this.startMarker?(ve(E,"$destroyed"),()=>{}):Ot(this.destroyHooks??(this.destroyHooks=[]),E)},G=(E,{immediate:C=!0}={})=>{if(typeof E!="function")throw new TypeError("jq79: $attached expects a function");if(f!==this.startMarker)return()=>{};this.watchPage();let M=Ot(this.attachHooks??(this.attachHooks=[]),E);return C&&this.onPage&&ve(E,"$attached"),M},j=E=>{if(typeof E!="function")throw new TypeError("jq79: $detached expects a function");return f!==this.startMarker?(ve(E,"$detached"),()=>{}):(this.watchPage(),Ot(this.detachHooks??(this.detachHooks=[]),E))},b=E=>{let C=Fe(E);return I(()=>C.$dispose()),C},H=this.endMarker,D=(E=>{let C=[];for(let M=f.nextSibling;M&&M!==H;M=M.nextSibling)M instanceof Element&&(M.matches(E)&&C.push(M),C.push(...Array.from(M.querySelectorAll(E))));return C}),L=(E=>D(E)[0]??null),B=this.modules,ae=E=>B&&E in B?Promise.resolve(B[E]):Vt(Jo(E,this.filename)),P=Object.assign(Object.create(null),{$emit:h,$updateModel:(...E)=>{let[C,M]=E.length>1?E:[void 0,E[0]];return f!==this.startMarker?!1:this.modelWriteback?.(C,M)??!1},$slots:Object.fromEntries(Object.keys(this.slots??{}).map(E=>[E,!0]))}),x=[],W=!0;this.scripts.forEach((E,C)=>{let M;x.push(new Promise(p=>{M=p}));let U=!1,Q=()=>{U=!0,M()},q={$mounted:()=>(Q(),O),$destroyed:I,$attached:G,$detached:j,$computed:b,$self:L,$$self:D,...P,...r},K={filename:this.filename,index:C},c=":mounted"in E.attrs,d=mn(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."),Qn(a,Ae(E.content));let y=c?vt(d):d;return di(y,a,R=>l.effect(R),q,ae,K)}let{vars:p,code:S}=Ge(E.content);Qn(a,Wt(E)),p.forEach(y=>{y in a||(a[y]=void 0)});let m=c?vt(S):S;return ri(m,a,y=>l.effect(y),q,ae,K)})();if(g.sync)g.settled.then(Q,Q);else{let p=i[rt];p.count++;let S=()=>{p.count--,Q()};g.settled.then(S,S)}!g.sync&&!U&&(W=!1)});let J=document.createDocumentFragment(),V=new Proxy(a,{has:(E,C)=>typeof C=="string"&&C in P||Reflect.has(E,C),get:(E,C,M)=>typeof C=="string"&&C in P&&!Reflect.has(E,C)?P[C]:Reflect.get(E,C,M)});if(J.append(this.startMarker,this.endMarker),this.content=J,W?(this.endMarker.parentNode.insertBefore(be(this.template,V,l,n),this.endMarker),this.renderDone=!0,this.settleMounted()):(Promise.all(x).then(()=>{f===this.startMarker&&(this.endMarker.parentNode.insertBefore(be(this.template,V,l,n),this.endMarker),this.renderDone=!0,this.settleMounted(),ce.settleAttached())}),hi(this,x)),n)if(Zt())this.shadowCss=[...this.styles.map(E=>E.content),je];else{let E=document.createElement("style");E.textContent=je,this.styleEls=[...this.styles.map(C=>{let M=document.createElement("style");return M.textContent=C.content,M}),E]}else this.styles.forEach(E=>ni(Zn(E))),this.ownsSharedStyles=!0;return this}mount(t,n){let s=typeof t=="string"?Te(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"?Te(t):t;if(!s)throw new Error(`mount target not found: ${t}`);return(!this.content||n!==void 0||!this.useShadow)&&this.renderWith(n??{},!0),this.attach(s)}attach(t){this.mountRoot&&this.detach();let n=this.useShadow&&t instanceof Element?t.shadowRoot??t.attachShadow({mode:"open"}):t;return this.useShadow&&this.placeShadowStyles(n,null),n.appendChild(this.content),this.mountRoot=n,this.settleMounted(),ce.settleAttached(),this}isOnPage(){return this.renderDone&&this.startMarker?.isConnected===!0}watchPage(){fe.has(this)||(fe.add(this),this.onPage=this.isOnPage(),this.onPage||ce.queueSettle())}static queueSettle(){_t||(_t=!0,queueMicrotask(()=>{_t=!1,ce.settleAttached()}))}static settleAttached(){if(fe.size===0)return;let t=[...fe].filter(n=>!n.onPage&&n.isOnPage());ce.inDocumentOrder(t).forEach(n=>{n.onPage||!fe.has(n)||(n.onPage=!0,n.attachHooks?.slice().forEach(s=>ve(s,"$attached")))})}notifyDetached(){if(fe.size===0)return;let t=[];if(this.startMarker?.isConnected){let n=new Set;for(let r=this.startMarker;r&&(n.add(r),r!==this.endMarker);r=r.nextSibling);let s=r=>{for(;r;r=r.parentNode)if(n.has(r))return!0;return!1};t=ce.inDocumentOrder([...fe].filter(r=>r.onPage&&s(r.startMarker)))}else this.onPage&&(t=[this]);t.forEach(n=>{n.onPage&&(n.onPage=!1,n.detachHooks?.slice().forEach(s=>ve(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=>qt(this.sheetRoot,s)),this.shadowSheets.length===0&&(this.shadowSheets=this.shadowCss.map(s=>s===je?Ht??(Ht=nt(s)):nt(s))),this.shadowSheets.forEach(s=>Qt(t,s)),this.sheetRoot=t;return}this.shadowCss&&this.styleEls.length===0&&(this.styleEls=this.shadowCss.map(s=>{let r=document.createElement("style");return r.textContent=s,r})),this.styleEls.forEach(s=>t.insertBefore(s,n))}settleMounted(){if(!this.renderDone||this.held>0)return;let t=this.onPaint;this.onPaint=null,t?.(),this.mountRoot&&this.resolveMounted?.()}holdOwner(t){this.renderDone&&this.held===0||(t.held++,this.onPaint=()=>{t.held--,t.settleMounted()})}detach(){if(!this.mountRoot||!this.content||!this.startMarker||!this.endMarker)return this;this.notifyDetached();let t=this.startMarker;for(;t;){let n=t.nextSibling;if(this.content.appendChild(t),t===this.endMarker)break;t=n}return this.mountRoot=null,this}destroy(){this.notifyDetached(),fe.delete(this),this.attachHooks=null,this.detachHooks=null,this.onPage=!1;let t=this.destroyHooks;this.destroyHooks=null,t?.forEach(s=>ve(s,"$destroyed")),this.resolveMounted=null;let n=this.onPaint;return this.onPaint=null,n?.(),this.detach(),this.fx?.dispose(),this.fx=null,this.data?.$dispose(),this.styleEls.forEach(s=>s.parentNode?.removeChild(s)),this.styleEls=[],this.sheetRoot&&this.shadowSheets.forEach(s=>{s!==Ht&&qt(this.sheetRoot,s)}),this.shadowCss=null,this.shadowSheets=[],this.sheetRoot=null,this.ownsSharedStyles&&(this.styles.forEach(s=>si(Zn(s))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.renderDone=!1,this.data=null,this.resolveMounted=null,this}};k(ce,"version",qr);var de=ce,ot=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 bi=e=>new de(e),ve=(e,t)=>{try{e()}catch(n){console.error(`jq79: error in a ${t} hook`,n)}},Ot=(e,t)=>(e.push(t),()=>{let n=e.indexOf(t);n!==-1&&e.splice(n,1)}),fe=new Set,_t=!1,Ds={$:Te,$$:Ie,$create:qe,$reactive:xe,$toRaw:Z,Component79:de};typeof globalThis<"u"&&globalThis[ui]&&js();0&&(module.exports={$,$$,$computed,$create,$reactive,$toRaw,C79,Component79,PendingComponent79,enableHotReload,hotUpdate,parseComponent,renderComponent});
|
|
17
|
+
}`;var $i={};var Hr="0.7.10",ss=e=>Object.fromEntries(Array.from(e.attributes).map(t=>[t.name,t.value])),rs="http://www.w3.org/1999/xhtml",os=e=>{let t=ss(e),n=e.namespaceURI,s=t[Oe];delete t[Oe];let r=n!==null&&n!==rs;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?[os(i)]:[]})}},Je=new Map,Ye=new Map,Bt=!1,Lt,Pe=class extends Error{constructor(n,s){super(`${n}. ${s}`);M(this,"reason",n);M(this,"hint",s)}},Wr=()=>new Pe("was not precompiled","Safe mode never builds code at runtime: the component's precompiled functions did not reach the page."),Fr=(e,t)=>{let n=globalThis[An];if(Array.isArray(n)&&n.length>0)for(let[s,r,i]of n.splice(0))Ye.set(Qe(s,r),i);return Ye.size===0?void 0:Ye.get(Qe(e,t))},Kt=(e,t,n="")=>{let s=Fr(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(Lt!==void 0)return Ur(e,t,n,Lt);if(Bt)throw Wr();return new Function(...e,t+n)},is=()=>{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}},_n="__jq79built",Ur=(e,t,n,s)=>{let r=document.createElement("script");r.setAttribute("nonce",s),r.textContent=`document.currentScript.${_n} = ${On(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[_n];if(typeof a=="function")return Ye.set(Qe(e,t),a),a;throw i!==void 0?i:new Pe("could not be built","The page's CSP refused a <script> carrying the nonce jq79 read from the page.")},jn=new Set,Br=(e,t)=>{jn.has(e)||(jn.add(e),console.error(`jq79: safeEval() is on, and "${e}" ${t.reason}, so it rendered as nothing. ${t.hint}`))},Ct=(e,t)=>{if(!(t in e)){if(t in globalThis)return globalThis[t];throw new ReferenceError(`${t} is not defined`)}},as=(e,t)=>{try{return Kt([...vt,...t],$n(e))}catch(n){return n instanceof Pe&&Br(e,n),null}},Kr=(e,t)=>{if(!ce.scopedNames)return null;let n=Rn(e,t);if(n===null)return null;try{return Kt([...vt,...t],n)}catch{return null}},ls=(e,t,n)=>{let s=Je.get(e);if(s===void 0){let r=Kr(t,n);s=r?{fn:r,scoped:!0}:{fn:as(t,n),scoped:!1},Je.set(e,s)}return s},cs=(e,t)=>`${t.join(",")}|${e}`,zr=(e,t)=>ls(cs(e,t),e,t).fn,Gr=(e,t,n)=>{let s=as(t,n);return Je.set(e,{fn:s,scoped:!1}),s},Vr=/^(?:([\w$]+) is not defined|Can't find variable: ([\w$]+))/,Zr=100,we=new Map,zt=new Set,et=0,Dt=!1,It=new Set,Qr=()=>{Dt=!1,!(et>0)&&(we.forEach(({name:e,expr:t,scope:n},s)=>{e in n||(zt.add(s),console.warn(`jq79: ${e} is not defined - evaluating "${t}". Template expressions resolve against the component store: a top-level let/var/const in a :setup script, a declared prop, or a global. Note a "function name() {}" declaration is not on the store - write "const name = () => {}".`))}),we.clear())},ds=()=>{Dt||et>0||!we.size||(Dt=!0,queueMicrotask(Qr))},us=e=>{et++;let t=()=>{et--,ds()};e.then(t,t)},Xr=(e,t)=>{if(It.has(e))return;It.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.`)},fs=(e,t,n)=>{if(!(n instanceof ReferenceError))return Xr(e,n);let s=Vr.exec(n.message),r=s?.[1]??s?.[2];if(!r)return;let i=`${r}|${e}`;zt.has(i)||we.has(i)||we.size>=Zr||(we.set(i,{name:r,expr:e,scope:t}),ds())},ps=(e,t,n)=>{let s=n?Object.keys(n):[],r=cs(e,s),{fn:i,scoped:o}=ls(r,e,s);if(!i)return;let a=n?Object.values(n):[];if(!o)return i(t,Ct,...a);try{return i(t,Ct,...a)}catch(l){if(!(l instanceof ReferenceError))throw l;let f=Gr(r,e,s);if(!f)throw l;return f(t,Ct,...a)}},_=(e,t,n)=>{try{return ps(e,t,n)}catch(s){fs(e,t,s);return}},hs=(e,t,n)=>{try{return ps(e,t,n)}catch(s){if(!(s instanceof ReferenceError))throw s;fs(e,t,s);return}},gs=(e,t)=>{if(e.length===1){let s=e[0];return typeof s=="string"?s:String(_(s.expr,t)??"")}let n="";for(let s of e)n+=typeof s=="string"?s:String(_(s.expr,t)??"");return n},ms=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i);e.addEventListener(r,a=>{if(o.has("self")&&a.target!==e)return;o.has("prevent")&&a.preventDefault(),o.has("stop")&&a.stopPropagation();let l=hs(n,s,{$event:a});typeof l=="function"&&l.call(e,a)},{once:o.has("once"),capture:o.has("capture")})},Yr=(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),Re(()=>{let f=hs(n,s,{$event:l});typeof f=="function"&&f(l)})};e.on(r,a)},Gt=e=>e instanceof DocumentFragment?{first:e.firstChild,last:e.lastChild}:{first:e,last:e},at=({first:e,last:t})=>{for(let n=e;n;){let s=n===t?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},Jr=e=>{e.forEach(t=>{if(t.first===t.last)return at(t);if(!t.first.parentNode)return;let s=document.createRange();s.setStartBefore(t.first),s.setEndAfter(t.last),s.deleteContents()})},eo=(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},to=({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}},Ln=(e,t)=>{let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s))for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r;return null},Ee=null,tt=null,ys=new WeakSet,no=e=>{let t={memo:Ee,base:tt};return Ee=new Map,tt=e,t},so=e=>{Ee=e.memo,tt=e.base},Dn=(e,t)=>e.component!==void 0?In(t,e.component):e.tag.includes("-")?In(t,e.tag):null,X=e=>e.component??e.tag,In=(e,t)=>{if(!Ee)return Ln(e,t);let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s)){if(s===tt){if(Ee.has(t))return Ee.get(t);let r=Ln(s,t);return Ee.set(t,r),r}if(!ys.has(s)){for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r}}return null},ro=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()},oo=(e,t)=>{let n=ro(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)"}.`)},qn=100,Mt=0,Es=Symbol("jq79.slots"),Le=e=>Object.keys(e.attrs).find(t=>t===":slot"||t.startsWith(":slot.")),io=e=>e==="default"?":slot":`:slot.${e}`,ao=e=>typeof e!="string"||e.trim()!=="",lo=e=>{let t={},n=[];e.children.forEach(r=>{let i=typeof r=="object"&&r.tag==="template"?Le(r):void 0;if(typeof r=="string"||i===void 0){n.push(r);return}let o=xt(i.slice(6));if(o in t){console.warn(`jq79: two <template ${io(o)}> in <${X(e)}>; the second was ignored`);return}t[o]={nodes:r.children,binder:r.attrs[i]||void 0}});let s=n.some(ao);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},co=(e,t,n)=>{Ae(t)?.forEach(({name:s,as:r,default:i})=>{let o=r??s;Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>{let a=n[s]?.();return a===void 0&&i!==void 0?_(i,e):a},set:()=>console.warn(`jq79: "${o}" is a slot prop - it comes from the component, so assigning to it does nothing`)})})},uo=e=>{let t=Le(e);return console.warn(`jq79: <template ${t}> fills a slot only as a direct child of a component tag; here it rendered nothing`),document.createComment(`misplaced ${t}`)},fo=(e,t)=>{let n=Object.entries(lo(e));if(!n.length)return null;let s={};return n.forEach(([r,i])=>{s[r]=po(i,t)}),s},po=(e,t)=>(n,s,r,i)=>{let o=Object.create(t);co(o,e.binder,n);let a=o[We]??[];Object.defineProperty(o,We,{value:[...a,s]});let l=me(o);return l.ownedBy(s),r.onDispose(()=>l.dispose()),be(e.nodes,o,l,i)},ho=(e,t,n,s)=>{let r=xt(e.tag.slice(5)),i=document.createDocumentFragment(),o=document.createComment(e.tag),a=document.createComment(`/${e.tag}`);i.append(o,a);let l=t[Es]?.[r];if(!l)return i.insertBefore(be(e.children,t,n,s),a),i;let f={};return Object.entries(e.attrs).forEach(([d,p])=>{if(!(d===Ce||ye(d)||d.startsWith("@")))if(d.startsWith(":")){let S=p||d.slice(1);f[ae(d.slice(1))]=()=>_(S,t)}else f[ae(d)]=()=>p}),i.insertBefore(l(f,t,n,s),a),i},ws="data-c79-box",go=(e,t,n)=>{if(t.ns!==void 0)return document.createDocumentFragment();let s=document.createElement(_e(e));s.setAttribute(ws,"");let r=t.attrs[Ce];return r!==void 0&&s.setAttribute(Ce,r),n||ti(),s},Hn=new WeakSet,mo=(e,t)=>{if(e.ns===void 0||Hn.has(e))return;let n=t.template.find(r=>typeof r=="object");if(n===void 0||n.ns!==void 0)return;Hn.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}`)},Wn=(e,t,n,s,r)=>{let i=go(e,t,r),o=!(i instanceof DocumentFragment),a=o?null:document.createComment(`/${e}`);o||i.append(document.createComment(e),a);let l=fo(t,n),f={},d={},p=[],S=[],O=!1;Object.entries(t.attrs).forEach(([v,A])=>{if(v!==Ce){if(v===":props"||v.startsWith(":props.")){O=!0,S.push({expr:A});return}if(!ye(v))if(v.startsWith("@"))p.push([v,A]);else if(v===":model"||v.startsWith(":model.")){let x=v===":model"?"default":ae(v.slice(7));d[x]=A||(v===":model"?"model":x)}else if(v.startsWith(":")){let x=ae(v.slice(1));f[x]=A||x,S.push({name:x,expr:A||x})}else{let x=ae(v),q=JSON.stringify(A);f[x]=q,S.push({name:x,expr:q})}}});let I=v=>v==="default"?":model":`:model.${v}`,z=v=>v==="default"?"model":v,j=new Set;Object.entries(d).forEach(([v,A])=>{let x=z(v);f[x]!==void 0&&console.warn(`jq79: <${X(t)}> binds prop "${x}" through both :${x} and ${I(v)} - ${I(v)} wins`),f[x]=A,zr(Nt(A),["$value"])===null&&(j.add(v),console.warn(`jq79: ${I(v)}="${A}" is not assignable - updates from <${X(t)}> will be dropped`))});let b=()=>{let v={};return S.forEach(({name:A,expr:x})=>{if(A!==void 0)v[A]=_(x,n);else{let q=_(x,n);q!==null&&typeof q=="object"&&Object.assign(v,q)}}),Object.entries(d).forEach(([A,x])=>{v[z(A)]=_(x,n)}),v},H=null,D=null,L=null,U=new Set,se=v=>{if(v==null){if(!n[_s]?.has(e)||U.has("unfilled"))return;U.add("unfilled"),console.error(`jq79: <${X(t)}> is declared as a prop and the parent passed nothing - nothing renders here. Pass it (:${e}="\u2026"), or drop it from the signature to use the one declared in this file.`);return}U.has("type")||(U.add("type"),console.error(`jq79: <${X(t)}> is ${typeof v}, not a component - nothing renders here`))};return s.effect(()=>{let v=_(e,n),A=v instanceof le?v:null;if(A||se(v),A===D||(L?.dispose(),L=null,H?.destroy(),H=null,D=A,!A))return;mo(t,A);let x=new le({template:A.template,scripts:A.scripts,styles:A.styles,modules:A.modules,filename:A.filename,siblings:A.siblings,name:A.name});if(l&&(x.slots=l),Object.keys(d).length){let P=new Set;x.modelWriteback=(C,Q)=>{let $=C==null?"default":ae(String(C)),W=d[$];return W===void 0?(P.has($)||(P.add($),console.warn(`jq79: <${X(t)}> has no ${I($)} - bound: ${Object.keys(d).map(I).join(", ")}`)),!1):j.has($)?!1:(Re(()=>_(Nt(W),n,{$value:Q})),!0)}}p.forEach(([P,C])=>Yr(x,P,C,n));let q=ii(x.scripts);ai(t,e,Object.keys(f),q);let J=Jn(Re(b),q),G=document.createDocumentFragment();if(Mt>=qn){console.error(`jq79: <${X(t)}> is ${qn} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}Mt++;try{(r?x.renderShadow(J):x.render(J)).mount(G)}finally{Mt--}let Z=n[ot];Z&&x.holdOwner(Z.owner),a?a.parentNode.insertBefore(G,a):i.appendChild(G);let y=me(n,!0);if(O){let P=[];y.effect(()=>{let C=Jn(b(),q),Q=Object.keys(C);P.forEach($=>{$ in C||(x.data[$]=void 0)}),Q.forEach($=>{x.data[$]=C[$]}),P=Q})}else Object.entries(f).forEach(([P,C])=>{q!==null&&!q.has(P)||y.effect(()=>{x.data[P]=_(C,n)})});L=y,H=x}),s.onDispose(()=>{L?.dispose(),H?.destroy()}),i},yo=(e,t)=>{let n=()=>{let s=_(e,t);return s!==null&&typeof s=="object"?s:null};return new Proxy(t,{has(s,r){let i=n();return i!==null&&Reflect.has(i,r)||Reflect.has(s,r)},get(s,r){let i=n();return i!==null&&Reflect.has(i,r)?i[r]:Reflect.get(s,r)},set(s,r,i){let o=n();return o!==null&&Reflect.has(o,r)?(o[r]=i,!0):Reflect.set(s,r,i)}})},pe=e=>typeof e=="string"?e.split(/\s+/).filter(Boolean):Array.isArray(e)?e.flatMap(pe):e!==null&&typeof e=="object"?Object.entries(e).flatMap(([t,n])=>n?pe(t):[]):[],Eo=e=>typeof e=="function"?(t,n,s)=>{try{return!!e(t,n,s)}catch{return!1}}:typeof e=="string"||Array.isArray(e)?Jt(e):()=>!1,wo=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"]),Ss=e=>e.ns===void 0?document.createElement(e.tag):document.createElementNS(e.ns,e.tag),So={"http://www.w3.org/2000/svg":["svg","feGaussianBlur"],"http://www.w3.org/1998/Math/MathML":["math","mi"]},Fn=new Map,bo=(e,t)=>{let n=`${e} ${t}`,s=Fn.get(n);if(s!==void 0)return s;let r=So[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 Fn.set(n,i),i},bs=(e,t)=>{let n=e.namespaceURI;if(n===null||n===rs)return t;let s=t.replace(/-/g,"").toLowerCase(),r=bo(n,s);return r===s?t:r},Ts=(e,t,n)=>{let s=wo.has(t);(s?!n:n==null)?e.removeAttribute(t):e.setAttribute(t,s?"":String(n))},ce={cloneSkeletons:!0,scopedNames:!0},To=new Set([":text",":html",":value",":checked",":selected"]),$o=e=>e.startsWith("@")||e===":class"||e.startsWith(":class.")||To.has(e)?!0:e.startsWith(":")?e===":model"?!1:!ye(e)&&!e.includes("."):e!==Oe,$s=e=>{if(e.component||e.tag.includes("-")||Ze(e.tag)||e.tag==="template"||e.ns===void 0&&document.createElement(e.tag)instanceof HTMLUnknownElement)return!1;for(let t in e.attrs)if(!$o(t))return!1;return e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?!0:e.children.every(t=>typeof t=="string"||$s(t))},Rs=(e,t,n)=>{let s=Ss(e),r,i=null;for(let p in e.attrs){let S=e.attrs[p];if(p.startsWith("@"))n.push({kind:"event",path:t,attr:p,expr:S});else if(p===":class")r=S;else if(p.startsWith(":class."))(i??(i=[])).push([p.slice(7),S]);else if(!ye(p))if(p.startsWith(":")){let O=p.slice(1);n.push({kind:"attr",path:t,name:bs(s,O),expr:S||ae(O)})}else s.setAttribute(p,S)}(r!==void 0||i)&&n.push({kind:"class",path:t,classExpr:r,toggles:i,staticClasses:new Set(pe(e.attrs.class??""))});let o=e.attrs[":text"],a=e.attrs[":html"];o!==void 0?n.push({kind:"textContent",path:t,expr:o}):a!==void 0?n.push({kind:"html",path:t,expr:a}):e.children.forEach((p,S)=>{if(typeof p=="string"){p.includes("{{")?(n.push({kind:"text",path:[...t,S],parts:$t(p)}),s.appendChild(document.createTextNode(""))):s.appendChild(document.createTextNode(p));return}s.appendChild(Rs(p,[...t,S],n))});let l=e.attrs[":value"];l!==void 0&&n.push({kind:"value",path:t,expr:l});let f=e.attrs[":checked"];f!==void 0&&n.push({kind:"checked",path:t,expr:f});let d=e.attrs[":selected"];return d!==void 0&&n.push({kind:"selected",path:t,expr:d}),s},Ro=3,xs=e=>e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?1:1+e.children.reduce((t,n)=>t+(typeof n=="string"?0:xs(n)),0),Un=new WeakMap,Bn=new WeakSet,xo=e=>{let t=Un.get(e);if(t!==void 0)return t;if(!Bn.has(e))return Bn.add(e),null;let n=null;if($s(e)&&xs(e)>=Ro){let s=[];n={skeleton:Rs(e,[],s),ops:s}}return Un.set(e,n),n},No=(e,t)=>{let n=e;for(let s=0;s<t.length;s++)n=n.childNodes[t[s]];return n},vo=(e,t,n)=>{let s=e.skeleton.cloneNode(!0);for(let r of e.ops){let i=r.path.length===0?s:No(s,r.path);if(r.kind==="text"){let o=i,a=r.parts;n.effect(()=>{let l=gs(a,t);o.textContent!==l&&(o.textContent=l)})}else if(r.kind==="event")ms(i,r.attr,r.expr,t);else if(r.kind==="attr"){let o=i,{name:a,expr:l}=r;n.effect(()=>Ts(o,a,_(l,t)))}else if(r.kind==="class"){let o=i,{classExpr:a,toggles:l,staticClasses:f}=r,d=[];n.effect(()=>{let p=a!==void 0?pe(_(a,t)):[];l?.forEach(([S,O])=>{_(O,t)&&p.push(...pe(S))}),d.forEach(S=>{!p.includes(S)&&!f.has(S)&&o.classList.remove(S)}),o.classList.add(...p),d=p})}else if(r.kind==="textContent"){let o=i,{expr:a}=r;n.effect(()=>{let l=String(_(a,t)??"");o.textContent!==l&&(o.textContent=l)})}else if(r.kind==="html"){let o=i,{expr:a}=r;n.effect(()=>{o.innerHTML=ct(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},Vt=(e,t,n,s)=>{let r=e.attrs[":with"],i=r!==void 0?yo(r,t):t;if(Ze(e.tag))return ho(e,i,n,s);if(e.tag==="template"&&Le(e)!==void 0)return uo(e);let o=Dn(e,i);if(o)return Wn(o,e,i,n,s);if(ce.cloneSkeletons){let b=xo(e);if(b)return vo(b,i,n)}let a=Ss(e);if(e.component!==void 0&&i[ot]?.count===0)throw oo(e.component,i);let l=e.ns===void 0&&(e.component!==void 0||e.tag.includes("-"));if(l){let b=!1;n.effect(()=>{if(b)return;let H=Dn(e,i);if(!H)return;b=!0;let D=Wn(H,e,i,n,s),L=Gt(D);n.onDispose(()=>at(L)),a.replaceWith(D)})}for(let b in e.attrs){let H=e.attrs[b];if(b.startsWith("@"))ms(a,b,H,i);else if(b===":model"||b.startsWith(":model."))l||console.warn(`jq79: ${b} on <${X(e)}> does nothing - :model binds component tags only (for now)`);else if(!ye(b))if(b.startsWith(":"))if(l)a.setAttribute(b,H);else{let D=b.slice(1),L=H||ae(D),U=bs(a,D);n.effect(()=>Ts(a,U,_(L,i)))}else a.setAttribute(b,H)}let f=e.attrs[":class"],d=null;for(let b in e.attrs)b.startsWith(":class.")&&(d??(d=[])).push([b.slice(7),e.attrs[b]]);if(f!==void 0||d){let b=new Set(pe(e.attrs.class??"")),H=[];n.effect(()=>{let D=f!==void 0?pe(_(f,i)):[];d?.forEach(([L,U])=>{_(U,i)&&D.push(...pe(L))}),H.forEach(L=>{!D.includes(L)&&!b.has(L)&&a.classList.remove(L)}),a.classList.add(...D),H=D})}let p=e.attrs[":text"],S=e.attrs[":html"],O=e.attrs[":html.allowed"];O!==void 0&&S===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),p!==void 0?n.effect(()=>{let b=String(_(p,i)??"");a.textContent!==b&&(a.textContent=b)}):S!==void 0?n.effect(()=>{let b=O!==void 0?{allowUrl:Eo(_(O,i))}:void 0;a.innerHTML=ct(String(_(S,i)??""),b)}):a instanceof HTMLTemplateElement?be(e.children,i,n,s,a.content):be(e.children,i,n,s,a);let I=e.attrs[":value"];I!==void 0&&n.effect(()=>{let b=String(_(I,i)??"");a.value!==b&&(a.value=b)});let z=e.attrs[":checked"];z!==void 0&&n.effect(()=>{let b=!!_(z,i);a.checked!==b&&(a.checked=b)});let j=e.attrs[":selected"];return j!==void 0&&n.effect(()=>{let b=!!_(j,i);a.selected!==b&&(a.selected=b)}),a},Po=(e,t,n,s)=>{let r=document.createComment("if"),i=document.createDocumentFragment();i.appendChild(r);let o=null,a=null,l=null;return n.effect(()=>{let f=e.find(p=>p.expr===void 0||_(p.expr,t))??null;if(f===a||(l?.dispose(),o&&at(o),o=null,a=f,!f))return;l=me(t);let d=Vt(f.node,t,l,s);o=Gt(d),r.parentNode.insertBefore(d,r.nextSibling)}),n.onDispose(()=>l?.dispose()),i},Ne=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})},Co=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},Mo=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Ns=(e,t)=>typeof e=="string"?t.some(n=>zn(e,n)):Object.values(e.attrs).some(n=>t.some(s=>zn(n,s)))||e.children.some(n=>Ns(n,t)),vs=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("-")||Ze(e.tag)||e.children.some(vs)),Kn=/[A-Za-z0-9_$]/,Ao=/^[A-Za-z_$][\w$]*\.[A-Za-z_$][\w$]*$/,zn=(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(!Kn.test(s)&&!Kn.test(r))return!0}return!1},At=new WeakMap,ko=e=>{let t=At.get(e);if(t!==void 0)return t;let n=e.attrs[":each"].match(Tn);if(!n)return At.set(e,null),null;let[,s,r,i]=n,o=e.attrs[":key"],a=o===s,l=o!==void 0&&!a&&Ao.test(o)&&o.startsWith(`${s}.`)?o.slice(s.length+1):void 0,{[":each"]:f,[":key"]:d,...p}=e.attrs,S={...e,attrs:p},O=["$index",...r?[r]:[]],I=Ns(S,O),z=/^[A-Z]/.test(s)||r!==void 0&&/^[A-Z]/.test(r),j=o!==void 0&&vs(S),b={itemName:s,atName:r,listExpr:i,keyExpr:o,keyIsItem:a,keyProp:l,itemNode:S,readsPosition:I,namesComponent:z,nestsScopes:j};return At.set(e,b),b},Oo=(e,t,n,s)=>{let r=ko(e);if(!r)return document.createComment(`invalid :each expression "${e.attrs[":each"]}"`);let{itemName:i,atName:o,listExpr:a,keyExpr:l,keyIsItem:f,keyProp:d,itemNode:p,readsPosition:S,namesComponent:O,nestsScopes:I}=r,z=document.createComment("each"),j=document.createDocumentFragment();j.appendChild(z),(":if"in e.attrs||":elseif"in e.attrs||":else"in e.attrs)&&console.warn("jq79: :if/:elseif/:else on a :each element is ignored; filter the list expression instead");let b=[],H=!1;return n.effect(()=>{let D=no(t);try{let L=_(a,t),U=Array.isArray(L),se=U?null:Mo(L)?Object.keys(L):[],v=U?L.length:se.length,A=new Map;b.forEach(($,W)=>{$.pos=W;let B=A.get($.key);B?B.push($):A.set($.key,[$])});let x=new Set,q=[],J=[],G=[],Z=[],y;for(let $=0;$<v;$++){let W=U?$:se[$],B=U?L[$]:L[W],u=W;f?u=B:d!==void 0&&B!==null&&typeof B=="object"?u=B[d]:l!==void 0&&(y===void 0?(y=Object.create(t),Ne(y,i,B),o&&Ne(y,o,W),Ne(y,"$index",$)):(y[i]=B,o&&(y[o]=W),y.$index=$),u=_(l,y)),x.has(u)&&!H&&(H=!0,console.warn(`jq79: duplicate :key in :each "${e.attrs[":each"]}"; duplicates pair up by position`)),x.add(u);let c=A.get(u)?.shift();if(c&&Object.is(c.item,B)){let g=c.scope;g.$index!==$&&(S&&q.push(c),g.$index=$),o&&g[o]!==W&&(g[o]=W),G.push(c),Z.push(c.pos);continue}if(c&&l!==void 0){let g=c.scope;g[i]=B,g.$index!==$&&(g.$index=$),o&&g[o]!==W&&(g[o]=W),c.item=B,J.push(c),G.push(c),Z.push(c.pos);continue}c&&(c.fx.dispose(),at(c.range));let m=Object.create(t);Ne(m,i,B),o&&Ne(m,o,W),Ne(m,"$index",$),O||ys.add(m);let h=me(t);I&&Object.defineProperty(m,gt,{value:h});let w=Gt(Vt(p,m,h,s));G.push({key:u,item:B,scope:m,fx:h,range:w,pos:$}),Z.push(-1)}let P=new Set;A.forEach($=>$.forEach(W=>P.add(W))),P.size&&(P.forEach($=>{$.dead=!0,$.fx.dispose()}),Jr(eo(b,$=>$.dead===!0)));let C=z,Q=Co(Z);G.forEach(($,W)=>{!Q[W]&&C.nextSibling!==$.range.first&&to($.range,C),C=$.range.last}),q.forEach($=>Re(()=>$.fx.refresh())),J.forEach($=>Re(()=>$.fx.rerun())),b=G}finally{so(D)}}),n.onDispose(()=>b.forEach(D=>D.fx.dispose())),j},Ps=(e,t)=>{let n=t;for(;n<e.length&&typeof e[n]=="string"&&!e[n].trim();)n++;return n},kt=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`)},_o=(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`)},jo=[":if",":elseif",":else",":each"],Lo=(e,t)=>{if(e.tag!=="template"||e.ns!==void 0)return;let n=jo.find(s=>s in e.attrs);if(n!==void 0){if(Le(e)!==void 0){if(t?.component===void 0)return;console.warn(`jq79: ${n} on <template ${Le(e)}> is ignored - a slot is filled with its children as written. Put ${n} on the elements inside it, or on the component's tag`);return}console.warn(`jq79: ${n} on a nested <template> shows nothing - a <template>'s children live in its .content and never reach the page. Put ${n} on the elements themselves`)}},Do=[...Rt,":model",":slot"].map(e=>e.slice(1)),Io={":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'},qo=e=>{for(let t in e.attrs){let n=Io[t];n!==void 0&&console.warn(`jq79: ${n}`)}},Ho=e=>{if(!(e.component!==void 0||e.tag.includes("-")))for(let t in e.attrs){if(!t.startsWith(":")||ye(t)||t===":model"||t.startsWith(":model."))continue;let n=t.slice(1);if(n.includes(".")){console.warn(`jq79: ${t} is not a directive - it bound an attribute named "${n}". Dotted modifiers belong to an event: if you meant @${n}, that is the spelling`);continue}let s=Do.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`)}},Cs=(e,t)=>{e.forEach(s=>{typeof s!="string"&&(Lo(s,t),qo(s),Ho(s),Cs(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(kt(r),":if"in r.attrs){s++;let i=a=>{let l=Ps(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"))kt(a);let o=i(":else");o&&kt(o),n=o!==void 0;continue}(":elseif"in r.attrs||":else"in r.attrs)&&_o(r,n),n=!1,s++}},Gn=new WeakMap,Wo=(e,t,n)=>{let s=Gn.get(t);if(s)return s;let r=[{expr:t.attrs[":if"],node:t}],i=n+1,o=f=>{let d=Ps(e,i),p=e[d];if(typeof p=="object"&&f in p.attrs)return i=d+1,p};for(let f=o(":elseif");f;f=o(":elseif"))r.push({expr:f.attrs[":elseif"],node:f});let a=o(":else");a&&r.push({node:a});let l={branches:r,next:i};return Gn.set(t,l),l},be=(e,t,n,s=!1,r)=>{let i=r??document.createDocumentFragment(),o=0;for(;o<e.length;){let a=e[o];if(typeof a=="string"){let l=document.createTextNode(a);if(a.includes("{{")){let f=$t(a);n.effect(()=>{let d=gs(f,t);l.textContent!==d&&(l.textContent=d)})}i.appendChild(l),o++;continue}if(":each"in a.attrs){i.appendChild(Oo(a,t,n,s)),o++;continue}if(":if"in a.attrs){let l=Wo(e,a,o);i.appendChild(Po(l.branches,t,n,s)),o=l.next;continue}i.appendChild(Vt(a,t,n,s)),o++}return i},Fo=(e,t,n=!1)=>be(e.template,t,me(t),n),Ce="data-jq79",Uo=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)},Ms=(e,t)=>{e.forEach(n=>{typeof n!="string"&&(n.attrs[Ce]=t,Ms(n.children,t))})},Bo=(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(", "),As=(e,t)=>{Array.from(e).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=Bo(n.selectorText,t):n instanceof CSSGroupingRule&&As(n.cssRules,t)})},Ko=/(^|[\s>+~,(])([A-Z][A-Za-z0-9]*)(?![\w-])/g,zo=/[a-z]/,Go=e=>e.replace(Ko,(t,n,s)=>zo.test(s)?`${n}${_e(s)}`:t),Vo=/^\s*@(media|supports|container|layer|scope|document)\b/i,Zo=/^\s*@/,Qo=e=>{let t="",n="",s="",r=[],i=()=>r.length===0||r[r.length-1],o=()=>{t+=i()&&!Zo.test(s)?Go(n):n,n=""},a=f=>{o(),t+=f,s+=f},l=(f,d)=>{o(),t+=f,s="",d!==void 0?r.push(d):f==="}"&&r.pop()};for(let f=0;f<e.length;){let d=e[f];if(d==="/"&&e[f+1]==="*"){let p=e.indexOf("*/",f+2),S=p===-1?e.length:p+2;a(e.slice(f,S)),f=S}else if(d==='"'||d==="'"){let p=f+1;for(;p<e.length&&e[p]!==d;)p+=e[p]==="\\"?2:1;a(e.slice(f,Math.min(p+1,e.length))),f=p+1}else d==="{"?(l("{",Vo.test(s)),f++):d==="}"||d===";"?(l(d),f++):(n+=d,s+=d,f++)}return o(),t},Xo=(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),As(n.cssRules,t),Array.from(n.cssRules).map(s=>s.cssText).join(`
|
|
18
|
+
`)},qt=e=>{let t=Sn(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=Vn(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(!bn.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 le({...Vn(Array.from(l.content.children),l.innerHTML),siblings:a,name:f})}),Object.keys(a).length&&(o.siblings=a),o},Yo=/^(?:text|application)\/(?:x-)?typescript$/i,Jo=e=>"lang"in e?`lang="${e.lang}"`:Yo.test(e.type?.trim()??"")?`type="${e.type}"`:null,Vn=(e,t)=>{let n=[],s=[],r=[];e.forEach(o=>{let a={attrs:ss(o),content:o.textContent??""};o.tagName==="SCRIPT"?n.push(a):o.tagName==="STYLE"?s.push(a):r.push(os(o))}),n.forEach(o=>{let a=Jo(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=Qo(o.content))});let i=o=>"scoped"in o.attrs&&!("lang"in o.attrs);if(s.some(i)){let o=Uo(t);Ms(r,o),s.forEach(a=>{i(a)&&(a.scoped=Xo(a.content,o))})}return Cs(r),{template:r,scripts:n,styles:s}},nt=e=>/\.html?([?#]|$)/.test(e)?Ut(e):import(e),ks=/^(?:\.\.?\/|\/|[a-z][a-z0-9+.-]*:)/i,Zn=(e,t)=>{if(!ks.test(e))return e;try{return new URL(e,new URL(t??"",document.baseURI)).href}catch{return e}},ei=(e,t)=>e?`
|
|
19
|
+
//# sourceURL=${e}?jq79-script=${t}`:"",Os=(e,t,n)=>{try{return Kt(e,t,ei(n.filename,n.index??0))}catch(s){throw s instanceof Pe?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}},Qn=e=>e.scoped??e.content,je=`:where([${ws}]) { display: contents }`,Zt=()=>Bt&&typeof Document<"u"&&"adoptedStyleSheets"in Document.prototype,st=e=>{let t=new CSSStyleSheet;return t.replaceSync(e),t},Qt=(e,t)=>{e.adoptedStyleSheets.includes(t)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,t])},Ht=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(n=>n!==t)},Xe=null,Wt=null,ti=()=>{if(Zt()){Qt(document,Wt??(Wt=st(je)));return}Xe?.isConnected||(Xe=document.createElement("style"),Xe.textContent=je,document.head.appendChild(Xe))},rt=new Map,ni=e=>{let t=rt.get(e);if(!t){if(Zt()){let n=st(e);Qt(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}}rt.set(e,t)}t.count++},si=e=>{let t=rt.get(e);t&&--t.count<=0&&(t.sheet?Ht(document,t.sheet):t.el?.remove(),rt.delete(e))},ri=(e,t,n,s={},r=nt,i={})=>{let o={...Is,...s},a=new Proxy(t,{has:(d,p)=>p!=="$__effect"&&p!=="$__import"&&p!=="$__state"&&(Reflect.has(d,p)||!(p in globalThis)&&!(p in o))}),l={},f=Os(xn(Object.keys(o)),Nn(e),i)(a,n,r,l,...Object.values(o));return f.catch(d=>console.error("jq79: error in :setup script",d)),us(f),{settled:f,sync:l.done===!0}},Xn=(e,t)=>{t?.forEach(({name:n,default:s})=>{e[n]===void 0&&(e[n]=s===void 0?void 0:_(s,e))})},Ft=e=>{let t=Cn(e);return!t&&e.attrs[":setup"]!==void 0&&oi(e,e.attrs[":setup"]),t},Yn=new WeakSet,oi=(e,t)=>{t.trim()==="_"||Yn.has(e)||(Yn.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`))},ii=e=>{let t=null;return e.forEach(n=>{let s=ke(n.content)??Ft(n);if(!s)return;let r=t??(t=new Set);s.forEach(({name:i})=>r.add(i))}),t},Jn=(e,t)=>{if(t===null)return e;let n={};return Object.keys(e).forEach(s=>{t.has(s)&&(n[s]=e[s])}),n},es=new WeakMap,ai=(e,t,n,s)=>{if(s===null)return;let r=es.get(e)??new Set;es.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`))})},li=(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},_s=Symbol("jq79.unfilledProps"),ot=Symbol("jq79.pendingScripts"),ci=e=>e&&e.default!==void 0?e.default:e,di=(e,t,n,s={},r=nt,i={})=>{let o={...Is,...s},a={},l=Os(vn(Object.keys(o)),Pn(e),i)(a,ci,r,...Object.values(o)),f=I=>console.error("jq79: error in factory script",I),d=!1,p,S=()=>{if(d)return p;d=!0;let I=a.default;if(typeof I!="function")return;let z=j=>{j&&typeof j=="object"&&Object.assign(t,j)};try{let j=I(t,{$data:t,$props:t,$effect:n,...s});j instanceof Promise?p=j.then(z).catch(f):z(j)}catch(j){f(j)}return p},O=l.then(S,f);return us(O),a.done&&S(),{settled:O,sync:a.done===!0&&p===void 0}},ui="__JQ79_HMR_ENABLED__",fi="__JQ79_HMR__",Se=null,pi=e=>{if(!Se||!e.filename)return;let t=Se.get(e.filename);t||Se.set(e.filename,t=new Set),t.add(new WeakRef(e))},Ot=e=>{try{return new URL(e,document.baseURI).pathname}catch{return e}},js=(e,t)=>{if(!Se)return 0;let n=Ot(e),s=qt(t);ne?.forEach((a,l)=>{Ot(l)===n&&ne.set(l,Promise.resolve(t))});let r=!1,i=a=>a.name===void 0?s:s.siblings?.[a.name]??null,o=0;for(let[a,l]of Se)if(Ot(a)===n){for(let f of l){let d=f.deref();if(!d){l.delete(f);continue}let p=i(d);if(!p){r=!0;continue}d.hotReplace(p)&&o++}l.size||Se.delete(a)}return r?0:o},Ls=()=>{Se??(Se=new Map),globalThis[fi]={update:js}},ts=3e3,hi=(e,t)=>{let n=setTimeout(()=>{console.warn(`jq79: ${e.name?`<${e.name}>`:"a component"}${e.filename?` (${e.filename})`:""} has been waiting ${ts/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.`)},ts);n?.unref?.(),Promise.all(t).then(()=>clearTimeout(n))},gi=e=>{if(ks.test(e))return e;let t=$i.resolve;if(typeof t!="function")return e;try{return t(e)}catch{return e}},ne=new Map,mi=e=>{try{return new URL(e,document.baseURI).href.replace(/#.*$/,"")}catch{return e}},ns=e=>Promise.all([fetch(e).then(t=>{if(!t.ok)throw new Error(`failed to fetch component from ${e}: ${t.status}`);return t.text()}),Ds?.then(()=>Si(e))]).then(([t])=>t),yi=e=>{if(!ne)return ns(e);let t=mi(e),n=ne.get(t);if(!n){n=ns(e),ne.set(t,n);let s=n;s.catch(()=>{ne?.get(t)===s&&ne.delete(t)})}return n},Ut=async e=>{let t=gi(e),n=await yi(t);return new le(n,{filename:t})},Ds,Ei="/jq79-sw.js",wi=async e=>{let t=typeof navigator>"u"?void 0:navigator.serviceWorker;if(!t)throw new Error("jq79: safeEval() compiles components in a service worker, and this page can't have one - service workers need https (or localhost). Precompile with the jq79/vite plugin instead, or use safeEval({ nonce: true }) on a page whose server issues a nonce.");let n;try{n=await t.register(e)}catch(s){throw new Error(`jq79: safeEval() couldn't register its service worker at ${e} (${s.message}). Serve jq79-sw.js from the jq79 package at your site's root, or pass its URL: safeEval({ worker: "/path/jq79-sw.js" }).`)}await t.ready,!t.controller&&await new Promise(s=>{t.addEventListener("controllerchange",()=>s(),{once:!0}),t.controller?s():n.active?.postMessage("jq79:claim")})},Si=e=>{let t=new URL(e,document.baseURI);return t.hash="",t.searchParams.set(kn,""),new Promise((n,s)=>{let r=document.createElement("script"),i=is();i&&r.setAttribute("nonce",i),r.src=t.href,r.onload=()=>{r.remove(),n()},r.onerror=()=>{r.remove(),s(new Error(`jq79: the precompiled functions of ${e} did not load, and safeEval() can't render it without them`))},document.head.append(r)})},de=class de{constructor(t,n={}){M(this,"template");M(this,"scripts");M(this,"styles");M(this,"modules");M(this,"filename");M(this,"siblings");M(this,"name");M(this,"slots");M(this,"modelWriteback");M(this,"data",null);M(this,"fx",null);M(this,"content",null);M(this,"startMarker",null);M(this,"endMarker",null);M(this,"styleEls",[]);M(this,"shadowCss",null);M(this,"shadowSheets",[]);M(this,"sheetRoot",null);M(this,"ownsSharedStyles",!1);M(this,"useShadow",!1);M(this,"mountRoot",null);M(this,"resolveMounted",null);M(this,"renderDone",!1);M(this,"held",0);M(this,"onPaint",null);M(this,"destroyHooks",null);M(this,"attachHooks",null);M(this,"detachHooks",null);M(this,"onPage",!1);M(this,"emitListeners",new Map);let s=typeof t=="string"?qt(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(),pi(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"?qt(t):t;zt.clear(),we.clear(),It.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=ce.scopedNames;for(let s in t){let r=t[s];Object.prototype.hasOwnProperty.call(ce,s)?typeof r=="boolean"?ce[s]=r:console.warn(`jq79: Component79.debug ignored "${s}" - the flags are booleans, and the ones it knows are: ${Object.keys(ce).join(", ")}`):console.warn(`jq79: Component79.debug does not know "${s}" - the flags it has are: ${Object.keys(ce).join(", ")}`)}ce.scopedNames!==n&&Je.clear()}return{...ce}}static safeEval(t={}){Bt=!0;let n=[];if(t.nonce){let r=is();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."))):Lt=r}let s=t.worker??(t.nonce?!1:Ei);return s!==!1&&n.push(Ds??(Ds=wi(s))),Promise.all(n).then(()=>{})}static cache(t){return t===!1?ne=null:t===!0&&(ne??(ne=new Map)),!!ne}static clearCache(){ne?.clear()}static fetch(t){if(Array.isArray(t))throw new TypeError("Component79.fetch takes one URL; use fetchAll for an array");return new it(Ut(t))}static fetchAll(t){return Promise.all(t.map(Ut))}static importAll(t){if(!Array.isArray(t))throw new TypeError("Component79.importAll takes an array; use import() for one");return Promise.all(t.map(n=>nt(Zn(n,void 0))))}on(t,n){return this.emitListeners.has(t)||this.emitListeners.set(t,new Set),this.emitListeners.get(t).add(n),this}off(t,n){return this.emitListeners.get(t)?.delete(n),this}render(t={}){return this.renderWith(t,!1)}renderShadow(t={}){return this.renderWith(t,!0)}renderWith(t,n){this.destroy();let s=Mn(this.scripts,Ft),r=li(this.siblings,s),i=r?Object.assign(Object.create(r),t):{...t},o=new Set([...s].filter(y=>!(y in t)));o.size&&Object.defineProperty(i,_s,{value:o}),this.slots&&Object.defineProperty(i,Es,{value:this.slots}),Object.defineProperty(i,ot,{value:{count:0,owner:this}});let a=xe(i),l=me(a);this.data=a,this.fx=l,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let f=this.startMarker,d=!1,p=(y,P)=>{y==="model:update"&&!d&&(d=!0,console.warn("jq79: $emit('model:update', \u2026) no longer feeds :model - call $updateModel(value) or $updateModel(name, value) instead"));let C=new CustomEvent(y,{detail:P,bubbles:!0,composed:!0,cancelable:!0});return f===this.startMarker&&this.emitListeners.get(y)?.forEach(Q=>Q(C,P)),C.cancelBubble||f.dispatchEvent(C),!C.defaultPrevented},S,O=new Promise(y=>{S=y});this.resolveMounted=S,this.renderDone=!1,this.held=0;let I=y=>{if(typeof y!="function")throw new TypeError("jq79: $destroyed expects a function");return f!==this.startMarker?(ve(y,"$destroyed"),()=>{}):_t(this.destroyHooks??(this.destroyHooks=[]),y)},z=(y,{immediate:P=!0}={})=>{if(typeof y!="function")throw new TypeError("jq79: $attached expects a function");if(f!==this.startMarker)return()=>{};this.watchPage();let C=_t(this.attachHooks??(this.attachHooks=[]),y);return P&&this.onPage&&ve(y,"$attached"),C},j=y=>{if(typeof y!="function")throw new TypeError("jq79: $detached expects a function");return f!==this.startMarker?(ve(y,"$detached"),()=>{}):(this.watchPage(),_t(this.detachHooks??(this.detachHooks=[]),y))},b=y=>{let P=Fe(y);return I(()=>P.$dispose()),P},H=this.endMarker,D=(y=>{let P=[];for(let C=f.nextSibling;C&&C!==H;C=C.nextSibling)C instanceof Element&&(C.matches(y)&&P.push(C),P.push(...Array.from(C.querySelectorAll(y))));return P}),L=(y=>D(y)[0]??null),U=this.modules,se=y=>U&&y in U?Promise.resolve(U[y]):nt(Zn(y,this.filename)),v=y=>{if(!Array.isArray(y))throw new TypeError("$importAll takes an array; use import() for one");return Promise.all(y.map(se))},x=Object.assign(Object.create(null),{$emit:p,$updateModel:(...y)=>{let[P,C]=y.length>1?y:[void 0,y[0]];return f!==this.startMarker?!1:this.modelWriteback?.(P,C)??!1},$slots:Object.fromEntries(Object.keys(this.slots??{}).map(y=>[y,!0]))}),q=[],J=!0;this.scripts.forEach((y,P)=>{let C;q.push(new Promise(w=>{C=w}));let Q=!1,$=()=>{Q=!0,C()},B={$mounted:()=>($(),O),$destroyed:I,$attached:z,$detached:j,$computed:b,$self:L,$$self:D,...x,$importAll:v,...r},u={filename:this.filename,index:P},c=":mounted"in y.attrs,m=mn(y.content),h=(()=>{if(m!==null){c&&console.warn("jq79: :mounted on a factory script renders the template before the factory has returned, so none of its bindings exist yet - await $mounted() inside the factory instead."),Xn(a,ke(y.content));let T=c?Pt(m):m;return di(T,a,R=>l.effect(R),B,se,u)}let{vars:w,code:g}=Ge(y.content);Xn(a,Ft(y)),w.forEach(T=>{T in a||(a[T]=void 0)});let E=c?Pt(g):g;return ri(E,a,T=>l.effect(T),B,se,u)})();if(h.sync)h.settled.then($,$);else{let w=i[ot];w.count++;let g=()=>{w.count--,$()};h.settled.then(g,g)}!h.sync&&!Q&&(J=!1)});let G=document.createDocumentFragment(),Z=new Proxy(a,{has:(y,P)=>typeof P=="string"&&P in x||Reflect.has(y,P),get:(y,P,C)=>typeof P=="string"&&P in x&&!Reflect.has(y,P)?x[P]:Reflect.get(y,P,C)});if(G.append(this.startMarker,this.endMarker),this.content=G,J?(this.endMarker.parentNode.insertBefore(be(this.template,Z,l,n),this.endMarker),this.renderDone=!0,this.settleMounted()):(Promise.all(q).then(()=>{f===this.startMarker&&(this.endMarker.parentNode.insertBefore(be(this.template,Z,l,n),this.endMarker),this.renderDone=!0,this.settleMounted(),de.settleAttached())}),hi(this,q)),n)if(Zt())this.shadowCss=[...this.styles.map(y=>y.content),je];else{let y=document.createElement("style");y.textContent=je,this.styleEls=[...this.styles.map(P=>{let C=document.createElement("style");return C.textContent=P.content,C}),y]}else this.styles.forEach(y=>ni(Qn(y))),this.ownsSharedStyles=!0;return this}mount(t,n){let s=typeof t=="string"?Te(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"?Te(t):t;if(!s)throw new Error(`mount target not found: ${t}`);return(!this.content||n!==void 0||!this.useShadow)&&this.renderWith(n??{},!0),this.attach(s)}attach(t){this.mountRoot&&this.detach();let n=this.useShadow&&t instanceof Element?t.shadowRoot??t.attachShadow({mode:"open"}):t;return this.useShadow&&this.placeShadowStyles(n,null),n.appendChild(this.content),this.mountRoot=n,this.settleMounted(),de.settleAttached(),this}isOnPage(){return this.renderDone&&this.startMarker?.isConnected===!0}watchPage(){fe.has(this)||(fe.add(this),this.onPage=this.isOnPage(),this.onPage||de.queueSettle())}static queueSettle(){jt||(jt=!0,queueMicrotask(()=>{jt=!1,de.settleAttached()}))}static settleAttached(){if(fe.size===0)return;let t=[...fe].filter(n=>!n.onPage&&n.isOnPage());de.inDocumentOrder(t).forEach(n=>{n.onPage||!fe.has(n)||(n.onPage=!0,n.attachHooks?.slice().forEach(s=>ve(s,"$attached")))})}notifyDetached(){if(fe.size===0)return;let t=[];if(this.startMarker?.isConnected){let n=new Set;for(let r=this.startMarker;r&&(n.add(r),r!==this.endMarker);r=r.nextSibling);let s=r=>{for(;r;r=r.parentNode)if(n.has(r))return!0;return!1};t=de.inDocumentOrder([...fe].filter(r=>r.onPage&&s(r.startMarker)))}else this.onPage&&(t=[this]);t.forEach(n=>{n.onPage&&(n.onPage=!1,n.detachHooks?.slice().forEach(s=>ve(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=>Ht(this.sheetRoot,s)),this.shadowSheets.length===0&&(this.shadowSheets=this.shadowCss.map(s=>s===je?Wt??(Wt=st(s)):st(s))),this.shadowSheets.forEach(s=>Qt(t,s)),this.sheetRoot=t;return}this.shadowCss&&this.styleEls.length===0&&(this.styleEls=this.shadowCss.map(s=>{let r=document.createElement("style");return r.textContent=s,r})),this.styleEls.forEach(s=>t.insertBefore(s,n))}settleMounted(){if(!this.renderDone||this.held>0)return;let t=this.onPaint;this.onPaint=null,t?.(),this.mountRoot&&this.resolveMounted?.()}holdOwner(t){this.renderDone&&this.held===0||(t.held++,this.onPaint=()=>{t.held--,t.settleMounted()})}detach(){if(!this.mountRoot||!this.content||!this.startMarker||!this.endMarker)return this;this.notifyDetached();let t=this.startMarker;for(;t;){let n=t.nextSibling;if(this.content.appendChild(t),t===this.endMarker)break;t=n}return this.mountRoot=null,this}destroy(){this.notifyDetached(),fe.delete(this),this.attachHooks=null,this.detachHooks=null,this.onPage=!1;let t=this.destroyHooks;this.destroyHooks=null,t?.forEach(s=>ve(s,"$destroyed")),this.resolveMounted=null;let n=this.onPaint;return this.onPaint=null,n?.(),this.detach(),this.fx?.dispose(),this.fx=null,this.data?.$dispose(),this.styleEls.forEach(s=>s.parentNode?.removeChild(s)),this.styleEls=[],this.sheetRoot&&this.shadowSheets.forEach(s=>{s!==Wt&&Ht(this.sheetRoot,s)}),this.shadowCss=null,this.shadowSheets=[],this.sheetRoot=null,this.ownsSharedStyles&&(this.styles.forEach(s=>si(Qn(s))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.renderDone=!1,this.data=null,this.resolveMounted=null,this}};M(de,"version",Hr);var le=de,it=class{constructor(t){M(this,"chain");this.chain=t}queue(t){return this.chain=this.chain.then(n=>(t(n),n)),this}then(t,n){return this.chain.then(t,n)}catch(t){return this.chain.catch(t)}finally(t){return this.chain.finally(t)}mount(t,n){return this.queue(s=>s.mount(t,n))}mountShadow(t,n){return this.queue(s=>s.mountShadow(t,n))}render(t={}){return this.queue(n=>n.render(t))}renderShadow(t={}){return this.queue(n=>n.renderShadow(t))}on(t,n){return this.queue(s=>s.on(t,n))}off(t,n){return this.queue(s=>s.off(t,n))}detach(){return this.queue(t=>t.detach())}destroy(){return this.queue(t=>t.destroy())}};var bi=e=>new le(e),ve=(e,t)=>{try{e()}catch(n){console.error(`jq79: error in a ${t} hook`,n)}},_t=(e,t)=>(e.push(t),()=>{let n=e.indexOf(t);n!==-1&&e.splice(n,1)}),fe=new Set,jt=!1,Is={$:Te,$$:Ie,$create:qe,$reactive:xe,$toRaw:V,Component79:le,C79:le};typeof globalThis<"u"&&globalThis[ui]&&Ls();0&&(module.exports={$,$$,$computed,$create,$reactive,$toRaw,C79,Component79,PendingComponent79,enableHotReload,hotUpdate,parseComponent,renderComponent});
|
|
20
20
|
//# sourceMappingURL=jq79.cjs.map
|