@notificationapi/react 0.0.37 → 1.0.1

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 (72) hide show
  1. package/dist/assets/Badge.js +456 -0
  2. package/dist/assets/Box.js +57 -0
  3. package/dist/assets/ButtonBase.js +1224 -0
  4. package/dist/assets/DefaultPropsProvider.js +4368 -0
  5. package/dist/assets/Divider.js +343 -0
  6. package/dist/assets/IconButton.js +225 -0
  7. package/dist/assets/Inbox.js +3051 -0
  8. package/dist/assets/InboxHeader.js +2338 -0
  9. package/dist/assets/Notification.js +5349 -7150
  10. package/dist/assets/NotificationPreferencesPopup.js +1694 -0
  11. package/dist/assets/Paper.js +154 -0
  12. package/dist/assets/Popover.js +451 -0
  13. package/dist/assets/Portal.js +110 -0
  14. package/dist/assets/PreferenceInput.js +1545 -1366
  15. package/dist/assets/Typography.js +292 -0
  16. package/dist/assets/WebPushOptInMessage.js +794 -407
  17. package/dist/assets/channelUtils.js +33 -65
  18. package/dist/assets/createSimplePaletteValueFilter.js +17 -0
  19. package/dist/assets/createSvgIcon.js +248 -0
  20. package/dist/assets/integerPropType.js +31 -0
  21. package/dist/assets/resolveComponentProps.js +93 -0
  22. package/dist/assets/style.css +1 -0
  23. package/dist/assets/useSlotProps.js +24 -0
  24. package/dist/assets/useTheme.js +10 -0
  25. package/dist/assets/useTheme2.js +16 -0
  26. package/dist/assets/utils.js +743 -0
  27. package/dist/components/Notifications/DefaultEmpty.d.ts +3 -0
  28. package/dist/components/Notifications/DefaultEmpty.js +7 -0
  29. package/dist/components/Notifications/Inbox.d.ts +4 -4
  30. package/dist/components/Notifications/Inbox.js +9 -6450
  31. package/dist/components/Notifications/InboxHeader.d.ts +1 -1
  32. package/dist/components/Notifications/InboxHeader.js +7 -53
  33. package/dist/components/Notifications/Notification.d.ts +3 -4
  34. package/dist/components/Notifications/Notification.js +6 -5
  35. package/dist/components/Notifications/NotificationCounter.js +16 -6
  36. package/dist/components/Notifications/NotificationFeed.d.ts +1 -2
  37. package/dist/components/Notifications/NotificationFeed.js +41 -38
  38. package/dist/components/Notifications/NotificationLauncher.d.ts +1 -0
  39. package/dist/components/Notifications/NotificationLauncher.js +100 -114
  40. package/dist/components/Notifications/NotificationPopup.d.ts +3 -4
  41. package/dist/components/Notifications/NotificationPopup.js +86 -88
  42. package/dist/components/Notifications/UnreadBadge.d.ts +7 -4
  43. package/dist/components/Notifications/UnreadBadge.js +28 -20
  44. package/dist/components/Notifications/interface.d.ts +0 -4
  45. package/dist/components/Notifications/interface.js +4 -5
  46. package/dist/components/Preferences/NotificationPreferencesInline.js +14 -14
  47. package/dist/components/Preferences/NotificationPreferencesPopup.js +7 -2068
  48. package/dist/components/Preferences/PreferenceInput.js +4 -3
  49. package/dist/components/Preferences/Preferences.js +1042 -547
  50. package/dist/components/Preferences/channelUtils.js +3 -4
  51. package/dist/components/Preferences/index.js +1 -1
  52. package/dist/components/Provider/context.d.ts +27 -0
  53. package/dist/components/Provider/context.js +7 -0
  54. package/dist/components/Provider/index.d.ts +2 -25
  55. package/dist/components/Provider/index.js +22 -24
  56. package/dist/components/WebPush/WebPushOptInMessage.js +3 -4
  57. package/dist/main.d.ts +1 -0
  58. package/dist/main.js +4 -4
  59. package/package.json +14 -12
  60. package/dist/assets/AntdIcon.js +0 -200
  61. package/dist/assets/CloseOutlined.js +0 -13
  62. package/dist/assets/PurePanel.js +0 -59
  63. package/dist/assets/RightOutlined.js +0 -13
  64. package/dist/assets/button.js +0 -1660
  65. package/dist/assets/colors.js +0 -36
  66. package/dist/assets/compact-item.js +0 -860
  67. package/dist/assets/index.js +0 -271
  68. package/dist/assets/index2.js +0 -647
  69. package/dist/assets/index3.js +0 -7527
  70. package/dist/assets/pickAttrs.js +0 -42
  71. package/dist/assets/presets.js +0 -810
  72. package/dist/assets/reactNode.js +0 -20821
@@ -1,2070 +1,9 @@
1
- import { jsxs as Te, jsx as ge } from "react/jsx-runtime";
2
- import { Preferences as jt } from "./Preferences.js";
3
- import * as l from "react";
4
- import h, { useContext as ee, useRef as U, useMemo as Rt, useEffect as Me } from "react";
5
- import { NotificationAPIContext as Tt } from "../Provider/index.js";
6
- import { a as Mt, b as Bt, c as zt, W as Ht } from "../../assets/WebPushOptInMessage.js";
7
- import { d as q, t as kt, I as At, e as Ze, g as Ye, m as Je, u as P, a as L, v as Dt, J as et, K as Ft, r as Lt, q as _t, f as xe, H as Vt, L as Wt, C as tt, A as qt, M as Gt, N as Ut, O as nt, P as Xt } from "../../assets/reactNode.js";
8
- import { o as $e, R as Kt, e as Qt, r as Zt } from "../../assets/compact-item.js";
9
- import { c as S, _ as j, d as Be, a as X, f as Se, i as ze, j as He, k as Yt } from "../../assets/presets.js";
10
- import { f as Jt, h as en, K as ke, j as tn, k as Oe, i as nn, u as ot, l as on, C as an, z as ln, d as ie, m as rn } from "../../assets/index3.js";
11
- import { B as Ee, c as at } from "../../assets/button.js";
12
- import { R as Ne } from "../../assets/CloseOutlined.js";
13
- import { p as we } from "../../assets/pickAttrs.js";
14
- import { K as Pe } from "../../assets/colors.js";
15
- import { w as sn } from "../../assets/PurePanel.js";
16
- import { D as cn } from "../../assets/PreferenceInput.js";
17
- function dn() {
18
- const [e, t] = l.useState([]), n = l.useCallback((o) => (t((a) => [].concat(q(a), [o])), () => {
19
- t((a) => a.filter((r) => r !== o));
20
- }), []);
21
- return [e, n];
22
- }
23
- const un = new Pe("antFadeIn", {
24
- "0%": {
25
- opacity: 0
26
- },
27
- "100%": {
28
- opacity: 1
29
- }
30
- }), mn = new Pe("antFadeOut", {
31
- "0%": {
32
- opacity: 1
33
- },
34
- "100%": {
35
- opacity: 0
36
- }
37
- }), fn = function(e) {
38
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
39
- const {
40
- antCls: n
41
- } = e, o = `${n}-fade`, a = t ? "&" : "";
42
- return [Jt(o, un, mn, e.motionDurationMid, t), {
43
- [`
44
- ${a}${o}-enter,
45
- ${a}${o}-appear
46
- `]: {
47
- opacity: 0,
48
- animationTimingFunction: "linear"
49
- },
50
- [`${a}${o}-leave`]: {
51
- animationTimingFunction: "linear"
52
- }
53
- }];
54
- };
55
- function Ce(e) {
56
- return !!(e != null && e.then);
57
- }
58
- const lt = (e) => {
59
- const {
60
- type: t,
61
- children: n,
62
- prefixCls: o,
63
- buttonProps: a,
64
- close: r,
65
- autoFocus: d,
66
- emitEvent: c,
67
- isSilent: i,
68
- quitOnNullishReturnValue: u,
69
- actionFn: s
70
- } = e, m = l.useRef(!1), g = l.useRef(null), [v, b] = kt(!1), f = function() {
71
- r == null || r.apply(void 0, arguments);
72
- };
73
- l.useEffect(() => {
74
- let C = null;
75
- return d && (C = setTimeout(() => {
76
- var y;
77
- (y = g.current) === null || y === void 0 || y.focus();
78
- })), () => {
79
- C && clearTimeout(C);
80
- };
81
- }, []);
82
- const x = (C) => {
83
- Ce(C) && (b(!0), C.then(function() {
84
- b(!1, !0), f.apply(void 0, arguments), m.current = !1;
85
- }, (y) => {
86
- if (b(!1, !0), m.current = !1, !(i != null && i()))
87
- return Promise.reject(y);
88
- }));
89
- }, p = (C) => {
90
- if (m.current)
91
- return;
92
- if (m.current = !0, !s) {
93
- f();
94
- return;
95
- }
96
- let y;
97
- if (c) {
98
- if (y = s(C), u && !Ce(y)) {
99
- m.current = !1, f(C);
100
- return;
101
- }
102
- } else if (s.length)
103
- y = s(r), m.current = !1;
104
- else if (y = s(), !Ce(y)) {
105
- f();
106
- return;
107
- }
108
- x(y);
109
- };
110
- return /* @__PURE__ */ l.createElement(Ee, Object.assign({}, at(t), {
111
- onClick: p,
112
- loading: v,
113
- prefixCls: o
114
- }, a, {
115
- ref: g
116
- }), n);
117
- }, oe = /* @__PURE__ */ h.createContext({}), {
118
- Provider: rt
119
- } = oe, Ae = () => {
120
- const {
121
- autoFocusButton: e,
122
- cancelButtonProps: t,
123
- cancelTextLocale: n,
124
- isSilent: o,
125
- mergedOkCancel: a,
126
- rootPrefixCls: r,
127
- close: d,
128
- onCancel: c,
129
- onConfirm: i
130
- } = ee(oe);
131
- return a ? /* @__PURE__ */ h.createElement(lt, {
132
- isSilent: o,
133
- actionFn: c,
134
- close: function() {
135
- d == null || d.apply(void 0, arguments), i == null || i(!1);
136
- },
137
- autoFocus: e === "cancel",
138
- buttonProps: t,
139
- prefixCls: `${r}-btn`
140
- }, n) : null;
141
- }, De = () => {
142
- const {
143
- autoFocusButton: e,
144
- close: t,
145
- isSilent: n,
146
- okButtonProps: o,
147
- rootPrefixCls: a,
148
- okTextLocale: r,
149
- okType: d,
150
- onConfirm: c,
151
- onOk: i
152
- } = ee(oe);
153
- return /* @__PURE__ */ h.createElement(lt, {
154
- isSilent: n,
155
- type: d || "primary",
156
- actionFn: i,
157
- close: function() {
158
- t == null || t.apply(void 0, arguments), c == null || c(!0);
159
- },
160
- autoFocus: e === "ok",
161
- buttonProps: o,
162
- prefixCls: `${a}-btn`
163
- }, r);
164
- };
165
- var it = /* @__PURE__ */ l.createContext({});
166
- function Fe(e, t, n) {
167
- var o = t;
168
- return !o && n && (o = "".concat(e, "-").concat(n)), o;
169
- }
170
- function Le(e, t) {
171
- var n = e["page".concat(t ? "Y" : "X", "Offset")], o = "scroll".concat(t ? "Top" : "Left");
172
- if (typeof n != "number") {
173
- var a = e.document;
174
- n = a.documentElement[o], typeof n != "number" && (n = a.body[o]);
175
- }
176
- return n;
177
- }
178
- function gn(e) {
179
- var t = e.getBoundingClientRect(), n = {
180
- left: t.left,
181
- top: t.top
182
- }, o = e.ownerDocument, a = o.defaultView || o.parentWindow;
183
- return n.left += Le(a), n.top += Le(a, !0), n;
184
- }
185
- const Cn = /* @__PURE__ */ l.memo(function(e) {
186
- var t = e.children;
187
- return t;
188
- }, function(e, t) {
189
- var n = t.shouldUpdate;
190
- return !n;
191
- });
192
- var vn = {
193
- width: 0,
194
- height: 0,
195
- overflow: "hidden",
196
- outline: "none"
197
- }, bn = {
198
- outline: "none"
199
- }, Ie = /* @__PURE__ */ h.forwardRef(function(e, t) {
200
- var n = e.prefixCls, o = e.className, a = e.style, r = e.title, d = e.ariaId, c = e.footer, i = e.closable, u = e.closeIcon, s = e.onClose, m = e.children, g = e.bodyStyle, v = e.bodyProps, b = e.modalRender, f = e.onMouseDown, x = e.onMouseUp, p = e.holderRef, C = e.visible, y = e.forceRender, $ = e.width, N = e.height, E = e.classNames, O = e.styles, R = h.useContext(it), w = R.panel, z = At(p, w), T = U(), _ = U();
201
- h.useImperativeHandle(t, function() {
202
- return {
203
- focus: function() {
204
- var A;
205
- (A = T.current) === null || A === void 0 || A.focus({
206
- preventScroll: !0
207
- });
208
- },
209
- changeActive: function(A) {
210
- var D = document, M = D.activeElement;
211
- A && M === _.current ? T.current.focus({
212
- preventScroll: !0
213
- }) : !A && M === T.current && _.current.focus({
214
- preventScroll: !0
215
- });
216
- }
217
- };
218
- });
219
- var F = {};
220
- $ !== void 0 && (F.width = $), N !== void 0 && (F.height = N);
221
- var B = c ? /* @__PURE__ */ h.createElement("div", {
222
- className: S("".concat(n, "-footer"), E == null ? void 0 : E.footer),
223
- style: j({}, O == null ? void 0 : O.footer)
224
- }, c) : null, H = r ? /* @__PURE__ */ h.createElement("div", {
225
- className: S("".concat(n, "-header"), E == null ? void 0 : E.header),
226
- style: j({}, O == null ? void 0 : O.header)
227
- }, /* @__PURE__ */ h.createElement("div", {
228
- className: "".concat(n, "-title"),
229
- id: d
230
- }, r)) : null, V = Rt(function() {
231
- return Be(i) === "object" && i !== null ? i : i ? {
232
- closeIcon: u ?? /* @__PURE__ */ h.createElement("span", {
233
- className: "".concat(n, "-close-x")
234
- })
235
- } : {};
236
- }, [i, u, n]), W = we(V, !0), G = Be(i) === "object" && i.disabled, ne = i ? /* @__PURE__ */ h.createElement("button", X({
237
- type: "button",
238
- onClick: s,
239
- "aria-label": "Close"
240
- }, W, {
241
- className: "".concat(n, "-close"),
242
- disabled: G
243
- }), V.closeIcon) : null, K = /* @__PURE__ */ h.createElement("div", {
244
- className: S("".concat(n, "-content"), E == null ? void 0 : E.content),
245
- style: O == null ? void 0 : O.content
246
- }, ne, H, /* @__PURE__ */ h.createElement("div", X({
247
- className: S("".concat(n, "-body"), E == null ? void 0 : E.body),
248
- style: j(j({}, g), O == null ? void 0 : O.body)
249
- }, v), m), B);
250
- return /* @__PURE__ */ h.createElement("div", {
251
- key: "dialog-element",
252
- role: "dialog",
253
- "aria-labelledby": r ? d : null,
254
- "aria-modal": "true",
255
- ref: z,
256
- style: j(j({}, a), F),
257
- className: S(n, o),
258
- onMouseDown: f,
259
- onMouseUp: x
260
- }, /* @__PURE__ */ h.createElement("div", {
261
- ref: T,
262
- tabIndex: 0,
263
- style: bn
264
- }, /* @__PURE__ */ h.createElement(Cn, {
265
- shouldUpdate: C || y
266
- }, b ? b(K) : K)), /* @__PURE__ */ h.createElement("div", {
267
- tabIndex: 0,
268
- ref: _,
269
- style: vn
270
- }));
271
- });
272
- process.env.NODE_ENV !== "production" && (Ie.displayName = "Panel");
273
- var st = /* @__PURE__ */ l.forwardRef(function(e, t) {
274
- var n = e.prefixCls, o = e.title, a = e.style, r = e.className, d = e.visible, c = e.forceRender, i = e.destroyOnClose, u = e.motionName, s = e.ariaId, m = e.onVisibleChanged, g = e.mousePosition, v = U(), b = l.useState(), f = Se(b, 2), x = f[0], p = f[1], C = {};
275
- x && (C.transformOrigin = x);
276
- function y() {
277
- var $ = gn(v.current);
278
- p(g && (g.x || g.y) ? "".concat(g.x - $.left, "px ").concat(g.y - $.top, "px") : "");
279
- }
280
- return /* @__PURE__ */ l.createElement(Ze, {
281
- visible: d,
282
- onVisibleChanged: m,
283
- onAppearPrepare: y,
284
- onEnterPrepare: y,
285
- forceRender: c,
286
- motionName: u,
287
- removeOnLeave: i,
288
- ref: v
289
- }, function($, N) {
290
- var E = $.className, O = $.style;
291
- return /* @__PURE__ */ l.createElement(Ie, X({}, e, {
292
- ref: t,
293
- title: o,
294
- ariaId: s,
295
- prefixCls: n,
296
- holderRef: N,
297
- style: j(j(j({}, O), a), C),
298
- className: S(r, E)
299
- }));
300
- });
301
- });
302
- st.displayName = "Content";
303
- var pn = function(t) {
304
- var n = t.prefixCls, o = t.style, a = t.visible, r = t.maskProps, d = t.motionName, c = t.className;
305
- return /* @__PURE__ */ l.createElement(Ze, {
306
- key: "mask",
307
- visible: a,
308
- motionName: d,
309
- leavedClassName: "".concat(n, "-mask-hidden")
310
- }, function(i, u) {
311
- var s = i.className, m = i.style;
312
- return /* @__PURE__ */ l.createElement("div", X({
313
- ref: u,
314
- style: j(j({}, m), o),
315
- className: S("".concat(n, "-mask"), s, c)
316
- }, r));
317
- });
318
- }, hn = function(t) {
319
- var n = t.prefixCls, o = n === void 0 ? "rc-dialog" : n, a = t.zIndex, r = t.visible, d = r === void 0 ? !1 : r, c = t.keyboard, i = c === void 0 ? !0 : c, u = t.focusTriggerAfterClose, s = u === void 0 ? !0 : u, m = t.wrapStyle, g = t.wrapClassName, v = t.wrapProps, b = t.onClose, f = t.afterOpenChange, x = t.afterClose, p = t.transitionName, C = t.animation, y = t.closable, $ = y === void 0 ? !0 : y, N = t.mask, E = N === void 0 ? !0 : N, O = t.maskTransitionName, R = t.maskAnimation, w = t.maskClosable, z = w === void 0 ? !0 : w, T = t.maskStyle, _ = t.maskProps, F = t.rootClassName, B = t.classNames, H = t.styles;
320
- process.env.NODE_ENV !== "production" && (["wrapStyle", "bodyStyle", "maskStyle"].forEach(function(I) {
321
- ze(!(I in t), "".concat(I, " is deprecated, please use styles instead."));
322
- }), "wrapClassName" in t && ze(!1, "wrapClassName is deprecated, please use classNames instead."));
323
- var V = U(), W = U(), G = U(), ne = l.useState(d), K = Se(ne, 2), Q = K[0], A = K[1], D = en();
324
- function M() {
325
- He(W.current, document.activeElement) || (V.current = document.activeElement);
326
- }
327
- function le() {
328
- if (!He(W.current, document.activeElement)) {
329
- var I;
330
- (I = G.current) === null || I === void 0 || I.focus();
331
- }
332
- }
333
- function de(I) {
334
- if (I)
335
- le();
336
- else {
337
- if (A(!1), E && V.current && s) {
338
- try {
339
- V.current.focus({
340
- preventScroll: !0
341
- });
342
- } catch {
343
- }
344
- V.current = null;
345
- }
346
- Q && (x == null || x());
347
- }
348
- f == null || f(I);
349
- }
350
- function ue(I) {
351
- b == null || b(I);
352
- }
353
- var re = U(!1), me = U(), Nt = function() {
354
- clearTimeout(me.current), re.current = !0;
355
- }, wt = function() {
356
- me.current = setTimeout(function() {
357
- re.current = !1;
358
- });
359
- }, Re = null;
360
- z && (Re = function(fe) {
361
- re.current ? re.current = !1 : W.current === fe.target && ue(fe);
362
- });
363
- function Pt(I) {
364
- if (i && I.keyCode === ke.ESC) {
365
- I.stopPropagation(), ue(I);
366
- return;
367
- }
368
- d && I.keyCode === ke.TAB && G.current.changeActive(!I.shiftKey);
369
- }
370
- Me(function() {
371
- d && (A(!0), M());
372
- }, [d]), Me(function() {
373
- return function() {
374
- clearTimeout(me.current);
375
- };
376
- }, []);
377
- var It = j(j(j({
378
- zIndex: a
379
- }, m), H == null ? void 0 : H.wrapper), {}, {
380
- display: Q ? null : "none"
381
- });
382
- return /* @__PURE__ */ l.createElement("div", X({
383
- className: S("".concat(o, "-root"), F)
384
- }, we(t, {
385
- data: !0
386
- })), /* @__PURE__ */ l.createElement(pn, {
387
- prefixCls: o,
388
- visible: E && d,
389
- motionName: Fe(o, O, R),
390
- style: j(j({
391
- zIndex: a
392
- }, T), H == null ? void 0 : H.mask),
393
- maskProps: _,
394
- className: B == null ? void 0 : B.mask
395
- }), /* @__PURE__ */ l.createElement("div", X({
396
- tabIndex: -1,
397
- onKeyDown: Pt,
398
- className: S("".concat(o, "-wrap"), g, B == null ? void 0 : B.wrapper),
399
- ref: W,
400
- onClick: Re,
401
- style: It
402
- }, v), /* @__PURE__ */ l.createElement(st, X({}, t, {
403
- onMouseDown: Nt,
404
- onMouseUp: wt,
405
- ref: G,
406
- closable: $,
407
- ariaId: D,
408
- prefixCls: o,
409
- visible: d && Q,
410
- onClose: ue,
411
- onVisibleChanged: de,
412
- motionName: Fe(o, p, C)
413
- }))));
414
- }, ct = function(t) {
415
- var n = t.visible, o = t.getContainer, a = t.forceRender, r = t.destroyOnClose, d = r === void 0 ? !1 : r, c = t.afterClose, i = t.panelRef, u = l.useState(n), s = Se(u, 2), m = s[0], g = s[1], v = l.useMemo(function() {
416
- return {
417
- panel: i
418
- };
419
- }, [i]);
420
- return l.useEffect(function() {
421
- n && g(!0);
422
- }, [n]), !a && d && !m ? null : /* @__PURE__ */ l.createElement(it.Provider, {
423
- value: v
424
- }, /* @__PURE__ */ l.createElement(tn, {
425
- open: n || a || m,
426
- autoDestroy: !1,
427
- getContainer: o,
428
- autoLock: n || m
429
- }, /* @__PURE__ */ l.createElement(hn, X({}, t, {
430
- destroyOnClose: d,
431
- afterClose: function() {
432
- c == null || c(), g(!1);
433
- }
434
- }))));
435
- };
436
- ct.displayName = "Dialog";
437
- function _e(e) {
438
- if (e)
439
- return {
440
- closable: e.closable,
441
- closeIcon: e.closeIcon
442
- };
443
- }
444
- function Ve(e) {
445
- const {
446
- closable: t,
447
- closeIcon: n
448
- } = e || {};
449
- return h.useMemo(() => {
450
- if (
451
- // If `closable`, whatever rest be should be true
452
- !t && (t === !1 || n === !1 || n === null)
453
- )
454
- return !1;
455
- if (t === void 0 && n === void 0)
456
- return null;
457
- let o = {
458
- closeIcon: typeof n != "boolean" && n !== null ? n : void 0
459
- };
460
- return t && typeof t == "object" && (o = Object.assign(Object.assign({}, o), t)), o;
461
- }, [t, n]);
462
- }
463
- function We() {
464
- const e = {};
465
- for (var t = arguments.length, n = new Array(t), o = 0; o < t; o++)
466
- n[o] = arguments[o];
467
- return n.forEach((a) => {
468
- a && Object.keys(a).forEach((r) => {
469
- a[r] !== void 0 && (e[r] = a[r]);
470
- });
471
- }), e;
472
- }
473
- const yn = {};
474
- function xn(e, t) {
475
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : yn;
476
- const o = Ve(e), a = Ve(t), r = typeof o != "boolean" ? !!(o != null && o.disabled) : !1, d = h.useMemo(() => Object.assign({
477
- closeIcon: /* @__PURE__ */ h.createElement(Ne, null)
478
- }, n), [n]), c = h.useMemo(() => o === !1 ? !1 : o ? We(d, a, o) : a === !1 ? !1 : a ? We(d, a) : d.closable ? d : !1, [o, a, d]);
479
- return h.useMemo(() => {
480
- if (c === !1)
481
- return [!1, null, r];
482
- const {
483
- closeIconRender: i
484
- } = d, {
485
- closeIcon: u
486
- } = c;
487
- let s = u;
488
- if (s != null) {
489
- i && (s = i(u));
490
- const m = we(c, !0);
491
- Object.keys(m).length && (s = /* @__PURE__ */ h.isValidElement(s) ? /* @__PURE__ */ h.cloneElement(s, m) : /* @__PURE__ */ h.createElement("span", Object.assign({}, m), s));
492
- }
493
- return [!0, s, r];
494
- }, [c, d]);
495
- }
496
- const $n = () => Yt() && window.document.documentElement, se = (e) => {
497
- const {
498
- prefixCls: t,
499
- className: n,
500
- style: o,
501
- size: a,
502
- shape: r
503
- } = e, d = S({
504
- [`${t}-lg`]: a === "large",
505
- [`${t}-sm`]: a === "small"
506
- }), c = S({
507
- [`${t}-circle`]: r === "circle",
508
- [`${t}-square`]: r === "square",
509
- [`${t}-round`]: r === "round"
510
- }), i = l.useMemo(() => typeof a == "number" ? {
511
- width: a,
512
- height: a,
513
- lineHeight: `${a}px`
514
- } : {}, [a]);
515
- return /* @__PURE__ */ l.createElement("span", {
516
- className: S(t, d, c, n),
517
- style: Object.assign(Object.assign({}, i), o)
518
- });
519
- }, Sn = new Pe("ant-skeleton-loading", {
520
- "0%": {
521
- backgroundPosition: "100% 50%"
522
- },
523
- "100%": {
524
- backgroundPosition: "0 50%"
525
- }
526
- }), ce = (e) => ({
527
- height: e,
528
- lineHeight: P(e)
529
- }), J = (e) => Object.assign({
530
- width: e
531
- }, ce(e)), On = (e) => ({
532
- background: e.skeletonLoadingBackground,
533
- backgroundSize: "400% 100%",
534
- animationName: Sn,
535
- animationDuration: e.skeletonLoadingMotionDuration,
536
- animationTimingFunction: "ease",
537
- animationIterationCount: "infinite"
538
- }), ve = (e, t) => Object.assign({
539
- width: t(e).mul(5).equal(),
540
- minWidth: t(e).mul(5).equal()
541
- }, ce(e)), En = (e) => {
542
- const {
543
- skeletonAvatarCls: t,
544
- gradientFromColor: n,
545
- controlHeight: o,
546
- controlHeightLG: a,
547
- controlHeightSM: r
548
- } = e;
549
- return {
550
- [t]: Object.assign({
551
- display: "inline-block",
552
- verticalAlign: "top",
553
- background: n
554
- }, J(o)),
555
- [`${t}${t}-circle`]: {
556
- borderRadius: "50%"
557
- },
558
- [`${t}${t}-lg`]: Object.assign({}, J(a)),
559
- [`${t}${t}-sm`]: Object.assign({}, J(r))
560
- };
561
- }, Nn = (e) => {
562
- const {
563
- controlHeight: t,
564
- borderRadiusSM: n,
565
- skeletonInputCls: o,
566
- controlHeightLG: a,
567
- controlHeightSM: r,
568
- gradientFromColor: d,
569
- calc: c
570
- } = e;
571
- return {
572
- [o]: Object.assign({
573
- display: "inline-block",
574
- verticalAlign: "top",
575
- background: d,
576
- borderRadius: n
577
- }, ve(t, c)),
578
- [`${o}-lg`]: Object.assign({}, ve(a, c)),
579
- [`${o}-sm`]: Object.assign({}, ve(r, c))
580
- };
581
- }, qe = (e) => Object.assign({
582
- width: e
583
- }, ce(e)), wn = (e) => {
584
- const {
585
- skeletonImageCls: t,
586
- imageSizeBase: n,
587
- gradientFromColor: o,
588
- borderRadiusSM: a,
589
- calc: r
590
- } = e;
591
- return {
592
- [t]: Object.assign(Object.assign({
593
- display: "inline-flex",
594
- alignItems: "center",
595
- justifyContent: "center",
596
- verticalAlign: "middle",
597
- background: o,
598
- borderRadius: a
599
- }, qe(r(n).mul(2).equal())), {
600
- [`${t}-path`]: {
601
- fill: "#bfbfbf"
602
- },
603
- [`${t}-svg`]: Object.assign(Object.assign({}, qe(n)), {
604
- maxWidth: r(n).mul(4).equal(),
605
- maxHeight: r(n).mul(4).equal()
606
- }),
607
- [`${t}-svg${t}-svg-circle`]: {
608
- borderRadius: "50%"
609
- }
610
- }),
611
- [`${t}${t}-circle`]: {
612
- borderRadius: "50%"
613
- }
614
- };
615
- }, be = (e, t, n) => {
616
- const {
617
- skeletonButtonCls: o
618
- } = e;
619
- return {
620
- [`${n}${o}-circle`]: {
621
- width: t,
622
- minWidth: t,
623
- borderRadius: "50%"
624
- },
625
- [`${n}${o}-round`]: {
626
- borderRadius: t
627
- }
628
- };
629
- }, pe = (e, t) => Object.assign({
630
- width: t(e).mul(2).equal(),
631
- minWidth: t(e).mul(2).equal()
632
- }, ce(e)), Pn = (e) => {
633
- const {
634
- borderRadiusSM: t,
635
- skeletonButtonCls: n,
636
- controlHeight: o,
637
- controlHeightLG: a,
638
- controlHeightSM: r,
639
- gradientFromColor: d,
640
- calc: c
641
- } = e;
642
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
643
- [n]: Object.assign({
644
- display: "inline-block",
645
- verticalAlign: "top",
646
- background: d,
647
- borderRadius: t,
648
- width: c(o).mul(2).equal(),
649
- minWidth: c(o).mul(2).equal()
650
- }, pe(o, c))
651
- }, be(e, o, n)), {
652
- [`${n}-lg`]: Object.assign({}, pe(a, c))
653
- }), be(e, a, `${n}-lg`)), {
654
- [`${n}-sm`]: Object.assign({}, pe(r, c))
655
- }), be(e, r, `${n}-sm`));
656
- }, In = (e) => {
657
- const {
658
- componentCls: t,
659
- skeletonAvatarCls: n,
660
- skeletonTitleCls: o,
661
- skeletonParagraphCls: a,
662
- skeletonButtonCls: r,
663
- skeletonInputCls: d,
664
- skeletonImageCls: c,
665
- controlHeight: i,
666
- controlHeightLG: u,
667
- controlHeightSM: s,
668
- gradientFromColor: m,
669
- padding: g,
670
- marginSM: v,
671
- borderRadius: b,
672
- titleHeight: f,
673
- blockRadius: x,
674
- paragraphLiHeight: p,
675
- controlHeightXS: C,
676
- paragraphMarginTop: y
677
- } = e;
678
- return {
679
- [t]: {
680
- display: "table",
681
- width: "100%",
682
- [`${t}-header`]: {
683
- display: "table-cell",
684
- paddingInlineEnd: g,
685
- verticalAlign: "top",
686
- // Avatar
687
- [n]: Object.assign({
688
- display: "inline-block",
689
- verticalAlign: "top",
690
- background: m
691
- }, J(i)),
692
- [`${n}-circle`]: {
693
- borderRadius: "50%"
694
- },
695
- [`${n}-lg`]: Object.assign({}, J(u)),
696
- [`${n}-sm`]: Object.assign({}, J(s))
697
- },
698
- [`${t}-content`]: {
699
- display: "table-cell",
700
- width: "100%",
701
- verticalAlign: "top",
702
- // Title
703
- [o]: {
704
- width: "100%",
705
- height: f,
706
- background: m,
707
- borderRadius: x,
708
- [`+ ${a}`]: {
709
- marginBlockStart: s
710
- }
711
- },
712
- // paragraph
713
- [a]: {
714
- padding: 0,
715
- "> li": {
716
- width: "100%",
717
- height: p,
718
- listStyle: "none",
719
- background: m,
720
- borderRadius: x,
721
- "+ li": {
722
- marginBlockStart: C
723
- }
724
- }
725
- },
726
- [`${a}> li:last-child:not(:first-child):not(:nth-child(2))`]: {
727
- width: "61%"
728
- }
729
- },
730
- [`&-round ${t}-content`]: {
731
- [`${o}, ${a} > li`]: {
732
- borderRadius: b
733
- }
734
- }
735
- },
736
- [`${t}-with-avatar ${t}-content`]: {
737
- // Title
738
- [o]: {
739
- marginBlockStart: v,
740
- [`+ ${a}`]: {
741
- marginBlockStart: y
742
- }
743
- }
744
- },
745
- // Skeleton element
746
- [`${t}${t}-element`]: Object.assign(Object.assign(Object.assign(Object.assign({
747
- display: "inline-block",
748
- width: "auto"
749
- }, Pn(e)), En(e)), Nn(e)), wn(e)),
750
- // Skeleton Block Button, Input
751
- [`${t}${t}-block`]: {
752
- width: "100%",
753
- [r]: {
754
- width: "100%"
755
- },
756
- [d]: {
757
- width: "100%"
758
- }
759
- },
760
- // With active animation
761
- [`${t}${t}-active`]: {
762
- [`
763
- ${o},
764
- ${a} > li,
765
- ${n},
766
- ${r},
767
- ${d},
768
- ${c}
769
- `]: Object.assign({}, On(e))
770
- }
771
- };
772
- }, jn = (e) => {
773
- const {
774
- colorFillContent: t,
775
- colorFill: n
776
- } = e, o = t, a = n;
777
- return {
778
- color: o,
779
- colorGradientEnd: a,
780
- gradientFromColor: o,
781
- gradientToColor: a,
782
- titleHeight: e.controlHeight / 2,
783
- blockRadius: e.borderRadiusSM,
784
- paragraphMarginTop: e.marginLG + e.marginXXS,
785
- paragraphLiHeight: e.controlHeight / 2
786
- };
787
- }, te = Ye("Skeleton", (e) => {
788
- const {
789
- componentCls: t,
790
- calc: n
791
- } = e, o = Je(e, {
792
- skeletonAvatarCls: `${t}-avatar`,
793
- skeletonTitleCls: `${t}-title`,
794
- skeletonParagraphCls: `${t}-paragraph`,
795
- skeletonButtonCls: `${t}-button`,
796
- skeletonInputCls: `${t}-input`,
797
- skeletonImageCls: `${t}-image`,
798
- imageSizeBase: n(e.controlHeight).mul(1.5).equal(),
799
- borderRadius: 100,
800
- // Large number to make capsule shape
801
- skeletonLoadingBackground: `linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,
802
- skeletonLoadingMotionDuration: "1.4s"
803
- });
804
- return [In(o)];
805
- }, jn, {
806
- deprecatedTokens: [["color", "gradientFromColor"], ["colorGradientEnd", "gradientToColor"]]
807
- }), Rn = (e) => {
808
- const {
809
- prefixCls: t,
810
- className: n,
811
- rootClassName: o,
812
- active: a,
813
- shape: r = "circle",
814
- size: d = "default"
815
- } = e, {
816
- getPrefixCls: c
817
- } = l.useContext(L), i = c("skeleton", t), [u, s, m] = te(i), g = $e(e, ["prefixCls", "className"]), v = S(i, `${i}-element`, {
818
- [`${i}-active`]: a
819
- }, n, o, s, m);
820
- return u(/* @__PURE__ */ l.createElement("div", {
821
- className: v
822
- }, /* @__PURE__ */ l.createElement(se, Object.assign({
823
- prefixCls: `${i}-avatar`,
824
- shape: r,
825
- size: d
826
- }, g))));
827
- }, Tn = (e) => {
828
- const {
829
- prefixCls: t,
830
- className: n,
831
- rootClassName: o,
832
- active: a,
833
- block: r = !1,
834
- size: d = "default"
835
- } = e, {
836
- getPrefixCls: c
837
- } = l.useContext(L), i = c("skeleton", t), [u, s, m] = te(i), g = $e(e, ["prefixCls"]), v = S(i, `${i}-element`, {
838
- [`${i}-active`]: a,
839
- [`${i}-block`]: r
840
- }, n, o, s, m);
841
- return u(/* @__PURE__ */ l.createElement("div", {
842
- className: v
843
- }, /* @__PURE__ */ l.createElement(se, Object.assign({
844
- prefixCls: `${i}-button`,
845
- size: d
846
- }, g))));
847
- }, Mn = "M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z", Bn = (e) => {
848
- const {
849
- prefixCls: t,
850
- className: n,
851
- rootClassName: o,
852
- style: a,
853
- active: r
854
- } = e, {
855
- getPrefixCls: d
856
- } = l.useContext(L), c = d("skeleton", t), [i, u, s] = te(c), m = S(c, `${c}-element`, {
857
- [`${c}-active`]: r
858
- }, n, o, u, s);
859
- return i(/* @__PURE__ */ l.createElement("div", {
860
- className: m
861
- }, /* @__PURE__ */ l.createElement("div", {
862
- className: S(`${c}-image`, n),
863
- style: a
864
- }, /* @__PURE__ */ l.createElement("svg", {
865
- viewBox: "0 0 1098 1024",
866
- xmlns: "http://www.w3.org/2000/svg",
867
- className: `${c}-image-svg`
868
- }, /* @__PURE__ */ l.createElement("title", null, "Image placeholder"), /* @__PURE__ */ l.createElement("path", {
869
- d: Mn,
870
- className: `${c}-image-path`
871
- })))));
872
- }, zn = (e) => {
873
- const {
874
- prefixCls: t,
875
- className: n,
876
- rootClassName: o,
877
- active: a,
878
- block: r,
879
- size: d = "default"
880
- } = e, {
881
- getPrefixCls: c
882
- } = l.useContext(L), i = c("skeleton", t), [u, s, m] = te(i), g = $e(e, ["prefixCls"]), v = S(i, `${i}-element`, {
883
- [`${i}-active`]: a,
884
- [`${i}-block`]: r
885
- }, n, o, s, m);
886
- return u(/* @__PURE__ */ l.createElement("div", {
887
- className: v
888
- }, /* @__PURE__ */ l.createElement(se, Object.assign({
889
- prefixCls: `${i}-input`,
890
- size: d
891
- }, g))));
892
- }, Hn = (e) => {
893
- const {
894
- prefixCls: t,
895
- className: n,
896
- rootClassName: o,
897
- style: a,
898
- active: r,
899
- children: d
900
- } = e, {
901
- getPrefixCls: c
902
- } = l.useContext(L), i = c("skeleton", t), [u, s, m] = te(i), g = S(i, `${i}-element`, {
903
- [`${i}-active`]: r
904
- }, s, n, o, m);
905
- return u(/* @__PURE__ */ l.createElement("div", {
906
- className: g
907
- }, /* @__PURE__ */ l.createElement("div", {
908
- className: S(`${i}-image`, n),
909
- style: a
910
- }, d)));
911
- }, kn = (e, t) => {
912
- const {
913
- width: n,
914
- rows: o = 2
915
- } = t;
916
- if (Array.isArray(n))
917
- return n[e];
918
- if (o - 1 === e)
919
- return n;
920
- }, An = (e) => {
921
- const {
922
- prefixCls: t,
923
- className: n,
924
- style: o,
925
- rows: a
926
- } = e, r = q(new Array(a)).map((d, c) => (
927
- // eslint-disable-next-line react/no-array-index-key
928
- /* @__PURE__ */ l.createElement("li", {
929
- key: c,
930
- style: {
931
- width: kn(c, e)
932
- }
933
- })
934
- ));
935
- return /* @__PURE__ */ l.createElement("ul", {
936
- className: S(t, n),
937
- style: o
938
- }, r);
939
- }, Dn = (e) => {
940
- let {
941
- prefixCls: t,
942
- className: n,
943
- width: o,
944
- style: a
945
- } = e;
946
- return (
947
- // biome-ignore lint/a11y/useHeadingContent: HOC here
948
- /* @__PURE__ */ l.createElement("h3", {
949
- className: S(t, n),
950
- style: Object.assign({
951
- width: o
952
- }, a)
953
- })
954
- );
955
- };
956
- function he(e) {
957
- return e && typeof e == "object" ? e : {};
958
- }
959
- function Fn(e, t) {
960
- return e && !t ? {
961
- size: "large",
962
- shape: "square"
963
- } : {
964
- size: "large",
965
- shape: "circle"
966
- };
967
- }
968
- function Ln(e, t) {
969
- return !e && t ? {
970
- width: "38%"
971
- } : e && t ? {
972
- width: "50%"
973
- } : {};
974
- }
975
- function _n(e, t) {
976
- const n = {};
977
- return (!e || !t) && (n.width = "61%"), !e && t ? n.rows = 3 : n.rows = 2, n;
978
- }
979
- const Y = (e) => {
980
- const {
981
- prefixCls: t,
982
- loading: n,
983
- className: o,
984
- rootClassName: a,
985
- style: r,
986
- children: d,
987
- avatar: c = !1,
988
- title: i = !0,
989
- paragraph: u = !0,
990
- active: s,
991
- round: m
992
- } = e, {
993
- getPrefixCls: g,
994
- direction: v,
995
- skeleton: b
996
- } = l.useContext(L), f = g("skeleton", t), [x, p, C] = te(f);
997
- if (n || !("loading" in e)) {
998
- const y = !!c, $ = !!i, N = !!u;
999
- let E;
1000
- if (y) {
1001
- const w = Object.assign(Object.assign({
1002
- prefixCls: `${f}-avatar`
1003
- }, Fn($, N)), he(c));
1004
- E = /* @__PURE__ */ l.createElement("div", {
1005
- className: `${f}-header`
1006
- }, /* @__PURE__ */ l.createElement(se, Object.assign({}, w)));
1007
- }
1008
- let O;
1009
- if ($ || N) {
1010
- let w;
1011
- if ($) {
1012
- const T = Object.assign(Object.assign({
1013
- prefixCls: `${f}-title`
1014
- }, Ln(y, N)), he(i));
1015
- w = /* @__PURE__ */ l.createElement(Dn, Object.assign({}, T));
1016
- }
1017
- let z;
1018
- if (N) {
1019
- const T = Object.assign(Object.assign({
1020
- prefixCls: `${f}-paragraph`
1021
- }, _n(y, $)), he(u));
1022
- z = /* @__PURE__ */ l.createElement(An, Object.assign({}, T));
1023
- }
1024
- O = /* @__PURE__ */ l.createElement("div", {
1025
- className: `${f}-content`
1026
- }, w, z);
1027
- }
1028
- const R = S(f, {
1029
- [`${f}-with-avatar`]: y,
1030
- [`${f}-active`]: s,
1031
- [`${f}-rtl`]: v === "rtl",
1032
- [`${f}-round`]: m
1033
- }, b == null ? void 0 : b.className, o, a, p, C);
1034
- return x(/* @__PURE__ */ l.createElement("div", {
1035
- className: R,
1036
- style: Object.assign(Object.assign({}, b == null ? void 0 : b.style), r)
1037
- }, E, O));
1038
- }
1039
- return d ?? null;
1040
- };
1041
- Y.Button = Tn;
1042
- Y.Avatar = Rn;
1043
- Y.Input = zn;
1044
- Y.Image = Bn;
1045
- Y.Node = Hn;
1046
- process.env.NODE_ENV !== "production" && (Y.displayName = "Skeleton");
1047
- function Ge() {
1048
- }
1049
- const Vn = /* @__PURE__ */ l.createContext({
1050
- add: Ge,
1051
- remove: Ge
1052
- });
1053
- function Wn(e) {
1054
- const t = l.useContext(Vn), n = l.useRef();
1055
- return Dt((a) => {
1056
- if (a) {
1057
- const r = e ? a.querySelector(e) : a;
1058
- t.add(r), n.current = r;
1059
- } else
1060
- t.remove(n.current);
1061
- });
1062
- }
1063
- const Ue = () => {
1064
- const {
1065
- cancelButtonProps: e,
1066
- cancelTextLocale: t,
1067
- onCancel: n
1068
- } = ee(oe);
1069
- return /* @__PURE__ */ h.createElement(Ee, Object.assign({
1070
- onClick: n
1071
- }, e), t);
1072
- }, Xe = () => {
1073
- const {
1074
- confirmLoading: e,
1075
- okButtonProps: t,
1076
- okType: n,
1077
- okTextLocale: o,
1078
- onOk: a
1079
- } = ee(oe);
1080
- return /* @__PURE__ */ h.createElement(Ee, Object.assign({}, at(n), {
1081
- loading: e,
1082
- onClick: a
1083
- }, t), o);
1084
- };
1085
- function dt(e, t) {
1086
- return /* @__PURE__ */ h.createElement("span", {
1087
- className: `${e}-close-x`
1088
- }, t || /* @__PURE__ */ h.createElement(Ne, {
1089
- className: `${e}-close-icon`
1090
- }));
1091
- }
1092
- const ut = (e) => {
1093
- const {
1094
- okText: t,
1095
- okType: n = "primary",
1096
- cancelText: o,
1097
- confirmLoading: a,
1098
- onOk: r,
1099
- onCancel: d,
1100
- okButtonProps: c,
1101
- cancelButtonProps: i,
1102
- footer: u
1103
- } = e, [s] = Oe("Modal", et()), m = t || (s == null ? void 0 : s.okText), g = o || (s == null ? void 0 : s.cancelText), v = {
1104
- confirmLoading: a,
1105
- okButtonProps: c,
1106
- cancelButtonProps: i,
1107
- okTextLocale: m,
1108
- cancelTextLocale: g,
1109
- okType: n,
1110
- onOk: r,
1111
- onCancel: d
1112
- }, b = h.useMemo(() => v, q(Object.values(v)));
1113
- let f;
1114
- return typeof u == "function" || typeof u > "u" ? (f = /* @__PURE__ */ h.createElement(h.Fragment, null, /* @__PURE__ */ h.createElement(Ue, null), /* @__PURE__ */ h.createElement(Xe, null)), typeof u == "function" && (f = u(f, {
1115
- OkBtn: Xe,
1116
- CancelBtn: Ue
1117
- })), f = /* @__PURE__ */ h.createElement(rt, {
1118
- value: b
1119
- }, f)) : f = u, /* @__PURE__ */ h.createElement(Ft, {
1120
- disabled: !1
1121
- }, f);
1122
- };
1123
- function Ke(e) {
1124
- return {
1125
- position: e,
1126
- inset: 0
1127
- };
1128
- }
1129
- const qn = (e) => {
1130
- const {
1131
- componentCls: t,
1132
- antCls: n
1133
- } = e;
1134
- return [{
1135
- [`${t}-root`]: {
1136
- [`${t}${n}-zoom-enter, ${t}${n}-zoom-appear`]: {
1137
- // reset scale avoid mousePosition bug
1138
- transform: "none",
1139
- opacity: 0,
1140
- animationDuration: e.motionDurationSlow,
1141
- // https://github.com/ant-design/ant-design/issues/11777
1142
- userSelect: "none"
1143
- },
1144
- // https://github.com/ant-design/ant-design/issues/37329
1145
- // https://github.com/ant-design/ant-design/issues/40272
1146
- [`${t}${n}-zoom-leave ${t}-content`]: {
1147
- pointerEvents: "none"
1148
- },
1149
- [`${t}-mask`]: Object.assign(Object.assign({}, Ke("fixed")), {
1150
- zIndex: e.zIndexPopupBase,
1151
- height: "100%",
1152
- backgroundColor: e.colorBgMask,
1153
- pointerEvents: "none",
1154
- [`${t}-hidden`]: {
1155
- display: "none"
1156
- }
1157
- }),
1158
- [`${t}-wrap`]: Object.assign(Object.assign({}, Ke("fixed")), {
1159
- zIndex: e.zIndexPopupBase,
1160
- overflow: "auto",
1161
- outline: 0,
1162
- WebkitOverflowScrolling: "touch"
1163
- })
1164
- }
1165
- }, {
1166
- [`${t}-root`]: fn(e)
1167
- }];
1168
- }, Gn = (e) => {
1169
- const {
1170
- componentCls: t
1171
- } = e;
1172
- return [
1173
- // ======================== Root =========================
1174
- {
1175
- [`${t}-root`]: {
1176
- [`${t}-wrap-rtl`]: {
1177
- direction: "rtl"
1178
- },
1179
- [`${t}-centered`]: {
1180
- textAlign: "center",
1181
- "&::before": {
1182
- display: "inline-block",
1183
- width: 0,
1184
- height: "100%",
1185
- verticalAlign: "middle",
1186
- content: '""'
1187
- },
1188
- [t]: {
1189
- top: 0,
1190
- display: "inline-block",
1191
- paddingBottom: 0,
1192
- textAlign: "start",
1193
- verticalAlign: "middle"
1194
- }
1195
- },
1196
- [`@media (max-width: ${e.screenSMMax}px)`]: {
1197
- [t]: {
1198
- maxWidth: "calc(100vw - 16px)",
1199
- margin: `${P(e.marginXS)} auto`
1200
- },
1201
- [`${t}-centered`]: {
1202
- [t]: {
1203
- flex: 1
1204
- }
1205
- }
1206
- }
1207
- }
1208
- },
1209
- // ======================== Modal ========================
1210
- {
1211
- [t]: Object.assign(Object.assign({}, Lt(e)), {
1212
- pointerEvents: "none",
1213
- position: "relative",
1214
- top: 100,
1215
- width: "auto",
1216
- maxWidth: `calc(100vw - ${P(e.calc(e.margin).mul(2).equal())})`,
1217
- margin: "0 auto",
1218
- paddingBottom: e.paddingLG,
1219
- [`${t}-title`]: {
1220
- margin: 0,
1221
- color: e.titleColor,
1222
- fontWeight: e.fontWeightStrong,
1223
- fontSize: e.titleFontSize,
1224
- lineHeight: e.titleLineHeight,
1225
- wordWrap: "break-word"
1226
- },
1227
- [`${t}-content`]: {
1228
- position: "relative",
1229
- backgroundColor: e.contentBg,
1230
- backgroundClip: "padding-box",
1231
- border: 0,
1232
- borderRadius: e.borderRadiusLG,
1233
- boxShadow: e.boxShadow,
1234
- pointerEvents: "auto",
1235
- padding: e.contentPadding
1236
- },
1237
- [`${t}-close`]: Object.assign({
1238
- position: "absolute",
1239
- top: e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),
1240
- insetInlineEnd: e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),
1241
- zIndex: e.calc(e.zIndexPopupBase).add(10).equal(),
1242
- padding: 0,
1243
- color: e.modalCloseIconColor,
1244
- fontWeight: e.fontWeightStrong,
1245
- lineHeight: 1,
1246
- textDecoration: "none",
1247
- background: "transparent",
1248
- borderRadius: e.borderRadiusSM,
1249
- width: e.modalCloseBtnSize,
1250
- height: e.modalCloseBtnSize,
1251
- border: 0,
1252
- outline: 0,
1253
- cursor: "pointer",
1254
- transition: `color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,
1255
- "&-x": {
1256
- display: "flex",
1257
- fontSize: e.fontSizeLG,
1258
- fontStyle: "normal",
1259
- lineHeight: P(e.modalCloseBtnSize),
1260
- justifyContent: "center",
1261
- textTransform: "none",
1262
- textRendering: "auto"
1263
- },
1264
- "&:disabled": {
1265
- pointerEvents: "none"
1266
- },
1267
- "&:hover": {
1268
- color: e.modalCloseIconHoverColor,
1269
- backgroundColor: e.colorBgTextHover,
1270
- textDecoration: "none"
1271
- },
1272
- "&:active": {
1273
- backgroundColor: e.colorBgTextActive
1274
- }
1275
- }, _t(e)),
1276
- [`${t}-header`]: {
1277
- color: e.colorText,
1278
- background: e.headerBg,
1279
- borderRadius: `${P(e.borderRadiusLG)} ${P(e.borderRadiusLG)} 0 0`,
1280
- marginBottom: e.headerMarginBottom,
1281
- padding: e.headerPadding,
1282
- borderBottom: e.headerBorderBottom
1283
- },
1284
- [`${t}-body`]: {
1285
- fontSize: e.fontSize,
1286
- lineHeight: e.lineHeight,
1287
- wordWrap: "break-word",
1288
- padding: e.bodyPadding,
1289
- [`${t}-body-skeleton`]: {
1290
- width: "100%",
1291
- height: "100%",
1292
- display: "flex",
1293
- justifyContent: "center",
1294
- alignItems: "center",
1295
- margin: `${P(e.margin)} auto`
1296
- }
1297
- },
1298
- [`${t}-footer`]: {
1299
- textAlign: "end",
1300
- background: e.footerBg,
1301
- marginTop: e.footerMarginTop,
1302
- padding: e.footerPadding,
1303
- borderTop: e.footerBorderTop,
1304
- borderRadius: e.footerBorderRadius,
1305
- [`> ${e.antCls}-btn + ${e.antCls}-btn`]: {
1306
- marginInlineStart: e.marginXS
1307
- }
1308
- },
1309
- [`${t}-open`]: {
1310
- overflow: "hidden"
1311
- }
1312
- })
1313
- },
1314
- // ======================== Pure =========================
1315
- {
1316
- [`${t}-pure-panel`]: {
1317
- top: "auto",
1318
- padding: 0,
1319
- display: "flex",
1320
- flexDirection: "column",
1321
- [`${t}-content,
1322
- ${t}-body,
1323
- ${t}-confirm-body-wrapper`]: {
1324
- display: "flex",
1325
- flexDirection: "column",
1326
- flex: "auto"
1327
- },
1328
- [`${t}-confirm-body`]: {
1329
- marginBottom: "auto"
1330
- }
1331
- }
1332
- }
1333
- ];
1334
- }, Un = (e) => {
1335
- const {
1336
- componentCls: t
1337
- } = e;
1338
- return {
1339
- [`${t}-root`]: {
1340
- [`${t}-wrap-rtl`]: {
1341
- direction: "rtl",
1342
- [`${t}-confirm-body`]: {
1343
- direction: "rtl"
1344
- }
1345
- }
1346
- }
1347
- };
1348
- }, mt = (e) => {
1349
- const t = e.padding, n = e.fontSizeHeading5, o = e.lineHeightHeading5;
1350
- return Je(e, {
1351
- modalHeaderHeight: e.calc(e.calc(o).mul(n).equal()).add(e.calc(t).mul(2).equal()).equal(),
1352
- modalFooterBorderColorSplit: e.colorSplit,
1353
- modalFooterBorderStyle: e.lineType,
1354
- modalFooterBorderWidth: e.lineWidth,
1355
- modalCloseIconColor: e.colorIcon,
1356
- modalCloseIconHoverColor: e.colorIconHover,
1357
- modalCloseBtnSize: e.controlHeight,
1358
- modalConfirmIconSize: e.fontHeight,
1359
- modalTitleHeight: e.calc(e.titleFontSize).mul(e.titleLineHeight).equal()
1360
- });
1361
- }, ft = (e) => ({
1362
- footerBg: "transparent",
1363
- headerBg: e.colorBgElevated,
1364
- titleLineHeight: e.lineHeightHeading5,
1365
- titleFontSize: e.fontSizeHeading5,
1366
- contentBg: e.colorBgElevated,
1367
- titleColor: e.colorTextHeading,
1368
- // internal
1369
- contentPadding: e.wireframe ? 0 : `${P(e.paddingMD)} ${P(e.paddingContentHorizontalLG)}`,
1370
- headerPadding: e.wireframe ? `${P(e.padding)} ${P(e.paddingLG)}` : 0,
1371
- headerBorderBottom: e.wireframe ? `${P(e.lineWidth)} ${e.lineType} ${e.colorSplit}` : "none",
1372
- headerMarginBottom: e.wireframe ? 0 : e.marginXS,
1373
- bodyPadding: e.wireframe ? e.paddingLG : 0,
1374
- footerPadding: e.wireframe ? `${P(e.paddingXS)} ${P(e.padding)}` : 0,
1375
- footerBorderTop: e.wireframe ? `${P(e.lineWidth)} ${e.lineType} ${e.colorSplit}` : "none",
1376
- footerBorderRadius: e.wireframe ? `0 0 ${P(e.borderRadiusLG)} ${P(e.borderRadiusLG)}` : 0,
1377
- footerMarginTop: e.wireframe ? 0 : e.marginSM,
1378
- confirmBodyPadding: e.wireframe ? `${P(e.padding * 2)} ${P(e.padding * 2)} ${P(e.paddingLG)}` : 0,
1379
- confirmIconMarginInlineEnd: e.wireframe ? e.margin : e.marginSM,
1380
- confirmBtnsMarginTop: e.wireframe ? e.marginLG : e.marginSM
1381
- }), gt = Ye("Modal", (e) => {
1382
- const t = mt(e);
1383
- return [Gn(t), Un(t), qn(t), nn(t, "zoom")];
1384
- }, ft, {
1385
- unitless: {
1386
- titleLineHeight: !0
1387
- }
1388
- });
1389
- var Xn = function(e, t) {
1390
- var n = {};
1391
- for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
1392
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
1393
- t.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (n[o[a]] = e[o[a]]);
1394
- return n;
1395
- };
1396
- let ye;
1397
- const Kn = (e) => {
1398
- ye = {
1399
- x: e.pageX,
1400
- y: e.pageY
1401
- }, setTimeout(() => {
1402
- ye = null;
1403
- }, 100);
1404
- };
1405
- $n() && document.documentElement.addEventListener("click", Kn, !0);
1406
- const Ct = (e) => {
1407
- var t;
1408
- const {
1409
- getPopupContainer: n,
1410
- getPrefixCls: o,
1411
- direction: a,
1412
- modal: r
1413
- } = l.useContext(L), d = (D) => {
1414
- const {
1415
- onCancel: M
1416
- } = e;
1417
- M == null || M(D);
1418
- }, c = (D) => {
1419
- const {
1420
- onOk: M
1421
- } = e;
1422
- M == null || M(D);
1423
- };
1424
- if (process.env.NODE_ENV !== "production") {
1425
- const D = xe("Modal");
1426
- [["visible", "open"], ["bodyStyle", "styles.body"], ["maskStyle", "styles.mask"]].forEach((M) => {
1427
- let [le, de] = M;
1428
- D.deprecated(!(le in e), le, de);
1429
- });
1430
- }
1431
- const {
1432
- prefixCls: i,
1433
- className: u,
1434
- rootClassName: s,
1435
- open: m,
1436
- wrapClassName: g,
1437
- centered: v,
1438
- getContainer: b,
1439
- focusTriggerAfterClose: f = !0,
1440
- style: x,
1441
- // Deprecated
1442
- visible: p,
1443
- width: C = 520,
1444
- footer: y,
1445
- classNames: $,
1446
- styles: N,
1447
- children: E,
1448
- loading: O
1449
- } = e, R = Xn(e, ["prefixCls", "className", "rootClassName", "open", "wrapClassName", "centered", "getContainer", "focusTriggerAfterClose", "style", "visible", "width", "footer", "classNames", "styles", "children", "loading"]), w = o("modal", i), z = o(), T = ot(w), [_, F, B] = gt(w, T), H = S(g, {
1450
- [`${w}-centered`]: !!v,
1451
- [`${w}-wrap-rtl`]: a === "rtl"
1452
- }), V = y !== null && !O ? /* @__PURE__ */ l.createElement(ut, Object.assign({}, e, {
1453
- onOk: c,
1454
- onCancel: d
1455
- })) : null, [W, G, ne] = xn(_e(e), _e(r), {
1456
- closable: !0,
1457
- closeIcon: /* @__PURE__ */ l.createElement(Ne, {
1458
- className: `${w}-close-icon`
1459
- }),
1460
- closeIconRender: (D) => dt(w, D)
1461
- }), K = Wn(`.${w}-content`), [Q, A] = on("Modal", R.zIndex);
1462
- return _(/* @__PURE__ */ l.createElement(an, {
1463
- form: !0,
1464
- space: !0
1465
- }, /* @__PURE__ */ l.createElement(ln.Provider, {
1466
- value: A
1467
- }, /* @__PURE__ */ l.createElement(ct, Object.assign({
1468
- width: C
1469
- }, R, {
1470
- zIndex: Q,
1471
- getContainer: b === void 0 ? n : b,
1472
- prefixCls: w,
1473
- rootClassName: S(F, s, B, T),
1474
- footer: V,
1475
- visible: m ?? p,
1476
- mousePosition: (t = R.mousePosition) !== null && t !== void 0 ? t : ye,
1477
- onClose: d,
1478
- closable: W && {
1479
- disabled: ne,
1480
- closeIcon: G
1481
- },
1482
- closeIcon: G,
1483
- focusTriggerAfterClose: f,
1484
- transitionName: ie(z, "zoom", e.transitionName),
1485
- maskTransitionName: ie(z, "fade", e.maskTransitionName),
1486
- className: S(F, u, r == null ? void 0 : r.className),
1487
- style: Object.assign(Object.assign({}, r == null ? void 0 : r.style), x),
1488
- classNames: Object.assign(Object.assign(Object.assign({}, r == null ? void 0 : r.classNames), $), {
1489
- wrapper: S(H, $ == null ? void 0 : $.wrapper)
1490
- }),
1491
- styles: Object.assign(Object.assign({}, r == null ? void 0 : r.styles), N),
1492
- panelRef: K
1493
- }), O ? /* @__PURE__ */ l.createElement(Y, {
1494
- active: !0,
1495
- title: !1,
1496
- paragraph: {
1497
- rows: 4
1498
- },
1499
- className: `${w}-body-skeleton`
1500
- }) : E))));
1501
- }, Qn = (e) => {
1502
- const {
1503
- componentCls: t,
1504
- titleFontSize: n,
1505
- titleLineHeight: o,
1506
- modalConfirmIconSize: a,
1507
- fontSize: r,
1508
- lineHeight: d,
1509
- modalTitleHeight: c,
1510
- fontHeight: i,
1511
- confirmBodyPadding: u
1512
- } = e, s = `${t}-confirm`;
1513
- return {
1514
- [s]: {
1515
- "&-rtl": {
1516
- direction: "rtl"
1517
- },
1518
- [`${e.antCls}-modal-header`]: {
1519
- display: "none"
1520
- },
1521
- [`${s}-body-wrapper`]: Object.assign({}, Wt()),
1522
- [`&${t} ${t}-body`]: {
1523
- padding: u
1524
- },
1525
- // ====================== Body ======================
1526
- [`${s}-body`]: {
1527
- display: "flex",
1528
- flexWrap: "nowrap",
1529
- alignItems: "start",
1530
- [`> ${e.iconCls}`]: {
1531
- flex: "none",
1532
- fontSize: a,
1533
- marginInlineEnd: e.confirmIconMarginInlineEnd,
1534
- marginTop: e.calc(e.calc(i).sub(a).equal()).div(2).equal()
1535
- },
1536
- [`&-has-title > ${e.iconCls}`]: {
1537
- marginTop: e.calc(e.calc(c).sub(a).equal()).div(2).equal()
1538
- }
1539
- },
1540
- [`${s}-paragraph`]: {
1541
- display: "flex",
1542
- flexDirection: "column",
1543
- flex: "auto",
1544
- rowGap: e.marginXS
1545
- },
1546
- // https://github.com/ant-design/ant-design/issues/48159
1547
- [`${e.iconCls} + ${s}-paragraph`]: {
1548
- maxWidth: `calc(100% - ${P(e.calc(e.modalConfirmIconSize).add(e.marginSM).equal())})`
1549
- },
1550
- [`${s}-title`]: {
1551
- color: e.colorTextHeading,
1552
- fontWeight: e.fontWeightStrong,
1553
- fontSize: n,
1554
- lineHeight: o
1555
- },
1556
- [`${s}-content`]: {
1557
- color: e.colorText,
1558
- fontSize: r,
1559
- lineHeight: d
1560
- },
1561
- // ===================== Footer =====================
1562
- [`${s}-btns`]: {
1563
- textAlign: "end",
1564
- marginTop: e.confirmBtnsMarginTop,
1565
- [`${e.antCls}-btn + ${e.antCls}-btn`]: {
1566
- marginBottom: 0,
1567
- marginInlineStart: e.marginXS
1568
- }
1569
- }
1570
- },
1571
- [`${s}-error ${s}-body > ${e.iconCls}`]: {
1572
- color: e.colorError
1573
- },
1574
- [`${s}-warning ${s}-body > ${e.iconCls},
1575
- ${s}-confirm ${s}-body > ${e.iconCls}`]: {
1576
- color: e.colorWarning
1577
- },
1578
- [`${s}-info ${s}-body > ${e.iconCls}`]: {
1579
- color: e.colorInfo
1580
- },
1581
- [`${s}-success ${s}-body > ${e.iconCls}`]: {
1582
- color: e.colorSuccess
1583
- }
1584
- };
1585
- }, Zn = Vt(["Modal", "confirm"], (e) => {
1586
- const t = mt(e);
1587
- return [Qn(t)];
1588
- }, ft, {
1589
- // confirm is weak than modal since no conflict here
1590
- order: -1e3
1591
- });
1592
- var Yn = function(e, t) {
1593
- var n = {};
1594
- for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
1595
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
1596
- t.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (n[o[a]] = e[o[a]]);
1597
- return n;
1598
- };
1599
- function vt(e) {
1600
- const {
1601
- prefixCls: t,
1602
- icon: n,
1603
- okText: o,
1604
- cancelText: a,
1605
- confirmPrefixCls: r,
1606
- type: d,
1607
- okCancel: c,
1608
- footer: i,
1609
- // Legacy for static function usage
1610
- locale: u
1611
- } = e, s = Yn(e, ["prefixCls", "icon", "okText", "cancelText", "confirmPrefixCls", "type", "okCancel", "footer", "locale"]);
1612
- if (process.env.NODE_ENV !== "production") {
1613
- const O = xe("Modal");
1614
- process.env.NODE_ENV !== "production" && O(!(typeof n == "string" && n.length > 2), "breaking", `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${n}\` at https://ant.design/components/icon`);
1615
- }
1616
- let m = n;
1617
- if (!n && n !== null)
1618
- switch (d) {
1619
- case "info":
1620
- m = /* @__PURE__ */ l.createElement(zt, null);
1621
- break;
1622
- case "success":
1623
- m = /* @__PURE__ */ l.createElement(Bt, null);
1624
- break;
1625
- case "error":
1626
- m = /* @__PURE__ */ l.createElement(Kt, null);
1627
- break;
1628
- default:
1629
- m = /* @__PURE__ */ l.createElement(Mt, null);
1630
- }
1631
- const g = c ?? d === "confirm", v = e.autoFocusButton === null ? !1 : e.autoFocusButton || "ok", [b] = Oe("Modal"), f = u || b, x = o || (g ? f == null ? void 0 : f.okText : f == null ? void 0 : f.justOkText), p = a || (f == null ? void 0 : f.cancelText), C = Object.assign({
1632
- autoFocusButton: v,
1633
- cancelTextLocale: p,
1634
- okTextLocale: x,
1635
- mergedOkCancel: g
1636
- }, s), y = l.useMemo(() => C, q(Object.values(C))), $ = /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(Ae, null), /* @__PURE__ */ l.createElement(De, null)), N = e.title !== void 0 && e.title !== null, E = `${r}-body`;
1637
- return /* @__PURE__ */ l.createElement("div", {
1638
- className: `${r}-body-wrapper`
1639
- }, /* @__PURE__ */ l.createElement("div", {
1640
- className: S(E, {
1641
- [`${E}-has-title`]: N
1642
- })
1643
- }, m, /* @__PURE__ */ l.createElement("div", {
1644
- className: `${r}-paragraph`
1645
- }, N && /* @__PURE__ */ l.createElement("span", {
1646
- className: `${r}-title`
1647
- }, e.title), /* @__PURE__ */ l.createElement("div", {
1648
- className: `${r}-content`
1649
- }, e.content))), i === void 0 || typeof i == "function" ? /* @__PURE__ */ l.createElement(rt, {
1650
- value: y
1651
- }, /* @__PURE__ */ l.createElement("div", {
1652
- className: `${r}-btns`
1653
- }, typeof i == "function" ? i($, {
1654
- OkBtn: De,
1655
- CancelBtn: Ae
1656
- }) : $)) : i, /* @__PURE__ */ l.createElement(Zn, {
1657
- prefixCls: t
1658
- }));
1659
- }
1660
- const bt = (e) => {
1661
- const {
1662
- close: t,
1663
- zIndex: n,
1664
- afterClose: o,
1665
- open: a,
1666
- keyboard: r,
1667
- centered: d,
1668
- getContainer: c,
1669
- maskStyle: i,
1670
- direction: u,
1671
- prefixCls: s,
1672
- wrapClassName: m,
1673
- rootPrefixCls: g,
1674
- bodyStyle: v,
1675
- closable: b = !1,
1676
- closeIcon: f,
1677
- modalRender: x,
1678
- focusTriggerAfterClose: p,
1679
- onConfirm: C,
1680
- styles: y
1681
- } = e;
1682
- if (process.env.NODE_ENV !== "production") {
1683
- const _ = xe("Modal");
1684
- [["visible", "open"], ["bodyStyle", "styles.body"], ["maskStyle", "styles.mask"]].forEach((F) => {
1685
- let [B, H] = F;
1686
- _.deprecated(!(B in e), B, H);
1687
- });
1688
- }
1689
- const $ = `${s}-confirm`, N = e.width || 416, E = e.style || {}, O = e.mask === void 0 ? !0 : e.mask, R = e.maskClosable === void 0 ? !1 : e.maskClosable, w = S($, `${$}-${e.type}`, {
1690
- [`${$}-rtl`]: u === "rtl"
1691
- }, e.className), [, z] = qt(), T = l.useMemo(() => n !== void 0 ? n : z.zIndexPopupBase + rn, [n, z]);
1692
- return /* @__PURE__ */ l.createElement(Ct, {
1693
- prefixCls: s,
1694
- className: w,
1695
- wrapClassName: S({
1696
- [`${$}-centered`]: !!e.centered
1697
- }, m),
1698
- onCancel: () => {
1699
- t == null || t({
1700
- triggerCancel: !0
1701
- }), C == null || C(!1);
1702
- },
1703
- open: a,
1704
- title: "",
1705
- footer: null,
1706
- transitionName: ie(g || "", "zoom", e.transitionName),
1707
- maskTransitionName: ie(g || "", "fade", e.maskTransitionName),
1708
- mask: O,
1709
- maskClosable: R,
1710
- style: E,
1711
- styles: Object.assign({
1712
- body: v,
1713
- mask: i
1714
- }, y),
1715
- width: N,
1716
- zIndex: T,
1717
- afterClose: o,
1718
- keyboard: r,
1719
- centered: d,
1720
- getContainer: c,
1721
- closable: b,
1722
- closeIcon: f,
1723
- modalRender: x,
1724
- focusTriggerAfterClose: p
1725
- }, /* @__PURE__ */ l.createElement(vt, Object.assign({}, e, {
1726
- confirmPrefixCls: $
1727
- })));
1728
- }, je = (e) => {
1729
- const {
1730
- rootPrefixCls: t,
1731
- iconPrefixCls: n,
1732
- direction: o,
1733
- theme: a
1734
- } = e;
1735
- return /* @__PURE__ */ l.createElement(tt, {
1736
- prefixCls: t,
1737
- iconPrefixCls: n,
1738
- direction: o,
1739
- theme: a
1740
- }, /* @__PURE__ */ l.createElement(bt, Object.assign({}, e)));
1741
- };
1742
- process.env.NODE_ENV !== "production" && (bt.displayName = "ConfirmDialog", je.displayName = "ConfirmDialogWrapper");
1743
- const Z = [];
1744
- let pt = "";
1745
- function ht() {
1746
- return pt;
1747
- }
1748
- const Jn = (e) => {
1749
- var t, n;
1750
- const {
1751
- prefixCls: o,
1752
- getContainer: a,
1753
- direction: r
1754
- } = e, d = et(), c = ee(L), i = ht() || c.getPrefixCls(), u = o || `${i}-modal`;
1755
- let s = a;
1756
- return s === !1 && (s = void 0, process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "production" && nt(!1, "Modal", "Static method not support `getContainer` to be `false` since it do not have context env.")), /* @__PURE__ */ h.createElement(je, Object.assign({}, e, {
1757
- rootPrefixCls: i,
1758
- prefixCls: u,
1759
- iconPrefixCls: c.iconPrefixCls,
1760
- theme: c.theme,
1761
- direction: r ?? c.direction,
1762
- locale: (n = (t = c.locale) === null || t === void 0 ? void 0 : t.Modal) !== null && n !== void 0 ? n : d,
1763
- getContainer: s
1764
- }));
1765
- };
1766
- function ae(e) {
1767
- const t = Ut();
1768
- process.env.NODE_ENV !== "production" && !t.holderRender && Gt("Modal");
1769
- const n = document.createDocumentFragment();
1770
- let o = Object.assign(Object.assign({}, e), {
1771
- close: c,
1772
- open: !0
1773
- }), a;
1774
- function r() {
1775
- for (var u, s = arguments.length, m = new Array(s), g = 0; g < s; g++)
1776
- m[g] = arguments[g];
1777
- if (m.some((f) => f == null ? void 0 : f.triggerCancel)) {
1778
- var b;
1779
- (u = e.onCancel) === null || u === void 0 || (b = u).call.apply(b, [e, () => {
1780
- }].concat(q(m.slice(1))));
1781
- }
1782
- for (let f = 0; f < Z.length; f++)
1783
- if (Z[f] === c) {
1784
- Z.splice(f, 1);
1785
- break;
1786
- }
1787
- Qt(n);
1788
- }
1789
- function d(u) {
1790
- clearTimeout(a), a = setTimeout(() => {
1791
- const s = t.getPrefixCls(void 0, ht()), m = t.getIconPrefixCls(), g = t.getTheme(), v = /* @__PURE__ */ h.createElement(Jn, Object.assign({}, u));
1792
- Zt(/* @__PURE__ */ h.createElement(tt, {
1793
- prefixCls: s,
1794
- iconPrefixCls: m,
1795
- theme: g
1796
- }, t.holderRender ? t.holderRender(v) : v), n);
1797
- });
1798
- }
1799
- function c() {
1800
- for (var u = arguments.length, s = new Array(u), m = 0; m < u; m++)
1801
- s[m] = arguments[m];
1802
- o = Object.assign(Object.assign({}, o), {
1803
- open: !1,
1804
- afterClose: () => {
1805
- typeof e.afterClose == "function" && e.afterClose(), r.apply(this, s);
1806
- }
1807
- }), o.visible && delete o.visible, d(o);
1808
- }
1809
- function i(u) {
1810
- typeof u == "function" ? o = u(o) : o = Object.assign(Object.assign({}, o), u), d(o);
1811
- }
1812
- return d(o), Z.push(c), {
1813
- destroy: c,
1814
- update: i
1815
- };
1816
- }
1817
- function yt(e) {
1818
- return Object.assign(Object.assign({}, e), {
1819
- type: "warning"
1820
- });
1821
- }
1822
- function xt(e) {
1823
- return Object.assign(Object.assign({}, e), {
1824
- type: "info"
1825
- });
1826
- }
1827
- function $t(e) {
1828
- return Object.assign(Object.assign({}, e), {
1829
- type: "success"
1830
- });
1831
- }
1832
- function St(e) {
1833
- return Object.assign(Object.assign({}, e), {
1834
- type: "error"
1835
- });
1836
- }
1837
- function Ot(e) {
1838
- return Object.assign(Object.assign({}, e), {
1839
- type: "confirm"
1840
- });
1841
- }
1842
- function eo(e) {
1843
- let {
1844
- rootPrefixCls: t
1845
- } = e;
1846
- process.env.NODE_ENV !== "production" && nt(!1, "Modal", "Modal.config is deprecated. Please use ConfigProvider.config instead."), pt = t;
1847
- }
1848
- var to = function(e, t) {
1849
- var n = {};
1850
- for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
1851
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
1852
- t.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (n[o[a]] = e[o[a]]);
1853
- return n;
1854
- };
1855
- const no = (e, t) => {
1856
- var n, {
1857
- afterClose: o,
1858
- config: a
1859
- } = e, r = to(e, ["afterClose", "config"]);
1860
- const [d, c] = l.useState(!0), [i, u] = l.useState(a), {
1861
- direction: s,
1862
- getPrefixCls: m
1863
- } = l.useContext(L), g = m("modal"), v = m(), b = () => {
1864
- var C;
1865
- o(), (C = i.afterClose) === null || C === void 0 || C.call(i);
1866
- }, f = function() {
1867
- var C;
1868
- c(!1);
1869
- for (var y = arguments.length, $ = new Array(y), N = 0; N < y; N++)
1870
- $[N] = arguments[N];
1871
- if ($.some((R) => R == null ? void 0 : R.triggerCancel)) {
1872
- var O;
1873
- (C = i.onCancel) === null || C === void 0 || (O = C).call.apply(O, [i, () => {
1874
- }].concat(q($.slice(1))));
1875
- }
1876
- };
1877
- l.useImperativeHandle(t, () => ({
1878
- destroy: f,
1879
- update: (C) => {
1880
- u((y) => Object.assign(Object.assign({}, y), C));
1881
- }
1882
- }));
1883
- const x = (n = i.okCancel) !== null && n !== void 0 ? n : i.type === "confirm", [p] = Oe("Modal", Xt.Modal);
1884
- return /* @__PURE__ */ l.createElement(je, Object.assign({
1885
- prefixCls: g,
1886
- rootPrefixCls: v
1887
- }, i, {
1888
- close: f,
1889
- open: d,
1890
- afterClose: b,
1891
- okText: i.okText || (x ? p == null ? void 0 : p.okText : p == null ? void 0 : p.justOkText),
1892
- direction: i.direction || s,
1893
- cancelText: i.cancelText || (p == null ? void 0 : p.cancelText)
1894
- }, r));
1895
- }, oo = /* @__PURE__ */ l.forwardRef(no);
1896
- let Qe = 0;
1897
- const ao = /* @__PURE__ */ l.memo(/* @__PURE__ */ l.forwardRef((e, t) => {
1898
- const [n, o] = dn();
1899
- return l.useImperativeHandle(t, () => ({
1900
- patchElement: o
1901
- }), []), /* @__PURE__ */ l.createElement(l.Fragment, null, n);
1902
- }));
1903
- function lo() {
1904
- const e = l.useRef(null), [t, n] = l.useState([]);
1905
- l.useEffect(() => {
1906
- t.length && (q(t).forEach((d) => {
1907
- d();
1908
- }), n([]));
1909
- }, [t]);
1910
- const o = l.useCallback((r) => function(c) {
1911
- var i;
1912
- Qe += 1;
1913
- const u = /* @__PURE__ */ l.createRef();
1914
- let s;
1915
- const m = new Promise((x) => {
1916
- s = x;
1917
- });
1918
- let g = !1, v;
1919
- const b = /* @__PURE__ */ l.createElement(oo, {
1920
- key: `modal-${Qe}`,
1921
- config: r(c),
1922
- ref: u,
1923
- afterClose: () => {
1924
- v == null || v();
1925
- },
1926
- isSilent: () => g,
1927
- onConfirm: (x) => {
1928
- s(x);
1929
- }
1930
- });
1931
- return v = (i = e.current) === null || i === void 0 ? void 0 : i.patchElement(b), v && Z.push(v), {
1932
- destroy: () => {
1933
- function x() {
1934
- var p;
1935
- (p = u.current) === null || p === void 0 || p.destroy();
1936
- }
1937
- u.current ? x() : n((p) => [].concat(q(p), [x]));
1938
- },
1939
- update: (x) => {
1940
- function p() {
1941
- var C;
1942
- (C = u.current) === null || C === void 0 || C.update(x);
1943
- }
1944
- u.current ? p() : n((C) => [].concat(q(C), [p]));
1945
- },
1946
- then: (x) => (g = !0, m.then(x))
1947
- };
1948
- }, []);
1949
- return [l.useMemo(() => ({
1950
- info: o(xt),
1951
- success: o($t),
1952
- error: o(St),
1953
- warning: o(yt),
1954
- confirm: o(Ot)
1955
- }), []), /* @__PURE__ */ l.createElement(ao, {
1956
- key: "modal-holder",
1957
- ref: e
1958
- })];
1959
- }
1960
- var ro = function(e, t) {
1961
- var n = {};
1962
- for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
1963
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(e); a < o.length; a++)
1964
- t.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[a]) && (n[o[a]] = e[o[a]]);
1965
- return n;
1966
- };
1967
- const io = (e) => {
1968
- const {
1969
- prefixCls: t,
1970
- className: n,
1971
- closeIcon: o,
1972
- closable: a,
1973
- type: r,
1974
- title: d,
1975
- children: c,
1976
- footer: i
1977
- } = e, u = ro(e, ["prefixCls", "className", "closeIcon", "closable", "type", "title", "children", "footer"]), {
1978
- getPrefixCls: s
1979
- } = l.useContext(L), m = s(), g = t || s("modal"), v = ot(m), [b, f, x] = gt(g, v), p = `${g}-confirm`;
1980
- let C = {};
1981
- return r ? C = {
1982
- closable: a ?? !1,
1983
- title: "",
1984
- footer: "",
1985
- children: /* @__PURE__ */ l.createElement(vt, Object.assign({}, e, {
1986
- prefixCls: g,
1987
- confirmPrefixCls: p,
1988
- rootPrefixCls: m,
1989
- content: c
1990
- }))
1991
- } : C = {
1992
- closable: a ?? !0,
1993
- title: d,
1994
- footer: i !== null && /* @__PURE__ */ l.createElement(ut, Object.assign({}, e)),
1995
- children: c
1996
- }, b(/* @__PURE__ */ l.createElement(Ie, Object.assign({
1997
- prefixCls: g,
1998
- className: S(f, `${g}-pure-panel`, r && p, r && `${p}-${r}`, n, x, v)
1999
- }, u, {
2000
- closeIcon: dt(g, o),
2001
- closable: a
2002
- }, C)));
2003
- }, so = sn(io);
2004
- function Et(e) {
2005
- return ae(yt(e));
2006
- }
2007
- const k = Ct;
2008
- k.useModal = lo;
2009
- k.info = function(t) {
2010
- return ae(xt(t));
2011
- };
2012
- k.success = function(t) {
2013
- return ae($t(t));
2014
- };
2015
- k.error = function(t) {
2016
- return ae(St(t));
2017
- };
2018
- k.warning = Et;
2019
- k.warn = Et;
2020
- k.confirm = function(t) {
2021
- return ae(Ot(t));
2022
- };
2023
- k.destroyAll = function() {
2024
- for (; Z.length; ) {
2025
- const t = Z.pop();
2026
- t && t();
2027
- }
2028
- };
2029
- k.config = eo;
2030
- k._InternalPanelDoNotUseOrYouWillBeFired = so;
2031
- process.env.NODE_ENV !== "production" && (k.displayName = "Modal");
2032
- function Eo(e) {
2033
- const t = ee(Tt);
2034
- if (!t)
2035
- return null;
2036
- const n = {
2037
- open: e.open === void 0 ? !0 : e.open,
2038
- onClose: e.onClose || (() => {
2039
- }),
2040
- collapse: e.collapse === void 0 ? !1 : e.collapse
2041
- };
2042
- return /* @__PURE__ */ Te(
2043
- k,
2044
- {
2045
- title: "Notification Preferences",
2046
- open: n.open,
2047
- onCancel: () => {
2048
- n.onClose();
2049
- },
2050
- footer: null,
2051
- zIndex: 9999,
2052
- children: [
2053
- /* @__PURE__ */ ge(jt, {}),
2054
- t.webPushOptInMessage && /* @__PURE__ */ Te("div", { children: [
2055
- /* @__PURE__ */ ge(cn, { style: { margin: "10px 0" } }),
2056
- /* @__PURE__ */ ge(
2057
- Ht,
2058
- {
2059
- hideAfterInteraction: !1,
2060
- descriptionStyle: { fontSize: 12 }
2061
- }
2062
- )
2063
- ] })
2064
- ]
2065
- }
2066
- );
2067
- }
1
+ import "react/jsx-runtime";
2
+ import "react";
3
+ import "./Preferences.js";
4
+ import "../Provider/context.js";
5
+ import "../../assets/WebPushOptInMessage.js";
6
+ import { N as f } from "../../assets/NotificationPreferencesPopup.js";
2068
7
  export {
2069
- Eo as NotificationPreferencesPopup
8
+ f as NotificationPreferencesPopup
2070
9
  };