@notificationapi/react 0.0.24 → 0.0.25

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 (48) hide show
  1. package/dist/assets/AntdIcon.js +200 -0
  2. package/dist/assets/Notification.js +118 -119
  3. package/dist/assets/PurePanel.js +69 -0
  4. package/dist/assets/RightOutlined.js +13 -0
  5. package/dist/assets/button.js +19 -18
  6. package/dist/assets/channelUtils.js +77 -0
  7. package/dist/assets/colors.js +8534 -9304
  8. package/dist/assets/index.js +16 -15
  9. package/dist/assets/index2.js +33 -32
  10. package/dist/assets/index3.js +722 -8531
  11. package/dist/assets/index4.js +8408 -0
  12. package/dist/assets/pickAttrs.js +42 -0
  13. package/dist/components/Notifications/Inbox.d.ts +3 -7
  14. package/dist/components/Notifications/Inbox.js +6250 -8
  15. package/dist/components/Notifications/InboxHeader.d.ts +1 -1
  16. package/dist/components/Notifications/InboxHeader.js +8 -7
  17. package/dist/components/Notifications/Notification.d.ts +2 -5
  18. package/dist/components/Notifications/Notification.js +3 -4
  19. package/dist/components/Notifications/NotificationCounter.d.ts +2 -2
  20. package/dist/components/Notifications/NotificationFeed.d.ts +4 -5
  21. package/dist/components/Notifications/NotificationFeed.js +28 -26
  22. package/dist/components/Notifications/NotificationLauncher.d.ts +1 -6
  23. package/dist/components/Notifications/NotificationLauncher.js +16 -18
  24. package/dist/components/Notifications/NotificationPopup.d.ts +5 -9
  25. package/dist/components/Notifications/NotificationPopup.js +119 -12
  26. package/dist/components/Notifications/UnreadBadge.d.ts +4 -7
  27. package/dist/components/Notifications/UnreadBadge.js +8 -10
  28. package/dist/components/Notifications/index.js +5 -5
  29. package/dist/components/Notifications/interface.d.ts +46 -0
  30. package/dist/components/Notifications/interface.js +19 -0
  31. package/dist/components/Preferences/NotificationPreferencesInline.d.ts +1 -1
  32. package/dist/components/Preferences/NotificationPreferencesInline.js +1 -1
  33. package/dist/components/Preferences/NotificationPreferencesPopup.js +1503 -4
  34. package/dist/components/Preferences/PreferenceInput.d.ts +5 -4
  35. package/dist/components/Preferences/PreferenceInput.js +1435 -4
  36. package/dist/components/Preferences/Preferences.d.ts +1 -4
  37. package/dist/components/Preferences/Preferences.js +581 -8
  38. package/dist/components/Preferences/channelUtils.d.ts +4 -0
  39. package/dist/components/Preferences/channelUtils.js +8 -0
  40. package/dist/components/Preferences/index.js +1 -1
  41. package/dist/components/Provider/index.d.ts +2 -2
  42. package/dist/components/Provider/index.js +150 -126
  43. package/dist/main.d.ts +2 -2
  44. package/dist/main.js +9 -9
  45. package/package.json +5 -2
  46. package/dist/assets/Inbox.js +0 -6363
  47. package/dist/assets/NotificationPreferencesPopup.js +0 -1562
  48. package/dist/assets/Preferences.js +0 -2120
@@ -1,2120 +0,0 @@
1
- import { jsx as R, Fragment as Z, jsxs as q } from "react/jsx-runtime";
2
- import { NotificationAPIContext as Ue } from "../components/Provider/index.js";
3
- import * as s from "react";
4
- import B, { forwardRef as Qe, useRef as pe, useImperativeHandle as Ye, useContext as Je } from "react";
5
- import { s as de, _ as T, L as te, v as oe, c as _, M as A, g as ae, m as ie, r as G, u as M, N as Ee, C as L, n as Ze, f as re, D as Oe, d as en, O as nn, t as tn, o as on, Q as an, a as be, k as rn, T as ln, R as V } from "./colors.js";
6
- import { I as W, u as Q, F as cn, p as ke, W as Ne, w as sn, j as he, K as ee, x as ge, y as dn, o as ve, A as un, B as hn, e as gn, T as fn } from "./index3.js";
7
- var mn = `accept acceptCharset accessKey action allowFullScreen allowTransparency
8
- alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
9
- charSet checked classID className colSpan cols content contentEditable contextMenu
10
- controls coords crossOrigin data dateTime default defer dir disabled download draggable
11
- encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
12
- headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
13
- is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
14
- mediaGroup method min minLength multiple muted name noValidate nonce open
15
- optimum pattern placeholder poster preload radioGroup readOnly rel required
16
- reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
17
- shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
18
- summary tabIndex target title type useMap value width wmode wrap`, pn = `onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
19
- onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
20
- onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
21
- onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
22
- onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
23
- onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
24
- onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`, bn = "".concat(mn, " ").concat(pn).split(/[\s\n]+/), vn = "aria-", Cn = "data-";
25
- function Ce(e, n) {
26
- return e.indexOf(n) === 0;
27
- }
28
- function Pe(e) {
29
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, a;
30
- n === !1 ? a = {
31
- aria: !0,
32
- data: !0,
33
- attr: !0
34
- } : n === !0 ? a = {
35
- aria: !0
36
- } : a = de({}, n);
37
- var t = {};
38
- return Object.keys(e).forEach(function(o) {
39
- // Aria
40
- (a.aria && (o === "role" || Ce(o, vn)) || // Data
41
- a.data && Ce(o, Cn) || // Attr
42
- a.attr && bn.includes(o)) && (t[o] = e[o]);
43
- }), t;
44
- }
45
- const yn = (e) => ({
46
- [e.componentCls]: {
47
- // For common/openAnimation
48
- [`${e.antCls}-motion-collapse-legacy`]: {
49
- overflow: "hidden",
50
- "&-active": {
51
- transition: `height ${e.motionDurationMid} ${e.motionEaseInOut},
52
- opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`
53
- }
54
- },
55
- [`${e.antCls}-motion-collapse`]: {
56
- overflow: "hidden",
57
- transition: `height ${e.motionDurationMid} ${e.motionEaseInOut},
58
- opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`
59
- }
60
- }
61
- });
62
- var $n = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z" } }] }, name: "right", theme: "outlined" }, Sn = function(n, a) {
63
- return /* @__PURE__ */ s.createElement(W, T({}, n, {
64
- ref: a,
65
- icon: $n
66
- }));
67
- }, Me = /* @__PURE__ */ s.forwardRef(Sn);
68
- process.env.NODE_ENV !== "production" && (Me.displayName = "RightOutlined");
69
- const ze = /* @__PURE__ */ s.createContext(null), xn = ze.Provider, Re = /* @__PURE__ */ s.createContext(null), In = Re.Provider;
70
- var wn = ["prefixCls", "className", "style", "checked", "disabled", "defaultChecked", "type", "title", "onChange"], En = /* @__PURE__ */ Qe(function(e, n) {
71
- var a = e.prefixCls, t = a === void 0 ? "rc-checkbox" : a, o = e.className, r = e.style, d = e.checked, i = e.disabled, c = e.defaultChecked, l = c === void 0 ? !1 : c, h = e.type, u = h === void 0 ? "checkbox" : h, C = e.title, m = e.onChange, O = te(e, wn), b = pe(null), p = pe(null), I = Q(l, {
72
- value: d
73
- }), y = oe(I, 2), S = y[0], v = y[1];
74
- Ye(n, function() {
75
- return {
76
- focus: function(f) {
77
- var w;
78
- (w = b.current) === null || w === void 0 || w.focus(f);
79
- },
80
- blur: function() {
81
- var f;
82
- (f = b.current) === null || f === void 0 || f.blur();
83
- },
84
- input: b.current,
85
- nativeElement: p.current
86
- };
87
- });
88
- var x = _(t, o, A(A({}, "".concat(t, "-checked"), S), "".concat(t, "-disabled"), i)), g = function(f) {
89
- i || ("checked" in e || v(f.target.checked), m == null || m({
90
- target: de(de({}, e), {}, {
91
- type: u,
92
- checked: f.target.checked
93
- }),
94
- stopPropagation: function() {
95
- f.stopPropagation();
96
- },
97
- preventDefault: function() {
98
- f.preventDefault();
99
- },
100
- nativeEvent: f.nativeEvent
101
- }));
102
- };
103
- return /* @__PURE__ */ s.createElement("span", {
104
- className: x,
105
- title: C,
106
- style: r,
107
- ref: p
108
- }, /* @__PURE__ */ s.createElement("input", T({}, O, {
109
- className: "".concat(t, "-input"),
110
- ref: b,
111
- onChange: g,
112
- disabled: i,
113
- checked: !!S,
114
- type: u
115
- })), /* @__PURE__ */ s.createElement("span", {
116
- className: "".concat(t, "-inner")
117
- }));
118
- });
119
- const On = (e) => {
120
- const {
121
- componentCls: n,
122
- antCls: a
123
- } = e, t = `${n}-group`;
124
- return {
125
- [t]: Object.assign(Object.assign({}, G(e)), {
126
- display: "inline-block",
127
- fontSize: 0,
128
- // RTL
129
- [`&${t}-rtl`]: {
130
- direction: "rtl"
131
- },
132
- [`${a}-badge ${a}-badge-count`]: {
133
- zIndex: 1
134
- },
135
- [`> ${a}-badge:not(:first-child) > ${a}-button-wrapper`]: {
136
- borderInlineStart: "none"
137
- }
138
- })
139
- };
140
- }, kn = (e) => {
141
- const {
142
- componentCls: n,
143
- wrapperMarginInlineEnd: a,
144
- colorPrimary: t,
145
- radioSize: o,
146
- motionDurationSlow: r,
147
- motionDurationMid: d,
148
- motionEaseInOutCirc: i,
149
- colorBgContainer: c,
150
- colorBorder: l,
151
- lineWidth: h,
152
- colorBgContainerDisabled: u,
153
- colorTextDisabled: C,
154
- paddingXS: m,
155
- dotColorDisabled: O,
156
- lineType: b,
157
- radioColor: p,
158
- radioBgColor: I,
159
- calc: y
160
- } = e, S = `${n}-inner`, x = y(o).sub(y(4).mul(2)), g = y(1).mul(o).equal();
161
- return {
162
- [`${n}-wrapper`]: Object.assign(Object.assign({}, G(e)), {
163
- display: "inline-flex",
164
- alignItems: "baseline",
165
- marginInlineStart: 0,
166
- marginInlineEnd: a,
167
- cursor: "pointer",
168
- // RTL
169
- [`&${n}-wrapper-rtl`]: {
170
- direction: "rtl"
171
- },
172
- "&-disabled": {
173
- cursor: "not-allowed",
174
- color: e.colorTextDisabled
175
- },
176
- "&::after": {
177
- display: "inline-block",
178
- width: 0,
179
- overflow: "hidden",
180
- content: '"\\a0"'
181
- },
182
- // hashId 在 wrapper 上,只能铺平
183
- [`${n}-checked::after`]: {
184
- position: "absolute",
185
- insetBlockStart: 0,
186
- insetInlineStart: 0,
187
- width: "100%",
188
- height: "100%",
189
- border: `${M(h)} ${b} ${t}`,
190
- borderRadius: "50%",
191
- visibility: "hidden",
192
- opacity: 0,
193
- content: '""'
194
- },
195
- [n]: Object.assign(Object.assign({}, G(e)), {
196
- position: "relative",
197
- display: "inline-block",
198
- outline: "none",
199
- cursor: "pointer",
200
- alignSelf: "center",
201
- borderRadius: "50%"
202
- }),
203
- [`${n}-wrapper:hover &,
204
- &:hover ${S}`]: {
205
- borderColor: t
206
- },
207
- [`${n}-input:focus-visible + ${S}`]: Object.assign({}, Ee(e)),
208
- [`${n}:hover::after, ${n}-wrapper:hover &::after`]: {
209
- visibility: "visible"
210
- },
211
- [`${n}-inner`]: {
212
- "&::after": {
213
- boxSizing: "border-box",
214
- position: "absolute",
215
- insetBlockStart: "50%",
216
- insetInlineStart: "50%",
217
- display: "block",
218
- width: g,
219
- height: g,
220
- marginBlockStart: y(1).mul(o).div(-2).equal(),
221
- marginInlineStart: y(1).mul(o).div(-2).equal(),
222
- backgroundColor: p,
223
- borderBlockStart: 0,
224
- borderInlineStart: 0,
225
- borderRadius: g,
226
- transform: "scale(0)",
227
- opacity: 0,
228
- transition: `all ${r} ${i}`,
229
- content: '""'
230
- },
231
- boxSizing: "border-box",
232
- position: "relative",
233
- insetBlockStart: 0,
234
- insetInlineStart: 0,
235
- display: "block",
236
- width: g,
237
- height: g,
238
- backgroundColor: c,
239
- borderColor: l,
240
- borderStyle: "solid",
241
- borderWidth: h,
242
- borderRadius: "50%",
243
- transition: `all ${d}`
244
- },
245
- [`${n}-input`]: {
246
- position: "absolute",
247
- inset: 0,
248
- zIndex: 1,
249
- cursor: "pointer",
250
- opacity: 0
251
- },
252
- // 选中状态
253
- [`${n}-checked`]: {
254
- [S]: {
255
- borderColor: t,
256
- backgroundColor: I,
257
- "&::after": {
258
- transform: `scale(${e.calc(e.dotSize).div(o).equal()})`,
259
- opacity: 1,
260
- transition: `all ${r} ${i}`
261
- }
262
- }
263
- },
264
- [`${n}-disabled`]: {
265
- cursor: "not-allowed",
266
- [S]: {
267
- backgroundColor: u,
268
- borderColor: l,
269
- cursor: "not-allowed",
270
- "&::after": {
271
- backgroundColor: O
272
- }
273
- },
274
- [`${n}-input`]: {
275
- cursor: "not-allowed"
276
- },
277
- [`${n}-disabled + span`]: {
278
- color: C,
279
- cursor: "not-allowed"
280
- },
281
- [`&${n}-checked`]: {
282
- [S]: {
283
- "&::after": {
284
- transform: `scale(${y(x).div(o).equal({
285
- unit: !1
286
- })})`
287
- }
288
- }
289
- }
290
- },
291
- [`span${n} + *`]: {
292
- paddingInlineStart: m,
293
- paddingInlineEnd: m
294
- }
295
- })
296
- };
297
- }, Nn = (e) => {
298
- const {
299
- buttonColor: n,
300
- controlHeight: a,
301
- componentCls: t,
302
- lineWidth: o,
303
- lineType: r,
304
- colorBorder: d,
305
- motionDurationSlow: i,
306
- motionDurationMid: c,
307
- buttonPaddingInline: l,
308
- fontSize: h,
309
- buttonBg: u,
310
- fontSizeLG: C,
311
- controlHeightLG: m,
312
- controlHeightSM: O,
313
- paddingXS: b,
314
- borderRadius: p,
315
- borderRadiusSM: I,
316
- borderRadiusLG: y,
317
- buttonCheckedBg: S,
318
- buttonSolidCheckedColor: v,
319
- colorTextDisabled: x,
320
- colorBgContainerDisabled: g,
321
- buttonCheckedBgDisabled: k,
322
- buttonCheckedColorDisabled: f,
323
- colorPrimary: w,
324
- colorPrimaryHover: N,
325
- colorPrimaryActive: $,
326
- buttonSolidCheckedBg: P,
327
- buttonSolidCheckedHoverBg: D,
328
- buttonSolidCheckedActiveBg: E,
329
- calc: z
330
- } = e;
331
- return {
332
- [`${t}-button-wrapper`]: {
333
- position: "relative",
334
- display: "inline-block",
335
- height: a,
336
- margin: 0,
337
- paddingInline: l,
338
- paddingBlock: 0,
339
- color: n,
340
- fontSize: h,
341
- lineHeight: M(z(a).sub(z(o).mul(2)).equal()),
342
- background: u,
343
- border: `${M(o)} ${r} ${d}`,
344
- // strange align fix for chrome but works
345
- // https://gw.alipayobjects.com/zos/rmsportal/VFTfKXJuogBAXcvfAUWJ.gif
346
- borderBlockStartWidth: z(o).add(0.02).equal(),
347
- borderInlineStartWidth: 0,
348
- borderInlineEndWidth: o,
349
- cursor: "pointer",
350
- transition: [`color ${c}`, `background ${c}`, `box-shadow ${c}`].join(","),
351
- a: {
352
- color: n
353
- },
354
- [`> ${t}-button`]: {
355
- position: "absolute",
356
- insetBlockStart: 0,
357
- insetInlineStart: 0,
358
- zIndex: -1,
359
- width: "100%",
360
- height: "100%"
361
- },
362
- "&:not(:first-child)": {
363
- "&::before": {
364
- position: "absolute",
365
- insetBlockStart: z(o).mul(-1).equal(),
366
- insetInlineStart: z(o).mul(-1).equal(),
367
- display: "block",
368
- boxSizing: "content-box",
369
- width: 1,
370
- height: "100%",
371
- paddingBlock: o,
372
- paddingInline: 0,
373
- backgroundColor: d,
374
- transition: `background-color ${i}`,
375
- content: '""'
376
- }
377
- },
378
- "&:first-child": {
379
- borderInlineStart: `${M(o)} ${r} ${d}`,
380
- borderStartStartRadius: p,
381
- borderEndStartRadius: p
382
- },
383
- "&:last-child": {
384
- borderStartEndRadius: p,
385
- borderEndEndRadius: p
386
- },
387
- "&:first-child:last-child": {
388
- borderRadius: p
389
- },
390
- [`${t}-group-large &`]: {
391
- height: m,
392
- fontSize: C,
393
- lineHeight: M(z(m).sub(z(o).mul(2)).equal()),
394
- "&:first-child": {
395
- borderStartStartRadius: y,
396
- borderEndStartRadius: y
397
- },
398
- "&:last-child": {
399
- borderStartEndRadius: y,
400
- borderEndEndRadius: y
401
- }
402
- },
403
- [`${t}-group-small &`]: {
404
- height: O,
405
- paddingInline: z(b).sub(o).equal(),
406
- paddingBlock: 0,
407
- lineHeight: M(z(O).sub(z(o).mul(2)).equal()),
408
- "&:first-child": {
409
- borderStartStartRadius: I,
410
- borderEndStartRadius: I
411
- },
412
- "&:last-child": {
413
- borderStartEndRadius: I,
414
- borderEndEndRadius: I
415
- }
416
- },
417
- "&:hover": {
418
- position: "relative",
419
- color: w
420
- },
421
- "&:has(:focus-visible)": Object.assign({}, Ee(e)),
422
- [`${t}-inner, input[type='checkbox'], input[type='radio']`]: {
423
- width: 0,
424
- height: 0,
425
- opacity: 0,
426
- pointerEvents: "none"
427
- },
428
- [`&-checked:not(${t}-button-wrapper-disabled)`]: {
429
- zIndex: 1,
430
- color: w,
431
- background: S,
432
- borderColor: w,
433
- "&::before": {
434
- backgroundColor: w
435
- },
436
- "&:first-child": {
437
- borderColor: w
438
- },
439
- "&:hover": {
440
- color: N,
441
- borderColor: N,
442
- "&::before": {
443
- backgroundColor: N
444
- }
445
- },
446
- "&:active": {
447
- color: $,
448
- borderColor: $,
449
- "&::before": {
450
- backgroundColor: $
451
- }
452
- }
453
- },
454
- [`${t}-group-solid &-checked:not(${t}-button-wrapper-disabled)`]: {
455
- color: v,
456
- background: P,
457
- borderColor: P,
458
- "&:hover": {
459
- color: v,
460
- background: D,
461
- borderColor: D
462
- },
463
- "&:active": {
464
- color: v,
465
- background: E,
466
- borderColor: E
467
- }
468
- },
469
- "&-disabled": {
470
- color: x,
471
- backgroundColor: g,
472
- borderColor: d,
473
- cursor: "not-allowed",
474
- "&:first-child, &:hover": {
475
- color: x,
476
- backgroundColor: g,
477
- borderColor: d
478
- }
479
- },
480
- [`&-disabled${t}-button-wrapper-checked`]: {
481
- color: f,
482
- backgroundColor: k,
483
- borderColor: d,
484
- boxShadow: "none"
485
- }
486
- }
487
- };
488
- }, Pn = (e) => {
489
- const {
490
- wireframe: n,
491
- padding: a,
492
- marginXS: t,
493
- lineWidth: o,
494
- fontSizeLG: r,
495
- colorText: d,
496
- colorBgContainer: i,
497
- colorTextDisabled: c,
498
- controlItemBgActiveDisabled: l,
499
- colorTextLightSolid: h,
500
- colorPrimary: u,
501
- colorPrimaryHover: C,
502
- colorPrimaryActive: m,
503
- colorWhite: O
504
- } = e, b = 4, p = r, I = n ? p - b * 2 : p - (b + o) * 2;
505
- return {
506
- // Radio
507
- radioSize: p,
508
- dotSize: I,
509
- dotColorDisabled: c,
510
- // Radio buttons
511
- buttonSolidCheckedColor: h,
512
- buttonSolidCheckedBg: u,
513
- buttonSolidCheckedHoverBg: C,
514
- buttonSolidCheckedActiveBg: m,
515
- buttonBg: i,
516
- buttonCheckedBg: i,
517
- buttonColor: d,
518
- buttonCheckedBgDisabled: l,
519
- buttonCheckedColorDisabled: c,
520
- buttonPaddingInline: a - o,
521
- wrapperMarginInlineEnd: t,
522
- // internal
523
- radioColor: n ? u : O,
524
- radioBgColor: n ? i : u
525
- };
526
- }, De = ae("Radio", (e) => {
527
- const {
528
- controlOutline: n,
529
- controlOutlineWidth: a
530
- } = e, t = `0 0 0 ${M(a)} ${n}`, r = ie(e, {
531
- radioFocusShadow: t,
532
- radioButtonFocusShadow: t
533
- });
534
- return [On(r), kn(r), Nn(r)];
535
- }, Pn, {
536
- unitless: {
537
- radioSize: !0,
538
- dotSize: !0
539
- }
540
- });
541
- var Mn = function(e, n) {
542
- var a = {};
543
- for (var t in e)
544
- Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (a[t] = e[t]);
545
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
546
- for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
547
- n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (a[t[o]] = e[t[o]]);
548
- return a;
549
- };
550
- const zn = (e, n) => {
551
- var a, t;
552
- const o = s.useContext(ze), r = s.useContext(Re), {
553
- getPrefixCls: d,
554
- direction: i,
555
- radio: c
556
- } = s.useContext(L), l = s.useRef(null), h = Ze(n, l), {
557
- isFormItemInput: u
558
- } = s.useContext(cn);
559
- if (process.env.NODE_ENV !== "production") {
560
- const E = re("Radio");
561
- process.env.NODE_ENV !== "production" && E(!("optionType" in e), "usage", "`optionType` is only support in Radio.Group.");
562
- }
563
- const C = (E) => {
564
- var z, j;
565
- (z = e.onChange) === null || z === void 0 || z.call(e, E), (j = o == null ? void 0 : o.onChange) === null || j === void 0 || j.call(o, E);
566
- }, {
567
- prefixCls: m,
568
- className: O,
569
- rootClassName: b,
570
- children: p,
571
- style: I,
572
- title: y
573
- } = e, S = Mn(e, ["prefixCls", "className", "rootClassName", "children", "style", "title"]), v = d("radio", m), x = ((o == null ? void 0 : o.optionType) || r) === "button", g = x ? `${v}-button` : v, k = ke(v), [f, w, N] = De(v, k), $ = Object.assign({}, S), P = s.useContext(Oe);
574
- o && ($.name = o.name, $.onChange = C, $.checked = e.value === o.value, $.disabled = (a = $.disabled) !== null && a !== void 0 ? a : o.disabled), $.disabled = (t = $.disabled) !== null && t !== void 0 ? t : P;
575
- const D = _(`${g}-wrapper`, {
576
- [`${g}-wrapper-checked`]: $.checked,
577
- [`${g}-wrapper-disabled`]: $.disabled,
578
- [`${g}-wrapper-rtl`]: i === "rtl",
579
- [`${g}-wrapper-in-form-item`]: u
580
- }, c == null ? void 0 : c.className, O, b, w, N, k);
581
- return f(/* @__PURE__ */ s.createElement(Ne, {
582
- component: "Radio",
583
- disabled: $.disabled
584
- }, /* @__PURE__ */ s.createElement("label", {
585
- className: D,
586
- style: Object.assign(Object.assign({}, c == null ? void 0 : c.style), I),
587
- onMouseEnter: e.onMouseEnter,
588
- onMouseLeave: e.onMouseLeave,
589
- title: y
590
- }, /* @__PURE__ */ s.createElement(En, Object.assign({}, $, {
591
- className: _($.className, !x && sn),
592
- type: "radio",
593
- prefixCls: g,
594
- ref: h
595
- })), p !== void 0 ? /* @__PURE__ */ s.createElement("span", null, p) : null)));
596
- }, X = /* @__PURE__ */ s.forwardRef(zn);
597
- process.env.NODE_ENV !== "production" && (X.displayName = "Radio");
598
- const Rn = /* @__PURE__ */ s.forwardRef((e, n) => {
599
- const {
600
- getPrefixCls: a,
601
- direction: t
602
- } = s.useContext(L), [o, r] = Q(e.defaultValue, {
603
- value: e.value
604
- }), d = (E) => {
605
- const z = o, j = E.target.value;
606
- "value" in e || r(j);
607
- const {
608
- onChange: H
609
- } = e;
610
- H && j !== z && H(E);
611
- }, {
612
- prefixCls: i,
613
- className: c,
614
- rootClassName: l,
615
- options: h,
616
- buttonStyle: u = "outline",
617
- disabled: C,
618
- children: m,
619
- size: O,
620
- style: b,
621
- id: p,
622
- onMouseEnter: I,
623
- onMouseLeave: y,
624
- onFocus: S,
625
- onBlur: v
626
- } = e, x = a("radio", i), g = `${x}-group`, k = ke(x), [f, w, N] = De(x, k);
627
- let $ = m;
628
- h && h.length > 0 && ($ = h.map((E) => typeof E == "string" || typeof E == "number" ? /* @__PURE__ */ s.createElement(X, {
629
- key: E.toString(),
630
- prefixCls: x,
631
- disabled: C,
632
- value: E,
633
- checked: o === E
634
- }, E) : /* @__PURE__ */ s.createElement(X, {
635
- key: `radio-group-value-options-${E.value}`,
636
- prefixCls: x,
637
- disabled: E.disabled || C,
638
- value: E.value,
639
- checked: o === E.value,
640
- title: E.title,
641
- style: E.style,
642
- id: E.id,
643
- required: E.required
644
- }, E.label)));
645
- const P = he(O), D = _(g, `${g}-${u}`, {
646
- [`${g}-${P}`]: P,
647
- [`${g}-rtl`]: t === "rtl"
648
- }, c, l, w, N, k);
649
- return f(/* @__PURE__ */ s.createElement("div", Object.assign({}, Pe(e, {
650
- aria: !0,
651
- data: !0
652
- }), {
653
- className: D,
654
- style: b,
655
- onMouseEnter: I,
656
- onMouseLeave: y,
657
- onFocus: S,
658
- onBlur: v,
659
- id: p,
660
- ref: n
661
- }), /* @__PURE__ */ s.createElement(xn, {
662
- value: {
663
- onChange: d,
664
- value: o,
665
- disabled: e.disabled,
666
- name: e.name,
667
- optionType: e.optionType
668
- }
669
- }, $)));
670
- }), Dn = /* @__PURE__ */ s.memo(Rn);
671
- var Bn = function(e, n) {
672
- var a = {};
673
- for (var t in e)
674
- Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (a[t] = e[t]);
675
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
676
- for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
677
- n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (a[t[o]] = e[t[o]]);
678
- return a;
679
- };
680
- const _n = (e, n) => {
681
- const {
682
- getPrefixCls: a
683
- } = s.useContext(L), {
684
- prefixCls: t
685
- } = e, o = Bn(e, ["prefixCls"]), r = a("radio", t);
686
- return /* @__PURE__ */ s.createElement(In, {
687
- value: "button"
688
- }, /* @__PURE__ */ s.createElement(X, Object.assign({
689
- prefixCls: r
690
- }, o, {
691
- type: "radio",
692
- ref: n
693
- })));
694
- }, Tn = /* @__PURE__ */ s.forwardRef(_n), U = X;
695
- U.Button = Tn;
696
- U.Group = Dn;
697
- U.__ANT_RADIO = !0;
698
- var Be = /* @__PURE__ */ B.forwardRef(function(e, n) {
699
- var a = e.prefixCls, t = e.forceRender, o = e.className, r = e.style, d = e.children, i = e.isActive, c = e.role, l = B.useState(i || t), h = oe(l, 2), u = h[0], C = h[1];
700
- return B.useEffect(function() {
701
- (t || i) && C(!0);
702
- }, [t, i]), u ? /* @__PURE__ */ B.createElement("div", {
703
- ref: n,
704
- className: _("".concat(a, "-content"), A(A({}, "".concat(a, "-content-active"), i), "".concat(a, "-content-inactive"), !i), o),
705
- style: r,
706
- role: c
707
- }, /* @__PURE__ */ B.createElement("div", {
708
- className: "".concat(a, "-content-box")
709
- }, d)) : null;
710
- });
711
- Be.displayName = "PanelContent";
712
- var jn = ["showArrow", "headerClass", "isActive", "onItemClick", "forceRender", "className", "prefixCls", "collapsible", "accordion", "panelKey", "extra", "header", "expandIcon", "openMotion", "destroyInactivePanel", "children"], _e = /* @__PURE__ */ B.forwardRef(function(e, n) {
713
- var a = e.showArrow, t = a === void 0 ? !0 : a, o = e.headerClass, r = e.isActive, d = e.onItemClick, i = e.forceRender, c = e.className, l = e.prefixCls, h = e.collapsible, u = e.accordion, C = e.panelKey, m = e.extra, O = e.header, b = e.expandIcon, p = e.openMotion, I = e.destroyInactivePanel, y = e.children, S = te(e, jn), v = h === "disabled", x = h === "header", g = h === "icon", k = m != null && typeof m != "boolean", f = function() {
714
- d == null || d(C);
715
- }, w = function(z) {
716
- (z.key === "Enter" || z.keyCode === ee.ENTER || z.which === ee.ENTER) && f();
717
- }, N = typeof b == "function" ? b(e) : /* @__PURE__ */ B.createElement("i", {
718
- className: "arrow"
719
- });
720
- N && (N = /* @__PURE__ */ B.createElement("div", {
721
- className: "".concat(l, "-expand-icon"),
722
- onClick: ["header", "icon"].includes(h) ? f : void 0
723
- }, N));
724
- var $ = _(A(A(A({}, "".concat(l, "-item"), !0), "".concat(l, "-item-active"), r), "".concat(l, "-item-disabled"), v), c), P = _(o, A(A(A({}, "".concat(l, "-header"), !0), "".concat(l, "-header-collapsible-only"), x), "".concat(l, "-icon-collapsible-only"), g)), D = {
725
- className: P,
726
- "aria-expanded": r,
727
- "aria-disabled": v,
728
- onKeyDown: w
729
- };
730
- return !x && !g && (D.onClick = f, D.role = u ? "tab" : "button", D.tabIndex = v ? -1 : 0), /* @__PURE__ */ B.createElement("div", T({}, S, {
731
- ref: n,
732
- className: $
733
- }), /* @__PURE__ */ B.createElement("div", D, t && N, /* @__PURE__ */ B.createElement("span", {
734
- className: "".concat(l, "-header-text"),
735
- onClick: h === "header" ? f : void 0
736
- }, O), k && /* @__PURE__ */ B.createElement("div", {
737
- className: "".concat(l, "-extra")
738
- }, m)), /* @__PURE__ */ B.createElement(en, T({
739
- visible: r,
740
- leavedClassName: "".concat(l, "-content-hidden")
741
- }, p, {
742
- forceRender: i,
743
- removeOnLeave: I
744
- }), function(E, z) {
745
- var j = E.className, H = E.style;
746
- return /* @__PURE__ */ B.createElement(Be, {
747
- ref: z,
748
- prefixCls: l,
749
- className: j,
750
- style: H,
751
- isActive: r,
752
- forceRender: i,
753
- role: u ? "tabpanel" : void 0
754
- }, y);
755
- }));
756
- }), An = ["children", "label", "key", "collapsible", "onItemClick", "destroyInactivePanel"], Hn = function(n, a) {
757
- var t = a.prefixCls, o = a.accordion, r = a.collapsible, d = a.destroyInactivePanel, i = a.onItemClick, c = a.activeKey, l = a.openMotion, h = a.expandIcon;
758
- return n.map(function(u, C) {
759
- var m = u.children, O = u.label, b = u.key, p = u.collapsible, I = u.onItemClick, y = u.destroyInactivePanel, S = te(u, An), v = String(b ?? C), x = p ?? r, g = y ?? d, k = function(N) {
760
- x !== "disabled" && (i(N), I == null || I(N));
761
- }, f = !1;
762
- return o ? f = c[0] === v : f = c.indexOf(v) > -1, /* @__PURE__ */ B.createElement(_e, T({}, S, {
763
- prefixCls: t,
764
- key: v,
765
- panelKey: v,
766
- isActive: f,
767
- accordion: o,
768
- openMotion: l,
769
- expandIcon: h,
770
- header: O,
771
- collapsible: x,
772
- onItemClick: k,
773
- destroyInactivePanel: g
774
- }), m);
775
- });
776
- }, Ln = function(n, a, t) {
777
- if (!n)
778
- return null;
779
- var o = t.prefixCls, r = t.accordion, d = t.collapsible, i = t.destroyInactivePanel, c = t.onItemClick, l = t.activeKey, h = t.openMotion, u = t.expandIcon, C = n.key || String(a), m = n.props, O = m.header, b = m.headerClass, p = m.destroyInactivePanel, I = m.collapsible, y = m.onItemClick, S = !1;
780
- r ? S = l[0] === C : S = l.indexOf(C) > -1;
781
- var v = I ?? d, x = function(f) {
782
- v !== "disabled" && (c(f), y == null || y(f));
783
- }, g = {
784
- key: C,
785
- panelKey: C,
786
- header: O,
787
- headerClass: b,
788
- isActive: S,
789
- prefixCls: o,
790
- destroyInactivePanel: p ?? i,
791
- openMotion: h,
792
- accordion: r,
793
- children: n.props.children,
794
- onItemClick: x,
795
- expandIcon: u,
796
- collapsible: v
797
- };
798
- return typeof n.type == "string" ? n : (Object.keys(g).forEach(function(k) {
799
- typeof g[k] > "u" && delete g[k];
800
- }), /* @__PURE__ */ B.cloneElement(n, g));
801
- };
802
- function Vn(e, n, a) {
803
- return Array.isArray(e) ? Hn(e, a) : ge(n).map(function(t, o) {
804
- return Ln(t, o, a);
805
- });
806
- }
807
- function Wn(e) {
808
- var n = e;
809
- if (!Array.isArray(n)) {
810
- var a = tn(n);
811
- n = a === "number" || a === "string" ? [n] : [];
812
- }
813
- return n.map(function(t) {
814
- return String(t);
815
- });
816
- }
817
- var qn = /* @__PURE__ */ B.forwardRef(function(e, n) {
818
- var a = e.prefixCls, t = a === void 0 ? "rc-collapse" : a, o = e.destroyInactivePanel, r = o === void 0 ? !1 : o, d = e.style, i = e.accordion, c = e.className, l = e.children, h = e.collapsible, u = e.openMotion, C = e.expandIcon, m = e.activeKey, O = e.defaultActiveKey, b = e.onChange, p = e.items, I = _(t, c), y = Q([], {
819
- value: m,
820
- onChange: function(w) {
821
- return b == null ? void 0 : b(w);
822
- },
823
- defaultValue: O,
824
- postState: Wn
825
- }), S = oe(y, 2), v = S[0], x = S[1], g = function(w) {
826
- return x(function() {
827
- if (i)
828
- return v[0] === w ? [] : [w];
829
- var N = v.indexOf(w), $ = N > -1;
830
- return $ ? v.filter(function(P) {
831
- return P !== w;
832
- }) : [].concat(on(v), [w]);
833
- });
834
- };
835
- nn(!l, "[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");
836
- var k = Vn(p, l, {
837
- prefixCls: t,
838
- accordion: i,
839
- openMotion: u,
840
- expandIcon: C,
841
- collapsible: h,
842
- destroyInactivePanel: r,
843
- onItemClick: g,
844
- activeKey: v
845
- });
846
- return /* @__PURE__ */ B.createElement("div", T({
847
- ref: n,
848
- className: I,
849
- style: d,
850
- role: i ? "tablist" : void 0
851
- }, Pe(e, {
852
- aria: !0,
853
- data: !0
854
- })), k);
855
- });
856
- const fe = Object.assign(qn, {
857
- /**
858
- * @deprecated use `items` instead, will be removed in `v4.0.0`
859
- */
860
- Panel: _e
861
- });
862
- fe.Panel;
863
- const Gn = /* @__PURE__ */ s.forwardRef((e, n) => {
864
- process.env.NODE_ENV !== "production" && re("Collapse.Panel").deprecated(!("disabled" in e), "disabled", 'collapsible="disabled"');
865
- const {
866
- getPrefixCls: a
867
- } = s.useContext(L), {
868
- prefixCls: t,
869
- className: o,
870
- showArrow: r = !0
871
- } = e, d = a("collapse", t), i = _({
872
- [`${d}-no-arrow`]: !r
873
- }, o);
874
- return /* @__PURE__ */ s.createElement(fe.Panel, Object.assign({
875
- ref: n
876
- }, e, {
877
- prefixCls: d,
878
- className: i
879
- }));
880
- }), Kn = (e) => {
881
- const {
882
- componentCls: n,
883
- contentBg: a,
884
- padding: t,
885
- headerBg: o,
886
- headerPadding: r,
887
- collapseHeaderPaddingSM: d,
888
- collapseHeaderPaddingLG: i,
889
- collapsePanelBorderRadius: c,
890
- lineWidth: l,
891
- lineType: h,
892
- colorBorder: u,
893
- colorText: C,
894
- colorTextHeading: m,
895
- colorTextDisabled: O,
896
- fontSizeLG: b,
897
- lineHeight: p,
898
- lineHeightLG: I,
899
- marginSM: y,
900
- paddingSM: S,
901
- paddingLG: v,
902
- paddingXS: x,
903
- motionDurationSlow: g,
904
- fontSizeIcon: k,
905
- contentPadding: f,
906
- fontHeight: w,
907
- fontHeightLG: N
908
- } = e, $ = `${M(l)} ${h} ${u}`;
909
- return {
910
- [n]: Object.assign(Object.assign({}, G(e)), {
911
- backgroundColor: o,
912
- border: $,
913
- borderRadius: c,
914
- "&-rtl": {
915
- direction: "rtl"
916
- },
917
- [`& > ${n}-item`]: {
918
- borderBottom: $,
919
- "&:last-child": {
920
- [`
921
- &,
922
- & > ${n}-header`]: {
923
- borderRadius: `0 0 ${M(c)} ${M(c)}`
924
- }
925
- },
926
- [`> ${n}-header`]: {
927
- position: "relative",
928
- // Compatible with old version of antd, should remove in next version
929
- display: "flex",
930
- flexWrap: "nowrap",
931
- alignItems: "flex-start",
932
- padding: r,
933
- color: m,
934
- lineHeight: p,
935
- cursor: "pointer",
936
- transition: `all ${g}, visibility 0s`,
937
- [`> ${n}-header-text`]: {
938
- flex: "auto"
939
- },
940
- "&:focus": {
941
- outline: "none"
942
- },
943
- // >>>>> Arrow
944
- [`${n}-expand-icon`]: {
945
- height: w,
946
- display: "flex",
947
- alignItems: "center",
948
- paddingInlineEnd: y
949
- },
950
- [`${n}-arrow`]: Object.assign(Object.assign({}, an()), {
951
- fontSize: k,
952
- // when `transform: rotate()` is applied to icon's root element
953
- transition: `transform ${g}`,
954
- // when `transform: rotate()` is applied to icon's child element
955
- svg: {
956
- transition: `transform ${g}`
957
- }
958
- }),
959
- // >>>>> Text
960
- [`${n}-header-text`]: {
961
- marginInlineEnd: "auto"
962
- }
963
- },
964
- [`${n}-icon-collapsible-only`]: {
965
- cursor: "unset",
966
- [`${n}-expand-icon`]: {
967
- cursor: "pointer"
968
- }
969
- }
970
- },
971
- [`${n}-content`]: {
972
- color: C,
973
- backgroundColor: a,
974
- borderTop: $,
975
- [`& > ${n}-content-box`]: {
976
- padding: f
977
- },
978
- "&-hidden": {
979
- display: "none"
980
- }
981
- },
982
- "&-small": {
983
- [`> ${n}-item`]: {
984
- [`> ${n}-header`]: {
985
- padding: d,
986
- paddingInlineStart: x,
987
- [`> ${n}-expand-icon`]: {
988
- // Arrow offset
989
- marginInlineStart: e.calc(S).sub(x).equal()
990
- }
991
- },
992
- [`> ${n}-content > ${n}-content-box`]: {
993
- padding: S
994
- }
995
- }
996
- },
997
- "&-large": {
998
- [`> ${n}-item`]: {
999
- fontSize: b,
1000
- lineHeight: I,
1001
- [`> ${n}-header`]: {
1002
- padding: i,
1003
- paddingInlineStart: t,
1004
- [`> ${n}-expand-icon`]: {
1005
- height: N,
1006
- // Arrow offset
1007
- marginInlineStart: e.calc(v).sub(t).equal()
1008
- }
1009
- },
1010
- [`> ${n}-content > ${n}-content-box`]: {
1011
- padding: v
1012
- }
1013
- }
1014
- },
1015
- [`${n}-item:last-child`]: {
1016
- borderBottom: 0,
1017
- [`> ${n}-content`]: {
1018
- borderRadius: `0 0 ${M(c)} ${M(c)}`
1019
- }
1020
- },
1021
- [`& ${n}-item-disabled > ${n}-header`]: {
1022
- "\n &,\n & > .arrow\n ": {
1023
- color: O,
1024
- cursor: "not-allowed"
1025
- }
1026
- },
1027
- // ========================== Icon Position ==========================
1028
- [`&${n}-icon-position-end`]: {
1029
- [`& > ${n}-item`]: {
1030
- [`> ${n}-header`]: {
1031
- [`${n}-expand-icon`]: {
1032
- order: 1,
1033
- paddingInlineEnd: 0,
1034
- paddingInlineStart: y
1035
- }
1036
- }
1037
- }
1038
- }
1039
- })
1040
- };
1041
- }, Fn = (e) => {
1042
- const {
1043
- componentCls: n
1044
- } = e, a = `> ${n}-item > ${n}-header ${n}-arrow`;
1045
- return {
1046
- [`${n}-rtl`]: {
1047
- [a]: {
1048
- transform: "rotate(180deg)"
1049
- }
1050
- }
1051
- };
1052
- }, Xn = (e) => {
1053
- const {
1054
- componentCls: n,
1055
- headerBg: a,
1056
- paddingXXS: t,
1057
- colorBorder: o
1058
- } = e;
1059
- return {
1060
- [`${n}-borderless`]: {
1061
- backgroundColor: a,
1062
- border: 0,
1063
- [`> ${n}-item`]: {
1064
- borderBottom: `1px solid ${o}`
1065
- },
1066
- [`
1067
- > ${n}-item:last-child,
1068
- > ${n}-item:last-child ${n}-header
1069
- `]: {
1070
- borderRadius: 0
1071
- },
1072
- [`> ${n}-item:last-child`]: {
1073
- borderBottom: 0
1074
- },
1075
- [`> ${n}-item > ${n}-content`]: {
1076
- backgroundColor: "transparent",
1077
- borderTop: 0
1078
- },
1079
- [`> ${n}-item > ${n}-content > ${n}-content-box`]: {
1080
- paddingTop: t
1081
- }
1082
- }
1083
- };
1084
- }, Un = (e) => {
1085
- const {
1086
- componentCls: n,
1087
- paddingSM: a
1088
- } = e;
1089
- return {
1090
- [`${n}-ghost`]: {
1091
- backgroundColor: "transparent",
1092
- border: 0,
1093
- [`> ${n}-item`]: {
1094
- borderBottom: 0,
1095
- [`> ${n}-content`]: {
1096
- backgroundColor: "transparent",
1097
- border: 0,
1098
- [`> ${n}-content-box`]: {
1099
- paddingBlock: a
1100
- }
1101
- }
1102
- }
1103
- }
1104
- };
1105
- }, Qn = (e) => ({
1106
- headerPadding: `${e.paddingSM}px ${e.padding}px`,
1107
- headerBg: e.colorFillAlter,
1108
- contentPadding: `${e.padding}px 16px`,
1109
- // Fixed Value
1110
- contentBg: e.colorBgContainer
1111
- }), Yn = ae("Collapse", (e) => {
1112
- const n = ie(e, {
1113
- collapseHeaderPaddingSM: `${M(e.paddingXS)} ${M(e.paddingSM)}`,
1114
- collapseHeaderPaddingLG: `${M(e.padding)} ${M(e.paddingLG)}`,
1115
- collapsePanelBorderRadius: e.borderRadiusLG
1116
- });
1117
- return [Kn(n), Xn(n), Un(n), Fn(n), yn(n)];
1118
- }, Qn), Te = /* @__PURE__ */ s.forwardRef((e, n) => {
1119
- const {
1120
- getPrefixCls: a,
1121
- direction: t,
1122
- collapse: o
1123
- } = s.useContext(L), {
1124
- prefixCls: r,
1125
- className: d,
1126
- rootClassName: i,
1127
- style: c,
1128
- bordered: l = !0,
1129
- ghost: h,
1130
- size: u,
1131
- expandIconPosition: C = "start",
1132
- children: m,
1133
- expandIcon: O
1134
- } = e, b = he(($) => {
1135
- var P;
1136
- return (P = u ?? $) !== null && P !== void 0 ? P : "middle";
1137
- }), p = a("collapse", r), I = a(), [y, S, v] = Yn(p);
1138
- if (process.env.NODE_ENV !== "production") {
1139
- const $ = re("Collapse");
1140
- process.env.NODE_ENV !== "production" && $(C !== "left" && C !== "right", "deprecated", "`expandIconPosition` with `left` or `right` is deprecated. Please use `start` or `end` instead.");
1141
- }
1142
- const x = s.useMemo(() => C === "left" ? "start" : C === "right" ? "end" : C, [C]), g = O ?? (o == null ? void 0 : o.expandIcon), k = s.useCallback(function() {
1143
- let $ = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1144
- const P = typeof g == "function" ? g($) : /* @__PURE__ */ s.createElement(Me, {
1145
- rotate: $.isActive ? 90 : void 0
1146
- });
1147
- return be(P, () => {
1148
- var D;
1149
- return {
1150
- className: _((D = P == null ? void 0 : P.props) === null || D === void 0 ? void 0 : D.className, `${p}-arrow`)
1151
- };
1152
- });
1153
- }, [g, p]), f = _(`${p}-icon-position-${x}`, {
1154
- [`${p}-borderless`]: !l,
1155
- [`${p}-rtl`]: t === "rtl",
1156
- [`${p}-ghost`]: !!h,
1157
- [`${p}-${b}`]: b !== "middle"
1158
- }, o == null ? void 0 : o.className, d, i, S, v), w = Object.assign(Object.assign({}, dn(I)), {
1159
- motionAppear: !1,
1160
- leavedClassName: `${p}-content-hidden`
1161
- }), N = s.useMemo(() => m ? ge(m).map(($, P) => {
1162
- var D, E;
1163
- if (!((D = $.props) === null || D === void 0) && D.disabled) {
1164
- const z = (E = $.key) !== null && E !== void 0 ? E : String(P), {
1165
- disabled: j,
1166
- collapsible: H
1167
- } = $.props, K = Object.assign(Object.assign({}, ve($.props, ["disabled"])), {
1168
- key: z,
1169
- collapsible: H ?? (j ? "disabled" : void 0)
1170
- });
1171
- return be($, K);
1172
- }
1173
- return $;
1174
- }) : null, [m]);
1175
- return y(
1176
- // @ts-ignore
1177
- /* @__PURE__ */ s.createElement(fe, Object.assign({
1178
- ref: n,
1179
- openMotion: w
1180
- }, ve(e, ["rootClassName"]), {
1181
- expandIcon: k,
1182
- prefixCls: p,
1183
- className: f,
1184
- style: Object.assign(Object.assign({}, o == null ? void 0 : o.style), c)
1185
- }), N)
1186
- );
1187
- });
1188
- process.env.NODE_ENV !== "production" && (Te.displayName = "Collapse");
1189
- const ye = Object.assign(Te, {
1190
- Panel: Gn
1191
- }), Jn = (e) => {
1192
- const {
1193
- componentCls: n,
1194
- sizePaddingEdgeHorizontal: a,
1195
- colorSplit: t,
1196
- lineWidth: o,
1197
- textPaddingInline: r,
1198
- orientationMargin: d,
1199
- verticalMarginInline: i
1200
- } = e;
1201
- return {
1202
- [n]: Object.assign(Object.assign({}, G(e)), {
1203
- borderBlockStart: `${M(o)} solid ${t}`,
1204
- // vertical
1205
- "&-vertical": {
1206
- position: "relative",
1207
- top: "-0.06em",
1208
- display: "inline-block",
1209
- height: "0.9em",
1210
- marginInline: i,
1211
- marginBlock: 0,
1212
- verticalAlign: "middle",
1213
- borderTop: 0,
1214
- borderInlineStart: `${M(o)} solid ${t}`
1215
- },
1216
- "&-horizontal": {
1217
- display: "flex",
1218
- clear: "both",
1219
- width: "100%",
1220
- minWidth: "100%",
1221
- // Fix https://github.com/ant-design/ant-design/issues/10914
1222
- margin: `${M(e.dividerHorizontalGutterMargin)} 0`
1223
- },
1224
- [`&-horizontal${n}-with-text`]: {
1225
- display: "flex",
1226
- alignItems: "center",
1227
- margin: `${M(e.dividerHorizontalWithTextGutterMargin)} 0`,
1228
- color: e.colorTextHeading,
1229
- fontWeight: 500,
1230
- fontSize: e.fontSizeLG,
1231
- whiteSpace: "nowrap",
1232
- textAlign: "center",
1233
- borderBlockStart: `0 ${t}`,
1234
- "&::before, &::after": {
1235
- position: "relative",
1236
- width: "50%",
1237
- borderBlockStart: `${M(o)} solid transparent`,
1238
- // Chrome not accept `inherit` in `border-top`
1239
- borderBlockStartColor: "inherit",
1240
- borderBlockEnd: 0,
1241
- transform: "translateY(50%)",
1242
- content: "''"
1243
- }
1244
- },
1245
- [`&-horizontal${n}-with-text-left`]: {
1246
- "&::before": {
1247
- width: `calc(${d} * 100%)`
1248
- },
1249
- "&::after": {
1250
- width: `calc(100% - ${d} * 100%)`
1251
- }
1252
- },
1253
- [`&-horizontal${n}-with-text-right`]: {
1254
- "&::before": {
1255
- width: `calc(100% - ${d} * 100%)`
1256
- },
1257
- "&::after": {
1258
- width: `calc(${d} * 100%)`
1259
- }
1260
- },
1261
- [`${n}-inner-text`]: {
1262
- display: "inline-block",
1263
- paddingBlock: 0,
1264
- paddingInline: r
1265
- },
1266
- "&-dashed": {
1267
- background: "none",
1268
- borderColor: t,
1269
- borderStyle: "dashed",
1270
- borderWidth: `${M(o)} 0 0`
1271
- },
1272
- [`&-horizontal${n}-with-text${n}-dashed`]: {
1273
- "&::before, &::after": {
1274
- borderStyle: "dashed none none"
1275
- }
1276
- },
1277
- [`&-vertical${n}-dashed`]: {
1278
- borderInlineStartWidth: o,
1279
- borderInlineEnd: 0,
1280
- borderBlockStart: 0,
1281
- borderBlockEnd: 0
1282
- },
1283
- [`&-plain${n}-with-text`]: {
1284
- color: e.colorText,
1285
- fontWeight: "normal",
1286
- fontSize: e.fontSize
1287
- },
1288
- [`&-horizontal${n}-with-text-left${n}-no-default-orientation-margin-left`]: {
1289
- "&::before": {
1290
- width: 0
1291
- },
1292
- "&::after": {
1293
- width: "100%"
1294
- },
1295
- [`${n}-inner-text`]: {
1296
- paddingInlineStart: a
1297
- }
1298
- },
1299
- [`&-horizontal${n}-with-text-right${n}-no-default-orientation-margin-right`]: {
1300
- "&::before": {
1301
- width: "100%"
1302
- },
1303
- "&::after": {
1304
- width: 0
1305
- },
1306
- [`${n}-inner-text`]: {
1307
- paddingInlineEnd: a
1308
- }
1309
- }
1310
- })
1311
- };
1312
- }, Zn = (e) => ({
1313
- textPaddingInline: "1em",
1314
- orientationMargin: 0.05,
1315
- verticalMarginInline: e.marginXS
1316
- }), et = ae("Divider", (e) => {
1317
- const n = ie(e, {
1318
- dividerHorizontalWithTextGutterMargin: e.margin,
1319
- dividerHorizontalGutterMargin: e.marginLG,
1320
- sizePaddingEdgeHorizontal: 0
1321
- });
1322
- return [Jn(n)];
1323
- }, Zn, {
1324
- unitless: {
1325
- orientationMargin: !0
1326
- }
1327
- });
1328
- var nt = function(e, n) {
1329
- var a = {};
1330
- for (var t in e)
1331
- Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (a[t] = e[t]);
1332
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
1333
- for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
1334
- n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (a[t[o]] = e[t[o]]);
1335
- return a;
1336
- };
1337
- const je = (e) => {
1338
- const {
1339
- getPrefixCls: n,
1340
- direction: a,
1341
- divider: t
1342
- } = s.useContext(L), {
1343
- prefixCls: o,
1344
- type: r = "horizontal",
1345
- orientation: d = "center",
1346
- orientationMargin: i,
1347
- className: c,
1348
- rootClassName: l,
1349
- children: h,
1350
- dashed: u,
1351
- plain: C,
1352
- style: m
1353
- } = e, O = nt(e, ["prefixCls", "type", "orientation", "orientationMargin", "className", "rootClassName", "children", "dashed", "plain", "style"]), b = n("divider", o), [p, I, y] = et(b), S = d.length > 0 ? `-${d}` : d, v = !!h, x = d === "left" && i != null, g = d === "right" && i != null, k = _(b, t == null ? void 0 : t.className, I, y, `${b}-${r}`, {
1354
- [`${b}-with-text`]: v,
1355
- [`${b}-with-text${S}`]: v,
1356
- [`${b}-dashed`]: !!u,
1357
- [`${b}-plain`]: !!C,
1358
- [`${b}-rtl`]: a === "rtl",
1359
- [`${b}-no-default-orientation-margin-left`]: x,
1360
- [`${b}-no-default-orientation-margin-right`]: g
1361
- }, c, l), f = s.useMemo(() => typeof i == "number" ? i : /^\d+$/.test(i) ? Number(i) : i, [i]), w = Object.assign(Object.assign({}, x && {
1362
- marginLeft: f
1363
- }), g && {
1364
- marginRight: f
1365
- });
1366
- if (process.env.NODE_ENV !== "production") {
1367
- const N = re("Divider");
1368
- process.env.NODE_ENV !== "production" && N(!h || r !== "vertical", "usage", "`children` not working in `vertical` mode.");
1369
- }
1370
- return p(/* @__PURE__ */ s.createElement("div", Object.assign({
1371
- className: k,
1372
- style: Object.assign(Object.assign({}, t == null ? void 0 : t.style), m)
1373
- }, O, {
1374
- role: "separator"
1375
- }), h && r !== "vertical" && /* @__PURE__ */ s.createElement("span", {
1376
- className: `${b}-inner-text`,
1377
- style: w
1378
- }, h)));
1379
- };
1380
- process.env.NODE_ENV !== "production" && (je.displayName = "Divider");
1381
- function $e(e) {
1382
- return ["small", "middle", "large"].includes(e);
1383
- }
1384
- function Se(e) {
1385
- return e ? typeof e == "number" && !Number.isNaN(e) : !1;
1386
- }
1387
- const Ae = /* @__PURE__ */ B.createContext({
1388
- latestIndex: 0
1389
- }), tt = Ae.Provider, ot = (e) => {
1390
- let {
1391
- className: n,
1392
- index: a,
1393
- children: t,
1394
- split: o,
1395
- style: r
1396
- } = e;
1397
- const {
1398
- latestIndex: d
1399
- } = s.useContext(Ae);
1400
- return t == null ? null : /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("div", {
1401
- className: n,
1402
- style: r
1403
- }, t), a < d && o && /* @__PURE__ */ s.createElement("span", {
1404
- className: `${n}-split`
1405
- }, o));
1406
- };
1407
- var at = function(e, n) {
1408
- var a = {};
1409
- for (var t in e)
1410
- Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (a[t] = e[t]);
1411
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
1412
- for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
1413
- n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (a[t[o]] = e[t[o]]);
1414
- return a;
1415
- };
1416
- const it = /* @__PURE__ */ s.forwardRef((e, n) => {
1417
- var a, t;
1418
- const {
1419
- getPrefixCls: o,
1420
- space: r,
1421
- direction: d
1422
- } = s.useContext(L), {
1423
- size: i = (r == null ? void 0 : r.size) || "small",
1424
- align: c,
1425
- className: l,
1426
- rootClassName: h,
1427
- children: u,
1428
- direction: C = "horizontal",
1429
- prefixCls: m,
1430
- split: O,
1431
- style: b,
1432
- wrap: p = !1,
1433
- classNames: I,
1434
- styles: y
1435
- } = e, S = at(e, ["size", "align", "className", "rootClassName", "children", "direction", "prefixCls", "split", "style", "wrap", "classNames", "styles"]), [v, x] = Array.isArray(i) ? i : [i, i], g = $e(x), k = $e(v), f = Se(x), w = Se(v), N = ge(u, {
1436
- keepEmpty: !0
1437
- }), $ = c === void 0 && C === "horizontal" ? "center" : c, P = o("space", m), [D, E, z] = hn(P), j = _(P, r == null ? void 0 : r.className, E, `${P}-${C}`, {
1438
- [`${P}-rtl`]: d === "rtl",
1439
- [`${P}-align-${$}`]: $,
1440
- [`${P}-gap-row-${x}`]: g,
1441
- [`${P}-gap-col-${v}`]: k
1442
- }, l, h, z), H = _(`${P}-item`, (a = I == null ? void 0 : I.item) !== null && a !== void 0 ? a : (t = r == null ? void 0 : r.classNames) === null || t === void 0 ? void 0 : t.item);
1443
- let K = 0;
1444
- const Ke = N.map((F, le) => {
1445
- var ce, se;
1446
- F != null && (K = le);
1447
- const Xe = F && F.key || `${H}-${le}`;
1448
- return /* @__PURE__ */ s.createElement(ot, {
1449
- className: H,
1450
- key: Xe,
1451
- index: le,
1452
- split: O,
1453
- style: (ce = y == null ? void 0 : y.item) !== null && ce !== void 0 ? ce : (se = r == null ? void 0 : r.styles) === null || se === void 0 ? void 0 : se.item
1454
- }, F);
1455
- }), Fe = s.useMemo(() => ({
1456
- latestIndex: K
1457
- }), [K]);
1458
- if (N.length === 0)
1459
- return null;
1460
- const Y = {};
1461
- return p && (Y.flexWrap = "wrap"), !k && w && (Y.columnGap = v), !g && f && (Y.rowGap = x), D(/* @__PURE__ */ s.createElement("div", Object.assign({
1462
- ref: n,
1463
- className: j,
1464
- style: Object.assign(Object.assign(Object.assign({}, Y), r == null ? void 0 : r.style), b)
1465
- }, S), /* @__PURE__ */ s.createElement(tt, {
1466
- value: Fe
1467
- }, Ke)));
1468
- }), me = it;
1469
- me.Compact = un;
1470
- process.env.NODE_ENV !== "production" && (me.displayName = "Space");
1471
- var rt = ["prefixCls", "className", "checked", "defaultChecked", "disabled", "loadingIcon", "checkedChildren", "unCheckedChildren", "onClick", "onChange", "onKeyDown"], He = /* @__PURE__ */ s.forwardRef(function(e, n) {
1472
- var a, t = e.prefixCls, o = t === void 0 ? "rc-switch" : t, r = e.className, d = e.checked, i = e.defaultChecked, c = e.disabled, l = e.loadingIcon, h = e.checkedChildren, u = e.unCheckedChildren, C = e.onClick, m = e.onChange, O = e.onKeyDown, b = te(e, rt), p = Q(!1, {
1473
- value: d,
1474
- defaultValue: i
1475
- }), I = oe(p, 2), y = I[0], S = I[1];
1476
- function v(f, w) {
1477
- var N = y;
1478
- return c || (N = f, S(N), m == null || m(N, w)), N;
1479
- }
1480
- function x(f) {
1481
- f.which === ee.LEFT ? v(!1, f) : f.which === ee.RIGHT && v(!0, f), O == null || O(f);
1482
- }
1483
- function g(f) {
1484
- var w = v(!y, f);
1485
- C == null || C(w, f);
1486
- }
1487
- var k = _(o, r, (a = {}, A(a, "".concat(o, "-checked"), y), A(a, "".concat(o, "-disabled"), c), a));
1488
- return /* @__PURE__ */ s.createElement("button", T({}, b, {
1489
- type: "button",
1490
- role: "switch",
1491
- "aria-checked": y,
1492
- disabled: c,
1493
- className: k,
1494
- ref: n,
1495
- onKeyDown: x,
1496
- onClick: g
1497
- }), l, /* @__PURE__ */ s.createElement("span", {
1498
- className: "".concat(o, "-inner")
1499
- }, /* @__PURE__ */ s.createElement("span", {
1500
- className: "".concat(o, "-inner-checked")
1501
- }, h), /* @__PURE__ */ s.createElement("span", {
1502
- className: "".concat(o, "-inner-unchecked")
1503
- }, u)));
1504
- });
1505
- He.displayName = "Switch";
1506
- const lt = (e) => {
1507
- const {
1508
- componentCls: n,
1509
- trackHeightSM: a,
1510
- trackPadding: t,
1511
- trackMinWidthSM: o,
1512
- innerMinMarginSM: r,
1513
- innerMaxMarginSM: d,
1514
- handleSizeSM: i,
1515
- calc: c
1516
- } = e, l = `${n}-inner`, h = M(c(i).add(c(t).mul(2)).equal()), u = M(c(d).mul(2).equal());
1517
- return {
1518
- [n]: {
1519
- [`&${n}-small`]: {
1520
- minWidth: o,
1521
- height: a,
1522
- lineHeight: M(a),
1523
- [`${n}-inner`]: {
1524
- paddingInlineStart: d,
1525
- paddingInlineEnd: r,
1526
- [`${l}-checked, ${l}-unchecked`]: {
1527
- minHeight: a
1528
- },
1529
- [`${l}-checked`]: {
1530
- marginInlineStart: `calc(-100% + ${h} - ${u})`,
1531
- marginInlineEnd: `calc(100% - ${h} + ${u})`
1532
- },
1533
- [`${l}-unchecked`]: {
1534
- marginTop: c(a).mul(-1).equal(),
1535
- marginInlineStart: 0,
1536
- marginInlineEnd: 0
1537
- }
1538
- },
1539
- [`${n}-handle`]: {
1540
- width: i,
1541
- height: i
1542
- },
1543
- [`${n}-loading-icon`]: {
1544
- top: c(c(i).sub(e.switchLoadingIconSize)).div(2).equal(),
1545
- fontSize: e.switchLoadingIconSize
1546
- },
1547
- [`&${n}-checked`]: {
1548
- [`${n}-inner`]: {
1549
- paddingInlineStart: r,
1550
- paddingInlineEnd: d,
1551
- [`${l}-checked`]: {
1552
- marginInlineStart: 0,
1553
- marginInlineEnd: 0
1554
- },
1555
- [`${l}-unchecked`]: {
1556
- marginInlineStart: `calc(100% - ${h} + ${u})`,
1557
- marginInlineEnd: `calc(-100% + ${h} - ${u})`
1558
- }
1559
- },
1560
- [`${n}-handle`]: {
1561
- insetInlineStart: `calc(100% - ${M(c(i).add(t).equal())})`
1562
- }
1563
- },
1564
- [`&:not(${n}-disabled):active`]: {
1565
- [`&:not(${n}-checked) ${l}`]: {
1566
- [`${l}-unchecked`]: {
1567
- marginInlineStart: c(e.marginXXS).div(2).equal(),
1568
- marginInlineEnd: c(e.marginXXS).mul(-1).div(2).equal()
1569
- }
1570
- },
1571
- [`&${n}-checked ${l}`]: {
1572
- [`${l}-checked`]: {
1573
- marginInlineStart: c(e.marginXXS).mul(-1).div(2).equal(),
1574
- marginInlineEnd: c(e.marginXXS).div(2).equal()
1575
- }
1576
- }
1577
- }
1578
- }
1579
- }
1580
- };
1581
- }, ct = (e) => {
1582
- const {
1583
- componentCls: n,
1584
- handleSize: a,
1585
- calc: t
1586
- } = e;
1587
- return {
1588
- [n]: {
1589
- [`${n}-loading-icon${e.iconCls}`]: {
1590
- position: "relative",
1591
- top: t(t(a).sub(e.fontSize)).div(2).equal(),
1592
- color: e.switchLoadingIconColor,
1593
- verticalAlign: "top"
1594
- },
1595
- [`&${n}-checked ${n}-loading-icon`]: {
1596
- color: e.switchColor
1597
- }
1598
- }
1599
- };
1600
- }, st = (e) => {
1601
- const {
1602
- componentCls: n,
1603
- trackPadding: a,
1604
- handleBg: t,
1605
- handleShadow: o,
1606
- handleSize: r,
1607
- calc: d
1608
- } = e, i = `${n}-handle`;
1609
- return {
1610
- [n]: {
1611
- [i]: {
1612
- position: "absolute",
1613
- top: a,
1614
- insetInlineStart: a,
1615
- width: r,
1616
- height: r,
1617
- transition: `all ${e.switchDuration} ease-in-out`,
1618
- "&::before": {
1619
- position: "absolute",
1620
- top: 0,
1621
- insetInlineEnd: 0,
1622
- bottom: 0,
1623
- insetInlineStart: 0,
1624
- backgroundColor: t,
1625
- borderRadius: d(r).div(2).equal(),
1626
- boxShadow: o,
1627
- transition: `all ${e.switchDuration} ease-in-out`,
1628
- content: '""'
1629
- }
1630
- },
1631
- [`&${n}-checked ${i}`]: {
1632
- insetInlineStart: `calc(100% - ${M(d(r).add(a).equal())})`
1633
- },
1634
- [`&:not(${n}-disabled):active`]: {
1635
- [`${i}::before`]: {
1636
- insetInlineEnd: e.switchHandleActiveInset,
1637
- insetInlineStart: 0
1638
- },
1639
- [`&${n}-checked ${i}::before`]: {
1640
- insetInlineEnd: 0,
1641
- insetInlineStart: e.switchHandleActiveInset
1642
- }
1643
- }
1644
- }
1645
- };
1646
- }, dt = (e) => {
1647
- const {
1648
- componentCls: n,
1649
- trackHeight: a,
1650
- trackPadding: t,
1651
- innerMinMargin: o,
1652
- innerMaxMargin: r,
1653
- handleSize: d,
1654
- calc: i
1655
- } = e, c = `${n}-inner`, l = M(i(d).add(i(t).mul(2)).equal()), h = M(i(r).mul(2).equal());
1656
- return {
1657
- [n]: {
1658
- [c]: {
1659
- display: "block",
1660
- overflow: "hidden",
1661
- borderRadius: 100,
1662
- height: "100%",
1663
- paddingInlineStart: r,
1664
- paddingInlineEnd: o,
1665
- transition: `padding-inline-start ${e.switchDuration} ease-in-out, padding-inline-end ${e.switchDuration} ease-in-out`,
1666
- [`${c}-checked, ${c}-unchecked`]: {
1667
- display: "block",
1668
- color: e.colorTextLightSolid,
1669
- fontSize: e.fontSizeSM,
1670
- transition: `margin-inline-start ${e.switchDuration} ease-in-out, margin-inline-end ${e.switchDuration} ease-in-out`,
1671
- pointerEvents: "none",
1672
- minHeight: a
1673
- },
1674
- [`${c}-checked`]: {
1675
- marginInlineStart: `calc(-100% + ${l} - ${h})`,
1676
- marginInlineEnd: `calc(100% - ${l} + ${h})`
1677
- },
1678
- [`${c}-unchecked`]: {
1679
- marginTop: i(a).mul(-1).equal(),
1680
- marginInlineStart: 0,
1681
- marginInlineEnd: 0
1682
- }
1683
- },
1684
- [`&${n}-checked ${c}`]: {
1685
- paddingInlineStart: o,
1686
- paddingInlineEnd: r,
1687
- [`${c}-checked`]: {
1688
- marginInlineStart: 0,
1689
- marginInlineEnd: 0
1690
- },
1691
- [`${c}-unchecked`]: {
1692
- marginInlineStart: `calc(100% - ${l} + ${h})`,
1693
- marginInlineEnd: `calc(-100% + ${l} - ${h})`
1694
- }
1695
- },
1696
- [`&:not(${n}-disabled):active`]: {
1697
- [`&:not(${n}-checked) ${c}`]: {
1698
- [`${c}-unchecked`]: {
1699
- marginInlineStart: i(t).mul(2).equal(),
1700
- marginInlineEnd: i(t).mul(-1).mul(2).equal()
1701
- }
1702
- },
1703
- [`&${n}-checked ${c}`]: {
1704
- [`${c}-checked`]: {
1705
- marginInlineStart: i(t).mul(-1).mul(2).equal(),
1706
- marginInlineEnd: i(t).mul(2).equal()
1707
- }
1708
- }
1709
- }
1710
- }
1711
- };
1712
- }, ut = (e) => {
1713
- const {
1714
- componentCls: n,
1715
- trackHeight: a,
1716
- trackMinWidth: t
1717
- } = e;
1718
- return {
1719
- [n]: Object.assign(Object.assign(Object.assign(Object.assign({}, G(e)), {
1720
- position: "relative",
1721
- display: "inline-block",
1722
- boxSizing: "border-box",
1723
- minWidth: t,
1724
- height: a,
1725
- lineHeight: `${M(a)}`,
1726
- verticalAlign: "middle",
1727
- background: e.colorTextQuaternary,
1728
- border: "0",
1729
- borderRadius: 100,
1730
- cursor: "pointer",
1731
- transition: `all ${e.motionDurationMid}`,
1732
- userSelect: "none",
1733
- [`&:hover:not(${n}-disabled)`]: {
1734
- background: e.colorTextTertiary
1735
- }
1736
- }), rn(e)), {
1737
- [`&${n}-checked`]: {
1738
- background: e.switchColor,
1739
- [`&:hover:not(${n}-disabled)`]: {
1740
- background: e.colorPrimaryHover
1741
- }
1742
- },
1743
- [`&${n}-loading, &${n}-disabled`]: {
1744
- cursor: "not-allowed",
1745
- opacity: e.switchDisabledOpacity,
1746
- "*": {
1747
- boxShadow: "none",
1748
- cursor: "not-allowed"
1749
- }
1750
- },
1751
- // rtl style
1752
- [`&${n}-rtl`]: {
1753
- direction: "rtl"
1754
- }
1755
- })
1756
- };
1757
- }, ht = (e) => {
1758
- const {
1759
- fontSize: n,
1760
- lineHeight: a,
1761
- controlHeight: t,
1762
- colorWhite: o
1763
- } = e, r = n * a, d = t / 2, i = 2, c = r - i * 2, l = d - i * 2;
1764
- return {
1765
- trackHeight: r,
1766
- trackHeightSM: d,
1767
- trackMinWidth: c * 2 + i * 4,
1768
- trackMinWidthSM: l * 2 + i * 2,
1769
- trackPadding: i,
1770
- // Fixed value
1771
- handleBg: o,
1772
- handleSize: c,
1773
- handleSizeSM: l,
1774
- handleShadow: `0 2px 4px 0 ${new ln("#00230b").setAlpha(0.2).toRgbString()}`,
1775
- innerMinMargin: c / 2,
1776
- innerMaxMargin: c + i + i * 2,
1777
- innerMinMarginSM: l / 2,
1778
- innerMaxMarginSM: l + i + i * 2
1779
- };
1780
- }, gt = ae("Switch", (e) => {
1781
- const n = ie(e, {
1782
- switchDuration: e.motionDurationMid,
1783
- switchColor: e.colorPrimary,
1784
- switchDisabledOpacity: e.opacityLoading,
1785
- switchLoadingIconSize: e.calc(e.fontSizeIcon).mul(0.75).equal(),
1786
- switchLoadingIconColor: `rgba(0, 0, 0, ${e.opacityLoading})`,
1787
- switchHandleActiveInset: "-30%"
1788
- });
1789
- return [
1790
- ut(n),
1791
- // inner style
1792
- dt(n),
1793
- // handle style
1794
- st(n),
1795
- // loading style
1796
- ct(n),
1797
- // small style
1798
- lt(n)
1799
- ];
1800
- }, ht);
1801
- var ft = function(e, n) {
1802
- var a = {};
1803
- for (var t in e)
1804
- Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (a[t] = e[t]);
1805
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
1806
- for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
1807
- n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (a[t[o]] = e[t[o]]);
1808
- return a;
1809
- };
1810
- const mt = /* @__PURE__ */ s.forwardRef((e, n) => {
1811
- const {
1812
- prefixCls: a,
1813
- size: t,
1814
- disabled: o,
1815
- loading: r,
1816
- className: d,
1817
- rootClassName: i,
1818
- style: c,
1819
- checked: l,
1820
- value: h,
1821
- defaultChecked: u,
1822
- defaultValue: C,
1823
- onChange: m
1824
- } = e, O = ft(e, ["prefixCls", "size", "disabled", "loading", "className", "rootClassName", "style", "checked", "value", "defaultChecked", "defaultValue", "onChange"]), [b, p] = Q(!1, {
1825
- value: l ?? h,
1826
- defaultValue: u ?? C
1827
- }), {
1828
- getPrefixCls: I,
1829
- direction: y,
1830
- switch: S
1831
- } = s.useContext(L), v = s.useContext(Oe), x = (o ?? v) || r, g = I("switch", a), k = /* @__PURE__ */ s.createElement("div", {
1832
- className: `${g}-handle`
1833
- }, r && /* @__PURE__ */ s.createElement(gn, {
1834
- className: `${g}-loading-icon`
1835
- })), [f, w, N] = gt(g), $ = he(t), P = _(S == null ? void 0 : S.className, {
1836
- [`${g}-small`]: $ === "small",
1837
- [`${g}-loading`]: r,
1838
- [`${g}-rtl`]: y === "rtl"
1839
- }, d, i, w, N), D = Object.assign(Object.assign({}, S == null ? void 0 : S.style), c), E = function() {
1840
- p(arguments.length <= 0 ? void 0 : arguments[0]), m == null || m.apply(void 0, arguments);
1841
- };
1842
- return f(/* @__PURE__ */ s.createElement(Ne, {
1843
- component: "Switch"
1844
- }, /* @__PURE__ */ s.createElement(He, Object.assign({}, O, {
1845
- checked: b,
1846
- onChange: E,
1847
- prefixCls: g,
1848
- className: P,
1849
- style: D,
1850
- disabled: x,
1851
- ref: n,
1852
- loadingIcon: k
1853
- }))));
1854
- }), ne = mt;
1855
- ne.__ANT_SWITCH = !0;
1856
- process.env.NODE_ENV !== "production" && (ne.displayName = "Switch");
1857
- var pt = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M816 768h-24V428c0-141.1-104.3-257.7-240-277.1V112c0-22.1-17.9-40-40-40s-40 17.9-40 40v38.9c-135.7 19.4-240 136-240 277.1v340h-24c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h216c0 61.8 50.2 112 112 112s112-50.2 112-112h216c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM512 888c-26.5 0-48-21.5-48-48h96c0 26.5-21.5 48-48 48zM304 768V428c0-55.6 21.6-107.8 60.9-147.1S456.4 220 512 220c55.6 0 107.8 21.6 147.1 60.9S720 372.4 720 428v340H304z" } }] }, name: "bell", theme: "outlined" }, bt = function(n, a) {
1858
- return /* @__PURE__ */ s.createElement(W, T({}, n, {
1859
- ref: a,
1860
- icon: pt
1861
- }));
1862
- }, Le = /* @__PURE__ */ s.forwardRef(bt);
1863
- process.env.NODE_ENV !== "production" && (Le.displayName = "BellOutlined");
1864
- var vt = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M928 512.3v-.3c0-229.8-186.2-416-416-416S96 282.2 96 512v.4c0 229.8 186.2 416 416 416s416-186.2 416-416v-.3.2zm-6.7-74.6l.6 3.3-.6-3.3zM676.7 638.2c53.5-82.2 52.5-189.4-11.1-263.7l162.4-8.4c20.5 44.4 32 93.8 32 145.9 0 185.2-144.6 336.6-327.1 347.4l143.8-221.2zM512 652.3c-77.5 0-140.2-62.7-140.2-140.2 0-77.7 62.7-140.2 140.2-140.2S652.2 434.5 652.2 512 589.5 652.3 512 652.3zm369.2-331.7l-3-5.7 3 5.7zM512 164c121.3 0 228.2 62.1 290.4 156.2l-263.6-13.9c-97.5-5.7-190.2 49.2-222.3 141.1L227.8 311c63.1-88.9 166.9-147 284.2-147zM102.5 585.8c26 145 127.1 264 261.6 315.1C229.6 850 128.5 731 102.5 585.8zM164 512c0-55.9 13.2-108.7 36.6-155.5l119.7 235.4c44.1 86.7 137.4 139.7 234 121.6l-74 145.1C302.9 842.5 164 693.5 164 512zm324.7 415.4c4 .2 8 .4 12 .5-4-.2-8-.3-12-.5z" } }] }, name: "chrome", theme: "outlined" }, Ct = function(n, a) {
1865
- return /* @__PURE__ */ s.createElement(W, T({}, n, {
1866
- ref: a,
1867
- icon: vt
1868
- }));
1869
- }, Ve = /* @__PURE__ */ s.forwardRef(Ct);
1870
- process.env.NODE_ENV !== "production" && (Ve.displayName = "ChromeOutlined");
1871
- var yt = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 110.8V792H136V270.8l-27.6-21.5 39.3-50.5 42.8 33.3h643.1l42.8-33.3 39.3 50.5-27.7 21.5zM833.6 232L512 482 190.4 232l-42.8-33.3-39.3 50.5 27.6 21.5 341.6 265.6a55.99 55.99 0 0068.7 0L888 270.8l27.6-21.5-39.3-50.5-42.7 33.2z" } }] }, name: "mail", theme: "outlined" }, $t = function(n, a) {
1872
- return /* @__PURE__ */ s.createElement(W, T({}, n, {
1873
- ref: a,
1874
- icon: yt
1875
- }));
1876
- }, ue = /* @__PURE__ */ s.forwardRef($t);
1877
- process.env.NODE_ENV !== "production" && (ue.displayName = "MailOutlined");
1878
- var St = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M464 512a48 48 0 1096 0 48 48 0 10-96 0zm200 0a48 48 0 1096 0 48 48 0 10-96 0zm-400 0a48 48 0 1096 0 48 48 0 10-96 0zm661.2-173.6c-22.6-53.7-55-101.9-96.3-143.3a444.35 444.35 0 00-143.3-96.3C630.6 75.7 572.2 64 512 64h-2c-60.6.3-119.3 12.3-174.5 35.9a445.35 445.35 0 00-142 96.5c-40.9 41.3-73 89.3-95.2 142.8-23 55.4-34.6 114.3-34.3 174.9A449.4 449.4 0 00112 714v152a46 46 0 0046 46h152.1A449.4 449.4 0 00510 960h2.1c59.9 0 118-11.6 172.7-34.3a444.48 444.48 0 00142.8-95.2c41.3-40.9 73.8-88.7 96.5-142 23.6-55.2 35.6-113.9 35.9-174.5.3-60.9-11.5-120-34.8-175.6zm-151.1 438C704 845.8 611 884 512 884h-1.7c-60.3-.3-120.2-15.3-173.1-43.5l-8.4-4.5H188V695.2l-4.5-8.4C155.3 633.9 140.3 574 140 513.7c-.4-99.7 37.7-193.3 107.6-263.8 69.8-70.5 163.1-109.5 262.8-109.9h1.7c50 0 98.5 9.7 144.2 28.9 44.6 18.7 84.6 45.6 119 80 34.3 34.3 61.3 74.4 80 119 19.4 46.2 29.1 95.2 28.9 145.8-.6 99.6-39.7 192.9-110.1 262.7z" } }] }, name: "message", theme: "outlined" }, xt = function(n, a) {
1879
- return /* @__PURE__ */ s.createElement(W, T({}, n, {
1880
- ref: a,
1881
- icon: St
1882
- }));
1883
- }, We = /* @__PURE__ */ s.forwardRef(xt);
1884
- process.env.NODE_ENV !== "production" && (We.displayName = "MessageOutlined");
1885
- var It = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M744 62H280c-35.3 0-64 28.7-64 64v768c0 35.3 28.7 64 64 64h464c35.3 0 64-28.7 64-64V126c0-35.3-28.7-64-64-64zm-8 824H288V134h448v752zM472 784a40 40 0 1080 0 40 40 0 10-80 0z" } }] }, name: "mobile", theme: "outlined" }, wt = function(n, a) {
1886
- return /* @__PURE__ */ s.createElement(W, T({}, n, {
1887
- ref: a,
1888
- icon: It
1889
- }));
1890
- }, qe = /* @__PURE__ */ s.forwardRef(wt);
1891
- process.env.NODE_ENV !== "production" && (qe.displayName = "MobileOutlined");
1892
- var Et = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M877.1 238.7L770.6 132.3c-13-13-30.4-20.3-48.8-20.3s-35.8 7.2-48.8 20.3L558.3 246.8c-13 13-20.3 30.5-20.3 48.9 0 18.5 7.2 35.8 20.3 48.9l89.6 89.7a405.46 405.46 0 01-86.4 127.3c-36.7 36.9-79.6 66-127.2 86.6l-89.6-89.7c-13-13-30.4-20.3-48.8-20.3a68.2 68.2 0 00-48.8 20.3L132.3 673c-13 13-20.3 30.5-20.3 48.9 0 18.5 7.2 35.8 20.3 48.9l106.4 106.4c22.2 22.2 52.8 34.9 84.2 34.9 6.5 0 12.8-.5 19.2-1.6 132.4-21.8 263.8-92.3 369.9-198.3C818 606 888.4 474.6 910.4 342.1c6.3-37.6-6.3-76.3-33.3-103.4zm-37.6 91.5c-19.5 117.9-82.9 235.5-178.4 331s-213 158.9-330.9 178.4c-14.8 2.5-30-2.5-40.8-13.2L184.9 721.9 295.7 611l119.8 120 .9.9 21.6-8a481.29 481.29 0 00285.7-285.8l8-21.6-120.8-120.7 110.8-110.9 104.5 104.5c10.8 10.8 15.8 26 13.3 40.8z" } }] }, name: "phone", theme: "outlined" }, Ot = function(n, a) {
1893
- return /* @__PURE__ */ s.createElement(W, T({}, n, {
1894
- ref: a,
1895
- icon: Et
1896
- }));
1897
- }, Ge = /* @__PURE__ */ s.forwardRef(Ot);
1898
- process.env.NODE_ENV !== "production" && (Ge.displayName = "PhoneOutlined");
1899
- const J = fn.Text, kt = (e, n) => {
1900
- const a = ["EMAIL", "INAPP_WEB", "SMS", "CALL", "PUSH", "WEB_PUSH"];
1901
- return a.indexOf(e) - a.indexOf(n);
1902
- }, xe = (e, n) => {
1903
- const a = ["off", "instant", "hourly", "daily", "weekly", "monthly"];
1904
- return a.indexOf(e) - a.indexOf(n);
1905
- }, Ie = (e) => ({
1906
- off: "Off",
1907
- instant: "Instant",
1908
- hourly: "Hourly",
1909
- daily: "Daily",
1910
- weekly: "Weekly",
1911
- monthly: "Monthly"
1912
- })[e], we = ({
1913
- notification: e,
1914
- preferences: n,
1915
- updateDelivery: a,
1916
- subNotificationId: t
1917
- }) => /* @__PURE__ */ R(Z, { children: e.channels.sort(kt).map((o, r) => {
1918
- const d = n.find(
1919
- (u) => u.notificationId === e.notificationId && u.channel === o
1920
- );
1921
- if (!d)
1922
- return null;
1923
- let i = Nt(o), c = Pt(o);
1924
- const l = Object.keys(e.options[o]).filter(
1925
- (u) => u !== "defaultDeliveryOption" && u !== "defaultDeliverOption"
1926
- );
1927
- let h;
1928
- return l.length === 1 ? h = /* @__PURE__ */ R(J, { children: Ie(d.delivery) }) : l.length === 2 && l.includes("off") ? h = /* @__PURE__ */ R(
1929
- ne,
1930
- {
1931
- checked: d.delivery !== "off",
1932
- onChange: (u) => {
1933
- if (u) {
1934
- const C = l.find((m) => m !== "off");
1935
- a(
1936
- e.notificationId,
1937
- o,
1938
- C,
1939
- t
1940
- );
1941
- } else
1942
- a(
1943
- e.notificationId,
1944
- o,
1945
- "off",
1946
- t
1947
- );
1948
- }
1949
- }
1950
- ) : h = /* @__PURE__ */ q(Z, { children: [
1951
- /* @__PURE__ */ R(
1952
- ne,
1953
- {
1954
- checked: d.delivery !== "off",
1955
- onChange: (u) => {
1956
- if (u) {
1957
- const C = l.sort(xe).find((m) => m !== "off");
1958
- a(
1959
- e.notificationId,
1960
- o,
1961
- C,
1962
- t
1963
- );
1964
- } else
1965
- a(
1966
- e.notificationId,
1967
- o,
1968
- "off",
1969
- t
1970
- );
1971
- }
1972
- }
1973
- ),
1974
- /* @__PURE__ */ R(
1975
- "div",
1976
- {
1977
- style: {
1978
- width: "100%",
1979
- marginTop: 8,
1980
- maxHeight: d.delivery !== "off" ? 1e3 : 0,
1981
- overflow: "hidden",
1982
- transition: "max-height 0.3s ease"
1983
- },
1984
- children: /* @__PURE__ */ q("div", { children: [
1985
- /* @__PURE__ */ R("div", { style: { marginTop: 20 }, children: /* @__PURE__ */ R(J, { strong: !0, children: "Choose frequency:" }) }),
1986
- /* @__PURE__ */ R(
1987
- U.Group,
1988
- {
1989
- value: d.delivery,
1990
- onChange: (u) => {
1991
- a(
1992
- e.notificationId,
1993
- o,
1994
- u.target.value,
1995
- t
1996
- );
1997
- },
1998
- children: /* @__PURE__ */ R(me, { direction: "vertical", style: { paddingTop: 10 }, children: l.filter((u) => u !== "off").sort(xe).map((u) => /* @__PURE__ */ R(U, { value: u, children: /* @__PURE__ */ R(J, { children: Ie(u) }) }, u)) })
1999
- }
2000
- )
2001
- ] })
2002
- }
2003
- )
2004
- ] }), /* @__PURE__ */ q("div", { children: [
2005
- /* @__PURE__ */ q(
2006
- "div",
2007
- {
2008
- style: {
2009
- display: "flex",
2010
- justifyContent: "space-between",
2011
- flexWrap: "wrap",
2012
- marginTop: r === 0 ? 12 : 0,
2013
- marginBottom: r === e.channels.length - 1 ? 12 : 0
2014
- },
2015
- children: [
2016
- /* @__PURE__ */ q(J, { children: [
2017
- c,
2018
- " ",
2019
- i
2020
- ] }),
2021
- h
2022
- ]
2023
- },
2024
- o
2025
- ),
2026
- r !== e.channels.length - 1 && /* @__PURE__ */ R(je, {})
2027
- ] }, o);
2028
- }) }), Nt = (e) => ({
2029
- EMAIL: "Email",
2030
- INAPP_WEB: "In-App",
2031
- SMS: "Text",
2032
- CALL: "Automated Calling",
2033
- PUSH: "Mobile",
2034
- WEB_PUSH: "Browser"
2035
- })[e], Pt = (e) => {
2036
- switch (e) {
2037
- case "EMAIL":
2038
- return /* @__PURE__ */ R(ue, { style: { color: V.primary } });
2039
- case "SMS":
2040
- return /* @__PURE__ */ R(We, { style: { color: V.primary } });
2041
- case "PUSH":
2042
- return /* @__PURE__ */ R(qe, { style: { color: V.primary } });
2043
- case "CALL":
2044
- return /* @__PURE__ */ R(Ge, { style: { color: V.primary } });
2045
- case "INAPP_WEB":
2046
- return /* @__PURE__ */ R(Le, { style: { color: V.primary } });
2047
- case "WEB_PUSH":
2048
- return /* @__PURE__ */ R(Ve, { style: { color: V.primary } });
2049
- default:
2050
- return /* @__PURE__ */ R(ue, { style: { color: V.primary } });
2051
- }
2052
- };
2053
- function _t() {
2054
- const e = Je(Ue);
2055
- if (!e || !e.preferences)
2056
- return null;
2057
- const n = e.preferences.notifications.map(
2058
- (a) => {
2059
- var d, i, c;
2060
- const t = (d = e.preferences) == null ? void 0 : d.preferences.filter(
2061
- (l) => l.notificationId === a.notificationId && !l.subNotificationId
2062
- ), o = (i = e.preferences) == null ? void 0 : i.preferences.filter(
2063
- (l) => l.notificationId === a.notificationId && l.subNotificationId
2064
- ), r = (c = e.preferences) == null ? void 0 : c.subNotifications.filter(
2065
- (l) => o == null ? void 0 : o.find(
2066
- (h) => h.subNotificationId === l.subNotificationId
2067
- )
2068
- );
2069
- return {
2070
- label: a.title,
2071
- key: a.notificationId,
2072
- children: /* @__PURE__ */ q(Z, { children: [
2073
- /* @__PURE__ */ R(
2074
- we,
2075
- {
2076
- notification: a,
2077
- preferences: t || [],
2078
- updateDelivery: e.updateDelivery
2079
- },
2080
- a.notificationId
2081
- ),
2082
- r == null ? void 0 : r.map((l) => /* @__PURE__ */ R(
2083
- ye,
2084
- {
2085
- bordered: !1,
2086
- items: [
2087
- {
2088
- label: l.title,
2089
- key: l.subNotificationId,
2090
- children: /* @__PURE__ */ R(
2091
- we,
2092
- {
2093
- notification: a,
2094
- preferences: o || [],
2095
- updateDelivery: e.updateDelivery,
2096
- subNotificationId: l.subNotificationId
2097
- },
2098
- l.subNotificationId
2099
- )
2100
- }
2101
- ],
2102
- defaultActiveKey: []
2103
- },
2104
- l.subNotificationId
2105
- ))
2106
- ] })
2107
- };
2108
- }
2109
- );
2110
- return /* @__PURE__ */ R(Z, { children: /* @__PURE__ */ R(ye, { items: n, defaultActiveKey: [] }) });
2111
- }
2112
- export {
2113
- _t as P,
2114
- Le as R,
2115
- Me as a,
2116
- we as b,
2117
- Pt as c,
2118
- Nt as g,
2119
- Pe as p
2120
- };