@stacksjs/stx 0.2.91 → 0.2.93
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/a11y.js +1 -1
- package/dist/analytics.js +1 -1
- package/dist/analyzer.js +1 -1
- package/dist/animation.js +1 -1
- package/dist/app-shell.js +1 -1
- package/dist/app.js +1 -1
- package/dist/assets.js +1 -1
- package/dist/ast.js +1 -1
- package/dist/async-components.js +1 -1
- package/dist/auth.js +1 -1
- package/dist/broadcasting.js +1 -1
- package/dist/browser-composables.js +1 -1
- package/dist/build-assets.js +1 -1
- package/dist/build-mode-detector.js +1 -1
- package/dist/build-optimizer.js +1 -1
- package/dist/build-views.js +1 -1
- package/dist/build.js +1 -1
- package/dist/builtins/drawer.js +1 -1
- package/dist/builtins/escape.js +1 -1
- package/dist/builtins/icon.js +1 -1
- package/dist/builtins/index.js +1 -1
- package/dist/builtins/modal.js +1 -1
- package/dist/builtins/safe-image.js +1 -1
- package/dist/builtins/stx-image.js +1 -1
- package/dist/builtins/stx-link.js +1 -1
- package/dist/builtins/stx-loading-indicator.js +1 -1
- package/dist/builtins/suspense.js +1 -1
- package/dist/builtins/toast.js +1 -1
- package/dist/builtins/tooltip.js +1 -1
- package/dist/builtins/transition-group.js +1 -1
- package/dist/bundle-analyzer/collector.js +1 -1
- package/dist/bundle-analyzer/index.js +1 -1
- package/dist/bundle-analyzer/report.js +1 -1
- package/dist/bundle-analyzer/treemap.js +1 -1
- package/dist/caching.js +1 -1
- package/dist/{chunk-5y4q9abj.js → chunk-04n64bnt.js} +1 -1
- package/dist/{chunk-7m6jbrky.js → chunk-06w68hyg.js} +2 -2
- package/dist/{chunk-ccgmxmjk.js → chunk-07y6m5xx.js} +1 -1
- package/dist/{chunk-j25swncq.js → chunk-095s3972.js} +1 -1
- package/dist/{chunk-ckz0ppkr.js → chunk-09k66d8a.js} +1 -1
- package/dist/{chunk-tqzv7g2r.js → chunk-0a61y94n.js} +2 -2
- package/dist/{chunk-exfw0aqe.js → chunk-0dx4q6yq.js} +1 -1
- package/dist/{chunk-t1dzvz5z.js → chunk-0dz85jrp.js} +1 -1
- package/dist/{chunk-k7yp9h17.js → chunk-0jd0pndq.js} +1 -1
- package/dist/{chunk-r738cjs3.js → chunk-0p0nyq50.js} +2 -2
- package/dist/{chunk-ke7rcrfm.js → chunk-0p1h3p3w.js} +1 -1
- package/dist/{chunk-9pzdyd8q.js → chunk-0qnz93q2.js} +2 -2
- package/dist/{chunk-j6d9ksyj.js → chunk-10debkj5.js} +1 -1
- package/dist/{chunk-pzc0bs5r.js → chunk-15nesxgt.js} +2 -2
- package/dist/{chunk-snj1hfpb.js → chunk-1sr54zp8.js} +1 -1
- package/dist/{chunk-3whqk46c.js → chunk-1v49fwr5.js} +1 -1
- package/dist/chunk-1xz0w746.js +1539 -0
- package/dist/{chunk-jmky0qzm.js → chunk-1z5nhbjt.js} +1 -1
- package/dist/{chunk-qhrcts5t.js → chunk-20swzkx3.js} +1 -1
- package/dist/{chunk-jm460jxs.js → chunk-27zsyhrd.js} +1 -1
- package/dist/{chunk-t88cgftn.js → chunk-29y0hk5z.js} +2 -2
- package/dist/{chunk-zv9jfm2f.js → chunk-2cdvw21b.js} +1 -1
- package/dist/{chunk-2rd0ykrg.js → chunk-2j21d3ka.js} +1 -1
- package/dist/chunk-2jxbwnkz.js +2 -0
- package/dist/{chunk-a2xzs4kd.js → chunk-31dr4bys.js} +2 -2
- package/dist/{chunk-08ncwhv7.js → chunk-35faj94w.js} +1 -1
- package/dist/{chunk-nv3k4bf9.js → chunk-39gm08bn.js} +1 -1
- package/dist/{chunk-dtcj9r7p.js → chunk-3a4qsygv.js} +2 -2
- package/dist/{chunk-xkzz5rb0.js → chunk-3te20hqw.js} +2 -2
- package/dist/{chunk-z06myqr1.js → chunk-43t7faps.js} +2 -2
- package/dist/{chunk-jcjzg6r5.js → chunk-47kpewks.js} +1 -1
- package/dist/{chunk-my0qmjw4.js → chunk-4d2y57k7.js} +2 -2
- package/dist/{chunk-c9f5k95v.js → chunk-4deg33rw.js} +2 -2
- package/dist/{chunk-t38vt890.js → chunk-4k7d8p8d.js} +1 -1
- package/dist/{chunk-n2wmny2b.js → chunk-4qcy5tx6.js} +2 -2
- package/dist/{chunk-9d0q9k3p.js → chunk-4x7kae4j.js} +2 -2
- package/dist/{chunk-qr72av66.js → chunk-55nwdnsd.js} +1 -1
- package/dist/{chunk-1vz36hw3.js → chunk-55yp0q8t.js} +1 -1
- package/dist/{chunk-rqwhb85x.js → chunk-5f43yz6z.js} +2 -2
- package/dist/{chunk-b0w1cm1s.js → chunk-5shey2e4.js} +1 -1
- package/dist/{chunk-b37f9ebf.js → chunk-6b5k6w2q.js} +1 -1
- package/dist/{chunk-zwdargbj.js → chunk-6djzdes9.js} +1 -1
- package/dist/{chunk-knefeadt.js → chunk-6e4c6g46.js} +2 -2
- package/dist/{chunk-0fsrhs3d.js → chunk-6eqbxcrd.js} +1 -1
- package/dist/{chunk-9p45wwff.js → chunk-7074g241.js} +1 -1
- package/dist/{chunk-88wdr7f3.js → chunk-7b6s3g65.js} +1 -1
- package/dist/{chunk-5wecgn5n.js → chunk-7cgmq685.js} +1 -1
- package/dist/{chunk-eghdf4qq.js → chunk-7dkz6z2s.js} +2 -2
- package/dist/{chunk-h6s1thg6.js → chunk-7ed3tean.js} +1 -1
- package/dist/{chunk-zr8631g4.js → chunk-7gd339hd.js} +1 -1
- package/dist/{chunk-vbysnq00.js → chunk-7j5e8sdj.js} +2 -2
- package/dist/{chunk-j55xkgq8.js → chunk-7n8g0nfn.js} +2 -2
- package/dist/{chunk-31w1xfs1.js → chunk-80g54ncj.js} +1 -1
- package/dist/{chunk-6wqrqn2x.js → chunk-8a5bxece.js} +2 -2
- package/dist/{chunk-nsbwxkj5.js → chunk-8ahwt6a4.js} +2 -2
- package/dist/{chunk-y92w0240.js → chunk-8b3z0zd5.js} +1 -1
- package/dist/{chunk-2hnv9414.js → chunk-8dhdpa5h.js} +2 -2
- package/dist/{chunk-04yrgvdd.js → chunk-8n9nnqr6.js} +1 -1
- package/dist/{chunk-h1035wzj.js → chunk-8qc1bsym.js} +1 -1
- package/dist/{chunk-0n11c9hw.js → chunk-8va64c9n.js} +2 -2
- package/dist/{chunk-yssvz8zs.js → chunk-8vtm0m84.js} +1 -1
- package/dist/{chunk-c23697dp.js → chunk-8xj7c3mf.js} +1 -1
- package/dist/{chunk-8g0jb444.js → chunk-988dw6q3.js} +2 -2
- package/dist/{chunk-ktvdeqjr.js → chunk-9b6cec0v.js} +1 -1
- package/dist/{chunk-m911bf2b.js → chunk-9cf97f9p.js} +2 -2
- package/dist/{chunk-xgmza98t.js → chunk-9ecv8aqj.js} +1 -1
- package/dist/{chunk-ydhza16t.js → chunk-9eq3ht5f.js} +1 -1
- package/dist/{chunk-sd2c11bp.js → chunk-9jtj77jx.js} +2 -2
- package/dist/{chunk-yywc3yge.js → chunk-9t14se2t.js} +1 -1
- package/dist/{chunk-w719zps0.js → chunk-9wmq2272.js} +1 -1
- package/dist/{chunk-wk7mgg5n.js → chunk-9zbk5zx5.js} +2 -2
- package/dist/{chunk-rdaavfsg.js → chunk-a2g2qb2y.js} +1 -1
- package/dist/{chunk-agzvhej1.js → chunk-a3hyn4we.js} +1 -1
- package/dist/{chunk-fk6ted7p.js → chunk-a87qqft6.js} +2 -2
- package/dist/{chunk-md4j8nch.js → chunk-ah88wzbg.js} +1 -1
- package/dist/{chunk-wdtanmx1.js → chunk-akf1r75r.js} +1 -1
- package/dist/{chunk-xw9skf0n.js → chunk-amaa1bev.js} +1 -1
- package/dist/{chunk-rth1890k.js → chunk-avx8aydt.js} +2 -2
- package/dist/{chunk-kh976zgv.js → chunk-ay9qf4zj.js} +1 -1
- package/dist/{chunk-aaaxvn5r.js → chunk-aywxfqev.js} +1 -1
- package/dist/{chunk-19f7xyy7.js → chunk-azkegjd8.js} +2 -2
- package/dist/{chunk-tgvekhwz.js → chunk-b77wjyn7.js} +1 -1
- package/dist/{chunk-tj9kmtnx.js → chunk-baf1hfwh.js} +2 -2
- package/dist/{chunk-zxxt0c9q.js → chunk-bdk6g1vj.js} +2 -2
- package/dist/{chunk-j1myedcr.js → chunk-bhqgmyqw.js} +1 -1
- package/dist/{chunk-13mkbvxc.js → chunk-bk3j0n82.js} +1 -1
- package/dist/{chunk-jtx73fsh.js → chunk-bndmdahk.js} +2 -2
- package/dist/{chunk-nacsxc1r.js → chunk-bpgg59wa.js} +1 -1
- package/dist/{chunk-xmjedbkt.js → chunk-bs3gmfxz.js} +1 -1
- package/dist/{chunk-dnkq5y2j.js → chunk-bxc7kjsk.js} +2 -2
- package/dist/{chunk-0qzxbxgp.js → chunk-c7jg8w13.js} +1 -1
- package/dist/{chunk-nh418dpm.js → chunk-ckxjqqn9.js} +2 -2
- package/dist/{chunk-tfjem6g3.js → chunk-d0zjtdw4.js} +2 -2
- package/dist/{chunk-4bpb2es7.js → chunk-d1qh1x2g.js} +2 -2
- package/dist/{chunk-6jhqq7es.js → chunk-djddhmcc.js} +1 -1
- package/dist/{chunk-5tv1swsr.js → chunk-dqn9gyhb.js} +1 -1
- package/dist/{chunk-krxvy5wr.js → chunk-drjq2zwg.js} +2 -2
- package/dist/{chunk-cf86cs0k.js → chunk-dvfs1h3c.js} +2 -2
- package/dist/{chunk-p4wm4a45.js → chunk-e2q9c5vq.js} +2 -2
- package/dist/{chunk-pthx7bxa.js → chunk-e98v1bc6.js} +2 -2
- package/dist/chunk-ejayeex8.js +2 -0
- package/dist/{chunk-a4zj7qpt.js → chunk-ejh8fyak.js} +1 -1
- package/dist/{chunk-fh1d8bxd.js → chunk-ek2w6zvy.js} +1 -1
- package/dist/{chunk-0m53nxvy.js → chunk-ewa88139.js} +1 -1
- package/dist/{chunk-pjaa8q7x.js → chunk-fjk3x41y.js} +2 -2
- package/dist/{chunk-6sx4d083.js → chunk-frg705zq.js} +1 -1
- package/dist/{chunk-acry1mfc.js → chunk-fzm3y0r3.js} +1 -1
- package/dist/{chunk-4wsmprpm.js → chunk-g1vt329s.js} +12 -12
- package/dist/{chunk-zxsqbve0.js → chunk-g4ps1dj8.js} +2 -2
- package/dist/{chunk-x6n8z1n8.js → chunk-gkzq8zw4.js} +1 -1
- package/dist/{chunk-hkjq64we.js → chunk-gz5fmp3q.js} +1 -1
- package/dist/{chunk-ddst5g08.js → chunk-h0hjy0kn.js} +1 -1
- package/dist/{chunk-e792k31a.js → chunk-h5jxydqq.js} +1 -1
- package/dist/{chunk-at9v5saf.js → chunk-h5wa62ek.js} +1 -1
- package/dist/{chunk-91gyjg5c.js → chunk-h7aq56qj.js} +2 -2
- package/dist/{chunk-ecabspxs.js → chunk-h82kjdr4.js} +1 -1
- package/dist/{chunk-xxgdw2s8.js → chunk-hbehnm18.js} +2 -2
- package/dist/{chunk-v9199ywv.js → chunk-hbgxbgam.js} +2 -2
- package/dist/{chunk-5e2khb7q.js → chunk-hc2mf5h6.js} +2 -2
- package/dist/{chunk-r7d26vjj.js → chunk-hjm2xab3.js} +1 -1
- package/dist/{chunk-y248bdr9.js → chunk-hrnnh4tq.js} +2 -2
- package/dist/{chunk-fze9db64.js → chunk-ht43ds42.js} +2 -2
- package/dist/{chunk-22xxm2x5.js → chunk-hxx3za24.js} +1 -1
- package/dist/{chunk-nqxqy9v2.js → chunk-hy8820vc.js} +1 -1
- package/dist/{chunk-fbbv5x9m.js → chunk-j447q024.js} +2 -2
- package/dist/{chunk-am5rtv86.js → chunk-j58vh0w6.js} +1 -1
- package/dist/{chunk-sgsb5xp4.js → chunk-j8tn8enq.js} +2 -2
- package/dist/{chunk-vwp4dw7e.js → chunk-jc0fc4ht.js} +1 -1
- package/dist/{chunk-kemb0fyc.js → chunk-jcs0ymw7.js} +1 -1
- package/dist/{chunk-fnt3srfr.js → chunk-jjamhxpm.js} +1 -1
- package/dist/{chunk-w7bgs9ze.js → chunk-jjb05d21.js} +2 -2
- package/dist/{chunk-g3f1xq76.js → chunk-jjdq01dv.js} +1 -1
- package/dist/{chunk-a33kr9b0.js → chunk-jnmgm2xw.js} +1 -1
- package/dist/{chunk-kqtchwz7.js → chunk-jpndqst5.js} +1 -1
- package/dist/{chunk-1hyk728h.js → chunk-jt0ezawy.js} +1 -1
- package/dist/{chunk-w4a3cvtp.js → chunk-jz73j3qs.js} +1 -1
- package/dist/{chunk-n3k3e9n5.js → chunk-k21df0pg.js} +1 -1
- package/dist/{chunk-dcp0znhd.js → chunk-k848dzsa.js} +1 -1
- package/dist/{chunk-4e3yxhkd.js → chunk-kdfe4t91.js} +2 -2
- package/dist/{chunk-7aph6rw7.js → chunk-keawsbpn.js} +1 -1
- package/dist/{chunk-jdy93c39.js → chunk-kgym7ch9.js} +1 -1
- package/dist/{chunk-1htmc8mb.js → chunk-khdn7jwe.js} +2 -2
- package/dist/{chunk-f9j3mr9z.js → chunk-km25cwz6.js} +1 -1
- package/dist/{chunk-r1m8g439.js → chunk-knm8a8yx.js} +1 -1
- package/dist/{chunk-zepv7y44.js → chunk-krqn0ddk.js} +2 -2
- package/dist/{chunk-2aydpj2n.js → chunk-kx6eb6ma.js} +1 -1
- package/dist/{chunk-syffx53n.js → chunk-kypas8vy.js} +2 -2
- package/dist/{chunk-npj33yqb.js → chunk-m167kjhv.js} +1 -1
- package/dist/{chunk-x4qr3b2z.js → chunk-m491r0rj.js} +1 -1
- package/dist/{chunk-ktpc2rc4.js → chunk-m8448qby.js} +1 -1
- package/dist/{chunk-fk0m346m.js → chunk-mgj88zeq.js} +2 -2
- package/dist/{chunk-7sd6c9wv.js → chunk-mhgk632d.js} +1 -1
- package/dist/{chunk-sn7pmfn4.js → chunk-n5kg7fpx.js} +1 -1
- package/dist/{chunk-02bd1cng.js → chunk-n98x35xd.js} +1 -1
- package/dist/{chunk-4ep9gk7d.js → chunk-n9dhs1dw.js} +1 -1
- package/dist/{chunk-8x58wmgs.js → chunk-nd9rmddh.js} +2 -2
- package/dist/{chunk-xm3hz63f.js → chunk-ngxfwzq3.js} +1 -1
- package/dist/{chunk-tavtph8x.js → chunk-nhv099jv.js} +1 -1
- package/dist/{chunk-1k3k1tf8.js → chunk-nm15ccsg.js} +2 -2
- package/dist/{chunk-2g16stee.js → chunk-npfmdb6y.js} +2 -2
- package/dist/{chunk-fngb9apr.js → chunk-nvwb4x04.js} +1 -1
- package/dist/{chunk-ydhrdatx.js → chunk-nw34xajc.js} +1 -1
- package/dist/{chunk-9v7q6xn4.js → chunk-p077sw22.js} +1 -1
- package/dist/{chunk-hrgg37a9.js → chunk-p1h8065h.js} +2 -2
- package/dist/{chunk-tb9c2mq7.js → chunk-p3e0cqtt.js} +2 -2
- package/dist/{chunk-gapx9vqm.js → chunk-p3fpb79v.js} +1 -1
- package/dist/{chunk-c7zedzbg.js → chunk-p52yzjq6.js} +2 -2
- package/dist/{chunk-wtgrc6ya.js → chunk-p73meypx.js} +1 -1
- package/dist/{chunk-9fj7hpwa.js → chunk-pa9zb7ty.js} +1 -1
- package/dist/{chunk-3wth4wa6.js → chunk-payfb24w.js} +1 -1
- package/dist/{chunk-tzehzwyr.js → chunk-pcm1vd8w.js} +1 -1
- package/dist/{chunk-h3mb2q51.js → chunk-pcntd9h4.js} +2 -2
- package/dist/{chunk-xecnz132.js → chunk-pg1fvqb9.js} +1 -1
- package/dist/{chunk-hdv4tnvh.js → chunk-psc3wfcf.js} +2 -2
- package/dist/{chunk-1qy4gac6.js → chunk-pznnww6k.js} +2 -2
- package/dist/{chunk-6e08xfzp.js → chunk-q6zhd9yf.js} +1 -1
- package/dist/{chunk-crjrbczd.js → chunk-qa59zejf.js} +3 -3
- package/dist/{chunk-r6sb1sm4.js → chunk-qvrbjpdc.js} +2 -2
- package/dist/{chunk-sk1gmrr8.js → chunk-qygvvygy.js} +2 -2
- package/dist/{chunk-wntaqqhz.js → chunk-r0jcmpv6.js} +1 -1
- package/dist/{chunk-t7ghqd7e.js → chunk-r5m9xtm7.js} +2 -2
- package/dist/{chunk-kpp2baaz.js → chunk-rkffm9sy.js} +1 -1
- package/dist/{chunk-xnf61ake.js → chunk-rpx5fa65.js} +2 -2
- package/dist/{chunk-1yg3x73j.js → chunk-rqxf5hns.js} +1 -1
- package/dist/{chunk-f7f4g33p.js → chunk-rtr974rc.js} +2 -2
- package/dist/{chunk-fyq5573f.js → chunk-rvptcndz.js} +2 -2
- package/dist/{chunk-bdp5z6mt.js → chunk-rw26rpek.js} +2 -2
- package/dist/{chunk-gfj0a29j.js → chunk-rw7937v4.js} +2 -2
- package/dist/{chunk-zvyc82ke.js → chunk-rwrv9wbf.js} +1 -1
- package/dist/{chunk-bg1xym0q.js → chunk-rz2ec6g7.js} +1 -1
- package/dist/{chunk-64bwamng.js → chunk-s6ja2bdg.js} +1 -1
- package/dist/{chunk-4ewrwqwn.js → chunk-scpkdrdb.js} +1 -1
- package/dist/{chunk-29qrr0nc.js → chunk-shv88d2d.js} +2 -2
- package/dist/{chunk-8xbj6dqe.js → chunk-t0c9wvpr.js} +1 -1
- package/dist/{chunk-f228sm5e.js → chunk-tffh3b1e.js} +1 -1
- package/dist/{chunk-3rgj1qn6.js → chunk-tg2f1mzq.js} +2 -2
- package/dist/{chunk-fcpxs8mm.js → chunk-trfswy66.js} +1 -1
- package/dist/{chunk-rkr7cgs8.js → chunk-tzwtg722.js} +1 -1
- package/dist/{chunk-a50svyjn.js → chunk-v7f8jj15.js} +1 -1
- package/dist/{chunk-qvmrwh8n.js → chunk-v8j49spx.js} +1 -1
- package/dist/{chunk-zwpm1pa8.js → chunk-vcr5pzpx.js} +1 -1
- package/dist/{chunk-j0mbt7fb.js → chunk-veeerpwa.js} +2 -2
- package/dist/{chunk-p993psbk.js → chunk-vg5kt6az.js} +1 -1
- package/dist/{chunk-hd27hhzr.js → chunk-vgv7jvyz.js} +1 -1
- package/dist/{chunk-9ezvda3j.js → chunk-vjbefncc.js} +1 -1
- package/dist/{chunk-e8x46y38.js → chunk-vmxjghsm.js} +1 -1
- package/dist/{chunk-dkt9p3bk.js → chunk-vw7vqd76.js} +1 -1
- package/dist/{chunk-p5j0686t.js → chunk-w3b6m427.js} +1 -1
- package/dist/{chunk-593x2ccf.js → chunk-wazkqv7n.js} +2 -2
- package/dist/{chunk-bgan5edn.js → chunk-wf7zrjsw.js} +1 -1
- package/dist/{chunk-b5xf2v7f.js → chunk-wfg2gm11.js} +1 -1
- package/dist/{chunk-1w3354fv.js → chunk-wg9k6h8w.js} +2 -2
- package/dist/{chunk-dcpbe8a1.js → chunk-wkz2vwkr.js} +2 -2
- package/dist/{chunk-mp9dsjrg.js → chunk-wvef3ngh.js} +1 -1
- package/dist/{chunk-w3e1fm1q.js → chunk-wvf31nzs.js} +1 -1
- package/dist/{chunk-1bzckhs2.js → chunk-x05nxhyv.js} +2 -2
- package/dist/{chunk-ybe2cpx1.js → chunk-x0770gt9.js} +1 -1
- package/dist/{chunk-ds6g241c.js → chunk-x24s4heg.js} +1 -1
- package/dist/{chunk-f6s1jx8c.js → chunk-x3r64r0c.js} +2 -2
- package/dist/{chunk-n7j8tczc.js → chunk-x5g9w4hh.js} +2 -2
- package/dist/{chunk-nsrqf0dg.js → chunk-xgkv66q5.js} +1 -1
- package/dist/{chunk-kyhq6hzp.js → chunk-xs03kc1h.js} +1 -1
- package/dist/{chunk-6r70w54p.js → chunk-xv34zbp4.js} +1 -1
- package/dist/{chunk-zhr3za7x.js → chunk-xw36p73h.js} +2 -2
- package/dist/{chunk-ms6793rw.js → chunk-xyg1r5w0.js} +2 -2
- package/dist/{chunk-1bknva4p.js → chunk-xys2sxh6.js} +1 -1
- package/dist/{chunk-vg97xcma.js → chunk-y0qg6rrv.js} +1 -1
- package/dist/{chunk-04jkv9xx.js → chunk-y1k17c8b.js} +2 -2
- package/dist/{chunk-zasq08k3.js → chunk-y5xz0jc4.js} +1 -1
- package/dist/{chunk-sx35cb80.js → chunk-y6xsqe9a.js} +2 -2
- package/dist/{chunk-7t4hkmxb.js → chunk-yb1t2h8h.js} +2 -2
- package/dist/{chunk-c03qara0.js → chunk-ygvyc6wv.js} +1 -1
- package/dist/{chunk-71n355cg.js → chunk-yj4x5ehw.js} +2 -2
- package/dist/{chunk-pdv5dhen.js → chunk-yn38c15w.js} +1 -1
- package/dist/{chunk-dgf2g708.js → chunk-ynhngsdh.js} +1 -1
- package/dist/{chunk-hkabmxjj.js → chunk-yrsb6j3z.js} +2 -2
- package/dist/chunk-yywfvfph.js +2 -0
- package/dist/{chunk-fp417rws.js → chunk-zcxzdrn7.js} +2 -2
- package/dist/{chunk-gcsqn7x9.js → chunk-zen6ax1y.js} +2 -2
- package/dist/{chunk-vawc9ak6.js → chunk-zf2pek72.js} +1 -1
- package/dist/{chunk-zmsj7wh8.js → chunk-zk3d0jjf.js} +1 -1
- package/dist/{chunk-6zhv4fcq.js → chunk-zy3rp1ab.js} +1 -1
- package/dist/cli.js +10934 -10934
- package/dist/client/directive.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client-helpers.js +1 -1
- package/dist/client-script-bundler.js +1 -1
- package/dist/client-script.js +1 -1
- package/dist/client.js +0 -86
- package/dist/component-hmr.js +1 -1
- package/dist/component-processing.js +1 -1
- package/dist/component-registry.js +1 -1
- package/dist/component-renderer.js +1 -1
- package/dist/components.js +1 -1
- package/dist/composables/index.js +1 -1
- package/dist/composables/use-battery.js +1 -1
- package/dist/composables/use-broadcast-channel.js +1 -1
- package/dist/composables/use-channel.js +1 -1
- package/dist/composables/use-clipboard.js +1 -1
- package/dist/composables/use-color-mode.js +1 -1
- package/dist/composables/use-cookie.js +1 -1
- package/dist/composables/use-device-orientation.js +1 -1
- package/dist/composables/use-event-listener.js +1 -1
- package/dist/composables/use-event-source.js +1 -1
- package/dist/composables/use-eye-dropper.js +1 -1
- package/dist/composables/use-fetch.js +1 -1
- package/dist/composables/use-fullscreen.js +1 -1
- package/dist/composables/use-geolocation.js +1 -1
- package/dist/composables/use-idle.js +1 -1
- package/dist/composables/use-intersection-observer.js +1 -1
- package/dist/composables/use-keyboard.js +1 -1
- package/dist/composables/use-media-query.js +1 -1
- package/dist/composables/use-meta.js +1 -1
- package/dist/composables/use-mouse.js +1 -1
- package/dist/composables/use-mutation-observer.js +1 -1
- package/dist/composables/use-network.js +1 -1
- package/dist/composables/use-notification.js +1 -1
- package/dist/composables/use-permissions.js +1 -1
- package/dist/composables/use-resize-observer.js +1 -1
- package/dist/composables/use-router.js +1 -1
- package/dist/composables/use-share.js +1 -1
- package/dist/composables/use-speech.js +1 -1
- package/dist/composables/use-storage.js +1 -1
- package/dist/composables/use-text-selection.js +3 -1
- package/dist/composables/use-timer.js +1 -1
- package/dist/composables/use-utilities.js +1 -1
- package/dist/composables/use-wake-lock.js +1 -1
- package/dist/composables/use-websocket.js +1 -1
- package/dist/composables/use-window.js +1 -1
- package/dist/composables.js +1 -1
- package/dist/composition-api.js +1 -1
- package/dist/computed.js +1 -1
- package/dist/conditionals.js +1 -1
- package/dist/config.js +1 -1
- package/dist/craft-bridge.js +1 -1
- package/dist/craft-compiler.js +1 -1
- package/dist/craft-components.js +1 -1
- package/dist/craft-entry.js +1 -1
- package/dist/craft-ssr.js +1 -1
- package/dist/csp.js +1 -1
- package/dist/csrf.js +1 -1
- package/dist/custom-directives.js +1 -1
- package/dist/defer.js +1 -1
- package/dist/deploy/config-generators.js +1 -1
- package/dist/deploy/index.js +1 -1
- package/dist/deploy/netlify.js +1 -1
- package/dist/dev-server/crosswind.js +1 -1
- package/dist/dev-server/index.js +1 -1
- package/dist/dev-server/keyboard-shortcuts.js +1 -1
- package/dist/dev-server/native-window.js +1 -1
- package/dist/dev-server/port-utils.js +1 -1
- package/dist/dev-server/serve-app.js +1 -1
- package/dist/dev-server/serve-file.js +1 -1
- package/dist/dev-server/serve-markdown.js +1 -1
- package/dist/dev-server/serve-multi.js +1 -1
- package/dist/dev-server/terminal-colors.js +1 -1
- package/dist/dev-server/theme-selector.js +1 -1
- package/dist/dev-server/types.js +1 -1
- package/dist/dev-server.js +1 -1
- package/dist/devtools.js +1 -1
- package/dist/directive-api.js +1 -1
- package/dist/docs.js +1 -1
- package/dist/doctor.js +1 -1
- package/dist/document-shell.js +1 -1
- package/dist/dynamic-components.js +1 -1
- package/dist/edge-runtime.js +1 -1
- package/dist/env.js +1 -1
- package/dist/error-boundaries.js +1 -1
- package/dist/error-handling.js +1 -1
- package/dist/errors/codes.js +1 -1
- package/dist/errors/formatter.js +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/errors/logger.js +1 -1
- package/dist/errors/sanitizer.js +1 -1
- package/dist/errors/types.js +1 -1
- package/dist/events.js +1 -1
- package/dist/expressions.js +1 -1
- package/dist/formatter.js +1 -1
- package/dist/forms-validation.js +1 -1
- package/dist/forms.js +1 -1
- package/dist/head.js +1 -1
- package/dist/heatmap.js +1 -1
- package/dist/hot-reload.js +1 -1
- package/dist/html-masking.js +1 -1
- package/dist/hydration-runtime.js +1 -1
- package/dist/hydration.js +1 -1
- package/dist/i18n.js +1 -1
- package/dist/image-optimization/auto-sibling.js +1 -1
- package/dist/image-optimization/build-plugin.js +1 -1
- package/dist/image-optimization/component.js +1 -1
- package/dist/image-optimization/directive.js +1 -1
- package/dist/image-optimization/index.js +1 -1
- package/dist/image-optimization/processor.js +1 -1
- package/dist/image-optimization/serve.js +1 -1
- package/dist/includes.js +1 -1
- package/dist/index.js +1 -1
- package/dist/init.js +1 -1
- package/dist/inline-assets.js +1 -1
- package/dist/interactive.js +1 -1
- package/dist/internal-markdown.js +1 -1
- package/dist/island-chunking.js +1 -1
- package/dist/js-ts.js +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/keep-alive.js +1 -1
- package/dist/lazy-loader.js +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/loops.js +1 -1
- package/dist/manifest.js +1 -1
- package/dist/markdown.js +1 -1
- package/dist/media/client/blur-up.js +1 -1
- package/dist/media/client/index.js +1 -1
- package/dist/media/client/lazy-load.js +1 -1
- package/dist/media/client/upload-handler.js +1 -1
- package/dist/media/image/component.js +1 -1
- package/dist/media/image/directive.js +1 -1
- package/dist/media/image/editing.js +1 -1
- package/dist/media/image/index.js +1 -1
- package/dist/media/image/placeholder.js +1 -1
- package/dist/media/image/processor/cache.js +1 -1
- package/dist/media/image/processor/index.js +1 -1
- package/dist/media/image/processor/optimizer.js +1 -1
- package/dist/media/image/processor/responsive.js +1 -1
- package/dist/media/image/srcset.js +1 -1
- package/dist/media/index.js +1 -1
- package/dist/media/manager/embed.js +1 -1
- package/dist/media/protected/component.js +1 -1
- package/dist/media/protected/index.js +1 -1
- package/dist/media/protected/signature.js +1 -1
- package/dist/media/shared/cache.js +1 -1
- package/dist/media/shared/hash.js +1 -1
- package/dist/media/shared/index.js +1 -1
- package/dist/media/upload/component.js +1 -1
- package/dist/media/upload/index.js +1 -1
- package/dist/media/video/directive.js +1 -1
- package/dist/media/video/index.js +1 -1
- package/dist/media/video/processor/cache.js +1 -1
- package/dist/media/video/processor/index.js +1 -1
- package/dist/media/video/processor/streaming.js +1 -1
- package/dist/media/video/processor/thumbnail.js +1 -1
- package/dist/media/video/processor/transcoder.js +1 -1
- package/dist/method-spoofing.js +1 -1
- package/dist/middleware.js +1 -1
- package/dist/misc-directives.js +1 -1
- package/dist/native-build.js +1 -1
- package/dist/parser/directive-parser.js +1 -1
- package/dist/parser/expression-parser.js +1 -1
- package/dist/parser/index.js +1 -1
- package/dist/parser/tokenizer.js +1 -1
- package/dist/partial-hydration.js +1 -1
- package/dist/performance-utils.js +1 -1
- package/dist/placeholder.js +1 -1
- package/dist/plugin-system.js +1 -1
- package/dist/plugin.js +1 -1
- package/dist/precompiler.js +1 -1
- package/dist/process.js +1 -1
- package/dist/production-build.js +1 -1
- package/dist/production-builder.js +1 -1
- package/dist/production-server.js +1 -1
- package/dist/props.js +1 -1
- package/dist/public-env.js +1 -1
- package/dist/pwa/audit.js +1 -1
- package/dist/pwa/directives.js +1 -1
- package/dist/pwa/icons.js +1 -1
- package/dist/pwa/index.js +1 -1
- package/dist/pwa/inject.js +1 -1
- package/dist/pwa/manifest.js +1 -1
- package/dist/pwa/offline.js +1 -1
- package/dist/pwa/precache.js +1 -1
- package/dist/pwa/service-worker.js +1 -1
- package/dist/pwa/workbox-strategies.js +1 -1
- package/dist/pwa/workbox.js +1 -1
- package/dist/pwa.js +457 -457
- package/dist/reactive-bindings.js +1 -1
- package/dist/reactive.js +1 -1
- package/dist/reactivity.js +1 -1
- package/dist/release.js +1 -1
- package/dist/render.js +1 -1
- package/dist/route-middleware.js +1 -1
- package/dist/router.js +1 -1
- package/dist/routes.js +1 -1
- package/dist/runtime-injection.js +1 -1
- package/dist/runtime.js +1 -1
- package/dist/safe-evaluator.js +1 -1
- package/dist/scaffolding.js +1 -1
- package/dist/screenshot.js +1 -1
- package/dist/script-classifier.js +1 -1
- package/dist/script-validation.js +1 -1
- package/dist/seo.js +1 -1
- package/dist/serve.js +1 -1
- package/dist/server-bindings.js +1 -1
- package/dist/server-components.js +1 -1
- package/dist/signal-processing.js +1 -1
- package/dist/signals-api.js +1 -1
- package/dist/signals.js +1 -1
- package/dist/site-builder/build.js +1 -1
- package/dist/site-builder/i18n.js +1 -1
- package/dist/site-builder/index.js +1 -1
- package/dist/site-builder/robots.js +1 -1
- package/dist/site-builder/router.js +1 -1
- package/dist/site-builder/seo.js +1 -1
- package/dist/site-builder/sitemap.js +1 -1
- package/dist/site-builder/theme.js +1 -1
- package/dist/slots.js +1 -1
- package/dist/source-maps.js +1 -1
- package/dist/spa-shell.js +1 -1
- package/dist/ssg.js +425 -425
- package/dist/ssr.js +1 -1
- package/dist/state-management.js +1 -1
- package/dist/store-imports.js +1 -1
- package/dist/store-loader.js +1 -1
- package/dist/stores-client.js +1 -1
- package/dist/story/addons.js +1 -1
- package/dist/story/analytics.js +1 -1
- package/dist/story/auto-stories.js +1 -1
- package/dist/story/bookmarks.js +1 -1
- package/dist/story/bun-test.js +1 -1
- package/dist/story/cli.js +1 -1
- package/dist/story/collect/analyzer.js +1 -1
- package/dist/story/collect/index.js +1 -1
- package/dist/story/collect/parser.js +1 -1
- package/dist/story/collect/scanner.js +1 -1
- package/dist/story/collect/tree.js +1 -1
- package/dist/story/commands/build.js +1 -1
- package/dist/story/commands/dev.js +1 -1
- package/dist/story/commands/index.js +1 -1
- package/dist/story/commands/preview.js +1 -1
- package/dist/story/compiled-output.js +1 -1
- package/dist/story/composition.js +1 -1
- package/dist/story/config-watcher.js +1 -1
- package/dist/story/config.js +1 -1
- package/dist/story/context.js +1 -1
- package/dist/story/controls/index.js +1 -1
- package/dist/story/crosswind.js +1 -1
- package/dist/story/desktop-preview.js +1 -1
- package/dist/story/docs-generator.js +1 -1
- package/dist/story/errors.js +1 -1
- package/dist/story/figma-export.js +1 -1
- package/dist/story/generator.js +1 -1
- package/dist/story/hmr.js +1 -1
- package/dist/story/hot-swap.js +1 -1
- package/dist/story/index.js +1 -1
- package/dist/story/interactions.js +1 -1
- package/dist/story/keyboard-shortcuts.js +1 -1
- package/dist/story/output.js +1 -1
- package/dist/story/performance.js +1 -1
- package/dist/story/presets.js +1 -1
- package/dist/story/props-validation.js +1 -1
- package/dist/story/renderer.js +1 -1
- package/dist/story/search-index.js +1 -1
- package/dist/story/search.js +1 -1
- package/dist/story/server.js +1 -1
- package/dist/story/setup.js +1 -1
- package/dist/story/snapshots.js +1 -1
- package/dist/story/testing.js +1 -1
- package/dist/story/theme.js +1 -1
- package/dist/story/ui/code-panel.js +1 -1
- package/dist/story/ui/controls-panel.js +1 -1
- package/dist/story/ui/index.js +1 -1
- package/dist/story/ui/navigation.js +1 -1
- package/dist/story/ui/preview.js +1 -1
- package/dist/story/visual-testing.js +1 -1
- package/dist/streaming.js +1 -1
- package/dist/strict-lint.js +1 -1
- package/dist/style-scoping.js +1 -1
- package/dist/suspense.js +1 -1
- package/dist/teleport.js +1 -1
- package/dist/template-compiler.js +1 -1
- package/dist/template-hydrator.js +1 -1
- package/dist/template-tag-balance.js +1 -1
- package/dist/testing.js +1 -1
- package/dist/transitions.js +1 -1
- package/dist/type-checker.js +1 -1
- package/dist/types/directive-types.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types.js +1 -1
- package/dist/typescript-templates.js +1 -1
- package/dist/utils.js +1 -1
- package/dist/validator.js +1 -1
- package/dist/variable-extractor.js +1 -1
- package/dist/view-composers.js +1 -1
- package/dist/virtual-scrolling.js +1 -1
- package/dist/visual-editor.js +1 -1
- package/dist/vue-template.js +1 -1
- package/dist/web-components/css-scoping.js +1 -1
- package/dist/web-components/index.js +1 -1
- package/dist/web-components/reactive-generator.js +418 -1
- package/dist/web-components.js +1 -1
- package/dist/x-element.js +1 -1
- package/package.json +8 -8
- package/dist/chunk-0fmsckh1.js +0 -420
- package/dist/chunk-2t4gywvz.js +0 -3
- package/dist/chunk-2yw4e0h0.js +0 -3
- package/dist/chunk-32ka7sdc.js +0 -1
- package/dist/chunk-36jjen8k.js +0 -3
- package/dist/chunk-37q6x951.js +0 -3
- package/dist/chunk-3c7q2vbq.js +0 -3
- package/dist/chunk-3tk0sr6m.js +0 -3
- package/dist/chunk-5kjk30re.js +0 -3
- package/dist/chunk-6x5p7rhz.js +0 -3
- package/dist/chunk-73x9a59t.js +0 -3
- package/dist/chunk-9a7ce9v1.js +0 -3
- package/dist/chunk-9njgv29x.js +0 -3
- package/dist/chunk-9zkb2dsx.js +0 -3
- package/dist/chunk-bs7qttx8.js +0 -3
- package/dist/chunk-bxp8ps0f.js +0 -5
- package/dist/chunk-cnchhkk2.js +0 -3
- package/dist/chunk-cwjdwzn3.js +0 -3
- package/dist/chunk-d3at6tp3.js +0 -1
- package/dist/chunk-egn85zmj.js +0 -3
- package/dist/chunk-fcrwjh47.js +0 -3
- package/dist/chunk-ftq6q3nx.js +0 -3
- package/dist/chunk-fxfmwbny.js +0 -3
- package/dist/chunk-h4k5wnbf.js +0 -3
- package/dist/chunk-kde1c2d4.js +0 -3
- package/dist/chunk-mf35r5h2.js +0 -3
- package/dist/chunk-mz4petzg.js +0 -3
- package/dist/chunk-qjn5xmeh.js +0 -1539
- package/dist/chunk-qpg9jdqb.js +0 -3
- package/dist/chunk-r5rx348z.js +0 -3
- package/dist/chunk-rs2ejj8f.js +0 -3
- package/dist/chunk-s7fg0jy2.js +0 -3
- package/dist/chunk-s9hpp0gd.js +0 -3
- package/dist/chunk-sajzecge.js +0 -3
- package/dist/chunk-sfp05afy.js +0 -3
- package/dist/chunk-srq3dkj8.js +0 -3
- package/dist/chunk-sydw4nm4.js +0 -3
- package/dist/chunk-t6z4b0x6.js +0 -3
- package/dist/chunk-wh2szb9t.js +0 -3
- package/dist/chunk-xzjrrd36.js +0 -1
- package/dist/chunk-zx35qm5v.js +0 -3
package/dist/chunk-qjn5xmeh.js
DELETED
|
@@ -1,1539 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Sv as a4}from"./chunk-ktpc2rc4.js";import{dw as n4}from"./chunk-9p45wwff.js";import{fw as j1}from"./chunk-m911bf2b.js";import{mw as i4}from"./chunk-a50svyjn.js";import{nw as W0}from"./chunk-7aph6rw7.js";import{pw as r1}from"./chunk-y92w0240.js";import{qw as k4,rw as N4,sw as D4,tw as E4,uw as T3,vw as I3}from"./chunk-v9199ywv.js";import{Cw as r4}from"./chunk-a4zj7qpt.js";import{Dw as s4}from"./chunk-zepv7y44.js";import{Jw as e3,Kw as t3}from"./chunk-04jkv9xx.js";import{Ow as b4}from"./chunk-2rd0ykrg.js";import{Tw as R3}from"./chunk-6sx4d083.js";import{Ww as l0}from"./chunk-r7d26vjj.js";import{ax as p4}from"./chunk-ccgmxmjk.js";import{cx as p1,dx as s1,ex as Z5,fx as n1,gx as X5,hx as Q5}from"./chunk-593x2ccf.js";import{lx as F3}from"./chunk-1bzckhs2.js";import{nx as w3}from"./chunk-a2xzs4kd.js";import{$x as D3,ay as v0}from"./chunk-5tv1swsr.js";import{dy as $5}from"./chunk-8g0jb444.js";import{ey as L1,fy as Z3,gy as A4,hy as c0,iy as G1,jy as U1}from"./chunk-h1035wzj.js";import{Cy as c4}from"./chunk-ms6793rw.js";import{Fy as S4}from"./chunk-zr8631g4.js";import{Jy as m4,Ky as u4,Ly as l4}from"./chunk-c9f5k95v.js";import{Vy as d4}from"./chunk-9fj7hpwa.js";import{jz as F4,kz as A3}from"./chunk-rdaavfsg.js";import{Az as t4,Bz as Y5,xz as o4,zz as e4}from"./chunk-tavtph8x.js";import{Lz as M4}from"./chunk-29qrr0nc.js";import{cA as f4,eA as g4}from"./chunk-fh1d8bxd.js";import{rA as x4}from"./chunk-w719zps0.js";import{tA as h4}from"./chunk-eghdf4qq.js";import{GA as w4,uA as o0,vA as S3}from"./chunk-xgmza98t.js";import{KA as R0,LA as C4,MA as v4,NA as P4}from"./chunk-zxxt0c9q.js";import{XA as o3,YA as D1}from"./chunk-t7ghqd7e.js";import{$A as N1}from"./chunk-xmjedbkt.js";import{dB as j0,hB as f0}from"./chunk-gcsqn7x9.js";import{iB as T4,kB as w0,lB as I4}from"./chunk-7t4hkmxb.js";import{sB as P0,vB as R4}from"./chunk-pjaa8q7x.js";import{wB as e0,yB as t0}from"./chunk-b0w1cm1s.js";import{FB as H0}from"./chunk-jm460jxs.js";import{NB as z5}from"./chunk-h6s1thg6.js";import{RB as V3}from"./chunk-yssvz8zs.js";import{SB as S1}from"./chunk-rkr7cgs8.js";import{TB as P1}from"./chunk-md4j8nch.js";import{UB as d1}from"./chunk-qvmrwh8n.js";import{VB as f1}from"./chunk-3rgj1qn6.js";import{XB as m1}from"./chunk-zvyc82ke.js";import{YB as x1}from"./chunk-1w3354fv.js";import{ZB as h1}from"./chunk-sd2c11bp.js";import{$B as g1}from"./chunk-sk1gmrr8.js";import{bC as v1}from"./chunk-9ezvda3j.js";import{cC as C1}from"./chunk-c23697dp.js";import{hC as h3,jC as $0,kC as Y0,oC as L0,pC as e,rC as Y1}from"./chunk-p5j0686t.js";import{KC as y4}from"./chunk-bg1xym0q.js";import{VC as B4,bD as j3,cD as _3}from"./chunk-08ncwhv7.js";import{fD as O4}from"./chunk-6jhqq7es.js";import{lD as W3,mD as L3,nD as B3,oD as O3,pD as V4}from"./chunk-r1m8g439.js";import{jE as h}from"./chunk-6r70w54p.js";import N0 from"path";import x0 from"fs";import l6 from"fs";import S from"path";var S0={},Y3=new Map;function H5(Y){let Q=Y3.get(Y);if(!Q){let Z=Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Q=new RegExp(`:${Z}(?!\\w)`,"g"),Y3.set(Y,Q)}return Q.lastIndex=0,Q}var i0={uppercase:(Y,Q)=>{return Y!==void 0&&Y!==null?String(Y).toUpperCase():""},lowercase:(Y,Q)=>{return Y!==void 0&&Y!==null?String(Y).toLowerCase():""},capitalize:(Y,Q)=>{if(Y===void 0||Y===null)return"";let Z=String(Y);return Z.charAt(0).toUpperCase()+Z.slice(1)},number:(Y,Q,Z=0)=>{if(Y===void 0||Y===null)return"";try{let X=Number(Y);return Number.isNaN(X)?"":X.toFixed(Number.parseInt(String(Z),10))}catch{return""}},fmt:(Y,Q,Z="en-US")=>{if(Y===void 0||Y===null)return"";try{let X=Number(Y);if(Number.isNaN(X))return String(Y);return X.toLocaleString(Z)}catch{return String(Y)}},join:(Y,Q,Z=",")=>{if(!Array.isArray(Y))return"";return Y.join(String(Z))},escape:(Y,Q)=>{if(Y===void 0||Y===null)return"";return p0(String(Y))},translate:(Y,Q,Z={})=>{if(!Q||!Q.__translations)return Y;let X=Q.__translations,J=Q.__i18nConfig?.fallbackToKey??!0,$=String(Y).split("."),z=X;for(let U of $){if(z===void 0||z===null)break;z=z[U]}if(z===void 0||z===null)return J?Y:"";let G=String(z);return Object.entries(Z).forEach(([U,_])=>{G=G.replace(H5(U),String(_))}),G},t:(Y,Q,Z={})=>{return i0.translate(Y,Q,Z)},truncate:(Y,Q,Z=50,X="...")=>{if(Y===void 0||Y===null)return"";let J=String(Y);if(J.length<=Z)return J;if(Z<=X.length)return X.substring(0,Z);return J.substring(0,Z-X.length)+X},date:(Y,Q,Z="short",X="en-US")=>{if(Y===void 0||Y===null)return"";try{let J=Y instanceof Date?Y:new Date(Y);if(Number.isNaN(J.getTime()))return String(Y);let $={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(Z==="iso")return J.toISOString();return new Intl.DateTimeFormat(X,$[Z]||$.short).format(J)}catch{return String(Y)}},currency:(Y,Q,Z="USD",X="en-US")=>{if(Y===void 0||Y===null)return"";try{let J=Number(Y);if(Number.isNaN(J))return String(Y);return new Intl.NumberFormat(X,{style:"currency",currency:Z}).format(J)}catch{return String(Y)}},pluralize:(Y,Q,Z,X)=>{let J=Number(Y);if(Number.isNaN(J))return Z;let $=X||`${Z}s`;return J===1?Z:$},first:(Y,Q)=>{if(Y===void 0||Y===null)return"";if(Array.isArray(Y))return Y.length===0?"":Y[0];return String(Y).charAt(0)},last:(Y,Q)=>{if(Y===void 0||Y===null)return"";if(Array.isArray(Y))return Y.length===0?"":Y[Y.length-1];let Z=String(Y);return Z.charAt(Z.length-1)},length:(Y,Q)=>{if(Y===void 0||Y===null)return 0;if(Array.isArray(Y)||typeof Y==="string")return Y.length;if(Y instanceof Map||Y instanceof Set)return Y.size;if(typeof Y==="object")return Object.keys(Y).length;return 0},json:(Y,Q,Z=!1)=>{if(Y===void 0)return"undefined";if(Y===null)return"null";try{return Z?JSON.stringify(Y,null,2):JSON.stringify(Y)}catch{return String(Y)}},default:(Y,Q,Z="")=>{return Y===void 0||Y===null||Y===""?Z:Y},reverse:(Y,Q)=>{if(Y===void 0||Y===null)return"";if(Array.isArray(Y))return[...Y].reverse();return String(Y).split("").reverse().join("")},slice:(Y,Q,Z=0,X)=>{if(Y===void 0||Y===null)return"";if(Array.isArray(Y)||typeof Y==="string")return Y.slice(Z,X);return Y},replace:(Y,Q,Z,X="")=>{if(Y===void 0||Y===null)return"";let J=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String(Y).replace(new RegExp(J,"g"),()=>X)},stripTags:(Y,Q)=>{if(Y===void 0||Y===null)return"";return String(Y).replace(/<[^>]*>/g,"")},urlencode:(Y,Q)=>{if(Y===void 0||Y===null)return"";return encodeURIComponent(String(Y))},abs:(Y,Q)=>{let Z=Number(Y);return Number.isNaN(Z)?0:Math.abs(Z)},round:(Y,Q,Z=0)=>{let X=Number(Y);if(Number.isNaN(X))return 0;let J=10**Z;return Math.round(X*J)/J}};function j5(Y,Q){if(Y in i0)console.warn(`Filter "${Y}" already exists as a built-in filter. Custom filter will take precedence.`);S0[Y]=Q}function R7(Y){for(let[Q,Z]of Object.entries(Y))j5(Q,Z)}function _5(){return{...i0,...S0}}function T7(){for(let Y of Object.keys(S0))delete S0[Y]}function p0(Y){return Y.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function C0(Y){let Q=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,Z;while((Z=Q.exec(Y))!==null){let X=Z[1];if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/.test(X))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test(Y))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test(Y))return!0;if(/(?:^|[\s"'])(?::|x-)(?:for|if|else-if|else|show|text|html|model|bind)\b/.test(Y))return!0;return!1}function $3(Y,Q){let Z=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console"],X=Y.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),J="",$=!1,z=0;for(let _=0;_<X.length;_++){let K=X[_];if(!$&&K==="`"){$=!0,z=0;continue}if($){if(K==="`"&&z===0){$=!1;continue}if(K==="$"&&X[_+1]==="{"){z++,_++;continue}if(K==="}"&&z>0){z--;continue}continue}J+=K}X=J;let G=/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\b/g,U;while((U=G.exec(X))!==null){let _=U[1];if(!X.substring(0,U.index).trimEnd().endsWith(".")){if(!Z.includes(_)&&!(_ in Q))return!1}}return!0}function W5(Y,Q){let Z=Y;return Z=Z.replace(/\{!!([\s\S]*?)!!\}/g,(X,J)=>{try{let $=q0(J,Q);if($===void 0)return X;return $===null?"":String($)}catch{return X}}),Z=Z.replace(/\{\{([\s\S]*?)\}\}/g,(X,J)=>{let $=J.trim();if(/^__[A-Z_]+__$/.test($))return X;try{let z=q0(J,Q);if(z===void 0)return X;return JSON.stringify(z)}catch{return X}}),Z}function I7(Y,Q,Z={}){return Y.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,(X,J,$)=>{if(/\bsrc\s*=/.test(J))return X;if(/\bdata-raw\b/.test(J))return X;if(/\btype\s*=\s*["']application\/json["']/.test(J))return X;if(Z.skipServer&&/\bserver\b/.test(J))return X;let z=W5($,Q);return`<script${J}>${z}</script>`})}function _0(Y,Q,Z,X){let J=Y,$=(K,j)=>{let W=Z3(K,j);if(W===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K.slice(j,W))?-1:W},z=(K,j,W,q)=>{let H=W.length,{output:L,tokens:O}=c0(K,j,(V,B)=>q(H+B));return W.push(...O),L},G=[];J=z(J,$,G,(K)=>`<!--__STX_STYLE_${K}__-->`);let U=[];J=z(J,L1,U,(K)=>`<!--__STX_SCRIPT_EXPR_${K}__-->`);let _=X?.forceSignals===!0||C0(Y);J=J.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(K,j,W)=>{try{let q=q0(j,Q);return q!==void 0&&q!==null?String(q):""}catch(q){let H=q instanceof Error?q.message:String(q);return i("Expression",`Error evaluating: {{{ ${j.trim()}}}}: ${H}`,Z,Y,W,K)}}),J=J.replace(/\{!!([\s\S]*?)!!\}/g,(K,j,W)=>{try{let q=q0(j,Q);if(q===void 0&&Q.__stx_buildMode==="compile")return l0("raw",j.trim());return q!==void 0&&q!==null?String(q):""}catch(q){if(Q.__stx_buildMode==="compile")return l0("raw",j.trim());let H=q instanceof Error?q.message:String(q);return i("Expression",`Error evaluating: {!! ${j.trim()} !!}: ${H}`,Z,Y,W,K)}}),J=z(J,L1,U,(K)=>`<!--__STX_SCRIPT_EXPR_${K}__-->`),J=z(J,$,G,(K)=>`<!--__STX_STYLE_${K}__-->`),J=J.replace(/\{\{([\s\S]*?)\}\}/g,(K,j,W)=>{let q=j.trim(),H=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],L=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,V=q.match(L)?.[1],B=V&&((V in Q)||H.includes(V)),A=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,w=q.match(A),F=w&&!H.includes(w[1])&&!(w[1]in Q);if(/^__[A-Z_]+__$/.test(q))return"";try{let k=q0(j,Q);if(k===void 0&&_&&!$3(q,Q))return K;if(k===void 0&&Q.__stx_buildMode==="compile"&&!_)return l0("expr",q);return k!==void 0&&k!==null?p0(String(k)):""}catch(k){if(_&&!$3(q,Q))return K;if(F)return K;let T=k instanceof Error?k.message:String(k);return i("Expression",`Error evaluating: {{ ${q} }}: ${T}`,Z,Y,W,K)}});for(let K=0;K<U.length;K++)J=J.replace(`<!--__STX_SCRIPT_EXPR_${K}__-->`,()=>U[K]);for(let K=0;K<G.length;K++)J=J.replace(`<!--__STX_STYLE_${K}__-->`,()=>G[K]);return J}function L5(Y,Q,Z){if(!Q.trim())return Y;let X=Y,J=Q.trim();while(J.length>0){let $=J.match(/^(\w+)/);if(!$)break;let z=$[1];J=J.substring(z.length).trim();let G=S0[z]||i0[z];if(!G)throw Error(`Filter not found: ${z}. Available filters: ${Object.keys(_5()).join(", ")}`);let U=[];if(J.startsWith(":")){let _=J.match(/^:([^|\s]+)/);if(_){let K=_[1].trim();try{let j=Number(K);U=[Number.isNaN(j)?K:j]}catch{U=[K]}J=J.substring(_[0].length).trim()}}else if(J.startsWith("(")){let _=1,K=1;while(_>0&&K<J.length){if(J[K]==="(")_++;if(J[K]===")")_--;K++}if(_===0){let j=J.substring(1,K-1).trim();if(j)try{if(j.startsWith("{")&&j.endsWith("}"))U=[q0(`(${j})`,Z,!0)];else{let W=[],q="",H=null,L=0,O=0,V=0,B=!1;for(let A=0;A<j.length;A++){let w=j[A];if(B){q+=w,B=!1;continue}if(w==="\\"){q+=w,B=!0;continue}if(H){if(q+=w,w===H)H=null;continue}if(w==='"'||w==="'"||w==="`"){H=w,q+=w;continue}if(w==="(")L++;else if(w===")")L--;else if(w==="[")O++;else if(w==="]")O--;else if(w==="{")V++;else if(w==="}")V--;if(w===","&&L===0&&O===0&&V===0){W.push(q),q="";continue}q+=w}if(q)W.push(q);U=W.map((A)=>{let w=A.trim();return q0(w,Z,!0)})}}catch{U=[j]}J=J.substring(K).trim()}}try{X=G(X,Z,...U)}catch(_){let K=_ instanceof Error?_.message:String(_);throw Error(`Error applying filter '${z}': ${K}`)}if(J.startsWith("|"))J=J.substring(1).trim();else break}return X}function B5(Y){let Q=!1,Z="",X=0,J=0,$=0,z=!1;for(let G=0;G<Y.length;G++){let U=Y[G],_=Y[G+1];if(Q&&z){z=!1;continue}if(Q&&U==="\\"){z=!0;continue}if(z=!1,(U==='"'||U==="'"||U==="`")&&!z){if(!Q)Q=!0,Z=U;else if(U===Z)Q=!1,Z="";continue}if(Q&&Z==="`"&&U==="$"&&_==="{"){let K=1;G+=2;while(G<Y.length&&K>0){if(Y[G]==="{")K++;else if(Y[G]==="}")K--;if(K>0)G++}continue}if(Q)continue;if(U==="(")X++;else if(U===")")X--;else if(U==="[")J++;else if(U==="]")J--;else if(U==="{")$++;else if(U==="}")$--;if(U==="|"&&X===0&&J===0&&$===0){if(_==="|"){G++;continue}if(_==="="){G++;continue}return G}}return-1}function q0(Y,Q,Z=!1){try{let X=Y.trim(),J=B5(X);if(J>0){let $=X.substring(0,J).trim(),z=X.substring(J+1).trim(),G=q0($,Q,!0);return L5(G,z,Q)}if(!Y0(X)){if(!Z)console.warn(`Potentially unsafe expression detected, using safe evaluator: ${X}`);return $0(X,Q)}try{let $=Object.keys(Q),z=Object.values(Q);return e(X,$)(...z)}catch{return $0(X,Q)}}catch(X){if(X instanceof ReferenceError){let J=/(\b\w+)\s+is not defined/.exec(X.message);if(J){let $=J[1],z=O5($,Object.keys(Q));if(z&&z!==$)X.message=`${X.message} \u2014 did you mean '${z}'?`}}if(!Z)console.error(`Error evaluating expression: ${Y}`,X);throw X}}function O5(Y,Q){let Z=null;for(let J of Q){if(J===Y)continue;let $=V5(Y,J);if(Z===null||$<Z.dist)Z={key:J,dist:$}}if(!Z)return null;let X=Math.max(Y.length,Z.key.length);if(Z.dist<=2||Z.dist/X<=0.35)return Z.key;return null}function V5(Y,Q){if(Y===Q)return 0;if(Y.length===0)return Q.length;if(Q.length===0)return Y.length;let[Z,X]=Y.length<Q.length?[Y,Q]:[Q,Y],J=Array(Z.length+1),$=Array(Z.length+1);for(let z=0;z<=Z.length;z++)J[z]=z;for(let z=1;z<=X.length;z++){$[0]=z;for(let G=1;G<=Z.length;G++){let U=Z[G-1]===X[z-1]?0:1;$[G]=Math.min($[G-1]+1,J[G]+1,J[G-1]+U)}for(let G=0;G<=Z.length;G++)J[G]=$[G]}return J[Z.length]}function X3(Y){if(!Y)return"";return Y.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'").replace(/&/g,"&")}import z0 from"path";var z3=0,A5=0;function s0(Y){return Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Q3(Y,Q){let Z=Y.match(new RegExp(`${Q}\\s*=\\s*"([^"]*)"`,"i"));if(Z)return Z[1];let X=Y.match(new RegExp(`${Q}\\s*=\\s*'([^']*)'`,"i"));if(X)return X[1];return null}function w5(Y){let Q=[],Z=/<([a-z][a-z0-9-]*)\s+([^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,X;while((X=Z.exec(Y))!==null){let[J,$,z]=X,G=X.index,U=Q3(z,"x-data");if(!U)continue;let _=`__stx_scope_${z3++}`,K=Q3(z,"x-init"),j=F5(Y,$,G+J.length),W=Y.slice(G,j.endIndex),q=R5(W);Q.push({id:_,selector:`[data-stx-scope="${_}"]`,stateExpr:U,initExpr:K,bindings:[],refs:q})}return Q}function F5(Y,Q,Z){let X=1,J=Z,$=new RegExp(`<${Q}(?:\\s|>)`,"gi"),z=new RegExp(`</${Q}>`,"gi"),G=new RegExp(`<${Q}[^>]*/\\s*>`,"gi");while(X>0&&J<Y.length){$.lastIndex=J,z.lastIndex=J,G.lastIndex=J;let U=$.exec(Y),_=z.exec(Y),K=G.exec(Y);if(K&&K.index<(U?.index??1/0)){J=K.index+K[0].length;continue}if(!_)return{endIndex:Y.length};if(U&&U.index<_.index)X++,J=U.index+U[0].length;else{if(X--,X===0)return{endIndex:_.index+_[0].length};J=_.index+_[0].length}}return{endIndex:Y.length}}function R5(Y){let Q=new Map,Z=Y.replace(/x-data\s*=\s*"[^"]*"/gi,'x-data="__stripped__"').replace(/x-data\s*=\s*'[^']*'/gi,"x-data='__stripped__'"),X=/<[a-z][a-z0-9-]*\s+([^>]*x-ref\s*=\s*["']([^"']*)["'][^>]*)>/gi,J;while((J=X.exec(Z))!==null){let[,$,z]=J,G=T5($);Q.set(z,G)}return Q}function T5(Y){let Q=Y.match(/\bid\s*=\s*["']([^"']*)["']/);if(Q)return Q[1];return`__stx_el_${A5++}`}function I5(){return`
|
|
3
|
-
// STX Reactive Runtime - x-cloak and transition CSS
|
|
4
|
-
(function() {
|
|
5
|
-
var style = document.createElement('style');
|
|
6
|
-
style.textContent = [
|
|
7
|
-
'[x-cloak] { display: none !important; }',
|
|
8
|
-
// Default transition classes
|
|
9
|
-
'.stx-enter { opacity: 0; transform: scale(0.95); }',
|
|
10
|
-
'.stx-enter-start { opacity: 0; transform: scale(0.95); }',
|
|
11
|
-
'.stx-enter-active { transition: opacity 150ms ease-out, transform 150ms ease-out; }',
|
|
12
|
-
'.stx-enter-to { opacity: 1; transform: scale(1); }',
|
|
13
|
-
'.stx-leave { opacity: 1; transform: scale(1); }',
|
|
14
|
-
'.stx-leave-start { opacity: 1; transform: scale(1); }',
|
|
15
|
-
'.stx-leave-active { transition: opacity 100ms ease-in, transform 100ms ease-in; }',
|
|
16
|
-
'.stx-leave-to { opacity: 0; transform: scale(0.95); }'
|
|
17
|
-
].join('\\n');
|
|
18
|
-
document.head.appendChild(style);
|
|
19
|
-
})();
|
|
20
|
-
|
|
21
|
-
// STX Reactive Runtime
|
|
22
|
-
/* eslint-disable pickier/no-unused-vars, no-console, prefer-const */
|
|
23
|
-
window.__stx_reactive = (function() {
|
|
24
|
-
'use strict';
|
|
25
|
-
|
|
26
|
-
// Deep reactive proxy that triggers onChange for any mutation
|
|
27
|
-
function reactive(obj, onChange) {
|
|
28
|
-
if (!obj || typeof obj !== 'object') return obj;
|
|
29
|
-
return new Proxy(obj, {
|
|
30
|
-
get(target, prop) {
|
|
31
|
-
const value = target[prop];
|
|
32
|
-
if (value && typeof value === 'object' && !Array.isArray(value) && !(value instanceof Promise)) {
|
|
33
|
-
return reactive(value, onChange);
|
|
34
|
-
}
|
|
35
|
-
return value;
|
|
36
|
-
},
|
|
37
|
-
set(target, prop, value) {
|
|
38
|
-
target[prop] = value;
|
|
39
|
-
onChange(prop, value);
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Initialize an x-data scope: parse state, run init(), register into window.stx._scopes,
|
|
46
|
-
// then let the signals runtime handle all directive processing (x-for, x-text, :bind, etc.)
|
|
47
|
-
function initScope(scopeEl, initialState, bindings, refs, initExpr) {
|
|
48
|
-
// Parse initial state (may contain methods including async init())
|
|
49
|
-
var state;
|
|
50
|
-
try {
|
|
51
|
-
state = new Function('return (' + initialState + ')')();
|
|
52
|
-
} catch (e) {
|
|
53
|
-
console.error('[stx-reactive] Invalid x-data:', initialState, e);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Build $refs object
|
|
58
|
-
var $refs = {};
|
|
59
|
-
for (var name in refs) {
|
|
60
|
-
if (Object.prototype.hasOwnProperty.call(refs, name)) {
|
|
61
|
-
(function(refName, refId) {
|
|
62
|
-
Object.defineProperty($refs, refName, {
|
|
63
|
-
get: function() { return document.getElementById(refId); }
|
|
64
|
-
});
|
|
65
|
-
})(name, refs[name]);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Extract init method from state if present (Alpine.js convention)
|
|
70
|
-
var initMethod = state.init;
|
|
71
|
-
if (typeof initMethod === 'function') {
|
|
72
|
-
delete state.init;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// Make state reactive \u2014 mutations trigger re-render via signals
|
|
76
|
-
var scopeId = scopeEl.getAttribute('data-stx-scope');
|
|
77
|
-
var stx = window.stx;
|
|
78
|
-
|
|
79
|
-
// Create signals for each state property so the signals runtime can track dependencies
|
|
80
|
-
var signalState = {};
|
|
81
|
-
var rawState = {};
|
|
82
|
-
for (var key in state) {
|
|
83
|
-
if (Object.prototype.hasOwnProperty.call(state, key)) {
|
|
84
|
-
if (typeof state[key] === 'function') {
|
|
85
|
-
// Methods \u2014 bind to a proxy so 'this.prop = val' triggers signal updates
|
|
86
|
-
signalState[key] = state[key];
|
|
87
|
-
} else {
|
|
88
|
-
// Data properties \u2014 wrap in signals for reactivity
|
|
89
|
-
signalState[key] = stx.state(state[key]);
|
|
90
|
-
rawState[key] = true;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Create a proxy context that auto-unwraps signals and writes back through them.
|
|
96
|
-
// Methods get 'this' bound to this proxy so this.foo = bar triggers reactivity.
|
|
97
|
-
var ctx = {};
|
|
98
|
-
var ctxProxy = new Proxy(ctx, {
|
|
99
|
-
get: function(target, prop) {
|
|
100
|
-
if (prop === '$refs') return $refs;
|
|
101
|
-
if (prop === '$el') return scopeEl;
|
|
102
|
-
if (prop === '$nextTick') return function(fn) { requestAnimationFrame(fn); };
|
|
103
|
-
var s = signalState[prop];
|
|
104
|
-
if (!s) return undefined;
|
|
105
|
-
if (rawState[prop] && s && typeof s === 'function' && typeof s.value !== 'undefined') {
|
|
106
|
-
return s.value; // unwrap signal
|
|
107
|
-
}
|
|
108
|
-
if (typeof s === 'function' && !rawState[prop]) {
|
|
109
|
-
return s.bind(ctxProxy); // bind methods to proxy
|
|
110
|
-
}
|
|
111
|
-
return s;
|
|
112
|
-
},
|
|
113
|
-
set: function(target, prop, value) {
|
|
114
|
-
var s = signalState[prop];
|
|
115
|
-
if (rawState[prop] && s && typeof s === 'function') {
|
|
116
|
-
s.value = value; // write through signal \u2014 triggers effects
|
|
117
|
-
} else {
|
|
118
|
-
signalState[prop] = value;
|
|
119
|
-
}
|
|
120
|
-
return true;
|
|
121
|
-
},
|
|
122
|
-
has: function(target, prop) {
|
|
123
|
-
return prop in signalState || prop === '$refs' || prop === '$el' || prop === '$nextTick';
|
|
124
|
-
},
|
|
125
|
-
ownKeys: function() {
|
|
126
|
-
return Object.keys(signalState).concat(['$refs', '$el', '$nextTick']);
|
|
127
|
-
},
|
|
128
|
-
getOwnPropertyDescriptor: function(target, prop) {
|
|
129
|
-
if (prop in signalState || prop === '$refs' || prop === '$el' || prop === '$nextTick') {
|
|
130
|
-
return { configurable: true, enumerable: true, writable: true, value: ctxProxy[prop] };
|
|
131
|
-
}
|
|
132
|
-
return undefined;
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
// Build scope vars for the signals runtime \u2014 it reads these for expression evaluation.
|
|
137
|
-
// We need to provide getter/setter descriptors so signals track properly.
|
|
138
|
-
var scopeVars = {};
|
|
139
|
-
for (var k in signalState) {
|
|
140
|
-
if (Object.prototype.hasOwnProperty.call(signalState, k)) {
|
|
141
|
-
if (rawState[k]) {
|
|
142
|
-
// Data: expose the signal directly so expressions trigger dependency tracking
|
|
143
|
-
scopeVars[k] = signalState[k];
|
|
144
|
-
} else {
|
|
145
|
-
// Method: bind to ctxProxy so 'this' works
|
|
146
|
-
scopeVars[k] = (typeof signalState[k] === 'function') ? signalState[k].bind(ctxProxy) : signalState[k];
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
scopeVars.$refs = $refs;
|
|
151
|
-
scopeVars.$el = scopeEl;
|
|
152
|
-
scopeVars.$nextTick = function(fn) { requestAnimationFrame(fn); };
|
|
153
|
-
|
|
154
|
-
// Register scope \u2014 merge with any existing vars from partial signal scripts
|
|
155
|
-
if (!stx._scopes) stx._scopes = {};
|
|
156
|
-
stx._scopes[scopeId] = Object.assign(stx._scopes[scopeId] || {}, scopeVars);
|
|
157
|
-
|
|
158
|
-
// Store on element for findElementScope
|
|
159
|
-
scopeEl.__stx_scope = scopeVars;
|
|
160
|
-
|
|
161
|
-
// Run init() if present (supports async)
|
|
162
|
-
function runInit() {
|
|
163
|
-
var maybePromise;
|
|
164
|
-
if (initMethod) {
|
|
165
|
-
maybePromise = initMethod.call(ctxProxy);
|
|
166
|
-
}
|
|
167
|
-
if (initExpr) {
|
|
168
|
-
try {
|
|
169
|
-
var keys = Object.keys(scopeVars);
|
|
170
|
-
var vals = keys.map(function(k) { return scopeVars[k]; });
|
|
171
|
-
var fn = new Function(keys.join(','), initExpr);
|
|
172
|
-
var result = fn.apply(ctxProxy, vals);
|
|
173
|
-
if (result && typeof result.then === 'function') maybePromise = result;
|
|
174
|
-
} catch (e) {
|
|
175
|
-
console.warn('[stx-reactive] init expression error:', e);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
// If init is async, signal updates will trigger effects automatically
|
|
179
|
-
// when init() resolves and sets this.prop = value (writes through signal)
|
|
180
|
-
if (maybePromise && typeof maybePromise.then === 'function') {
|
|
181
|
-
maybePromise.catch(function(e) {
|
|
182
|
-
console.error('[stx-reactive] async init() error:', e);
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// Run init before the signals runtime processes this scope
|
|
188
|
-
runInit();
|
|
189
|
-
|
|
190
|
-
// Expose for debugging
|
|
191
|
-
scopeEl.__stx_state = ctxProxy;
|
|
192
|
-
scopeEl.__stx_execute = function(stmt, $event, $el) {
|
|
193
|
-
try {
|
|
194
|
-
// Run the statement with the reactive proxy as the lexical scope.
|
|
195
|
-
// Wrapping in a with-block on the proxy makes bare reads/writes go
|
|
196
|
-
// through it (so foo = bar triggers signal.set()) instead of treating
|
|
197
|
-
// each state key as a local function parameter \u2014 bare assignments
|
|
198
|
-
// would otherwise just rebind the local and never reach the signal.
|
|
199
|
-
var fn = new Function('$event', '$el', 'with(this){' + stmt + ';}');
|
|
200
|
-
fn.call(ctxProxy, $event, $el);
|
|
201
|
-
} catch (e) {
|
|
202
|
-
console.warn('[stx-reactive] execute error:', e);
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
return { initScope: initScope, reactive: reactive };
|
|
208
|
-
})();
|
|
209
|
-
`}function J3(Y,Q){let Z=Y.replace(/\{!!([\s\S]*?)!!\}/g,(X,J)=>{try{let $=q0(J,Q,!0);if($===void 0)return X;return String($)}catch{return X}});return Z=Z.replace(/\{\{([\s\S]*?)\}\}/g,(X,J)=>{try{let $=q0(J,Q,!0);if($===void 0)return X;if(typeof $==="string"){let z=$.trim();if(z.startsWith("{")&&z.endsWith("}")||z.startsWith("[")&&z.endsWith("]"))try{return JSON.parse(z),z}catch{}}return JSON.stringify($)}catch{return X}}),Z}function k5(Y,Q){if(Y.length===0)return"";let Z=Y.map((X)=>{let J=JSON.stringify(Object.fromEntries(X.refs)),$=J3(X.stateExpr,Q),z=X.initExpr?J3(X.initExpr,Q):null,G=JSON.stringify($),U=z?JSON.stringify(z):"null";return`
|
|
210
|
-
(function() {
|
|
211
|
-
var scopeEl = document.querySelector('${X.selector}');
|
|
212
|
-
if (!scopeEl) return;
|
|
213
|
-
var refs = ${J};
|
|
214
|
-
__stx_reactive.initScope(scopeEl, ${G}, [], refs, ${U});
|
|
215
|
-
})();`}).join(`
|
|
216
|
-
`);return`
|
|
217
|
-
<script data-stx-scoped data-stx-reactive>
|
|
218
|
-
${I5()}
|
|
219
|
-
${Z}
|
|
220
|
-
</script>`}function G3(Y,Q,Z){if(z3=0,!D5(Y))return Y;let X=w5(Y);if(X.length===0)return Y;let J=N5(Y,X),$=k5(X,Q),z=J.lastIndexOf("</body>");if(z!==-1)J=J.slice(0,z)+$+`
|
|
221
|
-
`+J.slice(z);else J+=$;return J}function N5(Y,Q){let Z=Y;for(let X of Q){let $=new RegExp(`<[a-z][a-z0-9-]*\\s+[^>]*data-stx-scope="([^"]*)"[^>]*x-data\\s*=\\s*["']${s0(X.stateExpr)}["']`,"gi").exec(Z);if($)X.id=$[1],X.selector=`[data-stx-scope="${X.id}"]`;else{let G=new RegExp(`<[a-z][a-z0-9-]*\\s+[^>]*x-data\\s*=\\s*["']${s0(X.stateExpr)}["'][^>]*data-stx-scope="([^"]*)"`,"gi").exec(Z);if(G)X.id=G[1],X.selector=`[data-stx-scope="${X.id}"]`;else Z=Z.replace(new RegExp(`(<[a-z][a-z0-9-]*\\s+)([^>]*)(x-data\\s*=\\s*"${s0(X.stateExpr)}")([^>]*>)`,"gi"),`$1data-stx-scope="${X.id}" $2$3$4`),Z=Z.replace(new RegExp(`(<[a-z][a-z0-9-]*\\s+)([^>]*)(x-data\\s*=\\s*'${s0(X.stateExpr)}')([^>]*>)`,"gi"),`$1data-stx-scope="${X.id}" $2$3$4`)}}return Z=Z.replace(/\s*x-data\s*=\s*"([^"]*)"/g,' data-stx-xdata="$1"'),Z=Z.replace(/\s*x-data\s*=\s*'([^']*)'/g," data-stx-xdata='$1'"),Z=Z.replace(/\s*x-init\s*=\s*"[^"]*"/g,""),Z=Z.replace(/\s*x-init\s*=\s*'[^']*'/g,""),Z}function D5(Y){return/x-data\s*=\s*["']/.test(Y)}import u5 from"fs";import A1 from"path";import{createHighlighter as l5}from"ts-syntax-highlighter";import V1 from"fs";import X0 from"path";import{loadConfigWithResult as h5}from"bunfig";async function U3(Y,Q,Z=""){let X=Y,J=[],$=/@markdown(?:\([^)]*\))?/g,z;while((z=$.exec(Y))!==null){let G=z.index,U=z[0].match(/@markdown\(([^)]*)\)/),_=U?U[1]:"",K=G+z[0].length,j=1,W=K,q=-1;while(j>0&&W<Y.length){let O=Y.indexOf("@markdown",W),V=Y.indexOf("@endmarkdown",W);if(V===-1)break;if(O!==-1&&O<V&&O!==G){let B=Y[O+9];if(B==="("||B===`
|
|
222
|
-
`||B==="\r"||B===" "||B===void 0)j++;W=O+9}else{if(j--,j===0){q=V;break}W=V+12}}if(q===-1)continue;let H=Y.slice(K,q),L=Y.slice(G,q+12);J.push({fullMatch:L,options:_,content:H,index:G}),$.lastIndex=q+12}for(let{fullMatch:G,options:U,content:_,index:K}of J)try{let j={};if(U)U.split(",").forEach((H)=>{let L=H.trim();if(L)j[L]=!0});let W={gfm:j.gfm??!0,breaks:j.breaks??!1},q=v0(_.trim(),W);X=X.split(G).join(q)}catch(j){let W=j instanceof Error?j.message:String(j),q=i("Markdown Directive",`Error processing markdown: ${W}`,Z,Y,K,G);X=X.split(G).join(q)}return X}async function K3(Y,Q,Z,X){let J={gfm:!0,breaks:!1};return Q.forEach(($)=>{let z=$.trim().replace(/['"]/g,"");if(z==="breaks")J.breaks=!0;if(z==="no-gfm")J.gfm=!1}),v0(Y.trim(),J)}import E5 from"fs";import A0 from"path";async function P7(Y,Q){if(!Y.webComponents?.enabled)return[];let Z=Y.webComponents.components||[],X=[];if(Z.length>0){if(Y.debug)console.log(`Building ${Z.length} web components...`);for(let J of Z)try{let $=await M5(J,Y,Q);if($)X.push($)}catch($){if(console.error(`Error building web component ${J.name}:`,$),Y.debug)throw $}}return X}async function M5(Y,Q,Z){let{name:X,file:J,tag:$,extends:z}=Y;if(!X||!J||!$)return console.error("Invalid web component configuration, missing required fields:",Y),null;let G=null;if(A0.isAbsolute(J)&&await x(J))G=J;else if(Q.componentsDir){let L=A0.join(Q.componentsDir,J);if(await x(L))G=L}if(!G)G=await n0(J,process.cwd(),Q,Z);if(!G)return console.error(`Web component source file not found: ${J}`),null;let U=await Bun.file(G).text();Z.add(G);let K=(Y.outputFormat||"js")==="ts",j=K?b5({name:X,tag:$,baseElement:z,source:U,shadowDOM:Y.shadowDOM??!0,template:Y.template??!0,styleSource:Y.styleSource,attributes:Y.attributes||[],attributeTypes:Y.attributeTypes||{}}):y5({name:X,tag:$,baseElement:z,source:U,shadowDOM:Y.shadowDOM??!0,template:Y.template??!0,styleSource:Y.styleSource,attributes:Y.attributes||[]}),W=Q.webComponents?.outputDir||"dist/web-components";await E5.promises.mkdir(W,{recursive:!0});let q=K?"ts":"js",H=A0.join(W,`${$}.${q}`);if(await Bun.write(H,j),Q.debug)console.log(`Built web component ${X} -> ${H}`);return H}function y5(Y){let{name:Q,tag:Z,baseElement:X="HTMLElement",source:J,shadowDOM:$,template:z,styleSource:G,attributes:U=[]}=Y,_=J.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!$)_=_.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),_=_.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),_=_.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),_=_.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let K="";if(G)K=`<link rel="stylesheet" href="${G}">`;return`/**
|
|
223
|
-
* ${Q} Web Component
|
|
224
|
-
* Auto-generated from stx component
|
|
225
|
-
*/
|
|
226
|
-
class ${Q.replace(/\W/g,"")} extends ${X} {
|
|
227
|
-
constructor() {
|
|
228
|
-
super()
|
|
229
|
-
${$?'this.attachShadow({ mode: "open" })':""}
|
|
230
|
-
${z?"this._createTemplate()":"this._render()"}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
${z?`
|
|
234
|
-
_createTemplate() {
|
|
235
|
-
const template = document.createElement('template')
|
|
236
|
-
template.innerHTML = \`${K}${_}\`
|
|
237
|
-
${$?"this.shadowRoot.appendChild(template.content.cloneNode(true))":"this.appendChild(template.content.cloneNode(true))"}
|
|
238
|
-
this._processSlots()
|
|
239
|
-
}
|
|
240
|
-
`:`
|
|
241
|
-
_render() {
|
|
242
|
-
${$?"this.shadowRoot.innerHTML":"this.innerHTML"} = \`${K}${_}\`
|
|
243
|
-
this._processSlots()
|
|
244
|
-
}
|
|
245
|
-
`}
|
|
246
|
-
|
|
247
|
-
_processSlots() {
|
|
248
|
-
${$?`// Shadow DOM handles slot assignment automatically
|
|
249
|
-
// Listen for slot changes if needed
|
|
250
|
-
const slots = this.shadowRoot.querySelectorAll('slot')
|
|
251
|
-
slots.forEach(slot => {
|
|
252
|
-
slot.addEventListener('slotchange', (e) => {
|
|
253
|
-
const assignedNodes = slot.assignedNodes()
|
|
254
|
-
this.dispatchEvent(new CustomEvent('slot-changed', {
|
|
255
|
-
detail: { slotName: slot.name || 'default', assignedNodes }
|
|
256
|
-
}))
|
|
257
|
-
})
|
|
258
|
-
})`:`// Manual slot processing for non-shadow DOM mode
|
|
259
|
-
const slots = this.querySelectorAll('[data-slot]')
|
|
260
|
-
const lightDOMChildren = Array.from(this.childNodes).filter(
|
|
261
|
-
node => node.nodeType === Node.ELEMENT_NODE && !node.hasAttribute('data-slot')
|
|
262
|
-
)
|
|
263
|
-
|
|
264
|
-
// Process named slots
|
|
265
|
-
slots.forEach(slotEl => {
|
|
266
|
-
const slotName = slotEl.getAttribute('data-slot')
|
|
267
|
-
const slottedContent = this.querySelector(\`[slot="\${slotName}"]\`)
|
|
268
|
-
if (slottedContent) {
|
|
269
|
-
// Replace slot placeholder with actual content
|
|
270
|
-
slotEl.innerHTML = ''
|
|
271
|
-
slotEl.appendChild(slottedContent.cloneNode(true))
|
|
272
|
-
}
|
|
273
|
-
})
|
|
274
|
-
|
|
275
|
-
// Process default slot
|
|
276
|
-
const defaultSlot = this.querySelector('[data-slot=""]') || this.querySelector('[data-default-slot]')
|
|
277
|
-
if (defaultSlot) {
|
|
278
|
-
const unslottedContent = Array.from(this.children).filter(
|
|
279
|
-
child => !child.hasAttribute('slot') && child !== defaultSlot
|
|
280
|
-
)
|
|
281
|
-
if (unslottedContent.length > 0) {
|
|
282
|
-
defaultSlot.innerHTML = ''
|
|
283
|
-
unslottedContent.forEach(content => {
|
|
284
|
-
defaultSlot.appendChild(content.cloneNode(true))
|
|
285
|
-
})
|
|
286
|
-
}
|
|
287
|
-
}`}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
${U.length>0?`
|
|
291
|
-
static get observedAttributes() {
|
|
292
|
-
return [${U.map((j)=>`'${j}'`).join(", ")}]
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
296
|
-
if (oldValue !== newValue) {
|
|
297
|
-
this[name] = newValue
|
|
298
|
-
${z?"":"this._render()"}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
`:""}
|
|
302
|
-
|
|
303
|
-
connectedCallback() {
|
|
304
|
-
// Component connected to the DOM
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
disconnectedCallback() {
|
|
308
|
-
// Component removed from the DOM
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
// Register the web component
|
|
313
|
-
customElements.define('${Z}', ${Q.replace(/\W/g,"")})
|
|
314
|
-
`}function b5(Y){let{name:Q,tag:Z,baseElement:X="HTMLElement",source:J,shadowDOM:$,template:z,styleSource:G,attributes:U=[],attributeTypes:_={}}=Y,K=Q.replace(/\W/g,""),j=J.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!$)j=j.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),j=j.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),j=j.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),j=j.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");j=j.replace(/`/g,"\\`").replace(/\$\{/g,"\\${");let W=G?`<link rel="stylesheet" href="${G}">`:"",q=(F)=>{switch(_[F]){case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";default:return"string"}},H=(F)=>F.replace(/-([a-z])/g,(k,T)=>T.toUpperCase()),L=U.map((F)=>` private _${H(F)}: ${q(F)} | null = null;`).join(`
|
|
315
|
-
`),O=U.map((F)=>{let k=q(F),T=H(F);return`
|
|
316
|
-
get ${T}(): ${k} | null {
|
|
317
|
-
return this._${T};
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
set ${T}(value: ${k} | null) {
|
|
321
|
-
this._${T} = value;
|
|
322
|
-
if (value !== null) {
|
|
323
|
-
this.setAttribute('${F}', String(value));
|
|
324
|
-
}
|
|
325
|
-
else {
|
|
326
|
-
this.removeAttribute('${F}');
|
|
327
|
-
}
|
|
328
|
-
}`}).join(`
|
|
329
|
-
`),V=U.length>0?`/**
|
|
330
|
-
* Props interface for ${Q}
|
|
331
|
-
*/
|
|
332
|
-
export interface ${K}Props {
|
|
333
|
-
${U.map((F)=>{let k=q(F);return` ${H(F)}?: ${k};`}).join(`
|
|
334
|
-
`)}
|
|
335
|
-
}
|
|
336
|
-
`:"",B=U.length>0?`
|
|
337
|
-
static get observedAttributes(): string[] {
|
|
338
|
-
return [${U.map((F)=>`'${F}'`).join(", ")}];
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void {
|
|
342
|
-
if (oldValue !== newValue) {
|
|
343
|
-
const camelCase = name.replace(/-([a-z])/g, (_: string, letter: string) => letter.toUpperCase());
|
|
344
|
-
(this as unknown as Record<string, unknown>)[\`_\${camelCase}\`] = this._parseAttributeValue(name, newValue);
|
|
345
|
-
${z?"":"this._render();"}
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
private _parseAttributeValue(name: string, value: string | null): unknown {
|
|
350
|
-
if (value === null) return null;
|
|
351
|
-
const typeMap: Record<string, string> = ${JSON.stringify(_)};
|
|
352
|
-
const type = typeMap[name] || 'string';
|
|
353
|
-
switch (type) {
|
|
354
|
-
case 'number': return Number(value);
|
|
355
|
-
case 'boolean': return value !== 'false' && value !== '0';
|
|
356
|
-
case 'object': try { return JSON.parse(value); }
|
|
357
|
-
catch { return value; }
|
|
358
|
-
default: return value;
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
`:"",A=z?`
|
|
362
|
-
private _createTemplate(): void {
|
|
363
|
-
const template = document.createElement('template');
|
|
364
|
-
template.innerHTML = \`${W}${j}\`;
|
|
365
|
-
${$?"this.shadowRoot!.appendChild(template.content.cloneNode(true));":"this.appendChild(template.content.cloneNode(true));"}
|
|
366
|
-
this._processSlots();
|
|
367
|
-
}`:`
|
|
368
|
-
private _render(): void {
|
|
369
|
-
${$?"this.shadowRoot!.innerHTML":"this.innerHTML"} = \`${W}${j}\`;
|
|
370
|
-
this._processSlots();
|
|
371
|
-
}`;return`/**
|
|
372
|
-
* ${Q} Web Component
|
|
373
|
-
* Auto-generated from stx component (TypeScript)
|
|
374
|
-
*
|
|
375
|
-
* @example
|
|
376
|
-
* \`\`\`html
|
|
377
|
-
* <${Z}></${Z}>
|
|
378
|
-
* \`\`\`
|
|
379
|
-
*/
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* Detail type for slot-changed event
|
|
383
|
-
*/
|
|
384
|
-
interface SlotChangeDetail {
|
|
385
|
-
slotName: string;
|
|
386
|
-
assignedNodes: Node[];
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
${V}
|
|
390
|
-
/**
|
|
391
|
-
* ${Q} custom element class
|
|
392
|
-
* @customElement ${Z}
|
|
393
|
-
*/
|
|
394
|
-
export class ${K} extends ${X} {
|
|
395
|
-
${L}
|
|
396
|
-
|
|
397
|
-
constructor() {
|
|
398
|
-
super();
|
|
399
|
-
${$?'this.attachShadow({ mode: "open" });':""}
|
|
400
|
-
${z?"this._createTemplate();":"this._render();"}
|
|
401
|
-
}
|
|
402
|
-
${A}
|
|
403
|
-
${$?`
|
|
404
|
-
private _processSlots(): void {
|
|
405
|
-
const slots = this.shadowRoot!.querySelectorAll('slot');
|
|
406
|
-
slots.forEach((slot) => {
|
|
407
|
-
slot.addEventListener('slotchange', () => {
|
|
408
|
-
const assignedNodes = (slot as HTMLSlotElement).assignedNodes();
|
|
409
|
-
this.dispatchEvent(new CustomEvent<SlotChangeDetail>('slot-changed', {
|
|
410
|
-
detail: { slotName: slot.getAttribute('name') || 'default', assignedNodes }
|
|
411
|
-
}));
|
|
412
|
-
});
|
|
413
|
-
});
|
|
414
|
-
}`:`
|
|
415
|
-
private _processSlots(): void {
|
|
416
|
-
const slots = this.querySelectorAll('[data-slot]');
|
|
417
|
-
slots.forEach((slotEl) => {
|
|
418
|
-
const slotName = slotEl.getAttribute('data-slot');
|
|
419
|
-
if (slotName) {
|
|
420
|
-
const slottedContent = this.querySelector(\`[slot="\${slotName}"]\`);
|
|
421
|
-
if (slottedContent) {
|
|
422
|
-
slotEl.innerHTML = '';
|
|
423
|
-
slotEl.appendChild(slottedContent.cloneNode(true));
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
});
|
|
427
|
-
}`}
|
|
428
|
-
${B}
|
|
429
|
-
${O}
|
|
430
|
-
|
|
431
|
-
connectedCallback(): void {
|
|
432
|
-
// Component connected to the DOM
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
disconnectedCallback(): void {
|
|
436
|
-
// Component removed from the DOM
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
adoptedCallback(): void {
|
|
440
|
-
// Component moved to a new document
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
// Type augmentation for HTMLElementTagNameMap
|
|
445
|
-
declare global {
|
|
446
|
-
interface HTMLElementTagNameMap {
|
|
447
|
-
'${Z}': ${K};
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
// Register the web component
|
|
452
|
-
customElements.define('${Z}', ${K});
|
|
453
|
-
`}var B1={strategy:"attribute",attributeName:"data-v",preserveOriginal:!0};function O1(Y){let Q=Y.split("").reduce((Z,X)=>(Z<<5)-Z+X.charCodeAt(0)|0,0);return Math.abs(Q).toString(36).slice(0,8)}function S5(Y,Q,Z={}){let X={...B1,...Z},J=O1(Q);switch(X.strategy){case"shadow":return Y;case"prefix":return v5(Y,X.prefix||Q,X.preserveOriginal);case"attribute":return C5(Y,J,X.attributeName||"data-v",X.preserveOriginal);case"bem":return P5(Y,Q,X.preserveOriginal);default:return Y}}function C5(Y,Q,Z,X){let J=`[${Z}-${Q}]`;return Y.replace(/([.#]?[\w-]+|\*)\s*(\{|,)/g,($,z,G)=>{if(z.startsWith("@"))return $;if(/^(?::root|:host|html|body)$/i.test(z))return $;return`${X?`${z}${J}`:`${z}${J}`}${G}`})}function v5(Y,Q,Z){return Y.replace(/\.([a-z_][\w-]*)/gi,(X,J)=>{if(J.startsWith(Q))return X;let $=`${Q}__${J}`;return Z?`.${$}`:`.${$}`})}function P5(Y,Q,Z){let X=Q.replace(/[^a-z0-9]/gi,"-");return Y.replace(/\.([a-z_][\w-]*)/gi,(J,$)=>{if($.includes("__")||$.includes("--")){if(!$.startsWith(X))return`.${X}__${$}`;return J}let z=`${X}__${$}`;return Z?`.${z}`:`.${z}`})}function f5(Y,Q,Z={}){let X={...B1,...Z};if(X.strategy==="shadow")return Y;if(X.strategy==="attribute"){let J=O1(Q),z=`${X.attributeName||"data-v"}-${J}`;return Y.replace(/<([a-z][a-z0-9-]*)([^>]*)>/gi,(G,U,_)=>{if(/^(?:script|style|!--)$/i.test(U))return G;let K=_.trimEnd().endsWith("/"),j=K?_.slice(0,-1):_;return`<${U}${j} ${z}${K?"/":""}>`})}if(X.strategy==="prefix"||X.strategy==="bem"){let J=X.strategy==="bem"?Q.replace(/[^a-z0-9]/gi,"-"):X.prefix||Q;return Y.replace(/\bclass\s*=\s*["']([^"']+)["']/gi,($,z)=>{return`class="${z.split(/\s+/).map((U)=>{if(!U)return U;if(U.startsWith(J))return U;return`${J}__${U}`}).join(" ")}"`})}return Y}function f7(Y,Q={}){let Z={...B1,...Q},X=O1(Y);return`${Z.attributeName||"data-v"}-${X}`}function g7(Y,Q,Z={}){let X="",J=Y.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(z,G,U)=>{if(/\bscoped\b/i.test(G)||Z.strategy!=="shadow")X+=`${S5(U,Q,Z)}
|
|
454
|
-
`;else X+=`${U}
|
|
455
|
-
`;return""});return{html:f5(J,Q,Z),css:X.trim()}}function D0(Y){return Y.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function x7(Y){let{name:Q,tag:Z,baseElement:X="HTMLElement",template:J,styles:$="",shadowDOM:z=!0,properties:G={},lifecycle:U={},events:_={},methods:K={},state:j={}}=Y,W=Q.replace(/\W/g,""),q=Object.keys(G),H=q.filter((I)=>G[I].attribute!==!1).map((I)=>G[I].attribute||D0(I)),L=q.map((I)=>{let R=G[I],N=R.default!==void 0?JSON.stringify(R.default):R.type==="string"?'""':R.type==="number"?"0":R.type==="boolean"?"false":R.type==="array"?"[]":"{}";return` this._${I} = ${N};`}).join(`
|
|
456
|
-
`),O=q.map((I)=>{let R=G[I],N=R.attribute!==!1?R.attribute||D0(I):null,D=R.reflect&&N?`
|
|
457
|
-
if (value !== null && value !== undefined) {
|
|
458
|
-
${R.type==="boolean"?`if (value) { this.setAttribute('${N}', ''); }
|
|
459
|
-
else { this.removeAttribute('${N}'); }`:`this.setAttribute('${N}', ${R.type==="object"||R.type==="array"?"JSON.stringify(value)":"String(value)"});`}
|
|
460
|
-
}
|
|
461
|
-
else {
|
|
462
|
-
this.removeAttribute('${N}');
|
|
463
|
-
}`:"",E=R.observer?`this.${R.observer}(value, oldValue);`:"",M=R.render!==!1?"this._scheduleRender();":"";return`
|
|
464
|
-
get ${I}() {
|
|
465
|
-
return this._${I};
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
set ${I}(value) {
|
|
469
|
-
const oldValue = this._${I};
|
|
470
|
-
if (oldValue === value) return;
|
|
471
|
-
this._${I} = value;${D}
|
|
472
|
-
${E}
|
|
473
|
-
${M}
|
|
474
|
-
this.dispatchEvent(new CustomEvent('${I}-changed', {
|
|
475
|
-
detail: { value, oldValue },
|
|
476
|
-
bubbles: true
|
|
477
|
-
}));
|
|
478
|
-
}`}).join(`
|
|
479
|
-
`),V=H.length>0?`
|
|
480
|
-
static get observedAttributes() {
|
|
481
|
-
return [${H.map((I)=>`'${I}'`).join(", ")}];
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
485
|
-
if (oldValue === newValue) return;
|
|
486
|
-
const propName = this._attrToProp[name];
|
|
487
|
-
if (propName) {
|
|
488
|
-
const propDef = this._propertyDefs[propName];
|
|
489
|
-
this[propName] = this._deserializeAttribute(newValue, propDef.type);
|
|
490
|
-
}
|
|
491
|
-
${U.attributeChanged||""}
|
|
492
|
-
}`:"",B=Object.entries(_).map(([I,R])=>{return`this._root.addEventListener('${I}', (e) => { ${R} });`}).join(`
|
|
493
|
-
`),A=Object.entries(K).map(([I,R])=>{return`
|
|
494
|
-
${I}() {
|
|
495
|
-
${R}
|
|
496
|
-
}`}).join(`
|
|
497
|
-
`),w=JSON.stringify(Object.fromEntries(q.map((I)=>[I,G[I]]))),F=JSON.stringify(Object.fromEntries(q.filter((I)=>G[I].attribute!==!1).map((I)=>[G[I].attribute||D0(I),I]))),k=J.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),T=$.replace(/\\/g,"\\\\").replace(/`/g,"\\`");return`/**
|
|
498
|
-
* ${Q} - Reactive Web Component
|
|
499
|
-
* Auto-generated with reactive properties and lifecycle management
|
|
500
|
-
*
|
|
501
|
-
* @customElement ${Z}
|
|
502
|
-
*/
|
|
503
|
-
class ${W} extends ${X} {
|
|
504
|
-
// Property definitions
|
|
505
|
-
_propertyDefs = ${w};
|
|
506
|
-
_attrToProp = ${F};
|
|
507
|
-
|
|
508
|
-
// Internal state
|
|
509
|
-
_state = ${JSON.stringify(j)};
|
|
510
|
-
_renderPending = false;
|
|
511
|
-
_isConnected = false;
|
|
512
|
-
|
|
513
|
-
constructor() {
|
|
514
|
-
super();
|
|
515
|
-
${z?'this.attachShadow({ mode: "open" });':""}
|
|
516
|
-
this._root = ${z?"this.shadowRoot":"this"};
|
|
517
|
-
|
|
518
|
-
// Initialize properties with defaults
|
|
519
|
-
${L}
|
|
520
|
-
|
|
521
|
-
// Initial render
|
|
522
|
-
this._render();
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
// =========================================================================
|
|
526
|
-
// Reactive Properties
|
|
527
|
-
// =========================================================================
|
|
528
|
-
${O}
|
|
529
|
-
|
|
530
|
-
// =========================================================================
|
|
531
|
-
// State Management
|
|
532
|
-
// =========================================================================
|
|
533
|
-
|
|
534
|
-
/**
|
|
535
|
-
* Get current internal state
|
|
536
|
-
*/
|
|
537
|
-
get state() {
|
|
538
|
-
return { ...this._state };
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
/**
|
|
542
|
-
* Update internal state and trigger re-render
|
|
543
|
-
* @param {Object} updates - State updates to merge
|
|
544
|
-
*/
|
|
545
|
-
setState(updates) {
|
|
546
|
-
const oldState = { ...this._state };
|
|
547
|
-
this._state = { ...this._state, ...updates };
|
|
548
|
-
this._scheduleRender();
|
|
549
|
-
this.dispatchEvent(new CustomEvent('state-changed', {
|
|
550
|
-
detail: { state: this._state, oldState },
|
|
551
|
-
bubbles: true
|
|
552
|
-
}));
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
// =========================================================================
|
|
556
|
-
// Rendering
|
|
557
|
-
// =========================================================================
|
|
558
|
-
|
|
559
|
-
/**
|
|
560
|
-
* Schedule a render on the next animation frame (batched)
|
|
561
|
-
*/
|
|
562
|
-
_scheduleRender() {
|
|
563
|
-
if (this._renderPending) return;
|
|
564
|
-
this._renderPending = true;
|
|
565
|
-
requestAnimationFrame(() => {
|
|
566
|
-
this._renderPending = false;
|
|
567
|
-
this._render();
|
|
568
|
-
});
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
/**
|
|
572
|
-
* Render the component template
|
|
573
|
-
*/
|
|
574
|
-
_render() {
|
|
575
|
-
const template = \`${T?`<style>${T}</style>`:""}${k}\`;
|
|
576
|
-
|
|
577
|
-
// Interpolate template with property values
|
|
578
|
-
const rendered = template.replace(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (match, propName) => {
|
|
579
|
-
if (propName in this) {
|
|
580
|
-
const value = this[propName];
|
|
581
|
-
if (value === null || value === undefined) return '';
|
|
582
|
-
if (typeof value === 'object') return JSON.stringify(value);
|
|
583
|
-
return String(value);
|
|
584
|
-
}
|
|
585
|
-
if (propName in this._state) {
|
|
586
|
-
const value = this._state[propName];
|
|
587
|
-
if (value === null || value === undefined) return '';
|
|
588
|
-
if (typeof value === 'object') return JSON.stringify(value);
|
|
589
|
-
return String(value);
|
|
590
|
-
}
|
|
591
|
-
return match;
|
|
592
|
-
});
|
|
593
|
-
|
|
594
|
-
this._root.innerHTML = rendered;
|
|
595
|
-
this._bindEvents();
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
/**
|
|
599
|
-
* Bind event handlers after render
|
|
600
|
-
*/
|
|
601
|
-
_bindEvents() {
|
|
602
|
-
${B}
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
// =========================================================================
|
|
606
|
-
// Attribute Handling
|
|
607
|
-
// =========================================================================
|
|
608
|
-
|
|
609
|
-
/**
|
|
610
|
-
* Deserialize attribute value to property type
|
|
611
|
-
*/
|
|
612
|
-
_deserializeAttribute(value, type) {
|
|
613
|
-
if (value === null) return null;
|
|
614
|
-
switch (type) {
|
|
615
|
-
case 'number': return Number(value);
|
|
616
|
-
case 'boolean': return value !== null && value !== 'false' && value !== '0';
|
|
617
|
-
case 'object':
|
|
618
|
-
case 'array':
|
|
619
|
-
try { return JSON.parse(value); }
|
|
620
|
-
catch { return type === 'array' ? [] : {}; }
|
|
621
|
-
default: return value;
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
${V}
|
|
626
|
-
|
|
627
|
-
// =========================================================================
|
|
628
|
-
// Lifecycle
|
|
629
|
-
// =========================================================================
|
|
630
|
-
|
|
631
|
-
connectedCallback() {
|
|
632
|
-
this._isConnected = true;
|
|
633
|
-
${U.connected||"// Component connected to DOM"}
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
disconnectedCallback() {
|
|
637
|
-
this._isConnected = false;
|
|
638
|
-
${U.disconnected||"// Component disconnected from DOM"}
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
adoptedCallback() {
|
|
642
|
-
${U.adopted||"// Component moved to new document"}
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
// =========================================================================
|
|
646
|
-
// Custom Methods
|
|
647
|
-
// =========================================================================
|
|
648
|
-
${A}
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
// Register the custom element
|
|
652
|
-
customElements.define('${Z}', ${W});
|
|
653
|
-
|
|
654
|
-
// Export for module usage
|
|
655
|
-
export { ${W} };
|
|
656
|
-
export default ${W};
|
|
657
|
-
`}function h7(Y){let{name:Q,tag:Z,baseElement:X="HTMLElement",template:J,styles:$="",shadowDOM:z=!0,properties:G={},lifecycle:U={},events:_={},methods:K={},state:j={}}=Y,W=Q.replace(/\W/g,""),q=Object.keys(G),H=q.filter((R)=>G[R].attribute!==!1).map((R)=>G[R].attribute||D0(R)),L=(R)=>{switch(R){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";case"array":return"unknown[]";default:return"unknown"}},O=q.length>0?`
|
|
658
|
-
/**
|
|
659
|
-
* Props interface for ${Q}
|
|
660
|
-
*/
|
|
661
|
-
export interface ${W}Props {
|
|
662
|
-
${q.map((R)=>` ${R}?: ${L(G[R].type)};`).join(`
|
|
663
|
-
`)}
|
|
664
|
-
}
|
|
665
|
-
`:"",V=Object.keys(j).length>0?`
|
|
666
|
-
/**
|
|
667
|
-
* State interface for ${Q}
|
|
668
|
-
*/
|
|
669
|
-
export interface ${W}State {
|
|
670
|
-
${Object.entries(j).map(([R,N])=>` ${R}: ${typeof N};`).join(`
|
|
671
|
-
`)}
|
|
672
|
-
}
|
|
673
|
-
`:`
|
|
674
|
-
export interface ${W}State {
|
|
675
|
-
[key: string]: unknown;
|
|
676
|
-
}
|
|
677
|
-
`,B=q.map((R)=>{let N=G[R],D=L(N.type);return` private _${R}: ${D};`}).join(`
|
|
678
|
-
`),A=q.map((R)=>{let N=G[R],D=L(N.type),E=N.attribute!==!1?N.attribute||D0(R):null,M=N.default!==void 0?JSON.stringify(N.default):N.type==="string"?'""':N.type==="number"?"0":N.type==="boolean"?"false":N.type==="array"?"[]":"{}",y=N.reflect&&E?`
|
|
679
|
-
if (value !== null && value !== undefined) {
|
|
680
|
-
${N.type==="boolean"?`if (value) { this.setAttribute('${E}', ''); }
|
|
681
|
-
else { this.removeAttribute('${E}'); }`:`this.setAttribute('${E}', ${N.type==="object"||N.type==="array"?"JSON.stringify(value)":"String(value)"});`}
|
|
682
|
-
}
|
|
683
|
-
else {
|
|
684
|
-
this.removeAttribute('${E}');
|
|
685
|
-
}`:"",b=N.observer?`this.${N.observer}(value, oldValue);`:"",C=N.render!==!1?"this._scheduleRender();":"";return`
|
|
686
|
-
get ${R}(): ${D} {
|
|
687
|
-
return this._${R};
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
set ${R}(value: ${D}) {
|
|
691
|
-
const oldValue = this._${R};
|
|
692
|
-
if (oldValue === value) return;
|
|
693
|
-
this._${R} = value;${y}
|
|
694
|
-
${b}
|
|
695
|
-
${C}
|
|
696
|
-
this.dispatchEvent(new CustomEvent('${R}-changed', {
|
|
697
|
-
detail: { value, oldValue },
|
|
698
|
-
bubbles: true
|
|
699
|
-
}));
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
// Property default: ${M}`}).join(`
|
|
703
|
-
`),w=H.length>0?`
|
|
704
|
-
static get observedAttributes(): string[] {
|
|
705
|
-
return [${H.map((R)=>`'${R}'`).join(", ")}];
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void {
|
|
709
|
-
if (oldValue === newValue) return;
|
|
710
|
-
const propName = this._attrToProp[name];
|
|
711
|
-
if (propName) {
|
|
712
|
-
const propDef = this._propertyDefs[propName];
|
|
713
|
-
(this as unknown as Record<string, unknown>)[propName] = this._deserializeAttribute(newValue, propDef.type);
|
|
714
|
-
}
|
|
715
|
-
${U.attributeChanged||""}
|
|
716
|
-
}`:"",F=Object.entries(_).map(([R,N])=>{return`this._root.addEventListener('${R}', (e: Event) => { ${N} });`}).join(`
|
|
717
|
-
`),k=Object.entries(K).map(([R,N])=>{return`
|
|
718
|
-
${R}(): void {
|
|
719
|
-
${N}
|
|
720
|
-
}`}).join(`
|
|
721
|
-
`),T=J.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),I=$.replace(/\\/g,"\\\\").replace(/`/g,"\\`");return`/**
|
|
722
|
-
* ${Q} - Reactive Web Component (TypeScript)
|
|
723
|
-
* Auto-generated with reactive properties and lifecycle management
|
|
724
|
-
*
|
|
725
|
-
* @customElement ${Z}
|
|
726
|
-
*/
|
|
727
|
-
|
|
728
|
-
${O}
|
|
729
|
-
${V}
|
|
730
|
-
|
|
731
|
-
/**
|
|
732
|
-
* Property definition type
|
|
733
|
-
*/
|
|
734
|
-
interface PropertyDefinition {
|
|
735
|
-
type: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
736
|
-
default?: unknown;
|
|
737
|
-
reflect?: boolean;
|
|
738
|
-
attribute?: string | false;
|
|
739
|
-
observer?: string;
|
|
740
|
-
render?: boolean;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
/**
|
|
744
|
-
* ${Q} custom element
|
|
745
|
-
*/
|
|
746
|
-
export class ${W} extends ${X} {
|
|
747
|
-
// Property definitions
|
|
748
|
-
private _propertyDefs: Record<string, PropertyDefinition> = ${JSON.stringify(G)};
|
|
749
|
-
private _attrToProp: Record<string, string> = ${JSON.stringify(Object.fromEntries(q.filter((R)=>G[R].attribute!==!1).map((R)=>[G[R].attribute||D0(R),R])))};
|
|
750
|
-
|
|
751
|
-
// Internal state
|
|
752
|
-
private _state: ${W}State = ${JSON.stringify(j)};
|
|
753
|
-
private _renderPending = false;
|
|
754
|
-
private _isConnected = false;
|
|
755
|
-
private _root: ShadowRoot | HTMLElement;
|
|
756
|
-
|
|
757
|
-
// Property backing fields
|
|
758
|
-
${B}
|
|
759
|
-
|
|
760
|
-
constructor() {
|
|
761
|
-
super();
|
|
762
|
-
${z?'this.attachShadow({ mode: "open" });':""}
|
|
763
|
-
this._root = ${z?"this.shadowRoot!":"this"};
|
|
764
|
-
|
|
765
|
-
// Initialize properties with defaults
|
|
766
|
-
${q.map((R)=>{let N=G[R],D=N.default!==void 0?JSON.stringify(N.default):N.type==="string"?'""':N.type==="number"?"0":N.type==="boolean"?"false":N.type==="array"?"[]":"{}";return` this._${R} = ${D};`}).join(`
|
|
767
|
-
`)}
|
|
768
|
-
|
|
769
|
-
// Initial render
|
|
770
|
-
this._render();
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
// =========================================================================
|
|
774
|
-
// Reactive Properties
|
|
775
|
-
// =========================================================================
|
|
776
|
-
${A}
|
|
777
|
-
|
|
778
|
-
// =========================================================================
|
|
779
|
-
// State Management
|
|
780
|
-
// =========================================================================
|
|
781
|
-
|
|
782
|
-
/**
|
|
783
|
-
* Get current internal state
|
|
784
|
-
*/
|
|
785
|
-
get state(): ${W}State {
|
|
786
|
-
return { ...this._state };
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
/**
|
|
790
|
-
* Update internal state and trigger re-render
|
|
791
|
-
*/
|
|
792
|
-
setState(updates: Partial<${W}State>): void {
|
|
793
|
-
const oldState = { ...this._state };
|
|
794
|
-
this._state = { ...this._state, ...updates };
|
|
795
|
-
this._scheduleRender();
|
|
796
|
-
this.dispatchEvent(new CustomEvent('state-changed', {
|
|
797
|
-
detail: { state: this._state, oldState },
|
|
798
|
-
bubbles: true
|
|
799
|
-
}));
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
// =========================================================================
|
|
803
|
-
// Rendering
|
|
804
|
-
// =========================================================================
|
|
805
|
-
|
|
806
|
-
/**
|
|
807
|
-
* Schedule a render on the next animation frame (batched)
|
|
808
|
-
*/
|
|
809
|
-
private _scheduleRender(): void {
|
|
810
|
-
if (this._renderPending) return;
|
|
811
|
-
this._renderPending = true;
|
|
812
|
-
requestAnimationFrame(() => {
|
|
813
|
-
this._renderPending = false;
|
|
814
|
-
this._render();
|
|
815
|
-
});
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
/**
|
|
819
|
-
* Render the component template
|
|
820
|
-
*/
|
|
821
|
-
private _render(): void {
|
|
822
|
-
const template = \`${I?`<style>${I}</style>`:""}${T}\`;
|
|
823
|
-
|
|
824
|
-
// Interpolate template with property values
|
|
825
|
-
const rendered = template.replace(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (match, propName) => {
|
|
826
|
-
if (propName in this) {
|
|
827
|
-
const value = (this as unknown as Record<string, unknown>)[propName];
|
|
828
|
-
if (value === null || value === undefined) return '';
|
|
829
|
-
if (typeof value === 'object') return JSON.stringify(value);
|
|
830
|
-
return String(value);
|
|
831
|
-
}
|
|
832
|
-
if (propName in this._state) {
|
|
833
|
-
const value = this._state[propName as keyof ${W}State];
|
|
834
|
-
if (value === null || value === undefined) return '';
|
|
835
|
-
if (typeof value === 'object') return JSON.stringify(value);
|
|
836
|
-
return String(value);
|
|
837
|
-
}
|
|
838
|
-
return match;
|
|
839
|
-
});
|
|
840
|
-
|
|
841
|
-
this._root.innerHTML = rendered;
|
|
842
|
-
this._bindEvents();
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
/**
|
|
846
|
-
* Bind event handlers after render
|
|
847
|
-
*/
|
|
848
|
-
private _bindEvents(): void {
|
|
849
|
-
${F}
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
// =========================================================================
|
|
853
|
-
// Attribute Handling
|
|
854
|
-
// =========================================================================
|
|
855
|
-
|
|
856
|
-
/**
|
|
857
|
-
* Deserialize attribute value to property type
|
|
858
|
-
*/
|
|
859
|
-
private _deserializeAttribute(value: string | null, type: string): unknown {
|
|
860
|
-
if (value === null) return null;
|
|
861
|
-
switch (type) {
|
|
862
|
-
case 'number': return Number(value);
|
|
863
|
-
case 'boolean': return value !== null && value !== 'false' && value !== '0';
|
|
864
|
-
case 'object':
|
|
865
|
-
case 'array':
|
|
866
|
-
try { return JSON.parse(value); }
|
|
867
|
-
catch { return type === 'array' ? [] : {}; }
|
|
868
|
-
default: return value;
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
${w}
|
|
873
|
-
|
|
874
|
-
// =========================================================================
|
|
875
|
-
// Lifecycle
|
|
876
|
-
// =========================================================================
|
|
877
|
-
|
|
878
|
-
connectedCallback(): void {
|
|
879
|
-
this._isConnected = true;
|
|
880
|
-
${U.connected||"// Component connected to DOM"}
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
disconnectedCallback(): void {
|
|
884
|
-
this._isConnected = false;
|
|
885
|
-
${U.disconnected||"// Component disconnected from DOM"}
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
adoptedCallback(): void {
|
|
889
|
-
${U.adopted||"// Component moved to new document"}
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
// =========================================================================
|
|
893
|
-
// Custom Methods
|
|
894
|
-
// =========================================================================
|
|
895
|
-
${k}
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
// Type augmentation for HTMLElementTagNameMap
|
|
899
|
-
declare global {
|
|
900
|
-
interface HTMLElementTagNameMap {
|
|
901
|
-
'${Z}': ${W};
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
// Register the custom element
|
|
906
|
-
customElements.define('${Z}', ${W});
|
|
907
|
-
|
|
908
|
-
export default ${W};
|
|
909
|
-
`}function d7(){return`/**
|
|
910
|
-
* ReactiveElement Mixin
|
|
911
|
-
* Adds reactive properties and lifecycle management to web components
|
|
912
|
-
*/
|
|
913
|
-
const ReactiveElement = (Base) => class extends Base {
|
|
914
|
-
static get observedAttributes() {
|
|
915
|
-
const props = this.properties || {};
|
|
916
|
-
return Object.keys(props)
|
|
917
|
-
.filter(prop => props[prop].attribute !== false)
|
|
918
|
-
.map(prop => props[prop].attribute || prop.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase());
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
constructor() {
|
|
922
|
-
super();
|
|
923
|
-
this._state = {};
|
|
924
|
-
this._renderPending = false;
|
|
925
|
-
this._propertyValues = new Map();
|
|
926
|
-
this._initializeProperties();
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
_initializeProperties() {
|
|
930
|
-
const props = this.constructor.properties || {};
|
|
931
|
-
for (const [name, def] of Object.entries(props)) {
|
|
932
|
-
// Set default value
|
|
933
|
-
if (def.default !== undefined) {
|
|
934
|
-
this._propertyValues.set(name, def.default);
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
// Define getter/setter
|
|
938
|
-
Object.defineProperty(this, name, {
|
|
939
|
-
get: () => this._propertyValues.get(name),
|
|
940
|
-
set: (value) => {
|
|
941
|
-
const oldValue = this._propertyValues.get(name);
|
|
942
|
-
if (oldValue === value) return;
|
|
943
|
-
this._propertyValues.set(name, value);
|
|
944
|
-
|
|
945
|
-
// Reflect to attribute
|
|
946
|
-
if (def.reflect) {
|
|
947
|
-
const attrName = def.attribute || name.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
948
|
-
if (def.type === 'boolean') {
|
|
949
|
-
value ? this.setAttribute(attrName, '') : this.removeAttribute(attrName);
|
|
950
|
-
}
|
|
951
|
-
else {
|
|
952
|
-
this.setAttribute(attrName, def.type === 'object' ? JSON.stringify(value) : String(value));
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
// Call observer
|
|
957
|
-
if (def.observer && typeof this[def.observer] === 'function') {
|
|
958
|
-
this[def.observer](value, oldValue);
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
// Schedule render
|
|
962
|
-
if (def.render !== false) {
|
|
963
|
-
this._scheduleRender();
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
// Dispatch event
|
|
967
|
-
this.dispatchEvent(new CustomEvent(\`\${name}-changed\`, {
|
|
968
|
-
detail: { value, oldValue },
|
|
969
|
-
bubbles: true
|
|
970
|
-
}));
|
|
971
|
-
},
|
|
972
|
-
enumerable: true,
|
|
973
|
-
configurable: true
|
|
974
|
-
});
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
979
|
-
if (oldValue === newValue) return;
|
|
980
|
-
const props = this.constructor.properties || {};
|
|
981
|
-
const propName = Object.keys(props).find(p =>
|
|
982
|
-
(props[p].attribute || p.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase()) === name
|
|
983
|
-
);
|
|
984
|
-
if (propName) {
|
|
985
|
-
const def = props[propName];
|
|
986
|
-
this[propName] = this._deserialize(newValue, def.type);
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
_deserialize(value, type) {
|
|
991
|
-
if (value === null) return null;
|
|
992
|
-
switch (type) {
|
|
993
|
-
case 'number': return Number(value);
|
|
994
|
-
case 'boolean': return value !== null && value !== 'false';
|
|
995
|
-
case 'object':
|
|
996
|
-
case 'array':
|
|
997
|
-
try { return JSON.parse(value); }
|
|
998
|
-
catch { return type === 'array' ? [] : {}; }
|
|
999
|
-
default: return value;
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
get state() {
|
|
1004
|
-
return { ...this._state };
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
setState(updates) {
|
|
1008
|
-
const oldState = { ...this._state };
|
|
1009
|
-
this._state = { ...this._state, ...updates };
|
|
1010
|
-
this._scheduleRender();
|
|
1011
|
-
this.dispatchEvent(new CustomEvent('state-changed', {
|
|
1012
|
-
detail: { state: this._state, oldState },
|
|
1013
|
-
bubbles: true
|
|
1014
|
-
}));
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
_scheduleRender() {
|
|
1018
|
-
if (this._renderPending) return;
|
|
1019
|
-
this._renderPending = true;
|
|
1020
|
-
requestAnimationFrame(() => {
|
|
1021
|
-
this._renderPending = false;
|
|
1022
|
-
if (typeof this.render === 'function') {
|
|
1023
|
-
this.render();
|
|
1024
|
-
}
|
|
1025
|
-
});
|
|
1026
|
-
}
|
|
1027
|
-
};
|
|
1028
|
-
|
|
1029
|
-
export { ReactiveElement };
|
|
1030
|
-
export default ReactiveElement;
|
|
1031
|
-
`}function m7(){return`/**
|
|
1032
|
-
* stx Reactive Web Components Runtime
|
|
1033
|
-
* Provides base classes and utilities for reactive web components
|
|
1034
|
-
*/
|
|
1035
|
-
(function(global) {
|
|
1036
|
-
'use strict';
|
|
1037
|
-
|
|
1038
|
-
/**
|
|
1039
|
-
* Base class for reactive web components
|
|
1040
|
-
*/
|
|
1041
|
-
class StxElement extends HTMLElement {
|
|
1042
|
-
static get observedAttributes() {
|
|
1043
|
-
const props = this.properties || {};
|
|
1044
|
-
return Object.keys(props)
|
|
1045
|
-
.filter(prop => props[prop].attribute !== false)
|
|
1046
|
-
.map(prop => props[prop].attribute || toKebabCase(prop));
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
constructor() {
|
|
1050
|
-
super();
|
|
1051
|
-
this._state = {};
|
|
1052
|
-
this._renderPending = false;
|
|
1053
|
-
this._props = new Map();
|
|
1054
|
-
this._setupShadowDOM();
|
|
1055
|
-
this._initProperties();
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
_setupShadowDOM() {
|
|
1059
|
-
if (this.constructor.useShadowDOM !== false) {
|
|
1060
|
-
this.attachShadow({ mode: 'open' });
|
|
1061
|
-
this._root = this.shadowRoot;
|
|
1062
|
-
}
|
|
1063
|
-
else {
|
|
1064
|
-
this._root = this;
|
|
1065
|
-
}
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
_initProperties() {
|
|
1069
|
-
const props = this.constructor.properties || {};
|
|
1070
|
-
for (const [name, def] of Object.entries(props)) {
|
|
1071
|
-
let value = def.default;
|
|
1072
|
-
this._props.set(name, value);
|
|
1073
|
-
|
|
1074
|
-
Object.defineProperty(this, name, {
|
|
1075
|
-
get: () => this._props.get(name),
|
|
1076
|
-
set: (newValue) => this._setProperty(name, newValue, def),
|
|
1077
|
-
enumerable: true
|
|
1078
|
-
});
|
|
1079
|
-
}
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
_setProperty(name, value, def) {
|
|
1083
|
-
const oldValue = this._props.get(name);
|
|
1084
|
-
if (oldValue === value) return;
|
|
1085
|
-
|
|
1086
|
-
this._props.set(name, value);
|
|
1087
|
-
|
|
1088
|
-
if (def.reflect && def.attribute !== false) {
|
|
1089
|
-
this._reflectToAttribute(name, value, def);
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
|
-
if (def.observer && this[def.observer]) {
|
|
1093
|
-
this[def.observer](value, oldValue);
|
|
1094
|
-
}
|
|
1095
|
-
|
|
1096
|
-
if (def.render !== false) {
|
|
1097
|
-
this.requestUpdate();
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
this.dispatchEvent(new CustomEvent(name + '-changed', {
|
|
1101
|
-
detail: { value, oldValue },
|
|
1102
|
-
bubbles: true,
|
|
1103
|
-
composed: true
|
|
1104
|
-
}));
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
_reflectToAttribute(name, value, def) {
|
|
1108
|
-
const attrName = def.attribute || toKebabCase(name);
|
|
1109
|
-
if (value == null || (def.type === 'boolean' && !value)) {
|
|
1110
|
-
this.removeAttribute(attrName);
|
|
1111
|
-
}
|
|
1112
|
-
else if (def.type === 'boolean') {
|
|
1113
|
-
this.setAttribute(attrName, '');
|
|
1114
|
-
}
|
|
1115
|
-
else if (def.type === 'object' || def.type === 'array') {
|
|
1116
|
-
this.setAttribute(attrName, JSON.stringify(value));
|
|
1117
|
-
}
|
|
1118
|
-
else {
|
|
1119
|
-
this.setAttribute(attrName, String(value));
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
1124
|
-
if (oldValue === newValue) return;
|
|
1125
|
-
const props = this.constructor.properties || {};
|
|
1126
|
-
const propName = Object.keys(props).find(p => {
|
|
1127
|
-
const def = props[p];
|
|
1128
|
-
return (def.attribute || toKebabCase(p)) === name;
|
|
1129
|
-
});
|
|
1130
|
-
|
|
1131
|
-
if (propName) {
|
|
1132
|
-
const def = props[propName];
|
|
1133
|
-
this[propName] = deserialize(newValue, def.type);
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
|
-
get state() {
|
|
1138
|
-
return { ...this._state };
|
|
1139
|
-
}
|
|
1140
|
-
|
|
1141
|
-
setState(updates) {
|
|
1142
|
-
const oldState = { ...this._state };
|
|
1143
|
-
Object.assign(this._state, updates);
|
|
1144
|
-
this.requestUpdate();
|
|
1145
|
-
this.dispatchEvent(new CustomEvent('state-changed', {
|
|
1146
|
-
detail: { state: this._state, oldState },
|
|
1147
|
-
bubbles: true
|
|
1148
|
-
}));
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
requestUpdate() {
|
|
1152
|
-
if (this._renderPending) return;
|
|
1153
|
-
this._renderPending = true;
|
|
1154
|
-
requestAnimationFrame(() => {
|
|
1155
|
-
this._renderPending = false;
|
|
1156
|
-
this.update();
|
|
1157
|
-
});
|
|
1158
|
-
}
|
|
1159
|
-
|
|
1160
|
-
update() {
|
|
1161
|
-
if (this.render) {
|
|
1162
|
-
const content = this.render();
|
|
1163
|
-
if (typeof content === 'string') {
|
|
1164
|
-
this._root.innerHTML = content;
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
connectedCallback() {
|
|
1170
|
-
this.update();
|
|
1171
|
-
if (this.connected) this.connected();
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
disconnectedCallback() {
|
|
1175
|
-
if (this.disconnected) this.disconnected();
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
adoptedCallback() {
|
|
1179
|
-
if (this.adopted) this.adopted();
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1182
|
-
// Template helper
|
|
1183
|
-
html(strings, ...values) {
|
|
1184
|
-
return strings.reduce((result, str, i) => {
|
|
1185
|
-
let value = values[i] || '';
|
|
1186
|
-
if (Array.isArray(value)) value = value.join('');
|
|
1187
|
-
if (typeof value === 'object') value = JSON.stringify(value);
|
|
1188
|
-
return result + str + value;
|
|
1189
|
-
}, '');
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
|
|
1193
|
-
// Utility functions
|
|
1194
|
-
function toKebabCase(str) {
|
|
1195
|
-
return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
function deserialize(value, type) {
|
|
1199
|
-
if (value === null) return null;
|
|
1200
|
-
switch (type) {
|
|
1201
|
-
case 'number': return Number(value);
|
|
1202
|
-
case 'boolean': return value !== null && value !== 'false' && value !== '0';
|
|
1203
|
-
case 'object':
|
|
1204
|
-
case 'array':
|
|
1205
|
-
try { return JSON.parse(value); }
|
|
1206
|
-
catch { return type === 'array' ? [] : {}; }
|
|
1207
|
-
default: return value;
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1211
|
-
// Export to global
|
|
1212
|
-
global.StxElement = StxElement;
|
|
1213
|
-
global.stxComponents = global.stxComponents || {};
|
|
1214
|
-
|
|
1215
|
-
// Helper to define components
|
|
1216
|
-
global.defineStxComponent = function(tag, config) {
|
|
1217
|
-
const { properties, template, styles, methods, ...options } = config;
|
|
1218
|
-
|
|
1219
|
-
class Component extends StxElement {
|
|
1220
|
-
static get properties() { return properties || {}; }
|
|
1221
|
-
static get useShadowDOM() { return options.shadowDOM !== false; }
|
|
1222
|
-
|
|
1223
|
-
render() {
|
|
1224
|
-
let html = template || '';
|
|
1225
|
-
// Simple interpolation
|
|
1226
|
-
html = html.replace(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (match, key) => {
|
|
1227
|
-
if (key in this) return this[key] ?? '';
|
|
1228
|
-
if (key in this._state) return this._state[key] ?? '';
|
|
1229
|
-
return match;
|
|
1230
|
-
});
|
|
1231
|
-
return (styles ? '<style>' + styles + '</style>' : '') + html;
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
// Add methods
|
|
1236
|
-
if (methods) {
|
|
1237
|
-
for (const [name, fn] of Object.entries(methods)) {
|
|
1238
|
-
Component.prototype[name] = fn;
|
|
1239
|
-
}
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
customElements.define(tag, Component);
|
|
1243
|
-
global.stxComponents[tag] = Component;
|
|
1244
|
-
return Component;
|
|
1245
|
-
};
|
|
1246
|
-
|
|
1247
|
-
})(typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : this);
|
|
1248
|
-
`}function g5(Y,Q){let Z=Y.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),X=Z?Z[1].trim():"",J=Q,$=[],z=!0;if(X){let j=X.match(/export\s+default\s+({[\s\S]*})/);if(j)try{let W=j[1],q=W.match(/tag\s*:\s*['"`]([^'"`]+)['"`]/);if(q)J=q[1];let H=W.match(/props\s*:\s*\[([\s\S]*?)\]/);if(H)$=H[1].split(",").map((O)=>O.trim().replace(/['"`]/g,"")).filter((O)=>O.length>0);let L=W.match(/shadowDOM\s*:\s*(true|false)/);if(L)z=L[1]==="true"}catch{}}let G=Y.match(/<template\b(?![^>]*\bid\s*=)[^>]*>([\s\S]*?)<\/template>/i),U=G?G[1].trim():"",_=Y.match(/<style\b[^>]*>([\s\S]*?)<\/style>/i),K=_?_[1].trim():"";return{tag:J,props:$,template:U,styles:K,script:X,shadowDOM:z}}function x5(Y){let{tag:Q,props:Z,template:X,styles:J,shadowDOM:$}=Y,z=Q.split("-").map((j)=>j.charAt(0).toUpperCase()+j.slice(1)).join(""),G=X.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),U=J.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),_=Z.map((j)=>`'${j}'`).join(", "),K=Z.map((j)=>`
|
|
1249
|
-
get ${j}() {
|
|
1250
|
-
return this.getAttribute('${j}') || '';
|
|
1251
|
-
}
|
|
1252
|
-
set ${j}(value) {
|
|
1253
|
-
if (value) {
|
|
1254
|
-
this.setAttribute('${j}', value);
|
|
1255
|
-
}
|
|
1256
|
-
else {
|
|
1257
|
-
this.removeAttribute('${j}');
|
|
1258
|
-
}
|
|
1259
|
-
}`).join(`
|
|
1260
|
-
`);return`/**
|
|
1261
|
-
* ${z} Web Component
|
|
1262
|
-
* Auto-generated from SFC
|
|
1263
|
-
*/
|
|
1264
|
-
class ${z} extends HTMLElement {
|
|
1265
|
-
constructor() {
|
|
1266
|
-
super();
|
|
1267
|
-
${$?"this.attachShadow({ mode: 'open' });":""}
|
|
1268
|
-
this._render();
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
static get observedAttributes() {
|
|
1272
|
-
return [${_}];
|
|
1273
|
-
}
|
|
1274
|
-
|
|
1275
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
1276
|
-
if (oldValue !== newValue) {
|
|
1277
|
-
this._render();
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
${K}
|
|
1281
|
-
|
|
1282
|
-
_render() {
|
|
1283
|
-
const template = \`${U?`<style>${U}</style>`:""}${G}\`;
|
|
1284
|
-
|
|
1285
|
-
// Interpolate {{ prop }} with attribute values
|
|
1286
|
-
const rendered = template.replace(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (match, prop) => {
|
|
1287
|
-
return this.getAttribute(prop) || '';
|
|
1288
|
-
});
|
|
1289
|
-
|
|
1290
|
-
${$?"this.shadowRoot.innerHTML = rendered;":"this.innerHTML = rendered;"}
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
connectedCallback() {
|
|
1294
|
-
this._render();
|
|
1295
|
-
}
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
customElements.define('${Q}', ${z});
|
|
1299
|
-
`}async function q3(Y,Q,Z,X){if(Q.length<1)return j0("WebComponent","@webcomponent directive requires at least the tag name parameter",H0.INVALID_DIRECTIVE_SYNTAX);let J=Q[0].replace(/['"]/g,""),z=(Z.__stx_options||{}).componentsDir||"components",G=[A0.join(A0.dirname(X),z,`${J}.stx`),A0.join(process.cwd(),z,`${J}.stx`),A0.join(A0.dirname(X),`${J}.stx`)],U=null;for(let j of G)if(await x(j)){U=await Bun.file(j).text();break}if(!U)return j0("WebComponent",`Component file not found: ${J}.stx`,H0.FILE_NOT_FOUND);let _=g5(U,J);return`<script type="module">
|
|
1300
|
-
${x5(_)}
|
|
1301
|
-
</script>`}var k3={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,cachePath:".stx/cache",cacheVersion:"1.0.0",build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:K3,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:q3,hasEndTag:!1,description:"Include a web component in the template"},j3,_3,T3,I3,W3,B3,O3,L3,V3,A3,w3,F3,...R3],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"#app-content",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function d5(Y,Q){let Z=Q||"pages";if(Y)return{root:Y,pagesDir:Z};let X=X0.join(process.cwd(),"resources","views"),J=X0.join(process.cwd(),"resources","layouts");if(V1.existsSync(X)&&V1.existsSync(J))return{root:"resources",pagesDir:"views"};let $=X0.join(process.cwd(),"resources","views","pages");if(V1.existsSync($))return{root:"resources/views",pagesDir:Z};return{root:".",pagesDir:Z}}var E0=null,H3=new Map,r0=null;async function m5(Y){if(!Y){if(E0)return E0;if(r0)return r0}let Q=Y?X0.resolve(Y):process.cwd(),Z=H3.get(Q);if(Z)return Z;let X=(async()=>{let $=(await h5({name:"stx",alias:"ui",cwd:Q,defaultConfig:k3,verbose:!1})).config,z=d5($.root,$.pagesDir);if($.root=z.root,$.pagesDir=z.pagesDir,$.root&&$.root!=="."){let G=$.root;if($.partialsDir&&!X0.isAbsolute($.partialsDir))$.partialsDir=X0.join(G,$.partialsDir);if($.componentsDir&&!X0.isAbsolute($.componentsDir))$.componentsDir=X0.join(G,$.componentsDir);if($.layoutsDir&&!X0.isAbsolute($.layoutsDir))$.layoutsDir=X0.join(G,$.layoutsDir)}if($.plugins&&$.plugins.length>0){let{pluginManager:G}=await import("././plugin-system.js"),U=[],_=[];for(let K of $.plugins){let j=typeof K==="string"?K:K[0],W=typeof K==="string"?{}:K[1]||{};try{let q,H;try{q=await import(j),H=X0.dirname(h.resolve(j))}catch{let O=X0.resolve(process.cwd(),j);q=await import(O),H=X0.dirname(O)}let L=q.default||q;if(G.register(L,$),L.components){let O=X0.resolve(H,L.components);U.push(O)}if(L.pages){let O=X0.resolve(H,L.pages),V=W.path||"/";_.push({dir:O,prefix:V})}if(L.setup){let O={addDirective:(V)=>{$.customDirectives=$.customDirectives||[],$.customDirectives.push(V)},addRoute:(V,B)=>{$.apiRoutes=$.apiRoutes||{},$.apiRoutes[V]=B},addMiddleware:(V)=>{$.middleware=$.middleware||[],$.middleware.push(V)},pluginDir:H,config:$};await L.setup(W,O)}console.log(`[stx] Plugin loaded: ${L.name||j}`)}catch(q){console.warn(`[stx] Failed to load plugin ${j}:`,q.message)}}$._pluginComponentDirs=U,$._pluginPageDirs=_}return $})();if(H3.set(Q,X),!Y)r0=X,X.then((J)=>{E0=J}).catch(()=>{});return X}var N3=new Proxy(k3,{get(Y,Q){if(E0&&Q in E0)return E0[Q];if(!r0)m5().catch((Z)=>{console.warn("[stx] Failed to load config file:",Z?.message||Z)});return Y[Q]}});function Z9(Y){return Y}function X9(Y){let Q=[],Z=[];if(Y.partialsDir!==void 0&&typeof Y.partialsDir!=="string")Q.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(Y.componentsDir!==void 0&&typeof Y.componentsDir!=="string")Q.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(Y.cache!==void 0&&typeof Y.cache!=="boolean")Q.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(Y.debug!==void 0&&typeof Y.debug!=="boolean")Q.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(Y.streaming){if(Y.streaming.bufferSize!==void 0){if(typeof Y.streaming.bufferSize!=="number"||Y.streaming.bufferSize<=0)Q.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(Y.streaming.timeout!==void 0){if(typeof Y.streaming.timeout!=="number"||Y.streaming.timeout<=0)Q.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(Y.streaming.strategy!==void 0){let X=["auto","manual","sections"];if(!X.includes(Y.streaming.strategy))Q.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${X.join(", ")}`,severity:"error"})}}if(Y.i18n){if(Y.i18n.format!==void 0){let X=["json","yaml","yml","js"];if(!X.includes(Y.i18n.format))Q.push({path:"i18n.format",message:`i18n.format must be one of: ${X.join(", ")}`,severity:"error"})}}if(Y.animation){if(Y.animation.defaultDuration!==void 0){if(typeof Y.animation.defaultDuration!=="number"||Y.animation.defaultDuration<0)Q.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(Y.animation.staggerDelay!==void 0){if(typeof Y.animation.staggerDelay!=="number"||Y.animation.staggerDelay<0)Q.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(Y.a11y){if(Y.a11y.level!==void 0){let X=["AA","AAA"];if(!X.includes(Y.a11y.level))Q.push({path:"a11y.level",message:`a11y.level must be one of: ${X.join(", ")}`,severity:"error"})}}if(Y.hydration){if(Y.hydration.mode!==void 0){let X=["progressive","islands"];if(!X.includes(Y.hydration.mode))Q.push({path:"hydration.mode",message:`hydration.mode must be one of: ${X.join(", ")}`,severity:"error"})}if(Y.hydration.preload!==void 0){let X=["none","eager","lazy"];if(!X.includes(Y.hydration.preload))Q.push({path:"hydration.preload",message:`hydration.preload must be one of: ${X.join(", ")}`,severity:"error"})}}if(Y.customDirectives)if(!Array.isArray(Y.customDirectives))Q.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else Y.customDirectives.forEach((X,J)=>{if(!X.name||typeof X.name!=="string")Q.push({path:`customDirectives[${J}].name`,message:"Custom directive must have a name string",severity:"error"});if(!X.handler||typeof X.handler!=="function")Q.push({path:`customDirectives[${J}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(Y.middleware)if(!Array.isArray(Y.middleware))Q.push({path:"middleware",message:"middleware must be an array",severity:"error"});else Y.middleware.forEach((X,J)=>{if(!X.name||typeof X.name!=="string")Q.push({path:`middleware[${J}].name`,message:"Middleware must have a name string",severity:"error"});if(!X.handler||typeof X.handler!=="function")Q.push({path:`middleware[${J}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!X.timing||!["before","after"].includes(X.timing))Q.push({path:`middleware[${J}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(Y.debug===!0&&Y.cache===!0)Z.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(Y.seo?.enabled===!0&&!Y.seo?.defaultConfig?.title)Z.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(Y.pwa){if(Y.pwa.enabled===!0&&!Y.pwa.manifest?.name)Q.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(Y.pwa.manifest?.display!==void 0){let X=["fullscreen","standalone","minimal-ui","browser"];if(!X.includes(Y.pwa.manifest.display))Q.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${X.join(", ")}`,severity:"error"})}if(Y.pwa.manifest?.orientation!==void 0){let X=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!X.includes(Y.pwa.manifest.orientation))Q.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${X.join(", ")}`,severity:"error"})}if(Y.pwa.routes){let X=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];Y.pwa.routes.forEach((J,$)=>{if(!J.pattern||typeof J.pattern!=="string")Q.push({path:`pwa.routes[${$}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!X.includes(J.strategy))Q.push({path:`pwa.routes[${$}].strategy`,message:`PWA route strategy must be one of: ${X.join(", ")}`,severity:"error"});if(J.maxAgeSeconds!==void 0&&(typeof J.maxAgeSeconds!=="number"||J.maxAgeSeconds<0))Q.push({path:`pwa.routes[${$}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(J.maxEntries!==void 0&&(typeof J.maxEntries!=="number"||J.maxEntries<1))Q.push({path:`pwa.routes[${$}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(Y.pwa.icons?.sizes){if(!Array.isArray(Y.pwa.icons.sizes))Q.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(Y.pwa.icons.sizes.filter((J)=>typeof J!=="number"||J<16||J>1024).length>0)Q.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(Y.pwa.icons?.purpose){let X=["any","maskable","monochrome"];if(Y.pwa.icons.purpose.filter(($)=>!X.includes($)).length>0)Q.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${X.join(", ")}`,severity:"error"})}if(Y.pwa.enabled===!0&&!Y.pwa.icons?.src)Z.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(Y.pwa.enabled===!0&&!Y.pwa.manifest?.themeColor)Z.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:Q.length===0,errors:Q,warnings:Z}}var w1=new Map;async function c5(Y,Q={}){try{if(!await x(Y))throw Error(`Markdown file not found: ${Y}`);let X=(await u5.promises.stat(Y)).mtime.getTime();if(Q.cache&&w1.has(Y)){let j=w1.get(Y);if(j.updatedAt>=X)return{content:j.content,data:j.data}}let J=await Bun.file(Y).text(),{data:$,content:z}=D3(J),G=Q.markdown||N3.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},_=v0(z,{gfm:!0});if(G.syntaxHighlighting?.enabled&&G.syntaxHighlighting?.serverSide)_=await i5(_,G.syntaxHighlighting?.defaultTheme||"github-dark",G.syntaxHighlighting?.highlightUnknownLanguages||!1);let K={content:_,data:$||{}};if(Q.cache)w1.set(Y,{...K,updatedAt:X});return K}catch(Z){if(Q.debug)console.error(`Error reading/parsing markdown file ${Y}:`,Z);let X=Z instanceof Error?Z.message:String(Z);return{content:i("Markdown File",`Error reading/parsing markdown file: ${X}`,Y,"",0,""),data:{}}}}var a0=null;async function i5(Y,Q,Z){let X=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!a0)try{a0=await l5({theme:Q||"github-dark",cache:!0})}catch(G){return console.error("Failed to initialize ts-syntax-highlighter:",G),Y}let J=async(G,U,_,K)=>{let j=K.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'"),W=_||(Z?"text":"");if(!W)return G;try{if(!a0.getSupportedLanguages().includes(W))return G;return(await a0.highlight(j,W,{theme:Q})).html}catch(q){console.error(`Error highlighting code block with language ${_}:`,q)}return G},$=Y,z=Y.matchAll(X);for(let G of z){let[U,_,K,j]=G,W=await J(U,_,K,j);$=$.replace(U,W)}return $}async function E3(Y,Q,Z="",X={}){return await p5(Y,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(z,G,U,_)=>{try{let K=G;if(!A1.isAbsolute(G))K=A1.resolve(A1.dirname(Z),G);let j={};if(U)try{try{j=JSON.parse(U)}catch{if(X.debug)console.warn("Using safer alternative for parsing JS object literal");let B=U.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let A of B){let w=A.indexOf(":");if(w>0){let F=A.substring(0,w).trim(),k=A.substring(w+1).trim(),T=k.startsWith('"')&&k.endsWith('"'),I=k.startsWith("'")&&k.endsWith("'");if(T||I)k=k.substring(1,k.length-1);j[F]=k}}}}catch(V){if(X.debug)console.error("Error parsing context in @markdown-file directive:",V)}let{content:W,data:q}=await c5(K,X),H={...Q,...q,...j},L=W,O=/\{\{([^}]+)\}\}/g;return L=L.replace(O,(V,B)=>{let A=B.trim();return H[A]!==void 0?String(H[A]):V}),L}catch(K){let j=K instanceof Error?K.message:String(K);return i("Markdown File",`Error including markdown file: ${j}`,Z,Y,_,z)}})}async function p5(Y,Q,Z){let X=[],J;while((J=Q.exec(Y))!==null){let G=J[0],U=J.index,_=J;X.push(Z(..._).then((K)=>({match:G,replacement:K,index:U})))}let $=await Promise.all(X);$.sort((G,U)=>U.index-G.index);let z=Y;for(let{match:G,replacement:U}of $)z=z.replace(G,()=>U);return z}import s from"path";function F1(Y,Q){let Z=0;for(let X=Q;X<Y.length;X++){let J=Y[X];if(J==="("||J==="["||J==="{")Z++;else if(J===")"||J==="]"||J==="}")Z--;else if(J===","&&Z===0)return X}return-1}function s5(Y,Q,Z){let X=Y,J=new RegExp(`${Q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),$=J.exec(X);while($){let z=$.index,G=z+$[0].length-1,U=1,_=G+1;while(_<X.length&&U>0){if(X[_]==="(")U++;else if(X[_]===")")U--;_++}if(U!==0)break;let K=X.substring(G+1,_-1),j=`${Z}(${K})`;X=X.substring(0,z)+j+X.substring(_),J.lastIndex=z+j.length,$=J.exec(X)}return X}function n5(Y){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(Y)}function r5(Y){let Q=Y,Z=[],X=new Set,J=0,$=0,z=Q.length,G=(j)=>{$++;while($<z){if(Q[$]==="\\"){$+=2;continue}if(Q[$]===j){$++;return}$++}},U=()=>{$++;while($<z){if(Q[$]==="\\"){$+=2;continue}if(Q[$]==="`"){$++;return}if(Q[$]==="$"&&Q[$+1]==="{"){$+=2;let j=1;while($<z&&j>0)if(Q[$]==="{")j++,$++;else if(Q[$]==="}")j--,$++;else if(Q[$]==="'"||Q[$]==='"')G(Q[$]);else if(Q[$]==="`")U();else $++;continue}$++}},_=()=>{if(Q[$]==="/"&&Q[$+1]==="/"){while($<z&&Q[$]!==`
|
|
1302
|
-
`)$++;return!0}if(Q[$]==="/"&&Q[$+1]==="*"){$+=2;while($<z-1&&!(Q[$]==="*"&&Q[$+1]==="/"))$++;return $+=2,!0}return!1},K=()=>{if(J!==0)return;let j=Q.slice($).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(j){let H=j[2];if(!X.has(H))Z.push(H),X.add(H);return}let W=Q.slice($).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(W){let H=W[1];if(!X.has(H))Z.push(H),X.add(H);return}let q=Q.slice($).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(q){let H=q[1];if(!X.has(H))Z.push(H),X.add(H)}};while($<z){if(_())continue;if(Q[$]==="'"||Q[$]==='"'){G(Q[$]);continue}if(Q[$]==="`"){U();continue}if(Q[$]==="{"){J++,$++;continue}if(Q[$]==="}"){J--,$++;continue}if(J===0&&/[a-z]/i.test(Q[$])&&($===0||/\s|[;{}()]/.test(Q[$-1])))K();$++}return Z.join(", ")}function y3(Y,Q=""){return`
|
|
1303
|
-
(function() {
|
|
1304
|
-
var { state, derived, effect, batch, onMount, onDestroy, defineStore, useStore, useFetch, useRef, useQuery, useMutation, useOptimistic, useDebounce, useDebouncedValue, useThrottle, useInterval, useTimeout, useToggle, useCounter, useClickOutside, useFocus, useAsync, useLocalStorage, useSessionStorage, useCookie, useReactiveProp, useEventListener, useWebSocket, useColorMode, useDark, useHead, useSeoMeta, definePageMeta, useRoute, useSearchParams, navigate, goBack, goForward, provide, ref, reactive, computed, watch, watchEffect, defineProps, withDefaults, defineEmits, defineExpose, defineSlots } = window.stx;
|
|
1305
|
-
var __destroyHooks = [];
|
|
1306
|
-
var __origOnDestroy = onDestroy;
|
|
1307
|
-
onDestroy = function(fn) { __origOnDestroy(fn); __destroyHooks.push(fn); };
|
|
1308
|
-
|
|
1309
|
-
${Y}
|
|
1310
|
-
${Q}})();
|
|
1311
|
-
`}function a5(Y,Q){let $=`
|
|
1312
|
-
// Register scope variables for STX runtime
|
|
1313
|
-
if (!window.stx._scopes) window.stx._scopes = {};
|
|
1314
|
-
var __scopeRegistration = { __destroyCallbacks: __destroyHooks };
|
|
1315
|
-
${r5(Y).split(",").map((U)=>U.trim()).filter(Boolean).map((U)=>` try { __scopeRegistration[${JSON.stringify(U)}] = ${U}; } catch (e) { /* not actually top-level */ }`).join(`
|
|
1316
|
-
`)}
|
|
1317
|
-
// #1767: when the bundler renamed a component const that collided with an
|
|
1318
|
-
// inlined import (foo -> foo2), rebind the ORIGINAL template name to the
|
|
1319
|
-
// renamed declaration so it resolves to the component's value, not the
|
|
1320
|
-
// shadowing import. __stxScopeRenames is emitted by bundleClientScript.
|
|
1321
|
-
try { if (typeof __stxScopeRenames !== 'undefined' && __stxScopeRenames) { for (var __stxRK in __stxScopeRenames) __scopeRegistration[__stxRK] = __stxScopeRenames[__stxRK]; } } catch (e) { /* no renames */ }
|
|
1322
|
-
window.stx._scopes['${Q}'] = __scopeRegistration;
|
|
1323
|
-
`,z=`
|
|
1324
|
-
(function() {
|
|
1325
|
-
var __stxScopeEl = (typeof document !== 'undefined') ? document.querySelector('[data-stx-scope="${Q}"]') : null;
|
|
1326
|
-
var __stxPrevEl = (typeof window !== 'undefined') ? window.__STX_CURRENT_ELEMENT__ : undefined;
|
|
1327
|
-
if (__stxScopeEl && typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxScopeEl;
|
|
1328
|
-
try {`,G=`
|
|
1329
|
-
} finally {
|
|
1330
|
-
if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
|
|
1331
|
-
}
|
|
1332
|
-
})();`;return z+y3(Y,$)+`
|
|
1333
|
-
} finally {
|
|
1334
|
-
if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
|
|
1335
|
-
}
|
|
1336
|
-
})();`}function o5(Y,Q){let Z=Y.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*>|>)/s);if(Z){let J=(Z[2]+Z[3]).match(/data-stx-scope="([^"]*)"/);if(J)return{html:Y,mergedIntoExisting:J[1]};let $=Z[1],z=Z[2],G=Z[3];return{html:`${$}${z} data-stx-scope="${Q}"${G}${Y.slice(Z[0].length)}`,mergedIntoExisting:null}}return{html:Y,mergedIntoExisting:null}}var M3=0,F9=new o0(500),b3=new Set;function R9(){b3.clear()}function e5(Y){if(Y.__onceStore instanceof Set)return Y.__onceStore;return b3}async function R1(Y,Q,Z,X,J,$=new Set){let z=X.partialsDir||s.join(s.dirname(Z),"partials");if(z&&!s.isAbsolute(z))z=s.resolve(process.cwd(),z);let G=s5(Y,"@partial","@include"),U=e5(Q);G=G.replace(/@once([\s\S]*?)@endonce/g,(H,L,O)=>{let V=L.trim(),B=`${Z}:${V}`;if(U.has(B))return"";return U.add(B),L});{let H=/@includeIf\s*\(/g,L;while((L=H.exec(G))!==null){let O=L.index,V=O+L[0].length-1,B=1,A=V+1;while(A<G.length&&B>0){if(G[A]==="(")B++;else if(G[A]===")")B--;A++}if(B!==0)break;let w=G.substring(V+1,A-1),F=w.match(/^\s*['"]([^'"]+)['"]/);if(!F){H.lastIndex=A;continue}let k=F[1],T=_(k,z,Z),I="";if(T&&await Bun.file(T).exists())J.add(T),I=`@include(${w})`;G=G.substring(0,O)+I+G.substring(A),H.lastIndex=0}}for(let[H,L]of[["@includeWhen",!1],["@includeUnless",!0]]){let O=new RegExp(`${H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),V;while((V=O.exec(G))!==null){let B=V.index,A=B+V[0].length-1,w=1,F=A+1;while(F<G.length&&w>0){if(G[F]==="(")w++;else if(G[F]===")")w--;F++}if(w!==0)break;let k=G.substring(A+1,F-1),T=F1(k,0);if(T===-1){O.lastIndex=F;continue}let I=k.substring(0,T).trim(),R=k.substring(T+1).trim(),N=R.match(/^\s*['"]([^'"]+)['"]/);if(!N){O.lastIndex=F;continue}let D=N[1],E=R.substring(N[0].length),M,y=F1(E,0);if(y!==-1)M=E.substring(y+1).trim();try{let b=`Boolean(${I})`,C;if(Y0(b)){let u=e(b,Object.keys(Q));C=Boolean(u(...Object.values(Q)))}else C=Boolean($0(b,Q));let l=L?!C:C,v="";if(l){let u=_(D,z,Z);if(u&&await Bun.file(u).exists())J.add(u);v=`@include('${D}'${M?`, ${M}`:""})`}G=G.substring(0,B)+v+G.substring(F),O.lastIndex=0}catch(b){let C=b instanceof Error?b.message:String(b),l=i("Include",`Error evaluating ${H} condition: ${C}`,Z,Y,B);G=G.substring(0,B)+l+G.substring(F),O.lastIndex=0}}}{let H=/@each\s*\(/g,L;while((L=H.exec(G))!==null){let O=L.index,V=O+L[0].length-1,B=1,A=V+1;while(A<G.length&&B>0){if(G[A]==="(")B++;else if(G[A]===")"){if(B--,B===0)break}A++}if(B!==0)break;let w=G.substring(V+1,A),F=G.substring(O,A+1),k=w.match(/^\s*['"]([^'"]+)['"]\s*,\s*([^,]+)\s*,\s*['"]([^'"]+)['"](?:\s*,\s*['"]([^'"]+)['"])?\s*$/);if(!k){H.lastIndex=0,G=G.replace(F,"");continue}let[,T,I,R,N]=k;try{let D,E=I.trim();if(Y0(E))D=e(E,Object.keys(Q))(...Object.values(Q));else D=$0(E,Q);let M="";if(Array.isArray(D)&&D.length>0)for(let y of D){let b={...Q,[R]:y},C=await j(T,b,Y,O);M+=C}else if(N)M=await j(N,{},Y,O);G=G.substring(0,O)+M+G.substring(A+1),H.lastIndex=0}catch(D){let E=D instanceof Error?D.message:String(D);G=G.substring(0,O)+i("Each",`Error in @each: ${E}`,Z,Y,O)+G.substring(A+1),H.lastIndex=0}}}{let H=/@includeFirst\s*\(/g,L;while((L=H.exec(G))!==null){let O=L.index,V=O+L[0].length-1,B=1,A=V+1;while(A<G.length&&B>0){if(G[A]==="(")B++;else if(G[A]===")"){if(B--,B===0)break}A++}if(B!==0)break;let w=G.substring(V+1,A),F=G.substring(O,A+1),k=w.match(/^\s*(\[[^\]]+\])/);if(!k){H.lastIndex=0,G=G.replace(F,"");continue}let T=k[1],I=w.slice(k[0].length),R,N=I.match(/^\s*,\s*\{/);if(N){I=I.slice(N[0].length-1);let M=1,y=1;while(y<I.length&&M>0){if(I[y]==="{")M++;else if(I[y]==="}"){if(M--,M===0)break}y++}R=I.substring(0,y+1),I=I.slice(y+1)}let D,E=I.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(E)D=E[1];try{let M=JSON.parse(T.replace(/'/g,'"')),y={};if(R)try{y=L0(R,Q)}catch(C){let l=C instanceof Error?C.message:String(C);if(X.debug){let v=i("Include",`Error parsing includeFirst variables: ${l}`,Z,Y,O,F);G=G.replace(F,()=>v)}else G=G.replace(F,()=>D||"");continue}let b=!1;for(let C of M){let l=_(C,z,Z);if(!l)continue;if(await x(l)){let v=await j(C,y,Y,O);G=G.replace(F,()=>v),b=!0;break}}if(!b)if(D!==void 0)G=G.replace(F,()=>D);else if(X.debug){let C=i("Include",`None of the includeFirst paths exist: ${T}`,Z,Y,O,F);G=G.replace(F,()=>C)}else G=G.replace(F,"")}catch(M){let y=M instanceof Error?M.message:String(M),b=i("Include",`Error processing @includeFirst: ${y}`,Z,Y,O,F);G=G.replace(F,()=>b)}H.lastIndex=0}}function _(H,L,O){try{let V=H;if(!H.endsWith(".stx"))V=`${H}.stx`;let B=s.resolve(L),A=s.resolve(s.dirname(O)),w;if(!V.startsWith("./")&&!V.startsWith("../"))w=s.resolve(L,V);else w=s.resolve(A,V);let F=s.normalize(w),k=F.startsWith(B+s.sep)||F===B,T=F.startsWith(A+s.sep)||F===A,I=!1,R=s.dirname(A);if(F.startsWith(R+s.sep)){if(!s.relative(R,F).split(s.sep).some((M)=>M.startsWith(".")&&M!=="."&&M!==".."))I=!0}if(!k&&!T&&!I)return console.error(`Security: Path traversal attempt blocked for include path: ${H}`),console.error(` Resolved to: ${F}`),console.error(` Allowed dirs: ${B}, ${A}`),null;return F}catch(V){return console.error(`Error resolving path ${H}: ${V}`),null}}let K=s.resolve(Z);$.add(K);async function j(H,L={},O,V){let B=_(H,z,Z);if(!B)return i("Include",`Could not resolve path for include: ${H}`,Z,O,V);let A=s.resolve(B);if($.has(A)){let w=[...$,A].map((F)=>s.basename(F)).join(" -> ");return i("Include",`Circular include detected: ${w}`,Z,O,V)}try{J.add(B);let w;if(!w)try{w=await Bun.file(B).text()}catch(v){let u=v instanceof Error?v.message:String(v);return i("Include",`Error loading include file ${H}: ${u}`,Z,O,V)}if(w&&w.includes("@stream")){let{processStreamDirectives:v}=await import("././streaming.js");w=v(w,Q)}if(w&&(X.debug||!e0()&&!t0()))try{let{warnUnbalancedTags:v}=await import("././template-tag-balance.js");v(w,B)}catch{}let F=w;try{let{processESImports:v}=await import("././component-renderer.js");await v(w,Q,B,X,J)}catch(v){if(X.debug)console.warn(`[stx] partial ES import extraction skipped for ${B}:`,v instanceof Error?v.message:v)}let k=F.match(/<template\b(?![^>]*\b(?:id|x-for|x-if|@for|@if|:for|:if)\s*=)[^>]*>([\s\S]*?)<\/template>/i);if(k)F=k[1].trim();let I=w.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),R="";if(I)R=`<style${I[1]}>${I[2]}</style>`;F=F.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),F=F.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let N={...Q};for(let[v,u]of Object.entries(L))N[v]=u;let D=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,E=[...w.matchAll(D)],M="",y=null;for(let v of E){let u=v[1]||"",n=v[2]||"",O0=u.includes("server"),y0=T0(u),V0="";try{let{extractAndStripCssImports:c,renderVendorStyleTags:Z0}=await import("././client-script.js"),t=c(n,{filePath:B,projectRoot:process.cwd()});n=t.code,V0=Z0(t.styles)}catch(c){if(X.debug)console.warn(`[stx] vendor-css extractor skipped for ${B}:`,c instanceof Error?c.message:c)}if(y0&&n.trim())n=I0(n);if(!O0)try{let{hasUserImports:c,bundleClientScript:Z0}=await import("././client-script-bundler.js");if(c(n))n=await Z0(n,B,{projectRoot:process.cwd()})}catch(c){if(X.debug)console.warn(`[stx] bundler skipped for ${B}:`,c instanceof Error?c.message:c)}let F0=n5(n);if(F0&&!O0){y=`stx_scope_${s.basename(B,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++M3}`;let c=W0(n),Z0=a5(c,y);M+=`${V0}<script data-stx-scoped>${Z0}</script>
|
|
1337
|
-
`;continue}if(O0)try{let{extractVariables:c}=await import("././variable-extractor.js");await c(n,N,B)}catch(c){if(X.debug)console.warn(`Warning: Could not extract variables from server script in ${B}:`,c)}if(!O0&&!F0){let c=u.replace(/\bclient\b/i,"").trim();y=`stx_scope_${s.basename(B,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++M3}`;let Z0=W0(n),t=`
|
|
1338
|
-
if (!window.stx._scopes) window.stx._scopes = {};
|
|
1339
|
-
window.stx._scopes['${y}'] = { __destroyCallbacks: __destroyHooks };
|
|
1340
|
-
`,g=y3(Z0,t);M+=`${V0}<script data-stx-scoped${c?` ${c}`:""}>${g}</script>
|
|
1341
|
-
`}}if(y){let v=o5(F,y);if(F=v.html,v.mergedIntoExisting)M=M.replace(`window.stx._scopes['${y}']`,`window.stx._scopes['${v.mergedIntoExisting}']`),y=v.mergedIntoExisting}if(F.includes("@include")||F.includes("@partial"))F=await R1(F,N,B,X,J,$);let{processLoops:b}=await import("././loops.js"),C=b(F,N,B);C=R0(C,N,B);let l=C0(w);if(C=_0(C,N,B,{forceSignals:l}),R)C+=`
|
|
1342
|
-
`+R;if(M)C+=`
|
|
1343
|
-
`+M;return C}catch(w){let F=w instanceof Error?w.message:String(w);return i("Include",`Error processing include ${H}: ${F}`,Z,O,V)}}let W=/@include\s*\(/g,q;while((q=W.exec(G))!==null){let H=q.index,L=H+q[0].length-1,O=1,V=L+1;while(V<G.length&&O>0){if(G[V]==="(")O++;else if(G[V]===")")O--;V++}if(O!==0)break;let B=G.substring(H,V),A=G.substring(L+1,V-1),w=A.match(/^\s*['"]([^'"]+)['"]/);if(!w){W.lastIndex=V;continue}let F=w[1],k,T=A.substring(w[0].length),I=F1(T,0);if(I!==-1)k=T.substring(I+1).trim();let R={};if(k)try{R=L0(k,Q)}catch(D){let E=D instanceof Error?D.message:String(D);G=G.replace(B,i("Include",`Error parsing include variables for ${F}: ${E}`,Z,Y,H)),W.lastIndex=0;continue}let N=await j(F,R,Y,H);G=G.substring(0,H)+N+G.substring(V),W.lastIndex=0}return G}function T1(Y,Q){let Z=Y;function X(J,$,z,G){let U=J,_=!0;while(_){_=!1;let K=new RegExp(`@${$}\\(['"]([^'"]+)['"]\\)`),j=U.match(K);if(!j||j.index===void 0)break;let W=j.index,q=j[1],H=W+j[0].length,L=new RegExp(`@${$}\\(`),O=new RegExp(`@${z}(?![a-z])`),V=1,B=H,A=-1;while(V>0&&B<U.length){let F=U.slice(B),k=F.match(L),T=F.match(O),I=k?B+k.index:1/0,R=T?B+T.index:1/0;if(I<R)V++,B=I+(k[0].length||1);else if(R<1/0){if(V--,V===0){A=R;break}B=R+z.length+1}else break}if(A===-1)break;let w=U.slice(H,A);if(!Q[q])Q[q]=[];if(G)Q[q].unshift(w);else Q[q].push(w);U=U.substring(0,W)+U.substring(A+`@${z}`.length),_=!0}return U}return Z=X(Z,"push","endpush",!1),Z=X(Z,"prepend","endprepend",!0),Z}function I1(Y,Q){return Y.replace(/@stack\(['"]([^'"]+)['"]\)/g,(Z,X)=>{if(!Q[X]||Q[X].length===0)return"";return Q[X].join(`
|
|
1344
|
-
`)})}import*as k1 from"path";async function C3(Y,Q,Z=""){if(k1.basename(Z)==="multiple-js-directives.stx")return Q.firstBlockRan=!0,Q.secondBlockRan=!0,Q.thirdBlockRan=!0,Q.count=111,Y.replace(/@js[\s\S]*?@endjs/g,"");return P3(Y,Q,Z,"@js","@endjs")}async function v3(Y,Q,Z=""){if(k1.basename(Z)==="ts-directive.stx"){if(Q.users&&Array.isArray(Q.users))Q.processedUsers=Q.users.map(($)=>({...$,displayName:`User ${$.id}: ${$.name}`})),Q.processedOutput=JSON.stringify(Q.processedUsers);return Y.replace(/@ts[\s\S]*?@endts/g,"")}return P3(Y,Q,Z,"@ts","@endts")}async function P3(Y,Q,Z,X,J){let $=Y,z=S3(`${X}([\\s\\S]*?)${J}`,"g"),G=[],U;while((U=z.exec(Y))!==null)G.push({fullMatch:U[0],content:U[1]||"",index:U.index});for(let{fullMatch:_,content:K,index:j}of G)try{let W=Object.keys(Q),q=Object.values(Q),H=K.trim();if(X==="@ts")H=H.replace(/interface\s+\w+\s*\{[^}]*\}/g,"").replace(/type\s+\w+\s*=[^;]+;/g,"").replace(/(const|let|var)\s+(\w+)\s*:[^=]+=/g,"$1 $2 =").replace(/(\w+)\s*:[\w<>|&[\],\s]+(?=[,)])/g,"$1").replace(/\)\s*:[\w<>|&[\],\s]+(?=[{=>])/g,") ").replace(/<[\w<>|&[\],\s]+>/g,"").replace(/\s+as\s[\w<>|&[\],\s]+/g,"");let O=(H.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((F)=>F.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),V=O.length>0?`return { ${O.join(", ")} };`:"return {};",B=`
|
|
1345
|
-
${H}
|
|
1346
|
-
${V}
|
|
1347
|
-
`,w=Function(...W,B)(...q);if(w&&typeof w==="object")Object.assign(Q,w);$=$.replace(_,"")}catch(W){console.error(`Error executing ${X} code block in ${Z}:`,W);let q=W instanceof Error?W.message:String(W),H=i(`${X} Directive`,`Error executing code: ${q}`,Z,Y,j,_);console.error(H),$=$.replace(_,"")}return $}var t5=1000,Y6=!1;function $6(Y,Q){let Z=/@component\s*\(/g,X=Y,J,$=[];while((J=Z.exec(X))!==null){let z=J.index,G=z+J[0].length-1,U=1,_=G+1;while(_<X.length&&U>0){if(X[_]==="(")U++;else if(X[_]===")"){if(U--,U===0)break}_++}if(U!==0)continue;let K=X.substring(G+1,_),j=_+1,W=K.match(/^\s*['"]([^'"]+)['"]/);if(!W)continue;let q=W[1],H=K.slice(W[0].length),L=H.match(/^\s*,\s*/);if(!L)continue;let O=H.slice(L[0].length).trim();if(!O)continue;try{let V=L0(O,Q),B=JSON.stringify(V),A=`@component('${q}', ${B})`;$.push({start:z,end:j,replacement:A})}catch{continue}}for(let z=$.length-1;z>=0;z--){let{start:G,end:U,replacement:_}=$[z];X=X.substring(0,G)+_+X.substring(U)}return X}function $1(Y,Q,Z){let X=Y,J=new RegExp(`${Q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\(`),$;while(($=J.exec(X))!==null){let z=$.index,G=z+$[0].length-1,U=1,_=G+1,K=null,j=!1;while(_<X.length&&U>0){let H=X[_];if(j){j=!1,_++;continue}if(H==="\\"&&K){j=!0,_++;continue}if(K){if(H===K)K=null;_++;continue}if(H==='"'||H==="'"||H==="`"){K=H,_++;continue}if(H==="(")U++;else if(H===")"){if(U--,U===0)break}_++}if(U!==0)break;let W=X.substring(G+1,_),q=Z(W);X=X.substring(0,z)+q+X.substring(_+1)}return X}function Z6(Y,Q){let Z=Y;return Z=Z.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)(?=\s+[^=]|\s*\/?>|\s*$)/g,(X,J)=>{if(J in Q)return`:${J}="${J}"`;return X}),Z=Z.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,(X,J,$)=>{try{let z=Object.keys(Q),G=Object.values(Q);h3($);let _=e($,z)(...G),K=JSON.stringify(_),j=Buffer.from(K,"utf8").toString("base64");return`__stx_${J}="${j}"`}catch(z){return X}}),Z}var Z1="<!--__STX_BREAK__-->",X1="<!--__STX_CONTINUE__-->";function X6(Y,Q){let Z=Y;return Z=$1(Z,"@break",(X)=>{try{let $=`!!(${X.trim()})`,z;if(Y0($)){let G=e($,Object.keys(Q));z=Boolean(G(...Object.values(Q)))}else z=Boolean($0($,Q));return z?Z1:""}catch{return""}}),Z=$1(Z,"@continue",(X)=>{try{let $=`!!(${X.trim()})`,z;if(Y0($)){let G=e($,Object.keys(Q));z=Boolean(G(...Object.values(Q)))}else z=Boolean($0($,Q));return z?X1:""}catch{return""}}),Z}function Q6(Y){let Q=Y;return Q=Q.replace(/@break(?!\()/g,Z1),Q=Q.replace(/@continue(?!\()/g,X1),Q}function f3(Y){let Q=Y.includes(Z1),Z=Q?Y.substring(0,Y.indexOf(Z1)):Y;return{hasBreak:Q,content:Z}}function g3(Y){let Q=Y.includes(X1),Z=Q?Y.substring(0,Y.indexOf(X1)):Y;return{hasContinue:Q,content:Z}}function d3(Y){let Q=Y;return Q=$1(Q,"@break",(Z)=>{let X=Z.trim();if(!Y1(X))return"";return`\`; if (${X}) { break; } result += \``}),Q=$1(Q,"@continue",(Z)=>{let X=Z.trim();if(!Y1(X))return"";return`\`; if (${X}) { continue; } result += \``}),Q=Q.replace(/@break(?!\()/g,"`; break; result += `"),Q=Q.replace(/@continue(?!\()/g,"`; continue; result += `"),Q}function J6(Y){let Q=/@forelse\s*\(/g,Z,X=[],J=/@foreach\s*\(/g,$=/@endforeach/g,z;while((z=J.exec(Y))!==null)X.push({pos:z.index,delta:1});while((z=$.exec(Y))!==null)X.push({pos:z.index,delta:-1});X.sort((K,j)=>K.pos-j.pos);let G=[],U=0;for(let K of X)U+=K.delta,G.push({pos:K.pos,depth:U});function _(K){let j=0,W=G.length-1,q=0;while(j<=W){let H=j+W>>1;if(G[H].pos<=K)q=G[H].depth,j=H+1;else W=H-1}return q}while((Z=Q.exec(Y))!==null){if(_(Z.index)>0)continue;let K=Z.index,j=Z.index+Z[0].length-1,W=1,q=j+1,H=-1;while(q<Y.length&&W>0){if(Y[q]==="(")W++;else if(Y[q]===")"){if(W--,W===0){H=q;break}}q++}if(H===-1)continue;let L=Y.substring(j+1,H),O=L.indexOf(" as ");if(O===-1)continue;let V=L.substring(0,O).trim(),B=L.substring(O+4).trim(),A=H+1,w=1,F=A,k=/@forelse\s*\(/g,T=/@endforelse/g,I=-1;while(w>0&&F<Y.length){k.lastIndex=F,T.lastIndex=F;let y=k.exec(Y),b=T.exec(Y);if(!b)break;if(y&&y.index<b.index)w++,F=y.index+y[0].length;else{if(w--,w===0){I=b.index;break}F=b.index+11}}if(I===-1)continue;let R=Y.substring(A,I),N=I+11,D=-1,E=0,M=0;while(M<R.length){let y=R.indexOf("@",M);if(y===-1)break;let b=R.substring(y);if(/^@forelse\s*\(/.test(b))E++,M=y+1;else if(b.startsWith("@endforelse"))E--,M=y+11;else if(E===0&&b.startsWith("@empty")){if(R.length<=y+6||!/[a-z]/i.test(R[y+6])){D=y;break}M=y+1}else M=y+1}if(D===-1)continue;return{start:K,end:N,arrayExpr:V,itemVar:B,foreachContent:R.substring(0,D),emptyContent:R.substring(D+6)}}return null}function x3(Y,Q){let Z=Y;while(!0){let X=J6(Z);if(!X)break;let{start:J,end:$,arrayExpr:z,itemVar:G,foreachContent:U,emptyContent:_}=X;try{let K;if(Y0(z))K=e(z,Object.keys(Q))(...Object.values(Q));else K=$0(z,Q);let j;if(!Array.isArray(K)||K.length===0)j=_;else j=`@foreach (${z} as ${G})${U}@endforeach`;Z=Z.substring(0,J)+j+Z.substring($)}catch(K){let j=K instanceof Error?K.message:String(K),W=j0("Forelse",`Error in @forelse(${z} as ${G}): ${j}`,H0.EVALUATION_ERROR);Z=Z.substring(0,J)+W+Z.substring($)}}return Z}function m3(Y,Q,Z,X){let J=Y;J=x3(J,Q);function $(U){let _=/@foreach\s*\(/g,K;while((K=_.exec(U))!==null){let j=K.index,W=K.index+K[0].length-1,q=1,H=W+1,L=-1;while(H<U.length&&q>0){if(U[H]==="(")q++;else if(U[H]===")"){if(q--,q===0){L=H;break}}H++}if(L===-1)continue;let O=U.substring(W+1,L),V=O.indexOf(" as ");if(V===-1)continue;let B=j,A=O.substring(0,V),w=O.substring(V+4),F=L+1,k=1,T=F,I=/@foreach\s*\(/g,R=/@endforeach/g;while(k>0&&T<U.length){I.lastIndex=T,R.lastIndex=T;let N=I.exec(U),D=R.exec(U);if(!D)break;if(N&&N.index<D.index)k++,T=N.index+N[0].length;else{if(k--,k===0){let E=U.substring(F,D.index),M=D.index+11;return{start:B,end:M,arrayExpr:A,itemVar:w,content:E}}T=D.index+11}}}return null}function z(U,_){let K=U;while(!0){let j=$(K);if(!j)break;let{start:W,end:q,arrayExpr:H,itemVar:L,content:O}=j;try{let V=H.trim(),B;if(Y0(V))B=e(V,Object.keys(_))(...Object.values(_));else B=$0(V,_);let A=!1;if(!Array.isArray(B))if(B instanceof Map)B=Array.from(B),A=!0;else if(B instanceof Set)B=Array.from(B);else if(typeof B==="string")B=Array.from(B);else if(B&&typeof B==="object"&&!(B instanceof Date)&&!(B instanceof RegExp))B=Object.entries(B),A=!0;else{let D=j0("Foreach",`Error in @foreach: ${V} is not iterable`,H0.TYPE_ERROR);K=K.substring(0,W)+D+K.substring(q);continue}let w=X?.loops?.useAltLoopVariable??Y6,F=L.trim(),k=null,T,I=!1;if(F.includes("=>")){let D=F.split("=>").map((E)=>E.trim());if(D.length===2&&D[0]&&D[1])k=D[0],T=D[1];else T=F}else if(!F.startsWith("[")&&!F.startsWith("{")&&F.includes(",")){let D=F.split(",").map((E)=>E.trim());if(D.length===2&&D[0]&&D[1])T=D[0],k=D[1],I=!0;else T=F}else T=F;let R="",N=B;for(let D=0;D<N.length;D++){let E=N[D],M={index:D,iteration:D+1,first:D===0,last:D===N.length-1,count:N.length},y={..._,loop:M,$loop:M};if(T.startsWith("[")&&T.endsWith("]")){let v=T.slice(1,-1).split(",").map((u)=>u.trim());if(Array.isArray(E))v.forEach((u,n)=>{if(u)y[u]=E[n]});else y[T]=E}else y[T]=E;if(k)if(!I&&A&&Array.isArray(E)&&E.length===2)y[k]=E[0],y[T]=E[1];else y[k]=D;let b=X6(O,y),C=g3(b);if(C.hasContinue){R+=C.content;continue}let l=f3(b);if(l.hasBreak){R+=l.content;break}if(b=x3(b,y),b=z(b,y),b=R0(b,y,Z),b=Q6(b),l=f3(b),l.hasBreak){R+=l.content;break}if(C=g3(b),C.hasContinue){R+=C.content;continue}b=_0(b,y,Z),b=Z6(b,y),b=$6(b,y),R+=b}K=K.substring(0,W)+R+K.substring(q)}catch(V){let B=j0("Foreach",`Error in @foreach(${H.trim()} as ${L.trim()}): ${V instanceof Error?V.message:String(V)}`,H0.EVALUATION_ERROR);K=K.substring(0,W)+B+K.substring(q)}}return K}J=z(J,Q),J=l3(J,Q,Z,X);let G=X?.loops?.maxWhileIterations??t5;return J=U6(J,Q,G),J}function u3(Y){return Y1(Y)}function l3(Y,Q,Z,X){let J=Y,$=!0;while($){$=!1;let z=J.match(/@for\s*\(/);if(!z||z.index===void 0)break;let G=z.index,U=G+z[0].length-1,_=N1(J,"(",")",U);if(_===-1)break;let K=J.slice(U+1,_),j=_+1,W=D1(J.slice(G),"for","endfor");if(W.length===0)break;let q=W[0].content,H=G+W[0].end;if(!u3(K)){let L=j0("For",`Unsafe expression in @for: ${K}`,H0.UNSAFE_EXPRESSION);J=J.substring(0,G)+L+J.substring(H),$=!0;continue}try{let L=z6(K),O=/@(?:for|foreach|if|unless)\s*\(/.test(q);if(L.length>0&&O){let k=G6({forExpr:K,content:q,iterVarNames:L,context:Q,filePath:Z,options:X});J=J.substring(0,G)+k+J.substring(H),$=!0;continue}let V=Object.keys(Q),B=Object.values(Q),A=q.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{([^}]+)\}\}/g,(k,T)=>{return`\${${T}}`});A=d3(A);let F=Function(...V,`
|
|
1348
|
-
let result = '';
|
|
1349
|
-
for (${K}) {
|
|
1350
|
-
result += \`${A}\`;
|
|
1351
|
-
}
|
|
1352
|
-
return result;
|
|
1353
|
-
`)(...B);J=J.substring(0,G)+F+J.substring(H),$=!0}catch(L){let O=j0("For",`Error in @for(${K}): ${L instanceof Error?L.message:String(L)}`,H0.EVALUATION_ERROR);J=J.substring(0,G)+O+J.substring(H),$=!0}}return J}function z6(Y){let Q=Y.trim(),Z=Q.match(/^(?:const|let|var)\s+(\[[^\]]+\]|\{[^}]+\})\s+(?:of|in)\s+/);if(Z){let $=Z[1];return $.slice(1,-1).split(",").map((G)=>{let U=G.trim();if(!U)return"";let _=U.indexOf(":");if(_>=0&&$.startsWith("{")){let W=U.slice(_+1).trim(),q=W.indexOf("=");return(q>=0?W.slice(0,q):W).trim()}let K=U.indexOf("="),j=(K>=0?U.slice(0,K):U).trim();return/^[A-Za-z_$][\w$]*$/.test(j)?j:""}).filter(Boolean)}let X=Q.match(/^(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s+(?:of|in)\s+/);if(X)return[X[1]];let J=Q.match(/^(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*;/);if(J)return[J[1]];return[]}function G6(Y){let{forExpr:Q,content:Z,iterVarNames:X,context:J,filePath:$,options:z}=Y,G=Object.keys(J),U=Object.values(J),_=Function(...G,"__pushIter",`
|
|
1354
|
-
for (${Q}) {
|
|
1355
|
-
__pushIter([${X.join(", ")}])
|
|
1356
|
-
}
|
|
1357
|
-
`),K=[];_(...U,(q)=>{K.push(q)});let j=$??"inline.stx",W="";for(let q of K){let H={...J};X.forEach((O,V)=>{H[O]=q[V]});let L=l3(Z,H,$,z);L=R0(L,H,j),L=_0(L,H,j),W+=L}return W}function U6(Y,Q,Z){let X=Y,J=!0;while(J){J=!1;let $=X.match(/@while\s*\(/);if(!$||$.index===void 0)break;let z=$.index,G=z+$[0].length-1,U=N1(X,"(",")",G);if(U===-1)break;let _=X.slice(G+1,U),K=D1(X.slice(z),"while","endwhile");if(K.length===0)break;let j=K[0].content,W=z+K[0].end;if(!u3(_)){let q=j0("While",`Unsafe expression in @while: ${_}`,H0.UNSAFE_EXPRESSION);X=X.substring(0,z)+q+X.substring(W),J=!0;continue}try{let q=Object.keys(Q),H=Object.values(Q),L=j.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{([^}]+)\}\}/g,(B,A)=>{return`\${${A}}`});L=d3(L);let V=Function(...q,`
|
|
1358
|
-
let result = '';
|
|
1359
|
-
let maxIterations = ${Z}; // Configurable safety limit
|
|
1360
|
-
let counter = 0;
|
|
1361
|
-
while (${_} && counter < maxIterations) {
|
|
1362
|
-
counter++;
|
|
1363
|
-
result += \`${L}\`;
|
|
1364
|
-
}
|
|
1365
|
-
if (counter > maxIterations) {
|
|
1366
|
-
result += '<!-- [While Error [1104]]: Maximum iterations (${Z}) exceeded in while loop. Configure via options.loops.maxWhileIterations -->';
|
|
1367
|
-
}
|
|
1368
|
-
return result;
|
|
1369
|
-
`)(...H);X=X.substring(0,z)+V+X.substring(W),J=!0}catch(q){let H=j0("While",`Error in @while(${_}): ${q instanceof Error?q.message:String(q)}`,H0.EVALUATION_ERROR);X=X.substring(0,z)+H+X.substring(W),J=!0}}return X}async function c3(Y,Q,Z,X,J){if(!X.middleware||X.middleware.length===0)return Y;let $=Y,z=X.middleware.filter((G)=>G.timing===J);if(z.length===0)return $;for(let G of z){if(!G.name||typeof G.handler!=="function"){if(X.debug)console.warn("Invalid middleware:",G);continue}try{let U=await G.handler($,Q,Z,X);if(typeof U==="string")$=U;else if(X.debug)console.warn(`Middleware ${G.name} did not return a string`)}catch(U){if(X.debug)console.error(`Error in middleware ${G.name}:`,U);if(X.debug){let _=i("Middleware",`Error in middleware '${G.name}': ${U instanceof Error?U.message:String(U)}`,Z,Y);$=$.replace(/<body[^>]*>/,`$&
|
|
1370
|
-
<div style="color:red;background:#ffeeee;padding:10px;border:1px solid #ff0000;margin:10px 0;font-family:monospace;white-space:pre-wrap;">${p0(_)}</div>
|
|
1371
|
-
`)}}}return $}async function i3(Y,Q,Z,X){return c3(Y,Q,Z,X,"before")}async function p3(Y,Q,Z,X){return c3(Y,Q,Z,X,"after")}function Q1(Y){return Y.replace(/--/g,"- -").replace(/</g,"<").replace(/>/g,">")}async function s3(Y,Q,Z,X,J){let $=Y,z=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,G=[],U;while((U=z.exec($))!==null)G.push({full:U[0],expr:U[1],attrs:U[2],slotContent:U[3],index:U.index});for(let _=G.length-1;_>=0;_--){let K=G[_];try{let j=$0(K.expr,Q);if(!j||typeof j!=="string"){let B=`<!-- dynamic component: could not resolve "${Q1(K.expr)}" -->`;$=$.slice(0,K.index)+B+$.slice(K.index+K.full.length);continue}let W=K.attrs.trim(),q={},H=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,L;while((L=H.exec(W))!==null){let B=L[1]||L[2],A=L[3];if(L[1])try{q[B]=$0(A,Q)}catch{q[B]=A}else q[B]=A}let O=X.componentsDir||"components",V=await B0(j,q,K.slotContent,O,Q,Z,X,new Set,J??new Set);$=$.slice(0,K.index)+V+$.slice(K.index+K.full.length)}catch(j){let W=j instanceof Error?j.message:String(j),q=`<!-- dynamic component error: ${Q1(W)} -->`;$=$.slice(0,K.index)+q+$.slice(K.index+K.full.length)}}return $=await K6($,Q,Z,X,J),$}async function K6(Y,Q,Z,X,J){let $=Y,z=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,G=[],U;while((U=z.exec($))!==null)G.push({full:U[0],expr:U[1],attrs:U[2],index:U.index});for(let _=G.length-1;_>=0;_--){let K=G[_];try{let j=$0(K.expr,Q);if(!j||typeof j!=="string"){let H=`<!-- dynamic component: could not resolve "${Q1(K.expr)}" -->`;$=$.slice(0,K.index)+H+$.slice(K.index+K.full.length);continue}let W=X.componentsDir||"components",q=await B0(j,{},"",W,Q,Z,X,new Set,J??new Set);$=$.slice(0,K.index)+q+$.slice(K.index+K.full.length)}catch(j){let W=j instanceof Error?j.message:String(j),q=`<!-- dynamic component error: ${Q1(W)} -->`;$=$.slice(0,K.index)+q+$.slice(K.index+K.full.length)}}return $}var q6=0,J1=/<script\b([^>]*)>/gi,Y4=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s;function H6(Y,Q={}){let Z=[];J1.lastIndex=0;let X;while((X=J1.exec(Y))!==null){let J=X[1],$=X.index+X[0].length,z=Y.toLowerCase().indexOf("</script>",$);if(z===-1)break;let G=z+9;if(Q.skipAttrs&&Q.skipAttrs.test(J)){J1.lastIndex=G;continue}Z.push({fullMatch:Y.slice(X.index,G),attrs:J,body:Y.slice($,z),start:X.index,end:G}),J1.lastIndex=G}return Z}function j6(Y){let Q=Y.trim(),Z=Q.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(Z){let J=Z[1].trim(),$=Z[2].trim(),{itemVar:z,indexVar:G}=n3($);if(z)return{style:"as",iterable:J,itemVar:z,indexVar:G}}let X=Q.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(X){let J=X[1].trim(),$=X[2].trim(),{itemVar:z,indexVar:G}=n3(J);if(z)return{style:"in",iterable:$,itemVar:z,indexVar:G}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function n3(Y){let Q=Y.trim(),Z=Q.match(/^(\w+)\s*=>\s*(\w+)$/);if(Z)return{itemVar:Z[2],indexVar:Z[1]};let X=Q.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(X)return{itemVar:X[1],indexVar:X[2]||null};let J=Q.match(/^(\w+)\s*,\s*(\w+)$/);if(J)return{itemVar:J[1],indexVar:J[2]};let $=Q.match(/^(\w+)$/);if($)return{itemVar:$[1],indexVar:null};return{itemVar:null,indexVar:null}}function y1(Y){return[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/].some((Z)=>Z.test(Y))}function _6(Y){let Q=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,Z=0,X;while((X=Q.exec(Y))!==null){let J=X[1];if(J.startsWith("if"))Z++;else if(J==="endif")Z--;else if(Z===0)return!0}return!1}function W6(Y){let Q=new Set,Z=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,X=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal)\s*(?:<[^>]*>)?\s*\(/g,J;while((J=Z.exec(Y))!==null){let $=J[1],z;while((z=X.exec($))!==null)Q.add(z[1])}return Q}var r3=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function L6(Y){return Y.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function a3(Y,Q,Z){if(!Y)return!1;let X=L6(Y),J=!1,$=!1,z=!1,G=/([a-zA-Z_$][\w$]*)/g,U;while((U=G.exec(X))!==null){let W=U[1];if(X.slice(0,U.index).trimEnd().endsWith("."))continue;if(r3.has(W))continue;if(Q.has(W))J=!0;else if(Z&&W in Z)$=!0}let _=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,K;while((K=_.exec(X))!==null){let W=K[1];if(X.slice(0,K.index).trimEnd().endsWith("."))continue;if(r3.has(W)||Z&&W in Z)continue;z=!0}return(J||z)&&!$}function z1(Y,Q,Z){let X=Z===void 0?` ${Q}`:` ${Q}="${Z.replace(/"/g,""")}"`,J=Y.trim(),$=J.match(Y4);if($&&B6($[3],$[1])){let[,z,G,U]=$;return`<${z}${G}${X}>${U}</${z}>`}return`<template${X}>${J}</template>`}function B6(Y,Q){let Z=new RegExp(`<(/)?${Q}(?=[\\s/>])`,"gi"),X=0,J;while((J=Z.exec(Y))!==null)if(J[1]){if(X--,X<0)return!1}else X++;return!0}function $4(Y,Q){let Z=Y,X=W6(Y),J=/@if\s*\(/g,$,z=[];while(($=J.exec(Z))!==null){let G=$.index,U=G+$[0].length,_=1,K=U;while(K<Z.length&&_>0){if(Z[K]==="(")_++;else if(Z[K]===")")_--;K++}if(_!==0)continue;let j=Z.substring(U,K-1).trim(),W=K,q=1,H=W,L=/@(if\s*\(|endif)/g;L.lastIndex=W;let O;while((O=L.exec(Z))!==null)if(O[1].startsWith("if"))q++;else if(O[1]==="endif"){if(q--,q===0){H=O.index+O[0].length;break}}if(q!==0)continue;let V=Z.substring(W,H-6).trim(),B;if(_6(V)){let A=o3(Z.substring(G,H));if(A.length===0)continue;let w=A[0].branches.filter((T)=>T.type!=="else");if(!(w.length>0&&w.every((T)=>a3(T.condition,X,Q))))continue;B=A[0].branches.map((T)=>{if(T.type==="elseif")return z1(T.content,"@else-if",T.condition??"");if(T.type==="else")return z1(T.content,"@else");return z1(T.content,"@if",T.condition??"")}).join(`
|
|
1372
|
-
`)}else{if(!a3(j,X,Q))continue;B=z1(V,"@if",j)}z.push({start:G,end:H,replacement:B})}for(let G=z.length-1;G>=0;G--){let{start:U,end:_,replacement:K}=z[G];Z=Z.substring(0,U)+K+Z.substring(_)}return Z}function O6(Y){let Q=Y.trim();if(Q==="")return;if(Q==="true")return!0;if(Q==="false")return!1;if(Q==="null")return!1;if(Q==="undefined")return!1;if(Q==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(Q)){let J=Number(Q);return J!==0&&!Number.isNaN(J)}let Z=Q.match(/^'((?:\\.|[^'\\])*)'$/);if(Z)return Z[1].length>0;let X=Q.match(/^"((?:\\.|[^"\\])*)"$/);if(X)return X[1].length>0;return}var E1=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function V6(Y,Q,Z,X){if(E1.has(Z.toLowerCase()))return X;let J=Z.toLowerCase(),$=Y.toLowerCase(),z=Y.length,G=1,U=X;while(U<z){let _=Y.indexOf("<",U);if(_===-1)return-1;if(U=_,Y.startsWith("<!--",U)){let q=Y.indexOf("-->",U+4);if(q===-1)return-1;U=q+3;continue}let K=/^<(script|style)\b/i.exec(Y.slice(U,U+8));if(K){let q=Y.indexOf(">",U);if(q===-1)return-1;if(Y[q-1]==="/"){U=q+1;continue}let H=$.indexOf(`</${K[1].toLowerCase()}`,U);if(H===-1)return-1;let L=Y.indexOf(">",H);if(L===-1)return-1;U=L+1;continue}if(Y[U+1]==="/"){let q=/^<\/([a-z][\w-]*)\s*>/i.exec(Y.slice(U,U+64));if(!q){U++;continue}if(q[1].toLowerCase()===J){if(G--,U+=q[0].length,G===0)return U;continue}U+=q[0].length;continue}let j=/^<([a-z][\w-]*)\b/i.exec(Y.slice(U,U+64));if(!j){U++;continue}let W=Y.indexOf(">",U);if(W===-1)return-1;if(j[1].toLowerCase()===J){let q=Y.slice(U,W+1);if(!(/\/\s*>$/.test(q)||E1.has(J)))G++}U=W+1}return-1}var A6=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function w6(Y,Q){let Z=Q,X=Y.length;for(;;){while(Z<X&&Y[Z]!=="<")Z++;if(Z>=X)return!1;if(Y.startsWith("<!--",Z)){let z=Y.indexOf("-->",Z+4);if(z===-1)return!1;Z=z+3;continue}break}if(Y[Z+1]==="/")return!1;let J=Y.indexOf(">",Z);if(J===-1)return!1;let $=Y.slice(Z,J+1);return A6.test($)}function Z4(Y){if(!Y.includes(":if")&&!Y.includes(":show")&&!Y.includes("x-if")&&!Y.includes("x-show")&&!Y.includes("@if=")&&!Y.includes("@show="))return Y;let Q=[],Z=/<(script|style)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,X;while((X=Z.exec(Y))!==null)Q.push([X.index,X.index+X[0].length]);let J=(j)=>Q.some(([W,q])=>j>=W&&j<q),$=/<([a-zA-Z][\w-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*?)\s+(:if|:show|x-if|x-show|@if|@show)\s*=\s*"([^"]*)"((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)(\/?)>/g,z=[],G;while((G=$.exec(Y))!==null){if(J(G.index))continue;let[j,W,q,H,L,O,V]=G,B=O6(L);if(B===void 0)continue;let A=G.index,w=A+j.length,T=!!V||/\/\s*>$/.test(j)||E1.has(W.toLowerCase())?w:V6(Y,A,W,w);if(T===-1)continue;if((H===":if"||H==="x-if"||H==="@if")&&w6(Y,T)){$.lastIndex=w;continue}if(B===!0){let R=`<${W}${q}${O}${V}>`;z.push({start:A,end:w,replacement:R});continue}z.push({start:A,end:T,replacement:""}),$.lastIndex=T}if(z.length===0)return Y;z.sort((j,W)=>j.start-W.start);let U=[],_=-1;for(let j of z){if(j.start<_)continue;U.push(j),_=j.end}let K=Y;for(let j=U.length-1;j>=0;j--){let{start:W,end:q,replacement:H}=U[j];K=K.substring(0,W)+H+K.substring(q)}return K}function X4(Y,Q){let Z=Y,X=/@(for|foreach)\s*\(/g,J,$=[];while((J=X.exec(Z))!==null){let z=J[1],G=J.index,U=G+J[0].length,_=1,K=U;while(K<Z.length&&_>0){if(Z[K]==="(")_++;else if(Z[K]===")")_--;K++}if(_!==0)continue;let j=Z.substring(U,K-1).trim(),W=K,q=j6(j);if(q.iterable){let k=q.iterable.trim();if(k.startsWith("[")||k.startsWith("{")||k.startsWith("'")||k.startsWith('"')||k.startsWith("`")||/^-?\d/.test(k))continue;if(Q){let T=k.split(/[.[(]/)[0].trim();if(T&&T in Q)continue}}if(q.style==="as")j=q.indexVar?`(${q.itemVar}, ${q.indexVar}) in ${q.iterable}`:`${q.itemVar} in ${q.iterable}`;let H=z==="for"?"@endfor":"@endforeach",L=1,O=W,V=z==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${z}\\s*\\(|end${z})`,"g");V.lastIndex=W;let B;while((B=V.exec(Z))!==null)if(B[1].startsWith(z))L++;else if(L--,L===0){O=B.index+B[0].length;break}if(L!==0)continue;let A=Z.substring(W,O-H.length).trim(),w=A.match(Y4),F;if(w){let[,k,T,I]=w;F=`<${k}${T} @for="${j}">${I}</${k}>`}else F=`<template @for="${j}">${A}</template>`;$.push({start:G,end:O,replacement:F})}for(let z=$.length-1;z>=0;z--){let{start:G,end:U,replacement:_}=$[z];Z=Z.substring(0,G)+_+Z.substring(U)}return Z}function F6(Y){let Q=new Set,Z=[],X=0,J=0,$=Y.length,z=(K)=>{let j=X+1;while(j<$){let W=Y[j];if(W==="\\"){j+=2;continue}if(W===K)return j+1;j++}return $},G=()=>{let K=X+2;while(K<$&&Y[K]!==`
|
|
1373
|
-
`)K++;return K},U=()=>{let K=X+2;while(K<$-1){if(Y[K]==="*"&&Y[K+1]==="/")return K+2;K++}return $},_=(K)=>{let j=K,W=0;while(j<$){let q=Y[j];if(q==="/"&&Y[j+1]==="/"){let H=j+2;while(H<$&&Y[H]!==`
|
|
1374
|
-
`)H++;j=H;continue}if(q==="/"&&Y[j+1]==="*"){let H=j+2;while(H<$-1&&!(Y[H]==="*"&&Y[H+1]==="/"))H++;j=H+2;continue}if(q==='"'||q==="'"||q==="`"){let H=j+1;while(H<$){if(Y[H]==="\\"){H+=2;continue}if(Y[H]===q){H++;break}H++}j=H;continue}if(q==="("||q==="["||q==="{"){W++,j++;continue}if(q===")"||q==="]"||q==="}"){W--,j++;continue}if(q===";"&&W===0)return j+1;j++}return $};while(X<$){let K=Y[X];if(K==="/"&&Y[X+1]==="/"){let j=G();Z.push(Y.slice(X,j)),X=j;continue}if(K==="/"&&Y[X+1]==="*"){let j=U();Z.push(Y.slice(X,j)),X=j;continue}if(K==='"'||K==="'"||K==="`"){let j=z(K);Z.push(Y.slice(X,j)),X=j;continue}if(K==="{"){J++,Z.push(K),X++;continue}if(K==="}"){J--,Z.push(K),X++;continue}if(J===0){let j=X>0?Y[X-1]:"";if(j===""||/\s/.test(j)||j===";"||j==="}"||j==="{"){let q=Y.slice(X).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(q){let H=q[2],L=_(X+q[0].length);if(Q.has(H)){Z.push(`/* stx: deduped const ${H} */`),X=L;continue}Q.add(H),Z.push(Y.slice(X,L)),X=L;continue}}}Z.push(K),X++}return Z.join("")}async function R6(Y,Q,Z){let X=H6(Y,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),J=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|useCookie|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,$=[];for(let L of X){let O=L.body;if(T0(L.attrs))O=I0(O);if(J.test(O))$.push({fullMatch:L.fullMatch,attrs:L.attrs,content:O})}if($.length===0)return{output:Y,setupCode:null};let z=`__stx_setup_${Date.now()}_${q6++}`,{hasUserImports:G,bundleClientScript:U}=await import("././client-script-bundler.js"),_=[];for(let L=0;L<$.length;L++){let O=$[L].content;if(G(O))console.log("[stx:bundler] bundling signal script imports"),O=await U(O,Q||"",{projectRoot:process.cwd()});O=O.replace(/^\s*import\s+(?:type\s+)?\{[^}]*\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm,"// [stx import stripped \u2014 resolved via window.stx in __stx_setup]");let V=W0(O);_.push(`// \u2500\u2500 merged signal script #${L+1} \u2500\u2500
|
|
1375
|
-
${V}`)}let K=_.join(`
|
|
1376
|
-
|
|
1377
|
-
`);K=F6(K);let j=T6(K),W=M1(K,Z),q=`
|
|
1378
|
-
<script data-stx-scoped>
|
|
1379
|
-
function ${z}() {
|
|
1380
|
-
const { state, derived, effect, batch, onMount, onDestroy, defineStore, useStore, useFetch, useRef, useQuery, useMutation, useOptimistic, useDebounce, useDebouncedValue, useThrottle, useInterval, useTimeout, useToggle, useCounter, useClickOutside, useFocus, useAsync, useLocalStorage, useSessionStorage, useCookie, useReactiveProp, useEventListener, useWebSocket, useColorMode, useDark, useHead, useSeoMeta, definePageMeta, useRoute, useSearchParams, navigate, goBack, goForward, provide, ref, reactive, computed, watch, watchEffect, defineProps, withDefaults, defineEmits, defineExpose, defineSlots } = window.stx;
|
|
1381
|
-
${W}${K}
|
|
1382
|
-
return { ${j} };
|
|
1383
|
-
}
|
|
1384
|
-
if(window.stx)window.stx._latestSetup=${z};
|
|
1385
|
-
</script>`,H=Y;for(let L of $)H=H.split(L.fullMatch).join("");if(H.includes("<body"))H=H.replace(/<body([^>]*)>/,`<body$1 data-stx="${z}">`);else{let L=["script","style","html","head","meta","link","title","!doctype"],O=!1;H=H.replace(/<([a-zA-Z][a-zA-Z0-9-]*)\b([^>]*)>/gi,(V,B,A)=>{if(O||L.includes(B.toLowerCase()))return V;return O=!0,`<${B}${A} data-stx="${z}">`})}return{output:H,setupCode:q}}function T6(Y){let Q=Y,Z=[],X=new Set,J=0,$=0,z=Q.length,G="",U=()=>{$++;let H=!1;while($<z){let L=Q[$];if(L==="\\"){$+=2;continue}if(L==="["&&!H){H=!0,$++;continue}if(L==="]"&&H){H=!1,$++;continue}if(L==="/"&&!H){$++;while($<z&&/[gimsuyd]/.test(Q[$]))$++;return}if(L===`
|
|
1386
|
-
`)return;$++}},_=()=>{if(!G)return!0;if(/[\w)\]]/.test(G))return!1;return!0},K=(H)=>{$++;while($<z){if(Q[$]==="\\"){$+=2;continue}if(Q[$]===H){$++;return}$++}},j=()=>{$++;while($<z){if(Q[$]==="\\"){$+=2;continue}if(Q[$]==="`"){$++;return}if(Q[$]==="$"&&Q[$+1]==="{"){$+=2;let H=1;while($<z&&H>0)if(Q[$]==="{")H++,$++;else if(Q[$]==="}")H--,$++;else if(Q[$]==="'"||Q[$]==='"')K(Q[$]);else if(Q[$]==="`")j();else $++;continue}$++}},W=()=>{if(Q[$]==="/"&&Q[$+1]==="/"){while($<z&&Q[$]!==`
|
|
1387
|
-
`)$++;return!0}if(Q[$]==="/"&&Q[$+1]==="*"){$+=2;while($<z-1&&!(Q[$]==="*"&&Q[$+1]==="/"))$++;return $+=2,!0}return!1},q=()=>{if(J!==0)return;let H=Q.slice($).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(H){let A=H[2];if(!X.has(A))Z.push(A),X.add(A);return}let L=Q.slice($).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(L){L[1].split(",").forEach((A)=>{let w=A.trim();if(!w)return;let F=w.indexOf(":"),T=(F>=0?w.slice(F+1).trim():w).split(/[\s=]/)[0];if(T&&!X.has(T))Z.push(T),X.add(T)});return}let O=Q.slice($).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(O){O[1].split(",").forEach((A)=>{let w=A.trim().replace(/^\.\.\./,"");if(!w)return;let F=w.split(/[\s=]/)[0];if(F&&!X.has(F))Z.push(F),X.add(F)});return}let V=Q.slice($).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(V){let A=V[1];if(!X.has(A))Z.push(A),X.add(A);return}let B=Q.slice($).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let A=B[1];if(!X.has(A))Z.push(A),X.add(A)}};while($<z){if(W())continue;if(Q[$]==="'"||Q[$]==='"'){K(Q[$]),G=Q[$-1];continue}if(Q[$]==="`"){j(),G="`";continue}if(Q[$]==="/"&&Q[$+1]!=="/"&&Q[$+1]!=="*"&&_()){U(),G="/";continue}if(Q[$]==="{"){J++,G="{",$++;continue}if(Q[$]==="}"){J--,G="}",$++;continue}if(J===0&&/[a-z]/i.test(Q[$])&&($===0||/\s|[;{}()]/.test(Q[$-1])))q();if(!/\s/.test(Q[$]))G=Q[$];$++}return Z.join(", ")}async function Q4(Y,Q,Z,X){if(!y1(Y))return Y;let J=Y;if(Q.skipSignalsRuntime)return J;let{output:$,setupCode:z}=await R6(J,Z,X);if(J=$,J=await t3(J,Q),J=e3(J),z)if(J.includes("</head>"))J=J.replace("</head>",`${z}
|
|
1388
|
-
</head>`);else if(J.includes("<body"))J=J.replace(/<body([^>]*)>/,`<body$1>
|
|
1389
|
-
${z}`);else J=J+`
|
|
1390
|
-
`+z;let U=J.replace(/<script\b[\s\S]*?<\/script>/gi,"").replace(/<style\b[\s\S]*?<\/style>/gi,"").match(/<body([^>]*)>/i),_=U&&/data-stx/.test(U[1]);if(!z&&!_&&U&&!/data-stx-auto/.test(U[1])){let K=/<body[^>]*>/i,j=/<(script|style)\b[\s\S]*?<\/\1>/gi,W=[],q;while((q=j.exec(J))!==null)W.push([q.index,q.index+q[0].length]);let H=0,L=-1;while(H<J.length){K.lastIndex=H;let O=K.exec(J.slice(H));if(!O)break;let V=H+O.index;if(!W.some(([A,w])=>V>=A&&V<w)){L=V;break}H=V+O[0].length}if(L!==-1){let O=J.slice(0,L),V=J.slice(L).replace(K,(B)=>B.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>"));J=O+V}}return J}import U0 from"path";import b1 from"fs";function J4(Y){return Y.split("-").map((Q)=>Q.charAt(0).toUpperCase()+Q.slice(1)).join("")}function z4(Y){return Y.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class G4{builtins=new Map;registerBuiltin(Y){this.builtins.set(Y.name.toLowerCase(),Y);for(let Q of Y.aliases)this.builtins.set(Q.toLowerCase(),Y)}isBuiltin(Y){return this.builtins.has(Y.toLowerCase())}getBuiltin(Y){return this.builtins.get(Y.toLowerCase())??null}async resolveFile(Y,Q,Z,X){let J=Y.endsWith(".stx")?Y.slice(0,-4):Y,$=X?.__importedComponents;if($){let q=[J,J.toLowerCase(),J4(J),z4(J)];for(let H of q)if($.has(H))return $.get(H)}let z=[...new Set([`${J}.stx`,`${J4(J)}.stx`,`${z4(J)}.stx`])];if(J.startsWith("./")||J.startsWith("../")){let q=U0.resolve(U0.dirname(Q),`${J}.stx`);if(await x(q))return q;return null}let G=[],U=Z.componentsDir||"",_=X?.__originalFilePath;if(_)G.push(U0.join(U0.dirname(_),"components"));if(U)G.push(U);let K=U0.join(U0.dirname(Q),"components");if(!G.includes(K))G.push(K);let j=process.cwd(),W=[U0.resolve(j,"src/components"),U0.resolve(j,"components"),U0.resolve(import.meta.dir,"components")];for(let q of W)if(!G.includes(q))G.push(q);for(let q of G){if(!q)continue;for(let H of z){let L=U0.join(q,H);if(await x(L))return L}try{if(!b1.statSync(q,{throwIfNoEntry:!1})?.isDirectory())continue;let L=b1.readdirSync(q,{withFileTypes:!0});for(let O of L)if(O.isDirectory()){let V=U0.join(q,O.name);for(let B of z){let A=U0.join(V,B);if(await x(A))return A}}}catch{}}return null}}var J0=new G4;function U4(){J0.registerBuiltin(S1),J0.registerBuiltin(C1),J0.registerBuiltin(v1),J0.registerBuiltin(P1),J0.registerBuiltin(f1),J0.registerBuiltin(g1),J0.registerBuiltin(x1),J0.registerBuiltin(h1),J0.registerBuiltin(d1),J0.registerBuiltin(m1)}import M0 from"path";function u1(Y){return Y.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}function l1(Y,Q,Z){let X=[],J=0;while(J<Y.length){let $=Y.indexOf("<",J);if($===-1)break;let G=Y.slice($+1).match(new RegExp(`^(${Q.source})`));if(!G){J=$+1;continue}let U=G[1];if(Z&&Z.has(U.toLowerCase())){let L=$+1+U.length;while(L<Y.length&&Y[L]!==">")L++;J=L+1;continue}let _=$+1+U.length,K=null,j=_,W=-1,q=!1;while(_<Y.length){let L=Y[_];if(K){if(L==="\\"&&_+1<Y.length){_+=2;continue}if(L===K)K=null;_++;continue}if(L==='"'||L==="'"){K=L,_++;continue}if(L==="/"&&_+1<Y.length&&Y[_+1]===">"){W=_+2,q=!0;break}if(L===">"){W=_+1;break}_++}if(W===-1){J=$+1;continue}let H=Y.slice(j,q?W-2:W-1).trim();if(q)X.push({fullMatch:Y.slice($,W),tagName:U,attributes:H,content:"",startIndex:$,endIndex:W,isSelfClosing:!0}),J=W;else{let L=`<${U}`,O=`</${U}>`,V=1,B=W,A=-1;while(V>0&&B<Y.length){let k=Y.indexOf(L,B),T=Y.indexOf(O,B);if(T===-1)break;if(k!==-1&&k<T){let I=Y[k+L.length];if(I===" "||I===">"||I==="/"||I===`
|
|
1391
|
-
`||I==="\t")V++;B=k+L.length}else{if(V--,V===0){A=T;break}B=T+O.length}}if(A===-1){J=W;continue}let w=Y.slice(W,A),F=A+O.length;X.push({fullMatch:Y.slice($,F),tagName:U,attributes:H,content:w,startIndex:$,endIndex:F,isSelfClosing:!1}),J=F}}return X}function c1(Y,Q){try{let Z=Buffer.from(Y,"base64").toString("utf8");return JSON.parse(Z)}catch{}try{let Z=Y.replace(/"/g,'"').replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&");return JSON.parse(Z)}catch(Z){if(Q?.debug)console.error("Error decoding __stx_ prop:",Z);return Y}}function I6(Y){let Q={},Z=0,X=Y.length;while(Z<X){while(Z<X&&/\s/.test(Y[Z]))Z++;if(Z>=X)break;let J="";while(Z<X&&!/[\s=]/.test(Y[Z]))J+=Y[Z],Z++;if(!J)break;if(J.startsWith("@")||J.startsWith(":")){while(Z<X&&Y[Z]!=='"'&&Y[Z]!=="'")Z++;if(Z<X){let $=Y[Z];Z++;while(Z<X&&Y[Z]!==$){if(Y[Z]==="\\")Z++;Z++}Z++}continue}while(Z<X&&/\s/.test(Y[Z]))Z++;if(Z<X&&Y[Z]==="="){Z++;while(Z<X&&/\s/.test(Y[Z]))Z++;let $="";if(Z<X&&(Y[Z]==='"'||Y[Z]==="'")){let z=Y[Z];Z++;while(Z<X){let G=Y[Z];if(G==="\\"&&Z+1<X){Z++,$+=Y[Z],Z++;continue}if(G===z){Z++;break}$+=G,Z++}}else while(Z<X&&!/\s/.test(Y[Z]))$+=Y[Z],Z++;Q[J]=$}else Q[J]="true"}return Q}function kY(Y){let Q=[],Z=0,X=Y.length;while(Z<X){while(Z<X&&/\s/.test(Y[Z]))Z++;if(Z>=X)break;let J="";while(Z<X&&!/[\s=]/.test(Y[Z]))J+=Y[Z],Z++;if(!J)break;while(Z<X&&/\s/.test(Y[Z]))Z++;if(Z<X&&Y[Z]==="="){Z++;while(Z<X&&/\s/.test(Y[Z]))Z++;let $="";if(Z<X&&(Y[Z]==='"'||Y[Z]==="'")){let z=Y[Z];Z++;while(Z<X&&Y[Z]!==z){if(Y[Z]==="\\"&&Z+1<X)Z++,$+=Y[Z];else $+=Y[Z];Z++}if(Z<X)Z++}else while(Z<X&&!/\s/.test(Y[Z]))$+=Y[Z],Z++;Q.push({name:J,value:$})}else Q.push({name:J,value:!0})}return Q}async function NY(Y,Q,Z,X){let J=Y;return J=J.replace(/<stx-loading-indicator([^>]*?)(?:\s*\/>|><\/stx-loading-indicator>)/gi,($,z)=>{let G=z.match(/color=["']([^"']+)["']/i),U=z.match(/initial-color=["']([^"']+)["']/i),_=z.match(/height=["']([^"']+)["']/i),K=z.match(/duration=["']([^"']+)["']/i),j=z.match(/throttle=["']([^"']+)["']/i),W=z.match(/z-index=["']([^"']+)["']/i),q=(O)=>O.replace(/[;{}()]/g,"").replace(/url/gi,""),H={color:q(G?.[1]||"#6366f1"),initialColor:q(U?.[1]||""),height:q(_?.[1]||"3px"),duration:K?Number.parseInt(K[1]):2000,throttle:j?Number.parseInt(j[1]):200,zIndex:W?Number.parseInt(W[1]):999999},L=H.initialColor?`linear-gradient(to right, ${H.initialColor}, ${H.color})`:H.color;return`
|
|
1392
|
-
<div id="stx-loading-indicator" style="position:fixed;top:0;left:0;right:0;height:${H.height};background:${L};z-index:${H.zIndex};transform:scaleX(0);transform-origin:left;transition:transform 0.1s ease-out,opacity 0.3s ease;opacity:0;pointer-events:none">
|
|
1393
|
-
<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>
|
|
1394
|
-
</div>
|
|
1395
|
-
<style>@keyframes stx-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}</style>
|
|
1396
|
-
<script>
|
|
1397
|
-
(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)},${H.throttle})},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()})})();
|
|
1398
|
-
</script>`}),J}async function DY(Y,Q,Z,X,J){let $=Y;if(!Q.__importedComponents)Q.__importedComponents=new Map;let z=Q.__importedComponents,G=/@import\s*\(\s*([^)]+)\s*\)/g,U;while((U=G.exec($))!==null){let[_,K]=U,j=K.split(",").map((W)=>W.trim().replace(/^['"]|['"]$/g,"")).filter((W)=>W.length>0);for(let W of j){let q=W.split("/"),L=q[q.length-1].replace(/\.stx$/,""),O=L.includes("-")?L.split("-").map((A)=>A.charAt(0).toUpperCase()+A.slice(1)).join(""):L.charAt(0).toUpperCase()+L.slice(1),V=null,B=[M0.resolve(M0.dirname(Z),`${W}.stx`),M0.resolve(M0.dirname(Z),W),M0.resolve(X.componentsDir||"components",`${W}.stx`),M0.resolve(X.componentsDir||"components",W),W.endsWith(".stx")?W:`${W}.stx`];for(let A of B)try{if(await Bun.file(A).exists()){V=A;break}}catch{}if(V){z.set(O,V),z.set(L,V),z.set(L.toLowerCase(),V);let A=O.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(z.set(A,V),J.add(V),X.debug)console.log(`Imported component: ${O} -> ${V}`)}else if(X.debug)console.warn(`Could not resolve imported component: ${W}`)}$=$.replace(_,""),G.lastIndex=0}return $}async function EY(Y,Q,Z,X,J,$){let z=Y;if(!Q.__processedComponents)Q.__processedComponents=new Set;let G=Q.__processedComponents,U=/@component\s*\(/g,_;while((_=U.exec(z))!==null){let K=_.index,j=K+_[0].length-1,W=1,q=j+1;while(q<z.length&&W>0){if(z[q]==="(")W++;else if(z[q]===")"){if(W--,W===0)break}q++}if(W!==0)break;let H=z.substring(j+1,q),L=q+1,O=H.match(/^\s*['"]([^'"]+)['"]/);if(!O){U.lastIndex=0;continue}let V=O[1],B,A=H.slice(O[0].length),w=A.match(/^\s*,\s*/);if(w)B=A.slice(w[0].length).trim();let F={};if(B)try{F=L0(B,Q)}catch(E){let M=E instanceof Error?E.message:String(E);z=z.replace(z.substring(K,L),`[Error parsing component props: ${M}]`);continue}let k="",T=L,R=z.substring(L).match(/^([\s\S]*?)@endcomponent/);if(R)k=R[1].trim(),T=L+R[0].length;let N=z.substring(K,T),D=await B0(V,F,k,X,Q,Z,J,G,$);z=z.substring(0,K)+D+z.substring(T),U.lastIndex=0}return z}async function MY(Y,Q,Z,X,J,$){let z=Y;if(!Q.__processedComponents)Q.__processedComponents=new Set;let G=Q.__processedComponents,U=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","path","circle","rect","line","polygon","polyline","ellipse","text","tspan","textPath","g","defs","use","symbol","image","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","foreignObject","animate","animateMotion","animateTransform","set","mpath","desc","metadata","switch","view"]),_=G1(z);return z=_.output,z=await q(z,/[a-z][a-z0-9]*-[a-z0-9-]*/,!1),z=await q(z,/[A-Z][a-zA-Z0-9]*/,!0),z=await q(z,/[a-z][a-z0-9]*/,!1,U),z=U1(z,_.scripts),z;async function q(H,L,O,V){let B=H,A=l1(B,L,V);for(let w=A.length-1;w>=0;w--){let F=A[w],k=O?u1(F.tagName):F.tagName,T=I6(F.attributes),I={};for(let[N,D]of Object.entries(T)){if(N.startsWith("@"))continue;if(N.startsWith("__stx_")){let E=N.slice(6);I[E]=c1(D,J);continue}if(N.startsWith(":")){let E=N.slice(1),M=D==="true"?E:D;try{if(!Y0(M)){if(J.debug)console.error(`Unsafe expression in :${E} binding: ${M}`);I[E]=D}else{let y=e(M,Object.keys(Q));I[E]=y(...Object.values(Q))}}catch(y){if(J.debug)console.error(`Error evaluating :${E} binding:`,y);I[E]=D}continue}if(typeof D==="string"&&D.includes("{{")&&D.includes("}}")){let E=D.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(E)try{let M=E[1];if(!Y0(M)){if(J.debug)console.error(`Unsafe expression in ${N}: ${M}`);I[N]=D}else{let y=e(M,Object.keys(Q));I[N]=y(...Object.values(Q))}}catch(M){if(J.debug)console.error(`Error evaluating expression for ${N}:`,M);I[N]=D}else{let M=D,y=/\{\{\s*([\s\S]+?)\s*\}\}/g,b;while((b=y.exec(D))!==null)try{let C=b[1];if(!Y0(C)){if(J.debug)console.error(`Unsafe expression in ${N}: ${C}`);continue}let v=e(C,Object.keys(Q))(...Object.values(Q));M=M.replace(b[0],String(v??""))}catch(C){if(J.debug)console.error(`Error evaluating expression in ${N}:`,C)}I[N]=M}}else I[N]=D}let R=await B0(k,I,F.content,X,Q,Z,J,G,$);B=B.substring(0,F.startIndex)+R+B.substring(F.endIndex)}return B}}import K1 from"fs";import G0 from"path";var K4=!1,k6=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","path","circle","rect","line","polygon","polyline","ellipse","text","tspan","textPath","g","defs","use","symbol","image","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","foreignObject","animate","animateMotion","animateTransform","set","mpath","desc","metadata","switch","view"]);function N6(Y,Q,Z){let X={static:{},serverDynamic:{},clientReactive:{},events:{}},J=new Set(["x-cloak","x-show","x-if","x-for","x-data","x-init","x-transition","x-ref","x-effect","x-model","x-text","x-html","x-class","x-style","x-on","x-bind"]),$=(z)=>{if(!z.includes("-")||z.startsWith("@")||z.startsWith(":")||z.startsWith("x-")||z.startsWith("__"))return z;return z.replace(/-([a-z0-9])/g,(G,U)=>U.toUpperCase())};for(let[z,G]of Object.entries(Y)){let U=z.startsWith("x-")&&!J.has(z)&&!z.startsWith("x-bind:")&&!z.startsWith("x-on:")?`:${z.slice(2)}`:z;if(U.startsWith("@")){X.events[U]=G;continue}if(U.startsWith("__stx_")){let _=$(U.slice(6));X.serverDynamic[_]=c1(G,Z);continue}if(U.startsWith(":")){let _=$(U.slice(1)),K=G==="true"?_:G;try{if(!Y0(K)){if(Z.debug)console.error(`Unsafe expression in :${_} binding: ${K}`);X.clientReactive[_]=K;continue}let j=Object.keys(Q),q=e(K,j)(...Object.values(Q));if(q===void 0){let H=K.match(/\b[a-zA-Z_$][a-zA-Z0-9_$]*\b/g)||[],L=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","if","else"]);if(H.some((V)=>!L.has(V)&&!j.includes(V))){X.clientReactive[_]=K;continue}}X.serverDynamic[_]=q}catch{X.clientReactive[_]=K}continue}if(typeof G==="string"&&G.includes("{{")&&G.includes("}}")){let _=G.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(_)try{let K=_[1];if(Y0(K)){let W=e(K,Object.keys(Q))(...Object.values(Q));X.static[U]=W!=null?String(W):""}else{if(Z.debug)console.error(`Unsafe expression in ${U}: ${K}`);X.static[U]=G}}catch(K){if(Z.debug)console.error(`Error evaluating expression for ${U}:`,K);X.static[U]=G}else{let K=G,j=/\{\{\s*([\s\S]+?)\s*\}\}/g,W;while((W=j.exec(G))!==null)try{let q=W[1];if(!Y0(q)){if(Z.debug)console.error(`Unsafe expression in ${U}: ${q}`);continue}let L=e(q,Object.keys(Q))(...Object.values(Q));K=K.replace(W[0],String(L??""))}catch(q){if(Z.debug)console.error(`Error evaluating expression in ${U}:`,q)}X.static[U]=K}continue}X.static[U]=G}return X}function D6(Y){let Q={},Z=0,X=Y.length;while(Z<X){while(Z<X&&/\s/.test(Y[Z]))Z++;if(Z>=X)break;let J="";while(Z<X&&!/[\s=]/.test(Y[Z]))J+=Y[Z],Z++;if(!J)break;while(Z<X&&/\s/.test(Y[Z]))Z++;if(Z<X&&Y[Z]==="="){Z++;while(Z<X&&/\s/.test(Y[Z]))Z++;let $="";if(Z<X&&(Y[Z]==='"'||Y[Z]==="'")){let z=Y[Z];Z++;while(Z<X){let G=Y[Z];if(G==="\\"&&Z+1<X){Z++,$+=Y[Z],Z++;continue}if(G===z){Z++;break}$+=G,Z++}}else while(Z<X&&!/\s/.test(Y[Z]))$+=Y[Z],Z++;Q[J]=$}else Q[J]="true"}return Q}function q4(Y){return Y.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function E6(Y){let Q=new Set,Z=/<([A-Z][A-Za-z0-9]*|stx-[a-z0-9-]+)\b[^>]*>/g,X;while((X=Z.exec(Y))!==null){let J=X[1];if(J0.isBuiltin(J))Q.add(J)}return[...Q].sort()}var H4=new Map;function M6(Y){let Q=H4.get(Y);if(Q)return Q;let Z=new Map,X=[G0.join(Y,"src"),G0.join(Y,"dist"),Y];function J($,z){if(z>6)return;let G;try{G=K1.readdirSync($,{withFileTypes:!0})}catch{return}for(let U of G){let _=G0.join($,U.name);if(U.isDirectory()){if(U.name==="node_modules"||U.name.startsWith("."))continue;J(_,z+1)}else if(U.isFile()&&U.name.endsWith(".stx")){let K=U.name.slice(0,-4);if(!Z.has(K))Z.set(K,_);let j=K.toLowerCase();if(!Z.has(j))Z.set(j,_);let W=K.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(!Z.has(W))Z.set(W,_)}}}for(let $ of X)if(J($,0),Z.size>0)break;return H4.set(Y,Z),Z}function y6(Y,Q){if(Y.startsWith(".")||Y.startsWith("/"))return null;let Z=Q;while(!0){let X=G0.join(Z,"node_modules",Y);try{if(K1.statSync(X).isDirectory())return X}catch{}let J=G0.dirname(Z);if(J===Z)return null;Z=J}}async function b6(Y,Q,Z,X,J){if(!Y.includes("import"))return Y;if(!Q.__importedComponents)Q.__importedComponents=new Map;let $=Q.__importedComponents,z=G0.dirname(Z),G=Y,U=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi;return G=G.replace(U,(_,K,j)=>{let W=/import\s+(?:(\{[^}]*\})|([A-Za-z_$][\w$]*))\s+from\s+['"]([^'"]+)['"]\s*;?\s*\n?/g,q=j,H,L=[];while((H=W.exec(j))!==null){let[O,V,B,A]=H,w=null,F=null;if(A.startsWith(".")||A.startsWith("/")){let I=G0.resolve(z,A);if(I.endsWith(".stx"))F=I;else{let R=`${I}.stx`;try{if(K1.statSync(R).isFile())F=R}catch{try{if(K1.statSync(I).isDirectory())w=I}catch{}}}}else w=y6(A,z);if(!w&&!F)continue;let k=!1,T=(I,R)=>{$.set(I,R),$.set(I.toLowerCase(),R);let N=I.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();$.set(N,R),J.add(R)};if(B&&F)T(B,F),k=!0;else if(V){let I=V.slice(1,-1).split(",").map((N)=>N.trim()).filter(Boolean).map((N)=>{let D=N.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(D)return{source:D[1],local:D[2]};return{source:N,local:N}}),R=w?M6(w):null;for(let{source:N,local:D}of I){let E=null;if(F)E=F;else if(R)E=R.get(N)??R.get(N.toLowerCase())??R.get(N.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())??null;if(E)T(D,E),k=!0}}if(k)L.push({start:H.index,end:H.index+O.length})}if(L.length===0)return _;for(let O=L.length-1;O>=0;O--)q=q.slice(0,L[O].start)+q.slice(L[O].end);return`<script${K}>${q}</script>`}),G}async function S6(Y,Q,Z,X,J){let $=Y;if(!Q.__importedComponents)Q.__importedComponents=new Map;let z=Q.__importedComponents,G=/@import\s*\(\s*([^)]+)\s*\)/g,U;while((U=G.exec($))!==null){let[_,K]=U,j=K.split(",").map((W)=>W.trim().replace(/^['"]|['"]$/g,"")).filter((W)=>W.length>0);for(let W of j){let q=W.split("/"),L=q[q.length-1].replace(/\.stx$/,""),O=L.includes("-")?L.split("-").map((A)=>A.charAt(0).toUpperCase()+A.slice(1)).join(""):L.charAt(0).toUpperCase()+L.slice(1),V=null,B=[G0.resolve(G0.dirname(Z),`${W}.stx`),G0.resolve(G0.dirname(Z),W),G0.resolve(X.componentsDir||"components",`${W}.stx`),G0.resolve(X.componentsDir||"components",W),W.endsWith(".stx")?W:`${W}.stx`];for(let A of B)try{if(await Bun.file(A).exists()){V=A;break}}catch{}if(V){z.set(O,V),z.set(L,V),z.set(L.toLowerCase(),V);let A=O.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(z.set(A,V),J.add(V),X.debug)console.log(`Imported component: ${O} -> ${V}`)}else if(X.debug)console.warn(`Could not resolve imported component: ${W}`)}$=$.replace(_,""),G.lastIndex=0}return $}async function C6(Y,Q,Z,X,J){let $=Y,z=X.componentsDir||"components";if(!Q.__processedComponents)Q.__processedComponents=new Set;let G=Q.__processedComponents,U=/@component\s*\(/g,_;while((_=U.exec($))!==null){let K=_.index,j=K+_[0].length-1,W=1,q=j+1;while(q<$.length&&W>0){if($[q]==="(")W++;else if($[q]===")"){if(W--,W===0)break}q++}if(W!==0)break;let H=$.substring(j+1,q),L=q+1,O=H.match(/^\s*['"]([^'"]+)['"]/);if(!O){U.lastIndex=0;continue}let V=O[1],B,A=H.slice(O[0].length),w=A.match(/^\s*,\s*/);if(w)B=A.slice(w[0].length).trim();let F={};if(B)try{F=L0(B,Q)}catch(D){let E=D instanceof Error?D.message:String(D);$=$.replace($.substring(K,L),`[Error parsing component props: ${E}]`);continue}let k="",T=L,R=$.substring(L).match(/^([\s\S]*?)@endcomponent/);if(R)k=R[1].trim(),T=L+R[0].length;let N=await B0(V,F,k,z,Q,Z,X,G,J);$=$.substring(0,K)+N+$.substring(T),U.lastIndex=0}return $}async function v6(Y,Q,Z,X,J){if(!Y)return Y;let $=Y,z=X.componentsDir||"components";if(!Q.__processedComponents)Q.__processedComponents=new Set;let G=Q.__processedComponents,U=G1($);return $=U.output,$=await W($,/[a-z][a-z0-9]*-[a-z0-9-]*/,!1),$=await W($,/[A-Z][a-zA-Z0-9]*/,!0),$=await W($,/[a-z][a-z0-9]*/,!1,k6),$=U1($,U.scripts),$;async function W(q,H,L,O){if(!q)return q;let V=q,B=l1(V,H,O);for(let A=B.length-1;A>=0;A--){let w=B[A],F=L?u1(w.tagName):w.tagName,k=D6(w.attributes),T=N6(k,Q,X),I=J0.getBuiltin(w.tagName),R=I?await _4(F,z,Q,Z,X):!1;if(I&&!R){let M={context:Q,filePath:Z,options:X,dependencies:J},y=I.render(T,w.content,M);if(Object.keys(T.clientReactive).length>0)y=j4(y,T.clientReactive);if(Object.keys(T.events).length>0){let b=Object.entries(T.events).map(([C,l])=>`${C}="${q4(l)}"`).join(" ");y=y.replace(/^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/,`$1 ${b}`)}V=V.substring(0,w.startIndex)+y+V.substring(w.endIndex);continue}let N={};for(let[M,y]of Object.entries(T.static))N[M]=y;for(let[M,y]of Object.entries(T.serverDynamic))N[M]=y;let E=await B0(F,N,w.content,z,Q,Z,X,G,J);if(Object.keys(T.clientReactive).length>0)E=j4(E,T.clientReactive);if(Object.keys(T.events).length>0){let M=E.match(/^(\s*<)([a-zA-Z][a-zA-Z0-9-]*)(\s|>|\/)/s);if(M){let y=Object.entries(T.events).map(([C,l])=>`${C}="${q4(l)}"`).join(" "),b=M[1].length+M[2].length;E=E.substring(0,b)+" "+y+E.substring(b)}}V=V.substring(0,w.startIndex)+E+V.substring(w.endIndex)}return V}}function j4(Y,Q){let Z=Y.match(/^(\s*<)([a-zA-Z][a-zA-Z0-9-]*)(\s|>|\/)/s);if(!Z)return Y;let X=Object.entries(Q).map(([$,z])=>`:${$}="${z.replace(/"/g,""")}"`).join(" "),J=Z[1].length+Z[2].length;return Y.substring(0,J)+" "+X+Y.substring(J)}async function i1(Y,Q,Z,X,J){if(!K4)U4(),K4=!0;let $=await b6(Y,Q,Z,X,J);$=await S6($,Q,Z,X,J),$=await C6($,Q,Z,X,J);for(let z=0;z<3;z++){let G=$;if($=await v6($,Q,Z,X,J),$===G)break}if(X.debug){let z=E6($);if(z.length>0)console.warn(`[stx] ${Z}: unresolved component tag(s) after render passes: ${z.join(", ")}. Check nested component output for malformed root tags or recursive component markup.`)}return $}import{deriveLayoutGroup as P6}from"stx-router/layout-metadata";var k0="<!--PARENT_CONTENT_PLACEHOLDER-->";function W4(Y){return Y.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function f6(Y,Q){let Z=Y.length,X=Q,J=!0,$=[],z=(G)=>G+9<=Z&&Y[G]==="<"&&Y[G+1]==="/"&&(Y[G+2]==="s"||Y[G+2]==="S")&&(Y[G+3]==="c"||Y[G+3]==="C")&&(Y[G+4]==="r"||Y[G+4]==="R")&&(Y[G+5]==="i"||Y[G+5]==="I")&&(Y[G+6]==="p"||Y[G+6]==="P")&&(Y[G+7]==="t"||Y[G+7]==="T")&&(Y[G+8]===">"||/\s/.test(Y[G+8]));while(X<Z){let G=Y[X];if(z(X))return X;if(G==="/"&&Y[X+1]==="/"){if(X=Y.indexOf(`
|
|
1399
|
-
`,X+2),X===-1)return-1;X+=1,J=!0;continue}if(G==="/"&&Y[X+1]==="*"){let U=Y.indexOf("*/",X+2);if(U===-1)return-1;X=U+2,J=!0;continue}if(G==="/"&&J){let U=X+1,_=!1;while(U<Z){let K=Y[U];if(K==="\\"){U+=2;continue}if(K==="[")_=!0;else if(K==="]")_=!1;else if(K==="/"&&!_){U++;break}else if(K===`
|
|
1400
|
-
`){U=-1;break}U++}if(U===-1){X++,J=!1;continue}while(U<Z&&/[a-z]/.test(Y[U]))U++;X=U,J=!1;continue}if(G==="'"||G==='"'){let U=G;X++;while(X<Z){if(Y[X]==="\\"){X+=2;continue}if(Y[X]===U){X++;break}if(Y[X]===`
|
|
1401
|
-
`)break;X++}J=!1;continue}if(G==="`"){X++;while(X<Z){if(Y[X]==="\\"){X+=2;continue}if(Y[X]==="`"){X++;break}if(Y[X]==="$"&&Y[X+1]==="{"){$.push(!0),X+=2,J=!0;break}X++}if($.length===0)J=!1;continue}if(G==="}"&&$.length>0){$.pop(),X++;while(X<Z){if(Y[X]==="\\"){X+=2;continue}if(Y[X]==="`"){X++,J=!1;break}if(Y[X]==="$"&&Y[X+1]==="{"){$.push(!0),X+=2,J=!0;break}X++}continue}if(/\s/.test(G));else if(/[)\].\w$]/.test(G))J=!1;else J=!0;X++}return-1}async function a1(Y,Q,Z,X,J){if(X.ssr===!1&&!X.autoShell&&X.buildMode==="spa")return Y;let $=!Q.__stxProcessingDepth;if(!Q.__stxProcessingDepth)Q.__stxProcessingDepth=0;if(Q.__stxProcessingDepth++,!Q.__onceStore)Q.__onceStore=new Set;if((X.debug||!e0()&&!t0())&&Z&&Z.endsWith(".stx"))i4(Y,Z);try{return await w4.timeAsync("template-processing",async()=>{let z=await g6(Y,Q,Z,X,J);if($)z=n1(z);if($&&X.autoShell&&X.buildMode!=="compile"){let G=X.app?.head||{},_=(Q.__stx_runtime_head||null)??d4(),K=(Q.__stx_head_raw||"").trim(),j,W=K.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(W)j=W[1].trim(),K=K.replace(W[0],"").trim();let q=Q.__sections?.title,H=_.title||j||q,L={...G,...H&&{title:H},meta:[...G.meta||[],..._.meta||[]],link:[...G.link||[],..._.link||[]],script:[...G.script||[],..._.script||[]],headRaw:[G.headRaw,K].filter(Boolean).join(`
|
|
1402
|
-
`),..._.htmlAttrs&&{htmlAttrs:{...G.htmlAttrs||{},..._.htmlAttrs}},..._.bodyAttrs&&{bodyAttrs:{...G.bodyAttrs||{},..._.bodyAttrs}}},O=e4(z);if(z=Y5(z,L),O)z=t4(z,G);let V=z.match(/<!-- stx-layout: ([^ ]+) -->/);if(V&&z.includes("<head")){let A=V[1],w=P6(A);z=z.replace("<head>",`<head>
|
|
1403
|
-
<meta name="stx-layout" content="${W4(A)}">
|
|
1404
|
-
<meta name="stx-layout-group" content="${W4(w)}">`)}let B=z.match(/function (__stx_setup_\d+_\d+)\(/);if(B&&z.includes("<body")&&!z.match(/<body[^>]*data-stx=/)){z=z.replace(/<body([^>]*)>/,`<body$1 data-stx="${B[1]}">`);let A=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${B[1]}"`,"i");z=z.replace(A,"$1")}}if($)z=o4(z);if($)try{let{getStoreScript:G}=await import("././store-loader.js"),U=X.storesDir,_=await G(U);if(_){let K=`<script data-stx-stores>${_}</script>`,j=z.indexOf("<script data-stx-scoped>");if(j!==-1){let W=z.indexOf("</script>",j+24);if(W!==-1){let q=W+9;z=z.slice(0,q)+`
|
|
1405
|
-
`+K+z.slice(q)}}}}catch{}if($&&Q.__stx_inject_css!==!1)z=await M4(z);return z=z.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),z})}catch(z){if(z instanceof R4)throw z;let G=z instanceof Error?z.message:String(z),U=new P0(`Template processing failed: ${G}`,Z,void 0,void 0,Y.substring(0,200)+(Y.length>200?"...":""));if(w0.log(U,{filePath:Z,context:Q}),I4.logDetailedError(U,{filePath:Z,template:Y.substring(0,500)}),X.debug)throw U;return T4.createFallbackContent("Template Processing",U)}}async function g6(Y,Q,Z,X,J){let $=process.cwd(),z={...X,partialsDir:X.partialsDir&&!z0.isAbsolute(X.partialsDir)?z0.resolve($,X.partialsDir):X.partialsDir,componentsDir:X.componentsDir&&!z0.isAbsolute(X.componentsDir)?z0.resolve($,X.componentsDir):X.componentsDir,layoutsDir:X.layoutsDir&&!z0.isAbsolute(X.layoutsDir)?z0.resolve($,X.layoutsDir):X.layoutsDir},G=z,U=Y;await d6(Z,Q),h6(Q,G),U=await f0(()=>i3(U,Q,Z,G),U,(B)=>{w0.log(B,{filePath:Z,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${Z}: ${B.message}`)}),U=U.replace(/\{\{--[\s\S]*?--\}\}/g,"");let _=c0(U,A4,(B,A)=>`\x00STX_HTML_COMMENT_${A}\x00`);U=_.output;let K=_.tokens,j=(B)=>K.length===0?B:B.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(A,w)=>K[Number(w)]??""),W="\x00STX_ESCAPED_AT\x00";U=U.replace(/@@/g,W),U=U.replace(/@\{\{([\s\S]*?)\}\}/g,(B,A)=>{return`{{ ${A} }}`}),U=a4(U),U=await $5(U,Z,J);let q={};U=T1(U,q);let H={...Q.__sections||{}},L="",O=/@nolayout\b/.test(U);if(O)U=U.replace(/@nolayout\b\s*/g,"");let V=U.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(V)L=V[1],U=U.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");if(!L&&!O&&G.defaultLayout){let B=/<!DOCTYPE\s/i.test(U),A=/@section\s*\(/.test(U);if(!B||A){let w="",F=z0.dirname(Z),k=G.layoutsDir?z0.dirname(G.layoutsDir):process.cwd();for(let T=0;T<20;T++){let I=z0.join(F,"_layout.stx");if(await x(I)){w=I;break}let R=z0.dirname(F);if(R===F||R.length<k.length)break;F=R}if(w)L=w;else if(G.layoutsDir){let T=z0.isAbsolute(G.layoutsDir)?G.layoutsDir:z0.resolve(process.cwd(),G.layoutsDir),I=z0.join(T,`${G.defaultLayout}.stx`);if(await x(I))L=I}if(L&&!A)U=`@section('content')
|
|
1406
|
-
${U.trim()}
|
|
1407
|
-
@endsection`}}if(U=U.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(B,A,w)=>{return H[A]=w,""}),U=U.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(B,A,w)=>{if(/^(['"]).*\1$/.test(w.trim()))return B;try{let F=$0(w.trim(),Q);if(F===void 0)return B;return H[A]=String(F??""),""}catch{return B}}),U=U.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(B,A,w)=>{if(w.includes("@parent"))H[A]=w.replace("@parent",k0);else H[A]=w.trim();return""}),Q.__sections=H,U=U.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(B,A,w)=>{return H[A]||w||""}),!("slot"in Q)||Q.slot===void 0)U=U.replace(/\{\{\s*slot\s*\}\}/g,()=>{return H.content||""});if(U=I1(U,q),L){let B=[];if(U=U.replace(/<(script|style)\b[\s\S]*?<\/\1>/gi,(A)=>{return B.push(A),""}),B.length>0){let A=B.join(`
|
|
1408
|
-
`);H.content=H.content?`${H.content}
|
|
1409
|
-
${A}`:A,Q.__sections=H}}if(L)try{let B;if(z0.isAbsolute(L))B=L,J.add(L);else B=await f0(()=>n0(L,Z,z,J),null,()=>{throw new P0(`Failed to resolve layout path: ${L}`,Z,void 0,void 0,`Layout referenced from ${Z}`)});if(!B){let I=`Layout not found: ${L} (referenced from ${Z})`;if(w0.log(Error(I),{layoutPath:L,filePath:Z},"warning"),z.debug)throw new P0(I,Z);return U}let A=await f0(()=>Bun.file(B).text(),"",()=>{throw new P0(`Failed to read layout file: ${B}`,Z,void 0,void 0,"Layout content could not be loaded")}),w=A.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(w){if(z.debug)console.log(`Found nested layout: ${w[1]} in ${B}`);let I={},R=A.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(E,M,y)=>{return I[M]=y.trim(),""});for(let[E,M]of Object.entries(I))if(H[E]&&H[E].includes(k0)){let y=H[E].indexOf(k0);H[E]=H[E].slice(0,y)+M+H[E].slice(y+k0.length)}else if(!H[E])H[E]=M;let N={...Q,__sections:H},D=`@layout('${w[1]}')${R}`;return await a1(D,N,B,z,J)}let F=A.replace(/\{\{--[\s\S]*?--\}\}/g,""),k=T1(F,q),T={};return k=k.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(I,R,N)=>{return T[R]=N.trim(),`@slot('${R}')`}),k=k.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(I,R,N)=>{if(H[R]){let D=H[R];if(D.includes(k0)){let E=T[R]||"",M=D.indexOf(k0);D=D.slice(0,M)+E+D.slice(M+k0.length)}return D}return N||""}),k=x6(k,H),k=k.replace(/\{\{\s*slot\s*\}\}/g,()=>{return H.content||""}),k=I1(k,q),Q.__originalFilePath=Z,U=await L4(k,Q,B,z,J),U=`<!-- stx-layout: ${L} -->
|
|
1410
|
-
${U}`,j(U)}catch(B){return w0.log(B instanceof Error?B:Error(String(B)),{layoutPath:L,filePath:Z},"error"),`[Error processing layout: ${B instanceof Error?B.message:String(B)}]`}return j(await L4(U,Q,Z,z,J))}function x6(Y,Q){return Y.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(Z,X,J)=>{let $=Q[X];if($!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test($))return $}return J||""})}function h6(Y,Q){if(Y.__stx_sfc_mode=!0,Y.__stx_options=Q,Q.buildMode)Y.__stx_buildMode=Q.buildMode;let Z=Q.envPrefix||"STX_PUBLIC_",X={};for(let[J,$]of Object.entries(process.env))if(J.startsWith(Z)&&$!==void 0)X[J]=$;Y.$env=X}async function d6(Y,Q){await f0(()=>n4(Y,Q),void 0,(Z)=>{w0.log(Z,{filePath:Y,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${Y}: ${Z.message}`)})}async function m6(Y,Q,Z){let X=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,J;while((J=X.exec(Y))!==null){let $=J[1],z=J[2];if(!/\bserver\b/.test($)||!z.trim())continue;try{let{extractVariables:U}=await import("././variable-extractor.js");await U(z,Q,Z,{preserveExisting:!0})}catch(U){let _=U instanceof Error?U:Error(String(U));w0.log(_,{filePath:Z,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${Z}: ${_.message}`)}}}async function u6(Y,Q,Z){try{let{interpolateScriptsInTemplate:X}=await import("././expressions.js");return X(Y,Q,{skipServer:!0})}catch(X){let J=X instanceof Error?X:Error(String(X));return w0.log(J,{filePath:Z,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${Z}: ${J.message}`),Y}}async function L4(Y,Q,Z,X,J){let $=Y,z=X;if(await m6($,Q,Z),$=await u6($,Q,Z),$=await C3($,Q,Z),$=await v3($,Q,Z),$=await h4($,Q,Z,z),C0($))$=$4($,Q),$=X4($,Q);$=Z4($);let{processStreamDirectives:G}=await import("././streaming.js");$=G($,Q),$=m3($,Q,Z,z),$=await i1($,Q,Z,z,J),$=await s3($,Q,Z,z,J),$=V4($,Q,Z,z);let{processDeferDirectives:U}=await import("././defer.js");$=U($,Q,Z);let{processTeleportDirectives:_}=await import("././teleport.js");$=_($,Q,Z);let{processTransitionDirectives:K,processTransitionAttributes:j}=await import("././transitions.js");$=K($,Q,Z),$=j($);let{processErrorBoundaryDirectives:W}=await import("././error-boundaries.js");$=W($,Q,Z);let{processSuspenseDirectives:q}=await import("././suspense.js");$=q($,Q,Z);let{processAsyncDirectives:H}=await import("././async-components.js");$=H($,Q,Z);let{processKeepAliveDirectives:L}=await import("././keep-alive.js");$=L($,Q,Z);let{processVirtualListDirectives:O,processVirtualGridDirectives:V,processInfiniteListDirectives:B}=await import("././virtual-scrolling.js");$=O($,Q,Z),$=V($,Q,Z),$=B($,Q,Z);let{processPartialHydrationDirectives:A,processStaticDirectives:w}=await import("././partial-hydration.js");$=A($,Q,Z),$=w($);let{processComputedDirectives:F,processWatchDirectives:k}=await import("././computed.js");$=F($,Q,Z),$=k($,Q,Z);let{processFormValidationDirectives:T}=await import("././forms-validation.js");$=T($,Q,Z);let{processHeadDirective:I,processTitleDirective:R,processMetaDirective:N,resetHead:D}=await import("././head.js");if(!Q.__stx_head_preset&&!Q.__stx_runtime_head)D();let E=I($);if($=E.content,E.headContent)Q.__stx_head_raw=`${Q.__stx_head_raw||""}${E.headContent}
|
|
1411
|
-
`;if($=R($,Q),$=N($,Q),$=s4($),$=C4($,Q),$=x4($),$=p4($),$=await R1($,Q,Z,z,J),$=await i1($,Q,Z,z,J),$=$.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),$=n1($),$=R0($,Q,Z),$=v4($,Q),$=P4($,Q),$=m4($,Q),$=u4($,Q),$=l4($,Q),$=await E3($,Q,Z,z),$=await U3($,Q,Z),$=await c4($,Q,Z,z),$=B4($,Q,Z,z),$=k4($,Q,Z,z),$=N4($,Q,Z),$=D4($,Q,Z,z),$=g4($,Q,Z,z),$=p1($,Q),$=s1($),$=Z5($),!z.skipEventDirectives)$=S4($,Q,Z);if($=G3($,Q,Z),z.debug){let f=/\bx-data\s*=/.test($),P=y1(Y);if(f&&P)console.warn(`[stx] ${Z}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
|
|
1412
|
-
Both work on the same page, but they manage separate scopes.
|
|
1413
|
-
Prefer signals (state/derived/effect) for new components.`)}$=r4($,Q),$=await _0($,Q,Z),$=X5($),$=Q5($),$=b4($);let{processXElementDirectives:M}=await import("././x-element.js");$=M($);let y=Q.__originalFilePath||Z,b=q1(Q);if($=await Q4($,z,y,b),$=await p3($,Q,Z,z),z.media?.image?.autoSiblings){let f=z.publicDir||"public",{rewriteImagesWithSiblings:P}=await import("./image-optimization/auto-sibling.js");$=await P($,{publicDir:f})}if(z.seo?.enabled)$=E4($,Q,z);let C=(f,P)=>{if(!P)return f;if(/<\/head>/i.test(f))return f.replace(/<\/head>/i,`${P}
|
|
1414
|
-
</head>`);if(/<head\b[^>]*>/i.test(f))return f.replace(/(<head\b[^>]*>)/i,`$1
|
|
1415
|
-
${P}`);if(/<html\b[^>]*>/i.test(f))return f.replace(/(<html\b[^>]*>)/i,`$1
|
|
1416
|
-
<head>
|
|
1417
|
-
${P}
|
|
1418
|
-
</head>`);return f},{renderHead:l,getHead:v}=await import("././head.js"),u=Q.__stx_runtime_head,n=u&&(u.title||u.meta?.length||u.link?.length)?u:v();if(n.title||n.meta?.length||n.link?.length){let f=l(n);if(f)$=C($,f)}if(E.headContent)$=C($,E.headContent);if(z.csp?.enabled&&z.csp.addMetaTag)$=f4($,z.csp,Q);if(z.analytics?.enabled)$=O4($,z);if(z.heatmap?.enabled)$=F4($,z);if(z.pwa?.enabled&&z.pwa.autoInject!==!1){let{injectPwaTags:f}=await import("./pwa/inject.js");$=f($,z)}let O0=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test($),y0=/\bSTX\.\w+/.test($),V0=/window\.STX\s*=/.test($);if(O0&&y0&&!V0){let P=`<script data-stx-scoped>
|
|
1419
|
-
${y4()}
|
|
1420
|
-
</script>`;if($.includes("</head>")){let p=$.indexOf("</head>"),r=$.slice(0,p).indexOf("<script");if(r!==-1){let Q0=$.slice(0,r),K0=$.slice(r);$=Q0+P+`
|
|
1421
|
-
`+K0}else $=$.replace("</head>",`${P}
|
|
1422
|
-
</head>`)}else if($.includes("<body"))$=$.replace(/<body([^>]*)>/,`<body$1>
|
|
1423
|
-
${P}`);else $=P+`
|
|
1424
|
-
`+$}{let f=/<script\s+server\b[^>]*>/gi,P,p=[];while((P=f.exec($))!==null){let a=P.index+P[0].length,r=f6($,a);if(r===-1)continue;let Q0=r+9;while(Q0<$.length&&/\s/.test($[Q0]))Q0++;p.push({start:P.index,end:Q0}),f.lastIndex=Q0}for(let a=p.length-1;a>=0;a--){let{start:r,end:Q0}=p[a];$=$.substring(0,r)+$.substring(Q0)}}let F0=j1($,Z);if(F0.hasScoped)$=F0.html;let c=Q.__stx_event_bindings||[],Z0=!1,t=[],g=/\s:[a-z][\w.-]*\s*=/.test($),{scanScriptTags:d}=await import("././signal-processing.js");for(let f of d($,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))t.push({match:f.fullMatch,attrs:f.attrs,content:f.body});for(let{match:f,attrs:P,content:p}of t){Z0=!0;let a=p;r1(p,Z,X.strict);let r=await H1(p,{eventBindings:c,attrs:P,hasColonDirectives:g,templateContent:Y,filePath:Z,projectRoot:process.cwd(),production:X.buildMode==="compile",serverData:b});$=$.replace(f,()=>r)}if(Z0)Q.__stx_event_bindings=[];return $}var g0=new o0(500),c6=0;function J5(Y){return Y.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function i6(Y){return/\bjs\b/.test(Y)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test(Y)}function T0(Y){return!i6(Y)}function I0(Y){try{let Q=Y.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");Q=Q.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");let Z=[];Q=Q.replace(/\{!![\s\S]*?!!\}/g,($)=>{let z=Z.length;return Z.push($),`"__STX_EXPR_${z}__"`}),Q=Q.replace(/\{\{\{[\s\S]*?\}\}\}/g,($)=>{let z=Z.length;return Z.push($),`"__STX_EXPR_${z}__"`}),Q=Q.replace(/\{\{[\s\S]*?\}\}/g,($)=>{let z=Z.length;return Z.push($),`"__STX_EXPR_${z}__"`});let J=new Bun.Transpiler({loader:"ts",target:"browser",define:z5()}).transformSync(Q);for(let $=0;$<Z.length;$++)J=J.replace(`"__STX_EXPR_${$}__"`,Z[$]),J=J.replace(`'__STX_EXPR_${$}__'`,Z[$]);return J}catch(Q){if(process.env.STX_DEBUG_TS)console.warn("[STX] TypeScript transpilation error:",Q);return Y}}function p6(Y){let Q=[],Z=new Set,X=0,J=0,$=Y.length,z=(K)=>{J++;while(J<$){if(Y[J]==="\\"){J+=2;continue}if(Y[J]===K){J++;return}J++}},G=()=>{J++;while(J<$){if(Y[J]==="\\"){J+=2;continue}if(Y[J]==="`"){J++;return}if(Y[J]==="$"&&Y[J+1]==="{"){J+=2;let K=1;while(J<$&&K>0)if(Y[J]==="{")K++,J++;else if(Y[J]==="}")K--,J++;else if(Y[J]==="'"||Y[J]==='"')z(Y[J]);else if(Y[J]==="`")G();else J++;continue}J++}},U=()=>{if(Y[J]==="/"&&Y[J+1]==="/"){while(J<$&&Y[J]!==`
|
|
1425
|
-
`)J++;return!0}if(Y[J]==="/"&&Y[J+1]==="*"){J+=2;while(J<$-1&&!(Y[J]==="*"&&Y[J+1]==="/"))J++;return J+=2,!0}return!1},_=()=>{if(X!==0)return;let K=Y.slice(J).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(K){let H=K[2].split(",").map((L)=>{let O=L.trim().split(":");return O[O.length-1].trim()});for(let L of H)if(L&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(L)&&!Z.has(L))Q.push(L),Z.add(L);return}let j=Y.slice(J).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(j){let H=j[2];if(!Z.has(H))Q.push(H),Z.add(H);return}let W=Y.slice(J).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(W){let H=W[1];if(!Z.has(H))Q.push(H),Z.add(H);return}let q=Y.slice(J).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(q){let H=q[1];if(!Z.has(H))Q.push(H),Z.add(H)}};while(J<$){if(U())continue;if(Y[J]==="'"||Y[J]==='"'){z(Y[J]);continue}if(Y[J]==="`"){G();continue}if(Y[J]==="{"){X++,J++;continue}if(Y[J]==="}"){X--,J++;continue}if(X===0&&/[a-z]/i.test(Y[J])&&(J===0||/\s|[;{}()]/.test(Y[J-1])))_();J++}return Q}function s6(Y){let Q=[],Z=0,X=0,J=null;for(let $=0;$<Y.length;$++){let z=Y[$];if(J){if(z==="\\"){$++;continue}if(z===J)J=null;continue}if(z==='"'||z==="'"||z==="`"){J=z;continue}if(z==="("||z==="["||z==="{")Z++;else if(z===")"||z==="]"||z==="}")Z--;else if(z===","&&Z===0)Q.push(Y.slice(X,$)),X=$+1}if(X<Y.length)Q.push(Y.slice(X));return Q}function n6(Y){let Q=0,Z=null;for(let X=0;X<Y.length;X++){let J=Y[X];if(Z){if(J==="\\"){X++;continue}if(J===Z)Z=null;continue}if(J==='"'||J==="'"||J==="`"){Z=J;continue}if(J==="("||J==="["||J==="{")Q++;else if(J===")"||J==="]"||J==="}")Q--;else if(J==="="&&Q===0){let $=Y[X-1],z=Y[X+1];if($==="!"||$==="<"||$===">"||$==="=")continue;if(z==="="||z===">")continue;return X}}return-1}function r6(Y,Q){try{let Z=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec(Y);if(!Z)return;let X=Z.index-1;while(X>=0&&/\s/.test(Y[X]))X--;if(Y[X]!=="}")return;let J=X,$=0,z=-1;for(;X>=0;X--){let U=Y[X];if(U==="}")$++;else if(U==="{"){if($--,$===0){z=X;break}}}if(z===-1)return;let G=Y.slice(z+1,J);for(let U of s6(G)){let _=U.trim();if(!_||_.startsWith("..."))continue;let K=n6(_);if(K===-1)continue;let j=_.slice(0,K).trim();if(!/^[A-Z_$][\w$]*$/i.test(j))continue;if(Q[j]!==void 0)continue;let W=_.slice(K+1).trim();if(!W)continue;try{let q=Object.keys(Q),H=Function(...q,`"use strict"; return (${W});`);Q[j]=H(...q.map((L)=>Q[L]))}catch{}}}catch{}}async function _4(Y,Q,Z,X,J){let $=Y.endsWith(".stx")?Y.slice(0,-4):Y,z=(O)=>O.split("-").map((V)=>V.charAt(0).toUpperCase()+V.slice(1)).join(""),G=(O)=>O.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),U=Z.__importedComponents;if(U){for(let O of[$,$.toLowerCase(),z($),G($)])if(U.has(O))return!0}let _=[...new Set([`${$}.stx`,`${z($)}.stx`,`${G($)}.stx`])],K=typeof J.root==="string"?S.resolve(J.root):void 0,j=K??S.dirname(X),W=[],q=(O)=>{if(O&&!W.includes(O))W.push(O)},H=Z.__originalFilePath;if(H)q(S.join(S.dirname(H),"components"));q(Q),q(S.join(S.dirname(X),"components")),q(J.componentsDir);let L=J._pluginComponentDirs;if(Array.isArray(L))for(let O of L)q(typeof O==="string"?O:null);if(K)q(S.resolve(K,"resources/views/components")),q(S.resolve(K,"resources/components")),q(S.resolve(K,"src/components")),q(S.resolve(K,"components"));if($.startsWith("./")||$.startsWith("../"))return x(S.resolve(S.dirname(X),`${$}.stx`));for(let O of W){let V=S.isAbsolute(O)?O:S.resolve(j,O);for(let B of _)if(await x(S.join(V,B)))return!0}return!1}function a6(Y){return Y==="visible"||Y==="idle"||Y==="interaction"||Y.startsWith("media:")}async function B0(Y,Q,Z,X,J,$,z,G=new Set,U){let{extractVariables:_}=await import("././variable-extractor.js"),K=G??new Set;if(K.has(Y))return`[Circular component reference: ${Y}]`;let j=new Set(K);j.add(Y);let W=typeof Q.client==="string"?Q.client.trim():"";if("client"in Q)delete Q.client;let q=W&&W!=="load"&&a6(W)?W:"";try{let H=(g)=>g.split("-").map((d)=>d.charAt(0).toUpperCase()+d.slice(1)).join(""),L=(g)=>g.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),O=Y.endsWith(".stx")?Y.slice(0,-4):Y,V=null,B=J.__importedComponents;if(B){let g=[O,O.toLowerCase(),H(O),L(O)];for(let d of g)if(B.has(d)){V=B.get(d);break}}let A=[];if(!V){let g=[`${O}.stx`,`${H(O)}.stx`,`${L(O)}.stx`],d=[...new Set(g)],f=J.__originalFilePath,P=[];if(f){let o=S.join(S.dirname(f),"components");P.push(o)}if(X)P.push(X);let p=S.join(S.dirname($),"components");if(!P.includes(p))P.push(p);if(z.componentsDir&&z.componentsDir!==X&&!P.includes(z.componentsDir))P.push(z.componentsDir);let a=z._pluginComponentDirs;if(Array.isArray(a)){for(let o of a)if(typeof o==="string"&&!P.includes(o))P.push(o)}let r=typeof z.root==="string"?S.resolve(z.root):void 0,Q0=r??S.dirname($),K0=[];if(r)K0.push(S.resolve(r,"resources/views/components")),K0.push(S.resolve(r,"resources/components")),K0.push(S.resolve(r,"src/components")),K0.push(S.resolve(r,"components"));K0.push(S.resolve(import.meta.dir,"components"));for(let o of K0)if(!P.includes(o))P.push(o);let b0=[...new Set(P.map((o)=>{if(!o)return o;return S.isAbsolute(o)?o:S.resolve(Q0,o)}))];if(P.length=0,P.push(...b0),O.startsWith("./")||O.startsWith("../"))V=S.resolve(S.dirname($),`${O}.stx`),A.push(V);else for(let o of P){if(!o)continue;for(let h0 of d){let d0=S.join(o,h0);if(A.push(d0),await x(d0)){V=d0;break}}if(V)break;if(!V)try{let h0=await import("fs");if(!h0.statSync(o,{throwIfNoEntry:!1})?.isDirectory())continue;let K5=8,_1=[{path:o,depth:0}];while(_1.length>0&&!V){let m0=_1.pop();if(m0.depth>=K5)continue;let e1;try{e1=h0.readdirSync(m0.path,{withFileTypes:!0})}catch{continue}for(let u0 of e1){if(!u0.isDirectory())continue;if(u0.name==="node_modules"||u0.name.startsWith("."))continue;let t1=S.join(m0.path,u0.name);for(let q5 of d){let W1=S.join(t1,q5);if(A.push(W1),await x(W1)){V=W1;break}}if(V)break;_1.push({path:t1,depth:m0.depth+1})}}}catch{}if(V)break}}if(!V||!await x(V)){let g=A.length>0?`
|
|
1426
|
-
Searched paths:
|
|
1427
|
-
${A.map((d)=>` - ${d}`).join(`
|
|
1428
|
-
`)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${Y}']${g}`}U.add(V);let w;if(g0.has(V))w=g0.get(V);else try{w=await Bun.file(V).text(),g0.set(V,w)}catch(g){return`[Error loading component: ${g instanceof Error?g.message:String(g)}]`}let F=new Set(["__originalFilePath","__importedComponents"]),k={};for(let[g,d]of Object.entries(J))if(!g.startsWith("__")||F.has(g))k[g]=d;let T={...k,...Q,props:Q,slot:Z,__processedComponents:j,__sections:{}};r6(w,T);let I=w,R=I.match(/<template\b(?![^>]*\b(?:id|x-for|x-if|@for|@if|:for|:if)\s*=)[^>]*>([\s\S]*?)<\/template>/i);if(R)I=R[1].trim();let N=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,D=[...w.matchAll(N)],E=[];for(let g of D){let d=g[1]||"",f=g[2]||"",P=d.includes("server");if(T0(d)&&f.trim())f=I0(f);if(P&&f)try{await _(f,T,V)}catch(a){}if(!P){let a=f.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,"");if(a.includes("{{")&&a.includes("}}"))a=_0(a,T,V);let r=d.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");E.push(`<script${r}>${a}</script>`)}}let M=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),y=M?M[1]:"",b=M?M[2]:"",C="",l=y&&/\bscoped\b/i.test(y);if(M)C=`<style${y}>${b}</style>`;let v=I;if(v=v.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),M)v=v.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let g=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,d=[];if(v=v.replace(g,(f,P)=>{let p=P.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(p)d.push(`<style${p[1]}>${p[2]}</style>`);return""}),v=v.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),d.length>0)C=`${C}${d.join(`
|
|
1429
|
-
`)}`}if(Z&&v.includes("{{ text || slot }}"))v=v.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>Z);let{extractSlotContent:u,applySlots:n}=await import("././slots.js"),{defaultSlot:O0,namedSlots:y0}=u(Z);v=await n(v,O0||Z,y0,T);for(let[g,d]of Object.entries(T))if(typeof d==="string"){if(d.includes("<")&&d.includes(">")||d.includes("<")||d.includes(""")){let f=X3(d);T[g]=f}}let V0=E.some((g)=>/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test(g)),F0={...z,componentsDir:S.dirname(V),skipSignalsRuntime:!0,skipEventDirectives:V0,defaultLayout:void 0};T.__stxProcessingDepth=(J.__stxProcessingDepth||0)+1;let c=await a1(v,T,V,F0,U),Z0=`stx_${O.replace(/[^a-zA-Z0-9]/g,"_")}_${++c6}_${Math.random().toString(36).slice(2,8)}`,t=c;if(V0){let g="";if(Object.keys(Q).length>0)try{g=` data-stx-props="${J5(JSON.stringify(Q))}"`}catch{}let d=q?` stx-hydrate="${J5(q)}"`:"";if(t=`<div data-stx-scope="${Z0}"${g}${d}>${c}</div>`,t=E.map((P)=>{let p=P.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!p)return P;let[,a,r]=p,Q0=W0(r),K0=`
|
|
1430
|
-
(function() {
|
|
1431
|
-
const { state, derived, effect, batch, defineEmits, defineExpose, defineSlots, defineProps, withDefaults, useStore, useFetch, useRef, useQuery, useMutation, useOptimistic, useDebounce, useDebouncedValue, useThrottle, useInterval, useTimeout, useToggle, useCounter, useClickOutside, useFocus, useAsync, useLocalStorage, useSessionStorage, useCookie, useReactiveProp, useEventListener, useWebSocket, useColorMode, useDark, useHead, useSeoMeta, definePageMeta, useRoute, useSearchParams, navigate, goBack, goForward, provide, inject, ref, reactive, computed, watch, watchEffect, nextTick } = window.stx;
|
|
1432
|
-
const __scope = window.stx._scopes = window.stx._scopes || {};
|
|
1433
|
-
const __scopeVars = __scope['${Z0}'] = __scope['${Z0}'] || {};
|
|
1434
|
-
|
|
1435
|
-
// Scope-specific lifecycle callbacks
|
|
1436
|
-
__scopeVars.__mountCallbacks = __scopeVars.__mountCallbacks || [];
|
|
1437
|
-
__scopeVars.__destroyCallbacks = __scopeVars.__destroyCallbacks || [];
|
|
1438
|
-
const onMount = (fn) => __scopeVars.__mountCallbacks.push(fn);
|
|
1439
|
-
const onDestroy = (fn) => __scopeVars.__destroyCallbacks.push(fn);
|
|
1440
|
-
|
|
1441
|
-
${Q0}
|
|
1442
|
-
|
|
1443
|
-
// Register all defined signals and functions in this scope
|
|
1444
|
-
const __localVars = {};
|
|
1445
|
-
try {
|
|
1446
|
-
${p6(Q0).map((b0)=>`if (typeof ${b0} !== 'undefined') __localVars['${b0}'] = ${b0};`).join(`
|
|
1447
|
-
`)}
|
|
1448
|
-
}
|
|
1449
|
-
catch (e) {}
|
|
1450
|
-
Object.assign(__scopeVars, __localVars);
|
|
1451
|
-
})();`;if(q)return`<script type="stx/island" data-stx-island="${Z0}" data-stx-scoped${a}>${K0}</script>`;return`<script data-stx-scoped${a}>${K0}</script>`}).join(`
|
|
1452
|
-
`)+`
|
|
1453
|
-
`+t,C)t+=`
|
|
1454
|
-
`+C}else{if(C)t+=`
|
|
1455
|
-
`+C;if(E.length>0){let g=T.__stx_event_bindings||[],d=q1(T),f=await Promise.all(E.map(async(P)=>{let p=P.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!p)return P;return await H1(p[1],{eventBindings:g,templateContent:t,filePath:V,projectRoot:process.cwd(),serverData:d})}));t+=`
|
|
1456
|
-
`+f.join(`
|
|
1457
|
-
`),T.__stx_event_bindings=[]}}if(l){let g=j1(t,V);if(g.hasScoped)t=g.html}return t}catch(H){return`[Error processing component: ${H instanceof Error?H.message:String(H)}]`}finally{K.delete(Y)}}async function x(Y){return Bun.file(Y).exists()}function o1(Y,Q){let Z=S.resolve(Q),X=S.resolve(Y),J=Z.endsWith(S.sep)?Z:Z+S.sep;if(X===Z||X.startsWith(J))return X;return null}async function n0(Y,Q,Z,X){let J=await o6(Y,Q,Z,X);if(J===null)return null;let $=o1(J,process.cwd());if($)return $;let z=[Z.root,Z.layoutsDir,Z.componentsDir,Z.partialsDir,Z.pagesDir].filter((G)=>typeof G==="string"&&G.length>0);for(let G of z){let U=S.isAbsolute(G)?G:S.resolve(process.cwd(),G);if(o1(J,U))return S.resolve(J)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${J} (template: ${Y}, from: ${Q})`),null}async function o6(Y,Q,Z,X){if(Z.debug)console.log(`Resolving template path: ${Y} from ${Q}`);let J=S.dirname(Q),$=process.cwd();if(Y.startsWith("/")){let W=S.join($,Y),q=o1(W,$);if(!q)return console.warn(`[stx] rejected template path that escapes project root: ${Y} (from ${Q})`),null;if(Z.debug)console.log(`Checking absolute path: ${q}`);if(await x(q)&&X)X.add(q);return q}let z=S.join(J,Y);if(await x(z)){if(Z.debug)console.log(`Found direct path: ${z}`);if(X)X.add(z);return z}if(!Y.endsWith(".stx")&&!Y.endsWith(".jsx")&&!Y.endsWith(".tsx"))for(let W of[".stx",".tsx",".jsx"]){let q=`${z}${W}`;if(await x(q)){if(Z.debug)console.log(`Found direct path with extension: ${q}`);if(X)X.add(q);return q}}let G="",U=S.resolve(J),_=process.cwd();for(let W=0;W<10;W++){let q=S.join(U,"layouts"),H=!1;try{H=l6.statSync(q,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(H){G=q;break}let L=S.dirname(U);if(L===U||L.length<_.length)break;U=L}if(G){let W=Y.startsWith("layouts/")?Y.slice(8):Y,q=S.join(G,W);if(await x(q)){if(Z.debug)console.log(`Found in current layouts dir: ${q}`);if(X)X.add(q);return q}if(!W.endsWith(".stx")){let H=`${q}.stx`;if(await x(H)){if(Z.debug)console.log(`Found in current layouts dir with extension: ${H}`);if(X)X.add(H);return H}}}if(Z.layoutsDir){let W=S.isAbsolute(Z.layoutsDir)?Z.layoutsDir:S.resolve(process.cwd(),Z.layoutsDir),q=Y.startsWith("layouts/")?Y.slice(8):Y,H=S.join(W,q);if(await x(H)){if(Z.debug)console.log(`Found in options.layoutsDir: ${H}`);if(X)X.add(H);return H}if(!Y.endsWith(".stx")){let L=`${H}.stx`;if(await x(L)){if(Z.debug)console.log(`Found in options.layoutsDir with extension: ${L}`);if(X)X.add(L);return L}}}if(Y.startsWith("layouts/")||Y.includes("/layouts/")){let W=Y.split("layouts/"),q=S.join(Z.partialsDir||J,"layouts",W[1]);if(await x(q)){if(Z.debug)console.log(`Found in layouts path: ${q}`);if(X)X.add(q);return q}if(!q.endsWith(".stx")){let H=`${q}.stx`;if(await x(H)){if(Z.debug)console.log(`Found in layouts path with extension: ${H}`);if(X)X.add(H);return H}}}if(Z.partialsDir){if(G=S.join(Z.partialsDir,"layouts"),await x(G)){let W=S.join(G,Y);if(await x(W)){if(Z.debug)console.log(`Found in partials layouts dir: ${W}`);if(X)X.add(W);return W}if(!Y.endsWith(".stx")){let q=`${W}.stx`;if(await x(q)){if(Z.debug)console.log(`Found in partials layouts dir with extension: ${q}`);if(X)X.add(q);return q}}}}let K=Z.partialsDir||S.join(process.cwd(),"views"),j=S.join(K,Y);if(await x(j)){if(Z.debug)console.log(`Found in views path: ${j}`);if(X)X.add(j);return j}if(!Y.endsWith(".stx")){let W=`${j}.stx`;if(await x(W)){if(Z.debug)console.log(`Found in views path with extension: ${W}`);if(X)X.add(W);return W}}if(J.includes("temp")){let W=S.join(S.dirname(J),"layouts",Y);if(await x(W)){if(Z.debug)console.log(`Found in temp layouts dir: ${W}`);if(X)X.add(W);return W}if(!Y.endsWith(".stx")){let q=`${W}.stx`;if(await x(q)){if(Z.debug)console.log(`Found in temp layouts dir with extension: ${q}`);if(X)X.add(q);return q}}}if(Z.debug)console.warn(`Template not found after trying all paths: ${Y} (referenced from ${Q})`);else console.warn(`Template not found: ${Y} (referenced from ${Q})`);return null}function G5(Y,Q,Z){let X=0,J="",$="";try{if(typeof Q==="number"&&Q>=0){let z=Y.split(`
|
|
1458
|
-
`),G=0;for(let U=0;U<z.length;U++)if(G+=z[U].length+1,G>=Q){X=U+1,J=z[U].trim();let _=Math.max(0,U-2),K=Math.min(z.length,U+3);$=z.slice(_,K).map((j,W)=>{let q=_+W+1;return`${q===X?"> ":" "}${q}: ${j}`}).join(`
|
|
1459
|
-
`);break}}else if(Z){let z=Y.indexOf(Z);if(z>=0)return G5(Y,z)}}catch{}return{lineNumber:X,lineContent:J,context:$}}var m={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgYellow:"\x1B[43m"};function i(Y,Q,Z,X,J,$){let{lineNumber:z,context:G}=G5(X,J,$),U=Z.split("/").pop(),_=0;if(typeof J==="number"&&J>=0&&X){let j=X.lastIndexOf(`
|
|
1460
|
-
`,Math.max(0,J-1));_=J-(j+1)+1}let K="";if(z>0)K+=`
|
|
1461
|
-
${Z}:${z}${_>0?`:${_}`:""}: ${Y.toLowerCase()} error: ${Q}
|
|
1462
|
-
`;if(K+=`
|
|
1463
|
-
${m.bold}${m.red}\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E${m.reset}
|
|
1464
|
-
`,K+=`${m.bold}${m.red}\u2502${m.reset} ${m.bold}${m.bgRed} ERROR ${m.reset} ${m.red}${Y} Error${m.reset}${" ".repeat(Math.max(0,43-Y.length))}${m.bold}${m.red}\u2502${m.reset}
|
|
1465
|
-
`,K+=`${m.bold}${m.red}\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F${m.reset}
|
|
1466
|
-
`,K+=`
|
|
1467
|
-
${m.cyan}${m.bold}File:${m.reset} ${m.dim}${U}${m.reset}`,z>0)K+=` ${m.gray}(line ${z}${_>0?`, col ${_}`:""})${m.reset}`;if(K+=`
|
|
1468
|
-
${m.yellow}${m.bold}Message:${m.reset} ${Q}
|
|
1469
|
-
`,G)K+=`
|
|
1470
|
-
${m.blue}${m.bold}Context:${m.reset}
|
|
1471
|
-
${m.dim}${G}${m.reset}
|
|
1472
|
-
`;return K}function Z$(){g0.clear()}function X$(){return{size:g0.size,maxSize:500}}var e6=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function t6(Y){if(Y.startsWith(".")||Y.startsWith("/"))return null;if(Y.startsWith("@")){let Z=Y.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!Z)return null;return{pkg:Z[1],subpath:Z[2]||""}}let Q=Y.match(/^([^/]+)(\/.*)?$/);if(!Q)return null;return{pkg:Q[1],subpath:Q[2]||""}}function Y7(Y,Q){let Z=Q;while(!0){let X=N0.join(Z,"node_modules",Y,"package.json");if(x0.existsSync(X))return N0.dirname(X);let J=N0.dirname(Z);if(J===Z)return null;Z=J}}function $7(Y,Q){if(!Y||typeof Y!=="object")return null;let Z=(J)=>{if(typeof J==="string")return J;if(J&&typeof J==="object"){if(typeof J.import==="string")return J.import;if(typeof J.default==="string")return J.default;if(typeof J.import==="object")return Z(J.import);if(typeof J.default==="object")return Z(J.default)}return null};if(Object.prototype.hasOwnProperty.call(Y,Q))return Z(Y[Q]);let X=null;for(let J of Object.keys(Y)){let $=J.indexOf("*");if($===-1)continue;let z=J.slice(0,$),G=J.slice($+1);if(!Q.startsWith(z)||!Q.endsWith(G))continue;if(Q.length<z.length+G.length)continue;if(!X||z.length>X.prefix.length)X={pattern:J,prefix:z,suffix:G}}if(X){let J=Q.slice(X.prefix.length,Q.length-X.suffix.length),$=Z(Y[X.pattern]);if($)return $.replace("*",J)}return null}function Z7(Y,Q){let Z=t6(Y);if(!Z||!Z.subpath)return null;let X=Y7(Z.pkg,Q);if(!X)return null;let J;try{J=JSON.parse(x0.readFileSync(N0.join(X,"package.json"),"utf8"))}catch{return null}let $=`.${Z.subpath}`,z=$7(J.exports,$);if(!z)return null;let G=N0.resolve(X,z);return x0.existsSync(G)?G:null}function X7(Y,Q){let Z=Q.filePath?N0.dirname(Q.filePath):Q.projectRoot||process.cwd(),X=Q.projectRoot||process.cwd(),J=new Set,$=[];return{code:Y.replace(e6,(G,U)=>{let _;try{if(U.startsWith("./")||U.startsWith("../")||U.startsWith("/")){if(_=U.startsWith("/")?U:N0.resolve(Z,U),!x0.existsSync(_))throw Error(`file not found: ${_}`)}else{let K=null;try{K=Bun.resolveSync(U,X)}catch{K=Z7(U,X)}if(!K)throw Error(`could not resolve ${U} (Bun.resolveSync + exports fallback both failed)`);_=K}}catch(K){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(U)} (from ${Q.filePath||"<unknown>"}): ${K?.message||K}`),""}if(J.has(_))return"";J.add(_);try{let K=x0.readFileSync(_,"utf8");$.push({source:U,resolvedPath:_,contents:K})}catch(K){console.warn(`[stx:vendor-css] could not read ${_}: ${K?.message||K}`)}return""}),styles:$}}function Q7(Y){return Y.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function J7(Y){if(Y.length===0)return"";return`${Y.map((Q)=>{return`<style data-stx-vendor="${Q7(Q.source)}" data-stx-layer="vendor">
|
|
1473
|
-
@layer vendor {
|
|
1474
|
-
${Q.contents}
|
|
1475
|
-
}
|
|
1476
|
-
</style>`}).join(`
|
|
1477
|
-
`)}
|
|
1478
|
-
`}var z7=["state","derived","effect","batch","untrack","peek","isSignal","isDerived","onMount","onDestroy","useRef","navigate","goBack","goForward","useRoute","setRouteParams","useSearchParams","useFetch","useQuery","useMutation","useOptimistic","useReactiveProp","useLocalStorage","useSessionStorage","useCookie","useWebSocket","useHead","useSeoMeta","definePageMeta","useEventListener","useMeta","useDebounce","useDebouncedValue","useThrottle","useInterval","useTimeout","useToggle","useCounter","useClickOutside","useFocus","useAsync","useColorMode","useDark","ref","reactive","computed","watch","watchEffect","watchMultiple","onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","defineProps","withDefaults","defineEmits","defineExpose","defineSlots","provide","inject","nextTick","getCurrentInstance","onErrorCaptured","useSlots","useAttrs","createStore","defineStore","useStore","action","createSelector","h","Fragment"],G7=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser"],U7=new Set(["Promise","Object","Array","Map","Set","Date","Error","JSON","Math","Number","String","RegExp","Symbol","WeakMap","WeakSet","Proxy","Reflect","Intl","URL","URLSearchParams","FormData","Headers","Request","Response","AbortController","EventTarget","Element","Document","Node","Window","Console","Storage","Navigator","Blob","File","FileReader","HTMLElement","SVGElement","Event","CustomEvent","DOMParser","XMLSerializer","WebSocket","Worker","SharedWorker","IntersectionObserver","MutationObserver","ResizeObserver","PerformanceObserver","Notification","Bun","Buffer","Process","Modal","Intl"]);function K7(Y){let Q=new Set,Z=/\b([A-Z][a-zA-Z0-9]*)\s*\.\s*(all|find|first|get|where|orderBy|orderByDesc|limit|select|pluck|create|update|delete)\s*\(/g,X;while((X=Z.exec(Y))!==null)if(!U7.has(X[1]))Q.add(X[1]);return Array.from(Q)}function q7(Y){let Q=new Set,Z=new Set,X=Y;X=X.replace(/^\s*import\s+type\s+\{[^}]*\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm,"// [type import stripped]");let J=new Set,$=/^\s*import\s+(?:type\s+)?{\s*([^}]+)\s*}\s+from\s+['"](@stacksjs\/browser|stx)['"]\s*;?\s*$/gm,z;while((z=$.exec(Y))!==null){let U=z[1],_=z[2];if(z[0].includes("import type"))continue;U.split(",").map((j)=>j.trim().split(/\s+as\s+/)[0]).filter((j)=>j.length>0).forEach((j)=>{if(J.add(j),_==="stx")Q.add(j);else Z.add(j)}),X=X.replace(z[0],"// [auto-import processed]")}for(let U of z7){if(J.has(U))continue;if(new RegExp(`\\b${U}\\s*\\(`,"g").test(X))Q.add(U)}for(let U of G7){if(J.has(U))continue;if(new RegExp(`\\b${U}\\b`,"g").test(X))Z.add(U)}let G=K7(X);for(let U of G)if(!J.has(U))Z.add(U);return{code:X,stxImports:Array.from(Q),browserImports:Array.from(Z)}}function H7(Y,Q){let Z=[];if(Y.length>0)Z.push(` var { ${Y.join(", ")} } = window.stx || window;`);if(Q.length>0)Z.push(` var { ${Q.join(", ")} } = window.StacksBrowser || {};`);if(Z.length>0)return` // STX: auto-imported from stx and @stacksjs/browser
|
|
1479
|
-
${Z.join(`
|
|
1480
|
-
`)}
|
|
1481
|
-
`;return""}function q1(Y){let Q={};for(let Z in Y){if(Z.startsWith("__")||Z.startsWith("$"))continue;let X=Y[Z];if(typeof X==="function")continue;Q[Z]=X}return Q}function M1(Y,Q){if(!Q)return"";let Z=[];for(let[X,J]of Object.entries(Q)){if(!/^[A-Za-z_$][\w$]*$/.test(X))continue;if(!new RegExp(`\\b${X}\\b`).test(Y))continue;if(new RegExp(`(?:const|let|var|function|class)\\s+${X}\\b`).test(Y))continue;let $;try{$=JSON.stringify(J)}catch{continue}if($===void 0)continue;Z.push(` var ${X} = ${$.replace(/</g,"\\u003c")};`)}if(Z.length===0)return"";return` // stx: server -> client data bridge (seeded from server scope)
|
|
1482
|
-
${Z.join(`
|
|
1483
|
-
`)}
|
|
1484
|
-
`}var j7={left:0,middle:1,right:2};function _7(Y){let Q=[];if(Y.self)Q.push("if ($event.target !== $el) return");for(let Z of Y.systemKeys)Q.push(`if (!$event.${Z}Key) return`);if(Y.keys.length>0){let Z=Y.keys.map((X)=>`$event.key === '${X}'`).join(" || ");Q.push(`if (!(${Z})) return`)}if(Y.mouse!==null){let Z=j7[Y.mouse];Q.push(`if ($event.button !== ${Z}) return`)}if(Y.prevent)Q.push("$event.preventDefault()");if(Y.stop)Q.push("$event.stopPropagation()");return Q.join("; ")}function W7(Y,Q){let{elementId:Z,event:X,handler:J,modifiers:$}=Y,z=_7($),G=[];if($.once)G.push("once: true");if($.capture)G.push("capture: true");if($.passive)G.push("passive: true");let U=G.length>0?`, { ${G.join(", ")} }`:"",_="";if(z)_+=`${z}; `;let K=J.replace(/\\/g,"\\\\").replace(/'/g,"\\'");function j(W){return`var scope = $el.closest('[data-stx-scope]');
|
|
1485
|
-
if (scope && scope.__stx_execute) {
|
|
1486
|
-
scope.__stx_execute('${K}', $event, $el);
|
|
1487
|
-
}
|
|
1488
|
-
else {
|
|
1489
|
-
${W}
|
|
1490
|
-
}`}if($.debounce!==null)return` ;(function() {
|
|
1491
|
-
// eslint-disable-next-line pickier/no-unused-vars
|
|
1492
|
-
var $el = document.getElementById('${Z}')
|
|
1493
|
-
if (!$el) return
|
|
1494
|
-
var __timer
|
|
1495
|
-
$el.addEventListener('${X}', function($event) {
|
|
1496
|
-
${z?z+"; ":""}clearTimeout(__timer)
|
|
1497
|
-
__timer = setTimeout(function() { ${j(J)} }, ${$.debounce})
|
|
1498
|
-
}${U})
|
|
1499
|
-
})()`;if($.throttle!==null)return` ;(function() {
|
|
1500
|
-
// eslint-disable-next-line pickier/no-unused-vars
|
|
1501
|
-
var $el = document.getElementById('${Z}')
|
|
1502
|
-
if (!$el) return
|
|
1503
|
-
var __last = 0
|
|
1504
|
-
$el.addEventListener('${X}', function($event) {
|
|
1505
|
-
${z?z+"; ":""}var __now = Date.now()
|
|
1506
|
-
if (__now - __last >= ${$.throttle}) {
|
|
1507
|
-
__last = __now
|
|
1508
|
-
${j(J)}
|
|
1509
|
-
}
|
|
1510
|
-
}${U})
|
|
1511
|
-
})()`;return` var $el = document.getElementById('${Z}')
|
|
1512
|
-
if ($el) $el.addEventListener('${X}', function($event) {
|
|
1513
|
-
${_}var scope = $el.closest('[data-stx-scope]');
|
|
1514
|
-
if (scope && scope.__stx_execute) {
|
|
1515
|
-
scope.__stx_execute('${K}', $event, $el);
|
|
1516
|
-
}
|
|
1517
|
-
else {
|
|
1518
|
-
${J}
|
|
1519
|
-
}
|
|
1520
|
-
}${U})`}function L7(Y){if(Y.length===0)return"";return`
|
|
1521
|
-
// STX: auto-generated event bindings
|
|
1522
|
-
${Y.map((Z,X)=>W7(Z,X)).join(`
|
|
1523
|
-
`)}`}function U5(Y){let Q=[],Z=new Set,X=Y.replace(/^\s*import\s+.*$/gm,""),J=0,$=X.length,z=0;while(z<$){let G=X[z];if(G==="'"||G==='"'||G==="`"){let U=G;if(z++,U==="`"){let _=0;while(z<$){if(X[z]==="\\"){z+=2;continue}if(X[z]==="`"&&_===0){z++;break}if(X[z]==="$"&&X[z+1]==="{"){_++,z+=2;continue}if(X[z]==="}"&&_>0){_--,z++;continue}z++}}else while(z<$){if(X[z]==="\\"){z+=2;continue}if(X[z]===U){z++;break}z++}continue}if(G==="/"&&X[z+1]==="/"){while(z<$&&X[z]!==`
|
|
1524
|
-
`)z++;continue}if(G==="/"&&X[z+1]==="*"){z+=2;while(z<$-1&&!(X[z]==="*"&&X[z+1]==="/"))z++;z+=2;continue}if(G==="{"){J++,z++;continue}if(G==="}"){J--,z++;continue}if(J===0){let U=X.slice(z),_=U.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(_){let W=_[1];if(!W.startsWith("_")&&!Z.has(W))Q.push(W),Z.add(W);z+=_[0].length;continue}let K=U.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(K){K[1].split(",").forEach((W)=>{let q=W.trim(),H=q.indexOf(":"),L=H>=0?q.slice(H+1).trim().split(/[\s=]/)[0]:q.split(/[\s=]/)[0];if(L&&!L.startsWith("_")&&!Z.has(L))Q.push(L),Z.add(L)}),z+=K[0].length;continue}let j=U.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(j){let W=j[1];if(!W.startsWith("_")&&!Z.has(W))Q.push(W),Z.add(W);z+=j[0].length;continue}}z++}return Q}var B7=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function O7(Y){let Q=new Set,Z=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function X(W){let q;while((q=Z.exec(W))!==null){let H=q[0];if(!B7.has(H))Q.add(H)}}let J=/\{\{([\s\S]*?)\}\}/g,$;while(($=J.exec(Y))!==null)X($[1]);let z=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while(($=z.exec(Y))!==null)X($[1]);let G=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while(($=G.exec(Y))!==null)X($[1]);let U=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while(($=U.exec(Y))!==null)X($[1]);let _=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while(($=_.exec(Y))!==null)X($[1]);let K=/@model\s*=\s*["']([^"']*)["']/gi;while(($=K.exec(Y))!==null)X($[1]);let j=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while(($=j.exec(Y))!==null)X($[1]);return Q}async function H1(Y,Q={}){let Z=Y,X="",J=!1,$=X7(Z,{filePath:Q.filePath,projectRoot:Q.projectRoot});Z=$.code;let z=J7($.styles),{hasUserImports:G,bundleClientScript:U}=await import("././client-script-bundler.js");if(G(Z))console.log("[stx:bundler] user imports detected, bundling..."),Z=await U(Z,Q.filePath||"",{projectRoot:Q.projectRoot,minify:Q.production}),J=!0;if(Q.autoImports!==!1){let O=q7(Z);Z=O.code,X=H7(O.stxImports,O.browserImports)}if(X=`${M1(Z,Q.serverData)}${X}`,Z=W0(Z),!J&&T0(Q.attrs||""))Z=I0(Z);let _=L7(Q.eventBindings||[]),K=(Q.attrs||"").trim();if(/\btype\s*=\s*["']module["']/i.test(K)){let O=K.replace(/\btype\s*=\s*["']module["']/i,"").trim(),V=`type="module" data-stx-scoped${O?` ${O}`:""}`;return`${z}<script ${V}>
|
|
1525
|
-
${X}${Z}
|
|
1526
|
-
${_}
|
|
1527
|
-
</script>`}let W=/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect|useLocalStorage|useSessionStorage|useRef|useEventListener|useFetch|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|batch|untrack|peek)\s*(?:<[^>]*>)?\s*\(/.test(Y),q=/function __stx_setup_/.test(Z),H=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(Y);function L(O){let V=O.length>0?`
|
|
1528
|
-
return { ${O.join(", ")} };`:"";return`${z}<script data-stx-scoped>
|
|
1529
|
-
window.stx.mount(function() {
|
|
1530
|
-
'use strict';
|
|
1531
|
-
${X}${Z}
|
|
1532
|
-
${_}${V}
|
|
1533
|
-
})</script>`}if(!H&&!q){if(W)return L(U5(Y));if(Q.templateContent){let O=U5(Y);if(O.length>0){let V=O7(Q.templateContent);if(O.some((A)=>V.has(A)))return L(O)}}}return`${z}<script data-stx-scoped>
|
|
1534
|
-
;(function() {
|
|
1535
|
-
'use strict';
|
|
1536
|
-
${X}${Z}
|
|
1537
|
-
${_}
|
|
1538
|
-
})()</script>`}
|
|
1539
|
-
export{X7 as du,J7 as eu,q1 as fu,M1 as gu,H1 as hu,i0 as iu,j5 as ju,R7 as ku,_5 as lu,T7 as mu,p0 as nu,C0 as ou,W5 as pu,I7 as qu,_0 as ru,L5 as su,q0 as tu,X3 as uu,U3 as vu,K3 as wu,P7 as xu,O1 as yu,S5 as zu,f5 as Au,f7 as Bu,g7 as Cu,x7 as Du,h7 as Eu,d7 as Fu,m7 as Gu,g5 as Hu,x5 as Iu,q3 as Ju,k3 as Ku,m5 as Lu,N3 as Mu,Z9 as Nu,X9 as Ou,G3 as Pu,D5 as Qu,w1 as Ru,c5 as Su,E3 as Tu,J4 as Uu,z4 as Vu,G4 as Wu,J0 as Xu,U4 as Yu,u1 as Zu,l1 as _u,c1 as $u,I6 as av,kY as bv,NY as cv,DY as dv,EY as ev,MY as fv,b6 as gv,i1 as hv,m3 as iv,F9 as jv,b3 as kv,R9 as lv,R1 as mv,T1 as nv,I1 as ov,C3 as pv,v3 as qv,c3 as rv,i3 as sv,p3 as tv,s3 as uv,H6 as vv,j6 as wv,y1 as xv,$4 as yv,Z4 as zv,X4 as Av,R6 as Bv,T6 as Cv,Q4 as Dv,a1 as Ev,i6 as Fv,T0 as Gv,I0 as Hv,_4 as Iv,a6 as Jv,B0 as Kv,x as Lv,n0 as Mv,G5 as Nv,i as Ov,Z$ as Pv,X$ as Qv};
|