@stacksjs/stx 0.2.842 → 0.2.844

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.
Files changed (222) hide show
  1. package/dist/chunk-01gwdj2y.js +2 -0
  2. package/dist/{chunk-321e41ck.js → chunk-02qbawwq.js} +3 -3
  3. package/dist/{chunk-p32n92sy.js → chunk-0q3vkfqt.js} +5 -5
  4. package/dist/chunk-0tse1k5e.js +2 -0
  5. package/dist/{chunk-fstm9dcb.js → chunk-11kp389s.js} +1 -1
  6. package/dist/{chunk-32p5bqy2.js → chunk-1c6kczkt.js} +4 -4
  7. package/dist/chunk-1cdxe8yt.js +2 -0
  8. package/dist/{chunk-2bvjn3jg.js → chunk-1efmkw4t.js} +3 -3
  9. package/dist/{chunk-yffv17js.js → chunk-1h6pb8d1.js} +5 -5
  10. package/dist/{chunk-736q5pgh.js → chunk-2524ayee.js} +6 -6
  11. package/dist/{chunk-7cg2f588.js → chunk-28zze2wm.js} +1 -1
  12. package/dist/{chunk-6wrf6302.js → chunk-2cafvex6.js} +2 -2
  13. package/dist/{chunk-kqpdnbvs.js → chunk-2jwsntc9.js} +1 -1
  14. package/dist/{chunk-8pj4v1eh.js → chunk-2ytaezad.js} +2 -2
  15. package/dist/{chunk-e2dxyxaf.js → chunk-35e3qawb.js} +1 -1
  16. package/dist/{chunk-v3q126ys.js → chunk-3ba0nqwm.js} +2 -2
  17. package/dist/{chunk-wr1werwe.js → chunk-3e1hmm3h.js} +5 -5
  18. package/dist/chunk-3g46mker.js +2 -0
  19. package/dist/chunk-3qstewq3.js +2 -0
  20. package/dist/{chunk-4j08cbjd.js → chunk-3rjgm7qk.js} +5 -5
  21. package/dist/{chunk-y68xstqy.js → chunk-3sskqw4b.js} +1 -1
  22. package/dist/chunk-40r740w1.js +2 -0
  23. package/dist/chunk-469nzheq.js +2 -0
  24. package/dist/{chunk-er5tdp6k.js → chunk-46wqk1fb.js} +3 -3
  25. package/dist/{chunk-fvmd4kk6.js → chunk-47n5s7wk.js} +2 -2
  26. package/dist/{chunk-4y1a7nbm.js → chunk-48vnw9t9.js} +1 -1
  27. package/dist/chunk-54eap9rq.js +2 -0
  28. package/dist/chunk-5fspjf7x.js +42 -0
  29. package/dist/chunk-5hhyqze9.js +2 -0
  30. package/dist/{chunk-m5bj2jnb.js → chunk-5p96rafz.js} +2 -2
  31. package/dist/{chunk-mhyd24bg.js → chunk-5y3m5vzg.js} +2 -2
  32. package/dist/chunk-60jtrz9f.js +2 -0
  33. package/dist/{chunk-a1s5wqw4.js → chunk-69b8mr68.js} +2 -2
  34. package/dist/{chunk-t3p0jy0s.js → chunk-6hb75r07.js} +6 -6
  35. package/dist/chunk-6vcpmt0y.js +2 -0
  36. package/dist/{chunk-wrn3n4b8.js → chunk-71fsg3az.js} +5 -5
  37. package/dist/chunk-76a66cw3.js +2 -0
  38. package/dist/{chunk-wbgc2n04.js → chunk-78q3apyy.js} +2 -2
  39. package/dist/{chunk-jc5y35b7.js → chunk-79wb76ya.js} +1 -1
  40. package/dist/{chunk-694w19gx.js → chunk-7cxbt404.js} +5 -5
  41. package/dist/chunk-7k4npa5e.js +2 -0
  42. package/dist/{chunk-ngnr831a.js → chunk-7s411sa9.js} +5 -5
  43. package/dist/chunk-7xp2ec0v.js +2 -0
  44. package/dist/{chunk-qfvddpcg.js → chunk-87ksn02m.js} +2 -2
  45. package/dist/{chunk-tzd0f95w.js → chunk-8g5dsjr0.js} +6 -6
  46. package/dist/chunk-8nq2snvy.js +2 -0
  47. package/dist/{chunk-7ywzjj7t.js → chunk-8qjf16yr.js} +4 -4
  48. package/dist/chunk-8s27mteq.js +2 -0
  49. package/dist/chunk-8weaawqm.js +2 -0
  50. package/dist/chunk-9hzbqwrp.js +2 -0
  51. package/dist/{chunk-11y84h2d.js → chunk-9mtyxvhk.js} +2 -2
  52. package/dist/{chunk-gtchtap6.js → chunk-9vg3jtzw.js} +6 -6
  53. package/dist/{chunk-w20kjp62.js → chunk-a28rhqq2.js} +4 -4
  54. package/dist/{chunk-q9xzfnpz.js → chunk-a3wv8q6g.js} +16 -16
  55. package/dist/chunk-as6x6be8.js +2 -0
  56. package/dist/chunk-b30fzxwd.js +2 -0
  57. package/dist/{chunk-1m16mvt4.js → chunk-b6qf7w2b.js} +4 -4
  58. package/dist/chunk-bgaq87h6.js +2 -0
  59. package/dist/{chunk-qk079ca7.js → chunk-bqsrtvad.js} +2 -2
  60. package/dist/chunk-bygxt820.js +3 -0
  61. package/dist/chunk-c1vf7qev.js +2 -0
  62. package/dist/{chunk-r65vb67k.js → chunk-c4by7m5b.js} +6 -6
  63. package/dist/{chunk-7t57cnz9.js → chunk-c6yc6qsv.js} +5 -5
  64. package/dist/{chunk-p5x2j3xd.js → chunk-chetq1ce.js} +5 -5
  65. package/dist/{chunk-6dz3k0jc.js → chunk-cwwm14b3.js} +5 -5
  66. package/dist/chunk-d5bjpjbv.js +2 -0
  67. package/dist/chunk-e1vf62ck.js +2 -0
  68. package/dist/{chunk-7rtm7nd1.js → chunk-e3r9fybx.js} +4 -4
  69. package/dist/{chunk-vvv8wyr7.js → chunk-e5seb8f7.js} +2 -2
  70. package/dist/chunk-eq8enrjw.js +2 -0
  71. package/dist/chunk-f1wv2q2z.js +2 -0
  72. package/dist/chunk-f404rga4.js +2 -0
  73. package/dist/{chunk-9xps62ek.js → chunk-fm8gfj2g.js} +2 -2
  74. package/dist/{chunk-a9tzjqny.js → chunk-fs5mshcs.js} +5 -5
  75. package/dist/chunk-fyesbfvr.js +2 -0
  76. package/dist/chunk-gd7vyzhw.js +2 -0
  77. package/dist/chunk-gg63af5n.js +2 -0
  78. package/dist/chunk-gz45xsbg.js +709 -0
  79. package/dist/{chunk-97k72dfh.js → chunk-hc1f1yq8.js} +1 -1
  80. package/dist/chunk-hpw6hq7p.js +2 -0
  81. package/dist/{chunk-ph9f3hwk.js → chunk-hws9yb0b.js} +6 -6
  82. package/dist/chunk-jabw4ck5.js +3 -0
  83. package/dist/{chunk-51r39yw4.js → chunk-japk9yf6.js} +32 -32
  84. package/dist/chunk-jbb9pjae.js +2 -0
  85. package/dist/{chunk-f1hkagxk.js → chunk-jf0a5ew8.js} +2 -2
  86. package/dist/chunk-jv2z9qb7.js +2 -0
  87. package/dist/chunk-k609nyan.js +2 -0
  88. package/dist/{chunk-q0s0kc66.js → chunk-ka5ea34g.js} +2 -2
  89. package/dist/{chunk-bdaz0k5c.js → chunk-kbv5nwwd.js} +1 -1
  90. package/dist/chunk-ksaj3br7.js +2 -0
  91. package/dist/{chunk-2j5yane9.js → chunk-kxj5sp5w.js} +2 -2
  92. package/dist/{chunk-zvy88beh.js → chunk-mnt7jbek.js} +3 -3
  93. package/dist/chunk-mxrmed55.js +2 -0
  94. package/dist/{chunk-gjg82tsf.js → chunk-my85fge2.js} +4 -4
  95. package/dist/chunk-n4c8srx8.js +2 -0
  96. package/dist/{chunk-fx094pwg.js → chunk-n91sm385.js} +2 -2
  97. package/dist/{chunk-4657mnht.js → chunk-ncrrxp60.js} +4 -4
  98. package/dist/chunk-nfxd6y75.js +2 -0
  99. package/dist/chunk-nsqx4xwn.js +2 -0
  100. package/dist/{chunk-xmsf1bnx.js → chunk-ntg8ttm4.js} +3 -3
  101. package/dist/{chunk-yy83cyj1.js → chunk-pfzwgxk9.js} +10 -10
  102. package/dist/chunk-q5ehy99b.js +2 -0
  103. package/dist/{chunk-fgxydvt9.js → chunk-qtkjbz4n.js} +2 -2
  104. package/dist/chunk-r10h4xmw.js +2 -0
  105. package/dist/{chunk-x12e55sd.js → chunk-r3jf8v5a.js} +31 -31
  106. package/dist/{chunk-kd6r7z27.js → chunk-r4jwhy37.js} +2 -2
  107. package/dist/{chunk-cqwhafc9.js → chunk-r8xwd8r1.js} +14 -14
  108. package/dist/{chunk-0pghy8kw.js → chunk-rb6vr5v9.js} +6 -6
  109. package/dist/chunk-rf0q3mva.js +2 -0
  110. package/dist/{chunk-f8azcvh3.js → chunk-rjenga8c.js} +2 -2
  111. package/dist/{chunk-frqf7t08.js → chunk-rk2ex6qx.js} +2 -2
  112. package/dist/chunk-rm5pnhzx.js +3 -0
  113. package/dist/{chunk-4a989sxm.js → chunk-rpapxkdm.js} +3 -3
  114. package/dist/chunk-rrj3gv46.js +3 -0
  115. package/dist/chunk-s37e6wjj.js +2 -0
  116. package/dist/{chunk-bkcq0dxb.js → chunk-sfww6v6m.js} +7 -7
  117. package/dist/chunk-sjcvc0bd.js +2 -0
  118. package/dist/chunk-t2a78fzq.js +2 -0
  119. package/dist/chunk-t2sqxbv5.js +2 -0
  120. package/dist/chunk-t5mnysyw.js +2 -0
  121. package/dist/chunk-th7343bz.js +2 -0
  122. package/dist/{chunk-20ep26hg.js → chunk-tpf8v2mb.js} +2 -2
  123. package/dist/{chunk-bq7qcndg.js → chunk-tpyk6b4c.js} +2 -2
  124. package/dist/{chunk-t9mw38hk.js → chunk-txfz7gc3.js} +8 -8
  125. package/dist/{chunk-7bd85w4d.js → chunk-tzdwg9rw.js} +4 -4
  126. package/dist/{chunk-q8yfdjww.js → chunk-v7j50pfw.js} +12 -12
  127. package/dist/{chunk-h6hct02d.js → chunk-v7rat63v.js} +2 -2
  128. package/dist/{chunk-fzkjm2g2.js → chunk-v9jfxbwx.js} +2 -2
  129. package/dist/{chunk-m87qhcsz.js → chunk-vhckqe4x.js} +10 -10
  130. package/dist/chunk-vkrxrt0a.js +2 -0
  131. package/dist/chunk-vq4nccm4.js +2 -0
  132. package/dist/{chunk-sb0gtzcf.js → chunk-vrwdnefe.js} +2 -2
  133. package/dist/{chunk-sen1svvw.js → chunk-vyvjbydn.js} +4 -4
  134. package/dist/chunk-vzpbxgg7.js +2 -0
  135. package/dist/chunk-wj93vpy5.js +2 -0
  136. package/dist/chunk-wz30ghcf.js +2 -0
  137. package/dist/{chunk-x4f7efgp.js → chunk-x0dx1pyf.js} +3 -3
  138. package/dist/chunk-xjthcx9s.js +2 -0
  139. package/dist/chunk-xvd3vdrw.js +2 -0
  140. package/dist/chunk-xvtp7nyj.js +2 -0
  141. package/dist/chunk-xy45tx27.js +2 -0
  142. package/dist/{chunk-hcf1wv74.js → chunk-y49nzyxf.js} +9 -9
  143. package/dist/{chunk-vcx6dy59.js → chunk-yhzakgpp.js} +1 -1
  144. package/dist/chunk-z3qgv971.js +2 -0
  145. package/dist/cli.js +20 -20
  146. package/dist/component-renderer.d.ts +1 -0
  147. package/dist/component-renderer.js +15 -1
  148. package/dist/craft-entry.js +2 -2
  149. package/dist/craft.js +2 -2
  150. package/dist/document-shell.d.ts +16 -0
  151. package/dist/expressions.d.ts +39 -9
  152. package/dist/expressions.js +36 -5
  153. package/dist/process.js +2 -2
  154. package/dist/pwa.js +3 -3
  155. package/dist/server-bindings.d.ts +1 -1
  156. package/dist/server-bindings.js +1 -1
  157. package/dist/ssg.js +6 -6
  158. package/package.json +5 -5
  159. package/dist/chunk-0bacm8xg.js +0 -2
  160. package/dist/chunk-0gjx468c.js +0 -2
  161. package/dist/chunk-1m2sx3rc.js +0 -2
  162. package/dist/chunk-31bkv5yk.js +0 -2
  163. package/dist/chunk-38cj6zgb.js +0 -2
  164. package/dist/chunk-3cnf9vk3.js +0 -2
  165. package/dist/chunk-41sh9y5w.js +0 -2
  166. package/dist/chunk-4eagsz5d.js +0 -2
  167. package/dist/chunk-5gjzfgc5.js +0 -42
  168. package/dist/chunk-5t93dqft.js +0 -2
  169. package/dist/chunk-67gy8ktq.js +0 -2
  170. package/dist/chunk-6hn9n00a.js +0 -2
  171. package/dist/chunk-7m0r7mq9.js +0 -2
  172. package/dist/chunk-7v54wqsh.js +0 -2
  173. package/dist/chunk-7vhm0jj5.js +0 -3
  174. package/dist/chunk-8c363c2r.js +0 -2
  175. package/dist/chunk-8tkg5ews.js +0 -2
  176. package/dist/chunk-ajq3fnxc.js +0 -3
  177. package/dist/chunk-ar86zwmp.js +0 -2
  178. package/dist/chunk-b0fkvrat.js +0 -2
  179. package/dist/chunk-b4tpv1jd.js +0 -2
  180. package/dist/chunk-bj2bgazr.js +0 -2
  181. package/dist/chunk-c18pafmf.js +0 -3
  182. package/dist/chunk-c1xxnn0k.js +0 -2
  183. package/dist/chunk-c656az66.js +0 -2
  184. package/dist/chunk-d44g9sek.js +0 -2
  185. package/dist/chunk-d5vr9g4b.js +0 -2
  186. package/dist/chunk-dmjx0mjy.js +0 -2
  187. package/dist/chunk-ds3yhz8f.js +0 -2
  188. package/dist/chunk-dt4qswne.js +0 -2
  189. package/dist/chunk-e2ghgjb0.js +0 -2
  190. package/dist/chunk-ehgmm2sy.js +0 -2
  191. package/dist/chunk-eqn3jm65.js +0 -2
  192. package/dist/chunk-fjkge1xy.js +0 -2
  193. package/dist/chunk-ft30g13p.js +0 -2
  194. package/dist/chunk-g63jq20j.js +0 -2
  195. package/dist/chunk-gaxx0z19.js +0 -2
  196. package/dist/chunk-hph5qt43.js +0 -2
  197. package/dist/chunk-ht0nncp5.js +0 -2
  198. package/dist/chunk-hzgd52zc.js +0 -2
  199. package/dist/chunk-k4c4xa7b.js +0 -2
  200. package/dist/chunk-m7ev93s9.js +0 -2
  201. package/dist/chunk-nhk0aat9.js +0 -2
  202. package/dist/chunk-nwt1g6s6.js +0 -2
  203. package/dist/chunk-p7q6e8k1.js +0 -2
  204. package/dist/chunk-pf49wf76.js +0 -2
  205. package/dist/chunk-phfdcdhk.js +0 -2
  206. package/dist/chunk-pjkdn8zf.js +0 -2
  207. package/dist/chunk-q1v3c6v8.js +0 -2
  208. package/dist/chunk-q88w2rv9.js +0 -2
  209. package/dist/chunk-qjtt6hjd.js +0 -2
  210. package/dist/chunk-qmg1srpk.js +0 -2
  211. package/dist/chunk-r5bhgyes.js +0 -2
  212. package/dist/chunk-rzfbffnv.js +0 -2
  213. package/dist/chunk-sv2d6nfe.js +0 -2
  214. package/dist/chunk-txakmp61.js +0 -2
  215. package/dist/chunk-wfv30y38.js +0 -2
  216. package/dist/chunk-wj84r15x.js +0 -2
  217. package/dist/chunk-x4k11c9v.js +0 -2
  218. package/dist/chunk-y5k93ysf.js +0 -709
  219. package/dist/chunk-y64qhgv1.js +0 -2
  220. package/dist/chunk-yjskeqaj.js +0 -2
  221. package/dist/chunk-yxqzarzh.js +0 -2
  222. package/dist/chunk-z4g64re8.js +0 -3
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- import"./chunk-y5k93ysf.js";import{_o,Sa,ka}from"./chunk-xmsf1bnx.js";import"./chunk-x12e55sd.js";import"./chunk-cqwhafc9.js";import"./chunk-fx094pwg.js";import"./chunk-zjqvbcwa.js";import"./chunk-fvmd4kk6.js";import"./chunk-20ep26hg.js";import"./chunk-11y84h2d.js";import"./chunk-2j5yane9.js";import"./chunk-m87qhcsz.js";import"./chunk-0pghy8kw.js";import"./chunk-4657mnht.js";import"./chunk-vvv8wyr7.js";import"./chunk-bkcq0dxb.js";import"./chunk-51r39yw4.js";import"./chunk-5gjzfgc5.js";import"./chunk-hcf1wv74.js";import"./chunk-t9mw38hk.js";import"./chunk-wrn3n4b8.js";import"./chunk-4dxq7ft1.js";import"./chunk-9xps62ek.js";import{hu,_a,Sh,kh,Ca,Co,es,Ea,Ta,_h,Ch,$a,Ra,Aa,Pa}from"./chunk-q8yfdjww.js";import"./chunk-gjg82tsf.js";import"./chunk-ajq3fnxc.js";import"./chunk-4y1a7nbm.js";import"./chunk-694w19gx.js";import"./chunk-bdaz0k5c.js";import"./chunk-er5tdp6k.js";var m=new Map,d=new Map;function R(t,e){let n=e?.id||E(t),r=I(t),a=m.get(n);if(a&&a.hash===r)return a;let i=M(t),s=L(t),o=W(t),c=O(i),{staticParts:p,dynamicParts:l}=A(i),f=_(t),g={id:n,hash:r,tree:i,scripts:s,styles:o,staticParts:p,dynamicParts:l,dependencies:f,metadata:c};return m.set(n,g),g}async function Q(t,e={},n={}){let r=performance.now();if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`,c=d.get(o);if(c&&Date.now()-c.timestamp<(n.cacheTTL||60000))return{html:c.html,styles:t.styles.join(`
2
+ import"./chunk-gz45xsbg.js";import{_o,ka,_a}from"./chunk-ntg8ttm4.js";import"./chunk-r3jf8v5a.js";import"./chunk-r8xwd8r1.js";import"./chunk-n91sm385.js";import"./chunk-zjqvbcwa.js";import"./chunk-47n5s7wk.js";import"./chunk-tpf8v2mb.js";import"./chunk-9mtyxvhk.js";import"./chunk-kxj5sp5w.js";import"./chunk-vhckqe4x.js";import"./chunk-rb6vr5v9.js";import"./chunk-ncrrxp60.js";import"./chunk-e5seb8f7.js";import"./chunk-sfww6v6m.js";import"./chunk-japk9yf6.js";import"./chunk-5fspjf7x.js";import"./chunk-y49nzyxf.js";import"./chunk-txfz7gc3.js";import"./chunk-71fsg3az.js";import"./chunk-4dxq7ft1.js";import"./chunk-fm8gfj2g.js";import{yu,Ca,kh,_h,Ea,Co,es,Ta,$a,Ch,Eh,Ra,Aa,Pa,Ia}from"./chunk-v7j50pfw.js";import"./chunk-my85fge2.js";import"./chunk-rm5pnhzx.js";import"./chunk-48vnw9t9.js";import"./chunk-7cxbt404.js";import"./chunk-kbv5nwwd.js";import"./chunk-46wqk1fb.js";var m=new Map,d=new Map;function R(t,e){let n=e?.id||E(t),r=I(t),a=m.get(n);if(a&&a.hash===r)return a;let i=M(t),s=L(t),o=W(t),c=O(i),{staticParts:p,dynamicParts:l}=A(i),f=_(t),g={id:n,hash:r,tree:i,scripts:s,styles:o,staticParts:p,dynamicParts:l,dependencies:f,metadata:c};return m.set(n,g),g}async function Q(t,e={},n={}){let r=performance.now();if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`,c=d.get(o);if(c&&Date.now()-c.timestamp<(n.cacheTTL||60000))return{html:c.html,styles:t.styles.join(`
3
3
  `),scripts:t.scripts.join(`
4
4
  `),metadata:{renderTime:0,cacheHit:!0,totalSize:c.html.length,componentCount:t.metadata.componentCount}}}let a;if(n.streaming)a=await H(t.tree,e);else a=h(t.tree,e);let i;if(n.hydrate){let o=j(a,t,e);a=o.html,i=o.data}if(n.minify)a=D(a);if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`;d.set(o,{html:a,timestamp:Date.now()})}let s=performance.now()-r;return{html:a,styles:t.styles.join(`
5
5
  `),scripts:t.scripts.join(`
6
6
  `),hydrationData:i,metadata:{renderTime:s,cacheHit:!1,totalSize:a.length,componentCount:t.metadata.componentCount}}}function V(t,e){let n=[],r=[],a=[],i=new Map,s=[];return y(t.tree,(o,c)=>{if(o.type==="component"&&o.componentName){if(T(o.componentName))n.push(o.componentName)}if(o.type==="element"&&o.tag){let p=J(o);if(p)s.push(p);if(o.props){for(let[l,f]of Object.entries(o.props))if(l.startsWith("on")&&typeof f==="string"){let g=`handler_${i.size}`;i.set(g,f)}}}if(o.isStatic&&o.type==="element")r.push(b(o));else if(!o.isStatic&&o.type!=="text")a.push(o.tag||o.componentName||"unknown")}),{nativeComponents:n,staticHTML:r,dynamicParts:a,eventHandlers:i,nativeWidgets:s}}function Y(t,e={}){let n=R(t),r=P(n,e),a=new Map,i=[];return y(n.tree,(s)=>{if(s.type==="component"&&s.componentName){if(T(s.componentName)){i.push(s.componentName);let o=`<!--craft:${s.componentName}:${s.hydrationKey||"default"}-->`;a.set(s.hydrationKey||s.componentName,o)}}}),{staticHTML:r,dynamicPlaceholders:a,craftComponents:i}}function M(t){let e={type:"fragment",children:[]},n=e,r=[e],a=t,i=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);while(a.length>0){let s=a.match(/^<(@?[\w-]+)([^>]*)>/);if(s){let[p,l,f]=s,g=z(f),u=l.startsWith("@craft-"),C=u?l:l.toLowerCase(),S={type:u?"component":"element",tag:C,props:g,children:[],componentName:u?C.slice(1):void 0,isStatic:!v(f),hydrationKey:F()};if(n.children=n.children||[],n.children.push(S),!i.has(C)&&!f.endsWith("/"))r.push(S),n=S;a=a.slice(p.length);continue}let o=a.match(/^<\/(@?[\w-]+)>/);if(o){let[p,l]=o,g=l.startsWith("@craft-")?l:l.toLowerCase();while(r.length>1){let u=r.pop();if(n=r[r.length-1],u.tag===g)break}a=a.slice(p.length);continue}let c=a.match(/^[^<]+/);if(c){let p=c[0];if(p.trim()){let l={type:"text",text:p,isStatic:!v(p)};n.children=n.children||[],n.children.push(l)}a=a.slice(p.length);continue}a=a.slice(1)}return e}function z(t){let e={},n=/([\w-:@]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S+)))?/g,r;while((r=n.exec(t))!==null){let[,a,i,s,o]=r,c=i??s??o??!0;e[a]=c}return e}function y(t,e,n=[]){if(e(t,n),t.children)t.children.forEach((r,a)=>{y(r,e,[...n,`${a}`])})}function h(t,e){switch(t.type){case"text":return x(t.text||"",e);case"element":case"component":{let n=t.tag||"div",r=N(t.props||{},e),a=(t.children||[]).map((i)=>h(i,e)).join("");if(!t.children||t.children.length===0){if(["input","br","hr","img","meta","link"].includes(n))return`<${n}${r} />`}return`<${n}${r}>${a}</${n}>`}case"fragment":return(t.children||[]).map((n)=>h(n,e)).join("");case"slot":return`<!--slot:${t.slotName||"default"}-->`;default:return""}}function b(t){if(t.type==="text")return t.text||"";let e=t.tag||"div",n=N(t.props||{},{});return`<${e}${n}></${e}>`}function N(t,e){let n=[];for(let[r,a]of Object.entries(t))if(a===!0)n.push(` ${r}`);else if(a!==!1&&a!==null&&a!==void 0){let i=x(String(a),e);n.push(` ${r}="${k(i)}"`)}return n.join("")}async function H(t,e){return h(t,e)}function P(t,e){let n=[];return y(t.tree,(r)=>{if(r.isStatic)n.push(h(r,e))}),n.join("")}function j(t,e,n){let r={templateId:e.id,context:n,dynamicParts:Array.from(e.dynamicParts.entries())},a=`
7
7
  <script data-craft-hydration>
8
8
  window.__CRAFT_HYDRATION__ = ${JSON.stringify(r)};
9
- </script>`;return{html:t+a,data:r}}function O(t){let e=!1,n=!1,r=!1,a=!1,i=0,s=0;function o(c,p){if(s=Math.max(s,p),c.type==="slot")e=!0;if(c.type==="component")i++;if(!c.isStatic)n=!0;if(c.props)for(let l of Object.keys(c.props)){if(l.startsWith("on"))r=!0;if(l==="@async"||l==="data-async")a=!0}if(c.children)c.children.forEach((l)=>o(l,p+1))}return o(t,0),{hasSlots:e,hasDynamicContent:n,hasEventHandlers:r,hasAsyncContent:a,componentCount:i,maxDepth:s,estimatedSize:JSON.stringify(t).length}}function A(t){let e=new Map,n=new Map;return y(t,(r,a)=>{let i=a.join(".");if(r.isStatic)e.set(i,b(r));else n.set(i,r.tag||r.componentName||"dynamic")}),{staticParts:e,dynamicParts:n}}function L(t){let e=[],n=/<script[^>]*>([\s\S]*?)<\/script>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function W(t){let e=[],n=/<style[^>]*>([\s\S]*?)<\/style>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function _(t){let e=[],n=/@include\s*\(\s*['"]([^'"]+)['"]/g,r;while((r=n.exec(t))!==null)e.push(r[1]);let a=/@component\s*\(\s*['"]([^'"]+)['"]/g;while((r=a.exec(t))!==null)e.push(r[1]);let i=/<@craft-[\w-]+/g;while((r=i.exec(t))!==null)e.push(r[0].slice(2));return[...new Set(e)]}function v(t){return/\{\{.*?\}\}|\{\!\!.*?\!\!\}/.test(t)}function x(t,e){let n=t.replace(/\{\{\s*(.+?)\s*\}\}/g,(r,a)=>{try{let i=w(a.trim(),e);return k(String(i??""))}catch{return""}});return n=n.replace(/\{!!\s*(.+?)\s*!!\}/g,(r,a)=>{try{let i=w(a.trim(),e);return String(i??"")}catch{return""}}),n}function w(t,e){if(/^[\w.]+$/.test(t)){let n=t.split("."),r=e;for(let a of n)if(r&&typeof r==="object"&&a in r)r=r[a];else return;return r}try{return Function(...Object.keys(e),`return ${t}`)(...Object.values(e))}catch{return}}function k(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function D(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/\s+>/g,">").replace(/<\s+/g,"<").trim()}function E(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return`tpl_${Math.abs(e).toString(36)}`}function I(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(36)}var K=0;function F(){return`h_${++K}`}function T(t){return["craft-button","craft-text-input","craft-textarea","craft-checkbox","craft-radio","craft-select","craft-slider","craft-toggle","craft-date-picker","craft-time-picker","craft-color-picker","craft-file-input","craft-modal","craft-alert","craft-toast","craft-progress","craft-spinner","craft-avatar","craft-badge","craft-card","craft-accordion","craft-tabs","craft-tooltip","craft-popover","craft-dropdown","craft-context-menu","craft-data-table","craft-virtual-list","craft-tree-view","craft-map","craft-chart","craft-video","craft-audio","craft-webview","craft-canvas","craft-image-viewer","craft-pdf-viewer","craft-code-editor","craft-rich-editor"].includes(t)}function J(t){let e=t.tag?.toLowerCase(),n=t.props?.type,r={button:{component:"craft-button",confidence:0.95,reason:"Native button provides better touch feedback"},"input:text":{component:"craft-text-input",confidence:0.9,reason:"Native text input has better keyboard handling"},"input:checkbox":{component:"craft-checkbox",confidence:0.95,reason:"Native checkbox follows platform conventions"},"input:range":{component:"craft-slider",confidence:0.9,reason:"Native slider provides smooth interaction"},"input:date":{component:"craft-date-picker",confidence:0.95,reason:"Native date picker provides platform-specific UI"},"input:time":{component:"craft-time-picker",confidence:0.95,reason:"Native time picker provides platform-specific UI"},"input:color":{component:"craft-color-picker",confidence:0.9,reason:"Native color picker provides platform-specific UI"},textarea:{component:"craft-textarea",confidence:0.85,reason:"Native textarea handles multiline input better"},select:{component:"craft-select",confidence:0.9,reason:"Native select provides platform dropdown UI"},progress:{component:"craft-progress",confidence:0.95,reason:"Native progress bar matches platform style"},video:{component:"craft-video",confidence:0.95,reason:"Native video provides hardware acceleration"},audio:{component:"craft-audio",confidence:0.95,reason:"Native audio provides system integration"},dialog:{component:"craft-modal",confidence:0.9,reason:"Native modal provides proper layering and focus"}},a=n?`${e}:${n}`:e,i=r[a||""]||r[e||""];if(i)return{htmlSelector:a||e||"",nativeComponent:i.component,confidence:i.confidence,reason:i.reason};return null}function U(){m.clear()}function q(){d.clear()}function B(){U(),q()}function G(){return{templateCacheSize:m.size,renderCacheSize:d.size,totalEntries:m.size+d.size}}export{hu as CRAFT_BRIDGE_SCRIPT,Co as CRAFT_COMPONENTS,Ea as CRAFT_COMPONENT_RUNTIME,es as CRAFT_COMPONENT_STYLES,_o as NATIVE_COMPONENTS,$a as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,Sa as compileToNative,ka as createHotReloadServer,Ra as findCraftBinary,_a as generateCraftBridgeScript,V as generateCraftOptimizations,Pa as getAvailableFormats,Aa as getAvailableTargets,Ch as getCraftComponents,G as getSSRCacheStats,Ca as injectCraftBridge,Sh as isCraftEnvironment,Y as prerenderForCraft,Ta as processCraftComponents,kh as processCraftDirective,_h as registerCraftComponent,Q as renderSSR};
9
+ </script>`;return{html:t+a,data:r}}function O(t){let e=!1,n=!1,r=!1,a=!1,i=0,s=0;function o(c,p){if(s=Math.max(s,p),c.type==="slot")e=!0;if(c.type==="component")i++;if(!c.isStatic)n=!0;if(c.props)for(let l of Object.keys(c.props)){if(l.startsWith("on"))r=!0;if(l==="@async"||l==="data-async")a=!0}if(c.children)c.children.forEach((l)=>o(l,p+1))}return o(t,0),{hasSlots:e,hasDynamicContent:n,hasEventHandlers:r,hasAsyncContent:a,componentCount:i,maxDepth:s,estimatedSize:JSON.stringify(t).length}}function A(t){let e=new Map,n=new Map;return y(t,(r,a)=>{let i=a.join(".");if(r.isStatic)e.set(i,b(r));else n.set(i,r.tag||r.componentName||"dynamic")}),{staticParts:e,dynamicParts:n}}function L(t){let e=[],n=/<script[^>]*>([\s\S]*?)<\/script>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function W(t){let e=[],n=/<style[^>]*>([\s\S]*?)<\/style>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function _(t){let e=[],n=/@include\s*\(\s*['"]([^'"]+)['"]/g,r;while((r=n.exec(t))!==null)e.push(r[1]);let a=/@component\s*\(\s*['"]([^'"]+)['"]/g;while((r=a.exec(t))!==null)e.push(r[1]);let i=/<@craft-[\w-]+/g;while((r=i.exec(t))!==null)e.push(r[0].slice(2));return[...new Set(e)]}function v(t){return/\{\{.*?\}\}|\{\!\!.*?\!\!\}/.test(t)}function x(t,e){let n=t.replace(/\{\{\s*(.+?)\s*\}\}/g,(r,a)=>{try{let i=w(a.trim(),e);return k(String(i??""))}catch{return""}});return n=n.replace(/\{!!\s*(.+?)\s*!!\}/g,(r,a)=>{try{let i=w(a.trim(),e);return String(i??"")}catch{return""}}),n}function w(t,e){if(/^[\w.]+$/.test(t)){let n=t.split("."),r=e;for(let a of n)if(r&&typeof r==="object"&&a in r)r=r[a];else return;return r}try{return Function(...Object.keys(e),`return ${t}`)(...Object.values(e))}catch{return}}function k(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function D(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/\s+>/g,">").replace(/<\s+/g,"<").trim()}function E(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return`tpl_${Math.abs(e).toString(36)}`}function I(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(36)}var K=0;function F(){return`h_${++K}`}function T(t){return["craft-button","craft-text-input","craft-textarea","craft-checkbox","craft-radio","craft-select","craft-slider","craft-toggle","craft-date-picker","craft-time-picker","craft-color-picker","craft-file-input","craft-modal","craft-alert","craft-toast","craft-progress","craft-spinner","craft-avatar","craft-badge","craft-card","craft-accordion","craft-tabs","craft-tooltip","craft-popover","craft-dropdown","craft-context-menu","craft-data-table","craft-virtual-list","craft-tree-view","craft-map","craft-chart","craft-video","craft-audio","craft-webview","craft-canvas","craft-image-viewer","craft-pdf-viewer","craft-code-editor","craft-rich-editor"].includes(t)}function J(t){let e=t.tag?.toLowerCase(),n=t.props?.type,r={button:{component:"craft-button",confidence:0.95,reason:"Native button provides better touch feedback"},"input:text":{component:"craft-text-input",confidence:0.9,reason:"Native text input has better keyboard handling"},"input:checkbox":{component:"craft-checkbox",confidence:0.95,reason:"Native checkbox follows platform conventions"},"input:range":{component:"craft-slider",confidence:0.9,reason:"Native slider provides smooth interaction"},"input:date":{component:"craft-date-picker",confidence:0.95,reason:"Native date picker provides platform-specific UI"},"input:time":{component:"craft-time-picker",confidence:0.95,reason:"Native time picker provides platform-specific UI"},"input:color":{component:"craft-color-picker",confidence:0.9,reason:"Native color picker provides platform-specific UI"},textarea:{component:"craft-textarea",confidence:0.85,reason:"Native textarea handles multiline input better"},select:{component:"craft-select",confidence:0.9,reason:"Native select provides platform dropdown UI"},progress:{component:"craft-progress",confidence:0.95,reason:"Native progress bar matches platform style"},video:{component:"craft-video",confidence:0.95,reason:"Native video provides hardware acceleration"},audio:{component:"craft-audio",confidence:0.95,reason:"Native audio provides system integration"},dialog:{component:"craft-modal",confidence:0.9,reason:"Native modal provides proper layering and focus"}},a=n?`${e}:${n}`:e,i=r[a||""]||r[e||""];if(i)return{htmlSelector:a||e||"",nativeComponent:i.component,confidence:i.confidence,reason:i.reason};return null}function U(){m.clear()}function q(){d.clear()}function B(){U(),q()}function G(){return{templateCacheSize:m.size,renderCacheSize:d.size,totalEntries:m.size+d.size}}export{yu as CRAFT_BRIDGE_SCRIPT,Co as CRAFT_COMPONENTS,Ta as CRAFT_COMPONENT_RUNTIME,es as CRAFT_COMPONENT_STYLES,_o as NATIVE_COMPONENTS,Ra as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,ka as compileToNative,_a as createHotReloadServer,Aa as findCraftBinary,Ca as generateCraftBridgeScript,V as generateCraftOptimizations,Ia as getAvailableFormats,Pa as getAvailableTargets,Eh as getCraftComponents,G as getSSRCacheStats,Ea as injectCraftBridge,kh as isCraftEnvironment,Y as prerenderForCraft,$a as processCraftComponents,_h as processCraftDirective,Ch as registerCraftComponent,Q as renderSSR};
package/dist/craft.js CHANGED
@@ -1,9 +1,9 @@
1
1
  // @bun
2
- import"./chunk-y5k93ysf.js";import{_o,Sa,ka}from"./chunk-xmsf1bnx.js";import"./chunk-x12e55sd.js";import"./chunk-cqwhafc9.js";import"./chunk-fx094pwg.js";import"./chunk-zjqvbcwa.js";import"./chunk-fvmd4kk6.js";import"./chunk-20ep26hg.js";import"./chunk-11y84h2d.js";import"./chunk-2j5yane9.js";import"./chunk-m87qhcsz.js";import"./chunk-0pghy8kw.js";import"./chunk-4657mnht.js";import"./chunk-vvv8wyr7.js";import"./chunk-bkcq0dxb.js";import"./chunk-51r39yw4.js";import"./chunk-5gjzfgc5.js";import"./chunk-hcf1wv74.js";import"./chunk-t9mw38hk.js";import"./chunk-wrn3n4b8.js";import"./chunk-4dxq7ft1.js";import"./chunk-9xps62ek.js";import{hu,_a,Sh,kh,Ca,Co,es,Ea,Ta,_h,Ch,$a,Ra,Aa,Pa}from"./chunk-q8yfdjww.js";import"./chunk-gjg82tsf.js";import"./chunk-ajq3fnxc.js";import"./chunk-4y1a7nbm.js";import"./chunk-694w19gx.js";import"./chunk-bdaz0k5c.js";import"./chunk-er5tdp6k.js";var m=new Map,d=new Map;function R(t,e){let n=e?.id||E(t),r=I(t),a=m.get(n);if(a&&a.hash===r)return a;let i=M(t),s=L(t),o=W(t),c=O(i),{staticParts:p,dynamicParts:l}=A(i),f=_(t),g={id:n,hash:r,tree:i,scripts:s,styles:o,staticParts:p,dynamicParts:l,dependencies:f,metadata:c};return m.set(n,g),g}async function Q(t,e={},n={}){let r=performance.now();if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`,c=d.get(o);if(c&&Date.now()-c.timestamp<(n.cacheTTL||60000))return{html:c.html,styles:t.styles.join(`
2
+ import"./chunk-gz45xsbg.js";import{_o,ka,_a}from"./chunk-ntg8ttm4.js";import"./chunk-r3jf8v5a.js";import"./chunk-r8xwd8r1.js";import"./chunk-n91sm385.js";import"./chunk-zjqvbcwa.js";import"./chunk-47n5s7wk.js";import"./chunk-tpf8v2mb.js";import"./chunk-9mtyxvhk.js";import"./chunk-kxj5sp5w.js";import"./chunk-vhckqe4x.js";import"./chunk-rb6vr5v9.js";import"./chunk-ncrrxp60.js";import"./chunk-e5seb8f7.js";import"./chunk-sfww6v6m.js";import"./chunk-japk9yf6.js";import"./chunk-5fspjf7x.js";import"./chunk-y49nzyxf.js";import"./chunk-txfz7gc3.js";import"./chunk-71fsg3az.js";import"./chunk-4dxq7ft1.js";import"./chunk-fm8gfj2g.js";import{yu,Ca,kh,_h,Ea,Co,es,Ta,$a,Ch,Eh,Ra,Aa,Pa,Ia}from"./chunk-v7j50pfw.js";import"./chunk-my85fge2.js";import"./chunk-rm5pnhzx.js";import"./chunk-48vnw9t9.js";import"./chunk-7cxbt404.js";import"./chunk-kbv5nwwd.js";import"./chunk-46wqk1fb.js";var m=new Map,d=new Map;function R(t,e){let n=e?.id||E(t),r=I(t),a=m.get(n);if(a&&a.hash===r)return a;let i=M(t),s=L(t),o=W(t),c=O(i),{staticParts:p,dynamicParts:l}=A(i),f=_(t),g={id:n,hash:r,tree:i,scripts:s,styles:o,staticParts:p,dynamicParts:l,dependencies:f,metadata:c};return m.set(n,g),g}async function Q(t,e={},n={}){let r=performance.now();if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`,c=d.get(o);if(c&&Date.now()-c.timestamp<(n.cacheTTL||60000))return{html:c.html,styles:t.styles.join(`
3
3
  `),scripts:t.scripts.join(`
4
4
  `),metadata:{renderTime:0,cacheHit:!0,totalSize:c.html.length,componentCount:t.metadata.componentCount}}}let a;if(n.streaming)a=await H(t.tree,e);else a=h(t.tree,e);let i;if(n.hydrate){let o=j(a,t,e);a=o.html,i=o.data}if(n.minify)a=D(a);if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`;d.set(o,{html:a,timestamp:Date.now()})}let s=performance.now()-r;return{html:a,styles:t.styles.join(`
5
5
  `),scripts:t.scripts.join(`
6
6
  `),hydrationData:i,metadata:{renderTime:s,cacheHit:!1,totalSize:a.length,componentCount:t.metadata.componentCount}}}function V(t,e){let n=[],r=[],a=[],i=new Map,s=[];return y(t.tree,(o,c)=>{if(o.type==="component"&&o.componentName){if(T(o.componentName))n.push(o.componentName)}if(o.type==="element"&&o.tag){let p=J(o);if(p)s.push(p);if(o.props){for(let[l,f]of Object.entries(o.props))if(l.startsWith("on")&&typeof f==="string"){let g=`handler_${i.size}`;i.set(g,f)}}}if(o.isStatic&&o.type==="element")r.push(b(o));else if(!o.isStatic&&o.type!=="text")a.push(o.tag||o.componentName||"unknown")}),{nativeComponents:n,staticHTML:r,dynamicParts:a,eventHandlers:i,nativeWidgets:s}}function Y(t,e={}){let n=R(t),r=P(n,e),a=new Map,i=[];return y(n.tree,(s)=>{if(s.type==="component"&&s.componentName){if(T(s.componentName)){i.push(s.componentName);let o=`<!--craft:${s.componentName}:${s.hydrationKey||"default"}-->`;a.set(s.hydrationKey||s.componentName,o)}}}),{staticHTML:r,dynamicPlaceholders:a,craftComponents:i}}function M(t){let e={type:"fragment",children:[]},n=e,r=[e],a=t,i=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);while(a.length>0){let s=a.match(/^<(@?[\w-]+)([^>]*)>/);if(s){let[p,l,f]=s,g=z(f),u=l.startsWith("@craft-"),C=u?l:l.toLowerCase(),S={type:u?"component":"element",tag:C,props:g,children:[],componentName:u?C.slice(1):void 0,isStatic:!v(f),hydrationKey:F()};if(n.children=n.children||[],n.children.push(S),!i.has(C)&&!f.endsWith("/"))r.push(S),n=S;a=a.slice(p.length);continue}let o=a.match(/^<\/(@?[\w-]+)>/);if(o){let[p,l]=o,g=l.startsWith("@craft-")?l:l.toLowerCase();while(r.length>1){let u=r.pop();if(n=r[r.length-1],u.tag===g)break}a=a.slice(p.length);continue}let c=a.match(/^[^<]+/);if(c){let p=c[0];if(p.trim()){let l={type:"text",text:p,isStatic:!v(p)};n.children=n.children||[],n.children.push(l)}a=a.slice(p.length);continue}a=a.slice(1)}return e}function z(t){let e={},n=/([\w-:@]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S+)))?/g,r;while((r=n.exec(t))!==null){let[,a,i,s,o]=r,c=i??s??o??!0;e[a]=c}return e}function y(t,e,n=[]){if(e(t,n),t.children)t.children.forEach((r,a)=>{y(r,e,[...n,`${a}`])})}function h(t,e){switch(t.type){case"text":return x(t.text||"",e);case"element":case"component":{let n=t.tag||"div",r=N(t.props||{},e),a=(t.children||[]).map((i)=>h(i,e)).join("");if(!t.children||t.children.length===0){if(["input","br","hr","img","meta","link"].includes(n))return`<${n}${r} />`}return`<${n}${r}>${a}</${n}>`}case"fragment":return(t.children||[]).map((n)=>h(n,e)).join("");case"slot":return`<!--slot:${t.slotName||"default"}-->`;default:return""}}function b(t){if(t.type==="text")return t.text||"";let e=t.tag||"div",n=N(t.props||{},{});return`<${e}${n}></${e}>`}function N(t,e){let n=[];for(let[r,a]of Object.entries(t))if(a===!0)n.push(` ${r}`);else if(a!==!1&&a!==null&&a!==void 0){let i=x(String(a),e);n.push(` ${r}="${k(i)}"`)}return n.join("")}async function H(t,e){return h(t,e)}function P(t,e){let n=[];return y(t.tree,(r)=>{if(r.isStatic)n.push(h(r,e))}),n.join("")}function j(t,e,n){let r={templateId:e.id,context:n,dynamicParts:Array.from(e.dynamicParts.entries())},a=`
7
7
  <script data-craft-hydration>
8
8
  window.__CRAFT_HYDRATION__ = ${JSON.stringify(r)};
9
- </script>`;return{html:t+a,data:r}}function O(t){let e=!1,n=!1,r=!1,a=!1,i=0,s=0;function o(c,p){if(s=Math.max(s,p),c.type==="slot")e=!0;if(c.type==="component")i++;if(!c.isStatic)n=!0;if(c.props)for(let l of Object.keys(c.props)){if(l.startsWith("on"))r=!0;if(l==="@async"||l==="data-async")a=!0}if(c.children)c.children.forEach((l)=>o(l,p+1))}return o(t,0),{hasSlots:e,hasDynamicContent:n,hasEventHandlers:r,hasAsyncContent:a,componentCount:i,maxDepth:s,estimatedSize:JSON.stringify(t).length}}function A(t){let e=new Map,n=new Map;return y(t,(r,a)=>{let i=a.join(".");if(r.isStatic)e.set(i,b(r));else n.set(i,r.tag||r.componentName||"dynamic")}),{staticParts:e,dynamicParts:n}}function L(t){let e=[],n=/<script[^>]*>([\s\S]*?)<\/script>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function W(t){let e=[],n=/<style[^>]*>([\s\S]*?)<\/style>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function _(t){let e=[],n=/@include\s*\(\s*['"]([^'"]+)['"]/g,r;while((r=n.exec(t))!==null)e.push(r[1]);let a=/@component\s*\(\s*['"]([^'"]+)['"]/g;while((r=a.exec(t))!==null)e.push(r[1]);let i=/<@craft-[\w-]+/g;while((r=i.exec(t))!==null)e.push(r[0].slice(2));return[...new Set(e)]}function v(t){return/\{\{.*?\}\}|\{\!\!.*?\!\!\}/.test(t)}function x(t,e){let n=t.replace(/\{\{\s*(.+?)\s*\}\}/g,(r,a)=>{try{let i=w(a.trim(),e);return k(String(i??""))}catch{return""}});return n=n.replace(/\{!!\s*(.+?)\s*!!\}/g,(r,a)=>{try{let i=w(a.trim(),e);return String(i??"")}catch{return""}}),n}function w(t,e){if(/^[\w.]+$/.test(t)){let n=t.split("."),r=e;for(let a of n)if(r&&typeof r==="object"&&a in r)r=r[a];else return;return r}try{return Function(...Object.keys(e),`return ${t}`)(...Object.values(e))}catch{return}}function k(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function D(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/\s+>/g,">").replace(/<\s+/g,"<").trim()}function E(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return`tpl_${Math.abs(e).toString(36)}`}function I(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(36)}var K=0;function F(){return`h_${++K}`}function T(t){return["craft-button","craft-text-input","craft-textarea","craft-checkbox","craft-radio","craft-select","craft-slider","craft-toggle","craft-date-picker","craft-time-picker","craft-color-picker","craft-file-input","craft-modal","craft-alert","craft-toast","craft-progress","craft-spinner","craft-avatar","craft-badge","craft-card","craft-accordion","craft-tabs","craft-tooltip","craft-popover","craft-dropdown","craft-context-menu","craft-data-table","craft-virtual-list","craft-tree-view","craft-map","craft-chart","craft-video","craft-audio","craft-webview","craft-canvas","craft-image-viewer","craft-pdf-viewer","craft-code-editor","craft-rich-editor"].includes(t)}function J(t){let e=t.tag?.toLowerCase(),n=t.props?.type,r={button:{component:"craft-button",confidence:0.95,reason:"Native button provides better touch feedback"},"input:text":{component:"craft-text-input",confidence:0.9,reason:"Native text input has better keyboard handling"},"input:checkbox":{component:"craft-checkbox",confidence:0.95,reason:"Native checkbox follows platform conventions"},"input:range":{component:"craft-slider",confidence:0.9,reason:"Native slider provides smooth interaction"},"input:date":{component:"craft-date-picker",confidence:0.95,reason:"Native date picker provides platform-specific UI"},"input:time":{component:"craft-time-picker",confidence:0.95,reason:"Native time picker provides platform-specific UI"},"input:color":{component:"craft-color-picker",confidence:0.9,reason:"Native color picker provides platform-specific UI"},textarea:{component:"craft-textarea",confidence:0.85,reason:"Native textarea handles multiline input better"},select:{component:"craft-select",confidence:0.9,reason:"Native select provides platform dropdown UI"},progress:{component:"craft-progress",confidence:0.95,reason:"Native progress bar matches platform style"},video:{component:"craft-video",confidence:0.95,reason:"Native video provides hardware acceleration"},audio:{component:"craft-audio",confidence:0.95,reason:"Native audio provides system integration"},dialog:{component:"craft-modal",confidence:0.9,reason:"Native modal provides proper layering and focus"}},a=n?`${e}:${n}`:e,i=r[a||""]||r[e||""];if(i)return{htmlSelector:a||e||"",nativeComponent:i.component,confidence:i.confidence,reason:i.reason};return null}function U(){m.clear()}function q(){d.clear()}function B(){U(),q()}function G(){return{templateCacheSize:m.size,renderCacheSize:d.size,totalEntries:m.size+d.size}}export{hu as CRAFT_BRIDGE_SCRIPT,Co as CRAFT_COMPONENTS,Ea as CRAFT_COMPONENT_RUNTIME,es as CRAFT_COMPONENT_STYLES,_o as NATIVE_COMPONENTS,$a as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,Sa as compileToNative,ka as createHotReloadServer,Ra as findCraftBinary,_a as generateCraftBridgeScript,V as generateCraftOptimizations,Pa as getAvailableFormats,Aa as getAvailableTargets,Ch as getCraftComponents,G as getSSRCacheStats,Ca as injectCraftBridge,Sh as isCraftEnvironment,Y as prerenderForCraft,Ta as processCraftComponents,kh as processCraftDirective,_h as registerCraftComponent,Q as renderSSR};
9
+ </script>`;return{html:t+a,data:r}}function O(t){let e=!1,n=!1,r=!1,a=!1,i=0,s=0;function o(c,p){if(s=Math.max(s,p),c.type==="slot")e=!0;if(c.type==="component")i++;if(!c.isStatic)n=!0;if(c.props)for(let l of Object.keys(c.props)){if(l.startsWith("on"))r=!0;if(l==="@async"||l==="data-async")a=!0}if(c.children)c.children.forEach((l)=>o(l,p+1))}return o(t,0),{hasSlots:e,hasDynamicContent:n,hasEventHandlers:r,hasAsyncContent:a,componentCount:i,maxDepth:s,estimatedSize:JSON.stringify(t).length}}function A(t){let e=new Map,n=new Map;return y(t,(r,a)=>{let i=a.join(".");if(r.isStatic)e.set(i,b(r));else n.set(i,r.tag||r.componentName||"dynamic")}),{staticParts:e,dynamicParts:n}}function L(t){let e=[],n=/<script[^>]*>([\s\S]*?)<\/script>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function W(t){let e=[],n=/<style[^>]*>([\s\S]*?)<\/style>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function _(t){let e=[],n=/@include\s*\(\s*['"]([^'"]+)['"]/g,r;while((r=n.exec(t))!==null)e.push(r[1]);let a=/@component\s*\(\s*['"]([^'"]+)['"]/g;while((r=a.exec(t))!==null)e.push(r[1]);let i=/<@craft-[\w-]+/g;while((r=i.exec(t))!==null)e.push(r[0].slice(2));return[...new Set(e)]}function v(t){return/\{\{.*?\}\}|\{\!\!.*?\!\!\}/.test(t)}function x(t,e){let n=t.replace(/\{\{\s*(.+?)\s*\}\}/g,(r,a)=>{try{let i=w(a.trim(),e);return k(String(i??""))}catch{return""}});return n=n.replace(/\{!!\s*(.+?)\s*!!\}/g,(r,a)=>{try{let i=w(a.trim(),e);return String(i??"")}catch{return""}}),n}function w(t,e){if(/^[\w.]+$/.test(t)){let n=t.split("."),r=e;for(let a of n)if(r&&typeof r==="object"&&a in r)r=r[a];else return;return r}try{return Function(...Object.keys(e),`return ${t}`)(...Object.values(e))}catch{return}}function k(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function D(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/\s+>/g,">").replace(/<\s+/g,"<").trim()}function E(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return`tpl_${Math.abs(e).toString(36)}`}function I(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(36)}var K=0;function F(){return`h_${++K}`}function T(t){return["craft-button","craft-text-input","craft-textarea","craft-checkbox","craft-radio","craft-select","craft-slider","craft-toggle","craft-date-picker","craft-time-picker","craft-color-picker","craft-file-input","craft-modal","craft-alert","craft-toast","craft-progress","craft-spinner","craft-avatar","craft-badge","craft-card","craft-accordion","craft-tabs","craft-tooltip","craft-popover","craft-dropdown","craft-context-menu","craft-data-table","craft-virtual-list","craft-tree-view","craft-map","craft-chart","craft-video","craft-audio","craft-webview","craft-canvas","craft-image-viewer","craft-pdf-viewer","craft-code-editor","craft-rich-editor"].includes(t)}function J(t){let e=t.tag?.toLowerCase(),n=t.props?.type,r={button:{component:"craft-button",confidence:0.95,reason:"Native button provides better touch feedback"},"input:text":{component:"craft-text-input",confidence:0.9,reason:"Native text input has better keyboard handling"},"input:checkbox":{component:"craft-checkbox",confidence:0.95,reason:"Native checkbox follows platform conventions"},"input:range":{component:"craft-slider",confidence:0.9,reason:"Native slider provides smooth interaction"},"input:date":{component:"craft-date-picker",confidence:0.95,reason:"Native date picker provides platform-specific UI"},"input:time":{component:"craft-time-picker",confidence:0.95,reason:"Native time picker provides platform-specific UI"},"input:color":{component:"craft-color-picker",confidence:0.9,reason:"Native color picker provides platform-specific UI"},textarea:{component:"craft-textarea",confidence:0.85,reason:"Native textarea handles multiline input better"},select:{component:"craft-select",confidence:0.9,reason:"Native select provides platform dropdown UI"},progress:{component:"craft-progress",confidence:0.95,reason:"Native progress bar matches platform style"},video:{component:"craft-video",confidence:0.95,reason:"Native video provides hardware acceleration"},audio:{component:"craft-audio",confidence:0.95,reason:"Native audio provides system integration"},dialog:{component:"craft-modal",confidence:0.9,reason:"Native modal provides proper layering and focus"}},a=n?`${e}:${n}`:e,i=r[a||""]||r[e||""];if(i)return{htmlSelector:a||e||"",nativeComponent:i.component,confidence:i.confidence,reason:i.reason};return null}function U(){m.clear()}function q(){d.clear()}function B(){U(),q()}function G(){return{templateCacheSize:m.size,renderCacheSize:d.size,totalEntries:m.size+d.size}}export{yu as CRAFT_BRIDGE_SCRIPT,Co as CRAFT_COMPONENTS,Ta as CRAFT_COMPONENT_RUNTIME,es as CRAFT_COMPONENT_STYLES,_o as NATIVE_COMPONENTS,Ra as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,ka as compileToNative,_a as createHotReloadServer,Aa as findCraftBinary,Ca as generateCraftBridgeScript,V as generateCraftOptimizations,Ia as getAvailableFormats,Pa as getAvailableTargets,Eh as getCraftComponents,G as getSSRCacheStats,Ea as injectCraftBridge,kh as isCraftEnvironment,Y as prerenderForCraft,$a as processCraftComponents,_h as processCraftDirective,Ch as registerCraftComponent,Q as renderSSR};
@@ -172,6 +172,22 @@ export declare function ensureDocumentShell(html: string, headConfig?: AppHeadCo
172
172
  * selectors, so it generates no box of its own. A deferred island
173
173
  * (`stx-hydrate`) keeps one, because its visibility trigger observes it and an
174
174
  * element with no box never intersects.
175
+ *
176
+ * The cost of generating no box is that the wrapper is still an ELEMENT to a
177
+ * selector. Sibling-margin utilities set their margin on the parent's direct
178
+ * children -- `space-y-*` and `space-x-*` compile to `> * + *` or
179
+ * `> :not([hidden]) ~ :not([hidden])` -- so when that child is a component the
180
+ * margin lands here and is dropped, and the component renders flush against
181
+ * what is above it with nothing said (stacksjs/stx#2178). `gap` is unaffected,
182
+ * because flex and grid items are this wrapper's children, which is the same
183
+ * reason the rule exists.
184
+ *
185
+ * The wrapper cannot simply be dropped in favour of putting the scope on the
186
+ * component's own root: the native host identifies component boundaries by this
187
+ * attribute and UIKit and Android do not implement `display: contents`, so
188
+ * `scopeOnRootElement` takes the root only where a wrapper would be hoisted out
189
+ * by the parser. Letting it take an ordinary root as well fails 55 tests across
190
+ * the native host, shared overlays, forms and popovers.
175
191
  */
176
192
  export declare const COMPONENT_WRAPPER_RULE: '[data-stx-component-wrapper]:not([stx-hydrate]){display:contents}';
177
193
  /**
@@ -39,14 +39,6 @@ export declare function getAllFilters(): Record<string, FilterFunction>;
39
39
  * Clear all custom filters (useful for testing)
40
40
  */
41
41
  export declare function clearCustomFilters(): void;
42
- /**
43
- * Replace every `{{ expr }}` span in `input`, each read whole by
44
- * findMustacheEnd.
45
- *
46
- * `replacer` receives what String.replace passed before: the full matched text,
47
- * the expression between the braces, and the offset of the match in `input`.
48
- * An unterminated `{{` is left alone, as the old lazy regex also left it.
49
- */
50
42
  export declare function replaceInterpolations(input: string, replacer: (match: string, expr: string, offset: number) => string, braces?: number): string;
51
43
  /**
52
44
  * HTML escape function to prevent XSS
@@ -128,9 +120,22 @@ export declare function interpolateScriptAttributes(attrs: string, context: Reco
128
120
  */
129
121
  export declare function interpolateScriptsInTemplate(template: string, context: Record<string, any>, options?: InterpolateScriptsOptions): string;
130
122
  /**
131
- * Process template expressions including variables, filters, and operations
123
+ * The expression pass as every nested caller uses it: one uninterrupted sweep.
124
+ *
125
+ * `@for` renders through a loop generated by `new Function`, which calls back
126
+ * synchronously and reads the callback's return value to decide whether to
127
+ * break, so this entry point cannot become async without rewriting that.
132
128
  */
133
129
  export declare function processExpressions(template: string, context: Record<string, any>, filePath: string): string;
130
+ /**
131
+ * The same pass, for the one caller that renders a whole document and can
132
+ * afford to return to the event loop while doing it (stacksjs/stx#2176).
133
+ *
134
+ * The output is the sweep's own, unchanged: dividing a scan is not the same as
135
+ * dividing a document, and every offset and scope the replacer reads still
136
+ * describes the whole string.
137
+ */
138
+ export declare function processExpressionsChunked(template: string, context: Record<string, any>, filePath: string, yieldAfterMs?: number): Promise<string>;
134
139
  /**
135
140
  * Apply filters to a value
136
141
  */
@@ -204,4 +209,29 @@ export declare interface ExpressionRejection {
204
209
  */
205
210
  // eslint-disable-next-line pickier/no-unused-vars
206
211
  export type FilterFunction = (value: any, context: Record<string, any>, ...args: any[]) => any;
212
+ /**
213
+ * Replace every `{{ expr }}` span in `input`, each read whole by
214
+ * findMustacheEnd.
215
+ *
216
+ * `replacer` receives what String.replace passed before: the full matched text,
217
+ * the expression between the braces, and the offset of the match in `input`.
218
+ * An unterminated `{{` is left alone, as the old lazy regex also left it.
219
+ */
220
+ /**
221
+ * A pass that can be driven to completion synchronously, or a chunk at a time.
222
+ *
223
+ * The scan below is one uninterrupted sweep, and on a page whose interpolations
224
+ * are not inside a loop that is the whole render: 20,000 of them cost about
225
+ * 1.3 seconds with 80-85% of it in a single stretch, during which the server
226
+ * answers nothing (stacksjs/stx#2176). A `@foreach` page is already divided
227
+ * into thousands of per-iteration pieces, which is why only the loop-free shape
228
+ * shows it.
229
+ *
230
+ * Dividing the SCAN rather than the document is what keeps this safe. Every
231
+ * offset the replacer receives is still an offset into the whole string, and
232
+ * the loop and slot scopes it consults are still computed over the whole
233
+ * string, so nothing about which expressions are evaluated or preserved
234
+ * changes -- only where the sweep is allowed to pause.
235
+ */
236
+ declare type ChunkedPass<T> = Generator<void, T, void>;
207
237
  export { findMustacheEnd } from './mustache-span';
@@ -1,3 +1,4 @@
1
+ import { yieldDuringRendering } from "./performance-utils.js";
1
2
  import { findMustacheEnd } from "./mustache-span.js";
2
3
  export { findMustacheEnd } from "./mustache-span.js";
3
4
  import fs from "node:fs";
@@ -243,11 +244,17 @@ export function clearCustomFilters() {
243
244
  for (const key of Object.keys(customFilters))
244
245
  delete customFilters[key];
245
246
  }
246
- export function replaceInterpolations(input, replacer, braces = 2) {
247
+ function runToCompletion(pass) {
248
+ let step = pass.next();
249
+ while (!step.done)
250
+ step = pass.next();
251
+ return step.value;
252
+ }
253
+ function* replaceInterpolationsPass(input, replacer, braces, yieldAfterMs) {
247
254
  const opener = "{".repeat(braces);
248
255
  if (!input.includes(opener))
249
256
  return input;
250
- let output = "", cursor = 0;
257
+ let output = "", cursor = 0, sinceCheck = 0, lastPause = yieldAfterMs === Number.POSITIVE_INFINITY ? 0 : performance.now();
251
258
  for (;; ) {
252
259
  const open = input.indexOf(opener, cursor);
253
260
  if (open === -1)
@@ -257,9 +264,20 @@ export function replaceInterpolations(input, replacer, braces = 2) {
257
264
  break;
258
265
  output += input.slice(cursor, open) + replacer(input.slice(open, close + braces), input.slice(open + braces, close), open);
259
266
  cursor = close + braces;
267
+ if (++sinceCheck >= 64) {
268
+ sinceCheck = 0;
269
+ const now = performance.now();
270
+ if (now - lastPause >= yieldAfterMs) {
271
+ lastPause = now;
272
+ yield;
273
+ }
274
+ }
260
275
  }
261
276
  return cursor === 0 ? input : output + input.slice(cursor);
262
277
  }
278
+ export function replaceInterpolations(input, replacer, braces = 2) {
279
+ return runToCompletion(replaceInterpolationsPass(input, replacer, braces, Number.POSITIVE_INFINITY));
280
+ }
263
281
  function isBraceLiteralInBinding(source, offset, expr) {
264
282
  const quote = expr[0];
265
283
  if (quote !== "'" && quote !== '"' && quote !== "`")
@@ -571,7 +589,7 @@ export function interpolateScriptsInTemplate(template, context, options = {}) {
571
589
  });
572
590
  return restoreStashedScripts(output, interpolatedScripts);
573
591
  }
574
- export function processExpressions(template, context, filePath) {
592
+ function* processExpressionsPass(template, context, filePath, yieldAfterMs) {
575
593
  let output = template;
576
594
  const styleMatcher = (html, i) => {
577
595
  const end = matchStyleElement(html, i);
@@ -622,7 +640,7 @@ export function processExpressions(template, context, filePath) {
622
640
  ...scope,
623
641
  names: new Set(loopBoundNames(`${scope.binding} in __slot`))
624
642
  })), enclosingLoopNames = new Set(inheritedClientLoopNames(context));
625
- output = replaceInterpolations(output, (match, expr, offset) => {
643
+ output = yield* replaceInterpolationsPass(output, (match, expr, offset) => {
626
644
  const trimmedExpr = expr.trim();
627
645
  if (isBraceLiteralInBinding(output, offset, expr))
628
646
  return match;
@@ -666,13 +684,26 @@ export function processExpressions(template, context, filePath) {
666
684
  const msg = error instanceof Error ? error.message : String(error);
667
685
  return createDetailedErrorMessage("Expression", `Error evaluating: {{ ${trimmedExpr} }}: ${msg}`, filePath, template, offset, match);
668
686
  }
669
- });
687
+ }, 2, yieldAfterMs);
670
688
  if (scriptBlocks.length > 0)
671
689
  output = output.replace(/<!--__STX_SCRIPT_EXPR_(\d+)__-->/g, (match, i) => scriptBlocks[Number(i)] ?? match);
672
690
  if (styleBlocks.length > 0)
673
691
  output = output.replace(/<!--__STX_STYLE_(\d+)__-->/g, (match, i) => styleBlocks[Number(i)] ?? match);
674
692
  return output;
675
693
  }
694
+ export function processExpressions(template, context, filePath) {
695
+ return runToCompletion(processExpressionsPass(template, context, filePath, Number.POSITIVE_INFINITY));
696
+ }
697
+ const DOCUMENT_YIELD_AFTER_MS = 100;
698
+ export async function processExpressionsChunked(template, context, filePath, yieldAfterMs = DOCUMENT_YIELD_AFTER_MS) {
699
+ const pass = processExpressionsPass(template, context, filePath, yieldAfterMs);
700
+ let step = pass.next();
701
+ while (!step.done) {
702
+ await yieldDuringRendering();
703
+ step = pass.next();
704
+ }
705
+ return step.value;
706
+ }
676
707
  export function applyFilters(value, filterExpression, context) {
677
708
  if (!filterExpression.trim())
678
709
  return value;
package/dist/process.js CHANGED
@@ -24,7 +24,7 @@ import { processCustomDirectives } from "./custom-directives.js";
24
24
  import { processAppearanceBootstrapDirective } from "./appearance-bootstrap.js";
25
25
  import { devHelpers, errorLogger, errorRecovery, safeExecuteAsync, StxRuntimeError, StxValidationError } from "./error-handling.js";
26
26
  import { getHead as getHeadStatic } from "./head.js";
27
- import { processExpressions, usesSignalsInScript } from "./expressions.js";
27
+ import { processExpressions, processExpressionsChunked, usesSignalsInScript } from "./expressions.js";
28
28
  import { processBasicFormDirectives, processErrorDirective, processFormInputDirectives } from "./forms.js";
29
29
  import { processTranslateDirective } from "./i18n.js";
30
30
  import { processIncludes, processStackPushDirectives, processStackReplacements } from "./includes.js";
@@ -926,7 +926,7 @@ async function processOtherDirectives(template, context, filePath, options, depe
926
926
  Prefer signals (state/derived/effect) for new components.`);
927
927
  }
928
928
  output = processServerBindings(output, context);
929
- output = await processExpressions(output, context, filePath);
929
+ output = await processExpressionsChunked(output, context, filePath);
930
930
  await yieldDuringRendering();
931
931
  output = addCloakToUnresolvedExpressions(output);
932
932
  output = addCloakToConditionalDirectives(output);
package/dist/pwa.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{no,Ut,Cl,Ag}from"./chunk-7bd85w4d.js";import{to,Ni,Tg,$g,Rg}from"./chunk-tzd0f95w.js";import{Sl,kl,_l,Cg,Eg}from"./chunk-8pj4v1eh.js";import{We,An,Di}from"./chunk-frqf7t08.js";import{Pg,Ig,Og,Ng,ro,hy}from"./chunk-a1s5wqw4.js";import B from"fs";import w from"path";import O from"fs";import u from"path";var v=[72,96,128,144,152,192,384,512],S=[120,152,167,180],P=[16,32];async function M(n,t){let e={success:!0,generatedFiles:[],errors:[],warnings:[]},r=n.pwa?.icons;if(!r?.src)return e.errors.push("No source icon specified in pwa.icons.src"),e.success=!1,e;let o=u.isAbsolute(r.src)?r.src:u.resolve(process.cwd(),r.src);if(!await Bun.file(o).exists())return e.errors.push(`Source icon not found: ${o}`),e.success=!1,e;let a=u.resolve(t,r.outputDir||"pwa-icons");try{O.mkdirSync(a,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${a}`),e.success=!1,e}let s=r.sizes||v,l=r.generateWebP??!0,p=r.generateAppleIcons??!0;try{let c;try{c=await import("sharp")}catch{return e.errors.push(`sharp is not installed. Install it with: bun add sharp
3
- Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-dmjx0mjy.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
2
+ import{no,Vt,El,Pg}from"./chunk-tzdwg9rw.js";import{to,Di,$g,Rg,Ag}from"./chunk-8g5dsjr0.js";import{kl,_l,Cl,Eg,Tg}from"./chunk-2ytaezad.js";import{We,An,Mi}from"./chunk-rk2ex6qx.js";import{Ig,Og,Ng,Dg,ro,by}from"./chunk-69b8mr68.js";import B from"fs";import w from"path";import O from"fs";import u from"path";var v=[72,96,128,144,152,192,384,512],S=[120,152,167,180],P=[16,32];async function M(n,t){let e={success:!0,generatedFiles:[],errors:[],warnings:[]},r=n.pwa?.icons;if(!r?.src)return e.errors.push("No source icon specified in pwa.icons.src"),e.success=!1,e;let o=u.isAbsolute(r.src)?r.src:u.resolve(process.cwd(),r.src);if(!await Bun.file(o).exists())return e.errors.push(`Source icon not found: ${o}`),e.success=!1,e;let a=u.resolve(t,r.outputDir||"pwa-icons");try{O.mkdirSync(a,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${a}`),e.success=!1,e}let s=r.sizes||v,l=r.generateWebP??!0,p=r.generateAppleIcons??!0;try{let c;try{c=await import("sharp")}catch{return e.errors.push(`sharp is not installed. Install it with: bun add sharp
3
+ Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-mxrmed55.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
4
4
  <html lang="en">
5
5
  <head>
6
6
  <meta charset="UTF-8">
@@ -233,4 +233,4 @@ Icon generation requires the sharp package for image processing.`),e.success=!1,
233
233
  }, 5000);
234
234
  </script>
235
235
  </body>
236
- </html>`}function b(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=We(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=no(n,t);if(a){let s=Ut(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return Ni(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,kl as auditBuildOutput,Sl as auditConfig,re as buildPwaAssets,_l as calculateAuditResult,Eg as formatAuditResult,Di as formatSize,j as generateManifest,_ as generateManifestJson,$g as generateManifestLink,F as generateOfflinePage,We as generatePrecacheManifest,An as generatePrecacheManifestJs,M as generatePwaIcons,to as generatePwaTags,no as generateServiceWorker,Ag as generateServiceWorkerAuto,Tg as generateSwRegistrationScript,Rg as generateThemeColorMeta,N as getExpectedIconPaths,Ut as getServiceWorkerFileName,Ni as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,Cl as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,ro as pwaDirectives,Pg as pwaInstallDirective,Og as pwaOfflineDirective,Ng as pwaPushDirective,Ig as pwaUpdateDirective,hy as registerPwaDirectives,Cg as runPwaAudit,D as validateManifest};
236
+ </html>`}function b(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=We(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=no(n,t);if(a){let s=Vt(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return Di(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,_l as auditBuildOutput,kl as auditConfig,re as buildPwaAssets,Cl as calculateAuditResult,Tg as formatAuditResult,Mi as formatSize,j as generateManifest,_ as generateManifestJson,Rg as generateManifestLink,F as generateOfflinePage,We as generatePrecacheManifest,An as generatePrecacheManifestJs,M as generatePwaIcons,to as generatePwaTags,no as generateServiceWorker,Pg as generateServiceWorkerAuto,$g as generateSwRegistrationScript,Ag as generateThemeColorMeta,N as getExpectedIconPaths,Vt as getServiceWorkerFileName,Di as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,El as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,ro as pwaDirectives,Ig as pwaInstallDirective,Ng as pwaOfflineDirective,Dg as pwaPushDirective,Og as pwaUpdateDirective,by as registerPwaDirectives,Eg as runPwaAudit,D as validateManifest};
@@ -15,7 +15,7 @@ export declare function reactiveLoopRanges(template: string): Array<[number, num
15
15
  * A component tag inside one of these renders its slot in a separate pass,
16
16
  * which needs the names to keep treating them as the loop's.
17
17
  */
18
- export declare function reactiveLoopScopes(template: string): Array<{ start: number, end: number, names: string[] }>;
18
+ export declare function reactiveLoopScopes(template: string): Array<{ start: number, end: number, names: string[], tag: string }>;
19
19
  /**
20
20
  * Process server-side `:attr="expr"` bindings in a template.
21
21
  *
@@ -55,7 +55,7 @@ export function reactiveLoopScopes(template) {
55
55
  scope.end = tag.end;
56
56
  continue;
57
57
  }
58
- const loopAttr = /(?::for|x-for|v-for|@for)\s*=/.test(tag.attributes) ? parseAttributes(tag.attributes).find((attr) => LOOP_ATTRIBUTES.has(attr.name)) : void 0, loopValue = typeof loopAttr?.value === "string" ? loopAttr.value : null, scope = loopValue !== null ? { start: tag.start, end: tag.end, names: loopBoundNames(loopValue) } : null;
58
+ const loopAttr = /(?::for|x-for|v-for|@for)\s*=/.test(tag.attributes) ? parseAttributes(tag.attributes).find((attr) => LOOP_ATTRIBUTES.has(attr.name)) : void 0, loopValue = typeof loopAttr?.value === "string" ? loopAttr.value : null, scope = loopValue !== null ? { start: tag.start, end: tag.end, names: loopBoundNames(loopValue), tag: tagName } : null;
59
59
  if (scope)
60
60
  ranges.push(scope);
61
61
  if (!tag.selfClosing && !VOID_TAGS.has(tagName)) {
package/dist/ssg.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import"./chunk-4y6hes3h.js";import{x,il}from"./chunk-cqwhafc9.js";import"./chunk-fx094pwg.js";import"./chunk-zjqvbcwa.js";import{At,y}from"./chunk-y5k93ysf.js";import"./chunk-fvmd4kk6.js";import"./chunk-20ep26hg.js";import"./chunk-11y84h2d.js";import{_t,Ct,Et,Tt,$t,Rt}from"./chunk-2j5yane9.js";import{a}from"./chunk-m87qhcsz.js";import{$s}from"./chunk-0pghy8kw.js";import"./chunk-4657mnht.js";import"./chunk-wr1werwe.js";import{ye,nn,rn}from"./chunk-sen1svvw.js";import"./chunk-vvv8wyr7.js";import{b}from"./chunk-bkcq0dxb.js";import{bt,i}from"./chunk-51r39yw4.js";import"./chunk-5gjzfgc5.js";import"./chunk-hcf1wv74.js";import{ms}from"./chunk-t9mw38hk.js";import"./chunk-wrn3n4b8.js";import"./chunk-4dxq7ft1.js";import{ec,tc,nc}from"./chunk-321e41ck.js";import{en,er,tr}from"./chunk-c18pafmf.js";import{tn}from"./chunk-fzkjm2g2.js";import"./chunk-ajq3fnxc.js";import"./chunk-4y1a7nbm.js";import{G,ve}from"./chunk-694w19gx.js";import"./chunk-bdaz0k5c.js";import"./chunk-er5tdp6k.js";import{c}from"./chunk-z4g64re8.js";import{s,me}from"./chunk-x4f7efgp.js";import D from"fs";import f from"path";import{createHash as vt}from"crypto";function Pt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var kt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Dt(t){return Bun.hash(t).toString(16)}function ot(t,r={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let n=new Map,o=t.replace(kt,(e,u,g,v)=>{let w=v.trim();if(!w)return e;if(/\bdata-stx-src=/.test(g))return e;if(r.minify)w=Pt(w);let p=Dt(w);if(!n.has(p))n.set(p,w);let P=r.integrity?` data-stx-integrity="sha384-${vt("sha384").update(w).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${p}.js"${P}${g}></script>`}),l=Array.from(n,([e,u])=>({hash:e,code:u}));return{html:o,chunks:l}}var It=new Set(["visible","idle"]);function ct(t){if(!t.includes("data-stx-src="))return t;let r=new Map,n=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,o;while((o=n.exec(t))!==null)r.set(o[1],o[2]);let l=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=e.exec(t))!==null)if(It.has(r.get(u[1])||""))l.add(u[2]);let g=/<\/head\s*>/iy,v=y(t,(p,P)=>(g.lastIndex=P,g.exec(p)?g.lastIndex:-1))[0]?.start??-1;if(l.size===0||v===-1)return t;let w=Array.from(l).filter((p)=>!t.includes(`rel="prefetch" href="${p}"`)).map((p)=>`<link rel="prefetch" href="${p}" as="script">`).join("");if(!w)return t;return t.slice(0,v)+w+t.slice(v)}var Bt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function X(t){let r=t.trim();if(!r)return null;let n=/^https?:\/\//i.test(r)?r:`https://${r}`;try{return new URL(n).origin+new URL(n).pathname.replace(/\/$/,"")}catch{return null}}function jt(t){for(let r of Bt){let n=t[r];if(!n)continue;let o=X(n);if(o)return{url:o,source:"env",via:r}}return null}function lt(t){if(!t||typeof t!=="object")return null;let r=t,n=r.site?.url??r.url??r.app?.url;return typeof n==="string"?X(n):null}async function Ft(t){let{existsSync:r}=await import("fs"),n=await import("path");for(let o of["site.config.ts","site.config.js",".config/site.config.ts"]){let l=n.resolve(t,o);if(!r(l))continue;try{let e=await import(l),u=lt(e.default??e);if(u)return u}catch{}}return null}async function ut(t={}){let r=t.cwd??process.cwd(),n=t.env??process.env;if(t.explicit){let u=X(t.explicit);if(u)return{url:u,source:"option"}}let o=lt(t.stxConfig);if(o)return{url:o,source:"stx.config",via:"site.url"};let l=await Ft(r);if(l)return{url:l,source:"site.config",via:"url"};let e=jt(n);if(e)return e;return{url:"http://localhost",source:"fallback"}}function dt(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
3
- `)}function J(t){return async()=>({paths:await t(),fallback:!1})}var Ot;function Lt(t){let r=s(t),{depths:n}=me(r),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,l;while((l=o.exec(r))!==null){if(n[l.index]!==0)continue;let u=x(r,"(",")",o.lastIndex-1),g=r.indexOf("{",u+1),v=x(r,"{","}",g);if(u<0||g<0||v<0)break;return t.slice(l.index,v+1)}let e=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((l=e.exec(r))!==null){if(n[l.index]!==0)continue;let u=il(r,e.lastIndex).endPos;return t.slice(e.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function gt(t){let r="read";try{let n=await Bun.file(t).text();r="parse";let o=tn(n),l=[...o.server,...o.client,...o.signals].filter((e)=>/(?:^|\s)server(?:\s|=|$)/i.test(s(e.attrs))).sort((e,u)=>n.indexOf(e.fullTag)-n.indexOf(u.fullTag));for(let e of l){if(!/\bgetStaticPaths\b/.test(s(e.content)))continue;let u=(Ot??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(e.content);if(!/\bgetStaticPaths\b/.test(s(u)))continue;let g=Lt(u);if(/\bdefineStaticPaths\b/.test(s(g))&&At(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");r="execute";let v=Function("defineStaticPaths",`return (${g})`)(J);if(typeof v!=="function")throw TypeError("getStaticPaths must be a function");let w=await v();r="result";let p=Array.isArray(w)?{paths:w}:w;if(!p||typeof p!=="object"||!("paths"in p)||!Array.isArray(p.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let P of p.paths)if(!P||typeof P!=="object"||!P.params||typeof P.params!=="object"||Array.isArray(P.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:p}}return{kind:"absent"}}catch(n){return{kind:"error",phase:r,error:n instanceof Error?n:Error(String(n))}}}class pt{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,r=""){this.cacheDir=t,this.salt=r}async load(){if(this.loaded)return;let t=f.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let r=JSON.parse(await Bun.file(t).text());for(let[n,o]of Object.entries(r))this.cache.set(n,o)}catch{}this.loaded=!0}async save(){await D.promises.mkdir(this.cacheDir,{recursive:!0});let t=f.join(this.cacheDir,"build-cache.json"),r={};for(let[n,o]of this.cache)r[n]=o;await Bun.write(t,JSON.stringify(r))}getHash(t,r){let n=D.statSync(t),o=`${this.salt}|${t}:${n.mtimeMs}`;for(let e of r)if(D.existsSync(e)){let u=D.statSync(e);o+=`:${e}:${u.mtimeMs}`}let l=0;for(let e=0;e<o.length;e++){let u=o.charCodeAt(e);l=(l<<5)-l+u,l=l&l}return Math.abs(l).toString(36)}get(t,r){let n=this.cache.get(t);if(!n)return null;let o=ft(r).some((u)=>D.existsSync(u)),l=[r,...n.dependencies??[]].some((u)=>u.endsWith(".stx")&&D.existsSync(u)&&ms(D.readFileSync(u,"utf8")).some((g)=>/\bserver\b/.test(g.attrs)));if(o||l)return this.cache.delete(t),null;let e=this.getHash(r,n.dependencies??[]);if(n.hash!==e)return this.cache.delete(t),null;return n.html}set(t,r,n,o){let l=this.getHash(r,n);this.cache.set(t,{hash:l,html:o,generatedAt:Date.now(),dependencies:n})}}class ht{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let r=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return f.join(this.cacheDir,"isr",r)}async get(t){let r=this.getFilePath(t);if(!await Bun.file(r).exists())return null;try{return JSON.parse(await Bun.file(r).text())}catch{return null}}async set(t,r){let n=this.getFilePath(t);await D.promises.mkdir(f.dirname(n),{recursive:!0}),await Bun.write(n,JSON.stringify(r))}async invalidate(t){let r=this.getFilePath(t);if(await Bun.file(r).exists())await D.promises.unlink(r)}async invalidatePattern(t){let r=f.join(this.cacheDir,"isr");if(!D.existsSync(r))return;let n=await D.promises.readdir(r);for(let o of n){let l=o.replace(/_/g,"/").replace(".json","");if(t.test(l))await D.promises.unlink(f.join(r,o))}}async needsRevalidation(t){let r=await this.get(t);if(!r)return!0;return Date.now()>r.revalidateAfter}}async function Ut(t){let r=[];if(!t.isDynamic)r.push({url:t.pattern,params:{}});else{let n=await gt(t.filePath);if(n.kind==="error")throw Error(`getStaticPaths ${n.phase} failed for ${t.pattern} (${t.filePath}): ${n.error.message}`,{cause:n.error});if(n.kind==="absent")return console.warn(`Warning: Dynamic route ${t.pattern} (${t.filePath}) has no getStaticPaths`),r;let o=n.value;if(o.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${t.pattern} (${t.filePath})`),r;for(let l of o.paths){let e=t.pattern;for(let[u,g]of Object.entries(l.params))e=e.replace(`:${u}`,g).replace(`:${u}*`,g);r.push({url:e,params:l.params,props:l.props,revalidate:l.revalidate})}}return r}function ft(t){return[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"]}async function Mt(t){for(let r of ft(t))if(await Bun.file(r).exists())try{let n=await import(r);if(typeof n.default==="function")return await n.default();else if(typeof n.default==="object")return n.default;else if(typeof n.getData==="function")return await n.getData();else{let{default:o,...l}=n;return l}}catch(n){console.error(`Error loading data file ${r}:`,n)}return null}async function Gt(t,r,n){let o=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let l=o[1];if(!l.includes("getStaticProps"))return null;try{let e=l.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!e)return null;return await Function("params",`
2
+ import"./chunk-4y6hes3h.js";import{x,al}from"./chunk-r8xwd8r1.js";import"./chunk-n91sm385.js";import"./chunk-zjqvbcwa.js";import{At,y}from"./chunk-gz45xsbg.js";import"./chunk-47n5s7wk.js";import"./chunk-tpf8v2mb.js";import"./chunk-9mtyxvhk.js";import{_t,Ct,Et,Tt,$t,Rt}from"./chunk-kxj5sp5w.js";import{a}from"./chunk-vhckqe4x.js";import{$s}from"./chunk-rb6vr5v9.js";import"./chunk-ncrrxp60.js";import"./chunk-3e1hmm3h.js";import{ye,tn,nn}from"./chunk-vyvjbydn.js";import"./chunk-e5seb8f7.js";import{b}from"./chunk-sfww6v6m.js";import{bt,i}from"./chunk-japk9yf6.js";import"./chunk-5fspjf7x.js";import"./chunk-y49nzyxf.js";import{ms}from"./chunk-txfz7gc3.js";import"./chunk-71fsg3az.js";import"./chunk-4dxq7ft1.js";import{tc,nc,rc}from"./chunk-02qbawwq.js";import{Qt,er,tr}from"./chunk-rrj3gv46.js";import{en}from"./chunk-v9jfxbwx.js";import"./chunk-rm5pnhzx.js";import"./chunk-48vnw9t9.js";import{G,ve}from"./chunk-7cxbt404.js";import"./chunk-kbv5nwwd.js";import"./chunk-46wqk1fb.js";import{c}from"./chunk-bygxt820.js";import{s,me}from"./chunk-x0dx1pyf.js";import D from"fs";import f from"path";import{createHash as vt}from"crypto";function Pt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var kt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Dt(t){return Bun.hash(t).toString(16)}function ot(t,r={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let n=new Map,o=t.replace(kt,(e,u,g,v)=>{let w=v.trim();if(!w)return e;if(/\bdata-stx-src=/.test(g))return e;if(r.minify)w=Pt(w);let p=Dt(w);if(!n.has(p))n.set(p,w);let P=r.integrity?` data-stx-integrity="sha384-${vt("sha384").update(w).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${p}.js"${P}${g}></script>`}),l=Array.from(n,([e,u])=>({hash:e,code:u}));return{html:o,chunks:l}}var It=new Set(["visible","idle"]);function ct(t){if(!t.includes("data-stx-src="))return t;let r=new Map,n=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,o;while((o=n.exec(t))!==null)r.set(o[1],o[2]);let l=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=e.exec(t))!==null)if(It.has(r.get(u[1])||""))l.add(u[2]);let g=/<\/head\s*>/iy,v=y(t,(p,P)=>(g.lastIndex=P,g.exec(p)?g.lastIndex:-1))[0]?.start??-1;if(l.size===0||v===-1)return t;let w=Array.from(l).filter((p)=>!t.includes(`rel="prefetch" href="${p}"`)).map((p)=>`<link rel="prefetch" href="${p}" as="script">`).join("");if(!w)return t;return t.slice(0,v)+w+t.slice(v)}var Bt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function X(t){let r=t.trim();if(!r)return null;let n=/^https?:\/\//i.test(r)?r:`https://${r}`;try{return new URL(n).origin+new URL(n).pathname.replace(/\/$/,"")}catch{return null}}function jt(t){for(let r of Bt){let n=t[r];if(!n)continue;let o=X(n);if(o)return{url:o,source:"env",via:r}}return null}function lt(t){if(!t||typeof t!=="object")return null;let r=t,n=r.site?.url??r.url??r.app?.url;return typeof n==="string"?X(n):null}async function Ft(t){let{existsSync:r}=await import("fs"),n=await import("path");for(let o of["site.config.ts","site.config.js",".config/site.config.ts"]){let l=n.resolve(t,o);if(!r(l))continue;try{let e=await import(l),u=lt(e.default??e);if(u)return u}catch{}}return null}async function ut(t={}){let r=t.cwd??process.cwd(),n=t.env??process.env;if(t.explicit){let u=X(t.explicit);if(u)return{url:u,source:"option"}}let o=lt(t.stxConfig);if(o)return{url:o,source:"stx.config",via:"site.url"};let l=await Ft(r);if(l)return{url:l,source:"site.config",via:"url"};let e=jt(n);if(e)return e;return{url:"http://localhost",source:"fallback"}}function dt(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
3
+ `)}function J(t){return async()=>({paths:await t(),fallback:!1})}var Ot;function Lt(t){let r=s(t),{depths:n}=me(r),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,l;while((l=o.exec(r))!==null){if(n[l.index]!==0)continue;let u=x(r,"(",")",o.lastIndex-1),g=r.indexOf("{",u+1),v=x(r,"{","}",g);if(u<0||g<0||v<0)break;return t.slice(l.index,v+1)}let e=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((l=e.exec(r))!==null){if(n[l.index]!==0)continue;let u=al(r,e.lastIndex).endPos;return t.slice(e.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function gt(t){let r="read";try{let n=await Bun.file(t).text();r="parse";let o=en(n),l=[...o.server,...o.client,...o.signals].filter((e)=>/(?:^|\s)server(?:\s|=|$)/i.test(s(e.attrs))).sort((e,u)=>n.indexOf(e.fullTag)-n.indexOf(u.fullTag));for(let e of l){if(!/\bgetStaticPaths\b/.test(s(e.content)))continue;let u=(Ot??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(e.content);if(!/\bgetStaticPaths\b/.test(s(u)))continue;let g=Lt(u);if(/\bdefineStaticPaths\b/.test(s(g))&&At(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");r="execute";let v=Function("defineStaticPaths",`return (${g})`)(J);if(typeof v!=="function")throw TypeError("getStaticPaths must be a function");let w=await v();r="result";let p=Array.isArray(w)?{paths:w}:w;if(!p||typeof p!=="object"||!("paths"in p)||!Array.isArray(p.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let P of p.paths)if(!P||typeof P!=="object"||!P.params||typeof P.params!=="object"||Array.isArray(P.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:p}}return{kind:"absent"}}catch(n){return{kind:"error",phase:r,error:n instanceof Error?n:Error(String(n))}}}class pt{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,r=""){this.cacheDir=t,this.salt=r}async load(){if(this.loaded)return;let t=f.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let r=JSON.parse(await Bun.file(t).text());for(let[n,o]of Object.entries(r))this.cache.set(n,o)}catch{}this.loaded=!0}async save(){await D.promises.mkdir(this.cacheDir,{recursive:!0});let t=f.join(this.cacheDir,"build-cache.json"),r={};for(let[n,o]of this.cache)r[n]=o;await Bun.write(t,JSON.stringify(r))}getHash(t,r){let n=D.statSync(t),o=`${this.salt}|${t}:${n.mtimeMs}`;for(let e of r)if(D.existsSync(e)){let u=D.statSync(e);o+=`:${e}:${u.mtimeMs}`}let l=0;for(let e=0;e<o.length;e++){let u=o.charCodeAt(e);l=(l<<5)-l+u,l=l&l}return Math.abs(l).toString(36)}get(t,r){let n=this.cache.get(t);if(!n)return null;let o=ft(r).some((u)=>D.existsSync(u)),l=[r,...n.dependencies??[]].some((u)=>u.endsWith(".stx")&&D.existsSync(u)&&ms(D.readFileSync(u,"utf8")).some((g)=>/\bserver\b/.test(g.attrs)));if(o||l)return this.cache.delete(t),null;let e=this.getHash(r,n.dependencies??[]);if(n.hash!==e)return this.cache.delete(t),null;return n.html}set(t,r,n,o){let l=this.getHash(r,n);this.cache.set(t,{hash:l,html:o,generatedAt:Date.now(),dependencies:n})}}class ht{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let r=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return f.join(this.cacheDir,"isr",r)}async get(t){let r=this.getFilePath(t);if(!await Bun.file(r).exists())return null;try{return JSON.parse(await Bun.file(r).text())}catch{return null}}async set(t,r){let n=this.getFilePath(t);await D.promises.mkdir(f.dirname(n),{recursive:!0}),await Bun.write(n,JSON.stringify(r))}async invalidate(t){let r=this.getFilePath(t);if(await Bun.file(r).exists())await D.promises.unlink(r)}async invalidatePattern(t){let r=f.join(this.cacheDir,"isr");if(!D.existsSync(r))return;let n=await D.promises.readdir(r);for(let o of n){let l=o.replace(/_/g,"/").replace(".json","");if(t.test(l))await D.promises.unlink(f.join(r,o))}}async needsRevalidation(t){let r=await this.get(t);if(!r)return!0;return Date.now()>r.revalidateAfter}}async function Ut(t){let r=[];if(!t.isDynamic)r.push({url:t.pattern,params:{}});else{let n=await gt(t.filePath);if(n.kind==="error")throw Error(`getStaticPaths ${n.phase} failed for ${t.pattern} (${t.filePath}): ${n.error.message}`,{cause:n.error});if(n.kind==="absent")return console.warn(`Warning: Dynamic route ${t.pattern} (${t.filePath}) has no getStaticPaths`),r;let o=n.value;if(o.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${t.pattern} (${t.filePath})`),r;for(let l of o.paths){let e=t.pattern;for(let[u,g]of Object.entries(l.params))e=e.replace(`:${u}`,g).replace(`:${u}*`,g);r.push({url:e,params:l.params,props:l.props,revalidate:l.revalidate})}}return r}function ft(t){return[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"]}async function Mt(t){for(let r of ft(t))if(await Bun.file(r).exists())try{let n=await import(r);if(typeof n.default==="function")return await n.default();else if(typeof n.default==="object")return n.default;else if(typeof n.getData==="function")return await n.getData();else{let{default:o,...l}=n;return l}}catch(n){console.error(`Error loading data file ${r}:`,n)}return null}async function Gt(t,r,n){let o=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let l=o[1];if(!l.includes("getStaticProps"))return null;try{let e=l.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!e)return null;return await Function("params",`
4
4
  return (async function getStaticProps() {
5
5
  ${e[1]}
6
6
  })()
@@ -37,13 +37,13 @@ ${t.map((o)=>{let l=new URL(o.loc,r).href,e=` <url>
37
37
  ${n.join(`
38
38
  `)}
39
39
  </channel>
40
- </rss>`}async function Vt(t={}){let r=Date.now();rn();let n=await a(process.cwd()),o=n.build||{},l=await ut({explicit:t.domain||o.domain,stxConfig:n});if(l.source==="fallback"&&(t.sitemap??o.sitemap??!0))console.warn(dt());let e={router:t.router??n?.router??{},pagesDir:t.pagesDir||o.pagesDir||"pages",outputDir:t.outputDir||o.outputDir||"dist",baseUrl:t.baseUrl||o.baseUrl||"/",domain:l.url,revalidate:t.revalidate??o.revalidate??!1,sitemap:t.sitemap??o.sitemap??!0,sitemapExclude:t.sitemapExclude||o.sitemapExclude||[],robots:t.robots??o.robots??!0,rss:t.rss??o.rss??!1,concurrency:t.concurrency||o.concurrency||10,cache:t.cache??o.cache??!0,cacheDir:t.cacheDir||o.cacheDir||c(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??o.minify??!0,generate404:t.generate404??o.generate404??!0,publicDir:t.publicDir||o.publicDir||"public",trailingSlash:t.trailingSlash??o.trailingSlash??!1,cleanOutput:t.cleanOutput??o.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||n?.partialsDir||"",componentsDir:t.componentsDir||n?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,v=0,w={},p={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&D.existsSync(e.outputDir))await D.promises.rm(e.outputDir,{recursive:!0});await D.promises.mkdir(e.outputDir,{recursive:!0});let E=e.cacheSalt;if(!E){let{resolveUserCssConfig:d,fingerprintConfig:m}=await import("./chunk-38cj6zgb.js");try{E=m(await d(process.cwd()))}catch{}}let{prepareImageDelivery:S}=await import("./chunk-ht0nncp5.js"),R=await S(e.publicDir,e.outputDir);if(R.count>0)console.log(`Optimized ${R.count} image(s) for responsive delivery`),E=[E,R.fingerprint].filter(Boolean).join(":");let A=new pt(e.cacheDir,E);if(e.cache)await A.load();try{let{generateCss:d}=await import("./chunk-38cj6zgb.js");await d('<div class="bg-black"></div>')}catch{}_t();let wt=n?.routeMiddleware?.dir||"middleware";await Et(process.cwd(),wt);let V=Ct();if(V.length>0)console.log(`Loaded ${V.length} middleware: ${V.join(", ")}`);let yt=n?.routeMiddleware?.global||[];nc(n?.layoutsDir,c(process.cwd()));let Z=G(".",{pagesDir:e.pagesDir,pagesDirs:n?._layerPageDirs});console.log(`Found ${Z.length} routes`);let L=[];for(let d of Z)try{let m=await Ut(d);for(let k of m)L.push({route:d,url:k.url,params:k.params,props:k.props,revalidate:k.revalidate??e.revalidate})}catch(m){let k=m instanceof Error?m:Error(String(m));u.failedCount++,u.errors.push({route:d.pattern,error:k}),await e.hooks.onError?.(k,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,k)}u.totalPages=L.length+u.failedCount,console.log(`Generating ${L.length} pages...`);let U=[],Q=[];for(let d=0;d<L.length;d+=e.concurrency)Q.push(L.slice(d,d+e.concurrency));for(let d of Q)await Promise.all(d.map(async(m)=>{let{route:k,url:h,params:_,props:St,revalidate:rt}=m;try{await e.hooks.onPageStart?.(h);let M=await Bun.file(k.filePath).text(),T=Yt(M),xt=T?.middleware?Array.isArray(T.middleware)?T.middleware:[T.middleware]:[],nt=[...yt,...xt];if(nt.length>0){let B=Tt(h,_,T||{}),H=$t(B,null,void 0,{isServer:!0}),j=await Rt(nt,H);if(j.redirect){let C=typeof j.redirect==="string"?j.redirect:j.redirect.path||j.redirect,z=Zt(String(C),h),O=Qt(h,e);await D.promises.mkdir(f.dirname(O),{recursive:!0}),await Bun.write(O,z),u.successCount++,u.pages.push({route:h,outputPath:O,size:Buffer.byteLength(z),cached:!1}),U.push({loc:h,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${h} \u2192 redirect to ${C}`);return}if(j.abort){let C=typeof j.abort==="string"?j.abort:j.abort?.error?.message||"aborted";console.warn(` \u21B3 ${h} \u2014 middleware aborted: ${C}`);return}}let it=T?.validate;if(typeof it==="function")try{if(!await it({params:_})){console.warn(`Validation failed for ${h}, skipping...`);return}}catch{}let I=null,st=!1;if(e.cache){if(I=A.get(h,k.filePath),I)st=!0,u.cachedCount++}if(!I){let B=await mt(k,_,St,e,n);if(I=B.html,e.failOnIncludeError&&B.includeFailures.length>0)throw Error(`${B.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
40
+ </rss>`}async function Vt(t={}){let r=Date.now();nn();let n=await a(process.cwd()),o=n.build||{},l=await ut({explicit:t.domain||o.domain,stxConfig:n});if(l.source==="fallback"&&(t.sitemap??o.sitemap??!0))console.warn(dt());let e={router:t.router??n?.router??{},pagesDir:t.pagesDir||o.pagesDir||"pages",outputDir:t.outputDir||o.outputDir||"dist",baseUrl:t.baseUrl||o.baseUrl||"/",domain:l.url,revalidate:t.revalidate??o.revalidate??!1,sitemap:t.sitemap??o.sitemap??!0,sitemapExclude:t.sitemapExclude||o.sitemapExclude||[],robots:t.robots??o.robots??!0,rss:t.rss??o.rss??!1,concurrency:t.concurrency||o.concurrency||10,cache:t.cache??o.cache??!0,cacheDir:t.cacheDir||o.cacheDir||c(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??o.minify??!0,generate404:t.generate404??o.generate404??!0,publicDir:t.publicDir||o.publicDir||"public",trailingSlash:t.trailingSlash??o.trailingSlash??!1,cleanOutput:t.cleanOutput??o.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||n?.partialsDir||"",componentsDir:t.componentsDir||n?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,v=0,w={},p={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&D.existsSync(e.outputDir))await D.promises.rm(e.outputDir,{recursive:!0});await D.promises.mkdir(e.outputDir,{recursive:!0});let E=e.cacheSalt;if(!E){let{resolveUserCssConfig:d,fingerprintConfig:m}=await import("./chunk-gg63af5n.js");try{E=m(await d(process.cwd()))}catch{}}let{prepareImageDelivery:S}=await import("./chunk-rf0q3mva.js"),R=await S(e.publicDir,e.outputDir);if(R.count>0)console.log(`Optimized ${R.count} image(s) for responsive delivery`),E=[E,R.fingerprint].filter(Boolean).join(":");let A=new pt(e.cacheDir,E);if(e.cache)await A.load();try{let{generateCss:d}=await import("./chunk-gg63af5n.js");await d('<div class="bg-black"></div>')}catch{}_t();let wt=n?.routeMiddleware?.dir||"middleware";await Et(process.cwd(),wt);let V=Ct();if(V.length>0)console.log(`Loaded ${V.length} middleware: ${V.join(", ")}`);let yt=n?.routeMiddleware?.global||[];rc(n?.layoutsDir,c(process.cwd()));let Z=G(".",{pagesDir:e.pagesDir,pagesDirs:n?._layerPageDirs});console.log(`Found ${Z.length} routes`);let L=[];for(let d of Z)try{let m=await Ut(d);for(let k of m)L.push({route:d,url:k.url,params:k.params,props:k.props,revalidate:k.revalidate??e.revalidate})}catch(m){let k=m instanceof Error?m:Error(String(m));u.failedCount++,u.errors.push({route:d.pattern,error:k}),await e.hooks.onError?.(k,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,k)}u.totalPages=L.length+u.failedCount,console.log(`Generating ${L.length} pages...`);let U=[],Q=[];for(let d=0;d<L.length;d+=e.concurrency)Q.push(L.slice(d,d+e.concurrency));for(let d of Q)await Promise.all(d.map(async(m)=>{let{route:k,url:h,params:_,props:St,revalidate:rt}=m;try{await e.hooks.onPageStart?.(h);let M=await Bun.file(k.filePath).text(),T=Yt(M),xt=T?.middleware?Array.isArray(T.middleware)?T.middleware:[T.middleware]:[],nt=[...yt,...xt];if(nt.length>0){let B=Tt(h,_,T||{}),H=$t(B,null,void 0,{isServer:!0}),j=await Rt(nt,H);if(j.redirect){let C=typeof j.redirect==="string"?j.redirect:j.redirect.path||j.redirect,z=Zt(String(C),h),O=te(h,e);await D.promises.mkdir(f.dirname(O),{recursive:!0}),await Bun.write(O,z),u.successCount++,u.pages.push({route:h,outputPath:O,size:Buffer.byteLength(z),cached:!1}),U.push({loc:h,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${h} \u2192 redirect to ${C}`);return}if(j.abort){let C=typeof j.abort==="string"?j.abort:j.abort?.error?.message||"aborted";console.warn(` \u21B3 ${h} \u2014 middleware aborted: ${C}`);return}}let it=T?.validate;if(typeof it==="function")try{if(!await it({params:_})){console.warn(`Validation failed for ${h}, skipping...`);return}}catch{}let I=null,st=!1;if(e.cache){if(I=A.get(h,k.filePath),I)st=!0,u.cachedCount++}if(!I){let B=await mt(k,_,St,e,n);if(I=B.html,e.failOnIncludeError&&B.includeFailures.length>0)throw Error(`${B.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
41
41
  ${B.includeFailures.join(`
42
42
  `)}
43
43
  Set ssg.failOnIncludeError to false to build anyway.`);if(e.failOnServerScriptError&&B.serverScriptFailures.length>0)throw Error(`${B.serverScriptFailures.length} <script server> block(s) failed, so this page would have shipped with the content they produce missing:
44
44
  ${B.serverScriptFailures.join(`
45
45
  `)}
46
- Set ssg.failOnServerScriptError to false to build anyway.`);if(e.cache)A.set(h,k.filePath,B.dependencies,I)}let N;if(e.trailingSlash)N=f.join(e.outputDir,h,"index.html");else N=h==="/"?f.join(e.outputDir,"index.html"):f.join(e.outputDir,`${h}.html`);if(e.chunkIslands){let{html:B,chunks:H}=ot(I,{integrity:e.integrityIslands,minify:e.minify});if(H.length>0){let j=f.join(e.outputDir,"_stx","islands");await D.promises.mkdir(j,{recursive:!0});for(let C of H){let z=f.join(j,`${C.hash}.js`);if(!await Bun.file(z).exists())await Bun.write(z,C.code);if(!g.has(C.hash)){g.add(C.hash);let O=Buffer.byteLength(C.code,"utf8");v+=O,w[C.hash]={bytes:O,file:`/_stx/islands/${C.hash}.js`}}}if(p[h]=H.map((C)=>C.hash),I=B,e.prefetchIslands)I=ct(I)}}if(await D.promises.mkdir(f.dirname(N),{recursive:!0}),await Bun.write(N,I),!Wt(h,I,T,e.sitemapExclude))U.push({loc:h,lastmod:new Date().toISOString().split("T")[0],priority:h==="/"?1:0.8});let at={route:h,outputPath:N,size:Buffer.byteLength(I,"utf8"),cached:st};if(rt!==!1)at.revalidateAt=Date.now()+rt*1000;u.pages.push(at),u.successCount++,await e.hooks.onPageEnd?.(h,I)}catch(M){u.failedCount++,u.errors.push({route:h,error:M}),await e.hooks.onError?.(M,h),console.error(`Error generating ${h}:`,M)}}));let tt=nn();if(tt.length>0){let d=tt.map((m)=>`${m.filePath}: ${m.message}`).join(`
46
+ Set ssg.failOnServerScriptError to false to build anyway.`);if(e.cache)A.set(h,k.filePath,B.dependencies,I)}let N;if(e.trailingSlash)N=f.join(e.outputDir,h,"index.html");else N=h==="/"?f.join(e.outputDir,"index.html"):f.join(e.outputDir,`${h}.html`);if(e.chunkIslands){let{html:B,chunks:H}=ot(I,{integrity:e.integrityIslands,minify:e.minify});if(H.length>0){let j=f.join(e.outputDir,"_stx","islands");await D.promises.mkdir(j,{recursive:!0});for(let C of H){let z=f.join(j,`${C.hash}.js`);if(!await Bun.file(z).exists())await Bun.write(z,C.code);if(!g.has(C.hash)){g.add(C.hash);let O=Buffer.byteLength(C.code,"utf8");v+=O,w[C.hash]={bytes:O,file:`/_stx/islands/${C.hash}.js`}}}if(p[h]=H.map((C)=>C.hash),I=B,e.prefetchIslands)I=ct(I)}}if(await D.promises.mkdir(f.dirname(N),{recursive:!0}),await Bun.write(N,I),!Wt(h,I,T,e.sitemapExclude))U.push({loc:h,lastmod:new Date().toISOString().split("T")[0],priority:h==="/"?1:0.8});let at={route:h,outputPath:N,size:Buffer.byteLength(I,"utf8"),cached:st};if(rt!==!1)at.revalidateAt=Date.now()+rt*1000;u.pages.push(at),u.successCount++,await e.hooks.onPageEnd?.(h,I)}catch(M){u.failedCount++,u.errors.push({route:h,error:M}),await e.hooks.onError?.(M,h),console.error(`Error generating ${h}:`,M)}}));let tt=tn();if(tt.length>0){let d=tt.map((m)=>`${m.filePath}: ${m.message}`).join(`
47
47
  `);throw Error(`Client script bundling failed:
48
48
  ${d}`)}if(e.cache)await A.save();if(e.generate404){let d=f.join(e.pagesDir,"404.stx");if(await Bun.file(d).exists()){let m=new Set,k={...n,minifyClient:!0,debug:!1,cache:!1},h=await i(await Bun.file(d).text(),{},d,k,m);await Bun.write(f.join(e.outputDir,"404.html"),h)}else await Bun.write(f.join(e.outputDir,"404.html"),`<!DOCTYPE html>
49
49
  <html lang="en">
@@ -66,7 +66,7 @@ ${d}`)}if(e.cache)await A.save();if(e.generate404){let d=f.join(e.pagesDir,"404.
66
66
  <a href="/">Go home</a>
67
67
  </div>
68
68
  </body>
69
- </html>`)}for(let d of[500]){let m=f.join(e.pagesDir,`${d}.stx`);if(await Bun.file(m).exists()){let k=new Set,h={...n,minifyClient:!0,debug:!1,cache:!1},_=await i(await Bun.file(m).text(),{},m,h,k);await Bun.write(f.join(e.outputDir,`${d}.html`),_)}}let K=f.join(e.pagesDir,"error.stx");if(await Bun.file(K).exists()){let d=new Set,m={...n,minifyClient:!0,debug:!1,cache:!1},k=await i(await Bun.file(K).text(),{},K,m,d);await Bun.write(f.join(e.outputDir,"error.html"),k)}if(e.sitemap&&U.length>0){let d=qt(U,e.domain),m=f.join(e.outputDir,"sitemap.xml");await Bun.write(m,d),u.sitemapPath=m,console.log(`Generated sitemap.xml with ${U.length} URLs`)}if(e.robots!==!1){let d=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((h)=>typeof h==="string"),...d.disallow||[]],k=$s({rules:[{userAgent:d.userAgent||"*",allow:d.allow||["/"],...m.length>0?{disallow:m}:{}}],...d.sitemap!==!1&&u.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(f.join(e.outputDir,"robots.txt"),k),console.log("Generated robots.txt")}if(e.rss){let d=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},m=[];if(d.getItems)m=await d.getItems();let k=Jt(d,m),h=f.join(e.outputDir,"rss.xml");await Bun.write(h,k),u.rssPath=h,console.log(`Generated rss.xml with ${m.length} items`)}let W=ec(e.outputDir);if(W.assets>0)console.log(`Externalized ${W.assets} asset(s) from ${W.pages} page(s) (${(W.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let q=tc(e.outputDir);if(q.assets>0)console.log(`Externalized ${q.assets} repeated asset(s) from ${q.pages} page(s) (${(q.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&D.existsSync(e.publicDir))await Y(e.publicDir,e.outputDir),console.log(`Copied public assets from ${e.publicDir}`);let et=tr();if(et)await Y(et,f.join(e.outputDir,er)),console.log(`Copied assets from ${en}`)}catch(E){throw await e.hooks.onError?.(E),E}if(u.buildTime=Date.now()-r,g.size>0){u.islandChunks={count:g.size,totalBytes:v};let E={generatedChunks:g.size,totalBytes:v,chunks:w,pages:p};await Bun.write(f.join(e.outputDir,"_stx","islands-manifest.json"),JSON.stringify(E,null,2))}await e.hooks.onBuildEnd?.(u);let P=u.islandChunks?`
69
+ </html>`)}for(let d of[500]){let m=f.join(e.pagesDir,`${d}.stx`);if(await Bun.file(m).exists()){let k=new Set,h={...n,minifyClient:!0,debug:!1,cache:!1},_=await i(await Bun.file(m).text(),{},m,h,k);await Bun.write(f.join(e.outputDir,`${d}.html`),_)}}let K=f.join(e.pagesDir,"error.stx");if(await Bun.file(K).exists()){let d=new Set,m={...n,minifyClient:!0,debug:!1,cache:!1},k=await i(await Bun.file(K).text(),{},K,m,d);await Bun.write(f.join(e.outputDir,"error.html"),k)}if(e.sitemap&&U.length>0){let d=qt(U,e.domain),m=f.join(e.outputDir,"sitemap.xml");await Bun.write(m,d),u.sitemapPath=m,console.log(`Generated sitemap.xml with ${U.length} URLs`)}if(e.robots!==!1){let d=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((h)=>typeof h==="string"),...d.disallow||[]],k=$s({rules:[{userAgent:d.userAgent||"*",allow:d.allow||["/"],...m.length>0?{disallow:m}:{}}],...d.sitemap!==!1&&u.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(f.join(e.outputDir,"robots.txt"),k),console.log("Generated robots.txt")}if(e.rss){let d=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},m=[];if(d.getItems)m=await d.getItems();let k=Jt(d,m),h=f.join(e.outputDir,"rss.xml");await Bun.write(h,k),u.rssPath=h,console.log(`Generated rss.xml with ${m.length} items`)}let W=tc(e.outputDir);if(W.assets>0)console.log(`Externalized ${W.assets} asset(s) from ${W.pages} page(s) (${(W.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let q=nc(e.outputDir);if(q.assets>0)console.log(`Externalized ${q.assets} repeated asset(s) from ${q.pages} page(s) (${(q.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&D.existsSync(e.publicDir))await Y(e.publicDir,e.outputDir),console.log(`Copied public assets from ${e.publicDir}`);let et=tr();if(et)await Y(et,f.join(e.outputDir,er)),console.log(`Copied assets from ${Qt}`)}catch(E){throw await e.hooks.onError?.(E),E}if(u.buildTime=Date.now()-r,g.size>0){u.islandChunks={count:g.size,totalBytes:v};let E={generatedChunks:g.size,totalBytes:v,chunks:w,pages:p};await Bun.write(f.join(e.outputDir,"_stx","islands-manifest.json"),JSON.stringify(E,null,2))}await e.hooks.onBuildEnd?.(u);let P=u.islandChunks?`
70
70
  Island chunks: ${u.islandChunks.count} (${(u.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
71
71
  Build complete!
72
72
  Total: ${u.totalPages} pages
@@ -87,4 +87,4 @@ Build complete!
87
87
  <p>Redirecting to <a href="${t}">${t}</a>...</p>
88
88
  <script>window.location.replace('${t}')</script>
89
89
  </body>
90
- </html>`}function Qt(t,r){if(t==="/"||t==="")return f.join(r.outputDir,"index.html");let n=t.replace(/^\/|\/$/g,"");if(r.trailingSlash)return f.join(r.outputDir,n,"index.html");return f.join(r.outputDir,`${n}.html`)}var je={generateStaticSite:Vt,createISRHandler:Kt,defineStaticPaths:J,createMarkdownLoader:Xt};export{Kt as createISRHandler,Xt as createMarkdownLoader,Nt as declaresPageAction,je as default,J as defineStaticPaths,Vt as generateStaticSite,Wt as isExcludedFromSitemap};
90
+ </html>`}function te(t,r){if(t==="/"||t==="")return f.join(r.outputDir,"index.html");let n=t.replace(/^\/|\/$/g,"");if(r.trailingSlash)return f.join(r.outputDir,n,"index.html");return f.join(r.outputDir,`${n}.html`)}var Fe={generateStaticSite:Vt,createISRHandler:Kt,defineStaticPaths:J,createMarkdownLoader:Xt};export{Kt as createISRHandler,Xt as createMarkdownLoader,Nt as declaresPageAction,Fe as default,J as defineStaticPaths,Vt as generateStaticSite,Wt as isExcludedFromSitemap};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.842",
4
+ "version": "0.2.844",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -128,12 +128,12 @@
128
128
  "dependencies": {
129
129
  "@stacksjs/ts-css": "^0.3.21",
130
130
  "@stacksjs/clapp": "^0.2.16",
131
- "@stacksjs/desktop": "0.2.842",
132
- "@stacksjs/sanitizer": "0.2.842",
131
+ "@stacksjs/desktop": "0.2.844",
132
+ "@stacksjs/sanitizer": "0.2.844",
133
133
  "@stacksjs/ts-i18n": "^0.1.11",
134
- "bun-plugin-stx": "0.2.842",
134
+ "bun-plugin-stx": "0.2.844",
135
135
  "bunfig": "^0.15.21",
136
- "stx-router": "0.2.842",
136
+ "stx-router": "0.2.844",
137
137
  "ts-broadcasting": "^0.0.11",
138
138
  "ts-images": "^0.2.22",
139
139
  "ts-syntax-highlighter": "^0.2.1"
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{im}from"./chunk-f8azcvh3.js";import"./chunk-ph9f3hwk.js";import"./chunk-7ywzjj7t.js";import"./chunk-fzkjm2g2.js";import"./chunk-wr1werwe.js";import"./chunk-51r39yw4.js";import"./chunk-bkcq0dxb.js";import"./chunk-hcf1wv74.js";import"./chunk-4dxq7ft1.js";import"./chunk-5gjzfgc5.js";import"./chunk-ajq3fnxc.js";import"./chunk-wrn3n4b8.js";import"./chunk-4y1a7nbm.js";import"./chunk-t9mw38hk.js";import"./chunk-694w19gx.js";import"./chunk-bdaz0k5c.js";import"./chunk-vvv8wyr7.js";import"./chunk-m87qhcsz.js";import"./chunk-er5tdp6k.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-0pghy8kw.js";import"./chunk-2j5yane9.js";import"./chunk-y5k93ysf.js";import"./chunk-20ep26hg.js";import"./chunk-fvmd4kk6.js";import"./chunk-cqwhafc9.js";import"./chunk-zjqvbcwa.js";import"./chunk-fx094pwg.js";export{im as buildForProduction};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ch,vo,lh,uh,dh,ph}from"./chunk-6dz3k0jc.js";import"./chunk-sen1svvw.js";import"./chunk-wr1werwe.js";import"./chunk-4y6hes3h.js";import"./chunk-t9mw38hk.js";import"./chunk-694w19gx.js";import"./chunk-bdaz0k5c.js";import"./chunk-m87qhcsz.js";import"./chunk-er5tdp6k.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-0pghy8kw.js";import"./chunk-2j5yane9.js";import"./chunk-y5k93ysf.js";import"./chunk-20ep26hg.js";import"./chunk-fvmd4kk6.js";import"./chunk-cqwhafc9.js";import"./chunk-zjqvbcwa.js";import"./chunk-fx094pwg.js";export{ph as clearStoreCache,ch as getStoreScript,dh as getStoreScriptFor,uh as pageStoresAll,vo as storesRead,lh as storesReadInFiles};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Br,io,Vg,$l,ao}from"./chunk-7rtm7nd1.js";export{Vg as buildModuleRegistryScript,ao as buildSharedModuleRegistries,$l as exportsMutableBinding,Br as registeredModuleIdsIn,io as registeredModuleNamesIn};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{xo,fh,gh}from"./chunk-w20kjp62.js";import"./chunk-sen1svvw.js";import"./chunk-wr1werwe.js";import"./chunk-4y6hes3h.js";import"./chunk-t9mw38hk.js";import"./chunk-694w19gx.js";import"./chunk-bdaz0k5c.js";import"./chunk-m87qhcsz.js";import"./chunk-er5tdp6k.js";import"./chunk-11y84h2d.js";import"./chunk-4657mnht.js";import"./chunk-0pghy8kw.js";import"./chunk-2j5yane9.js";import"./chunk-y5k93ysf.js";import"./chunk-20ep26hg.js";import"./chunk-fvmd4kk6.js";import"./chunk-cqwhafc9.js";import"./chunk-zjqvbcwa.js";import"./chunk-fx094pwg.js";export{gh as clearComposableCache,fh as getComposableScript,xo as listComposableModules};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Af,ac,Ah,cc,Pf,If,un,ar,Ph,Of,Nf,Ih,b}from"./chunk-bkcq0dxb.js";import"./chunk-vvv8wyr7.js";import"./chunk-y5k93ysf.js";import"./chunk-20ep26hg.js";import"./chunk-fvmd4kk6.js";import"./chunk-cqwhafc9.js";import"./chunk-zjqvbcwa.js";import"./chunk-fx094pwg.js";export{un as buildCss,Of as extractClassNames,If as fingerprintConfig,Nf as generateCss,Ph as getCachedCSS,Af as getCssServeAsset,b as injectCss,ac as loadCssEngine,cc as loadCssEngineConfig,ar as rebuildCss,Ah as resetCssCache,Pf as resolveUserCssConfig,Ih as withLinkedModuleBundles};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Bi,Fi,zi,Fg,Hi,Vi,zg,Ui,Wi,Tl,Hg}from"./chunk-4a989sxm.js";export{Bi as VideoProcessorCache,Tl as analyzeVideo,Fg as clearVideoCache,Wi as generateDASHManifest,Ui as generateHLSManifest,Hi as generatePoster,zg as generateSpriteSheet,Vi as generateThumbnails,Fi as getCachedVideoResult,Hg as processVideo,zi as setCachedVideoResult};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Sm,km,_m,Cm,Em}from"./chunk-1m16mvt4.js";export{km as defineAsyncComponent,Cm as generateAsyncComponentCSS,Em as generateAsyncComponentRuntime,_m as isAsyncComponent,Sm as processAsyncDirectives};