react-modal-navigation 1.2.0 → 1.3.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.
- package/CHANGELOG.md +20 -0
- package/README.md +14 -55
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +31 -0
- package/dist/index.js +1577 -1206
- package/dist/style.css +3 -0
- package/docs/API.md +5 -1
- package/docs/NESTED-ROUTES.md +136 -0
- package/package.json +23 -7
- package/docs/ARCHITECTURE-1.1.11.md +0 -5
- package/docs/ASYNC-1.2.0.md +0 -8
- package/docs/DECLARATIVE-HARDENING-1.2.0.md +0 -7
- package/docs/DEVELOPMENT-1.2.0.md +0 -7
- package/docs/FINAL-OPTIMIZATION-1.1.11.md +0 -10
- package/docs/RC1-1.2.0.md +0 -2
- package/docs/RC2-1.2.0.md +0 -3
- package/docs/RC3-1.2.0.md +0 -9
- package/docs/RC3B-1.2.0.md +0 -7
- package/docs/RC3C-1.2.0.md +0 -2
- package/docs/RESOURCE-1.2.0.md +0 -7
- package/docs/RUNTIME-1.1.11.md +0 -5
- package/docs/RUNTIME-1.2.0.md +0 -9
- package/docs/STABILITY-1.1.11.md +0 -9
- package/docs/STAGE3-1.2.0.md +0 -7
- package/docs/SUBSCRIPTIONS-1.1.11.md +0 -7
- package/docs/UPGRADE-1.1.11.md +0 -18
package/dist/index.js
CHANGED
|
@@ -1,7 +1,138 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
function
|
|
1
|
+
import { jsx as m, jsxs as Me } from "react/jsx-runtime";
|
|
2
|
+
import { createPortal as zn, flushSync as Qt } from "react-dom";
|
|
3
|
+
import Oe, { createContext as we, useContext as Y, useSyncExternalStore as Ee, useMemo as V, useRef as G, useLayoutEffect as Se, useEffect as ee, useState as Pe, useInsertionEffect as rn, memo as pt, useCallback as X, useReducer as Nn, Suspense as qt } from "react";
|
|
4
|
+
function on(e) {
|
|
5
|
+
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
|
|
6
|
+
function o(i, u = "", a = [], c = {}, d = [], g = []) {
|
|
7
|
+
if (!i || typeof i != "object" || Array.isArray(i) || r.has(i)) throw new Error("[react-modal-navigation] Invalid or cyclic screens");
|
|
8
|
+
r.add(i);
|
|
9
|
+
for (const [x, b] of Object.entries(i)) {
|
|
10
|
+
if (!x || !b || typeof b != "object") throw new Error("[react-modal-navigation] Invalid screen");
|
|
11
|
+
const h = u ? `${u}/${x}` : x, { screens: l, layout: y, persistentLayout: C, initialRoute: L, initialParams: S, ...j } = b;
|
|
12
|
+
if (C && (!y || a.length)) throw new Error("[react-modal-navigation] Persistent layouts require a layout and cannot follow a nonpersistent layout");
|
|
13
|
+
if (S !== void 0 && (!l || !S || typeof S != "object" || Array.isArray(S))) throw new Error(`[react-modal-navigation] Invalid group initialParams: ${h}`);
|
|
14
|
+
const D = C ? [...d, { path: h, component: y }] : d, R = y && !C ? [...a, y] : a;
|
|
15
|
+
if (j.component || j.loader || !l) {
|
|
16
|
+
if (t.has(h)) throw new Error(`[react-modal-navigation] Duplicate screen: ${h}`);
|
|
17
|
+
t.set(h, R.length || D.length || g.length || Object.keys(c).length ? { ...c, ...j, ...g.length ? { routeGroups: g } : {}, ...R.length ? { routeLayouts: R } : {}, ...D.length ? { persistentLayouts: D } : {} } : b);
|
|
18
|
+
}
|
|
19
|
+
if (l) {
|
|
20
|
+
const { component: k, loader: O, ...A } = j;
|
|
21
|
+
if (L !== void 0) {
|
|
22
|
+
if (typeof L != "string" || !L || n.has(h)) throw new Error(`[react-modal-navigation] Invalid default route: ${h}`);
|
|
23
|
+
n.set(h, `${h}/${L}`);
|
|
24
|
+
}
|
|
25
|
+
o(l, h, R, { ...c, ...A }, D, [...g, { name: h, params: Object.freeze({ ...S }) }]);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
r.delete(i);
|
|
29
|
+
}
|
|
30
|
+
o(e);
|
|
31
|
+
const s = /* @__PURE__ */ new Map();
|
|
32
|
+
for (const [i, u] of n) {
|
|
33
|
+
if (t.has(i)) throw new Error(`[react-modal-navigation] Default route conflicts with screen: ${i}`);
|
|
34
|
+
let a = u;
|
|
35
|
+
for (; n.has(a); ) a = n.get(a);
|
|
36
|
+
if (!t.has(a)) throw new Error(`[react-modal-navigation] Unknown default route: ${u}`);
|
|
37
|
+
s.set(i, a);
|
|
38
|
+
}
|
|
39
|
+
return { screens: Object.fromEntries(t), aliases: Object.fromEntries(s) };
|
|
40
|
+
}
|
|
41
|
+
function Ct(e, t, n) {
|
|
42
|
+
if (typeof e != "string") return e;
|
|
43
|
+
if (n && (e.startsWith("./") || e.startsWith("../"))) {
|
|
44
|
+
const r = n.split("/").slice(0, -1);
|
|
45
|
+
for (const o of e.split("/"))
|
|
46
|
+
if (o !== ".")
|
|
47
|
+
if (o === "..") {
|
|
48
|
+
if (!r.length) throw new Error("[react-modal-navigation] Relative route escapes root");
|
|
49
|
+
r.pop();
|
|
50
|
+
} else r.push(o);
|
|
51
|
+
e = r.join("/");
|
|
52
|
+
}
|
|
53
|
+
return t && Object.hasOwn(t, e) ? t[e] : e;
|
|
54
|
+
}
|
|
55
|
+
function Bn(e, t) {
|
|
56
|
+
const n = { children: [], groups: /* @__PURE__ */ new Map() };
|
|
57
|
+
for (const r of e) {
|
|
58
|
+
let o = n;
|
|
59
|
+
for (const s of t[r.name].persistentLayouts ?? []) {
|
|
60
|
+
let i = o.groups.get(s.path);
|
|
61
|
+
i || (i = { layout: s, children: [], groups: /* @__PURE__ */ new Map(), routes: [] }, o.groups.set(s.path, i), o.children.push(i)), i.routes.push(r), o = i;
|
|
62
|
+
}
|
|
63
|
+
o.children.push({ route: r });
|
|
64
|
+
}
|
|
65
|
+
return n.children;
|
|
66
|
+
}
|
|
67
|
+
const sn = we(null), an = we(null), at = we(null), st = we(null), It = we(null), $t = we(null), Et = we(null), Pt = we(null), Ot = we(null), cn = we(null), ln = we(null), Je = we(null), Dt = we(null), Kt = we(null), We = we(null), un = we(null), Ht = we(!1);
|
|
68
|
+
function Gn() {
|
|
69
|
+
const e = Y(un);
|
|
70
|
+
if (!e) throw new Error("[react-modal-navigation] useModalMatches requires a modal route");
|
|
71
|
+
return e;
|
|
72
|
+
}
|
|
73
|
+
function Fn() {
|
|
74
|
+
return Gn().at(-2) ?? null;
|
|
75
|
+
}
|
|
76
|
+
function to() {
|
|
77
|
+
return Fn()?.params;
|
|
78
|
+
}
|
|
79
|
+
const dn = () => () => {
|
|
80
|
+
}, Zt = () => null;
|
|
81
|
+
function no(e) {
|
|
82
|
+
const t = Y(We), n = t?.routeGroups.get(e), r = Ee(n?.subscribe ?? dn, n?.getSnapshot ?? Zt, n?.getSnapshot ?? Zt), o = V(() => ({
|
|
83
|
+
setParams: (s) => t.routeGroups.setParams(e, s),
|
|
84
|
+
run: (s) => t.routeGroups.run(e, s)
|
|
85
|
+
}), [t, e]);
|
|
86
|
+
return V(() => r && { ...r, ...o }, [r, o]);
|
|
87
|
+
}
|
|
88
|
+
function ro(e, t, { protectCache: n = !0 } = {}) {
|
|
89
|
+
const r = Y(We), o = Y(at), i = Y(Ht) ? void 0 : o?.routeKey, u = G(t);
|
|
90
|
+
Se(() => {
|
|
91
|
+
u.current = t;
|
|
92
|
+
}, [t]), Se(() => r?.routeGroups.registerGuard(e, (a) => u.current(a), { protectCache: n, ownerKey: i }), [r, e, n, i]);
|
|
93
|
+
}
|
|
94
|
+
function oo(e, t) {
|
|
95
|
+
const r = Y(We)?.routeGroups.get(e), o = V(() => () => r?.getSnapshot().isFocused ?? !1, [r]), s = Ee(r?.subscribe ?? dn, o, o), i = G(t);
|
|
96
|
+
Se(() => {
|
|
97
|
+
i.current = t;
|
|
98
|
+
}, [t]), ee(() => {
|
|
99
|
+
if (s)
|
|
100
|
+
return i.current.onFocus?.(), () => i.current.onBlur?.();
|
|
101
|
+
}, [e, r, s]);
|
|
102
|
+
}
|
|
103
|
+
function Ft({ screen: e, route: t, children: n }) {
|
|
104
|
+
const r = Y(We), o = e.routeGroups ?? qn, s = V(() => {
|
|
105
|
+
const a = o.map((x) => r?.routeGroups.get(x.name));
|
|
106
|
+
let c, d;
|
|
107
|
+
return { getSnapshot: () => {
|
|
108
|
+
const x = o.map((b, h) => a[h]?.getSnapshot().params ?? b.params);
|
|
109
|
+
return (!c || x.some((b, h) => b !== c[h])) && (c = x, d = o.map((b, h) => ({ name: b.name, params: x[h] }))), d;
|
|
110
|
+
}, subscribe: (x) => {
|
|
111
|
+
const b = a.map((h) => {
|
|
112
|
+
if (!h) return;
|
|
113
|
+
let l = h.getSnapshot().params;
|
|
114
|
+
return h.subscribe(() => {
|
|
115
|
+
const y = h.getSnapshot().params;
|
|
116
|
+
Object.is(l, y) || (l = y, x());
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
return () => b.forEach((h) => h?.());
|
|
120
|
+
} };
|
|
121
|
+
}, [r, o]), i = Ee(s.subscribe, s.getSnapshot, s.getSnapshot), u = V(() => [...i, t], [i, t]);
|
|
122
|
+
return /* @__PURE__ */ m(un.Provider, { value: u, children: n });
|
|
123
|
+
}
|
|
124
|
+
const qn = [], Wt = we(null);
|
|
125
|
+
function so() {
|
|
126
|
+
return Y(Wt);
|
|
127
|
+
}
|
|
128
|
+
function mn({ layout: e, route: t, navigation: n, children: r, shared: o = !1 }) {
|
|
129
|
+
return /* @__PURE__ */ m(Ht.Provider, { value: o, children: /* @__PURE__ */ m(Wt.Provider, { value: r, children: /* @__PURE__ */ m(e, { route: t, navigation: n, children: r }) }) });
|
|
130
|
+
}
|
|
131
|
+
function fn({ screen: e, route: t, navigation: n, includePersistent: r = !0 }) {
|
|
132
|
+
const o = e.component, s = [...r ? (e.persistentLayouts ?? []).map((u) => ({ layout: u.component, shared: !0 })) : [], ...(e.routeLayouts ?? []).map((u) => ({ layout: u, shared: !1 }))], i = /* @__PURE__ */ m(Ht.Provider, { value: !1, children: /* @__PURE__ */ m(o, { route: t, navigation: n }) });
|
|
133
|
+
return !s.length && !e.persistentLayouts?.length ? /* @__PURE__ */ m(Ft, { screen: e, route: t, children: i }) : /* @__PURE__ */ m(Ft, { screen: e, route: t, children: s.reduceRight((u, { layout: a, shared: c }) => /* @__PURE__ */ m(mn, { shared: c, layout: a, route: t, navigation: n, children: u }), /* @__PURE__ */ m(Wt.Provider, { value: null, children: i })) });
|
|
134
|
+
}
|
|
135
|
+
function $e(e) {
|
|
5
136
|
let t = e;
|
|
6
137
|
const n = /* @__PURE__ */ new Set();
|
|
7
138
|
let r = !1;
|
|
@@ -11,13 +142,13 @@ function je(e) {
|
|
|
11
142
|
publish(o) {
|
|
12
143
|
if (!(r || Object.is(t, o))) {
|
|
13
144
|
t = o;
|
|
14
|
-
for (const
|
|
15
|
-
if (!(r || !n.has(
|
|
145
|
+
for (const s of [...n])
|
|
146
|
+
if (!(r || !n.has(s)))
|
|
16
147
|
try {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
} catch (
|
|
20
|
-
console.error(
|
|
148
|
+
const i = s();
|
|
149
|
+
i && typeof i.then == "function" && Promise.resolve(i).catch((u) => console.error(u));
|
|
150
|
+
} catch (i) {
|
|
151
|
+
console.error(i);
|
|
21
152
|
}
|
|
22
153
|
}
|
|
23
154
|
},
|
|
@@ -27,22 +158,22 @@ function je(e) {
|
|
|
27
158
|
listenerCount: () => n.size
|
|
28
159
|
};
|
|
29
160
|
}
|
|
30
|
-
const
|
|
31
|
-
let
|
|
32
|
-
const
|
|
33
|
-
function
|
|
161
|
+
const Lt = we(null);
|
|
162
|
+
let In = 0;
|
|
163
|
+
const Rt = (e, t) => ({ key: `modal-route-${++In}`, name: e, params: t ?? {} }), pn = (e, t) => [Rt(e, t)];
|
|
164
|
+
function kt(e, t) {
|
|
34
165
|
switch (t.type) {
|
|
35
166
|
case "COMMIT":
|
|
36
167
|
return t.stack;
|
|
37
168
|
case "PUSH":
|
|
38
|
-
return [...e,
|
|
169
|
+
return [...e, Rt(t.name, t.params)];
|
|
39
170
|
case "POP":
|
|
40
171
|
return e.slice(0, Math.max(1, e.length - t.count));
|
|
41
172
|
case "RESET":
|
|
42
|
-
return
|
|
173
|
+
return pn(t.name, t.params);
|
|
43
174
|
case "NAVIGATE": {
|
|
44
175
|
const n = e.findIndex((r) => r.name === t.name);
|
|
45
|
-
return n < 0 ? [...e,
|
|
176
|
+
return n < 0 ? [...e, Rt(t.name, t.params)] : e.slice(0, n + 1).map((r, o) => o === n ? { ...r, params: t.params ?? {} } : r);
|
|
46
177
|
}
|
|
47
178
|
case "SET_OPTIONS":
|
|
48
179
|
return e.map((n, r) => r === e.length - 1 ? { ...n, options: { ...n.options ?? {}, ...t.options ?? {} } } : n);
|
|
@@ -51,120 +182,127 @@ function mt(e, t) {
|
|
|
51
182
|
case "BACK":
|
|
52
183
|
return e.length > 1 ? e.slice(0, -1) : e;
|
|
53
184
|
case "REPLACE":
|
|
54
|
-
return e.length ? [...e.slice(0, -1),
|
|
185
|
+
return e.length ? [...e.slice(0, -1), Rt(t.name, t.params)] : e;
|
|
55
186
|
default:
|
|
56
187
|
return e;
|
|
57
188
|
}
|
|
58
189
|
}
|
|
59
|
-
function
|
|
60
|
-
const
|
|
61
|
-
return e.filter((
|
|
190
|
+
function Xt(e, t, n = 1 / 0, r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set()) {
|
|
191
|
+
const s = n === 1 / 0 ? 1 / 0 : Math.max(0, Math.floor(Number(n) || 0)), i = e.slice(0, -1).filter((a) => t[a.name]?.keepAlive !== !1), u = new Set((s === 0 ? [] : i.slice(-s)).map((a) => a.key));
|
|
192
|
+
return e.filter((a, c) => c === e.length - 1 || (u.has(a.key) || o.has(a.key)) && !r.has(a.key));
|
|
62
193
|
}
|
|
63
|
-
function
|
|
64
|
-
const r = new Set(t.map((
|
|
65
|
-
return o.size === n.size && [...o].every((
|
|
194
|
+
function $n(e, t, n) {
|
|
195
|
+
const r = new Set(t.map((s) => s.key)), o = new Set(e.slice(0, -1).filter((s) => n.has(s.key) || !r.has(s.key)).map((s) => s.key));
|
|
196
|
+
return o.size === n.size && [...o].every((s) => n.has(s)) ? n : o;
|
|
66
197
|
}
|
|
67
|
-
function
|
|
198
|
+
function Dn(e, t) {
|
|
68
199
|
const n = e.responsive;
|
|
69
200
|
if (!n) return e;
|
|
70
|
-
const { sm: r, md: o, lg:
|
|
71
|
-
return { ...e, ...t < 768 ? r : t < 1024 ? o : t < 1280 ?
|
|
201
|
+
const { sm: r, md: o, lg: s, xl: i } = n;
|
|
202
|
+
return { ...e, ...t < 768 ? r : t < 1024 ? o : t < 1280 ? s : i, ...e.runtimeLayout };
|
|
72
203
|
}
|
|
73
|
-
function
|
|
204
|
+
function Kn(e, t, n, r) {
|
|
74
205
|
const o = Math.max(0, Math.min(n ?? 1 / 0, r));
|
|
75
206
|
return Math.min(o, Math.max(Math.min(t ?? 240, o), e));
|
|
76
207
|
}
|
|
77
|
-
|
|
208
|
+
function Hn(e) {
|
|
209
|
+
return [...e.querySelectorAll('a[href],button,input,textarea,select,[tabindex],[contenteditable="true"],summary')].filter((t) => t.tabIndex >= 0 && !t.matches(":disabled") && !t.closest('[inert], [hidden], [aria-hidden="true"]') && t.getClientRects().length > 0 && !["hidden", "collapse"].includes(getComputedStyle(t).visibility)).sort((t, n) => (t.tabIndex || 1 / 0) - (n.tabIndex || 1 / 0));
|
|
210
|
+
}
|
|
211
|
+
const Wn = Object.freeze({ sm: 400, md: 560, lg: 720, xl: 960, full: "100%" }), Ve = (e) => typeof e == "number" ? `${e}px` : e, Jt = () => {
|
|
78
212
|
if (typeof document > "u") return "light";
|
|
79
213
|
const e = document.documentElement, t = document.body;
|
|
80
214
|
return e.classList.contains("dark") || t.classList.contains("dark") || e.dataset.theme === "dark" || t.dataset.theme === "dark" ? "dark" : e.classList.contains("light") || t.classList.contains("light") || e.dataset.theme === "light" || t.dataset.theme === "light" ? "light" : window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
81
215
|
};
|
|
82
|
-
let
|
|
83
|
-
const
|
|
84
|
-
let
|
|
85
|
-
function
|
|
86
|
-
if (
|
|
87
|
-
const t = document.documentElement, n = document.body, r = { html: t.style.overflow, body: n.style.overflow, padding: n.style.paddingRight, width: n.style.getPropertyValue("--modal-scrollbar-width") }, o = Math.max(0, window.innerWidth - t.clientWidth),
|
|
88
|
-
o && (n.style.paddingRight = `${
|
|
216
|
+
let mt = 0;
|
|
217
|
+
const Xe = [];
|
|
218
|
+
let Bt = null;
|
|
219
|
+
function _n() {
|
|
220
|
+
if (mt++, mt === 1) {
|
|
221
|
+
const t = document.documentElement, n = document.body, r = { html: t.style.overflow, body: n.style.overflow, padding: n.style.paddingRight, width: n.style.getPropertyValue("--modal-scrollbar-width") }, o = Math.max(0, window.innerWidth - t.clientWidth), s = parseFloat(getComputedStyle(n).paddingRight) || 0;
|
|
222
|
+
o && (n.style.paddingRight = `${s + o}px`), n.style.setProperty("--modal-scrollbar-width", `${o}px`), t.style.overflow = "hidden", n.style.overflow = "hidden", Bt = () => {
|
|
89
223
|
t.style.overflow = r.html, n.style.overflow = r.body, n.style.paddingRight = r.padding, r.width ? n.style.setProperty("--modal-scrollbar-width", r.width) : n.style.removeProperty("--modal-scrollbar-width");
|
|
90
224
|
};
|
|
91
225
|
}
|
|
92
226
|
let e = !1;
|
|
93
227
|
return () => {
|
|
94
|
-
e || (e = !0,
|
|
228
|
+
e || (e = !0, mt = Math.max(0, mt - 1), mt || (Bt?.(), Bt = null));
|
|
95
229
|
};
|
|
96
230
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
U(() => () => {
|
|
231
|
+
function Un({ dialogRef: e, options: t, requestClose: n, children: r, exiting: o = !1 }) {
|
|
232
|
+
const [s, i] = Pe(() => typeof window > "u" ? 1024 : window.innerWidth), u = !!t.responsive;
|
|
233
|
+
ee(() => {
|
|
234
|
+
if (!u) return;
|
|
235
|
+
const P = () => i(window.innerWidth < 768 ? 0 : window.innerWidth < 1024 ? 768 : window.innerWidth < 1280 ? 1024 : 1280);
|
|
236
|
+
return window.addEventListener("resize", P), P(), () => window.removeEventListener("resize", P);
|
|
237
|
+
}, [u]), t = Dn(t, s);
|
|
238
|
+
const [a, c] = Pe(null);
|
|
239
|
+
ee(() => c(null), [t.width, t.placement]);
|
|
240
|
+
const d = G(null), g = G(0);
|
|
241
|
+
ee(() => () => {
|
|
109
242
|
g.current && cancelAnimationFrame(g.current);
|
|
110
243
|
}, []);
|
|
111
|
-
const
|
|
244
|
+
const x = G(null), b = G(null), h = G(n);
|
|
112
245
|
h.current = n;
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
const [
|
|
116
|
-
|
|
246
|
+
const l = G(t.closeOnEsc);
|
|
247
|
+
l.current = t.closeOnEsc;
|
|
248
|
+
const [y, C] = Pe(Jt), L = t.theme === "light" || t.theme === "dark" ? t.theme : y;
|
|
249
|
+
ee(() => {
|
|
117
250
|
if (t.theme === "light" || t.theme === "dark") return;
|
|
118
|
-
const
|
|
119
|
-
for (const
|
|
120
|
-
const
|
|
121
|
-
return
|
|
122
|
-
|
|
251
|
+
const P = () => C(Jt()), F = new MutationObserver(P);
|
|
252
|
+
for (const de of [document.documentElement, document.body]) F.observe(de, { attributes: !0, attributeFilter: ["class", "data-theme"] });
|
|
253
|
+
const Z = window.matchMedia?.("(prefers-color-scheme: dark)");
|
|
254
|
+
return Z?.addEventListener?.("change", P), P(), () => {
|
|
255
|
+
F.disconnect(), Z?.removeEventListener?.("change", P);
|
|
123
256
|
};
|
|
124
|
-
}, [t.theme]),
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (
|
|
132
|
-
|
|
257
|
+
}, [t.theme]), rn(() => {
|
|
258
|
+
b.current = document.activeElement;
|
|
259
|
+
}, []), ee(() => {
|
|
260
|
+
const P = _n(), F = x.current;
|
|
261
|
+
Xe.push(F), e.current?.focus({ preventScroll: !0 });
|
|
262
|
+
const Z = (te) => {
|
|
263
|
+
const v = e.current;
|
|
264
|
+
if (!v || Xe.at(-1) !== F || te.defaultPrevented || te.isComposing) return;
|
|
265
|
+
if (te.key === "Escape" && l.current !== !1) {
|
|
266
|
+
te.preventDefault(), h.current("escape");
|
|
133
267
|
return;
|
|
134
268
|
}
|
|
135
|
-
if (
|
|
136
|
-
const
|
|
137
|
-
if (!
|
|
138
|
-
|
|
269
|
+
if (te.key !== "Tab") return;
|
|
270
|
+
const H = Hn(v);
|
|
271
|
+
if (!H.length) {
|
|
272
|
+
te.preventDefault(), v.focus();
|
|
139
273
|
return;
|
|
140
274
|
}
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
275
|
+
const ke = document.activeElement, xe = H.indexOf(ke), Ae = te.shiftKey ? -1 : 1;
|
|
276
|
+
if (H.some((Qe) => Qe.tabIndex > 0) || xe === -1 || (te.shiftKey ? xe === 0 : xe === H.length - 1)) {
|
|
277
|
+
te.preventDefault();
|
|
278
|
+
const Qe = xe === -1 ? te.shiftKey ? H.length - 1 : 0 : (xe + Ae + H.length) % H.length;
|
|
279
|
+
H[Qe].focus({ preventScroll: !0 });
|
|
280
|
+
}
|
|
281
|
+
}, de = (te) => {
|
|
282
|
+
Xe.at(-1) === F && e.current && !e.current.contains(te.target) && e.current.focus({ preventScroll: !0 });
|
|
145
283
|
};
|
|
146
|
-
return document.addEventListener("keydown",
|
|
147
|
-
document.removeEventListener("keydown",
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
150
|
-
const
|
|
151
|
-
|
|
284
|
+
return document.addEventListener("keydown", Z), document.addEventListener("focusin", de), () => {
|
|
285
|
+
document.removeEventListener("keydown", Z), document.removeEventListener("focusin", de);
|
|
286
|
+
const te = Xe.at(-1) === F, v = Xe.indexOf(F);
|
|
287
|
+
if (v !== -1 && Xe.splice(v, 1), P(), te) {
|
|
288
|
+
const H = b.current;
|
|
289
|
+
H?.isConnected && !H.closest("[inert], [hidden]") ? H.focus?.({ preventScroll: !0 }) : Xe.at(-1)?.querySelector("[role=dialog]")?.focus?.({ preventScroll: !0 });
|
|
152
290
|
}
|
|
153
291
|
};
|
|
154
292
|
}, [e]);
|
|
155
|
-
const
|
|
156
|
-
!d.current || d.current.id !==
|
|
293
|
+
const S = t.backgroundColor ?? t.backgroudColor, j = typeof S == "string" ? S : S?.[L], D = typeof j == "string" && /^(#|(?:rgb|rgba|hsl|hsla|hwb|oklch|oklab|lab|lch|color|color-mix|light-dark|var)\(|transparent$|currentColor$|[a-z]+$)/i.test(j.trim()) ? j.trim() : null, R = typeof j == "string" && !D ? j.trim() : "", k = !!(D || R), O = ["center", "left", "right", "top", "bottom"].includes(t.placement) ? t.placement : "right", A = Ve(a ?? t.width ?? Wn[t.size] ?? 460), N = Ve(t.height), W = Ve(t.maxHeight), Q = Ve(t.maxWidth), ne = Number(t.viewportGap ?? 5), re = Number.isFinite(ne) ? Math.max(0, ne) : 5, I = t.top == null ? null : Ve(t.top), _ = O !== "bottom" && I !== null ? I : null, le = typeof t.borderRadius == "number" ? `${t.borderRadius}px` : t.borderRadius ?? "12px", E = t.resizable && !t.fullscreen && ["left", "right"].includes(O), z = (P) => Kn(P, t.minWidth, typeof t.maxWidth == "number" ? t.maxWidth : void 0, x.current?.clientWidth - re * 2 || window.innerWidth), K = (P) => {
|
|
294
|
+
!d.current || d.current.id !== P.pointerId || (cancelAnimationFrame(g.current), c(d.current.width), e.current?.style.removeProperty("--pmn-drag-width"), d.current = null);
|
|
157
295
|
};
|
|
158
|
-
return
|
|
296
|
+
return zn(/* @__PURE__ */ m(
|
|
159
297
|
"div",
|
|
160
298
|
{
|
|
161
|
-
ref:
|
|
162
|
-
className: `pmn-overlay ${o ? "pmn-exiting" : "pmn-entering"} ${t.animation === !1 ? "pmn-no-animation" : ""} pmn-place-${
|
|
163
|
-
style: { padding:
|
|
164
|
-
onMouseDown: (
|
|
165
|
-
|
|
299
|
+
ref: x,
|
|
300
|
+
className: `pmn-overlay ${o ? "pmn-exiting" : "pmn-entering"} ${t.animation === !1 ? "pmn-no-animation" : ""} pmn-place-${O} ${t.fullscreen ? "pmn-fullscreen" : ""} ${t.mobileFullscreen ? "pmn-mobile-fullscreen" : ""}`,
|
|
301
|
+
style: { padding: re, ...t.bottom != null ? { paddingBottom: Ve(t.bottom) } : {}, ...t.left != null ? { paddingLeft: Ve(t.left) } : {}, ...t.right != null ? { paddingRight: Ve(t.right) } : {}, ..._ !== null ? { paddingTop: _, "--pmn-top-offset": _ } : {}, "--pmn-animation-duration": `${Math.min(1e3, Math.max(0, Number(t.animationDuration ?? 220) || 0))}ms` },
|
|
302
|
+
onMouseDown: (P) => {
|
|
303
|
+
P.target === P.currentTarget && t.closeOnOverlay === !0 && h.current("overlay");
|
|
166
304
|
},
|
|
167
|
-
children: /* @__PURE__ */
|
|
305
|
+
children: /* @__PURE__ */ Me(
|
|
168
306
|
"section",
|
|
169
307
|
{
|
|
170
308
|
ref: e,
|
|
@@ -172,36 +310,36 @@ function xn({ dialogRef: e, options: t, requestClose: n, children: r, exiting: o
|
|
|
172
310
|
role: "dialog",
|
|
173
311
|
"aria-modal": "true",
|
|
174
312
|
"aria-label": t.ariaLabel ?? "Dialog",
|
|
175
|
-
"data-modal-theme":
|
|
176
|
-
className: `pmn-dialog ${
|
|
177
|
-
style: { "--pmn-width":
|
|
313
|
+
"data-modal-theme": L,
|
|
314
|
+
className: `pmn-dialog ${L === "dark" ? "dark" : ""} ${k ? "pmn-has-custom-background" : ""} ${t.className ?? ""}`,
|
|
315
|
+
style: { "--pmn-width": A, "--pmn-gap": `${re}px`, ..._ !== null ? { "--pmn-top-offset": _ } : {}, ...N !== void 0 ? { "--pmn-height": N } : {}, ...W !== void 0 ? { "--pmn-max-height": W } : {}, ...Q !== void 0 ? { "--pmn-max-width": Q } : {}, borderRadius: le },
|
|
178
316
|
children: [
|
|
179
|
-
|
|
317
|
+
k && /* @__PURE__ */ m("div", { "aria-hidden": "true", className: `pmn-custom-background-layer ${R}`, style: D ? { backgroundColor: D } : void 0 }),
|
|
180
318
|
r,
|
|
181
|
-
|
|
319
|
+
E && /* @__PURE__ */ m(
|
|
182
320
|
"div",
|
|
183
321
|
{
|
|
184
322
|
role: "separator",
|
|
185
323
|
"aria-label": "调整弹窗宽度",
|
|
186
324
|
"aria-orientation": "vertical",
|
|
187
325
|
tabIndex: 0,
|
|
188
|
-
className: `pmn-resize-handle pmn-resize-${
|
|
189
|
-
onKeyDown: (
|
|
190
|
-
["ArrowLeft", "ArrowRight"].includes(
|
|
326
|
+
className: `pmn-resize-handle pmn-resize-${O}`,
|
|
327
|
+
onKeyDown: (P) => {
|
|
328
|
+
["ArrowLeft", "ArrowRight"].includes(P.key) && (P.preventDefault(), c(z(e.current.getBoundingClientRect().width + (P.key === "ArrowRight" ? 16 : -16) * (O === "left" ? 1 : -1))));
|
|
191
329
|
},
|
|
192
|
-
onPointerDown: (
|
|
193
|
-
if (
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
d.current = { id:
|
|
330
|
+
onPointerDown: (P) => {
|
|
331
|
+
if (P.button !== 0) return;
|
|
332
|
+
P.preventDefault(), P.currentTarget.setPointerCapture(P.pointerId);
|
|
333
|
+
const F = e.current.getBoundingClientRect().width;
|
|
334
|
+
d.current = { id: P.pointerId, x: P.clientX, start: F, width: F };
|
|
197
335
|
},
|
|
198
|
-
onPointerMove: (
|
|
199
|
-
const
|
|
200
|
-
!
|
|
336
|
+
onPointerMove: (P) => {
|
|
337
|
+
const F = d.current;
|
|
338
|
+
!F || F.id !== P.pointerId || (F.width = z(F.start + (P.clientX - F.x) * (O === "left" ? 1 : -1)), cancelAnimationFrame(g.current), g.current = requestAnimationFrame(() => e.current?.style.setProperty("--pmn-drag-width", `${F.width}px`)));
|
|
201
339
|
},
|
|
202
|
-
onPointerUp:
|
|
203
|
-
onPointerCancel:
|
|
204
|
-
onLostPointerCapture:
|
|
340
|
+
onPointerUp: K,
|
|
341
|
+
onPointerCancel: K,
|
|
342
|
+
onLostPointerCapture: K
|
|
205
343
|
}
|
|
206
344
|
)
|
|
207
345
|
]
|
|
@@ -210,155 +348,155 @@ function xn({ dialogRef: e, options: t, requestClose: n, children: r, exiting: o
|
|
|
210
348
|
}
|
|
211
349
|
), document.body);
|
|
212
350
|
}
|
|
213
|
-
const
|
|
214
|
-
function
|
|
215
|
-
const r =
|
|
216
|
-
let
|
|
351
|
+
const Vn = (e) => e;
|
|
352
|
+
function Fe(e, t = Vn, n = Object.is) {
|
|
353
|
+
const r = G({ store: null, initialized: !1, selection: void 0 }), o = V(() => {
|
|
354
|
+
let i = !1, u, a;
|
|
217
355
|
return () => {
|
|
218
|
-
const
|
|
219
|
-
if (
|
|
220
|
-
const d = t(
|
|
221
|
-
if (
|
|
222
|
-
n(
|
|
356
|
+
const c = e.getSnapshot();
|
|
357
|
+
if (i && Object.is(u, c)) return a;
|
|
358
|
+
const d = t(c);
|
|
359
|
+
if (i)
|
|
360
|
+
n(a, d) || (a = d);
|
|
223
361
|
else {
|
|
224
362
|
const g = r.current;
|
|
225
|
-
|
|
363
|
+
a = g.initialized && g.store === e && n(g.selection, d) ? g.selection : d;
|
|
226
364
|
}
|
|
227
|
-
return
|
|
365
|
+
return u = c, i = !0, a;
|
|
228
366
|
};
|
|
229
|
-
}, [e, t, n]),
|
|
230
|
-
return
|
|
231
|
-
r.current = { store: e, initialized: !0, selection:
|
|
232
|
-
}, [e,
|
|
367
|
+
}, [e, t, n]), s = Ee(e.subscribe, o, o);
|
|
368
|
+
return ee(() => {
|
|
369
|
+
r.current = { store: e, initialized: !0, selection: s };
|
|
370
|
+
}, [e, s]), s;
|
|
233
371
|
}
|
|
234
|
-
function
|
|
372
|
+
function Ye(e, t) {
|
|
235
373
|
if (Object.is(e, t)) return !0;
|
|
236
374
|
if (!e || !t || typeof e != "object" || typeof t != "object") return !1;
|
|
237
375
|
const n = Object.keys(e);
|
|
238
376
|
return n.length === Object.keys(t).length && n.every((r) => Object.hasOwn(t, r) && Object.is(e[r], t[r]));
|
|
239
377
|
}
|
|
240
|
-
const
|
|
241
|
-
function
|
|
378
|
+
const it = (e) => (t) => Object.fromEntries(e.map((n) => [n, t[n]])), Yn = it(["pageAnimationDuration", "pageAnimationDistance", "pageAnimation", "animation", "lockCloseWhileLoading", "maxCachedScreens", "bodyClassName", "lazyFallback", "onBlur", "onNavigate", "onRouteChange", "onFocus"]), Qn = it(["bodyClassName", "lazyFallback"]), Zn = it(["showHeader", "showTitle", "renderHeader", "renderHeaderRight", "showHeaderBorder", "headerClassName", "showBackButton", "showCloseButton"]), hn = it(["showFooter", "renderFooter", "done", "cancel", "cancle", "showFooterBorder", "footerClassName", "actions", "loadingText", "cancelText", "doneText", "doneDisabled"]), Xn = it(["fullscreenable", "fullscreen"]), _t = ["responsive", "width", "height", "maxWidth", "maxHeight", "minWidth", "size", "placement", "viewportGap", "top", "bottom", "left", "right", "borderRadius", "resizable", "fullscreen", "mobileFullscreen", "animation", "animationDuration", "closeOnEsc", "closeOnOverlay", "theme", "backgroundColor", "backgroudColor", "ariaLabel", "className"], Jn = it(_t);
|
|
379
|
+
function er(e, t) {
|
|
242
380
|
const n = { ...e, ...t, ...e.runtimeLayout };
|
|
243
|
-
return { ...
|
|
244
|
-
}
|
|
245
|
-
function
|
|
246
|
-
return
|
|
247
|
-
}
|
|
248
|
-
const
|
|
249
|
-
},
|
|
250
|
-
const r =
|
|
251
|
-
return
|
|
252
|
-
|
|
253
|
-
}), []), /* @__PURE__ */
|
|
254
|
-
if (!(r.current || !
|
|
255
|
-
r.current = !0,
|
|
381
|
+
return { ...Jn(n), runtimeLayout: Object.fromEntries(_t.filter((r) => Object.hasOwn(e.runtimeLayout ?? {}, r)).map((r) => [r, e.runtimeLayout[r]])) };
|
|
382
|
+
}
|
|
383
|
+
function tr(e, t) {
|
|
384
|
+
return Ye(e.runtimeLayout, t.runtimeLayout) && _t.every((n) => Object.is(e[n], t[n]));
|
|
385
|
+
}
|
|
386
|
+
const gn = {}, nr = () => gn, rr = () => () => {
|
|
387
|
+
}, or = Oe.memo(function({ action: t, context: n }) {
|
|
388
|
+
const r = G(!1), [o, s] = Pe(!1), i = G(!1);
|
|
389
|
+
return ee(() => (i.current = !0, () => {
|
|
390
|
+
i.current = !1;
|
|
391
|
+
}), []), /* @__PURE__ */ m("button", { type: "button", className: "pmn-icon-button", "aria-label": t.tooltip ?? t.key, title: t.tooltip, disabled: o || t.disabled || t.loading, onClick: async () => {
|
|
392
|
+
if (!(r.current || !i.current || t.disabled || t.loading)) {
|
|
393
|
+
r.current = !0, s(!0);
|
|
256
394
|
try {
|
|
257
395
|
await t.onClick?.(n);
|
|
258
|
-
} catch (
|
|
259
|
-
console.error("[react-modal-navigation] header action",
|
|
396
|
+
} catch (u) {
|
|
397
|
+
console.error("[react-modal-navigation] header action", u);
|
|
260
398
|
} finally {
|
|
261
|
-
r.current = !1,
|
|
399
|
+
r.current = !1, i.current && s(!1);
|
|
262
400
|
}
|
|
263
401
|
}
|
|
264
402
|
}, children: o ? "…" : t.icon ?? t.label });
|
|
265
403
|
});
|
|
266
|
-
function
|
|
267
|
-
return /* @__PURE__ */
|
|
404
|
+
function en({ back: e }) {
|
|
405
|
+
return /* @__PURE__ */ m("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", width: "20", height: "20", fill: "none", stroke: "currentColor", strokeWidth: "2", children: e ? /* @__PURE__ */ m("path", { d: "m15 18-6-6 6-6" }) : /* @__PURE__ */ m("path", { d: "M18 6 6 18M6 6l12 12" }) });
|
|
268
406
|
}
|
|
269
|
-
function
|
|
270
|
-
const
|
|
271
|
-
t = { ...t, ...
|
|
272
|
-
const d =
|
|
407
|
+
function sr({ options: e, screen: t, route: n, navigation: r, requestClose: o, translate: s, canGoBack: i }) {
|
|
408
|
+
const u = Y(Lt), a = () => u?.getSnapshot()[n.key] ?? gn, c = Ee(u?.subscribe ?? rr, a, nr);
|
|
409
|
+
t = { ...t, ...c };
|
|
410
|
+
const d = s ?? ((y) => y), g = t.showTitle ?? e.showTitle ?? !0, x = typeof t.title == "function" ? t.title({ t: d, route: n, navigation: r }) : t.title ?? n.name, b = V(() => ({ route: n, navigation: r, close: o, canGoBack: i, title: x, t: d }), [n, r, o, i, x, d]);
|
|
273
411
|
if (e.showHeader === !1) return null;
|
|
274
412
|
const h = t.renderHeader ?? e.renderHeader;
|
|
275
|
-
if (h) return h(
|
|
276
|
-
const
|
|
277
|
-
return /* @__PURE__ */
|
|
278
|
-
(t.showBackButton ?? e.showBackButton) !== !1 &&
|
|
279
|
-
g ? /* @__PURE__ */
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
(t.showCloseButton ?? e.showCloseButton) !== !1 && /* @__PURE__ */
|
|
413
|
+
if (h) return h(b);
|
|
414
|
+
const l = t.renderHeaderRight ?? e.renderHeaderRight;
|
|
415
|
+
return /* @__PURE__ */ Me("header", { className: `pmn-header ${t.showHeaderBorder ?? e.showHeaderBorder ? "pmn-border-bottom" : ""} ${e.headerClassName ?? ""}`, children: [
|
|
416
|
+
(t.showBackButton ?? e.showBackButton) !== !1 && i && /* @__PURE__ */ m("button", { type: "button", className: "pmn-icon-button", "aria-label": d("modal.back"), onClick: () => r.goBack(), children: /* @__PURE__ */ m(en, { back: !0 }) }),
|
|
417
|
+
g ? /* @__PURE__ */ m("h2", { children: x }) : /* @__PURE__ */ m("div", { className: "pmn-header-spacer" }),
|
|
418
|
+
l?.(b),
|
|
419
|
+
c.actions?.filter((y) => !y.hidden).map((y) => /* @__PURE__ */ m(or, { action: y, context: b }, `${n.key}:${y.key}`)),
|
|
420
|
+
/* @__PURE__ */ m(ar, { hidden: t.showFullscreenButton === !1 }),
|
|
421
|
+
(t.showCloseButton ?? e.showCloseButton) !== !1 && /* @__PURE__ */ m("button", { type: "button", className: "pmn-icon-button", "aria-label": d("modal.close"), onClick: () => o("header"), children: /* @__PURE__ */ m(en, {}) })
|
|
284
422
|
] });
|
|
285
423
|
}
|
|
286
|
-
const
|
|
287
|
-
const n =
|
|
288
|
-
return t || !o.fullscreenable ? null : /* @__PURE__ */
|
|
289
|
-
}),
|
|
290
|
-
const o =
|
|
291
|
-
return /* @__PURE__ */
|
|
292
|
-
}),
|
|
293
|
-
const r =
|
|
294
|
-
return /* @__PURE__ */
|
|
295
|
-
}),
|
|
296
|
-
const
|
|
297
|
-
|
|
298
|
-
|
|
424
|
+
const ar = Oe.memo(function({ hidden: t }) {
|
|
425
|
+
const n = Y(Dt), r = Y(We), o = Fe(r.stores.layout, Xn, Ye);
|
|
426
|
+
return t || !o.fullscreenable ? null : /* @__PURE__ */ m("button", { type: "button", className: "pmn-icon-button", "aria-label": o.fullscreen ? "还原" : "全屏", onClick: n?.toggleFullscreen, children: /* @__PURE__ */ m("svg", { "aria-hidden": "true", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ m("path", { d: o.fullscreen ? "M3 9h6V3 M21 9h-6V3 M3 15h6v6 M21 15h-6v6" : "M3 9V3h6 M15 3h6v6 M3 15v6h6 M15 21h6v-6" }) }) });
|
|
427
|
+
}), yn = pt(function({ store: t, screenOptions: n, ...r }) {
|
|
428
|
+
const o = X((i) => er(i, n), [n]), s = Fe(t, o, tr);
|
|
429
|
+
return /* @__PURE__ */ m(Un, { ...r, options: s });
|
|
430
|
+
}), vn = pt(function({ store: t, ...n }) {
|
|
431
|
+
const r = Fe(t, Zn, Ye);
|
|
432
|
+
return /* @__PURE__ */ m(sr, { ...n, options: r });
|
|
433
|
+
}), ir = Oe.memo(function({ action: t, context: n, loadingApi: r, onError: o, loadingText: s }) {
|
|
434
|
+
const i = G(!1), [u, a] = Pe(!1), c = G(!1);
|
|
435
|
+
ee(() => (c.current = !0, () => {
|
|
436
|
+
c.current = !1;
|
|
299
437
|
}), []);
|
|
300
|
-
const d =
|
|
301
|
-
if (!
|
|
302
|
-
|
|
303
|
-
const
|
|
438
|
+
const d = u || t.loading === !0, g = t.loadingText ?? s ?? n.t("modal.processing"), x = async () => {
|
|
439
|
+
if (!c.current || i.current || t.disabled || t.loading || typeof t.onClick != "function") return;
|
|
440
|
+
i.current = !0, a(!0);
|
|
441
|
+
const b = r?.begin(n.route.key, g);
|
|
304
442
|
try {
|
|
305
443
|
await t.onClick(n);
|
|
306
444
|
} catch (h) {
|
|
307
445
|
o?.(h, { phase: "footer", action: t.key, route: n.route });
|
|
308
446
|
} finally {
|
|
309
|
-
|
|
447
|
+
b != null && r?.end(n.route.key, b), i.current = !1, c.current && a(!1);
|
|
310
448
|
}
|
|
311
449
|
};
|
|
312
|
-
return /* @__PURE__ */
|
|
450
|
+
return /* @__PURE__ */ m(
|
|
313
451
|
"button",
|
|
314
452
|
{
|
|
315
453
|
type: "button",
|
|
316
454
|
disabled: t.disabled === !0 || d,
|
|
317
455
|
className: `pmn-button ${t.variant === "primary" || t.variant === "danger" ? "pmn-button-primary" : "pmn-button-secondary"} ${t.variant === "danger" ? "pmn-button-danger" : ""}`,
|
|
318
|
-
onClick:
|
|
456
|
+
onClick: x,
|
|
319
457
|
children: d ? g : t.label
|
|
320
458
|
}
|
|
321
459
|
);
|
|
322
460
|
});
|
|
323
|
-
function
|
|
324
|
-
const [
|
|
325
|
-
|
|
326
|
-
|
|
461
|
+
function bn({ screen: e, options: t, override: n, route: r, navigation: o, requestClose: s, translate: i, onError: u, loadingApi: a }) {
|
|
462
|
+
const [c, d] = Pe(null), g = G(/* @__PURE__ */ new Set()), x = G(!0);
|
|
463
|
+
ee(() => (x.current = !0, () => {
|
|
464
|
+
x.current = !1;
|
|
327
465
|
}), []);
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
330
|
-
const
|
|
331
|
-
if (typeof
|
|
332
|
-
const
|
|
333
|
-
if (!
|
|
334
|
-
const
|
|
335
|
-
if (!
|
|
336
|
-
g.current.add(
|
|
337
|
-
const
|
|
466
|
+
const b = i ?? ((A) => A), h = { ...t, ...e, ...n }, { showFooter: l, renderFooter: y, done: C, cancel: L, cancle: S } = h, j = L ?? S, D = V(() => ({ route: r, navigation: o, close: s, t: b }), [r, o, s, b]);
|
|
467
|
+
if (l === !1) return null;
|
|
468
|
+
const R = `pmn-footer ${h.showFooterBorder ? "pmn-border-top" : ""} ${h.footerClassName ?? ""}`;
|
|
469
|
+
if (typeof y == "function") return /* @__PURE__ */ m("footer", { className: R, children: y({ ...D, pending: g.current.size > 0 }) });
|
|
470
|
+
const k = Array.isArray(h.actions) ? h.actions : null;
|
|
471
|
+
if (!k && typeof C != "function" && typeof j != "function") return null;
|
|
472
|
+
const O = async (A, N, W) => {
|
|
473
|
+
if (!x.current || g.current.size > 0 || g.current.has(A) || typeof N != "function") return;
|
|
474
|
+
g.current.add(A), d(A);
|
|
475
|
+
const Q = a?.begin(r.key, h.loadingText ?? b("modal.processing"));
|
|
338
476
|
try {
|
|
339
|
-
await
|
|
340
|
-
} catch (
|
|
341
|
-
|
|
477
|
+
await N(D);
|
|
478
|
+
} catch (ne) {
|
|
479
|
+
u?.(ne, { phase: "footer", action: A, route: r });
|
|
342
480
|
} finally {
|
|
343
|
-
|
|
481
|
+
Q != null && a?.end(r.key, Q), g.current.delete(A), x.current && d((ne) => ne === A ? null : ne);
|
|
344
482
|
}
|
|
345
483
|
};
|
|
346
|
-
return
|
|
347
|
-
(
|
|
348
|
-
) }) : /* @__PURE__ */
|
|
349
|
-
typeof
|
|
350
|
-
typeof
|
|
484
|
+
return k ? /* @__PURE__ */ m("footer", { className: R, children: k.filter((A) => !A.hidden).map(
|
|
485
|
+
(A) => /* @__PURE__ */ m(ir, { action: A, context: D, loadingApi: a, onError: u, loadingText: h.loadingText }, `${r.key}:${A.key}`)
|
|
486
|
+
) }) : /* @__PURE__ */ Me("footer", { className: R, children: [
|
|
487
|
+
typeof j == "function" && /* @__PURE__ */ m("button", { type: "button", disabled: c !== null, onClick: () => O("cancel", j), className: "pmn-button pmn-button-secondary", children: h.cancelText ?? b("modal.cancel") }),
|
|
488
|
+
typeof C == "function" && /* @__PURE__ */ m("button", { type: "button", disabled: c !== null || h.doneDisabled === !0, onClick: () => O("done", C), className: "pmn-button pmn-button-primary", children: c === "done" ? h.loadingText ?? b("modal.processing") : h.doneText ?? b("modal.done") })
|
|
351
489
|
] });
|
|
352
490
|
}
|
|
353
|
-
function
|
|
491
|
+
function wn({ loading: e, translate: t }) {
|
|
354
492
|
if (!e.visible) return null;
|
|
355
|
-
const r = (t ?? ((
|
|
356
|
-
return /* @__PURE__ */
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
o && /* @__PURE__ */
|
|
493
|
+
const r = (t ?? ((s) => s))("modal.loading"), o = e.text ?? (r === "modal.loading" ? "加载中..." : r);
|
|
494
|
+
return /* @__PURE__ */ m("div", { className: "pmn-loading-overlay", role: "status", "aria-live": "polite", "aria-busy": "true", children: /* @__PURE__ */ Me("div", { className: "pmn-loading-content", children: [
|
|
495
|
+
/* @__PURE__ */ m("span", { className: "pmn-spinner", "aria-hidden": "true" }),
|
|
496
|
+
o && /* @__PURE__ */ m("span", { className: "pmn-loading-text", children: o })
|
|
359
497
|
] }) });
|
|
360
498
|
}
|
|
361
|
-
class
|
|
499
|
+
class Tt extends Oe.Component {
|
|
362
500
|
state = { error: null };
|
|
363
501
|
static getDerivedStateFromError(t) {
|
|
364
502
|
return { error: t };
|
|
@@ -370,65 +508,65 @@ class Nt extends Se.Component {
|
|
|
370
508
|
t.route?.key !== this.props.route?.key && this.state.error && this.setState({ error: null });
|
|
371
509
|
}
|
|
372
510
|
render() {
|
|
373
|
-
return this.state.error ? /* @__PURE__ */
|
|
374
|
-
/* @__PURE__ */
|
|
375
|
-
/* @__PURE__ */
|
|
376
|
-
/* @__PURE__ */
|
|
511
|
+
return this.state.error ? /* @__PURE__ */ Me("div", { role: "alert", className: "pmn-error-screen", children: [
|
|
512
|
+
/* @__PURE__ */ m("strong", { children: "页面加载失败" }),
|
|
513
|
+
/* @__PURE__ */ m("p", { children: this.state.error.message }),
|
|
514
|
+
/* @__PURE__ */ m("button", { type: "button", className: "pmn-button pmn-button-secondary", onClick: () => {
|
|
377
515
|
this.props.onRetry?.(), this.setState({ error: null });
|
|
378
516
|
}, children: "重试" })
|
|
379
517
|
] }) : this.props.children;
|
|
380
518
|
}
|
|
381
519
|
}
|
|
382
|
-
const
|
|
383
|
-
function
|
|
384
|
-
return e.length ? /* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
n.dismissible && /* @__PURE__ */
|
|
520
|
+
const cr = { success: "✓", error: "×", warning: "!", info: "i" };
|
|
521
|
+
function kn({ items: e, dismiss: t }) {
|
|
522
|
+
return e.length ? /* @__PURE__ */ m("div", { className: "pmn-toast-region", "aria-label": "Notifications", children: e.map((n) => /* @__PURE__ */ Me("div", { className: `pmn-toast pmn-toast-${n.type}`, role: n.type === "error" || n.type === "warning" ? "alert" : "status", children: [
|
|
523
|
+
/* @__PURE__ */ m("span", { className: "pmn-toast-symbol", "aria-hidden": "true", children: cr[n.type] }),
|
|
524
|
+
/* @__PURE__ */ m("span", { className: "pmn-toast-message", children: n.message }),
|
|
525
|
+
n.dismissible && /* @__PURE__ */ m("button", { type: "button", className: "pmn-toast-close", "aria-label": "Dismiss notification", onClick: () => t(n.id), children: "×" })
|
|
388
526
|
] }, n.id)) }) : null;
|
|
389
527
|
}
|
|
390
|
-
function
|
|
391
|
-
const r =
|
|
392
|
-
clearTimeout(o.current.get(
|
|
393
|
-
}, []),
|
|
394
|
-
if (typeof
|
|
395
|
-
const d = typeof
|
|
528
|
+
function xn(e, t, n) {
|
|
529
|
+
const r = G(0), o = G(/* @__PURE__ */ new Map()), s = X((a) => {
|
|
530
|
+
clearTimeout(o.current.get(a)), o.current.delete(a), t.current && e.current.publish(e.current.getSnapshot().filter((c) => c.id !== a));
|
|
531
|
+
}, []), i = X((a, c = {}) => {
|
|
532
|
+
if (typeof a != "string" || !a.trim()) throw new TypeError("[react-modal-navigation] toast message must be a non-empty string");
|
|
533
|
+
const d = typeof c == "string" ? { type: c } : c ?? {}, g = ["success", "error", "warning", "info"].includes(d.type) ? d.type : "info", x = ++r.current, b = Number.isFinite(d.duration) ? Math.max(0, d.duration) : 3e3;
|
|
396
534
|
if (!t.current) return null;
|
|
397
|
-
const h = e.current.getSnapshot(),
|
|
398
|
-
for (const
|
|
399
|
-
clearTimeout(o.current.get(
|
|
400
|
-
return e.current.publish([...h.slice(-4), { id:
|
|
401
|
-
}, [
|
|
402
|
-
const
|
|
403
|
-
for (const
|
|
404
|
-
return
|
|
405
|
-
const
|
|
535
|
+
const h = e.current.getSnapshot(), l = h.slice(0, Math.max(0, h.length - 4));
|
|
536
|
+
for (const y of l)
|
|
537
|
+
clearTimeout(o.current.get(y.id)), o.current.delete(y.id);
|
|
538
|
+
return e.current.publish([...h.slice(-4), { id: x, message: a, type: g, dismissible: d.dismissible !== !1 }]), b > 0 && o.current.set(x, setTimeout(() => s(x), b)), x;
|
|
539
|
+
}, [s]), u = V(() => {
|
|
540
|
+
const a = (c, d) => i(c, d);
|
|
541
|
+
for (const c of ["success", "error", "warning", "info"]) a[c] = (d, g = {}) => i(d, { ...g, type: c });
|
|
542
|
+
return a.promise = async (c, d, g = {}) => {
|
|
543
|
+
const x = i(d.loading, { ...g, type: "info", duration: 0 });
|
|
406
544
|
try {
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
const h = typeof d.success == "function" ? d.success(
|
|
410
|
-
return h &&
|
|
411
|
-
} catch (
|
|
412
|
-
|
|
413
|
-
const h = typeof d.error == "function" ? d.error(
|
|
414
|
-
throw h &&
|
|
545
|
+
const b = await (typeof c == "function" ? c() : c);
|
|
546
|
+
x != null && s(x);
|
|
547
|
+
const h = typeof d.success == "function" ? d.success(b) : d.success;
|
|
548
|
+
return h && i(h, { ...g, type: "success" }), b;
|
|
549
|
+
} catch (b) {
|
|
550
|
+
x != null && s(x);
|
|
551
|
+
const h = typeof d.error == "function" ? d.error(b) : d.error;
|
|
552
|
+
throw h && i(h, { ...g, type: "error" }), b;
|
|
415
553
|
}
|
|
416
|
-
},
|
|
417
|
-
for (const
|
|
554
|
+
}, a.dismiss = s, a.clear = () => {
|
|
555
|
+
for (const c of o.current.values()) clearTimeout(c);
|
|
418
556
|
o.current.clear(), e.current.publish([]);
|
|
419
|
-
},
|
|
420
|
-
}, [
|
|
421
|
-
return
|
|
422
|
-
const
|
|
557
|
+
}, a;
|
|
558
|
+
}, [i, s]);
|
|
559
|
+
return ee(() => {
|
|
560
|
+
const a = () => {
|
|
423
561
|
for (const d of o.current.values()) clearTimeout(d);
|
|
424
562
|
o.current.clear();
|
|
425
|
-
},
|
|
563
|
+
}, c = n?.addCleanup(a);
|
|
426
564
|
return () => {
|
|
427
|
-
|
|
565
|
+
c?.(), a();
|
|
428
566
|
};
|
|
429
|
-
}, [n]), { toast:
|
|
567
|
+
}, [n]), { toast: u, dismissToast: s };
|
|
430
568
|
}
|
|
431
|
-
function
|
|
569
|
+
function lr(e) {
|
|
432
570
|
let t;
|
|
433
571
|
return {
|
|
434
572
|
added(n) {
|
|
@@ -443,375 +581,439 @@ function Fn(e) {
|
|
|
443
581
|
}
|
|
444
582
|
};
|
|
445
583
|
}
|
|
446
|
-
function
|
|
447
|
-
const o = r.loadingTasks,
|
|
584
|
+
function Sn(e, t, n, r) {
|
|
585
|
+
const o = r.loadingTasks, s = r.loadingSequence, i = V(() => lr(o.current), [o]), u = X(() => {
|
|
448
586
|
if (!t.current) return;
|
|
449
|
-
const h =
|
|
450
|
-
(
|
|
451
|
-
}, [
|
|
587
|
+
const h = i.read(), l = e.current.getSnapshot();
|
|
588
|
+
(l.visible !== h.visible || l.text !== h.text || l.count !== h.count) && e.current.publish(h);
|
|
589
|
+
}, [i]), a = X((h, l) => {
|
|
452
590
|
if (!t.current || h !== "global" && n.current !== h) return null;
|
|
453
|
-
const
|
|
454
|
-
return o.current.set(
|
|
455
|
-
}, [
|
|
456
|
-
if (
|
|
457
|
-
o.current.get(
|
|
591
|
+
const y = ++s.current;
|
|
592
|
+
return o.current.set(y, { owner: h, text: l }), i.added(y), u(), y;
|
|
593
|
+
}, [u, i]), c = X((h, l) => {
|
|
594
|
+
if (l != null)
|
|
595
|
+
o.current.get(l)?.owner === h && o.current.delete(l);
|
|
458
596
|
else
|
|
459
|
-
for (const [
|
|
460
|
-
|
|
461
|
-
}, [
|
|
462
|
-
h ? (
|
|
463
|
-
}, [
|
|
464
|
-
|
|
465
|
-
}, [
|
|
466
|
-
return { loadingApi:
|
|
467
|
-
}
|
|
468
|
-
const
|
|
469
|
-
const r =
|
|
470
|
-
return /* @__PURE__ */
|
|
471
|
-
}),
|
|
472
|
-
const r =
|
|
473
|
-
return /* @__PURE__ */
|
|
474
|
-
}),
|
|
475
|
-
const
|
|
476
|
-
return /* @__PURE__ */
|
|
477
|
-
}),
|
|
478
|
-
const h =
|
|
479
|
-
|
|
480
|
-
const
|
|
481
|
-
if (
|
|
482
|
-
const
|
|
483
|
-
|
|
484
|
-
const
|
|
485
|
-
{ opacity: 1, transform: `translate3d(${
|
|
597
|
+
for (const [y, C] of o.current) C.owner === h && o.current.delete(y);
|
|
598
|
+
u();
|
|
599
|
+
}, [u]), d = X((h, l) => {
|
|
600
|
+
h ? (c("global"), a("global", l)) : c("global");
|
|
601
|
+
}, [a, c]), g = X((h, l, y) => {
|
|
602
|
+
l ? (c(h), a(h, y)) : c(h);
|
|
603
|
+
}, [a, c]);
|
|
604
|
+
return { loadingApi: V(() => ({ setLoading: d, setScreenLoading: g, begin: a, end: c }), [d, g, a, c]), refreshLoading: u, loadingTasks: o, setLoading: d };
|
|
605
|
+
}
|
|
606
|
+
const ur = Oe.memo(function({ store: t, translate: n }) {
|
|
607
|
+
const r = Ee(t.subscribe, t.getSnapshot, t.getSnapshot);
|
|
608
|
+
return /* @__PURE__ */ m(wn, { loading: r, translate: n });
|
|
609
|
+
}), dr = Oe.memo(function({ store: t, dismiss: n }) {
|
|
610
|
+
const r = Ee(t.subscribe, t.getSnapshot, t.getSnapshot);
|
|
611
|
+
return /* @__PURE__ */ m(kn, { items: r, dismiss: n });
|
|
612
|
+
}), mr = Oe.memo(function({ store: t, layoutStore: n, routeKey: r, ...o }) {
|
|
613
|
+
const s = () => t.getSnapshot()[r], i = Ee(t.subscribe, s, s), u = Fe(n, hn, Ye);
|
|
614
|
+
return /* @__PURE__ */ m(bn, { ...o, options: u, override: i });
|
|
615
|
+
}), fr = Oe.memo(function({ route: t, screen: n, navigation: r, focused: o, resultEvent: s, setFooter: i, loadingApi: u, loadingStore: a, bodyClassName: c, notifyError: d, registerDirtyGuard: g, pageMotion: x, lazyFallback: b }) {
|
|
616
|
+
const h = G(null), l = G(!1);
|
|
617
|
+
Se(() => {
|
|
618
|
+
const S = o && !l.current;
|
|
619
|
+
if (l.current = o, !S || !x?.enabled || !h.current?.animate) return;
|
|
620
|
+
const j = x.direction === "back" ? -100 : 100;
|
|
621
|
+
h.current.style.zIndex = "2";
|
|
622
|
+
const D = h.current.animate([
|
|
623
|
+
{ opacity: 1, transform: `translate3d(${j}%,0,0)` },
|
|
486
624
|
{ opacity: 1, transform: "translate3d(0,0,0)" }
|
|
487
|
-
], { duration:
|
|
625
|
+
], { duration: x.duration, easing: "cubic-bezier(.22,1,.36,1)" });
|
|
488
626
|
return () => {
|
|
489
|
-
|
|
627
|
+
D.cancel(), h.current && (h.current.style.zIndex = "");
|
|
490
628
|
};
|
|
491
|
-
}, [o,
|
|
492
|
-
const
|
|
493
|
-
setLoading: (
|
|
494
|
-
showLoading: (
|
|
495
|
-
hideLoading: (
|
|
496
|
-
}), [
|
|
497
|
-
return /* @__PURE__ */
|
|
629
|
+
}, [o, x?.enabled, x?.direction, x?.duration, x?.distance]);
|
|
630
|
+
const y = V(() => ({ isFocused: o, resultEvent: s, routeKey: t.key, setFooter: i }), [o, s, t.key, i]), C = V(() => ({
|
|
631
|
+
setLoading: (S, j) => u.setScreenLoading(t.key, S, j),
|
|
632
|
+
showLoading: (S) => u.begin(t.key, S),
|
|
633
|
+
hideLoading: (S) => u.end(t.key, S)
|
|
634
|
+
}), [u, t.key]), L = V(() => ({ routeKey: t.key, registerDirtyGuard: g }), [t.key, g]);
|
|
635
|
+
return /* @__PURE__ */ m(Je.Provider, { value: t, children: /* @__PURE__ */ m(It.Provider, { value: L, children: /* @__PURE__ */ m(at.Provider, { value: y, children: /* @__PURE__ */ m(st.Provider, { value: C, children: /* @__PURE__ */ m(Ot.Provider, { value: a, children: /* @__PURE__ */ m("div", { ref: h, hidden: !o, inert: !o, "data-modal-route-key": t.key, tabIndex: -1, className: `pmn-body ${o && x?.enabled && typeof Element < "u" && !Element.prototype.animate ? `pmn-page-enter pmn-page-${x.direction}` : ""} ${c ?? ""}`, style: o && x?.enabled ? { "--pmn-page-duration": `${x.duration}ms`, "--pmn-page-distance": `${x.distance}px` } : void 0, children: /* @__PURE__ */ m(Tt, { route: t, onError: d, children: /* @__PURE__ */ m(qt, { fallback: b ?? /* @__PURE__ */ m("div", { className: "pmn-lazy-loading", role: "status", "aria-live": "polite", children: "加载中..." }), children: /* @__PURE__ */ m(fn, { screen: n, route: t, navigation: r, includePersistent: !1 }) }) }) }) }) }) }) }) });
|
|
636
|
+
}), pr = Oe.memo(function({ routes: t, screens: n, navigation: r, currentKey: o, resultEvents: s, bodyClassName: i, setFooter: u, loadingApi: a, loadingStore: c, notifyError: d, registerDirtyGuard: g, pageMotion: x, lazyFallback: b }) {
|
|
637
|
+
const h = (l) => l.map((y) => {
|
|
638
|
+
if (y.route) {
|
|
639
|
+
const S = y.route;
|
|
640
|
+
return /* @__PURE__ */ m(
|
|
641
|
+
fr,
|
|
642
|
+
{
|
|
643
|
+
route: S,
|
|
644
|
+
screen: n[S.name],
|
|
645
|
+
navigation: r,
|
|
646
|
+
focused: S.key === o,
|
|
647
|
+
resultEvent: s[S.key] ?? null,
|
|
648
|
+
bodyClassName: i,
|
|
649
|
+
setFooter: u,
|
|
650
|
+
loadingApi: a,
|
|
651
|
+
loadingStore: c,
|
|
652
|
+
notifyError: d,
|
|
653
|
+
registerDirtyGuard: g,
|
|
654
|
+
pageMotion: S.key === o && !n[S.name].persistentLayouts?.length ? x : null,
|
|
655
|
+
lazyFallback: b
|
|
656
|
+
},
|
|
657
|
+
S.key
|
|
658
|
+
);
|
|
659
|
+
}
|
|
660
|
+
const C = y.routes.some((S) => S.key === o), L = C ? t.at(-1) : y.routes.at(-1);
|
|
661
|
+
return /* @__PURE__ */ m("div", { hidden: !C, inert: !C, className: "pmn-persistent-layout", children: /* @__PURE__ */ m(Je.Provider, { value: L, children: /* @__PURE__ */ m(Tt, { route: L, onError: d, children: /* @__PURE__ */ m(Ft, { screen: n[L.name], route: L, children: /* @__PURE__ */ m(qt, { fallback: b ?? /* @__PURE__ */ m("div", { className: "pmn-lazy-loading", role: "status", children: "加载中..." }), children: /* @__PURE__ */ m(mn, { shared: !0, layout: y.layout.component, route: L, navigation: r, children: h(y.children) }) }) }) }) }) }, `layout:${y.layout.path}`);
|
|
662
|
+
});
|
|
663
|
+
return h(t.some((l) => n[l.name].persistentLayouts?.length) ? Bn(t, n) : t.map((l) => ({ route: l })));
|
|
664
|
+
}, (e, t) => {
|
|
665
|
+
const { routes: n, ...r } = e, { routes: o, ...s } = t;
|
|
666
|
+
return n.length === o.length && n.every((i, u) => i === o[u]) && Ye(r, s);
|
|
498
667
|
});
|
|
499
|
-
function
|
|
500
|
-
const
|
|
501
|
-
|
|
502
|
-
|
|
668
|
+
function hr({ runtime: e, config: t, initialScreen: n, params: r, translate: o, onRequestClose: s, onOpened: i, registerLoading: u, notifyError: a, error: c, clearError: d, registerDirtyGuard: g, getProtectedCacheKeys: x, getDirtyRevision: b, canNavigate: h, exiting: l = !1 }) {
|
|
669
|
+
const y = Fe(e.stores.layout, Yn, Ye), [C, L] = Nn(kt, e.stores.navigation.getSnapshot().stack), { navigation: S, loading: j, footer: D, toast: R } = e.refs, k = e.alive, O = G(0), { toast: A, dismissToast: N } = xn(R, k, e);
|
|
670
|
+
ee(() => () => {
|
|
671
|
+
O.current++;
|
|
672
|
+
}, []);
|
|
673
|
+
const [W, Q] = Pe({});
|
|
674
|
+
Ee(e.routeGroups.subscribeGuards, e.routeGroups.getGuardRevision, e.routeGroups.getGuardRevision);
|
|
675
|
+
const [ne, re] = Pe(() => /* @__PURE__ */ new Set()), I = G(/* @__PURE__ */ new Map()), _ = G(null), le = G(null), E = G(null), z = G(null), K = G(null), P = G(!1), F = G(!1), Z = e.pageRequests, de = G(0), te = X((p, T, q) => {
|
|
676
|
+
for (const [oe, ge] of Z.current)
|
|
677
|
+
p.includes(ge.key) && (Z.current.delete(oe), ge.resolve({ status: T, ...T === "returned" ? { value: q } : {} }));
|
|
678
|
+
}, []), v = G(C), H = G(null), ke = G(null);
|
|
679
|
+
Se(() => () => {
|
|
680
|
+
H.current?.(), H.current = null, ke.current?.release(), ke.current = null;
|
|
503
681
|
}, []);
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
const j = E.current.getSnapshot();
|
|
520
|
-
if (M === null) {
|
|
521
|
-
if (!(m in j)) return;
|
|
522
|
-
const Y = { ...j };
|
|
523
|
-
delete Y[m], E.current.publish(Y);
|
|
682
|
+
const xe = G(h);
|
|
683
|
+
xe.current = h;
|
|
684
|
+
const Ae = G(!1), Qe = G(0), ye = C.at(-1), ve = ye.key, ct = G({ key: ve, depth: C.length }), ht = ct.current, et = ht.key !== ve, gt = C.length < ht.depth ? "back" : "forward";
|
|
685
|
+
et && (ct.current = { key: ve, depth: C.length });
|
|
686
|
+
const lt = Math.min(1e3, Math.max(0, Number(y.pageAnimationDuration ?? 360) || 0)), yt = Math.min(300, Math.max(0, Number(y.pageAnimationDistance ?? 96) || 0)), Ke = V(() => ({ distance: yt, enabled: y.pageAnimation !== !1 && y.animation !== !1 && lt > 0 && et, direction: gt, duration: lt }), [yt, y.pageAnimation, y.animation, lt, et, gt]), vt = G(ve);
|
|
687
|
+
vt.current = ve;
|
|
688
|
+
const { loadingApi: ut, refreshLoading: tt, loadingTasks: bt, setLoading: Ze } = Sn(j, k, vt, e), Le = t.screens, De = j, nt = G(u);
|
|
689
|
+
nt.current = u, ee(() => (nt.current?.({ setLoading: Ze }), () => nt.current?.(null)), [Ze]);
|
|
690
|
+
const Yt = X((p, T) => {
|
|
691
|
+
if (!k.current) return;
|
|
692
|
+
const q = D.current.getSnapshot();
|
|
693
|
+
if (T === null) {
|
|
694
|
+
if (!(p in q)) return;
|
|
695
|
+
const oe = { ...q };
|
|
696
|
+
delete oe[p], D.current.publish(oe);
|
|
524
697
|
return;
|
|
525
698
|
}
|
|
526
|
-
|
|
527
|
-
}, []),
|
|
699
|
+
q[p] !== T && D.current.publish({ ...q, [p]: T });
|
|
700
|
+
}, []), At = X(() => {
|
|
528
701
|
if (typeof document > "u") return;
|
|
529
|
-
const
|
|
530
|
-
if (!(
|
|
531
|
-
const
|
|
532
|
-
|
|
533
|
-
}, []),
|
|
534
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
535
|
-
}, [
|
|
702
|
+
const p = document.activeElement;
|
|
703
|
+
if (!(p instanceof HTMLElement) || !_.current?.contains(p)) return;
|
|
704
|
+
const T = p.closest("[data-modal-route-key]");
|
|
705
|
+
T && I.current.set(T.dataset.modalRouteKey, p), _.current.focus({ preventScroll: !0 });
|
|
706
|
+
}, []), jt = X((p) => {
|
|
707
|
+
if (!Object.prototype.hasOwnProperty.call(Le, p)) throw new Error(`[react-modal-navigation] Unknown modal screen: ${p}`);
|
|
708
|
+
}, [Le]), f = X((p, T) => {
|
|
536
709
|
try {
|
|
537
|
-
Promise.resolve(
|
|
538
|
-
} catch (
|
|
539
|
-
|
|
710
|
+
Promise.resolve(y[p]?.(T)).catch((q) => a(q, { phase: p }));
|
|
711
|
+
} catch (q) {
|
|
712
|
+
a(q, { phase: p });
|
|
540
713
|
}
|
|
541
|
-
}, [
|
|
542
|
-
if (!
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
545
|
-
const
|
|
546
|
-
|
|
714
|
+
}, [y, a]), w = X(async (p, T, q, oe, ge) => {
|
|
715
|
+
if (!k.current || F.current || e.routeGroups.isChecking()) return !1;
|
|
716
|
+
const me = O.current, se = v.current, qe = se.at(-1);
|
|
717
|
+
if (p !== "BACK" && p !== "POP" && (T = Ct(T, t.routeAliases, qe.name), jt(T)), p === "POP" && (!Number.isInteger(q) || q < 1 || se.length <= 1) || p === "BACK" && se.length <= 1) return !1;
|
|
718
|
+
const wt = p === "NAVIGATE" ? se.findIndex((ot) => ot.name === T) : -1, Be = p === "POP" ? se.slice(Math.max(1, se.length - q)) : p === "RESET" ? se : p === "BACK" || p === "REPLACE" ? [qe] : wt >= 0 ? se.slice(wt + 1) : [], Ne = e.beginTransaction();
|
|
719
|
+
if (!Ne) return !1;
|
|
720
|
+
F.current = !0;
|
|
547
721
|
try {
|
|
548
|
-
|
|
722
|
+
const ot = p === "POP" ? se[Math.max(0, se.length - q - 1)]?.name : p === "BACK" ? se.at(-2)?.name : T, En = new Set(Be.map((he) => he.key)), Pn = se.filter((he) => !En.has(he.key)), On = b?.(), Ln = e.routeGroups.getGuardRevision(), Tn = e.getRemovalRevision();
|
|
723
|
+
if (!await e.routeGroups.canLeave(qe, { name: ot }, { reason: "navigation", action: p, from: qe, to: ot }, !1, Be, Pn) || Be.length && xe.current && !await xe.current(Be.map((Ge) => Ge.key), {
|
|
549
724
|
reason: "navigation",
|
|
550
|
-
action:
|
|
551
|
-
from:
|
|
552
|
-
to:
|
|
553
|
-
}) ||
|
|
554
|
-
if (
|
|
555
|
-
const
|
|
556
|
-
|
|
725
|
+
action: p,
|
|
726
|
+
from: qe,
|
|
727
|
+
to: p === "POP" ? se[Math.max(0, se.length - q - 1)]?.name : p === "BACK" ? se.at(-2)?.name : T
|
|
728
|
+
}) || Be.length && !await e.canRemove(Be.map((he) => he.key), { reason: "navigation", action: p, from: qe, to: T }) || On !== b?.() || Ln !== e.routeGroups.getGuardRevision() || Tn !== e.getRemovalRevision() || !k.current || me !== O.current || v.current.at(-1)?.key !== qe.key) return !1;
|
|
729
|
+
if (p === "BACK" && oe !== void 0) {
|
|
730
|
+
const he = se.at(-2);
|
|
731
|
+
Q((Ge) => ({ ...Ge, [he.key]: { id: ++Qe.current, data: oe } }));
|
|
557
732
|
}
|
|
558
|
-
if (
|
|
559
|
-
const
|
|
560
|
-
|
|
733
|
+
if (Be.length) {
|
|
734
|
+
const he = new Set(Be.map((Ge) => Ge.key));
|
|
735
|
+
he.forEach((Ge) => I.current.delete(Ge)), Q((Ge) => Object.fromEntries(Object.entries(Ge).filter(([dt]) => !he.has(dt))));
|
|
561
736
|
}
|
|
562
|
-
e.tasks.cancelRoutes(
|
|
563
|
-
const
|
|
564
|
-
|
|
565
|
-
const
|
|
566
|
-
|
|
567
|
-
const
|
|
568
|
-
return
|
|
569
|
-
const
|
|
570
|
-
return
|
|
571
|
-
}),
|
|
572
|
-
} catch (
|
|
573
|
-
return
|
|
737
|
+
e.tasks.cancelRoutes(Be.map((he) => he.key)), te(Be.map((he) => he.key), p === "BACK" ? "returned" : "removed", oe);
|
|
738
|
+
const An = [...le.current?.querySelectorAll("[data-modal-route-key]") ?? []].find((he) => he.dataset.modalRouteKey === qe.key);
|
|
739
|
+
E.current = Le[qe.name].persistentLayouts?.length ? null : An?.cloneNode(!0) ?? null, At();
|
|
740
|
+
const jn = { type: p, name: T, params: q, count: q };
|
|
741
|
+
v.current = kt(v.current, jn);
|
|
742
|
+
const Nt = v.current;
|
|
743
|
+
return re((he) => {
|
|
744
|
+
const Ge = new Set(Nt.slice(0, -1).filter((dt) => he.has(dt.key)).map((dt) => dt.key));
|
|
745
|
+
return Ge.size === he.size ? he : Ge;
|
|
746
|
+
}), ge?.(Nt.at(-1)), H.current = Ne, Qt(() => L({ type: "COMMIT", stack: Nt })), !0;
|
|
747
|
+
} catch (ot) {
|
|
748
|
+
return H.current === Ne && (H.current = null), k.current && a(ot, { phase: "navigationGuard", action: p }), !1;
|
|
574
749
|
} finally {
|
|
575
|
-
|
|
750
|
+
F.current = !1, H.current !== Ne && Ne();
|
|
576
751
|
}
|
|
577
|
-
}, [
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
752
|
+
}, [jt, b, t.routeAliases, At, a, te]), B = X((p, T) => w("NAVIGATE", p, T), [w]), M = X((p, T) => w("PUSH", p, T), [w]), J = X((p = 1) => w("POP", null, p), [w]), U = X(() => J(v.current.length - 1), [J]), fe = X((p) => {
|
|
753
|
+
p = Ct(p, t.routeAliases, v.current.at(-1)?.name);
|
|
754
|
+
const T = v.current.findLastIndex((q) => q.name === p);
|
|
755
|
+
return T < 0 ? Promise.resolve(!1) : J(v.current.length - T - 1);
|
|
756
|
+
}, [J, t.routeAliases]), ae = X(async (p, T) => {
|
|
757
|
+
if (!k.current) return { status: "cancelled" };
|
|
758
|
+
let q;
|
|
759
|
+
return await w("NAVIGATE", p, T, void 0, (ge) => {
|
|
760
|
+
q = new Promise((me) => {
|
|
761
|
+
const se = ++de.current;
|
|
762
|
+
Z.current.set(se, { key: ge.key, resolve: me });
|
|
587
763
|
});
|
|
588
|
-
}) &&
|
|
589
|
-
}, [
|
|
590
|
-
if (!
|
|
591
|
-
if (!
|
|
592
|
-
const
|
|
593
|
-
|
|
594
|
-
}, []),
|
|
595
|
-
if (!
|
|
596
|
-
if (!
|
|
597
|
-
const
|
|
598
|
-
|
|
599
|
-
}, []),
|
|
600
|
-
|
|
601
|
-
const
|
|
602
|
-
if (!
|
|
603
|
-
const
|
|
604
|
-
if (!
|
|
605
|
-
|
|
764
|
+
}) && q ? q : { status: "cancelled" };
|
|
765
|
+
}, [w]), ie = X((p, T) => w("REPLACE", p, T), [w]), Re = X((p, T) => w("RESET", p, T), [w]), je = X((p) => {
|
|
766
|
+
if (!p || typeof p != "object" || Array.isArray(p)) throw new TypeError("[react-modal-navigation] setParams expects an object");
|
|
767
|
+
if (!k.current) return;
|
|
768
|
+
const T = { type: "SET_PARAMS", params: p };
|
|
769
|
+
v.current = kt(v.current, T), L({ type: "COMMIT", stack: v.current });
|
|
770
|
+
}, []), $ = X((p) => {
|
|
771
|
+
if (!p || typeof p != "object" || Array.isArray(p)) throw new TypeError("[react-modal-navigation] setOptions expects an object");
|
|
772
|
+
if (!k.current) return;
|
|
773
|
+
const T = { type: "SET_OPTIONS", options: p };
|
|
774
|
+
v.current = kt(v.current, T), L({ type: "COMMIT", stack: v.current });
|
|
775
|
+
}, []), ue = X((p) => w("BACK", null, void 0, p), [w]), pe = X((p, T) => !k.current || De.current.getSnapshot().visible && y.lockCloseWhileLoading !== !1 ? Promise.resolve(!1) : s(p, T, { route: ye, stack: C }), [y.lockCloseWhileLoading, s, ye, C]), ze = G(pe);
|
|
776
|
+
ze.current = pe;
|
|
777
|
+
const ce = X((p) => ze.current("api", p), []), rt = X(async (p) => {
|
|
778
|
+
if (!k.current || F.current || e.routeGroups.isChecking()) return !1;
|
|
779
|
+
const T = v.current, q = Xt(T, Le, y.maxCachedScreens, ne, e.routeGroups.getProtectedCacheKeys(T, x?.())), oe = q.slice(0, -1).filter((me) => p === void 0 || me.name === p).map((me) => me.key);
|
|
780
|
+
if (!oe.length) return !1;
|
|
781
|
+
const ge = e.beginTransaction();
|
|
782
|
+
if (!ge) return !1;
|
|
783
|
+
F.current = !0;
|
|
606
784
|
try {
|
|
607
|
-
const
|
|
608
|
-
return
|
|
609
|
-
} catch (
|
|
610
|
-
return
|
|
785
|
+
const me = { reason: "cache", action: "CLEAR_CACHE", from: T.at(-1) }, se = new Set(oe), qe = b?.(), wt = e.routeGroups.getGuardRevision(), Be = e.getRemovalRevision();
|
|
786
|
+
return !await e.routeGroups.canLeave(null, T.at(-1), me, !1, q.filter((Ne) => se.has(Ne.key)), q.filter((Ne) => !se.has(Ne.key))) || xe.current && !await xe.current(oe, me) || !await e.canRemove(oe, me) || qe !== b?.() || wt !== e.routeGroups.getGuardRevision() || Be !== e.getRemovalRevision() || !k.current || v.current !== T ? !1 : (e.tasks.cancelRoutes(oe), oe.forEach((Ne) => I.current.delete(Ne)), ke.current = { keys: oe, release: ge }, Qt(() => re((Ne) => /* @__PURE__ */ new Set([...Ne, ...oe]))), !0);
|
|
787
|
+
} catch (me) {
|
|
788
|
+
return ke.current?.release === ge && (ke.current = null), k.current && a(me, { phase: "clearCache" }), !1;
|
|
611
789
|
} finally {
|
|
612
|
-
|
|
790
|
+
F.current = !1, ke.current?.release !== ge && ge();
|
|
613
791
|
}
|
|
614
|
-
}, [e,
|
|
615
|
-
|
|
616
|
-
const
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
792
|
+
}, [e, a, Le, y.maxCachedScreens, ne, x, b]), _e = V(() => ({ navigate: B, navigateAsync: ae, push: M, pop: J, popTo: fe, popToTop: U, replace: ie, reset: Re, setParams: je, setOptions: $, goBack: ue, close: ce, setLoading: Ze, clearCache: rt }), [B, ae, M, J, fe, U, ie, Re, je, $, ue, ce, Ze, rt]);
|
|
793
|
+
Se(() => e.registerNavigation(_e), [e, _e]);
|
|
794
|
+
const Te = V(() => ({ canGoBack: C.length > 1, stack: C, currentRoute: ye }), [C]);
|
|
795
|
+
Se(() => {
|
|
796
|
+
if (S.current.publish(Te), C.length !== v.current.length || C.some((T, q) => T.key !== v.current[q].key)) return;
|
|
797
|
+
const p = H.current;
|
|
798
|
+
H.current = null, p?.();
|
|
799
|
+
}, [Te, C]);
|
|
800
|
+
const be = G(null);
|
|
801
|
+
be.current || (be.current = Object.defineProperties({}, {
|
|
802
|
+
canGoBack: { enumerable: !0, get: () => S.current.getSnapshot().canGoBack },
|
|
803
|
+
stack: { enumerable: !0, get: () => S.current.getSnapshot().stack },
|
|
804
|
+
currentRoute: { enumerable: !0, get: () => S.current.getSnapshot().currentRoute }
|
|
623
805
|
}));
|
|
624
|
-
const
|
|
625
|
-
|
|
626
|
-
const
|
|
627
|
-
if (
|
|
628
|
-
const
|
|
629
|
-
|
|
630
|
-
const
|
|
631
|
-
|
|
632
|
-
const
|
|
633
|
-
|
|
806
|
+
const Ce = V(() => Object.assign(be.current, _e), [_e]);
|
|
807
|
+
Se(() => {
|
|
808
|
+
const p = E.current;
|
|
809
|
+
if (E.current = null, z.current?.cancel?.(), z.current = null, le.current?.querySelectorAll("[data-pmn-outgoing]").forEach((se) => se.remove()), Le[ye.name].persistentLayouts?.length || !et || !Ke.enabled || !p || !le.current || typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) return;
|
|
810
|
+
const T = le.current;
|
|
811
|
+
p.removeAttribute("hidden"), p.removeAttribute("tabindex"), p.setAttribute("aria-hidden", "true"), p.setAttribute("inert", ""), p.dataset.pmnOutgoing = "true", p.querySelectorAll("[id]").forEach((se) => se.removeAttribute("id")), p.querySelectorAll("[autofocus]").forEach((se) => se.removeAttribute("autofocus")), p.style.cssText += ";position:absolute;inset:0;width:100%;height:100%;z-index:1;pointer-events:none;overflow:hidden;background:var(--pmn-body);", T.appendChild(p);
|
|
812
|
+
const q = Ke.direction === "back" ? 1 : -1, oe = [...T.querySelectorAll("[data-modal-route-key]")].find((se) => se.dataset.modalRouteKey === ve);
|
|
813
|
+
oe && (oe.style.zIndex = "2");
|
|
814
|
+
const ge = () => {
|
|
815
|
+
p.remove(), oe && (oe.style.zIndex = ""), z.current === me && (z.current = null);
|
|
634
816
|
};
|
|
635
|
-
let
|
|
636
|
-
if (
|
|
637
|
-
|
|
817
|
+
let me;
|
|
818
|
+
if (p.animate)
|
|
819
|
+
me = p.animate([
|
|
638
820
|
{ opacity: 1, transform: "translate3d(0,0,0)" },
|
|
639
|
-
{ opacity: 1, transform: `translate3d(${
|
|
640
|
-
], { duration:
|
|
821
|
+
{ opacity: 1, transform: `translate3d(${q * 100}%,0,0)` }
|
|
822
|
+
], { duration: Ke.duration, easing: "cubic-bezier(.22,1,.36,1)", fill: "forwards" }), me.addEventListener("finish", ge, { once: !0 }), me.addEventListener("cancel", ge, { once: !0 }), z.current = me;
|
|
641
823
|
else {
|
|
642
|
-
|
|
643
|
-
const se = setTimeout(
|
|
644
|
-
|
|
645
|
-
clearTimeout(se),
|
|
646
|
-
} },
|
|
824
|
+
p.classList.add("pmn-page-exit", `pmn-page-exit-${Ke.direction}`), p.style.setProperty("--pmn-page-duration", `${Ke.duration}ms`), p.style.setProperty("--pmn-page-distance", "100%");
|
|
825
|
+
const se = setTimeout(ge, Ke.duration + 40);
|
|
826
|
+
me = { cancel: () => {
|
|
827
|
+
clearTimeout(se), ge();
|
|
828
|
+
} }, z.current = me;
|
|
647
829
|
}
|
|
648
830
|
return () => {
|
|
649
|
-
|
|
831
|
+
me?.cancel?.(), p.remove();
|
|
650
832
|
};
|
|
651
|
-
}, [
|
|
652
|
-
|
|
653
|
-
const
|
|
654
|
-
if (!
|
|
655
|
-
const
|
|
656
|
-
(
|
|
657
|
-
}, [
|
|
658
|
-
let
|
|
659
|
-
for (const [
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
const
|
|
663
|
-
|
|
664
|
-
const
|
|
665
|
-
if (!
|
|
666
|
-
const
|
|
667
|
-
return
|
|
833
|
+
}, [ve]), Se(() => {
|
|
834
|
+
P.current = !1;
|
|
835
|
+
const p = [..._.current?.querySelectorAll("[data-modal-route-key]") ?? []].find((oe) => oe.dataset.modalRouteKey === ve);
|
|
836
|
+
if (!p) return;
|
|
837
|
+
const T = I.current.get(ve);
|
|
838
|
+
(T?.isConnected && p.contains(T) && !T.matches(":disabled") && !T.closest("[inert], [hidden]") ? T : p).focus({ preventScroll: !0 });
|
|
839
|
+
}, [ve]), ee(() => {
|
|
840
|
+
let p = !1;
|
|
841
|
+
for (const [q, oe] of bt.current)
|
|
842
|
+
oe.owner !== "global" && oe.owner !== ve && (bt.current.delete(q), p = !0);
|
|
843
|
+
p && tt();
|
|
844
|
+
const T = new Set(C.map((q) => q.key));
|
|
845
|
+
Q((q) => {
|
|
846
|
+
const oe = Object.keys(q).filter((me) => !T.has(me));
|
|
847
|
+
if (!oe.length) return q;
|
|
848
|
+
const ge = { ...q };
|
|
849
|
+
return oe.forEach((me) => delete ge[me]), ge;
|
|
668
850
|
});
|
|
669
|
-
for (const
|
|
670
|
-
}, [
|
|
671
|
-
if (
|
|
672
|
-
if (
|
|
673
|
-
const
|
|
674
|
-
|
|
851
|
+
for (const q of I.current.keys()) T.has(q) || I.current.delete(q);
|
|
852
|
+
}, [ve, C, tt]), ee(() => {
|
|
853
|
+
if (K.current?.key !== ve) {
|
|
854
|
+
if (K.current) {
|
|
855
|
+
const p = { from: K.current, to: ye, stack: C };
|
|
856
|
+
f("onBlur", { route: K.current, ...p }), f("onNavigate", p), f("onRouteChange", p);
|
|
675
857
|
}
|
|
676
|
-
|
|
858
|
+
f("onFocus", { route: ye, stack: C }), K.current = ye;
|
|
677
859
|
}
|
|
678
|
-
}, [
|
|
679
|
-
|
|
680
|
-
for (const
|
|
681
|
-
|
|
682
|
-
}, []),
|
|
683
|
-
|
|
860
|
+
}, [ye, ve, C, f]), ee(() => () => {
|
|
861
|
+
bt.current.clear(), I.current.clear();
|
|
862
|
+
for (const p of Z.current.values()) p.resolve({ status: "dismissed" });
|
|
863
|
+
Z.current.clear();
|
|
864
|
+
}, []), ee(() => {
|
|
865
|
+
Ae.current || (Ae.current = !0, i?.({ route: ye, stack: C }));
|
|
684
866
|
}, []);
|
|
685
|
-
const
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
867
|
+
const Ue = Xt(C, Le, y.maxCachedScreens, ne, e.routeGroups.getProtectedCacheKeys(C, x?.()));
|
|
868
|
+
Se(() => {
|
|
869
|
+
const p = new Set(Ue.map((q) => q.key)), T = ke.current;
|
|
870
|
+
T && T.keys.every((q) => !p.has(q)) && (ke.current = null, T.release());
|
|
871
|
+
for (const q of I.current.keys())
|
|
872
|
+
p.has(q) || I.current.delete(q);
|
|
873
|
+
}, [Ue]), Se(() => {
|
|
874
|
+
re((p) => $n(C, Ue, p));
|
|
875
|
+
}, [C, Ue]);
|
|
876
|
+
const He = V(() => ({ ...Le[ye.name], ...ye.options ?? {} }), [Le, ye.name, ye.options]), zt = e.refs.header;
|
|
877
|
+
return /* @__PURE__ */ m(Lt.Provider, { value: zt.current, children: /* @__PURE__ */ m($t.Provider, { value: A, children: /* @__PURE__ */ m(ln.Provider, { value: R.current, children: /* @__PURE__ */ m(cn.Provider, { value: D.current, children: /* @__PURE__ */ m(an.Provider, { value: Ce, children: /* @__PURE__ */ m(Et.Provider, { value: _e, children: /* @__PURE__ */ m(Pt.Provider, { value: S.current, children: /* @__PURE__ */ m(st.Provider, { value: ut, children: /* @__PURE__ */ Me(yn, { store: e.stores.layout, screenOptions: He.modalOptions, dialogRef: _, requestClose: pe, exiting: l, children: [
|
|
878
|
+
/* @__PURE__ */ m(vn, { store: e.stores.layout, screen: He, route: ye, navigation: Ce, requestClose: pe, translate: o, canGoBack: C.length > 1 }),
|
|
879
|
+
/* @__PURE__ */ m("main", { ref: le, className: "pmn-main", children: /* @__PURE__ */ m(
|
|
880
|
+
pr,
|
|
694
881
|
{
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
navigation:
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
bodyClassName:
|
|
701
|
-
setFooter:
|
|
702
|
-
loadingApi:
|
|
703
|
-
loadingStore:
|
|
704
|
-
notifyError:
|
|
882
|
+
routes: Ue,
|
|
883
|
+
screens: Le,
|
|
884
|
+
navigation: Ce,
|
|
885
|
+
currentKey: ve,
|
|
886
|
+
resultEvents: W,
|
|
887
|
+
bodyClassName: y.bodyClassName,
|
|
888
|
+
setFooter: Yt,
|
|
889
|
+
loadingApi: ut,
|
|
890
|
+
loadingStore: j.current,
|
|
891
|
+
notifyError: a,
|
|
705
892
|
registerDirtyGuard: g,
|
|
706
|
-
pageMotion:
|
|
707
|
-
lazyFallback:
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
Dn,
|
|
893
|
+
pageMotion: Ke,
|
|
894
|
+
lazyFallback: y.lazyFallback
|
|
895
|
+
}
|
|
896
|
+
) }),
|
|
897
|
+
/* @__PURE__ */ m(
|
|
898
|
+
mr,
|
|
713
899
|
{
|
|
714
|
-
store:
|
|
715
|
-
routeKey:
|
|
716
|
-
screen:
|
|
900
|
+
store: D.current,
|
|
901
|
+
routeKey: ve,
|
|
902
|
+
screen: He,
|
|
717
903
|
layoutStore: e.stores.layout,
|
|
718
|
-
route:
|
|
719
|
-
navigation:
|
|
720
|
-
requestClose:
|
|
904
|
+
route: ye,
|
|
905
|
+
navigation: Ce,
|
|
906
|
+
requestClose: pe,
|
|
721
907
|
translate: o,
|
|
722
|
-
onError:
|
|
723
|
-
loadingApi:
|
|
908
|
+
onError: a,
|
|
909
|
+
loadingApi: ut
|
|
724
910
|
},
|
|
725
|
-
|
|
911
|
+
ve
|
|
726
912
|
),
|
|
727
|
-
/* @__PURE__ */
|
|
728
|
-
/* @__PURE__ */
|
|
729
|
-
|
|
730
|
-
/* @__PURE__ */
|
|
731
|
-
/* @__PURE__ */
|
|
913
|
+
/* @__PURE__ */ m(ur, { store: j.current, translate: o }),
|
|
914
|
+
/* @__PURE__ */ m(dr, { store: R.current, dismiss: N }),
|
|
915
|
+
c && /* @__PURE__ */ Me("div", { className: "pmn-error", role: "alert", children: [
|
|
916
|
+
/* @__PURE__ */ m("span", { children: c.message || String(c) }),
|
|
917
|
+
/* @__PURE__ */ m("button", { type: "button", onClick: d, "aria-label": "Dismiss error", children: "×" })
|
|
732
918
|
] })
|
|
733
919
|
] }) }) }) }) }) }) }) }) });
|
|
734
920
|
}
|
|
735
|
-
const
|
|
736
|
-
function
|
|
737
|
-
if (!
|
|
921
|
+
const ao = (e) => e, io = (e) => ({ definitionLoader: e }), xt = /* @__PURE__ */ new WeakMap();
|
|
922
|
+
function Mt(e) {
|
|
923
|
+
if (!xt.has(e)) {
|
|
738
924
|
const t = Promise.resolve().then(e).catch((n) => {
|
|
739
|
-
throw
|
|
925
|
+
throw xt.delete(e), n;
|
|
740
926
|
});
|
|
741
|
-
|
|
927
|
+
xt.set(e, t);
|
|
742
928
|
}
|
|
743
|
-
return
|
|
929
|
+
return xt.get(e);
|
|
744
930
|
}
|
|
745
|
-
async function
|
|
931
|
+
async function Rn(e, t) {
|
|
746
932
|
let n = typeof e == "string" ? t && Object.hasOwn(t, e) ? t[e] : void 0 : e;
|
|
747
933
|
if (n?.definitionLoader) {
|
|
748
|
-
const r = await
|
|
934
|
+
const r = await Mt(n.definitionLoader);
|
|
749
935
|
n = r.default ?? r;
|
|
750
936
|
}
|
|
751
937
|
if (!n || !(n.component || n.loader || n.screens)) throw new Error(`[react-modal-navigation] Unknown or invalid modal: ${typeof e == "string" ? e : "inline"}`);
|
|
752
938
|
return n;
|
|
753
939
|
}
|
|
754
|
-
async function
|
|
755
|
-
const r = await
|
|
756
|
-
|
|
757
|
-
|
|
940
|
+
async function gr(e, t, n) {
|
|
941
|
+
const r = await Rn(e, t), o = r.screens ? on(r.screens) : null, s = o?.screens, u = (Array.isArray(n) ? n : [n ?? r.initialRoute ?? Object.keys(s ?? {})[0]]).map((a) => {
|
|
942
|
+
const c = Ct(a, o?.aliases);
|
|
943
|
+
return s ? Object.hasOwn(s, c) ? s[c] : null : r;
|
|
944
|
+
});
|
|
945
|
+
if (u.some((a) => !a)) throw new Error("[react-modal-navigation] Unknown preload screen");
|
|
946
|
+
return await Promise.all(u.map((a) => a.loader ? Mt(a.loader) : void 0)), r;
|
|
758
947
|
}
|
|
759
|
-
function
|
|
948
|
+
function yr(e) {
|
|
760
949
|
return function(n) {
|
|
761
|
-
const [r, o] =
|
|
762
|
-
return /* @__PURE__ */
|
|
950
|
+
const [r, o] = Pe(() => Oe.lazy(() => Mt(e)));
|
|
951
|
+
return /* @__PURE__ */ m(Tt, { route: n.route, onRetry: () => o(() => Oe.lazy(() => Mt(e))), children: /* @__PURE__ */ m(r, { ...n }) });
|
|
763
952
|
};
|
|
764
953
|
}
|
|
765
|
-
function
|
|
766
|
-
|
|
767
|
-
let
|
|
768
|
-
const
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
const
|
|
773
|
-
|
|
954
|
+
async function Ie(e, t, n) {
|
|
955
|
+
if (n.aborted) return !1;
|
|
956
|
+
let r;
|
|
957
|
+
const o = new Promise((s) => {
|
|
958
|
+
r = () => s(!1), n.addEventListener("abort", r, { once: !0 });
|
|
959
|
+
});
|
|
960
|
+
try {
|
|
961
|
+
const s = new Promise((u) => u(e(t))), i = await Promise.race([s, o]);
|
|
962
|
+
return !n.aborted && i !== !1;
|
|
963
|
+
} finally {
|
|
964
|
+
n.removeEventListener("abort", r);
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
function vr(e, { limit: t = 100 } = {}) {
|
|
968
|
+
const n = Number.isFinite(t) ? Math.max(1, Math.min(1e3, Math.floor(t))) : 100, r = $e({ active: null, queueSize: 0, events: [] });
|
|
969
|
+
let o, s = 0, i = !1, u = [];
|
|
970
|
+
const a = (g, x) => {
|
|
971
|
+
if (i) return;
|
|
972
|
+
const b = r.getSnapshot(), h = e.hostStore.getSnapshot().active, l = h?.runtime.alive.current ? h : null, y = l?.runtime.stores.navigation.getSnapshot(), C = l?.runtime.stores.loading.getSnapshot();
|
|
973
|
+
let L = l ? { id: l.id, name: l.name, routes: y.stack.map(({ key: R, name: k }) => ({ key: R, name: k })), focusedKey: y.currentRoute?.key, loadingCount: C.count, taskCount: l.runtime.tasks.count() } : null;
|
|
974
|
+
const S = g ? [...b.events, { sequence: ++s, time: Date.now(), type: g, id: x }].slice(-n) : b.events, j = b.active;
|
|
975
|
+
L && j && L.id === j.id && L.name === j.name && L.focusedKey === j.focusedKey && L.loadingCount === j.loadingCount && L.taskCount === j.taskCount && L.routes.length === j.routes.length && L.routes.every((R, k) => R.key === j.routes[k].key && R.name === j.routes[k].name) && (L = j);
|
|
774
976
|
const D = e.statusStore.getSnapshot().queueSize;
|
|
775
|
-
|
|
776
|
-
},
|
|
977
|
+
L === j && D === b.queueSize && S === b.events || r.publish({ active: L, queueSize: D, events: S });
|
|
978
|
+
}, c = () => {
|
|
777
979
|
const g = e.hostStore.getSnapshot().active?.runtime;
|
|
778
|
-
g !== o && (
|
|
779
|
-
}, d = [e.hostStore.subscribe(
|
|
780
|
-
return
|
|
980
|
+
g !== o && (u.forEach((x) => x()), o = g, u = g ? ["ready", "destroy", "change", "routeChange", "routeRemove", "routeBlur", "routeFocus"].map((x) => g.events.on(x, (b) => a(x === "change" ? `store.${b.store}` : `instance.${x}`, b.id))) : []), a();
|
|
981
|
+
}, d = [e.hostStore.subscribe(c), e.statusStore.subscribe(() => a()), ...["open", "close", "queueChange"].map((g) => e.commands.on(g, (x) => a(`manager.${g}`, x.id)))];
|
|
982
|
+
return c(), {
|
|
781
983
|
getSnapshot: r.getSnapshot,
|
|
782
984
|
subscribe: r.subscribe,
|
|
783
|
-
refresh: () =>
|
|
985
|
+
refresh: () => a(),
|
|
784
986
|
clear() {
|
|
785
|
-
!
|
|
987
|
+
!i && r.getSnapshot().events.length && r.publish({ ...r.getSnapshot(), events: [] });
|
|
786
988
|
},
|
|
787
989
|
dispose() {
|
|
788
|
-
|
|
990
|
+
i || (i = !0, d.forEach((g) => g()), u.forEach((g) => g()), u = [], o = null, r.publish({ active: null, queueSize: 0, events: [] }), r.destroy());
|
|
789
991
|
}
|
|
790
992
|
};
|
|
791
993
|
}
|
|
792
|
-
function
|
|
994
|
+
function Cn() {
|
|
793
995
|
const e = /* @__PURE__ */ new Map();
|
|
794
996
|
let t = !1;
|
|
795
997
|
const n = (r, o) => {
|
|
796
|
-
const
|
|
797
|
-
|
|
998
|
+
const s = e.get(r);
|
|
999
|
+
s?.delete(o), s?.size || e.delete(r);
|
|
798
1000
|
};
|
|
799
1001
|
return {
|
|
800
1002
|
on(r, o) {
|
|
801
1003
|
if (t) return () => {
|
|
802
1004
|
};
|
|
803
|
-
const
|
|
804
|
-
return e.set(r,
|
|
1005
|
+
const s = e.get(r) ?? /* @__PURE__ */ new Set();
|
|
1006
|
+
return e.set(r, s), s.add(o), () => n(r, o);
|
|
805
1007
|
},
|
|
806
1008
|
off: n,
|
|
807
1009
|
emit(r, o) {
|
|
808
1010
|
if (!t) {
|
|
809
|
-
for (const
|
|
810
|
-
if (!(t || !e.get(r)?.has(
|
|
1011
|
+
for (const s of [...e.get(r) ?? []])
|
|
1012
|
+
if (!(t || !e.get(r)?.has(s)))
|
|
811
1013
|
try {
|
|
812
|
-
Promise.resolve(
|
|
813
|
-
} catch (
|
|
814
|
-
console.error(
|
|
1014
|
+
Promise.resolve(s(o)).catch((i) => console.error(i));
|
|
1015
|
+
} catch (i) {
|
|
1016
|
+
console.error(i);
|
|
815
1017
|
}
|
|
816
1018
|
}
|
|
817
1019
|
},
|
|
@@ -823,39 +1025,166 @@ function sn() {
|
|
|
823
1025
|
}
|
|
824
1026
|
};
|
|
825
1027
|
}
|
|
826
|
-
function
|
|
827
|
-
const o =
|
|
828
|
-
|
|
829
|
-
const
|
|
830
|
-
|
|
831
|
-
const d =
|
|
832
|
-
|
|
1028
|
+
function br(e, t) {
|
|
1029
|
+
const n = /* @__PURE__ */ new Map(), r = (R) => (e[R?.name]?.routeGroups ?? []).map((k) => k.name), o = () => new Set(r(t.getSnapshot().currentRoute)), s = o(), i = (R) => new Set(R.flatMap(r));
|
|
1030
|
+
let u = i(t.getSnapshot().stack ?? [t.getSnapshot().currentRoute]);
|
|
1031
|
+
const a = $e(0);
|
|
1032
|
+
let c = !1;
|
|
1033
|
+
const d = new AbortController();
|
|
1034
|
+
let g = !1, x = 0, b = t.getSnapshot().currentRoute?.key, h = t.getSnapshot().currentRoute?.name;
|
|
1035
|
+
const l = (R) => (R.stack ?? [R.currentRoute]).map((k) => [k?.key, k?.name]);
|
|
1036
|
+
let y = l(t.getSnapshot());
|
|
1037
|
+
for (const R of Object.values(e))
|
|
1038
|
+
for (const k of R.routeGroups ?? []) {
|
|
1039
|
+
if (n.has(k.name)) continue;
|
|
1040
|
+
const O = $e({ ...k, isFocused: s.has(k.name), isRetained: u.has(k.name) });
|
|
1041
|
+
n.set(k.name, { store: O, initialParams: k.params, guards: /* @__PURE__ */ new Map(), cacheGuards: /* @__PURE__ */ new Map(), tasks: /* @__PURE__ */ new Set() });
|
|
1042
|
+
}
|
|
1043
|
+
const C = (R) => {
|
|
1044
|
+
const k = [...R.tasks];
|
|
1045
|
+
R.tasks.clear();
|
|
1046
|
+
for (const O of k) O.abort();
|
|
1047
|
+
};
|
|
1048
|
+
let L = !1;
|
|
1049
|
+
const S = [], j = (R) => {
|
|
1050
|
+
const k = R.currentRoute, O = i(R.stack ?? [k]), A = u.size !== O.size || [...u].some((re) => !O.has(re)), N = l(R), W = y.length !== N.length || N.some(([re, I], _) => re !== y[_][0] || I !== y[_][1]);
|
|
1051
|
+
if (k?.key === b && k?.name === h && !A && !W) return;
|
|
1052
|
+
y = N;
|
|
1053
|
+
const Q = u;
|
|
1054
|
+
u = O, b = k?.key, h = k?.name, x++;
|
|
1055
|
+
const ne = new Set(r(k));
|
|
1056
|
+
for (const [re, I] of n) {
|
|
1057
|
+
if (c) break;
|
|
1058
|
+
const _ = I.store.getSnapshot(), le = ne.has(re), E = u.has(re), z = Q.has(re) && !E;
|
|
1059
|
+
_.isFocused === le && _.isRetained === E || (I.store.publish({ ..._, isFocused: le, isRetained: E, ...z ? { params: I.initialParams } : {} }), le || C(I));
|
|
1060
|
+
}
|
|
1061
|
+
}, D = t.subscribe(() => {
|
|
1062
|
+
if (!c && (S.push(t.getSnapshot()), !L)) {
|
|
1063
|
+
L = !0;
|
|
1064
|
+
try {
|
|
1065
|
+
for (; !c && S.length; ) j(S.shift());
|
|
1066
|
+
} finally {
|
|
1067
|
+
L = !1, S.length = 0;
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
return {
|
|
1072
|
+
get: (R) => n.get(R)?.store,
|
|
1073
|
+
isChecking: () => g,
|
|
1074
|
+
subscribeGuards: a.subscribe,
|
|
1075
|
+
getGuardRevision: a.getSnapshot,
|
|
1076
|
+
getProtectedCacheKeys(R, k = /* @__PURE__ */ new Set()) {
|
|
1077
|
+
const O = new Set(k);
|
|
1078
|
+
if (c) return O;
|
|
1079
|
+
const A = /* @__PURE__ */ new Set(), N = /* @__PURE__ */ new Set();
|
|
1080
|
+
for (const [W, Q] of n)
|
|
1081
|
+
for (const ne of Q.cacheGuards.values())
|
|
1082
|
+
ne === void 0 ? A.add(W) : N.add(ne);
|
|
1083
|
+
for (const W of R)
|
|
1084
|
+
(N.has(W.key) || r(W).some((Q) => A.has(Q))) && O.add(W.key);
|
|
1085
|
+
return O;
|
|
1086
|
+
},
|
|
1087
|
+
setParams(R, k) {
|
|
1088
|
+
const O = n.get(R);
|
|
1089
|
+
if (c || !O) return !1;
|
|
1090
|
+
if (!k || typeof k != "object" || Array.isArray(k)) throw new TypeError("Group params must be an object");
|
|
1091
|
+
const A = O.store.getSnapshot();
|
|
1092
|
+
return Object.keys(k).every((N) => Object.hasOwn(A.params, N) && Object.is(A.params[N], k[N])) || O.store.publish({ ...A, params: Object.freeze({ ...A.params, ...k }) }), !0;
|
|
1093
|
+
},
|
|
1094
|
+
registerGuard(R, k, { protectCache: O = !0, ownerKey: A } = {}) {
|
|
1095
|
+
const N = n.get(R);
|
|
1096
|
+
if (c || !N) return () => {
|
|
1097
|
+
};
|
|
1098
|
+
const W = (Q) => k(Q);
|
|
1099
|
+
return N.guards.set(W, A), O && N.cacheGuards.set(W, A), a.publish(a.getSnapshot() + 1), () => {
|
|
1100
|
+
N.guards.delete(W) && (N.cacheGuards.delete(W), a.publish(a.getSnapshot() + 1));
|
|
1101
|
+
};
|
|
1102
|
+
},
|
|
1103
|
+
async canLeave(R, k, O, A = !1, N = [], W = []) {
|
|
1104
|
+
if (c || g || L) return !1;
|
|
1105
|
+
g = !0;
|
|
1106
|
+
const Q = x, ne = a.getSnapshot(), re = () => !c && x === Q && a.getSnapshot() === ne;
|
|
1107
|
+
try {
|
|
1108
|
+
const I = new Set(r(k)), _ = i(W), le = A ? [...n.keys()] : [.../* @__PURE__ */ new Set([
|
|
1109
|
+
...r(R).filter((P) => !I.has(P)),
|
|
1110
|
+
...N.flatMap(r).filter((P) => !_.has(P) && !I.has(P))
|
|
1111
|
+
])], E = new Set(N.map((P) => P.key)), z = new Set(le), K = [...n.keys()].filter((P) => z.has(P) || [...n.get(P).guards.values()].some((F) => F !== void 0 && E.has(F)));
|
|
1112
|
+
for (const P of K.sort((F, Z) => Z.split("/").length - F.split("/").length)) {
|
|
1113
|
+
const { guards: F } = n.get(P);
|
|
1114
|
+
for (const Z of [...F.keys()]) {
|
|
1115
|
+
if (!re()) return !1;
|
|
1116
|
+
if (!F.has(Z)) continue;
|
|
1117
|
+
const de = F.get(Z);
|
|
1118
|
+
if (!z.has(P) && (de === void 0 || !E.has(de))) continue;
|
|
1119
|
+
const te = await Ie(Z, O, d.signal);
|
|
1120
|
+
if (!re() || te === !1) return !1;
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
return re();
|
|
1124
|
+
} finally {
|
|
1125
|
+
g = !1;
|
|
1126
|
+
}
|
|
1127
|
+
},
|
|
1128
|
+
async run(R, k) {
|
|
1129
|
+
const O = n.get(R);
|
|
1130
|
+
if (c || L || !o().has(R) || !O?.store.getSnapshot().isFocused) throw new Error("Route group is not focused");
|
|
1131
|
+
const A = new AbortController();
|
|
1132
|
+
O.tasks.add(A);
|
|
1133
|
+
const { signal: N } = A;
|
|
1134
|
+
let W;
|
|
1135
|
+
const Q = new Promise((ne, re) => {
|
|
1136
|
+
W = () => re(new DOMException("Route group task aborted", "AbortError")), N.addEventListener("abort", W, { once: !0 });
|
|
1137
|
+
});
|
|
1138
|
+
try {
|
|
1139
|
+
const ne = new Promise((I) => I(k(N))), re = await Promise.race([Q, ne]);
|
|
1140
|
+
if (N.aborted) throw new DOMException("Route group task aborted", "AbortError");
|
|
1141
|
+
return re;
|
|
1142
|
+
} finally {
|
|
1143
|
+
N.removeEventListener("abort", W), O.tasks.delete(A);
|
|
1144
|
+
}
|
|
1145
|
+
},
|
|
1146
|
+
destroy() {
|
|
1147
|
+
if (!c) {
|
|
1148
|
+
c = !0, d.abort(), D(), a.destroy();
|
|
1149
|
+
for (const R of n.values())
|
|
1150
|
+
C(R), R.guards.clear(), R.cacheGuards.clear(), R.store.destroy({ ...R.store.getSnapshot(), params: R.initialParams, isFocused: !1, isRetained: !1 });
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
function wr(e, t, n, r) {
|
|
1156
|
+
const o = n.currentRoute, s = r.currentRoute;
|
|
1157
|
+
if (o?.key === s?.key && n.stack.length === r.stack.length && n.stack.every((g, x) => g.key === r.stack[x].key)) return;
|
|
1158
|
+
const i = new Set(n.stack.map((g) => g.key)), u = new Set(r.stack.map((g) => g.key)), a = n.stack.filter((g) => !u.has(g.key)), c = r.stack.filter((g) => !i.has(g.key));
|
|
1159
|
+
if (o?.key === s?.key && !a.length && !c.length) return;
|
|
1160
|
+
const d = { id: t, from: o, to: s, added: c, removed: a, stack: r.stack };
|
|
1161
|
+
e.emit("routeChange", d), a.length && e.emit("routeRemove", d), o?.key !== s?.key && (o && e.emit("routeBlur", { ...d, route: o }), s && e.emit("routeFocus", { ...d, route: s }));
|
|
833
1162
|
}
|
|
834
|
-
function
|
|
1163
|
+
function kr() {
|
|
835
1164
|
const e = /* @__PURE__ */ new Map();
|
|
836
1165
|
let t = !1;
|
|
837
|
-
const n = /* @__PURE__ */ new Set(), r = (
|
|
1166
|
+
const n = /* @__PURE__ */ new Set(), r = (s) => {
|
|
838
1167
|
try {
|
|
839
|
-
Promise.resolve(
|
|
840
|
-
} catch (
|
|
841
|
-
console.error(
|
|
1168
|
+
Promise.resolve(s.cancel()).catch((i) => console.error(i));
|
|
1169
|
+
} catch (i) {
|
|
1170
|
+
console.error(i);
|
|
842
1171
|
}
|
|
843
|
-
}, o = (
|
|
844
|
-
for (const [
|
|
845
|
-
!
|
|
1172
|
+
}, o = (s) => {
|
|
1173
|
+
for (const [i, u] of [...e])
|
|
1174
|
+
!s(u) || !e.delete(i) || r(i);
|
|
846
1175
|
};
|
|
847
1176
|
return {
|
|
848
|
-
register(
|
|
849
|
-
return t || n.has(
|
|
850
|
-
}) : (e.set(
|
|
1177
|
+
register(s, i) {
|
|
1178
|
+
return t || n.has(s) ? (r(i), () => {
|
|
1179
|
+
}) : (e.set(i, s), () => e.delete(i));
|
|
851
1180
|
},
|
|
852
|
-
cancelRoutes(
|
|
853
|
-
const
|
|
854
|
-
|
|
1181
|
+
cancelRoutes(s) {
|
|
1182
|
+
const i = new Set(s), u = [...i].filter((a) => !n.has(a));
|
|
1183
|
+
u.forEach((a) => n.add(a));
|
|
855
1184
|
try {
|
|
856
|
-
o((
|
|
1185
|
+
o((a) => i.has(a));
|
|
857
1186
|
} finally {
|
|
858
|
-
|
|
1187
|
+
u.forEach((a) => n.delete(a));
|
|
859
1188
|
}
|
|
860
1189
|
},
|
|
861
1190
|
destroy() {
|
|
@@ -864,102 +1193,110 @@ function Vn() {
|
|
|
864
1193
|
count: () => e.size
|
|
865
1194
|
};
|
|
866
1195
|
}
|
|
867
|
-
function
|
|
868
|
-
const n = e.config.singlePage || Object.keys(e.config.screens).length === 1, r = n ? [{ key: "single", name: e.screen, params: e.params ?? {}, options: {} }] :
|
|
869
|
-
o.set = (
|
|
870
|
-
const
|
|
871
|
-
if (
|
|
872
|
-
const
|
|
873
|
-
|
|
1196
|
+
function xr(e, t) {
|
|
1197
|
+
const n = e.config.singlePage || Object.keys(e.config.screens).length === 1, r = n ? [{ key: "single", name: e.screen, params: e.params ?? {}, options: {} }] : pn(e.screen, e.params), o = $e({});
|
|
1198
|
+
o.set = (E, z) => {
|
|
1199
|
+
const K = o.getSnapshot();
|
|
1200
|
+
if (z == null && !(E in K) || Object.is(K[E], z)) return;
|
|
1201
|
+
const P = { ...K };
|
|
1202
|
+
z == null ? delete P[E] : P[E] = z, o.publish(P);
|
|
874
1203
|
};
|
|
875
|
-
const
|
|
876
|
-
layout:
|
|
877
|
-
navigation:
|
|
1204
|
+
const s = {
|
|
1205
|
+
layout: $e(t),
|
|
1206
|
+
navigation: $e({ canGoBack: !1, stack: r, currentRoute: r[0] }),
|
|
878
1207
|
header: o,
|
|
879
|
-
footer:
|
|
880
|
-
loading:
|
|
881
|
-
toast:
|
|
882
|
-
},
|
|
883
|
-
let
|
|
884
|
-
const
|
|
885
|
-
const
|
|
886
|
-
return (!
|
|
887
|
-
},
|
|
888
|
-
if (!
|
|
1208
|
+
footer: $e({}),
|
|
1209
|
+
loading: $e({ visible: !1, text: null, count: 0 }),
|
|
1210
|
+
toast: $e([])
|
|
1211
|
+
}, i = br(e.config.screens, s.navigation), u = Object.fromEntries(Object.entries(s).map(([E, z]) => [E, { current: z }])), a = Cn();
|
|
1212
|
+
let c;
|
|
1213
|
+
const d = () => {
|
|
1214
|
+
const E = Object.entries(s);
|
|
1215
|
+
return (!c || E.some(([z, K]) => !Object.is(c[z], K.getSnapshot()))) && (c = Object.freeze(Object.fromEntries(E.map(([z, K]) => [z, K.getSnapshot()])))), c;
|
|
1216
|
+
}, g = (E, z, K = Object.is, P) => {
|
|
1217
|
+
if (!S.current) return () => {
|
|
889
1218
|
};
|
|
890
|
-
const
|
|
891
|
-
if (!Object.hasOwn(
|
|
892
|
-
return
|
|
1219
|
+
const F = P === void 0 ? Object.values(s) : [...new Set(P)].map((v) => {
|
|
1220
|
+
if (!Object.hasOwn(s, v)) throw new Error(`Unknown runtime store: ${v}`);
|
|
1221
|
+
return s[v];
|
|
893
1222
|
});
|
|
894
|
-
let
|
|
895
|
-
const
|
|
1223
|
+
let Z = E(d());
|
|
1224
|
+
const de = () => {
|
|
896
1225
|
try {
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
} catch (
|
|
902
|
-
console.error(
|
|
1226
|
+
const v = E(d());
|
|
1227
|
+
if (K(Z, v)) return;
|
|
1228
|
+
const H = Z;
|
|
1229
|
+
Z = v, Promise.resolve(z(v, H)).catch((ke) => console.error(ke));
|
|
1230
|
+
} catch (v) {
|
|
1231
|
+
console.error(v);
|
|
903
1232
|
}
|
|
904
|
-
},
|
|
905
|
-
return () =>
|
|
906
|
-
},
|
|
907
|
-
|
|
1233
|
+
}, te = F.map((v) => v.subscribe(de));
|
|
1234
|
+
return () => te.forEach((v) => v());
|
|
1235
|
+
}, x = kr(), b = /* @__PURE__ */ new Map(), h = new AbortController();
|
|
1236
|
+
let l = 0;
|
|
1237
|
+
const y = () => l, C = (E, z) => {
|
|
1238
|
+
if (!S.current) return () => {
|
|
908
1239
|
};
|
|
909
|
-
const
|
|
910
|
-
return b.set(
|
|
911
|
-
|
|
1240
|
+
const K = b.get(E) ?? /* @__PURE__ */ new Set(), P = (F) => z(F);
|
|
1241
|
+
return b.set(E, K), K.add(P), l++, () => {
|
|
1242
|
+
K.delete(P) && (!K.size && b.get(E) === K && b.delete(E), l++);
|
|
912
1243
|
};
|
|
913
|
-
},
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
if (
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
1244
|
+
}, L = async (E, z) => {
|
|
1245
|
+
const K = l, P = () => S.current && K === l;
|
|
1246
|
+
for (const F of new Set(E)) for (const Z of [...b.get(F) ?? []])
|
|
1247
|
+
if (!P() || await Ie(Z, z, h.signal) === !1 || !P()) return !1;
|
|
1248
|
+
return P();
|
|
1249
|
+
}, S = { current: !0 };
|
|
1250
|
+
let j = null;
|
|
1251
|
+
const D = () => {
|
|
1252
|
+
if (!S.current || j) return null;
|
|
1253
|
+
const E = /* @__PURE__ */ Symbol();
|
|
1254
|
+
return j = E, () => {
|
|
1255
|
+
j === E && (j = null);
|
|
1256
|
+
};
|
|
1257
|
+
};
|
|
1258
|
+
let R;
|
|
1259
|
+
const k = new Promise((E) => {
|
|
1260
|
+
R = E;
|
|
1261
|
+
}), O = (E) => S.current ? (I.navigationCommands = E, R(!0), I.hasRegistered || (I.hasRegistered = !0, a.emit("ready", { id: e.id })), () => {
|
|
1262
|
+
I.navigationCommands === E && (I.navigationCommands = null);
|
|
926
1263
|
}) : () => {
|
|
927
|
-
},
|
|
928
|
-
}),
|
|
929
|
-
if (
|
|
930
|
-
|
|
931
|
-
for (const
|
|
1264
|
+
}, A = /* @__PURE__ */ new Set(), N = { current: /* @__PURE__ */ new Map() }, W = { current: /* @__PURE__ */ new Map() }, Q = { current: 0 }, ne = (E) => S.current ? (A.add(E), () => A.delete(E)) : (E(), () => {
|
|
1265
|
+
}), re = () => {
|
|
1266
|
+
if (S.current) {
|
|
1267
|
+
S.current = !1, h.abort(), j = null, R(!1), I.navigationCommands = null, i.destroy(), x.destroy(), b.clear();
|
|
1268
|
+
for (const E of A)
|
|
932
1269
|
try {
|
|
933
|
-
|
|
934
|
-
} catch (
|
|
935
|
-
console.error(
|
|
1270
|
+
E();
|
|
1271
|
+
} catch (z) {
|
|
1272
|
+
console.error(z);
|
|
936
1273
|
}
|
|
937
|
-
|
|
938
|
-
for (const
|
|
939
|
-
|
|
1274
|
+
A.clear(), N.current.clear();
|
|
1275
|
+
for (const E of W.current.values()) E.resolve({ status: "dismissed" });
|
|
1276
|
+
W.current.clear(), s.layout.destroy({}), s.navigation.destroy({ canGoBack: !1, stack: [], currentRoute: null }), s.header.destroy({}), s.footer.destroy({}), s.loading.destroy({ visible: !1, text: null, count: 0 }), s.toast.destroy([]), c = void 0, a.emit("destroy", { id: e.id }), a.destroy();
|
|
940
1277
|
}
|
|
941
|
-
},
|
|
942
|
-
let
|
|
943
|
-
for (const [
|
|
944
|
-
let
|
|
945
|
-
|
|
946
|
-
const
|
|
947
|
-
if (
|
|
948
|
-
|
|
1278
|
+
}, I = { beginTransaction: D, routeGroups: i, events: a, getSnapshot: d, subscribeState: g, ready: k, registerNavigation: O, id: e.id, single: n, stores: s, refs: u, alive: S, loadingTasks: N, loadingSequence: Q, pageRequests: W, tasks: x, registerRemovalGuard: C, getRemovalRevision: y, canRemove: L, addCleanup: ne, destroy: re }, _ = [];
|
|
1279
|
+
let le = !1;
|
|
1280
|
+
for (const [E, z] of Object.entries(s)) {
|
|
1281
|
+
let K = z.getSnapshot();
|
|
1282
|
+
z.subscribe(() => {
|
|
1283
|
+
const P = z.getSnapshot(), F = K;
|
|
1284
|
+
if (K = P, _.push({ key: E, old: F, next: P }), !le) {
|
|
1285
|
+
le = !0;
|
|
949
1286
|
try {
|
|
950
|
-
for (let
|
|
951
|
-
const { key:
|
|
952
|
-
|
|
1287
|
+
for (let Z = 0; Z < _.length && S.current; Z++) {
|
|
1288
|
+
const { key: de, old: te, next: v } = _[Z];
|
|
1289
|
+
a.emit("change", { id: e.id, store: de, previous: te, current: v }), de === "navigation" && S.current && wr(a, e.id, te, v);
|
|
953
1290
|
}
|
|
954
1291
|
} finally {
|
|
955
|
-
|
|
1292
|
+
_.length = 0, le = !1;
|
|
956
1293
|
}
|
|
957
1294
|
}
|
|
958
1295
|
});
|
|
959
1296
|
}
|
|
960
|
-
return
|
|
1297
|
+
return I;
|
|
961
1298
|
}
|
|
962
|
-
function
|
|
1299
|
+
function ft(e, t, n) {
|
|
963
1300
|
if (typeof e == "string") {
|
|
964
1301
|
if (!e.trim()) throw new TypeError("[react-modal-navigation] modal name must not be empty");
|
|
965
1302
|
return { name: e, params: t ?? {}, options: n ?? {} };
|
|
@@ -967,19 +1304,19 @@ function nt(e, t, n) {
|
|
|
967
1304
|
if (e === null || typeof e != "object" || Array.isArray(e))
|
|
968
1305
|
throw new TypeError("[react-modal-navigation] open expects a modal name or a configuration object");
|
|
969
1306
|
if (e.component || e.loader || e.screens || e.definitionLoader) {
|
|
970
|
-
const { params:
|
|
971
|
-
return { name: g, params: t ??
|
|
1307
|
+
const { params: a, options: c, screen: d, ...g } = e;
|
|
1308
|
+
return { name: g, params: t ?? a ?? {}, options: { ...c, ...n }, screen: d };
|
|
972
1309
|
}
|
|
973
|
-
const { name: r, screen: o, params:
|
|
1310
|
+
const { name: r, screen: o, params: s = {}, options: i = {}, ...u } = e;
|
|
974
1311
|
if (typeof r != "string" || !r.trim())
|
|
975
1312
|
throw new TypeError("[react-modal-navigation] open config requires a non-empty string name");
|
|
976
|
-
if (
|
|
1313
|
+
if (i === null || typeof i != "object" || Array.isArray(i))
|
|
977
1314
|
throw new TypeError("[react-modal-navigation] open config options must be an object");
|
|
978
1315
|
if (o !== void 0 && (typeof o != "string" || !o.trim()))
|
|
979
1316
|
throw new TypeError("[react-modal-navigation] screen must be a non-empty string");
|
|
980
|
-
return { name: r, ...o === void 0 ? {} : { screen: o }, params:
|
|
1317
|
+
return { name: r, ...o === void 0 ? {} : { screen: o }, params: s, options: { ...u, ...i } };
|
|
981
1318
|
}
|
|
982
|
-
function
|
|
1319
|
+
function Sr() {
|
|
983
1320
|
const e = /* @__PURE__ */ new Map();
|
|
984
1321
|
return {
|
|
985
1322
|
wait(t) {
|
|
@@ -998,729 +1335,756 @@ function Qn() {
|
|
|
998
1335
|
pendingCount: () => e.size
|
|
999
1336
|
};
|
|
1000
1337
|
}
|
|
1001
|
-
const
|
|
1002
|
-
function
|
|
1338
|
+
const Rr = { placement: "right", showHeader: !0, showBackButton: !0, showCloseButton: !0, viewportGap: 5, borderRadius: 12, closeOnOverlay: !1, closeOnEsc: !0 };
|
|
1339
|
+
function Cr(e, t) {
|
|
1003
1340
|
let n = e;
|
|
1004
|
-
const r =
|
|
1005
|
-
let
|
|
1006
|
-
const d = (
|
|
1007
|
-
|
|
1341
|
+
const r = Cn(), o = /* @__PURE__ */ new Set(), { confirmDiscard: s, onError: i } = n, u = $e({ isOpen: !1, activeName: null, isFullscreen: !1, queueSize: 0, error: null }), a = $e({ active: null, options: null, exiting: !1, error: null, translate: n.translate });
|
|
1342
|
+
let c = null;
|
|
1343
|
+
const d = (f) => {
|
|
1344
|
+
c = f, De();
|
|
1008
1345
|
};
|
|
1009
1346
|
let g = null;
|
|
1010
|
-
const
|
|
1011
|
-
g =
|
|
1347
|
+
const x = (f) => {
|
|
1348
|
+
g = f, De();
|
|
1349
|
+
};
|
|
1350
|
+
let b = 0;
|
|
1351
|
+
const h = (f) => {
|
|
1352
|
+
b = f, De();
|
|
1353
|
+
}, l = { current: null }, y = { current: /* @__PURE__ */ new Map() }, C = { current: [] }, L = { current: null }, S = { current: null }, j = { current: 0 }, D = { current: null }, R = { current: !1 }, k = { current: 0 }, O = { current: null }, A = { current: /* @__PURE__ */ new Map() };
|
|
1354
|
+
let N = !1;
|
|
1355
|
+
const W = (f) => {
|
|
1356
|
+
N = f, De();
|
|
1357
|
+
}, Q = { current: s };
|
|
1358
|
+
let ne = new AbortController();
|
|
1359
|
+
const re = () => {
|
|
1360
|
+
ne.abort(), ne = new AbortController();
|
|
1012
1361
|
};
|
|
1013
|
-
let
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1362
|
+
let I = 0;
|
|
1363
|
+
const _ = (f, w) => {
|
|
1364
|
+
const B = A.current.get(f) ?? /* @__PURE__ */ new Set();
|
|
1365
|
+
A.current.set(f, B);
|
|
1366
|
+
const M = { get dirty() {
|
|
1367
|
+
return w.dirty;
|
|
1368
|
+
}, get message() {
|
|
1369
|
+
return w.message;
|
|
1370
|
+
}, get onBeforeDiscard() {
|
|
1371
|
+
return w.onBeforeDiscard;
|
|
1372
|
+
} };
|
|
1373
|
+
return B.add(M), I++, () => {
|
|
1374
|
+
B.delete(M) && (I++, !B.size && A.current.get(f) === B && A.current.delete(f));
|
|
1024
1375
|
};
|
|
1025
|
-
},
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
if (
|
|
1376
|
+
}, le = async (f, w) => {
|
|
1377
|
+
const B = I, M = ne.signal;
|
|
1378
|
+
for (const J of new Set(f)) for (const U of [...A.current.get(J) ?? []]) {
|
|
1379
|
+
if (!A.current.get(J)?.has(U) || !U.dirty) continue;
|
|
1380
|
+
const fe = U.onBeforeDiscard ? await Ie(() => U.onBeforeDiscard(w), w, M) : Q.current ? await Ie(() => Q.current(w), w, M) : typeof window < "u" && typeof window.confirm == "function" ? window.confirm(U.message || "有未保存的修改,确定放弃吗?") : !1;
|
|
1381
|
+
if (M.aborted || fe === !1 || B !== I) return !1;
|
|
1029
1382
|
}
|
|
1030
|
-
return !
|
|
1031
|
-
},
|
|
1032
|
-
|
|
1033
|
-
const
|
|
1034
|
-
|
|
1383
|
+
return !M.aborted && B === I;
|
|
1384
|
+
}, E = (f) => le([...A.current.keys()], f), z = { current: !0 }, K = { current: null };
|
|
1385
|
+
K.current || (K.current = Sr());
|
|
1386
|
+
const P = { current: i }, F = ((f, w) => {
|
|
1387
|
+
z.current && x(f);
|
|
1035
1388
|
try {
|
|
1036
|
-
|
|
1037
|
-
} catch (
|
|
1038
|
-
console.error("[react-modal-navigation] onError failed",
|
|
1389
|
+
P.current ? P.current(f, w) : console.error("[react-modal-navigation]", f);
|
|
1390
|
+
} catch (B) {
|
|
1391
|
+
console.error("[react-modal-navigation] onError failed", B);
|
|
1039
1392
|
}
|
|
1040
|
-
}),
|
|
1041
|
-
const
|
|
1042
|
-
|
|
1043
|
-
for (const
|
|
1044
|
-
}),
|
|
1045
|
-
const
|
|
1046
|
-
if (!
|
|
1047
|
-
const
|
|
1048
|
-
|
|
1049
|
-
const
|
|
1393
|
+
}), Z = ((f, w) => {
|
|
1394
|
+
const B = y.current.get(f);
|
|
1395
|
+
y.current.delete(f);
|
|
1396
|
+
for (const M of B ?? []) M(w);
|
|
1397
|
+
}), de = ((f) => ({ ...Rr, ...n.defaultOptions, ...n.theme !== void 0 ? { theme: n.theme } : {}, ...n.backgroundColor !== void 0 ? { backgroundColor: n.backgroundColor } : {}, ...f.config.modalOptions, ...f.overrides, runtimeLayout: f.runtimeLayout })), te = (async (f = "api", w, B = {}) => {
|
|
1398
|
+
const M = l.current;
|
|
1399
|
+
if (!M || D.current || R.current) return !1;
|
|
1400
|
+
const J = M.runtime.beginTransaction();
|
|
1401
|
+
if (!J) return !1;
|
|
1402
|
+
const U = k.current, fe = ne.signal;
|
|
1403
|
+
D.current = M.id, R.current = !0;
|
|
1404
|
+
const ae = de(M), ie = { ...B, reason: f, result: w, name: M.name };
|
|
1050
1405
|
try {
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
const
|
|
1054
|
-
if (await
|
|
1055
|
-
|
|
1056
|
-
const
|
|
1057
|
-
|
|
1406
|
+
const Re = I;
|
|
1407
|
+
if (!await E(ie) || U !== k.current || l.current?.id !== M.id) return !1;
|
|
1408
|
+
const je = M.runtime.routeGroups.getGuardRevision(), $ = M.runtime.getRemovalRevision();
|
|
1409
|
+
if (!await M.runtime.routeGroups.canLeave(null, null, ie, !0) || !await M.runtime.canRemove(M.runtime.stores.navigation.getSnapshot().stack.map((ze) => ze.key), ie) || U !== k.current || l.current?.id !== M.id || ae.onBeforeClose && !await Ie(() => ae.onBeforeClose(ie), ie, fe) || U !== k.current || l.current?.id !== M.id || !z.current || Re !== I || je !== M.runtime.routeGroups.getGuardRevision() || $ !== M.runtime.getRemovalRevision()) return !1;
|
|
1410
|
+
W(!0);
|
|
1411
|
+
const ue = ae.animation === !1 || typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ? 0 : Math.max(0, Number(ae.animationDuration ?? 220) || 0);
|
|
1412
|
+
if (await K.current.wait(Math.min(ue, 1e3)), !z.current || l.current?.id !== M.id) return !1;
|
|
1413
|
+
if (Re !== I || je !== M.runtime.routeGroups.getGuardRevision() || $ !== M.runtime.getRemovalRevision())
|
|
1414
|
+
return W(!1), !1;
|
|
1415
|
+
M.runtime.destroy(), l.current = null, O.current = null, N = !1, d(null), A.current.clear();
|
|
1416
|
+
const pe = B.confirmed || w !== void 0 ? { status: "confirmed", value: w, reason: f } : { status: "dismissed", reason: f };
|
|
1417
|
+
Z(M.id, pe), r.emit("close", { id: M.id, name: M.name, result: pe });
|
|
1058
1418
|
try {
|
|
1059
|
-
(
|
|
1060
|
-
} catch (
|
|
1061
|
-
|
|
1419
|
+
(B.confirmed || w !== void 0) && await Ie(() => ae.onConfirmed?.(w), ie, fe), await Ie(() => ae.onClose?.(ie), ie, fe), await Ie(() => ae.onClosed?.(ie), ie, fe);
|
|
1420
|
+
} catch (ze) {
|
|
1421
|
+
U === k.current && F(ze, { phase: "onClose", name: M.name });
|
|
1062
1422
|
}
|
|
1063
1423
|
return !0;
|
|
1064
|
-
} catch (
|
|
1065
|
-
return
|
|
1424
|
+
} catch (Re) {
|
|
1425
|
+
return U === k.current && l.current?.id === M.id && (N && W(!1), F(Re, { phase: "onBeforeClose", name: M.name })), !1;
|
|
1066
1426
|
} finally {
|
|
1067
|
-
D.current ===
|
|
1427
|
+
J(), D.current === M.id && (D.current = null), U === k.current && (R.current = !1), !l.current && z.current && queueMicrotask(() => S.current?.());
|
|
1068
1428
|
}
|
|
1069
|
-
}),
|
|
1070
|
-
if (!
|
|
1071
|
-
|
|
1072
|
-
|
|
1429
|
+
}), v = (async (f, w = {}, B = {}, M, J) => {
|
|
1430
|
+
if (!z.current || R.current || D.current) return null;
|
|
1431
|
+
const U = l.current?.runtime, fe = U?.beginTransaction();
|
|
1432
|
+
if (U && !fe) return null;
|
|
1433
|
+
R.current = !0;
|
|
1434
|
+
const ae = k.current, ie = ne.signal;
|
|
1073
1435
|
try {
|
|
1074
|
-
const
|
|
1075
|
-
if (!
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1078
|
-
const pe =
|
|
1079
|
-
if (!pe) throw new Error(`[react-modal-navigation] Unknown modal: ${
|
|
1080
|
-
const
|
|
1081
|
-
if (!pe.screens || !Object.hasOwn(pe.screens,
|
|
1082
|
-
const
|
|
1083
|
-
if (
|
|
1084
|
-
if (
|
|
1085
|
-
if (
|
|
1086
|
-
if (
|
|
1087
|
-
const
|
|
1088
|
-
|
|
1436
|
+
const Re = await Rn(f, n.registry);
|
|
1437
|
+
if (!z.current || ae !== k.current) return null;
|
|
1438
|
+
const je = (be) => be.loader && !be.component ? { ...be, component: t(be.loader) } : be, $ = Re.screens ? on(Re.screens) : null, ue = $ ? { ...Re, routeAliases: $.aliases, screens: Object.fromEntries(Object.entries($.screens).map(([be, Ce]) => [be, je(Ce)])) } : je(Re);
|
|
1439
|
+
f = typeof f == "string" ? f : Re.name ?? "inline";
|
|
1440
|
+
const pe = ue?.component && !ue.screens ? { ...ue, singlePage: !0, initialRoute: "__single__", screens: { __single__: { component: ue.component, title: ue.title, ...Re.screenOptions ?? {} } } } : ue;
|
|
1441
|
+
if (!pe) throw new Error(`[react-modal-navigation] Unknown modal: ${f}`);
|
|
1442
|
+
const ze = Ct(J ?? pe.initialRoute ?? Object.keys(pe.screens ?? {})[0], pe.routeAliases);
|
|
1443
|
+
if (!pe.screens || !Object.hasOwn(pe.screens, ze) || !pe.screens[ze]) throw new Error(`[react-modal-navigation] Unknown initial screen '${ze}' in modal '${f}'`);
|
|
1444
|
+
const ce = l.current, rt = B.instanceKey ?? pe.modalOptions?.instanceKey, _e = B.duplicateStrategy ?? pe.modalOptions?.duplicateStrategy;
|
|
1445
|
+
if (ce && rt != null && ce.instanceKey === rt) {
|
|
1446
|
+
if (_e === "ignore") return null;
|
|
1447
|
+
if (_e === "reuse") {
|
|
1448
|
+
if (M) {
|
|
1449
|
+
const be = y.current.get(ce.id) ?? [];
|
|
1450
|
+
be.push(M), y.current.set(ce.id, be);
|
|
1089
1451
|
}
|
|
1090
|
-
return
|
|
1452
|
+
return ce.id;
|
|
1091
1453
|
}
|
|
1092
1454
|
}
|
|
1093
|
-
if (
|
|
1094
|
-
const
|
|
1455
|
+
if (ce) {
|
|
1456
|
+
const be = de(ce), Ce = { reason: "replace", name: ce.name, nextName: f };
|
|
1095
1457
|
try {
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1458
|
+
const He = I;
|
|
1459
|
+
if (!await E(Ce) || ae !== k.current || l.current?.id !== ce.id) return null;
|
|
1460
|
+
const zt = ce.runtime.routeGroups.getGuardRevision(), p = ce.runtime.getRemovalRevision();
|
|
1461
|
+
if (!await ce.runtime.routeGroups.canLeave(null, null, Ce, !0) || !await ce.runtime.canRemove(ce.runtime.stores.navigation.getSnapshot().stack.map((T) => T.key), Ce) || ae !== k.current || l.current?.id !== ce.id || be.onBeforeClose && !await Ie(() => be.onBeforeClose(Ce), Ce, ie) || He !== I || zt !== ce.runtime.routeGroups.getGuardRevision() || p !== ce.runtime.getRemovalRevision()) return null;
|
|
1462
|
+
} catch (He) {
|
|
1463
|
+
return ae === k.current && l.current?.id === ce.id && F(He, { phase: "onBeforeClose", name: ce.name }), null;
|
|
1099
1464
|
}
|
|
1100
|
-
if (!
|
|
1101
|
-
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1465
|
+
if (!z.current || ae !== k.current || l.current?.id !== ce.id) return null;
|
|
1466
|
+
ce.runtime.destroy(), l.current = null, O.current = null, d(null), A.current.clear();
|
|
1467
|
+
const Ue = { status: "replaced", reason: "replace" };
|
|
1468
|
+
Z(ce.id, Ue), r.emit("close", { id: ce.id, name: ce.name, result: Ue });
|
|
1104
1469
|
try {
|
|
1105
|
-
await
|
|
1106
|
-
} catch (
|
|
1107
|
-
|
|
1470
|
+
await Ie(() => be.onClose?.(Ce), Ce, ie), await Ie(() => be.onClosed?.(Ce), Ce, ie);
|
|
1471
|
+
} catch (He) {
|
|
1472
|
+
ae === k.current && F(He, { phase: "onClose", name: ce.name });
|
|
1108
1473
|
}
|
|
1109
|
-
if (!
|
|
1474
|
+
if (!z.current || ae !== k.current) return null;
|
|
1110
1475
|
}
|
|
1111
|
-
const
|
|
1112
|
-
return
|
|
1476
|
+
const Te = { id: ++j.current, name: f, screen: ze, params: w, config: pe, overrides: B, instanceKey: rt };
|
|
1477
|
+
return Te.runtime = xr(Te, de(Te)), Te.runtime.bindings = nt(Te.id), l.current = Te, O.current = null, M && y.current.set(Te.id, [M]), g = null, d(Te), r.emit("open", { id: Te.id, name: Te.name }), Te.id;
|
|
1113
1478
|
} finally {
|
|
1114
|
-
|
|
1479
|
+
fe?.(), ae === k.current && (R.current = !1), !l.current && z.current && queueMicrotask(() => S.current?.());
|
|
1115
1480
|
}
|
|
1116
1481
|
});
|
|
1117
|
-
|
|
1118
|
-
const
|
|
1119
|
-
if (!
|
|
1120
|
-
const
|
|
1121
|
-
if (
|
|
1122
|
-
o.add(
|
|
1482
|
+
L.current = v;
|
|
1483
|
+
const H = (async () => {
|
|
1484
|
+
if (!z.current || l.current || R.current || D.current) return;
|
|
1485
|
+
const f = C.current.shift();
|
|
1486
|
+
if (f) {
|
|
1487
|
+
o.add(f), h(C.current.length);
|
|
1123
1488
|
try {
|
|
1124
|
-
const
|
|
1125
|
-
|
|
1126
|
-
} catch (
|
|
1127
|
-
|
|
1489
|
+
const w = await L.current(f.args.name, f.args.params, f.args.options, f.resolveResult, f.args.screen);
|
|
1490
|
+
w === null ? (f.resolveResult?.({ status: "dismissed", reason: "blocked" }), f.resolveId?.(null), queueMicrotask(() => S.current?.())) : f.resolveId?.(w);
|
|
1491
|
+
} catch (w) {
|
|
1492
|
+
f.reject?.(w), queueMicrotask(() => S.current?.());
|
|
1128
1493
|
} finally {
|
|
1129
|
-
o.delete(
|
|
1494
|
+
o.delete(f);
|
|
1130
1495
|
}
|
|
1131
1496
|
}
|
|
1132
1497
|
});
|
|
1133
|
-
|
|
1134
|
-
const
|
|
1135
|
-
if (!
|
|
1136
|
-
const
|
|
1137
|
-
return typeof
|
|
1138
|
-
|
|
1498
|
+
S.current = H;
|
|
1499
|
+
const ke = ((f, w, B) => {
|
|
1500
|
+
if (!z.current) return Promise.resolve(null);
|
|
1501
|
+
const M = ft(f, w, B);
|
|
1502
|
+
return typeof M.name == "string" && !n.registry?.[M.name] ? Promise.reject(new Error(`[react-modal-navigation] Unknown modal: ${M.name}`)) : new Promise((J, U) => {
|
|
1503
|
+
C.current.push({ args: M, resolveId: J, reject: U }), h(C.current.length), queueMicrotask(() => S.current?.());
|
|
1139
1504
|
});
|
|
1140
|
-
}),
|
|
1141
|
-
if (!
|
|
1142
|
-
const
|
|
1143
|
-
return typeof
|
|
1144
|
-
|
|
1505
|
+
}), xe = ((f, w, B) => {
|
|
1506
|
+
if (!z.current) return Promise.resolve({ status: "dismissed", reason: "unmount" });
|
|
1507
|
+
const M = ft(f, w, B);
|
|
1508
|
+
return typeof M.name == "string" && !n.registry?.[M.name] ? Promise.reject(new Error(`[react-modal-navigation] Unknown modal: ${M.name}`)) : new Promise((J, U) => {
|
|
1509
|
+
C.current.push({ args: M, resolveResult: J, reject: U }), h(C.current.length), queueMicrotask(() => S.current?.());
|
|
1145
1510
|
});
|
|
1146
|
-
}),
|
|
1147
|
-
if (!
|
|
1148
|
-
const
|
|
1149
|
-
return !
|
|
1150
|
-
}),
|
|
1151
|
-
const
|
|
1511
|
+
}), Ae = ((f) => {
|
|
1512
|
+
if (!f || typeof f != "object" || Array.isArray(f)) throw new TypeError("[react-modal-navigation] update expects an options object");
|
|
1513
|
+
const w = l.current;
|
|
1514
|
+
return !w || R.current ? !1 : (Object.keys(f).every((B) => Object.is(de(w)[B], f[B])) || (w.overrides = { ...w.overrides, ...f }, w.runtimeLayout = { ...w.runtimeLayout, ...f }, De()), !0);
|
|
1515
|
+
}), Qe = ((f, w) => gr(f, n.registry, w)), ye = ((f) => Ae({ fullscreen: !!f })), ve = (() => ye(!(l.current && de(l.current).fullscreen))), ct = ((f = "queue-cleared") => {
|
|
1516
|
+
const w = C.current.splice(0);
|
|
1152
1517
|
h(0);
|
|
1153
|
-
for (const
|
|
1154
|
-
|
|
1155
|
-
return
|
|
1156
|
-
}),
|
|
1157
|
-
const
|
|
1158
|
-
return
|
|
1159
|
-
}),
|
|
1160
|
-
const
|
|
1161
|
-
return new Promise((
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
},
|
|
1518
|
+
for (const B of w)
|
|
1519
|
+
B.resolveId?.(null), B.resolveResult?.({ status: "dismissed", reason: f });
|
|
1520
|
+
return w.length;
|
|
1521
|
+
}), ht = ((f, w, B) => {
|
|
1522
|
+
const M = ft(f, w, B);
|
|
1523
|
+
return v(M.name, M.params, M.options, void 0, M.screen);
|
|
1524
|
+
}), et = ((f, w, B) => {
|
|
1525
|
+
const M = ft(f, w, B);
|
|
1526
|
+
return new Promise((J, U) => {
|
|
1527
|
+
v(M.name, M.params, M.options, J, M.screen).then((fe) => {
|
|
1528
|
+
fe === null && J({ status: "dismissed", reason: "blocked" });
|
|
1529
|
+
}, U);
|
|
1165
1530
|
});
|
|
1166
|
-
}),
|
|
1167
|
-
const
|
|
1168
|
-
let
|
|
1169
|
-
const
|
|
1170
|
-
|
|
1171
|
-
}),
|
|
1172
|
-
|
|
1173
|
-
const
|
|
1531
|
+
}), gt = (async (f, w, B) => {
|
|
1532
|
+
const M = ft(f, w, B);
|
|
1533
|
+
let J;
|
|
1534
|
+
const U = new Promise(($) => {
|
|
1535
|
+
J = $;
|
|
1536
|
+
}), fe = await v(M.name, M.params, M.options, J, M.screen);
|
|
1537
|
+
fe === null && J({ status: "dismissed", reason: "blocked" });
|
|
1538
|
+
const ae = () => fe !== null && l.current?.id === fe && l.current.runtime.alive.current, ie = () => ae() ? l.current.runtime : null, Re = ie()?.ready.then(($) => $ && ae()) ?? Promise.resolve(!1), je = ($, ...ue) => ie()?.navigationCommands?.[$]?.(...ue) ?? !1;
|
|
1174
1539
|
return {
|
|
1175
|
-
id:
|
|
1176
|
-
result:
|
|
1177
|
-
isActive:
|
|
1178
|
-
replaceOptions: (
|
|
1179
|
-
if (!
|
|
1180
|
-
const
|
|
1181
|
-
return
|
|
1540
|
+
id: fe,
|
|
1541
|
+
result: U,
|
|
1542
|
+
isActive: ae,
|
|
1543
|
+
replaceOptions: ($) => {
|
|
1544
|
+
if (!ae() || R.current) return !1;
|
|
1545
|
+
const ue = l.current;
|
|
1546
|
+
return ue.overrides = { ...$ }, ue.runtimeLayout = void 0, De(), !0;
|
|
1182
1547
|
},
|
|
1183
1548
|
dispose: () => {
|
|
1184
|
-
if (!
|
|
1185
|
-
const
|
|
1186
|
-
|
|
1187
|
-
const
|
|
1188
|
-
return
|
|
1549
|
+
if (!ae()) return !1;
|
|
1550
|
+
const $ = l.current;
|
|
1551
|
+
k.current++, re(), K.current.cancelAll(), l.current = null, O.current = null, D.current = null, R.current = !1, N = !1, A.current.clear(), $.runtime.destroy(), d(null);
|
|
1552
|
+
const ue = { status: "dismissed", reason: "unmount" };
|
|
1553
|
+
return Z(fe, ue), r.emit("close", { id: fe, name: $.name, result: ue }), queueMicrotask(() => S.current?.()), !0;
|
|
1189
1554
|
},
|
|
1190
|
-
ready:
|
|
1191
|
-
on: (
|
|
1555
|
+
ready: Re,
|
|
1556
|
+
on: ($, ue) => ie()?.events.on($, ue) ?? (() => {
|
|
1192
1557
|
}),
|
|
1193
|
-
off: (
|
|
1558
|
+
off: ($, ue) => ie()?.events.off($, ue),
|
|
1194
1559
|
getSnapshot: () => ie()?.getSnapshot() ?? null,
|
|
1195
|
-
subscribeState: (
|
|
1560
|
+
subscribeState: ($, ue, pe, ze) => ie()?.subscribeState($, ue, pe, ze) ?? (() => {
|
|
1196
1561
|
}),
|
|
1197
1562
|
getState: () => ie()?.stores.navigation.getSnapshot() ?? null,
|
|
1198
|
-
subscribe: (
|
|
1563
|
+
subscribe: ($) => ie()?.stores.navigation.subscribe($) ?? (() => {
|
|
1199
1564
|
}),
|
|
1200
|
-
clearCache: async (
|
|
1201
|
-
navigate: async (
|
|
1202
|
-
setParams: (
|
|
1203
|
-
setLoading: (
|
|
1204
|
-
setOptions: (
|
|
1205
|
-
setFullscreen: (
|
|
1206
|
-
close: (
|
|
1207
|
-
confirm: (
|
|
1565
|
+
clearCache: async ($) => !!await je("clearCache", $),
|
|
1566
|
+
navigate: async (...$) => !!await je("navigate", ...$),
|
|
1567
|
+
setParams: ($) => ie()?.navigationCommands ? (je("setParams", $), !0) : !1,
|
|
1568
|
+
setLoading: ($, ue) => ie()?.navigationCommands?.setLoading ? (je("setLoading", $, ue), !0) : !1,
|
|
1569
|
+
setOptions: ($) => ae() && Ae($),
|
|
1570
|
+
setFullscreen: ($) => ae() && Ae({ fullscreen: !!$ }),
|
|
1571
|
+
close: ($) => ae() ? te("api", $) : Promise.resolve(!1),
|
|
1572
|
+
confirm: ($) => ae() ? te("confirm", $, { confirmed: !0 }) : Promise.resolve(!1)
|
|
1208
1573
|
};
|
|
1209
|
-
}),
|
|
1210
|
-
const
|
|
1211
|
-
return
|
|
1212
|
-
|
|
1213
|
-
},
|
|
1214
|
-
}, on: r.on, off: r.off, open:
|
|
1215
|
-
function
|
|
1216
|
-
const
|
|
1217
|
-
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1574
|
+
}), lt = ((f) => te("api", f)), yt = ((f = "api") => te(f)), Ke = ((f) => te("confirm", f, { confirmed: !0 })), vt = ((f, w) => O.current?.setLoading(f, w)), ut = () => x(null), tt = /* @__PURE__ */ new Set(), Ze = { inspect: (f) => {
|
|
1575
|
+
const w = vr({ hostStore: a, statusStore: u, commands: Ze }, f), B = w.dispose;
|
|
1576
|
+
return w.dispose = () => {
|
|
1577
|
+
tt.delete(w), B();
|
|
1578
|
+
}, tt.add(w), z.current || w.dispose(), w;
|
|
1579
|
+
}, on: r.on, off: r.off, open: ht, openInstance: gt, openAsync: et, enqueue: ke, enqueueAsync: xe, update: Ae, setOptions: Ae, preload: Qe, setFullscreen: ye, toggleFullscreen: ve, clearQueue: ct, close: lt, dismiss: yt, confirm: Ke, setLoading: vt, clearError: ut }, Le = (f, w) => Object.keys(f).length === Object.keys(w).length && Object.keys(f).every((B) => Object.is(f[B], w[B]));
|
|
1580
|
+
function De() {
|
|
1581
|
+
const f = c ? de(c) : null, w = a.getSnapshot();
|
|
1582
|
+
c && !Le(f, c.runtime.stores.layout.getSnapshot()) && c.runtime.stores.layout.publish(f);
|
|
1583
|
+
const B = c ? w.active === c ? w.options : f : null, M = { isOpen: !!c, activeName: c?.name ?? null, isFullscreen: !!f?.fullscreen, queueSize: b, error: g }, J = { active: c, options: B, exiting: N, error: g, translate: n.translate }, U = u.getSnapshot();
|
|
1584
|
+
Le(M, U) || u.publish(M), Le(J, w) || a.publish(J), U.queueSize !== M.queueSize && r.emit("queueChange", { previous: U.queueSize, current: M.queueSize });
|
|
1220
1585
|
}
|
|
1221
|
-
const
|
|
1222
|
-
registerLoading: (
|
|
1223
|
-
|
|
1586
|
+
const nt = (f) => ({
|
|
1587
|
+
registerLoading: (w) => {
|
|
1588
|
+
l.current?.id === f && (O.current = w);
|
|
1224
1589
|
},
|
|
1225
|
-
registerDirtyGuard: (
|
|
1590
|
+
registerDirtyGuard: (w, B) => l.current?.id === f ? _(w, B) : () => {
|
|
1226
1591
|
},
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1592
|
+
getDirtyRevision: () => I,
|
|
1593
|
+
getProtectedCacheKeys: () => l.current?.id === f ? new Set([...A.current].filter(([, w]) => [...w].some((B) => B.dirty)).map(([w]) => w)) : /* @__PURE__ */ new Set(),
|
|
1594
|
+
canNavigate: (w, B) => l.current?.id === f ? le(w, B) : Promise.resolve(!1),
|
|
1595
|
+
onRequestClose: (...w) => l.current?.id === f ? te(...w) : Promise.resolve(!1),
|
|
1596
|
+
onOpened: (w) => {
|
|
1597
|
+
if (l.current?.id !== f) return;
|
|
1598
|
+
const B = de(l.current), M = (J, U) => {
|
|
1599
|
+
l.current?.id === f && F(J, { phase: U });
|
|
1234
1600
|
};
|
|
1235
|
-
for (const
|
|
1601
|
+
for (const J of ["onOpen", "onOpened"])
|
|
1236
1602
|
try {
|
|
1237
|
-
Promise.resolve(
|
|
1238
|
-
} catch (
|
|
1239
|
-
|
|
1603
|
+
Promise.resolve(B[J]?.(w)).catch((U) => M(U, J));
|
|
1604
|
+
} catch (U) {
|
|
1605
|
+
M(U, J);
|
|
1240
1606
|
}
|
|
1241
1607
|
}
|
|
1242
1608
|
});
|
|
1243
|
-
return { commands:
|
|
1244
|
-
n =
|
|
1609
|
+
return { commands: Ze, statusStore: u, hostStore: a, bindInstance: nt, configure: (f) => {
|
|
1610
|
+
n = f, Q.current = f.confirmDiscard, P.current = f.onError, De();
|
|
1245
1611
|
}, mount: () => {
|
|
1246
|
-
|
|
1612
|
+
z.current = !0;
|
|
1247
1613
|
}, destroy: () => {
|
|
1248
|
-
|
|
1249
|
-
for (const
|
|
1250
|
-
r.clear(),
|
|
1251
|
-
for (const
|
|
1252
|
-
|
|
1253
|
-
for (const
|
|
1254
|
-
|
|
1255
|
-
o.clear(),
|
|
1256
|
-
}, reportError:
|
|
1257
|
-
}
|
|
1258
|
-
const
|
|
1259
|
-
return /* @__PURE__ */
|
|
1260
|
-
}),
|
|
1261
|
-
const
|
|
1262
|
-
return /* @__PURE__ */
|
|
1263
|
-
}),
|
|
1264
|
-
const r =
|
|
1265
|
-
return /* @__PURE__ */
|
|
1266
|
-
}),
|
|
1267
|
-
const r =
|
|
1268
|
-
return /* @__PURE__ */
|
|
1614
|
+
z.current = !1;
|
|
1615
|
+
for (const f of tt) f.dispose();
|
|
1616
|
+
r.clear(), k.current += 1, re(), K.current.cancelAll(), l.current?.runtime.destroy(), l.current = null, O.current = null, D.current = null, R.current = !1;
|
|
1617
|
+
for (const f of y.current.keys()) Z(f, { status: "dismissed", reason: "unmount" });
|
|
1618
|
+
y.current.clear(), A.current.clear(), c = null, N = !1, g = null;
|
|
1619
|
+
for (const f of o)
|
|
1620
|
+
f.resolveId?.(null), f.resolveResult?.({ status: "dismissed", reason: "unmount" });
|
|
1621
|
+
o.clear(), ct("unmount"), De();
|
|
1622
|
+
}, reportError: F };
|
|
1623
|
+
}
|
|
1624
|
+
const Mr = Oe.memo(function({ screen: t, route: n, navigation: r }) {
|
|
1625
|
+
return /* @__PURE__ */ m(fn, { screen: t, route: n, navigation: r });
|
|
1626
|
+
}), Er = Oe.memo(function({ store: t, layoutStore: n, route: r, ...o }) {
|
|
1627
|
+
const s = () => t.getSnapshot()[r.key], i = Ee(t.subscribe, s, s), u = Fe(n, hn, Ye);
|
|
1628
|
+
return /* @__PURE__ */ m(bn, { ...o, options: u, route: r, override: i });
|
|
1629
|
+
}), Pr = Oe.memo(function({ store: t, translate: n }) {
|
|
1630
|
+
const r = Ee(t.subscribe, t.getSnapshot, t.getSnapshot);
|
|
1631
|
+
return /* @__PURE__ */ m(wn, { loading: r, translate: n });
|
|
1632
|
+
}), Or = Oe.memo(function({ store: t, dismiss: n }) {
|
|
1633
|
+
const r = Ee(t.subscribe, t.getSnapshot, t.getSnapshot);
|
|
1634
|
+
return /* @__PURE__ */ m(kn, { items: r, dismiss: n });
|
|
1269
1635
|
});
|
|
1270
|
-
function
|
|
1271
|
-
const
|
|
1272
|
-
|
|
1273
|
-
const
|
|
1274
|
-
const
|
|
1275
|
-
if (
|
|
1276
|
-
if (
|
|
1277
|
-
const
|
|
1278
|
-
delete
|
|
1636
|
+
function Lr({ runtime: e, config: t, initialScreen: n, params: r, translate: o, onRequestClose: s, onOpened: i, registerLoading: u, notifyError: a, error: c, clearError: d, registerDirtyGuard: g, exiting: x = !1 }) {
|
|
1637
|
+
const b = Fe(e.stores.layout, Qn, Ye), h = n ?? t.initialRoute ?? Object.keys(t.screens)[0], [l, y] = Pe(() => e.stores.navigation.getSnapshot().currentRoute), C = G(l);
|
|
1638
|
+
C.current = l;
|
|
1639
|
+
const L = t.screens[h], S = e.alive, j = G(null), { navigation: D, footer: R, loading: k, toast: O } = e.refs, A = G("single"), { loadingApi: N, setLoading: W } = Sn(k, S, A, e), { toast: Q, dismissToast: ne } = xn(O, S, e), re = X((v, H) => {
|
|
1640
|
+
const ke = R.current, xe = ke.getSnapshot();
|
|
1641
|
+
if (H === null) {
|
|
1642
|
+
if (xe[v] !== void 0) {
|
|
1643
|
+
const Ae = { ...xe };
|
|
1644
|
+
delete Ae[v], ke.publish(Ae);
|
|
1279
1645
|
}
|
|
1280
|
-
} else
|
|
1281
|
-
}, []),
|
|
1282
|
-
navigate:
|
|
1646
|
+
} else xe[v] !== H && ke.publish({ ...xe, [v]: H });
|
|
1647
|
+
}, []), I = X((v = "api", H) => !S.current || k.current.getSnapshot().visible && e.stores.layout.getSnapshot().lockCloseWhileLoading !== !1 ? Promise.resolve(!1) : s(v, H), [s, e]), _ = X(() => Promise.resolve(!1), []), le = V(() => ({
|
|
1648
|
+
navigate: _,
|
|
1283
1649
|
navigateAsync: async () => ({ status: "cancelled" }),
|
|
1284
|
-
replace:
|
|
1285
|
-
reset:
|
|
1286
|
-
clearCache:
|
|
1287
|
-
goBack:
|
|
1288
|
-
push:
|
|
1289
|
-
pop:
|
|
1290
|
-
popToTop:
|
|
1291
|
-
popTo:
|
|
1292
|
-
setParams: (
|
|
1293
|
-
setOptions: (
|
|
1294
|
-
close:
|
|
1295
|
-
setLoading:
|
|
1650
|
+
replace: _,
|
|
1651
|
+
reset: _,
|
|
1652
|
+
clearCache: _,
|
|
1653
|
+
goBack: _,
|
|
1654
|
+
push: _,
|
|
1655
|
+
pop: _,
|
|
1656
|
+
popToTop: _,
|
|
1657
|
+
popTo: _,
|
|
1658
|
+
setParams: (v) => S.current ? (y((H) => ({ ...H, params: { ...H.params, ...typeof v == "function" ? v(H.params) : v } })), !0) : !1,
|
|
1659
|
+
setOptions: (v) => S.current ? (y((H) => ({ ...H, options: { ...H.options, ...v } })), !0) : !1,
|
|
1660
|
+
close: I,
|
|
1661
|
+
setLoading: W,
|
|
1296
1662
|
canGoBack: !1,
|
|
1297
|
-
stack: [
|
|
1298
|
-
currentRoute:
|
|
1299
|
-
}), [
|
|
1300
|
-
|
|
1301
|
-
const
|
|
1302
|
-
clearCache: (...
|
|
1303
|
-
navigate: (...
|
|
1304
|
-
navigateAsync: (...
|
|
1305
|
-
replace: (...
|
|
1306
|
-
reset: (...
|
|
1307
|
-
goBack: (...
|
|
1308
|
-
push: (...
|
|
1309
|
-
pop: (...
|
|
1310
|
-
popToTop: (...
|
|
1311
|
-
popTo: (...
|
|
1312
|
-
setParams: (...
|
|
1313
|
-
setOptions: (...
|
|
1314
|
-
close: (...
|
|
1315
|
-
setLoading: (...
|
|
1663
|
+
stack: [l],
|
|
1664
|
+
currentRoute: l
|
|
1665
|
+
}), [I, l, W, _]), E = G(le);
|
|
1666
|
+
E.current = le;
|
|
1667
|
+
const z = V(() => ({
|
|
1668
|
+
clearCache: (...v) => E.current.clearCache(...v),
|
|
1669
|
+
navigate: (...v) => E.current.navigate(...v),
|
|
1670
|
+
navigateAsync: (...v) => E.current.navigateAsync(...v),
|
|
1671
|
+
replace: (...v) => E.current.replace(...v),
|
|
1672
|
+
reset: (...v) => E.current.reset(...v),
|
|
1673
|
+
goBack: (...v) => E.current.goBack(...v),
|
|
1674
|
+
push: (...v) => E.current.push(...v),
|
|
1675
|
+
pop: (...v) => E.current.pop(...v),
|
|
1676
|
+
popToTop: (...v) => E.current.popToTop(...v),
|
|
1677
|
+
popTo: (...v) => E.current.popTo(...v),
|
|
1678
|
+
setParams: (...v) => E.current.setParams(...v),
|
|
1679
|
+
setOptions: (...v) => E.current.setOptions(...v),
|
|
1680
|
+
close: (...v) => E.current.close(...v),
|
|
1681
|
+
setLoading: (...v) => E.current.setLoading(...v)
|
|
1316
1682
|
}), []);
|
|
1317
|
-
|
|
1318
|
-
const
|
|
1319
|
-
setLoading: (
|
|
1320
|
-
showLoading: (
|
|
1321
|
-
hideLoading: (
|
|
1322
|
-
}), [
|
|
1323
|
-
|
|
1324
|
-
D.current.publish({ canGoBack: !1, stack: [
|
|
1325
|
-
}, [
|
|
1326
|
-
const
|
|
1327
|
-
|
|
1328
|
-
|
|
1683
|
+
Se(() => e.registerNavigation(z), [e, z]);
|
|
1684
|
+
const K = V(() => ({
|
|
1685
|
+
setLoading: (v, H) => N.setScreenLoading("single", v, H),
|
|
1686
|
+
showLoading: (v) => N.begin("single", v),
|
|
1687
|
+
hideLoading: (v) => N.end("single", v)
|
|
1688
|
+
}), [N]), P = V(() => ({ isFocused: !0, resultEvent: null, routeKey: "single", setFooter: re }), [re]), F = V(() => ({ routeKey: "single", registerDirtyGuard: g }), [g]);
|
|
1689
|
+
ee(() => {
|
|
1690
|
+
D.current.publish({ canGoBack: !1, stack: [l], currentRoute: l });
|
|
1691
|
+
}, [l]);
|
|
1692
|
+
const Z = G(!1);
|
|
1693
|
+
ee(() => (u?.({ setLoading: W }), Z.current || (Z.current = !0, i?.({ route: C.current, stack: [C.current] })), () => {
|
|
1694
|
+
u?.(null);
|
|
1329
1695
|
}), []);
|
|
1330
|
-
const
|
|
1331
|
-
return /* @__PURE__ */
|
|
1332
|
-
/* @__PURE__ */
|
|
1333
|
-
/* @__PURE__ */
|
|
1334
|
-
/* @__PURE__ */
|
|
1335
|
-
/* @__PURE__ */
|
|
1336
|
-
/* @__PURE__ */
|
|
1337
|
-
|
|
1338
|
-
/* @__PURE__ */
|
|
1339
|
-
/* @__PURE__ */
|
|
1696
|
+
const de = V(() => ({ ...L, ...l.options }), [L, l.options]), te = e.refs.header;
|
|
1697
|
+
return /* @__PURE__ */ m(Lt.Provider, { value: te.current, children: /* @__PURE__ */ m($t.Provider, { value: Q, children: /* @__PURE__ */ m(ln.Provider, { value: O.current, children: /* @__PURE__ */ m(cn.Provider, { value: R.current, children: /* @__PURE__ */ m(an.Provider, { value: le, children: /* @__PURE__ */ m(Et.Provider, { value: z, children: /* @__PURE__ */ m(Pt.Provider, { value: D.current, children: /* @__PURE__ */ m(st.Provider, { value: N, children: /* @__PURE__ */ Me(yn, { store: e.stores.layout, screenOptions: de.modalOptions, dialogRef: j, requestClose: I, exiting: x, children: [
|
|
1698
|
+
/* @__PURE__ */ m(vn, { store: e.stores.layout, screen: de, route: l, navigation: le, requestClose: I, translate: o, canGoBack: !1 }),
|
|
1699
|
+
/* @__PURE__ */ m("main", { className: "pmn-main", children: /* @__PURE__ */ m(Je.Provider, { value: l, children: /* @__PURE__ */ m(It.Provider, { value: F, children: /* @__PURE__ */ m(at.Provider, { value: P, children: /* @__PURE__ */ m(st.Provider, { value: K, children: /* @__PURE__ */ m(Ot.Provider, { value: k.current, children: /* @__PURE__ */ m("div", { className: `pmn-body ${b.bodyClassName ?? ""}`, "data-modal-route-key": "single", tabIndex: -1, children: /* @__PURE__ */ m(Tt, { route: l, onError: a, children: /* @__PURE__ */ m(qt, { fallback: b.lazyFallback ?? /* @__PURE__ */ m("div", { className: "pmn-lazy-loading", role: "status", "aria-live": "polite", children: "加载中..." }), children: /* @__PURE__ */ m(Mr, { screen: L, route: l, navigation: le }) }) }) }) }) }) }) }) }) }),
|
|
1700
|
+
/* @__PURE__ */ m(Er, { store: R.current, route: l, screen: de, layoutStore: e.stores.layout, navigation: le, requestClose: I, translate: o, onError: a, loadingApi: N }),
|
|
1701
|
+
/* @__PURE__ */ m(Pr, { store: k.current, translate: o }),
|
|
1702
|
+
/* @__PURE__ */ m(Or, { store: O.current, dismiss: ne }),
|
|
1703
|
+
c && /* @__PURE__ */ Me("div", { className: "pmn-error", role: "alert", children: [
|
|
1704
|
+
/* @__PURE__ */ m("span", { children: c.message || String(c) }),
|
|
1705
|
+
/* @__PURE__ */ m("button", { type: "button", onClick: d, children: "×" })
|
|
1340
1706
|
] })
|
|
1341
1707
|
] }) }) }) }) }) }) }) }) });
|
|
1342
1708
|
}
|
|
1343
|
-
const
|
|
1344
|
-
const { active: n, options: r, exiting: o, error:
|
|
1345
|
-
n?.runtime.alive.current && t.hostStore.getSnapshot().active?.id ===
|
|
1346
|
-
}, [t, n,
|
|
1709
|
+
const Tr = pt(hr), Ar = pt(Lr), jr = pt(function({ manager: t }) {
|
|
1710
|
+
const { active: n, options: r, exiting: o, error: s, translate: i } = Ee(t.hostStore.subscribe, t.hostStore.getSnapshot, t.hostStore.getSnapshot), u = n?.id, a = n?.runtime.bindings, c = V(() => (g, x) => {
|
|
1711
|
+
n?.runtime.alive.current && t.hostStore.getSnapshot().active?.id === u && t.reportError(g, x);
|
|
1712
|
+
}, [t, n, u]);
|
|
1347
1713
|
if (!n) return null;
|
|
1348
|
-
const d = n.config.singlePage || Object.keys(n.config.screens ?? {}).length === 1 ?
|
|
1349
|
-
return /* @__PURE__ */
|
|
1350
|
-
}), ir = ".pmn-overlay,.pmn-dialog,.pmn-dialog *{box-sizing:border-box}.pmn-overlay{position:fixed;inset:0;z-index:1000;display:flex;overscroll-behavior:none;background:#00000073}.pmn-place-right{justify-content:flex-end;align-items:stretch}.pmn-place-left{justify-content:flex-start;align-items:stretch}.pmn-place-center{justify-content:center;align-items:center}.pmn-place-top{justify-content:center;align-items:flex-start}.pmn-place-bottom{justify-content:center;align-items:flex-end}.pmn-dialog{--pmn-surface:#fff;--pmn-body:#fff;--pmn-text:#0f172a;--pmn-muted:#475569;--pmn-border:#e2e8f0;--pmn-hover:#f1f5f9;--pmn-overlay-card:rgba(255,255,255,.92);color-scheme:light;position:relative;display:flex;flex-direction:column;min-height:0;width:100%;max-width:min(calc(100vw - var(--pmn-gap)*2),var(--pmn-max-width, var(--pmn-width)));max-height:min(calc(100dvh - var(--pmn-gap)*2),var(--pmn-max-height, 100dvh));height:var(--pmn-height, 100%);overflow:hidden;outline:none;box-shadow:0 25px 50px -12px #00000040;background:var(--pmn-surface);color:var(--pmn-text)}.pmn-place-left .pmn-dialog,.pmn-place-right .pmn-dialog{height:calc(100dvh - var(--pmn-gap)*2);max-height:calc(100dvh - var(--pmn-gap)*2)}.pmn-place-center .pmn-dialog{height:var(--pmn-height, auto);min-height:150px}.pmn-place-top .pmn-dialog,.pmn-place-bottom .pmn-dialog{height:var(--pmn-height, auto);min-height:0}.pmn-dialog[data-modal-theme=dark]{--pmn-surface:#334155;--pmn-body:#334155;--pmn-text:#f1f5f9;--pmn-muted:#cbd5e1;--pmn-border:#475569;--pmn-hover:#1e293b;--pmn-overlay-card:rgba(51,65,85,.94);color-scheme:dark}.pmn-main{min-height:0;flex:1;overflow:hidden;display:flex;flex-direction:column;background:transparent}.pmn-body{height:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px;flex:1}.pmn-body[hidden]{display:none!important}.pmn-header{display:flex;flex-shrink:0;height:64px;align-items:center;gap:12px;padding:0 20px;background:transparent}.pmn-header h2{font-size:18px;font-weight:600;min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.pmn-header-spacer{flex:1}.pmn-border-bottom{border-bottom:1px solid var(--pmn-border)}.pmn-icon-button{display:inline-flex;align-items:center;justify-content:center;padding:8px;border:0;background:transparent;color:inherit;border-radius:8px;cursor:pointer}.pmn-icon-button:hover{background:var(--pmn-hover)}.pmn-footer{display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;gap:12px;padding:16px 20px;background:transparent}.pmn-border-top{border-top:1px solid var(--pmn-border)}.pmn-button{padding:8px 16px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer}.pmn-button:disabled{opacity:.5;cursor:not-allowed}.pmn-button-secondary{border:1px solid var(--pmn-border);background:transparent;color:var(--pmn-text)}.pmn-button-secondary:hover:not(:disabled){background:var(--pmn-hover)}.pmn-button-primary{border:1px solid #2563eb;background:#2563eb;color:#fff}.pmn-button-primary:hover:not(:disabled){background:#1d4ed8}.pmn-loading-overlay{position:absolute;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;background:#ffffffb8;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);cursor:progress}.pmn-dialog[data-modal-theme=dark] .pmn-loading-overlay{background:#0f172ab8}.pmn-loading-content{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;max-width:85%;text-align:center;color:var(--pmn-text);pointer-events:none}.pmn-loading-text{font-size:14px;font-weight:500;line-height:1.5;overflow-wrap:anywhere}.pmn-spinner{width:38px;height:38px;border:3px solid rgba(37,99,235,.2);border-top-color:#2563eb;border-radius:50%;animation:pmn-spin .8s linear infinite}@keyframes pmn-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.pmn-spinner{animation-duration:1.8s}}.pmn-error{position:absolute;z-index:60;bottom:8px;left:12px;right:12px;display:flex;justify-content:space-between;gap:12px;padding:12px;border:1px solid #fca5a5;border-radius:8px;background:#fef2f2;color:#991b1b;font-size:13px}.pmn-error button{border:0;background:transparent;font-size:20px;cursor:pointer;color:inherit}.pmn-dialog input:not([type=checkbox]):not([type=radio]),.pmn-dialog textarea,.pmn-dialog select{color:var(--pmn-text);border-color:var(--pmn-border)}.pmn-error-screen{padding:24px;color:var(--pmn-text)}.pmn-error-screen p{color:#dc2626;overflow-wrap:anywhere}@media(max-width:640px){.pmn-overlay.pmn-mobile-fullscreen{padding:0!important}.pmn-mobile-fullscreen .pmn-dialog{max-width:100%;width:100%;height:100dvh;max-height:100dvh;border-radius:0!important}}@media(prefers-reduced-motion:reduce){.pmn-spinner{animation-duration:2s}}@keyframes pmn-fade-in{0%{opacity:0}to{opacity:1}}@keyframes pmn-fade-out{0%{opacity:1}to{opacity:0}}@keyframes pmn-scale-in{0%{opacity:0;transform:translateY(10px) scale(.97)}to{opacity:1;transform:none}}@keyframes pmn-scale-out{0%{opacity:1;transform:none}to{opacity:0;transform:translateY(10px) scale(.97)}}@keyframes pmn-right-in{0%{transform:translate(105%)}to{transform:none}}@keyframes pmn-right-out{0%{transform:none}to{transform:translate(105%)}}@keyframes pmn-left-in{0%{transform:translate(-105%)}to{transform:none}}@keyframes pmn-left-out{0%{transform:none}to{transform:translate(-105%)}}@keyframes pmn-top-in{0%{transform:translateY(-105%)}to{transform:none}}@keyframes pmn-top-out{0%{transform:none}to{transform:translateY(-105%)}}@keyframes pmn-bottom-in{0%{transform:translateY(105%)}to{transform:none}}@keyframes pmn-bottom-out{0%{transform:none}to{transform:translateY(105%)}}.pmn-entering{animation:pmn-fade-in var(--pmn-animation-duration) ease-out both}.pmn-exiting{animation:pmn-fade-out var(--pmn-animation-duration) ease-in both;pointer-events:none}.pmn-entering .pmn-dialog{animation:pmn-scale-in var(--pmn-animation-duration) cubic-bezier(.2,.8,.2,1) both}.pmn-exiting .pmn-dialog{animation:pmn-scale-out var(--pmn-animation-duration) ease-in both}.pmn-entering.pmn-place-right .pmn-dialog{animation-name:pmn-right-in}.pmn-exiting.pmn-place-right .pmn-dialog{animation-name:pmn-right-out}.pmn-entering.pmn-place-left .pmn-dialog{animation-name:pmn-left-in}.pmn-exiting.pmn-place-left .pmn-dialog{animation-name:pmn-left-out}.pmn-entering.pmn-place-top .pmn-dialog{animation-name:pmn-top-in}.pmn-exiting.pmn-place-top .pmn-dialog{animation-name:pmn-top-out}.pmn-entering.pmn-place-bottom .pmn-dialog{animation-name:pmn-bottom-in}.pmn-exiting.pmn-place-bottom .pmn-dialog{animation-name:pmn-bottom-out}.pmn-no-animation,.pmn-no-animation .pmn-dialog{animation:none!important}@media(prefers-reduced-motion:reduce){.pmn-entering,.pmn-exiting,.pmn-entering .pmn-dialog,.pmn-exiting .pmn-dialog{animation:none!important}}.pmn-toast-region{position:absolute;top:56px;left:12px;right:12px;z-index:80;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;max-height:calc(100% - 72px);overflow:hidden}.pmn-toast{pointer-events:auto;display:flex;align-items:flex-start;gap:10px;width:max-content;max-width:100%;min-width:min(260px,100%);padding:11px 13px;border:1px solid var(--pmn-border);border-radius:9px;background:var(--pmn-surface);color:var(--pmn-text);box-shadow:0 5px 18px #0000001a;font-size:13px;line-height:1.5;overflow-wrap:anywhere}.pmn-toast-symbol{flex:0 0 20px;display:grid;place-items:center;width:20px;height:20px;border-radius:50%;font-size:13px;font-weight:700;background:var(--pmn-hover);color:var(--pmn-muted)}.pmn-toast-success .pmn-toast-symbol{background:#dcfce7;color:#15803d}.pmn-toast-error .pmn-toast-symbol{background:#fee2e2;color:#b91c1c}.pmn-toast-warning .pmn-toast-symbol{background:#fef3c7;color:#b45309}.pmn-toast-info .pmn-toast-symbol{background:#dbeafe;color:#1d4ed8}.pmn-toast-message{flex:1;min-width:0;white-space:pre-wrap}.pmn-toast-close{border:0;background:transparent;color:var(--pmn-muted);cursor:pointer;font-size:19px;line-height:18px;padding:0 1px}.pmn-toast-close:hover{color:var(--pmn-text)}.pmn-button-danger{background:#dc2626!important;color:#fff!important;border-color:#dc2626!important}@keyframes pmn-page-forward-in{0%{opacity:.18;transform:translate3d(var(--pmn-page-distance,96px),0,0) scale(.985)}to{opacity:1;transform:translateZ(0)}}@keyframes pmn-page-back-in{0%{opacity:.18;transform:translate3d(calc(-1 * var(--pmn-page-distance,96px)),0,0) scale(.985)}to{opacity:1;transform:translateZ(0)}}.pmn-page-enter{animation-duration:var(--pmn-page-duration,.36s);animation-timing-function:cubic-bezier(.2,.8,.2,1);animation-fill-mode:both;will-change:transform,opacity}.pmn-page-forward{animation-name:pmn-page-forward-in}.pmn-page-back{animation-name:pmn-page-back-in}@media(prefers-reduced-motion:reduce){.pmn-page-enter{animation:none!important;will-change:auto}}.pmn-main{position:relative;isolation:isolate}.pmn-page-exit{animation-duration:var(--pmn-page-duration,.36s);animation-timing-function:cubic-bezier(.22,1,.36,1);animation-fill-mode:forwards}@keyframes pmn-page-forward-out{to{opacity:.45;transform:translate3d(calc(-1 * var(--pmn-page-distance,96px)),0,0) scale(.985)}}@keyframes pmn-page-back-out{to{opacity:.45;transform:translate3d(var(--pmn-page-distance,96px),0,0) scale(.985)}}.pmn-page-exit-forward{animation-name:pmn-page-forward-out}.pmn-page-exit-back{animation-name:pmn-page-back-out}@media(prefers-reduced-motion:reduce){.pmn-page-exit{animation:none!important}}.pmn-main>.pmn-body{position:relative;width:100%;flex:1 0 100%;background:var(--pmn-body)}.pmn-page-forward,.pmn-page-back{z-index:2}@keyframes pmn-page-forward-in{0%{opacity:1;transform:translate3d(100%,0,0)}to{opacity:1;transform:translateZ(0)}}@keyframes pmn-page-back-in{0%{opacity:1;transform:translate3d(-100%,0,0)}to{opacity:1;transform:translateZ(0)}}@keyframes pmn-page-forward-out{to{opacity:1;transform:translate3d(-100%,0,0)}}@keyframes pmn-page-back-out{to{opacity:1;transform:translate3d(100%,0,0)}}.pmn-lazy-loading{display:flex;min-height:80px;align-items:center;justify-content:center;color:var(--pmn-muted);font-size:14px}.pmn-place-top .pmn-dialog{max-height:min(calc(100dvh - var(--pmn-top-offset, var(--pmn-gap)) - var(--pmn-gap)),var(--pmn-max-height,100dvh))}.pmn-dialog.pmn-has-custom-background{isolation:isolate;--pmn-body:transparent}.pmn-custom-background-layer{position:absolute;inset:0;z-index:0;pointer-events:none}.pmn-dialog.pmn-has-custom-background>:not(.pmn-custom-background-layer){position:relative;z-index:1}.pmn-dialog.pmn-has-custom-background .pmn-main>.pmn-body{background:transparent}.pmn-overlay.pmn-fullscreen{padding:0!important;align-items:stretch;justify-content:stretch}.pmn-overlay.pmn-fullscreen .pmn-dialog{width:100%;max-width:100%;height:100%;max-height:100%;border-radius:0!important}.pmn-place-left .pmn-dialog,.pmn-place-right .pmn-dialog{height:100%;max-height:100%}.pmn-place-center .pmn-dialog{max-height:100%}.pmn-dialog{max-width:min(100%,var(--pmn-drag-width,var(--pmn-max-width,var(--pmn-width))));max-height:min(100%,var(--pmn-max-height,100dvh))}.pmn-dialog .pmn-resize-handle{position:absolute;z-index:5;top:0;bottom:0;width:10px;cursor:ew-resize;touch-action:none;-webkit-user-select:none;user-select:none}.pmn-resize-left{right:0}.pmn-resize-right{left:0}.pmn-resize-handle:hover,.pmn-resize-handle:focus-visible{background:var(--pmn-border)}@media(max-width:640px){.pmn-mobile-fullscreen .pmn-resize-handle{display:none}}.pmn-dialog{max-width:min(100%,var(--pmn-max-width,100%),var(--pmn-drag-width,var(--pmn-width)))}.pmn-overlay.pmn-fullscreen .pmn-dialog{max-width:100%}", Kt = "react-modal-navigation-styles", Ot = /* @__PURE__ */ new WeakMap();
|
|
1351
|
-
function
|
|
1352
|
-
|
|
1714
|
+
const d = n.config.singlePage || Object.keys(n.config.screens ?? {}).length === 1 ? Ar : Tr;
|
|
1715
|
+
return /* @__PURE__ */ m(We.Provider, { value: n.runtime, children: /* @__PURE__ */ m(d, { runtime: n.runtime, config: n.config, initialScreen: n.screen, params: n.params, options: r, translate: i, notifyError: c, error: s, clearError: t.commands.clearError, exiting: o, ...a }, u) });
|
|
1716
|
+
}), zr = ".pmn-overlay,.pmn-dialog,.pmn-dialog *{box-sizing:border-box}.pmn-overlay{position:fixed;inset:0;z-index:1000;display:flex;overscroll-behavior:none;background:#00000073}.pmn-place-right{justify-content:flex-end;align-items:stretch}.pmn-place-left{justify-content:flex-start;align-items:stretch}.pmn-place-center{justify-content:center;align-items:center}.pmn-place-top{justify-content:center;align-items:flex-start}.pmn-place-bottom{justify-content:center;align-items:flex-end}.pmn-dialog{--pmn-surface:#fff;--pmn-body:#fff;--pmn-text:#0f172a;--pmn-muted:#475569;--pmn-border:#e2e8f0;--pmn-hover:#f1f5f9;--pmn-overlay-card:rgba(255,255,255,.92);color-scheme:light;position:relative;display:flex;flex-direction:column;min-height:0;width:100%;max-width:min(calc(100vw - var(--pmn-gap)*2),var(--pmn-max-width, var(--pmn-width)));max-height:min(calc(100dvh - var(--pmn-gap)*2),var(--pmn-max-height, 100dvh));height:var(--pmn-height, 100%);overflow:hidden;outline:none;box-shadow:0 25px 50px -12px #00000040;background:var(--pmn-surface);color:var(--pmn-text)}.pmn-place-left .pmn-dialog,.pmn-place-right .pmn-dialog{height:calc(100dvh - var(--pmn-gap)*2);max-height:calc(100dvh - var(--pmn-gap)*2)}.pmn-place-center .pmn-dialog{height:var(--pmn-height, auto);min-height:150px}.pmn-place-top .pmn-dialog,.pmn-place-bottom .pmn-dialog{height:var(--pmn-height, auto);min-height:0}.pmn-dialog[data-modal-theme=dark]{--pmn-surface:#334155;--pmn-body:#334155;--pmn-text:#f1f5f9;--pmn-muted:#cbd5e1;--pmn-border:#475569;--pmn-hover:#1e293b;--pmn-overlay-card:rgba(51,65,85,.94);color-scheme:dark}.pmn-main{min-height:0;flex:1;overflow:hidden;display:flex;flex-direction:column;background:transparent}.pmn-body{height:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px;flex:1}.pmn-body[hidden]{display:none!important}.pmn-header{display:flex;flex-shrink:0;height:64px;align-items:center;gap:12px;padding:0 20px;background:transparent}.pmn-header h2{font-size:18px;font-weight:600;min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.pmn-header-spacer{flex:1}.pmn-border-bottom{border-bottom:1px solid var(--pmn-border)}.pmn-icon-button{display:inline-flex;align-items:center;justify-content:center;padding:8px;border:0;background:transparent;color:inherit;border-radius:8px;cursor:pointer}.pmn-icon-button:hover{background:var(--pmn-hover)}.pmn-footer{display:flex;flex-shrink:0;align-items:center;justify-content:flex-end;gap:12px;padding:16px 20px;background:transparent}.pmn-border-top{border-top:1px solid var(--pmn-border)}.pmn-button{padding:8px 16px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer}.pmn-button:disabled{opacity:.5;cursor:not-allowed}.pmn-button-secondary{border:1px solid var(--pmn-border);background:transparent;color:var(--pmn-text)}.pmn-button-secondary:hover:not(:disabled){background:var(--pmn-hover)}.pmn-button-primary{border:1px solid #2563eb;background:#2563eb;color:#fff}.pmn-button-primary:hover:not(:disabled){background:#1d4ed8}.pmn-loading-overlay{position:absolute;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;background:#ffffffb8;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);cursor:progress}.pmn-dialog[data-modal-theme=dark] .pmn-loading-overlay{background:#0f172ab8}.pmn-loading-content{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;max-width:85%;text-align:center;color:var(--pmn-text);pointer-events:none}.pmn-loading-text{font-size:14px;font-weight:500;line-height:1.5;overflow-wrap:anywhere}.pmn-spinner{width:38px;height:38px;border:3px solid rgba(37,99,235,.2);border-top-color:#2563eb;border-radius:50%;animation:pmn-spin .8s linear infinite}@keyframes pmn-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.pmn-spinner{animation-duration:1.8s}}.pmn-error{position:absolute;z-index:60;bottom:8px;left:12px;right:12px;display:flex;justify-content:space-between;gap:12px;padding:12px;border:1px solid #fca5a5;border-radius:8px;background:#fef2f2;color:#991b1b;font-size:13px}.pmn-error button{border:0;background:transparent;font-size:20px;cursor:pointer;color:inherit}.pmn-dialog input:not([type=checkbox]):not([type=radio]),.pmn-dialog textarea,.pmn-dialog select{color:var(--pmn-text);border-color:var(--pmn-border)}.pmn-error-screen{padding:24px;color:var(--pmn-text)}.pmn-error-screen p{color:#dc2626;overflow-wrap:anywhere}@media(max-width:640px){.pmn-overlay.pmn-mobile-fullscreen{padding:0!important}.pmn-mobile-fullscreen .pmn-dialog{max-width:100%;width:100%;height:100dvh;max-height:100dvh;border-radius:0!important}}@media(prefers-reduced-motion:reduce){.pmn-spinner{animation-duration:2s}}@keyframes pmn-fade-in{0%{opacity:0}to{opacity:1}}@keyframes pmn-fade-out{0%{opacity:1}to{opacity:0}}@keyframes pmn-scale-in{0%{opacity:0;transform:translateY(10px) scale(.97)}to{opacity:1;transform:none}}@keyframes pmn-scale-out{0%{opacity:1;transform:none}to{opacity:0;transform:translateY(10px) scale(.97)}}@keyframes pmn-right-in{0%{transform:translate(105%)}to{transform:none}}@keyframes pmn-right-out{0%{transform:none}to{transform:translate(105%)}}@keyframes pmn-left-in{0%{transform:translate(-105%)}to{transform:none}}@keyframes pmn-left-out{0%{transform:none}to{transform:translate(-105%)}}@keyframes pmn-top-in{0%{transform:translateY(-105%)}to{transform:none}}@keyframes pmn-top-out{0%{transform:none}to{transform:translateY(-105%)}}@keyframes pmn-bottom-in{0%{transform:translateY(105%)}to{transform:none}}@keyframes pmn-bottom-out{0%{transform:none}to{transform:translateY(105%)}}.pmn-entering{animation:pmn-fade-in var(--pmn-animation-duration) ease-out both}.pmn-exiting{animation:pmn-fade-out var(--pmn-animation-duration) ease-in both;pointer-events:none}.pmn-entering .pmn-dialog{animation:pmn-scale-in var(--pmn-animation-duration) cubic-bezier(.2,.8,.2,1) both}.pmn-exiting .pmn-dialog{animation:pmn-scale-out var(--pmn-animation-duration) ease-in both}.pmn-entering.pmn-place-right .pmn-dialog{animation-name:pmn-right-in}.pmn-exiting.pmn-place-right .pmn-dialog{animation-name:pmn-right-out}.pmn-entering.pmn-place-left .pmn-dialog{animation-name:pmn-left-in}.pmn-exiting.pmn-place-left .pmn-dialog{animation-name:pmn-left-out}.pmn-entering.pmn-place-top .pmn-dialog{animation-name:pmn-top-in}.pmn-exiting.pmn-place-top .pmn-dialog{animation-name:pmn-top-out}.pmn-entering.pmn-place-bottom .pmn-dialog{animation-name:pmn-bottom-in}.pmn-exiting.pmn-place-bottom .pmn-dialog{animation-name:pmn-bottom-out}.pmn-no-animation,.pmn-no-animation .pmn-dialog{animation:none!important}@media(prefers-reduced-motion:reduce){.pmn-entering,.pmn-exiting,.pmn-entering .pmn-dialog,.pmn-exiting .pmn-dialog{animation:none!important}}.pmn-toast-region{position:absolute;top:56px;left:12px;right:12px;z-index:80;display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;max-height:calc(100% - 72px);overflow:hidden}.pmn-toast{pointer-events:auto;display:flex;align-items:flex-start;gap:10px;width:max-content;max-width:100%;min-width:min(260px,100%);padding:11px 13px;border:1px solid var(--pmn-border);border-radius:9px;background:var(--pmn-surface);color:var(--pmn-text);box-shadow:0 5px 18px #0000001a;font-size:13px;line-height:1.5;overflow-wrap:anywhere}.pmn-toast-symbol{flex:0 0 20px;display:grid;place-items:center;width:20px;height:20px;border-radius:50%;font-size:13px;font-weight:700;background:var(--pmn-hover);color:var(--pmn-muted)}.pmn-toast-success .pmn-toast-symbol{background:#dcfce7;color:#15803d}.pmn-toast-error .pmn-toast-symbol{background:#fee2e2;color:#b91c1c}.pmn-toast-warning .pmn-toast-symbol{background:#fef3c7;color:#b45309}.pmn-toast-info .pmn-toast-symbol{background:#dbeafe;color:#1d4ed8}.pmn-toast-message{flex:1;min-width:0;white-space:pre-wrap}.pmn-toast-close{border:0;background:transparent;color:var(--pmn-muted);cursor:pointer;font-size:19px;line-height:18px;padding:0 1px}.pmn-toast-close:hover{color:var(--pmn-text)}.pmn-button-danger{background:#dc2626!important;color:#fff!important;border-color:#dc2626!important}@keyframes pmn-page-forward-in{0%{opacity:.18;transform:translate3d(var(--pmn-page-distance,96px),0,0) scale(.985)}to{opacity:1;transform:translateZ(0)}}@keyframes pmn-page-back-in{0%{opacity:.18;transform:translate3d(calc(-1 * var(--pmn-page-distance,96px)),0,0) scale(.985)}to{opacity:1;transform:translateZ(0)}}.pmn-page-enter{animation-duration:var(--pmn-page-duration,.36s);animation-timing-function:cubic-bezier(.2,.8,.2,1);animation-fill-mode:both;will-change:transform,opacity}.pmn-page-forward{animation-name:pmn-page-forward-in}.pmn-page-back{animation-name:pmn-page-back-in}@media(prefers-reduced-motion:reduce){.pmn-page-enter{animation:none!important;will-change:auto}}.pmn-main{position:relative;isolation:isolate}.pmn-page-exit{animation-duration:var(--pmn-page-duration,.36s);animation-timing-function:cubic-bezier(.22,1,.36,1);animation-fill-mode:forwards}@keyframes pmn-page-forward-out{to{opacity:.45;transform:translate3d(calc(-1 * var(--pmn-page-distance,96px)),0,0) scale(.985)}}@keyframes pmn-page-back-out{to{opacity:.45;transform:translate3d(var(--pmn-page-distance,96px),0,0) scale(.985)}}.pmn-page-exit-forward{animation-name:pmn-page-forward-out}.pmn-page-exit-back{animation-name:pmn-page-back-out}@media(prefers-reduced-motion:reduce){.pmn-page-exit{animation:none!important}}.pmn-main>.pmn-body{position:relative;width:100%;flex:1 0 100%;background:var(--pmn-body)}.pmn-page-forward,.pmn-page-back{z-index:2}@keyframes pmn-page-forward-in{0%{opacity:1;transform:translate3d(100%,0,0)}to{opacity:1;transform:translateZ(0)}}@keyframes pmn-page-back-in{0%{opacity:1;transform:translate3d(-100%,0,0)}to{opacity:1;transform:translateZ(0)}}@keyframes pmn-page-forward-out{to{opacity:1;transform:translate3d(-100%,0,0)}}@keyframes pmn-page-back-out{to{opacity:1;transform:translate3d(100%,0,0)}}.pmn-lazy-loading{display:flex;min-height:80px;align-items:center;justify-content:center;color:var(--pmn-muted);font-size:14px}.pmn-place-top .pmn-dialog{max-height:min(calc(100dvh - var(--pmn-top-offset, var(--pmn-gap)) - var(--pmn-gap)),var(--pmn-max-height,100dvh))}.pmn-dialog.pmn-has-custom-background{isolation:isolate;--pmn-body:transparent}.pmn-custom-background-layer{position:absolute;inset:0;z-index:0;pointer-events:none}.pmn-dialog.pmn-has-custom-background>:not(.pmn-custom-background-layer){position:relative;z-index:1}.pmn-dialog.pmn-has-custom-background .pmn-main>.pmn-body{background:transparent}.pmn-overlay.pmn-fullscreen{padding:0!important;align-items:stretch;justify-content:stretch}.pmn-overlay.pmn-fullscreen .pmn-dialog{width:100%;max-width:100%;height:100%;max-height:100%;border-radius:0!important}.pmn-place-left .pmn-dialog,.pmn-place-right .pmn-dialog{height:100%;max-height:100%}.pmn-place-center .pmn-dialog{max-height:100%}.pmn-dialog{max-width:min(100%,var(--pmn-drag-width,var(--pmn-max-width,var(--pmn-width))));max-height:min(100%,var(--pmn-max-height,100dvh))}.pmn-dialog .pmn-resize-handle{position:absolute;z-index:5;top:0;bottom:0;width:10px;cursor:ew-resize;touch-action:none;-webkit-user-select:none;user-select:none}.pmn-resize-left{right:0}.pmn-resize-right{left:0}.pmn-resize-handle:hover,.pmn-resize-handle:focus-visible{background:var(--pmn-border)}@media(max-width:640px){.pmn-mobile-fullscreen .pmn-resize-handle{display:none}}.pmn-dialog{max-width:min(100%,var(--pmn-max-width,100%),var(--pmn-drag-width,var(--pmn-width)))}.pmn-overlay.pmn-fullscreen .pmn-dialog{max-width:100%}.pmn-persistent-layout{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}.pmn-persistent-layout[hidden]{display:none!important}", tn = "react-modal-navigation-styles", Gt = /* @__PURE__ */ new WeakMap();
|
|
1717
|
+
function Nr() {
|
|
1718
|
+
rn(() => {
|
|
1353
1719
|
if (typeof document > "u") return;
|
|
1354
1720
|
const e = document;
|
|
1355
|
-
let t =
|
|
1721
|
+
let t = Gt.get(e);
|
|
1356
1722
|
if (!t) {
|
|
1357
|
-
let n = e.getElementById(
|
|
1723
|
+
let n = e.getElementById(tn);
|
|
1358
1724
|
const r = !n;
|
|
1359
|
-
n || (n = e.createElement("style"), n.id =
|
|
1725
|
+
n || (n = e.createElement("style"), n.id = tn, n.setAttribute("data-react-modal-navigation", ""), n.textContent = zr, e.head.appendChild(n)), t = { element: n, owned: r, count: 0 }, Gt.set(e, t);
|
|
1360
1726
|
}
|
|
1361
1727
|
return t.count += 1, () => {
|
|
1362
|
-
t.count -= 1, t.count === 0 && (t.owned && t.element.remove(),
|
|
1728
|
+
t.count -= 1, t.count === 0 && (t.owned && t.element.remove(), Gt.delete(e));
|
|
1363
1729
|
};
|
|
1364
1730
|
}, []);
|
|
1365
1731
|
}
|
|
1366
|
-
const
|
|
1367
|
-
function
|
|
1368
|
-
|
|
1369
|
-
const
|
|
1370
|
-
return
|
|
1371
|
-
|
|
1372
|
-
}, [
|
|
1732
|
+
const Br = Object.freeze({}), Gr = (e) => ({ "modal.loading": "加载中...", "modal.processing": "处理中...", "modal.back": "返回", "modal.close": "关闭", "modal.cancel": "取消", "modal.done": "完成" })[e] ?? e;
|
|
1733
|
+
function co({ children: e, registry: t, defaultOptions: n = Br, backgroundColor: r, theme: o, translate: s = Gr, onError: i, confirmDiscard: u }) {
|
|
1734
|
+
Nr();
|
|
1735
|
+
const a = { registry: t, defaultOptions: n, backgroundColor: r, theme: o, translate: s, onError: i, confirmDiscard: u }, [c] = Pe(() => Cr(a, yr));
|
|
1736
|
+
return Se(() => (c.mount(), c.destroy), [c]), Se(() => {
|
|
1737
|
+
c.configure(a);
|
|
1738
|
+
}, [c, t, n, r, o, s, i, u]), /* @__PURE__ */ m(Dt.Provider, { value: c.commands, children: /* @__PURE__ */ m(Kt.Provider, { value: c.statusStore, children: /* @__PURE__ */ Me(sn.Provider, { value: c.commands, children: [
|
|
1373
1739
|
e,
|
|
1374
|
-
/* @__PURE__ */
|
|
1740
|
+
/* @__PURE__ */ m(jr, { manager: c })
|
|
1375
1741
|
] }) }) });
|
|
1376
1742
|
}
|
|
1377
|
-
const
|
|
1378
|
-
},
|
|
1379
|
-
function
|
|
1380
|
-
const t =
|
|
1743
|
+
const Fr = Object.freeze({ canGoBack: !1, stack: [], currentRoute: null }), nn = () => () => {
|
|
1744
|
+
}, St = () => Fr;
|
|
1745
|
+
function lo({ subscribe: e = !0 } = {}) {
|
|
1746
|
+
const t = Y(sn), n = Y(Kt), r = Ee(e && n?.subscribe || nn, e && n?.getSnapshot || St, e && n?.getSnapshot || St), o = V(() => t ? e ? { ...t, ...r } : t : null, [t, r, e]), s = Y(Et), i = Y(Pt), u = Ee(e && i?.subscribe || nn, e && i?.getSnapshot || St, e && i?.getSnapshot || St);
|
|
1381
1747
|
if (!o) throw new Error("[react-modal-navigation] useModal requires <ModalProvider>");
|
|
1382
|
-
const
|
|
1383
|
-
const
|
|
1384
|
-
if (!
|
|
1385
|
-
return
|
|
1748
|
+
const a = V(() => {
|
|
1749
|
+
const c = () => {
|
|
1750
|
+
if (!s) throw new Error("[react-modal-navigation] navigation requires an active modal screen; use modal.open() outside a modal");
|
|
1751
|
+
return s;
|
|
1386
1752
|
};
|
|
1387
1753
|
return {
|
|
1388
|
-
clearCache: (...d) =>
|
|
1389
|
-
navigateAsync: (...d) =>
|
|
1390
|
-
navigate: (...d) =>
|
|
1391
|
-
push: (...d) =>
|
|
1392
|
-
pop: (...d) =>
|
|
1393
|
-
popTo: (...d) =>
|
|
1394
|
-
popToTop: (...d) =>
|
|
1395
|
-
replace: (...d) =>
|
|
1396
|
-
reset: (...d) =>
|
|
1397
|
-
setParams: (...d) =>
|
|
1398
|
-
setOptions: (...d) =>
|
|
1399
|
-
goBack: (...d) =>
|
|
1400
|
-
close: (...d) =>
|
|
1401
|
-
setLoading: (...d) =>
|
|
1402
|
-
...e ? { canGoBack:
|
|
1754
|
+
clearCache: (...d) => c().clearCache(...d),
|
|
1755
|
+
navigateAsync: (...d) => c().navigateAsync(...d),
|
|
1756
|
+
navigate: (...d) => c().navigate(...d),
|
|
1757
|
+
push: (...d) => c().push(...d),
|
|
1758
|
+
pop: (...d) => c().pop(...d),
|
|
1759
|
+
popTo: (...d) => c().popTo(...d),
|
|
1760
|
+
popToTop: (...d) => c().popToTop(...d),
|
|
1761
|
+
replace: (...d) => c().replace(...d),
|
|
1762
|
+
reset: (...d) => c().reset(...d),
|
|
1763
|
+
setParams: (...d) => c().setParams(...d),
|
|
1764
|
+
setOptions: (...d) => c().setOptions(...d),
|
|
1765
|
+
goBack: (...d) => c().goBack(...d),
|
|
1766
|
+
close: (...d) => c().close(...d),
|
|
1767
|
+
setLoading: (...d) => c().setLoading(...d),
|
|
1768
|
+
...e ? { canGoBack: u.canGoBack, stack: u.stack, currentRoute: u.currentRoute } : {}
|
|
1403
1769
|
};
|
|
1404
|
-
}, [
|
|
1405
|
-
return
|
|
1770
|
+
}, [s, u, e]);
|
|
1771
|
+
return V(() => ({ ...o, modal: o, navigation: a }), [o, a]);
|
|
1406
1772
|
}
|
|
1407
|
-
function
|
|
1408
|
-
const e =
|
|
1773
|
+
function Mn() {
|
|
1774
|
+
const e = Y(Et);
|
|
1409
1775
|
if (!e) throw new Error("useModalNavigationCommands requires an active modal screen");
|
|
1410
1776
|
return e;
|
|
1411
1777
|
}
|
|
1412
|
-
function
|
|
1413
|
-
const n =
|
|
1778
|
+
function qr(e, t) {
|
|
1779
|
+
const n = Y(Pt);
|
|
1414
1780
|
if (!n) throw new Error("useModalNavigationState requires an active modal screen");
|
|
1415
|
-
return
|
|
1781
|
+
return Fe(n, e, t);
|
|
1416
1782
|
}
|
|
1417
|
-
function
|
|
1418
|
-
const e =
|
|
1419
|
-
return
|
|
1783
|
+
function uo() {
|
|
1784
|
+
const e = Mn(), t = qr();
|
|
1785
|
+
return V(() => ({ ...e, ...t }), [e, t]);
|
|
1420
1786
|
}
|
|
1421
|
-
function
|
|
1422
|
-
const e =
|
|
1787
|
+
function Ut() {
|
|
1788
|
+
const e = Y(at);
|
|
1423
1789
|
if (!e) throw new Error("useIsFocused must be called inside a modal screen");
|
|
1424
1790
|
return e.isFocused;
|
|
1425
1791
|
}
|
|
1426
|
-
function
|
|
1427
|
-
const t =
|
|
1428
|
-
|
|
1792
|
+
function mo(e) {
|
|
1793
|
+
const t = Ut();
|
|
1794
|
+
ee(() => {
|
|
1429
1795
|
if (t)
|
|
1430
1796
|
return e();
|
|
1431
1797
|
}, [t, e]);
|
|
1432
1798
|
}
|
|
1433
|
-
function
|
|
1434
|
-
const t =
|
|
1799
|
+
function fo(e) {
|
|
1800
|
+
const t = Y(at);
|
|
1435
1801
|
if (!t) throw new Error("useNavigationResult requires an active modal screen");
|
|
1436
|
-
const n =
|
|
1437
|
-
|
|
1802
|
+
const n = G(e), r = G(null);
|
|
1803
|
+
ee(() => {
|
|
1438
1804
|
n.current = e;
|
|
1439
|
-
}, [e]),
|
|
1805
|
+
}, [e]), ee(() => {
|
|
1440
1806
|
!t.isFocused || !t.resultEvent || r.current !== t.resultEvent.id && (r.current = t.resultEvent.id, n.current(t.resultEvent.data));
|
|
1441
1807
|
}, [t.isFocused, t.resultEvent]);
|
|
1442
1808
|
}
|
|
1443
|
-
function
|
|
1444
|
-
const t =
|
|
1809
|
+
function po(e = {}) {
|
|
1810
|
+
const t = Y(at);
|
|
1445
1811
|
if (!t) throw new Error("[react-modal-navigation] useModalFooter requires an active modal screen");
|
|
1446
|
-
const { setFooter: n, routeKey: r } = t, o =
|
|
1812
|
+
const { setFooter: n, routeKey: r } = t, o = G(e);
|
|
1447
1813
|
o.current = e;
|
|
1448
|
-
const
|
|
1449
|
-
|
|
1450
|
-
const
|
|
1451
|
-
return [.../* @__PURE__ */ new Set([...Object.keys(
|
|
1452
|
-
}) || (
|
|
1453
|
-
source:
|
|
1454
|
-
normalized:
|
|
1455
|
-
...
|
|
1456
|
-
onClick: (...
|
|
1814
|
+
const s = V(() => (...O) => o.current.done?.(...O), []), i = V(() => (...O) => (o.current.cancel ?? o.current.cancle)?.(...O), []), u = V(() => (...O) => o.current.renderFooter?.(...O), []), a = typeof e.done == "function", c = typeof (e.cancel ?? e.cancle) == "function", d = typeof e.renderFooter == "function", { showFooter: g, showFooterBorder: x, doneDisabled: b, doneText: h, cancelText: l, loadingText: y, footerClassName: C } = e, L = G({ source: null, normalized: void 0 }), S = Array.isArray(e.actions) ? e.actions : null, j = L.current.source;
|
|
1815
|
+
S === j || S && j && S.length === j.length && S.every((O, A) => {
|
|
1816
|
+
const N = j[A];
|
|
1817
|
+
return [.../* @__PURE__ */ new Set([...Object.keys(O), ...Object.keys(N)])].every((Q) => Q === "onClick" || Object.is(O[Q], N[Q]));
|
|
1818
|
+
}) || (L.current = {
|
|
1819
|
+
source: S?.map((O) => ({ ...O })) ?? null,
|
|
1820
|
+
normalized: S?.map((O, A) => ({
|
|
1821
|
+
...O,
|
|
1822
|
+
onClick: (...N) => (o.current.actions?.find((Q) => Q.key === O.key) ?? o.current.actions?.[A])?.onClick?.(...N)
|
|
1457
1823
|
}))
|
|
1458
1824
|
});
|
|
1459
|
-
const
|
|
1825
|
+
const R = L.current.normalized, k = V(() => ({
|
|
1460
1826
|
showFooter: g,
|
|
1461
|
-
showFooterBorder:
|
|
1462
|
-
doneDisabled:
|
|
1827
|
+
showFooterBorder: x,
|
|
1828
|
+
doneDisabled: b,
|
|
1463
1829
|
doneText: h,
|
|
1464
|
-
cancelText:
|
|
1465
|
-
loadingText:
|
|
1466
|
-
footerClassName:
|
|
1467
|
-
...
|
|
1468
|
-
...
|
|
1469
|
-
...
|
|
1470
|
-
...d ? { renderFooter:
|
|
1471
|
-
}), [g,
|
|
1472
|
-
|
|
1473
|
-
n(r,
|
|
1474
|
-
}, [r, n,
|
|
1475
|
-
}
|
|
1476
|
-
const
|
|
1477
|
-
function
|
|
1478
|
-
const e =
|
|
1830
|
+
cancelText: l,
|
|
1831
|
+
loadingText: y,
|
|
1832
|
+
footerClassName: C,
|
|
1833
|
+
...R !== void 0 ? { actions: R } : {},
|
|
1834
|
+
...a ? { done: s } : {},
|
|
1835
|
+
...c ? { cancel: i } : {},
|
|
1836
|
+
...d ? { renderFooter: u } : {}
|
|
1837
|
+
}), [g, x, b, h, l, y, C, R, a, c, d, s, i, u]);
|
|
1838
|
+
ee(() => {
|
|
1839
|
+
n(r, k);
|
|
1840
|
+
}, [r, n, k]), ee(() => () => n(r, null), [r, n]);
|
|
1841
|
+
}
|
|
1842
|
+
const Ir = (e) => e.visible;
|
|
1843
|
+
function ho() {
|
|
1844
|
+
const e = Y(st), t = Y(Ot);
|
|
1479
1845
|
if (!e || !t) throw new Error("[react-modal-navigation] useModalLoading requires an active modal screen");
|
|
1480
|
-
const n =
|
|
1481
|
-
return
|
|
1846
|
+
const n = Fe(t, Ir);
|
|
1847
|
+
return V(() => ({ ...e, isLoading: n }), [e, n]);
|
|
1482
1848
|
}
|
|
1483
|
-
function
|
|
1484
|
-
const e =
|
|
1849
|
+
function $r() {
|
|
1850
|
+
const e = Y(st);
|
|
1485
1851
|
if (!e) throw new Error("[react-modal-navigation] useModalLoadingCommands requires an active modal screen");
|
|
1486
1852
|
return e;
|
|
1487
1853
|
}
|
|
1488
|
-
function
|
|
1489
|
-
const n =
|
|
1854
|
+
function go(e, t) {
|
|
1855
|
+
const n = Y(Ot);
|
|
1490
1856
|
if (!n) throw new Error("[react-modal-navigation] useModalLoadingState requires an active modal screen");
|
|
1491
|
-
return
|
|
1857
|
+
return Fe(n, e, t);
|
|
1492
1858
|
}
|
|
1493
|
-
function
|
|
1494
|
-
const e =
|
|
1495
|
-
if (!
|
|
1496
|
-
|
|
1859
|
+
function yo() {
|
|
1860
|
+
const e = Y(We), t = Y(Je), n = $r(), r = Ut(), o = G(!0), s = G(null), [i, u] = Pe(!1), [a, c] = Pe(null), d = X((b) => {
|
|
1861
|
+
if (!b || s.current !== b) return !1;
|
|
1862
|
+
s.current = null, b.unregister?.(), o.current && u(!1);
|
|
1497
1863
|
try {
|
|
1498
|
-
|
|
1864
|
+
b.controller.abort();
|
|
1499
1865
|
} finally {
|
|
1500
|
-
|
|
1866
|
+
b.release();
|
|
1501
1867
|
}
|
|
1502
1868
|
return !0;
|
|
1503
|
-
}, []), g =
|
|
1504
|
-
return
|
|
1869
|
+
}, []), g = X(() => d(s.current), [d]);
|
|
1870
|
+
return ee(() => (o.current = !0, () => {
|
|
1505
1871
|
o.current = !1, g();
|
|
1506
|
-
}), [g]), { run:
|
|
1872
|
+
}), [g]), { run: X(async (b, h = {}) => {
|
|
1507
1873
|
if (!o.current || e && !e.alive.current) return { status: "cancelled" };
|
|
1508
|
-
if (
|
|
1509
|
-
if (typeof
|
|
1510
|
-
const
|
|
1511
|
-
let
|
|
1512
|
-
const
|
|
1513
|
-
|
|
1874
|
+
if (s.current) return { status: "busy" };
|
|
1875
|
+
if (typeof b != "function") throw new TypeError("[react-modal-navigation] run requires a function");
|
|
1876
|
+
const l = new AbortController();
|
|
1877
|
+
let y, C = !1;
|
|
1878
|
+
const L = { controller: l, release: () => {
|
|
1879
|
+
C || (C = !0, y != null && n.hideLoading(y));
|
|
1514
1880
|
} };
|
|
1515
|
-
|
|
1516
|
-
const
|
|
1881
|
+
s.current = L, L.cancel = () => d(L), L.unregister = e?.tasks.register(t?.key, L);
|
|
1882
|
+
const S = () => o.current && s.current === L && !l.signal.aborted;
|
|
1517
1883
|
try {
|
|
1518
|
-
if (!
|
|
1519
|
-
if (
|
|
1520
|
-
return
|
|
1521
|
-
const
|
|
1522
|
-
return
|
|
1523
|
-
} catch (
|
|
1524
|
-
if (!
|
|
1525
|
-
|
|
1884
|
+
if (!S()) return { status: "cancelled" };
|
|
1885
|
+
if (u(!0), c(null), y = n.showLoading(h.loadingText), !S())
|
|
1886
|
+
return y != null && C && n.hideLoading(y), { status: "cancelled" };
|
|
1887
|
+
const j = await b({ signal: l.signal });
|
|
1888
|
+
return S() ? (await h.onSuccess?.(j), S() ? { status: "success", value: j } : { status: "cancelled" }) : { status: "cancelled" };
|
|
1889
|
+
} catch (j) {
|
|
1890
|
+
if (!S()) return { status: "cancelled" };
|
|
1891
|
+
c(j);
|
|
1526
1892
|
try {
|
|
1527
|
-
await h.onError?.(
|
|
1893
|
+
await h.onError?.(j);
|
|
1528
1894
|
} catch (D) {
|
|
1529
1895
|
console.error("[react-modal-navigation] onError failed", D);
|
|
1530
1896
|
}
|
|
1531
|
-
if (!
|
|
1532
|
-
if (h.throwOnError) throw
|
|
1533
|
-
return { status: "error", error:
|
|
1897
|
+
if (!S()) return { status: "cancelled" };
|
|
1898
|
+
if (h.throwOnError) throw j;
|
|
1899
|
+
return { status: "error", error: j };
|
|
1534
1900
|
} finally {
|
|
1535
|
-
|
|
1901
|
+
L.unregister?.(), L.release(), s.current === L && (s.current = null, o.current && u(!1));
|
|
1536
1902
|
}
|
|
1537
|
-
}, [n, e, t?.key, d]), cancel: g, pending:
|
|
1903
|
+
}, [n, e, t?.key, d]), cancel: g, pending: i, error: a, clearError: () => c(null), isFocused: r };
|
|
1538
1904
|
}
|
|
1539
|
-
function
|
|
1540
|
-
const n =
|
|
1905
|
+
function Dr(e, t = {}) {
|
|
1906
|
+
const n = Y(It);
|
|
1541
1907
|
if (!n) throw new Error("[react-modal-navigation] useModalUnsavedChanges must be used inside a modal screen");
|
|
1542
|
-
const
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
}), [o, a]);
|
|
1556
|
-
}
|
|
1557
|
-
const $r = () => {
|
|
1558
|
-
const e = ee(Tt);
|
|
1908
|
+
const { message: r, onBeforeDiscard: o } = t, s = G(o);
|
|
1909
|
+
Se(() => {
|
|
1910
|
+
s.current = o;
|
|
1911
|
+
}, [o]);
|
|
1912
|
+
const { routeKey: i, registerDirtyGuard: u } = n, a = !!e, c = typeof o == "function";
|
|
1913
|
+
Se(() => u(i, {
|
|
1914
|
+
dirty: a,
|
|
1915
|
+
message: r,
|
|
1916
|
+
onBeforeDiscard: c ? (g) => s.current(g) : void 0
|
|
1917
|
+
}), [i, u, a, r, c]);
|
|
1918
|
+
}
|
|
1919
|
+
const vo = () => {
|
|
1920
|
+
const e = Y($t);
|
|
1559
1921
|
if (!e) throw new Error("[react-modal-navigation] useToast requires an active modal");
|
|
1560
1922
|
return e;
|
|
1561
1923
|
};
|
|
1562
|
-
function
|
|
1563
|
-
const e =
|
|
1924
|
+
function Kr() {
|
|
1925
|
+
const e = Y(Je);
|
|
1564
1926
|
if (!e) throw new Error("[react-modal-navigation] useModalRoute requires a modal screen");
|
|
1565
1927
|
return e;
|
|
1566
1928
|
}
|
|
1567
|
-
function
|
|
1568
|
-
return
|
|
1929
|
+
function Hr() {
|
|
1930
|
+
return Kr().params;
|
|
1569
1931
|
}
|
|
1570
|
-
function
|
|
1571
|
-
const e =
|
|
1932
|
+
function Vt() {
|
|
1933
|
+
const e = Y(Dt);
|
|
1572
1934
|
if (!e) throw new Error("[react-modal-navigation] ModalProvider required");
|
|
1573
1935
|
return e;
|
|
1574
1936
|
}
|
|
1575
|
-
const
|
|
1576
|
-
function
|
|
1577
|
-
const n =
|
|
1937
|
+
const Wr = (e) => e;
|
|
1938
|
+
function _r(e = Wr, t = Object.is) {
|
|
1939
|
+
const n = Y(Kt);
|
|
1578
1940
|
if (!n) throw new Error("[react-modal-navigation] ModalProvider required");
|
|
1579
|
-
return
|
|
1941
|
+
return Fe(n, e, t);
|
|
1580
1942
|
}
|
|
1581
|
-
const
|
|
1582
|
-
function
|
|
1583
|
-
const { setFullscreen: e, toggleFullscreen: t } =
|
|
1584
|
-
return { isFullscreen:
|
|
1943
|
+
const Ur = (e) => e.isFullscreen;
|
|
1944
|
+
function bo() {
|
|
1945
|
+
const { setFullscreen: e, toggleFullscreen: t } = Vt();
|
|
1946
|
+
return { isFullscreen: _r(Ur), setFullscreen: e, toggleFullscreen: t };
|
|
1585
1947
|
}
|
|
1586
|
-
function
|
|
1587
|
-
const t =
|
|
1948
|
+
function wo(e = {}) {
|
|
1949
|
+
const t = Y(Lt), n = Y(Je);
|
|
1588
1950
|
if (!t || !n) throw new Error("[react-modal-navigation] useModalHeader requires a modal screen");
|
|
1589
|
-
const r =
|
|
1590
|
-
r.current = e,
|
|
1951
|
+
const r = G(e);
|
|
1952
|
+
r.current = e, ee(() => {
|
|
1591
1953
|
t.set(n.key, r.current);
|
|
1592
|
-
}),
|
|
1954
|
+
}), ee(() => () => t.set(n.key, null), [t, n.key]);
|
|
1593
1955
|
}
|
|
1594
|
-
function
|
|
1595
|
-
const n =
|
|
1956
|
+
function ko(e, t) {
|
|
1957
|
+
const n = Y(We);
|
|
1596
1958
|
if (!n) throw new Error("[react-modal-navigation] useModalLayout requires an active modal");
|
|
1597
|
-
return
|
|
1959
|
+
return Fe(n.stores.layout, e, t);
|
|
1598
1960
|
}
|
|
1599
|
-
function
|
|
1600
|
-
const t =
|
|
1601
|
-
|
|
1961
|
+
function xo(e = {}) {
|
|
1962
|
+
const t = Y(We), n = Y(Je), r = Ut(), o = G(e);
|
|
1963
|
+
ee(() => {
|
|
1602
1964
|
o.current = e;
|
|
1603
|
-
}),
|
|
1965
|
+
}), ee(() => (o.current.onMount?.(), () => o.current.onDestroy?.()), []), ee(() => {
|
|
1604
1966
|
if (r)
|
|
1605
1967
|
return o.current.onFocus?.(), () => o.current.onBlur?.();
|
|
1606
|
-
}, [r]),
|
|
1607
|
-
}
|
|
1608
|
-
function
|
|
1609
|
-
const [
|
|
1610
|
-
|
|
1611
|
-
const
|
|
1612
|
-
return { dirty:
|
|
1613
|
-
}
|
|
1614
|
-
const
|
|
1615
|
-
function
|
|
1616
|
-
let n, r, o,
|
|
1617
|
-
const
|
|
1968
|
+
}, [r]), ee(() => t?.registerRemovalGuard(n?.key, (s) => o.current.onBeforeRemove?.(s)), [t, n?.key]);
|
|
1969
|
+
}
|
|
1970
|
+
function So({ values: e, initialValues: t, equals: n = Object.is, message: r, onBeforeDiscard: o }) {
|
|
1971
|
+
const [s, i] = Pe(() => t), u = !n(s, e);
|
|
1972
|
+
Dr(u, { message: r, onBeforeDiscard: o });
|
|
1973
|
+
const a = X((c = e) => i(() => c), [e]);
|
|
1974
|
+
return { dirty: u, markSaved: a };
|
|
1975
|
+
}
|
|
1976
|
+
const Vr = (e, t) => e && t && Object.keys(e).length === Object.keys(t).length && Object.keys(e).every((n) => Object.hasOwn(t, n) && Object.is(e[n], t[n]));
|
|
1977
|
+
function Yr(e, t) {
|
|
1978
|
+
let n, r, o, s = !1, i = !1, u = !1, a = 0, c = -1, d = !1;
|
|
1979
|
+
const g = (l) => {
|
|
1618
1980
|
try {
|
|
1619
|
-
|
|
1620
|
-
} catch (
|
|
1621
|
-
console.error(
|
|
1981
|
+
s && n?.onError ? Promise.resolve(n.onError(l)).catch((y) => console.error(y)) : console.error(l);
|
|
1982
|
+
} catch (y) {
|
|
1983
|
+
console.error(y);
|
|
1622
1984
|
}
|
|
1623
|
-
},
|
|
1624
|
-
if (
|
|
1985
|
+
}, x = (l, ...y) => {
|
|
1986
|
+
if (s)
|
|
1625
1987
|
try {
|
|
1626
|
-
Promise.resolve(n[
|
|
1627
|
-
} catch (
|
|
1628
|
-
|
|
1988
|
+
Promise.resolve(n[l]?.(...y)).catch(g);
|
|
1989
|
+
} catch (C) {
|
|
1990
|
+
g(C);
|
|
1629
1991
|
}
|
|
1630
1992
|
}, b = () => {
|
|
1631
|
-
|
|
1993
|
+
u = !0, !(i || d) && (d = !0, queueMicrotask(() => {
|
|
1994
|
+
d = !1, !i && u && h();
|
|
1995
|
+
}));
|
|
1632
1996
|
};
|
|
1633
|
-
async function
|
|
1634
|
-
|
|
1997
|
+
async function h() {
|
|
1998
|
+
i = !0;
|
|
1635
1999
|
try {
|
|
1636
|
-
for (;
|
|
1637
|
-
if (
|
|
2000
|
+
for (; u; ) {
|
|
2001
|
+
if (u = !1, !s) {
|
|
1638
2002
|
r?.dispose();
|
|
1639
2003
|
continue;
|
|
1640
2004
|
}
|
|
1641
|
-
const
|
|
1642
|
-
if (!
|
|
1643
|
-
const
|
|
1644
|
-
if (!
|
|
1645
|
-
r?.isActive() &&
|
|
2005
|
+
const l = n;
|
|
2006
|
+
if (!l) continue;
|
|
2007
|
+
const y = a;
|
|
2008
|
+
if (!l.open) {
|
|
2009
|
+
r?.isActive() && c !== y && (c = y, !await r.close() && a === y && x("onBlocked", "close"));
|
|
1646
2010
|
continue;
|
|
1647
2011
|
}
|
|
1648
2012
|
if (!r?.isActive()) {
|
|
1649
|
-
if (
|
|
1650
|
-
|
|
1651
|
-
const
|
|
1652
|
-
{ component: t, title:
|
|
1653
|
-
{ children:
|
|
1654
|
-
|
|
2013
|
+
if (c === y) continue;
|
|
2014
|
+
c = y;
|
|
2015
|
+
const C = await e.openInstance(
|
|
2016
|
+
{ component: t, title: l.title },
|
|
2017
|
+
{ children: l.children, title: l.title },
|
|
2018
|
+
l.options
|
|
1655
2019
|
);
|
|
1656
|
-
if (r =
|
|
1657
|
-
|
|
2020
|
+
if (r = C, o = l, !C.isActive()) {
|
|
2021
|
+
a === y && x("onBlocked", "open");
|
|
1658
2022
|
continue;
|
|
1659
2023
|
}
|
|
1660
|
-
if (
|
|
1661
|
-
r ===
|
|
1662
|
-
}).catch(
|
|
1663
|
-
|
|
2024
|
+
if (C.result.then((L) => {
|
|
2025
|
+
r === C && (r = null, o = null, n.open && a === c && x("onOpenChange", !1, L), b());
|
|
2026
|
+
}).catch(g), !s) {
|
|
2027
|
+
C.dispose();
|
|
1664
2028
|
continue;
|
|
1665
2029
|
}
|
|
1666
2030
|
if (!n.open) {
|
|
1667
|
-
|
|
2031
|
+
u = !0;
|
|
1668
2032
|
continue;
|
|
1669
2033
|
}
|
|
1670
|
-
if (!await
|
|
1671
|
-
|
|
2034
|
+
if (!await C.ready || !C.isActive()) continue;
|
|
2035
|
+
u = !0;
|
|
1672
2036
|
continue;
|
|
1673
2037
|
}
|
|
1674
|
-
|
|
2038
|
+
c = y, !(!Vr(o?.options, l.options) && !r.replaceOptions(l.options)) && ((!o || !Object.is(o.children, l.children) || !Object.is(o.title, l.title)) && !r.setParams({ children: l.children, title: l.title }) || (o = l));
|
|
1675
2039
|
}
|
|
1676
|
-
} catch (
|
|
1677
|
-
|
|
2040
|
+
} catch (l) {
|
|
2041
|
+
g(l);
|
|
1678
2042
|
} finally {
|
|
1679
|
-
|
|
2043
|
+
i = !1, u && b();
|
|
1680
2044
|
}
|
|
1681
2045
|
}
|
|
1682
2046
|
return {
|
|
1683
2047
|
mount() {
|
|
1684
|
-
|
|
2048
|
+
s = !0;
|
|
1685
2049
|
},
|
|
1686
|
-
update(
|
|
1687
|
-
(!n || n.open !==
|
|
2050
|
+
update(l) {
|
|
2051
|
+
(!n || n.open !== l.open) && a++, n = l, b();
|
|
1688
2052
|
},
|
|
1689
2053
|
unmount() {
|
|
1690
|
-
|
|
1691
|
-
|
|
2054
|
+
s = !1, queueMicrotask(() => {
|
|
2055
|
+
s || (r?.dispose(), b());
|
|
1692
2056
|
});
|
|
1693
2057
|
}
|
|
1694
2058
|
};
|
|
1695
2059
|
}
|
|
1696
|
-
function
|
|
1697
|
-
const { children: e, title: t } =
|
|
1698
|
-
return
|
|
2060
|
+
function Qr() {
|
|
2061
|
+
const { children: e, title: t } = Hr(), n = Mn();
|
|
2062
|
+
return Se(() => {
|
|
1699
2063
|
n.setOptions({ title: t });
|
|
1700
2064
|
}, [n, t]), e;
|
|
1701
2065
|
}
|
|
1702
|
-
function
|
|
1703
|
-
const
|
|
1704
|
-
return
|
|
1705
|
-
|
|
2066
|
+
function Ro({ open: e, onOpenChange: t, onBlocked: n, onError: r, children: o, title: s, ...i }) {
|
|
2067
|
+
const u = Vt(), a = V(() => Yr(u, Qr), [u]);
|
|
2068
|
+
return ee(() => (a.mount(), a.unmount), [a]), ee(() => {
|
|
2069
|
+
a.update({
|
|
1706
2070
|
open: e,
|
|
1707
2071
|
onOpenChange: t,
|
|
1708
2072
|
onBlocked: n,
|
|
1709
2073
|
onError: r,
|
|
1710
2074
|
children: o,
|
|
1711
|
-
title:
|
|
1712
|
-
options: { ...
|
|
2075
|
+
title: s,
|
|
2076
|
+
options: { ...i, instanceKey: void 0, duplicateStrategy: "allow" }
|
|
1713
2077
|
});
|
|
1714
2078
|
}), null;
|
|
1715
2079
|
}
|
|
1716
|
-
function
|
|
1717
|
-
const { active: t, queueSize: n, events: r } =
|
|
1718
|
-
return /* @__PURE__ */
|
|
1719
|
-
/* @__PURE__ */
|
|
2080
|
+
function Zr({ inspector: e }) {
|
|
2081
|
+
const { active: t, queueSize: n, events: r } = Ee(e.subscribe, e.getSnapshot, e.getSnapshot);
|
|
2082
|
+
return /* @__PURE__ */ Me("details", { style: { font: "12px monospace", padding: 12, border: "1px solid #888", borderRadius: 8 }, children: [
|
|
2083
|
+
/* @__PURE__ */ Me("summary", { children: [
|
|
1720
2084
|
"Modal DevTools · ",
|
|
1721
2085
|
t?.name ?? "Idle"
|
|
1722
2086
|
] }),
|
|
1723
|
-
/* @__PURE__ */
|
|
2087
|
+
/* @__PURE__ */ Me("p", { children: [
|
|
1724
2088
|
"Queue: ",
|
|
1725
2089
|
n,
|
|
1726
2090
|
" · Loading: ",
|
|
@@ -1728,14 +2092,14 @@ function Cr({ inspector: e }) {
|
|
|
1728
2092
|
" · Tasks: ",
|
|
1729
2093
|
t?.taskCount ?? 0
|
|
1730
2094
|
] }),
|
|
1731
|
-
/* @__PURE__ */
|
|
2095
|
+
/* @__PURE__ */ m("button", { type: "button", onClick: e.refresh, children: "Refresh" }),
|
|
1732
2096
|
" ",
|
|
1733
|
-
/* @__PURE__ */
|
|
1734
|
-
/* @__PURE__ */
|
|
2097
|
+
/* @__PURE__ */ m("button", { type: "button", onClick: e.clear, children: "Clear events" }),
|
|
2098
|
+
/* @__PURE__ */ m("ol", { children: t?.routes.map((o) => /* @__PURE__ */ Me("li", { children: [
|
|
1735
2099
|
o.name,
|
|
1736
2100
|
o.key === t.focusedKey ? " (focused)" : ""
|
|
1737
2101
|
] }, o.key)) }),
|
|
1738
|
-
/* @__PURE__ */
|
|
2102
|
+
/* @__PURE__ */ m("ol", { style: { maxHeight: 240, overflow: "auto" }, children: r.map((o) => /* @__PURE__ */ Me("li", { children: [
|
|
1739
2103
|
o.sequence,
|
|
1740
2104
|
" · ",
|
|
1741
2105
|
o.type,
|
|
@@ -1744,46 +2108,53 @@ function Cr({ inspector: e }) {
|
|
|
1744
2108
|
] }, o.sequence)) })
|
|
1745
2109
|
] });
|
|
1746
2110
|
}
|
|
1747
|
-
function
|
|
1748
|
-
const n =
|
|
1749
|
-
return
|
|
2111
|
+
function Co({ enabled: e = !1, limit: t = 100 }) {
|
|
2112
|
+
const n = Vt(), [r, o] = Pe(null);
|
|
2113
|
+
return ee(() => {
|
|
1750
2114
|
if (!e) {
|
|
1751
2115
|
o(null);
|
|
1752
2116
|
return;
|
|
1753
2117
|
}
|
|
1754
|
-
const
|
|
1755
|
-
return o(
|
|
1756
|
-
}, [n, e, t]), e && r ? /* @__PURE__ */
|
|
2118
|
+
const s = n.inspect({ limit: t });
|
|
2119
|
+
return o(s), s.dispose;
|
|
2120
|
+
}, [n, e, t]), e && r ? /* @__PURE__ */ m(Zr, { inspector: r }) : null;
|
|
1757
2121
|
}
|
|
1758
2122
|
export {
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
2123
|
+
Ro as Modal,
|
|
2124
|
+
Co as ModalDevTools,
|
|
2125
|
+
hr as ModalNavigator,
|
|
2126
|
+
so as ModalOutlet,
|
|
2127
|
+
co as ModalProvider,
|
|
2128
|
+
ao as defineModal,
|
|
2129
|
+
io as lazyModal,
|
|
2130
|
+
Ye as shallowEqual,
|
|
2131
|
+
mo as useFocusEffect,
|
|
2132
|
+
Ut as useIsFocused,
|
|
2133
|
+
lo as useModal,
|
|
2134
|
+
Vt as useModalCommands,
|
|
2135
|
+
po as useModalFooter,
|
|
2136
|
+
So as useModalFormGuard,
|
|
2137
|
+
bo as useModalFullscreen,
|
|
2138
|
+
ro as useModalGroupGuard,
|
|
2139
|
+
oo as useModalGroupLifecycle,
|
|
2140
|
+
wo as useModalHeader,
|
|
2141
|
+
ko as useModalLayout,
|
|
2142
|
+
xo as useModalLifecycle,
|
|
2143
|
+
ho as useModalLoading,
|
|
2144
|
+
$r as useModalLoadingCommands,
|
|
2145
|
+
go as useModalLoadingState,
|
|
2146
|
+
Gn as useModalMatches,
|
|
2147
|
+
uo as useModalNavigation,
|
|
2148
|
+
Mn as useModalNavigationCommands,
|
|
2149
|
+
qr as useModalNavigationState,
|
|
2150
|
+
Hr as useModalParams,
|
|
2151
|
+
Kr as useModalRoute,
|
|
2152
|
+
no as useModalRouteGroup,
|
|
2153
|
+
_r as useModalStatus,
|
|
2154
|
+
yo as useModalTask,
|
|
2155
|
+
Dr as useModalUnsavedChanges,
|
|
2156
|
+
fo as useNavigationResult,
|
|
2157
|
+
to as useParentParams,
|
|
2158
|
+
Fn as useParentRoute,
|
|
2159
|
+
vo as useToast
|
|
1789
2160
|
};
|