@stacksjs/stx 0.2.861 → 0.2.863
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/analytics.js +3 -2
- package/dist/animation.js +3 -3
- package/dist/app-shell.js +4 -3
- package/dist/{chunk-14cvwsy1.js → chunk-01c16zw4.js} +2 -2
- package/dist/chunk-021tjkd6.js +3 -0
- package/dist/chunk-0bfgsv31.js +2 -0
- package/dist/chunk-0twkeh31.js +2 -0
- package/dist/chunk-0xtda6aw.js +2 -0
- package/dist/chunk-15m7jnc0.js +33 -0
- package/dist/{chunk-7bajrfb1.js → chunk-1grdbpsk.js} +8 -8
- package/dist/{chunk-9syvkm5z.js → chunk-1mqcttg3.js} +6 -6
- package/dist/chunk-2asyyky3.js +2 -0
- package/dist/{chunk-eye156nv.js → chunk-2c18y094.js} +1 -1
- package/dist/chunk-2n932qtv.js +20 -0
- package/dist/{chunk-76360zky.js → chunk-32ty2zx6.js} +9 -9
- package/dist/chunk-36j129p1.js +2 -0
- package/dist/chunk-3gk1e2b1.js +2 -0
- package/dist/chunk-3ryp43f3.js +2 -0
- package/dist/{chunk-12r22pf0.js → chunk-3z1mmar2.js} +2 -2
- package/dist/{chunk-zhxdpzga.js → chunk-46ddesnf.js} +3 -3
- package/dist/chunk-46pxmpeb.js +3 -0
- package/dist/chunk-4pr29yrx.js +2 -0
- package/dist/{chunk-tjz3r7rj.js → chunk-55zq2ha8.js} +5 -5
- package/dist/{chunk-avp271q4.js → chunk-58sh82aj.js} +2 -2
- package/dist/{chunk-gggadrs4.js → chunk-5a0d3048.js} +3 -3
- package/dist/{chunk-121cgm3s.js → chunk-5p1k2h5q.js} +8 -8
- package/dist/chunk-5s1fb8z4.js +4 -0
- package/dist/{chunk-x69457q9.js → chunk-5zzrrxns.js} +8 -8
- package/dist/chunk-64ebysb4.js +2 -0
- package/dist/{chunk-4rrxrxp6.js → chunk-669b2bya.js} +4 -4
- package/dist/{chunk-38qp2pg2.js → chunk-67dgp45w.js} +2 -2
- package/dist/{chunk-5xdkmn39.js → chunk-6ftee542.js} +2 -2
- package/dist/{chunk-5wr1qqz3.js → chunk-6k4ac74t.js} +2 -2
- package/dist/{chunk-c2w4wc9f.js → chunk-6m6y9bbx.js} +1 -1
- package/dist/chunk-6pczzq5f.js +2 -0
- package/dist/{chunk-6tp0w6hf.js → chunk-7ayvybdy.js} +3 -3
- package/dist/chunk-7mjf144y.js +2 -0
- package/dist/chunk-7wqevtks.js +2 -0
- package/dist/{chunk-bag9q4m0.js → chunk-8502xb4n.js} +39 -39
- package/dist/chunk-85zmxbt0.js +33 -0
- package/dist/{chunk-cxpq2zna.js → chunk-8arfg8kp.js} +3 -3
- package/dist/{chunk-xmy6g81m.js → chunk-8hhhmscy.js} +2 -2
- package/dist/{chunk-fyfvqd2s.js → chunk-8me8hamk.js} +2 -2
- package/dist/{chunk-pb09xy77.js → chunk-8s6s6nd0.js} +2 -2
- package/dist/chunk-8v1zpdef.js +2 -0
- package/dist/chunk-94mpe1ny.js +3 -0
- package/dist/{chunk-mzes9ds7.js → chunk-9zrvh3pz.js} +2 -2
- package/dist/chunk-a4cn8rf4.js +2 -0
- package/dist/{chunk-fpkp0bqf.js → chunk-adqh1gp1.js} +1 -1
- package/dist/chunk-ap84eenm.js +2 -0
- package/dist/chunk-as2ffje6.js +2 -0
- package/dist/chunk-az5xw3w8.js +2 -0
- package/dist/chunk-b6w0f610.js +712 -0
- package/dist/chunk-ba91r7q9.js +2 -0
- package/dist/{chunk-qkcn0exq.js → chunk-brzjass3.js} +6 -6
- package/dist/chunk-bwdbj60y.js +3 -0
- package/dist/{chunk-3wg9kr5z.js → chunk-bx5d87xx.js} +6 -7
- package/dist/chunk-c0t2tdfk.js +2 -0
- package/dist/chunk-caxqwrnc.js +2 -0
- package/dist/{chunk-37tefp7s.js → chunk-cqhwzd9y.js} +5 -5
- package/dist/chunk-cvgbtmxp.js +2 -0
- package/dist/chunk-czca8yds.js +42 -0
- package/dist/chunk-d0afg5f7.js +2 -0
- package/dist/chunk-d9vzfbdp.js +2 -0
- package/dist/{chunk-65cbfx5x.js → chunk-dpmayc2w.js} +2 -2
- package/dist/{chunk-d6216bcw.js → chunk-dtarm8x9.js} +9 -9
- package/dist/chunk-e634vffz.js +3 -0
- package/dist/chunk-eafqxbr0.js +2 -0
- package/dist/{chunk-qjm23ma2.js → chunk-ew5cey88.js} +1 -1
- package/dist/{chunk-xppm4cs4.js → chunk-farh4p7f.js} +3 -3
- package/dist/chunk-fnv94wc6.js +2 -0
- package/dist/chunk-g4gcf4jn.js +2 -0
- package/dist/chunk-g65dptx2.js +2 -0
- package/dist/{chunk-q6w7a1vc.js → chunk-gbtbfg7e.js} +3 -3
- package/dist/{chunk-15jymk6t.js → chunk-gd56arnm.js} +2 -2
- package/dist/{chunk-5ka3h8dy.js → chunk-gjngg182.js} +45 -46
- package/dist/{chunk-8hck9qqm.js → chunk-gp8hgpt9.js} +4 -4
- package/dist/chunk-gw7t6a3t.js +2 -0
- package/dist/chunk-h2qgqjkn.js +2 -0
- package/dist/chunk-h65shwe9.js +2 -0
- package/dist/{chunk-zpkgs5d3.js → chunk-h816ta81.js} +6 -6
- package/dist/chunk-hc6111md.js +54 -0
- package/dist/{chunk-cq2hedwn.js → chunk-hev4t4d5.js} +6 -6
- package/dist/{chunk-7yhhwv07.js → chunk-hmdkf6c6.js} +2 -2
- package/dist/{chunk-vggtxttf.js → chunk-j1efsjsb.js} +5 -5
- package/dist/chunk-j4zrq17p.js +2 -0
- package/dist/chunk-jfmj0wsy.js +2 -0
- package/dist/{chunk-bg0ywp5w.js → chunk-jgra00m8.js} +2 -2
- package/dist/{chunk-5rxks14t.js → chunk-k32q90b2.js} +2 -2
- package/dist/{chunk-naj146zq.js → chunk-k7dxm48r.js} +2 -2
- package/dist/chunk-ks5p5w6z.js +25 -0
- package/dist/chunk-kw11yydy.js +2 -0
- package/dist/chunk-m9cperj4.js +2 -0
- package/dist/{chunk-zs4s9fcq.js → chunk-mcnwvh06.js} +6 -6
- package/dist/chunk-meqsd5bt.js +2 -0
- package/dist/{chunk-dba4bwkd.js → chunk-mfa07erx.js} +16 -16
- package/dist/{chunk-jh2v1vvb.js → chunk-mrh08821.js} +3 -3
- package/dist/{chunk-9n8t7v78.js → chunk-n3jw3xpj.js} +2 -2
- package/dist/chunk-ns04v3am.js +2 -0
- package/dist/chunk-ntbe5q5x.js +16 -0
- package/dist/chunk-nttsc0aw.js +14 -0
- package/dist/chunk-p0tkhd12.js +2 -0
- package/dist/chunk-p2etn78y.js +2 -0
- package/dist/{chunk-1nankvf6.js → chunk-pbakxcv8.js} +2 -2
- package/dist/{chunk-h4aqpf2r.js → chunk-prrvggcy.js} +5 -5
- package/dist/chunk-pyckafsb.js +12 -0
- package/dist/{chunk-t5q31st4.js → chunk-q1wxgw5s.js} +2 -2
- package/dist/chunk-qa5y30sy.js +72 -0
- package/dist/{chunk-m3p4hksq.js → chunk-qbghf76y.js} +4 -4
- package/dist/{chunk-a6d92kv6.js → chunk-qcxrcypb.js} +2 -2
- package/dist/{chunk-1jwcp2k0.js → chunk-qjey0jk6.js} +2 -2
- package/dist/chunk-qmkaqjba.js +2 -0
- package/dist/chunk-qxw9h564.js +2 -0
- package/dist/chunk-r23zq8yk.js +2 -0
- package/dist/{chunk-68w65mhs.js → chunk-r4v4vswq.js} +3 -3
- package/dist/chunk-reeaknf2.js +2 -0
- package/dist/chunk-rqa92xm4.js +2 -0
- package/dist/chunk-rqmb09ss.js +2 -0
- package/dist/chunk-s92j8k4z.js +2 -0
- package/dist/chunk-s9df8srx.js +6 -0
- package/dist/{chunk-dt73ww6m.js → chunk-sb8n32rn.js} +1 -1
- package/dist/{chunk-5neezkj1.js → chunk-sj3ry5ck.js} +33 -25
- package/dist/chunk-snz2cxqv.js +2 -0
- package/dist/{chunk-36vksrry.js → chunk-srgnevws.js} +2 -2
- package/dist/chunk-sz6d3v6b.js +2 -0
- package/dist/{chunk-9pyvc0dc.js → chunk-tnp2ta5q.js} +2 -2
- package/dist/{chunk-gx96hctv.js → chunk-v37zmez0.js} +2 -2
- package/dist/chunk-v408qsze.js +2 -0
- package/dist/{chunk-thdnk1kd.js → chunk-v4xes880.js} +3 -3
- package/dist/chunk-va07zs9v.js +2 -0
- package/dist/chunk-vc42mvjn.js +2 -0
- package/dist/chunk-vk98r75z.js +2 -0
- package/dist/{chunk-yj9nyt93.js → chunk-vvzys1x7.js} +3 -3
- package/dist/chunk-vwwpbhd2.js +3 -0
- package/dist/{chunk-hyea17hp.js → chunk-w468n41y.js} +155 -157
- package/dist/{chunk-f1vvhbmw.js → chunk-w6pzkcjp.js} +2 -2
- package/dist/{chunk-15rkvc0t.js → chunk-wk4wg6sn.js} +5 -5
- package/dist/chunk-wtfamngc.js +20 -0
- package/dist/chunk-x3p4emdp.js +2 -0
- package/dist/{chunk-3gfd9t8a.js → chunk-x512h2gv.js} +4 -4
- package/dist/{chunk-nwxjh1gv.js → chunk-x7redxyd.js} +4 -4
- package/dist/chunk-xcjvx6zt.js +2 -0
- package/dist/chunk-xfd3yqgj.js +1327 -0
- package/dist/chunk-xjxcwrqs.js +2 -0
- package/dist/chunk-xymr4ys9.js +3 -0
- package/dist/chunk-xzdkjkyp.js +2 -0
- package/dist/{chunk-b1tctqn5.js → chunk-y036cwc7.js} +10 -10
- package/dist/chunk-y190sh29.js +16 -0
- package/dist/{chunk-wrbhq1y2.js → chunk-yakdcak2.js} +3 -3
- package/dist/chunk-ybkwnscv.js +2 -0
- package/dist/{chunk-6nb49h13.js → chunk-yhc1c4tr.js} +125 -126
- package/dist/chunk-ymdw4fhd.js +3 -0
- package/dist/chunk-ynkbv9jq.js +4 -0
- package/dist/chunk-yr1zx78b.js +3 -0
- package/dist/{chunk-e8nzbz66.js → chunk-ysfeg3cn.js} +2 -2
- package/dist/chunk-ytzzth34.js +2 -0
- package/dist/chunk-yxpjj003.js +2 -0
- package/dist/chunk-z1rs6b4x.js +2 -0
- package/dist/chunk-z383x16t.js +2 -0
- package/dist/chunk-z3gz5fy4.js +2 -0
- package/dist/{chunk-tm201m9x.js → chunk-z512gt4v.js} +3 -3
- package/dist/{chunk-5n7m8vqx.js → chunk-zbvfjm4a.js} +2 -2
- package/dist/chunk-zr22gtpf.js +2 -0
- package/dist/chunk-zsnmk5me.js +2 -0
- package/dist/chunk-ztbexx3h.js +2 -0
- package/dist/cli.js +35 -35
- package/dist/client/signals-timer-runtime.js +12 -4
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/dev-server/serve-app.js +3 -2
- package/dist/dev-server/serve-multi.js +3 -4
- package/dist/dev-server/ts-css.js +4 -5
- package/dist/document-shell.js +4 -3
- package/dist/document-tags.d.ts +8 -0
- package/dist/document-tags.js +37 -0
- package/dist/events.js +2 -1
- package/dist/head-injection.js +2 -1
- package/dist/heatmap.js +2 -1
- package/dist/hot-reload.js +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/native-build.js +3 -3
- package/dist/process.js +5 -6
- package/dist/production-build.js +3 -3
- package/dist/pwa/inject.js +3 -3
- package/dist/pwa.js +3 -3
- package/dist/reactive-bindings.js +2 -1
- package/dist/reactive.js +2 -1
- package/dist/render.js +1 -1
- package/dist/runtime-injection.js +6 -6
- package/dist/serve.js +1 -1
- package/dist/site-builder/build.js +1 -1
- package/dist/site-builder/i18n.js +2 -2
- package/dist/site-builder/router.js +1 -1
- package/dist/site-builder/theme.js +1 -1
- package/dist/ssg.js +30 -31
- package/dist/template-hydrator.js +2 -1
- package/dist/web-components/css-scoping.js +3 -3
- package/dist/x-element.js +2 -1
- package/package.json +5 -5
- package/dist/body-close.d.ts +0 -13
- package/dist/body-close.js +0 -8
- package/dist/chunk-02css3vk.js +0 -14
- package/dist/chunk-0hqr6bff.js +0 -2
- package/dist/chunk-15sgdvyd.js +0 -2
- package/dist/chunk-261t62q4.js +0 -712
- package/dist/chunk-2b4a8tbd.js +0 -3
- package/dist/chunk-2fw36w1x.js +0 -2
- package/dist/chunk-2jcxsw75.js +0 -2
- package/dist/chunk-2pbhdaka.js +0 -2
- package/dist/chunk-2wba5ypm.js +0 -2
- package/dist/chunk-353gnvfe.js +0 -2
- package/dist/chunk-3cr5y8v1.js +0 -2
- package/dist/chunk-3y7yp0ka.js +0 -2
- package/dist/chunk-41wwqw0q.js +0 -2
- package/dist/chunk-4a1y51fs.js +0 -2
- package/dist/chunk-4a751brg.js +0 -2
- package/dist/chunk-4jgcd4d9.js +0 -33
- package/dist/chunk-5awhm4na.js +0 -2
- package/dist/chunk-5fhp9hxd.js +0 -2
- package/dist/chunk-5mg443dw.js +0 -2
- package/dist/chunk-5q4tncfw.js +0 -18
- package/dist/chunk-5x9ajbq0.js +0 -2
- package/dist/chunk-6g7tkmty.js +0 -2
- package/dist/chunk-72bj7ea4.js +0 -2
- package/dist/chunk-74g64pzt.js +0 -20
- package/dist/chunk-7de5y29a.js +0 -54
- package/dist/chunk-7ycmnsh5.js +0 -2
- package/dist/chunk-811hh6vp.js +0 -2
- package/dist/chunk-830ej8d2.js +0 -72
- package/dist/chunk-8fkmxrat.js +0 -2
- package/dist/chunk-8p9npc8y.js +0 -2
- package/dist/chunk-9fz3h6sx.js +0 -2
- package/dist/chunk-9jr30fns.js +0 -2
- package/dist/chunk-9xr628ew.js +0 -3
- package/dist/chunk-a9m6ajd7.js +0 -2
- package/dist/chunk-aj6vqdf7.js +0 -25
- package/dist/chunk-asr5v51s.js +0 -2
- package/dist/chunk-b7nmgkwa.js +0 -42
- package/dist/chunk-bv14vry8.js +0 -3
- package/dist/chunk-byx82s10.js +0 -2
- package/dist/chunk-c9y1g61m.js +0 -2
- package/dist/chunk-ck5nzbbv.js +0 -2
- package/dist/chunk-cvdm0hgq.js +0 -2
- package/dist/chunk-e0fxgbcc.js +0 -2
- package/dist/chunk-ed2m6pjf.js +0 -2
- package/dist/chunk-ednwdhv0.js +0 -2
- package/dist/chunk-egtphftq.js +0 -2
- package/dist/chunk-f18rxz70.js +0 -2
- package/dist/chunk-fahqq7c4.js +0 -2
- package/dist/chunk-fcbpzdyz.js +0 -2
- package/dist/chunk-gc79s0wh.js +0 -20
- package/dist/chunk-gjnrmz2q.js +0 -4
- package/dist/chunk-gp1dt8b8.js +0 -33
- package/dist/chunk-h0dsxxz4.js +0 -2
- package/dist/chunk-h2cvfp9y.js +0 -2
- package/dist/chunk-jhm1228j.js +0 -4
- package/dist/chunk-k3yym9zg.js +0 -2
- package/dist/chunk-k9fsd6t3.js +0 -2
- package/dist/chunk-kepxsjfx.js +0 -2
- package/dist/chunk-kgrvvtcy.js +0 -3
- package/dist/chunk-kh01rvag.js +0 -2
- package/dist/chunk-kv40xq53.js +0 -1329
- package/dist/chunk-mad172af.js +0 -2
- package/dist/chunk-mjkdskeg.js +0 -12
- package/dist/chunk-npt0mdzb.js +0 -2
- package/dist/chunk-p95fsnbk.js +0 -2
- package/dist/chunk-ptc3yqn3.js +0 -2
- package/dist/chunk-pybm7c9p.js +0 -2
- package/dist/chunk-q87hkwfg.js +0 -3
- package/dist/chunk-qe6631me.js +0 -2
- package/dist/chunk-qnx71b17.js +0 -2
- package/dist/chunk-qx8cav4w.js +0 -2
- package/dist/chunk-rb7cwck6.js +0 -2
- package/dist/chunk-s1e0t3hv.js +0 -2
- package/dist/chunk-s7vfmasx.js +0 -2
- package/dist/chunk-scwbttvt.js +0 -3
- package/dist/chunk-shy2hkvj.js +0 -2
- package/dist/chunk-sxtvy0sm.js +0 -3
- package/dist/chunk-t7z67vf6.js +0 -2
- package/dist/chunk-tarvase5.js +0 -2
- package/dist/chunk-tqs9pcga.js +0 -2
- package/dist/chunk-twjfrywv.js +0 -2
- package/dist/chunk-v0wdgxga.js +0 -3
- package/dist/chunk-vyna2rsq.js +0 -2
- package/dist/chunk-w4gjx2zs.js +0 -18
- package/dist/chunk-xhe7pw6e.js +0 -2
- package/dist/chunk-y86mpnrg.js +0 -2
- package/dist/chunk-z99bf0q0.js +0 -3
- package/dist/chunk-zm0g7ntw.js +0 -2
- package/dist/chunk-zrm2x65c.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{r}from"./chunk-
|
|
2
|
+
import{r}from"./chunk-x7redxyd.js";function y(e,n,i=240){return e.slice(n,n+i)}var v=[{rule:"route-params",pattern:/\blocation\s*\.\s*pathname\s*\.\s*(?:match|split)\s*\(/g,primitive:"useRoute() / useRouteParams() / useRouteParam(name)",why:"parsing the URL by hand re-implements the router and does not update on SPA navigation"},{rule:"alert",pattern:/(?<![.#\w$])(?:(?:window|globalThis)\s*\.\s*)?alert\s*\(/g,primitive:"stxAlert(message)",why:"themed, focus-trapped and non-blocking \u2014 but `await` it if the code after it "+"depended on the native dialog blocking until dismissal",reject:(e)=>/\b(?:async\s+)?function\s+alert\s*\(/.test(e)||/\b(?:const|let|var)\s+alert\s*=/.test(e)},{rule:"search-params",pattern:/new\s+URLSearchParams\s*\(/g,primitive:"useSearchParams()",why:"reactive, and writes back through the router instead of history.replaceState",reject:(e,n)=>{let i=e.indexOf("(",n);if(i===-1)return!0;let o=e.slice(i+1,e.indexOf(")",i)+1);return!/\b(?:location|search|href|url)\b/i.test(o)}},{rule:"navigate",pattern:/\blocation\s*\.\s*(?:assign|replace)\s*\(|\blocation\s*\.\s*href\s*=/g,primitive:"navigate(path) / goBack()",why:"a full document load throws away every store and the scroll position; navigate() is an SPA transition",reject:(e,n)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(y(e,n,160))},{rule:"fetch",pattern:/new\s+AbortController\s*\(/g,primitive:"useFetch(url) / useAsyncData(key, fn)",why:"cancellation, loading and error state are already wired; hand-rolling them is where the races live"},{rule:"polling",pattern:/setInterval\s*\(/g,primitive:"useEventSource() / useSSE() / useWebSocket() / useChannel()",why:"polling burns requests and lags; the push primitives are delivered",reject:(e,n)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(y(e,n))},{rule:"debounce",pattern:/\bclearTimeout\s*\(/g,primitive:"useDebounce(fn, ms) / useThrottle(fn, ms)",why:"a hand-held timer handle per call site is the usual source of stale-result bugs",requires:(e)=>/setTimeout\s*\(/.test(e)},{rule:"click-outside",pattern:/document\s*\.\s*addEventListener\s*\(\s*['"](?:click|mousedown|pointerdown)['"]/g,primitive:"useClickOutside(ref, fn)",why:"the document-level listener plus the blur race is exactly what this composable exists to remove"},{rule:"focus",pattern:/\.\s*(?:getElementById|querySelector)\s*\([^)]*\)\s*(?:\?\.)?\s*\.?focus\s*\(/g,primitive:"useFocus(ref) with x-ref",why:"a query by id breaks under nested scopes and SPA navigation; a ref does not"},{rule:"clipboard",pattern:/navigator\s*\.\s*(?:clipboard|share)\b/g,primitive:"useClipboard() / useShare()",why:"permission state, the copied flag and the unsupported-browser fallback are already handled"},{rule:"watch",pattern:/\beffect\s*\(\s*\(\s*\)\s*=>\s*\{[^}]*\bvoid\s+\w+\s*\(\s*\)/g,primitive:"watch(source, cb) / watchMultiple([...], cb)",why:"the `void a(); void b()` dance is a manual dependency list; watch takes one directly"}],C=["confirm","tooltip",...v.map((e)=>e.rule)];function g(e,n){let i=1;for(let o=0;o<n;o++)if(e[o]===`
|
|
3
3
|
`)i++;return i}function b(e,n){let i=e.lastIndexOf(`
|
|
4
4
|
`,n)+1,o=e.indexOf(`
|
|
5
5
|
`,n);return e.slice(i,o===-1?e.length:o).trim().slice(0,120)}function S(e,n){let i=e.slice(0,n),o=i.lastIndexOf("function"),l=i.lastIndexOf("=>"),s=Math.max(o,l);if(s===-1)return!1;let t=e.slice(Math.max(0,s-120),s);return/\basync\b[^;{}]*$/.test(t)}function k(e){return/\b(?:async\s+)?function\s+confirm\s*\(/.test(e)||/\b(?:const|let|var)\s+confirm\s*=/.test(e)||/\bimport\s*\{[^}]*\bconfirm\b[^}]*\}/.test(e)}function A(e,n,i){if(k(e))return e;let o=/(^|[^\w$.])(?:(?:window|globalThis)\s*\.\s*)?confirm\s*\(/g,l=m(e),s="",t=0,a;while((a=o.exec(l))!==null){let c=a.index+a[1].length,u=g(e,c),d=b(e,c);if(/stxConfirm\s*\($/.test(e.slice(0,c+8)))continue;let p=S(e,c);if(i.push({file:n,line:u,rule:"confirm",applied:p,snippet:d,reason:p?void 0:"stxConfirm() returns a Promise and native confirm() is synchronous, so this needs `await` inside an async function. Rewriting it here would make the condition always true."}),p)s+=e.slice(t,c)+"await stxConfirm(",t=c+(a[0].length-a[1].length)}return s+e.slice(t)}function E(e,n,i){let o=/(<[a-z][\w-]*\b[^>]*?)\stitle=(["'])(.*?)\2/gis,l=R(e),s="",t=0,a;while((a=o.exec(l))!==null){let[c,u,d,p]=a,h=g(e,a.index),f=b(e,a.index),w=u.match(/^<([A-Za-z][\w-]*)/)?.[1]??"";if(/^[A-Z]/.test(w)){i.push({file:n,line:h,rule:"tooltip",applied:!1,snippet:f,reason:`\`title\` on <${w}> is a component prop, not an HTML attribute \u2014 `+"adding x-tooltip here would put a tooltip on a component and may duplicate text it already renders."});continue}if(/\bx-tooltip[=\s]/.test(u)||p.trim()===""){i.push({file:n,line:h,rule:"tooltip",applied:!1,snippet:f,reason:/\bx-tooltip[=\s]/.test(u)?"already has x-tooltip":"empty title"});continue}i.push({file:n,line:h,rule:"tooltip",applied:!0,snippet:f}),s+=e.slice(t,a.index)+`${u} x-tooltip=${d}${p}${d} title=${d}${p}${d}`,t=a.index+c.length}return s+e.slice(t)}function R(e){return e.replace(/<!--[\s\S]*?-->/g,(n)=>n.replace(/[^\n]/g," ")).replace(/\{\{--[\s\S]*?--\}\}/g,(n)=>n.replace(/[^\n]/g," "))}function F(e){let n=(i)=>i.replace(/[^\n]/g," ");return e.replace(/\/\*[\s\S]*?\*\//g,n).replace(/\/\/[^\n]*/g,n)}function m(e,n=!1){let i=R(e);return(n?F(i):r(i)).replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,(l,s)=>/\bclient\b/i.test(s)?l:l.replace(/[^\n]/g," "))}function O(e,n,i,o){let l=m(e),s=m(e,!0);for(let t of v){if(!i.includes(t.rule))continue;if(t.requires&&!t.requires(e))continue;t.pattern.lastIndex=0;let a,c=/['"]/.test(t.pattern.source)?s:l;t.pattern.lastIndex=0;while((a=t.pattern.exec(c))!==null){if(t.reject?.(e,a.index))continue;o.push({file:n,line:g(e,a.index),rule:t.rule,applied:!1,snippet:b(e,a.index),reason:`${t.primitive} \u2014 ${t.why}`})}}}function q(e,n={}){let i=n.rules??C,o=n.file??"<source>",l=[];O(e,o,i,l);let s=e;if(i.includes("confirm"))s=A(s,o,l);if(i.includes("tooltip"))s=E(s,o,l);l.sort((c,u)=>c.line-u.line);let t=new Set,a=l.filter((c)=>{let u=`${c.rule}:${c.line}`;if(t.has(u))return!1;return t.add(u),!0});return{code:s,findings:a}}var x=new Set(["confirm","tooltip"]);function I(e,n){if(e.length===0)return"No hand-rolled equivalents found.";let i=e.filter((t)=>t.applied),o=e.filter((t)=>!t.applied&&x.has(t.rule)),l=e.filter((t)=>!t.applied&&!x.has(t.rule)),s=[];if(i.length>0){s.push(n?`Rewrote ${i.length} site(s):`:`Would rewrite ${i.length} site(s) (pass --fix):`);for(let t of i)s.push(` ${t.file}:${t.line} [${t.rule}] ${t.snippet}`)}if(o.length>0){s.push("",`Needs a human \u2014 ${o.length} site(s):`);for(let t of o)s.push(` ${t.file}:${t.line} [${t.rule}] ${t.snippet}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{El,Tl,$l}from"./chunk-1jwcp2k0.js";import{de,Kn,Gn,_o,Qr,es,Xn,Jn,Co,ts}from"./chunk-38qp2pg2.js";function z(e,o,l,r,d,y){let s=!0,u=new Set,h=(p)=>r.get?r.get(p):p,a=()=>h(e());return Object.defineProperty(a,"_isSignal",{value:!0}),Object.defineProperty(a,"modifiers",{get:o}),a.set=(p)=>{if(!s)return;let f=o(),t=r.set?r.set(p,f):p;if(f.trim&&typeof t==="string")t=t.trim();if(f.number&&typeof t==="string"&&t!==""){let i=Number(t);if(!Number.isNaN(i))t=i}if(Object.is(e(),t))return;e.set(t),l(t)},a.update=(p)=>a.set(p(a())),a.input=(p)=>{if(!o().lazy)a.set(p)},a.change=(p)=>{if(o().lazy)a.set(p)},a.subscribe=(p)=>{if(!s)return()=>{};let f=e.subscribe((t,i)=>p(h(t),h(i)));return u.add(f),()=>{f(),u.delete(f)}},Object.defineProperty(a,"value",{get:a,set:a.set}),d(()=>{s=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{s=!0}),a}function X(e,o=!0,l){if(!o||!e||typeof window>"u")return;let r=window;if(!r.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let s=JSON.parse(y?.textContent||"{}");r.__STX_DATA__=s&&typeof s==="object"&&!Array.isArray(s)?s:{}}catch{r.__STX_DATA__={}}}let d=r.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,e))try{return{data:l?l(d[e]):d[e]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Q(e){if(typeof window>"u")return;let o=window;if(e===void 0)o.__STX_DATA__={};else{if(!o.__STX_DATA__)try{let l=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");o.__STX_DATA__=l&&typeof l==="object"&&!Array.isArray(l)?l:{}}catch{o.__STX_DATA__={}}if(o.__STX_DATA__)delete o.__STX_DATA__[e]}}function Y(e){let o=null;try{o=typeof indexedDB<"u"?indexedDB:null}catch{o=null}if(!o)return null;let l=o,r=e||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,h)=>{let a=l.open(r,1);a.onupgradeneeded=()=>{a.result.createObjectStore("kv")},a.onsuccess=()=>u(a.result),a.onerror=()=>h(a.error),a.onblocked=()=>h(Error("blocked"))}),d.catch(()=>{d=null});return d},s=(u,h)=>y().then((a)=>new Promise((p,f)=>{let t=a.transaction("kv",u),i=h(t.objectStore("kv"));t.oncomplete=()=>p(i?i.result:void 0),t.onerror=()=>f(t.error),t.onabort=()=>f(t.error)}));return{get:(u)=>s("readonly",(h)=>h.get(u)),set:(u,h)=>s("readwrite",(a)=>{a.put(h,u)}),remove:(u)=>s("readwrite",(h)=>{h.delete(u)}),removePrefix:(u)=>s("readwrite",(h)=>{h.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function J(e,o){let l=e||{},r=null;if(l.storage!==void 0)r=l.storage;else try{r=typeof localStorage<"u"?localStorage:null}catch{r=null}let d=null,y=l.backend!==void 0;if(y)d=l.backend||null;let s=()=>{if(y)return d;y=!0;try{d=o?o():null}catch{d=null}if(d){let n=d;n.get("__stx_probe__").catch(()=>{if(d===n)d=null})}return d},u=l.limit||32768,h=l.defer||((n)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(n,{timeout:200});else setTimeout(n,16)}),a=new Map,p=new Set,f=new Map,t=!1,i=Promise.resolve(),g=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!r)return!1;try{return r.setItem(n,c),!0}catch{return!1}},_=(n)=>{try{if(r)r.removeItem(n)}catch{}},k=()=>{if(t=!1,!f.size)return i;let n=Array.from(f.entries());return f.clear(),i=i.then(()=>Promise.all(n.map(([c,v])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(v===void 0?null:v))}catch{}return}let x;try{return x={v},d.set(c,x).catch(()=>{let S;try{S=JSON.stringify(v)}catch{return}return d?d.set(c,{j:S}).catch(()=>{m(c,S)}):void 0})}catch{return}}))).then(()=>{}),i},N=(n,c)=>{if(f.set(n,c),p.add(n),t)return;t=!0,h(()=>{k()})},P=(n)=>{if(!n||typeof n!=="object")return;let c=n;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:g(c.j)};return},E={peek(n){if(a.has(n))return{value:a.get(n)};let c=null;try{c=r?r.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let v=g(c);return a.set(n,v),{value:v}},load(n){let c=E.peek(n),v=c?null:s();if(c||!v)return Promise.resolve(c);return v.get(n).then((x)=>{if(a.has(n))return{value:a.get(n)};let S=P(x);if(S)a.set(n,S.value),p.add(n);return S},()=>{return})},set(n,c){if(a.set(n,c),d&&p.has(n)){N(n,c);return}let v;try{v=JSON.stringify(c===void 0?null:c)}catch{return}if(v.length<=u&&m(n,v))return;if(!s()){if(v.length>u)m(n,v);return}_(n),N(n,c)},forget(n){for(let v of Array.from(a.keys()))if(v.indexOf(n)===0)a.delete(v);for(let v of Array.from(f.keys()))if(v.indexOf(n)===0)f.delete(v);for(let v of Array.from(p))if(v.indexOf(n)===0)p.delete(v);try{if(r)for(let v=r.length-1;v>=0;v--){let x=r.key(v);if(x&&x.indexOf(n)===0)r.removeItem(x)}}catch{}let c=s();if(!c)return i;return i=i.then(()=>c.removePrefix(n)).catch(()=>{}),i},flush(){return k()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")k()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{k()})}catch{}return E}function Z(e,o){if(!e)return!1;if(e===o.key)return!0;if(!o.url)return!1;if(e===o.url)return!0;try{let l=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",r=new URL(e,l),d=new URL(o.url,l);if(r.origin!==d.origin||r.pathname!==d.pathname)return!1;return!r.search||r.search===d.search}catch{return!1}}function ee(e){let o=e.prefix||"stx:kept:",l=e.matches||((t,i)=>t===i.key||t===i.url),r=new Set,d=new Map,y,s=(t)=>t===void 0?y:t,u=(t,i)=>{let g=s(i);if(g===!1||g===null||g==="")return null;return`${o}${g===void 0?"":`${g}:`}query:${t}`},h=(t)=>{let i=t&&t.value;if(!i||typeof i!=="object"||!("d"in i))return;return{data:i.d,at:Number(i.at)||0}},a=()=>{let t=globalThis;return t.__stx_outboxes instanceof Map?t.__stx_outboxes:null},p={setScope(t){y=t},scope:()=>y,keyFor:u,seed(t,i){let g=u(t,i);return g?h(e.kept.peek(g)):void 0},restore(t,i){let g=u(t,i);return g?e.kept.load(g).then(h):Promise.resolve(void 0)},persist(t,i,g){let m=u(t,g);if(m)e.kept.set(m,{d:i,at:Date.now()})},overlay(t,i,g){let m=a();if(!m||!m.size)return i;let _=i;return m.forEach((k)=>{try{_=k.overlay(t,_,g)}catch{}}),_},watch(t){return r.add(t),()=>{r.delete(t)}},cachedQuery(t,i){let g=d.get(t);if(g){if(i&&g.__options)g.__options(i);return g}let m=i||{},_=m.initial===void 0?null:m.initial,k=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,P=()=>({key:t,url:N()}),E=k(),n=_,c=0,v=e.sharedRequest(),x=0,S=p.seed(t,E);if(S)n=S.data;let C=e.state(p.overlay(P(),n)),U=e.state(!1),q=e.state(!1),K=e.state(null),M=e.state(S?S.at:0),R=0,V=()=>{C.set(p.overlay(P(),n))},W=(w)=>{let b=R;p.restore(t,w).then((T)=>{if(!T||b!==R||c)return;n=T.data,M.set(T.at),V()})};if(!S)W(E);let xt=()=>{let w=k();if(w===E)return;E=w,R++,x=0,q.set(!1),U.set(!1),c=0;let b=p.seed(t,E);if(n=b?b.data:_,M.set(b?b.at:0),V(),!b)W(E)},St=(w,b)=>{let T=m.timeoutMs||15000,I=typeof AbortController<"u"?new AbortController:null,O=null,j=new Promise((D,F)=>{O=setTimeout(()=>{if(I)I.abort();F(Error("The request took too long."))},T)}),A;if(m.load)A=m.load({force:w,url:b,signal:I?I.signal:void 0});else if(b){let D=m.fetch||((L,H)=>fetch(L,H)),F={method:"GET",headers:{Accept:"application/json"}};if(w)F.cache="no-cache";if(I)F.signal=I.signal;A=D(b,F).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((H)=>{throw Error(H&&(H.error||H.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(C());return Promise.race([A,j]).then((D)=>{if(O)clearTimeout(O);return m.transform?m.transform(D):D},(D)=>{if(O)clearTimeout(O);throw D})},G=(w)=>{let b=R,T=N(),I=()=>{if(b!==R)return Promise.resolve(C());if(x++,q.set(!0),c===0&&!M())U.set(!0);let j=()=>{if(b!==R)return;if(x=Math.max(0,x-1),!x)q.set(!1),U.set(!1)};return St(w,T).then((A)=>{if(b!==R||T!==N())return j(),C();return n=A,c=Date.now(),M.set(c),K.set(null),p.persist(t,A,E),V(),j(),C()},(A)=>{if(b===R&&T===N())K.set(A&&A.message?A.message:"Could not load.");return j(),C()})},O=`${b} ${T||""}`;return w?v.fresh(O,I):v.run(O,I)},B={data:C,loading:U,isFetching:q,error:K,updatedAt:M,get key(){return t},load(w){if(xt(),!w&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(C());return G(!!w)},refresh(){return B.load(!0)},set(w){n=typeof w==="function"?w(n):w,p.persist(t,n,E),V()},invalidate(){c=0},__options(w){m={...m,...w}}};if(r.add({target:P,updated:()=>{if(c||M())G(!1)},outbox:(w)=>{if(w)n=p.overlay(P(),n,w.id),c=0,G(!0);V()}}),d.set(t,B),m.immediate)B.load();return B}},f=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(e.listen!==!1&&f&&typeof f.addEventListener==="function")f.addEventListener("stx:updated",(t)=>{let i=t.detail||{};if(i.kind!=="api"||typeof i.url!=="string")return;r.forEach((g)=>{if(l(i.url,g.target()))g.updated()})}),f.addEventListener("stx:outbox",(t)=>{let i=t.detail||{},g=i.sent&&typeof i.sent.id==="string"?i.sent:null;r.forEach((m)=>{if(g){let _=Array.isArray(g.affects)?g.affects:[],k=m.target();if(!_.some((N)=>l(N,k)))return}m.outbox(g)})});return p}function te(e){let o=e&&e.covers||((s,u)=>Object.is(s,u)),l=[],r=[],d=0,y=(s,u)=>{let h;try{h=Promise.resolve(u())}catch(f){h=Promise.reject(f)}let a={key:s,promise:h};l.push(a);let p=()=>{let f=l.indexOf(a);if(f!==-1)l.splice(f,1)};return h.then(p,p),h};return{run(s,u){for(let h of l)if(o(h.key,s))return h.promise;for(let h of r)if(o(h.key,s))return h.promise;return y(s,u)},fresh(s,u){for(let f of r)if(o(f.key,s))return f.promise;let h=l.filter((f)=>o(f.key,s)).map((f)=>f.promise);if(!h.length)return y(s,u);let a={key:s,promise:null},p=()=>{};return a.promise=Promise.all(h.map((f)=>f.then(p,p))).then(()=>{let f=r.indexOf(a);if(f!==-1)r.splice(f,1);return y(s,u)}),r.push(a),a.promise},latest(){let s=++d;return()=>s===d},get busy(){return l.length>0||r.length>0}}}function ne(e){let o=!1,l=null,r=null,d=0;async function y(){if(o)return;l=new AbortController;try{let s=await e.request(e.endpoint,{signal:l.signal,cache:"no-store",headers:{Accept:"text/event-stream"}});if(!s.ok||!s.body||!s.headers.get("content-type")?.includes("text/event-stream"))throw Error("Broadcast stream unavailable");if(o){await s.body.cancel();return}let u=s.body.getReader(),h=new TextDecoder,a="";d=0,e.onStatus?.(!0),e.onConnected?.();try{while(!o){let{done:p,value:f}=await u.read();if(p)break;if(a+=h.decode(f,{stream:!0}).replace(/\r\n/g,`
|
|
2
|
+
import{Rl,Al,Pl}from"./chunk-qjey0jk6.js";import{ge,Jn,Yn,To,ns,rs,Zn,Qn,$o,ss}from"./chunk-67dgp45w.js";function z(e,o,l,r,d,y){let s=!0,u=new Set,h=(p)=>r.get?r.get(p):p,a=()=>h(e());return Object.defineProperty(a,"_isSignal",{value:!0}),Object.defineProperty(a,"modifiers",{get:o}),a.set=(p)=>{if(!s)return;let f=o(),t=r.set?r.set(p,f):p;if(f.trim&&typeof t==="string")t=t.trim();if(f.number&&typeof t==="string"&&t!==""){let i=Number(t);if(!Number.isNaN(i))t=i}if(Object.is(e(),t))return;e.set(t),l(t)},a.update=(p)=>a.set(p(a())),a.input=(p)=>{if(!o().lazy)a.set(p)},a.change=(p)=>{if(o().lazy)a.set(p)},a.subscribe=(p)=>{if(!s)return()=>{};let f=e.subscribe((t,i)=>p(h(t),h(i)));return u.add(f),()=>{f(),u.delete(f)}},Object.defineProperty(a,"value",{get:a,set:a.set}),d(()=>{s=!1,u.forEach((p)=>p()),u.clear()}),y?.(()=>{s=!0}),a}function X(e,o=!0,l){if(!o||!e||typeof window>"u")return;let r=window;if(!r.__STX_DATA__){let y=document.querySelector("script[data-stx-server-data]");try{let s=JSON.parse(y?.textContent||"{}");r.__STX_DATA__=s&&typeof s==="object"&&!Array.isArray(s)?s:{}}catch{r.__STX_DATA__={}}}let d=r.__STX_DATA__;if(d&&Object.prototype.hasOwnProperty.call(d,e))try{return{data:l?l(d[e]):d[e]}}catch(y){return{data:null,error:y instanceof Error?y:Error(String(y))}}return}function Q(e){if(typeof window>"u")return;let o=window;if(e===void 0)o.__STX_DATA__={};else{if(!o.__STX_DATA__)try{let l=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");o.__STX_DATA__=l&&typeof l==="object"&&!Array.isArray(l)?l:{}}catch{o.__STX_DATA__={}}if(o.__STX_DATA__)delete o.__STX_DATA__[e]}}function Y(e){let o=null;try{o=typeof indexedDB<"u"?indexedDB:null}catch{o=null}if(!o)return null;let l=o,r=e||"stx-kept",d=null,y=()=>{if(!d)d=new Promise((u,h)=>{let a=l.open(r,1);a.onupgradeneeded=()=>{a.result.createObjectStore("kv")},a.onsuccess=()=>u(a.result),a.onerror=()=>h(a.error),a.onblocked=()=>h(Error("blocked"))}),d.catch(()=>{d=null});return d},s=(u,h)=>y().then((a)=>new Promise((p,f)=>{let t=a.transaction("kv",u),i=h(t.objectStore("kv"));t.oncomplete=()=>p(i?i.result:void 0),t.onerror=()=>f(t.error),t.onabort=()=>f(t.error)}));return{get:(u)=>s("readonly",(h)=>h.get(u)),set:(u,h)=>s("readwrite",(a)=>{a.put(h,u)}),remove:(u)=>s("readwrite",(h)=>{h.delete(u)}),removePrefix:(u)=>s("readwrite",(h)=>{h.delete(IDBKeyRange.bound(u,`${u}\uFFFF`))})}}function J(e,o){let l=e||{},r=null;if(l.storage!==void 0)r=l.storage;else try{r=typeof localStorage<"u"?localStorage:null}catch{r=null}let d=null,y=l.backend!==void 0;if(y)d=l.backend||null;let s=()=>{if(y)return d;y=!0;try{d=o?o():null}catch{d=null}if(d){let n=d;n.get("__stx_probe__").catch(()=>{if(d===n)d=null})}return d},u=l.limit||32768,h=l.defer||((n)=>{let c=typeof requestIdleCallback==="function"?requestIdleCallback:null;if(c)c(n,{timeout:200});else setTimeout(n,16)}),a=new Map,p=new Set,f=new Map,t=!1,i=Promise.resolve(),g=(n)=>{try{return JSON.parse(n)}catch{return n}},m=(n,c)=>{if(!r)return!1;try{return r.setItem(n,c),!0}catch{return!1}},_=(n)=>{try{if(r)r.removeItem(n)}catch{}},k=()=>{if(t=!1,!f.size)return i;let n=Array.from(f.entries());return f.clear(),i=i.then(()=>Promise.all(n.map(([c,v])=>{if(!d){p.delete(c);try{m(c,JSON.stringify(v===void 0?null:v))}catch{}return}let x;try{return x={v},d.set(c,x).catch(()=>{let S;try{S=JSON.stringify(v)}catch{return}return d?d.set(c,{j:S}).catch(()=>{m(c,S)}):void 0})}catch{return}}))).then(()=>{}),i},N=(n,c)=>{if(f.set(n,c),p.add(n),t)return;t=!0,h(()=>{k()})},P=(n)=>{if(!n||typeof n!=="object")return;let c=n;if("v"in c)return{value:c.v};if(typeof c.j==="string")return{value:g(c.j)};return},E={peek(n){if(a.has(n))return{value:a.get(n)};let c=null;try{c=r?r.getItem(n):null}catch{c=null}if(c===null||c===void 0)return;let v=g(c);return a.set(n,v),{value:v}},load(n){let c=E.peek(n),v=c?null:s();if(c||!v)return Promise.resolve(c);return v.get(n).then((x)=>{if(a.has(n))return{value:a.get(n)};let S=P(x);if(S)a.set(n,S.value),p.add(n);return S},()=>{return})},set(n,c){if(a.set(n,c),d&&p.has(n)){N(n,c);return}let v;try{v=JSON.stringify(c===void 0?null:c)}catch{return}if(v.length<=u&&m(n,v))return;if(!s()){if(v.length>u)m(n,v);return}_(n),N(n,c)},forget(n){for(let v of Array.from(a.keys()))if(v.indexOf(n)===0)a.delete(v);for(let v of Array.from(f.keys()))if(v.indexOf(n)===0)f.delete(v);for(let v of Array.from(p))if(v.indexOf(n)===0)p.delete(v);try{if(r)for(let v=r.length-1;v>=0;v--){let x=r.key(v);if(x&&x.indexOf(n)===0)r.removeItem(x)}}catch{}let c=s();if(!c)return i;return i=i.then(()=>c.removePrefix(n)).catch(()=>{}),i},flush(){return k()}};try{if(typeof document<"u"&&document.addEventListener)document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden")k()});if(typeof addEventListener==="function")addEventListener("pagehide",()=>{k()})}catch{}return E}function Z(e,o){if(!e)return!1;if(e===o.key)return!0;if(!o.url)return!1;if(e===o.url)return!0;try{let l=typeof location<"u"&&location.origin&&location.origin!=="null"?location.origin:"http://localhost",r=new URL(e,l),d=new URL(o.url,l);if(r.origin!==d.origin||r.pathname!==d.pathname)return!1;return!r.search||r.search===d.search}catch{return!1}}function ee(e){let o=e.prefix||"stx:kept:",l=e.matches||((t,i)=>t===i.key||t===i.url),r=new Set,d=new Map,y,s=(t)=>t===void 0?y:t,u=(t,i)=>{let g=s(i);if(g===!1||g===null||g==="")return null;return`${o}${g===void 0?"":`${g}:`}query:${t}`},h=(t)=>{let i=t&&t.value;if(!i||typeof i!=="object"||!("d"in i))return;return{data:i.d,at:Number(i.at)||0}},a=()=>{let t=globalThis;return t.__stx_outboxes instanceof Map?t.__stx_outboxes:null},p={setScope(t){y=t},scope:()=>y,keyFor:u,seed(t,i){let g=u(t,i);return g?h(e.kept.peek(g)):void 0},restore(t,i){let g=u(t,i);return g?e.kept.load(g).then(h):Promise.resolve(void 0)},persist(t,i,g){let m=u(t,g);if(m)e.kept.set(m,{d:i,at:Date.now()})},overlay(t,i,g){let m=a();if(!m||!m.size)return i;let _=i;return m.forEach((k)=>{try{_=k.overlay(t,_,g)}catch{}}),_},watch(t){return r.add(t),()=>{r.delete(t)}},cachedQuery(t,i){let g=d.get(t);if(g){if(i&&g.__options)g.__options(i);return g}let m=i||{},_=m.initial===void 0?null:m.initial,k=()=>typeof m.scope==="function"?m.scope():m.scope,N=()=>(typeof m.url==="function"?m.url():m.url)||null,P=()=>({key:t,url:N()}),E=k(),n=_,c=0,v=e.sharedRequest(),x=0,S=p.seed(t,E);if(S)n=S.data;let C=e.state(p.overlay(P(),n)),U=e.state(!1),q=e.state(!1),K=e.state(null),M=e.state(S?S.at:0),R=0,V=()=>{C.set(p.overlay(P(),n))},W=(w)=>{let b=R;p.restore(t,w).then((T)=>{if(!T||b!==R||c)return;n=T.data,M.set(T.at),V()})};if(!S)W(E);let _t=()=>{let w=k();if(w===E)return;E=w,R++,x=0,q.set(!1),U.set(!1),c=0;let b=p.seed(t,E);if(n=b?b.data:_,M.set(b?b.at:0),V(),!b)W(E)},xt=(w,b)=>{let T=m.timeoutMs||15000,I=typeof AbortController<"u"?new AbortController:null,O=null,j=new Promise((D,F)=>{O=setTimeout(()=>{if(I)I.abort();F(Error("The request took too long."))},T)}),A;if(m.load)A=m.load({force:w,url:b,signal:I?I.signal:void 0});else if(b){let D=m.fetch||((L,H)=>fetch(L,H)),F={method:"GET",headers:{Accept:"application/json"}};if(w)F.cache="no-cache";if(I)F.signal=I.signal;A=D(b,F).then((L)=>{if(!L.ok)return L.json().catch(()=>null).then((H)=>{throw Error(H&&(H.error||H.message)||`Request failed (${L.status})`)});return L.json()})}else return Promise.resolve(C());return Promise.race([A,j]).then((D)=>{if(O)clearTimeout(O);return m.transform?m.transform(D):D},(D)=>{if(O)clearTimeout(O);throw D})},G=(w)=>{let b=R,T=N(),I=()=>{if(b!==R)return Promise.resolve(C());if(x++,q.set(!0),c===0&&!M())U.set(!0);let j=()=>{if(b!==R)return;if(x=Math.max(0,x-1),!x)q.set(!1),U.set(!1)};return xt(w,T).then((A)=>{if(b!==R||T!==N())return j(),C();return n=A,c=Date.now(),M.set(c),K.set(null),p.persist(t,A,E),V(),j(),C()},(A)=>{if(b===R&&T===N())K.set(A&&A.message?A.message:"Could not load.");return j(),C()})},O=`${b} ${T||""}`;return w?v.fresh(O,I):v.run(O,I)},B={data:C,loading:U,isFetching:q,error:K,updatedAt:M,get key(){return t},load(w){if(_t(),!w&&c&&Date.now()-c<(m.staleTime||0))return Promise.resolve(C());return G(!!w)},refresh(){return B.load(!0)},set(w){n=typeof w==="function"?w(n):w,p.persist(t,n,E),V()},invalidate(){c=0},__options(w){m={...m,...w}}};if(r.add({target:P,updated:()=>{if(c||M())G(!1)},outbox:(w)=>{if(w)n=p.overlay(P(),n,w.id),c=0,G(!0);V()}}),d.set(t,B),m.immediate)B.load();return B}},f=typeof window<"u"?window:typeof addEventListener==="function"?globalThis:null;if(e.listen!==!1&&f&&typeof f.addEventListener==="function")f.addEventListener("stx:updated",(t)=>{let i=t.detail||{};if(i.kind!=="api"||typeof i.url!=="string")return;r.forEach((g)=>{if(l(i.url,g.target()))g.updated()})}),f.addEventListener("stx:outbox",(t)=>{let i=t.detail||{},g=i.sent&&typeof i.sent.id==="string"?i.sent:null;r.forEach((m)=>{if(g){let _=Array.isArray(g.affects)?g.affects:[],k=m.target();if(!_.some((N)=>l(N,k)))return}m.outbox(g)})});return p}function te(e){let o=e&&e.covers||((s,u)=>Object.is(s,u)),l=[],r=[],d=0,y=(s,u)=>{let h;try{h=Promise.resolve(u())}catch(f){h=Promise.reject(f)}let a={key:s,promise:h};l.push(a);let p=()=>{let f=l.indexOf(a);if(f!==-1)l.splice(f,1)};return h.then(p,p),h};return{run(s,u){for(let h of l)if(o(h.key,s))return h.promise;for(let h of r)if(o(h.key,s))return h.promise;return y(s,u)},fresh(s,u){for(let f of r)if(o(f.key,s))return f.promise;let h=l.filter((f)=>o(f.key,s)).map((f)=>f.promise);if(!h.length)return y(s,u);let a={key:s,promise:null},p=()=>{};return a.promise=Promise.all(h.map((f)=>f.then(p,p))).then(()=>{let f=r.indexOf(a);if(f!==-1)r.splice(f,1);return y(s,u)}),r.push(a),a.promise},latest(){let s=++d;return()=>s===d},get busy(){return l.length>0||r.length>0}}}function ne(e){let o=!1,l=null,r=null,d=0;async function y(){if(o)return;l=new AbortController;try{let s=await e.request(e.endpoint,{signal:l.signal,cache:"no-store",headers:{Accept:"text/event-stream"}});if(!s.ok||!s.body||!s.headers.get("content-type")?.includes("text/event-stream"))throw Error("Broadcast stream unavailable");if(o){await s.body.cancel();return}let u=s.body.getReader(),h=new TextDecoder,a="";d=0,e.onStatus?.(!0),e.onConnected?.();try{while(!o){let{done:p,value:f}=await u.read();if(p)break;if(a+=h.decode(f,{stream:!0}).replace(/\r\n/g,`
|
|
3
3
|
`),a.length>1048576)throw Error("Broadcast frame too large");let t;while((t=a.indexOf(`
|
|
4
4
|
|
|
5
5
|
`))!==-1){let i=a.slice(0,t);a=a.slice(t+2);let g=i.split(`
|
|
@@ -993,7 +993,7 @@ else {
|
|
|
993
993
|
if (name in window) return window[name];
|
|
994
994
|
return defaultValue;
|
|
995
995
|
}
|
|
996
|
-
`;var
|
|
996
|
+
`;var de=` function bindParentComponentProps(el, callerScope) {
|
|
997
997
|
if (!el || !el.getAttribute || el.__stx_parent_props_bound) return;
|
|
998
998
|
var names = __stxWords(el.getAttribute('data-stx-parent-bindings') || '');
|
|
999
999
|
if (!names.length) return;
|
|
@@ -1117,7 +1117,7 @@ else {
|
|
|
1117
1117
|
});
|
|
1118
1118
|
return layerTemplateScopes.apply(null, sources);
|
|
1119
1119
|
}
|
|
1120
|
-
`;var
|
|
1120
|
+
`;var ue=` /*
|
|
1121
1121
|
* Run a component setup for one clone. The compiled setup finds its root by
|
|
1122
1122
|
* the template's scope id, so the clone answers to that id while it runs,
|
|
1123
1123
|
* and the scope it registers is moved to the clone's own id afterwards.
|
|
@@ -1299,7 +1299,7 @@ else {
|
|
|
1299
1299
|
}
|
|
1300
1300
|
});
|
|
1301
1301
|
}
|
|
1302
|
-
`;var
|
|
1302
|
+
`;var pe=` // Component composition API (Phase 4)
|
|
1303
1303
|
defineProps: function(definitions) {
|
|
1304
1304
|
var props = window.__STX_CURRENT_PROPS__ || {};
|
|
1305
1305
|
if (!definitions) return props;
|
|
@@ -1357,7 +1357,7 @@ else {
|
|
|
1357
1357
|
// implementation behind it (#1804).
|
|
1358
1358
|
useSlots: function() {
|
|
1359
1359
|
return window.__STX_CURRENT_SLOTS__ || {};
|
|
1360
|
-
},`;var
|
|
1360
|
+
},`;var fe=` var __bindIfCounter = 0;
|
|
1361
1361
|
// \u2500\u2500 x-else / x-else-if chain support (stacksjs/stx#1734) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
1362
1362
|
// Returns { name, terminal } for an else/else-if attribute present on el,
|
|
1363
1363
|
// or null. terminal=true for the catch-all x-else (no further siblings
|
|
@@ -1395,7 +1395,7 @@ else {
|
|
|
1395
1395
|
}
|
|
1396
1396
|
return chain;
|
|
1397
1397
|
}
|
|
1398
|
-
`;var
|
|
1398
|
+
`;var he=` // A false :if detaches its subtree before the DOMContentLoaded scope walk
|
|
1399
1399
|
// reaches nested components. Capture and bind their caller-owned props while
|
|
1400
1400
|
// the ancestor chain is still connected, otherwise resolveComponentCallerScope
|
|
1401
1401
|
// can no longer see the component that declared expressions such as
|
|
@@ -1476,7 +1476,7 @@ else {
|
|
|
1476
1476
|
}
|
|
1477
1477
|
return scripts;
|
|
1478
1478
|
}
|
|
1479
|
-
`;var
|
|
1479
|
+
`;var me=` // ==========================================================================
|
|
1480
1480
|
// Container Cleanup (for SPA navigation)
|
|
1481
1481
|
// ==========================================================================
|
|
1482
1482
|
|
|
@@ -10930,8 +10930,16 @@ catch (e2) {
|
|
|
10930
10930
|
return get;
|
|
10931
10931
|
}
|
|
10932
10932
|
|
|
10933
|
+
// A wait of 0 is a wait of 0. These defaults were written with ||, which
|
|
10934
|
+
// also replaces 0: useTimeout(fn, 0), meant as "on the next turn", waited a
|
|
10935
|
+
// full second, and a debounce or throttle of 0 waited 250ms. Only an omitted
|
|
10936
|
+
// wait takes the default, as in the module composables (use-timer.ts).
|
|
10937
|
+
function waitOr(value, fallback) {
|
|
10938
|
+
return value === undefined ? fallback : value;
|
|
10939
|
+
}
|
|
10940
|
+
|
|
10933
10941
|
function useDebounce(fn, delay) {
|
|
10934
|
-
delay = delay
|
|
10942
|
+
delay = waitOr(delay, 250);
|
|
10935
10943
|
var timer = null;
|
|
10936
10944
|
var lastArgs = null;
|
|
10937
10945
|
var debounced = function() {
|
|
@@ -10963,7 +10971,7 @@ catch (e2) {
|
|
|
10963
10971
|
var useDebounceFn = useDebounce;
|
|
10964
10972
|
|
|
10965
10973
|
function useDebouncedValue(getter, delay) {
|
|
10966
|
-
delay = delay
|
|
10974
|
+
delay = waitOr(delay, 250);
|
|
10967
10975
|
var current = getter();
|
|
10968
10976
|
var listeners = [];
|
|
10969
10977
|
var timer = null;
|
|
@@ -10993,7 +11001,7 @@ catch (e2) {
|
|
|
10993
11001
|
var refDebounced = useDebouncedValue;
|
|
10994
11002
|
|
|
10995
11003
|
function useThrottle(fn, limit) {
|
|
10996
|
-
limit = limit
|
|
11004
|
+
limit = waitOr(limit, 250);
|
|
10997
11005
|
var timer = null;
|
|
10998
11006
|
var lastRan = 0;
|
|
10999
11007
|
var throttled = function() {
|
|
@@ -11094,7 +11102,7 @@ else if (timer === null) {
|
|
|
11094
11102
|
}
|
|
11095
11103
|
|
|
11096
11104
|
function useTimeout(callback, delay) {
|
|
11097
|
-
delay = delay
|
|
11105
|
+
delay = waitOr(delay, 1000);
|
|
11098
11106
|
var timer = null;
|
|
11099
11107
|
var pending = false;
|
|
11100
11108
|
var listeners = [];
|
|
@@ -11547,7 +11555,7 @@ else if (timer === null) {
|
|
|
11547
11555
|
removeToast(tid);
|
|
11548
11556
|
}
|
|
11549
11557
|
}
|
|
11550
|
-
};`;var
|
|
11558
|
+
};`;var wt=` // \u2500\u2500 <TransitionGroup> support (#1742) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
11551
11559
|
// Class-driven enter/leave + FLIP move animations for keyed :for lists whose
|
|
11552
11560
|
// parent is a [data-stx-transition-group]. All helpers are self-contained and
|
|
11553
11561
|
// guarded (no-ops off the happy path), and every transition has a timeout
|
|
@@ -11638,7 +11646,7 @@ else if (timer === null) {
|
|
|
11638
11646
|
});
|
|
11639
11647
|
});
|
|
11640
11648
|
}
|
|
11641
|
-
`;var
|
|
11649
|
+
`;var bt=` // ==========================================================================
|
|
11642
11650
|
// WebSocket Composable
|
|
11643
11651
|
// ==========================================================================
|
|
11644
11652
|
|
|
@@ -11775,7 +11783,7 @@ else if (timer === null) {
|
|
|
11775
11783
|
subscribe: subscribe
|
|
11776
11784
|
};
|
|
11777
11785
|
}
|
|
11778
|
-
`;function
|
|
11786
|
+
`;function St(e={}){let o=kt(Xn(e));try{let r=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(o);return r=r.replace(/\}(var |let |const |function )/g,"};$1"),r}catch{return o}}function kt(e){let o=[],l=0,r="console.log(";while(l<e.length){let d=e.indexOf(r,l);if(d===-1){o.push(e.slice(l));break}o.push(e.slice(l,d));let y=1,s=d+r.length;while(s<e.length&&y>0){let u=e[s];if(u==='"'||u==="'"||u==="`"){let h=u;s++;while(s<e.length&&e[s]!==h){if(e[s]==="\\")s++;s++}s++;continue}if(u==="(")y++;else if(u===")")y--;s++}o.push("0"),l=s}return o.join("")}function Xn(e={}){return`${ae}${Pe}
|
|
11779
11787
|
${Ze(ie,ke,Te)}
|
|
11780
11788
|
|
|
11781
11789
|
${De}
|
|
@@ -11784,7 +11792,7 @@ ${tt}
|
|
|
11784
11792
|
${ut}
|
|
11785
11793
|
${xe}
|
|
11786
11794
|
${Ue}
|
|
11787
|
-
${
|
|
11795
|
+
${bt}
|
|
11788
11796
|
${Ae(X.toString(),Q.toString())}
|
|
11789
11797
|
${st}
|
|
11790
11798
|
${ze}
|
|
@@ -11799,24 +11807,24 @@ ${Se}
|
|
|
11799
11807
|
${Re}
|
|
11800
11808
|
${He}
|
|
11801
11809
|
${se}
|
|
11802
|
-
${
|
|
11803
|
-
${
|
|
11810
|
+
${de}
|
|
11811
|
+
${he}
|
|
11804
11812
|
${Ge}
|
|
11805
|
-
${nt(
|
|
11813
|
+
${nt(Al(),Pl(),Rl())}
|
|
11806
11814
|
|
|
11807
11815
|
${mt}
|
|
11808
11816
|
${lt}
|
|
11809
11817
|
${$e}
|
|
11810
11818
|
${le}
|
|
11811
11819
|
${ht}
|
|
11812
|
-
${
|
|
11820
|
+
${wt}
|
|
11813
11821
|
${qe}
|
|
11814
|
-
${
|
|
11822
|
+
${ue}
|
|
11815
11823
|
${Ke}
|
|
11816
11824
|
${Ne}
|
|
11817
11825
|
${e.native?Ie:""}
|
|
11818
11826
|
${Be}
|
|
11819
|
-
${
|
|
11827
|
+
${fe}
|
|
11820
11828
|
${Ve}
|
|
11821
11829
|
${je}
|
|
11822
11830
|
${ce}
|
|
@@ -11839,7 +11847,7 @@ ${ye}
|
|
|
11839
11847
|
${_e}
|
|
11840
11848
|
${vt}
|
|
11841
11849
|
${Me}
|
|
11842
|
-
${ot(
|
|
11850
|
+
${ot(pe)}
|
|
11843
11851
|
|
|
11844
11852
|
${pt}
|
|
11845
11853
|
|
|
@@ -11851,10 +11859,10 @@ ${we}
|
|
|
11851
11859
|
${be}
|
|
11852
11860
|
${at}
|
|
11853
11861
|
${Le}
|
|
11854
|
-
${
|
|
11862
|
+
${me}
|
|
11855
11863
|
${ct}
|
|
11856
11864
|
${dt}
|
|
11857
11865
|
${it}
|
|
11858
11866
|
})();
|
|
11859
|
-
`}var
|
|
11860
|
-
export{
|
|
11867
|
+
`}var $h={state:ge,derived:Jn,effect:Yn,batch:To,onMount:ns,onDestroy:rs,isSignal:Zn,isDerived:Qn,untrack:$o,peek:ss,generateSignalsRuntime:St,generateSignalsRuntimeDev:Xn};
|
|
11868
|
+
export{St,Xn,$h};
|
|
@@ -298,5 +298,5 @@ catch (error) {
|
|
|
298
298
|
init();
|
|
299
299
|
}
|
|
300
300
|
})();
|
|
301
|
-
</script>`}var
|
|
302
|
-
export{
|
|
301
|
+
</script>`}var Ug={name:"pwa.installButton",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return r(t,n)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Wg={name:"pwa.updatePrompt",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return p(t,n)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},qg={name:"pwa.offlineIndicator",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return d(t,n)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},Kg={name:"pwa.pushSubscribe",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return l(t,n)},hasEndTag:!0,description:"Renders a push notification subscription button"},co=[Ug,Wg,qg,Kg];function Py(t){return[...t,...co]}
|
|
302
|
+
export{Ug,Wg,qg,Kg,co,Py};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Eo,Eh,Th}from"./chunk-15m7jnc0.js";import"./chunk-wtfamngc.js";import"./chunk-wk4wg6sn.js";import"./chunk-9zrvh3pz.js";import"./chunk-y036cwc7.js";import"./chunk-nttsc0aw.js";import"./chunk-zsnmk5me.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Th as clearComposableCache,Eh as getComposableScript,Eo as listComposableModules};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function
|
|
3
|
-
export{
|
|
2
|
+
import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function sg(o){return w.test(o)}async function si(o,n={}){let i=n.cwd??process.cwd(),u=n.recursive!==!1,l=n.ignorePaths??[],c=globalThis.Bun.Glob,a=new Set,r=(t)=>{if(t.includes(`${e.sep}node_modules${e.sep}`)||t.includes(`${e.sep}dist${e.sep}`))return;if(l.some((s)=>s&&t.includes(e.normalize(s))))return;a.add(t)},d=async(t)=>{try{for await(let s of new c(t).scan({cwd:i,absolute:!0}))r(s)}catch{}};for(let t of o){if(!t)continue;if(sg(t)){await d(t);continue}let s=e.resolve(i,t);if(!g(s))continue;if(p(s).isDirectory()){for await(let f of new c(u?"**/*.stx":"*.stx").scan({cwd:s,absolute:!0}))r(f);continue}r(s)}return[...a].sort()}
|
|
3
|
+
export{sg,si};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var{WebView:p}=globalThis.Bun;import{existsSync as y,mkdirSync as b,readdirSync as v,statSync as S}from"fs";import l from"path";var h=16384;function M(e){if(/^https?:\/\//.test(e)||e.startsWith("file://"))return e;return`file://${l.resolve(e)}`}function g(e,n,t,o){return new Promise((s)=>{let i=!1,r,m,c=()=>{if(!i){if(i=!0,clearTimeout(m),r)clearTimeout(r);e.onNavigated=void 0,s()}};m=setTimeout(c,o),e.onNavigated=()=>{if(!i)r=setTimeout(c,t)};try{let u=e.navigate(n);if(u&&typeof u.catch==="function")u.catch(c)}catch{c()}})}async function w(e,n,t){let o=`!!document.querySelector(${JSON.stringify(n)})`,s=Date.now()+t;while(Date.now()<s){try{if(await e.evaluate(o))return}catch{}await new Promise((i)=>setTimeout(i,100))}}async function T(e){try{let n=await e.evaluate("Math.ceil(Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight, document.body ? document.body.scrollHeight : 0, document.body ? document.body.offsetHeight : 0))");return typeof n==="number"&&Number.isFinite(n)&&n>0?Math.min(n,h):0}catch{return 0}}async function
|
|
3
|
-
export{
|
|
2
|
+
var{WebView:p}=globalThis.Bun;import{existsSync as y,mkdirSync as b,readdirSync as v,statSync as S}from"fs";import l from"path";var h=16384;function M(e){if(/^https?:\/\//.test(e)||e.startsWith("file://"))return e;return`file://${l.resolve(e)}`}function g(e,n,t,o){return new Promise((s)=>{let i=!1,r,m,c=()=>{if(!i){if(i=!0,clearTimeout(m),r)clearTimeout(r);e.onNavigated=void 0,s()}};m=setTimeout(c,o),e.onNavigated=()=>{if(!i)r=setTimeout(c,t)};try{let u=e.navigate(n);if(u&&typeof u.catch==="function")u.catch(c)}catch{c()}})}async function w(e,n,t){let o=`!!document.querySelector(${JSON.stringify(n)})`,s=Date.now()+t;while(Date.now()<s){try{if(await e.evaluate(o))return}catch{}await new Promise((i)=>setTimeout(i,100))}}async function T(e){try{let n=await e.evaluate("Math.ceil(Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight, document.body ? document.body.scrollHeight : 0, document.body ? document.body.offsetHeight : 0))");return typeof n==="number"&&Number.isFinite(n)&&n>0?Math.min(n,h):0}catch{return 0}}async function Hl(e,n,t={}){let o=Math.min(t.width??1440,h),s=Math.min(t.height??2200,h),i=t.waitMs??800,r=t.timeoutMs??15000,m=t.format??"png",c=M(e),u=(f)=>new p({width:o,height:f,headless:!0,...t.backend?{backend:t.backend}:{}}),a=u(s);try{if(await g(a,c,i,r),t.waitSelector)await w(a,t.waitSelector,r);if(t.fullPage){let d=await T(a);if(d>s){if(a.close(),a=u(d),await g(a,c,i,r),t.waitSelector)await w(a,t.waitSelector,r)}}let f=await a.screenshot({encoding:"buffer",format:m});b(l.dirname(l.resolve(n)),{recursive:!0}),await Bun.write(n,f)}finally{a.close()}if(!y(n))throw Error(`Screenshot was not produced for ${e}`);return{input:e,output:n,bytes:S(n).size}}async function cm(e,n,t={}){b(n,{recursive:!0});let o;if(!/^https?:\/\//.test(e)&&y(e)&&S(e).isDirectory())o=v(e).filter((r)=>r.endsWith(".html")).map((r)=>l.join(e,r));else o=[e];let s=t.format??"png",i=[];for(let r of o){let m=/^https?:\/\//.test(r)?new URL(r).pathname.replace(/\W+/g,"-").replace(/^-|-$/g,"")||"index":l.basename(r).replace(/\.html?$/,"");i.push(await Hl(r,l.join(n,`${m}.${s}`),t))}return i}
|
|
3
|
+
export{Hl,cm};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ui,di,$t,me,wr,Ns,vr,Ms,Ds,og,ig,ag,xr,cg,lg,ug,dg,Lc,jc,Bc,pi,Fc,pg,Rt,At,Pt,It,Ot,Nt,it,fg}from"./chunk-x512h2gv.js";export{vr as Router,ug as abortNavigation,Ns as bracketPathToRegex,Rt as clearMiddleware,jc as createClientCookieManager,Ot as createMiddlewareContext,It as createRouteLocation,Lc as createServerCookieManager,Bc as createStorageManager,dg as defineMiddleware,ig as defineRoute,ag as defineRoutes,Ms as findErrorPage,Ds as formatRoutes,di as generateRouteManifest,ui as generateRouteTypes,Fc as getMiddleware,At as getMiddlewareNames,it as getRouterScript,fg as getRouterScriptDev,pg as hasMiddleware,$t as isFileRequestPath,Pt as loadMiddlewareFromDirectory,wr as matchRoute,lg as navigateTo,me as patternToRegex,pi as registerMiddleware,cg as resetRoutes,xr as route,Nt as runMiddleware,og as setAppUrl};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import y from"fs";import R from"path";var S="_stx";function F(e){return Bun.hash(e).toString(16).slice(0,8)}function k(e){let t=[],n=(i)=>{for(let s of y.readdirSync(i,{withFileTypes:!0})){let r=R.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(y.existsSync(e))n(e);return t}var z=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-runtime src="${e}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-router src="${e}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(e)=>`<link data-css="generated" rel="stylesheet" href="${e}">`}];function I(e,t=`/${S}`){let n=[],i=new Set,s=0,r=e;for(let o of z)r=r.replace(o.pattern,(g,u,c)=>{if(/\b(?:src|href)\s*=/.test(u)||!c.trim())return g;let a=`${o.prefix}.${F(c)}.${o.extension}`;if(!i.has(a))i.add(a),n.push({filename:a,contents:c,contentType:o.contentType});return s+=c.length,o.replace(`${t}/${a}`)});return{html:r,assets:n,bytesInlined:s}}function
|
|
2
|
+
import y from"fs";import R from"path";var S="_stx";function F(e){return Bun.hash(e).toString(16).slice(0,8)}function k(e){let t=[],n=(i)=>{for(let s of y.readdirSync(i,{withFileTypes:!0})){let r=R.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(y.existsSync(e))n(e);return t}var z=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-runtime src="${e}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-router src="${e}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(e)=>`<link data-css="generated" rel="stylesheet" href="${e}">`}];function I(e,t=`/${S}`){let n=[],i=new Set,s=0,r=e;for(let o of z)r=r.replace(o.pattern,(g,u,c)=>{if(/\b(?:src|href)\s*=/.test(u)||!c.trim())return g;let a=`${o.prefix}.${F(c)}.${o.extension}`;if(!i.has(a))i.add(a),n.push({filename:a,contents:c,contentType:o.contentType});return s+=c.length,o.replace(`${t}/${a}`)});return{html:r,assets:n,bytesInlined:s}}function lc(e){let t={pages:0,assets:0,bytesInlined:0},n=R.join(e,S),i=new Set;for(let s of k(e)){let r=y.readFileSync(s,"utf8"),{html:o,assets:g,bytesInlined:u}=I(r);if(o===r)continue;for(let c of g){if(i.has(c.filename))continue;i.add(c.filename),y.mkdirSync(n,{recursive:!0}),y.writeFileSync(R.join(n,c.filename),c.contents),t.assets++}y.writeFileSync(s,o),t.bytesInlined+=u,t.pages++}return t}import h from"fs";import T from"path";var L=1024,N=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,_=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function B(e){return Bun.hash(e).toString(16).slice(0,8)}function C(e){let t=[],n=(i)=>{for(let s of h.readdirSync(i,{withFileTypes:!0})){let r=T.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(h.existsSync(e))n(e);return t}function O(e,t){let n=e.match(new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!n)return;return n[2]??n[3]??n[4]??""}function H(e,t,n){if(n.length<L)return!1;if(/\b(?:src|href)\s*=/i.test(t))return!1;if(e.toLowerCase()==="script"){if(!_.has((O(t,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function D(e){let t=[];for(let n of e.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))t.push([n.index,n.index+n[0].length]);return t}function uc(e){let t={pages:0,assets:0,bytesInlined:0},n=C(e);if(n.length<2)return t;let i=new Map,s=new Map;for(let a of n){let f=h.readFileSync(a,"utf8");i.set(a,f);let M=D(f);for(let d of f.matchAll(N)){let[x,p,l,m]=d;if(!H(p,l,m))continue;if(M.some(([j,A])=>d.index>=j&&d.index<A))continue;let w=`${p.toLowerCase()}\x00${m}`,b=s.get(w);if(b)b.push({file:a,whole:x,tag:p,attrs:l,body:m});else s.set(w,[{file:a,whole:x,tag:p,attrs:l,body:m}])}}let r=[...s.values()].filter((a)=>new Set(a.map((f)=>f.file)).size>1);if(r.length===0)return t;let o=T.join(e,S),g=new Map(i),u=new Map,c=[];for(let a of r){let{tag:f,body:M}=a[0],d=f.toLowerCase()==="script",x=`${d?"chunk":"style"}.${B(M)}.${d?"js":"css"}`;c.push({filename:x,contents:M,contentType:d?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let p=`/${S}/${x}`;for(let l of a){let m=d?`<script${l.attrs} src="${p}"></script>`:`<link${l.attrs} rel="stylesheet" href="${p}">`,w=g.get(l.file),b=w.replace(l.whole,()=>m);if(b===w)continue;g.set(l.file,b),u.set(l.file,(u.get(l.file)??0)+l.body.length)}}h.mkdirSync(o,{recursive:!0});for(let a of c)h.writeFileSync(T.join(o,a.filename),a.contents),t.assets++;for(let[a,f]of g){if(f===i.get(a))continue;h.writeFileSync(a,f),t.pages++,t.bytesInlined+=u.get(a)??0}return t}import E from"fs";import v from"path";var K="layout-types.d.ts";function P(e){let t=[],n=(i,s)=>{let r;try{r=E.readdirSync(i,{withFileTypes:!0})}catch{return}for(let o of r){if(o.name.startsWith("."))continue;let g=v.join(i,o.name);if(o.isDirectory())n(g,s?`${s}/${o.name}`:o.name);else if(o.isFile()&&o.name.endsWith(".stx")&&o.name!=="_layout.stx"){let u=o.name.slice(0,-4);t.push(s?`${s}/${u}`:u)}}};return n(e,""),t.sort()}function W(e){let t=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(e.length===0)return t.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),t.join(`
|
|
3
3
|
`);return t.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...e.map((n)=>` '${n}': true`)," }","}","","export {}",""),t.join(`
|
|
4
|
-
`)}function
|
|
5
|
-
export{
|
|
4
|
+
`)}function dc(e,t){if(!e)return[];let n=v.isAbsolute(e)?e:v.resolve(process.cwd(),e),i=P(n),s=W(i),r=v.join(t,K);try{if(E.existsSync(r)&&E.readFileSync(r,"utf8")===s)return i;E.mkdirSync(t,{recursive:!0}),E.writeFileSync(r,s)}catch{}return i}
|
|
5
|
+
export{lc,uc,dc};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{tu,Im,nu,ru,Om,Nm}from"./chunk-vwwpbhd2.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Nm as applySlots,Om as extractSlotContent,Im as parseSlotElement,tu as parseSlots,ru as processSlots,nu as renderSlot};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{dm}from"./chunk-yr1zx78b.js";import"./chunk-85zmxbt0.js";import"./chunk-58sh82aj.js";import"./chunk-wk4wg6sn.js";import"./chunk-e634vffz.js";import"./chunk-nttsc0aw.js";import"./chunk-yhc1c4tr.js";import"./chunk-r4v4vswq.js";import"./chunk-tnp2ta5q.js";import"./chunk-669b2bya.js";import"./chunk-mfa07erx.js";import"./chunk-x512h2gv.js";import"./chunk-b6w0f610.js";import"./chunk-k7dxm48r.js";import"./chunk-k32q90b2.js";import"./chunk-qa5y30sy.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{dm as startProductionServer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{existsSync as A,mkdtempSync as D,readdirSync as M,rmSync as b,statSync as g,writeFileSync as k}from"fs";import{constants as P,tmpdir as x}from"os";import{join as s}from"path";import t from"process";var _=/^stx-(?:.+-)?p(\d+)-\w{6}$/,v=".stx-keep",I=60000,N=["SIGINT","SIGTERM","SIGHUP"],i=new Set,y=new Set,c=!1,S=new Set;function p(e){try{b(e,{recursive:!0,force:!0})}catch{}}function R(){for(let e of i)p(e);i.clear(),f()}function E(){for(let e of i)p(e);i.clear()}function C(e){if(R(),t.listenerCount(e)===0)t.exit(128+(P.signals[e]??1))}var h=new Map(N.map((e)=>[e,()=>C(e)]));function G(){if(c)return;c=!0,t.on("exit",E);for(let[e,n]of h)try{t.on(e,n)}catch{}}function f(){if(!c)return;c=!1,t.off("exit",E);for(let[e,n]of h)t.off(e,n)}function K(e){try{return t.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function O(e={}){let n=e.root??x(),r=e.isAlive??K,w=e.minAgeMs??I,T=e.now??Date.now(),a=[],u;try{u=M(n)}catch{return a}for(let d of u){let l=_.exec(d);if(!l)continue;let m=Number(l[1]);if(m===t.pid||r(m))continue;let o=s(n,d);try{if(!g(o).isDirectory())continue;if(T-g(o).mtimeMs<w)continue;if(A(s(o,v)))continue}catch{continue}p(o),a.push(o)}return a}function L(e){let n=e.replace(/^stx-/,"").replace(/-+$/,"");return n?`stx-${n}-p${t.pid}-`:`stx-p${t.pid}-`}function z(e=t.env){let n=e.STX_KEEP_TEMP?.trim().toLowerCase();return!!n&&n!=="0"&&n!=="false"}function
|
|
3
|
-
`)}catch{}if(y.add(e),i.delete(e),i.size===0)f()}async function
|
|
4
|
-
export{
|
|
2
|
+
import{existsSync as A,mkdtempSync as D,readdirSync as M,rmSync as b,statSync as g,writeFileSync as k}from"fs";import{constants as P,tmpdir as x}from"os";import{join as s}from"path";import t from"process";var _=/^stx-(?:.+-)?p(\d+)-\w{6}$/,v=".stx-keep",I=60000,N=["SIGINT","SIGTERM","SIGHUP"],i=new Set,y=new Set,c=!1,S=new Set;function p(e){try{b(e,{recursive:!0,force:!0})}catch{}}function R(){for(let e of i)p(e);i.clear(),f()}function E(){for(let e of i)p(e);i.clear()}function C(e){if(R(),t.listenerCount(e)===0)t.exit(128+(P.signals[e]??1))}var h=new Map(N.map((e)=>[e,()=>C(e)]));function G(){if(c)return;c=!0,t.on("exit",E);for(let[e,n]of h)try{t.on(e,n)}catch{}}function f(){if(!c)return;c=!1,t.off("exit",E);for(let[e,n]of h)t.off(e,n)}function K(e){try{return t.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function O(e={}){let n=e.root??x(),r=e.isAlive??K,w=e.minAgeMs??I,T=e.now??Date.now(),a=[],u;try{u=M(n)}catch{return a}for(let d of u){let l=_.exec(d);if(!l)continue;let m=Number(l[1]);if(m===t.pid||r(m))continue;let o=s(n,d);try{if(!g(o).isDirectory())continue;if(T-g(o).mtimeMs<w)continue;if(A(s(o,v)))continue}catch{continue}p(o),a.push(o)}return a}function L(e){let n=e.replace(/^stx-/,"").replace(/-+$/,"");return n?`stx-${n}-p${t.pid}-`:`stx-p${t.pid}-`}function z(e=t.env){let n=e.STX_KEEP_TEMP?.trim().toLowerCase();return!!n&&n!=="0"&&n!=="false"}function Ze(e="stx",n=x()){if(!S.has(n))S.add(n),O({root:n});let r=D(s(n,L(e)));if(z())return H(r),console.warn(`[stx] STX_KEEP_TEMP: keeping ${r}`),r;return G(),i.add(r),r}function ce(e){if(y.has(e))return;if(p(e),i.delete(e),i.size===0)f()}function H(e){try{k(s(e,v),`kept by pid ${t.pid}
|
|
3
|
+
`)}catch{}if(y.add(e),i.delete(e),i.size===0)f()}async function cc(e,n){let r=Ze(e);try{return await n(r)}finally{ce(r)}}
|
|
4
|
+
export{Ze,ce,cc};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{m,p}from"./chunk-qa5y30sy.js";import{ee,L,g}from"./chunk-b6w0f610.js";function z(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function k(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function B(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let f=t.indexOf("-->",s+4);n=f===-1?t.length:f+3;continue}let a=k(t,s+1);if(a===-1)return-1;let u=t.slice(s,a),c=u.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(u))e++}n=a}return-1}function Z(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[2].toLowerCase();if(u[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let f=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let l=d[1]||d[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=f||N.has(c)?-1:B(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!f&&!N.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function j(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[1]==="/",f=u[2].toLowerCase();if(c){let l=i.lastIndexOf(f);if(l!==-1)i.splice(l);e=s;continue}if(f==="template"&&i.length===0){let l=a.match(r);if(l){let h=z(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!N.has(f)){if(i.push(f),f==="script"||f==="style"){let l=t.toLowerCase().indexOf(`</${f}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function tu(t){let o={default:"",named:new Map},i=t,r=j(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=Z(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function Im(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function nu(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r},a=new Set,u=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of c){let[d,l]=f.split(":").map((S)=>S.trim()),h=l||d;if(s[h]=o[d],o[d]!==void 0)u.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else u.add(n);e=I(e,s,a,u)}return e}function I(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(L(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!L(s,r))return e;let a=_(s,o);if(a===void 0)return e;return g(String(a??""))}catch{return`{{ ${n} }}`}})}function _(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!m(t))return;return p(t,Object.keys(o))(...Object.values(o))}catch{return}}async function ru(t,o,i,r){let e=t;e=await W(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,u,c,f)=>{let d=o.named.get(u),l=f?.trim()||"",h=c||"",S={},E=[],C=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=C.exec(h))!==null){let w=b[1],x=b[2];S[w]=_(x,i),E.push([w,x])}if(r!==void 0&&d?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=d.propsBinding.trim(),x=ee(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let M=E.map(([A,P])=>{let O=S[A],R;try{R=O===void 0?void 0:JSON.stringify(O)}catch{}return`${JSON.stringify(A)}:(${R??P})`}).join(","),v=g(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${g(`${y} in [{${M}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${v}">${d.content}</template>`}return await nu(d,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,u,c)=>{if(/\bname\s*=/.test(u||""))return a;let f=c?.trim()||"";return o.default||f}),e}async function W(t,o,i){let r=[],e=[];t.replace(o,(a,...u)=>{let c=u[u.length-2];return e.push({match:a,index:c}),r.push(i(a,...u.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:u,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+u.length)}return s}function Om(t){let o=tu(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Nm(t,o,i,r,e){return await ru(t,{default:o,named:i},r,e)}
|
|
3
|
+
export{tu,Im,nu,ru,Om,Nm};
|