@stacksjs/stx 0.2.672 → 0.2.674

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 (212) hide show
  1. package/dist/chunk-0jwdcqj8.js +2 -0
  2. package/dist/chunk-0mwdq478.js +2 -0
  3. package/dist/{chunk-npa7gze7.js → chunk-0nfqgv4n.js} +2 -2
  4. package/dist/chunk-1y6egkty.js +2 -0
  5. package/dist/{chunk-1sr6c0nk.js → chunk-25zmy8q6.js} +2 -2
  6. package/dist/chunk-2881tcqt.js +2 -0
  7. package/dist/chunk-2a775q7x.js +2 -0
  8. package/dist/chunk-2asdbd5e.js +2 -0
  9. package/dist/chunk-34yj93hh.js +2 -0
  10. package/dist/{chunk-30nes8ne.js → chunk-35ezh7de.js} +2 -2
  11. package/dist/{chunk-sjcqxfq1.js → chunk-40tswfe7.js} +8 -8
  12. package/dist/chunk-41de209e.js +2 -0
  13. package/dist/{chunk-6xe8rnfv.js → chunk-4b9s7wgy.js} +2 -2
  14. package/dist/{chunk-ttbn287w.js → chunk-4bgjrrvz.js} +1 -1
  15. package/dist/{chunk-365vg0eg.js → chunk-4s8zacxg.js} +4 -4
  16. package/dist/chunk-4w6baw62.js +3 -0
  17. package/dist/{chunk-fbtv2k1p.js → chunk-506mv7hb.js} +2 -2
  18. package/dist/{chunk-fzqj1mjz.js → chunk-5qtthtg3.js} +7 -7
  19. package/dist/chunk-5s1ay9mv.js +2 -0
  20. package/dist/{chunk-kenbxxbn.js → chunk-5vt48yce.js} +6 -6
  21. package/dist/{chunk-qv6axke4.js → chunk-5zhp87wv.js} +2 -2
  22. package/dist/{chunk-hvf2e7pr.js → chunk-6s7tvmqp.js} +1 -1
  23. package/dist/{chunk-ecqrkyg8.js → chunk-6sjtyd0k.js} +4 -4
  24. package/dist/{chunk-a3d0g4mr.js → chunk-7adznted.js} +2 -2
  25. package/dist/chunk-7j1zgrnf.js +42 -0
  26. package/dist/chunk-7kznee1g.js +2 -0
  27. package/dist/{chunk-qjtpxsyx.js → chunk-7mvz972c.js} +3 -3
  28. package/dist/chunk-80zgyaqe.js +2 -0
  29. package/dist/chunk-84tqb1rn.js +2 -0
  30. package/dist/chunk-8azm7nha.js +2 -0
  31. package/dist/chunk-902qnyg0.js +2 -0
  32. package/dist/{chunk-3y41efsf.js → chunk-9dtbvjpp.js} +8 -8
  33. package/dist/chunk-9n6jwcpb.js +2 -0
  34. package/dist/{chunk-yfvm7q6t.js → chunk-a4p18ybc.js} +3 -3
  35. package/dist/chunk-a6y8td0d.js +2 -0
  36. package/dist/chunk-a7kt1ts4.js +2 -0
  37. package/dist/chunk-a81y8g40.js +2 -0
  38. package/dist/{chunk-mjm3tyfj.js → chunk-aet1pgw7.js} +36 -36
  39. package/dist/chunk-aft1zc84.js +2 -0
  40. package/dist/{chunk-04kg16qs.js → chunk-am2w363p.js} +4 -4
  41. package/dist/{chunk-ym41ybz2.js → chunk-asezs2n3.js} +6 -6
  42. package/dist/{chunk-7kk2m44a.js → chunk-bawq4fqy.js} +4 -4
  43. package/dist/chunk-bdp2r0v4.js +2 -0
  44. package/dist/{chunk-1mj9crcg.js → chunk-bkkpq8dx.js} +9 -9
  45. package/dist/chunk-brtvm8mb.js +2 -0
  46. package/dist/{chunk-2dp7hyv7.js → chunk-bsajk82t.js} +14 -14
  47. package/dist/chunk-bvzr9zqt.js +2 -0
  48. package/dist/{chunk-t9yqq483.js → chunk-cbjabv1w.js} +4 -4
  49. package/dist/chunk-cbvgtf3m.js +2 -0
  50. package/dist/chunk-cfydbaeq.js +2 -0
  51. package/dist/{chunk-t2pzy3x1.js → chunk-ck2e3e47.js} +3 -3
  52. package/dist/{chunk-wpmrz872.js → chunk-d09q93yf.js} +2 -2
  53. package/dist/{chunk-a91atghh.js → chunk-d1a86qx8.js} +1 -1
  54. package/dist/{chunk-xqp4hstk.js → chunk-dgc1a3yt.js} +6 -6
  55. package/dist/chunk-dq8c3h4n.js +2 -0
  56. package/dist/chunk-e36pne7n.js +2 -0
  57. package/dist/chunk-e62qfexp.js +2 -0
  58. package/dist/chunk-eq5jzaj5.js +2 -0
  59. package/dist/{chunk-kwek8xdt.js → chunk-f9zyf9n6.js} +65 -65
  60. package/dist/{chunk-dgb4z4kw.js → chunk-faakv1p6.js} +2 -2
  61. package/dist/{chunk-yqz01qvy.js → chunk-fb7t1nn9.js} +3 -3
  62. package/dist/{chunk-06b8btkv.js → chunk-fbmth6xv.js} +10 -10
  63. package/dist/{chunk-7met6yva.js → chunk-fd49fahd.js} +5 -5
  64. package/dist/chunk-fr39emcz.js +2 -0
  65. package/dist/chunk-fsq13amm.js +2 -0
  66. package/dist/chunk-fw413k9q.js +3 -0
  67. package/dist/chunk-fxh12vqd.js +2 -0
  68. package/dist/chunk-gcc9fa33.js +2 -0
  69. package/dist/chunk-h6t2ney6.js +2 -0
  70. package/dist/{chunk-kgfgb971.js → chunk-ham5x7ts.js} +4 -4
  71. package/dist/{chunk-n38yb274.js → chunk-hb3edeq9.js} +6 -6
  72. package/dist/{chunk-fvtwec1r.js → chunk-hegfgw27.js} +1 -1
  73. package/dist/{chunk-p472crv1.js → chunk-hgry3mjd.js} +1 -1
  74. package/dist/{chunk-t961jbzc.js → chunk-hsmcbh0p.js} +7 -7
  75. package/dist/{chunk-wz2zb53w.js → chunk-hz4x7h0n.js} +5 -5
  76. package/dist/{chunk-jxda11cg.js → chunk-j6m8xqh3.js} +2 -2
  77. package/dist/chunk-j8g5cvvm.js +2 -0
  78. package/dist/chunk-jzjpyyw2.js +2 -0
  79. package/dist/chunk-k1b8x73j.js +2 -0
  80. package/dist/{chunk-8k3rwv8r.js → chunk-kdebh22m.js} +7 -7
  81. package/dist/{chunk-pvb48ehs.js → chunk-mwnhdsbp.js} +2 -2
  82. package/dist/{chunk-s20h5gmr.js → chunk-nj343mw2.js} +5 -5
  83. package/dist/chunk-nw9bdk2n.js +2 -0
  84. package/dist/chunk-p4jkswz8.js +2 -0
  85. package/dist/chunk-p4r90vqf.js +2 -0
  86. package/dist/{chunk-bnn7pd62.js → chunk-p6qd7ad0.js} +2 -2
  87. package/dist/chunk-p8bgy5tt.js +2 -0
  88. package/dist/{chunk-aprhqxky.js → chunk-pb6erpj3.js} +5 -5
  89. package/dist/{chunk-r3e6x87d.js → chunk-pg2v1pb5.js} +3 -3
  90. package/dist/{chunk-dw81nc5v.js → chunk-pqqe2b6m.js} +4 -4
  91. package/dist/chunk-q6nwcav4.js +2 -0
  92. package/dist/chunk-qmqavdz2.js +2 -0
  93. package/dist/chunk-qpw72bty.js +2 -0
  94. package/dist/chunk-qwnh1kj6.js +2 -0
  95. package/dist/chunk-qy9m6qdn.js +2 -0
  96. package/dist/chunk-qychcdsm.js +2 -0
  97. package/dist/{chunk-7d4z944r.js → chunk-qz5b8ed4.js} +7 -7
  98. package/dist/{chunk-6ajahb2x.js → chunk-r7fdw2v5.js} +3 -3
  99. package/dist/{chunk-mmwedr93.js → chunk-rdr09efy.js} +5 -5
  100. package/dist/chunk-rj3w1ama.js +2 -0
  101. package/dist/{chunk-prf164ct.js → chunk-rr527jt6.js} +2 -2
  102. package/dist/{chunk-x68etmdg.js → chunk-rv39s5az.js} +4 -4
  103. package/dist/{chunk-a5zqqgx2.js → chunk-rym0309c.js} +3 -3
  104. package/dist/{chunk-sqayfat9.js → chunk-s0vtjyyj.js} +1 -1
  105. package/dist/{chunk-vqc4h16r.js → chunk-s2wptfm1.js} +2 -2
  106. package/dist/chunk-sf0r963g.js +2 -0
  107. package/dist/{chunk-a3yte051.js → chunk-sqn3y9qt.js} +2 -2
  108. package/dist/{chunk-9gfffs28.js → chunk-srq9fqq8.js} +10 -10
  109. package/dist/chunk-ss820yys.js +2 -0
  110. package/dist/{chunk-pn1ehs6a.js → chunk-szevd7d5.js} +2 -2
  111. package/dist/{chunk-wbzmr6a4.js → chunk-t0k16vqv.js} +2 -2
  112. package/dist/chunk-t4j9g2vh.js +2 -0
  113. package/dist/chunk-t79jfpv6.js +3 -0
  114. package/dist/{chunk-rcadtv3x.js → chunk-t9kxhe46.js} +1 -1
  115. package/dist/{chunk-zqtbtqbq.js → chunk-tddnb5bv.js} +2 -2
  116. package/dist/{chunk-hvzzhkhr.js → chunk-thceyzj6.js} +2 -2
  117. package/dist/{chunk-n3m7fkv1.js → chunk-trh7s6k3.js} +5 -5
  118. package/dist/{chunk-3349573p.js → chunk-trz8z4j4.js} +18 -18
  119. package/dist/chunk-ttemwrbx.js +2 -0
  120. package/dist/{chunk-wankp78x.js → chunk-twqzn21x.js} +7 -7
  121. package/dist/chunk-v14rq8b4.js +3 -0
  122. package/dist/{chunk-b4pcw34n.js → chunk-v21bhhjb.js} +1 -1
  123. package/dist/{chunk-ka8befem.js → chunk-v6peecfp.js} +2 -2
  124. package/dist/{chunk-g8r0km7g.js → chunk-vayhx642.js} +2 -2
  125. package/dist/{chunk-5pgk3w2c.js → chunk-vdxg7e1y.js} +2 -2
  126. package/dist/chunk-vq513cxx.js +2 -0
  127. package/dist/chunk-vvq8xe3n.js +2 -0
  128. package/dist/{chunk-tre98h62.js → chunk-w3d98907.js} +2 -2
  129. package/dist/{chunk-p3x21vp7.js → chunk-w7t2cfgy.js} +42 -42
  130. package/dist/chunk-w8t31bn9.js +2 -0
  131. package/dist/chunk-x1kz4d7j.js +2 -0
  132. package/dist/chunk-xcsyqwxf.js +25 -0
  133. package/dist/{chunk-9p6efb17.js → chunk-xghcsg3f.js} +1 -1
  134. package/dist/chunk-xn9jrjzh.js +2 -0
  135. package/dist/{chunk-nrvwejdw.js → chunk-y1pcdeg9.js} +5 -5
  136. package/dist/{chunk-qffbkvfn.js → chunk-yx3dpdwc.js} +3 -3
  137. package/dist/{chunk-f9hrpwsw.js → chunk-z22zy22p.js} +2 -2
  138. package/dist/chunk-z97bwx8m.js +2 -0
  139. package/dist/{chunk-120ze5ms.js → chunk-zmg1peyg.js} +3 -3
  140. package/dist/{chunk-pxdww4rb.js → chunk-zp79zkkd.js} +2 -2
  141. package/dist/cli.js +20 -20
  142. package/dist/craft-entry.js +2 -2
  143. package/dist/craft.js +2 -2
  144. package/dist/loops.js +19 -3
  145. package/dist/pwa.js +3 -3
  146. package/dist/signal-processing.d.ts +12 -0
  147. package/dist/signal-processing.js +1 -1
  148. package/dist/ssg.js +6 -6
  149. package/package.json +5 -5
  150. package/dist/chunk-028ee6q5.js +0 -2
  151. package/dist/chunk-02ymqwmj.js +0 -2
  152. package/dist/chunk-0dcrd58z.js +0 -2
  153. package/dist/chunk-0f33ssaq.js +0 -2
  154. package/dist/chunk-17yfcd5s.js +0 -2
  155. package/dist/chunk-1pnp91wx.js +0 -2
  156. package/dist/chunk-23b0khvh.js +0 -3
  157. package/dist/chunk-2f17h17f.js +0 -2
  158. package/dist/chunk-4c183zem.js +0 -2
  159. package/dist/chunk-4ve8vsw5.js +0 -2
  160. package/dist/chunk-4yt8tg4j.js +0 -2
  161. package/dist/chunk-52gp2xxk.js +0 -2
  162. package/dist/chunk-5w1c7x22.js +0 -2
  163. package/dist/chunk-5zgrvj4b.js +0 -2
  164. package/dist/chunk-67kj14at.js +0 -2
  165. package/dist/chunk-6vzktvyw.js +0 -2
  166. package/dist/chunk-7a3g26kk.js +0 -2
  167. package/dist/chunk-7d2fab0z.js +0 -2
  168. package/dist/chunk-7dtpszqq.js +0 -2
  169. package/dist/chunk-7spxdz5k.js +0 -2
  170. package/dist/chunk-864qtx7y.js +0 -2
  171. package/dist/chunk-89jbdtgw.js +0 -3
  172. package/dist/chunk-96mm4q2g.js +0 -2
  173. package/dist/chunk-9szxxgv5.js +0 -2
  174. package/dist/chunk-9yxgdy4z.js +0 -42
  175. package/dist/chunk-a95r5nmq.js +0 -25
  176. package/dist/chunk-am246nf3.js +0 -2
  177. package/dist/chunk-avnhsjq0.js +0 -2
  178. package/dist/chunk-aw3meb8t.js +0 -2
  179. package/dist/chunk-b4fd2dtk.js +0 -2
  180. package/dist/chunk-b823zxq6.js +0 -3
  181. package/dist/chunk-bdg0fydw.js +0 -2
  182. package/dist/chunk-d6en3vz7.js +0 -2
  183. package/dist/chunk-dnw3knxq.js +0 -2
  184. package/dist/chunk-dpvxe52r.js +0 -2
  185. package/dist/chunk-e1fetwbr.js +0 -2
  186. package/dist/chunk-e44z03s5.js +0 -2
  187. package/dist/chunk-e4vpr36s.js +0 -2
  188. package/dist/chunk-f8dkq3ta.js +0 -2
  189. package/dist/chunk-fcn71bq1.js +0 -2
  190. package/dist/chunk-g2jmwh7p.js +0 -2
  191. package/dist/chunk-j0v970k3.js +0 -2
  192. package/dist/chunk-jk41jwsc.js +0 -2
  193. package/dist/chunk-k2pa44rf.js +0 -2
  194. package/dist/chunk-qq1k3364.js +0 -2
  195. package/dist/chunk-qxmyaajq.js +0 -2
  196. package/dist/chunk-sc7hszsx.js +0 -2
  197. package/dist/chunk-sf0wsq74.js +0 -2
  198. package/dist/chunk-shpc1ttk.js +0 -2
  199. package/dist/chunk-sj6mhjdq.js +0 -2
  200. package/dist/chunk-sqhmkvwd.js +0 -2
  201. package/dist/chunk-sw6p5176.js +0 -2
  202. package/dist/chunk-tb6vacgp.js +0 -2
  203. package/dist/chunk-we8ptx6w.js +0 -2
  204. package/dist/chunk-weqc0ssb.js +0 -2
  205. package/dist/chunk-wq712sw1.js +0 -2
  206. package/dist/chunk-wyq0c4wy.js +0 -2
  207. package/dist/chunk-wz6368p4.js +0 -2
  208. package/dist/chunk-yscr04dv.js +0 -2
  209. package/dist/chunk-z8j2sbnb.js +0 -2
  210. package/dist/chunk-z8p6tk5z.js +0 -2
  211. package/dist/chunk-zhf01af3.js +0 -3
  212. package/dist/chunk-zp9k5pha.js +0 -2
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{M,I,vr,wr,xr}from"./chunk-hvzzhkhr.js";import{resolve as k,basename as J,extname as K,join as Y}from"path";import{mkdir as Z}from"fs/promises";var N={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:2000,cacheTranscoded:!0,cacheThumbnails:!0,cacheManifests:!0};class ei{config;constructor(t={}){this.config={...N,...t}}async get(t,e){return vr(t,e,"video",this.config)}async set(t,e,a){return wr(t,e,a,"video",this.config)}async clear(){return xr("video",this.config)}updateConfig(t){this.config={...this.config,...t}}}var V=null;function T(t){if(!V)V=new ei(t);else if(t)V.updateConfig(t);return V}async function ti(t,e,a){let c=a?{directory:`${a.outputDir}/../.cache`}:{};return T(c).get(t,e)}async function ni(t,e,a,c){let r=c?{directory:`${c.outputDir}/../.cache`}:{};return T(r).set(t,e,a)}async function _u(){return T().clear()}import{resolve as B,basename as _,extname as D,join as v}from"path";import{mkdir as A}from"fs/promises";async function L(){try{return await import("ts-videos")}catch{return null}}async function ri(t,e,a,c){let r=await L();if(!r)return console.warn("[stx-media] ts-videos not installed, cannot generate poster"),null;try{let n=B(t);if(!await I(n))return null;await A(a,{recursive:!0});let i=await M(n),s=_(t,D(t)),o=e.format||"webp",h=e.timestamp||0,y=`${s}-poster-${i}.${o}`,u=v(a,y),m=await r.extractThumbnails(n,{timestamps:[h],width:e.width||1280,height:e.height,format:o,quality:e.quality||85,outputDir:a,outputPattern:y.replace(`.${o}`,"")});if(m&&m.length>0){let d=m[0];return{path:u,url:`${c}/${y}`,width:d.width||e.width||1280,height:d.height||720,timestamp:h,size:d.size||0}}return null}catch(n){return console.warn(`[stx-media] Failed to generate poster: ${n}`),null}}async function si(t,e,a,c){let r=await L();if(!r)return[];try{let n=B(t);if(!await I(n))return[];await A(a,{recursive:!0});let i=await M(n),s=_(t,D(t)),o=e.format||"webp",u=(await new r.Input(n).getInfo()).duration||60,m=e.count||10,d=e.interval||u/m,g=[];for(let f=0;f<m&&f*d<u;f++)g.push(f*d);let l=await r.extractThumbnails(n,{timestamps:g,width:e.width||320,format:o,quality:e.quality||80,outputDir:a,outputPattern:`${s}-thumb-${i}`});if(l&&l.length>0)return l.map((f,b)=>({path:f.path||v(a,`${s}-thumb-${i}-${b}.${o}`),url:`${c}/${s}-thumb-${i}-${b}.${o}`,width:f.width||e.width||320,height:f.height||180,timestamp:g[b],size:f.size||0}));return[]}catch(n){return console.warn(`[stx-media] Failed to generate thumbnails: ${n}`),[]}}async function Cu(t,e,a,c){let r=await L();if(!r)return console.warn("[stx-media] ts-videos not installed, cannot generate sprite sheet"),null;try{let n=B(t);if(!await I(n))return null;await A(a,{recursive:!0});let i=await M(n),s=_(t,D(t)),y=(await new r.Input(n).getInfo()).duration||60,u=e.columns||10,m=e.interval||5,d=e.thumbnailWidth||160,g=e.thumbnailHeight||90,l=e.format||"jpeg",f=Math.ceil(y/m),b=Math.ceil(f/u),S=`${s}-sprite-${i}.${l}`,w=v(a,S),C=[];for(let P=0;P<f;P++)C.push(P*m);let p=await r.extractThumbnails(n,{timestamps:C,width:d,height:g,format:l,quality:e.quality||70,outputDir:v(a,".temp")});if(!p||p.length===0)return null;try{let P=await import("ts-images"),x=u*d,ie=b*g,re=await P.createSprite({images:p.map((U)=>U.path),columns:u,padding:0,outputPath:w,format:l,quality:e.quality||70});return{url:`${c}/${S}`,path:w,columns:u,rows:b,thumbnailWidth:d,thumbnailHeight:g,interval:m,totalFrames:f}}catch{return console.warn("[stx-media] ts-images not installed, sprite sheet generation skipped"),null}}catch(n){return console.warn(`[stx-media] Failed to generate sprite sheet: ${n}`),null}}import{resolve as F,basename as W,extname as q,join as R}from"path";import{mkdir as H,writeFile as z}from"fs/promises";async function j(){try{return await import("ts-videos")}catch{return null}}var Q=[{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 oi(t,e,a,c,r){let n=await j();if(!n)return console.warn("[stx-media] ts-videos not installed, cannot generate HLS manifest"),null;try{let i=F(t);if(!await I(i))return null;let s=await M(i),o=W(t,q(t)),h=R(a,`${o}-${s}-hls`);await H(h,{recursive:!0});let y=e.length>0?e:Q,u=r?.segmentDuration||6,g=(await new n.Input(i).getInfo()).duration||0,l=[],f=0;for(let w of y){let C=R(h,w.label);await H(C,{recursive:!0});let p=`${w.label}.m3u8`,P=R(C,p);try{let x=await n.generateHLS(i,{outputDir:C,segmentDuration:u,width:w.width,height:w.height,videoBitrate:w.bitrate,audioBitrate:w.audioBitrate,playlistName:w.label});if(x)l.push({quality:w,url:`${c}/${o}-${s}-hls/${w.label}/${p}`,path:P}),f+=x.segmentCount||Math.ceil(g/u)}catch(x){console.warn(`[stx-media] Failed to generate HLS for ${w.label}: ${x}`)}}if(l.length===0)return null;let b=R(h,"master.m3u8"),S=X(l,c,o,s);return await z(b,S),{manifestUrl:`${c}/${o}-${s}-hls/master.m3u8`,manifestPath:b,playlists:l,segmentCount:f,duration:g}}catch(i){return console.warn(`[stx-media] Failed to generate HLS manifest: ${i}`),null}}function X(t,e,a,c){let r=["#EXTM3U","#EXT-X-VERSION:3"];for(let n of t){let{quality:i}=n,s=i.bitrate+(i.audioBitrate||128000),o=`${i.width}x${i.height||Math.round(i.width*9/16)}`;r.push(`#EXT-X-STREAM-INF:BANDWIDTH=${s},RESOLUTION=${o},NAME="${i.label}"`,`${i.label}/${i.label}.m3u8`)}return r.join(`
3
- `)}async function ii(t,e,a,c,r){let n=await j();if(!n)return console.warn("[stx-media] ts-videos not installed, cannot generate DASH manifest"),null;try{let i=F(t);if(!await I(i))return null;let s=await M(i),o=W(t,q(t)),h=R(a,`${o}-${s}-dash`);await H(h,{recursive:!0});let y=e.length>0?e:Q,u=r?.segmentDuration||4,m=r?.minBufferTime||2,l=(await new n.Input(i).getInfo()).duration||0,f=[],b=[];for(let p of y){let P=R(h,p.label);await H(P,{recursive:!0});try{if(await n.generateDASH(i,{outputDir:P,segmentDuration:u,width:p.width,height:p.height,videoBitrate:p.bitrate,audioBitrate:p.audioBitrate})){if(f.push({bandwidth:p.bitrate,width:p.width,height:p.height||Math.round(p.width*9/16),url:`${c}/${o}-${s}-dash/${p.label}/video`}),p.audioBitrate)b.push({bandwidth:p.audioBitrate,url:`${c}/${o}-${s}-dash/${p.label}/audio`})}}catch(x){console.warn(`[stx-media] Failed to generate DASH for ${p.label}: ${x}`)}}if(f.length===0)return null;let S=R(h,"manifest.mpd"),w=G(f,b,l,u,m);await z(S,w);let C=[{type:"video",representations:f}];if(b.length>0)C.push({type:"audio",representations:b});return{manifestUrl:`${c}/${o}-${s}-dash/manifest.mpd`,manifestPath:S,adaptationSets:C,duration:l}}catch(i){return console.warn(`[stx-media] Failed to generate DASH manifest: ${i}`),null}}function G(t,e,a,c,r){let n=E(a),i=E(r),s=`<?xml version="1.0" encoding="UTF-8"?>
2
+ import{M,I,wr,xr,Sr}from"./chunk-thceyzj6.js";import{resolve as k,basename as J,extname as K,join as Y}from"path";import{mkdir as Z}from"fs/promises";var N={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:2000,cacheTranscoded:!0,cacheThumbnails:!0,cacheManifests:!0};class ti{config;constructor(t={}){this.config={...N,...t}}async get(t,e){return wr(t,e,"video",this.config)}async set(t,e,a){return xr(t,e,a,"video",this.config)}async clear(){return Sr("video",this.config)}updateConfig(t){this.config={...this.config,...t}}}var V=null;function T(t){if(!V)V=new ti(t);else if(t)V.updateConfig(t);return V}async function ni(t,e,a){let c=a?{directory:`${a.outputDir}/../.cache`}:{};return T(c).get(t,e)}async function ri(t,e,a,c){let r=c?{directory:`${c.outputDir}/../.cache`}:{};return T(r).set(t,e,a)}async function Cu(){return T().clear()}import{resolve as B,basename as _,extname as D,join as v}from"path";import{mkdir as A}from"fs/promises";async function L(){try{return await import("ts-videos")}catch{return null}}async function si(t,e,a,c){let r=await L();if(!r)return console.warn("[stx-media] ts-videos not installed, cannot generate poster"),null;try{let n=B(t);if(!await I(n))return null;await A(a,{recursive:!0});let i=await M(n),s=_(t,D(t)),o=e.format||"webp",h=e.timestamp||0,y=`${s}-poster-${i}.${o}`,u=v(a,y),m=await r.extractThumbnails(n,{timestamps:[h],width:e.width||1280,height:e.height,format:o,quality:e.quality||85,outputDir:a,outputPattern:y.replace(`.${o}`,"")});if(m&&m.length>0){let d=m[0];return{path:u,url:`${c}/${y}`,width:d.width||e.width||1280,height:d.height||720,timestamp:h,size:d.size||0}}return null}catch(n){return console.warn(`[stx-media] Failed to generate poster: ${n}`),null}}async function oi(t,e,a,c){let r=await L();if(!r)return[];try{let n=B(t);if(!await I(n))return[];await A(a,{recursive:!0});let i=await M(n),s=_(t,D(t)),o=e.format||"webp",u=(await new r.Input(n).getInfo()).duration||60,m=e.count||10,d=e.interval||u/m,g=[];for(let f=0;f<m&&f*d<u;f++)g.push(f*d);let l=await r.extractThumbnails(n,{timestamps:g,width:e.width||320,format:o,quality:e.quality||80,outputDir:a,outputPattern:`${s}-thumb-${i}`});if(l&&l.length>0)return l.map((f,b)=>({path:f.path||v(a,`${s}-thumb-${i}-${b}.${o}`),url:`${c}/${s}-thumb-${i}-${b}.${o}`,width:f.width||e.width||320,height:f.height||180,timestamp:g[b],size:f.size||0}));return[]}catch(n){return console.warn(`[stx-media] Failed to generate thumbnails: ${n}`),[]}}async function Eu(t,e,a,c){let r=await L();if(!r)return console.warn("[stx-media] ts-videos not installed, cannot generate sprite sheet"),null;try{let n=B(t);if(!await I(n))return null;await A(a,{recursive:!0});let i=await M(n),s=_(t,D(t)),y=(await new r.Input(n).getInfo()).duration||60,u=e.columns||10,m=e.interval||5,d=e.thumbnailWidth||160,g=e.thumbnailHeight||90,l=e.format||"jpeg",f=Math.ceil(y/m),b=Math.ceil(f/u),S=`${s}-sprite-${i}.${l}`,w=v(a,S),C=[];for(let P=0;P<f;P++)C.push(P*m);let p=await r.extractThumbnails(n,{timestamps:C,width:d,height:g,format:l,quality:e.quality||70,outputDir:v(a,".temp")});if(!p||p.length===0)return null;try{let P=await import("ts-images"),x=u*d,ie=b*g,re=await P.createSprite({images:p.map((U)=>U.path),columns:u,padding:0,outputPath:w,format:l,quality:e.quality||70});return{url:`${c}/${S}`,path:w,columns:u,rows:b,thumbnailWidth:d,thumbnailHeight:g,interval:m,totalFrames:f}}catch{return console.warn("[stx-media] ts-images not installed, sprite sheet generation skipped"),null}}catch(n){return console.warn(`[stx-media] Failed to generate sprite sheet: ${n}`),null}}import{resolve as F,basename as W,extname as q,join as R}from"path";import{mkdir as H,writeFile as z}from"fs/promises";async function j(){try{return await import("ts-videos")}catch{return null}}var Q=[{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 ii(t,e,a,c,r){let n=await j();if(!n)return console.warn("[stx-media] ts-videos not installed, cannot generate HLS manifest"),null;try{let i=F(t);if(!await I(i))return null;let s=await M(i),o=W(t,q(t)),h=R(a,`${o}-${s}-hls`);await H(h,{recursive:!0});let y=e.length>0?e:Q,u=r?.segmentDuration||6,g=(await new n.Input(i).getInfo()).duration||0,l=[],f=0;for(let w of y){let C=R(h,w.label);await H(C,{recursive:!0});let p=`${w.label}.m3u8`,P=R(C,p);try{let x=await n.generateHLS(i,{outputDir:C,segmentDuration:u,width:w.width,height:w.height,videoBitrate:w.bitrate,audioBitrate:w.audioBitrate,playlistName:w.label});if(x)l.push({quality:w,url:`${c}/${o}-${s}-hls/${w.label}/${p}`,path:P}),f+=x.segmentCount||Math.ceil(g/u)}catch(x){console.warn(`[stx-media] Failed to generate HLS for ${w.label}: ${x}`)}}if(l.length===0)return null;let b=R(h,"master.m3u8"),S=X(l,c,o,s);return await z(b,S),{manifestUrl:`${c}/${o}-${s}-hls/master.m3u8`,manifestPath:b,playlists:l,segmentCount:f,duration:g}}catch(i){return console.warn(`[stx-media] Failed to generate HLS manifest: ${i}`),null}}function X(t,e,a,c){let r=["#EXTM3U","#EXT-X-VERSION:3"];for(let n of t){let{quality:i}=n,s=i.bitrate+(i.audioBitrate||128000),o=`${i.width}x${i.height||Math.round(i.width*9/16)}`;r.push(`#EXT-X-STREAM-INF:BANDWIDTH=${s},RESOLUTION=${o},NAME="${i.label}"`,`${i.label}/${i.label}.m3u8`)}return r.join(`
3
+ `)}async function ai(t,e,a,c,r){let n=await j();if(!n)return console.warn("[stx-media] ts-videos not installed, cannot generate DASH manifest"),null;try{let i=F(t);if(!await I(i))return null;let s=await M(i),o=W(t,q(t)),h=R(a,`${o}-${s}-dash`);await H(h,{recursive:!0});let y=e.length>0?e:Q,u=r?.segmentDuration||4,m=r?.minBufferTime||2,l=(await new n.Input(i).getInfo()).duration||0,f=[],b=[];for(let p of y){let P=R(h,p.label);await H(P,{recursive:!0});try{if(await n.generateDASH(i,{outputDir:P,segmentDuration:u,width:p.width,height:p.height,videoBitrate:p.bitrate,audioBitrate:p.audioBitrate})){if(f.push({bandwidth:p.bitrate,width:p.width,height:p.height||Math.round(p.width*9/16),url:`${c}/${o}-${s}-dash/${p.label}/video`}),p.audioBitrate)b.push({bandwidth:p.audioBitrate,url:`${c}/${o}-${s}-dash/${p.label}/audio`})}}catch(x){console.warn(`[stx-media] Failed to generate DASH for ${p.label}: ${x}`)}}if(f.length===0)return null;let S=R(h,"manifest.mpd"),w=G(f,b,l,u,m);await z(S,w);let C=[{type:"video",representations:f}];if(b.length>0)C.push({type:"audio",representations:b});return{manifestUrl:`${c}/${o}-${s}-dash/manifest.mpd`,manifestPath:S,adaptationSets:C,duration:l}}catch(i){return console.warn(`[stx-media] Failed to generate DASH manifest: ${i}`),null}}function G(t,e,a,c,r){let n=E(a),i=E(r),s=`<?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"
6
6
  xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd"
@@ -26,4 +26,4 @@ import{M,I,vr,wr,xr}from"./chunk-hvzzhkhr.js";import{resolve as k,basename as J,
26
26
  </Representation>
27
27
  `}s+=` </AdaptationSet>
28
28
  `}return s+=` </Period>
29
- </MPD>`,s}function E(t){let e=Math.floor(t/3600),a=Math.floor(t%3600/60),c=Math.floor(t%60),r="PT";if(e>0)r+=`${e}H`;if(a>0)r+=`${a}M`;return r+=`${c}S`,r}async function O(){try{return await import("ts-videos")}catch{return null}}function ee(t){switch(t){case"very-low":return 500000;case"low":return 1e6;case"medium":return 2500000;case"high":return 5000000;case"very-high":return 1e7;case"lossless":return 0;default:return 2500000}}function te(t){switch(t){case"youtube":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};case"twitter":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"instagram-feed":return{codec:"h264",maxWidth:1080,maxHeight:1080,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"instagram-story":case"instagram-reels":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"tiktok":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"discord":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:60,bitrate:8000000,audioCodec:"aac",audioBitrate:192000};case"linkedin":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"facebook":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"web-progressive":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000,twoPass:!0};case"web-streaming":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};default:return{}}}async function wc(t){let e=await O();if(!e)return null;try{let a=k(t),r=await new e.Input(a).getInfo();return{duration:r.duration||0,width:r.width||0,height:r.height||0,frameRate:r.frameRate||0,bitrate:r.bitrate||0,codec:r.videoCodec||"",audioCodec:r.audioCodec}}catch(a){return console.warn(`[stx-media] Failed to analyze video: ${a}`),null}}async function Eu(t,e,a,c){let r=await O();if(!r)return console.warn("[stx-media] ts-videos not installed, skipping processing"),{src:t,processed:!1};let n=await ti(t,e,a);if(n)return n;try{let i=k(t);if(!await I(i))return{src:t,processed:!1,errors:[`Source file not found: ${t}`]};let s=a.outputDir||"dist/videos",o=a.baseUrl||"/videos";await Z(s,{recursive:!0});let h=await M(i),y=J(t,K(t)),u={src:t,processed:!0,hash:h};c?.({percentage:5,stage:"analyzing"}),u.metadata=await wc(i)||void 0;let m={};if(e.quality)m.bitrate=ee(e.quality);if(e.platform)Object.assign(m,te(e.platform));if(e.transcode)Object.assign(m,e.transcode);if(Object.keys(m).length>0||e.process){c?.({percentage:10,stage:"transcoding"});let d=`${y}-${h}.mp4`,g=Y(s,d);try{let l=await ae(i,g,m,r,(f)=>c?.({percentage:10+f*0.5,stage:"transcoding"}));if(l)u.transcoded={path:g,url:`${o}/${d}`,duration:l.duration,size:l.size,video:{codec:m.codec||"h264",width:l.width,height:l.height,bitrate:l.bitrate,frameRate:l.frameRate},audio:l.audioCodec?{codec:m.audioCodec||"aac",bitrate:m.audioBitrate||128000,sampleRate:m.sampleRate||48000,channels:m.channels||2}:void 0}}catch(l){u.errors=u.errors||[],u.errors.push(`Transcoding failed: ${l}`)}}if(e.generatePoster){c?.({percentage:65,stage:"generating-poster"});let d=typeof e.generatePoster==="object"?e.generatePoster:{timestamp:0},g=await ri(i,d,s,o);if(g)u.poster=g}if(a.thumbnails?.enabled){c?.({percentage:70,stage:"generating-thumbnails"});let d=await si(i,a.thumbnails,s,o);if(d.length>0)u.thumbnails=d}if(e.streaming){c?.({percentage:80,stage:"generating-manifests"});let d=typeof e.streaming==="object"?e.streaming:a.streaming||{format:"hls"};if(d.format==="hls"||d.format===void 0){let g=await oi(i,d.qualities||a.streaming?.defaultQualities||[],s,o);if(g)u.streaming={...u.streaming,hls:g}}if(d.format==="dash"){let g=await ii(i,d.qualities||a.streaming?.defaultQualities||[],s,o);if(g)u.streaming={...u.streaming,dash:g}}}if(e.spriteSheet)c?.({percentage:90,stage:"generating-sprite-sheet"});return c?.({percentage:100,stage:"complete"}),await ni(t,e,u,a),u}catch(i){return{src:t,processed:!1,errors:[`Processing failed: ${i}`]}}}async function ae(t,e,a,c,r){try{let i=await new c.Conversion(t,e,{videoCodec:a.codec,videoBitrate:a.bitrate,width:a.maxWidth,height:a.maxHeight,frameRate:a.frameRate,audioCodec:a.audioCodec,audioBitrate:a.audioBitrate,sampleRate:a.sampleRate,channels:a.channels}).run((s)=>{r?.(s.percentage/100)});return{duration:i.duration||0,size:i.size||0,width:i.width||a.maxWidth||0,height:i.height||a.maxHeight||0,bitrate:i.bitrate||a.bitrate||0,frameRate:i.frameRate||a.frameRate||30,audioCodec:i.audioCodec}}catch(n){return console.error(`[stx-media] Transcoding failed: ${n}`),null}}export{ei,ti,ni,_u,ri,si,Cu,oi,ii,wc,Eu};
29
+ </MPD>`,s}function E(t){let e=Math.floor(t/3600),a=Math.floor(t%3600/60),c=Math.floor(t%60),r="PT";if(e>0)r+=`${e}H`;if(a>0)r+=`${a}M`;return r+=`${c}S`,r}async function O(){try{return await import("ts-videos")}catch{return null}}function ee(t){switch(t){case"very-low":return 500000;case"low":return 1e6;case"medium":return 2500000;case"high":return 5000000;case"very-high":return 1e7;case"lossless":return 0;default:return 2500000}}function te(t){switch(t){case"youtube":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};case"twitter":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"instagram-feed":return{codec:"h264",maxWidth:1080,maxHeight:1080,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"instagram-story":case"instagram-reels":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:3500000,audioCodec:"aac",audioBitrate:128000};case"tiktok":return{codec:"h264",maxWidth:1080,maxHeight:1920,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"discord":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:60,bitrate:8000000,audioCodec:"aac",audioBitrate:192000};case"linkedin":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,bitrate:5000000,audioCodec:"aac",audioBitrate:128000};case"facebook":return{codec:"h264",maxWidth:1280,maxHeight:720,frameRate:30,bitrate:4000000,audioCodec:"aac",audioBitrate:128000};case"web-progressive":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000,twoPass:!0};case"web-streaming":return{codec:"h264",maxWidth:1920,maxHeight:1080,frameRate:30,audioCodec:"aac",audioBitrate:128000};default:return{}}}async function xc(t){let e=await O();if(!e)return null;try{let a=k(t),r=await new e.Input(a).getInfo();return{duration:r.duration||0,width:r.width||0,height:r.height||0,frameRate:r.frameRate||0,bitrate:r.bitrate||0,codec:r.videoCodec||"",audioCodec:r.audioCodec}}catch(a){return console.warn(`[stx-media] Failed to analyze video: ${a}`),null}}async function Tu(t,e,a,c){let r=await O();if(!r)return console.warn("[stx-media] ts-videos not installed, skipping processing"),{src:t,processed:!1};let n=await ni(t,e,a);if(n)return n;try{let i=k(t);if(!await I(i))return{src:t,processed:!1,errors:[`Source file not found: ${t}`]};let s=a.outputDir||"dist/videos",o=a.baseUrl||"/videos";await Z(s,{recursive:!0});let h=await M(i),y=J(t,K(t)),u={src:t,processed:!0,hash:h};c?.({percentage:5,stage:"analyzing"}),u.metadata=await xc(i)||void 0;let m={};if(e.quality)m.bitrate=ee(e.quality);if(e.platform)Object.assign(m,te(e.platform));if(e.transcode)Object.assign(m,e.transcode);if(Object.keys(m).length>0||e.process){c?.({percentage:10,stage:"transcoding"});let d=`${y}-${h}.mp4`,g=Y(s,d);try{let l=await ae(i,g,m,r,(f)=>c?.({percentage:10+f*0.5,stage:"transcoding"}));if(l)u.transcoded={path:g,url:`${o}/${d}`,duration:l.duration,size:l.size,video:{codec:m.codec||"h264",width:l.width,height:l.height,bitrate:l.bitrate,frameRate:l.frameRate},audio:l.audioCodec?{codec:m.audioCodec||"aac",bitrate:m.audioBitrate||128000,sampleRate:m.sampleRate||48000,channels:m.channels||2}:void 0}}catch(l){u.errors=u.errors||[],u.errors.push(`Transcoding failed: ${l}`)}}if(e.generatePoster){c?.({percentage:65,stage:"generating-poster"});let d=typeof e.generatePoster==="object"?e.generatePoster:{timestamp:0},g=await si(i,d,s,o);if(g)u.poster=g}if(a.thumbnails?.enabled){c?.({percentage:70,stage:"generating-thumbnails"});let d=await oi(i,a.thumbnails,s,o);if(d.length>0)u.thumbnails=d}if(e.streaming){c?.({percentage:80,stage:"generating-manifests"});let d=typeof e.streaming==="object"?e.streaming:a.streaming||{format:"hls"};if(d.format==="hls"||d.format===void 0){let g=await ii(i,d.qualities||a.streaming?.defaultQualities||[],s,o);if(g)u.streaming={...u.streaming,hls:g}}if(d.format==="dash"){let g=await ai(i,d.qualities||a.streaming?.defaultQualities||[],s,o);if(g)u.streaming={...u.streaming,dash:g}}}if(e.spriteSheet)c?.({percentage:90,stage:"generating-sprite-sheet"});return c?.({percentage:100,stage:"complete"}),await ri(t,e,u,a),u}catch(i){return{src:t,processed:!1,errors:[`Processing failed: ${i}`]}}}async function ae(t,e,a,c,r){try{let i=await new c.Conversion(t,e,{videoCodec:a.codec,videoBitrate:a.bitrate,width:a.maxWidth,height:a.maxHeight,frameRate:a.frameRate,audioCodec:a.audioCodec,audioBitrate:a.audioBitrate,sampleRate:a.sampleRate,channels:a.channels}).run((s)=>{r?.(s.percentage/100)});return{duration:i.duration||0,size:i.size||0,width:i.width||a.maxWidth||0,height:i.height||a.maxHeight||0,bitrate:i.bitrate||a.bitrate||0,frameRate:i.frameRate||a.frameRate||30,audioCodec:i.audioCodec}}catch(n){return console.error(`[stx-media] Transcoding failed: ${n}`),null}}export{ti,ni,ri,Cu,si,oi,Eu,ii,ai,xc,Tu};
@@ -1,8 +1,8 @@
1
1
  // @bun
2
- import d from"fs";import l from"path";function mc(n){let s=[],e=n.pwa;if(s.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:e?.enabled===!0,message:e?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!e?.enabled)return s;s.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(e.manifest?.name),message:e.manifest?.name?`App name: "${e.manifest.name}"`:"Missing required manifest name"}),s.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(e.manifest?.shortName),message:e.manifest?.shortName?`Short name: "${e.manifest.shortName}"`:"Short name not set (will use full name)"}),s.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(e.manifest?.description),message:e.manifest?.description?"Description is set":"App description not provided"}),s.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(e.manifest?.themeColor),message:e.manifest?.themeColor?`Theme color: ${e.manifest.themeColor}`:"Theme color not set"}),s.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(e.manifest?.backgroundColor),message:e.manifest?.backgroundColor?`Background color: ${e.manifest.backgroundColor}`:"Background color not set"}),s.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(e.manifest?.display||""),message:e.manifest?.display?`Display mode: ${e.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),s.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(e.manifest?.startUrl),message:e.manifest?.startUrl?`Start URL: ${e.manifest.startUrl}`:"Start URL not set"}),s.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(e.icons?.src),message:e.icons?.src?`Icon source: ${e.icons.src}`:"No icon source configured"});let a=e.icons?.sizes||[];s.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:a.includes(192),message:a.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),s.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:a.includes(512),message:a.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),s.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:e.icons?.purpose?.includes("maskable")||!1,message:e.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),s.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(e.serviceWorker),message:e.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),s.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(e.serviceWorker?.cacheVersion),message:e.serviceWorker?.cacheVersion?`Cache version: ${e.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),s.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:e.offline?.enabled===!0,message:e.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let t=e.routes||[];return s.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:t.length>0,message:t.length>0?`${t.length} route caching strategies configured`:"No custom caching strategies defined"}),s.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!e.push?.enabled||Boolean(e.push?.vapidPublicKey),message:e.push?.enabled?e.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),s.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:e.shareTarget?.enabled?`Share target enabled at ${e.shareTarget.action}`:"Share target not enabled"}),s.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:e.autoInject!==!1,message:e.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),s}function hc(n){let s=[],e=l.join(n,"manifest.json"),a=d.existsSync(e);if(s.push({id:"build-manifest",name:"Manifest File",category:"required",passed:a,message:a?"manifest.json exists":"manifest.json not found in build output"}),a)try{let r=JSON.parse(d.readFileSync(e,"utf-8"));s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),s.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(r.icons)&&r.icons.length>0,message:r.icons?.length?`${r.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let t=l.join(n,"sw.js"),c=d.existsSync(t);s.push({id:"build-sw",name:"Service Worker File",category:"required",passed:c,message:c?"Service worker (sw.js) exists":"Service worker not found in build output"});let o=l.join(n,"offline.html"),u=d.existsSync(o);s.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:u,message:u?"Offline page exists":"No offline.html found"});let i=l.join(n,"pwa-icons");if(d.existsSync(i)){let r=d.readdirSync(i).filter((m)=>m.endsWith(".png")||m.endsWith(".webp"));s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:r.length>0,message:r.length>0?`${r.length} icon files generated`:"No icon files found"})}else s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return s}function yc(n){let s=n.filter((i)=>i.category==="required"),e=n.filter((i)=>i.category==="recommended"),a=s.filter((i)=>i.passed).length,t=e.filter((i)=>i.passed).length,c=s.length>0?a/s.length*70:70,o=e.length>0?t/e.length*30:30;return{score:Math.round(c+o),passed:n.filter((i)=>i.passed).length,failed:n.filter((i)=>!i.passed&&i.category==="required").length,warnings:n.filter((i)=>!i.passed&&i.category!=="required").length,checks:n}}function lu(n,s){let e=mc(n),a=s&&d.existsSync(s)?hc(s):[];return yc([...e,...a])}function uu(n){let s=[];s.push(`
2
+ import d from"fs";import l from"path";function hc(n){let s=[],e=n.pwa;if(s.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:e?.enabled===!0,message:e?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!e?.enabled)return s;s.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(e.manifest?.name),message:e.manifest?.name?`App name: "${e.manifest.name}"`:"Missing required manifest name"}),s.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(e.manifest?.shortName),message:e.manifest?.shortName?`Short name: "${e.manifest.shortName}"`:"Short name not set (will use full name)"}),s.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(e.manifest?.description),message:e.manifest?.description?"Description is set":"App description not provided"}),s.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(e.manifest?.themeColor),message:e.manifest?.themeColor?`Theme color: ${e.manifest.themeColor}`:"Theme color not set"}),s.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(e.manifest?.backgroundColor),message:e.manifest?.backgroundColor?`Background color: ${e.manifest.backgroundColor}`:"Background color not set"}),s.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(e.manifest?.display||""),message:e.manifest?.display?`Display mode: ${e.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),s.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(e.manifest?.startUrl),message:e.manifest?.startUrl?`Start URL: ${e.manifest.startUrl}`:"Start URL not set"}),s.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(e.icons?.src),message:e.icons?.src?`Icon source: ${e.icons.src}`:"No icon source configured"});let a=e.icons?.sizes||[];s.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:a.includes(192),message:a.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),s.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:a.includes(512),message:a.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),s.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:e.icons?.purpose?.includes("maskable")||!1,message:e.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),s.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(e.serviceWorker),message:e.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),s.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(e.serviceWorker?.cacheVersion),message:e.serviceWorker?.cacheVersion?`Cache version: ${e.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),s.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:e.offline?.enabled===!0,message:e.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let t=e.routes||[];return s.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:t.length>0,message:t.length>0?`${t.length} route caching strategies configured`:"No custom caching strategies defined"}),s.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!e.push?.enabled||Boolean(e.push?.vapidPublicKey),message:e.push?.enabled?e.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),s.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:e.shareTarget?.enabled?`Share target enabled at ${e.shareTarget.action}`:"Share target not enabled"}),s.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:e.autoInject!==!1,message:e.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),s}function yc(n){let s=[],e=l.join(n,"manifest.json"),a=d.existsSync(e);if(s.push({id:"build-manifest",name:"Manifest File",category:"required",passed:a,message:a?"manifest.json exists":"manifest.json not found in build output"}),a)try{let r=JSON.parse(d.readFileSync(e,"utf-8"));s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),s.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(r.icons)&&r.icons.length>0,message:r.icons?.length?`${r.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{s.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let t=l.join(n,"sw.js"),c=d.existsSync(t);s.push({id:"build-sw",name:"Service Worker File",category:"required",passed:c,message:c?"Service worker (sw.js) exists":"Service worker not found in build output"});let o=l.join(n,"offline.html"),u=d.existsSync(o);s.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:u,message:u?"Offline page exists":"No offline.html found"});let i=l.join(n,"pwa-icons");if(d.existsSync(i)){let r=d.readdirSync(i).filter((m)=>m.endsWith(".png")||m.endsWith(".webp"));s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:r.length>0,message:r.length>0?`${r.length} icon files generated`:"No icon files found"})}else s.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return s}function bc(n){let s=n.filter((i)=>i.category==="required"),e=n.filter((i)=>i.category==="recommended"),a=s.filter((i)=>i.passed).length,t=e.filter((i)=>i.passed).length,c=s.length>0?a/s.length*70:70,o=e.length>0?t/e.length*30:30;return{score:Math.round(c+o),passed:n.filter((i)=>i.passed).length,failed:n.filter((i)=>!i.passed&&i.category==="required").length,warnings:n.filter((i)=>!i.passed&&i.category!=="required").length,checks:n}}function uu(n,s){let e=hc(n),a=s&&d.existsSync(s)?yc(s):[];return bc([...e,...a])}function du(n){let s=[];s.push(`
3
3
  === PWA Audit Report ===
4
4
  `);let e=n.score>=90?"32":n.score>=70?"33":"31";s.push(`Score: \x1B[${e}m${n.score}/100\x1B[0m`),s.push(`Passed: ${n.passed} | Failed: ${n.failed} | Warnings: ${n.warnings}
5
5
  `);let a=["required","recommended","optional"];for(let t of a){let c=n.checks.filter((o)=>o.category===t);if(c.length===0)continue;s.push(`
6
6
  ${t.toUpperCase()}:`);for(let o of c){let u=o.passed?"\x1B[32m\u2713\x1B[0m":"\x1B[31m\u2717\x1B[0m";if(s.push(` ${u} ${o.name}: ${o.message}`),o.details)s.push(` ${o.details}`)}}return s.push(""),s.join(`
7
7
  `)}
8
- export{mc,hc,yc,lu,uu};
8
+ export{hc,yc,bc,uu,du};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
2
  import m from"path";var y=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function I(...o){let r=new Set;for(let s of o){if(!s||!s.includes("__stxModules["))continue;for(let e of s.matchAll(y))try{r.add(JSON.parse(`"${e[1]}"`))}catch{}}return[...r].sort()}async function w(o,r={}){if(o.length===0)return null;let s=process.cwd(),e=[],a=[];o.forEach((t,c)=>{let i=t.startsWith("npm:")?t.slice(4):m.resolve(s,t),l=`__stxRegistered${c}`,p=JSON.stringify(t);e.push(`import * as ${l} from ${JSON.stringify(i)};`),a.push(`if (!globalThis.__stxModules[${p}]) globalThis.__stxModules[${p}] = ${l};`)});let d=[...e,"globalThis.__stxModules = globalThis.__stxModules || {};",...a].join(`
3
- `),n;try{let{bundleClientScript:t}=await import("./chunk-wz6368p4.js");n=await t(d,m.join(s,".stx-module-registry.ts"),{projectRoot:s,minify:r.minify,externalizeUserModules:!1,collectInputs:r.collectInputs,throwOnFailure:!0})}catch(t){let{formatBuildFailure:c}=await import("./chunk-280p4q7a.js"),i=c(t);console.warn(`[stx] could not build the page module registry (#1957): ${i}`);let l=`[stx] the page module registry did not build, so ${o.join(", ")} cannot load (#1957): ${i}`;return`;console.error(${JSON.stringify(l)});`}let{transformAutoImports:f,generateAutoImportDestructuring:_}=await import("./chunk-d6en3vz7.js"),u=f(n),h=_(u.stxImports,u.browserImports),{transformStoreImports:x}=await import("./chunk-hvtzw1jh.js");n=x(u.code);let g=JSON.stringify(new Bun.CryptoHasher("md5").update(d).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${g}]) return;`,` __stxBundles[${g}] = true;`,h,n,"})();"].join(`
3
+ `),n;try{let{bundleClientScript:t}=await import("./chunk-2a775q7x.js");n=await t(d,m.join(s,".stx-module-registry.ts"),{projectRoot:s,minify:r.minify,externalizeUserModules:!1,collectInputs:r.collectInputs,throwOnFailure:!0})}catch(t){let{formatBuildFailure:c}=await import("./chunk-280p4q7a.js"),i=c(t);console.warn(`[stx] could not build the page module registry (#1957): ${i}`);let l=`[stx] the page module registry did not build, so ${o.join(", ")} cannot load (#1957): ${i}`;return`;console.error(${JSON.stringify(l)});`}let{transformAutoImports:f,generateAutoImportDestructuring:_}=await import("./chunk-w8t31bn9.js"),u=f(n),h=_(u.stxImports,u.browserImports),{transformStoreImports:x}=await import("./chunk-hvtzw1jh.js");n=x(u.code);let g=JSON.stringify(new Bun.CryptoHasher("md5").update(d).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${g}]) return;`,` __stxBundles[${g}] = true;`,h,n,"})();"].join(`
4
4
  `)}export{w as buildModuleRegistryScript,I as registeredModuleIdsIn};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{jt}from"./chunk-ecqrkyg8.js";function Cs(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=jt(e),i=`
2
+ import{jt}from"./chunk-6sjtyd0k.js";function Es(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=jt(e),i=`
3
3
  <!-- stx PWA Meta Tags -->
4
4
  <link rel="manifest" href="/manifest.json">
5
5
  <meta name="theme-color" content="${a(r?.themeColor||"#000000")}">
@@ -43,9 +43,9 @@ if ('serviceWorker' in navigator) {
43
43
  });
44
44
  }
45
45
  </script>
46
- <!-- End stx PWA -->`,i}function Xo(e,n){let r=n.pwa;if(!r?.enabled||r.autoInject===!1)return e;if(e.includes("<!-- stx PWA Meta Tags -->"))return e;if(!e.includes("</head>")){let o=e.lastIndexOf("</body>");if(o!==-1){let i=Cs(n);return e.slice(0,o)+i+`
47
- `+e.slice(o)}return e+Cs(n)}let t=Cs(n);return e.replace("</head>",`${t}
48
- </head>`)}function du(e){if(!e.pwa?.enabled)return"";return`<script>
46
+ <!-- End stx PWA -->`,i}function Jo(e,n){let r=n.pwa;if(!r?.enabled||r.autoInject===!1)return e;if(e.includes("<!-- stx PWA Meta Tags -->"))return e;if(!e.includes("</head>")){let o=e.lastIndexOf("</body>");if(o!==-1){let i=Es(n);return e.slice(0,o)+i+`
47
+ `+e.slice(o)}return e+Es(n)}let t=Es(n);return e.replace("</head>",`${t}
48
+ </head>`)}function pu(e){if(!e.pwa?.enabled)return"";return`<script>
49
49
  if ('serviceWorker' in navigator) {
50
50
  window.addEventListener('load', function() {
51
51
  navigator.serviceWorker.register('/${jt(e)}')
@@ -57,5 +57,5 @@ if ('serviceWorker' in navigator) {
57
57
  });
58
58
  });
59
59
  }
60
- </script>`}function pu(){return'<link rel="manifest" href="/manifest.json">'}function fu(e){return`<meta name="theme-color" content="${a(e)}">`}function a(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}
61
- export{Cs,Xo,du,pu,fu};
60
+ </script>`}function fu(){return'<link rel="manifest" href="/manifest.json">'}function gu(e){return`<meta name="theme-color" content="${a(e)}">`}function a(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}
61
+ export{Es,Jo,pu,fu,gu};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ts,jt,vc,mu}from"./chunk-6sjtyd0k.js";export{Ts as generateServiceWorker,mu as generateServiceWorkerAuto,jt as getServiceWorkerFileName,vc as isWorkboxEnabled};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Dr,qn,Sl}from"./chunk-xcsyqwxf.js";import"./chunk-v6peecfp.js";import"./chunk-40tswfe7.js";import"./chunk-twqzn21x.js";import"./chunk-hgry3mjd.js";import"./chunk-srq9fqq8.js";import"./chunk-rym0309c.js";import"./chunk-7adznted.js";import"./chunk-am2w363p.js";import"./chunk-5qtthtg3.js";import"./chunk-4s8zacxg.js";import{Tt}from"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{Sl as declareBareLoopHead,Tt as parseLoopBinding,qn as processLoops,Dr as reportDeferredLoopWarnings};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{gd}from"./chunk-faakv1p6.js";export{gd as processDeferDirectives};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{_l,Fr}from"./chunk-7j1zgrnf.js";import"./chunk-v6peecfp.js";import"./chunk-hgry3mjd.js";import{cr}from"./chunk-f9zyf9n6.js";import"./chunk-mwnhdsbp.js";import"./chunk-25zmy8q6.js";import{tt}from"./chunk-bsajk82t.js";import"./chunk-ce6zddpf.js";import"./chunk-zp79zkkd.js";export{tt as freeIdentifiers,Fr as processComponents,_l as processESImports,cr as rendersAsElement};