@stacksjs/stx 0.2.914 → 0.2.917
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/build-defer-scripts.d.ts +12 -0
- package/dist/build-defer-scripts.js +37 -0
- package/dist/build-externalize-repeated.js +2 -0
- package/dist/build-externalize.js +1 -1
- package/dist/builtins/image-delivery.js +2 -0
- package/dist/builtins/image-placeholder.js +2 -0
- package/dist/{chunk-2vdbt2a7.js → chunk-0adc8x2h.js} +1 -1
- package/dist/{chunk-tykdvjbe.js → chunk-0asdv3hk.js} +2 -2
- package/dist/{chunk-1mmv8wb8.js → chunk-0atz8fjx.js} +4 -4
- package/dist/chunk-0fm6avxt.js +3 -0
- package/dist/{chunk-5ya4nmmr.js → chunk-0sj79ha5.js} +4 -4
- package/dist/{chunk-dhkw1r4y.js → chunk-0v7555tr.js} +4 -4
- package/dist/{chunk-5jn2qyv7.js → chunk-11c7xg1z.js} +1 -1
- package/dist/chunk-11rnqey0.js +2 -0
- package/dist/{chunk-4b110x6r.js → chunk-16sfjkc4.js} +2 -2
- package/dist/{chunk-kmy34he2.js → chunk-1hbf5e1h.js} +2 -2
- package/dist/{chunk-9atdw0p8.js → chunk-1jvt9t3r.js} +2 -2
- package/dist/chunk-1mx3j280.js +2 -0
- package/dist/{chunk-0d3pkkrv.js → chunk-23x3k751.js} +2 -2
- package/dist/chunk-29v3b5ks.js +2 -0
- package/dist/chunk-2cay3heb.js +2 -0
- package/dist/{chunk-6yketqa1.js → chunk-2f5jjxcj.js} +2 -2
- package/dist/{chunk-razwegar.js → chunk-2vx2ben8.js} +2 -2
- package/dist/{chunk-132j46ey.js → chunk-302nw40c.js} +1 -1
- package/dist/chunk-31yx4sjh.js +2 -0
- package/dist/chunk-33fnbw33.js +2 -0
- package/dist/{chunk-wbsbrm6n.js → chunk-36cz2v8k.js} +30 -30
- package/dist/{chunk-9gptdyqq.js → chunk-388xpdw5.js} +31 -5
- package/dist/chunk-38kerh2r.js +2 -0
- package/dist/chunk-38y11q8x.js +2 -0
- package/dist/{chunk-kyfydbtg.js → chunk-3h4db9yb.js} +3 -3
- package/dist/{chunk-3m457a9q.js → chunk-3jc6yb02.js} +3 -3
- package/dist/chunk-3q80f7mt.js +2 -0
- package/dist/{chunk-fghf6amb.js → chunk-43sgpy4e.js} +5 -5
- package/dist/{chunk-w4177qn3.js → chunk-4e18r89n.js} +2 -2
- package/dist/chunk-4pve3r5a.js +2 -0
- package/dist/{chunk-c08jvjqt.js → chunk-4vz17ytv.js} +8 -8
- package/dist/chunk-5afnyvw5.js +2 -0
- package/dist/chunk-5d5dxts6.js +2 -0
- package/dist/chunk-5fdsyyfe.js +2 -0
- package/dist/chunk-67yr4m5h.js +2 -0
- package/dist/chunk-6aqr0e6s.js +2 -0
- package/dist/chunk-6bw02d1t.js +2 -0
- package/dist/chunk-76mn123c.js +2 -0
- package/dist/{chunk-3z3b98f0.js → chunk-789yp1tg.js} +3 -3
- package/dist/chunk-7ar11ccn.js +2 -0
- package/dist/chunk-7fc0vrs5.js +2 -0
- package/dist/chunk-82fg5gp6.js +2 -0
- package/dist/{chunk-gyv2bsmn.js → chunk-88fx8xc1.js} +2 -2
- package/dist/chunk-89r7bbsk.js +2 -0
- package/dist/{chunk-h8tgqq8x.js → chunk-8b8az19t.js} +5 -5
- package/dist/chunk-8egbh6z1.js +2 -0
- package/dist/chunk-8n9jd8cz.js +2 -0
- package/dist/{chunk-9tj16d70.js → chunk-8wqhzzkn.js} +2 -2
- package/dist/chunk-8x3yaahc.js +2 -0
- package/dist/{chunk-rcwg2pdk.js → chunk-91p8p2cc.js} +5 -5
- package/dist/chunk-94qc4zwb.js +2 -0
- package/dist/{chunk-d4hnj3ct.js → chunk-952dfmcb.js} +2 -2
- package/dist/{chunk-72pbhpq8.js → chunk-95j8660f.js} +2 -2
- package/dist/{chunk-75r2p1cz.js → chunk-9928zdej.js} +2 -2
- package/dist/{chunk-8f5x16ht.js → chunk-9ay18k46.js} +1 -1
- package/dist/{chunk-2gwgcybp.js → chunk-9kn81bmp.js} +1 -1
- package/dist/{chunk-9bexzgws.js → chunk-9tv0tw7f.js} +1 -1
- package/dist/{chunk-0h06ry05.js → chunk-9w9y84t5.js} +6 -6
- package/dist/chunk-a5h9bwrc.js +2 -0
- package/dist/{chunk-gg31th5s.js → chunk-ar6jeqmm.js} +4 -4
- package/dist/{chunk-kx3mmpfd.js → chunk-b5qzed8y.js} +37 -37
- package/dist/chunk-bej9kz05.js +2 -0
- package/dist/chunk-bh2khcet.js +2 -0
- package/dist/{chunk-4h48fgkz.js → chunk-bm6y085n.js} +3 -3
- package/dist/{chunk-9phqwza2.js → chunk-c13dv3wm.js} +10 -10
- package/dist/chunk-c6096ssb.js +2 -0
- package/dist/chunk-ccgabq3a.js +2 -0
- package/dist/{chunk-sdf4c754.js → chunk-cxsc37fg.js} +2 -2
- package/dist/{chunk-jap66ea8.js → chunk-da05660m.js} +37 -37
- package/dist/{chunk-2671myh8.js → chunk-dwt2drzf.js} +5 -5
- package/dist/chunk-e0tvd7jj.js +2 -0
- package/dist/{chunk-sg95ne5m.js → chunk-ezqfrea9.js} +5 -5
- package/dist/{chunk-z27szg5v.js → chunk-f0sxbgbm.js} +1 -1
- package/dist/{chunk-08bzdet4.js → chunk-fn1reean.js} +19 -19
- package/dist/{chunk-2m4d8jkv.js → chunk-frpsrv1e.js} +2 -2
- package/dist/{chunk-pc89t52s.js → chunk-ftvpz1j4.js} +5 -5
- package/dist/{chunk-zjrnz9yt.js → chunk-fvr3h2fr.js} +3 -3
- package/dist/{chunk-8p3vqt2q.js → chunk-fzcqw147.js} +2 -2
- package/dist/{chunk-jttzrv0w.js → chunk-gg715pj6.js} +5 -5
- package/dist/chunk-gmmqz698.js +2 -0
- package/dist/{chunk-nzw0y1ny.js → chunk-h0aw9hmc.js} +3 -3
- package/dist/chunk-hxftzw0x.js +2 -0
- package/dist/{chunk-mpfm5ctr.js → chunk-jr2r2nh5.js} +4 -4
- package/dist/chunk-js1wayhb.js +2 -0
- package/dist/chunk-k2t0w8z1.js +2 -0
- package/dist/chunk-k8s3hyh2.js +2 -0
- package/dist/chunk-kcpxqsdj.js +2 -0
- package/dist/{chunk-nan0ysys.js → chunk-m8n14s3z.js} +2 -2
- package/dist/{chunk-as1p2pch.js → chunk-ma5ptt4m.js} +2 -2
- package/dist/{chunk-fyb9qy7x.js → chunk-mf5cqv1k.js} +9 -9
- package/dist/{chunk-jhegz7az.js → chunk-mgj074y2.js} +5 -5
- package/dist/chunk-mjr5fkc2.js +2 -0
- package/dist/{chunk-gqh8shzf.js → chunk-mt5ewkbg.js} +2 -2
- package/dist/{chunk-0m0w8rr1.js → chunk-n4m50dpk.js} +14 -14
- package/dist/chunk-na0e3s88.js +2 -0
- package/dist/chunk-new89wh2.js +2 -0
- package/dist/{chunk-eyw4g6kq.js → chunk-ngqb22wj.js} +9 -9
- package/dist/{chunk-v0yay1kw.js → chunk-nhyv3w4r.js} +1 -1
- package/dist/{chunk-yzgtsrjb.js → chunk-npj20tj9.js} +2 -2
- package/dist/{chunk-j01a1am0.js → chunk-nwef47nx.js} +1 -1
- package/dist/{chunk-zk1c6tg7.js → chunk-p3fepzt9.js} +3 -3
- package/dist/{chunk-z8rf8abt.js → chunk-p3x84jj0.js} +1 -1
- package/dist/chunk-p9bghe13.js +2 -0
- package/dist/{chunk-fycxc75p.js → chunk-pyyda92j.js} +1 -1
- package/dist/chunk-q2cwzgd0.js +2 -0
- package/dist/chunk-q60afqr7.js +2 -0
- package/dist/chunk-qdwtemy1.js +2 -0
- package/dist/chunk-qp0ndbk6.js +2 -0
- package/dist/{chunk-1ezcxbpg.js → chunk-qsexsrw2.js} +5 -5
- package/dist/{chunk-w3y8408q.js → chunk-r7y1196g.js} +2 -2
- package/dist/{chunk-ta7cwykn.js → chunk-ra2tzsvz.js} +4 -4
- package/dist/chunk-rzsvxjse.js +2 -0
- package/dist/chunk-s2c0ynn9.js +2 -0
- package/dist/{chunk-6w9av0n9.js → chunk-sdmq09jw.js} +1 -1
- package/dist/{chunk-qvjg8w1a.js → chunk-t65f98qv.js} +2 -2
- package/dist/chunk-v1wr2vdx.js +2 -0
- package/dist/{chunk-4fmfc48n.js → chunk-v78hjbz0.js} +3 -3
- package/dist/{chunk-ekyx5z50.js → chunk-vayzmvf5.js} +6 -6
- package/dist/{chunk-f9vch452.js → chunk-w6ydg43d.js} +3 -3
- package/dist/{chunk-e52rtbde.js → chunk-wc10m4tp.js} +3 -3
- package/dist/chunk-wcxa8xy2.js +2 -0
- package/dist/chunk-wgrj0cvs.js +2 -0
- package/dist/{chunk-49n9xce7.js → chunk-wj9bqkc0.js} +1 -1
- package/dist/{chunk-r4za879x.js → chunk-wm24jx3t.js} +2 -2
- package/dist/chunk-wpkwx3wq.js +2 -0
- package/dist/chunk-wq17dce6.js +2 -0
- package/dist/chunk-wvc6eayq.js +2 -0
- package/dist/chunk-xa98a901.js +2 -0
- package/dist/chunk-xjt5129x.js +2 -0
- package/dist/{chunk-eca022er.js → chunk-xnp031ba.js} +6 -6
- package/dist/{chunk-hgtcgz9b.js → chunk-yc3frw0z.js} +2 -2
- package/dist/chunk-yn02d599.js +2 -0
- package/dist/{chunk-g9bsafzx.js → chunk-yq2krsc9.js} +4 -4
- package/dist/chunk-ywrpmyzj.js +5 -0
- package/dist/{chunk-95x3jvmz.js → chunk-z110bf2c.js} +8 -6
- package/dist/{chunk-3syagjd7.js → chunk-zv3rn0ch.js} +4 -4
- package/dist/cli.js +14 -14
- package/dist/client/signals-mount-runtime.js +4 -2
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/dev-server/ts-css.d.ts +1 -1
- package/dist/dev-server/ts-css.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/native/compiler/html-to-ir.d.ts +3 -1
- package/dist/native/compiler/html-to-ir.js +30 -0
- package/dist/process.js +1 -1
- package/dist/pwa.js +3 -3
- package/dist/serve-page-assets.d.ts +2 -0
- package/dist/serve-page-assets.js +14 -0
- package/dist/ssg.js +25 -25
- package/dist/types/config-types.d.ts +2 -0
- package/package.json +5 -5
- package/dist/chunk-1dc6h93m.js +0 -2
- package/dist/chunk-1htdsypj.js +0 -3
- package/dist/chunk-1k5ns68h.js +0 -2
- package/dist/chunk-2870sk9z.js +0 -2
- package/dist/chunk-2fyey6pn.js +0 -2
- package/dist/chunk-2jkq15je.js +0 -2
- package/dist/chunk-3d3f35fz.js +0 -2
- package/dist/chunk-3e3zsgke.js +0 -2
- package/dist/chunk-3fabcebr.js +0 -2
- package/dist/chunk-41y868zf.js +0 -2
- package/dist/chunk-5xsghm23.js +0 -2
- package/dist/chunk-7k1thytm.js +0 -2
- package/dist/chunk-8n42epb6.js +0 -5
- package/dist/chunk-94r6mkcy.js +0 -2
- package/dist/chunk-9s8he3d1.js +0 -2
- package/dist/chunk-9y4gz22m.js +0 -2
- package/dist/chunk-a02sy0m5.js +0 -2
- package/dist/chunk-abs4fwmf.js +0 -2
- package/dist/chunk-abxwggen.js +0 -2
- package/dist/chunk-asewbsct.js +0 -2
- package/dist/chunk-bprjp80g.js +0 -2
- package/dist/chunk-c60egpe6.js +0 -2
- package/dist/chunk-cjq455ve.js +0 -2
- package/dist/chunk-cqq68aw8.js +0 -2
- package/dist/chunk-d9066gp6.js +0 -2
- package/dist/chunk-dmsrpf7h.js +0 -2
- package/dist/chunk-fzh73jtc.js +0 -2
- package/dist/chunk-g3a2gx3p.js +0 -2
- package/dist/chunk-g6s4151k.js +0 -2
- package/dist/chunk-gcc5tp4j.js +0 -2
- package/dist/chunk-gf4a9h9x.js +0 -2
- package/dist/chunk-gmczbe3j.js +0 -2
- package/dist/chunk-h13csdpm.js +0 -2
- package/dist/chunk-h7k1y40p.js +0 -2
- package/dist/chunk-h7xqba9k.js +0 -2
- package/dist/chunk-hpxhxwda.js +0 -2
- package/dist/chunk-j846tv4t.js +0 -2
- package/dist/chunk-jnk3nk5k.js +0 -2
- package/dist/chunk-jy5gh22e.js +0 -2
- package/dist/chunk-jzbte09f.js +0 -2
- package/dist/chunk-k0b1t59r.js +0 -2
- package/dist/chunk-k5v22gn4.js +0 -2
- package/dist/chunk-kwh5pjqd.js +0 -2
- package/dist/chunk-mgcakk1m.js +0 -2
- package/dist/chunk-n3bt1sv5.js +0 -2
- package/dist/chunk-n62nqhey.js +0 -2
- package/dist/chunk-n6ve45hj.js +0 -2
- package/dist/chunk-ptrz5xwt.js +0 -2
- package/dist/chunk-q3ha3fcj.js +0 -2
- package/dist/chunk-qgc59a7d.js +0 -2
- package/dist/chunk-qjkpwjg6.js +0 -2
- package/dist/chunk-t4paeg33.js +0 -2
- package/dist/chunk-tfn3x8t2.js +0 -2
- package/dist/chunk-vhk7a79j.js +0 -2
- package/dist/chunk-vmn8vpp8.js +0 -2
- package/dist/chunk-x1svtz8k.js +0 -2
- package/dist/chunk-ykx4zt07.js +0 -2
- package/dist/chunk-zb75qq5j.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import l from"fs";import u from"path";var m=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],x=3;function h(e,t){let r=u.resolve(u.dirname(t),e);for(let o of b){let s=r+o;try{if(l.statSync(s).isFile())return s}catch{}}return null}function Zr(e,t,r=0,o=new Set){if(!t||r>=x)return!1;for(let s of e.matchAll(g)){let n=h(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=l.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(Zr(i,n,r+1,o))return!0}return!1}var C=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","memo","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","sharedRequest","state","untrack","useAsync","useBroadcastStream","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useNativeDesktop","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useThrottleFn","useTimeout","useTimeoutFn","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],
|
|
3
|
-
export{Zr,C,
|
|
2
|
+
import l from"fs";import u from"path";var m=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],x=3;function h(e,t){let r=u.resolve(u.dirname(t),e);for(let o of b){let s=r+o;try{if(l.statSync(s).isFile())return s}catch{}}return null}function Zr(e,t,r=0,o=new Set){if(!t||r>=x)return!1;for(let s of e.matchAll(g)){let n=h(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=l.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(Zr(i,n,r+1,o))return!0}return!1}var C=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","memo","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","sharedRequest","state","untrack","useAsync","useBroadcastStream","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useNativeDesktop","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useThrottleFn","useTimeout","useTimeoutFn","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],Wl=["onMount","onDestroy"];function vt(e="const",t=[],r){let o=t.length?C.filter((s)=>!t.includes(s)):C;if(r!==void 0)o=o.filter((s)=>{let n=s.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${n}(?![\\w$])`).test(r)});return`${e} { ${o.join(", ")} } = window.stx;`}var y=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var S=C.filter((e)=>!y.includes(e));function oa(e){if(!e)return!1;return S.some((t)=>new RegExp(`\\b${t}\\s*(?:<[^>]*>)?\\s*\\(`).test(e))}var v=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],E=/\s@[a-z][\w.:-]*\s*=/i;function ql(e,t){if(!e)return!1;let r=f(e);return d(r,t)}function d(e,t){if(v.some((r)=>r.test(e)))return!0;if(oa(e))return!0;return T(e,t)}function T(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(Zr(r[1],t))return!0;return!1}function Kl(e,t){if(!e)return!1;let r=f(e);return E.test(r)||d(r,t)}var R=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function Xl(e){return R.includes(e.toLowerCase())}var So=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],_=["x-init","x-transition","x-effect","x-on"],Gl=[...So,..._];function Jl(){return`{${So.map((e)=>`'${e}':1`).join(",")}}`}var ia=["class","style","text","html","show","model","if","ref"];function Yl(){return`{${ia.map((e)=>e==="if"?"'if':1":`${e}:1`).join(",")}}`}var p=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","keydown","keyup","keypress","input","change","submit","focus","blur","scroll","resize","touchstart","touchend","touchmove","contextmenu","wheel","pointerdown","pointerup","pointermove"];function Zl(){return`/^(${p.join("|")})(?:\\.|$)/`}function Ql(e){return p.some((t)=>e===t||e.startsWith(`${t}.`))}var w=65536,A=4,c=new Map;function f(e){if(!e)return e;if(!e.includes("<!--")&&!/<(?:pre|code)\b/i.test(e))return e;let t=e.length>=w;if(t){let s=c.get(e);if(s!==void 0)return s}let r=(s)=>s.replace(/(<[^>]*>)|([^<]+)/g,(n,i,a)=>i??" ".repeat(a.length)),o=e.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/<!--[\s\S]*?-->/g,(s)=>" ".repeat(s.length));if(t){while(c.size>=A){let s=c.keys().next();if(s.done)break;c.delete(s.value)}c.set(e,o)}return o}
|
|
3
|
+
export{Zr,C,Wl,vt,oa,ql,Kl,Xl,So,Gl,Jl,ia,Yl,Zl,Ql};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var f=null,D=[],v=0,g=new Set;function x(){return f}function S(e){let n=f;return D.push(e),f=e,n}function h(e){D.pop(),f=e}var A=new WeakMap;function w(e,n){A.set(e,n)}function p(e,n){for(let r of e){let i=A.get(r);if(i)i(n);else n.add(r)}}function b(e){if(v>0){p(e,g);return}let n=new Set;p(e,n);for(let r of n)r()}function C(e){v++;try{e()}finally{if(v--,v===0){let n=[...g];g.clear();for(let r of n)r()}}}function m(e){let n=f;f=null;try{return e()}finally{f=n}}var k=[],T=[];function xe(e){let n=e,r=new Set,i=new Set,o=()=>{let t=x();if(t)i.add(t);return n};return o.set=(t)=>{if(!Object.is(t,n)){let c=n;n=t,r.forEach((u)=>{try{u(n,c)}catch(l){console.error("[stx] subscriber error:",l)}}),b(i)}},o.update=(t)=>{o.set(t(n))},o.subscribe=(t)=>(r.add(t),()=>r.delete(t)),Object.defineProperty(o,"_isSignal",{value:!0,writable:!1}),Object.defineProperty(o,"value",{get:()=>o(),set:(t)=>o.set(t),configurable:!0}),o}function ir(e,n={}){let r,i=!0,o=!1,t=new Set,c=typeof n.equals==="function"?n.equals:null,u=()=>{let s=S(d);try{r=e(),o=!0}finally{h(s)}i=!1},l=()=>{let s=r,y=o;try{u()}catch{return i=!0,!0}return!y||!c(s,r)},d=()=>{if(i)return;if(c&&t.size){if(l())b(t);return}i=!0,b(t)};w(d,(s)=>{if(i)return;if(c&&t.size){if(l())p(t,s);return}i=!0,p(t,s)});let a=()=>{let s=x();if(s)t.add(s);if(i)u();return r};return Object.defineProperty(a,"_isDerived",{value:!0,writable:!1}),Object.defineProperty(a,"value",{get:()=>a(),configurable:!0}),a}function
|
|
3
|
-
export{xe,ir,
|
|
2
|
+
var f=null,D=[],v=0,g=new Set;function x(){return f}function S(e){let n=f;return D.push(e),f=e,n}function h(e){D.pop(),f=e}var A=new WeakMap;function w(e,n){A.set(e,n)}function p(e,n){for(let r of e){let i=A.get(r);if(i)i(n);else n.add(r)}}function b(e){if(v>0){p(e,g);return}let n=new Set;p(e,n);for(let r of n)r()}function C(e){v++;try{e()}finally{if(v--,v===0){let n=[...g];g.clear();for(let r of n)r()}}}function m(e){let n=f;f=null;try{return e()}finally{f=n}}var k=[],T=[];function xe(e){let n=e,r=new Set,i=new Set,o=()=>{let t=x();if(t)i.add(t);return n};return o.set=(t)=>{if(!Object.is(t,n)){let c=n;n=t,r.forEach((u)=>{try{u(n,c)}catch(l){console.error("[stx] subscriber error:",l)}}),b(i)}},o.update=(t)=>{o.set(t(n))},o.subscribe=(t)=>(r.add(t),()=>r.delete(t)),Object.defineProperty(o,"_isSignal",{value:!0,writable:!1}),Object.defineProperty(o,"value",{get:()=>o(),set:(t)=>o.set(t),configurable:!0}),o}function ir(e,n={}){let r,i=!0,o=!1,t=new Set,c=typeof n.equals==="function"?n.equals:null,u=()=>{let s=S(d);try{r=e(),o=!0}finally{h(s)}i=!1},l=()=>{let s=r,y=o;try{u()}catch{return i=!0,!0}return!y||!c(s,r)},d=()=>{if(i)return;if(c&&t.size){if(l())b(t);return}i=!0,b(t)};w(d,(s)=>{if(i)return;if(c&&t.size){if(l())p(t,s);return}i=!0,p(t,s)});let a=()=>{let s=x();if(s)t.add(s);if(i)u();return r};return Object.defineProperty(a,"_isDerived",{value:!0,writable:!1}),Object.defineProperty(a,"value",{get:()=>a(),configurable:!0}),a}function Gh(e,n=Object.is){return ir(e,{equals:n})}function ar(e,n={}){let r,i=!1,o=()=>{if(i)return;if(r){let c=r;r=void 0;try{c()}catch(u){console.error("[stx] effect cleanup error:",u)}}let t=S(o);try{let c=e();r=typeof c==="function"?c:void 0}catch(c){i=!0,console.error("[stx] effect error (the effect is disposed):",c)}finally{h(t)}};if(n.immediate!==!1)o();return()=>{if(i=!0,r){let t=r;r=void 0,t()}}}function Vo(e){C(e)}function hs(e){k.push(e)}function ys(e){T.push(e)}function Jh(){O(k,"onMount",T)}function Yh(){O(T,"onDestroy")}function O(e,n,r){let i=e.splice(0,e.length);for(let o of i)try{let t=o();if(r&&typeof t==="function")r.push(t)}catch(t){console.error(`[stx] ${n} callback threw:`,t)}}function Zh(){return{mount:k.length,destroy:T.length}}function cr(e){return typeof e==="function"&&e._isSignal===!0}function lr(e){return typeof e==="function"&&e._isDerived===!0}function Wo(e){if(cr(e)||lr(e))return m(()=>e());return e}function bs(e){return m(e)}function Qh(e,n){let r=typeof e==="function"?e:()=>e,i=xe([]),o=ir(()=>i().reduce((u,l)=>n(u,l.action),r())),t=!1;return ar(()=>{if(r(),!t){t=!0;return}if(bs(()=>i().length))i.set([])}),[o,(u,l)=>{let d={action:u};i.set([...i(),d]);let a=()=>{let s=i().filter((y)=>y!==d);if(s.length!==i().length)i.set(s)};if(l&&typeof l.then==="function")Promise.resolve(l).then(a,a);return a}]}
|
|
3
|
+
export{xe,ir,Gh,ar,Vo,hs,ys,Jh,Yh,Zh,cr,lr,Wo,bs,Qh};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{pe}from"./chunk-
|
|
3
|
-
export{Ha,
|
|
2
|
+
import{pe}from"./chunk-88fx8xc1.js";import R from"fs";import g from"path";import C from"crypto";var S=new Set(["webp","avif","jpeg","png"]),T=new Set(["cover","contain","fill","inside","outside"]),q=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),k=4096,D=80,U="cover";async function Ha(e,t){let r=t.routePath??"/_stx/img",h=new URL(e.url);if(h.pathname!==r)return null;let a=A(h,t);if(!a.ok)return new Response(a.error,{status:a.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:n,srcUrl:d,width:l,height:i,format:s,quality:u,fit:c}=a,m;try{m=R.statSync(n)}catch{return new Response(`Source image not found: ${d}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!m.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let w=t.cacheDir??".stx/cache/img";await R.promises.mkdir(w,{recursive:!0});let b=`${n}:${m.mtimeMs}:${m.size}`,I=`${l}x${i}:${s}:${u}:${c}`,f=C.createHash("sha256").update(`${b}|${I}`).digest("hex").slice(0,16),o=g.join(w,`${f}.${s}`),p={"Content-Type":pe(s),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${f}"`,"X-Stx-Image-Cache":"HIT"};if(e.headers.get("if-none-match")===`"${f}"`)return new Response(null,{status:304,headers:p});let v=Bun.file(o);if(await v.exists())return new Response(v,{headers:p});try{let x=Buffer.from(await Bun.file(n).arrayBuffer()),{resizeAndConvert:P}=await L(),F=await P(x,{width:l,height:i,format:s,quality:u,fit:c});return await Bun.write(o,F),p["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(F),{headers:p})}catch(x){let P=x.message;return new Response(`Image processing failed: ${P}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function xu(e){return async(t)=>await Ha(t,e)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}function A(e,t){let r=e.searchParams.get("src");if(!r)return{ok:!1,error:"Missing required param: src",status:400};if(!r.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(r.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let h=g.extname(r).toLowerCase();if(!q.has(h))return{ok:!1,error:`Unsupported source extension: ${h}`,status:400};let a=g.resolve(t.publicDir),n=g.resolve(a,r.slice(1));if(!n.startsWith(`${a}${g.sep}`)&&n!==a)return{ok:!1,error:"src is outside publicDir",status:400};let d=t.maxWidth??k,l=t.maxHeight??k,i=e.searchParams.get("w"),s=e.searchParams.get("h"),u=i?Number.parseInt(i,10):0,c=s?Number.parseInt(s,10):0;if(i&&(!Number.isFinite(u)||u<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(s&&(!Number.isFinite(c)||c<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!i&&!s)return{ok:!1,error:"At least one of w or h is required",status:400};let m=Math.min(u||d,d),w=Math.min(c||l,l),b=e.searchParams.get("f")||"webp";if(!S.has(b))return{ok:!1,error:`Invalid f (must be one of: ${[...S].join(", ")})`,status:400};let I=b,f=e.searchParams.get("q"),o=f?Number.parseInt(f,10):t.defaultQuality??D;if(!Number.isFinite(o)||o<1||o>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let y=e.searchParams.get("fit")||t.defaultFit||U;if(!T.has(y))return{ok:!1,error:`Invalid fit (must be one of: ${[...T].join(", ")})`,status:400};return{ok:!0,srcFsPath:n,srcUrl:r,width:m,height:w,format:I,quality:o,fit:y}}async function L(){return await import("./chunk-9ay18k46.js")}
|
|
3
|
+
export{Ha,xu};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ra,Fy,zy,zl,nt,rm,vo,Hy,Uy,Vy,Wy,qy,Ky,Xy,Gy,Jy}from"./chunk-4vz17ytv.js";import"./chunk-0jdz31q1.js";export{Ky as applyHead,Hy as definePageMeta,ra as getHead,Fy as getPageMeta,nt as mergeHeadConfigs,Xy as processHeadDirective,Jy as processMetaDirective,Gy as processTitleDirective,qy as renderBodyAttrs,Vy as renderHead,Wy as renderHtmlAttrs,zy as resetHead,vo as seoMetaToHeadConfig,zl as useHead,Uy as usePageTitle,rm as useSeoMeta,Uy as useTitle};
|
|
@@ -298,5 +298,5 @@ catch (error) {
|
|
|
298
298
|
init();
|
|
299
299
|
}
|
|
300
300
|
})();
|
|
301
|
-
</script>`}var
|
|
302
|
-
export{
|
|
301
|
+
</script>`}var um={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"},dm={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"},pm={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"},fm={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"},Co=[um,dm,pm,fm];function Yy(t){return[...t,...Co]}
|
|
302
|
+
export{um,dm,pm,fm,Co,Yy};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Gu,Xo,ur,Ju,Yu,Zu,Qu,ed,td,nd,rd,sd,od,id,ad,cd,ld,ud,dd,pd,fd,gd,md,hd,yd,bd,wd,vd,xd,Sd,kd,_d,Cd,Ed,Td,$d,Rd,Ad,Pd,Id,Od,Nd,Md,Dd,Ld,jd,Bd,Fd,dn,sc,zd,Hd,Ud,oc,Vd,Wd,qd,Kd,Xd,Gd,ic,Jd,Yd,Zd,Qd,ep,tp,np,rp,sp,dr,op,ip,ap,cp,lp,up,dp,pp,fp,gp,mp,hp,Go,yp,bp,wp,vp,xp,vs,xs,Sp,kp,_p,Cp,Ep,ac,Tp,$p,Rp,cc,Jo,Ap,Pp,lc,uc,Ss,dc,Ip,pn,Op,pc,fc,Yo,Np,Zo,Mp,Dp,Lp,jp,Bp,Fp,zp,gc,Hp,Up,mc,Vp,Wp,qp,Kp,Xp,Gp,Jp,Yp,Zp,Qp,ef,tf,nf,rf,sf,of,af,cf,lf,uf,df,pf,ff,gf,hc,mf,hf,yf,bf,wf,vf,xf,Sf,kf,_f,Cf,pr,yc,bc,Ef,fr,Tf,$f,Rf,wc,vc,ks,_s,Af,Qo,Pf,If,Of,Nf,Mf,Df,Lf,jf,Bf,Ff,zf,Hf,Uf,Vf,Wf,qf,Kf,Xf,Gf,Jf,xc,Yf,Zf,Sc,kc,Qf,eg}from"./chunk-36cz2v8k.js";export{Bd as AVAILABLE_COMPONENTS,ac as AutoUpdater,Fd as COMPONENT_STYLES,ks as DEFAULT_WATCH_INTERVAL_MS,vc as MAX_WATCH_INTERVAL_MS,wc as MIN_WATCH_INTERVAL_MS,Gd as MODAL_STYLES,sd as TOAST_STYLES,np as TRAY_MENU_STYLES,lc as UPDATE_MANIFEST_ASSET,Wd as alert,df as appInfo,Df as appleScript,eg as applicationDataDirectory,Mf as audio,Zf as backgroundDelay,af as battery,Nf as biometric,_f as bluetooth,zf as bonjour,pn as bundlePathForExecutable,Np as caffeinate,Tp as canReplaceBundle,$p as clearQuarantine,Yp as clipboard,Xd as closeAllModals,hp as closeAllWindows,Vd as confirm,gf as contextMenu,Kf as continuityCamera,qf as coreml,Cp as craftBinaryNotFoundMessage,Go as craftWindowArguments,pr as crashReporter,Td as createAccordion,vd as createAutocomplete,dd as createAvatar,ud as createBadge,od as createButton,pd as createCard,Nd as createChart,ad as createCheckbox,kd as createChip,Md as createCodeEditor,yd as createColorPicker,Od as createDataGrid,bd as createDatePicker,xs as createDiskImage,gd as createDropdown,Ld as createFileExplorer,Ip as createGitHubUpdateManifest,dc as createGitHubUpdater,Sd as createImageView,Kp as createInterval,xd as createLabel,Ad as createListView,Dd as createMediaPlayer,Jd as createMenubar,Rd as createModalComponent,Qf as createNativeUpdateApi,kc as createPantrySelfUpdater,Bp as createPreferences,ld as createProgressBar,hd as createRadioButton,md as createRating,Cd as createScrollView,Yo as createSelfUpdater,cd as createSlider,Ed as createSplitView,$d as createStepper,ic as createSystemTray,Pd as createTable,fd as createTabs,id as createTextInput,wd as createTimePicker,qp as createTimer,_d as createTooltip,Id as createTreeView,jd as createWebView,yp as createWindow,wp as createWindowWithHTML,Zo as decaffeinate,of as deepLinks,Xp as delay,td as dismissAlertById,nd as dismissAllAlerts,rf as dragOut,Rp as extractBundle,Lf as fileAssociations,Qo as focus,If as focusShortcutsReady,Jp as formatCompact,jp as formatDuration,Lp as formatRemainingTime,Hp as formatShortcut,Gp as formatTime,Qp as fs,cc as generateUpdateManifest,rd as getActiveAlertCount,Kd as getActiveModalCount,Yd as getActiveTrayInstances,gp as getActiveWindowIds,Dp as getCaffeinateStatus,Jf as getCapabilities,xc as getCapability,pp as getDesktopConfig,up as getDialogBridgeScript,Wp as getRegisteredHotkeys,ep as getSimulatedTrayHTML,tp as getTrayBridgeScript,Zd as getTrayInstance,mp as getWindow,xp as getWindowBridgeScript,uc as githubLatestAssetUrl,Ss as githubReleaseAssetUrl,tf as globalShortcuts,fr as handoff,Pf as hasFocusShortcuts,Ef as iap,zp as isAutoLaunchEnabled,Yf as isAvailable,Mp as isCaffeinated,sf as isDragOutAvailable,vp as isWebviewAvailable,yf as keychain,Tf as liveActivities,Of as localServer,$f as location,Ff as log,Sp as macOSRuntimeExecutablePath,ff as menu,Wf as midi,vf as nativeAutoLaunch,xf as nativeTray,Sf as nativeWindow,cf as network,Zp as notifications,ed as notify,bp as openDevWindow,kp as pack,_p as packageApp,Sc as parsePantryUpdateManifest,gc as parseShortcut,Bf as pdf,bf as permissions,wf as printing,qd as prompt,pc as quitLauncher,Jo as readBundleIdentity,yc as redactPII,Up as registerHotkey,fc as relaunchBundle,Gu as requestNotificationPermission,fp as resetDesktopConfig,Ep as resolveCraftBinary,vs as resolveCraftExecutablePath,Op as runningBundleTeamId,hf as screen,Rf as screenCapture,_s as screenSharing,Gf as serial,Xf as serviceMenu,Fp as setAutoLaunch,dp as setDesktopConfig,ef as shell,Xo as showAlert,ip as showAlertDialog,op as showColorPicker,ap as showConfirmDialog,cp as showErrorDialog,Hd as showErrorModal,Qu as showErrorToast,sc as showInfoModal,Ju as showInfoToast,dr as showMessageBox,dn as showModal,rp as showOpenDialog,oc as showQuestionModal,sp as showSaveDialog,Ud as showSuccessModal,Yu as showSuccessToast,ur as showToast,lp as showWarningDialog,zd as showWarningModal,Zu as showWarningToast,hc as sidebar,bc as signPayload,Cf as speech,Uf as speechRecognition,Hf as spotlight,pf as standardMenus,Ap as swapBundle,mf as system,jf as tags,nf as theme,kf as touchbar,Qd as triggerTrayAction,Vp as unregisterAllHotkeys,mc as unregisterHotkey,lf as updater,Pp as verifyBundleTrust,Vf as vision,Af as watchScreenSharing,uf as windowEvents};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as
|
|
3
|
-
export{
|
|
2
|
+
import{Broadcast as s,BroadcastServer as h}from"ts-broadcasting";import{channel as Xm}from"ts-broadcasting";import{Broadcast as Gm,BroadcastServer as Jm}from"ts-broadcasting";var e=null,u=[];function Fm(){return e}async function zm(n){if(e)return e;let t=n.driver??"bun",r=n.host??"0.0.0.0",c=n.port??6001,l=n.scheme??"ws",a={verbose:n.verbose??!1,driver:t,default:t,connections:{[t]:{driver:t,host:r,port:c,scheme:l}}};return e=new h(a),s.setServer(e),await e.start(),e}async function Hm(){for(let n of u)clearInterval(n);if(u.length=0,!e)return;await e.stop(),e=null}async function Um(n){let t=await import(n),r=t.default??t;if(typeof r!=="function")throw Error(`routes/channels.ts must export a default function, got ${typeof r}`);let c=0;return r({channel(a,o){if(c++,o.authorize&&e)e.channels.channel(a,o.authorize);if(o.interval&&o.data){let d=o.event??`${a}.updated`,p=o.data,v=setInterval(async()=>{try{let g=await p();vu(a,d,g)}catch{}},o.interval);u.push(v)}}}),c}var f=!1;function i(){if(e)return!0;if(!f)f=!0,console.warn("[stx] broadcast() called before server started \u2014 messages will be sent once broadcasting is ready");return!1}function vu(n,t,r){if(!i())return;s.send(n,t,r)}function Vm(n,t,r){if(!i())return;s.toUser(n,t,r)}function Wm(n,t,r){if(!i())return;s.toUsers(n,t,r)}function qm(n,t,r){if(!i())return;s.send(`private-${n}`,t,r)}function Km(n,t,r){if(!i())return;s.presence(n,t,r)}
|
|
3
|
+
export{Fm,zm,Hm,Um,vu,Vm,Wm,qm,Km,Xm,Gm,Jm};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function
|
|
3
|
-
export{
|
|
2
|
+
import{existsSync as g,statSync as p}from"fs";import e from"path";var w=/[*?[\]{}]/;function Cg(o){return w.test(o)}async function xi(o,n={}){let i=n.cwd??process.cwd(),u=n.recursive!==!1,l=n.ignorePaths??[],c=globalThis.Bun.Glob,a=new Set,r=(t)=>{if(t.includes(`${e.sep}node_modules${e.sep}`)||t.includes(`${e.sep}dist${e.sep}`))return;if(l.some((s)=>s&&t.includes(e.normalize(s))))return;a.add(t)},d=async(t)=>{try{for await(let s of new c(t).scan({cwd:i,absolute:!0}))r(s)}catch{}};for(let t of o){if(!t)continue;if(Cg(t)){await d(t);continue}let s=e.resolve(i,t);if(!g(s))continue;if(p(s).isDirectory()){for await(let f of new c(u?"**/*.stx":"*.stx").scan({cwd:s,absolute:!0}))r(f);continue}r(s)}return[...a].sort()}
|
|
3
|
+
export{Cg,xi};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t}from"./chunk-
|
|
2
|
+
import{t}from"./chunk-fvr3h2fr.js";function y(e,i,s=240){return e.slice(i,i+s)}var v=[{rule:"route-params",pattern:/\blocation\s*\.\s*pathname\s*\.\s*(?:match|split)\s*\(/g,primitive:"useRoute() / useRouteParams() / useRouteParam(name)",why:"parsing the URL by hand re-implements the router and does not update on SPA navigation"},{rule:"alert",pattern:/(?<![.#\w$])(?:(?:window|globalThis)\s*\.\s*)?alert\s*\(/g,primitive:"stxAlert(message)",why:"themed, focus-trapped and non-blocking \u2014 but `await` it if the code after it "+"depended on the native dialog blocking until dismissal",reject:(e)=>/\b(?:async\s+)?function\s+alert\s*\(/.test(e)||/\b(?:const|let|var)\s+alert\s*=/.test(e)},{rule:"search-params",pattern:/new\s+URLSearchParams\s*\(/g,primitive:"useSearchParams()",why:"reactive, and writes back through the router instead of history.replaceState",reject:(e,i)=>{let s=e.indexOf("(",i);if(s===-1)return!0;let o=e.slice(s+1,e.indexOf(")",s)+1);return!/\b(?:location|search|href|url)\b/i.test(o)}},{rule:"navigate",pattern:/\blocation\s*\.\s*(?:assign|replace)\s*\(|\blocation\s*\.\s*href\s*=/g,primitive:"navigate(path) / goBack()",why:"a full document load throws away every store and the scroll position; navigate() is an SPA transition",reject:(e,i)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(y(e,i,160))},{rule:"fetch",pattern:/new\s+AbortController\s*\(/g,primitive:"useFetch(url) / useAsyncData(key, fn)",why:"cancellation, loading and error state are already wired; hand-rolling them is where the races live"},{rule:"polling",pattern:/setInterval\s*\(/g,primitive:"useEventSource() / useSSE() / useWebSocket() / useChannel()",why:"polling burns requests and lags; the push primitives are delivered",reject:(e,i)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(y(e,i))},{rule:"debounce",pattern:/\bclearTimeout\s*\(/g,primitive:"useDebounce(fn, ms) / useThrottle(fn, ms)",why:"a hand-held timer handle per call site is the usual source of stale-result bugs",requires:(e)=>/setTimeout\s*\(/.test(e)},{rule:"click-outside",pattern:/document\s*\.\s*addEventListener\s*\(\s*['"](?:click|mousedown|pointerdown)['"]/g,primitive:"useClickOutside(ref, fn)",why:"the document-level listener plus the blur race is exactly what this composable exists to remove"},{rule:"focus",pattern:/\.\s*(?:getElementById|querySelector)\s*\([^)]*\)\s*(?:\?\.)?\s*\.?focus\s*\(/g,primitive:"useFocus(ref) with x-ref",why:"a query by id breaks under nested scopes and SPA navigation; a ref does not"},{rule:"clipboard",pattern:/navigator\s*\.\s*(?:clipboard|share)\b/g,primitive:"useClipboard() / useShare()",why:"permission state, the copied flag and the unsupported-browser fallback are already handled"},{rule:"watch",pattern:/\beffect\s*\(\s*\(\s*\)\s*=>\s*\{[^}]*\bvoid\s+\w+\s*\(\s*\)/g,primitive:"watch(source, cb) / watchMultiple([...], cb)",why:"the `void a(); void b()` dance is a manual dependency list; watch takes one directly"}],C=["confirm","tooltip",...v.map((e)=>e.rule)];function g(e,i){let s=1;for(let o=0;o<i;o++)if(e[o]===`
|
|
3
3
|
`)s++;return s}function b(e,i){let s=e.lastIndexOf(`
|
|
4
4
|
`,i)+1,o=e.indexOf(`
|
|
5
5
|
`,i);return e.slice(s,o===-1?e.length:o).trim().slice(0,120)}function S(e,i){let s=e.slice(0,i),o=s.lastIndexOf("function"),l=s.lastIndexOf("=>"),r=Math.max(o,l);if(r===-1)return!1;let n=e.slice(Math.max(0,r-120),r);return/\basync\b[^;{}]*$/.test(n)}function k(e){return/\b(?:async\s+)?function\s+confirm\s*\(/.test(e)||/\b(?:const|let|var)\s+confirm\s*=/.test(e)||/\bimport\s*\{[^}]*\bconfirm\b[^}]*\}/.test(e)}function A(e,i,s){if(k(e))return e;let o=/(^|[^\w$.])(?:(?:window|globalThis)\s*\.\s*)?confirm\s*\(/g,l=m(e),r="",n=0,a;while((a=o.exec(l))!==null){let c=a.index+a[1].length,u=g(e,c),d=b(e,c);if(/stxConfirm\s*\($/.test(e.slice(0,c+8)))continue;let p=S(e,c);if(s.push({file:i,line:u,rule:"confirm",applied:p,snippet:d,reason:p?void 0:"stxConfirm() returns a Promise and native confirm() is synchronous, so this needs `await` inside an async function. Rewriting it here would make the condition always true."}),p)r+=e.slice(n,c)+"await stxConfirm(",n=c+(a[0].length-a[1].length)}return r+e.slice(n)}function E(e,i,s){let o=/(<[a-z][\w-]*\b[^>]*?)\stitle=(["'])(.*?)\2/gis,l=R(e),r="",n=0,a;while((a=o.exec(l))!==null){let[c,u,d,p]=a,h=g(e,a.index),f=b(e,a.index),w=u.match(/^<([A-Za-z][\w-]*)/)?.[1]??"";if(/^[A-Z]/.test(w)){s.push({file:i,line:h,rule:"tooltip",applied:!1,snippet:f,reason:`\`title\` on <${w}> is a component prop, not an HTML attribute \u2014 `+"adding x-tooltip here would put a tooltip on a component and may duplicate text it already renders."});continue}if(/\bx-tooltip[=\s]/.test(u)||p.trim()===""){s.push({file:i,line:h,rule:"tooltip",applied:!1,snippet:f,reason:/\bx-tooltip[=\s]/.test(u)?"already has x-tooltip":"empty title"});continue}s.push({file:i,line:h,rule:"tooltip",applied:!0,snippet:f}),r+=e.slice(n,a.index)+`${u} x-tooltip=${d}${p}${d} title=${d}${p}${d}`,n=a.index+c.length}return r+e.slice(n)}function R(e){return e.replace(/<!--[\s\S]*?-->/g,(i)=>i.replace(/[^\n]/g," ")).replace(/\{\{--[\s\S]*?--\}\}/g,(i)=>i.replace(/[^\n]/g," "))}function F(e){let i=(s)=>s.replace(/[^\n]/g," ");return e.replace(/\/\*[\s\S]*?\*\//g,i).replace(/\/\/[^\n]*/g,i)}function m(e,i=!1){let s=R(e);return(i?F(s):t(s)).replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,(l,r)=>/\bclient\b/i.test(r)?l:l.replace(/[^\n]/g," "))}function O(e,i,s,o){let l=m(e),r=m(e,!0);for(let n of v){if(!s.includes(n.rule))continue;if(n.requires&&!n.requires(e))continue;n.pattern.lastIndex=0;let a,c=/['"]/.test(n.pattern.source)?r:l;n.pattern.lastIndex=0;while((a=n.pattern.exec(c))!==null){if(n.reject?.(e,a.index))continue;o.push({file:i,line:g(e,a.index),rule:n.rule,applied:!1,snippet:b(e,a.index),reason:`${n.primitive} \u2014 ${n.why}`})}}}function q(e,i={}){let s=i.rules??C,o=i.file??"<source>",l=[];O(e,o,s,l);let r=e;if(s.includes("confirm"))r=A(r,o,l);if(s.includes("tooltip"))r=E(r,o,l);l.sort((c,u)=>c.line-u.line);let n=new Set,a=l.filter((c)=>{let u=`${c.rule}:${c.line}`;if(n.has(u))return!1;return n.add(u),!0});return{code:r,findings:a}}var x=new Set(["confirm","tooltip"]);function I(e,i){if(e.length===0)return"No hand-rolled equivalents found.";let s=e.filter((n)=>n.applied),o=e.filter((n)=>!n.applied&&x.has(n.rule)),l=e.filter((n)=>!n.applied&&!x.has(n.rule)),r=[];if(s.length>0){r.push(i?`Rewrote ${s.length} site(s):`:`Would rewrite ${s.length} site(s) (pass --fix):`);for(let n of s)r.push(` ${n.file}:${n.line} [${n.rule}] ${n.snippet}`)}if(o.length>0){r.push("",`Needs a human \u2014 ${o.length} site(s):`);for(let n of o)r.push(` ${n.file}:${n.line} [${n.rule}] ${n.snippet}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{br,i}from"./chunk-n4m50dpk.js";import"./chunk-ngqb22wj.js";import"./chunk-43sgpy4e.js";import"./chunk-fs43342z.js";import"./chunk-0v7555tr.js";import"./chunk-0fm6avxt.js";import"./chunk-bm6y085n.js";import"./chunk-9tv0tw7f.js";import"./chunk-9w9y84t5.js";import{Pe}from"./chunk-8b8az19t.js";import"./chunk-nhyv3w4r.js";import"./chunk-t65f98qv.js";import"./chunk-0adc8x2h.js";import"./chunk-mf5cqv1k.js";import"./chunk-w6ydg43d.js";import"./chunk-2vx2ben8.js";import"./chunk-jr2r2nh5.js";import"./chunk-xnp031ba.js";import"./chunk-388xpdw5.js";import{Ke,lo,uo}from"./chunk-b5qzed8y.js";import"./chunk-p3x84jj0.js";import"./chunk-w98yt4d4.js";import"./chunk-4vz17ytv.js";import"./chunk-phzhmnnm.js";import"./chunk-9928zdej.js";import"./chunk-0jdz31q1.js";import"./chunk-16sfjkc4.js";export{br as buildModulesTag,Pe as injectRouterScript,i as processDirectives,lo as processJsonDirective,uo as processOnceDirective,Ke as validateClientScript};
|