@stacksjs/stx 0.2.303 → 0.2.305
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/api-client.d.ts +26 -0
- package/dist/api-client.js +22 -0
- package/dist/api-handler.d.ts +6 -0
- package/dist/api-handler.js +3 -0
- package/dist/app-shell.js +11 -2
- package/dist/application-layers.d.ts +30 -0
- package/dist/application-layers.js +202 -0
- package/dist/build.js +9 -1
- package/dist/{chunk-rdg1n42s.js → chunk-00rtz7nw.js} +2 -2
- package/dist/chunk-02hm88m5.js +2 -0
- package/dist/chunk-044mychj.js +2 -0
- package/dist/{chunk-7eea1cse.js → chunk-09zjty4k.js} +1 -1
- package/dist/{chunk-7nfn7nj9.js → chunk-0gz0rhvs.js} +1 -1
- package/dist/chunk-113y4ywy.js +2 -0
- package/dist/{chunk-jsfch50r.js → chunk-1c2j4eby.js} +1 -1
- package/dist/{chunk-2m6x8tcx.js → chunk-1jbjrc0w.js} +2 -2
- package/dist/{chunk-m6wz1hf5.js → chunk-2h94c5hm.js} +2 -2
- package/dist/{chunk-mjpqz66q.js → chunk-2ver2s2y.js} +1 -1
- package/dist/chunk-3eervtf9.js +2 -0
- package/dist/{chunk-2rp09y5j.js → chunk-4evbx7sz.js} +1 -1
- package/dist/chunk-4jgr954p.js +2 -0
- package/dist/chunk-4mrhxtn3.js +18 -0
- package/dist/chunk-57ea6ye2.js +2 -0
- package/dist/{chunk-7eg7ep8f.js → chunk-5tefa8qb.js} +2 -2
- package/dist/{chunk-683tfkz4.js → chunk-64djh88a.js} +1 -1
- package/dist/{chunk-btrmvj2y.js → chunk-695fkras.js} +1 -1
- package/dist/{chunk-y7dcdjav.js → chunk-6zt2y7q3.js} +2 -2
- package/dist/chunk-7gqbr8nr.js +2 -0
- package/dist/{chunk-x4prtyjs.js → chunk-7kw3grq5.js} +1 -1
- package/dist/chunk-7m4yhzhb.js +6 -0
- package/dist/{chunk-7jebw3ea.js → chunk-7skk34dh.js} +2 -2
- package/dist/chunk-8ee62a9q.js +2 -0
- package/dist/{chunk-jj6yp7gm.js → chunk-8jam44my.js} +1 -1
- package/dist/chunk-8z0n5mtg.js +2 -0
- package/dist/chunk-92zzryxw.js +2 -0
- package/dist/{chunk-3bc8bqw2.js → chunk-9368t9jm.js} +1 -1
- package/dist/{chunk-3jwmcf4k.js → chunk-9c835qjn.js} +1 -1
- package/dist/chunk-9nf3hgvq.js +7 -0
- package/dist/chunk-a87jqtmd.js +2 -0
- package/dist/{chunk-5d9cy7a0.js → chunk-awj7yy37.js} +1 -1
- package/dist/chunk-b4xwbh8a.js +2 -0
- package/dist/{chunk-1evf3bdg.js → chunk-bd9wrcq1.js} +205 -19
- package/dist/chunk-bezqaxqt.js +2 -0
- package/dist/chunk-bk95q0bw.js +12 -0
- package/dist/{chunk-q25mr70f.js → chunk-c131k3mt.js} +1 -1
- package/dist/chunk-c1ae6afc.js +30 -0
- package/dist/{chunk-6btbgxh1.js → chunk-c79nfdyj.js} +1 -1
- package/dist/{chunk-cfgpk6bh.js → chunk-cbgh359m.js} +1 -1
- package/dist/{chunk-weqpt9nt.js → chunk-cr8v8k53.js} +1 -1
- package/dist/{chunk-p3wwm6k4.js → chunk-d19tvdvv.js} +1 -1
- package/dist/{chunk-nb1zdh1y.js → chunk-d3srvh3q.js} +1 -1
- package/dist/{chunk-rqrfq305.js → chunk-d57gb0v2.js} +1 -1
- package/dist/{chunk-1xyhk1wr.js → chunk-d5cqnwdd.js} +1 -1
- package/dist/chunk-dgpjxmhs.js +2 -0
- package/dist/chunk-dvvx1wny.js +3 -0
- package/dist/chunk-eans1ct0.js +43 -0
- package/dist/{chunk-ctz53mbz.js → chunk-ej8mv2k6.js} +1 -1
- package/dist/{chunk-zn6xcc0a.js → chunk-ek8cgwcg.js} +2 -2
- package/dist/{chunk-dv3z80gt.js → chunk-env6knrs.js} +1 -1
- package/dist/chunk-er848s6f.js +2 -0
- package/dist/{chunk-rf10fkrf.js → chunk-ess2pgt5.js} +1 -1
- package/dist/chunk-f1cgyd2h.js +3 -0
- package/dist/{chunk-hp3rjwnb.js → chunk-f325jzsk.js} +2 -2
- package/dist/{chunk-0tbgvp70.js → chunk-fczfdsab.js} +21 -5
- package/dist/chunk-fg0nf7cv.js +3754 -0
- package/dist/{chunk-xdq52pwj.js → chunk-fp7ms6e7.js} +1 -1
- package/dist/{chunk-qg6pg6ze.js → chunk-fqq5k9ve.js} +1 -1
- package/dist/{chunk-5t0w4h6z.js → chunk-g912mb7x.js} +1 -1
- package/dist/chunk-g97atepq.js +2 -0
- package/dist/{chunk-wj25qt72.js → chunk-gbwhbasw.js} +1 -1
- package/dist/chunk-gecmqs6p.js +17 -0
- package/dist/{chunk-cratkhhb.js → chunk-ghw5p1yk.js} +1 -1
- package/dist/{chunk-f0g2q51j.js → chunk-gssbag3e.js} +1 -1
- package/dist/{chunk-c9vhtjtr.js → chunk-gt8ja700.js} +2 -2
- package/dist/chunk-hftqr8ej.js +2 -0
- package/dist/{chunk-ftvmk1nj.js → chunk-hg2afckn.js} +1 -1
- package/dist/{chunk-hhnzd03k.js → chunk-hrcxfvh1.js} +1 -1
- package/dist/chunk-hzav4hyd.js +2 -0
- package/dist/{chunk-29gjwajm.js → chunk-jfzfrmzy.js} +1 -1
- package/dist/{chunk-ddqkj56r.js → chunk-jp2f8yzw.js} +1 -1
- package/dist/{chunk-ry3a2674.js → chunk-jsg1rthc.js} +1 -1
- package/dist/chunk-jxxv18a0.js +5 -0
- package/dist/{chunk-95t0k8cz.js → chunk-k23r03qj.js} +1 -1
- package/dist/{chunk-6b4k8fay.js → chunk-kxavsh3m.js} +1 -1
- package/dist/{chunk-4tffxxpd.js → chunk-m31n9pkr.js} +1 -1
- package/dist/{chunk-fj6fbqgb.js → chunk-m3a20mmb.js} +1 -1
- package/dist/chunk-m537zgay.js +2 -0
- package/dist/chunk-m8n0s4tk.js +28 -0
- package/dist/{chunk-j21csh4j.js → chunk-mbmqpaq1.js} +1 -1
- package/dist/{chunk-whm6bybj.js → chunk-mv5fdcwc.js} +3 -3
- package/dist/{chunk-y9nyqcha.js → chunk-mwh3ymwc.js} +1 -1
- package/dist/{chunk-51g95yts.js → chunk-mygq61f5.js} +2 -2
- package/dist/chunk-n99ajrwv.js +2 -0
- package/dist/chunk-ncrfrp95.js +2 -0
- package/dist/chunk-nqq7y7m9.js +3 -0
- package/dist/chunk-nws8fbde.js +2 -0
- package/dist/{chunk-q6xfyasj.js → chunk-pcvayb2f.js} +1 -1
- package/dist/chunk-phcvbqzn.js +2 -0
- package/dist/{chunk-nvxv2wxv.js → chunk-ppyz9623.js} +1 -1
- package/dist/{chunk-jb2r696a.js → chunk-qev11kg8.js} +1 -1
- package/dist/{chunk-6njgsr6w.js → chunk-qeyw5za9.js} +1 -1
- package/dist/chunk-qpzxgkc5.js +2 -0
- package/dist/chunk-qt2dmyq5.js +2 -0
- package/dist/chunk-r2k2sewg.js +2 -0
- package/dist/chunk-r808fpme.js +2 -0
- package/dist/chunk-rrankpmj.js +3 -0
- package/dist/chunk-rvyfyc43.js +2 -0
- package/dist/{chunk-3p0zgfgz.js → chunk-rzevgemj.js} +2 -2
- package/dist/{chunk-f62fh1fw.js → chunk-s3dnk3gc.js} +2 -2
- package/dist/{chunk-aa6kt84c.js → chunk-sart9ehj.js} +1 -1
- package/dist/chunk-sen2cxqm.js +2 -0
- package/dist/{chunk-jptkc64r.js → chunk-t3qb9s6s.js} +2 -2
- package/dist/{chunk-w8yac9xp.js → chunk-t41aaehf.js} +1 -1
- package/dist/{chunk-qjkzpd68.js → chunk-t51mwjyq.js} +1 -1
- package/dist/chunk-t8fqjb25.js +19 -0
- package/dist/{chunk-c6b5nqct.js → chunk-ta398s3d.js} +287 -352
- package/dist/chunk-tc6gqeha.js +2 -0
- package/dist/chunk-tt4r8q4v.js +2 -0
- package/dist/chunk-twbw18vs.js +2 -0
- package/dist/{chunk-6rzwef28.js → chunk-vd5xvsnv.js} +1 -1
- package/dist/chunk-w6d91maa.js +4 -0
- package/dist/{chunk-dcxtrqfy.js → chunk-wfffa8zm.js} +1 -1
- package/dist/chunk-wjdfhfj6.js +2 -0
- package/dist/chunk-wnamjw6n.js +3 -0
- package/dist/{chunk-22p0ezj6.js → chunk-wx13qmaw.js} +1 -1
- package/dist/chunk-x10mrzgp.js +2 -0
- package/dist/chunk-xd5ahrtn.js +2 -0
- package/dist/chunk-xsfwcj6x.js +2 -0
- package/dist/{chunk-91007tan.js → chunk-xwxdwqn9.js} +1 -1
- package/dist/{chunk-634gaa9d.js → chunk-xz3evxqp.js} +1 -1
- package/dist/chunk-xzgvcrnz.js +2 -0
- package/dist/{chunk-v8474ah4.js → chunk-y4nzmkea.js} +1 -1
- package/dist/{chunk-6w8fa3b8.js → chunk-ya5m5vbn.js} +1 -1
- package/dist/chunk-yd7jyyr7.js +2 -0
- package/dist/{chunk-ew6tr7b1.js → chunk-ydgdq45a.js} +2 -2
- package/dist/{chunk-ps20v1ah.js → chunk-ym3r8ktq.js} +1 -1
- package/dist/chunk-yyyxt326.js +2 -0
- package/dist/{chunk-yfwyvh02.js → chunk-ze44hhxb.js} +2 -2
- package/dist/{chunk-mdf3jbe6.js → chunk-zhcs8m2a.js} +2 -2
- package/dist/{chunk-f9d27v49.js → chunk-zs5y7xnt.js} +1 -1
- package/dist/chunk-zs95z9tf.js +2 -0
- package/dist/cli.js +14 -14
- package/dist/client-script-bundler.js +22 -11
- package/dist/component-contract-checks.d.ts +19 -0
- package/dist/component-contract-checks.js +147 -0
- package/dist/component-contract.d.ts +20 -0
- package/dist/component-contract.js +108 -0
- package/dist/component-model.d.ts +29 -0
- package/dist/component-model.js +59 -0
- package/dist/component-registry.js +7 -64
- package/dist/component-renderer.d.ts +1 -26
- package/dist/component-renderer.js +4 -239
- package/dist/component-resolution.d.ts +21 -0
- package/dist/component-resolution.js +118 -0
- package/dist/component-tags.d.ts +9 -0
- package/dist/component-tags.js +174 -0
- package/dist/composable-loader.d.ts +2 -13
- package/dist/composable-loader.js +15 -26
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.js +1 -0
- package/dist/composables/use-fetch.d.ts +117 -42
- package/dist/composables/use-fetch.js +47 -4
- package/dist/composition-api.d.ts +43 -19
- package/dist/config.d.ts +1 -1
- package/dist/config.js +46 -4
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/database.js +1 -1
- package/dist/dev-server/serve-app.js +57 -17
- package/dist/dev-server/serve-file.js +8 -1
- package/dist/expressions.js +1 -1
- package/dist/imported-signals.js +1 -1
- package/dist/includes.js +27 -3
- package/dist/index.d.ts +11 -0
- package/dist/index.js +7 -0
- package/dist/manifest.d.ts +6 -0
- package/dist/misc-directives.d.ts +2 -0
- package/dist/misc-directives.js +39 -1
- package/dist/process.js +18 -1
- package/dist/production-builder.d.ts +4 -0
- package/dist/production-builder.js +47 -8
- package/dist/production-server.d.ts +4 -1
- package/dist/production-server.js +119 -71
- package/dist/pwa.js +2 -2
- package/dist/render.js +9 -2
- package/dist/route-response-cache.d.ts +7 -0
- package/dist/route-response-cache.js +72 -0
- package/dist/route-rules.d.ts +17 -0
- package/dist/route-rules.js +40 -0
- package/dist/router.d.ts +1 -0
- package/dist/runtime-config-loader.d.ts +5 -0
- package/dist/runtime-config-loader.js +42 -0
- package/dist/runtime-config-server.d.ts +26 -0
- package/dist/runtime-config-server.js +77 -0
- package/dist/runtime-config-types.d.ts +2 -0
- package/dist/runtime-config-types.js +0 -0
- package/dist/runtime-config.d.ts +5 -0
- package/dist/runtime-config.js +9 -0
- package/dist/runtime-globals.js +3 -0
- package/dist/serve.js +32 -10
- package/dist/server-api.d.ts +27 -0
- package/dist/server-api.js +181 -0
- package/dist/server-data.d.ts +17 -0
- package/dist/server-data.js +40 -0
- package/dist/signal-processing.js +2 -2
- package/dist/signals.js +138 -15
- package/dist/ssg.js +2 -2
- package/dist/stx-virtual-ts.d.ts +6 -0
- package/dist/stx-virtual-ts.js +31 -7
- package/dist/stx.d.ts +28 -0
- package/dist/template-compiler.d.ts +1 -0
- package/dist/template-compiler.js +1 -1
- package/dist/template-hydrator.js +15 -4
- package/dist/typecheck.d.ts +1 -0
- package/dist/typecheck.js +4 -3
- package/dist/types/config-types.d.ts +17 -0
- package/dist/utils.js +15 -5
- package/dist/variable-extractor.d.ts +1 -1
- package/dist/variable-extractor.js +12 -1
- package/dist/visual-testing.js +1 -1
- package/dist/vue-template.js +19 -41
- package/package.json +5 -5
- package/stx.d.ts +28 -0
- package/dist/chunk-0p44z42s.js +0 -2
- package/dist/chunk-2jd9bxmf.js +0 -2
- package/dist/chunk-2yp8ang5.js +0 -2
- package/dist/chunk-35x7s4cr.js +0 -2
- package/dist/chunk-3bqz5zre.js +0 -2
- package/dist/chunk-48p0k8y7.js +0 -2
- package/dist/chunk-4b625drg.js +0 -2
- package/dist/chunk-593kby1d.js +0 -2
- package/dist/chunk-5nac67r4.js +0 -18
- package/dist/chunk-70cf5h11.js +0 -2
- package/dist/chunk-78akhaws.js +0 -2
- package/dist/chunk-9a4q74r6.js +0 -2
- package/dist/chunk-9f5329rv.js +0 -2
- package/dist/chunk-9rv7akqq.js +0 -30
- package/dist/chunk-apjy1a72.js +0 -12
- package/dist/chunk-b3p3bzax.js +0 -3
- package/dist/chunk-c5hk1fxt.js +0 -2
- package/dist/chunk-c9rs5g1s.js +0 -2
- package/dist/chunk-dkd0bg8g.js +0 -2
- package/dist/chunk-dxhtry04.js +0 -2
- package/dist/chunk-ehp6fez3.js +0 -2
- package/dist/chunk-em3jb1dn.js +0 -4
- package/dist/chunk-ev4djb0p.js +0 -2
- package/dist/chunk-frejnjh9.js +0 -2
- package/dist/chunk-fvcr26a0.js +0 -22
- package/dist/chunk-g6ttsdz1.js +0 -2
- package/dist/chunk-gd73rpks.js +0 -2
- package/dist/chunk-ggwnrdqz.js +0 -17
- package/dist/chunk-h3t6fjba.js +0 -2
- package/dist/chunk-jc57j887.js +0 -2
- package/dist/chunk-jw248h1d.js +0 -2
- package/dist/chunk-k5xtf38q.js +0 -3
- package/dist/chunk-m78y5qys.js +0 -19
- package/dist/chunk-mc4rtf5d.js +0 -2
- package/dist/chunk-mx2wcb15.js +0 -2
- package/dist/chunk-p4w3wjbv.js +0 -2
- package/dist/chunk-pm3k8dyk.js +0 -2
- package/dist/chunk-qr59yfq9.js +0 -2
- package/dist/chunk-qsmdvy1z.js +0 -2
- package/dist/chunk-rsxmjfxq.js +0 -3754
- package/dist/chunk-s4sp78fn.js +0 -2
- package/dist/chunk-v2fp9vkh.js +0 -2
- package/dist/chunk-vwnnbzsp.js +0 -2
- package/dist/chunk-w0g99tx9.js +0 -2
- package/dist/chunk-x2pk87q2.js +0 -3
- package/dist/chunk-xn0asg46.js +0 -2
- package/dist/chunk-xwmw1wtk.js +0 -2
- package/dist/chunk-zdx9s3z0.js +0 -28
|
@@ -1,5 +1,70 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Gj as B,Hj as R,Ij as H,Jj as S,Kj as F,Lj as M,Pj as E,Qj as P,Rj as O,Sj as I}from"./chunk-t41aaehf.js";import{ev as L}from"./chunk-rrankpmj.js";var w=null;function j(){return w}function f(z,W){if(w)w.provides.set(z,W);else V.set(z,W)}function k(z,W){let Q=w;while(Q){if(Q.provides.has(z))return Q.provides.get(z);Q=Q.parent}if(V.has(z))return V.get(z);return W}var V=new Map;function v(z,W){V.set(z,W)}function U(z){let W=w,Q=W?.el,Z=Array.isArray(z)?z:z&&typeof z==="object"?Object.keys(z):[];if(Q&&Z.length>0){let $=Q.__stx_component_emits||=Object.create(null);for(let Y of Z)$[Y]=!0}let _=($,...Y)=>{if(typeof document>"u")return;if(Q){let X=Q.__stx_component_emits||=Object.create(null);X[$]=!0,Q.dispatchEvent(new CustomEvent($,{detail:Y.length===1?Y[0]:Y,bubbles:!0,cancelable:!0}))}};if(W)W.emit=_;return _}function g(z){if(w)w.exposed=z}function m(z){let W=Promise.resolve();return z?W.then(z):W}function y(z){if(w)w.errorCapturedHooks.push(z)}function h(z,W,Q){let Z=W?.parent;while(Z){for(let _ of Z.errorCapturedHooks)if(_(z,W,Q)===!1)return;Z=Z.parent}}function p(){return w?.slots??{}}function u(){return w?.slots??{}}function l(){return w?.attrs??{}}function d(z){let W=z.__provides?new Map(Object.entries(z.__provides)):new Map;return{...z,__provides:W,__provide(Q,Z){W.set(Q,Z)},__inject(Q,Z){if(W.has(Q))return W.get(Q);if(z.__provides){let _=z.__provides instanceof Map?z.__provides:new Map(Object.entries(z.__provides));if(_.has(Q))return _.get(Q)}return Z}}}function i(){return`
|
|
3
|
+
// STX Composition API Runtime
|
|
4
|
+
(function() {
|
|
5
|
+
const _provides = new Map();
|
|
6
|
+
const _scopes = window.__stx_scopes || (window.__stx_scopes = {});
|
|
7
|
+
const _exposed = window.__stx_exposed || (window.__stx_exposed = {});
|
|
8
|
+
|
|
9
|
+
// provide() stores values in the nearest scope's provide map
|
|
10
|
+
window.__stx_provide = function(key, value) {
|
|
11
|
+
_provides.set(key, value);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// inject() walks up DOM ancestors with data-stx-scope to find provided values
|
|
15
|
+
window.__stx_inject = function(key, defaultValue, el) {
|
|
16
|
+
// Walk up the DOM tree
|
|
17
|
+
let current = el ? el.closest('[data-stx-scope]') : null;
|
|
18
|
+
while (current) {
|
|
19
|
+
const scopeId = current.getAttribute('data-stx-scope');
|
|
20
|
+
const scope = _scopes[scopeId];
|
|
21
|
+
if (scope && scope.__provided && scope.__provided.has(key)) {
|
|
22
|
+
return scope.__provided.get(key);
|
|
23
|
+
}
|
|
24
|
+
current = current.parentElement ? current.parentElement.closest('[data-stx-scope]') : null;
|
|
25
|
+
}
|
|
26
|
+
// Check global provides
|
|
27
|
+
if (_provides.has(key)) return _provides.get(key);
|
|
28
|
+
return defaultValue;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// defineEmits() returns an emit function
|
|
32
|
+
window.__stx_defineEmits = function(scopeId) {
|
|
33
|
+
return function emit(event, ...args) {
|
|
34
|
+
const el = document.querySelector('[data-stx-scope="' + scopeId + '"]');
|
|
35
|
+
if (el) {
|
|
36
|
+
el.dispatchEvent(new CustomEvent(event, {
|
|
37
|
+
detail: args.length === 1 ? args[0] : args,
|
|
38
|
+
bubbles: true,
|
|
39
|
+
cancelable: true
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// defineExpose() registers exposed properties
|
|
46
|
+
window.__stx_defineExpose = function(scopeId, exposed) {
|
|
47
|
+
_exposed[scopeId] = exposed;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// nextTick()
|
|
51
|
+
window.__stx_nextTick = function(fn) {
|
|
52
|
+
return Promise.resolve().then(fn);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// Template ref resolution
|
|
56
|
+
window.__stx_resolveRefs = function(scopeId) {
|
|
57
|
+
const scope = document.querySelector('[data-stx-scope="' + scopeId + '"]');
|
|
58
|
+
if (!scope) return {};
|
|
59
|
+
const refs = {};
|
|
60
|
+
// eslint-disable-next-line pickier/no-unused-vars
|
|
61
|
+
scope.querySelectorAll('[data-stx-ref]').forEach(function(el) {
|
|
62
|
+
refs[el.getAttribute('data-stx-ref')] = el;
|
|
63
|
+
});
|
|
64
|
+
return refs;
|
|
65
|
+
};
|
|
66
|
+
})();
|
|
67
|
+
`}function T(z,W,Q,Z,_){let $=!0,Y=new Set,X=(J)=>Z.get?Z.get(J):J,G=()=>X(z());return Object.defineProperty(G,"_isSignal",{value:!0}),Object.defineProperty(G,"modifiers",{get:W}),G.set=(J)=>{if(!$)return;let N=W(),A=Z.set?Z.set(J,N):J;if(N.trim&&typeof A==="string")A=A.trim();if(N.number&&typeof A==="string"&&A!==""){let K=Number(A);if(!Number.isNaN(K))A=K}if(Object.is(z(),A))return;z.set(A),Q(A)},G.update=(J)=>G.set(J(G())),G.input=(J)=>{if(!W().lazy)G.set(J)},G.change=(J)=>{if(W().lazy)G.set(J)},G.subscribe=(J)=>{if(!$)return()=>{};let N=z.subscribe((A,K)=>J(X(A),X(K)));return Y.add(N),()=>{N(),Y.delete(N)}},Object.defineProperty(G,"value",{get:G,set:G.set}),_(()=>{$=!1,Y.forEach((J)=>J()),Y.clear()}),G}function n(z="modelValue",W={}){let Q=typeof z==="string"?z:"modelValue",Z=typeof z==="string"?W:z,_=j()?.props||{},$=U([`update:${Q}`]),Y=Q==="modelValue"?"modelModifiers":`${Q}Modifiers`,X=(N)=>E(_[N])||P(_[N])?_[N]():_[N],G=B(Z.default),J=H(()=>{let N=X(Q);G.set(N===void 0?Z.default:N)});return M(J),T(G,()=>X(Y)||{},(N)=>$(`update:${Q}`,N),Z,M)}function q(z,W=!0,Q){if(!W||!z||typeof window>"u")return;let Z=window;if(!Z.__STX_DATA__){let $=document.querySelector("script[data-stx-server-data]");try{let Y=JSON.parse($?.textContent||"{}");Z.__STX_DATA__=Y&&typeof Y==="object"&&!Array.isArray(Y)?Y:{}}catch{Z.__STX_DATA__={}}}let _=Z.__STX_DATA__;if(_&&Object.prototype.hasOwnProperty.call(_,z))try{return{data:Q?Q(_[z]):_[z]}}catch($){return{data:null,error:$ instanceof Error?$:Error(String($))}}return}function D(z){if(typeof window>"u")return;let W=window;if(z===void 0)W.__STX_DATA__={};else{if(!W.__STX_DATA__)try{let Q=JSON.parse(document.querySelector("script[data-stx-server-data]")?.textContent||"{}");W.__STX_DATA__=Q&&typeof Q==="object"&&!Array.isArray(Q)?Q:{}}catch{W.__STX_DATA__={}}if(W.__STX_DATA__)delete W.__STX_DATA__[z]}}function C(){let z=b(x());try{let Q=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(z);return Q=Q.replace(/\}(var |let |const |function )/g,"};$1"),Q}catch{return z}}function b(z){let W=[],Q=0,Z="console.log(";while(Q<z.length){let _=z.indexOf(Z,Q);if(_===-1){W.push(z.slice(Q));break}W.push(z.slice(Q,_));let $=1,Y=_+Z.length;while(Y<z.length&&$>0){let X=z[Y];if(X==='"'||X==="'"||X==="`"){let G=X;Y++;while(Y<z.length&&z[Y]!==G){if(z[Y]==="\\")Y++;Y++}Y++;continue}if(X==="(")$++;else if(X===")")$--;Y++}W.push("0"),Q=Y}return W.join("")}function x(){return`
|
|
3
68
|
// STX Signals Runtime (Development Build)
|
|
4
69
|
console.log('[stx] signals runtime loading');
|
|
5
70
|
// Pre-initialization shim: capture onMount/onDestroy calls made before the runtime IIFE runs
|
|
@@ -68,6 +133,13 @@ console.log('[stx] entering IIFE');
|
|
|
68
133
|
// The body is attached rather than only interpolated: err.data is what a
|
|
69
134
|
// caller needs to render field errors, and err.status is what it needs to
|
|
70
135
|
// tell 401 from 500 without parsing the message.
|
|
136
|
+
function __stxRawBody(body) {
|
|
137
|
+
return (typeof FormData !== 'undefined' && body instanceof FormData)
|
|
138
|
+
|| (typeof Blob !== 'undefined' && body instanceof Blob)
|
|
139
|
+
|| (typeof URLSearchParams !== 'undefined' && body instanceof URLSearchParams)
|
|
140
|
+
|| (typeof ArrayBuffer !== 'undefined' && (body instanceof ArrayBuffer || ArrayBuffer.isView(body)));
|
|
141
|
+
}
|
|
142
|
+
|
|
71
143
|
async function __stxHttpError(response) {
|
|
72
144
|
var body = null;
|
|
73
145
|
var text = '';
|
|
@@ -102,8 +174,63 @@ console.log('[stx] entering IIFE');
|
|
|
102
174
|
// hook fails the request, which is what a token-refresh flow wants.
|
|
103
175
|
var __stxFetchHooks = { onRequest: null, onResponse: null, onResponseError: null };
|
|
104
176
|
|
|
177
|
+
// Double-submit CSRF, echoed for every same-origin unsafe request. A server
|
|
178
|
+
// using the pattern (Stacks does, by default, on every POST/PUT/PATCH/DELETE)
|
|
179
|
+
// plants a readable cookie and rejects any unsafe request whose header does
|
|
180
|
+
// not repeat it. Nothing here repeated it, so a form posting through
|
|
181
|
+
// useMutation - or the framework's own CMS form block - got 403 "CSRF token
|
|
182
|
+
// mismatch" on a stock install. The same thing axios does for XSRF-TOKEN.
|
|
183
|
+
// Only same-origin: the token must never leave for another host.
|
|
184
|
+
var __stxCsrf = { cookie: 'X-CSRF-Token', header: 'X-CSRF-Token' };
|
|
185
|
+
|
|
186
|
+
function __stxCookie(name) {
|
|
187
|
+
if (typeof document === 'undefined' || !document.cookie) return null;
|
|
188
|
+
var parts = document.cookie.split(';');
|
|
189
|
+
for (var i = 0; i < parts.length; i++) {
|
|
190
|
+
var at = parts[i].indexOf('=');
|
|
191
|
+
if (at === -1) continue;
|
|
192
|
+
if (parts[i].slice(0, at).trim() !== name) continue;
|
|
193
|
+
var value = parts[i].slice(at + 1).trim();
|
|
194
|
+
try { return value ? decodeURIComponent(value) : null; } catch (e) { return value || null; }
|
|
195
|
+
}
|
|
196
|
+
return null;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function __stxApplyCsrf(url, opts) {
|
|
200
|
+
if (!__stxCsrf) return;
|
|
201
|
+
var method = String((opts && opts.method) || 'GET').toUpperCase();
|
|
202
|
+
if (method === 'GET' || method === 'HEAD' || method === 'OPTIONS') return;
|
|
203
|
+
// A path is same-origin by definition; only an absolute URL needs its
|
|
204
|
+
// origin compared, and one that cannot be parsed is not trusted.
|
|
205
|
+
var target = String(url);
|
|
206
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(target) || target.slice(0, 2) === '//') {
|
|
207
|
+
if (typeof location === 'undefined') return;
|
|
208
|
+
try {
|
|
209
|
+
if (new URL(target).origin !== location.origin) return;
|
|
210
|
+
} catch (e) { return; }
|
|
211
|
+
}
|
|
212
|
+
var token = __stxCookie(__stxCsrf.cookie);
|
|
213
|
+
if (!token) return;
|
|
214
|
+
var headers = __stxHeaders(opts.headers);
|
|
215
|
+
var wanted = __stxCsrf.header.toLowerCase();
|
|
216
|
+
for (var key in headers) {
|
|
217
|
+
// A token the caller set on purpose wins.
|
|
218
|
+
if (key.toLowerCase() === wanted) return;
|
|
219
|
+
}
|
|
220
|
+
headers[__stxCsrf.header] = token;
|
|
221
|
+
opts.headers = headers;
|
|
222
|
+
}
|
|
223
|
+
|
|
105
224
|
function configureFetch(cfg) {
|
|
106
225
|
cfg = cfg || {};
|
|
226
|
+
// Unlike the hooks below, CSRF settings persist unless named: an app that
|
|
227
|
+
// installs an Authorization hook has not asked to stop sending the token.
|
|
228
|
+
// \`csrf: false\` turns it off; \`{ cookie, header }\` renames either side.
|
|
229
|
+
if (Object.prototype.hasOwnProperty.call(cfg, 'csrf')) {
|
|
230
|
+
__stxCsrf = cfg.csrf === false || cfg.csrf === null
|
|
231
|
+
? null
|
|
232
|
+
: { cookie: (cfg.csrf && cfg.csrf.cookie) || 'X-CSRF-Token', header: (cfg.csrf && (cfg.csrf.header || cfg.csrf.cookie)) || 'X-CSRF-Token' };
|
|
233
|
+
}
|
|
107
234
|
// Replace rather than stack: a module re-evaluated by hot reload or by a
|
|
108
235
|
// SPA script re-run must not end up with the same interceptor installed
|
|
109
236
|
// twice, sending two Authorization headers or counting a 401 twice.
|
|
@@ -129,6 +256,8 @@ console.log('[stx] entering IIFE');
|
|
|
129
256
|
async function __stxFetch(source, url, opts) {
|
|
130
257
|
var t0 = __stxDevtoolsNow();
|
|
131
258
|
opts = opts || {};
|
|
259
|
+
// Before the hooks, so an onRequest hook sees (and may override) it.
|
|
260
|
+
__stxApplyCsrf(url, opts);
|
|
132
261
|
if (__stxFetchHooks.onRequest) {
|
|
133
262
|
// Normalised first so a hook can write ctx.options.headers.Authorization
|
|
134
263
|
// without having to create the bag itself.
|
|
@@ -1075,20 +1204,25 @@ finally {
|
|
|
1075
1204
|
// Declarative Data Fetching (Feature #6 - useFetch)
|
|
1076
1205
|
// ==========================================================================
|
|
1077
1206
|
|
|
1207
|
+
var readHydratedData = ${q.toString()};
|
|
1208
|
+
var clearServerData = ${D.toString()};
|
|
1209
|
+
|
|
1078
1210
|
function useFetch(urlOrFn, options = {}) {
|
|
1079
|
-
const
|
|
1211
|
+
const hydrated = readHydratedData(options.key, options.hydrate !== false, options.transform);
|
|
1212
|
+
const initial = hydrated ? hydrated.data : (options.initialData ?? null);
|
|
1213
|
+
const data = state(initial);
|
|
1080
1214
|
// Starts false when nothing will be requested. It used to start true
|
|
1081
1215
|
// unconditionally while the only thing clearing it was the fetch that
|
|
1082
1216
|
// immediate:false suppresses \u2014 so the documented way to declare a deferred
|
|
1083
1217
|
// request produced a composable stuck loading forever, which is exactly the
|
|
1084
1218
|
// case where a template is most likely driving a spinner off it (#1818).
|
|
1085
|
-
const immediate = options.immediate !== false;
|
|
1219
|
+
const immediate = options.immediate !== false && !hydrated;
|
|
1086
1220
|
const loading = state(immediate);
|
|
1087
1221
|
// Any request in flight, background ones included. loading answers "is
|
|
1088
1222
|
// there nothing to show yet"; isFetching answers "is a request open" \u2014 and
|
|
1089
1223
|
// a background refresh is the case where those two stop agreeing (#1929).
|
|
1090
1224
|
const isFetching = state(immediate);
|
|
1091
|
-
const error = state(null);
|
|
1225
|
+
const error = state(hydrated ? (hydrated.error || null) : null);
|
|
1092
1226
|
if (options.suspense) registerSuspense(loading, error);
|
|
1093
1227
|
|
|
1094
1228
|
// A superseded or unmounted request must not resolve into a torn-down
|
|
@@ -1219,6 +1353,7 @@ else if (immediate) {
|
|
|
1219
1353
|
// from the getter made an early component resolve refs from whichever
|
|
1220
1354
|
// component happened to hydrate last.
|
|
1221
1355
|
var ownerScope = currentLifecycleScope() || componentScope;
|
|
1356
|
+
var ownerRefs = ownerScope.$refs || (ownerScope.$refs = {});
|
|
1222
1357
|
|
|
1223
1358
|
// Callable, as well as .current / .value.
|
|
1224
1359
|
//
|
|
@@ -1233,7 +1368,7 @@ else if (immediate) {
|
|
|
1233
1368
|
//
|
|
1234
1369
|
// No backticks in here: this whole runtime is a template literal.
|
|
1235
1370
|
var read = function () {
|
|
1236
|
-
return
|
|
1371
|
+
return ownerRefs[name] || null;
|
|
1237
1372
|
};
|
|
1238
1373
|
Object.defineProperty(read, 'current', { get: read, enumerable: true });
|
|
1239
1374
|
Object.defineProperty(read, 'value', { get: read, enumerable: true });
|
|
@@ -1677,8 +1812,11 @@ finally {
|
|
|
1677
1812
|
var resolvedUrl = typeof url === 'function' ? url() : url;
|
|
1678
1813
|
var fetchOpts = {
|
|
1679
1814
|
method: options.method || 'POST',
|
|
1680
|
-
|
|
1681
|
-
|
|
1815
|
+
// A file upload is a FormData body. Stringifying it sent "{}", and
|
|
1816
|
+
// the browser has to write its own multipart Content-Type (the
|
|
1817
|
+
// boundary lives there), so raw bodies pass through untouched.
|
|
1818
|
+
headers: __stxRawBody(body) ? __stxHeaders(options.headers) : { 'Content-Type': 'application/json', ...__stxHeaders(options.headers) },
|
|
1819
|
+
body: typeof body === 'string' || __stxRawBody(body) ? body : JSON.stringify(body)
|
|
1682
1820
|
};
|
|
1683
1821
|
var response = await __stxFetch('useMutation', resolvedUrl, fetchOpts);
|
|
1684
1822
|
if (!response.ok) throw await __stxHttpError(response);
|
|
@@ -1914,7 +2052,7 @@ catch (e) {
|
|
|
1914
2052
|
|
|
1915
2053
|
function expressionUsesSignalMethod(expression, name) {
|
|
1916
2054
|
var escapedName = name.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');
|
|
1917
|
-
return new RegExp('(?:^|[^\\\\w$])' + escapedName + '\\\\s*\\\\.\\\\s*(?:set|update|subscribe|toggle)\\\\s*\\\\(').test(expression);
|
|
2055
|
+
return new RegExp('(?:^|[^\\\\w$])' + escapedName + '\\\\s*\\\\.\\\\s*(?:set|update|subscribe|toggle|input|change)\\\\s*\\\\(').test(expression);
|
|
1918
2056
|
}
|
|
1919
2057
|
|
|
1920
2058
|
function expressionUsesSignalValue(expression, name) {
|
|
@@ -2295,7 +2433,11 @@ catch (e) {
|
|
|
2295
2433
|
value = undefined;
|
|
2296
2434
|
}
|
|
2297
2435
|
|
|
2298
|
-
|
|
2436
|
+
// ARIA states are strings, unlike HTML boolean attributes.
|
|
2437
|
+
if (name.startsWith('aria-') && typeof value === 'boolean') {
|
|
2438
|
+
el.setAttribute(name, String(value));
|
|
2439
|
+
}
|
|
2440
|
+
else if (value === false || value === null || value === undefined) {
|
|
2299
2441
|
el.removeAttribute(name);
|
|
2300
2442
|
}
|
|
2301
2443
|
else if (value === true) {
|
|
@@ -2685,7 +2827,7 @@ catch (e2) {
|
|
|
2685
2827
|
// :attr still works for backward compat but is reserved for structural directives.
|
|
2686
2828
|
// x-text, x-html, x-model, x-show, x-if, x-for, x-cloak, x-ref, x-data are
|
|
2687
2829
|
// handled by their own code paths below \u2014 exclude them here.
|
|
2688
|
-
var X_HANDLED = ${
|
|
2830
|
+
var X_HANDLED = ${L()};
|
|
2689
2831
|
if (name.startsWith('@bind:') || name.startsWith('x-bind:')
|
|
2690
2832
|
|| (name.startsWith(':') && !name.startsWith('::') && !DIRECTIVE_NAMES[name.slice(1).split('.')[0]] && !EVENT_RE.test(name.slice(1)))
|
|
2691
2833
|
|| (name.startsWith('x-') && !X_HANDLED[name.split('.')[0]] && !X_HANDLED[name])) {
|
|
@@ -2756,7 +2898,10 @@ catch (e2) {
|
|
|
2756
2898
|
}
|
|
2757
2899
|
return;
|
|
2758
2900
|
}
|
|
2759
|
-
if (
|
|
2901
|
+
if (attrName.startsWith('aria-') && typeof v === 'boolean') {
|
|
2902
|
+
el.setAttribute(attrName, String(v));
|
|
2903
|
+
}
|
|
2904
|
+
else if (v === false || v === null || v === undefined) {
|
|
2760
2905
|
el.removeAttribute(attrName);
|
|
2761
2906
|
}
|
|
2762
2907
|
else if (v === true) {
|
|
@@ -2796,14 +2941,36 @@ else if (name === '@html' || name === ':html' || name === 'x-html') {
|
|
|
2796
2941
|
el.removeAttribute(name);
|
|
2797
2942
|
}
|
|
2798
2943
|
else if (name === 'ref' || name === ':ref' || name === 'x-ref' || name === 'data-stx-ref') {
|
|
2799
|
-
//
|
|
2800
|
-
|
|
2801
|
-
|
|
2944
|
+
// A page ref can be projected through a component whose own $refs
|
|
2945
|
+
// replaced the compatibility scope's map. The compiler retains the
|
|
2946
|
+
// receiver boundary so named and signal refs use the same caller.
|
|
2947
|
+
var refRoot = el.closest && el.closest('[data-stx-scope]');
|
|
2948
|
+
var refCaller = el.getAttribute('data-stx-ref-caller');
|
|
2949
|
+
var refOwnerScope = findElementScope(el);
|
|
2950
|
+
if (refCaller) {
|
|
2951
|
+
var receiver = refRoot;
|
|
2952
|
+
while (receiver && receiver.getAttribute('data-stx-scope') !== refCaller
|
|
2953
|
+
&& receiver.getAttribute('data-stx-template-scope') !== refCaller) {
|
|
2954
|
+
receiver = receiver.parentElement && receiver.parentElement.closest('[data-stx-scope]');
|
|
2955
|
+
}
|
|
2956
|
+
refOwnerScope = receiver && receiver.__stx_parent_scope;
|
|
2957
|
+
}
|
|
2958
|
+
// Only projected refs may reach outside their component. Caller
|
|
2959
|
+
// snapshots exclude unrelated, previously hydrated siblings.
|
|
2960
|
+
if (refCaller && refOwnerScope) {
|
|
2961
|
+
if (refOwnerScope.$refs) refOwnerScope.$refs[value] = el;
|
|
2962
|
+
}
|
|
2963
|
+
else {
|
|
2964
|
+
if (scope.$refs) scope.$refs[value] = el;
|
|
2965
|
+
if (componentScope.$refs) componentScope.$refs[value] = el;
|
|
2966
|
+
}
|
|
2802
2967
|
// Also fill a same-named signal declared in the script block, so the
|
|
2803
2968
|
// documented ref() + x-ref pair works and reading the signal returns
|
|
2804
2969
|
// the element. Without this the signal stayed empty and every read of
|
|
2805
2970
|
// it silently returned undefined.
|
|
2806
|
-
var refTarget =
|
|
2971
|
+
var refTarget = refCaller && refOwnerScope
|
|
2972
|
+
? refOwnerScope[value]
|
|
2973
|
+
: (scope && scope[value]) || componentScope[value];
|
|
2807
2974
|
if (refTarget && typeof refTarget === 'function' && refTarget._isSignal && typeof refTarget.set === 'function') {
|
|
2808
2975
|
refTarget.set(el);
|
|
2809
2976
|
}
|
|
@@ -2811,7 +2978,12 @@ else if (name === 'ref' || name === ':ref' || name === 'x-ref' || name === 'data
|
|
|
2811
2978
|
else if (name.startsWith('@') || name.startsWith(':')) {
|
|
2812
2979
|
// Event handlers: @click, :click, @submit.prevent, :keydown.enter, etc.
|
|
2813
2980
|
const parts = name.slice(1).split('.');
|
|
2814
|
-
|
|
2981
|
+
// HTML folds attribute names to lowercase; the forwarding metadata
|
|
2982
|
+
// retains the declared event spelling (e.g. update:modelValue).
|
|
2983
|
+
const parentEventNames = (el.getAttribute && el.getAttribute('data-stx-parent-events') || '').split(/\\s+/);
|
|
2984
|
+
const eventName = parentEventNames.find(function(event) {
|
|
2985
|
+
return event.toLowerCase() === parts[0].toLowerCase();
|
|
2986
|
+
}) || parts[0];
|
|
2815
2987
|
const modifiers = parts.slice(1);
|
|
2816
2988
|
|
|
2817
2989
|
// Skip special directives (already handled above or in processElement)
|
|
@@ -2825,7 +2997,6 @@ else if (name === 'ref' || name === ':ref' || name === 'x-ref' || name === 'data
|
|
|
2825
2997
|
el[eventKey] = true;
|
|
2826
2998
|
|
|
2827
2999
|
// Capture scope at setup time so @for loop variables are available when event fires
|
|
2828
|
-
const parentEventNames = (el.getAttribute && el.getAttribute('data-stx-parent-events') || '').split(/\\s+/);
|
|
2829
3000
|
const isForwardedComponentEvent = !!(el.__stx_parent_scope && parentEventNames.includes(eventName));
|
|
2830
3001
|
const eventCapturedScope = isForwardedComponentEvent
|
|
2831
3002
|
? { ...globalHelpers, ...el.__stx_parent_scope }
|
|
@@ -5583,6 +5754,18 @@ catch (e) {} }
|
|
|
5583
5754
|
return normalizedPrefix + '-' + __stxGeneratedIdCounter;
|
|
5584
5755
|
}
|
|
5585
5756
|
|
|
5757
|
+
var createModelSignal = ${T.toString()};
|
|
5758
|
+
function useModel(name, options) {
|
|
5759
|
+
if (typeof name !== 'string') { options = name || {}; name = 'modelValue'; }
|
|
5760
|
+
options = options || {};
|
|
5761
|
+
var source = useReactiveProp(name, options.default, { parse: options.parse });
|
|
5762
|
+
var modifierName = name === 'modelValue' ? 'modelModifiers' : name + 'Modifiers';
|
|
5763
|
+
var modifiers = useReactiveProp(modifierName, {});
|
|
5764
|
+
var emit = window.stx.defineEmits(['update:' + name]);
|
|
5765
|
+
return createModelSignal(source, function() { return modifiers() || {}; },
|
|
5766
|
+
function(value) { emit('update:' + name, value); }, options, onDestroy);
|
|
5767
|
+
}
|
|
5768
|
+
|
|
5586
5769
|
// Reactive prop binding. Bridges the gap between a parent's clientReactive
|
|
5587
5770
|
// attribute (e.g. :open="modalOpen()" on a component) and the component's
|
|
5588
5771
|
// internal state. Returns a signal whose value tracks the named attribute
|
|
@@ -6378,6 +6561,7 @@ catch (e) {} }
|
|
|
6378
6561
|
onBeforeUnmount: onDestroy,
|
|
6379
6562
|
onUnmounted: onDestroy,
|
|
6380
6563
|
useFetch,
|
|
6564
|
+
clearServerData,
|
|
6381
6565
|
useRef,
|
|
6382
6566
|
navigate,
|
|
6383
6567
|
refresh,
|
|
@@ -6417,6 +6601,7 @@ catch (e) {} }
|
|
|
6417
6601
|
useCookie,
|
|
6418
6602
|
useId,
|
|
6419
6603
|
useReactiveProp,
|
|
6604
|
+
useModel,
|
|
6420
6605
|
useEventListener,
|
|
6421
6606
|
useWebSocket,
|
|
6422
6607
|
useColorMode,
|
|
@@ -7213,6 +7398,7 @@ else {
|
|
|
7213
7398
|
window.onMount = onMount;
|
|
7214
7399
|
window.onDestroy = onDestroy;
|
|
7215
7400
|
window.useFetch = useFetch;
|
|
7401
|
+
window.clearServerData = clearServerData;
|
|
7216
7402
|
window.useRef = useRef;
|
|
7217
7403
|
window.navigate = navigate;
|
|
7218
7404
|
window.goBack = goBack;
|
|
@@ -8274,5 +8460,5 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
|
|
|
8274
8460
|
}
|
|
8275
8461
|
}
|
|
8276
8462
|
})();
|
|
8277
|
-
`}var
|
|
8278
|
-
export{
|
|
8463
|
+
`}var Yz={state:B,derived:R,effect:H,batch:S,onMount:F,onDestroy:M,isSignal:E,isDerived:P,untrack:O,peek:I,generateSignalsRuntime:C,generateSignalsRuntimeDev:x};
|
|
8464
|
+
export{f as jj,k as kj,v as lj,U as mj,g as nj,m as oj,y as pj,h as qj,p as rj,u as sj,l as tj,d as uj,i as vj,n as wj,D as xj,C as yj,x as zj,Yz as Aj};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$i as e,Xi as a,Yi as b,Zi as c,_i as d,aj as f,bj as g,cj as h,dj as i,ej as j,fj as k,gj as l,hj as m,ij as n}from"./chunk-ydgdq45a.js";import"./chunk-fg0nf7cv.js";import"./chunk-2h94c5hm.js";import"./chunk-8jam44my.js";import"./chunk-t51mwjyq.js";import"./chunk-wfffa8zm.js";import"./chunk-mv5fdcwc.js";import"./chunk-4evbx7sz.js";import"./chunk-jxxv18a0.js";import"./chunk-c131k3mt.js";import"./chunk-9nf3hgvq.js";import"./chunk-nqq7y7m9.js";import"./chunk-1c2j4eby.js";import"./chunk-kxavsh3m.js";import"./chunk-qev11kg8.js";import"./chunk-rrankpmj.js";import"./chunk-fczfdsab.js";import"./chunk-fp7ms6e7.js";import"./chunk-jp2f8yzw.js";export{i as streamingSuspenseDirective,m as streamToResponse,g as streamTemplateSimple,a as streamTemplate,d as renderStreamingPage,k as registerStreamingDirectives,e as processStreamDirectives,l as processSectionDirectives,j as islandDirective,n as generateHydrationRuntime,f as extractStreamBoundaries,h as createStreamRenderer,b as buildSuspenseResolveScript,c as SUSPENSE_RESOLVER_RUNTIME};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{fm as x,gq as M}from"./chunk-fg0nf7cv.js";import"./chunk-2h94c5hm.js";import"./chunk-8jam44my.js";import"./chunk-t51mwjyq.js";import"./chunk-wfffa8zm.js";import{vt as B,xt as P}from"./chunk-mv5fdcwc.js";import"./chunk-4evbx7sz.js";import"./chunk-jxxv18a0.js";import"./chunk-c131k3mt.js";import"./chunk-9nf3hgvq.js";import"./chunk-nqq7y7m9.js";import"./chunk-1c2j4eby.js";import"./chunk-kxavsh3m.js";import"./chunk-qev11kg8.js";import"./chunk-rrankpmj.js";import"./chunk-fczfdsab.js";import"./chunk-fp7ms6e7.js";import"./chunk-jp2f8yzw.js";import G from"path";var T=["broadcast","calculateDistance","canNotify","clearCookies","clearFetchCache","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","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","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","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],O=new Set(T);var K=new Map,U=B(64),V=new Set,D=0,N=new Set(T);function f(){K.clear(),U.clear()}function S(H){let J=new Map;for(let Q of H){let Z=G.basename(Q);if(Z.endsWith(".d.ts"))continue;let z=Z.replace(/\.[jt]s$/,"");if(z==="index")continue;if(z===Z)continue;let X=J.get(z);if(X&&!X.endsWith(".js"))continue;J.set(z,Q)}return[...J.values()].sort()}function g(H,J){let Q=J.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${Q}\\b`).test(H)}function y(H){if(!H)return[];let J=P(H,D),Q=U.get(J);if(Q)return Q.slice();let Z=H.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,""),z=[];for(let X of N){if(V.has(X))continue;let A=X.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${A}\\s*\\(`).test(Z))z.push(X)}return z.sort(),U.set(J,z),z.slice()}async function p(H,J){let Q=y(H);if(Q.length===0)return null;let Z=J??G.join(import.meta.dir,"composables"),z=`${Z}\x00${Q.join(",")}`,X=K.get(z);if(X!==void 0)return X||null;let A=M({loader:"ts",target:"browser",define:x()}),L=new Set(Q),W=[],C=new Set,F=[];try{let q=new Bun.Glob("*.{ts,js}");for await(let j of q.scan({cwd:Z,absolute:!0}))F.push(j)}catch{return K.set(z,""),null}F=S(F);for(let q of F){let j;try{j=await Bun.file(q).text()}catch{continue}let I=[];try{I=A.scan(j).exports.filter(($)=>$!=="default")}catch{continue}if(!I.some(($)=>L.has($)))continue;try{j=j.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),j=j.replace(/^import\s+type\s+.*$/gm,""),j=j.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),j=j.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),j=j.replace(/^export\s+default\s+/gm,""),j=j.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),W.push(`// ${G.basename(q).replace(/\.[jt]s$/,"")}
|
|
3
|
+
${A.transformSync(j).trim()}`);for(let $ of I)C.add($)}catch($){console.warn(`[stx] framework composable ${G.basename(q)} could not be bundled:`,$)}}let Y=Q.filter((q)=>!C.has(q)&&!g(H,q));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(W.length===0)return K.set(z,""),null;let k=[...C].map((q)=>` try { if (!(${JSON.stringify(q)} in __s)) { __s[${JSON.stringify(q)}] = ${q}; if (!(${JSON.stringify(q)} in window)) window[${JSON.stringify(q)}] = ${q}; } } catch (e) {}`).join(`
|
|
4
|
+
`),w=`<script data-stx-framework-composables>
|
|
5
|
+
;(function(){
|
|
6
|
+
var __s = window.stx = window.stx || {};
|
|
7
|
+
${W.join(`
|
|
8
|
+
|
|
9
|
+
`)}
|
|
10
|
+
${k}
|
|
11
|
+
})();
|
|
12
|
+
</script>`;return K.set(z,w),w}function l(H){V.clear();for(let J of H)V.add(J);D++}export{S as selectComposableFiles,y as referencedFrameworkComposables,p as getFrameworkComposableScript,f as clearFrameworkComposableCache,l as __setRuntimeOwnedForTest};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import C from"path";var G=".stx",K="STX_DIR",J=null;function O(j){J=j?.trim()||null}function H(){return process.env[K]?.trim()||J||G}function Q(j=process.cwd(),...q){let B=H();return C.isAbsolute(B)?C.join(B,...q):C.join(j,B,...q)}function W(j){if(!j||C.isAbsolute(j))return j;let q=j.replace(/\\/g,"/");if(q!==G&&!q.startsWith(`${G}/`))return j;let B=q.slice(G.length+1);return B?C.join(H(),B):H()}
|
|
3
|
-
export{G as
|
|
3
|
+
export{G as iu,K as ju,O as ku,H as lu,Q as mu,W as nu};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$m as c,Dm as R,Km as k,Ko as l,Po as T,Tp as m,_m as d,vm as P,wm as D}from"./chunk-fg0nf7cv.js";import{At as S,Ct as v}from"./chunk-mv5fdcwc.js";import{Rv as XJ,Tv as YJ,Uv as ZJ}from"./chunk-fczfdsab.js";import{$v as QJ,cw as q}from"./chunk-jp2f8yzw.js";var n=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function r(J,Y,Q){let X={fullTag:Q,content:Y,attrs:J};if(/\bserver\b/.test(J))return{...X,type:"server"};if(/\bdata-stx-scoped\b/.test(J))return{...X,type:"client"};if(n.test(Y))return{...X,type:"signals"};if(/\bclient\b/.test(J)||/\btype\s*=\s*["']module["']/.test(J)||/\bsrc\s*=/.test(J))return{...X,type:"client"};return{...X,type:"server"}}var s=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function y(J){let Y=[],Q=[],X=[],$=0;while($<J.length){let Z=J.indexOf("<",$);if(Z===-1)break;let U=v(J,Z);if(U>Z){$=U;continue}let W=S(J,Z);if(W>Z){let j=J.slice(Z,W),F=s.exec(j);if(F){let K=r(F[1],F[2],j);switch(K.type){case"signals":Y.push(K);break;case"client":Q.push(K);break;case"server":X.push(K);break}}$=W;continue}$=Z+(J.startsWith("<!--",Z)?4:1)}return{signals:Y,client:Q,server:X}}var o=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function a(J){let Y=[],Q=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,X;while((X=Q.exec(J))!==null)Y.push({start:X.index,end:X.index+X[0].length});return Y}function C(J,Y){return Y.some((Q)=>J>=Q.start&&J<Q.end)}function t(J){let Y=(J||"").trim();if(!Y)return null;if(/[\s>+~,:]/.test(Y))return null;let Q={},X=Y,$=X.match(/^[a-z][\w-]*/i);if($)Q.tag=$[0].toLowerCase(),X=X.slice($[0].length);while(X.length>0){let Z=X.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(Z){if(Q.attr=Z[1],Z[3]!==void 0&&Z[3]!=="")Q.attrValue=Z[3];X=X.slice(Z[0].length);continue}let U=X.match(/^#([\w-]+)/);if(U){Q.id=U[1],X=X.slice(U[0].length);continue}let W=X.match(/^\.([\w-]+)/);if(W){Q.className=W[1],X=X.slice(W[0].length);continue}return null}if(!Q.tag&&!Q.attr&&!Q.id&&!Q.className)return null;return Q}function e(J,Y){if(Y.attr){if(!(Y.attrValue===void 0?new RegExp(`\\b${Y.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${Y.attr}\\s*=\\s*(["'])\\s*${Y.attrValue}\\s*\\1`,"i")).test(J))return!1}if(Y.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${Y.id}\\s*\\1`,"i").test(J))return!1}if(Y.className){let Q=J.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!Q)return!1;if(!Q[2].split(/\s+/).includes(Y.className))return!1}return!0}function x(J,Y="main"){let Q=t(Y);if(!Q)return null;let X=/<([a-z][\w-]*)\b([^>]*)>/gi,$=a(J),Z;while((Z=X.exec(J))!==null){if(C(Z.index,$))continue;let U=Z[1].toLowerCase(),W=Z[2]||"";if(W.trimEnd().endsWith("/")||o.has(U))continue;if(Q.tag&&Q.tag!==U)continue;if(!e(W,Q))continue;let j=Z[0],F=Z.index+j.length,K=new RegExp(`<(/?)${U}\\b([^>]*)>`,"gi");K.lastIndex=F;let G=1,B;while((B=K.exec(J))!==null){if(C(B.index,$))continue;let w=B[1]==="/";if(!w&&(B[2]||"").trimEnd().endsWith("/"))continue;if(G+=w?-1:1,G===0)return{openTag:j,openIndex:Z.index,start:F,end:B.index,tagName:U}}return null}return null}var wJ="X-STX-Router",NJ="private, no-store";function AJ(J){return J.replace(/&#(\d+);/g,(Y,Q)=>f(Number(Q),Y)).replace(/&#x([0-9a-f]+);/gi,(Y,Q)=>f(Number.parseInt(Q,16),Y)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function f(J,Y){if(!Number.isInteger(J)||J<0||J>1114111)return Y;try{return String.fromCodePoint(J)}catch{return Y}}function g(J){return J.headers.get("X-STX-Router")==="true"}function JJ(J,Y){if(!J)return Y;return J.split(",").some((X)=>X.trim().toLowerCase()===Y.toLowerCase())?J:`${J}, ${Y}`}function IJ(J){return{Vary:JJ(J,"X-STX-Router")}}import E from"path";XJ();var $J="stx-page-head:",UJ=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,O=null;function WJ(){if(O!==null)return O;try{let{getRouterScript:J}=(ZJ(),QJ(YJ));O=`<script>${J()}</script>`}catch{O=""}return O}async function MJ(J,Y){if(Y===!1)return null;if(Y&&typeof Y==="string"){let X=E.resolve(J,Y);if(await Bun.file(X).exists())return X;return null}let Q=E.join(J,"app.stx");if(await Bun.file(Q).exists())return Q;return null}async function bJ(J,Y){try{let Q=await Bun.file(J).text(),X=Q,$=Q.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if($)X=$[1].trim();let Z=y(Q),U=[...Z.client.map((V)=>V.fullTag),...Z.signals.map((V)=>V.fullTag)],W=[],j=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,F;while((F=j.exec(Q))!==null)W.push(F[0]);let K=X;for(let V of Z.server)K=K.replace(V.fullTag,"");for(let V of Z.client)K=K.replace(V.fullTag,"");K=K.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let G="<!--__STX_PAGE_SLOT__-->";if(K=K.replace(/<slot\s*\/>/gi,G).replace(/<slot\s*>\s*<\/slot>/gi,G),!K.includes(G))return console.warn(`[stx] Shell ${J} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:B,extractVariables:w,defaultConfig:N,loadStxConfig:I}=await import("./chunk-qt2dmyq5.js"),_=await I(),z={__filename:J,__dirname:E.dirname(J)};for(let V of U){let L=V.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(L&&!V.includes("client")&&!V.includes('type="module"'))await w(L[1],z,J)}let A=await B(K,z,J,{...N,..._,...Y},new Set),H=A.indexOf(G);if(H===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:A.substring(0,H),afterSlot:A.substring(H+G.length),filePath:J,shellScripts:U,shellStyles:W}}catch(Q){return console.error(`[stx] Error processing shell ${J}:`,Q),null}}function PJ(J,Y,Q){let X,$="",Z=Y.match(UJ);if(Z){Y=Y.replace(Z[0],"");try{let K=Buffer.from(Z[1],"base64").toString("utf8"),G=K.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(G)X=G[1].trim();$=K.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let U=Q||X||"stx App",W=WJ(),j="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>${U}</title>
|
|
8
|
+
${$?` ${$}
|
|
9
|
+
`:""} ${J.shellStyles.join(`
|
|
10
|
+
`)}
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
${J.beforeSlot}
|
|
14
|
+
<div data-stx-content>${Y}</div>
|
|
15
|
+
${J.afterSlot}
|
|
16
|
+
${J.shellScripts.filter((K)=>!K.includes("server")).join(`
|
|
17
|
+
`)}
|
|
18
|
+
${j}
|
|
19
|
+
${W}
|
|
20
|
+
</body>
|
|
21
|
+
</html>`}function jJ(J,Y={}){let Q=J.trim();if(!m(Q))return J;let X=[],$=Q.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if($){let j=$[1],F=/<style\b[^>]*>[\s\S]*?<\/style>/gi,K;while((K=F.exec(j))!==null)X.push(K[0]);let G=j.match(/<script\b[^>]*data-stx-server-data[^>]*>[\s\S]*?<\/script>/i);if(G)X.push(G[0]);let B=j.match(/<script\b[^>]*data-stx-runtime-config[^>]*>[\s\S]*?<\/script>/i);if(B)X.push(B[0])}if(Y.preserveHead&&$){let j=[],F=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,K;while((K=F.exec($[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(K[0]))continue;j.push(K[0])}if(j.length>0)X.unshift(`<!--${$J}${Buffer.from(j.join(`
|
|
22
|
+
`),"utf8").toString("base64")}-->`)}let Z=Q.match(/<body\b[^>]*>/i),U=Q.lastIndexOf("</body>");if(Z&&U!==-1){let j=Z.index+Z[0].length,F=Q.slice(j,U).trim();if(X.length>0)return X.join(`
|
|
23
|
+
`)+`
|
|
24
|
+
`+F;return F}let W=Q;if(W=W.replace(/<!DOCTYPE\b[^>]*>/i,""),W=W.replace(/<html\b[^>]*>/i,""),W=W.replace(/<\/html\s*>/i,""),$)W=W.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,X.join(`
|
|
25
|
+
`));return W=W.replace(/<body\b[^>]*>/i,""),W=W.replace(/<\/body\s*>/i,""),W.trim()}var u=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function RJ(J){return g(J)}function kJ(J,Y="main"){let Q=J.trim(),X=[],$=[],Z=Q.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(Z){let I=Z[1],_=/<style\b[^>]*>[\s\S]*?<\/style>/gi,z;while((z=_.exec(I))!==null)X.push(z[0]);let A=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((z=A.exec(I))!==null){if(u.test(z[0])||z[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(z[0]))continue;$.push(z[0])}}let U=x(Q,Y);if(!U)return jJ(J);let{tagName:W,start:j,end:F}=U,K=Q.slice(j,F).trim(),G=[],B=Q.match(/<body\b[^>]*>/i),w=Q.lastIndexOf("</body>");if(B&&B.index!==void 0&&w!==-1){let _=[[B.index+B[0].length,U.openIndex],[F+`</${W}>`.length,w]],z=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[A,H]of _){if(A>=H)continue;let V=Q.slice(A,H),L;z.lastIndex=0;while((L=z.exec(V))!==null){if(u.test(L[0]))continue;G.push(L[0])}}}let N=[];if(X.length>0)N.push(X.join(`
|
|
26
|
+
`));if($.length>0)N.push($.join(`
|
|
27
|
+
`));if(G.length>0)N.push(G.join(`
|
|
28
|
+
`));return N.push(K),N.join(`
|
|
29
|
+
`)}import M from"fs";import h from"path";function CJ(J,Y,Q){return{version:1,buildTime:new Date().toISOString(),routes:J,assets:Y,outputDir:Q}}function xJ(J,Y){let Q=h.join(Y,"manifest.json");M.writeFileSync(Q,JSON.stringify(J,null,2))}function fJ(J){let Y=h.join(J,"manifest.json");if(!M.existsSync(Y))return null;try{let Q=M.readFileSync(Y,"utf-8"),X=JSON.parse(Q);if(X.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${X.version}`),null;return X}catch(Q){return console.warn("[stx] Failed to load manifest:",Q),null}}function b(J,Y,Q={}){let X=`${encodeURIComponent(J)}=${encodeURIComponent(Y)}`;if(Q.maxAge!==void 0)X+=`; Max-Age=${Q.maxAge}`;if(Q.expires)X+=`; Expires=${Q.expires.toUTCString()}`;if(Q.path)X+=`; Path=${Q.path}`;if(Q.domain)X+=`; Domain=${Q.domain}`;if(Q.secure)X+="; Secure";if(Q.httpOnly)X+="; HttpOnly";if(Q.sameSite)X+=`; SameSite=${Q.sameSite}`;return X}async function KJ(J){let Y=J.headers.get("content-type")||"",Q={},X=($,Z)=>{let U=Q[$];if(U===void 0)Q[$]=Z;else if(Array.isArray(U))U.push(Z);else Q[$]=[U,Z]};if(Y.includes("multipart/form-data")){let $=await J.formData();for(let[Z,U]of $.entries())if(typeof U==="string")X(Z,U);return Q}if(Y.includes("application/x-www-form-urlencoded")){for(let[$,Z]of new URLSearchParams(await J.text()).entries())X($,Z);return Q}return Q}function FJ(J){if(!J)return!1;let Y=J.toUpperCase();return Y!=="GET"&&Y!=="HEAD"}async function p(J,Y={}){let Q=Y.request,X=Y.method??Q?.method;if(!Q||!FJ(X))return{ran:!1};if(typeof J.action!=="function")return{ran:!1};let $={};try{$=await KJ(Q)}catch{}let Z=await J.action({request:Q,form:$,params:Y.params??{},query:J.query??{},cookies:Y.cookies??{}});if(Z&&typeof Z==="object"){let U=Z,W=GJ(U.cookies),j=U.redirect;if(typeof j==="string"&&j)return{redirect:j,ran:!0,...W.length>0?{cookies:W}:{}};let{cookies:F,redirect:K,...G}=U;if(Object.assign(J,G),W.length>0)return{ran:!0,cookies:W}}return{ran:!0}}function GJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return[];let Y=[];for(let[Q,X]of Object.entries(J)){if(!Q)continue;if(typeof X==="string"){Y.push(b(Q,X));continue}if(X&&typeof X==="object"){let $=X;if(typeof $.value!=="string")continue;Y.push(b(Q,$.value,$))}}return Y}function hJ(J,Y=[],Q){let X=new Headers({Location:J,"Cache-Control":"no-store"});for(let $ of Y)X.append("Set-Cookie",$);for(let[$,Z]of Object.entries(Q??{}))if($.toLowerCase()!=="location")X.set($,Z);return new Response(null,{status:303,headers:X})}async function sJ(J,Y={}){return(await i(J,Y)).html}async function oJ(J,Y={}){let{html:Q,context:X,redirect:$,cookies:Z}=await i(J,Y),U=d(X),W=c(X);if($)return{html:Q,redirect:$,cookies:Z,status:U,headers:W};let{extractStreamBoundaries:j}=await import("./chunk-bezqaxqt.js"),F=j(X),K=J.streamTemplates;if(K&&Object.keys(K).length>0){let{processDirectives:G}=await import("./chunk-er848s6f.js"),{defaultConfig:B}=await import("./chunk-phcvbqzn.js"),w=X.streamBoundaries||{},N={...B,autoShell:!1},I=Object.keys(K).map((z)=>({id:z,render:async()=>{let A=typeof w[z]==="function"?await w[z]():void 0;return G(K[z],{...X,$boundary:A},J.sourceFile,N,new Set)}})),_=new Set(I.map((z)=>z.id));F=[...(F||[]).filter((z)=>!_.has(z.id)),...I]}return{html:Q,boundaries:F&&F.length>0?F:void 0,cookies:Z,status:U,headers:W}}async function i(J,Y){let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...Y};if(!J.hasServerScripts&&!D(J.html))return{html:J.html,context:Q};for(let U of J.serverScriptContent)try{await T(U,Q,J.sourceFile)}catch(W){if(Y.__stx_strict_hydration)throw W;console.warn(`[stx] Server script error in ${J.sourceFile}:`,W)}let X=await p(Q,{request:Y.request,method:Y.method,params:Y.params??{},cookies:Y.cookies??{}}),$=(U)=>{let W=U.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),j=l(Q);if(!j)return W;let F=W.indexOf("</head>");return F<0?j+W:W.slice(0,F)+j+W.slice(F)};if(X.redirect)return{html:J.html,context:Q,redirect:X.redirect,cookies:X.cookies};if(!D(J.html))return{html:$(J.html),context:Q,cookies:X.cookies};let Z=new Map;for(let[U,W]of Object.entries(J.placeholders))if(W.expression)try{let j=k(W.expression,Q);if(W.type==="raw")Z.set(U,j!==void 0&&j!==null?String(j):"");else Z.set(U,j!==void 0&&j!==null?R(String(j)):"")}catch(j){if(Y.__stx_strict_hydration)throw j;Z.set(U,"")}return{html:$(P(J.html,Z)),context:Q,cookies:X.cookies}}async function aJ(J,Y={}){if(!J.hasServerScripts&&!D(J.fragment))return J.fragment;let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...Y};for(let $ of J.serverScriptContent)try{await T($,Q,J.sourceFile)}catch(Z){console.warn(`[stx] Server script error in ${J.sourceFile}:`,Z)}if(!D(J.fragment))return J.fragment;let X=new Map;for(let[$,Z]of Object.entries(J.placeholders))if(Z.expression)try{let U=k(Z.expression,Q);if(Z.type==="raw")X.set($,U!==void 0&&U!==null?String(U):"");else X.set($,U!==void 0&&U!==null?R(String(U)):"")}catch{X.set($,"")}return P(J.fragment,X)}
|
|
30
|
+
export{r as gg,y as hg,t as ig,x as jg,wJ as kg,NJ as lg,AJ as mg,g as ng,JJ as og,IJ as pg,MJ as qg,bJ as rg,PJ as sg,jJ as tg,RJ as ug,kJ as vg,CJ as wg,xJ as xg,fJ as yg,b as zg,KJ as Ag,FJ as Bg,p as Cg,hJ as Dg,sJ as Eg,oJ as Fg,aJ as Gg};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{l as a,m as b,n as c}from"./chunk-q9n5swx7.js";import"./chunk-
|
|
2
|
+
import{l as a,m as b,n as c}from"./chunk-q9n5swx7.js";import"./chunk-jp2f8yzw.js";export{c as updateContextTree,b as updateContextStoryFiles,a as createContext};
|
|
@@ -213,4 +213,4 @@ function w(Z,M){let{itemHeight:K,containerHeight:P,overscan:F=3,keyProperty:$="i
|
|
|
213
213
|
})();
|
|
214
214
|
</script>
|
|
215
215
|
`})}var v={createVirtualList:w,processVirtualListDirectives:C,processInfiniteListDirectives:E,processVirtualGridDirectives:f,generateVirtualListCSS:b,useVirtualList:L};
|
|
216
|
-
export{w as
|
|
216
|
+
export{w as Ii,C as Ji,b as Ki,L as Li,E as Mi,f as Ni,v as Oi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{$e as c,Ze as a,_e as b,af as d,bf as e,cf as f,df as g,ef as h,ff as i,gf as j,hf as k,if as l,jf as m,kf as n,lf as o}from"./chunk-ym3r8ktq.js";import"./chunk-jp2f8yzw.js";export{k as writeNetlifyConfig,n as initNetlify,l as hasNetlifyConfig,g as getTotalSize,h as generateNetlifyToml,f as formatSize,e as filterRequiredFiles,i as detectProjectConfig,m as deploy,a as createNetlifyClient,d as createFileManifest,j as createDefaultNetlifyConfig,c as collectDeployFiles,b as calculateSha1,o as DeployError};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-jp2f8yzw.js";import v from"fs";import H from"path";import{gzipSync as z}from"zlib";import{createHash as g}from"crypto";var D={".js":"js",".mjs":"js",".cjs":"js",".ts":"js",".jsx":"js",".tsx":"js",".css":"css",".scss":"css",".sass":"css",".less":"css",".html":"html",".htm":"html",".png":"image",".jpg":"image",".jpeg":"image",".gif":"image",".svg":"image",".webp":"image",".avif":"image",".ico":"image",".woff":"font",".woff2":"font",".ttf":"font",".eot":"font",".otf":"font"},b=[/node_modules/,/vendor/,/bower_components/,/\.min\./],B=[/index\.(js|ts|html)$/,/main\.(js|ts)$/,/app\.(js|ts)$/,/entry\.(js|ts)$/];async function L(X,Z={}){let{includeSourceMaps:Q=!1,parseImports:$=!0,detectDuplicates:U=!0,topModulesCount:K=20}=Z;if(!v.existsSync(X))throw Error(`Build directory not found: ${X}`);if(!v.statSync(X).isDirectory())throw Error(`Not a directory: ${X}`);let q=await k(X,Q),J=[],F=[];for(let A of q)try{let O=await f(A,X,$);J.push(O)}catch(O){F.push(`Failed to process ${A}: ${O}`)}let Y=c(J,X),V=J.reduce((A,O)=>A+O.size,0),_=J.reduce((A,O)=>A+O.gzipSize,0),w=m(J),G=U?p(J):[],C=[...J].sort((A,O)=>O.size-A.size).slice(0,K);return{timestamp:Date.now(),buildDir:H.resolve(X),chunks:Y,totalSize:V,totalGzipSize:_,moduleCount:J.length,duplicates:G,byType:w,largestModules:C,warnings:F}}async function k(X,Z){let Q=[];async function $(U){let K=await v.promises.readdir(U,{withFileTypes:!0});for(let j of K){let q=H.join(U,j.name);if(j.isDirectory()){if(!j.name.startsWith(".")&&j.name!=="node_modules")await $(q)}else if(j.isFile()){if(!Z&&j.name.endsWith(".map"))continue;Q.push(q)}}}return await $(X),Q}async function f(X,Z,Q){let $=await v.promises.readFile(X),U=H.relative(Z,X),K=H.extname(X).toLowerCase(),j=$.length,q=y($),J=h($,K),F=g("md5").update($).digest("hex").slice(0,8),Y=D[K]||"other",V=[];if(Q&&Y==="js")V.push(...d($.toString("utf-8")));return{id:U,path:U,size:j,gzipSize:q,parsedSize:J,extension:K,type:Y,imports:V,importedBy:[],hash:F}}function y(X){try{let Z=z(X,{level:9}).length;return Math.min(Z,X.length)}catch{return X.length}}function h(X,Z){if(Z.includes(".min.")||X.length<1000)return X.length;let $=D[Z];if($==="js")return Math.round(X.length*0.6);if($==="css")return Math.round(X.length*0.7);return X.length}function d(X){let Z=[],Q=/import\s+(?:[\w*{}\s,]+\s+from\s+)?['"]([^'"]+)['"]/g,$;while(($=Q.exec(X))!==null)Z.push($[1]);let U=/import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=U.exec(X))!==null)Z.push($[1]);let K=/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=K.exec(X))!==null)Z.push($[1]);return[...new Set(Z)]}function c(X,Z){let Q=new Map;for(let U of X){let K=U.path.split(H.sep),j;if(K.length===1)j=H.basename(U.path,U.extension);else j=K[0];let q=Q.get(j)||[];q.push(U),Q.set(j,q)}let $=[];for(let[U,K]of Q){let j=K.reduce((Y,V)=>Y+V.size,0),q=K.reduce((Y,V)=>Y+V.gzipSize,0),J=K.some((Y)=>B.some((V)=>V.test(Y.path))),F=K.some((Y)=>b.some((V)=>V.test(Y.path)));$.push({name:U,files:K.map((Y)=>Y.path),modules:K,size:j,gzipSize:q,isEntry:J,isVendor:F})}return $.sort((U,K)=>K.size-U.size)}function m(X){let Z={js:{count:0,size:0,gzipSize:0},css:{count:0,size:0,gzipSize:0},html:{count:0,size:0,gzipSize:0},image:{count:0,size:0,gzipSize:0},font:{count:0,size:0,gzipSize:0},other:{count:0,size:0,gzipSize:0}};for(let Q of X)Z[Q.type].count++,Z[Q.type].size+=Q.size,Z[Q.type].gzipSize+=Q.gzipSize;return Z}function p(X){let Z=new Map;for(let $ of X){let U=Z.get($.hash)||[];U.push($),Z.set($.hash,U)}let Q=[];for(let[,$]of Z)if($.length>1){let U=$[0];Q.push({path:U.path,count:$.length,wastedBytes:U.size*($.length-1),locations:$.map((K)=>K.path)})}return Q.sort(($,U)=>U.wastedBytes-$.wastedBytes)}function W(X){if(X<1024)return`${X} B`;if(X<1048576)return`${(X/1024).toFixed(2)} KB`;return`${(X/1048576).toFixed(2)} MB`}function I(X){let Z=X.match(/^([\d.]+)\s*(B|KB|MB|GB)?$/i);if(!Z)return 0;let Q=Number.parseFloat(Z[1]);switch((Z[2]||"B").toUpperCase()){case"KB":return Q*1024;case"MB":return Q*1024*1024;case"GB":return Q*1024*1024*1024;default:return Q}}function E(X,Z){if(Z===0)return"0%";return`${(X/Z*100).toFixed(1)}%`}function R(X,Z){switch(Z.format){case"json":return u(X,Z);case"markdown":return l(X,Z);case"text":default:return r(X,Z)}}function u(X,Z){let Q=N(X,Z);return JSON.stringify({timestamp:X.timestamp,buildDir:X.buildDir,summary:{totalSize:X.totalSize,totalSizeFormatted:W(X.totalSize),totalGzipSize:X.totalGzipSize,totalGzipSizeFormatted:W(X.totalGzipSize),moduleCount:X.moduleCount,chunkCount:X.chunks.length,duplicateCount:X.duplicates.length},byType:Object.fromEntries(Object.entries(X.byType).map(([$,U])=>[$,{...U,sizeFormatted:W(U.size),gzipSizeFormatted:W(U.gzipSize)}])),chunks:X.chunks.map(($)=>({name:$.name,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),moduleCount:$.modules.length,isEntry:$.isEntry,isVendor:$.isVendor})),largestModules:X.largestModules.slice(0,Z.topModules||10).map(($)=>({path:$.path,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),type:$.type})),duplicates:X.duplicates,analysis:Q,warnings:X.warnings},null,2)}function r(X,Z){let Q=[],$=Z.showGzip!==!1;if(Q.push(""),Q.push("Bundle Analysis Report"),Q.push("\u2550".repeat(50)),Q.push(""),Q.push("Summary"),Q.push("\u2500".repeat(50)),$)Q.push(`Total Size: ${W(X.totalSize)} (${W(X.totalGzipSize)} gzip)`);else Q.push(`Total Size: ${W(X.totalSize)}`);if(Q.push(`Modules: ${X.moduleCount}`),Q.push(`Chunks: ${X.chunks.length}`),X.duplicates.length>0)Q.push(`Duplicates: ${X.duplicates.length}`);if(Q.push(""),Z.threshold&&X.totalSize>Z.threshold)Q.push(`\u26A0\uFE0F Bundle exceeds threshold of ${W(Z.threshold)}!`),Q.push("");Q.push("Size by Type"),Q.push("\u2500".repeat(50));let U=["js","css","html","image","font","other"];for(let j of U){let q=X.byType[j];if(q.count>0){let J=E(q.size,X.totalSize),F=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${j.padEnd(8)} ${W(q.size).padStart(12)}${F} ${J.padStart(6)} (${q.count} files)`)}}Q.push(""),Q.push("Chunks"),Q.push("\u2500".repeat(50));for(let j of X.chunks.slice(0,10)){let q=[];if(j.isEntry)q.push("entry");if(j.isVendor)q.push("vendor");let J=q.length>0?` [${q.join(", ")}]`:"",F=$?` (${W(j.gzipSize)} gzip)`:"";Q.push(` ${j.name.padEnd(20)} ${W(j.size).padStart(12)}${F}${J}`)}if(X.chunks.length>10)Q.push(` ... and ${X.chunks.length-10} more chunks`);Q.push("");let K=Z.topModules||10;Q.push(`Largest Modules (Top ${K})`),Q.push("\u2500".repeat(50));for(let j=0;j<Math.min(K,X.largestModules.length);j++){let q=X.largestModules[j],J=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${(j+1).toString().padStart(2)}. ${q.path}`),Q.push(` ${W(q.size)}${J}`)}if(Q.push(""),X.duplicates.length>0){Q.push("Duplicate Modules"),Q.push("\u2500".repeat(50));for(let j of X.duplicates.slice(0,5))Q.push(` ${j.path}`),Q.push(` ${j.count} copies, wasting ${W(j.wastedBytes)}`);if(X.duplicates.length>5)Q.push(` ... and ${X.duplicates.length-5} more duplicates`);Q.push("")}if(Z.recommendations!==!1){let j=N(X,Z);if(j.recommendations.length>0){Q.push("Recommendations"),Q.push("\u2500".repeat(50));for(let q of j.recommendations.slice(0,5)){let J=q.impact==="high"?"\u26A1":q.impact==="medium"?"\uD83D\uDCCA":"\uD83D\uDCA1";Q.push(` ${J} ${q.title}`),Q.push(` ${q.description}`)}Q.push("")}}if(X.warnings.length>0){Q.push("Warnings"),Q.push("\u2500".repeat(50));for(let j of X.warnings)Q.push(` \u26A0\uFE0F ${j}`);Q.push("")}return Q.join(`
|
|
3
3
|
`)}function l(X,Z){let Q=[],$=Z.showGzip!==!1;if(Q.push("# Bundle Analysis Report"),Q.push(""),Q.push(`Generated: ${new Date(X.timestamp).toISOString()}`),Q.push(""),Q.push("## Summary"),Q.push(""),Q.push("| Metric | Value |"),Q.push("|--------|-------|"),Q.push(`| Total Size | ${W(X.totalSize)} |`),$)Q.push(`| Gzip Size | ${W(X.totalGzipSize)} |`);Q.push(`| Modules | ${X.moduleCount} |`),Q.push(`| Chunks | ${X.chunks.length} |`),Q.push(`| Duplicates | ${X.duplicates.length} |`),Q.push(""),Q.push("## Size by Type"),Q.push(""),Q.push("| Type | Size | Gzip | % | Files |"),Q.push("|------|------|------|---|-------|");let U=["js","css","html","image","font","other"];for(let j of U){let q=X.byType[j];if(q.count>0)Q.push(`| ${j} | ${W(q.size)} | ${W(q.gzipSize)} | ${E(q.size,X.totalSize)} | ${q.count} |`)}Q.push(""),Q.push("## Chunks"),Q.push(""),Q.push("| Name | Size | Gzip | Modules | Type |"),Q.push("|------|------|------|---------|------|");for(let j of X.chunks.slice(0,15)){let q=j.isEntry?"Entry":j.isVendor?"Vendor":"-";Q.push(`| ${j.name} | ${W(j.size)} | ${W(j.gzipSize)} | ${j.modules.length} | ${q} |`)}Q.push("");let K=Z.topModules||10;Q.push(`## Largest Modules (Top ${K})`),Q.push(""),Q.push("| # | Path | Size | Gzip |"),Q.push("|---|------|------|------|");for(let j=0;j<Math.min(K,X.largestModules.length);j++){let q=X.largestModules[j];Q.push(`| ${j+1} | \`${q.path}\` | ${W(q.size)} | ${W(q.gzipSize)} |`)}if(Q.push(""),X.duplicates.length>0){Q.push("## Duplicates"),Q.push(""),Q.push("| Path | Copies | Wasted |"),Q.push("|------|--------|--------|");for(let j of X.duplicates.slice(0,10))Q.push(`| \`${j.path}\` | ${j.count} | ${W(j.wastedBytes)} |`);Q.push("")}if(Z.recommendations!==!1){let j=N(X,Z);if(j.recommendations.length>0){Q.push("## Recommendations"),Q.push("");for(let q of j.recommendations)Q.push(`### ${q.title}`),Q.push(""),Q.push(q.description),Q.push(""),Q.push(`- **Impact:** ${q.impact}`),Q.push(`- **Effort:** ${q.effort}`),Q.push("")}}return Q.join(`
|
|
4
4
|
`)}function N(X,Z){let Q=[],$=[];if(Z.threshold&&X.totalSize>Z.threshold)Q.push({severity:"error",message:`Bundle size (${W(X.totalSize)}) exceeds threshold (${W(Z.threshold)})`});if(X.totalSize>1048576)Q.push({severity:"warning",message:`Bundle is over 1MB (${W(X.totalSize)})`,details:"Large bundles can significantly impact load time"});if(X.duplicates.length>0){let q=X.duplicates.reduce((J,F)=>J+F.wastedBytes,0);Q.push({severity:"warning",message:`${X.duplicates.length} duplicate modules found, wasting ${W(q)}`}),$.push({title:"Remove Duplicate Modules",description:"Consider using import aliases or ensuring consistent package versions to eliminate duplicates.",impact:"medium",effort:"low"})}if(X.byType.js.size/X.totalSize>0.8&&X.totalSize>512000)$.push({title:"Code Splitting",description:"Over 80% of your bundle is JavaScript. Consider splitting code by route or feature.",impact:"high",effort:"medium"});let K=X.largestModules.filter((q)=>q.size>102400);if(K.length>0){Q.push({severity:"info",message:`${K.length} modules are over 100KB`});for(let q of K){if(q.path.includes("lodash")&&!q.path.includes("lodash-es"))$.push({title:"Use lodash-es instead of lodash",description:"lodash-es supports tree-shaking and can significantly reduce bundle size.",impact:"high",effort:"low"});if(q.path.includes("moment"))$.push({title:"Replace moment.js",description:"Consider using date-fns or dayjs for smaller date handling libraries.",impact:"high",effort:"medium"})}}if(X.byType.image.size>512000)$.push({title:"Optimize Images",description:`Images account for ${W(X.byType.image.size)}. Consider using WebP/AVIF formats and responsive images.`,impact:"high",effort:"low"});let j=100;if(X.totalSize>1048576)j-=20;else if(X.totalSize>512000)j-=10;if(j-=Math.min(20,X.duplicates.length*2),j-=Math.min(15,K.length*3),Z.threshold&&X.totalSize>Z.threshold)j-=25;return{score:Math.max(0,j),issues:Q,recommendations:$}}var i={lodash:{alternative:"lodash-es or individual imports",savings:"~70%"},moment:{alternative:"date-fns or dayjs",savings:"~90%"},"chart.js":{alternative:"chart.js with tree-shaking",savings:"~50%"},"highlight.js":{alternative:"Selective language imports",savings:"~80%"},fontawesome:{alternative:"Individual icon imports",savings:"~90%"},"material-ui":{alternative:"Named imports from @mui/*",savings:"~60%"}};function n(X){for(let[Z,Q]of Object.entries(i))if(X.includes(Z))return{title:`Optimize ${Z}`,description:`Consider using ${Q.alternative}. Potential savings: ${Q.savings}`,impact:"high",effort:"low"};return null}var o={default:{js:"#f7df1e",css:"#264de4",html:"#e34c26",image:"#4caf50",font:"#9c27b0",other:"#607d8b",vendor:"#ff5722"},pastel:{js:"#fff3b0",css:"#b0d4ff",html:"#ffb0b0",image:"#b0ffb0",font:"#e0b0ff",other:"#d0d0d0",vendor:"#ffcfb0"},monochrome:{js:"#333333",css:"#555555",html:"#777777",image:"#999999",font:"#bbbbbb",other:"#dddddd",vendor:"#444444"}};function x(X,Z={}){let{title:Q="Bundle Analysis",gzip:$=!0,colorScheme:U="default"}=Z,K=o[U],j=a(X),q=JSON.stringify(j);return`<!DOCTYPE html>
|
|
5
5
|
<html lang="en">
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Bi as a,Ci as b,Di as c,Ei as d,Fi as e,Gi as f,Hi as g}from"./chunk-ej8mv2k6.js";import"./chunk-jp2f8yzw.js";export{c as shouldCacheComponent,a as processKeepAliveDirectives,g as onDeactivated,f as onActivated,e as generateKeepAliveRuntime,d as generateKeepAliveCSS,b as createKeepAliveCache};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ii as a,Ji as b,Ki as c,Li as d,Mi as e,Ni as f,Oi as g}from"./chunk-cr8v8k53.js";import"./chunk-jp2f8yzw.js";export{d as useVirtualList,b as processVirtualListDirectives,f as processVirtualGridDirectives,e as processInfiniteListDirectives,c as generateVirtualListCSS,g as default,a as createVirtualList};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
function E(z){if(!z.startsWith("/")||/[?#\\]/.test(z))throw Error(`Invalid route rule pattern: ${z}`);let w=z==="/"?[]:z.slice(1).split("/");if(w.some((q,j)=>!q||q.includes("*")&&q!=="*"&&q!=="**"||q==="**"&&j!==w.length-1||q.startsWith(":")&&!/^:[\w]+$/.test(q)))throw Error(`Unsupported route rule pattern: ${z}`);return w}function F(z){for(let[w,q]of Object.entries(z)){if(E(w),!q||typeof q!=="object"||Object.keys(q).some((j)=>j!=="rendering"&&j!=="cache"))throw Error(`Unsupported route rule for ${w}`);if(q.rendering!==void 0&&q.rendering!=="prerender"&&q.rendering!=="dynamic")throw Error(`Unsupported rendering mode for ${w}`);if(q.cache!==void 0&&q.cache!==!1){let j=q.cache;if(!j||j.public!==!0||Object.keys(j).some((x)=>!["public","maxAge","swr"].includes(x))||!Number.isFinite(j.maxAge)||j.maxAge<=0||j.swr!==void 0&&(!Number.isFinite(j.swr)||j.swr<0))throw Error(`Route cache for ${w} requires public: true, maxAge > 0 and swr >= 0`);if(q.rendering==="prerender")throw Error(`Prerendered route ${w} cannot revalidate; use dynamic rendering with cache`)}}}function G(z={}){F(z);let w=(j)=>j==="**"?0:j==="*"?1:j.startsWith(":")?2:3,q=Object.entries(z).map(([j,x])=>({pattern:j,parts:E(j),rule:x}));return q.sort((j,x)=>{for(let A=0;A<Math.max(j.parts.length,x.parts.length);A++){let B=(x.parts[A]===void 0?4:w(x.parts[A]))-(j.parts[A]===void 0?4:w(j.parts[A]));if(B)return B}return j.pattern.localeCompare(x.pattern)}),(j)=>{let x=j==="/"?[]:j.replace(/\/$/,"").slice(1).split("/");return q.find(({parts:A})=>A.every((B,D)=>B==="**"||x[D]!==void 0&&(B==="*"||B.startsWith(":")||B===x[D]))&&(A.at(-1)==="**"||A.length===x.length))?.rule??{}}}
|
|
3
|
+
export{F as Hg,G as Ig};
|