@demiurgejs/core 0.2.0-beta.6 → 0.2.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,25 +1,26 @@
1
- import { jsx as Et } from "react/jsx-runtime";
2
- import { createContext as We, useCallback as At, createElement as R, useContext as Je, useRef as k, useMemo as ae, useActionState as nr, useId as or, useLayoutEffect as ne, useState as U, useEffect as Y, Fragment as Te, Component as ir } from "react";
3
- import { g as ar, h as at, i as sr, H as cr, j as st, k as ur, l as lr, m as Me } from "./chunks/index-LYve1rQp.js";
4
- import { F as oi, n as ii, o as ai, p as si, q as ci, d as ui, t as li, u as di, v as fi, a as hi, w as pi } from "./chunks/index-LYve1rQp.js";
5
- import { O as ct, J as dr, P as Ge, i as ee, Q as fr, R as hr, s as Ye, S as Ze, T as Xe, U as pr, V as xt, W as mr, l as Qe, L as kt, X as Be, Y as yr, r as gr, z as Rt, Z as wr, _ as ut, $ as vr, a0 as br, a1 as Sr, a2 as Er, a3 as Ar, a4 as xr, a5 as kr, a6 as Rr } from "./chunks/testing-BEW1nchS.js";
6
- import { a7 as yi, D as gi, a8 as wi, a9 as vi, aa as bi, ab as Si, ac as Ei, ad as Ai, ae as xi, af as ki, ag as Ri, ah as Ti, ai as Mi, aj as Ci, ak as $i, al as Ni, am as Li, an as Ii, H as Di, ao as Pi, e as Oi, c as _i, G as Fi, n as Ui, k as Bi, ap as Hi, aq as zi, ar as ji, f as Vi, as as qi, at as Ki, au as Wi, av as Ji, aw as Gi, ax as Yi, ay as Zi, az as Xi, aA as Qi, aB as ea, aC as ta, q as ra, aD as na, aE as oa, h as ia, aF as aa, aG as sa, x as ca, aH as ua, aI as la, aJ as da, aK as fa, j as ha, aL as pa, aM as ma, aN as ya, m as ga, aO as wa, aP as va, aQ as ba, aR as Sa, aS as Ea, aT as Aa, aU as xa, aV as ka, aW as Ra, p as Ta, aX as Ma, u as Ca, aY as $a, aZ as Na, a_ as La, w as Ia, a$ as Da, I as Pa, K as Oa, b0 as _a, b1 as Fa, b2 as Ua, b3 as Ba, b4 as Ha, b5 as za, b6 as ja, b7 as Va, N as qa, v as Ka, b8 as Wa, o as Ja, b as Ga } from "./chunks/testing-BEW1nchS.js";
7
- import { I as Tr } from "./chunks/static-files-ehaD1kE7.js";
8
- import { D as Za, c as Xa, i as Qa } from "./chunks/static-files-ehaD1kE7.js";
9
- import { d as ts, m as rs, a as ns, p as os, r as is } from "./chunks/links-iU22QkCE.js";
10
- import { k as Mr } from "./chunks/images-QgdmLyQ3.js";
11
- import { d as ss, l as cs, m as us, n as ls, f as ds, o as fs, q as hs, b as ps, s as ms, t as ys, c as gs, i as ws, p as vs, r as bs } from "./chunks/images-QgdmLyQ3.js";
12
- import { c as Es, s as As } from "./chunks/session-store-ChModVcq.js";
1
+ import { jsx as kt } from "react/jsx-runtime";
2
+ import { createContext as Ge, useCallback as Rt, createElement as R, useContext as Ye, useRef as k, useMemo as ce, useActionState as ar, useId as sr, useLayoutEffect as ie, useState as U, useEffect as X, Fragment as Ce, Component as cr } from "react";
3
+ import { flushSync as ur } from "react-dom";
4
+ import { g as lr, h as ct, i as dr, H as fr, j as ut, k as hr, l as pr, m as $e } from "./chunks/index-LYve1rQp.js";
5
+ import { F as li, n as di, o as fi, p as hi, q as pi, d as mi, t as yi, u as gi, v as wi, a as vi, w as bi } from "./chunks/index-LYve1rQp.js";
6
+ import { O as lt, J as mr, P as Ze, i as re, Q as yr, R as gr, s as Xe, S as Qe, T as et, U as wr, V as Tt, W as vr, l as tt, L as Mt, X as ze, Y as br, r as Sr, z as Ct, Z as Er, _ as dt, $ as Ar, a0 as xr, a1 as kr, a2 as Rr, a3 as Tr, a4 as Mr, a5 as Cr, a6 as $r } from "./chunks/testing-BEW1nchS.js";
7
+ import { a7 as Ei, D as Ai, a8 as xi, a9 as ki, aa as Ri, ab as Ti, ac as Mi, ad as Ci, ae as $i, af as Ni, ag as Li, ah as Ii, ai as Di, aj as Pi, ak as Oi, al as _i, am as Fi, an as Ui, H as Bi, ao as Hi, e as zi, c as Vi, G as ji, n as qi, k as Ki, ap as Wi, aq as Ji, ar as Gi, f as Yi, as as Zi, at as Xi, au as Qi, av as ea, aw as ta, ax as ra, ay as na, az as oa, aA as ia, aB as aa, aC as sa, q as ca, aD as ua, aE as la, h as da, aF as fa, aG as ha, x as pa, aH as ma, aI as ya, aJ as ga, aK as wa, j as va, aL as ba, aM as Sa, aN as Ea, m as Aa, aO as xa, aP as ka, aQ as Ra, aR as Ta, aS as Ma, aT as Ca, aU as $a, aV as Na, aW as La, p as Ia, aX as Da, u as Pa, aY as Oa, aZ as _a, a_ as Fa, w as Ua, a$ as Ba, I as Ha, K as za, b0 as Va, b1 as ja, b2 as qa, b3 as Ka, b4 as Wa, b5 as Ja, b6 as Ga, b7 as Ya, N as Za, v as Xa, b8 as Qa, o as es, b as ts } from "./chunks/testing-BEW1nchS.js";
8
+ import { I as Nr } from "./chunks/static-files-ehaD1kE7.js";
9
+ import { D as ns, c as os, i as is } from "./chunks/static-files-ehaD1kE7.js";
10
+ import { d as ss, m as cs, a as us, p as ls, r as ds } from "./chunks/links-iU22QkCE.js";
11
+ import { k as Lr } from "./chunks/images-QgdmLyQ3.js";
12
+ import { d as hs, l as ps, m as ms, n as ys, f as gs, o as ws, q as vs, b as bs, s as Ss, t as Es, c as As, i as xs, p as ks, r as Rs } from "./chunks/images-QgdmLyQ3.js";
13
+ import { c as Ms, s as Cs } from "./chunks/session-store-ChModVcq.js";
13
14
  import "react-dom/server";
14
- function xo(e) {
15
+ function $o(e) {
15
16
  return {
16
17
  entries: e.map((t) => ({
17
18
  ...t,
18
- alternates: Cr(t.alternates ?? [])
19
+ alternates: Ir(t.alternates ?? [])
19
20
  }))
20
21
  };
21
22
  }
22
- function Cr(e) {
23
+ function Ir(e) {
23
24
  const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
24
25
  for (const n of e) {
25
26
  const o = n.hrefLang.toLowerCase();
@@ -40,67 +41,67 @@ function Cr(e) {
40
41
  }
41
42
  return [...t].map(([n, o]) => ({ href: o, hrefLang: n }));
42
43
  }
43
- function ko(e) {
44
+ function No(e) {
44
45
  return [
45
46
  '<?xml version="1.0" encoding="UTF-8"?>',
46
47
  `<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.entries.some((r) => r.alternates?.length) ? ' xmlns:xhtml="http://www.w3.org/1999/xhtml"' : ""}>`,
47
- ...e.entries.map(Nr),
48
+ ...e.entries.map(Pr),
48
49
  "</urlset>",
49
50
  ""
50
51
  ].join(`
51
52
  `);
52
53
  }
53
- function Ro(e) {
54
+ function Lo(e) {
54
55
  return e;
55
56
  }
56
- function To(e) {
57
+ function Io(e) {
57
58
  return e;
58
59
  }
59
- function Mo(e) {
60
+ function Do(e) {
60
61
  const t = [];
61
62
  for (const r of e.rules ?? []) {
62
- for (const n of de(r.userAgent))
63
+ for (const n of he(r.userAgent))
63
64
  t.push(`User-agent: ${n}`);
64
- for (const n of de(r.allow))
65
+ for (const n of he(r.allow))
65
66
  t.push(`Allow: ${n}`);
66
- for (const n of de(r.disallow))
67
+ for (const n of he(r.disallow))
67
68
  t.push(`Disallow: ${n}`);
68
69
  t.push("");
69
70
  }
70
71
  e.host && t.push(`Host: ${e.host}`);
71
- for (const r of de(e.sitemap))
72
+ for (const r of he(e.sitemap))
72
73
  t.push(`Sitemap: ${r}`);
73
74
  return `${t.join(`
74
75
  `).replace(/\n+$/, "")}
75
76
  `;
76
77
  }
77
- function $r(e) {
78
- const t = e.width ?? 1200, r = e.height ?? 630, n = e.background ?? "#101820", o = e.foreground ?? "#ffffff", i = Ce(e.title, 120), s = e.subtitle ? Ce(e.subtitle, 160) : void 0, a = e.brand ? Ce(e.brand, 80) : void 0;
79
- return Dr(t, r), [
78
+ function Dr(e) {
79
+ const t = e.width ?? 1200, r = e.height ?? 630, n = e.background ?? "#101820", o = e.foreground ?? "#ffffff", i = Ne(e.title, 120), s = e.subtitle ? Ne(e.subtitle, 160) : void 0, a = e.brand ? Ne(e.brand, 80) : void 0;
80
+ return Fr(t, r), [
80
81
  `<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${r}" viewBox="0 0 ${t} ${r}" role="img" aria-label="${j(i)}">`,
81
82
  ` <rect width="100%" height="100%" fill="${j(n)}" />`,
82
- a ? ` <text x="72" y="96" fill="${j(o)}" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="32" font-weight="700">${X(a)}</text>` : null,
83
- ` <text x="72" y="${s ? 300 : 340}" fill="${j(o)}" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="76" font-weight="800">${X(i)}</text>`,
84
- s ? ` <text x="72" y="392" fill="${j(o)}" fill-opacity="0.78" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="38" font-weight="500">${X(s)}</text>` : null,
83
+ a ? ` <text x="72" y="96" fill="${j(o)}" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="32" font-weight="700">${ee(a)}</text>` : null,
84
+ ` <text x="72" y="${s ? 300 : 340}" fill="${j(o)}" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="76" font-weight="800">${ee(i)}</text>`,
85
+ s ? ` <text x="72" y="392" fill="${j(o)}" fill-opacity="0.78" font-family="Inter, ui-sans-serif, system-ui, sans-serif" font-size="38" font-weight="500">${ee(s)}</text>` : null,
85
86
  "</svg>"
86
- ].filter((u) => !!u).join(`
87
+ ].filter((l) => !!l).join(`
87
88
  `);
88
89
  }
89
- function Co(e) {
90
- return new Response($r(e), {
90
+ function Po(e) {
91
+ return new Response(Dr(e), {
91
92
  headers: {
92
- "cache-control": Tr,
93
+ "cache-control": Nr,
93
94
  "content-type": "image/svg+xml; charset=utf-8"
94
95
  }
95
96
  });
96
97
  }
97
- function Nr(e) {
98
+ function Pr(e) {
98
99
  return [
99
100
  " <url>",
100
- ` <loc>${X(e.url)}</loc>`,
101
- e.lastModified ? ` <lastmod>${X(Lr(e.lastModified))}</lastmod>` : null,
101
+ ` <loc>${ee(e.url)}</loc>`,
102
+ e.lastModified ? ` <lastmod>${ee(Or(e.lastModified))}</lastmod>` : null,
102
103
  e.changeFrequency ? ` <changefreq>${e.changeFrequency}</changefreq>` : null,
103
- e.priority !== void 0 ? ` <priority>${Ir(e.priority)}</priority>` : null,
104
+ e.priority !== void 0 ? ` <priority>${_r(e.priority)}</priority>` : null,
104
105
  ...(e.alternates ?? []).map(
105
106
  (t) => ` <xhtml:link rel="alternate" hreflang="${j(t.hrefLang)}" href="${j(t.href)}" />`
106
107
  ),
@@ -108,57 +109,57 @@ function Nr(e) {
108
109
  ].filter((t) => !!t).join(`
109
110
  `);
110
111
  }
111
- function Lr(e) {
112
+ function Or(e) {
112
113
  return e instanceof Date ? e.toISOString() : e;
113
114
  }
114
- function Ir(e) {
115
+ function _r(e) {
115
116
  if (e < 0 || e > 1)
116
117
  throw new Error("Sitemap entry priority must be between 0 and 1.");
117
118
  return String(e);
118
119
  }
119
- function de(e) {
120
+ function he(e) {
120
121
  return e === void 0 ? [] : Array.isArray(e) ? e : [e];
121
122
  }
122
- function X(e) {
123
+ function ee(e) {
123
124
  return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
124
125
  }
125
126
  function j(e) {
126
- return X(e).replaceAll('"', "&quot;").replaceAll("'", "&apos;");
127
+ return ee(e).replaceAll('"', "&quot;").replaceAll("'", "&apos;");
127
128
  }
128
- function Ce(e, t) {
129
+ function Ne(e, t) {
129
130
  return e.length > t ? `${e.slice(0, t - 3)}...` : e;
130
131
  }
131
- function Dr(e, t) {
132
+ function Fr(e, t) {
132
133
  if (!Number.isSafeInteger(e) || e <= 0)
133
134
  throw new Error("OG image width must be a positive integer.");
134
135
  if (!Number.isSafeInteger(t) || t <= 0)
135
136
  throw new Error("OG image height must be a positive integer.");
136
137
  }
137
- const Pr = "24h", Or = 1e4;
138
- function $o(e = {}) {
139
- const t = e.now ?? Date.now, r = e.defaultTtl ?? Pr, n = e.maximumEntries ?? Or;
138
+ const Ur = "24h", Br = 1e4;
139
+ function Oo(e = {}) {
140
+ const t = e.now ?? Date.now, r = e.defaultTtl ?? Ur, n = e.maximumEntries ?? Br;
140
141
  if (!Number.isSafeInteger(n) || n <= 0)
141
142
  throw new Error(
142
143
  "Demiurge idempotency maximumEntries must be a positive integer."
143
144
  );
144
- const o = ct(r);
145
+ const o = lt(r);
145
146
  if (!Number.isFinite(o))
146
147
  throw new Error("Demiurge idempotency defaultTtl must be finite.");
147
148
  const i = /* @__PURE__ */ new Map();
148
149
  return {
149
150
  async run(s) {
150
- const a = dr(s.key), u = t();
151
- _r(i, u);
151
+ const a = mr(s.key), l = t();
152
+ Hr(i, l);
152
153
  const d = i.get(a);
153
- if (d && (d.pending || d.expiresAt > u)) {
154
+ if (d && (d.pending || d.expiresAt > l)) {
154
155
  const h = await d.value;
155
156
  return {
156
157
  key: a,
157
158
  replayed: !0,
158
- value: lt(h)
159
+ value: ft(h)
159
160
  };
160
161
  }
161
- if (i.size >= n && Fr(i), i.size >= n)
162
+ if (i.size >= n && zr(i), i.size >= n)
162
163
  throw new Error(
163
164
  "Demiurge idempotency store is at capacity with in-flight mutations."
164
165
  );
@@ -170,10 +171,10 @@ function $o(e = {}) {
170
171
  i.set(a, A);
171
172
  try {
172
173
  const h = await v;
173
- return A.pending = !1, A.expiresAt = t() + ct(s.ttl ?? r), {
174
+ return A.pending = !1, A.expiresAt = t() + lt(s.ttl ?? r), {
174
175
  key: a,
175
176
  replayed: !1,
176
- value: lt(h)
177
+ value: ft(h)
177
178
  };
178
179
  } catch (h) {
179
180
  throw i.get(a) === A && i.delete(a), h;
@@ -181,24 +182,24 @@ function $o(e = {}) {
181
182
  }
182
183
  };
183
184
  }
184
- function lt(e) {
185
+ function ft(e) {
185
186
  return e instanceof Response ? e.clone() : e;
186
187
  }
187
- function _r(e, t) {
188
+ function Hr(e, t) {
188
189
  for (const [r, n] of e)
189
190
  !n.pending && n.expiresAt <= t && e.delete(r);
190
191
  }
191
- function Fr(e) {
192
+ function zr(e) {
192
193
  for (const [t, r] of e)
193
194
  if (!r.pending) {
194
195
  e.delete(t);
195
196
  return;
196
197
  }
197
198
  }
198
- function No(e, t) {
199
+ function _o(e, t) {
199
200
  return e.run(t);
200
201
  }
201
- function Lo(e) {
202
+ function Fo(e) {
202
203
  return typeof e == "function" ? {
203
204
  kind: "page",
204
205
  render: { mode: "ssr" },
@@ -211,10 +212,10 @@ function Lo(e) {
211
212
  view: e.view
212
213
  };
213
214
  }
214
- function Io(e) {
215
+ function Uo(e) {
215
216
  return e;
216
217
  }
217
- const Do = {
218
+ const Bo = {
218
219
  hmac(e) {
219
220
  return {
220
221
  kind: "response",
@@ -222,7 +223,7 @@ const Do = {
222
223
  const r = new Uint8Array(await t.request.arrayBuffer()), n = t.request.headers.get(
223
224
  e.header ?? "x-webhook-signature"
224
225
  );
225
- return n ? await Ur(r, n, e) ? await e.handler({
226
+ return n ? await Vr(r, n, e) ? await e.handler({
226
227
  ...t,
227
228
  rawBody: r,
228
229
  text: () => new TextDecoder().decode(r)
@@ -246,12 +247,12 @@ const Do = {
246
247
  };
247
248
  }
248
249
  };
249
- async function Ur(e, t, r) {
250
- const n = r.algorithm ?? "SHA-256", o = r.encoding ?? "hex", i = Br(
250
+ async function Vr(e, t, r) {
251
+ const n = r.algorithm ?? "SHA-256", o = r.encoding ?? "hex", i = jr(
251
252
  t,
252
253
  n,
253
254
  r.prefix
254
- ), s = Hr(i, o);
255
+ ), s = qr(i, o);
255
256
  if (!s)
256
257
  return !1;
257
258
  const a = await globalThis.crypto.subtle.importKey(
@@ -271,11 +272,11 @@ async function Ur(e, t, r) {
271
272
  Uint8Array.from(e).buffer
272
273
  );
273
274
  }
274
- function Br(e, t, r) {
275
+ function jr(e, t, r) {
275
276
  const n = e.trim(), o = r === void 0 ? `${t.toLowerCase().replace("-", "")}=` : r;
276
277
  return o !== !1 && n.startsWith(o) ? n.slice(o.length).trim() : n;
277
278
  }
278
- function Hr(e, t) {
279
+ function qr(e, t) {
279
280
  if (t === "hex")
280
281
  return /^(?:[0-9a-f]{2})+$/i.test(e) ? Uint8Array.from(
281
282
  e.match(/.{2}/g) ?? [],
@@ -292,19 +293,19 @@ function Hr(e, t) {
292
293
  return null;
293
294
  }
294
295
  }
295
- const zr = /^[!#$%&'*+\-.^_`|~A-Za-z0-9]+$/, jr = {
296
+ const Kr = /^[!#$%&'*+\-.^_`|~A-Za-z0-9]+$/, Wr = {
296
297
  host: "__Host-",
297
298
  none: "",
298
299
  secure: "__Secure-"
299
- }, dt = 4096;
300
- function ce(e, t = "host") {
301
- return `${jr[t]}${e}`;
300
+ }, ht = 4096;
301
+ function le(e, t = "host") {
302
+ return `${Wr[t]}${e}`;
302
303
  }
303
- function Vr(e) {
304
- const t = e.scope ?? "host", r = ce(e.name, t), n = [], o = (i, s) => {
304
+ function Jr(e) {
305
+ const t = e.scope ?? "host", r = le(e.name, t), n = [], o = (i, s) => {
305
306
  n.push({ code: i, message: s, name: r });
306
307
  };
307
- if (zr.test(e.name) || o(
308
+ if (Kr.test(e.name) || o(
308
309
  "cookie-name-invalid",
309
310
  `Cookie name ${JSON.stringify(e.name)} contains a character that a cookie name cannot hold. Use letters, digits, or the token characters that RFC 6265 allows.`
310
311
  ), (e.name.startsWith("__Host-") || e.name.startsWith("__Secure-")) && o(
@@ -326,63 +327,63 @@ function Vr(e) {
326
327
  "cookie-max-age-invalid",
327
328
  `Cookie ${r} declares maxAge ${JSON.stringify(e.maxAge)}. Use a whole number of seconds that is zero or greater.`
328
329
  ), n.length === 0) {
329
- const i = new TextEncoder().encode(Tt(e, t, r)).length;
330
- i > dt && o(
330
+ const i = new TextEncoder().encode($t(e, t, r)).length;
331
+ i > ht && o(
331
332
  "cookie-too-large",
332
- `Cookie ${r} serializes to ${i} bytes, and a browser drops a cookie above ${dt} bytes. Store the payload on the server and keep an identifier in the cookie.`
333
+ `Cookie ${r} serializes to ${i} bytes, and a browser drops a cookie above ${ht} bytes. Store the payload on the server and keep an identifier in the cookie.`
333
334
  );
334
335
  }
335
336
  return n;
336
337
  }
337
- function Po(e, t = "host") {
338
+ function Ho(e, t = "host") {
338
339
  if (typeof document > "u")
339
340
  return;
340
341
  const r = typeof e == "string" ? { name: e, scope: t } : e;
341
- return Ge(document.cookie).get(
342
- ce(r.name, r.scope ?? "host")
342
+ return Ze(document.cookie).get(
343
+ le(r.name, r.scope ?? "host")
343
344
  );
344
345
  }
345
- function Se(e) {
346
- const t = Vr(e);
346
+ function Ae(e) {
347
+ const t = Jr(e);
347
348
  if (t.length > 0)
348
349
  throw new Error(
349
350
  `Demiurge rejected a cookie declaration. ${t.map((n) => n.message).join(" ")}`
350
351
  );
351
352
  const r = e.scope ?? "host";
352
- return Tt(e, r, ce(e.name, r));
353
+ return $t(e, r, le(e.name, r));
353
354
  }
354
- function Tt(e, t, r) {
355
+ function $t(e, t, r) {
355
356
  const n = [`${r}=${encodeURIComponent(e.value)}`], o = t === "host" ? "/" : e.path ?? "/";
356
357
  return n.push(`Path=${o}`), t !== "host" && e.domain !== void 0 && n.push(`Domain=${e.domain}`), e.expires && n.push(`Expires=${e.expires.toUTCString()}`), e.maxAge !== void 0 && n.push(`Max-Age=${e.maxAge}`), n.push(`SameSite=${e.sameSite ?? "Lax"}`), (e.httpOnly ?? !0) && n.push("HttpOnly"), (t !== "none" || (e.secure ?? !0)) && n.push("Secure"), n.join("; ");
357
358
  }
358
- const qr = 10080 * 60 * 1e3, Kr = 1440 * 60 * 1e3, ft = 32;
359
- function Oo(e) {
360
- const t = Ct(e);
361
- return Mt(t, Jr(t.keys));
359
+ const Gr = 10080 * 60 * 1e3, Yr = 1440 * 60 * 1e3, pt = 32;
360
+ function zo(e) {
361
+ const t = Lt(e);
362
+ return Nt(t, Xr(t.keys));
362
363
  }
363
- function _o(e) {
364
- const t = Ct(e);
364
+ function Vo(e) {
365
+ const t = Lt(e);
365
366
  for (const r of t.keys)
366
367
  if (r.value.byteLength !== 32)
367
368
  throw new Error(
368
369
  `Demiurge encrypted cookie session key ${JSON.stringify(r.id)} must contain exactly 32 bytes for AES-256-GCM.`
369
370
  );
370
- return Mt(
371
+ return Nt(
371
372
  t,
372
- Gr(t.keys, t.randomBytes)
373
+ Qr(t.keys, t.randomBytes)
373
374
  );
374
375
  }
375
- function Mt(e, t) {
376
- const r = ce(
376
+ function Nt(e, t) {
377
+ const r = le(
377
378
  e.cookie.name,
378
379
  e.cookie.scope ?? "host"
379
380
  );
380
381
  return {
381
382
  cookieName: r,
382
383
  async open(n) {
383
- const o = Ge(n.headers.get("cookie") ?? "").get(r), i = e.now(), s = o ? await t.decode(o) : void 0;
384
- let a = s?.record, u = !!(o && !s), d = !!(s && !s.currentKey);
385
- a && Zr(a, i) ? (a = void 0, u = !0, d = !1) : a && e.renewal && e.idleExpirationMs !== !1 && a.idleExpiresAt !== void 0 && a.idleExpiresAt - i <= e.idleExpirationMs / 4 && (a = {
384
+ const o = Ze(n.headers.get("cookie") ?? "").get(r), i = e.now(), s = o ? await t.decode(o) : void 0;
385
+ let a = s?.record, l = !!(o && !s), d = !!(s && !s.currentKey);
386
+ a && tn(a, i) ? (a = void 0, l = !0, d = !1) : a && e.renewal && e.idleExpirationMs !== !1 && a.idleExpiresAt !== void 0 && a.idleExpiresAt - i <= e.idleExpirationMs / 4 && (a = {
386
387
  ...a,
387
388
  idleExpiresAt: Math.min(
388
389
  a.expiresAt,
@@ -396,10 +397,10 @@ function Mt(e, t) {
396
397
  "Demiurge cannot change a session that does not exist. Create the session first."
397
398
  );
398
399
  return a;
399
- }, A = (h) => (a = Le(h), u = !1, d = !0, Le(h));
400
+ }, A = (h) => (a = De(h), l = !1, d = !0, De(h));
400
401
  return {
401
402
  async commit() {
402
- return u ? [Xr(e.cookie)] : !a || !d ? [] : [Se({
403
+ return l ? [rn(e.cookie)] : !a || !d ? [] : [Ae({
403
404
  ...e.cookie,
404
405
  expires: new Date(a.expiresAt),
405
406
  value: await t.encode(a)
@@ -410,18 +411,18 @@ function Mt(e, t) {
410
411
  throw new Error(
411
412
  "Demiurge cannot create a session when one already exists. Rotate or update the current session."
412
413
  );
413
- const E = e.now(), g = et(
414
+ const E = e.now(), g = rt(
414
415
  "absoluteExpirationMs",
415
416
  p.absoluteExpirationMs ?? e.absoluteExpirationMs
416
- ), b = p.idleExpirationMs === void 0 ? e.idleExpirationMs : $t(p.idleExpirationMs), m = E + g;
417
+ ), b = p.idleExpirationMs === void 0 ? e.idleExpirationMs : It(p.idleExpirationMs), y = E + g;
417
418
  return A({
418
419
  createdAt: E,
419
- data: Ne(h),
420
- expiresAt: m,
421
- id: pt(e.randomBytes),
420
+ data: Ie(h),
421
+ expiresAt: y,
422
+ id: yt(e.randomBytes),
422
423
  ...b === !1 ? {} : {
423
424
  idleExpiresAt: Math.min(
424
- m,
425
+ y,
425
426
  E + b
426
427
  )
427
428
  },
@@ -429,17 +430,17 @@ function Mt(e, t) {
429
430
  });
430
431
  },
431
432
  destroy() {
432
- a = void 0, u = !0, d = !1;
433
+ a = void 0, l = !0, d = !1;
433
434
  },
434
435
  get() {
435
- return a ? Le(a) : void 0;
436
+ return a ? De(a) : void 0;
436
437
  },
437
438
  rotate(h) {
438
439
  const p = v();
439
440
  return A({
440
441
  ...p,
441
- data: h === void 0 ? p.data : Ne(h),
442
- id: pt(e.randomBytes),
442
+ data: h === void 0 ? p.data : Ie(h),
443
+ id: yt(e.randomBytes),
443
444
  version: p.version + 1
444
445
  });
445
446
  },
@@ -447,7 +448,7 @@ function Mt(e, t) {
447
448
  const p = v();
448
449
  return A({
449
450
  ...p,
450
- data: Ne(h),
451
+ data: Ie(h),
451
452
  version: p.version + 1
452
453
  });
453
454
  }
@@ -455,12 +456,12 @@ function Mt(e, t) {
455
456
  }
456
457
  };
457
458
  }
458
- function Ct(e) {
459
- const t = Wr(e.keys), r = et(
459
+ function Lt(e) {
460
+ const t = Zr(e.keys), r = rt(
460
461
  "absoluteExpirationMs",
461
- e.absoluteExpirationMs ?? qr
462
- ), n = $t(
463
- e.idleExpirationMs ?? Kr
462
+ e.absoluteExpirationMs ?? Gr
463
+ ), n = It(
464
+ e.idleExpirationMs ?? Yr
464
465
  );
465
466
  return {
466
467
  absoluteExpirationMs: r,
@@ -468,11 +469,11 @@ function Ct(e) {
468
469
  idleExpirationMs: n,
469
470
  keys: t,
470
471
  now: e.now ?? Date.now,
471
- randomBytes: e.randomBytes ?? Qr,
472
+ randomBytes: e.randomBytes ?? nn,
472
473
  renewal: e.renewal ?? !0
473
474
  };
474
475
  }
475
- function Wr(e) {
476
+ function Zr(e) {
476
477
  if (e.length === 0)
477
478
  throw new Error(
478
479
  "Demiurge cookie sessions require at least one key. Put the current key first."
@@ -495,28 +496,28 @@ function Wr(e) {
495
496
  }
496
497
  return [...e];
497
498
  }
498
- function et(e, t) {
499
+ function rt(e, t) {
499
500
  if (!Number.isSafeInteger(t) || t <= 0)
500
501
  throw new Error(
501
502
  `Demiurge cookie session ${e} must be a positive whole number of milliseconds.`
502
503
  );
503
504
  return t;
504
505
  }
505
- function $t(e) {
506
- return e === !1 ? !1 : et("idleExpirationMs", e);
506
+ function It(e) {
507
+ return e === !1 ? !1 : rt("idleExpirationMs", e);
507
508
  }
508
- function Jr(e) {
509
+ function Xr(e) {
509
510
  return {
510
511
  async decode(t) {
511
512
  const r = t.split(".");
512
513
  if (r.length !== 4 || r[0] !== "s1")
513
514
  return;
514
- const n = e.findIndex((v) => v.id === r[1]), o = e[n], i = be(r[2]), s = be(r[3]);
515
+ const n = e.findIndex((v) => v.id === r[1]), o = e[n], i = Ee(r[2]), s = Ee(r[3]);
515
516
  if (!o || !i || !s)
516
517
  return;
517
518
  const a = await crypto.subtle.importKey(
518
519
  "raw",
519
- I(o.value),
520
+ L(o.value),
520
521
  { hash: "SHA-256", name: "HMAC" },
521
522
  !1,
522
523
  ["verify"]
@@ -524,47 +525,47 @@ function Jr(e) {
524
525
  if (!await crypto.subtle.verify(
525
526
  "HMAC",
526
527
  a,
527
- I(s),
528
- I(Q(`s1.${o.id}.${r[2]}`))
528
+ L(s),
529
+ L(te(`s1.${o.id}.${r[2]}`))
529
530
  ))
530
531
  return;
531
- const d = Nt(i);
532
+ const d = Dt(i);
532
533
  return d ? { currentKey: n === 0, record: d } : void 0;
533
534
  },
534
535
  async encode(t) {
535
- const r = e[0], n = se(Q(JSON.stringify(t))), o = `s1.${r.id}.${n}`, i = await crypto.subtle.importKey(
536
+ const r = e[0], n = ue(te(JSON.stringify(t))), o = `s1.${r.id}.${n}`, i = await crypto.subtle.importKey(
536
537
  "raw",
537
- I(r.value),
538
+ L(r.value),
538
539
  { hash: "SHA-256", name: "HMAC" },
539
540
  !1,
540
541
  ["sign"]
541
542
  ), s = await crypto.subtle.sign(
542
543
  "HMAC",
543
544
  i,
544
- I(Q(o))
545
+ L(te(o))
545
546
  );
546
- return `${o}.${se(new Uint8Array(s))}`;
547
+ return `${o}.${ue(new Uint8Array(s))}`;
547
548
  }
548
549
  };
549
550
  }
550
- function Gr(e, t) {
551
+ function Qr(e, t) {
551
552
  return {
552
553
  async decode(r) {
553
554
  const n = r.split(".");
554
555
  if (n.length !== 4 || n[0] !== "e1")
555
556
  return;
556
- const o = e.findIndex((u) => u.id === n[1]), i = e[o], s = be(n[2]), a = be(n[3]);
557
+ const o = e.findIndex((l) => l.id === n[1]), i = e[o], s = Ee(n[2]), a = Ee(n[3]);
557
558
  if (!(!i || s?.byteLength !== 12 || !a))
558
559
  try {
559
- const u = await ht(i), d = await crypto.subtle.decrypt(
560
+ const l = await mt(i), d = await crypto.subtle.decrypt(
560
561
  {
561
- additionalData: I(Q(`e1.${i.id}`)),
562
- iv: I(s),
562
+ additionalData: L(te(`e1.${i.id}`)),
563
+ iv: L(s),
563
564
  name: "AES-GCM"
564
565
  },
565
- u,
566
- I(a)
567
- ), v = Nt(new Uint8Array(d));
566
+ l,
567
+ L(a)
568
+ ), v = Dt(new Uint8Array(d));
568
569
  return v ? { currentKey: o === 0, record: v } : void 0;
569
570
  } catch {
570
571
  return;
@@ -576,90 +577,90 @@ function Gr(e, t) {
576
577
  throw new Error(
577
578
  "Demiurge cookie session randomBytes returned an incorrect byte count."
578
579
  );
579
- const i = await ht(n), s = await crypto.subtle.encrypt(
580
+ const i = await mt(n), s = await crypto.subtle.encrypt(
580
581
  {
581
- additionalData: I(Q(`e1.${n.id}`)),
582
- iv: I(o),
582
+ additionalData: L(te(`e1.${n.id}`)),
583
+ iv: L(o),
583
584
  name: "AES-GCM"
584
585
  },
585
586
  i,
586
- I(Q(JSON.stringify(r)))
587
+ L(te(JSON.stringify(r)))
587
588
  );
588
- return `e1.${n.id}.${se(o)}.${se(new Uint8Array(s))}`;
589
+ return `e1.${n.id}.${ue(o)}.${ue(new Uint8Array(s))}`;
589
590
  }
590
591
  };
591
592
  }
592
- async function ht(e) {
593
+ async function mt(e) {
593
594
  return await crypto.subtle.importKey(
594
595
  "raw",
595
- I(e.value),
596
+ L(e.value),
596
597
  "AES-GCM",
597
598
  !1,
598
599
  ["decrypt", "encrypt"]
599
600
  );
600
601
  }
601
- function Nt(e) {
602
+ function Dt(e) {
602
603
  try {
603
604
  const t = JSON.parse(new TextDecoder("utf-8", { fatal: !0 }).decode(e));
604
- return !ee(t) || !$e(t.createdAt) || !$e(t.expiresAt) || typeof t.id != "string" || !/^[A-Za-z0-9_-]{43}$/.test(t.id) || !Yr(t.version) || t.idleExpiresAt !== void 0 && !$e(t.idleExpiresAt) || !ve(t.data) ? void 0 : t;
605
+ return !re(t) || !Le(t.createdAt) || !Le(t.expiresAt) || typeof t.id != "string" || !/^[A-Za-z0-9_-]{43}$/.test(t.id) || !en(t.version) || t.idleExpiresAt !== void 0 && !Le(t.idleExpiresAt) || !Se(t.data) ? void 0 : t;
605
606
  } catch {
606
607
  return;
607
608
  }
608
609
  }
609
- function $e(e) {
610
+ function Le(e) {
610
611
  return typeof e == "number" && Number.isSafeInteger(e) && e >= 0;
611
612
  }
612
- function Yr(e) {
613
+ function en(e) {
613
614
  return typeof e == "number" && Number.isSafeInteger(e) && e >= 0;
614
615
  }
615
- function ve(e) {
616
- return e === null || typeof e == "boolean" || typeof e == "string" ? !0 : typeof e == "number" ? Number.isFinite(e) : Array.isArray(e) ? e.every(ve) : ee(e) && Object.values(e).every(ve);
616
+ function Se(e) {
617
+ return e === null || typeof e == "boolean" || typeof e == "string" ? !0 : typeof e == "number" ? Number.isFinite(e) : Array.isArray(e) ? e.every(Se) : re(e) && Object.values(e).every(Se);
617
618
  }
618
- function Zr(e, t) {
619
+ function tn(e, t) {
619
620
  return e.expiresAt <= t || e.idleExpiresAt !== void 0 && e.idleExpiresAt <= t;
620
621
  }
621
- function Xr(e) {
622
- return Se({
622
+ function rn(e) {
623
+ return Ae({
623
624
  ...e,
624
625
  expires: /* @__PURE__ */ new Date(0),
625
626
  maxAge: 0,
626
627
  value: ""
627
628
  });
628
629
  }
629
- function pt(e) {
630
- const t = e(ft);
631
- if (t.byteLength !== ft)
630
+ function yt(e) {
631
+ const t = e(pt);
632
+ if (t.byteLength !== pt)
632
633
  throw new Error(
633
634
  "Demiurge cookie session randomBytes returned an incorrect byte count."
634
635
  );
635
- return se(t);
636
+ return ue(t);
636
637
  }
637
- function Qr(e) {
638
+ function nn(e) {
638
639
  return crypto.getRandomValues(new Uint8Array(e));
639
640
  }
640
- function Ne(e) {
641
- if (!ve(e))
641
+ function Ie(e) {
642
+ if (!Se(e))
642
643
  throw new Error(
643
644
  "Demiurge session data must contain only finite JSON values."
644
645
  );
645
646
  return structuredClone(e);
646
647
  }
647
- function Le(e) {
648
+ function De(e) {
648
649
  return structuredClone(e);
649
650
  }
650
- function Q(e) {
651
+ function te(e) {
651
652
  return new TextEncoder().encode(e);
652
653
  }
653
- function I(e) {
654
+ function L(e) {
654
655
  return Uint8Array.from(e).buffer;
655
656
  }
656
- function se(e) {
657
+ function ue(e) {
657
658
  let t = "";
658
659
  for (const r of e)
659
660
  t += String.fromCharCode(r);
660
661
  return btoa(t).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
661
662
  }
662
- function be(e) {
663
+ function Ee(e) {
663
664
  if (/^[A-Za-z0-9_-]+$/.test(e))
664
665
  try {
665
666
  const t = "=".repeat((4 - e.length % 4) % 4), r = atob(e.replaceAll("-", "+").replaceAll("_", "/") + t);
@@ -668,34 +669,34 @@ function be(e) {
668
669
  return;
669
670
  }
670
671
  }
671
- const en = 10080 * 60 * 1e3, tn = 1440 * 60 * 1e3;
672
- class rn extends Error {
672
+ const on = 10080 * 60 * 1e3, an = 1440 * 60 * 1e3;
673
+ class sn extends Error {
673
674
  constructor(t) {
674
675
  super(
675
676
  `Demiurge session ${t} conflicted with another request. Load the current session before another lifecycle operation.`
676
677
  ), this.name = "SessionStoreConflictError";
677
678
  }
678
679
  }
679
- class mt extends Error {
680
+ class gt extends Error {
680
681
  constructor(t) {
681
682
  super(
682
683
  `Demiurge session ${t} failed because the session store is unavailable.`
683
684
  ), this.name = "SessionStoreUnavailableError";
684
685
  }
685
686
  }
686
- function Fo(e) {
687
- const t = nn(e), r = ce(
687
+ function jo(e) {
688
+ const t = cn(e), r = le(
688
689
  t.cookie.name,
689
690
  t.cookie.scope ?? "host"
690
691
  );
691
692
  return {
692
693
  cookieName: r,
693
694
  async open(n) {
694
- const o = Ge(n.headers.get("cookie") ?? "").get(r), i = o ? await sn(o, t.keys) : void 0, s = t.now();
695
- let a = i ? await t.store.read(i.id, s) : void 0, u = !!(o && (!i || !a)), d = !!(a && i && !i.currentKey);
695
+ const o = Ze(n.headers.get("cookie") ?? "").get(r), i = o ? await dn(o, t.keys) : void 0, s = t.now();
696
+ let a = i ? await t.store.read(i.id, s) : void 0, l = !!(o && (!i || !a)), d = !!(a && i && !i.currentKey);
696
697
  if (a && t.renewal && t.idleExpirationMs !== !1 && a.idleExpiresAt !== void 0 && a.idleExpiresAt - s <= t.idleExpirationMs / 4) {
697
698
  const h = await t.store.update({
698
- ...Ie(a),
699
+ ...Pe(a),
699
700
  idleExpiresAt: Math.min(
700
701
  a.expiresAt,
701
702
  s + t.idleExpirationMs
@@ -704,9 +705,9 @@ function Fo(e) {
704
705
  if (h.status === "stored")
705
706
  a = h.record, d = !0;
706
707
  else if (h.status === "conflict")
707
- a = await t.store.read(a.id, s), u = !a;
708
+ a = await t.store.read(a.id, s), l = !a;
708
709
  else
709
- throw new mt("renewal");
710
+ throw new gt("renewal");
710
711
  }
711
712
  const v = () => {
712
713
  if (!a)
@@ -716,17 +717,17 @@ function Fo(e) {
716
717
  return a;
717
718
  }, A = (h, p) => {
718
719
  if (h.status === "conflict")
719
- throw new rn(p);
720
+ throw new sn(p);
720
721
  if (h.status === "unavailable")
721
- throw new mt(p);
722
- return a = Pe(h.record), u = !1, d = !0, Pe(h.record);
722
+ throw new gt(p);
723
+ return a = _e(h.record), l = !1, d = !0, _e(h.record);
723
724
  };
724
725
  return {
725
726
  async commit() {
726
- return u ? [cn(t.cookie)] : !a || !d ? [] : [Se({
727
+ return l ? [fn(t.cookie)] : !a || !d ? [] : [Ae({
727
728
  ...t.cookie,
728
729
  expires: new Date(a.expiresAt),
729
- value: await an(a.id, t.keys[0])
730
+ value: await ln(a.id, t.keys[0])
730
731
  })];
731
732
  },
732
733
  async create(h, p = {}) {
@@ -734,17 +735,17 @@ function Fo(e) {
734
735
  throw new Error(
735
736
  "Demiurge cannot create a session when one already exists. Rotate or update the current session."
736
737
  );
737
- const E = t.now(), g = tt(
738
+ const E = t.now(), g = nt(
738
739
  "absoluteExpirationMs",
739
740
  p.absoluteExpirationMs ?? t.absoluteExpirationMs
740
- ), b = p.idleExpirationMs === void 0 ? t.idleExpirationMs : Lt(p.idleExpirationMs), m = E + g, T = {
741
+ ), b = p.idleExpirationMs === void 0 ? t.idleExpirationMs : Pt(p.idleExpirationMs), y = E + g, T = {
741
742
  createdAt: E,
742
- data: De(h),
743
- expiresAt: m,
744
- id: yt(t.randomBytes),
743
+ data: Oe(h),
744
+ expiresAt: y,
745
+ id: wt(t.randomBytes),
745
746
  ...b === !1 ? {} : {
746
747
  idleExpiresAt: Math.min(
747
- m,
748
+ y,
748
749
  E + b
749
750
  )
750
751
  }
@@ -752,16 +753,16 @@ function Fo(e) {
752
753
  return A(await t.store.create(T), "creation");
753
754
  },
754
755
  async destroy() {
755
- a && await t.store.destroy(a.id), a = void 0, u = !0, d = !1;
756
+ a && await t.store.destroy(a.id), a = void 0, l = !0, d = !1;
756
757
  },
757
758
  get() {
758
- return a ? Pe(a) : void 0;
759
+ return a ? _e(a) : void 0;
759
760
  },
760
761
  async rotate(h) {
761
762
  const p = v(), E = {
762
- ...Ie(p),
763
- data: h === void 0 ? p.data : De(h),
764
- id: yt(t.randomBytes)
763
+ ...Pe(p),
764
+ data: h === void 0 ? p.data : Oe(h),
765
+ id: wt(t.randomBytes)
765
766
  };
766
767
  return A(
767
768
  await t.store.rotate(p.id, E, p.version),
@@ -772,8 +773,8 @@ function Fo(e) {
772
773
  const p = v();
773
774
  return A(
774
775
  await t.store.update({
775
- ...Ie(p),
776
- data: De(h)
776
+ ...Pe(p),
777
+ data: Oe(h)
777
778
  }, p.version),
778
779
  "update"
779
780
  );
@@ -782,29 +783,29 @@ function Fo(e) {
782
783
  }
783
784
  };
784
785
  }
785
- function nn(e) {
786
+ function cn(e) {
786
787
  if (!e.store || typeof e.store.read != "function")
787
788
  throw new Error(
788
789
  "Demiurge session manager requires a SessionStore implementation."
789
790
  );
790
- const t = on(e.keys);
791
+ const t = un(e.keys);
791
792
  return {
792
- absoluteExpirationMs: tt(
793
+ absoluteExpirationMs: nt(
793
794
  "absoluteExpirationMs",
794
- e.absoluteExpirationMs ?? en
795
+ e.absoluteExpirationMs ?? on
795
796
  ),
796
797
  cookie: { ...e.cookie, name: e.cookie?.name ?? "session" },
797
- idleExpirationMs: Lt(
798
- e.idleExpirationMs ?? tn
798
+ idleExpirationMs: Pt(
799
+ e.idleExpirationMs ?? an
799
800
  ),
800
801
  keys: t,
801
802
  now: e.now ?? Date.now,
802
- randomBytes: e.randomBytes ?? un,
803
+ randomBytes: e.randomBytes ?? hn,
803
804
  renewal: e.renewal ?? !0,
804
805
  store: e.store
805
806
  };
806
807
  }
807
- function on(e) {
808
+ function un(e) {
808
809
  if (e.length === 0)
809
810
  throw new Error(
810
811
  "Demiurge session manager requires at least one key. Put the current key first."
@@ -823,30 +824,30 @@ function on(e) {
823
824
  }
824
825
  return [...e];
825
826
  }
826
- async function an(e, t) {
827
+ async function ln(e, t) {
827
828
  const r = `i1.${t.id}.${e}`, n = await crypto.subtle.importKey(
828
829
  "raw",
829
- oe(t.value),
830
+ ae(t.value),
830
831
  { hash: "SHA-256", name: "HMAC" },
831
832
  !1,
832
833
  ["sign"]
833
834
  ), o = await crypto.subtle.sign(
834
835
  "HMAC",
835
836
  n,
836
- oe(new TextEncoder().encode(r))
837
+ ae(new TextEncoder().encode(r))
837
838
  );
838
- return `${r}.${It(new Uint8Array(o))}`;
839
+ return `${r}.${Ot(new Uint8Array(o))}`;
839
840
  }
840
- async function sn(e, t) {
841
+ async function dn(e, t) {
841
842
  const r = e.split(".");
842
843
  if (r.length !== 4 || r[0] !== "i1" || !/^[A-Za-z0-9_-]{43}$/.test(r[2]))
843
844
  return;
844
- const n = t.findIndex((u) => u.id === r[1]), o = t[n], i = ln(r[3]);
845
+ const n = t.findIndex((l) => l.id === r[1]), o = t[n], i = pn(r[3]);
845
846
  if (!o || !i)
846
847
  return;
847
848
  const s = await crypto.subtle.importKey(
848
849
  "raw",
849
- oe(o.value),
850
+ ae(o.value),
850
851
  { hash: "SHA-256", name: "HMAC" },
851
852
  !1,
852
853
  ["verify"]
@@ -854,63 +855,63 @@ async function sn(e, t) {
854
855
  return await crypto.subtle.verify(
855
856
  "HMAC",
856
857
  s,
857
- oe(i),
858
- oe(new TextEncoder().encode(r.slice(0, 3).join(".")))
858
+ ae(i),
859
+ ae(new TextEncoder().encode(r.slice(0, 3).join(".")))
859
860
  ) ? { currentKey: n === 0, id: r[2] } : void 0;
860
861
  }
861
- function Ie(e) {
862
+ function Pe(e) {
862
863
  const { version: t, ...r } = e;
863
864
  return r;
864
865
  }
865
- function cn(e) {
866
- return Se({
866
+ function fn(e) {
867
+ return Ae({
867
868
  ...e,
868
869
  expires: /* @__PURE__ */ new Date(0),
869
870
  maxAge: 0,
870
871
  value: ""
871
872
  });
872
873
  }
873
- function tt(e, t) {
874
+ function nt(e, t) {
874
875
  if (!Number.isSafeInteger(t) || t <= 0)
875
876
  throw new Error(
876
877
  `Demiurge session manager ${e} must be a positive whole number of milliseconds.`
877
878
  );
878
879
  return t;
879
880
  }
880
- function Lt(e) {
881
- return e === !1 ? !1 : tt("idleExpirationMs", e);
881
+ function Pt(e) {
882
+ return e === !1 ? !1 : nt("idleExpirationMs", e);
882
883
  }
883
- function yt(e) {
884
+ function wt(e) {
884
885
  const t = e(32);
885
886
  if (t.byteLength !== 32)
886
887
  throw new Error(
887
888
  "Demiurge session manager randomBytes returned an incorrect byte count."
888
889
  );
889
- return It(t);
890
+ return Ot(t);
890
891
  }
891
- function un(e) {
892
+ function hn(e) {
892
893
  return crypto.getRandomValues(new Uint8Array(e));
893
894
  }
894
- function De(e) {
895
- if (!He(e))
895
+ function Oe(e) {
896
+ if (!Ve(e))
896
897
  throw new Error(
897
898
  "Demiurge session data must contain only finite JSON values."
898
899
  );
899
900
  return structuredClone(e);
900
901
  }
901
- function He(e) {
902
- return e === null || typeof e == "boolean" || typeof e == "string" ? !0 : typeof e == "number" ? Number.isFinite(e) : Array.isArray(e) ? e.every(He) : typeof e == "object" && e !== null && Object.values(e).every(He);
902
+ function Ve(e) {
903
+ return e === null || typeof e == "boolean" || typeof e == "string" ? !0 : typeof e == "number" ? Number.isFinite(e) : Array.isArray(e) ? e.every(Ve) : typeof e == "object" && e !== null && Object.values(e).every(Ve);
903
904
  }
904
- function Pe(e) {
905
+ function _e(e) {
905
906
  return structuredClone(e);
906
907
  }
907
- function It(e) {
908
+ function Ot(e) {
908
909
  let t = "";
909
910
  for (const r of e)
910
911
  t += String.fromCharCode(r);
911
912
  return btoa(t).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
912
913
  }
913
- function ln(e) {
914
+ function pn(e) {
914
915
  if (/^[A-Za-z0-9_-]+$/.test(e))
915
916
  try {
916
917
  const t = "=".repeat((4 - e.length % 4) % 4), r = atob(e.replaceAll("-", "+").replaceAll("_", "/") + t);
@@ -919,10 +920,10 @@ function ln(e) {
919
920
  return;
920
921
  }
921
922
  }
922
- function oe(e) {
923
+ function ae(e) {
923
924
  return Uint8Array.from(e).buffer;
924
925
  }
925
- function Uo(e = {}) {
926
+ function qo(e = {}) {
926
927
  return async function(r) {
927
928
  if (r.method.toUpperCase() !== "POST")
928
929
  return new Response(null, {
@@ -931,22 +932,22 @@ function Uo(e = {}) {
931
932
  },
932
933
  status: 405
933
934
  });
934
- const n = fn(r);
935
+ const n = yn(r);
935
936
  if (n)
936
937
  return n;
937
- const o = hn(e, r);
938
+ const o = gn(e, r);
938
939
  if (o)
939
940
  return o;
940
- e.maxBodySize !== void 0 && (r = fr({ maxBodySize: e.maxBodySize }, r));
941
+ e.maxBodySize !== void 0 && (r = yr({ maxBodySize: e.maxBodySize }, r));
941
942
  let i;
942
943
  try {
943
944
  i = await r.json();
944
945
  } catch (a) {
945
- return a instanceof hr ? new Response("Security report body too large.", { status: 413 }) : new Response("Invalid security report JSON.", {
946
+ return a instanceof gr ? new Response("Security report body too large.", { status: 413 }) : new Response("Invalid security report JSON.", {
946
947
  status: 400
947
948
  });
948
949
  }
949
- const s = pn(i);
950
+ const s = wn(i);
950
951
  for (let a = 0; a < s.length; a += 1)
951
952
  await e.onReport?.(s[a], {
952
953
  index: a,
@@ -957,20 +958,20 @@ function Uo(e = {}) {
957
958
  });
958
959
  };
959
960
  }
960
- const dn = /* @__PURE__ */ new Set([
961
+ const mn = /* @__PURE__ */ new Set([
961
962
  "application/csp-report",
962
963
  "application/reports+json"
963
964
  ]);
964
- function fn(e) {
965
+ function yn(e) {
965
966
  const t = e.headers.get("content-type");
966
967
  if (!t)
967
968
  return null;
968
969
  const r = t.split(";", 1)[0]?.trim().toLowerCase();
969
- return r && dn.has(r) ? null : new Response("Unsupported security report Content-Type.", {
970
+ return r && mn.has(r) ? null : new Response("Unsupported security report Content-Type.", {
970
971
  status: 415
971
972
  });
972
973
  }
973
- function hn(e, t) {
974
+ function gn(e, t) {
974
975
  if (e.maxBodySize === void 0)
975
976
  return null;
976
977
  const r = t.headers.get("content-length");
@@ -981,29 +982,29 @@ function hn(e, t) {
981
982
  status: 400
982
983
  });
983
984
  const n = Number(r);
984
- return Number.isSafeInteger(n) ? n > Ye(e.maxBodySize) ? new Response("Security report body too large.", {
985
+ return Number.isSafeInteger(n) ? n > Xe(e.maxBodySize) ? new Response("Security report body too large.", {
985
986
  status: 413
986
987
  }) : null : new Response("Invalid Content-Length.", {
987
988
  status: 400
988
989
  });
989
990
  }
990
- function pn(e) {
991
- return Array.isArray(e) ? e : Ze(e) && "csp-report" in e ? [e["csp-report"]] : [e];
991
+ function wn(e) {
992
+ return Array.isArray(e) ? e : Qe(e) && "csp-report" in e ? [e["csp-report"]] : [e];
992
993
  }
993
- function Bo(e, t) {
994
+ function Ko(e, t) {
994
995
  const r = {}, n = [];
995
996
  let o = 0;
996
997
  for (const [i, s] of Object.entries(t.files)) {
997
- const a = e.getAll(i).filter(gn);
998
+ const a = e.getAll(i).filter(Sn);
998
999
  r[i] = a, s.required && a.length === 0 && n.push({
999
1000
  code: "file-missing",
1000
1001
  field: i,
1001
1002
  message: `Upload field ${i} requires at least one file.`
1002
1003
  });
1003
- for (const u of a)
1004
- o += u.size, mn(i, u, s, n);
1004
+ for (const l of a)
1005
+ o += l.size, vn(i, l, s, n);
1005
1006
  }
1006
- return t.maxTotalSize !== void 0 && o > Ye(t.maxTotalSize) && n.push({
1007
+ return t.maxTotalSize !== void 0 && o > Xe(t.maxTotalSize) && n.push({
1007
1008
  code: "total-upload-too-large",
1008
1009
  field: "*",
1009
1010
  message: `Uploaded files exceed the maximum total size of ${t.maxTotalSize}.`
@@ -1014,24 +1015,24 @@ function Bo(e, t) {
1014
1015
  totalSize: o
1015
1016
  };
1016
1017
  }
1017
- function mn(e, t, r, n) {
1018
- r.maxSize !== void 0 && t.size > Ye(r.maxSize) && n.push({
1018
+ function vn(e, t, r, n) {
1019
+ r.maxSize !== void 0 && t.size > Xe(r.maxSize) && n.push({
1019
1020
  code: "file-too-large",
1020
1021
  field: e,
1021
1022
  message: `Upload field ${e} contains ${t.name || "a file"} larger than ${r.maxSize}.`
1022
- }), r.types?.length && !yn(t.type, r.types) && n.push({
1023
+ }), r.types?.length && !bn(t.type, r.types) && n.push({
1023
1024
  code: "file-type-not-allowed",
1024
1025
  field: e,
1025
1026
  message: `Upload field ${e} contains ${t.name || "a file"} with disallowed type ${t.type || "unknown"}.`
1026
1027
  });
1027
1028
  }
1028
- function yn(e, t) {
1029
+ function bn(e, t) {
1029
1030
  return t.some((r) => r.endsWith("/*") ? e.startsWith(r.slice(0, -1)) : e === r);
1030
1031
  }
1031
- function gn(e) {
1032
+ function Sn(e) {
1032
1033
  return e instanceof File;
1033
1034
  }
1034
- function wn(e, t) {
1035
+ function En(e, t) {
1035
1036
  const r = t.headers.get("origin");
1036
1037
  if (!r)
1037
1038
  return {
@@ -1040,7 +1041,7 @@ function wn(e, t) {
1040
1041
  origin: r,
1041
1042
  reason: e.allowMissingOrigin ? void 0 : "missing-origin"
1042
1043
  };
1043
- const n = Dt(r);
1044
+ const n = _t(r);
1044
1045
  if (!n)
1045
1046
  return {
1046
1047
  allowed: !1,
@@ -1048,7 +1049,7 @@ function wn(e, t) {
1048
1049
  origin: r,
1049
1050
  reason: "invalid-origin"
1050
1051
  };
1051
- const o = vn(e, n, t);
1052
+ const o = An(e, n, t);
1052
1053
  return {
1053
1054
  allowed: o,
1054
1055
  expected: e.origins,
@@ -1056,20 +1057,20 @@ function wn(e, t) {
1056
1057
  reason: o ? void 0 : "origin-not-allowed"
1057
1058
  };
1058
1059
  }
1059
- function Ho(e, t) {
1060
- return !e || wn(e, t).allowed ? null : new Response("WebSocket origin not allowed.", {
1060
+ function Wo(e, t) {
1061
+ return !e || En(e, t).allowed ? null : new Response("WebSocket origin not allowed.", {
1061
1062
  status: 403
1062
1063
  });
1063
1064
  }
1064
- function vn(e, t, r) {
1065
+ function An(e, t, r) {
1065
1066
  return e.origins === "same-origin" ? t === new URL(r.url).origin : e.origins.some(
1066
- (n) => bn(n, t)
1067
+ (n) => xn(n, t)
1067
1068
  );
1068
1069
  }
1069
- function bn(e, t) {
1070
- return e === "null" ? t === "null" : Dt(e) === t;
1070
+ function xn(e, t) {
1071
+ return e === "null" ? t === "null" : _t(e) === t;
1071
1072
  }
1072
- function Dt(e) {
1073
+ function _t(e) {
1073
1074
  if (e === "null")
1074
1075
  return e;
1075
1076
  try {
@@ -1087,27 +1088,27 @@ function Dt(e) {
1087
1088
  return null;
1088
1089
  }
1089
1090
  }
1090
- const Pt = We({
1091
+ const Ft = Ge({
1091
1092
  register: () => () => {
1092
1093
  },
1093
1094
  focus: () => !1
1094
1095
  });
1095
- function Sn() {
1096
- const e = Je(Pt), t = k(void 0), r = At((n) => {
1096
+ function kn() {
1097
+ const e = Ye(Ft), t = k(void 0), r = Rt((n) => {
1097
1098
  t.current?.(), t.current = void 0, n && (t.current = e.register(n));
1098
1099
  }, [e]);
1099
- return ae(() => ({
1100
+ return ce(() => ({
1100
1101
  ref: r,
1101
1102
  tabIndex: -1
1102
1103
  }), [r]);
1103
1104
  }
1104
- function zo(e) {
1105
- const { as: t, children: r, ref: n, ...o } = e, i = Sn(), s = At((a) => {
1105
+ function Jo(e) {
1106
+ const { as: t, children: r, ref: n, ...o } = e, i = kn(), s = Rt((a) => {
1106
1107
  if (a) {
1107
- i.ref(a), gt(n, a);
1108
+ i.ref(a), vt(n, a);
1108
1109
  return;
1109
1110
  }
1110
- gt(n, null), i.ref(null);
1111
+ vt(n, null), i.ref(null);
1111
1112
  }, [i.ref, n]);
1112
1113
  return R(t ?? "div", {
1113
1114
  ...o,
@@ -1116,22 +1117,22 @@ function zo(e) {
1116
1117
  children: r
1117
1118
  });
1118
1119
  }
1119
- function gt(e, t) {
1120
+ function vt(e, t) {
1120
1121
  typeof e == "function" ? e(t) : e && (e.current = t);
1121
1122
  }
1122
- const Ot = Symbol("Demiurge mutation form action");
1123
- let ie;
1124
- const ze = /* @__PURE__ */ new Set();
1125
- function En(e) {
1126
- return ie = e, () => {
1127
- ie === e && (ie = void 0);
1123
+ const Ut = Symbol("Demiurge mutation form action");
1124
+ let se;
1125
+ const je = /* @__PURE__ */ new Set();
1126
+ function Rn(e) {
1127
+ return se = e, () => {
1128
+ se === e && (se = void 0);
1128
1129
  };
1129
1130
  }
1130
- function je(e) {
1131
- for (const t of ze)
1131
+ function qe(e) {
1132
+ for (const t of je)
1132
1133
  t !== e && t.abort();
1133
1134
  }
1134
- function An(e) {
1135
+ function Tn(e) {
1135
1136
  let t;
1136
1137
  return (r, n) => {
1137
1138
  t?.controller.abort();
@@ -1140,77 +1141,77 @@ function An(e) {
1140
1141
  // TYPE-EVIDENCE: the function assigns the promise before it exposes the invocation.
1141
1142
  promise: void 0
1142
1143
  };
1143
- ze.add(o);
1144
- const s = Xe({
1144
+ je.add(o);
1145
+ const s = et({
1145
1146
  to: e.route,
1146
1147
  ...e.path === void 0 ? {} : { path: e.path }
1147
- }), a = xn({
1148
+ }), a = Mn({
1148
1149
  body: n,
1149
1150
  method: e.method,
1150
1151
  signal: o.signal,
1151
1152
  url: s
1152
1153
  });
1153
- return i.promise = a.then(async (u) => {
1154
+ return i.promise = a.then(async (l) => {
1154
1155
  if (t !== i) return await t.promise;
1155
- if (u.status === "redirect") {
1156
- const d = Ut(u.location);
1157
- if (!d) return Oe("The mutation returned an unsafe redirect.");
1158
- je(o), ie?.redirect(d, u.history, o);
1159
- } else u.status === "success" && u.revalidate && await ie?.refresh();
1160
- return o.signal.aborted ? r ?? Oe("The mutation was cancelled.") : t === i ? u : await t.promise;
1161
- }).catch(async (u) => {
1156
+ if (l.status === "redirect") {
1157
+ const d = zt(l.location);
1158
+ if (!d) return Fe("The mutation returned an unsafe redirect.");
1159
+ qe(o), se?.redirect(d, l.history, o);
1160
+ } else l.status === "success" && l.revalidate && await se?.refresh();
1161
+ return o.signal.aborted ? r ?? Fe("The mutation was cancelled.") : t === i ? l : await t.promise;
1162
+ }).catch(async (l) => {
1162
1163
  if (t !== i) return await t.promise;
1163
1164
  if (o.signal.aborted && r) return r;
1164
- if (o.signal.aborted) return Oe("The mutation was cancelled.");
1165
- throw u;
1165
+ if (o.signal.aborted) return Fe("The mutation was cancelled.");
1166
+ throw l;
1166
1167
  }).finally(() => {
1167
- ze.delete(o);
1168
+ je.delete(o);
1168
1169
  }), t = i, i.promise;
1169
1170
  };
1170
1171
  }
1171
- function jo(e, t) {
1172
- const r = Xe({
1172
+ function Go(e, t) {
1173
+ const r = et({
1173
1174
  to: e.route,
1174
1175
  ...e.path === void 0 ? {} : { path: e.path }
1175
- }), n = ae(
1176
- () => An(e),
1176
+ }), n = ce(
1177
+ () => Tn(e),
1177
1178
  [e.method, r]
1178
- ), [o, i, s] = nr(n, t), a = ae(() => {
1179
- const u = (d) => i(d);
1180
- return Object.defineProperty(u, Ot, {
1179
+ ), [o, i, s] = ar(n, t), a = ce(() => {
1180
+ const l = (d) => i(d);
1181
+ return Object.defineProperty(l, Ut, {
1181
1182
  value: { method: "POST", url: r }
1182
- }), u;
1183
+ }), l;
1183
1184
  }, [i, r]);
1184
1185
  return [o, a, s];
1185
1186
  }
1186
- function _t(e) {
1187
- return e[Ot];
1187
+ function Bt(e) {
1188
+ return e[Ut];
1188
1189
  }
1189
- async function xn(e) {
1190
- const { result: t } = await Ft(e);
1190
+ async function Mn(e) {
1191
+ const { result: t } = await Ht(e);
1191
1192
  if (!t)
1192
1193
  throw new Error("Demiurge expected a versioned mutation result.");
1193
1194
  return t;
1194
1195
  }
1195
- async function Ft(e) {
1196
+ async function Ht(e) {
1196
1197
  const t = await fetch(e.url, {
1197
1198
  body: e.body,
1198
1199
  credentials: "same-origin",
1199
1200
  headers: {
1200
- accept: xt,
1201
- [mr]: pr,
1201
+ accept: Tt,
1202
+ [vr]: wr,
1202
1203
  ...e.contentType ? { "content-type": e.contentType } : {}
1203
1204
  },
1204
1205
  method: e.method,
1205
1206
  redirect: "manual",
1206
1207
  signal: e.signal
1207
1208
  });
1208
- return { response: t, result: await kn(t) };
1209
+ return { response: t, result: await Cn(t) };
1209
1210
  }
1210
- async function kn(e) {
1211
+ async function Cn(e) {
1211
1212
  const t = e.headers.get("content-type");
1212
1213
  if (!t) return;
1213
- const [r, ...n] = t?.split(";").map((s) => s.trim().toLowerCase()) ?? [], o = xt.split(";")[0];
1214
+ const [r, ...n] = t?.split(";").map((s) => s.trim().toLowerCase()) ?? [], o = Tt.split(";")[0];
1214
1215
  if (r !== o) return;
1215
1216
  if (n.length !== 1 || n[0] !== "v=1")
1216
1217
  throw new Error("Demiurge received a malformed versioned mutation result.");
@@ -1220,25 +1221,25 @@ async function kn(e) {
1220
1221
  } catch {
1221
1222
  throw new Error("Demiurge received a malformed versioned mutation result.");
1222
1223
  }
1223
- if (!ee(i) || i.version !== 1 || typeof i.status != "string")
1224
+ if (!re(i) || i.version !== 1 || typeof i.status != "string")
1224
1225
  throw new Error("Demiurge received a malformed versioned mutation result.");
1225
1226
  if (i.status === "success") {
1226
- if (!Z(i, ["data", "revalidate", "status", "version"]) || i.revalidate !== void 0 && typeof i.revalidate != "boolean" || "data" in i && !Ve(i.data)) throw fe();
1227
+ if (!Q(i, ["data", "revalidate", "status", "version"]) || i.revalidate !== void 0 && typeof i.revalidate != "boolean" || "data" in i && !Ke(i.data)) throw pe();
1227
1228
  return { version: 1, status: "success", ...i.data === void 0 ? {} : { data: i.data }, ...i.revalidate === void 0 ? {} : { revalidate: i.revalidate } };
1228
1229
  }
1229
1230
  if (i.status === "invalid") {
1230
- if (!Z(i, ["status", "validation", "version"]) || !Rn(i.validation)) throw fe();
1231
+ if (!Q(i, ["status", "validation", "version"]) || !$n(i.validation)) throw pe();
1231
1232
  return { version: 1, status: "invalid", validation: i.validation };
1232
1233
  }
1233
1234
  if (i.status === "failed") {
1234
- if (!Z(i, ["message", "status", "version"]) || i.message !== void 0 && typeof i.message != "string") throw fe();
1235
+ if (!Q(i, ["message", "status", "version"]) || i.message !== void 0 && typeof i.message != "string") throw pe();
1235
1236
  return { version: 1, status: "failed", ...i.message === void 0 ? {} : { message: i.message } };
1236
1237
  }
1237
- if (i.status === "redirect" && typeof i.location == "string" && (i.history === "push" || i.history === "replace") && Z(i, ["history", "location", "status", "version"]))
1238
+ if (i.status === "redirect" && typeof i.location == "string" && (i.history === "push" || i.history === "replace") && Q(i, ["history", "location", "status", "version"]))
1238
1239
  return { version: 1, status: "redirect", location: i.location, history: i.history };
1239
- throw fe();
1240
+ throw pe();
1240
1241
  }
1241
- function Ut(e) {
1242
+ function zt(e) {
1242
1243
  try {
1243
1244
  const t = new URL(e, window.location.href);
1244
1245
  return t.protocol !== window.location.protocol || t.origin !== window.location.origin || t.username || t.password ? void 0 : `${t.pathname}${t.search}${t.hash}`;
@@ -1246,51 +1247,51 @@ function Ut(e) {
1246
1247
  return;
1247
1248
  }
1248
1249
  }
1249
- function Oe(e) {
1250
+ function Fe(e) {
1250
1251
  return { version: 1, status: "failed", message: e };
1251
1252
  }
1252
- function fe() {
1253
+ function pe() {
1253
1254
  return new Error("Demiurge received a malformed mutation result.");
1254
1255
  }
1255
- function Z(e, t) {
1256
+ function Q(e, t) {
1256
1257
  return Object.keys(e).every((r) => t.includes(r));
1257
1258
  }
1258
- function Rn(e) {
1259
- return ee(e) && Z(e, ["issues"]) && Array.isArray(e.issues) && e.issues.every(Tn);
1259
+ function $n(e) {
1260
+ return re(e) && Q(e, ["issues"]) && Array.isArray(e.issues) && e.issues.every(Nn);
1260
1261
  }
1261
- function Tn(e) {
1262
- return ee(e) && Z(e, ["code", "message", "path"]) && typeof e.code == "string" && typeof e.message == "string" && Array.isArray(e.path) && (e.path.length === 0 || typeof e.path[0] == "string") && e.path.every((t) => typeof t == "string" || typeof t == "number");
1262
+ function Nn(e) {
1263
+ return re(e) && Q(e, ["code", "message", "path"]) && typeof e.code == "string" && typeof e.message == "string" && Array.isArray(e.path) && (e.path.length === 0 || typeof e.path[0] == "string") && e.path.every((t) => typeof t == "string" || typeof t == "number");
1263
1264
  }
1264
- function Ve(e) {
1265
- return e === null || typeof e == "string" || typeof e == "boolean" ? !0 : typeof e == "number" ? Number.isFinite(e) : Array.isArray(e) ? e.every(Ve) : ee(e) && Object.values(e).every(Ve);
1265
+ function Ke(e) {
1266
+ return e === null || typeof e == "string" || typeof e == "boolean" ? !0 : typeof e == "number" ? Number.isFinite(e) : Array.isArray(e) ? e.every(Ke) : re(e) && Object.values(e).every(Ke);
1266
1267
  }
1267
- function Mn(e) {
1268
- const t = kt(e.routes), r = e.loadNavigationData ?? Kt;
1268
+ function Ln(e) {
1269
+ const t = Mt(e.routes), r = e.loadNavigationData ?? Gt;
1269
1270
  return function() {
1270
- const [o, i] = U(() => F()), [s, a] = U(e.locale), u = Be(o.pathname, e.locales), d = k(o), [v, A] = U(
1271
+ const [o, i] = U(() => F()), [s, a] = U(e.locale), l = ze(o.pathname, e.locales), d = k(o), [v, A] = U(
1271
1272
  () => e.initialMatch ?? { status: "loading" }
1272
- ), h = k(!!e.initialMatch), p = k(!0), E = k(0), g = k(void 0), b = k("navigation"), m = k(/* @__PURE__ */ new Map()), T = k(/* @__PURE__ */ new Map()), [H, w] = U(0), [$, C] = U(0), V = k(/* @__PURE__ */ new Set()), [Qt, rt] = U(0), O = k("push"), [ue, Ae] = U(null), [q, xe] = U(null), nt = k(null);
1273
- nt.current = ue;
1274
- const K = k(void 0), ke = k(void 0), P = k(void 0), W = k(!1), ot = k(/* @__PURE__ */ new Map()), J = k([]), er = k(0);
1275
- function G() {
1276
- const c = P.current, l = qt();
1277
- c && ot.current.set(c, l), On(c, l);
1273
+ ), h = k(!!e.initialMatch), p = k(!0), E = k(0), g = k(void 0), b = k("navigation"), y = k(/* @__PURE__ */ new Map()), T = k(/* @__PURE__ */ new Map()), [H, w] = U(0), [$, C] = U(0), q = k(/* @__PURE__ */ new Set()), [rr, ot] = U(0), O = k("push"), z = k(!1), [de, ke] = U(null), [K, Re] = U(null), it = k(null);
1274
+ it.current = de;
1275
+ const W = k(void 0), Te = k(void 0), D = k(void 0), J = k(!1), at = k(/* @__PURE__ */ new Map()), G = k([]), nr = k(0);
1276
+ function Y() {
1277
+ const c = D.current, u = Jt();
1278
+ c && at.current.set(c, u), Bn(c, u);
1278
1279
  }
1279
- const Re = ae(() => ({
1280
+ const Me = ce(() => ({
1280
1281
  register(c) {
1281
- const l = {
1282
+ const u = {
1282
1283
  element: c,
1283
- order: er.current++
1284
+ order: nr.current++
1284
1285
  };
1285
- return J.current.length > 0 && typeof process < "u" && process.env.NODE_ENV !== "production" && console.warn(
1286
+ return G.current.length > 0 && typeof process < "u" && process.env.NODE_ENV !== "production" && console.warn(
1286
1287
  "Demiurge found more than one RouteFocusBoundary. The first boundary remains active."
1287
- ), J.current.push(l), () => {
1288
- const f = J.current.indexOf(l);
1289
- f !== -1 && J.current.splice(f, 1);
1288
+ ), G.current.push(u), () => {
1289
+ const f = G.current.indexOf(u);
1290
+ f !== -1 && G.current.splice(f, 1);
1290
1291
  };
1291
1292
  },
1292
1293
  focus() {
1293
- const c = J.current.slice().sort((l, f) => l.order - f.order)[0]?.element;
1294
+ const c = G.current.slice().sort((u, f) => u.order - f.order)[0]?.element;
1294
1295
  if (!c || !c.isConnected || typeof c.focus != "function")
1295
1296
  return !1;
1296
1297
  try {
@@ -1301,202 +1302,205 @@ function Mn(e) {
1301
1302
  return !0;
1302
1303
  }
1303
1304
  }), []);
1304
- ne(() => (e.navigation !== "document" && ar(), () => {
1305
- J.current = [];
1306
- }), [e.navigation]), Y(() => () => {
1307
- je();
1308
- for (const c of V.current) c();
1309
- V.current.clear();
1310
- for (const c of m.current.values()) c.abort();
1311
- m.current.clear(), T.current.clear();
1305
+ ie(() => (e.navigation !== "document" && lr(), () => {
1306
+ G.current = [];
1307
+ }), [e.navigation]), X(() => () => {
1308
+ qe();
1309
+ for (const c of q.current) c();
1310
+ q.current.clear();
1311
+ for (const c of y.current.values()) c.abort();
1312
+ y.current.clear(), T.current.clear();
1312
1313
  }, []);
1313
- function te(c) {
1314
- je(c);
1315
- let l = !1;
1316
- for (const [f, y] of m.current) {
1317
- if (y === c) continue;
1318
- y.abort(), m.current.delete(f);
1314
+ function ne(c) {
1315
+ qe(c);
1316
+ let u = !1;
1317
+ for (const [f, m] of y.current) {
1318
+ if (m === c) continue;
1319
+ m.abort(), y.current.delete(f);
1319
1320
  const S = T.current.get(f);
1320
1321
  (S?.state === "submitting" || S?.state === "loading") && T.current.set(f, {
1321
1322
  state: "idle",
1322
1323
  form: S.form,
1323
1324
  submissionKey: S.submissionKey,
1324
1325
  ...S.state === "loading" && S.result ? { result: S.result } : {}
1325
- }), l = !0;
1326
+ }), u = !0;
1326
1327
  }
1327
- l && w((f) => f + 1);
1328
+ u && w((f) => f + 1);
1328
1329
  }
1329
- function z() {
1330
+ function V() {
1330
1331
  E.current++, g.current?.abort(), g.current = void 0;
1331
1332
  }
1332
- Y(() => {
1333
+ X(() => {
1333
1334
  if (e.navigation === "document")
1334
1335
  return;
1335
1336
  const c = window.history.scrollRestoration;
1336
- window.history.scrollRestoration = "manual", P.current = wt(), G();
1337
- const l = () => {
1338
- W.current || G();
1337
+ window.history.scrollRestoration = "manual", D.current = bt(), Y();
1338
+ const u = () => {
1339
+ J.current || Y();
1339
1340
  };
1340
- return window.addEventListener("scroll", l, { passive: !0 }), () => {
1341
- window.removeEventListener("scroll", l), window.history.scrollRestoration = c;
1341
+ return window.addEventListener("scroll", u, { passive: !0 }), () => {
1342
+ window.removeEventListener("scroll", u), window.history.scrollRestoration = c;
1342
1343
  };
1343
- }, [e.navigation]), Y(() => {
1344
+ }, [e.navigation]), X(() => {
1344
1345
  function c() {
1345
- te(), O.current = "pop", W.current = !0, P.current = wt(), ke.current = ot.current.get(
1346
- P.current
1347
- ) ?? _n();
1348
- const l = F(), f = d.current;
1349
- (f.pathname !== l.pathname || f.search !== l.search) && (z(), b.current = "navigation"), d.current = l, e.navigation !== "document" && f.pathname === l.pathname && f.search === l.search && f.hash !== l.hash && pe(l.hash), i(l);
1346
+ ne(), z.current = !1, O.current = "pop", J.current = !0, D.current = bt(), Te.current = at.current.get(
1347
+ D.current
1348
+ ) ?? Hn();
1349
+ const u = F(), f = d.current;
1350
+ (f.pathname !== u.pathname || f.search !== u.search) && (V(), b.current = "navigation"), d.current = u, e.navigation !== "document" && f.pathname === u.pathname && f.search === u.search && f.hash !== u.hash && ye(u.hash), i(u);
1350
1351
  }
1351
1352
  return window.addEventListener("popstate", c), () => window.removeEventListener("popstate", c);
1352
- }, []), Y(() => {
1353
- let c = !1, l = !1;
1354
- const f = ++E.current, y = new AbortController();
1355
- g.current = y;
1356
- const S = b.current, D = () => !c && f === E.current;
1357
- if (Ae(null), xe(null), h.current && $n(e.initialMatch) === u)
1353
+ }, []), X(() => {
1354
+ let c = !1, u = !1;
1355
+ const f = ++E.current, m = new AbortController();
1356
+ g.current = m;
1357
+ const S = b.current, I = () => !c && f === E.current;
1358
+ if (ke(null), Re(null), h.current && Dn(e.initialMatch) === l)
1358
1359
  return h.current = !1, p.current = !1, () => {
1359
- c = !0, y.abort(), g.current === y && (g.current = void 0);
1360
+ c = !0, m.abort(), g.current === m && (g.current = void 0);
1360
1361
  };
1361
1362
  const _ = p.current;
1362
- p.current = !1, S !== "refresh" && e.navigation !== "document" && !_ && (K.current = {
1363
+ p.current = !1, S !== "refresh" && e.navigation !== "document" && !_ && (W.current = {
1363
1364
  navigation: O.current,
1364
- position: O.current === "pop" ? ke.current : void 0
1365
- }, ke.current = void 0), S !== "refresh" && (A({ status: "loading" }), yr(t, u).then((x) => {
1366
- D() && !l && x && A({ loading: x, status: "loading" });
1365
+ position: O.current === "pop" ? Te.current : void 0
1366
+ }, Te.current = void 0), S !== "refresh" && !z.current && (A({ status: "loading" }), br(t, l).then((x) => {
1367
+ I() && !u && x && A({ loading: x, status: "loading" });
1367
1368
  }).catch(() => {
1368
1369
  }));
1369
- const re = new Request(o.href, { signal: y.signal });
1370
- return Promise.resolve(r(re)).then(async (x) => {
1370
+ const oe = new Request(o.href, { signal: m.signal });
1371
+ return Promise.resolve(r(oe)).then(async (x) => {
1371
1372
  const N = x.url ? new URL(x.url, o.href) : new URL(o.href);
1372
1373
  N.hash || (N.hash = o.hash);
1373
- const M = x.locale ?? (e.locales ? gr(new Request(N), e.locales).locale : s);
1374
+ const M = x.locale ?? (e.locales ? Sr(new Request(N), e.locales).locale : s);
1374
1375
  return {
1375
1376
  initialData: x,
1376
1377
  responseUrl: N,
1377
- nextMatch: await Rt(
1378
+ nextMatch: await Ct(
1378
1379
  t,
1379
- Be(N.pathname, e.locales),
1380
- new Request(N.href, { signal: y.signal }),
1380
+ ze(N.pathname, e.locales),
1381
+ new Request(N.href, { signal: m.signal }),
1381
1382
  x,
1382
1383
  void 0,
1383
1384
  { documentContributions: !1, locale: M }
1384
1385
  )
1385
1386
  };
1386
1387
  }).then(({ initialData: x, nextMatch: N, responseUrl: M }) => {
1387
- if (l = !0, D()) {
1388
- if (x.document && at(x.document), "locale" in x && x.locale && a(x.locale), M.href !== o.href) {
1389
- window.history.replaceState(window.history.state, "", M);
1390
- const L = F();
1391
- d.current = L, i(L);
1392
- }
1393
- A(N), rt((L) => L + 1), S !== "refresh" && Ae({
1394
- kind: O.current,
1395
- outcome: N.status === "not-found" ? "not-found" : "ready",
1396
- title: document.title || "Demiurge App",
1397
- url: new URL(o.href)
1398
- });
1388
+ if (u = !0, I()) {
1389
+ const P = () => {
1390
+ if (x.document && ct(x.document), "locale" in x && x.locale && a(x.locale), M.href !== o.href) {
1391
+ window.history.replaceState(window.history.state, "", M);
1392
+ const fe = F();
1393
+ d.current = fe, i(fe);
1394
+ }
1395
+ A(N), ot((fe) => fe + 1), S !== "refresh" && ke({
1396
+ kind: O.current,
1397
+ outcome: N.status === "not-found" ? "not-found" : "ready",
1398
+ title: document.title || "Demiurge App",
1399
+ url: new URL(o.href)
1400
+ });
1401
+ }, Z = z.current;
1402
+ z.current = !1, Z ? Gn(P) : P();
1399
1403
  }
1400
1404
  }).catch(async (x) => {
1401
- if (l = !0, !D() || y.signal.aborted)
1405
+ if (u = !0, !I() || m.signal.aborted)
1402
1406
  return;
1403
- const N = await wr(
1407
+ const N = await Er(
1404
1408
  t,
1405
- u
1409
+ l
1406
1410
  );
1407
- if (D()) {
1408
- const M = typeof x == "object" && x ? Wt.get(x) : void 0;
1409
- M && at(M), A({
1411
+ if (I()) {
1412
+ const M = typeof x == "object" && x ? Yt.get(x) : void 0;
1413
+ M && ct(M), A({
1410
1414
  Error: N,
1411
1415
  error: x,
1412
1416
  locale: s,
1413
- pathname: u,
1417
+ pathname: l,
1414
1418
  status: "error"
1415
- }), Ae(S === "refresh" ? null : {
1419
+ }), ke(S === "refresh" ? null : {
1416
1420
  kind: O.current,
1417
1421
  outcome: "error",
1418
1422
  title: M?.title ?? "Navigation failed",
1419
1423
  url: new URL(o.href)
1420
- }), rt((L) => L + 1);
1424
+ }), ot((P) => P + 1);
1421
1425
  }
1422
1426
  }), () => {
1423
- c = !0, y.abort(), g.current === y && (g.current = void 0);
1427
+ c = !0, m.abort(), g.current === m && (g.current = void 0);
1424
1428
  };
1425
- }, [u, o.pathname, o.search, $]), ne(() => {
1426
- if (!(!q || e.navigation === "document")) {
1427
- if (q.url.hash) {
1428
- K.current && (K.current = void 0, pe(q.url.hash)), W.current = !1;
1429
+ }, [l, o.pathname, o.search, $]), ie(() => {
1430
+ if (!(!K || e.navigation === "document")) {
1431
+ if (K.url.hash) {
1432
+ W.current && (W.current = void 0, ye(K.url.hash)), J.current = !1;
1429
1433
  return;
1430
1434
  }
1431
- if (Re.focus(), K.current) {
1432
- const c = K.current;
1433
- K.current = void 0, Fn(e.navigationScroll, {
1434
- ...q,
1435
+ if (Me.focus(), W.current) {
1436
+ const c = W.current;
1437
+ W.current = void 0, zn(e.navigationScroll, {
1438
+ ...K,
1435
1439
  kind: c.navigation,
1436
1440
  navigation: c.navigation,
1437
1441
  position: c.position
1438
1442
  });
1439
1443
  }
1440
- W.current = !1, jn(q, e.navigationAccessibility);
1444
+ J.current = !1, Wn(K, e.navigationAccessibility);
1441
1445
  }
1442
1446
  }, [
1443
- q,
1444
- Re,
1447
+ K,
1448
+ Me,
1445
1449
  e.navigation,
1446
1450
  e.navigationAccessibility,
1447
1451
  e.navigationScroll
1448
1452
  ]);
1449
- function B(c, l) {
1450
- T.current.set(c, l), w((f) => f + 1);
1453
+ function B(c, u) {
1454
+ T.current.set(c, u), w((f) => f + 1);
1451
1455
  }
1452
- function tr(c, l) {
1453
- const f = Fe(c, l), y = T.current.get(f);
1454
- y?.form === c && (y.state === "loading" && y.result || (m.current.get(f)?.abort(), m.current.delete(f), T.current.delete(f), w((S) => S + 1)));
1456
+ function or(c, u) {
1457
+ const f = Be(c, u), m = T.current.get(f);
1458
+ m?.form === c && (m.state === "loading" && m.result || (y.current.get(f)?.abort(), y.current.delete(f), T.current.delete(f), w((S) => S + 1)));
1455
1459
  }
1456
- const rr = ae(
1460
+ const ir = ce(
1457
1461
  () => ({
1458
1462
  navigation: e.navigation ?? "server",
1459
1463
  locale: s,
1460
1464
  locales: e.locales,
1461
1465
  submissionVersion: H,
1462
- getMutationNavigation(c, l) {
1463
- const f = Fe(c, l);
1466
+ getMutationNavigation(c, u) {
1467
+ const f = Be(c, u);
1464
1468
  return T.current.get(f) ?? {
1465
1469
  state: "idle",
1466
1470
  form: c,
1467
- submissionKey: l
1471
+ submissionKey: u
1468
1472
  };
1469
1473
  },
1470
- releaseMutationNavigation: tr,
1474
+ releaseMutationNavigation: or,
1471
1475
  push(c) {
1472
- te(), W.current = !1;
1473
- const l = F();
1474
- O.current = "push", e.navigation !== "document" && G();
1475
- const f = ge();
1476
- window.history.pushState(f.state, "", c), P.current = f.key;
1477
- const y = F();
1478
- (l.pathname !== y.pathname || l.search !== y.search) && (z(), b.current = "navigation"), d.current = y, i(y), l.pathname === y.pathname && l.search === y.search && l.hash !== y.hash && pe(y.hash);
1476
+ ne(), J.current = !1;
1477
+ const u = F();
1478
+ O.current = "push", e.navigation !== "document" && Y();
1479
+ const f = ve();
1480
+ window.history.pushState(f.state, "", c), D.current = f.key;
1481
+ const m = F();
1482
+ z.current = At(e.viewTransitions) && (u.pathname !== m.pathname || u.search !== m.search), (u.pathname !== m.pathname || u.search !== m.search) && (V(), b.current = "navigation"), d.current = m, i(m), u.pathname === m.pathname && u.search === m.search && u.hash !== m.hash && ye(m.hash);
1479
1483
  },
1480
1484
  replace(c) {
1481
- te(), W.current = !1;
1482
- const l = F();
1483
- O.current = "replace", e.navigation !== "document" && G(), window.history.replaceState(
1484
- we(window.history.state, P.current),
1485
+ ne(), J.current = !1;
1486
+ const u = F();
1487
+ O.current = "replace", e.navigation !== "document" && Y(), window.history.replaceState(
1488
+ be(window.history.state, D.current),
1485
1489
  "",
1486
1490
  c
1487
1491
  );
1488
1492
  const f = F();
1489
- (l.pathname !== f.pathname || l.search !== f.search) && (z(), b.current = "navigation"), d.current = f, i(f), e.navigation !== "document" && l.pathname === f.pathname && l.search === f.search && l.hash !== f.hash && pe(f.hash);
1493
+ z.current = At(e.viewTransitions) && (u.pathname !== f.pathname || u.search !== f.search), (u.pathname !== f.pathname || u.search !== f.search) && (V(), b.current = "navigation"), d.current = f, i(f), e.navigation !== "document" && u.pathname === f.pathname && u.search === f.search && u.hash !== f.hash && ye(f.hash);
1490
1494
  },
1491
- async submitMutation(c, l, f) {
1495
+ async submitMutation(c, u, f) {
1492
1496
  if ((e.navigation ?? "server") !== "server") return;
1493
- const y = Bn(c, l);
1494
- if (!y) return;
1495
- const S = Fe(c, f);
1496
- m.current.get(S)?.abort();
1497
- const D = new AbortController();
1498
- m.current.set(S, D);
1499
- const _ = y.formData, re = () => !D.signal.aborted && m.current.get(S) === D;
1497
+ const m = jn(c, u);
1498
+ if (!m) return;
1499
+ const S = Be(c, f);
1500
+ y.current.get(S)?.abort();
1501
+ const I = new AbortController();
1502
+ y.current.set(S, I);
1503
+ const _ = m.formData, oe = () => !I.signal.aborted && y.current.get(S) === I;
1500
1504
  B(S, {
1501
1505
  state: "submitting",
1502
1506
  form: c,
@@ -1505,129 +1509,129 @@ function Mn(e) {
1505
1509
  });
1506
1510
  let x;
1507
1511
  try {
1508
- const N = await Ft({
1509
- body: y.body,
1510
- contentType: y.contentType,
1511
- method: y.method,
1512
- signal: D.signal,
1513
- url: y.url
1512
+ const N = await Ht({
1513
+ body: m.body,
1514
+ contentType: m.contentType,
1515
+ method: m.method,
1516
+ signal: I.signal,
1517
+ url: m.url
1514
1518
  });
1515
- if (x = N.response, !re()) return;
1519
+ if (x = N.response, !oe()) return;
1516
1520
  const M = N.result;
1517
- if (!re()) return;
1521
+ if (!oe()) return;
1518
1522
  if (M?.status === "invalid") {
1519
1523
  B(S, { state: "invalid", form: c, submissionKey: f, formData: _, result: M });
1520
1524
  return;
1521
1525
  }
1522
1526
  if (M?.status === "redirect") {
1523
- const L = Ut(M.location);
1524
- if (!L) {
1527
+ const P = zt(M.location);
1528
+ if (!P) {
1525
1529
  B(S, { state: "error", form: c, submissionKey: f, formData: _, response: x });
1526
1530
  return;
1527
1531
  }
1528
- if (z(), te(D), b.current = "navigation", B(S, { state: "loading", form: c, submissionKey: f, formData: _ }), G(), M.history === "replace")
1532
+ if (V(), ne(I), b.current = "navigation", B(S, { state: "loading", form: c, submissionKey: f, formData: _ }), Y(), M.history === "replace")
1529
1533
  window.history.replaceState(
1530
- we(null, P.current),
1534
+ be(null, D.current),
1531
1535
  "",
1532
- L
1536
+ P
1533
1537
  );
1534
1538
  else {
1535
- const le = ge();
1536
- window.history.pushState(le.state, "", L), P.current = le.key;
1539
+ const Z = ve();
1540
+ window.history.pushState(Z.state, "", P), D.current = Z.key;
1537
1541
  }
1538
- O.current = M.history, d.current = F(), i(d.current), C((le) => le + 1);
1542
+ O.current = M.history, d.current = F(), i(d.current), C((Z) => Z + 1);
1539
1543
  return;
1540
1544
  }
1541
1545
  if (M?.status === "failed" || !x.ok) {
1542
1546
  B(S, { state: "error", form: c, submissionKey: f, formData: _, response: x });
1543
1547
  return;
1544
1548
  }
1545
- M?.status === "success" && M.revalidate ? (B(S, { state: "loading", form: c, submissionKey: f, formData: _, result: M }), z(), b.current = "refresh", C((L) => L + 1)) : B(S, { state: "idle", form: c, submissionKey: f, result: M });
1549
+ M?.status === "success" && M.revalidate ? (B(S, { state: "loading", form: c, submissionKey: f, formData: _, result: M }), V(), b.current = "refresh", C((P) => P + 1)) : B(S, { state: "idle", form: c, submissionKey: f, result: M });
1546
1550
  } catch {
1547
- re() && B(S, { state: "error", form: c, submissionKey: f, formData: _, response: x });
1551
+ oe() && B(S, { state: "error", form: c, submissionKey: f, formData: _, response: x });
1548
1552
  } finally {
1549
- m.current.get(S) === D && m.current.delete(S);
1553
+ y.current.get(S) === I && y.current.delete(S);
1550
1554
  }
1551
1555
  }
1552
1556
  }),
1553
1557
  [H]
1554
1558
  );
1555
- return ne(() => En({
1556
- redirect(c, l, f) {
1557
- if (z(), te(f), b.current = "navigation", G(), l === "replace")
1559
+ return ie(() => Rn({
1560
+ redirect(c, u, f) {
1561
+ if (V(), ne(f), z.current = !1, b.current = "navigation", Y(), u === "replace")
1558
1562
  window.history.replaceState(
1559
- we(null, P.current),
1563
+ be(null, D.current),
1560
1564
  "",
1561
1565
  c
1562
1566
  );
1563
1567
  else {
1564
- const y = ge();
1565
- window.history.pushState(y.state, "", c), P.current = y.key;
1568
+ const m = ve();
1569
+ window.history.pushState(m.state, "", c), D.current = m.key;
1566
1570
  }
1567
- O.current = l, d.current = F(), i(d.current), C((y) => y + 1);
1571
+ O.current = u, d.current = F(), i(d.current), C((m) => m + 1);
1568
1572
  },
1569
1573
  refresh() {
1570
1574
  return new Promise((c) => {
1571
- z(), b.current = "refresh", V.current.add(c), C((l) => l + 1);
1575
+ V(), b.current = "refresh", q.current.add(c), C((u) => u + 1);
1572
1576
  });
1573
1577
  }
1574
- }), [s, e.locales, e.navigation]), R(Yt.Provider, {
1575
- value: rr,
1576
- children: R(Pt.Provider, {
1577
- value: Re,
1578
- children: R(Dn, {
1578
+ }), [s, e.locales, e.navigation]), R(Qt.Provider, {
1579
+ value: ir,
1580
+ children: R(Ft.Provider, {
1581
+ value: Me,
1582
+ children: R(Fn, {
1579
1583
  key: `${o.pathname}${o.search}`,
1580
1584
  Loading: e.loading,
1581
1585
  NotFound: e.notFound,
1582
1586
  match: v,
1583
- pendingCommit: ue,
1584
- resolvedRouteVersion: Qt,
1587
+ pendingCommit: de,
1588
+ resolvedRouteVersion: rr,
1585
1589
  onCommitted: (c) => {
1586
- nt.current === c && xe(c);
1590
+ it.current === c && Re(c);
1587
1591
  },
1588
1592
  onRenderError: () => {
1589
- xe(ue ? { ...ue, outcome: "error", title: "Navigation failed" } : null), it();
1593
+ Re(de ? { ...de, outcome: "error", title: "Navigation failed" } : null), st();
1590
1594
  },
1591
- onRouteCommitted: it
1595
+ onRouteCommitted: st
1592
1596
  })
1593
1597
  })
1594
1598
  });
1595
- function it() {
1596
- for (const c of V.current) c();
1597
- V.current.clear();
1598
- for (const [c, l] of T.current)
1599
- l.state === "loading" && T.current.set(c, {
1599
+ function st() {
1600
+ for (const c of q.current) c();
1601
+ q.current.clear();
1602
+ for (const [c, u] of T.current)
1603
+ u.state === "loading" && T.current.set(c, {
1600
1604
  state: "idle",
1601
- form: l.form,
1602
- submissionKey: l.submissionKey,
1603
- result: l.result
1605
+ form: u.form,
1606
+ submissionKey: u.submissionKey,
1607
+ result: u.result
1604
1608
  });
1605
1609
  w((c) => c + 1);
1606
1610
  }
1607
1611
  };
1608
1612
  }
1609
- function Cn(e, t) {
1610
- const r = t.getAttribute(ur);
1613
+ function In(e, t) {
1614
+ const r = t.getAttribute(hr);
1611
1615
  return e.status === "not-found" ? r === "not-found" : e.status === "ready" && r === null;
1612
1616
  }
1613
- function $n(e) {
1617
+ function Dn(e) {
1614
1618
  if (e)
1615
1619
  return e.status === "ready" ? e.match.pathname : e.status === "loading" ? void 0 : e.pathname;
1616
1620
  }
1617
- async function Vo(e) {
1621
+ async function Yo(e) {
1618
1622
  const t = e.root ?? document.getElementById("root");
1619
1623
  if (!t)
1620
1624
  throw new Error(
1621
1625
  "Demiurge expected a #root element in the framework document."
1622
1626
  );
1623
- const r = kt(e.routes), n = e.loadNavigationData ?? Kt, o = e.initialData ?? sr(document), i = await Rt(
1627
+ const r = Mt(e.routes), n = e.loadNavigationData ?? Gt, o = e.initialData ?? dr(document), i = await Ct(
1624
1628
  r,
1625
- Be(window.location.pathname, e.locales),
1629
+ ze(window.location.pathname, e.locales),
1626
1630
  new Request(window.location.href),
1627
1631
  o ?? await n(new Request(window.location.href)),
1628
1632
  void 0,
1629
1633
  { documentContributions: !1, locale: o?.locale ?? e.locale }
1630
- ), s = Cn(i, t), a = Mn(
1634
+ ), s = In(i, t), a = Ln(
1631
1635
  s ? {
1632
1636
  ...e,
1633
1637
  locale: o?.locale ?? e.locale,
@@ -1639,16 +1643,16 @@ async function Vo(e) {
1639
1643
  loadNavigationData: n,
1640
1644
  navigation: o?.navigation ?? e.navigation
1641
1645
  }
1642
- ), { createRoot: u, hydrateRoot: d } = Nn(
1646
+ ), { createRoot: l, hydrateRoot: d } = Pn(
1643
1647
  await import("react-dom/client")
1644
1648
  );
1645
- if (s && t.hasAttribute(cr)) {
1646
- d(t, R(a)), st();
1649
+ if (s && t.hasAttribute(fr)) {
1650
+ d(t, R(a)), ut();
1647
1651
  return;
1648
1652
  }
1649
- t.replaceChildren(), u(t).render(R(a)), st();
1653
+ t.replaceChildren(), l(t).render(R(a)), ut();
1650
1654
  }
1651
- function Nn(e) {
1655
+ function Pn(e) {
1652
1656
  const t = typeof e.createRoot == "function" && typeof e.hydrateRoot == "function" ? e : e.default;
1653
1657
  if (!t || typeof t.createRoot != "function" || typeof t.hydrateRoot != "function")
1654
1658
  throw new Error(
@@ -1656,65 +1660,65 @@ function Nn(e) {
1656
1660
  );
1657
1661
  return t;
1658
1662
  }
1659
- function Ln(e, t) {
1660
- const r = Ee(), {
1663
+ function On(e, t) {
1664
+ const r = xe(), {
1661
1665
  children: n,
1662
1666
  download: o,
1663
1667
  hash: i,
1664
1668
  locale: s,
1665
1669
  onClick: a,
1666
- path: u,
1670
+ path: l,
1667
1671
  reloadDocument: d,
1668
1672
  replace: v,
1669
1673
  search: A,
1670
1674
  target: h,
1671
1675
  to: p,
1672
1676
  ...E
1673
- } = e, g = Xe(e), b = s, m = r.locales && (b ?? r.locale) ? Qe(
1677
+ } = e, g = et(e), b = s, y = r.locales && (b ?? r.locale) ? tt(
1674
1678
  g,
1675
1679
  b ?? r.locale,
1676
1680
  r.locales,
1677
1681
  typeof window > "u" ? "http://demiurge.local" : window.location.href
1678
1682
  ) : g;
1679
- return /* @__PURE__ */ Et(
1683
+ return /* @__PURE__ */ kt(
1680
1684
  "a",
1681
1685
  {
1682
1686
  ...E,
1683
1687
  download: o,
1684
- href: m,
1688
+ href: y,
1685
1689
  ref: t,
1686
1690
  target: h,
1687
1691
  onClick: (T) => {
1688
- a?.(T), r.navigation === "server" && !d && zn(T, { download: o, target: h, to: m }) && (T.preventDefault(), v ? r.replace(m) : r.push(m));
1692
+ a?.(T), r.navigation === "server" && !d && Kn(T, { download: o, target: h, to: y }) && (T.preventDefault(), v ? r.replace(y) : r.push(y));
1689
1693
  },
1690
1694
  children: n
1691
1695
  }
1692
1696
  );
1693
1697
  }
1694
- function qo(e) {
1695
- return Ln(e, e.ref ?? null);
1698
+ function Zo(e) {
1699
+ return On(e, e.ref ?? null);
1696
1700
  }
1697
- const Bt = We(void 0);
1698
- function Ko(e) {
1699
- const t = Ee(), r = k(t);
1701
+ const Vt = Ge(void 0);
1702
+ function Xo(e) {
1703
+ const t = xe(), r = k(t);
1700
1704
  r.current = t;
1701
- const n = or(), o = e.submissionKey ?? n, i = k(null), s = Ht(), a = typeof e.action == "function" ? e.action : void 0, u = a ? _t(a) : void 0, d = !!(a && s && t.navigation === "server");
1702
- ne(() => () => {
1705
+ const n = sr(), o = e.submissionKey ?? n, i = k(null), s = jt(), a = typeof e.action == "function" ? e.action : void 0, l = a ? Bt(a) : void 0, d = !!(a && s && t.navigation === "server");
1706
+ ie(() => () => {
1703
1707
  i.current && r.current.releaseMutationNavigation(i.current, o);
1704
1708
  }, [o]);
1705
1709
  function v(g) {
1706
1710
  const b = e.onSubmit;
1707
1711
  if (b?.(g), a || g.defaultPrevented || t.navigation !== "server") return;
1708
- const m = g.nativeEvent.submitter;
1709
- Jt(g.currentTarget, m) && (g.preventDefault(), t.submitMutation(
1712
+ const y = g.nativeEvent.submitter;
1713
+ Zt(g.currentTarget, y) && (g.preventDefault(), t.submitMutation(
1710
1714
  g.currentTarget,
1711
- m,
1715
+ y,
1712
1716
  o
1713
1717
  ));
1714
1718
  }
1715
- const { submissionKey: A, ...h } = e, p = a ? d ? a : u?.url : h.action, E = typeof p == "string" && t.locales && (e.locale ?? t.locale) ? Qe(p, e.locale ?? t.locale, t.locales, typeof window > "u" ? "http://demiurge.local" : window.location.href) : p;
1719
+ const { submissionKey: A, ...h } = e, p = a ? d ? a : l?.url : h.action, E = typeof p == "string" && t.locales && (e.locale ?? t.locale) ? tt(p, e.locale ?? t.locale, t.locales, typeof window > "u" ? "http://demiurge.local" : window.location.href) : p;
1716
1720
  return R(
1717
- Bt.Provider,
1721
+ Vt.Provider,
1718
1722
  {
1719
1723
  value: o,
1720
1724
  children: R("form", {
@@ -1733,8 +1737,8 @@ function Ko(e) {
1733
1737
  }
1734
1738
  );
1735
1739
  }
1736
- function Wo(e) {
1737
- const t = Ee(), r = Ht(), n = _t(e.formAction), o = r && t.navigation === "server", i = t.locales && (e.locale ?? t.locale) ? Qe(n.url, e.locale ?? t.locale, t.locales, typeof window > "u" ? "http://demiurge.local" : window.location.href) : n.url;
1740
+ function Qo(e) {
1741
+ const t = xe(), r = jt(), n = Bt(e.formAction), o = r && t.navigation === "server", i = t.locales && (e.locale ?? t.locale) ? tt(n.url, e.locale ?? t.locale, t.locales, typeof window > "u" ? "http://demiurge.local" : window.location.href) : n.url;
1738
1742
  return R("button", {
1739
1743
  ...e,
1740
1744
  locale: void 0,
@@ -1742,18 +1746,18 @@ function Wo(e) {
1742
1746
  formMethod: o ? void 0 : "post"
1743
1747
  });
1744
1748
  }
1745
- function Ht() {
1749
+ function jt() {
1746
1750
  const [e, t] = U(!1);
1747
- return Y(() => t(!0), []), e;
1751
+ return X(() => t(!0), []), e;
1748
1752
  }
1749
- function In(e) {
1750
- const t = Je(Bt);
1751
- return Ee().getMutationNavigation(e?.form, e?.submissionKey ?? t);
1753
+ function _n(e) {
1754
+ const t = Ye(Vt);
1755
+ return xe().getMutationNavigation(e?.form, e?.submissionKey ?? t);
1752
1756
  }
1753
- function Jo(e) {
1754
- return In({ submissionKey: e });
1757
+ function ei(e) {
1758
+ return _n({ submissionKey: e });
1755
1759
  }
1756
- function Dn({
1760
+ function Fn({
1757
1761
  Loading: e,
1758
1762
  NotFound: t,
1759
1763
  match: r,
@@ -1764,51 +1768,51 @@ function Dn({
1764
1768
  onRouteCommitted: a
1765
1769
  }) {
1766
1770
  if (r.status === "loading") {
1767
- const m = r.loading ?? e;
1768
- return m ? R(m) : null;
1771
+ const y = r.loading ?? e;
1772
+ return y ? R(y) : null;
1769
1773
  }
1770
1774
  if (r.status === "not-found") {
1771
- const m = r.notFound ?? t ?? kr;
1772
- return R(Te, null, r.layouts.reduceRight(
1775
+ const y = r.notFound ?? t ?? Cr;
1776
+ return R(Ce, null, r.layouts.reduceRight(
1773
1777
  (T, H) => R(H, {
1774
1778
  children: T,
1775
1779
  locale: r.locale,
1776
1780
  path: {},
1777
1781
  pathname: r.pathname
1778
1782
  }),
1779
- R(m, { locale: r.locale, pathname: r.pathname })
1780
- ), R(_e, { commit: i, onCommit: o, onRouteCommitted: a, resolvedRouteVersion: s }));
1783
+ R(y, { locale: r.locale, pathname: r.pathname })
1784
+ ), R(Ue, { commit: i, onCommit: o, onRouteCommitted: a, resolvedRouteVersion: s }));
1781
1785
  }
1782
1786
  if (r.status === "error")
1783
- return R(Te, null, r.Error ? R(r.Error, {
1787
+ return R(Ce, null, r.Error ? R(r.Error, {
1784
1788
  error: r.error,
1785
1789
  locale: "locale" in r ? r.locale : void 0,
1786
1790
  pathname: r.pathname,
1787
- status: zt(r.error)
1788
- }) : null, R(_e, { commit: i, onCommit: o, onRouteCommitted: a, resolvedRouteVersion: s }));
1789
- const { data: u, error: d, locale: v, page: A, layouts: h, path: p, pathname: E } = r.match, g = R(A, { data: u, locale: v, path: p, pathname: E }), b = h.reduceRight(
1790
- (m, T) => R(T, { path: p, pathname: E, locale: v, children: m }),
1791
+ status: qt(r.error)
1792
+ }) : null, R(Ue, { commit: i, onCommit: o, onRouteCommitted: a, resolvedRouteVersion: s }));
1793
+ const { data: l, error: d, locale: v, page: A, layouts: h, path: p, pathname: E } = r.match, g = R(A, { data: l, locale: v, path: p, pathname: E }), b = h.reduceRight(
1794
+ (y, T) => R(T, { path: p, pathname: E, locale: v, children: y }),
1791
1795
  g
1792
1796
  );
1793
- return R(Pn, {
1797
+ return R(Un, {
1794
1798
  Error: d,
1795
- children: R(Te, null, b, R(_e, { commit: i, onCommit: o, onRouteCommitted: a, resolvedRouteVersion: s })),
1799
+ children: R(Ce, null, b, R(Ue, { commit: i, onCommit: o, onRouteCommitted: a, resolvedRouteVersion: s })),
1796
1800
  onError: n,
1797
1801
  pathname: E
1798
1802
  });
1799
1803
  }
1800
- function _e({
1804
+ function Ue({
1801
1805
  commit: e,
1802
1806
  onCommit: t,
1803
1807
  onRouteCommitted: r,
1804
1808
  resolvedRouteVersion: n
1805
1809
  }) {
1806
1810
  const o = k(null), i = k(0);
1807
- return ne(() => {
1811
+ return ie(() => {
1808
1812
  n > i.current && (i.current = n, r()), e && o.current !== e && (o.current = e, t(e));
1809
1813
  }, [e, t, r, n]), null;
1810
1814
  }
1811
- class Pn extends ir {
1815
+ class Un extends cr {
1812
1816
  static getDerivedStateFromError(t) {
1813
1817
  return { error: t };
1814
1818
  }
@@ -1823,12 +1827,12 @@ class Pn extends ir {
1823
1827
  return this.state.error !== void 0 ? this.props.Error ? R(this.props.Error, {
1824
1828
  error: this.state.error,
1825
1829
  pathname: this.props.pathname,
1826
- status: zt(this.state.error)
1830
+ status: qt(this.state.error)
1827
1831
  }) : null : this.props.children;
1828
1832
  }
1829
1833
  }
1830
- function zt(e) {
1831
- return Rr(e) ? e.status : 500;
1834
+ function qt(e) {
1835
+ return $r(e) ? e.status : 500;
1832
1836
  }
1833
1837
  function F() {
1834
1838
  return {
@@ -1838,43 +1842,43 @@ function F() {
1838
1842
  search: window.location.search
1839
1843
  };
1840
1844
  }
1841
- const qe = "__demiurge_scroll", Ke = "__demiurge_history_entry";
1842
- let jt = 0;
1843
- function wt() {
1844
- const e = Vt(window.history.state);
1845
+ const We = "__demiurge_scroll", Je = "__demiurge_history_entry";
1846
+ let Kt = 0;
1847
+ function bt() {
1848
+ const e = Wt(window.history.state);
1845
1849
  if (e) return e;
1846
- const t = ge(window.history.state);
1850
+ const t = ve(window.history.state);
1847
1851
  return window.history.replaceState(t.state, "", window.location.href), t.key;
1848
1852
  }
1849
- function ge(e) {
1850
- const t = `entry:${++jt}`;
1851
- return { key: t, state: we(e, t) };
1853
+ function ve(e) {
1854
+ const t = `entry:${++Kt}`;
1855
+ return { key: t, state: be(e, t) };
1852
1856
  }
1853
- function we(e, t = `entry:${++jt}`) {
1854
- return e && typeof e == "object" ? { ...e, [Ke]: t } : { [Ke]: t };
1857
+ function be(e, t = `entry:${++Kt}`) {
1858
+ return e && typeof e == "object" ? { ...e, [Je]: t } : { [Je]: t };
1855
1859
  }
1856
- function Vt(e) {
1860
+ function Wt(e) {
1857
1861
  if (!e || typeof e != "object") return;
1858
- const t = Reflect.get(e, Ke);
1862
+ const t = Reflect.get(e, Je);
1859
1863
  return typeof t == "string" ? t : void 0;
1860
1864
  }
1861
- function qt() {
1865
+ function Jt() {
1862
1866
  return { x: window.scrollX, y: window.scrollY };
1863
1867
  }
1864
- function On(e, t = qt()) {
1868
+ function Bn(e, t = Jt()) {
1865
1869
  const r = window.history.state;
1866
- if (e && Vt(r) !== e) return;
1867
- const n = r && typeof r == "object" ? { ...r, [qe]: t } : { [qe]: t };
1870
+ if (e && Wt(r) !== e) return;
1871
+ const n = r && typeof r == "object" ? { ...r, [We]: t } : { [We]: t };
1868
1872
  try {
1869
1873
  window.history.replaceState(n, "", window.location.href);
1870
1874
  } catch {
1871
1875
  }
1872
1876
  }
1873
- function _n() {
1874
- const e = window.history.state?.[qe];
1877
+ function Hn() {
1878
+ const e = window.history.state?.[We];
1875
1879
  return e && typeof e == "object" && typeof e.x == "number" && typeof e.y == "number" ? { x: e.x, y: e.y } : void 0;
1876
1880
  }
1877
- function Fn(e, t) {
1881
+ function zn(e, t) {
1878
1882
  if (t.kind === "pop" && t.url.hash || e === !1)
1879
1883
  return;
1880
1884
  if (typeof e == "function") {
@@ -1887,14 +1891,14 @@ function Fn(e, t) {
1887
1891
  const r = t.kind === "pop" ? t.position?.x ?? 0 : 0, n = t.kind === "pop" ? t.position?.y ?? 0 : 0;
1888
1892
  window.scrollTo?.(r, n);
1889
1893
  }
1890
- async function Kt(e) {
1894
+ async function Gt(e) {
1891
1895
  const t = new Headers(e.headers);
1892
- t.set("accept", "application/json"), t.set(ut, vr);
1896
+ t.set("accept", "application/json"), t.set(dt, Ar);
1893
1897
  const r = await fetch(new Request(e, {
1894
1898
  credentials: "same-origin",
1895
1899
  headers: t
1896
- })), n = r.headers.get(ut);
1897
- if (n === br) {
1900
+ })), n = r.headers.get(dt);
1901
+ if (n === xr) {
1898
1902
  const o = await r.json();
1899
1903
  if (o.hasData !== !0)
1900
1904
  throw new Error("Demiurge received malformed navigation route data.");
@@ -1906,8 +1910,8 @@ async function Kt(e) {
1906
1910
  url: r.url
1907
1911
  };
1908
1912
  }
1909
- if (n === Sr) {
1910
- const o = await vt(r);
1913
+ if (n === kr) {
1914
+ const o = await St(r);
1911
1915
  return {
1912
1916
  document: o?.document,
1913
1917
  hasData: !0,
@@ -1915,21 +1919,21 @@ async function Kt(e) {
1915
1919
  url: r.url
1916
1920
  };
1917
1921
  }
1918
- if (n === Er || !r.ok) {
1919
- const o = await vt(r), i = Ar.includes(
1922
+ if (n === Rr || !r.ok) {
1923
+ const o = await St(r), i = Tr.includes(
1920
1924
  r.status
1921
- ) ? r.status : 500, s = xr(i, {
1925
+ ) ? r.status : 500, s = Mr(i, {
1922
1926
  detail: o?.error?.detail,
1923
1927
  title: o?.error?.title
1924
1928
  });
1925
- throw o?.document && Wt.set(s, o.document), s;
1929
+ throw o?.document && Yt.set(s, o.document), s;
1926
1930
  }
1927
1931
  throw new Error(
1928
1932
  "Demiurge expected a navigation data response from the application server."
1929
1933
  );
1930
1934
  }
1931
- const Wt = /* @__PURE__ */ new WeakMap();
1932
- async function vt(e) {
1935
+ const Yt = /* @__PURE__ */ new WeakMap();
1936
+ async function St(e) {
1933
1937
  try {
1934
1938
  return await e.json();
1935
1939
  } catch (t) {
@@ -1937,16 +1941,16 @@ async function vt(e) {
1937
1941
  return;
1938
1942
  }
1939
1943
  }
1940
- function Fe(e, t) {
1944
+ function Be(e, t) {
1941
1945
  if (t) return t;
1942
1946
  if (!e) return "default";
1943
- let r = bt.get(e);
1944
- return r || (r = `form:${Un++}`, bt.set(e, r)), r;
1947
+ let r = Et.get(e);
1948
+ return r || (r = `form:${Vn++}`, Et.set(e, r)), r;
1945
1949
  }
1946
- const bt = /* @__PURE__ */ new WeakMap();
1947
- let Un = 1;
1948
- function Jt(e, t) {
1949
- const r = Gt(e, t);
1950
+ const Et = /* @__PURE__ */ new WeakMap();
1951
+ let Vn = 1;
1952
+ function Zt(e, t) {
1953
+ const r = Xt(e, t);
1950
1954
  if (!r) return !1;
1951
1955
  const { action: n, enctype: o, method: i, target: s } = r;
1952
1956
  if (!["POST", "PUT", "PATCH", "DELETE"].includes(i) || s && s.toLowerCase() !== "_self") return !1;
@@ -1957,15 +1961,15 @@ function Jt(e, t) {
1957
1961
  }
1958
1962
  return ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"].includes(o);
1959
1963
  }
1960
- function Bn(e, t) {
1961
- if (!Jt(e, t)) return;
1962
- const { action: r, enctype: n, method: o } = Gt(e, t), i = t ? new FormData(e, t) : new FormData(e);
1964
+ function jn(e, t) {
1965
+ if (!Zt(e, t)) return;
1966
+ const { action: r, enctype: n, method: o } = Xt(e, t), i = t ? new FormData(e, t) : new FormData(e);
1963
1967
  if (n === "multipart/form-data")
1964
1968
  return { body: i, contentType: void 0, formData: i, method: o, url: r };
1965
1969
  if (n === "application/x-www-form-urlencoded") {
1966
1970
  const a = new URLSearchParams();
1967
- for (const [u, d] of i)
1968
- typeof d == "string" ? a.append(u, d) : a.append(u, d.name);
1971
+ for (const [l, d] of i)
1972
+ typeof d == "string" ? a.append(l, d) : a.append(l, d.name);
1969
1973
  return {
1970
1974
  body: a,
1971
1975
  contentType: "application/x-www-form-urlencoded;charset=UTF-8",
@@ -1975,8 +1979,8 @@ function Bn(e, t) {
1975
1979
  };
1976
1980
  }
1977
1981
  const s = [];
1978
- for (const [a, u] of i)
1979
- s.push(`${a}=${typeof u == "string" ? u : u.name}`);
1982
+ for (const [a, l] of i)
1983
+ s.push(`${a}=${typeof l == "string" ? l : l.name}`);
1980
1984
  return {
1981
1985
  body: `${s.join(`\r
1982
1986
  `)}\r
@@ -1987,23 +1991,23 @@ function Bn(e, t) {
1987
1991
  url: r
1988
1992
  };
1989
1993
  }
1990
- function Gt(e, t) {
1991
- if (!Hn(t)) return;
1994
+ function Xt(e, t) {
1995
+ if (!qn(t)) return;
1992
1996
  const r = t instanceof HTMLButtonElement || t instanceof HTMLInputElement ? t : void 0;
1993
1997
  return {
1994
- action: (he(r, "formaction") ?? e.action) || window.location.href,
1995
- enctype: ((he(r, "formenctype") ?? e.enctype) || "application/x-www-form-urlencoded").toLowerCase(),
1996
- method: ((he(r, "formmethod") ?? e.method) || "get").toUpperCase(),
1997
- target: he(r, "formtarget") ?? e.target
1998
+ action: (me(r, "formaction") ?? e.action) || window.location.href,
1999
+ enctype: ((me(r, "formenctype") ?? e.enctype) || "application/x-www-form-urlencoded").toLowerCase(),
2000
+ method: ((me(r, "formmethod") ?? e.method) || "get").toUpperCase(),
2001
+ target: me(r, "formtarget") ?? e.target
1998
2002
  };
1999
2003
  }
2000
- function he(e, t) {
2004
+ function me(e, t) {
2001
2005
  return e?.hasAttribute(t) ? e.getAttribute(t) ?? "" : void 0;
2002
2006
  }
2003
- function Hn(e) {
2007
+ function qn(e) {
2004
2008
  return e ? e instanceof HTMLButtonElement ? !e.disabled && e.type === "submit" : e instanceof HTMLInputElement && !e.disabled && e.type === "submit" : !0;
2005
2009
  }
2006
- function pe(e) {
2010
+ function ye(e) {
2007
2011
  queueMicrotask(() => {
2008
2012
  if (!e) {
2009
2013
  window.scrollTo?.(0, 0);
@@ -2018,13 +2022,13 @@ function pe(e) {
2018
2022
  document.getElementById(t)?.scrollIntoView?.();
2019
2023
  });
2020
2024
  }
2021
- function zn(e, t) {
2025
+ function Kn(e, t) {
2022
2026
  if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.altKey || e.ctrlKey || e.shiftKey || t.download !== void 0 && t.download !== !1 || t.target !== void 0 && t.target.toLowerCase() !== "_self")
2023
2027
  return !1;
2024
2028
  const r = new URL(t.to, window.location.href);
2025
2029
  return (r.protocol === "http:" || r.protocol === "https:") && r.origin === window.location.origin;
2026
2030
  }
2027
- function jn(e, t) {
2031
+ function Wn(e, t) {
2028
2032
  const r = t?.announce ?? "title";
2029
2033
  if (r === !1) return;
2030
2034
  let n;
@@ -2033,12 +2037,26 @@ function jn(e, t) {
2033
2037
  } catch {
2034
2038
  return;
2035
2039
  }
2036
- n && Vn(n);
2040
+ n && Jn(n);
2041
+ }
2042
+ function Jn(e) {
2043
+ pr(e);
2037
2044
  }
2038
- function Vn(e) {
2039
- lr(e);
2045
+ function At(e) {
2046
+ return e === !0 && !window.matchMedia?.("(prefers-reduced-motion: reduce)").matches && typeof document.startViewTransition == "function";
2040
2047
  }
2041
- const Yt = We({
2048
+ function Gn(e) {
2049
+ if (typeof document.startViewTransition != "function") {
2050
+ e();
2051
+ return;
2052
+ }
2053
+ try {
2054
+ document.startViewTransition(() => ur(e));
2055
+ } catch {
2056
+ e();
2057
+ }
2058
+ }
2059
+ const Qt = Ge({
2042
2060
  navigation: "document",
2043
2061
  submissionVersion: 0,
2044
2062
  push(e) {
@@ -2056,12 +2074,12 @@ const Yt = We({
2056
2074
  window.location.replace(e);
2057
2075
  }
2058
2076
  });
2059
- function Ee() {
2060
- return Je(Yt);
2077
+ function xe() {
2078
+ return Ye(Qt);
2061
2079
  }
2062
- function Go({ className: e, id: t, policy: r, ...n }) {
2063
- const o = Mr(n, r);
2064
- return /* @__PURE__ */ Et(
2080
+ function ti({ className: e, id: t, policy: r, ...n }) {
2081
+ const o = Lr(n, r);
2082
+ return /* @__PURE__ */ kt(
2065
2083
  "img",
2066
2084
  {
2067
2085
  alt: o.alt,
@@ -2078,14 +2096,14 @@ function Go({ className: e, id: t, policy: r, ...n }) {
2078
2096
  }
2079
2097
  );
2080
2098
  }
2081
- const qn = "https://js.sentry-cdn.com", Yo = {
2099
+ const Yn = "https://js.sentry-cdn.com", ri = {
2082
2100
  /**
2083
2101
  * Plausible loads one script and posts events to its own API. The snippet
2084
2102
  * carries configuration in `data-domain`, so no inline code is involved.
2085
2103
  * `endpoint` accepts a same-origin path prefix for a proxied deployment.
2086
2104
  */
2087
2105
  plausible(e) {
2088
- const t = Kn(e.domain), r = St(e.endpoint ?? "https://plausible.io");
2106
+ const t = Zn(e.domain), r = xt(e.endpoint ?? "https://plausible.io");
2089
2107
  return {
2090
2108
  consent: e.consent ?? !1,
2091
2109
  domain: t,
@@ -2096,7 +2114,7 @@ const qn = "https://js.sentry-cdn.com", Yo = {
2096
2114
  },
2097
2115
  provider: "plausible",
2098
2116
  scripts: [
2099
- Me({
2117
+ $e({
2100
2118
  dataApi: `${r.base}/api/event`,
2101
2119
  dataDomain: t,
2102
2120
  defer: !0,
@@ -2114,8 +2132,8 @@ const qn = "https://js.sentry-cdn.com", Yo = {
2114
2132
  * why the integration also declares a `connect-src` need.
2115
2133
  */
2116
2134
  sentry(e) {
2117
- const t = Gn(e.dsn), r = Jn(
2118
- e.loaderHost ?? qn,
2135
+ const t = eo(e.dsn), r = Qn(
2136
+ e.loaderHost ?? Yn,
2119
2137
  "Sentry loader host"
2120
2138
  );
2121
2139
  return {
@@ -2129,7 +2147,7 @@ const qn = "https://js.sentry-cdn.com", Yo = {
2129
2147
  projectId: t.projectId,
2130
2148
  provider: "sentry",
2131
2149
  scripts: [
2132
- Me({
2150
+ $e({
2133
2151
  crossOrigin: "anonymous",
2134
2152
  needs: { connect: [t.origin] },
2135
2153
  purpose: "error-monitoring",
@@ -2148,7 +2166,7 @@ const qn = "https://js.sentry-cdn.com", Yo = {
2148
2166
  * to, and an optional same-origin entry script that starts the SDK.
2149
2167
  */
2150
2168
  openTelemetry(e) {
2151
- const t = St(e.endpoint), r = e.script;
2169
+ const t = xt(e.endpoint), r = e.script;
2152
2170
  if (r !== void 0 && !r.startsWith("/"))
2153
2171
  throw new Error(
2154
2172
  "OpenTelemetry browser instrumentation must be a same-origin script path."
@@ -2160,7 +2178,7 @@ const qn = "https://js.sentry-cdn.com", Yo = {
2160
2178
  needs: r ? { connect: [t.source], script: ["'self'"] } : { connect: [t.source] },
2161
2179
  provider: "opentelemetry",
2162
2180
  scripts: r ? [
2163
- Me({
2181
+ $e({
2164
2182
  needs: { connect: [t.source] },
2165
2183
  purpose: "observability",
2166
2184
  src: r,
@@ -2184,13 +2202,13 @@ const qn = "https://js.sentry-cdn.com", Yo = {
2184
2202
  return e.flatMap((t) => [...t.scripts]);
2185
2203
  }
2186
2204
  };
2187
- function Kn(e) {
2205
+ function Zn(e) {
2188
2206
  const t = e.trim();
2189
2207
  if (!t || t.includes("/") || t.includes(" "))
2190
2208
  throw new Error("Analytics domain must be a hostname without a path.");
2191
2209
  return t;
2192
2210
  }
2193
- function St(e) {
2211
+ function xt(e) {
2194
2212
  if (e.startsWith("/")) {
2195
2213
  if (e.startsWith("//"))
2196
2214
  throw new Error("Analytics endpoint must not be a scheme-relative URL.");
@@ -2199,10 +2217,10 @@ function St(e) {
2199
2217
  source: "'self'"
2200
2218
  };
2201
2219
  }
2202
- const t = Wn(e);
2220
+ const t = Xn(e);
2203
2221
  return { base: t.origin, source: t.origin };
2204
2222
  }
2205
- function Wn(e) {
2223
+ function Xn(e) {
2206
2224
  let t;
2207
2225
  try {
2208
2226
  t = new URL(e);
@@ -2213,7 +2231,7 @@ function Wn(e) {
2213
2231
  throw new Error("Analytics endpoint must use HTTPS.");
2214
2232
  return t;
2215
2233
  }
2216
- function Jn(e, t) {
2234
+ function Qn(e, t) {
2217
2235
  let r;
2218
2236
  try {
2219
2237
  r = new URL(e);
@@ -2224,7 +2242,7 @@ function Jn(e, t) {
2224
2242
  throw new Error(`${t} must use HTTPS.`);
2225
2243
  return r.origin;
2226
2244
  }
2227
- function Gn(e) {
2245
+ function eo(e) {
2228
2246
  let t;
2229
2247
  try {
2230
2248
  t = new URL(e);
@@ -2246,60 +2264,60 @@ function Gn(e) {
2246
2264
  publicKey: t.username
2247
2265
  };
2248
2266
  }
2249
- function Zo(e = {}) {
2267
+ function ni(e = {}) {
2250
2268
  return {
2251
2269
  async request(t) {
2252
- await me({ kind: "request", signal: t }, e);
2270
+ await ge({ kind: "request", signal: t }, e);
2253
2271
  },
2254
2272
  async serverStart(t = {}) {
2255
- await me({ kind: "server-start", signal: t }, e);
2273
+ await ge({ kind: "server-start", signal: t }, e);
2256
2274
  },
2257
2275
  async trace(t) {
2258
- await me({ kind: "trace", signal: t }, e);
2276
+ await ge({ kind: "trace", signal: t }, e);
2259
2277
  },
2260
2278
  async reportWebVitals(t) {
2261
- await me({ kind: "web-vital", signal: t }, e);
2279
+ await ge({ kind: "web-vital", signal: t }, e);
2262
2280
  }
2263
2281
  };
2264
2282
  }
2265
- async function me(e, t) {
2283
+ async function ge(e, t) {
2266
2284
  await t.onEvent?.(e), e.kind === "request" ? await t.request?.(e.signal) : e.kind === "server-start" ? await t.serverStart?.(e.signal) : e.kind === "trace" ? await t.trace?.(e.signal) : await t.webVitals?.(e.signal);
2267
2285
  }
2268
- const Yn = [
2286
+ const to = [
2269
2287
  "CLS",
2270
2288
  "FCP",
2271
2289
  "FID",
2272
2290
  "INP",
2273
2291
  "LCP",
2274
2292
  "TTFB"
2275
- ], Ue = [
2293
+ ], He = [
2276
2294
  "CLS",
2277
2295
  "FCP",
2278
2296
  "INP",
2279
2297
  "LCP",
2280
2298
  "TTFB"
2281
- ], Zn = new Set(Yn), Xn = /* @__PURE__ */ new Set([
2299
+ ], ro = new Set(to), no = /* @__PURE__ */ new Set([
2282
2300
  "back-forward",
2283
2301
  "back-forward-cache",
2284
2302
  "navigate",
2285
2303
  "prerender",
2286
2304
  "reload",
2287
2305
  "restore"
2288
- ]), Qn = /* @__PURE__ */ new Set([
2306
+ ]), oo = /* @__PURE__ */ new Set([
2289
2307
  "good",
2290
2308
  "needs-improvement",
2291
2309
  "poor"
2292
2310
  ]);
2293
- function eo(e) {
2294
- return typeof e == "string" && Zn.has(e);
2311
+ function io(e) {
2312
+ return typeof e == "string" && ro.has(e);
2295
2313
  }
2296
- function to(e) {
2297
- return typeof e == "string" && Xn.has(e);
2314
+ function ao(e) {
2315
+ return typeof e == "string" && no.has(e);
2298
2316
  }
2299
- function ro(e) {
2300
- return typeof e == "string" && Qn.has(e);
2317
+ function so(e) {
2318
+ return typeof e == "string" && oo.has(e);
2301
2319
  }
2302
- const no = {
2320
+ const co = {
2303
2321
  CLS: { good: 0.1, poor: 0.25 },
2304
2322
  FCP: { good: 1800, poor: 3e3 },
2305
2323
  FID: { good: 100, poor: 300 },
@@ -2307,13 +2325,13 @@ const no = {
2307
2325
  LCP: { good: 2500, poor: 4e3 },
2308
2326
  TTFB: { good: 800, poor: 1800 }
2309
2327
  };
2310
- function oo(e, t) {
2311
- const r = no[e];
2328
+ function uo(e, t) {
2329
+ const r = co[e];
2312
2330
  return t <= r.good ? "good" : t > r.poor ? "poor" : "needs-improvement";
2313
2331
  }
2314
- const Zt = 32;
2315
- function Xo(e) {
2316
- const t = so(e.endpoint), r = co(e.metrics), n = uo(e.sampleRate);
2332
+ const er = 32;
2333
+ function oi(e) {
2334
+ const t = ho(e.endpoint), r = po(e.metrics), n = mo(e.sampleRate);
2317
2335
  return {
2318
2336
  endpoint: t.url,
2319
2337
  kind: "web-vitals",
@@ -2322,45 +2340,45 @@ function Xo(e) {
2322
2340
  sampleRate: n
2323
2341
  };
2324
2342
  }
2325
- function Qo(...e) {
2343
+ function ii(...e) {
2326
2344
  const t = /* @__PURE__ */ new Set();
2327
2345
  for (const r of e)
2328
2346
  for (const n of r.needs.connect ?? [])
2329
2347
  t.add(n);
2330
2348
  return t.size === 0 ? { security: { needs: {} } } : { security: { needs: { connect: [...t] } } };
2331
2349
  }
2332
- async function ei(e, t = {}) {
2333
- const r = t.maxMetrics ?? Zt;
2350
+ async function ai(e, t = {}) {
2351
+ const r = t.maxMetrics ?? er;
2334
2352
  let n;
2335
2353
  try {
2336
2354
  n = await e.json();
2337
2355
  } catch {
2338
2356
  return { ok: !1, reason: "unreadable-body" };
2339
2357
  }
2340
- return io(n, r);
2358
+ return lo(n, r);
2341
2359
  }
2342
- function io(e, t = Zt) {
2343
- if (!Ze(e) || !Array.isArray(e.metrics))
2360
+ function lo(e, t = er) {
2361
+ if (!Qe(e) || !Array.isArray(e.metrics))
2344
2362
  return { ok: !1, reason: "invalid-payload" };
2345
2363
  if (e.metrics.length > t)
2346
2364
  return { ok: !1, reason: "too-many-metrics" };
2347
2365
  const r = [];
2348
2366
  for (const n of e.metrics) {
2349
- const o = ao(n);
2367
+ const o = fo(n);
2350
2368
  if (!o)
2351
2369
  return { ok: !1, reason: "invalid-payload" };
2352
2370
  r.push(o);
2353
2371
  }
2354
2372
  return { metrics: r, ok: !0 };
2355
2373
  }
2356
- function ao(e) {
2357
- if (!Ze(e))
2374
+ function fo(e) {
2375
+ if (!Qe(e))
2358
2376
  return;
2359
2377
  const { id: t, name: r, navigationType: n, rating: o, url: i, value: s } = e;
2360
- if (!(typeof t != "string" || t.length === 0 || t.length > 128) && !(!eo(r) || !to(n)) && ro(o) && !(typeof i != "string" || i.length === 0 || i.length > 2048) && !(typeof s != "number" || !Number.isFinite(s) || s < 0))
2378
+ if (!(typeof t != "string" || t.length === 0 || t.length > 128) && !(!io(r) || !ao(n)) && so(o) && !(typeof i != "string" || i.length === 0 || i.length > 2048) && !(typeof s != "number" || !Number.isFinite(s) || s < 0))
2361
2379
  return { id: t, name: r, navigationType: n, rating: o, url: i, value: s };
2362
2380
  }
2363
- function so(e) {
2381
+ function ho(e) {
2364
2382
  if (e.startsWith("/")) {
2365
2383
  if (e.startsWith("//"))
2366
2384
  throw new Error(
@@ -2380,14 +2398,14 @@ function so(e) {
2380
2398
  throw new Error("The web vitals endpoint must use HTTPS.");
2381
2399
  return { source: t.origin, url: t.href };
2382
2400
  }
2383
- function co(e) {
2401
+ function po(e) {
2384
2402
  if (!e)
2385
- return Ue;
2403
+ return He;
2386
2404
  const t = [];
2387
2405
  for (const r of e) {
2388
- if (!Ue.includes(r))
2406
+ if (!He.includes(r))
2389
2407
  throw new Error(
2390
- `The browser collector does not measure ${JSON.stringify(r)}. Demiurge collects ${Ue.join(", ")}.`
2408
+ `The browser collector does not measure ${JSON.stringify(r)}. Demiurge collects ${He.join(", ")}.`
2391
2409
  );
2392
2410
  t.includes(r) || t.push(r);
2393
2411
  }
@@ -2395,15 +2413,15 @@ function co(e) {
2395
2413
  throw new Error("A web vitals integration must collect one metric or more.");
2396
2414
  return t;
2397
2415
  }
2398
- function uo(e) {
2416
+ function mo(e) {
2399
2417
  if (e === void 0)
2400
2418
  return 1;
2401
2419
  if (!Number.isFinite(e) || e < 0 || e > 1)
2402
2420
  throw new Error("The web vitals sample rate must be between 0 and 1.");
2403
2421
  return e;
2404
2422
  }
2405
- const lo = 1e3, fo = 5e3, ho = 40;
2406
- function po(e, t = {}) {
2423
+ const yo = 1e3, go = 5e3, wo = 40;
2424
+ function vo(e, t = {}) {
2407
2425
  if (typeof window > "u" || typeof PerformanceObserver > "u")
2408
2426
  return () => {
2409
2427
  };
@@ -2411,8 +2429,8 @@ function po(e, t = {}) {
2411
2429
  if (e.sampleRate < 1 && r() >= e.sampleRate)
2412
2430
  return () => {
2413
2431
  };
2414
- const n = t.transport ?? mo, o = new Set(e.metrics), i = [], s = [], a = /* @__PURE__ */ new Set();
2415
- let u = yo(), d = 0, v = 0, A = 0, h = 0, p, E, g = !1;
2432
+ const n = t.transport ?? bo, o = new Set(e.metrics), i = [], s = [], a = /* @__PURE__ */ new Set();
2433
+ let l = So(), d = 0, v = 0, A = 0, h = 0, p, E, g = !1;
2416
2434
  const b = (w, $) => {
2417
2435
  if (g || a.has(w))
2418
2436
  return;
@@ -2420,68 +2438,68 @@ function po(e, t = {}) {
2420
2438
  const C = {
2421
2439
  id: `${w}-${Date.now()}-${Math.floor(r() * 1e9)}`,
2422
2440
  name: w,
2423
- navigationType: u,
2424
- rating: oo(w, $),
2441
+ navigationType: l,
2442
+ rating: uo(w, $),
2425
2443
  url: window.location.href,
2426
2444
  value: Math.round($ * 1e3) / 1e3
2427
2445
  };
2428
2446
  s.push(C), t.onReport?.(C);
2429
- }, m = () => {
2447
+ }, y = () => {
2430
2448
  if (g || (p !== void 0 && b("LCP", p), E !== void 0 && b("INP", E), o.has("CLS") && b("CLS", d), s.length === 0))
2431
2449
  return;
2432
2450
  const w = s.splice(0, s.length);
2433
2451
  n(e.endpoint, { metrics: w });
2434
2452
  }, T = () => {
2435
- document.visibilityState === "hidden" && m();
2453
+ document.visibilityState === "hidden" && y();
2436
2454
  }, H = (w) => {
2437
- w.persisted && (u = "back-forward-cache", a.clear(), d = 0, v = 0, A = 0, h = 0, p = void 0, E = void 0, o.has("FCP") && b("FCP", performance.now() - w.timeStamp));
2455
+ w.persisted && (l = "back-forward-cache", a.clear(), d = 0, v = 0, A = 0, h = 0, p = void 0, E = void 0, o.has("FCP") && b("FCP", performance.now() - w.timeStamp));
2438
2456
  };
2439
2457
  if (o.has("TTFB")) {
2440
- const w = Xt();
2458
+ const w = tr();
2441
2459
  w && w.responseStart > 0 && b("TTFB", w.responseStart);
2442
2460
  }
2443
- return o.has("FCP") && ye(i, { buffered: !0, type: "paint" }, (w) => {
2461
+ return o.has("FCP") && we(i, { buffered: !0, type: "paint" }, (w) => {
2444
2462
  for (const $ of w)
2445
2463
  $.name === "first-contentful-paint" && b("FCP", $.startTime);
2446
- }), o.has("LCP") && ye(
2464
+ }), o.has("LCP") && we(
2447
2465
  i,
2448
2466
  { buffered: !0, type: "largest-contentful-paint" },
2449
2467
  (w) => {
2450
2468
  const $ = w.at(-1);
2451
2469
  $ && (p = $.startTime);
2452
2470
  }
2453
- ), o.has("CLS") && ye(i, { buffered: !0, type: "layout-shift" }, (w) => {
2471
+ ), o.has("CLS") && we(i, { buffered: !0, type: "layout-shift" }, (w) => {
2454
2472
  for (const $ of w) {
2455
2473
  const C = $;
2456
2474
  if (C.hadRecentInput)
2457
2475
  continue;
2458
- v > 0 && C.startTime - h < lo && C.startTime - A < fo ? v += C.value : (v = C.value, A = C.startTime), h = C.startTime, d = Math.max(d, v);
2476
+ v > 0 && C.startTime - h < yo && C.startTime - A < go ? v += C.value : (v = C.value, A = C.startTime), h = C.startTime, d = Math.max(d, v);
2459
2477
  }
2460
- }), o.has("INP") && ye(
2478
+ }), o.has("INP") && we(
2461
2479
  i,
2462
2480
  {
2463
2481
  buffered: !0,
2464
- durationThreshold: ho,
2482
+ durationThreshold: wo,
2465
2483
  type: "event"
2466
2484
  },
2467
2485
  (w) => {
2468
2486
  for (const $ of w)
2469
2487
  E = Math.max(E ?? 0, $.duration);
2470
2488
  }
2471
- ), document.addEventListener("visibilitychange", T), window.addEventListener("pagehide", m), window.addEventListener("pageshow", H), () => {
2472
- m(), g = !0;
2489
+ ), document.addEventListener("visibilitychange", T), window.addEventListener("pagehide", y), window.addEventListener("pageshow", H), () => {
2490
+ y(), g = !0;
2473
2491
  for (const w of i)
2474
2492
  w.disconnect();
2475
- document.removeEventListener("visibilitychange", T), window.removeEventListener("pagehide", m), window.removeEventListener("pageshow", H);
2493
+ document.removeEventListener("visibilitychange", T), window.removeEventListener("pagehide", y), window.removeEventListener("pageshow", H);
2476
2494
  };
2477
2495
  }
2478
- function ti({ integration: e, onReport: t, transport: r }) {
2479
- return Y(
2480
- () => po(e, { onReport: t, transport: r }),
2496
+ function si({ integration: e, onReport: t, transport: r }) {
2497
+ return X(
2498
+ () => vo(e, { onReport: t, transport: r }),
2481
2499
  [e, t, r]
2482
2500
  ), null;
2483
2501
  }
2484
- function mo(e, t) {
2502
+ function bo(e, t) {
2485
2503
  const r = JSON.stringify(t);
2486
2504
  if (typeof navigator < "u" && typeof navigator.sendBeacon == "function") {
2487
2505
  const n = new Blob([r], { type: "application/json" });
@@ -2496,7 +2514,7 @@ function mo(e, t) {
2496
2514
  }).catch(() => {
2497
2515
  });
2498
2516
  }
2499
- function ye(e, t, r) {
2517
+ function we(e, t, r) {
2500
2518
  try {
2501
2519
  const n = new PerformanceObserver((o) => r(o.getEntries()));
2502
2520
  n.observe(t), e.push(n);
@@ -2504,204 +2522,204 @@ function ye(e, t, r) {
2504
2522
  return;
2505
2523
  }
2506
2524
  }
2507
- function Xt() {
2525
+ function tr() {
2508
2526
  if (!(typeof performance > "u"))
2509
2527
  return performance.getEntriesByType("navigation")[0];
2510
2528
  }
2511
- function yo() {
2512
- const e = Xt();
2529
+ function So() {
2530
+ const e = tr();
2513
2531
  return e?.type === "back_forward" ? "back-forward" : e?.type === "reload" || e?.type === "prerender" ? e.type : "navigate";
2514
2532
  }
2515
2533
  export {
2516
- Ue as COLLECTED_WEB_VITAL_NAMES,
2517
- yi as CacheNotFoundError,
2518
- Za as DEFAULT_CONTENT_TYPE,
2519
- gi as DEFAULT_MAX_BODY_SIZE,
2520
- wi as EnvValidationError,
2521
- oi as FRAMEWORK_TRUSTED_TYPES_POLICY,
2522
- Ko as Form,
2523
- Ar as HTTP_ERROR_STATUSES,
2524
- vi as HttpError,
2525
- Go as Image,
2526
- qo as Link,
2527
- mr as MUTATION_REQUEST_HEADER,
2528
- pr as MUTATION_REQUEST_VALUE,
2529
- xt as MUTATION_RESPONSE_MEDIA_TYPE,
2530
- Wo as MutationSubmit,
2531
- bi as MutationValidationError,
2532
- zo as RouteFocusBoundary,
2533
- Si as RouteSerializationError,
2534
- ii as Script,
2535
- rn as SessionStoreConflictError,
2536
- mt as SessionStoreUnavailableError,
2537
- Yn as WEB_VITAL_NAMES,
2538
- no as WEB_VITAL_THRESHOLDS,
2539
- ti as WebVitals,
2540
- Yo as analytics,
2541
- Be as applicationPathname,
2542
- Ei as applyFetchMetadataVary,
2543
- Ai as applyLocalizedMetadata,
2544
- ai as assertAdapterCapabilities,
2545
- xi as attachExceptionSource,
2546
- ki as auditScriptDependencies,
2547
- Ri as authorizeRoute,
2548
- Ti as cacheNotFound,
2549
- si as checkAdapterCapabilities,
2550
- Mi as checkFetchMetadata,
2551
- wn as checkWebSocketOrigin,
2552
- po as collectWebVitals,
2553
- Xa as contentTypeForExtension,
2554
- Ci as createCache,
2555
- $i as createCorsHeaders,
2556
- Ni as createCsrfCookie,
2557
- Li as createCsrfToken,
2558
- _o as createEncryptedCookieSession,
2559
- Mn as createFileRouter,
2560
- ci as createFrameworkScriptUrl,
2561
- Ii as createInvalidation,
2562
- Di as createMemoryCache,
2563
- Pi as createMemoryCacheStore,
2564
- $o as createMemoryIdempotencyStore,
2565
- Oi as createMemoryRateLimitStore,
2566
- Es as createMemorySessionStore,
2567
- An as createMutationAction,
2568
- _i as createRequestHandler,
2569
- Se as createSecureCookie,
2570
- Fi as createSecurityAudit,
2571
- Ui as createSecurityHeaders,
2572
- Uo as createSecurityReportHandler,
2573
- Fo as createSessionManager,
2574
- Oo as createSignedCookieSession,
2575
- Bi as cspHash,
2576
- Hi as cspNonce,
2577
- ss as defaultFontPath,
2578
- ui as defineAdapter,
2579
- zi as defineAuthorization,
2580
- ji as defineEnvSchema,
2581
- cs as defineFonts,
2582
- us as defineImages,
2583
- Zo as defineInstrumentation,
2584
- ts as defineLinks,
2585
- Vi as defineLocales,
2586
- qi as defineMetadata,
2587
- Io as defineMiddleware,
2588
- To as defineOgImage,
2589
- Ro as defineRobots,
2590
- Ki as defineRoutePolicy,
2591
- li as defineScripts,
2592
- Wi as defineSecurityPolicy,
2593
- xo as defineSitemap,
2594
- Ji as defineTags,
2595
- Xo as defineWebVitals,
2596
- Gi as deserializeEnvSchema,
2597
- Yi as enforceAllowedMethods,
2598
- Zi as enforceCsrfProtection,
2599
- Xi as enforceFetchMetadataPolicy,
2600
- Qi as enforceRateLimit,
2601
- ea as enforceRequestSecurity,
2602
- Ho as enforceWebSocketOrigin,
2603
- ta as env,
2604
- ls as font,
2605
- ds as fontAssetFileName,
2606
- fs as fontAssetUrl,
2607
- hs as fontLinks,
2608
- ps as fontMediaType,
2609
- ms as fontPreloadLinks,
2610
- ys as fontSources,
2611
- gs as fontStylesheetUrl,
2612
- ra as getBodySizeException,
2613
- na as getCspException,
2614
- oa as getCsrfException,
2615
- di as getRequestClientAddress,
2616
- fi as getScriptWorker,
2617
- ia as handleRequestWithManifest,
2618
- Xe as href,
2619
- aa as html,
2620
- xr as httpError,
2621
- Vo as hydrateFileRouter,
2622
- ws as isAllowedImageSource,
2623
- sa as isCacheNotFoundError,
2624
- Qa as isContentHashedFileName,
2625
- Rr as isHttpError,
2626
- ca as isSecurityException,
2627
- ua as issueCsrfToken,
2628
- la as json,
2629
- da as jsonl,
2630
- fa as link,
2631
- ha as localeDirection,
2632
- Qe as localizeHref,
2633
- pa as mergeRouteAccess,
2634
- ma as mergeRoutePolicies,
2635
- ya as mergeRouteSecurityPolicies,
2636
- ga as mergeSecurityPolicies,
2637
- wa as meta,
2638
- rs as modulePreload,
2639
- va as mutation,
2640
- ba as mutationInput,
2641
- Sa as notFound,
2642
- Lo as page,
2643
- Ye as parseBodySize,
2644
- ct as parseCacheDuration,
2645
- Ge as parseCookieHeader,
2646
- vs as parseImageOptimizerRequest,
2647
- Ea as parseRateLimitWindow,
2648
- io as parseWebVitalsBeacon,
2649
- Aa as permitsRequest,
2650
- Mr as planImageTransform,
2651
- ns as preconnect,
2652
- os as preload,
2653
- xa as query,
2654
- ka as readEnv,
2655
- Po as readSecureCookie,
2656
- ei as readWebVitalsBeacon,
2657
- Ra as redirect,
2658
- bs as renderFontFaceCss,
2659
- Co as renderOgImageResponse,
2660
- $r as renderOgImageSvg,
2661
- hi as renderPageResponse,
2662
- Mo as renderRobots,
2663
- ko as renderSitemap,
2664
- Ta as resolveCsp,
2665
- Ma as resolveCsrf,
2666
- is as resolveLinks,
2667
- gr as resolveLocale,
2668
- Ca as resolveMaxBodySize,
2669
- $a as resolveMetadata,
2670
- Na as resolveRouteAccess,
2671
- pi as resolveScripts,
2672
- La as response,
2673
- No as runIdempotentMutation,
2674
- Me as script,
2675
- ce as secureCookieName,
2676
- Ia as security,
2677
- mo as sendWebVitalsBeacon,
2678
- dr as serializeCacheKey,
2679
- Da as serializeCacheNamespace,
2680
- Pa as serializeCacheTag,
2681
- Oa as serializeEnvSchema,
2682
- As as serializeSessionNamespace,
2683
- _a as serverTiming,
2684
- Fa as sse,
2685
- st as startDeferredScripts,
2686
- Ua as stream,
2687
- Ba as structuredData,
2688
- Ha as tag,
2689
- za as text,
2690
- ja as toResponse,
2691
- Va as unstable_resetEnvironment,
2692
- qa as unstable_startEnvironment,
2693
- Jo as useFormNavigation,
2694
- jo as useMutationAction,
2695
- In as useNavigation,
2696
- Sn as useRouteFocusBoundary,
2697
- Ka as validateCorsPolicy,
2698
- Wa as validateEnv,
2699
- Ja as validateRateLimitPolicy,
2700
- Ga as validateRouteModules,
2701
- Vr as validateSecureCookie,
2702
- Bo as validateUploads,
2703
- oo as webVitalRating,
2704
- Qo as webVitalsPolicy,
2705
- Do as webhook
2534
+ He as COLLECTED_WEB_VITAL_NAMES,
2535
+ Ei as CacheNotFoundError,
2536
+ ns as DEFAULT_CONTENT_TYPE,
2537
+ Ai as DEFAULT_MAX_BODY_SIZE,
2538
+ xi as EnvValidationError,
2539
+ li as FRAMEWORK_TRUSTED_TYPES_POLICY,
2540
+ Xo as Form,
2541
+ Tr as HTTP_ERROR_STATUSES,
2542
+ ki as HttpError,
2543
+ ti as Image,
2544
+ Zo as Link,
2545
+ vr as MUTATION_REQUEST_HEADER,
2546
+ wr as MUTATION_REQUEST_VALUE,
2547
+ Tt as MUTATION_RESPONSE_MEDIA_TYPE,
2548
+ Qo as MutationSubmit,
2549
+ Ri as MutationValidationError,
2550
+ Jo as RouteFocusBoundary,
2551
+ Ti as RouteSerializationError,
2552
+ di as Script,
2553
+ sn as SessionStoreConflictError,
2554
+ gt as SessionStoreUnavailableError,
2555
+ to as WEB_VITAL_NAMES,
2556
+ co as WEB_VITAL_THRESHOLDS,
2557
+ si as WebVitals,
2558
+ ri as analytics,
2559
+ ze as applicationPathname,
2560
+ Mi as applyFetchMetadataVary,
2561
+ Ci as applyLocalizedMetadata,
2562
+ fi as assertAdapterCapabilities,
2563
+ $i as attachExceptionSource,
2564
+ Ni as auditScriptDependencies,
2565
+ Li as authorizeRoute,
2566
+ Ii as cacheNotFound,
2567
+ hi as checkAdapterCapabilities,
2568
+ Di as checkFetchMetadata,
2569
+ En as checkWebSocketOrigin,
2570
+ vo as collectWebVitals,
2571
+ os as contentTypeForExtension,
2572
+ Pi as createCache,
2573
+ Oi as createCorsHeaders,
2574
+ _i as createCsrfCookie,
2575
+ Fi as createCsrfToken,
2576
+ Vo as createEncryptedCookieSession,
2577
+ Ln as createFileRouter,
2578
+ pi as createFrameworkScriptUrl,
2579
+ Ui as createInvalidation,
2580
+ Bi as createMemoryCache,
2581
+ Hi as createMemoryCacheStore,
2582
+ Oo as createMemoryIdempotencyStore,
2583
+ zi as createMemoryRateLimitStore,
2584
+ Ms as createMemorySessionStore,
2585
+ Tn as createMutationAction,
2586
+ Vi as createRequestHandler,
2587
+ Ae as createSecureCookie,
2588
+ ji as createSecurityAudit,
2589
+ qi as createSecurityHeaders,
2590
+ qo as createSecurityReportHandler,
2591
+ jo as createSessionManager,
2592
+ zo as createSignedCookieSession,
2593
+ Ki as cspHash,
2594
+ Wi as cspNonce,
2595
+ hs as defaultFontPath,
2596
+ mi as defineAdapter,
2597
+ Ji as defineAuthorization,
2598
+ Gi as defineEnvSchema,
2599
+ ps as defineFonts,
2600
+ ms as defineImages,
2601
+ ni as defineInstrumentation,
2602
+ ss as defineLinks,
2603
+ Yi as defineLocales,
2604
+ Zi as defineMetadata,
2605
+ Uo as defineMiddleware,
2606
+ Io as defineOgImage,
2607
+ Lo as defineRobots,
2608
+ Xi as defineRoutePolicy,
2609
+ yi as defineScripts,
2610
+ Qi as defineSecurityPolicy,
2611
+ $o as defineSitemap,
2612
+ ea as defineTags,
2613
+ oi as defineWebVitals,
2614
+ ta as deserializeEnvSchema,
2615
+ ra as enforceAllowedMethods,
2616
+ na as enforceCsrfProtection,
2617
+ oa as enforceFetchMetadataPolicy,
2618
+ ia as enforceRateLimit,
2619
+ aa as enforceRequestSecurity,
2620
+ Wo as enforceWebSocketOrigin,
2621
+ sa as env,
2622
+ ys as font,
2623
+ gs as fontAssetFileName,
2624
+ ws as fontAssetUrl,
2625
+ vs as fontLinks,
2626
+ bs as fontMediaType,
2627
+ Ss as fontPreloadLinks,
2628
+ Es as fontSources,
2629
+ As as fontStylesheetUrl,
2630
+ ca as getBodySizeException,
2631
+ ua as getCspException,
2632
+ la as getCsrfException,
2633
+ gi as getRequestClientAddress,
2634
+ wi as getScriptWorker,
2635
+ da as handleRequestWithManifest,
2636
+ et as href,
2637
+ fa as html,
2638
+ Mr as httpError,
2639
+ Yo as hydrateFileRouter,
2640
+ xs as isAllowedImageSource,
2641
+ ha as isCacheNotFoundError,
2642
+ is as isContentHashedFileName,
2643
+ $r as isHttpError,
2644
+ pa as isSecurityException,
2645
+ ma as issueCsrfToken,
2646
+ ya as json,
2647
+ ga as jsonl,
2648
+ wa as link,
2649
+ va as localeDirection,
2650
+ tt as localizeHref,
2651
+ ba as mergeRouteAccess,
2652
+ Sa as mergeRoutePolicies,
2653
+ Ea as mergeRouteSecurityPolicies,
2654
+ Aa as mergeSecurityPolicies,
2655
+ xa as meta,
2656
+ cs as modulePreload,
2657
+ ka as mutation,
2658
+ Ra as mutationInput,
2659
+ Ta as notFound,
2660
+ Fo as page,
2661
+ Xe as parseBodySize,
2662
+ lt as parseCacheDuration,
2663
+ Ze as parseCookieHeader,
2664
+ ks as parseImageOptimizerRequest,
2665
+ Ma as parseRateLimitWindow,
2666
+ lo as parseWebVitalsBeacon,
2667
+ Ca as permitsRequest,
2668
+ Lr as planImageTransform,
2669
+ us as preconnect,
2670
+ ls as preload,
2671
+ $a as query,
2672
+ Na as readEnv,
2673
+ Ho as readSecureCookie,
2674
+ ai as readWebVitalsBeacon,
2675
+ La as redirect,
2676
+ Rs as renderFontFaceCss,
2677
+ Po as renderOgImageResponse,
2678
+ Dr as renderOgImageSvg,
2679
+ vi as renderPageResponse,
2680
+ Do as renderRobots,
2681
+ No as renderSitemap,
2682
+ Ia as resolveCsp,
2683
+ Da as resolveCsrf,
2684
+ ds as resolveLinks,
2685
+ Sr as resolveLocale,
2686
+ Pa as resolveMaxBodySize,
2687
+ Oa as resolveMetadata,
2688
+ _a as resolveRouteAccess,
2689
+ bi as resolveScripts,
2690
+ Fa as response,
2691
+ _o as runIdempotentMutation,
2692
+ $e as script,
2693
+ le as secureCookieName,
2694
+ Ua as security,
2695
+ bo as sendWebVitalsBeacon,
2696
+ mr as serializeCacheKey,
2697
+ Ba as serializeCacheNamespace,
2698
+ Ha as serializeCacheTag,
2699
+ za as serializeEnvSchema,
2700
+ Cs as serializeSessionNamespace,
2701
+ Va as serverTiming,
2702
+ ja as sse,
2703
+ ut as startDeferredScripts,
2704
+ qa as stream,
2705
+ Ka as structuredData,
2706
+ Wa as tag,
2707
+ Ja as text,
2708
+ Ga as toResponse,
2709
+ Ya as unstable_resetEnvironment,
2710
+ Za as unstable_startEnvironment,
2711
+ ei as useFormNavigation,
2712
+ Go as useMutationAction,
2713
+ _n as useNavigation,
2714
+ kn as useRouteFocusBoundary,
2715
+ Xa as validateCorsPolicy,
2716
+ Qa as validateEnv,
2717
+ es as validateRateLimitPolicy,
2718
+ ts as validateRouteModules,
2719
+ Jr as validateSecureCookie,
2720
+ Ko as validateUploads,
2721
+ uo as webVitalRating,
2722
+ ii as webVitalsPolicy,
2723
+ Bo as webhook
2706
2724
  };
2707
2725
  //# sourceMappingURL=index.js.map