@stacksjs/stx 0.2.846 → 0.2.849
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/app-shell.d.ts +2 -1
- package/dist/app-shell.js +3 -3
- package/dist/{chunk-cpdfxy8g.js → chunk-056rsqc6.js} +12 -12
- package/dist/{chunk-wzpd3htt.js → chunk-09412heg.js} +7 -7
- package/dist/chunk-0d4zhbjz.js +2 -0
- package/dist/{chunk-ng8nkbp2.js → chunk-0ey7kc6t.js} +2 -2
- package/dist/chunk-0g05v7m1.js +2 -0
- package/dist/{chunk-z26fg4p0.js → chunk-0wms5teg.js} +2 -2
- package/dist/{chunk-nsc93haq.js → chunk-0zgxxhvs.js} +6 -6
- package/dist/chunk-11snc6n0.js +2 -0
- package/dist/{chunk-82vf29ty.js → chunk-12r22pf0.js} +2 -2
- package/dist/{chunk-j1n2xb48.js → chunk-14cvwsy1.js} +2 -2
- package/dist/{chunk-0e4y6h1h.js → chunk-1k12cc65.js} +14 -14
- package/dist/chunk-1menbxwb.js +2 -0
- package/dist/chunk-1p968nww.js +2 -0
- package/dist/chunk-1pf4y2yr.js +2 -0
- package/dist/{chunk-6pgq75h9.js → chunk-25m74mh1.js} +5 -5
- package/dist/{chunk-xq9w5g23.js → chunk-2j3gttzf.js} +1 -1
- package/dist/chunk-2sxmmjt1.js +2 -0
- package/dist/{chunk-h76wsqr4.js → chunk-2ts9pb6s.js} +2 -2
- package/dist/{chunk-caw0wzns.js → chunk-2xf323h9.js} +3 -3
- package/dist/chunk-34afrhts.js +2 -0
- package/dist/chunk-37bzsnr7.js +2 -0
- package/dist/chunk-3m5v3ynh.js +4 -0
- package/dist/chunk-3m6n90sk.js +2 -0
- package/dist/{chunk-zx2xwrp3.js → chunk-3qyz80d6.js} +6 -6
- package/dist/{chunk-an6vb4ng.js → chunk-46t924aw.js} +2 -2
- package/dist/{chunk-9hfk5wf1.js → chunk-4fc8zs15.js} +5 -5
- package/dist/chunk-4q4mtrc5.js +2 -0
- package/dist/{chunk-xskygt2v.js → chunk-54p27ney.js} +5 -5
- package/dist/chunk-5bm8hmwd.js +2 -0
- package/dist/chunk-5r2z29n8.js +2 -0
- package/dist/{chunk-wbx27kdd.js → chunk-5wr1qqz3.js} +2 -2
- package/dist/{chunk-wvsnp294.js → chunk-63sqdcr6.js} +9 -9
- package/dist/chunk-660preb9.js +2 -0
- package/dist/chunk-6hd83cj4.js +2 -0
- package/dist/{chunk-gs33xdk7.js → chunk-6xcmeev9.js} +5 -5
- package/dist/chunk-740njbwc.js +2 -0
- package/dist/chunk-77fs8281.js +2 -0
- package/dist/chunk-7c73t536.js +2 -0
- package/dist/chunk-7ycmnsh5.js +2 -0
- package/dist/{chunk-r3v1zaj0.js → chunk-81ysx0tc.js} +2 -2
- package/dist/{chunk-hp8ny2zb.js → chunk-83dxfhkw.js} +5 -5
- package/dist/chunk-84gg2atb.js +2 -0
- package/dist/chunk-86z8zrn9.js +3 -0
- package/dist/{chunk-5903tzcw.js → chunk-88a7qaw8.js} +3 -3
- package/dist/{chunk-1qp5808r.js → chunk-8bxws458.js} +3 -3
- package/dist/{chunk-j3zy3mrn.js → chunk-8vkywnpx.js} +9 -9
- package/dist/{chunk-zkn55966.js → chunk-90mm5bf8.js} +6 -6
- package/dist/{chunk-8az9e5b9.js → chunk-93c08def.js} +5 -5
- package/dist/chunk-9c6yvh3p.js +2 -0
- package/dist/chunk-9f0pv6sz.js +2 -0
- package/dist/chunk-9fxeqf0e.js +2 -0
- package/dist/{chunk-4041q9sd.js → chunk-9mbyhepc.js} +5 -5
- package/dist/{chunk-vxayh4az.js → chunk-9qxx2teq.js} +6 -6
- package/dist/{chunk-p8ry1q7c.js → chunk-9sjtph54.js} +3 -3
- package/dist/chunk-atsjexk0.js +2 -0
- package/dist/{chunk-x3pxxx7j.js → chunk-b147ejha.js} +3 -3
- package/dist/{chunk-1w5hte9z.js → chunk-b3n1m4m5.js} +2 -2
- package/dist/chunk-bcefawtc.js +2 -0
- package/dist/chunk-bkqqa8aw.js +2 -0
- package/dist/chunk-bmds786f.js +2 -0
- package/dist/{chunk-ph57nv7v.js → chunk-bsw6hd14.js} +2 -2
- package/dist/{chunk-s2a51j0k.js → chunk-bttvkzxh.js} +6 -6
- package/dist/chunk-c0azgkss.js +2 -0
- package/dist/{chunk-v8y01jbr.js → chunk-c541s99z.js} +4 -4
- package/dist/{chunk-50tnhq5f.js → chunk-c7qej674.js} +30 -30
- package/dist/chunk-cbz7jtzf.js +2 -0
- package/dist/{chunk-bsr6kf34.js → chunk-ct54e34a.js} +1 -1
- package/dist/{chunk-84myqca7.js → chunk-cww1zk8y.js} +2 -2
- package/dist/{chunk-d1pat213.js → chunk-dv9q56r7.js} +2 -2
- package/dist/chunk-e1n286mv.js +2 -0
- package/dist/{chunk-t3e95q80.js → chunk-eg2p1cyw.js} +14 -14
- package/dist/{chunk-7rcc2tzz.js → chunk-emf6ee94.js} +3 -3
- package/dist/chunk-evdskc25.js +2 -0
- package/dist/chunk-f18rxz70.js +2 -0
- package/dist/{chunk-wd632rge.js → chunk-f2zgh4xr.js} +7 -7
- package/dist/chunk-f8akfzzn.js +2 -0
- package/dist/chunk-f8wmxwa3.js +2 -0
- package/dist/{chunk-neh3kewg.js → chunk-fa3ygt8c.js} +4 -4
- package/dist/{chunk-n475s55q.js → chunk-fez9828r.js} +2 -2
- package/dist/chunk-fseqwysr.js +2 -0
- package/dist/{chunk-ds1vj0dw.js → chunk-fx8jjasv.js} +4 -4
- package/dist/{chunk-x1n01gc1.js → chunk-ga650crj.js} +5 -5
- package/dist/{chunk-rg2gfyy0.js → chunk-gpkxphqz.js} +2 -2
- package/dist/chunk-h8zb6cek.js +2 -0
- package/dist/chunk-hc4ydhw0.js +2 -0
- package/dist/{chunk-30g5kqy0.js → chunk-he9dzchk.js} +1 -1
- package/dist/{chunk-4y6hes3h.js → chunk-hpwtjb4a.js} +2 -2
- package/dist/chunk-j08r18x1.js +2 -0
- package/dist/chunk-j539dz72.js +2 -0
- package/dist/{chunk-s6qzmwp3.js → chunk-jaf44web.js} +1 -1
- package/dist/{chunk-vyggv4k0.js → chunk-jcwtw3hd.js} +2 -2
- package/dist/{chunk-81nmqdht.js → chunk-jh36gqcq.js} +2 -2
- package/dist/{chunk-m8cpabd2.js → chunk-jm0qsr3s.js} +3 -3
- package/dist/{chunk-4v6mbvqv.js → chunk-jmshgw0t.js} +5 -5
- package/dist/chunk-jqngvqby.js +2 -0
- package/dist/{chunk-vh8wn94m.js → chunk-jtccqpwa.js} +2 -2
- package/dist/chunk-k33kgf8a.js +2 -0
- package/dist/{chunk-7qwfbafg.js → chunk-k44qj40k.js} +2 -2
- package/dist/{chunk-444sbdm8.js → chunk-k7e3e149.js} +36 -36
- package/dist/chunk-ke76eaat.js +33 -0
- package/dist/chunk-kz7ha54c.js +2 -0
- package/dist/chunk-m7cbkrz6.js +2 -0
- package/dist/{chunk-qttjrja7.js → chunk-ma9yq04p.js} +2 -2
- package/dist/chunk-md8dj6tb.js +2 -0
- package/dist/{chunk-krdfnsz6.js → chunk-mnncq81c.js} +5 -5
- package/dist/chunk-na1v2jcy.js +2 -0
- package/dist/{chunk-jf0a5ew8.js → chunk-na1x46xm.js} +3 -3
- package/dist/{chunk-sxsjxme0.js → chunk-nws4zm4k.js} +4 -4
- package/dist/chunk-p2fkggw4.js +3 -0
- package/dist/chunk-pqqyjvq9.js +2 -0
- package/dist/chunk-q18508s2.js +2 -0
- package/dist/chunk-qay7pgnq.js +2 -0
- package/dist/chunk-qczgdzjk.js +2 -0
- package/dist/{chunk-rgy9c7d8.js → chunk-qpz9jrvw.js} +3 -3
- package/dist/chunk-r40g6785.js +2 -0
- package/dist/chunk-r6085mp4.js +2 -0
- package/dist/{chunk-prrf0j54.js → chunk-r96ahk8s.js} +5 -5
- package/dist/chunk-rke4q3jk.js +2 -0
- package/dist/{chunk-mzyx6y1a.js → chunk-rqjskxpw.js} +32 -32
- package/dist/chunk-rrnvbwac.js +2 -0
- package/dist/{chunk-c78dsx3f.js → chunk-rtsshvpt.js} +10 -10
- package/dist/{chunk-66e0d2t7.js → chunk-rwc322gq.js} +2 -2
- package/dist/{chunk-r1984y6y.js → chunk-shnw9geh.js} +4 -4
- package/dist/{chunk-dspmqeg0.js → chunk-t4dkcf28.js} +114 -25
- package/dist/{chunk-2a792g5e.js → chunk-t5q31st4.js} +2 -2
- package/dist/{chunk-4jmkvzns.js → chunk-tb5h85ag.js} +2 -2
- package/dist/{chunk-098mrr5f.js → chunk-tbcvarvy.js} +2 -2
- package/dist/chunk-te1wksa0.js +2 -0
- package/dist/{chunk-6x6xthsv.js → chunk-tj533808.js} +2 -2
- package/dist/{chunk-jx14j83s.js → chunk-tm5t3hh3.js} +3 -3
- package/dist/{chunk-serwcna2.js → chunk-trgbdydw.js} +2 -2
- package/dist/chunk-v11hvvxc.js +2 -0
- package/dist/{chunk-fnfq6fkk.js → chunk-v929r67j.js} +1 -1
- package/dist/chunk-vasvns9e.js +2 -0
- package/dist/chunk-vdb3p2v3.js +2 -0
- package/dist/chunk-vm2y05sr.js +2 -0
- package/dist/{chunk-zyt8k9n0.js → chunk-wdwx2aa6.js} +2 -2
- package/dist/{chunk-6g7wrn48.js → chunk-wp14sf2j.js} +2 -2
- package/dist/{chunk-xhytkzg7.js → chunk-wzyc9da7.js} +2 -2
- package/dist/chunk-x2wn6mpd.js +2 -0
- package/dist/chunk-x45mp78q.js +2 -0
- package/dist/chunk-xa2qfe51.js +3 -0
- package/dist/{chunk-zjqvbcwa.js → chunk-xppm4cs4.js} +2 -2
- package/dist/{chunk-tzqnf28n.js → chunk-xr9rf0e6.js} +3 -3
- package/dist/chunk-xsmyhp5f.js +2 -0
- package/dist/{chunk-xj5j18nf.js → chunk-y1cneng3.js} +2 -2
- package/dist/{chunk-rn7710jg.js → chunk-y6wbbmp3.js} +3 -3
- package/dist/{chunk-evww725k.js → chunk-ynnd6nnt.js} +63 -63
- package/dist/{chunk-d4jhyxp6.js → chunk-yqjmqndq.js} +6 -6
- package/dist/{chunk-hff8z61n.js → chunk-yrmppd8r.js} +1 -1
- package/dist/{chunk-9d9sartn.js → chunk-z57xq46m.js} +1 -1
- package/dist/chunk-zecffe6a.js +2 -0
- package/dist/{chunk-ea5w92vs.js → chunk-zfb2wnha.js} +3 -3
- package/dist/cli.js +20 -20
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/floating-actions.d.ts +43 -0
- package/dist/native/floating-actions.js +50 -0
- package/dist/native/index.d.ts +1 -0
- package/dist/native/index.js +1 -0
- package/dist/native/primitives/FloatingActions.stx +42 -0
- package/dist/native/runtime/browser-screen.js +3 -8
- package/dist/page-head.d.ts +15 -0
- package/dist/page-head.js +35 -10
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +6 -6
- package/dist/template-compiler.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-07hvjvj1.js +0 -2
- package/dist/chunk-13sp1247.js +0 -2
- package/dist/chunk-1kdtapc1.js +0 -2
- package/dist/chunk-263gby2p.js +0 -2
- package/dist/chunk-33ggd5at.js +0 -2
- package/dist/chunk-3q19w77r.js +0 -2
- package/dist/chunk-40x0vwza.js +0 -2
- package/dist/chunk-4cmda04d.js +0 -2
- package/dist/chunk-5xt4tjpm.js +0 -2
- package/dist/chunk-6289h3tr.js +0 -2
- package/dist/chunk-6q7ke5p0.js +0 -2
- package/dist/chunk-6ya0860g.js +0 -2
- package/dist/chunk-8k7rfy77.js +0 -3
- package/dist/chunk-9enwmg0z.js +0 -2
- package/dist/chunk-a7z6j9ga.js +0 -2
- package/dist/chunk-ab6dw6f4.js +0 -2
- package/dist/chunk-adnntqk3.js +0 -2
- package/dist/chunk-bhzbcmm7.js +0 -2
- package/dist/chunk-cfez1qbm.js +0 -2
- package/dist/chunk-cgyddqxw.js +0 -2
- package/dist/chunk-cng4fhpt.js +0 -2
- package/dist/chunk-ctq1qy1g.js +0 -2
- package/dist/chunk-cyghcps7.js +0 -2
- package/dist/chunk-e26aqarz.js +0 -2
- package/dist/chunk-e7816ep3.js +0 -2
- package/dist/chunk-en8hnq2q.js +0 -2
- package/dist/chunk-enz6fsdx.js +0 -2
- package/dist/chunk-eydqn4gz.js +0 -2
- package/dist/chunk-fk7gs41v.js +0 -2
- package/dist/chunk-fx04tq90.js +0 -2
- package/dist/chunk-fzba0b0n.js +0 -2
- package/dist/chunk-g7tj2tnz.js +0 -2
- package/dist/chunk-ga0293gz.js +0 -2
- package/dist/chunk-gab3h25h.js +0 -2
- package/dist/chunk-hczqyk7c.js +0 -2
- package/dist/chunk-hs6fg0k9.js +0 -2
- package/dist/chunk-hsg4ggt0.js +0 -2
- package/dist/chunk-k3pfadjb.js +0 -2
- package/dist/chunk-kmnre1tq.js +0 -2
- package/dist/chunk-mgtp037k.js +0 -3
- package/dist/chunk-mp42d9v5.js +0 -2
- package/dist/chunk-mtmgrccj.js +0 -2
- package/dist/chunk-n20tsy6a.js +0 -2
- package/dist/chunk-nhn69eva.js +0 -4
- package/dist/chunk-pdt1phnh.js +0 -2
- package/dist/chunk-q87wwwra.js +0 -2
- package/dist/chunk-r1mvd96m.js +0 -2
- package/dist/chunk-rrj3gv46.js +0 -3
- package/dist/chunk-s321pb85.js +0 -2
- package/dist/chunk-st75663x.js +0 -2
- package/dist/chunk-stss2b88.js +0 -2
- package/dist/chunk-svxkcdhh.js +0 -2
- package/dist/chunk-t6gm8z7x.js +0 -2
- package/dist/chunk-tkssavxx.js +0 -2
- package/dist/chunk-tw6y23ew.js +0 -2
- package/dist/chunk-vm34qp5k.js +0 -2
- package/dist/chunk-vtg2tqzt.js +0 -2
- package/dist/chunk-wddaxpep.js +0 -2
- package/dist/chunk-x6bt567m.js +0 -2
- package/dist/chunk-xdzs2mxv.js +0 -32
- package/dist/chunk-xf4d9gam.js +0 -2
- package/dist/chunk-xf5db38j.js +0 -2
- package/dist/chunk-y5t7ec69.js +0 -2
- package/dist/chunk-yk90sqqv.js +0 -2
- package/dist/chunk-z231es22.js +0 -2
- package/dist/chunk-zphekzv8.js +0 -2
- package/dist/chunk-zsft5466.js +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import x from"fs";import u from"path";import p from"fs";import w from"path";var y=["components","layouts","partials","emails"];function M(e){return e.split(/[\\/]/).filter(Boolean).slice(0,-1).some((a)=>y.includes(a))}function b(e){return M(e.replace(/^\//,""))}function
|
|
3
|
-
`),o=w.join(t,"route-types.d.ts");try{if(p.existsSync(o)&&p.readFileSync(o,"utf8")===n)return;p.mkdirSync(t,{recursive:!0}),p.writeFileSync(o,n)}catch{}}function
|
|
4
|
-
`))}import I from"path";var N=Object.freeze(["ico","png","jpg","jpeg","gif","webp","avif","svg","bmp","tif","tiff","heic","css","js","mjs","cjs","map","wasm","webmanifest","json","xml","txt","rss","atom","woff","woff2","ttf","otf","eot","mp3","mp4","m4a","m4v","mov","webm","ogg","ogv","oga","wav","flac","avi","mkv","pdf","csv","doc","docx","xls","xlsx","ppt","pptx","rtf","odt","zip","gz","tgz","tar","rar","7z","bz2","xz","php","phtml","asp","aspx","jsp","cgi","env","ini","yml","yaml","toml","sql","bak","old","swp","log","conf","cfg","exe","dmg","pkg","apk","ipa","msi","iso","bin","dll"]),D=N.flatMap((e)=>e===e.toUpperCase()?[e]:[e,e.toUpperCase()]).join("|"),G=new RegExp(`\\.(?:${D})$`),E=`(?![^/]*\\.(?:${D})$)`;function kt(e){let t=e,a=t.search(/[?#]/);if(a!==-1)t=t.slice(0,a);let r=t.slice(t.lastIndexOf("/")+1);return r.length>0&&G.test(r)}function R(e,t){let r=I.relative(t,e).replace(/\.(stx|md)$/,"");if(r=r.split(I.sep).join("/"),r==="index")return"/";if(r.endsWith("/index"))r=r.slice(0,-6);return r=r.replace(/\[\[([^\]]+)\]\]/g,":$1?"),r=r.replace(/\[([^\]]+)\]/g,":$1"),r=r.replace(/:\.\.\.([^/]+)/g,":$1*"),`/${r}`}function de(e,t={}){let a=t.page?E:"",r=[],n="",o=0;while(o<e.length){let i=e.slice(o),c=/^\/:([^/?*]+)\?/.exec(i);if(c){r.push(c[1]);let d=o+c[0].length===e.length;n+=`(?:/${d?a:""}([^/]+))?`,o+=c[0].length;continue}let s=/^:([^/?*]+)\*/.exec(i);if(s){r.push(s[1]),n+="(.+)",o+=s[0].length;continue}let l=/^:([^/?*]+)/.exec(i);if(l){r.push(l[1]);let d=o+l[0].length===e.length;n+=`${d?a:""}([^/]+)`,o+=l[0].length;continue}n+=e[o].replace(/[.+^${}()|[\]\\*?]/g,"\\$&"),o+=1}return{regex:new RegExp(`^${n}$`),params:r}}function mr(e,t){let a=e===""?"/":e;for(let r of t){let n=a.match(r.regex);if(n){let o={};return r.params.forEach((i,c)=>{o[i]=n[c+1]}),{route:r,params:o}}}return null}function As(e,t={}){let a=e.replace(/\[\[([^\]]+)\]\]/g,":$1?").replace(/\[([^\]]+)\]/g,":$1").replace(/:\.\.\.([^/]+)/g,":$1*");return de(a,t)}import j from"fs";import L from"path";function _(e,t){let a=[],r=L.dirname(e);while(r.startsWith(t)||r===t){let n=L.join(r,"_layout.stx");if(j.existsSync(n))a.unshift(n);if(r===t)break;r=L.dirname(r)}return a}function B(e,t){let a=[];if(!x.existsSync(e))return a;let r=x.readdirSync(e,{withFileTypes:!0});for(let n of r){let o=u.join(e,n.name);if(n.isDirectory()){if(n.name.startsWith("."))continue;if(y.includes(n.name))continue;a.push(...B(o,t))}else if(n.isFile()){let i=u.extname(n.name);if(t.includes(i)){if(n.name.startsWith("_")&&n.name!=="_layout.stx")continue;if(n.name==="_layout.stx")continue;a.push(o)}}}return a}class hr{routes;pagesDir;pagesDirs;config;constructor(e,t={}){this.config=t;let a=t.pagesDirs&&t.pagesDirs.length>0?t.pagesDirs:[t.pagesDir||"pages"];this.pagesDirs=a.map((s)=>u.resolve(e,s)),this.pagesDir=this.pagesDirs[0];let r=t.extensions||[".stx"],n=(s)=>{let l=u.resolve(e,s);try{return x.realpathSync(l)}catch{return l}},o=(t.exclude??[]).filter((s)=>typeof s==="string"&&s.trim()!=="").map(n),i=(s)=>{if(o.length===0)return!1;let l=n(s);return o.some((d)=>l===d||l.startsWith(`${d}${u.sep}`))},c=new Set;this.routes=[];for(let s of this.pagesDirs){let l=B(s,r).filter((h)=>!i(h)),d=new Map;for(let h of l){let g=R(h,s),m=t.pagesDirs?g.replace(/:[\w]+/g,":param"):g;if(t.pagesDirs&&d.has(m))throw Error(`Conflicting layer pages for ${g}: ${d.get(m)} and ${h}`);if(d.set(m,h),c.has(m))continue;c.add(m);let{regex:X,params:P}=de(g,{page:!0}),C=t.layouts!==!1?_(h,s):[];this.routes.push({pattern:g,regex:X,params:P,filePath:h,isDynamic:P.length>0,layout:C.length>0?C[C.length-1]:void 0})}}if(this.routes.sort((s,l)=>{if(!s.isDynamic&&l.isDynamic)return-1;if(s.isDynamic&&!l.isDynamic)return 1;let d=s.pattern.split("/").length,h=l.pattern.split("/").length;if(d!==h)return h-d;return s.pattern.localeCompare(l.pattern)}),t.emit!==!1){let s=u.resolve(e,t.stateDir||process.env.STX_DIR?.trim()||".stx");ii(this.routes,s),ai(this.routes,s,this.pagesDir)}}match(e){let t=e===""?"/":e;for(let a of this.routes){let r=t.match(a.regex);if(r){let n={};return a.params.forEach((o,i)=>{n[o]=r[i+1]}),{route:a,params:n}}}return null}resolve(e,t){let a=this.routes.find((n)=>n.pattern===e||n.filePath.includes(e));if(!a)return"#not-found";let r=a.pattern;if(t)for(let[n,o]of Object.entries(t))r=r.replace(`:${n}`,encodeURIComponent(o));return r}addRoute(e){this.routes.push(e),this.routes.sort((t,a)=>{if(!t.isDynamic&&a.isDynamic)return-1;if(t.isDynamic&&!a.isDynamic)return 1;return t.pattern.localeCompare(a.pattern)})}getLayout(e){return e.layout??null}}function Ps(e,t){let a=[`${t}.stx`,"error.stx"];for(let r of a){let n=u.join(e,r);if(x.existsSync(n))return n}return null}function Is(e,t){return e.map((a)=>{let r=u.relative(t,a.filePath),n=a.isDynamic?" (dynamic)":"";return`${a.pattern} \u2192 ${r}${n}`})}var f={},k="";function Xf(e){k=e.replace(/\/$/,"")}function Gf(e,t,a={}){f[e]={path:t,name:e,params:a}}function Jf(e){for(let[t,a]of Object.entries(e))if(typeof a==="string")f[t]={path:a,name:t};else f[t]={...a,name:t}}function yr(e,t={},a=!1){let r=f[e];if(!r)return console.warn(`Route [${e}] not defined.`),"#undefined-route";let n={...r.params,...t},o=r.path;o=o.replace(/:(\w+)/g,(c,s)=>{let l=n[s];if(l===void 0)return console.warn(`Missing parameter [${s}] for route [${e}].`),`:${s}`;return delete n[s],encodeURIComponent(String(l))});let i=Object.entries(n);if(i.length>0){let c=i.map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");o+=(o.includes("?")?"&":"?")+c}return a&&k?`${k}${o}`:o}function Yf(){for(let e of Object.keys(f))delete f[e];k=""}import F from"fs";import q from"path";function Zf(e,t={}){return{type:"redirect",path:e,options:{replace:t.replace??!1,external:t.external??!1,redirectCode:t.redirectCode??302}}}function Qf(e){return{type:"abort",error:typeof e==="string"?{statusCode:500,message:e}:e}}function eg(e,t={}){return{handler:e,mode:t.mode??"universal"}}function O(e){let t={};if(!e)return t;let a=e.split(";");for(let r of a){let[n,...o]=r.split("=");if(n){let i=n.trim(),c=o.join("=").trim();if(i)t[i]=decodeURIComponent(c)}}return t}function S(e,t,a={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(a.expires){let n=typeof a.expires==="number"?new Date(Date.now()+a.expires*1000):a.expires;r+=`; Expires=${n.toUTCString()}`}if(a.path)r+=`; Path=${a.path}`;if(a.domain)r+=`; Domain=${a.domain}`;if(a.secure)r+="; Secure";if(a.httpOnly)r+="; HttpOnly";if(a.sameSite)r+=`; SameSite=${a.sameSite}`;return r}function $c(e,t){let a=e.headers.get("cookie")||"",r=O(a);return{get(n){return r[n]},set(n,o,i={}){r[n]=o,t.append("Set-Cookie",S(n,o,i))},delete(n){delete r[n],t.append("Set-Cookie",S(n,"",{expires:new Date(0),path:"/"}))},getAll(){return{...r}}}}function Rc(){return{get(e){if(typeof document>"u")return;return O(document.cookie)[e]},set(e,t,a={}){if(typeof document>"u")return;document.cookie=S(e,t,a)},delete(e){if(typeof document>"u")return;document.cookie=S(e,"",{expires:new Date(0),path:"/"})},getAll(){if(typeof document>"u")return{};return O(document.cookie)}}}function Ac(){let e=typeof window<"u"&&typeof window.localStorage<"u";return{get(t){if(!e)return null;try{return window.localStorage.getItem(t)}catch{return null}},set(t,a){if(!e)return;try{window.localStorage.setItem(t,a)}catch{}},remove(t){if(!e)return;try{window.localStorage.removeItem(t)}catch{}},isAvailable(){return e}}}var v=new Map;function ci(e,t){v.set(e,t)}function Pc(e){return v.get(e)}function tg(e){return v.has(e)}function _t(){v.clear()}function Ct(){return Array.from(v.keys())}async function Et(e,t="middleware"){let a=q.resolve(e,t);if(!F.existsSync(a))return;let r=F.readdirSync(a);for(let n of r){if(!n.endsWith(".ts")&&!n.endsWith(".js"))continue;if(n.includes(".test.")||n.includes(".spec."))continue;let o=n.replace(/\.(ts|js)$/,""),i=q.join(a,n);try{let s=(await import(i)).default;if(s&&typeof s.handler==="function")ci(o,s);else if(typeof s==="function")ci(o,{handler:s,mode:"universal"})}catch(c){console.warn(`Failed to load middleware '${o}' from ${i}:`,c)}}}function K(e){let t={};if(!e)return t;let a=new URLSearchParams(e);for(let[r,n]of a)t[r]=n;return t}function Tt(e,t,a,r=""){return{path:e,params:t,query:K(r),fullPath:r?`${e}?${r}`:e,meta:a}}function $t(e,t,a,r){let n=r?.isServer??typeof window>"u",o=!n,i=new Headers;return{to:e,from:t,isClient:o,isServer:n,cookies:n&&a?$c(a,i):Rc(),storage:Ac(),state:{},request:a,responseHeaders:i}}async function Rt(e,t){let a=Array.isArray(e)?e:[e],r=t.isServer;for(let n of a){let o=Pc(n);if(!o)return console.error(`Route middleware '${n}' is not registered \u2014 failing the guard closed.`),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:`Route middleware '${n}' is not registered`}},state:t.state,responseHeaders:t.responseHeaders};if(o.mode==="server"&&!r)continue;try{let i=await o.handler(t);if(i){if(i.type==="redirect")return{passed:!1,redirect:i,state:t.state,responseHeaders:t.responseHeaders};if(i.type==="abort")return{passed:!1,abort:i,state:t.state,responseHeaders:t.responseHeaders}}}catch(i){return console.error(`Error in middleware '${n}':`,i),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:i instanceof Error?i.message:"Middleware error"}},state:t.state,responseHeaders:t.responseHeaders}}}return{passed:!0,state:t.state,responseHeaders:t.responseHeaders}}function Os(e){let a=e.replace(/\\/g,"/").split("/").filter(Boolean),r=a.lastIndexOf("layouts"),n=r>=0?a[r+1]:a.at(-1);if(!n)return"app";return n.replace(/\.stx$/i,"")||"app"}function tt(e){let t=e.match(/<meta\b[^>]*name=["']stx-layout["'][^>]*content=["']([^"']+)["'][^>]*>/i),a=e.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i),r=e.match(/<!--\s*stx-layout:\s*([^ ]+)\s*-->/i),n=t?.[1]||r?.[1]||"";return{layout:n,group:a?.[1]||Os(n)}}var A,T;function W(e){let t=[],a="log(",r=0;while(r<e.length){let n=e.indexOf("log(",r);if(n===-1){t.push(e.slice(r));break}let o=n>0?e[n-1]:" ",i=/\bfunction\s+$/.test(e.slice(Math.max(0,n-16),n));if(/[\w$.]/.test(o)||i){t.push(e.slice(r,n+4)),r=n+4;continue}t.push(e.slice(r,n));let c=1,s=n+4;while(s<e.length&&c>0){let l=e[s];if(l==='"'||l==="'"||l==="`"){let d=l;s++;while(s<e.length&&e[s]!==d){if(e[s]==="\\")s++;s++}s++;continue}if(l==="(")c++;else if(l===")")c--;s++}t.push("0"),r=s}return t.join("")}function U(e,t=!1){try{return new Bun.Transpiler(t?{loader:"js",minify:{whitespace:!0,identifiers:!0}}:{loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return e}}function H(){return`
|
|
2
|
+
import x from"fs";import u from"path";import p from"fs";import w from"path";var y=["components","layouts","partials","emails"];function M(e){return e.split(/[\\/]/).filter(Boolean).slice(0,-1).some((a)=>y.includes(a))}function b(e){return M(e.replace(/^\//,""))}function ai(e,t){let a=e.filter((i)=>!b(i.pattern)),r=["// Auto-generated by STX - do not edit"];if(a.length===0)r.push("// No page routes found \u2014 route paths stay typed as string.","export {}","");else{r.push("declare module '@stacksjs/stx' {"," interface KnownRoutes {");for(let i of a){let c=[];for(let l of i.params){let d=i.pattern.includes(`:${l}?`)?"?":"";c.push(`${l}${d}: string`)}let s=c.join("; ");r.push(` '${i.pattern}': { ${s} }`)}r.push(" }","}","","export {}","")}let n=r.join(`
|
|
3
|
+
`),o=w.join(t,"route-types.d.ts");try{if(p.existsSync(o)&&p.readFileSync(o,"utf8")===n)return;p.mkdirSync(t,{recursive:!0}),p.writeFileSync(o,n)}catch{}}function ci(e,t,a){let r=process.cwd(),n=w.relative(r,a),o=e.filter((c)=>!b(c.pattern)),i=["// Auto-generated by stx \u2014 do not edit",`// Source: ${n||"pages"}/`,"","export const routes = ["];for(let c of o){let s=w.relative(r,c.filePath).replace(/\\/g,"/"),l=JSON.stringify(c.params),d=c.layout?`, layout: '${w.relative(r,c.layout).replace(/\\/g,"/")}'`:"";i.push(` { pattern: '${c.pattern}', filePath: '${s}', isDynamic: ${c.isDynamic}, params: ${l}${d} },`)}i.push("] as const",""),i.push("export type RouteName = typeof routes[number]['pattern']",""),p.mkdirSync(t,{recursive:!0}),p.writeFileSync(w.join(t,"routes.ts"),i.join(`
|
|
4
|
+
`))}import I from"path";var N=Object.freeze(["ico","png","jpg","jpeg","gif","webp","avif","svg","bmp","tif","tiff","heic","css","js","mjs","cjs","map","wasm","webmanifest","json","xml","txt","rss","atom","woff","woff2","ttf","otf","eot","mp3","mp4","m4a","m4v","mov","webm","ogg","ogv","oga","wav","flac","avi","mkv","pdf","csv","doc","docx","xls","xlsx","ppt","pptx","rtf","odt","zip","gz","tgz","tar","rar","7z","bz2","xz","php","phtml","asp","aspx","jsp","cgi","env","ini","yml","yaml","toml","sql","bak","old","swp","log","conf","cfg","exe","dmg","pkg","apk","ipa","msi","iso","bin","dll"]),D=N.flatMap((e)=>e===e.toUpperCase()?[e]:[e,e.toUpperCase()]).join("|"),X=new RegExp(`\\.(?:${D})$`),E=`(?![^/]*\\.(?:${D})$)`;function kt(e){let t=e,a=t.search(/[?#]/);if(a!==-1)t=t.slice(0,a);let r=t.slice(t.lastIndexOf("/")+1);return r.length>0&&X.test(r)}function R(e,t){let r=I.relative(t,e).replace(/\.(stx|md)$/,"");if(r=r.split(I.sep).join("/"),r==="index")return"/";if(r.endsWith("/index"))r=r.slice(0,-6);return r=r.replace(/\[\[([^\]]+)\]\]/g,":$1?"),r=r.replace(/\[([^\]]+)\]/g,":$1"),r=r.replace(/:\.\.\.([^/]+)/g,":$1*"),`/${r}`}function de(e,t={}){let a=t.page?E:"",r=[],n="",o=0;while(o<e.length){let i=e.slice(o),c=/^\/:([^/?*]+)\?/.exec(i);if(c){r.push(c[1]);let d=o+c[0].length===e.length;n+=`(?:/${d?a:""}([^/]+))?`,o+=c[0].length;continue}let s=/^:([^/?*]+)\*/.exec(i);if(s){r.push(s[1]),n+="(.+)",o+=s[0].length;continue}let l=/^:([^/?*]+)/.exec(i);if(l){r.push(l[1]);let d=o+l[0].length===e.length;n+=`${d?a:""}([^/]+)`,o+=l[0].length;continue}n+=e[o].replace(/[.+^${}()|[\]\\*?]/g,"\\$&"),o+=1}return{regex:new RegExp(`^${n}$`),params:r}}function hr(e,t){let a=e===""?"/":e;for(let r of t){let n=a.match(r.regex);if(n){let o={};return r.params.forEach((i,c)=>{o[i]=n[c+1]}),{route:r,params:o}}}return null}function Ps(e,t={}){let a=e.replace(/\[\[([^\]]+)\]\]/g,":$1?").replace(/\[([^\]]+)\]/g,":$1").replace(/:\.\.\.([^/]+)/g,":$1*");return de(a,t)}import j from"fs";import L from"path";function _(e,t){let a=[],r=L.dirname(e);while(r.startsWith(t)||r===t){let n=L.join(r,"_layout.stx");if(j.existsSync(n))a.unshift(n);if(r===t)break;r=L.dirname(r)}return a}function B(e,t){let a=[];if(!x.existsSync(e))return a;let r=x.readdirSync(e,{withFileTypes:!0});for(let n of r){let o=u.join(e,n.name);if(n.isDirectory()){if(n.name.startsWith("."))continue;if(y.includes(n.name))continue;a.push(...B(o,t))}else if(n.isFile()){let i=u.extname(n.name);if(t.includes(i)){if(n.name.startsWith("_")&&n.name!=="_layout.stx")continue;if(n.name==="_layout.stx")continue;a.push(o)}}}return a}class yr{routes;pagesDir;pagesDirs;config;constructor(e,t={}){this.config=t;let a=t.pagesDirs&&t.pagesDirs.length>0?t.pagesDirs:[t.pagesDir||"pages"];this.pagesDirs=a.map((s)=>u.resolve(e,s)),this.pagesDir=this.pagesDirs[0];let r=t.extensions||[".stx"],n=(s)=>{let l=u.resolve(e,s);try{return x.realpathSync(l)}catch{return l}},o=(t.exclude??[]).filter((s)=>typeof s==="string"&&s.trim()!=="").map(n),i=(s)=>{if(o.length===0)return!1;let l=n(s);return o.some((d)=>l===d||l.startsWith(`${d}${u.sep}`))},c=new Set;this.routes=[];for(let s of this.pagesDirs){let l=B(s,r).filter((h)=>!i(h)),d=new Map;for(let h of l){let g=R(h,s),m=t.pagesDirs?g.replace(/:[\w]+/g,":param"):g;if(t.pagesDirs&&d.has(m))throw Error(`Conflicting layer pages for ${g}: ${d.get(m)} and ${h}`);if(d.set(m,h),c.has(m))continue;c.add(m);let{regex:G,params:P}=de(g,{page:!0}),T=t.layouts!==!1?_(h,s):[];this.routes.push({pattern:g,regex:G,params:P,filePath:h,isDynamic:P.length>0,layout:T.length>0?T[T.length-1]:void 0})}}if(this.routes.sort((s,l)=>{if(!s.isDynamic&&l.isDynamic)return-1;if(s.isDynamic&&!l.isDynamic)return 1;let d=s.pattern.split("/").length,h=l.pattern.split("/").length;if(d!==h)return h-d;return s.pattern.localeCompare(l.pattern)}),t.emit!==!1){let s=u.resolve(e,t.stateDir||process.env.STX_DIR?.trim()||".stx");ai(this.routes,s),ci(this.routes,s,this.pagesDir)}}match(e){let t=e===""?"/":e;for(let a of this.routes){let r=t.match(a.regex);if(r){let n={};return a.params.forEach((o,i)=>{n[o]=r[i+1]}),{route:a,params:n}}}return null}resolve(e,t){let a=this.routes.find((n)=>n.pattern===e||n.filePath.includes(e));if(!a)return"#not-found";let r=a.pattern;if(t)for(let[n,o]of Object.entries(t))r=r.replace(`:${n}`,encodeURIComponent(o));return r}addRoute(e){this.routes.push(e),this.routes.sort((t,a)=>{if(!t.isDynamic&&a.isDynamic)return-1;if(t.isDynamic&&!a.isDynamic)return 1;return t.pattern.localeCompare(a.pattern)})}getLayout(e){return e.layout??null}}function Is(e,t){let a=[`${t}.stx`,"error.stx"];for(let r of a){let n=u.join(e,r);if(x.existsSync(n))return n}return null}function Os(e,t){return e.map((a)=>{let r=u.relative(t,a.filePath),n=a.isDynamic?" (dynamic)":"";return`${a.pattern} \u2192 ${r}${n}`})}var f={},k="";function Gf(e){k=e.replace(/\/$/,"")}function Jf(e,t,a={}){f[e]={path:t,name:e,params:a}}function Yf(e){for(let[t,a]of Object.entries(e))if(typeof a==="string")f[t]={path:a,name:t};else f[t]={...a,name:t}}function br(e,t={},a=!1){let r=f[e];if(!r)return console.warn(`Route [${e}] not defined.`),"#undefined-route";let n={...r.params,...t},o=r.path;o=o.replace(/:(\w+)/g,(c,s)=>{let l=n[s];if(l===void 0)return console.warn(`Missing parameter [${s}] for route [${e}].`),`:${s}`;return delete n[s],encodeURIComponent(String(l))});let i=Object.entries(n);if(i.length>0){let c=i.map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");o+=(o.includes("?")?"&":"?")+c}return a&&k?`${k}${o}`:o}function Zf(){for(let e of Object.keys(f))delete f[e];k=""}import F from"fs";import q from"path";function Qf(e,t={}){return{type:"redirect",path:e,options:{replace:t.replace??!1,external:t.external??!1,redirectCode:t.redirectCode??302}}}function eg(e){return{type:"abort",error:typeof e==="string"?{statusCode:500,message:e}:e}}function tg(e,t={}){return{handler:e,mode:t.mode??"universal"}}function O(e){let t={};if(!e)return t;let a=e.split(";");for(let r of a){let[n,...o]=r.split("=");if(n){let i=n.trim(),c=o.join("=").trim();if(i)t[i]=decodeURIComponent(c)}}return t}function S(e,t,a={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(a.expires){let n=typeof a.expires==="number"?new Date(Date.now()+a.expires*1000):a.expires;r+=`; Expires=${n.toUTCString()}`}if(a.path)r+=`; Path=${a.path}`;if(a.domain)r+=`; Domain=${a.domain}`;if(a.secure)r+="; Secure";if(a.httpOnly)r+="; HttpOnly";if(a.sameSite)r+=`; SameSite=${a.sameSite}`;return r}function Rc(e,t){let a=e.headers.get("cookie")||"",r=O(a);return{get(n){return r[n]},set(n,o,i={}){r[n]=o,t.append("Set-Cookie",S(n,o,i))},delete(n){delete r[n],t.append("Set-Cookie",S(n,"",{expires:new Date(0),path:"/"}))},getAll(){return{...r}}}}function Ac(){return{get(e){if(typeof document>"u")return;return O(document.cookie)[e]},set(e,t,a={}){if(typeof document>"u")return;document.cookie=S(e,t,a)},delete(e){if(typeof document>"u")return;document.cookie=S(e,"",{expires:new Date(0),path:"/"})},getAll(){if(typeof document>"u")return{};return O(document.cookie)}}}function Pc(){let e=typeof window<"u"&&typeof window.localStorage<"u";return{get(t){if(!e)return null;try{return window.localStorage.getItem(t)}catch{return null}},set(t,a){if(!e)return;try{window.localStorage.setItem(t,a)}catch{}},remove(t){if(!e)return;try{window.localStorage.removeItem(t)}catch{}},isAvailable(){return e}}}var v=new Map;function li(e,t){v.set(e,t)}function Ic(e){return v.get(e)}function ng(e){return v.has(e)}function _t(){v.clear()}function Ct(){return Array.from(v.keys())}async function Et(e,t="middleware"){let a=q.resolve(e,t);if(!F.existsSync(a))return;let r=F.readdirSync(a);for(let n of r){if(!n.endsWith(".ts")&&!n.endsWith(".js"))continue;if(n.includes(".test.")||n.includes(".spec."))continue;let o=n.replace(/\.(ts|js)$/,""),i=q.join(a,n);try{let s=(await import(i)).default;if(s&&typeof s.handler==="function")li(o,s);else if(typeof s==="function")li(o,{handler:s,mode:"universal"})}catch(c){console.warn(`Failed to load middleware '${o}' from ${i}:`,c)}}}function K(e){let t={};if(!e)return t;let a=new URLSearchParams(e);for(let[r,n]of a)t[r]=n;return t}function Tt(e,t,a,r=""){return{path:e,params:t,query:K(r),fullPath:r?`${e}?${r}`:e,meta:a}}function $t(e,t,a,r){let n=r?.isServer??typeof window>"u",o=!n,i=new Headers;return{to:e,from:t,isClient:o,isServer:n,cookies:n&&a?Rc(a,i):Ac(),storage:Pc(),state:{},request:a,responseHeaders:i}}async function Rt(e,t){let a=Array.isArray(e)?e:[e],r=t.isServer;for(let n of a){let o=Ic(n);if(!o)return console.error(`Route middleware '${n}' is not registered \u2014 failing the guard closed.`),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:`Route middleware '${n}' is not registered`}},state:t.state,responseHeaders:t.responseHeaders};if(o.mode==="server"&&!r)continue;try{let i=await o.handler(t);if(i){if(i.type==="redirect")return{passed:!1,redirect:i,state:t.state,responseHeaders:t.responseHeaders};if(i.type==="abort")return{passed:!1,abort:i,state:t.state,responseHeaders:t.responseHeaders}}}catch(i){return console.error(`Error in middleware '${n}':`,i),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:i instanceof Error?i.message:"Middleware error"}},state:t.state,responseHeaders:t.responseHeaders}}}return{passed:!0,state:t.state,responseHeaders:t.responseHeaders}}function Ns(e){let a=e.replace(/\\/g,"/").split("/").filter(Boolean),r=a.lastIndexOf("layouts"),n=r>=0?a[r+1]:a.at(-1);if(!n)return"app";return n.replace(/\.stx$/i,"")||"app"}function tt(e){let t=e.match(/<meta\b[^>]*name=["']stx-layout["'][^>]*content=["']([^"']+)["'][^>]*>/i),a=e.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i),r=e.match(/<!--\s*stx-layout:\s*([^ ]+)\s*-->/i),n=t?.[1]||r?.[1]||"";return{layout:n,group:a?.[1]||Ns(n)}}var A,C;function W(e){let t=[],a="log(",r=0;while(r<e.length){let n=e.indexOf("log(",r);if(n===-1){t.push(e.slice(r));break}let o=n>0?e[n-1]:" ",i=/\bfunction\s+$/.test(e.slice(Math.max(0,n-16),n));if(/[\w$.]/.test(o)||i){t.push(e.slice(r,n+4)),r=n+4;continue}t.push(e.slice(r,n));let c=1,s=n+4;while(s<e.length&&c>0){let l=e[s];if(l==='"'||l==="'"||l==="`"){let d=l;s++;while(s<e.length&&e[s]!==d){if(e[s]==="\\")s++;s++}s++;continue}if(l==="(")c++;else if(l===")")c--;s++}t.push("0"),r=s}return t.join("")}function U(e,t=!1){try{return new Bun.Transpiler(t?{loader:"js",minify:{whitespace:!0,identifiers:!0}}:{loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return e}}function H(){return`
|
|
5
5
|
;(function(){
|
|
6
6
|
'use strict';
|
|
7
7
|
var ROUTER_REV=8;
|
|
@@ -1667,26 +1667,36 @@ else {
|
|
|
1667
1667
|
link.setAttribute('data-css','generated');
|
|
1668
1668
|
link.setAttribute('rel','stylesheet');
|
|
1669
1669
|
link.setAttribute('href',new URL(href,location.href).href===abs?href:abs);
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
link.onload=
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1670
|
+
pending.push(holdCss(link));
|
|
1671
|
+
});
|
|
1672
|
+
return allCss(pending);
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
// Put a sheet in <head> unapplied and answer with its __stxCssReady, the
|
|
1676
|
+
// promise the swap waits on. Shared by generated and page stylesheets.
|
|
1677
|
+
function holdCss(link){
|
|
1678
|
+
link.setAttribute('media','print');
|
|
1679
|
+
link.setAttribute('data-stx-css-pending','');
|
|
1680
|
+
link.__stxCssReady=new Promise(function(resolve){
|
|
1681
|
+
var timer=setTimeout(finish,o.cssLoadTimeout);
|
|
1682
|
+
function finish(failed){
|
|
1683
|
+
clearTimeout(timer);link.onload=null;link.onerror=null;link.__stxCssReady=null;
|
|
1684
|
+
// A sheet that failed (a 5xx, a dropped connection) is gone for good:
|
|
1685
|
+
// swapping anyway painted the page with only the styles the
|
|
1686
|
+
// previous page happened to share, which reads as a broken layout.
|
|
1687
|
+
// Drop the dead <link> so a retry fetches it again, and report it.
|
|
1688
|
+
if(failed===true&&link.parentNode)link.parentNode.removeChild(link);
|
|
1689
|
+
resolve(failed!==true);
|
|
1690
|
+
}
|
|
1691
|
+
link.onload=function(){finish(false)};
|
|
1692
|
+
link.onerror=function(){finish(true)};
|
|
1688
1693
|
});
|
|
1689
|
-
|
|
1694
|
+
dhead().appendChild(link);
|
|
1695
|
+
return link.__stxCssReady;
|
|
1696
|
+
}
|
|
1697
|
+
// One answer for every sheet a swap waits on: null when there is none.
|
|
1698
|
+
function allCss(pending){
|
|
1699
|
+
return pending.some(Boolean)?Promise.all(pending).then(function(results){return results.indexOf(false)===-1}):null;
|
|
1690
1700
|
}
|
|
1691
1701
|
|
|
1692
1702
|
// Swap once the destination's sheets are in, or hand the navigation to the
|
|
@@ -1737,6 +1747,73 @@ else {
|
|
|
1737
1747
|
return hrefs;
|
|
1738
1748
|
}
|
|
1739
1749
|
|
|
1750
|
+
// \u2500\u2500 Page stylesheets \u2500\u2500
|
|
1751
|
+
// A fragment is the container's inner content, so the <link rel="stylesheet">
|
|
1752
|
+
// tags the destination declares in its own <head> never arrived with it: a
|
|
1753
|
+
// page reached by a link click rendered with the previous page's CSS and
|
|
1754
|
+
// none of its own, while a full load of the same URL was fine. The server
|
|
1755
|
+
// lists them in a template of their own, behind the fragment marker and the
|
|
1756
|
+
// metadata. They are assets, not metadata (#2121), so applyPageHead never
|
|
1757
|
+
// sees them, and only stylesheet links are read out of the list.
|
|
1758
|
+
//
|
|
1759
|
+
// Additive and deduped by absolute URL, like the full-document path: a sheet
|
|
1760
|
+
// the document has stays where it is, one it lacks is appended once, and
|
|
1761
|
+
// nothing is ever removed or reordered. Generated utility sheets are not
|
|
1762
|
+
// listed; promoteGeneratedCss owns those.
|
|
1763
|
+
var PAGE_CSS=/^(?:<!--stx-fragment[^>]*>)?(?:<template data-stx-page-head[^]*?<\\/template>\\n?)?<template data-stx-page-css="1">([^]*?)<\\/template>\\n?/;
|
|
1764
|
+
var PAGE_CSS_LINK='link[rel="stylesheet"][href]:not([data-css])';
|
|
1765
|
+
function fragmentPageCss(html){
|
|
1766
|
+
var payload=PAGE_CSS.exec(html);
|
|
1767
|
+
if(!payload)return [];
|
|
1768
|
+
// Parsed inert: a <template>'s content fetches nothing and applies nothing.
|
|
1769
|
+
var list=ce('template');
|
|
1770
|
+
list.innerHTML=payload[1];
|
|
1771
|
+
return list.content.querySelectorAll(PAGE_CSS_LINK);
|
|
1772
|
+
}
|
|
1773
|
+
function findPageCss(abs){
|
|
1774
|
+
var found=null;
|
|
1775
|
+
qsa('head '+PAGE_CSS_LINK).forEach(function(link){
|
|
1776
|
+
try{if(!found&&new URL(link.getAttribute('href'),location.href).href===abs)found=link}catch(e){}
|
|
1777
|
+
});
|
|
1778
|
+
return found;
|
|
1779
|
+
}
|
|
1780
|
+
// A sheet this path added goes live under the media its page declared. One
|
|
1781
|
+
// the document already had is left exactly as it was.
|
|
1782
|
+
function releasePageCss(link,media){
|
|
1783
|
+
if(!link||!link.hasAttribute('data-stx-css-pending'))return;
|
|
1784
|
+
link.removeAttribute('data-stx-css-pending');
|
|
1785
|
+
if(media)link.setAttribute('media',media);else link.removeAttribute('media');
|
|
1786
|
+
}
|
|
1787
|
+
// Before the swap, as preloadGeneratedCss: the sheets the document lacks are
|
|
1788
|
+
// added unapplied, and the swap waits for them so the new markup never
|
|
1789
|
+
// paints without its own CSS. Called again at the swap with live set, which
|
|
1790
|
+
// is when they start to apply.
|
|
1791
|
+
//
|
|
1792
|
+
// Each href is resolved against the page that declared it, never the one on
|
|
1793
|
+
// screen: a relative 'assets/app.css' on /docs/intro is /docs/assets/app.css
|
|
1794
|
+
// (#1777). It is stored absolute, so it still names the same file once the
|
|
1795
|
+
// address bar has moved on.
|
|
1796
|
+
function pageCss(links,base,live){
|
|
1797
|
+
var pending=[];
|
|
1798
|
+
links.forEach(function(decl){
|
|
1799
|
+
var abs,link;
|
|
1800
|
+
try{abs=new URL(decl.getAttribute('href'),new URL(base,location.href)).href}catch(e){return}
|
|
1801
|
+
link=findPageCss(abs);
|
|
1802
|
+
if(!link){
|
|
1803
|
+
link=ce('link');
|
|
1804
|
+
['crossorigin','integrity'].forEach(function(name){
|
|
1805
|
+
if(decl.hasAttribute(name))link.setAttribute(name,decl.getAttribute(name));
|
|
1806
|
+
});
|
|
1807
|
+
link.setAttribute('rel','stylesheet');
|
|
1808
|
+
link.setAttribute('href',abs);
|
|
1809
|
+
holdCss(link);
|
|
1810
|
+
}
|
|
1811
|
+
pending.push(link.__stxCssReady);
|
|
1812
|
+
if(live)releasePageCss(link,decl.getAttribute('media'));
|
|
1813
|
+
});
|
|
1814
|
+
return allCss(pending);
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1740
1817
|
// Everything page-level the outgoing page registered stays its own from
|
|
1741
1818
|
// here on: the runtime runs those on stx:load and keeps whatever the
|
|
1742
1819
|
// incoming page's scripts register next (see beginSwap in the runtime).
|
|
@@ -1752,6 +1829,10 @@ else {
|
|
|
1752
1829
|
if(isFragment){
|
|
1753
1830
|
var headPayload=/^<template data-stx-page-head="1">([\\s\\S]*?)<\\/template>\\n?/.exec(html);
|
|
1754
1831
|
if(headPayload){incomingHead=headPayload[1];html=html.slice(headPayload[0].length)}
|
|
1832
|
+
// The page's stylesheet list comes off as well: it is read here, and
|
|
1833
|
+
// must not be written into the container with the content.
|
|
1834
|
+
var incomingCss=fragmentPageCss(html);
|
|
1835
|
+
html=html.replace(PAGE_CSS,'');
|
|
1755
1836
|
}
|
|
1756
1837
|
if(!isFragment&&!isStxDocument(html)){log('[router] non-stx document \u2014 full navigation to:',url);location.href=url;return Promise.resolve(false)}
|
|
1757
1838
|
var ctx=pendingCtx||{direction:pushState==='replace'?'replace':pushState==='tab'?'tab':pushState===false?'pop':'push'};
|
|
@@ -1863,6 +1944,8 @@ else {
|
|
|
1863
1944
|
dhead().appendChild(cw);
|
|
1864
1945
|
}
|
|
1865
1946
|
}
|
|
1947
|
+
// The page's own sheets first, so its generated one still ends last.
|
|
1948
|
+
pageCss(incomingCss,url,true);
|
|
1866
1949
|
// Already present ones are MOVED last, not skipped \u2014 see
|
|
1867
1950
|
// promoteGeneratedCss for why their order is the whole bug.
|
|
1868
1951
|
promoteGeneratedCss(fragCssHrefs,location.href);
|
|
@@ -2018,7 +2101,8 @@ else {
|
|
|
2018
2101
|
// swaps, or the new markup paints once without its utilities and then
|
|
2019
2102
|
// jumps. Cleanup waits with it so the outgoing page stays live meanwhile.
|
|
2020
2103
|
// With nothing new to load this runs in the same turn, as it always did.
|
|
2021
|
-
|
|
2104
|
+
// The page's own stylesheets wait the same way, for the same reason.
|
|
2105
|
+
var fragCssReady=allCss([preloadGeneratedCss(fragmentCssHrefs(html),location.href),pageCss(incomingCss,url)]);
|
|
2022
2106
|
return afterCss(fragCssReady,url,startFragSwap);
|
|
2023
2107
|
}
|
|
2024
2108
|
|
|
@@ -2126,7 +2210,9 @@ else {
|
|
|
2126
2210
|
// below also reorders them.
|
|
2127
2211
|
if(l.hasAttribute('data-css'))return;
|
|
2128
2212
|
var abs=new URL(href,docBase).href;
|
|
2129
|
-
|
|
2213
|
+
// Present, but possibly still held unapplied by a fragment navigation
|
|
2214
|
+
// or a prefetch that never swapped; this page makes it live.
|
|
2215
|
+
if(curLinks[abs]){releasePageCss(findPageCss(abs),l.getAttribute('media'));return}
|
|
2130
2216
|
curLinks[abs]=1;
|
|
2131
2217
|
var nl=ce('link');
|
|
2132
2218
|
Array.from(l.attributes).forEach(function(a){nl.setAttribute(a.name,a.value)});
|
|
@@ -3654,6 +3740,8 @@ else {
|
|
|
3654
3740
|
// as a navigation adds it; the swap makes it live.
|
|
3655
3741
|
// A whole document's generated sheets too, named the same way in its head.
|
|
3656
3742
|
preloadGeneratedCss(fragmentCssHrefs(result.html),location.href);
|
|
3743
|
+
// And the stylesheets its own head links, which a fragment lists.
|
|
3744
|
+
pageCss(fragmentPageCss(result.html),href);
|
|
3657
3745
|
}
|
|
3658
3746
|
}).catch(function(){}).finally(function(){delete prefetching[key]})},!glance);
|
|
3659
3747
|
}
|
|
@@ -3738,6 +3826,7 @@ else {
|
|
|
3738
3826
|
// or loaded) rather than starting them; a failed sheet is the swap's to
|
|
3739
3827
|
// handle, so it does not hold this up. Generated sheets are root paths.
|
|
3740
3828
|
preloadGeneratedCss(fragmentCssHrefs(html),location.href);
|
|
3829
|
+
pageCss(fragmentPageCss(html),base);
|
|
3741
3830
|
var waits=loadModuleRegistries(html,base);
|
|
3742
3831
|
if(!waits)return null;
|
|
3743
3832
|
return Promise.race([
|
|
@@ -4095,4 +4184,4 @@ else {
|
|
|
4095
4184
|
|
|
4096
4185
|
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',init);else init();
|
|
4097
4186
|
})();
|
|
4098
|
-
`}function nt(){if(A)return A;return A=U(W(H()),!0),A}function
|
|
4187
|
+
`}function nt(){if(A)return A;return A=U(W(H()),!0),A}function rg(){if(C)return C;return C=U(H()),C}export{ai,ci,kt,de,hr,Ps,yr,Is,Os,Gf,Jf,Yf,br,Zf,Qf,eg,tg,Rc,Ac,Pc,li,Ic,ng,_t,Ct,Et,Tt,$t,Rt,Ns,tt,nt,rg};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var f=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),b=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);function l(i){return i.replace(/[^\n]/g," ")}function w(i){let o=i.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,l).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,l).replace(/<!--[\s\S]*?-->/g,l).replace(/\{\{\{[\s\S]*?\}\}\}/g,l).replace(/\{\{[\s\S]*?\}\}/g,l).replace(/\{!![\s\S]*?!!\}/g,l),s=new Map,r=new Map,p=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,t;while((t=p.exec(o))!==null){let e=t[1]==="/",n=t[2],a=t[3]==="/";if(f.has(n.toLowerCase()))continue;if(a)continue;if(e)r.set(n,(r.get(n)??0)+1);else{let g=s.get(n);if(g)g.count++;else{let d=o.slice(0,t.index).split(`
|
|
3
|
-
`).length;s.set(n,{count:1,firstLine:d})}}}let c=[];for(let e of new Set([...s.keys(),...r.keys()])){if(b.has(e.toLowerCase()))continue;let n=s.get(e)?.count??0,a=r.get(e)??0;if(n!==a)c.push({tag:e,opened:n,closed:a,firstOpenLine:s.get(e)?.firstLine??0})}return c}var u=new Set;function
|
|
4
|
-
export{
|
|
3
|
+
`).length;s.set(n,{count:1,firstLine:d})}}}let c=[];for(let e of new Set([...s.keys(),...r.keys()])){if(b.has(e.toLowerCase()))continue;let n=s.get(e)?.count??0,a=r.get(e)??0;if(n!==a)c.push({tag:e,opened:n,closed:a,firstOpenLine:s.get(e)?.firstLine??0})}return c}var u=new Set;function Fo(i,o){let s;try{s=w(i)}catch{return}if(s.length===0)return;let r=`${o}:${i.length}`;if(u.has(r))return;u.add(r);let p=o?o.split(/[/\\]/).pop()||o:"template";for(let{tag:t,opened:c,closed:e,firstOpenLine:n}of s)if(c>e){let a=n?` (first opened at line ${n})`:"";console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 an unclosed <${t}>${a} may swallow the content that follows it.`)}else console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 ${e-c} stray </${t}>.`)}
|
|
4
|
+
export{Fo};
|
|
@@ -72,7 +72,7 @@ else {
|
|
|
72
72
|
${t}
|
|
73
73
|
})();
|
|
74
74
|
</script>
|
|
75
|
-
`}function
|
|
75
|
+
`}function Ym(i,n,o){f=0;let l=/@defer\s*\(([^)]*)\)\s*([\s\S]*?)@enddefer/g;return i.replace(l,(t,e,s)=>{let a=v(),r=p(t,e,s),d=r.placeholder?`<div data-defer-placeholder>${r.placeholder}</div>`:"",c=r.loading?`<div data-defer-loading style="display: none;">${r.loading}</div>`:'<div data-defer-loading style="display: none;"></div>',g=r.error?`<div data-defer-error style="display: none;">${r.error}</div>`:"",u=`<div data-defer-content style="display: none;">${r.content}</div>`,h=E(a,r);return`
|
|
76
76
|
<div id="${a}" class="stx-defer" data-defer-trigger="${r.trigger}">
|
|
77
77
|
${d}
|
|
78
78
|
${c}
|
|
@@ -81,4 +81,4 @@ else {
|
|
|
81
81
|
</div>
|
|
82
82
|
${h}
|
|
83
83
|
`})}
|
|
84
|
-
export{
|
|
84
|
+
export{Ym};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a}from"./chunk-
|
|
3
|
-
export{
|
|
2
|
+
import{a}from"./chunk-rtsshvpt.js";import{xo}from"./chunk-12r22pf0.js";import p from"path";async function em(t={}){let l=performance.now(),s=t.root||process.cwd(),e=await a(s),o=t.ssr?.routeRules??e.routeRules??{};if(xo(o),!e.ssr&&Object.keys(o).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let u,n;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");u=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-vasvns9e.js");n=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let d=Math.round(performance.now()-l);return{mode:r,ssg:u,ssr:n,duration:d}}
|
|
3
|
+
export{em};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Mh,jf,Ye,pc,Lh,us,ds,ps}from"./chunk-f2zgh4xr.js";import"./chunk-shnw9geh.js";import"./chunk-xa2qfe51.js";import"./chunk-cww1zk8y.js";import"./chunk-he9dzchk.js";import"./chunk-ynnd6nnt.js";import"./chunk-gpkxphqz.js";import"./chunk-46t924aw.js";import"./chunk-eg2p1cyw.js";import"./chunk-xppm4cs4.js";import"./chunk-0wms5teg.js";export{Lh as clearOnceStore,pc as onceStore,Ye as partialsCache,us as processIncludes,ds as processStackPushDirectives,ps as processStackReplacements,Mh as resetUnscopedSignalWarnings,jf as topLevelElements};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{f,d}from"./chunk-
|
|
3
|
-
export{
|
|
2
|
+
import{f,d}from"./chunk-eg2p1cyw.js";import{Y,N,p}from"./chunk-ynnd6nnt.js";function B(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 k=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function E(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 Z(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=E(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 L(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=E(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||k.has(c)?-1:Z(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&&!k.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 j(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=E(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=B(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)&&!k.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 Kl(t){let o={default:"",named:new Map},i=t,r=j(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=L(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 Sm(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 Xl(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=I(e,s,a,u)}return e}function I(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(N(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!N(s,r))return e;let a=C(s,o);if(a===void 0)return e;return p(String(a??""))}catch{return`{{ ${n} }}`}})}function C(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 Gl(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={},A=[],M=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=M.exec(h))!==null){let w=b[1],x=b[2];S[w]=C(x,i),A.push([w,x])}if(r!==void 0&&m?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=m.propsBinding.trim(),x=Y(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let v=A.map(([O,z])=>{let R=S[O],_;try{_=R===void 0?void 0:JSON.stringify(R)}catch{}return`${JSON.stringify(O)}:(${_??z})`}).join(","),P=p(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${p(`${y} in [{${v}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${P}">${m.content}</template>`}return await Xl(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 km(t){let o=Kl(t);return{defaultSlot:o.default,namedSlots:o.named}}async function _m(t,o,i,r,e){return await Gl(t,{default:o,named:i},r,e)}
|
|
3
|
+
export{Kl,Sm,Xl,Gl,km,_m};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import y from"fs";import R from"path";var S="_stx";function F(e){return Bun.hash(e).toString(16).slice(0,8)}function k(e){let t=[],n=(i)=>{for(let s of y.readdirSync(i,{withFileTypes:!0})){let r=R.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(y.existsSync(e))n(e);return t}var z=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-runtime src="${e}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-router src="${e}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(e)=>`<link data-css="generated" rel="stylesheet" href="${e}">`}];function I(e,t=`/${S}`){let n=[],i=new Set,s=0,r=e;for(let o of z)r=r.replace(o.pattern,(g,u,c)=>{if(/\b(?:src|href)\s*=/.test(u)||!c.trim())return g;let a=`${o.prefix}.${F(c)}.${o.extension}`;if(!i.has(a))i.add(a),n.push({filename:a,contents:c,contentType:o.contentType});return s+=c.length,o.replace(`${t}/${a}`)});return{html:r,assets:n,bytesInlined:s}}function
|
|
2
|
+
import y from"fs";import R from"path";var S="_stx";function F(e){return Bun.hash(e).toString(16).slice(0,8)}function k(e){let t=[],n=(i)=>{for(let s of y.readdirSync(i,{withFileTypes:!0})){let r=R.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(y.existsSync(e))n(e);return t}var z=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-runtime src="${e}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-router src="${e}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(e)=>`<link data-css="generated" rel="stylesheet" href="${e}">`}];function I(e,t=`/${S}`){let n=[],i=new Set,s=0,r=e;for(let o of z)r=r.replace(o.pattern,(g,u,c)=>{if(/\b(?:src|href)\s*=/.test(u)||!c.trim())return g;let a=`${o.prefix}.${F(c)}.${o.extension}`;if(!i.has(a))i.add(a),n.push({filename:a,contents:c,contentType:o.contentType});return s+=c.length,o.replace(`${t}/${a}`)});return{html:r,assets:n,bytesInlined:s}}function rc(e){let t={pages:0,assets:0,bytesInlined:0},n=R.join(e,S),i=new Set;for(let s of k(e)){let r=y.readFileSync(s,"utf8"),{html:o,assets:g,bytesInlined:u}=I(r);if(o===r)continue;for(let c of g){if(i.has(c.filename))continue;i.add(c.filename),y.mkdirSync(n,{recursive:!0}),y.writeFileSync(R.join(n,c.filename),c.contents),t.assets++}y.writeFileSync(s,o),t.bytesInlined+=u,t.pages++}return t}import h from"fs";import T from"path";var L=1024,N=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,_=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function B(e){return Bun.hash(e).toString(16).slice(0,8)}function C(e){let t=[],n=(i)=>{for(let s of h.readdirSync(i,{withFileTypes:!0})){let r=T.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(h.existsSync(e))n(e);return t}function O(e,t){let n=e.match(new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!n)return;return n[2]??n[3]??n[4]??""}function H(e,t,n){if(n.length<L)return!1;if(/\b(?:src|href)\s*=/i.test(t))return!1;if(e.toLowerCase()==="script"){if(!_.has((O(t,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function D(e){let t=[];for(let n of e.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))t.push([n.index,n.index+n[0].length]);return t}function sc(e){let t={pages:0,assets:0,bytesInlined:0},n=C(e);if(n.length<2)return t;let i=new Map,s=new Map;for(let a of n){let f=h.readFileSync(a,"utf8");i.set(a,f);let M=D(f);for(let d of f.matchAll(N)){let[x,p,l,m]=d;if(!H(p,l,m))continue;if(M.some(([j,A])=>d.index>=j&&d.index<A))continue;let w=`${p.toLowerCase()}\x00${m}`,b=s.get(w);if(b)b.push({file:a,whole:x,tag:p,attrs:l,body:m});else s.set(w,[{file:a,whole:x,tag:p,attrs:l,body:m}])}}let r=[...s.values()].filter((a)=>new Set(a.map((f)=>f.file)).size>1);if(r.length===0)return t;let o=T.join(e,S),g=new Map(i),u=new Map,c=[];for(let a of r){let{tag:f,body:M}=a[0],d=f.toLowerCase()==="script",x=`${d?"chunk":"style"}.${B(M)}.${d?"js":"css"}`;c.push({filename:x,contents:M,contentType:d?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let p=`/${S}/${x}`;for(let l of a){let m=d?`<script${l.attrs} src="${p}"></script>`:`<link${l.attrs} rel="stylesheet" href="${p}">`,w=g.get(l.file),b=w.replace(l.whole,()=>m);if(b===w)continue;g.set(l.file,b),u.set(l.file,(u.get(l.file)??0)+l.body.length)}}h.mkdirSync(o,{recursive:!0});for(let a of c)h.writeFileSync(T.join(o,a.filename),a.contents),t.assets++;for(let[a,f]of g){if(f===i.get(a))continue;h.writeFileSync(a,f),t.pages++,t.bytesInlined+=u.get(a)??0}return t}import E from"fs";import v from"path";var K="layout-types.d.ts";function P(e){let t=[],n=(i,s)=>{let r;try{r=E.readdirSync(i,{withFileTypes:!0})}catch{return}for(let o of r){if(o.name.startsWith("."))continue;let g=v.join(i,o.name);if(o.isDirectory())n(g,s?`${s}/${o.name}`:o.name);else if(o.isFile()&&o.name.endsWith(".stx")&&o.name!=="_layout.stx"){let u=o.name.slice(0,-4);t.push(s?`${s}/${u}`:u)}}};return n(e,""),t.sort()}function W(e){let t=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(e.length===0)return t.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),t.join(`
|
|
3
3
|
`);return t.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...e.map((n)=>` '${n}': true`)," }","}","","export {}",""),t.join(`
|
|
4
|
-
`)}function
|
|
5
|
-
export{
|
|
4
|
+
`)}function oc(e,t){if(!e)return[];let n=v.isAbsolute(e)?e:v.resolve(process.cwd(),e),i=P(n),s=W(i),r=v.join(t,K);try{if(E.existsSync(r)&&E.readFileSync(r,"utf8")===s)return i;E.mkdirSync(t,{recursive:!0}),E.writeFileSync(r,s)}catch{}return i}
|
|
5
|
+
export{rc,sc,oc};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var{WebView:p}=globalThis.Bun;import{existsSync as y,mkdirSync as b,readdirSync as v,statSync as S}from"fs";import l from"path";var h=16384;function M(e){if(/^https?:\/\//.test(e)||e.startsWith("file://"))return e;return`file://${l.resolve(e)}`}function g(e,n,t,o){return new Promise((s)=>{let i=!1,r,m,c=()=>{if(!i){if(i=!0,clearTimeout(m),r)clearTimeout(r);e.onNavigated=void 0,s()}};m=setTimeout(c,o),e.onNavigated=()=>{if(!i)r=setTimeout(c,t)};try{let u=e.navigate(n);if(u&&typeof u.catch==="function")u.catch(c)}catch{c()}})}async function w(e,n,t){let o=`!!document.querySelector(${JSON.stringify(n)})`,s=Date.now()+t;while(Date.now()<s){try{if(await e.evaluate(o))return}catch{}await new Promise((i)=>setTimeout(i,100))}}async function T(e){try{let n=await e.evaluate("Math.ceil(Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight, document.body ? document.body.scrollHeight : 0, document.body ? document.body.offsetHeight : 0))");return typeof n==="number"&&Number.isFinite(n)&&n>0?Math.min(n,h):0}catch{return 0}}async function
|
|
3
|
-
export{
|
|
2
|
+
var{WebView:p}=globalThis.Bun;import{existsSync as y,mkdirSync as b,readdirSync as v,statSync as S}from"fs";import l from"path";var h=16384;function M(e){if(/^https?:\/\//.test(e)||e.startsWith("file://"))return e;return`file://${l.resolve(e)}`}function g(e,n,t,o){return new Promise((s)=>{let i=!1,r,m,c=()=>{if(!i){if(i=!0,clearTimeout(m),r)clearTimeout(r);e.onNavigated=void 0,s()}};m=setTimeout(c,o),e.onNavigated=()=>{if(!i)r=setTimeout(c,t)};try{let u=e.navigate(n);if(u&&typeof u.catch==="function")u.catch(c)}catch{c()}})}async function w(e,n,t){let o=`!!document.querySelector(${JSON.stringify(n)})`,s=Date.now()+t;while(Date.now()<s){try{if(await e.evaluate(o))return}catch{}await new Promise((i)=>setTimeout(i,100))}}async function T(e){try{let n=await e.evaluate("Math.ceil(Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight, document.body ? document.body.scrollHeight : 0, document.body ? document.body.offsetHeight : 0))");return typeof n==="number"&&Number.isFinite(n)&&n>0?Math.min(n,h):0}catch{return 0}}async function Nl(e,n,t={}){let o=Math.min(t.width??1440,h),s=Math.min(t.height??2200,h),i=t.waitMs??800,r=t.timeoutMs??15000,m=t.format??"png",c=M(e),u=(f)=>new p({width:o,height:f,headless:!0,...t.backend?{backend:t.backend}:{}}),a=u(s);try{if(await g(a,c,i,r),t.waitSelector)await w(a,t.waitSelector,r);if(t.fullPage){let d=await T(a);if(d>s){if(a.close(),a=u(d),await g(a,c,i,r),t.waitSelector)await w(a,t.waitSelector,r)}}let f=await a.screenshot({encoding:"buffer",format:m});b(l.dirname(l.resolve(n)),{recursive:!0}),await Bun.write(n,f)}finally{a.close()}if(!y(n))throw Error(`Screenshot was not produced for ${e}`);return{input:e,output:n,bytes:S(n).size}}async function Zg(e,n,t={}){b(n,{recursive:!0});let o;if(!/^https?:\/\//.test(e)&&y(e)&&S(e).isDirectory())o=v(e).filter((r)=>r.endsWith(".html")).map((r)=>l.join(e,r));else o=[e];let s=t.format??"png",i=[];for(let r of o){let m=/^https?:\/\//.test(r)?new URL(r).pathname.replace(/\W+/g,"-").replace(/^-|-$/g,"")||"index":l.basename(r).replace(/\.html?$/,"");i.push(await Nl(r,l.join(n,`${m}.${s}`),t))}return i}
|
|
3
|
+
export{Nl,Zg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{dh,So,ph,fh,gh,mh}from"./chunk-9mbyhepc.js";import"./chunk-fx8jjasv.js";import"./chunk-54p27ney.js";import"./chunk-hpwtjb4a.js";import"./chunk-63sqdcr6.js";import"./chunk-0zgxxhvs.js";import"./chunk-he9dzchk.js";import"./chunk-rtsshvpt.js";import"./chunk-xr9rf0e6.js";import"./chunk-jtccqpwa.js";import"./chunk-nws4zm4k.js";import"./chunk-09412heg.js";import"./chunk-t4dkcf28.js";import"./chunk-ynnd6nnt.js";import"./chunk-gpkxphqz.js";import"./chunk-46t924aw.js";import"./chunk-eg2p1cyw.js";import"./chunk-xppm4cs4.js";import"./chunk-0wms5teg.js";export{mh as clearStoreCache,dh as getStoreScript,gh as getStoreScriptFor,fh as pageStoresAll,So as storesRead,ph as storesReadInFiles};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-0wms5teg.js";import"./chunk-xppm4cs4.js";import"./chunk-eg2p1cyw.js";import{w,S,C,Z}from"./chunk-ynnd6nnt.js";import"./chunk-46t924aw.js";import"./chunk-gpkxphqz.js";import{lr}from"./chunk-14cvwsy1.js";import{existsSync as R}from"fs";import l 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","useCompletion","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","useVirtualList","useVisibility","useWakeLock","useWindowSize"],F=new Set(b);var u=new Map,h=w(64),x=new Set,k=0,P=new Set(b);function z(){u.clear(),h.clear()}function I(s){let o=new Map;for(let t of s){let i=l.basename(t);if(i.endsWith(".d.ts"))continue;let r=i.replace(/\.[jt]s$/,"");if(r==="index")continue;if(r===i)continue;let a=o.get(r);if(a&&!a.endsWith(".js"))continue;o.set(r,t)}return[...o.values()].sort()}function M(s,o){let t=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${t}\\b`).test(s)}function L(s){if(!s)return[];let o=S(s,k),t=h.get(o);if(t)return t.slice();let i=s.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,""),r=[];for(let a of P){if(x.has(a))continue;let p=a.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${p}\\s*\\(`).test(i))r.push(a)}return r.sort(),h.set(o,r),r.slice()}function _(){let s=l.join(import.meta.dir,"composables"),o=import.meta.url.endsWith(".ts")?"ts":"js";if(R(l.join(s,`index.${o}`)))return s;let t=lr("@stacksjs/stx/composables");return t?l.dirname(t):void 0}async function V(s,o){let t=L(s);if(t.length===0)return null;let i=o??_();if(!i)return null;let r=`${i}\x00${t.join(",")}`,a=u.get(r);if(a!==void 0)return a||null;let p=Z({loader:"ts",target:"browser",define:C()}),O=new Set(t),m=[],d=new Set,f=[];try{let n=new Bun.Glob("*.{ts,js}");for await(let e of n.scan({cwd:i,absolute:!0}))f.push(e)}catch{return u.set(r,""),null}f=I(f);for(let n of f){let e;try{e=await Bun.file(n).text()}catch{continue}let g=[];try{g=p.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(`// ${l.basename(n).replace(/\.[jt]s$/,"")}
|
|
3
3
|
${p.transformSync(e).trim()}`);for(let c of g)d.add(c)}catch(c){console.warn(`[stx] framework composable ${l.basename(n)} could not be bundled:`,c)}}let y=t.filter((n)=>!d.has(n)&&!M(s,n));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 u.set(r,""),null;let E=[...d].map((n)=>` try { if (!(${JSON.stringify(n)} in __s)) { __s[${JSON.stringify(n)}] = ${n}; if (!(${JSON.stringify(n)} in window)) window[${JSON.stringify(n)}] = ${n}; } } catch (e) {}`).join(`
|
|
4
4
|
`),v=`<script data-stx-scoped data-stx-run="always" data-stx-framework-composables>
|
|
5
5
|
;(function(){
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{lm}from"./chunk-3m5v3ynh.js";import"./chunk-ke76eaat.js";import"./chunk-ga650crj.js";import"./chunk-rwc322gq.js";import"./chunk-54p27ney.js";import"./chunk-c7qej674.js";import"./chunk-8vkywnpx.js";import"./chunk-f2zgh4xr.js";import"./chunk-t5q31st4.js";import"./chunk-shnw9geh.js";import"./chunk-xa2qfe51.js";import"./chunk-88a7qaw8.js";import"./chunk-cww1zk8y.js";import"./chunk-63sqdcr6.js";import"./chunk-0zgxxhvs.js";import"./chunk-he9dzchk.js";import"./chunk-0ey7kc6t.js";import"./chunk-rtsshvpt.js";import"./chunk-xr9rf0e6.js";import"./chunk-jtccqpwa.js";import"./chunk-nws4zm4k.js";import"./chunk-09412heg.js";import"./chunk-t4dkcf28.js";import"./chunk-ynnd6nnt.js";import"./chunk-gpkxphqz.js";import"./chunk-46t924aw.js";import"./chunk-eg2p1cyw.js";import"./chunk-xppm4cs4.js";import"./chunk-0wms5teg.js";export{lm as buildForProduction};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Oi,ly,uy,ml,Ue,Tg,to,dy,py,fy,gy,my,hy,yy,by,wy}from"./chunk-eg2p1cyw.js";export{hy as applyHead,dy as definePageMeta,Oi as getHead,ly as getPageMeta,Ue as mergeHeadConfigs,yy as processHeadDirective,wy as processMetaDirective,by as processTitleDirective,my as renderBodyAttrs,fy as renderHead,gy as renderHtmlAttrs,uy as resetHead,to as seoMetaToHeadConfig,ml as useHead,py as usePageTitle,Tg as useSeoMeta,py as useTitle};
|
|
@@ -298,5 +298,5 @@ catch (error) {
|
|
|
298
298
|
init();
|
|
299
299
|
}
|
|
300
300
|
})();
|
|
301
|
-
</script>`}var
|
|
302
|
-
export{
|
|
301
|
+
</script>`}var Ng={name:"pwa.installButton",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return r(t,n)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Dg={name:"pwa.updatePrompt",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return p(t,n)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},Mg={name:"pwa.offlineIndicator",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return d(t,n)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},Lg={name:"pwa.pushSubscribe",handler:(t,i,e,a)=>{let n=e.__stx_options||{};return l(t,n)},hasEndTag:!0,description:"Renders a push notification subscription button"},oo=[Ng,Dg,Mg,Lg];function vy(t){return[...t,...oo]}
|
|
302
|
+
export{Ng,Dg,Mg,Lg,oo,vy};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{T}from"./chunk-
|
|
2
|
+
import{T}from"./chunk-k44qj40k.js";import{We,Pn}from"./chunk-9sjtph54.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
|
|
3
3
|
maxEntries: ${o},
|
|
4
4
|
${u?`maxAgeSeconds: ${u},`:""}
|
|
5
5
|
purgeOnQuotaError: true,
|
|
@@ -17,7 +17,7 @@ registerRoute(
|
|
|
17
17
|
],`:""}
|
|
18
18
|
})
|
|
19
19
|
);`)}return c.join(`
|
|
20
|
-
`)}function p(e){if(e.startsWith("*.")){let t=e.slice(2);return`({ request }) => request.destination === '${f(t)}'`}if(e.endsWith("/**"))return`({ url }) => url.pathname.startsWith('${e.slice(0,-3)}')`;if(e.endsWith("/*")){let t=e.slice(0,-2);return`({ url }) => url.pathname.startsWith('${t}') && !url.pathname.slice(${t.length+1}).includes('/')`}if(e.includes("*")&&!e.startsWith("*")){let[t,r]=e.split("*");return`({ url }) => url.pathname.startsWith('${t}') && url.pathname.endsWith('${r}')`}if(e==="/"||!e.includes("*"))return`({ url }) => url.pathname === '${e}'`;return`new RegExp('${x(e).replace(/\\\*/g,".*")}')`}function f(e){return{js:"script",mjs:"script",css:"style",html:"document",htm:"document",png:"image",jpg:"image",jpeg:"image",gif:"image",svg:"image",webp:"image",avif:"image",ico:"image",woff:"font",woff2:"font",ttf:"font",eot:"font",otf:"font"}[e.toLowerCase()]||"empty"}function h(e){return"stx-"+e.replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase().slice(0,30)+"-cache"}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(e,t){let r=e.pwa;if(!r?.enabled)return{mode:"generate",modules:[],skipWaiting:!0,clientsClaim:!0};let n=r.serviceWorker||{},c=r.routes||[],a=[{name:"workbox-precaching",exports:["precacheAndRoute","cleanupOutdatedCaches"]},{name:"workbox-routing",exports:["registerRoute","NavigationRoute","setDefaultHandler"]}],i=new Set;for(let o of c)i.add(g(o.strategy));if(i.size>0)a.push({name:"workbox-strategies",exports:Array.from(i)});if(c.some((o)=>o.maxAgeSeconds||o.maxEntries)||r.cacheStorage)a.push({name:"workbox-expiration",exports:["ExpirationPlugin"]});if(c.some((o)=>o.strategy==="network-first"||o.strategy==="stale-while-revalidate"))a.push({name:"workbox-cacheable-response",exports:["CacheableResponsePlugin"]});if(r.backgroundSync?.enabled)a.push({name:"workbox-background-sync",exports:["BackgroundSyncPlugin","Queue"]});if(n.navigationPreload)a.push({name:"workbox-navigation-preload",exports:["enable"]});let l=t?We(t,e):void 0;return{mode:"generate",modules:a,precacheManifest:l?.entries,skipWaiting:n.skipWaiting??!0,clientsClaim:n.clientsClaim??!0,offlineFallback:r.offline?.enabled?"/offline.html":void 0,navigationPreload:n.navigationPreload??!1,cacheVersion:n.cacheVersion||"1.0.0"}}function W(e,t){let r=e.pwa;if(!r?.enabled)return"";let n=b(e,t),c=r.serviceWorker||{},{push:a,backgroundSync:i}=r,s=t?We(t,e):null,l=s?
|
|
20
|
+
`)}function p(e){if(e.startsWith("*.")){let t=e.slice(2);return`({ request }) => request.destination === '${f(t)}'`}if(e.endsWith("/**"))return`({ url }) => url.pathname.startsWith('${e.slice(0,-3)}')`;if(e.endsWith("/*")){let t=e.slice(0,-2);return`({ url }) => url.pathname.startsWith('${t}') && !url.pathname.slice(${t.length+1}).includes('/')`}if(e.includes("*")&&!e.startsWith("*")){let[t,r]=e.split("*");return`({ url }) => url.pathname.startsWith('${t}') && url.pathname.endsWith('${r}')`}if(e==="/"||!e.includes("*"))return`({ url }) => url.pathname === '${e}'`;return`new RegExp('${x(e).replace(/\\\*/g,".*")}')`}function f(e){return{js:"script",mjs:"script",css:"style",html:"document",htm:"document",png:"image",jpg:"image",jpeg:"image",gif:"image",svg:"image",webp:"image",avif:"image",ico:"image",woff:"font",woff2:"font",ttf:"font",eot:"font",otf:"font"}[e.toLowerCase()]||"empty"}function h(e){return"stx-"+e.replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase().slice(0,30)+"-cache"}function x(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(e,t){let r=e.pwa;if(!r?.enabled)return{mode:"generate",modules:[],skipWaiting:!0,clientsClaim:!0};let n=r.serviceWorker||{},c=r.routes||[],a=[{name:"workbox-precaching",exports:["precacheAndRoute","cleanupOutdatedCaches"]},{name:"workbox-routing",exports:["registerRoute","NavigationRoute","setDefaultHandler"]}],i=new Set;for(let o of c)i.add(g(o.strategy));if(i.size>0)a.push({name:"workbox-strategies",exports:Array.from(i)});if(c.some((o)=>o.maxAgeSeconds||o.maxEntries)||r.cacheStorage)a.push({name:"workbox-expiration",exports:["ExpirationPlugin"]});if(c.some((o)=>o.strategy==="network-first"||o.strategy==="stale-while-revalidate"))a.push({name:"workbox-cacheable-response",exports:["CacheableResponsePlugin"]});if(r.backgroundSync?.enabled)a.push({name:"workbox-background-sync",exports:["BackgroundSyncPlugin","Queue"]});if(n.navigationPreload)a.push({name:"workbox-navigation-preload",exports:["enable"]});let l=t?We(t,e):void 0;return{mode:"generate",modules:a,precacheManifest:l?.entries,skipWaiting:n.skipWaiting??!0,clientsClaim:n.clientsClaim??!0,offlineFallback:r.offline?.enabled?"/offline.html":void 0,navigationPreload:n.navigationPreload??!1,cacheVersion:n.cacheVersion||"1.0.0"}}function W(e,t){let r=e.pwa;if(!r?.enabled)return"";let n=b(e,t),c=r.serviceWorker||{},{push:a,backgroundSync:i}=r,s=t?We(t,e):null,l=s?Pn(s):"[]",o=k(n.modules),u=d(e);return`/**
|
|
21
21
|
* Service Worker - Generated by stx with Workbox
|
|
22
22
|
* Cache Version: ${n.cacheVersion}
|
|
23
23
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import d from"fs";import l from"path";function
|
|
2
|
+
import d from"fs";import l from"path";function Cl(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 El(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 Tl(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 $g(n,s){let e=Cl(n),a=s&&d.existsSync(s)?El(s):[];return Tl([...e,...a])}function Rg(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{
|
|
8
|
+
export{Cl,El,Tl,$g,Rg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{m,wi,Yc,Zc,gg,mg,hg,yg,bg,Ks,wg,Be,Z,Fe,vg,Rr,xg,tl,nl,Si,ze,r,xn,rl,h,ge,ry}from"./chunk-ynnd6nnt.js";import"./chunk-gpkxphqz.js";import"./chunk-46t924aw.js";import"./chunk-eg2p1cyw.js";import"./chunk-xppm4cs4.js";import"./chunk-0wms5teg.js";export{nl as SIGNAL_COMPOSABLE_CALL,ge as clearComponentCache,Si as componentClientSignalNames,wi as convertToCommonJS,h as createDetailedErrorMessage,bg as extractDirectiveNames,Yc as extractScriptFromTemplate,m as extractVariables,r as fileExists,ry as getComponentCacheStats,mg as getPositionInfo,Z as getSharedTranspiler,rl as getSourceLineInfo,yg as hasDirectives,Zc as hasVariables,xg as isHydrateTrigger,wg as isJavaScriptScript,ze as renderComponentWithSlot,xn as resolveTemplatePath,vg as scopeOnRootElement,Ks as scopeSequenceKey,Be as shouldTranspileTypeScript,tl as slotContentHasExpressions,Fe as transpileTypeScript,Rr as userComponentFileExists,hg as validateDirective,gg as validateTemplate};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{da,om,pa,im,Vl,Ul,am,cm}from"./chunk-056rsqc6.js";import"./chunk-y6wbbmp3.js";import"./chunk-fx8jjasv.js";import"./chunk-54p27ney.js";import"./chunk-hpwtjb4a.js";import"./chunk-63sqdcr6.js";import"./chunk-0zgxxhvs.js";import"./chunk-he9dzchk.js";import"./chunk-rtsshvpt.js";import"./chunk-xr9rf0e6.js";import"./chunk-jtccqpwa.js";import"./chunk-nws4zm4k.js";import"./chunk-09412heg.js";import"./chunk-t4dkcf28.js";import{Ot,sg}from"./chunk-ynnd6nnt.js";import"./chunk-gpkxphqz.js";import"./chunk-46t924aw.js";import"./chunk-eg2p1cyw.js";import"./chunk-xppm4cs4.js";import"./chunk-0wms5teg.js";export{da as buildScriptVirtualFile,om as buildVirtualSource,Ot as extractScriptBlocks,sg as extractTemplateExpressions,Vl as findRuntimeTypeDeclarations,Ul as findStxModuleDeclarations,cm as formatTypecheckDiagnostics,im as sourcePathFor,am as typecheckStxFiles,pa as virtualPathFor};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
function I(s){let o=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;s=s.replace(o,(e,t)=>`const { ${t.split(",").map((r)=>r.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
|
|
3
3
|
`);let n=/import\s*\{([^}]+)\}\s*from\s*['"]@composables['"]\s*;?\n?/g;return s=s.replace(n,(e,t)=>`const { ${t.split(",").map((r)=>r.trim()).filter(Boolean).join(", ")} } = window.__composables
|
|
4
|
-
`),s}function
|
|
5
|
-
export{I,
|
|
4
|
+
`),s}function An(s){return s.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}
|
|
5
|
+
export{I,An};
|