@askrjs/askr 0.0.21 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +160 -46
  3. package/dist/_virtual/___vite-browser-external.js +1 -0
  4. package/dist/_virtual/__vite-browser-external.js +1 -0
  5. package/dist/_virtual/_commonjsHelpers.js +1 -0
  6. package/dist/_virtual/main.js +1 -0
  7. package/dist/_virtual/preload-helper.js +1 -0
  8. package/dist/{benchmark.d.ts → bench/benchmark-entry.d.ts} +3 -3
  9. package/dist/bench/benchmark-entry.d.ts.map +1 -0
  10. package/dist/benchmark.js +1 -1
  11. package/dist/boot/index.d.ts +70 -0
  12. package/dist/boot/index.d.ts.map +1 -0
  13. package/dist/boot/index.js +2 -0
  14. package/dist/common/component.d.ts +16 -0
  15. package/dist/common/component.d.ts.map +1 -0
  16. package/dist/common/errors.d.ts +53 -0
  17. package/dist/common/errors.d.ts.map +1 -0
  18. package/dist/common/index.d.ts +14 -0
  19. package/dist/common/index.d.ts.map +1 -0
  20. package/dist/common/jsx.d.ts +17 -0
  21. package/dist/common/jsx.d.ts.map +1 -0
  22. package/dist/common/jsx.js +1 -0
  23. package/dist/{jsx-CPjsGyEg.d.ts → common/props.d.ts} +6 -18
  24. package/dist/common/props.d.ts.map +1 -0
  25. package/dist/{router-DaGtH1Sq.d.ts → common/router.d.ts} +10 -7
  26. package/dist/common/router.d.ts.map +1 -0
  27. package/dist/common/ssr-errors.d.ts +8 -0
  28. package/dist/common/ssr-errors.d.ts.map +1 -0
  29. package/dist/common/ssr-errors.js +1 -0
  30. package/dist/common/ssr.d.ts +17 -0
  31. package/dist/common/ssr.d.ts.map +1 -0
  32. package/dist/common/vnode.d.ts +17 -0
  33. package/dist/common/vnode.d.ts.map +1 -0
  34. package/dist/common/vnode.js +1 -0
  35. package/dist/components/link.d.ts +56 -0
  36. package/dist/components/link.d.ts.map +1 -0
  37. package/dist/components/link.js +1 -0
  38. package/dist/dev/invariant.d.ts +83 -0
  39. package/dist/dev/invariant.d.ts.map +1 -0
  40. package/dist/dev/invariant.js +2 -0
  41. package/dist/dev/logger.d.ts +13 -0
  42. package/dist/dev/logger.d.ts.map +1 -0
  43. package/dist/dev/logger.js +1 -0
  44. package/dist/dev/vite-plugin-askr.d.ts +18 -0
  45. package/dist/dev/vite-plugin-askr.d.ts.map +1 -0
  46. package/dist/dev/warnings.d.ts +5 -0
  47. package/dist/dev/warnings.d.ts.map +1 -0
  48. package/dist/for/for.d.ts +16 -0
  49. package/dist/for/for.d.ts.map +1 -0
  50. package/dist/for/for.js +1 -0
  51. package/dist/for/index.d.ts +2 -63
  52. package/dist/for/index.d.ts.map +1 -0
  53. package/dist/for/index.js +1 -1
  54. package/dist/foundations/core.d.ts +23 -0
  55. package/dist/foundations/core.d.ts.map +1 -0
  56. package/dist/foundations/core.js +1 -0
  57. package/dist/foundations/index.d.ts +3 -669
  58. package/dist/foundations/index.d.ts.map +1 -0
  59. package/dist/foundations/index.js +1 -1
  60. package/dist/foundations/interactions/dismissable.d.ts +58 -0
  61. package/dist/foundations/interactions/dismissable.d.ts.map +1 -0
  62. package/dist/foundations/interactions/dismissable.js +1 -0
  63. package/dist/foundations/interactions/focusable.d.ts +16 -0
  64. package/dist/foundations/interactions/focusable.d.ts.map +1 -0
  65. package/dist/foundations/interactions/focusable.js +1 -0
  66. package/dist/foundations/interactions/hoverable.d.ts +19 -0
  67. package/dist/foundations/interactions/hoverable.d.ts.map +1 -0
  68. package/dist/foundations/interactions/hoverable.js +1 -0
  69. package/dist/foundations/interactions/index.d.ts +5 -0
  70. package/dist/foundations/interactions/index.d.ts.map +1 -0
  71. package/dist/foundations/interactions/interaction-policy.d.ts +96 -0
  72. package/dist/foundations/interactions/interaction-policy.d.ts.map +1 -0
  73. package/dist/foundations/interactions/interaction-policy.js +1 -0
  74. package/dist/foundations/interactions/pressable.d.ts +54 -0
  75. package/dist/foundations/interactions/pressable.d.ts.map +1 -0
  76. package/dist/foundations/interactions/pressable.js +1 -0
  77. package/dist/foundations/interactions/roving-focus.d.ts +117 -0
  78. package/dist/foundations/interactions/roving-focus.d.ts.map +1 -0
  79. package/dist/foundations/interactions/roving-focus.js +1 -0
  80. package/dist/foundations/state/controllable.d.ts +53 -0
  81. package/dist/foundations/state/controllable.d.ts.map +1 -0
  82. package/dist/foundations/state/controllable.js +1 -0
  83. package/dist/foundations/state/index.d.ts +2 -0
  84. package/dist/foundations/state/index.d.ts.map +1 -0
  85. package/dist/foundations/structures/collection.d.ts +67 -0
  86. package/dist/foundations/structures/collection.d.ts.map +1 -0
  87. package/dist/foundations/structures/collection.js +1 -0
  88. package/dist/foundations/structures/index.d.ts +5 -0
  89. package/dist/foundations/structures/index.d.ts.map +1 -0
  90. package/dist/foundations/structures/layer.d.ts +102 -0
  91. package/dist/foundations/structures/layer.d.ts.map +1 -0
  92. package/dist/foundations/structures/layer.js +1 -0
  93. package/dist/{layout-BINPv-nz.d.ts → foundations/structures/layout.d.ts} +3 -4
  94. package/dist/foundations/structures/layout.d.ts.map +1 -0
  95. package/dist/foundations/structures/layout.js +1 -0
  96. package/dist/foundations/structures/portal.d.ts +33 -0
  97. package/dist/foundations/structures/portal.d.ts.map +1 -0
  98. package/dist/foundations/structures/portal.js +1 -0
  99. package/dist/foundations/structures/presence.d.ts +30 -0
  100. package/dist/foundations/structures/presence.d.ts.map +1 -0
  101. package/dist/foundations/structures/presence.js +1 -0
  102. package/dist/foundations/structures/slot.d.ts +31 -0
  103. package/dist/foundations/structures/slot.d.ts.map +1 -0
  104. package/dist/foundations/structures/slot.js +1 -0
  105. package/dist/foundations/structures.d.ts +14 -0
  106. package/dist/foundations/structures.d.ts.map +1 -0
  107. package/dist/foundations/structures.js +1 -0
  108. package/dist/foundations/utilities/aria.d.ts +13 -0
  109. package/dist/foundations/utilities/aria.d.ts.map +1 -0
  110. package/dist/foundations/utilities/aria.js +1 -0
  111. package/dist/foundations/utilities/compose-handlers.d.ts +34 -0
  112. package/dist/foundations/utilities/compose-handlers.d.ts.map +1 -0
  113. package/dist/foundations/utilities/compose-handlers.js +1 -0
  114. package/dist/foundations/utilities/compose-ref.d.ts +24 -0
  115. package/dist/foundations/utilities/compose-ref.d.ts.map +1 -0
  116. package/dist/foundations/utilities/compose-ref.js +1 -0
  117. package/dist/foundations/utilities/event-types.d.ts +17 -0
  118. package/dist/foundations/utilities/event-types.d.ts.map +1 -0
  119. package/dist/foundations/utilities/index.d.ts +7 -0
  120. package/dist/foundations/utilities/index.d.ts.map +1 -0
  121. package/dist/foundations/utilities/merge-props.d.ts +2 -0
  122. package/dist/foundations/utilities/merge-props.d.ts.map +1 -0
  123. package/dist/foundations/utilities/merge-props.js +1 -0
  124. package/dist/foundations/utilities/use-id.d.ts +29 -0
  125. package/dist/foundations/utilities/use-id.d.ts.map +1 -0
  126. package/dist/foundations/utilities/use-id.js +1 -0
  127. package/dist/fx/fx.d.ts +30 -0
  128. package/dist/fx/fx.d.ts.map +1 -0
  129. package/dist/fx/fx.js +1 -0
  130. package/dist/fx/index.d.ts +5 -184
  131. package/dist/fx/index.d.ts.map +1 -0
  132. package/dist/fx/index.js +1 -1
  133. package/dist/fx/noop.d.ts +12 -0
  134. package/dist/fx/noop.d.ts.map +1 -0
  135. package/dist/fx/noop.js +1 -0
  136. package/dist/fx/timing.d.ts +155 -0
  137. package/dist/fx/timing.d.ts.map +1 -0
  138. package/dist/fx/timing.js +1 -0
  139. package/dist/index.d.ts +18 -37
  140. package/dist/index.d.ts.map +1 -0
  141. package/dist/index.js +1 -1
  142. package/dist/jsx/index.d.ts +4 -0
  143. package/dist/jsx/index.d.ts.map +1 -0
  144. package/dist/jsx/index.js +1 -0
  145. package/dist/jsx/jsx-dev-runtime.d.ts +4 -0
  146. package/dist/jsx/jsx-dev-runtime.d.ts.map +1 -0
  147. package/dist/jsx/jsx-runtime.d.ts +10 -0
  148. package/dist/jsx/jsx-runtime.d.ts.map +1 -0
  149. package/dist/{types-BTT0Fc9S.d.ts → jsx/types.d.ts} +6 -3
  150. package/dist/jsx/types.d.ts.map +1 -0
  151. package/dist/jsx/types.js +1 -0
  152. package/dist/jsx/utils.d.ts +4 -0
  153. package/dist/jsx/utils.d.ts.map +1 -0
  154. package/dist/jsx/utils.js +1 -0
  155. package/dist/jsx-dev-runtime.js +1 -1
  156. package/dist/jsx-runtime.js +1 -1
  157. package/dist/node_modules/esbuild/lib/main.js +65 -0
  158. package/dist/renderer/cleanup.d.ts +25 -0
  159. package/dist/renderer/cleanup.d.ts.map +1 -0
  160. package/dist/renderer/cleanup.js +1 -0
  161. package/dist/renderer/dom.d.ts +44 -0
  162. package/dist/renderer/dom.d.ts.map +1 -0
  163. package/dist/renderer/dom.js +1 -0
  164. package/dist/renderer/evaluate.d.ts +4 -0
  165. package/dist/renderer/evaluate.d.ts.map +1 -0
  166. package/dist/renderer/evaluate.js +1 -0
  167. package/dist/renderer/fastpath.d.ts +7 -0
  168. package/dist/renderer/fastpath.d.ts.map +1 -0
  169. package/dist/renderer/fastpath.js +1 -0
  170. package/dist/renderer/index.d.ts +6 -0
  171. package/dist/renderer/index.d.ts.map +1 -0
  172. package/dist/renderer/index.js +1 -0
  173. package/dist/renderer/keyed.d.ts +23 -0
  174. package/dist/renderer/keyed.d.ts.map +1 -0
  175. package/dist/renderer/keyed.js +1 -0
  176. package/dist/renderer/reconcile.d.ts +88 -0
  177. package/dist/renderer/reconcile.d.ts.map +1 -0
  178. package/dist/renderer/reconcile.js +1 -0
  179. package/dist/renderer/types.d.ts +3 -0
  180. package/dist/renderer/types.d.ts.map +1 -0
  181. package/dist/renderer/types.js +1 -0
  182. package/dist/renderer/utils.d.ts +63 -0
  183. package/dist/renderer/utils.d.ts.map +1 -0
  184. package/dist/renderer/utils.js +1 -0
  185. package/dist/resources/index.d.ts +7 -22
  186. package/dist/resources/index.d.ts.map +1 -0
  187. package/dist/resources/index.js +1 -1
  188. package/dist/router/index.d.ts +8 -87
  189. package/dist/router/index.d.ts.map +1 -0
  190. package/dist/router/index.js +1 -1
  191. package/dist/router/match.d.ts +22 -0
  192. package/dist/router/match.d.ts.map +1 -0
  193. package/dist/router/match.js +1 -0
  194. package/dist/router/navigate.d.ts +20 -0
  195. package/dist/router/navigate.d.ts.map +1 -0
  196. package/dist/router/navigate.js +1 -0
  197. package/dist/router/route.d.ts +52 -0
  198. package/dist/router/route.d.ts.map +1 -0
  199. package/dist/router/route.js +1 -0
  200. package/dist/runtime/component.d.ts +123 -0
  201. package/dist/runtime/component.d.ts.map +1 -0
  202. package/dist/runtime/component.js +1 -0
  203. package/dist/runtime/context.d.ts +80 -0
  204. package/dist/runtime/context.d.ts.map +1 -0
  205. package/dist/runtime/context.js +1 -0
  206. package/dist/runtime/derive.d.ts +7 -0
  207. package/dist/runtime/derive.d.ts.map +1 -0
  208. package/dist/runtime/derive.js +1 -0
  209. package/dist/runtime/dev-namespace.d.ts +31 -0
  210. package/dist/runtime/dev-namespace.d.ts.map +1 -0
  211. package/dist/runtime/dev-namespace.js +1 -0
  212. package/dist/runtime/events.d.ts +52 -0
  213. package/dist/runtime/events.d.ts.map +1 -0
  214. package/dist/runtime/events.js +1 -0
  215. package/dist/runtime/execution-model.d.ts +4 -0
  216. package/dist/runtime/execution-model.d.ts.map +1 -0
  217. package/dist/runtime/execution-model.js +1 -0
  218. package/dist/runtime/fastlane.d.ts +27 -0
  219. package/dist/runtime/fastlane.d.ts.map +1 -0
  220. package/dist/runtime/fastlane.js +1 -0
  221. package/dist/runtime/for.d.ts +52 -0
  222. package/dist/runtime/for.d.ts.map +1 -0
  223. package/dist/runtime/for.js +1 -0
  224. package/dist/runtime/hydration.d.ts +25 -0
  225. package/dist/runtime/hydration.d.ts.map +1 -0
  226. package/dist/runtime/operations.d.ts +39 -0
  227. package/dist/runtime/operations.d.ts.map +1 -0
  228. package/dist/runtime/operations.js +1 -0
  229. package/dist/runtime/resource-cell.d.ts +35 -0
  230. package/dist/runtime/resource-cell.d.ts.map +1 -0
  231. package/dist/runtime/resource-cell.js +1 -0
  232. package/dist/runtime/scheduler.d.ts +48 -0
  233. package/dist/runtime/scheduler.d.ts.map +1 -0
  234. package/dist/runtime/scheduler.js +1 -0
  235. package/dist/runtime/snapshot.d.ts +25 -0
  236. package/dist/runtime/snapshot.d.ts.map +1 -0
  237. package/dist/runtime/ssr-bridge.d.ts +10 -0
  238. package/dist/runtime/ssr-bridge.d.ts.map +1 -0
  239. package/dist/runtime/ssr-bridge.js +1 -0
  240. package/dist/runtime/state.d.ts +56 -0
  241. package/dist/runtime/state.d.ts.map +1 -0
  242. package/dist/runtime/state.js +1 -0
  243. package/dist/ssr/attrs.d.ts +26 -0
  244. package/dist/ssr/attrs.d.ts.map +1 -0
  245. package/dist/ssr/attrs.js +1 -0
  246. package/dist/ssr/context.d.ts +47 -0
  247. package/dist/ssr/context.d.ts.map +1 -0
  248. package/dist/ssr/context.js +1 -0
  249. package/dist/ssr/create-ssr.d.ts +19 -0
  250. package/dist/ssr/create-ssr.d.ts.map +1 -0
  251. package/dist/ssr/errors.d.ts +6 -0
  252. package/dist/ssr/errors.d.ts.map +1 -0
  253. package/dist/ssr/errors.js +1 -0
  254. package/dist/ssr/escape.d.ts +38 -0
  255. package/dist/ssr/escape.d.ts.map +1 -0
  256. package/dist/ssr/escape.js +1 -0
  257. package/dist/ssr/index.d.ts +18 -94
  258. package/dist/ssr/index.d.ts.map +1 -0
  259. package/dist/ssr/index.js +1 -1
  260. package/dist/ssr/render-keys.d.ts +39 -0
  261. package/dist/ssr/render-keys.d.ts.map +1 -0
  262. package/dist/ssr/render-keys.js +1 -0
  263. package/dist/ssr/sink.d.ts +23 -0
  264. package/dist/ssr/sink.d.ts.map +1 -0
  265. package/dist/ssr/sink.js +1 -0
  266. package/dist/ssr/stream-render.d.ts +7 -0
  267. package/dist/ssr/stream-render.d.ts.map +1 -0
  268. package/dist/ssr/stream-render.js +1 -0
  269. package/dist/ssr/types.d.ts +21 -0
  270. package/dist/ssr/types.d.ts.map +1 -0
  271. package/dist/vite/index.js +3 -1
  272. package/package.json +11 -10
  273. package/dist/chunk-37RC6ZT3.js +0 -1
  274. package/dist/chunk-3L6PFAJ3.js +0 -1
  275. package/dist/chunk-47D5SNYH.js +0 -1
  276. package/dist/chunk-4RTKQ7SC.js +0 -1
  277. package/dist/chunk-5PLQPS3O.js +0 -1
  278. package/dist/chunk-62D2TNHX.js +0 -1
  279. package/dist/chunk-BP2CKUO6.js +0 -1
  280. package/dist/chunk-D2JSJKCW.js +0 -1
  281. package/dist/chunk-EQ5S5GU4.js +0 -1
  282. package/dist/chunk-HGMOQ3I7.js +0 -1
  283. package/dist/chunk-HZKAD5DE.js +0 -1
  284. package/dist/chunk-ILZCMHZM.js +0 -2
  285. package/dist/chunk-NL44ANML.js +0 -2
  286. package/dist/chunk-YRY4OLQF.js +0 -1
  287. package/dist/component-AJMg1Gmv.d.ts +0 -177
  288. package/dist/jsx-dev-runtime.d.ts +0 -7
  289. package/dist/jsx-runtime.d.ts +0 -14
  290. package/dist/logger-NGZDJLVS.js +0 -1
  291. package/dist/main-EPE35NMW.js +0 -65
  292. package/dist/navigate-4VAVLF3A.js +0 -1
  293. package/dist/route-IVG3V65Y.js +0 -1
  294. package/dist/vite/index.d.ts +0 -17
@@ -1,2 +0,0 @@
1
- import {a}from'./chunk-D2JSJKCW.js';import {j as j$1}from'./chunk-ILZCMHZM.js';import {c}from'./chunk-62D2TNHX.js';var q={};c(q,{_lockRouteRegistrationForTests:()=>T,_unlockRouteRegistrationForTests:()=>U,clearRoutes:()=>C,getLoadedNamespaces:()=>F,getNamespaceRoutes:()=>Q,getRoutes:()=>W,lockRouteRegistration:()=>L,registerRoute:()=>_,resolveRoute:()=>J,route:()=>S,setServerLocation:()=>O,unloadNamespace:()=>j});function h(e,r){let o=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e,i=r.endsWith("/")&&r!=="/"?r.slice(0,-1):r,t=o.split("/").filter(Boolean),n=i.split("/").filter(Boolean);if(n.length===1&&n[0]==="*")return {matched:true,params:{"*":t.length>1?o:t[0]}};if(t.length!==n.length)return {matched:false,params:{}};let s={};for(let a=0;a<n.length;a++){let c=n[a],u=t[a];if(c.startsWith("{")&&c.endsWith("}")){let f=c.slice(1,-1);s[f]=decodeURIComponent(u);}else if(c==="*")s["*"]=u;else if(c!==u)return {matched:false,params:{}}}return {matched:true,params:s}}var l=[],g=new Set,P=Symbol.for("__ASKR_HAS_ROUTES__");function b(e){try{let r=globalThis;r[P]=e;}catch{}}b(false);var p=new Map;function z(e){let r=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;return r==="/"?0:r.split("/").filter(Boolean).length}function v(e){let r=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;if(r==="/*")return 0;let o=r.split("/").filter(Boolean),i=0;for(let t of o)t.startsWith("{")&&t.endsWith("}")?i+=2:t==="*"?i+=1:i+=3;return i}var w=null;function O(e){w=e;}function M(e){try{let r=new URL(e,"http://localhost");return {pathname:r.pathname,search:r.search,hash:r.hash}}catch{return {pathname:"/",search:"",hash:""}}}function m(e){if(e&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let r of Object.keys(e)){let o=e[r];o&&typeof o=="object"&&m(o);}}return e}function N(e){let r=new URLSearchParams(e||""),o=new Map;for(let[t,n]of r.entries()){let s=o.get(t);s?s.push(n):o.set(t,[n]);}return m({get(t){let n=o.get(t);return n?n[0]:null},getAll(t){let n=o.get(t);return n?[...n]:[]},has(t){return o.has(t)},toJSON(){let t={};for(let[n,s]of o.entries())t[n]=s.length>1?[...s]:s[0];return t}})}function B(e){let r=W(),o=[];function i(t){let n=t.endsWith("/")&&t!=="/"?t.slice(0,-1):t;if(n==="/*")return 0;let s=n.split("/").filter(Boolean),a=0;for(let c of s)c.startsWith("{")&&c.endsWith("}")?a+=2:c==="*"?a+=1:a+=3;return a}for(let t of r){let n=h(e,t.path);n.matched&&o.push({pattern:t.path,params:n.params,name:t.name,namespace:t.namespace,specificity:i(t.path)});}return o.sort((t,n)=>n.specificity-t.specificity),o.map(t=>({path:t.pattern,params:m({...t.params}),name:t.name,namespace:t.namespace}))}var d=false;function L(){d=true;}function T(){d=true;}function U(){d=false;}function S(e,r,o){if(a()==="islands")throw new Error("Routes are not supported with islands. Use createSPA (client) or createSSR (server) instead.");if(typeof e>"u"){let a=j$1();if(!a)throw new Error("route() can only be called during component render execution. Call route() from inside your component function.");let c="/",u="",f="";if(typeof window<"u"&&window.location)c=window.location.pathname||"/",u=window.location.search||"",f=window.location.hash||"";else if(w){let R=M(w);c=R.pathname,u=R.search,f=R.hash;}let A=m({...a.props||{}}),D=N(u),E=B(c);return Object.freeze({path:c,params:A,query:D,hash:f||null,matches:Object.freeze(E)})}let i=j$1();if(i&&i.ssr)throw new Error("route() cannot be called during SSR rendering. Register routes at module load time instead.");if(d)throw new Error("Route registration is locked after app startup. Register routes at module load time before calling createSPA or createSSR.");if(typeof r!="function")throw new Error("route(path, handler) requires a function handler that returns a VNode (e.g. () => <Page />). Passing JSX elements or VNodes directly is not supported.");let t={path:e,handler:r,namespace:o};l.push(t),b(true);let n=z(e),s=p.get(n);s||(s=[],p.set(n,s)),s.push(t),o&&g.add(o);}function W(){return [...l]}function Q(e){return l.filter(r=>r.namespace===e)}function j(e){let r=l.length;for(let o=l.length-1;o>=0;o--)if(l[o].namespace===e){let i=l[o];l.splice(o,1);let t=z(i.path),n=p.get(t);if(n){let s=n.indexOf(i);s>=0&&n.splice(s,1);}}return g.delete(e),r-l.length}function C(){l.length=0,g.clear(),p.clear(),d=false,b(false);}function k(e){if(e!=null&&typeof e=="function")return (r,o)=>{try{return e(r,o)}catch{return e(r)}}}function _(e,r,...o){let i=!e.startsWith("/"),t={path:e,handler:r,children:o.filter(Boolean),_isDescriptor:true};if(!i){let n=k(r);if(r!=null&&!n)throw new Error("registerRoute(path, handler) requires a function handler. Passing JSX elements or VNodes directly is not supported.");n&&S(e,n);for(let s of t.children||[]){let c=`${e==="/"?"":e.replace(/\/$/,"")}/${s.path.replace(/^\//,"")}`.replace(/\/\//g,"/");if(s.handler){let u=k(s.handler);if(!u)throw new Error("registerRoute child handler must be a function. Passing JSX elements directly is not supported.");u&&S(c,u);}s.children&&s.children.length&&_(c,null,...s.children);}return t}return t}function F(){return Array.from(g)}function J(e){let r=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e,o=r==="/"?0:r.split("/").filter(Boolean).length,i=[],t=p.get(o);if(t)for(let n of t){let s=h(e,n.path);s.matched&&i.push({route:n,specificity:v(n.path),params:s.params});}for(let n of l){if(t?.includes(n))continue;let s=h(e,n.path);s.matched&&i.push({route:n,specificity:v(n.path),params:s.params});}if(i.sort((n,s)=>s.specificity-n.specificity),i.length>0){let n=i[0];return {handler:n.route.handler,params:n.params}}return null}
2
- export{O as a,L as b,T as c,U as d,S as e,W as f,Q as g,j as h,C as i,_ as j,F as k,J as l,q as m};
@@ -1 +0,0 @@
1
- var r=class e extends Error{constructor(n="Server-side rendering requires all data to be available synchronously. This component attempted to use async data during SSR."){super(n);this.code="SSR_DATA_MISSING";this.name="SSRDataMissingError",Object.setPrototypeOf(this,e.prototype);}};var o={getCurrentSSRContext(){return null},throwSSRDataMissing(){throw new Error("[Askr] SSR data missing (SSR bridge not installed). If you are rendering on the server, ensure you are using the askr SSR entrypoints.")},getCurrentRenderData(){return null},getNextKey(){throw new Error("[Askr] getNextKey() called outside SSR render phase (SSR bridge not installed).")}},t=o;function s(e){t=e;}function d(){return t}export{r as a,s as b,d as c};
@@ -1,177 +0,0 @@
1
- import { P as Props, J as JSXElement } from './jsx-CPjsGyEg.js';
2
-
3
- /**
4
- * State primitive for Askr components
5
- * Optimized for minimal overhead and fast updates
6
- *
7
- * INVARIANTS ENFORCED:
8
- * - state() only callable during component render (currentInstance exists)
9
- * - state() called at top-level only (indices must be monotonically increasing)
10
- * - state values persist across re-renders (stored in stateValues array)
11
- * - state.set() cannot be called during render (causes infinite loops)
12
- * - state.set() always enqueues through scheduler (never direct mutation)
13
- * - state.set() callback (notifyUpdate) always available
14
- */
15
-
16
- /**
17
- * State value holder - callable to read, has set method to update
18
- * @example
19
- * const count = state(0);
20
- * count(); // read: 0
21
- * count.set(1); // write: triggers re-render
22
- */
23
- interface State<T> {
24
- (): T;
25
- set(value: T): void;
26
- set(updater: (prev: T) => T): void;
27
- _hasBeenRead?: boolean;
28
- _readers?: Map<ComponentInstance, number>;
29
- }
30
- /**
31
- * Creates a local state value for a component
32
- * Optimized for:
33
- * - O(1) read performance
34
- * - Minimal allocation per state
35
- * - Fast scheduler integration
36
- *
37
- * IMPORTANT: state() must be called during component render execution.
38
- * It captures the current component instance from context.
39
- * Calling outside a component function will throw an error.
40
- *
41
- * @example
42
- * ```ts
43
- * // ✅ Correct: called during render
44
- * export function Counter() {
45
- * const count = state(0);
46
- * return { type: 'button', children: [count()] };
47
- * }
48
- *
49
- * // ❌ Wrong: called outside component
50
- * const count = state(0);
51
- * export function BadComponent() {
52
- * return { type: 'div' };
53
- * }
54
- * ```
55
- */
56
- declare function state<T>(initialValue: T): State<T>;
57
-
58
- /**
59
- * Common call contracts: Component signatures
60
- */
61
-
62
- type ComponentContext = {
63
- signal: AbortSignal;
64
- };
65
- type ComponentVNode = {
66
- type: string;
67
- props?: Props;
68
- children?: (string | ComponentVNode | null | undefined | false)[];
69
- };
70
- type ComponentFunction = (props: Props, context?: ComponentContext) => JSXElement | ComponentVNode | string | number | null;
71
-
72
- /**
73
- * Context system: lexical scope + render-time snapshots
74
- *
75
- * CORE SEMANTIC (Option A — Snapshot-Based):
76
- * ============================================
77
- * An async resource observes the context of the render that created it.
78
- * Context changes only take effect via re-render, not magically mid-await.
79
- *
80
- * This ensures:
81
- * - Deterministic behavior
82
- * - Concurrency safety
83
- * - Replayable execution
84
- * - Debuggability
85
- *
86
- * INVARIANTS:
87
- * - readContext() only works during component render (has currentContextFrame)
88
- * - Each render captures a context snapshot
89
- * - Async continuations see the snapshot from render start (frozen)
90
- * - Provider (Scope) creates a new frame that shadows parent
91
- * - Context updates require re-render to take effect
92
- */
93
-
94
- type ContextKey = symbol;
95
- interface ContextFrame {
96
- parent: ContextFrame | null;
97
- values: Map<ContextKey, unknown> | null;
98
- }
99
-
100
- /**
101
- * Component instance lifecycle management
102
- * Internal only — users never see this
103
- */
104
-
105
- interface ComponentInstance {
106
- id: string;
107
- fn: ComponentFunction;
108
- props: Props;
109
- target: Element | null;
110
- mounted: boolean;
111
- abortController: AbortController;
112
- ssr?: boolean;
113
- cleanupStrict?: boolean;
114
- stateValues: State<unknown>[];
115
- evaluationGeneration: number;
116
- notifyUpdate: (() => void) | null;
117
- _pendingFlushTask?: () => void;
118
- _pendingRunTask?: () => void;
119
- _enqueueRun?: () => void;
120
- stateIndexCheck: number;
121
- expectedStateIndices: number[];
122
- firstRenderComplete: boolean;
123
- mountOperations: Array<() => void | (() => void) | Promise<void | (() => void)>>;
124
- cleanupFns: Array<() => void>;
125
- hasPendingUpdate: boolean;
126
- ownerFrame: ContextFrame | null;
127
- isRoot?: boolean;
128
- _currentRenderToken?: number;
129
- lastRenderToken?: number;
130
- _pendingReadStates?: Set<State<unknown>>;
131
- _lastReadStates?: Set<State<unknown>>;
132
- _placeholder?: Comment;
133
- }
134
- /**
135
- * Get the abort signal for the current component
136
- * Used to cancel async operations on unmount/navigation
137
- *
138
- * The signal is guaranteed to be aborted when:
139
- * - Component unmounts
140
- * - Navigation occurs (different route)
141
- * - Parent is destroyed
142
- *
143
- * IMPORTANT: getSignal() must be called during component render execution.
144
- * It captures the current component instance from context.
145
- *
146
- * @returns AbortSignal that will be aborted when component unmounts
147
- * @throws Error if called outside component execution
148
- *
149
- * @example
150
- * ```ts
151
- * // ✅ Correct: called during render, used in async operation
152
- * export async function UserPage({ id }: { id: string }) {
153
- * const signal = getSignal();
154
- * const user = await fetch(`/api/users/${id}`, { signal });
155
- * return <div>{user.name}</div>;
156
- * }
157
- *
158
- * // ✅ Correct: passed to event handler
159
- * export function Button() {
160
- * const signal = getSignal();
161
- * return {
162
- * type: 'button',
163
- * props: {
164
- * onClick: async () => {
165
- * const data = await fetch(url, { signal });
166
- * }
167
- * }
168
- * };
169
- * }
170
- *
171
- * // ❌ Wrong: called outside component context
172
- * const signal = getSignal(); // Error: not in component
173
- * ```
174
- */
175
- declare function getSignal(): AbortSignal;
176
-
177
- export { type ComponentFunction as C, type State as S, type ComponentInstance as a, getSignal as g, state as s };
@@ -1,7 +0,0 @@
1
- import './types-BTT0Fc9S.js';
2
- import { J as JSXElement } from './jsx-CPjsGyEg.js';
3
- export { F as Fragment } from './jsx-CPjsGyEg.js';
4
-
5
- declare function jsxDEV(type: unknown, props: Record<string, unknown> | null, key?: string | number): JSXElement;
6
-
7
- export { jsxDEV };
@@ -1,14 +0,0 @@
1
- import './types-BTT0Fc9S.js';
2
- import { J as JSXElement } from './jsx-CPjsGyEg.js';
3
- export { F as Fragment } from './jsx-CPjsGyEg.js';
4
-
5
- /**
6
- * JSX runtime factory
7
- * Same element shape as production runtime.
8
- */
9
-
10
- declare function jsxDEV(type: unknown, props: Record<string, unknown> | null, key?: string | number): JSXElement;
11
- declare function jsx(type: unknown, props: Record<string, unknown> | null, key?: string | number): JSXElement;
12
- declare function jsxs(type: unknown, props: Record<string, unknown> | null, key?: string | number): JSXElement;
13
-
14
- export { jsx, jsxDEV, jsxs };
@@ -1 +0,0 @@
1
- export{a as logger}from'./chunk-HGMOQ3I7.js';import'./chunk-62D2TNHX.js';
@@ -1,65 +0,0 @@
1
- import {b,a}from'./chunk-62D2TNHX.js';var ar=b((or,ht)=>{var We=Object.defineProperty,wt=Object.getOwnPropertyDescriptor,yt=Object.getOwnPropertyNames,bt=Object.prototype.hasOwnProperty,vt=(e,t)=>{for(var r in t)We(e,r,{get:t[r],enumerable:true});},xt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of yt(t))!bt.call(e,l)&&l!==r&&We(e,l,{get:()=>t[l],enumerable:!(n=wt(t,l))||n.enumerable});return e},$t=e=>xt(We({},"__esModule",{value:true}),e),Se={};vt(Se,{analyzeMetafile:()=>Gt,analyzeMetafileSync:()=>tr,build:()=>Yt,buildSync:()=>Xt,context:()=>Ht,default:()=>lr,formatMessages:()=>Qt,formatMessagesSync:()=>er,initialize:()=>nr,stop:()=>rr,transform:()=>Kt,transformSync:()=>Zt,version:()=>Vt});ht.exports=$t(Se);function ze(e){let t=n=>{if(n===null)r.write8(0);else if(typeof n=="boolean")r.write8(1),r.write8(+n);else if(typeof n=="number")r.write8(2),r.write32(n|0);else if(typeof n=="string")r.write8(3),r.write(ne(n));else if(n instanceof Uint8Array)r.write8(4),r.write(n);else if(n instanceof Array){r.write8(5),r.write32(n.length);for(let l of n)t(l);}else {let l=Object.keys(n);r.write8(6),r.write32(l.length);for(let s of l)r.write(ne(s)),t(n[s]);}},r=new Ze;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),Ne(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function Et(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return !!r.read8();case 2:return r.read32();case 3:return be(r.read());case 4:return r.read();case 5:{let a=r.read32(),h=[];for(let o=0;o<a;o++)h.push(t());return h}case 6:{let a=r.read32(),h={};for(let o=0;o<a;o++)h[be(r.read())]=t();return h}default:throw new Error("Invalid packet")}},r=new Ze(e),n=r.read32(),l=(n&1)===0;n>>>=1;let s=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return {id:n,isRequest:l,value:s}}var Ze=class{constructor(e=new Uint8Array(1024)){this.buf=e,this.len=0,this.ptr=0;}_write(e){if(this.len+e>this.buf.length){let t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t;}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e;}write32(e){let t=this._write(4);Ne(this.buf,e,t);}write(e){let t=this._write(4+e.length);Ne(this.buf,e.length,t),this.buf.set(e,t+4);}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return et(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),r=this._read(t.length);return t.set(this.buf.subarray(r,r+e)),t}},ne,be,Ie;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;ne=r=>e.encode(r),be=r=>t.decode(r),Ie='new TextEncoder().encode("")';}else if(typeof Buffer<"u")ne=e=>Buffer.from(e),be=e=>{let{buffer:t,byteOffset:r,byteLength:n}=e;return Buffer.from(t,r,n).toString()},Ie='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(ne("")instanceof Uint8Array))throw new Error(`Invariant violation: "${Ie} instanceof Uint8Array" is incorrectly false
2
-
3
- This indicates that your JavaScript environment is broken. You cannot use
4
- esbuild in this environment because esbuild relies on this invariant. This
5
- is not a problem with esbuild. You need to fix your environment instead.
6
- `);function et(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function Ne(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24;}var V=JSON.stringify,qe="warning",Je="silent";function ye(e,t){let r=[];for(let n of e){if(G(n,t),n.indexOf(",")>=0)throw new Error(`Invalid ${t}: ${n}`);r.push(n);}return r.join(",")}var Oe=()=>null,U=e=>typeof e=="boolean"?null:"a boolean",y=e=>typeof e=="string"?null:"a string",Me=e=>e instanceof RegExp?null:"a RegExp object",de=e=>typeof e=="number"&&e===(e|0)?null:"an integer",kt=e=>typeof e=="number"&&e===(e|0)&&e>=0&&e<=65535?null:"a valid port number",tt=e=>typeof e=="function"?null:"a function",se=e=>Array.isArray(e)?null:"an array",X=e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"an array of strings",Z=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",St=e=>typeof e=="object"&&e!==null?null:"an array or an object",At=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Ve=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",rt=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",Pt=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",nt=e=>typeof e=="string"||Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"a string or an array of strings",it=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",jt=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function i(e,t,r,n){let l=e[r];if(t[r+""]=true,l===void 0)return;let s=n(l);if(s!==null)throw new Error(`${V(r)} must be ${s}`);return l}function J(e,t,r){for(let n in e)if(!(n in t))throw new Error(`Invalid option ${r}: ${V(n)}`)}function Ot(e){let t=Object.create(null),r=i(e,t,"wasmURL",jt),n=i(e,t,"wasmModule",At),l=i(e,t,"worker",U);return J(e,t,"in initialize() call"),{wasmURL:r,wasmModule:n,worker:l}}function lt(e){let t;if(e!==void 0){t=Object.create(null);for(let r in e){let n=e[r];if(typeof n=="string"||n===false)t[r]=n;else throw new Error(`Expected ${V(r)} in mangle cache to map to either a string or false`)}}return t}function Fe(e,t,r,n,l){let s=i(t,r,"color",U),a=i(t,r,"logLevel",y),h=i(t,r,"logLimit",de);s!==void 0?e.push(`--color=${s}`):n&&e.push("--color=true"),e.push(`--log-level=${a||l}`),e.push(`--log-limit=${h||0}`);}function G(e,t,r){if(typeof e!="string")throw new Error(`Expected value for ${t}${r!==void 0?" "+V(r):""} to be a string, got ${typeof e} instead`);return e}function at(e,t,r){let n=i(t,r,"legalComments",y),l=i(t,r,"sourceRoot",y),s=i(t,r,"sourcesContent",U),a=i(t,r,"target",nt),h=i(t,r,"format",y),o=i(t,r,"globalName",y),w=i(t,r,"mangleProps",Me),g=i(t,r,"reserveProps",Me),$=i(t,r,"mangleQuoted",U),I=i(t,r,"minify",U),_=i(t,r,"minifySyntax",U),B=i(t,r,"minifyWhitespace",U),N=i(t,r,"minifyIdentifiers",U),L=i(t,r,"lineLimit",de),W=i(t,r,"drop",X),z=i(t,r,"dropLabels",X),x=i(t,r,"charset",y),p=i(t,r,"treeShaking",U),d=i(t,r,"ignoreAnnotations",U),u=i(t,r,"jsx",y),E=i(t,r,"jsxFactory",y),S=i(t,r,"jsxFragment",y),M=i(t,r,"jsxImportSource",y),A=i(t,r,"jsxDev",U),c=i(t,r,"jsxSideEffects",U),f=i(t,r,"define",Z),v=i(t,r,"logOverride",Z),j=i(t,r,"supported",Z),D=i(t,r,"pure",X),P=i(t,r,"keepNames",U),k=i(t,r,"platform",y),O=i(t,r,"tsconfigRaw",Pt),R=i(t,r,"absPaths",X);if(n&&e.push(`--legal-comments=${n}`),l!==void 0&&e.push(`--source-root=${l}`),s!==void 0&&e.push(`--sources-content=${s}`),a&&e.push(`--target=${ye(Array.isArray(a)?a:[a],"target")}`),h&&e.push(`--format=${h}`),o&&e.push(`--global-name=${o}`),k&&e.push(`--platform=${k}`),O&&e.push(`--tsconfig-raw=${typeof O=="string"?O:JSON.stringify(O)}`),I&&e.push("--minify"),_&&e.push("--minify-syntax"),B&&e.push("--minify-whitespace"),N&&e.push("--minify-identifiers"),L&&e.push(`--line-limit=${L}`),x&&e.push(`--charset=${x}`),p!==void 0&&e.push(`--tree-shaking=${p}`),d&&e.push("--ignore-annotations"),W)for(let m of W)e.push(`--drop:${G(m,"drop")}`);if(z&&e.push(`--drop-labels=${ye(z,"drop label")}`),R&&e.push(`--abs-paths=${ye(R,"abs paths")}`),w&&e.push(`--mangle-props=${De(w)}`),g&&e.push(`--reserve-props=${De(g)}`),$!==void 0&&e.push(`--mangle-quoted=${$}`),u&&e.push(`--jsx=${u}`),E&&e.push(`--jsx-factory=${E}`),S&&e.push(`--jsx-fragment=${S}`),M&&e.push(`--jsx-import-source=${M}`),A&&e.push("--jsx-dev"),c&&e.push("--jsx-side-effects"),f)for(let m in f){if(m.indexOf("=")>=0)throw new Error(`Invalid define: ${m}`);e.push(`--define:${m}=${G(f[m],"define",m)}`);}if(v)for(let m in v){if(m.indexOf("=")>=0)throw new Error(`Invalid log override: ${m}`);e.push(`--log-override:${m}=${G(v[m],"log override",m)}`);}if(j)for(let m in j){if(m.indexOf("=")>=0)throw new Error(`Invalid supported: ${m}`);let F=j[m];if(typeof F!="boolean")throw new Error(`Expected value for supported ${V(m)} to be a boolean, got ${typeof F} instead`);e.push(`--supported:${m}=${F}`);}if(D)for(let m of D)e.push(`--pure:${G(m,"pure")}`);P&&e.push("--keep-names");}function Mt(e,t,r,n,l){var s;let a=[],h=[],o=Object.create(null),w=null,g=null;Fe(a,t,o,r,n),at(a,t,o);let $=i(t,o,"sourcemap",rt),I=i(t,o,"bundle",U),_=i(t,o,"splitting",U),B=i(t,o,"preserveSymlinks",U),N=i(t,o,"metafile",U),L=i(t,o,"outfile",y),W=i(t,o,"outdir",y),z=i(t,o,"outbase",y),x=i(t,o,"tsconfig",y),p=i(t,o,"resolveExtensions",X),d=i(t,o,"nodePaths",X),u=i(t,o,"mainFields",X),E=i(t,o,"conditions",X),S=i(t,o,"external",X),M=i(t,o,"packages",y),A=i(t,o,"alias",Z),c=i(t,o,"loader",Z),f=i(t,o,"outExtension",Z),v=i(t,o,"publicPath",y),j=i(t,o,"entryNames",y),D=i(t,o,"chunkNames",y),P=i(t,o,"assetNames",y),k=i(t,o,"inject",X),O=i(t,o,"banner",Z),R=i(t,o,"footer",Z),m=i(t,o,"entryPoints",St),F=i(t,o,"absWorkingDir",y),T=i(t,o,"stdin",Z),C=(s=i(t,o,"write",U))!=null?s:l,Q=i(t,o,"allowOverwrite",U),q=i(t,o,"mangleCache",Z);if(o.plugins=true,J(t,o,`in ${e}() call`),$&&a.push(`--sourcemap${$===true?"":`=${$}`}`),I&&a.push("--bundle"),Q&&a.push("--allow-overwrite"),_&&a.push("--splitting"),B&&a.push("--preserve-symlinks"),N&&a.push("--metafile"),L&&a.push(`--outfile=${L}`),W&&a.push(`--outdir=${W}`),z&&a.push(`--outbase=${z}`),x&&a.push(`--tsconfig=${x}`),M&&a.push(`--packages=${M}`),p&&a.push(`--resolve-extensions=${ye(p,"resolve extension")}`),v&&a.push(`--public-path=${v}`),j&&a.push(`--entry-names=${j}`),D&&a.push(`--chunk-names=${D}`),P&&a.push(`--asset-names=${P}`),u&&a.push(`--main-fields=${ye(u,"main field")}`),E&&a.push(`--conditions=${ye(E,"condition")}`),S)for(let b of S)a.push(`--external:${G(b,"external")}`);if(A)for(let b in A){if(b.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${b}`);a.push(`--alias:${b}=${G(A[b],"alias",b)}`);}if(O)for(let b in O){if(b.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${b}`);a.push(`--banner:${b}=${G(O[b],"banner",b)}`);}if(R)for(let b in R){if(b.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${b}`);a.push(`--footer:${b}=${G(R[b],"footer",b)}`);}if(k)for(let b of k)a.push(`--inject:${G(b,"inject")}`);if(c)for(let b in c){if(b.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${b}`);a.push(`--loader:${b}=${G(c[b],"loader",b)}`);}if(f)for(let b in f){if(b.indexOf("=")>=0)throw new Error(`Invalid out extension: ${b}`);a.push(`--out-extension:${b}=${G(f[b],"out extension",b)}`);}if(m)if(Array.isArray(m))for(let b=0,ae=m.length;b<ae;b++){let ee=m[b];if(typeof ee=="object"&&ee!==null){let ie=Object.create(null),oe=i(ee,ie,"in",y),te=i(ee,ie,"out",y);if(J(ee,ie,"in entry point at index "+b),oe===void 0)throw new Error('Missing property "in" for entry point at index '+b);if(te===void 0)throw new Error('Missing property "out" for entry point at index '+b);h.push([te,oe]);}else h.push(["",G(ee,"entry point at index "+b)]);}else for(let b in m)h.push([b,G(m[b],"entry point",b)]);if(T){let b=Object.create(null),ae=i(T,b,"contents",it),ee=i(T,b,"resolveDir",y),ie=i(T,b,"sourcefile",y),oe=i(T,b,"loader",y);J(T,b,'in "stdin" object'),ie&&a.push(`--sourcefile=${ie}`),oe&&a.push(`--loader=${oe}`),ee&&(g=ee),typeof ae=="string"?w=ne(ae):ae instanceof Uint8Array&&(w=ae);}let le=[];if(d)for(let b of d)b+="",le.push(b);return {entries:h,flags:a,write:C,stdinContents:w,stdinResolveDir:g,absWorkingDir:F,nodePaths:le,mangleCache:lt(q)}}function Dt(e,t,r,n){let l=[],s=Object.create(null);Fe(l,t,s,r,n),at(l,t,s);let a=i(t,s,"sourcemap",rt),h=i(t,s,"sourcefile",y),o=i(t,s,"loader",y),w=i(t,s,"banner",y),g=i(t,s,"footer",y),$=i(t,s,"mangleCache",Z);return J(t,s,`in ${e}() call`),a&&l.push(`--sourcemap=${a===true?"external":a}`),h&&l.push(`--sourcefile=${h}`),o&&l.push(`--loader=${o}`),w&&l.push(`--banner=${w}`),g&&l.push(`--footer=${g}`),{flags:l,mangleCache:lt($)}}function ot(e){let t={},r={didClose:false,reason:""},n={},l=0,s=0,a=new Uint8Array(16*1024),h=0,o=x=>{let p=h+x.length;if(p>a.length){let u=new Uint8Array(p*2);u.set(a),a=u;}a.set(x,h),h+=x.length;let d=0;for(;d+4<=h;){let u=et(a,d);if(d+4+u>h)break;d+=4,B(a.subarray(d,d+u)),d+=u;}d>0&&(a.copyWithin(0,d,h),h-=d);},w=x=>{r.didClose=true,x&&(r.reason=": "+(x.message||x));let p="The service was stopped"+r.reason;for(let d in n)n[d](p,null);n={};},g=(x,p,d)=>{if(r.didClose)return d("The service is no longer running"+r.reason,null);let u=l++;n[u]=(E,S)=>{try{d(E,S);}finally{x&&x.unref();}},x&&x.ref(),e.writeToStdin(ze({id:u,isRequest:true,value:p}));},$=(x,p)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);e.writeToStdin(ze({id:x,isRequest:false,value:p}));},I=async(x,p)=>{try{if(p.command==="ping"){$(x,{});return}if(typeof p.key=="number"){let d=t[p.key];if(!d)return;let u=d[p.command];if(u){await u(x,p);return}}throw new Error("Invalid command: "+p.command)}catch(d){let u=[fe(d,e,null,void 0,"")];try{$(x,{errors:u});}catch{}}},_=true,B=x=>{if(_){_=false;let d=String.fromCharCode(...x);if(d!=="0.27.2")throw new Error(`Cannot start service: Host version "0.27.2" does not match binary version ${V(d)}`);return}let p=Et(x);if(p.isRequest)I(p.id,p.value);else {let d=n[p.id];delete n[p.id],p.value.error?d(p.value.error,{}):d(null,p.value);}};return {readFromStdout:o,afterClose:w,service:{buildOrContext:({callName:x,refs:p,options:d,isTTY:u,defaultWD:E,callback:S})=>{let M=0,A=s++,c={},f={ref(){++M===1&&p&&p.ref();},unref(){--M===0&&(delete t[A],p&&p.unref());}};t[A]=c,f.ref(),Ct(x,A,g,$,f,e,c,d,u,E,(v,j)=>{try{S(v,j);}finally{f.unref();}});},transform:({callName:x,refs:p,input:d,options:u,isTTY:E,fs:S,callback:M})=>{let A=st(),c=f=>{try{if(typeof d!="string"&&!(d instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:v,mangleCache:j}=Dt(x,u,E,Je),D={command:"transform",flags:v,inputFS:f!==null,input:f!==null?ne(f):typeof d=="string"?ne(d):d};j&&(D.mangleCache=j),g(p,D,(P,k)=>{if(P)return M(new Error(P),null);let O=ve(k.errors,A),R=ve(k.warnings,A),m=1,F=()=>{if(--m===0){let T={warnings:R,code:k.code,map:k.map,mangleCache:void 0,legalComments:void 0};"legalComments"in k&&(T.legalComments=k?.legalComments),k.mangleCache&&(T.mangleCache=k?.mangleCache),M(null,T);}};if(O.length>0)return M(Ee("Transform failed",O,R),null);k.codeFS&&(m++,S.readFile(k.code,(T,C)=>{T!==null?M(T,null):(k.code=C,F());})),k.mapFS&&(m++,S.readFile(k.map,(T,C)=>{T!==null?M(T,null):(k.map=C,F());})),F();});}catch(v){let j=[];try{Fe(j,u,{},E,Je);}catch{}let D=fe(v,e,A,void 0,"");g(p,{command:"error",flags:j,error:D},()=>{D.detail=A.load(D.detail),M(Ee("Transform failed",[D],[]),null);});}};if((typeof d=="string"||d instanceof Uint8Array)&&d.length>1024*1024){let f=c;c=()=>S.writeFile(d,f);}c(null);},formatMessages:({callName:x,refs:p,messages:d,options:u,callback:E})=>{if(!u)throw new Error(`Missing second argument in ${x}() call`);let S={},M=i(u,S,"kind",y),A=i(u,S,"color",U),c=i(u,S,"terminalWidth",de);if(J(u,S,`in ${x}() call`),M===void 0)throw new Error(`Missing "kind" in ${x}() call`);if(M!=="error"&&M!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${x}() call`);let f={command:"format-msgs",messages:ue(d,"messages",null,"",c),isWarning:M==="warning"};A!==void 0&&(f.color=A),c!==void 0&&(f.terminalWidth=c),g(p,f,(v,j)=>{if(v)return E(new Error(v),null);E(null,j.messages);});},analyzeMetafile:({callName:x,refs:p,metafile:d,options:u,callback:E})=>{u===void 0&&(u={});let S={},M=i(u,S,"color",U),A=i(u,S,"verbose",U);J(u,S,`in ${x}() call`);let c={command:"analyze-metafile",metafile:d};M!==void 0&&(c.color=M),A!==void 0&&(c.verbose=A),g(p,c,(f,v)=>{if(f)return E(new Error(f),null);E(null,v.result);});}}}}function Ct(e,t,r,n,l,s,a,h,o,w,g){let $=st(),I=e==="context",_=(L,W)=>{let z=[];try{Fe(z,h,{},o,qe);}catch{}let x=fe(L,s,$,void 0,W);r(l,{command:"error",flags:z,error:x},()=>{x.detail=$.load(x.detail),g(Ee(I?"Context failed":"Build failed",[x],[]),null);});},B;if(typeof h=="object"){let L=h.plugins;if(L!==void 0){if(!Array.isArray(L))return _(new Error('"plugins" must be an array'),"");B=L;}}if(B&&B.length>0){if(s.isSync)return _(new Error("Cannot use plugins in synchronous API calls"),"");Lt(t,r,n,l,s,a,h,B,$).then(L=>{if(!L.ok)return _(L.error,L.pluginName);try{N(L.requestPlugins,L.runOnEndCallbacks,L.scheduleOnDisposeCallbacks);}catch(W){_(W,"");}},L=>_(L,""));return}try{N(null,(L,W)=>W([],[]),()=>{});}catch(L){_(L,"");}function N(L,W,z){let x=s.hasFS,{entries:p,flags:d,write:u,stdinContents:E,stdinResolveDir:S,absWorkingDir:M,nodePaths:A,mangleCache:c}=Mt(e,h,o,qe,x);if(u&&!s.hasFS)throw new Error('The "write" option is unavailable in this environment');let f={command:"build",key:t,entries:p,flags:d,write:u,stdinContents:E,stdinResolveDir:S,absWorkingDir:M||w,nodePaths:A,context:I};L&&(f.plugins=L),c&&(f.mangleCache=c);let v=(P,k)=>{let O={errors:ve(P.errors,$),warnings:ve(P.warnings,$),outputFiles:void 0,metafile:void 0,mangleCache:void 0},R=O.errors.slice(),m=O.warnings.slice();P.outputFiles&&(O.outputFiles=P.outputFiles.map(Ft)),P.metafile&&(O.metafile=JSON.parse(P.metafile)),P.mangleCache&&(O.mangleCache=P.mangleCache),P.writeToStdout!==void 0&&console.log(be(P.writeToStdout).replace(/\n$/,"")),W(O,(F,T)=>{if(R.length>0||F.length>0){let C=Ee("Build failed",R.concat(F),m.concat(T));return k(C,null,F,T)}k(null,O,F,T);});},j,D;I&&(a["on-end"]=(P,k)=>new Promise(O=>{v(k,(R,m,F,T)=>{let C={errors:F,warnings:T};D&&D(R,m),j=void 0,D=void 0,n(P,C),O();});})),r(l,f,(P,k)=>{if(P)return g(new Error(P),null);if(!I)return v(k,(m,F)=>(z(),g(m,F)));if(k.errors.length>0)return g(Ee("Context failed",k.errors,k.warnings),null);let O=false,R={rebuild:()=>(j||(j=new Promise((m,F)=>{let T;D=(Q,q)=>{T||(T=()=>Q?F(Q):m(q));};let C=()=>{r(l,{command:"rebuild",key:t},(q,le)=>{q?F(new Error(q)):T?T():C();});};C();})),j),watch:(m={})=>new Promise((F,T)=>{if(!s.hasFS)throw new Error('Cannot use the "watch" API in this environment');let C={},Q=i(m,C,"delay",de);J(m,C,"in watch() call");let q={command:"watch",key:t};Q&&(q.delay=Q),r(l,q,le=>{le?T(new Error(le)):F(void 0);});}),serve:(m={})=>new Promise((F,T)=>{if(!s.hasFS)throw new Error('Cannot use the "serve" API in this environment');let C={},Q=i(m,C,"port",kt),q=i(m,C,"host",y),le=i(m,C,"servedir",y),b=i(m,C,"keyfile",y),ae=i(m,C,"certfile",y),ee=i(m,C,"fallback",y),ie=i(m,C,"cors",Z),oe=i(m,C,"onRequest",tt);J(m,C,"in serve() call");let te={command:"serve",key:t,onRequest:!!oe};if(Q!==void 0&&(te.port=Q),q!==void 0&&(te.host=q),le!==void 0&&(te.servedir=le),b!==void 0&&(te.keyfile=b),ae!==void 0&&(te.certfile=ae),ee!==void 0&&(te.fallback=ee),ie){let xe={},pe=i(ie,xe,"origin",nt);J(ie,xe,'on "cors" object'),Array.isArray(pe)?te.corsOrigin=pe:pe!==void 0&&(te.corsOrigin=[pe]);}r(l,te,(xe,pe)=>{if(xe)return T(new Error(xe));oe&&(a["serve-request"]=(mt,gt)=>{oe(gt.args),n(mt,{});}),F(pe);});}),cancel:()=>new Promise(m=>{if(O)return m();r(l,{command:"cancel",key:t},()=>{m();});}),dispose:()=>new Promise(m=>{if(O)return m();O=true,r(l,{command:"dispose",key:t},()=>{m(),z(),l.unref();});})};l.ref(),g(null,R);});}}var Lt=async(e,t,r,n,l,s,a,h,o)=>{let w=[],g=[],$={},I={},_=[],B=0,N=0,L=[],W=false;h=[...h];for(let p of h){let d={};if(typeof p!="object")throw new Error(`Plugin at index ${N} must be an object`);let u=i(p,d,"name",y);if(typeof u!="string"||u==="")throw new Error(`Plugin at index ${N} is missing a name`);try{let E=i(p,d,"setup",tt);if(typeof E!="function")throw new Error("Plugin is missing a setup function");J(p,d,`on plugin ${V(u)}`);let S={name:u,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};N++;let A=E({initialOptions:a,resolve:(c,f={})=>{if(!W)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof c!="string")throw new Error("The path to resolve must be a string");let v=Object.create(null),j=i(f,v,"pluginName",y),D=i(f,v,"importer",y),P=i(f,v,"namespace",y),k=i(f,v,"resolveDir",y),O=i(f,v,"kind",y),R=i(f,v,"pluginData",Oe),m=i(f,v,"with",Z);return J(f,v,"in resolve() call"),new Promise((F,T)=>{let C={command:"resolve",path:c,key:e,pluginName:u};if(j!=null&&(C.pluginName=j),D!=null&&(C.importer=D),P!=null&&(C.namespace=P),k!=null&&(C.resolveDir=k),O!=null)C.kind=O;else throw new Error('Must specify "kind" when calling "resolve"');R!=null&&(C.pluginData=o.store(R)),m!=null&&(C.with=Tt(m,"with")),t(n,C,(Q,q)=>{Q!==null?T(new Error(Q)):F({errors:ve(q.errors,o),warnings:ve(q.warnings,o),path:q.path,external:q.external,sideEffects:q.sideEffects,namespace:q.namespace,suffix:q.suffix,pluginData:o.load(q.pluginData)});});})},onStart(c){let f='This error came from the "onStart" callback registered here:',v=Pe(new Error(f),l,"onStart");w.push({name:u,callback:c,note:v}),S.onStart=!0;},onEnd(c){let f='This error came from the "onEnd" callback registered here:',v=Pe(new Error(f),l,"onEnd");g.push({name:u,callback:c,note:v}),S.onEnd=!0;},onResolve(c,f){let v='This error came from the "onResolve" callback registered here:',j=Pe(new Error(v),l,"onResolve"),D={},P=i(c,D,"filter",Me),k=i(c,D,"namespace",y);if(J(c,D,`in onResolve() call for plugin ${V(u)}`),P==null)throw new Error("onResolve() call is missing a filter");let O=B++;$[O]={name:u,callback:f,note:j},S.onResolve.push({id:O,filter:De(P),namespace:k||""});},onLoad(c,f){let v='This error came from the "onLoad" callback registered here:',j=Pe(new Error(v),l,"onLoad"),D={},P=i(c,D,"filter",Me),k=i(c,D,"namespace",y);if(J(c,D,`in onLoad() call for plugin ${V(u)}`),P==null)throw new Error("onLoad() call is missing a filter");let O=B++;I[O]={name:u,callback:f,note:j},S.onLoad.push({id:O,filter:De(P),namespace:k||""});},onDispose(c){_.push(c);},esbuild:l.esbuild});A&&await A,L.push(S);}catch(E){return {ok:false,error:E,pluginName:u}}}s["on-start"]=async(p,d)=>{o.clear();let u={errors:[],warnings:[]};await Promise.all(w.map(async({name:E,callback:S,note:M})=>{try{let A=await S();if(A!=null){if(typeof A!="object")throw new Error(`Expected onStart() callback in plugin ${V(E)} to return an object`);let c={},f=i(A,c,"errors",se),v=i(A,c,"warnings",se);J(A,c,`from onStart() callback in plugin ${V(E)}`),f!=null&&u.errors.push(...ue(f,"errors",o,E,void 0)),v!=null&&u.warnings.push(...ue(v,"warnings",o,E,void 0));}}catch(A){u.errors.push(fe(A,l,o,M&&M(),E));}})),r(p,u);},s["on-resolve"]=async(p,d)=>{let u={},E="",S,M;for(let A of d.ids)try{({name:E,callback:S,note:M}=$[A]);let c=await S({path:d.path,importer:d.importer,namespace:d.namespace,resolveDir:d.resolveDir,kind:d.kind,pluginData:o.load(d.pluginData),with:d.with});if(c!=null){if(typeof c!="object")throw new Error(`Expected onResolve() callback in plugin ${V(E)} to return an object`);let f={},v=i(c,f,"pluginName",y),j=i(c,f,"path",y),D=i(c,f,"namespace",y),P=i(c,f,"suffix",y),k=i(c,f,"external",U),O=i(c,f,"sideEffects",U),R=i(c,f,"pluginData",Oe),m=i(c,f,"errors",se),F=i(c,f,"warnings",se),T=i(c,f,"watchFiles",X),C=i(c,f,"watchDirs",X);J(c,f,`from onResolve() callback in plugin ${V(E)}`),u.id=A,v!=null&&(u.pluginName=v),j!=null&&(u.path=j),D!=null&&(u.namespace=D),P!=null&&(u.suffix=P),k!=null&&(u.external=k),O!=null&&(u.sideEffects=O),R!=null&&(u.pluginData=o.store(R)),m!=null&&(u.errors=ue(m,"errors",o,E,void 0)),F!=null&&(u.warnings=ue(F,"warnings",o,E,void 0)),T!=null&&(u.watchFiles=je(T,"watchFiles")),C!=null&&(u.watchDirs=je(C,"watchDirs"));break}}catch(c){u={id:A,errors:[fe(c,l,o,M&&M(),E)]};break}r(p,u);},s["on-load"]=async(p,d)=>{let u={},E="",S,M;for(let A of d.ids)try{({name:E,callback:S,note:M}=I[A]);let c=await S({path:d.path,namespace:d.namespace,suffix:d.suffix,pluginData:o.load(d.pluginData),with:d.with});if(c!=null){if(typeof c!="object")throw new Error(`Expected onLoad() callback in plugin ${V(E)} to return an object`);let f={},v=i(c,f,"pluginName",y),j=i(c,f,"contents",it),D=i(c,f,"resolveDir",y),P=i(c,f,"pluginData",Oe),k=i(c,f,"loader",y),O=i(c,f,"errors",se),R=i(c,f,"warnings",se),m=i(c,f,"watchFiles",X),F=i(c,f,"watchDirs",X);J(c,f,`from onLoad() callback in plugin ${V(E)}`),u.id=A,v!=null&&(u.pluginName=v),j instanceof Uint8Array?u.contents=j:j!=null&&(u.contents=ne(j)),D!=null&&(u.resolveDir=D),P!=null&&(u.pluginData=o.store(P)),k!=null&&(u.loader=k),O!=null&&(u.errors=ue(O,"errors",o,E,void 0)),R!=null&&(u.warnings=ue(R,"warnings",o,E,void 0)),m!=null&&(u.watchFiles=je(m,"watchFiles")),F!=null&&(u.watchDirs=je(F,"watchDirs"));break}}catch(c){u={id:A,errors:[fe(c,l,o,M&&M(),E)]};break}r(p,u);};let z=(p,d)=>d([],[]);g.length>0&&(z=(p,d)=>{(async()=>{let u=[],E=[];for(let{name:S,callback:M,note:A}of g){let c,f;try{let v=await M(p);if(v!=null){if(typeof v!="object")throw new Error(`Expected onEnd() callback in plugin ${V(S)} to return an object`);let j={},D=i(v,j,"errors",se),P=i(v,j,"warnings",se);J(v,j,`from onEnd() callback in plugin ${V(S)}`),D!=null&&(c=ue(D,"errors",o,S,void 0)),P!=null&&(f=ue(P,"warnings",o,S,void 0));}}catch(v){c=[fe(v,l,o,A&&A(),S)];}if(c){u.push(...c);try{p.errors.push(...c);}catch{}}if(f){E.push(...f);try{p.warnings.push(...f);}catch{}}}d(u,E);})();});let x=()=>{for(let p of _)setTimeout(()=>p(),0);};return W=true,{ok:true,requestPlugins:L,runOnEndCallbacks:z,scheduleOnDisposeCallbacks:x}};function st(){let e=new Map,t=0;return {clear(){e.clear();},load(r){return e.get(r)},store(r){if(r===void 0)return -1;let n=t++;return e.set(n,r),n}}}function Pe(e,t,r){let n,l=false;return ()=>{if(l)return n;l=true;try{let s=(e.stack+"").split(`
7
- `);s.splice(1,1);let a=ut(t,s,r);if(a)return n={text:e.message,location:a},n}catch{}}}function fe(e,t,r,n,l){let s="Internal error",a=null;try{s=(e&&e.message||e)+"";}catch{}try{a=ut(t,(e.stack+"").split(`
8
- `),"");}catch{}return {id:"",pluginName:l,text:s,location:a,notes:n?[n]:[],detail:r?r.store(e):-1}}function ut(e,t,r){let n=" at ";if(e.readFileSync&&!t[0].startsWith(n)&&t[1].startsWith(n))for(let l=1;l<t.length;l++){let s=t[l];if(s.startsWith(n))for(s=s.slice(n.length);;){let a=/^(?:new |async )?\S+ \((.*)\)$/.exec(s);if(a){s=a[1];continue}if(a=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(s),a){s=a[1];continue}if(a=/^(\S+):(\d+):(\d+)$/.exec(s),a){let h;try{h=e.readFileSync(a[1],"utf8");}catch{break}let o=h.split(/\r\n|\r|\n|\u2028|\u2029/)[+a[2]-1]||"",w=+a[3]-1,g=o.slice(w,w+r.length)===r?r.length:0;return {file:a[1],namespace:"file",line:+a[2],column:ne(o.slice(0,w)).length,length:ne(o.slice(w,w+g)).length,lineText:o+`
9
- `+t.slice(1).join(`
10
- `),suggestion:""}}break}}return null}function Ee(e,t,r){let n=5;e+=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,n+1).map((s,a)=>{if(a===n)return `
11
- ...`;if(!s.location)return `
12
- error: ${s.text}`;let{file:h,line:o,column:w}=s.location,g=s.pluginName?`[plugin: ${s.pluginName}] `:"";return `
13
- ${h}:${o}:${w}: ERROR: ${g}${s.text}`}).join("");let l=new Error(e);for(let[s,a]of [["errors",t],["warnings",r]])Object.defineProperty(l,s,{configurable:true,enumerable:true,get:()=>a,set:h=>Object.defineProperty(l,s,{configurable:true,enumerable:true,value:h})});return l}function ve(e,t){for(let r of e)r.detail=t.load(r.detail);return e}function Ye(e,t,r){if(e==null)return null;let n={},l=i(e,n,"file",y),s=i(e,n,"namespace",y),a=i(e,n,"line",de),h=i(e,n,"column",de),o=i(e,n,"length",de),w=i(e,n,"lineText",y),g=i(e,n,"suggestion",y);if(J(e,n,t),w){let $=w.slice(0,(h&&h>0?h:0)+(o&&o>0?o:0)+(r&&r>0?r:80));!/[\x7F-\uFFFF]/.test($)&&!/\n/.test(w)&&(w=$);}return {file:l||"",namespace:s||"",line:a||0,column:h||0,length:o||0,lineText:w||"",suggestion:g||""}}function ue(e,t,r,n,l){let s=[],a=0;for(let h of e){let o={},w=i(h,o,"id",y),g=i(h,o,"pluginName",y),$=i(h,o,"text",y),I=i(h,o,"location",Ve),_=i(h,o,"notes",se),B=i(h,o,"detail",Oe),N=`in element ${a} of "${t}"`;J(h,o,N);let L=[];if(_)for(let W of _){let z={},x=i(W,z,"text",y),p=i(W,z,"location",Ve);J(W,z,N),L.push({text:x||"",location:Ye(p,N,l)});}s.push({id:w||"",pluginName:g||n,text:$||"",location:Ye(I,N,l),notes:L,detail:r?r.store(B):-1}),a++;}return s}function je(e,t){let r=[];for(let n of e){if(typeof n!="string")throw new Error(`${V(t)} must be an array of strings`);r.push(n);}return r}function Tt(e,t){let r=Object.create(null);for(let n in e){let l=e[n];if(typeof l!="string")throw new Error(`key ${V(n)} in object ${V(t)} must be a string`);r[n]=l;}return r}function Ft({path:e,contents:t,hash:r}){let n=null;return {path:e,contents:t,hash:r,get text(){let l=this.contents;return (n===null||l!==t)&&(t=l,n=be(l)),n}}}function De(e){let t=e.source;return e.flags&&(t=`(?${e.flags})${t}`),t}var ce=a("fs"),He=a("os"),re=a("path"),we=process.env.ESBUILD_BINARY_PATH||we,_t=e=>!!e&&e!=="/usr/bin/esbuild",Ke="@esbuild/darwin-arm64",Qe="@esbuild/darwin-x64",Ce={"win32 arm64 LE":"@esbuild/win32-arm64","win32 ia32 LE":"@esbuild/win32-ia32","win32 x64 LE":"@esbuild/win32-x64"},Le={"aix ppc64 BE":"@esbuild/aix-ppc64","android arm64 LE":"@esbuild/android-arm64","darwin arm64 LE":"@esbuild/darwin-arm64","darwin x64 LE":"@esbuild/darwin-x64","freebsd arm64 LE":"@esbuild/freebsd-arm64","freebsd x64 LE":"@esbuild/freebsd-x64","linux arm LE":"@esbuild/linux-arm","linux arm64 LE":"@esbuild/linux-arm64","linux ia32 LE":"@esbuild/linux-ia32","linux mips64el LE":"@esbuild/linux-mips64el","linux ppc64 LE":"@esbuild/linux-ppc64","linux riscv64 LE":"@esbuild/linux-riscv64","linux s390x BE":"@esbuild/linux-s390x","linux x64 LE":"@esbuild/linux-x64","linux loong64 LE":"@esbuild/linux-loong64","netbsd arm64 LE":"@esbuild/netbsd-arm64","netbsd x64 LE":"@esbuild/netbsd-x64","openbsd arm64 LE":"@esbuild/openbsd-arm64","openbsd x64 LE":"@esbuild/openbsd-x64","sunos x64 LE":"@esbuild/sunos-x64"},Ge={"android arm LE":"@esbuild/android-arm","android x64 LE":"@esbuild/android-x64","openharmony arm64 LE":"@esbuild/openharmony-arm64"};function Bt(){let e,t,r=false,n=`${process.platform} ${He.arch()} ${He.endianness()}`;if(n in Ce)e=Ce[n],t="esbuild.exe";else if(n in Le)e=Le[n],t="bin/esbuild";else if(n in Ge)e=Ge[n],t="bin/esbuild",r=true;else throw new Error(`Unsupported platform: ${n}`);return {pkg:e,subpath:t,isWASM:r}}function It(){let e=a.resolve("esbuild"),t=re.dirname(re.dirname(re.dirname(e)));if(re.basename(t)==="node_modules"){for(let r in Le)try{let n=Le[r];if(ce.existsSync(re.join(t,n)))return n}catch{}for(let r in Ce)try{let n=Ce[r];if(ce.existsSync(re.join(t,n)))return n}catch{}}return null}function Nt(e,t){let r=re.dirname(a.resolve("esbuild"));return re.join(r,`downloaded-${e.replace("/","-")}-${re.basename(t)}`)}function Rt(){if(_t(we))if(!ce.existsSync(we))console.warn(`[esbuild] Ignoring bad configuration: ESBUILD_BINARY_PATH=${we}`);else return {binPath:we,isWASM:false};let{pkg:e,subpath:t,isWASM:r}=Bt(),n;try{n=a.resolve(`${e}/${t}`);}catch(l){if(n=Nt(e,t),!ce.existsSync(n)){try{a.resolve(e);}catch{let s=It();if(s){let a=`
14
- Specifically the "${s}" package is present but this platform
15
- needs the "${e}" package instead. People often get into this
16
- situation by installing esbuild on Windows or macOS and copying "node_modules"
17
- into a Docker image that runs Linux, or by copying "node_modules" between
18
- Windows and WSL environments.
19
-
20
- If you are installing with npm, you can try not copying the "node_modules"
21
- directory when you copy the files over, and running "npm ci" or "npm install"
22
- on the destination platform after the copy. Or you could consider using yarn
23
- instead of npm which has built-in support for installing a package on multiple
24
- platforms simultaneously.
25
-
26
- If you are installing with yarn, you can try listing both this platform and the
27
- other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
28
- feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
29
- Keep in mind that this means multiple copies of esbuild will be present.
30
- `;throw (e===Qe&&s===Ke||e===Ke&&s===Qe)&&(a=`
31
- Specifically the "${s}" package is present but this platform
32
- needs the "${e}" package instead. People often get into this
33
- situation by installing esbuild with npm running inside of Rosetta 2 and then
34
- trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
35
- 2 is Apple's on-the-fly x86_64-to-arm64 translation service).
36
-
37
- If you are installing with npm, you can try ensuring that both npm and node are
38
- not running under Rosetta 2 and then reinstalling esbuild. This likely involves
39
- changing how you installed npm and/or node. For example, installing node with
40
- the universal installer here should work: https://nodejs.org/en/download/. Or
41
- you could consider using yarn instead of npm which has built-in support for
42
- installing a package on multiple platforms simultaneously.
43
-
44
- If you are installing with yarn, you can try listing both "arm64" and "x64"
45
- in your ".yarnrc.yml" file using the "supportedArchitectures" feature:
46
- https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
47
- Keep in mind that this means multiple copies of esbuild will be present.
48
- `),new Error(`
49
- You installed esbuild for another platform than the one you're currently using.
50
- This won't work because esbuild is written with native code and needs to
51
- install a platform-specific binary executable.
52
- ${a}
53
- Another alternative is to use the "esbuild-wasm" package instead, which works
54
- the same way on all platforms. But it comes with a heavy performance cost and
55
- can sometimes be 10x slower than the "esbuild" package, so you may also not
56
- want to do that.
57
- `)}throw new Error(`The package "${e}" could not be found, and is needed by esbuild.
58
-
59
- If you are installing esbuild with npm, make sure that you don't specify the
60
- "--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
61
- of "package.json" is used by esbuild to install the correct binary executable
62
- for your current platform.`)}throw l}}if(/\.zip\//.test(n)){let l;try{l=a("pnpapi");}catch{}if(l){let s=l.getPackageInformation(l.topLevel).packageLocation,a=re.join(s,"node_modules",".cache","esbuild",`pnpapi-${e.replace("/","-")}-0.27.2-${re.basename(t)}`);return ce.existsSync(a)||(ce.mkdirSync(re.dirname(a),{recursive:true}),ce.copyFileSync(n,a),ce.chmodSync(a,493)),{binPath:a,isWASM:r}}}return {binPath:n,isWASM:r}}var ct=a("child_process"),Ut=a("crypto"),Re=a("path"),he=a("fs"),Wt=a("os"),zt=a("tty"),H;if(process.env.ESBUILD_WORKER_THREADS!=="0"){try{H=a("worker_threads");}catch{}let[e,t]=process.versions.node.split(".");(+e<12||+e==12&&+t<17||+e==13&&+t<13)&&(H=void 0);}var Xe,Ae=((Xe=H?.workerData)==null?void 0:Xe.esbuildVersion)==="0.27.2",ft=()=>{if(!we&&(Re.basename(__filename)!=="main.js"||Re.basename(__dirname)!=="lib"))throw new Error(`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
63
-
64
- More information: The file containing the code for esbuild's JavaScript API (${__filename}) does not appear to be inside the esbuild package on the file system, which usually means that the esbuild package was bundled into another file. This is problematic because the API needs to run a binary executable inside the esbuild package which is located using a relative path from the API code to the executable. If the esbuild package is bundled, the relative path will be incorrect and the executable won't be found.`);{let{binPath:e,isWASM:t}=Rt();return t?["node",[e]]:[e,[]]}},ke=()=>zt.isatty(2),qt={readFile(e,t){try{let r=he.readFileSync(e,"utf8");try{he.unlinkSync(e);}catch{}t(null,r);}catch(r){t(r,null);}},writeFile(e,t){try{let r=dt();he.writeFileSync(r,e),t(r);}catch{t(null);}}},Jt={readFile(e,t){try{he.readFile(e,"utf8",(r,n)=>{try{he.unlink(e,()=>t(r,n));}catch{t(r,n);}});}catch(r){t(r,null);}},writeFile(e,t){try{let r=dt();he.writeFile(r,e,n=>t(n!==null?null:r));}catch{t(null);}}},Vt="0.27.2",Yt=e=>ge().build(e),Ht=e=>ge().context(e),Kt=(e,t)=>ge().transform(e,t),Qt=(e,t)=>ge().formatMessages(e,t),Gt=(e,t)=>ge().analyzeMetafile(e,t),Xt=e=>{if(H&&!Ae)return K||(K=Be(H)),K.buildSync(e);let t;return _e(r=>r.buildOrContext({callName:"buildSync",refs:null,options:e,isTTY:ke(),defaultWD:me,callback:(n,l)=>{if(n)throw n;t=l;}})),t},Zt=(e,t)=>{if(H&&!Ae)return K||(K=Be(H)),K.transformSync(e,t);let r;return _e(n=>n.transform({callName:"transformSync",refs:null,input:e,options:t||{},isTTY:ke(),fs:qt,callback:(l,s)=>{if(l)throw l;r=s;}})),r},er=(e,t)=>{if(H&&!Ae)return K||(K=Be(H)),K.formatMessagesSync(e,t);let r;return _e(n=>n.formatMessages({callName:"formatMessagesSync",refs:null,messages:e,options:t,callback:(l,s)=>{if(l)throw l;r=s;}})),r},tr=(e,t)=>{if(H&&!Ae)return K||(K=Be(H)),K.analyzeMetafileSync(e,t);let r;return _e(n=>n.analyzeMetafile({callName:"analyzeMetafileSync",refs:null,metafile:typeof e=="string"?e:JSON.stringify(e),options:t,callback:(l,s)=>{if(l)throw l;r=s;}})),r},rr=()=>(Te&&Te(),K&&K.stop(),Promise.resolve()),Ue=false,nr=e=>{if(e=Ot(e||{}),e.wasmURL)throw new Error('The "wasmURL" option only works in the browser');if(e.wasmModule)throw new Error('The "wasmModule" option only works in the browser');if(e.worker)throw new Error('The "worker" option only works in the browser');if(Ue)throw new Error('Cannot call "initialize" more than once');return ge(),Ue=true,Promise.resolve()},me=process.cwd(),$e,Te,ge=()=>{if($e)return $e;let[e,t]=ft(),r=ct.spawn(e,t.concat("--service=0.27.2","--ping"),{windowsHide:true,stdio:["pipe","pipe","inherit"],cwd:me}),{readFromStdout:n,afterClose:l,service:s}=ot({writeToStdin(g){r.stdin.write(g,$=>{$&&l($);});},readFileSync:he.readFileSync,isSync:false,hasFS:true,esbuild:Se});r.stdin.on("error",l),r.on("error",l);let a=r.stdin,h=r.stdout;h.on("data",n),h.on("end",l),Te=()=>{a.destroy(),h.destroy(),r.kill(),Ue=false,$e=void 0,Te=void 0;};let o=0;r.unref(),a.unref&&a.unref(),h.unref&&h.unref();let w={ref(){++o===1&&r.ref();},unref(){--o===0&&r.unref();}};return $e={build:g=>new Promise(($,I)=>{s.buildOrContext({callName:"build",refs:w,options:g,isTTY:ke(),defaultWD:me,callback:(_,B)=>_?I(_):$(B)});}),context:g=>new Promise(($,I)=>s.buildOrContext({callName:"context",refs:w,options:g,isTTY:ke(),defaultWD:me,callback:(_,B)=>_?I(_):$(B)})),transform:(g,$)=>new Promise((I,_)=>s.transform({callName:"transform",refs:w,input:g,options:$||{},isTTY:ke(),fs:Jt,callback:(B,N)=>B?_(B):I(N)})),formatMessages:(g,$)=>new Promise((I,_)=>s.formatMessages({callName:"formatMessages",refs:w,messages:g,options:$,callback:(B,N)=>B?_(B):I(N)})),analyzeMetafile:(g,$)=>new Promise((I,_)=>s.analyzeMetafile({callName:"analyzeMetafile",refs:w,metafile:typeof g=="string"?g:JSON.stringify(g),options:$,callback:(B,N)=>B?_(B):I(N)}))},$e},_e=e=>{let[t,r]=ft(),n=new Uint8Array,{readFromStdout:l,afterClose:s,service:a}=ot({writeToStdin(o){if(n.length!==0)throw new Error("Must run at most one command");n=o;},isSync:true,hasFS:true,esbuild:Se});e(a);let h=ct.execFileSync(t,r.concat("--service=0.27.2"),{cwd:me,windowsHide:true,input:n,maxBuffer:+process.env.ESBUILD_MAX_BUFFER||16*1024*1024});l(h),s(null);},dt=()=>Re.join(Wt.tmpdir(),`esbuild-${Ut.randomBytes(32).toString("hex")}`),K=null,Be=e=>{let{port1:t,port2:r}=new e.MessageChannel,n=new e.Worker(__filename,{workerData:{workerPort:r,defaultWD:me,esbuildVersion:"0.27.2"},transferList:[r],execArgv:[]}),l=0,s=w=>{let g=new Error(`Build failed with 1 error:
65
- error: ${w}`),$=[{id:"",pluginName:"",text:w,location:null,notes:[],detail:void 0}];return g.errors=$,g.warnings=[],g},a=w=>{if(!w)return;let g=w.plugins;if(g&&g.length>0)throw s("Cannot use plugins in synchronous API calls")},h=(w,g)=>{for(let $ in g)w[$]=g[$];},o=(w,g)=>{let $=l++,I=new SharedArrayBuffer(8),_=new Int32Array(I),B={sharedBuffer:I,id:$,command:w,args:g};n.postMessage(B);let N=Atomics.wait(_,0,0);if(N!=="ok"&&N!=="not-equal")throw new Error("Internal error: Atomics.wait() failed: "+N);let{message:{id:L,resolve:W,reject:z,properties:x}}=e.receiveMessageOnPort(t);if($!==L)throw new Error(`Internal error: Expected id ${$} but got id ${L}`);if(z)throw h(z,x),z;return W};return n.unref(),{buildSync(w){return a(w),o("build",[w])},transformSync(w,g){return o("transform",[w,g])},formatMessagesSync(w,g){return o("formatMessages",[w,g])},analyzeMetafileSync(w,g){return o("analyzeMetafile",[w,g])},stop(){n.terminate(),K=null;}}},ir=()=>{let e=H.workerData.workerPort,t=H.parentPort,r=n=>{let l={};if(n&&typeof n=="object")for(let s in n)l[s]=n[s];return l};try{let n=ge();me=H.workerData.defaultWD,t.on("message",l=>{(async()=>{let{sharedBuffer:s,id:a,command:h,args:o}=l,w=new Int32Array(s);try{switch(h){case "build":e.postMessage({id:a,resolve:await n.build(o[0])});break;case "transform":e.postMessage({id:a,resolve:await n.transform(o[0],o[1])});break;case "formatMessages":e.postMessage({id:a,resolve:await n.formatMessages(o[0],o[1])});break;case "analyzeMetafile":e.postMessage({id:a,resolve:await n.analyzeMetafile(o[0],o[1])});break;default:throw new Error(`Invalid command: ${h}`)}}catch(g){e.postMessage({id:a,reject:g,properties:r(g)});}Atomics.add(w,0,1),Atomics.notify(w,0,1/0);})();});}catch(n){t.on("message",l=>{let{sharedBuffer:s,id:a}=l,h=new Int32Array(s);e.postMessage({id:a,reject:n,properties:r(n)}),Atomics.add(h,0,1),Atomics.notify(h,0,1/0);});}};Ae&&ir();var lr=Se;});var mainEPE35NMW = ar();export{mainEPE35NMW as default};
@@ -1 +0,0 @@
1
- export{d as cleanupNavigation,c as initializeNavigation,b as navigate,a as registerAppInstance}from'./chunk-EQ5S5GU4.js';import'./chunk-NL44ANML.js';import'./chunk-D2JSJKCW.js';import'./chunk-ILZCMHZM.js';import'./chunk-HGMOQ3I7.js';import'./chunk-BP2CKUO6.js';import'./chunk-37RC6ZT3.js';import'./chunk-62D2TNHX.js';
@@ -1 +0,0 @@
1
- export{c as _lockRouteRegistrationForTests,d as _unlockRouteRegistrationForTests,i as clearRoutes,k as getLoadedNamespaces,g as getNamespaceRoutes,f as getRoutes,b as lockRouteRegistration,j as registerRoute,l as resolveRoute,e as route,a as setServerLocation,h as unloadNamespace}from'./chunk-NL44ANML.js';import'./chunk-D2JSJKCW.js';import'./chunk-ILZCMHZM.js';import'./chunk-HGMOQ3I7.js';import'./chunk-BP2CKUO6.js';import'./chunk-37RC6ZT3.js';import'./chunk-62D2TNHX.js';
@@ -1,17 +0,0 @@
1
- import { Plugin } from 'vite';
2
-
3
- /**
4
- * Vite plugin for Askr
5
- *
6
- * Provides sensible defaults so Vite "just works" with Askr without extra config:
7
- * - Configures esbuild JSX injection and `optimizeDeps.include` so the runtime is available
8
- */
9
-
10
- interface AskrVitePluginOptions {
11
- /** Enable the built-in JSX transform that rewrites JSX to Askr's automatic runtime. */
12
- transformJsx?: boolean;
13
- }
14
- declare function askrVitePlugin(opts?: AskrVitePluginOptions): Plugin;
15
- declare const askr: typeof askrVitePlugin;
16
-
17
- export { type AskrVitePluginOptions, askr, askrVitePlugin, askrVitePlugin as default };