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