@amateescu/portal-ui-components 0.0.25 → 0.0.26-beta1

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 (38) hide show
  1. package/dist/{Box-CmKt1PwF.js → Box-DIkPDmkQ.js} +4 -4
  2. package/dist/{Button-BT8r3F_d.js → Button-DX-oo-0S.js} +5 -5
  3. package/dist/{ButtonBase-By486Sca.js → ButtonBase-OBo-BQii.js} +3 -3
  4. package/dist/EllipsisOutlined-DgMtO3ok.js +2467 -0
  5. package/dist/PurePanel-DOohzuQB.js +2212 -0
  6. package/dist/{Skeleton-XFbjx7LJ.js → Skeleton-BekbYx_y.js} +161 -158
  7. package/dist/{UserInfoDropdown-DGaplQo6.js → UserInfoDropdown-WucWs2wn.js} +1564 -1529
  8. package/dist/components/ConfirmationModal/ConfirmationModal.js +1 -1
  9. package/dist/components/ConfirmationModal/ConfirmationModal.stories.js +1 -1
  10. package/dist/components/CustomButton/CustomButton.js +1 -1
  11. package/dist/components/CustomPagination/CustomPagination.js +4 -4
  12. package/dist/components/ErrorModal/ErrorModal.js +5 -6
  13. package/dist/components/ErrorModal/ErrorModal.stories.js +1 -1
  14. package/dist/components/InfoModal/InfoModal.js +1 -1
  15. package/dist/components/InfoModal/InfoModal.stories.js +1 -1
  16. package/dist/components/KpiCard/KpiCard.js +995 -892
  17. package/dist/components/LoadingAnimation/LoadingAnimation.js +5 -5
  18. package/dist/components/Login/Login.js +681 -674
  19. package/dist/components/Login/Login.stories.js +1586 -1546
  20. package/dist/components/SideMenu/SideMenu.js +1 -1
  21. package/dist/components/UserInfoDropdown/UserInfoDropdown.js +1 -1
  22. package/dist/components/UserInfoDropdown/UserInfoDropdown.stories.js +1 -1
  23. package/dist/components/index.js +1 -1
  24. package/dist/context-DcMzUd6b.js +7343 -0
  25. package/dist/{createSvgIcon-B8ya7kb4.js → createSvgIcon-C53fLlQy.js} +5 -5
  26. package/dist/generateUtilityClasses-B5BV6O-J.js +3367 -0
  27. package/dist/{index-1vDmwq0E.js → index-Bb1SSZdZ.js} +6718 -6719
  28. package/dist/index-Cfhdtvoc.js +1689 -0
  29. package/dist/main.js +1 -1
  30. package/dist/objectWithoutPropertiesLoose-DYizGgyG.js +46 -0
  31. package/dist/types/Column.d.ts +2 -0
  32. package/package.json +33 -31
  33. package/dist/EllipsisOutlined-CtmB5yDB.js +0 -2470
  34. package/dist/PurePanel-CfZ1n-M8.js +0 -4782
  35. package/dist/generateUtilityClasses-Bhjgm_6-.js +0 -3270
  36. package/dist/index-DsP9yT3s.js +0 -1551
  37. package/dist/objectWithoutPropertiesLoose-CIT-1_kH.js +0 -227
  38. package/dist/useId-DbfH3PlN.js +0 -5397
@@ -0,0 +1,2212 @@
1
+ import * as m from "react";
2
+ import c, { useContext as _e, useRef as D, forwardRef as me, useState as je, useEffect as te, useMemo as oe, Children as kt } from "react";
3
+ import { I as eo, U as We, v as Ge, e as M, Z as pt, $ as le, h as vt, Y as to, a0 as oo, a1 as ro, w as ce, q as bt, c as N, a2 as Ct, a as re, k as Fe, a3 as no, a4 as ao, a5 as io, g as ht, m as ne, E as yt, x as so, l as lo, a6 as co, a7 as uo, a8 as St, a9 as xt, p as Et, aa as Ot, _ as J, i as Te, s as $t, H as mo, K as T, ab as Re, u as ue, ac as go, B as fo, ad as po, T as vo, b as bo, ae as Co, n as ho, o as yo, af as So, C as xo } from "./context-DcMzUd6b.js";
4
+ import { R as It } from "./index-Bb1SSZdZ.js";
5
+ import { a as se } from "./objectWithoutPropertiesLoose-DYizGgyG.js";
6
+ const Ve = ["blue", "purple", "cyan", "green", "magenta", "pink", "red", "orange", "yellow", "volcano", "geekblue", "lime", "gold"];
7
+ function Eo(e) {
8
+ return e && /* @__PURE__ */ c.isValidElement(e) && e.type === c.Fragment;
9
+ }
10
+ const Oo = (e, t, o) => /* @__PURE__ */ c.isValidElement(e) ? /* @__PURE__ */ c.cloneElement(e, typeof o == "function" ? o(e.props || {}) : o) : t;
11
+ function Rt(e, t) {
12
+ return Oo(e, e, t);
13
+ }
14
+ var $o = { icon: { tag: "svg", attrs: { viewBox: "0 0 1024 1024", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, name: "loading", theme: "outlined" }, Io = function(t, o) {
15
+ return /* @__PURE__ */ m.createElement(eo, se({}, t, {
16
+ ref: o,
17
+ icon: $o
18
+ }));
19
+ }, wt = /* @__PURE__ */ m.forwardRef(Io);
20
+ process.env.NODE_ENV !== "production" && (wt.displayName = "LoadingOutlined");
21
+ const Bt = /* @__PURE__ */ c.createContext(void 0);
22
+ process.env.NODE_ENV !== "production" && (Bt.displayName = "zIndexContext");
23
+ const V = 100, Ro = 10, wo = V * Ro, Bo = wo + V, Nt = {
24
+ Modal: V,
25
+ Drawer: V,
26
+ Popover: V,
27
+ Popconfirm: V,
28
+ Tooltip: V,
29
+ Tour: V,
30
+ FloatButton: V
31
+ }, No = {
32
+ SelectLike: 50,
33
+ Dropdown: 50,
34
+ DatePicker: 50,
35
+ Menu: 50,
36
+ ImagePreview: 1
37
+ };
38
+ function Ho(e) {
39
+ return e in Nt;
40
+ }
41
+ const yn = (e, t) => {
42
+ const [, o] = We(), r = c.useContext(Bt), n = Ho(e);
43
+ let a;
44
+ if (t !== void 0)
45
+ a = [t, t];
46
+ else {
47
+ let i = r ?? 0;
48
+ n ? i += // Use preset token zIndex by default but not stack when has parent container
49
+ (r ? 0 : o.zIndexPopupBase) + // Container offset
50
+ Nt[e] : i += No[e], a = [r === void 0 ? t : i, i];
51
+ }
52
+ if (process.env.NODE_ENV !== "production") {
53
+ const i = Ge(e), s = o.zIndexPopupBase + Bo, l = a[0] || 0;
54
+ process.env.NODE_ENV !== "production" && i(t !== void 0 || l <= s, "usage", "`zIndex` is over design token `zIndexPopupBase` too much. It may cause unexpected override.");
55
+ }
56
+ return a;
57
+ };
58
+ var ae = M({}, It), zo = ae.version, we = ae.render, Po = ae.unmountComponentAtNode, ge;
59
+ try {
60
+ var _o = Number((zo || "").split(".")[0]);
61
+ _o >= 18 && (ge = ae.createRoot);
62
+ } catch {
63
+ }
64
+ function lt(e) {
65
+ var t = ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
66
+ t && vt(t) === "object" && (t.usingClientEntryPoint = e);
67
+ }
68
+ var de = "__rc_react_root__";
69
+ function jo(e, t) {
70
+ lt(!0);
71
+ var o = t[de] || ge(t);
72
+ lt(!1), o.render(e), t[de] = o;
73
+ }
74
+ function To(e, t) {
75
+ we == null || we(e, t);
76
+ }
77
+ function Do(e, t) {
78
+ if (ge) {
79
+ jo(e, t);
80
+ return;
81
+ }
82
+ To(e, t);
83
+ }
84
+ function Lo(e) {
85
+ return De.apply(this, arguments);
86
+ }
87
+ function De() {
88
+ return De = pt(/* @__PURE__ */ le().mark(function e(t) {
89
+ return le().wrap(function(r) {
90
+ for (; ; ) switch (r.prev = r.next) {
91
+ case 0:
92
+ return r.abrupt("return", Promise.resolve().then(function() {
93
+ var n;
94
+ (n = t[de]) === null || n === void 0 || n.unmount(), delete t[de];
95
+ }));
96
+ case 1:
97
+ case "end":
98
+ return r.stop();
99
+ }
100
+ }, e);
101
+ })), De.apply(this, arguments);
102
+ }
103
+ function Ao(e) {
104
+ Po(e);
105
+ }
106
+ function Mo(e) {
107
+ return Le.apply(this, arguments);
108
+ }
109
+ function Le() {
110
+ return Le = pt(/* @__PURE__ */ le().mark(function e(t) {
111
+ return le().wrap(function(r) {
112
+ for (; ; ) switch (r.prev = r.next) {
113
+ case 0:
114
+ if (ge === void 0) {
115
+ r.next = 2;
116
+ break;
117
+ }
118
+ return r.abrupt("return", Lo(t));
119
+ case 2:
120
+ Ao(t);
121
+ case 3:
122
+ case "end":
123
+ return r.stop();
124
+ }
125
+ }, e);
126
+ })), Le.apply(this, arguments);
127
+ }
128
+ const Wo = (e, t) => {
129
+ if (process.env.NODE_ENV !== "production") {
130
+ const o = parseInt(m.version.split(".")[0], 10), r = Object.keys(It);
131
+ process.env.NODE_ENV !== "production" && to(o < 19 || r.includes("createRoot"), "compatible", "antd v5 support React is 16 ~ 18. see https://u.ant.design/v5-for-19 for compatible.");
132
+ }
133
+ return Do(e, t), () => Mo(t);
134
+ };
135
+ let Go = Wo;
136
+ function Fo() {
137
+ return Go;
138
+ }
139
+ const Vo = (e) => {
140
+ const {
141
+ componentCls: t,
142
+ colorPrimary: o
143
+ } = e;
144
+ return {
145
+ [t]: {
146
+ position: "absolute",
147
+ background: "transparent",
148
+ pointerEvents: "none",
149
+ boxSizing: "border-box",
150
+ color: `var(--wave-color, ${o})`,
151
+ boxShadow: "0 0 0 0 currentcolor",
152
+ opacity: 0.2,
153
+ // =================== Motion ===================
154
+ "&.wave-motion-appear": {
155
+ transition: [`box-shadow 0.4s ${e.motionEaseOutCirc}`, `opacity 2s ${e.motionEaseOutCirc}`].join(","),
156
+ "&-active": {
157
+ boxShadow: "0 0 0 6px currentcolor",
158
+ opacity: 0
159
+ },
160
+ "&.wave-quick": {
161
+ transition: [`box-shadow ${e.motionDurationSlow} ${e.motionEaseInOut}`, `opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`].join(",")
162
+ }
163
+ }
164
+ }
165
+ };
166
+ }, Uo = oo("Wave", (e) => [Vo(e)]), Ht = `${ro}-wave-target`;
167
+ function Be(e) {
168
+ return e && e !== "#fff" && e !== "#ffffff" && e !== "rgb(255, 255, 255)" && e !== "rgba(255, 255, 255, 1)" && !/rgba\((?:\d*, ){3}0\)/.test(e) && // any transparent rgba color
169
+ e !== "transparent";
170
+ }
171
+ function qo(e) {
172
+ const {
173
+ borderTopColor: t,
174
+ borderColor: o,
175
+ backgroundColor: r
176
+ } = getComputedStyle(e);
177
+ return Be(t) ? t : Be(o) ? o : Be(r) ? r : null;
178
+ }
179
+ function Ne(e) {
180
+ return Number.isNaN(e) ? 0 : e;
181
+ }
182
+ const Xo = (e) => {
183
+ const {
184
+ className: t,
185
+ target: o,
186
+ component: r,
187
+ registerUnmount: n
188
+ } = e, a = m.useRef(null), i = m.useRef(null);
189
+ m.useEffect(() => {
190
+ i.current = n();
191
+ }, []);
192
+ const [s, l] = m.useState(null), [u, d] = m.useState([]), [g, p] = m.useState(0), [C, h] = m.useState(0), [x, f] = m.useState(0), [b, w] = m.useState(0), [E, v] = m.useState(!1), y = {
193
+ left: g,
194
+ top: C,
195
+ width: x,
196
+ height: b,
197
+ borderRadius: u.map((S) => `${S}px`).join(" ")
198
+ };
199
+ s && (y["--wave-color"] = s);
200
+ function B() {
201
+ const S = getComputedStyle(o);
202
+ l(qo(o));
203
+ const $ = S.position === "static", {
204
+ borderLeftWidth: H,
205
+ borderTopWidth: z
206
+ } = S;
207
+ p($ ? o.offsetLeft : Ne(-parseFloat(H))), h($ ? o.offsetTop : Ne(-parseFloat(z))), f(o.offsetWidth), w(o.offsetHeight);
208
+ const {
209
+ borderTopLeftRadius: j,
210
+ borderTopRightRadius: P,
211
+ borderBottomLeftRadius: q,
212
+ borderBottomRightRadius: L
213
+ } = S;
214
+ d([j, P, L, q].map((G) => Ne(parseFloat(G))));
215
+ }
216
+ if (m.useEffect(() => {
217
+ if (o) {
218
+ const S = ce(() => {
219
+ B(), v(!0);
220
+ });
221
+ let $;
222
+ return typeof ResizeObserver < "u" && ($ = new ResizeObserver(B), $.observe(o)), () => {
223
+ ce.cancel(S), $ == null || $.disconnect();
224
+ };
225
+ }
226
+ }, []), !E)
227
+ return null;
228
+ const _ = (r === "Checkbox" || r === "Radio") && (o == null ? void 0 : o.classList.contains(Ht));
229
+ return /* @__PURE__ */ m.createElement(bt, {
230
+ visible: !0,
231
+ motionAppear: !0,
232
+ motionName: "wave-motion",
233
+ motionDeadline: 5e3,
234
+ onAppearEnd: (S, $) => {
235
+ var H, z;
236
+ if ($.deadline || $.propertyName === "opacity") {
237
+ const j = (H = a.current) === null || H === void 0 ? void 0 : H.parentElement;
238
+ (z = i.current) === null || z === void 0 || z.call(i).then(() => {
239
+ j == null || j.remove();
240
+ });
241
+ }
242
+ return !1;
243
+ }
244
+ }, (S, $) => {
245
+ let {
246
+ className: H
247
+ } = S;
248
+ return /* @__PURE__ */ m.createElement("div", {
249
+ ref: Ct(a, $),
250
+ className: N(t, H, {
251
+ "wave-quick": _
252
+ }),
253
+ style: y
254
+ });
255
+ });
256
+ }, Zo = (e, t) => {
257
+ var o;
258
+ const {
259
+ component: r
260
+ } = t;
261
+ if (r === "Checkbox" && !(!((o = e.querySelector("input")) === null || o === void 0) && o.checked))
262
+ return;
263
+ const n = document.createElement("div");
264
+ n.style.position = "absolute", n.style.left = "0px", n.style.top = "0px", e == null || e.insertBefore(n, e == null ? void 0 : e.firstChild);
265
+ const a = Fo();
266
+ let i = null;
267
+ function s() {
268
+ return i;
269
+ }
270
+ i = a(/* @__PURE__ */ m.createElement(Xo, Object.assign({}, t, {
271
+ target: e,
272
+ registerUnmount: s
273
+ })), n);
274
+ }, Yo = (e, t, o) => {
275
+ const {
276
+ wave: r
277
+ } = m.useContext(re), [, n, a] = We(), i = Fe((u) => {
278
+ const d = e.current;
279
+ if (r != null && r.disabled || !d)
280
+ return;
281
+ const g = d.querySelector(`.${Ht}`) || d, {
282
+ showEffect: p
283
+ } = r || {};
284
+ (p || Zo)(g, {
285
+ className: t,
286
+ token: n,
287
+ component: o,
288
+ event: u,
289
+ hashId: a
290
+ });
291
+ }), s = m.useRef(null);
292
+ return (u) => {
293
+ ce.cancel(s.current), s.current = ce(() => {
294
+ i(u);
295
+ });
296
+ };
297
+ }, zt = (e) => {
298
+ const {
299
+ children: t,
300
+ disabled: o,
301
+ component: r
302
+ } = e, {
303
+ getPrefixCls: n
304
+ } = _e(re), a = D(null), i = n("wave"), [, s] = Uo(i), l = Yo(a, N(i, s), r);
305
+ if (c.useEffect(() => {
306
+ const d = a.current;
307
+ if (!d || d.nodeType !== 1 || o)
308
+ return;
309
+ const g = (p) => {
310
+ !io(p.target) || // No need wave
311
+ !d.getAttribute || d.getAttribute("disabled") || d.disabled || d.className.includes("disabled") || d.className.includes("-leave") || l(p);
312
+ };
313
+ return d.addEventListener("click", g, !0), () => {
314
+ d.removeEventListener("click", g, !0);
315
+ };
316
+ }, [o]), !/* @__PURE__ */ c.isValidElement(t))
317
+ return t ?? null;
318
+ const u = no(t) ? Ct(ao(t), a) : a;
319
+ return Rt(t, {
320
+ ref: u
321
+ });
322
+ };
323
+ process.env.NODE_ENV !== "production" && (zt.displayName = "Wave");
324
+ const Ko = (e) => {
325
+ const {
326
+ componentCls: t
327
+ } = e;
328
+ return {
329
+ [t]: {
330
+ "&-block": {
331
+ display: "flex",
332
+ width: "100%"
333
+ },
334
+ "&-vertical": {
335
+ flexDirection: "column"
336
+ }
337
+ }
338
+ };
339
+ }, Jo = (e) => {
340
+ const {
341
+ componentCls: t,
342
+ antCls: o
343
+ } = e;
344
+ return {
345
+ [t]: {
346
+ display: "inline-flex",
347
+ "&-rtl": {
348
+ direction: "rtl"
349
+ },
350
+ "&-vertical": {
351
+ flexDirection: "column"
352
+ },
353
+ "&-align": {
354
+ flexDirection: "column",
355
+ "&-center": {
356
+ alignItems: "center"
357
+ },
358
+ "&-start": {
359
+ alignItems: "flex-start"
360
+ },
361
+ "&-end": {
362
+ alignItems: "flex-end"
363
+ },
364
+ "&-baseline": {
365
+ alignItems: "baseline"
366
+ }
367
+ },
368
+ [`${t}-item:empty`]: {
369
+ display: "none"
370
+ },
371
+ // https://github.com/ant-design/ant-design/issues/47875
372
+ [`${t}-item > ${o}-badge-not-a-wrapper:only-child`]: {
373
+ display: "block"
374
+ }
375
+ }
376
+ };
377
+ }, Qo = (e) => {
378
+ const {
379
+ componentCls: t
380
+ } = e;
381
+ return {
382
+ [t]: {
383
+ "&-gap-row-small": {
384
+ rowGap: e.spaceGapSmallSize
385
+ },
386
+ "&-gap-row-middle": {
387
+ rowGap: e.spaceGapMiddleSize
388
+ },
389
+ "&-gap-row-large": {
390
+ rowGap: e.spaceGapLargeSize
391
+ },
392
+ "&-gap-col-small": {
393
+ columnGap: e.spaceGapSmallSize
394
+ },
395
+ "&-gap-col-middle": {
396
+ columnGap: e.spaceGapMiddleSize
397
+ },
398
+ "&-gap-col-large": {
399
+ columnGap: e.spaceGapLargeSize
400
+ }
401
+ }
402
+ };
403
+ }, ko = ht("Space", (e) => {
404
+ const t = ne(e, {
405
+ spaceGapSmallSize: e.paddingXS,
406
+ spaceGapMiddleSize: e.padding,
407
+ spaceGapLargeSize: e.paddingLG
408
+ });
409
+ return [Jo(t), Qo(t), Ko(t)];
410
+ }, () => ({}), {
411
+ // Space component don't apply extra font style
412
+ // https://github.com/ant-design/ant-design/issues/40315
413
+ resetStyle: !1
414
+ });
415
+ var Pt = function(e, t) {
416
+ var o = {};
417
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
418
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var n = 0, r = Object.getOwnPropertySymbols(e); n < r.length; n++)
419
+ t.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[n]) && (o[r[n]] = e[r[n]]);
420
+ return o;
421
+ };
422
+ const fe = /* @__PURE__ */ m.createContext(null), er = (e, t) => {
423
+ const o = m.useContext(fe), r = m.useMemo(() => {
424
+ if (!o)
425
+ return "";
426
+ const {
427
+ compactDirection: n,
428
+ isFirstItem: a,
429
+ isLastItem: i
430
+ } = o, s = n === "vertical" ? "-vertical-" : "-";
431
+ return N(`${e}-compact${s}item`, {
432
+ [`${e}-compact${s}first-item`]: a,
433
+ [`${e}-compact${s}last-item`]: i,
434
+ [`${e}-compact${s}item-rtl`]: t === "rtl"
435
+ });
436
+ }, [e, t, o]);
437
+ return {
438
+ compactSize: o == null ? void 0 : o.compactSize,
439
+ compactDirection: o == null ? void 0 : o.compactDirection,
440
+ compactItemClassnames: r
441
+ };
442
+ }, tr = (e) => {
443
+ const {
444
+ children: t
445
+ } = e;
446
+ return /* @__PURE__ */ m.createElement(fe.Provider, {
447
+ value: null
448
+ }, t);
449
+ }, or = (e) => {
450
+ const {
451
+ children: t
452
+ } = e, o = Pt(e, ["children"]);
453
+ return /* @__PURE__ */ m.createElement(fe.Provider, {
454
+ value: m.useMemo(() => o, [o])
455
+ }, t);
456
+ }, Sn = (e) => {
457
+ const {
458
+ getPrefixCls: t,
459
+ direction: o
460
+ } = m.useContext(re), {
461
+ size: r,
462
+ direction: n,
463
+ block: a,
464
+ prefixCls: i,
465
+ className: s,
466
+ rootClassName: l,
467
+ children: u
468
+ } = e, d = Pt(e, ["size", "direction", "block", "prefixCls", "className", "rootClassName", "children"]), g = yt((E) => r ?? E), p = t("space-compact", i), [C, h] = ko(p), x = N(p, h, {
469
+ [`${p}-rtl`]: o === "rtl",
470
+ [`${p}-block`]: a,
471
+ [`${p}-vertical`]: n === "vertical"
472
+ }, s, l), f = m.useContext(fe), b = so(u), w = m.useMemo(() => b.map((E, v) => {
473
+ const y = (E == null ? void 0 : E.key) || `${p}-item-${v}`;
474
+ return /* @__PURE__ */ m.createElement(or, {
475
+ key: y,
476
+ compactSize: g,
477
+ compactDirection: n,
478
+ isFirstItem: v === 0 && (!f || (f == null ? void 0 : f.isFirstItem)),
479
+ isLastItem: v === b.length - 1 && (!f || (f == null ? void 0 : f.isLastItem))
480
+ }, E);
481
+ }), [r, b, f]);
482
+ return b.length === 0 ? null : C(/* @__PURE__ */ m.createElement("div", Object.assign({
483
+ className: x
484
+ }, d), w));
485
+ };
486
+ var rr = function(e, t) {
487
+ var o = {};
488
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
489
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var n = 0, r = Object.getOwnPropertySymbols(e); n < r.length; n++)
490
+ t.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[n]) && (o[r[n]] = e[r[n]]);
491
+ return o;
492
+ };
493
+ const _t = /* @__PURE__ */ m.createContext(void 0), nr = (e) => {
494
+ const {
495
+ getPrefixCls: t,
496
+ direction: o
497
+ } = m.useContext(re), {
498
+ prefixCls: r,
499
+ size: n,
500
+ className: a
501
+ } = e, i = rr(e, ["prefixCls", "size", "className"]), s = t("btn-group", r), [, , l] = We(), u = m.useMemo(() => {
502
+ switch (n) {
503
+ case "large":
504
+ return "lg";
505
+ case "small":
506
+ return "sm";
507
+ default:
508
+ return "";
509
+ }
510
+ }, [n]);
511
+ if (process.env.NODE_ENV !== "production") {
512
+ const g = Ge("Button.Group");
513
+ g.deprecated(!1, "Button.Group", "Space.Compact"), process.env.NODE_ENV !== "production" && g(!n || ["large", "small", "middle"].includes(n), "usage", "Invalid prop `size`.");
514
+ }
515
+ const d = N(s, {
516
+ [`${s}-${u}`]: u,
517
+ [`${s}-rtl`]: o === "rtl"
518
+ }, a, l);
519
+ return /* @__PURE__ */ m.createElement(_t.Provider, {
520
+ value: n
521
+ }, /* @__PURE__ */ m.createElement("div", Object.assign({}, i, {
522
+ className: d
523
+ })));
524
+ }, ct = /^[\u4E00-\u9FA5]{2}$/, Ae = ct.test.bind(ct);
525
+ function xn(e) {
526
+ return e === "danger" ? {
527
+ danger: !0
528
+ } : {
529
+ type: e
530
+ };
531
+ }
532
+ function ut(e) {
533
+ return typeof e == "string";
534
+ }
535
+ function ie(e) {
536
+ return e === "text" || e === "link";
537
+ }
538
+ function ar(e, t) {
539
+ if (e == null)
540
+ return;
541
+ const o = t ? " " : "";
542
+ return typeof e != "string" && typeof e != "number" && ut(e.type) && Ae(e.props.children) ? Rt(e, {
543
+ children: e.props.children.split("").join(o)
544
+ }) : ut(e) ? Ae(e) ? /* @__PURE__ */ c.createElement("span", null, e.split("").join(o)) : /* @__PURE__ */ c.createElement("span", null, e) : Eo(e) ? /* @__PURE__ */ c.createElement("span", null, e) : e;
545
+ }
546
+ function ir(e, t) {
547
+ let o = !1;
548
+ const r = [];
549
+ return c.Children.forEach(e, (n) => {
550
+ const a = typeof n, i = a === "string" || a === "number";
551
+ if (o && i) {
552
+ const s = r.length - 1, l = r[s];
553
+ r[s] = `${l}${n}`;
554
+ } else
555
+ r.push(n);
556
+ o = i;
557
+ }), c.Children.map(r, (n) => ar(n, t));
558
+ }
559
+ ["default", "primary", "danger"].concat(lo(Ve));
560
+ const Me = /* @__PURE__ */ me((e, t) => {
561
+ const {
562
+ className: o,
563
+ style: r,
564
+ children: n,
565
+ prefixCls: a
566
+ } = e, i = N(`${a}-icon`, o);
567
+ return /* @__PURE__ */ c.createElement("span", {
568
+ ref: t,
569
+ className: i,
570
+ style: r
571
+ }, n);
572
+ }), dt = /* @__PURE__ */ me((e, t) => {
573
+ const {
574
+ prefixCls: o,
575
+ className: r,
576
+ style: n,
577
+ iconClassName: a
578
+ } = e, i = N(`${o}-loading-icon`, r);
579
+ return /* @__PURE__ */ c.createElement(Me, {
580
+ prefixCls: o,
581
+ className: i,
582
+ style: n,
583
+ ref: t
584
+ }, /* @__PURE__ */ c.createElement(wt, {
585
+ className: a
586
+ }));
587
+ }), He = () => ({
588
+ width: 0,
589
+ opacity: 0,
590
+ transform: "scale(0)"
591
+ }), ze = (e) => ({
592
+ width: e.scrollWidth,
593
+ opacity: 1,
594
+ transform: "scale(1)"
595
+ }), sr = (e) => {
596
+ const {
597
+ prefixCls: t,
598
+ loading: o,
599
+ existIcon: r,
600
+ className: n,
601
+ style: a,
602
+ mount: i
603
+ } = e, s = !!o;
604
+ return r ? /* @__PURE__ */ c.createElement(dt, {
605
+ prefixCls: t,
606
+ className: n,
607
+ style: a
608
+ }) : /* @__PURE__ */ c.createElement(bt, {
609
+ visible: s,
610
+ // Used for minus flex gap style only
611
+ motionName: `${t}-loading-icon-motion`,
612
+ motionAppear: !i,
613
+ motionEnter: !i,
614
+ motionLeave: !i,
615
+ removeOnLeave: !0,
616
+ onAppearStart: He,
617
+ onAppearActive: ze,
618
+ onEnterStart: He,
619
+ onEnterActive: ze,
620
+ onLeaveStart: ze,
621
+ onLeaveActive: He
622
+ }, (l, u) => {
623
+ let {
624
+ className: d,
625
+ style: g
626
+ } = l;
627
+ const p = Object.assign(Object.assign({}, a), g);
628
+ return /* @__PURE__ */ c.createElement(dt, {
629
+ prefixCls: t,
630
+ className: N(n, d),
631
+ style: p,
632
+ ref: u
633
+ });
634
+ });
635
+ }, mt = (e, t) => ({
636
+ // Border
637
+ [`> span, > ${e}`]: {
638
+ "&:not(:last-child)": {
639
+ [`&, & > ${e}`]: {
640
+ "&:not(:disabled)": {
641
+ borderInlineEndColor: t
642
+ }
643
+ }
644
+ },
645
+ "&:not(:first-child)": {
646
+ [`&, & > ${e}`]: {
647
+ "&:not(:disabled)": {
648
+ borderInlineStartColor: t
649
+ }
650
+ }
651
+ }
652
+ }
653
+ }), lr = (e) => {
654
+ const {
655
+ componentCls: t,
656
+ fontSize: o,
657
+ lineWidth: r,
658
+ groupBorderColor: n,
659
+ colorErrorHover: a
660
+ } = e;
661
+ return {
662
+ [`${t}-group`]: [
663
+ {
664
+ position: "relative",
665
+ display: "inline-flex",
666
+ // Border
667
+ [`> span, > ${t}`]: {
668
+ "&:not(:last-child)": {
669
+ [`&, & > ${t}`]: {
670
+ borderStartEndRadius: 0,
671
+ borderEndEndRadius: 0
672
+ }
673
+ },
674
+ "&:not(:first-child)": {
675
+ marginInlineStart: e.calc(r).mul(-1).equal(),
676
+ [`&, & > ${t}`]: {
677
+ borderStartStartRadius: 0,
678
+ borderEndStartRadius: 0
679
+ }
680
+ }
681
+ },
682
+ [t]: {
683
+ position: "relative",
684
+ zIndex: 1,
685
+ "&:hover, &:focus, &:active": {
686
+ zIndex: 2
687
+ },
688
+ "&[disabled]": {
689
+ zIndex: 0
690
+ }
691
+ },
692
+ [`${t}-icon-only`]: {
693
+ fontSize: o
694
+ }
695
+ },
696
+ // Border Color
697
+ mt(`${t}-primary`, n),
698
+ mt(`${t}-danger`, a)
699
+ ]
700
+ };
701
+ };
702
+ var cr = ["b"], ur = ["v"], Pe = function(t) {
703
+ return Math.round(Number(t || 0));
704
+ }, dr = function(t) {
705
+ if (t instanceof Ot)
706
+ return t;
707
+ if (t && vt(t) === "object" && "h" in t && "b" in t) {
708
+ var o = t, r = o.b, n = Et(o, cr);
709
+ return M(M({}, n), {}, {
710
+ v: r
711
+ });
712
+ }
713
+ return typeof t == "string" && /hsb/.test(t) ? t.replace(/hsb/, "hsv") : t;
714
+ }, U = /* @__PURE__ */ function(e) {
715
+ co(o, e);
716
+ var t = uo(o);
717
+ function o(r) {
718
+ return St(this, o), t.call(this, dr(r));
719
+ }
720
+ return xt(o, [{
721
+ key: "toHsbString",
722
+ value: function() {
723
+ var n = this.toHsb(), a = Pe(n.s * 100), i = Pe(n.b * 100), s = Pe(n.h), l = n.a, u = "hsb(".concat(s, ", ").concat(a, "%, ").concat(i, "%)"), d = "hsba(".concat(s, ", ").concat(a, "%, ").concat(i, "%, ").concat(l.toFixed(l === 0 ? 0 : 2), ")");
724
+ return l === 1 ? u : d;
725
+ }
726
+ }, {
727
+ key: "toHsb",
728
+ value: function() {
729
+ var n = this.toHsv(), a = n.v, i = Et(n, ur);
730
+ return M(M({}, i), {}, {
731
+ b: a,
732
+ a: this.a
733
+ });
734
+ }
735
+ }]), o;
736
+ }(Ot), mr = "rc-color-picker", K = function(t) {
737
+ return t instanceof U ? t : new U(t);
738
+ }, gr = K("#1677ff"), jt = function(t) {
739
+ var o = t.offset, r = t.targetRef, n = t.containerRef, a = t.color, i = t.type, s = n.current.getBoundingClientRect(), l = s.width, u = s.height, d = r.current.getBoundingClientRect(), g = d.width, p = d.height, C = g / 2, h = p / 2, x = (o.x + C) / l, f = 1 - (o.y + h) / u, b = a.toHsb(), w = x, E = (o.x + C) / l * 360;
740
+ if (i)
741
+ switch (i) {
742
+ case "hue":
743
+ return K(M(M({}, b), {}, {
744
+ h: E <= 0 ? 0 : E
745
+ }));
746
+ case "alpha":
747
+ return K(M(M({}, b), {}, {
748
+ a: w <= 0 ? 0 : w
749
+ }));
750
+ }
751
+ return K({
752
+ h: b.h,
753
+ s: x <= 0 ? 0 : x,
754
+ b: f >= 1 ? 1 : f,
755
+ a: b.a
756
+ });
757
+ }, Tt = function(t, o) {
758
+ var r = t.toHsb();
759
+ switch (o) {
760
+ case "hue":
761
+ return {
762
+ x: r.h / 360 * 100,
763
+ y: 50
764
+ };
765
+ case "alpha":
766
+ return {
767
+ x: t.a * 100,
768
+ y: 50
769
+ };
770
+ default:
771
+ return {
772
+ x: r.s * 100,
773
+ y: (1 - r.b) * 100
774
+ };
775
+ }
776
+ }, fr = function(t) {
777
+ var o = t.color, r = t.prefixCls, n = t.className, a = t.style, i = t.onClick, s = "".concat(r, "-color-block");
778
+ return /* @__PURE__ */ c.createElement("div", {
779
+ className: N(s, n),
780
+ style: a,
781
+ onClick: i
782
+ }, /* @__PURE__ */ c.createElement("div", {
783
+ className: "".concat(s, "-inner"),
784
+ style: {
785
+ background: o
786
+ }
787
+ }));
788
+ };
789
+ function pr(e) {
790
+ var t = "touches" in e ? e.touches[0] : e, o = document.documentElement.scrollLeft || document.body.scrollLeft || window.pageXOffset, r = document.documentElement.scrollTop || document.body.scrollTop || window.pageYOffset;
791
+ return {
792
+ pageX: t.pageX - o,
793
+ pageY: t.pageY - r
794
+ };
795
+ }
796
+ function Dt(e) {
797
+ var t = e.targetRef, o = e.containerRef, r = e.direction, n = e.onDragChange, a = e.onDragChangeComplete, i = e.calculate, s = e.color, l = e.disabledDrag, u = je({
798
+ x: 0,
799
+ y: 0
800
+ }), d = J(u, 2), g = d[0], p = d[1], C = D(null), h = D(null);
801
+ te(function() {
802
+ p(i());
803
+ }, [s]), te(function() {
804
+ return function() {
805
+ document.removeEventListener("mousemove", C.current), document.removeEventListener("mouseup", h.current), document.removeEventListener("touchmove", C.current), document.removeEventListener("touchend", h.current), C.current = null, h.current = null;
806
+ };
807
+ }, []);
808
+ var x = function(v) {
809
+ var y = pr(v), B = y.pageX, _ = y.pageY, S = o.current.getBoundingClientRect(), $ = S.x, H = S.y, z = S.width, j = S.height, P = t.current.getBoundingClientRect(), q = P.width, L = P.height, G = q / 2, Z = L / 2, A = Math.max(0, Math.min(B - $, z)) - G, I = Math.max(0, Math.min(_ - H, j)) - Z, Q = {
810
+ x: A,
811
+ y: r === "x" ? g.y : I
812
+ };
813
+ if (q === 0 && L === 0 || q !== L)
814
+ return !1;
815
+ n == null || n(Q);
816
+ }, f = function(v) {
817
+ v.preventDefault(), x(v);
818
+ }, b = function(v) {
819
+ v.preventDefault(), document.removeEventListener("mousemove", C.current), document.removeEventListener("mouseup", h.current), document.removeEventListener("touchmove", C.current), document.removeEventListener("touchend", h.current), C.current = null, h.current = null, a == null || a();
820
+ }, w = function(v) {
821
+ document.removeEventListener("mousemove", C.current), document.removeEventListener("mouseup", h.current), !l && (x(v), document.addEventListener("mousemove", f), document.addEventListener("mouseup", b), document.addEventListener("touchmove", f), document.addEventListener("touchend", b), C.current = f, h.current = b);
822
+ };
823
+ return [g, w];
824
+ }
825
+ var Lt = function(t) {
826
+ var o = t.size, r = o === void 0 ? "default" : o, n = t.color, a = t.prefixCls;
827
+ return /* @__PURE__ */ c.createElement("div", {
828
+ className: N("".concat(a, "-handler"), Te({}, "".concat(a, "-handler-sm"), r === "small")),
829
+ style: {
830
+ backgroundColor: n
831
+ }
832
+ });
833
+ }, At = function(t) {
834
+ var o = t.children, r = t.style, n = t.prefixCls;
835
+ return /* @__PURE__ */ c.createElement("div", {
836
+ className: "".concat(n, "-palette"),
837
+ style: M({
838
+ position: "relative"
839
+ }, r)
840
+ }, o);
841
+ }, Mt = /* @__PURE__ */ me(function(e, t) {
842
+ var o = e.children, r = e.x, n = e.y;
843
+ return /* @__PURE__ */ c.createElement("div", {
844
+ ref: t,
845
+ style: {
846
+ position: "absolute",
847
+ left: "".concat(r, "%"),
848
+ top: "".concat(n, "%"),
849
+ zIndex: 1,
850
+ transform: "translate(-50%, -50%)"
851
+ }
852
+ }, o);
853
+ }), vr = function(t) {
854
+ var o = t.color, r = t.onChange, n = t.prefixCls, a = t.onChangeComplete, i = t.disabled, s = D(), l = D(), u = D(o), d = Fe(function(x) {
855
+ var f = jt({
856
+ offset: x,
857
+ targetRef: l,
858
+ containerRef: s,
859
+ color: o
860
+ });
861
+ u.current = f, r(f);
862
+ }), g = Dt({
863
+ color: o,
864
+ containerRef: s,
865
+ targetRef: l,
866
+ calculate: function() {
867
+ return Tt(o);
868
+ },
869
+ onDragChange: d,
870
+ onDragChangeComplete: function() {
871
+ return a == null ? void 0 : a(u.current);
872
+ },
873
+ disabledDrag: i
874
+ }), p = J(g, 2), C = p[0], h = p[1];
875
+ return /* @__PURE__ */ c.createElement("div", {
876
+ ref: s,
877
+ className: "".concat(n, "-select"),
878
+ onMouseDown: h,
879
+ onTouchStart: h
880
+ }, /* @__PURE__ */ c.createElement(At, {
881
+ prefixCls: n
882
+ }, /* @__PURE__ */ c.createElement(Mt, {
883
+ x: C.x,
884
+ y: C.y,
885
+ ref: l
886
+ }, /* @__PURE__ */ c.createElement(Lt, {
887
+ color: o.toRgbString(),
888
+ prefixCls: n
889
+ })), /* @__PURE__ */ c.createElement("div", {
890
+ className: "".concat(n, "-saturation"),
891
+ style: {
892
+ backgroundColor: "hsl(".concat(o.toHsb().h, ",100%, 50%)"),
893
+ backgroundImage: "linear-gradient(0deg, #000, transparent),linear-gradient(90deg, #fff, hsla(0, 0%, 100%, 0))"
894
+ }
895
+ })));
896
+ }, br = function(t, o) {
897
+ var r = $t(t, {
898
+ value: o
899
+ }), n = J(r, 2), a = n[0], i = n[1], s = oe(function() {
900
+ return K(a);
901
+ }, [a]);
902
+ return [s, i];
903
+ }, Cr = function(t) {
904
+ var o = t.colors, r = t.children, n = t.direction, a = n === void 0 ? "to right" : n, i = t.type, s = t.prefixCls, l = oe(function() {
905
+ return o.map(function(u, d) {
906
+ var g = K(u);
907
+ return i === "alpha" && d === o.length - 1 && (g = new U(g.setA(1))), g.toRgbString();
908
+ }).join(",");
909
+ }, [o, i]);
910
+ return /* @__PURE__ */ c.createElement("div", {
911
+ className: "".concat(s, "-gradient"),
912
+ style: {
913
+ position: "absolute",
914
+ inset: 0,
915
+ background: "linear-gradient(".concat(a, ", ").concat(l, ")")
916
+ }
917
+ }, r);
918
+ }, hr = function(t) {
919
+ var o = t.prefixCls, r = t.colors, n = t.disabled, a = t.onChange, i = t.onChangeComplete, s = t.color, l = t.type, u = D(), d = D(), g = D(s), p = function(y) {
920
+ return l === "hue" ? y.getHue() : y.a * 100;
921
+ }, C = Fe(function(v) {
922
+ var y = jt({
923
+ offset: v,
924
+ targetRef: d,
925
+ containerRef: u,
926
+ color: s,
927
+ type: l
928
+ });
929
+ g.current = y, a(p(y));
930
+ }), h = Dt({
931
+ color: s,
932
+ targetRef: d,
933
+ containerRef: u,
934
+ calculate: function() {
935
+ return Tt(s, l);
936
+ },
937
+ onDragChange: C,
938
+ onDragChangeComplete: function() {
939
+ i(p(g.current));
940
+ },
941
+ direction: "x",
942
+ disabledDrag: n
943
+ }), x = J(h, 2), f = x[0], b = x[1], w = c.useMemo(function() {
944
+ if (l === "hue") {
945
+ var v = s.toHsb();
946
+ v.s = 1, v.b = 1, v.a = 1;
947
+ var y = new U(v);
948
+ return y;
949
+ }
950
+ return s;
951
+ }, [s, l]), E = c.useMemo(function() {
952
+ return r.map(function(v) {
953
+ return "".concat(v.color, " ").concat(v.percent, "%");
954
+ });
955
+ }, [r]);
956
+ return /* @__PURE__ */ c.createElement("div", {
957
+ ref: u,
958
+ className: N("".concat(o, "-slider"), "".concat(o, "-slider-").concat(l)),
959
+ onMouseDown: b,
960
+ onTouchStart: b
961
+ }, /* @__PURE__ */ c.createElement(At, {
962
+ prefixCls: o
963
+ }, /* @__PURE__ */ c.createElement(Mt, {
964
+ x: f.x,
965
+ y: f.y,
966
+ ref: d
967
+ }, /* @__PURE__ */ c.createElement(Lt, {
968
+ size: "small",
969
+ color: w.toHexString(),
970
+ prefixCls: o
971
+ })), /* @__PURE__ */ c.createElement(Cr, {
972
+ colors: E,
973
+ type: l,
974
+ prefixCls: o
975
+ })));
976
+ };
977
+ function yr(e) {
978
+ return m.useMemo(function() {
979
+ var t = e || {}, o = t.slider;
980
+ return [o || hr];
981
+ }, [e]);
982
+ }
983
+ var Sr = [{
984
+ color: "rgb(255, 0, 0)",
985
+ percent: 0
986
+ }, {
987
+ color: "rgb(255, 255, 0)",
988
+ percent: 17
989
+ }, {
990
+ color: "rgb(0, 255, 0)",
991
+ percent: 33
992
+ }, {
993
+ color: "rgb(0, 255, 255)",
994
+ percent: 50
995
+ }, {
996
+ color: "rgb(0, 0, 255)",
997
+ percent: 67
998
+ }, {
999
+ color: "rgb(255, 0, 255)",
1000
+ percent: 83
1001
+ }, {
1002
+ color: "rgb(255, 0, 0)",
1003
+ percent: 100
1004
+ }], xr = /* @__PURE__ */ me(function(e, t) {
1005
+ var o = e.value, r = e.defaultValue, n = e.prefixCls, a = n === void 0 ? mr : n, i = e.onChange, s = e.onChangeComplete, l = e.className, u = e.style, d = e.panelRender, g = e.disabledAlpha, p = g === void 0 ? !1 : g, C = e.disabled, h = C === void 0 ? !1 : C, x = e.components, f = yr(x), b = J(f, 1), w = b[0], E = br(r || gr, o), v = J(E, 2), y = v[0], B = v[1], _ = oe(function() {
1006
+ return y.setA(1).toRgbString();
1007
+ }, [y]), S = function(I, Q) {
1008
+ o || B(I), i == null || i(I, Q);
1009
+ }, $ = function(I) {
1010
+ return new U(y.setHue(I));
1011
+ }, H = function(I) {
1012
+ return new U(y.setA(I / 100));
1013
+ }, z = function(I) {
1014
+ S($(I), {
1015
+ type: "hue",
1016
+ value: I
1017
+ });
1018
+ }, j = function(I) {
1019
+ S(H(I), {
1020
+ type: "alpha",
1021
+ value: I
1022
+ });
1023
+ }, P = function(I) {
1024
+ s && s($(I));
1025
+ }, q = function(I) {
1026
+ s && s(H(I));
1027
+ }, L = N("".concat(a, "-panel"), l, Te({}, "".concat(a, "-panel-disabled"), h)), G = {
1028
+ prefixCls: a,
1029
+ disabled: h,
1030
+ color: y
1031
+ }, Z = /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement(vr, se({
1032
+ onChange: S
1033
+ }, G, {
1034
+ onChangeComplete: s
1035
+ })), /* @__PURE__ */ c.createElement("div", {
1036
+ className: "".concat(a, "-slider-container")
1037
+ }, /* @__PURE__ */ c.createElement("div", {
1038
+ className: N("".concat(a, "-slider-group"), Te({}, "".concat(a, "-slider-group-disabled-alpha"), p))
1039
+ }, /* @__PURE__ */ c.createElement(w, se({}, G, {
1040
+ type: "hue",
1041
+ colors: Sr,
1042
+ min: 0,
1043
+ max: 359,
1044
+ value: y.getHue(),
1045
+ onChange: z,
1046
+ onChangeComplete: P
1047
+ })), !p && /* @__PURE__ */ c.createElement(w, se({}, G, {
1048
+ type: "alpha",
1049
+ colors: [{
1050
+ percent: 0,
1051
+ color: "rgba(255, 0, 4, 0)"
1052
+ }, {
1053
+ percent: 100,
1054
+ color: _
1055
+ }],
1056
+ min: 0,
1057
+ max: 100,
1058
+ value: y.a * 100,
1059
+ onChange: j,
1060
+ onChangeComplete: q
1061
+ }))), /* @__PURE__ */ c.createElement(fr, {
1062
+ color: y.toRgbString(),
1063
+ prefixCls: a
1064
+ })));
1065
+ return /* @__PURE__ */ c.createElement("div", {
1066
+ className: L,
1067
+ style: u,
1068
+ ref: t
1069
+ }, typeof d == "function" ? d(Z) : Z);
1070
+ });
1071
+ process.env.NODE_ENV !== "production" && (xr.displayName = "ColorPicker");
1072
+ const Er = (e, t) => (e == null ? void 0 : e.replace(/[^\w/]/g, "").slice(0, t ? 8 : 6)) || "", Or = (e, t) => e ? Er(e, t) : "";
1073
+ let $r = /* @__PURE__ */ function() {
1074
+ function e(t) {
1075
+ St(this, e);
1076
+ var o;
1077
+ if (this.cleared = !1, t instanceof e) {
1078
+ this.metaColor = t.metaColor.clone(), this.colors = (o = t.colors) === null || o === void 0 ? void 0 : o.map((n) => ({
1079
+ color: new e(n.color),
1080
+ percent: n.percent
1081
+ })), this.cleared = t.cleared;
1082
+ return;
1083
+ }
1084
+ const r = Array.isArray(t);
1085
+ r && t.length ? (this.colors = t.map((n) => {
1086
+ let {
1087
+ color: a,
1088
+ percent: i
1089
+ } = n;
1090
+ return {
1091
+ color: new e(a),
1092
+ percent: i
1093
+ };
1094
+ }), this.metaColor = new U(this.colors[0].color.metaColor)) : this.metaColor = new U(r ? "" : t), (!t || r && !this.colors) && (this.metaColor = this.metaColor.setA(0), this.cleared = !0);
1095
+ }
1096
+ return xt(e, [{
1097
+ key: "toHsb",
1098
+ value: function() {
1099
+ return this.metaColor.toHsb();
1100
+ }
1101
+ }, {
1102
+ key: "toHsbString",
1103
+ value: function() {
1104
+ return this.metaColor.toHsbString();
1105
+ }
1106
+ }, {
1107
+ key: "toHex",
1108
+ value: function() {
1109
+ return Or(this.toHexString(), this.metaColor.a < 1);
1110
+ }
1111
+ }, {
1112
+ key: "toHexString",
1113
+ value: function() {
1114
+ return this.metaColor.toHexString();
1115
+ }
1116
+ }, {
1117
+ key: "toRgb",
1118
+ value: function() {
1119
+ return this.metaColor.toRgb();
1120
+ }
1121
+ }, {
1122
+ key: "toRgbString",
1123
+ value: function() {
1124
+ return this.metaColor.toRgbString();
1125
+ }
1126
+ }, {
1127
+ key: "isGradient",
1128
+ value: function() {
1129
+ return !!this.colors && !this.cleared;
1130
+ }
1131
+ }, {
1132
+ key: "getColors",
1133
+ value: function() {
1134
+ return this.colors || [{
1135
+ color: this,
1136
+ percent: 0
1137
+ }];
1138
+ }
1139
+ }, {
1140
+ key: "toCssString",
1141
+ value: function() {
1142
+ const {
1143
+ colors: o
1144
+ } = this;
1145
+ return o ? `linear-gradient(90deg, ${o.map((n) => `${n.color.toRgbString()} ${n.percent}%`).join(", ")})` : this.metaColor.toRgbString();
1146
+ }
1147
+ }, {
1148
+ key: "equals",
1149
+ value: function(o) {
1150
+ return !o || this.isGradient() !== o.isGradient() ? !1 : this.isGradient() ? this.colors.length === o.colors.length && this.colors.every((r, n) => {
1151
+ const a = o.colors[n];
1152
+ return r.percent === a.percent && r.color.equals(a.color);
1153
+ }) : this.toHexString() === o.toHexString();
1154
+ }
1155
+ }]);
1156
+ }();
1157
+ const Ir = new T("antZoomIn", {
1158
+ "0%": {
1159
+ transform: "scale(0.2)",
1160
+ opacity: 0
1161
+ },
1162
+ "100%": {
1163
+ transform: "scale(1)",
1164
+ opacity: 1
1165
+ }
1166
+ }), Rr = new T("antZoomOut", {
1167
+ "0%": {
1168
+ transform: "scale(1)"
1169
+ },
1170
+ "100%": {
1171
+ transform: "scale(0.2)",
1172
+ opacity: 0
1173
+ }
1174
+ }), gt = new T("antZoomBigIn", {
1175
+ "0%": {
1176
+ transform: "scale(0.8)",
1177
+ opacity: 0
1178
+ },
1179
+ "100%": {
1180
+ transform: "scale(1)",
1181
+ opacity: 1
1182
+ }
1183
+ }), ft = new T("antZoomBigOut", {
1184
+ "0%": {
1185
+ transform: "scale(1)"
1186
+ },
1187
+ "100%": {
1188
+ transform: "scale(0.8)",
1189
+ opacity: 0
1190
+ }
1191
+ }), wr = new T("antZoomUpIn", {
1192
+ "0%": {
1193
+ transform: "scale(0.8)",
1194
+ transformOrigin: "50% 0%",
1195
+ opacity: 0
1196
+ },
1197
+ "100%": {
1198
+ transform: "scale(1)",
1199
+ transformOrigin: "50% 0%"
1200
+ }
1201
+ }), Br = new T("antZoomUpOut", {
1202
+ "0%": {
1203
+ transform: "scale(1)",
1204
+ transformOrigin: "50% 0%"
1205
+ },
1206
+ "100%": {
1207
+ transform: "scale(0.8)",
1208
+ transformOrigin: "50% 0%",
1209
+ opacity: 0
1210
+ }
1211
+ }), Nr = new T("antZoomLeftIn", {
1212
+ "0%": {
1213
+ transform: "scale(0.8)",
1214
+ transformOrigin: "0% 50%",
1215
+ opacity: 0
1216
+ },
1217
+ "100%": {
1218
+ transform: "scale(1)",
1219
+ transformOrigin: "0% 50%"
1220
+ }
1221
+ }), Hr = new T("antZoomLeftOut", {
1222
+ "0%": {
1223
+ transform: "scale(1)",
1224
+ transformOrigin: "0% 50%"
1225
+ },
1226
+ "100%": {
1227
+ transform: "scale(0.8)",
1228
+ transformOrigin: "0% 50%",
1229
+ opacity: 0
1230
+ }
1231
+ }), zr = new T("antZoomRightIn", {
1232
+ "0%": {
1233
+ transform: "scale(0.8)",
1234
+ transformOrigin: "100% 50%",
1235
+ opacity: 0
1236
+ },
1237
+ "100%": {
1238
+ transform: "scale(1)",
1239
+ transformOrigin: "100% 50%"
1240
+ }
1241
+ }), Pr = new T("antZoomRightOut", {
1242
+ "0%": {
1243
+ transform: "scale(1)",
1244
+ transformOrigin: "100% 50%"
1245
+ },
1246
+ "100%": {
1247
+ transform: "scale(0.8)",
1248
+ transformOrigin: "100% 50%",
1249
+ opacity: 0
1250
+ }
1251
+ }), _r = new T("antZoomDownIn", {
1252
+ "0%": {
1253
+ transform: "scale(0.8)",
1254
+ transformOrigin: "50% 100%",
1255
+ opacity: 0
1256
+ },
1257
+ "100%": {
1258
+ transform: "scale(1)",
1259
+ transformOrigin: "50% 100%"
1260
+ }
1261
+ }), jr = new T("antZoomDownOut", {
1262
+ "0%": {
1263
+ transform: "scale(1)",
1264
+ transformOrigin: "50% 100%"
1265
+ },
1266
+ "100%": {
1267
+ transform: "scale(0.8)",
1268
+ transformOrigin: "50% 100%",
1269
+ opacity: 0
1270
+ }
1271
+ }), Tr = {
1272
+ zoom: {
1273
+ inKeyframes: Ir,
1274
+ outKeyframes: Rr
1275
+ },
1276
+ "zoom-big": {
1277
+ inKeyframes: gt,
1278
+ outKeyframes: ft
1279
+ },
1280
+ "zoom-big-fast": {
1281
+ inKeyframes: gt,
1282
+ outKeyframes: ft
1283
+ },
1284
+ "zoom-left": {
1285
+ inKeyframes: Nr,
1286
+ outKeyframes: Hr
1287
+ },
1288
+ "zoom-right": {
1289
+ inKeyframes: zr,
1290
+ outKeyframes: Pr
1291
+ },
1292
+ "zoom-up": {
1293
+ inKeyframes: wr,
1294
+ outKeyframes: Br
1295
+ },
1296
+ "zoom-down": {
1297
+ inKeyframes: _r,
1298
+ outKeyframes: jr
1299
+ }
1300
+ }, En = (e, t) => {
1301
+ const {
1302
+ antCls: o
1303
+ } = e, r = `${o}-${t}`, {
1304
+ inKeyframes: n,
1305
+ outKeyframes: a
1306
+ } = Tr[t];
1307
+ return [mo(r, n, a, t === "zoom-big-fast" ? e.motionDurationFast : e.motionDurationMid), {
1308
+ [`
1309
+ ${r}-enter,
1310
+ ${r}-appear
1311
+ `]: {
1312
+ transform: "scale(0)",
1313
+ opacity: 0,
1314
+ animationTimingFunction: e.motionEaseOutCirc,
1315
+ "&-prepare": {
1316
+ transform: "none"
1317
+ }
1318
+ },
1319
+ [`${r}-leave`]: {
1320
+ animationTimingFunction: e.motionEaseInOutCirc
1321
+ }
1322
+ }];
1323
+ }, Dr = (e, t) => {
1324
+ const {
1325
+ r: o,
1326
+ g: r,
1327
+ b: n,
1328
+ a
1329
+ } = e.toRgb(), i = new U(e.toRgbString()).onBackground(t).toHsv();
1330
+ return a <= 0.5 ? i.v > 0.5 : o * 0.299 + r * 0.587 + n * 0.114 > 192;
1331
+ }, Wt = (e) => {
1332
+ const {
1333
+ paddingInline: t,
1334
+ onlyIconSize: o
1335
+ } = e;
1336
+ return ne(e, {
1337
+ buttonPaddingHorizontal: t,
1338
+ buttonPaddingVertical: 0,
1339
+ buttonIconOnlyFontSize: o
1340
+ });
1341
+ }, Gt = (e) => {
1342
+ var t, o, r, n, a, i;
1343
+ const s = (t = e.contentFontSize) !== null && t !== void 0 ? t : e.fontSize, l = (o = e.contentFontSizeSM) !== null && o !== void 0 ? o : e.fontSize, u = (r = e.contentFontSizeLG) !== null && r !== void 0 ? r : e.fontSizeLG, d = (n = e.contentLineHeight) !== null && n !== void 0 ? n : Re(s), g = (a = e.contentLineHeightSM) !== null && a !== void 0 ? a : Re(l), p = (i = e.contentLineHeightLG) !== null && i !== void 0 ? i : Re(u), C = Dr(new $r(e.colorBgSolid), "#fff") ? "#000" : "#fff", h = Ve.reduce((x, f) => Object.assign(Object.assign({}, x), {
1344
+ [`${f}ShadowColor`]: `0 ${ue(e.controlOutlineWidth)} 0 ${go(e[`${f}1`], e.colorBgContainer)}`
1345
+ }), {});
1346
+ return Object.assign(Object.assign({}, h), {
1347
+ fontWeight: 400,
1348
+ defaultShadow: `0 ${e.controlOutlineWidth}px 0 ${e.controlTmpOutline}`,
1349
+ primaryShadow: `0 ${e.controlOutlineWidth}px 0 ${e.controlOutline}`,
1350
+ dangerShadow: `0 ${e.controlOutlineWidth}px 0 ${e.colorErrorOutline}`,
1351
+ primaryColor: e.colorTextLightSolid,
1352
+ dangerColor: e.colorTextLightSolid,
1353
+ borderColorDisabled: e.colorBorder,
1354
+ defaultGhostColor: e.colorBgContainer,
1355
+ ghostBg: "transparent",
1356
+ defaultGhostBorderColor: e.colorBgContainer,
1357
+ paddingInline: e.paddingContentHorizontal - e.lineWidth,
1358
+ paddingInlineLG: e.paddingContentHorizontal - e.lineWidth,
1359
+ paddingInlineSM: 8 - e.lineWidth,
1360
+ onlyIconSize: "inherit",
1361
+ onlyIconSizeSM: "inherit",
1362
+ onlyIconSizeLG: "inherit",
1363
+ groupBorderColor: e.colorPrimaryHover,
1364
+ linkHoverBg: "transparent",
1365
+ textTextColor: e.colorText,
1366
+ textTextHoverColor: e.colorText,
1367
+ textTextActiveColor: e.colorText,
1368
+ textHoverBg: e.colorFillTertiary,
1369
+ defaultColor: e.colorText,
1370
+ defaultBg: e.colorBgContainer,
1371
+ defaultBorderColor: e.colorBorder,
1372
+ defaultBorderColorDisabled: e.colorBorder,
1373
+ defaultHoverBg: e.colorBgContainer,
1374
+ defaultHoverColor: e.colorPrimaryHover,
1375
+ defaultHoverBorderColor: e.colorPrimaryHover,
1376
+ defaultActiveBg: e.colorBgContainer,
1377
+ defaultActiveColor: e.colorPrimaryActive,
1378
+ defaultActiveBorderColor: e.colorPrimaryActive,
1379
+ solidTextColor: C,
1380
+ contentFontSize: s,
1381
+ contentFontSizeSM: l,
1382
+ contentFontSizeLG: u,
1383
+ contentLineHeight: d,
1384
+ contentLineHeightSM: g,
1385
+ contentLineHeightLG: p,
1386
+ paddingBlock: Math.max((e.controlHeight - s * d) / 2 - e.lineWidth, 0),
1387
+ paddingBlockSM: Math.max((e.controlHeightSM - l * g) / 2 - e.lineWidth, 0),
1388
+ paddingBlockLG: Math.max((e.controlHeightLG - u * p) / 2 - e.lineWidth, 0)
1389
+ });
1390
+ }, Lr = (e) => {
1391
+ const {
1392
+ componentCls: t,
1393
+ iconCls: o,
1394
+ fontWeight: r,
1395
+ opacityLoading: n,
1396
+ motionDurationSlow: a,
1397
+ motionEaseInOut: i,
1398
+ marginXS: s,
1399
+ calc: l
1400
+ } = e;
1401
+ return {
1402
+ [t]: {
1403
+ outline: "none",
1404
+ position: "relative",
1405
+ display: "inline-flex",
1406
+ gap: e.marginXS,
1407
+ alignItems: "center",
1408
+ justifyContent: "center",
1409
+ fontWeight: r,
1410
+ whiteSpace: "nowrap",
1411
+ textAlign: "center",
1412
+ backgroundImage: "none",
1413
+ background: "transparent",
1414
+ border: `${ue(e.lineWidth)} ${e.lineType} transparent`,
1415
+ cursor: "pointer",
1416
+ transition: `all ${e.motionDurationMid} ${e.motionEaseInOut}`,
1417
+ userSelect: "none",
1418
+ touchAction: "manipulation",
1419
+ color: e.colorText,
1420
+ "&:disabled > *": {
1421
+ pointerEvents: "none"
1422
+ },
1423
+ // https://github.com/ant-design/ant-design/issues/51380
1424
+ [`${t}-icon > svg`]: po(),
1425
+ "> a": {
1426
+ color: "currentColor"
1427
+ },
1428
+ "&:not(:disabled)": fo(e),
1429
+ [`&${t}-two-chinese-chars::first-letter`]: {
1430
+ letterSpacing: "0.34em"
1431
+ },
1432
+ [`&${t}-two-chinese-chars > *:not(${o})`]: {
1433
+ marginInlineEnd: "-0.34em",
1434
+ letterSpacing: "0.34em"
1435
+ },
1436
+ [`&${t}-icon-only`]: {
1437
+ paddingInline: 0,
1438
+ // make `btn-icon-only` not too narrow
1439
+ [`&${t}-compact-item`]: {
1440
+ flex: "none"
1441
+ },
1442
+ [`&${t}-round`]: {
1443
+ width: "auto"
1444
+ }
1445
+ },
1446
+ // Loading
1447
+ [`&${t}-loading`]: {
1448
+ opacity: n,
1449
+ cursor: "default"
1450
+ },
1451
+ [`${t}-loading-icon`]: {
1452
+ transition: ["width", "opacity", "margin"].map((u) => `${u} ${a} ${i}`).join(",")
1453
+ },
1454
+ // iconPosition
1455
+ [`&:not(${t}-icon-end)`]: {
1456
+ [`${t}-loading-icon-motion`]: {
1457
+ "&-appear-start, &-enter-start": {
1458
+ marginInlineEnd: l(s).mul(-1).equal()
1459
+ },
1460
+ "&-appear-active, &-enter-active": {
1461
+ marginInlineEnd: 0
1462
+ },
1463
+ "&-leave-start": {
1464
+ marginInlineEnd: 0
1465
+ },
1466
+ "&-leave-active": {
1467
+ marginInlineEnd: l(s).mul(-1).equal()
1468
+ }
1469
+ }
1470
+ },
1471
+ "&-icon-end": {
1472
+ flexDirection: "row-reverse",
1473
+ [`${t}-loading-icon-motion`]: {
1474
+ "&-appear-start, &-enter-start": {
1475
+ marginInlineStart: l(s).mul(-1).equal()
1476
+ },
1477
+ "&-appear-active, &-enter-active": {
1478
+ marginInlineStart: 0
1479
+ },
1480
+ "&-leave-start": {
1481
+ marginInlineStart: 0
1482
+ },
1483
+ "&-leave-active": {
1484
+ marginInlineStart: l(s).mul(-1).equal()
1485
+ }
1486
+ }
1487
+ }
1488
+ }
1489
+ };
1490
+ }, Ft = (e, t, o) => ({
1491
+ [`&:not(:disabled):not(${e}-disabled)`]: {
1492
+ "&:hover": t,
1493
+ "&:active": o
1494
+ }
1495
+ }), Ar = (e) => ({
1496
+ minWidth: e.controlHeight,
1497
+ paddingInlineStart: 0,
1498
+ paddingInlineEnd: 0,
1499
+ borderRadius: "50%"
1500
+ }), Mr = (e) => ({
1501
+ borderRadius: e.controlHeight,
1502
+ paddingInlineStart: e.calc(e.controlHeight).div(2).equal(),
1503
+ paddingInlineEnd: e.calc(e.controlHeight).div(2).equal()
1504
+ }), Wr = (e) => ({
1505
+ cursor: "not-allowed",
1506
+ borderColor: e.borderColorDisabled,
1507
+ color: e.colorTextDisabled,
1508
+ background: e.colorBgContainerDisabled,
1509
+ boxShadow: "none"
1510
+ }), pe = (e, t, o, r, n, a, i, s) => ({
1511
+ [`&${e}-background-ghost`]: Object.assign(Object.assign({
1512
+ color: o || void 0,
1513
+ background: t,
1514
+ borderColor: r || void 0,
1515
+ boxShadow: "none"
1516
+ }, Ft(e, Object.assign({
1517
+ background: t
1518
+ }, i), Object.assign({
1519
+ background: t
1520
+ }, s))), {
1521
+ "&:disabled": {
1522
+ cursor: "not-allowed",
1523
+ color: n || void 0,
1524
+ borderColor: a || void 0
1525
+ }
1526
+ })
1527
+ }), Gr = (e) => ({
1528
+ [`&:disabled, &${e.componentCls}-disabled`]: Object.assign({}, Wr(e))
1529
+ }), Fr = (e) => ({
1530
+ [`&:disabled, &${e.componentCls}-disabled`]: {
1531
+ cursor: "not-allowed",
1532
+ color: e.colorTextDisabled
1533
+ }
1534
+ }), ve = (e, t, o, r) => {
1535
+ const a = r && ["link", "text"].includes(r) ? Fr : Gr;
1536
+ return Object.assign(Object.assign({}, a(e)), Ft(e.componentCls, t, o));
1537
+ }, be = (e, t, o, r, n) => ({
1538
+ [`&${e.componentCls}-variant-solid`]: Object.assign({
1539
+ color: t,
1540
+ background: o
1541
+ }, ve(e, r, n))
1542
+ }), Ce = (e, t, o, r, n) => ({
1543
+ [`&${e.componentCls}-variant-outlined, &${e.componentCls}-variant-dashed`]: Object.assign({
1544
+ borderColor: t,
1545
+ background: o
1546
+ }, ve(e, r, n))
1547
+ }), he = (e) => ({
1548
+ [`&${e.componentCls}-variant-dashed`]: {
1549
+ borderStyle: "dashed"
1550
+ }
1551
+ }), ye = (e, t, o, r) => ({
1552
+ [`&${e.componentCls}-variant-filled`]: Object.assign({
1553
+ boxShadow: "none",
1554
+ background: t
1555
+ }, ve(e, o, r))
1556
+ }), W = (e, t, o, r, n) => ({
1557
+ [`&${e.componentCls}-variant-${o}`]: Object.assign({
1558
+ color: t,
1559
+ boxShadow: "none"
1560
+ }, ve(e, r, n, o))
1561
+ }), Vr = (e) => {
1562
+ const {
1563
+ componentCls: t
1564
+ } = e;
1565
+ return Ve.reduce((o, r) => {
1566
+ const n = e[`${r}6`], a = e[`${r}1`], i = e[`${r}5`], s = e[`${r}2`], l = e[`${r}3`], u = e[`${r}7`];
1567
+ return Object.assign(Object.assign({}, o), {
1568
+ [`&${t}-color-${r}`]: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
1569
+ color: n,
1570
+ boxShadow: e[`${r}ShadowColor`]
1571
+ }, be(e, e.colorTextLightSolid, n, {
1572
+ background: i
1573
+ }, {
1574
+ background: u
1575
+ })), Ce(e, n, e.colorBgContainer, {
1576
+ color: i,
1577
+ borderColor: i,
1578
+ background: e.colorBgContainer
1579
+ }, {
1580
+ color: u,
1581
+ borderColor: u,
1582
+ background: e.colorBgContainer
1583
+ })), he(e)), ye(e, a, {
1584
+ background: s
1585
+ }, {
1586
+ background: l
1587
+ })), W(e, n, "link", {
1588
+ color: i
1589
+ }, {
1590
+ color: u
1591
+ })), W(e, n, "text", {
1592
+ color: i,
1593
+ background: a
1594
+ }, {
1595
+ color: u,
1596
+ background: l
1597
+ }))
1598
+ });
1599
+ }, {});
1600
+ }, Ur = (e) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
1601
+ color: e.defaultColor,
1602
+ boxShadow: e.defaultShadow
1603
+ }, be(e, e.solidTextColor, e.colorBgSolid, {
1604
+ color: e.solidTextColor,
1605
+ background: e.colorBgSolidHover
1606
+ }, {
1607
+ color: e.solidTextColor,
1608
+ background: e.colorBgSolidActive
1609
+ })), he(e)), ye(e, e.colorFillTertiary, {
1610
+ background: e.colorFillSecondary
1611
+ }, {
1612
+ background: e.colorFill
1613
+ })), pe(e.componentCls, e.ghostBg, e.defaultGhostColor, e.defaultGhostBorderColor, e.colorTextDisabled, e.colorBorder)), W(e, e.textTextColor, "link", {
1614
+ color: e.colorLinkHover,
1615
+ background: e.linkHoverBg
1616
+ }, {
1617
+ color: e.colorLinkActive
1618
+ })), qr = (e) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
1619
+ color: e.colorPrimary,
1620
+ boxShadow: e.primaryShadow
1621
+ }, Ce(e, e.colorPrimary, e.colorBgContainer, {
1622
+ color: e.colorPrimaryTextHover,
1623
+ borderColor: e.colorPrimaryHover,
1624
+ background: e.colorBgContainer
1625
+ }, {
1626
+ color: e.colorPrimaryTextActive,
1627
+ borderColor: e.colorPrimaryActive,
1628
+ background: e.colorBgContainer
1629
+ })), he(e)), ye(e, e.colorPrimaryBg, {
1630
+ background: e.colorPrimaryBgHover
1631
+ }, {
1632
+ background: e.colorPrimaryBorder
1633
+ })), W(e, e.colorPrimaryText, "text", {
1634
+ color: e.colorPrimaryTextHover,
1635
+ background: e.colorPrimaryBg
1636
+ }, {
1637
+ color: e.colorPrimaryTextActive,
1638
+ background: e.colorPrimaryBorder
1639
+ })), W(e, e.colorPrimaryText, "link", {
1640
+ color: e.colorPrimaryTextHover,
1641
+ background: e.linkHoverBg
1642
+ }, {
1643
+ color: e.colorPrimaryTextActive
1644
+ })), pe(e.componentCls, e.ghostBg, e.colorPrimary, e.colorPrimary, e.colorTextDisabled, e.colorBorder, {
1645
+ color: e.colorPrimaryHover,
1646
+ borderColor: e.colorPrimaryHover
1647
+ }, {
1648
+ color: e.colorPrimaryActive,
1649
+ borderColor: e.colorPrimaryActive
1650
+ })), Xr = (e) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
1651
+ color: e.colorError,
1652
+ boxShadow: e.dangerShadow
1653
+ }, be(e, e.dangerColor, e.colorError, {
1654
+ background: e.colorErrorHover
1655
+ }, {
1656
+ background: e.colorErrorActive
1657
+ })), Ce(e, e.colorError, e.colorBgContainer, {
1658
+ color: e.colorErrorHover,
1659
+ borderColor: e.colorErrorBorderHover
1660
+ }, {
1661
+ color: e.colorErrorActive,
1662
+ borderColor: e.colorErrorActive
1663
+ })), he(e)), ye(e, e.colorErrorBg, {
1664
+ background: e.colorErrorBgFilledHover
1665
+ }, {
1666
+ background: e.colorErrorBgActive
1667
+ })), W(e, e.colorError, "text", {
1668
+ color: e.colorErrorHover,
1669
+ background: e.colorErrorBg
1670
+ }, {
1671
+ color: e.colorErrorHover,
1672
+ background: e.colorErrorBgActive
1673
+ })), W(e, e.colorError, "link", {
1674
+ color: e.colorErrorHover
1675
+ }, {
1676
+ color: e.colorErrorActive
1677
+ })), pe(e.componentCls, e.ghostBg, e.colorError, e.colorError, e.colorTextDisabled, e.colorBorder, {
1678
+ color: e.colorErrorHover,
1679
+ borderColor: e.colorErrorHover
1680
+ }, {
1681
+ color: e.colorErrorActive,
1682
+ borderColor: e.colorErrorActive
1683
+ })), Zr = (e) => Object.assign(Object.assign({}, W(e, e.colorLink, "link", {
1684
+ color: e.colorLinkHover
1685
+ }, {
1686
+ color: e.colorLinkActive
1687
+ })), pe(e.componentCls, e.ghostBg, e.colorInfo, e.colorInfo, e.colorTextDisabled, e.colorBorder, {
1688
+ color: e.colorInfoHover,
1689
+ borderColor: e.colorInfoHover
1690
+ }, {
1691
+ color: e.colorInfoActive,
1692
+ borderColor: e.colorInfoActive
1693
+ })), Yr = (e) => {
1694
+ const {
1695
+ componentCls: t
1696
+ } = e;
1697
+ return Object.assign({
1698
+ [`${t}-color-default`]: Ur(e),
1699
+ [`${t}-color-primary`]: qr(e),
1700
+ [`${t}-color-dangerous`]: Xr(e),
1701
+ [`${t}-color-link`]: Zr(e)
1702
+ }, Vr(e));
1703
+ }, Kr = (e) => Object.assign(Object.assign(Object.assign(Object.assign({}, Ce(e, e.defaultBorderColor, e.defaultBg, {
1704
+ color: e.defaultHoverColor,
1705
+ borderColor: e.defaultHoverBorderColor,
1706
+ background: e.defaultHoverBg
1707
+ }, {
1708
+ color: e.defaultActiveColor,
1709
+ borderColor: e.defaultActiveBorderColor,
1710
+ background: e.defaultActiveBg
1711
+ })), W(e, e.textTextColor, "text", {
1712
+ color: e.textTextHoverColor,
1713
+ background: e.textHoverBg
1714
+ }, {
1715
+ color: e.textTextActiveColor,
1716
+ background: e.colorBgTextActive
1717
+ })), be(e, e.primaryColor, e.colorPrimary, {
1718
+ background: e.colorPrimaryHover,
1719
+ color: e.primaryColor
1720
+ }, {
1721
+ background: e.colorPrimaryActive,
1722
+ color: e.primaryColor
1723
+ })), W(e, e.colorLink, "link", {
1724
+ color: e.colorLinkHover,
1725
+ background: e.linkHoverBg
1726
+ }, {
1727
+ color: e.colorLinkActive
1728
+ })), Ue = function(e) {
1729
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
1730
+ const {
1731
+ componentCls: o,
1732
+ controlHeight: r,
1733
+ fontSize: n,
1734
+ borderRadius: a,
1735
+ buttonPaddingHorizontal: i,
1736
+ iconCls: s,
1737
+ buttonPaddingVertical: l,
1738
+ buttonIconOnlyFontSize: u
1739
+ } = e;
1740
+ return [
1741
+ {
1742
+ [t]: {
1743
+ fontSize: n,
1744
+ height: r,
1745
+ padding: `${ue(l)} ${ue(i)}`,
1746
+ borderRadius: a,
1747
+ [`&${o}-icon-only`]: {
1748
+ width: r,
1749
+ [s]: {
1750
+ fontSize: u
1751
+ }
1752
+ }
1753
+ }
1754
+ },
1755
+ // Shape - patch prefixCls again to override solid border radius style
1756
+ {
1757
+ [`${o}${o}-circle${t}`]: Ar(e)
1758
+ },
1759
+ {
1760
+ [`${o}${o}-round${t}`]: Mr(e)
1761
+ }
1762
+ ];
1763
+ }, Jr = (e) => {
1764
+ const t = ne(e, {
1765
+ fontSize: e.contentFontSize
1766
+ });
1767
+ return Ue(t, e.componentCls);
1768
+ }, Qr = (e) => {
1769
+ const t = ne(e, {
1770
+ controlHeight: e.controlHeightSM,
1771
+ fontSize: e.contentFontSizeSM,
1772
+ padding: e.paddingXS,
1773
+ buttonPaddingHorizontal: e.paddingInlineSM,
1774
+ buttonPaddingVertical: 0,
1775
+ borderRadius: e.borderRadiusSM,
1776
+ buttonIconOnlyFontSize: e.onlyIconSizeSM
1777
+ });
1778
+ return Ue(t, `${e.componentCls}-sm`);
1779
+ }, kr = (e) => {
1780
+ const t = ne(e, {
1781
+ controlHeight: e.controlHeightLG,
1782
+ fontSize: e.contentFontSizeLG,
1783
+ buttonPaddingHorizontal: e.paddingInlineLG,
1784
+ buttonPaddingVertical: 0,
1785
+ borderRadius: e.borderRadiusLG,
1786
+ buttonIconOnlyFontSize: e.onlyIconSizeLG
1787
+ });
1788
+ return Ue(t, `${e.componentCls}-lg`);
1789
+ }, en = (e) => {
1790
+ const {
1791
+ componentCls: t
1792
+ } = e;
1793
+ return {
1794
+ [t]: {
1795
+ [`&${t}-block`]: {
1796
+ width: "100%"
1797
+ }
1798
+ }
1799
+ };
1800
+ }, tn = ht("Button", (e) => {
1801
+ const t = Wt(e);
1802
+ return [
1803
+ // Shared
1804
+ Lr(t),
1805
+ // Size
1806
+ Jr(t),
1807
+ Qr(t),
1808
+ kr(t),
1809
+ // Block
1810
+ en(t),
1811
+ // Color
1812
+ Yr(t),
1813
+ // https://github.com/ant-design/ant-design/issues/50969
1814
+ Kr(t),
1815
+ // Button Group
1816
+ lr(t)
1817
+ ];
1818
+ }, Gt, {
1819
+ unitless: {
1820
+ fontWeight: !0,
1821
+ contentLineHeight: !0,
1822
+ contentLineHeightSM: !0,
1823
+ contentLineHeightLG: !0
1824
+ }
1825
+ });
1826
+ function on(e, t, o) {
1827
+ const {
1828
+ focusElCls: r,
1829
+ focus: n,
1830
+ borderElCls: a
1831
+ } = o, i = a ? "> *" : "", s = ["hover", n ? "focus" : null, "active"].filter(Boolean).map((l) => `&:${l} ${i}`).join(",");
1832
+ return {
1833
+ [`&-item:not(${t}-last-item)`]: {
1834
+ marginInlineEnd: e.calc(e.lineWidth).mul(-1).equal()
1835
+ },
1836
+ "&-item": Object.assign(Object.assign({
1837
+ [s]: {
1838
+ zIndex: 2
1839
+ }
1840
+ }, r ? {
1841
+ [`&${r}`]: {
1842
+ zIndex: 2
1843
+ }
1844
+ } : {}), {
1845
+ [`&[disabled] ${i}`]: {
1846
+ zIndex: 0
1847
+ }
1848
+ })
1849
+ };
1850
+ }
1851
+ function rn(e, t, o) {
1852
+ const {
1853
+ borderElCls: r
1854
+ } = o, n = r ? `> ${r}` : "";
1855
+ return {
1856
+ [`&-item:not(${t}-first-item):not(${t}-last-item) ${n}`]: {
1857
+ borderRadius: 0
1858
+ },
1859
+ [`&-item:not(${t}-last-item)${t}-first-item`]: {
1860
+ [`& ${n}, &${e}-sm ${n}, &${e}-lg ${n}`]: {
1861
+ borderStartEndRadius: 0,
1862
+ borderEndEndRadius: 0
1863
+ }
1864
+ },
1865
+ [`&-item:not(${t}-first-item)${t}-last-item`]: {
1866
+ [`& ${n}, &${e}-sm ${n}, &${e}-lg ${n}`]: {
1867
+ borderStartStartRadius: 0,
1868
+ borderEndStartRadius: 0
1869
+ }
1870
+ }
1871
+ };
1872
+ }
1873
+ function nn(e) {
1874
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
1875
+ focus: !0
1876
+ };
1877
+ const {
1878
+ componentCls: o
1879
+ } = e, r = `${o}-compact`;
1880
+ return {
1881
+ [r]: Object.assign(Object.assign({}, on(e, r, t)), rn(o, r, t))
1882
+ };
1883
+ }
1884
+ function an(e, t) {
1885
+ return {
1886
+ // border collapse
1887
+ [`&-item:not(${t}-last-item)`]: {
1888
+ marginBottom: e.calc(e.lineWidth).mul(-1).equal()
1889
+ },
1890
+ "&-item": {
1891
+ "&:hover,&:focus,&:active": {
1892
+ zIndex: 2
1893
+ },
1894
+ "&[disabled]": {
1895
+ zIndex: 0
1896
+ }
1897
+ }
1898
+ };
1899
+ }
1900
+ function sn(e, t) {
1901
+ return {
1902
+ [`&-item:not(${t}-first-item):not(${t}-last-item)`]: {
1903
+ borderRadius: 0
1904
+ },
1905
+ [`&-item${t}-first-item:not(${t}-last-item)`]: {
1906
+ [`&, &${e}-sm, &${e}-lg`]: {
1907
+ borderEndEndRadius: 0,
1908
+ borderEndStartRadius: 0
1909
+ }
1910
+ },
1911
+ [`&-item${t}-last-item:not(${t}-first-item)`]: {
1912
+ [`&, &${e}-sm, &${e}-lg`]: {
1913
+ borderStartStartRadius: 0,
1914
+ borderStartEndRadius: 0
1915
+ }
1916
+ }
1917
+ };
1918
+ }
1919
+ function ln(e) {
1920
+ const t = `${e.componentCls}-compact-vertical`;
1921
+ return {
1922
+ [t]: Object.assign(Object.assign({}, an(e, t)), sn(e.componentCls, t))
1923
+ };
1924
+ }
1925
+ const cn = (e) => {
1926
+ const {
1927
+ componentCls: t,
1928
+ colorPrimaryHover: o,
1929
+ lineWidth: r,
1930
+ calc: n
1931
+ } = e, a = n(r).mul(-1).equal(), i = (s) => {
1932
+ const l = `${t}-compact${s ? "-vertical" : ""}-item${t}-primary:not([disabled])`;
1933
+ return {
1934
+ [`${l} + ${l}::before`]: {
1935
+ position: "absolute",
1936
+ top: s ? a : 0,
1937
+ insetInlineStart: s ? 0 : a,
1938
+ backgroundColor: o,
1939
+ content: '""',
1940
+ width: s ? "100%" : r,
1941
+ height: s ? r : "100%"
1942
+ }
1943
+ };
1944
+ };
1945
+ return Object.assign(Object.assign({}, i()), i(!0));
1946
+ }, un = vo(["Button", "compact"], (e) => {
1947
+ const t = Wt(e);
1948
+ return [
1949
+ // Space Compact
1950
+ nn(t),
1951
+ ln(t),
1952
+ cn(t)
1953
+ ];
1954
+ }, Gt);
1955
+ var dn = function(e, t) {
1956
+ var o = {};
1957
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
1958
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var n = 0, r = Object.getOwnPropertySymbols(e); n < r.length; n++)
1959
+ t.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[n]) && (o[r[n]] = e[r[n]]);
1960
+ return o;
1961
+ };
1962
+ function mn(e) {
1963
+ if (typeof e == "object" && e) {
1964
+ let t = e == null ? void 0 : e.delay;
1965
+ return t = !Number.isNaN(t) && typeof t == "number" ? t : 0, {
1966
+ loading: t <= 0,
1967
+ delay: t
1968
+ };
1969
+ }
1970
+ return {
1971
+ loading: !!e,
1972
+ delay: 0
1973
+ };
1974
+ }
1975
+ const gn = {
1976
+ default: ["default", "outlined"],
1977
+ primary: ["primary", "solid"],
1978
+ dashed: ["default", "dashed"],
1979
+ // `link` is not a real color but we should compatible with it
1980
+ link: ["link", "link"],
1981
+ text: ["default", "text"]
1982
+ }, fn = /* @__PURE__ */ c.forwardRef((e, t) => {
1983
+ var o, r;
1984
+ const {
1985
+ loading: n = !1,
1986
+ prefixCls: a,
1987
+ color: i,
1988
+ variant: s,
1989
+ type: l,
1990
+ danger: u = !1,
1991
+ shape: d = "default",
1992
+ size: g,
1993
+ styles: p,
1994
+ disabled: C,
1995
+ className: h,
1996
+ rootClassName: x,
1997
+ children: f,
1998
+ icon: b,
1999
+ iconPosition: w = "start",
2000
+ ghost: E = !1,
2001
+ block: v = !1,
2002
+ // React does not recognize the `htmlType` prop on a DOM element. Here we pick it out of `rest`.
2003
+ htmlType: y = "button",
2004
+ classNames: B,
2005
+ style: _ = {},
2006
+ autoInsertSpace: S,
2007
+ autoFocus: $
2008
+ } = e, H = dn(e, ["loading", "prefixCls", "color", "variant", "type", "danger", "shape", "size", "styles", "disabled", "className", "rootClassName", "children", "icon", "iconPosition", "ghost", "block", "htmlType", "classNames", "style", "autoInsertSpace", "autoFocus"]), z = l || "default", [j, P] = oe(() => {
2009
+ if (i && s)
2010
+ return [i, s];
2011
+ const R = gn[z] || [];
2012
+ return u ? ["danger", R[1]] : R;
2013
+ }, [l, i, s, u]), L = j === "danger" ? "dangerous" : j, {
2014
+ getPrefixCls: G,
2015
+ direction: Z,
2016
+ autoInsertSpace: A,
2017
+ className: I,
2018
+ style: Q,
2019
+ classNames: Vt,
2020
+ styles: Ut
2021
+ } = bo("button"), Se = (o = S ?? A) !== null && o !== void 0 ? o : !0, O = G("btn", a), [Xe, qt, Xt] = tn(O), Zt = _e(Co), Y = C ?? Zt, Yt = _e(_t), k = oe(() => mn(n), [n]), [X, Ze] = je(k.loading), [xe, Ye] = je(!1), ee = D(null), Ke = ho(t, ee), Je = kt.count(f) === 1 && !b && !ie(P), Ee = D(!0);
2022
+ c.useEffect(() => (Ee.current = !1, () => {
2023
+ Ee.current = !0;
2024
+ }), []), te(() => {
2025
+ let R = null;
2026
+ k.delay > 0 ? R = setTimeout(() => {
2027
+ R = null, Ze(!0);
2028
+ }, k.delay) : Ze(k.loading);
2029
+ function F() {
2030
+ R && (clearTimeout(R), R = null);
2031
+ }
2032
+ return F;
2033
+ }, [k]), te(() => {
2034
+ if (!ee.current || !Se)
2035
+ return;
2036
+ const R = ee.current.textContent || "";
2037
+ Je && Ae(R) ? xe || Ye(!0) : xe && Ye(!1);
2038
+ }), te(() => {
2039
+ $ && ee.current && ee.current.focus();
2040
+ }, []);
2041
+ const Qe = c.useCallback((R) => {
2042
+ var F;
2043
+ if (X || Y) {
2044
+ R.preventDefault();
2045
+ return;
2046
+ }
2047
+ (F = e.onClick) === null || F === void 0 || F.call(e, ("href" in e, R));
2048
+ }, [e.onClick, X, Y]);
2049
+ if (process.env.NODE_ENV !== "production") {
2050
+ const R = Ge("Button");
2051
+ process.env.NODE_ENV !== "production" && R(!(typeof b == "string" && b.length > 2), "breaking", `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${b}\` at https://ant.design/components/icon`), process.env.NODE_ENV !== "production" && R(!(E && ie(P)), "usage", "`link` or `text` button can't be a `ghost` button.");
2052
+ }
2053
+ const {
2054
+ compactSize: Kt,
2055
+ compactItemClassnames: ke
2056
+ } = er(O, Z), Jt = {
2057
+ large: "lg",
2058
+ small: "sm",
2059
+ middle: void 0
2060
+ }, et = yt((R) => {
2061
+ var F, Ie;
2062
+ return (Ie = (F = g ?? Kt) !== null && F !== void 0 ? F : Yt) !== null && Ie !== void 0 ? Ie : R;
2063
+ }), tt = et && (r = Jt[et]) !== null && r !== void 0 ? r : "", Qt = X ? "loading" : b, Oe = yo(H, ["navigate"]), ot = N(O, qt, Xt, {
2064
+ [`${O}-${d}`]: d !== "default" && d,
2065
+ // line(253 - 254): Compatible with versions earlier than 5.21.0
2066
+ [`${O}-${z}`]: z,
2067
+ [`${O}-dangerous`]: u,
2068
+ [`${O}-color-${L}`]: L,
2069
+ [`${O}-variant-${P}`]: P,
2070
+ [`${O}-${tt}`]: tt,
2071
+ [`${O}-icon-only`]: !f && f !== 0 && !!Qt,
2072
+ [`${O}-background-ghost`]: E && !ie(P),
2073
+ [`${O}-loading`]: X,
2074
+ [`${O}-two-chinese-chars`]: xe && Se && !X,
2075
+ [`${O}-block`]: v,
2076
+ [`${O}-rtl`]: Z === "rtl",
2077
+ [`${O}-icon-end`]: w === "end"
2078
+ }, ke, h, x, I), rt = Object.assign(Object.assign({}, Q), _), nt = N(B == null ? void 0 : B.icon, Vt.icon), at = Object.assign(Object.assign({}, (p == null ? void 0 : p.icon) || {}), Ut.icon || {}), it = b && !X ? /* @__PURE__ */ c.createElement(Me, {
2079
+ prefixCls: O,
2080
+ className: nt,
2081
+ style: at
2082
+ }, b) : n && typeof n == "object" && n.icon ? /* @__PURE__ */ c.createElement(Me, {
2083
+ prefixCls: O,
2084
+ className: nt,
2085
+ style: at
2086
+ }, n.icon) : /* @__PURE__ */ c.createElement(sr, {
2087
+ existIcon: !!b,
2088
+ prefixCls: O,
2089
+ loading: X,
2090
+ mount: Ee.current
2091
+ }), st = f || f === 0 ? ir(f, Je && Se) : null;
2092
+ if (Oe.href !== void 0)
2093
+ return Xe(/* @__PURE__ */ c.createElement("a", Object.assign({}, Oe, {
2094
+ className: N(ot, {
2095
+ [`${O}-disabled`]: Y
2096
+ }),
2097
+ href: Y ? void 0 : Oe.href,
2098
+ style: rt,
2099
+ onClick: Qe,
2100
+ ref: Ke,
2101
+ tabIndex: Y ? -1 : 0
2102
+ }), it, st));
2103
+ let $e = /* @__PURE__ */ c.createElement("button", Object.assign({}, H, {
2104
+ type: y,
2105
+ className: ot,
2106
+ style: rt,
2107
+ onClick: Qe,
2108
+ disabled: Y,
2109
+ ref: Ke
2110
+ }), it, st, ke && /* @__PURE__ */ c.createElement(un, {
2111
+ prefixCls: O
2112
+ }));
2113
+ return ie(P) || ($e = /* @__PURE__ */ c.createElement(zt, {
2114
+ component: "Button",
2115
+ disabled: X
2116
+ }, $e)), Xe($e);
2117
+ }), qe = fn;
2118
+ qe.Group = nr;
2119
+ qe.__ANT_BUTTON = !0;
2120
+ process.env.NODE_ENV !== "production" && (qe.displayName = "Button");
2121
+ const On = (e) => {
2122
+ const {
2123
+ space: t,
2124
+ form: o,
2125
+ children: r
2126
+ } = e;
2127
+ if (r == null)
2128
+ return null;
2129
+ let n = r;
2130
+ return o && (n = /* @__PURE__ */ c.createElement(So, {
2131
+ override: !0,
2132
+ status: !0
2133
+ }, n)), t && (n = /* @__PURE__ */ c.createElement(tr, null, n)), n;
2134
+ };
2135
+ function pn(e) {
2136
+ return (t) => /* @__PURE__ */ m.createElement(xo, {
2137
+ theme: {
2138
+ token: {
2139
+ motion: !1,
2140
+ zIndexPopupBase: 0
2141
+ }
2142
+ }
2143
+ }, /* @__PURE__ */ m.createElement(e, Object.assign({}, t)));
2144
+ }
2145
+ const $n = (e, t, o, r, n) => pn((i) => {
2146
+ const {
2147
+ prefixCls: s,
2148
+ style: l
2149
+ } = i, u = m.useRef(null), [d, g] = m.useState(0), [p, C] = m.useState(0), [h, x] = $t(!1, {
2150
+ value: i.open
2151
+ }), {
2152
+ getPrefixCls: f
2153
+ } = m.useContext(re), b = f(r, s);
2154
+ m.useEffect(() => {
2155
+ if (x(!0), typeof ResizeObserver < "u") {
2156
+ const v = new ResizeObserver((B) => {
2157
+ const _ = B[0].target;
2158
+ g(_.offsetHeight + 8), C(_.offsetWidth);
2159
+ }), y = setInterval(() => {
2160
+ var B;
2161
+ const _ = n ? `.${n(b)}` : `.${b}-dropdown`, S = (B = u.current) === null || B === void 0 ? void 0 : B.querySelector(_);
2162
+ S && (clearInterval(y), v.observe(S));
2163
+ }, 10);
2164
+ return () => {
2165
+ clearInterval(y), v.disconnect();
2166
+ };
2167
+ }
2168
+ }, []);
2169
+ let w = Object.assign(Object.assign({}, i), {
2170
+ style: Object.assign(Object.assign({}, l), {
2171
+ margin: 0
2172
+ }),
2173
+ open: h,
2174
+ visible: h,
2175
+ getPopupContainer: () => u.current
2176
+ });
2177
+ Object.assign(w, {
2178
+ [t]: {
2179
+ overflow: {
2180
+ adjustX: !1,
2181
+ adjustY: !1
2182
+ }
2183
+ }
2184
+ });
2185
+ const E = {
2186
+ paddingBottom: d,
2187
+ position: "relative",
2188
+ minWidth: p
2189
+ };
2190
+ return /* @__PURE__ */ m.createElement("div", {
2191
+ ref: u,
2192
+ style: E
2193
+ }, /* @__PURE__ */ m.createElement(e, Object.assign({}, w)));
2194
+ });
2195
+ export {
2196
+ qe as B,
2197
+ On as C,
2198
+ Ve as P,
2199
+ wo as a,
2200
+ Eo as b,
2201
+ xn as c,
2202
+ Rt as d,
2203
+ $n as e,
2204
+ ko as f,
2205
+ Fo as g,
2206
+ Sn as h,
2207
+ En as i,
2208
+ er as j,
2209
+ yn as u,
2210
+ pn as w,
2211
+ Bt as z
2212
+ };