@gobolt/genesis 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/README.md +10 -0
  2. package/dist/{AntdIcon-c395a1c4.js → AntdIcon-BoLh1dP8.js} +66 -68
  3. package/dist/CheckOutlined-CeTKr6II.js +13 -0
  4. package/dist/{CloseCircleFilled-ddc51e7e.js → CloseCircleFilled-DXCxlIQL.js} +8 -11
  5. package/dist/{CloseOutlined-14b8bba1.js → CloseOutlined-ClXDNn82.js} +9 -12
  6. package/dist/{Compact-c39ed20d.js → Compact-CGY560JF.js} +63 -65
  7. package/dist/ContextIsolator-D5x2Ih51.js +20 -0
  8. package/dist/{ExclamationCircleFilled-23ef9812.js → ExclamationCircleFilled-C0Kj5KQV.js} +16 -22
  9. package/dist/KeyCode-DM2sFh3-.js +517 -0
  10. package/dist/LoadingOutlined-8EnJdZ7I.js +13 -0
  11. package/dist/{Overflow-a570fa69.js → Overflow-PBZD-PFm.js} +63 -64
  12. package/dist/{DownOutlined-64a4732a.js → PurePanel-BqPLRtc2.js} +67 -70
  13. package/dist/{SearchOutlined-a9014e08.js → SearchOutlined-BP3Z2K6j.js} +8 -11
  14. package/dist/{TextArea-20825221.js → TextArea-DKwCct3i.js} +583 -588
  15. package/dist/Typography-aGoDUl4R.js +710 -0
  16. package/dist/bundle.css +1204 -0
  17. package/dist/{button-fa1c119c.js → button-CDQgO1OK.js} +274 -278
  18. package/dist/{collapse-345bc884.js → collapse-Dtpt-6W_.js} +2 -2
  19. package/dist/compact-item-DH13cl8A.js +61 -0
  20. package/dist/components/Badge/Badge.d.ts +2 -2
  21. package/dist/components/Badge/Badge.js +63 -62
  22. package/dist/components/Badge/__tests__/Badge.test.js +11 -65
  23. package/dist/components/Badge/index.js +2 -21
  24. package/dist/components/Badge/styles.js +7 -8
  25. package/dist/components/Breadcrumb/Breadcrumb.js +8 -24
  26. package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +21 -7
  27. package/dist/components/Breadcrumb/__tests__/Breadcrumb.test.js +13 -60
  28. package/dist/components/Breadcrumb/index.js +2 -25
  29. package/dist/components/Breadcrumb/styles.d.ts +10 -6
  30. package/dist/components/Breadcrumb/styles.js +787 -808
  31. package/dist/components/Button/Button.d.ts +6 -4
  32. package/dist/components/Button/Button.js +20 -40
  33. package/dist/components/Button/__tests__/Button.test.js +9 -54
  34. package/dist/components/Button/index.js +2 -20
  35. package/dist/components/Button/styles.d.ts +9 -5
  36. package/dist/components/Button/styles.js +19 -30
  37. package/dist/components/Checkbox/Checkbox.js +8 -38
  38. package/dist/components/Checkbox/__tests__/Checkbox.test.js +16 -62
  39. package/dist/components/Checkbox/index.js +2 -47
  40. package/dist/components/Checkbox/styles.d.ts +8 -1
  41. package/dist/components/Checkbox/styles.js +181 -188
  42. package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.d.ts +2 -4
  43. package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.js +19 -51
  44. package/dist/components/ErrorBoundaryFallback/index.d.ts +1 -0
  45. package/dist/components/ErrorBoundaryFallback/index.js +2 -49
  46. package/dist/components/ErrorBoundaryFallback/styles.d.ts +1 -3
  47. package/dist/components/ErrorBoundaryFallback/styles.js +34 -37
  48. package/dist/components/Form/Form.d.ts +18 -5
  49. package/dist/components/Form/Form.js +4 -45
  50. package/dist/components/Form/__stories__/FormStory.js +44 -81
  51. package/dist/components/Form/__tests__/form.test.d.ts +1 -0
  52. package/dist/components/Form/__tests__/form.test.js +18 -0
  53. package/dist/components/Form/index.js +2 -46
  54. package/dist/components/Form/styles.d.ts +3 -0
  55. package/dist/components/Form/styles.js +5 -0
  56. package/dist/components/Input/Input.js +6 -29
  57. package/dist/components/Input/__tests__/Input.test.js +21 -66
  58. package/dist/components/Input/index.js +2 -29
  59. package/dist/components/Input/styles.d.ts +5 -2
  60. package/dist/components/Input/styles.js +319 -332
  61. package/dist/components/Message/Message.d.ts +4 -4
  62. package/dist/components/Message/Message.js +53 -80
  63. package/dist/components/Message/__tests__/Message.test.js +24 -70
  64. package/dist/components/Message/index.js +2 -48
  65. package/dist/components/Message/styles.d.ts +4 -1
  66. package/dist/components/Message/styles.js +24 -18
  67. package/dist/components/Notification/Notification.d.ts +11 -10
  68. package/dist/components/Notification/Notification.js +306 -372
  69. package/dist/components/Notification/NotificationRightChevron.d.ts +2 -0
  70. package/dist/components/Notification/NotificationRightChevron.js +23 -0
  71. package/dist/components/Notification/__tests__/Notification.test.js +8 -69
  72. package/dist/components/Notification/index.js +2 -59
  73. package/dist/components/Notification/styles.d.ts +13 -3
  74. package/dist/components/Notification/styles.js +36 -20
  75. package/dist/components/Radio/Radio.js +20 -106
  76. package/dist/components/Radio/RadioGroup.js +18 -71
  77. package/dist/components/Radio/__stories__/RadioGroup.stories.d.ts +1 -1
  78. package/dist/components/Radio/__tests__/RadioGroup.test.js +15 -70
  79. package/dist/components/Radio/index.d.ts +1 -1
  80. package/dist/components/Radio/index.js +2 -56
  81. package/dist/components/Select/DropdownChevron.d.ts +2 -0
  82. package/dist/components/Select/DropdownChevron.js +23 -0
  83. package/dist/components/Select/Select.d.ts +9 -4
  84. package/dist/components/Select/Select.js +29 -41
  85. package/dist/components/Select/__tests__/Select.test.js +10752 -93
  86. package/dist/components/Select/index.js +2 -28
  87. package/dist/components/Select/styles.d.ts +20 -6
  88. package/dist/components/Select/styles.js +1381 -1370
  89. package/dist/components/Toast/Toast.d.ts +4 -4
  90. package/dist/components/Toast/Toast.js +8 -37
  91. package/dist/components/Toast/__stories__/Toast.stories.d.ts +1 -0
  92. package/dist/components/Toast/__tests__/Toast.test.js +10 -55
  93. package/dist/components/Toast/index.js +2 -46
  94. package/dist/components/Toast/styles.d.ts +6 -1
  95. package/dist/components/Toast/styles.js +36 -21
  96. package/dist/components/Typography/Typography.d.ts +7 -4
  97. package/dist/components/Typography/Typography.js +2 -42
  98. package/dist/components/Typography/__stories__/Typography.stories.d.ts +1 -0
  99. package/dist/components/Typography/__tests__/Typography.test.js +19 -56
  100. package/dist/components/Typography/index.js +2 -46
  101. package/dist/components/Typography/styles.d.ts +18 -4
  102. package/dist/components/Typography/styles.js +36 -43
  103. package/dist/components/index.d.ts +13 -5
  104. package/dist/components/index.js +24 -70
  105. package/dist/{context-3b8a39af.js → context-BMW3aJEf.js} +538 -548
  106. package/dist/genesis/GenesisThemeBreakdown.js +38 -55
  107. package/dist/genesis/GenesisThemeDemo.js +3 -53
  108. package/dist/genesis/styles.d.ts +6 -2
  109. package/dist/genesis/styles.js +496 -521
  110. package/dist/{index-e2b72ca8.js → index-1CBpubM3.js} +97 -102
  111. package/dist/index-BZAhCB_K.js +97 -0
  112. package/dist/{index-501fc13d.js → index-C0SmxWLS.js} +367 -392
  113. package/dist/index-C8haFnXI.js +1112 -0
  114. package/dist/index-CfDY25LP.js +873 -0
  115. package/dist/index-DPW8XdWj.js +952 -0
  116. package/dist/{index-8c8d2d0c.js → index-bKlRxQp4.js} +114 -114
  117. package/dist/index-oK7z6jnz.js +22795 -0
  118. package/dist/index.d.ts +1 -0
  119. package/dist/index.js +31 -77
  120. package/dist/{isVisible-729780f5.js → isVisible-A-IfeFoT.js} +67 -94
  121. package/dist/{magic-string.es-b7491176.js → magic-string.es-D2FWSwU3.js} +56 -103
  122. package/dist/{pickAttrs-00ba4687.js → pickAttrs-B0YTfcV1.js} +1 -1
  123. package/dist/providers/GenesisProvider.d.ts +0 -5
  124. package/dist/providers/GenesisProvider.js +9 -59
  125. package/dist/providers/ThemeProvider.d.ts +1 -2
  126. package/dist/providers/ThemeProvider.js +11 -13
  127. package/dist/providers/ToastProvider.d.ts +11 -4
  128. package/dist/providers/ToastProvider.js +10 -39
  129. package/dist/providers/index.d.ts +2 -3
  130. package/dist/providers/index.js +4 -51
  131. package/dist/providers/useGenesis.d.ts +7 -0
  132. package/dist/providers/useGenesis.js +6 -0
  133. package/dist/setup-BvfREoHl.js +33891 -0
  134. package/dist/{styled-components.browser.esm-02f500bc.js → styled-components.browser.esm-CZ1XM4o4.js} +72 -134
  135. package/dist/styles/design-tokens/border-tokens/BorderTokenList.js +15 -45
  136. package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.js +15 -45
  137. package/dist/styles/design-tokens/{typography → typography-tokens}/TypographyTokens.stories.d.ts +1 -0
  138. package/dist/styles/design-tokens/variables.d.ts +10 -10
  139. package/dist/styles/design-tokens/variables.js +1 -1
  140. package/dist/styles/global-styles.d.ts +1 -0
  141. package/dist/styles/global-styles.js +14 -31
  142. package/dist/styles/theme/genesis-theme.js +257 -212
  143. package/dist/styles/theme/genesis-theme.types.d.ts +46 -0
  144. package/dist/styles/theme/index.js +4 -5
  145. package/dist/styles-CT_fyXBd.js +1808 -0
  146. package/dist/test/setup.js +3 -46
  147. package/dist/useLocale-DT-z_vQ6.js +16 -0
  148. package/dist/useVariants-DvhXfgJY.js +30 -0
  149. package/dist/utils/isAllEnglishString.js +1 -2
  150. package/dist/{presets-83ccb923.js → warning-C63HNL9U.js} +358 -356
  151. package/package.json +51 -43
  152. package/dist/CheckOutlined-52d9ac25.js +0 -29
  153. package/dist/ContextIsolator-b09b2c52.js +0 -20
  154. package/dist/EllipsisOutlined-60122660.js +0 -1115
  155. package/dist/InfoCircleFilled-c5f90c20.js +0 -16
  156. package/dist/RightOutlined-83515eb4.js +0 -16
  157. package/dist/compact-item-b8f85aa6.js +0 -75
  158. package/dist/index-0a886e53.js +0 -100
  159. package/dist/index-0b9ee239.js +0 -955
  160. package/dist/index-1a33c134.js +0 -1389
  161. package/dist/index-4003d75b.js +0 -3748
  162. package/dist/index-89035ea5.js +0 -3242
  163. package/dist/providers/ToastWrapper.d.ts +0 -7
  164. package/dist/providers/ToastWrapper.js +0 -56
  165. package/dist/setup-aaca7b6f.js +0 -21158
  166. package/dist/styles/theme/global-styles.d.ts +0 -1
  167. package/dist/styles/theme/global-styles.js +0 -36
  168. package/dist/useVariants-a0d64298.js +0 -30
  169. /package/dist/{presetColors-ccf8cb4c.js → presetColors-Cl8UP3Nw.js} +0 -0
  170. /package/dist/{reactNode-f4391605.js → reactNode-sKPeiqPL.js} +0 -0
@@ -1,3242 +0,0 @@
1
- import { jsxs as qe, jsx as Q } from "react/jsx-runtime";
2
- import { TYPOGRAPHY_VARIANT as we, TYPE as Ot, STATE as re, BREAKPOINTS as En, SIZE as ot } from "./constants/index.js";
3
- import "./components/Button/styles.js";
4
- import { useBreakpoint as Nt } from "./providers/ThemeProvider.js";
5
- import "./components/Checkbox/styles.js";
6
- import "./components/ErrorBoundaryFallback/styles.js";
7
- import * as a from "react";
8
- import q, { useContext as Ie, useRef as wn, useState as rt, useEffect as Ge, createContext as It } from "react";
9
- import "./components/Input/styles.js";
10
- import "./components/Select/styles.js";
11
- import { Text as On, Headline as Nn } from "./components/Typography/styles.js";
12
- import "./components/Badge/styles.js";
13
- import { a0 as Mt, v as ee, g as ze, m as Ye, p as te, H as In, r as Qe, I as Ft, C as he, t as Pe, B as Pt, A as Mn, a1 as Fn, D as Pn, a2 as jn, a3 as Rn, S as _n, w as it, j as Tn, q as Ln, Y as at, Z as Vn, n as jt, d as kn, u as Dn, s as Hn, x as An, a4 as zn, a5 as Rt, a as Bn } from "./index-4003d75b.js";
14
- import { g as Wn } from "./index-e2b72ca8.js";
15
- import { C as _t, E as Tt } from "./ExclamationCircleFilled-23ef9812.js";
16
- import { C as Lt } from "./CloseCircleFilled-ddc51e7e.js";
17
- import { C as Vt } from "./CloseOutlined-14b8bba1.js";
18
- import { I as qn } from "./InfoCircleFilled-c5f90c20.js";
19
- import { f as de, d as kt, a as fe, c as K, h as Xe, e as Dt, _ as Oe } from "./presets-83ccb923.js";
20
- import { createPortal as Gn } from "react-dom";
21
- import { a as Xn, K as Ee, C as Kn, b as st } from "./index-1a33c134.js";
22
- import { p as Un } from "./pickAttrs-00ba4687.js";
23
- import { u as je, a as Je, b as Yn, V as Qn, c as Ht, d as me, R as Jn, F as De, e as At, C as Zn, L as eo, W as to, f as no, g as oo } from "./context-3b8a39af.js";
24
- import { n as ro } from "./styled-components.browser.esm-02f500bc.js";
25
- import { ToastRow as io, ToastContent as ao } from "./components/Toast/styles.js";
26
- import { g as so } from "./collapse-345bc884.js";
27
- import { z as zt, T as lo } from "./index-0b9ee239.js";
28
- import { a as co } from "./Compact-c39ed20d.js";
29
- import { c as uo } from "./reactNode-f4391605.js";
30
- import { t as fo, i as mo, o as po } from "./isVisible-729780f5.js";
31
- import { A as ye } from "./AntdIcon-c395a1c4.js";
32
- import { u as go } from "./CheckOutlined-52d9ac25.js";
33
- import { L as ho } from "./compact-item-b8f85aa6.js";
34
- const lt = (e) => typeof e == "object" && e != null && e.nodeType === 1, ct = (e, t) => (!t || e !== "hidden") && e !== "visible" && e !== "clip", Te = (e, t) => {
35
- if (e.clientHeight < e.scrollHeight || e.clientWidth < e.scrollWidth) {
36
- const o = getComputedStyle(e, null);
37
- return ct(o.overflowY, t) || ct(o.overflowX, t) || ((n) => {
38
- const r = ((i) => {
39
- if (!i.ownerDocument || !i.ownerDocument.defaultView)
40
- return null;
41
- try {
42
- return i.ownerDocument.defaultView.frameElement;
43
- } catch {
44
- return null;
45
- }
46
- })(n);
47
- return !!r && (r.clientHeight < n.scrollHeight || r.clientWidth < n.scrollWidth);
48
- })(e);
49
- }
50
- return !1;
51
- }, Le = (e, t, o, n, r, i, s, l) => i < e && s > t || i > e && s < t ? 0 : i <= e && l <= o || s >= t && l >= o ? i - e - n : s > t && l < o || i < e && l > o ? s - t + r : 0, vo = (e) => {
52
- const t = e.parentElement;
53
- return t ?? (e.getRootNode().host || null);
54
- }, ut = (e, t) => {
55
- var o, n, r, i;
56
- if (typeof document > "u")
57
- return [];
58
- const { scrollMode: s, block: l, inline: c, boundary: u, skipOverflowHiddenElements: C } = t, O = typeof u == "function" ? u : (R) => R !== u;
59
- if (!lt(e))
60
- throw new TypeError("Invalid target");
61
- const h = document.scrollingElement || document.documentElement, E = [];
62
- let w = e;
63
- for (; lt(w) && O(w); ) {
64
- if (w = vo(w), w === h) {
65
- E.push(w);
66
- break;
67
- }
68
- w != null && w === document.body && Te(w) && !Te(document.documentElement) || w != null && Te(w, C) && E.push(w);
69
- }
70
- const $ = (n = (o = window.visualViewport) == null ? void 0 : o.width) != null ? n : innerWidth, S = (i = (r = window.visualViewport) == null ? void 0 : r.height) != null ? i : innerHeight, { scrollX: v, scrollY: M } = window, { height: m, width: y, top: b, right: d, bottom: F, left: p } = e.getBoundingClientRect(), { top: f, right: g, bottom: N, left: V } = ((R) => {
71
- const x = window.getComputedStyle(R);
72
- return { top: parseFloat(x.scrollMarginTop) || 0, right: parseFloat(x.scrollMarginRight) || 0, bottom: parseFloat(x.scrollMarginBottom) || 0, left: parseFloat(x.scrollMarginLeft) || 0 };
73
- })(e);
74
- let P = l === "start" || l === "nearest" ? b - f : l === "end" ? F + N : b + m / 2 - f + N, I = c === "center" ? p + y / 2 - V + g : c === "end" ? d + g : p - V;
75
- const D = [];
76
- for (let R = 0; R < E.length; R++) {
77
- const x = E[R], { height: H, width: j, top: U, right: z, bottom: Y, left: G } = x.getBoundingClientRect();
78
- if (s === "if-needed" && b >= 0 && p >= 0 && F <= S && d <= $ && (x === h && !Te(x) || b >= U && F <= Y && p >= G && d <= z))
79
- return D;
80
- const X = getComputedStyle(x), _ = parseInt(X.borderLeftWidth, 10), B = parseInt(X.borderTopWidth, 10), A = parseInt(X.borderRightWidth, 10), T = parseInt(X.borderBottomWidth, 10);
81
- let L = 0, k = 0;
82
- const J = "offsetWidth" in x ? x.offsetWidth - x.clientWidth - _ - A : 0, Z = "offsetHeight" in x ? x.offsetHeight - x.clientHeight - B - T : 0, ne = "offsetWidth" in x ? x.offsetWidth === 0 ? 0 : j / x.offsetWidth : 0, oe = "offsetHeight" in x ? x.offsetHeight === 0 ? 0 : H / x.offsetHeight : 0;
83
- if (h === x)
84
- L = l === "start" ? P : l === "end" ? P - S : l === "nearest" ? Le(M, M + S, S, B, T, M + P, M + P + m, m) : P - S / 2, k = c === "start" ? I : c === "center" ? I - $ / 2 : c === "end" ? I - $ : Le(v, v + $, $, _, A, v + I, v + I + y, y), L = Math.max(0, L + M), k = Math.max(0, k + v);
85
- else {
86
- L = l === "start" ? P - U - B : l === "end" ? P - Y + T + Z : l === "nearest" ? Le(U, Y, H, B, T + Z, P, P + m, m) : P - (U + H / 2) + Z / 2, k = c === "start" ? I - G - _ : c === "center" ? I - (G + j / 2) + J / 2 : c === "end" ? I - z + A + J : Le(G, z, j, _, A + J, I, I + y, y);
87
- const { scrollLeft: ie, scrollTop: W } = x;
88
- L = oe === 0 ? 0 : Math.max(0, Math.min(W + L / oe, x.scrollHeight - H / oe + Z)), k = ne === 0 ? 0 : Math.max(0, Math.min(ie + k / ne, x.scrollWidth - j / ne + J)), P += W - L, I += ie - k;
89
- }
90
- D.push({ el: x, top: L, left: k });
91
- }
92
- return D;
93
- }, bo = (e) => e === !1 ? { block: "end", inline: "nearest" } : ((t) => t === Object(t) && Object.keys(t).length !== 0)(e) ? e : { block: "start", inline: "nearest" };
94
- function yo(e, t) {
95
- if (!e.isConnected || !((r) => {
96
- let i = r;
97
- for (; i && i.parentNode; ) {
98
- if (i.parentNode === document)
99
- return !0;
100
- i = i.parentNode instanceof ShadowRoot ? i.parentNode.host : i.parentNode;
101
- }
102
- return !1;
103
- })(e))
104
- return;
105
- const o = ((r) => {
106
- const i = window.getComputedStyle(r);
107
- return { top: parseFloat(i.scrollMarginTop) || 0, right: parseFloat(i.scrollMarginRight) || 0, bottom: parseFloat(i.scrollMarginBottom) || 0, left: parseFloat(i.scrollMarginLeft) || 0 };
108
- })(e);
109
- if (((r) => typeof r == "object" && typeof r.behavior == "function")(t))
110
- return t.behavior(ut(e, t));
111
- const n = typeof t == "boolean" || t == null ? void 0 : t.behavior;
112
- for (const { el: r, top: i, left: s } of ut(e, bo(t))) {
113
- const l = i - o.top + o.bottom, c = s - o.left + o.right;
114
- r.scroll({ top: l, left: c, behavior: n });
115
- }
116
- }
117
- var Bt = /* @__PURE__ */ a.forwardRef(function(e, t) {
118
- var o = e.prefixCls, n = e.style, r = e.className, i = e.duration, s = i === void 0 ? 4.5 : i, l = e.showProgress, c = e.pauseOnHover, u = c === void 0 ? !0 : c, C = e.eventKey, O = e.content, h = e.closable, E = e.closeIcon, w = E === void 0 ? "x" : E, $ = e.props, S = e.onClick, v = e.onNoticeClose, M = e.times, m = e.hovering, y = a.useState(!1), b = de(y, 2), d = b[0], F = b[1], p = a.useState(0), f = de(p, 2), g = f[0], N = f[1], V = a.useState(0), P = de(V, 2), I = P[0], D = P[1], R = m || d, x = s > 0 && l, H = function() {
119
- v(C);
120
- }, j = function(_) {
121
- (_.key === "Enter" || _.code === "Enter" || _.keyCode === Xn.ENTER) && H();
122
- };
123
- a.useEffect(function() {
124
- if (!R && s > 0) {
125
- var X = Date.now() - I, _ = setTimeout(function() {
126
- H();
127
- }, s * 1e3 - I);
128
- return function() {
129
- u && clearTimeout(_), D(Date.now() - X);
130
- };
131
- }
132
- }, [s, R, M]), a.useEffect(function() {
133
- if (!R && x && (u || I === 0)) {
134
- var X = performance.now(), _, B = function A() {
135
- cancelAnimationFrame(_), _ = requestAnimationFrame(function(T) {
136
- var L = T + I - X, k = Math.min(L / (s * 1e3), 1);
137
- N(k * 100), k < 1 && A();
138
- });
139
- };
140
- return B(), function() {
141
- u && cancelAnimationFrame(_);
142
- };
143
- }
144
- }, [s, I, R, x, M]);
145
- var U = a.useMemo(function() {
146
- return kt(h) === "object" && h !== null ? h : h ? {
147
- closeIcon: w
148
- } : {};
149
- }, [h, w]), z = Un(U, !0), Y = 100 - (!g || g < 0 ? 0 : g > 100 ? 100 : g), G = "".concat(o, "-notice");
150
- return /* @__PURE__ */ a.createElement("div", fe({}, $, {
151
- ref: t,
152
- className: K(G, r, Xe({}, "".concat(G, "-closable"), h)),
153
- style: n,
154
- onMouseEnter: function(_) {
155
- var B;
156
- F(!0), $ == null || (B = $.onMouseEnter) === null || B === void 0 || B.call($, _);
157
- },
158
- onMouseLeave: function(_) {
159
- var B;
160
- F(!1), $ == null || (B = $.onMouseLeave) === null || B === void 0 || B.call($, _);
161
- },
162
- onClick: S
163
- }), /* @__PURE__ */ a.createElement("div", {
164
- className: "".concat(G, "-content")
165
- }, O), h && /* @__PURE__ */ a.createElement("a", fe({
166
- tabIndex: 0,
167
- className: "".concat(G, "-close"),
168
- onKeyDown: j,
169
- "aria-label": "Close"
170
- }, z, {
171
- onClick: function(_) {
172
- _.preventDefault(), _.stopPropagation(), H();
173
- }
174
- }), U.closeIcon), x && /* @__PURE__ */ a.createElement("progress", {
175
- className: "".concat(G, "-progress"),
176
- max: "100",
177
- value: Y
178
- }, Y + "%"));
179
- }), Wt = /* @__PURE__ */ q.createContext({}), Co = function(t) {
180
- var o = t.children, n = t.classNames;
181
- return /* @__PURE__ */ q.createElement(Wt.Provider, {
182
- value: {
183
- classNames: n
184
- }
185
- }, o);
186
- }, dt = 8, ft = 3, mt = 16, $o = function(t) {
187
- var o = {
188
- offset: dt,
189
- threshold: ft,
190
- gap: mt
191
- };
192
- if (t && kt(t) === "object") {
193
- var n, r, i;
194
- o.offset = (n = t.offset) !== null && n !== void 0 ? n : dt, o.threshold = (r = t.threshold) !== null && r !== void 0 ? r : ft, o.gap = (i = t.gap) !== null && i !== void 0 ? i : mt;
195
- }
196
- return [!!t, o];
197
- }, xo = ["className", "style", "classNames", "styles"], qt = function(t) {
198
- var o = t.configList, n = t.placement, r = t.prefixCls, i = t.className, s = t.style, l = t.motion, c = t.onAllNoticeRemoved, u = t.onNoticeClose, C = t.stack, O = Ie(Wt), h = O.classNames, E = wn({}), w = rt(null), $ = de(w, 2), S = $[0], v = $[1], M = rt([]), m = de(M, 2), y = m[0], b = m[1], d = o.map(function(R) {
199
- return {
200
- config: R,
201
- key: String(R.key)
202
- };
203
- }), F = $o(C), p = de(F, 2), f = p[0], g = p[1], N = g.offset, V = g.threshold, P = g.gap, I = f && (y.length > 0 || d.length <= V), D = typeof l == "function" ? l(n) : l;
204
- return Ge(function() {
205
- f && y.length > 1 && b(function(R) {
206
- return R.filter(function(x) {
207
- return d.some(function(H) {
208
- var j = H.key;
209
- return x === j;
210
- });
211
- });
212
- });
213
- }, [y, d, f]), Ge(function() {
214
- var R;
215
- if (f && E.current[(R = d[d.length - 1]) === null || R === void 0 ? void 0 : R.key]) {
216
- var x;
217
- v(E.current[(x = d[d.length - 1]) === null || x === void 0 ? void 0 : x.key]);
218
- }
219
- }, [d, f]), /* @__PURE__ */ q.createElement(Mt, fe({
220
- key: n,
221
- className: K(r, "".concat(r, "-").concat(n), h == null ? void 0 : h.list, i, Xe(Xe({}, "".concat(r, "-stack"), !!f), "".concat(r, "-stack-expanded"), I)),
222
- style: s,
223
- keys: d,
224
- motionAppear: !0
225
- }, D, {
226
- onAllRemoved: function() {
227
- c(n);
228
- }
229
- }), function(R, x) {
230
- var H = R.config, j = R.className, U = R.style, z = R.index, Y = H, G = Y.key, X = Y.times, _ = String(G), B = H, A = B.className, T = B.style, L = B.classNames, k = B.styles, J = Dt(B, xo), Z = d.findIndex(function(ge) {
231
- return ge.key === _;
232
- }), ne = {};
233
- if (f) {
234
- var oe = d.length - 1 - (Z > -1 ? Z : z - 1), ie = n === "top" || n === "bottom" ? "-50%" : "0";
235
- if (oe > 0) {
236
- var W, ae, Ce;
237
- ne.height = I ? (W = E.current[_]) === null || W === void 0 ? void 0 : W.offsetHeight : S == null ? void 0 : S.offsetHeight;
238
- for (var ce = 0, ve = 0; ve < oe; ve++) {
239
- var be;
240
- ce += ((be = E.current[d[d.length - 1 - ve].key]) === null || be === void 0 ? void 0 : be.offsetHeight) + P;
241
- }
242
- var $e = (I ? ce : oe * N) * (n.startsWith("top") ? 1 : -1), Re = !I && S !== null && S !== void 0 && S.offsetWidth && (ae = E.current[_]) !== null && ae !== void 0 && ae.offsetWidth ? ((S == null ? void 0 : S.offsetWidth) - N * 2 * (oe < 3 ? oe : 3)) / ((Ce = E.current[_]) === null || Ce === void 0 ? void 0 : Ce.offsetWidth) : 1;
243
- ne.transform = "translate3d(".concat(ie, ", ").concat($e, "px, 0) scaleX(").concat(Re, ")");
244
- } else
245
- ne.transform = "translate3d(".concat(ie, ", 0, 0)");
246
- }
247
- return /* @__PURE__ */ q.createElement("div", {
248
- ref: x,
249
- className: K("".concat(r, "-notice-wrapper"), j, L == null ? void 0 : L.wrapper),
250
- style: Oe(Oe(Oe({}, U), ne), k == null ? void 0 : k.wrapper),
251
- onMouseEnter: function() {
252
- return b(function(ue) {
253
- return ue.includes(_) ? ue : [].concat(ee(ue), [_]);
254
- });
255
- },
256
- onMouseLeave: function() {
257
- return b(function(ue) {
258
- return ue.filter(function(xe) {
259
- return xe !== _;
260
- });
261
- });
262
- }
263
- }, /* @__PURE__ */ q.createElement(Bt, fe({}, J, {
264
- ref: function(ue) {
265
- Z > -1 ? E.current[_] = ue : delete E.current[_];
266
- },
267
- prefixCls: r,
268
- classNames: L,
269
- styles: k,
270
- className: K(A, h == null ? void 0 : h.notice),
271
- style: T,
272
- times: X,
273
- key: G,
274
- eventKey: G,
275
- onNoticeClose: u,
276
- hovering: f && y.length > 0
277
- })));
278
- });
279
- };
280
- process.env.NODE_ENV !== "production" && (qt.displayName = "NoticeList");
281
- var Gt = /* @__PURE__ */ a.forwardRef(function(e, t) {
282
- var o = e.prefixCls, n = o === void 0 ? "rc-notification" : o, r = e.container, i = e.motion, s = e.maxCount, l = e.className, c = e.style, u = e.onAllRemoved, C = e.stack, O = e.renderNotifications, h = a.useState([]), E = de(h, 2), w = E[0], $ = E[1], S = function(f) {
283
- var g, N = w.find(function(V) {
284
- return V.key === f;
285
- });
286
- N == null || (g = N.onClose) === null || g === void 0 || g.call(N), $(function(V) {
287
- return V.filter(function(P) {
288
- return P.key !== f;
289
- });
290
- });
291
- };
292
- a.useImperativeHandle(t, function() {
293
- return {
294
- open: function(f) {
295
- $(function(g) {
296
- var N = ee(g), V = N.findIndex(function(D) {
297
- return D.key === f.key;
298
- }), P = Oe({}, f);
299
- if (V >= 0) {
300
- var I;
301
- P.times = (((I = g[V]) === null || I === void 0 ? void 0 : I.times) || 0) + 1, N[V] = P;
302
- } else
303
- P.times = 0, N.push(P);
304
- return s > 0 && N.length > s && (N = N.slice(-s)), N;
305
- });
306
- },
307
- close: function(f) {
308
- S(f);
309
- },
310
- destroy: function() {
311
- $([]);
312
- }
313
- };
314
- });
315
- var v = a.useState({}), M = de(v, 2), m = M[0], y = M[1];
316
- a.useEffect(function() {
317
- var p = {};
318
- w.forEach(function(f) {
319
- var g = f.placement, N = g === void 0 ? "topRight" : g;
320
- N && (p[N] = p[N] || [], p[N].push(f));
321
- }), Object.keys(m).forEach(function(f) {
322
- p[f] = p[f] || [];
323
- }), y(p);
324
- }, [w]);
325
- var b = function(f) {
326
- y(function(g) {
327
- var N = Oe({}, g), V = N[f] || [];
328
- return V.length || delete N[f], N;
329
- });
330
- }, d = a.useRef(!1);
331
- if (a.useEffect(function() {
332
- Object.keys(m).length > 0 ? d.current = !0 : d.current && (u == null || u(), d.current = !1);
333
- }, [m]), !r)
334
- return null;
335
- var F = Object.keys(m);
336
- return /* @__PURE__ */ Gn(/* @__PURE__ */ a.createElement(a.Fragment, null, F.map(function(p) {
337
- var f = m[p], g = /* @__PURE__ */ a.createElement(qt, {
338
- key: p,
339
- configList: f,
340
- placement: p,
341
- prefixCls: n,
342
- className: l == null ? void 0 : l(p),
343
- style: c == null ? void 0 : c(p),
344
- motion: i,
345
- onNoticeClose: S,
346
- onAllNoticeRemoved: b,
347
- stack: C
348
- });
349
- return O ? O(g, {
350
- prefixCls: n,
351
- key: p
352
- }) : g;
353
- })), r);
354
- });
355
- process.env.NODE_ENV !== "production" && (Gt.displayName = "Notifications");
356
- var So = ["getContainer", "motion", "prefixCls", "maxCount", "className", "style", "onAllRemoved", "stack", "renderNotifications"], Eo = function() {
357
- return document.body;
358
- }, pt = 0;
359
- function wo() {
360
- for (var e = {}, t = arguments.length, o = new Array(t), n = 0; n < t; n++)
361
- o[n] = arguments[n];
362
- return o.forEach(function(r) {
363
- r && Object.keys(r).forEach(function(i) {
364
- var s = r[i];
365
- s !== void 0 && (e[i] = s);
366
- });
367
- }), e;
368
- }
369
- function Oo() {
370
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.getContainer, o = t === void 0 ? Eo : t, n = e.motion, r = e.prefixCls, i = e.maxCount, s = e.className, l = e.style, c = e.onAllRemoved, u = e.stack, C = e.renderNotifications, O = Dt(e, So), h = a.useState(), E = de(h, 2), w = E[0], $ = E[1], S = a.useRef(), v = /* @__PURE__ */ a.createElement(Gt, {
371
- container: w,
372
- ref: S,
373
- prefixCls: r,
374
- motion: n,
375
- maxCount: i,
376
- className: s,
377
- style: l,
378
- onAllRemoved: c,
379
- stack: u,
380
- renderNotifications: C
381
- }), M = a.useState([]), m = de(M, 2), y = m[0], b = m[1], d = a.useMemo(function() {
382
- return {
383
- open: function(p) {
384
- var f = wo(O, p);
385
- (f.key === null || f.key === void 0) && (f.key = "rc-notification-".concat(pt), pt += 1), b(function(g) {
386
- return [].concat(ee(g), [{
387
- type: "open",
388
- config: f
389
- }]);
390
- });
391
- },
392
- close: function(p) {
393
- b(function(f) {
394
- return [].concat(ee(f), [{
395
- type: "close",
396
- key: p
397
- }]);
398
- });
399
- },
400
- destroy: function() {
401
- b(function(p) {
402
- return [].concat(ee(p), [{
403
- type: "destroy"
404
- }]);
405
- });
406
- }
407
- };
408
- }, []);
409
- return a.useEffect(function() {
410
- $(o());
411
- }), a.useEffect(function() {
412
- S.current && y.length && (y.forEach(function(F) {
413
- switch (F.type) {
414
- case "open":
415
- S.current.open(F.config);
416
- break;
417
- case "close":
418
- S.current.close(F.key);
419
- break;
420
- case "destroy":
421
- S.current.destroy();
422
- break;
423
- }
424
- }), b(function(F) {
425
- return F.filter(function(p) {
426
- return !y.includes(p);
427
- });
428
- }));
429
- }, [y]), [d, v];
430
- }
431
- const No = (e) => {
432
- const {
433
- componentCls: t
434
- } = e;
435
- return {
436
- // Grid system
437
- [t]: {
438
- display: "flex",
439
- flexFlow: "row wrap",
440
- minWidth: 0,
441
- "&::before, &::after": {
442
- display: "flex"
443
- },
444
- "&-no-wrap": {
445
- flexWrap: "nowrap"
446
- },
447
- // The origin of the X-axis
448
- "&-start": {
449
- justifyContent: "flex-start"
450
- },
451
- // The center of the X-axis
452
- "&-center": {
453
- justifyContent: "center"
454
- },
455
- // The opposite of the X-axis
456
- "&-end": {
457
- justifyContent: "flex-end"
458
- },
459
- "&-space-between": {
460
- justifyContent: "space-between"
461
- },
462
- "&-space-around": {
463
- justifyContent: "space-around"
464
- },
465
- "&-space-evenly": {
466
- justifyContent: "space-evenly"
467
- },
468
- // Align at the top
469
- "&-top": {
470
- alignItems: "flex-start"
471
- },
472
- // Align at the center
473
- "&-middle": {
474
- alignItems: "center"
475
- },
476
- "&-bottom": {
477
- alignItems: "flex-end"
478
- }
479
- }
480
- };
481
- }, Io = (e) => {
482
- const {
483
- componentCls: t
484
- } = e;
485
- return {
486
- // Grid system
487
- [t]: {
488
- position: "relative",
489
- maxWidth: "100%",
490
- // Prevent columns from collapsing when empty
491
- minHeight: 1
492
- }
493
- };
494
- }, Mo = (e, t) => {
495
- const {
496
- prefixCls: o,
497
- componentCls: n,
498
- gridColumns: r
499
- } = e, i = {};
500
- for (let s = r; s >= 0; s--)
501
- s === 0 ? (i[`${n}${t}-${s}`] = {
502
- display: "none"
503
- }, i[`${n}-push-${s}`] = {
504
- insetInlineStart: "auto"
505
- }, i[`${n}-pull-${s}`] = {
506
- insetInlineEnd: "auto"
507
- }, i[`${n}${t}-push-${s}`] = {
508
- insetInlineStart: "auto"
509
- }, i[`${n}${t}-pull-${s}`] = {
510
- insetInlineEnd: "auto"
511
- }, i[`${n}${t}-offset-${s}`] = {
512
- marginInlineStart: 0
513
- }, i[`${n}${t}-order-${s}`] = {
514
- order: 0
515
- }) : (i[`${n}${t}-${s}`] = [
516
- // https://github.com/ant-design/ant-design/issues/44456
517
- // Form set `display: flex` on Col which will override `display: block`.
518
- // Let's get it from css variable to support override.
519
- {
520
- "--ant-display": "block",
521
- // Fallback to display if variable not support
522
- display: "block"
523
- },
524
- {
525
- display: "var(--ant-display)",
526
- flex: `0 0 ${s / r * 100}%`,
527
- maxWidth: `${s / r * 100}%`
528
- }
529
- ], i[`${n}${t}-push-${s}`] = {
530
- insetInlineStart: `${s / r * 100}%`
531
- }, i[`${n}${t}-pull-${s}`] = {
532
- insetInlineEnd: `${s / r * 100}%`
533
- }, i[`${n}${t}-offset-${s}`] = {
534
- marginInlineStart: `${s / r * 100}%`
535
- }, i[`${n}${t}-order-${s}`] = {
536
- order: s
537
- });
538
- return i[`${n}${t}-flex`] = {
539
- flex: `var(--${o}${t}-flex)`
540
- }, i;
541
- }, Ke = (e, t) => Mo(e, t), Fo = (e, t, o) => ({
542
- [`@media (min-width: ${te(t)})`]: Object.assign({}, Ke(e, o))
543
- }), Po = () => ({}), jo = () => ({}), Ro = ze("Grid", No, Po), _o = (e) => ({
544
- xs: e.screenXSMin,
545
- sm: e.screenSMMin,
546
- md: e.screenMDMin,
547
- lg: e.screenLGMin,
548
- xl: e.screenXLMin,
549
- xxl: e.screenXXLMin
550
- }), To = ze("Grid", (e) => {
551
- const t = Ye(e, {
552
- gridColumns: 24
553
- // Row is divided into 24 parts in Grid
554
- }), o = _o(t);
555
- return delete o.xs, [Io(t), Ke(t, ""), Ke(t, "-xs"), Object.keys(o).map((n) => Fo(t, o[n], `-${n}`)).reduce((n, r) => Object.assign(Object.assign({}, n), r), {})];
556
- }, jo), Lo = (e) => {
557
- const {
558
- componentCls: t,
559
- notificationMarginEdge: o,
560
- animationMaxHeight: n
561
- } = e, r = `${t}-notice`, i = new Ee("antNotificationFadeIn", {
562
- "0%": {
563
- transform: "translate3d(100%, 0, 0)",
564
- opacity: 0
565
- },
566
- "100%": {
567
- transform: "translate3d(0, 0, 0)",
568
- opacity: 1
569
- }
570
- }), s = new Ee("antNotificationTopFadeIn", {
571
- "0%": {
572
- top: -n,
573
- opacity: 0
574
- },
575
- "100%": {
576
- top: 0,
577
- opacity: 1
578
- }
579
- }), l = new Ee("antNotificationBottomFadeIn", {
580
- "0%": {
581
- bottom: e.calc(n).mul(-1).equal(),
582
- opacity: 0
583
- },
584
- "100%": {
585
- bottom: 0,
586
- opacity: 1
587
- }
588
- }), c = new Ee("antNotificationLeftFadeIn", {
589
- "0%": {
590
- transform: "translate3d(-100%, 0, 0)",
591
- opacity: 0
592
- },
593
- "100%": {
594
- transform: "translate3d(0, 0, 0)",
595
- opacity: 1
596
- }
597
- });
598
- return {
599
- [t]: {
600
- [`&${t}-top, &${t}-bottom`]: {
601
- marginInline: 0,
602
- [r]: {
603
- marginInline: "auto auto"
604
- }
605
- },
606
- [`&${t}-top`]: {
607
- [`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]: {
608
- animationName: s
609
- }
610
- },
611
- [`&${t}-bottom`]: {
612
- [`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]: {
613
- animationName: l
614
- }
615
- },
616
- [`&${t}-topRight, &${t}-bottomRight`]: {
617
- [`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]: {
618
- animationName: i
619
- }
620
- },
621
- [`&${t}-topLeft, &${t}-bottomLeft`]: {
622
- marginRight: {
623
- value: 0,
624
- _skip_check_: !0
625
- },
626
- marginLeft: {
627
- value: o,
628
- _skip_check_: !0
629
- },
630
- [r]: {
631
- marginInlineEnd: "auto",
632
- marginInlineStart: 0
633
- },
634
- [`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]: {
635
- animationName: c
636
- }
637
- }
638
- }
639
- };
640
- }, Vo = Lo, ko = ["top", "topLeft", "topRight", "bottom", "bottomLeft", "bottomRight"], Do = {
641
- topLeft: "left",
642
- topRight: "right",
643
- bottomLeft: "left",
644
- bottomRight: "right",
645
- top: "left",
646
- bottom: "left"
647
- }, Ho = (e, t) => {
648
- const {
649
- componentCls: o
650
- } = e;
651
- return {
652
- [`${o}-${t}`]: {
653
- [`&${o}-stack > ${o}-notice-wrapper`]: {
654
- [t.startsWith("top") ? "top" : "bottom"]: 0,
655
- [Do[t]]: {
656
- value: 0,
657
- _skip_check_: !0
658
- }
659
- }
660
- }
661
- };
662
- }, Ao = (e) => {
663
- const t = {};
664
- for (let o = 1; o < e.notificationStackLayer; o++)
665
- t[`&:nth-last-child(${o + 1})`] = {
666
- overflow: "hidden",
667
- [`& > ${e.componentCls}-notice`]: {
668
- opacity: 0,
669
- transition: `opacity ${e.motionDurationMid}`
670
- }
671
- };
672
- return Object.assign({
673
- [`&:not(:nth-last-child(-n+${e.notificationStackLayer}))`]: {
674
- opacity: 0,
675
- overflow: "hidden",
676
- color: "transparent",
677
- pointerEvents: "none"
678
- }
679
- }, t);
680
- }, zo = (e) => {
681
- const t = {};
682
- for (let o = 1; o < e.notificationStackLayer; o++)
683
- t[`&:nth-last-child(${o + 1})`] = {
684
- background: e.colorBgBlur,
685
- backdropFilter: "blur(10px)",
686
- "-webkit-backdrop-filter": "blur(10px)"
687
- };
688
- return Object.assign({}, t);
689
- }, Bo = (e) => {
690
- const {
691
- componentCls: t
692
- } = e;
693
- return Object.assign({
694
- [`${t}-stack`]: {
695
- [`& > ${t}-notice-wrapper`]: Object.assign({
696
- transition: `all ${e.motionDurationSlow}, backdrop-filter 0s`,
697
- position: "absolute"
698
- }, Ao(e))
699
- },
700
- [`${t}-stack:not(${t}-stack-expanded)`]: {
701
- [`& > ${t}-notice-wrapper`]: Object.assign({}, zo(e))
702
- },
703
- [`${t}-stack${t}-stack-expanded`]: {
704
- [`& > ${t}-notice-wrapper`]: {
705
- "&:not(:nth-last-child(-n + 1))": {
706
- opacity: 1,
707
- overflow: "unset",
708
- color: "inherit",
709
- pointerEvents: "auto",
710
- [`& > ${e.componentCls}-notice`]: {
711
- opacity: 1
712
- }
713
- },
714
- "&:after": {
715
- content: '""',
716
- position: "absolute",
717
- height: e.margin,
718
- width: "100%",
719
- insetInline: 0,
720
- bottom: e.calc(e.margin).mul(-1).equal(),
721
- background: "transparent",
722
- pointerEvents: "auto"
723
- }
724
- }
725
- }
726
- }, ko.map((o) => Ho(e, o)).reduce((o, n) => Object.assign(Object.assign({}, o), n), {}));
727
- }, Wo = Bo, Xt = (e) => {
728
- const {
729
- iconCls: t,
730
- componentCls: o,
731
- // .ant-notification
732
- boxShadow: n,
733
- fontSizeLG: r,
734
- notificationMarginBottom: i,
735
- borderRadiusLG: s,
736
- colorSuccess: l,
737
- colorInfo: c,
738
- colorWarning: u,
739
- colorError: C,
740
- colorTextHeading: O,
741
- notificationBg: h,
742
- notificationPadding: E,
743
- notificationMarginEdge: w,
744
- notificationProgressBg: $,
745
- notificationProgressHeight: S,
746
- fontSize: v,
747
- lineHeight: M,
748
- width: m,
749
- notificationIconSize: y,
750
- colorText: b
751
- } = e, d = `${o}-notice`;
752
- return {
753
- position: "relative",
754
- marginBottom: i,
755
- marginInlineStart: "auto",
756
- background: h,
757
- borderRadius: s,
758
- boxShadow: n,
759
- [d]: {
760
- padding: E,
761
- width: m,
762
- maxWidth: `calc(100vw - ${te(e.calc(w).mul(2).equal())})`,
763
- overflow: "hidden",
764
- lineHeight: M,
765
- wordWrap: "break-word"
766
- },
767
- [`${d}-message`]: {
768
- marginBottom: e.marginXS,
769
- color: O,
770
- fontSize: r,
771
- lineHeight: e.lineHeightLG
772
- },
773
- [`${d}-description`]: {
774
- fontSize: v,
775
- color: b
776
- },
777
- [`${d}-closable ${d}-message`]: {
778
- paddingInlineEnd: e.paddingLG
779
- },
780
- [`${d}-with-icon ${d}-message`]: {
781
- marginBottom: e.marginXS,
782
- marginInlineStart: e.calc(e.marginSM).add(y).equal(),
783
- fontSize: r
784
- },
785
- [`${d}-with-icon ${d}-description`]: {
786
- marginInlineStart: e.calc(e.marginSM).add(y).equal(),
787
- fontSize: v
788
- },
789
- // Icon & color style in different selector level
790
- // https://github.com/ant-design/ant-design/issues/16503
791
- // https://github.com/ant-design/ant-design/issues/15512
792
- [`${d}-icon`]: {
793
- position: "absolute",
794
- fontSize: y,
795
- lineHeight: 1,
796
- // icon-font
797
- [`&-success${t}`]: {
798
- color: l
799
- },
800
- [`&-info${t}`]: {
801
- color: c
802
- },
803
- [`&-warning${t}`]: {
804
- color: u
805
- },
806
- [`&-error${t}`]: {
807
- color: C
808
- }
809
- },
810
- [`${d}-close`]: Object.assign({
811
- position: "absolute",
812
- top: e.notificationPaddingVertical,
813
- insetInlineEnd: e.notificationPaddingHorizontal,
814
- color: e.colorIcon,
815
- outline: "none",
816
- width: e.notificationCloseButtonSize,
817
- height: e.notificationCloseButtonSize,
818
- borderRadius: e.borderRadiusSM,
819
- transition: `background-color ${e.motionDurationMid}, color ${e.motionDurationMid}`,
820
- display: "flex",
821
- alignItems: "center",
822
- justifyContent: "center",
823
- "&:hover": {
824
- color: e.colorIconHover,
825
- backgroundColor: e.colorBgTextHover
826
- },
827
- "&:active": {
828
- backgroundColor: e.colorBgTextActive
829
- }
830
- }, In(e)),
831
- [`${d}-progress`]: {
832
- position: "absolute",
833
- display: "block",
834
- appearance: "none",
835
- WebkitAppearance: "none",
836
- inlineSize: `calc(100% - ${te(s)} * 2)`,
837
- left: {
838
- _skip_check_: !0,
839
- value: s
840
- },
841
- right: {
842
- _skip_check_: !0,
843
- value: s
844
- },
845
- bottom: 0,
846
- blockSize: S,
847
- border: 0,
848
- "&, &::-webkit-progress-bar": {
849
- borderRadius: s,
850
- backgroundColor: "rgba(0, 0, 0, 0.04)"
851
- },
852
- "&::-moz-progress-bar": {
853
- background: $
854
- },
855
- "&::-webkit-progress-value": {
856
- borderRadius: s,
857
- background: $
858
- }
859
- },
860
- [`${d}-btn`]: {
861
- float: "right",
862
- marginTop: e.marginSM
863
- }
864
- };
865
- }, qo = (e) => {
866
- const {
867
- componentCls: t,
868
- // .ant-notification
869
- notificationMarginBottom: o,
870
- notificationMarginEdge: n,
871
- motionDurationMid: r,
872
- motionEaseInOut: i
873
- } = e, s = `${t}-notice`, l = new Ee("antNotificationFadeOut", {
874
- "0%": {
875
- maxHeight: e.animationMaxHeight,
876
- marginBottom: o
877
- },
878
- "100%": {
879
- maxHeight: 0,
880
- marginBottom: 0,
881
- paddingTop: 0,
882
- paddingBottom: 0,
883
- opacity: 0
884
- }
885
- });
886
- return [
887
- // ============================ Holder ============================
888
- {
889
- [t]: Object.assign(Object.assign({}, Qe(e)), {
890
- position: "fixed",
891
- zIndex: e.zIndexPopup,
892
- marginRight: {
893
- value: n,
894
- _skip_check_: !0
895
- },
896
- [`${t}-hook-holder`]: {
897
- position: "relative"
898
- },
899
- // animation
900
- [`${t}-fade-appear-prepare`]: {
901
- opacity: "0 !important"
902
- },
903
- [`${t}-fade-enter, ${t}-fade-appear`]: {
904
- animationDuration: e.motionDurationMid,
905
- animationTimingFunction: i,
906
- animationFillMode: "both",
907
- opacity: 0,
908
- animationPlayState: "paused"
909
- },
910
- [`${t}-fade-leave`]: {
911
- animationTimingFunction: i,
912
- animationFillMode: "both",
913
- animationDuration: r,
914
- animationPlayState: "paused"
915
- },
916
- [`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]: {
917
- animationPlayState: "running"
918
- },
919
- [`${t}-fade-leave${t}-fade-leave-active`]: {
920
- animationName: l,
921
- animationPlayState: "running"
922
- },
923
- // RTL
924
- "&-rtl": {
925
- direction: "rtl",
926
- [`${s}-btn`]: {
927
- float: "left"
928
- }
929
- }
930
- })
931
- },
932
- // ============================ Notice ============================
933
- {
934
- [t]: {
935
- [`${s}-wrapper`]: Object.assign({}, Xt(e))
936
- }
937
- }
938
- ];
939
- }, Kt = (e) => ({
940
- zIndexPopup: e.zIndexPopupBase + Kn + 50,
941
- width: 384
942
- }), Ut = (e) => {
943
- const t = e.paddingMD, o = e.paddingLG;
944
- return Ye(e, {
945
- notificationBg: e.colorBgElevated,
946
- notificationPaddingVertical: t,
947
- notificationPaddingHorizontal: o,
948
- notificationIconSize: e.calc(e.fontSizeLG).mul(e.lineHeightLG).equal(),
949
- notificationCloseButtonSize: e.calc(e.controlHeightLG).mul(0.55).equal(),
950
- notificationMarginBottom: e.margin,
951
- notificationPadding: `${te(e.paddingMD)} ${te(e.paddingContentHorizontalLG)}`,
952
- notificationMarginEdge: e.marginLG,
953
- animationMaxHeight: 150,
954
- notificationStackLayer: 3,
955
- notificationProgressHeight: 2,
956
- notificationProgressBg: `linear-gradient(90deg, ${e.colorPrimaryBorderHover}, ${e.colorPrimary})`
957
- });
958
- }, Yt = ze("Notification", (e) => {
959
- const t = Ut(e);
960
- return [qo(t), Vo(t), Wo(t)];
961
- }, Kt), Go = Ft(["Notification", "PurePanel"], (e) => {
962
- const t = `${e.componentCls}-notice`, o = Ut(e);
963
- return {
964
- [`${t}-pure-panel`]: Object.assign(Object.assign({}, Xt(o)), {
965
- width: o.width,
966
- maxWidth: `calc(100vw - ${te(e.calc(o.notificationMarginEdge).mul(2).equal())})`,
967
- margin: 0
968
- })
969
- };
970
- }, Kt);
971
- var Xo = globalThis && globalThis.__rest || function(e, t) {
972
- var o = {};
973
- for (var n in e)
974
- Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
975
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
976
- for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
977
- t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (o[n[r]] = e[n[r]]);
978
- return o;
979
- };
980
- function Ze(e, t) {
981
- return t === null || t === !1 ? null : t || /* @__PURE__ */ a.createElement(Vt, {
982
- className: `${e}-close-icon`
983
- });
984
- }
985
- const Ko = {
986
- success: _t,
987
- info: qn,
988
- error: Lt,
989
- warning: Tt
990
- }, Qt = (e) => {
991
- const {
992
- prefixCls: t,
993
- icon: o,
994
- type: n,
995
- message: r,
996
- description: i,
997
- btn: s,
998
- role: l = "alert"
999
- } = e;
1000
- let c = null;
1001
- return o ? c = /* @__PURE__ */ a.createElement("span", {
1002
- className: `${t}-icon`
1003
- }, o) : n && (c = /* @__PURE__ */ a.createElement(Ko[n] || null, {
1004
- className: K(`${t}-icon`, `${t}-icon-${n}`)
1005
- })), /* @__PURE__ */ a.createElement("div", {
1006
- className: K({
1007
- [`${t}-with-icon`]: c
1008
- }),
1009
- role: l
1010
- }, c, /* @__PURE__ */ a.createElement("div", {
1011
- className: `${t}-message`
1012
- }, r), /* @__PURE__ */ a.createElement("div", {
1013
- className: `${t}-description`
1014
- }, i), s && /* @__PURE__ */ a.createElement("div", {
1015
- className: `${t}-btn`
1016
- }, s));
1017
- }, Uo = (e) => {
1018
- const {
1019
- prefixCls: t,
1020
- className: o,
1021
- icon: n,
1022
- type: r,
1023
- message: i,
1024
- description: s,
1025
- btn: l,
1026
- closable: c = !0,
1027
- closeIcon: u,
1028
- className: C
1029
- } = e, O = Xo(e, ["prefixCls", "className", "icon", "type", "message", "description", "btn", "closable", "closeIcon", "className"]), {
1030
- getPrefixCls: h
1031
- } = a.useContext(he), E = t || h("notification"), w = `${E}-notice`, $ = je(E), [S, v, M] = Yt(E, $);
1032
- return S(/* @__PURE__ */ a.createElement("div", {
1033
- className: K(`${w}-pure-panel`, v, o, M, $)
1034
- }, /* @__PURE__ */ a.createElement(Go, {
1035
- prefixCls: E
1036
- }), /* @__PURE__ */ a.createElement(Bt, Object.assign({}, O, {
1037
- prefixCls: E,
1038
- eventKey: "pure",
1039
- duration: null,
1040
- closable: c,
1041
- className: K({
1042
- notificationClassName: C
1043
- }),
1044
- closeIcon: Ze(E, u),
1045
- content: /* @__PURE__ */ a.createElement(Qt, {
1046
- prefixCls: w,
1047
- icon: n,
1048
- type: r,
1049
- message: i,
1050
- description: s,
1051
- btn: l
1052
- })
1053
- }))));
1054
- }, Yo = Uo;
1055
- function Qo(e, t, o) {
1056
- let n;
1057
- switch (e) {
1058
- case "top":
1059
- n = {
1060
- left: "50%",
1061
- transform: "translateX(-50%)",
1062
- right: "auto",
1063
- top: t,
1064
- bottom: "auto"
1065
- };
1066
- break;
1067
- case "topLeft":
1068
- n = {
1069
- left: 0,
1070
- top: t,
1071
- bottom: "auto"
1072
- };
1073
- break;
1074
- case "topRight":
1075
- n = {
1076
- right: 0,
1077
- top: t,
1078
- bottom: "auto"
1079
- };
1080
- break;
1081
- case "bottom":
1082
- n = {
1083
- left: "50%",
1084
- transform: "translateX(-50%)",
1085
- right: "auto",
1086
- top: "auto",
1087
- bottom: o
1088
- };
1089
- break;
1090
- case "bottomLeft":
1091
- n = {
1092
- left: 0,
1093
- top: "auto",
1094
- bottom: o
1095
- };
1096
- break;
1097
- default:
1098
- n = {
1099
- right: 0,
1100
- top: "auto",
1101
- bottom: o
1102
- };
1103
- break;
1104
- }
1105
- return n;
1106
- }
1107
- function Jo(e) {
1108
- return {
1109
- motionName: `${e}-fade`
1110
- };
1111
- }
1112
- var Zo = globalThis && globalThis.__rest || function(e, t) {
1113
- var o = {};
1114
- for (var n in e)
1115
- Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
1116
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
1117
- for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
1118
- t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (o[n[r]] = e[n[r]]);
1119
- return o;
1120
- };
1121
- const gt = 24, er = 4.5, tr = "topRight", nr = (e) => {
1122
- let {
1123
- children: t,
1124
- prefixCls: o
1125
- } = e;
1126
- const n = je(o), [r, i, s] = Yt(o, n);
1127
- return r(/* @__PURE__ */ q.createElement(Co, {
1128
- classNames: {
1129
- list: K(i, s, n)
1130
- }
1131
- }, t));
1132
- }, or = (e, t) => {
1133
- let {
1134
- prefixCls: o,
1135
- key: n
1136
- } = t;
1137
- return /* @__PURE__ */ q.createElement(nr, {
1138
- prefixCls: o,
1139
- key: n
1140
- }, e);
1141
- }, rr = /* @__PURE__ */ q.forwardRef((e, t) => {
1142
- const {
1143
- top: o,
1144
- bottom: n,
1145
- prefixCls: r,
1146
- getContainer: i,
1147
- maxCount: s,
1148
- rtl: l,
1149
- onAllRemoved: c,
1150
- stack: u,
1151
- duration: C,
1152
- pauseOnHover: O = !0,
1153
- showProgress: h
1154
- } = e, {
1155
- getPrefixCls: E,
1156
- getPopupContainer: w,
1157
- notification: $,
1158
- direction: S
1159
- } = Ie(he), [, v] = Pt(), M = r || E("notification"), m = (p) => Qo(p, o ?? gt, n ?? gt), y = () => K({
1160
- [`${M}-rtl`]: l ?? S === "rtl"
1161
- }), b = () => Jo(M), [d, F] = Oo({
1162
- prefixCls: M,
1163
- style: m,
1164
- className: y,
1165
- motion: b,
1166
- closable: !0,
1167
- closeIcon: Ze(M),
1168
- duration: C ?? er,
1169
- getContainer: () => (i == null ? void 0 : i()) || (w == null ? void 0 : w()) || document.body,
1170
- maxCount: s,
1171
- pauseOnHover: O,
1172
- showProgress: h,
1173
- onAllRemoved: c,
1174
- renderNotifications: or,
1175
- stack: u === !1 ? !1 : {
1176
- threshold: typeof u == "object" ? u == null ? void 0 : u.threshold : void 0,
1177
- offset: 8,
1178
- gap: v.margin
1179
- }
1180
- });
1181
- return q.useImperativeHandle(t, () => Object.assign(Object.assign({}, d), {
1182
- prefixCls: M,
1183
- notification: $
1184
- })), F;
1185
- });
1186
- function Jt(e) {
1187
- const t = q.useRef(null), o = Pe("Notification");
1188
- return [q.useMemo(() => {
1189
- const r = (c) => {
1190
- var u;
1191
- if (!t.current) {
1192
- process.env.NODE_ENV !== "production" && o(!1, "usage", "You are calling notice in render which will break in React 18 concurrent mode. Please trigger in effect instead.");
1193
- return;
1194
- }
1195
- const {
1196
- open: C,
1197
- prefixCls: O,
1198
- notification: h
1199
- } = t.current, E = `${O}-notice`, {
1200
- message: w,
1201
- description: $,
1202
- icon: S,
1203
- type: v,
1204
- btn: M,
1205
- className: m,
1206
- style: y,
1207
- role: b = "alert",
1208
- closeIcon: d,
1209
- closable: F
1210
- } = c, p = Zo(c, ["message", "description", "icon", "type", "btn", "className", "style", "role", "closeIcon", "closable"]), f = Ze(E, typeof d < "u" ? d : h == null ? void 0 : h.closeIcon);
1211
- return C(Object.assign(Object.assign({
1212
- // use placement from props instead of hard-coding "topRight"
1213
- placement: (u = e == null ? void 0 : e.placement) !== null && u !== void 0 ? u : tr
1214
- }, p), {
1215
- content: /* @__PURE__ */ q.createElement(Qt, {
1216
- prefixCls: E,
1217
- icon: S,
1218
- type: v,
1219
- message: w,
1220
- description: $,
1221
- btn: M,
1222
- role: b
1223
- }),
1224
- className: K(v && `${E}-${v}`, m, h == null ? void 0 : h.className),
1225
- style: Object.assign(Object.assign({}, h == null ? void 0 : h.style), y),
1226
- closeIcon: f,
1227
- closable: F ?? !!f
1228
- }));
1229
- }, s = {
1230
- open: r,
1231
- destroy: (c) => {
1232
- var u, C;
1233
- c !== void 0 ? (u = t.current) === null || u === void 0 || u.close(c) : (C = t.current) === null || C === void 0 || C.destroy();
1234
- }
1235
- };
1236
- return ["success", "info", "warning", "error"].forEach((c) => {
1237
- s[c] = (u) => r(Object.assign(Object.assign({}, u), {
1238
- type: c
1239
- }));
1240
- }), s;
1241
- }, []), /* @__PURE__ */ q.createElement(rr, Object.assign({
1242
- key: "notification-holder"
1243
- }, e, {
1244
- ref: t
1245
- }))];
1246
- }
1247
- function ir(e) {
1248
- return Jt(e);
1249
- }
1250
- const ar = /* @__PURE__ */ q.createContext({}), Me = ["xxl", "xl", "lg", "md", "sm", "xs"], sr = (e) => ({
1251
- xs: `(max-width: ${e.screenXSMax}px)`,
1252
- sm: `(min-width: ${e.screenSM}px)`,
1253
- md: `(min-width: ${e.screenMD}px)`,
1254
- lg: `(min-width: ${e.screenLG}px)`,
1255
- xl: `(min-width: ${e.screenXL}px)`,
1256
- xxl: `(min-width: ${e.screenXXL}px)`
1257
- }), lr = (e) => {
1258
- const t = e, o = [].concat(Me).reverse();
1259
- return o.forEach((n, r) => {
1260
- const i = n.toUpperCase(), s = `screen${i}Min`, l = `screen${i}`;
1261
- if (!(t[s] <= t[l]))
1262
- throw new Error(`${s}<=${l} fails : !(${t[s]}<=${t[l]})`);
1263
- if (r < o.length - 1) {
1264
- const c = `screen${i}Max`;
1265
- if (!(t[l] <= t[c]))
1266
- throw new Error(`${l}<=${c} fails : !(${t[l]}<=${t[c]})`);
1267
- const C = `screen${o[r + 1].toUpperCase()}Min`;
1268
- if (!(t[c] <= t[C]))
1269
- throw new Error(`${c}<=${C} fails : !(${t[c]}<=${t[C]})`);
1270
- }
1271
- }), e;
1272
- };
1273
- function cr() {
1274
- const [, e] = Pt(), t = sr(lr(e));
1275
- return q.useMemo(() => {
1276
- const o = /* @__PURE__ */ new Map();
1277
- let n = -1, r = {};
1278
- return {
1279
- matchHandlers: {},
1280
- dispatch(i) {
1281
- return r = i, o.forEach((s) => s(r)), o.size >= 1;
1282
- },
1283
- subscribe(i) {
1284
- return o.size || this.register(), n += 1, o.set(n, i), i(r), n;
1285
- },
1286
- unsubscribe(i) {
1287
- o.delete(i), o.size || this.unregister();
1288
- },
1289
- unregister() {
1290
- Object.keys(t).forEach((i) => {
1291
- const s = t[i], l = this.matchHandlers[s];
1292
- l == null || l.mql.removeListener(l == null ? void 0 : l.listener);
1293
- }), o.clear();
1294
- },
1295
- register() {
1296
- Object.keys(t).forEach((i) => {
1297
- const s = t[i], l = (u) => {
1298
- let {
1299
- matches: C
1300
- } = u;
1301
- this.dispatch(Object.assign(Object.assign({}, r), {
1302
- [i]: C
1303
- }));
1304
- }, c = window.matchMedia(s);
1305
- c.addListener(l), this.matchHandlers[s] = {
1306
- mql: c,
1307
- listener: l
1308
- }, l(c);
1309
- });
1310
- },
1311
- responsiveMap: t
1312
- };
1313
- }, [e]);
1314
- }
1315
- const ur = /* @__PURE__ */ It({}), Zt = ur;
1316
- var dr = globalThis && globalThis.__rest || function(e, t) {
1317
- var o = {};
1318
- for (var n in e)
1319
- Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
1320
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
1321
- for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
1322
- t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (o[n[r]] = e[n[r]]);
1323
- return o;
1324
- };
1325
- function ht(e) {
1326
- return typeof e == "number" ? `${e} ${e} auto` : /^\d+(\.\d+)?(px|em|rem|%)$/.test(e) ? `0 0 ${e}` : e;
1327
- }
1328
- const fr = ["xs", "sm", "md", "lg", "xl", "xxl"], en = /* @__PURE__ */ a.forwardRef((e, t) => {
1329
- const {
1330
- getPrefixCls: o,
1331
- direction: n
1332
- } = a.useContext(he), {
1333
- gutter: r,
1334
- wrap: i
1335
- } = a.useContext(Zt), {
1336
- prefixCls: s,
1337
- span: l,
1338
- order: c,
1339
- offset: u,
1340
- push: C,
1341
- pull: O,
1342
- className: h,
1343
- children: E,
1344
- flex: w,
1345
- style: $
1346
- } = e, S = dr(e, ["prefixCls", "span", "order", "offset", "push", "pull", "className", "children", "flex", "style"]), v = o("col", s), [M, m, y] = To(v), b = {};
1347
- let d = {};
1348
- fr.forEach((f) => {
1349
- let g = {};
1350
- const N = e[f];
1351
- typeof N == "number" ? g.span = N : typeof N == "object" && (g = N || {}), delete S[f], d = Object.assign(Object.assign({}, d), {
1352
- [`${v}-${f}-${g.span}`]: g.span !== void 0,
1353
- [`${v}-${f}-order-${g.order}`]: g.order || g.order === 0,
1354
- [`${v}-${f}-offset-${g.offset}`]: g.offset || g.offset === 0,
1355
- [`${v}-${f}-push-${g.push}`]: g.push || g.push === 0,
1356
- [`${v}-${f}-pull-${g.pull}`]: g.pull || g.pull === 0,
1357
- [`${v}-rtl`]: n === "rtl"
1358
- }), g.flex && (d[`${v}-${f}-flex`] = !0, b[`--${v}-${f}-flex`] = ht(g.flex));
1359
- });
1360
- const F = K(v, {
1361
- [`${v}-${l}`]: l !== void 0,
1362
- [`${v}-order-${c}`]: c,
1363
- [`${v}-offset-${u}`]: u,
1364
- [`${v}-push-${C}`]: C,
1365
- [`${v}-pull-${O}`]: O
1366
- }, h, d, m, y), p = {};
1367
- if (r && r[0] > 0) {
1368
- const f = r[0] / 2;
1369
- p.paddingLeft = f, p.paddingRight = f;
1370
- }
1371
- return w && (p.flex = ht(w), i === !1 && !p.minWidth && (p.minWidth = 0)), M(/* @__PURE__ */ a.createElement("div", Object.assign({}, S, {
1372
- style: Object.assign(Object.assign(Object.assign({}, p), $), b),
1373
- className: F,
1374
- ref: t
1375
- }), E));
1376
- });
1377
- process.env.NODE_ENV !== "production" && (en.displayName = "Col");
1378
- const tn = en;
1379
- var mr = globalThis && globalThis.__rest || function(e, t) {
1380
- var o = {};
1381
- for (var n in e)
1382
- Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
1383
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
1384
- for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
1385
- t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (o[n[r]] = e[n[r]]);
1386
- return o;
1387
- };
1388
- function vt(e, t) {
1389
- const [o, n] = a.useState(typeof e == "string" ? e : ""), r = () => {
1390
- if (typeof e == "string" && n(e), typeof e == "object")
1391
- for (let i = 0; i < Me.length; i++) {
1392
- const s = Me[i];
1393
- if (!t[s])
1394
- continue;
1395
- const l = e[s];
1396
- if (l !== void 0) {
1397
- n(l);
1398
- return;
1399
- }
1400
- }
1401
- };
1402
- return a.useEffect(() => {
1403
- r();
1404
- }, [JSON.stringify(e), t]), o;
1405
- }
1406
- const nn = /* @__PURE__ */ a.forwardRef((e, t) => {
1407
- const {
1408
- prefixCls: o,
1409
- justify: n,
1410
- align: r,
1411
- className: i,
1412
- style: s,
1413
- children: l,
1414
- gutter: c = 0,
1415
- wrap: u
1416
- } = e, C = mr(e, ["prefixCls", "justify", "align", "className", "style", "children", "gutter", "wrap"]), {
1417
- getPrefixCls: O,
1418
- direction: h
1419
- } = a.useContext(he), [E, w] = a.useState({
1420
- xs: !0,
1421
- sm: !0,
1422
- md: !0,
1423
- lg: !0,
1424
- xl: !0,
1425
- xxl: !0
1426
- }), [$, S] = a.useState({
1427
- xs: !1,
1428
- sm: !1,
1429
- md: !1,
1430
- lg: !1,
1431
- xl: !1,
1432
- xxl: !1
1433
- }), v = vt(r, $), M = vt(n, $), m = a.useRef(c), y = cr();
1434
- a.useEffect(() => {
1435
- const x = y.subscribe((H) => {
1436
- S(H);
1437
- const j = m.current || 0;
1438
- (!Array.isArray(j) && typeof j == "object" || Array.isArray(j) && (typeof j[0] == "object" || typeof j[1] == "object")) && w(H);
1439
- });
1440
- return () => y.unsubscribe(x);
1441
- }, []);
1442
- const b = () => {
1443
- const x = [void 0, void 0];
1444
- return (Array.isArray(c) ? c : [c, void 0]).forEach((j, U) => {
1445
- if (typeof j == "object")
1446
- for (let z = 0; z < Me.length; z++) {
1447
- const Y = Me[z];
1448
- if (E[Y] && j[Y] !== void 0) {
1449
- x[U] = j[Y];
1450
- break;
1451
- }
1452
- }
1453
- else
1454
- x[U] = j;
1455
- }), x;
1456
- }, d = O("row", o), [F, p, f] = Ro(d), g = b(), N = K(d, {
1457
- [`${d}-no-wrap`]: u === !1,
1458
- [`${d}-${M}`]: M,
1459
- [`${d}-${v}`]: v,
1460
- [`${d}-rtl`]: h === "rtl"
1461
- }, i, p, f), V = {}, P = g[0] != null && g[0] > 0 ? g[0] / -2 : void 0;
1462
- P && (V.marginLeft = P, V.marginRight = P);
1463
- const [I, D] = g;
1464
- V.rowGap = D;
1465
- const R = a.useMemo(() => ({
1466
- gutter: [I, D],
1467
- wrap: u
1468
- }), [I, D, u]);
1469
- return F(/* @__PURE__ */ a.createElement(Zt.Provider, {
1470
- value: R
1471
- }, /* @__PURE__ */ a.createElement("div", Object.assign({}, C, {
1472
- className: N,
1473
- style: Object.assign(Object.assign({}, V), s),
1474
- ref: t
1475
- }), l)));
1476
- });
1477
- process.env.NODE_ENV !== "production" && (nn.displayName = "Row");
1478
- const pr = nn;
1479
- function He(e) {
1480
- const [t, o] = a.useState(e);
1481
- return a.useEffect(() => {
1482
- const n = setTimeout(() => {
1483
- o(e);
1484
- }, e.length ? 0 : 10);
1485
- return () => {
1486
- clearTimeout(n);
1487
- };
1488
- }, [e]), t;
1489
- }
1490
- const gr = (e) => {
1491
- const {
1492
- componentCls: t
1493
- } = e, o = `${t}-show-help`, n = `${t}-show-help-item`;
1494
- return {
1495
- [o]: {
1496
- // Explain holder
1497
- transition: `opacity ${e.motionDurationFast} ${e.motionEaseInOut}`,
1498
- "&-appear, &-enter": {
1499
- opacity: 0,
1500
- "&-active": {
1501
- opacity: 1
1502
- }
1503
- },
1504
- "&-leave": {
1505
- opacity: 1,
1506
- "&-active": {
1507
- opacity: 0
1508
- }
1509
- },
1510
- // Explain
1511
- [n]: {
1512
- overflow: "hidden",
1513
- transition: `height ${e.motionDurationFast} ${e.motionEaseInOut},
1514
- opacity ${e.motionDurationFast} ${e.motionEaseInOut},
1515
- transform ${e.motionDurationFast} ${e.motionEaseInOut} !important`,
1516
- [`&${n}-appear, &${n}-enter`]: {
1517
- transform: "translateY(-5px)",
1518
- opacity: 0,
1519
- "&-active": {
1520
- transform: "translateY(0)",
1521
- opacity: 1
1522
- }
1523
- },
1524
- [`&${n}-leave-active`]: {
1525
- transform: "translateY(-5px)"
1526
- }
1527
- }
1528
- }
1529
- };
1530
- }, hr = gr, vr = (e) => ({
1531
- legend: {
1532
- display: "block",
1533
- width: "100%",
1534
- marginBottom: e.marginLG,
1535
- padding: 0,
1536
- color: e.colorTextDescription,
1537
- fontSize: e.fontSizeLG,
1538
- lineHeight: "inherit",
1539
- border: 0,
1540
- borderBottom: `${te(e.lineWidth)} ${e.lineType} ${e.colorBorder}`
1541
- },
1542
- 'input[type="search"]': {
1543
- boxSizing: "border-box"
1544
- },
1545
- // Position radios and checkboxes better
1546
- 'input[type="radio"], input[type="checkbox"]': {
1547
- lineHeight: "normal"
1548
- },
1549
- 'input[type="file"]': {
1550
- display: "block"
1551
- },
1552
- // Make range inputs behave like textual form controls
1553
- 'input[type="range"]': {
1554
- display: "block",
1555
- width: "100%"
1556
- },
1557
- // Make multiple select elements height not fixed
1558
- "select[multiple], select[size]": {
1559
- height: "auto"
1560
- },
1561
- // Focus for file, radio, and checkbox
1562
- "input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus": {
1563
- outline: 0,
1564
- boxShadow: `0 0 0 ${te(e.controlOutlineWidth)} ${e.controlOutline}`
1565
- },
1566
- // Adjust output element
1567
- output: {
1568
- display: "block",
1569
- paddingTop: 15,
1570
- color: e.colorText,
1571
- fontSize: e.fontSize,
1572
- lineHeight: e.lineHeight
1573
- }
1574
- }), bt = (e, t) => {
1575
- const {
1576
- formItemCls: o
1577
- } = e;
1578
- return {
1579
- [o]: {
1580
- [`${o}-label > label`]: {
1581
- height: t
1582
- },
1583
- [`${o}-control-input`]: {
1584
- minHeight: t
1585
- }
1586
- }
1587
- };
1588
- }, br = (e) => {
1589
- const {
1590
- componentCls: t
1591
- } = e;
1592
- return {
1593
- [e.componentCls]: Object.assign(Object.assign(Object.assign({}, Qe(e)), vr(e)), {
1594
- [`${t}-text`]: {
1595
- display: "inline-block",
1596
- paddingInlineEnd: e.paddingSM
1597
- },
1598
- // ================================================================
1599
- // = Size =
1600
- // ================================================================
1601
- "&-small": Object.assign({}, bt(e, e.controlHeightSM)),
1602
- "&-large": Object.assign({}, bt(e, e.controlHeightLG))
1603
- })
1604
- };
1605
- }, yr = (e) => {
1606
- const {
1607
- formItemCls: t,
1608
- iconCls: o,
1609
- componentCls: n,
1610
- rootPrefixCls: r,
1611
- antCls: i,
1612
- labelRequiredMarkColor: s,
1613
- labelColor: l,
1614
- labelFontSize: c,
1615
- labelHeight: u,
1616
- labelColonMarginInlineStart: C,
1617
- labelColonMarginInlineEnd: O,
1618
- itemMarginBottom: h
1619
- } = e;
1620
- return {
1621
- [t]: Object.assign(Object.assign({}, Qe(e)), {
1622
- marginBottom: h,
1623
- verticalAlign: "top",
1624
- "&-with-help": {
1625
- transition: "none"
1626
- },
1627
- [`&-hidden,
1628
- &-hidden${i}-row`]: {
1629
- // https://github.com/ant-design/ant-design/issues/26141
1630
- display: "none"
1631
- },
1632
- "&-has-warning": {
1633
- [`${t}-split`]: {
1634
- color: e.colorError
1635
- }
1636
- },
1637
- "&-has-error": {
1638
- [`${t}-split`]: {
1639
- color: e.colorWarning
1640
- }
1641
- },
1642
- // ==============================================================
1643
- // = Label =
1644
- // ==============================================================
1645
- [`${t}-label`]: {
1646
- flexGrow: 0,
1647
- overflow: "hidden",
1648
- whiteSpace: "nowrap",
1649
- textAlign: "end",
1650
- verticalAlign: "middle",
1651
- "&-left": {
1652
- textAlign: "start"
1653
- },
1654
- "&-wrap": {
1655
- overflow: "unset",
1656
- lineHeight: e.lineHeight,
1657
- whiteSpace: "unset"
1658
- },
1659
- "> label": {
1660
- position: "relative",
1661
- display: "inline-flex",
1662
- alignItems: "center",
1663
- maxWidth: "100%",
1664
- height: u,
1665
- color: l,
1666
- fontSize: c,
1667
- [`> ${o}`]: {
1668
- fontSize: e.fontSize,
1669
- verticalAlign: "top"
1670
- },
1671
- // Required mark
1672
- [`&${t}-required:not(${t}-required-mark-optional)::before`]: {
1673
- display: "inline-block",
1674
- marginInlineEnd: e.marginXXS,
1675
- color: s,
1676
- fontSize: e.fontSize,
1677
- fontFamily: "SimSun, sans-serif",
1678
- lineHeight: 1,
1679
- content: '"*"',
1680
- [`${n}-hide-required-mark &`]: {
1681
- display: "none"
1682
- }
1683
- },
1684
- // Optional mark
1685
- [`${t}-optional`]: {
1686
- display: "inline-block",
1687
- marginInlineStart: e.marginXXS,
1688
- color: e.colorTextDescription,
1689
- [`${n}-hide-required-mark &`]: {
1690
- display: "none"
1691
- }
1692
- },
1693
- // Optional mark
1694
- [`${t}-tooltip`]: {
1695
- color: e.colorTextDescription,
1696
- cursor: "help",
1697
- writingMode: "horizontal-tb",
1698
- marginInlineStart: e.marginXXS
1699
- },
1700
- "&::after": {
1701
- content: '":"',
1702
- position: "relative",
1703
- marginBlock: 0,
1704
- marginInlineStart: C,
1705
- marginInlineEnd: O
1706
- },
1707
- [`&${t}-no-colon::after`]: {
1708
- content: '"\\a0"'
1709
- }
1710
- }
1711
- },
1712
- // ==============================================================
1713
- // = Input =
1714
- // ==============================================================
1715
- [`${t}-control`]: {
1716
- "--ant-display": "flex",
1717
- flexDirection: "column",
1718
- flexGrow: 1,
1719
- [`&:first-child:not([class^="'${r}-col-'"]):not([class*="' ${r}-col-'"])`]: {
1720
- width: "100%"
1721
- },
1722
- "&-input": {
1723
- position: "relative",
1724
- display: "flex",
1725
- alignItems: "center",
1726
- minHeight: e.controlHeight,
1727
- "&-content": {
1728
- flex: "auto",
1729
- maxWidth: "100%"
1730
- }
1731
- }
1732
- },
1733
- // ==============================================================
1734
- // = Explain =
1735
- // ==============================================================
1736
- [t]: {
1737
- "&-additional": {
1738
- display: "flex",
1739
- flexDirection: "column"
1740
- },
1741
- "&-explain, &-extra": {
1742
- clear: "both",
1743
- color: e.colorTextDescription,
1744
- fontSize: e.fontSize,
1745
- lineHeight: e.lineHeight
1746
- },
1747
- "&-explain-connected": {
1748
- width: "100%"
1749
- },
1750
- "&-extra": {
1751
- minHeight: e.controlHeightSM,
1752
- transition: `color ${e.motionDurationMid} ${e.motionEaseOut}`
1753
- // sync input color transition
1754
- },
1755
- "&-explain": {
1756
- "&-error": {
1757
- color: e.colorError
1758
- },
1759
- "&-warning": {
1760
- color: e.colorWarning
1761
- }
1762
- }
1763
- },
1764
- [`&-with-help ${t}-explain`]: {
1765
- height: "auto",
1766
- opacity: 1
1767
- },
1768
- // ==============================================================
1769
- // = Feedback Icon =
1770
- // ==============================================================
1771
- [`${t}-feedback-icon`]: {
1772
- fontSize: e.fontSize,
1773
- textAlign: "center",
1774
- visibility: "visible",
1775
- animationName: zt,
1776
- animationDuration: e.motionDurationMid,
1777
- animationTimingFunction: e.motionEaseOutBack,
1778
- pointerEvents: "none",
1779
- "&-success": {
1780
- color: e.colorSuccess
1781
- },
1782
- "&-error": {
1783
- color: e.colorError
1784
- },
1785
- "&-warning": {
1786
- color: e.colorWarning
1787
- },
1788
- "&-validating": {
1789
- color: e.colorPrimary
1790
- }
1791
- }
1792
- })
1793
- };
1794
- }, yt = (e, t) => {
1795
- const {
1796
- formItemCls: o
1797
- } = e;
1798
- return {
1799
- [`${t}-horizontal`]: {
1800
- [`${o}-label`]: {
1801
- flexGrow: 0
1802
- },
1803
- [`${o}-control`]: {
1804
- flex: "1 1 0",
1805
- // https://github.com/ant-design/ant-design/issues/32777
1806
- // https://github.com/ant-design/ant-design/issues/33773
1807
- minWidth: 0
1808
- },
1809
- // Do not change this to `ant-col-24`! `-24` match all the responsive rules
1810
- // https://github.com/ant-design/ant-design/issues/32980
1811
- // https://github.com/ant-design/ant-design/issues/34903
1812
- // https://github.com/ant-design/ant-design/issues/44538
1813
- [`${o}-label[class$='-24'], ${o}-label[class*='-24 ']`]: {
1814
- [`& + ${o}-control`]: {
1815
- minWidth: "unset"
1816
- }
1817
- }
1818
- }
1819
- };
1820
- }, Cr = (e) => {
1821
- const {
1822
- componentCls: t,
1823
- formItemCls: o,
1824
- inlineItemMarginBottom: n
1825
- } = e;
1826
- return {
1827
- [`${t}-inline`]: {
1828
- display: "flex",
1829
- flexWrap: "wrap",
1830
- [o]: {
1831
- flex: "none",
1832
- marginInlineEnd: e.margin,
1833
- marginBottom: n,
1834
- "&-row": {
1835
- flexWrap: "nowrap"
1836
- },
1837
- [`> ${o}-label,
1838
- > ${o}-control`]: {
1839
- display: "inline-block",
1840
- verticalAlign: "top"
1841
- },
1842
- [`> ${o}-label`]: {
1843
- flex: "none"
1844
- },
1845
- [`${t}-text`]: {
1846
- display: "inline-block"
1847
- },
1848
- [`${o}-has-feedback`]: {
1849
- display: "inline-block"
1850
- }
1851
- }
1852
- }
1853
- };
1854
- }, le = (e) => ({
1855
- padding: e.verticalLabelPadding,
1856
- margin: e.verticalLabelMargin,
1857
- whiteSpace: "initial",
1858
- textAlign: "start",
1859
- "> label": {
1860
- margin: 0,
1861
- "&::after": {
1862
- // https://github.com/ant-design/ant-design/issues/43538
1863
- visibility: "hidden"
1864
- }
1865
- }
1866
- }), on = (e) => {
1867
- const {
1868
- componentCls: t,
1869
- formItemCls: o,
1870
- rootPrefixCls: n
1871
- } = e;
1872
- return {
1873
- [`${o} ${o}-label`]: le(e),
1874
- // ref: https://github.com/ant-design/ant-design/issues/45122
1875
- [`${t}:not(${t}-inline)`]: {
1876
- [o]: {
1877
- flexWrap: "wrap",
1878
- [`${o}-label, ${o}-control`]: {
1879
- // When developer pass `xs: { span }`,
1880
- // It should follow the `xs` screen config
1881
- // ref: https://github.com/ant-design/ant-design/issues/44386
1882
- [`&:not([class*=" ${n}-col-xs"])`]: {
1883
- flex: "0 0 100%",
1884
- maxWidth: "100%"
1885
- }
1886
- }
1887
- }
1888
- }
1889
- };
1890
- }, $r = (e) => {
1891
- const {
1892
- componentCls: t,
1893
- formItemCls: o,
1894
- antCls: n
1895
- } = e;
1896
- return {
1897
- [`${t}-vertical`]: {
1898
- [`${o}:not(${o}-horizontal)`]: {
1899
- [`${o}-row`]: {
1900
- flexDirection: "column"
1901
- },
1902
- [`${o}-label > label`]: {
1903
- height: "auto"
1904
- },
1905
- [`${o}-control`]: {
1906
- width: "100%"
1907
- },
1908
- [`${o}-label,
1909
- ${n}-col-24${o}-label,
1910
- ${n}-col-xl-24${o}-label`]: le(e)
1911
- }
1912
- },
1913
- [`@media (max-width: ${te(e.screenXSMax)})`]: [on(e), {
1914
- [t]: {
1915
- [`${o}:not(${o}-horizontal)`]: {
1916
- [`${n}-col-xs-24${o}-label`]: le(e)
1917
- }
1918
- }
1919
- }],
1920
- [`@media (max-width: ${te(e.screenSMMax)})`]: {
1921
- [t]: {
1922
- [`${o}:not(${o}-horizontal)`]: {
1923
- [`${n}-col-sm-24${o}-label`]: le(e)
1924
- }
1925
- }
1926
- },
1927
- [`@media (max-width: ${te(e.screenMDMax)})`]: {
1928
- [t]: {
1929
- [`${o}:not(${o}-horizontal)`]: {
1930
- [`${n}-col-md-24${o}-label`]: le(e)
1931
- }
1932
- }
1933
- },
1934
- [`@media (max-width: ${te(e.screenLGMax)})`]: {
1935
- [t]: {
1936
- [`${o}:not(${o}-horizontal)`]: {
1937
- [`${n}-col-lg-24${o}-label`]: le(e)
1938
- }
1939
- }
1940
- }
1941
- };
1942
- }, xr = (e) => {
1943
- const {
1944
- formItemCls: t,
1945
- antCls: o
1946
- } = e;
1947
- return {
1948
- [`${t}-vertical`]: {
1949
- [`${t}-row`]: {
1950
- flexDirection: "column"
1951
- },
1952
- [`${t}-label > label`]: {
1953
- height: "auto"
1954
- },
1955
- [`${t}-control`]: {
1956
- width: "100%"
1957
- }
1958
- },
1959
- [`${t}-vertical ${t}-label,
1960
- ${o}-col-24${t}-label,
1961
- ${o}-col-xl-24${t}-label`]: le(e),
1962
- [`@media (max-width: ${te(e.screenXSMax)})`]: [on(e), {
1963
- [t]: {
1964
- [`${o}-col-xs-24${t}-label`]: le(e)
1965
- }
1966
- }],
1967
- [`@media (max-width: ${te(e.screenSMMax)})`]: {
1968
- [t]: {
1969
- [`${o}-col-sm-24${t}-label`]: le(e)
1970
- }
1971
- },
1972
- [`@media (max-width: ${te(e.screenMDMax)})`]: {
1973
- [t]: {
1974
- [`${o}-col-md-24${t}-label`]: le(e)
1975
- }
1976
- },
1977
- [`@media (max-width: ${te(e.screenLGMax)})`]: {
1978
- [t]: {
1979
- [`${o}-col-lg-24${t}-label`]: le(e)
1980
- }
1981
- }
1982
- };
1983
- }, Sr = (e) => ({
1984
- labelRequiredMarkColor: e.colorError,
1985
- labelColor: e.colorTextHeading,
1986
- labelFontSize: e.fontSize,
1987
- labelHeight: e.controlHeight,
1988
- labelColonMarginInlineStart: e.marginXXS / 2,
1989
- labelColonMarginInlineEnd: e.marginXS,
1990
- itemMarginBottom: e.marginLG,
1991
- verticalLabelPadding: `0 0 ${e.paddingXS}px`,
1992
- verticalLabelMargin: 0,
1993
- inlineItemMarginBottom: 0
1994
- }), rn = (e, t) => Ye(e, {
1995
- formItemCls: `${e.componentCls}-item`,
1996
- rootPrefixCls: t
1997
- }), et = ze("Form", (e, t) => {
1998
- let {
1999
- rootPrefixCls: o
2000
- } = t;
2001
- const n = rn(e, o);
2002
- return [br(n), yr(n), hr(n), yt(n, n.componentCls), yt(n, n.formItemCls), Cr(n), $r(n), xr(n), so(n), zt];
2003
- }, Sr, {
2004
- // Let From style before the Grid
2005
- // ref https://github.com/ant-design/ant-design/issues/44386
2006
- order: -1e3
2007
- }), Ct = [];
2008
- function Be(e, t, o) {
2009
- let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
2010
- return {
2011
- key: typeof e == "string" ? e : `${t}-${n}`,
2012
- error: e,
2013
- errorStatus: o
2014
- };
2015
- }
2016
- const Er = (e) => {
2017
- let {
2018
- help: t,
2019
- helpStatus: o,
2020
- errors: n = Ct,
2021
- warnings: r = Ct,
2022
- className: i,
2023
- fieldId: s,
2024
- onVisibleChanged: l
2025
- } = e;
2026
- const {
2027
- prefixCls: c
2028
- } = a.useContext(Je), u = `${c}-item-explain`, C = je(c), [O, h, E] = et(c, C), w = a.useMemo(() => st(c), [c]), $ = He(n), S = He(r), v = a.useMemo(() => t != null ? [Be(t, "help", o)] : [].concat(ee($.map((y, b) => Be(y, "error", "error", b))), ee(S.map((y, b) => Be(y, "warning", "warning", b)))), [t, o, $, S]), M = a.useMemo(() => {
2029
- const y = {};
2030
- return v.forEach((b) => {
2031
- let {
2032
- key: d
2033
- } = b;
2034
- y[d] = (y[d] || 0) + 1;
2035
- }), v.map((b, d) => Object.assign(Object.assign({}, b), {
2036
- key: y[b.key] > 1 ? `${b.key}-fallback-${d}` : b.key
2037
- }));
2038
- }, [v]), m = {};
2039
- return s && (m.id = `${s}_help`), O(/* @__PURE__ */ a.createElement(Mn, {
2040
- motionDeadline: w.motionDeadline,
2041
- motionName: `${c}-show-help`,
2042
- visible: !!M.length,
2043
- onVisibleChanged: l
2044
- }, (y) => {
2045
- const {
2046
- className: b,
2047
- style: d
2048
- } = y;
2049
- return /* @__PURE__ */ a.createElement("div", Object.assign({}, m, {
2050
- className: K(u, b, E, C, i, h),
2051
- style: d,
2052
- role: "alert"
2053
- }), /* @__PURE__ */ a.createElement(Mt, Object.assign({
2054
- keys: M
2055
- }, st(c), {
2056
- motionName: `${c}-show-help-item`,
2057
- component: !1
2058
- }), (F) => {
2059
- const {
2060
- key: p,
2061
- error: f,
2062
- errorStatus: g,
2063
- className: N,
2064
- style: V
2065
- } = F;
2066
- return /* @__PURE__ */ a.createElement("div", {
2067
- key: p,
2068
- className: K(N, {
2069
- [`${u}-${g}`]: g
2070
- }),
2071
- style: V
2072
- }, f);
2073
- }));
2074
- }));
2075
- }, an = Er, wr = ["parentNode"], Or = "form_item";
2076
- function Ne(e) {
2077
- return e === void 0 || e === !1 ? [] : Array.isArray(e) ? e : [e];
2078
- }
2079
- function sn(e, t) {
2080
- if (!e.length)
2081
- return;
2082
- const o = e.join("_");
2083
- return t ? `${t}_${o}` : wr.includes(o) ? `${Or}_${o}` : o;
2084
- }
2085
- function ln(e, t, o, n, r, i) {
2086
- let s = n;
2087
- return i !== void 0 ? s = i : o.validating ? s = "validating" : e.length ? s = "error" : t.length ? s = "warning" : (o.touched || r && o.validated) && (s = "success"), s;
2088
- }
2089
- function $t(e) {
2090
- return Ne(e).join("_");
2091
- }
2092
- function xt(e, t) {
2093
- const o = t.getFieldInstance(e), n = Fn(o);
2094
- if (n)
2095
- return n;
2096
- const r = sn(Ne(e), t.__INTERNAL__.name);
2097
- if (r)
2098
- return document.getElementById(r);
2099
- }
2100
- function cn(e) {
2101
- const [t] = Yn(), o = a.useRef({}), n = a.useMemo(() => e ?? Object.assign(Object.assign({}, t), {
2102
- __INTERNAL__: {
2103
- itemRef: (r) => (i) => {
2104
- const s = $t(r);
2105
- i ? o.current[s] = i : delete o.current[s];
2106
- }
2107
- },
2108
- scrollToField: function(r) {
2109
- let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2110
- const s = xt(r, n);
2111
- s && yo(s, Object.assign({
2112
- scrollMode: "if-needed",
2113
- block: "nearest"
2114
- }, i));
2115
- },
2116
- focusField: (r) => {
2117
- var i;
2118
- const s = xt(r, n);
2119
- s && ((i = s.focus) === null || i === void 0 || i.call(s));
2120
- },
2121
- getFieldInstance: (r) => {
2122
- const i = $t(r);
2123
- return o.current[i];
2124
- }
2125
- }), [e, t]);
2126
- return [n];
2127
- }
2128
- const Ve = {};
2129
- function Nr(e) {
2130
- let {
2131
- name: t
2132
- } = e;
2133
- const o = Pe("Form");
2134
- a.useEffect(() => {
2135
- if (t)
2136
- return Ve[t] = (Ve[t] || 0) + 1, process.env.NODE_ENV !== "production" && o(Ve[t] <= 1, "usage", "There exist multiple Form with same `name`."), () => {
2137
- Ve[t] -= 1;
2138
- };
2139
- }, [t]);
2140
- }
2141
- var Ir = globalThis && globalThis.__rest || function(e, t) {
2142
- var o = {};
2143
- for (var n in e)
2144
- Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
2145
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
2146
- for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
2147
- t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (o[n[r]] = e[n[r]]);
2148
- return o;
2149
- };
2150
- const Mr = (e, t) => {
2151
- const o = a.useContext(Pn), {
2152
- getPrefixCls: n,
2153
- direction: r,
2154
- form: i
2155
- } = a.useContext(he), {
2156
- prefixCls: s,
2157
- className: l,
2158
- rootClassName: c,
2159
- size: u,
2160
- disabled: C = o,
2161
- form: O,
2162
- colon: h,
2163
- labelAlign: E,
2164
- labelWrap: w,
2165
- labelCol: $,
2166
- wrapperCol: S,
2167
- hideRequiredMark: v,
2168
- layout: M = "horizontal",
2169
- scrollToFirstError: m,
2170
- requiredMark: y,
2171
- onFinishFailed: b,
2172
- name: d,
2173
- style: F,
2174
- feedbackIcons: p,
2175
- variant: f
2176
- } = e, g = Ir(e, ["prefixCls", "className", "rootClassName", "size", "disabled", "form", "colon", "labelAlign", "labelWrap", "labelCol", "wrapperCol", "hideRequiredMark", "layout", "scrollToFirstError", "requiredMark", "onFinishFailed", "name", "style", "feedbackIcons", "variant"]), N = co(u), V = a.useContext(jn);
2177
- process.env.NODE_ENV !== "production" && Nr(e);
2178
- const P = a.useMemo(() => y !== void 0 ? y : v ? !1 : i && i.requiredMark !== void 0 ? i.requiredMark : !0, [v, y, i]), I = h ?? (i == null ? void 0 : i.colon), D = n("form", s), R = je(D), [x, H, j] = et(D, R), U = K(D, `${D}-${M}`, {
2179
- [`${D}-hide-required-mark`]: P === !1,
2180
- [`${D}-rtl`]: r === "rtl",
2181
- [`${D}-${N}`]: N
2182
- }, j, R, H, i == null ? void 0 : i.className, l, c), [z] = cn(O), {
2183
- __INTERNAL__: Y
2184
- } = z;
2185
- Y.name = d;
2186
- const G = a.useMemo(() => ({
2187
- name: d,
2188
- labelAlign: E,
2189
- labelCol: $,
2190
- labelWrap: w,
2191
- wrapperCol: S,
2192
- vertical: M === "vertical",
2193
- colon: I,
2194
- requiredMark: P,
2195
- itemRef: Y.itemRef,
2196
- form: z,
2197
- feedbackIcons: p
2198
- }), [d, E, $, S, M, I, P, z, p]), X = a.useRef(null);
2199
- a.useImperativeHandle(t, () => {
2200
- var A;
2201
- return Object.assign(Object.assign({}, z), {
2202
- nativeElement: (A = X.current) === null || A === void 0 ? void 0 : A.nativeElement
2203
- });
2204
- });
2205
- const _ = (A, T) => {
2206
- if (A) {
2207
- let L = {
2208
- block: "nearest"
2209
- };
2210
- typeof A == "object" && (L = Object.assign(Object.assign({}, L), A)), z.scrollToField(T, L), L.focus && z.focusField(T);
2211
- }
2212
- }, B = (A) => {
2213
- if (b == null || b(A), A.errorFields.length) {
2214
- const T = A.errorFields[0].name;
2215
- if (m !== void 0) {
2216
- _(m, T);
2217
- return;
2218
- }
2219
- i && i.scrollToFirstError !== void 0 && _(i.scrollToFirstError, T);
2220
- }
2221
- };
2222
- return x(/* @__PURE__ */ a.createElement(Qn.Provider, {
2223
- value: f
2224
- }, /* @__PURE__ */ a.createElement(Rn, {
2225
- disabled: C
2226
- }, /* @__PURE__ */ a.createElement(_n.Provider, {
2227
- value: N
2228
- }, /* @__PURE__ */ a.createElement(Ht, {
2229
- // This is not list in API, we pass with spread
2230
- validateMessages: V
2231
- }, /* @__PURE__ */ a.createElement(me.Provider, {
2232
- value: G
2233
- }, /* @__PURE__ */ a.createElement(Jn, Object.assign({
2234
- id: d
2235
- }, g, {
2236
- name: d,
2237
- onFinishFailed: B,
2238
- form: z,
2239
- ref: X,
2240
- style: Object.assign(Object.assign({}, i == null ? void 0 : i.style), F),
2241
- className: U
2242
- }))))))));
2243
- }, un = /* @__PURE__ */ a.forwardRef(Mr);
2244
- process.env.NODE_ENV !== "production" && (un.displayName = "Form");
2245
- const Fr = un;
2246
- function Pr(e) {
2247
- if (typeof e == "function")
2248
- return e;
2249
- const t = fo(e);
2250
- return t.length <= 1 ? t[0] : t;
2251
- }
2252
- const dn = () => {
2253
- const {
2254
- status: e,
2255
- errors: t = [],
2256
- warnings: o = []
2257
- } = a.useContext(De);
2258
- if (process.env.NODE_ENV !== "production") {
2259
- const n = Pe("Form.Item");
2260
- process.env.NODE_ENV !== "production" && n(e !== void 0, "usage", "Form.Item.useStatus should be used under Form.Item component. For more information: https://u.ant.design/form-item-usestatus");
2261
- }
2262
- return {
2263
- status: e,
2264
- errors: t,
2265
- warnings: o
2266
- };
2267
- };
2268
- dn.Context = De;
2269
- const jr = dn;
2270
- function Rr(e) {
2271
- const [t, o] = a.useState(e), n = a.useRef(null), r = a.useRef([]), i = a.useRef(!1);
2272
- a.useEffect(() => (i.current = !1, () => {
2273
- i.current = !0, it.cancel(n.current), n.current = null;
2274
- }), []);
2275
- function s(l) {
2276
- i.current || (n.current === null && (r.current = [], n.current = it(() => {
2277
- n.current = null, o((c) => {
2278
- let u = c;
2279
- return r.current.forEach((C) => {
2280
- u = C(u);
2281
- }), u;
2282
- });
2283
- })), r.current.push(l));
2284
- }
2285
- return [t, s];
2286
- }
2287
- function _r() {
2288
- const {
2289
- itemRef: e
2290
- } = a.useContext(me), t = a.useRef({});
2291
- function o(n, r) {
2292
- const i = r && typeof r == "object" && Tn(r), s = n.join("_");
2293
- return (t.current.name !== s || t.current.originRef !== i) && (t.current.name = s, t.current.originRef = i, t.current.ref = Ln(e(n), i)), t.current.ref;
2294
- }
2295
- return o;
2296
- }
2297
- const Tr = (e) => {
2298
- const {
2299
- formItemCls: t
2300
- } = e;
2301
- return {
2302
- "@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)": {
2303
- // Fallback for IE, safe to remove we not support it anymore
2304
- [`${t}-control`]: {
2305
- display: "flex"
2306
- }
2307
- }
2308
- };
2309
- }, Lr = Ft(["Form", "item-item"], (e, t) => {
2310
- let {
2311
- rootPrefixCls: o
2312
- } = t;
2313
- const n = rn(e, o);
2314
- return [Tr(n)];
2315
- });
2316
- var Vr = globalThis && globalThis.__rest || function(e, t) {
2317
- var o = {};
2318
- for (var n in e)
2319
- Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
2320
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
2321
- for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
2322
- t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (o[n[r]] = e[n[r]]);
2323
- return o;
2324
- };
2325
- const kr = 24, Dr = (e) => {
2326
- const {
2327
- prefixCls: t,
2328
- status: o,
2329
- labelCol: n,
2330
- wrapperCol: r,
2331
- children: i,
2332
- errors: s,
2333
- warnings: l,
2334
- _internalItemRender: c,
2335
- extra: u,
2336
- help: C,
2337
- fieldId: O,
2338
- marginBottom: h,
2339
- onErrorVisibleChanged: E,
2340
- label: w
2341
- } = e, $ = `${t}-item`, S = a.useContext(me), v = a.useMemo(() => {
2342
- let I = Object.assign({}, r || S.wrapperCol || {});
2343
- return w === null && !n && !r && S.labelCol && [void 0, "xs", "sm", "md", "lg", "xl", "xxl"].forEach((R) => {
2344
- const x = R ? [R] : [], H = at(S.labelCol, x), j = typeof H == "object" ? H : {}, U = at(I, x), z = typeof U == "object" ? U : {};
2345
- "span" in j && !("offset" in z) && j.span < kr && (I = Vn(I, [].concat(x, ["offset"]), j.span));
2346
- }), I;
2347
- }, [r, S]), M = K(`${$}-control`, v.className), m = a.useMemo(() => Vr(S, ["labelCol", "wrapperCol"]), [S]), y = a.useRef(null), [b, d] = a.useState(0);
2348
- jt(() => {
2349
- u && y.current ? d(y.current.clientHeight) : d(0);
2350
- }, [u]);
2351
- const F = /* @__PURE__ */ a.createElement("div", {
2352
- className: `${$}-control-input`
2353
- }, /* @__PURE__ */ a.createElement("div", {
2354
- className: `${$}-control-input-content`
2355
- }, i)), p = a.useMemo(() => ({
2356
- prefixCls: t,
2357
- status: o
2358
- }), [t, o]), f = h !== null || s.length || l.length ? /* @__PURE__ */ a.createElement(Je.Provider, {
2359
- value: p
2360
- }, /* @__PURE__ */ a.createElement(an, {
2361
- fieldId: O,
2362
- errors: s,
2363
- warnings: l,
2364
- help: C,
2365
- helpStatus: o,
2366
- className: `${$}-explain-connected`,
2367
- onVisibleChanged: E
2368
- })) : null, g = {};
2369
- O && (g.id = `${O}_extra`);
2370
- const N = u ? /* @__PURE__ */ a.createElement("div", Object.assign({}, g, {
2371
- className: `${$}-extra`,
2372
- ref: y
2373
- }), u) : null, V = f || N ? /* @__PURE__ */ a.createElement("div", {
2374
- className: `${$}-additional`,
2375
- style: h ? {
2376
- minHeight: h + b
2377
- } : {}
2378
- }, f, N) : null, P = c && c.mark === "pro_table_render" && c.render ? c.render(e, {
2379
- input: F,
2380
- errorList: f,
2381
- extra: N
2382
- }) : /* @__PURE__ */ a.createElement(a.Fragment, null, F, V);
2383
- return /* @__PURE__ */ a.createElement(me.Provider, {
2384
- value: m
2385
- }, /* @__PURE__ */ a.createElement(tn, Object.assign({}, v, {
2386
- className: M
2387
- }), P), /* @__PURE__ */ a.createElement(Lr, {
2388
- prefixCls: t
2389
- }));
2390
- }, Hr = Dr;
2391
- var Ar = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { tag: "path", attrs: { d: "M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z" } }] }, name: "question-circle", theme: "outlined" };
2392
- const zr = Ar;
2393
- var Br = function(t, o) {
2394
- return /* @__PURE__ */ a.createElement(ye, fe({}, t, {
2395
- ref: o,
2396
- icon: zr
2397
- }));
2398
- }, fn = /* @__PURE__ */ a.forwardRef(Br);
2399
- process.env.NODE_ENV !== "production" && (fn.displayName = "QuestionCircleOutlined");
2400
- const Wr = fn;
2401
- var qr = globalThis && globalThis.__rest || function(e, t) {
2402
- var o = {};
2403
- for (var n in e)
2404
- Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
2405
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
2406
- for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
2407
- t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (o[n[r]] = e[n[r]]);
2408
- return o;
2409
- };
2410
- function Gr(e) {
2411
- return e ? typeof e == "object" && !/* @__PURE__ */ a.isValidElement(e) ? e : {
2412
- title: e
2413
- } : null;
2414
- }
2415
- const Xr = (e) => {
2416
- let {
2417
- prefixCls: t,
2418
- label: o,
2419
- htmlFor: n,
2420
- labelCol: r,
2421
- labelAlign: i,
2422
- colon: s,
2423
- required: l,
2424
- requiredMark: c,
2425
- tooltip: u,
2426
- vertical: C
2427
- } = e;
2428
- var O;
2429
- const [h] = go("Form"), {
2430
- labelAlign: E,
2431
- labelCol: w,
2432
- labelWrap: $,
2433
- colon: S
2434
- } = a.useContext(me);
2435
- if (!o)
2436
- return null;
2437
- const v = r || w || {}, M = i || E, m = `${t}-item-label`, y = K(m, M === "left" && `${m}-left`, v.className, {
2438
- [`${m}-wrap`]: !!$
2439
- });
2440
- let b = o;
2441
- const d = s === !0 || S !== !1 && s !== !1;
2442
- d && !C && typeof o == "string" && o.trim() && (b = o.replace(/[:|:]\s*$/, ""));
2443
- const p = Gr(u);
2444
- if (p) {
2445
- const {
2446
- icon: V = /* @__PURE__ */ a.createElement(Wr, null)
2447
- } = p, P = qr(p, ["icon"]), I = /* @__PURE__ */ a.createElement(lo, Object.assign({}, P), /* @__PURE__ */ a.cloneElement(V, {
2448
- className: `${t}-item-tooltip`,
2449
- title: "",
2450
- onClick: (D) => {
2451
- D.preventDefault();
2452
- },
2453
- tabIndex: null
2454
- }));
2455
- b = /* @__PURE__ */ a.createElement(a.Fragment, null, b, I);
2456
- }
2457
- const f = c === "optional", g = typeof c == "function";
2458
- g ? b = c(b, {
2459
- required: !!l
2460
- }) : f && !l && (b = /* @__PURE__ */ a.createElement(a.Fragment, null, b, /* @__PURE__ */ a.createElement("span", {
2461
- className: `${t}-item-optional`,
2462
- title: ""
2463
- }, (h == null ? void 0 : h.optional) || ((O = kn.Form) === null || O === void 0 ? void 0 : O.optional))));
2464
- const N = K({
2465
- [`${t}-item-required`]: l,
2466
- [`${t}-item-required-mark-optional`]: f || g,
2467
- [`${t}-item-no-colon`]: !d
2468
- });
2469
- return /* @__PURE__ */ a.createElement(tn, Object.assign({}, v, {
2470
- className: y
2471
- }), /* @__PURE__ */ a.createElement("label", {
2472
- htmlFor: n,
2473
- className: N,
2474
- title: typeof o == "string" ? o : ""
2475
- }, b));
2476
- }, Kr = Xr, Ur = {
2477
- success: _t,
2478
- warning: Tt,
2479
- error: Lt,
2480
- validating: ho
2481
- };
2482
- function mn(e) {
2483
- let {
2484
- children: t,
2485
- errors: o,
2486
- warnings: n,
2487
- hasFeedback: r,
2488
- validateStatus: i,
2489
- prefixCls: s,
2490
- meta: l,
2491
- noStyle: c
2492
- } = e;
2493
- const u = `${s}-item`, {
2494
- feedbackIcons: C
2495
- } = a.useContext(me), O = ln(o, n, l, null, !!r, i), {
2496
- isFormItemInput: h,
2497
- status: E,
2498
- hasFeedback: w,
2499
- feedbackIcon: $
2500
- } = a.useContext(De), S = a.useMemo(() => {
2501
- var v;
2502
- let M;
2503
- if (r) {
2504
- const y = r !== !0 && r.icons || C, b = O && ((v = y == null ? void 0 : y({
2505
- status: O,
2506
- errors: o,
2507
- warnings: n
2508
- })) === null || v === void 0 ? void 0 : v[O]), d = O && Ur[O];
2509
- M = b !== !1 && d ? /* @__PURE__ */ a.createElement("span", {
2510
- className: K(`${u}-feedback-icon`, `${u}-feedback-icon-${O}`)
2511
- }, b || /* @__PURE__ */ a.createElement(d, null)) : null;
2512
- }
2513
- const m = {
2514
- status: O || "",
2515
- errors: o,
2516
- warnings: n,
2517
- hasFeedback: !!r,
2518
- feedbackIcon: M,
2519
- isFormItemInput: !0
2520
- };
2521
- return c && (m.status = (O ?? E) || "", m.isFormItemInput = h, m.hasFeedback = !!(r ?? w), m.feedbackIcon = r !== void 0 ? m.feedbackIcon : $), m;
2522
- }, [O, r, c, h, E]);
2523
- return /* @__PURE__ */ a.createElement(De.Provider, {
2524
- value: S
2525
- }, t);
2526
- }
2527
- var Yr = globalThis && globalThis.__rest || function(e, t) {
2528
- var o = {};
2529
- for (var n in e)
2530
- Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
2531
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
2532
- for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
2533
- t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (o[n[r]] = e[n[r]]);
2534
- return o;
2535
- };
2536
- function Qr(e) {
2537
- const {
2538
- prefixCls: t,
2539
- className: o,
2540
- rootClassName: n,
2541
- style: r,
2542
- help: i,
2543
- errors: s,
2544
- warnings: l,
2545
- validateStatus: c,
2546
- meta: u,
2547
- hasFeedback: C,
2548
- hidden: O,
2549
- children: h,
2550
- fieldId: E,
2551
- required: w,
2552
- isRequired: $,
2553
- onSubItemMetaChange: S,
2554
- layout: v
2555
- } = e, M = Yr(e, ["prefixCls", "className", "rootClassName", "style", "help", "errors", "warnings", "validateStatus", "meta", "hasFeedback", "hidden", "children", "fieldId", "required", "isRequired", "onSubItemMetaChange", "layout"]), m = `${t}-item`, {
2556
- requiredMark: y,
2557
- vertical: b
2558
- } = a.useContext(me), d = b || v === "vertical", F = a.useRef(null), p = He(s), f = He(l), g = i != null, N = !!(g || s.length || l.length), V = !!F.current && mo(F.current), [P, I] = a.useState(null);
2559
- jt(() => {
2560
- if (N && F.current) {
2561
- const j = getComputedStyle(F.current);
2562
- I(parseInt(j.marginBottom, 10));
2563
- }
2564
- }, [N, V]);
2565
- const D = (j) => {
2566
- j || I(null);
2567
- }, x = function() {
2568
- let j = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
2569
- const U = j ? p : u.errors, z = j ? f : u.warnings;
2570
- return ln(U, z, u, "", !!C, c);
2571
- }(), H = K(m, o, n, {
2572
- [`${m}-with-help`]: g || p.length || f.length,
2573
- // Status
2574
- [`${m}-has-feedback`]: x && C,
2575
- [`${m}-has-success`]: x === "success",
2576
- [`${m}-has-warning`]: x === "warning",
2577
- [`${m}-has-error`]: x === "error",
2578
- [`${m}-is-validating`]: x === "validating",
2579
- [`${m}-hidden`]: O,
2580
- // Layout
2581
- [`${m}-${v}`]: v
2582
- });
2583
- return /* @__PURE__ */ a.createElement("div", {
2584
- className: H,
2585
- style: r,
2586
- ref: F
2587
- }, /* @__PURE__ */ a.createElement(pr, Object.assign({
2588
- className: `${m}-row`
2589
- }, po(M, [
2590
- "_internalItemRender",
2591
- "colon",
2592
- "dependencies",
2593
- "extra",
2594
- "fieldKey",
2595
- "getValueFromEvent",
2596
- "getValueProps",
2597
- "htmlFor",
2598
- "id",
2599
- // It is deprecated because `htmlFor` is its replacement.
2600
- "initialValue",
2601
- "isListField",
2602
- "label",
2603
- "labelAlign",
2604
- "labelCol",
2605
- "labelWrap",
2606
- "messageVariables",
2607
- "name",
2608
- "normalize",
2609
- "noStyle",
2610
- "preserve",
2611
- "requiredMark",
2612
- "rules",
2613
- "shouldUpdate",
2614
- "trigger",
2615
- "tooltip",
2616
- "validateFirst",
2617
- "validateTrigger",
2618
- "valuePropName",
2619
- "wrapperCol",
2620
- "validateDebounce"
2621
- ])), /* @__PURE__ */ a.createElement(Kr, Object.assign({
2622
- htmlFor: E
2623
- }, e, {
2624
- requiredMark: y,
2625
- required: w ?? $,
2626
- prefixCls: t,
2627
- vertical: d
2628
- })), /* @__PURE__ */ a.createElement(Hr, Object.assign({}, e, u, {
2629
- errors: p,
2630
- warnings: f,
2631
- prefixCls: t,
2632
- status: x,
2633
- help: i,
2634
- marginBottom: P,
2635
- onErrorVisibleChanged: D
2636
- }), /* @__PURE__ */ a.createElement(At.Provider, {
2637
- value: S
2638
- }, /* @__PURE__ */ a.createElement(mn, {
2639
- prefixCls: t,
2640
- meta: u,
2641
- errors: u.errors,
2642
- warnings: u.warnings,
2643
- hasFeedback: C,
2644
- // Already calculated
2645
- validateStatus: x
2646
- }, h)))), !!P && /* @__PURE__ */ a.createElement("div", {
2647
- className: `${m}-margin-offset`,
2648
- style: {
2649
- marginBottom: -P
2650
- }
2651
- }));
2652
- }
2653
- const Jr = "__SPLIT__";
2654
- function Zr(e, t) {
2655
- const o = Object.keys(e), n = Object.keys(t);
2656
- return o.length === n.length && o.every((r) => {
2657
- const i = e[r], s = t[r];
2658
- return i === s || typeof i == "function" || typeof s == "function";
2659
- });
2660
- }
2661
- const ei = /* @__PURE__ */ a.memo((e) => {
2662
- let {
2663
- children: t
2664
- } = e;
2665
- return t;
2666
- }, (e, t) => Zr(e.control, t.control) && e.update === t.update && e.childProps.length === t.childProps.length && e.childProps.every((o, n) => o === t.childProps[n]));
2667
- function St() {
2668
- return {
2669
- errors: [],
2670
- warnings: [],
2671
- touched: !1,
2672
- validating: !1,
2673
- name: [],
2674
- validated: !1
2675
- };
2676
- }
2677
- function ti(e) {
2678
- const {
2679
- name: t,
2680
- noStyle: o,
2681
- className: n,
2682
- dependencies: r,
2683
- prefixCls: i,
2684
- shouldUpdate: s,
2685
- rules: l,
2686
- children: c,
2687
- required: u,
2688
- label: C,
2689
- messageVariables: O,
2690
- trigger: h = "onChange",
2691
- validateTrigger: E,
2692
- hidden: w,
2693
- help: $,
2694
- layout: S
2695
- } = e, {
2696
- getPrefixCls: v
2697
- } = a.useContext(he), {
2698
- name: M
2699
- } = a.useContext(me), m = Pr(c), y = typeof m == "function", b = a.useContext(At), {
2700
- validateTrigger: d
2701
- } = a.useContext(Zn), F = E !== void 0 ? E : d, p = t != null, f = v("form", i), g = je(f), [N, V, P] = et(f, g), I = Pe("Form.Item");
2702
- process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "production" && I(t !== null, "usage", "`null` is passed as `name` property");
2703
- const D = a.useContext(eo), R = a.useRef(null), [x, H] = Rr({}), [j, U] = Dn(() => St()), z = (T) => {
2704
- const L = D == null ? void 0 : D.getKey(T.name);
2705
- if (U(T.destroy ? St() : T, !0), o && $ !== !1 && b) {
2706
- let k = T.name;
2707
- if (T.destroy)
2708
- k = R.current || k;
2709
- else if (L !== void 0) {
2710
- const [J, Z] = L;
2711
- k = [J].concat(ee(Z)), R.current = k;
2712
- }
2713
- b(T, k);
2714
- }
2715
- }, Y = (T, L) => {
2716
- H((k) => {
2717
- const J = Object.assign({}, k), ne = [].concat(ee(T.name.slice(0, -1)), ee(L)).join(Jr);
2718
- return T.destroy ? delete J[ne] : J[ne] = T, J;
2719
- });
2720
- }, [G, X] = a.useMemo(() => {
2721
- const T = ee(j.errors), L = ee(j.warnings);
2722
- return Object.values(x).forEach((k) => {
2723
- T.push.apply(T, ee(k.errors || [])), L.push.apply(L, ee(k.warnings || []));
2724
- }), [T, L];
2725
- }, [x, j.errors, j.warnings]), _ = _r();
2726
- function B(T, L, k) {
2727
- return o && !w ? /* @__PURE__ */ a.createElement(mn, {
2728
- prefixCls: f,
2729
- hasFeedback: e.hasFeedback,
2730
- validateStatus: e.validateStatus,
2731
- meta: j,
2732
- errors: G,
2733
- warnings: X,
2734
- noStyle: !0
2735
- }, T) : /* @__PURE__ */ a.createElement(Qr, Object.assign({
2736
- key: "row"
2737
- }, e, {
2738
- className: K(n, P, g, V),
2739
- prefixCls: f,
2740
- fieldId: L,
2741
- isRequired: k,
2742
- errors: G,
2743
- warnings: X,
2744
- meta: j,
2745
- onSubItemMetaChange: Y,
2746
- layout: S
2747
- }), T);
2748
- }
2749
- if (!p && !y && !r)
2750
- return N(B(m));
2751
- let A = {};
2752
- return typeof C == "string" ? A.label = C : t && (A.label = String(t)), O && (A = Object.assign(Object.assign({}, A), O)), N(/* @__PURE__ */ a.createElement(to, Object.assign({}, e, {
2753
- messageVariables: A,
2754
- trigger: h,
2755
- validateTrigger: F,
2756
- onMetaChange: z
2757
- }), (T, L, k) => {
2758
- const J = Ne(t).length && L ? L.name : [], Z = sn(J, M), ne = u !== void 0 ? u : !!(l != null && l.some((W) => {
2759
- if (W && typeof W == "object" && W.required && !W.warningOnly)
2760
- return !0;
2761
- if (typeof W == "function") {
2762
- const ae = W(k);
2763
- return (ae == null ? void 0 : ae.required) && !(ae != null && ae.warningOnly);
2764
- }
2765
- return !1;
2766
- })), oe = Object.assign({}, T);
2767
- let ie = null;
2768
- if (process.env.NODE_ENV !== "production" && I(!(s && r), "usage", "`shouldUpdate` and `dependencies` shouldn't be used together. See https://u.ant.design/form-deps."), Array.isArray(m) && p)
2769
- process.env.NODE_ENV !== "production" && I(!1, "usage", "A `Form.Item` with a `name` prop must have a single child element. For information on how to render more complex form items, see https://u.ant.design/complex-form-item."), ie = m;
2770
- else if (y && (!(s || r) || p))
2771
- process.env.NODE_ENV !== "production" && I(!!(s || r), "usage", "A `Form.Item` with a render function must have either `shouldUpdate` or `dependencies`."), process.env.NODE_ENV !== "production" && I(!p, "usage", "A `Form.Item` with a render function cannot be a field, and thus cannot have a `name` prop.");
2772
- else if (r && !y && !p)
2773
- process.env.NODE_ENV !== "production" && I(!1, "usage", "Must set `name` or use a render function when `dependencies` is set.");
2774
- else if (/* @__PURE__ */ a.isValidElement(m)) {
2775
- process.env.NODE_ENV !== "production" && I(m.props.defaultValue === void 0, "usage", "`defaultValue` will not work on controlled Field. You should use `initialValues` of Form instead.");
2776
- const W = Object.assign(Object.assign({}, m.props), oe);
2777
- if (W.id || (W.id = Z), $ || G.length > 0 || X.length > 0 || e.extra) {
2778
- const ce = [];
2779
- ($ || G.length > 0) && ce.push(`${Z}_help`), e.extra && ce.push(`${Z}_extra`), W["aria-describedby"] = ce.join(" ");
2780
- }
2781
- G.length > 0 && (W["aria-invalid"] = "true"), ne && (W["aria-required"] = "true"), Hn(m) && (W.ref = _(J, m)), new Set([].concat(ee(Ne(h)), ee(Ne(F)))).forEach((ce) => {
2782
- W[ce] = function() {
2783
- for (var ve, be, $e, Re, ge, ue = arguments.length, xe = new Array(ue), _e = 0; _e < ue; _e++)
2784
- xe[_e] = arguments[_e];
2785
- ($e = oe[ce]) === null || $e === void 0 || (ve = $e).call.apply(ve, [oe].concat(xe)), (ge = (Re = m.props)[ce]) === null || ge === void 0 || (be = ge).call.apply(be, [Re].concat(xe));
2786
- };
2787
- });
2788
- const Ce = [W["aria-required"], W["aria-invalid"], W["aria-describedby"]];
2789
- ie = /* @__PURE__ */ a.createElement(ei, {
2790
- control: oe,
2791
- update: m,
2792
- childProps: Ce
2793
- }, uo(m, W));
2794
- } else
2795
- y && (s || r) && !p ? ie = m(k) : (process.env.NODE_ENV !== "production" && I(!J.length || !!o, "usage", "`name` is only used for validate React element. If you are using Form.Item as layout display, please remove `name` instead."), ie = m);
2796
- return B(ie, Z, ne);
2797
- }));
2798
- }
2799
- const pn = ti;
2800
- pn.useStatus = jr;
2801
- const ni = pn;
2802
- var oi = globalThis && globalThis.__rest || function(e, t) {
2803
- var o = {};
2804
- for (var n in e)
2805
- Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]);
2806
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
2807
- for (var r = 0, n = Object.getOwnPropertySymbols(e); r < n.length; r++)
2808
- t.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[r]) && (o[n[r]] = e[n[r]]);
2809
- return o;
2810
- };
2811
- const ri = (e) => {
2812
- var {
2813
- prefixCls: t,
2814
- children: o
2815
- } = e, n = oi(e, ["prefixCls", "children"]);
2816
- if (process.env.NODE_ENV !== "production") {
2817
- const l = Pe("Form.List");
2818
- process.env.NODE_ENV !== "production" && l(typeof n.name == "number" || (Array.isArray(n.name) ? !!n.name.length : !!n.name), "usage", "Miss `name` prop.");
2819
- }
2820
- const {
2821
- getPrefixCls: r
2822
- } = a.useContext(he), i = r("form", t), s = a.useMemo(() => ({
2823
- prefixCls: i,
2824
- status: "error"
2825
- }), [i]);
2826
- return /* @__PURE__ */ a.createElement(no, Object.assign({}, n), (l, c, u) => /* @__PURE__ */ a.createElement(Je.Provider, {
2827
- value: s
2828
- }, o(l.map((C) => Object.assign(Object.assign({}, C), {
2829
- fieldKey: C.key
2830
- })), c, {
2831
- errors: u.errors,
2832
- warnings: u.warnings
2833
- })));
2834
- }, ii = ri;
2835
- function ai() {
2836
- const {
2837
- form: e
2838
- } = a.useContext(me);
2839
- return e;
2840
- }
2841
- const pe = Fr;
2842
- pe.Item = ni;
2843
- pe.List = ii;
2844
- pe.ErrorList = an;
2845
- pe.useForm = cn;
2846
- pe.useFormInstance = ai;
2847
- pe.useWatch = oo;
2848
- pe.Provider = Ht;
2849
- pe.create = () => {
2850
- process.env.NODE_ENV !== "production" && An(!1, "Form", "antd v4 removed `Form.create`. Please remove or use `@ant-design/compatible` instead.");
2851
- };
2852
- const tt = pe;
2853
- let se = null, ke = (e) => e(), Ae = [], Fe = {};
2854
- function Et() {
2855
- const {
2856
- getContainer: e,
2857
- rtl: t,
2858
- maxCount: o,
2859
- top: n,
2860
- bottom: r,
2861
- showProgress: i,
2862
- pauseOnHover: s
2863
- } = Fe, l = (e == null ? void 0 : e()) || document.body;
2864
- return {
2865
- getContainer: () => l,
2866
- rtl: t,
2867
- maxCount: o,
2868
- top: n,
2869
- bottom: r,
2870
- showProgress: i,
2871
- pauseOnHover: s
2872
- };
2873
- }
2874
- const si = /* @__PURE__ */ q.forwardRef((e, t) => {
2875
- const {
2876
- notificationConfig: o,
2877
- sync: n
2878
- } = e, {
2879
- getPrefixCls: r
2880
- } = Ie(he), i = Fe.prefixCls || r("notification"), s = Ie(ar), [l, c] = Jt(Object.assign(Object.assign(Object.assign({}, o), {
2881
- prefixCls: i
2882
- }), s.notification));
2883
- return q.useEffect(n, []), q.useImperativeHandle(t, () => {
2884
- const u = Object.assign({}, l);
2885
- return Object.keys(u).forEach((C) => {
2886
- u[C] = function() {
2887
- return n(), l[C].apply(l, arguments);
2888
- };
2889
- }), {
2890
- instance: u,
2891
- sync: n
2892
- };
2893
- }), c;
2894
- }), li = /* @__PURE__ */ q.forwardRef((e, t) => {
2895
- const [o, n] = q.useState(Et), r = () => {
2896
- n(Et);
2897
- };
2898
- q.useEffect(r, []);
2899
- const i = Rt(), s = i.getRootPrefixCls(), l = i.getIconPrefixCls(), c = i.getTheme(), u = /* @__PURE__ */ q.createElement(si, {
2900
- ref: t,
2901
- sync: r,
2902
- notificationConfig: o
2903
- });
2904
- return /* @__PURE__ */ q.createElement(Bn, {
2905
- prefixCls: s,
2906
- iconPrefixCls: l,
2907
- theme: c
2908
- }, i.holderRender ? i.holderRender(u) : u);
2909
- });
2910
- function nt() {
2911
- if (!se) {
2912
- const e = document.createDocumentFragment(), t = {
2913
- fragment: e
2914
- };
2915
- se = t, ke(() => {
2916
- Wn()(/* @__PURE__ */ q.createElement(li, {
2917
- ref: (n) => {
2918
- const {
2919
- instance: r,
2920
- sync: i
2921
- } = n || {};
2922
- Promise.resolve().then(() => {
2923
- !t.instance && r && (t.instance = r, t.sync = i, nt());
2924
- });
2925
- }
2926
- }), e);
2927
- });
2928
- return;
2929
- }
2930
- se.instance && (Ae.forEach((e) => {
2931
- switch (e.type) {
2932
- case "open": {
2933
- ke(() => {
2934
- se.instance.open(Object.assign(Object.assign({}, Fe), e.config));
2935
- });
2936
- break;
2937
- }
2938
- case "destroy":
2939
- ke(() => {
2940
- se == null || se.instance.destroy(e.key);
2941
- });
2942
- break;
2943
- }
2944
- }), Ae = []);
2945
- }
2946
- function ci(e) {
2947
- Fe = Object.assign(Object.assign({}, Fe), e), ke(() => {
2948
- var t;
2949
- (t = se == null ? void 0 : se.sync) === null || t === void 0 || t.call(se);
2950
- });
2951
- }
2952
- function gn(e) {
2953
- const t = Rt();
2954
- process.env.NODE_ENV !== "production" && !t.holderRender && zn("notification"), Ae.push({
2955
- type: "open",
2956
- config: e
2957
- }), nt();
2958
- }
2959
- const ui = (e) => {
2960
- Ae.push({
2961
- type: "destroy",
2962
- key: e
2963
- }), nt();
2964
- }, di = ["success", "info", "warning", "error"], fi = {
2965
- open: gn,
2966
- destroy: ui,
2967
- config: ci,
2968
- useNotification: ir,
2969
- _InternalPanelDoNotUseOrYouWillBeFired: Yo
2970
- }, hn = fi;
2971
- di.forEach((e) => {
2972
- hn[e] = (t) => gn(Object.assign(Object.assign({}, t), {
2973
- type: e
2974
- }));
2975
- });
2976
- process.env.NODE_ENV;
2977
- process.env.NODE_ENV;
2978
- const We = hn;
2979
- var mi = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z" } }, { tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, name: "check-circle", theme: "outlined" };
2980
- const pi = mi;
2981
- var gi = function(t, o) {
2982
- return /* @__PURE__ */ a.createElement(ye, fe({}, t, {
2983
- ref: o,
2984
- icon: pi
2985
- }));
2986
- }, vn = /* @__PURE__ */ a.forwardRef(gi);
2987
- process.env.NODE_ENV !== "production" && (vn.displayName = "CheckCircleOutlined");
2988
- const hi = vn;
2989
- var vi = { icon: { tag: "svg", attrs: { "fill-rule": "evenodd", viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z" } }] }, name: "close-circle", theme: "outlined" };
2990
- const bi = vi;
2991
- var yi = function(t, o) {
2992
- return /* @__PURE__ */ a.createElement(ye, fe({}, t, {
2993
- ref: o,
2994
- icon: bi
2995
- }));
2996
- }, bn = /* @__PURE__ */ a.forwardRef(yi);
2997
- process.env.NODE_ENV !== "production" && (bn.displayName = "CloseCircleOutlined");
2998
- const Ci = bn;
2999
- var $i = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { tag: "path", attrs: { d: "M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" } }] }, name: "exclamation-circle", theme: "outlined" };
3000
- const xi = $i;
3001
- var Si = function(t, o) {
3002
- return /* @__PURE__ */ a.createElement(ye, fe({}, t, {
3003
- ref: o,
3004
- icon: xi
3005
- }));
3006
- }, yn = /* @__PURE__ */ a.forwardRef(Si);
3007
- process.env.NODE_ENV !== "production" && (yn.displayName = "ExclamationCircleOutlined");
3008
- const Ei = yn;
3009
- var wi = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { tag: "path", attrs: { d: "M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z" } }] }, name: "info-circle", theme: "outlined" };
3010
- const Oi = wi;
3011
- var Ni = function(t, o) {
3012
- return /* @__PURE__ */ a.createElement(ye, fe({}, t, {
3013
- ref: o,
3014
- icon: Oi
3015
- }));
3016
- }, Cn = /* @__PURE__ */ a.forwardRef(Ni);
3017
- process.env.NODE_ENV !== "production" && (Cn.displayName = "InfoCircleOutlined");
3018
- const Ii = Cn;
3019
- var Mi = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M696 480H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8z" } }, { tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, name: "minus-circle", theme: "outlined" };
3020
- const Fi = Mi;
3021
- var Pi = function(t, o) {
3022
- return /* @__PURE__ */ a.createElement(ye, fe({}, t, {
3023
- ref: o,
3024
- icon: Fi
3025
- }));
3026
- }, $n = /* @__PURE__ */ a.forwardRef(Pi);
3027
- process.env.NODE_ENV !== "production" && ($n.displayName = "MinusCircleOutlined");
3028
- const ji = $n, xn = It(void 0), pa = ({
3029
- children: e
3030
- }) => {
3031
- const [t, o] = We.useNotification();
3032
- Ge(() => {
3033
- const r = document.createElement("div");
3034
- return r.id = "notification-root", document.body.appendChild(r), We.config({
3035
- getContainer: () => r
3036
- }), () => {
3037
- document.body.removeChild(r);
3038
- };
3039
- }, []);
3040
- const n = {
3041
- show: (r, i, s = "info") => {
3042
- We.open({
3043
- key: Date.now().toString(),
3044
- message: null,
3045
- description: /* @__PURE__ */ Q(
3046
- wt,
3047
- {
3048
- data: {
3049
- message: r,
3050
- description: i,
3051
- state: s
3052
- }
3053
- }
3054
- ),
3055
- className: "custom-notification",
3056
- style: {
3057
- padding: 16,
3058
- background: "white"
3059
- },
3060
- placement: "topRight",
3061
- duration: 3,
3062
- content: /* @__PURE__ */ Q(
3063
- wt,
3064
- {
3065
- data: {
3066
- message: r,
3067
- description: i,
3068
- state: s
3069
- }
3070
- }
3071
- )
3072
- });
3073
- }
3074
- };
3075
- return /* @__PURE__ */ qe(xn.Provider, { value: n, children: [
3076
- o,
3077
- e
3078
- ] });
3079
- }, ga = () => {
3080
- const e = Ie(xn);
3081
- if (!e)
3082
- throw new Error("useToast must be used within a GenesisProvider");
3083
- return e;
3084
- }, Ri = ({ help: e, ...t }) => {
3085
- const o = ro();
3086
- return /* @__PURE__ */ Q(
3087
- tt.Item,
3088
- {
3089
- help: /* @__PURE__ */ Q(
3090
- "div",
3091
- {
3092
- style: {
3093
- marginTop: `${o.sizing.Size1}px`,
3094
- marginBottom: `${o.sizing.Size1}px`
3095
- },
3096
- children: /* @__PURE__ */ Q(
3097
- Ue,
3098
- {
3099
- variant: we.body3,
3100
- type: Ot.secondary,
3101
- state: t.validateStatus === "error" ? re.error : re.active,
3102
- children: e
3103
- }
3104
- )
3105
- }
3106
- ),
3107
- ...t,
3108
- children: t.children
3109
- }
3110
- );
3111
- }, Sn = ({ children: e, ...t }) => (Nt(), /* @__PURE__ */ Q(tt, { children: e }));
3112
- Sn.Item = Ri;
3113
- Sn.useForm = tt.useForm;
3114
- const Ue = ({
3115
- children: e,
3116
- type: t = Ot.secondary,
3117
- variant: o = we.body1,
3118
- state: n = re.active,
3119
- color: r,
3120
- ...i
3121
- }) => {
3122
- const s = Nt() ?? En.wide;
3123
- switch (o) {
3124
- case o.includes("display"):
3125
- case o.includes("heading"):
3126
- return /* @__PURE__ */ Q(
3127
- Nn,
3128
- {
3129
- state: n,
3130
- type: t,
3131
- variant: o,
3132
- breakpoint: s,
3133
- color: r,
3134
- ...i,
3135
- children: e
3136
- }
3137
- );
3138
- case o.includes("body"):
3139
- default:
3140
- return /* @__PURE__ */ Q(
3141
- On,
3142
- {
3143
- state: n,
3144
- type: t,
3145
- variant: o,
3146
- breakpoint: s,
3147
- color: r,
3148
- ...i,
3149
- children: e
3150
- }
3151
- );
3152
- }
3153
- }, _i = (e, t) => {
3154
- switch (e) {
3155
- case re.error:
3156
- return t.colors.status.error.onsurface;
3157
- case re.success:
3158
- return t.colors.status.success.onsurface;
3159
- case re.warning:
3160
- return t.colors.status.warning.onsurface;
3161
- case re.generic:
3162
- return t.colors.status.generic.onsurface;
3163
- case re.info:
3164
- default:
3165
- return t.colors.status.info.onsurface;
3166
- }
3167
- }, Se = 22, Ti = (e, t) => {
3168
- switch (e) {
3169
- case re.warning:
3170
- return /* @__PURE__ */ Q(Ei, { style: { color: t, fontSize: Se } });
3171
- case re.error:
3172
- return /* @__PURE__ */ Q(Ci, { style: { color: t, fontSize: Se } });
3173
- case re.success:
3174
- return /* @__PURE__ */ Q(hi, { style: { color: t, fontSize: Se } });
3175
- case re.generic:
3176
- return /* @__PURE__ */ Q(ji, { style: { color: t, fontSize: Se } });
3177
- case re.info:
3178
- default:
3179
- return /* @__PURE__ */ Q(Ii, { style: { color: t, fontSize: Se } });
3180
- }
3181
- }, wt = ({
3182
- state: e = re.info,
3183
- message: t,
3184
- action: o,
3185
- close: n,
3186
- size: r = ot.standard
3187
- }) => {
3188
- const i = {}, s = _i(e, i), l = i.colors.interactive.utility.border, c = i.colors.interactive.utility.onsurface, u = r === ot.small ? we.body1 : we.body2;
3189
- return /* @__PURE__ */ qe(io, { state: e, size: r, children: [
3190
- /* @__PURE__ */ qe(ao, { size: r, children: [
3191
- Ti(e, s),
3192
- /* @__PURE__ */ Q(Ue, { variant: u, color: i.colors.onsurface.copy, children: t })
3193
- ] }),
3194
- o ? /* @__PURE__ */ Q(
3195
- "button",
3196
- {
3197
- onClick: o.onClick,
3198
- style: {
3199
- border: `1px solid ${l}`,
3200
- background: "none",
3201
- cursor: "pointer",
3202
- cursorEvents: "all",
3203
- color: c,
3204
- borderRadius: i.borderRadius.BorderRadiusSm,
3205
- paddingTop: i.components.utilityButton.padding.verPadding,
3206
- paddingBottom: i.components.utilityButton.padding.verPadding,
3207
- paddingLeft: i.components.utilityButton.padding.horPadding,
3208
- paddingRight: i.components.utilityButton.padding.horPadding
3209
- },
3210
- children: /* @__PURE__ */ Q(Ue, { variant: we.body1, children: o.text })
3211
- }
3212
- ) : null,
3213
- n ? /* @__PURE__ */ Q(
3214
- "button",
3215
- {
3216
- onClick: n,
3217
- style: {
3218
- textDecoration: "underline",
3219
- border: "none",
3220
- background: "none",
3221
- cursor: "pointer",
3222
- cursorEvents: "all"
3223
- },
3224
- children: /* @__PURE__ */ Q(Vt, { style: { fontSize: 18 } })
3225
- }
3226
- ) : null
3227
- ] });
3228
- };
3229
- export {
3230
- tt as A,
3231
- hi as C,
3232
- Ei as E,
3233
- Sn as F,
3234
- Ii as I,
3235
- ji as M,
3236
- Ue as T,
3237
- wt as a,
3238
- Ri as b,
3239
- pa as c,
3240
- Ci as d,
3241
- ga as u
3242
- };