@gatewaze/admin-embed 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +42 -0
  2. package/dist/AiSkillsPicker-dbFhcanE.js +373 -0
  3. package/dist/ContentAccessPage-D0HRqPFc.js +264 -0
  4. package/dist/DataTable-fe6yRVpF.js +1984 -0
  5. package/dist/DetailPageHeader-D_v7924k.js +69 -0
  6. package/dist/EditionEmail-CyhC8232.js +8382 -0
  7. package/dist/GuideContent-DBXKCu7r.js +7580 -0
  8. package/dist/HostMediaTab-BsIBEQ1v.js +440 -0
  9. package/dist/InboxPage-C8ivCKdx.js +1112 -0
  10. package/dist/NewsletterCanvasEditor--B06apn3.js +11453 -0
  11. package/dist/NewsletterSetupWizard-BqV6-fa5.js +347 -0
  12. package/dist/NewsletterSignup-DRVZIpOs.js +224 -0
  13. package/dist/Page-D3u8IZ2a.js +14 -0
  14. package/dist/Toaster-Cde0i6IA.js +18 -0
  15. package/dist/Tooltip-CqxUlW1d.js +746 -0
  16. package/dist/_collectionSlug_-B3UN6M-Q.js +308 -0
  17. package/dist/_collection_-Qz4k_Qjl.js +139 -0
  18. package/dist/_edition_-DQXwkI_-.js +301 -0
  19. package/dist/_id_-CtT7rT9f.js +257 -0
  20. package/dist/_id_-CzScE4Qn.js +1197 -0
  21. package/dist/_virtual_gatewaze-modules-BeloWlOa.js +991 -0
  22. package/dist/admin-B0Mmrh_O.js +1239 -0
  23. package/dist/admin-CcfoK6vD.js +17 -0
  24. package/dist/admin-embed.js +21844 -0
  25. package/dist/admin.css +2 -0
  26. package/dist/block-editor-vXBShAue.js +226 -0
  27. package/dist/brand-DklYwIeA.js +11 -0
  28. package/dist/brick-editor-CmBitMMK.js +225 -0
  29. package/dist/broadcastService-CBqXNt_N.js +190 -0
  30. package/dist/classnames-uWIYaD6z.js +44 -0
  31. package/dist/contentAccessService-Cs7tdAo-.js +59 -0
  32. package/dist/context-jzuubYRz.js +5 -0
  33. package/dist/createSafeContext-P1pK0sAN.js +17 -0
  34. package/dist/detail-B8SVFJJr.js +26285 -0
  35. package/dist/detail-uFBxRbLF.js +2966 -0
  36. package/dist/dist-DTrOExw8.js +38806 -0
  37. package/dist/edition-slug-CARO24Bs.js +7 -0
  38. package/dist/export-edition-html-C_hdXQu5.js +18893 -0
  39. package/dist/floating-ui.dom-Cyv879E9.js +987 -0
  40. package/dist/hooks-C377EXJG.js +2974 -0
  41. package/dist/img/mlops-logo.png +0 -0
  42. package/dist/img/mlops-logo2.png +0 -0
  43. package/dist/index.d.ts +105 -0
  44. package/dist/jsx-runtime-CjozyJt-.js +180 -0
  45. package/dist/lib-CylJmhlJ.js +828 -0
  46. package/dist/list-C0cz0aQz.js +451 -0
  47. package/dist/list-CIVgIGsU.js +166 -0
  48. package/dist/logo/mlops-alt.png +0 -0
  49. package/dist/logo/mlops-logo.png +0 -0
  50. package/dist/new-r4KWpqa6.js +80 -0
  51. package/dist/outline-DwDYhYcF.js +6538 -0
  52. package/dist/pages-Ersfxcz7.js +216 -0
  53. package/dist/preview/12627f.jpg +0 -0
  54. package/dist/preview/af009d.jpg +0 -0
  55. package/dist/public-api-LD11kMxh.js +238 -0
  56. package/dist/react-DB2tPNit.js +933 -0
  57. package/dist/react-dom-giQNVXng.js +267 -0
  58. package/dist/registry-4XrV9iNG.js +7 -0
  59. package/dist/render-BtUWfMUt.js +59634 -0
  60. package/dist/resolvePeopleByEmail-hivX2l07.js +828 -0
  61. package/dist/runtime-config.js +10 -0
  62. package/dist/sends-BkPO6PG2.js +182 -0
  63. package/dist/server.browser-Pj3QUa7k.js +15227 -0
  64. package/dist/shim-BCerG8nb.js +6681 -0
  65. package/dist/sonnerHostBridge-CXuCMM3R.js +665 -0
  66. package/dist/src-BWDAOzZO.js +799 -0
  67. package/dist/starter-templates-CFs-QUdF.js +3077 -0
  68. package/dist/storage-VDSvnkvR.js +39 -0
  69. package/dist/templateParser-BQ2IsJ6c.js +49 -0
  70. package/dist/templates-rjQjWsRr.js +253 -0
  71. package/dist/theme/gatewaze/android-icon-144x144.png +0 -0
  72. package/dist/theme/gatewaze/android-icon-192x192.png +0 -0
  73. package/dist/theme/gatewaze/android-icon-36x36.png +0 -0
  74. package/dist/theme/gatewaze/android-icon-48x48.png +0 -0
  75. package/dist/theme/gatewaze/android-icon-72x72.png +0 -0
  76. package/dist/theme/gatewaze/android-icon-96x96.png +0 -0
  77. package/dist/theme/gatewaze/favicon-144x144.png +0 -0
  78. package/dist/theme/gatewaze/favicon-16x16.png +0 -0
  79. package/dist/theme/gatewaze/favicon-192x192.png +0 -0
  80. package/dist/theme/gatewaze/favicon-32x32.png +0 -0
  81. package/dist/theme/gatewaze/favicon-96x96.png +0 -0
  82. package/dist/theme/gatewaze/favicon.ico +0 -0
  83. package/dist/theme/gatewaze/gatewaze-icon-512.png +0 -0
  84. package/dist/theme/gatewaze/gatewaze-logo-black.svg +24 -0
  85. package/dist/theme/gatewaze/gatewaze-logo-white.svg +20 -0
  86. package/dist/theme/gatewaze/gatewaze-poweredby-black.svg +25 -0
  87. package/dist/theme/gatewaze/gatewaze-poweredby-white.svg +25 -0
  88. package/dist/theme/gatewaze/logo_black.svg +24 -0
  89. package/dist/theme/gatewaze/logo_white.svg +20 -0
  90. package/dist/theme-D6odw5nx.js +586 -0
  91. package/dist/ui-DRIo9Krs.js +9747 -0
  92. package/dist/upload-DMNfZ6FX.js +505 -0
  93. package/dist/useModuleFeature-DgsFIUpv.js +8 -0
  94. package/dist/utils-BcVvIjaY.js +36 -0
  95. package/dist/with-selector-B8eSdVx_.js +100 -0
  96. package/package.json +33 -0
@@ -0,0 +1,2974 @@
1
+ import { c as e, t } from "./react-DB2tPNit.js";
2
+ //#region ../../node_modules/.pnpm/react-router@8.3.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router/dist/production/lib/router/url.js
3
+ var n = /^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i, r = /^[\\/]{2}/;
4
+ function i(e, t) {
5
+ return t + e.replace(/\\/g, "/");
6
+ }
7
+ //#endregion
8
+ //#region ../../node_modules/.pnpm/react-router@8.3.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router/dist/production/lib/router/history.js
9
+ var a = "popstate";
10
+ function o(e) {
11
+ return typeof e == "object" && !!e && "pathname" in e && "search" in e && "hash" in e && "state" in e && "key" in e;
12
+ }
13
+ function s(e = {}) {
14
+ function t(e, t) {
15
+ let n = t.state?.masked, { pathname: r, search: i, hash: a } = n || e.location;
16
+ return f("", {
17
+ pathname: r,
18
+ search: i,
19
+ hash: a
20
+ }, t.state && t.state.usr || null, t.state && t.state.key || "default", n ? {
21
+ pathname: e.location.pathname,
22
+ search: e.location.search,
23
+ hash: e.location.hash
24
+ } : void 0);
25
+ }
26
+ function n(e, t) {
27
+ return typeof t == "string" ? t : p(t);
28
+ }
29
+ return h(t, n, null, e);
30
+ }
31
+ function c(e, t) {
32
+ if (e === !1 || e == null) throw Error(t);
33
+ }
34
+ function l(e, t) {
35
+ if (!e) {
36
+ typeof console < "u" && console.warn(t);
37
+ try {
38
+ throw Error(t);
39
+ } catch {}
40
+ }
41
+ }
42
+ function u() {
43
+ return Math.random().toString(36).substring(2, 10);
44
+ }
45
+ function d(e, t) {
46
+ return {
47
+ usr: e.state,
48
+ key: e.key,
49
+ idx: t,
50
+ masked: e.mask ? {
51
+ pathname: e.pathname,
52
+ search: e.search,
53
+ hash: e.hash
54
+ } : void 0
55
+ };
56
+ }
57
+ function f(e, t, n = null, r, i) {
58
+ return {
59
+ pathname: typeof e == "string" ? e : e.pathname,
60
+ search: "",
61
+ hash: "",
62
+ ...typeof t == "string" ? m(t) : t,
63
+ state: n,
64
+ key: t && t.key || r || u(),
65
+ mask: i
66
+ };
67
+ }
68
+ function p({ pathname: e = "/", search: t = "", hash: n = "" }) {
69
+ return t && t !== "?" && (e += t.charAt(0) === "?" ? t : "?" + t), n && n !== "#" && (e += n.charAt(0) === "#" ? n : "#" + n), e;
70
+ }
71
+ function m(e) {
72
+ let t = {};
73
+ if (e) {
74
+ let n = e.indexOf("#");
75
+ n >= 0 && (t.hash = e.substring(n), e = e.substring(0, n));
76
+ let r = e.indexOf("?");
77
+ r >= 0 && (t.search = e.substring(r), e = e.substring(0, r)), e && (t.pathname = e);
78
+ }
79
+ return t;
80
+ }
81
+ function h(e, t, n, r = {}) {
82
+ let { window: i = document.defaultView, v5Compat: s = !1 } = r, c = i.history, l = "POP", u = null, p = m();
83
+ p ?? (p = 0, c.replaceState({
84
+ ...c.state,
85
+ idx: p
86
+ }, ""));
87
+ function m() {
88
+ return (c.state || { idx: null }).idx;
89
+ }
90
+ function h() {
91
+ l = "POP";
92
+ let e = m(), t = e == null ? null : e - p;
93
+ p = e, u && u({
94
+ action: l,
95
+ location: b.location,
96
+ delta: t
97
+ });
98
+ }
99
+ function _(e, t) {
100
+ l = "PUSH";
101
+ let r = o(e) ? e : f(b.location, e, t);
102
+ n && n(r, e), p = m() + 1;
103
+ let a = d(r, p), h = b.createHref(r.mask || r);
104
+ try {
105
+ c.pushState(a, "", h);
106
+ } catch (e) {
107
+ if (e instanceof DOMException && e.name === "DataCloneError") throw e;
108
+ i.location.assign(h);
109
+ }
110
+ s && u && u({
111
+ action: l,
112
+ location: b.location,
113
+ delta: 1
114
+ });
115
+ }
116
+ function v(e, t) {
117
+ l = "REPLACE";
118
+ let r = o(e) ? e : f(b.location, e, t);
119
+ n && n(r, e), p = m();
120
+ let i = d(r, p), a = b.createHref(r.mask || r);
121
+ c.replaceState(i, "", a), s && u && u({
122
+ action: l,
123
+ location: b.location,
124
+ delta: 0
125
+ });
126
+ }
127
+ function y(e) {
128
+ return g(i, e);
129
+ }
130
+ let b = {
131
+ get action() {
132
+ return l;
133
+ },
134
+ get location() {
135
+ return e(i, c);
136
+ },
137
+ listen(e) {
138
+ if (u) throw Error("A history only accepts one active listener");
139
+ return i.addEventListener(a, h), u = e, () => {
140
+ i.removeEventListener(a, h), u = null;
141
+ };
142
+ },
143
+ createHref(e) {
144
+ return t(i, e);
145
+ },
146
+ createURL: y,
147
+ encodeLocation(e) {
148
+ let t = y(e);
149
+ return {
150
+ pathname: t.pathname,
151
+ search: t.search,
152
+ hash: t.hash
153
+ };
154
+ },
155
+ push: _,
156
+ replace: v,
157
+ go(e) {
158
+ return c.go(e);
159
+ }
160
+ };
161
+ return b;
162
+ }
163
+ function g(e, t, n = !1) {
164
+ let i = "http://localhost";
165
+ e && (i = e.location.origin === "null" ? e.location.href : e.location.origin), c(i, "No window.location.(origin|href) available to create URL");
166
+ let a = typeof t == "string" ? t : p(t);
167
+ return a = a.replace(/ $/, "%20"), !n && r.test(a) && (a = i + a), new URL(a, i);
168
+ }
169
+ //#endregion
170
+ //#region ../../node_modules/.pnpm/react-router@8.3.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router/dist/production/lib/router/utils.js
171
+ var _ = /* @__PURE__ */ e(t(), 1), v = class {
172
+ #e = /* @__PURE__ */ new Map();
173
+ constructor(e) {
174
+ if (e) for (let [t, n] of e) this.set(t, n);
175
+ }
176
+ get(e) {
177
+ if (this.#e.has(e)) return this.#e.get(e);
178
+ if (e.defaultValue !== void 0) return e.defaultValue;
179
+ throw Error("No value found for context");
180
+ }
181
+ set(e, t) {
182
+ this.#e.set(e, t);
183
+ }
184
+ }, y = /* @__PURE__ */ new Set([
185
+ "lazy",
186
+ "caseSensitive",
187
+ "path",
188
+ "id",
189
+ "index",
190
+ "children"
191
+ ]);
192
+ function b(e) {
193
+ return y.has(e);
194
+ }
195
+ var x = /* @__PURE__ */ new Set([
196
+ "lazy",
197
+ "caseSensitive",
198
+ "path",
199
+ "id",
200
+ "index",
201
+ "middleware",
202
+ "children"
203
+ ]);
204
+ function S(e) {
205
+ return x.has(e);
206
+ }
207
+ function C(e) {
208
+ return e.index === !0;
209
+ }
210
+ function w(e) {
211
+ let t = {};
212
+ return e.Component && Object.assign(t, {
213
+ element: _.createElement(e.Component),
214
+ Component: void 0
215
+ }), e.HydrateFallback && Object.assign(t, {
216
+ hydrateFallbackElement: _.createElement(e.HydrateFallback),
217
+ HydrateFallback: void 0
218
+ }), e.ErrorBoundary && Object.assign(t, {
219
+ errorElement: _.createElement(e.ErrorBoundary),
220
+ ErrorBoundary: void 0
221
+ }), t;
222
+ }
223
+ function T(e, t = w, n = [], r = {}, i = !1) {
224
+ return e.map((e, a) => {
225
+ let o = [...n, String(a)], s = typeof e.id == "string" ? e.id : o.join("-");
226
+ if (c(e.index !== !0 || !e.children, "Cannot specify children on an index route"), c(i || !r[s], `Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`), C(e)) {
227
+ let n = {
228
+ ...e,
229
+ id: s
230
+ };
231
+ return r[s] = E(n, t(n)), n;
232
+ }
233
+ {
234
+ let n = {
235
+ ...e,
236
+ id: s,
237
+ children: void 0
238
+ };
239
+ return r[s] = E(n, t(n)), e.children && (n.children = T(e.children, t, o, r, i)), n;
240
+ }
241
+ });
242
+ }
243
+ function E(e, t) {
244
+ return Object.assign(e, {
245
+ ...t,
246
+ ...typeof t.lazy == "object" && t.lazy != null ? { lazy: {
247
+ ...e.lazy,
248
+ ...t.lazy
249
+ } } : {}
250
+ });
251
+ }
252
+ function D(e, t, n = "/") {
253
+ return O(e, t, n, !1);
254
+ }
255
+ function O(e, t, n, r, i) {
256
+ let a = z((typeof t == "string" ? m(t) : t).pathname || "/", n);
257
+ if (a == null) return null;
258
+ let o = i ?? A(e), s = null, c = ue(a);
259
+ for (let e = 0; s == null && e < o.length; ++e) s = se(o[e], c, r);
260
+ return s;
261
+ }
262
+ function k(e, t) {
263
+ let { route: n, pathname: r, params: i } = e;
264
+ return {
265
+ id: n.id,
266
+ pathname: r,
267
+ params: i,
268
+ loaderData: t[n.id],
269
+ handle: n.handle
270
+ };
271
+ }
272
+ function A(e) {
273
+ let t = j(e);
274
+ return N(t), t;
275
+ }
276
+ function j(e, t = [], n = [], r = "", i = !1) {
277
+ let a = (e, a, o = i, s) => {
278
+ let l = {
279
+ relativePath: s === void 0 ? e.path || "" : s,
280
+ caseSensitive: e.caseSensitive === !0,
281
+ childrenIndex: a,
282
+ route: e
283
+ };
284
+ if (l.relativePath.startsWith("/")) {
285
+ if (!l.relativePath.startsWith(r) && o) return;
286
+ c(l.relativePath.startsWith(r), `Absolute route path "${l.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`), l.relativePath = l.relativePath.slice(r.length);
287
+ }
288
+ let u = U([r, l.relativePath]), d = n.concat(l);
289
+ e.children && e.children.length > 0 && (c(e.index !== !0, `Index routes must not have child routes. Please remove all child routes from route path "${u}".`), j(e.children, t, d, u, o)), !(e.path == null && !e.index) && t.push({
290
+ path: u,
291
+ score: oe(u, e.index),
292
+ routesMeta: d.map((e, t) => {
293
+ let [n, r] = R(e.relativePath, e.caseSensitive, t === d.length - 1);
294
+ return {
295
+ ...e,
296
+ matcher: n,
297
+ compiledParams: r
298
+ };
299
+ })
300
+ });
301
+ };
302
+ return e.forEach((e, t) => {
303
+ if (e.path === "" || !e.path?.includes("?")) a(e, t);
304
+ else for (let n of M(e.path)) a(e, t, !0, n);
305
+ }), t;
306
+ }
307
+ function M(e) {
308
+ let t = e.split("/");
309
+ if (t.length === 0) return [];
310
+ let [n, ...r] = t, i = n.endsWith("?"), a = n.replace(/\?$/, "");
311
+ if (r.length === 0) return i ? [a, ""] : [a];
312
+ let o = M(r.join("/")), s = [];
313
+ return s.push(...o.map((e) => e === "" ? a : [a, e].join("/"))), i && s.push(...o), s.map((t) => e.startsWith("/") && t === "" ? "/" : t);
314
+ }
315
+ function N(e) {
316
+ e.sort((e, t) => e.score === t.score ? L(e.routesMeta.map((e) => e.childrenIndex), t.routesMeta.map((e) => e.childrenIndex)) : t.score - e.score);
317
+ }
318
+ var P = /^:[\w-]+$/, F = /^:[\w-]+/, ee = 3.5, I = 3, te = 2, ne = 1, re = 10, ie = -2, ae = (e) => e === "*";
319
+ function oe(e, t) {
320
+ let n = e.split("/"), r = n.length;
321
+ return n.some(ae) && (r += ie), t && (r += te), n.filter((e) => !ae(e)).reduce((e, t) => e + (P.test(t) ? I : F.test(t) ? ee : t === "" ? ne : re), r);
322
+ }
323
+ function L(e, t) {
324
+ return e.length === t.length && e.slice(0, -1).every((e, n) => e === t[n]) ? e[e.length - 1] - t[t.length - 1] : 0;
325
+ }
326
+ function se(e, t, n = !1) {
327
+ let { routesMeta: r } = e, i = {}, a = "/", o = [];
328
+ for (let e = 0; e < r.length; ++e) {
329
+ let s = r[e], c = e === r.length - 1, l = a === "/" ? t : t.slice(a.length) || "/", u = {
330
+ path: s.relativePath,
331
+ caseSensitive: s.caseSensitive,
332
+ end: c
333
+ }, d = s.matcher && s.compiledParams ? le(u, l, s.matcher, s.compiledParams) : ce(u, l), f = s.route;
334
+ if (!d && c && n && !r[r.length - 1].route.index && (d = ce({
335
+ path: s.relativePath,
336
+ caseSensitive: s.caseSensitive,
337
+ end: !1
338
+ }, l)), !d) return null;
339
+ Object.assign(i, d.params), o.push({
340
+ params: i,
341
+ pathname: U([a, d.pathname]),
342
+ pathnameBase: ve(U([a, d.pathnameBase])),
343
+ route: f
344
+ }), d.pathnameBase !== "/" && (a = U([a, d.pathnameBase]));
345
+ }
346
+ return o;
347
+ }
348
+ function ce(e, t) {
349
+ typeof e == "string" && (e = {
350
+ path: e,
351
+ caseSensitive: !1,
352
+ end: !0
353
+ });
354
+ let [n, r] = R(e.path, e.caseSensitive, e.end);
355
+ return le(e, t, n, r);
356
+ }
357
+ function le(e, t, n, r) {
358
+ let i = t.match(n);
359
+ if (!i) return null;
360
+ let a = i[0], o = a.replace(/(.)\/+$/, "$1"), s = i.slice(1);
361
+ return {
362
+ params: r.reduce((e, { paramName: t, isOptional: n }, r) => {
363
+ if (t === "*") {
364
+ let e = s[r] || "";
365
+ o = a.slice(0, a.length - e.length).replace(/(.)\/+$/, "$1");
366
+ }
367
+ let i = s[r];
368
+ return e[t] = n && !i ? void 0 : (i || "").replace(/%2F/g, "/"), e;
369
+ }, {}),
370
+ pathname: a,
371
+ pathnameBase: o,
372
+ pattern: e
373
+ };
374
+ }
375
+ function R(e, t = !1, n = !0) {
376
+ l(e === "*" || !e.endsWith("*") || e.endsWith("/*"), `Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`);
377
+ let r = [], i = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (e, t, n, i, a) => {
378
+ if (r.push({
379
+ paramName: t,
380
+ isOptional: n != null
381
+ }), n) {
382
+ let t = a.charAt(i + e.length);
383
+ return t && t !== "/" ? "/([^\\/]*)" : "(?:/([^\\/]*))?";
384
+ }
385
+ return "/([^\\/]+)";
386
+ }).replace(/\/([\w-]+)\?(?=\/|$|\()/g, "(?:/$1)?");
387
+ return e.endsWith("*") ? (r.push({ paramName: "*" }), i += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? i += "\\/*$" : e !== "" && e !== "/" && (i += "(?:(?=\\/|$))"), [new RegExp(i, t ? void 0 : "i"), r];
388
+ }
389
+ function ue(e) {
390
+ try {
391
+ return e.split("/").map((e) => decodeURIComponent(e).replace(/\//g, "%2F")).join("/");
392
+ } catch (t) {
393
+ return l(!1, `The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`), e;
394
+ }
395
+ }
396
+ function z(e, t) {
397
+ if (t === "/") return e;
398
+ if (!e.toLowerCase().startsWith(t.toLowerCase())) return null;
399
+ let n = t.endsWith("/") ? t.length - 1 : t.length, r = e.charAt(n);
400
+ return r && r !== "/" ? null : e.slice(n) || "/";
401
+ }
402
+ function B({ basename: e, pathname: t }) {
403
+ return t === "/" ? e : U([e, t]);
404
+ }
405
+ var de = (e) => n.test(e);
406
+ function V(e, t = "/") {
407
+ let { pathname: n, search: r = "", hash: i = "" } = typeof e == "string" ? m(e) : e, a;
408
+ return n ? (n = ge(n), a = n.startsWith("/") ? H(n.substring(1), "/") : H(n, t)) : a = t, {
409
+ pathname: a,
410
+ search: ye(r),
411
+ hash: be(i)
412
+ };
413
+ }
414
+ function H(e, t) {
415
+ let n = _e(t).split("/");
416
+ return e.split("/").forEach((e) => {
417
+ e === ".." ? n.length > 1 && n.pop() : e !== "." && n.push(e);
418
+ }), n.length > 1 ? n.join("/") : "/";
419
+ }
420
+ function fe(e, t, n, r) {
421
+ return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
422
+ }
423
+ function pe(e) {
424
+ return e.filter((e, t) => t === 0 || e.route.path && e.route.path.length > 0);
425
+ }
426
+ function me(e) {
427
+ let t = pe(e);
428
+ return t.map((e, n) => n === t.length - 1 ? e.pathname : e.pathnameBase);
429
+ }
430
+ function he(e, t, n, r = !1) {
431
+ let i;
432
+ typeof e == "string" ? i = m(e) : (i = { ...e }, c(!i.pathname || !i.pathname.includes("?"), fe("?", "pathname", "search", i)), c(!i.pathname || !i.pathname.includes("#"), fe("#", "pathname", "hash", i)), c(!i.search || !i.search.includes("#"), fe("#", "search", "hash", i)));
433
+ let a = e === "" || i.pathname === "", o = a ? "/" : i.pathname, s;
434
+ if (o == null) s = n;
435
+ else {
436
+ let e = t.length - 1;
437
+ if (!r && o.startsWith("..")) {
438
+ let t = o.split("/");
439
+ for (; t[0] === "..";) t.shift(), --e;
440
+ i.pathname = t.join("/");
441
+ }
442
+ s = e >= 0 ? t[e] : "/";
443
+ }
444
+ let l = V(i, s), u = o && o !== "/" && o.endsWith("/"), d = (a || o === ".") && n.endsWith("/");
445
+ return !l.pathname.endsWith("/") && (u || d) && (l.pathname += "/"), l;
446
+ }
447
+ var ge = (e) => e.replace(/[\\/]{2,}/g, "/"), U = (e) => ge(e.join("/")), _e = (e) => e.replace(/\/+$/, ""), ve = (e) => _e(e).replace(/^\/*/, "/"), ye = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, be = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, xe = [
448
+ "EvalError",
449
+ "RangeError",
450
+ "ReferenceError",
451
+ "SyntaxError",
452
+ "TypeError",
453
+ "URIError"
454
+ ], Se = class {
455
+ status;
456
+ statusText;
457
+ data;
458
+ error;
459
+ internal;
460
+ constructor(e, t, n, r = !1) {
461
+ this.status = e, this.statusText = t || "", this.internal = r, n instanceof Error ? (this.data = n.toString(), this.error = n) : this.data = n;
462
+ }
463
+ };
464
+ function Ce(e) {
465
+ return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
466
+ }
467
+ function we(e) {
468
+ return U(e.map((e) => e.route.path).filter(Boolean)) || "/";
469
+ }
470
+ function Te(e, t) {
471
+ let n = new URL(typeof e == "string" || e instanceof URL ? e : e.url), r = typeof t == "string" ? m(t) : t;
472
+ if (n.pathname = r.pathname || "/", r.search) {
473
+ let e = new URLSearchParams(r.search), t = e.getAll("index");
474
+ e.delete("index");
475
+ for (let n of t.filter(Boolean)) e.append("index", n);
476
+ let i = e.toString();
477
+ n.search = i ? `?${i}` : "";
478
+ } else n.search = "";
479
+ return n.hash = r.hash || "", n;
480
+ }
481
+ var Ee = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0;
482
+ function De(e, t) {
483
+ let a = e;
484
+ if (typeof a != "string" || !n.test(a)) return {
485
+ absoluteURL: void 0,
486
+ isExternal: !1,
487
+ to: a
488
+ };
489
+ let o = a, s = !1;
490
+ if (Ee) try {
491
+ let e = new URL(window.location.href), n = r.test(a) ? new URL(i(a, e.protocol)) : new URL(a), o = z(n.pathname, t);
492
+ n.origin === e.origin && o != null ? a = o + n.search + n.hash : s = !0;
493
+ } catch {
494
+ l(!1, `<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`);
495
+ }
496
+ return {
497
+ absoluteURL: o,
498
+ isExternal: s,
499
+ to: a
500
+ };
501
+ }
502
+ //#endregion
503
+ //#region ../../node_modules/.pnpm/react-router@8.3.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router/dist/production/lib/router/instrumentation.js
504
+ var Oe = Symbol("Uninstrumented"), W = /* @__PURE__ */ new WeakMap();
505
+ function ke(e, t) {
506
+ let n = {
507
+ lazy: [],
508
+ "lazy.loader": [],
509
+ "lazy.action": [],
510
+ "lazy.middleware": [],
511
+ middleware: [],
512
+ loader: [],
513
+ action: []
514
+ };
515
+ e.forEach((e) => e({
516
+ id: t.id,
517
+ index: t.index,
518
+ path: t.path,
519
+ instrument(e) {
520
+ e.lazy != null && n.lazy.push(e.lazy), e["lazy.loader"] != null && n["lazy.loader"].push(e["lazy.loader"]), e["lazy.action"] != null && n["lazy.action"].push(e["lazy.action"]), e["lazy.middleware"] != null && n["lazy.middleware"].push(e["lazy.middleware"]), e.middleware != null && n.middleware.push(e.middleware), e.loader != null && n.loader.push(e.loader), e.action != null && n.action.push(e.action);
521
+ }
522
+ }));
523
+ let r = {};
524
+ if (typeof t.lazy == "function" && n.lazy.length > 0) {
525
+ let e = t.lazy;
526
+ r.lazy = async (...t) => K(await q(n.lazy, void 0, () => e(...t), J));
527
+ }
528
+ if (typeof t.lazy == "object") {
529
+ let e = t.lazy;
530
+ if (typeof e.middleware == "function" && n["lazy.middleware"].length > 0) {
531
+ let t = e.middleware;
532
+ r.lazy = Object.assign(r.lazy || {}, { middleware: async (...e) => K(await q(n["lazy.middleware"], void 0, () => t(...e), J)) });
533
+ }
534
+ if (typeof e.loader == "function" && n["lazy.loader"].length > 0) {
535
+ let t = e.loader;
536
+ r.lazy = Object.assign(r.lazy || {}, { loader: async (...e) => K(await q(n["lazy.loader"], void 0, () => t(...e), J)) });
537
+ }
538
+ if (typeof e.action == "function" && n["lazy.action"].length > 0) {
539
+ let t = e.action;
540
+ r.lazy = Object.assign(r.lazy || {}, { action: async (...e) => K(await q(n["lazy.action"], void 0, () => t(...e), J)) });
541
+ }
542
+ }
543
+ if (typeof t.loader == "function" && n.loader.length > 0) {
544
+ let e = G(t.loader), i = async (...t) => K(await q(n.loader, Pe(t[0]), () => e(...t), J));
545
+ e.hydrate === !0 && (i.hydrate = !0), je(i, e), r.loader = i;
546
+ }
547
+ if (typeof t.action == "function" && n.action.length > 0) {
548
+ let e = G(t.action), i = async (...t) => K(await q(n.action, Pe(t[0]), () => e(...t), J));
549
+ je(i, e), r.action = i;
550
+ }
551
+ return t.middleware && t.middleware.length > 0 && n.middleware.length > 0 && (r.middleware = t.middleware.map((e) => {
552
+ let t = G(e), r = async (...e) => K(await q(n.middleware, Pe(e[0]), () => t(...e), J));
553
+ return je(r, t), r;
554
+ })), r;
555
+ }
556
+ function Ae(e, t) {
557
+ let n = {
558
+ navigate: [],
559
+ fetch: []
560
+ };
561
+ if (t.forEach((e) => e({ instrument(e) {
562
+ e.navigate != null && n.navigate.push(e.navigate), e.fetch != null && n.fetch.push(e.fetch);
563
+ } })), n.navigate.length > 0) {
564
+ let t = G(e.navigate), r = async (...r) => {
565
+ let [i, a] = r, o, s = {
566
+ to: typeof i == "number" || typeof i == "string" ? i : i ? p(i) : ".",
567
+ ...Fe(e, a ?? {})
568
+ };
569
+ return K(await q(n.navigate, s, async () => {
570
+ if (typeof i == "number") return await t(...r);
571
+ let n = Me(e, (e) => {
572
+ o = e;
573
+ });
574
+ try {
575
+ return await t(...r);
576
+ } finally {
577
+ n();
578
+ }
579
+ }, (e) => ({
580
+ ...J(e),
581
+ meta: o
582
+ })));
583
+ };
584
+ je(r, t), e.navigate = r;
585
+ }
586
+ if (n.fetch.length > 0) {
587
+ let t = G(e.fetch), r = async (...r) => {
588
+ let [i, a, o, s] = r, c;
589
+ return K(await q(n.fetch, {
590
+ href: o ?? ".",
591
+ fetcherKey: i,
592
+ ...Fe(e, s ?? {})
593
+ }, async () => {
594
+ let n = Me(e, (e) => {
595
+ c = e;
596
+ });
597
+ try {
598
+ return await t(...r);
599
+ } finally {
600
+ n();
601
+ }
602
+ }, (e) => ({
603
+ ...J(e),
604
+ meta: c
605
+ })));
606
+ };
607
+ je(r, t), e.fetch = r;
608
+ }
609
+ return e;
610
+ }
611
+ function G(e) {
612
+ return e[Oe] ?? e;
613
+ }
614
+ function je(e, t) {
615
+ e[Oe] = t;
616
+ }
617
+ function Me(e, t) {
618
+ return W.set(e, t), () => {
619
+ W.get(e) === t && W.delete(e);
620
+ };
621
+ }
622
+ function Ne(e) {
623
+ let t = W.get(e);
624
+ return W.delete(e), t;
625
+ }
626
+ function K(e) {
627
+ if (e.type === "error") throw e.value;
628
+ return e.value;
629
+ }
630
+ async function q(e, t, n, r, i = {
631
+ result: null,
632
+ innerResult: null
633
+ }, a = e.length - 1) {
634
+ let o = e[a];
635
+ if (o) {
636
+ let s, l = async () => (s ? console.error("You cannot call instrumented handlers more than once") : s = q(e, t, n, r, i, a - 1), await s, c(i.innerResult, "Expected an inner result"), i.innerResult);
637
+ try {
638
+ await o(l, t);
639
+ } catch (e) {
640
+ console.error("An instrumentation function threw an error:", e);
641
+ }
642
+ s || await l(), await s;
643
+ } else {
644
+ try {
645
+ i.result = {
646
+ type: "success",
647
+ value: await n()
648
+ };
649
+ } catch (e) {
650
+ i.result = {
651
+ type: "error",
652
+ value: e
653
+ };
654
+ }
655
+ i.innerResult = r(i.result, t);
656
+ }
657
+ return i.result ? i.result : (i.result = {
658
+ type: "error",
659
+ value: /* @__PURE__ */ Error("No result assigned in instrumentation chain.")
660
+ }, i.innerResult = r(i.result, t), i.result);
661
+ }
662
+ function J(e) {
663
+ return e.type === "error" && e.value instanceof Error ? {
664
+ status: "error",
665
+ error: e.value
666
+ } : {
667
+ status: "success",
668
+ error: void 0
669
+ };
670
+ }
671
+ function Pe(e) {
672
+ let { request: t, context: n, params: r } = e;
673
+ return {
674
+ ...e,
675
+ request: Ie(t),
676
+ params: { ...r },
677
+ context: Y(n)
678
+ };
679
+ }
680
+ function Fe(e, t) {
681
+ return {
682
+ currentUrl: p(e.state.location),
683
+ ..."formMethod" in t ? { formMethod: t.formMethod } : {},
684
+ ..."formEncType" in t ? { formEncType: t.formEncType } : {},
685
+ ..."formData" in t ? { formData: t.formData } : {},
686
+ ..."body" in t ? { body: t.body } : {}
687
+ };
688
+ }
689
+ function Ie(e) {
690
+ return {
691
+ method: e.method,
692
+ url: e.url,
693
+ headers: { get: (...t) => e.headers.get(...t) }
694
+ };
695
+ }
696
+ function Y(e) {
697
+ return { get: (t) => e.get(t) };
698
+ }
699
+ //#endregion
700
+ //#region ../../node_modules/.pnpm/react-router@8.3.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router/dist/production/lib/router/router.js
701
+ var Le = [
702
+ "POST",
703
+ "PUT",
704
+ "PATCH",
705
+ "DELETE"
706
+ ], Re = new Set(Le), ze = ["GET", ...Le], Be = new Set(ze), Ve = /* @__PURE__ */ new Set([
707
+ 301,
708
+ 302,
709
+ 303,
710
+ 307,
711
+ 308
712
+ ]), He = /* @__PURE__ */ new Set([307, 308]), Ue = {
713
+ state: "idle",
714
+ location: void 0,
715
+ matches: void 0,
716
+ historyAction: void 0,
717
+ formMethod: void 0,
718
+ formAction: void 0,
719
+ formEncType: void 0,
720
+ formData: void 0,
721
+ json: void 0,
722
+ text: void 0
723
+ }, We = {
724
+ state: "idle",
725
+ data: void 0,
726
+ formMethod: void 0,
727
+ formAction: void 0,
728
+ formEncType: void 0,
729
+ formData: void 0,
730
+ json: void 0,
731
+ text: void 0
732
+ }, Ge = {
733
+ state: "unblocked",
734
+ proceed: void 0,
735
+ reset: void 0,
736
+ location: void 0
737
+ }, Ke = "remix-router-transitions", qe = Symbol("ResetLoaderData"), Je = class {
738
+ #e;
739
+ #t;
740
+ #n;
741
+ #r;
742
+ constructor(e) {
743
+ this.#e = e, this.#t = A(e);
744
+ }
745
+ get stableRoutes() {
746
+ return this.#e;
747
+ }
748
+ get activeRoutes() {
749
+ return this.#n ?? this.#e;
750
+ }
751
+ get branches() {
752
+ return this.#r ?? this.#t;
753
+ }
754
+ get hasHMRRoutes() {
755
+ return this.#n != null;
756
+ }
757
+ setRoutes(e) {
758
+ this.#e = e, this.#t = A(e);
759
+ }
760
+ setHmrRoutes(e) {
761
+ this.#n = e, this.#r = A(e);
762
+ }
763
+ commitHmrRoutes() {
764
+ this.#n && (this.#e = this.#n, this.#t = this.#r, this.#n = void 0, this.#r = void 0);
765
+ }
766
+ };
767
+ function Ye(e) {
768
+ let t = e.window ? e.window : typeof window < "u" ? window : void 0, n = t !== void 0 && t.document !== void 0 && t.document.createElement !== void 0;
769
+ c(e.routes.length > 0, "You must provide a non-empty routes array to createRouter");
770
+ let r = e.hydrationRouteProperties || [], i = e.mapRouteProperties, a = i || (() => ({}));
771
+ if (e.instrumentations) {
772
+ let t = e.instrumentations;
773
+ a = (e) => ({
774
+ ...i?.(e),
775
+ ...ke(t.map((e) => e.route).filter(Boolean), e)
776
+ });
777
+ }
778
+ let o = {}, s = new Je(T(e.routes, a, void 0, o)), u = e.basename || "/";
779
+ u.startsWith("/") || (u = `/${u}`);
780
+ let d = e.dataStrategy || ft, p = { ...e.future }, h = null, _ = /* @__PURE__ */ new Set(), y = null, b = null, x = null, S = null, C = e.hydrationData != null, w = O(s.activeRoutes, e.history.location, u, !1, s.branches), E = !1, D = null, A, j;
781
+ if (w == null && !e.patchRoutesOnNavigation) {
782
+ let t = X(404, { pathname: e.history.location.pathname }), { matches: n, route: r } = Ft(s.activeRoutes);
783
+ A = !0, j = !A, w = n, D = { [r.id]: t };
784
+ } else if (w && !e.hydrationData && ot(w, s.activeRoutes, e.history.location.pathname).active && (w = null), !w) {
785
+ A = !1, j = !A, w = [];
786
+ let t = ot(null, s.activeRoutes, e.history.location.pathname);
787
+ t.active && t.matches && (E = !0, w = t.matches);
788
+ } else if (w.some((e) => e.route.lazy)) A = !1, j = !A;
789
+ else if (!w.some((e) => et(e.route))) A = !0, j = !A;
790
+ else {
791
+ let t = e.hydrationData ? e.hydrationData.loaderData : null, n = e.hydrationData ? e.hydrationData.errors : null, r = w;
792
+ if (n) {
793
+ let e = w.findIndex((e) => n[e.route.id] !== void 0);
794
+ r = r.slice(0, e + 1);
795
+ }
796
+ j = !1, A = !0, r.forEach((e) => {
797
+ let r = tt(e.route, t, n);
798
+ j ||= r.renderFallback, A &&= !r.shouldLoad;
799
+ });
800
+ }
801
+ let M, N = {
802
+ historyAction: e.history.action,
803
+ location: e.history.location,
804
+ matches: w,
805
+ initialized: A,
806
+ renderFallback: j,
807
+ navigation: Ue,
808
+ restoreScrollPosition: e.hydrationData == null && null,
809
+ preventScrollReset: !1,
810
+ revalidation: "idle",
811
+ loaderData: e.hydrationData && e.hydrationData.loaderData || {},
812
+ actionData: e.hydrationData && e.hydrationData.actionData || null,
813
+ errors: e.hydrationData && e.hydrationData.errors || D,
814
+ fetchers: /* @__PURE__ */ new Map(),
815
+ blockers: /* @__PURE__ */ new Map()
816
+ }, P = "POP", F = null, ee = !1, I, te = !1, ne = /* @__PURE__ */ new Map(), re = null, ie = !1, ae = !1, oe = /* @__PURE__ */ new Set(), L = /* @__PURE__ */ new Map(), se = 0, ce = -1, le = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Set(), ue = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map(), V = /* @__PURE__ */ new Set(), H = /* @__PURE__ */ new Map(), fe, pe = null;
817
+ function me() {
818
+ if (h = e.history.listen(({ action: t, location: n, delta: r }) => {
819
+ if (fe) {
820
+ fe(), fe = void 0;
821
+ return;
822
+ }
823
+ l(H.size === 0 || r != null, "You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");
824
+ let i = qe({
825
+ currentLocation: N.location,
826
+ nextLocation: n,
827
+ historyAction: t
828
+ });
829
+ if (i && r != null) {
830
+ let t = new Promise((e) => {
831
+ fe = e;
832
+ });
833
+ e.history.go(r * -1), Ke(i, {
834
+ state: "blocked",
835
+ location: n,
836
+ proceed() {
837
+ Ke(i, {
838
+ state: "proceeding",
839
+ proceed: void 0,
840
+ reset: void 0,
841
+ location: n
842
+ }), t.then(() => e.history.go(r));
843
+ },
844
+ reset() {
845
+ let e = new Map(N.blockers);
846
+ e.set(i, Ge), U({ blockers: e });
847
+ }
848
+ }), F?.resolve(), F = null;
849
+ return;
850
+ }
851
+ return be(t, n);
852
+ }), n) {
853
+ an(t, ne);
854
+ let e = () => on(t, ne);
855
+ t.addEventListener("pagehide", e), re = () => t.removeEventListener("pagehide", e);
856
+ }
857
+ return N.initialized || be("POP", N.location, { initialHydration: !0 }), M;
858
+ }
859
+ function he() {
860
+ h && h(), re && re(), _.clear(), I && I.abort(), N.fetchers.forEach((e, t) => Fe(N.fetchers, t)), N.blockers.forEach((e, t) => Ve(t));
861
+ }
862
+ function ge(e) {
863
+ if (_.add(e), y) {
864
+ let { newErrors: t } = y;
865
+ y = null, e(N, {
866
+ deletedFetchers: [],
867
+ newErrors: t,
868
+ viewTransitionOpts: void 0,
869
+ flushSync: !1
870
+ });
871
+ }
872
+ return () => _.delete(e);
873
+ }
874
+ function U(e, t = {}) {
875
+ e.matches &&= e.matches.map((e) => {
876
+ let t = o[e.route.id], n = e.route;
877
+ return n.element !== t.element || n.errorElement !== t.errorElement || n.hydrateFallbackElement !== t.hydrateFallbackElement ? {
878
+ ...e,
879
+ route: t
880
+ } : e;
881
+ }), N = {
882
+ ...N,
883
+ ...e
884
+ };
885
+ let n = [], r = [];
886
+ N.fetchers.forEach((e, t) => {
887
+ e.state === "idle" && (V.has(t) ? n.push(t) : r.push(t));
888
+ }), V.forEach((e) => {
889
+ !N.fetchers.has(e) && !L.has(e) && n.push(e);
890
+ }), _.size === 0 && (y = { newErrors: e.errors ?? null }), [..._].forEach((r) => r(N, {
891
+ deletedFetchers: n,
892
+ newErrors: e.errors ?? null,
893
+ viewTransitionOpts: t.viewTransitionOpts,
894
+ flushSync: t.flushSync === !0
895
+ })), n.forEach((e) => Fe(N.fetchers, e)), r.forEach((e) => N.fetchers.delete(e));
896
+ }
897
+ function _e(t, n, { flushSync: r } = {}) {
898
+ let i = N.actionData != null && N.navigation.formMethod != null && Q(N.navigation.formMethod) && N.navigation.state === "loading" && t.state?._isRedirect !== !0, a;
899
+ a = n.actionData ? Object.keys(n.actionData).length > 0 ? n.actionData : null : i ? N.actionData : null;
900
+ let o = n.loaderData ? Mt(N.loaderData, n.loaderData, n.matches || [], n.errors) : N.loaderData, c = N.blockers;
901
+ c.size > 0 && !ie && (c = new Map(c), c.forEach((e, t) => c.set(t, Ge)));
902
+ let l = !ie && it(t, n.matches || N.matches), u = ee === !0 || N.navigation.formMethod != null && Q(N.navigation.formMethod) && t.state?._isRedirect !== !0;
903
+ s.commitHmrRoutes(), ie || P === "POP" || (P === "PUSH" ? e.history.push(t, t.state) : P === "REPLACE" && e.history.replace(t, t.state));
904
+ let d;
905
+ if (P === "POP") {
906
+ let e = ne.get(N.location.pathname);
907
+ e && e.has(t.pathname) ? d = {
908
+ currentLocation: N.location,
909
+ nextLocation: t
910
+ } : ne.has(t.pathname) && (d = {
911
+ currentLocation: t,
912
+ nextLocation: N.location
913
+ });
914
+ } else if (te) {
915
+ let e = ne.get(N.location.pathname);
916
+ e ? e.add(t.pathname) : (e = /* @__PURE__ */ new Set([t.pathname]), ne.set(N.location.pathname, e)), d = {
917
+ currentLocation: N.location,
918
+ nextLocation: t
919
+ };
920
+ }
921
+ U({
922
+ ...n,
923
+ actionData: a,
924
+ loaderData: o,
925
+ historyAction: P,
926
+ location: t,
927
+ initialized: !0,
928
+ renderFallback: !1,
929
+ navigation: Ue,
930
+ revalidation: "idle",
931
+ restoreScrollPosition: l,
932
+ preventScrollReset: u,
933
+ blockers: c
934
+ }, {
935
+ viewTransitionOpts: d,
936
+ flushSync: r === !0
937
+ }), P = "POP", ee = !1, te = !1, ie = !1, ae = !1, F?.resolve(), F = null, pe?.resolve(), pe = null;
938
+ }
939
+ async function ve(t, n) {
940
+ if (F?.resolve(), F = null, typeof t == "number") {
941
+ F ||= sn();
942
+ let n = F.promise;
943
+ return e.history.go(t), n;
944
+ }
945
+ let r = Ne(M), { path: i, submission: a, error: o } = Qe(!1, Ze(N.location, N.matches, u, t, n?.fromRouteId, n?.relative), n), s;
946
+ n?.mask && (s = {
947
+ pathname: "",
948
+ search: "",
949
+ hash: "",
950
+ ...typeof n.mask == "string" ? m(n.mask) : {
951
+ ...N.location.mask,
952
+ ...n.mask
953
+ }
954
+ });
955
+ let c = N.location, l = f(c, i, n && n.state, void 0, s);
956
+ l = {
957
+ ...l,
958
+ ...e.history.encodeLocation(l)
959
+ };
960
+ let d = n && n.replace != null ? n.replace : void 0, p = "PUSH";
961
+ d === !0 ? p = "REPLACE" : d === !1 || a != null && Q(a.formMethod) && a.formAction === N.location.pathname + N.location.search && (p = "REPLACE");
962
+ let h = n && "preventScrollReset" in n ? n.preventScrollReset === !0 : void 0, g = (n && n.flushSync) === !0, _ = qe({
963
+ currentLocation: c,
964
+ nextLocation: l,
965
+ historyAction: p
966
+ });
967
+ if (_) {
968
+ Ke(_, {
969
+ state: "blocked",
970
+ location: l,
971
+ proceed() {
972
+ Ke(_, {
973
+ state: "proceeding",
974
+ proceed: void 0,
975
+ reset: void 0,
976
+ location: l
977
+ }), ve(t, n);
978
+ },
979
+ reset() {
980
+ let e = new Map(N.blockers);
981
+ e.set(_, Ge), U({ blockers: e });
982
+ }
983
+ });
984
+ return;
985
+ }
986
+ await be(p, l, {
987
+ submission: a,
988
+ pendingError: o,
989
+ preventScrollReset: h,
990
+ replace: n && n.replace,
991
+ enableViewTransition: n && n.viewTransition,
992
+ flushSync: g,
993
+ callSiteDefaultShouldRevalidate: n && n.defaultShouldRevalidate,
994
+ instrumentationNavigateMetaReceiver: r
995
+ });
996
+ }
997
+ function ye() {
998
+ pe ||= sn(), Me(), U({ revalidation: "loading" });
999
+ let e = pe.promise;
1000
+ return N.navigation.state === "submitting" ? e : N.navigation.state === "idle" ? (be(N.historyAction, N.location, { startUninterruptedRevalidation: !0 }), e) : (be(P || N.historyAction, N.navigation.location, {
1001
+ overrideNavigation: N.navigation,
1002
+ enableViewTransition: te === !0
1003
+ }), e);
1004
+ }
1005
+ async function be(t, n, r) {
1006
+ I && I.abort(), I = null, P = t, ie = (r && r.startUninterruptedRevalidation) === !0, rt(N.location, N.matches), ee = (r && r.preventScrollReset) === !0, te = (r && r.enableViewTransition) === !0;
1007
+ let i = s.activeRoutes, a = r?.initialHydration && N.matches && N.matches.length > 0 && !E ? N.matches : O(i, n, u, !1, s.branches), o = (r && r.flushSync) === !0;
1008
+ if (a && N.initialized && !ae && Rt(N.location, n) && !(r && r.submission && Q(r.submission.formMethod))) {
1009
+ _e(n, { matches: a }, { flushSync: o });
1010
+ return;
1011
+ }
1012
+ let c = ot(a, i, n.pathname);
1013
+ if (c.active && c.matches && (a = c.matches), r?.instrumentationNavigateMetaReceiver) {
1014
+ let t = Zt(e.history, n, a);
1015
+ r.instrumentationNavigateMetaReceiver(t);
1016
+ }
1017
+ if (!a) {
1018
+ let { error: e, notFoundMatches: t, route: r } = Ye(n.pathname);
1019
+ _e(n, {
1020
+ matches: t,
1021
+ loaderData: {},
1022
+ errors: { [r.id]: e }
1023
+ }, { flushSync: o });
1024
+ return;
1025
+ }
1026
+ let l = r && r.overrideNavigation ? {
1027
+ ...r.overrideNavigation,
1028
+ matches: a,
1029
+ historyAction: t
1030
+ } : void 0;
1031
+ I = new AbortController();
1032
+ let d = Dt(e.history, n, I.signal, r && r.submission), f = e.getContext ? await e.getContext() : new v(), p;
1033
+ if (r && r.pendingError) p = [Pt(a).route.id, {
1034
+ type: "error",
1035
+ error: r.pendingError
1036
+ }];
1037
+ else if (r && r.submission && Q(r.submission.formMethod)) {
1038
+ let i = await xe(d, n, r.submission, a, t, f, c.active, r && r.initialHydration === !0, {
1039
+ replace: r.replace,
1040
+ flushSync: o
1041
+ });
1042
+ if (i.shortCircuited) return;
1043
+ if (i.pendingActionResult) {
1044
+ let [e, t] = i.pendingActionResult;
1045
+ if (Z(t) && Ce(t.error) && t.error.status === 404) {
1046
+ I = null, _e(n, {
1047
+ matches: i.matches,
1048
+ loaderData: {},
1049
+ errors: { [e]: t.error }
1050
+ });
1051
+ return;
1052
+ }
1053
+ }
1054
+ a = i.matches || a, p = i.pendingActionResult, l = $t(n, a, t, r.submission), o = !1, c.active = !1, d = Dt(e.history, d.url, d.signal);
1055
+ }
1056
+ let { shortCircuited: m, matches: h, loaderData: g, errors: _, workingFetchers: y } = await Se(d, n, a, t, f, c.active, l, r && r.submission, r && r.fetcherSubmission, r && r.replace, r && r.initialHydration === !0, o, p, r && r.callSiteDefaultShouldRevalidate);
1057
+ m || (I = null, _e(n, {
1058
+ matches: h || a,
1059
+ ...Nt(p),
1060
+ loaderData: g,
1061
+ errors: _,
1062
+ ...y ? { fetchers: y } : {}
1063
+ }));
1064
+ }
1065
+ async function xe(t, n, i, c, l, d, f, p, m = {}) {
1066
+ if (Me(), U({ navigation: en(n, c, l, i) }, { flushSync: m.flushSync === !0 }), f) {
1067
+ let e = await st(c, n.pathname, t.signal);
1068
+ if (e.type === "aborted") return { shortCircuited: !0 };
1069
+ if (e.type === "error") {
1070
+ if (e.partialMatches.length === 0) {
1071
+ let { matches: t, route: n } = Ft(s.activeRoutes);
1072
+ return {
1073
+ matches: t,
1074
+ pendingActionResult: [n.id, {
1075
+ type: "error",
1076
+ error: e.error
1077
+ }]
1078
+ };
1079
+ }
1080
+ let t = Pt(e.partialMatches).route.id;
1081
+ return {
1082
+ matches: e.partialMatches,
1083
+ pendingActionResult: [t, {
1084
+ type: "error",
1085
+ error: e.error
1086
+ }]
1087
+ };
1088
+ }
1089
+ if (e.matches) c = e.matches;
1090
+ else {
1091
+ let { notFoundMatches: e, error: t, route: r } = Ye(n.pathname);
1092
+ return {
1093
+ matches: e,
1094
+ pendingActionResult: [r.id, {
1095
+ type: "error",
1096
+ error: t
1097
+ }]
1098
+ };
1099
+ }
1100
+ }
1101
+ let h, g = Xt(c, n);
1102
+ if (!g.route.action && !g.route.lazy) h = {
1103
+ type: "error",
1104
+ error: X(405, {
1105
+ method: t.method,
1106
+ pathname: n.pathname,
1107
+ routeId: g.route.id
1108
+ })
1109
+ };
1110
+ else {
1111
+ let e = await G(t, n, vt(a, o, t, n, c, g, p ? [] : r, d), d, null);
1112
+ if (h = e[g.route.id], !h) {
1113
+ for (let t of c) if (e[t.route.id]) {
1114
+ h = e[t.route.id];
1115
+ break;
1116
+ }
1117
+ }
1118
+ if (t.signal.aborted) return { shortCircuited: !0 };
1119
+ }
1120
+ if (Ut(h)) {
1121
+ let n;
1122
+ return n = m && m.replace != null ? m.replace : Et(h.response.headers.get("Location"), new URL(t.url), u, e.history) === N.location.pathname + N.location.search, await W(t, h, !0, {
1123
+ submission: i,
1124
+ replace: n
1125
+ }), { shortCircuited: !0 };
1126
+ }
1127
+ if (Z(h)) {
1128
+ let e = Pt(c, g.route.id);
1129
+ return (m && m.replace) !== !0 && (P = "PUSH"), {
1130
+ matches: c,
1131
+ pendingActionResult: [
1132
+ e.route.id,
1133
+ h,
1134
+ g.route.id
1135
+ ]
1136
+ };
1137
+ }
1138
+ return {
1139
+ matches: c,
1140
+ pendingActionResult: [g.route.id, h]
1141
+ };
1142
+ }
1143
+ async function Se(t, n, i, c, l, d, f, p, m, h, g, _, v, y) {
1144
+ let b = f || $t(n, i, c, p), x = p || m || Qt(b), S = !ie && !g;
1145
+ if (d) {
1146
+ if (S) {
1147
+ let e = we(v);
1148
+ U({
1149
+ navigation: b,
1150
+ ...e === void 0 ? {} : { actionData: e }
1151
+ }, { flushSync: _ });
1152
+ }
1153
+ let e = await st(i, n.pathname, t.signal);
1154
+ if (e.type === "aborted") return { shortCircuited: !0 };
1155
+ if (e.type === "error") {
1156
+ if (e.partialMatches.length === 0) {
1157
+ let { matches: t, route: n } = Ft(s.activeRoutes);
1158
+ return {
1159
+ matches: t,
1160
+ loaderData: {},
1161
+ errors: { [n.id]: e.error }
1162
+ };
1163
+ }
1164
+ let t = Pt(e.partialMatches).route.id;
1165
+ return {
1166
+ matches: e.partialMatches,
1167
+ loaderData: {},
1168
+ errors: { [t]: e.error }
1169
+ };
1170
+ }
1171
+ if (e.matches) i = e.matches;
1172
+ else {
1173
+ let { error: e, notFoundMatches: t, route: r } = Ye(n.pathname);
1174
+ return {
1175
+ matches: t,
1176
+ loaderData: {},
1177
+ errors: { [r.id]: e }
1178
+ };
1179
+ }
1180
+ }
1181
+ let C = s.activeRoutes, { dsMatches: w, revalidatingFetchers: T } = $e(t, l, a, o, e.history, N, i, x, n, g ? [] : r, g === !0, ae, oe, V, ue, R, C, u, e.patchRoutesOnNavigation != null, s.branches, v, y);
1182
+ if (ce = ++se, !e.dataStrategy && !w.some((e) => e.shouldLoad) && !w.some((e) => e.route.middleware && e.route.middleware.length > 0) && T.length === 0) {
1183
+ let e = new Map(N.fetchers), t = Re(e);
1184
+ return _e(n, {
1185
+ matches: i,
1186
+ loaderData: {},
1187
+ errors: v && Z(v[1]) ? { [v[0]]: v[1].error } : null,
1188
+ ...Nt(v),
1189
+ ...t ? { fetchers: e } : {}
1190
+ }, { flushSync: _ }), { shortCircuited: !0 };
1191
+ }
1192
+ if (S) {
1193
+ let e = {};
1194
+ if (!d) {
1195
+ e.navigation = b;
1196
+ let t = we(v);
1197
+ t !== void 0 && (e.actionData = t);
1198
+ }
1199
+ T.length > 0 && (e.fetchers = Te(T)), U(e, { flushSync: _ });
1200
+ }
1201
+ T.forEach((e) => {
1202
+ Y(e.key), e.controller && L.set(e.key, e.controller);
1203
+ });
1204
+ let E = () => T.forEach((e) => Y(e.key));
1205
+ I && I.signal.addEventListener("abort", E);
1206
+ let { loaderResults: D, fetcherResults: O } = await je(w, T, t, n, l);
1207
+ if (t.signal.aborted) return { shortCircuited: !0 };
1208
+ I && I.signal.removeEventListener("abort", E), T.forEach((e) => L.delete(e.key));
1209
+ let k = It(D);
1210
+ if (k) return await W(t, k.result, !0, { replace: h }), { shortCircuited: !0 };
1211
+ if (k = It(O), k) return R.add(k.key), await W(t, k.result, !0, { replace: h }), { shortCircuited: !0 };
1212
+ let A = new Map(N.fetchers), { loaderData: j, errors: M } = jt(N, i, D, v, T, O, A);
1213
+ g && N.errors && (M = {
1214
+ ...N.errors,
1215
+ ...M
1216
+ });
1217
+ let P = Re(A), F = ze(ce, A), ee = P || F || T.length > 0;
1218
+ return {
1219
+ matches: i,
1220
+ loaderData: j,
1221
+ errors: M,
1222
+ ...ee ? { workingFetchers: A } : {}
1223
+ };
1224
+ }
1225
+ function we(e) {
1226
+ if (e && !Z(e[1])) return { [e[0]]: e[1].data };
1227
+ if (N.actionData) return Object.keys(N.actionData).length === 0 ? null : N.actionData;
1228
+ }
1229
+ function Te(e) {
1230
+ let t = new Map(N.fetchers);
1231
+ return e.forEach((e) => {
1232
+ let n = t.get(e.key), r = tn(void 0, n ? n.data : void 0);
1233
+ t.set(e.key, r);
1234
+ }), t;
1235
+ }
1236
+ async function Ee(t, n, r, i) {
1237
+ Y(t);
1238
+ let a = (i && i.flushSync) === !0, o = Ne(M), c = s.activeRoutes, l = Ze(N.location, N.matches, u, r, n, i?.relative), d = O(c, l, u, !1, s.branches), f = ot(d, c, l);
1239
+ if (f.active && f.matches && (d = f.matches), o && o(Zt(e.history, l, d)), !d) {
1240
+ q(t, n, X(404, { pathname: l }), { flushSync: a });
1241
+ return;
1242
+ }
1243
+ let { path: p, submission: m, error: h } = Qe(!0, l, i);
1244
+ if (h) {
1245
+ q(t, n, h, { flushSync: a });
1246
+ return;
1247
+ }
1248
+ let g = e.getContext ? await e.getContext() : new v(), _ = (i && i.preventScrollReset) === !0;
1249
+ if (m && Q(m.formMethod)) {
1250
+ await De(t, n, p, d, g, f.active, a, _, m, i && i.defaultShouldRevalidate);
1251
+ return;
1252
+ }
1253
+ ue.set(t, {
1254
+ routeId: n,
1255
+ path: p
1256
+ }), await Oe(t, n, p, d, g, f.active, a, _, m);
1257
+ }
1258
+ async function De(t, n, i, l, d, f, p, m, h, g) {
1259
+ Me(), ue.delete(t), K(t, nn(h, N.fetchers.get(t)), { flushSync: p });
1260
+ let _ = new AbortController(), v = Dt(e.history, i, _.signal, h);
1261
+ if (f) {
1262
+ let e = await st(l, new URL(v.url).pathname, v.signal, t);
1263
+ if (e.type === "aborted") return;
1264
+ if (e.type === "error") {
1265
+ q(t, n, e.error, { flushSync: p });
1266
+ return;
1267
+ }
1268
+ if (e.matches) l = e.matches;
1269
+ else {
1270
+ q(t, n, X(404, { pathname: i }), { flushSync: p });
1271
+ return;
1272
+ }
1273
+ }
1274
+ let y = Xt(l, i);
1275
+ if (!y.route.action && !y.route.lazy) {
1276
+ q(t, n, X(405, {
1277
+ method: h.formMethod,
1278
+ pathname: i,
1279
+ routeId: n
1280
+ }), { flushSync: p });
1281
+ return;
1282
+ }
1283
+ L.set(t, _);
1284
+ let b = se, x = vt(a, o, v, i, l, y, r, d), S = await G(v, i, x, d, t), C = S[y.route.id];
1285
+ if (!C) {
1286
+ for (let e of x) if (S[e.route.id]) {
1287
+ C = S[e.route.id];
1288
+ break;
1289
+ }
1290
+ }
1291
+ if (v.signal.aborted) {
1292
+ L.get(t) === _ && L.delete(t);
1293
+ return;
1294
+ }
1295
+ if (V.has(t)) {
1296
+ if (Ut(C) || Z(C)) {
1297
+ K(t, rn(void 0));
1298
+ return;
1299
+ }
1300
+ } else {
1301
+ if (Ut(C)) {
1302
+ if (L.delete(t), ce > b) {
1303
+ K(t, rn(void 0));
1304
+ return;
1305
+ }
1306
+ return R.add(t), K(t, tn(h)), W(v, C, !1, {
1307
+ fetcherSubmission: h,
1308
+ preventScrollReset: m
1309
+ });
1310
+ }
1311
+ if (Z(C)) {
1312
+ q(t, n, C.error);
1313
+ return;
1314
+ }
1315
+ }
1316
+ let w = N.navigation.location || N.location, T = Dt(e.history, w, _.signal), E = s.activeRoutes, D = N.navigation.state === "idle" ? N.matches : O(E, N.navigation.location, u, !1, s.branches);
1317
+ c(D, "Didn't find any matches after fetcher action");
1318
+ let k = ++se;
1319
+ le.set(t, k);
1320
+ let { dsMatches: A, revalidatingFetchers: j } = $e(T, d, a, o, e.history, N, D, h, w, r, !1, ae, oe, V, ue, R, E, u, e.patchRoutesOnNavigation != null, s.branches, [y.route.id, C], g), M = tn(h, C.data), F = new Map(N.fetchers);
1321
+ F.set(t, M), j.filter((e) => e.key !== t).forEach((e) => {
1322
+ let t = e.key, n = F.get(t), r = tn(void 0, n ? n.data : void 0);
1323
+ F.set(t, r), Y(t), e.controller && L.set(t, e.controller);
1324
+ }), U({ fetchers: F });
1325
+ let ee = () => j.forEach((e) => Y(e.key));
1326
+ _.signal.addEventListener("abort", ee);
1327
+ let { loaderResults: te, fetcherResults: ne } = await je(A, j, T, w, d);
1328
+ if (_.signal.aborted) return;
1329
+ _.signal.removeEventListener("abort", ee), le.delete(t), L.delete(t), j.forEach((e) => L.delete(e.key));
1330
+ let re = N.fetchers.has(t), ie = (e) => {
1331
+ if (!re) return e;
1332
+ let n = new Map(e.fetchers);
1333
+ return n.set(t, rn(C.data)), {
1334
+ ...e,
1335
+ fetchers: n
1336
+ };
1337
+ }, z = It(te);
1338
+ if (z) return N = ie(N), W(T, z.result, !1, { preventScrollReset: m });
1339
+ if (z = It(ne), z) return R.add(z.key), N = ie(N), W(T, z.result, !1, { preventScrollReset: m });
1340
+ let B = new Map(N.fetchers);
1341
+ re && B.set(t, rn(C.data));
1342
+ let { loaderData: de, errors: H } = jt(N, D, te, void 0, j, ne, B);
1343
+ ze(k, B), N.navigation.state === "loading" && k > ce ? (c(P, "Expected pending action"), I && I.abort(), _e(N.navigation.location, {
1344
+ matches: D,
1345
+ loaderData: de,
1346
+ errors: H,
1347
+ fetchers: B
1348
+ })) : (U({
1349
+ errors: H,
1350
+ loaderData: Mt(N.loaderData, de, D, H),
1351
+ fetchers: B
1352
+ }), ae = !1);
1353
+ }
1354
+ async function Oe(t, n, i, s, c, l, u, d, f) {
1355
+ let p = N.fetchers.get(t);
1356
+ K(t, tn(f, p ? p.data : void 0), { flushSync: u });
1357
+ let m = new AbortController(), h = Dt(e.history, i, m.signal);
1358
+ if (l) {
1359
+ let e = await st(s, new URL(h.url).pathname, h.signal, t);
1360
+ if (e.type === "aborted") return;
1361
+ if (e.type === "error") {
1362
+ q(t, n, e.error, { flushSync: u });
1363
+ return;
1364
+ }
1365
+ if (e.matches) s = e.matches;
1366
+ else {
1367
+ q(t, n, X(404, { pathname: i }), { flushSync: u });
1368
+ return;
1369
+ }
1370
+ }
1371
+ let g = Xt(s, i);
1372
+ L.set(t, m);
1373
+ let _ = se, v = await G(h, i, vt(a, o, h, i, s, g, r, c), c, t), y = v[g.route.id];
1374
+ if (!y) {
1375
+ for (let e of s) if (v[e.route.id]) {
1376
+ y = v[e.route.id];
1377
+ break;
1378
+ }
1379
+ }
1380
+ if (L.get(t) === m && L.delete(t), !h.signal.aborted) {
1381
+ if (V.has(t)) {
1382
+ K(t, rn(void 0));
1383
+ return;
1384
+ }
1385
+ if (Ut(y)) if (ce > _) {
1386
+ K(t, rn(void 0));
1387
+ return;
1388
+ } else {
1389
+ R.add(t), await W(h, y, !1, { preventScrollReset: d });
1390
+ return;
1391
+ }
1392
+ if (Z(y)) {
1393
+ q(t, n, y.error);
1394
+ return;
1395
+ }
1396
+ K(t, rn(y.data));
1397
+ }
1398
+ }
1399
+ async function W(r, i, a, { submission: o, fetcherSubmission: s, preventScrollReset: l, replace: d } = {}) {
1400
+ a || (F?.resolve(), F = null), i.response.headers.has("X-Remix-Revalidate") && (ae = !0);
1401
+ let p = i.response.headers.get("Location");
1402
+ c(p, "Expected a Location header on the redirect Response"), p = Et(p, new URL(r.url), u, e.history);
1403
+ let m = f(N.location, p, { _isRedirect: !0 });
1404
+ if (n) {
1405
+ let e = !1;
1406
+ if (i.response.headers.has("X-Remix-Reload-Document")) e = !0;
1407
+ else if (de(p)) {
1408
+ let n = g(t, p, !0);
1409
+ e = n.origin !== t.location.origin || z(n.pathname, u) == null;
1410
+ }
1411
+ if (e) {
1412
+ d ? t.location.replace(p) : t.location.assign(p);
1413
+ return;
1414
+ }
1415
+ }
1416
+ I = null;
1417
+ let h = d === !0 || i.response.headers.has("X-Remix-Replace") ? "REPLACE" : "PUSH", { formMethod: _, formAction: v, formEncType: y } = N.navigation;
1418
+ !o && !s && _ && v && y && (o = Qt(N.navigation));
1419
+ let b = o || s;
1420
+ He.has(i.response.status) && b && Q(b.formMethod) ? await be(h, m, {
1421
+ submission: {
1422
+ ...b,
1423
+ formAction: p
1424
+ },
1425
+ preventScrollReset: l || ee,
1426
+ enableViewTransition: a ? te : void 0
1427
+ }) : await be(h, m, {
1428
+ overrideNavigation: $t(m, [], h, o),
1429
+ fetcherSubmission: s,
1430
+ preventScrollReset: l || ee,
1431
+ enableViewTransition: a ? te : void 0
1432
+ });
1433
+ }
1434
+ async function G(e, t, n, r, i) {
1435
+ let a, o = {};
1436
+ try {
1437
+ a = await yt(d, e, t, n, i, r, !1);
1438
+ } catch (e) {
1439
+ return n.filter((e) => e.shouldLoad).forEach((t) => {
1440
+ o[t.route.id] = {
1441
+ type: "error",
1442
+ error: e
1443
+ };
1444
+ }), o;
1445
+ }
1446
+ if (e.signal.aborted) return o;
1447
+ if (!Q(e.method)) for (let e of n) {
1448
+ if (a[e.route.id]?.type === "error") break;
1449
+ !a.hasOwnProperty(e.route.id) && !N.loaderData.hasOwnProperty(e.route.id) && (!N.errors || !N.errors.hasOwnProperty(e.route.id)) && e.shouldCallHandler() && (a[e.route.id] = {
1450
+ type: "error",
1451
+ result: /* @__PURE__ */ Error(`No result returned from dataStrategy for route ${e.route.id}`)
1452
+ });
1453
+ }
1454
+ for (let [t, r] of Object.entries(a)) if (Ht(r)) {
1455
+ let i = r.result;
1456
+ o[t] = {
1457
+ type: "redirect",
1458
+ response: Ct(i, e, t, n, u)
1459
+ };
1460
+ } else o[t] = await St(r);
1461
+ return o;
1462
+ }
1463
+ async function je(e, t, n, r, i) {
1464
+ let a = G(n, r, e, i, null), o = Promise.all(t.map(async (e) => {
1465
+ if (e.matches && e.match && e.request && e.controller) {
1466
+ let t = (await G(e.request, e.path, e.matches, i, e.key))[e.match.route.id];
1467
+ return { [e.key]: t };
1468
+ }
1469
+ return Promise.resolve({ [e.key]: {
1470
+ type: "error",
1471
+ error: X(404, { pathname: e.path })
1472
+ } });
1473
+ }));
1474
+ return {
1475
+ loaderResults: await a,
1476
+ fetcherResults: (await o).reduce((e, t) => Object.assign(e, t), {})
1477
+ };
1478
+ }
1479
+ function Me() {
1480
+ ae = !0, ue.forEach((e, t) => {
1481
+ L.has(t) && oe.add(t), Y(t);
1482
+ });
1483
+ }
1484
+ function K(e, t, n = {}) {
1485
+ let r = new Map(N.fetchers);
1486
+ r.set(e, t), U({ fetchers: r }, { flushSync: (n && n.flushSync) === !0 });
1487
+ }
1488
+ function q(e, t, n, r = {}) {
1489
+ let i = Pt(N.matches, t), a = new Map(N.fetchers);
1490
+ Fe(a, e), U({
1491
+ errors: { [i.route.id]: n },
1492
+ fetchers: a
1493
+ }, { flushSync: (r && r.flushSync) === !0 });
1494
+ }
1495
+ function J(e) {
1496
+ return B.set(e, (B.get(e) || 0) + 1), V.has(e) && V.delete(e), N.fetchers.get(e) || We;
1497
+ }
1498
+ function Pe(e, t) {
1499
+ Y(e, t?.reason), K(e, rn(null));
1500
+ }
1501
+ function Fe(e, t) {
1502
+ let n = N.fetchers.get(t);
1503
+ L.has(t) && !(n && n.state === "loading" && le.has(t)) && Y(t), ue.delete(t), le.delete(t), R.delete(t), V.delete(t), oe.delete(t), e.delete(t);
1504
+ }
1505
+ function Ie(e) {
1506
+ let t = (B.get(e) || 0) - 1;
1507
+ t <= 0 ? (B.delete(e), V.add(e)) : B.set(e, t), U({ fetchers: new Map(N.fetchers) });
1508
+ }
1509
+ function Y(e, t) {
1510
+ let n = L.get(e);
1511
+ n && (n.abort(t), L.delete(e));
1512
+ }
1513
+ function Le(e, t) {
1514
+ for (let n of e) {
1515
+ let e = t.get(n);
1516
+ c(e, `Expected fetcher: ${n}`);
1517
+ let r = rn(e.data);
1518
+ t.set(n, r);
1519
+ }
1520
+ }
1521
+ function Re(e) {
1522
+ let t = [], n = !1;
1523
+ for (let r of R) {
1524
+ let i = e.get(r);
1525
+ c(i, `Expected fetcher: ${r}`), i.state === "loading" && (R.delete(r), t.push(r), n = !0);
1526
+ }
1527
+ return Le(t, e), n;
1528
+ }
1529
+ function ze(e, t) {
1530
+ let n = [];
1531
+ for (let [r, i] of le) if (i < e) {
1532
+ let e = t.get(r);
1533
+ c(e, `Expected fetcher: ${r}`), e.state === "loading" && (Y(r), le.delete(r), n.push(r));
1534
+ }
1535
+ return Le(n, t), n.length > 0;
1536
+ }
1537
+ function Be(e, t) {
1538
+ let n = N.blockers.get(e) || Ge;
1539
+ return H.get(e) !== t && H.set(e, t), n;
1540
+ }
1541
+ function Ve(e) {
1542
+ N.blockers.delete(e), H.delete(e);
1543
+ }
1544
+ function Ke(e, t) {
1545
+ let n = N.blockers.get(e) || Ge;
1546
+ c(n.state === "unblocked" && t.state === "blocked" || n.state === "blocked" && t.state === "blocked" || n.state === "blocked" && t.state === "proceeding" || n.state === "blocked" && t.state === "unblocked" || n.state === "proceeding" && t.state === "unblocked", `Invalid blocker state transition: ${n.state} -> ${t.state}`);
1547
+ let r = new Map(N.blockers);
1548
+ r.set(e, t), U({ blockers: r });
1549
+ }
1550
+ function qe({ currentLocation: e, nextLocation: t, historyAction: n }) {
1551
+ if (H.size === 0) return;
1552
+ H.size > 1 && l(!1, "A router only supports one blocker at a time");
1553
+ let r = Array.from(H.entries()), [i, a] = r[r.length - 1], o = N.blockers.get(i);
1554
+ if (!(o && o.state === "proceeding") && a({
1555
+ currentLocation: e,
1556
+ nextLocation: t,
1557
+ historyAction: n
1558
+ })) return i;
1559
+ }
1560
+ function Ye(e) {
1561
+ let t = X(404, { pathname: e }), n = s.activeRoutes, { matches: r, route: i } = Ft(n);
1562
+ return {
1563
+ notFoundMatches: r,
1564
+ route: i,
1565
+ error: t
1566
+ };
1567
+ }
1568
+ function Xe(e, t, n) {
1569
+ if (b = e, S = t, x = n || null, !C && N.navigation === Ue) {
1570
+ C = !0;
1571
+ let e = it(N.location, N.matches);
1572
+ e != null && U({ restoreScrollPosition: e });
1573
+ }
1574
+ return () => {
1575
+ b = null, S = null, x = null;
1576
+ };
1577
+ }
1578
+ function nt(e, t) {
1579
+ return x && x(e, t.map((e) => k(e, N.loaderData))) || e.key;
1580
+ }
1581
+ function rt(e, t) {
1582
+ if (b && S) {
1583
+ let n = nt(e, t);
1584
+ b[n] = S();
1585
+ }
1586
+ }
1587
+ function it(e, t) {
1588
+ if (b) {
1589
+ let n = nt(e, t), r = b[n];
1590
+ if (typeof r == "number") return r;
1591
+ }
1592
+ return null;
1593
+ }
1594
+ function ot(t, n, r) {
1595
+ if (e.patchRoutesOnNavigation) {
1596
+ let e = s.branches;
1597
+ if (!t) return {
1598
+ active: !0,
1599
+ matches: O(n, r, u, !0, e) || []
1600
+ };
1601
+ if (Object.keys(t[0].params).length > 0) return {
1602
+ active: !0,
1603
+ matches: O(n, r, u, !0, e)
1604
+ };
1605
+ }
1606
+ return {
1607
+ active: !1,
1608
+ matches: null
1609
+ };
1610
+ }
1611
+ async function st(t, n, r, i) {
1612
+ if (!e.patchRoutesOnNavigation) return {
1613
+ type: "success",
1614
+ matches: t
1615
+ };
1616
+ let c = t;
1617
+ for (;;) {
1618
+ let t = o;
1619
+ try {
1620
+ await e.patchRoutesOnNavigation({
1621
+ signal: r,
1622
+ path: n,
1623
+ matches: c,
1624
+ fetcherKey: i,
1625
+ patch: (e, n) => {
1626
+ r.aborted || at(e, n, s, t, a, !1);
1627
+ }
1628
+ });
1629
+ } catch (e) {
1630
+ return {
1631
+ type: "error",
1632
+ error: e,
1633
+ partialMatches: c
1634
+ };
1635
+ }
1636
+ if (r.aborted) return { type: "aborted" };
1637
+ let l = s.branches, d = O(s.activeRoutes, n, u, !1, l), f = null;
1638
+ if (d && (Object.keys(d[0].params).length === 0 || (f = O(s.activeRoutes, n, u, !0, l), !(f && c.length < f.length && ct(c, f.slice(0, c.length)))))) return {
1639
+ type: "success",
1640
+ matches: d
1641
+ };
1642
+ if (f ||= O(s.activeRoutes, n, u, !0, l), !f || ct(c, f)) return {
1643
+ type: "success",
1644
+ matches: null
1645
+ };
1646
+ c = f;
1647
+ }
1648
+ }
1649
+ function ct(e, t) {
1650
+ return e.length === t.length && e.every((e, n) => e.route.id === t[n].route.id);
1651
+ }
1652
+ function lt(e) {
1653
+ o = {}, s.setHmrRoutes(T(e, a, void 0, o));
1654
+ }
1655
+ function ut(e, t, n = !1) {
1656
+ at(e, t, s, o, a, n), s.hasHMRRoutes || U({});
1657
+ }
1658
+ return M = {
1659
+ get basename() {
1660
+ return u;
1661
+ },
1662
+ get future() {
1663
+ return p;
1664
+ },
1665
+ get state() {
1666
+ return N;
1667
+ },
1668
+ get routes() {
1669
+ return s.stableRoutes;
1670
+ },
1671
+ get branches() {
1672
+ return s.branches;
1673
+ },
1674
+ get manifest() {
1675
+ return o;
1676
+ },
1677
+ get window() {
1678
+ return t;
1679
+ },
1680
+ initialize: me,
1681
+ subscribe: ge,
1682
+ enableScrollRestoration: Xe,
1683
+ navigate: ve,
1684
+ fetch: Ee,
1685
+ revalidate: ye,
1686
+ createHref: (t) => e.history.createHref(t),
1687
+ encodeLocation: (t) => e.history.encodeLocation(t),
1688
+ getFetcher: J,
1689
+ resetFetcher: Pe,
1690
+ deleteFetcher: Ie,
1691
+ dispose: he,
1692
+ getBlocker: Be,
1693
+ deleteBlocker: Ve,
1694
+ patchRoutes: ut,
1695
+ _internalFetchControllers: L,
1696
+ _internalSetRoutes: lt,
1697
+ _internalSetStateDoNotUseOrYouWillBreakYourApp(e) {
1698
+ U(e);
1699
+ }
1700
+ }, e.instrumentations && (M = Ae(M, e.instrumentations.map((e) => e.router).filter(Boolean))), M;
1701
+ }
1702
+ function Xe(e) {
1703
+ return e != null && ("formData" in e && e.formData != null || "body" in e && e.body !== void 0);
1704
+ }
1705
+ function Ze(e, t, n, r, i, a) {
1706
+ let o, s;
1707
+ if (i) {
1708
+ o = [];
1709
+ for (let e of t) if (o.push(e), e.route.id === i) {
1710
+ s = e;
1711
+ break;
1712
+ }
1713
+ } else o = t, s = t[t.length - 1];
1714
+ let c = he(r || ".", me(o), z(e.pathname, n) || e.pathname, a === "path");
1715
+ if (r ?? (c.search = e.search, c.hash = e.hash), (r == null || r === "" || r === ".") && s) {
1716
+ let e = Yt(c.search);
1717
+ if (s.route.index && !e) c.search = c.search ? c.search.replace(/^\?/, "?index&") : "?index";
1718
+ else if (!s.route.index && e) {
1719
+ let e = new URLSearchParams(c.search), t = e.getAll("index");
1720
+ e.delete("index"), t.filter((e) => e).forEach((t) => e.append("index", t));
1721
+ let n = e.toString();
1722
+ c.search = n ? `?${n}` : "";
1723
+ }
1724
+ }
1725
+ return n !== "/" && (c.pathname = B({
1726
+ basename: n,
1727
+ pathname: c.pathname
1728
+ })), p(c);
1729
+ }
1730
+ function Qe(e, t, n) {
1731
+ if (!n || !Xe(n)) return { path: t };
1732
+ if (n.formMethod && !Jt(n.formMethod)) return {
1733
+ path: t,
1734
+ error: X(405, { method: n.formMethod })
1735
+ };
1736
+ let r = () => ({
1737
+ path: t,
1738
+ error: X(400, { type: "invalid-body" })
1739
+ }), i = (n.formMethod || "get").toUpperCase(), a = Lt(t);
1740
+ if (n.body !== void 0) {
1741
+ if (n.formEncType === "text/plain") {
1742
+ if (!Q(i)) return r();
1743
+ let e = typeof n.body == "string" ? n.body : n.body instanceof FormData || n.body instanceof URLSearchParams ? Array.from(n.body.entries()).reduce((e, [t, n]) => `${e}${t}=${n}\n`, "") : String(n.body);
1744
+ return {
1745
+ path: t,
1746
+ submission: {
1747
+ formMethod: i,
1748
+ formAction: a,
1749
+ formEncType: n.formEncType,
1750
+ formData: void 0,
1751
+ json: void 0,
1752
+ text: e
1753
+ }
1754
+ };
1755
+ }
1756
+ if (n.formEncType === "application/json") {
1757
+ if (!Q(i)) return r();
1758
+ try {
1759
+ let e = typeof n.body == "string" ? JSON.parse(n.body) : n.body;
1760
+ return {
1761
+ path: t,
1762
+ submission: {
1763
+ formMethod: i,
1764
+ formAction: a,
1765
+ formEncType: n.formEncType,
1766
+ formData: void 0,
1767
+ json: e,
1768
+ text: void 0
1769
+ }
1770
+ };
1771
+ } catch {
1772
+ return r();
1773
+ }
1774
+ }
1775
+ }
1776
+ c(typeof FormData == "function", "FormData is not available in this environment");
1777
+ let o, s;
1778
+ if (n.formData) o = Ot(n.formData), s = n.formData;
1779
+ else if (n.body instanceof FormData) o = Ot(n.body), s = n.body;
1780
+ else if (n.body instanceof URLSearchParams) o = n.body, s = kt(o);
1781
+ else if (n.body == null) o = new URLSearchParams(), s = new FormData();
1782
+ else try {
1783
+ o = new URLSearchParams(n.body), s = kt(o);
1784
+ } catch {
1785
+ return r();
1786
+ }
1787
+ let l = {
1788
+ formMethod: i,
1789
+ formAction: a,
1790
+ formEncType: n && n.formEncType || "application/x-www-form-urlencoded",
1791
+ formData: s,
1792
+ json: void 0,
1793
+ text: void 0
1794
+ };
1795
+ if (Q(l.formMethod)) return {
1796
+ path: t,
1797
+ submission: l
1798
+ };
1799
+ let u = m(t);
1800
+ return e && u.search && Yt(u.search) && o.append("index", ""), u.search = `?${o}`, {
1801
+ path: p(u),
1802
+ submission: l
1803
+ };
1804
+ }
1805
+ function $e(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x) {
1806
+ let S = b ? Z(b[1]) ? b[1].error : b[1].data : void 0, C = i.createURL(a.location), w = i.createURL(c), T;
1807
+ if (u && a.errors) {
1808
+ let e = Object.keys(a.errors)[0];
1809
+ T = o.findIndex((t) => t.route.id === e);
1810
+ } else if (b && Z(b[1])) {
1811
+ let e = b[0];
1812
+ T = o.findIndex((t) => t.route.id === e) - 1;
1813
+ }
1814
+ let E = b ? b[1].statusCode : void 0, D = E && E >= 400, k = {
1815
+ currentUrl: C,
1816
+ currentParams: a.matches[0]?.params || {},
1817
+ nextUrl: w,
1818
+ nextParams: o[0].params,
1819
+ ...s,
1820
+ actionResult: S,
1821
+ actionStatus: E
1822
+ }, A = we(o), j = o.map((i, o) => {
1823
+ let { route: s } = i, f = null;
1824
+ if (T != null && o > T) f = !1;
1825
+ else if (s.lazy) f = !0;
1826
+ else if (!et(s)) f = !1;
1827
+ else if (u) {
1828
+ let { shouldLoad: e } = tt(s, a.loaderData, a.errors);
1829
+ f = e;
1830
+ } else nt(a.loaderData, a.matches[o], i) && (f = !0);
1831
+ if (f !== null) return _t(n, r, e, c, A, i, l, t, f);
1832
+ let p = !1;
1833
+ typeof x == "boolean" ? p = x : D ? p = !1 : d || C.pathname + C.search === w.pathname + w.search ? p = !0 : C.search === w.search ? rt(a.matches[o], i) && (p = !0) : p = !0;
1834
+ let m = {
1835
+ ...k,
1836
+ defaultShouldRevalidate: p
1837
+ };
1838
+ return _t(n, r, e, c, A, i, l, t, it(i, m), m, x);
1839
+ }), M = [];
1840
+ return m.forEach((e, s) => {
1841
+ if (u || !o.some((t) => t.route.id === e.routeId) || p.has(s)) return;
1842
+ let c = a.fetchers.get(s), m = c && c.state !== "idle" && c.data === void 0, b = O(g, e.path, _ ?? "/", !1, y);
1843
+ if (!b) {
1844
+ if (v && m) return;
1845
+ M.push({
1846
+ key: s,
1847
+ routeId: e.routeId,
1848
+ path: e.path,
1849
+ matches: null,
1850
+ match: null,
1851
+ request: null,
1852
+ controller: null
1853
+ });
1854
+ return;
1855
+ }
1856
+ if (h.has(s)) return;
1857
+ let S = Xt(b, e.path), C = new AbortController(), w = Dt(i, e.path, C.signal), T = null;
1858
+ if (f.has(s)) f.delete(s), T = vt(n, r, w, e.path, b, S, l, t);
1859
+ else if (m) d && (T = vt(n, r, w, e.path, b, S, l, t));
1860
+ else {
1861
+ let i;
1862
+ i = typeof x == "boolean" ? x : !D && d;
1863
+ let a = {
1864
+ ...k,
1865
+ defaultShouldRevalidate: i
1866
+ };
1867
+ it(S, a) && (T = vt(n, r, w, e.path, b, S, l, t, a));
1868
+ }
1869
+ T && M.push({
1870
+ key: s,
1871
+ routeId: e.routeId,
1872
+ path: e.path,
1873
+ matches: T,
1874
+ match: S,
1875
+ request: w,
1876
+ controller: C
1877
+ });
1878
+ }), {
1879
+ dsMatches: j,
1880
+ revalidatingFetchers: M
1881
+ };
1882
+ }
1883
+ function et(e) {
1884
+ return e.loader != null || e.middleware != null && e.middleware.length > 0;
1885
+ }
1886
+ function tt(e, t, n) {
1887
+ if (e.lazy) return {
1888
+ shouldLoad: !0,
1889
+ renderFallback: !0
1890
+ };
1891
+ if (!et(e)) return {
1892
+ shouldLoad: !1,
1893
+ renderFallback: !1
1894
+ };
1895
+ let r = t != null && e.id in t, i = n != null && n[e.id] !== void 0;
1896
+ if (!r && i) return {
1897
+ shouldLoad: !1,
1898
+ renderFallback: !1
1899
+ };
1900
+ if (typeof e.loader == "function" && e.loader.hydrate === !0) return {
1901
+ shouldLoad: !0,
1902
+ renderFallback: !r
1903
+ };
1904
+ let a = !r && !i;
1905
+ return {
1906
+ shouldLoad: a,
1907
+ renderFallback: a
1908
+ };
1909
+ }
1910
+ function nt(e, t, n) {
1911
+ let r = !t || n.route.id !== t.route.id, i = !e.hasOwnProperty(n.route.id);
1912
+ return r || i;
1913
+ }
1914
+ function rt(e, t) {
1915
+ let n = e.route.path;
1916
+ return e.pathname !== t.pathname || n != null && n.endsWith("*") && e.params["*"] !== t.params["*"];
1917
+ }
1918
+ function it(e, t) {
1919
+ if (e.route.shouldRevalidate) {
1920
+ let n = e.route.shouldRevalidate(t);
1921
+ if (typeof n == "boolean") return n;
1922
+ }
1923
+ return t.defaultShouldRevalidate;
1924
+ }
1925
+ function at(e, t, n, r, i, a) {
1926
+ let o;
1927
+ if (e) {
1928
+ let t = r[e];
1929
+ c(t, `No route found to patch children into: routeId = ${e}`), t.children ||= [], o = t.children;
1930
+ } else o = n.activeRoutes;
1931
+ let s = [], l = [];
1932
+ if (t.forEach((e) => {
1933
+ let t = o.find((t) => ot(e, t));
1934
+ t ? l.push({
1935
+ existingRoute: t,
1936
+ newRoute: e
1937
+ }) : s.push(e);
1938
+ }), s.length > 0) {
1939
+ let t = T(s, i, [
1940
+ e || "_",
1941
+ "patch",
1942
+ String(o?.length || "0")
1943
+ ], r);
1944
+ o.push(...t);
1945
+ }
1946
+ if (a && l.length > 0) for (let e = 0; e < l.length; e++) {
1947
+ let { existingRoute: t, newRoute: n } = l[e], r = t, [a] = T([n], i, [], {}, !0);
1948
+ Object.assign(r, {
1949
+ element: a.element ? a.element : r.element,
1950
+ errorElement: a.errorElement ? a.errorElement : r.errorElement,
1951
+ hydrateFallbackElement: a.hydrateFallbackElement ? a.hydrateFallbackElement : r.hydrateFallbackElement
1952
+ });
1953
+ }
1954
+ n.hasHMRRoutes || n.setRoutes([...n.activeRoutes]);
1955
+ }
1956
+ function ot(e, t) {
1957
+ return "id" in e && "id" in t && e.id === t.id ? !0 : e.index !== t.index || e.path !== t.path || e.caseSensitive !== t.caseSensitive ? !1 : (!e.children || e.children.length === 0) && (!t.children || t.children.length === 0) ? !0 : e.children?.every((e, n) => t.children?.some((t) => ot(e, t))) ?? !1;
1958
+ }
1959
+ var st = /* @__PURE__ */ new WeakMap(), ct = ({ key: e, route: t, manifest: n, mapRouteProperties: r }) => {
1960
+ let i = n[t.id];
1961
+ if (c(i, "No route found in manifest"), !i.lazy || typeof i.lazy != "object") return;
1962
+ let a = i.lazy[e];
1963
+ if (!a) return;
1964
+ let o = st.get(i);
1965
+ o || (o = {}, st.set(i, o));
1966
+ let s = o[e];
1967
+ if (s) return s;
1968
+ let u = (async () => {
1969
+ let t = b(e), n = i[e] !== void 0;
1970
+ if (t) l(!t, "Route property " + e + " is not a supported lazy route property. This property will be ignored."), o[e] = Promise.resolve();
1971
+ else if (n) l(!1, `Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);
1972
+ else {
1973
+ let t = await a();
1974
+ t != null && (Object.assign(i, { [e]: t }), Object.assign(i, r(i)));
1975
+ }
1976
+ typeof i.lazy == "object" && (i.lazy[e] = void 0, Object.values(i.lazy).every((e) => e === void 0) && (i.lazy = void 0));
1977
+ })();
1978
+ return o[e] = u, u;
1979
+ }, lt = /* @__PURE__ */ new WeakMap();
1980
+ function ut(e, t, n, r, i) {
1981
+ let a = n[e.id];
1982
+ if (c(a, "No route found in manifest"), !e.lazy) return {
1983
+ lazyRoutePromise: void 0,
1984
+ lazyHandlerPromise: void 0
1985
+ };
1986
+ if (typeof e.lazy == "function") {
1987
+ let t = lt.get(a);
1988
+ if (t) return {
1989
+ lazyRoutePromise: t,
1990
+ lazyHandlerPromise: t
1991
+ };
1992
+ let n = (async () => {
1993
+ c(typeof e.lazy == "function", "No lazy route function found");
1994
+ let t = await e.lazy(), n = {};
1995
+ for (let e in t) {
1996
+ let r = t[e];
1997
+ if (r === void 0) continue;
1998
+ let i = S(e), o = a[e] !== void 0;
1999
+ i ? l(!i, "Route property " + e + " is not a supported property to be returned from a lazy route function. This property will be ignored.") : o ? l(!o, `Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`) : n[e] = r;
2000
+ }
2001
+ Object.assign(a, n), Object.assign(a, {
2002
+ ...r(a),
2003
+ lazy: void 0
2004
+ });
2005
+ })();
2006
+ return lt.set(a, n), n.catch(() => {}), {
2007
+ lazyRoutePromise: n,
2008
+ lazyHandlerPromise: n
2009
+ };
2010
+ }
2011
+ let o = Object.keys(e.lazy), s = [], u;
2012
+ for (let a of o) {
2013
+ if (i && i.includes(a)) continue;
2014
+ let o = ct({
2015
+ key: a,
2016
+ route: e,
2017
+ manifest: n,
2018
+ mapRouteProperties: r
2019
+ });
2020
+ o && (s.push(o), a === t && (u = o));
2021
+ }
2022
+ let d = s.length > 0 ? Promise.all(s).then(() => {}) : void 0;
2023
+ return d?.catch(() => {}), u?.catch(() => {}), {
2024
+ lazyRoutePromise: d,
2025
+ lazyHandlerPromise: u
2026
+ };
2027
+ }
2028
+ async function dt(e) {
2029
+ let t = e.matches.filter((e) => e.shouldLoad), n = {};
2030
+ return (await Promise.all(t.map((e) => e.resolve()))).forEach((e, r) => {
2031
+ n[t[r].route.id] = e;
2032
+ }), n;
2033
+ }
2034
+ async function ft(e) {
2035
+ return e.matches.some((e) => e.route.middleware) ? pt(e, () => dt(e)) : dt(e);
2036
+ }
2037
+ function pt(e, t) {
2038
+ return mt(e, t, (e) => {
2039
+ if (qt(e)) throw e;
2040
+ return e;
2041
+ }, Bt, n);
2042
+ async function n(t, n, r) {
2043
+ if (r) return Object.assign(r.value, { [n]: {
2044
+ type: "error",
2045
+ result: t
2046
+ } });
2047
+ {
2048
+ let { matches: r } = e, i = Math.min(Math.max(r.findIndex((e) => e.route.id === n), 0), Math.max(r.findIndex((e) => e.shouldCallHandler()), 0)), a = r[i].route.id;
2049
+ for (let e of r.slice(0, i + 1)) try {
2050
+ await e._lazyPromises?.route;
2051
+ } catch {
2052
+ a = e.route.id;
2053
+ break;
2054
+ }
2055
+ return { [Pt(r, a).route.id]: {
2056
+ type: "error",
2057
+ result: t
2058
+ } };
2059
+ }
2060
+ }
2061
+ }
2062
+ async function mt(e, t, n, r, i) {
2063
+ let { matches: a, ...o } = e;
2064
+ return await ht(o, a.flatMap((e) => e.route.middleware ? e.route.middleware.map((t) => [e.route.id, t]) : []), t, n, r, i);
2065
+ }
2066
+ async function ht(e, t, n, r, i, a, o = 0) {
2067
+ let { request: s } = e;
2068
+ if (s.signal.aborted) throw s.signal.reason ?? /* @__PURE__ */ Error(`Request aborted: ${s.method} ${s.url}`);
2069
+ let c = t[o];
2070
+ if (!c) return await n();
2071
+ let [l, u] = c, d, f = async () => {
2072
+ if (d) throw Error("You may only call `next()` once per middleware");
2073
+ try {
2074
+ return d = { value: await ht(e, t, n, r, i, a, o + 1) }, d.value;
2075
+ } catch (e) {
2076
+ return d = { value: await a(e, l, d) }, d.value;
2077
+ }
2078
+ };
2079
+ try {
2080
+ let t = await u(e, f), n = t == null ? void 0 : r(t);
2081
+ return i(n) ? n : d ? n ?? d.value : (d = { value: await f() }, d.value);
2082
+ } catch (e) {
2083
+ return await a(e, l, d);
2084
+ }
2085
+ }
2086
+ function gt(e, t, n, r, i) {
2087
+ let a = ct({
2088
+ key: "middleware",
2089
+ route: r.route,
2090
+ manifest: t,
2091
+ mapRouteProperties: e
2092
+ }), o = ut(r.route, Q(n.method) ? "action" : "loader", t, e, i);
2093
+ return {
2094
+ middleware: a,
2095
+ route: o.lazyRoutePromise,
2096
+ handler: o.lazyHandlerPromise
2097
+ };
2098
+ }
2099
+ function _t(e, t, n, r, i, a, o, s, c, l = null, u) {
2100
+ let d = !1, f = gt(e, t, n, a, o);
2101
+ return {
2102
+ ...a,
2103
+ _lazyPromises: f,
2104
+ shouldLoad: c,
2105
+ shouldRevalidateArgs: l,
2106
+ shouldCallHandler(e) {
2107
+ return d = !0, l ? typeof u == "boolean" ? it(a, {
2108
+ ...l,
2109
+ defaultShouldRevalidate: u
2110
+ }) : typeof e == "boolean" ? it(a, {
2111
+ ...l,
2112
+ defaultShouldRevalidate: e
2113
+ }) : it(a, l) : c;
2114
+ },
2115
+ resolve(e) {
2116
+ let { lazy: t, loader: o, middleware: l } = a.route, u = d || c || e && !Q(n.method) && (t || o), p = l && l.length > 0 && !o && !t;
2117
+ return u && (Q(n.method) || !p) ? bt({
2118
+ request: n,
2119
+ path: r,
2120
+ pattern: i,
2121
+ match: a,
2122
+ lazyHandlerPromise: f?.handler,
2123
+ lazyRoutePromise: f?.route,
2124
+ handlerOverride: e,
2125
+ scopedContext: s
2126
+ }) : Promise.resolve({
2127
+ type: "data",
2128
+ result: void 0
2129
+ });
2130
+ }
2131
+ };
2132
+ }
2133
+ function vt(e, t, n, r, i, a, o, s, c = null) {
2134
+ return i.map((l) => l.route.id === a.route.id ? _t(e, t, n, r, we(i), l, o, s, !0, c) : {
2135
+ ...l,
2136
+ shouldLoad: !1,
2137
+ shouldRevalidateArgs: c,
2138
+ shouldCallHandler: () => !1,
2139
+ _lazyPromises: gt(e, t, n, l, o),
2140
+ resolve: () => Promise.resolve({
2141
+ type: "data",
2142
+ result: void 0
2143
+ })
2144
+ });
2145
+ }
2146
+ async function yt(e, t, n, r, i, a, o) {
2147
+ r.some((e) => e._lazyPromises?.middleware) && await Promise.all(r.map((e) => e._lazyPromises?.middleware));
2148
+ let s = {
2149
+ request: t,
2150
+ url: Te(t, n),
2151
+ pattern: we(r),
2152
+ params: r[0].params,
2153
+ context: a,
2154
+ matches: r
2155
+ }, c = o ? () => {
2156
+ throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`");
2157
+ } : (e) => {
2158
+ let t = s;
2159
+ return pt(t, () => e({
2160
+ ...t,
2161
+ fetcherKey: i,
2162
+ runClientMiddleware: () => {
2163
+ throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler");
2164
+ }
2165
+ }));
2166
+ }, l = await e({
2167
+ ...s,
2168
+ fetcherKey: i,
2169
+ runClientMiddleware: c
2170
+ });
2171
+ try {
2172
+ await Promise.all(r.flatMap((e) => [e._lazyPromises?.handler, e._lazyPromises?.route]));
2173
+ } catch {}
2174
+ return l;
2175
+ }
2176
+ async function bt({ request: e, path: t, pattern: n, match: r, lazyHandlerPromise: i, lazyRoutePromise: a, handlerOverride: o, scopedContext: s }) {
2177
+ let c, l, u = Q(e.method), d = u ? "action" : "loader", f = (i) => {
2178
+ let a, c = new Promise((e, t) => a = t);
2179
+ l = () => a(), e.signal.addEventListener("abort", l);
2180
+ let u = (a) => typeof i == "function" ? i({
2181
+ request: e,
2182
+ url: Te(e, t),
2183
+ pattern: n,
2184
+ params: r.params,
2185
+ context: s
2186
+ }, ...a === void 0 ? [] : [a]) : Promise.reject(/* @__PURE__ */ Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)), f = (async () => {
2187
+ try {
2188
+ return {
2189
+ type: "data",
2190
+ result: await (o ? o((e) => u(e)) : u())
2191
+ };
2192
+ } catch (e) {
2193
+ return {
2194
+ type: "error",
2195
+ result: e
2196
+ };
2197
+ }
2198
+ })();
2199
+ return Promise.race([f, c]);
2200
+ };
2201
+ try {
2202
+ let t = u ? r.route.action : r.route.loader;
2203
+ if (i || a) if (t) {
2204
+ let e, [n] = await Promise.all([
2205
+ f(t).catch((t) => {
2206
+ e = t;
2207
+ }),
2208
+ i,
2209
+ a
2210
+ ]);
2211
+ if (e !== void 0) throw e;
2212
+ c = n;
2213
+ } else {
2214
+ await i;
2215
+ let t = u ? r.route.action : r.route.loader;
2216
+ if (t) [c] = await Promise.all([f(t), a]);
2217
+ else if (d === "action") {
2218
+ let t = new URL(e.url), n = t.pathname + t.search;
2219
+ throw X(405, {
2220
+ method: e.method,
2221
+ pathname: n,
2222
+ routeId: r.route.id
2223
+ });
2224
+ } else return {
2225
+ type: "data",
2226
+ result: void 0
2227
+ };
2228
+ }
2229
+ else if (t) c = await f(t);
2230
+ else {
2231
+ let t = new URL(e.url);
2232
+ throw X(404, { pathname: t.pathname + t.search });
2233
+ }
2234
+ } catch (e) {
2235
+ return {
2236
+ type: "error",
2237
+ result: e
2238
+ };
2239
+ } finally {
2240
+ l && e.signal.removeEventListener("abort", l);
2241
+ }
2242
+ return c;
2243
+ }
2244
+ async function xt(e) {
2245
+ let t = e.headers.get("Content-Type");
2246
+ return t && /\bapplication\/json\b/.test(t) ? e.body == null ? null : e.json() : e.text();
2247
+ }
2248
+ async function St(e) {
2249
+ let { result: t, type: n } = e;
2250
+ if (Gt(t)) {
2251
+ let e;
2252
+ try {
2253
+ e = await xt(t);
2254
+ } catch (e) {
2255
+ return {
2256
+ type: "error",
2257
+ error: e
2258
+ };
2259
+ }
2260
+ return n === "error" ? {
2261
+ type: "error",
2262
+ error: new Se(t.status, t.statusText, e),
2263
+ statusCode: t.status,
2264
+ headers: t.headers
2265
+ } : {
2266
+ type: "data",
2267
+ data: e,
2268
+ statusCode: t.status,
2269
+ headers: t.headers
2270
+ };
2271
+ }
2272
+ return n === "error" ? Wt(t) ? t.data instanceof Error ? {
2273
+ type: "error",
2274
+ error: t.data,
2275
+ statusCode: t.init?.status,
2276
+ headers: t.init?.headers ? new Headers(t.init.headers) : void 0
2277
+ } : {
2278
+ type: "error",
2279
+ error: zt(t),
2280
+ statusCode: Ce(t) ? t.status : void 0,
2281
+ headers: t.init?.headers ? new Headers(t.init.headers) : void 0
2282
+ } : {
2283
+ type: "error",
2284
+ error: t,
2285
+ statusCode: Ce(t) ? t.status : void 0
2286
+ } : Wt(t) ? {
2287
+ type: "data",
2288
+ data: t.data,
2289
+ statusCode: t.init?.status,
2290
+ headers: t.init?.headers ? new Headers(t.init.headers) : void 0
2291
+ } : {
2292
+ type: "data",
2293
+ data: t
2294
+ };
2295
+ }
2296
+ function Ct(e, t, n, r, i) {
2297
+ let a = e.headers.get("Location");
2298
+ if (c(a, "Redirects returned/thrown from loaders/actions must have a Location header"), !de(a)) {
2299
+ let o = r.slice(0, r.findIndex((e) => e.route.id === n) + 1);
2300
+ a = Ze(new URL(t.url), o, i, a), e.headers.set("Location", a);
2301
+ }
2302
+ return e;
2303
+ }
2304
+ var wt = [
2305
+ "about:",
2306
+ "blob:",
2307
+ "chrome:",
2308
+ "chrome-untrusted:",
2309
+ "content:",
2310
+ "data:",
2311
+ "devtools:",
2312
+ "file:",
2313
+ "filesystem:",
2314
+ "javascript:"
2315
+ ];
2316
+ function Tt(e) {
2317
+ try {
2318
+ return wt.includes(new URL(e).protocol);
2319
+ } catch {
2320
+ return !1;
2321
+ }
2322
+ }
2323
+ function Et(e, t, n, a) {
2324
+ if (de(e)) {
2325
+ let a = e, o = r.test(a) ? new URL(i(a, t.protocol)) : new URL(a);
2326
+ if (Tt(o.toString())) throw Error("Invalid redirect location");
2327
+ let s = z(o.pathname, n) != null;
2328
+ if (o.origin === t.origin && s) return ge(o.pathname) + o.search + o.hash;
2329
+ }
2330
+ try {
2331
+ if (Tt(a.createURL(e).toString())) throw Error("Invalid redirect location");
2332
+ } catch {}
2333
+ return e;
2334
+ }
2335
+ function Dt(e, t, n, r) {
2336
+ let i = e.createURL(Lt(t)).toString(), a = { signal: n };
2337
+ if (r && Q(r.formMethod)) {
2338
+ let { formMethod: e, formEncType: t } = r;
2339
+ a.method = e.toUpperCase(), t === "application/json" ? (a.headers = new Headers({ "Content-Type": t }), a.body = JSON.stringify(r.json)) : a.body = t === "text/plain" ? r.text : t === "application/x-www-form-urlencoded" && r.formData ? Ot(r.formData) : r.formData;
2340
+ }
2341
+ return new Request(i, a);
2342
+ }
2343
+ function Ot(e) {
2344
+ let t = new URLSearchParams();
2345
+ for (let [n, r] of e.entries()) t.append(n, typeof r == "string" ? r : r.name);
2346
+ return t;
2347
+ }
2348
+ function kt(e) {
2349
+ let t = new FormData();
2350
+ for (let [n, r] of e.entries()) t.append(n, r);
2351
+ return t;
2352
+ }
2353
+ function At(e, t, n, r = !1, i = !1) {
2354
+ let a = {}, o = null, s, l = !1, u = {}, d = n && Z(n[1]) ? n[1].error : void 0;
2355
+ return e.forEach((n) => {
2356
+ if (!(n.route.id in t)) return;
2357
+ let f = n.route.id, p = t[f];
2358
+ if (c(!Ut(p), "Cannot handle redirect results in processLoaderData"), Z(p)) {
2359
+ let t = p.error;
2360
+ if (d !== void 0 && (t = d, d = void 0), o ||= {}, i) o[f] = t;
2361
+ else {
2362
+ let n = Pt(e, f);
2363
+ o[n.route.id] ?? (o[n.route.id] = t);
2364
+ }
2365
+ r || (a[f] = qe), l || (l = !0, s = Ce(p.error) ? p.error.status : 500), p.headers && (u[f] = p.headers);
2366
+ } else a[f] = p.data, p.statusCode && p.statusCode !== 200 && !l && (s = p.statusCode), p.headers && (u[f] = p.headers);
2367
+ }), d !== void 0 && n && (o = { [n[0]]: d }, n[2] && (a[n[2]] = void 0)), {
2368
+ loaderData: a,
2369
+ errors: o,
2370
+ statusCode: s || 200,
2371
+ loaderHeaders: u
2372
+ };
2373
+ }
2374
+ function jt(e, t, n, r, i, a, o) {
2375
+ let { loaderData: s, errors: l } = At(t, n, r);
2376
+ return i.filter((e) => !e.matches || e.matches.some((e) => e.shouldLoad)).forEach((t) => {
2377
+ let { key: n, match: r, controller: i } = t;
2378
+ if (i && i.signal.aborted) return;
2379
+ let s = a[n];
2380
+ if (c(s, "Did not find corresponding fetcher result"), Z(s)) {
2381
+ let t = Pt(e.matches, r?.route.id);
2382
+ l && l[t.route.id] || (l = {
2383
+ ...l,
2384
+ [t.route.id]: s.error
2385
+ }), o.delete(n);
2386
+ } else if (Ut(s)) c(!1, "Unhandled fetcher revalidation redirect");
2387
+ else {
2388
+ let e = rn(s.data);
2389
+ o.set(n, e);
2390
+ }
2391
+ }), {
2392
+ loaderData: s,
2393
+ errors: l
2394
+ };
2395
+ }
2396
+ function Mt(e, t, n, r) {
2397
+ let i = Object.entries(t).filter(([, e]) => e !== qe).reduce((e, [t, n]) => (e[t] = n, e), {});
2398
+ for (let a of n) {
2399
+ let n = a.route.id;
2400
+ if (!t.hasOwnProperty(n) && e.hasOwnProperty(n) && a.route.loader && (i[n] = e[n]), r && r.hasOwnProperty(n)) break;
2401
+ }
2402
+ return i;
2403
+ }
2404
+ function Nt(e) {
2405
+ return e ? Z(e[1]) ? { actionData: {} } : { actionData: { [e[0]]: e[1].data } } : {};
2406
+ }
2407
+ function Pt(e, t) {
2408
+ return (t ? e.slice(0, e.findIndex((e) => e.route.id === t) + 1) : [...e]).reverse().find((e) => e.route.ErrorBoundary != null || e.route.errorElement != null) || e[0];
2409
+ }
2410
+ function Ft(e) {
2411
+ let t = e.length === 1 ? e[0] : e.find((e) => e.index || !e.path || e.path === "/") || { id: "__shim-error-route__" };
2412
+ return {
2413
+ matches: [{
2414
+ params: {},
2415
+ pathname: "",
2416
+ pathnameBase: "",
2417
+ route: t
2418
+ }],
2419
+ route: t
2420
+ };
2421
+ }
2422
+ function X(e, { pathname: t, routeId: n, method: r, type: i, message: a } = {}) {
2423
+ let o = "Unknown Server Error", s = "Unknown @remix-run/router error";
2424
+ return e === 400 ? (o = "Bad Request", r && t && n ? s = `You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.` : i === "invalid-body" && (s = "Unable to encode submission body")) : e === 403 ? (o = "Forbidden", s = `Route "${n}" does not match URL "${t}"`) : e === 404 ? (o = "Not Found", s = `No route matches URL "${t}"`) : e === 405 && (o = "Method Not Allowed", r && t && n ? s = `You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.` : r && (s = `Invalid request method "${r.toUpperCase()}"`)), new Se(e || 500, o, Error(s), !0);
2425
+ }
2426
+ function It(e) {
2427
+ let t = Object.entries(e);
2428
+ for (let e = t.length - 1; e >= 0; e--) {
2429
+ let [n, r] = t[e];
2430
+ if (Ut(r)) return {
2431
+ key: n,
2432
+ result: r
2433
+ };
2434
+ }
2435
+ }
2436
+ function Lt(e) {
2437
+ return p({
2438
+ ...typeof e == "string" ? m(e) : e,
2439
+ hash: ""
2440
+ });
2441
+ }
2442
+ function Rt(e, t) {
2443
+ return e.pathname !== t.pathname || e.search !== t.search ? !1 : e.hash === "" ? t.hash !== "" : e.hash === t.hash || t.hash !== "";
2444
+ }
2445
+ function zt(e) {
2446
+ return new Se(e.init?.status ?? 500, e.init?.statusText ?? "Internal Server Error", e.data);
2447
+ }
2448
+ function Bt(e) {
2449
+ return typeof e == "object" && !!e && Object.entries(e).every(([e, t]) => typeof e == "string" && Vt(t));
2450
+ }
2451
+ function Vt(e) {
2452
+ return typeof e == "object" && !!e && "type" in e && "result" in e && (e.type === "data" || e.type === "error");
2453
+ }
2454
+ function Ht(e) {
2455
+ return Gt(e.result) && Ve.has(e.result.status);
2456
+ }
2457
+ function Z(e) {
2458
+ return e.type === "error";
2459
+ }
2460
+ function Ut(e) {
2461
+ return (e && e.type) === "redirect";
2462
+ }
2463
+ function Wt(e) {
2464
+ return typeof e == "object" && !!e && "type" in e && "data" in e && "init" in e && e.type === "DataWithResponseInit";
2465
+ }
2466
+ function Gt(e) {
2467
+ return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.headers == "object" && e.body !== void 0;
2468
+ }
2469
+ function Kt(e) {
2470
+ return Ve.has(e);
2471
+ }
2472
+ function qt(e) {
2473
+ return Gt(e) && Kt(e.status) && e.headers.has("Location");
2474
+ }
2475
+ function Jt(e) {
2476
+ return Be.has(e.toUpperCase());
2477
+ }
2478
+ function Q(e) {
2479
+ return Re.has(e.toUpperCase());
2480
+ }
2481
+ function Yt(e) {
2482
+ return new URLSearchParams(e).getAll("index").some((e) => e === "");
2483
+ }
2484
+ function Xt(e, t) {
2485
+ let n = typeof t == "string" ? m(t).search : t.search;
2486
+ if (e[e.length - 1].route.index && Yt(n || "")) return e[e.length - 1];
2487
+ let r = pe(e);
2488
+ return r[r.length - 1];
2489
+ }
2490
+ function Zt(e, t, n) {
2491
+ return {
2492
+ url: Te(e.createURL(t), t),
2493
+ pattern: n ? we(n) : "",
2494
+ params: n?.[0]?.params ? { ...n[0].params } : {}
2495
+ };
2496
+ }
2497
+ function Qt(e) {
2498
+ let { formMethod: t, formAction: n, formEncType: r, text: i, formData: a, json: o } = e;
2499
+ if (!(!t || !n || !r)) {
2500
+ if (i != null) return {
2501
+ formMethod: t,
2502
+ formAction: n,
2503
+ formEncType: r,
2504
+ formData: void 0,
2505
+ json: void 0,
2506
+ text: i
2507
+ };
2508
+ if (a != null) return {
2509
+ formMethod: t,
2510
+ formAction: n,
2511
+ formEncType: r,
2512
+ formData: a,
2513
+ json: void 0,
2514
+ text: void 0
2515
+ };
2516
+ if (o !== void 0) return {
2517
+ formMethod: t,
2518
+ formAction: n,
2519
+ formEncType: r,
2520
+ formData: void 0,
2521
+ json: o,
2522
+ text: void 0
2523
+ };
2524
+ }
2525
+ }
2526
+ function $t(e, t, n, r) {
2527
+ return r ? {
2528
+ state: "loading",
2529
+ location: e,
2530
+ matches: t,
2531
+ historyAction: n,
2532
+ formMethod: r.formMethod,
2533
+ formAction: r.formAction,
2534
+ formEncType: r.formEncType,
2535
+ formData: r.formData,
2536
+ json: r.json,
2537
+ text: r.text
2538
+ } : {
2539
+ state: "loading",
2540
+ location: e,
2541
+ matches: t,
2542
+ historyAction: n,
2543
+ formMethod: void 0,
2544
+ formAction: void 0,
2545
+ formEncType: void 0,
2546
+ formData: void 0,
2547
+ json: void 0,
2548
+ text: void 0
2549
+ };
2550
+ }
2551
+ function en(e, t, n, r) {
2552
+ return {
2553
+ state: "submitting",
2554
+ location: e,
2555
+ matches: t,
2556
+ historyAction: n,
2557
+ formMethod: r.formMethod,
2558
+ formAction: r.formAction,
2559
+ formEncType: r.formEncType,
2560
+ formData: r.formData,
2561
+ json: r.json,
2562
+ text: r.text
2563
+ };
2564
+ }
2565
+ function tn(e, t) {
2566
+ return e ? {
2567
+ state: "loading",
2568
+ formMethod: e.formMethod,
2569
+ formAction: e.formAction,
2570
+ formEncType: e.formEncType,
2571
+ formData: e.formData,
2572
+ json: e.json,
2573
+ text: e.text,
2574
+ data: t
2575
+ } : {
2576
+ state: "loading",
2577
+ formMethod: void 0,
2578
+ formAction: void 0,
2579
+ formEncType: void 0,
2580
+ formData: void 0,
2581
+ json: void 0,
2582
+ text: void 0,
2583
+ data: t
2584
+ };
2585
+ }
2586
+ function nn(e, t) {
2587
+ return {
2588
+ state: "submitting",
2589
+ formMethod: e.formMethod,
2590
+ formAction: e.formAction,
2591
+ formEncType: e.formEncType,
2592
+ formData: e.formData,
2593
+ json: e.json,
2594
+ text: e.text,
2595
+ data: t ? t.data : void 0
2596
+ };
2597
+ }
2598
+ function rn(e) {
2599
+ return {
2600
+ state: "idle",
2601
+ formMethod: void 0,
2602
+ formAction: void 0,
2603
+ formEncType: void 0,
2604
+ formData: void 0,
2605
+ json: void 0,
2606
+ text: void 0,
2607
+ data: e
2608
+ };
2609
+ }
2610
+ function an(e, t) {
2611
+ try {
2612
+ let n = e.sessionStorage.getItem(Ke);
2613
+ if (n) {
2614
+ let e = JSON.parse(n);
2615
+ for (let [n, r] of Object.entries(e || {})) r && Array.isArray(r) && t.set(n, new Set(r || []));
2616
+ }
2617
+ } catch {}
2618
+ }
2619
+ function on(e, t) {
2620
+ if (t.size > 0) {
2621
+ let n = {};
2622
+ for (let [e, r] of t) n[e] = [...r];
2623
+ try {
2624
+ e.sessionStorage.setItem(Ke, JSON.stringify(n));
2625
+ } catch (e) {
2626
+ l(!1, `Failed to save applied view transitions in sessionStorage (${e}).`);
2627
+ }
2628
+ }
2629
+ }
2630
+ function sn() {
2631
+ let e, t, n = new Promise((r, i) => {
2632
+ e = async (e) => {
2633
+ r(e);
2634
+ try {
2635
+ await n;
2636
+ } catch {}
2637
+ }, t = async (e) => {
2638
+ i(e);
2639
+ try {
2640
+ await n;
2641
+ } catch {}
2642
+ };
2643
+ });
2644
+ return {
2645
+ promise: n,
2646
+ resolve: e,
2647
+ reject: t
2648
+ };
2649
+ }
2650
+ //#endregion
2651
+ //#region ../../node_modules/.pnpm/react-router@8.3.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router/dist/production/lib/context.js
2652
+ var cn = _.createContext(null);
2653
+ cn.displayName = "DataRouter";
2654
+ var ln = _.createContext(null);
2655
+ ln.displayName = "DataRouterState";
2656
+ var un = _.createContext(!1);
2657
+ function dn() {
2658
+ return _.useContext(un);
2659
+ }
2660
+ var fn = _.createContext({ isTransitioning: !1 });
2661
+ fn.displayName = "ViewTransition";
2662
+ var pn = _.createContext(/* @__PURE__ */ new Map());
2663
+ pn.displayName = "Fetchers";
2664
+ var mn = _.createContext(null);
2665
+ mn.displayName = "Await";
2666
+ var hn = _.createContext(null);
2667
+ hn.displayName = "Navigation";
2668
+ var gn = _.createContext(null);
2669
+ gn.displayName = "Location";
2670
+ var $ = _.createContext({
2671
+ outlet: null,
2672
+ matches: [],
2673
+ isDataRoute: !1
2674
+ });
2675
+ $.displayName = "Route";
2676
+ var _n = _.createContext(null);
2677
+ _n.displayName = "RouteError";
2678
+ //#endregion
2679
+ //#region ../../node_modules/.pnpm/react-router@8.3.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router/dist/production/lib/errors.js
2680
+ var vn = "REACT_ROUTER_ERROR", yn = "REDIRECT", bn = "ROUTE_ERROR_RESPONSE";
2681
+ function xn(e) {
2682
+ if (e.startsWith(`${vn}:${yn}:{`)) try {
2683
+ let t = JSON.parse(e.slice(28));
2684
+ if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string" && typeof t.location == "string" && typeof t.reloadDocument == "boolean" && typeof t.replace == "boolean") return t;
2685
+ } catch {}
2686
+ }
2687
+ function Sn(e) {
2688
+ if (e.startsWith(`${vn}:${bn}:{`)) try {
2689
+ let t = JSON.parse(e.slice(40));
2690
+ if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string") return new Se(t.status, t.statusText, t.data);
2691
+ } catch {}
2692
+ }
2693
+ //#endregion
2694
+ //#region ../../node_modules/.pnpm/react-router@8.3.0_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-router/dist/production/lib/hooks.js
2695
+ function Cn(e, { relative: t } = {}) {
2696
+ c(wn(), "useHref() may be used only in the context of a <Router> component.");
2697
+ let { basename: n, navigator: r } = _.useContext(hn), { hash: i, pathname: a, search: o } = An(e, { relative: t }), s = a;
2698
+ return n !== "/" && (s = a === "/" ? n : U([n, a])), r.createHref({
2699
+ pathname: s,
2700
+ search: o,
2701
+ hash: i
2702
+ });
2703
+ }
2704
+ function wn() {
2705
+ return _.useContext(gn) != null;
2706
+ }
2707
+ function Tn() {
2708
+ return c(wn(), "useLocation() may be used only in the context of a <Router> component."), _.useContext(gn).location;
2709
+ }
2710
+ var En = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
2711
+ function Dn() {
2712
+ let { isDataRoute: e } = _.useContext($);
2713
+ return e ? Jn() : On();
2714
+ }
2715
+ function On() {
2716
+ c(wn(), "useNavigate() may be used only in the context of a <Router> component.");
2717
+ let e = _.useContext(cn), { basename: t, navigator: n } = _.useContext(hn), { matches: r } = _.useContext($), { pathname: i } = Tn(), a = JSON.stringify(me(r)), o = _.useRef(!1);
2718
+ return _.useLayoutEffect(() => {
2719
+ o.current = !0;
2720
+ }), _.useCallback((r, s = {}) => {
2721
+ if (l(o.current, En), !o.current) return;
2722
+ if (typeof r == "number") {
2723
+ n.go(r);
2724
+ return;
2725
+ }
2726
+ let c = he(r, JSON.parse(a), i, s.relative === "path");
2727
+ e == null && t !== "/" && (c.pathname = c.pathname === "/" ? t : U([t, c.pathname])), (s.replace ? n.replace : n.push)(c, s.state, s);
2728
+ }, [
2729
+ t,
2730
+ n,
2731
+ a,
2732
+ i,
2733
+ e
2734
+ ]);
2735
+ }
2736
+ _.createContext(null);
2737
+ function kn() {
2738
+ let { matches: e } = _.useContext($);
2739
+ return e[e.length - 1]?.params ?? {};
2740
+ }
2741
+ function An(e, { relative: t } = {}) {
2742
+ let { matches: n } = _.useContext($), { pathname: r } = Tn(), i = JSON.stringify(me(n));
2743
+ return _.useMemo(() => he(e, JSON.parse(i), r, t === "path"), [
2744
+ e,
2745
+ i,
2746
+ r,
2747
+ t
2748
+ ]);
2749
+ }
2750
+ function jn(e, t, n) {
2751
+ c(wn(), "useRoutes() may be used only in the context of a <Router> component.");
2752
+ let { navigator: r } = _.useContext(hn), { matches: i } = _.useContext($), a = i[i.length - 1], o = a ? a.params : {};
2753
+ a && a.pathname;
2754
+ let s = a ? a.pathnameBase : "/";
2755
+ a && a.route;
2756
+ let l = Tn(), u;
2757
+ if (t) {
2758
+ let e = typeof t == "string" ? m(t) : t;
2759
+ c(s === "/" || e.pathname?.startsWith(s), `When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${e.pathname}" was given in the \`location\` prop.`), u = e;
2760
+ } else u = l;
2761
+ let d = u.pathname || "/", f = d;
2762
+ if (s !== "/") {
2763
+ let e = s.replace(/^\//, "").split("/");
2764
+ f = "/" + d.replace(/^\//, "").split("/").slice(e.length).join("/");
2765
+ }
2766
+ let p = n && n.state.matches.length ? n.state.matches.map((e) => Object.assign(e, { route: n.manifest[e.route.id] || e.route })) : D(e, { pathname: f }), h = Rn(p && p.map((e) => Object.assign({}, e, {
2767
+ params: Object.assign({}, o, e.params),
2768
+ pathname: U([s, r.encodeLocation ? r.encodeLocation(e.pathname.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")).pathname : e.pathname]),
2769
+ pathnameBase: e.pathnameBase === "/" ? s : U([s, r.encodeLocation ? r.encodeLocation(e.pathnameBase.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")).pathname : e.pathnameBase])
2770
+ })), i, n);
2771
+ return t && h ? /* @__PURE__ */ _.createElement(gn.Provider, { value: {
2772
+ location: {
2773
+ pathname: "/",
2774
+ search: "",
2775
+ hash: "",
2776
+ state: null,
2777
+ key: "default",
2778
+ mask: void 0,
2779
+ ...u
2780
+ },
2781
+ navigationType: "POP"
2782
+ } }, h) : h;
2783
+ }
2784
+ function Mn() {
2785
+ let e = qn(), t = Ce(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), n = e instanceof Error ? e.stack : null;
2786
+ return /* @__PURE__ */ _.createElement(_.Fragment, null, /* @__PURE__ */ _.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ _.createElement("h3", { style: { fontStyle: "italic" } }, t), n ? /* @__PURE__ */ _.createElement("pre", { style: {
2787
+ padding: "0.5rem",
2788
+ backgroundColor: "rgba(200,200,200, 0.5)"
2789
+ } }, n) : null, null);
2790
+ }
2791
+ var Nn = /* @__PURE__ */ _.createElement(Mn, null), Pn = class extends _.Component {
2792
+ constructor(e) {
2793
+ super(e), this.state = {
2794
+ location: e.location,
2795
+ revalidation: e.revalidation,
2796
+ error: e.error
2797
+ };
2798
+ }
2799
+ static contextType = un;
2800
+ static getDerivedStateFromError(e) {
2801
+ return { error: e };
2802
+ }
2803
+ static getDerivedStateFromProps(e, t) {
2804
+ return t.location !== e.location || t.revalidation !== "idle" && e.revalidation === "idle" ? {
2805
+ error: e.error,
2806
+ location: e.location,
2807
+ revalidation: e.revalidation
2808
+ } : {
2809
+ error: e.error === void 0 ? t.error : e.error,
2810
+ location: t.location,
2811
+ revalidation: e.revalidation || t.revalidation
2812
+ };
2813
+ }
2814
+ componentDidCatch(e, t) {
2815
+ this.props.onError ? this.props.onError(e, t) : console.error("React Router caught the following error during render", e);
2816
+ }
2817
+ render() {
2818
+ let e = this.state.error;
2819
+ if (this.context && typeof e == "object" && e && "digest" in e && typeof e.digest == "string") {
2820
+ let t = Sn(e.digest);
2821
+ t && (e = t);
2822
+ }
2823
+ let t = e === void 0 ? this.props.children : /* @__PURE__ */ _.createElement($.Provider, { value: this.props.routeContext }, /* @__PURE__ */ _.createElement(_n.Provider, {
2824
+ value: e,
2825
+ children: this.props.component
2826
+ }));
2827
+ return this.context ? /* @__PURE__ */ _.createElement(In, { error: e }, t) : t;
2828
+ }
2829
+ }, Fn = /* @__PURE__ */ new WeakMap();
2830
+ function In({ children: e, error: t }) {
2831
+ let { basename: n } = _.useContext(hn);
2832
+ if (typeof t == "object" && t && "digest" in t && typeof t.digest == "string") {
2833
+ let e = xn(t.digest);
2834
+ if (e) {
2835
+ let r = Fn.get(t);
2836
+ if (r) throw r;
2837
+ let i = De(e.location, n), a = i.absoluteURL || i.to;
2838
+ if (Tt(a)) throw Error("Invalid redirect location");
2839
+ if (Ee && !Fn.get(t)) if (i.isExternal || e.reloadDocument) window.location.href = a;
2840
+ else {
2841
+ let n = Promise.resolve().then(() => window.__reactRouterDataRouter.navigate(i.to, { replace: e.replace }));
2842
+ throw Fn.set(t, n), n;
2843
+ }
2844
+ return /* @__PURE__ */ _.createElement("meta", {
2845
+ httpEquiv: "refresh",
2846
+ content: `0;url=${a}`
2847
+ });
2848
+ }
2849
+ }
2850
+ return e;
2851
+ }
2852
+ function Ln({ routeContext: e, match: t, children: n }) {
2853
+ let r = _.useContext(cn);
2854
+ return r && r.static && r.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (r.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ _.createElement($.Provider, { value: e }, n);
2855
+ }
2856
+ function Rn(e, t = [], n) {
2857
+ let r = n?.state;
2858
+ if (e == null) {
2859
+ if (!r) return null;
2860
+ if (r.errors) e = r.matches;
2861
+ else if (t.length === 0 && !r.initialized && r.matches.length > 0) e = r.matches;
2862
+ else return null;
2863
+ }
2864
+ let i = e, a = r?.errors;
2865
+ if (a != null) {
2866
+ let e = i.findIndex((e) => e.route.id && a?.[e.route.id] !== void 0);
2867
+ c(e >= 0, `Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`), i = i.slice(0, Math.min(i.length, e + 1));
2868
+ }
2869
+ let o = !1, s = -1;
2870
+ if (n && r) {
2871
+ o = r.renderFallback;
2872
+ for (let e = 0; e < i.length; e++) {
2873
+ let t = i[e];
2874
+ if ((t.route.HydrateFallback || t.route.hydrateFallbackElement) && (s = e), t.route.id) {
2875
+ let { loaderData: e, errors: a } = r, c = t.route.loader && !e.hasOwnProperty(t.route.id) && (!a || a[t.route.id] === void 0);
2876
+ if (t.route.lazy || c) {
2877
+ n.isStatic && (o = !0), i = s >= 0 ? i.slice(0, s + 1) : [i[0]];
2878
+ break;
2879
+ }
2880
+ }
2881
+ }
2882
+ }
2883
+ let l = n?.onError, u = r && l ? (e, t) => {
2884
+ l(e, {
2885
+ location: r.location,
2886
+ params: r.matches?.[0]?.params ?? {},
2887
+ pattern: we(r.matches),
2888
+ errorInfo: t
2889
+ });
2890
+ } : void 0;
2891
+ return i.reduceRight((e, n, c) => {
2892
+ let l, d = !1, f = null, p = null;
2893
+ r && (l = a && n.route.id ? a[n.route.id] : void 0, f = n.route.errorElement || Nn, o && (s < 0 && c === 0 ? (Xn("route-fallback", !1, "No `HydrateFallback` element provided to render during initial hydration"), d = !0, p = null) : s === c && (d = !0, p = n.route.hydrateFallbackElement || null)));
2894
+ let m = t.concat(i.slice(0, c + 1)), h = () => {
2895
+ let t;
2896
+ return t = l ? f : d ? p : n.route.Component ? /* @__PURE__ */ _.createElement(n.route.Component, null) : n.route.element ? n.route.element : e, /* @__PURE__ */ _.createElement(Ln, {
2897
+ match: n,
2898
+ routeContext: {
2899
+ outlet: e,
2900
+ matches: m,
2901
+ isDataRoute: r != null
2902
+ },
2903
+ children: t
2904
+ });
2905
+ };
2906
+ return r && (n.route.ErrorBoundary || n.route.errorElement || c === 0) ? /* @__PURE__ */ _.createElement(Pn, {
2907
+ location: r.location,
2908
+ revalidation: r.revalidation,
2909
+ component: f,
2910
+ error: l,
2911
+ children: h(),
2912
+ routeContext: {
2913
+ outlet: null,
2914
+ matches: m,
2915
+ isDataRoute: !0
2916
+ },
2917
+ onError: u
2918
+ }) : h();
2919
+ }, null);
2920
+ }
2921
+ function zn(e) {
2922
+ return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
2923
+ }
2924
+ function Bn(e) {
2925
+ let t = _.useContext(cn);
2926
+ return c(t, zn(e)), t;
2927
+ }
2928
+ function Vn(e) {
2929
+ let t = _.useContext(ln);
2930
+ return c(t, zn(e)), t;
2931
+ }
2932
+ function Hn(e) {
2933
+ let t = _.useContext($);
2934
+ return c(t, zn(e)), t;
2935
+ }
2936
+ function Un(e) {
2937
+ let t = Hn(e), n = t.matches[t.matches.length - 1];
2938
+ return c(n.route.id, `${e} can only be used on routes that contain a unique "id"`), n.route.id;
2939
+ }
2940
+ function Wn() {
2941
+ return Un("useRouteId");
2942
+ }
2943
+ function Gn() {
2944
+ let e = Vn("useNavigation");
2945
+ return _.useMemo(() => {
2946
+ let { matches: t, historyAction: n, ...r } = e.navigation;
2947
+ return r;
2948
+ }, [e.navigation]);
2949
+ }
2950
+ function Kn() {
2951
+ let { matches: e, loaderData: t } = Vn("useMatches");
2952
+ return _.useMemo(() => e.map((e) => k(e, t)), [e, t]);
2953
+ }
2954
+ function qn() {
2955
+ let e = _.useContext(_n), t = Vn("useRouteError"), n = Un("useRouteError");
2956
+ return e === void 0 ? t.errors?.[n] : e;
2957
+ }
2958
+ function Jn() {
2959
+ let { router: e } = Bn("useNavigate"), t = Un("useNavigate"), n = _.useRef(!1);
2960
+ return _.useLayoutEffect(() => {
2961
+ n.current = !0;
2962
+ }), _.useCallback(async (r, i = {}) => {
2963
+ l(n.current, En), n.current && (typeof r == "number" ? await e.navigate(r) : await e.navigate(r, {
2964
+ fromRouteId: t,
2965
+ ...i
2966
+ }));
2967
+ }, [e, t]);
2968
+ }
2969
+ var Yn = {};
2970
+ function Xn(e, t, n) {
2971
+ !t && !Yn[e] && (Yn[e] = !0, l(!1, n));
2972
+ }
2973
+ //#endregion
2974
+ export { he as A, w as C, ce as D, U as E, m as F, l as I, n as L, s as M, p as N, D as O, c as P, xe as S, we as T, $ as _, Dn as a, Ye as b, An as c, mn as d, cn as f, hn as g, gn as h, Kn as i, z as j, De as k, Wn as l, pn as m, wn as n, Gn as o, ln as p, Tn as r, kn as s, Cn as t, jn as u, fn as v, me as w, Se as x, dn as y };