@notificationapi/react 0.0.34 → 0.0.35

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 (30) hide show
  1. package/README.md +1 -1
  2. package/dist/assets/AntdIcon.js +1 -1
  3. package/dist/assets/CloseOutlined.js +13 -0
  4. package/dist/assets/Notification.js +17 -16
  5. package/dist/assets/PreferenceInput.js +1470 -0
  6. package/dist/assets/PurePanel.js +32 -42
  7. package/dist/assets/WebPushOptInMessage.js +478 -0
  8. package/dist/assets/button.js +50 -50
  9. package/dist/assets/colors.js +25 -20840
  10. package/dist/assets/compact-item.js +860 -0
  11. package/dist/assets/index.js +11 -9
  12. package/dist/assets/index2.js +10 -9
  13. package/dist/assets/index3.js +2303 -3150
  14. package/dist/assets/presets.js +22 -22
  15. package/dist/assets/reactNode.js +20821 -0
  16. package/dist/components/Notifications/Inbox.js +81 -78
  17. package/dist/components/Notifications/NotificationFeed.js +59 -31
  18. package/dist/components/Notifications/NotificationLauncher.js +61 -41
  19. package/dist/components/Notifications/NotificationPopup.js +72 -65
  20. package/dist/components/Preferences/NotificationPreferencesInline.d.ts +1 -1
  21. package/dist/components/Preferences/NotificationPreferencesInline.js +39 -5
  22. package/dist/components/Preferences/NotificationPreferencesPopup.d.ts +1 -1
  23. package/dist/components/Preferences/NotificationPreferencesPopup.js +463 -464
  24. package/dist/components/Preferences/PreferenceInput.js +5 -1466
  25. package/dist/components/Preferences/Preferences.js +24 -23
  26. package/dist/components/Provider/index.d.ts +9 -1
  27. package/dist/components/Provider/index.js +209 -154
  28. package/dist/components/WebPush/WebPushOptInMessage.d.ts +14 -0
  29. package/dist/components/WebPush/WebPushOptInMessage.js +8 -0
  30. package/package.json +2 -2
@@ -0,0 +1,1470 @@
1
+ import { jsx as D, Fragment as re, jsxs as L } from "react/jsx-runtime";
2
+ import { g as ze, a as Pe } from "./channelUtils.js";
3
+ import { F as Ne, u as ge, K as ae, T as Me } from "./index3.js";
4
+ import * as d from "react";
5
+ import Re, { forwardRef as je, useRef as le, useImperativeHandle as De } from "react";
6
+ import { u as Y, W as be, T as Be, a as pe, C as _e, t as Te, b as He, c as We } from "./compact-item.js";
7
+ import { e as fe, f as me, c as _, b as U, a as ve, _ as de } from "./presets.js";
8
+ import { g as ne, m as oe, r as A, u as E, p as Ce, a as W, i as qe, f as Se, D as $e, q as Ve, T as Le } from "./reactNode.js";
9
+ import { p as Ae } from "./pickAttrs.js";
10
+ const ye = /* @__PURE__ */ d.createContext(null), Ge = ye.Provider, xe = /* @__PURE__ */ d.createContext(null), Fe = xe.Provider;
11
+ var Xe = ["prefixCls", "className", "style", "checked", "disabled", "defaultChecked", "type", "title", "onChange"], Ke = /* @__PURE__ */ je(function(e, n) {
12
+ var i = e.prefixCls, t = i === void 0 ? "rc-checkbox" : i, o = e.className, s = e.style, a = e.checked, r = e.disabled, l = e.defaultChecked, c = l === void 0 ? !1 : l, g = e.type, u = g === void 0 ? "checkbox" : g, S = e.title, m = e.onChange, w = fe(e, Xe), y = le(null), b = le(null), k = Y(c, {
13
+ value: a
14
+ }), f = me(k, 2), v = f[0], x = f[1];
15
+ De(n, function() {
16
+ return {
17
+ focus: function(h) {
18
+ var $;
19
+ ($ = y.current) === null || $ === void 0 || $.focus(h);
20
+ },
21
+ blur: function() {
22
+ var h;
23
+ (h = y.current) === null || h === void 0 || h.blur();
24
+ },
25
+ input: y.current,
26
+ nativeElement: b.current
27
+ };
28
+ });
29
+ var I = _(t, o, U(U({}, "".concat(t, "-checked"), v), "".concat(t, "-disabled"), r)), p = function(h) {
30
+ r || ("checked" in e || x(h.target.checked), m == null || m({
31
+ target: de(de({}, e), {}, {
32
+ type: u,
33
+ checked: h.target.checked
34
+ }),
35
+ stopPropagation: function() {
36
+ h.stopPropagation();
37
+ },
38
+ preventDefault: function() {
39
+ h.preventDefault();
40
+ },
41
+ nativeEvent: h.nativeEvent
42
+ }));
43
+ };
44
+ return /* @__PURE__ */ d.createElement("span", {
45
+ className: I,
46
+ title: S,
47
+ style: s,
48
+ ref: b
49
+ }, /* @__PURE__ */ d.createElement("input", ve({}, w, {
50
+ className: "".concat(t, "-input"),
51
+ ref: y,
52
+ onChange: p,
53
+ disabled: r,
54
+ checked: !!v,
55
+ type: u
56
+ })), /* @__PURE__ */ d.createElement("span", {
57
+ className: "".concat(t, "-inner")
58
+ }));
59
+ });
60
+ const Ue = (e) => {
61
+ const {
62
+ componentCls: n,
63
+ antCls: i
64
+ } = e, t = `${n}-group`;
65
+ return {
66
+ [t]: Object.assign(Object.assign({}, A(e)), {
67
+ display: "inline-block",
68
+ fontSize: 0,
69
+ // RTL
70
+ [`&${t}-rtl`]: {
71
+ direction: "rtl"
72
+ },
73
+ [`&${t}-block`]: {
74
+ display: "flex"
75
+ },
76
+ [`${i}-badge ${i}-badge-count`]: {
77
+ zIndex: 1
78
+ },
79
+ [`> ${i}-badge:not(:first-child) > ${i}-button-wrapper`]: {
80
+ borderInlineStart: "none"
81
+ }
82
+ })
83
+ };
84
+ }, Qe = (e) => {
85
+ const {
86
+ componentCls: n,
87
+ wrapperMarginInlineEnd: i,
88
+ colorPrimary: t,
89
+ radioSize: o,
90
+ motionDurationSlow: s,
91
+ motionDurationMid: a,
92
+ motionEaseInOutCirc: r,
93
+ colorBgContainer: l,
94
+ colorBorder: c,
95
+ lineWidth: g,
96
+ colorBgContainerDisabled: u,
97
+ colorTextDisabled: S,
98
+ paddingXS: m,
99
+ dotColorDisabled: w,
100
+ lineType: y,
101
+ radioColor: b,
102
+ radioBgColor: k,
103
+ calc: f
104
+ } = e, v = `${n}-inner`, I = f(o).sub(f(4).mul(2)), p = f(1).mul(o).equal({
105
+ unit: !0
106
+ });
107
+ return {
108
+ [`${n}-wrapper`]: Object.assign(Object.assign({}, A(e)), {
109
+ display: "inline-flex",
110
+ alignItems: "baseline",
111
+ marginInlineStart: 0,
112
+ marginInlineEnd: i,
113
+ cursor: "pointer",
114
+ // RTL
115
+ [`&${n}-wrapper-rtl`]: {
116
+ direction: "rtl"
117
+ },
118
+ "&-disabled": {
119
+ cursor: "not-allowed",
120
+ color: e.colorTextDisabled
121
+ },
122
+ "&::after": {
123
+ display: "inline-block",
124
+ width: 0,
125
+ overflow: "hidden",
126
+ content: '"\\a0"'
127
+ },
128
+ "&-block": {
129
+ flex: 1,
130
+ justifyContent: "center"
131
+ },
132
+ // hashId 在 wrapper 上,只能铺平
133
+ [`${n}-checked::after`]: {
134
+ position: "absolute",
135
+ insetBlockStart: 0,
136
+ insetInlineStart: 0,
137
+ width: "100%",
138
+ height: "100%",
139
+ border: `${E(g)} ${y} ${t}`,
140
+ borderRadius: "50%",
141
+ visibility: "hidden",
142
+ opacity: 0,
143
+ content: '""'
144
+ },
145
+ [n]: Object.assign(Object.assign({}, A(e)), {
146
+ position: "relative",
147
+ display: "inline-block",
148
+ outline: "none",
149
+ cursor: "pointer",
150
+ alignSelf: "center",
151
+ borderRadius: "50%"
152
+ }),
153
+ [`${n}-wrapper:hover &,
154
+ &:hover ${v}`]: {
155
+ borderColor: t
156
+ },
157
+ [`${n}-input:focus-visible + ${v}`]: Object.assign({}, Ce(e)),
158
+ [`${n}:hover::after, ${n}-wrapper:hover &::after`]: {
159
+ visibility: "visible"
160
+ },
161
+ [`${n}-inner`]: {
162
+ "&::after": {
163
+ boxSizing: "border-box",
164
+ position: "absolute",
165
+ insetBlockStart: "50%",
166
+ insetInlineStart: "50%",
167
+ display: "block",
168
+ width: p,
169
+ height: p,
170
+ marginBlockStart: f(1).mul(o).div(-2).equal({
171
+ unit: !0
172
+ }),
173
+ marginInlineStart: f(1).mul(o).div(-2).equal({
174
+ unit: !0
175
+ }),
176
+ backgroundColor: b,
177
+ borderBlockStart: 0,
178
+ borderInlineStart: 0,
179
+ borderRadius: p,
180
+ transform: "scale(0)",
181
+ opacity: 0,
182
+ transition: `all ${s} ${r}`,
183
+ content: '""'
184
+ },
185
+ boxSizing: "border-box",
186
+ position: "relative",
187
+ insetBlockStart: 0,
188
+ insetInlineStart: 0,
189
+ display: "block",
190
+ width: p,
191
+ height: p,
192
+ backgroundColor: l,
193
+ borderColor: c,
194
+ borderStyle: "solid",
195
+ borderWidth: g,
196
+ borderRadius: "50%",
197
+ transition: `all ${a}`
198
+ },
199
+ [`${n}-input`]: {
200
+ position: "absolute",
201
+ inset: 0,
202
+ zIndex: 1,
203
+ cursor: "pointer",
204
+ opacity: 0
205
+ },
206
+ // 选中状态
207
+ [`${n}-checked`]: {
208
+ [v]: {
209
+ borderColor: t,
210
+ backgroundColor: k,
211
+ "&::after": {
212
+ transform: `scale(${e.calc(e.dotSize).div(o).equal()})`,
213
+ opacity: 1,
214
+ transition: `all ${s} ${r}`
215
+ }
216
+ }
217
+ },
218
+ [`${n}-disabled`]: {
219
+ cursor: "not-allowed",
220
+ [v]: {
221
+ backgroundColor: u,
222
+ borderColor: c,
223
+ cursor: "not-allowed",
224
+ "&::after": {
225
+ backgroundColor: w
226
+ }
227
+ },
228
+ [`${n}-input`]: {
229
+ cursor: "not-allowed"
230
+ },
231
+ [`${n}-disabled + span`]: {
232
+ color: S,
233
+ cursor: "not-allowed"
234
+ },
235
+ [`&${n}-checked`]: {
236
+ [v]: {
237
+ "&::after": {
238
+ transform: `scale(${f(I).div(o).equal()})`
239
+ }
240
+ }
241
+ }
242
+ },
243
+ [`span${n} + *`]: {
244
+ paddingInlineStart: m,
245
+ paddingInlineEnd: m
246
+ }
247
+ })
248
+ };
249
+ }, Ye = (e) => {
250
+ const {
251
+ buttonColor: n,
252
+ controlHeight: i,
253
+ componentCls: t,
254
+ lineWidth: o,
255
+ lineType: s,
256
+ colorBorder: a,
257
+ motionDurationSlow: r,
258
+ motionDurationMid: l,
259
+ buttonPaddingInline: c,
260
+ fontSize: g,
261
+ buttonBg: u,
262
+ fontSizeLG: S,
263
+ controlHeightLG: m,
264
+ controlHeightSM: w,
265
+ paddingXS: y,
266
+ borderRadius: b,
267
+ borderRadiusSM: k,
268
+ borderRadiusLG: f,
269
+ buttonCheckedBg: v,
270
+ buttonSolidCheckedColor: x,
271
+ colorTextDisabled: I,
272
+ colorBgContainerDisabled: p,
273
+ buttonCheckedBgDisabled: P,
274
+ buttonCheckedColorDisabled: h,
275
+ colorPrimary: $,
276
+ colorPrimaryHover: z,
277
+ colorPrimaryActive: C,
278
+ buttonSolidCheckedBg: R,
279
+ buttonSolidCheckedHoverBg: N,
280
+ buttonSolidCheckedActiveBg: j,
281
+ calc: M
282
+ } = e;
283
+ return {
284
+ [`${t}-button-wrapper`]: {
285
+ position: "relative",
286
+ display: "inline-block",
287
+ height: i,
288
+ margin: 0,
289
+ paddingInline: c,
290
+ paddingBlock: 0,
291
+ color: n,
292
+ fontSize: g,
293
+ lineHeight: E(M(i).sub(M(o).mul(2)).equal()),
294
+ background: u,
295
+ border: `${E(o)} ${s} ${a}`,
296
+ // strange align fix for chrome but works
297
+ // https://gw.alipayobjects.com/zos/rmsportal/VFTfKXJuogBAXcvfAUWJ.gif
298
+ borderBlockStartWidth: M(o).add(0.02).equal(),
299
+ borderInlineStartWidth: 0,
300
+ borderInlineEndWidth: o,
301
+ cursor: "pointer",
302
+ transition: [`color ${l}`, `background ${l}`, `box-shadow ${l}`].join(","),
303
+ a: {
304
+ color: n
305
+ },
306
+ [`> ${t}-button`]: {
307
+ position: "absolute",
308
+ insetBlockStart: 0,
309
+ insetInlineStart: 0,
310
+ zIndex: -1,
311
+ width: "100%",
312
+ height: "100%"
313
+ },
314
+ "&:not(:first-child)": {
315
+ "&::before": {
316
+ position: "absolute",
317
+ insetBlockStart: M(o).mul(-1).equal(),
318
+ insetInlineStart: M(o).mul(-1).equal(),
319
+ display: "block",
320
+ boxSizing: "content-box",
321
+ width: 1,
322
+ height: "100%",
323
+ paddingBlock: o,
324
+ paddingInline: 0,
325
+ backgroundColor: a,
326
+ transition: `background-color ${r}`,
327
+ content: '""'
328
+ }
329
+ },
330
+ "&:first-child": {
331
+ borderInlineStart: `${E(o)} ${s} ${a}`,
332
+ borderStartStartRadius: b,
333
+ borderEndStartRadius: b
334
+ },
335
+ "&:last-child": {
336
+ borderStartEndRadius: b,
337
+ borderEndEndRadius: b
338
+ },
339
+ "&:first-child:last-child": {
340
+ borderRadius: b
341
+ },
342
+ [`${t}-group-large &`]: {
343
+ height: m,
344
+ fontSize: S,
345
+ lineHeight: E(M(m).sub(M(o).mul(2)).equal()),
346
+ "&:first-child": {
347
+ borderStartStartRadius: f,
348
+ borderEndStartRadius: f
349
+ },
350
+ "&:last-child": {
351
+ borderStartEndRadius: f,
352
+ borderEndEndRadius: f
353
+ }
354
+ },
355
+ [`${t}-group-small &`]: {
356
+ height: w,
357
+ paddingInline: M(y).sub(o).equal(),
358
+ paddingBlock: 0,
359
+ lineHeight: E(M(w).sub(M(o).mul(2)).equal()),
360
+ "&:first-child": {
361
+ borderStartStartRadius: k,
362
+ borderEndStartRadius: k
363
+ },
364
+ "&:last-child": {
365
+ borderStartEndRadius: k,
366
+ borderEndEndRadius: k
367
+ }
368
+ },
369
+ "&:hover": {
370
+ position: "relative",
371
+ color: $
372
+ },
373
+ "&:has(:focus-visible)": Object.assign({}, Ce(e)),
374
+ [`${t}-inner, input[type='checkbox'], input[type='radio']`]: {
375
+ width: 0,
376
+ height: 0,
377
+ opacity: 0,
378
+ pointerEvents: "none"
379
+ },
380
+ [`&-checked:not(${t}-button-wrapper-disabled)`]: {
381
+ zIndex: 1,
382
+ color: $,
383
+ background: v,
384
+ borderColor: $,
385
+ "&::before": {
386
+ backgroundColor: $
387
+ },
388
+ "&:first-child": {
389
+ borderColor: $
390
+ },
391
+ "&:hover": {
392
+ color: z,
393
+ borderColor: z,
394
+ "&::before": {
395
+ backgroundColor: z
396
+ }
397
+ },
398
+ "&:active": {
399
+ color: C,
400
+ borderColor: C,
401
+ "&::before": {
402
+ backgroundColor: C
403
+ }
404
+ }
405
+ },
406
+ [`${t}-group-solid &-checked:not(${t}-button-wrapper-disabled)`]: {
407
+ color: x,
408
+ background: R,
409
+ borderColor: R,
410
+ "&:hover": {
411
+ color: x,
412
+ background: N,
413
+ borderColor: N
414
+ },
415
+ "&:active": {
416
+ color: x,
417
+ background: j,
418
+ borderColor: j
419
+ }
420
+ },
421
+ "&-disabled": {
422
+ color: I,
423
+ backgroundColor: p,
424
+ borderColor: a,
425
+ cursor: "not-allowed",
426
+ "&:first-child, &:hover": {
427
+ color: I,
428
+ backgroundColor: p,
429
+ borderColor: a
430
+ }
431
+ },
432
+ [`&-disabled${t}-button-wrapper-checked`]: {
433
+ color: h,
434
+ backgroundColor: P,
435
+ borderColor: a,
436
+ boxShadow: "none"
437
+ },
438
+ "&-block": {
439
+ flex: 1,
440
+ textAlign: "center"
441
+ }
442
+ }
443
+ };
444
+ }, Je = (e) => {
445
+ const {
446
+ wireframe: n,
447
+ padding: i,
448
+ marginXS: t,
449
+ lineWidth: o,
450
+ fontSizeLG: s,
451
+ colorText: a,
452
+ colorBgContainer: r,
453
+ colorTextDisabled: l,
454
+ controlItemBgActiveDisabled: c,
455
+ colorTextLightSolid: g,
456
+ colorPrimary: u,
457
+ colorPrimaryHover: S,
458
+ colorPrimaryActive: m,
459
+ colorWhite: w
460
+ } = e, y = 4, b = s, k = n ? b - y * 2 : b - (y + o) * 2;
461
+ return {
462
+ // Radio
463
+ radioSize: b,
464
+ dotSize: k,
465
+ dotColorDisabled: l,
466
+ // Radio buttons
467
+ buttonSolidCheckedColor: g,
468
+ buttonSolidCheckedBg: u,
469
+ buttonSolidCheckedHoverBg: S,
470
+ buttonSolidCheckedActiveBg: m,
471
+ buttonBg: r,
472
+ buttonCheckedBg: r,
473
+ buttonColor: a,
474
+ buttonCheckedBgDisabled: c,
475
+ buttonCheckedColorDisabled: l,
476
+ buttonPaddingInline: i - o,
477
+ wrapperMarginInlineEnd: t,
478
+ // internal
479
+ radioColor: n ? u : w,
480
+ radioBgColor: n ? r : u
481
+ };
482
+ }, we = ne("Radio", (e) => {
483
+ const {
484
+ controlOutline: n,
485
+ controlOutlineWidth: i
486
+ } = e, t = `0 0 0 ${E(i)} ${n}`, s = oe(e, {
487
+ radioFocusShadow: t,
488
+ radioButtonFocusShadow: t
489
+ });
490
+ return [Ue(s), Qe(s), Ye(s)];
491
+ }, Je, {
492
+ unitless: {
493
+ radioSize: !0,
494
+ dotSize: !0
495
+ }
496
+ });
497
+ var Ze = function(e, n) {
498
+ var i = {};
499
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (i[t] = e[t]);
500
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
501
+ n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (i[t[o]] = e[t[o]]);
502
+ return i;
503
+ };
504
+ const et = (e, n) => {
505
+ var i, t;
506
+ const o = d.useContext(ye), s = d.useContext(xe), {
507
+ getPrefixCls: a,
508
+ direction: r,
509
+ radio: l
510
+ } = d.useContext(W), c = d.useRef(null), g = qe(n, c), {
511
+ isFormItemInput: u
512
+ } = d.useContext(Ne);
513
+ if (process.env.NODE_ENV !== "production") {
514
+ const j = Se("Radio");
515
+ process.env.NODE_ENV !== "production" && j(!("optionType" in e), "usage", "`optionType` is only support in Radio.Group.");
516
+ }
517
+ const S = (j) => {
518
+ var M, T;
519
+ (M = e.onChange) === null || M === void 0 || M.call(e, j), (T = o == null ? void 0 : o.onChange) === null || T === void 0 || T.call(o, j);
520
+ }, {
521
+ prefixCls: m,
522
+ className: w,
523
+ rootClassName: y,
524
+ children: b,
525
+ style: k,
526
+ title: f
527
+ } = e, v = Ze(e, ["prefixCls", "className", "rootClassName", "children", "style", "title"]), x = a("radio", m), I = ((o == null ? void 0 : o.optionType) || s) === "button", p = I ? `${x}-button` : x, P = ge(x), [h, $, z] = we(x, P), C = Object.assign({}, v), R = d.useContext($e);
528
+ o && (C.name = o.name, C.onChange = S, C.checked = e.value === o.value, C.disabled = (i = C.disabled) !== null && i !== void 0 ? i : o.disabled), C.disabled = (t = C.disabled) !== null && t !== void 0 ? t : R;
529
+ const N = _(`${p}-wrapper`, {
530
+ [`${p}-wrapper-checked`]: C.checked,
531
+ [`${p}-wrapper-disabled`]: C.disabled,
532
+ [`${p}-wrapper-rtl`]: r === "rtl",
533
+ [`${p}-wrapper-in-form-item`]: u,
534
+ [`${p}-wrapper-block`]: !!(o != null && o.block)
535
+ }, l == null ? void 0 : l.className, w, y, $, z, P);
536
+ return h(/* @__PURE__ */ d.createElement(be, {
537
+ component: "Radio",
538
+ disabled: C.disabled
539
+ }, /* @__PURE__ */ d.createElement("label", {
540
+ className: N,
541
+ style: Object.assign(Object.assign({}, l == null ? void 0 : l.style), k),
542
+ onMouseEnter: e.onMouseEnter,
543
+ onMouseLeave: e.onMouseLeave,
544
+ title: f
545
+ }, /* @__PURE__ */ d.createElement(Ke, Object.assign({}, C, {
546
+ className: _(C.className, {
547
+ [Be]: !I
548
+ }),
549
+ type: "radio",
550
+ prefixCls: p,
551
+ ref: g
552
+ })), b !== void 0 ? /* @__PURE__ */ d.createElement("span", null, b) : null)));
553
+ }, G = /* @__PURE__ */ d.forwardRef(et);
554
+ process.env.NODE_ENV !== "production" && (G.displayName = "Radio");
555
+ const tt = /* @__PURE__ */ d.forwardRef((e, n) => {
556
+ const {
557
+ getPrefixCls: i,
558
+ direction: t
559
+ } = d.useContext(W), {
560
+ prefixCls: o,
561
+ className: s,
562
+ rootClassName: a,
563
+ options: r,
564
+ buttonStyle: l = "outline",
565
+ disabled: c,
566
+ children: g,
567
+ size: u,
568
+ style: S,
569
+ id: m,
570
+ optionType: w,
571
+ name: y,
572
+ defaultValue: b,
573
+ value: k,
574
+ block: f = !1,
575
+ onChange: v,
576
+ onMouseEnter: x,
577
+ onMouseLeave: I,
578
+ onFocus: p,
579
+ onBlur: P
580
+ } = e, [h, $] = Y(b, {
581
+ value: k
582
+ }), z = d.useCallback((O) => {
583
+ const H = h, B = O.target.value;
584
+ "value" in e || $(B), B !== H && (v == null || v(O));
585
+ }, [h, $, v]), C = i("radio", o), R = `${C}-group`, N = ge(C), [j, M, T] = we(C, N);
586
+ let X = g;
587
+ r && r.length > 0 && (X = r.map((O) => typeof O == "string" || typeof O == "number" ? /* @__PURE__ */ d.createElement(G, {
588
+ key: O.toString(),
589
+ prefixCls: C,
590
+ disabled: c,
591
+ value: O,
592
+ checked: h === O
593
+ }, O) : /* @__PURE__ */ d.createElement(G, {
594
+ key: `radio-group-value-options-${O.value}`,
595
+ prefixCls: C,
596
+ disabled: O.disabled || c,
597
+ value: O.value,
598
+ checked: h === O.value,
599
+ title: O.title,
600
+ style: O.style,
601
+ id: O.id,
602
+ required: O.required
603
+ }, O.label)));
604
+ const q = pe(u), V = _(R, `${R}-${l}`, {
605
+ [`${R}-${q}`]: q,
606
+ [`${R}-rtl`]: t === "rtl",
607
+ [`${R}-block`]: f
608
+ }, s, a, M, T, N), J = d.useMemo(() => ({
609
+ onChange: z,
610
+ value: h,
611
+ disabled: c,
612
+ name: y,
613
+ optionType: w,
614
+ block: f
615
+ }), [z, h, c, y, w, f]);
616
+ return j(/* @__PURE__ */ d.createElement("div", Object.assign({}, Ae(e, {
617
+ aria: !0,
618
+ data: !0
619
+ }), {
620
+ className: V,
621
+ style: S,
622
+ onMouseEnter: x,
623
+ onMouseLeave: I,
624
+ onFocus: p,
625
+ onBlur: P,
626
+ id: m,
627
+ ref: n
628
+ }), /* @__PURE__ */ d.createElement(Ge, {
629
+ value: J
630
+ }, X)));
631
+ }), nt = /* @__PURE__ */ d.memo(tt);
632
+ var ot = function(e, n) {
633
+ var i = {};
634
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (i[t] = e[t]);
635
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
636
+ n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (i[t[o]] = e[t[o]]);
637
+ return i;
638
+ };
639
+ const it = (e, n) => {
640
+ const {
641
+ getPrefixCls: i
642
+ } = d.useContext(W), {
643
+ prefixCls: t
644
+ } = e, o = ot(e, ["prefixCls"]), s = i("radio", t);
645
+ return /* @__PURE__ */ d.createElement(Fe, {
646
+ value: "button"
647
+ }, /* @__PURE__ */ d.createElement(G, Object.assign({
648
+ prefixCls: s
649
+ }, o, {
650
+ type: "radio",
651
+ ref: n
652
+ })));
653
+ }, rt = /* @__PURE__ */ d.forwardRef(it), F = G;
654
+ F.Button = rt;
655
+ F.Group = nt;
656
+ F.__ANT_RADIO = !0;
657
+ const at = (e) => {
658
+ const {
659
+ componentCls: n,
660
+ sizePaddingEdgeHorizontal: i,
661
+ colorSplit: t,
662
+ lineWidth: o,
663
+ textPaddingInline: s,
664
+ orientationMargin: a,
665
+ verticalMarginInline: r
666
+ } = e;
667
+ return {
668
+ [n]: Object.assign(Object.assign({}, A(e)), {
669
+ borderBlockStart: `${E(o)} solid ${t}`,
670
+ // vertical
671
+ "&-vertical": {
672
+ position: "relative",
673
+ top: "-0.06em",
674
+ display: "inline-block",
675
+ height: "0.9em",
676
+ marginInline: r,
677
+ marginBlock: 0,
678
+ verticalAlign: "middle",
679
+ borderTop: 0,
680
+ borderInlineStart: `${E(o)} solid ${t}`
681
+ },
682
+ "&-horizontal": {
683
+ display: "flex",
684
+ clear: "both",
685
+ width: "100%",
686
+ minWidth: "100%",
687
+ // Fix https://github.com/ant-design/ant-design/issues/10914
688
+ margin: `${E(e.dividerHorizontalGutterMargin)} 0`
689
+ },
690
+ [`&-horizontal${n}-with-text`]: {
691
+ display: "flex",
692
+ alignItems: "center",
693
+ margin: `${E(e.dividerHorizontalWithTextGutterMargin)} 0`,
694
+ color: e.colorTextHeading,
695
+ fontWeight: 500,
696
+ fontSize: e.fontSizeLG,
697
+ whiteSpace: "nowrap",
698
+ textAlign: "center",
699
+ borderBlockStart: `0 ${t}`,
700
+ "&::before, &::after": {
701
+ position: "relative",
702
+ width: "50%",
703
+ borderBlockStart: `${E(o)} solid transparent`,
704
+ // Chrome not accept `inherit` in `border-top`
705
+ borderBlockStartColor: "inherit",
706
+ borderBlockEnd: 0,
707
+ transform: "translateY(50%)",
708
+ content: "''"
709
+ }
710
+ },
711
+ [`&-horizontal${n}-with-text-left`]: {
712
+ "&::before": {
713
+ width: `calc(${a} * 100%)`
714
+ },
715
+ "&::after": {
716
+ width: `calc(100% - ${a} * 100%)`
717
+ }
718
+ },
719
+ [`&-horizontal${n}-with-text-right`]: {
720
+ "&::before": {
721
+ width: `calc(100% - ${a} * 100%)`
722
+ },
723
+ "&::after": {
724
+ width: `calc(${a} * 100%)`
725
+ }
726
+ },
727
+ [`${n}-inner-text`]: {
728
+ display: "inline-block",
729
+ paddingBlock: 0,
730
+ paddingInline: s
731
+ },
732
+ "&-dashed": {
733
+ background: "none",
734
+ borderColor: t,
735
+ borderStyle: "dashed",
736
+ borderWidth: `${E(o)} 0 0`
737
+ },
738
+ [`&-horizontal${n}-with-text${n}-dashed`]: {
739
+ "&::before, &::after": {
740
+ borderStyle: "dashed none none"
741
+ }
742
+ },
743
+ [`&-vertical${n}-dashed`]: {
744
+ borderInlineStartWidth: o,
745
+ borderInlineEnd: 0,
746
+ borderBlockStart: 0,
747
+ borderBlockEnd: 0
748
+ },
749
+ "&-dotted": {
750
+ background: "none",
751
+ borderColor: t,
752
+ borderStyle: "dotted",
753
+ borderWidth: `${E(o)} 0 0`
754
+ },
755
+ [`&-horizontal${n}-with-text${n}-dotted`]: {
756
+ "&::before, &::after": {
757
+ borderStyle: "dotted none none"
758
+ }
759
+ },
760
+ [`&-vertical${n}-dotted`]: {
761
+ borderInlineStartWidth: o,
762
+ borderInlineEnd: 0,
763
+ borderBlockStart: 0,
764
+ borderBlockEnd: 0
765
+ },
766
+ [`&-plain${n}-with-text`]: {
767
+ color: e.colorText,
768
+ fontWeight: "normal",
769
+ fontSize: e.fontSize
770
+ },
771
+ [`&-horizontal${n}-with-text-left${n}-no-default-orientation-margin-left`]: {
772
+ "&::before": {
773
+ width: 0
774
+ },
775
+ "&::after": {
776
+ width: "100%"
777
+ },
778
+ [`${n}-inner-text`]: {
779
+ paddingInlineStart: i
780
+ }
781
+ },
782
+ [`&-horizontal${n}-with-text-right${n}-no-default-orientation-margin-right`]: {
783
+ "&::before": {
784
+ width: "100%"
785
+ },
786
+ "&::after": {
787
+ width: 0
788
+ },
789
+ [`${n}-inner-text`]: {
790
+ paddingInlineEnd: i
791
+ }
792
+ }
793
+ })
794
+ };
795
+ }, lt = (e) => ({
796
+ textPaddingInline: "1em",
797
+ orientationMargin: 0.05,
798
+ verticalMarginInline: e.marginXS
799
+ }), dt = ne("Divider", (e) => {
800
+ const n = oe(e, {
801
+ dividerHorizontalWithTextGutterMargin: e.margin,
802
+ dividerHorizontalGutterMargin: e.marginLG,
803
+ sizePaddingEdgeHorizontal: 0
804
+ });
805
+ return [at(n)];
806
+ }, lt, {
807
+ unitless: {
808
+ orientationMargin: !0
809
+ }
810
+ });
811
+ var st = function(e, n) {
812
+ var i = {};
813
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (i[t] = e[t]);
814
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
815
+ n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (i[t[o]] = e[t[o]]);
816
+ return i;
817
+ };
818
+ const ke = (e) => {
819
+ const {
820
+ getPrefixCls: n,
821
+ direction: i,
822
+ divider: t
823
+ } = d.useContext(W), {
824
+ prefixCls: o,
825
+ type: s = "horizontal",
826
+ orientation: a = "center",
827
+ orientationMargin: r,
828
+ className: l,
829
+ rootClassName: c,
830
+ children: g,
831
+ dashed: u,
832
+ variant: S = "solid",
833
+ plain: m,
834
+ style: w
835
+ } = e, y = st(e, ["prefixCls", "type", "orientation", "orientationMargin", "className", "rootClassName", "children", "dashed", "variant", "plain", "style"]), b = n("divider", o), [k, f, v] = dt(b), x = !!g, I = a === "left" && r != null, p = a === "right" && r != null, P = _(b, t == null ? void 0 : t.className, f, v, `${b}-${s}`, {
836
+ [`${b}-with-text`]: x,
837
+ [`${b}-with-text-${a}`]: x,
838
+ [`${b}-dashed`]: !!u,
839
+ [`${b}-${S}`]: S !== "solid",
840
+ [`${b}-plain`]: !!m,
841
+ [`${b}-rtl`]: i === "rtl",
842
+ [`${b}-no-default-orientation-margin-left`]: I,
843
+ [`${b}-no-default-orientation-margin-right`]: p
844
+ }, l, c), h = d.useMemo(() => typeof r == "number" ? r : /^\d+$/.test(r) ? Number(r) : r, [r]), $ = Object.assign(Object.assign({}, I && {
845
+ marginLeft: h
846
+ }), p && {
847
+ marginRight: h
848
+ });
849
+ if (process.env.NODE_ENV !== "production") {
850
+ const z = Se("Divider");
851
+ process.env.NODE_ENV !== "production" && z(!g || s !== "vertical", "usage", "`children` not working in `vertical` mode.");
852
+ }
853
+ return k(/* @__PURE__ */ d.createElement("div", Object.assign({
854
+ className: P,
855
+ style: Object.assign(Object.assign({}, t == null ? void 0 : t.style), w)
856
+ }, y, {
857
+ role: "separator"
858
+ }), g && s !== "vertical" && /* @__PURE__ */ d.createElement("span", {
859
+ className: `${b}-inner-text`,
860
+ style: $
861
+ }, g)));
862
+ };
863
+ process.env.NODE_ENV !== "production" && (ke.displayName = "Divider");
864
+ function se(e) {
865
+ return ["small", "middle", "large"].includes(e);
866
+ }
867
+ function ce(e) {
868
+ return e ? typeof e == "number" && !Number.isNaN(e) : !1;
869
+ }
870
+ const Ie = /* @__PURE__ */ Re.createContext({
871
+ latestIndex: 0
872
+ }), ct = Ie.Provider, ut = (e) => {
873
+ let {
874
+ className: n,
875
+ index: i,
876
+ children: t,
877
+ split: o,
878
+ style: s
879
+ } = e;
880
+ const {
881
+ latestIndex: a
882
+ } = d.useContext(Ie);
883
+ return t == null ? null : /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("div", {
884
+ className: n,
885
+ style: s
886
+ }, t), i < a && o && /* @__PURE__ */ d.createElement("span", {
887
+ className: `${n}-split`
888
+ }, o));
889
+ };
890
+ var ht = function(e, n) {
891
+ var i = {};
892
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (i[t] = e[t]);
893
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
894
+ n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (i[t[o]] = e[t[o]]);
895
+ return i;
896
+ };
897
+ const gt = /* @__PURE__ */ d.forwardRef((e, n) => {
898
+ var i, t, o;
899
+ const {
900
+ getPrefixCls: s,
901
+ space: a,
902
+ direction: r
903
+ } = d.useContext(W), {
904
+ size: l = (i = a == null ? void 0 : a.size) !== null && i !== void 0 ? i : "small",
905
+ align: c,
906
+ className: g,
907
+ rootClassName: u,
908
+ children: S,
909
+ direction: m = "horizontal",
910
+ prefixCls: w,
911
+ split: y,
912
+ style: b,
913
+ wrap: k = !1,
914
+ classNames: f,
915
+ styles: v
916
+ } = e, x = ht(e, ["size", "align", "className", "rootClassName", "children", "direction", "prefixCls", "split", "style", "wrap", "classNames", "styles"]), [I, p] = Array.isArray(l) ? l : [l, l], P = se(p), h = se(I), $ = ce(p), z = ce(I), C = Te(S, {
917
+ keepEmpty: !0
918
+ }), R = c === void 0 && m === "horizontal" ? "center" : c, N = s("space", w), [j, M, T] = He(N), X = _(N, a == null ? void 0 : a.className, M, `${N}-${m}`, {
919
+ [`${N}-rtl`]: r === "rtl",
920
+ [`${N}-align-${R}`]: R,
921
+ [`${N}-gap-row-${p}`]: P,
922
+ [`${N}-gap-col-${I}`]: h
923
+ }, g, u, T), q = _(`${N}-item`, (t = f == null ? void 0 : f.item) !== null && t !== void 0 ? t : (o = a == null ? void 0 : a.classNames) === null || o === void 0 ? void 0 : o.item);
924
+ let V = 0;
925
+ const J = C.map((B, Z) => {
926
+ var ee, te;
927
+ B != null && (V = Z);
928
+ const Oe = (B == null ? void 0 : B.key) || `${q}-${Z}`;
929
+ return /* @__PURE__ */ d.createElement(ut, {
930
+ className: q,
931
+ key: Oe,
932
+ index: Z,
933
+ split: y,
934
+ style: (ee = v == null ? void 0 : v.item) !== null && ee !== void 0 ? ee : (te = a == null ? void 0 : a.styles) === null || te === void 0 ? void 0 : te.item
935
+ }, B);
936
+ }), O = d.useMemo(() => ({
937
+ latestIndex: V
938
+ }), [V]);
939
+ if (C.length === 0)
940
+ return null;
941
+ const H = {};
942
+ return k && (H.flexWrap = "wrap"), !h && z && (H.columnGap = I), !P && $ && (H.rowGap = p), j(/* @__PURE__ */ d.createElement("div", Object.assign({
943
+ ref: n,
944
+ className: X,
945
+ style: Object.assign(Object.assign(Object.assign({}, H), a == null ? void 0 : a.style), b)
946
+ }, x), /* @__PURE__ */ d.createElement(ct, {
947
+ value: O
948
+ }, J)));
949
+ }), ie = gt;
950
+ ie.Compact = _e;
951
+ process.env.NODE_ENV !== "production" && (ie.displayName = "Space");
952
+ var bt = ["prefixCls", "className", "checked", "defaultChecked", "disabled", "loadingIcon", "checkedChildren", "unCheckedChildren", "onClick", "onChange", "onKeyDown"], Ee = /* @__PURE__ */ d.forwardRef(function(e, n) {
953
+ var i, t = e.prefixCls, o = t === void 0 ? "rc-switch" : t, s = e.className, a = e.checked, r = e.defaultChecked, l = e.disabled, c = e.loadingIcon, g = e.checkedChildren, u = e.unCheckedChildren, S = e.onClick, m = e.onChange, w = e.onKeyDown, y = fe(e, bt), b = Y(!1, {
954
+ value: a,
955
+ defaultValue: r
956
+ }), k = me(b, 2), f = k[0], v = k[1];
957
+ function x(h, $) {
958
+ var z = f;
959
+ return l || (z = h, v(z), m == null || m(z, $)), z;
960
+ }
961
+ function I(h) {
962
+ h.which === ae.LEFT ? x(!1, h) : h.which === ae.RIGHT && x(!0, h), w == null || w(h);
963
+ }
964
+ function p(h) {
965
+ var $ = x(!f, h);
966
+ S == null || S($, h);
967
+ }
968
+ var P = _(o, s, (i = {}, U(i, "".concat(o, "-checked"), f), U(i, "".concat(o, "-disabled"), l), i));
969
+ return /* @__PURE__ */ d.createElement("button", ve({}, y, {
970
+ type: "button",
971
+ role: "switch",
972
+ "aria-checked": f,
973
+ disabled: l,
974
+ className: P,
975
+ ref: n,
976
+ onKeyDown: I,
977
+ onClick: p
978
+ }), c, /* @__PURE__ */ d.createElement("span", {
979
+ className: "".concat(o, "-inner")
980
+ }, /* @__PURE__ */ d.createElement("span", {
981
+ className: "".concat(o, "-inner-checked")
982
+ }, g), /* @__PURE__ */ d.createElement("span", {
983
+ className: "".concat(o, "-inner-unchecked")
984
+ }, u)));
985
+ });
986
+ Ee.displayName = "Switch";
987
+ const pt = (e) => {
988
+ const {
989
+ componentCls: n,
990
+ trackHeightSM: i,
991
+ trackPadding: t,
992
+ trackMinWidthSM: o,
993
+ innerMinMarginSM: s,
994
+ innerMaxMarginSM: a,
995
+ handleSizeSM: r,
996
+ calc: l
997
+ } = e, c = `${n}-inner`, g = E(l(r).add(l(t).mul(2)).equal()), u = E(l(a).mul(2).equal());
998
+ return {
999
+ [n]: {
1000
+ [`&${n}-small`]: {
1001
+ minWidth: o,
1002
+ height: i,
1003
+ lineHeight: E(i),
1004
+ [`${n}-inner`]: {
1005
+ paddingInlineStart: a,
1006
+ paddingInlineEnd: s,
1007
+ [`${c}-checked, ${c}-unchecked`]: {
1008
+ minHeight: i
1009
+ },
1010
+ [`${c}-checked`]: {
1011
+ marginInlineStart: `calc(-100% + ${g} - ${u})`,
1012
+ marginInlineEnd: `calc(100% - ${g} + ${u})`
1013
+ },
1014
+ [`${c}-unchecked`]: {
1015
+ marginTop: l(i).mul(-1).equal(),
1016
+ marginInlineStart: 0,
1017
+ marginInlineEnd: 0
1018
+ }
1019
+ },
1020
+ [`${n}-handle`]: {
1021
+ width: r,
1022
+ height: r
1023
+ },
1024
+ [`${n}-loading-icon`]: {
1025
+ top: l(l(r).sub(e.switchLoadingIconSize)).div(2).equal(),
1026
+ fontSize: e.switchLoadingIconSize
1027
+ },
1028
+ [`&${n}-checked`]: {
1029
+ [`${n}-inner`]: {
1030
+ paddingInlineStart: s,
1031
+ paddingInlineEnd: a,
1032
+ [`${c}-checked`]: {
1033
+ marginInlineStart: 0,
1034
+ marginInlineEnd: 0
1035
+ },
1036
+ [`${c}-unchecked`]: {
1037
+ marginInlineStart: `calc(100% - ${g} + ${u})`,
1038
+ marginInlineEnd: `calc(-100% + ${g} - ${u})`
1039
+ }
1040
+ },
1041
+ [`${n}-handle`]: {
1042
+ insetInlineStart: `calc(100% - ${E(l(r).add(t).equal())})`
1043
+ }
1044
+ },
1045
+ [`&:not(${n}-disabled):active`]: {
1046
+ [`&:not(${n}-checked) ${c}`]: {
1047
+ [`${c}-unchecked`]: {
1048
+ marginInlineStart: l(e.marginXXS).div(2).equal(),
1049
+ marginInlineEnd: l(e.marginXXS).mul(-1).div(2).equal()
1050
+ }
1051
+ },
1052
+ [`&${n}-checked ${c}`]: {
1053
+ [`${c}-checked`]: {
1054
+ marginInlineStart: l(e.marginXXS).mul(-1).div(2).equal(),
1055
+ marginInlineEnd: l(e.marginXXS).div(2).equal()
1056
+ }
1057
+ }
1058
+ }
1059
+ }
1060
+ }
1061
+ };
1062
+ }, ft = (e) => {
1063
+ const {
1064
+ componentCls: n,
1065
+ handleSize: i,
1066
+ calc: t
1067
+ } = e;
1068
+ return {
1069
+ [n]: {
1070
+ [`${n}-loading-icon${e.iconCls}`]: {
1071
+ position: "relative",
1072
+ top: t(t(i).sub(e.fontSize)).div(2).equal(),
1073
+ color: e.switchLoadingIconColor,
1074
+ verticalAlign: "top"
1075
+ },
1076
+ [`&${n}-checked ${n}-loading-icon`]: {
1077
+ color: e.switchColor
1078
+ }
1079
+ }
1080
+ };
1081
+ }, mt = (e) => {
1082
+ const {
1083
+ componentCls: n,
1084
+ trackPadding: i,
1085
+ handleBg: t,
1086
+ handleShadow: o,
1087
+ handleSize: s,
1088
+ calc: a
1089
+ } = e, r = `${n}-handle`;
1090
+ return {
1091
+ [n]: {
1092
+ [r]: {
1093
+ position: "absolute",
1094
+ top: i,
1095
+ insetInlineStart: i,
1096
+ width: s,
1097
+ height: s,
1098
+ transition: `all ${e.switchDuration} ease-in-out`,
1099
+ "&::before": {
1100
+ position: "absolute",
1101
+ top: 0,
1102
+ insetInlineEnd: 0,
1103
+ bottom: 0,
1104
+ insetInlineStart: 0,
1105
+ backgroundColor: t,
1106
+ borderRadius: a(s).div(2).equal(),
1107
+ boxShadow: o,
1108
+ transition: `all ${e.switchDuration} ease-in-out`,
1109
+ content: '""'
1110
+ }
1111
+ },
1112
+ [`&${n}-checked ${r}`]: {
1113
+ insetInlineStart: `calc(100% - ${E(a(s).add(i).equal())})`
1114
+ },
1115
+ [`&:not(${n}-disabled):active`]: {
1116
+ [`${r}::before`]: {
1117
+ insetInlineEnd: e.switchHandleActiveInset,
1118
+ insetInlineStart: 0
1119
+ },
1120
+ [`&${n}-checked ${r}::before`]: {
1121
+ insetInlineEnd: 0,
1122
+ insetInlineStart: e.switchHandleActiveInset
1123
+ }
1124
+ }
1125
+ }
1126
+ };
1127
+ }, vt = (e) => {
1128
+ const {
1129
+ componentCls: n,
1130
+ trackHeight: i,
1131
+ trackPadding: t,
1132
+ innerMinMargin: o,
1133
+ innerMaxMargin: s,
1134
+ handleSize: a,
1135
+ calc: r
1136
+ } = e, l = `${n}-inner`, c = E(r(a).add(r(t).mul(2)).equal()), g = E(r(s).mul(2).equal());
1137
+ return {
1138
+ [n]: {
1139
+ [l]: {
1140
+ display: "block",
1141
+ overflow: "hidden",
1142
+ borderRadius: 100,
1143
+ height: "100%",
1144
+ paddingInlineStart: s,
1145
+ paddingInlineEnd: o,
1146
+ transition: `padding-inline-start ${e.switchDuration} ease-in-out, padding-inline-end ${e.switchDuration} ease-in-out`,
1147
+ [`${l}-checked, ${l}-unchecked`]: {
1148
+ display: "block",
1149
+ color: e.colorTextLightSolid,
1150
+ fontSize: e.fontSizeSM,
1151
+ transition: `margin-inline-start ${e.switchDuration} ease-in-out, margin-inline-end ${e.switchDuration} ease-in-out`,
1152
+ pointerEvents: "none",
1153
+ minHeight: i
1154
+ },
1155
+ [`${l}-checked`]: {
1156
+ marginInlineStart: `calc(-100% + ${c} - ${g})`,
1157
+ marginInlineEnd: `calc(100% - ${c} + ${g})`
1158
+ },
1159
+ [`${l}-unchecked`]: {
1160
+ marginTop: r(i).mul(-1).equal(),
1161
+ marginInlineStart: 0,
1162
+ marginInlineEnd: 0
1163
+ }
1164
+ },
1165
+ [`&${n}-checked ${l}`]: {
1166
+ paddingInlineStart: o,
1167
+ paddingInlineEnd: s,
1168
+ [`${l}-checked`]: {
1169
+ marginInlineStart: 0,
1170
+ marginInlineEnd: 0
1171
+ },
1172
+ [`${l}-unchecked`]: {
1173
+ marginInlineStart: `calc(100% - ${c} + ${g})`,
1174
+ marginInlineEnd: `calc(-100% + ${c} - ${g})`
1175
+ }
1176
+ },
1177
+ [`&:not(${n}-disabled):active`]: {
1178
+ [`&:not(${n}-checked) ${l}`]: {
1179
+ [`${l}-unchecked`]: {
1180
+ marginInlineStart: r(t).mul(2).equal(),
1181
+ marginInlineEnd: r(t).mul(-1).mul(2).equal()
1182
+ }
1183
+ },
1184
+ [`&${n}-checked ${l}`]: {
1185
+ [`${l}-checked`]: {
1186
+ marginInlineStart: r(t).mul(-1).mul(2).equal(),
1187
+ marginInlineEnd: r(t).mul(2).equal()
1188
+ }
1189
+ }
1190
+ }
1191
+ }
1192
+ };
1193
+ }, Ct = (e) => {
1194
+ const {
1195
+ componentCls: n,
1196
+ trackHeight: i,
1197
+ trackMinWidth: t
1198
+ } = e;
1199
+ return {
1200
+ [n]: Object.assign(Object.assign(Object.assign(Object.assign({}, A(e)), {
1201
+ position: "relative",
1202
+ display: "inline-block",
1203
+ boxSizing: "border-box",
1204
+ minWidth: t,
1205
+ height: i,
1206
+ lineHeight: E(i),
1207
+ verticalAlign: "middle",
1208
+ background: e.colorTextQuaternary,
1209
+ border: "0",
1210
+ borderRadius: 100,
1211
+ cursor: "pointer",
1212
+ transition: `all ${e.motionDurationMid}`,
1213
+ userSelect: "none",
1214
+ [`&:hover:not(${n}-disabled)`]: {
1215
+ background: e.colorTextTertiary
1216
+ }
1217
+ }), Ve(e)), {
1218
+ [`&${n}-checked`]: {
1219
+ background: e.switchColor,
1220
+ [`&:hover:not(${n}-disabled)`]: {
1221
+ background: e.colorPrimaryHover
1222
+ }
1223
+ },
1224
+ [`&${n}-loading, &${n}-disabled`]: {
1225
+ cursor: "not-allowed",
1226
+ opacity: e.switchDisabledOpacity,
1227
+ "*": {
1228
+ boxShadow: "none",
1229
+ cursor: "not-allowed"
1230
+ }
1231
+ },
1232
+ // rtl style
1233
+ [`&${n}-rtl`]: {
1234
+ direction: "rtl"
1235
+ }
1236
+ })
1237
+ };
1238
+ }, St = (e) => {
1239
+ const {
1240
+ fontSize: n,
1241
+ lineHeight: i,
1242
+ controlHeight: t,
1243
+ colorWhite: o
1244
+ } = e, s = n * i, a = t / 2, r = 2, l = s - r * 2, c = a - r * 2;
1245
+ return {
1246
+ trackHeight: s,
1247
+ trackHeightSM: a,
1248
+ trackMinWidth: l * 2 + r * 4,
1249
+ trackMinWidthSM: c * 2 + r * 2,
1250
+ trackPadding: r,
1251
+ // Fixed value
1252
+ handleBg: o,
1253
+ handleSize: l,
1254
+ handleSizeSM: c,
1255
+ handleShadow: `0 2px 4px 0 ${new Le("#00230b").setAlpha(0.2).toRgbString()}`,
1256
+ innerMinMargin: l / 2,
1257
+ innerMaxMargin: l + r + r * 2,
1258
+ innerMinMarginSM: c / 2,
1259
+ innerMaxMarginSM: c + r + r * 2
1260
+ };
1261
+ }, $t = ne("Switch", (e) => {
1262
+ const n = oe(e, {
1263
+ switchDuration: e.motionDurationMid,
1264
+ switchColor: e.colorPrimary,
1265
+ switchDisabledOpacity: e.opacityLoading,
1266
+ switchLoadingIconSize: e.calc(e.fontSizeIcon).mul(0.75).equal(),
1267
+ switchLoadingIconColor: `rgba(0, 0, 0, ${e.opacityLoading})`,
1268
+ switchHandleActiveInset: "-30%"
1269
+ });
1270
+ return [
1271
+ Ct(n),
1272
+ // inner style
1273
+ vt(n),
1274
+ // handle style
1275
+ mt(n),
1276
+ // loading style
1277
+ ft(n),
1278
+ // small style
1279
+ pt(n)
1280
+ ];
1281
+ }, St);
1282
+ var yt = function(e, n) {
1283
+ var i = {};
1284
+ for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (i[t] = e[t]);
1285
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, t = Object.getOwnPropertySymbols(e); o < t.length; o++)
1286
+ n.indexOf(t[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[o]) && (i[t[o]] = e[t[o]]);
1287
+ return i;
1288
+ };
1289
+ const xt = /* @__PURE__ */ d.forwardRef((e, n) => {
1290
+ const {
1291
+ prefixCls: i,
1292
+ size: t,
1293
+ disabled: o,
1294
+ loading: s,
1295
+ className: a,
1296
+ rootClassName: r,
1297
+ style: l,
1298
+ checked: c,
1299
+ value: g,
1300
+ defaultChecked: u,
1301
+ defaultValue: S,
1302
+ onChange: m
1303
+ } = e, w = yt(e, ["prefixCls", "size", "disabled", "loading", "className", "rootClassName", "style", "checked", "value", "defaultChecked", "defaultValue", "onChange"]), [y, b] = Y(!1, {
1304
+ value: c ?? g,
1305
+ defaultValue: u ?? S
1306
+ }), {
1307
+ getPrefixCls: k,
1308
+ direction: f,
1309
+ switch: v
1310
+ } = d.useContext(W), x = d.useContext($e), I = (o ?? x) || s, p = k("switch", i), P = /* @__PURE__ */ d.createElement("div", {
1311
+ className: `${p}-handle`
1312
+ }, s && /* @__PURE__ */ d.createElement(We, {
1313
+ className: `${p}-loading-icon`
1314
+ })), [h, $, z] = $t(p), C = pe(t), R = _(v == null ? void 0 : v.className, {
1315
+ [`${p}-small`]: C === "small",
1316
+ [`${p}-loading`]: s,
1317
+ [`${p}-rtl`]: f === "rtl"
1318
+ }, a, r, $, z), N = Object.assign(Object.assign({}, v == null ? void 0 : v.style), l), j = function() {
1319
+ b(arguments.length <= 0 ? void 0 : arguments[0]), m == null || m.apply(void 0, arguments);
1320
+ };
1321
+ return h(/* @__PURE__ */ d.createElement(be, {
1322
+ component: "Switch"
1323
+ }, /* @__PURE__ */ d.createElement(Ee, Object.assign({}, w, {
1324
+ checked: y,
1325
+ onChange: j,
1326
+ prefixCls: p,
1327
+ className: R,
1328
+ style: N,
1329
+ disabled: I,
1330
+ ref: n,
1331
+ loadingIcon: P
1332
+ }))));
1333
+ }), Q = xt;
1334
+ Q.__ANT_SWITCH = !0;
1335
+ process.env.NODE_ENV !== "production" && (Q.displayName = "Switch");
1336
+ const K = Me.Text, wt = (e, n) => {
1337
+ const i = ["EMAIL", "INAPP_WEB", "SMS", "CALL", "PUSH", "WEB_PUSH"];
1338
+ return i.indexOf(e) - i.indexOf(n);
1339
+ }, ue = (e, n) => {
1340
+ const i = ["off", "instant", "hourly", "daily", "weekly", "monthly"];
1341
+ return i.indexOf(e) - i.indexOf(n);
1342
+ }, he = (e) => ({
1343
+ off: "Off",
1344
+ instant: "Instant",
1345
+ hourly: "Hourly",
1346
+ daily: "Daily",
1347
+ weekly: "Weekly",
1348
+ monthly: "Monthly"
1349
+ })[e], Rt = ({
1350
+ notification: e,
1351
+ preferences: n,
1352
+ updateDelivery: i,
1353
+ subNotificationId: t
1354
+ }) => /* @__PURE__ */ D(re, { children: e.channels.sort(wt).map((o, s) => {
1355
+ const a = n.find(
1356
+ (u) => u.notificationId === e.notificationId && u.channel === o
1357
+ );
1358
+ if (!a)
1359
+ return null;
1360
+ const r = ze(o), l = Pe(o), c = Object.keys(
1361
+ e.options[o]
1362
+ ).filter(
1363
+ (u) => u !== "defaultDeliveryOption" && u !== "defaultDeliverOption"
1364
+ );
1365
+ let g;
1366
+ return c.length === 1 ? g = /* @__PURE__ */ D(K, { children: he(a.delivery) }) : c.length === 2 && c.includes("off") ? g = /* @__PURE__ */ D(
1367
+ Q,
1368
+ {
1369
+ checked: a.delivery !== "off",
1370
+ onChange: (u) => {
1371
+ if (u) {
1372
+ const S = c.find((m) => m !== "off");
1373
+ i(
1374
+ e.notificationId,
1375
+ o,
1376
+ S,
1377
+ t
1378
+ );
1379
+ } else
1380
+ i(
1381
+ e.notificationId,
1382
+ o,
1383
+ "off",
1384
+ t
1385
+ );
1386
+ }
1387
+ }
1388
+ ) : g = /* @__PURE__ */ L(re, { children: [
1389
+ /* @__PURE__ */ D(
1390
+ Q,
1391
+ {
1392
+ checked: a.delivery !== "off",
1393
+ onChange: (u) => {
1394
+ if (u) {
1395
+ const S = c.sort(ue).find((m) => m !== "off");
1396
+ i(
1397
+ e.notificationId,
1398
+ o,
1399
+ S,
1400
+ t
1401
+ );
1402
+ } else
1403
+ i(
1404
+ e.notificationId,
1405
+ o,
1406
+ "off",
1407
+ t
1408
+ );
1409
+ }
1410
+ }
1411
+ ),
1412
+ /* @__PURE__ */ D(
1413
+ "div",
1414
+ {
1415
+ style: {
1416
+ width: "100%",
1417
+ marginTop: 8,
1418
+ maxHeight: a.delivery !== "off" ? 1e3 : 0,
1419
+ overflow: "hidden",
1420
+ transition: "max-height 0.3s ease"
1421
+ },
1422
+ children: /* @__PURE__ */ L("div", { children: [
1423
+ /* @__PURE__ */ D("div", { style: { marginTop: 20 }, children: /* @__PURE__ */ D(K, { strong: !0, children: "Choose frequency:" }) }),
1424
+ /* @__PURE__ */ D(
1425
+ F.Group,
1426
+ {
1427
+ value: a.delivery,
1428
+ onChange: (u) => {
1429
+ i(
1430
+ e.notificationId,
1431
+ o,
1432
+ u.target.value,
1433
+ t
1434
+ );
1435
+ },
1436
+ children: /* @__PURE__ */ D(ie, { direction: "vertical", style: { paddingTop: 10 }, children: c.filter((u) => u !== "off").sort(ue).map((u) => /* @__PURE__ */ D(F, { value: u, children: /* @__PURE__ */ D(K, { children: he(u) }) }, u)) })
1437
+ }
1438
+ )
1439
+ ] })
1440
+ }
1441
+ )
1442
+ ] }), /* @__PURE__ */ L("div", { children: [
1443
+ /* @__PURE__ */ L(
1444
+ "div",
1445
+ {
1446
+ style: {
1447
+ display: "flex",
1448
+ justifyContent: "space-between",
1449
+ flexWrap: "wrap",
1450
+ marginTop: s === 0 ? 12 : 0,
1451
+ marginBottom: s === e.channels.length - 1 ? 12 : 0
1452
+ },
1453
+ children: [
1454
+ /* @__PURE__ */ L(K, { children: [
1455
+ l,
1456
+ " ",
1457
+ r
1458
+ ] }),
1459
+ g
1460
+ ]
1461
+ },
1462
+ o
1463
+ ),
1464
+ s !== e.channels.length - 1 && /* @__PURE__ */ D(ke, {})
1465
+ ] }, o);
1466
+ }) });
1467
+ export {
1468
+ ke as D,
1469
+ Rt as P
1470
+ };