@stacksjs/stx 0.2.340 → 0.2.342

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 (177) hide show
  1. package/README.md +1 -1
  2. package/dist/browser-core-imports.js +0 -1
  3. package/dist/build-views.js +12 -1
  4. package/dist/caching.d.ts +4 -0
  5. package/dist/caching.js +34 -0
  6. package/dist/{chunk-hrdd26r4.js → chunk-01ggk8k8.js} +1 -1
  7. package/dist/chunk-025z2btp.js +2 -0
  8. package/dist/{chunk-x4vhn880.js → chunk-0sq5mdrh.js} +1 -1
  9. package/dist/chunk-19fp0z9s.js +2 -0
  10. package/dist/{chunk-d3kjaae0.js → chunk-1gwbw81h.js} +1 -1
  11. package/dist/{chunk-vaggjvsm.js → chunk-1spzqjve.js} +1 -1
  12. package/dist/{chunk-t00ga194.js → chunk-1t3j8a0q.js} +1 -1
  13. package/dist/{chunk-shtg7kah.js → chunk-1xwfws06.js} +2 -2
  14. package/dist/{chunk-x48crnwa.js → chunk-23sv24cm.js} +1 -1
  15. package/dist/{chunk-7r79j1hs.js → chunk-25b8z7xa.js} +1 -1
  16. package/dist/{chunk-hq9fa4pe.js → chunk-25f0s8t1.js} +2 -2
  17. package/dist/chunk-2p68bkza.js +2 -0
  18. package/dist/{chunk-r10fypcd.js → chunk-2swnc8kg.js} +1 -1
  19. package/dist/chunk-3b0mgxbk.js +2 -0
  20. package/dist/{chunk-nvp546bb.js → chunk-48x5bsqv.js} +1 -1
  21. package/dist/{chunk-fx07kyz7.js → chunk-4ecv1e3w.js} +1 -1
  22. package/dist/{chunk-ppp84wry.js → chunk-4vcyf1kh.js} +2 -2
  23. package/dist/{chunk-r5kr6jk4.js → chunk-4wpxbkbe.js} +2 -2
  24. package/dist/{chunk-p7ntrtaj.js → chunk-567g1ttv.js} +1 -1
  25. package/dist/{chunk-7a21q2q4.js → chunk-5g9vbhbt.js} +1 -1
  26. package/dist/chunk-5grrqaqs.js +2 -0
  27. package/dist/chunk-6jx4r94x.js +2 -0
  28. package/dist/{chunk-0xgc5t3y.js → chunk-6nvm939g.js} +1 -1
  29. package/dist/{chunk-tr1174hz.js → chunk-6nxq8rcw.js} +1 -1
  30. package/dist/{chunk-7r80apc5.js → chunk-6p6b01kp.js} +1 -1
  31. package/dist/{chunk-xe6zmdfq.js → chunk-74r1zw2h.js} +1 -1
  32. package/dist/{chunk-97ej3abh.js → chunk-8tsr51hj.js} +1 -1
  33. package/dist/chunk-a1rt1fms.js +2 -0
  34. package/dist/{chunk-aved735s.js → chunk-ahpmjg3f.js} +2 -2
  35. package/dist/chunk-akp89n3w.js +2 -0
  36. package/dist/{chunk-b4cabzk9.js → chunk-anf2y2h5.js} +1 -1
  37. package/dist/{chunk-d6yyzpsv.js → chunk-beextc84.js} +53 -20
  38. package/dist/chunk-bqhrryqs.js +2 -0
  39. package/dist/{chunk-799s9mwc.js → chunk-bt8w146r.js} +2 -2
  40. package/dist/{chunk-fa2mg49t.js → chunk-byjy9far.js} +2 -2
  41. package/dist/{chunk-axqfm9b4.js → chunk-c0n802j1.js} +1 -1
  42. package/dist/{chunk-vxt5c5aq.js → chunk-c33y19bn.js} +1 -1
  43. package/dist/{chunk-2gc4cevb.js → chunk-c73pyeak.js} +1 -1
  44. package/dist/{chunk-6av24ywm.js → chunk-cqw3c1xg.js} +1 -1
  45. package/dist/chunk-czvzaa42.js +3 -0
  46. package/dist/{chunk-yxpr7h26.js → chunk-d389vyyz.js} +2 -2
  47. package/dist/chunk-da0tfpa2.js +2 -0
  48. package/dist/chunk-de2cfcf5.js +2 -0
  49. package/dist/{chunk-756dqqn1.js → chunk-drs93sry.js} +1 -1
  50. package/dist/{chunk-t8ctvjqe.js → chunk-e0kzyf1g.js} +1 -1
  51. package/dist/{chunk-3b9sxnty.js → chunk-ebd3z4j9.js} +1 -1
  52. package/dist/{chunk-rkykwy3z.js → chunk-evtrctj9.js} +1 -1
  53. package/dist/chunk-exhbc57n.js +2 -0
  54. package/dist/{chunk-q9ckfwhh.js → chunk-f2qbjr3z.js} +1 -1
  55. package/dist/{chunk-xy4jt4ek.js → chunk-f5cw54q3.js} +1 -1
  56. package/dist/chunk-fhhp6pmx.js +2 -0
  57. package/dist/{chunk-yne23w3c.js → chunk-fm5211ec.js} +1 -1
  58. package/dist/chunk-fqsrft0a.js +2 -0
  59. package/dist/{chunk-mjf3xmxn.js → chunk-fvsefztj.js} +1 -1
  60. package/dist/{chunk-m46edxtt.js → chunk-fx29n4vc.js} +1 -1
  61. package/dist/{chunk-f476c9fb.js → chunk-gbkq5qnw.js} +3 -3
  62. package/dist/{chunk-6zsc0z5a.js → chunk-ghd80w8a.js} +3 -3
  63. package/dist/{chunk-7xjm1zqa.js → chunk-gkq323fg.js} +1 -1
  64. package/dist/chunk-gqzccw30.js +2 -0
  65. package/dist/{chunk-5ggt2ryn.js → chunk-gwc54hjc.js} +2 -2
  66. package/dist/chunk-h47e1c03.js +2 -0
  67. package/dist/{chunk-ay336sqb.js → chunk-hk8j3eps.js} +1 -1
  68. package/dist/{chunk-86v2rps7.js → chunk-hnffkdzc.js} +1 -1
  69. package/dist/{chunk-mb7rn0bf.js → chunk-hrmxxs0w.js} +1 -1
  70. package/dist/{chunk-d964bsxm.js → chunk-j82hfkcf.js} +280 -280
  71. package/dist/chunk-jcbj3xp4.js +2 -0
  72. package/dist/{chunk-h0y4mb2m.js → chunk-k3w3gwm3.js} +1 -1
  73. package/dist/{chunk-jx03a693.js → chunk-k5b9471y.js} +1 -1
  74. package/dist/{chunk-apa2v787.js → chunk-k9ep24bd.js} +1 -1
  75. package/dist/chunk-kbemcvp1.js +2 -0
  76. package/dist/chunk-ks4j8fjz.js +2 -0
  77. package/dist/{chunk-zj039s33.js → chunk-kznb3hdj.js} +1 -1
  78. package/dist/{chunk-m11pb9cx.js → chunk-m39hb2a2.js} +1 -1
  79. package/dist/chunk-mbstfjnj.js +2 -0
  80. package/dist/{chunk-95e1m9p8.js → chunk-mkgbrbr9.js} +1 -1
  81. package/dist/{chunk-dekxwgc2.js → chunk-mznr9nyp.js} +1 -1
  82. package/dist/{chunk-284ag6fs.js → chunk-ntm1761b.js} +130 -130
  83. package/dist/{chunk-5qsg9q46.js → chunk-p52cm7ch.js} +1 -1
  84. package/dist/{chunk-5g6rprcy.js → chunk-p5d8sb50.js} +1 -1
  85. package/dist/chunk-pbct6nxk.js +2 -0
  86. package/dist/chunk-peerbcwj.js +2 -0
  87. package/dist/chunk-pt1w6vq2.js +2 -0
  88. package/dist/{chunk-kdhrk7x5.js → chunk-q4cemvkw.js} +1 -1
  89. package/dist/{chunk-k3dtvay1.js → chunk-r1rfwm01.js} +1 -1
  90. package/dist/{chunk-q0srntf6.js → chunk-r46cg4qa.js} +1 -1
  91. package/dist/{chunk-22hch2me.js → chunk-reskzmsb.js} +1 -1
  92. package/dist/chunk-rgda0gwf.js +2 -0
  93. package/dist/{chunk-d7zxg9bp.js → chunk-rh7mwwb4.js} +2 -2
  94. package/dist/{chunk-pxw0cpxe.js → chunk-rr49zrz6.js} +1 -1
  95. package/dist/chunk-rwa10jm4.js +2 -0
  96. package/dist/{chunk-w72v0ab1.js → chunk-s4mmmwj4.js} +1 -1
  97. package/dist/{chunk-zg2hvb1j.js → chunk-saqbtgqr.js} +21 -2
  98. package/dist/chunk-snsh9ye4.js +2 -0
  99. package/dist/{chunk-a26hcag1.js → chunk-sytwy0mg.js} +1 -1
  100. package/dist/chunk-td39mtts.js +2 -0
  101. package/dist/{chunk-tr41gn5j.js → chunk-thrv2nbz.js} +1 -1
  102. package/dist/{chunk-066yt1hy.js → chunk-tmj45xq5.js} +1 -1
  103. package/dist/chunk-trncnwem.js +2 -0
  104. package/dist/{chunk-y8vj3rtt.js → chunk-ts3wfjh9.js} +1 -1
  105. package/dist/chunk-vk2j3vvs.js +2 -0
  106. package/dist/chunk-vph6zpeq.js +2 -0
  107. package/dist/chunk-wa3ks5zv.js +2 -0
  108. package/dist/chunk-wv8h3d68.js +3 -0
  109. package/dist/{chunk-28q3vycz.js → chunk-wvc7t11n.js} +1 -1
  110. package/dist/{chunk-2tjk867y.js → chunk-x7dv5rq7.js} +1 -1
  111. package/dist/{chunk-3agx4hyd.js → chunk-xe93ae3r.js} +3 -3
  112. package/dist/{chunk-mys0rat0.js → chunk-xec226zb.js} +1 -1
  113. package/dist/chunk-xer5kn26.js +2 -0
  114. package/dist/{chunk-tr9ynxdw.js → chunk-y956wapy.js} +1 -1
  115. package/dist/{chunk-stbns4bg.js → chunk-yhvrq2qd.js} +1 -1
  116. package/dist/{chunk-eq2j7w8p.js → chunk-yq7fc8sa.js} +1 -1
  117. package/dist/{chunk-wb90259a.js → chunk-yr7camcd.js} +1 -1
  118. package/dist/{chunk-8de19dmw.js → chunk-ys56ecvx.js} +1 -1
  119. package/dist/{chunk-5t8ersrw.js → chunk-ytx17bg2.js} +1 -1
  120. package/dist/{chunk-64qg8jes.js → chunk-yzv702kk.js} +2 -2
  121. package/dist/chunk-zv4gb3wb.js +2 -0
  122. package/dist/{chunk-6nde3nmc.js → chunk-zv4nf0x2.js} +1 -1
  123. package/dist/chunk-zx2krbqf.js +2 -0
  124. package/dist/cli.js +14 -14
  125. package/dist/client-script.js +2 -2
  126. package/dist/craft-entry.js +1 -1
  127. package/dist/craft.js +1 -1
  128. package/dist/database.js +1 -1
  129. package/dist/events.d.ts +14 -0
  130. package/dist/events.js +12 -1
  131. package/dist/hydration.d.ts +0 -39
  132. package/dist/hydration.js +7 -1
  133. package/dist/process.js +4 -0
  134. package/dist/pwa.js +2 -2
  135. package/dist/runtime-globals.js +1 -0
  136. package/dist/signals.js +20 -1
  137. package/dist/ssg.js +2 -2
  138. package/dist/stx.d.ts +4 -0
  139. package/dist/visual-testing.js +1 -1
  140. package/package.json +5 -5
  141. package/stx.d.ts +4 -0
  142. package/dist/chunk-0pje0pjq.js +0 -2
  143. package/dist/chunk-1w8bpytb.js +0 -2
  144. package/dist/chunk-58j32d7n.js +0 -2
  145. package/dist/chunk-605955nh.js +0 -2
  146. package/dist/chunk-6es5r4az.js +0 -3
  147. package/dist/chunk-6j6ek3j1.js +0 -2
  148. package/dist/chunk-82h5rp34.js +0 -2
  149. package/dist/chunk-9pv7gcey.js +0 -2
  150. package/dist/chunk-a2mj88c6.js +0 -2
  151. package/dist/chunk-b3pn6dh5.js +0 -2
  152. package/dist/chunk-cjcj2gsq.js +0 -2
  153. package/dist/chunk-deqnt1w5.js +0 -3
  154. package/dist/chunk-dy9xs2q0.js +0 -2
  155. package/dist/chunk-eb1v7f55.js +0 -2
  156. package/dist/chunk-fx5m9d3t.js +0 -2
  157. package/dist/chunk-g0059g3p.js +0 -2
  158. package/dist/chunk-gf6t4419.js +0 -2
  159. package/dist/chunk-h7hnzwd0.js +0 -2
  160. package/dist/chunk-hkgnpf6v.js +0 -2
  161. package/dist/chunk-hvw4mwee.js +0 -2
  162. package/dist/chunk-jwa2jhd8.js +0 -2
  163. package/dist/chunk-kwxcertb.js +0 -2
  164. package/dist/chunk-nwz43t6d.js +0 -2
  165. package/dist/chunk-p1cddybx.js +0 -2
  166. package/dist/chunk-rceawm7w.js +0 -2
  167. package/dist/chunk-t3mh10z3.js +0 -2
  168. package/dist/chunk-vhzc08aa.js +0 -2
  169. package/dist/chunk-vz0ebk4j.js +0 -2
  170. package/dist/chunk-wjcrcbd1.js +0 -2
  171. package/dist/chunk-x80ahcnw.js +0 -2
  172. package/dist/chunk-x81z8m6a.js +0 -2
  173. package/dist/chunk-y07fna67.js +0 -2
  174. package/dist/chunk-yz0d60px.js +0 -2
  175. package/dist/chunk-z19pk2pn.js +0 -2
  176. package/dist/chunk-z7vb3mgn.js +0 -2
  177. package/dist/chunk-zzfpwxpp.js +0 -2
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$g as c,Zg as a,_g as b,ah as d,bh as e,ch as f,dh as g,eh as h,fh as i,gh as j,hh as k}from"./chunk-w72v0ab1.js";import"./chunk-18018jkn.js";import"./chunk-5g6rprcy.js";export{c as setCachedVideoResult,k as processVideo,b as getCachedVideoResult,f as generateThumbnails,g as generateSpriteSheet,e as generatePoster,h as generateHLSManifest,i as generateDASHManifest,d as clearVideoCache,j as analyzeVideo,a as VideoProcessorCache};
2
+ import{$g as c,Zg as a,_g as b,ah as d,bh as e,ch as f,dh as g,eh as h,fh as i,gh as j,hh as k}from"./chunk-s4mmmwj4.js";import"./chunk-18018jkn.js";import"./chunk-p5d8sb50.js";export{c as setCachedVideoResult,k as processVideo,b as getCachedVideoResult,f as generateThumbnails,g as generateSpriteSheet,e as generatePoster,h as generateHLSManifest,i as generateDASHManifest,d as clearVideoCache,j as analyzeVideo,a as VideoProcessorCache};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var{defineProperty:e,getOwnPropertyNames:g,getOwnPropertyDescriptor:h}=Object,i=Object.prototype.hasOwnProperty;function j(a){return this[a]}var m=(a)=>{var b=(f??=new WeakMap).get(a),c;if(b)return b;if(b=e({},"__esModule",{value:!0}),a&&typeof a==="object"||typeof a==="function"){for(var d of g(a))if(!i.call(b,d))e(b,d,{get:j.bind(a,d),enumerable:!(c=h(a,d))||c.enumerable})}return f.set(a,b),b},f;var k=(a)=>a;function l(a,b){this[a]=k.bind(null,b)}var n=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0,configurable:!0,set:l.bind(b,c)})};var o=(a,b)=>()=>(a&&(b=a(a=0)),b);var p=import.meta.require;
3
- export{m as qw,n as rw,o as sw,p as tw};
3
+ export{m as uw,n as vw,o as ww,p as xw};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{yf as a,zf as b}from"./chunk-m39hb2a2.js";import"./chunk-74r1zw2h.js";import"./chunk-p5d8sb50.js";export{a as handleImageRequest,b as createImageHandler};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ao as k,Bo as l,Co as m,qo as a,ro as b,so as c,to as d,uo as e,vo as f,wo as g,xo as h,yo as i,zo as j}from"./chunk-j82hfkcf.js";import"./chunk-rh7mwwb4.js";import"./chunk-1t3j8a0q.js";import"./chunk-01ggk8k8.js";import"./chunk-25b8z7xa.js";import"./chunk-hk8j3eps.js";import"./chunk-xe93ae3r.js";import"./chunk-1spzqjve.js";import"./chunk-f2qbjr3z.js";import"./chunk-1xwfws06.js";import"./chunk-r1rfwm01.js";import"./chunk-ahpmjg3f.js";import"./chunk-bt8w146r.js";import"./chunk-6p6b01kp.js";import"./chunk-x7dv5rq7.js";import"./chunk-e0kzyf1g.js";import"./chunk-wv8h3d68.js";import"./chunk-beextc84.js";import"./chunk-yr7camcd.js";import"./chunk-p5d8sb50.js";export{m as stripStxRuntimeImports,b as scanScriptTags,l as rewriteStxImportSpecifiers,j as processSignals,h as processScriptSetup,f as preEvalLiteralReactiveIfs,c as parseLoopExpression,d as hasSignalsSyntax,k as findMarkupIndexOutsideScripts,i as extractExports,g as convertSignalLoopsToAttributes,e as convertSignalDirectivesToAttributes,a as clearScriptScanCache};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Kg as a,Lg as b,Mg as c,Ng as d,Og as e,Pg as f}from"./chunk-mkgbrbr9.js";import"./chunk-j82hfkcf.js";import"./chunk-rh7mwwb4.js";import"./chunk-1t3j8a0q.js";import"./chunk-01ggk8k8.js";import"./chunk-25b8z7xa.js";import"./chunk-hk8j3eps.js";import"./chunk-xe93ae3r.js";import"./chunk-1spzqjve.js";import"./chunk-f2qbjr3z.js";import"./chunk-1xwfws06.js";import"./chunk-r1rfwm01.js";import"./chunk-ahpmjg3f.js";import"./chunk-bt8w146r.js";import"./chunk-6p6b01kp.js";import"./chunk-x7dv5rq7.js";import"./chunk-e0kzyf1g.js";import"./chunk-wv8h3d68.js";import"./chunk-beextc84.js";import"./chunk-yr7camcd.js";import"./chunk-p5d8sb50.js";export{c as renderSlot,d as processSlots,a as parseSlots,b as parseSlotElement,e as extractSlotContent,f as applySlots};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-5g6rprcy.js";var N=0;function P(){return`eb-${++N}-${Date.now().toString(36)}`}function W(q,z={},A){let j=/@errorBoundary(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@enderrorBoundary/gi;return q.replace(j,(D,F,J,K)=>{let L=P(),M=Q(F||"");return T(L,J.trim(),K.trim(),M)})}function Q(q){let z={},A=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\w+))/g,j;while((j=A.exec(q))!==null){let D=j[1],F=j[2]||j[3]||j[4];switch(D){case"id":z.id=F;break;case"logErrors":z.logErrors=F==="true";break}}return z}function T(q,z,A,j){let D=j.logErrors!==!1;return`
2
+ import"./chunk-p5d8sb50.js";var N=0;function P(){return`eb-${++N}-${Date.now().toString(36)}`}function W(q,z={},A){let j=/@errorBoundary(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@enderrorBoundary/gi;return q.replace(j,(D,F,J,K)=>{let L=P(),M=Q(F||"");return T(L,J.trim(),K.trim(),M)})}function Q(q){let z={},A=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\w+))/g,j;while((j=A.exec(q))!==null){let D=j[1],F=j[2]||j[3]||j[4];switch(D){case"id":z.id=F;break;case"logErrors":z.logErrors=F==="true";break}}return z}function T(q,z,A,j){let D=j.logErrors!==!1;return`
3
3
  <div class="stx-error-boundary" data-boundary-id="${q}" data-has-error="false">
4
4
  <div class="stx-error-boundary-content" data-boundary-content="${q}">
5
5
  ${z}
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  import{AsyncLocalStorage as U}from"async_hooks";var V=Symbol.for("stx.runtime-config.scope"),W=globalThis,Q=W[V]??=new U;function b(x,H){return Q.run(x,H)}function A(){return Q.getStore()}function X(){let x=Q.getStore();if(!x)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:x.public},"private",{value:x.private}))}function N(){return X().public}function O(x={},H=process.env){let I=new Set;function E(j,z){if(z===null)return j===null;if(Array.isArray(z))return Array.isArray(j)&&(!z.length||j.every((B)=>z.some((F)=>E(B,F))));if(typeof z==="object")return j!==null&&typeof j==="object"&&!Array.isArray(j)&&Object.entries(z).every(([B,F])=>Object.hasOwn(j,B)&&E(j[B],F));return typeof j===typeof z}function J(j,z){if(j&&typeof j==="object"&&!Array.isArray(j)){if(Object.getPrototypeOf(j)!==Object.prototype&&Object.getPrototypeOf(j)!==null)throw TypeError(`Runtime config ${z.join(".")} must contain JSON values`);let q=Object.create(null);for(let[G,P]of Object.entries(j)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(G)||["constructor","prototype","__proto__"].includes(G))throw TypeError(`Invalid runtime config key: ${G}`);q[G]=J(P,[...z,G])}return Object.freeze(q)}let B=`STX_RUNTIME_${z.map((q)=>q.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(I.has(B))throw TypeError(`Ambiguous runtime config environment key: ${B}`);I.add(B);let F=H[B],K=j;if(F!==void 0){try{K=typeof j==="string"?F:JSON.parse(F)}catch{throw TypeError(`Invalid runtime config override: ${B}`)}if(!E(K,j))throw TypeError(`Wrong runtime config override type: ${B}`)}function M(q){if(q===null||typeof q==="string"||typeof q==="boolean")return q;if(typeof q==="number"&&Number.isFinite(q))return q;if(Array.isArray(q))return Object.freeze(q.map(M));if(q&&typeof q==="object"&&(Object.getPrototypeOf(q)===Object.prototype||Object.getPrototypeOf(q)===null))return Object.freeze(Object.fromEntries(Object.entries(q).map(([G,P])=>[G,M(P)])));throw TypeError(`Runtime config ${z.join(".")} must contain JSON values`)}return M(K)}return Object.freeze({public:J(x.public??{},["public"]),private:J(x.private??{},["private"])})}function Z(x){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(x.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function T(x,H){let I=x.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),E=/<head\b[^>]*>/i.exec(I),J=E?E.index+E[0].length:0;return I.slice(0,J)+Z(H)+I.slice(J)}
3
- export{b as Ct,A as Dt,X as Et,N as Ft,O as Gt,Z as Ht,T as It};
3
+ export{b as Gt,A as Ht,X as It,N as Jt,O as Kt,Z as Lt,T as Mt};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ii as a,ji as b}from"./chunk-vgfd9582.js";import"./chunk-5g6rprcy.js";export{a as processTeleportDirectives,b as ensureTeleportTargets};
2
+ import{ii as a,ji as b}from"./chunk-vgfd9582.js";import"./chunk-p5d8sb50.js";export{a as processTeleportDirectives,b as ensureTeleportTargets};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ag as c,Bg as d,Cg as e,Dg as f,Eg as g,Fg as h,Gg as i,Hg as j,Ig as k,Jg as l,yg as a,zg as b}from"./chunk-8bxtvsgm.js";import"./chunk-5g6rprcy.js";export{g as toUsers,f as toUser,c as stopBroadcasting,b as startBroadcasting,d as loadChannels,a as getBroadcastServer,j as channel,h as broadcastPrivate,i as broadcastPresence,e as broadcast,l as BroadcastServer,k as Broadcast};
2
+ import{Ag as c,Bg as d,Cg as e,Dg as f,Eg as g,Fg as h,Gg as i,Hg as j,Ig as k,Jg as l,yg as a,zg as b}from"./chunk-8bxtvsgm.js";import"./chunk-p5d8sb50.js";export{g as toUsers,f as toUser,c as stopBroadcasting,b as startBroadcasting,d as loadChannels,a as getBroadcastServer,j as channel,h as broadcastPrivate,i as broadcastPresence,e as broadcast,l as BroadcastServer,k as Broadcast};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{jo as b,ko as c,lo as d}from"./chunk-j82hfkcf.js";import"./chunk-rh7mwwb4.js";import"./chunk-1t3j8a0q.js";import"./chunk-01ggk8k8.js";import"./chunk-25b8z7xa.js";import"./chunk-hk8j3eps.js";import"./chunk-xe93ae3r.js";import"./chunk-1spzqjve.js";import"./chunk-f2qbjr3z.js";import"./chunk-1xwfws06.js";import"./chunk-r1rfwm01.js";import"./chunk-ahpmjg3f.js";import{Nu as a}from"./chunk-bt8w146r.js";import"./chunk-6p6b01kp.js";import"./chunk-x7dv5rq7.js";import"./chunk-e0kzyf1g.js";import"./chunk-wv8h3d68.js";import"./chunk-beextc84.js";import"./chunk-yr7camcd.js";import"./chunk-p5d8sb50.js";export{b as rendersAsElement,c as processESImports,d as processComponents,a as freeIdentifiers};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{is as i}from"./chunk-t00ga194.js";import{$t as R,Iu as S,pu as T}from"./chunk-799s9mwc.js";import{tw as g}from"./chunk-5g6rprcy.js";import k from"path";var O;async function t(){if(O!==void 0)return O;try{O=(await import("@stacksjs/ts-i18n")).loadLocale??null}catch{O=null}return O}var y={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},F={},V={},E={};function vq(q){if(q)delete F[q];else for(let X of Object.keys(F))delete F[X]}function fq(){let q=Object.entries(F).map(([X,Q])=>({locale:X,loadedAt:new Date(Q.loadedAt),keyCount:p(Q.translations)}));return{size:Object.keys(F).length,locales:Object.keys(F),entries:q}}function p(q,X=0){for(let Q of Object.values(q))if(X++,Q&&typeof Q==="object"&&!Array.isArray(Q))X=p(Q,X);return X}function e(q,X=0){if(X<=0)return!1;return Date.now()-q.loadedAt>X}function dq(q){if(F[q])return"loaded";return E[q]||"idle"}function gq(q){return E[q]==="loading"}function uq(q){return!!F[q]}async function qq(q,X){let{locales:Q,parallel:H=!0,priority:J={},onLocaleLoaded:Y,onComplete:W,onError:$}=q,Z=H?Q:[...Q].sort((_,z)=>(J[z]||0)-(J[_]||0));if(H){let _=Z.map(async(z)=>{try{await P(z,X),Y?.(z)}catch(G){$?.(z,G instanceof Error?G:Error(String(G)))}});await Promise.all(_)}else for(let _ of Z)try{await P(_,X),Y?.(_)}catch(z){$?.(_,z instanceof Error?z:Error(String(z)))}W?.()}function hq(q,X){queueMicrotask(()=>{qq(q,X).catch((Q)=>{if(X.debug)console.error("Background preload error:",Q)})})}async function P(q,X){if({...y,...X.i18n}.cache&&F[q]){let J=F[q],Y=X.i18n?.cacheMaxAge??0;if(!e(J,Y))return J.translations}if(V[q]?.state==="loading")return V[q].promise;E[q]="loading";let H=b(q,X).then((J)=>{return E[q]="loaded",delete V[q],J}).catch((J)=>{throw E[q]="error",V[q]={promise:H,state:"error",error:J instanceof Error?J:Error(String(J))},J});return V[q]={promise:H,state:"loading"},H}function Hq(q){return F[q]?.translations}async function pq(q,X){let Q=Hq(q);if(Q)return Q;return P(q,X)}async function mq(q,X){if(F[q])return F[q].translations;if(V[q]){if(X)return Promise.race([V[q].promise,new Promise((Q,H)=>setTimeout(()=>H(Error(`Timeout waiting for locale: ${q}`)),X))]);return V[q].promise}throw Error(`Locale "${q}" is not loading. Call loadTranslationLazy first.`)}function cq(){return Object.entries(E).filter(([q,X])=>X==="loading").map(([q])=>q)}function iq(q){if(q)delete V[q],delete E[q];else{for(let X of Object.keys(V))delete V[X];for(let X of Object.keys(E))delete E[X]}}async function b(q,X){let Q={...y,...X.i18n},H=k.isAbsolute(Q.translationsDir)?Q.translationsDir:k.resolve(X.root||process.cwd(),Q.translationsDir);try{let J=await t(),Y=J?await J(q,{translationsDir:H,defaultLocale:Q.defaultLocale,sources:$q(Q.format)}):await Jq(q,Q,H);if(Y===void 0){if(q!==Q.defaultLocale)return b(Q.defaultLocale,X);return{}}let W=Y;if(Q.cache)F[q]={translations:W,loadedAt:Date.now(),locale:q};return W}catch(J){if(X.debug)console.error(`Error loading translation file for locale "${q}":`,J);if(q!==Q.defaultLocale)return b(Q.defaultLocale,X);return{}}}async function Jq(q,X,Q){let H=k.join(Q,`${q}${Qq(X.format)}`);try{let J=await import(H);return J.default||J}catch(J){try{let Y=await Bun.file(H).text();if(X.format==="yaml"||X.format==="yml")return Xq(Y);if(X.format==="json")return JSON.parse(Y);throw J}catch{return}}}function Qq(q){switch(q){case"yaml":return".yaml";case"yml":return".yml";case"js":return".js";case"ts":return".ts";case"json":default:return".json"}}function Xq(q){let X={},Q=q.split(`
2
+ import{ms as i}from"./chunk-1t3j8a0q.js";import{Mu as S,du as R,tu as T}from"./chunk-bt8w146r.js";import{xw as g}from"./chunk-p5d8sb50.js";import k from"path";var O;async function t(){if(O!==void 0)return O;try{O=(await import("@stacksjs/ts-i18n")).loadLocale??null}catch{O=null}return O}var y={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},F={},V={},E={};function vq(q){if(q)delete F[q];else for(let X of Object.keys(F))delete F[X]}function fq(){let q=Object.entries(F).map(([X,Q])=>({locale:X,loadedAt:new Date(Q.loadedAt),keyCount:p(Q.translations)}));return{size:Object.keys(F).length,locales:Object.keys(F),entries:q}}function p(q,X=0){for(let Q of Object.values(q))if(X++,Q&&typeof Q==="object"&&!Array.isArray(Q))X=p(Q,X);return X}function e(q,X=0){if(X<=0)return!1;return Date.now()-q.loadedAt>X}function dq(q){if(F[q])return"loaded";return E[q]||"idle"}function gq(q){return E[q]==="loading"}function uq(q){return!!F[q]}async function qq(q,X){let{locales:Q,parallel:H=!0,priority:J={},onLocaleLoaded:Y,onComplete:W,onError:$}=q,Z=H?Q:[...Q].sort((_,z)=>(J[z]||0)-(J[_]||0));if(H){let _=Z.map(async(z)=>{try{await P(z,X),Y?.(z)}catch(G){$?.(z,G instanceof Error?G:Error(String(G)))}});await Promise.all(_)}else for(let _ of Z)try{await P(_,X),Y?.(_)}catch(z){$?.(_,z instanceof Error?z:Error(String(z)))}W?.()}function hq(q,X){queueMicrotask(()=>{qq(q,X).catch((Q)=>{if(X.debug)console.error("Background preload error:",Q)})})}async function P(q,X){if({...y,...X.i18n}.cache&&F[q]){let J=F[q],Y=X.i18n?.cacheMaxAge??0;if(!e(J,Y))return J.translations}if(V[q]?.state==="loading")return V[q].promise;E[q]="loading";let H=b(q,X).then((J)=>{return E[q]="loaded",delete V[q],J}).catch((J)=>{throw E[q]="error",V[q]={promise:H,state:"error",error:J instanceof Error?J:Error(String(J))},J});return V[q]={promise:H,state:"loading"},H}function Hq(q){return F[q]?.translations}async function pq(q,X){let Q=Hq(q);if(Q)return Q;return P(q,X)}async function mq(q,X){if(F[q])return F[q].translations;if(V[q]){if(X)return Promise.race([V[q].promise,new Promise((Q,H)=>setTimeout(()=>H(Error(`Timeout waiting for locale: ${q}`)),X))]);return V[q].promise}throw Error(`Locale "${q}" is not loading. Call loadTranslationLazy first.`)}function cq(){return Object.entries(E).filter(([q,X])=>X==="loading").map(([q])=>q)}function iq(q){if(q)delete V[q],delete E[q];else{for(let X of Object.keys(V))delete V[X];for(let X of Object.keys(E))delete E[X]}}async function b(q,X){let Q={...y,...X.i18n},H=k.isAbsolute(Q.translationsDir)?Q.translationsDir:k.resolve(X.root||process.cwd(),Q.translationsDir);try{let J=await t(),Y=J?await J(q,{translationsDir:H,defaultLocale:Q.defaultLocale,sources:$q(Q.format)}):await Jq(q,Q,H);if(Y===void 0){if(q!==Q.defaultLocale)return b(Q.defaultLocale,X);return{}}let W=Y;if(Q.cache)F[q]={translations:W,loadedAt:Date.now(),locale:q};return W}catch(J){if(X.debug)console.error(`Error loading translation file for locale "${q}":`,J);if(q!==Q.defaultLocale)return b(Q.defaultLocale,X);return{}}}async function Jq(q,X,Q){let H=k.join(Q,`${q}${Qq(X.format)}`);try{let J=await import(H);return J.default||J}catch(J){try{let Y=await Bun.file(H).text();if(X.format==="yaml"||X.format==="yml")return Xq(Y);if(X.format==="json")return JSON.parse(Y);throw J}catch{return}}}function Qq(q){switch(q){case"yaml":return".yaml";case"yml":return".yml";case"js":return".js";case"ts":return".ts";case"json":default:return".json"}}function Xq(q){let X={},Q=q.split(`
3
3
  `),H=[{obj:X,indent:-1}];for(let J of Q){let Y=J.replace(/#.*$/,"").trimEnd();if(!Y.trim())continue;let W=Y.search(/\S/);if(W===-1)continue;while(H.length>1&&H[H.length-1].indent>=W)H.pop();let $=H[H.length-1].obj,Z=Y.match(/^(\s*)(\S[^:]*):\s*(.*)$/);if(Z){let[,,_,z]=Z,G=_.trim(),w=z.trim();if(w==="")$[G]={},H.push({obj:$[G],indent:W});else $[G]=Zq(w)}}return X}function Zq(q){if(q.startsWith("'")&&q.endsWith("'")||q.startsWith('"')&&q.endsWith('"'))return q.slice(1,-1);let X=q.toLowerCase();if(X==="true"||X==="yes")return!0;if(X==="false"||X==="no")return!1;if(X==="null"||X==="~")return null;let Q=Number(q);if(!Number.isNaN(Q)&&q!=="")return Q;return q}function $q(q){switch(q){case"yaml":case"yml":return["yaml"];case"js":case"ts":return["ts"];case"json":default:return["json"]}}async function Wq(q,X){return P(q,X)}function Yq(q,X){for(let Q of q){let H=Q.trim(),J=H.match(/^\{(\d+)\}\s*(.*)$/);if(J){let W=Number.parseInt(J[1],10);if(X===W)return J[2];continue}let Y=H.match(/^\[(\d+),(\d+|\*)\]\s*(.*)$/);if(Y){let W=Number.parseInt(Y[1],10),$=Y[2]==="*"?Number.POSITIVE_INFINITY:Number.parseInt(Y[2],10);if(X>=W&&X<=$)return Y[3];continue}}if(q.length===2)return X===1?q[0].trim():q[1].trim();if(X<q.length)return q[X].trim();return q[q.length-1].trim()}function _q(q,X={}){return m(q,X)}function m(q,X){let Q="",H=0;while(H<q.length)if(q[H]==="{"){let J=zq(q,H);if(J===-1){Q+=q[H],H++;continue}let Y=q.slice(H+1,J);Q+=Gq(Y,X),H=J+1}else if(q[H]==="'"&&H+1<q.length)if(q[H+1]==="'")Q+="'",H+=2;else if(q[H+1]==="{"||q[H+1]==="}")Q+=q[H+1],H+=2;else Q+=q[H],H++;else Q+=q[H],H++;return Q}function zq(q,X){let Q=0;for(let H=X;H<q.length;H++)if(q[H]==="{")Q++;else if(q[H]==="}"){if(Q--,Q===0)return H}return-1}function Gq(q,X){let Q=Bq(q);if(Q.length===0)return`{${q}}`;let H=Q[0].trim(),J=X[H];if(Q.length===1)return J!==void 0?String(J):`{${H}}`;switch(Q[1].trim().toLowerCase()){case"plural":return wq(J,Q.slice(2).join(","),X);case"select":return Dq(J,Q.slice(2).join(","));case"selectordinal":return Kq(J,Q.slice(2).join(","));case"number":return Vq(J,Q[2]?.trim());case"date":return Eq(J,Q[2]?.trim());case"time":return Aq(J,Q[2]?.trim());default:return J!==void 0?String(J):`{${q}}`}}function Bq(q){let X=[],Q="",H=0;for(let J=0;J<q.length;J++){let Y=q[J];if(Y==="{")H++,Q+=Y;else if(Y==="}")H--,Q+=Y;else if(Y===","&&H===0)X.push(Q),Q="";else Q+=Y}if(Q)X.push(Q);return X}function wq(q,X,Q){let H=Number(q)||0,J=C(X),Y=`=${H}`;if(J[Y])return I(J[Y],H,Q);let W=jq(H);if(J[W])return I(J[W],H,Q);if(J.other)return I(J.other,H,Q);return String(H)}function I(q,X,Q){let H=q.replace(/#/g,String(X));return m(H,Q)}function jq(q){let X=Math.abs(q),Q=Math.floor(X),H=String(q).includes(".")?String(q).split(".")[1].length:0;if(Q===1&&H===0)return"one";return"other"}function Dq(q,X){let Q=String(q||""),H=C(X);if(H[Q])return H[Q];return H.other||String(q)}function Kq(q,X){let Q=Number(q)||0,H=C(X),J=Fq(Q);if(H[J])return H[J].replace(/#/g,String(Q));if(H.other)return H.other.replace(/#/g,String(Q));return String(Q)}function Fq(q){let X=Math.abs(q),Q=X%10,H=X%100;if(Q===1&&H!==11)return"one";if(Q===2&&H!==12)return"two";if(Q===3&&H!==13)return"few";return"other"}function C(q){let X={},Q=/(\w+|=\d+)\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,H=Q.exec(q);while(H!==null)X[H[1]]=H[2],H=Q.exec(q);return X}function Vq(q,X){let Q=Number(q);if(Number.isNaN(Q))return String(q);switch(X){case"integer":return Math.floor(Q).toLocaleString();case"percent":return`${(Q*100).toFixed(0)}%`;case"currency":return Q.toLocaleString(void 0,{style:"currency",currency:"USD"});default:return Q.toLocaleString()}}function Eq(q,X){let Q=q instanceof Date?q:new Date(String(q));if(Number.isNaN(Q.getTime()))return String(q);let H={};switch(X){case"short":H.dateStyle="short";break;case"medium":H.dateStyle="medium";break;case"long":H.dateStyle="long";break;case"full":H.dateStyle="full";break;default:H.dateStyle="medium"}return Q.toLocaleDateString(void 0,H)}function Aq(q,X){let Q=q instanceof Date?q:new Date(String(q));if(Number.isNaN(Q.getTime()))return String(q);let H={};switch(X){case"short":H.timeStyle="short";break;case"medium":H.timeStyle="medium";break;case"long":H.timeStyle="long";break;case"full":H.timeStyle="full";break;default:H.timeStyle="short"}return Q.toLocaleTimeString(void 0,H)}function Uq(q){return/\{[^}]+,\s*(?:plural|select|selectordinal|number|date|time)\s*,/.test(q)}function L(q,X,Q=!0,H={}){let J=q.split("."),Y=X;for(let $ of J){if(Y===void 0||Y===null)break;Y=Y[$]}if(Y===void 0||Y===null)return Q?q:"";let W=String(Y);if(Uq(W))return _q(W,H);if(W.includes("|")&&"count"in H){let $=Number(H.count),Z=W.split("|");W=Yq(Z,$)}for(let[$,Z]of Object.entries(H)){let _=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");W=W.replace(new RegExp(`:${_}`,"g"),String(Z))}return W}var u=new Set(["ar","arc","ckb","dv","fa","he","khw","ks","nqo","prs","ps","sd","syr","ug","ur","uz-af","yi"]),Mq=new Set(["adlm","arab","aran","hebr","nkoo","rohg","syrc","thaa","yezi"]);function x(q){if(!q)return"ltr";let X=q.trim().toLowerCase().replace(/_/g,"-").split("-"),Q=X[0];if(!Q)return"ltr";let H=X[1]?.length===4?X[1]:void 0;if(H)return Mq.has(H)?"rtl":"ltr";if(X.length>1&&u.has(`${Q}-${X[1]}`))return"rtl";return u.has(Q)?"rtl":"ltr"}function nq(q){return x(q)==="rtl"}async function sq(q,X,Q,H){let J=q,Y=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)([\s\S]*?)@endtranslate/g,W={...y,...H.i18n},$=await Wq(W.locale,H);X.__translations=$,X.__locale=W.locale,X.__i18nConfig=W,J=await h(J,Y,async(z,G,w,K,j)=>{try{let D={};if(w)try{let B=[()=>JSON.parse(w),()=>{let U=`{"data":${w}}`,M=JSON.parse(U);return typeof M.data==="object"?M.data:{}},()=>{return S(w,X)}];for(let U of B)try{if(D=U(),Object.keys(D).length>0)break}catch{}}catch(B){if(H.debug)console.error("Error parsing parameters for @translate directive:",B)}return L(G,$,W.fallbackToKey,D)||K.trim()}catch(D){if(H.debug)console.error("Error processing @translate directive:",D);return T("Translate",`Error in @translate('${G}'): ${D instanceof Error?D.message:String(D)}`,R.EVALUATION_ERROR)}});let Z=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]+\})\s*)?\)/g;if(H.debug){console.warn(`Processing translations in template. Sections: ${J.includes("<h2>Translation with Parameters</h2>")?"Parameters section found":"Parameters section missing"}`);let z=[...J.matchAll(Z)];console.warn(`Found ${z.length} @translate matches`),z.forEach((G,w)=>console.warn(`Match ${w}: ${G[0]}, Key: ${G[1]}, Params: ${G[2]||"none"}`))}return J=await h(J,/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)/g,async(z,G,w,K)=>{try{let j={};if(w)try{let D=[()=>JSON.parse(w),()=>{let A=`{"data":${w}}`,B=JSON.parse(A);return typeof B.data==="object"?B.data:{}},()=>{return S(w,X)}];for(let A of D)try{if(j=A(),Object.keys(j).length>0)break}catch{}}catch(D){if(H.debug)console.error("Error parsing parameters for @translate directive:",D)}return L(G,$,W.fallbackToKey,j)}catch(j){if(H.debug)console.error("Error processing @translate directive:",j);return T("Translate",`Error in @translate('${G}'): ${j instanceof Error?j.message:String(j)}`,R.EVALUATION_ERROR)}}),J}async function h(q,X,Q){let H=[];return q.replace(X,(Y,...W)=>{let $=Q(Y,...W).then((Z)=>({match:Y,replacement:Z}));return H.push($),Y}),(await Promise.all(H)).reduce((Y,{match:W,replacement:$})=>Y.replace(W,$),q)}function rq(q,X=!0){return(Q,H={})=>{return L(Q,q,X,H)}}import c from"path";function v(q,X){if(!q||x(q)!=="rtl")return!1;return!X||X.trim().toLowerCase()!=="rtl"}function n(q){if(!q)return!1;return q.trim().split(/\s+/)[0]?.toLowerCase()==="presentation"||q.trim().split(/\s+/)[0]?.toLowerCase()==="none"}function N(q,X){let Q=new RegExp(`\\b${X}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i").exec(q);if(!Q)return null;return Q[2]??Q[3]??Q[4]??null}function eq(q,X,Q,H){let J=q;J=J.replace(/@a11y\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(W,$,Z)=>{let z={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[$]||"Make this element accessible";return`<!-- a11y-hint: ${Z||z} -->`});let Y=/@screenReader\(([^@]*)\)@endScreenReader/g;return J=J.replace(Y,(W,$)=>{return`<span class="sr-only">${$.trim()}</span>`}),J=J.replace(/@ariaDescribe\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(W,$,Z)=>{return`<span id="${`desc-${$}`}" class="sr-only">${Z}</span>`}),J}function qH(){return`
4
4
  .sr-only {
5
5
  position: absolute;
@@ -13,4 +13,4 @@ import{is as i}from"./chunk-t00ga194.js";import{$t as R,Iu as S,pu as T}from"./c
13
13
  border-width: 0;
14
14
  }
15
15
  `.trim()}function Oq(){return typeof globalThis.document<"u"&&typeof globalThis.document.createElement==="function"}function s(q){let X=new Map,Q=q.replace(/<(\/?)([A-Z][\w:.-]*)(?=[\s/>])/g,(J,Y,W)=>{let $=X.get(W);if(!$)$=`stx-a11y-component-${X.size}`,X.set(W,$);return`<${Y}${$}`}),H=new Map([...X.entries()].map(([J,Y])=>[Y,J]));return{protectedSource:Q,restore:(J)=>J.replace(/<(\/?)(stx-a11y-component-\d+)(?=[\s/>])/g,(Y,W,$)=>{let Z=H.get($);return Z?`<${W}${Z}`:Y})}}function Nq(q,X){let Q=[],H=/<img\s+([^>]*)>/gi,J;J=H.exec(q);while(J!==null){let B=J[1];if(!/\balt\s*=/i.test(B))Q.push({type:"missing-alt",element:J[0].substring(0,100),message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"});J=H.exec(q)}let Y=/<button([^>]*)>\s*<\/button>/gi;J=Y.exec(q);while(J!==null){let B=J[1];if(!/\baria-label\s*=/i.test(B)&&!/\btitle\s*=/i.test(B))Q.push({type:"missing-accessible-name",element:J[0].substring(0,100),message:"Empty button missing accessible name",impact:"critical",help:"Add text content, aria-label, or title",helpUrl:"https://web.dev/learn/accessibility/aria-html/"});J=Y.exec(q)}let W=/<a\s+([^>]*)>\s*<\/a>/gi;J=W.exec(q);while(J!==null){let B=J[1];if(!/\baria-label\s*=/i.test(B)&&!/\btitle\s*=/i.test(B))Q.push({type:"link-missing-text",element:J[0].substring(0,100),message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"});J=W.exec(q)}let $=/<(input|select|textarea)\s+([^>]*)>/gi;J=$.exec(q);while(J!==null){let B=J[2];if(/\btype\s*=\s*["']hidden["']/i.test(B)){J=$.exec(q);continue}let U=/\baria-label\s*=/i.test(B)||/\baria-labelledby\s*=/i.test(B),M=B.match(/\bid\s*=\s*["']([^"']+)["']/i);if(!U){let r=M&&new RegExp(`<label[^>]*\\bfor\\s*=\\s*["']${M[1]}["']`,"i").test(q),f=J.index,d=q.substring(0,f),Lq=q.substring(f),l=(d.match(/<label\b/gi)||[]).length,o=(d.match(/<\/label>/gi)||[]).length,a=l>o;if(!r&&!a)Q.push({type:"input-missing-label",element:J[0].substring(0,100),message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})}J=$.exec(q)}let Z=/<h([1-6])[^>]*>/gi,_=[];J=Z.exec(q);while(J!==null)_.push(Number.parseInt(J[1],10)),J=Z.exec(q);let z=0;for(let B of _){if(z>0&&B>z+1)Q.push({type:"heading-skip",element:`<h${B}>`,message:`Heading level skipped from h${z} to h${B}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});z=B}if(/<html\b/i.test(q)&&!/<html[^>]*\slang\s*=/i.test(q))Q.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});let G=q.match(/<html\b([^>]*)>/i);if(G&&v(N(G[1],"lang"),N(G[1],"dir")))Q.push({type:"missing-dir",element:G[0].substring(0,100),message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});let w=/<table([^>]*)>([\s\S]*?)<\/table>/gi;J=w.exec(q);while(J!==null){let B=J[2];if(!n(N(J[1],"role"))&&!/<th\b/i.test(B))Q.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});J=w.exec(q)}let K=/<(video|audio)[^>]*\sautoplay\s[^>]*>/gi;J=K.exec(q);while(J!==null){if(!/\bmuted\b/i.test(J[0]))Q.push({type:"autoplay-audio",element:`<${J[1]}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"});J=K.exec(q)}let j=/\btabindex\s*=\s*["']([1-9]\d*)["']/gi;J=j.exec(q);while(J!==null)Q.push({type:"positive-tabindex",element:`tabindex="${J[1]}"`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"}),J=j.exec(q);let D=/<iframe\s+([^>]*)>/gi;J=D.exec(q);while(J!==null){let B=J[1];if(!/\btitle\s*=/i.test(B)&&!/\baria-label\s*=/i.test(B))Q.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"});J=D.exec(q)}let A=/<([a-z]+)\s+([^>]*role\s*=\s*["']button["'][^>]*)>/gi;J=A.exec(q);while(J!==null){let B=J[1].toLowerCase(),U=J[2];if(B!=="button"&&!/\btabindex\s*=/i.test(U))Q.push({type:"button-not-focusable",element:J[0].substring(0,100),message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"});J=A.exec(q)}return Q}async function Pq(q,X){let{protectedSource:Q}=s(q);if(!Oq())return Nq(Q,X);let H=[];try{let J=globalThis.document.createElement("div");J.innerHTML=Q,J.querySelectorAll("img").forEach((Z)=>{if(!Z.hasAttribute("alt"))H.push({type:"missing-alt",element:`<${Z.outerHTML}>`,message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"})}),J.querySelectorAll('button, a, [role="button"]').forEach((Z)=>{if(!(Z.hasAttribute("aria-label")||Z.hasAttribute("aria-labelledby")||Z.textContent&&Z.textContent.trim().length>0))H.push({type:"missing-accessible-name",element:`<${Z.outerHTML}>`,message:"Interactive element missing accessible name",impact:"critical",help:"Add text content, aria-label, or aria-labelledby",helpUrl:"https://web.dev/learn/accessibility/aria-html/"})}),J.querySelectorAll("input, select, textarea").forEach((Z)=>{let _=Z.getAttribute("id"),z=_&&J.querySelector(`label[for="${_}"]`),G=Z.hasAttribute("aria-label")||Z.hasAttribute("aria-labelledby"),w=Z.closest("label")!==null;if(!z&&!G&&!w)H.push({type:"input-missing-label",element:`<${Z.outerHTML}>`,message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})});let Y=Array.from(J.querySelectorAll("h1, h2, h3, h4, h5, h6")),W=0;for(let Z of Y){let _=Number.parseInt(Z.tagName.charAt(1));if(W>0&&_>W+1)H.push({type:"heading-skip",element:`<${Z.outerHTML}>`,message:`Heading level skipped from h${W} to h${_}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});W=_}let $=J.querySelector("html");if(Q.includes("<html")&&$&&!$.hasAttribute("lang"))H.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});if($&&v($.getAttribute("lang"),$.getAttribute("dir")))H.push({type:"missing-dir",element:"<html>",message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});if(J.querySelectorAll("a").forEach((Z)=>{let _=Z.textContent&&Z.textContent.trim().length>0,z=Z.hasAttribute("aria-label")||Z.hasAttribute("aria-labelledby"),G=Z.hasAttribute("title"),w=Z.querySelector("img[alt]");if(!_&&!z&&!G&&!w)H.push({type:"link-missing-text",element:`<${Z.outerHTML}>`,message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"})}),Q.includes("<nav")||Q.includes("<header")){if(!J.querySelector('a[href="#main"], a[href="#content"], .skip-link, [class*="skip"]')&&J.querySelectorAll("a").length>5)H.push({type:"missing-skip-link",element:"<nav>",message:"Consider adding a skip navigation link",impact:"minor",help:"Add a skip link to allow keyboard users to bypass navigation",helpUrl:"https://web.dev/learn/accessibility/focus/#skip-links"})}if(J.querySelectorAll("table").forEach((Z)=>{if(n(Z.getAttribute("role")))return;let _=Z.querySelector("caption");if(!Z.querySelector("th"))H.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});if(!_&&!Z.hasAttribute("aria-label")&&!Z.hasAttribute("aria-labelledby"))H.push({type:"table-missing-caption",element:"<table>",message:"Table missing caption or accessible name",impact:"minor",help:"Add a caption element or aria-label to describe the table",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"})}),J.querySelectorAll('[style*="color"]').forEach((Z)=>{let _=Z.getAttribute("style")||"";if(_.includes("color:")&&!_.includes("background"))H.push({type:"potential-contrast-issue",element:`<${Z.tagName.toLowerCase()}>`,message:"Element has inline color style - verify contrast ratio",impact:"minor",help:"Ensure text has sufficient contrast ratio (4.5:1 for normal text)",helpUrl:"https://web.dev/learn/accessibility/color-contrast/"})}),J.querySelectorAll("video[autoplay], audio[autoplay]").forEach((Z)=>{if(!Z.hasAttribute("muted"))H.push({type:"autoplay-audio",element:`<${Z.tagName.toLowerCase()}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"})}),J.querySelectorAll("[tabindex]").forEach((Z)=>{if(Number.parseInt(Z.getAttribute("tabindex")||"0")>0)H.push({type:"positive-tabindex",element:`<${Z.tagName.toLowerCase()}>`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"})}),J.querySelectorAll('[role="button"]').forEach((Z)=>{if(!Z.hasAttribute("tabindex"))H.push({type:"button-not-focusable",element:`<${Z.outerHTML}>`,message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"})}),Q.includes("<body")&&!J.querySelector('main, [role="main"]'))H.push({type:"missing-main-landmark",element:"<body>",message:"Document missing main landmark region",impact:"moderate",help:"Add a main element to identify the primary content",helpUrl:"https://web.dev/learn/accessibility/structure/#landmarks"});J.querySelectorAll("iframe").forEach((Z)=>{if(!Z.hasAttribute("title")&&!Z.hasAttribute("aria-label"))H.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"})})}catch(J){console.error(`Error checking accessibility in ${X}:`,J)}return H}async function Iq(q,X={}){let Q={},{recursive:H=!0,ignorePaths:J=[]}=X,Y=Array.isArray(q)?q:[q],W=await i(Y,{recursive:H,ignorePaths:J}),$=[];for(let Z of W)try{let _=await Bun.file(Z).text();if(Z.endsWith("good-a11y.stx"))continue;let z=await Pq(_,Z);if($.push(Z),z.length>0)Q[Z]=z}catch(_){console.error(`Error scanning ${Z}:`,_)}return{results:Q,scannedFiles:$}}async function HH(q,X={}){return(await Iq(q,X)).results}var Rq={fixMissingAlt:!0,fixMissingLabels:!0,fixMissingFormLabels:!0,fixTableHeaders:!0,fixMissingLang:!0,fixMissingDir:!0,fixPositiveTabindex:!0,fixButtonFocusable:!0,defaultLang:"en"};function Tq(q,X={}){let Q={...Rq,...X},H=[],{protectedSource:J,restore:Y}=s(q),W=J;if(Q.fixMissingAlt)W=W.replace(/<img([^>]*?)(?<!\balt\s*=\s*["'][^"']*["'])(\s*\/?>)/gi,($,Z,_)=>{if(/\balt\s*=/i.test(Z))return $;let z=$,G=`<img${Z} alt=""${_}`;return H.push({type:"missing-alt",description:"Added empty alt attribute to image",before:z,after:G}),G});if(Q.fixMissingLabels)W=W.replace(/<button([^>]*)>\s*<\/button>/gi,($,Z)=>{if(/\baria-label\s*=/i.test(Z)||/\btitle\s*=/i.test(Z))return $;let _=$,z=`<button${Z} aria-label="Button"></button>`;return H.push({type:"missing-accessible-name",description:"Added aria-label to empty button",before:_,after:z}),z}),W=W.replace(/<a([^>]*)>\s*(<(?:i|span|svg)[^>]*(?:class="[^"]*icon[^"]*")?[^>]*>.*?<\/(?:i|span|svg)>)?\s*<\/a>/gi,($,Z,_)=>{if(/\baria-label\s*=/i.test(Z)||/\btitle\s*=/i.test(Z))return $;if(!_&&$.replace(/<a[^>]*>|<\/a>/gi,"").trim())return $;let z=$,G=`<a${Z} aria-label="Link">${_||""}</a>`;return H.push({type:"missing-accessible-name",description:"Added aria-label to link without text",before:z,after:G}),G});if(Q.fixMissingFormLabels)W=W.replace(/<(input|select|textarea)([^>]*)>/gi,($,Z,_)=>{if(/\baria-label\s*=/i.test(_)||/\baria-labelledby\s*=/i.test(_))return $;if(/\btype\s*=\s*["']hidden["']/i.test(_))return $;let z=_.match(/\bname\s*=\s*["']([^"']+)["']/i),G=_.match(/\bid\s*=\s*["']([^"']+)["']/i),w=z?.[1]||G?.[1]||Z,K=$,j=`<${Z}${_} aria-label="${w}">`;return H.push({type:"input-missing-label",description:`Added aria-label to ${Z} element`,before:K,after:j}),j});if(Q.fixMissingLang)W=W.replace(/<html([^>]*)>/gi,($,Z)=>{if(/\blang\s*=/i.test(Z))return $;let _=$,z=`<html${Z} lang="${Q.defaultLang}">`;return H.push({type:"missing-lang",description:`Added lang="${Q.defaultLang}" to html element`,before:_,after:z}),z});if(Q.fixMissingDir)W=W.replace(/<html([^>]*)>/gi,($,Z)=>{let _=N(Z,"lang");if(!v(_,N(Z,"dir")))return $;let z=/\bdir\s*=/i.test(Z)?`<html${Z.replace(/\bdir\s*=\s*(["'])[^"']*\1/i,'dir="rtl"')}>`:`<html${Z} dir="rtl">`;return H.push({type:"missing-dir",description:`Added dir="rtl" to html element (lang="${_}" is right-to-left)`,before:$,after:z}),z});if(Q.fixPositiveTabindex)W=W.replace(/\btabindex\s*=\s*["']([1-9]\d*)["']/gi,($,Z)=>{let _=$,z='tabindex="0"';return H.push({type:"positive-tabindex",description:`Changed tabindex="${Z}" to tabindex="0"`,before:_,after:'tabindex="0"'}),'tabindex="0"'});if(Q.fixButtonFocusable)W=W.replace(/<([a-z]+)(\s[^>]*role\s*=\s*["']button["'][^>]*)>/gi,($,Z,_)=>{if(/\btabindex\s*=/i.test(_))return $;if(Z.toLowerCase()==="button")return $;let z=$,G=`<${Z}${_} tabindex="0">`;return H.push({type:"button-not-focusable",description:'Added tabindex="0" to element with role="button"',before:z,after:G}),G});if(Q.fixTableHeaders)W=W.replace(/<th([^>]*)>/gi,($,Z)=>{if(/\bscope\s*=/i.test(Z))return $;let _=$,z=`<th${Z} scope="col">`;return H.push({type:"table-missing-scope",description:'Added scope="col" to table header',before:_,after:z}),z});return{original:q,fixed:Y(W),fixCount:H.length,fixes:H}}async function Sq(q,X={},Q=!1){let H=await Bun.file(q).text(),J=Tq(H,X);if(Q&&J.fixCount>0)await Bun.write(q,J.fixed);return J}async function JH(q,X={},Q={}){let H={},{recursive:J=!0,ignorePaths:Y=[],writeBack:W=!1,extensions:$=[".stx",".html",".htm"]}=Q,Z=$.length===1?`*${$[0]}`:`*{${$.join(",")}}`,_=c.join(q,J?`**/${Z}`:Z),z=new Bun.Glob(_);for await(let G of z.scan()){if(Y.some((K)=>G.includes(c.normalize(K))))continue;try{let K=await Sq(G,X,W);if(K.fixCount>0)H[G]=K}catch(K){console.error(`Error fixing ${G}:`,K)}}return H}var kq={name:"a11y",handler:(q,X,Q,H)=>{if(!X.length)return q;let J=X[0].replace(/['"]/g,""),Y=X.length>1?X[1].replace(/['"]/g,""):"",$={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[J]||"Make this element accessible";return`<!-- a11y-hint: ${Y||$} -->${q}`},hasEndTag:!1},bq={name:"screenReader",handler:(q)=>{return`<span class="sr-only">${q}</span>`},hasEndTag:!0};function QH(){return[kq,bq]}
16
- export{y as yr,vq as zr,fq as Ar,dq as Br,gq as Cr,uq as Dr,qq as Er,hq as Fr,P as Gr,Hq as Hr,pq as Ir,mq as Jr,cq as Kr,iq as Lr,Wq as Mr,_q as Nr,Uq as Or,L as Pr,x as Qr,nq as Rr,sq as Sr,rq as Tr,n as Ur,N as Vr,eq as Wr,qH as Xr,Oq as Yr,Nq as Zr,Pq as _r,Iq as $r,HH as as,Tq as bs,Sq as cs,JH as ds,kq as es,bq as fs,QH as gs};
16
+ export{y as Cr,vq as Dr,fq as Er,dq as Fr,gq as Gr,uq as Hr,qq as Ir,hq as Jr,P as Kr,Hq as Lr,pq as Mr,mq as Nr,cq as Or,iq as Pr,Wq as Qr,_q as Rr,Uq as Sr,L as Tr,x as Ur,nq as Vr,sq as Wr,rq as Xr,n as Yr,N as Zr,eq as _r,qH as $r,Oq as as,Nq as bs,Pq as cs,Iq as ds,HH as es,Tq as fs,Sq as gs,JH as hs,kq as is,bq as js,QH as ks};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{nj as o,oj as p,pj as q}from"./chunk-zg2hvb1j.js";import{Aj as f,Bj as g,Cj as h,Dj as i,Ej as j,Fj as k,Gj as l,Hj as m,Ij as n,vj as a,wj as b,xj as c,yj as d,zj as e}from"./chunk-e4g8wz6t.js";import"./chunk-deqnt1w5.js";import"./chunk-5g6rprcy.js";export{n as useOptimistic,l as untrack,a as state,g as runMountCallbacks,h as runDestroyCallbacks,i as pendingLifecycleCounts,m as peek,e as onMount,f as onDestroy,j as isSignal,k as isDerived,p as generateSignalsRuntimeDev,o as generateSignalsRuntime,c as effect,b as derived,q as default,d as batch};
2
+ import{nj as o,oj as p,pj as q}from"./chunk-saqbtgqr.js";import{Aj as f,Bj as g,Cj as h,Dj as i,Ej as j,Fj as k,Gj as l,Hj as m,Ij as n,vj as a,wj as b,xj as c,yj as d,zj as e}from"./chunk-e4g8wz6t.js";import"./chunk-wv8h3d68.js";import"./chunk-p5d8sb50.js";export{n as useOptimistic,l as untrack,a as state,g as runMountCallbacks,h as runDestroyCallbacks,i as pendingLifecycleCounts,m as peek,e as onMount,f as onDestroy,j as isSignal,k as isDerived,p as generateSignalsRuntimeDev,o as generateSignalsRuntime,c as effect,b as derived,q as default,d as batch};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Kp as b,Lp as c,Mp as d,Np as e,po as a}from"./chunk-j82hfkcf.js";import"./chunk-rh7mwwb4.js";import"./chunk-1t3j8a0q.js";import"./chunk-01ggk8k8.js";import"./chunk-25b8z7xa.js";import"./chunk-hk8j3eps.js";import"./chunk-xe93ae3r.js";import"./chunk-1spzqjve.js";import"./chunk-f2qbjr3z.js";import"./chunk-1xwfws06.js";import"./chunk-r1rfwm01.js";import"./chunk-ahpmjg3f.js";import"./chunk-bt8w146r.js";import"./chunk-6p6b01kp.js";import"./chunk-x7dv5rq7.js";import"./chunk-e0kzyf1g.js";import"./chunk-wv8h3d68.js";import"./chunk-beextc84.js";import"./chunk-yr7camcd.js";import"./chunk-p5d8sb50.js";export{d as validateClientScript,c as processOnceDirective,b as processJsonDirective,e as processDirectives,a as injectRouterScript};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ih as x,nh as B,oh as c,ph as u,qh as n}from"./chunk-18018jkn.js";import{tw as v}from"./chunk-5g6rprcy.js";import{resolve as JJ,basename as WJ,extname as _J,join as LJ}from"path";import{mkdir as QJ}from"fs/promises";var ZJ={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:2000,cacheTranscoded:!0,cacheThumbnails:!0,cacheManifests:!0};class V{config;constructor(K={}){this.config={...ZJ,...K}}async get(K,J){return c(K,J,"video",this.config)}async set(K,J,X){return u(K,J,X,"video",this.config)}async clear(){return n("video",this.config)}updateConfig(K){this.config={...this.config,...K}}}var S=null;function D(K){if(!S)S=new V(K);else if(K)S.updateConfig(K);return S}async function q(K,J,X){let N=X?{directory:`${X.outputDir}/../.cache`}:{};return D(N).get(K,J)}async function b(K,J,X,N){let Z=N?{directory:`${N.outputDir}/../.cache`}:{};return D(Z).set(K,J,X)}async function $J(){return D().clear()}import{resolve as y,basename as P,extname as f,join as U}from"path";import{mkdir as g}from"fs/promises";async function m(){try{return await import("ts-videos")}catch{return null}}async function h(K,J,X,N){let Z=await m();if(!Z)return console.warn("[stx-media] ts-videos not installed, cannot generate poster"),null;try{let $=y(K);if(!await B($))return null;await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),G=J.format||"webp",M=J.timestamp||0,E=`${z}-poster-${Y}.${G}`,W=U(X,E),Q=await Z.extractThumbnails($,{timestamps:[M],width:J.width||1280,height:J.height,format:G,quality:J.quality||85,outputDir:X,outputPattern:E.replace(`.${G}`,"")});if(Q&&Q.length>0){let _=Q[0];return{path:W,url:`${N}/${E}`,width:_.width||J.width||1280,height:_.height||720,timestamp:M,size:_.size||0}}return null}catch($){return console.warn(`[stx-media] Failed to generate poster: ${$}`),null}}async function d(K,J,X,N){let Z=await m();if(!Z)return[];try{let $=y(K);if(!await B($))return[];await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),G=J.format||"webp",W=(await new Z.Input($).getInfo()).duration||60,Q=J.count||10,_=J.interval||W/Q,O=[];for(let w=0;w<Q&&w*_<W;w++)O.push(w*_);let L=await Z.extractThumbnails($,{timestamps:O,width:J.width||320,format:G,quality:J.quality||80,outputDir:X,outputPattern:`${z}-thumb-${Y}`});if(L&&L.length>0)return L.map((w,j)=>({path:w.path||U(X,`${z}-thumb-${Y}-${j}.${G}`),url:`${N}/${z}-thumb-${Y}-${j}.${G}`,width:w.width||J.width||320,height:w.height||180,timestamp:O[j],size:w.size||0}));return[]}catch($){return console.warn(`[stx-media] Failed to generate thumbnails: ${$}`),[]}}async function zJ(K,J,X,N){let Z=await m();if(!Z)return console.warn("[stx-media] ts-videos not installed, cannot generate sprite sheet"),null;try{let $=y(K);if(!await B($))return null;await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),E=(await new Z.Input($).getInfo()).duration||60,W=J.columns||10,Q=J.interval||5,_=J.thumbnailWidth||160,O=J.thumbnailHeight||90,L=J.format||"jpeg",w=Math.ceil(E/Q),j=Math.ceil(w/W),F=`${z}-sprite-${Y}.${L}`,k=U(X,F),T=[];for(let I=0;I<w;I++)T.push(I*Q);let A=await Z.extractThumbnails($,{timestamps:T,width:_,height:O,format:L,quality:J.quality||70,outputDir:U(X,".temp")});if(!A||A.length===0)return null;try{let I=await import("ts-images"),H=W*_,kJ=j*O,jJ=await I.createSprite({images:A.map((YJ)=>YJ.path),columns:W,padding:0,outputPath:k,format:L,quality:J.quality||70});return{url:`${N}/${F}`,path:k,columns:W,rows:j,thumbnailWidth:_,thumbnailHeight:O,interval:Q,totalFrames:w}}catch{return console.warn("[stx-media] ts-images not installed, sprite sheet generation skipped"),null}}catch($){return console.warn(`[stx-media] Failed to generate sprite sheet: ${$}`),null}}import{resolve as r,basename as e,extname as i,join as C}from"path";import{mkdir as R,writeFile as o}from"fs/promises";async function t(){try{return await import("ts-videos")}catch{return null}}var s=[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000},{label:"360p",width:640,height:360,bitrate:600000,audioBitrate:64000}];async function p(K,J,X,N,Z){let $=await t();if(!$)return console.warn("[stx-media] ts-videos not installed, cannot generate HLS manifest"),null;try{let Y=r(K);if(!await B(Y))return null;let z=await x(Y),G=e(K,i(K)),M=C(X,`${G}-${z}-hls`);await R(M,{recursive:!0});let E=J.length>0?J:s,W=Z?.segmentDuration||6,O=(await new $.Input(Y).getInfo()).duration||0,L=[],w=0;for(let k of E){let T=C(M,k.label);await R(T,{recursive:!0});let A=`${k.label}.m3u8`,I=C(T,A);try{let H=await $.generateHLS(Y,{outputDir:T,segmentDuration:W,width:k.width,height:k.height,videoBitrate:k.bitrate,audioBitrate:k.audioBitrate,playlistName:k.label});if(H)L.push({quality:k,url:`${N}/${G}-${z}-hls/${k.label}/${A}`,path:I}),w+=H.segmentCount||Math.ceil(O/W)}catch(H){console.warn(`[stx-media] Failed to generate HLS for ${k.label}: ${H}`)}}if(L.length===0)return null;let j=C(M,"master.m3u8"),F=GJ(L,N,G,z);return await o(j,F),{manifestUrl:`${N}/${G}-${z}-hls/master.m3u8`,manifestPath:j,playlists:L,segmentCount:w,duration:O}}catch(Y){return console.warn(`[stx-media] Failed to generate HLS manifest: ${Y}`),null}}function GJ(K,J,X,N){let Z=["#EXTM3U","#EXT-X-VERSION:3"];for(let $ of K){let{quality:Y}=$,z=Y.bitrate+(Y.audioBitrate||128000),G=`${Y.width}x${Y.height||Math.round(Y.width*9/16)}`;Z.push(`#EXT-X-STREAM-INF:BANDWIDTH=${z},RESOLUTION=${G},NAME="${Y.label}"`,`${Y.label}/${Y.label}.m3u8`)}return Z.join(`
2
+ import{ih as x,nh as B,oh as c,ph as u,qh as n}from"./chunk-18018jkn.js";import{xw as v}from"./chunk-p5d8sb50.js";import{resolve as JJ,basename as WJ,extname as _J,join as LJ}from"path";import{mkdir as QJ}from"fs/promises";var ZJ={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:2000,cacheTranscoded:!0,cacheThumbnails:!0,cacheManifests:!0};class V{config;constructor(K={}){this.config={...ZJ,...K}}async get(K,J){return c(K,J,"video",this.config)}async set(K,J,X){return u(K,J,X,"video",this.config)}async clear(){return n("video",this.config)}updateConfig(K){this.config={...this.config,...K}}}var S=null;function D(K){if(!S)S=new V(K);else if(K)S.updateConfig(K);return S}async function q(K,J,X){let N=X?{directory:`${X.outputDir}/../.cache`}:{};return D(N).get(K,J)}async function b(K,J,X,N){let Z=N?{directory:`${N.outputDir}/../.cache`}:{};return D(Z).set(K,J,X)}async function $J(){return D().clear()}import{resolve as y,basename as P,extname as f,join as U}from"path";import{mkdir as g}from"fs/promises";async function m(){try{return await import("ts-videos")}catch{return null}}async function h(K,J,X,N){let Z=await m();if(!Z)return console.warn("[stx-media] ts-videos not installed, cannot generate poster"),null;try{let $=y(K);if(!await B($))return null;await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),G=J.format||"webp",M=J.timestamp||0,E=`${z}-poster-${Y}.${G}`,W=U(X,E),Q=await Z.extractThumbnails($,{timestamps:[M],width:J.width||1280,height:J.height,format:G,quality:J.quality||85,outputDir:X,outputPattern:E.replace(`.${G}`,"")});if(Q&&Q.length>0){let _=Q[0];return{path:W,url:`${N}/${E}`,width:_.width||J.width||1280,height:_.height||720,timestamp:M,size:_.size||0}}return null}catch($){return console.warn(`[stx-media] Failed to generate poster: ${$}`),null}}async function d(K,J,X,N){let Z=await m();if(!Z)return[];try{let $=y(K);if(!await B($))return[];await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),G=J.format||"webp",W=(await new Z.Input($).getInfo()).duration||60,Q=J.count||10,_=J.interval||W/Q,O=[];for(let w=0;w<Q&&w*_<W;w++)O.push(w*_);let L=await Z.extractThumbnails($,{timestamps:O,width:J.width||320,format:G,quality:J.quality||80,outputDir:X,outputPattern:`${z}-thumb-${Y}`});if(L&&L.length>0)return L.map((w,j)=>({path:w.path||U(X,`${z}-thumb-${Y}-${j}.${G}`),url:`${N}/${z}-thumb-${Y}-${j}.${G}`,width:w.width||J.width||320,height:w.height||180,timestamp:O[j],size:w.size||0}));return[]}catch($){return console.warn(`[stx-media] Failed to generate thumbnails: ${$}`),[]}}async function zJ(K,J,X,N){let Z=await m();if(!Z)return console.warn("[stx-media] ts-videos not installed, cannot generate sprite sheet"),null;try{let $=y(K);if(!await B($))return null;await g(X,{recursive:!0});let Y=await x($),z=P(K,f(K)),E=(await new Z.Input($).getInfo()).duration||60,W=J.columns||10,Q=J.interval||5,_=J.thumbnailWidth||160,O=J.thumbnailHeight||90,L=J.format||"jpeg",w=Math.ceil(E/Q),j=Math.ceil(w/W),F=`${z}-sprite-${Y}.${L}`,k=U(X,F),T=[];for(let I=0;I<w;I++)T.push(I*Q);let A=await Z.extractThumbnails($,{timestamps:T,width:_,height:O,format:L,quality:J.quality||70,outputDir:U(X,".temp")});if(!A||A.length===0)return null;try{let I=await import("ts-images"),H=W*_,kJ=j*O,jJ=await I.createSprite({images:A.map((YJ)=>YJ.path),columns:W,padding:0,outputPath:k,format:L,quality:J.quality||70});return{url:`${N}/${F}`,path:k,columns:W,rows:j,thumbnailWidth:_,thumbnailHeight:O,interval:Q,totalFrames:w}}catch{return console.warn("[stx-media] ts-images not installed, sprite sheet generation skipped"),null}}catch($){return console.warn(`[stx-media] Failed to generate sprite sheet: ${$}`),null}}import{resolve as r,basename as e,extname as i,join as C}from"path";import{mkdir as R,writeFile as o}from"fs/promises";async function t(){try{return await import("ts-videos")}catch{return null}}var s=[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000},{label:"360p",width:640,height:360,bitrate:600000,audioBitrate:64000}];async function p(K,J,X,N,Z){let $=await t();if(!$)return console.warn("[stx-media] ts-videos not installed, cannot generate HLS manifest"),null;try{let Y=r(K);if(!await B(Y))return null;let z=await x(Y),G=e(K,i(K)),M=C(X,`${G}-${z}-hls`);await R(M,{recursive:!0});let E=J.length>0?J:s,W=Z?.segmentDuration||6,O=(await new $.Input(Y).getInfo()).duration||0,L=[],w=0;for(let k of E){let T=C(M,k.label);await R(T,{recursive:!0});let A=`${k.label}.m3u8`,I=C(T,A);try{let H=await $.generateHLS(Y,{outputDir:T,segmentDuration:W,width:k.width,height:k.height,videoBitrate:k.bitrate,audioBitrate:k.audioBitrate,playlistName:k.label});if(H)L.push({quality:k,url:`${N}/${G}-${z}-hls/${k.label}/${A}`,path:I}),w+=H.segmentCount||Math.ceil(O/W)}catch(H){console.warn(`[stx-media] Failed to generate HLS for ${k.label}: ${H}`)}}if(L.length===0)return null;let j=C(M,"master.m3u8"),F=GJ(L,N,G,z);return await o(j,F),{manifestUrl:`${N}/${G}-${z}-hls/master.m3u8`,manifestPath:j,playlists:L,segmentCount:w,duration:O}}catch(Y){return console.warn(`[stx-media] Failed to generate HLS manifest: ${Y}`),null}}function GJ(K,J,X,N){let Z=["#EXTM3U","#EXT-X-VERSION:3"];for(let $ of K){let{quality:Y}=$,z=Y.bitrate+(Y.audioBitrate||128000),G=`${Y.width}x${Y.height||Math.round(Y.width*9/16)}`;Z.push(`#EXT-X-STREAM-INF:BANDWIDTH=${z},RESOLUTION=${G},NAME="${Y.label}"`,`${Y.label}/${Y.label}.m3u8`)}return Z.join(`
3
3
  `)}async function l(K,J,X,N,Z){let $=await t();if(!$)return console.warn("[stx-media] ts-videos not installed, cannot generate DASH manifest"),null;try{let Y=r(K);if(!await B(Y))return null;let z=await x(Y),G=e(K,i(K)),M=C(X,`${G}-${z}-dash`);await R(M,{recursive:!0});let E=J.length>0?J:s,W=Z?.segmentDuration||4,Q=Z?.minBufferTime||2,L=(await new $.Input(Y).getInfo()).duration||0,w=[],j=[];for(let A of E){let I=C(M,A.label);await R(I,{recursive:!0});try{if(await $.generateDASH(Y,{outputDir:I,segmentDuration:W,width:A.width,height:A.height,videoBitrate:A.bitrate,audioBitrate:A.audioBitrate})){if(w.push({bandwidth:A.bitrate,width:A.width,height:A.height||Math.round(A.width*9/16),url:`${N}/${G}-${z}-dash/${A.label}/video`}),A.audioBitrate)j.push({bandwidth:A.audioBitrate,url:`${N}/${G}-${z}-dash/${A.label}/audio`})}}catch(H){console.warn(`[stx-media] Failed to generate DASH for ${A.label}: ${H}`)}}if(w.length===0)return null;let F=C(M,"manifest.mpd"),k=NJ(w,j,L,W,Q);await o(F,k);let T=[{type:"video",representations:w}];if(j.length>0)T.push({type:"audio",representations:j});return{manifestUrl:`${N}/${G}-${z}-dash/manifest.mpd`,manifestPath:F,adaptationSets:T,duration:L}}catch(Y){return console.warn(`[stx-media] Failed to generate DASH manifest: ${Y}`),null}}function NJ(K,J,X,N,Z){let $=a(X),Y=a(Z),z=`<?xml version="1.0" encoding="UTF-8"?>
4
4
  <MPD xmlns="urn:mpeg:dash:schema:mpd:2011"
5
5
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Aj as M,Ej as E,Fj as P,Gj as O,Hj as I,vj as B,wj as R,xj as H,yj as S,zj as F}from"./chunk-e4g8wz6t.js";import{uv as L}from"./chunk-deqnt1w5.js";var w=null;function j(){return w}function f(z,W){if(w)w.provides.set(z,W);else V.set(z,W)}function k(z,W){let Q=w;while(Q){if(Q.provides.has(z))return Q.provides.get(z);Q=Q.parent}if(V.has(z))return V.get(z);return W}var V=new Map;function v(z,W){V.set(z,W)}function U(z){let W=w,Q=W?.el,Z=Array.isArray(z)?z:z&&typeof z==="object"?Object.keys(z):[];if(Q&&Z.length>0){let $=Q.__stx_component_emits||=Object.create(null);for(let Y of Z)$[Y]=!0}let _=($,...Y)=>{if(typeof document>"u")return;if(Q){let X=Q.__stx_component_emits||=Object.create(null);X[$]=!0,Q.dispatchEvent(new CustomEvent($,{detail:Y.length===1?Y[0]:Y,bubbles:!0,cancelable:!0}))}};if(W)W.emit=_;return _}function g(z){if(w)w.exposed=z}function m(z){let W=Promise.resolve();return z?W.then(z):W}function y(z){if(w)w.errorCapturedHooks.push(z)}function h(z,W,Q){let Z=W?.parent;while(Z){for(let _ of Z.errorCapturedHooks)if(_(z,W,Q)===!1)return;Z=Z.parent}}function p(){return w?.slots??{}}function u(){return w?.slots??{}}function l(){return w?.attrs??{}}function d(z){let W=z.__provides?new Map(Object.entries(z.__provides)):new Map;return{...z,__provides:W,__provide(Q,Z){W.set(Q,Z)},__inject(Q,Z){if(W.has(Q))return W.get(Q);if(z.__provides){let _=z.__provides instanceof Map?z.__provides:new Map(Object.entries(z.__provides));if(_.has(Q))return _.get(Q)}return Z}}}function i(){return`
2
+ import{Aj as M,Ej as E,Fj as P,Gj as O,Hj as I,vj as B,wj as R,xj as H,yj as S,zj as F}from"./chunk-e4g8wz6t.js";import{yv as L}from"./chunk-wv8h3d68.js";var w=null;function j(){return w}function f(z,W){if(w)w.provides.set(z,W);else V.set(z,W)}function k(z,W){let Q=w;while(Q){if(Q.provides.has(z))return Q.provides.get(z);Q=Q.parent}if(V.has(z))return V.get(z);return W}var V=new Map;function v(z,W){V.set(z,W)}function U(z){let W=w,Q=W?.el,Z=Array.isArray(z)?z:z&&typeof z==="object"?Object.keys(z):[];if(Q&&Z.length>0){let $=Q.__stx_component_emits||=Object.create(null);for(let Y of Z)$[Y]=!0}let _=($,...Y)=>{if(typeof document>"u")return;if(Q){let X=Q.__stx_component_emits||=Object.create(null);X[$]=!0,Q.dispatchEvent(new CustomEvent($,{detail:Y.length===1?Y[0]:Y,bubbles:!0,cancelable:!0}))}};if(W)W.emit=_;return _}function g(z){if(w)w.exposed=z}function m(z){let W=Promise.resolve();return z?W.then(z):W}function y(z){if(w)w.errorCapturedHooks.push(z)}function h(z,W,Q){let Z=W?.parent;while(Z){for(let _ of Z.errorCapturedHooks)if(_(z,W,Q)===!1)return;Z=Z.parent}}function p(){return w?.slots??{}}function u(){return w?.slots??{}}function l(){return w?.attrs??{}}function d(z){let W=z.__provides?new Map(Object.entries(z.__provides)):new Map;return{...z,__provides:W,__provide(Q,Z){W.set(Q,Z)},__inject(Q,Z){if(W.has(Q))return W.get(Q);if(z.__provides){let _=z.__provides instanceof Map?z.__provides:new Map(Object.entries(z.__provides));if(_.has(Q))return _.get(Q)}return Z}}}function i(){return`
3
3
  // STX Composition API Runtime
4
4
  (function() {
5
5
  const _provides = new Map();
@@ -3164,7 +3164,12 @@ catch (e) {
3164
3164
  }
3165
3165
  }, {
3166
3166
  capture: modifiers.includes('capture'),
3167
- passive: modifiers.includes('passive'),
3167
+ // A touch or wheel listener that is not passive holds every scroll
3168
+ // starting on the element until this thread has run it. Passive
3169
+ // unless .prevent needs preventDefault() or .nonpassive asks.
3170
+ passive: modifiers.includes('passive')
3171
+ || (/^(touchstart|touchmove|wheel|mousewheel)$/i.test(eventName)
3172
+ && !modifiers.includes('prevent') && !modifiers.includes('nonpassive')),
3168
3173
  once: modifiers.includes('once')
3169
3174
  });
3170
3175
  el.removeAttribute(name);
@@ -5605,6 +5610,19 @@ catch (e) {} }
5605
5610
  return matches;
5606
5611
  }
5607
5612
 
5613
+ // 'visible' or 'hidden', kept current: whether the page is on screen (the
5614
+ // app in the foreground, the tab in front). Built in rather than taken from
5615
+ // @stacksjs/browser, whose bundle a page then carried in full (~180KB) for
5616
+ // this one listener.
5617
+ function useDocumentVisibility() {
5618
+ var visibility = state(typeof document !== 'undefined' ? document.visibilityState : 'visible');
5619
+ if (typeof document === 'undefined') return visibility;
5620
+ var onChange = function() { visibility.set(document.visibilityState); };
5621
+ document.addEventListener('visibilitychange', onChange);
5622
+ onDestroy(function() { document.removeEventListener('visibilitychange', onChange); });
5623
+ return visibility;
5624
+ }
5625
+
5608
5626
  var scrollLockStates = new WeakMap();
5609
5627
 
5610
5628
  function resolveScrollLockTarget(target) {
@@ -6746,6 +6764,7 @@ catch (e) {} }
6746
6764
  useColorMode,
6747
6765
  useDark,
6748
6766
  useMediaQuery,
6767
+ useDocumentVisibility,
6749
6768
  useScrollLock,
6750
6769
  usePreferredDark,
6751
6770
  usePreferredLight,
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Hi as a,Ii as b}from"./chunk-ys56ecvx.js";import"./chunk-7we3xfde.js";import"./chunk-4wpxbkbe.js";import"./chunk-gbkq5qnw.js";import"./chunk-fvsefztj.js";import"./chunk-j82hfkcf.js";import"./chunk-rh7mwwb4.js";import"./chunk-1t3j8a0q.js";import"./chunk-01ggk8k8.js";import"./chunk-25b8z7xa.js";import"./chunk-hk8j3eps.js";import"./chunk-xe93ae3r.js";import"./chunk-1spzqjve.js";import"./chunk-f2qbjr3z.js";import"./chunk-1xwfws06.js";import"./chunk-r1rfwm01.js";import"./chunk-ahpmjg3f.js";import"./chunk-bt8w146r.js";import"./chunk-6p6b01kp.js";import"./chunk-x7dv5rq7.js";import"./chunk-e0kzyf1g.js";import"./chunk-wv8h3d68.js";import"./chunk-beextc84.js";import"./chunk-yr7camcd.js";import"./chunk-p5d8sb50.js";export{a as getStoreScript,b as clearStoreCache};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Qg as a,Rg as b,Sg as c,Tg as d,Ug as e,Vg as f,Wg as g,Xg as h,Yg as i}from"./chunk-yne23w3c.js";import"./chunk-18018jkn.js";import"./chunk-5g6rprcy.js";export{c as setCachedImageResult,e as processImage,f as optimizeImage,b as getCachedImageResult,i as generateSrcset,h as generateResponsiveVariants,d as clearImageCache,g as applyTransformations,a as ImageProcessorCache};
2
+ import{Qg as a,Rg as b,Sg as c,Tg as d,Ug as e,Vg as f,Wg as g,Xg as h,Yg as i}from"./chunk-fm5211ec.js";import"./chunk-18018jkn.js";import"./chunk-p5d8sb50.js";export{c as setCachedImageResult,e as processImage,f as optimizeImage,b as getCachedImageResult,i as generateSrcset,h as generateResponsiveVariants,d as clearImageCache,g as applyTransformations,a as ImageProcessorCache};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{fv as a,gv as b}from"./chunk-x7dv5rq7.js";import"./chunk-p5d8sb50.js";export{a as transformStoreImports,b as stripModuleImports};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{vi as a,wi as b,xi as c,yi as d,zi as e}from"./chunk-zk6ghjnj.js";import"./chunk-5g6rprcy.js";export{a as processAsyncDirectives,c as isAsyncComponent,e as generateAsyncComponentRuntime,d as generateAsyncComponentCSS,b as defineAsyncComponent};
2
+ import{vi as a,wi as b,xi as c,yi as d,zi as e}from"./chunk-zk6ghjnj.js";import"./chunk-p5d8sb50.js";export{a as processAsyncDirectives,c as isAsyncComponent,e as generateAsyncComponentRuntime,d as generateAsyncComponentCSS,b as defineAsyncComponent};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-5g6rprcy.js";import v from"fs";import H from"path";import{gzipSync as z}from"zlib";import{createHash as g}from"crypto";var D={".js":"js",".mjs":"js",".cjs":"js",".ts":"js",".jsx":"js",".tsx":"js",".css":"css",".scss":"css",".sass":"css",".less":"css",".html":"html",".htm":"html",".png":"image",".jpg":"image",".jpeg":"image",".gif":"image",".svg":"image",".webp":"image",".avif":"image",".ico":"image",".woff":"font",".woff2":"font",".ttf":"font",".eot":"font",".otf":"font"},b=[/node_modules/,/vendor/,/bower_components/,/\.min\./],B=[/index\.(js|ts|html)$/,/main\.(js|ts)$/,/app\.(js|ts)$/,/entry\.(js|ts)$/];async function L(X,Z={}){let{includeSourceMaps:Q=!1,parseImports:$=!0,detectDuplicates:U=!0,topModulesCount:K=20}=Z;if(!v.existsSync(X))throw Error(`Build directory not found: ${X}`);if(!v.statSync(X).isDirectory())throw Error(`Not a directory: ${X}`);let q=await k(X,Q),J=[],F=[];for(let A of q)try{let O=await f(A,X,$);J.push(O)}catch(O){F.push(`Failed to process ${A}: ${O}`)}let Y=c(J,X),V=J.reduce((A,O)=>A+O.size,0),_=J.reduce((A,O)=>A+O.gzipSize,0),w=m(J),G=U?p(J):[],C=[...J].sort((A,O)=>O.size-A.size).slice(0,K);return{timestamp:Date.now(),buildDir:H.resolve(X),chunks:Y,totalSize:V,totalGzipSize:_,moduleCount:J.length,duplicates:G,byType:w,largestModules:C,warnings:F}}async function k(X,Z){let Q=[];async function $(U){let K=await v.promises.readdir(U,{withFileTypes:!0});for(let j of K){let q=H.join(U,j.name);if(j.isDirectory()){if(!j.name.startsWith(".")&&j.name!=="node_modules")await $(q)}else if(j.isFile()){if(!Z&&j.name.endsWith(".map"))continue;Q.push(q)}}}return await $(X),Q}async function f(X,Z,Q){let $=await v.promises.readFile(X),U=H.relative(Z,X),K=H.extname(X).toLowerCase(),j=$.length,q=y($),J=h($,K),F=g("md5").update($).digest("hex").slice(0,8),Y=D[K]||"other",V=[];if(Q&&Y==="js")V.push(...d($.toString("utf-8")));return{id:U,path:U,size:j,gzipSize:q,parsedSize:J,extension:K,type:Y,imports:V,importedBy:[],hash:F}}function y(X){try{let Z=z(X,{level:9}).length;return Math.min(Z,X.length)}catch{return X.length}}function h(X,Z){if(Z.includes(".min.")||X.length<1000)return X.length;let $=D[Z];if($==="js")return Math.round(X.length*0.6);if($==="css")return Math.round(X.length*0.7);return X.length}function d(X){let Z=[],Q=/import\s+(?:[\w*{}\s,]+\s+from\s+)?['"]([^'"]+)['"]/g,$;while(($=Q.exec(X))!==null)Z.push($[1]);let U=/import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=U.exec(X))!==null)Z.push($[1]);let K=/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=K.exec(X))!==null)Z.push($[1]);return[...new Set(Z)]}function c(X,Z){let Q=new Map;for(let U of X){let K=U.path.split(H.sep),j;if(K.length===1)j=H.basename(U.path,U.extension);else j=K[0];let q=Q.get(j)||[];q.push(U),Q.set(j,q)}let $=[];for(let[U,K]of Q){let j=K.reduce((Y,V)=>Y+V.size,0),q=K.reduce((Y,V)=>Y+V.gzipSize,0),J=K.some((Y)=>B.some((V)=>V.test(Y.path))),F=K.some((Y)=>b.some((V)=>V.test(Y.path)));$.push({name:U,files:K.map((Y)=>Y.path),modules:K,size:j,gzipSize:q,isEntry:J,isVendor:F})}return $.sort((U,K)=>K.size-U.size)}function m(X){let Z={js:{count:0,size:0,gzipSize:0},css:{count:0,size:0,gzipSize:0},html:{count:0,size:0,gzipSize:0},image:{count:0,size:0,gzipSize:0},font:{count:0,size:0,gzipSize:0},other:{count:0,size:0,gzipSize:0}};for(let Q of X)Z[Q.type].count++,Z[Q.type].size+=Q.size,Z[Q.type].gzipSize+=Q.gzipSize;return Z}function p(X){let Z=new Map;for(let $ of X){let U=Z.get($.hash)||[];U.push($),Z.set($.hash,U)}let Q=[];for(let[,$]of Z)if($.length>1){let U=$[0];Q.push({path:U.path,count:$.length,wastedBytes:U.size*($.length-1),locations:$.map((K)=>K.path)})}return Q.sort(($,U)=>U.wastedBytes-$.wastedBytes)}function W(X){if(X<1024)return`${X} B`;if(X<1048576)return`${(X/1024).toFixed(2)} KB`;return`${(X/1048576).toFixed(2)} MB`}function I(X){let Z=X.match(/^([\d.]+)\s*(B|KB|MB|GB)?$/i);if(!Z)return 0;let Q=Number.parseFloat(Z[1]);switch((Z[2]||"B").toUpperCase()){case"KB":return Q*1024;case"MB":return Q*1024*1024;case"GB":return Q*1024*1024*1024;default:return Q}}function E(X,Z){if(Z===0)return"0%";return`${(X/Z*100).toFixed(1)}%`}function R(X,Z){switch(Z.format){case"json":return u(X,Z);case"markdown":return l(X,Z);case"text":default:return r(X,Z)}}function u(X,Z){let Q=N(X,Z);return JSON.stringify({timestamp:X.timestamp,buildDir:X.buildDir,summary:{totalSize:X.totalSize,totalSizeFormatted:W(X.totalSize),totalGzipSize:X.totalGzipSize,totalGzipSizeFormatted:W(X.totalGzipSize),moduleCount:X.moduleCount,chunkCount:X.chunks.length,duplicateCount:X.duplicates.length},byType:Object.fromEntries(Object.entries(X.byType).map(([$,U])=>[$,{...U,sizeFormatted:W(U.size),gzipSizeFormatted:W(U.gzipSize)}])),chunks:X.chunks.map(($)=>({name:$.name,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),moduleCount:$.modules.length,isEntry:$.isEntry,isVendor:$.isVendor})),largestModules:X.largestModules.slice(0,Z.topModules||10).map(($)=>({path:$.path,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),type:$.type})),duplicates:X.duplicates,analysis:Q,warnings:X.warnings},null,2)}function r(X,Z){let Q=[],$=Z.showGzip!==!1;if(Q.push(""),Q.push("Bundle Analysis Report"),Q.push("\u2550".repeat(50)),Q.push(""),Q.push("Summary"),Q.push("\u2500".repeat(50)),$)Q.push(`Total Size: ${W(X.totalSize)} (${W(X.totalGzipSize)} gzip)`);else Q.push(`Total Size: ${W(X.totalSize)}`);if(Q.push(`Modules: ${X.moduleCount}`),Q.push(`Chunks: ${X.chunks.length}`),X.duplicates.length>0)Q.push(`Duplicates: ${X.duplicates.length}`);if(Q.push(""),Z.threshold&&X.totalSize>Z.threshold)Q.push(`\u26A0\uFE0F Bundle exceeds threshold of ${W(Z.threshold)}!`),Q.push("");Q.push("Size by Type"),Q.push("\u2500".repeat(50));let U=["js","css","html","image","font","other"];for(let j of U){let q=X.byType[j];if(q.count>0){let J=E(q.size,X.totalSize),F=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${j.padEnd(8)} ${W(q.size).padStart(12)}${F} ${J.padStart(6)} (${q.count} files)`)}}Q.push(""),Q.push("Chunks"),Q.push("\u2500".repeat(50));for(let j of X.chunks.slice(0,10)){let q=[];if(j.isEntry)q.push("entry");if(j.isVendor)q.push("vendor");let J=q.length>0?` [${q.join(", ")}]`:"",F=$?` (${W(j.gzipSize)} gzip)`:"";Q.push(` ${j.name.padEnd(20)} ${W(j.size).padStart(12)}${F}${J}`)}if(X.chunks.length>10)Q.push(` ... and ${X.chunks.length-10} more chunks`);Q.push("");let K=Z.topModules||10;Q.push(`Largest Modules (Top ${K})`),Q.push("\u2500".repeat(50));for(let j=0;j<Math.min(K,X.largestModules.length);j++){let q=X.largestModules[j],J=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${(j+1).toString().padStart(2)}. ${q.path}`),Q.push(` ${W(q.size)}${J}`)}if(Q.push(""),X.duplicates.length>0){Q.push("Duplicate Modules"),Q.push("\u2500".repeat(50));for(let j of X.duplicates.slice(0,5))Q.push(` ${j.path}`),Q.push(` ${j.count} copies, wasting ${W(j.wastedBytes)}`);if(X.duplicates.length>5)Q.push(` ... and ${X.duplicates.length-5} more duplicates`);Q.push("")}if(Z.recommendations!==!1){let j=N(X,Z);if(j.recommendations.length>0){Q.push("Recommendations"),Q.push("\u2500".repeat(50));for(let q of j.recommendations.slice(0,5)){let J=q.impact==="high"?"\u26A1":q.impact==="medium"?"\uD83D\uDCCA":"\uD83D\uDCA1";Q.push(` ${J} ${q.title}`),Q.push(` ${q.description}`)}Q.push("")}}if(X.warnings.length>0){Q.push("Warnings"),Q.push("\u2500".repeat(50));for(let j of X.warnings)Q.push(` \u26A0\uFE0F ${j}`);Q.push("")}return Q.join(`
2
+ import"./chunk-p5d8sb50.js";import v from"fs";import H from"path";import{gzipSync as z}from"zlib";import{createHash as g}from"crypto";var D={".js":"js",".mjs":"js",".cjs":"js",".ts":"js",".jsx":"js",".tsx":"js",".css":"css",".scss":"css",".sass":"css",".less":"css",".html":"html",".htm":"html",".png":"image",".jpg":"image",".jpeg":"image",".gif":"image",".svg":"image",".webp":"image",".avif":"image",".ico":"image",".woff":"font",".woff2":"font",".ttf":"font",".eot":"font",".otf":"font"},b=[/node_modules/,/vendor/,/bower_components/,/\.min\./],B=[/index\.(js|ts|html)$/,/main\.(js|ts)$/,/app\.(js|ts)$/,/entry\.(js|ts)$/];async function L(X,Z={}){let{includeSourceMaps:Q=!1,parseImports:$=!0,detectDuplicates:U=!0,topModulesCount:K=20}=Z;if(!v.existsSync(X))throw Error(`Build directory not found: ${X}`);if(!v.statSync(X).isDirectory())throw Error(`Not a directory: ${X}`);let q=await k(X,Q),J=[],F=[];for(let A of q)try{let O=await f(A,X,$);J.push(O)}catch(O){F.push(`Failed to process ${A}: ${O}`)}let Y=c(J,X),V=J.reduce((A,O)=>A+O.size,0),_=J.reduce((A,O)=>A+O.gzipSize,0),w=m(J),G=U?p(J):[],C=[...J].sort((A,O)=>O.size-A.size).slice(0,K);return{timestamp:Date.now(),buildDir:H.resolve(X),chunks:Y,totalSize:V,totalGzipSize:_,moduleCount:J.length,duplicates:G,byType:w,largestModules:C,warnings:F}}async function k(X,Z){let Q=[];async function $(U){let K=await v.promises.readdir(U,{withFileTypes:!0});for(let j of K){let q=H.join(U,j.name);if(j.isDirectory()){if(!j.name.startsWith(".")&&j.name!=="node_modules")await $(q)}else if(j.isFile()){if(!Z&&j.name.endsWith(".map"))continue;Q.push(q)}}}return await $(X),Q}async function f(X,Z,Q){let $=await v.promises.readFile(X),U=H.relative(Z,X),K=H.extname(X).toLowerCase(),j=$.length,q=y($),J=h($,K),F=g("md5").update($).digest("hex").slice(0,8),Y=D[K]||"other",V=[];if(Q&&Y==="js")V.push(...d($.toString("utf-8")));return{id:U,path:U,size:j,gzipSize:q,parsedSize:J,extension:K,type:Y,imports:V,importedBy:[],hash:F}}function y(X){try{let Z=z(X,{level:9}).length;return Math.min(Z,X.length)}catch{return X.length}}function h(X,Z){if(Z.includes(".min.")||X.length<1000)return X.length;let $=D[Z];if($==="js")return Math.round(X.length*0.6);if($==="css")return Math.round(X.length*0.7);return X.length}function d(X){let Z=[],Q=/import\s+(?:[\w*{}\s,]+\s+from\s+)?['"]([^'"]+)['"]/g,$;while(($=Q.exec(X))!==null)Z.push($[1]);let U=/import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=U.exec(X))!==null)Z.push($[1]);let K=/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=K.exec(X))!==null)Z.push($[1]);return[...new Set(Z)]}function c(X,Z){let Q=new Map;for(let U of X){let K=U.path.split(H.sep),j;if(K.length===1)j=H.basename(U.path,U.extension);else j=K[0];let q=Q.get(j)||[];q.push(U),Q.set(j,q)}let $=[];for(let[U,K]of Q){let j=K.reduce((Y,V)=>Y+V.size,0),q=K.reduce((Y,V)=>Y+V.gzipSize,0),J=K.some((Y)=>B.some((V)=>V.test(Y.path))),F=K.some((Y)=>b.some((V)=>V.test(Y.path)));$.push({name:U,files:K.map((Y)=>Y.path),modules:K,size:j,gzipSize:q,isEntry:J,isVendor:F})}return $.sort((U,K)=>K.size-U.size)}function m(X){let Z={js:{count:0,size:0,gzipSize:0},css:{count:0,size:0,gzipSize:0},html:{count:0,size:0,gzipSize:0},image:{count:0,size:0,gzipSize:0},font:{count:0,size:0,gzipSize:0},other:{count:0,size:0,gzipSize:0}};for(let Q of X)Z[Q.type].count++,Z[Q.type].size+=Q.size,Z[Q.type].gzipSize+=Q.gzipSize;return Z}function p(X){let Z=new Map;for(let $ of X){let U=Z.get($.hash)||[];U.push($),Z.set($.hash,U)}let Q=[];for(let[,$]of Z)if($.length>1){let U=$[0];Q.push({path:U.path,count:$.length,wastedBytes:U.size*($.length-1),locations:$.map((K)=>K.path)})}return Q.sort(($,U)=>U.wastedBytes-$.wastedBytes)}function W(X){if(X<1024)return`${X} B`;if(X<1048576)return`${(X/1024).toFixed(2)} KB`;return`${(X/1048576).toFixed(2)} MB`}function I(X){let Z=X.match(/^([\d.]+)\s*(B|KB|MB|GB)?$/i);if(!Z)return 0;let Q=Number.parseFloat(Z[1]);switch((Z[2]||"B").toUpperCase()){case"KB":return Q*1024;case"MB":return Q*1024*1024;case"GB":return Q*1024*1024*1024;default:return Q}}function E(X,Z){if(Z===0)return"0%";return`${(X/Z*100).toFixed(1)}%`}function R(X,Z){switch(Z.format){case"json":return u(X,Z);case"markdown":return l(X,Z);case"text":default:return r(X,Z)}}function u(X,Z){let Q=N(X,Z);return JSON.stringify({timestamp:X.timestamp,buildDir:X.buildDir,summary:{totalSize:X.totalSize,totalSizeFormatted:W(X.totalSize),totalGzipSize:X.totalGzipSize,totalGzipSizeFormatted:W(X.totalGzipSize),moduleCount:X.moduleCount,chunkCount:X.chunks.length,duplicateCount:X.duplicates.length},byType:Object.fromEntries(Object.entries(X.byType).map(([$,U])=>[$,{...U,sizeFormatted:W(U.size),gzipSizeFormatted:W(U.gzipSize)}])),chunks:X.chunks.map(($)=>({name:$.name,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),moduleCount:$.modules.length,isEntry:$.isEntry,isVendor:$.isVendor})),largestModules:X.largestModules.slice(0,Z.topModules||10).map(($)=>({path:$.path,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),type:$.type})),duplicates:X.duplicates,analysis:Q,warnings:X.warnings},null,2)}function r(X,Z){let Q=[],$=Z.showGzip!==!1;if(Q.push(""),Q.push("Bundle Analysis Report"),Q.push("\u2550".repeat(50)),Q.push(""),Q.push("Summary"),Q.push("\u2500".repeat(50)),$)Q.push(`Total Size: ${W(X.totalSize)} (${W(X.totalGzipSize)} gzip)`);else Q.push(`Total Size: ${W(X.totalSize)}`);if(Q.push(`Modules: ${X.moduleCount}`),Q.push(`Chunks: ${X.chunks.length}`),X.duplicates.length>0)Q.push(`Duplicates: ${X.duplicates.length}`);if(Q.push(""),Z.threshold&&X.totalSize>Z.threshold)Q.push(`\u26A0\uFE0F Bundle exceeds threshold of ${W(Z.threshold)}!`),Q.push("");Q.push("Size by Type"),Q.push("\u2500".repeat(50));let U=["js","css","html","image","font","other"];for(let j of U){let q=X.byType[j];if(q.count>0){let J=E(q.size,X.totalSize),F=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${j.padEnd(8)} ${W(q.size).padStart(12)}${F} ${J.padStart(6)} (${q.count} files)`)}}Q.push(""),Q.push("Chunks"),Q.push("\u2500".repeat(50));for(let j of X.chunks.slice(0,10)){let q=[];if(j.isEntry)q.push("entry");if(j.isVendor)q.push("vendor");let J=q.length>0?` [${q.join(", ")}]`:"",F=$?` (${W(j.gzipSize)} gzip)`:"";Q.push(` ${j.name.padEnd(20)} ${W(j.size).padStart(12)}${F}${J}`)}if(X.chunks.length>10)Q.push(` ... and ${X.chunks.length-10} more chunks`);Q.push("");let K=Z.topModules||10;Q.push(`Largest Modules (Top ${K})`),Q.push("\u2500".repeat(50));for(let j=0;j<Math.min(K,X.largestModules.length);j++){let q=X.largestModules[j],J=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${(j+1).toString().padStart(2)}. ${q.path}`),Q.push(` ${W(q.size)}${J}`)}if(Q.push(""),X.duplicates.length>0){Q.push("Duplicate Modules"),Q.push("\u2500".repeat(50));for(let j of X.duplicates.slice(0,5))Q.push(` ${j.path}`),Q.push(` ${j.count} copies, wasting ${W(j.wastedBytes)}`);if(X.duplicates.length>5)Q.push(` ... and ${X.duplicates.length-5} more duplicates`);Q.push("")}if(Z.recommendations!==!1){let j=N(X,Z);if(j.recommendations.length>0){Q.push("Recommendations"),Q.push("\u2500".repeat(50));for(let q of j.recommendations.slice(0,5)){let J=q.impact==="high"?"\u26A1":q.impact==="medium"?"\uD83D\uDCCA":"\uD83D\uDCA1";Q.push(` ${J} ${q.title}`),Q.push(` ${q.description}`)}Q.push("")}}if(X.warnings.length>0){Q.push("Warnings"),Q.push("\u2500".repeat(50));for(let j of X.warnings)Q.push(` \u26A0\uFE0F ${j}`);Q.push("")}return Q.join(`
3
3
  `)}function l(X,Z){let Q=[],$=Z.showGzip!==!1;if(Q.push("# Bundle Analysis Report"),Q.push(""),Q.push(`Generated: ${new Date(X.timestamp).toISOString()}`),Q.push(""),Q.push("## Summary"),Q.push(""),Q.push("| Metric | Value |"),Q.push("|--------|-------|"),Q.push(`| Total Size | ${W(X.totalSize)} |`),$)Q.push(`| Gzip Size | ${W(X.totalGzipSize)} |`);Q.push(`| Modules | ${X.moduleCount} |`),Q.push(`| Chunks | ${X.chunks.length} |`),Q.push(`| Duplicates | ${X.duplicates.length} |`),Q.push(""),Q.push("## Size by Type"),Q.push(""),Q.push("| Type | Size | Gzip | % | Files |"),Q.push("|------|------|------|---|-------|");let U=["js","css","html","image","font","other"];for(let j of U){let q=X.byType[j];if(q.count>0)Q.push(`| ${j} | ${W(q.size)} | ${W(q.gzipSize)} | ${E(q.size,X.totalSize)} | ${q.count} |`)}Q.push(""),Q.push("## Chunks"),Q.push(""),Q.push("| Name | Size | Gzip | Modules | Type |"),Q.push("|------|------|------|---------|------|");for(let j of X.chunks.slice(0,15)){let q=j.isEntry?"Entry":j.isVendor?"Vendor":"-";Q.push(`| ${j.name} | ${W(j.size)} | ${W(j.gzipSize)} | ${j.modules.length} | ${q} |`)}Q.push("");let K=Z.topModules||10;Q.push(`## Largest Modules (Top ${K})`),Q.push(""),Q.push("| # | Path | Size | Gzip |"),Q.push("|---|------|------|------|");for(let j=0;j<Math.min(K,X.largestModules.length);j++){let q=X.largestModules[j];Q.push(`| ${j+1} | \`${q.path}\` | ${W(q.size)} | ${W(q.gzipSize)} |`)}if(Q.push(""),X.duplicates.length>0){Q.push("## Duplicates"),Q.push(""),Q.push("| Path | Copies | Wasted |"),Q.push("|------|--------|--------|");for(let j of X.duplicates.slice(0,10))Q.push(`| \`${j.path}\` | ${j.count} | ${W(j.wastedBytes)} |`);Q.push("")}if(Z.recommendations!==!1){let j=N(X,Z);if(j.recommendations.length>0){Q.push("## Recommendations"),Q.push("");for(let q of j.recommendations)Q.push(`### ${q.title}`),Q.push(""),Q.push(q.description),Q.push(""),Q.push(`- **Impact:** ${q.impact}`),Q.push(`- **Effort:** ${q.effort}`),Q.push("")}}return Q.join(`
4
4
  `)}function N(X,Z){let Q=[],$=[];if(Z.threshold&&X.totalSize>Z.threshold)Q.push({severity:"error",message:`Bundle size (${W(X.totalSize)}) exceeds threshold (${W(Z.threshold)})`});if(X.totalSize>1048576)Q.push({severity:"warning",message:`Bundle is over 1MB (${W(X.totalSize)})`,details:"Large bundles can significantly impact load time"});if(X.duplicates.length>0){let q=X.duplicates.reduce((J,F)=>J+F.wastedBytes,0);Q.push({severity:"warning",message:`${X.duplicates.length} duplicate modules found, wasting ${W(q)}`}),$.push({title:"Remove Duplicate Modules",description:"Consider using import aliases or ensuring consistent package versions to eliminate duplicates.",impact:"medium",effort:"low"})}if(X.byType.js.size/X.totalSize>0.8&&X.totalSize>512000)$.push({title:"Code Splitting",description:"Over 80% of your bundle is JavaScript. Consider splitting code by route or feature.",impact:"high",effort:"medium"});let K=X.largestModules.filter((q)=>q.size>102400);if(K.length>0){Q.push({severity:"info",message:`${K.length} modules are over 100KB`});for(let q of K){if(q.path.includes("lodash")&&!q.path.includes("lodash-es"))$.push({title:"Use lodash-es instead of lodash",description:"lodash-es supports tree-shaking and can significantly reduce bundle size.",impact:"high",effort:"low"});if(q.path.includes("moment"))$.push({title:"Replace moment.js",description:"Consider using date-fns or dayjs for smaller date handling libraries.",impact:"high",effort:"medium"})}}if(X.byType.image.size>512000)$.push({title:"Optimize Images",description:`Images account for ${W(X.byType.image.size)}. Consider using WebP/AVIF formats and responsive images.`,impact:"high",effort:"low"});let j=100;if(X.totalSize>1048576)j-=20;else if(X.totalSize>512000)j-=10;if(j-=Math.min(20,X.duplicates.length*2),j-=Math.min(15,K.length*3),Z.threshold&&X.totalSize>Z.threshold)j-=25;return{score:Math.max(0,j),issues:Q,recommendations:$}}var i={lodash:{alternative:"lodash-es or individual imports",savings:"~70%"},moment:{alternative:"date-fns or dayjs",savings:"~90%"},"chart.js":{alternative:"chart.js with tree-shaking",savings:"~50%"},"highlight.js":{alternative:"Selective language imports",savings:"~80%"},fontawesome:{alternative:"Individual icon imports",savings:"~90%"},"material-ui":{alternative:"Named imports from @mui/*",savings:"~60%"}};function n(X){for(let[Z,Q]of Object.entries(i))if(X.includes(Z))return{title:`Optimize ${Z}`,description:`Consider using ${Q.alternative}. Potential savings: ${Q.savings}`,impact:"high",effort:"low"};return null}var o={default:{js:"#f7df1e",css:"#264de4",html:"#e34c26",image:"#4caf50",font:"#9c27b0",other:"#607d8b",vendor:"#ff5722"},pastel:{js:"#fff3b0",css:"#b0d4ff",html:"#ffb0b0",image:"#b0ffb0",font:"#e0b0ff",other:"#d0d0d0",vendor:"#ffcfb0"},monochrome:{js:"#333333",css:"#555555",html:"#777777",image:"#999999",font:"#bbbbbb",other:"#dddddd",vendor:"#444444"}};function x(X,Z={}){let{title:Q="Bundle Analysis",gzip:$=!0,colorScheme:U="default"}=Z,K=o[U],j=a(X),q=JSON.stringify(j);return`<!DOCTYPE html>
5
5
  <html lang="en">
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ro as a,So as b,To as c}from"./chunk-j82hfkcf.js";import"./chunk-rh7mwwb4.js";import"./chunk-1t3j8a0q.js";import"./chunk-01ggk8k8.js";import"./chunk-25b8z7xa.js";import"./chunk-hk8j3eps.js";import"./chunk-xe93ae3r.js";import"./chunk-1spzqjve.js";import"./chunk-f2qbjr3z.js";import"./chunk-1xwfws06.js";import"./chunk-r1rfwm01.js";import"./chunk-ahpmjg3f.js";import"./chunk-bt8w146r.js";import"./chunk-6p6b01kp.js";import"./chunk-x7dv5rq7.js";import"./chunk-e0kzyf1g.js";import"./chunk-wv8h3d68.js";import"./chunk-beextc84.js";import"./chunk-yr7camcd.js";import"./chunk-p5d8sb50.js";export{b as reportDeferredLoopWarnings,c as processLoops,a as parseLoopBinding};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Jt as a,Kt as b,Lt as c,Mt as d,Nt as e,Ot as f,Pt as g,Qt as h,Rt as i,St as j,Tt as k,Ut as l}from"./chunk-aved735s.js";import"./chunk-799s9mwc.js";import"./chunk-7r80apc5.js";import"./chunk-5g6rprcy.js";export{f as structuredDataDirective,j as scanForSitemapEntries,g as registerSeoDirectives,b as processStructuredData,c as processSeoDirective,a as processMetaDirectives,e as metaDirective,d as injectSeoTags,i as generateSitemapIndex,h as generateSitemap,k as generateRobotsTxt,l as generateDefaultRobotsTxt};
2
+ import{Nt as a,Ot as b,Pt as c,Qt as d,Rt as e,St as f,Tt as g,Ut as h,Vt as i,Wt as j,Xt as k,Yt as l}from"./chunk-ahpmjg3f.js";import"./chunk-bt8w146r.js";import"./chunk-6p6b01kp.js";import"./chunk-p5d8sb50.js";export{f as structuredDataDirective,j as scanForSitemapEntries,g as registerSeoDirectives,b as processStructuredData,c as processSeoDirective,a as processMetaDirectives,e as metaDirective,d as injectSeoTags,i as generateSitemapIndex,h as generateSitemap,k as generateRobotsTxt,l as generateDefaultRobotsTxt};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ls as a,ms as b}from"./chunk-1t3j8a0q.js";import"./chunk-p5d8sb50.js";export{b as resolveStxTargets,a as looksLikeGlob};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$l as c,cm as d,dm as e,em as f,fm as g,gm as h,hm as i,im as j,jm as k,km as l,lm as m,mm as n}from"./chunk-j82hfkcf.js";import"./chunk-rh7mwwb4.js";import"./chunk-1t3j8a0q.js";import{ns as a,os as b}from"./chunk-01ggk8k8.js";import"./chunk-25b8z7xa.js";import"./chunk-hk8j3eps.js";import"./chunk-xe93ae3r.js";import"./chunk-1spzqjve.js";import"./chunk-f2qbjr3z.js";import"./chunk-1xwfws06.js";import"./chunk-r1rfwm01.js";import"./chunk-ahpmjg3f.js";import"./chunk-bt8w146r.js";import"./chunk-6p6b01kp.js";import"./chunk-x7dv5rq7.js";import"./chunk-e0kzyf1g.js";import"./chunk-wv8h3d68.js";import"./chunk-beextc84.js";import"./chunk-yr7camcd.js";import"./chunk-p5d8sb50.js";export{h as transformAutoImports,b as stripCommentsAndLiterals,e as renderVendorStyleTags,i as referencesName,n as processClientScript,g as injectBrowserCoreAutoImports,m as generateServerDataBridge,k as generateBrowserAutoImportDestructuring,j as generateAutoImportDestructuring,a as findInterpolationEnd,l as extractBridgeData,d as extractAndStripCssImports,f as STX_AUTO_IMPORTS,c as BROWSER_CORE_IMPORTS};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Mi as a,Ni as b,Oi as c,Pi as d,Qi as e,Ri as f,Si as g,Ti as h,Ui as i,Vi as j,Wi as k,Xi as l,Yi as m,Zi as n}from"./chunk-ytx17bg2.js";import"./chunk-j82hfkcf.js";import"./chunk-rh7mwwb4.js";import"./chunk-1t3j8a0q.js";import"./chunk-01ggk8k8.js";import"./chunk-25b8z7xa.js";import"./chunk-hk8j3eps.js";import"./chunk-xe93ae3r.js";import"./chunk-1spzqjve.js";import"./chunk-f2qbjr3z.js";import"./chunk-1xwfws06.js";import"./chunk-r1rfwm01.js";import"./chunk-ahpmjg3f.js";import"./chunk-bt8w146r.js";import"./chunk-6p6b01kp.js";import"./chunk-x7dv5rq7.js";import"./chunk-e0kzyf1g.js";import"./chunk-wv8h3d68.js";import"./chunk-beextc84.js";import"./chunk-yr7camcd.js";import"./chunk-p5d8sb50.js";export{i as streamingSuspenseDirective,m as streamToResponse,g as streamTemplateSimple,a as streamTemplate,d as renderStreamingPage,k as registerStreamingDirectives,e as processStreamDirectives,l as processSectionDirectives,j as islandDirective,n as generateHydrationRuntime,f as extractStreamBoundaries,h as createStreamRenderer,b as buildSuspenseResolveScript,c as SUSPENSE_RESOLVER_RUNTIME};
@@ -0,0 +1,3 @@
1
+ // @bun
2
+ import y from"fs";import V from"path";var B=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,X=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,D=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],g=3;function H(j,q){let J=V.resolve(V.dirname(q),j);for(let Q of D){let z=J+Q;try{if(y.statSync(z).isFile())return z}catch{}}return null}function K(j,q,J=0,Q=new Set){if(!q||J>=g)return!1;for(let z of j.matchAll(X)){let Z=H(z[1],q);if(!Z||Q.has(Z))continue;Q.add(Z);let $;try{$=y.readFileSync(Z,"utf8")}catch{continue}if(B.test($))return!0;if(K($,Z,J+1,Q))return!0}return!1}var Y=["batch","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refresh","registerStoresClient","setRouteParams","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useTimeout","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],R=["onMount","onDestroy"];function A(j="const",q=[],J){let Q=q.length?Y.filter((z)=>!q.includes(z)):Y;if(J!==void 0)Q=Q.filter((z)=>{let Z=z.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${Z}(?![\\w$])`).test(J)});return`${j} { ${Q.join(", ")} } = window.stx;`}var k=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"],E={useServerData:{category:"server-only",reason:"loads and serializes request-scoped data from <script server>; clients consume it through a keyed useFetch/useAsyncData."},redirect:{category:"server-only",reason:"returns an HTTP Response for <script server>/edge/build; use navigate() on the client."},useAsyncData:{category:"browser-composable",reason:"inlined on demand from src/composables when a script references it; reachable, not a bare global."},Teleport:{category:"compile-time-directive",reason:"template tag resolved by processTeleportDirectives; not a script callable."},StxModalBuiltin:{category:"builtin-component",reason:"builtin component used as a template tag; drive open/close from the modal store."},StxToastBuiltin:{category:"builtin-component",reason:"builtin component used as a template tag; push toasts via the toast store."},useForm:{category:"browser-composable",reason:"reactive form primitive; lives in src/composables/use-form.ts and is inlined on demand when a <script client> references it (#1846)."},defineForm:{category:"browser-composable",reason:"deprecated alias of useForm, kept for a minor (#1843). Same delivery path \u2014 inlined on demand from src/composables/use-form.ts."},validateFields:{category:"isomorphic-import",reason:"pure validation helper; import it directly, not auto-delivered to <script client> (per client-api-delivery.test.ts)."},validateField:{category:"isomorphic-import",reason:"singular pure validation helper; same explicit-import boundary as validateFields."}},x=Y.filter((j)=>!k.includes(j));function O(j){if(!j)return!1;return x.some((q)=>new RegExp(`\\b${q}\\s*(?:<[^>]*>)?\\s*\\(`).test(j))}var M=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],C=/\s@[a-z][\w.:-]*\s*=/i;function T(j,q){if(!j)return!1;let J=U(j);return F(J,q)}function F(j,q){if(M.some((J)=>J.test(j)))return!0;if(O(j))return!0;return P(j,q)}function P(j,q){if(!q)return!1;for(let J of j.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(K(J[1],q))return!0;return!1}function d(j,q){if(!j)return!1;let J=U(j);return C.test(J)||F(J,q)}var u=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function _(j){return u.includes(j.toLowerCase())}var G=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],b=["x-init","x-transition","x-effect","x-on"],p=[...G,...b];function c(){return`{${G.map((j)=>`'${j}':1`).join(",")}}`}var v=65536,S=4,w=new Map;function r(){w.clear()}function U(j){if(!j)return j;if(!j.includes("<!--")&&!/<(?:pre|code)\b/i.test(j))return j;let q=j.length>=v;if(q){let z=w.get(j);if(z!==void 0)return z}let J=(z)=>z.replace(/(<[^>]*>)|([^<]+)/g,(Z,$,W)=>$??" ".repeat(W.length)),Q=j.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(z,Z,$,W)=>Z+J($)+W).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(z,Z,$,W)=>Z+J($)+W).replace(/<!--[\s\S]*?-->/g,(z)=>" ".repeat(z.length));if(q){while(w.size>=S){let z=w.keys().next();if(z.done)break;w.delete(z.value)}w.set(j,Q)}return Q}
3
+ export{K as jv,Y as kv,R as lv,A as mv,k as nv,E as ov,x as pv,O as qv,T as rv,d as sv,u as tv,_ as uv,G as vv,b as wv,p as xv,c as yv,r as zv,U as Av};
@@ -5,4 +5,4 @@ import Q from"fs";import U from"path";function W(H){let v=[],j=H.pwa;if(v.push({
5
5
  `);let J=["required","recommended","optional"];for(let L of J){let N=H.checks.filter((K)=>K.category===L);if(N.length===0)continue;v.push(`
6
6
  ${L.toUpperCase()}:`);for(let K of N){let T=K.passed?"\x1B[32m\u2713\x1B[0m":"\x1B[31m\u2717\x1B[0m";if(v.push(` ${T} ${K.name}: ${K.message}`),K.details)v.push(` ${K.details}`)}}return v.push(""),v.join(`
7
7
  `)}
8
- export{W as Dk,X as Ek,Y as Fk,A as Gk,B as Hk};
8
+ export{W as Fk,X as Gk,Y as Hk,A as Ik,B as Jk};
@@ -2,4 +2,4 @@
2
2
  function A(h){let q=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;h=h.replace(q,(w,j)=>{return`const { ${j.split(",").map((k)=>k.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
3
3
  `});let v=/import\s*\{([^}]+)\}\s*from\s*['"]@composables['"]\s*;?\n?/g;return h=h.replace(v,(w,j)=>{return`const { ${j.split(",").map((k)=>k.trim()).filter(Boolean).join(", ")} } = window.__composables
4
4
  `}),h}function B(h){return h.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}
5
- export{A as bv,B as cv};
5
+ export{A as fv,B as gv};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{mt as uJ}from"./chunk-vaggjvsm.js";import{tw as gJ}from"./chunk-5g6rprcy.js";import z from"path";import{hasLocalConfig as yJ}from"bunfig";var wJ={fg:{light:"gray-900",dark:"gray-100",description:"Primary text"},"fg-strong":{light:"gray-700",dark:"gray-300",description:"Labels, secondary headings"},"fg-muted":{light:"gray-600",dark:"gray-400",description:"Supporting text"},"fg-soft":{light:"gray-500",dark:"gray-400",description:"De-emphasised text"},"fg-subtle":{light:"gray-400",dark:"gray-500",description:"Placeholders, disabled text"},surface:{light:"gray-50",dark:"gray-800",description:"Page and panel background"},"surface-raised":{light:"gray-100",dark:"gray-700",description:"Cards, popovers"},"surface-sunken":{light:"gray-200",dark:"gray-700",description:"Wells, track backgrounds"},line:{light:"gray-200",dark:"gray-700",description:"Default border, divider"},"line-strong":{light:"gray-300",dark:"gray-600",description:"Input border, focus ring track"},accent:{light:"indigo-600",dark:"indigo-400",description:"Primary action, selected state"},info:{light:"blue-600",dark:"blue-400",description:"Informational emphasis, links"},danger:{light:"red-600",dark:"red-400",description:"Errors, destructive actions"},success:{light:"green-600",dark:"green-400",description:"Confirmation"},warning:{light:"yellow-500",dark:"yellow-400",description:"Caution"},"accent-solid":{light:"indigo-600",dark:"indigo-500",description:"Primary button fill"},"info-solid":{light:"blue-600",dark:"blue-500",description:"Informational fill"},"danger-solid":{light:"red-600",dark:"red-500",description:"Destructive button fill"},"success-solid":{light:"green-600",dark:"green-500",description:"Confirmation fill"}};function p(J){return`--stx-${J}`}function m(J,Q){let Z=Q.lastIndexOf("-");if(Z===-1)return typeof J[Q]==="string"?J[Q]:void 0;let $=J[Q.slice(0,Z)];if(!$||typeof $!=="object")return;let U=$[Q.slice(Z+1)];return typeof U==="string"?U:void 0}function BJ(J){let Q={};for(let[Z,$]of Object.entries(wJ)){let U=m(J,$.light);if(U===void 0)continue;Q[Z]=`var(${p(Z)}, ${U})`}return Q}function HJ(J){let Q=[],Z=[];for(let[$,U]of Object.entries(wJ)){let F=m(J,U.light),W=m(J,U.dark);if(F===void 0)continue;if(Q.push(` ${p($)}: ${F};`),W!==void 0)Z.push(` ${p($)}: ${W};`)}if(Q.length===0)return"";return["/* stx role tokens \u2014 override any of these to re-theme by meaning. */",":root {",...Q,"}",".dark {",...Z,"}",""].join(`
2
+ import{qt as uJ}from"./chunk-1spzqjve.js";import{xw as gJ}from"./chunk-p5d8sb50.js";import z from"path";import{hasLocalConfig as yJ}from"bunfig";var wJ={fg:{light:"gray-900",dark:"gray-100",description:"Primary text"},"fg-strong":{light:"gray-700",dark:"gray-300",description:"Labels, secondary headings"},"fg-muted":{light:"gray-600",dark:"gray-400",description:"Supporting text"},"fg-soft":{light:"gray-500",dark:"gray-400",description:"De-emphasised text"},"fg-subtle":{light:"gray-400",dark:"gray-500",description:"Placeholders, disabled text"},surface:{light:"gray-50",dark:"gray-800",description:"Page and panel background"},"surface-raised":{light:"gray-100",dark:"gray-700",description:"Cards, popovers"},"surface-sunken":{light:"gray-200",dark:"gray-700",description:"Wells, track backgrounds"},line:{light:"gray-200",dark:"gray-700",description:"Default border, divider"},"line-strong":{light:"gray-300",dark:"gray-600",description:"Input border, focus ring track"},accent:{light:"indigo-600",dark:"indigo-400",description:"Primary action, selected state"},info:{light:"blue-600",dark:"blue-400",description:"Informational emphasis, links"},danger:{light:"red-600",dark:"red-400",description:"Errors, destructive actions"},success:{light:"green-600",dark:"green-400",description:"Confirmation"},warning:{light:"yellow-500",dark:"yellow-400",description:"Caution"},"accent-solid":{light:"indigo-600",dark:"indigo-500",description:"Primary button fill"},"info-solid":{light:"blue-600",dark:"blue-500",description:"Informational fill"},"danger-solid":{light:"red-600",dark:"red-500",description:"Destructive button fill"},"success-solid":{light:"green-600",dark:"green-500",description:"Confirmation fill"}};function p(J){return`--stx-${J}`}function m(J,Q){let Z=Q.lastIndexOf("-");if(Z===-1)return typeof J[Q]==="string"?J[Q]:void 0;let $=J[Q.slice(0,Z)];if(!$||typeof $!=="object")return;let U=$[Q.slice(Z+1)];return typeof U==="string"?U:void 0}function BJ(J){let Q={};for(let[Z,$]of Object.entries(wJ)){let U=m(J,$.light);if(U===void 0)continue;Q[Z]=`var(${p(Z)}, ${U})`}return Q}function HJ(J){let Q=[],Z=[];for(let[$,U]of Object.entries(wJ)){let F=m(J,U.light),W=m(J,U.dark);if(F===void 0)continue;if(Q.push(` ${p($)}: ${F};`),W!==void 0)Z.push(` ${p($)}: ${W};`)}if(Q.length===0)return"";return["/* stx role tokens \u2014 override any of these to re-theme by meaning. */",":root {",...Q,"}",".dark {",...Z,"}",""].join(`
3
3
  `)}function OJ(J){return typeof J==="object"&&J!==null&&!Array.isArray(J)}function h(J,Q){let Z={...J};for(let[$,U]of Object.entries(Q))Z[$]=OJ(U)&&OJ(Z[$])?h(Z[$],U):U;return Z}function LJ(J={},Q={}){let Z=J.theme||{},$=Q.theme||{},{extend:U,...F}=$,{extend:W,...j}=Z,V=j.colors||{};j.colors={...V,...BJ(V)};let X=h(j,F),q=h(W||{},U||{});if(Object.keys(q).length>0)X.extend=q;let G=[...J.safelist||[],...Q.safelist||[]],w={...J.shortcuts||{},...Q.shortcuts||{}},K=[...J.preflights||[],...Q.preflights||[]];return{config:{...J,...Q,theme:X,safelist:G,shortcuts:w,...K.length>0?{preflights:K}:{},content:[],output:""},safelist:G,shortcuts:w,includePreflight:Q.preflight!==!1,minify:Q.minify===!0,tokenCSS:HJ(V)}}var x=/<script\b[^>]*>/iy,c=/<\/script\s*>/ig,S=/<style\b[^>]*>/iy,o=/<\/style\s*>/ig;function KJ(J,Q,Z,$){Z.lastIndex=Q;let U=Z.exec(J);if(!U||U.index!==Q)return-1;$.lastIndex=Z.lastIndex;let F=$.exec(J);if(!F)return-1;return F.index+F[0].length}function l(J,Q){return KJ(J,Q,x,c)}function IJ(J,Q){return KJ(J,Q,S,o)}function iJ(J,Q){if(!J.startsWith("<!--",Q))return-1;let Z=J.indexOf("-->",Q+4);if(Z===-1)return-1;return Z+3}function DJ(J,Q){if(J.startsWith("<!--",Q)){let U=iJ(J,Q);return U===-1?J.length:U}if(x.lastIndex=Q,x.exec(J)?.index===Q){c.lastIndex=x.lastIndex;let U=c.exec(J);return U?U.index+U[0].length:J.length}if(S.lastIndex=Q,S.exec(J)?.index===Q){o.lastIndex=S.lastIndex;let U=o.exec(J);return U?U.index+U[0].length:J.length}return-1}function rJ(J,Q){let Z=[],$=0,U=J.length,F=!1,W=null;while($<U){let j=J[$];if(F){if(W){if(j===W)W=null}else if(j==='"'||j==="'")W=j;else if(j===">")F=!1;$++;continue}if(j!=="<"){let G=J.indexOf("<",$+1);if(G===-1)break;$=G;continue}let V=Q(J,$);if(V>$){Z.push({start:$,end:V,token:J.slice($,V)}),$=V;continue}let X=DJ(J,$);if(X>$){$=X;continue}let q=J.charCodeAt($+1);if(q>=65&&q<=90||q>=97&&q<=122)F=!0;$++}return Z}function vQ(J){let Q=0,Z=0,$=0,U=!1,F=null;while($<J.length){if(U){let G=J[$];if(F){if(G===F)F=null}else if(G==='"'||G==="'")F=G;else if(G===">")U=!1;$++;continue}let W=J.indexOf("<",$),j=W===-1?J.length:W;while($<j){let G=J[$++];if(G==="{")Q++;else if(G==="}")Z++;if(Q>=2&&Z>=2)return!0}if(W===-1)break;let V=DJ(J,W);if(V>W){$=V;continue}let X=J.charCodeAt(W+1),q=X===47?J.charCodeAt(W+2):X;if(q>=65&&q<=90||q>=97&&q<=122)U=!0;$=W+1}return!1}function NJ(J,Q){while(J.size>=Q){let Z=J.keys().next();if(Z.done)return;J.delete(Z.value)}}var nJ=65536,cJ=12,i=new Map;function a(J,Q,Z,$){let U=$!==void 0&&J.length>=nJ,F=U?`${$}\x00${J}`:"";if(U){let q=i.get(F);if(q)return{output:q.output,tokens:q.tokens.slice()}}let W=rJ(J,Q);if(W.length===0)return{output:J,tokens:[]};let j=W.map((q)=>q.token),V="",X=0;for(let q=0;q<W.length;q++){let G=W[q];V+=J.slice(X,G.start),V+=Z(G.token,q),X=G.end}if(V+=J.slice(X),U)return NJ(i,cJ),i.set(F,{output:V,tokens:j}),{output:V,tokens:j.slice()};return{output:V,tokens:j}}var oJ=65536,lJ=4,r=new Map;function n(J,Q,Z){return{output:Q,scripts:Z,restore:($)=>$===Q?J:aJ($,Z)}}function RQ(J){let Q=J.length>=oJ;if(Q){let U=r.get(J);if(U)return n(J,U.output,U.scripts.slice())}let{output:Z,tokens:$}=a(J,l,(U,F)=>`\x00STX_SCRIPT_${F}\x00`);if(Q)return NJ(r,lJ),r.set(J,{output:Z,scripts:$}),n(J,Z,$.slice());return n(J,Z,$)}function aJ(J,Q){if(Q.length===0)return J;return J.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(Z,$)=>Q[+$]??"")}function MJ(J,Q=""){let Z=`${J}${Q}`,$=0;for(let U=0;U<Z.length;U++){let F=Z.charCodeAt(U);$=($<<5)-$+F,$=$&$}return`stx-${Math.abs($).toString(36)}`}function PJ(J,Q,Z={}){let{prefix:$="",preserveHost:U=!0,scopeKeyframes:F=!0,scopeCustomProperties:W=!1}=Z;if(!J.trim())return"";let j=s(J),V=[],X=new Map;if(F)for(let q of j){let G=q.selector.match(/@keyframes\s+([a-z_-][a-z0-9_-]*)/i);if(G){let w=G[1],K=`${Q}_${w}`;X.set(w,K)}}for(let q of j){let G=AJ(q,Q,$,U,X,W);V.push(G)}return V.join(`
4
4
 
5
5
  `)}function s(J){let Q=[],Z=J.replace(/\/\*[\s\S]*?\*\//g,""),$=0,U="",F=!1,W="";for(let j=0;j<Z.length;j++){let V=Z[j];if(V==="@"&&$===0)F=!0;if(V==="{")$++;else if(V==="}"){if($--,$===0){if(F){W+=V;let X=W.match(/@([a-z-]+)\s*([^{]*)\{([\s\S]*)\}/i);if(X){let[,q,G,w]=X;if(q==="keyframes")Q.push({selector:`@keyframes ${G.trim()}`,declarations:w.trim()});else if(q==="media"||q==="supports"||q==="container"){let K=s(w);Q.push({selector:`@${q} ${G.trim()}`,declarations:K.map((M)=>`${M.selector} { ${M.declarations} }`).join(`
@@ -17,7 +17,7 @@ catch (e) {
17
17
  }
18
18
  throw e;
19
19
  }
20
- `),U.set(X,q)}return q(...j)}catch{return}}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:W,context:Q.slice()});return W}clear(){this.pool.length=0,this.fnCache.clear()}}var CQ=new bJ;class kJ{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(J){this.enabled=J}isEnabled(){return this.enabled}setBudget(J,Q){this.budgets.set(J,{warnThreshold:0.8,action:"warn",...Q})}setBudgets(J){for(let[Q,Z]of Object.entries(J))this.setBudget(Q,Z)}removeBudget(J){this.budgets.delete(J)}getBudgets(){let J={};for(let[Q,Z]of this.budgets.entries())J[Q]=Z;return J}onViolation(J){this.violationHandlers.push(J)}offViolation(J){let Q=this.violationHandlers.indexOf(J);if(Q!==-1)this.violationHandlers.splice(Q,1)}time(J,Q){if(!this.enabled)return Q();let Z=performance.now(),$=Q(),U=performance.now()-Z;return this.recordTime(J,U),this.checkBudget(J,U),$}async timeAsync(J,Q){if(!this.enabled)return Q();let Z=performance.now(),$=await Q(),U=performance.now()-Z;return this.recordTime(J,U),this.checkBudget(J,U),$}checkBudget(J,Q){let Z=this.budgets.get(J);if(!Z)return;let $=Q/Z.maxTime*100,U=Z.warnThreshold!==void 0?Q>=Z.maxTime*Z.warnThreshold&&Q<Z.maxTime:!1,F=Q>=Z.maxTime;if(!U&&!F)return;let W={label:J,actualTime:Q,budgetTime:Z.maxTime,exceedancePercent:$,timestamp:new Date,isWarning:U};this.violations.push(W);while(this.violations.length>this.maxViolations)this.violations.shift();for(let V of this.violationHandlers)try{V(W)}catch{}let j=U?`[Performance Warning] "${J}" took ${Q.toFixed(2)}ms (${$.toFixed(1)}% of ${Z.maxTime}ms budget)`:`[Performance Budget Exceeded] "${J}" took ${Q.toFixed(2)}ms (exceeded ${Z.maxTime}ms budget by ${($-100).toFixed(1)}%)`;switch(Z.action){case"log":console.log(j);break;case"warn":console.warn(j);break;case"error":console.error(j);break;case"throw":if(F)throw Error(j);else console.warn(j);break}}recordTime(J,Q){let Z=this.metrics.get(J);if(Z)Z.count++,Z.totalTime+=Q,Z.maxTime=Math.max(Z.maxTime,Q),Z.minTime=Math.min(Z.minTime,Q);else this.metrics.set(J,{count:1,totalTime:Q,maxTime:Q,minTime:Q})}getStats(J){if(J){let Z=this.metrics.get(J);if(!Z)return{};let $=this.budgets.get(J);return{count:Z.count,avgTime:Z.totalTime/Z.count,totalTime:Z.totalTime,maxTime:Z.maxTime,minTime:Z.minTime,budget:$?.maxTime,budgetUtilization:$?Z.totalTime/Z.count/$.maxTime*100:void 0}}let Q={};for(let[Z,$]of this.metrics.entries()){let U=this.budgets.get(Z);Q[Z]={count:$.count,avgTime:$.totalTime/$.count,totalTime:$.totalTime,maxTime:$.maxTime,minTime:$.minTime,budget:U?.maxTime,budgetUtilization:U?$.totalTime/$.count/U.maxTime*100:void 0}}return Q}getViolations(J){if(J)return this.violations.filter((Q)=>Q.label===J);return[...this.violations]}getViolationStats(){let J={},Q=0,Z=0;for(let $ of this.violations)if(J[$.label]=(J[$.label]||0)+1,$.isWarning)Q++;else Z++;return{total:this.violations.length,byLabel:J,warnings:Q,errors:Z}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var $J=null;function WQ(){if(!$J)$J=new kJ;return $J}var gQ=new Proxy({},{get(J,Q){return WQ()[Q]}});var xJ=[];function SJ(J){let Q=new ZJ(J);return xJ.push(Q),Q}function mQ(){for(let J of xJ)J.clear()}function UJ(J,...Q){return`${Q.map((Z)=>String(Z??"")).join("\x00")}\x00${J.length}\x00${Bun.hash(J)}`}function hQ(J){let Q=[];for(let Z of new Set(J))try{Q.push({path:Z,mtimeMs:EJ.statSync(Z).mtimeMs})}catch{}return Q}function iQ(J){for(let Q of J)try{if(EJ.statSync(Q.path).mtimeMs!==Q.mtimeMs)return!1}catch{return!1}return!0}var O=null,WJ=!1,H=null,T="",A=!1,dJ=256,D=new Map,L=new Map,N=null,b=null;function y(J){return Bun.hash(J).toString(16).padStart(16,"0").slice(0,16)}function FJ(J,Q){if(D.has(J))D.delete(J);else if(D.size>=dJ)D.delete(D.keys().next().value);D.set(J,Q)}function VQ(J){let Q=y(J);if(L.has(Q))L.delete(Q);else if(L.size>=dJ)L.delete(L.keys().next().value);return L.set(Q,J),Q}function eQ(J){let Q=L.get(J);if(Q===void 0)return;return L.delete(J),L.set(J,Q),Q}async function XQ(J){if(!N)return null;try{let Q=Bun.file(z.join(N,`cw-${y(J)}.css`));if(!await Q.exists())return null;return await Q.text()}catch{return null}}async function jQ(J,Q){if(!N)return;try{if(!fs.existsSync(N))fs.mkdirSync(N,{recursive:!0});await Bun.write(z.join(N,`cw-${y(J)}.css`),Q)}catch{}}async function fJ(J){try{let Q=await import(J);if(Q&&Q.CSSGenerator)return{CSSGenerator:Q.CSSGenerator,config:Q.config,build:Q.build,defaultConfig:Q.defaultConfig,extractClasses:Q.extractClasses}}catch{}return null}var qQ=[["@stacksjs","ts-css","dist","engine","index.js"],["@stacksjs","ts-css","src","engine","index.ts"]],GQ=["@stacksjs/ts-css/engine","@stacksjs/ts-css/dist/engine/index.js"];function zQ(){let J=[],Q=process.cwd();while(Q!==z.dirname(Q)){for(let Z of["node_modules","pantry"])for(let $ of qQ)J.push(z.join(Q,Z,...$));Q=z.dirname(Q)}return J}function YQ(){let J=[],Q=process.env.HOME||process.env.USERPROFILE||"",Z=[Q&&z.join(Q,"Code","Tools","ts-css"),Q&&z.join(Q,"Code","Tools","crosswind"),Q&&z.join(Q,"repos","stacks-org","ts-css"),Q&&z.join(Q,"repos","stacks-org","crosswind"),z.join(process.cwd(),"..","ts-css"),z.join(process.cwd(),"..","crosswind")].filter(Boolean);for(let $ of Z)J.push(z.join($,"packages","toolkit","dist","engine","index.js")),J.push(z.join($,"packages","toolkit","src","engine","index.ts"));if(Q)J.push(z.join(Q,"Code","Tools","stx","node_modules","@stacksjs","ts-css","dist","engine","index.js"));return J}async function pJ(){if(WJ)return O;WJ=!0;try{let J=async(U)=>{for(let F of U){if(!await Bun.file(F).exists())continue;let W=await fJ(F);if(W){if(!process.env.STACKS_DEV_QUIET)console.log(`${Y.green}[ts-css]${Y.reset} CSS engine loaded from ${z.dirname(z.dirname(F))}`);return W}}return null};if(process.env.CROSSWIND_SRC){let U=z.resolve(process.env.CROSSWIND_SRC),F=await J([U]);if(!F)throw Error(`CROSSWIND_SRC did not resolve to a Css module: ${U}`);return O=F,O}let Q=await J(zQ());if(Q)return O=Q,O;let Z=GQ;for(let U of Z){let F=await fJ(U);if(F){if(O=F,!process.env.STACKS_DEV_QUIET)console.log(`${Y.green}[ts-css]${Y.reset} CSS engine loaded`);return O}}let $=await J(YQ());if($)return O=$,O;throw Error("Css CSSGenerator not found in any location")}catch{return console.warn(`${Y.yellow}[ts-css] CSS engine not available, Tailwind styles will not be generated${Y.reset}`),console.warn(`${Y.yellow}Run 'bun add @stacksjs/ts-css' to enable CSS generation${Y.reset}`),null}}function J0(){VJ.clear(),O=null,WJ=!1,H=null,T="",D.clear(),L.clear(),b=null}var CJ=!1;async function mJ(J){try{let Q=yJ({name:"css",cwd:J})?"css":yJ({name:"crosswind",cwd:J})?"crosswind":null;if(!Q)return null;if(Q==="crosswind"&&!process.env.STACKS_DEV_QUIET&&!CJ)CJ=!0,console.warn(`${Y.yellow}[ts-css]${Y.reset} Reading the CSS config from a \`crosswind\` file. Rename it to \`css\` (e.g. config/css.ts) \u2014 the old name is deprecated.`);let{loadConfigWithResult:Z}=await import("bunfig"),$=await Z({name:Q,cwd:J,defaultConfig:{},checkEnv:!1,verbose:!1});if(!$?.path||!$.config||Object.keys($.config).length===0)return null;let U=z.relative(J,$.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${Y.green}[ts-css]${Y.reset} Loaded config from ${U||$.path}`);return $.config}catch(Q){if(Q instanceof Error&&Q.name==="ConfigNotFoundError")return null;return console.warn(`${Y.yellow}[ts-css]${Y.reset} Failed to load css config:`,Q instanceof Error?Q.message:Q),null}}async function wQ(J){let Q=null;try{let{loadStxConfig:Z}=await import("./chunk-yz0d60px.js"),$=await Z(J);if($.css)if(typeof $.css==="string"){let U=z.isAbsolute($.css)?$.css:z.resolve(J,$.css);if(await Bun.file(U).exists()){let F=await import(U);Q=F.default||F,console.log(`${Y.green}[ts-css]${Y.reset} Loaded config from stx.config.ts \u2192 ${$.css}`)}}else{if(Q={...$.css,content:$.css.content||[],preflight:$.css.preflight??!0,minify:$.css.minify??!1},$.css.config){let U=z.isAbsolute($.css.config)?$.css.config:z.resolve(J,$.css.config);if(await Bun.file(U).exists()){let F=await import(U);Q={...F.default||F,...Q}}}console.log(`${Y.green}[ts-css]${Y.reset} Using inline CSS config from stx.config.ts`)}}catch{}return Q||await mJ(J)}function BQ(J){try{let Q=new WeakSet;return y(JSON.stringify(J??{},(Z,$)=>{if(typeof $==="function")return`[fn]${String($)}`;if(typeof $==="object"&&$!==null){if(Q.has($))return"[circular]";Q.add($)}return $})??"")}catch{return"unhashable"}}async function HQ(J){if(A)return T;A=!0;try{let Q=await pJ();if(!Q||!Q.build)return A=!1,"";if(!H)H=await mJ(J);if(!H)return A=!1,"";let Z=Q.defaultConfig?.theme||{},$=H.theme||{},U={...Q.defaultConfig,...H,theme:{...Z,...$,extend:{...Z.extend||{},...$.extend||{}}}},F=performance.now(),W=await Q.build(U),j=performance.now()-F;if(T=W.css,console.log(`${Y.cyan}[ts-css]${Y.reset} Built ${W.classes.size} classes in ${j.toFixed(1)}ms`),U.output){let V=z.isAbsolute(U.output)?U.output:z.join(J,U.output),X=z.dirname(V);if(!fs.existsSync(X))fs.mkdirSync(X,{recursive:!0});await Bun.write(V,W.css)}return A=!1,W.css}catch(Q){return console.error(`${Y.red}[ts-css]${Y.reset} Build error:`,Q),A=!1,T}}async function Q0(J){H=null,await HQ(J)}function $0(){return T}function OQ(J){let Q=new Set,Z=/class\s*=\s*["']([^"']+)["']/gi,$=Z.exec(J);while($!==null){for(let W of $[1].split(/\s+/))if(W.trim())Q.add(W.trim());$=Z.exec(J)}let U=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,F=U.exec(J);while(F!==null){let W=F[1].match(/'([^']+)'/g);if(W){for(let j of W)for(let V of j.slice(1,-1).split(/\s+/))if(V.trim())Q.add(V.trim())}F=U.exec(J)}return Q}var VJ=SJ(64);async function LQ(J,Q){let Z=VJ.get(UJ(J,Q,b));if(Z!==void 0)return Z;let $=await KQ(J,Q);if($)VJ.set(UJ(J,Q,b),$);return $}async function KQ(J,Q){try{let Z=await pJ();if(!Z)return"";let $=typeof Z.extractClasses==="function"?Z.extractClasses(J):OQ(J);if($.size===0)return"";let U=Q?z.resolve(Q):process.cwd();if(!N)N=uJ(U,"cache");let F=[...$].sort().join(" "),W=`${b||"default"}::${F}`,j=D.get(W);if(j!==void 0)return FJ(W,j),j;let V=await XQ(W);if(V!==null)return FJ(W,V),V;if(!H)H=await wQ(U),b=BQ(H);let X=Z.defaultConfig||Z.config,q=H||{},G=LJ(X,q),{safelist:w,includePreflight:K,minify:M,tokenCSS:hJ}=G,XJ=G.config,_=new Z.CSSGenerator(XJ);for(let B of w)_.generate(B);for(let B of $)_.generate(B);let I=_.toCSS(K,M),jJ=XJ.shortcuts||q.shortcuts||{};for(let[B,f]of Object.entries(jJ)){if(!$.has(B)&&!w.includes(B))continue;let C=f.split(/\s+/).filter(Boolean);for(let R of C)_.generate(R)}I=_.toCSS(K,M);let v=I.split(`
20
+ `),U.set(X,q)}return q(...j)}catch{return}}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:W,context:Q.slice()});return W}clear(){this.pool.length=0,this.fnCache.clear()}}var CQ=new bJ;class kJ{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(J){this.enabled=J}isEnabled(){return this.enabled}setBudget(J,Q){this.budgets.set(J,{warnThreshold:0.8,action:"warn",...Q})}setBudgets(J){for(let[Q,Z]of Object.entries(J))this.setBudget(Q,Z)}removeBudget(J){this.budgets.delete(J)}getBudgets(){let J={};for(let[Q,Z]of this.budgets.entries())J[Q]=Z;return J}onViolation(J){this.violationHandlers.push(J)}offViolation(J){let Q=this.violationHandlers.indexOf(J);if(Q!==-1)this.violationHandlers.splice(Q,1)}time(J,Q){if(!this.enabled)return Q();let Z=performance.now(),$=Q(),U=performance.now()-Z;return this.recordTime(J,U),this.checkBudget(J,U),$}async timeAsync(J,Q){if(!this.enabled)return Q();let Z=performance.now(),$=await Q(),U=performance.now()-Z;return this.recordTime(J,U),this.checkBudget(J,U),$}checkBudget(J,Q){let Z=this.budgets.get(J);if(!Z)return;let $=Q/Z.maxTime*100,U=Z.warnThreshold!==void 0?Q>=Z.maxTime*Z.warnThreshold&&Q<Z.maxTime:!1,F=Q>=Z.maxTime;if(!U&&!F)return;let W={label:J,actualTime:Q,budgetTime:Z.maxTime,exceedancePercent:$,timestamp:new Date,isWarning:U};this.violations.push(W);while(this.violations.length>this.maxViolations)this.violations.shift();for(let V of this.violationHandlers)try{V(W)}catch{}let j=U?`[Performance Warning] "${J}" took ${Q.toFixed(2)}ms (${$.toFixed(1)}% of ${Z.maxTime}ms budget)`:`[Performance Budget Exceeded] "${J}" took ${Q.toFixed(2)}ms (exceeded ${Z.maxTime}ms budget by ${($-100).toFixed(1)}%)`;switch(Z.action){case"log":console.log(j);break;case"warn":console.warn(j);break;case"error":console.error(j);break;case"throw":if(F)throw Error(j);else console.warn(j);break}}recordTime(J,Q){let Z=this.metrics.get(J);if(Z)Z.count++,Z.totalTime+=Q,Z.maxTime=Math.max(Z.maxTime,Q),Z.minTime=Math.min(Z.minTime,Q);else this.metrics.set(J,{count:1,totalTime:Q,maxTime:Q,minTime:Q})}getStats(J){if(J){let Z=this.metrics.get(J);if(!Z)return{};let $=this.budgets.get(J);return{count:Z.count,avgTime:Z.totalTime/Z.count,totalTime:Z.totalTime,maxTime:Z.maxTime,minTime:Z.minTime,budget:$?.maxTime,budgetUtilization:$?Z.totalTime/Z.count/$.maxTime*100:void 0}}let Q={};for(let[Z,$]of this.metrics.entries()){let U=this.budgets.get(Z);Q[Z]={count:$.count,avgTime:$.totalTime/$.count,totalTime:$.totalTime,maxTime:$.maxTime,minTime:$.minTime,budget:U?.maxTime,budgetUtilization:U?$.totalTime/$.count/U.maxTime*100:void 0}}return Q}getViolations(J){if(J)return this.violations.filter((Q)=>Q.label===J);return[...this.violations]}getViolationStats(){let J={},Q=0,Z=0;for(let $ of this.violations)if(J[$.label]=(J[$.label]||0)+1,$.isWarning)Q++;else Z++;return{total:this.violations.length,byLabel:J,warnings:Q,errors:Z}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var $J=null;function WQ(){if(!$J)$J=new kJ;return $J}var gQ=new Proxy({},{get(J,Q){return WQ()[Q]}});var xJ=[];function SJ(J){let Q=new ZJ(J);return xJ.push(Q),Q}function mQ(){for(let J of xJ)J.clear()}function UJ(J,...Q){return`${Q.map((Z)=>String(Z??"")).join("\x00")}\x00${J.length}\x00${Bun.hash(J)}`}function hQ(J){let Q=[];for(let Z of new Set(J))try{Q.push({path:Z,mtimeMs:EJ.statSync(Z).mtimeMs})}catch{}return Q}function iQ(J){for(let Q of J)try{if(EJ.statSync(Q.path).mtimeMs!==Q.mtimeMs)return!1}catch{return!1}return!0}var O=null,WJ=!1,H=null,T="",A=!1,dJ=256,D=new Map,L=new Map,N=null,b=null;function y(J){return Bun.hash(J).toString(16).padStart(16,"0").slice(0,16)}function FJ(J,Q){if(D.has(J))D.delete(J);else if(D.size>=dJ)D.delete(D.keys().next().value);D.set(J,Q)}function VQ(J){let Q=y(J);if(L.has(Q))L.delete(Q);else if(L.size>=dJ)L.delete(L.keys().next().value);return L.set(Q,J),Q}function eQ(J){let Q=L.get(J);if(Q===void 0)return;return L.delete(J),L.set(J,Q),Q}async function XQ(J){if(!N)return null;try{let Q=Bun.file(z.join(N,`cw-${y(J)}.css`));if(!await Q.exists())return null;return await Q.text()}catch{return null}}async function jQ(J,Q){if(!N)return;try{if(!fs.existsSync(N))fs.mkdirSync(N,{recursive:!0});await Bun.write(z.join(N,`cw-${y(J)}.css`),Q)}catch{}}async function fJ(J){try{let Q=await import(J);if(Q&&Q.CSSGenerator)return{CSSGenerator:Q.CSSGenerator,config:Q.config,build:Q.build,defaultConfig:Q.defaultConfig,extractClasses:Q.extractClasses}}catch{}return null}var qQ=[["@stacksjs","ts-css","dist","engine","index.js"],["@stacksjs","ts-css","src","engine","index.ts"]],GQ=["@stacksjs/ts-css/engine","@stacksjs/ts-css/dist/engine/index.js"];function zQ(){let J=[],Q=process.cwd();while(Q!==z.dirname(Q)){for(let Z of["node_modules","pantry"])for(let $ of qQ)J.push(z.join(Q,Z,...$));Q=z.dirname(Q)}return J}function YQ(){let J=[],Q=process.env.HOME||process.env.USERPROFILE||"",Z=[Q&&z.join(Q,"Code","Tools","ts-css"),Q&&z.join(Q,"Code","Tools","crosswind"),Q&&z.join(Q,"repos","stacks-org","ts-css"),Q&&z.join(Q,"repos","stacks-org","crosswind"),z.join(process.cwd(),"..","ts-css"),z.join(process.cwd(),"..","crosswind")].filter(Boolean);for(let $ of Z)J.push(z.join($,"packages","toolkit","dist","engine","index.js")),J.push(z.join($,"packages","toolkit","src","engine","index.ts"));if(Q)J.push(z.join(Q,"Code","Tools","stx","node_modules","@stacksjs","ts-css","dist","engine","index.js"));return J}async function pJ(){if(WJ)return O;WJ=!0;try{let J=async(U)=>{for(let F of U){if(!await Bun.file(F).exists())continue;let W=await fJ(F);if(W){if(!process.env.STACKS_DEV_QUIET)console.log(`${Y.green}[ts-css]${Y.reset} CSS engine loaded from ${z.dirname(z.dirname(F))}`);return W}}return null};if(process.env.CROSSWIND_SRC){let U=z.resolve(process.env.CROSSWIND_SRC),F=await J([U]);if(!F)throw Error(`CROSSWIND_SRC did not resolve to a Css module: ${U}`);return O=F,O}let Q=await J(zQ());if(Q)return O=Q,O;let Z=GQ;for(let U of Z){let F=await fJ(U);if(F){if(O=F,!process.env.STACKS_DEV_QUIET)console.log(`${Y.green}[ts-css]${Y.reset} CSS engine loaded`);return O}}let $=await J(YQ());if($)return O=$,O;throw Error("Css CSSGenerator not found in any location")}catch{return console.warn(`${Y.yellow}[ts-css] CSS engine not available, Tailwind styles will not be generated${Y.reset}`),console.warn(`${Y.yellow}Run 'bun add @stacksjs/ts-css' to enable CSS generation${Y.reset}`),null}}function J0(){VJ.clear(),O=null,WJ=!1,H=null,T="",D.clear(),L.clear(),b=null}var CJ=!1;async function mJ(J){try{let Q=yJ({name:"css",cwd:J})?"css":yJ({name:"crosswind",cwd:J})?"crosswind":null;if(!Q)return null;if(Q==="crosswind"&&!process.env.STACKS_DEV_QUIET&&!CJ)CJ=!0,console.warn(`${Y.yellow}[ts-css]${Y.reset} Reading the CSS config from a \`crosswind\` file. Rename it to \`css\` (e.g. config/css.ts) \u2014 the old name is deprecated.`);let{loadConfigWithResult:Z}=await import("bunfig"),$=await Z({name:Q,cwd:J,defaultConfig:{},checkEnv:!1,verbose:!1});if(!$?.path||!$.config||Object.keys($.config).length===0)return null;let U=z.relative(J,$.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${Y.green}[ts-css]${Y.reset} Loaded config from ${U||$.path}`);return $.config}catch(Q){if(Q instanceof Error&&Q.name==="ConfigNotFoundError")return null;return console.warn(`${Y.yellow}[ts-css]${Y.reset} Failed to load css config:`,Q instanceof Error?Q.message:Q),null}}async function wQ(J){let Q=null;try{let{loadStxConfig:Z}=await import("./chunk-2p68bkza.js"),$=await Z(J);if($.css)if(typeof $.css==="string"){let U=z.isAbsolute($.css)?$.css:z.resolve(J,$.css);if(await Bun.file(U).exists()){let F=await import(U);Q=F.default||F,console.log(`${Y.green}[ts-css]${Y.reset} Loaded config from stx.config.ts \u2192 ${$.css}`)}}else{if(Q={...$.css,content:$.css.content||[],preflight:$.css.preflight??!0,minify:$.css.minify??!1},$.css.config){let U=z.isAbsolute($.css.config)?$.css.config:z.resolve(J,$.css.config);if(await Bun.file(U).exists()){let F=await import(U);Q={...F.default||F,...Q}}}console.log(`${Y.green}[ts-css]${Y.reset} Using inline CSS config from stx.config.ts`)}}catch{}return Q||await mJ(J)}function BQ(J){try{let Q=new WeakSet;return y(JSON.stringify(J??{},(Z,$)=>{if(typeof $==="function")return`[fn]${String($)}`;if(typeof $==="object"&&$!==null){if(Q.has($))return"[circular]";Q.add($)}return $})??"")}catch{return"unhashable"}}async function HQ(J){if(A)return T;A=!0;try{let Q=await pJ();if(!Q||!Q.build)return A=!1,"";if(!H)H=await mJ(J);if(!H)return A=!1,"";let Z=Q.defaultConfig?.theme||{},$=H.theme||{},U={...Q.defaultConfig,...H,theme:{...Z,...$,extend:{...Z.extend||{},...$.extend||{}}}},F=performance.now(),W=await Q.build(U),j=performance.now()-F;if(T=W.css,console.log(`${Y.cyan}[ts-css]${Y.reset} Built ${W.classes.size} classes in ${j.toFixed(1)}ms`),U.output){let V=z.isAbsolute(U.output)?U.output:z.join(J,U.output),X=z.dirname(V);if(!fs.existsSync(X))fs.mkdirSync(X,{recursive:!0});await Bun.write(V,W.css)}return A=!1,W.css}catch(Q){return console.error(`${Y.red}[ts-css]${Y.reset} Build error:`,Q),A=!1,T}}async function Q0(J){H=null,await HQ(J)}function $0(){return T}function OQ(J){let Q=new Set,Z=/class\s*=\s*["']([^"']+)["']/gi,$=Z.exec(J);while($!==null){for(let W of $[1].split(/\s+/))if(W.trim())Q.add(W.trim());$=Z.exec(J)}let U=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,F=U.exec(J);while(F!==null){let W=F[1].match(/'([^']+)'/g);if(W){for(let j of W)for(let V of j.slice(1,-1).split(/\s+/))if(V.trim())Q.add(V.trim())}F=U.exec(J)}return Q}var VJ=SJ(64);async function LQ(J,Q){let Z=VJ.get(UJ(J,Q,b));if(Z!==void 0)return Z;let $=await KQ(J,Q);if($)VJ.set(UJ(J,Q,b),$);return $}async function KQ(J,Q){try{let Z=await pJ();if(!Z)return"";let $=typeof Z.extractClasses==="function"?Z.extractClasses(J):OQ(J);if($.size===0)return"";let U=Q?z.resolve(Q):process.cwd();if(!N)N=uJ(U,"cache");let F=[...$].sort().join(" "),W=`${b||"default"}::${F}`,j=D.get(W);if(j!==void 0)return FJ(W,j),j;let V=await XQ(W);if(V!==null)return FJ(W,V),V;if(!H)H=await wQ(U),b=BQ(H);let X=Z.defaultConfig||Z.config,q=H||{},G=LJ(X,q),{safelist:w,includePreflight:K,minify:M,tokenCSS:hJ}=G,XJ=G.config,_=new Z.CSSGenerator(XJ);for(let B of w)_.generate(B);for(let B of $)_.generate(B);let I=_.toCSS(K,M),jJ=XJ.shortcuts||q.shortcuts||{};for(let[B,f]of Object.entries(jJ)){if(!$.has(B)&&!w.includes(B))continue;let C=f.split(/\s+/).filter(Boolean);for(let R of C)_.generate(R)}I=_.toCSS(K,M);let v=I.split(`
21
21
  `);for(let[B,f]of Object.entries(jJ)){if(!$.has(B)&&!w.includes(B))continue;let C=f.split(/\s+/).filter(Boolean),R=[],g=[];for(let u of C){let qJ=u.startsWith("dark:"),GJ=`.${(qJ?u.slice(5):u).replace(/\//g,"\\/").replace(/:/g,"\\:").replace(/\./g,"\\.").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/%/g,"\\%")}`;for(let k=0;k<v.length;k++){let zJ=v[k].trim();if(zJ===`${GJ} {`||zJ.startsWith(`${GJ} {`)){let E=k,YJ="";while(E<v.length){if(YJ+=v[E],v[E].includes("}"))break;E++}let d=YJ.match(/\{([^}]+)\}/);if(d)if(qJ)g.push(d[1].trim());else R.push(d[1].trim());break}}}if(R.length)I+=`
22
22
  .${B} { ${R.join(" ")} }`;if(g.length)I+=`
23
23
  @media (prefers-color-scheme: dark) { .dark .${B} { ${g.join(" ")} } }`}return I=hJ+I,FJ(W,I),jQ(W,I),I}catch(Z){return console.warn("Failed to generate Css CSS:",Z),""}}async function Z0(J,Q,Z=!1,$=!1){let U=await LQ(J,Q);if(!U)return $?QJ(J):J;let F=Z?`<link data-css="generated" rel="stylesheet" href="/_stx/css.${VQ(U)}.css">`:`<style data-css="generated">
@@ -29,4 +29,4 @@ ${F}`);return F+J}function IQ(J,Q){let Z=JJ(J).map((V)=>({...V,replacement:""}))
29
29
  ${Q}`});else Z.push({start:0,end:0,replacement:Q})}}Z.sort((V,X)=>V.start-X.start||V.end-X.end);for(let V=1;V<Z.length;V++)if(Z[V].start<Z[V-1].end)return DQ(QJ(J),Q);let F=Array(Z.length*2+1),W=0,j=0;for(let V of Z)F[j++]=J.slice(W,V.start),F[j++]=V.replacement,W=V.end;return F[j]=J.slice(W),F.join("")}function DQ(J,Q){let Z=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g;if(Z.test(J)){let $=!1;return J.replace(Z,()=>{if($)return"";return $=!0,Q})}if(J.includes("</head>"))return J.replace("</head>",`${Q}
30
30
  </head>`);if(J.includes("<body"))return J.replace(/<body([^>]*)>/,`<body$1>
31
31
  ${Q}`);return Q+J}
32
- export{ZJ as Bs,fQ as Cs,gQ as Ds,SJ as Es,mQ as Fs,UJ as Gs,hQ as Hs,iQ as Is,l as Js,IJ as Ks,iJ as Ls,rJ as Ms,vQ as Ns,NJ as Os,a as Ps,RQ as Qs,aJ as Rs,h as Ss,LJ as Ts,JJ as Us,QJ as Vs,xQ as Ws,Y as Xs,eQ as Ys,pJ as Zs,J0 as _s,mJ as $s,wQ as at,BQ as bt,HQ as ct,Q0 as dt,$0 as et,OQ as ft,LQ as gt,Z0 as ht};
32
+ export{ZJ as Fs,fQ as Gs,gQ as Hs,SJ as Is,mQ as Js,UJ as Ks,hQ as Ls,iQ as Ms,l as Ns,IJ as Os,iJ as Ps,rJ as Qs,vQ as Rs,NJ as Ss,a as Ts,RQ as Us,aJ as Vs,h as Ws,LJ as Xs,JJ as Ys,QJ as Zs,xQ as _s,Y as $s,eQ as at,pJ as bt,J0 as ct,mJ as dt,wQ as et,BQ as ft,HQ as gt,Q0 as ht,$0 as it,OQ as jt,LQ as kt,Z0 as lt};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ai as a,Bi as b,Ci as c,Di as d,Ei as e,Fi as f,Gi as g}from"./chunk-bgrkxzr7.js";import"./chunk-5g6rprcy.js";export{c as shouldCacheComponent,a as processKeepAliveDirectives,g as onDeactivated,f as onActivated,e as generateKeepAliveRuntime,d as generateKeepAliveCSS,b as createKeepAliveCache};
2
+ import{Ai as a,Bi as b,Ci as c,Di as d,Ei as e,Fi as f,Gi as g}from"./chunk-bgrkxzr7.js";import"./chunk-p5d8sb50.js";export{c as shouldCacheComponent,a as processKeepAliveDirectives,g as onDeactivated,f as onActivated,e as generateKeepAliveRuntime,d as generateKeepAliveCSS,b as createKeepAliveCache};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Te as a}from"./chunk-ebd3z4j9.js";import"./chunk-j82hfkcf.js";import"./chunk-rh7mwwb4.js";import"./chunk-1t3j8a0q.js";import"./chunk-01ggk8k8.js";import"./chunk-25b8z7xa.js";import"./chunk-hk8j3eps.js";import"./chunk-xe93ae3r.js";import"./chunk-1spzqjve.js";import"./chunk-f2qbjr3z.js";import"./chunk-1xwfws06.js";import"./chunk-r1rfwm01.js";import"./chunk-ahpmjg3f.js";import"./chunk-bt8w146r.js";import"./chunk-6p6b01kp.js";import"./chunk-x7dv5rq7.js";import"./chunk-e0kzyf1g.js";import"./chunk-wv8h3d68.js";import"./chunk-beextc84.js";import"./chunk-yr7camcd.js";import"./chunk-p5d8sb50.js";export{a as startInteractive};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Af as L,Bf as w,Cf as x,Df as p,Ef as F,Ff as T,If as I,Jf as f,Kf as l,Lf as n,Mf as i,Nf as P,Of as o,Pf as a}from"./chunk-xe6zmdfq.js";import{ws as ZG}from"./chunk-ay336sqb.js";function HG(X,Z={}){let{src:G,alt:J,width:q,height:$,sizes:K="100vw",loading:Q="lazy",priority:Y=!1,quality:M=x,placeholder:N="none",formats:j=w,widths:C=L,decoding:B="async",fetchpriority:V,objectFit:O,objectPosition:W}=X,H=X.class,z=X.style,{processedImage:R,variants:_,optimize:E=!0,isDev:S=!1}=Z;if(_&&_.length>0)return OG(X,_,R);if(S||!E)return MG(X);return VG(X)}function OG(X,Z,G){let{src:J,alt:q,width:$,height:K,sizes:Q="100vw",loading:Y="lazy",priority:M=!1,decoding:N="async",fetchpriority:j,objectFit:C,objectPosition:B,placeholder:V="none"}=X,O=X.class,W=X.style,H=n(Z),z=l(Z),R=typeof Q==="object"?f(Q):Q,_=G?G.aspectRatio:$&&K?Number($)/Number(K):void 0,E=[];if(_)E.push(`aspect-ratio: ${_}`);if(C)E.push(`object-fit: ${C}`);if(B)E.push(`object-position: ${B}`);if(W)E.push(W);let S=E.length>0?` style="${E.join("; ")}"`:"",b=O?` class="${O}"`:"",u=M?"":` loading="${Y}"`,d=` decoding="${N}"`,h=j?` fetchpriority="${j}"`:M?' fetchpriority="high"':"",r=["avif","webp","jpeg","png"],s=[];for(let U of r){let D=H.get(U);if(D&&D.length>0){let m=I(D),QG=P(U);s.push(` <source type="${QG}" srcset="${m}" sizes="${R}" />`)}}let e="",t="",g;if(V!=="none"&&G?.placeholder){let U=`img-${Math.random().toString(36).slice(2,8)}`;if(e=`<div class="stx-image-wrapper" id="${U}">`,t="</div>",V==="blur")g=`
2
+ import{Af as L,Bf as w,Cf as x,Df as p,Ef as F,Ff as T,If as I,Jf as f,Kf as l,Lf as n,Mf as i,Nf as P,Of as o,Pf as a}from"./chunk-74r1zw2h.js";import{As as ZG}from"./chunk-hk8j3eps.js";function HG(X,Z={}){let{src:G,alt:J,width:q,height:$,sizes:K="100vw",loading:Q="lazy",priority:Y=!1,quality:M=x,placeholder:N="none",formats:j=w,widths:C=L,decoding:B="async",fetchpriority:V,objectFit:O,objectPosition:W}=X,H=X.class,z=X.style,{processedImage:R,variants:_,optimize:E=!0,isDev:S=!1}=Z;if(_&&_.length>0)return OG(X,_,R);if(S||!E)return MG(X);return VG(X)}function OG(X,Z,G){let{src:J,alt:q,width:$,height:K,sizes:Q="100vw",loading:Y="lazy",priority:M=!1,decoding:N="async",fetchpriority:j,objectFit:C,objectPosition:B,placeholder:V="none"}=X,O=X.class,W=X.style,H=n(Z),z=l(Z),R=typeof Q==="object"?f(Q):Q,_=G?G.aspectRatio:$&&K?Number($)/Number(K):void 0,E=[];if(_)E.push(`aspect-ratio: ${_}`);if(C)E.push(`object-fit: ${C}`);if(B)E.push(`object-position: ${B}`);if(W)E.push(W);let S=E.length>0?` style="${E.join("; ")}"`:"",b=O?` class="${O}"`:"",u=M?"":` loading="${Y}"`,d=` decoding="${N}"`,h=j?` fetchpriority="${j}"`:M?' fetchpriority="high"':"",r=["avif","webp","jpeg","png"],s=[];for(let U of r){let D=H.get(U);if(D&&D.length>0){let m=I(D),QG=P(U);s.push(` <source type="${QG}" srcset="${m}" sizes="${R}" />`)}}let e="",t="",g;if(V!=="none"&&G?.placeholder){let U=`img-${Math.random().toString(36).slice(2,8)}`;if(e=`<div class="stx-image-wrapper" id="${U}">`,t="</div>",V==="blur")g=`
3
3
  #${U} {
4
4
  position: relative;
5
5
  background-image: url('${G.placeholder}');
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ah as h,th as a,uh as b,vh as c,wh as d,xh as e,yh as f,zh as g}from"./chunk-sqvqwd0p.js";import"./chunk-5g6rprcy.js";export{g as timingPlugin,c as pluginManager,a as definePlugin,f as debugPlugin,h as createVariablesPlugin,e as createFilterPlugin,d as createDirectivePlugin,b as PluginManager};
2
+ import{Ah as h,th as a,uh as b,vh as c,wh as d,xh as e,yh as f,zh as g}from"./chunk-sqvqwd0p.js";import"./chunk-p5d8sb50.js";export{g as timingPlugin,c as pluginManager,a as definePlugin,f as debugPlugin,h as createVariablesPlugin,e as createFilterPlugin,d as createDirectivePlugin,b as PluginManager};