@stacksjs/stx 0.2.736 → 0.2.740
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-as108kr9.js → chunk-06jys4zk.js} +4 -4
- package/dist/{chunk-2t00wxz0.js → chunk-0ckh7cy1.js} +1 -1
- package/dist/{chunk-h1rq3935.js → chunk-0yewaggn.js} +6 -6
- package/dist/{chunk-hxy0qwqs.js → chunk-13tac9ac.js} +5 -5
- package/dist/chunk-1wak0s76.js +2 -0
- package/dist/{chunk-fv4s2yjf.js → chunk-26wrcfr7.js} +1 -1
- package/dist/{chunk-ez35607j.js → chunk-27agaezn.js} +2 -2
- package/dist/{chunk-nqfpvejh.js → chunk-2hrdh72h.js} +1 -1
- package/dist/chunk-2tt2whvk.js +2 -0
- package/dist/{chunk-j8r7r1wv.js → chunk-3f25fntg.js} +2 -2
- package/dist/chunk-3f4kf3fe.js +2 -0
- package/dist/{chunk-dnqzrktd.js → chunk-3kw9m62d.js} +2 -2
- package/dist/chunk-4yz476ss.js +2 -0
- package/dist/chunk-4z7bnc9j.js +2 -0
- package/dist/{chunk-pgz6yy2m.js → chunk-55qv90h9.js} +9 -9
- package/dist/{chunk-3fwdxxh1.js → chunk-5f6x6fyp.js} +4 -4
- package/dist/chunk-67xtpw2q.js +2 -0
- package/dist/chunk-6dz075xn.js +2 -0
- package/dist/{chunk-4c86wr9a.js → chunk-6ew10ptg.js} +2 -2
- package/dist/chunk-6vajjyj8.js +2 -0
- package/dist/chunk-75wdm7kd.js +2 -0
- package/dist/{chunk-x0014jes.js → chunk-7emrpfha.js} +6 -6
- package/dist/chunk-7vt4k3jv.js +2 -0
- package/dist/chunk-840t4gws.js +2 -0
- package/dist/{chunk-74fepz6h.js → chunk-888xnaex.js} +2 -2
- package/dist/{chunk-my4m7bk0.js → chunk-88kpnrgj.js} +1 -1
- package/dist/chunk-8bw9yd5m.js +2 -0
- package/dist/chunk-8nq4879f.js +2 -0
- package/dist/chunk-8qdrv49k.js +2 -0
- package/dist/{chunk-x9wwd2ee.js → chunk-91pycazt.js} +2 -2
- package/dist/{chunk-dhy6n39n.js → chunk-9bbs9d9q.js} +2 -2
- package/dist/{chunk-qf2aa8qe.js → chunk-9v98dzxt.js} +4 -4
- package/dist/{chunk-62awa752.js → chunk-9zrbhs3p.js} +1 -1
- package/dist/chunk-a0mze6dz.js +2 -0
- package/dist/chunk-af9ptz0x.js +2 -0
- package/dist/{chunk-s7q5wrsa.js → chunk-agxvydxe.js} +1 -1
- package/dist/chunk-aj6m4pqt.js +2 -0
- package/dist/{chunk-4hv1camf.js → chunk-amsbfc3y.js} +30 -30
- package/dist/{chunk-rj4j7qcj.js → chunk-amyxgejb.js} +1 -1
- package/dist/chunk-ascwd65c.js +2 -0
- package/dist/chunk-at0k9j3q.js +3 -0
- package/dist/{chunk-narz7105.js → chunk-b107z777.js} +2 -2
- package/dist/{chunk-1t0xwfy2.js → chunk-b4ejzx20.js} +18 -18
- package/dist/{chunk-agjysd2b.js → chunk-b8ryfxay.js} +1 -1
- package/dist/{chunk-xaddgvkx.js → chunk-byaasw3f.js} +2 -2
- package/dist/{chunk-630yrhzv.js → chunk-cka9p9v5.js} +2 -2
- package/dist/chunk-cmm2mkr1.js +2 -0
- package/dist/{chunk-3e40sm05.js → chunk-crk5dzxb.js} +4 -4
- package/dist/chunk-d4ahp771.js +2 -0
- package/dist/chunk-dw7ajrvf.js +2 -0
- package/dist/chunk-e2ar36jw.js +2 -0
- package/dist/{chunk-hez09ssh.js → chunk-e43cxztn.js} +2 -2
- package/dist/chunk-ejhd435r.js +2 -0
- package/dist/{chunk-r3j4m04w.js → chunk-eks1mjr3.js} +2 -2
- package/dist/chunk-eyekxtjn.js +2 -0
- package/dist/{chunk-6pqsf6tq.js → chunk-f17tdyp3.js} +5 -5
- package/dist/{chunk-hnmqnncv.js → chunk-f2yfe5e2.js} +1 -1
- package/dist/{chunk-jpfp8f5r.js → chunk-f6bpxqj9.js} +5 -5
- package/dist/{chunk-z7ry4w8w.js → chunk-fveqk208.js} +1 -1
- package/dist/{chunk-ph2yg39f.js → chunk-gwes6c9v.js} +1 -1
- package/dist/{chunk-3dyhn59d.js → chunk-gyvaz4cb.js} +1 -1
- package/dist/{chunk-qc93ce5h.js → chunk-h2y36t58.js} +2 -2
- package/dist/chunk-h4ab99hb.js +2 -0
- package/dist/{chunk-5cr84pp2.js → chunk-h58sctng.js} +4 -4
- package/dist/{chunk-79sjdpfy.js → chunk-h6jba844.js} +1 -1
- package/dist/chunk-h75rev1h.js +2 -0
- package/dist/chunk-h9140mn0.js +2 -0
- package/dist/chunk-hjatgram.js +2 -0
- package/dist/{chunk-y6964t7z.js → chunk-hq00hf2e.js} +3 -3
- package/dist/{chunk-r3hden6p.js → chunk-j3cbj356.js} +2 -2
- package/dist/chunk-j4gxcnd5.js +2 -0
- package/dist/{chunk-m5nzpjej.js → chunk-jeh671tw.js} +1 -1
- package/dist/chunk-jka3p99a.js +2 -0
- package/dist/{chunk-g2kfmmfa.js → chunk-jydd8cdc.js} +5 -5
- package/dist/chunk-k38vsxt8.js +2 -0
- package/dist/{chunk-88rftjjk.js → chunk-k8gxa1jf.js} +4 -4
- package/dist/chunk-kgxqj66x.js +2 -0
- package/dist/{chunk-2kz9d366.js → chunk-kjh118s3.js} +7 -7
- package/dist/{chunk-3xyvc3g1.js → chunk-kp2rkczm.js} +5 -5
- package/dist/chunk-m45r8w14.js +2 -0
- package/dist/{chunk-x5dc06p5.js → chunk-md36aysy.js} +6 -6
- package/dist/{chunk-h16qbyjd.js → chunk-n8mb6510.js} +2 -2
- package/dist/{chunk-q7fh1xka.js → chunk-njdppe81.js} +6 -6
- package/dist/{chunk-vvrn688m.js → chunk-nt3hva3f.js} +4 -4
- package/dist/{chunk-f2c3t1ky.js → chunk-nybty1zx.js} +2 -2
- package/dist/{chunk-rbmt5w9v.js → chunk-nzwcbt98.js} +2 -2
- package/dist/{chunk-3cwvp8vc.js → chunk-p766mk6b.js} +8 -8
- package/dist/{chunk-00y2xpfk.js → chunk-pwt6467e.js} +1 -1
- package/dist/chunk-pzm8bc99.js +2 -0
- package/dist/{chunk-05qf3e2p.js → chunk-q1db41k8.js} +3 -3
- package/dist/chunk-qjm2q9we.js +2 -0
- package/dist/{chunk-j28r2d0q.js → chunk-r2cfezt5.js} +2 -2
- package/dist/{chunk-018149qp.js → chunk-rner9txv.js} +2 -2
- package/dist/chunk-rpe1tskt.js +2 -0
- package/dist/{chunk-1dss61y2.js → chunk-rsfs0x3d.js} +1 -1
- package/dist/{chunk-arbhrz4x.js → chunk-rthn3eq6.js} +60 -60
- package/dist/{chunk-wnt00y7f.js → chunk-sc1wkke5.js} +12 -12
- package/dist/{chunk-e25aeftz.js → chunk-sj7hm8dm.js} +2 -2
- package/dist/{chunk-755wsp41.js → chunk-smq3x9a2.js} +27 -7
- package/dist/{chunk-zkx2m308.js → chunk-sv4d9jgf.js} +10 -10
- package/dist/{chunk-r1qcq029.js → chunk-t8ap5qet.js} +6 -6
- package/dist/chunk-tbgz73ta.js +2 -0
- package/dist/chunk-tpwxvpnt.js +2 -0
- package/dist/{chunk-hnqpqtk2.js → chunk-ttsrhr95.js} +6 -6
- package/dist/{chunk-dmnncw90.js → chunk-vtmd3ssd.js} +3 -3
- package/dist/chunk-vvbszwjs.js +2 -0
- package/dist/{chunk-mwxbdpb1.js → chunk-vyv76w55.js} +2 -2
- package/dist/chunk-w07kke19.js +2 -0
- package/dist/{chunk-serrx31a.js → chunk-w1sdxmx3.js} +2 -2
- package/dist/{chunk-39nkd53v.js → chunk-w34w1hrg.js} +2 -2
- package/dist/chunk-w6dyqh92.js +2 -0
- package/dist/{chunk-2mqzpzy7.js → chunk-w9are744.js} +4 -4
- package/dist/chunk-wbcqtpkm.js +2 -0
- package/dist/chunk-wy8er1ps.js +2 -0
- package/dist/chunk-wzkjzh7w.js +2 -0
- package/dist/{chunk-d9hw6n2d.js → chunk-x0c8xq0s.js} +3 -3
- package/dist/{chunk-eqxezwg4.js → chunk-x0vws901.js} +1 -1
- package/dist/{chunk-zqnttswy.js → chunk-xa8bzf00.js} +3 -3
- package/dist/chunk-xrspzeqx.js +2 -0
- package/dist/chunk-xt786nk0.js +2 -0
- package/dist/{chunk-v402swbm.js → chunk-xzv8t0nd.js} +1 -1
- package/dist/{chunk-z8jq4qe7.js → chunk-yvwesavg.js} +9 -9
- package/dist/{chunk-e3egwyax.js → chunk-yxtqk5p8.js} +2 -2
- package/dist/{chunk-9chqvq23.js → chunk-yygtmm7t.js} +3 -3
- package/dist/{chunk-np6gcwgs.js → chunk-yz4jpwp3.js} +19 -19
- package/dist/{chunk-h0xyzp7v.js → chunk-z82a0dpd.js} +3 -3
- package/dist/chunk-zgnqyta0.js +2 -0
- package/dist/chunk-zvfr6022.js +2 -0
- package/dist/{chunk-wk50m71x.js → chunk-zzeas8x5.js} +1 -1
- package/dist/cli.js +19 -19
- package/dist/client/signals-class-runtime.js +1 -0
- package/dist/client/signals-component-props-runtime.js +1 -0
- package/dist/client/signals-expression-compiler-runtime.js +8 -0
- package/dist/client/signals-expression-runtime.js +2 -1
- package/dist/client/signals-for-runtime.js +4 -2
- package/dist/client/signals-if-chain-runtime.js +1 -0
- package/dist/client/signals-if-runtime.js +2 -1
- package/dist/client/signals-model-runtime.js +1 -0
- package/dist/client/signals-process-element-runtime.js +2 -0
- package/dist/client/signals-show-runtime.js +1 -0
- package/dist/client/signals-style-runtime.js +1 -0
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/runtime/binding-diagnostics.d.ts +3 -0
- package/dist/native/runtime/binding-diagnostics.js +20 -0
- package/dist/native/runtime/shared-screen.js +2 -0
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +27 -27
- package/package.json +5 -5
- package/dist/chunk-0ajbe55p.js +0 -2
- package/dist/chunk-0ee76md1.js +0 -2
- package/dist/chunk-0g9a1kks.js +0 -2
- package/dist/chunk-1pgr2n0h.js +0 -2
- package/dist/chunk-2hpt1f4r.js +0 -2
- package/dist/chunk-336t7zzz.js +0 -2
- package/dist/chunk-362sjw8c.js +0 -2
- package/dist/chunk-3j8x8mhx.js +0 -2
- package/dist/chunk-3n3vmhtd.js +0 -2
- package/dist/chunk-5wpgbwap.js +0 -2
- package/dist/chunk-5zrz59dy.js +0 -2
- package/dist/chunk-6h1qa3hw.js +0 -2
- package/dist/chunk-6jn0p1a9.js +0 -2
- package/dist/chunk-6t78kw7s.js +0 -2
- package/dist/chunk-8w1ep4w3.js +0 -2
- package/dist/chunk-918xy0ra.js +0 -2
- package/dist/chunk-9q15h90v.js +0 -2
- package/dist/chunk-a0c2qg2b.js +0 -2
- package/dist/chunk-a49at1ah.js +0 -2
- package/dist/chunk-a64crz43.js +0 -2
- package/dist/chunk-ak04tgvw.js +0 -2
- package/dist/chunk-azatpcm0.js +0 -2
- package/dist/chunk-b2x1wd97.js +0 -2
- package/dist/chunk-c1481efw.js +0 -2
- package/dist/chunk-c8yrvpr7.js +0 -2
- package/dist/chunk-e18z6ntg.js +0 -2
- package/dist/chunk-ejhvxggz.js +0 -2
- package/dist/chunk-enpchwv1.js +0 -2
- package/dist/chunk-jbryd6s7.js +0 -3
- package/dist/chunk-jkqe35rg.js +0 -2
- package/dist/chunk-jresy8fn.js +0 -2
- package/dist/chunk-m6d2bq3y.js +0 -2
- package/dist/chunk-mt789hbw.js +0 -2
- package/dist/chunk-mvbw706e.js +0 -2
- package/dist/chunk-n14zxb4g.js +0 -2
- package/dist/chunk-nfg5tjn2.js +0 -2
- package/dist/chunk-nvtp22qp.js +0 -2
- package/dist/chunk-q6tmvtqq.js +0 -2
- package/dist/chunk-rgv7rjrs.js +0 -2
- package/dist/chunk-t98sz9rb.js +0 -2
- package/dist/chunk-tdvmf3ge.js +0 -2
- package/dist/chunk-vresxjg7.js +0 -2
- package/dist/chunk-w9qxsp09.js +0 -2
- package/dist/chunk-wke3dw59.js +0 -2
- package/dist/chunk-wva9vscy.js +0 -2
- package/dist/chunk-wy2kct6z.js +0 -2
- package/dist/chunk-xbc84n7q.js +0 -2
- package/dist/chunk-ysk3rmz2.js +0 -2
- package/dist/chunk-zx5wbfxd.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{U}from"./chunk-
|
|
2
|
+
import{U}from"./chunk-rthn3eq6.js";import{Fe,O,Dt}from"./chunk-nzwcbt98.js";import{dt,_e,M,Ce,Zi,ro,Qi,Rn}from"./chunk-jydd8cdc.js";import{wt,ue,Ze}from"./chunk-w9are744.js";import{vo}from"./chunk-13tac9ac.js";import{An}from"./chunk-3kw9m62d.js";import{ye}from"./chunk-f6bpxqj9.js";import Z from"fs";import T from"path";var{serve:ce}=globalThis.Bun;import H from"zlib";import{promisify as Q}from"util";var K=Q(H.brotliCompress),ee=Q(H.gzip),te=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ne=["text/event-stream","multipart/x-mixed-replace"],re=1024;function se(t){if(!t)return!1;let e=t.toLowerCase();if(ne.some((o)=>e.startsWith(o)))return!1;return te.some((o)=>e.startsWith(o))}function oe(t){let e=new Map;for(let o of t.split(",")){let[r,...a]=o.trim().split(";"),f=r.trim().toLowerCase();if(!f)continue;let h=1;for(let g of a){let l=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(g);if(!l)continue;let m=Number.parseFloat(l[1]);if(Number.isFinite(m))h=m}e.set(f,h)}return e}function ae(t){if(!t)return null;let e=oe(t),o=e.get("*"),r=(a)=>e.get(a)??o??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var Y=33554432,V=new Map,z=0;function ie(t,e){if(e.length>Y/8)return;V.set(t,e),z+=e.length;for(let[o,r]of V){if(z<=Y)break;V.delete(o),z-=r.length}}async function Cn(t,e,o={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!se(e.headers.get("content-type")))return e;let r=ae(t.headers.get("accept-encoding"));if(!r)return e;let a;try{a=new Uint8Array(await e.arrayBuffer())}catch{return e}let f=()=>new Response(a,{status:e.status,statusText:e.statusText,headers:J(e.headers)});if(a.length<(o.threshold??re))return f();try{let h=o.quality??5,g=`${r}:${h}:${a.length}:${Bun.hash(a)}`,l=V.get(g);if(!l)l=r==="br"?await K(a,{params:{[H.constants.BROTLI_PARAM_QUALITY]:h,[H.constants.BROTLI_PARAM_SIZE_HINT]:a.length}}):await ee(a),ie(g,l);if(l.length>=a.length)return f();let m=J(e.headers);return m.set("Content-Encoding",r),m.set("Content-Length",String(l.length)),new Response(l,{status:e.status,statusText:e.statusText,headers:m})}catch{return f()}}function J(t){let e=new Headers(t),o=e.get("Vary");if(!o)return e.set("Vary","Accept-Encoding"),e;if(!o.split(",").some((a)=>a.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${o}, Accept-Encoding`);return e}class G{now;entries=new U(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,o){let r,a=async()=>{let s=r??await o();return s.headers.set("Cache-Control","private, no-store"),s.headers.set("Vary",M(s.headers.get("Vary")).Vary),s};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return a();let f=new URL(t.url),h=`${f.origin}${f.pathname}${f.search}|${_e(t)?"fragment":"document"}`,g=this.entries.get(h),l=(s)=>{let b=new Headers(s.headers);return b.set("Cache-Control","private, no-store"),b.set("Age",String(Math.max(0,Math.floor((this.now()-s.created)/1000)))),new Response(s.body.slice(0),{headers:b})},m=g?(this.now()-g.created)/1000:1/0;if(g&&m<e.maxAge)return l(g);let v=this.generation,_=async()=>{let s=await o();r=s;let b=(s.headers.get("Vary")??"").toLowerCase().split(",").map((y)=>y.trim()).filter(Boolean);if(s.status!==200||s.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(s.headers.get("Cache-Control")??"")||b.some((y)=>y!=="x-stx-router"&&y!=="accept-encoding"))return null;let E=await s.clone().arrayBuffer();if(E.byteLength>1048576)return null;s.headers.set("Vary",M(s.headers.get("Vary")).Vary);let n={body:E,headers:Array.from(s.headers.entries()),created:this.now(),path:f.pathname};if(this.generation===v)this.entries.set(h,n);return n},x=this.pending.get(h);if(!x){if(this.pending.size>=1000)return a();x=_().finally(()=>{if(this.pending.get(h)===x)this.pending.delete(h)}),this.pending.set(h,x)}if(g&&m<e.maxAge+(e.swr??0))return x.catch(()=>{}),l(g);let A=await x;return A?l(A):a()}}var pe={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function xg(t={}){let e=T.resolve(t.outputDir||".output"),o=t.port??3000,r=Zi(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let a=An(r.routeRules),f=new G,h=vo(e,r.apiRoutes??[]),g=Bun.file(T.join(e,"server/runtime-config.json")),l=t.runtimeConfig??(await g.exists()?await g.json():void 0),m=l?O(l):void 0,v=new Map,_=new Map,x=new Map,A=new Map;for(let n of r.routes)try{let y=T.join(e,n.compiledPath),i=JSON.parse(await Bun.file(y).text());if(m)i.html=Dt(i.html,m);v.set(n.pattern,i),x.set(n.pattern,Ze(i.html)),A.set(n.pattern,ye(i.html));let j=T.join(e,n.fragmentPath);if(await Bun.file(j).exists()){let P=await Bun.file(j).text();_.set(n.pattern,m?Dt(P,m):P)}}catch(y){console.warn(`[stx] Failed to load route ${n.pattern}:`,y)}let s=new Map,b=[];for(let n of r.routes)if(n.hasParams){let{regex:y,params:i}=ue(n.pattern,{page:!0});b.push({regex:y,route:n,paramNames:i})}else s.set(n.pattern,n);let E=ce({port:o,async fetch(n){return Cn(n,await Fe(m??O(),async()=>{let i=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[i])return t.apiRoutes[i](n);let j=await h(n);if(j)return j;if((n.method==="GET"||n.method==="HEAD")&&i!=="/"){let p=T.resolve(e,"public"),d;try{d=decodeURIComponent(i)}catch{d=i}if(!d.includes("\x00")){let u=T.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${T.sep}`))try{if(Z.existsSync(u)&&Z.statSync(u).isFile()){let R=T.extname(u).toLowerCase(),B=pe[R]||"application/octet-stream",X=i.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(i);return new Response(Bun.file(u),{headers:{"Content-Type":B,"Cache-Control":X?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let P=_e(n),C=null,q={};if(C=s.get(i)||null,!C)for(let{regex:p,route:d,paramNames:u}of b){let c=i.match(p);if(c){C=d,u.forEach((R,B)=>{q[R]=c[B+1]});break}}if(!C){let p=wt(i)?null:s.get("/404")||null;if(p){let d=v.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let N=a(i),W=Object.keys(N).length>0;return f.respond(n,N.cache,async()=>{let p=v.get(C.pattern);if(P&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let c=_.get(C.pattern);if(c){let R=x.get(C.pattern);return new Response(c,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...A.has(C.pattern)?{"X-STX-Runtime":A.get(C.pattern)?"true":"false"}:{},...R?{"X-STX-Layout":R.layout,"X-STX-Layout-Group":R.group}:{},...M(),...N.cache?{}:{"Cache-Control":dt}}})}}let d=ro(n.method),u=v.get(C.pattern);if(!u){let c=s.get("/500")||null;if(c){let R=v.get(c.pattern);if(R)return new Response(R.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(C.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...M(),"Cache-Control":"public, max-age=60"}});try{let{html:c,boundaries:R,redirect:B,cookies:X,status:F,headers:I}=await Rn(u,{params:q,request:n,method:n.method,__stx_strict_hydration:W,__stx_runtime_config:m});if(B)return Qi(B,X,I);if(R&&R.length>0){let{renderStreamingPage:S,streamToResponse:D}=await import("./chunk-a0mze6dz.js"),L=new Headers({...M(),...I,"Cache-Control":"private, no-store"});for(let k of X??[])L.append("Set-Cookie",k);if(P&&!d){let k=Ze(c);L.set("X-STX-Fragment","true"),L.set("X-STX-Runtime",ye(c)?"true":"false"),L.set("X-STX-Layout",k.layout),L.set("X-STX-Layout-Group",k.group)}return D(S(P&&!d?Ce(c,r.routerContainer||"main",!0):c,R,{timeoutMs:30000}),{status:F??u.status??200,headers:L})}let w=new Headers({"Content-Type":"text/html",...M(),...N.cache?{}:{"Cache-Control":"private, no-store"}});for(let S of X??[])w.append("Set-Cookie",S);for(let[S,D]of Object.entries(I??{}))w.set(S,D);if(w.set("Vary",M(w.get("Vary")).Vary),P&&!d){let S=Ze(c);return w.set("X-STX-Fragment","true"),w.set("X-STX-Runtime",ye(c)?"true":"false"),w.set("X-STX-Layout",S.layout),w.set("X-STX-Layout-Group",S.group),new Response(Ce(c,r.routerContainer||"main",!0),{status:F??u.status??200,headers:w})}return new Response(c,{status:F??u.status??200,headers:w})}catch(c){if(console.error(`[stx] Hydration error for ${i}:`,c),W)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${E.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${v.size} pre-loaded)`),{port:E.port,stop:()=>{f.invalidate(),E.stop()},invalidate:(n)=>f.invalidate(n)}}
|
|
3
3
|
export{Cn,xg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ol,Nl,Dl,Ml,Ll,jl,Bl,Fl,zl,Hl,Kg}from"./chunk-md36aysy.js";export{Ol as createIslandRegistry,Kg as default,Hl as generateIslandManifest,Dl as generatePartialHydrationCSS,jl as hydrateAll,Ll as hydrateByStrategy,Ml as hydrateIsland,Bl as isHydrated,Fl as onHydrated,Nl as processPartialHydrationDirectives,zl as processStaticDirectives};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function o(t,i){let n=t[i],e=i+1;while(e<t.length){if(t[e]==="\\"){e+=2;continue}if(t[e]===n)return e+1;e++}return t.length}function b(t,i){let n=i+1;while(n<t.length){if(t[n]==="\\"){n+=2;continue}if(t[n]==="`")return n+1;if(t[n]==="$"&&t[n+1]==="{"){if(n=
|
|
2
|
+
function o(t,i){let n=t[i],e=i+1;while(e<t.length){if(t[e]==="\\"){e+=2;continue}if(t[e]===n)return e+1;e++}return t.length}function b(t,i){let n=i+1;while(n<t.length){if(t[n]==="\\"){n+=2;continue}if(t[n]==="`")return n+1;if(t[n]==="$"&&t[n+1]==="{"){if(n=Bc(t,n+2),n<t.length)n++;continue}n++}return t.length}function Bc(t,i){let n=1,e=i,r="{",f="";while(e<t.length){let l=t[e];if(l==="\\"){e+=2;continue}if(l==='"'||l==="'"){e=o(t,e),r=h,f="";continue}if(l==="`"){e=b(t,e),r=h,f="";continue}if(l==="/"&&t[e+1]==="/"){while(e<t.length&&t[e]!==`
|
|
3
3
|
`)e++;continue}if(l==="/"&&t[e+1]==="*"){e+=2;while(e<t.length&&t.slice(e,e+2)!=="*/")e++;e+=2;continue}if(l==="/"&&a(r,f)){let u=w(t,e);if(u!==-1){e=u,r=h,f="";continue}}if(l==="{")n++;else if(l==="}"){if(n--,n===0)return e}if(/[\w$]/.test(l))f=/[\w$]/.test(r)?f+l:l,r=l;else if(!/\s/.test(l))r=l,f="";e++}return t.length}var m=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function a(t,i){if(i)return m.has(i);return!(t===")"||t==="]"||t===h)}var h="\x00";function w(t,i){let n=i+1,e=!1;while(n<t.length){let r=t[n];if(r===`
|
|
4
4
|
`)return-1;if(r==="\\"){n+=2;continue}if(r==="[")e=!0;else if(r==="]")e=!1;else if(r==="/"&&!e){n++;while(n<t.length&&/[a-z]/i.test(t[n]))n++;return n}n++}return-1}function s(t){let i="",n=0,e="",r="";while(n<t.length){let f=t.slice(n,n+2);if(f==="//"){while(n<t.length&&t[n]!==`
|
|
5
5
|
`)i+=" ",n++;continue}if(f==="/*"){while(n<t.length&&t.slice(n,n+2)!=="*/")i+=t[n]===`
|
|
6
6
|
`?`
|
|
7
7
|
`:" ",n++;i+=" ",n+=2;continue}let l=t[n];if(l==='"'||l==="'"){let u=l;i+=" ",n++;while(n<t.length&&t[n]!==u){if(t[n]==="\\"){i+=" ",n+=2;continue}i+=t[n]===`
|
|
8
8
|
`?`
|
|
9
|
-
`:" ",n++}i+=" ",n++,e=h,r="";continue}if(l==="/"&&a(e,r)){let u=w(t,n);if(u!==-1){i+=`/${" ".repeat(u-n-2)}/`,n=u,e=h,r="";continue}}if(l==="`"){i+=" ",n++;while(n<t.length&&t[n]!=="`"){if(t[n]==="\\"){i+=" ",n+=2;continue}if(t[n]==="$"&&t[n+1]==="{"){let u=n+2,g=
|
|
9
|
+
`:" ",n++}i+=" ",n++,e=h,r="";continue}if(l==="/"&&a(e,r)){let u=w(t,n);if(u!==-1){i+=`/${" ".repeat(u-n-2)}/`,n=u,e=h,r="";continue}}if(l==="`"){i+=" ",n++;while(n<t.length&&t[n]!=="`"){if(t[n]==="\\"){i+=" ",n+=2;continue}if(t[n]==="$"&&t[n+1]==="{"){let u=n+2,g=Bc(t,u);if(i+=" ",i+=s(t.slice(u,g)),g<t.length)i+=" ";n=g+1;continue}i+=t[n]===`
|
|
10
10
|
`?`
|
|
11
11
|
`:" ",n++}i+=" ",n++,e=h,r="";continue}if(i+=l,n++,/[\w$]/.test(l))r=/[\w$]/.test(e)?r+l:l,e=l;else if(!/\s/.test(l))e=l,r=""}return i}function ge(t){let i=new Uint16Array(t.length),n=0,e=!0;for(let r=0;r<t.length;r++){let f=t[r];if(f===")"||f==="]"||f==="}")if(n===0)e=!1;else n--;if(i[r]=n,f==="("||f==="["||f==="{")n++}return{depths:i,balanced:e&&n===0}}
|
|
12
|
-
export{
|
|
12
|
+
export{Bc,s,ge};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ll,ul}from"./chunk-yz4jpwp3.js";import"./chunk-fveqk208.js";import"./chunk-pwt6467e.js";import"./chunk-kp2rkczm.js";import"./chunk-crk5dzxb.js";import"./chunk-55qv90h9.js";import"./chunk-nybty1zx.js";import"./chunk-x0vws901.js";import"./chunk-jydd8cdc.js";import"./chunk-888xnaex.js";import"./chunk-w1sdxmx3.js";import"./chunk-agxvydxe.js";import"./chunk-amyxgejb.js";import"./chunk-rner9txv.js";import"./chunk-w34w1hrg.js";import"./chunk-ttsrhr95.js";import"./chunk-md36aysy.js";import"./chunk-xa8bzf00.js";import"./chunk-vyv76w55.js";import"./chunk-t8ap5qet.js";import"./chunk-8fazd6fr.js";import"./chunk-pd89jnqk.js";import"./chunk-fsz9k5k0.js";import"./chunk-72hfqwvk.js";import"./chunk-78x8qfvt.js";import"./chunk-y3w2rc1y.js";import"./chunk-f2yfe5e2.js";import"./chunk-3f25fntg.js";import"./chunk-smq3x9a2.js";import"./chunk-06jys4zk.js";import"./chunk-e43cxztn.js";import"./chunk-vtmd3ssd.js";import{Jt}from"./chunk-88kpnrgj.js";import"./chunk-h58sctng.js";import"./chunk-13tac9ac.js";import"./chunk-1xjv71dw.js";import{Re,i}from"./chunk-b4ejzx20.js";import"./chunk-7emrpfha.js";import"./chunk-91pycazt.js";import"./chunk-hq00hf2e.js";import"./chunk-0yewaggn.js";import"./chunk-nt3hva3f.js";import"./chunk-at0k9j3q.js";import"./chunk-eks1mjr3.js";import"./chunk-kjh118s3.js";import{be}from"./chunk-f6bpxqj9.js";import"./chunk-jeh671tw.js";import{ir,ar}from"./chunk-sj7hm8dm.js";import{us,j,a}from"./chunk-yvwesavg.js";import"./chunk-z82a0dpd.js";import"./chunk-6ew10ptg.js";import"./chunk-5f6x6fyp.js";import"./chunk-njdppe81.js";import"./chunk-w9are744.js";import{m,Me}from"./chunk-rthn3eq6.js";import"./chunk-yxtqk5p8.js";import"./chunk-nzwcbt98.js";import"./chunk-sv4d9jgf.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";import"./chunk-9zrbhs3p.js";import"./chunk-x0c8xq0s.js";export{us as buildWebComponents,ar as cacheTemplate,ir as checkCache,Jt as classifyAllScripts,ll as createMiddleware,ul as createRoute,j as defaultConfig,m as extractVariables,be as injectRouterScript,a as loadStxConfig,Me as processClientScript,i as processDirectives,Re as readMarkdownFile};
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import o from"fs";import u from"path";var h={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"};function p(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];r=(r<<5)-r+n,r=r&r}return Math.abs(r).toString(16).padStart(8,"0")}function x(e,r){let t=u.basename(e);for(let n of r)if(n.startsWith("*.")){let i=n.slice(1);if(t.endsWith(i))return!0}else if(n.includes("*")){let i=new RegExp(`^${n.replace(/\*/g,".*")}$`);if(i.test(t)||i.test(e))return!0}else if(t===n||e.includes(n))return!0;return!1}function S(e,r,t){let n=u.extname(e).toLowerCase(),i=h[n],c=(t.maxFileSizeKB||500)*1024;if(r>c)return!1;if(t.exclude&&x(e,t.exclude))return!1;if(t.include&&t.include.length>0){for(let s of t.include)if(s.startsWith("*.")){if(e.endsWith(s.slice(1)))return!0}else if(e.includes(s))return!0}if(i&&t[i]===!0)return!0;if(!i)return!1;return!1}function f(e,r,t,n){let i=o.readdirSync(e,{withFileTypes:!0});for(let c of i){let s=u.join(e,c.name);if(c.isDirectory()){if(["node_modules",".git",".stx"].includes(c.name))continue;f(s,r,t,n)}else if(c.isFile()){let a=o.statSync(s),l=u.relative(r,s);if(S(l,a.size,t)){let d=o.readFileSync(s),g=p(d),m=`/${l.replace(/\\/g,"/")}`;n.push({url:m,revision:g,size:a.size})}}}}function Ve(e,r){let t=r.pwa?.precache,n=[];if(!t?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!o.existsSync(e))return{entries:[],totalSize:0,fileCount:0};f(e,e,t,n),n.sort((c,s)=>c.url.localeCompare(s.url));let i=n.reduce((c,s)=>c+s.size,0);return{entries:n,totalSize:i,fileCount:n.length}}function _n(e){if(e.entries.length===0)return"[]";return`[
|
|
3
3
|
${e.entries.map((t)=>` { url: '${t.url}', revision: '${t.revision}' }`).join(`,
|
|
4
4
|
`)}
|
|
5
|
-
]`}function
|
|
6
|
-
export{Ve,_n,
|
|
5
|
+
]`}function wi(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;return`${(e/1048576).toFixed(2)} MB`}
|
|
6
|
+
export{Ve,_n,wi};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{f,d}from"./chunk-
|
|
3
|
-
export{
|
|
2
|
+
import{f,d}from"./chunk-sv4d9jgf.js";import{J,I,p}from"./chunk-rthn3eq6.js";function z(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function k(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function B(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=k(t,s+1);if(a===-1)return-1;let u=t.slice(s,a),c=u.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(u))e++}n=a}return-1}function Z(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[2].toLowerCase();if(u[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let g=/\/\s*>$/.test(a),m=i.length===0?a.match(r):null;if(m){let l=m[1]||m[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=g||N.has(c)?-1:B(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!g&&!N.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function L(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=k(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[1]==="/",g=u[2].toLowerCase();if(c){let l=i.lastIndexOf(g);if(l!==-1)i.splice(l);e=s;continue}if(g==="template"&&i.length===0){let l=a.match(r);if(l){let h=z(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!N.has(g)){if(i.push(g),g==="script"||g==="style"){let l=t.toLowerCase().indexOf(`</${g}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function Cl(t){let o={default:"",named:new Map},i=t,r=L(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=Z(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function Vg(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function El(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r},a=new Set,u=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((g)=>g.trim()).filter(Boolean);for(let g of c){let[m,l]=g.split(":").map((S)=>S.trim()),h=l||m;if(s[h]=o[m],o[m]!==void 0)u.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else u.add(n);e=j(e,s,a,u)}return e}function j(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(I(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!I(s,r))return e;let a=_(s,o);if(a===void 0)return e;return p(String(a??""))}catch{return`{{ ${n} }}`}})}function _(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!f(t))return;return d(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Tl(t,o,i,r){let e=t;e=await W(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,u,c,g)=>{let m=o.named.get(u),l=g?.trim()||"",h=c||"",S={},E=[],C=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=C.exec(h))!==null){let w=b[1],x=b[2];S[w]=_(x,i),E.push([w,x])}if(r!==void 0&&m?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=m.propsBinding.trim(),x=J(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let M=E.map(([A,P])=>{let O=S[A],R;try{R=O===void 0?void 0:JSON.stringify(O)}catch{}return`${JSON.stringify(A)}:(${R??P})`}).join(","),v=p(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${p(`${y} in [{${M}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${v}">${m.content}</template>`}return await El(m,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,u,c)=>{if(/\bname\s*=/.test(u||""))return a;let g=c?.trim()||"";return o.default||g}),e}async function W(t,o,i){let r=[],e=[];t.replace(o,(a,...u)=>{let c=u[u.length-2];return e.push({match:a,index:c}),r.push(i(a,...u.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:u,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+u.length)}return s}function Ug(t){let o=Cl(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Wg(t,o,i,r,e){return await Tl(t,{default:o,named:i},r,e)}
|
|
3
|
+
export{Cl,Vg,El,Tl,Ug,Wg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{nf,rf,Te,sf,Fa,Yt,Zt,Gm,za,Qt,Jn,of,af,cf,ho,en,lf,tn,uf}from"./chunk-h58sctng.js";import"./chunk-13tac9ac.js";import"./chunk-1xjv71dw.js";import"./chunk-yvwesavg.js";import"./chunk-z82a0dpd.js";import"./chunk-6ew10ptg.js";import"./chunk-5f6x6fyp.js";import"./chunk-njdppe81.js";import"./chunk-w9are744.js";import"./chunk-rthn3eq6.js";import"./chunk-yxtqk5p8.js";import"./chunk-nzwcbt98.js";import"./chunk-sv4d9jgf.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{Jn as MODULE_SPECIFIER_PREFIX,nf as bundleCacheDir,rf as bundleCacheEntryLimit,tn as bundleClientScript,Zt as clearBundleFailures,Te as clientBundleDependencies,Yt as getBundleFailures,Qt as hasUserImports,en as moduleSubstitutionKey,af as normalizeRegistrySpecifiers,lf as queueClientBundleBuild,Fa as recordBundleFailure,of as registryIdForPath,za as resolveBundlerFallback,cf as rewriteRegistryImports,Gm as setBundlerFallbackMode,sf as shouldLogBundlerDiagnostics,uf as tempBuildName,ho as withModuleSubstitutes};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-27agaezn.js";import"./chunk-zn3c0ew5.js";import{w,x,C,Y}from"./chunk-rthn3eq6.js";import"./chunk-sv4d9jgf.js";import"./chunk-nzwcbt98.js";import"./chunk-yxtqk5p8.js";import f from"path";var b=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],L=new Set(b);var l=new Map,h=w(64),S=new Set,k=0,R=new Set(b);function T(){l.clear(),h.clear()}function P(n){let o=new Map;for(let r of n){let a=f.basename(r);if(a.endsWith(".d.ts"))continue;let t=a.replace(/\.[jt]s$/,"");if(t==="index")continue;if(t===a)continue;let i=o.get(t);if(i&&!i.endsWith(".js"))continue;o.set(t,r)}return[...o.values()].sort()}function I(n,o){let r=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${r}\\b`).test(n)}function M(n){if(!n)return[];let o=x(n,k),r=h.get(o);if(r)return r.slice();let a=n.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),t=[];for(let i of R){if(S.has(i))continue;let u=i.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${u}\\s*\\(`).test(a))t.push(i)}return t.sort(),h.set(o,t),t.slice()}async function A(n,o){let r=M(n);if(r.length===0)return null;let a=o??f.join(import.meta.dir,"composables"),t=`${a}\x00${r.join(",")}`,i=l.get(t);if(i!==void 0)return i||null;let u=Y({loader:"ts",target:"browser",define:C()}),O=new Set(r),m=[],d=new Set,p=[];try{let s=new Bun.Glob("*.{ts,js}");for await(let e of s.scan({cwd:a,absolute:!0}))p.push(e)}catch{return l.set(t,""),null}p=P(p);for(let s of p){let e;try{e=await Bun.file(s).text()}catch{continue}let g=[];try{g=u.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>O.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${f.basename(s).replace(/\.[jt]s$/,"")}
|
|
3
3
|
${u.transformSync(e).trim()}`);for(let c of g)d.add(c)}catch(c){console.warn(`[stx] framework composable ${f.basename(s)} could not be bundled:`,c)}}let y=r.filter((s)=>!d.has(s)&&!I(n,s));if(y.length>0)console.warn(`[stx] could not bundle ${y.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(m.length===0)return l.set(t,""),null;let E=[...d].map((s)=>` try { if (!(${JSON.stringify(s)} in __s)) { __s[${JSON.stringify(s)}] = ${s}; if (!(${JSON.stringify(s)} in window)) window[${JSON.stringify(s)}] = ${s}; } } catch (e) {}`).join(`
|
|
4
4
|
`),v=`<script data-stx-scoped data-stx-run="always" data-stx-framework-composables>
|
|
5
5
|
;(function(){
|