@stacksjs/stx 0.2.917 → 0.2.921
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/app-shell.js +3 -2
- package/dist/chunk-0678sab4.js +2 -0
- package/dist/chunk-0bnv0aaz.js +2 -0
- package/dist/chunk-0bvfm5h5.js +2 -0
- package/dist/chunk-0c3q5h03.js +2 -0
- package/dist/chunk-0fh84wr5.js +2 -0
- package/dist/chunk-0p9x0m5n.js +2 -0
- package/dist/{chunk-ngqb22wj.js → chunk-0rq1w0xr.js} +9 -9
- package/dist/{chunk-t65f98qv.js → chunk-1pc2p489.js} +2 -2
- package/dist/{chunk-1hx6dyy9.js → chunk-1ts1pg90.js} +2 -2
- package/dist/{chunk-h0aw9hmc.js → chunk-29cy41z3.js} +5 -5
- package/dist/{chunk-952dfmcb.js → chunk-2d0pemtc.js} +3 -3
- package/dist/{chunk-0vyytd9v.js → chunk-2qnpr0ty.js} +3 -3
- package/dist/chunk-2r2tayyd.js +3 -0
- package/dist/chunk-2sfxj244.js +2 -0
- package/dist/{chunk-nwef47nx.js → chunk-30d298vs.js} +1 -1
- package/dist/chunk-36j2drjv.js +42 -0
- package/dist/{chunk-pyyda92j.js → chunk-3d0bjcn7.js} +1 -1
- package/dist/chunk-3k9d0h11.js +2 -0
- package/dist/chunk-3mc9ew9r.js +25 -0
- package/dist/chunk-43r0h76m.js +2 -0
- package/dist/{chunk-95j8660f.js → chunk-4f8h38xr.js} +2 -2
- package/dist/{chunk-16sfjkc4.js → chunk-4jg8ddfy.js} +2 -2
- package/dist/chunk-4jh5t3rz.js +2 -0
- package/dist/{chunk-v78hjbz0.js → chunk-4nabpd82.js} +5 -5
- package/dist/{chunk-z110bf2c.js → chunk-4w203ddt.js} +9 -9
- package/dist/chunk-4y2k14ec.js +2 -0
- package/dist/chunk-57xcb1wn.js +2 -0
- package/dist/chunk-5ekbye3p.js +2 -0
- package/dist/chunk-5s1q4y2j.js +2 -0
- package/dist/chunk-6359fekc.js +2 -0
- package/dist/{chunk-sdmq09jw.js → chunk-66cz2ph7.js} +2 -2
- package/dist/chunk-6bm7t0hm.js +3 -0
- package/dist/{chunk-xc5esqcb.js → chunk-6ybq9pfh.js} +2 -2
- package/dist/{chunk-nhyv3w4r.js → chunk-7767n5k6.js} +1 -1
- package/dist/{chunk-0sj79ha5.js → chunk-78j6c3sf.js} +5 -5
- package/dist/{chunk-ftvpz1j4.js → chunk-7d0h2pa3.js} +5 -5
- package/dist/{chunk-1hbf5e1h.js → chunk-7g720sk3.js} +2 -2
- package/dist/chunk-7nshr15z.js +2 -0
- package/dist/{chunk-w98yt4d4.js → chunk-875wejw1.js} +2 -2
- package/dist/chunk-8g6cmgn8.js +2 -0
- package/dist/chunk-8gfdy17b.js +2 -0
- package/dist/{chunk-mgj074y2.js → chunk-8vjsmyrk.js} +5 -5
- package/dist/chunk-8yx65vb0.js +2 -0
- package/dist/{chunk-frpsrv1e.js → chunk-90ps064x.js} +2 -2
- package/dist/chunk-91nwc581.js +2 -0
- package/dist/{chunk-mt5ewkbg.js → chunk-94001bha.js} +6 -6
- package/dist/chunk-94skx5m6.js +2 -0
- package/dist/chunk-9aegppj7.js +2 -0
- package/dist/{chunk-11c7xg1z.js → chunk-9ch2qhbw.js} +1 -1
- package/dist/{chunk-da05660m.js → chunk-9sk596tw.js} +58 -58
- package/dist/{chunk-fn1reean.js → chunk-a3qb13vr.js} +20 -20
- package/dist/chunk-a5vzdhsk.js +2 -0
- package/dist/{chunk-0jdz31q1.js → chunk-a78k8fkg.js} +3 -3
- package/dist/{chunk-jr2r2nh5.js → chunk-ag07tdhn.js} +4 -4
- package/dist/chunk-amnfd29h.js +7 -0
- package/dist/chunk-aqh48tyw.js +2 -0
- package/dist/{chunk-fs43342z.js → chunk-avtq2p0c.js} +2 -2
- package/dist/{chunk-phzhmnnm.js → chunk-ayrd026n.js} +3 -3
- package/dist/{chunk-eptzpvn0.js → chunk-b0kq5mzq.js} +3 -3
- package/dist/chunk-b6am4h24.js +2 -0
- package/dist/{chunk-dwt2drzf.js → chunk-b9z4nb1v.js} +8 -8
- package/dist/{chunk-qsexsrw2.js → chunk-bwnx71s8.js} +5 -5
- package/dist/{chunk-2vx2ben8.js → chunk-c3nmjx26.js} +2 -2
- package/dist/chunk-cajg2sz0.js +2 -0
- package/dist/{chunk-2f5jjxcj.js → chunk-dhx4m7mf.js} +2 -2
- package/dist/chunk-dktqmf4t.js +2 -0
- package/dist/chunk-dqwxyk1m.js +2 -0
- package/dist/chunk-e2kk1d9z.js +2 -0
- package/dist/{chunk-ra2tzsvz.js → chunk-e8aqkt1b.js} +6 -6
- package/dist/{chunk-1jxkc6d0.js → chunk-e8hvbc53.js} +2 -2
- package/dist/{chunk-p3fepzt9.js → chunk-edjzm0vj.js} +3 -3
- package/dist/chunk-ee4ejnk2.js +2 -0
- package/dist/chunk-eezp4a40.js +2 -0
- package/dist/chunk-eh2ynja3.js +2 -0
- package/dist/chunk-emk29htn.js +2 -0
- package/dist/{chunk-va4xam1q.js → chunk-eqj8nj5c.js} +1 -1
- package/dist/{chunk-xnp031ba.js → chunk-f8sh6289.js} +7 -7
- package/dist/{chunk-wj9bqkc0.js → chunk-fb1hyhgf.js} +3 -3
- package/dist/chunk-fd0vnz09.js +2 -0
- package/dist/chunk-fyhtp2nt.js +2 -0
- package/dist/{chunk-ywrpmyzj.js → chunk-g2fxp9zp.js} +3 -3
- package/dist/chunk-gbct53j0.js +2 -0
- package/dist/{chunk-1jvt9t3r.js → chunk-gsm3rk4j.js} +2 -2
- package/dist/{chunk-gfp39bzr.js → chunk-gt9bt8xa.js} +2 -2
- package/dist/{chunk-ar6jeqmm.js → chunk-gxdy4qjj.js} +4 -4
- package/dist/chunk-gxtq25gr.js +2 -0
- package/dist/chunk-h1dnjn9g.js +2 -0
- package/dist/chunk-h4nqjks2.js +2 -0
- package/dist/{chunk-f0sxbgbm.js → chunk-h7z23fpq.js} +2 -2
- package/dist/{chunk-cq4cwfqf.js → chunk-hakevnm1.js} +2 -2
- package/dist/chunk-hn7fv830.js +2 -0
- package/dist/chunk-hx6tr46s.js +1459 -0
- package/dist/chunk-jenk04c8.js +2 -0
- package/dist/{chunk-ezqfrea9.js → chunk-jfy0r3hx.js} +28 -28
- package/dist/{chunk-3jc6yb02.js → chunk-jh007a8k.js} +9 -9
- package/dist/chunk-jh1hdq31.js +3 -0
- package/dist/{chunk-fzcqw147.js → chunk-jk1hzawb.js} +3 -3
- package/dist/{chunk-wm24jx3t.js → chunk-jya12bfn.js} +2 -2
- package/dist/chunk-k1qbgpfy.js +2 -0
- package/dist/chunk-kgmwja6f.js +2 -0
- package/dist/{chunk-91p8p2cc.js → chunk-khf62zkn.js} +6 -6
- package/dist/chunk-kppj8rqa.js +2 -0
- package/dist/{chunk-vayzmvf5.js → chunk-m3ra99h8.js} +6 -6
- package/dist/{chunk-fznjm7qt.js → chunk-m8rzaqm8.js} +2 -2
- package/dist/chunk-msvphygp.js +2 -0
- package/dist/chunk-mzbejejf.js +2 -0
- package/dist/{chunk-8b8az19t.js → chunk-nkgqhb7s.js} +8 -8
- package/dist/{chunk-npj20tj9.js → chunk-p17jeqz0.js} +2 -2
- package/dist/{chunk-bvqgq18r.js → chunk-p97h91zx.js} +2 -2
- package/dist/{chunk-cxsc37fg.js → chunk-pe5sstex.js} +2 -2
- package/dist/chunk-pjv4dskp.js +2 -0
- package/dist/chunk-pqr4gn9b.js +4 -0
- package/dist/{chunk-zv3rn0ch.js → chunk-prj38cyp.js} +6 -6
- package/dist/{chunk-5jc9hmwg.js → chunk-pwg544dw.js} +2 -2
- package/dist/chunk-pxvp0cc9.js +3 -0
- package/dist/{chunk-hhspwfva.js → chunk-q8snpht6.js} +3 -3
- package/dist/chunk-q99y5115.js +3 -0
- package/dist/chunk-qnytvyy0.js +2 -0
- package/dist/{chunk-23x3k751.js → chunk-qzspvwv6.js} +2 -2
- package/dist/chunk-r02asm46.js +2 -0
- package/dist/chunk-r7zvrh58.js +70 -0
- package/dist/chunk-ra35ptjg.js +3 -0
- package/dist/chunk-rc4712qh.js +2 -0
- package/dist/chunk-rq7sg012.js +33 -0
- package/dist/{chunk-302nw40c.js → chunk-rt4gzqs9.js} +1 -1
- package/dist/chunk-rx1xw7q2.js +2 -0
- package/dist/{chunk-36cz2v8k.js → chunk-rzmephr2.js} +31 -31
- package/dist/{chunk-cwcmmgvz.js → chunk-s1x2pc9b.js} +2 -2
- package/dist/{chunk-r7y1196g.js → chunk-s3rhbwgf.js} +4 -4
- package/dist/{chunk-0asdv3hk.js → chunk-s6w14v6h.js} +2 -2
- package/dist/chunk-sdvv8zge.js +3 -0
- package/dist/chunk-sgppgy5e.js +20 -0
- package/dist/chunk-sk7pptzf.js +38 -0
- package/dist/{chunk-w6ydg43d.js → chunk-sk8x8nw8.js} +3 -3
- package/dist/chunk-skjm3zdh.js +2 -0
- package/dist/{chunk-388xpdw5.js → chunk-t4exh7c9.js} +76 -36
- package/dist/{chunk-yq2krsc9.js → chunk-t64mp8x1.js} +6 -6
- package/dist/{chunk-8wqhzzkn.js → chunk-tfpd7aht.js} +3 -3
- package/dist/chunk-tsnzhke9.js +2 -0
- package/dist/{chunk-c13dv3wm.js → chunk-tt6n2mx6.js} +14 -14
- package/dist/chunk-txyze88n.js +2 -0
- package/dist/chunk-v1t7sees.js +2 -0
- package/dist/chunk-vhp5hqwp.js +54 -0
- package/dist/{chunk-88fx8xc1.js → chunk-vn3hsx7v.js} +2 -2
- package/dist/chunk-vt410s5m.js +2 -0
- package/dist/{chunk-mf5cqv1k.js → chunk-w27j0apm.js} +29 -29
- package/dist/{chunk-gg715pj6.js → chunk-w5vxzk5j.js} +6 -6
- package/dist/chunk-w81a1e14.js +9 -0
- package/dist/{chunk-m8n14s3z.js → chunk-wajvxzt0.js} +2 -2
- package/dist/chunk-wrva7jes.js +2 -0
- package/dist/chunk-ws25jw6x.js +6 -0
- package/dist/{chunk-789yp1tg.js → chunk-ww24mxmd.js} +3 -3
- package/dist/chunk-xdprx6tx.js +1331 -0
- package/dist/chunk-xgv3gy1b.js +2 -0
- package/dist/chunk-xjhv5e5f.js +2 -0
- package/dist/{chunk-zkwkhesc.js → chunk-xmy75h5v.js} +2 -2
- package/dist/chunk-xnvh4jk2.js +21 -0
- package/dist/chunk-xtakhmnb.js +2 -0
- package/dist/{chunk-2qk2ppgm.js → chunk-y97g0kwc.js} +1 -1
- package/dist/chunk-y9f9d4zv.js +2 -0
- package/dist/{chunk-p3x84jj0.js → chunk-yfe380a4.js} +2 -2
- package/dist/chunk-ygtz9kc7.js +3 -0
- package/dist/chunk-yyypc7s3.js +2 -0
- package/dist/chunk-z5j4prza.js +2 -0
- package/dist/{chunk-ma5ptt4m.js → chunk-z68teecy.js} +2 -2
- package/dist/cli.js +38 -38
- package/dist/color-mode-boot.d.ts +1 -8
- package/dist/color-mode-boot.js +46 -2
- package/dist/composables/use-media-query.js +23 -22
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/document-shell.d.ts +2 -0
- package/dist/document-shell.js +15 -3
- package/dist/document-tags.d.ts +2 -0
- package/dist/document-tags.js +9 -0
- package/dist/head-injection.d.ts +2 -0
- package/dist/head-injection.js +1 -0
- package/dist/head.d.ts +2 -0
- package/dist/head.js +2 -2
- package/dist/native/accessibility.d.ts +1 -1
- package/dist/native/accessibility.js +5 -3
- package/dist/native/bridge/protocol.d.ts +1 -0
- package/dist/native/compiler/html-to-ir.js +15 -1
- package/dist/native/compiler/ir.d.ts +8 -0
- package/dist/native/components/primitives.d.ts +2 -0
- package/dist/native/event-names.js +6 -0
- package/dist/native/prop-names.js +3 -1
- package/dist/native/runtime/browser-renderer.d.ts +1 -0
- package/dist/native/runtime/browser-renderer.js +27 -6
- package/dist/native/runtime/craft-bridge.js +1 -0
- package/dist/native/runtime/craft.d.ts +3 -0
- package/dist/native/runtime/jsc-globals.js +1 -1
- package/dist/native/runtime/native-media.js +8 -3
- package/dist/native/runtime/shared-screen.js +8 -3
- package/dist/native/testing.d.ts +3 -1
- package/dist/native/testing.js +35 -1
- package/dist/page-head.js +1 -9
- package/dist/process.js +6 -3
- package/dist/pwa.js +3 -3
- package/dist/signal-processing.d.ts +2 -2
- package/dist/signal-processing.js +17 -11
- package/dist/ssg.js +13 -13
- package/dist/types/config-types.d.ts +1 -1
- package/dist/utils.js +2 -1
- package/dist/variable-extractor.js +6 -1
- package/dist/vue-template.d.ts +2 -0
- package/dist/vue-template.js +72 -2
- package/package.json +6 -6
- package/dist/chunk-0adc8x2h.js +0 -9
- package/dist/chunk-0atz8fjx.js +0 -20
- package/dist/chunk-0fm6avxt.js +0 -3
- package/dist/chunk-0v7555tr.js +0 -42
- package/dist/chunk-11rnqey0.js +0 -2
- package/dist/chunk-1mx3j280.js +0 -2
- package/dist/chunk-20hy5p3p.js +0 -2
- package/dist/chunk-29v3b5ks.js +0 -2
- package/dist/chunk-2cay3heb.js +0 -2
- package/dist/chunk-31yx4sjh.js +0 -2
- package/dist/chunk-33fnbw33.js +0 -2
- package/dist/chunk-357qjcj1.js +0 -3
- package/dist/chunk-38kerh2r.js +0 -2
- package/dist/chunk-38y11q8x.js +0 -2
- package/dist/chunk-3h4db9yb.js +0 -33
- package/dist/chunk-3q80f7mt.js +0 -2
- package/dist/chunk-43kz6rx9.js +0 -2
- package/dist/chunk-43sgpy4e.js +0 -54
- package/dist/chunk-4e18r89n.js +0 -3
- package/dist/chunk-4pve3r5a.js +0 -2
- package/dist/chunk-4vz17ytv.js +0 -68
- package/dist/chunk-5afnyvw5.js +0 -2
- package/dist/chunk-5d5dxts6.js +0 -2
- package/dist/chunk-5fdsyyfe.js +0 -2
- package/dist/chunk-67yr4m5h.js +0 -2
- package/dist/chunk-6aqr0e6s.js +0 -2
- package/dist/chunk-6bw02d1t.js +0 -2
- package/dist/chunk-76mn123c.js +0 -2
- package/dist/chunk-7ar11ccn.js +0 -2
- package/dist/chunk-7fc0vrs5.js +0 -2
- package/dist/chunk-82fg5gp6.js +0 -2
- package/dist/chunk-89r7bbsk.js +0 -2
- package/dist/chunk-8egbh6z1.js +0 -2
- package/dist/chunk-8n9jd8cz.js +0 -2
- package/dist/chunk-8tfpv6zf.js +0 -6
- package/dist/chunk-8x3yaahc.js +0 -2
- package/dist/chunk-94qc4zwb.js +0 -2
- package/dist/chunk-9928zdej.js +0 -3
- package/dist/chunk-9ay18k46.js +0 -2
- package/dist/chunk-9kn81bmp.js +0 -2
- package/dist/chunk-9tv0tw7f.js +0 -3
- package/dist/chunk-9w9y84t5.js +0 -21
- package/dist/chunk-a5h9bwrc.js +0 -2
- package/dist/chunk-b5qzed8y.js +0 -1323
- package/dist/chunk-bej9kz05.js +0 -2
- package/dist/chunk-bh2khcet.js +0 -2
- package/dist/chunk-bm6y085n.js +0 -25
- package/dist/chunk-c6096ssb.js +0 -2
- package/dist/chunk-ccgabq3a.js +0 -2
- package/dist/chunk-e0tvd7jj.js +0 -2
- package/dist/chunk-e5rag6rh.js +0 -3
- package/dist/chunk-fvr3h2fr.js +0 -7
- package/dist/chunk-gmmqz698.js +0 -2
- package/dist/chunk-hxftzw0x.js +0 -2
- package/dist/chunk-js1wayhb.js +0 -2
- package/dist/chunk-jz37h2z0.js +0 -4
- package/dist/chunk-k2t0w8z1.js +0 -2
- package/dist/chunk-k8s3hyh2.js +0 -2
- package/dist/chunk-kcpxqsdj.js +0 -2
- package/dist/chunk-mjr5fkc2.js +0 -2
- package/dist/chunk-n4m50dpk.js +0 -1467
- package/dist/chunk-na0e3s88.js +0 -2
- package/dist/chunk-new89wh2.js +0 -2
- package/dist/chunk-nrap20qt.js +0 -2
- package/dist/chunk-p9bghe13.js +0 -2
- package/dist/chunk-q2cwzgd0.js +0 -2
- package/dist/chunk-q60afqr7.js +0 -2
- package/dist/chunk-q9yahsww.js +0 -2
- package/dist/chunk-qdwtemy1.js +0 -2
- package/dist/chunk-qp0ndbk6.js +0 -2
- package/dist/chunk-rzsvxjse.js +0 -2
- package/dist/chunk-s2c0ynn9.js +0 -2
- package/dist/chunk-senrtnx2.js +0 -2
- package/dist/chunk-v1wr2vdx.js +0 -2
- package/dist/chunk-v6gkjg5f.js +0 -3
- package/dist/chunk-wc10m4tp.js +0 -38
- package/dist/chunk-wcxa8xy2.js +0 -2
- package/dist/chunk-wgrj0cvs.js +0 -2
- package/dist/chunk-wpkwx3wq.js +0 -2
- package/dist/chunk-wq17dce6.js +0 -2
- package/dist/chunk-wvc6eayq.js +0 -2
- package/dist/chunk-xa98a901.js +0 -2
- package/dist/chunk-xjt5129x.js +0 -2
- package/dist/chunk-yc3frw0z.js +0 -3
- package/dist/chunk-yn02d599.js +0 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.921",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -127,14 +127,14 @@
|
|
|
127
127
|
},
|
|
128
128
|
"dependencies": {
|
|
129
129
|
"@stacksjs/clapp": "^0.2.17",
|
|
130
|
-
"@stacksjs/desktop": "0.2.
|
|
131
|
-
"@stacksjs/sanitizer": "0.2.
|
|
132
|
-
"@stacksjs/ts-css": "^0.3.
|
|
130
|
+
"@stacksjs/desktop": "0.2.921",
|
|
131
|
+
"@stacksjs/sanitizer": "0.2.921",
|
|
132
|
+
"@stacksjs/ts-css": "^0.3.27",
|
|
133
133
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
134
134
|
"@types/dom-speech-recognition": "^0.0.12",
|
|
135
|
-
"bun-plugin-stx": "0.2.
|
|
135
|
+
"bun-plugin-stx": "0.2.921",
|
|
136
136
|
"bunfig": "^0.15.21",
|
|
137
|
-
"stx-router": "0.2.
|
|
137
|
+
"stx-router": "0.2.921",
|
|
138
138
|
"ts-broadcasting": "^0.0.13",
|
|
139
139
|
"ts-images": "^0.2.22",
|
|
140
140
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-0adc8x2h.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{T}from"./chunk-0jdz31q1.js";import{Ul}from"./chunk-9928zdej.js";var t=new T(256,{maxBytes:16777216,sizeOf:(n)=>n.source.length*2});function Z(n){let r=t.get(n);if(r)return r.asynchronous;let s=o(n);return t.set(n,{source:n,asynchronous:s}),s}function o(n){let r=new Bun.Transpiler({loader:"js"});if(Ul(n))return r.transformSync(`(async function(){
|
|
3
|
-
${n}
|
|
4
|
-
})()`),!0;try{return r.transformSync(`(function(){
|
|
5
|
-
${n}
|
|
6
|
-
})()`),!1}catch{return r.transformSync(`(async function(){
|
|
7
|
-
${n}
|
|
8
|
-
})()`),!0}}
|
|
9
|
-
export{Z};
|
package/dist/chunk-0atz8fjx.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Z}from"./chunk-0adc8x2h.js";import{yr,He}from"./chunk-cwcmmgvz.js";import{G,k,Mr,to,A}from"./chunk-b5qzed8y.js";import{a,j}from"./chunk-mf5cqv1k.js";import{ri}from"./chunk-0sj79ha5.js";import{gt}from"./chunk-zkwkhesc.js";import{l}from"./chunk-4e18r89n.js";import{t,h}from"./chunk-fvr3h2fr.js";import d from"path";import E from"fs";import{AsyncLocalStorage as lt}from"async_hooks";import{randomUUID as St}from"crypto";var vt=12;function X(e,n,s){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(d.basename(e))||ri(e,n,s)}var ct=2;function tg(e){let n=process.env.STX_BUNDLE_CACHE_DIR?.trim();return n?d.resolve(n):l(e,"bundle-cache")}function rt(e,n){let s=e;for(let i of Bt(n))if(i!==d.sep)s=s.split(i).join("\x00root");return s}var it=new Map;function Bt(e){let n=d.resolve(e),s=it.get(n);if(!s){let i=n;try{i=E.realpathSync(n)}catch{}s=[...new Set([n,i])].sort((c,p)=>p.length-c.length),it.set(n,s)}return s}function jt(e,n){try{let s=E.statSync(e),i=d.resolve(n),c=e.startsWith(`${i}${d.sep}`);return{path:c?d.relative(i,e):e,...c?{inRoot:!0}:{},mtimeMs:s.mtimeMs,size:s.size,hash:Bun.hash(E.readFileSync(e)).toString(36)}}catch{return null}}function ut(e,n){return e.inRoot?d.join(d.resolve(n),e.path):e.path}function Et(e,n){for(let s of e){let i=ut(s,n);try{let c=E.statSync(i);if(c.size!==s.size)return!1;if(c.mtimeMs!==s.mtimeMs&&Bun.hash(E.readFileSync(i)).toString(36)!==s.hash)return!1}catch{return!1}}return!0}var dt=new Map,_t=100;function ng(e=process.env){let n=Number(e.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(n)&&n>=1?Math.floor(n):2000}var q=new Map;async function Mt(e){let n=q.get(e)??0;if(n>0&&n<_t){q.set(e,n+1);return}q.set(e,1);try{let s=(await E.promises.readdir(e)).filter((o)=>o.endsWith(".js")),i=ng();if(s.length<=i)return;let p=(await Promise.all(s.map(async(o)=>{try{return{name:o,at:(await E.promises.stat(d.join(e,o))).mtimeMs}}catch{return null}}))).filter((o)=>o!==null);p.sort((o,w)=>w.at-o.at);for(let o of p.slice(i)){let w=o.name.slice(0,-3);await E.promises.rm(d.join(e,`${w}.js`),{force:!0}),await E.promises.rm(d.join(e,`${w}.deps.json`),{force:!0})}T("pruned bundle cache to",i,"entries")}catch{}}function $e(e){return dt.get(e)??[]}function Y(e,n){if(e)dt.set(e,n)}function rg(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function T(...e){if(rg())console.log("[stx:bundler]",...e)}var et=[];function Pc(e,n,s){et.push({filePath:e||"<inline>",message:n,details:s})}function mn(){return et.slice()}function hn(){et.length=0}var K;function iy(e){K=e}function Ic(){if(K)return K;try{let e=j.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var tt=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function yn(e){let n=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,s;while((s=n.exec(e))!==null){let c=s[1];if(!tt.some((o)=>o.test(c)))return T("detected user import:",c),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((s=i.exec(e))!==null){let c=s[1];if(/\.css(?:\?.*)?$/.test(c))continue;if(!tt.some((o)=>o.test(c)))return T("detected side-effect import:",c),!0}return!1}var hr="stx-module:",Rt=/\.(?:[cm]?[jt]sx?|json)$/i;function sg(e,n){return d.relative(e,n).split(d.sep).join("/")}function og(e,n){if(n.size===0)return e;return e.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(s,i,c,p)=>{let o=n.get(p);return o&&!p.startsWith(hr)?`${i}${c}${o}${c}`:s})}function ig(e,n){let s=0,i=(p)=>{let o=`__stxMod${s++}`,w=JSON.stringify(p);return n.push(`var ${o} = globalThis.__stxModules && globalThis.__stxModules[${w}];`,`if (${o} === undefined) throw new Error("[stx] module " + ${JSON.stringify(w)} + " is not registered on this page (#1957)");`),o},c=(p,o)=>{for(let w of p.split(",")){let C=w.trim();if(!C)continue;let R=C.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!R)continue;let S=R[1].startsWith('"')?JSON.parse(R[1]):R[1],f=R[2]??S;n.push(`var ${f} = ${o}[${JSON.stringify(S)}];`)}};return e=e.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,o,w)=>{let C=w.slice(hr.length),R=i(C),S=o.trim(),f=S.match(/^([\w$]+)\s*(?:,\s*|$)/);if(f&&!S.startsWith("{")&&!S.startsWith("*"))n.push(`var ${f[1]} = ${R}.default;`),S=S.slice(f[0].length).trim();let v=S.match(/^\*\s*as\s+([\w$]+)$/);if(v)n.push(`var ${v[1]} = ${R};`);else if(S.startsWith("{"))c(S.replace(/^\{|\}$/g,""),R);return""}),e=e.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,o)=>(i(o.slice(hr.length)),"")),e}function ot(e){let n=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,d.join(e,"index.ts"),d.join(e,"index.tsx"),d.join(e,"index.js"),d.join(e,"index.mjs")];for(let s of n)try{if(E.existsSync(s)&&E.statSync(s,{throwIfNoEntry:!1})?.isFile())return s}catch{}return}var H=new lt;function Cs(e,n){let s=new Bun.CryptoHasher("md5");for(let[i,c]of[...e].sort(([p],[o])=>p<o?-1:p>o?1:0))s.update(`${i}\x00${c}\x00`);return H.run({modules:e,key:s.digest("hex").slice(0,12)},n)}var pt=new lt;function ag(e){return pt.run(!0,e)}function cg(){return pt.getStore()===!0}function Oc(e){if(!cg())return;throw Error(`The client script of ${e} needs bundling, and it is being rendered inside a Bun.build loader, where Bun never finishes a second build. Make the page an entrypoint of the build (bun-plugin-stx renders entrypoints before the bundler starts), or render it once outside the build so its bundle is cached.`)}function bn(){return H.getStore()?.key??""}function ft(e,n,s,i,c,p,o=new Map,w,C,R){let S=new Map([[s,i],...R??[]]),f=(B)=>B!==void 0&&S.has(B),v=(B,r,u)=>{if(X(r,e,w))return null;if(!p||!f(B)||!Rt.test(r))return null;try{if(!E.statSync(r,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}c.add(r);let _=`${hr}${sg(process.cwd(),r)}`;return o.set(u,_),{path:_,external:!0}},b=(B,r)=>{let u=f(B)?n:d.dirname(B),_=d.resolve(u,r);return ot(_)??_};return{name:"stx-client-bundle",setup(B){if(B.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(r)=>({path:r.path,external:!0})),B.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(r)=>({path:r.path,external:!0})),B.onResolve({filter:/^\//},(r)=>{if(f(r.path))return{path:r.path};let u=ot(r.path);if(u){let _=v(r.importer,u,r.path);if(_)return _;if(!f(u))c.add(u);return{path:u}}return{path:r.path,external:!0}}),B.onResolve({filter:/^\.\.?\//},(r)=>{let u=b(r.importer,r.path),_=v(r.importer,u,r.path);if(_)return _;return c.add(u),{path:u}}),B.onResolve({filter:/^[@~]\//},(r)=>{let u=d.resolve(e,r.path.slice(2)),_=[u,`${u}.ts`,`${u}.tsx`,`${u}.js`,`${u}.mjs`,`${u}.jsx`,d.join(u,"index.ts"),d.join(u,"index.tsx"),d.join(u,"index.js"),d.join(u,"index.mjs")];for(let x of _)if(E.existsSync(x)&&E.statSync(x,{throwIfNoEntry:!1})?.isFile()){let D=v(r.importer,x,r.path);if(D)return D;return T(`resolved ${r.path[0]}/ import:`,r.path,"\u2192",x),c.add(x),{path:x}}return console.warn(`[stx:bundler] could not resolve ${r.path[0]}/ import:`,r.path),{path:u}}),p)B.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(r)=>{if(!f(r.importer))return;let u=`${hr}npm:${r.path}`;return o.set(r.path,u),{path:u,external:!0}});B.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(r)=>{if(S.has(r.path))return{contents:S.get(r.path),loader:"ts"};if(X(r.path,e,w))throw Error(`Server-only API source cannot be imported by a client script: ${r.path}`);let u=d.extname(r.path).toLowerCase(),_=u===".json"?"json":u===".tsx"?"tsx":u===".jsx"?"jsx":u===".ts"||u===".mts"||u===".cts"?"ts":"js";if(!f(r.path))c.add(r.path);let x=C?.get(r.path);if(x!==void 0)return{contents:x,loader:"js"};return{contents:E.readFileSync(r.path,"utf8"),loader:_}})}}}var Q=new Map,V=k(64),at=Symbol.for("stx.client-bundle-build-queue");function lg(e){let n=globalThis,i=(n[at]??Promise.resolve()).then(e,e);return n[at]=i.then(()=>{return},()=>{return}),i}async function wn(e,n,s={}){let i=s.projectRoot||process.cwd(),c=(await a(i)).serverApi,p=s.minify??!1,o=s.externalizeUserModules??!0,w=s.expose?.length?[...new Set(s.expose)].sort():void 0,C=s.cacheDir||tg(i),R=H.getStore(),S=new Bun.CryptoHasher("md5");S.update(`${vt}\x00${gt()}\x00${JSON.stringify(c??!1)}\x00${o?"registry":"inline"}\x00${w?w.join(","):"*"}\x00${p?"minified":"readable"}\x00${R?.key??""}\x00${rt(e,i)}\x00${rt(n,i)}`);let f=S.digest("hex").slice(0,12),v=d.join(C,`${f}.js`),b=V.get(v);if(b){if(to(b.files)&&b.files.every((x)=>!X(x.path,i,c))){T("memo hit:",f);let x=b.files.map((D)=>D.path);return Y(n,x),s.collectInputs?.push(...x),b.code}V.delete(v),T("memo invalidated by dep change:",f)}let B=d.join(C,`${f}.deps.json`),r=Bun.file(v);if(await r.exists()){let x=Bun.file(B),D=!1,N=null;if(await x.exists())try{let O=JSON.parse(await x.text());if(O.metadataVersion===ct&&Array.isArray(O.files)&&Et(O.files,i))N=Mr(O.files.map((g)=>ut(g,i))),D=N.length===O.files.length&&!N.some((g)=>X(g.path,i,c))}catch{D=!1}if(D){if(T("cache hit:",f),N)Y(n,N.map((L)=>L.path)),s.collectInputs?.push(...N.map((L)=>L.path));let O=await r.text(),g=new Date;if(E.promises.utimes(v,g,g).catch(()=>{}),N)V.set(v,{code:O,files:N});return O}T("cache invalidated by dep change:",f)}let u=Q.get(f);if(u){let x=await u;if(s.collectInputs)s.collectInputs.push(...(V.get(v)?.files??[]).map((D)=>D.path));return x}Oc(n);let _=lg(()=>Ft(e,n,{projectRoot:i,minify:p,cacheDir:C,hash:f,cachePath:v,depsPath:B,collectInputs:s.collectInputs,externalizeUserModules:o,serverApi:c,expose:w,throwOnFailure:s.throwOnFailure,substitutes:R?.modules}));Q.set(f,_);try{return await _}finally{Q.delete(f)}}function Nc(e){return`${e}-${process.pid}-${St()}`}async function ay(e,n){let{projectRoot:s}=n,i=Nc(new Bun.CryptoHasher("md5").update([...e.keys()].join("\x00")).digest("hex").slice(0,12)),c=d.join(l(s,"bundle-tmp"),"out",i);E.mkdirSync(c,{recursive:!0});let p=new Map,o=new Map,w=0;for(let[f,v]of e){let b=d.join(s,`.stx-split-${i}-${w++}.ts`);p.set(b,v),o.set(d.basename(b).replace(/\.ts$/,""),f)}let[C,R]=[...p][0],S=new Set;Oc(n.filePath);try{let f=await Bun.build({entrypoints:[...p.keys()],outdir:c,target:"browser",format:"esm",splitting:!0,minify:!1,naming:{entry:"[name].js",chunk:"chunk-[hash].js"},plugins:[ft(s,d.dirname(n.filePath),C,R,S,!1,new Map,void 0,H.getStore()?.modules,p)],define:{"process.env.NODE_ENV":'"development"',...A()},root:s});if(!f.success)throw Error(f.logs.filter((b)=>b.level==="error").map((b)=>b.message).join(", ")||"Unable to bundle the entries");let v={entries:new Map,chunks:new Map};for(let b of f.outputs){let B=d.basename(b.path);if(b.kind==="entry-point"){let r=o.get(B.replace(/\.js$/,""));if(r!==void 0)v.entries.set(r,await b.text())}else if(b.kind==="chunk")v.chunks.set(B.replace(/\.js$/,""),await b.text())}return n.collectInputs?.push(...S),v}finally{try{E.rmSync(c,{recursive:!0,force:!0})}catch{}}}async function Ft(e,n,s){let{projectRoot:i,minify:c,cacheDir:p,hash:o,cachePath:w,depsPath:C,externalizeUserModules:R}=s,S=l(i,"bundle-tmp"),f=Nc(o),v=d.join(i,`.stx-client-${f}.ts`),b=d.join(S,"out",f);E.mkdirSync(b,{recursive:!0});let B=d.dirname(n),r=new Set,u=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,_=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,x=t(e),{depths:D,balanced:N}=h(x),O=(F)=>!N||D[F]===0,g;while((g=u.exec(x))!==null){if(g[1])continue;if(!O(g.index))continue;if(g[2])g[2].split(",").forEach((F)=>{let m=It(F);if(m)r.add(m)});else if(g[3])r.add(g[3])}while((g=_.exec(x))!==null){if(g[1])continue;if(!O(g.index))continue;r.add(g[2])}let L=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=L.exec(x))!==null){if(!O(g.index))continue;let F=/^\s*['"]([^'"]+)['"]/.exec(e.slice(g.index+g[0].length))?.[1];if(F&&tt.some((m)=>m.test(F)))continue;if(g[1])r.add(g[1]);if(g[2])r.add(g[2]);for(let m of(g[3]??"").split(",")){let M=m.trim();if(!M||/^type\s/.test(M))continue;let P=/\bas\s+(\w+)\s*$/.exec(M)?.[1]??/^\w+$/.exec(M)?.[0];if(P)r.add(P)}}for(let F of x.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let m of F[1].split(",")){let M=/\bas\s+(\w+)\s*$/.exec(m)?.[1]??/^\s*(\w+)\s*$/.exec(m)?.[1];if(M)r.delete(M)}let mt=r.size>0?`
|
|
3
|
-
export { ${[...r].join(", ")} }`:"";T("bundling:",o,"from:",d.basename(n));let nt=new Set,st=new Map;try{let F=await Bun.build({entrypoints:[v],outdir:b,target:"browser",format:"esm",minify:c?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[ft(i,B,v,e+mt,nt,R,st,s.serverApi,s.substitutes)],define:{"process.env.NODE_ENV":c?'"production"':'"development"',...A()},root:i});if(!F.success){let I=F.logs.filter((U)=>U.level==="error").map((U)=>U.message).join(", ")||`Unable to bundle ${d.basename(n)}`,z=yr(F.logs,n||void 0);if(console.warn("[stx:bundler] build failed:",I),Pc(n||"",I,z),s.throwOnFailure||Ic()==="error")throw Error(I);return e}let m="";for(let y of F.outputs){m=await y.text();break}let M=[];for(let y of m.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let I of y[1].split(",")){let z=I.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(z){M.push([z[2],z[1]]);continue}let U=I.trim();if(/^[A-Za-z_$][\w$]*$/.test(U))M.push([U,U])}if(s.expose){let y=new Set(s.expose);for(let I=M.length-1;I>=0;I--)if(!y.has(M[I][0]))M.splice(I,1)}let P=[];m=ig(og(m,st),P);let ht=m.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(m=m.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),c&&m)try{m=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(m)}catch{}let xt=Z(m),W=`__stxBundle_${o}`,yt=new Set(G(e,!0).split(",").map((y)=>y.trim())),$t=M.map(([y,I])=>`get ${JSON.stringify(y)}() { return ${I} }${yt.has(y)?`, set ${JSON.stringify(y)}(__stxValue_${I}) { ${I} = __stxValue_${I} }`:""}`).join(", "),bt=M.map(([y])=>`var ${y} = undefined;`).join(`
|
|
4
|
-
`),wt=M.map(([y])=>`${y} = ${W}[${JSON.stringify(y)}];`).join(`
|
|
5
|
-
`);if(m=`${ht.join(`
|
|
6
|
-
`)}
|
|
7
|
-
${bt}
|
|
8
|
-
var ${W} = ${xt?"await (async function":"(function"}() {
|
|
9
|
-
${P.join(`
|
|
10
|
-
`)}
|
|
11
|
-
${m}
|
|
12
|
-
return { ${$t} };
|
|
13
|
-
})();
|
|
14
|
-
${wt}
|
|
15
|
-
var __stxLiveBindings = typeof __stxLiveBindings === 'undefined' ? {} : __stxLiveBindings;
|
|
16
|
-
Object.keys(${W}).forEach(function(name) {
|
|
17
|
-
if (!Object.prototype.hasOwnProperty.call(__stxLiveBindings, name))
|
|
18
|
-
Object.defineProperty(__stxLiveBindings, name, Object.getOwnPropertyDescriptor(${W}, name));
|
|
19
|
-
});`.trim(),T("bundled:",o,"output:",m.length,"bytes"),r.size>0&&M.length===0)return console.warn(`[stx:bundler] dropped every binding for ${d.basename(n)} (${o}); serving the unbundled source and not caching this result`),e;E.mkdirSync(p,{recursive:!0}),await Bun.write(w,m);let J=Mr(nt);return await Bun.write(C,JSON.stringify({metadataVersion:ct,files:J.map((y)=>jt(y.path,i)).filter((y)=>y!==null)})),Y(n,J.map((y)=>y.path)),s.collectInputs?.push(...J.map((y)=>y.path)),V.set(w,{code:m,files:J}),await Mt(p),m}catch(F){let m=yr(F,n||void 0),M=He(F,n||void 0);if(console.warn(`[stx:bundler] error: ${M}`),Pc(n||"",M,m),s.throwOnFailure||Ic()==="error")throw F;return e}finally{try{E.rmSync(b,{recursive:!0,force:!0})}catch{}}}function It(e){let n=e.trim();if(!n)return null;let s=n.indexOf("=");if(s!==-1)n=n.slice(0,s).trim();let i=n.indexOf(":");if(i!==-1)n=n.slice(i+1).trim();if(n.startsWith("..."))n=n.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(n)?n:null}
|
|
20
|
-
export{tg,ng,$e,rg,Pc,mn,hn,iy,Ic,yn,hr,sg,og,ig,Cs,ag,cg,Oc,bn,lg,wn,Nc,ay};
|
package/dist/chunk-0fm6avxt.js
DELETED
package/dist/chunk-0v7555tr.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Xl,Gl}from"./chunk-16sfjkc4.js";import{J,Nr,Zs,Qs,Ii,Ni,eo,Ne,Xe,ke,se,Lr,jr,he,oe,F,mt,Br,io,Hr,Qe,s,g,Y,Mn}from"./chunk-b5qzed8y.js";import{m,M,Ee,p}from"./chunk-4vz17ytv.js";import{r}from"./chunk-0fm6avxt.js";import{ge}from"./chunk-9tv0tw7f.js";import{Sr}from"./chunk-1hx6dyy9.js";import{w}from"./chunk-v6gkjg5f.js";import{t}from"./chunk-fvr3h2fr.js";import{createHash as At}from"crypto";import K from"fs";import G from"path";import ze from"fs";function Ae(e,i,n){let o=Buffer.alloc(n),a=ze.readSync(e,o,0,n,i);return o.subarray(0,a)}function Fe(e){if(e.length<25)return!1;let i=(o,a)=>String.fromCharCode(...e.subarray(o,a));if(i(0,4)!=="RIFF"||i(8,12)!=="WEBP")return!1;let n=i(12,16);if(n==="VP8X")return(e[20]&16)!==0;if(n==="VP8L")return((e[21]|e[22]<<8|e[23]<<16|e[24]<<24)>>>28&1)===1;return!1}function Ue(e){let i;try{i=ze.openSync(e,"r");let n=Ae(i,0,33);if(n.length>=3&&n[0]===255&&n[1]===216&&n[2]===255)return"none";if(n.length>=26&&n[0]===137&&n.toString("latin1",1,4)==="PNG"){let o=n[25];if(o===4||o===6)return"possible";let a=8;for(let c=0;c<64;c++){let l=Ae(i,a,8);if(l.length<8)return"unknown";let u=l.toString("latin1",4,8);if(u==="tRNS")return"possible";if(u==="IDAT"||u==="IEND")return"none";a+=12+l.readUInt32BE(0)}return"unknown"}if(n.length>=25&&n.toString("latin1",0,4)==="RIFF"&&n.toString("latin1",8,12)==="WEBP"){if(Fe(n))return"possible";let o=n.toString("latin1",12,16);return o==="VP8 "||o==="VP8X"?"none":"unknown"}return"unknown"}catch{return"unknown"}finally{if(i!==void 0)ze.closeSync(i)}}import sn from"fs";import We from"os";import{fileURLToPath as bt}from"url";var Ie=Symbol("stx.image-worker.unavailable");function on(e=typeof We.availableParallelism==="function"?We.availableParallelism():We.cpus().length){return Math.max(1,Math.min(2,e-1))}var Pe=0,vt=[];async function an(){if(Pe<on()){Pe++;return}await new Promise((e)=>vt.push(e)),Pe++}function cn(){Pe--,vt.shift()?.()}var ln="@stacksjs/stx/builtins/image-warmup-worker";function un(e=process.cwd()){let i=import.meta.url.endsWith(".ts")?"ts":"js";try{let n=new URL(`./image-warmup-worker.${i}`,import.meta.url);if(n.protocol==="file:"&&sn.existsSync(bt(n)))return bt(n)}catch{}return Sr(ln,e)}var xt=!1;function ue(e){if(!xt)xt=!0,console.warn(`[stx] image worker unavailable (${e}); running the image pass on the serving thread instead. Results are the same, but requests may stall while it runs.`);return Ie}function _e(e){return e instanceof Error?e.message:String(e)}async function He(e,i){let n;try{n=(await import("worker_threads")).Worker}catch(a){return ue(`could not load node:worker_threads: ${_e(a)}`)}if(typeof n!=="function")return ue("node:worker_threads has no Worker in this runtime");let o=un();if(!o)return ue("no image-warmup-worker entry beside this module or in the installed @stacksjs/stx");await an();try{return await new Promise((a,c)=>{let l;try{l=new n(o)}catch(h){a(ue(`could not start ${o}: ${_e(h)}`));return}let u=!1,f=!1,v=(h)=>{if(f)return;f=!0,h(),l.terminate()};l.on("message",(h)=>{if(h.type==="ready"){u=!0,l.postMessage({task:e,args:i});return}if(h.type==="result"){v(()=>a(h.value));return}let d=Error(h.error?.message??"image worker failed");if(h.error?.name)d.name=h.error.name;if(h.error?.stack)d.stack=h.error.stack;v(()=>c(d))}),l.on("error",(h)=>{v(()=>u?c(h instanceof Error?h:Error(_e(h)||"image worker crashed")):a(ue(`the worker failed before it was ready: ${_e(h)}`)))}),l.on("exit",(h)=>{v(()=>u?c(Error("image worker exited before it finished")):a(ue(`the worker exited with code ${h} before it was ready`)))})})}finally{cn()}}var fn=new Set([".avif",".jpeg",".jpg",".png",".webp"]),dn=[320,640,960,1280,1920],ve="/_stx/images",gn=`stx:${ve}:alpha-1`,pn=`stx:${ve}:opaque-1`,mn=["@stacksjs/ts-webp","@stacksjs/ts-avif","ts-images"],Oe;function hn(e,i){let n=G.dirname(Bun.resolveSync(e,i));while(n!==G.dirname(n)){let o=G.join(n,"package.json");if(K.existsSync(o)){let a=JSON.parse(K.readFileSync(o,"utf8"));if(a.name===e)return a.version}n=G.dirname(n)}return}function wt(){if(Oe!==void 0)return Oe;let e;try{e=G.dirname(Bun.resolveSync("ts-images",import.meta.dir))}catch{}return Oe=mn.map((i)=>{let n;try{n=e?hn(i,e):void 0}catch{}return`${i.replace("@stacksjs/","")}@${n??"unknown"}`}).join("+"),Oe}var $t=Symbol.for("stx.image-delivery");function we(){let e=globalThis;return e[$t]??={catalog:new Map,transparent:new Set},e[$t]}var St=new Set;function yn(e){return`/${e.split(G.sep).map(encodeURIComponent).join("/")}`}function bn(e){let i=G.extname(e),n=e.slice(0,-i.length).replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,""),o=At("sha256").update(e).digest("hex").slice(0,8);return`${n||"image"}-${o}`}function Ct(e,i=`stx:${ve}`){let n=(o)=>`${ve}/${o.split("/").map(encodeURIComponent).join("/")}`;return{cacheNamespace:i,async stat(o){let a=G.join(e,o);try{let c=await K.promises.stat(a);return c.size>0?{bytes:c.size,path:a,url:n(o)}:null}catch{return null}},async write(o,a){let c=G.join(e,o);await K.promises.mkdir(G.dirname(c),{recursive:!0});let l=`${c}.${process.pid}.tmp`;return await K.promises.writeFile(l,a),await K.promises.rename(l,c),{bytes:a.byteLength,path:c,url:n(o)}},url:n}}async function _t(e,i=e){let n=await K.promises.readdir(i,{withFileTypes:!0});n.sort((a,c)=>a.name.localeCompare(c.name));let o=[];for(let a of n){let c=G.join(i,a.name);if(a.isDirectory()){if(i===e&&a.name==="_stx")continue;o.push(...await _t(e,c));continue}if(!a.isFile()||!fn.has(G.extname(a.name).toLowerCase()))continue;o.push({absolutePath:c,relativePath:G.relative(e,c)})}return o}function Rt(e,i){return e.map((n)=>({key:yn(n.relativePath),input:n.absolutePath,name:bn(n.relativePath),...xn(n.absolutePath)?{options:{storage:i}}:{}}))}function xn(e){return Ue(e)==="possible"}function vn(e){for(let i=3;i<e.length;i+=4)if(e[i]!==255)return!0;return!1}async function wn(e){let i=Object.entries(e).filter(([,c])=>c.fallback.format==="png"),n=new Set,o=8;if(i.length===0)return n;let{decode:a}=await import("ts-images");for(let c=0;c<i.length;c+=8)await Promise.all(i.slice(c,c+8).map(async([l,u])=>{let f=u.variants.filter((v)=>v.format==="png").sort((v,h)=>v.width-h.width)[0];try{let v=await a(new Uint8Array(await K.promises.readFile(f?.path??u.fallback.path)));if(vn(v.data))n.add(l)}catch{n.add(l)}}));return n}function $n(e,i){let n=[];for(let o of i){let a=e[o],c=a?.variants.filter((u)=>u.format==="webp")??[];if(!a||c.length===0)continue;if(!c.some((u)=>{let f;try{return f=K.openSync(u.path,"r"),!Fe(Ae(f,0,32))}catch{return!0}finally{if(f!==void 0)K.closeSync(f)}}))continue;if(a.variants=a.variants.filter((u)=>u.format!=="webp"),delete a.sources.webp,n.push(o),!St.has(o))St.add(o),console.warn(`[stx-images] ${o} is transparent but its WebP variants have no alpha channel; serving PNG instead. Upgrade @stacksjs/ts-webp to 0.1.6 or later.`)}return n}async function Sn(e){let i=[],n=8;if(e.length===0)return i;let{generateThumbHash:o}=await import("ts-images");for(let a=0;a<e.length;a+=8){let c=e.slice(a,a+8),l=await Promise.all(c.map(async(u)=>{try{return await o(u.absolutePath),u}catch{return console.warn(`[stx-images] Skipping unreadable raster: ${u.relativePath}`),null}}));i.push(...l.filter((u)=>u!==null))}return i}function qe(e){return G.join(e,"undecodable.json")}function Cn(e){try{let i=K.readFileSync(qe(e),"utf-8"),n=JSON.parse(i);return n&&typeof n==="object"?n:{}}catch{return{}}}function Rn(e,i){try{K.mkdirSync(G.dirname(qe(e)),{recursive:!0}),K.writeFileSync(qe(e),JSON.stringify(i))}catch{}}function kt(e){try{let i=K.statSync(e);return{mtimeMs:i.mtimeMs,size:i.size}}catch{return}}function Pt(e){if(!e||e.startsWith("data:")||e.startsWith("blob:")||/^https?:\/\//i.test(e)||e.startsWith("//"))return;let i=e.split(/[?#]/,1)[0];if(!i)return;try{return`/${i.replace(/^\/+/,"").split("/").map(decodeURIComponent).map(encodeURIComponent).join("/")}`}catch{return}}function ai(e){let i=Pt(e);return i?we().catalog.get(i):void 0}function ci(e){let i=Pt(e);return i?we().transparent.has(i):!1}function li(e){let i=(o)=>e.variants.filter((a)=>a.format===o).reduce((a,c)=>a+c.bytes,0),n=i(e.fallback.format);return["avif","webp"].map((o)=>({format:o,srcset:e.sources[o]||"",bytes:i(o)})).filter((o)=>o.srcset&&o.bytes>0&&o.bytes<n).sort((o,a)=>o.bytes-a.bytes).map(({format:o,srcset:a})=>({format:o,srcset:a}))}function gy(e){let i=ai(e);if(!i)return;return{src:i.fallback.url,srcset:i.sources[i.fallback.format]||"",sources:li(i).map(({format:n,srcset:o})=>({type:`image/${n}`,srcset:o})),width:i.source.width,height:i.source.height,placeholder:ci(e)?void 0:i.placeholder?.dataUrl}}function As(){let e=we();e.catalog=new Map,e.transparent=new Set}function An(e){let i=we();i.catalog=new Map(e.entries),i.transparent=new Set(e.transparent)}async function my(e,i,n={}){if(!e||!K.existsSync(e))return As(),{count:0,fingerprint:""};if(n.offThread){let y=await He("delivery",{publicDir:e,outputDir:i});if(y!==Ie)return An(y.state),y.result}let o=await _t(e);if(o.length===0)return As(),{count:0,fingerprint:""};let a=Cn(i),c=o.filter((y)=>{let S=a[y.relativePath];if(!S)return!0;let R=kt(y.absolutePath);return!R||R.mtimeMs!==S.mtimeMs||R.size!==S.size});if(c.length===0)return As(),{count:0,fingerprint:""};let l=Ct(G.join(i,"_stx","images"),`${gn}:${wt()}`),u={outDir:G.join(i,"_stx","images"),storage:Ct(G.join(i,"_stx","images"),`${pn}:${wt()}`),baseUrl:ve,widths:dn,formats:["avif","webp"],quality:{avif:70,webp:78,jpeg:82,png:100},includeOriginal:!1,placeholder:!0,batchConcurrency:4,concurrency:4},{createImageDeliveryCatalog:f}=await import("ts-images/delivery"),v=c,h;try{h=await f({...u,entries:Rt(c,l)})}catch(y){if(v=await Sn(c),v.length===c.length)throw y;let S=new Set(v.map((I)=>I.relativePath)),R=!1;for(let I of c){if(S.has(I.relativePath))continue;let k=kt(I.absolutePath);if(!k)continue;a[I.relativePath]=k,R=!0}if(R)Rn(i,a);if(v.length===0)return As(),{count:0,fingerprint:""};h=await f({...u,entries:Rt(v,l)})}let d=await wn(h.entries),C=$n(h.entries,d),x=we();x.catalog=new Map(Object.entries(h.entries)),x.transparent=d;let b=d.size===0&&C.length===0?h.fingerprint:At("sha256").update(h.fingerprint).update(JSON.stringify({transparent:[...d].sort(),droppedWebp:C.sort()})).digest("hex");return{count:v.length,fingerprint:b}}class It{builtins=new Map;registerBuiltin(e){this.builtins.set(e.name.toLowerCase(),e);for(let i of e.aliases)this.builtins.set(i.toLowerCase(),e)}isBuiltin(e){return this.builtins.has(e.toLowerCase())}getBuiltin(e){return this.builtins.get(e.toLowerCase())??null}async resolveFile(e,i,n,o){let a=Ii(e,o);if(a!==void 0)return a;for(let c of Ni(e,i,n,o))if(await s(c))return c;return null}}var fe=new It;var ne="\x00stx-boolean-attribute";function Ze(e){return e.indexOf("\x00")===-1?e:e.replace(/\0/g,"")}var _n=new Set(["accesskey","autocapitalize","autofocus","class","contenteditable","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","role","slot","spellcheck","style","tabindex","title","translate","accept","action","alt","autocomplete","capture","cite","cols","colspan","content","controls","datetime","default","download","enctype","for","form","formaction","formenctype","formmethod","formnovalidate","formtarget","height","href","hreflang","kind","label","loading","loop","max","maxlength","media","method","min","minlength","multiple","muted","name","open","pattern","placeholder","playsinline","poster","preload","readonly","referrerpolicy","rel","required","reversed","rows","rowspan","scope","selected","shape","size","span","src","srcdoc","srclang","srcset","start","step","target","type","usemap","value","width","wrap"]);function Ve(e){let i=e.toLowerCase();return i.startsWith("aria-")||i.startsWith("data-")||_n.has(i)}function re(e,i){let n=[];for(let[o,a]of Object.entries(e.static)){if(i.has(o))continue;let c=e.staticNames?.[o]??o;if(typeof a==="boolean"){if(a)n.push(g(c));continue}if(a===ne){n.push(g(c));continue}n.push(`${g(c)}="${Mn(c,Ze(String(a)))}"`)}return n}function ie(e,i){let n=[];for(let[o,a]of Object.entries(e.serverDynamic??{})){if(i.has(o))continue;if(a===null||a===void 0||a===!1)continue;let c=e.serverDynamicNames?.[o]??o;if(a===!0){n.push(g(c));continue}if(typeof a==="object")continue;n.push(`${g(c)}="${Mn(c,Ze(String(a)))}"`)}return n}function Pn(e){if(e.clientReactive.to)return{value:e.clientReactive.to,reactive:!0};if(e.serverDynamic.to!==void 0)return{value:String(e.serverDynamic.to),reactive:!1};if(typeof e.static.to==="string")return{value:e.static.to,reactive:!1};return{value:"#",reactive:!1}}var Ge={name:"StxLink",aliases:["stx-link"],render(e,i,n){let o=Pn(e),a=(typeof e.static.class==="string"?e.static.class:"")||(typeof e.static.className==="string"?e.static.className:""),c=typeof e.static.activeClass==="string"?e.static.activeClass:"active",l=typeof e.static.exactActiveClass==="string"?e.static.exactActiveClass:"exact-active",u=e.static.prefetch===!0||e.static.prefetch==="true"||e.serverDynamic.prefetch===!0,f=[];if(o.reactive)f.push(`:href="${r(o.value)}"`);else f.push(`href="${r(Lr(o.value,"navigable"))}"`);if(a)f.push(`class="${r(a)}"`);if(f.push("data-stx-link"),f.push(`data-stx-active-class="${r(c)}"`),f.push(`data-stx-exact-active-class="${r(l)}"`),u)f.push("data-stx-prefetch");let v=typeof e.static.activeMatch==="string"?e.static.activeMatch.trim():"";if(v)f.push(`data-stx-active-match="${r(v)}"`);let h=new Set(["to","class","className","activeClass","exactActiveClass","activeMatch","prefetch"]);return f.push(...re(e,h)),f.push(...ie(e,h)),`<a ${f.join(" ")}>${i}</a>`}};var In=new Map;function Ke(e){if(!e)return;let i=e.split("?")[0].split("#")[0];return In.get(i)}var En={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Je=[320,640,768,1024,1280,1536,1920];function X(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let n=e.static[i];if(typeof n==="string")return n;return}function Be(e,i,n=!1){let o=e.serverDynamic[i];if(o!==void 0)return o!==!1&&o!=="false";let a=e.static[i];if(a!==void 0)return a!=="false"&&a!==!1;return n}function Ye(e){if(e.includes("(")||e.includes(","))return e;let i=e.trim().split(/\s+/),n=[];for(let o of i)if(o.includes(":")){let[a,c]=o.split(":"),l=En[a];if(l)n.push(`(max-width: ${l}px) ${c}`);else{let u=Number.parseInt(a);if(!Number.isNaN(u))n.push(`(max-width: ${u}px) ${c}`)}}else n.push(o);return n.join(", ")}function et(e,i,n,o){return i.map((a)=>`${$e(e,a,void 0,n,o)} ${a}w`).join(", ")}function Nn(e,i,n,o,a){return i.map((c)=>{let l=n?n*c:void 0;return`${$e(e,l,void 0,o,a)} ${c}x`}).join(", ")}function $e(e,i,n,o,a){if(!o||o==="local"||o==="static")return e;if(o==="cloudinary"){let c=[];if(i)c.push(`w_${i}`);if(n)c.push(`h_${n}`);if(a)c.push(`f_${a}`);c.push("q_auto");let l=c.join(",");return e.replace("/upload/",`/upload/${l}/`)}if(o==="imgix"){let c=new URLSearchParams;if(i)c.set("w",String(i));if(n)c.set("h",String(n));if(a)c.set("fm",a);c.set("auto","format");let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}if(o==="bunny"){let c=new URLSearchParams;if(i)c.set("width",String(i));if(n)c.set("height",String(n));if(a)c.set("format",a);let l=e.includes("?")?"&":"?";return`${e}${l}${c.toString()}`}return e}function On(e){return`var s=this.style;${e.map((i)=>`s.${i}=''`).join(";")}`}function Bn(e,i,n="#e5e7eb"){let o=`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${i}"><rect width="100%" height="100%" fill="${n}"/></svg>`;return`data:image/svg+xml;base64,${btoa(o)}`}var tt={name:"StxImage",aliases:["Image","stx-image","stx-img"],render(e,i,n){let o=X(e,"src")||"",a=ai(o),c=X(e,"alt")||"",l=X(e,"width")||(a?String(a.source.width):void 0),u=X(e,"height")||(a?String(a.source.height):void 0),f=X(e,"sizes"),v=X(e,"srcset"),h=X(e,"densities"),d=X(e,"format"),C=ci(o)||Ke(o)?.transparent===!0,x=X(e,"placeholder")||(a&&!C?"thumbhash":void 0),b=X(e,"placeholderColor")||"#e5e7eb",y=X(e,"provider"),S=X(e,"class")||X(e,"className")||"",R=X(e,"style")||"",I=X(e,"objectFit")||X(e,"fit"),k=X(e,"objectPosition")||X(e,"position"),E=X(e,"quality"),z=Be(e,"lazy",!0),W=Be(e,"preload",!1),B=Be(e,"priority",!1),O=X(e,"loading"),L=X(e,"decoding")||"async",U=!!a||Be(e,"picture",!1)||!!d,_=l?Number.parseInt(l):void 0,A=u?Number.parseInt(u):void 0,T=v||"",H="";if(a)T=a.sources[a.fallback.format]||"",H=f?Ye(f):"100vw";else if(!T&&f&&y&&y!=="local"&&y!=="static")T=et(o,Je,y,d),H=Ye(f);else if(!T&&h){let V=h.split(/\s+/).map((P)=>Number.parseFloat(P.replace("x","")));T=Nn(o,V,_,y,d)}else if(f)H=Ye(f);let D=[];if(R)D.push(R);if(I)D.push(`object-fit:${I}`);if(k)D.push(`object-position:${k}`);if(_&&A)D.push(`aspect-ratio:${_}/${A}`);let te=[],ae=x==="blur"||x==="color"||x==="thumbhash";if(ae&&!C){let V=a?.placeholder?{dataUrl:a.placeholder.dataUrl,color:b}:Ke(o);if(V&&x==="color")D.push(`background-color:${V.color}`),te.push("backgroundColor");else if(V)D.push(`background-color:${V.color}`),D.push(`background-image:url(${V.dataUrl})`),D.push("background-size:cover"),D.push("background-repeat:no-repeat"),te.push("backgroundColor","backgroundImage");else{let P=Bn(_||16,A||9,b);D.push(`background-image:url(${P})`),D.push("background-size:cover"),D.push("background-repeat:no-repeat"),te.push("backgroundImage")}}else if(!ae&&x&&x!=="empty"&&x!=="none")D.push(`background-image:url(${r(x)})`),D.push("background-size:cover"),D.push("background-repeat:no-repeat"),te.push("backgroundImage");let j=a?.fallback.url||$e(o,_,A,y,d),Z=[];if(Z.push(`src="${r(Lr(j,"fetched"))}"`),Z.push(`alt="${r(c)}"`),l)Z.push(`width="${r(l)}"`);if(u)Z.push(`height="${r(u)}"`);let Ce=O||(B||W?"eager":z?"lazy":"");if(Ce)Z.push(`loading="${r(Ce)}"`);if(B)Z.push('fetchpriority="high"');if(Z.push(`decoding="${r(L)}"`),S)Z.push(`class="${r(S)}"`);if(D.length>0)Z.push(`style="${r(D.join(";"))}"`);if(T)Z.push(`srcset="${r(Lr(T,"fetched"))}"`);if(H)Z.push(`sizes="${r(H)}"`);let xe=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","objectFit","objectPosition","fit","position","format","provider","quality","densities","preload","priority","picture","loading","decoding"]);if(te.length>0){let V=typeof e.static.onload==="string"?e.static.onload:"",P=On(te)+(V?`;${V}`:"");Z.push(`onload="${r(P)}"`),xe.add("onload")}Z.push(...re(e,xe)),Z.push(...ie(e,xe));let le=`<img ${Z.join(" ")} />`,Q="";if(W){let P=d==="webp"?"image/webp":d==="avif"?"image/avif":"";Q=`<link rel="preload" as="image" href="${r(j)}"${P?` type="${P}"`:""}${T?` imagesrcset="${r(T)}"`:""}${H?` imagesizes="${r(H)}"`:""} />
|
|
3
|
-
`}if(U){let V=[];if(a)for(let P of li(a))V.push(`<source type="image/${P.format}" srcset="${r(P.srcset)}"${H?` sizes="${r(H)}"`:""} />`);if(!a&&(d==="avif"||d==="auto")){let P=$e(o,_,A,y,"avif"),N=T?et(o,Je,y,"avif"):`${P}`;V.push(`<source type="image/avif" srcset="${r(N)}"${H?` sizes="${r(H)}"`:""} />`)}if(!a&&(d==="webp"||d==="auto")){let P=$e(o,_,A,y,"webp"),N=T?et(o,Je,y,"webp"):`${P}`;V.push(`<source type="image/webp" srcset="${r(N)}"${H?` sizes="${r(H)}"`:""} />`)}return`${Q}<picture>
|
|
4
|
-
${V.join(`
|
|
5
|
-
`)}
|
|
6
|
-
${le}
|
|
7
|
-
</picture>`}return`${Q}${le}`}};var Et="/images/safe-image-default.svg";function de(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let n=e.static[i];if(typeof n==="string")return n;return}var Tn=`<script>window.__stxSafeImageHandler||(window.__stxSafeImageHandler=function(i){if(i.__stx_fb)return;i.__stx_fb=1;var f=i.getAttribute('data-fallback')||'${Et}';var c=i.getAttribute('data-fallback-class');i.src=f;if(c)i.className=c;});</script>`,nt={name:"SafeImage",aliases:["safe-image","safe-img"],render(e,i,n){let o=de(e,"src")||"",a=de(e,"alt")||"",c=de(e,"fallback")||Et,l=de(e,"class")||de(e,"className")||"",u=de(e,"fallbackClassName")||"",f=[];if(f.push(`src="${r(o)}"`),f.push(`alt="${r(a)}"`),l)f.push(`class="${r(l)}"`);if(f.push(`data-fallback="${r(c)}"`),u)f.push(`data-fallback-class="${r(u)}"`);f.push('onerror="window.__stxSafeImageHandler(this)"');let v=new Set(["src","alt","fallback","class","className","fallbackClassName"]);f.push(...re(e,v)),f.push(...ie(e,v));let h=`<img ${f.join(" ")} />`,d=n.context;if(!d.__safeImageHandlerEmitted)return d.__safeImageHandlerEmitted=!0,`${Tn}${h}`;return h}};function rt(e){return e.replace(/[;{}()]/g,"").replace(/url/gi,"")}function Se(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let n=e.static[i];if(typeof n==="string")return n;return}function Te(e,i,n){let o=Se(e,i);if(o!==void 0){let a=Number.parseInt(o,10);if(!Number.isNaN(a))return a}return n}var st={name:"StxLoadingIndicator",aliases:["stx-loading-indicator"],render(e,i,n){let o=rt(Se(e,"color")||"#6366f1"),a=rt(Se(e,"initialColor")||Se(e,"initial-color")||""),c=rt(Se(e,"height")||"3px"),l=Te(e,"duration",2000),u=Te(e,"throttle",200),f=Te(e,"zIndex",999999)||Te(e,"z-index",999999),v=a?`linear-gradient(to right, ${a}, ${o})`:o;return`
|
|
8
|
-
<div id="stx-loading-indicator" style="position:fixed;top:0;left:0;right:0;height:${c};background:${v};z-index:${f};transform:scaleX(0);transform-origin:left;transition:transform 0.1s ease-out,opacity 0.3s ease;opacity:0;pointer-events:none">
|
|
9
|
-
<div style="position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,0.4) 50%,transparent 100%);animation:stx-shimmer 1.5s infinite"></div>
|
|
10
|
-
</div>
|
|
11
|
-
<style>@keyframes stx-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}</style>
|
|
12
|
-
<script>
|
|
13
|
-
(function(){var el=document.getElementById('stx-loading-indicator'),p=0,l=!1,i=null;function u(v){p=Math.min(Math.max(v,0),100);if(el){el.style.opacity=p>0?'1':'0';el.style.transform='scaleX('+(p/100)+')'}}window.stxLoading={start:function(){l=!0;p=0;u(10);if(i)clearInterval(i);i=setInterval(function(){if(!l)return;var r=90-p,inc=Math.max(0.5,r*0.1);if(p<90)u(p+inc)},${u})},finish:function(){l=!1;if(i){clearInterval(i);i=null}u(100);setTimeout(function(){if(el)el.style.opacity='0';setTimeout(function(){p=0;if(el)el.style.transform='scaleX(0)'},300)},200)},set:function(v){u(v)},clear:function(){l=!1;p=0;if(i){clearInterval(i);i=null}if(el){el.style.opacity='0';el.style.transform='scaleX(0)'}}};document.addEventListener('click',function(e){var a=e.target.closest&&e.target.closest('a');if(!a)return;var h=a.getAttribute('href');if(!h||h.startsWith('http')||h.startsWith('#')||h.startsWith('mailto:')||h.startsWith('tel:')||a.target==='_blank')return;window.stxLoading.start()});window.addEventListener('popstate',function(){window.stxLoading.start()});window.addEventListener('load',function(){window.stxLoading.finish()})})();
|
|
14
|
-
</script>`}};function Ot(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let n=e.static[i];if(typeof n==="string")return n;return}function Dn(e,i,n){let o=Ot(e,i);if(o!==void 0){let a=Number.parseInt(o,10);if(!Number.isNaN(a))return a}return n}var Nt={"top-right":"top:1rem;right:1rem","top-left":"top:1rem;left:1rem","top-center":"top:1rem;left:50%;transform:translateX(-50%)","bottom-right":"bottom:1rem;right:1rem","bottom-left":"bottom:1rem;left:1rem","bottom-center":"bottom:1rem;left:50%;transform:translateX(-50%)"},it={name:"StxToast",aliases:["stx-toast"],render(e,i,n){let o=r(Ot(e,"position")||"top-right"),a=Dn(e,"max",5),c=Nt[o]||Nt["top-right"];return`<div id="stx-toast-container" data-stx-toast-position="${o}" data-stx-toast-max="${a}" style="position:fixed;${c};z-index:999999;display:flex;flex-direction:column;gap:0.5rem;pointer-events:none;max-width:24rem;width:100%"></div>
|
|
15
|
-
<style>
|
|
16
|
-
@keyframes stx-toast-in{from{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}
|
|
17
|
-
@keyframes stx-toast-out{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(100%)}}
|
|
18
|
-
@keyframes stx-toast-in-left{from{opacity:0;transform:translateX(-100%)}to{opacity:1;transform:translateX(0)}}
|
|
19
|
-
@keyframes stx-toast-out-left{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-100%)}}
|
|
20
|
-
@keyframes stx-toast-in-center{from{opacity:0;transform:translateY(-1rem)}to{opacity:1;transform:translateY(0)}}
|
|
21
|
-
@keyframes stx-toast-out-center{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-1rem)}}
|
|
22
|
-
</style>`}};function De(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let n=e.static[i];if(typeof n==="string")return n;return}var Bt={sm:"max-width:24rem",md:"max-width:32rem",lg:"max-width:42rem",xl:"max-width:56rem",full:"max-width:calc(100vw - 2rem);max-height:calc(100vh - 2rem)"},ot={name:"StxModal",aliases:["stx-modal"],render(e,i,n){let o=De(e,"id");if(!o)return console.warn('[stx] <StxModal> requires an "id" prop'),"<!-- StxModal: missing id prop -->";let a=r(o),c=De(e,"size")||"md",l=De(e,"closeOnBackdrop")!=="false",u=De(e,"closeOnEscape")!=="false",f=Bt[c]||Bt.md;return`<div id="stx-modal-${a}" class="stx-modal-backdrop" data-stx-modal="${a}" data-close-backdrop="${l}" data-close-escape="${u}" style="display:none;position:fixed;inset:0;z-index:99999;align-items:center;justify-content:center;background:rgba(0,0,0,0.5);backdrop-filter:blur(2px);opacity:0;transition:opacity 0.2s ease" aria-modal="true" role="dialog">
|
|
23
|
-
<div class="stx-modal-panel" style="${f};width:100%;margin:1rem;border-radius:0.75rem;box-shadow:0 20px 60px rgba(0,0,0,0.3);overflow:hidden;transform:scale(0.95) translateY(8px);transition:transform 0.2s ease,opacity 0.2s ease;opacity:0;background:var(--stx-modal-bg,#fff);color:var(--stx-modal-text,#1f2937)">
|
|
24
|
-
<div style="padding:1.5rem">${i}</div>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
<style>
|
|
28
|
-
@media(prefers-color-scheme:dark){[data-stx-modal]{--stx-modal-bg:#1f2937;--stx-modal-text:#f3f4f6}}
|
|
29
|
-
.stx-modal-backdrop[data-stx-modal-open]{display:flex!important;opacity:1}
|
|
30
|
-
.stx-modal-backdrop[data-stx-modal-open] .stx-modal-panel{transform:scale(1) translateY(0);opacity:1}
|
|
31
|
-
</style>`}};function pe(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);let n=e.static[i];if(typeof n==="string")return n;return}var Tt={sm:"16rem",md:"24rem",lg:"32rem",xl:"40rem"},at={name:"StxDrawer",aliases:["stx-drawer"],render(e,i,n){let o=pe(e,"id");if(!o)return console.warn('[stx] <StxDrawer> requires an "id" prop'),"<!-- StxDrawer: missing id prop -->";let a=r(o),c=pe(e,"side")||"right",l=pe(e,"size")||"md",u=pe(e,"closeOnBackdrop")!=="false",f=pe(e,"closeOnEscape")!=="false",v=pe(e,"overlay")!=="false",h=Tt[l]||Tt.md,d=c==="left",C=d?"left:0":"right:0",x=d?"translateX(-100%)":"translateX(100%)",b=d?"stx-drawer-slide-left":"stx-drawer-slide-right";return`<div id="stx-drawer-${a}" class="stx-drawer-backdrop" data-stx-drawer="${a}" data-close-backdrop="${u}" data-close-escape="${f}" style="display:none;position:fixed;inset:0;z-index:99999;${v?"background:rgba(0,0,0,0.5);backdrop-filter:blur(2px)":"background:transparent;pointer-events:none"};opacity:0;transition:opacity 0.2s ease" role="dialog" aria-modal="true">
|
|
32
|
-
<div class="stx-drawer-panel" style="position:fixed;top:0;bottom:0;${C};width:${h};max-width:100vw;transform:${x};transition:transform 0.3s cubic-bezier(0.4,0,0.2,1);background:var(--stx-drawer-bg,#fff);color:var(--stx-drawer-text,#1f2937);box-shadow:0 20px 60px rgba(0,0,0,0.3);overflow-y:auto;pointer-events:auto">
|
|
33
|
-
<div style="padding:1.5rem">${i}</div>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
<style>
|
|
37
|
-
@media(prefers-color-scheme:dark){[data-stx-drawer]{--stx-drawer-bg:#1f2937;--stx-drawer-text:#f3f4f6}}
|
|
38
|
-
.stx-drawer-backdrop[data-stx-drawer-open]{display:block!important;opacity:1}
|
|
39
|
-
.stx-drawer-backdrop[data-stx-drawer-open] .stx-drawer-panel{transform:translateX(0)}
|
|
40
|
-
</style>`}};import{existsSync as jn,readFileSync as Ln}from"fs";var je=new Map,Dt=new Set;function zn(e){if(Dt.has(e))return;Dt.add(e),console.warn(`[stx] icon collection "${e}" is not installed, so its icons render as nothing. Install it with \`bun add -d @iconify-json/${e}\`.`)}function Fn(e){let i=process.cwd();for(let n of[`${i}/node_modules/@iconify-json/${e}/icons.json`,`${i}/pantry/@iconify-json/${e}/icons.json`,`${i}/node_modules/@iconify/json/json/${e}.json`,`${i}/pantry/@iconify/json/json/${e}.json`])if(jn(n))return n;for(let n of[`@iconify-json/${e}/icons.json`,`@iconify/json/json/${e}.json`])try{return w.resolve(n)}catch{}return null}function Un(e){if(je.has(e))return je.get(e);let i=Fn(e);if(!i)return zn(e),null;try{let n=JSON.parse(Ln(i,"utf8"));return je.set(e,n),n}catch{return null}}function Wn(e,i,n,o){let a=[];if(i.rotate)a.push(`rotate(${i.rotate*90} ${n/2} ${o/2})`);if(i.hFlip)a.push(`translate(${n} 0) scale(-1 1)`);if(i.vFlip)a.push(`translate(0 ${o}) scale(1 -1)`);return a.length?`<g transform="${a.join(" ")}">${e}</g>`:e}function Hn(e,i){let n=i,o=e.icons[n],a={hFlip:!1,vFlip:!1,rotate:0};for(let u=0;!o&&u<8;u++){let f=e.aliases?.[n];if(!f)return null;if(f.hFlip)a.hFlip=!a.hFlip;if(f.vFlip)a.vFlip=!a.vFlip;if(f.rotate)a.rotate=((a.rotate+f.rotate)%4+4)%4;n=f.parent,o=e.icons[n]}if(!o)return null;let c=o.width??e.width??24,l=o.height??e.height??24;return{body:Wn(o.body,a,c,l),width:c,height:l}}function me(e,i){if(e.serverDynamic[i]!==void 0)return String(e.serverDynamic[i]);if(e.static[i]!==void 0)return String(e.static[i]);if(e.clientReactive[i]!==void 0)return e.clientReactive[i];return}var ct={name:"Icon",aliases:["icon","stx-icon"],render(e,i,n){let o=me(e,"name")??me(e,"icon");if(!o)return"<!-- Icon: missing name/icon prop -->";let a="lucide",c=o;if(o.includes(":")){let S=o.split(":");a=S[0],c=S[1]}let l=r(me(e,"size")||"24"),u=r(me(e,"color")||"currentColor"),f=r(me(e,"class")||""),v=r(me(e,"style")||""),h=je.get(a)??Un(a);if(!h)return`<!-- Icon: collection "${a}" not loaded -->`;let d=Hn(h,c);if(!d)return`<!-- Icon: "${c}" not found in ${a} -->`;let C=`0 0 ${d.width} ${d.height}`,x=d.body;if(u!=="currentColor")x=x.replace(/currentColor/g,u);let b=f?` class="${f}"`:"",y=v?` style="${v}"`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${l}" viewBox="${C}" fill="none"${b}${y}>${x}</svg>`}};function jt(e,...i){for(let n of i){if(e.serverDynamic[n]!==void 0)return String(e.serverDynamic[n]);let o=e.static[n];if(typeof o==="string")return o}return}function Mt(e,i){let n=new RegExp(`<(template|div|span)[^>]*\\bslot=["']${i}["'][^>]*>([\\s\\S]*?)<\\/\\1>`,"i"),o=e.match(n);if(!o)return{region:null,rest:e};return{region:o[2],rest:e.replace(o[0],"")}}var lt={name:"Suspense",aliases:["suspense"],render(e,i,n){let o=Mt(i,"fallback"),a=o.rest,c=Mt(a,"error"),l=c.rest,u=o.region??jt(e,"fallback")??'<div class="stx-suspense-loading">Loading\u2026</div>',f=c.region??jt(e,"errorFallback","error-fallback")??'<div class="stx-suspense-error">Something went wrong.</div>';return`<div data-stx-suspense><div data-stx-suspense-fallback>${u}</div><div data-stx-suspense-error hidden>${f}</div><div data-stx-suspense-content hidden>${l}</div></div>`}};function Me(e,...i){for(let n of i){if(e.serverDynamic[n]!==void 0)return String(e.serverDynamic[n]);let o=e.static[n];if(typeof o==="string")return o}return}var ut={name:"TransitionGroup",aliases:["transition-group"],render(e,i,n){let o=(Me(e,"name")||"v").replace(/["'<>]/g,""),a=(Me(e,"tag")||"div").replace(/[^a-z0-9-]/gi,"")||"div",c=Me(e,"class"),l=Me(e,"id"),u=[`data-stx-transition-group="${o}"`,c?`class="${c}"`:"",l?`id="${l}"`:""].filter(Boolean).join(" ");return`<${a} ${u}>${i}</${a}>`}};function Lt(e=fe){e.registerBuiltin(Ge),e.registerBuiltin(tt),e.registerBuiltin(nt),e.registerBuiltin(st),e.registerBuiltin(it),e.registerBuiltin(ot),e.registerBuiltin(at),e.registerBuiltin(ct),e.registerBuiltin(lt),e.registerBuiltin(ut)}var zt=new Map;function qn(e){let i=zt.get(e.source);if(!i)i=new RegExp(`(${e.source})(?![\\w.:-])`,"y"),zt.set(e.source,i);return i}var Ft=new WeakMap;function Ut(e){let i=Ft.get(e);if(!i)i=new Set([...e].map((o)=>o.toLowerCase())),Ft.set(e,i);let n=i;return(o)=>!/[a-z]/.test(o)&&n.has(o.toLowerCase())}function Xn(e,i){let n="";for(let o=i;o<e.length;o++){let a=e[o];if(n){if(a==="\\")o++;else if(a===n)n=""}else if(a==='"'||a==="'")n=a;else if(a===">")return o}return e.length}function Wt(e,i,n){let o=[],a=0,c=typeof n==="function"?n:n?(l)=>n.has(l.toLowerCase()):void 0;while(a<e.length){let l=e.indexOf("<",a);if(l===-1)break;let u=qn(i);u.lastIndex=l+1;let f=u.exec(e);if(!f){a=l+1;continue}let v=f[1];if(c&&c(v)){let S=l+1+v.length;while(S<e.length&&e[S]!==">")S++;a=S+1;continue}let h=l+1+v.length,d=null,C=h,x=-1,b=!1;while(h<e.length){let S=e[h];if(d){if(S==="\\"&&h+1<e.length){h+=2;continue}if(S===d)d=null;h++;continue}if(S==='"'||S==="'"){d=S,h++;continue}if(S==="/"&&h+1<e.length&&e[h+1]===">"){x=h+2,b=!0;break}if(S===">"){x=h+1;break}h++}if(x===-1){a=l+1;continue}let y=e.slice(C,b?x-2:x-1).trim();if(b)o.push({fullMatch:e.slice(l,x),tagName:v,attributes:y,content:"",startIndex:l,endIndex:x,isSelfClosing:!0}),a=x;else{let S=`<${v}`,R=`</${v}>`,I=1,k=x,E=-1;while(I>0&&k<e.length){let B=e.indexOf(S,k),O=e.indexOf(R,k);if(O===-1)break;if(B!==-1&&B<O){let L=e[B+S.length];if(L===" "||L===">"||L==="/"||L===`
|
|
41
|
-
`||L==="\t"){let U=Xn(e,B+S.length);if(e[U-1]!=="/")I++;k=U+1}else k=B+S.length}else{if(I--,I===0){E=O;break}k=O+R.length}}if(E===-1){a=x;continue}let z=e.slice(x,E),W=E+R.length;o.push({fullMatch:e.slice(l,W),tagName:v,attributes:y,content:z,startIndex:l,endIndex:W,isSelfClosing:!1}),a=W}}return o}function ft(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�?39;/g,"'").replace(/'/gi,"'").replace(/&/g,"&")}function kn(e,i){try{let n=Buffer.from(e,"base64").toString("utf8");return JSON.parse(n)}catch{}try{let n=e.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");return JSON.parse(n)}catch(n){if(i?.debug)console.error("Error decoding __stx_ prop:",n);return e}}function Le(e,i){let n=0,o="",a=i;while(a<e.length){let c=e[a];if(o){if(c==="\\")a++;else if(c===o)o=""}else if(c==='"'||c==="'"||c==="`")o=c;else if(c==="{")n++;else if(c==="}"){if(n--,n===0)return e.slice(i,a+1)}a++}return e.slice(i)}function Ht(e){let i=e.trim();if(!i.startsWith("{")||!i.endsWith("}"))return null;if(Le(i,0).length!==i.length)return null;return i.slice(1,-1).trim()}function qt(e){let i=[],n=0,o=e.length;while(n<o){while(n<o&&/\s/.test(e[n]))n++;if(n>=o)break;let a="";while(n<o&&!/[\s=]/.test(e[n]))a+=e[n],n++;if(!a)break;while(n<o&&/\s/.test(e[n]))n++;if(n<o&&e[n]==="="){n++;while(n<o&&/\s/.test(e[n]))n++;let c="";if(n<o&&(e[n]==='"'||e[n]==="'")){let l=e[n];n++;while(n<o&&e[n]!==l){if(e[n]==="\\"&&n+1<o)n++,c+=e[n];else c+=e[n];n++}if(n<o)n++}else if(e[n]==="{")c=Le(e,n),n+=c.length;else while(n<o&&!/\s/.test(e[n]))c+=e[n],n++;i.push({name:a,value:c})}else i.push({name:a,value:!0})}return i}var Zn=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]),Vn=new Set([":for","x-for","v-for","@for"]),Xt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Gn(e){return dt(e).map((i)=>[i.start,i.end])}function dt(e){let i=[],n=new Map;for(let o of Ne(e)){let a=o.name.toLowerCase();if(o.closing){let v=n.get(a)?.pop();if(v)v.end=o.end;continue}let l=/(?::for|x-for|v-for|@for)\s*=/.test(o.attributes)?qt(o.attributes).find((v)=>Vn.has(v.name)):void 0,u=typeof l?.value==="string"?l.value:null,f=u!==null?{start:o.start,end:o.end,names:oe(u),tag:a}:null;if(f)i.push(f);if(!o.selfClosing&&!Xt.has(a)){let v=n.get(a);if(!v)v=[],n.set(a,v);v.push(f)}}return i}var Kn=/(?:^|\s)((?:[\w-]+:)*-?space-[xy]-(?!reverse(?:\s|$))[\w./[\]-]+)(?=\s|$)/;function Zt(e){let i=new Map,n=[];for(let o of Ne(e)){let a=o.name.toLowerCase();if(o.closing){for(let l=n.length-1;l>=0;l--)if(n[l].name===a){n.length=l;break}continue}let c=n.at(-1);if(c){if(c.utility&&c.children>0)i.set(o.start,c.utility);if(!/(?:^|\s)hidden(?=[\s=]|$)/.test(o.attributes))c.children++}if(!o.selfClosing&&!Xt.has(a)){let l=/(?:^|\s)class\s*=\s*(["'])([\s\S]*?)\1/.exec(o.attributes)?.[2];n.push({name:a,utility:l?Kn.exec(l)?.[1]??null:null,children:0})}}return i}function Vt(e){if(typeof e==="string")return e;if(Array.isArray(e))return e.filter(Boolean).map((i)=>Vt(i)).join(" ");if(e&&typeof e==="object")return Object.entries(e).filter(([,i])=>i).map(([i])=>i).join(" ");return e?String(e):""}function Bc(e,i){if(!/:[\w-]+=/.test(e))return e;let n=e,o=/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi,a=[],c;while((c=o.exec(e))!==null)a.push([c.index,c.index+c[0].length]);a.push(...Gn(e));let l=new Set([...mt(i),...Array.isArray(i.__stx_client_declared_names)?i.__stx_client_declared_names:[]]);function u(d){return a.some(([C,x])=>d>=C&&d<x)}let f=[],v=new Map,h=256;for(let d of Ne(n)){if(d.closing||u(d.start))continue;let C=d.attributes.trimEnd();if(!C||!C.includes(":"))continue;let x=/(?:^|\s)data-native(?:\s|=|$)/i.test(C.replace(/"[^"]*"|'[^']*'/g,"")),b=new Set((/(?:^|\s)data-stx-parent-bindings="([^"]*)"/.exec(C)?.[1]??"").split(/\s+/).filter(Boolean)),y=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,S,R=C,I=!1;while((S=y.exec(C))!==null){if(jr(C,S.index,!0)?.kind==="attribute")continue;let k=S[1],E=S[2];if(Xl(k))continue;if(b.has(k)&&!x)continue;if(F(E,l))continue;if(E.includes("()")&&!E.includes(".get(")||E.includes("$store")||E.includes("$ref"))continue;try{let z=Object.keys(i),W=Object.values(i),B=E.match(/^([a-zA-Z_$][\w$]*)/);if(B&&!z.includes(B[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes(B[1]))continue;let O=JSON.stringify([z,E]),L=v.get(O);if(!L){if(L=Function(...z,`return (${E})`),v.size>=h)v.clear();v.set(O,L)}let U=L(...W);if(k==="class"){let _=Y(Vt(U));if(_){let A=R.match(/\sclass="([^"]*)"/);if(A)R=R.replace(A[0],()=>` class="${A[1]} ${_}"`);else R=R.replace(S[0],()=>` class="${_}"`)}else R=R.replace(S[0],"");I=!0;continue}if(Zn.has(k)){if(U)R=R.replace(S[0],` ${k}`);else R=R.replace(S[0],"");I=!0;continue}if(U===null||U===void 0||U===!1)R=R.replace(S[0],"");else{let _=x&&typeof U==="object"?JSON.stringify(U):String(U),A=Mn(k,_);R=R.replace(S[0],()=>` ${k}="${A}"`)}I=!0}catch(z){if(z instanceof he)throw z;continue}}if(I){let k=d.selfClosing?" /":"",z=`<${d.name}${R}${k}>`;f.push({start:d.start,end:d.end,replacement:z})}}if(f.length>0){let d=Array(f.length*2+1),C=0;for(let x=0;x<f.length;x++){let{start:b,end:y,replacement:S}=f[x];d[x*2]=n.slice(C,b),d[x*2+1]=S,C=y}d[f.length*2]=n.slice(C),n=d.join("")}return n}import Gt from"fs";import Kt from"path";var Jt=!1;function Jn(e,i,n,o=!1,a=new Set){let c={static:{},staticNames:{},serverDynamic:{},serverDynamicNames:{},clientReactive:{},events:{}},l=new Set(Array.isArray(i.__stx_client_signal_names)?i.__stx_client_signal_names:[]),u=(C)=>{if(l.size===0)return!1;let x=t(C),b=x.match(/^\s*[!+~(-]*\s*([a-zA-Z_$][\w$]*)/)?.[1];if(b&&l.has(b))return!0;for(let y of l){let S=y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?:^|[^\\w$.])${S}\\s*\\(`).test(x))return!0}return!1},f=new Set(Gl),v=(C)=>{if(!C.includes("-")||C.startsWith("@")||C.startsWith(":")||C.startsWith("x-")||C.startsWith("__"))return C;if(C.startsWith("aria-")||C.startsWith("data-"))return C;return C.replace(/-([a-z0-9])/g,(x,b)=>b.toUpperCase())},h=(C,x)=>{let b=v(C);if(c.static[b]=x,b!==C)c.staticNames[b]=C},d={...e};for(let[C,x]of Object.entries(e)){let b=/^v-model(?::([a-zA-Z_][a-zA-Z0-9_]*))?((?:\.[a-zA-Z]+)*)$/.exec(C);if(!b)continue;delete d[C];let y=b[1]||"modelValue";if(d[`:${y}`]=x,d[`@update:${y}`]=`${x} = $event`,b[2]){let S=b[2].slice(1).split(".").map((R)=>`${R}: true`).join(", ");d[`:${b[1]?`${y}Modifiers`:"modelModifiers"}`]=`{ ${S} }`}}for(let[C,x]of Object.entries(d)){let b=C.startsWith("x-")&&!f.has(C)&&!C.startsWith("x-bind:")&&!C.startsWith("x-on:")?`:${C.slice(2)}`:C;if(b.startsWith("@")){c.events[b]=x;continue}if(b.startsWith("__stx_")){let y=v(b.slice(6));c.serverDynamic[y]=kn(x,n);continue}if(b.startsWith(":")){let y=v(b.slice(1)),S=x===ne?y:x;if(y==="if"||y==="for"||y==="show"){c.clientReactive[y]=S;continue}if(o){c.clientReactive[y]=S;continue}if(F(S,a)){c.clientReactive[y]=S;continue}if(u(S)){c.clientReactive[y]=S;continue}try{if(!m(S)){if(n.debug)console.error(`Unsafe expression in :${y} binding: ${S}`);c.clientReactive[y]=S;continue}let R=Object.keys(i),I=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","if","else"]),k=new Set(Array.isArray(i.__stx_client_declared_names)?i.__stx_client_declared_names:[]);if((Array.isArray(i.__stx_caller_client_bindings)?i.__stx_caller_client_bindings:[]).includes(S.trim())||Ee(S).some((O)=>!I.has(O)&&(k.has(O)||!R.includes(O)&&!(O in globalThis)))){c.clientReactive[y]=S;continue}let B=p(S,R)(...Object.values(i));if(c.serverDynamic[y]=B,y!==b.slice(1)&&c.serverDynamicNames)c.serverDynamicNames[y]=b.slice(1)}catch{c.clientReactive[y]=S}continue}if(typeof x==="string"&&x.includes("{{")&&x.includes("}}")){let y=tr(x,a);if(y!==null){c.clientReactive[v(b)]=y;continue}let S=x.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(S)try{let R=S[1];if(m(R)){let k=p(R,Object.keys(i))(...Object.values(i));h(b,k!=null?String(k):"")}else{if(n.debug)console.error(`Unsafe expression in ${b}: ${R}`);h(b,x)}}catch(R){if(n.debug)console.error(`Error evaluating expression for ${b}:`,R);h(b,x)}else{let R=x,I=/\{\{\s*([\s\S]+?)\s*\}\}/g,k;while((k=I.exec(x))!==null)try{let E=k[1];if(!m(E)){if(n.debug)console.error(`Unsafe expression in ${b}: ${E}`);continue}let W=p(E,Object.keys(i))(...Object.values(i));R=R.replace(k[0],String(W??""))}catch(E){if(n.debug)console.error(`Error evaluating expression in ${b}:`,E)}h(b,R)}continue}h(b,x===ne?"true":ft(x))}return c}var gt=new Set;function hy(){gt.clear()}function Yn(e){let i=/^\s*(?:<!--[\s\S]*?-->\s*)*<(?:div|span)\b((?:[^>"']|"[^"]*"|'[^']*')*)>/.exec(e);return!!i&&/\sdata-stx-component-wrapper(?=[\s=]|$)/.test(i[1])&&!/\sstx-hydrate(?=[\s=]|$)/.test(i[1])}function Qn(e,i,n){let o=`${n}\x00${e}\x00${i}`;if(gt.has(o))return;gt.add(o);let a=/space-x-/.test(i)?"flex":"flex flex-col",c=i.replace(/space-[xy]-/,"gap-");console.warn(`[stx] <${e}> in ${n} is a later child of a "${i}" stack, so it gets no spacing: the utility puts its margin on the component's scope wrapper, which generates no box. Use "${a} ${c}" on the parent instead -- gap reaches through the wrapper.`)}var pt=new Set;function yy(){pt.clear()}function er(e,i){let n=`${i}\x00${e}`;if(pt.has(n))return;pt.add(n),console.warn(`[stx] <${e}> in ${i} is inside a <template :for>, so its props and slot expressions will not see the loop variables and render empty. Put the directive on the element the loop repeats instead -- <tr :for="..."> or <span :for="..." class="contents"> -- which binds correctly.`)}function tr(e,i){if(i.size===0)return null;let n=/\{\{\s*([\s\S]+?)\s*\}\}/g,o=[...e.matchAll(n)];if(!o.some((u)=>F(u[1],i)))return null;let a=e.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(a&&o.length===1)return a[1];let c="",l=0;for(let u of o)c+=e.slice(l,u.index).replace(/[`\\$]/g,(f)=>`\\${f}`),c+=`\${${u[1]}}`,l=u.index+u[0].length;return c+=e.slice(l).replace(/[`\\$]/g,(u)=>`\\${u}`),`\`${c}\``}var nr=[[/@if\s*\(/,"@endif"],[/@unless\s*\(/,"@endunless"]];function rr(e,i,n){if(!e.includes("@"))return e;if(!nr.some(([a,c])=>a.test(e)&&e.includes(c)))return e;try{return ge(e,i,n)}catch{return e}}function ye(e){let i={},n=0,o=e.length;while(n<o){while(n<o&&/\s/.test(e[n]))n++;if(n>=o)break;let a="";while(n<o&&!/[\s=]/.test(e[n]))a+=e[n],n++;if(!a)break;while(n<o&&/\s/.test(e[n]))n++;if(n<o&&e[n]==="="){n++;while(n<o&&/\s/.test(e[n]))n++;let c="";if(n<o&&(e[n]==='"'||e[n]==="'")){let l=e[n];n++;while(n<o){let u=e[n];if(u==="\\"&&n+1<o){n++,c+=e[n],n++;continue}if(u===l){n++;break}c+=u,n++}}else if(e[n]==="{"){c=Le(e,n),n+=c.length;let l=Ht(c);if(l!==null){i[`:${a}`]=l;continue}}else while(n<o&&!/\s/.test(e[n]))c+=e[n],n++;i[a]=c}else i[a]=ne}return i}function Yt(e){return Object.entries(e).map(([i,n])=>n===ne?i:`${i}="${sr(n)}"`).join(" ")}function sr(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function ir(e){let i=new Set,n=/<([A-Z][A-Za-z0-9]*|stx-[a-z0-9-]+)\b[^>]*>/g,o;while((o=n.exec(e))!==null){let a=o[1];if(fe.isBuiltin(a))i.add(a)}return[...i].sort()}async function hg(e,i,n,o,a){if(!/import\s/.test(e))return e;if(!i.__importedComponents)i.__importedComponents=new Map;let c=i.__importedComponents,l=Kt.dirname(n),u=[],f=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi;for(let d of e.matchAll(f)){let[C,x,b]=d,y=/import\s+(?:(\{[^}]*\})|([A-Za-z_$][\w$]*))\s+from\s+['"]([^'"]+)['"]\s*;?\s*\n?/g,S=b,R,I=[];while((R=y.exec(b))!==null){let[k,E,z,W]=R,B=null,O=null;if(W.startsWith(".")||W.startsWith("/")){let _=Kt.resolve(l,W);if(_.endsWith(".stx"))O=_;else{let A=`${_}.stx`;try{if(Gt.statSync(A).isFile())O=A}catch{try{if(Gt.statSync(_).isDirectory())B=_}catch{}}}}else B=Zs(W,l);if(!B&&!O)continue;let L=!1,U=(_,A)=>{c.set(_,A),c.set(_.toLowerCase(),A);let T=_.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();c.set(T,A),a.add(A)};if(z&&O)U(z,O),L=!0;else if(E){let _=E.slice(1,-1).split(",").map((T)=>T.trim()).filter(Boolean).map((T)=>{let H=T.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(H)return{source:H[1],local:H[2]};return{source:T,local:T}}),A=B?Nr(B):null;for(let{source:T,local:H}of _){let D=null;if(O)D=O;else if(A)D=A.get(T)??A.get(T.toLowerCase())??A.get(T.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())??null;if(D)U(H,D),L=!0}}if(L)I.push({start:R.index,end:R.index+k.length})}if(I.length===0)continue;for(let k=I.length-1;k>=0;k--)S=S.slice(0,I[k].start)+S.slice(I[k].end);u.push({start:d.index,end:d.index+C.length,value:`<script${x}>${S}</script>`})}if(u.length===0)return e;let v=[],h=0;for(let d of u)v.push(e.slice(h,d.start),d.value),h=d.end;return v.push(e.slice(h)),v.join("")}async function or(e,i,n,o,a){let c=e;if(!i.__importedComponents)i.__importedComponents=new Map;let l=i.__importedComponents,u=/@import\s*\(\s*([^)]+)\s*\)/g,f;while((f=u.exec(c))!==null){let[v,h]=f,d=h.split(",").map((C)=>C.trim().replace(/^['"]|['"]$/g,"")).filter((C)=>C.length>0);for(let C of d){let x=C.split("/"),y=x[x.length-1].replace(/\.stx$/,""),S=y.includes("-")?y.split("-").map((k)=>k.charAt(0).toUpperCase()+k.slice(1)).join(""):y.charAt(0).toUpperCase()+y.slice(1),R=null,I=Qs(C,n,o);for(let k of I)try{if(await Bun.file(k).exists()){R=k;break}}catch{}if(R){l.set(S,R),l.set(y,R),l.set(y.toLowerCase(),R);let k=S.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(l.set(k,R),a.add(R),o.debug)console.log(`Imported component: ${S} -> ${R}`)}else if(o.debug)console.warn(`Could not resolve imported component: ${C}`)}c=c.replace(v,""),u.lastIndex=0}return c}async function ar(e,i,n,o,a){let c=e,l=o.componentsDir||"components";if(!i.__processedComponents)i.__processedComponents=new Set;let u=i.__processedComponents,f=/@component\s*\(/g,v;while((v=f.exec(c))!==null){let h=v.index,d=h+v[0].length-1,C=1,x=d+1;while(x<c.length&&C>0){if(c[x]==="(")C++;else if(c[x]===")"){if(C--,C===0)break}x++}if(C!==0)break;let b=c.substring(d+1,x),y=x+1,S=b.match(/^\s*['"]([^'"]+)['"]/);if(!S){f.lastIndex=y;continue}let R=S[1],I,k=b.slice(S[0].length),E=k.match(/^\s*,\s*/);if(E)I=k.slice(E[0].length).trim();let z={};if(I)try{z=M(I,i)}catch(_){let A=_ instanceof Error?_.message:String(_);c=c.replace(c.substring(h,y),`[Error parsing component props: ${A}]`);continue}let W="",B=y,L=c.substring(y).match(/^([\s\S]*?)@endcomponent/);if(L)W=L[1].trim(),B=y+L[0].length;let U=await Qe(R,z,W,l,i,n,o,u,a);c=c.substring(0,h)+U+c.substring(B),f.lastIndex=0}return c}async function cr(e,i,n,o,a){if(!e)return e;let c=e,l=o.componentsDir||"components";if(!i.__processedComponents)i.__processedComponents=new Set;let u=i.__processedComponents,f=io(c);if(f.size>0){let y=Array.isArray(i.__stx_client_declared_names)?i.__stx_client_declared_names:[];i.__stx_client_declared_names=[...new Set([...y,...f])]}let v=se(c);c=v.output;let h=mt(i);return c=await b(c,/[a-z][a-z0-9]*-[a-z0-9-]*/,!1),c=await b(c,/[A-Z][a-zA-Z0-9]*/,!0,Ut(Br)),c=await b(c,/[a-z][a-z0-9]*/,!1,Br),c=v.restore(c),c;async function b(y,S,R,I){if(!y)return y;let k=y,E=Wt(k,S,I),z=dt(k),W=!o._nativeHostAttrs&&/space-[xy]-/.test(k),B,O=new Map;for(let _=E.length-1;_>=0;_--){let A=E[_],T=R?J(A.tagName):A.tagName,H=ye(rr(A.attributes,i,n)),D=z.filter(({start:N,end:q})=>A.startIndex>=N&&A.startIndex<q);if(D.some((N)=>N.tag==="template"))er(A.tagName,n);let te=D.length>0,ae=new Set(h);for(let N of D)for(let q of N.names)ae.add(q);let j=Jn(H,i,o,te,ae);if(typeof j.clientReactive.for==="string")for(let N of oe(j.clientReactive.for))ae.add(N);let Z=fe.getBuiltin(A.tagName),Ce=Z?await Hr(A.tagName,l,i,n,{...o,_nativePrimitivesFallback:void 0}):!1,xe=A.tagName==="Image"&&eo([...Object.keys(j.static),...Object.keys(j.serverDynamic),...Object.keys(j.clientReactive)],Object.keys(j.events),{...j.static,...j.serverDynamic})&&(o._pluginComponentDirs??[]).some((N)=>Nr(N).has("Image"));if(Z&&!Ce&&!xe){let N={context:i,filePath:n,options:o,dependencies:a},q=Z.render(j,A.content,N);if(Object.keys(j.events).length>0){let ce=Yt(j.events);q=q.replace(/^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/,`$1 ${ce}`)}if(Object.keys(j.clientReactive).length>0)q=Qt(q,j.clientReactive);O.set(_,q);continue}if(!R&&A.tagName.includes("-")&&!await Hr(T,l,i,n,o))continue;let le={};for(let[N,q]of Object.entries(j.static))le[N]=q;for(let[N,q]of Object.entries(j.serverDynamic))le[N]=q;let Q={declaredProps:new Set,consumedProps:new Set,reactiveProps:Object.keys(j.clientReactive),events:Object.keys(j.events)},V=await Qe(T,le,v.restore(A.content),l,i,n,o,u,a,[...ae],Q,A.tagName);if(W&&Yn(V)){B??=Zt(k);let N=B.get(A.startIndex);if(N)Qn(A.tagName,N,n)}let P=V;if(P=lr(P,j,Q.declaredProps,Q.consumedProps,o._nativeHostAttrs),o._nativeHostAttrs){let N=Q.reactiveProps.filter((ee)=>!Q.consumedProps.has(ee)&&!["if","for","show","key","ref"].includes(ee)).map(J),q=ht(P,!0);if(N.length&&q){if(!Object.hasOwn(ye(P.slice(q.insertPos,q.tagEnd)),"data-stx-native-host-root"))P=P.slice(0,q.insertPos)+' data-stx-native-host-root="true"'+P.slice(q.insertPos);let ee=be(P);P=P.slice(0,ee.insertPos)+` data-stx-native-forward="${N.join(" ")}"`+P.slice(ee.insertPos)}let ce=ht(P,!0);if(ce){let ee=ye(P.slice(ce.insertPos,ce.tagEnd)),Re=be(P),rn=ye(P.slice(Re.insertPos,Re.tagEnd));if(Object.hasOwn(ee,"data-stx-native-host-root")&&!Object.hasOwn(rn,"data-stx-native-host-owner"))P=P.slice(0,Re.insertPos)+" data-stx-native-host-owner"+P.slice(Re.insertPos)}}if(Object.keys(j.events).length>0){let N=be(P);if(N){let q=Yt(j.events),ce=Object.keys(j.events).map((ee)=>ee.replace(/^@/,"").split(".")[0]).join(" ");P=P.substring(0,N.insertPos)+` data-stx-parent-events="${ce}" ${q}`+P.substring(N.insertPos)}}if(Object.keys(j.clientReactive).length>0)P=Qt(P,j.clientReactive);O.set(_,P)}if(O.size===0)return k;let L="",U=0;for(let _=0;_<E.length;_++){let A=O.get(_);if(A===void 0)continue;L+=k.slice(U,E[_].startIndex),L+=A,U=E[_].endIndex}return L+=k.slice(U),L}}function Qt(e,i){let n=new Set(["if","for"]),o=new Set(["show"]),a=Object.entries(i).filter(([h])=>!n.has(h)),c=a.filter(([h])=>!o.has(h)).map(([h])=>J(h)).join(" "),l=e,u=a.length>0?be(l):null;if(u){let h=a.map(([C,x])=>`:${J(C)}="${x.replace(/"/g,""")}"`).join(" "),d=c?` data-stx-parent-bindings="${c}"`:"";l=l.substring(0,u.insertPos)+`${d} ${h}`+l.substring(u.insertPos)}let f=i.if;if(f)l=`<template :if="${f.replace(/"/g,""")}">${l}</template>`;let v=i.for;if(v){let h=i.key,d=h?` :key="${h.replace(/"/g,""")}"`:"";l=`<template :for="${v.replace(/"/g,""")}"${d}>${l}</template>`}return l}function lr(e,i,n=new Set,o=new Set,a=!1){let c=ht(e,a);if(!c)return e;let l=a?be(e):null;if(l){let u=tn(e,l).filter((f)=>f.insertPos>c.insertPos);for(let f=u.length-1;f>=0;f--)e=en(e,u[f],i,n,o,a)}return en(e,c,i,n,o,a)}function en(e,i,n,o,a,c){let l=e.slice(i.insertPos,i.tagEnd),u=n.serverDynamic.class??n.static.class;if(c&&typeof u==="string"&&u&&!a.has("class")){let b=/(^|\s)class\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/i,y=b.test(l)?l.replace(b,(S,R,I,k,E)=>`${R}class="${r(`${ft(I??k??E)} ${u}`)}"`):` class="${r(u)}"${l}`;e=e.slice(0,i.insertPos)+y+e.slice(i.tagEnd),i.tagEnd+=y.length-l.length,l=y}let f=c||/\bdata-native(?:\s|=)/i.test(l),v=f?a:o,h=new Set(Object.keys(ye(l))),d=new Set(["class","className"]);for(let b of Object.keys(n.static)){let y=n.staticNames[b]??b;if(h.has(y)||v.has(b)||!f&&!Ve(y))d.add(b)}for(let b of Object.keys(n.serverDynamic)){let y=n.serverDynamicNames?.[b]??b;if(h.has(y)||v.has(b)||!f&&!Ve(y))d.add(b)}let C=[];if(f){for(let[b,y]of Object.entries(n.static)){if(d.has(b)||y!==!0&&y!==ne)continue;d.add(b),C.push(`${r(n.staticNames?.[b]??b)}="true"`)}for(let[b,y]of Object.entries(n.serverDynamic)){if(d.has(b)||y!==!0)continue;d.add(b),C.push(`${r(n.serverDynamicNames?.[b]??b)}="true"`)}}let x=[...re(n,d),...ie(n,d),...C];if(f){for(let[b,y]of Object.entries(n.serverDynamic)){if(d.has(b)||y!==!1)continue;let S=n.serverDynamicNames?.[b]??b;x.push(`${r(S)}="false"`)}for(let[b,y]of Object.entries(n.serverDynamic)){if(d.has(b)||y===null||typeof y!=="object")continue;let S=JSON.stringify(y);if(S!==void 0){let R=n.serverDynamicNames?.[b]??b;x.push(`${r(R)}="${r(S)}"`)}}}if(x.length===0)return e;return`${e.slice(0,i.insertPos)} ${x.join(" ")}${e.slice(i.insertPos)}`}function be(e){let i=nn(e,0);if(i)return i;let n=/<([a-zA-Z][a-zA-Z0-9-]*)\b[^>]*\bdata-stx-scope(?:\s|=|>)/i.exec(e);if(n)return{insertPos:n.index+1+n[1].length,tagEnd:yt(e,n.index+1+n[1].length)};return null}function ht(e,i=!1){let n=be(e);if(!n)return null;let o=e.slice(n.insertPos,n.tagEnd),a=/\bdata-stx-component-wrapper(?:\s|=|>|$)/i.test(o)?nn(e,n.tagEnd+1):n;return a&&i?ur(e,a)??a:a}function ur(e,i){return tn(e,i)[0]??null}function tn(e,i){let n=[];if(!e.includes("data-stx-native-host-root"))return n;let o=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),a=e.lastIndexOf("<",i.insertPos),c=0,l;while(a>=0&&a<e.length){if(e.startsWith("<!--",a)){let d=e.indexOf("-->",a+4);if(d<0)return n;a=e.indexOf("<",d+3);continue}let u=/^<(\/?)([a-z][\w-]*)\b/i.exec(e.slice(a));if(!u){a=e.indexOf("<",a+1);continue}let f=u[2].toLowerCase(),v=a+u[0].length,h=yt(e,v);if(u[1]){if(c--,l!==void 0&&c<l)l=void 0;if(c<=0)return n}else if(f==="script"||f==="style"){let d=new RegExp(`</${f}\\s*>`,"gi");if(d.lastIndex=h+1,!d.exec(e))return n;a=e.indexOf("<",d.lastIndex);continue}else{let d=ye(e.slice(v,h)),C=c>0&&(Object.hasOwn(d,"data-stx-component-wrapper")||Object.hasOwn(d,"data-stx-native-host-owner")),x=l===void 0&&!C&&Object.hasOwn(d,"data-stx-native-host-root");if(x)n.push({insertPos:v,tagEnd:h});if(!o.has(f)&&e[h-1]!=="/"){if(c++,l===void 0&&(C||x))l=c}else if(c===0)return n}a=e.indexOf("<",h+1)}return n}function nn(e,i){let n=i;while(n<e.length){let o=e.slice(n),a=o.match(/^\s+/);if(a){n+=a[0].length;continue}if(o.startsWith("<!--")){let u=e.indexOf("-->",n+4);if(u===-1)return null;n=u+3;continue}let c=o.match(/^<(script|style)\b[^>]*>/i);if(c){let u=`</${c[1].toLowerCase()}>`,f=e.toLowerCase().indexOf(u,n+c[0].length);if(f===-1)return null;n=f+u.length;continue}let l=o.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(?:\s|>|\/)/);if(!l)return null;return{insertPos:n+1+l[1].length,tagEnd:yt(e,n+1+l[1].length)}}return null}function yt(e,i){let n="";for(let o=i;o<e.length;o++){let a=e[o];if(n){if(a==="\\")o++;else if(a===n)n=""}else if(a==='"'||a==="'")n=a;else if(a===">")return o}return e.length}async function Ps(e,i,n,o,a){if(!Jt)Lt(fe),Jt=!0;let c=await hg(e,i,n,o,a);c=await or(c,i,n,o,a),c=await ar(c,i,n,o,a);let l=[];for(let u=0;u<3;u++){let f=l.length,v=ke(c,Xe,(d,C)=>`\x00STX_COMPONENT_COMMENT_${f+C}\x00`,`STX_COMPONENT_COMMENT:${f}`);l.push(...v.tokens);let h=c;if(c=await cr(v.output,i,n,o,a),c===h)break}if(l.length>0)c=c.replace(/\x00STX_COMPONENT_COMMENT_(\d+)\x00/g,(u,f)=>l[Number(f)]??"");if(o.debug){let u=ir(c);if(u.length>0)console.warn(`[stx] ${n}: unresolved component tag(s) after render passes: ${u.join(", ")}. Check nested component output for malformed root tags or recursive component markup.`)}return c}
|
|
42
|
-
export{ai,ci,li,gy,As,my,kn,Bc,hy,yy,hg,Ps};
|
package/dist/chunk-11rnqey0.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ti,$i,Dt,Se,Rr,Ks,Ar,Xs,Gs,Eg,Tg,$g,Pr,Rg,Ag,Pg,Ig,nl,rl,sl,Ri,ol,Og,Lt,jt,Bt,Ft,zt,Ht,ft,Ng}from"./chunk-388xpdw5.js";export{Ar as Router,Pg as abortNavigation,Ks as bracketPathToRegex,Lt as clearMiddleware,rl as createClientCookieManager,zt as createMiddlewareContext,Ft as createRouteLocation,nl as createServerCookieManager,sl as createStorageManager,Ig as defineMiddleware,Tg as defineRoute,$g as defineRoutes,Xs as findErrorPage,Gs as formatRoutes,$i as generateRouteManifest,Ti as generateRouteTypes,ol as getMiddleware,jt as getMiddlewareNames,ft as getRouterScript,Ng as getRouterScriptDev,Og as hasMiddleware,Dt as isFileRequestPath,Bt as loadMiddlewareFromDirectory,Rr as matchRoute,Ag as navigateTo,Se as patternToRegex,Ri as registerMiddleware,Rg as resetRoutes,Pr as route,Ht as runMiddleware,Eg as setAppUrl};
|
package/dist/chunk-1mx3j280.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ra,Fy,zy,zl,nt,rm,vo,Hy,Uy,Vy,Wy,qy,Ky,Xy,Gy,Jy}from"./chunk-4vz17ytv.js";import"./chunk-0jdz31q1.js";export{Ky as applyHead,Hy as definePageMeta,ra as getHead,Fy as getPageMeta,nt as mergeHeadConfigs,Xy as processHeadDirective,Jy as processMetaDirective,Gy as processTitleDirective,qy as renderBodyAttrs,Vy as renderHead,Wy as renderHtmlAttrs,zy as resetHead,vo as seoMetaToHeadConfig,zl as useHead,Uy as usePageTitle,rm as useSeoMeta,Uy as useTitle};
|
package/dist/chunk-20hy5p3p.js
DELETED
package/dist/chunk-29v3b5ks.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Gu,Xo,ur,Ju,Yu,Zu,Qu,ed,td,nd,rd,sd,od,id,ad,cd,ld,ud,dd,pd,fd,gd,md,hd,yd,bd,wd,vd,xd,Sd,kd,_d,Cd,Ed,Td,$d,Rd,Ad,Pd,Id,Od,Nd,Md,Dd,Ld,jd,Bd,Fd,dn,sc,zd,Hd,Ud,oc,Vd,Wd,qd,Kd,Xd,Gd,ic,Jd,Yd,Zd,Qd,ep,tp,np,rp,sp,dr,op,ip,ap,cp,lp,up,dp,pp,fp,gp,mp,hp,Go,yp,bp,wp,vp,xp,vs,xs,Sp,kp,_p,Cp,Ep,ac,Tp,$p,Rp,cc,Jo,Ap,Pp,lc,uc,Ss,dc,Ip,pn,Op,pc,fc,Yo,Np,Zo,Mp,Dp,Lp,jp,Bp,Fp,zp,gc,Hp,Up,mc,Vp,Wp,qp,Kp,Xp,Gp,Jp,Yp,Zp,Qp,ef,tf,nf,rf,sf,of,af,cf,lf,uf,df,pf,ff,gf,hc,mf,hf,yf,bf,wf,vf,xf,Sf,kf,_f,Cf,pr,yc,bc,Ef,fr,Tf,$f,Rf,wc,vc,ks,_s,Af,Qo,Pf,If,Of,Nf,Mf,Df,Lf,jf,Bf,Ff,zf,Hf,Uf,Vf,Wf,qf,Kf,Xf,Gf,Jf,xc,Yf,Zf,Sc,kc,Qf,eg}from"./chunk-36cz2v8k.js";export{Bd as AVAILABLE_COMPONENTS,ac as AutoUpdater,Fd as COMPONENT_STYLES,ks as DEFAULT_WATCH_INTERVAL_MS,vc as MAX_WATCH_INTERVAL_MS,wc as MIN_WATCH_INTERVAL_MS,Gd as MODAL_STYLES,sd as TOAST_STYLES,np as TRAY_MENU_STYLES,lc as UPDATE_MANIFEST_ASSET,Wd as alert,df as appInfo,Df as appleScript,eg as applicationDataDirectory,Mf as audio,Zf as backgroundDelay,af as battery,Nf as biometric,_f as bluetooth,zf as bonjour,pn as bundlePathForExecutable,Np as caffeinate,Tp as canReplaceBundle,$p as clearQuarantine,Yp as clipboard,Xd as closeAllModals,hp as closeAllWindows,Vd as confirm,gf as contextMenu,Kf as continuityCamera,qf as coreml,Cp as craftBinaryNotFoundMessage,Go as craftWindowArguments,pr as crashReporter,Td as createAccordion,vd as createAutocomplete,dd as createAvatar,ud as createBadge,od as createButton,pd as createCard,Nd as createChart,ad as createCheckbox,kd as createChip,Md as createCodeEditor,yd as createColorPicker,Od as createDataGrid,bd as createDatePicker,xs as createDiskImage,gd as createDropdown,Ld as createFileExplorer,Ip as createGitHubUpdateManifest,dc as createGitHubUpdater,Sd as createImageView,Kp as createInterval,xd as createLabel,Ad as createListView,Dd as createMediaPlayer,Jd as createMenubar,Rd as createModalComponent,Qf as createNativeUpdateApi,kc as createPantrySelfUpdater,Bp as createPreferences,ld as createProgressBar,hd as createRadioButton,md as createRating,Cd as createScrollView,Yo as createSelfUpdater,cd as createSlider,Ed as createSplitView,$d as createStepper,ic as createSystemTray,Pd as createTable,fd as createTabs,id as createTextInput,wd as createTimePicker,qp as createTimer,_d as createTooltip,Id as createTreeView,jd as createWebView,yp as createWindow,wp as createWindowWithHTML,Zo as decaffeinate,of as deepLinks,Xp as delay,td as dismissAlertById,nd as dismissAllAlerts,rf as dragOut,Rp as extractBundle,Lf as fileAssociations,Qo as focus,If as focusShortcutsReady,Jp as formatCompact,jp as formatDuration,Lp as formatRemainingTime,Hp as formatShortcut,Gp as formatTime,Qp as fs,cc as generateUpdateManifest,rd as getActiveAlertCount,Kd as getActiveModalCount,Yd as getActiveTrayInstances,gp as getActiveWindowIds,Dp as getCaffeinateStatus,Jf as getCapabilities,xc as getCapability,pp as getDesktopConfig,up as getDialogBridgeScript,Wp as getRegisteredHotkeys,ep as getSimulatedTrayHTML,tp as getTrayBridgeScript,Zd as getTrayInstance,mp as getWindow,xp as getWindowBridgeScript,uc as githubLatestAssetUrl,Ss as githubReleaseAssetUrl,tf as globalShortcuts,fr as handoff,Pf as hasFocusShortcuts,Ef as iap,zp as isAutoLaunchEnabled,Yf as isAvailable,Mp as isCaffeinated,sf as isDragOutAvailable,vp as isWebviewAvailable,yf as keychain,Tf as liveActivities,Of as localServer,$f as location,Ff as log,Sp as macOSRuntimeExecutablePath,ff as menu,Wf as midi,vf as nativeAutoLaunch,xf as nativeTray,Sf as nativeWindow,cf as network,Zp as notifications,ed as notify,bp as openDevWindow,kp as pack,_p as packageApp,Sc as parsePantryUpdateManifest,gc as parseShortcut,Bf as pdf,bf as permissions,wf as printing,qd as prompt,pc as quitLauncher,Jo as readBundleIdentity,yc as redactPII,Up as registerHotkey,fc as relaunchBundle,Gu as requestNotificationPermission,fp as resetDesktopConfig,Ep as resolveCraftBinary,vs as resolveCraftExecutablePath,Op as runningBundleTeamId,hf as screen,Rf as screenCapture,_s as screenSharing,Gf as serial,Xf as serviceMenu,Fp as setAutoLaunch,dp as setDesktopConfig,ef as shell,Xo as showAlert,ip as showAlertDialog,op as showColorPicker,ap as showConfirmDialog,cp as showErrorDialog,Hd as showErrorModal,Qu as showErrorToast,sc as showInfoModal,Ju as showInfoToast,dr as showMessageBox,dn as showModal,rp as showOpenDialog,oc as showQuestionModal,sp as showSaveDialog,Ud as showSuccessModal,Yu as showSuccessToast,ur as showToast,lp as showWarningDialog,zd as showWarningModal,Zu as showWarningToast,hc as sidebar,bc as signPayload,Cf as speech,Uf as speechRecognition,Hf as spotlight,pf as standardMenus,Ap as swapBundle,mf as system,jf as tags,nf as theme,kf as touchbar,Qd as triggerTrayAction,Vp as unregisterAllHotkeys,mc as unregisterHotkey,lf as updater,Pp as verifyBundleTrust,Vf as vision,Af as watchScreenSharing,uf as windowEvents};
|
package/dist/chunk-2cay3heb.js
DELETED
package/dist/chunk-31yx4sjh.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{br,i}from"./chunk-n4m50dpk.js";import"./chunk-ngqb22wj.js";import"./chunk-43sgpy4e.js";import"./chunk-fs43342z.js";import"./chunk-0v7555tr.js";import"./chunk-0fm6avxt.js";import"./chunk-bm6y085n.js";import"./chunk-9tv0tw7f.js";import"./chunk-9w9y84t5.js";import{Pe}from"./chunk-8b8az19t.js";import"./chunk-nhyv3w4r.js";import"./chunk-t65f98qv.js";import"./chunk-0adc8x2h.js";import"./chunk-mf5cqv1k.js";import"./chunk-w6ydg43d.js";import"./chunk-2vx2ben8.js";import"./chunk-jr2r2nh5.js";import"./chunk-xnp031ba.js";import"./chunk-388xpdw5.js";import{Ke,lo,uo}from"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{br as buildModulesTag,Pe as injectRouterScript,i as processDirectives,lo as processJsonDirective,uo as processOnceDirective,Ke as validateClientScript};
|
package/dist/chunk-33fnbw33.js
DELETED
package/dist/chunk-357qjcj1.js
DELETED
package/dist/chunk-38kerh2r.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Am}from"./chunk-0asdv3hk.js";import"./chunk-mf5cqv1k.js";import"./chunk-w6ydg43d.js";import"./chunk-2vx2ben8.js";import"./chunk-jr2r2nh5.js";import"./chunk-xnp031ba.js";import"./chunk-388xpdw5.js";import"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{Am as buildApp};
|
package/dist/chunk-38y11q8x.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Fm,zm,Hm,Um,vu,Vm,Wm,qm,Km,Xm,Gm,Jm}from"./chunk-2f5jjxcj.js";export{Gm as Broadcast,Jm as BroadcastServer,vu as broadcast,Km as broadcastPresence,qm as broadcastPrivate,Xm as channel,Fm as getBroadcastServer,Um as loadChannels,zm as startBroadcasting,Hm as stopBroadcasting,Vm as toUser,Wm as toUsers};
|
package/dist/chunk-3h4db9yb.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Bn}from"./chunk-4vz17ytv.js";import{B,Q,x,Kt,Xt,zr,y,Ol,Ki,Y,N}from"./chunk-b5qzed8y.js";import{gn}from"./chunk-f0sxbgbm.js";import{r}from"./chunk-0fm6avxt.js";import{ne}from"./chunk-e5rag6rh.js";import{L,c}from"./chunk-8tfpv6zf.js";var J=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function K(t){let s=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,n;while((n=e.exec(t))!==null)s.push({start:n.index,end:n.index+n[0].length});return s}function I(t,s){return s.some((e)=>t>=e.start&&t<e.end)}function Z(t){let s=(t||"").trim();if(!s)return null;if(/[\s>+~,:]/.test(s))return null;let e={},n=s,i=n.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),n=n.slice(i[0].length);while(n.length>0){let o=n.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(o){if(e.attr=o[1],o[3]!==void 0&&o[3]!=="")e.attrValue=o[3];n=n.slice(o[0].length);continue}let l=n.match(/^#([\w-]+)/);if(l){e.id=l[1],n=n.slice(l[0].length);continue}let a=n.match(/^\.([\w-]+)/);if(a){e.className=a[1],n=n.slice(a[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function tt(t,s){if(s.attr){if(!(s.attrValue===void 0?new RegExp(`\\b${s.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${s.attr}\\s*=\\s*(["'])\\s*${s.attrValue}\\s*\\1`,"i")).test(t))return!1}if(s.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${s.id}\\s*\\1`,"i").test(t))return!1}if(s.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(s.className))return!1}return!0}function T(t,s="main"){let e=Z(s);if(!e)return null;let n=/<([a-z][\w-]*)\b([^>]*)>/gi,i=K(t),o;while((o=n.exec(t))!==null){if(I(o.index,i))continue;let l=o[1].toLowerCase(),a=o[2]||"";if(a.trimEnd().endsWith("/")||J.has(l))continue;if(e.tag&&e.tag!==l)continue;if(!tt(a,e))continue;let u=o[0],g=o.index+u.length,f=new RegExp(`<(/?)${l}\\b([^>]*)>`,"gi");f.lastIndex=g;let d=1,h;while((h=f.exec(t))!==null){if(I(h.index,i))continue;let b=h[1]==="/";if(!b&&(h[2]||"").trimEnd().endsWith("/"))continue;if(d+=b?-1:1,d===0)return{openTag:u,openIndex:o.index,start:g,end:h.index,tagName:l}}return null}return null}var Et="private, no-store";function cn(t){return t.replace(/&#(\d+);/g,(s,e)=>D(Number(e),s)).replace(/&#x([0-9a-f]+);/gi,(s,e)=>D(Number.parseInt(e,16),s)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function D(t,s){if(!Number.isInteger(t)||t<0||t>1114111)return s;try{return String.fromCodePoint(t)}catch{return s}}function Be(t){return t.headers.get("X-STX-Router")==="true"}function H(t,s){if(!t)return s;return t.split(",").some((n)=>n.trim().toLowerCase()===s.toLowerCase())?t:`${t}, ${s}`}function V(t){let s=H(t,"X-STX-Router");for(let e of ds)s=H(s,e);return{Vary:s}}var ds=["X-STX-Have-Layout","X-STX-Have-Layout-Group"];function k(t){return t.replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function F(t){let s=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy;return x(s,(n,i)=>(e.lastIndex=i,e.exec(n)?e.lastIndex:-1)).map(({token:n})=>n)}function q(t){let s=Object.create(null),e=t.replace(/^<\w+\b|>$/g,"");for(let n of e.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let i=n[1].toLowerCase();if(!(i in s))s[i]=n[2]??n[3]??n[4]??""}return s}function Kn(t){let s=[];for(let e of F(t)){if(/^<title\b/i.test(e)){s.push(`<title>${k(e.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let n=q(e);if(/^<meta\b/i.test(e)){let i=n.property?"property":"name",o=cn(n[i]??"").toLowerCase();if(o==="description"||/^(?:og|twitter):[\w:]+$/.test(o))s.push(`<meta ${i}="${r(o)}" content="${k(n.content??"")}">`)}else{let i=cn(n.rel??"").toLowerCase();if(i==="canonical"||i==="alternate"&&n.hreflang)s.push(`<link rel="${i}" href="${k(n.href??"")}"${i==="alternate"?` hreflang="${k(n.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${s.join("")}</template>
|
|
3
|
-
`}var et=["media","crossorigin","integrity"];function Xn(t){let s=[];for(let e of F(t)){if(!/^<link\b/i.test(e))continue;let n=q(e);if(cn(n.rel??"").trim().toLowerCase()!=="stylesheet")continue;if(!n.href||"data-css"in n||"disabled"in n)continue;let i=et.filter((o)=>(o in n)).map((o)=>` ${o}="${k(n[o])}"`).join("");s.push(`<link rel="stylesheet" href="${k(n.href)}"${i}>`)}return s.length?`<template data-stx-page-css="1">${s.join("")}</template>
|
|
4
|
-
`:""}import P from"path";var nt="stx-page-head:",rt=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,_={dev:null,prod:null};function st(){let t=ne()?"dev":"prod",s=_[t];if(s!==null)return s;try{let e=import.meta.require("./chunk-11rnqey0.js"),n=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;_[t]=`<script>${n()}</script>`}catch{_[t]=""}return _[t]}async function Da(t,s){if(s===!1)return null;if(s&&typeof s==="string"){let n=P.resolve(t,s);if(await Bun.file(n).exists())return n;return null}let e=P.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Bo(t,s){try{let e=await Bun.file(t).text(),n=e,i=B(e);if(i)n=i.content.trim();let o=gn(e),l=[...o.client.map((p)=>p.fullTag),...o.signals.map((p)=>p.fullTag)],a=[],u=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,g;while((g=u.exec(e))!==null)a.push(g[0]);let f=n;for(let p of o.server)f=f.replace(p.fullTag,"");for(let p of o.client)f=f.replace(p.fullTag,"");f=f.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let d="<!--__STX_PAGE_SLOT__-->";if(f=f.replace(/<slot\s*\/>/gi,d).replace(/<slot\s*>\s*<\/slot>/gi,d),!f.includes(d))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:h,extractVariables:b,defaultConfig:w,loadStxConfig:R}=await import("./chunk-k2t0w8z1.js"),E=await R(),m={__filename:t,__dirname:P.dirname(t)};for(let p of l){let C=p.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!p.includes("client")&&!p.includes('type="module"'))await b(C[1],m,t)}let S=await h(f,m,t,{...w,...E,...s},new Set),A=S.indexOf(d);if(A===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:S.substring(0,A),afterSlot:S.substring(A+d.length),filePath:t,shellScripts:l,shellStyles:a}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function ps(t,s,e){let n,i="",o=s.match(rt);if(o){s=s.replace(o[0],"");try{let f=Buffer.from(o[1],"base64").toString("utf8"),d=f.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(d)n=d[1].trim();i=f.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let l=e||n||"stx App",a=st(),u="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
5
|
-
<html lang="en">
|
|
6
|
-
<head>
|
|
7
|
-
<meta charset="UTF-8">
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
|
-
<title>${l}</title>
|
|
10
|
-
${i?` ${i}
|
|
11
|
-
`:""} ${t.shellStyles.join(`
|
|
12
|
-
`)}
|
|
13
|
-
</head>
|
|
14
|
-
<body>
|
|
15
|
-
${t.beforeSlot}
|
|
16
|
-
<div data-stx-content>${s}</div>
|
|
17
|
-
${t.afterSlot}
|
|
18
|
-
${t.shellScripts.filter((f)=>!f.includes("server")).join(`
|
|
19
|
-
`)}
|
|
20
|
-
${u}
|
|
21
|
-
${a}
|
|
22
|
-
</body>
|
|
23
|
-
</html>`}function ot(t,s={}){let e=t.trim();if(!Bn(e))return t;let n=[],i=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(i){let u=i[1],g=/<style\b[^>]*>[\s\S]*?<\/style>/gi,f;while((f=g.exec(u))!==null)n.push(f[0]);let d=u.match(/<script\b[^>]*data-stx-server-data[^>]*>[\s\S]*?<\/script>/i);if(d)n.push(d[0]);let h=u.match(/<script\b[^>]*data-stx-runtime-config[^>]*>[\s\S]*?<\/script>/i);if(h)n.push(h[0])}if(s.preserveHead&&i){let u=[],g=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,f;while((f=g.exec(i[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(f[0]))continue;u.push(f[0])}if(u.length>0)n.unshift(`<!--${nt}${Buffer.from(u.join(`
|
|
24
|
-
`),"utf8").toString("base64")}-->`)}let o=e.match(/<body\b[^>]*>/i),l=c(e);if(o&&l!==-1){let u=o.index+o[0].length,g=e.slice(u,l).trim();if(n.length>0)return n.join(`
|
|
25
|
-
`)+`
|
|
26
|
-
`+g;return g}let a=e;if(a=a.replace(/<!DOCTYPE\b[^>]*>/i,""),a=a.replace(/<html\b[^>]*>/i,""),a=a.replace(/<\/html\s*>/i,""),i)a=a.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,n.join(`
|
|
27
|
-
`));return a=a.replace(/<body\b[^>]*>/i,""),a=a.replace(/<\/body\s*>/i,""),a.trim()}var U=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function G(t,s,e,n){if(!U.test(s))return!1;let i=s.slice(0,s.indexOf(">")+1),o=/\sdata-stx-owner="([^"]+)"/i.exec(i)?.[1];if(!o)return!0;let l=`data-stx-scope="${o}"`;for(let a=t.indexOf(l);a!==-1;a=t.indexOf(l,a+l.length))if(a>=e&&a<n)return!1;return!0}function La(t){return Be(t)}function it(t,s){let e=[],n=new Set;for(let i of x(t,Q)){if(i.start>=s.start&&i.start<s.end)continue;let o=i.token.match(/^<script\b((?:"[^"]*"|'[^']*'|[^'">])*)>/i)?.[1]??"",l=new Map;for(let g of o.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g))l.set(g[1].toLowerCase(),g[2]??g[3]??g[4]??"");let a=l.get("src")?.trim(),u=l.get("type")?.trim().toLowerCase();if(!a||l.has("server")||u&&!["module","text/javascript","application/javascript"].includes(u))continue;if(l.has("data-stx-runtime")||l.has("data-stx-router")||/^\/_stx\/(?:runtime|router)(?:\.[a-f0-9]{16})?\.js(?:[?#]|$)/i.test(a))continue;if(G(t,i.token,s.start,s.end)||n.has(i.token))continue;n.add(i.token),e.push(i.token)}return e}function Tt(t,s="main"){return!!T(t.trim(),s)}function Fe(t,s="main",e=!1){let n=t.trim(),i=[],o=[],l=n.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(l){let S=l[1],A=/<style\b[^>]*>[\s\S]*?<\/style>/gi,p;while((p=A.exec(S))!==null)i.push(p[0]);let C=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((p=C.exec(S))!==null){if(U.test(p[0])||p[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(p[0]))continue;o.push(p[0])}}let a=T(n,s);if(!a)return(e?Kn(t)+Xn(t):"")+ot(t);let u=it(n,a),g=new Set(u),{tagName:f,start:d,end:h}=a,b=n.slice(d,h).trim(),w=[],R=n.match(/<body\b[^>]*>/i),E=c(n);if(R&&R.index!==void 0&&E!==-1){let A=[[R.index+R[0].length,a.openIndex],[h+`</${f}>`.length,E]],p=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[C,j]of A){if(C>=j)continue;let W=n.slice(C,j),v;p.lastIndex=0;while((v=p.exec(W))!==null){if(G(n,v[0],d,h))continue;w.push(v[0])}}}let m=[];if(e)m.push(Kn(t)+Xn(t));if(i.length>0)m.push(i.join(`
|
|
28
|
-
`));if(u.length>0)m.push(u.join(`
|
|
29
|
-
`));if(o.length>0)m.push(o.filter((S)=>!g.has(S)).join(`
|
|
30
|
-
`));if(w.length>0)m.push(w.filter((S)=>!g.has(S)).join(`
|
|
31
|
-
`));return m.push(b),m.join(`
|
|
32
|
-
`)}import O from"fs";import X from"path";function ja(t,s,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:s,outputDir:e}}function Ba(t,s){let e=X.join(s,"manifest.json");O.writeFileSync(e,JSON.stringify(t,null,2))}function Fa(t){let s=X.join(t,"manifest.json");if(!O.existsSync(s))return null;try{let e=O.readFileSync(s,"utf-8"),n=JSON.parse(e);if(n.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${n.version}`),null;return n}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function M(t,s,e={}){let n=`${encodeURIComponent(t)}=${encodeURIComponent(s)}`;if(e.maxAge!==void 0)n+=`; Max-Age=${e.maxAge}`;if(e.expires)n+=`; Expires=${e.expires.toUTCString()}`;if(e.path)n+=`; Path=${e.path}`;if(e.domain)n+=`; Domain=${e.domain}`;if(e.secure)n+="; Secure";if(e.httpOnly)n+="; HttpOnly";if(e.sameSite)n+=`; SameSite=${e.sameSite}`;return n}async function at(t){let s=t.headers.get("content-type")||"",e={},n=(i,o)=>{let l=e[i];if(l===void 0)e[i]=o;else if(Array.isArray(l))l.push(o);else e[i]=[l,o]};if(s.includes("multipart/form-data")){let i=await t.formData();for(let[o,l]of i.entries())if(typeof l==="string")n(o,l);return e}if(s.includes("application/x-www-form-urlencoded")){for(let[i,o]of new URLSearchParams(await t.text()).entries())n(i,o);return e}return e}function Fo(t){if(!t)return!1;let s=t.toUpperCase();return s!=="GET"&&s!=="HEAD"}async function z(t,s={}){let e=s.request,n=s.method??e?.method;if(!e||!Fo(n))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await at(e)}catch{}let o=await t.action({request:e,form:i,params:s.params??{},query:t.query??{},cookies:s.cookies??{}});if(o&&typeof o==="object"){let l=o,a=ct(l.cookies),u=l.redirect;if(typeof u==="string"&&u)return{redirect:u,ran:!0,...a.length>0?{cookies:a}:{}};let{cookies:g,redirect:f,...d}=l;if(Object.assign(t,d),a.length>0)return{ran:!0,cookies:a}}return{ran:!0}}function ct(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let s=[];for(let[e,n]of Object.entries(t)){if(!e)continue;if(typeof n==="string"){s.push(M(e,n));continue}if(n&&typeof n==="object"){let i=n;if(typeof i.value!=="string")continue;s.push(M(e,i.value,i))}}return s}function za(t,s=[],e){let n=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of s)n.append("Set-Cookie",i);for(let[i,o]of Object.entries(e??{}))if(i.toLowerCase()!=="location")n.set(i,o);return new Response(null,{status:303,headers:n})}async function Gn(t,s={}){let{html:e,context:n,redirect:i,cookies:o}=await lt(t,s),l=Kt(n),a=Xt(n);if(i)return{html:e,redirect:i,cookies:o,status:l,headers:a};let{extractStreamBoundaries:u}=await import("./chunk-6aqr0e6s.js"),g=u(n),f=t.streamTemplates;if(f&&Object.keys(f).length>0){let{processDirectives:d}=await import("./chunk-31yx4sjh.js"),{defaultConfig:h}=await import("./chunk-82fg5gp6.js"),b=n.streamBoundaries||{},w={...h,autoShell:!1},R=Object.keys(f).map((m)=>({id:m,render:async()=>{let S=typeof b[m]==="function"?await b[m]():void 0;return d(f[m],{...n,$boundary:S},t.sourceFile,w,new Set)}})),E=new Set(R.map((m)=>m.id));g=[...(g||[]).filter((m)=>!E.has(m.id)),...R]}return{html:e,boundaries:g&&g.length>0?g:void 0,cookies:o,status:l,headers:a}}async function lt(t,s){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...s};if(!t.hasServerScripts&&!Ki(t.html))return{html:t.html,context:e};for(let l of t.serverScriptContent)try{await y(l,e,t.sourceFile)}catch(a){if(s.__stx_strict_hydration)throw a;console.warn(`[stx] Server script error in ${t.sourceFile}:`,a)}let n=await z(e,{request:s.request,method:s.method,params:s.params??{},cookies:s.cookies??{}}),i=(l)=>{let a=l.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),u=zr(e);if(!u)return a;let g=L(a);return g<0?u+a:a.slice(0,g)+u+a.slice(g)};if(n.redirect)return{html:t.html,context:e,redirect:n.redirect,cookies:n.cookies};if(!Ki(t.html))return{html:i(t.html),context:e,cookies:n.cookies};let o=new Map;for(let[l,a]of Object.entries(t.placeholders))if(a.expression)try{let u=N(a.expression,e);if(a.type==="raw")o.set(l,u!==void 0&&u!==null?String(u):"");else o.set(l,u!==void 0&&u!==null?Y(String(u)):"")}catch(u){if(s.__stx_strict_hydration)throw u;o.set(l,"")}return{html:i(Ol(t.html,o)),context:e,cookies:n.cookies}}
|
|
33
|
-
export{Et,cn,Be,V,ds,Kn,Xn,Da,Bo,ps,ot,La,Tt,Fe,ja,Ba,Fa,Fo,za,Gn};
|
package/dist/chunk-3q80f7mt.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{uu,Ia,du,pu,Oa,fu,gu,mu,hu,Na,yu,Nm}from"./chunk-ra2tzsvz.js";import{Ha,xu}from"./chunk-1jvt9t3r.js";import{le,ue,de,Yn,Te,ze,gs,$t,ln,Zn,Qn,er,pe,tr,nr,ms}from"./chunk-88fx8xc1.js";import{Eu}from"./chunk-frpsrv1e.js";import"./chunk-0vyytd9v.js";export{ue as DEFAULT_FORMATS,de as DEFAULT_QUALITY,le as DEFAULT_WIDTHS,ms as ImageProcessingError,pu as clearImageCache,Oa as createImageDirective,xu as createImageHandler,gu as createImagePlugin,Nm as defaultImageConfig,nr as formatSize,Na as generateImageManifest,ln as generateSizes,$t as generateSrcSet,Zn as getFallbackVariant,gs as getImageMetadata,pe as getMimeType,tr as getTotalSize,Qn as groupVariantsByFormat,Ha as handleImageRequest,fu as imageDirective,Te as isImageBackendAvailable,er as isImageFile,Yn as isSharpAvailable,hu as optimizeDirectory,mu as optimizeImage,Ia as parseImageComponent,ze as processImage,du as processImageComponents,uu as renderImageComponent,Eu as rewriteImagesWithSiblings,yu as writeImageManifest};
|
package/dist/chunk-43kz6rx9.js
DELETED
package/dist/chunk-43sgpy4e.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{d,m,M,p,te}from"./chunk-4vz17ytv.js";import{T}from"./chunk-0jdz31q1.js";import{G,Js,Ke,B,Vt,Fr,Ye,Ze,s,b,Me,P}from"./chunk-b5qzed8y.js";import{vt}from"./chunk-16sfjkc4.js";import{D}from"./chunk-phzhmnnm.js";import{ge}from"./chunk-9tv0tw7f.js";import{W,ut}from"./chunk-1jxkc6d0.js";import{I,Fn}from"./chunk-e5rag6rh.js";import A from"path";import{existsSync as ye}from"fs";function ae(c,e){let a=0;for(let r=e;r<c.length;r++){let S=c[r];if(S==="("||S==="["||S==="{")a++;else if(S===")"||S==="]"||S==="}")a--;else if(S===","&&a===0)return r}return-1}function $e(c,e,a){let r=c,S=new RegExp(`${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),n=S.exec(r);while(n){let u=n.index,t=u+n[0].length-1,C=1,z=t+1;while(z<r.length&&C>0){if(r[z]==="(")C++;else if(r[z]===")")C--;z++}if(C!==0)break;let ie=r.substring(t+1,z-1),N=`${a}(${ie})`;r=r.substring(0,u)+N+r.substring(z),S.lastIndex=u+N.length,n=S.exec(r)}return r}function Ee(c){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(c)}function he(c){let e=c,a=[],r=new Set,S=0,n=0,u=e.length,t=(N)=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]===N){n++;return}n++}},C=()=>{n++;while(n<u){if(e[n]==="\\"){n+=2;continue}if(e[n]==="`"){n++;return}if(e[n]==="$"&&e[n+1]==="{"){n+=2;let N=1;while(n<u&&N>0)if(e[n]==="{")N++,n++;else if(e[n]==="}")N--,n++;else if(e[n]==="'"||e[n]==='"')t(e[n]);else if(e[n]==="`")C();else n++;continue}n++}},z=()=>{if(e[n]==="/"&&e[n+1]==="/"){while(n<u&&e[n]!==`
|
|
3
|
-
`)n++;return!0}if(e[n]==="/"&&e[n+1]==="*"){n+=2;while(n<u-1&&!(e[n]==="*"&&e[n+1]==="/"))n++;return n+=2,!0}return!1},ie=()=>{if(S!==0)return;let N=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(N){let H=N[2];if(!r.has(H))a.push(H),r.add(H);return}let se=e.slice(n).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(se){let H=se[1];if(!r.has(H))a.push(H),r.add(H);return}let Y=e.slice(n).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Y){let H=Y[1];if(!r.has(H))a.push(H),r.add(H)}};while(n<u){if(z())continue;if(e[n]==="'"||e[n]==='"'){t(e[n]);continue}if(e[n]==="`"){C();continue}if(e[n]==="{"){S++,n++;continue}if(e[n]==="}"){S--,n++;continue}if(S===0&&/[a-z]/i.test(e[n])&&(n===0||/\s|[;{}()]/.test(e[n-1])))ie();n++}return a.join(", ")}function ve(c,e=""){let a=he(c).split(",").map((r)=>r.trim()).filter(Boolean);return`
|
|
4
|
-
(function() {
|
|
5
|
-
${vt("var",a)}
|
|
6
|
-
var __destroyHooks = [];
|
|
7
|
-
var __origOnDestroy = onDestroy;
|
|
8
|
-
onDestroy = function(fn) { __origOnDestroy(fn); __destroyHooks.push(fn); };
|
|
9
|
-
|
|
10
|
-
${c}
|
|
11
|
-
${e}})();
|
|
12
|
-
`}function Re(c,e){let r=he(c).split(",").map((u)=>u.trim()).filter(Boolean),S=new Set(G(c,!0).split(",").map((u)=>u.trim())),n=r.map((u)=>S.has(u)?` try { ${u}; Object.defineProperty(__scopeRegistration, ${JSON.stringify(u)}, ${Js(u)}); } catch (e) { /* not actually top-level */ }`:` try { __scopeRegistration[${JSON.stringify(u)}] = ${u}; } catch (e) { /* not actually top-level */ }`).join(`
|
|
13
|
-
`);return`
|
|
14
|
-
// Register scope variables for STX runtime
|
|
15
|
-
if (!window.stx._scopes) window.stx._scopes = {};
|
|
16
|
-
var __scopeRegistration = window.stx._scopes['${e}'] || { __destroyCallbacks: __destroyHooks };
|
|
17
|
-
${n}
|
|
18
|
-
// #1767: when the bundler renamed a component const that collided with an
|
|
19
|
-
// inlined import (foo -> foo2), rebind the ORIGINAL template name to the
|
|
20
|
-
// renamed declaration so it resolves to the component's value, not the
|
|
21
|
-
// shadowing import. __stxScopeRenames is emitted by bundleClientScript.
|
|
22
|
-
try { if (typeof __stxScopeRenames !== 'undefined' && __stxScopeRenames) { for (var __stxRK in __stxScopeRenames) __scopeRegistration[__stxRK] = __stxScopeRenames[__stxRK]; } } catch (e) { /* no renames */ }
|
|
23
|
-
if (typeof __stxLiveBindings !== 'undefined') Object.defineProperties(__scopeRegistration, Object.getOwnPropertyDescriptors(__stxLiveBindings));
|
|
24
|
-
window.stx._scopes['${e}'] = __scopeRegistration;
|
|
25
|
-
`}function ke(c,e){return c.replace(/<script data-stx-scoped data-stx-run="always" data-stx-owner="([^"]*)"/g,(a,r)=>r===e?a:'<script data-stx-scoped data-stx-run="always"')}function ue(c,e){let a=Re(c,e);return Ie(ve(c,a),e)}function Ie(c,e){let a=`
|
|
26
|
-
(function() {
|
|
27
|
-
var __stxScopeEl = (typeof document !== 'undefined') ? document.querySelector('[data-stx-scope="${e}"]') : null;
|
|
28
|
-
var __stxPrevEl = (typeof window !== 'undefined') ? window.__STX_CURRENT_ELEMENT__ : undefined;
|
|
29
|
-
if (__stxScopeEl && typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxScopeEl;
|
|
30
|
-
if (__stxScopeEl && typeof window !== 'undefined' && window.stx) {
|
|
31
|
-
if (!window.stx._scopes) window.stx._scopes = {};
|
|
32
|
-
window.stx._scopes['${e}'] = {};
|
|
33
|
-
}
|
|
34
|
-
var __stxEndEffects = (typeof window !== 'undefined' && window.stx && window.stx._beginEffects) ? window.stx._beginEffects() : null;
|
|
35
|
-
try {`,r=`
|
|
36
|
-
} finally {
|
|
37
|
-
// The body's effects end where its onDestroy callbacks run: with the scope
|
|
38
|
-
// when the partial has a root, with the page when it has none.
|
|
39
|
-
if (__stxEndEffects) {
|
|
40
|
-
var __stxDisposeEffects = __stxEndEffects();
|
|
41
|
-
var __stxRegistered = __stxScopeEl && window.stx._scopes && window.stx._scopes['${e}'];
|
|
42
|
-
if (__stxRegistered) __stxRegistered.__disposeEffects = __stxDisposeEffects;
|
|
43
|
-
else if (window.stx._destroyCallbacks) window.stx._destroyCallbacks.push(__stxDisposeEffects);
|
|
44
|
-
}
|
|
45
|
-
if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
|
|
46
|
-
}
|
|
47
|
-
})();`;return a+c+r}function Te(c,e){if(W(c)){let n=W(c).tag.match(/data-stx-scope="([^"]*)"/);if(n)return{html:c,mergedIntoExisting:n[1],stamped:!0,root:"body"};return{html:ut(c,(u,t)=>`<body${t} data-stx-scope="${e}">`),mergedIntoExisting:null,stamped:!0,root:"body"}}let a=Vt(c),r=c.slice(a).match(/^(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(r){let S=r[1]+r[2],n=r[1].slice(1),u=S.match(/data-stx-scope="([^"]*)"/);if(u)return{html:c,mergedIntoExisting:u[1],stamped:!0,root:n};let t=c.slice(0,a),C=r[1],z=r[2];return{html:`${t}${C} data-stx-scope="${e}"${z}${c.slice(a+r[0].length)}`,mergedIntoExisting:null,stamped:!0,root:n}}return{html:c,mergedIntoExisting:null,stamped:!1,root:null}}var Ae=0;function fe(c,e){let a=A.basename(c,".stx").replace(/[^a-zA-Z0-9]/g,"_"),r=e.__stx_scope_seq;return r?`stx_scope_${a}_${++r.n}_${r.key}`:`stx_scope_${a}_${++Ae}`}var le=new Set,pe=new Set;function py(){le.clear(),pe.clear()}var Ce=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function mg(c){let e=(t)=>t.replace(/[^\n]/g," "),a=c.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,e).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,e).replace(/<!--[\s\S]*?-->/g,e).replace(/\x00STX_HTML_COMMENT_\d+\x00/g,e).replace(/\{\{[\s\S]*?\}\}/g,e).replace(/\{!![\s\S]*?!!\}/g,e),r=[],S=0,n=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,u;while((u=n.exec(a))!==null){let t=u[1]==="/",C=u[2],z=u[3]==="/"||Ce.has(C.toLowerCase());if(t){S=Math.max(0,S-1);continue}if(S===0)r.push(C);if(!z)S++}return r}function me(c){return/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(c)}var lt=new T(500),jc=new Set;function fy(){jc.clear()}function De(c){if(c.__onceStore instanceof Set)return c.__onceStore;return jc}async function Ts(c,e,a,r,S,n=new Set){let u=r.partialsDir||A.join(A.dirname(a),"partials");if(u&&!A.isAbsolute(u))u=A.resolve(process.cwd(),u);let t=$e(c,"@partial","@include"),C=De(e);t=t.replace(/@once([\s\S]*?)@endonce/g,(f,v,h)=>{let g=v.trim(),i=`${a}:${g}`;if(C.has(i))return"";return C.add(i),v});{let f=/@includeIf\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")")i--;x++}if(i!==0)break;let l=t.substring(g+1,x-1),o=l.match(/^\s*['"]([^'"]+)['"]/);if(!o){f.lastIndex=x;continue}let O=o[1],F=z(O,u,a),E="";if(F&&await Bun.file(F).exists())S.add(F),E=`@include(${l})`;t=t.substring(0,h)+E+t.substring(x),f.lastIndex=0}}for(let[f,v]of[["@includeWhen",!1],["@includeUnless",!0]]){let h=new RegExp(`${f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),g;while((g=h.exec(t))!==null){let i=g.index,x=i+g[0].length-1,l=1,o=x+1;while(o<t.length&&l>0){if(t[o]==="(")l++;else if(t[o]===")")l--;o++}if(l!==0)break;let O=t.substring(x+1,o-1),F=ae(O,0);if(F===-1){h.lastIndex=o;continue}let E=O.substring(0,F).trim(),V=O.substring(F+1).trim(),U=V.match(/^\s*['"]([^'"]+)['"]/);if(!U){h.lastIndex=o;continue}let _=U[1],q=V.substring(U[0].length),j,R=ae(q,0);if(R!==-1)j=q.substring(R+1).trim();try{let k=`Boolean(${E})`,L;if(m(k)){let oe=p(k,Object.keys(e));L=Boolean(oe(...Object.values(e)))}else L=Boolean(d(k,e));let ee=v?!L:L,re="";if(ee){let oe=z(_,u,a);if(oe&&await Bun.file(oe).exists())S.add(oe);re=`@include('${_}'${j?`, ${j}`:""})`}t=t.substring(0,i)+re+t.substring(o),h.lastIndex=0}catch(k){let L=k instanceof Error?k.message:String(k),ee=b("Include",`Error evaluating ${f} condition: ${L}`,a,c,i);t=t.substring(0,i)+ee+t.substring(o),h.lastIndex=0}}}{let f=/@each\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),O=l.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!O){f.lastIndex=0,t=t.replace(o,"");continue}let[,F,E,V,U]=O;try{let _,q=E.trim();if(m(q))_=p(q,Object.keys(e))(...Object.values(e));else _=d(q,e);let j="";if(Array.isArray(_)&&_.length>0)for(let R of _){let k={...e,[V]:R},L=await se(F,k,c,h);j+=L}else if(U)j=await se(U,{},c,h);t=t.substring(0,h)+j+t.substring(x+1),f.lastIndex=0}catch(_){let q=_ instanceof Error?_.message:String(_);t=t.substring(0,h)+b("Each",`Error in @each: ${q}`,a,c,h)+t.substring(x+1),f.lastIndex=0}}}{let f=/@includeFirst\s*\(/g,v;while((v=f.exec(t))!==null){let h=v.index,g=h+v[0].length-1,i=1,x=g+1;while(x<t.length&&i>0){if(t[x]==="(")i++;else if(t[x]===")"){if(i--,i===0)break}x++}if(i!==0)break;let l=t.substring(g+1,x),o=t.substring(h,x+1),O=l.match(/^\s*(\[[^\]]+\])/);if(!O){f.lastIndex=0,t=t.replace(o,"");continue}let F=O[1],E=l.slice(O[0].length),V,U=E.match(/^\s*,\s*\{/);if(U){E=E.slice(U[0].length-1);let j=1,R=1;while(R<E.length&&j>0){if(E[R]==="{")j++;else if(E[R]==="}"){if(j--,j===0)break}R++}V=E.substring(0,R+1),E=E.slice(R+1)}let _,q=E.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(q)_=q[1];try{let j=JSON.parse(F.replace(/'/g,'"')),R={};if(V)try{R=M(V,e)}catch(L){let ee=L instanceof Error?L.message:String(L);if(r.debug){let re=b("Include",`Error parsing includeFirst variables: ${ee}`,a,c,h,o);t=t.replace(o,()=>re)}else t=t.replace(o,()=>_||"");continue}let k=!1;for(let L of j){let ee=z(L,u,a);if(!ee)continue;if(await s(ee)){let re=await se(L,R,c,h);t=t.replace(o,()=>re),k=!0;break}}if(!k)if(_!==void 0)t=t.replace(o,()=>_);else if(r.debug){let L=b("Include",`None of the includeFirst paths exist: ${F}`,a,c,h,o);t=t.replace(o,()=>L)}else t=t.replace(o,"")}catch(j){let R=j instanceof Error?j.message:String(j),k=b("Include",`Error processing @includeFirst: ${R}`,a,c,h,o);t=t.replace(o,()=>k)}f.lastIndex=0}}function z(f,v,h){try{let g=f;if(!f.endsWith(".stx"))g=`${f}.stx`;let i=A.resolve(v),x=A.resolve(A.dirname(h)),l;if(!g.startsWith("./")&&!g.startsWith("../")){for(let U of r._layerPartialDirs??[]){let _=A.resolve(U,g);if(_.startsWith(`${A.resolve(U)}${A.sep}`)&&ye(_))return _}l=A.resolve(v,g)}else l=A.resolve(x,g);let o=A.normalize(l),O=o.startsWith(i+A.sep)||o===i,F=o.startsWith(x+A.sep)||o===x,E=!1,V=A.dirname(x);if(o.startsWith(V+A.sep)){if(!A.relative(V,o).split(A.sep).some((j)=>j.startsWith(".")&&j!=="."&&j!==".."))E=!0}if(!O&&!F&&!E)return console.error(`Security: Path traversal attempt blocked for include path: ${f}`),console.error(` Resolved to: ${o}`),console.error(` Allowed dirs: ${i}, ${x}`),null;return o}catch(g){return console.error(`Error resolving path ${f}: ${g}`),null}}let ie=A.resolve(a);n.add(ie);function N(f,v,h,g){return r.onIncludeError?.({includePath:f,templatePath:a,message:v,partialsDir:u}),b("Include",v,a,h,g)}async function se(f,v={},h,g){let i=z(f,u,a);if(!i)return N(f,`Could not resolve path for include: ${f}`,h,g);let x=A.resolve(i);if(n.has(x)){let l=[...n,x].map((o)=>A.basename(o)).join(" -> ");return N(f,`Circular include detected: ${l}`,h,g)}try{S.add(i);let l;if(!l)try{l=await Bun.file(i).text()}catch(y){let K=y instanceof Error?y.message:String(y);return N(f,`Error loading include file ${f}: ${K}`,h,g)}if(l)l=l.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(l&&l.includes("@stream")){let{processStreamDirectives:y}=await import("./chunk-6aqr0e6s.js");l=y(l,e)}if(l&&(r.debug||!I()&&!Fn()))try{let{warnUnbalancedTags:y}=await import("./chunk-20hy5p3p.js");y(l,i)}catch{}try{let{processESImports:y}=await import("./chunk-7ar11ccn.js");l=await y(l,e,i,r,S)}catch(y){if(r.debug)console.warn(`[stx] partial ES import extraction skipped for ${i}:`,y instanceof Error?y.message:y)}let o=l,O=B(o);if(O)o=O.content.trim();let E=l.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),V="";if(E)V=`<style${E[1]}>${E[2]}</style>`;let U=[];o=o.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(y,K,w)=>{if(!me(K))return"";return U.push({attrs:K,body:w}),`__STX_DATA_BLOCK_${U.length-1}__`}),o=o.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let _={...e};_.__stx_signals_gate=Me(l,i);for(let[y,K]of Object.entries(v))_[y]=K;let q=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,j=[...l.matchAll(q)].sort((y,K)=>{let w=(y[1]||"").includes("server"),X=(K[1]||"").includes("server");return Number(X)-Number(w)}),R="",k=null,L=!1,ee=!1;for(let y of j){let K=y[1]||"",w=y[2]||"";if(me(K))continue;let X=K.includes("server"),be=Ye(K);if(!X&&!/\bsrc\s*=/i.test(K))Ke(w,i,r.strict);if(!X&&w.trim()){let{interpolateScriptExpressions:Z}=await import("./chunk-kcpxqsdj.js");w=Z(w,_,f)}let ce="";try{let{extractAndStripCssImports:Z,renderVendorStyleTags:Q}=await import("./chunk-7fc0vrs5.js"),ne=Z(w,{filePath:i,projectRoot:process.cwd()});w=ne.code,ce=Q(ne.styles)}catch(Z){if(r.debug)console.warn(`[stx] vendor-css extractor skipped for ${i}:`,Z instanceof Error?Z.message:Z)}if(be&&w.trim())w=Ze(w);if(!X){try{let{injectBrowserCoreAutoImports:Q}=await import("./chunk-7fc0vrs5.js");w=Q(w).code;let{hasUserImports:ne,bundleClientScript:Se}=await import("./chunk-wq17dce6.js");if(ne(w))w=await Se(w,i,{projectRoot:process.cwd()})}catch(Q){if(r.debug)console.warn(`[stx] bundler skipped for ${i}:`,Q instanceof Error?Q.message:Q)}let{stripStxRuntimeImports:Z}=await import("./chunk-8x3yaahc.js");w=Z(w)}let de=Ee(w);if(!X){let{extractBridgeData:Z,generateServerDataBridge:Q}=await import("./chunk-7fc0vrs5.js"),ne=Q(w,Z(_));if(ne)w=`${ne}
|
|
48
|
-
${w}`}if(de&&!X){L=!0,k=fe(i,e);let Z=D(w),Q=ue(Z,k);R+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${k}">${Q}</script>
|
|
49
|
-
`;continue}if(X)try{let{extractVariables:Z}=await import("./chunk-4pve3r5a.js");await Z(w,_,i)}catch(Z){if(r.debug)console.warn(`Warning: Could not extract variables from server script in ${i}:`,Z)}if(!X&&!de){let Z=K.replace(/\bclient\b/i,"").trim();k=fe(i,e);let Q=D(w),ne=ue(Q,k);if(/__scopeRegistration\["(?!__stx)[^"]+"\]\s*=|Object\.defineProperty\(__scopeRegistration, "(?!__stx)/.test(ne))ee=!0;R+=`${ce}<script data-stx-scoped data-stx-run="always" data-stx-owner="${k}"${Z?` ${Z}`:""}>${ne}</script>
|
|
50
|
-
`}}if(U.length>0){let{interpolateScriptExpressions:y}=await import("./chunk-kcpxqsdj.js");o=o.replace(/__STX_DATA_BLOCK_(\d+)__/g,(K,w)=>{let X=U[Number(w)];return`<script${X.attrs}>${y(X.body,_,f)}</script>`})}if(k){let y=Te(o,k);if(o=y.html,y.mergedIntoExisting){let w=k,X=y.mergedIntoExisting;R=R.split(`'${w}'`).join(`'${X}'`).split(`"${w}"`).join(`"${X}"`),k=X}else if(!y.stamped&&L&&!le.has(i))le.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares signals but has no element to scope them to, so nothing in it will hydrate. Wrap the partial's markup in a single root element.`);if(y.stamped&&y.root!=="body"&&(L||ee)&&!pe.has(i)){let w=mg(o);if(w.length>1)pe.add(i),console.warn(`[stx] ${A.relative(process.cwd(),i)} declares ${L?"signals":"bindings"} and has ${w.length} top-level elements (${w.map((X)=>`<${X}>`).join(", ")}). Only the first is scoped, so bindings in the others cannot see what this partial's script declares. Wrap the partial's markup in a single root element.`)}let K=y.stamped&&y.root!==null&&Fr(y.root);R=ke(R,K?k:null)}if(o.includes("@include")||o.includes("@partial"))o=await Ts(o,_,i,r,S,n);let{processLoops:re,reportDeferredLoopWarnings:oe}=await import("./chunk-s2c0ynn9.js"),J=re(o,_,i,void 0,!0);J=ge(J,_,i),J=oe(J);let{processMetaDirectives:xe,processSeoDirective:_e,processStructuredData:we}=await import("./chunk-na0e3s88.js");if(J=xe(J,_,i,r),J=we(J,_,i),J=_e(J,_,i,r),J=P(J,_,i),V)J+=`
|
|
51
|
-
`+V;if(R)J+=`
|
|
52
|
-
`+R;return J}catch(l){if(l instanceof te)throw l;let o=l instanceof Error?l.message:String(l);return N(f,`Error processing include ${f}: ${o}`,h,g)}}let Y=/@include\s*\(/g,H;while((H=Y.exec(t))!==null){let f=H.index,v=f+H[0].length-1,h=1,g=v+1;while(g<t.length&&h>0){if(t[g]==="(")h++;else if(t[g]===")")h--;g++}if(h!==0)break;let i=t.substring(f,g),x=t.substring(v+1,g-1),l=x.match(/^\s*['"]([^'"]+)['"]/);if(!l){Y.lastIndex=g;continue}let o=l[1],O,F=x.substring(l[0].length),E=ae(F,0);if(E!==-1)O=F.substring(E+1).trim();let V={};if(O)try{V=M(O,e)}catch(_){let q=_ instanceof Error?_.message:String(_);t=t.replace(i,b("Include",`Error parsing include variables for ${o}: ${q}`,a,c,f)),Y.lastIndex=0;continue}let U=await se(o,V,c,f);t=t.substring(0,f)+U+t.substring(g),Y.lastIndex=0}return t}function $s(c,e){let a=c;function r(S,n,u,t){let C=S,z=!0;while(z){z=!1;let ie=new RegExp(`@${n}\\(['"]([^'"]+)['"]\\)`),N=C.match(ie);if(!N||N.index===void 0)break;let se=N.index,Y=N[1],H=se+N[0].length,f=new RegExp(`@${n}\\(`),v=new RegExp(`@${u}(?![a-z])`),h=1,g=H,i=-1;while(h>0&&g<C.length){let l=C.slice(g),o=l.match(f),O=l.match(v),F=o?g+o.index:1/0,E=O?g+O.index:1/0;if(F<E)h++,g=F+(o[0].length||1);else if(E<1/0){if(h--,h===0){i=E;break}g=E+u.length+1}else break}if(i===-1)break;let x=C.slice(H,i);if(!e[Y])e[Y]=[];if(t)e[Y].unshift(x);else e[Y].push(x);C=C.substring(0,se)+C.substring(i+`@${u}`.length),z=!0}return C}return a=r(a,"push","endpush",!1),a=r(a,"prepend","endprepend",!0),a}function Rs(c,e){return c.replace(/@stack\(['"]([^'"]+)['"]\)/g,(a,r)=>{if(!e[r]||e[r].length===0)return"";return e[r].join(`
|
|
53
|
-
`)})}
|
|
54
|
-
export{py,mg,lt,jc,fy,Ts,$s,Rs};
|
package/dist/chunk-4e18r89n.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import i from"path";var En=".stx",o="STX_DIR",e=null;function il(t){e=t?.trim()||null}function Ir(){return process.env[o]?.trim()||e||En}function l(t=process.cwd(),...n){let r=Ir();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function Or(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==En&&!n.startsWith(`${En}/`))return t;let r=n.slice(En.length+1);return r?i.join(Ir(),r):Ir()}
|
|
3
|
-
export{En,il,Ir,l,Or};
|
package/dist/chunk-4pve3r5a.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ht,Mg,Dg,Lg,jg,Bg,y,Fg,Ui,zg,_l,Cl}from"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{ht as STX_ENGINE_BINDING_NAMES,Ui as convertToCommonJS,_l as extractScriptFromTemplate,y as extractVariables,Cl as hasVariables,Fg as isCompleteImport,Bg as isMissingBindingFailure,Lg as isModuleResolutionFailure,jg as isSyntaxFailure,zg as splitDeclaration,Mg as stripTypeScript,Dg as withoutStxReferrer};
|