@stacksjs/stx 0.2.759 → 0.2.761

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 (248) hide show
  1. package/dist/chunk-00nz3pas.js +2 -0
  2. package/dist/{chunk-3nxe5xmy.js → chunk-0fs9kx0h.js} +3 -3
  3. package/dist/{chunk-42hcspws.js → chunk-0kq0k4pg.js} +2 -2
  4. package/dist/chunk-0nynnmya.js +2 -0
  5. package/dist/{chunk-wp9y6x33.js → chunk-0q5dm9r2.js} +5 -5
  6. package/dist/{chunk-f4gqzg1y.js → chunk-0wj31pqy.js} +2 -2
  7. package/dist/chunk-13v3vgb6.js +2 -0
  8. package/dist/chunk-18gazs55.js +2 -0
  9. package/dist/chunk-1a9h6r9f.js +2 -0
  10. package/dist/chunk-1p8t2ekg.js +2 -0
  11. package/dist/chunk-1rcntvgx.js +2 -0
  12. package/dist/chunk-1w5gtkd6.js +2 -0
  13. package/dist/{chunk-fpagqrd1.js → chunk-23t9anc0.js} +75 -75
  14. package/dist/chunk-298gj90a.js +2 -0
  15. package/dist/{chunk-m5fjhrpd.js → chunk-2cbd1ew6.js} +101 -101
  16. package/dist/{chunk-h692k9xn.js → chunk-2typf9dh.js} +4 -4
  17. package/dist/chunk-2wnfqrv5.js +26 -0
  18. package/dist/chunk-2wq0h5ye.js +2 -0
  19. package/dist/{chunk-prej5pk6.js → chunk-2zd51tj4.js} +2 -2
  20. package/dist/chunk-2zg3jmy7.js +2 -0
  21. package/dist/{chunk-ztdjdxjt.js → chunk-319aez2f.js} +3 -3
  22. package/dist/{chunk-7g9vd5fv.js → chunk-37y8sg48.js} +2 -2
  23. package/dist/{chunk-j2mpqa4p.js → chunk-3csfmhg0.js} +2 -2
  24. package/dist/{chunk-jb1dk0w7.js → chunk-3mz088mb.js} +2 -2
  25. package/dist/chunk-3wxb7mfb.js +2 -0
  26. package/dist/{chunk-cehjp06v.js → chunk-42zqmcnc.js} +3 -3
  27. package/dist/{chunk-5ge5h2y3.js → chunk-45g1w1ct.js} +5 -5
  28. package/dist/{chunk-89h4snzd.js → chunk-4833k99b.js} +2 -2
  29. package/dist/{chunk-jevd16gq.js → chunk-48g9wez2.js} +30 -30
  30. package/dist/{chunk-t5gabs4x.js → chunk-4c0qcjac.js} +2 -2
  31. package/dist/{chunk-hmae7ha6.js → chunk-4rxmxc1p.js} +2 -2
  32. package/dist/chunk-4tgn1frg.js +3 -0
  33. package/dist/chunk-5fg8hqq0.js +2 -0
  34. package/dist/chunk-5x0g7e9y.js +2 -0
  35. package/dist/{chunk-83ezv8yz.js → chunk-5yhv5eqq.js} +3 -3
  36. package/dist/{chunk-6n195hvc.js → chunk-61qh74q1.js} +5 -5
  37. package/dist/chunk-64pdwfef.js +177 -0
  38. package/dist/{chunk-mcynmrbe.js → chunk-6fz2n9w6.js} +43 -43
  39. package/dist/chunk-72ns4q88.js +2 -0
  40. package/dist/chunk-7fwcnech.js +2 -0
  41. package/dist/{chunk-x9haxcsj.js → chunk-7y1rpd4g.js} +8 -8
  42. package/dist/chunk-7z2mebp5.js +2 -0
  43. package/dist/chunk-803qm5tk.js +2 -0
  44. package/dist/chunk-86cg9qqm.js +2 -0
  45. package/dist/{chunk-gs6wc7sr.js → chunk-89801pjp.js} +5 -5
  46. package/dist/chunk-8h5mqs28.js +2 -0
  47. package/dist/chunk-8jh2b5k2.js +2 -0
  48. package/dist/{chunk-yp6w740k.js → chunk-8rk79ha1.js} +2 -2
  49. package/dist/{chunk-2x112fxs.js → chunk-8vs5y4h7.js} +14 -14
  50. package/dist/{chunk-kpr09x3g.js → chunk-8y54tpbr.js} +7 -7
  51. package/dist/{chunk-s4y26fk6.js → chunk-8yyq3nfg.js} +2 -2
  52. package/dist/chunk-927ta2dn.js +2 -0
  53. package/dist/chunk-940wny2b.js +2 -0
  54. package/dist/{chunk-93j4atq9.js → chunk-98t1cv8x.js} +2 -2
  55. package/dist/{chunk-sgm6tg8h.js → chunk-9k8ztdcc.js} +2 -2
  56. package/dist/{chunk-4npabwne.js → chunk-9nhyq39s.js} +3 -3
  57. package/dist/{chunk-gz38jt5j.js → chunk-aa1y9j3p.js} +2 -2
  58. package/dist/chunk-ad9dt9rk.js +2 -0
  59. package/dist/chunk-ak4w2emd.js +2 -0
  60. package/dist/{chunk-tb56j1zt.js → chunk-ak93e1zz.js} +5 -5
  61. package/dist/{chunk-jt28zh50.js → chunk-b0z2n941.js} +2 -2
  62. package/dist/{chunk-qwds327k.js → chunk-b51p56k5.js} +2 -2
  63. package/dist/{chunk-r4sawwmp.js → chunk-b7x8b83z.js} +1 -1
  64. package/dist/chunk-b8dtz3v8.js +2 -0
  65. package/dist/{chunk-0e9xdrzx.js → chunk-bjhesw78.js} +8 -8
  66. package/dist/{chunk-w8p1y4c0.js → chunk-bvctccab.js} +4 -4
  67. package/dist/chunk-c5tkxjb0.js +2 -0
  68. package/dist/{chunk-hk98vptc.js → chunk-cdcrd33m.js} +2 -2
  69. package/dist/chunk-cgh0k52q.js +2 -0
  70. package/dist/chunk-ctdw7fh4.js +2 -0
  71. package/dist/{chunk-asp7ett1.js → chunk-dnsf934e.js} +9 -9
  72. package/dist/{chunk-7r7j7vwt.js → chunk-ds6mbfdq.js} +3 -3
  73. package/dist/chunk-e2q79dfs.js +2 -0
  74. package/dist/chunk-e5vn76f5.js +2 -0
  75. package/dist/{chunk-9s1qnf90.js → chunk-eb6p3p62.js} +2 -2
  76. package/dist/chunk-emhbj3xd.js +2 -0
  77. package/dist/{chunk-3cn9y08d.js → chunk-evxp3wmv.js} +7 -7
  78. package/dist/{chunk-z8k3fx4r.js → chunk-f8p8ggvw.js} +4 -4
  79. package/dist/chunk-fjfrgef4.js +2 -0
  80. package/dist/chunk-fke4s0kk.js +33 -0
  81. package/dist/{chunk-0dkd26t4.js → chunk-frybxj35.js} +7 -7
  82. package/dist/{chunk-4s9kytdz.js → chunk-fxmc5006.js} +2 -2
  83. package/dist/chunk-fxnk5ee8.js +2 -0
  84. package/dist/chunk-fys1patf.js +2 -0
  85. package/dist/{chunk-6ts3sthp.js → chunk-g4k0svq6.js} +2 -2
  86. package/dist/chunk-g9efdc5v.js +2 -0
  87. package/dist/chunk-gpvfswgj.js +2 -0
  88. package/dist/chunk-hnen9b45.js +2 -0
  89. package/dist/chunk-jacb7aw1.js +2 -0
  90. package/dist/{chunk-4zw118tn.js → chunk-jgk5j35w.js} +4 -4
  91. package/dist/{chunk-geb6zyxg.js → chunk-jn78c13y.js} +13 -13
  92. package/dist/chunk-jq1698j4.js +2 -0
  93. package/dist/{chunk-pwmkhs7z.js → chunk-jyp2mmts.js} +2 -2
  94. package/dist/{chunk-76fcwbe1.js → chunk-jzajpmke.js} +7 -7
  95. package/dist/chunk-k0jkpw0q.js +2 -0
  96. package/dist/{chunk-3kfbs0mw.js → chunk-k2ex94n8.js} +1 -1
  97. package/dist/{chunk-m00c7sh0.js → chunk-k9247v28.js} +1 -1
  98. package/dist/chunk-kdqnest3.js +2 -0
  99. package/dist/{chunk-1mfj2j5g.js → chunk-kj9m0vc6.js} +3 -3
  100. package/dist/chunk-krsg6dgz.js +3 -0
  101. package/dist/chunk-m5740sd3.js +2 -0
  102. package/dist/{chunk-myynywry.js → chunk-mdvtermb.js} +2 -2
  103. package/dist/chunk-mebf9vwb.js +2 -0
  104. package/dist/chunk-nm2r4se1.js +2 -0
  105. package/dist/chunk-p2j38381.js +2 -0
  106. package/dist/{chunk-3ajnrfa2.js → chunk-p88yh4wt.js} +2 -2
  107. package/dist/{chunk-fjxhga6w.js → chunk-pqbxa0r7.js} +2 -2
  108. package/dist/chunk-q245q8z1.js +2 -0
  109. package/dist/{chunk-5q9ss7ty.js → chunk-q3azy64b.js} +4 -4
  110. package/dist/chunk-qm3jbse5.js +2 -0
  111. package/dist/{chunk-yftw25sa.js → chunk-qx0np0hy.js} +2 -2
  112. package/dist/{chunk-qwsgc5rc.js → chunk-qystt1qc.js} +1 -1
  113. package/dist/{chunk-v20cwjgz.js → chunk-qyzjkvme.js} +6 -6
  114. package/dist/chunk-r13fwtas.js +2 -0
  115. package/dist/{chunk-dh9aagwm.js → chunk-r1tp2gnr.js} +1 -1
  116. package/dist/chunk-r5tsewzd.js +2 -0
  117. package/dist/{chunk-v2egd4zh.js → chunk-r6yb0540.js} +5 -5
  118. package/dist/{chunk-pes27snj.js → chunk-r8zhed35.js} +3 -3
  119. package/dist/{chunk-hmydy949.js → chunk-rh2qth8r.js} +5 -5
  120. package/dist/chunk-rha8sv1h.js +3 -0
  121. package/dist/{chunk-vh1d5eqk.js → chunk-t2cq4bpe.js} +6 -6
  122. package/dist/chunk-tfy1m821.js +2 -0
  123. package/dist/{chunk-465resq9.js → chunk-tpfxvw4q.js} +17 -17
  124. package/dist/{chunk-t6qn1374.js → chunk-tshpcvcy.js} +2 -2
  125. package/dist/{chunk-spjpdymh.js → chunk-ttqs99jj.js} +2 -2
  126. package/dist/chunk-v1ff2dfp.js +7 -0
  127. package/dist/chunk-vc3ppphz.js +2 -0
  128. package/dist/{chunk-x1q2ape8.js → chunk-vv8dn70r.js} +14 -14
  129. package/dist/{chunk-06zn167b.js → chunk-vvs28yqw.js} +8 -8
  130. package/dist/chunk-w2pch5xn.js +4 -0
  131. package/dist/chunk-w512gnft.js +2 -0
  132. package/dist/{chunk-j4snweyz.js → chunk-wby7qzha.js} +3 -3
  133. package/dist/{chunk-b6g24qj0.js → chunk-wghtdgwj.js} +2 -2
  134. package/dist/chunk-wk8y89q2.js +25 -0
  135. package/dist/{chunk-19safa6y.js → chunk-wmnzapn8.js} +2 -2
  136. package/dist/chunk-wmxsaxt0.js +2 -0
  137. package/dist/chunk-wq1vs94k.js +2 -0
  138. package/dist/chunk-wwnqbv9j.js +3 -0
  139. package/dist/{chunk-a5d888es.js → chunk-wycrtkw4.js} +6 -6
  140. package/dist/chunk-x1q7b7jg.js +2 -0
  141. package/dist/chunk-x1x69g3s.js +2 -0
  142. package/dist/{chunk-gs373714.js → chunk-x5seqmrv.js} +2 -2
  143. package/dist/{chunk-r5jytt0f.js → chunk-x7q4tp3f.js} +4 -4
  144. package/dist/{chunk-bsq9zg9j.js → chunk-xt034729.js} +6 -6
  145. package/dist/chunk-y5emxzbt.js +2 -0
  146. package/dist/chunk-y6mqq78g.js +2 -0
  147. package/dist/{chunk-11kejz35.js → chunk-yh5658q8.js} +1 -1
  148. package/dist/chunk-yhbsvf65.js +54 -0
  149. package/dist/{chunk-00ns0516.js → chunk-yjzk7rwt.js} +6 -6
  150. package/dist/chunk-yn3kff5k.js +2 -0
  151. package/dist/chunk-ynjm2tm0.js +2 -0
  152. package/dist/chunk-yp80rx17.js +2 -0
  153. package/dist/chunk-z5xermzg.js +2 -0
  154. package/dist/{chunk-j04v4rgf.js → chunk-zhrz4zvw.js} +5 -5
  155. package/dist/cli.js +20 -20
  156. package/dist/composable-loader.d.ts +1 -1
  157. package/dist/composable-loader.js +47 -10
  158. package/dist/craft-entry.js +2 -2
  159. package/dist/craft.js +2 -2
  160. package/dist/message-catalogs.d.ts +39 -0
  161. package/dist/message-catalogs.js +128 -0
  162. package/dist/native/compiler/bundle.js +11 -36
  163. package/dist/native/compiler/html-to-ir.js +32 -0
  164. package/dist/native/compiler/render-screen.js +1 -1
  165. package/dist/native/compiler/setup-script.d.ts +1 -0
  166. package/dist/native/compiler/shared-scripts.js +10 -0
  167. package/dist/native/runtime/compact-document.d.ts +20 -0
  168. package/dist/native/runtime/compact-document.js +101 -0
  169. package/dist/process.d.ts +1 -1
  170. package/dist/process.js +87 -22
  171. package/dist/pwa.js +3 -3
  172. package/dist/ssg.js +14 -14
  173. package/dist/store-loader.d.ts +27 -3
  174. package/dist/store-loader.js +144 -4
  175. package/dist/types/config-types.d.ts +1 -0
  176. package/package.json +5 -5
  177. package/dist/chunk-055v5qz2.js +0 -2
  178. package/dist/chunk-0b7f2mby.js +0 -2
  179. package/dist/chunk-0j7e56zm.js +0 -2
  180. package/dist/chunk-0jn79fkt.js +0 -25
  181. package/dist/chunk-0y44f9rk.js +0 -2
  182. package/dist/chunk-3h2yz805.js +0 -2
  183. package/dist/chunk-3jfes9b0.js +0 -2
  184. package/dist/chunk-4m8bexrn.js +0 -33
  185. package/dist/chunk-4tz00fkp.js +0 -2
  186. package/dist/chunk-52q8184e.js +0 -2
  187. package/dist/chunk-59ytzyp1.js +0 -2
  188. package/dist/chunk-5ffdtfwg.js +0 -2
  189. package/dist/chunk-5q551m4w.js +0 -2
  190. package/dist/chunk-6ndeycxk.js +0 -2
  191. package/dist/chunk-6xt3kvq1.js +0 -2
  192. package/dist/chunk-75r09rqt.js +0 -2
  193. package/dist/chunk-79y41h1d.js +0 -2
  194. package/dist/chunk-7h5d35bf.js +0 -2
  195. package/dist/chunk-82ybmdqk.js +0 -2
  196. package/dist/chunk-8frs2dtp.js +0 -2
  197. package/dist/chunk-8n2gj4q2.js +0 -11
  198. package/dist/chunk-8prq9t3b.js +0 -2
  199. package/dist/chunk-8sxngenk.js +0 -2
  200. package/dist/chunk-90er677t.js +0 -2
  201. package/dist/chunk-aakkjjgr.js +0 -2
  202. package/dist/chunk-abs1k04e.js +0 -2
  203. package/dist/chunk-c05r0rzw.js +0 -3
  204. package/dist/chunk-c7yjhjr2.js +0 -2
  205. package/dist/chunk-cpep999n.js +0 -2
  206. package/dist/chunk-cvwn6mga.js +0 -2
  207. package/dist/chunk-davr7z73.js +0 -2
  208. package/dist/chunk-dqs4bgec.js +0 -2
  209. package/dist/chunk-e30kgg28.js +0 -2
  210. package/dist/chunk-e3fkq9gb.js +0 -2
  211. package/dist/chunk-eab8na0z.js +0 -2
  212. package/dist/chunk-exg7ry7b.js +0 -2
  213. package/dist/chunk-f4mmk2cx.js +0 -2
  214. package/dist/chunk-fhwn8j9p.js +0 -2
  215. package/dist/chunk-fj105fff.js +0 -2
  216. package/dist/chunk-g387j1qv.js +0 -2
  217. package/dist/chunk-gefpzry6.js +0 -2
  218. package/dist/chunk-ghzycypz.js +0 -2
  219. package/dist/chunk-gvaee1w0.js +0 -170
  220. package/dist/chunk-k37472gm.js +0 -2
  221. package/dist/chunk-k3wnmpt3.js +0 -2
  222. package/dist/chunk-kb8654dp.js +0 -4
  223. package/dist/chunk-kfqdx75m.js +0 -2
  224. package/dist/chunk-mgx71bfg.js +0 -2
  225. package/dist/chunk-mmhbn7xt.js +0 -2
  226. package/dist/chunk-mzcbfra0.js +0 -2
  227. package/dist/chunk-nv9dy71x.js +0 -54
  228. package/dist/chunk-ny2qzraq.js +0 -2
  229. package/dist/chunk-pg15tx9c.js +0 -2
  230. package/dist/chunk-ppc5s12t.js +0 -2
  231. package/dist/chunk-ptzzpf97.js +0 -2
  232. package/dist/chunk-qgsrxyh9.js +0 -2
  233. package/dist/chunk-qmxcs806.js +0 -2
  234. package/dist/chunk-qn4gt8sx.js +0 -3
  235. package/dist/chunk-qryg0hgn.js +0 -2
  236. package/dist/chunk-qt17792g.js +0 -2
  237. package/dist/chunk-qz9fzz5k.js +0 -2
  238. package/dist/chunk-rh90yh1c.js +0 -2
  239. package/dist/chunk-rvc0pb16.js +0 -2
  240. package/dist/chunk-sj5t0tnv.js +0 -2
  241. package/dist/chunk-t4mpq6t0.js +0 -3
  242. package/dist/chunk-tb6jcr2v.js +0 -2
  243. package/dist/chunk-tn40nh9e.js +0 -3
  244. package/dist/chunk-xcq41ah8.js +0 -2
  245. package/dist/chunk-y3jbkk7a.js +0 -2
  246. package/dist/chunk-yme43vbp.js +0 -2
  247. package/dist/chunk-yv8jeqdn.js +0 -2
  248. package/dist/chunk-zq7g0687.js +0 -2
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Sl,Lg}from"./chunk-8yyq3nfg.js";export{Sl as captureScreenshot,Lg as captureScreenshots};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import y from"fs";import R from"path";var S="_stx";function F(e){return Bun.hash(e).toString(16).slice(0,8)}function k(e){let t=[],n=(i)=>{for(let s of y.readdirSync(i,{withFileTypes:!0})){let r=R.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(y.existsSync(e))n(e);return t}var z=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-runtime src="${e}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-router src="${e}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(e)=>`<link data-css="generated" rel="stylesheet" href="${e}">`}];function I(e,t=`/${S}`){let n=[],i=new Set,s=0,r=e;for(let o of z)r=r.replace(o.pattern,(g,u,c)=>{if(/\b(?:src|href)\s*=/.test(u)||!c.trim())return g;let a=`${o.prefix}.${F(c)}.${o.extension}`;if(!i.has(a))i.add(a),n.push({filename:a,contents:c,contentType:o.contentType});return s+=c.length,o.replace(`${t}/${a}`)});return{html:r,assets:n,bytesInlined:s}}function Wa(e){let t={pages:0,assets:0,bytesInlined:0},n=R.join(e,S),i=new Set;for(let s of k(e)){let r=y.readFileSync(s,"utf8"),{html:o,assets:g,bytesInlined:u}=I(r);if(o===r)continue;for(let c of g){if(i.has(c.filename))continue;i.add(c.filename),y.mkdirSync(n,{recursive:!0}),y.writeFileSync(R.join(n,c.filename),c.contents),t.assets++}y.writeFileSync(s,o),t.bytesInlined+=u,t.pages++}return t}import h from"fs";import T from"path";var L=1024,N=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,_=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function B(e){return Bun.hash(e).toString(16).slice(0,8)}function C(e){let t=[],n=(i)=>{for(let s of h.readdirSync(i,{withFileTypes:!0})){let r=T.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(h.existsSync(e))n(e);return t}function O(e,t){let n=e.match(new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!n)return;return n[2]??n[3]??n[4]??""}function H(e,t,n){if(n.length<L)return!1;if(/\b(?:src|href)\s*=/i.test(t))return!1;if(e.toLowerCase()==="script"){if(!_.has((O(t,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function D(e){let t=[];for(let n of e.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))t.push([n.index,n.index+n[0].length]);return t}function qa(e){let t={pages:0,assets:0,bytesInlined:0},n=C(e);if(n.length<2)return t;let i=new Map,s=new Map;for(let a of n){let f=h.readFileSync(a,"utf8");i.set(a,f);let M=D(f);for(let d of f.matchAll(N)){let[x,p,l,m]=d;if(!H(p,l,m))continue;if(M.some(([j,A])=>d.index>=j&&d.index<A))continue;let w=`${p.toLowerCase()}\x00${m}`,b=s.get(w);if(b)b.push({file:a,whole:x,tag:p,attrs:l,body:m});else s.set(w,[{file:a,whole:x,tag:p,attrs:l,body:m}])}}let r=[...s.values()].filter((a)=>new Set(a.map((f)=>f.file)).size>1);if(r.length===0)return t;let o=T.join(e,S),g=new Map(i),u=new Map,c=[];for(let a of r){let{tag:f,body:M}=a[0],d=f.toLowerCase()==="script",x=`${d?"chunk":"style"}.${B(M)}.${d?"js":"css"}`;c.push({filename:x,contents:M,contentType:d?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let p=`/${S}/${x}`;for(let l of a){let m=d?`<script${l.attrs} src="${p}"></script>`:`<link${l.attrs} rel="stylesheet" href="${p}">`,w=g.get(l.file),b=w.replace(l.whole,()=>m);if(b===w)continue;g.set(l.file,b),u.set(l.file,(u.get(l.file)??0)+l.body.length)}}h.mkdirSync(o,{recursive:!0});for(let a of c)h.writeFileSync(T.join(o,a.filename),a.contents),t.assets++;for(let[a,f]of g){if(f===i.get(a))continue;h.writeFileSync(a,f),t.pages++,t.bytesInlined+=u.get(a)??0}return t}import E from"fs";import v from"path";var K="layout-types.d.ts";function P(e){let t=[],n=(i,s)=>{let r;try{r=E.readdirSync(i,{withFileTypes:!0})}catch{return}for(let o of r){if(o.name.startsWith("."))continue;let g=v.join(i,o.name);if(o.isDirectory())n(g,s?`${s}/${o.name}`:o.name);else if(o.isFile()&&o.name.endsWith(".stx")&&o.name!=="_layout.stx"){let u=o.name.slice(0,-4);t.push(s?`${s}/${u}`:u)}}};return n(e,""),t.sort()}function W(e){let t=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(e.length===0)return t.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),t.join(`
2
+ import y from"fs";import R from"path";var S="_stx";function F(e){return Bun.hash(e).toString(16).slice(0,8)}function k(e){let t=[],n=(i)=>{for(let s of y.readdirSync(i,{withFileTypes:!0})){let r=R.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(y.existsSync(e))n(e);return t}var z=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-runtime src="${e}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-router src="${e}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(e)=>`<link data-css="generated" rel="stylesheet" href="${e}">`}];function I(e,t=`/${S}`){let n=[],i=new Set,s=0,r=e;for(let o of z)r=r.replace(o.pattern,(g,u,c)=>{if(/\b(?:src|href)\s*=/.test(u)||!c.trim())return g;let a=`${o.prefix}.${F(c)}.${o.extension}`;if(!i.has(a))i.add(a),n.push({filename:a,contents:c,contentType:o.contentType});return s+=c.length,o.replace(`${t}/${a}`)});return{html:r,assets:n,bytesInlined:s}}function qa(e){let t={pages:0,assets:0,bytesInlined:0},n=R.join(e,S),i=new Set;for(let s of k(e)){let r=y.readFileSync(s,"utf8"),{html:o,assets:g,bytesInlined:u}=I(r);if(o===r)continue;for(let c of g){if(i.has(c.filename))continue;i.add(c.filename),y.mkdirSync(n,{recursive:!0}),y.writeFileSync(R.join(n,c.filename),c.contents),t.assets++}y.writeFileSync(s,o),t.bytesInlined+=u,t.pages++}return t}import h from"fs";import T from"path";var L=1024,N=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,_=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function B(e){return Bun.hash(e).toString(16).slice(0,8)}function C(e){let t=[],n=(i)=>{for(let s of h.readdirSync(i,{withFileTypes:!0})){let r=T.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(h.existsSync(e))n(e);return t}function O(e,t){let n=e.match(new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!n)return;return n[2]??n[3]??n[4]??""}function H(e,t,n){if(n.length<L)return!1;if(/\b(?:src|href)\s*=/i.test(t))return!1;if(e.toLowerCase()==="script"){if(!_.has((O(t,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function D(e){let t=[];for(let n of e.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))t.push([n.index,n.index+n[0].length]);return t}function Ka(e){let t={pages:0,assets:0,bytesInlined:0},n=C(e);if(n.length<2)return t;let i=new Map,s=new Map;for(let a of n){let f=h.readFileSync(a,"utf8");i.set(a,f);let M=D(f);for(let d of f.matchAll(N)){let[x,p,l,m]=d;if(!H(p,l,m))continue;if(M.some(([j,A])=>d.index>=j&&d.index<A))continue;let w=`${p.toLowerCase()}\x00${m}`,b=s.get(w);if(b)b.push({file:a,whole:x,tag:p,attrs:l,body:m});else s.set(w,[{file:a,whole:x,tag:p,attrs:l,body:m}])}}let r=[...s.values()].filter((a)=>new Set(a.map((f)=>f.file)).size>1);if(r.length===0)return t;let o=T.join(e,S),g=new Map(i),u=new Map,c=[];for(let a of r){let{tag:f,body:M}=a[0],d=f.toLowerCase()==="script",x=`${d?"chunk":"style"}.${B(M)}.${d?"js":"css"}`;c.push({filename:x,contents:M,contentType:d?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let p=`/${S}/${x}`;for(let l of a){let m=d?`<script${l.attrs} src="${p}"></script>`:`<link${l.attrs} rel="stylesheet" href="${p}">`,w=g.get(l.file),b=w.replace(l.whole,()=>m);if(b===w)continue;g.set(l.file,b),u.set(l.file,(u.get(l.file)??0)+l.body.length)}}h.mkdirSync(o,{recursive:!0});for(let a of c)h.writeFileSync(T.join(o,a.filename),a.contents),t.assets++;for(let[a,f]of g){if(f===i.get(a))continue;h.writeFileSync(a,f),t.pages++,t.bytesInlined+=u.get(a)??0}return t}import E from"fs";import v from"path";var K="layout-types.d.ts";function P(e){let t=[],n=(i,s)=>{let r;try{r=E.readdirSync(i,{withFileTypes:!0})}catch{return}for(let o of r){if(o.name.startsWith("."))continue;let g=v.join(i,o.name);if(o.isDirectory())n(g,s?`${s}/${o.name}`:o.name);else if(o.isFile()&&o.name.endsWith(".stx")&&o.name!=="_layout.stx"){let u=o.name.slice(0,-4);t.push(s?`${s}/${u}`:u)}}};return n(e,""),t.sort()}function W(e){let t=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(e.length===0)return t.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),t.join(`
3
3
  `);return t.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...e.map((n)=>` '${n}': true`)," }","}","","export {}",""),t.join(`
4
- `)}function Ka(e,t){if(!e)return[];let n=v.isAbsolute(e)?e:v.resolve(process.cwd(),e),i=P(n),s=W(i),r=v.join(t,K);try{if(E.existsSync(r)&&E.readFileSync(r,"utf8")===s)return i;E.mkdirSync(t,{recursive:!0}),E.writeFileSync(r,s)}catch{}return i}
5
- export{Wa,qa,Ka};
4
+ `)}function Ga(e,t){if(!e)return[];let n=v.isAbsolute(e)?e:v.resolve(process.cwd(),e),i=P(n),s=W(i),r=v.join(t,K);try{if(E.existsSync(r)&&E.readFileSync(r,"utf8")===s)return i;E.mkdirSync(t,{recursive:!0}),E.writeFileSync(r,s)}catch{}return i}
5
+ export{qa,Ka,Ga};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function zt(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function Js(e,t){if(console.log(a(" Server running at:")),console.log(""),console.log(` ${m("\u279C")} ${a("Local:")} ${c(e)}`),t)console.log(` ${m("\u279C")} ${a("Network:")} ${c(t)}`);console.log("")}function Ht(e){let t=e>0?"\u2713":"\u25CB",r=e>0?S:y;console.log(` ${r(t)} Found ${a(String(e))} story ${e===1?"file":"files"}`)}function Li(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function it(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function ji(e){console.log(` ${O("\u2139")} ${e}`)}function Bi(e,t,r){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" Build Complete ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${S("\u2713")} Stories: ${a(String(e))}`),console.log(` ${S("\u2713")} Output: ${a(t)}`),console.log(` ${S("\u2713")} Time: ${a(`${r}ms`)}`),console.log("")}function Ys(){console.log(""),console.log(a(" Keyboard Shortcuts:")),console.log(""),console.log(` ${c("h")} Show this help`),console.log(` ${c("o")} Open in browser`),console.log(` ${c("r")} Restart server`),console.log(` ${c("c")} Clear console`),console.log(` ${c("q")} Quit`),console.log("")}import h from"fs";import d from"path";async function Vt(e){let{root:t,config:r}=e,o=[],i=await P(t,r.storyMatch,r.storyIgnored);for(let s of i){let n=d.resolve(t,s),l=v(s,n);o.push(l)}return o}async function P(e,t,r){let o=[];async function i(s,n){let l=await h.promises.readdir(s,{withFileTypes:!0});for(let g of l){let f=d.join(s,g.name),u=d.relative(n,f);if(T(u,r))continue;if(g.isDirectory())await i(f,n);else if(g.isFile()){if(F(u,t))o.push(u)}}}return await i(e,e),o}function T(e,t){for(let r of t)if(E(e,r))return!0;return!1}function F(e,t){for(let r of t)if(E(e,r))return!0;return!1}function E(e,t){let r=e.replace(/\\/g,"/"),i=t.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return i=`^${i}$`,new RegExp(i).test(r)}function v(e,t){let r=d.basename(e,".story.stx");return{id:e.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:t,relativePath:e,fileName:r,treeFile:{title:r,path:e}}}function Fi(e,t){let{root:r,config:o}=e,i=[],s=h.watch(r,{recursive:!0},async(n,l)=>{if(!l)return;let g=l.replace(/\\/g,"/");if(!F(g,o.storyMatch))return;if(T(g,o.storyIgnored))return;let f=d.resolve(r,g);try{await h.promises.access(f);let u=v(g,f);t(n==="rename"?"add":"change",u)}catch{let u=v(g,f);t("unlink",u)}});return i.push(s),()=>{for(let n of i)n.close()}}function N(e,t){let r=t.treeFile||{title:t.fileName,path:t.relativePath};if(e.tree.file==="title")return r.title.split("/");if(e.tree.file==="path")return[...t.relativePath.split("/").slice(0,-1),r.title];if(typeof e.tree.file==="function")return e.tree.file(r);return[r.title]}function Ut(e,t){for(let n of t)n.treePath=N(e,n);let r=(e.tree.groups||[]).map((n)=>({groupConfig:{id:n.id||n.title,title:n.title,include:n.include},treeObject:{}})),o={treeObject:{}};r.push(o);for(let n=0;n<t.length;n++){let l=t[n],g=j(l,r,o);k(l.treePath,n,g.treeObject)}let i=e.tree.order==="asc"?(n,l)=>n.localeCompare(l):e.tree.order,s=[];for(let n of r)if(n===o)s.push(...x(n.treeObject,i));else if(n.groupConfig&&Object.keys(n.treeObject).length>0)s.push({group:!0,id:n.groupConfig.id,title:n.groupConfig.title,children:x(n.treeObject,i)});return s}function j(e,t,r){let o=e.treeFile||{title:e.fileName,path:e.relativePath};for(let i of t)if(i.groupConfig?.include&&i.groupConfig.include(o))return i;return r}function k(e,t,r){let o=r;for(let i=0;i<e.length;i++){let s=e[i];if(i===e.length-1)if(o[s]!==void 0){let l=1;while(o[`${s}-${l}`]!==void 0)l++;o[`${s}-${l}`]=t}else o[s]=t;else{if(o[s]===void 0)o[s]={};else if(typeof o[s]==="number"){let l=o[s];o[s]={"":l}}o=o[s]}}}function x(e,t){let r=[];for(let[o,i]of Object.entries(e))if(typeof i==="number")r.push({title:o,index:i});else r.push({title:o,children:x(i,t)});return r.sort((o,i)=>t(o.title,i.title)),r}
3
- export{zt,Js,Ht,Li,it,ji,Bi,Ys,Vt,Fi,Ut};
2
+ var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function Ht(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function Ys(e,t){if(console.log(a(" Server running at:")),console.log(""),console.log(` ${m("\u279C")} ${a("Local:")} ${c(e)}`),t)console.log(` ${m("\u279C")} ${a("Network:")} ${c(t)}`);console.log("")}function Vt(e){let t=e>0?"\u2713":"\u25CB",r=e>0?S:y;console.log(` ${r(t)} Found ${a(String(e))} story ${e===1?"file":"files"}`)}function Bi(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function at(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function Fi(e){console.log(` ${O("\u2139")} ${e}`)}function zi(e,t,r){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" Build Complete ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${S("\u2713")} Stories: ${a(String(e))}`),console.log(` ${S("\u2713")} Output: ${a(t)}`),console.log(` ${S("\u2713")} Time: ${a(`${r}ms`)}`),console.log("")}function Zs(){console.log(""),console.log(a(" Keyboard Shortcuts:")),console.log(""),console.log(` ${c("h")} Show this help`),console.log(` ${c("o")} Open in browser`),console.log(` ${c("r")} Restart server`),console.log(` ${c("c")} Clear console`),console.log(` ${c("q")} Quit`),console.log("")}import h from"fs";import d from"path";async function Ut(e){let{root:t,config:r}=e,o=[],i=await P(t,r.storyMatch,r.storyIgnored);for(let s of i){let n=d.resolve(t,s),l=v(s,n);o.push(l)}return o}async function P(e,t,r){let o=[];async function i(s,n){let l=await h.promises.readdir(s,{withFileTypes:!0});for(let g of l){let f=d.join(s,g.name),u=d.relative(n,f);if(T(u,r))continue;if(g.isDirectory())await i(f,n);else if(g.isFile()){if(F(u,t))o.push(u)}}}return await i(e,e),o}function T(e,t){for(let r of t)if(E(e,r))return!0;return!1}function F(e,t){for(let r of t)if(E(e,r))return!0;return!1}function E(e,t){let r=e.replace(/\\/g,"/"),i=t.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return i=`^${i}$`,new RegExp(i).test(r)}function v(e,t){let r=d.basename(e,".story.stx");return{id:e.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:t,relativePath:e,fileName:r,treeFile:{title:r,path:e}}}function Hi(e,t){let{root:r,config:o}=e,i=[],s=h.watch(r,{recursive:!0},async(n,l)=>{if(!l)return;let g=l.replace(/\\/g,"/");if(!F(g,o.storyMatch))return;if(T(g,o.storyIgnored))return;let f=d.resolve(r,g);try{await h.promises.access(f);let u=v(g,f);t(n==="rename"?"add":"change",u)}catch{let u=v(g,f);t("unlink",u)}});return i.push(s),()=>{for(let n of i)n.close()}}function N(e,t){let r=t.treeFile||{title:t.fileName,path:t.relativePath};if(e.tree.file==="title")return r.title.split("/");if(e.tree.file==="path")return[...t.relativePath.split("/").slice(0,-1),r.title];if(typeof e.tree.file==="function")return e.tree.file(r);return[r.title]}function Wt(e,t){for(let n of t)n.treePath=N(e,n);let r=(e.tree.groups||[]).map((n)=>({groupConfig:{id:n.id||n.title,title:n.title,include:n.include},treeObject:{}})),o={treeObject:{}};r.push(o);for(let n=0;n<t.length;n++){let l=t[n],g=j(l,r,o);k(l.treePath,n,g.treeObject)}let i=e.tree.order==="asc"?(n,l)=>n.localeCompare(l):e.tree.order,s=[];for(let n of r)if(n===o)s.push(...x(n.treeObject,i));else if(n.groupConfig&&Object.keys(n.treeObject).length>0)s.push({group:!0,id:n.groupConfig.id,title:n.groupConfig.title,children:x(n.treeObject,i)});return s}function j(e,t,r){let o=e.treeFile||{title:e.fileName,path:e.relativePath};for(let i of t)if(i.groupConfig?.include&&i.groupConfig.include(o))return i;return r}function k(e,t,r){let o=r;for(let i=0;i<e.length;i++){let s=e[i];if(i===e.length-1)if(o[s]!==void 0){let l=1;while(o[`${s}-${l}`]!==void 0)l++;o[`${s}-${l}`]=t}else o[s]=t;else{if(o[s]===void 0)o[s]={};else if(typeof o[s]==="number"){let l=o[s];o[s]={"":l}}o=o[s]}}}function x(e,t){let r=[];for(let[o,i]of Object.entries(e))if(typeof i==="number")r.push({title:o,index:i});else r.push({title:o,children:x(i,t)});return r.sort((o,i)=>t(o.title,i.title)),r}
3
+ export{Ht,Ys,Vt,Bi,at,Fi,zi,Zs,Ut,Hi,Wt};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{er,i}from"./chunk-23t9anc0.js";import"./chunk-7y1rpd4g.js";import"./chunk-b0z2n941.js";import"./chunk-wk8y89q2.js";import"./chunk-yhbsvf65.js";import"./chunk-bjhesw78.js";import"./chunk-krsg6dgz.js";import"./chunk-9k8ztdcc.js";import"./chunk-vvs28yqw.js";import{we}from"./chunk-frybxj35.js";import"./chunk-k2ex94n8.js";import"./chunk-4rxmxc1p.js";import"./chunk-vv8dn70r.js";import"./chunk-kj9m0vc6.js";import"./chunk-8rk79ha1.js";import"./chunk-q3azy64b.js";import"./chunk-evxp3wmv.js";import"./chunk-f8p8ggvw.js";import{Oe,Ms,Ls}from"./chunk-2cbd1ew6.js";import"./chunk-wghtdgwj.js";import"./chunk-x5seqmrv.js";import"./chunk-tpfxvw4q.js";import"./chunk-4833k99b.js";import"./chunk-b51p56k5.js";export{er as buildModulesTag,we as injectRouterScript,i as processDirectives,Ms as processJsonDirective,Ls as processOnceDirective,Oe as validateClientScript};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{de,Ic,Ns,gn,m,De,Me}from"./chunk-m5fjhrpd.js";import{lr,Ye,j}from"./chunk-x1q2ape8.js";import{Qn,i}from"./chunk-fpagqrd1.js";import{be}from"./chunk-0dkd26t4.js";function b(s){return s.endsWith(".md")||s.endsWith(".markdown")}function k(s){let e=[];g(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];g(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function g(n,p){let u;while((u=n.exec(s))!==null){let t=u.index,o=t+u[0].length;if(p?.some((l)=>t>=l.start&&o<=l.end))continue;e.push({start:t,end:o})}}if(e.length===0)return s;e.sort((n,p)=>n.start-p.start);let c="",a=0;for(let n of e){if(n.start<a)continue;c+=s.slice(a,n.start),c+=`@raw${s.slice(n.start,n.end)}@endraw`,a=n.end}return c+=s.slice(a),c}async function R(s,e={}){let{data:r,content:g}=lr(s),a=await(e.renderer??((n)=>Ye(n)))(g);return{html:k(a),frontmatter:r??{}}}import{dirname as v,resolve as _}from"path";function M(s){let e=s,r=de(s);if(r)e=r.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,c=[],a=[],n=[],p=(o)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(o),u;while((u=g.exec(s))!==null){let o=u[1],l=u[2],d=u[0],f=o.includes("server");if(p(l))n.push(d);else if(f)a.push(l);else c.push(d)}let t=e;{let o=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,d=[];while((l=o.exec(t))!==null){let f=l.index+l[0].length,x=t.indexOf("</script>",f);if(x===-1)continue;d.push({start:l.index,end:x+9}),o.lastIndex=x+9}for(let f=d.length-1;f>=0;f--)t=t.substring(0,d[f].start)+t.substring(d[f].end)}for(let o of c)t=t.replace(o,"");return{templateContent:t,serverScripts:a,clientScripts:c,signalsScripts:n}}function E(s,e){return`<!DOCTYPE html>
2
+ import{de,Oc,Ds,gn,m,Me,Le}from"./chunk-2cbd1ew6.js";import{ur,Ze,j}from"./chunk-vv8dn70r.js";import{er,i}from"./chunk-23t9anc0.js";import{we}from"./chunk-frybxj35.js";function b(s){return s.endsWith(".md")||s.endsWith(".markdown")}function k(s){let e=[];g(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];g(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function g(n,p){let u;while((u=n.exec(s))!==null){let t=u.index,o=t+u[0].length;if(p?.some((l)=>t>=l.start&&o<=l.end))continue;e.push({start:t,end:o})}}if(e.length===0)return s;e.sort((n,p)=>n.start-p.start);let c="",a=0;for(let n of e){if(n.start<a)continue;c+=s.slice(a,n.start),c+=`@raw${s.slice(n.start,n.end)}@endraw`,a=n.end}return c+=s.slice(a),c}async function R(s,e={}){let{data:r,content:g}=ur(s),a=await(e.renderer??((n)=>Ze(n)))(g);return{html:k(a),frontmatter:r??{}}}import{dirname as v,resolve as _}from"path";function M(s){let e=s,r=de(s);if(r)e=r.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,c=[],a=[],n=[],p=(o)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(o),u;while((u=g.exec(s))!==null){let o=u[1],l=u[2],d=u[0],f=o.includes("server");if(p(l))n.push(d);else if(f)a.push(l);else c.push(d)}let t=e;{let o=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,d=[];while((l=o.exec(t))!==null){let f=l.index+l[0].length,x=t.indexOf("</script>",f);if(x===-1)continue;d.push({start:l.index,end:x+9}),o.lastIndex=x+9}for(let f=d.length-1;f>=0;f--)t=t.substring(0,d[f].start)+t.substring(d[f].end)}for(let o of c)t=t.replace(o,"");return{templateContent:t,serverScripts:a,clientScripts:c,signalsScripts:n}}function E(s,e){return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -9,10 +9,10 @@ import{de,Ic,Ns,gn,m,De,Me}from"./chunk-m5fjhrpd.js";import{lr,Ye,j}from"./chunk
9
9
  <body>
10
10
  ${s}
11
11
  </body>
12
- </html>`}async function Va(s,e={}){let r=_(s),g=Bun.file(r);if(!await g.exists())throw Error(`Template file not found: ${r}`);let c=await g.text(),a=null;if(b(r)){let n=await R(c,{renderer:e.markdownRenderer});c=n.html,a=n.frontmatter}if(a)e={...e,context:{...a,...e.context||{}}};if(e.layout){let n=_(e.layout),p=Bun.file(n);if(!await p.exists())throw Error(`Layout template not found: ${n}`);let{layout:u,injectCSS:t,...o}=e,l={...e.context||{}};gn(l);let d=await S(c,r,{...o,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),f=await p.text(),x={...l,content:d},y={...o,context:x,injectCSS:t};return S(f,n,y)}return S(c,r,e)}async function S(s,e,r={}){let{templateContent:g,serverScripts:c,clientScripts:a}=M(s),n={...j,...r.options},p={__filename:e,__dirname:v(e),__stx:{},__stx_options:n,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...Ns(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let o of c)await m(o,p,e);let u=new Set,t=g;if(t=await i(t,p,e,n,u),Ic(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),a.length>0)t+=`
12
+ </html>`}async function Ua(s,e={}){let r=_(s),g=Bun.file(r);if(!await g.exists())throw Error(`Template file not found: ${r}`);let c=await g.text(),a=null;if(b(r)){let n=await R(c,{renderer:e.markdownRenderer});c=n.html,a=n.frontmatter}if(a)e={...e,context:{...a,...e.context||{}}};if(e.layout){let n=_(e.layout),p=Bun.file(n);if(!await p.exists())throw Error(`Layout template not found: ${n}`);let{layout:u,injectCSS:t,...o}=e,l={...e.context||{}};gn(l);let d=await S(c,r,{...o,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),f=await p.text(),x={...l,content:d},y={...o,context:x,injectCSS:t};return S(f,n,y)}return S(c,r,e)}async function S(s,e,r={}){let{templateContent:g,serverScripts:c,clientScripts:a}=M(s),n={...j,...r.options},p={__filename:e,__dirname:v(e),__stx:{},__stx_options:n,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...Ds(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let o of c)await m(o,p,e);let u=new Set,t=g;if(t=await i(t,p,e,n,u),Oc(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),a.length>0)t+=`
13
13
  ${a.join(`
14
- `)}`}else{if(r.processClientScripts!==!1&&a.length>0){let o=p.__stx_event_bindings||[],l=De(p),d=await Promise.all(a.map(async(w)=>{let C=w.match(/<script\b([^>]*)>/i)?.[1]||"";if(/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(C))return w;let h=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!h)return w;return await Me(h[1],{eventBindings:o,templateContent:t,serverData:l,filePath:e})})),x=[await Qn(d,{...n,buildMode:"compile"}),...d].filter(Boolean).join(`
14
+ `)}`}else{if(r.processClientScripts!==!1&&a.length>0){let o=p.__stx_event_bindings||[],l=Me(p),d=await Promise.all(a.map(async(w)=>{let C=w.match(/<script\b([^>]*)>/i)?.[1]||"";if(/\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(C))return w;let h=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!h)return w;return await Le(h[1],{eventBindings:o,templateContent:t,serverData:l,filePath:e})})),x=[await er(d,{...n,buildMode:"compile"}),...d].filter(Boolean).join(`
15
15
  `);if(t.match(/(<\/body>)/i))t=t.replace(/(<\/body>)/i,`${x}
16
16
  $1`);else t+=`
17
- ${x}`}t=await be(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=E(t,r.title)}if(r.injectCSS)try{let{injectCss:o}=await import("./chunk-davr7z73.js");t=await o(t)}catch{}return t}
18
- export{Va};
17
+ ${x}`}t=await we(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=E(t,r.title)}if(r.injectCSS)try{let{injectCss:o}=await import("./chunk-wq1vs94k.js");t=await o(t)}catch{}return t}
18
+ export{Ua};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- var d=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],u=/<body\b([^>]*)>/gi;function L(n){let i=0,e,c=d.map(()=>{return});while(i<n.length){if(e===void 0||e!==null&&e.index<i)u.lastIndex=i,e=u.exec(n);if(!e)return null;let a=e.index,r=-1,o=null;for(let l=0;l<d.length;l++){let g=d[l],t=c[l];if(t===void 0||t!==null&&t.index<i)g.open.lastIndex=i,t=g.open.exec(n),c[l]=t;if(!t)continue;if(t.index<a&&(r===-1||t.index<r))r=t.index,o=g.close}if(r===-1||!o)return{index:a,tag:e[0],attrs:e[1]??""};o.lastIndex=r;let s=o.exec(n);if(!s)return null;i=s.index+s[0].length}return null}function Xe(n,i){let e=L(n);if(!e)return n;return n.slice(0,e.index)+i(e.tag,e.attrs)+n.slice(e.index+e.tag.length)}
3
- export{L,Xe};
2
+ var d=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],u=/<body\b([^>]*)>/gi;function L(n){let i=0,e,c=d.map(()=>{return});while(i<n.length){if(e===void 0||e!==null&&e.index<i)u.lastIndex=i,e=u.exec(n);if(!e)return null;let a=e.index,r=-1,o=null;for(let l=0;l<d.length;l++){let g=d[l],t=c[l];if(t===void 0||t!==null&&t.index<i)g.open.lastIndex=i,t=g.open.exec(n),c[l]=t;if(!t)continue;if(t.index<a&&(r===-1||t.index<r))r=t.index,o=g.close}if(r===-1||!o)return{index:a,tag:e[0],attrs:e[1]??""};o.lastIndex=r;let s=o.exec(n);if(!s)return null;i=s.index+s[0].length}return null}function Je(n,i){let e=L(n);if(!e)return n;return n.slice(0,e.index)+i(e.tag,e.attrs)+n.slice(e.index+e.tag.length)}
3
+ export{L,Je};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{su}from"./chunk-cdcrd33m.js";export{su as rewriteImagesWithSiblings};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{mt,zn,nh}from"./chunk-jzajpmke.js";import{le,Hn,rh,Vn,mo,qr,Kr,sh,oh,ih,Un,Wn,ho,Gr,ah}from"./chunk-jyp2mmts.js";import"./chunk-b51p56k5.js";export{mo as batch,nh as default,Hn as derived,Vn as effect,mt as generateSignalsRuntime,zn as generateSignalsRuntimeDev,Wn as isDerived,Un as isSignal,rh as memo,Kr as onDestroy,qr as onMount,Gr as peek,ih as pendingLifecycleCounts,oh as runDestroyCallbacks,sh as runMountCallbacks,le as state,ho as untrack,ah as useOptimistic};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{mf,hf,he,yf,Xa,Qt,en,gh,Ja,tn,Zn,bf,wf,vf,es,nn,xf,rn,Ya,mh}from"./chunk-x7q4tp3f.js";import"./chunk-61qh74q1.js";import"./chunk-wmnzapn8.js";import"./chunk-vv8dn70r.js";import"./chunk-kj9m0vc6.js";import"./chunk-8rk79ha1.js";import"./chunk-q3azy64b.js";import"./chunk-evxp3wmv.js";import"./chunk-f8p8ggvw.js";import"./chunk-2cbd1ew6.js";import"./chunk-wghtdgwj.js";import"./chunk-x5seqmrv.js";import"./chunk-tpfxvw4q.js";import"./chunk-4833k99b.js";import"./chunk-b51p56k5.js";export{Zn as MODULE_SPECIFIER_PREFIX,mf as bundleCacheDir,hf as bundleCacheEntryLimit,mh as bundleClientEntriesSplit,rn as bundleClientScript,en as clearBundleFailures,he as clientBundleDependencies,Qt as getBundleFailures,tn as hasUserImports,nn as moduleSubstitutionKey,wf as normalizeRegistrySpecifiers,xf as queueClientBundleBuild,Xa as recordBundleFailure,bf as registryIdForPath,Ja as resolveBundlerFallback,vf as rewriteRegistryImports,gh as setBundlerFallbackMode,yf as shouldLogBundlerDiagnostics,Ya as tempBuildName,es as withModuleSubstitutes};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ri,Ai,Pi,kg,_g,Cg,yl,Eg,Tg}from"./chunk-r1tp2gnr.js";export{Ri as ImageProcessorCache,yl as applyTransformations,kg as clearImageCache,Eg as generateResponsiveVariants,Tg as generateSrcset,Ai as getCachedImageResult,Cg as optimizeImage,_g as processImage,Pi as setCachedImageResult};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Q,ee,te,On,me,Te,Ur,Bl,ft,Kt,Nn,Dn,Mn,ne,Ln,jn,Wr}from"./chunk-mdvtermb.js";import"./chunk-r8zhed35.js";export{ee as DEFAULT_FORMATS,te as DEFAULT_QUALITY,Q as DEFAULT_WIDTHS,Wr as ImageProcessingError,jn as formatSize,Kt as generateSizes,ft as generateSrcSet,Nn as getFallbackVariant,Ur as getImageMetadata,ne as getMimeType,Ln as getTotalSize,Dn as groupVariantsByFormat,me as isImageBackendAvailable,Mn as isImageFile,On as isSharpAvailable,Te as processImage,Bl as resizeAndConvert};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Um,Wm,qm,Km,Gm}from"./chunk-bvctccab.js";export{Wm as defineAsyncComponent,Km as generateAsyncComponentCSS,Gm as generateAsyncComponentRuntime,qm as isAsyncComponent,Um as processAsyncDirectives};