fansunited-frontend-components 0.0.92 → 0.0.94
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.
- package/Betslip.js +1 -1
- package/ChanceGame.js +139 -146
- package/ClassicQuizPlay.js +1 -1
- package/CollectLead.js +14 -20
- package/CompetitionStatistics.js +27 -27
- package/CompetitorCard.js +895 -891
- package/Discussion.js +1 -1
- package/EitherOrPlay.js +1 -1
- package/EventCard.js +1494 -1571
- package/EventGamePlay.js +1 -1
- package/Leaderboard.js +249 -257
- package/List.js +319 -436
- package/MatchQuizPlay.js +1 -1
- package/Odds.js +30 -30
- package/PersonalityQuizPlay.js +1 -1
- package/PickThePair.js +627 -693
- package/PlayerOfTheMatch.js +256 -279
- package/PollVote.js +1 -1
- package/Predictor.js +19443 -2
- package/README.md +2 -1
- package/Standings.js +94 -99
- package/TopX.js +5871 -6988
- package/chunks/ChanceGameEmbedVariant-C3NGwvTF.js +21 -0
- package/chunks/OddsSkeleton-Bav8FHHN.js +26 -0
- package/chunks/{OddsStrip-B159Nivm.js → OddsStrip-CviVfQI4.js} +51 -53
- package/chunks/{PickOneOfX-D9qlxKTD.js → PickOneOfX-a6Dv0-rR.js} +210 -212
- package/chunks/index-B1d9q8fX.js +4 -0
- package/chunks/index-BP0pvFJ4.js +4 -0
- package/chunks/index-CHZyL_g_.js +4 -0
- package/chunks/index-CeCUdRmF.js +4 -0
- package/chunks/index-Ckyyw-I8.js +4 -0
- package/chunks/index-DGvCP5G8.js +4 -0
- package/chunks/index-yjMVOgwO.js +4 -0
- package/chunks/{main-CcPVuc5G.js → main-CFwRpvUi.js} +219 -238
- package/chunks/{main-By2Fg4Us.js → main-D9tFZv2q.js} +272 -309
- package/chunks/{main-Db4YC1C9.js → main-Dj4Manb5.js} +386 -407
- package/chunks/{main-BhONg691.js → main-DjiQz1dv.js} +764 -1125
- package/chunks/{main-BoLNJccN.js → main-Dys2_Jt2.js} +1625 -1954
- package/chunks/{main-JAewg2VD.js → main-dwV_55lz.js} +409 -432
- package/chunks/main-eAQMCxQ7.js +1949 -0
- package/chunks/{main-CWfREbUv.js → main-gexg6lc-.js} +959 -977
- package/index.js +40 -44
- package/package.json +13 -5
- package/chunks/AccessTime-B7Q_InTi.js +0 -10
- package/chunks/AlertMessage-CTbc9daZ.js +0 -318
- package/chunks/Avatar-Ve0m4ut_.js +0 -353
- package/chunks/Button-x1sQVMH2.js +0 -665
- package/chunks/Card-DfxnA3Cz.js +0 -196
- package/chunks/CardActions-TMBAbk8a.js +0 -140
- package/chunks/CardContent-CLQHztIU.js +0 -106
- package/chunks/ChanceGameEmbedVariant-C3TKbPI4.js +0 -913
- package/chunks/CheckCircle-DW1VzjQO.js +0 -8
- package/chunks/Chip-BUoNpinI.js +0 -365
- package/chunks/CircularProgress-D88LgW2V.js +0 -317
- package/chunks/Close-BxLZcPtb.js +0 -9
- package/chunks/Close-DVx6f5-e.js +0 -8
- package/chunks/CollectLeadForm-DtUFKk99.js +0 -3419
- package/chunks/ConsentsList-BcIMKviP.js +0 -339
- package/chunks/DirectionScope-CK0duYt8.js +0 -36
- package/chunks/Divider-D_ALv2uC.js +0 -166
- package/chunks/Edit-CiKqhDom.js +0 -99
- package/chunks/EmojiEvents-BYoxruEl.js +0 -8
- package/chunks/FavoriteBorder-YhT6RHv5.js +0 -11
- package/chunks/FormControl-BNG04EhC.js +0 -656
- package/chunks/FormControlContext-Ct0huDDM.js +0 -6
- package/chunks/FormLabel-Bl7hTa8O.js +0 -130
- package/chunks/GlobalStyles-PokSS9bO.js +0 -12
- package/chunks/InlineSpinner-BhKW6lxZ.js +0 -28
- package/chunks/Input-B7kPqO0b.js +0 -391
- package/chunks/KeyboardArrowDown-OGGGLEnE.js +0 -8
- package/chunks/KeyboardArrowRight-DN7qrp17.js +0 -11
- package/chunks/KeyboardArrowUp-jvN5m_A0.js +0 -8
- package/chunks/Link-brb09X-6.js +0 -319
- package/chunks/ListItemButton-BFG5QJbo.js +0 -1151
- package/chunks/ModalClose-D3i-AyMB.js +0 -153
- package/chunks/ModalDialog-Be6w76fh.js +0 -880
- package/chunks/NotFoundSkeleton-BHRVG8yg.js +0 -83
- package/chunks/Notification-CC66HKXb.js +0 -614
- package/chunks/OddsSkeleton-BBOVhfsn.js +0 -137
- package/chunks/OverlayScoreStateSkeleton-D5rnBJ_w.js +0 -154
- package/chunks/OverlayScoreStateWrapperSkeleton-CTXzD0bm.js +0 -81
- package/chunks/OverlaySignInSkeleton-T8A_9Tco.js +0 -518
- package/chunks/OverlaySkeleton-y02LRXZy.js +0 -1193
- package/chunks/Person-BD-IO4aX.js +0 -8
- package/chunks/PersonOutline-Nxl_9g9S.js +0 -8
- package/chunks/Popper-CGfJHTbM.js +0 -1263
- package/chunks/Portal-DQQSLiON.js +0 -74
- package/chunks/Portal-X8O64KaQ.js +0 -66
- package/chunks/Predictor-BJBBwZ6R.js +0 -19513
- package/chunks/PrizeCard-B2tBhY45.js +0 -36400
- package/chunks/Search-jaDXe8g7.js +0 -14
- package/chunks/Select-CzBMHr7z.js +0 -1165
- package/chunks/Sheet-x-YGYOYz.js +0 -132
- package/chunks/SignInCta-3NFxIOuf.js +0 -79
- package/chunks/Spinner-_5U881sC.js +0 -39
- package/chunks/SportsSoccer-DLUgspA-.js +0 -20
- package/chunks/Stack-CDpKA1D-.js +0 -169
- package/chunks/StandardContentSkeleton-DaZftDxZ.js +0 -57
- package/chunks/Table-IJ9-D2DF.js +0 -394
- package/chunks/Tabs-iyOvjGfd.js +0 -1084
- package/chunks/Textarea-Dv_Z4l5j.js +0 -475
- package/chunks/TimerOutlined-jNsK__Zz.js +0 -8
- package/chunks/Tooltip-clSjN1oC.js +0 -535
- package/chunks/Typography-BsucZNXl.js +0 -775
- package/chunks/areArraysEqual-B3mXtHvh.js +0 -6
- package/chunks/colorInversionUtils-AoR_6ghW.js +0 -347
- package/chunks/createSvgIcon-BWoHeNkc.js +0 -2813
- package/chunks/createSvgIcon-DBkOhFdn.js +0 -206
- package/chunks/dividerClasses-BkQMLbsL.js +0 -9
- package/chunks/elementAcceptingRef-DjUfkpLB.js +0 -25
- package/chunks/enums-B1lTCQvC.js +0 -15
- package/chunks/formLabelClasses-N0g8NZ67.js +0 -9
- package/chunks/getReactElementRef-B3MFPBbS.js +0 -21
- package/chunks/helpers-CKFwVhwj.js +0 -558
- package/chunks/index-Bg5jypgn.js +0 -11
- package/chunks/index-Bnad45hB.js +0 -4
- package/chunks/index-C6rtfeRX.js +0 -4
- package/chunks/index-CFc0WTOi.js +0 -848
- package/chunks/index-C_kf8WZI.js +0 -4
- package/chunks/index-CaVpDbdC.js +0 -4
- package/chunks/index-DJJVbXn_.js +0 -4
- package/chunks/index-DQO7VDRC.js +0 -4
- package/chunks/index-Kgehqf8J.js +0 -4
- package/chunks/main-W_W6YBtr.js +0 -3280
- package/chunks/ownerWindow-PI509BpA.js +0 -7
- package/chunks/searchEntities-SJcoznz0.js +0 -38
- package/chunks/sportsEvents-CGX-WkNB.js +0 -27
- package/chunks/useButton-C9taTgFS.js +0 -106
- package/chunks/useConsents-BLhgfEDf.js +0 -1168
- package/chunks/useControlled-BYdyS7Pn.js +0 -31
- package/chunks/useEmbedCode-DCWnWGak.js +0 -31
- package/chunks/useEventCallback-C9W0M_8l.js +0 -14
- package/chunks/useForwardedInput-CkAnayh_.js +0 -180
- package/chunks/useImageVariant-B62O7iLC.js +0 -15
- package/chunks/useInfoPage-BHdgKdme.js +0 -50
- package/chunks/useParticipationDraft-Brnd_p3w.js +0 -307
- package/chunks/useSwitch-DLSSqtcZ.js +0 -66
- package/chunks/variantColorInheritance-DZr7CNx6.js +0 -30
- package/chunks/visuallyHidden-B8J7BVSJ.js +0 -14
|
@@ -1,3419 +0,0 @@
|
|
|
1
|
-
import { jsx as a, jsxs as q, Fragment as We } from "react/jsx-runtime";
|
|
2
|
-
import { S as it, _ as p, H as Ce, I as Qe, P as e, J as xe, G as Ze, F as eo, b as at, v as ct, x as ut, a as dt, B as Io, g as pt, f as Pt, u as mt } from "./PrizeCard-B2tBhY45.js";
|
|
3
|
-
import * as C from "react";
|
|
4
|
-
import { useState as Xe, useEffect as kt, createElement as Ko } from "react";
|
|
5
|
-
import { k as Go, m as Yo, n as Dt, o as At, p as wt } from "./helpers-CKFwVhwj.js";
|
|
6
|
-
import { i as $t, a as Xo, C as Rt, b as Qo, s as Et, g as Bt } from "./ConsentsList-BcIMKviP.js";
|
|
7
|
-
import { F as _e, C as _t } from "./FormControl-BNG04EhC.js";
|
|
8
|
-
import { f as Ft, s as K, a as qe, b as ne, d as zt, c as Je, u as ft, T as ao } from "./Typography-BsucZNXl.js";
|
|
9
|
-
import { L as vo } from "./Link-brb09X-6.js";
|
|
10
|
-
import { A as Zo } from "./AlertMessage-CTbc9daZ.js";
|
|
11
|
-
import { S as gt } from "./Stack-CDpKA1D-.js";
|
|
12
|
-
import { F as je } from "./FormLabel-Bl7hTa8O.js";
|
|
13
|
-
import { S as Mt, a as Ht, b as Vt, c as jt, I as so } from "./Input-B7kPqO0b.js";
|
|
14
|
-
import { S as Ut, a as Wt } from "./Select-CzBMHr7z.js";
|
|
15
|
-
import { C as qt } from "./Close-BxLZcPtb.js";
|
|
16
|
-
import { c as ht } from "./createSvgIcon-DBkOhFdn.js";
|
|
17
|
-
import { u as yt, V as bt, g as io } from "./variantColorInheritance-DZr7CNx6.js";
|
|
18
|
-
import { S as jo, B as Eo } from "./Button-x1sQVMH2.js";
|
|
19
|
-
import { l as _o, G as Jt, C as Kt, R as Gt, W as Yt, N as et, g as Xt, S as Qt, s as Zt, a as en, b as on, L as tn, c as nn, d as rn } from "./ListItemButton-BFG5QJbo.js";
|
|
20
|
-
import { F as ln } from "./FormControlContext-Ct0huDDM.js";
|
|
21
|
-
import { u as Bo } from "./useControlled-BYdyS7Pn.js";
|
|
22
|
-
import { u as Co } from "./useEventCallback-C9W0M_8l.js";
|
|
23
|
-
import { a as sn, C as an } from "./Chip-BUoNpinI.js";
|
|
24
|
-
import { u as cn } from "./useButton-C9taTgFS.js";
|
|
25
|
-
import { P as un } from "./Popper-CGfJHTbM.js";
|
|
26
|
-
import { c as ot } from "./getReactElementRef-B3MFPBbS.js";
|
|
27
|
-
import { I as dn } from "./colorInversionUtils-AoR_6ghW.js";
|
|
28
|
-
import { T as pn } from "./Textarea-Dv_Z4l5j.js";
|
|
29
|
-
const mn = (o) => {
|
|
30
|
-
const t = C.useRef({});
|
|
31
|
-
return C.useEffect(() => {
|
|
32
|
-
t.current = o;
|
|
33
|
-
}), t.current;
|
|
34
|
-
};
|
|
35
|
-
function fn(o) {
|
|
36
|
-
const t = typeof o;
|
|
37
|
-
switch (t) {
|
|
38
|
-
case "number":
|
|
39
|
-
return Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? o !== Math.floor(o) ? "float" : "number" : "Infinity";
|
|
40
|
-
case "object":
|
|
41
|
-
return o === null ? "null" : o.constructor.name;
|
|
42
|
-
default:
|
|
43
|
-
return t;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function gn(o) {
|
|
47
|
-
return typeof o == "number" && isFinite(o) && Math.floor(o) === o;
|
|
48
|
-
}
|
|
49
|
-
const hn = Number.isInteger || gn;
|
|
50
|
-
function vt(o, t, l, s) {
|
|
51
|
-
const f = o[t];
|
|
52
|
-
if (f == null || !hn(f)) {
|
|
53
|
-
const u = fn(f);
|
|
54
|
-
return new RangeError(`Invalid ${s} \`${t}\` of type \`${u}\` supplied to \`${l}\`, expected \`integer\`.`);
|
|
55
|
-
}
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
function Ct(o, t, ...l) {
|
|
59
|
-
return o[t] === void 0 ? null : vt(o, t, ...l);
|
|
60
|
-
}
|
|
61
|
-
function Fo() {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
Ct.isRequired = vt;
|
|
65
|
-
Fo.isRequired = Fo;
|
|
66
|
-
const yn = process.env.NODE_ENV === "production" ? Fo : Ct;
|
|
67
|
-
function tt(o) {
|
|
68
|
-
return typeof o.normalize < "u" ? o.normalize("NFD").replace(/[\u0300-\u036f]/g, "") : o;
|
|
69
|
-
}
|
|
70
|
-
function bn(o = {}) {
|
|
71
|
-
const {
|
|
72
|
-
ignoreAccents: t = !0,
|
|
73
|
-
ignoreCase: l = !0,
|
|
74
|
-
limit: s,
|
|
75
|
-
matchFrom: f = "any",
|
|
76
|
-
stringify: u,
|
|
77
|
-
trim: O = !1
|
|
78
|
-
} = o;
|
|
79
|
-
return (P, {
|
|
80
|
-
inputValue: A,
|
|
81
|
-
getOptionLabel: y
|
|
82
|
-
}) => {
|
|
83
|
-
let I = O ? A.trim() : A;
|
|
84
|
-
l && (I = I.toLowerCase()), t && (I = tt(I));
|
|
85
|
-
const d = I ? P.filter((w) => {
|
|
86
|
-
let k = (u || y)(w);
|
|
87
|
-
return l && (k = k.toLowerCase()), t && (k = tt(k)), f === "start" ? k.indexOf(I) === 0 : k.indexOf(I) > -1;
|
|
88
|
-
}) : P;
|
|
89
|
-
return typeof s == "number" ? d.slice(0, s) : d;
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
function xo(o, t) {
|
|
93
|
-
for (let l = 0; l < o.length; l += 1)
|
|
94
|
-
if (t(o[l]))
|
|
95
|
-
return l;
|
|
96
|
-
return -1;
|
|
97
|
-
}
|
|
98
|
-
const vn = bn(), nt = 5, Cn = (o) => {
|
|
99
|
-
var t;
|
|
100
|
-
return o.current !== null && ((t = o.current.parentElement) == null ? void 0 : t.contains(document.activeElement));
|
|
101
|
-
}, xn = [];
|
|
102
|
-
function In(o) {
|
|
103
|
-
const {
|
|
104
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
105
|
-
unstable_isActiveElementInListbox: t = Cn,
|
|
106
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
107
|
-
unstable_classNamePrefix: l = "Mui",
|
|
108
|
-
autoComplete: s = !1,
|
|
109
|
-
autoHighlight: f = !1,
|
|
110
|
-
autoSelect: u = !1,
|
|
111
|
-
blurOnSelect: O = !1,
|
|
112
|
-
clearOnBlur: P = !o.freeSolo,
|
|
113
|
-
clearOnEscape: A = !1,
|
|
114
|
-
componentName: y = "useAutocomplete",
|
|
115
|
-
defaultValue: I = o.multiple ? xn : null,
|
|
116
|
-
disableClearable: d = !1,
|
|
117
|
-
disableCloseOnSelect: w = !1,
|
|
118
|
-
disabled: k,
|
|
119
|
-
disabledItemsFocusable: E = !1,
|
|
120
|
-
disableListWrap: g = !1,
|
|
121
|
-
filterOptions: i = vn,
|
|
122
|
-
filterSelectedOptions: H = !1,
|
|
123
|
-
freeSolo: V = !1,
|
|
124
|
-
getOptionDisabled: B,
|
|
125
|
-
getOptionKey: J,
|
|
126
|
-
getOptionLabel: Ie = (r) => {
|
|
127
|
-
var n;
|
|
128
|
-
return (n = r.label) != null ? n : r;
|
|
129
|
-
},
|
|
130
|
-
groupBy: j,
|
|
131
|
-
handleHomeEndKeys: be = !o.freeSolo,
|
|
132
|
-
id: ie,
|
|
133
|
-
includeInputInList: fe = !1,
|
|
134
|
-
inputValue: Oe,
|
|
135
|
-
isOptionEqualToValue: Q = (r, n) => r === n,
|
|
136
|
-
multiple: T = !1,
|
|
137
|
-
onChange: L,
|
|
138
|
-
onClose: D,
|
|
139
|
-
onHighlightChange: F,
|
|
140
|
-
onInputChange: z,
|
|
141
|
-
onOpen: R,
|
|
142
|
-
open: G,
|
|
143
|
-
openOnFocus: de = !1,
|
|
144
|
-
options: Ae,
|
|
145
|
-
readOnly: le = !1,
|
|
146
|
-
selectOnFocus: Ke = !o.freeSolo,
|
|
147
|
-
value: ge
|
|
148
|
-
} = o, U = it(ie);
|
|
149
|
-
let Z = Ie;
|
|
150
|
-
Z = (r) => {
|
|
151
|
-
const n = Ie(r);
|
|
152
|
-
if (typeof n != "string") {
|
|
153
|
-
if (process.env.NODE_ENV !== "production") {
|
|
154
|
-
const c = n === void 0 ? "undefined" : `${typeof n} (${n})`;
|
|
155
|
-
console.error(`MUI: The \`getOptionLabel\` method of ${y} returned ${c} instead of a string for ${JSON.stringify(r)}.`);
|
|
156
|
-
}
|
|
157
|
-
return String(n);
|
|
158
|
-
}
|
|
159
|
-
return n;
|
|
160
|
-
};
|
|
161
|
-
const we = C.useRef(!1), b = C.useRef(!0), W = C.useRef(null), X = C.useRef(null), [Y, $e] = C.useState(null), [ae, Ge] = C.useState(-1), oo = f ? 0 : -1, $ = C.useRef(oo), [m, Pe] = Bo({
|
|
162
|
-
controlled: ge,
|
|
163
|
-
default: I,
|
|
164
|
-
name: y
|
|
165
|
-
}), [N, ve] = Bo({
|
|
166
|
-
controlled: Oe,
|
|
167
|
-
default: "",
|
|
168
|
-
name: y,
|
|
169
|
-
state: "inputValue"
|
|
170
|
-
}), [Re, Ye] = C.useState(!1), Fe = C.useCallback((r, n) => {
|
|
171
|
-
if (!(T ? m.length < n.length : n !== null) && !P)
|
|
172
|
-
return;
|
|
173
|
-
let h;
|
|
174
|
-
if (T)
|
|
175
|
-
h = "";
|
|
176
|
-
else if (n == null)
|
|
177
|
-
h = "";
|
|
178
|
-
else {
|
|
179
|
-
const S = Z(n);
|
|
180
|
-
h = typeof S == "string" ? S : "";
|
|
181
|
-
}
|
|
182
|
-
N !== h && (ve(h), z && z(r, h, "reset"));
|
|
183
|
-
}, [Z, N, T, z, ve, P, m]), [ke, to] = Bo({
|
|
184
|
-
controlled: G,
|
|
185
|
-
default: !1,
|
|
186
|
-
name: y,
|
|
187
|
-
state: "open"
|
|
188
|
-
}), [co, no] = C.useState(!0), Ee = !T && m != null && N === Z(m), pe = ke && !le, _ = pe ? i(
|
|
189
|
-
Ae.filter((r) => !(H && (T ? m : [m]).some((n) => n !== null && Q(r, n)))),
|
|
190
|
-
// we use the empty string to manipulate `filterOptions` to not filter any options
|
|
191
|
-
// i.e. the filter predicate always returns true
|
|
192
|
-
{
|
|
193
|
-
inputValue: Ee && co ? "" : N,
|
|
194
|
-
getOptionLabel: Z
|
|
195
|
-
}
|
|
196
|
-
) : [], me = mn({
|
|
197
|
-
filteredOptions: _,
|
|
198
|
-
value: m,
|
|
199
|
-
inputValue: N
|
|
200
|
-
});
|
|
201
|
-
C.useEffect(() => {
|
|
202
|
-
const r = m !== me.value;
|
|
203
|
-
Re && !r || V && !r || Fe(null, m);
|
|
204
|
-
}, [m, Fe, Re, me.value, V]);
|
|
205
|
-
const ze = ke && _.length > 0 && !le;
|
|
206
|
-
if (process.env.NODE_ENV !== "production" && m !== null && !V && Ae.length > 0) {
|
|
207
|
-
const r = (T ? m : [m]).filter((n) => !Ae.some((c) => Q(c, n)));
|
|
208
|
-
r.length > 0 && console.warn([`MUI: The value provided to ${y} is invalid.`, `None of the options match with \`${r.length > 1 ? JSON.stringify(r) : JSON.stringify(r[0])}\`.`, "You can use the `isOptionEqualToValue` prop to customize the equality test."].join(`
|
|
209
|
-
`));
|
|
210
|
-
}
|
|
211
|
-
const Te = Co((r) => {
|
|
212
|
-
r === -1 ? W.current.focus() : Y.querySelector(`[data-tag-index="${r}"]`).focus();
|
|
213
|
-
});
|
|
214
|
-
C.useEffect(() => {
|
|
215
|
-
T && ae > m.length - 1 && (Ge(-1), Te(-1));
|
|
216
|
-
}, [m, T, ae, Te]);
|
|
217
|
-
function ro(r, n) {
|
|
218
|
-
if (!X.current || r < 0 || r >= _.length)
|
|
219
|
-
return -1;
|
|
220
|
-
let c = r;
|
|
221
|
-
for (; ; ) {
|
|
222
|
-
const h = X.current.querySelector(`[data-option-index="${c}"]`), S = E ? !1 : !h || h.disabled || h.getAttribute("aria-disabled") === "true";
|
|
223
|
-
if (h && h.hasAttribute("tabindex") && !S)
|
|
224
|
-
return c;
|
|
225
|
-
if (n === "next" ? c = (c + 1) % _.length : c = (c - 1 + _.length) % _.length, c === r)
|
|
226
|
-
return -1;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
const Le = Co(({
|
|
230
|
-
event: r,
|
|
231
|
-
index: n,
|
|
232
|
-
reason: c = "auto"
|
|
233
|
-
}) => {
|
|
234
|
-
if ($.current = n, n === -1 ? W.current.removeAttribute("aria-activedescendant") : W.current.setAttribute("aria-activedescendant", `${U}-option-${n}`), F && F(r, n === -1 ? null : _[n], c), !X.current)
|
|
235
|
-
return;
|
|
236
|
-
const h = X.current.querySelector(`[role="option"].${l}-focused`);
|
|
237
|
-
h && (h.classList.remove(`${l}-focused`), h.classList.remove(`${l}-focusVisible`));
|
|
238
|
-
let S = X.current;
|
|
239
|
-
if (X.current.getAttribute("role") !== "listbox" && (S = X.current.parentElement.querySelector('[role="listbox"]')), !S)
|
|
240
|
-
return;
|
|
241
|
-
if (n === -1) {
|
|
242
|
-
S.scrollTop = 0;
|
|
243
|
-
return;
|
|
244
|
-
}
|
|
245
|
-
const M = X.current.querySelector(`[data-option-index="${n}"]`);
|
|
246
|
-
if (M && (M.classList.add(`${l}-focused`), c === "keyboard" && M.classList.add(`${l}-focusVisible`), S.scrollHeight > S.clientHeight && c !== "mouse" && c !== "touch")) {
|
|
247
|
-
const te = M, ye = S.clientHeight + S.scrollTop, lo = te.offsetTop + te.offsetHeight;
|
|
248
|
-
lo > ye ? S.scrollTop = lo - S.clientHeight : te.offsetTop - te.offsetHeight * (j ? 1.3 : 0) < S.scrollTop && (S.scrollTop = te.offsetTop - te.offsetHeight * (j ? 1.3 : 0));
|
|
249
|
-
}
|
|
250
|
-
}), ce = Co(({
|
|
251
|
-
event: r,
|
|
252
|
-
diff: n,
|
|
253
|
-
direction: c = "next",
|
|
254
|
-
reason: h = "auto"
|
|
255
|
-
}) => {
|
|
256
|
-
if (!pe)
|
|
257
|
-
return;
|
|
258
|
-
const M = ro((() => {
|
|
259
|
-
const te = _.length - 1;
|
|
260
|
-
if (n === "reset")
|
|
261
|
-
return oo;
|
|
262
|
-
if (n === "start")
|
|
263
|
-
return 0;
|
|
264
|
-
if (n === "end")
|
|
265
|
-
return te;
|
|
266
|
-
const ye = $.current + n;
|
|
267
|
-
return ye < 0 ? ye === -1 && fe ? -1 : g && $.current !== -1 || Math.abs(n) > 1 ? 0 : te : ye > te ? ye === te + 1 && fe ? -1 : g || Math.abs(n) > 1 ? te : 0 : ye;
|
|
268
|
-
})(), c);
|
|
269
|
-
if (Le({
|
|
270
|
-
index: M,
|
|
271
|
-
reason: h,
|
|
272
|
-
event: r
|
|
273
|
-
}), s && n !== "reset")
|
|
274
|
-
if (M === -1)
|
|
275
|
-
W.current.value = N;
|
|
276
|
-
else {
|
|
277
|
-
const te = Z(_[M]);
|
|
278
|
-
W.current.value = te, te.toLowerCase().indexOf(N.toLowerCase()) === 0 && N.length > 0 && W.current.setSelectionRange(N.length, te.length);
|
|
279
|
-
}
|
|
280
|
-
}), x = () => {
|
|
281
|
-
const r = (n, c) => {
|
|
282
|
-
const h = n ? Z(n) : "", S = c ? Z(c) : "";
|
|
283
|
-
return h === S;
|
|
284
|
-
};
|
|
285
|
-
if ($.current !== -1 && me.filteredOptions && me.filteredOptions.length !== _.length && me.inputValue === N && (T ? m.length === me.value.length && me.value.every((n, c) => Z(m[c]) === Z(n)) : r(me.value, m))) {
|
|
286
|
-
const n = me.filteredOptions[$.current];
|
|
287
|
-
if (n)
|
|
288
|
-
return xo(_, (c) => Z(c) === Z(n));
|
|
289
|
-
}
|
|
290
|
-
return -1;
|
|
291
|
-
}, ee = C.useCallback(() => {
|
|
292
|
-
if (!pe)
|
|
293
|
-
return;
|
|
294
|
-
const r = x();
|
|
295
|
-
if (r !== -1) {
|
|
296
|
-
$.current = r;
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
const n = T ? m[0] : m;
|
|
300
|
-
if (_.length === 0 || n == null) {
|
|
301
|
-
ce({
|
|
302
|
-
diff: "reset"
|
|
303
|
-
});
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
if (X.current) {
|
|
307
|
-
if (n != null) {
|
|
308
|
-
const c = _[$.current];
|
|
309
|
-
if (T && c && xo(m, (S) => Q(c, S)) !== -1)
|
|
310
|
-
return;
|
|
311
|
-
const h = xo(_, (S) => Q(S, n));
|
|
312
|
-
h === -1 ? ce({
|
|
313
|
-
diff: "reset"
|
|
314
|
-
}) : Le({
|
|
315
|
-
index: h
|
|
316
|
-
});
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
if ($.current >= _.length - 1) {
|
|
320
|
-
Le({
|
|
321
|
-
index: _.length - 1
|
|
322
|
-
});
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
Le({
|
|
326
|
-
index: $.current
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
}, [
|
|
330
|
-
// Only sync the highlighted index when the option switch between empty and not
|
|
331
|
-
_.length,
|
|
332
|
-
// Don't sync the highlighted index with the value when multiple
|
|
333
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
334
|
-
T ? !1 : m,
|
|
335
|
-
H,
|
|
336
|
-
ce,
|
|
337
|
-
Le,
|
|
338
|
-
pe,
|
|
339
|
-
N,
|
|
340
|
-
T
|
|
341
|
-
]), mo = Co((r) => {
|
|
342
|
-
Ft(X, r), r && ee();
|
|
343
|
-
});
|
|
344
|
-
process.env.NODE_ENV !== "production" && C.useEffect(() => {
|
|
345
|
-
(!W.current || W.current.nodeName !== "INPUT") && (W.current && W.current.nodeName === "TEXTAREA" ? console.warn([`A textarea element was provided to ${y} where input was expected.`, "This is not a supported scenario but it may work under certain conditions.", "A textarea keyboard navigation may conflict with Autocomplete controls (for example enter and arrow keys).", "Make sure to test keyboard navigation and add custom event handlers if necessary."].join(`
|
|
346
|
-
`)) : console.error([`MUI: Unable to find the input element. It was resolved to ${W.current} while an HTMLInputElement was expected.`, `Instead, ${y} expects an input element.`, "", y === "useAutocomplete" ? "Make sure you have bound getInputProps correctly and that the normal ref/effect resolutions order is guaranteed." : "Make sure you have customized the input component correctly."].join(`
|
|
347
|
-
`)));
|
|
348
|
-
}, [y]), C.useEffect(() => {
|
|
349
|
-
ee();
|
|
350
|
-
}, [ee]);
|
|
351
|
-
const De = (r) => {
|
|
352
|
-
ke || (to(!0), no(!0), R && R(r));
|
|
353
|
-
}, oe = (r, n) => {
|
|
354
|
-
ke && (to(!1), D && D(r, n));
|
|
355
|
-
}, re = (r, n, c, h) => {
|
|
356
|
-
if (T) {
|
|
357
|
-
if (m.length === n.length && m.every((S, M) => S === n[M]))
|
|
358
|
-
return;
|
|
359
|
-
} else if (m === n)
|
|
360
|
-
return;
|
|
361
|
-
L && L(r, n, c, h), Pe(n);
|
|
362
|
-
}, ue = C.useRef(!1), he = (r, n, c = "selectOption", h = "options") => {
|
|
363
|
-
let S = c, M = n;
|
|
364
|
-
if (T) {
|
|
365
|
-
if (M = Array.isArray(m) ? m.slice() : [], process.env.NODE_ENV !== "production") {
|
|
366
|
-
const ye = M.filter((lo) => Q(n, lo));
|
|
367
|
-
ye.length > 1 && console.error([`MUI: The \`isOptionEqualToValue\` method of ${y} does not handle the arguments correctly.`, `The component expects a single value to match a given option but found ${ye.length} matches.`].join(`
|
|
368
|
-
`));
|
|
369
|
-
}
|
|
370
|
-
const te = xo(M, (ye) => Q(n, ye));
|
|
371
|
-
te === -1 ? M.push(n) : h !== "freeSolo" && (M.splice(te, 1), S = "removeOption");
|
|
372
|
-
}
|
|
373
|
-
Fe(r, M), re(r, M, S, {
|
|
374
|
-
option: n
|
|
375
|
-
}), !w && (!r || !r.ctrlKey && !r.metaKey) && oe(r, S), (O === !0 || O === "touch" && ue.current || O === "mouse" && !ue.current) && W.current.blur();
|
|
376
|
-
};
|
|
377
|
-
function Oo(r, n) {
|
|
378
|
-
if (r === -1)
|
|
379
|
-
return -1;
|
|
380
|
-
let c = r;
|
|
381
|
-
for (; ; ) {
|
|
382
|
-
if (n === "next" && c === m.length || n === "previous" && c === -1)
|
|
383
|
-
return -1;
|
|
384
|
-
const h = Y.querySelector(`[data-tag-index="${c}"]`);
|
|
385
|
-
if (!h || !h.hasAttribute("tabindex") || h.disabled || h.getAttribute("aria-disabled") === "true")
|
|
386
|
-
c += n === "next" ? 1 : -1;
|
|
387
|
-
else
|
|
388
|
-
return c;
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
const fo = (r, n) => {
|
|
392
|
-
if (!T)
|
|
393
|
-
return;
|
|
394
|
-
N === "" && oe(r, "toggleInput");
|
|
395
|
-
let c = ae;
|
|
396
|
-
ae === -1 ? N === "" && n === "previous" && (c = m.length - 1) : (c += n === "next" ? 1 : -1, c < 0 && (c = 0), c === m.length && (c = -1)), c = Oo(c, n), Ge(c), Te(c);
|
|
397
|
-
}, go = (r) => {
|
|
398
|
-
we.current = !0, ve(""), z && z(r, "", "clear"), re(r, T ? [] : null, "clear");
|
|
399
|
-
}, To = (r) => (n) => {
|
|
400
|
-
if (r.onKeyDown && r.onKeyDown(n), !n.defaultMuiPrevented && (ae !== -1 && ["ArrowLeft", "ArrowRight"].indexOf(n.key) === -1 && (Ge(-1), Te(-1)), n.which !== 229))
|
|
401
|
-
switch (n.key) {
|
|
402
|
-
case "Home":
|
|
403
|
-
pe && be && (n.preventDefault(), ce({
|
|
404
|
-
diff: "start",
|
|
405
|
-
direction: "next",
|
|
406
|
-
reason: "keyboard",
|
|
407
|
-
event: n
|
|
408
|
-
}));
|
|
409
|
-
break;
|
|
410
|
-
case "End":
|
|
411
|
-
pe && be && (n.preventDefault(), ce({
|
|
412
|
-
diff: "end",
|
|
413
|
-
direction: "previous",
|
|
414
|
-
reason: "keyboard",
|
|
415
|
-
event: n
|
|
416
|
-
}));
|
|
417
|
-
break;
|
|
418
|
-
case "PageUp":
|
|
419
|
-
n.preventDefault(), ce({
|
|
420
|
-
diff: -nt,
|
|
421
|
-
direction: "previous",
|
|
422
|
-
reason: "keyboard",
|
|
423
|
-
event: n
|
|
424
|
-
}), De(n);
|
|
425
|
-
break;
|
|
426
|
-
case "PageDown":
|
|
427
|
-
n.preventDefault(), ce({
|
|
428
|
-
diff: nt,
|
|
429
|
-
direction: "next",
|
|
430
|
-
reason: "keyboard",
|
|
431
|
-
event: n
|
|
432
|
-
}), De(n);
|
|
433
|
-
break;
|
|
434
|
-
case "ArrowDown":
|
|
435
|
-
n.preventDefault(), ce({
|
|
436
|
-
diff: 1,
|
|
437
|
-
direction: "next",
|
|
438
|
-
reason: "keyboard",
|
|
439
|
-
event: n
|
|
440
|
-
}), De(n);
|
|
441
|
-
break;
|
|
442
|
-
case "ArrowUp":
|
|
443
|
-
n.preventDefault(), ce({
|
|
444
|
-
diff: -1,
|
|
445
|
-
direction: "previous",
|
|
446
|
-
reason: "keyboard",
|
|
447
|
-
event: n
|
|
448
|
-
}), De(n);
|
|
449
|
-
break;
|
|
450
|
-
case "ArrowLeft":
|
|
451
|
-
fo(n, "previous");
|
|
452
|
-
break;
|
|
453
|
-
case "ArrowRight":
|
|
454
|
-
fo(n, "next");
|
|
455
|
-
break;
|
|
456
|
-
case "Enter":
|
|
457
|
-
if ($.current !== -1 && pe) {
|
|
458
|
-
const c = _[$.current], h = B ? B(c) : !1;
|
|
459
|
-
if (n.preventDefault(), h)
|
|
460
|
-
return;
|
|
461
|
-
he(n, c, "selectOption"), s && W.current.setSelectionRange(W.current.value.length, W.current.value.length);
|
|
462
|
-
} else V && N !== "" && Ee === !1 && (T && n.preventDefault(), he(n, N, "createOption", "freeSolo"));
|
|
463
|
-
break;
|
|
464
|
-
case "Escape":
|
|
465
|
-
pe ? (n.preventDefault(), n.stopPropagation(), oe(n, "escape")) : A && (N !== "" || T && m.length > 0) && (n.preventDefault(), n.stopPropagation(), go(n));
|
|
466
|
-
break;
|
|
467
|
-
case "Backspace":
|
|
468
|
-
if (T && !le && N === "" && m.length > 0) {
|
|
469
|
-
const c = ae === -1 ? m.length - 1 : ae, h = m.slice();
|
|
470
|
-
h.splice(c, 1), re(n, h, "removeOption", {
|
|
471
|
-
option: m[c]
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
break;
|
|
475
|
-
case "Delete":
|
|
476
|
-
if (T && !le && N === "" && m.length > 0 && ae !== -1) {
|
|
477
|
-
const c = ae, h = m.slice();
|
|
478
|
-
h.splice(c, 1), re(n, h, "removeOption", {
|
|
479
|
-
option: m[c]
|
|
480
|
-
});
|
|
481
|
-
}
|
|
482
|
-
break;
|
|
483
|
-
}
|
|
484
|
-
}, Lo = (r) => {
|
|
485
|
-
Ye(!0), de && !we.current && De(r);
|
|
486
|
-
}, ho = (r) => {
|
|
487
|
-
if (t(X)) {
|
|
488
|
-
W.current.focus();
|
|
489
|
-
return;
|
|
490
|
-
}
|
|
491
|
-
Ye(!1), b.current = !0, we.current = !1, u && $.current !== -1 && pe ? he(r, _[$.current], "blur") : u && V && N !== "" ? he(r, N, "blur", "freeSolo") : P && Fe(r, m), oe(r, "blur");
|
|
492
|
-
}, No = (r) => {
|
|
493
|
-
const n = r.target.value;
|
|
494
|
-
N !== n && (ve(n), no(!1), z && z(r, n, "input")), n === "" ? !d && !T && re(r, null, "clear") : De(r);
|
|
495
|
-
}, So = (r) => {
|
|
496
|
-
const n = Number(r.currentTarget.getAttribute("data-option-index"));
|
|
497
|
-
$.current !== n && Le({
|
|
498
|
-
event: r,
|
|
499
|
-
index: n,
|
|
500
|
-
reason: "mouse"
|
|
501
|
-
});
|
|
502
|
-
}, Po = (r) => {
|
|
503
|
-
Le({
|
|
504
|
-
event: r,
|
|
505
|
-
index: Number(r.currentTarget.getAttribute("data-option-index")),
|
|
506
|
-
reason: "touch"
|
|
507
|
-
}), ue.current = !0;
|
|
508
|
-
}, ko = (r) => {
|
|
509
|
-
const n = Number(r.currentTarget.getAttribute("data-option-index"));
|
|
510
|
-
he(r, _[n], "selectOption"), ue.current = !1;
|
|
511
|
-
}, Do = (r) => (n) => {
|
|
512
|
-
const c = m.slice();
|
|
513
|
-
c.splice(r, 1), re(n, c, "removeOption", {
|
|
514
|
-
option: m[r]
|
|
515
|
-
});
|
|
516
|
-
}, yo = (r) => {
|
|
517
|
-
ke ? oe(r, "toggleInput") : De(r);
|
|
518
|
-
}, Ao = (r) => {
|
|
519
|
-
r.currentTarget.contains(r.target) && r.target.getAttribute("id") !== U && r.preventDefault();
|
|
520
|
-
}, wo = (r) => {
|
|
521
|
-
r.currentTarget.contains(r.target) && (W.current.focus(), Ke && b.current && W.current.selectionEnd - W.current.selectionStart === 0 && W.current.select(), b.current = !1);
|
|
522
|
-
}, $o = (r) => {
|
|
523
|
-
!k && (N === "" || !ke) && yo(r);
|
|
524
|
-
};
|
|
525
|
-
let uo = V && N.length > 0;
|
|
526
|
-
uo = uo || (T ? m.length > 0 : m !== null);
|
|
527
|
-
let bo = _;
|
|
528
|
-
if (j) {
|
|
529
|
-
const r = /* @__PURE__ */ new Map();
|
|
530
|
-
let n = !1;
|
|
531
|
-
bo = _.reduce((c, h, S) => {
|
|
532
|
-
const M = j(h);
|
|
533
|
-
return c.length > 0 && c[c.length - 1].group === M ? c[c.length - 1].options.push(h) : (process.env.NODE_ENV !== "production" && (r.get(M) && !n && (console.warn(`MUI: The options provided combined with the \`groupBy\` method of ${y} returns duplicated headers.`, "You can solve the issue by sorting the options with the output of `groupBy`."), n = !0), r.set(M, !0)), c.push({
|
|
534
|
-
key: S,
|
|
535
|
-
index: S,
|
|
536
|
-
group: M,
|
|
537
|
-
options: [h]
|
|
538
|
-
})), c;
|
|
539
|
-
}, []);
|
|
540
|
-
}
|
|
541
|
-
return k && Re && ho(), {
|
|
542
|
-
getRootProps: (r = {}) => p({
|
|
543
|
-
"aria-owns": ze ? `${U}-listbox` : null
|
|
544
|
-
}, r, {
|
|
545
|
-
onKeyDown: To(r),
|
|
546
|
-
onMouseDown: Ao,
|
|
547
|
-
onClick: wo
|
|
548
|
-
}),
|
|
549
|
-
getInputLabelProps: () => ({
|
|
550
|
-
id: `${U}-label`,
|
|
551
|
-
htmlFor: U
|
|
552
|
-
}),
|
|
553
|
-
getInputProps: () => ({
|
|
554
|
-
id: U,
|
|
555
|
-
value: N,
|
|
556
|
-
onBlur: ho,
|
|
557
|
-
onFocus: Lo,
|
|
558
|
-
onChange: No,
|
|
559
|
-
onMouseDown: $o,
|
|
560
|
-
// if open then this is handled imperatively so don't let react override
|
|
561
|
-
// only have an opinion about this when closed
|
|
562
|
-
"aria-activedescendant": pe ? "" : null,
|
|
563
|
-
"aria-autocomplete": s ? "both" : "list",
|
|
564
|
-
"aria-controls": ze ? `${U}-listbox` : void 0,
|
|
565
|
-
"aria-expanded": ze,
|
|
566
|
-
// Disable browser's suggestion that might overlap with the popup.
|
|
567
|
-
// Handle autocomplete but not autofill.
|
|
568
|
-
autoComplete: "off",
|
|
569
|
-
ref: W,
|
|
570
|
-
autoCapitalize: "none",
|
|
571
|
-
spellCheck: "false",
|
|
572
|
-
role: "combobox",
|
|
573
|
-
disabled: k
|
|
574
|
-
}),
|
|
575
|
-
getClearProps: () => ({
|
|
576
|
-
tabIndex: -1,
|
|
577
|
-
type: "button",
|
|
578
|
-
onClick: go
|
|
579
|
-
}),
|
|
580
|
-
getPopupIndicatorProps: () => ({
|
|
581
|
-
tabIndex: -1,
|
|
582
|
-
type: "button",
|
|
583
|
-
onClick: yo
|
|
584
|
-
}),
|
|
585
|
-
getTagProps: ({
|
|
586
|
-
index: r
|
|
587
|
-
}) => p({
|
|
588
|
-
key: r,
|
|
589
|
-
"data-tag-index": r,
|
|
590
|
-
tabIndex: -1
|
|
591
|
-
}, !le && {
|
|
592
|
-
onDelete: Do(r)
|
|
593
|
-
}),
|
|
594
|
-
getListboxProps: () => ({
|
|
595
|
-
role: "listbox",
|
|
596
|
-
id: `${U}-listbox`,
|
|
597
|
-
"aria-labelledby": `${U}-label`,
|
|
598
|
-
ref: mo,
|
|
599
|
-
onMouseDown: (r) => {
|
|
600
|
-
r.preventDefault();
|
|
601
|
-
}
|
|
602
|
-
}),
|
|
603
|
-
getOptionProps: ({
|
|
604
|
-
index: r,
|
|
605
|
-
option: n
|
|
606
|
-
}) => {
|
|
607
|
-
var c;
|
|
608
|
-
const h = (T ? m : [m]).some((M) => M != null && Q(n, M)), S = B ? B(n) : !1;
|
|
609
|
-
return {
|
|
610
|
-
key: (c = J == null ? void 0 : J(n)) != null ? c : Z(n),
|
|
611
|
-
tabIndex: -1,
|
|
612
|
-
role: "option",
|
|
613
|
-
id: `${U}-option-${r}`,
|
|
614
|
-
onMouseMove: So,
|
|
615
|
-
onClick: ko,
|
|
616
|
-
onTouchStart: Po,
|
|
617
|
-
"data-option-index": r,
|
|
618
|
-
"aria-disabled": S,
|
|
619
|
-
"aria-selected": h
|
|
620
|
-
};
|
|
621
|
-
},
|
|
622
|
-
id: U,
|
|
623
|
-
inputValue: N,
|
|
624
|
-
value: m,
|
|
625
|
-
dirty: uo,
|
|
626
|
-
expanded: pe && Y,
|
|
627
|
-
popupOpen: pe,
|
|
628
|
-
focused: Re || ae !== -1,
|
|
629
|
-
anchorEl: Y,
|
|
630
|
-
setAnchorEl: $e,
|
|
631
|
-
focusedTag: ae,
|
|
632
|
-
groupedOptions: bo
|
|
633
|
-
};
|
|
634
|
-
}
|
|
635
|
-
const Uo = /* @__PURE__ */ C.createContext(void 0);
|
|
636
|
-
process.env.NODE_ENV !== "production" && (Uo.displayName = "ListSubheaderContext");
|
|
637
|
-
const On = ["component", "className", "children", "nested", "sticky", "variant", "color", "startAction", "endAction", "role", "slots", "slotProps"], Tn = (o) => {
|
|
638
|
-
const {
|
|
639
|
-
sticky: t,
|
|
640
|
-
nested: l,
|
|
641
|
-
nesting: s,
|
|
642
|
-
variant: f,
|
|
643
|
-
color: u
|
|
644
|
-
} = o, O = {
|
|
645
|
-
root: ["root", l && "nested", s && "nesting", t && "sticky", u && `color${xe(u)}`, f && `variant${xe(f)}`],
|
|
646
|
-
startAction: ["startAction"],
|
|
647
|
-
endAction: ["endAction"]
|
|
648
|
-
};
|
|
649
|
-
return Je(O, Xt, {});
|
|
650
|
-
}, Ln = K("li")(({
|
|
651
|
-
theme: o,
|
|
652
|
-
ownerState: t
|
|
653
|
-
}) => {
|
|
654
|
-
var l;
|
|
655
|
-
return [
|
|
656
|
-
!t.nested && {
|
|
657
|
-
// add negative margin to ListItemButton equal to this ListItem padding
|
|
658
|
-
"--ListItemButton-marginInline": "calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",
|
|
659
|
-
"--ListItemButton-marginBlock": "calc(-1 * var(--ListItem-paddingY))",
|
|
660
|
-
alignItems: "center",
|
|
661
|
-
gap: "var(--ListItem-gap)",
|
|
662
|
-
marginInline: "var(--ListItem-marginInline)"
|
|
663
|
-
},
|
|
664
|
-
t.nested && {
|
|
665
|
-
// add negative margin to NestedList equal to this ListItem padding
|
|
666
|
-
"--NestedList-marginRight": "calc(-1 * var(--ListItem-paddingRight))",
|
|
667
|
-
"--NestedList-marginLeft": "calc(-1 * var(--ListItem-paddingLeft))",
|
|
668
|
-
"--NestedListItem-paddingLeft": "calc(var(--ListItem-paddingLeft) + var(--List-nestedInsetStart))",
|
|
669
|
-
// add negative margin to ListItem, ListItemButton to make them start from the edge.
|
|
670
|
-
"--ListItemButton-marginBlock": "0px",
|
|
671
|
-
"--ListItemButton-marginInline": "calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",
|
|
672
|
-
"--ListItem-marginInline": "calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",
|
|
673
|
-
flexDirection: "column"
|
|
674
|
-
},
|
|
675
|
-
// Base styles
|
|
676
|
-
p({
|
|
677
|
-
// Integration with control elements, for example Checkbox, Radio.
|
|
678
|
-
"--unstable_actionRadius": "calc(var(--ListItem-radius) - var(--variant-borderWidth, 0px))"
|
|
679
|
-
}, t.startAction && {
|
|
680
|
-
"--unstable_startActionWidth": "2rem"
|
|
681
|
-
// to add sufficient padding-left on ListItemButton
|
|
682
|
-
}, t.endAction && {
|
|
683
|
-
"--unstable_endActionWidth": "2.5rem"
|
|
684
|
-
// to add sufficient padding-right on ListItemButton
|
|
685
|
-
}, {
|
|
686
|
-
boxSizing: "border-box",
|
|
687
|
-
borderRadius: "var(--ListItem-radius)",
|
|
688
|
-
display: "var(--_ListItem-display)",
|
|
689
|
-
"&:not([hidden])": {
|
|
690
|
-
"--_ListItem-display": "var(--_List-markerDisplay, flex)"
|
|
691
|
-
},
|
|
692
|
-
flex: "none",
|
|
693
|
-
// prevent children from shrinking when the List's height is limited.
|
|
694
|
-
listStyleType: "var(--_List-markerType, disc)",
|
|
695
|
-
position: "relative",
|
|
696
|
-
paddingBlockStart: t.nested ? 0 : "var(--ListItem-paddingY)",
|
|
697
|
-
paddingBlockEnd: t.nested ? 0 : "var(--ListItem-paddingY)",
|
|
698
|
-
paddingInlineStart: "var(--ListItem-paddingLeft)",
|
|
699
|
-
paddingInlineEnd: "var(--ListItem-paddingRight)"
|
|
700
|
-
}, t["data-first-child"] === void 0 && p({}, t.row ? {
|
|
701
|
-
marginInlineStart: "var(--List-gap)"
|
|
702
|
-
} : {
|
|
703
|
-
marginBlockStart: "var(--List-gap)"
|
|
704
|
-
}), t.row && t.wrap && {
|
|
705
|
-
marginInlineStart: "var(--List-gap)",
|
|
706
|
-
marginBlockStart: "var(--List-gap)"
|
|
707
|
-
}, {
|
|
708
|
-
minBlockSize: "var(--ListItem-minHeight)"
|
|
709
|
-
}, t.sticky && {
|
|
710
|
-
// sticky in list item can be found in grouped options
|
|
711
|
-
position: "sticky",
|
|
712
|
-
top: "var(--ListItem-stickyTop, 0px)",
|
|
713
|
-
// integration with Menu and Select.
|
|
714
|
-
zIndex: 1,
|
|
715
|
-
background: `var(--ListItem-stickyBackground, ${o.vars.palette.background.body})`
|
|
716
|
-
}, {
|
|
717
|
-
[`.${_o.nested} > &`]: {
|
|
718
|
-
"--_ListItem-display": "flex"
|
|
719
|
-
}
|
|
720
|
-
}),
|
|
721
|
-
(l = o.variants[t.variant]) == null ? void 0 : l[t.color]
|
|
722
|
-
];
|
|
723
|
-
}), Nn = K(Ln, {
|
|
724
|
-
name: "JoyListItem",
|
|
725
|
-
slot: "Root",
|
|
726
|
-
overridesResolver: (o, t) => t.root
|
|
727
|
-
})({}), Sn = K("div", {
|
|
728
|
-
name: "JoyListItem",
|
|
729
|
-
slot: "StartAction",
|
|
730
|
-
overridesResolver: (o, t) => t.startAction
|
|
731
|
-
})(({
|
|
732
|
-
ownerState: o
|
|
733
|
-
}) => ({
|
|
734
|
-
display: "inherit",
|
|
735
|
-
position: "absolute",
|
|
736
|
-
top: o.nested ? "calc(var(--ListItem-minHeight) / 2)" : "50%",
|
|
737
|
-
left: 0,
|
|
738
|
-
transform: "translate(var(--ListItem-startActionTranslateX), -50%)",
|
|
739
|
-
zIndex: 1
|
|
740
|
-
// to stay on top of ListItemButton (default `position: relative`).
|
|
741
|
-
})), Pn = K("div", {
|
|
742
|
-
name: "JoyListItem",
|
|
743
|
-
slot: "StartAction",
|
|
744
|
-
overridesResolver: (o, t) => t.startAction
|
|
745
|
-
})(({
|
|
746
|
-
ownerState: o
|
|
747
|
-
}) => ({
|
|
748
|
-
display: "inherit",
|
|
749
|
-
position: "absolute",
|
|
750
|
-
top: o.nested ? "calc(var(--ListItem-minHeight) / 2)" : "50%",
|
|
751
|
-
right: 0,
|
|
752
|
-
transform: "translate(var(--ListItem-endActionTranslateX), -50%)"
|
|
753
|
-
})), po = /* @__PURE__ */ C.forwardRef(function(t, l) {
|
|
754
|
-
const s = qe({
|
|
755
|
-
props: t,
|
|
756
|
-
name: "JoyListItem"
|
|
757
|
-
}), f = C.useContext(Jt), u = C.useContext(Kt), O = C.useContext(Gt), P = C.useContext(Yt), A = C.useContext(et), {
|
|
758
|
-
component: y,
|
|
759
|
-
className: I,
|
|
760
|
-
children: d,
|
|
761
|
-
nested: w = !1,
|
|
762
|
-
sticky: k = !1,
|
|
763
|
-
variant: E = "plain",
|
|
764
|
-
color: g = "neutral",
|
|
765
|
-
startAction: i,
|
|
766
|
-
endAction: H,
|
|
767
|
-
role: V,
|
|
768
|
-
slots: B = {},
|
|
769
|
-
slotProps: J = {}
|
|
770
|
-
} = s, Ie = Ce(s, On), [j, be] = C.useState(""), [ie, fe] = (u == null ? void 0 : u.split(":")) || ["", ""], Oe = y || (ie && !ie.match(/^(ul|ol|menu)$/) ? "div" : void 0);
|
|
771
|
-
let Q = f === "menu" ? "none" : void 0;
|
|
772
|
-
u && (Q = {
|
|
773
|
-
menu: "none",
|
|
774
|
-
menubar: "none",
|
|
775
|
-
group: "presentation"
|
|
776
|
-
}[fe]), V && (Q = V);
|
|
777
|
-
const T = p({}, s, {
|
|
778
|
-
sticky: k,
|
|
779
|
-
startAction: i,
|
|
780
|
-
endAction: H,
|
|
781
|
-
row: O,
|
|
782
|
-
wrap: P,
|
|
783
|
-
variant: E,
|
|
784
|
-
color: g,
|
|
785
|
-
nesting: A,
|
|
786
|
-
nested: w,
|
|
787
|
-
component: Oe,
|
|
788
|
-
role: Q
|
|
789
|
-
}), L = Tn(T), D = p({}, Ie, {
|
|
790
|
-
component: Oe,
|
|
791
|
-
slots: B,
|
|
792
|
-
slotProps: J
|
|
793
|
-
}), [F, z] = ne("root", {
|
|
794
|
-
additionalProps: {
|
|
795
|
-
role: Q
|
|
796
|
-
},
|
|
797
|
-
ref: l,
|
|
798
|
-
className: Qe(L.root, I),
|
|
799
|
-
elementType: Nn,
|
|
800
|
-
externalForwardedProps: D,
|
|
801
|
-
ownerState: T
|
|
802
|
-
}), [R, G] = ne("startAction", {
|
|
803
|
-
className: L.startAction,
|
|
804
|
-
elementType: Sn,
|
|
805
|
-
externalForwardedProps: D,
|
|
806
|
-
ownerState: T
|
|
807
|
-
}), [de, Ae] = ne("endAction", {
|
|
808
|
-
className: L.endAction,
|
|
809
|
-
elementType: Pn,
|
|
810
|
-
externalForwardedProps: D,
|
|
811
|
-
ownerState: T
|
|
812
|
-
});
|
|
813
|
-
return /* @__PURE__ */ a(Uo.Provider, {
|
|
814
|
-
value: be,
|
|
815
|
-
children: /* @__PURE__ */ a(et.Provider, {
|
|
816
|
-
value: w ? j || !0 : !1,
|
|
817
|
-
children: /* @__PURE__ */ q(F, p({}, z, {
|
|
818
|
-
children: [i && /* @__PURE__ */ a(R, p({}, G, {
|
|
819
|
-
children: i
|
|
820
|
-
})), C.Children.map(d, (le, Ke) => {
|
|
821
|
-
var ge;
|
|
822
|
-
return /* @__PURE__ */ C.isValidElement(le) ? /* @__PURE__ */ C.cloneElement(le, p({}, Ke === 0 && {
|
|
823
|
-
"data-first-child": ""
|
|
824
|
-
}, zt(le, ["ListItem"]) && {
|
|
825
|
-
// The ListItem of ListItem should not be 'li'
|
|
826
|
-
component: ((ge = le.props) == null ? void 0 : ge.component) || "div"
|
|
827
|
-
})) : le;
|
|
828
|
-
}), H && /* @__PURE__ */ a(de, p({}, Ae, {
|
|
829
|
-
children: H
|
|
830
|
-
}))]
|
|
831
|
-
}))
|
|
832
|
-
})
|
|
833
|
-
});
|
|
834
|
-
});
|
|
835
|
-
process.env.NODE_ENV !== "production" && (po.propTypes = {
|
|
836
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
837
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
838
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
839
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
840
|
-
/**
|
|
841
|
-
* The content of the component.
|
|
842
|
-
*/
|
|
843
|
-
children: e.node,
|
|
844
|
-
/**
|
|
845
|
-
* @ignore
|
|
846
|
-
*/
|
|
847
|
-
className: e.string,
|
|
848
|
-
/**
|
|
849
|
-
* The color of the component. It supports those theme colors that make sense for this component.
|
|
850
|
-
* @default 'neutral'
|
|
851
|
-
*/
|
|
852
|
-
color: e.oneOfType([e.oneOf(["danger", "neutral", "primary", "success", "warning"]), e.string]),
|
|
853
|
-
/**
|
|
854
|
-
* The component used for the root node.
|
|
855
|
-
* Either a string to use a HTML element or a component.
|
|
856
|
-
*/
|
|
857
|
-
component: e.elementType,
|
|
858
|
-
/**
|
|
859
|
-
* The element to display at the end of ListItem.
|
|
860
|
-
*/
|
|
861
|
-
endAction: e.node,
|
|
862
|
-
/**
|
|
863
|
-
* If `true`, the component can contain NestedList.
|
|
864
|
-
* @default false
|
|
865
|
-
*/
|
|
866
|
-
nested: e.bool,
|
|
867
|
-
/**
|
|
868
|
-
* @ignore
|
|
869
|
-
*/
|
|
870
|
-
role: e.string,
|
|
871
|
-
/**
|
|
872
|
-
* The props used for each slot inside.
|
|
873
|
-
* @default {}
|
|
874
|
-
*/
|
|
875
|
-
slotProps: e.shape({
|
|
876
|
-
endAction: e.oneOfType([e.func, e.object]),
|
|
877
|
-
root: e.oneOfType([e.func, e.object]),
|
|
878
|
-
startAction: e.oneOfType([e.func, e.object])
|
|
879
|
-
}),
|
|
880
|
-
/**
|
|
881
|
-
* The components used for each slot inside.
|
|
882
|
-
* @default {}
|
|
883
|
-
*/
|
|
884
|
-
slots: e.shape({
|
|
885
|
-
endAction: e.elementType,
|
|
886
|
-
root: e.elementType,
|
|
887
|
-
startAction: e.elementType
|
|
888
|
-
}),
|
|
889
|
-
/**
|
|
890
|
-
* The element to display at the start of ListItem.
|
|
891
|
-
*/
|
|
892
|
-
startAction: e.node,
|
|
893
|
-
/**
|
|
894
|
-
* If `true`, the component has sticky position (with top = 0).
|
|
895
|
-
* @default false
|
|
896
|
-
*/
|
|
897
|
-
sticky: e.bool,
|
|
898
|
-
/**
|
|
899
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
900
|
-
*/
|
|
901
|
-
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
|
|
902
|
-
/**
|
|
903
|
-
* The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
|
|
904
|
-
* @default 'plain'
|
|
905
|
-
*/
|
|
906
|
-
variant: e.oneOfType([e.oneOf(["outlined", "plain", "soft", "solid"]), e.string])
|
|
907
|
-
});
|
|
908
|
-
po.muiName = "ListItem";
|
|
909
|
-
const kn = ht(/* @__PURE__ */ a("path", {
|
|
910
|
-
d: "M7 10l5 5 5-5z"
|
|
911
|
-
}), "ArrowDropDown"), Dn = ht(/* @__PURE__ */ a("path", {
|
|
912
|
-
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
913
|
-
}), "Cancel");
|
|
914
|
-
function An(o) {
|
|
915
|
-
return Ze("MuiChipDelete", o);
|
|
916
|
-
}
|
|
917
|
-
eo("MuiChipDelete", ["root", "disabled", "focusVisible", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantSolid", "variantSoft", "variantOutlined"]);
|
|
918
|
-
var rt;
|
|
919
|
-
const wn = ["children", "variant", "color", "disabled", "onKeyDown", "onDelete", "onClick", "component", "slots", "slotProps"], $n = ["onDelete"], Rn = (o) => {
|
|
920
|
-
const {
|
|
921
|
-
focusVisible: t,
|
|
922
|
-
variant: l,
|
|
923
|
-
color: s,
|
|
924
|
-
disabled: f
|
|
925
|
-
} = o, u = {
|
|
926
|
-
root: ["root", f && "disabled", t && "focusVisible", l && `variant${xe(l)}`, s && `color${xe(s)}`]
|
|
927
|
-
};
|
|
928
|
-
return Je(u, An, {});
|
|
929
|
-
}, En = K(jo, {
|
|
930
|
-
name: "JoyChipDelete",
|
|
931
|
-
slot: "Root",
|
|
932
|
-
overridesResolver: (o, t) => t.root
|
|
933
|
-
})(({
|
|
934
|
-
theme: o
|
|
935
|
-
}) => ({
|
|
936
|
-
"--IconButton-size": "var(--Chip-deleteSize, 2rem)",
|
|
937
|
-
"--Icon-fontSize": "calc(var(--IconButton-size, 2rem) / 1.3)",
|
|
938
|
-
minWidth: "var(--IconButton-size, 2rem)",
|
|
939
|
-
// use min-width instead of height to make the button resilient to its content
|
|
940
|
-
minHeight: "var(--IconButton-size, 2rem)",
|
|
941
|
-
// use min-height instead of height to make the button resilient to its content
|
|
942
|
-
fontSize: o.vars.fontSize.sm,
|
|
943
|
-
paddingInline: "2px",
|
|
944
|
-
// add a gap, in case the content is long, for example multiple icons
|
|
945
|
-
pointerEvents: "visible",
|
|
946
|
-
// force the ChipDelete to be hoverable because the decorator can have pointerEvents 'none'
|
|
947
|
-
borderRadius: "var(--Chip-deleteRadius, 50%)",
|
|
948
|
-
zIndex: 1,
|
|
949
|
-
// overflow above sibling button or anchor
|
|
950
|
-
padding: 0
|
|
951
|
-
// reset user agent stylesheet
|
|
952
|
-
})), xt = /* @__PURE__ */ C.forwardRef(function(t, l) {
|
|
953
|
-
const s = qe({
|
|
954
|
-
props: t,
|
|
955
|
-
name: "JoyChipDelete"
|
|
956
|
-
}), {
|
|
957
|
-
children: f,
|
|
958
|
-
variant: u = "plain",
|
|
959
|
-
color: O = "neutral",
|
|
960
|
-
disabled: P,
|
|
961
|
-
onKeyDown: A,
|
|
962
|
-
onDelete: y,
|
|
963
|
-
onClick: I,
|
|
964
|
-
component: d,
|
|
965
|
-
slots: w = {},
|
|
966
|
-
slotProps: k = {}
|
|
967
|
-
} = s, E = Ce(s, wn), g = C.useContext(sn), {
|
|
968
|
-
variant: i = u,
|
|
969
|
-
color: H = O
|
|
970
|
-
} = yt(t.variant, t.color, !0), V = t.color || H, B = P ?? g.disabled, J = C.useRef(null), Ie = ft(J, l), {
|
|
971
|
-
focusVisible: j,
|
|
972
|
-
getRootProps: be
|
|
973
|
-
} = cn(p({}, s, {
|
|
974
|
-
disabled: B,
|
|
975
|
-
rootRef: Ie
|
|
976
|
-
})), ie = p({}, s, {
|
|
977
|
-
disabled: B,
|
|
978
|
-
variant: i,
|
|
979
|
-
color: V,
|
|
980
|
-
focusVisible: j
|
|
981
|
-
}), fe = Rn(ie), Oe = p({}, E, {
|
|
982
|
-
component: d,
|
|
983
|
-
slots: w,
|
|
984
|
-
slotProps: k
|
|
985
|
-
}), Q = (z) => {
|
|
986
|
-
!B && y && y(z), I && I(z);
|
|
987
|
-
}, T = (z) => {
|
|
988
|
-
["Backspace", "Enter", "Delete"].includes(z.key) && (z.preventDefault(), !B && y && y(z)), A && A(z);
|
|
989
|
-
}, [L, D] = ne("root", {
|
|
990
|
-
ref: l,
|
|
991
|
-
elementType: En,
|
|
992
|
-
getSlotProps: be,
|
|
993
|
-
externalForwardedProps: Oe,
|
|
994
|
-
ownerState: ie,
|
|
995
|
-
additionalProps: {
|
|
996
|
-
as: d,
|
|
997
|
-
onKeyDown: T,
|
|
998
|
-
onClick: Q
|
|
999
|
-
},
|
|
1000
|
-
className: fe.root
|
|
1001
|
-
}), F = Ce(D, $n);
|
|
1002
|
-
return /* @__PURE__ */ a(L, p({}, F, {
|
|
1003
|
-
children: f ?? (rt || (rt = /* @__PURE__ */ a(Dn, {})))
|
|
1004
|
-
}));
|
|
1005
|
-
});
|
|
1006
|
-
process.env.NODE_ENV !== "production" && (xt.propTypes = {
|
|
1007
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
1008
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
1009
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
1010
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
1011
|
-
/**
|
|
1012
|
-
* If provided, it will replace the default icon.
|
|
1013
|
-
*/
|
|
1014
|
-
children: e.node,
|
|
1015
|
-
/**
|
|
1016
|
-
* The color of the component. It supports those theme colors that make sense for this component.
|
|
1017
|
-
* @default 'neutral'
|
|
1018
|
-
*/
|
|
1019
|
-
color: e.oneOfType([e.oneOf(["danger", "neutral", "primary", "success", "warning"]), e.string]),
|
|
1020
|
-
/**
|
|
1021
|
-
* The component used for the root node.
|
|
1022
|
-
* Either a string to use a HTML element or a component.
|
|
1023
|
-
*/
|
|
1024
|
-
component: e.elementType,
|
|
1025
|
-
/**
|
|
1026
|
-
* If `true`, the component is disabled.
|
|
1027
|
-
* If `undefined`, the value inherits from the parent chip via a React context.
|
|
1028
|
-
*/
|
|
1029
|
-
disabled: e.bool,
|
|
1030
|
-
/**
|
|
1031
|
-
* @ignore
|
|
1032
|
-
*/
|
|
1033
|
-
onClick: e.func,
|
|
1034
|
-
/**
|
|
1035
|
-
* Callback fired when the component is not disabled and either:
|
|
1036
|
-
* - `Backspace`, `Enter` or `Delete` is pressed.
|
|
1037
|
-
* - The component is clicked.
|
|
1038
|
-
*/
|
|
1039
|
-
onDelete: e.func,
|
|
1040
|
-
/**
|
|
1041
|
-
* @ignore
|
|
1042
|
-
*/
|
|
1043
|
-
onKeyDown: e.func,
|
|
1044
|
-
/**
|
|
1045
|
-
* The props used for each slot inside.
|
|
1046
|
-
* @default {}
|
|
1047
|
-
*/
|
|
1048
|
-
slotProps: e.shape({
|
|
1049
|
-
root: e.oneOfType([e.func, e.object])
|
|
1050
|
-
}),
|
|
1051
|
-
/**
|
|
1052
|
-
* The components used for each slot inside.
|
|
1053
|
-
* @default {}
|
|
1054
|
-
*/
|
|
1055
|
-
slots: e.shape({
|
|
1056
|
-
root: e.elementType
|
|
1057
|
-
}),
|
|
1058
|
-
/**
|
|
1059
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1060
|
-
*/
|
|
1061
|
-
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
|
|
1062
|
-
/**
|
|
1063
|
-
* The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
|
|
1064
|
-
* @default 'plain'
|
|
1065
|
-
*/
|
|
1066
|
-
variant: e.oneOfType([e.oneOf(["outlined", "plain", "soft", "solid"]), e.string])
|
|
1067
|
-
});
|
|
1068
|
-
function Bn(o) {
|
|
1069
|
-
return Ze("MuiListSubheader", o);
|
|
1070
|
-
}
|
|
1071
|
-
eo("MuiListSubheader", ["root", "sticky", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantSoft", "variantOutlined", "variantSolid"]);
|
|
1072
|
-
const _n = ["component", "className", "children", "id", "sticky", "variant", "color", "slots", "slotProps"], Fn = (o) => {
|
|
1073
|
-
const {
|
|
1074
|
-
variant: t,
|
|
1075
|
-
color: l,
|
|
1076
|
-
sticky: s
|
|
1077
|
-
} = o, f = {
|
|
1078
|
-
root: ["root", s && "sticky", l && `color${xe(l)}`, t && `variant${xe(t)}`]
|
|
1079
|
-
};
|
|
1080
|
-
return Je(f, Bn, {});
|
|
1081
|
-
}, zn = K("div", {
|
|
1082
|
-
name: "JoyListSubheader",
|
|
1083
|
-
slot: "Root",
|
|
1084
|
-
overridesResolver: (o, t) => t.root
|
|
1085
|
-
})(({
|
|
1086
|
-
theme: o,
|
|
1087
|
-
ownerState: t
|
|
1088
|
-
}) => {
|
|
1089
|
-
var l, s;
|
|
1090
|
-
return p({
|
|
1091
|
-
boxSizing: "border-box",
|
|
1092
|
-
display: "flex",
|
|
1093
|
-
alignItems: "center",
|
|
1094
|
-
marginInline: "var(--ListItem-marginInline)",
|
|
1095
|
-
paddingBlock: "var(--ListItem-paddingY)",
|
|
1096
|
-
paddingInlineStart: "var(--ListItem-paddingLeft)",
|
|
1097
|
-
paddingInlineEnd: "var(--ListItem-paddingRight)",
|
|
1098
|
-
minBlockSize: "var(--ListItem-minHeight)"
|
|
1099
|
-
}, o.typography["body-xs"], {
|
|
1100
|
-
fontSize: "max(0.75em, 0.625rem)",
|
|
1101
|
-
textTransform: "uppercase",
|
|
1102
|
-
letterSpacing: "0.1em"
|
|
1103
|
-
}, t.sticky && {
|
|
1104
|
-
position: "sticky",
|
|
1105
|
-
top: "var(--ListItem-stickyTop, 0px)",
|
|
1106
|
-
// integration with Menu and Select.
|
|
1107
|
-
zIndex: 1,
|
|
1108
|
-
background: "var(--ListItem-stickyBackground)"
|
|
1109
|
-
}, {
|
|
1110
|
-
color: t.color ? `var(--_Link-color, rgba(${(l = o.vars.palette[t.color]) == null ? void 0 : l.mainChannel} / 1))` : o.vars.palette.text.tertiary
|
|
1111
|
-
}, t.instanceColor && {
|
|
1112
|
-
[`&:not([${dn}])`]: {
|
|
1113
|
-
"--_Link-color": o.vars.palette.text.secondary
|
|
1114
|
-
}
|
|
1115
|
-
}, (s = o.variants[t.variant]) == null ? void 0 : s[t.color]);
|
|
1116
|
-
}), It = /* @__PURE__ */ C.forwardRef(function(t, l) {
|
|
1117
|
-
const s = qe({
|
|
1118
|
-
props: t,
|
|
1119
|
-
name: "JoyListSubheader"
|
|
1120
|
-
}), {
|
|
1121
|
-
component: f,
|
|
1122
|
-
className: u,
|
|
1123
|
-
children: O,
|
|
1124
|
-
id: P,
|
|
1125
|
-
sticky: A = !1,
|
|
1126
|
-
variant: y,
|
|
1127
|
-
color: I,
|
|
1128
|
-
slots: d = {},
|
|
1129
|
-
slotProps: w = {}
|
|
1130
|
-
} = s, k = Ce(s, _n), E = it(P), g = C.useContext(Uo);
|
|
1131
|
-
C.useEffect(() => {
|
|
1132
|
-
g && g(E || "");
|
|
1133
|
-
}, [g, E]);
|
|
1134
|
-
const i = p({
|
|
1135
|
-
instanceColor: t.color
|
|
1136
|
-
}, s, {
|
|
1137
|
-
id: E,
|
|
1138
|
-
sticky: A,
|
|
1139
|
-
variant: y,
|
|
1140
|
-
color: y ? I ?? "neutral" : I
|
|
1141
|
-
}), H = Fn(i), V = p({}, k, {
|
|
1142
|
-
component: f,
|
|
1143
|
-
slots: d,
|
|
1144
|
-
slotProps: w
|
|
1145
|
-
}), [B, J] = ne("root", {
|
|
1146
|
-
ref: l,
|
|
1147
|
-
className: Qe(H.root, u),
|
|
1148
|
-
elementType: zn,
|
|
1149
|
-
externalForwardedProps: V,
|
|
1150
|
-
ownerState: i,
|
|
1151
|
-
additionalProps: {
|
|
1152
|
-
as: f,
|
|
1153
|
-
id: E
|
|
1154
|
-
}
|
|
1155
|
-
});
|
|
1156
|
-
return /* @__PURE__ */ a(B, p({}, J, {
|
|
1157
|
-
children: O
|
|
1158
|
-
}));
|
|
1159
|
-
});
|
|
1160
|
-
process.env.NODE_ENV !== "production" && (It.propTypes = {
|
|
1161
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
1162
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
1163
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
1164
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
1165
|
-
/**
|
|
1166
|
-
* The content of the component.
|
|
1167
|
-
*/
|
|
1168
|
-
children: e.node,
|
|
1169
|
-
/**
|
|
1170
|
-
* @ignore
|
|
1171
|
-
*/
|
|
1172
|
-
className: e.string,
|
|
1173
|
-
/**
|
|
1174
|
-
* The color of the component. It supports those theme colors that make sense for this component.
|
|
1175
|
-
*/
|
|
1176
|
-
color: e.oneOfType([e.oneOf(["danger", "neutral", "primary", "success", "warning"]), e.string]),
|
|
1177
|
-
/**
|
|
1178
|
-
* The component used for the root node.
|
|
1179
|
-
* Either a string to use a HTML element or a component.
|
|
1180
|
-
*/
|
|
1181
|
-
component: e.elementType,
|
|
1182
|
-
/**
|
|
1183
|
-
* @ignore
|
|
1184
|
-
*/
|
|
1185
|
-
id: e.string,
|
|
1186
|
-
/**
|
|
1187
|
-
* The props used for each slot inside.
|
|
1188
|
-
* @default {}
|
|
1189
|
-
*/
|
|
1190
|
-
slotProps: e.shape({
|
|
1191
|
-
root: e.oneOfType([e.func, e.object])
|
|
1192
|
-
}),
|
|
1193
|
-
/**
|
|
1194
|
-
* The components used for each slot inside.
|
|
1195
|
-
* @default {}
|
|
1196
|
-
*/
|
|
1197
|
-
slots: e.shape({
|
|
1198
|
-
root: e.elementType
|
|
1199
|
-
}),
|
|
1200
|
-
/**
|
|
1201
|
-
* If `true`, the component has sticky position (with top = 0).
|
|
1202
|
-
* @default false
|
|
1203
|
-
*/
|
|
1204
|
-
sticky: e.bool,
|
|
1205
|
-
/**
|
|
1206
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1207
|
-
*/
|
|
1208
|
-
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
|
|
1209
|
-
/**
|
|
1210
|
-
* The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
|
|
1211
|
-
*/
|
|
1212
|
-
variant: e.oneOfType([e.oneOf(["outlined", "plain", "soft", "solid"]), e.string])
|
|
1213
|
-
});
|
|
1214
|
-
function Mn(o) {
|
|
1215
|
-
return Ze("MuiAutocomplete", o);
|
|
1216
|
-
}
|
|
1217
|
-
const Ue = eo("MuiAutocomplete", ["root", "wrapper", "input", "startDecorator", "endDecorator", "formControl", "focused", "disabled", "error", "multiple", "limitTag", "hasPopupIcon", "hasClearIcon", "clearIndicator", "popupIndicator", "popupIndicatorOpen", "listbox", "option", "loading", "noOptions", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "sizeSm", "sizeMd", "sizeLg", "variantPlain", "variantOutlined", "variantSoft", "variantSolid"]);
|
|
1218
|
-
function Hn(o) {
|
|
1219
|
-
return Ze("MuiAutocompleteListbox", o);
|
|
1220
|
-
}
|
|
1221
|
-
eo("MuiAutocompleteListbox", ["root", "sizeSm", "sizeMd", "sizeLg", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantOutlined", "variantSoft", "variantSolid"]);
|
|
1222
|
-
const Vn = ["anchorEl", "direction", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "TransitionProps"], jn = ["children", "className", "component", "color", "variant", "size", "slots", "slotProps"], Un = (o) => {
|
|
1223
|
-
const {
|
|
1224
|
-
variant: t,
|
|
1225
|
-
color: l,
|
|
1226
|
-
size: s
|
|
1227
|
-
} = o, f = {
|
|
1228
|
-
root: ["root", t && `variant${xe(t)}`, l && `color${xe(l)}`, s && `size${xe(s)}`]
|
|
1229
|
-
};
|
|
1230
|
-
return Je(f, Hn, {});
|
|
1231
|
-
}, Wn = (o) => Ce(o, Vn), Ot = K(Qt)(({
|
|
1232
|
-
theme: o,
|
|
1233
|
-
ownerState: t
|
|
1234
|
-
}) => {
|
|
1235
|
-
var l;
|
|
1236
|
-
const s = (l = o.variants[t.variant]) == null ? void 0 : l[t.color];
|
|
1237
|
-
return p({
|
|
1238
|
-
"--focus-outline-offset": `calc(${o.vars.focus.thickness} * -1)`,
|
|
1239
|
-
// to prevent the focus outline from being cut by overflow
|
|
1240
|
-
"--ListItem-stickyBackground": (s == null ? void 0 : s.backgroundColor) || (s == null ? void 0 : s.background) || o.vars.palette.background.popup,
|
|
1241
|
-
"--ListItem-stickyTop": "calc(var(--List-padding, var(--ListDivider-gap)) * -1)"
|
|
1242
|
-
}, Zt, {
|
|
1243
|
-
boxShadow: o.shadow.md,
|
|
1244
|
-
borderRadius: `var(--List-radius, ${o.vars.radius.sm})`
|
|
1245
|
-
}, !(s != null && s.backgroundColor) && {
|
|
1246
|
-
backgroundColor: o.vars.palette.background.popup
|
|
1247
|
-
}, {
|
|
1248
|
-
zIndex: o.vars.zIndex.popup,
|
|
1249
|
-
overflow: "auto",
|
|
1250
|
-
maxHeight: "40vh",
|
|
1251
|
-
position: "relative",
|
|
1252
|
-
// to make sure that the listbox is positioned for grouped options to work.
|
|
1253
|
-
"&:empty": {
|
|
1254
|
-
visibility: "hidden"
|
|
1255
|
-
},
|
|
1256
|
-
[`& .${_o.nested}, & .${_o.nested} .${en.root}`]: {
|
|
1257
|
-
// For grouped options autocomplete:
|
|
1258
|
-
// Force the position to make the scroll into view logic works because the `element.offsetTop` should reference to the listbox, not the grouped list.
|
|
1259
|
-
// See the implementation of the `useAutocomplete` line:370
|
|
1260
|
-
//
|
|
1261
|
-
// Resource: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetTop
|
|
1262
|
-
position: "initial"
|
|
1263
|
-
}
|
|
1264
|
-
});
|
|
1265
|
-
}), qn = K(Ot, {
|
|
1266
|
-
name: "JoyAutocompleteListbox",
|
|
1267
|
-
slot: "Root",
|
|
1268
|
-
overridesResolver: (o, t) => t.root
|
|
1269
|
-
})({}), Jn = /* @__PURE__ */ C.forwardRef(function(t, l) {
|
|
1270
|
-
const s = qe({
|
|
1271
|
-
props: t,
|
|
1272
|
-
name: "JoyAutocompleteListbox"
|
|
1273
|
-
}), {
|
|
1274
|
-
children: f,
|
|
1275
|
-
className: u,
|
|
1276
|
-
component: O,
|
|
1277
|
-
color: P = "neutral",
|
|
1278
|
-
variant: A = "outlined",
|
|
1279
|
-
size: y = "md",
|
|
1280
|
-
slots: I = {},
|
|
1281
|
-
slotProps: d = {}
|
|
1282
|
-
} = s, w = Ce(s, jn), k = p({}, s, {
|
|
1283
|
-
size: y,
|
|
1284
|
-
color: P,
|
|
1285
|
-
variant: A,
|
|
1286
|
-
nesting: !1,
|
|
1287
|
-
row: !1,
|
|
1288
|
-
wrap: !1
|
|
1289
|
-
}), E = Wn(w), g = Un(k), i = p({}, E, {
|
|
1290
|
-
component: O,
|
|
1291
|
-
slots: I,
|
|
1292
|
-
slotProps: d
|
|
1293
|
-
}), [H, V] = ne("root", {
|
|
1294
|
-
ref: l,
|
|
1295
|
-
className: Qe(g.root, u),
|
|
1296
|
-
elementType: qn,
|
|
1297
|
-
externalForwardedProps: i,
|
|
1298
|
-
ownerState: k,
|
|
1299
|
-
additionalProps: {
|
|
1300
|
-
role: "listbox"
|
|
1301
|
-
}
|
|
1302
|
-
});
|
|
1303
|
-
return /* @__PURE__ */ a(bt, {
|
|
1304
|
-
variant: A,
|
|
1305
|
-
color: P,
|
|
1306
|
-
children: /* @__PURE__ */ a(H, p({}, V, {
|
|
1307
|
-
children: f
|
|
1308
|
-
}))
|
|
1309
|
-
});
|
|
1310
|
-
});
|
|
1311
|
-
process.env.NODE_ENV !== "production" && (Jn.propTypes = {
|
|
1312
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
1313
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
1314
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
1315
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
1316
|
-
/**
|
|
1317
|
-
* @ignore
|
|
1318
|
-
*/
|
|
1319
|
-
children: e.node,
|
|
1320
|
-
/**
|
|
1321
|
-
* @ignore
|
|
1322
|
-
*/
|
|
1323
|
-
className: e.string,
|
|
1324
|
-
/**
|
|
1325
|
-
* The color of the component. It supports those theme colors that make sense for this component.
|
|
1326
|
-
* @default 'neutral'
|
|
1327
|
-
*/
|
|
1328
|
-
color: e.oneOfType([e.oneOf(["danger", "neutral", "primary", "success", "warning"]), e.string]),
|
|
1329
|
-
/**
|
|
1330
|
-
* The component used for the root node.
|
|
1331
|
-
* Either a string to use a HTML element or a component.
|
|
1332
|
-
*/
|
|
1333
|
-
component: e.elementType,
|
|
1334
|
-
/**
|
|
1335
|
-
* The size of the component (affect other nested list* components).
|
|
1336
|
-
* @default 'md'
|
|
1337
|
-
*/
|
|
1338
|
-
size: e.oneOf(["sm", "md", "lg"]),
|
|
1339
|
-
/**
|
|
1340
|
-
* The props used for each slot inside.
|
|
1341
|
-
* @default {}
|
|
1342
|
-
*/
|
|
1343
|
-
slotProps: e.shape({
|
|
1344
|
-
root: e.oneOfType([e.func, e.object])
|
|
1345
|
-
}),
|
|
1346
|
-
/**
|
|
1347
|
-
* The components used for each slot inside.
|
|
1348
|
-
* @default {}
|
|
1349
|
-
*/
|
|
1350
|
-
slots: e.shape({
|
|
1351
|
-
root: e.elementType
|
|
1352
|
-
}),
|
|
1353
|
-
/**
|
|
1354
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1355
|
-
*/
|
|
1356
|
-
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
|
|
1357
|
-
/**
|
|
1358
|
-
* The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
|
|
1359
|
-
* @default 'outlined'
|
|
1360
|
-
*/
|
|
1361
|
-
variant: e.oneOfType([e.oneOf(["contained", "light", "outlined", "text"]), e.string])
|
|
1362
|
-
});
|
|
1363
|
-
function Kn(o) {
|
|
1364
|
-
return Ze("MuiAutocompleteOption", o);
|
|
1365
|
-
}
|
|
1366
|
-
eo("MuiAutocompleteOption", ["root", "focused", "focusVisible", "colorPrimary", "colorNeutral", "colorDanger", "colorSuccess", "colorWarning", "colorContext", "variantPlain", "variantSoft", "variantOutlined", "variantSolid"]);
|
|
1367
|
-
const Gn = ["children", "component", "color", "variant", "className", "slots", "slotProps"], Yn = (o) => {
|
|
1368
|
-
const {
|
|
1369
|
-
color: t,
|
|
1370
|
-
variant: l
|
|
1371
|
-
} = o, s = {
|
|
1372
|
-
root: ["root", t && `color${xe(t)}`, l && `variant${xe(l)}`]
|
|
1373
|
-
};
|
|
1374
|
-
return Je(s, Kn, {});
|
|
1375
|
-
}, Tt = K(on)(({
|
|
1376
|
-
theme: o,
|
|
1377
|
-
ownerState: t
|
|
1378
|
-
}) => {
|
|
1379
|
-
var l, s;
|
|
1380
|
-
return {
|
|
1381
|
-
'&[aria-disabled="true"]': (l = o.variants[`${t.variant}Disabled`]) == null ? void 0 : l[t.color],
|
|
1382
|
-
'&[aria-selected="true"]': p({}, (s = o.variants[`${t.variant}Active`]) == null ? void 0 : s[t.color], {
|
|
1383
|
-
fontWeight: o.vars.fontWeight.md
|
|
1384
|
-
})
|
|
1385
|
-
};
|
|
1386
|
-
}), Xn = K(Tt, {
|
|
1387
|
-
name: "JoyAutocompleteOption",
|
|
1388
|
-
slot: "Root",
|
|
1389
|
-
overridesResolver: (o, t) => t.root
|
|
1390
|
-
})({}), zo = /* @__PURE__ */ C.forwardRef(function(t, l) {
|
|
1391
|
-
const s = qe({
|
|
1392
|
-
props: t,
|
|
1393
|
-
name: "JoyAutocompleteOption"
|
|
1394
|
-
}), {
|
|
1395
|
-
children: f,
|
|
1396
|
-
component: u = "li",
|
|
1397
|
-
color: O = "neutral",
|
|
1398
|
-
variant: P = "plain",
|
|
1399
|
-
className: A,
|
|
1400
|
-
slots: y = {},
|
|
1401
|
-
slotProps: I = {}
|
|
1402
|
-
} = s, d = Ce(s, Gn), {
|
|
1403
|
-
variant: w = P,
|
|
1404
|
-
color: k = O
|
|
1405
|
-
} = yt(t.variant, t.color), E = p({}, s, {
|
|
1406
|
-
component: u,
|
|
1407
|
-
color: k,
|
|
1408
|
-
variant: w
|
|
1409
|
-
}), g = Yn(E), i = p({}, d, {
|
|
1410
|
-
component: u,
|
|
1411
|
-
slots: y,
|
|
1412
|
-
slotProps: I
|
|
1413
|
-
}), [H, V] = ne("root", {
|
|
1414
|
-
ref: l,
|
|
1415
|
-
className: Qe(g.root, A),
|
|
1416
|
-
elementType: Xn,
|
|
1417
|
-
externalForwardedProps: i,
|
|
1418
|
-
ownerState: E,
|
|
1419
|
-
additionalProps: {
|
|
1420
|
-
as: u,
|
|
1421
|
-
role: "option"
|
|
1422
|
-
}
|
|
1423
|
-
});
|
|
1424
|
-
return /* @__PURE__ */ a(H, p({}, V, {
|
|
1425
|
-
children: f
|
|
1426
|
-
}));
|
|
1427
|
-
});
|
|
1428
|
-
process.env.NODE_ENV !== "production" && (zo.propTypes = {
|
|
1429
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
1430
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
1431
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
1432
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
1433
|
-
/**
|
|
1434
|
-
* @ignore
|
|
1435
|
-
*/
|
|
1436
|
-
children: e.node,
|
|
1437
|
-
/**
|
|
1438
|
-
* @ignore
|
|
1439
|
-
*/
|
|
1440
|
-
className: e.string,
|
|
1441
|
-
/**
|
|
1442
|
-
* The color of the component. It supports those theme colors that make sense for this component.
|
|
1443
|
-
* @default 'neutral'
|
|
1444
|
-
*/
|
|
1445
|
-
color: e.oneOfType([e.oneOf(["danger", "neutral", "primary", "success", "warning"]), e.string]),
|
|
1446
|
-
/**
|
|
1447
|
-
* The component used for the root node.
|
|
1448
|
-
* Either a string to use a HTML element or a component.
|
|
1449
|
-
*/
|
|
1450
|
-
component: e.elementType,
|
|
1451
|
-
/**
|
|
1452
|
-
* The props used for each slot inside.
|
|
1453
|
-
* @default {}
|
|
1454
|
-
*/
|
|
1455
|
-
slotProps: e.shape({
|
|
1456
|
-
root: e.oneOfType([e.func, e.object])
|
|
1457
|
-
}),
|
|
1458
|
-
/**
|
|
1459
|
-
* The components used for each slot inside.
|
|
1460
|
-
* @default {}
|
|
1461
|
-
*/
|
|
1462
|
-
slots: e.shape({
|
|
1463
|
-
root: e.elementType
|
|
1464
|
-
}),
|
|
1465
|
-
/**
|
|
1466
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1467
|
-
*/
|
|
1468
|
-
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
|
|
1469
|
-
/**
|
|
1470
|
-
* The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
|
|
1471
|
-
* @default 'plain'
|
|
1472
|
-
*/
|
|
1473
|
-
variant: e.oneOfType([e.oneOf(["contained", "light", "outlined", "text"]), e.string])
|
|
1474
|
-
});
|
|
1475
|
-
var lt, st;
|
|
1476
|
-
const Qn = ["aria-describedby", "aria-label", "aria-labelledby", "autoComplete", "autoHighlight", "autoSelect", "autoFocus", "blurOnSelect", "clearIcon", "clearOnBlur", "clearOnEscape", "clearText", "closeText", "defaultValue", "disableCloseOnSelect", "disabledItemsFocusable", "disableListWrap", "disableClearable", "disabled", "endDecorator", "error", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "getLimitTagsText", "getOptionDisabled", "getOptionKey", "getOptionLabel", "handleHomeEndKeys", "includeInputInList", "isOptionEqualToValue", "groupBy", "id", "inputValue", "limitTags", "loading", "loadingText", "multiple", "name", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "placeholder", "popupIcon", "readOnly", "renderGroup", "renderOption", "renderTags", "required", "type", "startDecorator", "size", "color", "variant", "value", "component", "selectOnFocus", "slots", "slotProps"], Zn = ["onDelete"], er = ["key"], or = ["onBlur", "onFocus", "onMouseDown"], tr = ["key"], nr = (o) => o.current !== null && o.current.contains(document.activeElement), rr = (o) => {
|
|
1477
|
-
var t;
|
|
1478
|
-
return (t = o.label) != null ? t : o;
|
|
1479
|
-
}, lr = (o) => `+${o}`, sr = (o) => /* @__PURE__ */ q(po, {
|
|
1480
|
-
nested: !0,
|
|
1481
|
-
children: [/* @__PURE__ */ a(It, {
|
|
1482
|
-
sticky: !0,
|
|
1483
|
-
children: o.group
|
|
1484
|
-
}), /* @__PURE__ */ a(nn, {
|
|
1485
|
-
children: o.children
|
|
1486
|
-
})]
|
|
1487
|
-
}, o.key), ir = (o) => {
|
|
1488
|
-
const {
|
|
1489
|
-
disabled: t,
|
|
1490
|
-
focused: l,
|
|
1491
|
-
hasClearIcon: s,
|
|
1492
|
-
hasPopupIcon: f,
|
|
1493
|
-
popupOpen: u,
|
|
1494
|
-
variant: O,
|
|
1495
|
-
color: P,
|
|
1496
|
-
size: A,
|
|
1497
|
-
multiple: y
|
|
1498
|
-
} = o, I = {
|
|
1499
|
-
root: ["root", l && "focused", s && "hasClearIcon", f && "hasPopupIcon", O && `variant${xe(O)}`, P && `color${xe(P)}`, A && `size${xe(A)}`],
|
|
1500
|
-
wrapper: ["wrapper", y && "multiple"],
|
|
1501
|
-
input: ["input"],
|
|
1502
|
-
startDecorator: ["startDecorator"],
|
|
1503
|
-
endDecorator: ["endDecorator"],
|
|
1504
|
-
clearIndicator: ["clearIndicator"],
|
|
1505
|
-
popupIndicator: ["popupIndicator", u && "popupIndicatorOpen", t && "disabled"],
|
|
1506
|
-
listbox: ["listbox"],
|
|
1507
|
-
option: ["option"],
|
|
1508
|
-
loading: ["loading"],
|
|
1509
|
-
noOptions: ["noOptions"],
|
|
1510
|
-
limitTag: ["limitTag"]
|
|
1511
|
-
};
|
|
1512
|
-
return Je(I, Mn, {});
|
|
1513
|
-
}, ar = K(Mt, {
|
|
1514
|
-
name: "JoyAutocomplete",
|
|
1515
|
-
slot: "Root",
|
|
1516
|
-
overridesResolver: (o, t) => t.root
|
|
1517
|
-
})(({
|
|
1518
|
-
ownerState: o
|
|
1519
|
-
}) => p({}, o.size === "sm" && {
|
|
1520
|
-
"--Autocomplete-wrapperGap": "3px"
|
|
1521
|
-
}, o.size === "md" && {
|
|
1522
|
-
"--Autocomplete-wrapperGap": "3px"
|
|
1523
|
-
}, o.size === "lg" && {
|
|
1524
|
-
"--Autocomplete-wrapperGap": "4px"
|
|
1525
|
-
}, {
|
|
1526
|
-
/* Avoid double tap issue on iOS */
|
|
1527
|
-
"@media (pointer: fine)": {
|
|
1528
|
-
[`&:hover .${Ue.clearIndicator}`]: {
|
|
1529
|
-
visibility: "visible"
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
}, o.multiple && !o.startDecorator && {
|
|
1533
|
-
paddingInlineStart: 0
|
|
1534
|
-
})), cr = K("div", {
|
|
1535
|
-
name: "JoyAutocomplete",
|
|
1536
|
-
slot: "Wrapper",
|
|
1537
|
-
overridesResolver: (o, t) => t.wrapper
|
|
1538
|
-
})(({
|
|
1539
|
-
ownerState: o
|
|
1540
|
-
}) => ({
|
|
1541
|
-
flex: 1,
|
|
1542
|
-
// stretch to fill the root slot
|
|
1543
|
-
minWidth: 0,
|
|
1544
|
-
// won't push end decorator out of the autocomplete
|
|
1545
|
-
display: "flex",
|
|
1546
|
-
alignItems: "center",
|
|
1547
|
-
flexWrap: "wrap",
|
|
1548
|
-
gap: "var(--Autocomplete-wrapperGap)",
|
|
1549
|
-
[`&.${Ue.multiple}`]: p({
|
|
1550
|
-
paddingBlock: "var(--Autocomplete-wrapperGap)"
|
|
1551
|
-
}, !o.startDecorator && {
|
|
1552
|
-
paddingInlineStart: "var(--Autocomplete-wrapperGap)"
|
|
1553
|
-
}, !o.endDecorator && {
|
|
1554
|
-
paddingInlineEnd: "var(--Autocomplete-wrapperGap)"
|
|
1555
|
-
})
|
|
1556
|
-
})), ur = K(Ht, {
|
|
1557
|
-
name: "JoyAutocomplete",
|
|
1558
|
-
slot: "Input",
|
|
1559
|
-
overridesResolver: (o, t) => t.input
|
|
1560
|
-
})(({
|
|
1561
|
-
ownerState: o
|
|
1562
|
-
}) => p({
|
|
1563
|
-
minWidth: 30,
|
|
1564
|
-
minHeight: "var(--Chip-minHeight)"
|
|
1565
|
-
}, o.multiple && {
|
|
1566
|
-
marginInlineStart: "calc(var(--Autocomplete-wrapperGap) * 2.5)"
|
|
1567
|
-
})), dr = K(Vt, {
|
|
1568
|
-
name: "JoyAutocomplete",
|
|
1569
|
-
slot: "StartDecorator",
|
|
1570
|
-
overridesResolver: (o, t) => t.startDecorator
|
|
1571
|
-
})({}), pr = K(jt, {
|
|
1572
|
-
name: "JoyAutocomplete",
|
|
1573
|
-
slot: "EndDecorator",
|
|
1574
|
-
overridesResolver: (o, t) => t.endDecorator
|
|
1575
|
-
})(({
|
|
1576
|
-
ownerState: o
|
|
1577
|
-
}) => p({}, (o.hasClearIcon || o.hasPopupIcon) && {
|
|
1578
|
-
"--Button-margin": "0px",
|
|
1579
|
-
"--IconButton-margin": "0px",
|
|
1580
|
-
"--Icon-margin": "0px"
|
|
1581
|
-
})), mr = K(jo, {
|
|
1582
|
-
name: "JoyAutocomplete",
|
|
1583
|
-
slot: "ClearIndicator",
|
|
1584
|
-
overridesResolver: (o, t) => t.clearIndicator
|
|
1585
|
-
})(({
|
|
1586
|
-
ownerState: o
|
|
1587
|
-
}) => p({
|
|
1588
|
-
alignSelf: "center"
|
|
1589
|
-
}, !o.hasPopupIcon && {
|
|
1590
|
-
marginInlineEnd: "calc(var(--Input-decoratorChildOffset) * -1)"
|
|
1591
|
-
}, {
|
|
1592
|
-
marginInlineStart: "calc(var(--_Input-paddingBlock) / 2)",
|
|
1593
|
-
visibility: o.focused ? "visible" : "hidden"
|
|
1594
|
-
})), fr = K(jo, {
|
|
1595
|
-
name: "JoyAutocomplete",
|
|
1596
|
-
slot: "PopupIndicator",
|
|
1597
|
-
overridesResolver: (o, t) => t.popupIndicator
|
|
1598
|
-
})({
|
|
1599
|
-
alignSelf: "center",
|
|
1600
|
-
marginInlineStart: "calc(var(--_Input-paddingBlock) / 2)",
|
|
1601
|
-
marginInlineEnd: "calc(var(--Input-decoratorChildOffset) * -1)",
|
|
1602
|
-
[`&.${Ue.popupIndicatorOpen}`]: {
|
|
1603
|
-
transform: "rotate(180deg)",
|
|
1604
|
-
"--Icon-color": "currentColor"
|
|
1605
|
-
}
|
|
1606
|
-
}), gr = K(Ot, {
|
|
1607
|
-
name: "JoyAutocomplete",
|
|
1608
|
-
slot: "Listbox",
|
|
1609
|
-
overridesResolver: (o, t) => t.listbox
|
|
1610
|
-
})(({
|
|
1611
|
-
theme: o
|
|
1612
|
-
}) => ({
|
|
1613
|
-
// `unstable_popup-zIndex` is a private variable that lets other component, for example Modal, to override the z-index so that the listbox can be displayed above the Modal.
|
|
1614
|
-
zIndex: `var(--unstable_popup-zIndex, ${o.vars.zIndex.popup})`
|
|
1615
|
-
})), hr = K(Tt, {
|
|
1616
|
-
name: "JoyAutocomplete",
|
|
1617
|
-
slot: "Option",
|
|
1618
|
-
overridesResolver: (o, t) => t.option
|
|
1619
|
-
})({}), yr = K(po, {
|
|
1620
|
-
name: "JoyAutocomplete",
|
|
1621
|
-
slot: "Loading",
|
|
1622
|
-
overridesResolver: (o, t) => t.loading
|
|
1623
|
-
})(({
|
|
1624
|
-
theme: o
|
|
1625
|
-
}) => ({
|
|
1626
|
-
color: (o.vars || o).palette.text.secondary
|
|
1627
|
-
})), br = K(po, {
|
|
1628
|
-
name: "JoyAutocomplete",
|
|
1629
|
-
slot: "NoOptions",
|
|
1630
|
-
overridesResolver: (o, t) => t.noOptions
|
|
1631
|
-
})(({
|
|
1632
|
-
theme: o
|
|
1633
|
-
}) => ({
|
|
1634
|
-
color: (o.vars || o).palette.text.secondary
|
|
1635
|
-
})), vr = K("div", {
|
|
1636
|
-
name: "JoyAutocomplete",
|
|
1637
|
-
slot: "NoOptions",
|
|
1638
|
-
overridesResolver: (o, t) => t.noOptions
|
|
1639
|
-
})({
|
|
1640
|
-
marginInlineStart: "calc(var(--Input-paddingInline) / 2)",
|
|
1641
|
-
marginBlockStart: "var(--_Input-paddingBlock)"
|
|
1642
|
-
}), Mo = /* @__PURE__ */ C.forwardRef(function(t, l) {
|
|
1643
|
-
var s, f, u, O, P, A, y;
|
|
1644
|
-
const I = qe({
|
|
1645
|
-
props: t,
|
|
1646
|
-
name: "JoyAutocomplete"
|
|
1647
|
-
}), {
|
|
1648
|
-
"aria-describedby": d,
|
|
1649
|
-
"aria-label": w,
|
|
1650
|
-
"aria-labelledby": k,
|
|
1651
|
-
autoFocus: E,
|
|
1652
|
-
clearIcon: g = lt || (lt = /* @__PURE__ */ a(qt, {
|
|
1653
|
-
fontSize: "md"
|
|
1654
|
-
})),
|
|
1655
|
-
clearText: i = "Clear",
|
|
1656
|
-
closeText: H = "Close",
|
|
1657
|
-
disableClearable: V = !1,
|
|
1658
|
-
disabled: B,
|
|
1659
|
-
endDecorator: J,
|
|
1660
|
-
error: Ie = !1,
|
|
1661
|
-
forcePopupIcon: j = "auto",
|
|
1662
|
-
freeSolo: be = !1,
|
|
1663
|
-
getLimitTagsText: ie = lr,
|
|
1664
|
-
getOptionLabel: fe = rr,
|
|
1665
|
-
groupBy: Oe,
|
|
1666
|
-
id: Q,
|
|
1667
|
-
limitTags: T = -1,
|
|
1668
|
-
loading: L = !1,
|
|
1669
|
-
loadingText: D = "Loading…",
|
|
1670
|
-
multiple: F = !1,
|
|
1671
|
-
name: z,
|
|
1672
|
-
noOptionsText: R = "No options",
|
|
1673
|
-
openText: G = "Open",
|
|
1674
|
-
placeholder: de,
|
|
1675
|
-
popupIcon: Ae = st || (st = /* @__PURE__ */ a(kn, {})),
|
|
1676
|
-
readOnly: le = !1,
|
|
1677
|
-
renderGroup: Ke = sr,
|
|
1678
|
-
renderOption: ge,
|
|
1679
|
-
renderTags: U,
|
|
1680
|
-
required: Z,
|
|
1681
|
-
type: we,
|
|
1682
|
-
startDecorator: b,
|
|
1683
|
-
size: W = "md",
|
|
1684
|
-
color: X = "neutral",
|
|
1685
|
-
variant: Y = "outlined",
|
|
1686
|
-
component: $e,
|
|
1687
|
-
slots: ae = {},
|
|
1688
|
-
slotProps: Ge = {}
|
|
1689
|
-
} = I, oo = Ce(I, Qn), $ = C.useContext(ln), m = (s = (f = t.error) != null ? f : $ == null ? void 0 : $.error) != null ? s : Ie, Pe = (u = (O = t.size) != null ? O : $ == null ? void 0 : $.size) != null ? u : W, N = (P = t.color) != null ? P : m ? "danger" : (A = $ == null ? void 0 : $.color) != null ? A : X, ve = (y = B ?? ($ == null ? void 0 : $.disabled)) != null ? y : !1, {
|
|
1690
|
-
getRootProps: Re,
|
|
1691
|
-
getInputProps: Ye,
|
|
1692
|
-
getPopupIndicatorProps: Fe,
|
|
1693
|
-
getClearProps: ke,
|
|
1694
|
-
getTagProps: to,
|
|
1695
|
-
getListboxProps: co,
|
|
1696
|
-
getOptionProps: no,
|
|
1697
|
-
value: Ee,
|
|
1698
|
-
dirty: pe,
|
|
1699
|
-
popupOpen: _,
|
|
1700
|
-
focused: me,
|
|
1701
|
-
focusedTag: ze,
|
|
1702
|
-
anchorEl: Te,
|
|
1703
|
-
setAnchorEl: ro,
|
|
1704
|
-
inputValue: Le,
|
|
1705
|
-
groupedOptions: ce
|
|
1706
|
-
} = In(p({}, I, {
|
|
1707
|
-
id: Q ?? ($ == null ? void 0 : $.htmlFor),
|
|
1708
|
-
componentName: "Autocomplete",
|
|
1709
|
-
unstable_classNamePrefix: "Mui",
|
|
1710
|
-
unstable_isActiveElementInListbox: nr
|
|
1711
|
-
})), {
|
|
1712
|
-
onMouseDown: x
|
|
1713
|
-
} = Ye(), {
|
|
1714
|
-
onClick: ee
|
|
1715
|
-
} = Re(), mo = !V && !ve && pe && !le, De = (!be || j === !0) && j !== !1, oe = p({
|
|
1716
|
-
instanceColor: t.color
|
|
1717
|
-
}, I, {
|
|
1718
|
-
value: Ee,
|
|
1719
|
-
disabled: ve,
|
|
1720
|
-
focused: me,
|
|
1721
|
-
getOptionLabel: fe,
|
|
1722
|
-
hasOptions: !!ce.length,
|
|
1723
|
-
hasClearIcon: mo,
|
|
1724
|
-
hasPopupIcon: De,
|
|
1725
|
-
inputFocused: ze === -1,
|
|
1726
|
-
popupOpen: _,
|
|
1727
|
-
size: Pe,
|
|
1728
|
-
color: N,
|
|
1729
|
-
variant: Y
|
|
1730
|
-
}), re = ir(oe), ue = p({}, oo, {
|
|
1731
|
-
component: $e,
|
|
1732
|
-
slots: ae,
|
|
1733
|
-
slotProps: Ge
|
|
1734
|
-
});
|
|
1735
|
-
let he;
|
|
1736
|
-
if (F && Ee.length > 0) {
|
|
1737
|
-
const v = (Ne) => {
|
|
1738
|
-
const se = to(Ne), {
|
|
1739
|
-
onDelete: Se
|
|
1740
|
-
} = se, Me = Ce(se, Zn);
|
|
1741
|
-
return p({
|
|
1742
|
-
disabled: ve,
|
|
1743
|
-
size: Pe,
|
|
1744
|
-
onClick: Se
|
|
1745
|
-
}, Me);
|
|
1746
|
-
};
|
|
1747
|
-
U ? he = U(Ee, v, oe) : he = Ee.map((Ne, se) => {
|
|
1748
|
-
const Se = v({
|
|
1749
|
-
index: se
|
|
1750
|
-
}), {
|
|
1751
|
-
key: Me
|
|
1752
|
-
} = Se, Ro = Ce(Se, er);
|
|
1753
|
-
return /* @__PURE__ */ a(an, {
|
|
1754
|
-
size: Pe,
|
|
1755
|
-
variant: "soft",
|
|
1756
|
-
color: "neutral",
|
|
1757
|
-
endDecorator: /* @__PURE__ */ a(xt, p({}, Ro), Me),
|
|
1758
|
-
sx: {
|
|
1759
|
-
minWidth: 0
|
|
1760
|
-
},
|
|
1761
|
-
children: fe(Ne)
|
|
1762
|
-
}, se);
|
|
1763
|
-
});
|
|
1764
|
-
}
|
|
1765
|
-
const Oo = ft(l, ro), fo = {
|
|
1766
|
-
[Ue.disabled]: ve,
|
|
1767
|
-
[Ue.error]: m,
|
|
1768
|
-
[Ue.focused]: me,
|
|
1769
|
-
[Ue.formControl]: !!$
|
|
1770
|
-
}, [go, To] = ne("root", {
|
|
1771
|
-
ref: Oo,
|
|
1772
|
-
className: [re.root, fo],
|
|
1773
|
-
elementType: ar,
|
|
1774
|
-
externalForwardedProps: ue,
|
|
1775
|
-
ownerState: oe,
|
|
1776
|
-
getSlotProps: Re,
|
|
1777
|
-
additionalProps: {
|
|
1778
|
-
onClick: (v) => {
|
|
1779
|
-
ee && ee(v), v.currentTarget === v.target && x && x(v);
|
|
1780
|
-
}
|
|
1781
|
-
}
|
|
1782
|
-
}), [Lo, ho] = ne("wrapper", {
|
|
1783
|
-
className: re.wrapper,
|
|
1784
|
-
elementType: cr,
|
|
1785
|
-
externalForwardedProps: ue,
|
|
1786
|
-
ownerState: oe
|
|
1787
|
-
}), No = {
|
|
1788
|
-
[Ue.disabled]: ve
|
|
1789
|
-
}, [So, Po] = ne("input", {
|
|
1790
|
-
className: [re.input, No],
|
|
1791
|
-
elementType: ur,
|
|
1792
|
-
getSlotProps: (v) => {
|
|
1793
|
-
const Ne = Ye(), {
|
|
1794
|
-
onBlur: se,
|
|
1795
|
-
onFocus: Se,
|
|
1796
|
-
onMouseDown: Me
|
|
1797
|
-
} = Ne, Ro = Ce(Ne, or);
|
|
1798
|
-
return p({}, Ro, {
|
|
1799
|
-
onBlur: (He) => {
|
|
1800
|
-
var Ve;
|
|
1801
|
-
se == null || se(He), (Ve = v.onBlur) == null || Ve.call(v, He);
|
|
1802
|
-
},
|
|
1803
|
-
onFocus: (He) => {
|
|
1804
|
-
var Ve;
|
|
1805
|
-
Se == null || Se(He), (Ve = v.onFocus) == null || Ve.call(v, He);
|
|
1806
|
-
},
|
|
1807
|
-
onMouseDown: (He) => {
|
|
1808
|
-
var Ve;
|
|
1809
|
-
Me == null || Me(He), (Ve = v.onMouseDown) == null || Ve.call(v, He);
|
|
1810
|
-
}
|
|
1811
|
-
});
|
|
1812
|
-
},
|
|
1813
|
-
externalForwardedProps: ue,
|
|
1814
|
-
ownerState: oe,
|
|
1815
|
-
additionalProps: {
|
|
1816
|
-
autoFocus: E,
|
|
1817
|
-
placeholder: de,
|
|
1818
|
-
name: z,
|
|
1819
|
-
readOnly: le,
|
|
1820
|
-
disabled: ve,
|
|
1821
|
-
required: Z ?? ($ == null ? void 0 : $.required),
|
|
1822
|
-
type: we,
|
|
1823
|
-
"aria-invalid": m || void 0,
|
|
1824
|
-
"aria-label": w,
|
|
1825
|
-
"aria-labelledby": k,
|
|
1826
|
-
"aria-describedby": d ?? ($ == null ? void 0 : $["aria-describedby"])
|
|
1827
|
-
}
|
|
1828
|
-
}), [ko, Do] = ne("startDecorator", {
|
|
1829
|
-
className: re.startDecorator,
|
|
1830
|
-
elementType: dr,
|
|
1831
|
-
externalForwardedProps: ue,
|
|
1832
|
-
ownerState: oe
|
|
1833
|
-
}), [yo, Ao] = ne("endDecorator", {
|
|
1834
|
-
className: re.endDecorator,
|
|
1835
|
-
elementType: pr,
|
|
1836
|
-
externalForwardedProps: ue,
|
|
1837
|
-
ownerState: oe
|
|
1838
|
-
}), [wo, $o] = ne("clearIndicator", {
|
|
1839
|
-
className: re.clearIndicator,
|
|
1840
|
-
elementType: mr,
|
|
1841
|
-
getSlotProps: ke,
|
|
1842
|
-
externalForwardedProps: ue,
|
|
1843
|
-
ownerState: oe,
|
|
1844
|
-
getSlotOwnerState: (v) => ({
|
|
1845
|
-
size: v.size || Pe,
|
|
1846
|
-
variant: v.variant || io(Y, N).variant || "plain",
|
|
1847
|
-
color: v.color || io(Y, N).color || "neutral",
|
|
1848
|
-
disableColorInversion: !!t.color
|
|
1849
|
-
}),
|
|
1850
|
-
additionalProps: {
|
|
1851
|
-
"aria-label": i,
|
|
1852
|
-
title: i
|
|
1853
|
-
}
|
|
1854
|
-
}), [uo, bo] = ne("popupIndicator", {
|
|
1855
|
-
className: re.popupIndicator,
|
|
1856
|
-
elementType: fr,
|
|
1857
|
-
getSlotProps: Fe,
|
|
1858
|
-
externalForwardedProps: ue,
|
|
1859
|
-
ownerState: oe,
|
|
1860
|
-
getSlotOwnerState: (v) => ({
|
|
1861
|
-
size: v.size || Pe,
|
|
1862
|
-
variant: v.variant || io(Y, N).variant || "plain",
|
|
1863
|
-
color: v.color || io(Y, N).color || "neutral",
|
|
1864
|
-
disableColorInversion: !!t.color
|
|
1865
|
-
}),
|
|
1866
|
-
additionalProps: {
|
|
1867
|
-
disabled: ve,
|
|
1868
|
-
"aria-label": _ ? H : G,
|
|
1869
|
-
title: _ ? H : G,
|
|
1870
|
-
type: "button"
|
|
1871
|
-
}
|
|
1872
|
-
}), [r, n] = ne("listbox", {
|
|
1873
|
-
className: re.listbox,
|
|
1874
|
-
elementType: gr,
|
|
1875
|
-
getSlotProps: co,
|
|
1876
|
-
externalForwardedProps: ue,
|
|
1877
|
-
ownerState: oe,
|
|
1878
|
-
getSlotOwnerState: (v) => ({
|
|
1879
|
-
size: v.size || Pe,
|
|
1880
|
-
variant: v.variant || Y,
|
|
1881
|
-
color: v.color || N,
|
|
1882
|
-
disableColorInversion: !v.disablePortal
|
|
1883
|
-
}),
|
|
1884
|
-
additionalProps: {
|
|
1885
|
-
anchorEl: Te,
|
|
1886
|
-
open: _,
|
|
1887
|
-
style: Te ? {
|
|
1888
|
-
width: Te.clientWidth
|
|
1889
|
-
} : {}
|
|
1890
|
-
}
|
|
1891
|
-
}), [c, h] = ne("loading", {
|
|
1892
|
-
className: re.loading,
|
|
1893
|
-
elementType: yr,
|
|
1894
|
-
externalForwardedProps: ue,
|
|
1895
|
-
ownerState: oe
|
|
1896
|
-
}), [S, M] = ne("noOptions", {
|
|
1897
|
-
className: re.noOptions,
|
|
1898
|
-
elementType: br,
|
|
1899
|
-
externalForwardedProps: ue,
|
|
1900
|
-
ownerState: oe,
|
|
1901
|
-
additionalProps: {
|
|
1902
|
-
role: "presentation",
|
|
1903
|
-
onMouseDown: (v) => {
|
|
1904
|
-
v.preventDefault();
|
|
1905
|
-
}
|
|
1906
|
-
}
|
|
1907
|
-
}), [te, ye] = ne("limitTag", {
|
|
1908
|
-
className: re.limitTag,
|
|
1909
|
-
elementType: vr,
|
|
1910
|
-
externalForwardedProps: ue,
|
|
1911
|
-
ownerState: oe
|
|
1912
|
-
});
|
|
1913
|
-
if (T > -1 && Array.isArray(he)) {
|
|
1914
|
-
const v = he.length - T;
|
|
1915
|
-
!me && v > 0 && (he = he.splice(0, T), he.push(/* @__PURE__ */ a(te, p({}, ye, {
|
|
1916
|
-
children: ie(v)
|
|
1917
|
-
}), he.length)));
|
|
1918
|
-
}
|
|
1919
|
-
const [lo, Lt] = ne("option", {
|
|
1920
|
-
className: re.option,
|
|
1921
|
-
elementType: hr,
|
|
1922
|
-
externalForwardedProps: ue,
|
|
1923
|
-
ownerState: oe,
|
|
1924
|
-
getSlotOwnerState: (v) => ({
|
|
1925
|
-
variant: v.variant || io(Y, N).variant || "plain",
|
|
1926
|
-
color: v.color || io(Y, N).color || "neutral",
|
|
1927
|
-
disableColorInversion: !n.disablePortal
|
|
1928
|
-
}),
|
|
1929
|
-
additionalProps: {
|
|
1930
|
-
as: "li"
|
|
1931
|
-
}
|
|
1932
|
-
}), Nt = ge || ((v, Ne) => {
|
|
1933
|
-
const {
|
|
1934
|
-
key: se
|
|
1935
|
-
} = v, Se = Ce(v, tr);
|
|
1936
|
-
return /* @__PURE__ */ a(lo, p({}, Se, {
|
|
1937
|
-
children: fe(Ne)
|
|
1938
|
-
}), se);
|
|
1939
|
-
}), Wo = (v, Ne) => {
|
|
1940
|
-
const se = no({
|
|
1941
|
-
option: v,
|
|
1942
|
-
index: Ne
|
|
1943
|
-
});
|
|
1944
|
-
return Nt(p({}, Lt, se), v, {
|
|
1945
|
-
// `aria-selected` prop will always by boolean, see useAutocomplete hook.
|
|
1946
|
-
selected: !!se["aria-selected"],
|
|
1947
|
-
inputValue: Le,
|
|
1948
|
-
ownerState: oe
|
|
1949
|
-
});
|
|
1950
|
-
}, St = C.useMemo(() => [{
|
|
1951
|
-
name: "offset",
|
|
1952
|
-
options: {
|
|
1953
|
-
offset: [0, 4]
|
|
1954
|
-
}
|
|
1955
|
-
}, ...n.modifiers || []], [n.modifiers]);
|
|
1956
|
-
let qo = null;
|
|
1957
|
-
if (Te) {
|
|
1958
|
-
var Jo;
|
|
1959
|
-
qo = /* @__PURE__ */ a(bt, {
|
|
1960
|
-
variant: Y,
|
|
1961
|
-
color: N,
|
|
1962
|
-
children: /* @__PURE__ */ a(tn, {
|
|
1963
|
-
nested: !0,
|
|
1964
|
-
children: /* @__PURE__ */ q(r, p({}, n, {
|
|
1965
|
-
className: Qe(n.className),
|
|
1966
|
-
modifiers: St
|
|
1967
|
-
}, !((Jo = I.slots) != null && Jo.listbox) && {
|
|
1968
|
-
as: un,
|
|
1969
|
-
slots: {
|
|
1970
|
-
root: n.as || "ul"
|
|
1971
|
-
}
|
|
1972
|
-
}, {
|
|
1973
|
-
children: [ce.map((v, Ne) => {
|
|
1974
|
-
if (Oe) {
|
|
1975
|
-
const se = v;
|
|
1976
|
-
return Ke({
|
|
1977
|
-
key: String(se.key),
|
|
1978
|
-
group: se.group,
|
|
1979
|
-
children: se.options.map((Se, Me) => Wo(Se, se.index + Me))
|
|
1980
|
-
});
|
|
1981
|
-
}
|
|
1982
|
-
return Wo(v, Ne);
|
|
1983
|
-
}), L && ce.length === 0 ? /* @__PURE__ */ a(c, p({}, h, {
|
|
1984
|
-
children: D
|
|
1985
|
-
})) : null, ce.length === 0 && !be && !L ? /* @__PURE__ */ a(S, p({}, M, {
|
|
1986
|
-
children: R
|
|
1987
|
-
})) : null]
|
|
1988
|
-
}))
|
|
1989
|
-
})
|
|
1990
|
-
});
|
|
1991
|
-
}
|
|
1992
|
-
return /* @__PURE__ */ q(C.Fragment, {
|
|
1993
|
-
children: [/* @__PURE__ */ q(go, p({}, To, {
|
|
1994
|
-
children: [b && /* @__PURE__ */ a(ko, p({}, Do, {
|
|
1995
|
-
children: b
|
|
1996
|
-
})), /* @__PURE__ */ q(Lo, p({}, ho, {
|
|
1997
|
-
children: [he, /* @__PURE__ */ a(So, p({}, Po))]
|
|
1998
|
-
})), J && /* @__PURE__ */ a(yo, p({}, Ao, {
|
|
1999
|
-
children: J
|
|
2000
|
-
})), mo ? /* @__PURE__ */ a(wo, p({}, $o, {
|
|
2001
|
-
children: g
|
|
2002
|
-
})) : null, De ? /* @__PURE__ */ a(uo, p({}, bo, {
|
|
2003
|
-
children: Ae
|
|
2004
|
-
})) : null]
|
|
2005
|
-
})), qo]
|
|
2006
|
-
});
|
|
2007
|
-
});
|
|
2008
|
-
process.env.NODE_ENV !== "production" && (Mo.propTypes = {
|
|
2009
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
2010
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
2011
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
2012
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
2013
|
-
/**
|
|
2014
|
-
* Identifies the element (or elements) that describes the object.
|
|
2015
|
-
* @see aria-labelledby
|
|
2016
|
-
*/
|
|
2017
|
-
"aria-describedby": e.string,
|
|
2018
|
-
/**
|
|
2019
|
-
* Defines a string value that labels the current element.
|
|
2020
|
-
* @see aria-labelledby.
|
|
2021
|
-
*/
|
|
2022
|
-
"aria-label": e.string,
|
|
2023
|
-
/**
|
|
2024
|
-
* Identifies the element (or elements) that labels the current element.
|
|
2025
|
-
* @see aria-describedby.
|
|
2026
|
-
*/
|
|
2027
|
-
"aria-labelledby": e.string,
|
|
2028
|
-
/**
|
|
2029
|
-
* If `true`, the portion of the selected suggestion that the user hasn't typed,
|
|
2030
|
-
* known as the completion string, appears inline after the input cursor in the textbox.
|
|
2031
|
-
* The inline completion string is visually highlighted and has a selected state.
|
|
2032
|
-
* @default false
|
|
2033
|
-
*/
|
|
2034
|
-
autoComplete: e.bool,
|
|
2035
|
-
/**
|
|
2036
|
-
* If `true`, the `input` element is focused during the first mount.
|
|
2037
|
-
*/
|
|
2038
|
-
autoFocus: e.bool,
|
|
2039
|
-
/**
|
|
2040
|
-
* If `true`, the first option is automatically highlighted.
|
|
2041
|
-
* @default false
|
|
2042
|
-
*/
|
|
2043
|
-
autoHighlight: e.bool,
|
|
2044
|
-
/**
|
|
2045
|
-
* If `true`, the selected option becomes the value of the input
|
|
2046
|
-
* when the Autocomplete loses focus unless the user chooses
|
|
2047
|
-
* a different option or changes the character string in the input.
|
|
2048
|
-
*
|
|
2049
|
-
* When using the `freeSolo` mode, the typed value will be the input value
|
|
2050
|
-
* if the Autocomplete loses focus without highlighting an option.
|
|
2051
|
-
* @default false
|
|
2052
|
-
*/
|
|
2053
|
-
autoSelect: e.bool,
|
|
2054
|
-
/**
|
|
2055
|
-
* Control if the input should be blurred when an option is selected:
|
|
2056
|
-
*
|
|
2057
|
-
* - `false` the input is not blurred.
|
|
2058
|
-
* - `true` the input is always blurred.
|
|
2059
|
-
* - `touch` the input is blurred after a touch event.
|
|
2060
|
-
* - `mouse` the input is blurred after a mouse event.
|
|
2061
|
-
* @default false
|
|
2062
|
-
*/
|
|
2063
|
-
blurOnSelect: e.oneOfType([e.oneOf(["mouse", "touch"]), e.bool]),
|
|
2064
|
-
/**
|
|
2065
|
-
* The icon to display in place of the default clear icon.
|
|
2066
|
-
* @default <ClearIcon fontSize="md" />
|
|
2067
|
-
*/
|
|
2068
|
-
clearIcon: e.node,
|
|
2069
|
-
/**
|
|
2070
|
-
* If `true`, the input's text is cleared on blur if no value is selected.
|
|
2071
|
-
*
|
|
2072
|
-
* Set it to `true` if you want to help the user enter a new value.
|
|
2073
|
-
* Set it to `false` if you want to help the user resume their search.
|
|
2074
|
-
* @default !props.freeSolo
|
|
2075
|
-
*/
|
|
2076
|
-
clearOnBlur: e.bool,
|
|
2077
|
-
/**
|
|
2078
|
-
* If `true`, clear all values when the user presses escape and the popup is closed.
|
|
2079
|
-
* @default false
|
|
2080
|
-
*/
|
|
2081
|
-
clearOnEscape: e.bool,
|
|
2082
|
-
/**
|
|
2083
|
-
* Override the default text for the *clear* icon button.
|
|
2084
|
-
*
|
|
2085
|
-
* For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
|
|
2086
|
-
* @default 'Clear'
|
|
2087
|
-
*/
|
|
2088
|
-
clearText: e.string,
|
|
2089
|
-
/**
|
|
2090
|
-
* Override the default text for the *close popup* icon button.
|
|
2091
|
-
*
|
|
2092
|
-
* For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
|
|
2093
|
-
* @default 'Close'
|
|
2094
|
-
*/
|
|
2095
|
-
closeText: e.string,
|
|
2096
|
-
/**
|
|
2097
|
-
* The color of the component. It supports those theme colors that make sense for this component.
|
|
2098
|
-
* @default 'neutral'
|
|
2099
|
-
*/
|
|
2100
|
-
color: e.oneOf(["danger", "neutral", "primary", "success", "warning"]),
|
|
2101
|
-
/**
|
|
2102
|
-
* The default value. Use when the component is not controlled.
|
|
2103
|
-
* @default props.multiple ? [] : null
|
|
2104
|
-
*/
|
|
2105
|
-
defaultValue: ot(e.any, (o) => o.multiple && o.defaultValue !== void 0 && !Array.isArray(o.defaultValue) ? new Error(["MUI: The Autocomplete expects the `defaultValue` prop to be an array when `multiple={true}` or undefined.", `However, ${o.defaultValue} was provided.`].join(`
|
|
2106
|
-
`)) : null),
|
|
2107
|
-
/**
|
|
2108
|
-
* If `true`, the input can't be cleared.
|
|
2109
|
-
* @default false
|
|
2110
|
-
*/
|
|
2111
|
-
disableClearable: e.bool,
|
|
2112
|
-
/**
|
|
2113
|
-
* If `true`, the popup won't close when a value is selected.
|
|
2114
|
-
* @default false
|
|
2115
|
-
*/
|
|
2116
|
-
disableCloseOnSelect: e.bool,
|
|
2117
|
-
/**
|
|
2118
|
-
* If `true`, the component is disabled.
|
|
2119
|
-
* @default false
|
|
2120
|
-
*/
|
|
2121
|
-
disabled: e.bool,
|
|
2122
|
-
/**
|
|
2123
|
-
* If `true`, will allow focus on disabled items.
|
|
2124
|
-
* @default false
|
|
2125
|
-
*/
|
|
2126
|
-
disabledItemsFocusable: e.bool,
|
|
2127
|
-
/**
|
|
2128
|
-
* If `true`, the list box in the popup will not wrap focus.
|
|
2129
|
-
* @default false
|
|
2130
|
-
*/
|
|
2131
|
-
disableListWrap: e.bool,
|
|
2132
|
-
/**
|
|
2133
|
-
* Trailing adornment for this input.
|
|
2134
|
-
*/
|
|
2135
|
-
endDecorator: e.node,
|
|
2136
|
-
/**
|
|
2137
|
-
* If `true`, the `input` will indicate an error.
|
|
2138
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
|
2139
|
-
* @default false
|
|
2140
|
-
*/
|
|
2141
|
-
error: e.bool,
|
|
2142
|
-
/**
|
|
2143
|
-
* A function that determines the filtered options to be rendered on search.
|
|
2144
|
-
*
|
|
2145
|
-
* @default createFilterOptions()
|
|
2146
|
-
* @param {Value[]} options The options to render.
|
|
2147
|
-
* @param {object} state The state of the component.
|
|
2148
|
-
* @returns {Value[]}
|
|
2149
|
-
*/
|
|
2150
|
-
filterOptions: e.func,
|
|
2151
|
-
/**
|
|
2152
|
-
* If `true`, hide the selected options from the list box.
|
|
2153
|
-
* @default false
|
|
2154
|
-
*/
|
|
2155
|
-
filterSelectedOptions: e.bool,
|
|
2156
|
-
/**
|
|
2157
|
-
* Force the visibility display of the popup icon.
|
|
2158
|
-
* @default 'auto'
|
|
2159
|
-
*/
|
|
2160
|
-
forcePopupIcon: e.oneOfType([e.oneOf(["auto"]), e.bool]),
|
|
2161
|
-
/**
|
|
2162
|
-
* If `true`, the Autocomplete is free solo, meaning that the user input is not bound to provided options.
|
|
2163
|
-
* @default false
|
|
2164
|
-
*/
|
|
2165
|
-
freeSolo: e.bool,
|
|
2166
|
-
/**
|
|
2167
|
-
* The label to display when the tags are truncated (`limitTags`).
|
|
2168
|
-
*
|
|
2169
|
-
* @param {string | number} more The number of truncated tags.
|
|
2170
|
-
* @returns {ReactNode}
|
|
2171
|
-
* @default (more: string | number) => `+${more}`
|
|
2172
|
-
*/
|
|
2173
|
-
getLimitTagsText: e.func,
|
|
2174
|
-
/**
|
|
2175
|
-
* Used to determine the disabled state for a given option.
|
|
2176
|
-
*
|
|
2177
|
-
* @param {Value} option The option to test.
|
|
2178
|
-
* @returns {boolean}
|
|
2179
|
-
*/
|
|
2180
|
-
getOptionDisabled: e.func,
|
|
2181
|
-
/**
|
|
2182
|
-
* Used to determine the key for a given option.
|
|
2183
|
-
* This can be useful when the labels of options are not unique (since labels are used as keys by default).
|
|
2184
|
-
*
|
|
2185
|
-
* @param {Value} option The option to get the key for.
|
|
2186
|
-
* @returns {string | number}
|
|
2187
|
-
*/
|
|
2188
|
-
getOptionKey: e.func,
|
|
2189
|
-
/**
|
|
2190
|
-
* Used to determine the string value for a given option.
|
|
2191
|
-
* It's used to fill the input (and the list box options if `renderOption` is not provided).
|
|
2192
|
-
*
|
|
2193
|
-
* If used in free solo mode, it must accept both the type of the options and a string.
|
|
2194
|
-
*
|
|
2195
|
-
* @param {Value} option
|
|
2196
|
-
* @returns {string}
|
|
2197
|
-
* @default (option) => option.label ?? option
|
|
2198
|
-
*/
|
|
2199
|
-
getOptionLabel: e.func,
|
|
2200
|
-
/**
|
|
2201
|
-
* If provided, the options will be grouped under the returned string.
|
|
2202
|
-
* The groupBy value is also used as the text for group headings when `renderGroup` is not provided.
|
|
2203
|
-
*
|
|
2204
|
-
* @param {Value} options The options to group.
|
|
2205
|
-
* @returns {string}
|
|
2206
|
-
*/
|
|
2207
|
-
groupBy: e.func,
|
|
2208
|
-
/**
|
|
2209
|
-
* If `true`, the component handles the "Home" and "End" keys when the popup is open.
|
|
2210
|
-
* It should move focus to the first option and last option, respectively.
|
|
2211
|
-
* @default !props.freeSolo
|
|
2212
|
-
*/
|
|
2213
|
-
handleHomeEndKeys: e.bool,
|
|
2214
|
-
/**
|
|
2215
|
-
* This prop is used to help implement the accessibility logic.
|
|
2216
|
-
* If you don't provide an id it will fall back to a randomly generated one.
|
|
2217
|
-
*/
|
|
2218
|
-
id: e.string,
|
|
2219
|
-
/**
|
|
2220
|
-
* If `true`, the highlight can move to the input.
|
|
2221
|
-
* @default false
|
|
2222
|
-
*/
|
|
2223
|
-
includeInputInList: e.bool,
|
|
2224
|
-
/**
|
|
2225
|
-
* The input value.
|
|
2226
|
-
*/
|
|
2227
|
-
inputValue: e.string,
|
|
2228
|
-
/**
|
|
2229
|
-
* Used to determine if the option represents the given value.
|
|
2230
|
-
* Uses strict equality by default.
|
|
2231
|
-
* ⚠️ Both arguments need to be handled, an option can only match with one value.
|
|
2232
|
-
*
|
|
2233
|
-
* @param {Value} option The option to test.
|
|
2234
|
-
* @param {Value} value The value to test against.
|
|
2235
|
-
* @returns {boolean}
|
|
2236
|
-
*/
|
|
2237
|
-
isOptionEqualToValue: e.func,
|
|
2238
|
-
/**
|
|
2239
|
-
* The maximum number of tags that will be visible when not focused.
|
|
2240
|
-
* Set `-1` to disable the limit.
|
|
2241
|
-
* @default -1
|
|
2242
|
-
*/
|
|
2243
|
-
limitTags: yn,
|
|
2244
|
-
/**
|
|
2245
|
-
* If `true`, the component is in a loading state.
|
|
2246
|
-
* This shows the `loadingText` in place of suggestions (only if there are no suggestions to show, for example `options` are empty).
|
|
2247
|
-
* @default false
|
|
2248
|
-
*/
|
|
2249
|
-
loading: e.bool,
|
|
2250
|
-
/**
|
|
2251
|
-
* Text to display when in a loading state.
|
|
2252
|
-
*
|
|
2253
|
-
* For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
|
|
2254
|
-
* @default 'Loading…'
|
|
2255
|
-
*/
|
|
2256
|
-
loadingText: e.node,
|
|
2257
|
-
/**
|
|
2258
|
-
* If `true`, `value` must be an array and the menu will support multiple selections.
|
|
2259
|
-
* @default false
|
|
2260
|
-
*/
|
|
2261
|
-
multiple: e.bool,
|
|
2262
|
-
/**
|
|
2263
|
-
* Name attribute of the `input` element.
|
|
2264
|
-
*/
|
|
2265
|
-
name: e.string,
|
|
2266
|
-
/**
|
|
2267
|
-
* Text to display when there are no options.
|
|
2268
|
-
*
|
|
2269
|
-
* For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
|
|
2270
|
-
* @default 'No options'
|
|
2271
|
-
*/
|
|
2272
|
-
noOptionsText: e.node,
|
|
2273
|
-
/**
|
|
2274
|
-
* Callback fired when the value changes.
|
|
2275
|
-
*
|
|
2276
|
-
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
2277
|
-
* @param {Value|Value[]} value The new value of the component.
|
|
2278
|
-
* @param {string} reason One of "createOption", "selectOption", "removeOption", "blur" or "clear".
|
|
2279
|
-
* @param {string} [details]
|
|
2280
|
-
*/
|
|
2281
|
-
onChange: e.func,
|
|
2282
|
-
/**
|
|
2283
|
-
* Callback fired when the popup requests to be closed.
|
|
2284
|
-
* Use in controlled mode (see open).
|
|
2285
|
-
*
|
|
2286
|
-
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
2287
|
-
* @param {string} reason Can be: `"toggleInput"`, `"escape"`, `"selectOption"`, `"removeOption"`, `"blur"`.
|
|
2288
|
-
*/
|
|
2289
|
-
onClose: e.func,
|
|
2290
|
-
/**
|
|
2291
|
-
* Callback fired when the highlight option changes.
|
|
2292
|
-
*
|
|
2293
|
-
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
2294
|
-
* @param {Value} option The highlighted option.
|
|
2295
|
-
* @param {string} reason Can be: `"keyboard"`, `"auto"`, `"mouse"`, `"touch"`.
|
|
2296
|
-
*/
|
|
2297
|
-
onHighlightChange: e.func,
|
|
2298
|
-
/**
|
|
2299
|
-
* Callback fired when the input value changes.
|
|
2300
|
-
*
|
|
2301
|
-
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
2302
|
-
* @param {string} value The new value of the text input.
|
|
2303
|
-
* @param {string} reason Can be: `"input"` (user input), `"reset"` (programmatic change), `"clear"`.
|
|
2304
|
-
*/
|
|
2305
|
-
onInputChange: e.func,
|
|
2306
|
-
/**
|
|
2307
|
-
* @ignore
|
|
2308
|
-
*/
|
|
2309
|
-
onKeyDown: e.func,
|
|
2310
|
-
/**
|
|
2311
|
-
* Callback fired when the popup requests to be opened.
|
|
2312
|
-
* Use in controlled mode (see open).
|
|
2313
|
-
*
|
|
2314
|
-
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
2315
|
-
*/
|
|
2316
|
-
onOpen: e.func,
|
|
2317
|
-
/**
|
|
2318
|
-
* If `true`, the component is shown.
|
|
2319
|
-
*/
|
|
2320
|
-
open: e.bool,
|
|
2321
|
-
/**
|
|
2322
|
-
* If `true`, the popup will open on input focus.
|
|
2323
|
-
* @default false
|
|
2324
|
-
*/
|
|
2325
|
-
openOnFocus: e.bool,
|
|
2326
|
-
/**
|
|
2327
|
-
* Override the default text for the *open popup* icon button.
|
|
2328
|
-
*
|
|
2329
|
-
* For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).
|
|
2330
|
-
* @default 'Open'
|
|
2331
|
-
*/
|
|
2332
|
-
openText: e.string,
|
|
2333
|
-
/**
|
|
2334
|
-
* Array of options.
|
|
2335
|
-
*/
|
|
2336
|
-
options: e.array.isRequired,
|
|
2337
|
-
/**
|
|
2338
|
-
* The input placeholder
|
|
2339
|
-
*/
|
|
2340
|
-
placeholder: e.string,
|
|
2341
|
-
/**
|
|
2342
|
-
* The icon to display in place of the default popup icon.
|
|
2343
|
-
* @default <ArrowDropDownIcon />
|
|
2344
|
-
*/
|
|
2345
|
-
popupIcon: e.node,
|
|
2346
|
-
/**
|
|
2347
|
-
* If `true`, the component becomes readonly. It is also supported for multiple tags where the tag cannot be deleted.
|
|
2348
|
-
* @default false
|
|
2349
|
-
*/
|
|
2350
|
-
readOnly: e.bool,
|
|
2351
|
-
/**
|
|
2352
|
-
* Render the group.
|
|
2353
|
-
*
|
|
2354
|
-
* @param {AutocompleteRenderGroupParams} params The group to render.
|
|
2355
|
-
* @returns {ReactNode}
|
|
2356
|
-
*/
|
|
2357
|
-
renderGroup: e.func,
|
|
2358
|
-
/**
|
|
2359
|
-
* Render the option, use `getOptionLabel` by default.
|
|
2360
|
-
*
|
|
2361
|
-
* @param {object} props The props to apply on the li element.
|
|
2362
|
-
* @param {T} option The option to render.
|
|
2363
|
-
* @param {object} state The state of the component.
|
|
2364
|
-
* @returns {ReactNode}
|
|
2365
|
-
*/
|
|
2366
|
-
renderOption: e.func,
|
|
2367
|
-
/**
|
|
2368
|
-
* Render the selected value.
|
|
2369
|
-
*
|
|
2370
|
-
* @param {T[]} value The `value` provided to the component.
|
|
2371
|
-
* @param {function} getTagProps A tag props getter.
|
|
2372
|
-
* @param {object} ownerState The state of the Autocomplete component.
|
|
2373
|
-
* @returns {ReactNode}
|
|
2374
|
-
*/
|
|
2375
|
-
renderTags: e.func,
|
|
2376
|
-
/**
|
|
2377
|
-
* If `true`, the `input` element is required.
|
|
2378
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
|
2379
|
-
*/
|
|
2380
|
-
required: e.bool,
|
|
2381
|
-
/**
|
|
2382
|
-
* If `true`, the input's text is selected on focus.
|
|
2383
|
-
* It helps the user clear the selected value.
|
|
2384
|
-
* @default !props.freeSolo
|
|
2385
|
-
*/
|
|
2386
|
-
selectOnFocus: e.bool,
|
|
2387
|
-
/**
|
|
2388
|
-
* The size of the component.
|
|
2389
|
-
* @default 'md'
|
|
2390
|
-
*/
|
|
2391
|
-
size: e.oneOfType([e.oneOf(["sm", "md", "lg"]), e.string]),
|
|
2392
|
-
/**
|
|
2393
|
-
* The props used for each slot inside.
|
|
2394
|
-
* @default {}
|
|
2395
|
-
*/
|
|
2396
|
-
slotProps: e.shape({
|
|
2397
|
-
clearIndicator: e.oneOfType([e.func, e.object]),
|
|
2398
|
-
endDecorator: e.oneOfType([e.func, e.object]),
|
|
2399
|
-
input: e.oneOfType([e.func, e.object]),
|
|
2400
|
-
limitTag: e.oneOfType([e.func, e.object]),
|
|
2401
|
-
listbox: e.oneOfType([e.func, e.object]),
|
|
2402
|
-
loading: e.oneOfType([e.func, e.object]),
|
|
2403
|
-
noOptions: e.oneOfType([e.func, e.object]),
|
|
2404
|
-
option: e.oneOfType([e.func, e.object]),
|
|
2405
|
-
popupIndicator: e.oneOfType([e.func, e.object]),
|
|
2406
|
-
root: e.oneOfType([e.func, e.object]),
|
|
2407
|
-
startDecorator: e.oneOfType([e.func, e.object]),
|
|
2408
|
-
wrapper: e.oneOfType([e.func, e.object])
|
|
2409
|
-
}),
|
|
2410
|
-
/**
|
|
2411
|
-
* The components used for each slot inside.
|
|
2412
|
-
* @default {}
|
|
2413
|
-
*/
|
|
2414
|
-
slots: e.shape({
|
|
2415
|
-
clearIndicator: e.elementType,
|
|
2416
|
-
endDecorator: e.elementType,
|
|
2417
|
-
input: e.elementType,
|
|
2418
|
-
limitTag: e.elementType,
|
|
2419
|
-
listbox: e.elementType,
|
|
2420
|
-
loading: e.elementType,
|
|
2421
|
-
noOptions: e.elementType,
|
|
2422
|
-
option: e.elementType,
|
|
2423
|
-
popupIndicator: e.elementType,
|
|
2424
|
-
root: e.elementType,
|
|
2425
|
-
startDecorator: e.elementType,
|
|
2426
|
-
wrapper: e.elementType
|
|
2427
|
-
}),
|
|
2428
|
-
/**
|
|
2429
|
-
* Leading adornment for this input.
|
|
2430
|
-
*/
|
|
2431
|
-
startDecorator: e.node,
|
|
2432
|
-
/**
|
|
2433
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
2434
|
-
*/
|
|
2435
|
-
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object]),
|
|
2436
|
-
/**
|
|
2437
|
-
* Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
|
|
2438
|
-
*/
|
|
2439
|
-
type: e.string,
|
|
2440
|
-
/**
|
|
2441
|
-
* The value of the autocomplete.
|
|
2442
|
-
*
|
|
2443
|
-
* The value must have reference equality with the option in order to be selected.
|
|
2444
|
-
* You can customize the equality behavior with the `isOptionEqualToValue` prop.
|
|
2445
|
-
*/
|
|
2446
|
-
value: ot(e.any, (o) => o.multiple && o.value !== void 0 && !Array.isArray(o.value) ? new Error(["MUI: The Autocomplete expects the `value` prop to be an array when `multiple={true}` or undefined.", `However, ${o.value} was provided.`].join(`
|
|
2447
|
-
`)) : null),
|
|
2448
|
-
/**
|
|
2449
|
-
* The [global variant](https://mui.com/joy-ui/main-features/global-variants/) to use.
|
|
2450
|
-
* @default 'outlined'
|
|
2451
|
-
*/
|
|
2452
|
-
variant: e.oneOf(["outlined", "plain", "soft", "solid"])
|
|
2453
|
-
});
|
|
2454
|
-
function Cr(o) {
|
|
2455
|
-
return Ze("MuiListItemContent", o);
|
|
2456
|
-
}
|
|
2457
|
-
eo("MuiListItemContent", ["root"]);
|
|
2458
|
-
const xr = ["component", "className", "children", "slots", "slotProps"], Ir = () => Je({
|
|
2459
|
-
root: ["root"]
|
|
2460
|
-
}, Cr, {}), Or = K("div", {
|
|
2461
|
-
name: "JoyListItemContent",
|
|
2462
|
-
slot: "Root",
|
|
2463
|
-
overridesResolver: (o, t) => t.root
|
|
2464
|
-
})({
|
|
2465
|
-
flex: "1 1 auto",
|
|
2466
|
-
minWidth: 0
|
|
2467
|
-
}), Ho = /* @__PURE__ */ C.forwardRef(function(t, l) {
|
|
2468
|
-
const s = qe({
|
|
2469
|
-
props: t,
|
|
2470
|
-
name: "JoyListItemContent"
|
|
2471
|
-
}), {
|
|
2472
|
-
component: f,
|
|
2473
|
-
className: u,
|
|
2474
|
-
children: O,
|
|
2475
|
-
slots: P = {},
|
|
2476
|
-
slotProps: A = {}
|
|
2477
|
-
} = s, y = Ce(s, xr), I = p({}, s), d = Ir(), w = p({}, y, {
|
|
2478
|
-
component: f,
|
|
2479
|
-
slots: P,
|
|
2480
|
-
slotProps: A
|
|
2481
|
-
}), [k, E] = ne("root", {
|
|
2482
|
-
ref: l,
|
|
2483
|
-
className: Qe(d.root, u),
|
|
2484
|
-
elementType: Or,
|
|
2485
|
-
externalForwardedProps: w,
|
|
2486
|
-
ownerState: I
|
|
2487
|
-
});
|
|
2488
|
-
return /* @__PURE__ */ a(k, p({}, E, {
|
|
2489
|
-
children: O
|
|
2490
|
-
}));
|
|
2491
|
-
});
|
|
2492
|
-
process.env.NODE_ENV !== "production" && (Ho.propTypes = {
|
|
2493
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
2494
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
2495
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
2496
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
2497
|
-
/**
|
|
2498
|
-
* The content of the component.
|
|
2499
|
-
*/
|
|
2500
|
-
children: e.node,
|
|
2501
|
-
/**
|
|
2502
|
-
* @ignore
|
|
2503
|
-
*/
|
|
2504
|
-
className: e.string,
|
|
2505
|
-
/**
|
|
2506
|
-
* The component used for the root node.
|
|
2507
|
-
* Either a string to use a HTML element or a component.
|
|
2508
|
-
*/
|
|
2509
|
-
component: e.elementType,
|
|
2510
|
-
/**
|
|
2511
|
-
* The props used for each slot inside.
|
|
2512
|
-
* @default {}
|
|
2513
|
-
*/
|
|
2514
|
-
slotProps: e.shape({
|
|
2515
|
-
root: e.oneOfType([e.func, e.object])
|
|
2516
|
-
}),
|
|
2517
|
-
/**
|
|
2518
|
-
* The components used for each slot inside.
|
|
2519
|
-
* @default {}
|
|
2520
|
-
*/
|
|
2521
|
-
slots: e.shape({
|
|
2522
|
-
root: e.elementType
|
|
2523
|
-
}),
|
|
2524
|
-
/**
|
|
2525
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
2526
|
-
*/
|
|
2527
|
-
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
|
|
2528
|
-
});
|
|
2529
|
-
function Tr(o) {
|
|
2530
|
-
return Ze("MuiListItemDecorator", o);
|
|
2531
|
-
}
|
|
2532
|
-
eo("MuiListItemDecorator", ["root"]);
|
|
2533
|
-
const Lr = ["component", "className", "children", "slots", "slotProps"], Nr = () => Je({
|
|
2534
|
-
root: ["root"]
|
|
2535
|
-
}, Tr, {}), Sr = K("span", {
|
|
2536
|
-
name: "JoyListItemDecorator",
|
|
2537
|
-
slot: "Root",
|
|
2538
|
-
overridesResolver: (o, t) => t.root
|
|
2539
|
-
})(({
|
|
2540
|
-
ownerState: o
|
|
2541
|
-
}) => p({
|
|
2542
|
-
boxSizing: "border-box",
|
|
2543
|
-
display: "inline-flex",
|
|
2544
|
-
alignItems: `var(--unstable_ListItemDecorator-alignItems, ${o.parentOrientation === "horizontal" ? "center" : "initial"})`
|
|
2545
|
-
}, o.parentOrientation === "horizontal" ? {
|
|
2546
|
-
minInlineSize: "var(--ListItemDecorator-size)",
|
|
2547
|
-
marginInlineEnd: "calc(-1 * var(--ListItem-gap))"
|
|
2548
|
-
} : {
|
|
2549
|
-
minBlockSize: "var(--ListItemDecorator-size)",
|
|
2550
|
-
justifyContent: "center",
|
|
2551
|
-
marginBlockEnd: "calc(-1 * var(--ListItem-gap))"
|
|
2552
|
-
})), Vo = /* @__PURE__ */ C.forwardRef(function(t, l) {
|
|
2553
|
-
const s = qe({
|
|
2554
|
-
props: t,
|
|
2555
|
-
name: "JoyListItemDecorator"
|
|
2556
|
-
}), {
|
|
2557
|
-
component: f,
|
|
2558
|
-
className: u,
|
|
2559
|
-
children: O,
|
|
2560
|
-
slots: P = {},
|
|
2561
|
-
slotProps: A = {}
|
|
2562
|
-
} = s, y = Ce(s, Lr), I = C.useContext(rn), d = p({
|
|
2563
|
-
parentOrientation: I
|
|
2564
|
-
}, s), w = Nr(), k = p({}, y, {
|
|
2565
|
-
component: f,
|
|
2566
|
-
slots: P,
|
|
2567
|
-
slotProps: A
|
|
2568
|
-
}), [E, g] = ne("root", {
|
|
2569
|
-
ref: l,
|
|
2570
|
-
className: Qe(w.root, u),
|
|
2571
|
-
elementType: Sr,
|
|
2572
|
-
externalForwardedProps: k,
|
|
2573
|
-
ownerState: d
|
|
2574
|
-
});
|
|
2575
|
-
return /* @__PURE__ */ a(E, p({}, g, {
|
|
2576
|
-
children: O
|
|
2577
|
-
}));
|
|
2578
|
-
});
|
|
2579
|
-
process.env.NODE_ENV !== "production" && (Vo.propTypes = {
|
|
2580
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
2581
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
2582
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
2583
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
2584
|
-
/**
|
|
2585
|
-
* The content of the component.
|
|
2586
|
-
*/
|
|
2587
|
-
children: e.node,
|
|
2588
|
-
/**
|
|
2589
|
-
* @ignore
|
|
2590
|
-
*/
|
|
2591
|
-
className: e.string,
|
|
2592
|
-
/**
|
|
2593
|
-
* The component used for the root node.
|
|
2594
|
-
* Either a string to use a HTML element or a component.
|
|
2595
|
-
*/
|
|
2596
|
-
component: e.elementType,
|
|
2597
|
-
/**
|
|
2598
|
-
* The props used for each slot inside.
|
|
2599
|
-
* @default {}
|
|
2600
|
-
*/
|
|
2601
|
-
slotProps: e.shape({
|
|
2602
|
-
root: e.oneOfType([e.func, e.object])
|
|
2603
|
-
}),
|
|
2604
|
-
/**
|
|
2605
|
-
* The components used for each slot inside.
|
|
2606
|
-
* @default {}
|
|
2607
|
-
*/
|
|
2608
|
-
slots: e.shape({
|
|
2609
|
-
root: e.elementType
|
|
2610
|
-
}),
|
|
2611
|
-
/**
|
|
2612
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
2613
|
-
*/
|
|
2614
|
-
sx: e.oneOfType([e.arrayOf(e.oneOfType([e.func, e.object, e.bool])), e.func, e.object])
|
|
2615
|
-
});
|
|
2616
|
-
function Pr(o) {
|
|
2617
|
-
const {
|
|
2618
|
-
sdk: t,
|
|
2619
|
-
fields: l = ["fullName", "email"],
|
|
2620
|
-
campaignId: s = "",
|
|
2621
|
-
campaignName: f = "",
|
|
2622
|
-
contentType: u = "",
|
|
2623
|
-
contentId: O = "",
|
|
2624
|
-
contentName: P = "",
|
|
2625
|
-
syncWithProfile: A = !1
|
|
2626
|
-
} = o, { leadPhoneCountryCode: y, language: I } = at(ct), [d, w] = Xe({
|
|
2627
|
-
firstName: "",
|
|
2628
|
-
lastName: "",
|
|
2629
|
-
fullName: "",
|
|
2630
|
-
email: "",
|
|
2631
|
-
gender: "",
|
|
2632
|
-
country: "",
|
|
2633
|
-
phoneCountryCode: y ? Go(y) : Yo(I || "en"),
|
|
2634
|
-
phoneNumber: "",
|
|
2635
|
-
customFields: {}
|
|
2636
|
-
});
|
|
2637
|
-
kt(() => {
|
|
2638
|
-
const L = y ? Go(y) : Yo(I || "en");
|
|
2639
|
-
w((D) => !D.phoneNumber || !D.phoneCountryCode ? { ...D, phoneCountryCode: L } : D);
|
|
2640
|
-
}, [y, I]);
|
|
2641
|
-
const [k, E] = Xe({}), [g, i] = Xe(!1), [H, V] = Xe(!1), [B, J] = Xe(null), Ie = () => J(null), j = (L) => (D) => {
|
|
2642
|
-
w((F) => ({
|
|
2643
|
-
...F,
|
|
2644
|
-
[L]: D.target.value
|
|
2645
|
-
}));
|
|
2646
|
-
}, be = (L) => (D) => {
|
|
2647
|
-
const F = D.target.value;
|
|
2648
|
-
E((z) => ({ ...z, [L]: F }));
|
|
2649
|
-
}, ie = (L, D) => {
|
|
2650
|
-
w((F) => ({
|
|
2651
|
-
...F,
|
|
2652
|
-
phoneCountryCode: D
|
|
2653
|
-
}));
|
|
2654
|
-
}, fe = (L, D) => {
|
|
2655
|
-
w((F) => ({
|
|
2656
|
-
...F,
|
|
2657
|
-
country: (D == null ? void 0 : D.code) || ""
|
|
2658
|
-
}));
|
|
2659
|
-
}, Oe = (L, D) => {
|
|
2660
|
-
w((F) => ({
|
|
2661
|
-
...F,
|
|
2662
|
-
gender: D || ""
|
|
2663
|
-
}));
|
|
2664
|
-
}, Q = async () => {
|
|
2665
|
-
if (A)
|
|
2666
|
-
try {
|
|
2667
|
-
const L = t.profile.getOwn();
|
|
2668
|
-
if (d.fullName && l.includes("fullName") ? L.setName(d.fullName.trim()) : d.firstName && l.includes("firstName") && d.lastName && l.includes("lastName") ? L.setName(
|
|
2669
|
-
d.firstName.trim() + " " + d.lastName.trim()
|
|
2670
|
-
) : d.firstName && l.includes("firstName") ? L.setName(d.firstName.trim()) : d.lastName && l.includes("lastName") && L.setName(d.lastName.trim()), d.email && l.includes("email") && L.setEmail(d.email.trim()), d.gender && l.includes("gender") && L.setGender(d.gender), d.country && l.includes("country")) {
|
|
2671
|
-
const D = await t.profile.getCountries(), F = At(d.country), z = D.find((R) => R.name === (F == null ? void 0 : F.label));
|
|
2672
|
-
z && L.setCountry(z.id);
|
|
2673
|
-
}
|
|
2674
|
-
d.phoneCountryCode && l.includes("phoneCountryCode") && L.setPhoneCountryCode(
|
|
2675
|
-
"+" + d.phoneCountryCode.phone
|
|
2676
|
-
), d.phoneNumber && l.includes("phoneNumber") && L.setPhoneNumber(d.phoneNumber.trim()), await L.update();
|
|
2677
|
-
} catch (L) {
|
|
2678
|
-
console.warn("[LeadForm] Failed to sync profile data:", L);
|
|
2679
|
-
}
|
|
2680
|
-
};
|
|
2681
|
-
return {
|
|
2682
|
-
formData: d,
|
|
2683
|
-
setFormData: w,
|
|
2684
|
-
isLoading: g,
|
|
2685
|
-
isSuccess: H,
|
|
2686
|
-
error: B,
|
|
2687
|
-
clearError: Ie,
|
|
2688
|
-
handleInputChange: j,
|
|
2689
|
-
handleCustomFieldChange: be,
|
|
2690
|
-
customFieldsData: k,
|
|
2691
|
-
handlePhoneCountryChange: ie,
|
|
2692
|
-
handleCountryChange: fe,
|
|
2693
|
-
handleGenderChange: Oe,
|
|
2694
|
-
handleSubmit: async (L) => {
|
|
2695
|
-
var R;
|
|
2696
|
-
L && L.preventDefault(), J(null);
|
|
2697
|
-
const D = {
|
|
2698
|
-
firstName: d.firstName,
|
|
2699
|
-
lastName: d.lastName,
|
|
2700
|
-
fullName: d.fullName,
|
|
2701
|
-
email: d.email,
|
|
2702
|
-
gender: d.gender,
|
|
2703
|
-
country: d.country,
|
|
2704
|
-
phoneCountryCode: "+" + (((R = d.phoneCountryCode) == null ? void 0 : R.phone) ?? ""),
|
|
2705
|
-
phoneNumber: d.phoneNumber,
|
|
2706
|
-
campaignId: s,
|
|
2707
|
-
campaignName: f,
|
|
2708
|
-
contentType: u,
|
|
2709
|
-
contentId: O,
|
|
2710
|
-
contentName: P,
|
|
2711
|
-
customFields: k
|
|
2712
|
-
}, F = [
|
|
2713
|
-
"firstName",
|
|
2714
|
-
"lastName",
|
|
2715
|
-
"fullName",
|
|
2716
|
-
"email",
|
|
2717
|
-
"gender",
|
|
2718
|
-
"country",
|
|
2719
|
-
"phoneCountryCode",
|
|
2720
|
-
"phoneNumber",
|
|
2721
|
-
"customFields"
|
|
2722
|
-
], z = Object.fromEntries(
|
|
2723
|
-
Object.entries(D).map(([G, de]) => F.includes(G) ? G === "customFields" ? [G, de] : l.includes(G) && de !== "" && de !== null ? [G, de] : [G, null] : [G, de])
|
|
2724
|
-
);
|
|
2725
|
-
i(!0);
|
|
2726
|
-
try {
|
|
2727
|
-
await t.profile.collectLead(z), await Q(), V(!0);
|
|
2728
|
-
} catch {
|
|
2729
|
-
J("leads.form.error");
|
|
2730
|
-
} finally {
|
|
2731
|
-
i(!1);
|
|
2732
|
-
}
|
|
2733
|
-
},
|
|
2734
|
-
countries: Dt
|
|
2735
|
-
};
|
|
2736
|
-
}
|
|
2737
|
-
const kr = (o) => {
|
|
2738
|
-
const t = ut(), { t: l } = dt();
|
|
2739
|
-
if (!o.brandingUrls)
|
|
2740
|
-
return /* @__PURE__ */ a(We, {});
|
|
2741
|
-
const { privacyPolicyUrl: s, termsAndConditionsUrl: f } = o.brandingUrls;
|
|
2742
|
-
if (!s && !f)
|
|
2743
|
-
return /* @__PURE__ */ a(We, {});
|
|
2744
|
-
const u = () => s && !f ? /* @__PURE__ */ q(ao, { children: [
|
|
2745
|
-
l("common.labels.iAgreeToThe"),
|
|
2746
|
-
" ",
|
|
2747
|
-
/* @__PURE__ */ a(
|
|
2748
|
-
vo,
|
|
2749
|
-
{
|
|
2750
|
-
href: s,
|
|
2751
|
-
target: "_blank",
|
|
2752
|
-
rel: "noopener noreferrer",
|
|
2753
|
-
sx: {
|
|
2754
|
-
color: o.primaryColor,
|
|
2755
|
-
textDecorationColor: o.primaryColor
|
|
2756
|
-
},
|
|
2757
|
-
children: l("leads.form.privacyPolicy")
|
|
2758
|
-
}
|
|
2759
|
-
)
|
|
2760
|
-
] }) : !s && f ? /* @__PURE__ */ q(ao, { children: [
|
|
2761
|
-
l("common.labels.iAgreeToThe"),
|
|
2762
|
-
" ",
|
|
2763
|
-
/* @__PURE__ */ a(
|
|
2764
|
-
vo,
|
|
2765
|
-
{
|
|
2766
|
-
href: f,
|
|
2767
|
-
target: "_blank",
|
|
2768
|
-
rel: "noopener noreferrer",
|
|
2769
|
-
sx: {
|
|
2770
|
-
color: o.primaryColor,
|
|
2771
|
-
textDecorationColor: o.primaryColor
|
|
2772
|
-
},
|
|
2773
|
-
children: l("leads.form.termsAndConditions")
|
|
2774
|
-
}
|
|
2775
|
-
)
|
|
2776
|
-
] }) : /* @__PURE__ */ q(ao, { children: [
|
|
2777
|
-
l("common.labels.iAgreeToThe"),
|
|
2778
|
-
" ",
|
|
2779
|
-
/* @__PURE__ */ a(
|
|
2780
|
-
vo,
|
|
2781
|
-
{
|
|
2782
|
-
href: s,
|
|
2783
|
-
target: "_blank",
|
|
2784
|
-
rel: "noopener noreferrer",
|
|
2785
|
-
sx: {
|
|
2786
|
-
color: o.primaryColor,
|
|
2787
|
-
textDecorationColor: o.primaryColor
|
|
2788
|
-
},
|
|
2789
|
-
children: l("leads.form.privacyPolicy")
|
|
2790
|
-
}
|
|
2791
|
-
),
|
|
2792
|
-
" ",
|
|
2793
|
-
l("common.labels.andThe"),
|
|
2794
|
-
" ",
|
|
2795
|
-
/* @__PURE__ */ a(
|
|
2796
|
-
vo,
|
|
2797
|
-
{
|
|
2798
|
-
href: f,
|
|
2799
|
-
target: "_blank",
|
|
2800
|
-
rel: "noopener noreferrer",
|
|
2801
|
-
sx: {
|
|
2802
|
-
color: o.primaryColor,
|
|
2803
|
-
textDecorationColor: o.primaryColor
|
|
2804
|
-
},
|
|
2805
|
-
children: l("leads.form.termsAndConditions")
|
|
2806
|
-
}
|
|
2807
|
-
)
|
|
2808
|
-
] });
|
|
2809
|
-
return /* @__PURE__ */ a(_e, { required: !0, disabled: o.isDisabled, size: "sm", children: /* @__PURE__ */ q(Io, { sx: { display: "inline-flex", alignItems: "center", gap: "8px" }, children: [
|
|
2810
|
-
/* @__PURE__ */ a(
|
|
2811
|
-
_t,
|
|
2812
|
-
{
|
|
2813
|
-
slotProps: {
|
|
2814
|
-
input: {
|
|
2815
|
-
sx: {}
|
|
2816
|
-
},
|
|
2817
|
-
checkbox: {
|
|
2818
|
-
sx: {
|
|
2819
|
-
"&.Mui-checked": {
|
|
2820
|
-
bgcolor: o.primaryColor,
|
|
2821
|
-
"--Icon-color": "#FFF"
|
|
2822
|
-
},
|
|
2823
|
-
"&:not(.Mui-checked):not(.Mui-disabled):hover": {
|
|
2824
|
-
bgcolor: t.colorSchemes.light.palette.neutral.outlinedHoverBg
|
|
2825
|
-
},
|
|
2826
|
-
bgcolor: t.colorSchemes.light.palette.background.surface
|
|
2827
|
-
}
|
|
2828
|
-
}
|
|
2829
|
-
}
|
|
2830
|
-
}
|
|
2831
|
-
),
|
|
2832
|
-
u()
|
|
2833
|
-
] }) });
|
|
2834
|
-
}, Dr = [
|
|
2835
|
-
"fullName",
|
|
2836
|
-
"firstName",
|
|
2837
|
-
"lastName",
|
|
2838
|
-
"email",
|
|
2839
|
-
"gender",
|
|
2840
|
-
"country",
|
|
2841
|
-
"phoneCountryCode",
|
|
2842
|
-
"phoneNumber"
|
|
2843
|
-
], Be = {
|
|
2844
|
-
phoneContainer: { display: "flex", gap: 1 },
|
|
2845
|
-
countrySelect: { width: "45%" },
|
|
2846
|
-
phoneInput: { width: "100%" },
|
|
2847
|
-
listItemContent: { fontSize: "sm" },
|
|
2848
|
-
submitButton: { mt: 2 }
|
|
2849
|
-
}, Ar = (o) => {
|
|
2850
|
-
var me, ze, Te, ro, Le, ce;
|
|
2851
|
-
const [t, l] = Xe(() => $t(o.consents || [])), [s, f] = Xe(!1), {
|
|
2852
|
-
sdk: u,
|
|
2853
|
-
brandingColors: O,
|
|
2854
|
-
brandingUrls: P,
|
|
2855
|
-
fields: A = ["fullName", "email"],
|
|
2856
|
-
campaignId: y = "",
|
|
2857
|
-
campaignName: I = "",
|
|
2858
|
-
contentType: d = "",
|
|
2859
|
-
contentId: w = "",
|
|
2860
|
-
contentName: k = "",
|
|
2861
|
-
formCustomFields: E,
|
|
2862
|
-
onSuccessCta: g,
|
|
2863
|
-
labels: i,
|
|
2864
|
-
syncWithProfile: H = !1,
|
|
2865
|
-
isSubmittingParticipation: V = !1
|
|
2866
|
-
} = o, B = A.map((x) => x && x.trim()).filter((x) => Dr.includes(x)), {
|
|
2867
|
-
formData: J,
|
|
2868
|
-
isLoading: Ie,
|
|
2869
|
-
isSuccess: j,
|
|
2870
|
-
error: be,
|
|
2871
|
-
handleInputChange: ie,
|
|
2872
|
-
handleCustomFieldChange: fe,
|
|
2873
|
-
customFieldsData: Oe,
|
|
2874
|
-
handlePhoneCountryChange: Q,
|
|
2875
|
-
handleCountryChange: T,
|
|
2876
|
-
handleGenderChange: L,
|
|
2877
|
-
handleSubmit: D,
|
|
2878
|
-
countries: F
|
|
2879
|
-
} = Pr({
|
|
2880
|
-
sdk: u,
|
|
2881
|
-
fields: B,
|
|
2882
|
-
campaignId: y,
|
|
2883
|
-
campaignName: I,
|
|
2884
|
-
contentType: d,
|
|
2885
|
-
contentId: w,
|
|
2886
|
-
contentName: k,
|
|
2887
|
-
syncWithProfile: H
|
|
2888
|
-
}), { shadowRootElement: z } = at(ct), { t: R } = dt(), G = ut(), de = pt(), Ae = Pt(), le = mt().primary, Ke = de.textPrimary, ge = (O == null ? void 0 : O.primaryColor) || ((ze = (me = de.palette) == null ? void 0 : me.primary) == null ? void 0 : ze.plainColor), U = (ro = (Te = de.palette) == null ? void 0 : Te.primary) == null ? void 0 : ro.onPrimary, Z = (O == null ? void 0 : O.primaryColor) || ((ce = (Le = de.palette) == null ? void 0 : Le.primary) == null ? void 0 : ce.primaryContainer), we = Ae.sm, b = {
|
|
2889
|
-
background: {
|
|
2890
|
-
surface: G.colorSchemes.light.palette.background.surface,
|
|
2891
|
-
popup: G.colorSchemes.light.palette.background.popup
|
|
2892
|
-
},
|
|
2893
|
-
neutral: {
|
|
2894
|
-
outlinedBorder: G.colorSchemes.light.palette.neutral.outlinedBorder,
|
|
2895
|
-
outlinedColor: G.colorSchemes.light.palette.neutral.outlinedColor,
|
|
2896
|
-
outlinedHoverBg: G.colorSchemes.light.palette.neutral.outlinedHoverBg,
|
|
2897
|
-
plainActiveBg: G.colorSchemes.light.palette.neutral.plainActiveBg,
|
|
2898
|
-
plainHoverBg: G.colorSchemes.light.palette.neutral.plainHoverBg,
|
|
2899
|
-
plainHoverColor: G.colorSchemes.light.palette.neutral.plainHoverColor
|
|
2900
|
-
}
|
|
2901
|
-
}, W = [
|
|
2902
|
-
{ value: "male", label: R("leads.form.genderOptions.male") },
|
|
2903
|
-
{ value: "female", label: R("leads.form.genderOptions.female") },
|
|
2904
|
-
{ value: "other", label: R("leads.form.genderOptions.other") },
|
|
2905
|
-
{ value: "prefer_not_to_say", label: R("leads.form.genderOptions.notSay") }
|
|
2906
|
-
], X = {
|
|
2907
|
-
color: `${Ke} !important`,
|
|
2908
|
-
fontSize: "0.875em"
|
|
2909
|
-
}, Y = {
|
|
2910
|
-
fontFamily: le,
|
|
2911
|
-
borderRadius: we,
|
|
2912
|
-
bgcolor: b.background.surface,
|
|
2913
|
-
borderColor: b.neutral.outlinedBorder,
|
|
2914
|
-
color: b.neutral.outlinedColor,
|
|
2915
|
-
fontSize: "1em",
|
|
2916
|
-
lineHeight: "2.25em",
|
|
2917
|
-
"&:hover": {
|
|
2918
|
-
bgcolor: b.neutral.outlinedHoverBg
|
|
2919
|
-
},
|
|
2920
|
-
"&.Mui-disabled": {
|
|
2921
|
-
borderColor: b.neutral.outlinedBorder
|
|
2922
|
-
},
|
|
2923
|
-
"& input:-webkit-autofill": {
|
|
2924
|
-
WebkitBoxShadow: `0 0 0 1000px ${b.background.surface} inset !important`,
|
|
2925
|
-
WebkitTextFillColor: `${b.neutral.outlinedColor} !important`,
|
|
2926
|
-
caretColor: b.neutral.outlinedColor,
|
|
2927
|
-
borderRadius: we
|
|
2928
|
-
},
|
|
2929
|
-
"& input:-webkit-autofill:hover": {
|
|
2930
|
-
WebkitBoxShadow: `0 0 0 1000px ${b.background.surface} inset !important`,
|
|
2931
|
-
WebkitTextFillColor: `${b.neutral.outlinedColor} !important`
|
|
2932
|
-
},
|
|
2933
|
-
"& input:-webkit-autofill:focus": {
|
|
2934
|
-
WebkitBoxShadow: `0 0 0 1000px ${b.background.surface} inset !important`,
|
|
2935
|
-
WebkitTextFillColor: `${b.neutral.outlinedColor} !important`
|
|
2936
|
-
},
|
|
2937
|
-
"& input:-webkit-autofill:active": {
|
|
2938
|
-
WebkitBoxShadow: `0 0 0 1000px ${b.background.surface} inset !important`,
|
|
2939
|
-
WebkitTextFillColor: `${b.neutral.outlinedColor} !important`
|
|
2940
|
-
},
|
|
2941
|
-
"& input:-moz-autofill": {
|
|
2942
|
-
backgroundColor: `${b.background.surface} !important`,
|
|
2943
|
-
color: `${b.neutral.outlinedColor} !important`
|
|
2944
|
-
},
|
|
2945
|
-
"& input:autofill": {
|
|
2946
|
-
backgroundColor: `${b.background.surface} !important`,
|
|
2947
|
-
color: `${b.neutral.outlinedColor} !important`
|
|
2948
|
-
}
|
|
2949
|
-
}, $e = {
|
|
2950
|
-
root: {
|
|
2951
|
-
sx: {
|
|
2952
|
-
...Y,
|
|
2953
|
-
"&:hover": { bgcolor: b.neutral.outlinedHoverBg }
|
|
2954
|
-
}
|
|
2955
|
-
},
|
|
2956
|
-
listbox: {
|
|
2957
|
-
container: z,
|
|
2958
|
-
sx: {
|
|
2959
|
-
zIndex: 10,
|
|
2960
|
-
bgcolor: b.background.popup,
|
|
2961
|
-
border: `1px solid ${b.neutral.outlinedBorder}`,
|
|
2962
|
-
borderRadius: we,
|
|
2963
|
-
boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)"
|
|
2964
|
-
}
|
|
2965
|
-
}
|
|
2966
|
-
}, ae = {
|
|
2967
|
-
fontFamily: le,
|
|
2968
|
-
color: `${b.neutral.outlinedColor} !important`,
|
|
2969
|
-
bgcolor: "transparent",
|
|
2970
|
-
"&:hover": {
|
|
2971
|
-
bgcolor: `${b.neutral.plainHoverBg} !important`,
|
|
2972
|
-
color: `${b.neutral.plainHoverColor} !important`
|
|
2973
|
-
},
|
|
2974
|
-
"&.Mui-selected": {
|
|
2975
|
-
bgcolor: `${b.neutral.plainActiveBg} !important`,
|
|
2976
|
-
color: `${b.neutral.outlinedColor} !important`
|
|
2977
|
-
},
|
|
2978
|
-
"&.Mui-selected:hover": {
|
|
2979
|
-
bgcolor: `${b.neutral.plainActiveBg} !important`,
|
|
2980
|
-
color: `${b.neutral.outlinedColor} !important`
|
|
2981
|
-
}
|
|
2982
|
-
}, Ge = (i == null ? void 0 : i.fullNameLabel) || R("leads.form.fullName"), oo = (i == null ? void 0 : i.fullNamePlaceholder) || R("leads.form.fullNamePlaceholder"), $ = (i == null ? void 0 : i.firstNameLabel) || R("leads.form.firstName"), m = (i == null ? void 0 : i.firstNamePlaceholder) || R("leads.form.firstNamePlaceholder"), Pe = (i == null ? void 0 : i.lastNameLabel) || R("leads.form.lastName"), N = (i == null ? void 0 : i.lastNamePlaceholder) || R("leads.form.lastNamePlaceholder"), ve = (i == null ? void 0 : i.emailLabel) || R("leads.form.email"), Re = (i == null ? void 0 : i.genderLabel) || R("leads.form.gender"), Ye = (i == null ? void 0 : i.genderPlaceholder) || R("leads.form.genderPlaceholder"), Fe = (i == null ? void 0 : i.countryLabel) || R("leads.form.country"), ke = (i == null ? void 0 : i.countryPlaceholder) || R("leads.form.countryPlaceholder"), to = (i == null ? void 0 : i.phoneNumberLabel) || R("leads.form.phone"), co = (i == null ? void 0 : i.phoneNumberPlaceholder) || R("leads.form.phonePlaceholder"), no = Xo(
|
|
2983
|
-
o.consents || [],
|
|
2984
|
-
t
|
|
2985
|
-
), Ee = (x) => {
|
|
2986
|
-
l(x), Xo(o.consents || [], x) && f(!1);
|
|
2987
|
-
}, pe = async (x) => {
|
|
2988
|
-
if (!no) {
|
|
2989
|
-
x == null || x.preventDefault(), f(!0);
|
|
2990
|
-
return;
|
|
2991
|
-
}
|
|
2992
|
-
await D(x), await Et(
|
|
2993
|
-
u,
|
|
2994
|
-
o.consents || [],
|
|
2995
|
-
Bt(t),
|
|
2996
|
-
{
|
|
2997
|
-
entityId: w || void 0,
|
|
2998
|
-
entityType: wt(d)
|
|
2999
|
-
},
|
|
3000
|
-
i
|
|
3001
|
-
);
|
|
3002
|
-
}, _ = () => g != null && g.component ? g.component : g != null && g.onClick ? /* @__PURE__ */ a(
|
|
3003
|
-
Eo,
|
|
3004
|
-
{
|
|
3005
|
-
size: "lg",
|
|
3006
|
-
loading: V,
|
|
3007
|
-
sx: {
|
|
3008
|
-
...Be.submitButton,
|
|
3009
|
-
bgcolor: ge,
|
|
3010
|
-
color: U,
|
|
3011
|
-
":hover": {
|
|
3012
|
-
bgcolor: Z,
|
|
3013
|
-
color: U
|
|
3014
|
-
},
|
|
3015
|
-
fontSize: "1em",
|
|
3016
|
-
...V ? Qo(ge, U) : {}
|
|
3017
|
-
},
|
|
3018
|
-
onClick: g.onClick,
|
|
3019
|
-
children: g.defaultLabel
|
|
3020
|
-
}
|
|
3021
|
-
) : g != null && g.url ? typeof window > "u" ? /* @__PURE__ */ a(
|
|
3022
|
-
Io,
|
|
3023
|
-
{
|
|
3024
|
-
component: "a",
|
|
3025
|
-
href: g.url,
|
|
3026
|
-
target: (g == null ? void 0 : g.target) || "_self",
|
|
3027
|
-
sx: {
|
|
3028
|
-
...Be.submitButton,
|
|
3029
|
-
bgcolor: ge,
|
|
3030
|
-
color: U,
|
|
3031
|
-
":hover": {
|
|
3032
|
-
bgcolor: Z,
|
|
3033
|
-
color: U
|
|
3034
|
-
},
|
|
3035
|
-
fontSize: "1em",
|
|
3036
|
-
textDecoration: "none",
|
|
3037
|
-
display: "inline-flex",
|
|
3038
|
-
alignItems: "center",
|
|
3039
|
-
justifyContent: "center"
|
|
3040
|
-
},
|
|
3041
|
-
children: g.defaultLabel
|
|
3042
|
-
}
|
|
3043
|
-
) : /* @__PURE__ */ a(
|
|
3044
|
-
Eo,
|
|
3045
|
-
{
|
|
3046
|
-
size: "lg",
|
|
3047
|
-
sx: {
|
|
3048
|
-
...Be.submitButton,
|
|
3049
|
-
bgcolor: ge,
|
|
3050
|
-
color: U,
|
|
3051
|
-
":hover": {
|
|
3052
|
-
bgcolor: Z,
|
|
3053
|
-
color: U
|
|
3054
|
-
},
|
|
3055
|
-
fontSize: "1em"
|
|
3056
|
-
},
|
|
3057
|
-
onClick: () => {
|
|
3058
|
-
(g == null ? void 0 : g.target) === "_blank" ? window.open(g == null ? void 0 : g.url, "_blank") : window.location.href = g == null ? void 0 : g.url;
|
|
3059
|
-
},
|
|
3060
|
-
children: g.defaultLabel
|
|
3061
|
-
}
|
|
3062
|
-
) : /* @__PURE__ */ a(We, {});
|
|
3063
|
-
return /* @__PURE__ */ a("form", { onSubmit: pe, children: /* @__PURE__ */ q(gt, { spacing: 2, sx: { fontFamily: le }, children: [
|
|
3064
|
-
B.includes("fullName") && /* @__PURE__ */ q(_e, { required: !0, disabled: j, children: [
|
|
3065
|
-
/* @__PURE__ */ a(je, { sx: X, children: Ge }),
|
|
3066
|
-
/* @__PURE__ */ a(
|
|
3067
|
-
so,
|
|
3068
|
-
{
|
|
3069
|
-
value: J.fullName,
|
|
3070
|
-
onChange: ie("fullName"),
|
|
3071
|
-
placeholder: oo,
|
|
3072
|
-
sx: Y
|
|
3073
|
-
}
|
|
3074
|
-
)
|
|
3075
|
-
] }),
|
|
3076
|
-
B.includes("firstName") && /* @__PURE__ */ q(_e, { required: !0, disabled: j, children: [
|
|
3077
|
-
/* @__PURE__ */ a(je, { sx: X, children: $ }),
|
|
3078
|
-
/* @__PURE__ */ a(
|
|
3079
|
-
so,
|
|
3080
|
-
{
|
|
3081
|
-
value: J.firstName,
|
|
3082
|
-
onChange: ie("firstName"),
|
|
3083
|
-
placeholder: m,
|
|
3084
|
-
sx: Y
|
|
3085
|
-
}
|
|
3086
|
-
)
|
|
3087
|
-
] }),
|
|
3088
|
-
B.includes("lastName") && /* @__PURE__ */ q(_e, { required: !0, disabled: j, children: [
|
|
3089
|
-
/* @__PURE__ */ a(je, { sx: X, children: Pe }),
|
|
3090
|
-
/* @__PURE__ */ a(
|
|
3091
|
-
so,
|
|
3092
|
-
{
|
|
3093
|
-
value: J.lastName,
|
|
3094
|
-
onChange: ie("lastName"),
|
|
3095
|
-
placeholder: N,
|
|
3096
|
-
sx: Y
|
|
3097
|
-
}
|
|
3098
|
-
)
|
|
3099
|
-
] }),
|
|
3100
|
-
B.includes("email") && /* @__PURE__ */ q(_e, { required: !0, disabled: j, children: [
|
|
3101
|
-
/* @__PURE__ */ a(je, { sx: X, children: ve }),
|
|
3102
|
-
/* @__PURE__ */ a(
|
|
3103
|
-
so,
|
|
3104
|
-
{
|
|
3105
|
-
type: "email",
|
|
3106
|
-
value: J.email,
|
|
3107
|
-
onChange: ie("email"),
|
|
3108
|
-
placeholder: "your.email@example.com",
|
|
3109
|
-
sx: Y
|
|
3110
|
-
}
|
|
3111
|
-
)
|
|
3112
|
-
] }),
|
|
3113
|
-
B.includes("gender") && /* @__PURE__ */ q(_e, { required: !0, disabled: j, children: [
|
|
3114
|
-
/* @__PURE__ */ a(je, { sx: X, children: Re }),
|
|
3115
|
-
/* @__PURE__ */ a(
|
|
3116
|
-
Ut,
|
|
3117
|
-
{
|
|
3118
|
-
value: J.gender,
|
|
3119
|
-
onChange: L,
|
|
3120
|
-
placeholder: Ye,
|
|
3121
|
-
slotProps: $e,
|
|
3122
|
-
children: W.map((x) => /* @__PURE__ */ a(
|
|
3123
|
-
Wt,
|
|
3124
|
-
{
|
|
3125
|
-
value: x.value,
|
|
3126
|
-
sx: ae,
|
|
3127
|
-
children: x.label
|
|
3128
|
-
},
|
|
3129
|
-
x.value
|
|
3130
|
-
))
|
|
3131
|
-
}
|
|
3132
|
-
)
|
|
3133
|
-
] }),
|
|
3134
|
-
B.includes("country") && /* @__PURE__ */ q(_e, { required: !0, disabled: j, children: [
|
|
3135
|
-
/* @__PURE__ */ a(je, { sx: X, children: Fe }),
|
|
3136
|
-
/* @__PURE__ */ a(
|
|
3137
|
-
Mo,
|
|
3138
|
-
{
|
|
3139
|
-
value: F.find((x) => x.code === J.country) || null,
|
|
3140
|
-
onChange: T,
|
|
3141
|
-
slotProps: {
|
|
3142
|
-
input: { autoComplete: "new-country" },
|
|
3143
|
-
listbox: $e.listbox,
|
|
3144
|
-
root: $e.root,
|
|
3145
|
-
clearIndicator: {
|
|
3146
|
-
sx: {
|
|
3147
|
-
"&:hover": {
|
|
3148
|
-
bgcolor: b.neutral.plainHoverBg,
|
|
3149
|
-
color: b.neutral.plainHoverColor
|
|
3150
|
-
}
|
|
3151
|
-
}
|
|
3152
|
-
},
|
|
3153
|
-
popupIndicator: {
|
|
3154
|
-
sx: {
|
|
3155
|
-
"&:hover": {
|
|
3156
|
-
bgcolor: b.neutral.plainHoverBg,
|
|
3157
|
-
color: b.neutral.plainHoverColor
|
|
3158
|
-
}
|
|
3159
|
-
}
|
|
3160
|
-
}
|
|
3161
|
-
},
|
|
3162
|
-
options: F,
|
|
3163
|
-
autoHighlight: !0,
|
|
3164
|
-
getOptionLabel: (x) => x.label,
|
|
3165
|
-
placeholder: ke,
|
|
3166
|
-
renderOption: (x, ee) => /* @__PURE__ */ Ko(
|
|
3167
|
-
zo,
|
|
3168
|
-
{
|
|
3169
|
-
...x,
|
|
3170
|
-
key: `autocomplete-country-${ee.code}-${ee.label}`,
|
|
3171
|
-
sx: {
|
|
3172
|
-
...ae,
|
|
3173
|
-
"&[aria-selected='true']": {
|
|
3174
|
-
bgcolor: b.neutral.plainActiveBg
|
|
3175
|
-
}
|
|
3176
|
-
}
|
|
3177
|
-
},
|
|
3178
|
-
/* @__PURE__ */ a(Vo, { children: /* @__PURE__ */ a(
|
|
3179
|
-
"img",
|
|
3180
|
-
{
|
|
3181
|
-
loading: "lazy",
|
|
3182
|
-
width: "20",
|
|
3183
|
-
srcSet: `https://flagcdn.com/w40/${ee.code.toLowerCase()}.png 2x`,
|
|
3184
|
-
src: `https://flagcdn.com/w20/${ee.code.toLowerCase()}.png`,
|
|
3185
|
-
alt: ""
|
|
3186
|
-
}
|
|
3187
|
-
) }),
|
|
3188
|
-
/* @__PURE__ */ a(Ho, { sx: Be.listItemContent, children: ee.label })
|
|
3189
|
-
)
|
|
3190
|
-
}
|
|
3191
|
-
)
|
|
3192
|
-
] }),
|
|
3193
|
-
(B.includes("phoneCountryCode") || B.includes("phoneNumber")) && /* @__PURE__ */ q(_e, { required: !0, disabled: j, children: [
|
|
3194
|
-
/* @__PURE__ */ a(je, { sx: X, children: to }),
|
|
3195
|
-
/* @__PURE__ */ q(Io, { sx: Be.phoneContainer, children: [
|
|
3196
|
-
B.includes("phoneCountryCode") && /* @__PURE__ */ a(
|
|
3197
|
-
Mo,
|
|
3198
|
-
{
|
|
3199
|
-
value: J.phoneCountryCode,
|
|
3200
|
-
onChange: Q,
|
|
3201
|
-
slotProps: {
|
|
3202
|
-
input: { autoComplete: "new-phone-country-code" },
|
|
3203
|
-
listbox: $e.listbox,
|
|
3204
|
-
root: $e.root,
|
|
3205
|
-
clearIndicator: {
|
|
3206
|
-
sx: {
|
|
3207
|
-
"&:hover": {
|
|
3208
|
-
bgcolor: b.neutral.plainHoverBg,
|
|
3209
|
-
color: b.neutral.plainHoverColor
|
|
3210
|
-
}
|
|
3211
|
-
}
|
|
3212
|
-
},
|
|
3213
|
-
popupIndicator: {
|
|
3214
|
-
sx: {
|
|
3215
|
-
"&:hover": {
|
|
3216
|
-
bgcolor: b.neutral.plainHoverBg,
|
|
3217
|
-
color: b.neutral.plainHoverColor
|
|
3218
|
-
}
|
|
3219
|
-
}
|
|
3220
|
-
}
|
|
3221
|
-
},
|
|
3222
|
-
sx: Be.countrySelect,
|
|
3223
|
-
options: F,
|
|
3224
|
-
autoHighlight: !0,
|
|
3225
|
-
getOptionLabel: (x) => `+${x.phone}`,
|
|
3226
|
-
renderOption: (x, ee) => /* @__PURE__ */ Ko(
|
|
3227
|
-
zo,
|
|
3228
|
-
{
|
|
3229
|
-
...x,
|
|
3230
|
-
key: `autocomplete-${ee.code}-${ee.label}`,
|
|
3231
|
-
sx: {
|
|
3232
|
-
...ae,
|
|
3233
|
-
"&[aria-selected='true']": {
|
|
3234
|
-
bgcolor: b.neutral.plainActiveBg
|
|
3235
|
-
}
|
|
3236
|
-
}
|
|
3237
|
-
},
|
|
3238
|
-
/* @__PURE__ */ a(Vo, { children: /* @__PURE__ */ a(
|
|
3239
|
-
"img",
|
|
3240
|
-
{
|
|
3241
|
-
loading: "lazy",
|
|
3242
|
-
width: "20",
|
|
3243
|
-
srcSet: `https://flagcdn.com/w40/${ee.code.toLowerCase()}.png 2x`,
|
|
3244
|
-
src: `https://flagcdn.com/w20/${ee.code.toLowerCase()}.png`,
|
|
3245
|
-
alt: ""
|
|
3246
|
-
}
|
|
3247
|
-
) }),
|
|
3248
|
-
/* @__PURE__ */ q(Ho, { sx: Be.listItemContent, children: [
|
|
3249
|
-
ee.label,
|
|
3250
|
-
/* @__PURE__ */ q(ao, { level: "body-xs", children: [
|
|
3251
|
-
"+",
|
|
3252
|
-
ee.phone
|
|
3253
|
-
] })
|
|
3254
|
-
] })
|
|
3255
|
-
)
|
|
3256
|
-
}
|
|
3257
|
-
),
|
|
3258
|
-
B.includes("phoneNumber") && /* @__PURE__ */ a(
|
|
3259
|
-
so,
|
|
3260
|
-
{
|
|
3261
|
-
value: J.phoneNumber,
|
|
3262
|
-
onChange: ie("phoneNumber"),
|
|
3263
|
-
placeholder: co,
|
|
3264
|
-
sx: {
|
|
3265
|
-
...Be.phoneInput,
|
|
3266
|
-
...Y
|
|
3267
|
-
}
|
|
3268
|
-
}
|
|
3269
|
-
)
|
|
3270
|
-
] })
|
|
3271
|
-
] }),
|
|
3272
|
-
E && E.length > 0 ? E.map((x, ee) => /* @__PURE__ */ q(
|
|
3273
|
-
_e,
|
|
3274
|
-
{
|
|
3275
|
-
disabled: j,
|
|
3276
|
-
required: x.required || !1,
|
|
3277
|
-
children: [
|
|
3278
|
-
/* @__PURE__ */ a(je, { sx: X, children: x.label }),
|
|
3279
|
-
x.type === "textarea" ? /* @__PURE__ */ a(
|
|
3280
|
-
pn,
|
|
3281
|
-
{
|
|
3282
|
-
value: Oe[x.key] || "",
|
|
3283
|
-
onChange: fe(x.key),
|
|
3284
|
-
placeholder: x.placeholder || "",
|
|
3285
|
-
sx: Y,
|
|
3286
|
-
minRows: 3
|
|
3287
|
-
}
|
|
3288
|
-
) : /* @__PURE__ */ a(
|
|
3289
|
-
so,
|
|
3290
|
-
{
|
|
3291
|
-
value: Oe[x.key] || "",
|
|
3292
|
-
onChange: fe(x.key),
|
|
3293
|
-
placeholder: x.placeholder,
|
|
3294
|
-
sx: Y
|
|
3295
|
-
}
|
|
3296
|
-
)
|
|
3297
|
-
]
|
|
3298
|
-
},
|
|
3299
|
-
`custom-field-${x.key}-${ee}`
|
|
3300
|
-
)) : null,
|
|
3301
|
-
o.consents && o.consents.length > 0 ? /* @__PURE__ */ a(
|
|
3302
|
-
Rt,
|
|
3303
|
-
{
|
|
3304
|
-
consents: o.consents,
|
|
3305
|
-
checked: t,
|
|
3306
|
-
onChange: Ee,
|
|
3307
|
-
isDisabled: j,
|
|
3308
|
-
primaryColor: ge,
|
|
3309
|
-
brandingUrls: P,
|
|
3310
|
-
labels: i,
|
|
3311
|
-
requiredError: s ? R("consents.requiredError") : null,
|
|
3312
|
-
forceLightSurface: !0
|
|
3313
|
-
}
|
|
3314
|
-
) : /* @__PURE__ */ a(
|
|
3315
|
-
kr,
|
|
3316
|
-
{
|
|
3317
|
-
primaryColor: ge,
|
|
3318
|
-
brandingUrls: P,
|
|
3319
|
-
isDisabled: j
|
|
3320
|
-
}
|
|
3321
|
-
),
|
|
3322
|
-
be && /* @__PURE__ */ a(Zo, { variant: "error", message: R(be) }),
|
|
3323
|
-
j ? /* @__PURE__ */ q(We, { children: [
|
|
3324
|
-
i != null && i.successTitle || i != null && i.successDescription ? /* @__PURE__ */ a(
|
|
3325
|
-
Zo,
|
|
3326
|
-
{
|
|
3327
|
-
variant: "success",
|
|
3328
|
-
title: i == null ? void 0 : i.successTitle,
|
|
3329
|
-
description: i == null ? void 0 : i.successDescription
|
|
3330
|
-
}
|
|
3331
|
-
) : /* @__PURE__ */ a(We, {}),
|
|
3332
|
-
_()
|
|
3333
|
-
] }) : /* @__PURE__ */ a(
|
|
3334
|
-
Eo,
|
|
3335
|
-
{
|
|
3336
|
-
type: "submit",
|
|
3337
|
-
loading: Ie,
|
|
3338
|
-
disabled: V,
|
|
3339
|
-
size: "lg",
|
|
3340
|
-
sx: {
|
|
3341
|
-
...Be.submitButton,
|
|
3342
|
-
bgcolor: ge,
|
|
3343
|
-
color: U,
|
|
3344
|
-
":hover": { bgcolor: Z, color: U },
|
|
3345
|
-
fontSize: "0.8125em",
|
|
3346
|
-
...Ie ? Qo(ge, U) : {}
|
|
3347
|
-
},
|
|
3348
|
-
children: i == null ? void 0 : i.submitButtonLabel
|
|
3349
|
-
}
|
|
3350
|
-
)
|
|
3351
|
-
] }) });
|
|
3352
|
-
}, sl = ({
|
|
3353
|
-
sdk: o,
|
|
3354
|
-
content: t,
|
|
3355
|
-
campaign: l,
|
|
3356
|
-
branding: s,
|
|
3357
|
-
fields: f = ["fullName", "email"],
|
|
3358
|
-
labels: u,
|
|
3359
|
-
onSuccessCta: O,
|
|
3360
|
-
customFields: P,
|
|
3361
|
-
consents: A,
|
|
3362
|
-
syncWithProfile: y = !1,
|
|
3363
|
-
isSubmittingParticipation: I = !1
|
|
3364
|
-
}) => {
|
|
3365
|
-
var i;
|
|
3366
|
-
const d = pt(), w = d.textColor, k = ((i = s == null ? void 0 : s.colors) == null ? void 0 : i.secondaryColor) || d.textColor, E = mt().primary, g = f.map((H) => H && H.trim());
|
|
3367
|
-
return /* @__PURE__ */ q(gt, { spacing: 2, zIndex: 10, width: "100%", children: [
|
|
3368
|
-
u != null && u.title || u != null && u.description ? /* @__PURE__ */ q(Io, { children: [
|
|
3369
|
-
u != null && u.title ? /* @__PURE__ */ a(
|
|
3370
|
-
ao,
|
|
3371
|
-
{
|
|
3372
|
-
level: "h4",
|
|
3373
|
-
sx: {
|
|
3374
|
-
fontFamily: E,
|
|
3375
|
-
color: w,
|
|
3376
|
-
fontSize: "1.25em"
|
|
3377
|
-
},
|
|
3378
|
-
children: u.title
|
|
3379
|
-
}
|
|
3380
|
-
) : /* @__PURE__ */ a(We, {}),
|
|
3381
|
-
u != null && u.description ? /* @__PURE__ */ a(
|
|
3382
|
-
ao,
|
|
3383
|
-
{
|
|
3384
|
-
level: "body-sm",
|
|
3385
|
-
sx: {
|
|
3386
|
-
fontFamily: E,
|
|
3387
|
-
color: k,
|
|
3388
|
-
opacity: 0.6,
|
|
3389
|
-
fontSize: "0.875em"
|
|
3390
|
-
},
|
|
3391
|
-
children: u == null ? void 0 : u.description
|
|
3392
|
-
}
|
|
3393
|
-
) : /* @__PURE__ */ a(We, {})
|
|
3394
|
-
] }) : /* @__PURE__ */ a(We, {}),
|
|
3395
|
-
/* @__PURE__ */ a(
|
|
3396
|
-
Ar,
|
|
3397
|
-
{
|
|
3398
|
-
sdk: o,
|
|
3399
|
-
brandingColors: s == null ? void 0 : s.colors,
|
|
3400
|
-
brandingUrls: s == null ? void 0 : s.urls,
|
|
3401
|
-
campaignId: l == null ? void 0 : l.id,
|
|
3402
|
-
campaignName: l == null ? void 0 : l.name,
|
|
3403
|
-
contentName: t == null ? void 0 : t.name,
|
|
3404
|
-
contentType: t == null ? void 0 : t.type,
|
|
3405
|
-
contentId: t == null ? void 0 : t.id,
|
|
3406
|
-
onSuccessCta: O,
|
|
3407
|
-
fields: g,
|
|
3408
|
-
labels: u,
|
|
3409
|
-
formCustomFields: P,
|
|
3410
|
-
consents: A,
|
|
3411
|
-
syncWithProfile: y,
|
|
3412
|
-
isSubmittingParticipation: I
|
|
3413
|
-
}
|
|
3414
|
-
)
|
|
3415
|
-
] });
|
|
3416
|
-
};
|
|
3417
|
-
export {
|
|
3418
|
-
sl as C
|
|
3419
|
-
};
|