docthub-core-components 3.3.17 → 3.3.19
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.
|
@@ -1,98 +1,98 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as c, jsxs as G, Fragment as Ee } from "react/jsx-runtime";
|
|
3
3
|
import { c as je } from "react-compiler-runtime";
|
|
4
|
-
import { getCountries as
|
|
5
|
-
import { ChevronsUpDown as
|
|
6
|
-
import * as
|
|
7
|
-
import { CommandList as
|
|
8
|
-
import { Input as
|
|
9
|
-
import { Label as
|
|
10
|
-
import { PopoverTrigger as
|
|
4
|
+
import { getCountries as Ge, getCountryCallingCode as Ae } from "libphonenumber-js";
|
|
5
|
+
import { ChevronsUpDown as Ue, CheckIcon as Ve } from "lucide-react";
|
|
6
|
+
import * as O from "react";
|
|
7
|
+
import { CommandList as ze, CommandEmpty as Xe, CommandGroup as qe, CommandInput as Me, Command as He, CommandItem as Ze } from "../../../ui/command.js";
|
|
8
|
+
import { Input as Je } from "../../../ui/input.js";
|
|
9
|
+
import { Label as Ke } from "../../../ui/label.js";
|
|
10
|
+
import { PopoverTrigger as Qe, PopoverContent as We, Popover as Ye } from "../../../ui/popover.js";
|
|
11
11
|
import { cn as te } from "../../../../lib/utils.js";
|
|
12
12
|
import { DoctTypography as $e } from "../../../ui/typography.js";
|
|
13
|
-
const
|
|
14
|
-
const e =
|
|
13
|
+
const et = /\D/g, re = (t) => t.replace(et, ""), Re = (t) => {
|
|
14
|
+
const e = t.match(/^\+\s*(\d+)\s*-\s*(\d*)\s*$/);
|
|
15
15
|
return e ? {
|
|
16
16
|
callingCode: e[1],
|
|
17
17
|
national: e[2]
|
|
18
18
|
} : null;
|
|
19
|
-
},
|
|
20
|
-
if (
|
|
21
|
-
const e = String(
|
|
22
|
-
return
|
|
23
|
-
},
|
|
24
|
-
if (!
|
|
25
|
-
if (typeof
|
|
26
|
-
const e = String(
|
|
27
|
-
if (
|
|
28
|
-
if (
|
|
19
|
+
}, Te = (t) => {
|
|
20
|
+
if (t == null) return "";
|
|
21
|
+
const e = String(t).trim(), r = Re(e);
|
|
22
|
+
return r ? r.national : re(e);
|
|
23
|
+
}, tt = /^[A-Za-z]{2}$/, rt = /^\+?\d+$/, z = (t) => {
|
|
24
|
+
if (!t) return "91";
|
|
25
|
+
if (typeof t == "object" && "countryCode" in t) {
|
|
26
|
+
const e = String(t.countryCode ?? "").trim();
|
|
27
|
+
if (rt.test(e)) return re(e) || "91";
|
|
28
|
+
if (tt.test(e))
|
|
29
29
|
try {
|
|
30
|
-
return
|
|
30
|
+
return Ae(e.toUpperCase());
|
|
31
31
|
} catch {
|
|
32
32
|
return "91";
|
|
33
33
|
}
|
|
34
34
|
return "91";
|
|
35
35
|
}
|
|
36
36
|
try {
|
|
37
|
-
return
|
|
37
|
+
return Ae(t);
|
|
38
38
|
} catch {
|
|
39
39
|
return "91";
|
|
40
40
|
}
|
|
41
|
-
},
|
|
42
|
-
if (
|
|
41
|
+
}, Le = (t, e) => {
|
|
42
|
+
if (t == null)
|
|
43
43
|
return e && e.length > 0 ? e[0] : "IN";
|
|
44
|
-
if (typeof
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
44
|
+
if (typeof t == "number" && (e != null && e.length)) {
|
|
45
|
+
const r = e[0];
|
|
46
|
+
if (r && typeof r == "object" && "countryId" in r) {
|
|
47
|
+
const s = e.find((l) => l.countryId === t);
|
|
48
|
+
if (s) return s;
|
|
49
49
|
}
|
|
50
|
-
return e[
|
|
50
|
+
return e[t];
|
|
51
51
|
}
|
|
52
|
-
return
|
|
53
|
-
},
|
|
54
|
-
if (!e) return
|
|
55
|
-
const
|
|
56
|
-
return
|
|
57
|
-
},
|
|
58
|
-
const
|
|
52
|
+
return t;
|
|
53
|
+
}, Be = (t, e) => {
|
|
54
|
+
if (!e) return t ? `+${re(t)}` : "";
|
|
55
|
+
const r = z(e);
|
|
56
|
+
return t ? `+${r}-${t}` : `+${r}`;
|
|
57
|
+
}, Oe = (t, e) => e ? typeof t == "object" && "countryId" in t && typeof e == "object" && "countryId" in e ? t.countryId === e.countryId : t === e : !1, Fe = (t, e, r) => {
|
|
58
|
+
const s = re(e), l = t.map((n) => n.value).filter((n) => !!n).filter((n) => z(n) === s);
|
|
59
59
|
if (l.length !== 0)
|
|
60
|
-
return
|
|
61
|
-
},
|
|
60
|
+
return r && l.some((n) => Oe(n, r)) ? r : l[0];
|
|
61
|
+
}, lt = (t) => {
|
|
62
62
|
const e = je(45), {
|
|
63
|
-
disabled:
|
|
64
|
-
value:
|
|
63
|
+
disabled: r,
|
|
64
|
+
value: s,
|
|
65
65
|
options: l,
|
|
66
|
-
onChange:
|
|
66
|
+
onChange: n,
|
|
67
67
|
showFlagVariant: d,
|
|
68
68
|
hasError: C,
|
|
69
69
|
popoverAnchorRef: p,
|
|
70
70
|
loading: v,
|
|
71
71
|
onCountrySearch: f,
|
|
72
72
|
noDataText: w
|
|
73
|
-
} =
|
|
73
|
+
} = t, S = O.useRef(null), [y, b] = O.useState(""), [o, x] = O.useState(!1);
|
|
74
74
|
let h;
|
|
75
|
-
e[0] !==
|
|
75
|
+
e[0] !== s ? (h = s ? `+${z(s)}` : "+91", e[0] = s, e[1] = h) : h = e[1];
|
|
76
76
|
const g = h, I = !!f;
|
|
77
77
|
let _;
|
|
78
|
-
e[2] !== f || e[3] !== y ? (_ = (
|
|
79
|
-
x(
|
|
78
|
+
e[2] !== f || e[3] !== y ? (_ = (R) => {
|
|
79
|
+
x(R), R && (y && (f == null || f("")), b(""));
|
|
80
80
|
}, e[2] = f, e[3] = y, e[4] = _) : _ = e[4];
|
|
81
|
-
const
|
|
81
|
+
const j = C ? "border-destructive" : "border-gray-300", T = o && "bg-gray-100";
|
|
82
82
|
let F;
|
|
83
|
-
e[5] !==
|
|
83
|
+
e[5] !== j || e[6] !== T ? (F = te("flex h-[40px] items-center gap-1.5 rounded-l-md rounded-r-none border-l-[1px] border-t-[1px] border-b-[1px] bg-white px-3 py-[1px] text-sm font-medium text-gray-900 transition-colors", j, "hover:bg-gray-100 focus:z-10 focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-50", T), e[5] = j, e[6] = T, e[7] = F) : F = e[7];
|
|
84
84
|
let E;
|
|
85
85
|
e[8] !== g ? (E = /* @__PURE__ */ c($e, { variant: "body2", weight: "regular", className: "text-gray-900", children: g }), e[8] = g, e[9] = E) : E = e[9];
|
|
86
|
-
const U =
|
|
86
|
+
const U = r && "hidden";
|
|
87
87
|
let u;
|
|
88
88
|
e[10] !== U ? (u = te("h-4 w-4 text-gray-500 shrink-0", U), e[10] = U, e[11] = u) : u = e[11];
|
|
89
89
|
let X;
|
|
90
|
-
e[12] !== u ? (X = /* @__PURE__ */ c(
|
|
90
|
+
e[12] !== u ? (X = /* @__PURE__ */ c(Ue, { className: u }), e[12] = u, e[13] = X) : X = e[13];
|
|
91
91
|
let L;
|
|
92
|
-
e[14] !==
|
|
92
|
+
e[14] !== r || e[15] !== F || e[16] !== E || e[17] !== X ? (L = /* @__PURE__ */ c(Qe, { asChild: !0, children: /* @__PURE__ */ G("button", { type: "button", disabled: r, className: F, children: [
|
|
93
93
|
E,
|
|
94
94
|
X
|
|
95
|
-
] }) }), e[14] =
|
|
95
|
+
] }) }), e[14] = r, e[15] = F, e[16] = E, e[17] = X, e[18] = L) : L = e[18];
|
|
96
96
|
let M;
|
|
97
97
|
e[19] === Symbol.for("react.memo_cache_sentinel") ? (M = {
|
|
98
98
|
side: "flip",
|
|
@@ -101,126 +101,128 @@ const Ye = /\D/g, re = (r) => r.replace(Ye, ""), Oe = (r) => {
|
|
|
101
101
|
}, e[19] = M) : M = e[19];
|
|
102
102
|
const B = !I;
|
|
103
103
|
let V;
|
|
104
|
-
e[20] !== f ? (V = (
|
|
105
|
-
b(
|
|
106
|
-
const
|
|
107
|
-
|
|
104
|
+
e[20] !== f ? (V = (R) => {
|
|
105
|
+
b(R), f == null || f(R), window.setTimeout(() => {
|
|
106
|
+
const i = S.current;
|
|
107
|
+
i && (i.scrollTop = 0);
|
|
108
108
|
}, 0);
|
|
109
109
|
}, e[20] = f, e[21] = V) : V = e[21];
|
|
110
110
|
let D;
|
|
111
|
-
e[22] !== y || e[23] !== V ? (D = /* @__PURE__ */ c("div", { className: "mb-3 h-[32px] rounded-full border border-gray-300 bg-white overflow-hidden [&_[cmdk-input-wrapper]]:h-full [&_[cmdk-input-wrapper]]:px-3 [&_[cmdk-input-wrapper]_svg]:text-gray-500", children: /* @__PURE__ */ c(
|
|
112
|
-
let j;
|
|
113
|
-
e[25] === Symbol.for("react.memo_cache_sentinel") ? (j = {
|
|
114
|
-
msOverflowStyle: "none"
|
|
115
|
-
}, e[25] = j) : j = e[25];
|
|
111
|
+
e[22] !== y || e[23] !== V ? (D = /* @__PURE__ */ c("div", { className: "mb-3 h-[32px] rounded-full border border-gray-300 bg-white overflow-hidden [&_[cmdk-input-wrapper]]:h-full [&_[cmdk-input-wrapper]]:px-3 [&_[cmdk-input-wrapper]_svg]:text-gray-500", children: /* @__PURE__ */ c(Me, { value: y, onValueChange: V, placeholder: "Search country..." }) }), e[22] = y, e[23] = V, e[24] = D) : D = e[24];
|
|
116
112
|
let k;
|
|
117
|
-
e[
|
|
118
|
-
|
|
119
|
-
|
|
113
|
+
e[25] === Symbol.for("react.memo_cache_sentinel") ? (k = {
|
|
114
|
+
msOverflowStyle: "none"
|
|
115
|
+
}, e[25] = k) : k = e[25];
|
|
116
|
+
let A;
|
|
117
|
+
e[26] !== l || e[27] !== v || e[28] !== w || e[29] !== n || e[30] !== s || e[31] !== d ? (A = /* @__PURE__ */ c(ze, { children: /* @__PURE__ */ c("div", { ref: S, className: "max-h-[min(288px,calc(100vh-12rem))] overflow-y-auto -mx-1 px-1 [&::-webkit-scrollbar]:hidden [scrollbar-width:none]", style: k, children: v ? /* @__PURE__ */ c("div", { className: "py-6 text-center text-sm text-gray-500", children: "Loading…" }) : /* @__PURE__ */ G(Ee, { children: [
|
|
118
|
+
/* @__PURE__ */ c(Xe, { children: w }),
|
|
119
|
+
/* @__PURE__ */ c(qe, { children: l.map((R) => {
|
|
120
120
|
const {
|
|
121
|
-
value:
|
|
121
|
+
value: i,
|
|
122
122
|
label: H,
|
|
123
123
|
countryCode: le
|
|
124
|
-
} =
|
|
125
|
-
return
|
|
124
|
+
} = R;
|
|
125
|
+
return i ? /* @__PURE__ */ c(nt, { country: i, countryName: H, countryCode: le, selectedCountry: s, onChange: n, onSelectComplete: () => x(!1), showFlagVariant: d }, typeof i == "object" && "countryId" in i ? i.countryId : i) : null;
|
|
126
126
|
}) })
|
|
127
|
-
] }) }) }), e[26] = l, e[27] = v, e[28] = w, e[29] =
|
|
127
|
+
] }) }) }), e[26] = l, e[27] = v, e[28] = w, e[29] = n, e[30] = s, e[31] = d, e[32] = A) : A = e[32];
|
|
128
128
|
let P;
|
|
129
|
-
e[33] !== B || e[34] !== D || e[35] !==
|
|
129
|
+
e[33] !== B || e[34] !== D || e[35] !== A ? (P = /* @__PURE__ */ G(He, { shouldFilter: B, children: [
|
|
130
130
|
D,
|
|
131
|
-
|
|
132
|
-
] }), e[33] = B, e[34] = D, e[35] =
|
|
131
|
+
A
|
|
132
|
+
] }), e[33] = B, e[34] = D, e[35] = A, e[36] = P) : P = e[36];
|
|
133
133
|
let $;
|
|
134
|
-
e[37] !== p || e[38] !== P ? ($ = /* @__PURE__ */ c(
|
|
134
|
+
e[37] !== p || e[38] !== P ? ($ = /* @__PURE__ */ c(We, { anchor: p, side: "bottom", sideOffset: 6, collisionAvoidance: M, className: "w-[min(var(--anchor-width),calc(100vw-1rem))] max-w-[var(--available-width)] min-w-0 p-1 shadow-md border border-gray-300 rounded-md", align: "start", children: P }), e[37] = p, e[38] = P, e[39] = $) : $ = e[39];
|
|
135
135
|
let q;
|
|
136
|
-
return e[40] !==
|
|
136
|
+
return e[40] !== o || e[41] !== L || e[42] !== $ || e[43] !== _ ? (q = /* @__PURE__ */ G(Ye, { open: o, modal: !0, onOpenChange: _, children: [
|
|
137
137
|
L,
|
|
138
138
|
$
|
|
139
|
-
] }), e[40] =
|
|
140
|
-
},
|
|
139
|
+
] }), e[40] = o, e[41] = L, e[42] = $, e[43] = _, e[44] = q) : q = e[44], q;
|
|
140
|
+
}, nt = (t) => {
|
|
141
141
|
const e = je(16), {
|
|
142
|
-
country:
|
|
143
|
-
countryName:
|
|
142
|
+
country: r,
|
|
143
|
+
countryName: s,
|
|
144
144
|
countryCode: l,
|
|
145
|
-
selectedCountry:
|
|
145
|
+
selectedCountry: n,
|
|
146
146
|
onChange: d,
|
|
147
147
|
onSelectComplete: C,
|
|
148
148
|
showFlagVariant: p
|
|
149
|
-
} =
|
|
149
|
+
} = t;
|
|
150
150
|
let v;
|
|
151
|
-
e[0] !==
|
|
152
|
-
d(
|
|
153
|
-
}, e[0] =
|
|
151
|
+
e[0] !== r || e[1] !== d || e[2] !== C ? (v = () => {
|
|
152
|
+
d(r), C();
|
|
153
|
+
}, e[0] = r, e[1] = d, e[2] = C, e[3] = v) : v = e[3];
|
|
154
154
|
const f = v;
|
|
155
155
|
let w;
|
|
156
156
|
e: {
|
|
157
|
-
if (!
|
|
157
|
+
if (!n) {
|
|
158
158
|
w = !1;
|
|
159
159
|
break e;
|
|
160
160
|
}
|
|
161
|
-
if (typeof
|
|
162
|
-
w =
|
|
161
|
+
if (typeof r == "object" && "countryId" in r && typeof n == "object" && "countryId" in n) {
|
|
162
|
+
w = r.countryId === n.countryId;
|
|
163
163
|
break e;
|
|
164
164
|
}
|
|
165
|
-
w =
|
|
165
|
+
w = r === n;
|
|
166
166
|
}
|
|
167
|
-
const S = w, y = `${
|
|
167
|
+
const S = w, y = `${s} ${l}`;
|
|
168
168
|
let b;
|
|
169
169
|
e[4] === Symbol.for("react.memo_cache_sentinel") ? (b = te("flex items-center gap-3 px-3 py-2.5 text-sm cursor-pointer transition-colors", "data-[selected=true]:bg-[#F5F5F5] data-[selected=true]:text-gray-900", "hover:bg-[#F5F5F5]"), e[4] = b) : b = e[4];
|
|
170
|
-
let
|
|
171
|
-
e[5] !== l || e[6] !==
|
|
172
|
-
/* @__PURE__ */ c("span", { className: "flex-1 text-sm font-normal text-gray-700", children:
|
|
170
|
+
let o;
|
|
171
|
+
e[5] !== l || e[6] !== s || e[7] !== p ? (o = p ? /* @__PURE__ */ G(Ee, { children: [
|
|
172
|
+
/* @__PURE__ */ c("span", { className: "flex-1 text-sm font-normal text-gray-700", children: s }),
|
|
173
173
|
/* @__PURE__ */ c($e, { variant: "body2", weight: "regular", className: "text-gray-900 min-w-[50px] text-right", children: l })
|
|
174
174
|
] }) : /* @__PURE__ */ G(Ee, { children: [
|
|
175
175
|
/* @__PURE__ */ c($e, { variant: "body2", weight: "regular", className: "text-gray-900 min-w-[50px]", children: l }),
|
|
176
|
-
/* @__PURE__ */ c("span", { className: "flex-1 text-sm font-normal text-gray-700", children:
|
|
177
|
-
] }), e[5] = l, e[6] =
|
|
176
|
+
/* @__PURE__ */ c("span", { className: "flex-1 text-sm font-normal text-gray-700", children: s })
|
|
177
|
+
] }), e[5] = l, e[6] = s, e[7] = p, e[8] = o) : o = e[8];
|
|
178
178
|
let x;
|
|
179
|
-
e[9] !== S ? (x = S && /* @__PURE__ */ c(
|
|
179
|
+
e[9] !== S ? (x = S && /* @__PURE__ */ c(Ve, { className: "ml-auto h-4 w-4 text-gray-900 shrink-0" }), e[9] = S, e[10] = x) : x = e[10];
|
|
180
180
|
let h;
|
|
181
|
-
return e[11] !== f || e[12] !== y || e[13] !==
|
|
182
|
-
|
|
181
|
+
return e[11] !== f || e[12] !== y || e[13] !== o || e[14] !== x ? (h = /* @__PURE__ */ G(Ze, { value: y, className: b, onSelect: f, children: [
|
|
182
|
+
o,
|
|
183
183
|
x
|
|
184
|
-
] }), e[11] = f, e[12] = y, e[13] =
|
|
185
|
-
}, ot =
|
|
186
|
-
if (
|
|
187
|
-
return ot.map((
|
|
188
|
-
value:
|
|
184
|
+
] }), e[11] = f, e[12] = y, e[13] = o, e[14] = x, e[15] = h) : h = e[15], h;
|
|
185
|
+
}, ot = Ge(), st = (t) => {
|
|
186
|
+
if (t === void 0)
|
|
187
|
+
return ot.map((r) => ({
|
|
188
|
+
value: r,
|
|
189
189
|
label: new Intl.DisplayNames(["en"], {
|
|
190
190
|
type: "region"
|
|
191
|
-
}).of(
|
|
192
|
-
countryCode: `+${z(
|
|
191
|
+
}).of(r) ?? r,
|
|
192
|
+
countryCode: `+${z(r)}`
|
|
193
193
|
}));
|
|
194
|
-
if (
|
|
194
|
+
if (t.length === 0)
|
|
195
|
+
return [];
|
|
196
|
+
if (t.length === 0)
|
|
195
197
|
return [];
|
|
196
|
-
const e =
|
|
197
|
-
return e && typeof e == "object" && "countryId" in e ?
|
|
198
|
-
value:
|
|
199
|
-
label:
|
|
200
|
-
countryCode: `+${z(
|
|
201
|
-
})) :
|
|
202
|
-
value:
|
|
198
|
+
const e = t[0];
|
|
199
|
+
return e && typeof e == "object" && "countryId" in e ? t.map((r) => ({
|
|
200
|
+
value: r,
|
|
201
|
+
label: r.countryName,
|
|
202
|
+
countryCode: `+${z(r)}`
|
|
203
|
+
})) : t.map((r) => ({
|
|
204
|
+
value: r,
|
|
203
205
|
label: new Intl.DisplayNames(["en"], {
|
|
204
206
|
type: "region"
|
|
205
|
-
}).of(
|
|
206
|
-
countryCode: `+${z(
|
|
207
|
+
}).of(r) ?? r,
|
|
208
|
+
countryCode: `+${z(r)}`
|
|
207
209
|
}));
|
|
208
210
|
};
|
|
209
|
-
function
|
|
211
|
+
function gt(t) {
|
|
210
212
|
const e = je(116);
|
|
211
|
-
let
|
|
212
|
-
e[0] !==
|
|
213
|
+
let r, s, l, n, d, C, p, v, f, w, S, y, b, o, x, h, g, I, _, j, T, F, E, U;
|
|
214
|
+
e[0] !== t ? ({
|
|
213
215
|
label: S,
|
|
214
216
|
helperText: v,
|
|
215
217
|
error: p,
|
|
216
|
-
required:
|
|
217
|
-
className:
|
|
218
|
-
"aria-describedby":
|
|
218
|
+
required: j,
|
|
219
|
+
className: s,
|
|
220
|
+
"aria-describedby": r,
|
|
219
221
|
id: f,
|
|
220
222
|
value: F,
|
|
221
223
|
onPhoneChange: h,
|
|
222
|
-
countryCode:
|
|
223
|
-
onCountryCodeChange:
|
|
224
|
+
countryCode: n,
|
|
225
|
+
onCountryCodeChange: o,
|
|
224
226
|
onValuesChange: I,
|
|
225
227
|
onCountryChange: b,
|
|
226
228
|
onValueChange: g,
|
|
@@ -234,103 +236,103 @@ function yt(r) {
|
|
|
234
236
|
noDataText: U,
|
|
235
237
|
inputRef: w,
|
|
236
238
|
...T
|
|
237
|
-
} =
|
|
238
|
-
const u = F === void 0 ? "" : F, X = E === void 0 ? "default" : E, L = U === void 0 ? "No data found" : U, M =
|
|
239
|
-
let
|
|
240
|
-
e[25] !==
|
|
241
|
-
const P =
|
|
242
|
-
let
|
|
243
|
-
e[29] !== l ? (
|
|
244
|
-
const
|
|
239
|
+
} = t, e[0] = t, e[1] = r, e[2] = s, e[3] = l, e[4] = n, e[5] = d, e[6] = C, e[7] = p, e[8] = v, e[9] = f, e[10] = w, e[11] = S, e[12] = y, e[13] = b, e[14] = o, e[15] = x, e[16] = h, e[17] = g, e[18] = I, e[19] = _, e[20] = j, e[21] = T, e[22] = F, e[23] = E, e[24] = U) : (r = e[1], s = e[2], l = e[3], n = e[4], d = e[5], C = e[6], p = e[7], v = e[8], f = e[9], w = e[10], S = e[11], y = e[12], b = e[13], o = e[14], x = e[15], h = e[16], g = e[17], I = e[18], _ = e[19], j = e[20], T = e[21], F = e[22], E = e[23], U = e[24]);
|
|
240
|
+
const u = F === void 0 ? "" : F, X = E === void 0 ? "default" : E, L = U === void 0 ? "No data found" : U, M = O.useId(), B = O.useId(), V = O.useRef(null), D = f ?? M, k = !!(v || p);
|
|
241
|
+
let A;
|
|
242
|
+
e[25] !== r || e[26] !== k || e[27] !== B ? (A = [r, k ? B : void 0].filter(Boolean).join(" ") || void 0, e[25] = r, e[26] = k, e[27] = B, e[28] = A) : A = e[28];
|
|
243
|
+
const P = A, $ = !!p, q = X === "flag";
|
|
244
|
+
let R;
|
|
245
|
+
e[29] !== l ? (R = st(l), e[29] = l, e[30] = R) : R = e[30];
|
|
246
|
+
const i = R;
|
|
245
247
|
let H;
|
|
246
|
-
e[31] !== l || e[32] !==
|
|
247
|
-
const m =
|
|
248
|
+
e[31] !== l || e[32] !== i || e[33] !== d || e[34] !== u ? (H = () => {
|
|
249
|
+
const m = Re(String(u ?? "").trim());
|
|
248
250
|
if (m) {
|
|
249
|
-
const N = Fe(
|
|
251
|
+
const N = Fe(i, m.callingCode, void 0);
|
|
250
252
|
if (N)
|
|
251
253
|
return N;
|
|
252
254
|
}
|
|
253
|
-
return
|
|
254
|
-
}, e[31] = l, e[32] =
|
|
255
|
+
return Le(d, l);
|
|
256
|
+
}, e[31] = l, e[32] = i, e[33] = d, e[34] = u, e[35] = H) : H = e[35];
|
|
255
257
|
const le = H;
|
|
256
|
-
let
|
|
257
|
-
e[36] !== le ? (
|
|
258
|
-
const [a,
|
|
259
|
-
let
|
|
260
|
-
e[38] !== l || e[39] !== d ? (
|
|
261
|
-
if (d != null)
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
},
|
|
266
|
-
const ae =
|
|
258
|
+
let ne;
|
|
259
|
+
e[36] !== le ? (ne = () => le(), e[36] = le, e[37] = ne) : ne = e[37];
|
|
260
|
+
const [a, oe] = O.useState(ne), ke = O.useRef(!1);
|
|
261
|
+
let se, ie;
|
|
262
|
+
e[38] !== l || e[39] !== d ? (se = () => {
|
|
263
|
+
if (ke.current || d == null || !(l != null && l.length))
|
|
264
|
+
return;
|
|
265
|
+
const m = Le(d, l);
|
|
266
|
+
m && oe(m);
|
|
267
|
+
}, ie = [d, l], e[38] = l, e[39] = d, e[40] = se, e[41] = ie) : (se = e[40], ie = e[41]), O.useEffect(se, ie);
|
|
268
|
+
const ae = n !== void 0;
|
|
267
269
|
let ce, de;
|
|
268
|
-
e[42] !==
|
|
270
|
+
e[42] !== o || e[43] !== a ? (ce = () => {
|
|
269
271
|
if (!a)
|
|
270
272
|
return;
|
|
271
273
|
const m = z(a);
|
|
272
|
-
|
|
273
|
-
}, de = [a,
|
|
274
|
+
o == null || o(m);
|
|
275
|
+
}, de = [a, o], e[42] = o, e[43] = a, e[44] = ce, e[45] = de) : (ce = e[44], de = e[45]), O.useEffect(ce, de);
|
|
274
276
|
let fe, ue;
|
|
275
|
-
e[46] !==
|
|
277
|
+
e[46] !== n || e[47] !== i || e[48] !== ae || e[49] !== a ? (fe = () => {
|
|
276
278
|
if (!ae)
|
|
277
279
|
return;
|
|
278
|
-
const m = re(String(
|
|
280
|
+
const m = re(String(n ?? ""));
|
|
279
281
|
if (m === "")
|
|
280
282
|
return;
|
|
281
|
-
const N = Fe(
|
|
282
|
-
N && !
|
|
283
|
-
}, ue = [
|
|
283
|
+
const N = Fe(i, m, a);
|
|
284
|
+
N && !Oe(N, a) && oe(N);
|
|
285
|
+
}, ue = [n, i, ae, a], e[46] = n, e[47] = i, e[48] = ae, e[49] = a, e[50] = fe, e[51] = ue) : (fe = e[50], ue = e[51]), O.useEffect(fe, ue);
|
|
284
286
|
let me, pe;
|
|
285
|
-
e[52] !==
|
|
286
|
-
const m =
|
|
287
|
+
e[52] !== i || e[53] !== a || e[54] !== u ? (me = () => {
|
|
288
|
+
const m = Re(String(u ?? "").trim());
|
|
287
289
|
if (!m)
|
|
288
290
|
return;
|
|
289
|
-
const N = Fe(
|
|
290
|
-
N && !
|
|
291
|
-
}, pe = [u,
|
|
291
|
+
const N = Fe(i, m.callingCode, a);
|
|
292
|
+
N && !Oe(N, a) && oe(N);
|
|
293
|
+
}, pe = [u, i, a], e[52] = i, e[53] = a, e[54] = u, e[55] = me, e[56] = pe) : (me = e[55], pe = e[56]), O.useEffect(me, pe);
|
|
292
294
|
let he;
|
|
293
|
-
e[57] !== u ? (he =
|
|
295
|
+
e[57] !== u ? (he = Te(u), e[57] = u, e[58] = he) : he = e[58];
|
|
294
296
|
const ye = he;
|
|
295
297
|
let ge;
|
|
296
|
-
e[59] !== ye || e[60] !== b || e[61] !==
|
|
297
|
-
|
|
298
|
+
e[59] !== ye || e[60] !== b || e[61] !== o || e[62] !== g || e[63] !== I ? (ge = (m) => {
|
|
299
|
+
ke.current = !0, oe(m);
|
|
298
300
|
const N = z(m);
|
|
299
|
-
|
|
300
|
-
}, e[59] = ye, e[60] = b, e[61] =
|
|
301
|
+
o == null || o(N), b == null || b(m), I == null || I([N, ye]), g == null || g(Be(ye, m));
|
|
302
|
+
}, e[59] = ye, e[60] = b, e[61] = o, e[62] = g, e[63] = I, e[64] = ge) : ge = e[64];
|
|
301
303
|
const Ce = ge;
|
|
302
304
|
let ve;
|
|
303
|
-
e[65] !==
|
|
305
|
+
e[65] !== n || e[66] !== h || e[67] !== g || e[68] !== I || e[69] !== a ? (ve = (m) => {
|
|
304
306
|
const N = m.target.value, De = re(N);
|
|
305
307
|
h == null || h(De);
|
|
306
|
-
const
|
|
307
|
-
I == null || I([
|
|
308
|
-
}, e[65] =
|
|
308
|
+
const Pe = n ?? z(a);
|
|
309
|
+
I == null || I([Pe, De]), g == null || g(Be(De, a));
|
|
310
|
+
}, e[65] = n, e[66] = h, e[67] = g, e[68] = I, e[69] = a, e[70] = ve) : ve = e[70];
|
|
309
311
|
const we = ve;
|
|
310
312
|
let be;
|
|
311
|
-
e[71] !== u ? (be =
|
|
313
|
+
e[71] !== u ? (be = Te(u), e[71] = u, e[72] = be) : be = e[72];
|
|
312
314
|
const Ie = be;
|
|
313
315
|
let Z;
|
|
314
|
-
e[73] !==
|
|
316
|
+
e[73] !== s ? (Z = te("space-y-1", s), e[73] = s, e[74] = Z) : Z = e[74];
|
|
315
317
|
let J;
|
|
316
|
-
e[75] !== S || e[76] !==
|
|
318
|
+
e[75] !== S || e[76] !== j || e[77] !== D ? (J = S && /* @__PURE__ */ G(Ke, { htmlFor: D, className: "text-sm font-medium text-foreground", children: [
|
|
317
319
|
S,
|
|
318
|
-
|
|
319
|
-
] }), e[75] = S, e[76] =
|
|
320
|
+
j && /* @__PURE__ */ c("span", { className: "ml-1 text-destructive", "aria-hidden": "true", children: "*" })
|
|
321
|
+
] }), e[75] = S, e[76] = j, e[77] = D, e[78] = J) : J = e[78];
|
|
320
322
|
let K;
|
|
321
|
-
e[79] !==
|
|
322
|
-
const Ne =
|
|
323
|
+
e[79] !== i || e[80] !== C || e[81] !== Ce || e[82] !== $ || e[83] !== y || e[84] !== L || e[85] !== x || e[86] !== a || e[87] !== q ? (K = /* @__PURE__ */ c(lt, { disabled: C, value: a, options: i, onChange: Ce, showFlagVariant: q, hasError: $, popoverAnchorRef: V, loading: y, onCountrySearch: x, noDataText: L }), e[79] = i, e[80] = C, e[81] = Ce, e[82] = $, e[83] = y, e[84] = L, e[85] = x, e[86] = a, e[87] = q, e[88] = K) : K = e[88];
|
|
324
|
+
const Ne = j || void 0, Se = $ || void 0, _e = $ ? "border-destructive" : "border-gray-300";
|
|
323
325
|
let Q;
|
|
324
326
|
e[89] !== _e ? (Q = te("h-[40px] rounded-r-md rounded-l-none border-t-[1px] border-b-[1px] border-l-[1px] bg-white px-3 py-[1px] text-sm", _e), e[89] = _e, e[90] = Q) : Q = e[90];
|
|
325
327
|
let W;
|
|
326
|
-
e[91] !== P || e[92] !== C || e[93] !== we || e[94] !== w || e[95] !== Ie || e[96] !== _ || e[97] !== D || e[98] !== T || e[99] !== Ne || e[100] !== Se || e[101] !== Q ? (W = /* @__PURE__ */ c(
|
|
328
|
+
e[91] !== P || e[92] !== C || e[93] !== we || e[94] !== w || e[95] !== Ie || e[96] !== _ || e[97] !== D || e[98] !== T || e[99] !== Ne || e[100] !== Se || e[101] !== Q ? (W = /* @__PURE__ */ c(Je, { ...T, ref: w, id: D, type: "text", inputMode: "numeric", value: Ie, onChange: we, disabled: C, placeholder: _, "aria-required": Ne, "aria-invalid": Se, "aria-describedby": P, className: Q }), e[91] = P, e[92] = C, e[93] = we, e[94] = w, e[95] = Ie, e[96] = _, e[97] = D, e[98] = T, e[99] = Ne, e[100] = Se, e[101] = Q, e[102] = W) : W = e[102];
|
|
327
329
|
let Y;
|
|
328
330
|
e[103] !== K || e[104] !== W ? (Y = /* @__PURE__ */ G("div", { ref: V, className: "flex w-full min-w-0 items-center", children: [
|
|
329
331
|
K,
|
|
330
332
|
W
|
|
331
333
|
] }), e[103] = K, e[104] = W, e[105] = Y) : Y = e[105];
|
|
332
334
|
let ee;
|
|
333
|
-
e[106] !== p || e[107] !==
|
|
335
|
+
e[106] !== p || e[107] !== k || e[108] !== B || e[109] !== v ? (ee = k && /* @__PURE__ */ c("p", { id: B, className: te("text-xs", p ? "text-destructive" : "text-muted-foreground"), role: p ? "alert" : void 0, children: p || v }), e[106] = p, e[107] = k, e[108] = B, e[109] = v, e[110] = ee) : ee = e[110];
|
|
334
336
|
let xe;
|
|
335
337
|
return e[111] !== Z || e[112] !== J || e[113] !== Y || e[114] !== ee ? (xe = /* @__PURE__ */ G("div", { className: Z, children: [
|
|
336
338
|
J,
|
|
@@ -339,5 +341,5 @@ function yt(r) {
|
|
|
339
341
|
] }), e[111] = Z, e[112] = J, e[113] = Y, e[114] = ee, e[115] = xe) : xe = e[115], xe;
|
|
340
342
|
}
|
|
341
343
|
export {
|
|
342
|
-
|
|
344
|
+
gt as DoctPhoneInput
|
|
343
345
|
};
|