@hot-updater/console 0.30.2 → 0.30.3

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.
@@ -1,12 +1,12 @@
1
1
  {
2
- "date": "2026-04-17T09:42:39.942Z",
2
+ "date": "2026-04-23T15:05:17.862Z",
3
3
  "preset": "node-server",
4
4
  "framework": {
5
5
  "name": "nitro",
6
- "version": "3.0.260311-beta"
6
+ "version": "3.0.260415-beta"
7
7
  },
8
8
  "versions": {
9
- "nitro": "3.0.260311-beta"
9
+ "nitro": "3.0.260415-beta"
10
10
  },
11
11
  "serverEntry": "server/index.mjs",
12
12
  "publicDir": "public",
@@ -1,44 +1,44 @@
1
- //#region node_modules/.nitro/vite/services/ssr/assets/__tanstack-start-server-fn-resolver-_tshRSrU.js
1
+ //#region node_modules/.nitro/vite/services/ssr/assets/__tanstack-start-server-fn-resolver-DB7Vwz3A.js
2
2
  var manifest = {
3
3
  "51a34c05479a893c7d320bd4cd1604427289d667698c48b9f30a01aabf8a5e68": {
4
4
  functionName: "getConfig_createServerFn_handler",
5
- importer: () => import("./_ssr/api-rpc-CO6sLvit.mjs")
5
+ importer: () => import("./_ssr/api-rpc-kX2sZt80.mjs")
6
6
  },
7
7
  "79ada05964de8f2123bfcd62b10097d59bf8fd689ef5c7161031e5871d8396c5": {
8
8
  functionName: "getChannels_createServerFn_handler",
9
- importer: () => import("./_ssr/api-rpc-CO6sLvit.mjs")
9
+ importer: () => import("./_ssr/api-rpc-kX2sZt80.mjs")
10
10
  },
11
11
  "f8bdca3d0579adb812d6404f55d9261a89cdb025e920b1fcad82883646a5fe9e": {
12
12
  functionName: "getConfigLoaded_createServerFn_handler",
13
- importer: () => import("./_ssr/api-rpc-CO6sLvit.mjs")
13
+ importer: () => import("./_ssr/api-rpc-kX2sZt80.mjs")
14
14
  },
15
15
  "00ccacb4a0212c83ec29f4d11719046ad91ea8291cfc557d514dbf00d3bd7f5f": {
16
16
  functionName: "getBundles_createServerFn_handler",
17
- importer: () => import("./_ssr/api-rpc-CO6sLvit.mjs")
17
+ importer: () => import("./_ssr/api-rpc-kX2sZt80.mjs")
18
18
  },
19
19
  "1bd85c2a50e24785cb6abb023a247a9f048f37ddfa85cbb1c57e579563bad013": {
20
20
  functionName: "getBundle_createServerFn_handler",
21
- importer: () => import("./_ssr/api-rpc-CO6sLvit.mjs")
21
+ importer: () => import("./_ssr/api-rpc-kX2sZt80.mjs")
22
22
  },
23
23
  "e000081a14772a0496dfdf615232fbbb1a23b89191d0e32f89a05dd67a1916f7": {
24
24
  functionName: "getBundleDownloadUrl_createServerFn_handler",
25
- importer: () => import("./_ssr/api-rpc-CO6sLvit.mjs")
25
+ importer: () => import("./_ssr/api-rpc-kX2sZt80.mjs")
26
26
  },
27
27
  "67f90ce4cd10fd0226cd9d77cdcd8d0f25a59a6ac406360b655e44296bc4208b": {
28
28
  functionName: "updateBundle_createServerFn_handler",
29
- importer: () => import("./_ssr/api-rpc-CO6sLvit.mjs")
29
+ importer: () => import("./_ssr/api-rpc-kX2sZt80.mjs")
30
30
  },
31
31
  "c4ef3bbb77ea8a4410623fd18a4741e2ff0668b1a97510bcdd032a8428eaa5da": {
32
32
  functionName: "promoteBundle_createServerFn_handler",
33
- importer: () => import("./_ssr/api-rpc-CO6sLvit.mjs")
33
+ importer: () => import("./_ssr/api-rpc-kX2sZt80.mjs")
34
34
  },
35
35
  "16cc7c2f080ea5b73e0c6bba815b110dbd7727796036d248ba0d8ae819ddef08": {
36
36
  functionName: "createBundle_createServerFn_handler",
37
- importer: () => import("./_ssr/api-rpc-CO6sLvit.mjs")
37
+ importer: () => import("./_ssr/api-rpc-kX2sZt80.mjs")
38
38
  },
39
39
  "3a27ff5679228b86a346b3fe42142e7a5bf0264f73173c0dbe5f07fb37c43cf7": {
40
40
  functionName: "deleteBundle_createServerFn_handler",
41
- importer: () => import("./_ssr/api-rpc-CO6sLvit.mjs")
41
+ importer: () => import("./_ssr/api-rpc-kX2sZt80.mjs")
42
42
  }
43
43
  };
44
44
  async function getServerFnById(id) {
@@ -1,12 +1,12 @@
1
1
  import { n as HTTPError, o as toRequest } from "../_libs/h3+rou3+srvx.mjs";
2
- //#region ../../node_modules/.pnpm/nitro@3.0.260311-beta_@electric-sql+pglite@0.2.17_@libsql+client@0.15.15_better-sqlite3_1b79551a75de5c9d1c572affb95b889b/node_modules/nitro/dist/runtime/vite.mjs
2
+ //#region ../../node_modules/.pnpm/nitro@3.0.260415-beta_@electric-sql+pglite@0.2.17_@libsql+client@0.15.15_better-sqlite3_97f61cc24ed75a40553113785315eaba/node_modules/nitro/dist/runtime/vite.mjs
3
3
  function fetchViteEnv(viteEnvName, input, init) {
4
4
  const viteEnv = (globalThis.__nitro_vite_envs__ || {})[viteEnvName];
5
5
  if (!viteEnv) throw HTTPError.status(404);
6
6
  return Promise.resolve(viteEnv.fetch(toRequest(input, init)));
7
7
  }
8
8
  //#endregion
9
- //#region ../../node_modules/.pnpm/nitro@3.0.260311-beta_@electric-sql+pglite@0.2.17_@libsql+client@0.15.15_better-sqlite3_1b79551a75de5c9d1c572affb95b889b/node_modules/nitro/dist/runtime/internal/vite/ssr-renderer.mjs
9
+ //#region ../../node_modules/.pnpm/nitro@3.0.260415-beta_@electric-sql+pglite@0.2.17_@libsql+client@0.15.15_better-sqlite3_97f61cc24ed75a40553113785315eaba/node_modules/nitro/dist/runtime/internal/vite/ssr-renderer.mjs
10
10
  /** @param {{ req: Request }} HTTPEvent */
11
11
  function ssrRenderer({ req }) {
12
12
  return fetchViteEnv("ssr", req);
@@ -150,11 +150,11 @@ function useStore(atom, selector, compare = defaultCompare) {
150
150
  return (0, import_with_selector.useSyncExternalStoreWithSelector)(subscribe, boundGetSnapshot, boundGetSnapshot, selector, compare);
151
151
  }
152
152
  //#endregion
153
- //#region ../../node_modules/.pnpm/@tanstack+react-form@1.28.5_@tanstack+react-start@1.166.11_crossws@0.4.4_srvx@0.11.9__r_2c63417f08bda843067d176b0739d9b1/node_modules/@tanstack/react-form/dist/esm/useIsomorphicLayoutEffect.js
153
+ //#region ../../node_modules/.pnpm/@tanstack+react-form@1.28.5_@tanstack+react-start@1.166.11_crossws@0.4.5_srvx@0.11.15___626f04d33fa368240a754ea58864b26b/node_modules/@tanstack/react-form/dist/esm/useIsomorphicLayoutEffect.js
154
154
  var import_jsx_runtime = require_jsx_runtime();
155
155
  var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react.useLayoutEffect : import_react.useEffect;
156
156
  //#endregion
157
- //#region ../../node_modules/.pnpm/@tanstack+react-form@1.28.5_@tanstack+react-start@1.166.11_crossws@0.4.4_srvx@0.11.9__r_2c63417f08bda843067d176b0739d9b1/node_modules/@tanstack/react-form/dist/esm/useField.js
157
+ //#region ../../node_modules/.pnpm/@tanstack+react-form@1.28.5_@tanstack+react-start@1.166.11_crossws@0.4.5_srvx@0.11.15___626f04d33fa368240a754ea58864b26b/node_modules/@tanstack/react-form/dist/esm/useField.js
158
158
  function useField(opts) {
159
159
  const [prevOptions, setPrevOptions] = (0, import_react.useState)(() => ({
160
160
  form: opts.form,
@@ -221,16 +221,16 @@ var Field = (({ children, ...fieldOptions }) => {
221
221
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: (0, import_react.useMemo)(() => functionalUpdate(children, fieldApi), [children, fieldApi]) });
222
222
  });
223
223
  //#endregion
224
- //#region ../../node_modules/.pnpm/@tanstack+react-form@1.28.5_@tanstack+react-start@1.166.11_crossws@0.4.4_srvx@0.11.9__r_2c63417f08bda843067d176b0739d9b1/node_modules/@tanstack/react-form/dist/esm/useUUID.js
224
+ //#region ../../node_modules/.pnpm/@tanstack+react-form@1.28.5_@tanstack+react-start@1.166.11_crossws@0.4.5_srvx@0.11.15___626f04d33fa368240a754ea58864b26b/node_modules/@tanstack/react-form/dist/esm/useUUID.js
225
225
  function useUUID() {
226
226
  return (0, import_react.useState)(() => uuid())[0];
227
227
  }
228
228
  //#endregion
229
- //#region ../../node_modules/.pnpm/@tanstack+react-form@1.28.5_@tanstack+react-start@1.166.11_crossws@0.4.4_srvx@0.11.9__r_2c63417f08bda843067d176b0739d9b1/node_modules/@tanstack/react-form/dist/esm/useFormId.js
229
+ //#region ../../node_modules/.pnpm/@tanstack+react-form@1.28.5_@tanstack+react-start@1.166.11_crossws@0.4.5_srvx@0.11.15___626f04d33fa368240a754ea58864b26b/node_modules/@tanstack/react-form/dist/esm/useFormId.js
230
230
  var _React = import_react;
231
231
  var useFormId = "19.2.4".split(".")[0] === "17" ? useUUID : _React.useId;
232
232
  //#endregion
233
- //#region ../../node_modules/.pnpm/@tanstack+react-form@1.28.5_@tanstack+react-start@1.166.11_crossws@0.4.4_srvx@0.11.9__r_2c63417f08bda843067d176b0739d9b1/node_modules/@tanstack/react-form/dist/esm/useForm.js
233
+ //#region ../../node_modules/.pnpm/@tanstack+react-form@1.28.5_@tanstack+react-start@1.166.11_crossws@0.4.5_srvx@0.11.15___626f04d33fa368240a754ea58864b26b/node_modules/@tanstack/react-form/dist/esm/useForm.js
234
234
  function LocalSubscribe({ form, selector = (state) => state, children }) {
235
235
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: functionalUpdate(children, useStore(form.store, selector)) });
236
236
  }
@@ -1,19 +1,9 @@
1
1
  import nodeHTTP from "node:http";
2
2
  import { PassThrough, Readable } from "node:stream";
3
+ import { pipeline } from "node:stream/promises";
3
4
  import nodeHTTPS from "node:https";
4
5
  import nodeHTTP2 from "node:http2";
5
- //#region ../../node_modules/.pnpm/srvx@0.11.9/node_modules/srvx/dist/_chunks/_utils.mjs
6
- var noColor = /* @__PURE__ */ (() => {
7
- const env = globalThis.process?.env ?? {};
8
- return env.NO_COLOR === "1" || env.TERM === "dumb";
9
- })();
10
- var _c = (c, r = 39) => (t) => noColor ? t : `\u001B[${c}m${t}\u001B[${r}m`;
11
- var bold = /* @__PURE__ */ _c(1, 22);
12
- var red = /* @__PURE__ */ _c(31);
13
- var green = /* @__PURE__ */ _c(32);
14
- var gray = /* @__PURE__ */ _c(90);
15
- //#endregion
16
- //#region ../../node_modules/.pnpm/srvx@0.11.9/node_modules/srvx/dist/_chunks/_url.mjs
6
+ //#region ../../node_modules/.pnpm/srvx@0.11.15/node_modules/srvx/dist/_chunks/_url.mjs
17
7
  function lazyInherit(target, source, sourceKey) {
18
8
  for (const key of [...Object.getOwnPropertyNames(source), ...Object.getOwnPropertySymbols(source)]) {
19
9
  if (key === "constructor") continue;
@@ -68,7 +58,8 @@ var FastURL = /* @__PURE__ */ (() => {
68
58
  #searchParams;
69
59
  #pos;
70
60
  constructor(url) {
71
- if (typeof url === "string") this.#href = url;
61
+ if (typeof url === "string") if (url[0] === "/") this.#href = url;
62
+ else this.#url = new NativeURL(url);
72
63
  else if (_needsNormRE.test(url.pathname)) this.#url = new NativeURL(`${url.protocol || "http:"}//${url.host || "localhost"}${url.pathname}${url.search || ""}`);
73
64
  else {
74
65
  this.#protocol = url.protocol;
@@ -156,7 +147,7 @@ var FastURL = /* @__PURE__ */ (() => {
156
147
  return FastURL;
157
148
  })();
158
149
  //#endregion
159
- //#region ../../node_modules/.pnpm/srvx@0.11.9/node_modules/srvx/dist/_chunks/_utils2.mjs
150
+ //#region ../../node_modules/.pnpm/srvx@0.11.15/node_modules/srvx/dist/_chunks/_utils2.mjs
160
151
  function resolvePortAndHost(opts) {
161
152
  const _port = opts.port ?? globalThis.process?.env.PORT ?? 3e3;
162
153
  const port = typeof _port === "number" ? _port : Number.parseInt(_port, 10);
@@ -227,7 +218,18 @@ function createWaitUntil() {
227
218
  };
228
219
  }
229
220
  //#endregion
230
- //#region ../../node_modules/.pnpm/srvx@0.11.9/node_modules/srvx/dist/_chunks/_plugins.mjs
221
+ //#region ../../node_modules/.pnpm/srvx@0.11.15/node_modules/srvx/dist/_chunks/_utils.mjs
222
+ var noColor = /* @__PURE__ */ (() => {
223
+ const env = globalThis.process?.env ?? {};
224
+ return env.NO_COLOR === "1" || env.TERM === "dumb";
225
+ })();
226
+ var _c = (c, r = 39) => (t) => noColor ? t : `\u001B[${c}m${t}\u001B[${r}m`;
227
+ var bold = /* @__PURE__ */ _c(1, 22);
228
+ var red = /* @__PURE__ */ _c(31);
229
+ var green = /* @__PURE__ */ _c(32);
230
+ var gray = /* @__PURE__ */ _c(90);
231
+ //#endregion
232
+ //#region ../../node_modules/.pnpm/srvx@0.11.15/node_modules/srvx/dist/_chunks/_plugins.mjs
231
233
  function wrapFetch(server) {
232
234
  const fetchHandler = server.options.fetch;
233
235
  const middleware = server.options.middleware || [];
@@ -283,7 +285,7 @@ var gracefulShutdownPlugin = (server) => {
283
285
  for (const sig of ["SIGINT", "SIGTERM"]) globalThis.process.on(sig, shutdown);
284
286
  };
285
287
  //#endregion
286
- //#region ../../node_modules/.pnpm/srvx@0.11.9/node_modules/srvx/dist/adapters/node.mjs
288
+ //#region ../../node_modules/.pnpm/srvx@0.11.15/node_modules/srvx/dist/adapters/node.mjs
287
289
  async function sendNodeResponse(nodeRes, webRes) {
288
290
  if (!webRes) {
289
291
  nodeRes.statusCode = 500;
@@ -291,15 +293,14 @@ async function sendNodeResponse(nodeRes, webRes) {
291
293
  }
292
294
  if (webRes._toNodeResponse) {
293
295
  const res = webRes._toNodeResponse();
294
- writeHead(nodeRes, res.status, res.statusText, res.headers);
295
296
  if (res.body) {
296
- if (res.body instanceof ReadableStream) return streamBody(res.body, nodeRes);
297
- else if (typeof res.body?.pipe === "function") {
298
- res.body.pipe(nodeRes);
299
- return new Promise((resolve) => nodeRes.on("close", resolve));
300
- }
297
+ if (res.body instanceof ReadableStream) {
298
+ writeHead(nodeRes, res.status, res.statusText, res.headers);
299
+ return streamBody(res.body, nodeRes);
300
+ } else if (typeof res.body?.pipe === "function") return pipeBody(res.body, nodeRes, res.status, res.statusText, res.headers);
301
+ writeHead(nodeRes, res.status, res.statusText, res.headers);
301
302
  nodeRes.write(res.body);
302
- }
303
+ } else writeHead(nodeRes, res.status, res.statusText, res.headers);
303
304
  return endNodeResponse(nodeRes);
304
305
  }
305
306
  const rawHeaders = [...webRes.headers];
@@ -314,6 +315,40 @@ function writeHead(nodeRes, status, statusText, rawHeaders) {
314
315
  function endNodeResponse(nodeRes) {
315
316
  return new Promise((resolve) => nodeRes.end(resolve));
316
317
  }
318
+ function pipeBody(stream, nodeRes, status, statusText, headers) {
319
+ if (nodeRes.destroyed) {
320
+ stream.destroy?.();
321
+ return;
322
+ }
323
+ if (typeof stream.on !== "function" || typeof stream.destroy !== "function") {
324
+ writeHead(nodeRes, status, statusText, headers);
325
+ stream.pipe(nodeRes);
326
+ return new Promise((resolve) => nodeRes.on("close", resolve));
327
+ }
328
+ if (stream.destroyed) {
329
+ writeHead(nodeRes, 500, "Internal Server Error", []);
330
+ return endNodeResponse(nodeRes);
331
+ }
332
+ return new Promise((resolve) => {
333
+ function onEarlyError() {
334
+ stream.off("readable", onReadable);
335
+ stream.destroy();
336
+ writeHead(nodeRes, 500, "Internal Server Error", []);
337
+ endNodeResponse(nodeRes).then(resolve);
338
+ }
339
+ function onReadable() {
340
+ stream.off("error", onEarlyError);
341
+ if (nodeRes.destroyed) {
342
+ stream.destroy();
343
+ return resolve();
344
+ }
345
+ writeHead(nodeRes, status, statusText, headers);
346
+ pipeline(stream, nodeRes).catch(() => {}).then(() => resolve());
347
+ }
348
+ stream.once("error", onEarlyError);
349
+ stream.once("readable", onReadable);
350
+ });
351
+ }
317
352
  function streamBody(stream, nodeRes) {
318
353
  if (nodeRes.destroyed) {
319
354
  stream.cancel();
@@ -355,9 +390,8 @@ var NodeRequestURL = class extends FastURL {
355
390
  const pathname = qIndex === -1 ? path : path?.slice(0, qIndex) || "/";
356
391
  const search = qIndex === -1 ? "" : path?.slice(qIndex) || "";
357
392
  let host = req.headers.host || req.headers[":authority"];
358
- if (host) {
359
- if (!HOST_RE.test(host)) throw new TypeError(`Invalid host header: ${host}`);
360
- } else if (req.socket) host = `${req.socket.localFamily === "IPv6" ? "[" + req.socket.localAddress + "]" : req.socket.localAddress}:${req.socket?.localPort || "80"}`;
393
+ if (host && !HOST_RE.test(host)) host = "_invalid_";
394
+ else if (!host) if (req.socket) host = `${req.socket.localFamily === "IPv6" ? "[" + req.socket.localAddress + "]" : req.socket.localAddress}:${req.socket?.localPort || "80"}`;
361
395
  else host = "localhost";
362
396
  const protocol = req.socket?.encrypted || req.headers["x-forwarded-proto"] === "https" || req.headers[":scheme"] === "https" ? "https:" : "http:";
363
397
  super({
@@ -417,17 +451,8 @@ var NodeRequestHeaders = /* @__PURE__ */ (() => {
417
451
  const value = this.#req.headers["set-cookie"];
418
452
  return Array.isArray(value) ? value : value ? [value] : [];
419
453
  }
420
- *_entries() {
421
- const rawHeaders = this.#req.rawHeaders;
422
- const len = rawHeaders.length;
423
- for (let i = 0; i < len; i += 2) {
424
- const key = rawHeaders[i];
425
- if (key.charCodeAt(0) === 58) continue;
426
- yield [key.toLowerCase(), rawHeaders[i + 1]];
427
- }
428
- }
429
454
  entries() {
430
- return this.#headers ? this.#headers.entries() : this._entries();
455
+ return this._headers.entries();
431
456
  }
432
457
  [Symbol.iterator]() {
433
458
  return this.entries();
@@ -679,6 +704,7 @@ var NodeServer = class {
679
704
  waitUntil;
680
705
  #isSecure;
681
706
  #listeningPromise;
707
+ #listenError;
682
708
  #wait;
683
709
  constructor(options) {
684
710
  this.options = {
@@ -732,16 +758,30 @@ var NodeServer = class {
732
758
  else if (this.#isSecure) server = nodeHTTPS.createServer(this.serveOptions, handler);
733
759
  else server = nodeHTTP.createServer(this.serveOptions, handler);
734
760
  this.node.server = server;
735
- if (!options.manual) this.serve();
761
+ if (!options.manual) this.serve().catch(() => {});
736
762
  }
737
763
  serve() {
738
- if (this.#listeningPromise) return Promise.resolve(this.#listeningPromise).then(() => this);
739
- this.#listeningPromise = new Promise((resolve) => {
740
- this.node.server.listen(this.serveOptions, () => {
764
+ if (this.#listeningPromise) return this.#listeningPromise.then(() => this);
765
+ const server = this.node?.server;
766
+ if (!server) return Promise.reject(/* @__PURE__ */ new Error("Server not initialized"));
767
+ this.#listenError = void 0;
768
+ this.#listeningPromise = new Promise((resolve, reject) => {
769
+ const onError = (error) => {
770
+ server.off("listening", onListening);
771
+ this.#listenError = error;
772
+ this.#listeningPromise = void 0;
773
+ reject(error);
774
+ };
775
+ const onListening = () => {
776
+ server.off("error", onError);
741
777
  printListening(this.options, this.url);
742
778
  resolve();
743
- });
779
+ };
780
+ server.once("error", onError);
781
+ server.once("listening", onListening);
782
+ server.listen(this.serveOptions);
744
783
  });
784
+ return this.#listeningPromise.then(() => this);
745
785
  }
746
786
  get url() {
747
787
  const addr = this.node?.server?.address();
@@ -749,6 +789,7 @@ var NodeServer = class {
749
789
  return typeof addr === "string" ? addr : fmtURL(addr.address, addr.port, this.#isSecure);
750
790
  }
751
791
  ready() {
792
+ if (this.#listenError) return Promise.reject(this.#listenError);
752
793
  return Promise.resolve(this.#listeningPromise).then(() => this);
753
794
  }
754
795
  async close(closeAll) {
@@ -767,10 +808,14 @@ var NullProtoObj = /* @__PURE__ */ (() => {
767
808
  return e.prototype = Object.create(null), Object.freeze(e.prototype), e;
768
809
  })();
769
810
  //#endregion
770
- //#region ../../node_modules/.pnpm/h3@2.0.1-rc.16_crossws@0.4.4_srvx@0.11.9_/node_modules/h3/dist/h3-ByfIX5Jk.mjs
811
+ //#region ../../node_modules/.pnpm/h3@2.0.1-rc.20_crossws@0.4.5_srvx@0.11.15_/node_modules/h3/dist/h3-Bz4OPZv_.mjs
812
+ function decodePathname(pathname) {
813
+ return decodeURI(pathname.includes("%25") ? pathname.replace(/%25/g, "%2525") : pathname);
814
+ }
771
815
  var kEventNS = "h3.internal.event.";
772
816
  var kEventRes = /* @__PURE__ */ Symbol.for(`${kEventNS}res`);
773
817
  var kEventResHeaders = /* @__PURE__ */ Symbol.for(`${kEventNS}res.headers`);
818
+ var kEventResErrHeaders = /* @__PURE__ */ Symbol.for(`${kEventNS}res.err.headers`);
774
819
  var H3Event = class {
775
820
  app;
776
821
  req;
@@ -782,7 +827,9 @@ var H3Event = class {
782
827
  this.req = req;
783
828
  this.app = app;
784
829
  const _url = req._url;
785
- this.url = _url && _url instanceof URL ? _url : new FastURL(req.url);
830
+ const url = _url && _url instanceof URL ? _url : new FastURL(req.url);
831
+ if (url.pathname.includes("%")) url.pathname = decodePathname(url.pathname);
832
+ this.url = url;
786
833
  }
787
834
  get res() {
788
835
  return this[kEventRes] ||= new H3EventResponse();
@@ -818,6 +865,9 @@ var H3EventResponse = class {
818
865
  get headers() {
819
866
  return this[kEventResHeaders] ||= new Headers();
820
867
  }
868
+ get errHeaders() {
869
+ return this[kEventResErrHeaders] ||= new Headers();
870
+ }
821
871
  };
822
872
  var DISALLOWED_STATUS_CHARS = /[^\u0009\u0020-\u007E]/g;
823
873
  function sanitizeStatusMessage(statusMessage = "") {
@@ -857,8 +907,8 @@ var HTTPError = class HTTPError extends Error {
857
907
  messageInput = arg1;
858
908
  details = arg2;
859
909
  } else details = arg1;
860
- const status = sanitizeStatusCode(details?.status || (details?.cause)?.status || details?.status || details?.statusCode, 500);
861
- const statusText = sanitizeStatusMessage(details?.statusText || (details?.cause)?.statusText || details?.statusText || details?.statusMessage);
910
+ const status = sanitizeStatusCode(details?.status || details?.statusCode || (details?.cause)?.status || (details?.cause)?.statusCode, 500);
911
+ const statusText = sanitizeStatusMessage(details?.statusText || details?.statusMessage || (details?.cause)?.statusText || (details?.cause)?.statusMessage);
862
912
  const message = messageInput || details?.message || (details?.cause)?.message || details?.statusText || details?.statusMessage || [
863
913
  "HTTPError",
864
914
  status,
@@ -944,7 +994,8 @@ function prepareResponse(val, event, config, nested) {
944
994
  }
945
995
  if (error.unhandled && !config.silent) console.error(error);
946
996
  const { onError } = config;
947
- return onError && !nested ? Promise.resolve(onError(error, event)).catch((error) => error).then((newVal) => prepareResponse(newVal ?? val, event, config, true)) : errorResponse(error, config.debug);
997
+ const errHeaders = event[kEventRes]?.[kEventResErrHeaders];
998
+ return onError && !nested ? Promise.resolve(onError(error, event)).catch((error) => error).then((newVal) => prepareResponse(newVal ?? val, event, config, true)) : errorResponse(error, config.debug, errHeaders);
948
999
  }
949
1000
  const preparedRes = event[kEventRes];
950
1001
  const preparedHeaders = preparedRes?.[kEventResHeaders];
@@ -1027,14 +1078,16 @@ function prepareResponseBody(val, event, config) {
1027
1078
  function nullBody(method, status) {
1028
1079
  return method === "HEAD" || status === 100 || status === 101 || status === 102 || status === 204 || status === 205 || status === 304;
1029
1080
  }
1030
- function errorResponse(error, debug) {
1081
+ function errorResponse(error, debug, errHeaders) {
1082
+ let headers = error.headers ? mergeHeaders$1(jsonHeaders, error.headers) : new Headers(jsonHeaders);
1083
+ if (errHeaders) headers = mergeHeaders$1(headers, errHeaders);
1031
1084
  return new NodeResponse(JSON.stringify({
1032
1085
  ...error.toJSON(),
1033
1086
  stack: debug && error.stack ? error.stack.split("\n").map((l) => l.trim()) : void 0
1034
1087
  }, void 0, debug ? 2 : void 0), {
1035
1088
  status: error.status,
1036
1089
  statusText: error.statusText,
1037
- headers: error.headers ? mergeHeaders$1(jsonHeaders, error.headers) : new Headers(jsonHeaders)
1090
+ headers
1038
1091
  });
1039
1092
  }
1040
1093
  function callMiddleware(event, middleware, handler, index = 0) {
@@ -1153,6 +1206,5 @@ var H3Core = class {
1153
1206
  return routeMiddleware ? [...globalMiddleware, ...routeMiddleware] : globalMiddleware;
1154
1207
  }
1155
1208
  };
1156
- new TextEncoder();
1157
1209
  //#endregion
1158
1210
  export { toEventHandler as a, serve as c, defineLazyEventHandler as i, HTTPError as n, toRequest as o, defineHandler as r, NodeResponse as s, H3Core as t };
@@ -1,8 +1,8 @@
1
- //#region ../../node_modules/.pnpm/hookable@6.0.1/node_modules/hookable/dist/index.mjs
1
+ //#region ../../node_modules/.pnpm/hookable@6.1.1/node_modules/hookable/dist/index.mjs
2
2
  function callHooks(hooks, args, startIndex, task) {
3
3
  for (let i = startIndex; i < hooks.length; i += 1) try {
4
4
  const result = task ? task.run(() => hooks[i](...args)) : hooks[i](...args);
5
- if (result instanceof Promise) return result.then(() => callHooks(hooks, args, i + 1, task));
5
+ if (result && typeof result.then === "function") return Promise.resolve(result).then(() => callHooks(hooks, args, i + 1, task));
6
6
  } catch (error) {
7
7
  return Promise.reject(error);
8
8
  }
@@ -1116,5 +1116,39 @@ var WriteStream = class extends EE {
1116
1116
  }
1117
1117
  }
1118
1118
  };
1119
+ var WriteStreamSync = class extends WriteStream {
1120
+ [_open]() {
1121
+ let fd;
1122
+ if (this[_defaultFlag] && this[_flags] === "r+") try {
1123
+ fd = fs.openSync(this[_path], this[_flags], this[_mode]);
1124
+ } catch (er) {
1125
+ if (er?.code === "ENOENT") {
1126
+ this[_flags] = "w";
1127
+ return this[_open]();
1128
+ } else throw er;
1129
+ }
1130
+ else fd = fs.openSync(this[_path], this[_flags], this[_mode]);
1131
+ this[_onopen](null, fd);
1132
+ }
1133
+ [_close]() {
1134
+ if (this[_autoClose] && typeof this[_fd] === "number") {
1135
+ const fd = this[_fd];
1136
+ this[_fd] = void 0;
1137
+ fs.closeSync(fd);
1138
+ this.emit("close");
1139
+ }
1140
+ }
1141
+ [_write](buf) {
1142
+ let threw = true;
1143
+ try {
1144
+ this[_onwrite](null, fs.writeSync(this[_fd], buf, 0, buf.length, this[_pos]));
1145
+ threw = false;
1146
+ } finally {
1147
+ if (threw) try {
1148
+ this[_close]();
1149
+ } catch {}
1150
+ }
1151
+ }
1152
+ };
1119
1153
  //#endregion
1120
- export { Minipass as i, ReadStreamSync as n, WriteStream as r, ReadStream as t };
1154
+ export { Minipass as a, WriteStreamSync as i, ReadStreamSync as n, WriteStream as r, ReadStream as t };
@@ -1,4 +1,4 @@
1
- import { i as Minipass } from "./isaacs__fs-minipass+minipass.mjs";
1
+ import { a as Minipass } from "./isaacs__fs-minipass+minipass.mjs";
2
2
  import { Buffer } from "buffer";
3
3
  import assert from "assert";
4
4
  import * as realZlib$1 from "zlib";
@@ -308,6 +308,19 @@ var Zlib = class extends ZlibBase {
308
308
  }
309
309
  }
310
310
  };
311
+ var Gzip = class extends Zlib {
312
+ #portable;
313
+ constructor(opts) {
314
+ super(opts, "Gzip");
315
+ this.#portable = opts && !!opts.portable;
316
+ }
317
+ [_superWrite](data) {
318
+ if (!this.#portable) return super[_superWrite](data);
319
+ this.#portable = false;
320
+ data[9] = 255;
321
+ return super[_superWrite](data);
322
+ }
323
+ };
311
324
  var Unzip = class extends Zlib {
312
325
  constructor(opts) {
313
326
  super(opts, "Unzip");
@@ -322,6 +335,11 @@ var Brotli = class extends ZlibBase {
322
335
  super(opts, mode);
323
336
  }
324
337
  };
338
+ var BrotliCompress = class extends Brotli {
339
+ constructor(opts) {
340
+ super(opts, "BrotliCompress");
341
+ }
342
+ };
325
343
  var BrotliDecompress = class extends Brotli {
326
344
  constructor(opts) {
327
345
  super(opts, "BrotliDecompress");
@@ -336,10 +354,15 @@ var Zstd = class extends ZlibBase {
336
354
  super(opts, mode);
337
355
  }
338
356
  };
357
+ var ZstdCompress = class extends Zstd {
358
+ constructor(opts) {
359
+ super(opts, "ZstdCompress");
360
+ }
361
+ };
339
362
  var ZstdDecompress = class extends Zstd {
340
363
  constructor(opts) {
341
364
  super(opts, "ZstdDecompress");
342
365
  }
343
366
  };
344
367
  //#endregion
345
- export { Unzip as n, ZstdDecompress as r, BrotliDecompress as t };
368
+ export { ZstdCompress as a, Unzip as i, BrotliDecompress as n, ZstdDecompress as o, Gzip as r, BrotliCompress as t };
@@ -1,7 +1,9 @@
1
1
  import { r as __toESM } from "../_runtime.mjs";
2
+ import { P as require_jsx_runtime } from "./@radix-ui/react-alert-dialog+[...].mjs";
2
3
  import { u as require_react } from "./@floating-ui/react-dom+[...].mjs";
3
4
  //#region ../../node_modules/.pnpm/@radix-ui+react-direction@1.1.1_@types+react@19.2.14_react@19.2.4/node_modules/@radix-ui/react-direction/dist/index.mjs
4
5
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
6
+ require_jsx_runtime();
5
7
  var DirectionContext = import_react.createContext(void 0);
6
8
  function useDirection(localDir) {
7
9
  const globalDir = import_react.useContext(DirectionContext);