@yuku123/z-cognition-component 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/ApartmentOutlined-M6qSurnE.js +12 -0
- package/dist-lib/ArrowLeftOutlined-DowsrSUj.js +12 -0
- package/dist-lib/{ConceptsPage-DOf_CJlz.js → ConceptsPage-BOeKdDKI.js} +16 -13
- package/dist-lib/{DocsPage-CiC7TU96.js → DocsPage-BZOBFp3c.js} +4 -4
- package/dist-lib/EvidenceFormList-DXqqSpPV.js +91 -0
- package/dist-lib/{EyeOutlined-CH-5UdnC.js → EyeOutlined-DGSrX-0M.js} +1 -1
- package/dist-lib/ImpactPage-DyhUR6fT.js +71 -0
- package/dist-lib/{LeftOutlined-DQTflZ6D.js → LeftOutlined-Cgo6Izj-.js} +1 -1
- package/dist-lib/{OntologyDetailPage-mgK_NQxP.js → OntologyDetailPage-B8DyU8WW.js} +93 -99
- package/dist-lib/{OntologyInferPage-NUaoaQpN.js → OntologyInferPage-CvcjxpBB.js} +40 -38
- package/dist-lib/{OntologyListPage-C9wH01y0.js → OntologyListPage-Cb0XfpWE.js} +49 -47
- package/dist-lib/OntologyMaterializePage-B0f9TnJa.js +136 -0
- package/dist-lib/OntologyNodesPage-D4MWlm6q.js +1268 -0
- package/dist-lib/{OntologyValidatePage-DtkYK_l4.js → OntologyValidatePage-abQVJwzV.js} +52 -49
- package/dist-lib/{Pagination-Ds8VKQIT.js → Pagination-Dxslodkq.js} +258 -260
- package/dist-lib/PlusOutlined-B_dXo_97.js +12 -0
- package/dist-lib/{ReloadOutlined-B26pDoyV.js → ReloadOutlined-CS-e-TmN.js} +10 -19
- package/dist-lib/{ResolvePage-Cz9HORZ3.js → ResolvePage-rbQ-8nNZ.js} +33 -31
- package/dist-lib/{RotateRightOutlined-B575hEBK.js → RotateRightOutlined-q7zp2e47.js} +1 -1
- package/dist-lib/SearchOutlined-puH6bCY6.js +979 -0
- package/dist-lib/Skeleton-DXcERb5r.js +557 -0
- package/dist-lib/{Table-D8pPXolZ.js → Table-CDagah-g.js} +452 -450
- package/dist-lib/TagsOutlined-B4_qkn6-.js +20 -0
- package/dist-lib/TermDetailPage-CP0D6OvA.js +242 -0
- package/dist-lib/{TermsPage-BuzCMYov.js → TermsPage-CuufAyuL.js} +31 -28
- package/dist-lib/TextArea-DTpTS5HL.js +1897 -0
- package/dist-lib/ThunderboltOutlined-Bf54AaFE.js +20 -0
- package/dist-lib/{agents-DS0rPJGV.js → agents-CvgRLQw2.js} +46 -46
- package/dist-lib/{ai-CQ67aRC4.js → ai-DYDhijtn.js} +30 -30
- package/dist-lib/{ai-chat-share-AOB7rEOb.js → ai-chat-share-DJnybJtS.js} +14 -13
- package/dist-lib/{approval-LLVR3fMa.js → approval-3IbhY8Lp.js} +26 -25
- package/dist-lib/{approvals-D1DSA-Mw.js → approvals-Cd6CVzz4.js} +43 -42
- package/dist-lib/{assistant-DpabpWKV.js → assistant-cIXgilaE.js} +50 -49
- package/dist-lib/{assistant-history-ChvhtZwX.js → assistant-history-BQzH4ChB.js} +5 -5
- package/dist-lib/{assistant-summary-B0ksF8CX.js → assistant-summary-LKTj_HKM.js} +1 -1
- package/dist-lib/{audit-DeU1XEgQ.js → audit-CxuJ5unU.js} +1 -1
- package/dist-lib/{bios-Bk36bVhw.js → bios-BplnCOF4.js} +130 -125
- package/dist-lib/callSuper-DZEfdkXG.js +7 -0
- package/dist-lib/{changelog-xEt2qnho.js → changelog-BoGqt_81.js} +2 -2
- package/dist-lib/{changelog-CCMDMI4R.js → changelog-Cn81Dvgk.js} +1 -1
- package/dist-lib/chunk-YDNE64FV-DGyyfCo0.js +2004 -0
- package/dist-lib/colors-sdAcAcU3.js +24 -0
- package/dist-lib/context-Buz0ggsK.js +710 -0
- package/dist-lib/context-DpmyNOn3.js +21 -0
- package/dist-lib/createForOfIteratorHelper-DEx_aTey.js +51 -0
- package/dist-lib/d3-force-CZK-Rgd6.js +598 -0
- package/dist-lib/{dayjs.min-DoEf5yCX.js → dayjs.min-BauDENhn.js} +1 -1
- package/dist-lib/{detail-Xtof0GoK.js → detail-BaX7WiWV.js} +51 -50
- package/dist-lib/{detail-BW6dD_YP.js → detail-Cx5c4KJH.js} +89 -88
- package/dist-lib/{docx-preview-D4v2g8Yg.js → docx-preview-B5nQuTwk.js} +1 -1
- package/dist-lib/{downloads-Dj4DgBSS.js → downloads-C3Oz04OW.js} +4 -3
- package/dist-lib/{edit-nZ7siGuW.js → edit-Cbn2eJaJ.js} +265 -259
- package/dist-lib/{editor-BuhZwEsv.js → editor-mtaJBQXz.js} +21 -20
- package/dist-lib/embed-CR8XVkMy.js +31148 -0
- package/dist-lib/{evaluation-B-igEqQ9.js → evaluation-BoHiY8yT.js} +15 -14
- package/dist-lib/{focus-set-DfRWcq91.js → focus-set-h0YtOUB2.js} +34 -33
- package/dist-lib/{format-CWI99NCN.js → format-UGmYKemG.js} +1 -1
- package/dist-lib/index-9aQ4BzIK.js +500 -0
- package/dist-lib/{index-BJ2Gpcbi.js → index-B22_2Dzh.js} +2 -2
- package/dist-lib/index-B57Fj7Y0.js +1169 -0
- package/dist-lib/{index-D_-8dmug.js → index-BEjXaDfk.js} +23 -22
- package/dist-lib/{index-rtSfQuYs.js → index-BSlCGnzo.js} +12 -12
- package/dist-lib/index-Bc-Vin3j.js +256 -0
- package/dist-lib/{index-SAPKyv8e.js → index-Bm1sK-VN.js} +10 -10
- package/dist-lib/{index-g9uC_rON.js → index-BwVZgt5s.js} +129 -146
- package/dist-lib/{index-CZipVp1G.js → index-C3AMwzIi.js} +1 -1
- package/dist-lib/{index-B5jr3A7f.js → index-CHBNrCMy.js} +19 -19
- package/dist-lib/{index-BFRg0cn3.js → index-CLTfICbf.js} +6 -6
- package/dist-lib/{index-CnLkqTRm.js → index-CaXylbQR.js} +175 -173
- package/dist-lib/index-Cfu1W1H6.js +535 -0
- package/dist-lib/{index-DzrH4RQ7.js → index-Cj4DDWyj.js} +11 -10
- package/dist-lib/index-CrMcNEAZ.js +9656 -0
- package/dist-lib/index-Cy9i4Kx7.js +699 -0
- package/dist-lib/index-CyKWCYMK.js +218 -0
- package/dist-lib/{index-CjwzwBTy.js → index-D3GHtSlM.js} +94 -93
- package/dist-lib/{index-B8l4PAGJ.js → index-DBlG9uXV.js} +112 -108
- package/dist-lib/index-DBtGE89a.js +168 -0
- package/dist-lib/{index-CS5YTpdI.js → index-DMTPsTna.js} +4 -3
- package/dist-lib/index-DjFPRXl5.js +1484 -0
- package/dist-lib/{index-Bu6udiyN.js → index-DsuUGhTA.js} +123 -121
- package/dist-lib/index-DvWHYX81.js +450 -0
- package/dist-lib/{index-D5V4bZ4e.js → index-PBT9GksC.js} +8 -8
- package/dist-lib/index-Vu6sPBci.js +1884 -0
- package/dist-lib/index-bOY1cBol.js +4890 -0
- package/dist-lib/index-nQSVLWfW.js +356 -0
- package/dist-lib/{index-pcUZcUIA.js → index-o65vKUwa.js} +48 -47
- package/dist-lib/{index-K7z38Ybg.js → index-ounfql2z.js} +33 -31
- package/dist-lib/{index-B1rpIXU7.js → index-y7jVGGI0.js} +23 -21
- package/dist-lib/index.js +3 -1
- package/dist-lib/{jszip.min-dcaDnWUw.js → jszip.min-DcEHhn-b.js} +1 -1
- package/dist-lib/{kb-form-modal-9L0AUHVG.js → kb-form-modal-B0rM1ZvV.js} +71 -71
- package/dist-lib/{kbTeam-BECePvJe.js → kbTeam-Bh_FQH28.js} +3 -3
- package/dist-lib/{knowledge-base-C8gHP0dj.js → knowledge-base-Cl1Ka1e6.js} +104 -103
- package/dist-lib/{knowledge-hub-C9KkDv1A.js → knowledge-hub-CPuzdRiq.js} +52 -51
- package/dist-lib/{markdown-lite-BABX4bcl.js → markdown-lite-Cu62Fl7J.js} +181 -177
- package/dist-lib/{material-preview-docx-lp_xPipj.js → material-preview-docx-CH-09KeC.js} +1 -1
- package/dist-lib/{material-preview-pdf-CKAovvpc.js → material-preview-pdf-CTSo215V.js} +7 -7
- package/dist-lib/{material-preview-pptx-6Byitp0J.js → material-preview-pptx-D8XGDF-u.js} +1 -1
- package/dist-lib/{member-B5WF3FCj.js → member-DKDx77PD.js} +1 -1
- package/dist-lib/{message-kHyjuooj.js → message-BrooQ3Q7.js} +25 -24
- package/dist-lib/{message-D2MSaOMq.js → message-Dievi8Jw.js} +1 -1
- package/dist-lib/{messages-D_VDuKK7.js → messages-xTNmTS9g.js} +16 -15
- package/dist-lib/{meta-CEf_DYcU.js → meta-BD_qYTZu.js} +1 -1
- package/dist-lib/{metrics-hONGW0KG.js → metrics-DiHYqBKB.js} +2 -2
- package/dist-lib/{monitor-DF3WVsVV.js → monitor-BBCu3zRe.js} +8 -8
- package/dist-lib/{monitor-DFmEu6rH.js → monitor-BXsdMJSV.js} +4 -4
- package/dist-lib/{my-access-j53lA6T6.js → my-access-CEGErUgv.js} +4 -4
- package/dist-lib/{my-permissions-C5L8ZN2d.js → my-permissions-wSr5zv7g.js} +23 -22
- package/dist-lib/{new-DfZ61nMQ.js → new-BevAuTe5.js} +14 -12
- package/dist-lib/{ontology-CUH5qslO.js → ontology-DXGSJC-y.js} +145 -142
- package/dist-lib/{ontology-domains-CRC1ZRit.js → ontology-domains-jTG7CZm8.js} +88 -84
- package/dist-lib/ontology-modeling-CjRsa-DR.js +1039 -0
- package/dist-lib/{ontology-modeling-DaSk5fsh.js → ontology-modeling-DOj68TuI.js} +2125 -2117
- package/dist-lib/ontology-scenarios-CcAagMiP.js +660 -0
- package/dist-lib/{ontology-scenarios-DAbyoKV6.js → ontology-scenarios-J5kw6xgi.js} +703 -712
- package/dist-lib/pages-CsexFuEz.js +73 -0
- package/dist-lib/pages.js +3 -3
- package/dist-lib/{permission-CklDU2kO.js → permission-BUXo69Ne.js} +31 -31
- package/dist-lib/{pptx-preview.es-D4ODiBv2.js → pptx-preview.es-AUrdYKu3.js} +2 -2
- package/dist-lib/{preset-Bp_mvsJm.js → preset-gh5SGoYT.js} +9810 -10199
- package/dist-lib/{quota-DLe9so2b.js → quota-D31cXjul.js} +4 -4
- package/dist-lib/{row-CE051ClO.js → row-B5MnGm9M.js} +63 -61
- package/dist-lib/{save-blob-qKrc8-z6.js → save-blob-CiWNK-cX.js} +2 -2
- package/dist-lib/{scenario-mapping-preview-CSDqIN3R.js → scenario-mapping-preview-DQ_OBV4Z.js} +48 -46
- package/dist-lib/{scenario-simple-form-CAkhVgeV.js → scenario-simple-form-DESMvU7A.js} +425 -423
- package/dist-lib/{schedule-B_ujtL3h.js → schedule-BktxwX3S.js} +8 -8
- package/dist-lib/{settings-BIkKTQjc.js → settings-dsB3H65I.js} +147 -146
- package/dist-lib/{shared-Dfz1X4Mq.js → shared-CTCzvhyE.js} +1 -1
- package/dist-lib/{shared-utils-BeRiAkbe.js → shared-utils-BstybhBG.js} +2 -2
- package/dist-lib/{skills-BzpcX5fN.js → skills-CHPlMsgO.js} +40 -39
- package/dist-lib/{source-selection-DOL5LBrV.js → source-selection-tXqc855k.js} +16 -16
- package/dist-lib/{task-config-D0a7TOYt.js → task-config-BiTOiZj0.js} +4 -4
- package/dist-lib/{tech-CH01ekZ5.js → tech-BKlGPkV0.js} +4 -3
- package/dist-lib/{tools-YnTN61uE.js → tools-CouQ4FWk.js} +14 -14
- package/dist-lib/{use-domain-access-CXx1YzE5.js → use-domain-access-BPlNfoiP.js} +13 -13
- package/dist-lib/use-g6-graph-WLX0PweO.js +1119 -0
- package/dist-lib/{use-graph-layers-CowyyYcb.js → use-graph-layers-ja-ZIC_R.js} +50 -48
- package/dist-lib/useClosable-BY7FgWKy.js +59 -0
- package/dist-lib/useForm-Byp1LopG.js +145 -0
- package/dist-lib/{version-control-panel-CLy2ZXI_.js → version-control-panel-CkBm36Yk.js} +27 -26
- package/dist-lib/{version-management-C_v8w1E4.js → version-management-B4kIbdVc.js} +7 -6
- package/dist-lib/{welcome-ChEcA4Ej.js → welcome-F5iZoFB1.js} +4 -3
- package/package.json +2 -3
- package/dist-lib/EvidenceFormList-CrE2FzHk.js +0 -90
- package/dist-lib/ImpactPage-CYiuqy0S.js +0 -68
- package/dist-lib/OntologyMaterializePage-D_fDqYHY.js +0 -134
- package/dist-lib/OntologyNodesPage-5kH7RHwE.js +0 -2844
- package/dist-lib/PlusOutlined-BSTPGLOH.js +0 -21
- package/dist-lib/Skeleton-CxFsInYI.js +0 -671
- package/dist-lib/Table-Civ838nE.js +0 -20514
- package/dist-lib/TermDetailPage-BtkOpbPT.js +0 -263
- package/dist-lib/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist-lib/callSuper-CwIeyYoc.js +0 -7
- package/dist-lib/chunk-6KYCQHYJ-DcgZQlO5.js +0 -1627
- package/dist-lib/context-T27uno74.js +0 -54
- package/dist-lib/d3-force-Cr_oBTiR.js +0 -647
- package/dist-lib/embed-Bs3Hmsyy.js +0 -51377
- package/dist-lib/index-0TvzCTD7.js +0 -2336
- package/dist-lib/index-4tbtbcAt.js +0 -550
- package/dist-lib/index-B1wh6i1C.js +0 -1308
- package/dist-lib/index-BVgdmf6r.js +0 -2487
- package/dist-lib/index-CSnvcFg-.js +0 -543
- package/dist-lib/index-D35Ry0PG.js +0 -1162
- package/dist-lib/index-DC57_dnh.js +0 -604
- package/dist-lib/index-DQ16Zb7x.js +0 -546
- package/dist-lib/index-DRcTwC17.js +0 -418
- package/dist-lib/index-Dd9pPAT3.js +0 -2192
- package/dist-lib/index-DxzorPvG.js +0 -13960
- package/dist-lib/index-If4xc1-H.js +0 -559
- package/dist-lib/index-R71k3nB_.js +0 -710
- package/dist-lib/index-mUlorJxp.js +0 -3279
- package/dist-lib/ontology-modeling-CvJIImxt.js +0 -3612
- package/dist-lib/ontology-scenarios-BRDkk3uA.js +0 -675
- package/dist-lib/pages-CticGC6S.js +0 -512
- package/dist-lib/use-g6-graph-SwJtPLce.js +0 -57552
|
@@ -1,1627 +0,0 @@
|
|
|
1
|
-
import * as i from "react";
|
|
2
|
-
/**
|
|
3
|
-
* react-router v7.18.5
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Remix Software Inc.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
9
|
-
*
|
|
10
|
-
* @license MIT
|
|
11
|
-
*/
|
|
12
|
-
var ee = /^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i, He = /^[\\/]{2}/;
|
|
13
|
-
function je(e, t) {
|
|
14
|
-
return t + e.replace(/\\/g, "/");
|
|
15
|
-
}
|
|
16
|
-
function E(e, t) {
|
|
17
|
-
if (e === !1 || e === null || typeof e > "u")
|
|
18
|
-
throw new Error(t);
|
|
19
|
-
}
|
|
20
|
-
function L(e, t) {
|
|
21
|
-
if (!e) {
|
|
22
|
-
typeof console < "u" && console.warn(t);
|
|
23
|
-
try {
|
|
24
|
-
throw new Error(t);
|
|
25
|
-
} catch {
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
function H({
|
|
30
|
-
pathname: e = "/",
|
|
31
|
-
search: t = "",
|
|
32
|
-
hash: r = ""
|
|
33
|
-
}) {
|
|
34
|
-
return t && t !== "?" && (e += t.charAt(0) === "?" ? t : "?" + t), r && r !== "#" && (e += r.charAt(0) === "#" ? r : "#" + r), e;
|
|
35
|
-
}
|
|
36
|
-
function te(e) {
|
|
37
|
-
let t = {};
|
|
38
|
-
if (e) {
|
|
39
|
-
let r = e.indexOf("#");
|
|
40
|
-
r >= 0 && (t.hash = e.substring(r), e = e.substring(0, r));
|
|
41
|
-
let a = e.indexOf("?");
|
|
42
|
-
a >= 0 && (t.search = e.substring(a), e = e.substring(0, a)), e && (t.pathname = e);
|
|
43
|
-
}
|
|
44
|
-
return t;
|
|
45
|
-
}
|
|
46
|
-
function ve(e, t, r = "/") {
|
|
47
|
-
return Ve(e, t, r, !1);
|
|
48
|
-
}
|
|
49
|
-
function Ve(e, t, r, a, n) {
|
|
50
|
-
let o = typeof t == "string" ? te(t) : t, l = D(o.pathname || "/", r);
|
|
51
|
-
if (l == null)
|
|
52
|
-
return null;
|
|
53
|
-
let s = ze(e), u = null, d = rt(l);
|
|
54
|
-
for (let c = 0; u == null && c < s.length; ++c)
|
|
55
|
-
u = tt(
|
|
56
|
-
s[c],
|
|
57
|
-
d,
|
|
58
|
-
a
|
|
59
|
-
);
|
|
60
|
-
return u;
|
|
61
|
-
}
|
|
62
|
-
function ze(e) {
|
|
63
|
-
let t = ye(e);
|
|
64
|
-
return Je(t), t;
|
|
65
|
-
}
|
|
66
|
-
function ye(e, t = [], r = [], a = "", n = !1) {
|
|
67
|
-
let o = (l, s, u = n, d) => {
|
|
68
|
-
let c = {
|
|
69
|
-
relativePath: d === void 0 ? l.path || "" : d,
|
|
70
|
-
caseSensitive: l.caseSensitive === !0,
|
|
71
|
-
childrenIndex: s,
|
|
72
|
-
route: l
|
|
73
|
-
};
|
|
74
|
-
if (c.relativePath.startsWith("/")) {
|
|
75
|
-
if (!c.relativePath.startsWith(a) && u)
|
|
76
|
-
return;
|
|
77
|
-
E(
|
|
78
|
-
c.relativePath.startsWith(a),
|
|
79
|
-
`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
|
|
80
|
-
), c.relativePath = c.relativePath.slice(a.length);
|
|
81
|
-
}
|
|
82
|
-
let f = C([a, c.relativePath]), h = r.concat(c);
|
|
83
|
-
l.children && l.children.length > 0 && (E(
|
|
84
|
-
// Our types know better, but runtime JS may not!
|
|
85
|
-
// @ts-expect-error
|
|
86
|
-
l.index !== !0,
|
|
87
|
-
`Index routes must not have child routes. Please remove all child routes from route path "${f}".`
|
|
88
|
-
), ye(
|
|
89
|
-
l.children,
|
|
90
|
-
t,
|
|
91
|
-
h,
|
|
92
|
-
f,
|
|
93
|
-
u
|
|
94
|
-
)), !(l.path == null && !l.index) && t.push({
|
|
95
|
-
path: f,
|
|
96
|
-
score: Ze(f, l.index),
|
|
97
|
-
routesMeta: h.map((p, g) => {
|
|
98
|
-
let [v, m] = Ee(
|
|
99
|
-
p.relativePath,
|
|
100
|
-
p.caseSensitive,
|
|
101
|
-
g === h.length - 1
|
|
102
|
-
);
|
|
103
|
-
return {
|
|
104
|
-
...p,
|
|
105
|
-
matcher: v,
|
|
106
|
-
compiledParams: m
|
|
107
|
-
};
|
|
108
|
-
})
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
return e.forEach((l, s) => {
|
|
112
|
-
var u;
|
|
113
|
-
if (l.path === "" || !((u = l.path) != null && u.includes("?")))
|
|
114
|
-
o(l, s);
|
|
115
|
-
else
|
|
116
|
-
for (let d of Re(l.path))
|
|
117
|
-
o(l, s, !0, d);
|
|
118
|
-
}), t;
|
|
119
|
-
}
|
|
120
|
-
function Re(e) {
|
|
121
|
-
let t = e.split("/");
|
|
122
|
-
if (t.length === 0) return [];
|
|
123
|
-
let [r, ...a] = t, n = r.endsWith("?"), o = r.replace(/\?$/, "");
|
|
124
|
-
if (a.length === 0)
|
|
125
|
-
return n ? [o, ""] : [o];
|
|
126
|
-
let l = Re(a.join("/")), s = [];
|
|
127
|
-
return s.push(
|
|
128
|
-
...l.map(
|
|
129
|
-
(u) => u === "" ? o : [o, u].join("/")
|
|
130
|
-
)
|
|
131
|
-
), n && s.push(...l), s.map(
|
|
132
|
-
(u) => e.startsWith("/") && u === "" ? "/" : u
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
function Je(e) {
|
|
136
|
-
e.sort(
|
|
137
|
-
(t, r) => t.score !== r.score ? r.score - t.score : et(
|
|
138
|
-
t.routesMeta.map((a) => a.childrenIndex),
|
|
139
|
-
r.routesMeta.map((a) => a.childrenIndex)
|
|
140
|
-
)
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
var Ke = /^:[\w-]+$/, qe = 3, Ge = 2, Ye = 1, Xe = 10, Qe = -2, de = (e) => e === "*";
|
|
144
|
-
function Ze(e, t) {
|
|
145
|
-
let r = e.split("/"), a = r.length;
|
|
146
|
-
return r.some(de) && (a += Qe), t && (a += Ge), r.filter((n) => !de(n)).reduce(
|
|
147
|
-
(n, o) => n + (Ke.test(o) ? qe : o === "" ? Ye : Xe),
|
|
148
|
-
a
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
function et(e, t) {
|
|
152
|
-
return e.length === t.length && e.slice(0, -1).every((a, n) => a === t[n]) ? (
|
|
153
|
-
// If two routes are siblings, we should try to match the earlier sibling
|
|
154
|
-
// first. This allows people to have fine-grained control over the matching
|
|
155
|
-
// behavior by simply putting routes with identical paths in the order they
|
|
156
|
-
// want them tried.
|
|
157
|
-
e[e.length - 1] - t[t.length - 1]
|
|
158
|
-
) : (
|
|
159
|
-
// Otherwise, it doesn't really make sense to rank non-siblings by index,
|
|
160
|
-
// so they sort equally.
|
|
161
|
-
0
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
function tt(e, t, r = !1) {
|
|
165
|
-
let { routesMeta: a } = e, n = {}, o = "/", l = [];
|
|
166
|
-
for (let s = 0; s < a.length; ++s) {
|
|
167
|
-
let u = a[s], d = s === a.length - 1, c = o === "/" ? t : t.slice(o.length) || "/", f = {
|
|
168
|
-
path: u.relativePath,
|
|
169
|
-
caseSensitive: u.caseSensitive,
|
|
170
|
-
end: d
|
|
171
|
-
}, h = (
|
|
172
|
-
// Use precomputed matcher if it exists
|
|
173
|
-
u.matcher && u.compiledParams ? we(
|
|
174
|
-
f,
|
|
175
|
-
c,
|
|
176
|
-
u.matcher,
|
|
177
|
-
u.compiledParams
|
|
178
|
-
) : j(f, c)
|
|
179
|
-
), p = u.route;
|
|
180
|
-
if (!h && d && r && !a[a.length - 1].route.index && (h = j(
|
|
181
|
-
{
|
|
182
|
-
path: u.relativePath,
|
|
183
|
-
caseSensitive: u.caseSensitive,
|
|
184
|
-
end: !1
|
|
185
|
-
},
|
|
186
|
-
c
|
|
187
|
-
)), !h)
|
|
188
|
-
return null;
|
|
189
|
-
Object.assign(n, h.params), l.push({
|
|
190
|
-
// TODO: Can this as be avoided?
|
|
191
|
-
params: n,
|
|
192
|
-
pathname: C([o, h.pathname]),
|
|
193
|
-
pathnameBase: ot(
|
|
194
|
-
C([o, h.pathnameBase])
|
|
195
|
-
),
|
|
196
|
-
route: p
|
|
197
|
-
}), h.pathnameBase !== "/" && (o = C([o, h.pathnameBase]));
|
|
198
|
-
}
|
|
199
|
-
return l;
|
|
200
|
-
}
|
|
201
|
-
function j(e, t) {
|
|
202
|
-
typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
|
|
203
|
-
let [r, a] = Ee(
|
|
204
|
-
e.path,
|
|
205
|
-
e.caseSensitive,
|
|
206
|
-
e.end
|
|
207
|
-
);
|
|
208
|
-
return we(e, t, r, a);
|
|
209
|
-
}
|
|
210
|
-
function we(e, t, r, a) {
|
|
211
|
-
let n = t.match(r);
|
|
212
|
-
if (!n) return null;
|
|
213
|
-
let o = n[0], l = N(o, 1), s = n.slice(1);
|
|
214
|
-
return {
|
|
215
|
-
params: a.reduce(
|
|
216
|
-
(d, { paramName: c, isOptional: f }, h) => {
|
|
217
|
-
if (c === "*") {
|
|
218
|
-
let g = s[h] || "";
|
|
219
|
-
l = N(
|
|
220
|
-
o.slice(0, o.length - g.length),
|
|
221
|
-
1
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
const p = s[h];
|
|
225
|
-
return f && !p ? d[c] = void 0 : d[c] = (p || "").replace(/%2F/g, "/"), d;
|
|
226
|
-
},
|
|
227
|
-
{}
|
|
228
|
-
),
|
|
229
|
-
pathname: o,
|
|
230
|
-
pathnameBase: l,
|
|
231
|
-
pattern: e
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
function Ee(e, t = !1, r = !0) {
|
|
235
|
-
L(
|
|
236
|
-
e === "*" || !e.endsWith("*") || e.endsWith("/*"),
|
|
237
|
-
`Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`
|
|
238
|
-
);
|
|
239
|
-
let a = [], n = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
|
|
240
|
-
/\/:([\w-]+)(\?)?/g,
|
|
241
|
-
(l, s, u, d, c) => {
|
|
242
|
-
if (a.push({ paramName: s, isOptional: u != null }), u) {
|
|
243
|
-
let f = c.charAt(d + l.length);
|
|
244
|
-
return f && f !== "/" ? "/([^\\/]*)" : "(?:/([^\\/]*))?";
|
|
245
|
-
}
|
|
246
|
-
return "/([^\\/]+)";
|
|
247
|
-
}
|
|
248
|
-
).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
|
|
249
|
-
return e.endsWith("*") ? (a.push({ paramName: "*" }), n += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : r ? n += "\\/*$" : e !== "" && e !== "/" && (n += "(?:(?=\\/|$))"), [new RegExp(n, t ? void 0 : "i"), a];
|
|
250
|
-
}
|
|
251
|
-
function rt(e) {
|
|
252
|
-
try {
|
|
253
|
-
return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
|
|
254
|
-
} catch (t) {
|
|
255
|
-
return L(
|
|
256
|
-
!1,
|
|
257
|
-
`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`
|
|
258
|
-
), e;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
function D(e, t) {
|
|
262
|
-
if (t === "/") return e;
|
|
263
|
-
if (!e.toLowerCase().startsWith(t.toLowerCase()))
|
|
264
|
-
return null;
|
|
265
|
-
let r = t.endsWith("/") ? t.length - 1 : t.length, a = e.charAt(r);
|
|
266
|
-
return a && a !== "/" ? null : e.slice(r) || "/";
|
|
267
|
-
}
|
|
268
|
-
function nt(e, t = "/") {
|
|
269
|
-
let {
|
|
270
|
-
pathname: r,
|
|
271
|
-
search: a = "",
|
|
272
|
-
hash: n = ""
|
|
273
|
-
} = typeof e == "string" ? te(e) : e, o;
|
|
274
|
-
return r ? (r = Ce(r), r.startsWith("/") || r.startsWith("\\") ? o = he(r.substring(1), "/") : o = he(r, t)) : o = t, {
|
|
275
|
-
pathname: o,
|
|
276
|
-
search: lt(a),
|
|
277
|
-
hash: it(n)
|
|
278
|
-
};
|
|
279
|
-
}
|
|
280
|
-
function he(e, t) {
|
|
281
|
-
let r = N(t).split("/");
|
|
282
|
-
return e.split("/").forEach((n) => {
|
|
283
|
-
n === ".." ? r.length > 1 && r.pop() : n !== "." && r.push(n);
|
|
284
|
-
}), r.length > 1 ? r.join("/") : "/";
|
|
285
|
-
}
|
|
286
|
-
function G(e, t, r, a) {
|
|
287
|
-
return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(
|
|
288
|
-
a
|
|
289
|
-
)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
|
|
290
|
-
}
|
|
291
|
-
function at(e) {
|
|
292
|
-
return e.filter(
|
|
293
|
-
(t, r) => r === 0 || t.route.path && t.route.path.length > 0
|
|
294
|
-
);
|
|
295
|
-
}
|
|
296
|
-
function xe(e) {
|
|
297
|
-
let t = at(e);
|
|
298
|
-
return t.map(
|
|
299
|
-
(r, a) => a === t.length - 1 ? r.pathname : r.pathnameBase
|
|
300
|
-
);
|
|
301
|
-
}
|
|
302
|
-
function re(e, t, r, a = !1) {
|
|
303
|
-
let n;
|
|
304
|
-
typeof e == "string" ? n = te(e) : (n = { ...e }, E(
|
|
305
|
-
!n.pathname || !n.pathname.includes("?"),
|
|
306
|
-
G("?", "pathname", "search", n)
|
|
307
|
-
), E(
|
|
308
|
-
!n.pathname || !n.pathname.includes("#"),
|
|
309
|
-
G("#", "pathname", "hash", n)
|
|
310
|
-
), E(
|
|
311
|
-
!n.search || !n.search.includes("#"),
|
|
312
|
-
G("#", "search", "hash", n)
|
|
313
|
-
));
|
|
314
|
-
let o = e === "" || n.pathname === "", l = o ? "/" : n.pathname, s;
|
|
315
|
-
if (l == null)
|
|
316
|
-
s = r;
|
|
317
|
-
else {
|
|
318
|
-
let f = t.length - 1;
|
|
319
|
-
if (!a && l.startsWith("..")) {
|
|
320
|
-
let h = l.split("/");
|
|
321
|
-
for (; h[0] === ".."; )
|
|
322
|
-
h.shift(), f -= 1;
|
|
323
|
-
n.pathname = h.join("/");
|
|
324
|
-
}
|
|
325
|
-
s = f >= 0 ? t[f] : "/";
|
|
326
|
-
}
|
|
327
|
-
let u = nt(n, s), d = l && l !== "/" && l.endsWith("/"), c = (o || l === ".") && r.endsWith("/");
|
|
328
|
-
return !u.pathname.endsWith("/") && (d || c) && (u.pathname += "/"), u;
|
|
329
|
-
}
|
|
330
|
-
var Ce = (e) => e.replace(/[\\/]{2,}/g, "/"), C = (e) => Ce(e.join("/"));
|
|
331
|
-
function N(e, t = 0) {
|
|
332
|
-
let r = e.length;
|
|
333
|
-
for (; r > t && e.charCodeAt(r - 1) === 47; )
|
|
334
|
-
r--;
|
|
335
|
-
return r === e.length ? e : e.slice(0, r);
|
|
336
|
-
}
|
|
337
|
-
var ot = (e) => N(e).replace(/^\/*/, "/"), lt = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, it = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, st = class {
|
|
338
|
-
constructor(e, t, r, a = !1) {
|
|
339
|
-
this.status = e, this.statusText = t || "", this.internal = a, r instanceof Error ? (this.data = r.toString(), this.error = r) : this.data = r;
|
|
340
|
-
}
|
|
341
|
-
};
|
|
342
|
-
function ut(e) {
|
|
343
|
-
return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
|
|
344
|
-
}
|
|
345
|
-
function ct(e) {
|
|
346
|
-
let t = e.map((r) => r.route.path).filter(Boolean);
|
|
347
|
-
return C(t) || "/";
|
|
348
|
-
}
|
|
349
|
-
var Se = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
350
|
-
function be(e, t) {
|
|
351
|
-
let r = e;
|
|
352
|
-
if (typeof r != "string" || !ee.test(r))
|
|
353
|
-
return {
|
|
354
|
-
absoluteURL: void 0,
|
|
355
|
-
isExternal: !1,
|
|
356
|
-
to: r
|
|
357
|
-
};
|
|
358
|
-
let a = r, n = !1;
|
|
359
|
-
if (Se)
|
|
360
|
-
try {
|
|
361
|
-
let o = new URL(window.location.href), l = He.test(r) ? new URL(je(r, o.protocol)) : new URL(r), s = D(l.pathname, t);
|
|
362
|
-
l.origin === o.origin && s != null ? r = s + l.search + l.hash : n = !0;
|
|
363
|
-
} catch {
|
|
364
|
-
L(
|
|
365
|
-
!1,
|
|
366
|
-
`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
367
|
-
);
|
|
368
|
-
}
|
|
369
|
-
return {
|
|
370
|
-
absoluteURL: a,
|
|
371
|
-
isExternal: n,
|
|
372
|
-
to: r
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
|
376
|
-
var me = new URL("http://localhost");
|
|
377
|
-
function Pe(e) {
|
|
378
|
-
if (e.createURL)
|
|
379
|
-
return e.createURL("/");
|
|
380
|
-
try {
|
|
381
|
-
return new URL(e.createHref("/"), me);
|
|
382
|
-
} catch {
|
|
383
|
-
return me;
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
function Y(e, t) {
|
|
387
|
-
return e.origin === t.origin && (e.origin !== "null" || e.protocol === t.protocol && e.host === t.host);
|
|
388
|
-
}
|
|
389
|
-
function ft(e, t) {
|
|
390
|
-
if (e.startsWith("//"))
|
|
391
|
-
return !0;
|
|
392
|
-
let r = t.protocol.toLowerCase();
|
|
393
|
-
return e.toLowerCase().startsWith(r) ? t.host === "" || e.slice(r.length).startsWith("//") : !1;
|
|
394
|
-
}
|
|
395
|
-
function Le(e, t, r, a) {
|
|
396
|
-
let n = null;
|
|
397
|
-
try {
|
|
398
|
-
n = e == null ? null : new URL(e, r);
|
|
399
|
-
} catch {
|
|
400
|
-
}
|
|
401
|
-
let o = new URL(t, r), l = n != null && !Y(n, r), s = !Y(o, r);
|
|
402
|
-
if (a === "reject") {
|
|
403
|
-
if (l || s)
|
|
404
|
-
throw new Error("External navigation is not allowed");
|
|
405
|
-
} else if (s && (n == null || !ft(e, n) || !Y(n, o)))
|
|
406
|
-
throw new Error("External navigation is not allowed");
|
|
407
|
-
}
|
|
408
|
-
var ke = [
|
|
409
|
-
"POST",
|
|
410
|
-
"PUT",
|
|
411
|
-
"PATCH",
|
|
412
|
-
"DELETE"
|
|
413
|
-
];
|
|
414
|
-
new Set(
|
|
415
|
-
ke
|
|
416
|
-
);
|
|
417
|
-
var dt = [
|
|
418
|
-
"GET",
|
|
419
|
-
...ke
|
|
420
|
-
];
|
|
421
|
-
new Set(dt);
|
|
422
|
-
var ht = [
|
|
423
|
-
"about:",
|
|
424
|
-
"blob:",
|
|
425
|
-
"chrome:",
|
|
426
|
-
"chrome-untrusted:",
|
|
427
|
-
"content:",
|
|
428
|
-
"data:",
|
|
429
|
-
"devtools:",
|
|
430
|
-
"file:",
|
|
431
|
-
"filesystem:",
|
|
432
|
-
// eslint-disable-next-line no-script-url
|
|
433
|
-
"javascript:"
|
|
434
|
-
];
|
|
435
|
-
function mt(e) {
|
|
436
|
-
try {
|
|
437
|
-
return ht.includes(new URL(e).protocol);
|
|
438
|
-
} catch {
|
|
439
|
-
return !1;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
var A = i.createContext(null);
|
|
443
|
-
A.displayName = "DataRouter";
|
|
444
|
-
var V = i.createContext(null);
|
|
445
|
-
V.displayName = "DataRouterState";
|
|
446
|
-
var $e = i.createContext(!1);
|
|
447
|
-
function pt() {
|
|
448
|
-
return i.useContext($e);
|
|
449
|
-
}
|
|
450
|
-
var Te = i.createContext({
|
|
451
|
-
isTransitioning: !1
|
|
452
|
-
});
|
|
453
|
-
Te.displayName = "ViewTransition";
|
|
454
|
-
var gt = i.createContext(
|
|
455
|
-
/* @__PURE__ */ new Map()
|
|
456
|
-
);
|
|
457
|
-
gt.displayName = "Fetchers";
|
|
458
|
-
var vt = i.createContext(null);
|
|
459
|
-
vt.displayName = "Await";
|
|
460
|
-
var S = i.createContext(
|
|
461
|
-
null
|
|
462
|
-
);
|
|
463
|
-
S.displayName = "Navigation";
|
|
464
|
-
var ne = i.createContext(
|
|
465
|
-
null
|
|
466
|
-
);
|
|
467
|
-
ne.displayName = "Location";
|
|
468
|
-
var $ = i.createContext({
|
|
469
|
-
outlet: null,
|
|
470
|
-
matches: [],
|
|
471
|
-
isDataRoute: !1
|
|
472
|
-
});
|
|
473
|
-
$.displayName = "Route";
|
|
474
|
-
var ae = i.createContext(null);
|
|
475
|
-
ae.displayName = "RouteError";
|
|
476
|
-
var Ie = "REACT_ROUTER_ERROR", yt = "REDIRECT", Rt = "ROUTE_ERROR_RESPONSE";
|
|
477
|
-
function wt(e) {
|
|
478
|
-
if (e.startsWith(`${Ie}:${yt}:{`))
|
|
479
|
-
try {
|
|
480
|
-
let t = JSON.parse(e.slice(28));
|
|
481
|
-
if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string" && typeof t.location == "string" && typeof t.reloadDocument == "boolean" && typeof t.replace == "boolean")
|
|
482
|
-
return t;
|
|
483
|
-
} catch {
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
function Et(e) {
|
|
487
|
-
if (e.startsWith(
|
|
488
|
-
`${Ie}:${Rt}:{`
|
|
489
|
-
))
|
|
490
|
-
try {
|
|
491
|
-
let t = JSON.parse(e.slice(40));
|
|
492
|
-
if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string")
|
|
493
|
-
return new st(
|
|
494
|
-
t.status,
|
|
495
|
-
t.statusText,
|
|
496
|
-
t.data
|
|
497
|
-
);
|
|
498
|
-
} catch {
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
function xt(e, { relative: t } = {}) {
|
|
502
|
-
E(
|
|
503
|
-
z(),
|
|
504
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
505
|
-
// router loaded. We can help them understand how to avoid that.
|
|
506
|
-
"useHref() may be used only in the context of a <Router> component."
|
|
507
|
-
);
|
|
508
|
-
let { basename: r, navigator: a } = i.useContext(S), { hash: n, pathname: o, search: l } = M(e, { relative: t }), s = o;
|
|
509
|
-
return r !== "/" && (s = o === "/" ? r : C([r, o])), a.createHref({ pathname: s, search: l, hash: n });
|
|
510
|
-
}
|
|
511
|
-
function z() {
|
|
512
|
-
return i.useContext(ne) != null;
|
|
513
|
-
}
|
|
514
|
-
function k() {
|
|
515
|
-
return E(
|
|
516
|
-
z(),
|
|
517
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
518
|
-
// router loaded. We can help them understand how to avoid that.
|
|
519
|
-
"useLocation() may be used only in the context of a <Router> component."
|
|
520
|
-
), i.useContext(ne).location;
|
|
521
|
-
}
|
|
522
|
-
var De = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
523
|
-
function Fe(e) {
|
|
524
|
-
i.useContext(S).static || i.useLayoutEffect(e);
|
|
525
|
-
}
|
|
526
|
-
function Ne() {
|
|
527
|
-
let { isDataRoute: e } = i.useContext($);
|
|
528
|
-
return e ? At() : Ct();
|
|
529
|
-
}
|
|
530
|
-
function Ct() {
|
|
531
|
-
E(
|
|
532
|
-
z(),
|
|
533
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
534
|
-
// router loaded. We can help them understand how to avoid that.
|
|
535
|
-
"useNavigate() may be used only in the context of a <Router> component."
|
|
536
|
-
);
|
|
537
|
-
let e = i.useContext(A), { basename: t, navigator: r } = i.useContext(S), { matches: a } = i.useContext($), { pathname: n } = k(), o = JSON.stringify(xe(a)), l = i.useRef(!1);
|
|
538
|
-
return Fe(() => {
|
|
539
|
-
l.current = !0;
|
|
540
|
-
}), i.useCallback(
|
|
541
|
-
(u, d = {}) => {
|
|
542
|
-
if (L(l.current, De), !l.current) return;
|
|
543
|
-
if (typeof u == "number") {
|
|
544
|
-
r.go(u);
|
|
545
|
-
return;
|
|
546
|
-
}
|
|
547
|
-
let c = re(
|
|
548
|
-
u,
|
|
549
|
-
JSON.parse(o),
|
|
550
|
-
n,
|
|
551
|
-
d.relative === "path"
|
|
552
|
-
);
|
|
553
|
-
e == null && t !== "/" && (c.pathname = c.pathname === "/" ? t : C([t, c.pathname])), Le(
|
|
554
|
-
typeof u == "string" ? u : H(u),
|
|
555
|
-
r.createHref(c),
|
|
556
|
-
Pe(r),
|
|
557
|
-
"reject"
|
|
558
|
-
), (d.replace ? r.replace : r.push)(
|
|
559
|
-
c,
|
|
560
|
-
d.state,
|
|
561
|
-
d
|
|
562
|
-
);
|
|
563
|
-
},
|
|
564
|
-
[
|
|
565
|
-
t,
|
|
566
|
-
r,
|
|
567
|
-
o,
|
|
568
|
-
n,
|
|
569
|
-
e
|
|
570
|
-
]
|
|
571
|
-
);
|
|
572
|
-
}
|
|
573
|
-
i.createContext(null);
|
|
574
|
-
function M(e, { relative: t } = {}) {
|
|
575
|
-
let { matches: r } = i.useContext($), { pathname: a } = k(), n = JSON.stringify(xe(r));
|
|
576
|
-
return i.useMemo(
|
|
577
|
-
() => re(
|
|
578
|
-
e,
|
|
579
|
-
JSON.parse(n),
|
|
580
|
-
a,
|
|
581
|
-
t === "path"
|
|
582
|
-
),
|
|
583
|
-
[e, n, a, t]
|
|
584
|
-
);
|
|
585
|
-
}
|
|
586
|
-
function St(e, t, r) {
|
|
587
|
-
E(
|
|
588
|
-
z(),
|
|
589
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
590
|
-
// router loaded. We can help them understand how to avoid that.
|
|
591
|
-
"useRoutes() may be used only in the context of a <Router> component."
|
|
592
|
-
);
|
|
593
|
-
let { navigator: a } = i.useContext(S), { matches: n } = i.useContext($), o = n[n.length - 1], l = o ? o.params : {}, s = o ? o.pathname : "/", u = o ? o.pathnameBase : "/", d = o && o.route;
|
|
594
|
-
{
|
|
595
|
-
let m = d && d.path || "";
|
|
596
|
-
Ue(
|
|
597
|
-
s,
|
|
598
|
-
!d || m.endsWith("*") || m.endsWith("*?"),
|
|
599
|
-
`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${m}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
600
|
-
|
|
601
|
-
Please change the parent <Route path="${m}"> to <Route path="${m === "/" ? "*" : `${m}/*`}">.`
|
|
602
|
-
);
|
|
603
|
-
}
|
|
604
|
-
let c = k(), f;
|
|
605
|
-
f = c;
|
|
606
|
-
let h = f.pathname || "/", p = h;
|
|
607
|
-
if (u !== "/") {
|
|
608
|
-
let m = u.replace(/^\//, "").split("/");
|
|
609
|
-
p = "/" + h.replace(/^\//, "").split("/").slice(m.length).join("/");
|
|
610
|
-
}
|
|
611
|
-
let g = r && r.state.matches.length ? (
|
|
612
|
-
// If we're in a data router, use the matches we've already identified but ensure
|
|
613
|
-
// we have the latest route instances from the manifest in case elements have changed
|
|
614
|
-
r.state.matches.map(
|
|
615
|
-
(m) => Object.assign(m, {
|
|
616
|
-
route: r.manifest[m.route.id] || m.route
|
|
617
|
-
})
|
|
618
|
-
)
|
|
619
|
-
) : ve(e, { pathname: p });
|
|
620
|
-
return L(
|
|
621
|
-
d || g != null,
|
|
622
|
-
`No routes matched location "${f.pathname}${f.search}${f.hash}" `
|
|
623
|
-
), L(
|
|
624
|
-
g == null || g[g.length - 1].route.element !== void 0 || g[g.length - 1].route.Component !== void 0 || g[g.length - 1].route.lazy !== void 0,
|
|
625
|
-
`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
|
|
626
|
-
), $t(
|
|
627
|
-
g && g.map(
|
|
628
|
-
(m) => Object.assign({}, m, {
|
|
629
|
-
params: Object.assign({}, l, m.params),
|
|
630
|
-
pathname: C([
|
|
631
|
-
u,
|
|
632
|
-
// Re-encode pathnames that were decoded inside matchRoutes.
|
|
633
|
-
// Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
|
|
634
|
-
// `new URL()` internally and we need to prevent it from treating
|
|
635
|
-
// them as separators
|
|
636
|
-
a.encodeLocation ? a.encodeLocation(
|
|
637
|
-
m.pathname.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
|
|
638
|
-
).pathname : m.pathname
|
|
639
|
-
]),
|
|
640
|
-
pathnameBase: m.pathnameBase === "/" ? u : C([
|
|
641
|
-
u,
|
|
642
|
-
// Re-encode pathnames that were decoded inside matchRoutes
|
|
643
|
-
// Pre-encode `%`, `?` and `#` ahead of `encodeLocation` because it uses
|
|
644
|
-
// `new URL()` internally and we need to prevent it from treating
|
|
645
|
-
// them as separators
|
|
646
|
-
a.encodeLocation ? a.encodeLocation(
|
|
647
|
-
m.pathnameBase.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23")
|
|
648
|
-
).pathname : m.pathnameBase
|
|
649
|
-
])
|
|
650
|
-
})
|
|
651
|
-
),
|
|
652
|
-
n,
|
|
653
|
-
r
|
|
654
|
-
);
|
|
655
|
-
}
|
|
656
|
-
function bt() {
|
|
657
|
-
let e = Nt(), t = ut(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), r = e instanceof Error ? e.stack : null, a = "rgba(200,200,200, 0.5)", n = { padding: "0.5rem", backgroundColor: a }, o = { padding: "2px 4px", backgroundColor: a }, l = null;
|
|
658
|
-
return console.error(
|
|
659
|
-
"Error handled by React Router default ErrorBoundary:",
|
|
660
|
-
e
|
|
661
|
-
), l = /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ i.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ i.createElement("code", { style: o }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ i.createElement("code", { style: o }, "errorElement"), " prop on your route.")), /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ i.createElement("h3", { style: { fontStyle: "italic" } }, t), r ? /* @__PURE__ */ i.createElement("pre", { style: n }, r) : null, l);
|
|
662
|
-
}
|
|
663
|
-
var Pt = /* @__PURE__ */ i.createElement(bt, null), Ae = class extends i.Component {
|
|
664
|
-
constructor(e) {
|
|
665
|
-
super(e), this.state = {
|
|
666
|
-
location: e.location,
|
|
667
|
-
revalidation: e.revalidation,
|
|
668
|
-
error: e.error
|
|
669
|
-
};
|
|
670
|
-
}
|
|
671
|
-
static getDerivedStateFromError(e) {
|
|
672
|
-
return { error: e };
|
|
673
|
-
}
|
|
674
|
-
static getDerivedStateFromProps(e, t) {
|
|
675
|
-
return t.location !== e.location || t.revalidation !== "idle" && e.revalidation === "idle" ? {
|
|
676
|
-
error: e.error,
|
|
677
|
-
location: e.location,
|
|
678
|
-
revalidation: e.revalidation
|
|
679
|
-
} : {
|
|
680
|
-
error: e.error !== void 0 ? e.error : t.error,
|
|
681
|
-
location: t.location,
|
|
682
|
-
revalidation: e.revalidation || t.revalidation
|
|
683
|
-
};
|
|
684
|
-
}
|
|
685
|
-
componentDidCatch(e, t) {
|
|
686
|
-
this.props.onError ? this.props.onError(e, t) : console.error(
|
|
687
|
-
"React Router caught the following error during render",
|
|
688
|
-
e
|
|
689
|
-
);
|
|
690
|
-
}
|
|
691
|
-
render() {
|
|
692
|
-
let e = this.state.error;
|
|
693
|
-
if (this.context && typeof e == "object" && e && "digest" in e && typeof e.digest == "string") {
|
|
694
|
-
const r = Et(e.digest);
|
|
695
|
-
r && (e = r);
|
|
696
|
-
}
|
|
697
|
-
let t = e !== void 0 ? /* @__PURE__ */ i.createElement($.Provider, { value: this.props.routeContext }, /* @__PURE__ */ i.createElement(
|
|
698
|
-
ae.Provider,
|
|
699
|
-
{
|
|
700
|
-
value: e,
|
|
701
|
-
children: this.props.component
|
|
702
|
-
}
|
|
703
|
-
)) : this.props.children;
|
|
704
|
-
return this.context ? /* @__PURE__ */ i.createElement(Lt, { error: e }, t) : t;
|
|
705
|
-
}
|
|
706
|
-
};
|
|
707
|
-
Ae.contextType = $e;
|
|
708
|
-
var X = /* @__PURE__ */ new WeakMap();
|
|
709
|
-
function Lt({
|
|
710
|
-
children: e,
|
|
711
|
-
error: t
|
|
712
|
-
}) {
|
|
713
|
-
let { basename: r, navigator: a } = i.useContext(S);
|
|
714
|
-
if (typeof t == "object" && t && "digest" in t && typeof t.digest == "string") {
|
|
715
|
-
let n = wt(t.digest);
|
|
716
|
-
if (n) {
|
|
717
|
-
let o = X.get(t);
|
|
718
|
-
if (o) throw o;
|
|
719
|
-
let l = be(n.location, r), s = l.absoluteURL || l.to;
|
|
720
|
-
if (Le(
|
|
721
|
-
n.location,
|
|
722
|
-
s,
|
|
723
|
-
Pe(a),
|
|
724
|
-
"allow-explicit"
|
|
725
|
-
), mt(s))
|
|
726
|
-
throw new Error("Invalid redirect location");
|
|
727
|
-
if (Se && !X.get(t))
|
|
728
|
-
if (l.isExternal || n.reloadDocument)
|
|
729
|
-
window.location.href = s;
|
|
730
|
-
else {
|
|
731
|
-
const u = Promise.resolve().then(
|
|
732
|
-
() => window.__reactRouterDataRouter.navigate(l.to, {
|
|
733
|
-
replace: n.replace
|
|
734
|
-
})
|
|
735
|
-
);
|
|
736
|
-
throw X.set(t, u), u;
|
|
737
|
-
}
|
|
738
|
-
return /* @__PURE__ */ i.createElement("meta", { httpEquiv: "refresh", content: `0;url=${s}` });
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
return e;
|
|
742
|
-
}
|
|
743
|
-
function kt({ routeContext: e, match: t, children: r }) {
|
|
744
|
-
let a = i.useContext(A);
|
|
745
|
-
return a && a.static && a.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ i.createElement($.Provider, { value: e }, r);
|
|
746
|
-
}
|
|
747
|
-
function $t(e, t = [], r) {
|
|
748
|
-
let a = r == null ? void 0 : r.state;
|
|
749
|
-
if (e == null) {
|
|
750
|
-
if (!a)
|
|
751
|
-
return null;
|
|
752
|
-
if (a.errors)
|
|
753
|
-
e = a.matches;
|
|
754
|
-
else if (t.length === 0 && !a.initialized && a.matches.length > 0)
|
|
755
|
-
e = a.matches;
|
|
756
|
-
else
|
|
757
|
-
return null;
|
|
758
|
-
}
|
|
759
|
-
let n = e, o = a == null ? void 0 : a.errors;
|
|
760
|
-
if (o != null) {
|
|
761
|
-
let c = n.findIndex(
|
|
762
|
-
(f) => f.route.id && (o == null ? void 0 : o[f.route.id]) !== void 0
|
|
763
|
-
);
|
|
764
|
-
E(
|
|
765
|
-
c >= 0,
|
|
766
|
-
`Could not find a matching route for errors on route IDs: ${Object.keys(
|
|
767
|
-
o
|
|
768
|
-
).join(",")}`
|
|
769
|
-
), n = n.slice(
|
|
770
|
-
0,
|
|
771
|
-
Math.min(n.length, c + 1)
|
|
772
|
-
);
|
|
773
|
-
}
|
|
774
|
-
let l = !1, s = -1;
|
|
775
|
-
if (r && a) {
|
|
776
|
-
l = a.renderFallback;
|
|
777
|
-
for (let c = 0; c < n.length; c++) {
|
|
778
|
-
let f = n[c];
|
|
779
|
-
if ((f.route.HydrateFallback || f.route.hydrateFallbackElement) && (s = c), f.route.id) {
|
|
780
|
-
let { loaderData: h, errors: p } = a, g = f.route.loader && !h.hasOwnProperty(f.route.id) && (!p || p[f.route.id] === void 0);
|
|
781
|
-
if (f.route.lazy || g) {
|
|
782
|
-
r.isStatic && (l = !0), s >= 0 ? n = n.slice(0, s + 1) : n = [n[0]];
|
|
783
|
-
break;
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
let u = r == null ? void 0 : r.onError, d = a && u ? (c, f) => {
|
|
789
|
-
var h, p;
|
|
790
|
-
u(c, {
|
|
791
|
-
location: a.location,
|
|
792
|
-
params: ((p = (h = a.matches) == null ? void 0 : h[0]) == null ? void 0 : p.params) ?? {},
|
|
793
|
-
pattern: ct(a.matches),
|
|
794
|
-
errorInfo: f
|
|
795
|
-
});
|
|
796
|
-
} : void 0;
|
|
797
|
-
return n.reduceRight(
|
|
798
|
-
(c, f, h) => {
|
|
799
|
-
let p, g = !1, v = null, m = null;
|
|
800
|
-
a && (p = o && f.route.id ? o[f.route.id] : void 0, v = f.route.errorElement || Pt, l && (s < 0 && h === 0 ? (Ue(
|
|
801
|
-
"route-fallback",
|
|
802
|
-
!1,
|
|
803
|
-
"No `HydrateFallback` element provided to render during initial hydration"
|
|
804
|
-
), g = !0, m = null) : s === h && (g = !0, m = f.route.hydrateFallbackElement || null)));
|
|
805
|
-
let R = t.concat(n.slice(0, h + 1)), w = () => {
|
|
806
|
-
let y;
|
|
807
|
-
return p ? y = v : g ? y = m : f.route.Component ? y = /* @__PURE__ */ i.createElement(f.route.Component, null) : f.route.element ? y = f.route.element : y = c, /* @__PURE__ */ i.createElement(
|
|
808
|
-
kt,
|
|
809
|
-
{
|
|
810
|
-
match: f,
|
|
811
|
-
routeContext: {
|
|
812
|
-
outlet: c,
|
|
813
|
-
matches: R,
|
|
814
|
-
isDataRoute: a != null
|
|
815
|
-
},
|
|
816
|
-
children: y
|
|
817
|
-
}
|
|
818
|
-
);
|
|
819
|
-
};
|
|
820
|
-
return a && (f.route.ErrorBoundary || f.route.errorElement || h === 0) ? /* @__PURE__ */ i.createElement(
|
|
821
|
-
Ae,
|
|
822
|
-
{
|
|
823
|
-
location: a.location,
|
|
824
|
-
revalidation: a.revalidation,
|
|
825
|
-
component: v,
|
|
826
|
-
error: p,
|
|
827
|
-
children: w(),
|
|
828
|
-
routeContext: { outlet: null, matches: R, isDataRoute: !0 },
|
|
829
|
-
onError: d
|
|
830
|
-
}
|
|
831
|
-
) : w();
|
|
832
|
-
},
|
|
833
|
-
null
|
|
834
|
-
);
|
|
835
|
-
}
|
|
836
|
-
function oe(e) {
|
|
837
|
-
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
838
|
-
}
|
|
839
|
-
function Tt(e) {
|
|
840
|
-
let t = i.useContext(A);
|
|
841
|
-
return E(t, oe(e)), t;
|
|
842
|
-
}
|
|
843
|
-
function It(e) {
|
|
844
|
-
let t = i.useContext(V);
|
|
845
|
-
return E(t, oe(e)), t;
|
|
846
|
-
}
|
|
847
|
-
function Dt(e) {
|
|
848
|
-
let t = i.useContext($);
|
|
849
|
-
return E(t, oe(e)), t;
|
|
850
|
-
}
|
|
851
|
-
function le(e) {
|
|
852
|
-
let t = Dt(e), r = t.matches[t.matches.length - 1];
|
|
853
|
-
return E(
|
|
854
|
-
r.route.id,
|
|
855
|
-
`${e} can only be used on routes that contain a unique "id"`
|
|
856
|
-
), r.route.id;
|
|
857
|
-
}
|
|
858
|
-
function Ft() {
|
|
859
|
-
return le(
|
|
860
|
-
"useRouteId"
|
|
861
|
-
/* UseRouteId */
|
|
862
|
-
);
|
|
863
|
-
}
|
|
864
|
-
function Nt() {
|
|
865
|
-
var a;
|
|
866
|
-
let e = i.useContext(ae), t = It(
|
|
867
|
-
"useRouteError"
|
|
868
|
-
/* UseRouteError */
|
|
869
|
-
), r = le(
|
|
870
|
-
"useRouteError"
|
|
871
|
-
/* UseRouteError */
|
|
872
|
-
);
|
|
873
|
-
return e !== void 0 ? e : (a = t.errors) == null ? void 0 : a[r];
|
|
874
|
-
}
|
|
875
|
-
function At() {
|
|
876
|
-
let { router: e } = Tt(
|
|
877
|
-
"useNavigate"
|
|
878
|
-
/* UseNavigateStable */
|
|
879
|
-
), t = le(
|
|
880
|
-
"useNavigate"
|
|
881
|
-
/* UseNavigateStable */
|
|
882
|
-
), r = i.useRef(!1);
|
|
883
|
-
return Fe(() => {
|
|
884
|
-
r.current = !0;
|
|
885
|
-
}), i.useCallback(
|
|
886
|
-
async (n, o = {}) => {
|
|
887
|
-
L(r.current, De), r.current && (typeof n == "number" ? await e.navigate(n) : await e.navigate(n, { fromRouteId: t, ...o }));
|
|
888
|
-
},
|
|
889
|
-
[e, t]
|
|
890
|
-
);
|
|
891
|
-
}
|
|
892
|
-
var pe = {};
|
|
893
|
-
function Ue(e, t, r) {
|
|
894
|
-
!t && !pe[e] && (pe[e] = !0, L(!1, r));
|
|
895
|
-
}
|
|
896
|
-
i.memo(Ut);
|
|
897
|
-
function Ut({
|
|
898
|
-
routes: e,
|
|
899
|
-
manifest: t,
|
|
900
|
-
future: r,
|
|
901
|
-
state: a,
|
|
902
|
-
isStatic: n,
|
|
903
|
-
onError: o
|
|
904
|
-
}) {
|
|
905
|
-
return St(e, void 0, {
|
|
906
|
-
manifest: t,
|
|
907
|
-
state: a,
|
|
908
|
-
isStatic: n,
|
|
909
|
-
onError: o
|
|
910
|
-
});
|
|
911
|
-
}
|
|
912
|
-
var W = "get", B = "application/x-www-form-urlencoded";
|
|
913
|
-
function J(e) {
|
|
914
|
-
return typeof HTMLElement < "u" && e instanceof HTMLElement;
|
|
915
|
-
}
|
|
916
|
-
function _t(e) {
|
|
917
|
-
return J(e) && e.tagName.toLowerCase() === "button";
|
|
918
|
-
}
|
|
919
|
-
function Mt(e) {
|
|
920
|
-
return J(e) && e.tagName.toLowerCase() === "form";
|
|
921
|
-
}
|
|
922
|
-
function Ot(e) {
|
|
923
|
-
return J(e) && e.tagName.toLowerCase() === "input";
|
|
924
|
-
}
|
|
925
|
-
function Wt(e) {
|
|
926
|
-
return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
|
|
927
|
-
}
|
|
928
|
-
function Bt(e, t) {
|
|
929
|
-
return e.button === 0 && // Ignore everything but left clicks
|
|
930
|
-
(!t || t === "_self") && // Let browser handle "target=_blank" etc.
|
|
931
|
-
!Wt(e);
|
|
932
|
-
}
|
|
933
|
-
function Z(e = "") {
|
|
934
|
-
return new URLSearchParams(
|
|
935
|
-
typeof e == "string" || Array.isArray(e) || e instanceof URLSearchParams ? e : Object.keys(e).reduce((t, r) => {
|
|
936
|
-
let a = e[r];
|
|
937
|
-
return t.concat(
|
|
938
|
-
Array.isArray(a) ? a.map((n) => [r, n]) : [[r, a]]
|
|
939
|
-
);
|
|
940
|
-
}, [])
|
|
941
|
-
);
|
|
942
|
-
}
|
|
943
|
-
function Ht(e, t) {
|
|
944
|
-
let r = Z(e);
|
|
945
|
-
return t && t.forEach((a, n) => {
|
|
946
|
-
r.has(n) || t.getAll(n).forEach((o) => {
|
|
947
|
-
r.append(n, o);
|
|
948
|
-
});
|
|
949
|
-
}), r;
|
|
950
|
-
}
|
|
951
|
-
var O = null;
|
|
952
|
-
function jt() {
|
|
953
|
-
if (O === null)
|
|
954
|
-
try {
|
|
955
|
-
new FormData(
|
|
956
|
-
document.createElement("form"),
|
|
957
|
-
// @ts-expect-error if FormData supports the submitter parameter, this will throw
|
|
958
|
-
0
|
|
959
|
-
), O = !1;
|
|
960
|
-
} catch {
|
|
961
|
-
O = !0;
|
|
962
|
-
}
|
|
963
|
-
return O;
|
|
964
|
-
}
|
|
965
|
-
var Vt = /* @__PURE__ */ new Set([
|
|
966
|
-
"application/x-www-form-urlencoded",
|
|
967
|
-
"multipart/form-data",
|
|
968
|
-
"text/plain"
|
|
969
|
-
]);
|
|
970
|
-
function Q(e) {
|
|
971
|
-
return e != null && !Vt.has(e) ? (L(
|
|
972
|
-
!1,
|
|
973
|
-
`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${B}"`
|
|
974
|
-
), null) : e;
|
|
975
|
-
}
|
|
976
|
-
function zt(e, t) {
|
|
977
|
-
let r, a, n, o, l;
|
|
978
|
-
if (Mt(e)) {
|
|
979
|
-
let s = e.getAttribute("action");
|
|
980
|
-
a = s ? D(s, t) : null, r = e.getAttribute("method") || W, n = Q(e.getAttribute("enctype")) || B, o = new FormData(e);
|
|
981
|
-
} else if (_t(e) || Ot(e) && (e.type === "submit" || e.type === "image")) {
|
|
982
|
-
let s = e.form;
|
|
983
|
-
if (s == null)
|
|
984
|
-
throw new Error(
|
|
985
|
-
'Cannot submit a <button> or <input type="submit"> without a <form>'
|
|
986
|
-
);
|
|
987
|
-
let u = e.getAttribute("formaction") || s.getAttribute("action");
|
|
988
|
-
if (a = u ? D(u, t) : null, r = e.getAttribute("formmethod") || s.getAttribute("method") || W, n = Q(e.getAttribute("formenctype")) || Q(s.getAttribute("enctype")) || B, o = new FormData(s, e), !jt()) {
|
|
989
|
-
let { name: d, type: c, value: f } = e;
|
|
990
|
-
if (c === "image") {
|
|
991
|
-
let h = d ? `${d}.` : "";
|
|
992
|
-
o.append(`${h}x`, "0"), o.append(`${h}y`, "0");
|
|
993
|
-
} else d && o.append(d, f);
|
|
994
|
-
}
|
|
995
|
-
} else {
|
|
996
|
-
if (J(e))
|
|
997
|
-
throw new Error(
|
|
998
|
-
'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
|
|
999
|
-
);
|
|
1000
|
-
r = W, a = null, n = B, l = e;
|
|
1001
|
-
}
|
|
1002
|
-
return o && n === "text/plain" && (l = o, o = void 0), { action: a, method: r.toLowerCase(), encType: n, formData: o, body: l };
|
|
1003
|
-
}
|
|
1004
|
-
Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
|
|
1005
|
-
function ie(e, t) {
|
|
1006
|
-
if (e === !1 || e === null || typeof e > "u")
|
|
1007
|
-
throw new Error(t);
|
|
1008
|
-
}
|
|
1009
|
-
function _e(e, t, r, a) {
|
|
1010
|
-
let n = typeof e == "string" ? new URL(
|
|
1011
|
-
e,
|
|
1012
|
-
// This can be called during the SSR flow via PrefetchPageLinksImpl so
|
|
1013
|
-
// don't assume window is available
|
|
1014
|
-
typeof window > "u" ? "server://singlefetch/" : window.location.origin
|
|
1015
|
-
) : e;
|
|
1016
|
-
return r ? n.pathname.endsWith("/") ? n.pathname = `${n.pathname}_.${a}` : n.pathname = `${n.pathname}.${a}` : n.pathname === "/" ? n.pathname = `_root.${a}` : t && D(n.pathname, t) === "/" ? n.pathname = `${N(t)}/_root.${a}` : n.pathname = `${N(n.pathname)}.${a}`, n;
|
|
1017
|
-
}
|
|
1018
|
-
async function Jt(e, t) {
|
|
1019
|
-
if (e.id in t)
|
|
1020
|
-
return t[e.id];
|
|
1021
|
-
try {
|
|
1022
|
-
let r = await import(
|
|
1023
|
-
/* @vite-ignore */
|
|
1024
|
-
/* webpackIgnore: true */
|
|
1025
|
-
e.module
|
|
1026
|
-
);
|
|
1027
|
-
return t[e.id] = r, r;
|
|
1028
|
-
} catch (r) {
|
|
1029
|
-
return console.error(
|
|
1030
|
-
`Error loading route module \`${e.module}\`, reloading page...`
|
|
1031
|
-
), console.error(r), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {
|
|
1032
|
-
});
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
function Kt(e) {
|
|
1036
|
-
return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
|
|
1037
|
-
}
|
|
1038
|
-
async function qt(e, t, r) {
|
|
1039
|
-
let a = await Promise.all(
|
|
1040
|
-
e.map(async (n) => {
|
|
1041
|
-
let o = t.routes[n.route.id];
|
|
1042
|
-
if (o) {
|
|
1043
|
-
let l = await Jt(o, r);
|
|
1044
|
-
return l.links ? l.links() : [];
|
|
1045
|
-
}
|
|
1046
|
-
return [];
|
|
1047
|
-
})
|
|
1048
|
-
);
|
|
1049
|
-
return Qt(
|
|
1050
|
-
a.flat(1).filter(Kt).filter((n) => n.rel === "stylesheet" || n.rel === "preload").map(
|
|
1051
|
-
(n) => n.rel === "stylesheet" ? { ...n, rel: "prefetch", as: "style" } : { ...n, rel: "prefetch" }
|
|
1052
|
-
)
|
|
1053
|
-
);
|
|
1054
|
-
}
|
|
1055
|
-
function ge(e, t, r, a, n, o) {
|
|
1056
|
-
let l = (u, d) => r[d] ? u.route.id !== r[d].route.id : !0, s = (u, d) => {
|
|
1057
|
-
var c;
|
|
1058
|
-
return (
|
|
1059
|
-
// param change, /users/123 -> /users/456
|
|
1060
|
-
r[d].pathname !== u.pathname || // splat param changed, which is not present in match.path
|
|
1061
|
-
// e.g. /files/images/avatar.jpg -> files/finances.xls
|
|
1062
|
-
((c = r[d].route.path) == null ? void 0 : c.endsWith("*")) && r[d].params["*"] !== u.params["*"]
|
|
1063
|
-
);
|
|
1064
|
-
};
|
|
1065
|
-
return o === "assets" ? t.filter(
|
|
1066
|
-
(u, d) => l(u, d) || s(u, d)
|
|
1067
|
-
) : o === "data" ? t.filter((u, d) => {
|
|
1068
|
-
var f;
|
|
1069
|
-
let c = a.routes[u.route.id];
|
|
1070
|
-
if (!c || !c.hasLoader)
|
|
1071
|
-
return !1;
|
|
1072
|
-
if (l(u, d) || s(u, d))
|
|
1073
|
-
return !0;
|
|
1074
|
-
if (u.route.shouldRevalidate) {
|
|
1075
|
-
let h = u.route.shouldRevalidate({
|
|
1076
|
-
currentUrl: new URL(
|
|
1077
|
-
n.pathname + n.search + n.hash,
|
|
1078
|
-
window.origin
|
|
1079
|
-
),
|
|
1080
|
-
currentParams: ((f = r[0]) == null ? void 0 : f.params) || {},
|
|
1081
|
-
nextUrl: new URL(e, window.origin),
|
|
1082
|
-
nextParams: u.params,
|
|
1083
|
-
defaultShouldRevalidate: !0
|
|
1084
|
-
});
|
|
1085
|
-
if (typeof h == "boolean")
|
|
1086
|
-
return h;
|
|
1087
|
-
}
|
|
1088
|
-
return !0;
|
|
1089
|
-
}) : [];
|
|
1090
|
-
}
|
|
1091
|
-
function Gt(e, t, { includeHydrateFallback: r } = {}) {
|
|
1092
|
-
return Yt(
|
|
1093
|
-
e.map((a) => {
|
|
1094
|
-
let n = t.routes[a.route.id];
|
|
1095
|
-
if (!n) return [];
|
|
1096
|
-
let o = [n.module];
|
|
1097
|
-
return n.clientActionModule && (o = o.concat(n.clientActionModule)), n.clientLoaderModule && (o = o.concat(n.clientLoaderModule)), r && n.hydrateFallbackModule && (o = o.concat(n.hydrateFallbackModule)), n.imports && (o = o.concat(n.imports)), o;
|
|
1098
|
-
}).flat(1)
|
|
1099
|
-
);
|
|
1100
|
-
}
|
|
1101
|
-
function Yt(e) {
|
|
1102
|
-
return [...new Set(e)];
|
|
1103
|
-
}
|
|
1104
|
-
function Xt(e) {
|
|
1105
|
-
let t = {}, r = Object.keys(e).sort();
|
|
1106
|
-
for (let a of r)
|
|
1107
|
-
t[a] = e[a];
|
|
1108
|
-
return t;
|
|
1109
|
-
}
|
|
1110
|
-
function Qt(e, t) {
|
|
1111
|
-
let r = /* @__PURE__ */ new Set();
|
|
1112
|
-
return new Set(t), e.reduce((a, n) => {
|
|
1113
|
-
let o = JSON.stringify(Xt(n));
|
|
1114
|
-
return r.has(o) || (r.add(o), a.push({ key: o, link: n })), a;
|
|
1115
|
-
}, []);
|
|
1116
|
-
}
|
|
1117
|
-
function se() {
|
|
1118
|
-
let e = i.useContext(A);
|
|
1119
|
-
return ie(
|
|
1120
|
-
e,
|
|
1121
|
-
"You must render this element inside a <DataRouterContext.Provider> element"
|
|
1122
|
-
), e;
|
|
1123
|
-
}
|
|
1124
|
-
function Zt() {
|
|
1125
|
-
let e = i.useContext(V);
|
|
1126
|
-
return ie(
|
|
1127
|
-
e,
|
|
1128
|
-
"You must render this element inside a <DataRouterStateContext.Provider> element"
|
|
1129
|
-
), e;
|
|
1130
|
-
}
|
|
1131
|
-
var ue = i.createContext(void 0);
|
|
1132
|
-
ue.displayName = "FrameworkContext";
|
|
1133
|
-
function K() {
|
|
1134
|
-
let e = i.useContext(ue);
|
|
1135
|
-
return ie(
|
|
1136
|
-
e,
|
|
1137
|
-
"You must render this element inside a <HydratedRouter> element"
|
|
1138
|
-
), e;
|
|
1139
|
-
}
|
|
1140
|
-
function er(e, t) {
|
|
1141
|
-
let r = i.useContext(ue), [a, n] = i.useState(!1), [o, l] = i.useState(!1), { onFocus: s, onBlur: u, onMouseEnter: d, onMouseLeave: c, onTouchStart: f } = t, h = i.useRef(null);
|
|
1142
|
-
i.useEffect(() => {
|
|
1143
|
-
if (e === "render" && l(!0), e === "viewport") {
|
|
1144
|
-
let v = (R) => {
|
|
1145
|
-
R.forEach((w) => {
|
|
1146
|
-
l(w.isIntersecting);
|
|
1147
|
-
});
|
|
1148
|
-
}, m = new IntersectionObserver(v, { threshold: 0.5 });
|
|
1149
|
-
return h.current && m.observe(h.current), () => {
|
|
1150
|
-
m.disconnect();
|
|
1151
|
-
};
|
|
1152
|
-
}
|
|
1153
|
-
}, [e]), i.useEffect(() => {
|
|
1154
|
-
if (a) {
|
|
1155
|
-
let v = setTimeout(() => {
|
|
1156
|
-
l(!0);
|
|
1157
|
-
}, 100);
|
|
1158
|
-
return () => {
|
|
1159
|
-
clearTimeout(v);
|
|
1160
|
-
};
|
|
1161
|
-
}
|
|
1162
|
-
}, [a]);
|
|
1163
|
-
let p = () => {
|
|
1164
|
-
n(!0);
|
|
1165
|
-
}, g = () => {
|
|
1166
|
-
n(!1), l(!1);
|
|
1167
|
-
};
|
|
1168
|
-
return r ? e !== "intent" ? [o, h, {}] : [
|
|
1169
|
-
o,
|
|
1170
|
-
h,
|
|
1171
|
-
{
|
|
1172
|
-
onFocus: _(s, p),
|
|
1173
|
-
onBlur: _(u, g),
|
|
1174
|
-
onMouseEnter: _(d, p),
|
|
1175
|
-
onMouseLeave: _(c, g),
|
|
1176
|
-
onTouchStart: _(f, p)
|
|
1177
|
-
}
|
|
1178
|
-
] : [!1, h, {}];
|
|
1179
|
-
}
|
|
1180
|
-
function _(e, t) {
|
|
1181
|
-
return (r) => {
|
|
1182
|
-
e && e(r), r.defaultPrevented || t(r);
|
|
1183
|
-
};
|
|
1184
|
-
}
|
|
1185
|
-
function tr({ page: e, ...t }) {
|
|
1186
|
-
let r = pt(), { nonce: a } = K(), { router: n } = se(), o = i.useMemo(
|
|
1187
|
-
() => ve(n.routes, e, n.basename),
|
|
1188
|
-
[n.routes, e, n.basename]
|
|
1189
|
-
);
|
|
1190
|
-
return o ? (t.nonce == null && a && (t = { ...t, nonce: a }), r ? /* @__PURE__ */ i.createElement(nr, { page: e, matches: o, ...t }) : /* @__PURE__ */ i.createElement(ar, { page: e, matches: o, ...t })) : null;
|
|
1191
|
-
}
|
|
1192
|
-
function rr(e) {
|
|
1193
|
-
let { manifest: t, routeModules: r } = K(), [a, n] = i.useState([]);
|
|
1194
|
-
return i.useEffect(() => {
|
|
1195
|
-
let o = !1;
|
|
1196
|
-
return qt(e, t, r).then(
|
|
1197
|
-
(l) => {
|
|
1198
|
-
o || n(l);
|
|
1199
|
-
}
|
|
1200
|
-
), () => {
|
|
1201
|
-
o = !0;
|
|
1202
|
-
};
|
|
1203
|
-
}, [e, t, r]), a;
|
|
1204
|
-
}
|
|
1205
|
-
function nr({
|
|
1206
|
-
page: e,
|
|
1207
|
-
matches: t,
|
|
1208
|
-
...r
|
|
1209
|
-
}) {
|
|
1210
|
-
let a = k(), { future: n } = K(), { basename: o } = se(), l = i.useMemo(() => {
|
|
1211
|
-
if (e === a.pathname + a.search + a.hash)
|
|
1212
|
-
return [];
|
|
1213
|
-
let s = _e(
|
|
1214
|
-
e,
|
|
1215
|
-
o,
|
|
1216
|
-
n.v8_trailingSlashAwareDataRequests,
|
|
1217
|
-
"rsc"
|
|
1218
|
-
), u = !1, d = [];
|
|
1219
|
-
for (let c of t)
|
|
1220
|
-
typeof c.route.shouldRevalidate == "function" ? u = !0 : d.push(c.route.id);
|
|
1221
|
-
return u && d.length > 0 && s.searchParams.set("_routes", d.join(",")), [s.pathname + s.search];
|
|
1222
|
-
}, [
|
|
1223
|
-
o,
|
|
1224
|
-
n.v8_trailingSlashAwareDataRequests,
|
|
1225
|
-
e,
|
|
1226
|
-
a,
|
|
1227
|
-
t
|
|
1228
|
-
]);
|
|
1229
|
-
return /* @__PURE__ */ i.createElement(i.Fragment, null, l.map((s) => /* @__PURE__ */ i.createElement("link", { key: s, rel: "prefetch", as: "fetch", href: s, ...r })));
|
|
1230
|
-
}
|
|
1231
|
-
function ar({
|
|
1232
|
-
page: e,
|
|
1233
|
-
matches: t,
|
|
1234
|
-
...r
|
|
1235
|
-
}) {
|
|
1236
|
-
let a = k(), { future: n, manifest: o, routeModules: l } = K(), { basename: s } = se(), { loaderData: u, matches: d } = Zt(), c = i.useMemo(
|
|
1237
|
-
() => ge(
|
|
1238
|
-
e,
|
|
1239
|
-
t,
|
|
1240
|
-
d,
|
|
1241
|
-
o,
|
|
1242
|
-
a,
|
|
1243
|
-
"data"
|
|
1244
|
-
),
|
|
1245
|
-
[e, t, d, o, a]
|
|
1246
|
-
), f = i.useMemo(
|
|
1247
|
-
() => ge(
|
|
1248
|
-
e,
|
|
1249
|
-
t,
|
|
1250
|
-
d,
|
|
1251
|
-
o,
|
|
1252
|
-
a,
|
|
1253
|
-
"assets"
|
|
1254
|
-
),
|
|
1255
|
-
[e, t, d, o, a]
|
|
1256
|
-
), h = i.useMemo(() => {
|
|
1257
|
-
if (e === a.pathname + a.search + a.hash)
|
|
1258
|
-
return [];
|
|
1259
|
-
let v = /* @__PURE__ */ new Set(), m = !1;
|
|
1260
|
-
if (t.forEach((w) => {
|
|
1261
|
-
var b;
|
|
1262
|
-
let y = o.routes[w.route.id];
|
|
1263
|
-
!y || !y.hasLoader || (!c.some((x) => x.route.id === w.route.id) && w.route.id in u && ((b = l[w.route.id]) != null && b.shouldRevalidate) || y.hasClientLoader ? m = !0 : v.add(w.route.id));
|
|
1264
|
-
}), v.size === 0)
|
|
1265
|
-
return [];
|
|
1266
|
-
let R = _e(
|
|
1267
|
-
e,
|
|
1268
|
-
s,
|
|
1269
|
-
n.v8_trailingSlashAwareDataRequests,
|
|
1270
|
-
"data"
|
|
1271
|
-
);
|
|
1272
|
-
return m && v.size > 0 && R.searchParams.set(
|
|
1273
|
-
"_routes",
|
|
1274
|
-
t.filter((w) => v.has(w.route.id)).map((w) => w.route.id).join(",")
|
|
1275
|
-
), [R.pathname + R.search];
|
|
1276
|
-
}, [
|
|
1277
|
-
s,
|
|
1278
|
-
n.v8_trailingSlashAwareDataRequests,
|
|
1279
|
-
u,
|
|
1280
|
-
a,
|
|
1281
|
-
o,
|
|
1282
|
-
c,
|
|
1283
|
-
t,
|
|
1284
|
-
e,
|
|
1285
|
-
l
|
|
1286
|
-
]), p = i.useMemo(
|
|
1287
|
-
() => Gt(f, o),
|
|
1288
|
-
[f, o]
|
|
1289
|
-
), g = rr(f);
|
|
1290
|
-
return /* @__PURE__ */ i.createElement(i.Fragment, null, h.map((v) => /* @__PURE__ */ i.createElement("link", { key: v, rel: "prefetch", as: "fetch", href: v, ...r })), p.map((v) => /* @__PURE__ */ i.createElement("link", { key: v, rel: "modulepreload", href: v, ...r })), g.map(({ key: v, link: m }) => (
|
|
1291
|
-
// these don't spread `linkProps` because they are full link descriptors
|
|
1292
|
-
// already with their own props
|
|
1293
|
-
/* @__PURE__ */ i.createElement(
|
|
1294
|
-
"link",
|
|
1295
|
-
{
|
|
1296
|
-
key: v,
|
|
1297
|
-
nonce: r.nonce,
|
|
1298
|
-
...m,
|
|
1299
|
-
crossOrigin: m.crossOrigin ?? r.crossOrigin
|
|
1300
|
-
}
|
|
1301
|
-
)
|
|
1302
|
-
)));
|
|
1303
|
-
}
|
|
1304
|
-
function or(...e) {
|
|
1305
|
-
return (t) => {
|
|
1306
|
-
e.forEach((r) => {
|
|
1307
|
-
typeof r == "function" ? r(t) : r != null && (r.current = t);
|
|
1308
|
-
});
|
|
1309
|
-
};
|
|
1310
|
-
}
|
|
1311
|
-
var lr = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
1312
|
-
try {
|
|
1313
|
-
lr && (window.__reactRouterVersion = // @ts-expect-error
|
|
1314
|
-
"7.18.5");
|
|
1315
|
-
} catch {
|
|
1316
|
-
}
|
|
1317
|
-
var Me = i.forwardRef(
|
|
1318
|
-
function({
|
|
1319
|
-
onClick: t,
|
|
1320
|
-
discover: r = "render",
|
|
1321
|
-
prefetch: a = "none",
|
|
1322
|
-
relative: n,
|
|
1323
|
-
reloadDocument: o,
|
|
1324
|
-
replace: l,
|
|
1325
|
-
mask: s,
|
|
1326
|
-
state: u,
|
|
1327
|
-
target: d,
|
|
1328
|
-
to: c,
|
|
1329
|
-
preventScrollReset: f,
|
|
1330
|
-
viewTransition: h,
|
|
1331
|
-
defaultShouldRevalidate: p,
|
|
1332
|
-
...g
|
|
1333
|
-
}, v) {
|
|
1334
|
-
let { basename: m, navigator: R, useTransitions: w } = i.useContext(S), y = typeof c == "string" && ee.test(c), b = be(c, m);
|
|
1335
|
-
c = b.to;
|
|
1336
|
-
let x = xt(c, { relative: n }), P = k(), T = null;
|
|
1337
|
-
if (s) {
|
|
1338
|
-
let I = re(
|
|
1339
|
-
s,
|
|
1340
|
-
[],
|
|
1341
|
-
P.mask ? P.mask.pathname : "/",
|
|
1342
|
-
!0
|
|
1343
|
-
);
|
|
1344
|
-
m !== "/" && (I.pathname = I.pathname === "/" ? m : C([m, I.pathname])), T = R.createHref(I);
|
|
1345
|
-
}
|
|
1346
|
-
let [F, U, q] = er(
|
|
1347
|
-
a,
|
|
1348
|
-
g
|
|
1349
|
-
), We = cr(c, {
|
|
1350
|
-
replace: l,
|
|
1351
|
-
mask: s,
|
|
1352
|
-
state: u,
|
|
1353
|
-
target: d,
|
|
1354
|
-
preventScrollReset: f,
|
|
1355
|
-
relative: n,
|
|
1356
|
-
viewTransition: h,
|
|
1357
|
-
defaultShouldRevalidate: p,
|
|
1358
|
-
useTransitions: w
|
|
1359
|
-
});
|
|
1360
|
-
function Be(I) {
|
|
1361
|
-
t && t(I), I.defaultPrevented || We(I);
|
|
1362
|
-
}
|
|
1363
|
-
let ce = !(b.isExternal || o), fe = (
|
|
1364
|
-
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
1365
|
-
/* @__PURE__ */ i.createElement(
|
|
1366
|
-
"a",
|
|
1367
|
-
{
|
|
1368
|
-
...g,
|
|
1369
|
-
...q,
|
|
1370
|
-
href: (ce ? T : void 0) || b.absoluteURL || x,
|
|
1371
|
-
onClick: ce ? Be : t,
|
|
1372
|
-
ref: or(v, U),
|
|
1373
|
-
target: d,
|
|
1374
|
-
"data-discover": !y && r === "render" ? "true" : void 0
|
|
1375
|
-
}
|
|
1376
|
-
)
|
|
1377
|
-
);
|
|
1378
|
-
return F && !y ? /* @__PURE__ */ i.createElement(i.Fragment, null, fe, /* @__PURE__ */ i.createElement(tr, { page: x })) : fe;
|
|
1379
|
-
}
|
|
1380
|
-
);
|
|
1381
|
-
Me.displayName = "Link";
|
|
1382
|
-
var ir = i.forwardRef(
|
|
1383
|
-
function({
|
|
1384
|
-
"aria-current": t = "page",
|
|
1385
|
-
caseSensitive: r = !1,
|
|
1386
|
-
className: a = "",
|
|
1387
|
-
end: n = !1,
|
|
1388
|
-
style: o,
|
|
1389
|
-
to: l,
|
|
1390
|
-
viewTransition: s,
|
|
1391
|
-
children: u,
|
|
1392
|
-
...d
|
|
1393
|
-
}, c) {
|
|
1394
|
-
let f = M(l, { relative: d.relative }), h = k(), p = i.useContext(V), { navigator: g, basename: v } = i.useContext(S), m = p != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1395
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1396
|
-
pr(f) && s === !0, R = g.encodeLocation ? g.encodeLocation(f).pathname : f.pathname, w = h.pathname, y = p && p.navigation && p.navigation.location ? p.navigation.location.pathname : null;
|
|
1397
|
-
r || (w = w.toLowerCase(), y = y ? y.toLowerCase() : null, R = R.toLowerCase()), y && v && (y = D(y, v) || y);
|
|
1398
|
-
const b = R !== "/" && R.endsWith("/") ? R.length - 1 : R.length;
|
|
1399
|
-
let x = w === R || !n && w.startsWith(R) && w.charAt(b) === "/", P = y != null && (y === R || !n && y.startsWith(R) && y.charAt(R.length) === "/"), T = {
|
|
1400
|
-
isActive: x,
|
|
1401
|
-
isPending: P,
|
|
1402
|
-
isTransitioning: m
|
|
1403
|
-
}, F = x ? t : void 0, U;
|
|
1404
|
-
typeof a == "function" ? U = a(T) : U = [
|
|
1405
|
-
a,
|
|
1406
|
-
x ? "active" : null,
|
|
1407
|
-
P ? "pending" : null,
|
|
1408
|
-
m ? "transitioning" : null
|
|
1409
|
-
].filter(Boolean).join(" ");
|
|
1410
|
-
let q = typeof o == "function" ? o(T) : o;
|
|
1411
|
-
return /* @__PURE__ */ i.createElement(
|
|
1412
|
-
Me,
|
|
1413
|
-
{
|
|
1414
|
-
...d,
|
|
1415
|
-
"aria-current": F,
|
|
1416
|
-
className: U,
|
|
1417
|
-
ref: c,
|
|
1418
|
-
style: q,
|
|
1419
|
-
to: l,
|
|
1420
|
-
viewTransition: s
|
|
1421
|
-
},
|
|
1422
|
-
typeof u == "function" ? u(T) : u
|
|
1423
|
-
);
|
|
1424
|
-
}
|
|
1425
|
-
);
|
|
1426
|
-
ir.displayName = "NavLink";
|
|
1427
|
-
var sr = i.forwardRef(
|
|
1428
|
-
({
|
|
1429
|
-
discover: e = "render",
|
|
1430
|
-
fetcherKey: t,
|
|
1431
|
-
navigate: r,
|
|
1432
|
-
reloadDocument: a,
|
|
1433
|
-
replace: n,
|
|
1434
|
-
state: o,
|
|
1435
|
-
method: l = W,
|
|
1436
|
-
action: s,
|
|
1437
|
-
onSubmit: u,
|
|
1438
|
-
relative: d,
|
|
1439
|
-
preventScrollReset: c,
|
|
1440
|
-
viewTransition: f,
|
|
1441
|
-
defaultShouldRevalidate: h,
|
|
1442
|
-
...p
|
|
1443
|
-
}, g) => {
|
|
1444
|
-
let { useTransitions: v } = i.useContext(S), m = hr(), R = mr(s, { relative: d }), w = l.toLowerCase() === "get" ? "get" : "post", y = typeof s == "string" && ee.test(s), b = (x) => {
|
|
1445
|
-
if (u && u(x), x.defaultPrevented) return;
|
|
1446
|
-
x.preventDefault();
|
|
1447
|
-
let P = x.nativeEvent.submitter, T = (P == null ? void 0 : P.getAttribute("formmethod")) || l, F = () => m(P || x.currentTarget, {
|
|
1448
|
-
fetcherKey: t,
|
|
1449
|
-
method: T,
|
|
1450
|
-
navigate: r,
|
|
1451
|
-
replace: n,
|
|
1452
|
-
state: o,
|
|
1453
|
-
relative: d,
|
|
1454
|
-
preventScrollReset: c,
|
|
1455
|
-
viewTransition: f,
|
|
1456
|
-
defaultShouldRevalidate: h
|
|
1457
|
-
});
|
|
1458
|
-
v && r !== !1 ? i.startTransition(() => F()) : F();
|
|
1459
|
-
};
|
|
1460
|
-
return /* @__PURE__ */ i.createElement(
|
|
1461
|
-
"form",
|
|
1462
|
-
{
|
|
1463
|
-
ref: g,
|
|
1464
|
-
method: w,
|
|
1465
|
-
action: R,
|
|
1466
|
-
onSubmit: a ? u : b,
|
|
1467
|
-
...p,
|
|
1468
|
-
"data-discover": !y && e === "render" ? "true" : void 0
|
|
1469
|
-
}
|
|
1470
|
-
);
|
|
1471
|
-
}
|
|
1472
|
-
);
|
|
1473
|
-
sr.displayName = "Form";
|
|
1474
|
-
function ur(e) {
|
|
1475
|
-
return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1476
|
-
}
|
|
1477
|
-
function Oe(e) {
|
|
1478
|
-
let t = i.useContext(A);
|
|
1479
|
-
return E(t, ur(e)), t;
|
|
1480
|
-
}
|
|
1481
|
-
function cr(e, {
|
|
1482
|
-
target: t,
|
|
1483
|
-
replace: r,
|
|
1484
|
-
mask: a,
|
|
1485
|
-
state: n,
|
|
1486
|
-
preventScrollReset: o,
|
|
1487
|
-
relative: l,
|
|
1488
|
-
viewTransition: s,
|
|
1489
|
-
defaultShouldRevalidate: u,
|
|
1490
|
-
useTransitions: d
|
|
1491
|
-
} = {}) {
|
|
1492
|
-
let c = Ne(), f = k(), h = M(e, { relative: l });
|
|
1493
|
-
return i.useCallback(
|
|
1494
|
-
(p) => {
|
|
1495
|
-
if (Bt(p, t)) {
|
|
1496
|
-
p.preventDefault();
|
|
1497
|
-
let g = r !== void 0 ? r : H(f) === H(h), v = () => c(e, {
|
|
1498
|
-
replace: g,
|
|
1499
|
-
mask: a,
|
|
1500
|
-
state: n,
|
|
1501
|
-
preventScrollReset: o,
|
|
1502
|
-
relative: l,
|
|
1503
|
-
viewTransition: s,
|
|
1504
|
-
defaultShouldRevalidate: u
|
|
1505
|
-
});
|
|
1506
|
-
d ? i.startTransition(() => v()) : v();
|
|
1507
|
-
}
|
|
1508
|
-
},
|
|
1509
|
-
[
|
|
1510
|
-
f,
|
|
1511
|
-
c,
|
|
1512
|
-
h,
|
|
1513
|
-
r,
|
|
1514
|
-
a,
|
|
1515
|
-
n,
|
|
1516
|
-
t,
|
|
1517
|
-
e,
|
|
1518
|
-
o,
|
|
1519
|
-
l,
|
|
1520
|
-
s,
|
|
1521
|
-
u,
|
|
1522
|
-
d
|
|
1523
|
-
]
|
|
1524
|
-
);
|
|
1525
|
-
}
|
|
1526
|
-
function gr(e) {
|
|
1527
|
-
L(
|
|
1528
|
-
typeof URLSearchParams < "u",
|
|
1529
|
-
"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params."
|
|
1530
|
-
);
|
|
1531
|
-
let t = i.useRef(Z(e)), r = i.useRef(!1), a = k(), n = i.useMemo(
|
|
1532
|
-
() => (
|
|
1533
|
-
// Only merge in the defaults if we haven't yet called setSearchParams.
|
|
1534
|
-
// Once we call that we want those to take precedence, otherwise you can't
|
|
1535
|
-
// remove a param with setSearchParams({}) if it has an initial value
|
|
1536
|
-
Ht(
|
|
1537
|
-
a.search,
|
|
1538
|
-
r.current ? null : t.current
|
|
1539
|
-
)
|
|
1540
|
-
),
|
|
1541
|
-
[a.search]
|
|
1542
|
-
), o = Ne(), l = i.useCallback(
|
|
1543
|
-
(s, u) => {
|
|
1544
|
-
const d = Z(
|
|
1545
|
-
typeof s == "function" ? s(new URLSearchParams(n)) : s
|
|
1546
|
-
);
|
|
1547
|
-
r.current = !0, o("?" + d, u);
|
|
1548
|
-
},
|
|
1549
|
-
[o, n]
|
|
1550
|
-
);
|
|
1551
|
-
return [n, l];
|
|
1552
|
-
}
|
|
1553
|
-
var fr = 0, dr = () => `__${String(++fr)}__`;
|
|
1554
|
-
function hr() {
|
|
1555
|
-
let { router: e } = Oe(
|
|
1556
|
-
"useSubmit"
|
|
1557
|
-
/* UseSubmit */
|
|
1558
|
-
), { basename: t } = i.useContext(S), r = Ft(), a = e.fetch, n = e.navigate;
|
|
1559
|
-
return i.useCallback(
|
|
1560
|
-
async (o, l = {}) => {
|
|
1561
|
-
let { action: s, method: u, encType: d, formData: c, body: f } = zt(
|
|
1562
|
-
o,
|
|
1563
|
-
t
|
|
1564
|
-
);
|
|
1565
|
-
if (l.navigate === !1) {
|
|
1566
|
-
let h = l.fetcherKey || dr();
|
|
1567
|
-
await a(h, r, l.action || s, {
|
|
1568
|
-
defaultShouldRevalidate: l.defaultShouldRevalidate,
|
|
1569
|
-
preventScrollReset: l.preventScrollReset,
|
|
1570
|
-
formData: c,
|
|
1571
|
-
body: f,
|
|
1572
|
-
formMethod: l.method || u,
|
|
1573
|
-
formEncType: l.encType || d,
|
|
1574
|
-
flushSync: l.flushSync
|
|
1575
|
-
});
|
|
1576
|
-
} else
|
|
1577
|
-
await n(l.action || s, {
|
|
1578
|
-
defaultShouldRevalidate: l.defaultShouldRevalidate,
|
|
1579
|
-
preventScrollReset: l.preventScrollReset,
|
|
1580
|
-
formData: c,
|
|
1581
|
-
body: f,
|
|
1582
|
-
formMethod: l.method || u,
|
|
1583
|
-
formEncType: l.encType || d,
|
|
1584
|
-
replace: l.replace,
|
|
1585
|
-
state: l.state,
|
|
1586
|
-
fromRouteId: r,
|
|
1587
|
-
flushSync: l.flushSync,
|
|
1588
|
-
viewTransition: l.viewTransition
|
|
1589
|
-
});
|
|
1590
|
-
},
|
|
1591
|
-
[a, n, t, r]
|
|
1592
|
-
);
|
|
1593
|
-
}
|
|
1594
|
-
function mr(e, { relative: t } = {}) {
|
|
1595
|
-
let { basename: r } = i.useContext(S), a = i.useContext($);
|
|
1596
|
-
E(a, "useFormAction must be used inside a RouteContext");
|
|
1597
|
-
let [n] = a.matches.slice(-1), o = { ...M(e || ".", { relative: t }) }, l = k();
|
|
1598
|
-
if (e == null) {
|
|
1599
|
-
o.search = l.search;
|
|
1600
|
-
let s = new URLSearchParams(o.search), u = s.getAll("index");
|
|
1601
|
-
if (u.some((c) => c === "")) {
|
|
1602
|
-
s.delete("index"), u.filter((f) => f).forEach((f) => s.append("index", f));
|
|
1603
|
-
let c = s.toString();
|
|
1604
|
-
o.search = c ? `?${c}` : "";
|
|
1605
|
-
}
|
|
1606
|
-
}
|
|
1607
|
-
return (!e || e === ".") && n.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), r !== "/" && (o.pathname = o.pathname === "/" ? r : C([r, o.pathname])), H(o);
|
|
1608
|
-
}
|
|
1609
|
-
function pr(e, { relative: t } = {}) {
|
|
1610
|
-
let r = i.useContext(Te);
|
|
1611
|
-
E(
|
|
1612
|
-
r != null,
|
|
1613
|
-
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1614
|
-
);
|
|
1615
|
-
let { basename: a } = Oe(
|
|
1616
|
-
"useViewTransitionState"
|
|
1617
|
-
/* useViewTransitionState */
|
|
1618
|
-
), n = M(e, { relative: t });
|
|
1619
|
-
if (!r.isTransitioning)
|
|
1620
|
-
return !1;
|
|
1621
|
-
let o = D(r.currentLocation.pathname, a) || r.currentLocation.pathname, l = D(r.nextLocation.pathname, a) || r.nextLocation.pathname;
|
|
1622
|
-
return j(n.pathname, l) != null || j(n.pathname, o) != null;
|
|
1623
|
-
}
|
|
1624
|
-
export {
|
|
1625
|
-
gr as a,
|
|
1626
|
-
Ne as u
|
|
1627
|
-
};
|