nuclo 0.3.39 → 0.3.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/logo/nuclo.logo.cjs +1 -1
- package/dist/logo/nuclo.logo.cjs.map +1 -1
- package/dist/logo/nuclo.logo.mjs.map +1 -1
- package/dist/nuclo.cjs +1 -1
- package/dist/nuclo.cjs.map +1 -1
- package/dist/nuclo.mjs +1 -1
- package/dist/nuclo.mjs.map +1 -1
- package/dist/polyfill/nuclo.polyfill.cjs.map +1 -1
- package/dist/polyfill/nuclo.polyfill.mjs.map +1 -1
- package/dist/ssr/nuclo.ssr.cjs +1 -1
- package/dist/ssr/nuclo.ssr.cjs.map +1 -1
- package/dist/ssr/nuclo.ssr.mjs.map +1 -1
- package/package.json +5 -5
package/dist/logo/nuclo.logo.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=Math.PI,t=t=>Array.from({length:361},(n,r)=>{let i=r/360*2*e;return[64*Math.cos(i)+t*Math.cos(2*i),64*Math.sin(i)-t*Math.sin(2*i)]}),n=t(90),r=t(12),i=t(0);function a(e,t,a){let o=n=>n.map(([n,r])=>[t+e*n,a+e*r]);return{hub:o(i),shape:o(n),play:o(r),cx:t,cy:a,ring:96*e,wheel:32*e}}a(88/154,100,100);const o=34*e/180,s=[36,27,20,25],c=(e,t,n,r)=>({len:Math.hypot(n-e,r-t),at:i=>[e+(n-e)*i,t+(r-t)*i]}),l=(e,t,n,r,i)=>({len:n*Math.abs(i-r),at:a=>[e+n*Math.cos(r+(i-r)*a),t-n*Math.sin(r+(i-r)*a)]}),u=e=>{let t=e.reduce((e,t)=>e+t.len,0),n=0,r=0;return Array.from({length:361},(i,a)=>{let o=a/360*t;for(;n<e.length-1&&r+e[n].len<o;)r+=e[n++].len;return e[n].at((o-r)/e[n].len)})},d=(t,n)=>{let r=n?264:120,i=n?176:208,a=n?0:2*e,o=t+120;return u([c(t,r,t,i),l(t+60,i,60,e,a),c(o,i,o,r),c(o,r,o-24,r),c(o-24,r,o-24,i),l(t+60,i,36,a,e),c(t+24,i,t+24,r),c(t+24,r,t,r)])},f=t=>{let n=Math.asin(3/73),r=Math.asin(3/55),i=(e,n)=>[t+e*Math.cos(n),192-e*Math.sin(n)],a=(e,t,n)=>c(...i(e,n),...i(t,n)),s=(e,t,n,r)=>l(...i(e,t),3,n,r);return u([l(t,192,76,o+n,2*e-o-n),s(73,-o-n,-o-n,-o+e/2),a(73*Math.cos(n),55*Math.cos(r),-o),s(55,-o-r,-o+e/2,-o-r+e),l(t,192,52,2*e-o-r,o+r),s(55,o+r,o+r+e,o+1.5*e),a(55*Math.cos(r),73*Math.cos(n),o),s(73,o+n,o+1.5*e,o+n+2*e)])},p=t=>u([l(t+13,57,13,e,0),c(t+26,57,t+26,255),l(t+13,255,13,0,-e),c(t,255,t,57)]),m=t=>[u([l(t,192,76,e,3*e)]),u([l(t,192,52,e,-e)])],h=[[e=>[d(e,!0)],120],[e=>[d(e,!1)],120],[e=>[f(e+76)],76+76*Math.cos(o)],[e=>[p(e)],26],[e=>m(e+76),152]],g=n.map(e=>e[0]),_=n.map(e=>e[1]),v=1.45*144/(Math.max(..._)-Math.min(..._)),y=a(v,48-v*Math.min(...g),264-v*Math.max(..._));let b=y.cx+v*Math.max(...g)+36;const x=h.map(([e,t],n)=>{let r=e(b);return b+=t+(s[n]??0),r});function S(e,t=5){let n=e.flat(),r=Math.floor(Math.min(...n.map(e=>e[0]))-t),i=Math.floor(Math.min(...n.map(e=>e[1]))-t),a=Math.ceil(Math.max(...n.map(e=>e[0]))+t),o=Math.ceil(Math.max(...n.map(e=>e[1]))+t);return[r,i,a-r,o-i]}const C=S([y.shape,...x.flat()]),w=(e,t=360)=>e.map(e=>`M`+e.slice(0,t+1).map(e=>e.map(e=>Math.round(e*10)/10).join(`,`)).join(`L`)+(t===360?`Z`:``)).join(``),T={from:`#ea3f25`,to:`#ed6a2c`},E=`#f26a2e`,D=.2;let O=0;function
|
|
1
|
+
const e=Math.PI,t=t=>Array.from({length:361},(n,r)=>{let i=r/360*2*e;return[64*Math.cos(i)+t*Math.cos(2*i),64*Math.sin(i)-t*Math.sin(2*i)]}),n=t(90),r=t(12),i=t(0);function a(e,t,a){let o=n=>n.map(([n,r])=>[t+e*n,a+e*r]);return{hub:o(i),shape:o(n),play:o(r),cx:t,cy:a,ring:96*e,wheel:32*e}}a(88/154,100,100);const o=34*e/180,s=[36,27,20,25],c=(e,t,n,r)=>({len:Math.hypot(n-e,r-t),at:i=>[e+(n-e)*i,t+(r-t)*i]}),l=(e,t,n,r,i)=>({len:n*Math.abs(i-r),at:a=>[e+n*Math.cos(r+(i-r)*a),t-n*Math.sin(r+(i-r)*a)]}),u=e=>{let t=e.reduce((e,t)=>e+t.len,0),n=0,r=0;return Array.from({length:361},(i,a)=>{let o=a/360*t;for(;n<e.length-1&&r+e[n].len<o;)r+=e[n++].len;return e[n].at((o-r)/e[n].len)})},d=(t,n)=>{let r=n?264:120,i=n?176:208,a=n?0:2*e,o=t+120;return u([c(t,r,t,i),l(t+60,i,60,e,a),c(o,i,o,r),c(o,r,o-24,r),c(o-24,r,o-24,i),l(t+60,i,36,a,e),c(t+24,i,t+24,r),c(t+24,r,t,r)])},f=t=>{let n=Math.asin(3/73),r=Math.asin(3/55),i=(e,n)=>[t+e*Math.cos(n),192-e*Math.sin(n)],a=(e,t,n)=>c(...i(e,n),...i(t,n)),s=(e,t,n,r)=>l(...i(e,t),3,n,r);return u([l(t,192,76,o+n,2*e-o-n),s(73,-o-n,-o-n,-o+e/2),a(73*Math.cos(n),55*Math.cos(r),-o),s(55,-o-r,-o+e/2,-o-r+e),l(t,192,52,2*e-o-r,o+r),s(55,o+r,o+r+e,o+1.5*e),a(55*Math.cos(r),73*Math.cos(n),o),s(73,o+n,o+1.5*e,o+n+2*e)])},p=t=>u([l(t+13,57,13,e,0),c(t+26,57,t+26,255),l(t+13,255,13,0,-e),c(t,255,t,57)]),m=t=>[u([l(t,192,76,e,3*e)]),u([l(t,192,52,e,-e)])],h=[[e=>[d(e,!0)],120],[e=>[d(e,!1)],120],[e=>[f(e+76)],76+76*Math.cos(o)],[e=>[p(e)],26],[e=>m(e+76),152]],g=n.map(e=>e[0]),_=n.map(e=>e[1]),v=1.45*144/(Math.max(..._)-Math.min(..._)),y=a(v,48-v*Math.min(...g),264-v*Math.max(..._));let b=y.cx+v*Math.max(...g)+36;const x=h.map(([e,t],n)=>{let r=e(b);return b+=t+(s[n]??0),r});function S(e,t=5){let n=e.flat(),r=Math.floor(Math.min(...n.map(e=>e[0]))-t),i=Math.floor(Math.min(...n.map(e=>e[1]))-t),a=Math.ceil(Math.max(...n.map(e=>e[0]))+t),o=Math.ceil(Math.max(...n.map(e=>e[1]))+t);return[r,i,a-r,o-i]}const C=S([y.shape,...x.flat()]),w=(e,t=360)=>e.map(e=>`M`+e.slice(0,t+1).map(e=>e.map(e=>Math.round(e*10)/10).join(`,`)).join(`L`)+(t===360?`Z`:``)).join(``),T={from:`#ea3f25`,to:`#ed6a2c`},E=`#f26a2e`,D=.2;let O=0;module.exports=function({height:e=32,animate:t=!0}={},...n){let r=`nuclo-logo-${O++}`,i=Math.round(e*C[2]/C[3]),a=+(1.2/(i/C[2])).toFixed(2),o=(e,t,n,r=!1)=>({contours:e,fill:t,start:n,end:n+(r?.6:1.4),letter:r,k:360,ink:1}),s=[o([y.shape],`url(#${r}-fill)`,0),o([y.play],`#111`,0),...x.map((e,t)=>o(e,`currentColor`,1.2+t*.39999999999999997,!0))],c=s[0],l=s[s.length-1].end+D,u=l;function d(){let e=(e,t)=>Math.min(1,Math.max(0,(u-e)/(t-e)));for(let t of s)t.k=Math.round((.5-Math.cos(Math.PI*e(t.start,t.end))/2)*360),t.ink=e(t.end,t.end+D);update(r)}function f(){if(!t||globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches)return;let e=performance.now(),n=0,r=t=>{u=Math.min(l,(t-e)/1e3),d(),u<l&&(n=requestAnimationFrame(r))};return u=0,d(),n=requestAnimationFrame(r),()=>cancelAnimationFrame(n)}let p=(e,t)=>circleSvg({cx:()=>t[e.k][0],cy:()=>t[e.k][1],r:5,fill:`currentColor`,stroke:E,"stroke-width":1.5,opacity:()=>u<=e.start?0:1-e.ink}),m=e=>lineSvg({x1:()=>y.hub[e.k][0],y1:()=>y.hub[e.k][1],x2:()=>e.contours[0][e.k][0],y2:()=>e.contours[0][e.k][1]}),h=e=>pathSvg({d:()=>w(e.contours,e.k),fill:e.fill,"fill-opacity":()=>e.ink,stroke:e.letter?e.fill:E,"stroke-width":a,"stroke-opacity":()=>e.letter||e.ink<1?1:0});return svgSvg({viewBox:C.join(` `),width:i,height:e,role:`img`,"aria-label":`Nuclo`,onMount:f},...n,scope(r),defsSvg(linearGradientSvg({id:`${r}-fill`,x1:0,y1:0,x2:0,y2:1},stopSvg({offset:`0`,"stop-color":T.from}),stopSvg({offset:`1`,"stop-color":T.to}))),gSvg({fill:`none`,stroke:E,"stroke-width":a,opacity:()=>1-c.ink},circleSvg({cx:y.cx,cy:y.cy,r:y.ring,"stroke-opacity":.25}),circleSvg({cx:()=>y.hub[c.k][0],cy:()=>y.hub[c.k][1],r:y.wheel}),m(s[0]),m(s[1])),...s.map(h),...s.flatMap(e=>e.contours.map(t=>p(e,t))))};
|
|
2
2
|
//# sourceMappingURL=nuclo.logo.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nuclo.logo.cjs","names":["ic","PI","lap","t","i","d","rawShape","rawPlay","rawHub","placeIcon","place","pts","x","y","cx","s","cy","a","kern","line","x1","x0","y1","y0","arc","rad","to","from","trace","L","segs","sum","done","n","arch","up","c","end","rx","open","fo","fi","at","ang","cut","r0","r1","corner","cr","pill","ring","letters","xs","p","ys","S","brandIcon","glyphs","glyph","w","contours","box","margin","brandBox","pathD","k","v","GRADIENT","STROKE","INK_SET","instances","nucloLogo","mods","id","width","height","sw","piece","start","letter","pieces","wheel","total","now","paint","seg","draw","animate","raf","frame","ms","pen","arm"],"sources":["../../src/logo/geometry.ts","../../src/logo/index.ts"],"sourcesContent":["// The Nuclo mark and wordmark as point lists: pure math, no DOM. The components\n// draw them and scripts/render-brand.ts writes the static SVG and PNG assets\n// from them, so every logo on the site comes from this one source.\n\nexport const N = 360; // points per contour. One wheel lap draws the icon; each pen draws its glyph in the same N steps\nconst PI = Math.PI;\n\n// ── The icon: a hypotrochoid with two pens on one wheel ──────────────────\nexport const R = 96; // the fixed ring\nexport const r = 32; // the rolling wheel. R / r = 3 gives three lobes\nconst outer = 90; // the shape's pen. d > r: the lobes overlap\nconst inner = 12; // the play triangle's pen. d < r: a rounded triangle\n\n// One lap of a pen at distance d from the wheel's center, around the origin\nconst lap = (d: number) =>\n Array.from({ length: N + 1 }, (_, i) => {\n const t = (i / N) * 2 * PI;\n return [(R - r) * Math.cos(t) + d * Math.cos(((R - r) / r) * t), (R - r) * Math.sin(t) - d * Math.sin(((R - r) / r) * t)];\n });\nconst rawShape = lap(outer);\nconst rawPlay = lap(inner);\nconst rawHub = lap(0);\n\nexport type Icon = { hub: number[][]; shape: number[][]; play: number[][]; cx: number; cy: number; ring: number; wheel: number };\n\n/** The icon scaled by s with the wheel's center at (cx, cy). */\nexport function placeIcon(s: number, cx: number, cy: number): Icon {\n const place = (pts: number[][]) => pts.map(([x, y]) => [cx + s * x, cy + s * y]);\n return { hub: place(rawHub), shape: place(rawShape), play: place(rawPlay), cx, cy, ring: R * s, wheel: r * s };\n}\n\n/** The icon alone in a 200 × 200 box, the outer pen touching the box's margin. */\nexport const icon = placeIcon(88 / (R - r + outer), 100, 100);\n\n// ── The wordmark on its unit grid. U is the module; the sizes are multiples of it ──\nconst U = 24;\nconst stem = U; // every stroke, straight or round, is one unit thick\nconst xh = 6 * U; // x-height\nconst pad = 2 * U;\nconst base = 9 * U + pad; // the baseline. The l is 9 units tall\nconst top = base - xh; // the x-height line\nconst mid = top + xh / 2;\nconst ovr = 4; // round forms overshoot the x-height and the baseline, so they look aligned\nconst ro = xh / 2 + ovr; // outer radius of c and o\nconst ri = ro - stem; // their counter\nconst A = 2.5 * U; // arch radius of n and u: narrower than the bowls\nconst lw = stem + 2; // the l is two units wider: a lone stem with round ends looks lighter\nconst a = (34 * PI) / 180; // half of the c's opening\n// The space between the inks of each pair, set by eye: n–u, u–c, c–l, l–o\nconst kern = [36, 27, 20, 25];\n\n// Each contour is a chain of lines and arcs. Angles turn counterclockwise and 0 points right\ntype Seg = { len: number; at: (t: number) => number[] };\nconst line = (x0: number, y0: number, x1: number, y1: number): Seg => ({\n len: Math.hypot(x1 - x0, y1 - y0),\n at: (t) => [x0 + (x1 - x0) * t, y0 + (y1 - y0) * t],\n});\nconst arc = (cx: number, cy: number, rad: number, from: number, to: number): Seg => ({\n len: rad * Math.abs(to - from),\n at: (t) => [cx + rad * Math.cos(from + (to - from) * t), cy - rad * Math.sin(from + (to - from) * t)],\n});\n// N + 1 points along the chain, the same distance apart\nconst trace = (segs: Seg[]) => {\n const L = segs.reduce((sum, s) => sum + s.len, 0);\n let i = 0;\n let done = 0;\n return Array.from({ length: N + 1 }, (_, n) => {\n const d = (n / N) * L;\n while (i < segs.length - 1 && done + segs[i].len < d) done += segs[i++].len;\n return segs[i].at((d - done) / segs[i].len);\n });\n};\n\n// n: two stems and an arch over the top. u: the same glyph, arch under the bottom\nconst arch = (x: number, up: boolean) => {\n const y = up ? base : top; // where the stems end, flat on the line\n const c = up ? top + A - ovr : base - A + ovr; // the arch's center. The arch overshoots the line like the o does\n const end = up ? 0 : 2 * PI; // the arch turns over the top, or under the bottom\n const rx = x + 2 * A;\n return trace([\n line(x, y, x, c),\n arc(x + A, c, A, PI, end),\n line(rx, c, rx, y),\n line(rx, y, rx - stem, y),\n line(rx - stem, y, rx - stem, c),\n arc(x + A, c, A - stem, end, PI),\n line(x + stem, c, x + stem, y),\n line(x + stem, y, x, y),\n ]);\n};\n// c: the o cut open on the right, 34° above and below the center line. The cuts point at the center.\n// Their four corners are rounded by q, so the cut ends sit with the pill of the l\nconst open = (cx: number) => {\n const q = 3;\n const fo = Math.asin(q / (ro - q)); // where a corner arc meets the outer circle, from the cut\n const fi = Math.asin(q / (ri + q)); // and the inner circle\n const at = (rad: number, ang: number): [number, number] => [cx + rad * Math.cos(ang), mid - rad * Math.sin(ang)];\n const cut = (r0: number, r1: number, ang: number) => line(...at(r0, ang), ...at(r1, ang));\n const corner = (cr: number, ang: number, from: number, to: number) => arc(...at(cr, ang), q, from, to);\n return trace([\n arc(cx, mid, ro, a + fo, 2 * PI - a - fo), // the outer curve, over the top and down the left\n corner(ro - q, -a - fo, -a - fo, -a + PI / 2), // the lower cut: outer corner,\n cut((ro - q) * Math.cos(fo), (ri + q) * Math.cos(fi), -a), // the cut,\n corner(ri + q, -a - fi, -a + PI / 2, -a - fi + PI), // inner corner\n arc(cx, mid, ri, 2 * PI - a - fi, a + fi), // the counter, back up the left\n corner(ri + q, a + fi, a + fi + PI, a + 1.5 * PI), // the upper cut: inner corner,\n cut((ri + q) * Math.cos(fi), (ro - q) * Math.cos(fo), a), // the cut,\n corner(ro - q, a + fo, a + 1.5 * PI, a + fo + 2 * PI), // outer corner\n ]);\n};\n// l: a pill from the ascender line to the baseline. Its round ends overshoot both lines like the bowls do\nconst pill = (x: number) => {\n const rad = lw / 2;\n const y0 = base - 9 * U - ovr + rad; // the center of the top cap\n const y1 = base + ovr - rad; // and of the bottom cap\n return trace([arc(x + rad, y0, rad, PI, 0), line(x + lw, y0, x + lw, y1), arc(x + rad, y1, rad, 0, -PI), line(x, y1, x, y0)]);\n};\n// o: two circles. They run in opposite directions, so the fill leaves the counter open\nconst ring = (cx: number) => [trace([arc(cx, mid, ro, PI, 3 * PI)]), trace([arc(cx, mid, ri, PI, -PI)])];\n\n// Each letter: its contours at x, and the width of its ink. The c's ink stops at its terminals\nconst letters: [(x: number) => number[][][], number][] = [\n [(x) => [arch(x, true)], 2 * A],\n [(x) => [arch(x, false)], 2 * A],\n [(x) => [open(x + ro)], ro + ro * Math.cos(a)],\n [(x) => [pill(x)], lw],\n [(x) => ring(x + ro), 2 * ro],\n];\n\n// ── The lockup: icon and wordmark on one baseline ────────────────────────\n// The icon is 1.45 x-heights tall, so it leads but does not overpower the word; its lowest lobe\n// touches the baseline; the n starts 1.5 stems after the tip of the right lobe\nconst xs = rawShape.map((p) => p[0]);\nconst ys = rawShape.map((p) => p[1]);\nconst S = (1.45 * xh) / (Math.max(...ys) - Math.min(...ys));\nexport const brandIcon = placeIcon(S, pad - S * Math.min(...xs), base - S * Math.max(...ys));\n\nlet x = brandIcon.cx + S * Math.max(...xs) + 1.5 * stem;\n/** The wordmark: one list of contours per letter. */\nexport const glyphs = letters.map(([glyph, w], i) => {\n const contours = glyph(x);\n x += w + (kern[i] ?? 0);\n return contours;\n});\n\n/** The box around a drawing: [x, y, width, height], with room for the pens that ride the outlines. */\nexport function box(contours: number[][][], margin = 5): [number, number, number, number] {\n const pts = contours.flat();\n const x0 = Math.floor(Math.min(...pts.map((p) => p[0])) - margin);\n const y0 = Math.floor(Math.min(...pts.map((p) => p[1])) - margin);\n const x1 = Math.ceil(Math.max(...pts.map((p) => p[0])) + margin);\n const y1 = Math.ceil(Math.max(...pts.map((p) => p[1])) + margin);\n return [x0, y0, x1 - x0, y1 - y0];\n}\nexport const brandBox = box([brandIcon.shape, ...glyphs.flat()]);\n\n/** The path of the first k points of each contour, closed once the contour is complete. */\nexport const pathD = (contours: number[][][], k = N) =>\n contours.map((pts) => \"M\" + pts.slice(0, k + 1).map((p) => p.map((v) => Math.round(v * 10) / 10).join(\",\")).join(\"L\") + (k === N ? \"Z\" : \"\")).join(\"\");\n\nexport const GRADIENT = { from: \"#ea3f25\", to: \"#ed6a2c\" };\nexport const INK = \"#111\";\nexport const STROKE = \"#f26a2e\";\n","/**\n * nuclo/nuclo-logo — the Nuclo logo (mark and name) as a nuclo component, drawn the\n * way nuclo.dev draws it: a Spirograph wheel rolls inside a ring and its two pens\n * trace the mark; then a pen writes each letter, n to o, each inking as the next begins.\n *\n * import nucloLogo from \"nuclo/nuclo-logo\";\n * main(nucloLogo({ height: 48 }));\n *\n * Its own entry, so apps that never show the logo never ship it. It builds on the\n * runtime's globals (svgSvg, scope, update, …), so the app imports \"nuclo\" as usual.\n * The svg starts finished, which is what SSR sends; on mount it is drawn again unless\n * `animate` is off or the visitor prefers reduced motion.\n */\nimport { brandBox, brandIcon as ic, glyphs, pathD, GRADIENT, INK, N, STROKE } from \"./geometry\";\n\nexport type NucloLogoOptions = {\n\t/** Height in px; the width follows the logo's proportions. Default 32. */\n\theight?: number;\n\t/** Draw the logo when it mounts. Default true. */\n\tanimate?: boolean;\n};\n\nconst ICON_DRAW = 1.4; // seconds the wheel takes\nconst LETTER_DRAW = 0.6; // seconds a pen takes per letter\nconst LEAD = 0.2; // how early each letter starts, before the last one ends\nconst INK_SET = 0.2; // seconds the ink takes to set, once the pen has closed the outline\n\n// One drawn thing: its contours, its fill and when its pen runs. k is how many points are drawn, ink its fill\ntype Piece = { contours: number[][][]; fill: string; start: number; end: number; letter: boolean; k: number; ink: number };\n\nlet instances = 0;\n\nexport default function nucloLogo({ height = 32, animate = true }: NucloLogoOptions = {}, ...mods: SVGElementModifierLike<\"svg\">[]) {\n\tconst id = `nuclo-logo-${instances++}`;\n\tconst width = Math.round((height * brandBox[2]) / brandBox[3]);\n\tconst sw = +(1.2 / (width / brandBox[2])).toFixed(2); // a ~1.2px pen line whatever the size\n\n\tconst piece = (contours: number[][][], fill: string, start: number, letter = false): Piece =>\n\t\t({ contours, fill, start, end: start + (letter ? LETTER_DRAW : ICON_DRAW), letter, k: N, ink: 1 });\n\tconst pieces = [\n\t\tpiece([ic.shape], `url(#${id}-fill)`, 0),\n\t\tpiece([ic.play], INK, 0),\n\t\t...glyphs.map((contours, i) => piece(contours, \"currentColor\", ICON_DRAW - LEAD + i * (LETTER_DRAW - LEAD), true)),\n\t];\n\tconst wheel = pieces[0];\n\tconst total = pieces[pieces.length - 1].end + INK_SET;\n\tlet now = total; // seconds into the drawing: the finished logo until it is drawn\n\n\tfunction paint() {\n\t\tconst seg = (from: number, to: number) => Math.min(1, Math.max(0, (now - from) / (to - from)));\n\t\tfor (const p of pieces) {\n\t\t\tp.k = Math.round((0.5 - Math.cos(Math.PI * seg(p.start, p.end)) / 2) * N);\n\t\t\tp.ink = seg(p.end, p.end + INK_SET); // fills only once the outline is closed\n\t\t}\n\t\tupdate(id);\n\t}\n\n\t// onMount runs before the first paint, so the finished logo never flashes\n\tfunction draw() {\n\t\tif (!animate || globalThis.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches) return;\n\t\tconst start = performance.now();\n\t\tlet raf = 0;\n\t\tconst frame = (ms: number) => {\n\t\t\tnow = Math.min(total, (ms - start) / 1000);\n\t\t\tpaint();\n\t\t\tif (now < total) raf = requestAnimationFrame(frame);\n\t\t};\n\t\tnow = 0;\n\t\tpaint();\n\t\traf = requestAnimationFrame(frame);\n\t\treturn () => cancelAnimationFrame(raf);\n\t}\n\n\t// A pen is on the page from the moment it starts until its ink has set\n\tconst pen = (p: Piece, pts: number[][]) =>\n\t\tcircleSvg({ cx: () => pts[p.k][0], cy: () => pts[p.k][1], r: 5, fill: \"currentColor\", stroke: STROKE, \"stroke-width\": 1.5, opacity: () => (now <= p.start ? 0 : 1 - p.ink) });\n\n\tconst arm = (p: Piece) =>\n\t\tlineSvg({ x1: () => ic.hub[p.k][0], y1: () => ic.hub[p.k][1], x2: () => p.contours[0][p.k][0], y2: () => p.contours[0][p.k][1] });\n\n\t// The line a pen has drawn so far. It fills when the contour closes\n\tconst trace = (p: Piece) =>\n\t\tpathSvg({ d: () => pathD(p.contours, p.k), fill: p.fill, \"fill-opacity\": () => p.ink, stroke: p.letter ? p.fill : STROKE, \"stroke-width\": sw, \"stroke-opacity\": () => (p.letter || p.ink < 1 ? 1 : 0) });\n\n\treturn svgSvg(\n\t\t{ viewBox: brandBox.join(\" \"), width, height, role: \"img\", \"aria-label\": \"Nuclo\", onMount: draw },\n\t\t...mods,\n\t\tscope(id),\n\t\tdefsSvg(\n\t\t\tlinearGradientSvg(\n\t\t\t\t{ id: `${id}-fill`, x1: 0, y1: 0, x2: 0, y2: 1 },\n\t\t\t\tstopSvg({ offset: \"0\", \"stop-color\": GRADIENT.from }),\n\t\t\t\tstopSvg({ offset: \"1\", \"stop-color\": GRADIENT.to }),\n\t\t\t),\n\t\t),\n\t\t// The ring, the wheel and its arms fade out as the mark's ink sets\n\t\tgSvg(\n\t\t\t{ fill: \"none\", stroke: STROKE, \"stroke-width\": sw, opacity: () => 1 - wheel.ink },\n\t\t\tcircleSvg({ cx: ic.cx, cy: ic.cy, r: ic.ring, \"stroke-opacity\": 0.25 }),\n\t\t\tcircleSvg({ cx: () => ic.hub[wheel.k][0], cy: () => ic.hub[wheel.k][1], r: ic.wheel }),\n\t\t\tarm(pieces[0]),\n\t\t\tarm(pieces[1]),\n\t\t),\n\t\t...pieces.map(trace),\n\t\t...pieces.flatMap((p) => p.contours.map((pts) => pen(p, pts))),\n\t);\n}\n"],"mappings":"AAKA,MAAMC,EAAK,KAAK,GASVC,EAAO,GACX,MAAM,KAAK,CAAE,OAAQ,GAAM,GAAI,EAAG,IAAM,CACtC,IAAMC,EAAKC,EAAA,IAAS,EAAIH,EACxB,MAAO,CAAE,GAAS,KAAK,IAAIE,CAAC,EAAIE,EAAI,KAAK,IAAM,EAAcF,CAAC,EAAI,GAAS,KAAK,IAAIA,CAAC,EAAIE,EAAI,KAAK,IAAM,EAAcF,CAAC,CAAC,CAC1H,CAAC,EACGG,EAAWJ,EAAI,EAAK,EACpBK,EAAUL,EAAI,EAAK,EACnBM,EAASN,EAAI,CAAC,EAKpB,SAAgBO,EAAU,EAAW,EAAY,EAAkB,CACjE,IAAMC,EAAS,GAAoBC,EAAI,KAAK,CAACC,EAAGC,KAAO,CAACC,EAAKC,EAAIH,EAAGI,EAAKD,EAAIF,CAAC,CAAC,EAC/E,MAAO,CAAE,IAAKH,EAAMF,CAAM,EAAG,MAAOE,EAAMJ,CAAQ,EAAG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ChG,GAAGd,EACH,MAAMC,CAAE,EACR,QACC,kBACC,CAAE,GAAI,GAAGA,EAAG,OAAQ,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,GAAI,CAAE,EAC/C,QAAQ,CAAE,OAAQ,IAAK,aAAcN,EAAS,IAAK,CAAC,EACpD,QAAQ,CAAE,OAAQ,IAAK,aAAcA,EAAS,EAAG,CAAC,CACnD,CACD,EAEA,KACC,CAAE,KAAM,OAAQ,OAAQC,EAAQ,eAAgBQ,EAAI,YAAe,EAAIK,EAAM,GAAI,EACjF,UAAU,CAAE,GAAIjF,EAAG,GAAI,GAAIA,EAAG,GAAI,EAAGA,EAAG,KAAM,iBAAkB,GAAK,CAAC,EACtE,UAAU,CAAE,OAAUA,EAAG,IAAIiF,EAAM,EAAE,CAAC,GAAI,OAAUjF,EAAG,IAAIiF,EAAM,EAAE,CAAC,GAAI,EAAGjF,EAAG,KAAM,CAAC,EACrF4F,EAAIZ,EAAO,EAAE,EACbY,EAAIZ,EAAO,EAAE,CACd,EACA,GAAGA,EAAO,IAAIpD,CAAK,EACnB,GAAGoD,EAAO,QAAS,GAAM3B,EAAE,SAAS,IAAK,GAAQsC,EAAItC,EAAG1C,CAAG,CAAC,CAAC,CAC9D,CACD,C"}
|
|
1
|
+
{"version":3,"file":"nuclo.logo.cjs","names":["ic","PI","lap","d","_","i","t","rawShape","rawPlay","rawHub","placeIcon","s","cx","cy","place","pts","x","y","a","kern","line","x0","y0","x1","y1","arc","rad","from","to","trace","segs","L","sum","done","n","arch","up","c","end","rx","open","fo","fi","at","ang","cut","r0","r1","corner","cr","pill","ring","letters","xs","p","ys","S","brandIcon","glyphs","glyph","w","contours","box","margin","brandBox","pathD","k","v","GRADIENT","STROKE","INK_SET","instances","height","animate","mods","id","width","sw","piece","fill","start","letter","pieces","wheel","total","now","paint","seg","draw","raf","frame","ms","pen","arm"],"sources":["../../src/logo/geometry.ts","../../src/logo/index.ts"],"sourcesContent":["// The Nuclo mark and wordmark as point lists: pure math, no DOM. The components\n// draw them and scripts/render-brand.ts writes the static SVG and PNG assets\n// from them, so every logo on the site comes from this one source.\n\nexport const N = 360; // points per contour. One wheel lap draws the icon; each pen draws its glyph in the same N steps\nconst PI = Math.PI;\n\n// ── The icon: a hypotrochoid with two pens on one wheel ──────────────────\nexport const R = 96; // the fixed ring\nexport const r = 32; // the rolling wheel. R / r = 3 gives three lobes\nconst outer = 90; // the shape's pen. d > r: the lobes overlap\nconst inner = 12; // the play triangle's pen. d < r: a rounded triangle\n\n// One lap of a pen at distance d from the wheel's center, around the origin\nconst lap = (d: number) =>\n Array.from({ length: N + 1 }, (_, i) => {\n const t = (i / N) * 2 * PI;\n return [(R - r) * Math.cos(t) + d * Math.cos(((R - r) / r) * t), (R - r) * Math.sin(t) - d * Math.sin(((R - r) / r) * t)];\n });\nconst rawShape = lap(outer);\nconst rawPlay = lap(inner);\nconst rawHub = lap(0);\n\nexport type Icon = { hub: number[][]; shape: number[][]; play: number[][]; cx: number; cy: number; ring: number; wheel: number };\n\n/** The icon scaled by s with the wheel's center at (cx, cy). */\nexport function placeIcon(s: number, cx: number, cy: number): Icon {\n const place = (pts: number[][]) => pts.map(([x, y]) => [cx + s * x, cy + s * y]);\n return { hub: place(rawHub), shape: place(rawShape), play: place(rawPlay), cx, cy, ring: R * s, wheel: r * s };\n}\n\n/** The icon alone in a 200 × 200 box, the outer pen touching the box's margin. */\nexport const icon = placeIcon(88 / (R - r + outer), 100, 100);\n\n// ── The wordmark on its unit grid. U is the module; the sizes are multiples of it ──\nconst U = 24;\nconst stem = U; // every stroke, straight or round, is one unit thick\nconst xh = 6 * U; // x-height\nconst pad = 2 * U;\nconst base = 9 * U + pad; // the baseline. The l is 9 units tall\nconst top = base - xh; // the x-height line\nconst mid = top + xh / 2;\nconst ovr = 4; // round forms overshoot the x-height and the baseline, so they look aligned\nconst ro = xh / 2 + ovr; // outer radius of c and o\nconst ri = ro - stem; // their counter\nconst A = 2.5 * U; // arch radius of n and u: narrower than the bowls\nconst lw = stem + 2; // the l is two units wider: a lone stem with round ends looks lighter\nconst a = (34 * PI) / 180; // half of the c's opening\n// The space between the inks of each pair, set by eye: n–u, u–c, c–l, l–o\nconst kern = [36, 27, 20, 25];\n\n// Each contour is a chain of lines and arcs. Angles turn counterclockwise and 0 points right\ntype Seg = { len: number; at: (t: number) => number[] };\nconst line = (x0: number, y0: number, x1: number, y1: number): Seg => ({\n len: Math.hypot(x1 - x0, y1 - y0),\n at: (t) => [x0 + (x1 - x0) * t, y0 + (y1 - y0) * t],\n});\nconst arc = (cx: number, cy: number, rad: number, from: number, to: number): Seg => ({\n len: rad * Math.abs(to - from),\n at: (t) => [cx + rad * Math.cos(from + (to - from) * t), cy - rad * Math.sin(from + (to - from) * t)],\n});\n// N + 1 points along the chain, the same distance apart\nconst trace = (segs: Seg[]) => {\n const L = segs.reduce((sum, s) => sum + s.len, 0);\n let i = 0;\n let done = 0;\n return Array.from({ length: N + 1 }, (_, n) => {\n const d = (n / N) * L;\n while (i < segs.length - 1 && done + segs[i].len < d) done += segs[i++].len;\n return segs[i].at((d - done) / segs[i].len);\n });\n};\n\n// n: two stems and an arch over the top. u: the same glyph, arch under the bottom\nconst arch = (x: number, up: boolean) => {\n const y = up ? base : top; // where the stems end, flat on the line\n const c = up ? top + A - ovr : base - A + ovr; // the arch's center. The arch overshoots the line like the o does\n const end = up ? 0 : 2 * PI; // the arch turns over the top, or under the bottom\n const rx = x + 2 * A;\n return trace([\n line(x, y, x, c),\n arc(x + A, c, A, PI, end),\n line(rx, c, rx, y),\n line(rx, y, rx - stem, y),\n line(rx - stem, y, rx - stem, c),\n arc(x + A, c, A - stem, end, PI),\n line(x + stem, c, x + stem, y),\n line(x + stem, y, x, y),\n ]);\n};\n// c: the o cut open on the right, 34° above and below the center line. The cuts point at the center.\n// Their four corners are rounded by q, so the cut ends sit with the pill of the l\nconst open = (cx: number) => {\n const q = 3;\n const fo = Math.asin(q / (ro - q)); // where a corner arc meets the outer circle, from the cut\n const fi = Math.asin(q / (ri + q)); // and the inner circle\n const at = (rad: number, ang: number): [number, number] => [cx + rad * Math.cos(ang), mid - rad * Math.sin(ang)];\n const cut = (r0: number, r1: number, ang: number) => line(...at(r0, ang), ...at(r1, ang));\n const corner = (cr: number, ang: number, from: number, to: number) => arc(...at(cr, ang), q, from, to);\n return trace([\n arc(cx, mid, ro, a + fo, 2 * PI - a - fo), // the outer curve, over the top and down the left\n corner(ro - q, -a - fo, -a - fo, -a + PI / 2), // the lower cut: outer corner,\n cut((ro - q) * Math.cos(fo), (ri + q) * Math.cos(fi), -a), // the cut,\n corner(ri + q, -a - fi, -a + PI / 2, -a - fi + PI), // inner corner\n arc(cx, mid, ri, 2 * PI - a - fi, a + fi), // the counter, back up the left\n corner(ri + q, a + fi, a + fi + PI, a + 1.5 * PI), // the upper cut: inner corner,\n cut((ri + q) * Math.cos(fi), (ro - q) * Math.cos(fo), a), // the cut,\n corner(ro - q, a + fo, a + 1.5 * PI, a + fo + 2 * PI), // outer corner\n ]);\n};\n// l: a pill from the ascender line to the baseline. Its round ends overshoot both lines like the bowls do\nconst pill = (x: number) => {\n const rad = lw / 2;\n const y0 = base - 9 * U - ovr + rad; // the center of the top cap\n const y1 = base + ovr - rad; // and of the bottom cap\n return trace([arc(x + rad, y0, rad, PI, 0), line(x + lw, y0, x + lw, y1), arc(x + rad, y1, rad, 0, -PI), line(x, y1, x, y0)]);\n};\n// o: two circles. They run in opposite directions, so the fill leaves the counter open\nconst ring = (cx: number) => [trace([arc(cx, mid, ro, PI, 3 * PI)]), trace([arc(cx, mid, ri, PI, -PI)])];\n\n// Each letter: its contours at x, and the width of its ink. The c's ink stops at its terminals\nconst letters: [(x: number) => number[][][], number][] = [\n [(x) => [arch(x, true)], 2 * A],\n [(x) => [arch(x, false)], 2 * A],\n [(x) => [open(x + ro)], ro + ro * Math.cos(a)],\n [(x) => [pill(x)], lw],\n [(x) => ring(x + ro), 2 * ro],\n];\n\n// ── The lockup: icon and wordmark on one baseline ────────────────────────\n// The icon is 1.45 x-heights tall, so it leads but does not overpower the word; its lowest lobe\n// touches the baseline; the n starts 1.5 stems after the tip of the right lobe\nconst xs = rawShape.map((p) => p[0]);\nconst ys = rawShape.map((p) => p[1]);\nconst S = (1.45 * xh) / (Math.max(...ys) - Math.min(...ys));\nexport const brandIcon = placeIcon(S, pad - S * Math.min(...xs), base - S * Math.max(...ys));\n\nlet x = brandIcon.cx + S * Math.max(...xs) + 1.5 * stem;\n/** The wordmark: one list of contours per letter. */\nexport const glyphs = letters.map(([glyph, w], i) => {\n const contours = glyph(x);\n x += w + (kern[i] ?? 0);\n return contours;\n});\n\n/** The box around a drawing: [x, y, width, height], with room for the pens that ride the outlines. */\nexport function box(contours: number[][][], margin = 5): [number, number, number, number] {\n const pts = contours.flat();\n const x0 = Math.floor(Math.min(...pts.map((p) => p[0])) - margin);\n const y0 = Math.floor(Math.min(...pts.map((p) => p[1])) - margin);\n const x1 = Math.ceil(Math.max(...pts.map((p) => p[0])) + margin);\n const y1 = Math.ceil(Math.max(...pts.map((p) => p[1])) + margin);\n return [x0, y0, x1 - x0, y1 - y0];\n}\nexport const brandBox = box([brandIcon.shape, ...glyphs.flat()]);\n\n/** The path of the first k points of each contour, closed once the contour is complete. */\nexport const pathD = (contours: number[][][], k = N) =>\n contours.map((pts) => \"M\" + pts.slice(0, k + 1).map((p) => p.map((v) => Math.round(v * 10) / 10).join(\",\")).join(\"L\") + (k === N ? \"Z\" : \"\")).join(\"\");\n\nexport const GRADIENT = { from: \"#ea3f25\", to: \"#ed6a2c\" };\nexport const INK = \"#111\";\nexport const STROKE = \"#f26a2e\";\n","/**\n * nuclo/nuclo-logo — the Nuclo logo (mark and name) as a nuclo component, drawn the\n * way nuclo.dev draws it: a Spirograph wheel rolls inside a ring and its two pens\n * trace the mark; then a pen writes each letter, n to o, each inking as the next begins.\n *\n * import nucloLogo from \"nuclo/nuclo-logo\";\n * main(nucloLogo({ height: 48 }));\n *\n * Its own entry, so apps that never show the logo never ship it. It builds on the\n * runtime's globals (svgSvg, scope, update, …), so the app imports \"nuclo\" as usual.\n * The svg starts finished, which is what SSR sends; on mount it is drawn again unless\n * `animate` is off or the visitor prefers reduced motion.\n */\nimport { brandBox, brandIcon as ic, glyphs, pathD, GRADIENT, INK, N, STROKE } from \"./geometry\";\n\nexport type NucloLogoOptions = {\n\t/** Height in px; the width follows the logo's proportions. Default 32. */\n\theight?: number;\n\t/** Draw the logo when it mounts. Default true. */\n\tanimate?: boolean;\n};\n\nconst ICON_DRAW = 1.4; // seconds the wheel takes\nconst LETTER_DRAW = 0.6; // seconds a pen takes per letter\nconst LEAD = 0.2; // how early each letter starts, before the last one ends\nconst INK_SET = 0.2; // seconds the ink takes to set, once the pen has closed the outline\n\n// One drawn thing: its contours, its fill and when its pen runs. k is how many points are drawn, ink its fill\ntype Piece = { contours: number[][][]; fill: string; start: number; end: number; letter: boolean; k: number; ink: number };\n\nlet instances = 0;\n\nexport default function nucloLogo({ height = 32, animate = true }: NucloLogoOptions = {}, ...mods: SVGElementModifierLike<\"svg\">[]) {\n\tconst id = `nuclo-logo-${instances++}`;\n\tconst width = Math.round((height * brandBox[2]) / brandBox[3]);\n\tconst sw = +(1.2 / (width / brandBox[2])).toFixed(2); // a ~1.2px pen line whatever the size\n\n\tconst piece = (contours: number[][][], fill: string, start: number, letter = false): Piece =>\n\t\t({ contours, fill, start, end: start + (letter ? LETTER_DRAW : ICON_DRAW), letter, k: N, ink: 1 });\n\tconst pieces = [\n\t\tpiece([ic.shape], `url(#${id}-fill)`, 0),\n\t\tpiece([ic.play], INK, 0),\n\t\t...glyphs.map((contours, i) => piece(contours, \"currentColor\", ICON_DRAW - LEAD + i * (LETTER_DRAW - LEAD), true)),\n\t];\n\tconst wheel = pieces[0];\n\tconst total = pieces[pieces.length - 1].end + INK_SET;\n\tlet now = total; // seconds into the drawing: the finished logo until it is drawn\n\n\tfunction paint() {\n\t\tconst seg = (from: number, to: number) => Math.min(1, Math.max(0, (now - from) / (to - from)));\n\t\tfor (const p of pieces) {\n\t\t\tp.k = Math.round((0.5 - Math.cos(Math.PI * seg(p.start, p.end)) / 2) * N);\n\t\t\tp.ink = seg(p.end, p.end + INK_SET); // fills only once the outline is closed\n\t\t}\n\t\tupdate(id);\n\t}\n\n\t// onMount runs before the first paint, so the finished logo never flashes\n\tfunction draw() {\n\t\tif (!animate || globalThis.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches) return;\n\t\tconst start = performance.now();\n\t\tlet raf = 0;\n\t\tconst frame = (ms: number) => {\n\t\t\tnow = Math.min(total, (ms - start) / 1000);\n\t\t\tpaint();\n\t\t\tif (now < total) raf = requestAnimationFrame(frame);\n\t\t};\n\t\tnow = 0;\n\t\tpaint();\n\t\traf = requestAnimationFrame(frame);\n\t\treturn () => cancelAnimationFrame(raf);\n\t}\n\n\t// A pen is on the page from the moment it starts until its ink has set\n\tconst pen = (p: Piece, pts: number[][]) =>\n\t\tcircleSvg({ cx: () => pts[p.k][0], cy: () => pts[p.k][1], r: 5, fill: \"currentColor\", stroke: STROKE, \"stroke-width\": 1.5, opacity: () => (now <= p.start ? 0 : 1 - p.ink) });\n\n\tconst arm = (p: Piece) =>\n\t\tlineSvg({ x1: () => ic.hub[p.k][0], y1: () => ic.hub[p.k][1], x2: () => p.contours[0][p.k][0], y2: () => p.contours[0][p.k][1] });\n\n\t// The line a pen has drawn so far. It fills when the contour closes\n\tconst trace = (p: Piece) =>\n\t\tpathSvg({ d: () => pathD(p.contours, p.k), fill: p.fill, \"fill-opacity\": () => p.ink, stroke: p.letter ? p.fill : STROKE, \"stroke-width\": sw, \"stroke-opacity\": () => (p.letter || p.ink < 1 ? 1 : 0) });\n\n\treturn svgSvg(\n\t\t{ viewBox: brandBox.join(\" \"), width, height, role: \"img\", \"aria-label\": \"Nuclo\", onMount: draw },\n\t\t...mods,\n\t\tscope(id),\n\t\tdefsSvg(\n\t\t\tlinearGradientSvg(\n\t\t\t\t{ id: `${id}-fill`, x1: 0, y1: 0, x2: 0, y2: 1 },\n\t\t\t\tstopSvg({ offset: \"0\", \"stop-color\": GRADIENT.from }),\n\t\t\t\tstopSvg({ offset: \"1\", \"stop-color\": GRADIENT.to }),\n\t\t\t),\n\t\t),\n\t\t// The ring, the wheel and its arms fade out as the mark's ink sets\n\t\tgSvg(\n\t\t\t{ fill: \"none\", stroke: STROKE, \"stroke-width\": sw, opacity: () => 1 - wheel.ink },\n\t\t\tcircleSvg({ cx: ic.cx, cy: ic.cy, r: ic.ring, \"stroke-opacity\": 0.25 }),\n\t\t\tcircleSvg({ cx: () => ic.hub[wheel.k][0], cy: () => ic.hub[wheel.k][1], r: ic.wheel }),\n\t\t\tarm(pieces[0]),\n\t\t\tarm(pieces[1]),\n\t\t),\n\t\t...pieces.map(trace),\n\t\t...pieces.flatMap((p) => p.contours.map((pts) => pen(p, pts))),\n\t);\n}\n"],"mappings":"AAKA,MAAMC,EAAK,KAAK,GASVC,EAAOC,GACX,MAAM,KAAK,CAAE,OAAQ,GAAM,GAAIC,EAAGC,IAAM,CACtC,IAAMC,EAAKD,EAAA,IAAS,EAAIJ,EACxB,MAAO,CAAE,GAAS,KAAK,IAAIK,CAAC,EAAIH,EAAI,KAAK,IAAM,EAAcG,CAAC,EAAI,GAAS,KAAK,IAAIA,CAAC,EAAIH,EAAI,KAAK,IAAM,EAAcG,CAAC,CAAC,CAC1H,CAAC,EACGC,EAAWL,EAAI,EAAK,EACpBM,EAAUN,EAAI,EAAK,EACnBO,EAASP,EAAI,CAAC,EAKpB,SAAgBQ,EAAUC,EAAWC,EAAYC,EAAkB,CACjE,IAAMC,EAASC,GAAoBA,EAAI,KAAK,CAACC,EAAGC,KAAO,CAACL,EAAKD,EAAIK,EAAGH,EAAKF,EAAIM,CAAC,CAAC,EAC/E,MAAO,CAAE,IAAKH,EAAML,CAAM,EAAG,MAAOK,EAAMP,CAAQ,EAAG,KAAMO,EAAMN,CAAO,EAAGI,KAAIC,KAAI,KAAA,GAAUF,EAAG,MAAA,GAAWA,CAAE,CAC/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AAS,QAASgB,CAAK,EAChG,GAAGd,EACH,MAAMC,CAAE,EACR,QACC,kBACC,CAAE,GAAI,GAAGA,EAAG,OAAQ,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,GAAI,CAAE,EAC/C,QAAQ,CAAE,OAAQ,IAAK,aAAcP,EAAS,IAAK,CAAC,EACpD,QAAQ,CAAE,OAAQ,IAAK,aAAcA,EAAS,EAAG,CAAC,CACnD,CACD,EAEA,KACC,CAAE,KAAM,OAAQ,OAAQC,EAAQ,eAAgBQ,EAAI,YAAe,EAAIM,EAAM,GAAI,EACjF,UAAU,CAAE,GAAInF,EAAG,GAAI,GAAIA,EAAG,GAAI,EAAGA,EAAG,KAAM,iBAAkB,GAAK,CAAC,EACtE,UAAU,CAAE,OAAUA,EAAG,IAAImF,EAAM,EAAE,CAAC,GAAI,OAAUnF,EAAG,IAAImF,EAAM,EAAE,CAAC,GAAI,EAAGnF,EAAG,KAAM,CAAC,EACrF6F,EAAIX,EAAO,EAAE,EACbW,EAAIX,EAAO,EAAE,CACd,EACA,GAAGA,EAAO,IAAIrD,CAAK,EACnB,GAAGqD,EAAO,QAAS5B,GAAMA,EAAE,SAAS,IAAKvC,GAAQ6E,EAAItC,EAAGvC,CAAG,CAAC,CAAC,CAC9D,CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nuclo.logo.mjs","names":["ic","PI","lap","t","i","d","rawShape","rawPlay","rawHub","placeIcon","place","pts","x","y","cx","s","cy","a","kern","line","x1","x0","y1","y0","arc","rad","to","from","trace","L","segs","sum","done","n","arch","up","c","end","rx","open","fo","fi","at","ang","cut","r0","r1","corner","cr","pill","ring","letters","xs","p","ys","S","brandIcon","glyphs","glyph","w","contours","box","margin","brandBox","pathD","k","v","GRADIENT","STROKE","INK_SET","instances","nucloLogo","mods","id","width","height","sw","piece","start","letter","pieces","wheel","total","now","paint","seg","draw","animate","raf","frame","ms","pen","arm"],"sources":["../../src/logo/geometry.ts","../../src/logo/index.ts"],"sourcesContent":["// The Nuclo mark and wordmark as point lists: pure math, no DOM. The components\n// draw them and scripts/render-brand.ts writes the static SVG and PNG assets\n// from them, so every logo on the site comes from this one source.\n\nexport const N = 360; // points per contour. One wheel lap draws the icon; each pen draws its glyph in the same N steps\nconst PI = Math.PI;\n\n// ── The icon: a hypotrochoid with two pens on one wheel ──────────────────\nexport const R = 96; // the fixed ring\nexport const r = 32; // the rolling wheel. R / r = 3 gives three lobes\nconst outer = 90; // the shape's pen. d > r: the lobes overlap\nconst inner = 12; // the play triangle's pen. d < r: a rounded triangle\n\n// One lap of a pen at distance d from the wheel's center, around the origin\nconst lap = (d: number) =>\n Array.from({ length: N + 1 }, (_, i) => {\n const t = (i / N) * 2 * PI;\n return [(R - r) * Math.cos(t) + d * Math.cos(((R - r) / r) * t), (R - r) * Math.sin(t) - d * Math.sin(((R - r) / r) * t)];\n });\nconst rawShape = lap(outer);\nconst rawPlay = lap(inner);\nconst rawHub = lap(0);\n\nexport type Icon = { hub: number[][]; shape: number[][]; play: number[][]; cx: number; cy: number; ring: number; wheel: number };\n\n/** The icon scaled by s with the wheel's center at (cx, cy). */\nexport function placeIcon(s: number, cx: number, cy: number): Icon {\n const place = (pts: number[][]) => pts.map(([x, y]) => [cx + s * x, cy + s * y]);\n return { hub: place(rawHub), shape: place(rawShape), play: place(rawPlay), cx, cy, ring: R * s, wheel: r * s };\n}\n\n/** The icon alone in a 200 × 200 box, the outer pen touching the box's margin. */\nexport const icon = placeIcon(88 / (R - r + outer), 100, 100);\n\n// ── The wordmark on its unit grid. U is the module; the sizes are multiples of it ──\nconst U = 24;\nconst stem = U; // every stroke, straight or round, is one unit thick\nconst xh = 6 * U; // x-height\nconst pad = 2 * U;\nconst base = 9 * U + pad; // the baseline. The l is 9 units tall\nconst top = base - xh; // the x-height line\nconst mid = top + xh / 2;\nconst ovr = 4; // round forms overshoot the x-height and the baseline, so they look aligned\nconst ro = xh / 2 + ovr; // outer radius of c and o\nconst ri = ro - stem; // their counter\nconst A = 2.5 * U; // arch radius of n and u: narrower than the bowls\nconst lw = stem + 2; // the l is two units wider: a lone stem with round ends looks lighter\nconst a = (34 * PI) / 180; // half of the c's opening\n// The space between the inks of each pair, set by eye: n–u, u–c, c–l, l–o\nconst kern = [36, 27, 20, 25];\n\n// Each contour is a chain of lines and arcs. Angles turn counterclockwise and 0 points right\ntype Seg = { len: number; at: (t: number) => number[] };\nconst line = (x0: number, y0: number, x1: number, y1: number): Seg => ({\n len: Math.hypot(x1 - x0, y1 - y0),\n at: (t) => [x0 + (x1 - x0) * t, y0 + (y1 - y0) * t],\n});\nconst arc = (cx: number, cy: number, rad: number, from: number, to: number): Seg => ({\n len: rad * Math.abs(to - from),\n at: (t) => [cx + rad * Math.cos(from + (to - from) * t), cy - rad * Math.sin(from + (to - from) * t)],\n});\n// N + 1 points along the chain, the same distance apart\nconst trace = (segs: Seg[]) => {\n const L = segs.reduce((sum, s) => sum + s.len, 0);\n let i = 0;\n let done = 0;\n return Array.from({ length: N + 1 }, (_, n) => {\n const d = (n / N) * L;\n while (i < segs.length - 1 && done + segs[i].len < d) done += segs[i++].len;\n return segs[i].at((d - done) / segs[i].len);\n });\n};\n\n// n: two stems and an arch over the top. u: the same glyph, arch under the bottom\nconst arch = (x: number, up: boolean) => {\n const y = up ? base : top; // where the stems end, flat on the line\n const c = up ? top + A - ovr : base - A + ovr; // the arch's center. The arch overshoots the line like the o does\n const end = up ? 0 : 2 * PI; // the arch turns over the top, or under the bottom\n const rx = x + 2 * A;\n return trace([\n line(x, y, x, c),\n arc(x + A, c, A, PI, end),\n line(rx, c, rx, y),\n line(rx, y, rx - stem, y),\n line(rx - stem, y, rx - stem, c),\n arc(x + A, c, A - stem, end, PI),\n line(x + stem, c, x + stem, y),\n line(x + stem, y, x, y),\n ]);\n};\n// c: the o cut open on the right, 34° above and below the center line. The cuts point at the center.\n// Their four corners are rounded by q, so the cut ends sit with the pill of the l\nconst open = (cx: number) => {\n const q = 3;\n const fo = Math.asin(q / (ro - q)); // where a corner arc meets the outer circle, from the cut\n const fi = Math.asin(q / (ri + q)); // and the inner circle\n const at = (rad: number, ang: number): [number, number] => [cx + rad * Math.cos(ang), mid - rad * Math.sin(ang)];\n const cut = (r0: number, r1: number, ang: number) => line(...at(r0, ang), ...at(r1, ang));\n const corner = (cr: number, ang: number, from: number, to: number) => arc(...at(cr, ang), q, from, to);\n return trace([\n arc(cx, mid, ro, a + fo, 2 * PI - a - fo), // the outer curve, over the top and down the left\n corner(ro - q, -a - fo, -a - fo, -a + PI / 2), // the lower cut: outer corner,\n cut((ro - q) * Math.cos(fo), (ri + q) * Math.cos(fi), -a), // the cut,\n corner(ri + q, -a - fi, -a + PI / 2, -a - fi + PI), // inner corner\n arc(cx, mid, ri, 2 * PI - a - fi, a + fi), // the counter, back up the left\n corner(ri + q, a + fi, a + fi + PI, a + 1.5 * PI), // the upper cut: inner corner,\n cut((ri + q) * Math.cos(fi), (ro - q) * Math.cos(fo), a), // the cut,\n corner(ro - q, a + fo, a + 1.5 * PI, a + fo + 2 * PI), // outer corner\n ]);\n};\n// l: a pill from the ascender line to the baseline. Its round ends overshoot both lines like the bowls do\nconst pill = (x: number) => {\n const rad = lw / 2;\n const y0 = base - 9 * U - ovr + rad; // the center of the top cap\n const y1 = base + ovr - rad; // and of the bottom cap\n return trace([arc(x + rad, y0, rad, PI, 0), line(x + lw, y0, x + lw, y1), arc(x + rad, y1, rad, 0, -PI), line(x, y1, x, y0)]);\n};\n// o: two circles. They run in opposite directions, so the fill leaves the counter open\nconst ring = (cx: number) => [trace([arc(cx, mid, ro, PI, 3 * PI)]), trace([arc(cx, mid, ri, PI, -PI)])];\n\n// Each letter: its contours at x, and the width of its ink. The c's ink stops at its terminals\nconst letters: [(x: number) => number[][][], number][] = [\n [(x) => [arch(x, true)], 2 * A],\n [(x) => [arch(x, false)], 2 * A],\n [(x) => [open(x + ro)], ro + ro * Math.cos(a)],\n [(x) => [pill(x)], lw],\n [(x) => ring(x + ro), 2 * ro],\n];\n\n// ── The lockup: icon and wordmark on one baseline ────────────────────────\n// The icon is 1.45 x-heights tall, so it leads but does not overpower the word; its lowest lobe\n// touches the baseline; the n starts 1.5 stems after the tip of the right lobe\nconst xs = rawShape.map((p) => p[0]);\nconst ys = rawShape.map((p) => p[1]);\nconst S = (1.45 * xh) / (Math.max(...ys) - Math.min(...ys));\nexport const brandIcon = placeIcon(S, pad - S * Math.min(...xs), base - S * Math.max(...ys));\n\nlet x = brandIcon.cx + S * Math.max(...xs) + 1.5 * stem;\n/** The wordmark: one list of contours per letter. */\nexport const glyphs = letters.map(([glyph, w], i) => {\n const contours = glyph(x);\n x += w + (kern[i] ?? 0);\n return contours;\n});\n\n/** The box around a drawing: [x, y, width, height], with room for the pens that ride the outlines. */\nexport function box(contours: number[][][], margin = 5): [number, number, number, number] {\n const pts = contours.flat();\n const x0 = Math.floor(Math.min(...pts.map((p) => p[0])) - margin);\n const y0 = Math.floor(Math.min(...pts.map((p) => p[1])) - margin);\n const x1 = Math.ceil(Math.max(...pts.map((p) => p[0])) + margin);\n const y1 = Math.ceil(Math.max(...pts.map((p) => p[1])) + margin);\n return [x0, y0, x1 - x0, y1 - y0];\n}\nexport const brandBox = box([brandIcon.shape, ...glyphs.flat()]);\n\n/** The path of the first k points of each contour, closed once the contour is complete. */\nexport const pathD = (contours: number[][][], k = N) =>\n contours.map((pts) => \"M\" + pts.slice(0, k + 1).map((p) => p.map((v) => Math.round(v * 10) / 10).join(\",\")).join(\"L\") + (k === N ? \"Z\" : \"\")).join(\"\");\n\nexport const GRADIENT = { from: \"#ea3f25\", to: \"#ed6a2c\" };\nexport const INK = \"#111\";\nexport const STROKE = \"#f26a2e\";\n","/**\n * nuclo/nuclo-logo — the Nuclo logo (mark and name) as a nuclo component, drawn the\n * way nuclo.dev draws it: a Spirograph wheel rolls inside a ring and its two pens\n * trace the mark; then a pen writes each letter, n to o, each inking as the next begins.\n *\n * import nucloLogo from \"nuclo/nuclo-logo\";\n * main(nucloLogo({ height: 48 }));\n *\n * Its own entry, so apps that never show the logo never ship it. It builds on the\n * runtime's globals (svgSvg, scope, update, …), so the app imports \"nuclo\" as usual.\n * The svg starts finished, which is what SSR sends; on mount it is drawn again unless\n * `animate` is off or the visitor prefers reduced motion.\n */\nimport { brandBox, brandIcon as ic, glyphs, pathD, GRADIENT, INK, N, STROKE } from \"./geometry\";\n\nexport type NucloLogoOptions = {\n\t/** Height in px; the width follows the logo's proportions. Default 32. */\n\theight?: number;\n\t/** Draw the logo when it mounts. Default true. */\n\tanimate?: boolean;\n};\n\nconst ICON_DRAW = 1.4; // seconds the wheel takes\nconst LETTER_DRAW = 0.6; // seconds a pen takes per letter\nconst LEAD = 0.2; // how early each letter starts, before the last one ends\nconst INK_SET = 0.2; // seconds the ink takes to set, once the pen has closed the outline\n\n// One drawn thing: its contours, its fill and when its pen runs. k is how many points are drawn, ink its fill\ntype Piece = { contours: number[][][]; fill: string; start: number; end: number; letter: boolean; k: number; ink: number };\n\nlet instances = 0;\n\nexport default function nucloLogo({ height = 32, animate = true }: NucloLogoOptions = {}, ...mods: SVGElementModifierLike<\"svg\">[]) {\n\tconst id = `nuclo-logo-${instances++}`;\n\tconst width = Math.round((height * brandBox[2]) / brandBox[3]);\n\tconst sw = +(1.2 / (width / brandBox[2])).toFixed(2); // a ~1.2px pen line whatever the size\n\n\tconst piece = (contours: number[][][], fill: string, start: number, letter = false): Piece =>\n\t\t({ contours, fill, start, end: start + (letter ? LETTER_DRAW : ICON_DRAW), letter, k: N, ink: 1 });\n\tconst pieces = [\n\t\tpiece([ic.shape], `url(#${id}-fill)`, 0),\n\t\tpiece([ic.play], INK, 0),\n\t\t...glyphs.map((contours, i) => piece(contours, \"currentColor\", ICON_DRAW - LEAD + i * (LETTER_DRAW - LEAD), true)),\n\t];\n\tconst wheel = pieces[0];\n\tconst total = pieces[pieces.length - 1].end + INK_SET;\n\tlet now = total; // seconds into the drawing: the finished logo until it is drawn\n\n\tfunction paint() {\n\t\tconst seg = (from: number, to: number) => Math.min(1, Math.max(0, (now - from) / (to - from)));\n\t\tfor (const p of pieces) {\n\t\t\tp.k = Math.round((0.5 - Math.cos(Math.PI * seg(p.start, p.end)) / 2) * N);\n\t\t\tp.ink = seg(p.end, p.end + INK_SET); // fills only once the outline is closed\n\t\t}\n\t\tupdate(id);\n\t}\n\n\t// onMount runs before the first paint, so the finished logo never flashes\n\tfunction draw() {\n\t\tif (!animate || globalThis.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches) return;\n\t\tconst start = performance.now();\n\t\tlet raf = 0;\n\t\tconst frame = (ms: number) => {\n\t\t\tnow = Math.min(total, (ms - start) / 1000);\n\t\t\tpaint();\n\t\t\tif (now < total) raf = requestAnimationFrame(frame);\n\t\t};\n\t\tnow = 0;\n\t\tpaint();\n\t\traf = requestAnimationFrame(frame);\n\t\treturn () => cancelAnimationFrame(raf);\n\t}\n\n\t// A pen is on the page from the moment it starts until its ink has set\n\tconst pen = (p: Piece, pts: number[][]) =>\n\t\tcircleSvg({ cx: () => pts[p.k][0], cy: () => pts[p.k][1], r: 5, fill: \"currentColor\", stroke: STROKE, \"stroke-width\": 1.5, opacity: () => (now <= p.start ? 0 : 1 - p.ink) });\n\n\tconst arm = (p: Piece) =>\n\t\tlineSvg({ x1: () => ic.hub[p.k][0], y1: () => ic.hub[p.k][1], x2: () => p.contours[0][p.k][0], y2: () => p.contours[0][p.k][1] });\n\n\t// The line a pen has drawn so far. It fills when the contour closes\n\tconst trace = (p: Piece) =>\n\t\tpathSvg({ d: () => pathD(p.contours, p.k), fill: p.fill, \"fill-opacity\": () => p.ink, stroke: p.letter ? p.fill : STROKE, \"stroke-width\": sw, \"stroke-opacity\": () => (p.letter || p.ink < 1 ? 1 : 0) });\n\n\treturn svgSvg(\n\t\t{ viewBox: brandBox.join(\" \"), width, height, role: \"img\", \"aria-label\": \"Nuclo\", onMount: draw },\n\t\t...mods,\n\t\tscope(id),\n\t\tdefsSvg(\n\t\t\tlinearGradientSvg(\n\t\t\t\t{ id: `${id}-fill`, x1: 0, y1: 0, x2: 0, y2: 1 },\n\t\t\t\tstopSvg({ offset: \"0\", \"stop-color\": GRADIENT.from }),\n\t\t\t\tstopSvg({ offset: \"1\", \"stop-color\": GRADIENT.to }),\n\t\t\t),\n\t\t),\n\t\t// The ring, the wheel and its arms fade out as the mark's ink sets\n\t\tgSvg(\n\t\t\t{ fill: \"none\", stroke: STROKE, \"stroke-width\": sw, opacity: () => 1 - wheel.ink },\n\t\t\tcircleSvg({ cx: ic.cx, cy: ic.cy, r: ic.ring, \"stroke-opacity\": 0.25 }),\n\t\t\tcircleSvg({ cx: () => ic.hub[wheel.k][0], cy: () => ic.hub[wheel.k][1], r: ic.wheel }),\n\t\t\tarm(pieces[0]),\n\t\t\tarm(pieces[1]),\n\t\t),\n\t\t...pieces.map(trace),\n\t\t...pieces.flatMap((p) => p.contours.map((pts) => pen(p, pts))),\n\t);\n}\n"],"mappings":"AAKA,MAAMC,EAAK,KAAK,GASVC,EAAO,GACX,MAAM,KAAK,CAAE,OAAQ,GAAM,GAAI,EAAG,IAAM,CACtC,IAAMC,EAAKC,EAAA,IAAS,EAAIH,EACxB,MAAO,CAAE,GAAS,KAAK,IAAIE,CAAC,EAAIE,EAAI,KAAK,IAAM,EAAcF,CAAC,EAAI,GAAS,KAAK,IAAIA,CAAC,EAAIE,EAAI,KAAK,IAAM,EAAcF,CAAC,CAAC,CAC1H,CAAC,EACGG,EAAWJ,EAAI,EAAK,EACpBK,EAAUL,EAAI,EAAK,EACnBM,EAASN,EAAI,CAAC,EAKpB,SAAgBO,EAAU,EAAW,EAAY,EAAkB,CACjE,IAAMC,EAAS,GAAoBC,EAAI,KAAK,CAACC,EAAGC,KAAO,CAACC,EAAKC,EAAIH,EAAGI,EAAKD,EAAIF,CAAC,CAAC,EAC/E,MAAO,CAAE,IAAKH,EAAMF,CAAM,EAAG,MAAOE,EAAMJ,CAAQ,EAAG,KAAMI,EAAMH,CAAO,EAAG,KAAI,KAAI,KAAA,GAAU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GAAI,GAAGA,EAAG,OAAQ,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,GAAI,CAAE,EAC/C,QAAQ,CAAE,OAAQ,IAAK,aAAcN,EAAS,IAAK,CAAC,EACpD,QAAQ,CAAE,OAAQ,IAAK,aAAcA,EAAS,EAAG,CAAC,CACnD,CACD,EAEA,KACC,CAAE,KAAM,OAAQ,OAAQC,EAAQ,eAAgBQ,EAAI,YAAe,EAAIK,EAAM,GAAI,EACjF,UAAU,CAAE,GAAIjF,EAAG,GAAI,GAAIA,EAAG,GAAI,EAAGA,EAAG,KAAM,iBAAkB,GAAK,CAAC,EACtE,UAAU,CAAE,OAAUA,EAAG,IAAIiF,EAAM,EAAE,CAAC,GAAI,OAAUjF,EAAG,IAAIiF,EAAM,EAAE,CAAC,GAAI,EAAGjF,EAAG,KAAM,CAAC,EACrF4F,EAAIZ,EAAO,EAAE,EACbY,EAAIZ,EAAO,EAAE,CACd,EACA,GAAGA,EAAO,IAAIpD,CAAK,EACnB,GAAGoD,EAAO,QAAS,GAAM3B,EAAE,SAAS,IAAK,GAAQsC,EAAItC,EAAG1C,CAAG,CAAC,CAAC,CAC9D,CACD,C"}
|
|
1
|
+
{"version":3,"file":"nuclo.logo.mjs","names":["ic","PI","lap","d","_","i","t","rawShape","rawPlay","rawHub","placeIcon","s","cx","cy","place","pts","x","y","a","kern","line","x0","y0","x1","y1","arc","rad","from","to","trace","segs","L","sum","done","n","arch","up","c","end","rx","open","fo","fi","at","ang","cut","r0","r1","corner","cr","pill","ring","letters","xs","p","ys","S","brandIcon","glyphs","glyph","w","contours","box","margin","brandBox","pathD","k","v","GRADIENT","STROKE","INK_SET","instances","nucloLogo","height","animate","mods","id","width","sw","piece","fill","start","letter","pieces","wheel","total","now","paint","seg","draw","raf","frame","ms","pen","arm"],"sources":["../../src/logo/geometry.ts","../../src/logo/index.ts"],"sourcesContent":["// The Nuclo mark and wordmark as point lists: pure math, no DOM. The components\n// draw them and scripts/render-brand.ts writes the static SVG and PNG assets\n// from them, so every logo on the site comes from this one source.\n\nexport const N = 360; // points per contour. One wheel lap draws the icon; each pen draws its glyph in the same N steps\nconst PI = Math.PI;\n\n// ── The icon: a hypotrochoid with two pens on one wheel ──────────────────\nexport const R = 96; // the fixed ring\nexport const r = 32; // the rolling wheel. R / r = 3 gives three lobes\nconst outer = 90; // the shape's pen. d > r: the lobes overlap\nconst inner = 12; // the play triangle's pen. d < r: a rounded triangle\n\n// One lap of a pen at distance d from the wheel's center, around the origin\nconst lap = (d: number) =>\n Array.from({ length: N + 1 }, (_, i) => {\n const t = (i / N) * 2 * PI;\n return [(R - r) * Math.cos(t) + d * Math.cos(((R - r) / r) * t), (R - r) * Math.sin(t) - d * Math.sin(((R - r) / r) * t)];\n });\nconst rawShape = lap(outer);\nconst rawPlay = lap(inner);\nconst rawHub = lap(0);\n\nexport type Icon = { hub: number[][]; shape: number[][]; play: number[][]; cx: number; cy: number; ring: number; wheel: number };\n\n/** The icon scaled by s with the wheel's center at (cx, cy). */\nexport function placeIcon(s: number, cx: number, cy: number): Icon {\n const place = (pts: number[][]) => pts.map(([x, y]) => [cx + s * x, cy + s * y]);\n return { hub: place(rawHub), shape: place(rawShape), play: place(rawPlay), cx, cy, ring: R * s, wheel: r * s };\n}\n\n/** The icon alone in a 200 × 200 box, the outer pen touching the box's margin. */\nexport const icon = placeIcon(88 / (R - r + outer), 100, 100);\n\n// ── The wordmark on its unit grid. U is the module; the sizes are multiples of it ──\nconst U = 24;\nconst stem = U; // every stroke, straight or round, is one unit thick\nconst xh = 6 * U; // x-height\nconst pad = 2 * U;\nconst base = 9 * U + pad; // the baseline. The l is 9 units tall\nconst top = base - xh; // the x-height line\nconst mid = top + xh / 2;\nconst ovr = 4; // round forms overshoot the x-height and the baseline, so they look aligned\nconst ro = xh / 2 + ovr; // outer radius of c and o\nconst ri = ro - stem; // their counter\nconst A = 2.5 * U; // arch radius of n and u: narrower than the bowls\nconst lw = stem + 2; // the l is two units wider: a lone stem with round ends looks lighter\nconst a = (34 * PI) / 180; // half of the c's opening\n// The space between the inks of each pair, set by eye: n–u, u–c, c–l, l–o\nconst kern = [36, 27, 20, 25];\n\n// Each contour is a chain of lines and arcs. Angles turn counterclockwise and 0 points right\ntype Seg = { len: number; at: (t: number) => number[] };\nconst line = (x0: number, y0: number, x1: number, y1: number): Seg => ({\n len: Math.hypot(x1 - x0, y1 - y0),\n at: (t) => [x0 + (x1 - x0) * t, y0 + (y1 - y0) * t],\n});\nconst arc = (cx: number, cy: number, rad: number, from: number, to: number): Seg => ({\n len: rad * Math.abs(to - from),\n at: (t) => [cx + rad * Math.cos(from + (to - from) * t), cy - rad * Math.sin(from + (to - from) * t)],\n});\n// N + 1 points along the chain, the same distance apart\nconst trace = (segs: Seg[]) => {\n const L = segs.reduce((sum, s) => sum + s.len, 0);\n let i = 0;\n let done = 0;\n return Array.from({ length: N + 1 }, (_, n) => {\n const d = (n / N) * L;\n while (i < segs.length - 1 && done + segs[i].len < d) done += segs[i++].len;\n return segs[i].at((d - done) / segs[i].len);\n });\n};\n\n// n: two stems and an arch over the top. u: the same glyph, arch under the bottom\nconst arch = (x: number, up: boolean) => {\n const y = up ? base : top; // where the stems end, flat on the line\n const c = up ? top + A - ovr : base - A + ovr; // the arch's center. The arch overshoots the line like the o does\n const end = up ? 0 : 2 * PI; // the arch turns over the top, or under the bottom\n const rx = x + 2 * A;\n return trace([\n line(x, y, x, c),\n arc(x + A, c, A, PI, end),\n line(rx, c, rx, y),\n line(rx, y, rx - stem, y),\n line(rx - stem, y, rx - stem, c),\n arc(x + A, c, A - stem, end, PI),\n line(x + stem, c, x + stem, y),\n line(x + stem, y, x, y),\n ]);\n};\n// c: the o cut open on the right, 34° above and below the center line. The cuts point at the center.\n// Their four corners are rounded by q, so the cut ends sit with the pill of the l\nconst open = (cx: number) => {\n const q = 3;\n const fo = Math.asin(q / (ro - q)); // where a corner arc meets the outer circle, from the cut\n const fi = Math.asin(q / (ri + q)); // and the inner circle\n const at = (rad: number, ang: number): [number, number] => [cx + rad * Math.cos(ang), mid - rad * Math.sin(ang)];\n const cut = (r0: number, r1: number, ang: number) => line(...at(r0, ang), ...at(r1, ang));\n const corner = (cr: number, ang: number, from: number, to: number) => arc(...at(cr, ang), q, from, to);\n return trace([\n arc(cx, mid, ro, a + fo, 2 * PI - a - fo), // the outer curve, over the top and down the left\n corner(ro - q, -a - fo, -a - fo, -a + PI / 2), // the lower cut: outer corner,\n cut((ro - q) * Math.cos(fo), (ri + q) * Math.cos(fi), -a), // the cut,\n corner(ri + q, -a - fi, -a + PI / 2, -a - fi + PI), // inner corner\n arc(cx, mid, ri, 2 * PI - a - fi, a + fi), // the counter, back up the left\n corner(ri + q, a + fi, a + fi + PI, a + 1.5 * PI), // the upper cut: inner corner,\n cut((ri + q) * Math.cos(fi), (ro - q) * Math.cos(fo), a), // the cut,\n corner(ro - q, a + fo, a + 1.5 * PI, a + fo + 2 * PI), // outer corner\n ]);\n};\n// l: a pill from the ascender line to the baseline. Its round ends overshoot both lines like the bowls do\nconst pill = (x: number) => {\n const rad = lw / 2;\n const y0 = base - 9 * U - ovr + rad; // the center of the top cap\n const y1 = base + ovr - rad; // and of the bottom cap\n return trace([arc(x + rad, y0, rad, PI, 0), line(x + lw, y0, x + lw, y1), arc(x + rad, y1, rad, 0, -PI), line(x, y1, x, y0)]);\n};\n// o: two circles. They run in opposite directions, so the fill leaves the counter open\nconst ring = (cx: number) => [trace([arc(cx, mid, ro, PI, 3 * PI)]), trace([arc(cx, mid, ri, PI, -PI)])];\n\n// Each letter: its contours at x, and the width of its ink. The c's ink stops at its terminals\nconst letters: [(x: number) => number[][][], number][] = [\n [(x) => [arch(x, true)], 2 * A],\n [(x) => [arch(x, false)], 2 * A],\n [(x) => [open(x + ro)], ro + ro * Math.cos(a)],\n [(x) => [pill(x)], lw],\n [(x) => ring(x + ro), 2 * ro],\n];\n\n// ── The lockup: icon and wordmark on one baseline ────────────────────────\n// The icon is 1.45 x-heights tall, so it leads but does not overpower the word; its lowest lobe\n// touches the baseline; the n starts 1.5 stems after the tip of the right lobe\nconst xs = rawShape.map((p) => p[0]);\nconst ys = rawShape.map((p) => p[1]);\nconst S = (1.45 * xh) / (Math.max(...ys) - Math.min(...ys));\nexport const brandIcon = placeIcon(S, pad - S * Math.min(...xs), base - S * Math.max(...ys));\n\nlet x = brandIcon.cx + S * Math.max(...xs) + 1.5 * stem;\n/** The wordmark: one list of contours per letter. */\nexport const glyphs = letters.map(([glyph, w], i) => {\n const contours = glyph(x);\n x += w + (kern[i] ?? 0);\n return contours;\n});\n\n/** The box around a drawing: [x, y, width, height], with room for the pens that ride the outlines. */\nexport function box(contours: number[][][], margin = 5): [number, number, number, number] {\n const pts = contours.flat();\n const x0 = Math.floor(Math.min(...pts.map((p) => p[0])) - margin);\n const y0 = Math.floor(Math.min(...pts.map((p) => p[1])) - margin);\n const x1 = Math.ceil(Math.max(...pts.map((p) => p[0])) + margin);\n const y1 = Math.ceil(Math.max(...pts.map((p) => p[1])) + margin);\n return [x0, y0, x1 - x0, y1 - y0];\n}\nexport const brandBox = box([brandIcon.shape, ...glyphs.flat()]);\n\n/** The path of the first k points of each contour, closed once the contour is complete. */\nexport const pathD = (contours: number[][][], k = N) =>\n contours.map((pts) => \"M\" + pts.slice(0, k + 1).map((p) => p.map((v) => Math.round(v * 10) / 10).join(\",\")).join(\"L\") + (k === N ? \"Z\" : \"\")).join(\"\");\n\nexport const GRADIENT = { from: \"#ea3f25\", to: \"#ed6a2c\" };\nexport const INK = \"#111\";\nexport const STROKE = \"#f26a2e\";\n","/**\n * nuclo/nuclo-logo — the Nuclo logo (mark and name) as a nuclo component, drawn the\n * way nuclo.dev draws it: a Spirograph wheel rolls inside a ring and its two pens\n * trace the mark; then a pen writes each letter, n to o, each inking as the next begins.\n *\n * import nucloLogo from \"nuclo/nuclo-logo\";\n * main(nucloLogo({ height: 48 }));\n *\n * Its own entry, so apps that never show the logo never ship it. It builds on the\n * runtime's globals (svgSvg, scope, update, …), so the app imports \"nuclo\" as usual.\n * The svg starts finished, which is what SSR sends; on mount it is drawn again unless\n * `animate` is off or the visitor prefers reduced motion.\n */\nimport { brandBox, brandIcon as ic, glyphs, pathD, GRADIENT, INK, N, STROKE } from \"./geometry\";\n\nexport type NucloLogoOptions = {\n\t/** Height in px; the width follows the logo's proportions. Default 32. */\n\theight?: number;\n\t/** Draw the logo when it mounts. Default true. */\n\tanimate?: boolean;\n};\n\nconst ICON_DRAW = 1.4; // seconds the wheel takes\nconst LETTER_DRAW = 0.6; // seconds a pen takes per letter\nconst LEAD = 0.2; // how early each letter starts, before the last one ends\nconst INK_SET = 0.2; // seconds the ink takes to set, once the pen has closed the outline\n\n// One drawn thing: its contours, its fill and when its pen runs. k is how many points are drawn, ink its fill\ntype Piece = { contours: number[][][]; fill: string; start: number; end: number; letter: boolean; k: number; ink: number };\n\nlet instances = 0;\n\nexport default function nucloLogo({ height = 32, animate = true }: NucloLogoOptions = {}, ...mods: SVGElementModifierLike<\"svg\">[]) {\n\tconst id = `nuclo-logo-${instances++}`;\n\tconst width = Math.round((height * brandBox[2]) / brandBox[3]);\n\tconst sw = +(1.2 / (width / brandBox[2])).toFixed(2); // a ~1.2px pen line whatever the size\n\n\tconst piece = (contours: number[][][], fill: string, start: number, letter = false): Piece =>\n\t\t({ contours, fill, start, end: start + (letter ? LETTER_DRAW : ICON_DRAW), letter, k: N, ink: 1 });\n\tconst pieces = [\n\t\tpiece([ic.shape], `url(#${id}-fill)`, 0),\n\t\tpiece([ic.play], INK, 0),\n\t\t...glyphs.map((contours, i) => piece(contours, \"currentColor\", ICON_DRAW - LEAD + i * (LETTER_DRAW - LEAD), true)),\n\t];\n\tconst wheel = pieces[0];\n\tconst total = pieces[pieces.length - 1].end + INK_SET;\n\tlet now = total; // seconds into the drawing: the finished logo until it is drawn\n\n\tfunction paint() {\n\t\tconst seg = (from: number, to: number) => Math.min(1, Math.max(0, (now - from) / (to - from)));\n\t\tfor (const p of pieces) {\n\t\t\tp.k = Math.round((0.5 - Math.cos(Math.PI * seg(p.start, p.end)) / 2) * N);\n\t\t\tp.ink = seg(p.end, p.end + INK_SET); // fills only once the outline is closed\n\t\t}\n\t\tupdate(id);\n\t}\n\n\t// onMount runs before the first paint, so the finished logo never flashes\n\tfunction draw() {\n\t\tif (!animate || globalThis.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches) return;\n\t\tconst start = performance.now();\n\t\tlet raf = 0;\n\t\tconst frame = (ms: number) => {\n\t\t\tnow = Math.min(total, (ms - start) / 1000);\n\t\t\tpaint();\n\t\t\tif (now < total) raf = requestAnimationFrame(frame);\n\t\t};\n\t\tnow = 0;\n\t\tpaint();\n\t\traf = requestAnimationFrame(frame);\n\t\treturn () => cancelAnimationFrame(raf);\n\t}\n\n\t// A pen is on the page from the moment it starts until its ink has set\n\tconst pen = (p: Piece, pts: number[][]) =>\n\t\tcircleSvg({ cx: () => pts[p.k][0], cy: () => pts[p.k][1], r: 5, fill: \"currentColor\", stroke: STROKE, \"stroke-width\": 1.5, opacity: () => (now <= p.start ? 0 : 1 - p.ink) });\n\n\tconst arm = (p: Piece) =>\n\t\tlineSvg({ x1: () => ic.hub[p.k][0], y1: () => ic.hub[p.k][1], x2: () => p.contours[0][p.k][0], y2: () => p.contours[0][p.k][1] });\n\n\t// The line a pen has drawn so far. It fills when the contour closes\n\tconst trace = (p: Piece) =>\n\t\tpathSvg({ d: () => pathD(p.contours, p.k), fill: p.fill, \"fill-opacity\": () => p.ink, stroke: p.letter ? p.fill : STROKE, \"stroke-width\": sw, \"stroke-opacity\": () => (p.letter || p.ink < 1 ? 1 : 0) });\n\n\treturn svgSvg(\n\t\t{ viewBox: brandBox.join(\" \"), width, height, role: \"img\", \"aria-label\": \"Nuclo\", onMount: draw },\n\t\t...mods,\n\t\tscope(id),\n\t\tdefsSvg(\n\t\t\tlinearGradientSvg(\n\t\t\t\t{ id: `${id}-fill`, x1: 0, y1: 0, x2: 0, y2: 1 },\n\t\t\t\tstopSvg({ offset: \"0\", \"stop-color\": GRADIENT.from }),\n\t\t\t\tstopSvg({ offset: \"1\", \"stop-color\": GRADIENT.to }),\n\t\t\t),\n\t\t),\n\t\t// The ring, the wheel and its arms fade out as the mark's ink sets\n\t\tgSvg(\n\t\t\t{ fill: \"none\", stroke: STROKE, \"stroke-width\": sw, opacity: () => 1 - wheel.ink },\n\t\t\tcircleSvg({ cx: ic.cx, cy: ic.cy, r: ic.ring, \"stroke-opacity\": 0.25 }),\n\t\t\tcircleSvg({ cx: () => ic.hub[wheel.k][0], cy: () => ic.hub[wheel.k][1], r: ic.wheel }),\n\t\t\tarm(pieces[0]),\n\t\t\tarm(pieces[1]),\n\t\t),\n\t\t...pieces.map(trace),\n\t\t...pieces.flatMap((p) => p.contours.map((pts) => pen(p, pts))),\n\t);\n}\n"],"mappings":"AAKA,MAAMC,EAAK,KAAK,GASVC,EAAOC,GACX,MAAM,KAAK,CAAE,OAAQ,GAAM,GAAIC,EAAGC,IAAM,CACtC,IAAMC,EAAKD,EAAA,IAAS,EAAIJ,EACxB,MAAO,CAAE,GAAS,KAAK,IAAIK,CAAC,EAAIH,EAAI,KAAK,IAAM,EAAcG,CAAC,EAAI,GAAS,KAAK,IAAIA,CAAC,EAAIH,EAAI,KAAK,IAAM,EAAcG,CAAC,CAAC,CAC1H,CAAC,EACGC,EAAWL,EAAI,EAAK,EACpBM,EAAUN,EAAI,EAAK,EACnBO,EAASP,EAAI,CAAC,EAKpB,SAAgBQ,EAAUC,EAAWC,EAAYC,EAAkB,CACjE,IAAMC,EAASC,GAAoBA,EAAI,KAAK,CAACC,EAAGC,KAAO,CAACL,EAAKD,EAAIK,EAAGH,EAAKF,EAAIM,CAAC,CAAC,EAC/E,MAAO,CAAE,IAAKH,EAAML,CAAM,EAAG,MAAOK,EAAMP,CAAQ,EAAG,KAAMO,EAAMN,CAAO,EAAGI,KAAIC,KAAI,KAAA,GAAUF,EAAG,MAAA,GAAWA,CAAE,CAC/G,CAGoBD,EAAU,GAAM,IAAgB,IAAK,GAAG,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CAAE,EACR,QACC,kBACC,CAAE,GAAI,GAAGA,EAAG,OAAQ,GAAI,EAAG,GAAI,EAAG,GAAI,EAAG,GAAI,CAAE,EAC/C,QAAQ,CAAE,OAAQ,IAAK,aAAcR,EAAS,IAAK,CAAC,EACpD,QAAQ,CAAE,OAAQ,IAAK,aAAcA,EAAS,EAAG,CAAC,CACnD,CACD,EAEA,KACC,CAAE,KAAM,OAAQ,OAAQC,EAAQ,eAAgBS,EAAI,YAAe,EAAIM,EAAM,GAAI,EACjF,UAAU,CAAE,GAAIpF,EAAG,GAAI,GAAIA,EAAG,GAAI,EAAGA,EAAG,KAAM,iBAAkB,GAAK,CAAC,EACtE,UAAU,CAAE,OAAUA,EAAG,IAAIoF,EAAM,EAAE,CAAC,GAAI,OAAUpF,EAAG,IAAIoF,EAAM,EAAE,CAAC,GAAI,EAAGpF,EAAG,KAAM,CAAC,EACrF8F,EAAIX,EAAO,EAAE,EACbW,EAAIX,EAAO,EAAE,CACd,EACA,GAAGA,EAAO,IAAItD,CAAK,EACnB,GAAGsD,EAAO,QAAS7B,GAAMA,EAAE,SAAS,IAAKvC,GAAQ8E,EAAIvC,EAAGvC,CAAG,CAAC,CAAC,CAC9D,CACD,C"}
|
package/dist/nuclo.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=/* @__PURE__ */ new Set([`onMount`,`onDestroy`]),t=/* @__PURE__ */ new WeakMap,n=/* @__PURE__ */ new WeakMap;function r(t){if(t.length<=2||t.charCodeAt(0)!==111||t.charCodeAt(1)!==110)return null;let n=t.charCodeAt(2);return n<65||n>90||e.has(t)?null:t===`onDoubleClick`?`ondblclick`:t.toLowerCase()}function i(e,r,i){if(r in e){e[r]=i;let t=n.get(e);if(!t){n.set(e,[r,i]);return}for(let e=0;e<t.length;e+=2)if(t[e]===r){t[e+1]=i;return}t.push(r,i);return}let a=r.slice(2),o=t.get(e);if(o){for(let t=0;t<o.length;t+=2){if(o[t]!==a)continue;let n=o[t+1];if(n===i)return;e.removeEventListener(a,n),e.addEventListener(a,i),o[t+1]=i;return}e.addEventListener(a,i),o.push(a,i)}else e.addEventListener(a,i),t.set(e,[a,i])}function a(e){let r=n.get(e);if(r){let t=e;for(let e=0;e<r.length;e+=2){let n=r[e];t[n]===r[e+1]&&(t[n]=null)}n.delete(e)}let i=t.get(e);if(i){for(let t=0;t<i.length;t+=2)e.removeEventListener(i[t],i[t+1]);t.delete(e)}}function o(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}const s=typeof window<`u`&&typeof document<`u`,c=Symbol.for(`nuclo.serializing.v1`),l=globalThis,u=l[c]??(l[c]={on:!1,scratch:/* @__PURE__ */ new Map});function d(){return u.on}function f(){return u.scratch}const p=[/* @__PURE__ */ new Set,/* @__PURE__ */ new Set,/* @__PURE__ */ new Set,/* @__PURE__ */ new Set],m=[[],[],[],[]];let h=/* @__PURE__ */ new WeakMap,ee=!1,g=!1;const _=/* @__PURE__ */ new Set;function v(e,t){p[e].add(t),m[e].push(t)}function y(e,t){return h.get(e)?.[t]??_}const te=[];let b=null;const x=[];function ne(e){let t=e,n;for(;t&&(n=b.get(t))===void 0;)x.push(t),t=t.parentNode;n===void 0&&(n=te);for(let e=x.length-1;e>=0;e--){let t=x[e];t.nodeType===1&&T.has(t)&&(n=[t,...n]),b.set(t,n)}return x.length=0,n}function re(e,t){let n=t.deref();if(!n||!n.isConnected)return;let r=ne(n.nodeType===1?n:n.parentNode);for(let n=0;n<r.length;n++){let i=r[n],a=h.get(i);a||h.set(i,a=[/* @__PURE__ */ new Set,/* @__PURE__ */ new Set,/* @__PURE__ */ new Set,/* @__PURE__ */ new Set]);let o=a[e];o.add(t),o.size>=(E.get(o)??ae)&&oe(o)}}function ie(){if(g){g=!1,h=/* @__PURE__ */ new WeakMap,b=/* @__PURE__ */ new Map;for(let e=0;e<4;e++){m[e].length=0;for(let t of p[e])re(e,t)}b=null}else{for(let e=0;e<4;e++){let t=m[e];if(t.length!==0){if(ee){b??=/* @__PURE__ */ new Map;for(let n=0;n<t.length;n++)re(e,t[n])}t.length=0}}b=null}}const S=/* @__PURE__ */ new Map,C=typeof FinalizationRegistry<`u`?new FinalizationRegistry(({id:e,ref:t})=>{let n=S.get(e);n?.delete(t)&&n.size===0&&S.delete(e)}):null;function w(e){let t=[],n=/* @__PURE__ */ new Set;for(let r of e){if(typeof r!=`string`)continue;let e=r.trim();e&&(n.has(e)||(n.add(e),t.push(e)))}return t}const T=/* @__PURE__ */ new WeakMap,E=/* @__PURE__ */ new WeakMap,ae=64;function oe(e){for(let t of e)t.deref()===void 0&&e.delete(t);E.set(e,Math.max(64,e.size*2))}function se(e,t){let n=T.get(t);if(n||T.set(t,n=/* @__PURE__ */ new Set),n.has(e))return;n.add(e),ee=!0,t.isConnected&&(g=!0);let r=S.get(e);r||S.set(e,r=/* @__PURE__ */ new Set);let i=new WeakRef(t);r.add(i),C?.register(t,{id:e,ref:i}),r.size>=(E.get(r)??64)&&oe(r)}function ce(e){let t=w(e);if(t.length===0)return[];let n=/* @__PURE__ */ new Set;for(let e of t){let t=S.get(e);if(t){for(let r of t){let i=r.deref();i===void 0?t.delete(r):i.isConnected?n.add(i):(t.delete(r),T.get(i)?.delete(e))}t.size===0&&S.delete(e)}}if(n.size>1){for(let e of n)for(let t=e.parentNode;t;t=t.parentNode)if(n.has(t)){n.delete(e);break}}return Array.from(n)}function le(...e){let t=w(e);return function(e){if(s&&!d()&&e instanceof Element)for(let n of t)se(n,e)}}const ue=p[3],D=/* @__PURE__ */ new WeakMap,de=p[2],O=/* @__PURE__ */ new WeakMap;function fe(e,t,n){let r=D.get(e);if(r){r.resolver=t,r.lastValue=n;return}let i=new WeakRef(e);v(3,i),D.set(e,{ref:i,resolver:t,lastValue:n})}function pe(e){let t=O.get(e);if(!t){let n=new WeakRef(e);t={ref:n,attributeResolvers:[]},v(2,n),O.set(e,t)}return t}function me(e){let t=D.get(e);t&&(ue.delete(t.ref),D.delete(e))}function he(e){let t=O.get(e);t&&(de.delete(t.ref),O.delete(e))}function ge(e){let t=e.nodeType;if(t===1){let t=e;gt(t),he(t)}else if(t===3){me(e);return}else if(t===8){Je(e);return}if(s&&!Xe())for(let t=e.firstChild;t!==null;t=t.nextSibling)ge(t);else{let t=Xe()?Array.from(e.childNodes):e.childNodes;for(let e=0;e<t.length;e++)ge(t[e])}t===1&&Je(e)}function k(e){if(!e?.parentNode)return!1;try{return ge(e),e.parentNode?.removeChild(e),!0}catch(e){return o(`Failed to remove child node`,e),!1}}function _e(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return o(`Failed to insert node before reference`,e),!1}}function ve(e){return document.createComment(e,!0)}function ye(e,t){return{start:ve(`${e}-start-${t}`),end:ve(`${e}-end`)}}function be(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;k(n),n=e}}function xe(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)_e(n,e[r],t)}function Se(e,t,n){let r=e,i=Object.getOwnPropertyDescriptor(r,`appendChild`),a=r.insertBefore;r.appendChild=function(e){return a.call(r,e,t)};try{return n()}finally{i?Object.defineProperty(r,"appendChild",i):Reflect.deleteProperty(r,`appendChild`)}}let A=!1,Ce=!1,we=/* @__PURE__ */ new WeakMap;function j(){return A}function M(){return A&&Ce}function Te(e=!1){A=!0,Ce=e,we=/* @__PURE__ */ new WeakMap}function Ee(){A=!1,Ce=!1,we=/* @__PURE__ */ new WeakMap}function De(e){let t=A;A=!1;try{return e()}finally{A=t}}function N(e){let t=we.get(e);return t===void 0?e.firstChild:t}function P(e,t){we.set(e,t)}function Oe(e,t){let n=N(e);return P(e,n),De(()=>n?Se(e,n,t):t())}function ke(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function Ae(e,t=Ce){let n=N(e),r=!1;for(;n&&ke(n);){let e=n.nextSibling;t&&k(n),n=e,r=!0}r&&P(e,n)}function F(e){let t=N(e);return t&&P(e,t.nextSibling),t}function je(e){let t=N(e);if(!t||t.nodeType!==3)return null;if(ke(t)){let e=t.nextSibling;for(;e&&ke(e);)e=e.nextSibling;if(e&&e.nodeType===8&&(e.textContent??``).trimStart().startsWith(`text-`))return null}return F(e),t}function Me(e,t){Ae(e);let n=N(e),r=t+`-start-`;if(!n||n.nodeType!==8||!n.textContent?.startsWith(r))return null;F(e);let i=t+`-end`,a=0;for(let e=n.nextSibling;e;e=e.nextSibling){if(e.nodeType!==8)continue;let t=e.textContent;if(t===i){if(a===0)return{start:n,end:e,recreated:!1};a--}else t?.startsWith(r)&&a++}let o=document.createComment(i);return e.insertBefore(o,n.nextSibling),{start:n,end:o,recreated:!0}}function Ne(e,t){if(!A)return null;Ae(e);let n=N(e);if(n&&n.nodeType===1){let r=n.tagName;if(r===t||r.toLowerCase()===t)return F(e)}return null}function Pe(e,t){if(!t||t.parentNode!==e)return;let n=N(e);for(;n;){let e=n===t?null:n.nextSibling;k(n),n=e}P(e,null)}const I=/* @__PURE__ */ new WeakMap;let Fe=0,L=[];function Ie(){return!s||d()}function Le(e){let t=I.get(e);return t||(t={mount:null,destroy:null,dispose:null,state:0},I.set(e,t),Fe++,L.push(new WeakRef(e))),t}function Re(e,t){return e===null?t:Array.isArray(e)?(e.push(t),e):[e,t]}function ze(e,t){if(Ie())return;let n=Le(e);n.state!==2&&(n.state!==0&&M()||(n.mount=Re(n.mount,t)))}function Be(e,t){if(Ie())return;let n=Le(e);n.state!==2&&(n.state!==0&&M()||(n.destroy=Re(n.destroy,t)))}function Ve(e,t){if(Ie())return;let n=Le(e);n.state!==2&&(n.dispose=t)}function He(e,t,n){if(n.state===1)try{let r=t(e);typeof r==`function`&&(I.get(e)?.state===2?Ue(e,r):n.destroy=Re(n.destroy,r))}catch(e){o(`Error in mount callback`,e)}}function Ue(e,t){try{t(e)}catch(e){o(`Error in destroy callback`,e)}}function We(e){let t=I.get(e);if(t.state!==0)return;t.state=1;let n=t.mount;if(t.mount=null,n!==null){if(Array.isArray(n))for(let r=0;r<n.length;r++)He(e,n[r],t);else He(e,n,t)}}function Ge(){if(L.length===0)return;let e=L;L=[];for(let t=0;t<e.length;t++){let n=e[t].deref();n&&We(n)}}function Ke(){return L.length}function qe(e){for(let t=L.length-1;t>=e;t--){let e=L[t].deref();e&&!e.isConnected&&Je(e)}}function Je(e){let t=I.get(e);if(!t||t.state===2)return;let n=t.state===1;t.state=2,Fe--;let r=t.dispose;if(r!==null){t.dispose=null;try{r(e)}catch(e){o(`Error disposing node`,e)}}let i=e;if(n){let e=t.destroy;if(e!==null){if(Array.isArray(e))for(let t=0;t<e.length;t++)Ue(i,e[t]);else Ue(i,e)}}t.mount=null,t.destroy=null}function Ye(e){return I.get(e)?.state===1}function Xe(){return Fe>0}const Ze=Symbol(`nuclo.factory.tag`),Qe=Symbol(`nuclo.factory.mods`),$e=Symbol(`nuclo.event.modifier`);let et=0;const tt=[];let nt=0;function rt(){return nt>=tt.length&&tt.push(()=>null),tt[nt++]}function it(e,t,n){e[Ze]=t,e[Qe]=n}function at(e){return typeof e==`function`?e[Qe]:void 0}function ot(e){return typeof e==`function`?e[Ze]:void 0}function st(e){return e[$e]=!0,e}function ct(e){return typeof e==`function`&&e[$e]===!0}function lt(){return et>0}function ut(e,t,n){et++;try{return e(t,n)}finally{et--}}function dt(){return nt}function ft(e){for(;nt>e;){let e=tt[--nt];e[Ze]=void 0,e[Qe]=void 0}}const pt=/* @__PURE__ */ new WeakMap;function mt(e,t){let n=pt.get(e);n?Array.isArray(n)?n.includes(t)||n.push(t):n!==t&&pt.set(e,[n,t]):pt.set(e,t)}function ht(e,t){e.removeEventListener(t.type,t.wrapped,t.capture)}function gt(e){a(e);let t=pt.get(e);if(t){if(Array.isArray(t))for(let n=0;n<t.length;n++)ht(e,t[n]);else ht(e,t);pt.delete(e)}}function _t(e){}function vt(e,t){return s?function(n){if(!n)return;let r=n;e===`mount`?ze(r,t):Be(r,t)}:_t}function yt(e,t,n){return{type:e,wrapped:function(n){let r=this;try{t.call(r,n)}catch(t){o(`Error in '${e}' listener`,t)}},capture:n}}function bt(e,t,n){if(e===`mount`||e===`destroy`)return vt(e,t);if(!s)return _t;let r=yt(e,t,n===!0||typeof n==`object`&&!!n&&n.capture===!0);return st(function(t){if(!t||typeof t.addEventListener!=`function`)return;let i=t;i.addEventListener(e,r.wrapped,n),mt(i,r)})}function xt(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function St(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function Ct(e){return typeof e==`object`&&!!e}function R(e){return typeof e==`function`}function wt(e){return R(e)&&e.length===0}function Tt(e){return e==null||typeof e==`object`||typeof e==`function`?``:String(e)}function Et(e,t){let n=Tt(t),r=document.createTextNode(n);return s&&!d()&&fe(r,e,n),r}function Dt(e){if(!e)return Ot(ue);for(let t of e.roots)Ot(y(t,3))}function Ot(e){for(let t of e){let n=t.deref(),r=n&&D.get(n);if(!r||r.ref!==t||!n.isConnected){r&&r.ref===t&&D.delete(n),e.delete(t),ue.delete(t);continue}let i;try{i=Tt(r.resolver())}catch(e){o(`Failed to update reactive text node`,e),i=``}i!==r.lastValue&&(n.textContent=i,r.lastValue=i)}}function z(e,t=null,n=null){return{kind:e,keys:t,child:n}}const kt=[];let B=0;function At(){return B}function jt(e){B=e}function Mt(e){return B=0,e.leafCount===0?kt:Array(e.leafCount)}function Nt(e,t,n,r,i){e[B]=t,e[B+1]=n,e[B+2]=r,e[B+3]=i,B+=4}function Pt(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r.kind===0){for(let e=0;e<r.keys.length;e++)if(r.keys[e].key===t&&r.keys[e].kind!==3)return!0}}return!1}function Ft(e,t){let n=[];for(let e=0;e<t.length;e++){let i=t[e];if(i==null){n.push(z(4));continue}let a=typeof i;if(a===`function`){let e=at(i);if(e!==void 0){let t=ot(i);if(!t)return null;let r=Ft(t,e);if(!r)return null;n.push(z(3,null,r));continue}if(i.length===0){let e;try{e=i()}catch{return null}if(e==null||typeof e!=`object`&&typeof e!=`function`){n.push(z(2));continue}return null}if(ct(i)){n.push(z(5));continue}return null}if(a===`object`){if(St(i))return null;let e=i,t=Object.keys(e),a=[];for(let i=0;i<t.length;i++){let o=t[i],s=e[o];if(s==null){a.push({key:o,kind:3,prop:!1,cloned:!1,value:void 0});continue}if(o===`style`||Pt(n,o))return null;let c=typeof s;if(c===`function`){let e=r(o);if(e){a.push({key:o,kind:1,prop:!1,cloned:!1,value:e});continue}if(o===`className`&&s.length===0){a.push({key:o,kind:2,prop:!1,cloned:!1,value:void 0});continue}return null}if(c===`object`)return null;a.push({key:o,kind:0,prop:!1,cloned:!1,value:s})}n.push(z(0,a))}else n.push(z(1))}let i=!1,a=!1,o=0;for(let e=0;e<n.length;e++){let t=n[e];if(t.kind===5)i=!0;else if(t.kind===2)o+=4;else if(t.kind===3)a||=t.child.subtreeEvents,o+=t.child.leafCount;else if(t.kind===0)for(let e=0;e<t.keys.length;e++)t.keys[e].kind===1?i=!0:t.keys[e].kind===2&&(o+=4)}return{tag:e,slots:n,events:i,subtreeEvents:i||a,eventProps:null,tracked:i,leafCount:o}}function It(e,t){if(!e.subtreeEvents)return;let n=e.eventProps;if(n!==null){let e=t;for(let t=0;t<n.length;t++)typeof e[n[t]]==`function`&&(e[n[t]]=null)}e.tracked&>(t);let r=e.slots,i=t.firstChild;for(let e=0;e<r.length&&i!==null;e++){let t=r[e];switch(t.kind){case 1:case 2:i=i.nextSibling;break;case 3:t.child.subtreeEvents&&It(t.child,i),i=i.nextSibling}}}function Lt(e,t){let n=e.slots,r=t.firstChild,i=!1;for(let a=0;a<n.length;a++){let o=n[a];switch(o.kind){case 5:i=!0;break;case 0:{let n=o.keys;for(let r=0;r<n.length;r++){let a=n[r];a.kind===1?(a.prop=a.value in t,a.prop?(e.eventProps??=[]).push(a.value):i=!0):a.kind===0?(a.prop=a.key in t,a.cloned=a.prop?t[a.key]===a.value:t.getAttribute(a.key)===String(a.value)):a.kind===2&&t.removeAttribute(`class`)}break}case 1:case 2:r&&=r.nextSibling;break;case 3:if(!r)return;Lt(o.child,r),r=r.nextSibling}}e.tracked=i}function Rt(e,t,n,r){let a=e.slots;if(t.length!==a.length)return!1;let o=n.firstChild;for(let e=0;e<a.length;e++){let s=a[e],c=t[e];switch(s.kind){case 0:{if(typeof c!=`object`||!c)return!1;let e=c,t=s.keys,a=0;for(let t in e)a++;if(a!==t.length)return!1;for(let a=0;a<t.length;a++){let o=t[a],s=e[o.key];switch(o.kind){case 0:if(s==null||typeof s==`object`||typeof s==`function`)return!1;if(s===o.value&&o.cloned)break;if(o.prop){let e=n;e[o.key]!==s&&(e[o.key]=s)}else{let e=String(s);n.getAttribute(o.key)!==e&&n.setAttribute(o.key,e)}break;case 1:{if(typeof s!=`function`)return!1;let e=o.value;o.prop?n[e]=s:i(n,e,s);break}case 2:{if(typeof s!=`function`||s.length!==0)return!1;let e=s,t;try{t=e()}catch{return!1}let i=t?String(t):``;i&&(n.className=i),Nt(r,1,n,e,i);break}case 3:if(s!=null||!(o.key in e))return!1}}break}case 1:if(c==null||typeof c==`object`||typeof c==`function`||!o)return!1;o.nodeValue=String(c),o=o.nextSibling;break;case 2:{if(typeof c!=`function`||c.length!==0||at(c)!==void 0||!o)return!1;let e;try{e=c()}catch{return!1}if(e!=null&&(typeof e==`object`||typeof e==`function`))return!1;let t=Tt(e),n=o;n.nodeValue=t,Nt(r,0,n,c,t),o=n.nextSibling;break}case 3:{let e=at(c);if(e===void 0||ot(c)!==s.child.tag||!o||!Rt(s.child,e,o,r))return!1;o=o.nextSibling;break}case 4:if(c!=null)return!1;break;case 5:if(!ct(c))return!1;c(n,0)}}return!0}function zt(e,t,n,r){let i=e.slots;if(t.length!==i.length)return!1;let a=n.firstChild;for(let e=0;e<i.length;e++){let o=i[e],s=t[e];switch(o.kind){case 0:{if(typeof s!=`object`||!s)return!1;let e=s,t=o.keys,i=0;for(let a in e){if(i>=t.length)return!1;let o=t[i];if(o.key!==a)return!1;i++;let s=e[a];if(o.kind===2){if(typeof s!=`function`||s.length!==0)return!1;he(n),Nt(r,1,n,s,n.className)}}if(i!==t.length)return!1;break}case 1:if(!a)return!1;a=a.nextSibling;break;case 2:{if(typeof s!=`function`||s.length!==0||!a||a.nodeType!==3)return!1;let e=a;me(e),Nt(r,0,e,s,e.nodeValue??``),a=e.nextSibling;break}case 3:{let e=at(s);if(e===void 0||ot(s)!==o.child.tag||!a||!zt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1;break;case 5:if(!ct(s))return!1}}return!0}function Bt(e){for(let t=0;t<e.length;t+=4){let n;try{n=e[t+2]()}catch{continue}if(e[t]===0){let r=Tt(n);r!==e[t+3]&&(e[t+1].nodeValue=r,e[t+3]=r)}else{let r=n?String(n):``;r!==e[t+3]&&(e[t+1].className=r,e[t+3]=r)}}}const Vt={};function Ht(e,t){let n;try{n=t.resolver()}catch(e){o(`Failed to resolve reactive attribute: ${t.key}`,e);return}let r=typeof n!=`object`||!n;if(!(r&&Object.is(n,t.lastValue)))try{let i=t.apply(e,t.key,n);t.lastValue=r&&i!==!1?n:Vt}catch(e){o(`Failed to apply reactive attribute: ${t.key}`,e)}}function Ut(e,t,n,r){let i=e,a={key:t,resolver:n,apply:r,lastValue:Vt};if(s&&!d()){let e=pe(i).attributeResolvers,n=0;for(;n<e.length&&e[n].key!==t;)n++;e[n]=a}Ht(i,a)}function Wt(e){if(!e)return Gt(de);for(let t of e.roots)Gt(y(t,2))}function Gt(e){for(let t of e){let n=t.deref(),r=n&&O.get(n);if(!r||r.ref!==t||!n.isConnected){r&&r.ref===t&&O.delete(n),e.delete(t),de.delete(t);continue}let i=r.attributeResolvers;for(let e=0;e<i.length;e++)Ht(n,i[e])}}function Kt(e,t){let n=e.style;if(n&&t)for(let e in t){let r=t[e];try{n[e]=r==null?``:String(r)}catch{o(`Failed to set style property '${e}'`)}}}function qt(e,t,n){Kt(e,n)}function Jt(e,t){R(t)?Ut(e,`style`,t,qt):Kt(e,t)}const V=/* @__PURE__ */ new WeakMap,Yt=/* @__PURE__ */ new WeakSet;function Xt(e){return e instanceof HTMLElement?e.className:e.getAttribute(`class`)||``}function Zt(e,t){e instanceof HTMLElement?e.className=t:e.setAttribute(`class`,t)}function Qt(e,t){let n=t.length,r=0;for(let i=0;i<=n;i++)(i===n||t.charCodeAt(i)===32)&&(i>r&&e.add(t.substring(r,i)),r=i+1)}function $t(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function en(e){let t=Xt(e);if(t&&!V.has(e)){let n=/* @__PURE__ */ new Set;Qt(n,t),V.set(e,n)}Yt.add(e)}function tn(e){V.delete(e),Yt.delete(e)}function nn(e){return Yt.has(e)}function rn(e,t){if(!t)return;let n=V.get(e);n||(n=/* @__PURE__ */ new Set,V.set(e,n)),Qt(n,t)}function an(e,t){let n=V.get(e);if(!n||n.size===0){let n=t||``;Xt(e)!==n&&Zt(e,n);return}if(!t){Zt(e,$t(n));return}let r=$t(n),i=t.length,a=0;for(let e=0;e<=i;e++)if(e===i||t.charCodeAt(e)===32){if(e>a){let i=t.substring(a,e);n.has(i)||(r+=` `+i)}a=e+1}Zt(e,r)}function on(e,t){if(!t)return;let n=Xt(e);if(n&&n!==t){let r=/* @__PURE__ */ new Set;Qt(r,n),Qt(r,t),Zt(e,$t(r))}else Zt(e,t)}const sn=/* @__PURE__ */ new WeakMap;function cn(e,t){let n=String(t);if(sn.set(e,t),e.value===n)return;let r=e.selectedIndex;if(e.value=n,e.value!==n)return e.selectedIndex=r,!1}function ln(e){let t=sn.get(e);t!==void 0&&cn(e,t)}function un(e){sn.delete(e)}function dn(e,t,n,r){if(n!=null){if(r&&t===`className`)on(e,String(n));else if(e instanceof Element&&e.namespaceURI===`http://www.w3.org/2000/svg`)e.setAttribute(t===`className`?`class`:t,String(n));else if(t in e){if(t===`value`&&e.localName===`select`)return cn(e,n);try{e[t]=n}catch{e instanceof Element&&e.setAttribute(t,String(n))}}else e instanceof Element&&e.setAttribute(t,String(n))}}function fn(e,t,n){an(e,String(n||``))}function pn(e,t,n,a=!1){if(n==null)return;let o=t;if(o===`style`){Jt(e,n);return}if(R(n)){if(o===`onMount`){ze(e,n);return}if(o===`onDestroy`){Be(e,n);return}if(o===`onClick`){i(e,`onclick`,n);return}if(o.charCodeAt(0)===111&&o.charCodeAt(1)===110){let t=r(o);if(t){i(e,t,n);return}if(o in e){i(e,o,n);return}}if(n.length===0){let t=n;o===`className`?(en(e),Ut(e,o,t,fn)):Ut(e,o,t,dn);return}}let s=e;if(o===`className`&&nn(s)){let e=String(n||``);e&&(rn(s,e),on(s,e))}else dn(s,o,n,a)}function mn(e,t,n=!0){let r=!1;for(let i in t){if(i===`value`&&e.localName===`input`){r=!0;continue}let a=i,o=t[i];pn(e,a,o,n&&a===`className`)}r&&pn(e,`value`,t.value)}function hn(e){return Ct(e)&&!St(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function gn(e){Ae(e);let t=N(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function _n(e,t){let n=N(e);if(n&&n.nodeType===3)return F(e),n.textContent!==t&&(n.textContent=t),n;let r=document.createTextNode(t);return e.insertBefore(r,n),P(e,n),r}function vn(e,t,n){if(t==null)return null;if(R(t)){if(wt(t))try{let r=t();if(hn(r))return mn(e,{className:()=>{let e=t();return hn(e)?e.className:``}}),null;if(xt(r)){if(j()){let n=e,i=Tt(r);if(M()){let e=je(n);if(e)return e.textContent!==i&&(e.textContent=i),fe(e,t,i),null}if(gn(n))return F(n),fe(_n(n,i),t,i),null}return yn(n,Et(t,r))}return null}catch(e){return o(`Error evaluating reactive text function:`,e),yn(n,Et(bn,``))}let r=t(e,n);return r==null?null:xt(r)?yn(n,document.createTextNode(String(r))):St(r)?r:(Ct(r)&&mn(e,r),null)}let r=t;if(xt(r)){if(j()){let t=e,n=String(r),i=M();if(i){let e=je(t);if(e)return me(e),e.textContent!==n&&(e.textContent=n),null}if(gn(t)){F(t);let e=_n(t,n);return i&&me(e),null}}return yn(n,document.createTextNode(String(r)))}return St(r)?r:(mn(e,r),null)}function yn(e,t){if(s&&!j()&&!d())return t;let n=document.createDocumentFragment();return n.appendChild(ve(` text-${e} `)),n.appendChild(t),n}function bn(){return``}const H=p[1],U=/* @__PURE__ */ new WeakMap,xn=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{H.delete(e)}):null;function Sn(e,t){for(let t=0;t<e.length;t++){let n=e[t].condition;if(typeof n==`function`?n():n)return t}return t.length>0?-1:null}function Cn(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=Sn(t,n);o!==e.activeIndex&&(be(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&kn(o>=0?t[o].content:n,r,i,a))}function wn(e){let t=U.get(e.startMarker);if(U.set(e.startMarker,e),t)return;let n=new WeakRef(e.startMarker);v(1,n),xn?.register(e.startMarker,n)}function Tn(e){return U.get(e)}function En(e){if(!e)return Dn(H);for(let t of e.roots)Dn(y(t,1))}function Dn(e){for(let t of e){let n=t.deref();if(n===void 0){e.delete(t),H.delete(t);continue}let r=U.get(n);if(!r){e.delete(t),H.delete(t);continue}if(!n.isConnected||!r.endMarker.isConnected){U.delete(n),e.delete(t),H.delete(t);continue}let i=Ke();try{Cn(r)}catch(r){o(`when() branch threw during update; unregistering this conditional`,r),U.delete(n),e.delete(t),H.delete(t),qe(i)}}}function On(e,t,n,r){return!R(e)||wt(e)||at(e)!==void 0?vn(t,e,n):Se(t,r,()=>{let r=vn(t,e,n);return r&&!r.parentNode?r:null})}function kn(e,t,n,r){for(let i of e){let e=On(i,t,n,r);e&&xe([e],r)}}function An(e,t,n=0){let r=n,i=e,a=j(),o=M();for(let n=0;n<t.length;n+=1){let s=t[n];if(s==null)continue;let c=vn(e,s,r);if(c){if(c.parentNode!==i){if(a){let e=N(i);i.insertBefore(c,e),P(i,e)}else i.appendChild(c)}else o&&N(i)===c&&F(i);r+=1}}}function jn(e,t){tn(e),e.removeAttribute(`class`),t&&(gt(e),he(e),e.removeAttribute(`style`))}function Mn(e,t,n){if(lt()){let n=rt();return it(n,e,t),n}let r=function(r,i=0){let a=r?Ne(r,e):null;a&&(jn(a,M()),e===`select`&&un(a));let o=a??(n?document.createElementNS(`http://www.w3.org/2000/svg`,e):document.createElement(e)),s=a?o.lastChild:null;return An(o,t,i),a&&Pe(o,s),e===`select`&&ln(o),o};return n||it(r,e,t),r}function Nn(e){return(...t)=>Mn(e,t,!1)}function Pn(e){return(...t)=>Mn(e,t,!0)}function Fn(){return{regions:/* @__PURE__ */ new Map,pending:/* @__PURE__ */ new Map,placed:/* @__PURE__ */ new Map}}const In=Fn(),W=/* @__PURE__ */ new WeakMap,G=/* @__PURE__ */ new WeakMap,Ln=`region.registry`;function K(){if(!d())return In;let e=f(),t=e.get(Ln);return t||e.set(Ln,t=Fn()),t}const Rn=typeof FinalizationRegistry<`u`?new FinalizationRegistry(({id:e,ref:t,waiting:n})=>{n?Jn(In,e,t):In.regions.get(e)===t&&In.regions.delete(e)}):null,zn=[];function q(e){return Ye(e)&&!e.isConnected}function Bn(e){W.delete(e.startMarker);let t=K();t.regions.get(e.id)?.deref()===e.startMarker&&t.regions.delete(e.id);let n=[...e.hidden,...e.views];e.hidden.length=0,e.views.length=0;for(let e of n)J(e),q(e.anchor)||Yn(e)}function Vn(){let e=K();for(let[t,n]of e.pending){for(let e of n){let t=e.deref();if(t&&!q(t))continue;n.delete(e),d()||Rn?.unregister(e);let r=t&&G.get(t)?.find(t=>t.pendingRef===e);r&&(r.pendingRef=null)}n.size===0&&e.pending.delete(t)}for(let[t,n]of e.placed){for(let e of n)e.deref()||n.delete(e);n.size===0&&e.placed.delete(t)}for(let[t,n]of e.regions){let r=n.deref();if(!r){e.regions.delete(t);continue}let i=W.get(r);if(i){if(q(r))Bn(i);else for(let e of[...i.hidden,...i.views])q(e.anchor)&&fr(e)}}}function Hn(e){let t=e,n=K(),r=n.regions.get(t.id)?.deref();if(r&&r!==t.startMarker&&r.isConnected)console.warn(`nuclo: two regions share the id "${t.id}". Every into("${t.id}", …) now goes to the one built last; the other stays empty. Give each region its own id.`);else if(r&&r!==t.startMarker&&q(r)){let e=W.get(r);e&&Bn(e)}let i=W.has(t.startMarker),a=new WeakRef(t.startMarker);n.regions.set(t.id,a),W.set(t.startMarker,t),!i&&!d()&&Rn?.register(t.startMarker,{id:t.id,ref:a,waiting:!1}),Ve(t.startMarker,pr),t.claiming&&zn.push(t);let o=n.pending.get(t.id);if(o){n.pending.delete(t.id);for(let e of o){d()||Rn?.unregister(e);let n=qn(e,t.id);n&&(n.pendingRef=null,ir(t,n,null))}}for(let e of Un(n,t.id))ir(t,e,null)}function Un(e,t){let n=e.placed.get(t);if(!n)return[];let r=[];for(let e of n){let t=e.deref(),i=t&&G.get(t)?.find(t=>t.placedRef===e);i&&er(i)||(n.delete(e),i&&(J(i),q(i.anchor)||r.push(i)))}return n.size===0&&e.placed.delete(t),r}function Wn(e){return e.nodeType===8&&G.has(e)}function Gn(e){let t=K(),n=t.regions.get(e)?.deref();if(!n){t.regions.delete(e);return}let r=W.get(n);if(r&&q(n))Bn(r);else return r}function Kn(e,t){let n=W.get(e);return n&&n.endMarker===t?n:void 0}function qn(e,t){let n=e.deref();if(n&&!q(n))return G.get(n)?.find(e=>e.id===t&&e.region===null)}function Jn(e,t,n){let r=e.pending.get(t);r&&(r.delete(n),r.size===0&&e.pending.delete(t))}function Yn(e){if(e.pendingRef)return;let t=K(),n=t.pending.get(e.id);n||t.pending.set(e.id,n=/* @__PURE__ */ new Set);let r=new WeakRef(e.anchor);e.pendingRef=r,n.add(r),d()||Rn?.register(e.anchor,{id:e.id,ref:r,waiting:!0},r)}function Xn(e){let t=e.pendingRef;t&&(e.pendingRef=null,Jn(K(),e.id,t),d()||Rn?.unregister(t))}function Zn(e,t){let n=G.get(e);for(let e of n??[])t.some(t=>t.id===e.id)||fr(e);G.set(e,t),Ve(e,pr);for(let e of t){let t=n?.find(t=>t.id===e.id)??null;t&&(e.pendingRef=t.pendingRef,t.pendingRef=null);let r=Gn(e.id);r?(Xn(e),ir(r,e,t)):Yn(e)}}function Qn(e){e.startMarker.textContent=`region-start-${e.index}-v${e.views.length}`}function $n(e){let t=/-v(\d+)$/.exec(e||``);return t?parseInt(t[1],10):0}function er(e){return e.region?.deref()??null}function tr(e,t,n=null){if(e.region=new WeakRef(t),n?.placedRef&&(e.placedRef=n.placedRef,n.placedRef=null),e.placedRef)return;let r=K(),i=r.placed.get(e.id);i||r.placed.set(e.id,i=/* @__PURE__ */ new Set),e.placedRef=new WeakRef(e.anchor),i.add(e.placedRef)}function J(e){e.region=null,e.first=null,e.last=null;let t=e.placedRef;if(!t)return;e.placedRef=null;let n=K(),r=n.placed.get(e.id);r&&(r.delete(t),r.size===0&&n.placed.delete(e.id))}function nr(e,t,n){let r=t.nextSibling;e.first=r===n||!r?null:new WeakRef(r),e.last=e.first?new WeakRef(n.previousSibling):null}function rr(e){let t=e;be(t.startMarker,t.endMarker);for(let e of t.views)J(e);for(let e of t.hidden)J(e);t.views.length=0,t.hidden.length=0,t.showingEmpty=!0,t.empty.length&&kn(t.empty,t.host,t.index,t.endMarker),Qn(t)}function ir(e,t,n){if(e.deferred)e.deferred.push([t,n]);else{e.deferred=[];try{ar(e,t,n)}finally{let t=e.deferred;e.deferred=null;for(let[n,r]of t)ir(e,n,r)}}}function ar(e,t,n){if(n&&er(n)===e){let r=e.hidden.indexOf(n);if(r!==-1){e.hidden[r]=t,tr(t,e,n),n.region=null;return}lr(e,t,n)}else{if(e.showingEmpty||e.type===`latest`&&e.views.length>0){be(e.startMarker,e.endMarker);for(let t of e.views)t.first=null,t.last=null,e.hidden.push(t);e.views.length=0,e.showingEmpty=!1,e.claiming=!1,e.claimCursor=null}if(e.views.push(t),tr(t,e),j()&&e.claiming){let{before:n,cursor:r}=or(e,t.content);nr(t,n,r)}else{let n=e.claiming&&e.claimCursor?e.claimCursor:e.endMarker,r=n.previousSibling;kn(t.content,e.host,e.index,n),nr(t,r,n)}Qn(e)}}function or(e,t){let n=e.host,r=N(n),i=e.claimCursor??e.endMarker,a=i.previousSibling;P(n,i);for(let n of t)An(e.host,[n],e.index);let o=N(n)??e.endMarker;return e.claimCursor=o,P(n,r),{before:a,cursor:o}}function sr(e,t,n,r){let i=e.host,a=N(i),o=n.previousSibling,s=document.createComment(`region-claim-boundary`);i.insertBefore(s,r),P(i,n===r?s:n);try{for(let n of t)An(e.host,[n],e.index);let n=N(i);for(;n&&n!==s;){let e=n.nextSibling;k(n),n=e}}finally{i.removeChild(s),P(i,a)}return o}function cr(e,t){let n=t.last?.deref();if(n)return n.nextSibling??e.endMarker;for(let n=e.views.indexOf(t)+1;n<e.views.length;n++){let t=e.views[n].first?.deref();if(t)return t}return e.endMarker}function lr(e,t,n){let r=cr(e,n),i=sr(e,t.content,n.first?.deref()??r,r);e.views[e.views.indexOf(n)]=t,tr(t,e,n),J(n),nr(t,i,r),Qn(e)}function ur(e){let t=e;t.empty.length&&or(t,t.empty),t.showingEmpty=!0}function dr(e){sr(e,e.empty,e.startMarker.nextSibling??e.endMarker,e.endMarker)}function fr(e){Xn(e);let t=er(e);if(!t){J(e);return}let n=t.hidden.indexOf(e);if(n!==-1){t.hidden.splice(n,1),J(e);return}let r=t.views.indexOf(e);if(r!==-1){t.views.splice(r,1);let n=e.last?.deref(),i=n?n.nextSibling:null,a=e.first?.deref()??null;for(;a&&a!==i;){let e=a.nextSibling;k(a),a=e}}if(J(e),r===-1)return;if(t.views.length>0||t.claiming){Qn(t);return}let i=t.hidden.pop();i?ir(t,i,null):rr(t)}function pr(e){let t=e,n=G.get(t);if(n){G.delete(t);for(let e of n)fr(e);return}let r=W.get(t);r&&Bn(r)}function mr(){for(let e of zn){if(e.claiming&&W.get(e.startMarker)===e){let t=e.claimCursor;for(;t&&t!==e.endMarker;){let e=t.nextSibling;k(t),t=e}e.views.length===0&&!e.showingEmpty&&rr(e)}e.claiming=!1,e.claimCursor=null}zn.length=0}function hr(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}const gr=p[0],_r=/* @__PURE__ */ new WeakMap,vr=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{gr.delete(e)}):null;let yr=0;function br(e,t){let n=_r.get(e);if(_r.set(e,t),n)return;let r=new WeakRef(e);v(0,r),vr?.register(e,r)}function xr(e){return Array.isArray(e)?e:Array.from(e)}function Sr(e,t,n){let r=typeof e==`function`?e(t,n):e;return typeof r!=`object`||!r?null:`tagName`in r||Wn(r)?r:null}function Cr(e,t,n){return Sr(e.renderItem(t,n),e.host,n)}function wr(e,t,n){let r=dt();try{return Tr(e,t,n)}finally{ft(r)}}function Tr(e,t,n){e.lastRenderLeaves=null;let r=e.template,i=s&&!j()&&!d(),a=r&&i?ut(e.renderItem,t,n):e.renderItem(t,n);if(r!==null&&i){let i=at(a);if(i!==void 0){if(r===void 0){let t=ot(a),r=t?Ft(t,i):null,o=Sr(a,e.host,n);if(r&&o){let t=o.cloneNode(!0);Lt(r,t);let n=At(),a=Mt(r),s=!1;try{s=zt(r,i,o,a),s&&(e.lastRenderLeaves=a)}finally{jt(n)}if(!s)return e.template=null,e.lastRenderLeaves=null,o;e.template={tmpl:r,skeleton:t},e.rowShape=r}else e.template=null;return o}let o=r.skeleton.cloneNode(!0),s=At(),c=Mt(r.tmpl);try{if(ot(a)===r.tmpl.tag&&Rt(r.tmpl,i,o,c))return e.lastRenderLeaves=c,o}finally{jt(s)}return e.template=null,Cr(e,t,n)}if(r===void 0)e.template=null;else return e.template=null,Cr(e,t,n)}return Sr(a,e.host,n)}function Er(e,t){let n=t.element,r=e.rowShape;t.dyn!==null&&r?It(r,n):ge(n)}function Dr(e,t){let n=e.rowShape;if(t.dyn===null||!n)return k(t.element);let r=t.element;return r.parentNode?(It(n,r),r.parentNode.removeChild(r),!0):!1}function Or(e,t,n,r,i){if(r.parentNode!==n||i.parentNode!==n)return!1;for(let n=0;n<t.length;n++)t[n].element&&Er(e,t[n]);if(s&&n.firstChild===r&&n.lastChild===i)return n.textContent=``,n.appendChild(r),n.appendChild(i),!0;for(let e=0;e<t.length;e++){let r=t[e].element;r&&r.parentNode===n&&n.removeChild(r)}return!0}function kr(e){let t=e.length;if(t===0)return[];let n=Array(t),r=[];for(let i=0;i<t;i++){let t=e[i],a=0,o=r.length;for(;a<o;){let n=a+o>>1;e[r[n]]<t?a=n+1:o=n}n[i]=a>0?r[a-1]:-1,a===r.length?r.push(i):r[a]=i}let i=r.length,a=r[i-1],o=Array(i);for(;i>0;)o[--i]=a,a=n[a];return o}function Ar(e,t,n,r,i,a,o){let s=document.createDocumentFragment();for(let t=r;t<i;t++){let r=n[t],i=wr(e,r,t);if(!i)continue;let a=e.lastRenderLeaves;o.push({item:r,element:i,dyn:a,dynCreatedAt:a?e.currentFlushEpoch:void 0}),e.lastRenderLeaves=null,s.appendChild(i)}s.firstChild&&t.insertBefore(s,a)}function jr(e){if(!e)return null;let t=e.nodeName===`OPTGROUP`?e.parentNode:e;return t&&t.nodeName===`SELECT`&&!t.multiple?t:null}function Mr(e){let t=xr(e.itemsProvider());if(hr(e.lastSyncedItems,t))return;let n=s?jr(e.startMarker.parentNode):null,r=n&&n.selectedIndex>=0?n.value:null,i=Ke();try{if(Nr(e,t),r!==null&&n.value!==r){let e=n.selectedIndex;n.value=r,n.value!==r&&(n.selectedIndex=e)}}catch(t){let{startMarker:n,endMarker:r}=e;throw n.parentNode&&n.parentNode===r.parentNode&&be(n,r),e.records=[],e.lastSyncedItems=[],e.allRecordsCreatedAt=void 0,qe(i),t}}function Nr(e,t){let{startMarker:n,endMarker:r}=e,i=n.parentNode??e.host,a=e.records,o=a.length,s=t.length;if(s===0){if(o>0&&!Or(e,a,i,n,r))for(let t=0;t<o;t++)Dr(e,a[t]);e.records=[],e.lastSyncedItems=[],e.allRecordsCreatedAt=void 0;return}let c=0,l=Math.min(o,s);for(;c<l&&a[c].item===t[c];)c++;let u=0,d=l-c;for(;u<d&&a[o-1-u].item===t[s-1-u];)u++;let f=c,p=o-u,m=c,h=s-u;if(f===p){let n=p<o?a[p].element:r;if(p===o)Ar(e,i,t,m,h,n,a),e.allRecordsCreatedAt=o===0?e.currentFlushEpoch:void 0;else{let r=[];Ar(e,i,t,m,h,n,r),e.records=a.slice(0,f).concat(r,a.slice(f)),e.allRecordsCreatedAt=void 0}e.lastSyncedItems=t.slice();return}if(m===h){for(let t=f;t<p;t++)Dr(e,a[t]);a.splice(f,p-f),e.allRecordsCreatedAt=void 0,e.lastSyncedItems=t.slice();return}let ee=p-f,g=h-m,_=Array(g).fill(-1),v=new Uint8Array(ee),y=0,te=Math.min(p,h);for(let e=c;e<te;e++)a[e].item===t[e]&&(_[e-m]=e,v[e-f]=1,y++);let b=y,x=/* @__PURE__ */ new Map;for(let e=p-1;e>=f;e--){if(v[e-f])continue;let t=a[e].item,n=x.get(t);n===void 0?x.set(t,e):typeof n==`number`?x.set(t,[n,e]):n.push(e)}for(let e=0;e<g;e++){if(_[e]!==-1)continue;let n=x.get(t[m+e]);if(n===void 0)continue;let r;typeof n==`number`?(r=n,x.delete(t[m+e])):(r=n.pop(),n.length===0&&x.delete(t[m+e])),_[e]=r,v[r-f]=1,y++}if(y===0&&f===0&&p===o){if(!Or(e,a,i,n,r))for(let t=0;t<o;t++)Dr(e,a[t]);let c=[];Ar(e,i,t,0,s,r,c),e.records=c,e.allRecordsCreatedAt=e.currentFlushEpoch,e.lastSyncedItems=t.slice();return}for(let t=f;t<p;t++)v[t-f]||Dr(e,a[t]);let ne=null,re=y-b<=8&&b>=32;if(y>0&&!re){let e=[],t=[];for(let n=0;n<g;n++)_[n]!==-1&&(e.push(_[n]),t.push(n));ne=new Uint8Array(g);let n=kr(e);for(let e=0;e<n.length;e++)ne[t[n[e]]]=1}let ie=Array(g),S=0,C=p<o?a[p].element:r,w=null;for(let n=g-1;n>=0;n--){let r=_[n];if(r===-1){let r=t[m+n],i=wr(e,r,m+n);if(!i){ie[n]=null,S++;continue}let a=e.lastRenderLeaves;ie[n]={item:r,element:i,dyn:a,dynCreatedAt:a?e.currentFlushEpoch:void 0},e.lastRenderLeaves=null,w??=document.createDocumentFragment(),w.insertBefore(i,w.firstChild);continue}let o=a[r];ie[n]=o;let s=o.element;if(w&&w.firstChild){let e=w.firstChild;i.insertBefore(w,C),C=e,w=null}(ne?!ne[n]:!(re&&r===m+n))&&i.insertBefore(s,C),C=s}w&&w.firstChild&&i.insertBefore(w,C);let T=Array(f+(g-S)+(o-p)),E=0;for(let e=0;e<f;e++)T[E++]=a[e];for(let e=0;e<g;e++){let t=ie[e];t&&(T[E++]=t)}for(let e=p;e<o;e++)T[E++]=a[e];e.records=T,e.allRecordsCreatedAt=void 0,e.lastSyncedItems=t.slice()}function Pr(e,t,n,r,i,a,o){return{itemsProvider:e,renderItem:t,startMarker:n,endMarker:r,records:i,host:a,lastSyncedItems:o,template:void 0,rowShape:null,lastRenderLeaves:null,currentFlushEpoch:void 0,allRecordsCreatedAt:void 0}}function Fr(e,t,n,r){return j()?Lr(e,t,n,r):Ir(e,t,n,r)}function Ir(e,t,n,r){let{start:i,end:a}=ye(`list`,r),o=Pr(e,t,i,a,[],n,[]),c=n;return c.appendChild(i),c.appendChild(a),Mr(o),s&&!d()&&br(i,o),o}function Lr(e,t,n,r){let i=n,a=Me(i,`list`);if(!a)return Oe(i,()=>Ir(e,t,n,r));let{start:o,end:c}=a,l=xr(e()),u=[];for(let e=0;e<l.length;e++){let r=Sr(t(l[e],e),n,e);r&&u.push({item:l[e],element:r,dyn:null,dynCreatedAt:void 0})}let f=N(i);for(;f&&f!==c;){let e=f.nextSibling;k(f),f=e}let p=c;for(let e=u.length-1;e>=0;e--){let t=u[e].element;(t.parentNode!==i||t.nextSibling!==p)&&i.insertBefore(t,p),p=t}P(i,c.nextSibling);let m=Pr(e,t,o,c,u,n,l.slice());return s&&!d()&&br(o,m),m}function Rr(e){if(yr++,!e)return zr(gr);for(let t of e.roots)zr(y(t,0))}function zr(e){for(let t of e){let n=t.deref();if(!n){e.delete(t),gr.delete(t);continue}let r=_r.get(n);if(!r){e.delete(t),gr.delete(t);continue}if(!n.isConnected||!r.endMarker.isConnected){_r.delete(n),e.delete(t),gr.delete(t);continue}r.currentFlushEpoch=yr;try{Mr(r)}finally{r.currentFlushEpoch=void 0}if(r.allRecordsCreatedAt===yr)continue;let i=r.records;for(let e=0;e<i.length;e++){if(i[e].dynCreatedAt===yr)continue;let t=i[e].dyn;t&&Bt(t)}}}function Br(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function Vr(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var Hr=class e{groups;elseContent;constructor(e,t){this.groups=e,this.elseContent=t}cloneWith(t,n){return new e(t?[...this.groups,t]:this.groups,n??this.elseContent)}render(e,t){return j()?this.hydrateRender(e,t):this.freshRender(e,t)}freshRender(e,t){let{start:n,end:r}=ye(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=e;return a.appendChild(n),a.appendChild(r),Cn(i),n.textContent=Br(t,i.activeIndex),n}hydrateRender(e,t){let n=e,r=Me(n,`when`);if(!r)return Oe(n,()=>this.freshRender(e,t));let{start:i,end:a}=r,o=Sn(this.groups,this.elseContent),s=Tn(i),c=s?s.activeIndex:Vr(i.textContent);if(!r.recreated&&(c===void 0||c===o)){if(o!==null){let n=o>=0?this.groups[o].content:this.elseContent;for(let r of n)An(e,[r],t)}let r=N(n);for(;r&&r!==a;){let e=r.nextSibling;k(r),r=e}}else if(be(i,a),o!==null){let n=o>=0?this.groups[o].content:this.elseContent;De(()=>kn(n,e,t,a))}return P(n,a.nextSibling),this.createRuntimeFromMarkers(e,t,i,a,o),i}createRuntimeFromMarkers(e,t,n,r,i=null){let a={startMarker:n,endMarker:r,host:e,index:t,groups:this.groups,elseContent:this.elseContent,activeIndex:i};return s&&!d()&&wn(a),a}};function Ur(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return Ur(e.cloneWith({condition:t,content:n}))},else:function(...t){return Ur(e.cloneWith(void 0,t))}})}function Wr(e,...t){return Ur(new Hr([{condition:e,content:t}],[]))}const Gr=[Vn,Rr,En,Wt,Dt];function Kr(...e){ie();let t=e.length>0?{roots:ce(e)}:void 0;for(let e of Gr)e(t);Ge()}function qr(e,t){return function(n,r){return Fr(e,t,n,r).startMarker}}function Jr(e,t,n,r,i){let a=e.empty===void 0?[]:[e.empty];return{id:e.id,type:e.type??`latest`,empty:a,startMarker:r,endMarker:i,host:t,index:n,views:[],hidden:[],showingEmpty:!1,claimCursor:null,claiming:!1,deferred:null}}function Yr(e,t,n){let{start:r,end:i}=ye(`region`,n),a=t;a.appendChild(r),a.appendChild(i);let o=Jr(e,t,n,r,i);return rr(o),Hn(o),r}function Xr(e,t,n){let r=t,i=Me(r,`region`);if(!i)return Oe(r,()=>Yr(e,t,n));let{start:a,end:o}=i;P(r,o.nextSibling);let s=Kn(a,o);if(s&&(s.id!==e.id||s.type!==(e.type??`latest`))){Bn(s);let r=Jr(e,t,n,a,o);return De(()=>{rr(r),Hn(r)}),a}if(s)return s.type=e.type??`latest`,s.empty=e.empty===void 0?[]:[e.empty],s.host=t,s.index=n,s.showingEmpty&&dr(s),a;let c=Jr(e,t,n,a,o);return i.recreated?(rr(c),Hn(c),a):(c.claiming=!0,c.claimCursor=a.nextSibling,$n(a.textContent)===0&&ur(c),Hn(c),a)}function Zr(e){return function(t,n){return j()?Xr(e,t,n):Yr(e,t,n)}}function Qr(e){Ae(e);let t=N(e);return!t||t.nodeType!==8||!t.textContent?.startsWith(`view-`)?null:(F(e),t)}function $r(e,...t){let n=typeof e==`string`?[[e,t]]:Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[t]]);return function(e,t){let r=e,i=j()&&Qr(r)||ve(`view-${t}`);return Zn(i,n.map(([e,t])=>({id:e,content:t,anchor:i,region:null,pendingRef:null,first:null,last:null}))),i}}const Y=/* @__PURE__ */ new WeakMap,X=[],ei=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{let t=X.indexOf(e);t!==-1&&X.splice(t,1)}):null;function ti(e){if(wt(e)){let t=e();if(R(t))return{build:t,component:e}}return{build:e,component:null}}function ni(e,t){if(!t||!s||!e||e.nodeType!==1)return;let n=e,r=Y.get(n);if(r){r.component=t;return}let i={root:new WeakRef(n)};Y.set(n,{component:t}),X.push(i),ei?.register(e,i,i)}function ri(e,t,n=0){let{build:r,component:i}=ti(e),a=t||document.body,o=Ke(),s;try{s=r(a,n),s.parentNode!==a&&a.appendChild(s)}catch(e){throw qe(o),e}return Ge(),ni(s,i),s}function ii(e,t){let{build:n,component:r}=ti(e),i=oi(n,t,!1,null);return ni(i,r),i}function ai(e,t){if(e!==void 0){let{build:n}=ti(e);return oi(n,t,!0,null)}let n=0;for(let e=0;e<X.length;e++){let t=X[e],r=t.root.deref(),i=r?.parentNode;if(!r||!r.isConnected||!i||i.nodeType!==1){ei?.unregister(t),r&&Y.delete(r);continue}let a=Y.get(r);try{let e=oi(a.component(),i,!0,r);e!==r&&(Y.delete(r),Y.set(e,a),t.root=new WeakRef(e),ei?.unregister(t),ei?.register(e,t,t))}catch(e){o(`forceUpdate(): component threw; keeping this root's previous DOM`,e)}X[n++]=t}X.length=n}function oi(e,t,n,r){let i=t||document.body,a=i;Te(n),r?P(a,r):n&&Ae(a,!1);let o=Ke(),s;try{s=e(i,0);let t=s;if(t&&t.nodeType===1&&t.parentNode!==a){let e=N(a);if(e){let n=e.nextSibling;a.insertBefore(t,e),k(e),P(a,n)}else a.appendChild(t),P(a,null)}}catch(e){throw qe(o),e}finally{Ee(),mr()}return Ge(),s}function si(){return{atomCache:/* @__PURE__ */ new Map,atomMeta:/* @__PURE__ */ new Map,rawKeys:/* @__PURE__ */ new Set,baseRules:[],queryRules:/* @__PURE__ */ new Map,styleEpoch:0,cssTextCache:null,sheet:null,sheetDocument:null,baseRuleCount:0,groupRules:/* @__PURE__ */ new Map,externalRules:null,hasExternalGroups:!1}}const ci=Symbol.for(`nuclo.style.engine.v1`),li=globalThis;let ui;function Z(){return ui??=li[ci]??(li[ci]=si())}function di(e){for(let t of e){let e=Z();e.queryRules.has(t)||e.queryRules.set(t,[])}}function fi(e,t){let n=Z();try{let r=e.cssRules.length;e.insertRule(t+`{}`,r);let i=e.cssRules[r];return n.groupRules.set(t,i),n.groupRules.set(Q(i),i),i}catch{return null}}const pi=/* @__PURE__ */ new WeakMap;function Q(e){let t=pi.get(e);if(t!==void 0)return t;let n=e.cssText,r=n.indexOf(`{`),i=(r===-1?n:n.slice(0,r)).trim();return pi.set(e,i),i}function mi(e){return e instanceof CSSStyleRule?e.selectorText:Q(e)}function hi(e,t){let n=Z();if(!n.externalRules)return;let r=wi(t,mi(e)),i=n.externalRules.get(r);i||(i=/* @__PURE__ */ new Set,n.externalRules.set(r,i)),i.add(e.cssText)}function gi(e,t){let n=Z();if(!n.externalRules)return!1;let r=wi(t,mi(e)),i=n.externalRules.get(r);return i?.delete(e.cssText)?(i.size===0&&n.externalRules.delete(r),n.externalRules.size===0&&(n.externalRules=null),!0):!1}function _i(e){let t=Z();for(let n=0;n<e.length;n++){let r=e[n];if(r instanceof CSSStyleRule){hi(r,void 0);continue}let i=Q(r);if(`cssRules`in r&&!i.startsWith(`@keyframes`)){let e=r;t.hasExternalGroups=!0,t.groupRules.set(i,e);for(let t=0;t<e.cssRules.length;t++)hi(e.cssRules[t],i)}else hi(r,void 0)}}function vi(e,t){let n=Z();try{e.insertRule(t,n.baseRuleCount);let r=e.cssRules[n.baseRuleCount];if(gi(r,void 0)){e.deleteRule(n.baseRuleCount);return}n.baseRuleCount++}catch{}}function yi(e,t){let n=Z();try{let r=e.cssRules.length;e.insertRule(t,r);let i=e.cssRules[r];n.externalRules&&gi(i,Q(e))&&e.deleteRule(r)}catch{}}function bi(e,t){let n=Z(),r=n.groupRules.get(t);if(r)return r;if(!n.hasExternalGroups)return fi(e,t);try{let r=e.cssRules.length;e.insertRule(t+`{}`,r);let i=Q(e.cssRules[r]);e.deleteRule(r);let a=n.groupRules.get(i);if(a)return n.groupRules.set(t,a),a}catch{return null}return fi(e,t)}function xi(){let e=Z();if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(e.sheet&&e.sheetDocument===document&&e.sheet.ownerNode&&e.sheet.ownerNode.isConnected)return e.sheet;let t=document.getElementById(`nuclo-styles`),n;if(t?.tagName===`STYLE`?n=t:(n=document.createElement(`style`),n.id=`nuclo-styles`,t?t.replaceWith(n):document.head.appendChild(n)),e.sheet=n.sheet,e.sheetDocument=document,e.groupRules.clear(),e.baseRuleCount=0,e.externalRules=null,e.hasExternalGroups=!1,!e.sheet)return null;if(e.sheet.cssRules.length>0){let t=0;for(;t<e.sheet.cssRules.length;){let n=e.sheet.cssRules[t];if(!(n instanceof CSSStyleRule)&&`cssRules`in n&&!Q(n).startsWith(`@keyframes`))break;t++}e.baseRuleCount=t,e.externalRules=/* @__PURE__ */ new Map,_i(e.sheet.cssRules)}for(let t of e.baseRules)vi(e.sheet,t);for(let[t,n]of e.queryRules){let r=bi(e.sheet,t);if(r)for(let e of n)yi(r,e)}return e.sheet}function Si(e,t){let n=Z(),r=xi();if(t===void 0)n.baseRules.push(e);else{let r=n.queryRules.get(t);r||(r=[],n.queryRules.set(t,r)),r.push(e)}if(n.cssTextCache=null,r){if(t===void 0)vi(r,e);else{let n=bi(r,t);n&&yi(n,e)}}}function Ci(e){let t=2166136261,n=2128831035;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619),n=Math.imul(n^i,2246822507)}return(t>>>0).toString(36)+((n>>>9)%1296).toString(36)}function wi(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function Ti(e,t){return e+t.length+`:`+t}function Ei(e,t){let n=``,r=0;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);a===92&&i+1<e.length?n+=e[i]+e[++i]:r===0?a===34||a===39?(r=a,n+=e[i]):n+=a===38?t:e[i]:(n+=e[i],a===r&&(r=0))}return n}function Di(e,t){let n=`.`+e;return n+Ei(t,n)}function Oi(e){if(e.length===0||e===`-`)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n>=97&&n<=122||n>=65&&n<=90||n===45||n===95||t>0&&n>=48&&n<=57))return!1}if(e.charCodeAt(0)===45&&e.length>1){let t=e.charCodeAt(1);if(t>=48&&t<=57)return!1}return!0}function ki(e,t,n,r,i=!1){let a=Z(),o=wi(e,t);for(let[e,t]of n)o=Ti(Ti(o,e),t);r!==void 0&&!Oi(r)&&(console.warn(`[nuclo] css() name ${JSON.stringify(r)} is not a valid CSS class name (letters, digits, - and _ only, not starting with a digit); falling back to a generated name.`),r=void 0);let s=r===void 0?`a`+o:`n`+Ti(``,r)+o,c=a.atomCache.get(s);if(c!==void 0)return xi(),c;r===void 0?c=`n`+Ci(s):(c=i?r:r+`-`+Ci(s),a.atomMeta.has(c)&&console.warn(`[nuclo] css() name ${JSON.stringify(c)} is already used by a different style. Both rules are emitted under the same class, so they will override each other — rename one.`));let l=``;for(let[e,t]of n)l+=(l?`;`:``)+e+`:`+t;return a.atomCache.set(s,c),a.atomMeta.set(c,{query:e,suffix:t,decls:n,name:r}),Si(Di(c,t)+`{`+l+`}`,e),c}function Ai(e,t){let n=Z(),r=n.atomMeta.get(e),i=n.atomMeta.get(t);if(!r||!i)return t;let a=[...r.decls,...i.decls],o=/* @__PURE__ */ new Map;for(let e=0;e<a.length;e++)o.set(a[e][0],e);let s=a.filter((e,t)=>o.get(e[0])===t);return ki(r.query,r.suffix,s,r.name??i.name)}function ji(e){let t=Z().atomMeta.get(e);return t===void 0?void 0:wi(t.query,t.suffix)}function Mi(){return(ui??li[ci])?.styleEpoch??0}function Ni(e,t){let n=Z();n.rawKeys.has(e)?xi():(n.rawKeys.add(e),Si(t,void 0))}function Pi(){let e=Z();if(e.cssTextCache!==null)return e.cssTextCache;let t=e.baseRules.join(``);for(let[n,r]of e.queryRules)r.length>0&&(t+=n+`{`+r.join(``)+`}`);return e.cssTextCache=t,t}function Fi(){let e=Z();e.atomCache.clear(),e.atomMeta.clear(),e.rawKeys.clear(),e.baseRules.length=0,e.queryRules.clear(),e.groupRules.clear(),e.cssTextCache=null,e.baseRuleCount=0,e.sheet=null,e.sheetDocument=null,e.externalRules=null,e.hasExternalGroups=!1,e.styleEpoch++,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()}function Ii(e){let t=0;for(;t<e.length;t++){let n=e.charCodeAt(t);if(n>=65&&n<=90)break}if(t===e.length)return e;let n=e.slice(0,t);for(let r=t;r<e.length;r++){let t=e.charCodeAt(r);n+=t>=65&&t<=90?`-`+String.fromCharCode(t+32):e[r]}return n}const Li={hover:`:hover`,focus:`:focus`,focusVisible:`:focus-visible`,focusWithin:`:focus-within`,active:`:active`,visited:`:visited`,disabled:`:disabled`,enabled:`:enabled`,checked:`:checked`,required:`:required`,invalid:`:invalid`,valid:`:valid`,readOnly:`:read-only`,first:`:first-child`,last:`:last-child`,only:`:only-child`,odd:`:nth-child(odd)`,even:`:nth-child(even)`,empty:`:empty`,placeholderShown:`:placeholder-shown`,placeholder:`::placeholder`,before:`::before`,after:`::after`,selection:`::selection`,marker:`::marker`,firstLine:`::first-line`,firstLetter:`::first-letter`},Ri={bg:[`background`],p:[`padding`],px:[`padding-left`,`padding-right`],py:[`padding-top`,`padding-bottom`],pt:[`padding-top`],pr:[`padding-right`],pb:[`padding-bottom`],pl:[`padding-left`],m:[`margin`],mx:[`margin-left`,`margin-right`],my:[`margin-top`,`margin-bottom`],mt:[`margin-top`],mr:[`margin-right`],mb:[`margin-bottom`],ml:[`margin-left`],w:[`width`],h:[`height`],minW:[`min-width`],maxW:[`max-width`],minH:[`min-height`],maxH:[`max-height`],size:[`width`,`height`],text:[`font-size`],font:[`font-family`],weight:[`font-weight`],leading:[`line-height`],tracking:[`letter-spacing`],align:[`text-align`],items:[`align-items`],justify:[`justify-content`],z:[`z-index`],rounded:[`border-radius`],shadow:[`box-shadow`],select:[`user-select`]},zi={row:{display:`flex`,"flex-direction":`row`},col:{display:`flex`,"flex-direction":`column`},center:{"align-items":`center`,"justify-content":`center`},truncate:{overflow:`hidden`,"text-overflow":`ellipsis`,"white-space":`nowrap`}},Bi={background:`colors`,"background-color":`colors`,color:`colors`,"border-color":`colors`,"border-top-color":`colors`,"border-right-color":`colors`,"border-bottom-color":`colors`,"border-left-color":`colors`,"outline-color":`colors`,"caret-color":`colors`,"text-decoration-color":`colors`,"font-family":`fonts`,"box-shadow":`shadows`,"border-radius":`radii`},Vi=/* @__PURE__ */ new Set([`z-index`,`opacity`,`font-weight`,`line-height`,`flex`,`flex-grow`,`flex-shrink`,`order`,`aspect-ratio`,`zoom`,`scale`,`column-count`,`orphans`,`widows`,`tab-size`,`animation-iteration-count`,`grid-column`,`grid-row`]),Hi=/* @__PURE__ */ new Map;function Ui(e){if(!/[A-Z]/.test(e))return e;let t=Hi.get(e);return t===void 0&&(t=Ii(e),Hi.size>=512&&Hi.clear(),Hi.set(e,t)),t}function Wi(e){return e.charCodeAt(0)===64?e:`@media `+e}function Gi(e){return e.charCodeAt(0)===40}function Ki(e){if(!e.startsWith(`not`))return!1;let t=e.charCodeAt(3);return Number.isNaN(t)||t===32||t===40}function qi(e,t){if(e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)){let n=e.slice(6).trim(),r=t.slice(6).trim();if(!Ki(n)&&!Ki(r)){if(Gi(r))return`@media `+n+` and `+r;if(Gi(n))return`@media `+r+` and `+n}return console.warn(`[nuclo] cannot combine nested media queries ${JSON.stringify(e)} and ${JSON.stringify(t)}; using the inner query alone. Author one query that states both conditions.`),t}return t}function Ji(e,t){for(let n in t){let r=t[n],i=e[n];e[n]=typeof r==`object`&&r&&!Array.isArray(r)&&typeof i==`object`&&i&&!Array.isArray(i)?Ji({...i},r):r}return e}var Yi=class{className;constructor(e){this.className=e}toString(){return this.className}};function $(e){return new Yi(e)}function Xi(e,t){let n=ji(t);if(n===void 0){e.set(t,t);return}let r=e.get(n);r===void 0||r===t?e.set(n,t):e.set(n,Ai(r,t))}function Zi(e,t){let n=0;for(let r=0;r<=e.length;r++){let i=r===e.length?32:e.charCodeAt(r);(i===32||i===9||i===10||i===12||i===13)&&(r>n&&Xi(t,e.slice(n,r)),n=r+1)}}function Qi(e,t){for(let n of e)n&&(typeof n==`string`?Zi(n,t):Array.isArray(n)?Qi(n,t):Zi(n.className,t))}function $i(e){let t=/* @__PURE__ */ new Map;Qi(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return n}const ea=/* @__PURE__ */ new WeakMap;function ta(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function na(...e){if(e.length===0)return $(``);if(e.length===1){let t=e[0];if(!t)return $(``);if(!Array.isArray(t)){let e=typeof t==`string`?t:t.className;if(!/[\t\n\f\r ]/.test(e))return $(e)}}if(e.length===2&&ta(e[0])&&ta(e[1])){let t=e[0],n=e[1],r=Mi(),i=ea.get(t),a=i?.get(n);if(a!==void 0&&a.epoch===r&&a.first===e[0].className&&a.second===e[1].className)return xi(),a.result;let o=$($i(e)),s=i??/* @__PURE__ */ new WeakMap;return s.set(n,{epoch:r,first:e[0].className,second:e[1].className,result:o}),i||ea.set(t,s),o}return $($i(e))}const ra=wi(void 0,``);function ia(e={}){let t=e.screens??{};di(Object.values(t).map(Wi));let n=/* @__PURE__ */ new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||Vi.has(t)?String(n):n+`px`;let r=Bi[t];if(r!==void 0){let t=e[r]?.[n];if(t!==void 0)return t}return n}function i(e,t,n){let r=wi(t,n),i=e.get(r);return i||(i={query:t,suffix:n,decls:[]},e.set(r,i)),i}function a(e,n,o,s){for(let c in e){let l=e[c];if(l==null||l===!1)continue;if(typeof l==`object`){if(c===`raw`){let e=l,t=i(s,n,o).decls;for(let n in e)t.push([n,r(n,e[n])]);continue}let e=Li[c];if(e!==void 0){a(l,n,o+e,s);continue}let u=t[c];if(u!==void 0){a(l,qi(n,Wi(u)),o,s);continue}let d=c.charCodeAt(0);if(d===38){a(l,n,Ei(c,`&`+o).slice(1),s);continue}if(d===64){a(l,qi(n,c),o,s);continue}continue}if(l===!0){let e=zi[c];if(e){let t=i(s,n,o).decls;for(let n in e)t.push([n,e[n]])}continue}let u=Ri[c];if(u!==void 0){let e=i(s,n,o).decls;for(let t of u)e.push([t,r(t,l)])}else{let e=Ui(c);i(s,n,o).decls.push([e,r(e,l)])}}}function o(e,t){let r=typeof e==`string`,i=r?t:e,o=r?e:void 0;if(i==null)return $(``);let s=Mi(),c=n.get(i);if(c!==void 0&&c.epoch===s&&c.name===o)return xi(),c.result;let l=/* @__PURE__ */ new Map;a(i,void 0,``,l);let u=[];for(let e of l.values()){if(e.decls.length===0)continue;let t=e.query===void 0&&e.suffix===``;u.push(ki(e.query,e.suffix,e.decls,o,t))}let d=$(u.join(` `));return n.set(i,{epoch:s,name:o,result:d}),d}function s(e){let t=/* @__PURE__ */ new Map;a(e,void 0,``,t);let n=``;for(let[e,r]of t.get(ra)?.decls??[])n+=(n?`;`:``)+e+`:`+r;return n}function c(e){let t=``;for(let n in e)t+=n+`{`+s(e[n])+`}`;let n=`nk`+Ci(t);return Ni(n,`@keyframes `+n+`{`+t+`}`),n}function l(e,t){let n=e+`{`+s(t)+`}`;Ni(`g|`+n,n)}function u(e){let t=e=>e===!0?`true`:e===!1?`false`:String(e),n=e.variants??{},r=Object.keys(n),i=e.defaultVariants??{},a=e.base??null,s=(e.compoundVariants??[]).map(e=>{let{css:n,...r}=e,i={};for(let e in r)i[e]=t(r[e]);return{conditions:i,style:n}}),c=/* @__PURE__ */ new Map,l=Mi();return function(e){let u=Mi();l!==u&&(c.clear(),l=u);let d={};for(let n of r){let r=(e?e[n]:void 0)??i[n];r!=null&&(d[n]=t(r))}let f=``;for(let e of r){let t=d[e];f+=e.length+`:`+e,f+=t===void 0?`-`:`+`+t.length+`:`+t}let p=c.get(f);if(p)return xi(),p;let m={};a&&(m=Ji(m,a));for(let e of r){let t=d[e];if(t!==void 0){let r=n[e][t];r&&(m=Ji(m,r))}}for(let e of s){let t=!0;for(let n in e.conditions)if(d[n]!==e.conditions[n]){t=!1;break}t&&(m=Ji(m,e.style))}let h=o(m);return c.set(f,h),h}}return{css:o,cx:na,variants:u,keyframes:c,globalStyle:l,theme:e}}let aa;function oa(){return aa??=ia({})}const sa=(e,t)=>typeof e==`string`?oa().css(e,t):oa().css(e),ca=e=>oa().variants(e),la=e=>oa().keyframes(e),ua=(e,t)=>oa().globalStyle(e,t),da=/* @__PURE__ */ `a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.menu.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.script.search.section.select.slot.small.source.span.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`),fa=/* @__PURE__ */ `a.animate.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialGradient.rect.script.set.stop.style.svg.switch.symbol.text.textPath.title.tspan.use.view`.split(`.`);function pa(e,t,n,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let i=r(n);return Object.defineProperty(e,t,{value:i,configurable:!0,enumerable:!0,writable:!0}),i},set(n){Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}})}function ma(e,t){t in e&&typeof e[t]!=`function`||(pa(e,t,t,Nn),t===`var`&&pa(e,`var_`,t,Nn))}function ha(e,t){let n=`${t}Svg`;n in e||pa(e,n,t,Pn)}function ga(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<fa.length;t++)ha(e,fa[t]);for(let t=0;t<da.length;t++)ma(e,da[t]);e[t]=!0}}function _a(){ga();let e=globalThis;e.list=qr,e.update=Kr,e.when=Wr,e.region=Zr,e.into=$r,e.on=bt,e.scope=le,e.render=ri,e.hydrate=ii,e.forceUpdate=ai,e.createCss=ia,e.css=sa,e.cx=na,e.variants=ca,e.keyframes=la,e.globalStyle=ua}_a(),exports.createCss=ia,exports.css=sa,exports.cx=na,exports.forceUpdate=ai,exports.getCssText=Pi,exports.globalStyle=ua,exports.hydrate=ii,exports.into=$r,exports.keyframes=la,exports.list=qr,exports.on=bt,exports.region=Zr,exports.render=ri,exports.resetStyles=Fi,exports.scope=le,exports.update=Kr,exports.variants=ca,exports.when=Wr;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=/* @__PURE__ */ new Set([`onMount`,`onDestroy`]),t=/* @__PURE__ */ new WeakMap,n=/* @__PURE__ */ new WeakMap;function r(t){if(t.length<=2||t.charCodeAt(0)!==111||t.charCodeAt(1)!==110)return null;let n=t.charCodeAt(2);return n<65||n>90||e.has(t)?null:t===`onDoubleClick`?`ondblclick`:t.toLowerCase()}function i(e,r,i){if(r in e){e[r]=i;let t=n.get(e);if(!t){n.set(e,[r,i]);return}for(let e=0;e<t.length;e+=2)if(t[e]===r){t[e+1]=i;return}t.push(r,i);return}let a=r.slice(2),o=t.get(e);if(o){for(let t=0;t<o.length;t+=2){if(o[t]!==a)continue;let n=o[t+1];if(n===i)return;e.removeEventListener(a,n),e.addEventListener(a,i),o[t+1]=i;return}e.addEventListener(a,i),o.push(a,i)}else e.addEventListener(a,i),t.set(e,[a,i])}function a(e){let r=n.get(e);if(r){let t=e;for(let e=0;e<r.length;e+=2){let n=r[e];t[n]===r[e+1]&&(t[n]=null)}n.delete(e)}let i=t.get(e);if(i){for(let t=0;t<i.length;t+=2)e.removeEventListener(i[t],i[t+1]);t.delete(e)}}function o(e,t){typeof console<`u`&&console.error(`nuclo: ${e}`,t)}const s=typeof window<`u`&&typeof document<`u`,c=Symbol.for(`nuclo.serializing.v1`),l=globalThis,u=l[c]??(l[c]={on:!1,scratch:/* @__PURE__ */ new Map});function d(){return u.on}function f(){return u.scratch}const p=[/* @__PURE__ */ new Set,/* @__PURE__ */ new Set,/* @__PURE__ */ new Set,/* @__PURE__ */ new Set],m=[[],[],[],[]];let h=/* @__PURE__ */ new WeakMap,ee=!1,g=!1;const _=/* @__PURE__ */ new Set;function v(e,t){p[e].add(t),m[e].push(t)}function y(e,t){return h.get(e)?.[t]??_}const te=[];let b=null;const x=[];function ne(e){let t=e,n;for(;t&&(n=b.get(t))===void 0;)x.push(t),t=t.parentNode;n===void 0&&(n=te);for(let e=x.length-1;e>=0;e--){let t=x[e];t.nodeType===1&&w.has(t)&&(n=[t,...n]),b.set(t,n)}return x.length=0,n}function re(e,t){let n=t.deref();if(!n||!n.isConnected)return;let r=ne(n.nodeType===1?n:n.parentNode);for(let n=0;n<r.length;n++){let i=r[n],a=h.get(i);a||h.set(i,a=[/* @__PURE__ */ new Set,/* @__PURE__ */ new Set,/* @__PURE__ */ new Set,/* @__PURE__ */ new Set]);let o=a[e];o.add(t),o.size>=(oe.get(o)??se)&&ce(o)}}function ie(){if(g){g=!1,h=/* @__PURE__ */ new WeakMap,b=/* @__PURE__ */ new Map;for(let e=0;e<4;e++){m[e].length=0;for(let t of p[e])re(e,t)}b=null}else{for(let e=0;e<4;e++){let t=m[e];if(t.length!==0){if(ee){b??=/* @__PURE__ */ new Map;for(let n=0;n<t.length;n++)re(e,t[n])}t.length=0}}b=null}}const S=/* @__PURE__ */ new Map,ae=typeof FinalizationRegistry<`u`?new FinalizationRegistry(({id:e,ref:t})=>{let n=S.get(e);n?.delete(t)&&n.size===0&&S.delete(e)}):null;function C(e){let t=[],n=/* @__PURE__ */ new Set;for(let r of e){if(typeof r!=`string`)continue;let e=r.trim();e&&(n.has(e)||(n.add(e),t.push(e)))}return t}const w=/* @__PURE__ */ new WeakMap,oe=/* @__PURE__ */ new WeakMap,se=64;function ce(e){for(let t of e)t.deref()===void 0&&e.delete(t);oe.set(e,Math.max(64,e.size*2))}function le(e,t){let n=w.get(t);if(n||w.set(t,n=/* @__PURE__ */ new Set),n.has(e))return;n.add(e),ee=!0,t.isConnected&&(g=!0);let r=S.get(e);r||S.set(e,r=/* @__PURE__ */ new Set);let i=new WeakRef(t);r.add(i),ae?.register(t,{id:e,ref:i}),r.size>=(oe.get(r)??64)&&ce(r)}function ue(e){let t=C(e);if(t.length===0)return[];let n=/* @__PURE__ */ new Set;for(let e of t){let t=S.get(e);if(t){for(let r of t){let i=r.deref();i===void 0?t.delete(r):i.isConnected?n.add(i):(t.delete(r),w.get(i)?.delete(e))}t.size===0&&S.delete(e)}}if(n.size>1){for(let e of n)for(let t=e.parentNode;t;t=t.parentNode)if(n.has(t)){n.delete(e);break}}return Array.from(n)}function de(...e){let t=C(e);return function(e){if(s&&!d()&&e instanceof Element)for(let n of t)le(n,e)}}const fe=p[3],T=/* @__PURE__ */ new WeakMap,pe=p[2],E=/* @__PURE__ */ new WeakMap;function me(e,t,n){let r=T.get(e);if(r){r.resolver=t,r.lastValue=n;return}let i=new WeakRef(e);v(3,i),T.set(e,{ref:i,resolver:t,lastValue:n})}function he(e){let t=E.get(e);if(!t){let n=new WeakRef(e);t={ref:n,attributeResolvers:[]},v(2,n),E.set(e,t)}return t}function ge(e){let t=T.get(e);t&&(fe.delete(t.ref),T.delete(e))}function _e(e){let t=E.get(e);t&&(pe.delete(t.ref),E.delete(e))}function ve(e){let t=e.nodeType;if(t===1){let t=e;gt(t),_e(t)}else if(t===3){ge(e);return}else if(t===8){Ye(e);return}if(s&&!Ze())for(let t=e.firstChild;t!==null;t=t.nextSibling)ve(t);else{let t=Ze()?Array.from(e.childNodes):e.childNodes;for(let e=0;e<t.length;e++)ve(t[e])}t===1&&Ye(e)}function D(e){if(!e?.parentNode)return!1;try{return ve(e),e.parentNode?.removeChild(e),!0}catch(e){return o(`Failed to remove child node`,e),!1}}function ye(e,t,n){try{return e.insertBefore(t,n),!0}catch(e){return o(`Failed to insert node before reference`,e),!1}}function be(e){return document.createComment(e,!0)}function xe(e,t){return{start:be(`${e}-start-${t}`),end:be(`${e}-end`)}}function O(e,t){let n=e.nextSibling;for(;n&&n!==t;){let e=n.nextSibling;D(n),n=e}}function Se(e,t){let n=t.parentNode;if(n)for(let r=0;r<e.length;r++)ye(n,e[r],t)}function Ce(e,t,n){let r=e,i=Object.getOwnPropertyDescriptor(r,`appendChild`),a=r.insertBefore;r.appendChild=function(e){return a.call(r,e,t)};try{return n()}finally{i?Object.defineProperty(r,"appendChild",i):Reflect.deleteProperty(r,`appendChild`)}}let k=!1,we=!1,Te=/* @__PURE__ */ new WeakMap;function A(){return k}function j(){return k&&we}function Ee(e=!1){k=!0,we=e,Te=/* @__PURE__ */ new WeakMap}function De(){k=!1,we=!1,Te=/* @__PURE__ */ new WeakMap}function Oe(e){let t=k;k=!1;try{return e()}finally{k=t}}function M(e){let t=Te.get(e);return t===void 0?e.firstChild:t}function N(e,t){Te.set(e,t)}function ke(e,t){let n=M(e);return N(e,n),Oe(()=>n?Ce(e,n,t):t())}function Ae(e){return e.nodeType===3&&!/\S/.test(e.textContent||``)}function je(e,t=we){let n=M(e),r=!1;for(;n&&Ae(n);){let e=n.nextSibling;t&&D(n),n=e,r=!0}r&&N(e,n)}function P(e){let t=M(e);return t&&N(e,t.nextSibling),t}function Me(e){let t=M(e);if(!t||t.nodeType!==3)return null;if(Ae(t)){let e=t.nextSibling;for(;e&&Ae(e);)e=e.nextSibling;if(e&&e.nodeType===8&&(e.textContent??``).trimStart().startsWith(`text-`))return null}return P(e),t}function Ne(e,t){je(e);let n=M(e),r=t+`-start-`;if(!n||n.nodeType!==8||!n.textContent?.startsWith(r))return null;P(e);let i=t+`-end`,a=0;for(let e=n.nextSibling;e;e=e.nextSibling){if(e.nodeType!==8)continue;let t=e.textContent;if(t===i){if(a===0)return{start:n,end:e,recreated:!1};a--}else t?.startsWith(r)&&a++}let o=document.createComment(i);return e.insertBefore(o,n.nextSibling),{start:n,end:o,recreated:!0}}function Pe(e,t){if(!k)return null;je(e);let n=M(e);if(n&&n.nodeType===1){let r=n.tagName;if(r===t||r.toLowerCase()===t)return P(e)}return null}function Fe(e,t){if(!t||t.parentNode!==e)return;let n=M(e);for(;n;){let e=n===t?null:n.nextSibling;D(n),n=e}N(e,null)}const F=/* @__PURE__ */ new WeakMap;let Ie=0,I=[];function Le(){return!s||d()}function Re(e){let t=F.get(e);return t||(t={mount:null,destroy:null,dispose:null,state:0},F.set(e,t),Ie++,I.push(new WeakRef(e))),t}function ze(e,t){return e===null?t:Array.isArray(e)?(e.push(t),e):[e,t]}function Be(e,t){if(Le())return;let n=Re(e);n.state!==2&&(n.state!==0&&j()||(n.mount=ze(n.mount,t)))}function Ve(e,t){if(Le())return;let n=Re(e);n.state!==2&&(n.state!==0&&j()||(n.destroy=ze(n.destroy,t)))}function He(e,t){if(Le())return;let n=Re(e);n.state!==2&&(n.dispose=t)}function Ue(e,t,n){if(n.state===1)try{let r=t(e);typeof r==`function`&&(F.get(e)?.state===2?We(e,r):n.destroy=ze(n.destroy,r))}catch(e){o(`Error in mount callback`,e)}}function We(e,t){try{t(e)}catch(e){o(`Error in destroy callback`,e)}}function Ge(e){let t=F.get(e);if(t.state!==0)return;t.state=1;let n=t.mount;if(t.mount=null,n!==null){if(Array.isArray(n))for(let r=0;r<n.length;r++)Ue(e,n[r],t);else Ue(e,n,t)}}function Ke(){if(I.length===0)return;let e=I;I=[];for(let t=0;t<e.length;t++){let n=e[t].deref();n&&Ge(n)}}function qe(){return I.length}function Je(e){for(let t=I.length-1;t>=e;t--){let e=I[t].deref();e&&!e.isConnected&&Ye(e)}}function Ye(e){let t=F.get(e);if(!t||t.state===2)return;let n=t.state===1;t.state=2,Ie--;let r=t.dispose;if(r!==null){t.dispose=null;try{r(e)}catch(e){o(`Error disposing node`,e)}}let i=e;if(n){let e=t.destroy;if(e!==null){if(Array.isArray(e))for(let t=0;t<e.length;t++)We(i,e[t]);else We(i,e)}}t.mount=null,t.destroy=null}function Xe(e){return F.get(e)?.state===1}function Ze(){return Ie>0}const Qe=Symbol(`nuclo.factory.tag`),$e=Symbol(`nuclo.factory.mods`),et=Symbol(`nuclo.event.modifier`);let tt=0;const nt=[];let rt=0;function it(){return rt>=nt.length&&nt.push(()=>null),nt[rt++]}function at(e,t,n){e[Qe]=t,e[$e]=n}function L(e){return typeof e==`function`?e[$e]:void 0}function ot(e){return typeof e==`function`?e[Qe]:void 0}function st(e){return e[et]=!0,e}function ct(e){return typeof e==`function`&&e[et]===!0}function lt(){return tt>0}function ut(e,t,n){tt++;try{return e(t,n)}finally{tt--}}function dt(){return rt}function ft(e){for(;rt>e;){let e=nt[--rt];e[Qe]=void 0,e[$e]=void 0}}const pt=/* @__PURE__ */ new WeakMap;function mt(e,t){let n=pt.get(e);n?Array.isArray(n)?n.includes(t)||n.push(t):n!==t&&pt.set(e,[n,t]):pt.set(e,t)}function ht(e,t){e.removeEventListener(t.type,t.wrapped,t.capture)}function gt(e){a(e);let t=pt.get(e);if(t){if(Array.isArray(t))for(let n=0;n<t.length;n++)ht(e,t[n]);else ht(e,t);pt.delete(e)}}function _t(e){}function vt(e,t){return s?function(n){if(!n)return;let r=n;e===`mount`?Be(r,t):Ve(r,t)}:_t}function yt(e,t,n){return{type:e,wrapped:function(n){let r=this;try{t.call(r,n)}catch(t){o(`Error in '${e}' listener`,t)}},capture:n}}function bt(e,t,n){if(e===`mount`||e===`destroy`)return vt(e,t);if(!s)return _t;let r=yt(e,t,n===!0||typeof n==`object`&&!!n&&n.capture===!0);return st(function(t){if(!t||typeof t.addEventListener!=`function`)return;let i=t;i.addEventListener(e,r.wrapped,n),mt(i,r)})}function xt(e){return e===null||typeof e!=`object`&&typeof e!=`function`}function St(e){return e instanceof Node?!0:typeof e!=`object`||!e?!1:typeof e.nodeType==`number`}function Ct(e){return typeof e==`object`&&!!e}function R(e){return typeof e==`function`}function wt(e){return R(e)&&e.length===0}function Tt(e){return e==null||typeof e==`object`||typeof e==`function`?``:String(e)}function Et(e,t){let n=Tt(t),r=document.createTextNode(n);return s&&!d()&&me(r,e,n),r}function Dt(e){if(!e)return Ot(fe);for(let t of e.roots)Ot(y(t,3))}function Ot(e){for(let t of e){let n=t.deref(),r=n&&T.get(n);if(!r||r.ref!==t||!n.isConnected){r&&r.ref===t&&T.delete(n),e.delete(t),fe.delete(t);continue}let i;try{i=Tt(r.resolver())}catch(e){o(`Failed to update reactive text node`,e),i=``}i!==r.lastValue&&(n.textContent=i,r.lastValue=i)}}function z(e,t=null,n=null){return{kind:e,keys:t,child:n}}const kt=[];let B=0;function At(){return B}function jt(e){B=e}function Mt(e){return B=0,e.leafCount===0?kt:Array(e.leafCount)}function Nt(e,t,n,r,i){e[B]=t,e[B+1]=n,e[B+2]=r,e[B+3]=i,B+=4}function Pt(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r.kind===0){for(let e=0;e<r.keys.length;e++)if(r.keys[e].key===t&&r.keys[e].kind!==3)return!0}}return!1}function Ft(e,t){let n=[];for(let e=0;e<t.length;e++){let i=t[e];if(i==null){n.push(z(4));continue}let a=typeof i;if(a===`function`){let e=L(i);if(e!==void 0){let t=ot(i);if(!t)return null;let r=Ft(t,e);if(!r)return null;n.push(z(3,null,r));continue}if(i.length===0){let e;try{e=i()}catch{return null}if(e==null||typeof e!=`object`&&typeof e!=`function`){n.push(z(2));continue}return null}if(ct(i)){n.push(z(5));continue}return null}if(a===`object`){if(St(i))return null;let e=i,t=Object.keys(e),a=[];for(let i=0;i<t.length;i++){let o=t[i],s=e[o];if(s==null){a.push({key:o,kind:3,prop:!1,cloned:!1,value:void 0});continue}if(o===`style`||Pt(n,o))return null;let c=typeof s;if(c===`function`){let e=r(o);if(e){a.push({key:o,kind:1,prop:!1,cloned:!1,value:e});continue}if(o===`className`&&s.length===0){a.push({key:o,kind:2,prop:!1,cloned:!1,value:void 0});continue}return null}if(c===`object`)return null;a.push({key:o,kind:0,prop:!1,cloned:!1,value:s})}n.push(z(0,a))}else n.push(z(1))}let i=!1,a=!1,o=0,s=-1;for(let e=0;e<n.length;e++){let t=n[e];if((t.kind===1||t.kind===2||t.kind===3)&&(s=e),t.kind===5)i=!0;else if(t.kind===2)o+=4;else if(t.kind===3)a||=t.child.subtreeEvents,o+=t.child.leafCount;else if(t.kind===0)for(let e=0;e<t.keys.length;e++)t.keys[e].kind===1?i=!0:t.keys[e].kind===2&&(o+=4)}return{tag:e,slots:n,events:i,subtreeEvents:i||a,eventProps:null,tracked:i,lastNode:s,leafCount:o}}function It(e,t){if(!e.subtreeEvents)return;let n=e.eventProps;if(n!==null){let e=t;for(let t=0;t<n.length;t++)e[n[t]]=null}e.tracked&>(t);let r=e.slots,i=t.firstChild;for(let e=0;e<r.length&&i!==null;e++){let t=r[e];switch(t.kind){case 1:case 2:i=i.nextSibling;break;case 3:t.child.subtreeEvents&&It(t.child,i),i=i.nextSibling}}}function Lt(e,t){let n=e.slots,r=t.firstChild,i=!1;for(let a=0;a<n.length;a++){let o=n[a];switch(o.kind){case 5:i=!0;break;case 0:{let n=o.keys;for(let r=0;r<n.length;r++){let a=n[r];a.kind===1?(a.prop=a.value in t,a.prop?(e.eventProps??=[]).push(a.value):i=!0):a.kind===0?(a.prop=a.key in t,a.cloned=a.prop?t[a.key]===a.value:t.getAttribute(a.key)===String(a.value)):a.kind===2&&t.removeAttribute(`class`)}break}case 1:case 2:r&&=r.nextSibling;break;case 3:if(!r)return;Lt(o.child,r),r=r.nextSibling}}e.tracked=i}function Rt(e,t,n,r){let a=e.slots;if(t.length!==a.length)return!1;let o=e.lastNode,s=o<0?null:n.firstChild;for(let e=0;e<a.length;e++){let c=a[e],l=t[e];switch(c.kind){case 0:{if(typeof l!=`object`||!l)return!1;let e=l,t=c.keys,a=0;for(let t in e)a++;if(a!==t.length)return!1;for(let a=0;a<t.length;a++){let o=t[a],s=e[o.key];switch(o.kind){case 0:if(s==null||typeof s==`object`||typeof s==`function`)return!1;if(s===o.value&&o.cloned)break;if(o.prop){let e=n;e[o.key]!==s&&(e[o.key]=s)}else{let e=String(s);n.getAttribute(o.key)!==e&&n.setAttribute(o.key,e)}break;case 1:{if(typeof s!=`function`)return!1;let e=o.value;o.prop?n[e]=s:i(n,e,s);break}case 2:{if(typeof s!=`function`||s.length!==0)return!1;let e=s,t;try{t=e()}catch{return!1}let i=t?String(t):``;i&&(n.className=i),Nt(r,1,n,e,i);break}case 3:if(s!=null||!(o.key in e))return!1}}break}case 1:if(l==null||typeof l==`object`||typeof l==`function`||!s)return!1;s.nodeValue=String(l),e<o&&(s=s.nextSibling);break;case 2:{if(typeof l!=`function`||l.length!==0||L(l)!==void 0||!s)return!1;let t;try{t=l()}catch{return!1}if(t!=null&&(typeof t==`object`||typeof t==`function`))return!1;let n=Tt(t),i=s;i.nodeValue=n,Nt(r,0,i,l,n),e<o&&(s=i.nextSibling);break}case 3:{let t=L(l);if(t===void 0||ot(l)!==c.child.tag||!s||!Rt(c.child,t,s,r))return!1;e<o&&(s=s.nextSibling);break}case 4:if(l!=null)return!1;break;case 5:if(!ct(l))return!1;l(n,0)}}return!0}function zt(e,t,n,r){let i=e.slots;if(t.length!==i.length)return!1;let a=n.firstChild;for(let e=0;e<i.length;e++){let o=i[e],s=t[e];switch(o.kind){case 0:{if(typeof s!=`object`||!s)return!1;let e=s,t=o.keys,i=0;for(let a in e){if(i>=t.length)return!1;let o=t[i];if(o.key!==a)return!1;i++;let s=e[a];if(o.kind===2){if(typeof s!=`function`||s.length!==0)return!1;_e(n),Nt(r,1,n,s,n.className)}}if(i!==t.length)return!1;break}case 1:if(!a)return!1;a=a.nextSibling;break;case 2:{if(typeof s!=`function`||s.length!==0||!a||a.nodeType!==3)return!1;let e=a;ge(e),Nt(r,0,e,s,e.nodeValue??``),a=e.nextSibling;break}case 3:{let e=L(s);if(e===void 0||ot(s)!==o.child.tag||!a||!zt(o.child,e,a,r))return!1;a=a.nextSibling;break}case 4:if(s!=null)return!1;break;case 5:if(!ct(s))return!1}}return!0}function Bt(e){for(let t=0;t<e.length;t+=4){let n;try{n=e[t+2]()}catch{continue}if(e[t]===0){let r=Tt(n);r!==e[t+3]&&(e[t+1].nodeValue=r,e[t+3]=r)}else{let r=n?String(n):``;r!==e[t+3]&&(e[t+1].className=r,e[t+3]=r)}}}const Vt={};function Ht(e,t){let n;try{n=t.resolver()}catch(e){o(`Failed to resolve reactive attribute: ${t.key}`,e);return}let r=typeof n!=`object`||!n;if(!(r&&Object.is(n,t.lastValue)))try{let i=t.apply(e,t.key,n);t.lastValue=r&&i!==!1?n:Vt}catch(e){o(`Failed to apply reactive attribute: ${t.key}`,e)}}function Ut(e,t,n,r){let i=e,a={key:t,resolver:n,apply:r,lastValue:Vt};if(s&&!d()){let e=he(i).attributeResolvers,n=0;for(;n<e.length&&e[n].key!==t;)n++;e[n]=a}Ht(i,a)}function Wt(e){if(!e)return Gt(pe);for(let t of e.roots)Gt(y(t,2))}function Gt(e){for(let t of e){let n=t.deref(),r=n&&E.get(n);if(!r||r.ref!==t||!n.isConnected){r&&r.ref===t&&E.delete(n),e.delete(t),pe.delete(t);continue}let i=r.attributeResolvers;for(let e=0;e<i.length;e++)Ht(n,i[e])}}function Kt(e,t){let n=e.style;if(n&&t)for(let e in t){let r=t[e];try{n[e]=r==null?``:String(r)}catch{o(`Failed to set style property '${e}'`)}}}function qt(e,t,n){Kt(e,n)}function Jt(e,t){R(t)?Ut(e,`style`,t,qt):Kt(e,t)}const V=/* @__PURE__ */ new WeakMap,Yt=/* @__PURE__ */ new WeakSet;function Xt(e){return e instanceof HTMLElement?e.className:e.getAttribute(`class`)||``}function Zt(e,t){e instanceof HTMLElement?e.className=t:e.setAttribute(`class`,t)}function Qt(e,t){let n=t.length,r=0;for(let i=0;i<=n;i++)(i===n||t.charCodeAt(i)===32)&&(i>r&&e.add(t.substring(r,i)),r=i+1)}function $t(e){let t=``;for(let n of e)t&&(t+=` `),t+=n;return t}function en(e){let t=Xt(e);if(t&&!V.has(e)){let n=/* @__PURE__ */ new Set;Qt(n,t),V.set(e,n)}Yt.add(e)}function tn(e){V.delete(e),Yt.delete(e)}function nn(e){return Yt.has(e)}function rn(e,t){if(!t)return;let n=V.get(e);n||(n=/* @__PURE__ */ new Set,V.set(e,n)),Qt(n,t)}function an(e,t){let n=V.get(e);if(!n||n.size===0){let n=t||``;Xt(e)!==n&&Zt(e,n);return}if(!t){Zt(e,$t(n));return}let r=$t(n),i=t.length,a=0;for(let e=0;e<=i;e++)if(e===i||t.charCodeAt(e)===32){if(e>a){let i=t.substring(a,e);n.has(i)||(r+=` `+i)}a=e+1}Zt(e,r)}function on(e,t){if(!t)return;let n=Xt(e);if(n&&n!==t){let r=/* @__PURE__ */ new Set;Qt(r,n),Qt(r,t),Zt(e,$t(r))}else Zt(e,t)}const sn=/* @__PURE__ */ new WeakMap;function cn(e,t){let n=String(t);if(sn.set(e,t),e.value===n)return;let r=e.selectedIndex;if(e.value=n,e.value!==n)return e.selectedIndex=r,!1}function ln(e){let t=sn.get(e);t!==void 0&&cn(e,t)}function un(e){sn.delete(e)}function dn(e,t,n,r){if(n!=null){if(r&&t===`className`)on(e,String(n));else if(e instanceof Element&&e.namespaceURI===`http://www.w3.org/2000/svg`)e.setAttribute(t===`className`?`class`:t,String(n));else if(t in e){if(t===`value`&&e.localName===`select`)return cn(e,n);try{e[t]=n}catch{e instanceof Element&&e.setAttribute(t,String(n))}}else e instanceof Element&&e.setAttribute(t,String(n))}}function fn(e,t,n){an(e,String(n||``))}function pn(e,t,n,a=!1){if(n==null)return;let o=t;if(o===`style`){Jt(e,n);return}if(R(n)){if(o===`onMount`){Be(e,n);return}if(o===`onDestroy`){Ve(e,n);return}if(o===`onClick`){i(e,`onclick`,n);return}if(o.charCodeAt(0)===111&&o.charCodeAt(1)===110){let t=r(o);if(t){i(e,t,n);return}if(o in e){i(e,o,n);return}}if(n.length===0){let t=n;o===`className`?(en(e),Ut(e,o,t,fn)):Ut(e,o,t,dn);return}}let s=e;if(o===`className`&&nn(s)){let e=String(n||``);e&&(rn(s,e),on(s,e))}else dn(s,o,n,a)}function mn(e,t,n=!0){let r=!1;for(let i in t){if(i===`value`&&e.localName===`input`){r=!0;continue}let a=i;pn(e,a,t[i],n&&a===`className`)}r&&pn(e,`value`,t.value)}function hn(e){return Ct(e)&&!St(e)&&`className`in e&&typeof e.className==`string`&&Object.keys(e).length===1}function gn(e){je(e);let t=M(e);return!!t&&t.nodeType===8&&t.textContent?.trimStart().startsWith(`text-`)===!0}function _n(e,t){let n=M(e);if(n&&n.nodeType===3)return P(e),n.textContent!==t&&(n.textContent=t),n;let r=document.createTextNode(t);return e.insertBefore(r,n),N(e,n),r}function vn(e,t,n){if(t==null)return null;if(R(t)){if(wt(t))try{let r=t();if(hn(r))return mn(e,{className:()=>{let e=t();return hn(e)?e.className:``}}),null;if(xt(r)){if(A()){let n=e,i=Tt(r);if(j()){let e=Me(n);if(e)return e.textContent!==i&&(e.textContent=i),me(e,t,i),null}if(gn(n))return P(n),me(_n(n,i),t,i),null}return yn(n,Et(t,r))}return null}catch(e){return o(`Error evaluating reactive text function:`,e),yn(n,Et(bn,``))}let r=t(e,n);return r==null?null:xt(r)?yn(n,document.createTextNode(String(r))):St(r)?r:(Ct(r)&&mn(e,r),null)}let r=t;if(xt(r)){if(A()){let t=e,n=String(r),i=j();if(i){let e=Me(t);if(e)return ge(e),e.textContent!==n&&(e.textContent=n),null}if(gn(t)){P(t);let e=_n(t,n);return i&&ge(e),null}}return yn(n,document.createTextNode(String(r)))}return St(r)?r:(mn(e,r),null)}function yn(e,t){if(s&&!A()&&!d())return t;let n=document.createDocumentFragment();return n.appendChild(be(` text-${e} `)),n.appendChild(t),n}function bn(){return``}const xn=p[1],Sn=/* @__PURE__ */ new WeakMap,Cn=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{xn.delete(e)}):null;function wn(e,t){for(let t=0;t<e.length;t++){let n=e[t].condition;if(typeof n==`function`?n():n)return t}return t.length>0?-1:null}function Tn(e){let{groups:t,elseContent:n,host:r,index:i,endMarker:a}=e,o=wn(t,n);o!==e.activeIndex&&(O(e.startMarker,e.endMarker),e.activeIndex=o,o!==null&&jn(o>=0?t[o].content:n,r,i,a))}function En(e){let t=Sn.get(e.startMarker);if(Sn.set(e.startMarker,e),t)return;let n=new WeakRef(e.startMarker);v(1,n),Cn?.register(e.startMarker,n)}function Dn(e){return Sn.get(e)}function On(e){if(!e)return kn(xn);for(let t of e.roots)kn(y(t,1))}function kn(e){for(let t of e){let n=t.deref();if(n===void 0){e.delete(t),xn.delete(t);continue}let r=Sn.get(n);if(!r){e.delete(t),xn.delete(t);continue}if(!n.isConnected||!r.endMarker.isConnected){Sn.delete(n),e.delete(t),xn.delete(t);continue}let i=qe(),a=r.activeIndex;try{Tn(r)}catch(e){o(`when() threw during update; it is retried on the next update()`,e),Je(i),r.activeIndex!==a&&(O(n,r.endMarker),r.activeIndex=null)}}}function An(e,t,n,r){return!R(e)||wt(e)||L(e)!==void 0?vn(t,e,n):Ce(t,r,()=>{let r=vn(t,e,n);return r&&!r.parentNode?r:null})}function jn(e,t,n,r){for(let i of e){let e=An(i,t,n,r);e&&Se([e],r)}}function Mn(e,t,n=0){let r=n,i=e,a=A(),o=j();for(let n=0;n<t.length;n+=1){let s=t[n];if(s==null)continue;let c=vn(e,s,r);if(c){if(c.parentNode!==i){if(a){let e=M(i);i.insertBefore(c,e),N(i,e)}else i.appendChild(c)}else o&&M(i)===c&&P(i);r+=1}}}function Nn(e,t){tn(e),e.removeAttribute(`class`),t&&(gt(e),_e(e),e.removeAttribute(`style`))}function Pn(e,t,n){if(lt()){let n=it();return at(n,e,t),n}let r=function(r,i=0){let a=r?Pe(r,e):null;a&&(Nn(a,j()),e===`select`&&un(a));let o=a??(n?document.createElementNS(`http://www.w3.org/2000/svg`,e):document.createElement(e)),s=a?o.lastChild:null;return Mn(o,t,i),a&&Fe(o,s),e===`select`&&ln(o),o};return n||at(r,e,t),r}function Fn(e){return(...t)=>Pn(e,t,!1)}function In(e){return(...t)=>Pn(e,t,!0)}function Ln(){return{regions:/* @__PURE__ */ new Map,pending:/* @__PURE__ */ new Map,placed:/* @__PURE__ */ new Map}}const Rn=Ln(),H=/* @__PURE__ */ new WeakMap,U=/* @__PURE__ */ new WeakMap,zn=`region.registry`;function W(){if(!d())return Rn;let e=f(),t=e.get(zn);return t||e.set(zn,t=Ln()),t}const Bn=typeof FinalizationRegistry<`u`?new FinalizationRegistry(({id:e,ref:t,waiting:n})=>{n?Xn(Rn,e,t):Rn.regions.get(e)===t&&Rn.regions.delete(e)}):null,Vn=[];function G(e){return Xe(e)&&!e.isConnected}function Hn(e){H.delete(e.startMarker);let t=W();t.regions.get(e.id)?.deref()===e.startMarker&&t.regions.delete(e.id);let n=[...e.hidden,...e.views];e.hidden.length=0,e.views.length=0;for(let e of n)K(e),G(e.anchor)||Zn(e)}function Un(){let e=W();for(let[t,n]of e.pending){for(let e of n){let t=e.deref();if(t&&!G(t))continue;n.delete(e),d()||Bn?.unregister(e);let r=t&&U.get(t)?.find(t=>t.pendingRef===e);r&&(r.pendingRef=null)}n.size===0&&e.pending.delete(t)}for(let[t,n]of e.placed){for(let e of n)e.deref()||n.delete(e);n.size===0&&e.placed.delete(t)}for(let[t,n]of e.regions){let r=n.deref();if(!r){e.regions.delete(t);continue}let i=H.get(r);if(i){if(G(r))Hn(i);else for(let e of[...i.hidden,...i.views])G(e.anchor)&&mr(e)}}}function Wn(e){let t=e,n=W(),r=n.regions.get(t.id)?.deref();if(r&&r!==t.startMarker&&r.isConnected)console.warn(`nuclo: two regions share the id "${t.id}". Every into("${t.id}", …) now goes to the one built last; the other stays empty. Give each region its own id.`);else if(r&&r!==t.startMarker&&G(r)){let e=H.get(r);e&&Hn(e)}let i=H.has(t.startMarker),a=new WeakRef(t.startMarker);n.regions.set(t.id,a),H.set(t.startMarker,t),!i&&!d()&&Bn?.register(t.startMarker,{id:t.id,ref:a,waiting:!1}),He(t.startMarker,hr),t.claiming&&Vn.push(t);let o=n.pending.get(t.id);if(o){n.pending.delete(t.id);for(let e of o){d()||Bn?.unregister(e);let n=Yn(e,t.id);n&&(n.pendingRef=null,or(t,n,null))}}for(let e of Gn(n,t.id))or(t,e,null)}function Gn(e,t){let n=e.placed.get(t);if(!n)return[];let r=[];for(let e of n){let t=e.deref(),i=t&&U.get(t)?.find(t=>t.placedRef===e);i&&nr(i)||(n.delete(e),i&&(K(i),G(i.anchor)||r.push(i)))}return n.size===0&&e.placed.delete(t),r}function Kn(e){return e.nodeType===8&&U.has(e)}function qn(e){let t=W(),n=t.regions.get(e)?.deref();if(!n){t.regions.delete(e);return}let r=H.get(n);if(r&&G(n))Hn(r);else return r}function Jn(e,t){let n=H.get(e);return n&&n.endMarker===t?n:void 0}function Yn(e,t){let n=e.deref();if(n&&!G(n))return U.get(n)?.find(e=>e.id===t&&e.region===null)}function Xn(e,t,n){let r=e.pending.get(t);r&&(r.delete(n),r.size===0&&e.pending.delete(t))}function Zn(e){if(e.pendingRef)return;let t=W(),n=t.pending.get(e.id);n||t.pending.set(e.id,n=/* @__PURE__ */ new Set);let r=new WeakRef(e.anchor);e.pendingRef=r,n.add(r),d()||Bn?.register(e.anchor,{id:e.id,ref:r,waiting:!0},r)}function Qn(e){let t=e.pendingRef;t&&(e.pendingRef=null,Xn(W(),e.id,t),d()||Bn?.unregister(t))}function $n(e,t){let n=U.get(e);for(let e of n??[])t.some(t=>t.id===e.id)||mr(e);U.set(e,t),He(e,hr);for(let e of t){let t=n?.find(t=>t.id===e.id)??null;t&&(e.pendingRef=t.pendingRef,t.pendingRef=null);let r=qn(e.id);r?(Qn(e),or(r,e,t)):Zn(e)}}function er(e){e.startMarker.textContent=`region-start-${e.index}-v${e.views.length}`}function tr(e){let t=/-v(\d+)$/.exec(e||``);return t?parseInt(t[1],10):0}function nr(e){return e.region?.deref()??null}function rr(e,t,n=null){if(e.region=new WeakRef(t),n?.placedRef&&(e.placedRef=n.placedRef,n.placedRef=null),e.placedRef)return;let r=W(),i=r.placed.get(e.id);i||r.placed.set(e.id,i=/* @__PURE__ */ new Set),e.placedRef=new WeakRef(e.anchor),i.add(e.placedRef)}function K(e){e.region=null,e.first=null,e.last=null;let t=e.placedRef;if(!t)return;e.placedRef=null;let n=W(),r=n.placed.get(e.id);r&&(r.delete(t),r.size===0&&n.placed.delete(e.id))}function ir(e,t,n){let r=t.nextSibling;e.first=r===n||!r?null:new WeakRef(r),e.last=e.first?new WeakRef(n.previousSibling):null}function ar(e){let t=e;O(t.startMarker,t.endMarker);for(let e of t.views)K(e);for(let e of t.hidden)K(e);t.views.length=0,t.hidden.length=0,t.showingEmpty=!0,t.empty.length&&jn(t.empty,t.host,t.index,t.endMarker),er(t)}function or(e,t,n){if(e.deferred)e.deferred.push([t,n]);else{e.deferred=[];try{sr(e,t,n)}finally{let t=e.deferred;e.deferred=null;for(let[n,r]of t)or(e,n,r)}}}function sr(e,t,n){if(n&&nr(n)===e){let r=e.hidden.indexOf(n);if(r!==-1){e.hidden[r]=t,rr(t,e,n),n.region=null;return}dr(e,t,n)}else{if(e.showingEmpty||e.type===`latest`&&e.views.length>0){O(e.startMarker,e.endMarker);for(let t of e.views)t.first=null,t.last=null,e.hidden.push(t);e.views.length=0,e.showingEmpty=!1,e.claiming=!1,e.claimCursor=null}if(e.views.push(t),rr(t,e),A()&&e.claiming){let{before:n,cursor:r}=cr(e,t.content);ir(t,n,r)}else{let n=e.claiming&&e.claimCursor?e.claimCursor:e.endMarker,r=n.previousSibling;jn(t.content,e.host,e.index,n),ir(t,r,n)}er(e)}}function cr(e,t){let n=e.host,r=M(n),i=e.claimCursor??e.endMarker,a=i.previousSibling;N(n,i);for(let n of t)Mn(e.host,[n],e.index);let o=M(n)??e.endMarker;return e.claimCursor=o,N(n,r),{before:a,cursor:o}}function lr(e,t,n,r){let i=e.host,a=M(i),o=n.previousSibling,s=document.createComment(`region-claim-boundary`);i.insertBefore(s,r),N(i,n===r?s:n);try{for(let n of t)Mn(e.host,[n],e.index);let n=M(i);for(;n&&n!==s;){let e=n.nextSibling;D(n),n=e}}finally{i.removeChild(s),N(i,a)}return o}function ur(e,t){let n=t.last?.deref();if(n)return n.nextSibling??e.endMarker;for(let n=e.views.indexOf(t)+1;n<e.views.length;n++){let t=e.views[n].first?.deref();if(t)return t}return e.endMarker}function dr(e,t,n){let r=ur(e,n),i=lr(e,t.content,n.first?.deref()??r,r);e.views[e.views.indexOf(n)]=t,rr(t,e,n),K(n),ir(t,i,r),er(e)}function fr(e){let t=e;t.empty.length&&cr(t,t.empty),t.showingEmpty=!0}function pr(e){lr(e,e.empty,e.startMarker.nextSibling??e.endMarker,e.endMarker)}function mr(e){Qn(e);let t=nr(e);if(!t){K(e);return}let n=t.hidden.indexOf(e);if(n!==-1){t.hidden.splice(n,1),K(e);return}let r=t.views.indexOf(e);if(r!==-1){t.views.splice(r,1);let n=e.last?.deref(),i=n?n.nextSibling:null,a=e.first?.deref()??null;for(;a&&a!==i;){let e=a.nextSibling;D(a),a=e}}if(K(e),r===-1)return;if(t.views.length>0||t.claiming){er(t);return}let i=t.hidden.pop();i?or(t,i,null):ar(t)}function hr(e){let t=e,n=U.get(t);if(n){U.delete(t);for(let e of n)mr(e);return}let r=H.get(t);r&&Hn(r)}function gr(){for(let e of Vn){if(e.claiming&&H.get(e.startMarker)===e){let t=e.claimCursor;for(;t&&t!==e.endMarker;){let e=t.nextSibling;D(t),t=e}e.views.length===0&&!e.showingEmpty&&ar(e)}e.claiming=!1,e.claimCursor=null}Vn.length=0}function _r(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}const vr=p[0],yr=/* @__PURE__ */ new WeakMap,br=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{vr.delete(e)}):null;let xr=0;function Sr(e,t){let n=yr.get(e);if(yr.set(e,t),n)return;let r=new WeakRef(e);v(0,r),br?.register(e,r)}function Cr(e){return Array.isArray(e)?e:Array.from(e)}function wr(e,t,n){let r=typeof e==`function`?e(t,n):e;return typeof r!=`object`||!r?null:`tagName`in r||Kn(r)?r:null}function Tr(e,t,n){return wr(e.renderItem(t,n),e.host,n)}function Er(e,t,n){let r=dt();try{return Dr(e,t,n)}finally{ft(r)}}function Dr(e,t,n){e.lastRenderLeaves=null;let r=e.template,i=s&&!A()&&!d(),a=r&&i?ut(e.renderItem,t,n):e.renderItem(t,n);if(r!==null&&i){let i=L(a);if(i!==void 0){if(r===void 0){let t=ot(a),r=t?Ft(t,i):null,o=wr(a,e.host,n);if(r&&o){let t=o.cloneNode(!0);Lt(r,t);let n=At(),a=Mt(r),s=!1;try{s=zt(r,i,o,a),s&&(e.lastRenderLeaves=a)}finally{jt(n)}if(!s)return e.template=null,e.lastRenderLeaves=null,o;e.template={tmpl:r,skeleton:t},e.rowShape=r}else e.template=null;return o}let o=r.skeleton.cloneNode(!0),s=At(),c=Mt(r.tmpl);try{if(ot(a)===r.tmpl.tag&&Rt(r.tmpl,i,o,c))return e.lastRenderLeaves=c,o}finally{jt(s)}return e.template=null,Tr(e,t,n)}if(r===void 0)e.template=null;else return e.template=null,Tr(e,t,n)}return wr(a,e.host,n)}function Or(e,t){let n=t.element,r=e.rowShape;t.dyn!==null&&r?It(r,n):ve(n)}function kr(e,t){let n=e.rowShape;if(t.dyn===null||!n)return D(t.element);let r=t.element;return r.parentNode?(It(n,r),r.parentNode.removeChild(r),!0):!1}function Ar(e,t,n,r,i){if(r.parentNode!==n||i.parentNode!==n)return!1;for(let n=0;n<t.length;n++)t[n].element&&Or(e,t[n]);if(s&&n.firstChild===r&&n.lastChild===i)return n.textContent=``,n.appendChild(r),n.appendChild(i),!0;for(let e=0;e<t.length;e++){let r=t[e].element;r&&r.parentNode===n&&n.removeChild(r)}return!0}function jr(e){let t=e.length;if(t===0)return[];let n=Array(t),r=[];for(let i=0;i<t;i++){let t=e[i],a=0,o=r.length;for(;a<o;){let n=a+o>>1;e[r[n]]<t?a=n+1:o=n}n[i]=a>0?r[a-1]:-1,a===r.length?r.push(i):r[a]=i}let i=r.length,a=r[i-1],o=Array(i);for(;i>0;)o[--i]=a,a=n[a];return o}function Mr(e,t,n,r,i,a,o){for(let s=r;s<i;s++){let r=n[s],i=Er(e,r,s);if(!i)continue;let c=e.lastRenderLeaves;o.push({item:r,element:i,dyn:c,dynCreatedAt:c?e.currentFlushEpoch:void 0}),e.lastRenderLeaves=null,t.insertBefore(i,a)}}function Nr(e){if(!e)return null;let t=e.nodeName===`OPTGROUP`?e.parentNode:e;return t&&t.nodeName===`SELECT`&&!t.multiple?t:null}function Pr(e){let t=Cr(e.itemsProvider());if(_r(e.lastSyncedItems,t))return;let n=s?Nr(e.startMarker.parentNode):null,r=n&&n.selectedIndex>=0?n.value:null,i=qe();try{if(Fr(e,t),r!==null&&n.value!==r){let e=n.selectedIndex;n.value=r,n.value!==r&&(n.selectedIndex=e)}}catch(t){let{startMarker:n,endMarker:r}=e;throw n.parentNode&&n.parentNode===r.parentNode&&O(n,r),e.records=[],e.lastSyncedItems=[],e.allRecordsCreatedAt=void 0,Je(i),t}}function Fr(e,t){let{startMarker:n,endMarker:r}=e,i=n.parentNode??e.host,a=e.records,o=a.length,s=t.length;if(s===0){if(o>0&&!Ar(e,a,i,n,r))for(let t=0;t<o;t++)kr(e,a[t]);e.records=[],e.lastSyncedItems=[],e.allRecordsCreatedAt=void 0;return}let c=0,l=Math.min(o,s);for(;c<l&&a[c].item===t[c];)c++;let u=0,d=l-c;for(;u<d&&a[o-1-u].item===t[s-1-u];)u++;let f=c,p=o-u,m=c,h=s-u;if(f===p){let n=p<o?a[p].element:r;if(p===o)Mr(e,i,t,m,h,n,a),e.allRecordsCreatedAt=o===0?e.currentFlushEpoch:void 0;else{let r=[];Mr(e,i,t,m,h,n,r),e.records=a.slice(0,f).concat(r,a.slice(f)),e.allRecordsCreatedAt=void 0}e.lastSyncedItems=t.slice();return}if(m===h){for(let t=f;t<p;t++)kr(e,a[t]);a.splice(f,p-f),e.allRecordsCreatedAt=void 0,e.lastSyncedItems=t.slice();return}let ee=p-f,g=h-m,_=Array(g).fill(-1),v=new Uint8Array(ee),y=0,te=Math.min(p,h);for(let e=c;e<te;e++)a[e].item===t[e]&&(_[e-m]=e,v[e-f]=1,y++);let b=y,x=/* @__PURE__ */ new Map;for(let e=p-1;e>=f;e--){if(v[e-f])continue;let t=a[e].item,n=x.get(t);n===void 0?x.set(t,e):typeof n==`number`?x.set(t,[n,e]):n.push(e)}for(let e=0;e<g;e++){if(_[e]!==-1)continue;let n=x.get(t[m+e]);if(n===void 0)continue;let r;typeof n==`number`?(r=n,x.delete(t[m+e])):(r=n.pop(),n.length===0&&x.delete(t[m+e])),_[e]=r,v[r-f]=1,y++}if(y===0&&f===0&&p===o){if(!Ar(e,a,i,n,r))for(let t=0;t<o;t++)kr(e,a[t]);let c=[];Mr(e,i,t,0,s,r,c),e.records=c,e.allRecordsCreatedAt=e.currentFlushEpoch,e.lastSyncedItems=t.slice();return}for(let t=f;t<p;t++)v[t-f]||kr(e,a[t]);let ne=null,re=y-b<=8&&b>=32;if(y>0&&!re){let e=[],t=[];for(let n=0;n<g;n++)_[n]!==-1&&(e.push(_[n]),t.push(n));ne=new Uint8Array(g);let n=jr(e);for(let e=0;e<n.length;e++)ne[t[n[e]]]=1}let ie=Array(g),S=0,ae=p<o?a[p].element:r;for(let n=g-1;n>=0;n--){let r=_[n];if(r===-1){let r=t[m+n],a=Er(e,r,m+n);if(!a){ie[n]=null,S++;continue}let o=e.lastRenderLeaves;ie[n]={item:r,element:a,dyn:o,dynCreatedAt:o?e.currentFlushEpoch:void 0},e.lastRenderLeaves=null,i.insertBefore(a,ae),ae=a;continue}let o=a[r];ie[n]=o;let s=o.element;(ne?!ne[n]:!(re&&r===m+n))&&i.insertBefore(s,ae),ae=s}let C=Array(f+(g-S)+(o-p)),w=0;for(let e=0;e<f;e++)C[w++]=a[e];for(let e=0;e<g;e++){let t=ie[e];t&&(C[w++]=t)}for(let e=p;e<o;e++)C[w++]=a[e];e.records=C,e.allRecordsCreatedAt=void 0,e.lastSyncedItems=t.slice()}function Ir(e,t,n,r,i,a,o){return{itemsProvider:e,renderItem:t,startMarker:n,endMarker:r,records:i,host:a,lastSyncedItems:o,template:void 0,rowShape:null,lastRenderLeaves:null,currentFlushEpoch:void 0,allRecordsCreatedAt:void 0}}function Lr(e,t,n,r){return A()?zr(e,t,n,r):Rr(e,t,n,r)}function Rr(e,t,n,r){let{start:i,end:a}=xe(`list`,r),o=Ir(e,t,i,a,[],n,[]),c=n;return c.appendChild(i),c.appendChild(a),Pr(o),s&&!d()&&Sr(i,o),o}function zr(e,t,n,r){let i=n,a=Ne(i,`list`);if(!a)return ke(i,()=>Rr(e,t,n,r));let{start:o,end:c}=a,l=Cr(e()),u=[];for(let e=0;e<l.length;e++){let r=wr(t(l[e],e),n,e);r&&u.push({item:l[e],element:r,dyn:null,dynCreatedAt:void 0})}let f=M(i);for(;f&&f!==c;){let e=f.nextSibling;D(f),f=e}let p=c;for(let e=u.length-1;e>=0;e--){let t=u[e].element;(t.parentNode!==i||t.nextSibling!==p)&&i.insertBefore(t,p),p=t}N(i,c.nextSibling);let m=Ir(e,t,o,c,u,n,l.slice());return s&&!d()&&Sr(o,m),m}function Br(e){if(xr++,!e)return Vr(vr);for(let t of e.roots)Vr(y(t,0))}function Vr(e){for(let t of e){let n=t.deref();if(!n){e.delete(t),vr.delete(t);continue}let r=yr.get(n);if(!r){e.delete(t),vr.delete(t);continue}if(!n.isConnected||!r.endMarker.isConnected){yr.delete(n),e.delete(t),vr.delete(t);continue}r.currentFlushEpoch=xr;try{Pr(r)}catch(e){o(`list() threw during update; it is retried on the next update()`,e)}finally{r.currentFlushEpoch=void 0}if(r.allRecordsCreatedAt===xr)continue;let i=r.records;for(let e=0;e<i.length;e++){if(i[e].dynCreatedAt===xr)continue;let t=i[e].dyn;t&&Bt(t)}}}function Hr(e,t){return`when-start-${e}-b${t===null?`n`:t}`}function Ur(e){let t=/-b(n|-?\d+)$/.exec(e||``);if(t)return t[1]===`n`?null:parseInt(t[1],10)}var Wr=class e{groups;elseContent;constructor(e,t){this.groups=e,this.elseContent=t}cloneWith(t,n){return new e(t?[...this.groups,t]:this.groups,n??this.elseContent)}render(e,t){return A()?this.hydrateRender(e,t):this.freshRender(e,t)}freshRender(e,t){let{start:n,end:r}=xe(`when`,t),i=this.createRuntimeFromMarkers(e,t,n,r),a=e;return a.appendChild(n),a.appendChild(r),Tn(i),n.textContent=Hr(t,i.activeIndex),n}hydrateRender(e,t){let n=e,r=Ne(n,`when`);if(!r)return ke(n,()=>this.freshRender(e,t));let{start:i,end:a}=r,o=wn(this.groups,this.elseContent),s=Dn(i),c=s?s.activeIndex:Ur(i.textContent);if(!r.recreated&&(c===void 0||c===o)){if(o!==null){let n=o>=0?this.groups[o].content:this.elseContent;for(let r of n)Mn(e,[r],t)}let r=M(n);for(;r&&r!==a;){let e=r.nextSibling;D(r),r=e}}else if(O(i,a),o!==null){let n=o>=0?this.groups[o].content:this.elseContent;Oe(()=>jn(n,e,t,a))}return N(n,a.nextSibling),this.createRuntimeFromMarkers(e,t,i,a,o),i}createRuntimeFromMarkers(e,t,n,r,i=null){let a={startMarker:n,endMarker:r,host:e,index:t,groups:this.groups,elseContent:this.elseContent,activeIndex:i};return s&&!d()&&En(a),a}};function Gr(e){return Object.assign(function(t,n){return e.render(t,n)},{when:function(t,...n){return Gr(e.cloneWith({condition:t,content:n}))},else:function(...t){return Gr(e.cloneWith(void 0,t))}})}function Kr(e,...t){return Gr(new Wr([{condition:e,content:t}],[]))}const qr=[Un,Br,On,Wt,Dt];function Jr(...e){ie();let t=e.length>0?{roots:ue(e)}:void 0;for(let e of qr)e(t);Ke()}function Yr(e,t){return function(n,r){return Lr(e,t,n,r).startMarker}}function Xr(e,t,n,r,i){let a=e.empty===void 0?[]:[e.empty];return{id:e.id,type:e.type??`latest`,empty:a,startMarker:r,endMarker:i,host:t,index:n,views:[],hidden:[],showingEmpty:!1,claimCursor:null,claiming:!1,deferred:null}}function Zr(e,t,n){let{start:r,end:i}=xe(`region`,n),a=t;a.appendChild(r),a.appendChild(i);let o=Xr(e,t,n,r,i);return ar(o),Wn(o),r}function Qr(e,t,n){let r=t,i=Ne(r,`region`);if(!i)return ke(r,()=>Zr(e,t,n));let{start:a,end:o}=i;N(r,o.nextSibling);let s=Jn(a,o);if(s&&(s.id!==e.id||s.type!==(e.type??`latest`))){Hn(s);let r=Xr(e,t,n,a,o);return Oe(()=>{ar(r),Wn(r)}),a}if(s)return s.type=e.type??`latest`,s.empty=e.empty===void 0?[]:[e.empty],s.host=t,s.index=n,s.showingEmpty&&pr(s),a;let c=Xr(e,t,n,a,o);return i.recreated?(ar(c),Wn(c),a):(c.claiming=!0,c.claimCursor=a.nextSibling,tr(a.textContent)===0&&fr(c),Wn(c),a)}function $r(e){return function(t,n){return A()?Qr(e,t,n):Zr(e,t,n)}}function ei(e){je(e);let t=M(e);return!t||t.nodeType!==8||!t.textContent?.startsWith(`view-`)?null:(P(e),t)}function ti(e,...t){let n=typeof e==`string`?[[e,t]]:Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[t]]);return function(e,t){let r=e,i=A()&&ei(r)||be(`view-${t}`);return $n(i,n.map(([e,t])=>({id:e,content:t,anchor:i,region:null,pendingRef:null,first:null,last:null}))),i}}const q=/* @__PURE__ */ new WeakMap,J=[],ni=typeof FinalizationRegistry<`u`?new FinalizationRegistry(e=>{let t=J.indexOf(e);t!==-1&&J.splice(t,1)}):null;function ri(e){if(wt(e)){let t=e();if(R(t))return{build:t,component:e}}return{build:e,component:null}}function ii(e,t){if(!t||!s||!e||e.nodeType!==1)return;let n=e,r=q.get(n);if(r){r.component=t;return}let i={root:new WeakRef(n)};q.set(n,{component:t}),J.push(i),ni?.register(e,i,i)}function ai(e,t,n=0){let{build:r,component:i}=ri(e),a=t||document.body,o=qe(),s;try{s=r(a,n),s.parentNode!==a&&a.appendChild(s)}catch(e){throw Je(o),e}return Ke(),ii(s,i),s}function oi(e,t){let{build:n,component:r}=ri(e),i=ci(n,t,!1,null);return ii(i,r),i}function si(e,t){if(e!==void 0){let{build:n}=ri(e);return ci(n,t,!0,null)}let n=0;for(let e=0;e<J.length;e++){let t=J[e],r=t.root.deref(),i=r?.parentNode;if(!r||!r.isConnected||!i||i.nodeType!==1){ni?.unregister(t),r&&q.delete(r);continue}let a=q.get(r);try{let e=ci(a.component(),i,!0,r);e!==r&&(q.delete(r),q.set(e,a),t.root=new WeakRef(e),ni?.unregister(t),ni?.register(e,t,t))}catch(e){o(`forceUpdate(): component threw; keeping this root's previous DOM`,e)}J[n++]=t}J.length=n}function ci(e,t,n,r){let i=t||document.body,a=i;Ee(n),r?N(a,r):n&&je(a,!1);let o=qe(),s;try{s=e(i,0);let t=s;if(t&&t.nodeType===1&&t.parentNode!==a){let e=M(a);if(e){let n=e.nextSibling;a.insertBefore(t,e),D(e),N(a,n)}else a.appendChild(t),N(a,null)}}catch(e){throw Je(o),e}finally{De(),gr()}return Ke(),s}function li(){return{atomCache:/* @__PURE__ */ new Map,atomMeta:/* @__PURE__ */ new Map,rawKeys:/* @__PURE__ */ new Set,baseRules:[],queryRules:/* @__PURE__ */ new Map,styleEpoch:0,cssTextCache:null,sheet:null,sheetDocument:null,baseRuleCount:0,groupRules:/* @__PURE__ */ new Map,externalRules:null,hasExternalGroups:!1}}const ui=Symbol.for(`nuclo.style.engine.v1`),di=globalThis;let fi;function Y(){return fi??=di[ui]??(di[ui]=li())}function pi(e){for(let t of e){let e=Y();e.queryRules.has(t)||e.queryRules.set(t,[])}}function mi(e,t){let n=Y();try{let r=e.cssRules.length;e.insertRule(t+`{}`,r);let i=e.cssRules[r];return n.groupRules.set(t,i),n.groupRules.set(X(i),i),i}catch{return null}}const hi=/* @__PURE__ */ new WeakMap;function X(e){let t=hi.get(e);if(t!==void 0)return t;let n=e.cssText,r=n.indexOf(`{`),i=(r===-1?n:n.slice(0,r)).trim();return hi.set(e,i),i}function gi(e){return e instanceof CSSStyleRule?e.selectorText:X(e)}function _i(e,t){let n=Y();if(!n.externalRules)return;let r=Q(t,gi(e)),i=n.externalRules.get(r);i||(i=/* @__PURE__ */ new Set,n.externalRules.set(r,i)),i.add(e.cssText)}function vi(e,t){let n=Y();if(!n.externalRules)return!1;let r=Q(t,gi(e)),i=n.externalRules.get(r);return i?.delete(e.cssText)?(i.size===0&&n.externalRules.delete(r),n.externalRules.size===0&&(n.externalRules=null),!0):!1}function yi(e){let t=Y();for(let n=0;n<e.length;n++){let r=e[n];if(r instanceof CSSStyleRule){_i(r,void 0);continue}let i=X(r);if(`cssRules`in r&&!i.startsWith(`@keyframes`)){let e=r;t.hasExternalGroups=!0,t.groupRules.set(i,e);for(let t=0;t<e.cssRules.length;t++)_i(e.cssRules[t],i)}else _i(r,void 0)}}function bi(e,t){let n=Y();try{if(e.insertRule(t,n.baseRuleCount),vi(e.cssRules[n.baseRuleCount],void 0)){e.deleteRule(n.baseRuleCount);return}n.baseRuleCount++}catch{}}function xi(e,t){let n=Y();try{let r=e.cssRules.length;e.insertRule(t,r);let i=e.cssRules[r];n.externalRules&&vi(i,X(e))&&e.deleteRule(r)}catch{}}function Si(e,t){let n=Y(),r=n.groupRules.get(t);if(r)return r;if(!n.hasExternalGroups)return mi(e,t);try{let r=e.cssRules.length;e.insertRule(t+`{}`,r);let i=X(e.cssRules[r]);e.deleteRule(r);let a=n.groupRules.get(i);if(a)return n.groupRules.set(t,a),a}catch{return null}return mi(e,t)}function Z(){let e=Y();if(typeof document>`u`||typeof document.getElementById!=`function`)return null;if(e.sheet&&e.sheetDocument===document&&e.sheet.ownerNode&&e.sheet.ownerNode.isConnected)return e.sheet;let t=document.getElementById(`nuclo-styles`),n;if(t?.tagName===`STYLE`?n=t:(n=document.createElement(`style`),n.id=`nuclo-styles`,t?t.replaceWith(n):document.head.appendChild(n)),e.sheet=n.sheet,e.sheetDocument=document,e.groupRules.clear(),e.baseRuleCount=0,e.externalRules=null,e.hasExternalGroups=!1,!e.sheet)return null;if(e.sheet.cssRules.length>0){let t=0;for(;t<e.sheet.cssRules.length;){let n=e.sheet.cssRules[t];if(!(n instanceof CSSStyleRule)&&`cssRules`in n&&!X(n).startsWith(`@keyframes`))break;t++}e.baseRuleCount=t,e.externalRules=/* @__PURE__ */ new Map,yi(e.sheet.cssRules)}for(let t of e.baseRules)bi(e.sheet,t);for(let[t,n]of e.queryRules){let r=Si(e.sheet,t);if(r)for(let e of n)xi(r,e)}return e.sheet}function Ci(e,t){let n=Y(),r=Z();if(t===void 0)n.baseRules.push(e);else{let r=n.queryRules.get(t);r||(r=[],n.queryRules.set(t,r)),r.push(e)}if(n.cssTextCache=null,r){if(t===void 0)bi(r,e);else{let n=Si(r,t);n&&xi(n,e)}}}function wi(e){let t=0x811c9dc5,n=0x7ee3623b;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619),n=Math.imul(n^i,0x85ebca6b)}return(t>>>0).toString(36)+((n>>>9)%1296).toString(36)}function Q(e,t){return(e===void 0?`-`:`+`+e.length+`:`+e)+t.length+`:`+t}function Ti(e,t){return e+t.length+`:`+t}function Ei(e,t){let n=``,r=0;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);a===92&&i+1<e.length?n+=e[i]+e[++i]:r===0?a===34||a===39?(r=a,n+=e[i]):n+=a===38?t:e[i]:(n+=e[i],a===r&&(r=0))}return n}function Di(e,t){let n=`.`+e;return n+Ei(t,n)}function Oi(e){if(e.length===0||e===`-`)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(!(n>=97&&n<=122||n>=65&&n<=90||n===45||n===95||t>0&&n>=48&&n<=57))return!1}if(e.charCodeAt(0)===45&&e.length>1){let t=e.charCodeAt(1);if(t>=48&&t<=57)return!1}return!0}function ki(e,t,n,r,i=!1){let a=Y(),o=Q(e,t);for(let[e,t]of n)o=Ti(Ti(o,e),t);r!==void 0&&!Oi(r)&&(console.warn(`[nuclo] css() name ${JSON.stringify(r)} is not a valid CSS class name (letters, digits, - and _ only, not starting with a digit); falling back to a generated name.`),r=void 0);let s=r===void 0?`a`+o:`n`+Ti(``,r)+o,c=a.atomCache.get(s);if(c!==void 0)return Z(),c;r===void 0?c=`n`+wi(s):(c=i?r:r+`-`+wi(s),a.atomMeta.has(c)&&console.warn(`[nuclo] css() name ${JSON.stringify(c)} is already used by a different style. Both rules are emitted under the same class, so they will override each other — rename one.`));let l=``;for(let[e,t]of n)l+=(l?`;`:``)+e+`:`+t;return a.atomCache.set(s,c),a.atomMeta.set(c,{query:e,suffix:t,decls:n,name:r}),Ci(Di(c,t)+`{`+l+`}`,e),c}function Ai(e,t){let n=Y(),r=n.atomMeta.get(e),i=n.atomMeta.get(t);if(!r||!i)return t;let a=[...r.decls,...i.decls],o=/* @__PURE__ */ new Map;for(let e=0;e<a.length;e++)o.set(a[e][0],e);let s=a.filter((e,t)=>o.get(e[0])===t);return ki(r.query,r.suffix,s,r.name??i.name)}function ji(e){let t=Y().atomMeta.get(e);return t===void 0?void 0:Q(t.query,t.suffix)}function Mi(){return(fi??di[ui])?.styleEpoch??0}function Ni(e,t){let n=Y();n.rawKeys.has(e)?Z():(n.rawKeys.add(e),Ci(t,void 0))}function Pi(e){let t=0;for(;t<e.length;t++){let n=e.charCodeAt(t);if(n>=65&&n<=90)break}if(t===e.length)return e;let n=e.slice(0,t);for(let r=t;r<e.length;r++){let t=e.charCodeAt(r);n+=t>=65&&t<=90?`-`+String.fromCharCode(t+32):e[r]}return n}const Fi={hover:`:hover`,focus:`:focus`,focusVisible:`:focus-visible`,focusWithin:`:focus-within`,active:`:active`,visited:`:visited`,disabled:`:disabled`,enabled:`:enabled`,checked:`:checked`,required:`:required`,invalid:`:invalid`,valid:`:valid`,readOnly:`:read-only`,first:`:first-child`,last:`:last-child`,only:`:only-child`,odd:`:nth-child(odd)`,even:`:nth-child(even)`,empty:`:empty`,placeholderShown:`:placeholder-shown`,placeholder:`::placeholder`,before:`::before`,after:`::after`,selection:`::selection`,marker:`::marker`,firstLine:`::first-line`,firstLetter:`::first-letter`},Ii={bg:[`background`],p:[`padding`],px:[`padding-left`,`padding-right`],py:[`padding-top`,`padding-bottom`],pt:[`padding-top`],pr:[`padding-right`],pb:[`padding-bottom`],pl:[`padding-left`],m:[`margin`],mx:[`margin-left`,`margin-right`],my:[`margin-top`,`margin-bottom`],mt:[`margin-top`],mr:[`margin-right`],mb:[`margin-bottom`],ml:[`margin-left`],w:[`width`],h:[`height`],minW:[`min-width`],maxW:[`max-width`],minH:[`min-height`],maxH:[`max-height`],size:[`width`,`height`],text:[`font-size`],font:[`font-family`],weight:[`font-weight`],leading:[`line-height`],tracking:[`letter-spacing`],align:[`text-align`],items:[`align-items`],justify:[`justify-content`],z:[`z-index`],rounded:[`border-radius`],shadow:[`box-shadow`],select:[`user-select`]},Li={row:{display:`flex`,"flex-direction":`row`},col:{display:`flex`,"flex-direction":`column`},center:{"align-items":`center`,"justify-content":`center`},truncate:{overflow:`hidden`,"text-overflow":`ellipsis`,"white-space":`nowrap`}},Ri={background:`colors`,"background-color":`colors`,color:`colors`,"border-color":`colors`,"border-top-color":`colors`,"border-right-color":`colors`,"border-bottom-color":`colors`,"border-left-color":`colors`,"outline-color":`colors`,"caret-color":`colors`,"text-decoration-color":`colors`,"font-family":`fonts`,"box-shadow":`shadows`,"border-radius":`radii`},zi=/* @__PURE__ */ new Set([`z-index`,`opacity`,`font-weight`,`line-height`,`flex`,`flex-grow`,`flex-shrink`,`order`,`aspect-ratio`,`zoom`,`scale`,`column-count`,`orphans`,`widows`,`tab-size`,`animation-iteration-count`,`grid-column`,`grid-row`]),Bi=/* @__PURE__ */ new Map;function Vi(e){if(!/[A-Z]/.test(e))return e;let t=Bi.get(e);return t===void 0&&(t=Pi(e),Bi.size>=512&&Bi.clear(),Bi.set(e,t)),t}function Hi(e){return e.charCodeAt(0)===64?e:`@media `+e}function Ui(e){return e.charCodeAt(0)===40}function Wi(e){if(!e.startsWith(`not`))return!1;let t=e.charCodeAt(3);return Number.isNaN(t)||t===32||t===40}function Gi(e,t){if(e!==void 0&&e.startsWith(`@media`)&&t.startsWith(`@media`)){let n=e.slice(6).trim(),r=t.slice(6).trim();if(!Wi(n)&&!Wi(r)){if(Ui(r))return`@media `+n+` and `+r;if(Ui(n))return`@media `+r+` and `+n}return console.warn(`[nuclo] cannot combine nested media queries ${JSON.stringify(e)} and ${JSON.stringify(t)}; using the inner query alone. Author one query that states both conditions.`),t}return t}function Ki(e,t){for(let n in t){let r=t[n],i=e[n];e[n]=typeof r==`object`&&r&&!Array.isArray(r)&&typeof i==`object`&&i&&!Array.isArray(i)?Ki({...i},r):r}return e}var qi=class{className;constructor(e){this.className=e}toString(){return this.className}};function $(e){return new qi(e)}function Ji(e,t){let n=ji(t);if(n===void 0){e.set(t,t);return}let r=e.get(n);r===void 0||r===t?e.set(n,t):e.set(n,Ai(r,t))}function Yi(e,t){let n=0;for(let r=0;r<=e.length;r++){let i=r===e.length?32:e.charCodeAt(r);(i===32||i===9||i===10||i===12||i===13)&&(r>n&&Ji(t,e.slice(n,r)),n=r+1)}}function Xi(e,t){for(let n of e)n&&(typeof n==`string`?Yi(n,t):Array.isArray(n)?Xi(n,t):Yi(n.className,t))}function Zi(e){let t=/* @__PURE__ */ new Map;Xi(e,t);let n=``;for(let e of t.values())n+=(n?` `:``)+e;return n}const Qi=/* @__PURE__ */ new WeakMap;function $i(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function ea(...e){if(e.length===0)return $(``);if(e.length===1){let t=e[0];if(!t)return $(``);if(!Array.isArray(t)){let e=typeof t==`string`?t:t.className;if(!/[\t\n\f\r ]/.test(e))return $(e)}}if(e.length===2&&$i(e[0])&&$i(e[1])){let t=e[0],n=e[1],r=Mi(),i=Qi.get(t),a=i?.get(n);if(a!==void 0&&a.epoch===r&&a.first===e[0].className&&a.second===e[1].className)return Z(),a.result;let o=$(Zi(e)),s=i??/* @__PURE__ */ new WeakMap;return s.set(n,{epoch:r,first:e[0].className,second:e[1].className,result:o}),i||Qi.set(t,s),o}return $(Zi(e))}const ta=Q(void 0,``);function na(e={}){let t=e.screens??{};pi(Object.values(t).map(Hi));let n=/* @__PURE__ */ new WeakMap;function r(t,n){if(typeof n==`number`)return n===0||zi.has(t)?String(n):n+`px`;let r=Ri[t];if(r!==void 0){let t=e[r]?.[n];if(t!==void 0)return t}return n}function i(e,t,n){let r=Q(t,n),i=e.get(r);return i||(i={query:t,suffix:n,decls:[]},e.set(r,i)),i}function a(e,n,o,s){for(let c in e){let l=e[c];if(l==null||l===!1)continue;if(typeof l==`object`){if(c===`raw`){let e=l,t=i(s,n,o).decls;for(let n in e)t.push([n,r(n,e[n])]);continue}let e=Fi[c];if(e!==void 0){a(l,n,o+e,s);continue}let u=t[c];if(u!==void 0){a(l,Gi(n,Hi(u)),o,s);continue}let d=c.charCodeAt(0);if(d===38){a(l,n,Ei(c,`&`+o).slice(1),s);continue}if(d===64){a(l,Gi(n,c),o,s);continue}continue}if(l===!0){let e=Li[c];if(e){let t=i(s,n,o).decls;for(let n in e)t.push([n,e[n]])}continue}let u=Ii[c];if(u!==void 0){let e=i(s,n,o).decls;for(let t of u)e.push([t,r(t,l)])}else{let e=Vi(c);i(s,n,o).decls.push([e,r(e,l)])}}}function o(e,t){let r=typeof e==`string`,i=r?t:e,o=r?e:void 0;if(i==null)return $(``);let s=Mi(),c=n.get(i);if(c!==void 0&&c.epoch===s&&c.name===o)return Z(),c.result;let l=/* @__PURE__ */ new Map;a(i,void 0,``,l);let u=[];for(let e of l.values()){if(e.decls.length===0)continue;let t=e.query===void 0&&e.suffix===``;u.push(ki(e.query,e.suffix,e.decls,o,t))}let d=$(u.join(` `));return n.set(i,{epoch:s,name:o,result:d}),d}function s(e){let t=/* @__PURE__ */ new Map;a(e,void 0,``,t);let n=``;for(let[e,r]of t.get(ta)?.decls??[])n+=(n?`;`:``)+e+`:`+r;return n}function c(e){let t=``;for(let n in e)t+=n+`{`+s(e[n])+`}`;let n=`nk`+wi(t);return Ni(n,`@keyframes `+n+`{`+t+`}`),n}function l(e,t){let n=e+`{`+s(t)+`}`;Ni(`g|`+n,n)}function u(e){let t=e=>e===!0?`true`:e===!1?`false`:String(e),n=e.variants??{},r=Object.keys(n),i=e.defaultVariants??{},a=e.base??null,s=(e.compoundVariants??[]).map(e=>{let{css:n,...r}=e,i={};for(let e in r)i[e]=t(r[e]);return{conditions:i,style:n}}),c=/* @__PURE__ */ new Map,l=Mi();return function(e){let u=Mi();l!==u&&(c.clear(),l=u);let d={};for(let n of r){let r=(e?e[n]:void 0)??i[n];r!=null&&(d[n]=t(r))}let f=``;for(let e of r){let t=d[e];f+=e.length+`:`+e,f+=t===void 0?`-`:`+`+t.length+`:`+t}let p=c.get(f);if(p)return Z(),p;let m={};a&&(m=Ki(m,a));for(let e of r){let t=d[e];if(t!==void 0){let r=n[e][t];r&&(m=Ki(m,r))}}for(let e of s){let t=!0;for(let n in e.conditions)if(d[n]!==e.conditions[n]){t=!1;break}t&&(m=Ki(m,e.style))}let h=o(m);return c.set(f,h),h}}return{css:o,cx:ea,variants:u,keyframes:c,globalStyle:l,theme:e}}let ra;function ia(){return ra??=na({})}const aa=(e,t)=>typeof e==`string`?ia().css(e,t):ia().css(e),oa=e=>ia().variants(e),sa=e=>ia().keyframes(e),ca=(e,t)=>ia().globalStyle(e,t),la=/* @__PURE__ */ `a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.menu.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.script.search.section.select.slot.small.source.span.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`),ua=/* @__PURE__ */ `a.animate.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialGradient.rect.script.set.stop.style.svg.switch.symbol.text.textPath.title.tspan.use.view`.split(`.`);function da(e,t,n,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let i=r(n);return Object.defineProperty(e,t,{value:i,configurable:!0,enumerable:!0,writable:!0}),i},set(n){Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!0,writable:!0})}})}function fa(e,t){t in e&&typeof e[t]!=`function`||(da(e,t,t,Fn),t===`var`&&da(e,`var_`,t,Fn))}function pa(e,t){let n=`${t}Svg`;n in e||da(e,n,t,In)}function ma(e=globalThis){let t=`__nuclo_tags_registered`;if(!e[t]){for(let t=0;t<ua.length;t++)pa(e,ua[t]);for(let t=0;t<la.length;t++)fa(e,la[t]);e[t]=!0}}function ha(){ma();let e=globalThis;e.list=Yr,e.update=Jr,e.when=Kr,e.region=$r,e.into=ti,e.on=bt,e.scope=de,e.render=ai,e.hydrate=oi,e.forceUpdate=si,e.createCss=na,e.css=aa,e.cx=ea,e.variants=oa,e.keyframes=sa,e.globalStyle=ca}ha(),exports.createCss=na,exports.css=aa,exports.cx=ea,exports.forceUpdate=si,exports.getCssText=function(){let e=Y();if(e.cssTextCache!==null)return e.cssTextCache;let t=e.baseRules.join(``);for(let[n,r]of e.queryRules)r.length>0&&(t+=n+`{`+r.join(``)+`}`);return e.cssTextCache=t,t},exports.globalStyle=ca,exports.hydrate=oi,exports.into=ti,exports.keyframes=sa,exports.list=Yr,exports.on=bt,exports.region=$r,exports.render=ai,exports.resetStyles=function(){let e=Y();e.atomCache.clear(),e.atomMeta.clear(),e.rawKeys.clear(),e.baseRules.length=0,e.queryRules.clear(),e.groupRules.clear(),e.cssTextCache=null,e.baseRuleCount=0,e.sheet=null,e.sheetDocument=null,e.externalRules=null,e.hasExternalGroups=!1,e.styleEpoch++,typeof document<`u`&&document.getElementById(`nuclo-styles`)?.remove()},exports.scope=de,exports.update=Jr,exports.variants=oa,exports.when=Kr;
|
|
2
2
|
//# sourceMappingURL=nuclo.cjs.map
|