@athbnb/ui 0.0.2 → 0.0.3

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/dist/index.js CHANGED
@@ -1,4322 +1,22 @@
1
- import * as e from "react";
2
- import { forwardRef as t, useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
3
- import { NavLink as s, useMatches as c, useSearchParams as l } from "react-router-dom";
4
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
5
- import { createPortal as p } from "react-dom";
6
- import { APIProvider as m, Map as h } from "@vis.gl/react-google-maps";
7
- import { Tooltip as g } from "react-tooltip";
8
- import { Bounce as _, Flip as v, Slide as y, ToastContainer as b, Zoom as x, toast as S } from "react-toastify";
9
- //#region \0rolldown/runtime.js
10
- var C = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), w = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
11
- if (typeof require < "u") return require.apply(this, arguments);
12
- throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
13
- }), T = /* @__PURE__ */ C(((e) => {
14
- var t = w("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
15
- e.c = function(e) {
16
- return t.H.useMemoCache(e);
17
- };
18
- })), E = /* @__PURE__ */ C(((e) => {
19
- process.env.NODE_ENV !== "production" && (function() {
20
- var t = w("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
21
- e.c = function(e) {
22
- var n = t.H;
23
- return n === null && console.error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."), n.useMemoCache(e);
24
- };
25
- })();
26
- })), D = (/* @__PURE__ */ C(((e, t) => {
27
- process.env.NODE_ENV === "production" ? t.exports = T() : t.exports = E();
28
- })))(), O = {
29
- fit: "w-fit",
30
- full: "w-full",
31
- auto: "w-auto",
32
- min: "w-min",
33
- max: "w-max"
34
- };
35
- function k(e) {
36
- let t = (0, D.c)(27), { title: n, outline: r, className: i, width: a, onClick: o, disabled: c, loading: l, loadingClass: p, pulseDotClass: m, type: h, icon: g, to: _, children: v } = e, y = r === void 0 ? !1 : r, b = i === void 0 ? "h-fit" : i, x = a === void 0 ? "fit" : a, S = c === void 0 ? !1 : c, C = l === void 0 ? !1 : l, w = p === void 0 ? "" : p, T = m === void 0 ? "" : m, E = h === void 0 ? "button" : h, k = O[x] ?? O.fit, A = y ? "border bg-transparent border-primary text-primary font-bold" : "bg-primary text-white font-bold border border-primary", j;
37
- t[0] !== b || t[1] !== A || t[2] !== k ? (j = [
38
- A,
39
- "flex",
40
- "cursor-pointer",
41
- "px-5 py-2.5",
42
- k,
43
- "rounded-button-primary",
44
- "items-center",
45
- "justify-center",
46
- "text-sm",
47
- "transition-all",
48
- "duration-200",
49
- "ease-in-out",
50
- "disabled:opacity-50",
51
- "disabled:cursor-not-allowed",
52
- b
53
- ].filter(Boolean), t[0] = b, t[1] = A, t[2] = k, t[3] = j) : j = t[3];
54
- let M = j.join(" "), N = v ?? n, P;
55
- t[4] !== N || t[5] !== C || t[6] !== w || t[7] !== y || t[8] !== T ? (P = C ? /* @__PURE__ */ d("div", {
56
- className: `flex space-x-2.5 py-2 items-center ${w}`,
57
- role: "status",
58
- "aria-label": "Loading",
59
- children: Array.from({ length: 3 }, (e, t) => /* @__PURE__ */ d("div", { className: `w-2 h-2 rounded-full pulse-scale-dot ${y ? "bg-primary" : "bg-white"} ${T}` }, t))
60
- }) : N, t[4] = N, t[5] = C, t[6] = w, t[7] = y, t[8] = T, t[9] = P) : P = t[9];
61
- let F;
62
- t[10] === g ? F = t[11] : (F = g ? /* @__PURE__ */ d("span", {
63
- className: "ml-2",
64
- children: g
65
- }) : null, t[10] = g, t[11] = F);
66
- let I;
67
- t[12] !== P || t[13] !== F ? (I = /* @__PURE__ */ f(u, { children: [P, F] }), t[12] = P, t[13] = F, t[14] = I) : I = t[14];
68
- let L = I;
69
- if (_) {
70
- let e = S || C, n;
71
- return t[15] !== M || t[16] !== L || t[17] !== o || t[18] !== e || t[19] !== _ ? (n = /* @__PURE__ */ d(s, {
72
- to: _,
73
- className: M,
74
- onClick: o,
75
- "aria-disabled": e,
76
- children: L
77
- }), t[15] = M, t[16] = L, t[17] = o, t[18] = e, t[19] = _, t[20] = n) : n = t[20], n;
78
- }
79
- let R = S || C, z;
80
- return t[21] !== M || t[22] !== L || t[23] !== o || t[24] !== R || t[25] !== E ? (z = /* @__PURE__ */ d("button", {
81
- className: M,
82
- disabled: R,
83
- onClick: o,
84
- type: E,
85
- children: L
86
- }), t[21] = M, t[22] = L, t[23] = o, t[24] = R, t[25] = E, t[26] = z) : z = t[26], z;
87
- }
88
- //#endregion
89
- //#region src/ui/TextInput.tsx
90
- function A(e) {
91
- let t = (0, D.c)(11), { label: n, name: r, required: i, error: a, isFocused: o, hasValue: s, labelBgClassName: c, inactiveTopClassName: l, labelRestClassName: u } = e, p = c === void 0 ? "bg-white" : c, m = o || s ? "-top-2.5 text-sm! text-secondary font-bold" : `${l === void 0 ? "top-2.5" : l} text-secondary/50 ${u === void 0 ? "w-11/12" : u}`, h = a ? "!text-red-500" : "", g;
92
- t[0] !== p || t[1] !== m || t[2] !== h ? (g = [
93
- "absolute inline-block left-2 px-1 transition-all duration-300 ease-in-out sm:text-base text-sm pointer-events-none align-middle",
94
- p,
95
- m,
96
- h
97
- ].filter(Boolean), t[0] = p, t[1] = m, t[2] = h, t[3] = g) : g = t[3];
98
- let _ = g.join(" "), v;
99
- t[4] === i ? v = t[5] : (v = i ? /* @__PURE__ */ d("span", {
100
- className: "text-red-500 ml-0.5",
101
- children: "*"
102
- }) : null, t[4] = i, t[5] = v);
103
- let y;
104
- return t[6] !== n || t[7] !== r || t[8] !== _ || t[9] !== v ? (y = /* @__PURE__ */ f("label", {
105
- htmlFor: r,
106
- className: _,
107
- children: [n, v]
108
- }), t[6] = n, t[7] = r, t[8] = _, t[9] = v, t[10] = y) : y = t[10], y;
109
- }
110
- function j(e, t, n, r) {
111
- return [e ? "border-red-500" : t || n ? "border-1 border-primary" : "border-1 border-primary/50", r ? "bg-white cursor-not-allowed border-1 border-primary/50 opacity-75" : ""].filter(Boolean).join(" ");
112
- }
113
- var M = (e) => {
114
- let t = (0, D.c)(2), { open: n } = e, r;
115
- return t[0] === n ? r = t[1] : (r = n ? /* @__PURE__ */ f("svg", {
116
- xmlns: "http://www.w3.org/2000/svg",
117
- width: "16",
118
- height: "16",
119
- viewBox: "0 0 24 24",
120
- fill: "none",
121
- stroke: "currentColor",
122
- strokeWidth: "2",
123
- className: "text-primary",
124
- "aria-hidden": !0,
125
- children: [/* @__PURE__ */ d("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }), /* @__PURE__ */ d("circle", {
126
- cx: "12",
127
- cy: "12",
128
- r: "3"
129
- })]
130
- }) : /* @__PURE__ */ f("svg", {
131
- xmlns: "http://www.w3.org/2000/svg",
132
- width: "16",
133
- height: "16",
134
- viewBox: "0 0 24 24",
135
- fill: "none",
136
- stroke: "currentColor",
137
- strokeWidth: "2",
138
- className: "text-secondary",
139
- "aria-hidden": !0,
140
- children: [/* @__PURE__ */ d("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }), /* @__PURE__ */ d("line", {
141
- x1: "1",
142
- y1: "1",
143
- x2: "23",
144
- y2: "23"
145
- })]
146
- }), t[0] = n, t[1] = r), r;
147
- }, N = () => {
148
- let e = (0, D.c)(1), t;
149
- return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ f("svg", {
150
- xmlns: "http://www.w3.org/2000/svg",
151
- width: "24",
152
- height: "24",
153
- viewBox: "0 0 24 24",
154
- fill: "none",
155
- stroke: "currentColor",
156
- strokeWidth: "2",
157
- className: "min-w-6 min-h-6 shrink-0 text-red-500 pe-2",
158
- "aria-hidden": !0,
159
- children: [
160
- /* @__PURE__ */ d("circle", {
161
- cx: "12",
162
- cy: "12",
163
- r: "10"
164
- }),
165
- /* @__PURE__ */ d("line", {
166
- x1: "12",
167
- y1: "8",
168
- x2: "12",
169
- y2: "12"
170
- }),
171
- /* @__PURE__ */ d("line", {
172
- x1: "12",
173
- y1: "16",
174
- x2: "12.01",
175
- y2: "16"
176
- })
177
- ]
178
- }), e[0] = t) : t = e[0], t;
179
- };
180
- function P(t) {
181
- let n = (0, D.c)(83), r, i, a, o, s, c, l, u, p, m, h, g, _, v, y, b, x, S;
182
- n[0] === t ? (r = n[1], i = n[2], a = n[3], o = n[4], s = n[5], c = n[6], l = n[7], u = n[8], p = n[9], m = n[10], h = n[11], g = n[12], _ = n[13], v = n[14], y = n[15], b = n[16], x = n[17], S = n[18]) : ({label: l, name: a, type: h, value: g, onChange: s, onBlur: o, error: _, description: v, helperText: y, required: b, disabled: x, className: S, leftComponent: u, rightComponent: p, bgColorForLabel: m, dateMin: i, dateMax: r, ...c} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = o, n[5] = s, n[6] = c, n[7] = l, n[8] = u, n[9] = p, n[10] = m, n[11] = h, n[12] = g, n[13] = _, n[14] = v, n[15] = y, n[16] = b, n[17] = x, n[18] = S);
183
- let C = l === void 0 ? "" : l, w = h === void 0 ? "text" : h, T = g === void 0 ? "" : g, E = _ === void 0 ? "" : _, O = v === void 0 ? "" : v, k = y === void 0 ? "" : y, N = b === void 0 ? !1 : b, P = x === void 0 ? !1 : x, I = S === void 0 ? "" : S, L = u === void 0 ? null : u, R = p === void 0 ? null : p, z = m === void 0 ? "bg-white" : m, B = e.useRef(null), [V, H] = e.useState(!1), [U, W] = e.useState(!1), G = w === "password", K = G ? U ? "text" : "password" : w, q;
184
- n[19] !== r || n[20] !== i || n[21] !== w ? (q = w === "date" ? {
185
- min: i ?? new Date((/* @__PURE__ */ new Date()).setFullYear((/* @__PURE__ */ new Date()).getFullYear() - 100)).toISOString().split("T")[0],
186
- max: r ?? (/* @__PURE__ */ new Date()).toISOString().split("T")[0]
187
- } : {}, n[19] = r, n[20] = i, n[21] = w, n[22] = q) : q = n[22];
188
- let J = q, ee = `${I} ${P ? "opacity-75" : ""}`, Y = !!T, X;
189
- n[23] !== P || n[24] !== E || n[25] !== V || n[26] !== Y ? (X = j(E, V, Y, P), n[23] = P, n[24] = E, n[25] = V, n[26] = Y, n[27] = X) : X = n[27];
190
- let Z;
191
- n[28] === X ? Z = n[29] : (Z = ["relative peer w-full sm:h-[48px] h-[42px] px-3 text-base bg-transparent border rounded-md outline-none transition-all text-[14px] flex items-center", X], n[28] = X, n[29] = Z);
192
- let Q = Z.join(" "), te;
193
- n[30] !== J || n[31] !== w ? (te = w === "date" ? J : {}, n[30] = J, n[31] = w, n[32] = te) : te = n[32];
194
- let $;
195
- n[33] === w ? $ = n[34] : ($ = () => {
196
- w === "date" && B.current?.showPicker && B.current.showPicker(), H(!0);
197
- }, n[33] = w, n[34] = $);
198
- let ne;
199
- n[35] === o ? ne = n[36] : (ne = (e) => {
200
- H(!1), o?.(e);
201
- }, n[35] = o, n[36] = ne);
202
- let re = P ? "cursor-not-allowed" : "", ie = G ? "pr-6" : "", ae;
203
- n[37] !== re || n[38] !== ie ? (ae = [
204
- "outline-0 w-full text-[16px] sm:text-[14px] bg-transparent",
205
- re,
206
- ie
207
- ].filter(Boolean), n[37] = re, n[38] = ie, n[39] = ae) : ae = n[39];
208
- let oe = ae.join(" "), se;
209
- n[40] !== K || n[41] !== P || n[42] !== a || n[43] !== s || n[44] !== c || n[45] !== te || n[46] !== $ || n[47] !== ne || n[48] !== oe || n[49] !== T ? (se = /* @__PURE__ */ d("input", {
210
- id: a,
211
- name: a,
212
- type: K,
213
- value: T,
214
- disabled: P,
215
- ...te,
216
- onChange: s,
217
- onFocus: $,
218
- onBlur: ne,
219
- placeholder: "",
220
- ref: B,
221
- className: oe,
222
- ...c
223
- }), n[40] = K, n[41] = P, n[42] = a, n[43] = s, n[44] = c, n[45] = te, n[46] = $, n[47] = ne, n[48] = oe, n[49] = T, n[50] = se) : se = n[50];
224
- let ce;
225
- n[51] !== G || n[52] !== R || n[53] !== U ? (ce = G ? /* @__PURE__ */ d("button", {
226
- type: "button",
227
- className: "absolute right-3 top-1/2 -translate-y-1/2 text-secondary cursor-pointer border-0 bg-transparent p-0",
228
- onClick: () => W(F),
229
- tabIndex: -1,
230
- "aria-label": U ? "Hide password" : "Show password",
231
- children: /* @__PURE__ */ d(M, { open: U })
232
- }) : R, n[51] = G, n[52] = R, n[53] = U, n[54] = ce) : ce = n[54];
233
- let le;
234
- n[55] === ce ? le = n[56] : (le = /* @__PURE__ */ d("div", {
235
- className: "z-[5]",
236
- children: ce
237
- }), n[55] = ce, n[56] = le);
238
- let ue = !!P, de = !!T, fe = w === "date" ? "w-10/12" : "w-11/12", pe;
239
- n[57] !== z || n[58] !== E || n[59] !== V || n[60] !== C || n[61] !== a || n[62] !== N || n[63] !== ue || n[64] !== de || n[65] !== fe ? (pe = /* @__PURE__ */ d(A, {
240
- label: C,
241
- name: a,
242
- required: N,
243
- error: E,
244
- disabled: ue,
245
- isFocused: V,
246
- hasValue: de,
247
- labelBgClassName: z,
248
- labelRestClassName: fe
249
- }), n[57] = z, n[58] = E, n[59] = V, n[60] = C, n[61] = a, n[62] = N, n[63] = ue, n[64] = de, n[65] = fe, n[66] = pe) : pe = n[66];
250
- let me;
251
- n[67] !== L || n[68] !== Q || n[69] !== se || n[70] !== le || n[71] !== pe ? (me = /* @__PURE__ */ f("div", {
252
- className: Q,
253
- children: [
254
- L,
255
- se,
256
- le,
257
- pe
258
- ]
259
- }), n[67] = L, n[68] = Q, n[69] = se, n[70] = le, n[71] = pe, n[72] = me) : me = n[72];
260
- let he;
261
- n[73] !== E || n[74] !== k ? (he = (E || k) && /* @__PURE__ */ d("p", {
262
- className: `mt-1 text-sm ${E ? "text-red-500" : "text-secondary/50"}`,
263
- children: E || k
264
- }), n[73] = E, n[74] = k, n[75] = he) : he = n[75];
265
- let ge;
266
- n[76] === O ? ge = n[77] : (ge = O ? /* @__PURE__ */ d("div", {
267
- className: "mt-1 sm:text-base text-sm text-secondary/60",
268
- children: O
269
- }) : null, n[76] = O, n[77] = ge);
270
- let _e;
271
- return n[78] !== ee || n[79] !== me || n[80] !== he || n[81] !== ge ? (_e = /* @__PURE__ */ f("div", {
272
- className: ee,
273
- children: [
274
- me,
275
- he,
276
- ge
277
- ]
278
- }), n[78] = ee, n[79] = me, n[80] = he, n[81] = ge, n[82] = _e) : _e = n[82], _e;
279
- }
280
- function F(e) {
281
- return !e;
282
- }
283
- function I(t) {
284
- let n = (0, D.c)(61), r, i, a, o, s, c, l, u, p, m, h, g, _, v, y;
285
- n[0] === t ? (r = n[1], i = n[2], a = n[3], o = n[4], s = n[5], c = n[6], l = n[7], u = n[8], p = n[9], m = n[10], h = n[11], g = n[12], _ = n[13], v = n[14], y = n[15]) : ({label: c, name: i, value: u, onChange: o, onBlur: a, error: p, helperText: m, required: h, disabled: g, className: _, rows: v, maxLength: r, bgColorForLabel: y, placeholder: l, ...s} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = o, n[5] = s, n[6] = c, n[7] = l, n[8] = u, n[9] = p, n[10] = m, n[11] = h, n[12] = g, n[13] = _, n[14] = v, n[15] = y);
286
- let b = c === void 0 ? "" : c, x = u === void 0 ? "" : u, S = p === void 0 ? "" : p, C = m === void 0 ? "" : m, w = h === void 0 ? !1 : h, T = g === void 0 ? !1 : g, E = _ === void 0 ? "" : _, O = v === void 0 ? 4 : v, k = y === void 0 ? "bg-white" : y, M = l === void 0 ? "" : l, [N, P] = e.useState(!1), F = N || !!x, I = `${E} ${T ? "opacity-75" : ""}`, L = !!x, R;
287
- n[16] !== T || n[17] !== S || n[18] !== N || n[19] !== L ? (R = j(S, N, L, T), n[16] = T, n[17] = S, n[18] = N, n[19] = L, n[20] = R) : R = n[20];
288
- let z;
289
- n[21] === R ? z = n[22] : (z = ["relative w-full px-3 pt-4 pb-2 text-base bg-transparent border rounded-md outline-none transition-all text-[14px]", R], n[21] = R, n[22] = z);
290
- let B = z.join(" "), V;
291
- n[23] === Symbol.for("react.memo_cache_sentinel") ? (V = () => P(!0), n[23] = V) : V = n[23];
292
- let H;
293
- n[24] === a ? H = n[25] : (H = (e) => {
294
- P(!1), a?.(e);
295
- }, n[24] = a, n[25] = H);
296
- let U = F ? M : "", W = `outline-0 w-full text-[16px] sm:text-[14px] resize-none bg-transparent ${T ? "cursor-not-allowed" : ""}`, G;
297
- n[26] !== T || n[27] !== r || n[28] !== i || n[29] !== o || n[30] !== s || n[31] !== O || n[32] !== H || n[33] !== U || n[34] !== W || n[35] !== x ? (G = /* @__PURE__ */ d("textarea", {
298
- id: i,
299
- name: i,
300
- value: x,
301
- disabled: T,
302
- rows: O,
303
- maxLength: r,
304
- onChange: o,
305
- onFocus: V,
306
- onBlur: H,
307
- placeholder: U,
308
- className: W,
309
- ...s
310
- }), n[26] = T, n[27] = r, n[28] = i, n[29] = o, n[30] = s, n[31] = O, n[32] = H, n[33] = U, n[34] = W, n[35] = x, n[36] = G) : G = n[36];
311
- let K = !!T, q = !!x, J;
312
- n[37] !== k || n[38] !== S || n[39] !== N || n[40] !== b || n[41] !== i || n[42] !== w || n[43] !== K || n[44] !== q ? (J = /* @__PURE__ */ d(A, {
313
- label: b,
314
- name: i,
315
- required: w,
316
- error: S,
317
- disabled: K,
318
- isFocused: N,
319
- hasValue: q,
320
- labelBgClassName: k,
321
- inactiveTopClassName: "top-3.5",
322
- labelRestClassName: "w-11/12"
323
- }), n[37] = k, n[38] = S, n[39] = N, n[40] = b, n[41] = i, n[42] = w, n[43] = K, n[44] = q, n[45] = J) : J = n[45];
324
- let ee;
325
- n[46] !== r || n[47] !== x ? (ee = r == null ? null : /* @__PURE__ */ f("span", {
326
- className: "absolute bottom-2 right-3 text-xs text-secondary/40",
327
- children: [
328
- String(x).length,
329
- "/",
330
- r
331
- ]
332
- }), n[46] = r, n[47] = x, n[48] = ee) : ee = n[48];
333
- let Y;
334
- n[49] !== B || n[50] !== G || n[51] !== J || n[52] !== ee ? (Y = /* @__PURE__ */ f("div", {
335
- className: B,
336
- children: [
337
- G,
338
- J,
339
- ee
340
- ]
341
- }), n[49] = B, n[50] = G, n[51] = J, n[52] = ee, n[53] = Y) : Y = n[53];
342
- let X;
343
- n[54] !== S || n[55] !== C ? (X = (S || C) && /* @__PURE__ */ d("p", {
344
- className: `mt-1 text-sm ${S ? "text-red-500" : "text-secondary/50"}`,
345
- children: S || C
346
- }), n[54] = S, n[55] = C, n[56] = X) : X = n[56];
347
- let Z;
348
- return n[57] !== I || n[58] !== Y || n[59] !== X ? (Z = /* @__PURE__ */ f("div", {
349
- className: I,
350
- children: [Y, X]
351
- }), n[57] = I, n[58] = Y, n[59] = X, n[60] = Z) : Z = n[60], Z;
352
- }
353
- function L(t) {
354
- let n = (0, D.c)(65), r, i, a, o, s, c, l, u, p, m, h, g, _, v, y;
355
- n[0] === t ? (r = n[1], i = n[2], a = n[3], o = n[4], s = n[5], c = n[6], l = n[7], u = n[8], p = n[9], m = n[10], h = n[11], g = n[12], _ = n[13], v = n[14], y = n[15]) : ({label: l, name: i, value: u, onChange: o, onBlur: a, error: p, description: m, helperText: h, countryOptions: g, countryCode: r, onSelectCountryCode: s, required: _, disabled: v, className: y, ...c} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = o, n[5] = s, n[6] = c, n[7] = l, n[8] = u, n[9] = p, n[10] = m, n[11] = h, n[12] = g, n[13] = _, n[14] = v, n[15] = y);
356
- let b = l === void 0 ? "" : l, x = u === void 0 ? "" : u, S = p === void 0 ? "" : p, C = m === void 0 ? "" : m, w = h === void 0 ? "" : h, T;
357
- n[16] === g ? T = n[17] : (T = g === void 0 ? [] : g, n[16] = g, n[17] = T);
358
- let E = T, O = _ === void 0 ? !1 : _, k = v === void 0 ? !1 : v, A = y === void 0 ? "" : y, [M, N] = e.useState(!1), P = M || !!x, F = !!r && E && E.length > 0, I = `relative ${A}`, L, z;
359
- n[18] === Symbol.for("react.memo_cache_sentinel") ? (L = () => N(!0), z = () => N(!1), n[18] = L, n[19] = z) : (L = n[18], z = n[19]);
360
- let B = !!x, V;
361
- n[20] !== k || n[21] !== S || n[22] !== M || n[23] !== B ? (V = j(S, M, B, k), n[20] = k, n[21] = S, n[22] = M, n[23] = B, n[24] = V) : V = n[24];
362
- let H;
363
- n[25] === V ? H = n[26] : (H = ["flex items-center border sm:h-[48px] h-[42px] px-3 rounded-md transition-all bg-white", V], n[25] = V, n[26] = H);
364
- let U = H.join(" "), W;
365
- n[27] !== r || n[28] !== E || n[29] !== k || n[30] !== s || n[31] !== F ? (W = F ? /* @__PURE__ */ d("select", {
366
- disabled: k,
367
- className: "text-sm bg-transparent outline-none border-none mr-2",
368
- value: r,
369
- onChange: s,
370
- children: E.map(R)
371
- }) : null, n[27] = r, n[28] = E, n[29] = k, n[30] = s, n[31] = F, n[32] = W) : W = n[32];
372
- let G;
373
- n[33] !== k || n[34] !== i || n[35] !== a || n[36] !== o || n[37] !== c || n[38] !== x ? (G = /* @__PURE__ */ d("input", {
374
- id: i,
375
- name: i,
376
- type: "tel",
377
- value: x,
378
- disabled: k,
379
- onChange: o,
380
- onBlur: a,
381
- placeholder: "",
382
- className: "peer w-full text-base bg-transparent outline-none text-[16px] sm:text-[14px]",
383
- ...c
384
- }), n[33] = k, n[34] = i, n[35] = a, n[36] = o, n[37] = c, n[38] = x, n[39] = G) : G = n[39];
385
- let K;
386
- n[40] !== U || n[41] !== W || n[42] !== G ? (K = /* @__PURE__ */ f("div", {
387
- className: U,
388
- children: [W, G]
389
- }), n[40] = U, n[41] = W, n[42] = G, n[43] = K) : K = n[43];
390
- let q = P ? "-top-2.5 text-sm! text-secondary bg-white font-bold" : "top-2.5 text-secondary/50 w-11/12", J = S ? "!text-red-500" : "", ee;
391
- n[44] !== q || n[45] !== J ? (ee = [
392
- "absolute left-2 px-1 transition-all duration-300 ease-in-out bg-white sm:text-base text-sm pointer-events-none",
393
- q,
394
- J
395
- ], n[44] = q, n[45] = J, n[46] = ee) : ee = n[46];
396
- let Y = ee.join(" "), X;
397
- n[47] === O ? X = n[48] : (X = O ? /* @__PURE__ */ d("span", {
398
- className: "text-red-500 ml-0.5",
399
- children: "*"
400
- }) : null, n[47] = O, n[48] = X);
401
- let Z;
402
- n[49] !== b || n[50] !== i || n[51] !== Y || n[52] !== X ? (Z = /* @__PURE__ */ f("label", {
403
- htmlFor: i,
404
- className: Y,
405
- children: [b, X]
406
- }), n[49] = b, n[50] = i, n[51] = Y, n[52] = X, n[53] = Z) : Z = n[53];
407
- let Q;
408
- n[54] !== S || n[55] !== w ? (Q = (S || w) && /* @__PURE__ */ d("p", {
409
- className: `mt-1 text-sm ${S ? "text-red-500" : "text-secondary/50"}`,
410
- children: S || w
411
- }), n[54] = S, n[55] = w, n[56] = Q) : Q = n[56];
412
- let te;
413
- n[57] === C ? te = n[58] : (te = C ? /* @__PURE__ */ d("div", {
414
- className: "mt-1 sm:text-base text-sm text-secondary/60",
415
- children: C
416
- }) : null, n[57] = C, n[58] = te);
417
- let $;
418
- return n[59] !== I || n[60] !== K || n[61] !== Z || n[62] !== Q || n[63] !== te ? ($ = /* @__PURE__ */ f("div", {
419
- className: I,
420
- onFocus: L,
421
- onBlur: z,
422
- children: [
423
- K,
424
- Z,
425
- Q,
426
- te
427
- ]
428
- }), n[59] = I, n[60] = K, n[61] = Z, n[62] = Q, n[63] = te, n[64] = $) : $ = n[64], $;
429
- }
430
- function R(e) {
431
- return /* @__PURE__ */ f("option", {
432
- value: e.code,
433
- children: [
434
- e.code,
435
- " (",
436
- e.dialCode,
437
- ")"
438
- ]
439
- }, e.code);
440
- }
441
- function z({ label: t = "", name: n, value: r = "", onChange: i, onBlur: a, onSelect: o, fetchSuggestions: s, debounceMs: c = 300, minQueryLength: l = 4, error: u = "", helperText: p = "", required: m = !1, disabled: h = !1, className: g = "", ..._ }) {
442
- let [v, y] = e.useState(!1), [b, x] = e.useState([]), [S, C] = e.useState(!1), [w, T] = e.useState(!1), E = e.useRef(null), D = e.useRef(null), O = e.useRef(!1), k = e.useRef(!1);
443
- e.useEffect(() => {
444
- if (O.current) {
445
- O.current = !1, k.current = !1;
446
- return;
447
- }
448
- if (!r || r.length < l) {
449
- x([]), T(!1);
450
- return;
451
- }
452
- if (!k.current) return;
453
- let e = setTimeout(async () => {
454
- try {
455
- C(!0);
456
- let e = await s(r);
457
- x(e), T(e.length > 0);
458
- } catch {
459
- x([]), T(!1);
460
- } finally {
461
- C(!1);
462
- }
463
- }, c);
464
- return () => clearTimeout(e);
465
- }, [
466
- r,
467
- s,
468
- c,
469
- l
470
- ]), e.useEffect(() => {
471
- let e = (e) => {
472
- D.current && !D.current.contains(e.target) && E.current && !E.current.contains(e.target) && T(!1);
473
- };
474
- return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
475
- }, []);
476
- let M = (e) => {
477
- let t = e.value ?? e.postalCode ?? e.description ?? "";
478
- O.current = !0, i?.({ target: {
479
- value: t,
480
- name: n ?? ""
481
- } }), o?.(e), T(!1), x([]);
482
- };
483
- return /* @__PURE__ */ f("div", {
484
- className: `relative ${g} ${h ? "opacity-75" : ""}`,
485
- children: [
486
- /* @__PURE__ */ f("div", {
487
- className: ["relative peer w-full sm:h-[48px] h-[42px] px-3 text-base bg-transparent border rounded-md outline-none transition-all text-[14px] flex items-center", j(u, v, !!r, h)].join(" "),
488
- children: [
489
- /* @__PURE__ */ d("input", {
490
- id: n,
491
- name: n,
492
- type: "text",
493
- value: r,
494
- disabled: h,
495
- onChange: (e) => {
496
- k.current = !0, i?.(e);
497
- },
498
- onFocus: () => y(!0),
499
- onBlur: (e) => {
500
- setTimeout(() => y(!1), 200), a?.(e);
501
- },
502
- placeholder: "",
503
- ref: E,
504
- className: `outline-0 w-full text-[16px] sm:text-[14px] ${h ? "cursor-not-allowed" : ""}`,
505
- autoComplete: "off",
506
- ..._
507
- }),
508
- S ? /* @__PURE__ */ d("div", {
509
- className: "absolute right-3 top-1/2 -translate-y-1/2",
510
- children: /* @__PURE__ */ d("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-primary" })
511
- }) : null,
512
- /* @__PURE__ */ d(A, {
513
- label: t,
514
- name: n,
515
- required: m,
516
- error: u,
517
- disabled: !!h,
518
- isFocused: v,
519
- hasValue: !!r
520
- })
521
- ]
522
- }),
523
- w && b.length > 0 ? /* @__PURE__ */ d("div", {
524
- ref: D,
525
- className: "absolute z-50 w-full mt-1 bg-white border border-primary/50 rounded-md shadow-lg max-h-60 overflow-y-auto",
526
- children: b.map((e, t) => /* @__PURE__ */ f("div", {
527
- role: "option",
528
- tabIndex: 0,
529
- className: "px-4 py-3 hover:bg-primary/10 cursor-pointer transition-colors border-b border-primary/10 last:border-b-0",
530
- onClick: () => M(e),
531
- onKeyDown: (t) => {
532
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), M(e));
533
- },
534
- children: [/* @__PURE__ */ d("p", {
535
- className: "text-sm text-secondary font-medium",
536
- children: e.formattedAddress || e.description
537
- }), e.secondaryText ? /* @__PURE__ */ d("p", {
538
- className: "text-xs text-secondary/60 mt-0.5",
539
- children: e.secondaryText
540
- }) : null]
541
- }, e.id ?? t))
542
- }) : null,
543
- (u || p) && /* @__PURE__ */ d("p", {
544
- className: `mt-1 text-sm ${u ? "text-red-500" : "text-secondary/50"}`,
545
- children: u || p
546
- })
547
- ]
548
- });
549
- }
550
- function B(e) {
551
- let t = (0, D.c)(32), { placeholder: n, value: r, onChange: i, error: a, inputProps: o, label: s, labelClassName: c, description: l, descriptionClassName: u, leftComponent: p, rightComponent: m, className: h, containerClassName: g, errorClassName: _ } = e, v = n === void 0 ? "Enter text" : n, y;
552
- t[0] === o ? y = t[1] : (y = o === void 0 ? {} : o, t[0] = o, t[1] = y);
553
- let b = y, x = c === void 0 ? "" : c, S = u === void 0 ? "" : u, C = h === void 0 ? "" : h, w = g === void 0 ? "" : g, T = _ === void 0 ? "" : _, E;
554
- t[2] !== s || t[3] !== x ? (E = s ? /* @__PURE__ */ d("label", {
555
- className: `block text-sm sm:text-lg font-bold text-secondary mb-1 ${x}`,
556
- children: s
557
- }) : null, t[2] = s, t[3] = x, t[4] = E) : E = t[4];
558
- let O;
559
- t[5] !== l || t[6] !== S ? (O = l ? /* @__PURE__ */ d("div", {
560
- className: `block text-xs sm:text-base text-secondary/50 mb-2 ${S}`,
561
- children: l
562
- }) : null, t[5] = l, t[6] = S, t[7] = O) : O = t[7];
563
- let k = "flex items-center rounded-medium sm:rounded-primary md:rounded-medium lg:rounded-primary bg-white outline -outline-offset-1 outline-primary/50 has-[input:focus-within]:outline-1 has-[input:focus-within]:outline-offset-1 has-[input:focus-within]:outline-primary text-sm sm:text-base " + w, A;
564
- t[8] === i ? A = t[9] : (A = (e) => i?.(e.currentTarget.value), t[8] = i, t[9] = A);
565
- let j = "block min-w-0 grow sm:py-2.5 py-1.5 pr-3 pl-3 text-[16px] sm:text-[14px] focus:outline-none " + C, M;
566
- t[10] !== b || t[11] !== v || t[12] !== A || t[13] !== j || t[14] !== r ? (M = /* @__PURE__ */ d("input", {
567
- placeholder: v,
568
- value: r,
569
- onChange: A,
570
- className: j,
571
- ...b
572
- }), t[10] = b, t[11] = v, t[12] = A, t[13] = j, t[14] = r, t[15] = M) : M = t[15];
573
- let P;
574
- t[16] !== a || t[17] !== m ? (P = a ? /* @__PURE__ */ d(N, {}) : m, t[16] = a, t[17] = m, t[18] = P) : P = t[18];
575
- let F;
576
- t[19] !== p || t[20] !== k || t[21] !== M || t[22] !== P ? (F = /* @__PURE__ */ f("div", {
577
- className: k,
578
- children: [
579
- p,
580
- M,
581
- P
582
- ]
583
- }), t[19] = p, t[20] = k, t[21] = M, t[22] = P, t[23] = F) : F = t[23];
584
- let I;
585
- t[24] !== a || t[25] !== T ? (I = a ? /* @__PURE__ */ d("div", {
586
- className: "text-2xs font-semibold text-red-500 mt-0.75 pl-3 " + T,
587
- children: a
588
- }) : null, t[24] = a, t[25] = T, t[26] = I) : I = t[26];
589
- let L;
590
- return t[27] !== O || t[28] !== F || t[29] !== I || t[30] !== E ? (L = /* @__PURE__ */ f("div", {
591
- className: "w-full",
592
- children: [
593
- E,
594
- O,
595
- F,
596
- I
597
- ]
598
- }), t[27] = O, t[28] = F, t[29] = I, t[30] = E, t[31] = L) : L = t[31], L;
599
- }
600
- function V(e) {
601
- let t = (0, D.c)(10);
602
- if (e.variant === "stacked") {
603
- let n;
604
- return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ d(B, { ...e }), t[0] = e, t[1] = n), n;
605
- }
606
- let n = e.kind ?? "text";
607
- if (n === "textarea") {
608
- let n = e, r;
609
- return t[2] === n ? r = t[3] : (r = /* @__PURE__ */ d(I, { ...n }), t[2] = n, t[3] = r), r;
610
- }
611
- if (n === "phone") {
612
- let n = e, r;
613
- return t[4] === n ? r = t[5] : (r = /* @__PURE__ */ d(L, { ...n }), t[4] = n, t[5] = r), r;
614
- }
615
- if (n === "autocomplete") {
616
- let n = e, r;
617
- return t[6] === n ? r = t[7] : (r = /* @__PURE__ */ d(z, { ...n }), t[6] = n, t[7] = r), r;
618
- }
619
- let r = e, i;
620
- return t[8] === r ? i = t[9] : (i = /* @__PURE__ */ d(P, { ...r }), t[8] = r, t[9] = i), i;
621
- }
622
- //#endregion
623
- //#region src/ui/Dropdown.tsx
624
- function H(e) {
625
- return e.map((e) => typeof e == "string" ? {
626
- value: e,
627
- label: e
628
- } : {
629
- ...e,
630
- value: String(e.value)
631
- });
632
- }
633
- function U(e) {
634
- let t = (0, D.c)(6), { open: n, className: r } = e, i = n ? "rotate-180" : "rotate-0", a = r ?? "", o;
635
- t[0] !== i || t[1] !== a ? (o = [
636
- "shrink-0 fill-secondary transition-transform duration-200 pointer-events-none",
637
- i,
638
- a
639
- ].filter(Boolean), t[0] = i, t[1] = a, t[2] = o) : o = t[2];
640
- let s = o.join(" "), c;
641
- t[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ d("path", { d: "M7 10l5 5 5-5H7z" }), t[3] = c) : c = t[3];
642
- let l;
643
- return t[4] === s ? l = t[5] : (l = /* @__PURE__ */ d("svg", {
644
- xmlns: "http://www.w3.org/2000/svg",
645
- viewBox: "0 0 24 24",
646
- className: s,
647
- "aria-hidden": !0,
648
- children: c
649
- }), t[4] = s, t[5] = l), l;
650
- }
651
- function W(e) {
652
- let t = (0, D.c)(9), { description: n, error: r, helperText: i, helperClassName: a } = e, o = a === void 0 ? "text-sm" : a, s;
653
- t[0] === n ? s = t[1] : (s = n ? /* @__PURE__ */ d("div", {
654
- className: "mt-1 sm:text-base text-sm text-secondary/60",
655
- children: n
656
- }) : null, t[0] = n, t[1] = s);
657
- let c;
658
- t[2] !== r || t[3] !== o || t[4] !== i ? (c = (r || i) && /* @__PURE__ */ d("p", {
659
- className: `mt-1 ${o} ${r ? "text-red-500" : "text-secondary/50"}`,
660
- children: r || i
661
- }), t[2] = r, t[3] = o, t[4] = i, t[5] = c) : c = t[5];
662
- let l;
663
- return t[6] !== s || t[7] !== c ? (l = /* @__PURE__ */ f(u, { children: [s, c] }), t[6] = s, t[7] = c, t[8] = l) : l = t[8], l;
664
- }
665
- function G(t) {
666
- let n = (0, D.c)(37), { label: r, description: i, placeholder: a, options: o, value: s, onValueChange: c, multiple: l, error: u, errors: p, className: m, disabled: h, name: g, id: _ } = t, v = a === void 0 ? "Select…" : a, y = l === void 0 ? !1 : l, b = m === void 0 ? "" : m, x = h === void 0 ? !1 : h, S = H(o), C = u ?? p, [w, T] = e.useState(!1), E = _ ?? g, O = `relative space-y-0 ${b}`, k;
667
- n[0] !== r || n[1] !== E ? (k = r ? /* @__PURE__ */ d("label", {
668
- htmlFor: E,
669
- className: "block text-secondary text-sm sm:text-lg font-bold mb-2",
670
- children: r
671
- }) : null, n[0] = r, n[1] = E, n[2] = k) : k = n[2];
672
- let A;
673
- n[3] === i ? A = n[4] : (A = i ? /* @__PURE__ */ d("p", {
674
- className: "mb-2 sm:text-base text-sm text-secondary/75",
675
- children: i
676
- }) : null, n[3] = i, n[4] = A);
677
- let j, M;
678
- n[5] === Symbol.for("react.memo_cache_sentinel") ? (M = () => T(J), j = () => T(!1), n[5] = j, n[6] = M) : (j = n[5], M = n[6]);
679
- let N;
680
- n[7] !== y || n[8] !== c ? (N = (e) => {
681
- T(!1), c(y ? Array.from(e.target.selectedOptions).map(q) : e.target.value);
682
- }, n[7] = y, n[8] = c, n[9] = N) : N = n[9];
683
- let P;
684
- n[10] !== y || n[11] !== v ? (P = y ? null : /* @__PURE__ */ d("option", {
685
- value: "",
686
- disabled: !0,
687
- children: v
688
- }), n[10] = y, n[11] = v, n[12] = P) : P = n[12];
689
- let F = S.map(K), I;
690
- n[13] !== x || n[14] !== y || n[15] !== g || n[16] !== E || n[17] !== j || n[18] !== N || n[19] !== P || n[20] !== F || n[21] !== M || n[22] !== s ? (I = /* @__PURE__ */ f("select", {
691
- id: E,
692
- name: g,
693
- multiple: y,
694
- disabled: x,
695
- value: s,
696
- onMouseDown: M,
697
- onBlur: j,
698
- onChange: N,
699
- className: "appearance-none w-full sm:px-3 sm:py-2.5 px-3 py-1.5 text-sm sm:text-base rounded-medium sm:rounded-primary md:rounded-medium lg:rounded-primary outline -outline-offset-1 outline-primary/50 focus:outline-offset-1 focus:outline-primary cursor-pointer disabled:cursor-not-allowed disabled:opacity-75",
700
- children: [P, F]
701
- }), n[13] = x, n[14] = y, n[15] = g, n[16] = E, n[17] = j, n[18] = N, n[19] = P, n[20] = F, n[21] = M, n[22] = s, n[23] = I) : I = n[23];
702
- let L;
703
- n[24] === w ? L = n[25] : (L = /* @__PURE__ */ d("div", {
704
- className: "pointer-events-none absolute inset-y-0 right-3 flex items-center",
705
- children: /* @__PURE__ */ d(U, {
706
- open: w,
707
- className: "sm:w-4 sm:h-4 w-2.5 h-2.5"
708
- })
709
- }), n[24] = w, n[25] = L);
710
- let R;
711
- n[26] !== I || n[27] !== L ? (R = /* @__PURE__ */ f("div", {
712
- className: "relative",
713
- children: [I, L]
714
- }), n[26] = I, n[27] = L, n[28] = R) : R = n[28];
715
- let z;
716
- n[29] === C ? z = n[30] : (z = C ? /* @__PURE__ */ d("p", {
717
- className: "text-red-500 text-xs mt-1",
718
- children: C
719
- }) : null, n[29] = C, n[30] = z);
720
- let B;
721
- return n[31] !== R || n[32] !== z || n[33] !== O || n[34] !== k || n[35] !== A ? (B = /* @__PURE__ */ f("div", {
722
- className: O,
723
- children: [
724
- k,
725
- A,
726
- R,
727
- z
728
- ]
729
- }), n[31] = R, n[32] = z, n[33] = O, n[34] = k, n[35] = A, n[36] = B) : B = n[36], B;
730
- }
731
- function K(e) {
732
- return /* @__PURE__ */ d("option", {
733
- value: e.value,
734
- disabled: e.disabled,
735
- children: typeof e.label == "string" ? e.label : e.value
736
- }, e.value);
737
- }
738
- function q(e) {
739
- return e.value;
740
- }
741
- function J(e) {
742
- return !e;
743
- }
744
- function ee(e, t) {
745
- return !t || typeof e != "string" ? e : e.toLowerCase();
746
- }
747
- function Y(t) {
748
- let n = (0, D.c)(82), r, i, a, o, s, c, l, u, p, m, h, g, _, v, y, b, x, S, C, w;
749
- n[0] === t ? (r = n[1], i = n[2], a = n[3], o = n[4], s = n[5], c = n[6], l = n[7], u = n[8], p = n[9], m = n[10], h = n[11], g = n[12], _ = n[13], v = n[14], y = n[15], b = n[16], x = n[17], S = n[18], C = n[19], w = n[20]) : ({label: u, placeholder: _, name: i, id: r, value: v, onValueChange: o, onBlur: a, error: y, description: b, helperText: x, required: S, disabled: C, options: s, className: w, selectClassName: p, optionClassName: m, allowEmpty: h, optionLabelLowercase: g, style: l, ...c} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = o, n[5] = s, n[6] = c, n[7] = l, n[8] = u, n[9] = p, n[10] = m, n[11] = h, n[12] = g, n[13] = _, n[14] = v, n[15] = y, n[16] = b, n[17] = x, n[18] = S, n[19] = C, n[20] = w);
750
- let T = u === void 0 ? "" : u, E = _ === void 0 ? "" : _, O = v === void 0 ? "" : v, k = y === void 0 ? "" : y, A = b === void 0 ? "" : b, j = x === void 0 ? "" : x, M = S === void 0 ? !1 : S, N = C === void 0 ? !1 : C, P = w === void 0 ? "" : w, F = p === void 0 ? "" : p, I = m === void 0 ? "" : m, L = h === void 0 ? !0 : h, R = g === void 0 ? !1 : g, z = H(s), [B, V] = e.useState(!1), [G, K] = e.useState(!1), q = r ?? i, J, Y;
751
- n[21] === O ? (J = n[22], Y = n[23]) : (J = () => {
752
- O?.toString().trim() && V(!0);
753
- }, Y = [O], n[21] = O, n[22] = J, n[23] = Y), e.useEffect(J, Y);
754
- let X = `relative flex flex-col ${P}`, Z;
755
- n[24] === l ? Z = n[25] : (Z = {
756
- textTransform: "none",
757
- ...l
758
- }, n[24] = l, n[25] = Z);
759
- let Q;
760
- n[26] === o ? Q = n[27] : (Q = (e) => {
761
- o(e.target.value), K(!1);
762
- }, n[26] = o, n[27] = Q);
763
- let te;
764
- n[28] === Symbol.for("react.memo_cache_sentinel") ? (te = () => {
765
- V(!0), K(!0);
766
- }, n[28] = te) : te = n[28];
767
- let $;
768
- n[29] !== a || n[30] !== O ? ($ = (e) => {
769
- O?.toString().trim() || V(!1), K(!1), a?.(e);
770
- }, n[29] = a, n[30] = O, n[31] = $) : $ = n[31];
771
- let ne;
772
- n[32] === Symbol.for("react.memo_cache_sentinel") ? (ne = (e) => {
773
- e.target.tagName === "SELECT" && K(!0);
774
- }, n[32] = ne) : ne = n[32];
775
- let re = k ? "border-red-500" : B ? "border-primary" : "border-primary/50", ie = N ? "bg-white cursor-not-allowed opacity-75" : "", ae;
776
- n[33] !== F || n[34] !== re || n[35] !== ie ? (ae = [
777
- "min-h-[42px] peer w-full h-full pl-3 pr-10 py-3 sm:py-3 text-sm bg-transparent border rounded-md outline-none appearance-none transition-all text-[14px] text-ellipsis overflow-hidden whitespace-nowrap cursor-pointer",
778
- re,
779
- ie,
780
- F
781
- ].filter(Boolean), n[33] = F, n[34] = re, n[35] = ie, n[36] = ae) : ae = n[36];
782
- let oe = ae.join(" "), se = !L, ce = !L, le = E || T, ue;
783
- n[37] !== se || n[38] !== ce || n[39] !== le ? (ue = /* @__PURE__ */ d("option", {
784
- value: "",
785
- disabled: se,
786
- hidden: ce,
787
- children: le
788
- }), n[37] = se, n[38] = ce, n[39] = le, n[40] = ue) : ue = n[40];
789
- let de;
790
- n[41] !== I || n[42] !== R ? (de = (e, t) => /* @__PURE__ */ d("option", {
791
- value: e.value,
792
- disabled: e.disabled,
793
- className: `text-[14px] ${I}`,
794
- children: ee(e.label ?? e.value, R)
795
- }, e.value ?? t), n[41] = I, n[42] = R, n[43] = de) : de = n[43];
796
- let fe = z.map(de), pe;
797
- n[44] !== N || n[45] !== i || n[46] !== c || n[47] !== q || n[48] !== Z || n[49] !== Q || n[50] !== te || n[51] !== $ || n[52] !== ne || n[53] !== oe || n[54] !== ue || n[55] !== fe || n[56] !== O ? (pe = /* @__PURE__ */ f("select", {
798
- id: q,
799
- name: i,
800
- value: O,
801
- disabled: N,
802
- style: Z,
803
- onChange: Q,
804
- onFocus: te,
805
- onBlur: $,
806
- onMouseDown: ne,
807
- className: oe,
808
- ...c,
809
- children: [ue, fe]
810
- }), n[44] = N, n[45] = i, n[46] = c, n[47] = q, n[48] = Z, n[49] = Q, n[50] = te, n[51] = $, n[52] = ne, n[53] = oe, n[54] = ue, n[55] = fe, n[56] = O, n[57] = pe) : pe = n[57];
811
- let me = B ? "-top-2.5 text-sm! text-secondary bg-white font-bold" : "top-2.5 text-secondary/50 w-11/12", he = k ? "!text-red-500" : "", ge;
812
- n[58] !== me || n[59] !== he ? (ge = [
813
- "absolute left-2 px-1 transition-all duration-300 ease-in-out bg-white sm:text-base text-sm pointer-events-none",
814
- me,
815
- he
816
- ].filter(Boolean), n[58] = me, n[59] = he, n[60] = ge) : ge = n[60];
817
- let _e = ge.join(" "), ve;
818
- n[61] === M ? ve = n[62] : (ve = M ? /* @__PURE__ */ d("span", {
819
- className: "text-red-500 ml-0.5",
820
- children: "*"
821
- }) : null, n[61] = M, n[62] = ve);
822
- let ye;
823
- n[63] !== T || n[64] !== q || n[65] !== _e || n[66] !== ve ? (ye = /* @__PURE__ */ f("label", {
824
- htmlFor: q,
825
- className: _e,
826
- children: [T, ve]
827
- }), n[63] = T, n[64] = q, n[65] = _e, n[66] = ve, n[67] = ye) : ye = n[67];
828
- let be = B && G, xe;
829
- n[68] === be ? xe = n[69] : (xe = /* @__PURE__ */ d(U, {
830
- open: be,
831
- className: "absolute right-3 top-1/2 -translate-y-1/2 h-[14px] w-[14px]"
832
- }), n[68] = be, n[69] = xe);
833
- let Se;
834
- n[70] !== pe || n[71] !== ye || n[72] !== xe ? (Se = /* @__PURE__ */ f("div", {
835
- className: "relative",
836
- children: [
837
- pe,
838
- ye,
839
- xe
840
- ]
841
- }), n[70] = pe, n[71] = ye, n[72] = xe, n[73] = Se) : Se = n[73];
842
- let Ce;
843
- n[74] !== A || n[75] !== k || n[76] !== j ? (Ce = /* @__PURE__ */ d(W, {
844
- description: A,
845
- error: k,
846
- helperText: j
847
- }), n[74] = A, n[75] = k, n[76] = j, n[77] = Ce) : Ce = n[77];
848
- let we;
849
- return n[78] !== X || n[79] !== Se || n[80] !== Ce ? (we = /* @__PURE__ */ f("div", {
850
- className: X,
851
- children: [Se, Ce]
852
- }), n[78] = X, n[79] = Se, n[80] = Ce, n[81] = we) : we = n[81], we;
853
- }
854
- function X(t) {
855
- let n = (0, D.c)(27), { label: r, placeholder: i, name: a, value: o, onValueChange: s, onBlur: c, error: l, description: u, helperText: p, required: m, disabled: h, options: g, className: _, optionLabelLowercase: v, listMaxHeightClassName: y } = t, b = r === void 0 ? "" : r, x = i === void 0 ? "" : i, S = o === void 0 ? "" : o, C = l === void 0 ? "" : l, w = u === void 0 ? "" : u, T = p === void 0 ? "" : p, E = m === void 0 ? !1 : m, O = h === void 0 ? !1 : h, k = _ === void 0 ? "" : _, A = v === void 0 ? !1 : v, j = y === void 0 ? "max-h-[144px]" : y, M = H(g), N = e.useRef(null), [P, F] = e.useState(!1), [I, L] = e.useState(!1), R;
856
- n[0] === S ? R = n[1] : (R = (e) => String(e.value) === String(S), n[0] = S, n[1] = R);
857
- let z = M.find(R), B, V;
858
- n[2] !== c || n[3] !== S ? (B = () => {
859
- let e = (e) => {
860
- N.current && !N.current.contains(e.target) && (L(!1), S?.toString()?.trim() || F(!1), c?.());
861
- };
862
- return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
863
- }, V = [S, c], n[2] = c, n[3] = S, n[4] = B, n[5] = V) : (B = n[4], V = n[5]), e.useEffect(B, V);
864
- let G = C ? "border-red-500" : I || P ? "border-primary" : "border-primary/50", K = O ? "bg-white cursor-not-allowed opacity-50" : "cursor-pointer", q;
865
- n[6] !== G || n[7] !== K ? (q = [
866
- "min-h-[42px] w-full pl-3 pr-10 py-3 sm:py-3 text-sm bg-transparent border rounded-md outline-none transition-all text-[14px] flex items-center",
867
- G,
868
- K
869
- ].filter(Boolean), n[6] = G, n[7] = K, n[8] = q) : q = n[8];
870
- let J;
871
- n[9] === O ? J = n[10] : (J = () => {
872
- O || (L(Z), F(!0));
873
- }, n[9] = O, n[10] = J);
874
- let Y;
875
- n[11] === Symbol.for("react.memo_cache_sentinel") ? (Y = (e) => {
876
- e.key === "Escape" && L(!1);
877
- }, n[11] = Y) : Y = n[11];
878
- let X = P || z ? "-top-2.5 text-sm! text-secondary font-bold" : "top-2.5 text-secondary/50 w-11/12", Q = C ? "!text-red-500" : "", te;
879
- n[12] !== X || n[13] !== Q ? (te = [
880
- "absolute left-2 px-1 transition-all duration-300 ease-in-out bg-white sm:text-base text-sm pointer-events-none",
881
- X,
882
- Q
883
- ].filter(Boolean), n[12] = X, n[13] = Q, n[14] = te) : te = n[14];
884
- let $ = te.join(" "), ne;
885
- n[15] === E ? ne = n[16] : (ne = E ? /* @__PURE__ */ d("span", {
886
- className: "text-red-500 ml-0.5",
887
- children: "*"
888
- }) : null, n[15] = E, n[16] = ne);
889
- let re;
890
- n[17] !== b || n[18] !== $ || n[19] !== ne ? (re = /* @__PURE__ */ f("label", {
891
- className: $,
892
- children: [b, ne]
893
- }), n[17] = b, n[18] = $, n[19] = ne, n[20] = re) : re = n[20];
894
- let ie;
895
- n[21] === I ? ie = n[22] : (ie = /* @__PURE__ */ d(U, {
896
- open: I,
897
- className: "absolute right-3 top-1/2 -translate-y-1/2 h-[14px] w-[14px]"
898
- }), n[21] = I, n[22] = ie);
899
- let ae;
900
- return n[23] !== w || n[24] !== C || n[25] !== T ? (ae = /* @__PURE__ */ d(W, {
901
- description: w,
902
- error: C,
903
- helperText: T
904
- }), n[23] = w, n[24] = C, n[25] = T, n[26] = ae) : ae = n[26], /* @__PURE__ */ f("div", {
905
- ref: N,
906
- className: `relative flex flex-col ${k}`,
907
- children: [/* @__PURE__ */ f("div", {
908
- className: "relative",
909
- children: [
910
- /* @__PURE__ */ d("div", {
911
- id: a,
912
- role: "combobox",
913
- "aria-expanded": I,
914
- "aria-haspopup": "listbox",
915
- className: q.join(" "),
916
- onClick: J,
917
- onKeyDown: Y,
918
- children: /* @__PURE__ */ d("span", {
919
- className: z ? "text-secondary" : "text-secondary/40 text-sm truncate",
920
- children: z ? ee(z.label ?? z.value, A) : x || b
921
- })
922
- }),
923
- re,
924
- ie,
925
- I && !O ? /* @__PURE__ */ d("ul", {
926
- role: "listbox",
927
- className: `absolute z-30 top-full mt-1 w-full bg-white border border-primary/50 rounded-md shadow-lg ${j} overflow-y-auto`,
928
- children: M.map((e, t) => {
929
- let n = String(e.value), r = n === String(S);
930
- return /* @__PURE__ */ d("li", {
931
- role: "option",
932
- "aria-selected": r,
933
- onClick: () => {
934
- s(n), L(!1);
935
- },
936
- className: ["px-3 py-2 cursor-pointer text-sm hover:bg-primary/10", r ? "bg-primary/5 font-semibold text-primary" : "text-secondary"].filter(Boolean).join(" "),
937
- children: ee(e.label ?? e.value, A)
938
- }, e.value ?? t);
939
- })
940
- }) : null
941
- ]
942
- }), ae]
943
- });
944
- }
945
- function Z(e) {
946
- return !e;
947
- }
948
- function Q(t) {
949
- let n = (0, D.c)(36), { label: r, name: i, id: a, placeholder: o, options: s, onSelectionChange: c, onToggle: l, onBlur: u, error: p, description: m, helperText: h, required: g, disabled: _, className: v } = t, y = r === void 0 ? "" : r, b = o === void 0 ? "Select an option" : o, x = p === void 0 ? "" : p, S = m === void 0 ? "" : m, C = h === void 0 ? "" : h, w = g === void 0 ? !1 : g, T = _ === void 0 ? !1 : _, E = v === void 0 ? "" : v, O = H(s), k = "field" in t && t.field ? t.field.value : t.value, A = "field" in t && t.field ? t.field.onChange : t.onValueChange, j = "field" in t && t.field ? t.field.onBlur : void 0, [M, N] = e.useState(!1), [P, F] = e.useState(!1), I = e.useRef(null), L = a ?? i ?? "dropdown-custom-trigger", R;
950
- n[0] === k ? R = n[1] : (R = (e) => e.value === k, n[0] = k, n[1] = R);
951
- let z = O.find(R), B = !!(P || k), V, G;
952
- n[2] === Symbol.for("react.memo_cache_sentinel") ? (G = () => {
953
- let e = (e) => {
954
- I.current && !I.current.contains(e.target) && (N(!1), F(!1));
955
- };
956
- return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
957
- }, V = [], n[2] = V, n[3] = G) : (V = n[2], G = n[3]), e.useEffect(G, V);
958
- let K, q;
959
- n[4] !== M || n[5] !== l ? (K = () => {
960
- l?.(M);
961
- }, q = [M, l], n[4] = M, n[5] = l, n[6] = K, n[7] = q) : (K = n[6], q = n[7]), e.useEffect(K, q);
962
- let J = () => z?.label == null ? P || M ? b : "" : z.label, ee = B ? "-top-2.5 translate-y-0 text-sm! text-secondary font-bold" : `${x ? "top-1/3" : "top-1/2"} -translate-y-1/2 text-secondary/50 w-[86%] truncate`, Y = x ? "!text-red-500" : "", X;
963
- n[8] !== ee || n[9] !== Y ? (X = [
964
- "absolute left-2 px-1 text-[14px] transition-all duration-300 ease-in-out bg-white sm:text-base text-sm z-10 pointer-events-none",
965
- ee,
966
- Y
967
- ].filter(Boolean), n[8] = ee, n[9] = Y, n[10] = X) : X = n[10];
968
- let Z = X.join(" "), Q;
969
- n[11] === w ? Q = n[12] : (Q = w ? /* @__PURE__ */ d("span", {
970
- className: "text-red-500 ml-0.5",
971
- children: "*"
972
- }) : null, n[11] = w, n[12] = Q);
973
- let $;
974
- n[13] !== L || n[14] !== y || n[15] !== Z || n[16] !== Q ? ($ = /* @__PURE__ */ f("label", {
975
- htmlFor: L,
976
- className: Z,
977
- children: [y, Q]
978
- }), n[13] = L, n[14] = y, n[15] = Z, n[16] = Q, n[17] = $) : $ = n[17];
979
- let ne, re;
980
- n[18] === Symbol.for("react.memo_cache_sentinel") ? (ne = () => {
981
- N(te), F(!0);
982
- }, re = () => F(!0), n[18] = ne, n[19] = re) : (ne = n[18], re = n[19]);
983
- let ie;
984
- n[20] !== u || n[21] !== j ? (ie = (e) => {
985
- F(!1), u?.(e), j?.(e);
986
- }, n[20] = u, n[21] = j, n[22] = ie) : ie = n[22];
987
- let ae = T ? "bg-white cursor-not-allowed opacity-75" : "", oe = x ? "border-red-500" : P || k ? "border-primary" : "border-primary/50", se;
988
- n[23] !== ae || n[24] !== oe ? (se = [
989
- "peer w-full sm:h-[48px] h-[42px] px-3 text-left text-[14px] text-base bg-transparent border rounded-md outline-none transition-all",
990
- ae,
991
- oe
992
- ].filter(Boolean), n[23] = ae, n[24] = oe, n[25] = se) : se = n[25];
993
- let ce = `absolute right-3 ${x ? "top-1/3" : "top-1/2"} -translate-y-1/2 h-[14px] w-[14px]`, le;
994
- n[26] !== M || n[27] !== ce ? (le = /* @__PURE__ */ d(U, {
995
- open: M,
996
- className: ce
997
- }), n[26] = M, n[27] = ce, n[28] = le) : le = n[28];
998
- let ue;
999
- n[29] !== S || n[30] !== x || n[31] !== C ? (ue = /* @__PURE__ */ d(W, {
1000
- description: S,
1001
- error: x,
1002
- helperText: C
1003
- }), n[29] = S, n[30] = x, n[31] = C, n[32] = ue) : ue = n[32];
1004
- let de;
1005
- return n[33] !== i || n[34] !== k ? (de = i ? /* @__PURE__ */ d("input", {
1006
- type: "hidden",
1007
- name: i,
1008
- value: k,
1009
- readOnly: !0
1010
- }) : null, n[33] = i, n[34] = k, n[35] = de) : de = n[35], /* @__PURE__ */ f("div", {
1011
- className: `relative ${E}`,
1012
- ref: I,
1013
- children: [
1014
- $,
1015
- /* @__PURE__ */ d("button", {
1016
- id: L,
1017
- type: "button",
1018
- disabled: T,
1019
- onClick: ne,
1020
- onFocus: re,
1021
- onBlur: ie,
1022
- className: se.join(" "),
1023
- children: /* @__PURE__ */ d("div", {
1024
- className: `${k ? "text-secondary" : "text-gray-500"} truncate`,
1025
- children: J()
1026
- })
1027
- }),
1028
- M ? /* @__PURE__ */ d("div", {
1029
- className: "absolute z-50 w-full mt-1 bg-white border shadow-primary border-primary rounded-md overflow-hidden overflow-y-auto max-h-60",
1030
- children: O.map((e) => {
1031
- let t = e.label ?? e.value, n = e.description;
1032
- return /* @__PURE__ */ f("div", {
1033
- role: "option",
1034
- tabIndex: 0,
1035
- onClick: () => {
1036
- A(e.value), c?.(e), N(!1);
1037
- },
1038
- onKeyDown: (t) => {
1039
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), A(e.value), c?.(e), N(!1));
1040
- },
1041
- className: "px-4 py-3 hover:bg-gray-50 cursor-pointer text-[14px]",
1042
- children: [/* @__PURE__ */ d("div", {
1043
- className: "text-secondary text-sm sm:text-lg",
1044
- children: t
1045
- }), n ? /* @__PURE__ */ d("div", {
1046
- className: "text-sm sm:text-sm text-secondary/75 mt-1",
1047
- children: n
1048
- }) : null]
1049
- }, e.value);
1050
- })
1051
- }) : null,
1052
- le,
1053
- ue,
1054
- de
1055
- ]
1056
- });
1057
- }
1058
- function te(e) {
1059
- return !e;
1060
- }
1061
- function $(t) {
1062
- let n = (0, D.c)(44), { label: r, placeholder: i, name: a, value: o, onValueChange: s, onBlur: c, options: l, allOptions: u, maxSelect: p, error: m, description: h, helperText: g, required: _, disabled: v, className: y } = t, b = r === void 0 ? "" : r, x = i === void 0 ? "" : i, S = o === void 0 ? [] : o, C = p === void 0 ? 4 : p, w = m === void 0 ? "" : m, T = h === void 0 ? "" : h, E = g === void 0 ? "" : g, O = _ === void 0 ? !1 : _, k = v === void 0 ? !1 : v, A = y === void 0 ? "" : y, j = H(l), M = H(u ?? l), N = e.useRef(null), [P, F] = e.useState(!1), [I, L] = e.useState(!1);
1063
- e.useEffect(() => {
1064
- S.length > 0 && F(!0);
1065
- }, [S]);
1066
- let R, z;
1067
- n[0] === c ? (R = n[1], z = n[2]) : (R = () => {
1068
- let e = (e) => {
1069
- N.current && !N.current.contains(e.target) && (L(!1), F(!1), c?.(e));
1070
- };
1071
- return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
1072
- }, z = [c], n[0] = c, n[1] = R, n[2] = z), e.useEffect(R, z);
1073
- let B = (e) => {
1074
- if (!e) return;
1075
- let t = S.some((t) => t == e), n;
1076
- if (t) n = S.filter((t) => t != e);
1077
- else {
1078
- if (S.length >= C) return;
1079
- n = [...S, e];
1080
- }
1081
- s(n);
1082
- }, V = (e) => {
1083
- s(S.filter((t) => t !== e));
1084
- }, G = j.filter((e) => !S.some((t) => t == e.value)), K = `relative flex flex-col ${A}`, q = w ? "border-red-500" : P ? "border-primary" : "border-primary/50", J = k ? "bg-gray-100 cursor-not-allowed" : "bg-white cursor-pointer", ee;
1085
- n[3] !== q || n[4] !== J ? (ee = [
1086
- "relative flex flex-wrap items-center gap-1 min-h-[42px] peer w-full px-3 sm:py-3 py-3 border rounded-md",
1087
- q,
1088
- J
1089
- ].filter(Boolean), n[3] = q, n[4] = J, n[5] = ee) : ee = n[5];
1090
- let Y = ee.join(" "), X;
1091
- n[6] === k ? X = n[7] : (X = () => !k && L(ne), n[6] = k, n[7] = X);
1092
- let Z;
1093
- n[8] === Symbol.for("react.memo_cache_sentinel") ? (Z = (e) => e.key === "Escape" && L(!1), n[8] = Z) : Z = n[8];
1094
- let Q = k ? -1 : 0, te = S.length > 0 ? /* @__PURE__ */ d("div", {
1095
- className: "flex flex-wrap items-center gap-1 py-1 sm:py-0",
1096
- children: S.map((e, t) => {
1097
- let n = M.find((t) => (t.value || t) == e), r = typeof n?.label == "string" ? n.label : n?.label ?? n?.value ?? e;
1098
- return /* @__PURE__ */ f("span", {
1099
- className: "flex items-center gap-1 bg-primary/10 text-primary text-xs px-2 py-1 rounded-full",
1100
- children: [r, /* @__PURE__ */ d("button", {
1101
- type: "button",
1102
- className: "text-red-500 ml-1 border-0 bg-transparent p-0 cursor-pointer",
1103
- "aria-label": `Remove ${String(r)}`,
1104
- onClick: (t) => {
1105
- t.stopPropagation(), V(e);
1106
- },
1107
- children: "✕"
1108
- })]
1109
- }, `${e}-${t}`);
1110
- })
1111
- }) : /* @__PURE__ */ d("span", {
1112
- className: "text-secondary/50 text-sm",
1113
- children: x || `Select ${b}`
1114
- }), $;
1115
- n[9] === I ? $ = n[10] : ($ = /* @__PURE__ */ d(U, {
1116
- open: I,
1117
- className: "absolute right-3 top-1/2 -translate-y-1/2 sm:w-4 z-10 sm:h-4 w-3 h-3"
1118
- }), n[9] = I, n[10] = $);
1119
- let re;
1120
- n[11] !== I || n[12] !== Y || n[13] !== X || n[14] !== Q || n[15] !== te || n[16] !== $ ? (re = /* @__PURE__ */ f("div", {
1121
- role: "combobox",
1122
- "aria-expanded": I,
1123
- className: Y,
1124
- onClick: X,
1125
- onKeyDown: Z,
1126
- tabIndex: Q,
1127
- children: [te, $]
1128
- }), n[11] = I, n[12] = Y, n[13] = X, n[14] = Q, n[15] = te, n[16] = $, n[17] = re) : re = n[17];
1129
- let ie = I && !k ? /* @__PURE__ */ d("ul", {
1130
- role: "listbox",
1131
- className: "absolute z-30 mt-1 w-full bg-white border border-primary/50 rounded-md shadow-lg max-h-48 overflow-y-auto",
1132
- children: G.map((e, t) => {
1133
- let n = String(e.value), r = S.some((e) => e == n), i = !!e.disabled || !r && S.length >= C;
1134
- return /* @__PURE__ */ d("li", {
1135
- role: "option",
1136
- onClick: () => !i && B(n),
1137
- className: [
1138
- "px-3 py-2 cursor-pointer text-sm hover:bg-primary/10",
1139
- r ? "bg-primary/5 font-semibold" : "",
1140
- i ? "opacity-50 cursor-not-allowed hover:bg-white" : ""
1141
- ].filter(Boolean).join(" "),
1142
- children: e.label || e.value
1143
- }, n ?? t);
1144
- })
1145
- }) : null, ae = P || S.length > 0 ? "-top-2.5 text-sm! text-secondary font-bold" : "top-1/2 -translate-y-1/2 text-secondary/50 w-11/12", oe = w ? "!text-red-500" : "", se;
1146
- n[18] !== ae || n[19] !== oe ? (se = [
1147
- "absolute left-2 px-1 transition-all duration-300 ease-in-out bg-white sm:text-base text-sm pointer-events-none",
1148
- ae,
1149
- oe
1150
- ].filter(Boolean), n[18] = ae, n[19] = oe, n[20] = se) : se = n[20];
1151
- let ce = se.join(" "), le;
1152
- n[21] === O ? le = n[22] : (le = O ? /* @__PURE__ */ d("span", {
1153
- className: "text-red-500 ml-0.5",
1154
- children: "*"
1155
- }) : null, n[21] = O, n[22] = le);
1156
- let ue;
1157
- n[23] !== b || n[24] !== a || n[25] !== ce || n[26] !== le ? (ue = /* @__PURE__ */ f("label", {
1158
- htmlFor: a,
1159
- className: ce,
1160
- children: [b, le]
1161
- }), n[23] = b, n[24] = a, n[25] = ce, n[26] = le, n[27] = ue) : ue = n[27];
1162
- let de;
1163
- n[28] !== re || n[29] !== ie || n[30] !== ue ? (de = /* @__PURE__ */ f("div", {
1164
- className: "relative",
1165
- children: [
1166
- re,
1167
- ie,
1168
- ue
1169
- ]
1170
- }), n[28] = re, n[29] = ie, n[30] = ue, n[31] = de) : de = n[31];
1171
- let fe;
1172
- n[32] !== T || n[33] !== w || n[34] !== E ? (fe = /* @__PURE__ */ d(W, {
1173
- description: T,
1174
- error: w,
1175
- helperText: E,
1176
- helperClassName: "text-xs"
1177
- }), n[32] = T, n[33] = w, n[34] = E, n[35] = fe) : fe = n[35];
1178
- let pe;
1179
- n[36] !== C || n[37] !== S.length ? (pe = S.length > C ? /* @__PURE__ */ f("p", {
1180
- className: "mt-1 text-xs text-red-500",
1181
- children: [
1182
- "You can select up to ",
1183
- C,
1184
- " options."
1185
- ]
1186
- }) : null, n[36] = C, n[37] = S.length, n[38] = pe) : pe = n[38];
1187
- let me;
1188
- return n[39] !== K || n[40] !== de || n[41] !== fe || n[42] !== pe ? (me = /* @__PURE__ */ f("div", {
1189
- ref: N,
1190
- className: K,
1191
- children: [
1192
- de,
1193
- fe,
1194
- pe
1195
- ]
1196
- }), n[39] = K, n[40] = de, n[41] = fe, n[42] = pe, n[43] = me) : me = n[43], me;
1197
- }
1198
- function ne(e) {
1199
- return !e;
1200
- }
1201
- function re(e) {
1202
- let t = (0, D.c)(10);
1203
- switch (e.variant) {
1204
- case "stacked": {
1205
- let n;
1206
- return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ d(G, { ...e }), t[0] = e, t[1] = n), n;
1207
- }
1208
- case "floating-native": {
1209
- let n;
1210
- return t[2] === e ? n = t[3] : (n = /* @__PURE__ */ d(Y, { ...e }), t[2] = e, t[3] = n), n;
1211
- }
1212
- case "floating-scrollable": {
1213
- let n;
1214
- return t[4] === e ? n = t[5] : (n = /* @__PURE__ */ d(X, { ...e }), t[4] = e, t[5] = n), n;
1215
- }
1216
- case "floating-custom": {
1217
- let n;
1218
- return t[6] === e ? n = t[7] : (n = /* @__PURE__ */ d(Q, { ...e }), t[6] = e, t[7] = n), n;
1219
- }
1220
- case "multi": {
1221
- let n;
1222
- return t[8] === e ? n = t[9] : (n = /* @__PURE__ */ d($, { ...e }), t[8] = e, t[9] = n), n;
1223
- }
1224
- default: return null;
1225
- }
1226
- }
1227
- //#endregion
1228
- //#region src/ui/Slider.tsx
1229
- var ie = 768, ae = 1024;
1230
- function oe() {
1231
- let t = (0, D.c)(2), [n, r] = e.useState(3), i, a;
1232
- return t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = () => {
1233
- let e = () => {
1234
- let e = window.innerWidth;
1235
- r(e < ie ? 1 : e < ae ? 2 : 3);
1236
- };
1237
- return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
1238
- }, a = [], t[0] = i, t[1] = a) : (i = t[0], a = t[1]), e.useEffect(i, a), n;
1239
- }
1240
- function se(e) {
1241
- return e === 1 ? "100vw" : e === 2 ? "50vw" : "33.3333vw";
1242
- }
1243
- function ce(t) {
1244
- let n = (0, D.c)(40), { children: r, className: i, autoPlay: a, intervalMs: o } = t, s = i === void 0 ? "" : i, c = a === void 0 ? !0 : a, l = o === void 0 ? 4e3 : o, u = oe(), [f, p] = e.useState(0), [m, h] = e.useState(c), [g, _] = e.useState(0), [v, y] = e.useState(0), b, x;
1245
- n[0] === c ? (b = n[1], x = n[2]) : (b = () => {
1246
- h(c);
1247
- }, x = [c], n[0] = c, n[1] = b, n[2] = x), e.useEffect(b, x);
1248
- let S = e.Children.toArray(r).filter(e.isValidElement), C = S.length, w = Math.max(0, C - u), T = se(u), E, O;
1249
- n[3] !== f || n[4] !== w ? (E = () => {
1250
- f > w && p(0);
1251
- }, O = [f, w], n[3] = f, n[4] = w, n[5] = E, n[6] = O) : (E = n[5], O = n[6]), e.useEffect(E, O), e.useEffect(() => {
1252
- if (!m || S.length === 0 || w === 0) return;
1253
- let e = window.setInterval(() => {
1254
- p((e) => {
1255
- let t = e + 1;
1256
- return t > w ? 0 : t;
1257
- });
1258
- }, l);
1259
- return () => window.clearInterval(e);
1260
- }, [
1261
- m,
1262
- w,
1263
- S.length,
1264
- l
1265
- ]);
1266
- let k;
1267
- n[7] === w ? k = n[8] : (k = () => {
1268
- p((e) => {
1269
- let t = e + 1;
1270
- return t > w ? 0 : t;
1271
- });
1272
- }, n[7] = w, n[8] = k);
1273
- let A = k, j;
1274
- n[9] === w ? j = n[10] : (j = () => {
1275
- p((e) => {
1276
- let t = e - 1;
1277
- return t < 0 ? w : t;
1278
- });
1279
- }, n[9] = w, n[10] = j);
1280
- let M = j, N;
1281
- n[11] === Symbol.for("react.memo_cache_sentinel") ? (N = (e) => {
1282
- _(e.targetTouches[0].clientX), h(!1);
1283
- }, n[11] = N) : N = n[11];
1284
- let P = N, F;
1285
- n[12] === Symbol.for("react.memo_cache_sentinel") ? (F = (e) => {
1286
- y(e.targetTouches[0].clientX);
1287
- }, n[12] = F) : F = n[12];
1288
- let I = F, L;
1289
- n[13] !== c || n[14] !== A || n[15] !== M || n[16] !== v || n[17] !== g ? (L = () => {
1290
- if (!g || !v) return;
1291
- let e = g - v;
1292
- e > 50 && A(), e < -50 && M(), _(0), y(0), window.setTimeout(() => h(c), 1e3);
1293
- }, n[13] = c, n[14] = A, n[15] = M, n[16] = v, n[17] = g, n[18] = L) : L = n[18];
1294
- let R = L, z;
1295
- n[19] !== c || n[20] !== A || n[21] !== M ? (z = (e) => {
1296
- let t = e.currentTarget.getBoundingClientRect(), n = e.clientX - t.left;
1297
- h(!1), n < t.width / 2 ? M() : A(), window.setTimeout(() => h(c), 1e3);
1298
- }, n[19] = c, n[20] = A, n[21] = M, n[22] = z) : z = n[22];
1299
- let B = z;
1300
- if (C === 0) return null;
1301
- if (C <= u) {
1302
- let t = `relative w-full py-16 md:py-[4.5rem] justify-center items-center overflow-hidden flex gap-8 ${s}`, r;
1303
- return n[23] === t ? r = n[24] : (r = t.trim(), n[23] = t, n[24] = r), /* @__PURE__ */ d("div", {
1304
- className: r,
1305
- children: /* @__PURE__ */ d("div", {
1306
- className: "flex w-full",
1307
- children: S.map((t, n) => e.cloneElement(t, {
1308
- key: n,
1309
- className: ["shrink-0", t.props.className].filter(Boolean).join(" "),
1310
- style: {
1311
- ...t.props.style ?? {},
1312
- width: T,
1313
- minWidth: T
1314
- }
1315
- }))
1316
- })
1317
- });
1318
- }
1319
- let V = `relative w-full py-16 md:py-[4.5rem] justify-center items-center overflow-hidden cursor-pointer ${s}`, H;
1320
- n[25] === V ? H = n[26] : (H = V.trim(), n[25] = V, n[26] = H);
1321
- let U = `translateX(-${100 / u * f}vw)`, W = `${S.length * 100 / u}vw`, G;
1322
- n[27] !== U || n[28] !== W ? (G = {
1323
- transform: U,
1324
- width: W
1325
- }, n[27] = U, n[28] = W, n[29] = G) : G = n[29];
1326
- let K = S.map((t, n) => e.cloneElement(t, {
1327
- key: n,
1328
- className: ["shrink-0", t.props.className].filter(Boolean).join(" "),
1329
- style: {
1330
- ...t.props.style ?? {},
1331
- width: T,
1332
- minWidth: T
1333
- }
1334
- })), q;
1335
- n[30] !== G || n[31] !== K ? (q = /* @__PURE__ */ d("div", {
1336
- className: "flex transition-transform duration-500 ease-in-out",
1337
- style: G,
1338
- children: K
1339
- }), n[30] = G, n[31] = K, n[32] = q) : q = n[32];
1340
- let J;
1341
- return n[33] !== B || n[34] !== R || n[35] !== I || n[36] !== P || n[37] !== H || n[38] !== q ? (J = /* @__PURE__ */ d("div", {
1342
- className: H,
1343
- onClick: B,
1344
- onTouchStart: P,
1345
- onTouchMove: I,
1346
- onTouchEnd: R,
1347
- role: "region",
1348
- "aria-roledescription": "carousel",
1349
- children: q
1350
- }), n[33] = B, n[34] = R, n[35] = I, n[36] = P, n[37] = H, n[38] = q, n[39] = J) : J = n[39], J;
1351
- }
1352
- var le = 1024;
1353
- function ue(t) {
1354
- let n = (0, D.c)(3), [r, i] = e.useState(typeof window < "u" ? window.innerWidth < t : !0), a, o;
1355
- return n[0] === t ? (a = n[1], o = n[2]) : (a = () => {
1356
- let e = () => i(window.innerWidth < t);
1357
- return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
1358
- }, o = [t], n[0] = t, n[1] = a, n[2] = o), e.useEffect(a, o), r;
1359
- }
1360
- function de(t) {
1361
- let n = (0, D.c)(36), { slides: r, className: i } = t, a = i === void 0 ? "" : i, o = e.useRef(null), s = ue(le), [c, l] = e.useState(0), u;
1362
- n[0] === s ? u = n[1] : (u = () => {
1363
- if (!s || !o.current) return;
1364
- let e = o.current.scrollLeft, t = o.current.clientWidth;
1365
- l(Math.round(e / t));
1366
- }, n[0] = s, n[1] = u);
1367
- let p = u, m = e.useRef(!1), h = e.useRef(0), g = e.useRef(0), _;
1368
- n[2] === s ? _ = n[3] : (_ = (e) => {
1369
- !s || !o.current || (m.current = !0, o.current.classList.add("cursor-grabbing"), h.current = e.pageX - o.current.offsetLeft, g.current = o.current.scrollLeft);
1370
- }, n[2] = s, n[3] = _);
1371
- let v = _, y;
1372
- n[4] === Symbol.for("react.memo_cache_sentinel") ? (y = () => {
1373
- m.current = !1, o.current?.classList.remove("cursor-grabbing");
1374
- }, n[4] = y) : y = n[4];
1375
- let b = y, x;
1376
- n[5] === s ? x = n[6] : (x = (e) => {
1377
- if (!s || !m.current || !o.current) return;
1378
- e.preventDefault();
1379
- let t = (e.pageX - o.current.offsetLeft - h.current) * 1.2;
1380
- o.current.scrollLeft = g.current - t;
1381
- }, n[5] = s, n[6] = x);
1382
- let S = x, C;
1383
- n[7] === a ? C = n[8] : (C = ["w-full", a].filter(Boolean), n[7] = a, n[8] = C);
1384
- let w = C.join(" "), T = s ? "cursor-grab" : "", E;
1385
- n[9] === T ? E = n[10] : (E = ["w-full overflow-x-auto no-scrollbar px-4 select-none", T].filter(Boolean), n[9] = T, n[10] = E);
1386
- let O = E.join(" "), k = s ? "x mandatory" : "none", A;
1387
- n[11] === k ? A = n[12] : (A = {
1388
- WebkitOverflowScrolling: "touch",
1389
- scrollSnapType: k,
1390
- scrollBehavior: "smooth"
1391
- }, n[11] = k, n[12] = A);
1392
- let j = s ? "flex transition-all duration-300" : "flex justify-center flex-wrap gap-6 transition-all duration-300", M;
1393
- if (n[13] !== s || n[14] !== r) {
1394
- let e;
1395
- n[16] === s ? e = n[17] : (e = (e, t) => /* @__PURE__ */ f("div", {
1396
- className: "shrink-0 rounded-2xl flex flex-col items-center pe-4 sm:pe-6",
1397
- style: {
1398
- width: s ? "100%" : "30%",
1399
- minWidth: s ? "100%" : "280px",
1400
- maxWidth: s ? "100%" : "450px",
1401
- height: "auto",
1402
- scrollSnapAlign: s ? "center" : "none"
1403
- },
1404
- children: [
1405
- /* @__PURE__ */ d("img", {
1406
- src: e.image,
1407
- alt: typeof e.imageAlt == "string" ? e.imageAlt : typeof e.title == "string" ? e.title : "Slide",
1408
- className: "rounded-xl w-full h-[180px] xs:h-[220px] sm:h-[260px] md:h-[300px] object-cover mb-3 sm:mb-4",
1409
- draggable: !1
1410
- }),
1411
- /* @__PURE__ */ d("div", {
1412
- className: "font-bold text-primary title-text mb-1 sm:mb-2 text-center px-2",
1413
- children: e.title
1414
- }),
1415
- /* @__PURE__ */ d("div", {
1416
- className: "text-secondary paragraph-text text-center px-2 pb-2",
1417
- children: e.description
1418
- })
1419
- ]
1420
- }, t), n[16] = s, n[17] = e), M = r.map(e), n[13] = s, n[14] = r, n[15] = M;
1421
- } else M = n[15];
1422
- let N;
1423
- n[18] !== j || n[19] !== M ? (N = /* @__PURE__ */ d("div", {
1424
- className: j,
1425
- children: M
1426
- }), n[18] = j, n[19] = M, n[20] = N) : N = n[20];
1427
- let P;
1428
- n[21] !== v || n[22] !== S || n[23] !== p || n[24] !== O || n[25] !== A || n[26] !== N ? (P = /* @__PURE__ */ d("div", {
1429
- ref: o,
1430
- className: O,
1431
- style: A,
1432
- onScroll: p,
1433
- onMouseDown: v,
1434
- onMouseLeave: b,
1435
- onMouseUp: b,
1436
- onMouseMove: S,
1437
- children: N
1438
- }), n[21] = v, n[22] = S, n[23] = p, n[24] = O, n[25] = A, n[26] = N, n[27] = P) : P = n[27];
1439
- let F;
1440
- n[28] !== c || n[29] !== s || n[30] !== r ? (F = s ? /* @__PURE__ */ d("div", {
1441
- className: "flex justify-center mt-3",
1442
- role: "tablist",
1443
- "aria-label": "Slides",
1444
- children: r.map((e, t) => /* @__PURE__ */ d("div", {
1445
- role: "presentation",
1446
- className: ["h-2 w-2 mx-1 rounded-full transition-all duration-300", c === t ? "bg-primary scale-125" : "bg-gray-400"].join(" ")
1447
- }, t))
1448
- }) : null, n[28] = c, n[29] = s, n[30] = r, n[31] = F) : F = n[31];
1449
- let I;
1450
- return n[32] !== P || n[33] !== F || n[34] !== w ? (I = /* @__PURE__ */ f("div", {
1451
- className: w,
1452
- children: [P, F]
1453
- }), n[32] = P, n[33] = F, n[34] = w, n[35] = I) : I = n[35], I;
1454
- }
1455
- //#endregion
1456
- //#region src/utils/date-picker-utils.ts
1457
- var fe = [
1458
- "January",
1459
- "February",
1460
- "March",
1461
- "April",
1462
- "May",
1463
- "June",
1464
- "July",
1465
- "August",
1466
- "September",
1467
- "October",
1468
- "November",
1469
- "December"
1470
- ], pe = [
1471
- "Sun",
1472
- "Mon",
1473
- "Tue",
1474
- "Wed",
1475
- "Thu",
1476
- "Fri",
1477
- "Sat"
1478
- ];
1479
- function me(e) {
1480
- return new Date(e.getFullYear(), e.getMonth(), e.getDate());
1481
- }
1482
- function he(e) {
1483
- return !e || isNaN(e.getTime()) ? "" : `${e.getDate().toString().padStart(2, "0")} ${fe[e.getMonth()].slice(0, 3)} ${e.getFullYear()}`;
1484
- }
1485
- function ge(e) {
1486
- return `${e.getFullYear()}-${(e.getMonth() + 1).toString().padStart(2, "0")}-${e.getDate().toString().padStart(2, "0")}`;
1487
- }
1488
- function _e(e) {
1489
- if (e == null || !String(e).trim()) return null;
1490
- let t = String(e).trim();
1491
- if (/^\d{1,2}\/\d{1,2}\/\d{4}$/.test(t)) {
1492
- let [e, n, r] = t.split("/").map((e) => parseInt(e, 10)), i = new Date(r, n - 1, e);
1493
- return isNaN(i.getTime()) ? null : me(i);
1494
- }
1495
- let n = /^(\d{1,2})\s+([A-Za-z]{3})\s+(\d{4})$/.exec(t);
1496
- if (n) {
1497
- let e = parseInt(n[1], 10), t = n[2].toLowerCase(), r = parseInt(n[3], 10), i = fe.findIndex((e) => e.slice(0, 3).toLowerCase() === t);
1498
- if (i >= 0) {
1499
- let t = new Date(r, i, e);
1500
- return isNaN(t.getTime()) ? null : me(t);
1501
- }
1502
- }
1503
- if (/^\d{4}-\d{2}-\d{2}/.test(t)) {
1504
- let [e, n, r] = t.slice(0, 10).split("-").map((e) => parseInt(e, 10)), i = new Date(e, n - 1, r);
1505
- return isNaN(i.getTime()) ? null : me(i);
1506
- }
1507
- let r = new Date(t);
1508
- return isNaN(r.getTime()) ? null : me(r);
1509
- }
1510
- function ve(e) {
1511
- if (e == null) return null;
1512
- if (typeof e == "string" && /^\d{1,2}\/\d{1,2}\/\d{4}$/.test(e)) {
1513
- let [t, n, r] = e.split("/").map((e) => parseInt(e, 10));
1514
- return me(new Date(r, n - 1, t));
1515
- }
1516
- let t = typeof e == "string" ? new Date(e) : e;
1517
- return isNaN(t.getTime()) ? null : me(t);
1518
- }
1519
- function ye(e, t) {
1520
- return !e || !t ? !1 : e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
1521
- }
1522
- function be(e, t) {
1523
- return me(e).getTime() - me(t).getTime();
1524
- }
1525
- function xe(e, t, n) {
1526
- let r = me(e).getTime(), i = me(t).getTime(), a = me(n).getTime();
1527
- return r >= Math.min(i, a) && r <= Math.max(i, a);
1528
- }
1529
- function Se(e, t) {
1530
- return new Date(e, t + 1, 0).getDate();
1531
- }
1532
- function Ce(e, t) {
1533
- return new Date(e, t, 1).getDay();
1534
- }
1535
- //#endregion
1536
- //#region src/ui/DatePicker.tsx
1537
- function we(e) {
1538
- let t = (0, D.c)(3), { className: n } = e, r;
1539
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ d("path", { d: "M18 6L6 18M6 6l12 12" }), t[0] = r) : r = t[0];
1540
- let i;
1541
- return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ d("svg", {
1542
- xmlns: "http://www.w3.org/2000/svg",
1543
- viewBox: "0 0 24 24",
1544
- fill: "none",
1545
- stroke: "currentColor",
1546
- strokeWidth: "2",
1547
- className: n,
1548
- "aria-hidden": !0,
1549
- children: r
1550
- }), t[1] = n, t[2] = i), i;
1551
- }
1552
- function Te(e) {
1553
- let t = (0, D.c)(2), { dir: n } = e, r;
1554
- return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ d("svg", {
1555
- xmlns: "http://www.w3.org/2000/svg",
1556
- viewBox: "0 0 24 24",
1557
- fill: "currentColor",
1558
- className: "w-3 h-3",
1559
- "aria-hidden": !0,
1560
- children: n === "left" ? /* @__PURE__ */ d("path", { d: "M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z" }) : /* @__PURE__ */ d("path", { d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" })
1561
- }), t[0] = n, t[1] = r), r;
1562
- }
1563
- function Ee() {
1564
- let e = (0, D.c)(1), t;
1565
- return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ f("svg", {
1566
- xmlns: "http://www.w3.org/2000/svg",
1567
- width: "24",
1568
- height: "24",
1569
- viewBox: "0 0 24 24",
1570
- fill: "none",
1571
- stroke: "currentColor",
1572
- strokeWidth: "2",
1573
- className: "min-w-6 min-h-6 shrink-0 text-red-500 pe-2",
1574
- "aria-hidden": !0,
1575
- children: [
1576
- /* @__PURE__ */ d("circle", {
1577
- cx: "12",
1578
- cy: "12",
1579
- r: "10"
1580
- }),
1581
- /* @__PURE__ */ d("line", {
1582
- x1: "12",
1583
- y1: "8",
1584
- x2: "12",
1585
- y2: "12"
1586
- }),
1587
- /* @__PURE__ */ d("line", {
1588
- x1: "12",
1589
- y1: "16",
1590
- x2: "12.01",
1591
- y2: "16"
1592
- })
1593
- ]
1594
- }), e[0] = t) : t = e[0], t;
1595
- }
1596
- var De = 380, Oe = 320, ke = e.forwardRef(function({ value: t, onChange: n, onBlur: r, autoFocus: i = !1, placeholder: a = "Select Date", min: o = null, max: s = null, disabled: c = !1, className: l = "", inputClassName: p = "", disabledDates: m = [], error: h = "", rangeStart: g = null, rangeEnd: _ = null, valueFormat: v = "display", onOpenChange: y }, b) {
1597
- let [x, S] = e.useState(!1), [C, w] = e.useState(() => /* @__PURE__ */ new Date()), [T, E] = e.useState(null), [D, O] = e.useState(""), k = e.useRef(null), [A, j] = e.useState(!1), [M, N] = e.useState(!1), P = e.useCallback((e) => {
1598
- S((t) => {
1599
- let n = typeof e == "function" ? e(t) : e;
1600
- return n !== t && y?.(n), n;
1601
- });
1602
- }, [y]);
1603
- e.useImperativeHandle(b, () => ({
1604
- open: () => {
1605
- c || P(!0);
1606
- },
1607
- close: () => P(!1),
1608
- toggle: () => {
1609
- c || P((e) => !e);
1610
- }
1611
- })), e.useEffect(() => {
1612
- if (!x || !k.current) return;
1613
- let e = k.current.getBoundingClientRect(), t = window.innerHeight - e.bottom, n = window.innerWidth - e.left;
1614
- j(t < De && e.top > De), N(n < Oe && e.right > Oe);
1615
- }, [x]), e.useEffect(() => {
1616
- if (!x) return;
1617
- let e = (e) => {
1618
- k.current && !k.current.contains(e.target) && (P(!1), r?.());
1619
- };
1620
- return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
1621
- }, [
1622
- x,
1623
- r,
1624
- P
1625
- ]), e.useEffect(() => {
1626
- i && P(!0);
1627
- }, [i, P]);
1628
- let F = e.useMemo(() => ve(o), [o]), I = e.useMemo(() => ve(s), [s]), L = e.useCallback((e) => {
1629
- if (c) return !0;
1630
- let t = me(e);
1631
- if (F && t.getTime() < F.getTime() || I && t.getTime() > I.getTime()) return !0;
1632
- for (let e of m) {
1633
- let n = typeof e == "string" ? _e(e) ?? ve(e) : me(e);
1634
- if (n && t.getTime() === n.getTime()) return !0;
1635
- }
1636
- return !1;
1637
- }, [
1638
- c,
1639
- m,
1640
- F,
1641
- I
1642
- ]);
1643
- e.useEffect(() => {
1644
- if (!t) {
1645
- E(null);
1646
- return;
1647
- }
1648
- let e = _e(t);
1649
- if (!e) {
1650
- E(null);
1651
- return;
1652
- }
1653
- L(e) ? (O("Date is outside allowed range"), E(e)) : (O(""), E(e), w(new Date(e.getFullYear(), e.getMonth(), 1)));
1654
- }, [t]), e.useEffect(() => {
1655
- O(h);
1656
- }, [h]);
1657
- let R = e.useCallback((e) => {
1658
- n(v === "iso" ? ge(e) : he(e));
1659
- }, [n, v]), z = (e) => {
1660
- let t = new Date(C.getFullYear(), C.getMonth(), e);
1661
- if (L(t)) {
1662
- O("Date is outside allowed range");
1663
- return;
1664
- }
1665
- O(""), E(t), R(t), r?.(), P(!1);
1666
- }, B = (e) => {
1667
- w((t) => {
1668
- let n = t.getFullYear(), r = t.getMonth();
1669
- return new Date(n, r + e, 1);
1670
- });
1671
- }, V = (e) => {
1672
- w((t) => new Date(t.getFullYear() + e, t.getMonth(), 1));
1673
- }, H = g ? _e(g) : null, U = _ ? _e(_) : null, W = () => {
1674
- let e = C.getFullYear(), t = C.getMonth(), n = Se(e, t), r = Ce(e, t), i = [];
1675
- for (let e = 0; e < r; e++) i.push(/* @__PURE__ */ d("div", { className: "w-full h-9" }, `e-${e}`));
1676
- for (let r = 1; r <= n; r++) {
1677
- let n = new Date(e, t, r);
1678
- n.setHours(0, 0, 0, 0);
1679
- let a = L(n), o = ye(n, T), s = ye(n, /* @__PURE__ */ new Date()), c = !!(H && ye(n, H)), l = !!(U && ye(n, U)), u = H != null && U != null && be(n, H) > 0 && be(n, U) < 0, p = "relative z-10 w-full h-full flex items-center justify-center text-sm font-medium ";
1680
- a ? p += "text-gray-300 cursor-not-allowed" : c || l || o && !u ? p += "text-white font-bold" : u ? p += "text-black font-bold" : p += "text-secondary hover:bg-gray-100 rounded-full", i.push(/* @__PURE__ */ f("div", {
1681
- className: "relative w-full h-9 flex items-center justify-center cursor-pointer",
1682
- onClick: (e) => {
1683
- e.preventDefault(), a || z(r);
1684
- },
1685
- children: [
1686
- u && !a ? /* @__PURE__ */ d("div", { className: "absolute inset-x-0 inset-y-0 bg-primary/20" }) : null,
1687
- c && !a ? /* @__PURE__ */ d("div", { className: `absolute inset-y-0 bg-primary left-0 right-0 ${U ? "rounded-l-md" : "rounded-md"}` }) : null,
1688
- l && !a ? /* @__PURE__ */ d("div", { className: `absolute inset-y-0 bg-primary left-0 right-0 ${H ? "rounded-r-md" : "rounded-md"}` }) : null,
1689
- o && !c && !l && !a ? /* @__PURE__ */ d("div", { className: "absolute inset-0 m-auto w-8 h-8 rounded-full bg-primary" }) : null,
1690
- s && !o && !c && !l && !u ? /* @__PURE__ */ d("div", { className: "absolute inset-0 m-auto w-8 h-8 rounded-full border border-primary" }) : null,
1691
- /* @__PURE__ */ d("span", {
1692
- className: p,
1693
- children: r
1694
- })
1695
- ]
1696
- }, r));
1697
- }
1698
- return i;
1699
- }, G = (e) => {
1700
- c || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), P((e) => !e));
1701
- }, K = T ? he(T) : null;
1702
- return /* @__PURE__ */ f("div", {
1703
- className: `relative ${l}`,
1704
- ref: k,
1705
- children: [
1706
- /* @__PURE__ */ d("div", {
1707
- onClick: () => !c && P((e) => !e),
1708
- onKeyDown: G,
1709
- tabIndex: c ? -1 : 0,
1710
- role: "button",
1711
- "aria-expanded": x,
1712
- "aria-haspopup": "dialog",
1713
- "aria-label": a,
1714
- className: `flex-1 text-sm sm:text-sm font-bold cursor-pointer text-left ${p} ${c ? "cursor-not-allowed opacity-50" : ""} ${K ? "text-secondary" : "text-secondary/50"}`,
1715
- children: K ?? a
1716
- }),
1717
- D ? /* @__PURE__ */ d("p", {
1718
- className: "text-red-500 text-xs mt-1",
1719
- children: D
1720
- }) : null,
1721
- x ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", {
1722
- className: "fixed inset-0 bg-black/50 z-50 sm:hidden",
1723
- onClick: () => P(!1),
1724
- "aria-hidden": !0
1725
- }), /* @__PURE__ */ f("div", {
1726
- className: [
1727
- "z-50 bg-white border border-gray-200 shadow-lg p-4 sm:p-4",
1728
- "fixed left-0 right-0 bottom-0 rounded-t-xl rounded-br-none rounded-bl-none max-h-[80vh] overflow-y-auto",
1729
- "sm:absolute sm:inset-x-auto sm:bottom-auto sm:max-h-none sm:overflow-visible sm:rounded-lg sm:min-w-[280px] sm:max-w-[320px]",
1730
- M ? "sm:right-0 sm:left-auto" : "sm:left-0 sm:right-auto",
1731
- A ? "sm:bottom-full sm:mb-2" : "sm:top-full sm:mt-2"
1732
- ].join(" "),
1733
- role: "dialog",
1734
- "aria-label": "Choose date",
1735
- onMouseDown: (e) => e.stopPropagation(),
1736
- children: [
1737
- /* @__PURE__ */ f("div", {
1738
- className: "flex items-center justify-between mb-4 sm:hidden",
1739
- children: [/* @__PURE__ */ d("h3", {
1740
- className: "text-lg font-semibold text-secondary",
1741
- children: "Select Date"
1742
- }), /* @__PURE__ */ d("button", {
1743
- type: "button",
1744
- onClick: () => P(!1),
1745
- className: "p-1 hover:bg-gray-100 rounded-full text-secondary",
1746
- "aria-label": "Close",
1747
- children: /* @__PURE__ */ d(we, { className: "w-5 h-5" })
1748
- })]
1749
- }),
1750
- /* @__PURE__ */ f("div", {
1751
- className: "flex items-center justify-between gap-2 mb-4 min-h-10",
1752
- children: [
1753
- /* @__PURE__ */ f("div", {
1754
- className: "flex items-center gap-3 shrink-0",
1755
- children: [/* @__PURE__ */ d("button", {
1756
- type: "button",
1757
- onClick: (e) => {
1758
- e.stopPropagation(), V(-1);
1759
- },
1760
- className: "min-w-9 min-h-9 flex items-center justify-center p-1.5 hover:bg-gray-100 text-xl rounded text-secondary leading-none",
1761
- "aria-label": "Previous year",
1762
- children: "‹‹"
1763
- }), /* @__PURE__ */ d("button", {
1764
- type: "button",
1765
- onClick: (e) => {
1766
- e.stopPropagation(), B(-1);
1767
- },
1768
- className: "min-w-9 min-h-9 flex items-center justify-center p-1.5 hover:bg-gray-100 text-xl rounded text-secondary leading-none",
1769
- "aria-label": "Previous month",
1770
- children: "‹"
1771
- })]
1772
- }),
1773
- /* @__PURE__ */ f("div", {
1774
- className: "font-semibold text-secondary text-sm sm:text-base px-2 text-center shrink min-w-0",
1775
- children: [
1776
- fe[C.getMonth()],
1777
- " ",
1778
- C.getFullYear()
1779
- ]
1780
- }),
1781
- /* @__PURE__ */ f("div", {
1782
- className: "flex items-center gap-3 shrink-0",
1783
- children: [/* @__PURE__ */ d("button", {
1784
- type: "button",
1785
- onClick: (e) => {
1786
- e.stopPropagation(), B(1);
1787
- },
1788
- className: "min-w-9 min-h-9 flex items-center justify-center p-1.5 hover:bg-gray-100 text-xl rounded text-secondary leading-none",
1789
- "aria-label": "Next month",
1790
- children: "›"
1791
- }), /* @__PURE__ */ d("button", {
1792
- type: "button",
1793
- onClick: (e) => {
1794
- e.stopPropagation(), V(1);
1795
- },
1796
- className: "min-w-9 min-h-9 flex items-center justify-center p-1.5 hover:bg-gray-100 text-xl rounded text-secondary leading-none",
1797
- "aria-label": "Next year",
1798
- children: "››"
1799
- })]
1800
- })
1801
- ]
1802
- }),
1803
- /* @__PURE__ */ d("div", {
1804
- className: "grid grid-cols-7 gap-0 mb-2",
1805
- children: pe.map((e) => /* @__PURE__ */ d("div", {
1806
- className: "text-xs text-secondary text-[14px] text-center font-semibold p-1",
1807
- children: e
1808
- }, e))
1809
- }),
1810
- /* @__PURE__ */ d("div", {
1811
- className: "grid grid-cols-7 gap-0",
1812
- children: W()
1813
- })
1814
- ]
1815
- })] }) : null
1816
- ]
1817
- });
1818
- });
1819
- function Ae(t) {
1820
- let n = (0, D.c)(50), r, i, a, o, s, c, l, u, p, m, h, g;
1821
- n[0] === t ? (r = n[1], i = n[2], a = n[3], o = n[4], s = n[5], c = n[6], l = n[7], u = n[8], p = n[9], m = n[10], h = n[11], g = n[12]) : ({label: s, name: r, value: c, onChange: a, onBlur: i, error: l, description: u, helperText: p, required: m, disabled: h, className: g, ...o} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = o, n[5] = s, n[6] = c, n[7] = l, n[8] = u, n[9] = p, n[10] = m, n[11] = h, n[12] = g);
1822
- let _ = s === void 0 ? "" : s, v = c === void 0 ? "" : c, y = l === void 0 ? "" : l, b = u === void 0 ? "" : u, x = p === void 0 ? "" : p, S = m === void 0 ? !1 : m, C = h === void 0 ? !1 : h, w = g === void 0 ? "" : g, [T, E] = e.useState(!1), O = T || !!v, k;
1823
- if (n[13] !== v) {
1824
- let e = v ? _e(v) : null;
1825
- k = e ? he(e) : v, n[13] = v, n[14] = k;
1826
- } else k = n[14];
1827
- let A = k, j = `relative ${w}`, M = `flex items-center border sm:h-[48px] h-[42px] rounded-md transition-all bg-white ${y ? "border-red-500" : T ? "border border-primary" : "border border-primary/50"} ${C ? "bg-white cursor-not-allowed opacity-75" : "cursor-pointer"}`, N;
1828
- n[15] === C ? N = n[16] : (N = () => !C && E(!0), n[15] = C, n[16] = N);
1829
- let P;
1830
- n[17] !== C || n[18] !== A || n[19] !== T || n[20] !== r || n[21] !== i || n[22] !== a || n[23] !== o || n[24] !== v ? (P = T ? /* @__PURE__ */ d("input", {
1831
- id: r,
1832
- name: r,
1833
- type: "date",
1834
- value: v,
1835
- onChange: a,
1836
- onBlur: (e) => {
1837
- E(!1), i?.(e);
1838
- },
1839
- disabled: C,
1840
- autoFocus: !0,
1841
- className: "peer w-full h-full min-h-[42px] sm:min-h-[48px] px-3 py-2 text-base bg-transparent outline-none",
1842
- ...o
1843
- }) : /* @__PURE__ */ d("div", {
1844
- className: "w-full px-3 flex items-center text-base text-secondary min-h-[42px] sm:min-h-[48px]",
1845
- children: v ? /* @__PURE__ */ d("span", {
1846
- className: "text-secondary",
1847
- children: A
1848
- }) : /* @__PURE__ */ d("span", {
1849
- className: "text-transparent select-none",
1850
- "aria-hidden": !0,
1851
- children: "."
1852
- })
1853
- }), n[17] = C, n[18] = A, n[19] = T, n[20] = r, n[21] = i, n[22] = a, n[23] = o, n[24] = v, n[25] = P) : P = n[25];
1854
- let F;
1855
- n[26] !== M || n[27] !== N || n[28] !== P ? (F = /* @__PURE__ */ d("div", {
1856
- className: M,
1857
- onClick: N,
1858
- children: P
1859
- }), n[26] = M, n[27] = N, n[28] = P, n[29] = F) : F = n[29];
1860
- let I = `absolute left-2 px-1 transition-all duration-300 ease-in-out bg-white sm:text-base text-sm pointer-events-none z-[1]
1861
- ${O ? "-top-2.5 text-sm! text-secondary bg-white font-bold" : "top-1/2 -translate-y-1/2 text-secondary/50"}
1862
- ${y ? "text-red-500!" : ""}
1863
- `, L;
1864
- n[30] === S ? L = n[31] : (L = S ? /* @__PURE__ */ d("span", {
1865
- className: "text-red-500 ml-0.5",
1866
- children: "*"
1867
- }) : null, n[30] = S, n[31] = L);
1868
- let R;
1869
- n[32] !== _ || n[33] !== r || n[34] !== I || n[35] !== L ? (R = /* @__PURE__ */ f("label", {
1870
- htmlFor: r,
1871
- className: I,
1872
- children: [_, L]
1873
- }), n[32] = _, n[33] = r, n[34] = I, n[35] = L, n[36] = R) : R = n[36];
1874
- let z;
1875
- n[37] !== F || n[38] !== R ? (z = /* @__PURE__ */ f("div", {
1876
- className: "relative",
1877
- children: [F, R]
1878
- }), n[37] = F, n[38] = R, n[39] = z) : z = n[39];
1879
- let B;
1880
- n[40] === b ? B = n[41] : (B = b ? /* @__PURE__ */ d("div", {
1881
- className: "mt-1 sm:text-base text-sm text-secondary/60",
1882
- children: b
1883
- }) : null, n[40] = b, n[41] = B);
1884
- let V;
1885
- n[42] !== y || n[43] !== x ? (V = (y || x) && /* @__PURE__ */ d("p", {
1886
- className: `mt-1 text-xs ${y ? "text-red-500" : "text-secondary/50"}`,
1887
- children: y || x
1888
- }), n[42] = y, n[43] = x, n[44] = V) : V = n[44];
1889
- let H;
1890
- return n[45] !== j || n[46] !== z || n[47] !== B || n[48] !== V ? (H = /* @__PURE__ */ f("div", {
1891
- className: j,
1892
- children: [
1893
- z,
1894
- B,
1895
- V
1896
- ]
1897
- }), n[45] = j, n[46] = z, n[47] = B, n[48] = V, n[49] = H) : H = n[49], H;
1898
- }
1899
- var je = e.forwardRef(function(e, t) {
1900
- let n = (0, D.c)(37), { placeholder: r, value: i, onChange: a, error: o, inputProps: s, label: c, labelClassName: l, description: u, descriptionClassName: p, leftComponent: m, rightComponent: h, className: g, containerClassName: _, errorClassName: v, min: y, max: b, step: x, disabled: S } = e, C = r === void 0 ? "Select date" : r, w;
1901
- n[0] === s ? w = n[1] : (w = s === void 0 ? {} : s, n[0] = s, n[1] = w);
1902
- let T = w, E = l === void 0 ? "" : l, O = p === void 0 ? "" : p, k = g === void 0 ? "" : g, A = _ === void 0 ? "" : _, j = v === void 0 ? "" : v, M = S === void 0 ? !1 : S, N;
1903
- n[2] !== c || n[3] !== E ? (N = c ? /* @__PURE__ */ d("label", {
1904
- className: `block text-sm sm:text-lg font-bold text-secondary mb-1 ${E}`,
1905
- children: c
1906
- }) : null, n[2] = c, n[3] = E, n[4] = N) : N = n[4];
1907
- let P;
1908
- n[5] !== u || n[6] !== O ? (P = u ? /* @__PURE__ */ d("div", {
1909
- className: `block text-xs sm:text-base text-secondary/50 mb-2 ${O}`,
1910
- children: u
1911
- }) : null, n[5] = u, n[6] = O, n[7] = P) : P = n[7];
1912
- let F = "flex items-center rounded-medium sm:rounded-primary md:rounded-medium lg:rounded-primary bg-white outline -outline-offset-1 outline-primary/50 has-[input:focus-within]:outline-1 has-[input:focus-within]:outline-offset-1 has-[input:focus-within]:outline-primary text-sm sm:text-base " + (M ? "opacity-50 " : "") + A, I;
1913
- n[8] === a ? I = n[9] : (I = (e) => a?.(e.currentTarget.value), n[8] = a, n[9] = I);
1914
- let L = "block min-w-0 grow sm:py-2.5 py-1.5 pr-3 pl-3 focus:outline-none text-[16px] sm:text-[14px] " + k, R;
1915
- n[10] !== M || n[11] !== T || n[12] !== b || n[13] !== y || n[14] !== C || n[15] !== t || n[16] !== x || n[17] !== I || n[18] !== L || n[19] !== i ? (R = /* @__PURE__ */ d("input", {
1916
- ref: t,
1917
- type: "date",
1918
- placeholder: C,
1919
- value: i,
1920
- onChange: I,
1921
- min: y,
1922
- max: b,
1923
- step: x,
1924
- disabled: M,
1925
- className: L,
1926
- ...T
1927
- }), n[10] = M, n[11] = T, n[12] = b, n[13] = y, n[14] = C, n[15] = t, n[16] = x, n[17] = I, n[18] = L, n[19] = i, n[20] = R) : R = n[20];
1928
- let z;
1929
- n[21] !== o || n[22] !== h ? (z = o ? /* @__PURE__ */ d(Ee, {}) : h, n[21] = o, n[22] = h, n[23] = z) : z = n[23];
1930
- let B;
1931
- n[24] !== m || n[25] !== F || n[26] !== R || n[27] !== z ? (B = /* @__PURE__ */ f("div", {
1932
- className: F,
1933
- children: [
1934
- m,
1935
- R,
1936
- z
1937
- ]
1938
- }), n[24] = m, n[25] = F, n[26] = R, n[27] = z, n[28] = B) : B = n[28];
1939
- let V;
1940
- n[29] !== o || n[30] !== j ? (V = o ? /* @__PURE__ */ d("div", {
1941
- className: "text-2xs font-semibold text-red-500 mt-0.75 pl-3 " + j,
1942
- children: o
1943
- }) : null, n[29] = o, n[30] = j, n[31] = V) : V = n[31];
1944
- let H;
1945
- return n[32] !== N || n[33] !== P || n[34] !== B || n[35] !== V ? (H = /* @__PURE__ */ f("div", {
1946
- className: "w-full",
1947
- children: [
1948
- N,
1949
- P,
1950
- B,
1951
- V
1952
- ]
1953
- }), n[32] = N, n[33] = P, n[34] = B, n[35] = V, n[36] = H) : H = n[36], H;
1954
- });
1955
- function Me(e) {
1956
- let t = (0, D.c)(42), { day: n, disabled: r, onClick: i, singleDay: a, rangeStart: o, rangeEnd: s, inRangeMiddle: c, displayInRange: l, displayStart: p, displayEnd: m } = e, h;
1957
- t[0] === n ? h = t[1] : (h = ye(n, /* @__PURE__ */ new Date()), t[0] = n, t[1] = h);
1958
- let g = h, _ = g && !a && !o && !s && !c && !l, v = r ? "text-gray-400" : a || o ? "font-semibold text-white" : s || c ? "font-semibold text-secondary" : p || m ? "font-semibold text-white" : l ? "font-semibold text-secondary" : g ? "font-bold text-primary" : "text-secondary", y = `relative w-full h-9 flex items-center justify-center ${r ? "cursor-not-allowed opacity-40" : "cursor-pointer"}`, b;
1959
- t[2] !== r || t[3] !== i ? (b = () => !r && i(), t[2] = r, t[3] = i, t[4] = b) : b = t[4];
1960
- let x;
1961
- t[5] === n ? x = t[6] : (x = ge(n), t[5] = n, t[6] = x);
1962
- let S;
1963
- t[7] !== r || t[8] !== a ? (S = a && !r ? /* @__PURE__ */ d("span", { className: "absolute h-8 w-8 rounded-full bg-primary" }) : null, t[7] = r, t[8] = a, t[9] = S) : S = t[9];
1964
- let C;
1965
- t[10] !== r || t[11] !== o ? (C = o && !r ? /* @__PURE__ */ d("span", { className: "absolute inset-y-0 left-0 right-0 bg-primary rounded-l-md" }) : null, t[10] = r, t[11] = o, t[12] = C) : C = t[12];
1966
- let w;
1967
- t[13] !== r || t[14] !== c ? (w = c && !r ? /* @__PURE__ */ d("span", { className: "absolute inset-y-0 left-0 right-0 bg-primary/20" }) : null, t[13] = r, t[14] = c, t[15] = w) : w = t[15];
1968
- let T;
1969
- t[16] !== r || t[17] !== s ? (T = s && !r ? /* @__PURE__ */ d("span", { className: "absolute inset-y-0 left-0 right-0 bg-primary/20 rounded-r-md" }) : null, t[16] = r, t[17] = s, t[18] = T) : T = t[18];
1970
- let E;
1971
- t[19] !== m || t[20] !== l || t[21] !== p || t[22] !== a ? (E = p && m && l && !a ? /* @__PURE__ */ d("span", { className: "absolute inset-0 rounded-md border border-primary/40 bg-primary/5" }) : /* @__PURE__ */ f(u, { children: [
1972
- p ? /* @__PURE__ */ d("span", { className: "absolute inset-y-0 left-0 right-0 rounded-l-md border border-primary/30 bg-primary/10 border-r-0" }) : null,
1973
- m ? /* @__PURE__ */ d("span", { className: "absolute inset-y-0 left-0 right-0 rounded-r-md border border-primary/30 bg-primary/10 border-l-0" }) : null,
1974
- l && !p && !m ? /* @__PURE__ */ d("span", { className: "absolute inset-y-0 left-0 right-0 bg-primary/10 border-y border-primary/20" }) : null
1975
- ] }), t[19] = m, t[20] = l, t[21] = p, t[22] = a, t[23] = E) : E = t[23];
1976
- let O;
1977
- t[24] === _ ? O = t[25] : (O = _ ? /* @__PURE__ */ d("span", { className: "absolute inset-0 m-auto h-8 w-8 rounded-full border border-primary pointer-events-none" }) : null, t[24] = _, t[25] = O);
1978
- let k = `relative z-10 text-sm ${v}`, A;
1979
- t[26] === n ? A = t[27] : (A = n.getDate(), t[26] = n, t[27] = A);
1980
- let j;
1981
- t[28] !== k || t[29] !== A ? (j = /* @__PURE__ */ d("span", {
1982
- className: k,
1983
- children: A
1984
- }), t[28] = k, t[29] = A, t[30] = j) : j = t[30];
1985
- let M;
1986
- return t[31] !== O || t[32] !== j || t[33] !== y || t[34] !== b || t[35] !== x || t[36] !== S || t[37] !== C || t[38] !== w || t[39] !== T || t[40] !== E ? (M = /* @__PURE__ */ f("div", {
1987
- className: y,
1988
- onClick: b,
1989
- title: x,
1990
- children: [
1991
- S,
1992
- C,
1993
- w,
1994
- T,
1995
- E,
1996
- O,
1997
- j
1998
- ]
1999
- }), t[31] = O, t[32] = j, t[33] = y, t[34] = b, t[35] = x, t[36] = S, t[37] = C, t[38] = w, t[39] = T, t[40] = E, t[41] = M) : M = t[41], M;
2000
- }
2001
- function Ne(t) {
2002
- let n = (0, D.c)(58), { value: r, onChange: i, onMonthChange: a, minDate: o, maxDate: s, disablePast: c, displayRanges: l, cursorMonth: u, className: p } = t, m = r === void 0 ? null : r, h = c === void 0 ? !0 : c, g;
2003
- n[0] === l ? g = n[1] : (g = l === void 0 ? [] : l, n[0] = l, n[1] = g);
2004
- let _ = g, v = p === void 0 ? "" : p, y;
2005
- if (n[2] !== u) {
2006
- let e = me(u ? new Date(u) : /* @__PURE__ */ new Date());
2007
- y = new Date(e.getFullYear(), e.getMonth(), 1), n[2] = u, n[3] = y;
2008
- } else y = n[3];
2009
- let b = y, x;
2010
- n[4] === m ? x = n[5] : (x = () => m ? {
2011
- start: _e(m.startDate) ?? /* @__PURE__ */ new Date(),
2012
- end: _e(m.endDate) ?? /* @__PURE__ */ new Date()
2013
- } : null, n[4] = m, n[5] = x);
2014
- let [S, C] = e.useState(x), [w, T] = e.useState(b), [E, O] = e.useState(null), k, A;
2015
- n[6] === u ? (k = n[7], A = n[8]) : (k = () => {
2016
- if (u) {
2017
- let e = u;
2018
- T(new Date(e.getFullYear(), e.getMonth(), 1));
2019
- }
2020
- }, A = [u], n[6] = u, n[7] = k, n[8] = A), e.useEffect(k, A);
2021
- let j, M;
2022
- n[9] === m ? (j = n[10], M = n[11]) : (j = () => {
2023
- if (!m) {
2024
- C(null);
2025
- return;
2026
- }
2027
- let e = _e(m.startDate), t = _e(m.endDate);
2028
- e && t && C({
2029
- start: e,
2030
- end: t
2031
- });
2032
- }, M = [m], n[9] = m, n[10] = j, n[11] = M), e.useEffect(j, M);
2033
- let N;
2034
- n[12] === i ? N = n[13] : (N = (e) => {
2035
- if (!e) {
2036
- i(null);
2037
- return;
2038
- }
2039
- i({
2040
- startDate: ge(e.start),
2041
- endDate: ge(e.end)
2042
- });
2043
- }, n[12] = i, n[13] = N);
2044
- let P = N, F;
2045
- n[14] !== h || n[15] !== s || n[16] !== o ? (F = (e) => {
2046
- let t = me(e);
2047
- if (h) {
2048
- let e = me(/* @__PURE__ */ new Date());
2049
- if (t.getTime() < e.getTime()) return !0;
2050
- }
2051
- let n = ve(o), r = ve(s);
2052
- return !!(n && t.getTime() < n.getTime() || r && t.getTime() > r.getTime());
2053
- }, n[14] = h, n[15] = s, n[16] = o, n[17] = F) : F = n[17];
2054
- let I = F, L;
2055
- n[18] !== P || n[19] !== I || n[20] !== S || n[21] !== E ? (L = (e) => {
2056
- if (!I(e)) {
2057
- if (!S || S.start && S.end && !E) {
2058
- O(e);
2059
- let t = me(e), n = {
2060
- start: t,
2061
- end: t
2062
- };
2063
- C(n), P(n);
2064
- return;
2065
- }
2066
- if (E) {
2067
- let t = me(E), n = me(e);
2068
- be(n, t) < 0 && ([t, n] = [n, t]);
2069
- let r = {
2070
- start: t,
2071
- end: n
2072
- };
2073
- C(r), O(null), P(r);
2074
- }
2075
- }
2076
- }, n[18] = P, n[19] = I, n[20] = S, n[21] = E, n[22] = L) : L = n[22];
2077
- let R = L, z;
2078
- n[23] === Symbol.for("react.memo_cache_sentinel") ? (z = (e) => {
2079
- T((t) => new Date(t.getFullYear(), t.getMonth() + e, 1));
2080
- }, n[23] = z) : z = n[23];
2081
- let B = z, V, H;
2082
- n[24] !== w || n[25] !== a ? (V = () => {
2083
- a?.(w);
2084
- }, H = [w, a], n[24] = w, n[25] = a, n[26] = V, n[27] = H) : (V = n[26], H = n[27]), e.useEffect(V, H);
2085
- let U, W, G, K, q, J, ee;
2086
- if (n[28] !== v || n[29] !== w || n[30] !== _ || n[31] !== R || n[32] !== I || n[33] !== S) {
2087
- let e = w.getFullYear(), t = w.getMonth(), r = Se(e, t), i = Ce(e, t), a = [];
2088
- for (let n = 1; n <= r; n++) a.push(new Date(e, t, n));
2089
- ee = `p-2 sm:p-4 w-full sm:max-w-fit flex justify-center sm:justify-start sm:gap-4 ${v}`, K = "w-full sm:w-auto";
2090
- let o;
2091
- n[41] === Symbol.for("react.memo_cache_sentinel") ? (o = () => B(-1), n[41] = o) : o = n[41];
2092
- let s;
2093
- n[42] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ d("button", {
2094
- type: "button",
2095
- onClick: o,
2096
- className: "p-1.5 sm:p-1 hover:bg-primary/20 bg-primary/10 rounded-full w-8 h-8 flex items-center justify-center cursor-pointer text-primary",
2097
- "aria-label": "Previous month",
2098
- children: /* @__PURE__ */ d(Te, { dir: "left" })
2099
- }), n[42] = s) : s = n[42];
2100
- let c;
2101
- n[43] === Symbol.for("react.memo_cache_sentinel") ? (c = () => B(1), n[43] = c) : c = n[43];
2102
- let l;
2103
- n[44] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ d("button", {
2104
- type: "button",
2105
- onClick: c,
2106
- className: "p-1.5 sm:p-1 hover:bg-primary/20 bg-primary/10 rounded-full w-8 h-8 flex items-center justify-center cursor-pointer text-primary",
2107
- "aria-label": "Next month",
2108
- children: /* @__PURE__ */ d(Te, { dir: "right" })
2109
- }), n[44] = l) : l = n[44], q = /* @__PURE__ */ f("div", {
2110
- className: "flex items-center justify-between mb-4",
2111
- children: [
2112
- s,
2113
- /* @__PURE__ */ f("div", {
2114
- className: "font-bold text-secondary text-sm sm:text-base px-2",
2115
- children: [
2116
- fe[t],
2117
- " ",
2118
- e
2119
- ]
2120
- }),
2121
- l
2122
- ]
2123
- }), n[45] === Symbol.for("react.memo_cache_sentinel") ? (J = /* @__PURE__ */ d("div", {
2124
- className: "grid grid-cols-7 text-xs text-center mb-2",
2125
- children: pe.map(Fe)
2126
- }), n[45] = J) : J = n[45], U = "grid grid-cols-7 gap-y-1 w-full sm:min-w-[21rem]", W = Array.from({ length: i }).map(Pe), G = a.map((e) => {
2127
- let t = I(e), n = !1, r = !1, i = !1, a = !1;
2128
- if (S) {
2129
- let t = be(S.start, S.end) !== 0, o = ye(e, S.start), s = ye(e, S.end);
2130
- n = !t && o && s, r = t && o && !s, i = t && s && !o, a = t && be(e, S.start) > 0 && be(e, S.end) < 0;
2131
- }
2132
- let o = !1, s = !1, c = !1;
2133
- for (let t of _) {
2134
- let n = _e(t.startDate), r = _e(t.endDate);
2135
- n && r && (xe(e, n, r) && (o = !0), ye(e, n) && (s = !0), ye(e, r) && (c = !0));
2136
- }
2137
- return /* @__PURE__ */ d(Me, {
2138
- day: e,
2139
- singleDay: n,
2140
- rangeStart: r,
2141
- rangeEnd: i,
2142
- inRangeMiddle: a,
2143
- displayInRange: o,
2144
- displayStart: s,
2145
- displayEnd: c,
2146
- disabled: t,
2147
- onClick: () => R(e)
2148
- }, ge(e));
2149
- }), n[28] = v, n[29] = w, n[30] = _, n[31] = R, n[32] = I, n[33] = S, n[34] = U, n[35] = W, n[36] = G, n[37] = K, n[38] = q, n[39] = J, n[40] = ee;
2150
- } else U = n[34], W = n[35], G = n[36], K = n[37], q = n[38], J = n[39], ee = n[40];
2151
- let Y;
2152
- n[46] !== U || n[47] !== W || n[48] !== G ? (Y = /* @__PURE__ */ f("div", {
2153
- className: U,
2154
- children: [W, G]
2155
- }), n[46] = U, n[47] = W, n[48] = G, n[49] = Y) : Y = n[49];
2156
- let X;
2157
- n[50] !== K || n[51] !== q || n[52] !== J || n[53] !== Y ? (X = /* @__PURE__ */ f("div", {
2158
- className: K,
2159
- children: [
2160
- q,
2161
- J,
2162
- Y
2163
- ]
2164
- }), n[50] = K, n[51] = q, n[52] = J, n[53] = Y, n[54] = X) : X = n[54];
2165
- let Z;
2166
- return n[55] !== ee || n[56] !== X ? (Z = /* @__PURE__ */ d("div", {
2167
- className: ee,
2168
- children: X
2169
- }), n[55] = ee, n[56] = X, n[57] = Z) : Z = n[57], Z;
2170
- }
2171
- function Pe(e, t) {
2172
- return /* @__PURE__ */ d("div", {}, `p-${t}`);
2173
- }
2174
- function Fe(e) {
2175
- return /* @__PURE__ */ d("div", {
2176
- className: "text-black font-bold",
2177
- children: e
2178
- }, e);
2179
- }
2180
- //#endregion
2181
- //#region src/ui/TimePicker.tsx
2182
- function Ie(e) {
2183
- let t = (0, D.c)(4), { className: n } = e, r, i;
2184
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ d("circle", {
2185
- cx: "12",
2186
- cy: "12",
2187
- r: "10"
2188
- }), i = /* @__PURE__ */ d("path", { d: "M12 6v6l4 2" }), t[0] = r, t[1] = i) : (r = t[0], i = t[1]);
2189
- let a;
2190
- return t[2] === n ? a = t[3] : (a = /* @__PURE__ */ f("svg", {
2191
- xmlns: "http://www.w3.org/2000/svg",
2192
- viewBox: "0 0 24 24",
2193
- fill: "none",
2194
- stroke: "currentColor",
2195
- strokeWidth: "2",
2196
- strokeLinecap: "round",
2197
- strokeLinejoin: "round",
2198
- className: n,
2199
- "aria-hidden": !0,
2200
- children: [r, i]
2201
- }), t[2] = n, t[3] = a), a;
2202
- }
2203
- function Le(e) {
2204
- let t = (0, D.c)(4), { className: n } = e, r, i;
2205
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ d("circle", {
2206
- cx: "12",
2207
- cy: "12",
2208
- r: "4"
2209
- }), i = /* @__PURE__ */ d("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41" }), t[0] = r, t[1] = i) : (r = t[0], i = t[1]);
2210
- let a;
2211
- return t[2] === n ? a = t[3] : (a = /* @__PURE__ */ f("svg", {
2212
- xmlns: "http://www.w3.org/2000/svg",
2213
- viewBox: "0 0 24 24",
2214
- fill: "none",
2215
- stroke: "currentColor",
2216
- strokeWidth: "2",
2217
- strokeLinecap: "round",
2218
- strokeLinejoin: "round",
2219
- className: n,
2220
- "aria-hidden": !0,
2221
- children: [r, i]
2222
- }), t[2] = n, t[3] = a), a;
2223
- }
2224
- function Re(e) {
2225
- let t = (0, D.c)(3), { className: n } = e, r;
2226
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ d("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" }), t[0] = r) : r = t[0];
2227
- let i;
2228
- return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ d("svg", {
2229
- xmlns: "http://www.w3.org/2000/svg",
2230
- viewBox: "0 0 24 24",
2231
- fill: "none",
2232
- stroke: "currentColor",
2233
- strokeWidth: "2",
2234
- strokeLinecap: "round",
2235
- strokeLinejoin: "round",
2236
- className: n,
2237
- "aria-hidden": !0,
2238
- children: r
2239
- }), t[1] = n, t[2] = i), i;
2240
- }
2241
- var ze = Array.from({ length: 12 }, (e, t) => (t + 1).toString().padStart(2, "0")), Be = Array.from({ length: 12 }, (e, t) => (t * 5).toString().padStart(2, "0"));
2242
- function Ve(e) {
2243
- if (!e || !/^\d{1,2}:\d{2}$/.test(e.trim())) return {
2244
- hour12: "12",
2245
- minute: "00",
2246
- period: "AM"
2247
- };
2248
- let [t, n] = e.trim().split(":"), r = Math.min(23, Math.max(0, parseInt(t, 10))), i = n.padStart(2, "0").slice(0, 2), a = r % 12;
2249
- a === 0 && (a = 12);
2250
- let o = r >= 12 ? "PM" : "AM";
2251
- return {
2252
- hour12: a.toString().padStart(2, "0"),
2253
- minute: i,
2254
- period: o
2255
- };
2256
- }
2257
- function He(e, t, n) {
2258
- let r = parseInt(e, 10);
2259
- (Number.isNaN(r) || r < 1 || r > 12) && (r = 12);
2260
- let i = r;
2261
- n === "PM" && i !== 12 ? i += 12 : n === "AM" && i === 12 && (i = 0);
2262
- let a = t.padStart(2, "0").slice(0, 2);
2263
- return `${i.toString().padStart(2, "0")}:${a}`;
2264
- }
2265
- function Ue(e) {
2266
- if (!e || !/^\d{1,2}:\d{2}$/.test(e.trim())) return "—";
2267
- let { hour12: t, minute: n, period: r } = Ve(e);
2268
- return `${parseInt(t, 10).toString().padStart(2, "0")}:${n} ${r}`;
2269
- }
2270
- function We(t) {
2271
- let n = (0, D.c)(43), { value: r, onChange: i, placeholder: a, variant: o, horizontalPosition: s, className: c, id: l } = t, u = a === void 0 ? "Select time" : a, p = o === void 0 ? "day" : o, m = s === void 0 ? "left" : s, h = c === void 0 ? "" : c, [g, _] = e.useState(!1), v;
2272
- n[0] === r ? v = n[1] : (v = Ve(r), n[0] = r, n[1] = v);
2273
- let y = v, [b, x] = e.useState(y.hour12), [S, C] = e.useState(y.minute), [w, T] = e.useState(y.period), E = e.useRef(null), O, k;
2274
- n[2] === r ? (O = n[3], k = n[4]) : (O = () => {
2275
- let e = Ve(r);
2276
- x(e.hour12), C(e.minute), T(e.period);
2277
- }, k = [r], n[2] = r, n[3] = O, n[4] = k), e.useEffect(O, k);
2278
- let A, j;
2279
- n[5] === Symbol.for("react.memo_cache_sentinel") ? (A = () => {
2280
- let e = (e) => {
2281
- let t = E.current, n = e.target;
2282
- t && n instanceof Node && !t.contains(n) && _(!1);
2283
- };
2284
- return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
2285
- }, j = [], n[5] = A, n[6] = j) : (A = n[5], j = n[6]), e.useEffect(A, j);
2286
- let M;
2287
- n[7] !== i || n[8] !== b || n[9] !== S || n[10] !== w ? (M = () => {
2288
- let e = He(b, S, w);
2289
- i?.(e), _(!1);
2290
- }, n[7] = i, n[8] = b, n[9] = S, n[10] = w, n[11] = M) : M = n[11];
2291
- let N = M, P;
2292
- n[12] === r ? P = n[13] : (P = r && /^\d{1,2}:\d{2}$/.test(r.trim()), n[12] = r, n[13] = P);
2293
- let F = !!P, I;
2294
- n[14] !== F || n[15] !== u || n[16] !== r ? (I = F ? Ue(r) : u, n[14] = F, n[15] = u, n[16] = r, n[17] = I) : I = n[17];
2295
- let L = I, R = `relative ${h}`, z;
2296
- n[18] === R ? z = n[19] : (z = R.trim(), n[18] = R, n[19] = z);
2297
- let B;
2298
- n[20] === Symbol.for("react.memo_cache_sentinel") ? (B = () => _(Ge), n[20] = B) : B = n[20];
2299
- let V;
2300
- n[21] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ d("div", { children: /* @__PURE__ */ d(Ie, { className: "h-3 w-3 sm:h-5 sm:w-5" }) }), n[21] = V) : V = n[21];
2301
- let H = `text-xs font-semibold sm:text-lg ${F ? "text-gray-600" : "text-gray-400"}`, U;
2302
- n[22] !== H || n[23] !== L ? (U = /* @__PURE__ */ d("div", {
2303
- className: "flex min-w-0 flex-1 items-center gap-1",
2304
- children: /* @__PURE__ */ d("span", {
2305
- className: H,
2306
- children: L
2307
- })
2308
- }), n[22] = H, n[23] = L, n[24] = U) : U = n[24];
2309
- let W;
2310
- n[25] === p ? W = n[26] : (W = /* @__PURE__ */ d("div", {
2311
- className: "shrink-0 text-gray-400",
2312
- children: p === "night" ? /* @__PURE__ */ d(Re, { className: "h-3 w-3 sm:h-4 sm:w-4" }) : /* @__PURE__ */ d(Le, { className: "h-3 w-3 sm:h-5 sm:w-5" })
2313
- }), n[25] = p, n[26] = W);
2314
- let G;
2315
- n[27] !== l || n[28] !== g || n[29] !== U || n[30] !== W ? (G = /* @__PURE__ */ f("button", {
2316
- id: l,
2317
- type: "button",
2318
- "aria-haspopup": "dialog",
2319
- "aria-expanded": g,
2320
- onClick: B,
2321
- className: "flex w-full min-w-0 items-center gap-1 rounded-lg border border-primary/50 bg-gray-50 px-1 py-2 transition-colors hover:bg-gray-100 focus:border-transparent focus:outline-none focus:ring-1 focus:ring-primary sm:px-3 sm:py-2",
2322
- children: [
2323
- V,
2324
- U,
2325
- W
2326
- ]
2327
- }), n[27] = l, n[28] = g, n[29] = U, n[30] = W, n[31] = G) : G = n[31];
2328
- let K;
2329
- n[32] !== N || n[33] !== m || n[34] !== g || n[35] !== b || n[36] !== S || n[37] !== w ? (K = g ? /* @__PURE__ */ f("div", {
2330
- role: "dialog",
2331
- "aria-label": "Choose time",
2332
- className: `absolute top-full z-20 mt-2 min-w-[200px] rounded-lg bg-white p-4 text-secondary shadow-primary ${m === "left" ? "left-0" : "right-0"}`,
2333
- children: [/* @__PURE__ */ f("div", {
2334
- className: "mb-4 flex gap-4",
2335
- children: [
2336
- /* @__PURE__ */ f("div", {
2337
- className: "min-w-0 flex-1",
2338
- children: [/* @__PURE__ */ d("div", {
2339
- className: "mb-2 text-center text-sm",
2340
- children: "Hour"
2341
- }), /* @__PURE__ */ d("div", {
2342
- className: "max-h-32 space-y-1 overflow-y-auto",
2343
- children: ze.map((e) => /* @__PURE__ */ d("button", {
2344
- type: "button",
2345
- onClick: () => x(e),
2346
- className: `w-full rounded px-2 py-1 text-sm ${b === e ? "bg-primary text-white" : "hover:bg-primary/20"}`,
2347
- children: e
2348
- }, e))
2349
- })]
2350
- }),
2351
- /* @__PURE__ */ f("div", {
2352
- className: "min-w-0 flex-1",
2353
- children: [/* @__PURE__ */ d("div", {
2354
- className: "mb-2 text-center text-sm",
2355
- children: "Min"
2356
- }), /* @__PURE__ */ d("div", {
2357
- className: "max-h-32 space-y-1 overflow-y-auto",
2358
- children: Be.map((e) => /* @__PURE__ */ d("button", {
2359
- type: "button",
2360
- onClick: () => C(e),
2361
- className: `w-full rounded px-2 py-1 text-sm ${S === e ? "bg-primary text-white" : "hover:bg-primary/20"}`,
2362
- children: e
2363
- }, e))
2364
- })]
2365
- }),
2366
- /* @__PURE__ */ f("div", {
2367
- className: "min-w-0 flex-1",
2368
- children: [/* @__PURE__ */ d("div", {
2369
- className: "mb-2 text-center text-sm",
2370
- children: "Period"
2371
- }), /* @__PURE__ */ d("div", {
2372
- className: "space-y-1",
2373
- children: ["AM", "PM"].map((e) => /* @__PURE__ */ d("button", {
2374
- type: "button",
2375
- onClick: () => T(e),
2376
- className: `w-full rounded px-2 py-1 text-sm ${w === e ? "bg-primary text-white" : "hover:bg-primary/20"}`,
2377
- children: e
2378
- }, e))
2379
- })]
2380
- })
2381
- ]
2382
- }), /* @__PURE__ */ f("div", {
2383
- className: "flex gap-2 border-t border-gray-600 pt-2",
2384
- children: [/* @__PURE__ */ d("button", {
2385
- type: "button",
2386
- onClick: () => _(!1),
2387
- className: "flex-1 cursor-pointer rounded px-3 py-2 text-sm transition-colors hover:bg-primary/20",
2388
- children: "CANCEL"
2389
- }), /* @__PURE__ */ d("button", {
2390
- type: "button",
2391
- onClick: N,
2392
- className: "flex-1 cursor-pointer rounded bg-primary px-3 py-2 text-sm text-white transition-colors",
2393
- children: "OK"
2394
- })]
2395
- })]
2396
- }) : null, n[32] = N, n[33] = m, n[34] = g, n[35] = b, n[36] = S, n[37] = w, n[38] = K) : K = n[38];
2397
- let q;
2398
- return n[39] !== z || n[40] !== G || n[41] !== K ? (q = /* @__PURE__ */ f("div", {
2399
- className: z,
2400
- ref: E,
2401
- children: [G, K]
2402
- }), n[39] = z, n[40] = G, n[41] = K, n[42] = q) : q = n[42], q;
2403
- }
2404
- function Ge(e) {
2405
- return !e;
2406
- }
2407
- //#endregion
2408
- //#region src/ui/Loader.tsx
2409
- function Ke(e) {
2410
- let t = (0, D.c)(8), { loadingClass: n, pulseDotClass: r, dotColorClass: i, className: a } = e, o = n === void 0 ? "" : n, s = r === void 0 ? "" : r, c = i === void 0 ? "bg-primary" : i, l = `flex items-center space-x-2.5 py-2 ${o} ${a === void 0 ? "" : a}`, u;
2411
- t[0] === l ? u = t[1] : (u = l.trim(), t[0] = l, t[1] = u);
2412
- let f;
2413
- t[2] !== c || t[3] !== s ? (f = Array.from({ length: 3 }, (e, t) => /* @__PURE__ */ d("div", { className: `h-2 w-2 rounded-full pulse-scale-dot ${c} ${s}`.trim() }, t)), t[2] = c, t[3] = s, t[4] = f) : f = t[4];
2414
- let p;
2415
- return t[5] !== u || t[6] !== f ? (p = /* @__PURE__ */ d("div", {
2416
- className: u,
2417
- role: "status",
2418
- "aria-label": "Loading",
2419
- "aria-live": "polite",
2420
- children: f
2421
- }), t[5] = u, t[6] = f, t[7] = p) : p = t[7], p;
2422
- }
2423
- function qe(e) {
2424
- let t = (0, D.c)(28), { fullScreen: n, className: r, svgWidth: i, heartColor: a, diamondColor: o } = e, s = n === void 0 ? !0 : n, c = r === void 0 ? "" : r, l = i === void 0 ? 300 : i, u = a === void 0 ? "#00BC78" : a, p = o === void 0 ? "#0072D8" : o, m;
2425
- t[0] === l ? m = t[1] : (m = { width: l }, t[0] = l, t[1] = m);
2426
- let h;
2427
- t[2] === u ? h = t[3] : (h = { color: u }, t[2] = u, t[3] = h);
2428
- let g;
2429
- t[4] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ d("path", {
2430
- className: "logo-path logo-heart-green",
2431
- d: "M532.8 41C532.8 51.2 529 61.5 521.3 69.4L487.8 104.2L431 163.2L372 106.4L339.7 75.3C323.4 59.6 322.9 33.7 338.6 17.4C346.7 9 357.4 4.8 368.1 4.8C378.3 4.8 388.6 8.6 396.5 16.3L428.8 47.4L462.3 12.6C478 -3.7 504 -4.2 520.3 11.5C528.6 19.5 532.8 30.2 532.8 41Z"
2432
- }), t[4] = g) : g = t[4];
2433
- let _;
2434
- t[5] === h ? _ = t[6] : (_ = /* @__PURE__ */ d("g", {
2435
- style: h,
2436
- children: g
2437
- }), t[5] = h, t[6] = _);
2438
- let v;
2439
- t[7] === p ? v = t[8] : (v = { color: p }, t[7] = p, t[8] = v);
2440
- let y;
2441
- t[9] === Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ d("path", {
2442
- className: "logo-path logo-diamond-blue",
2443
- d: "M682.1 291.2L625.3 350.2L559.4 286.8L492.9 356L492.7 356.1L492.9 356.2L554.6 415.6L497.7 474.7L436 415.3L435.9 415.1L435.8 415.3L374 479.5L314.9 422.6L376.7 358.4L376.9 358.3L376.7 358.2L307.7 291.8L307.5 291.6L307.3 291.8L246.5 355L187.4 298.1L248.3 234.9L248.5 234.7L248.2 234.5L182.6 171.3L239.5 112.3L305.1 175.5L305.3 175.7L305.5 175.5L372 106.4L431 163.2L364.6 232.3L364.3 232.5L364.6 232.7L433.6 299.1L433.7 299.3L433.8 299.1L500.4 230L431 163.2L487.9 104.2L557.2 170.9L618.3 107.5L677.3 164.4L616.2 227.8L682.1 291.2Z"
2444
- }), t[9] = y) : y = t[9];
2445
- let b;
2446
- t[10] === v ? b = t[11] : (b = /* @__PURE__ */ d("g", {
2447
- style: v,
2448
- children: y
2449
- }), t[10] = v, t[11] = b);
2450
- let x;
2451
- t[12] !== b || t[13] !== _ ? (x = /* @__PURE__ */ f("svg", {
2452
- viewBox: "0 0 865 685",
2453
- xmlns: "http://www.w3.org/2000/svg",
2454
- children: [_, b]
2455
- }), t[12] = b, t[13] = _, t[14] = x) : x = t[14];
2456
- let S;
2457
- t[15] !== x || t[16] !== m ? (S = /* @__PURE__ */ d("div", {
2458
- className: "relative",
2459
- children: /* @__PURE__ */ d("div", {
2460
- className: "icon-loader",
2461
- style: m,
2462
- children: x
2463
- })
2464
- }), t[15] = x, t[16] = m, t[17] = S) : S = t[17];
2465
- let C = S;
2466
- if (!s) {
2467
- let e = `flex items-center justify-center ${c}`, n;
2468
- t[18] === e ? n = t[19] : (n = e.trim(), t[18] = e, t[19] = n);
2469
- let r;
2470
- return t[20] !== C || t[21] !== n ? (r = /* @__PURE__ */ d("div", {
2471
- className: n,
2472
- role: "status",
2473
- "aria-label": "Loading",
2474
- "aria-live": "polite",
2475
- children: C
2476
- }), t[20] = C, t[21] = n, t[22] = r) : r = t[22], r;
2477
- }
2478
- let w = `fixed inset-0 z-50 flex items-center justify-center bg-white ${c}`, T;
2479
- t[23] === w ? T = t[24] : (T = w.trim(), t[23] = w, t[24] = T);
2480
- let E;
2481
- return t[25] !== C || t[26] !== T ? (E = /* @__PURE__ */ d("div", {
2482
- className: T,
2483
- role: "status",
2484
- "aria-label": "Loading",
2485
- "aria-live": "polite",
2486
- children: C
2487
- }), t[25] = C, t[26] = T, t[27] = E) : E = t[27], E;
2488
- }
2489
- function Je(e) {
2490
- let t = (0, D.c)(10), { sizeClass: n, className: r } = e, i = n === void 0 ? "h-24 w-24" : n, a = `relative ${r === void 0 ? "" : r}`, o;
2491
- t[0] === a ? o = t[1] : (o = a.trim(), t[0] = a, t[1] = o);
2492
- let s = `${i} rounded-full border-b-8 border-t-8 border-primary/50`, c;
2493
- t[2] === s ? c = t[3] : (c = /* @__PURE__ */ d("div", { className: s }), t[2] = s, t[3] = c);
2494
- let l = `absolute top-0 left-0 ${i} animate-spin rounded-full border-b-8 border-t-8 border-primary`, u;
2495
- t[4] === l ? u = t[5] : (u = /* @__PURE__ */ d("div", { className: l }), t[4] = l, t[5] = u);
2496
- let p;
2497
- return t[6] !== o || t[7] !== c || t[8] !== u ? (p = /* @__PURE__ */ f("div", {
2498
- className: o,
2499
- children: [c, u]
2500
- }), t[6] = o, t[7] = c, t[8] = u, t[9] = p) : p = t[9], p;
2501
- }
2502
- function Ye(e) {
2503
- let t = (0, D.c)(8), { sizeClass: n, className: r, backdropClassName: i } = e, a = r === void 0 ? "" : r, o = `fixed inset-0 z-50 flex items-center justify-center bg-white ${i === void 0 ? "" : i}`, s;
2504
- t[0] === o ? s = t[1] : (s = o.trim(), t[0] = o, t[1] = s);
2505
- let c;
2506
- t[2] !== a || t[3] !== n ? (c = /* @__PURE__ */ d(Je, {
2507
- sizeClass: n,
2508
- className: a
2509
- }), t[2] = a, t[3] = n, t[4] = c) : c = t[4];
2510
- let l;
2511
- return t[5] !== s || t[6] !== c ? (l = /* @__PURE__ */ d("div", {
2512
- className: s,
2513
- role: "status",
2514
- "aria-label": "Loading",
2515
- "aria-live": "polite",
2516
- children: c
2517
- }), t[5] = s, t[6] = c, t[7] = l) : l = t[7], l;
2518
- }
2519
- //#endregion
2520
- //#region src/ui/Modal.tsx
2521
- function Xe(e) {
2522
- let t = (0, D.c)(18), { isOpen: n, onClose: i, children: a, className: o, zIndexClass: s, closeOnBackdropClick: c, contentId: l } = e, u = o === void 0 ? "" : o, m = s === void 0 ? "z-[1500]" : s, h = c === void 0 ? !0 : c, g, _;
2523
- if (t[0] !== n || t[1] !== i ? (g = () => {
2524
- if (!n) return;
2525
- let e = (e) => {
2526
- e.key === "Escape" && i();
2527
- }, t = document.body.style.overflow;
2528
- return document.addEventListener("keydown", e), document.body.style.overflow = "hidden", () => {
2529
- document.removeEventListener("keydown", e), document.body.style.overflow = t;
2530
- };
2531
- }, _ = [n, i], t[0] = n, t[1] = i, t[2] = g, t[3] = _) : (g = t[2], _ = t[3]), r(g, _), !n || typeof document > "u") return null;
2532
- let v = `fixed inset-0 flex items-center justify-center p-2 ${m}`, y;
2533
- t[4] !== h || t[5] !== i ? (y = /* @__PURE__ */ d("div", {
2534
- className: "absolute inset-0 bg-black/50 backdrop-blur-md",
2535
- "aria-hidden": !0,
2536
- onClick: () => {
2537
- h && i();
2538
- }
2539
- }), t[4] = h, t[5] = i, t[6] = y) : y = t[6];
2540
- let b = `relative z-10 w-full max-w-[420px] rounded-primary bg-white shadow-primary sm:max-w-[700px] md:max-w-[800px] ${u}`, x;
2541
- t[7] === b ? x = t[8] : (x = b.trim(), t[7] = b, t[8] = x);
2542
- let S;
2543
- t[9] === Symbol.for("react.memo_cache_sentinel") ? (S = {
2544
- maxHeight: "80vh",
2545
- overflowY: "auto"
2546
- }, t[9] = S) : S = t[9];
2547
- let C;
2548
- t[10] !== a || t[11] !== l || t[12] !== x ? (C = /* @__PURE__ */ d("div", {
2549
- id: l,
2550
- role: "dialog",
2551
- "aria-modal": "true",
2552
- className: x,
2553
- style: S,
2554
- onClick: Ze,
2555
- children: a
2556
- }), t[10] = a, t[11] = l, t[12] = x, t[13] = C) : C = t[13];
2557
- let w;
2558
- return t[14] !== C || t[15] !== v || t[16] !== y ? (w = p(/* @__PURE__ */ f("div", {
2559
- className: v,
2560
- role: "presentation",
2561
- children: [y, C]
2562
- }), document.body), t[14] = C, t[15] = v, t[16] = y, t[17] = w) : w = t[17], w;
2563
- }
2564
- function Ze(e) {
2565
- return e.stopPropagation();
2566
- }
2567
- //#endregion
2568
- //#region src/ui/CongratulationsBox.tsx
2569
- function Qe(e) {
2570
- let t = (0, D.c)(4), { className: n } = e, r, i;
2571
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ d("circle", {
2572
- cx: "40",
2573
- cy: "40",
2574
- r: "38",
2575
- className: "fill-primary",
2576
- stroke: "currentColor",
2577
- strokeWidth: "2"
2578
- }), i = /* @__PURE__ */ d("path", {
2579
- className: "stroke-white",
2580
- strokeWidth: "4",
2581
- strokeLinecap: "round",
2582
- strokeLinejoin: "round",
2583
- d: "M24 40l11 11 21-22"
2584
- }), t[0] = r, t[1] = i) : (r = t[0], i = t[1]);
2585
- let a;
2586
- return t[2] === n ? a = t[3] : (a = /* @__PURE__ */ f("svg", {
2587
- xmlns: "http://www.w3.org/2000/svg",
2588
- viewBox: "0 0 80 80",
2589
- fill: "none",
2590
- className: n,
2591
- "aria-hidden": !0,
2592
- children: [r, i]
2593
- }), t[2] = n, t[3] = a), a;
2594
- }
2595
- function $e({ title: e = "Congratulations!", message: t = /* @__PURE__ */ d(u, { children: "Your Profile is now \"Verified\"." }), durationMs: n = 3e3, tickMs: i = 50, onComplete: a, className: s = "" }) {
2596
- let [c, l] = o(0), [p, m] = o(!0);
2597
- return r(() => {
2598
- if (n <= 0) return;
2599
- let e = 100 / n * i, t = window.setInterval(() => {
2600
- l((n) => {
2601
- let r = n + e;
2602
- return r >= 100 ? (window.clearInterval(t), window.setTimeout(() => {
2603
- m(!1), a?.();
2604
- }, 100), 100) : r;
2605
- });
2606
- }, i);
2607
- return () => window.clearInterval(t);
2608
- }, [
2609
- n,
2610
- i,
2611
- a
2612
- ]), p ? /* @__PURE__ */ d("div", {
2613
- className: `mx-auto w-full max-w-lg py-8 sm:max-w-xl md:max-w-2xl ${s}`.trim(),
2614
- children: /* @__PURE__ */ f("div", {
2615
- className: "relative mt-8 flex w-full flex-col gap-4 rounded-primary p-4 shadow-primary sm:gap-8 sm:p-8 lg:p-12",
2616
- children: [
2617
- n > 0 ? /* @__PURE__ */ d("div", {
2618
- className: "absolute top-0 left-0 flex w-full justify-start",
2619
- children: /* @__PURE__ */ d("div", {
2620
- className: "h-2 rounded-primary bg-primary transition-all duration-100 ease-linear",
2621
- style: { width: `${c}%` }
2622
- })
2623
- }) : null,
2624
- /* @__PURE__ */ d("div", {
2625
- className: "flex justify-center rounded-full",
2626
- children: /* @__PURE__ */ d(Qe, { className: "h-16 w-16 text-primary lg:h-24 lg:w-24" })
2627
- }),
2628
- /* @__PURE__ */ d("h1", {
2629
- className: "text-center text-2xl font-bold text-primary sm:text-3xl lg:text-5xl",
2630
- children: e
2631
- }),
2632
- /* @__PURE__ */ d("p", {
2633
- className: "text-center text-base font-bold text-secondary sm:text-lg lg:text-2xl",
2634
- children: t
2635
- })
2636
- ]
2637
- })
2638
- }) : null;
2639
- }
2640
- //#endregion
2641
- //#region src/ui/Card.tsx
2642
- function et(e) {
2643
- let t = (0, D.c)(25), { title: n, description: r, image: i, imageAlt: a, onClick: o, className: s, style: c } = e, l = s === void 0 ? "" : s, u = a ?? (typeof n == "string" ? n : "Card image"), p = `shrink-0 px-2 ${l}`, m;
2644
- t[0] === p ? m = t[1] : (m = p.trim(), t[0] = p, t[1] = m);
2645
- let h;
2646
- t[2] === o ? h = t[3] : (h = o ? (e) => {
2647
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), o());
2648
- } : void 0, t[2] = o, t[3] = h);
2649
- let g = o ? "button" : void 0, _ = o ? 0 : void 0, v;
2650
- t[4] !== u || t[5] !== i ? (v = /* @__PURE__ */ d("div", {
2651
- className: "relative h-[220px] w-full sm:h-[280px] md:h-[320px] lg:h-[360px]",
2652
- children: /* @__PURE__ */ d("img", {
2653
- src: i,
2654
- alt: u,
2655
- className: "absolute inset-0 h-full w-full rounded-2xl object-cover",
2656
- loading: "lazy",
2657
- decoding: "async"
2658
- })
2659
- }), t[4] = u, t[5] = i, t[6] = v) : v = t[6];
2660
- let y;
2661
- t[7] === n ? y = t[8] : (y = /* @__PURE__ */ d("h3", {
2662
- className: "text-center text-lg font-bold text-primary transition-colors duration-200 sm:text-xl md:text-2xl",
2663
- children: n
2664
- }), t[7] = n, t[8] = y);
2665
- let b;
2666
- t[9] === r ? b = t[10] : (b = /* @__PURE__ */ d("p", {
2667
- className: "mb-3 text-center text-sm text-secondary sm:text-base",
2668
- children: r
2669
- }), t[9] = r, t[10] = b);
2670
- let x;
2671
- t[11] !== y || t[12] !== b ? (x = /* @__PURE__ */ f("div", {
2672
- className: "mt-4 flex w-full flex-1 flex-col justify-between px-2 text-center sm:px-4",
2673
- children: [y, b]
2674
- }), t[11] = y, t[12] = b, t[13] = x) : x = t[13];
2675
- let S;
2676
- t[14] !== x || t[15] !== v ? (S = /* @__PURE__ */ f("div", {
2677
- className: "flex h-full flex-col overflow-hidden bg-transparent transition-all duration-300",
2678
- children: [v, x]
2679
- }), t[14] = x, t[15] = v, t[16] = S) : S = t[16];
2680
- let C;
2681
- return t[17] !== o || t[18] !== c || t[19] !== S || t[20] !== m || t[21] !== h || t[22] !== g || t[23] !== _ ? (C = /* @__PURE__ */ d("div", {
2682
- className: m,
2683
- style: c,
2684
- onClick: o,
2685
- onKeyDown: h,
2686
- role: g,
2687
- tabIndex: _,
2688
- children: S
2689
- }), t[17] = o, t[18] = c, t[19] = S, t[20] = m, t[21] = h, t[22] = g, t[23] = _, t[24] = C) : C = t[24], C;
2690
- }
2691
- function tt(e) {
2692
- let t = (0, D.c)(53), { title: n, description: r, img: i, imgMobile: a, imageAlt: o, logo: s, isReverse: c, className: l } = e, u = o === void 0 ? "Info image" : o, p = c === void 0 ? !1 : c, m = `w-full ${l === void 0 ? "" : l}`, h;
2693
- t[0] === m ? h = t[1] : (h = m.trim(), t[0] = m, t[1] = h);
2694
- let g = `relative mb-4 aspect-square w-1/2 ${p ? "float-left mr-5" : "float-right ml-5"}`, _ = a ?? i, v;
2695
- t[2] !== u || t[3] !== _ ? (v = /* @__PURE__ */ d("img", {
2696
- src: _,
2697
- alt: u,
2698
- className: "h-full w-full rounded-2xl object-cover",
2699
- loading: "lazy",
2700
- decoding: "async"
2701
- }), t[2] = u, t[3] = _, t[4] = v) : v = t[4];
2702
- let y;
2703
- t[5] !== p || t[6] !== s ? (y = s ? /* @__PURE__ */ d("div", {
2704
- className: `absolute -bottom-4 scale-75 transform ${p ? "-right-4" : "-left-4"}`,
2705
- children: s
2706
- }) : null, t[5] = p, t[6] = s, t[7] = y) : y = t[7];
2707
- let b;
2708
- t[8] !== g || t[9] !== v || t[10] !== y ? (b = /* @__PURE__ */ f("div", {
2709
- className: g,
2710
- children: [v, y]
2711
- }), t[8] = g, t[9] = v, t[10] = y, t[11] = b) : b = t[11];
2712
- let x;
2713
- t[12] === n ? x = t[13] : (x = /* @__PURE__ */ d("h2", {
2714
- className: "section-header-text mb-3 text-left font-bold leading-[1.2] text-primary",
2715
- children: n
2716
- }), t[12] = n, t[13] = x);
2717
- let S;
2718
- t[14] === r ? S = t[15] : (S = /* @__PURE__ */ d("p", {
2719
- className: "paragraph-text whitespace-pre-line leading-relaxed text-secondary",
2720
- children: r
2721
- }), t[14] = r, t[15] = S);
2722
- let C;
2723
- t[16] !== b || t[17] !== x || t[18] !== S ? (C = /* @__PURE__ */ f("div", {
2724
- className: "relative",
2725
- children: [
2726
- b,
2727
- x,
2728
- S
2729
- ]
2730
- }), t[16] = b, t[17] = x, t[18] = S, t[19] = C) : C = t[19];
2731
- let w;
2732
- t[20] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ d("div", { className: "clear-both" }), t[20] = w) : w = t[20];
2733
- let T;
2734
- t[21] === C ? T = t[22] : (T = /* @__PURE__ */ f("div", {
2735
- className: "block w-full lg:hidden",
2736
- children: [C, w]
2737
- }), t[21] = C, t[22] = T);
2738
- let E = `hidden w-full items-center gap-0 lg:flex ${p ? "flex-row-reverse" : "flex-row"}`, O = `flex flex-1 flex-col justify-center gap-6 text-left ${p ? "items-start pl-16" : "items-end pr-16"}`, k;
2739
- t[23] === n ? k = t[24] : (k = /* @__PURE__ */ d("h2", {
2740
- className: "section-header-text mb-4 font-bold leading-tight text-primary",
2741
- children: n
2742
- }), t[23] = n, t[24] = k);
2743
- let A;
2744
- t[25] === r ? A = t[26] : (A = /* @__PURE__ */ d("p", {
2745
- className: "paragraph-text whitespace-pre-line leading-relaxed text-secondary",
2746
- children: r
2747
- }), t[25] = r, t[26] = A);
2748
- let j;
2749
- t[27] !== k || t[28] !== A ? (j = /* @__PURE__ */ f("div", {
2750
- className: "w-full max-w-md",
2751
- children: [k, A]
2752
- }), t[27] = k, t[28] = A, t[29] = j) : j = t[29];
2753
- let M;
2754
- t[30] !== O || t[31] !== j ? (M = /* @__PURE__ */ d("div", {
2755
- className: O,
2756
- children: j
2757
- }), t[30] = O, t[31] = j, t[32] = M) : M = t[32];
2758
- let N = `relative flex flex-1 ${p ? "justify-end pr-16" : "justify-start pl-16"}`, P;
2759
- t[33] !== u || t[34] !== i ? (P = /* @__PURE__ */ d("img", {
2760
- src: i,
2761
- alt: u,
2762
- className: "aspect-square w-full rounded-3xl object-cover",
2763
- loading: "lazy",
2764
- decoding: "async"
2765
- }), t[33] = u, t[34] = i, t[35] = P) : P = t[35];
2766
- let F;
2767
- t[36] !== p || t[37] !== s ? (F = s ? /* @__PURE__ */ d("div", {
2768
- className: `absolute -bottom-4 rounded-full transform ${p ? "-right-4" : "-left-4"}`,
2769
- children: s
2770
- }) : null, t[36] = p, t[37] = s, t[38] = F) : F = t[38];
2771
- let I;
2772
- t[39] !== P || t[40] !== F ? (I = /* @__PURE__ */ f("div", {
2773
- className: "relative w-full max-w-md",
2774
- children: [P, F]
2775
- }), t[39] = P, t[40] = F, t[41] = I) : I = t[41];
2776
- let L;
2777
- t[42] !== N || t[43] !== I ? (L = /* @__PURE__ */ d("div", {
2778
- className: N,
2779
- children: I
2780
- }), t[42] = N, t[43] = I, t[44] = L) : L = t[44];
2781
- let R;
2782
- t[45] !== E || t[46] !== M || t[47] !== L ? (R = /* @__PURE__ */ f("div", {
2783
- className: E,
2784
- children: [M, L]
2785
- }), t[45] = E, t[46] = M, t[47] = L, t[48] = R) : R = t[48];
2786
- let z;
2787
- return t[49] !== T || t[50] !== R || t[51] !== h ? (z = /* @__PURE__ */ f("div", {
2788
- className: h,
2789
- children: [T, R]
2790
- }), t[49] = T, t[50] = R, t[51] = h, t[52] = z) : z = t[52], z;
2791
- }
2792
- //#endregion
2793
- //#region src/ui/BookingDetailsCard.tsx
2794
- function nt(e) {
2795
- let t = (0, D.c)(4), { className: n } = e, r, i;
2796
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ d("path", { d: "M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" }), i = /* @__PURE__ */ d("polyline", { points: "9 22 9 12 15 12 15 22" }), t[0] = r, t[1] = i) : (r = t[0], i = t[1]);
2797
- let a;
2798
- return t[2] === n ? a = t[3] : (a = /* @__PURE__ */ f("svg", {
2799
- xmlns: "http://www.w3.org/2000/svg",
2800
- viewBox: "0 0 24 24",
2801
- fill: "none",
2802
- stroke: "currentColor",
2803
- strokeWidth: "1.75",
2804
- strokeLinecap: "round",
2805
- strokeLinejoin: "round",
2806
- className: n,
2807
- "aria-hidden": !0,
2808
- children: [r, i]
2809
- }), t[2] = n, t[3] = a), a;
2810
- }
2811
- function rt(e, t) {
2812
- return t != null && t > 0 && typeof e == "string" && e.length > t ? /* @__PURE__ */ f(u, { children: [e.slice(0, t), /* @__PURE__ */ d("span", {
2813
- className: "text-primary",
2814
- children: "..."
2815
- })] }) : e;
2816
- }
2817
- var it = "relative block cursor-pointer rounded-secondary border border-gray-100 bg-white p-4 shadow-primary transition-shadow duration-200 hover:shadow-sm sm:p-4";
2818
- function at(e) {
2819
- let t = (0, D.c)(35), { title: n, description: r, icon: i, iconSrc: a, iconAlt: o, to: c, onClick: l, amenities: p, credits: m, descriptionMaxLength: h, className: g } = e, _ = o === void 0 ? "" : o, v = h === void 0 ? 150 : h, y = g === void 0 ? "" : g, b;
2820
- t[0] !== i || t[1] !== _ || t[2] !== a ? (b = /* @__PURE__ */ d("div", {
2821
- className: "absolute -top-3 left-4 h-12 w-12 overflow-hidden rounded-xl bg-white shadow-[0_12px_40px_rgba(0,0,0,0.12),0_4px_12px_rgba(0,0,0,0.08)] sm:-top-5 sm:left-6 sm:h-16 sm:w-16",
2822
- children: i ? /* @__PURE__ */ d("span", {
2823
- className: "flex h-full w-full items-center justify-center p-1.5 text-primary [&_svg]:max-h-full [&_svg]:max-w-full [&_img]:max-h-full [&_img]:max-w-full [&_img]:object-contain",
2824
- children: i
2825
- }) : a ? /* @__PURE__ */ d("img", {
2826
- src: a,
2827
- alt: _,
2828
- className: "h-full w-full object-cover",
2829
- loading: "lazy"
2830
- }) : /* @__PURE__ */ d("div", {
2831
- className: "flex h-full w-full items-center justify-center p-1.5",
2832
- children: /* @__PURE__ */ d(nt, { className: "h-8 w-8 text-primary sm:h-10 sm:w-10" })
2833
- })
2834
- }), t[0] = i, t[1] = _, t[2] = a, t[3] = b) : b = t[3];
2835
- let x;
2836
- t[4] === n ? x = t[5] : (x = /* @__PURE__ */ d("h3", {
2837
- className: "title-text mb-1 font-bold text-primary sm:mb-1",
2838
- children: n
2839
- }), t[4] = n, t[5] = x);
2840
- let S;
2841
- t[6] !== r || t[7] !== v ? (S = rt(r, v), t[6] = r, t[7] = v, t[8] = S) : S = t[8];
2842
- let C;
2843
- t[9] === S ? C = t[10] : (C = /* @__PURE__ */ d("p", {
2844
- className: "paragraph-text mb-4 leading-relaxed text-secondary sm:mb-4",
2845
- children: S
2846
- }), t[9] = S, t[10] = C);
2847
- let w;
2848
- t[11] === p ? w = t[12] : (w = p && p.length > 0 ? /* @__PURE__ */ d("div", {
2849
- className: "mb-4 grid grid-cols-2 gap-x-2 gap-y-2 sm:mb-6 sm:gap-y-3",
2850
- children: p.map(ot)
2851
- }) : null, t[11] = p, t[12] = w);
2852
- let T;
2853
- t[13] === m ? T = t[14] : (T = m ? /* @__PURE__ */ f("div", {
2854
- className: "flex items-center gap-2",
2855
- children: [/* @__PURE__ */ d("div", {
2856
- className: "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary sm:h-6 sm:w-6",
2857
- children: /* @__PURE__ */ d("span", {
2858
- className: "paragraph-text font-bold text-white",
2859
- children: m.badgeText
2860
- })
2861
- }), /* @__PURE__ */ d("span", {
2862
- className: "paragraph-text text-secondary",
2863
- children: m.label
2864
- })]
2865
- }) : null, t[13] = m, t[14] = T);
2866
- let E;
2867
- t[15] !== x || t[16] !== C || t[17] !== w || t[18] !== T ? (E = /* @__PURE__ */ f("div", {
2868
- className: "mt-10",
2869
- children: [
2870
- x,
2871
- C,
2872
- w,
2873
- T
2874
- ]
2875
- }), t[15] = x, t[16] = C, t[17] = w, t[18] = T, t[19] = E) : E = t[19];
2876
- let O;
2877
- t[20] !== E || t[21] !== b ? (O = /* @__PURE__ */ f(u, { children: [b, E] }), t[20] = E, t[21] = b, t[22] = O) : O = t[22];
2878
- let k = O;
2879
- if (c) {
2880
- let e = `${it} ${y}`, n;
2881
- t[23] === e ? n = t[24] : (n = e.trim(), t[23] = e, t[24] = n);
2882
- let r;
2883
- return t[25] !== k || t[26] !== n || t[27] !== c ? (r = /* @__PURE__ */ d(s, {
2884
- to: c,
2885
- className: n,
2886
- children: k
2887
- }), t[25] = k, t[26] = n, t[27] = c, t[28] = r) : r = t[28], r;
2888
- }
2889
- let A = `${it} ${y}`, j;
2890
- t[29] === A ? j = t[30] : (j = A.trim(), t[29] = A, t[30] = j);
2891
- let M;
2892
- return t[31] !== k || t[32] !== l || t[33] !== j ? (M = /* @__PURE__ */ d("div", {
2893
- className: j,
2894
- onClick: l,
2895
- children: k
2896
- }), t[31] = k, t[32] = l, t[33] = j, t[34] = M) : M = t[34], M;
2897
- }
2898
- function ot(e, t) {
2899
- return /* @__PURE__ */ f("div", {
2900
- className: "flex gap-2 sm:gap-3",
2901
- children: [/* @__PURE__ */ d("div", {
2902
- className: "h-4 w-4 shrink-0 text-primary sm:h-5 sm:w-5 [&_svg]:h-full [&_svg]:w-full",
2903
- children: e.icon
2904
- }), /* @__PURE__ */ d("span", {
2905
- className: "paragraph-text capitalize text-secondary",
2906
- children: e.label
2907
- })]
2908
- }, t);
2909
- }
2910
- //#endregion
2911
- //#region src/ui/Accordion.tsx
2912
- function st(e) {
2913
- let t = (0, D.c)(3), { className: n } = e, r;
2914
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ d("path", {
2915
- strokeLinecap: "round",
2916
- strokeLinejoin: "round",
2917
- strokeWidth: 2,
2918
- d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
2919
- }), t[0] = r) : r = t[0];
2920
- let i;
2921
- return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ d("svg", {
2922
- className: n,
2923
- fill: "none",
2924
- stroke: "currentColor",
2925
- viewBox: "0 0 24 24",
2926
- "aria-hidden": !0,
2927
- children: r
2928
- }), t[1] = n, t[2] = i), i;
2929
- }
2930
- function ct(e) {
2931
- let t = (0, D.c)(2), { expanded: n } = e, r;
2932
- return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ d("span", {
2933
- className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-primary sm:h-[30px] sm:w-[30px]",
2934
- "aria-hidden": !0,
2935
- children: /* @__PURE__ */ d("svg", {
2936
- viewBox: "0 0 24 24",
2937
- className: "h-[18px] w-[18px] sm:h-[22px] sm:w-[22px]",
2938
- fill: "none",
2939
- children: n ? /* @__PURE__ */ d("path", {
2940
- stroke: "white",
2941
- strokeLinecap: "round",
2942
- strokeWidth: 2.75,
2943
- d: "M5 12h14"
2944
- }) : /* @__PURE__ */ d("path", {
2945
- stroke: "white",
2946
- strokeLinecap: "round",
2947
- strokeWidth: 2.75,
2948
- d: "M12 5v14M5 12h14"
2949
- })
2950
- })
2951
- }), t[0] = n, t[1] = r), r;
2952
- }
2953
- function lt(e) {
2954
- let t = (0, D.c)(13), { filteredFaqs: n, emptyMessage: r } = e, [i, a] = o(null), s;
2955
- if (t[0] !== n || t[1] !== i) {
2956
- let e;
2957
- t[3] === i ? e = t[4] : (e = (e, t) => /* @__PURE__ */ f("div", {
2958
- className: "border-b border-primary bg-white",
2959
- children: [/* @__PURE__ */ d(k, {
2960
- type: "button",
2961
- outline: !0,
2962
- width: "full",
2963
- title: /* @__PURE__ */ f("div", {
2964
- className: "flex w-full items-center justify-between",
2965
- children: [/* @__PURE__ */ f("div", {
2966
- className: "flex items-center gap-2 sm:gap-4",
2967
- children: [/* @__PURE__ */ d("span", {
2968
- className: "title-text font-bold text-primary/50",
2969
- children: String(t + 1).padStart(2, "0")
2970
- }), /* @__PURE__ */ d("span", {
2971
- className: "title-text font-bold",
2972
- children: e.question
2973
- })]
2974
- }), /* @__PURE__ */ d("div", {
2975
- className: "ml-2 shrink-0 sm:ml-4",
2976
- children: /* @__PURE__ */ d(ct, { expanded: i === t })
2977
- })]
2978
- }),
2979
- onClick: () => a((e) => e === t ? null : t),
2980
- className: "!h-auto !min-h-0 !justify-start !rounded-none !border-0 !bg-transparent !px-0 !pt-0 !pb-2 !text-left !shadow-none !ring-0 !outline-none sm:!pb-4 text-xs sm:text-base"
2981
- }), i === t ? /* @__PURE__ */ d("div", {
2982
- className: "pb-2 sm:pb-4",
2983
- children: e.answerHtml != null && e.answerHtml !== "" ? /* @__PURE__ */ d("div", {
2984
- className: "faq-answer-content paragraph-text text-secondary",
2985
- dangerouslySetInnerHTML: { __html: e.answerHtml }
2986
- }) : /* @__PURE__ */ d("div", {
2987
- className: "faq-answer-content paragraph-text text-secondary",
2988
- children: e.answer
2989
- })
2990
- }) : null]
2991
- }, `${e.question}-${t}`), t[3] = i, t[4] = e), s = n.map(e), t[0] = n, t[1] = i, t[2] = s;
2992
- } else s = t[2];
2993
- let c;
2994
- t[5] === s ? c = t[6] : (c = /* @__PURE__ */ d("div", {
2995
- className: "flex flex-col gap-2 sm:gap-4",
2996
- children: s
2997
- }), t[5] = s, t[6] = c);
2998
- let l;
2999
- t[7] !== r || t[8] !== n.length ? (l = n.length === 0 ? /* @__PURE__ */ d("div", {
3000
- className: "py-8 text-center text-sm text-primary sm:text-base",
3001
- children: r
3002
- }) : null, t[7] = r, t[8] = n.length, t[9] = l) : l = t[9];
3003
- let p;
3004
- return t[10] !== c || t[11] !== l ? (p = /* @__PURE__ */ f(u, { children: [c, l] }), t[10] = c, t[11] = l, t[12] = p) : p = t[12], p;
3005
- }
3006
- function ut(e) {
3007
- let t = (0, D.c)(36), { faqs: n, categories: r, showCategories: i, showSearch: a, className: s, activeCategory: c, defaultActiveCategory: l, onActiveCategoryChange: u, searchPlaceholder: p, emptyMessage: m } = e, h;
3008
- t[0] === n ? h = t[1] : (h = n === void 0 ? [] : n, t[0] = n, t[1] = h);
3009
- let g = h, _;
3010
- t[2] === r ? _ = t[3] : (_ = r === void 0 ? [] : r, t[2] = r, t[3] = _);
3011
- let v = _, y = i === void 0 ? !0 : i, b = a === void 0 ? !0 : a, x = s === void 0 ? "" : s, S = p === void 0 ? "Search here..." : p, C = m === void 0 ? "No FAQs match your search." : m, [w, T] = o(""), [E, O] = o(l ?? v[0] ?? ""), k = c !== void 0, A = k ? c : E, j;
3012
- t[4] !== k || t[5] !== u ? (j = (e) => {
3013
- u?.(e), k || O(e);
3014
- }, t[4] = k, t[5] = u, t[6] = j) : j = t[6];
3015
- let M = j, N;
3016
- if (t[7] !== A || t[8] !== g || t[9] !== w || t[10] !== y) {
3017
- let e;
3018
- t[12] !== A || t[13] !== w || t[14] !== y ? (e = (e) => {
3019
- let t = !y || !e.category || e.category === A, n = e.question.toLowerCase(), r = (e.answerHtml ?? "").toLowerCase(), i = !w || n.includes(w.toLowerCase()) || r.includes(w.toLowerCase());
3020
- return t && i;
3021
- }, t[12] = A, t[13] = w, t[14] = y, t[15] = e) : e = t[15], N = g.filter(e), t[7] = A, t[8] = g, t[9] = w, t[10] = y, t[11] = N;
3022
- } else N = t[11];
3023
- let P = N, F = `mx-auto flex flex-col ${x}`, I;
3024
- t[16] === F ? I = t[17] : (I = F.trim(), t[16] = F, t[17] = I);
3025
- let L;
3026
- t[18] !== A || t[19] !== v || t[20] !== M || t[21] !== y ? (L = y && v.length > 1 ? /* @__PURE__ */ d("div", {
3027
- className: "mb-4 flex flex-wrap justify-center gap-2",
3028
- children: v.map((e) => /* @__PURE__ */ d("button", {
3029
- type: "button",
3030
- className: `rounded-button-text cursor-pointer rounded-full border px-4 py-2 font-bold transition-colors duration-150 ${A === e ? "border-primary bg-primary text-white" : "border-primary/50 bg-white text-primary hover:border-primary"}`,
3031
- onClick: () => M(e),
3032
- children: e
3033
- }, e))
3034
- }) : null, t[18] = A, t[19] = v, t[20] = M, t[21] = y, t[22] = L) : L = t[22];
3035
- let R;
3036
- t[23] !== S || t[24] !== w || t[25] !== b ? (R = b ? /* @__PURE__ */ f("div", {
3037
- className: "relative mb-4 sm:mb-6",
3038
- children: [/* @__PURE__ */ d("input", {
3039
- type: "search",
3040
- placeholder: S,
3041
- value: w,
3042
- onChange: (e) => T(e.target.value),
3043
- className: "w-full rounded-full border border-primary py-2 pr-3 pl-9 text-sm text-primary outline-none focus:border-primary focus:shadow-none focus:outline-none focus:ring-0 focus:ring-offset-0 focus-visible:outline-none focus-visible:ring-0 sm:py-3 sm:pl-10 sm:text-base",
3044
- "aria-label": S
3045
- }), /* @__PURE__ */ d(st, { className: "absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 text-primary sm:h-5 sm:w-5" })]
3046
- }) : null, t[23] = S, t[24] = w, t[25] = b, t[26] = R) : R = t[26];
3047
- let z = `${A}\u0000${w}`, B;
3048
- t[27] !== C || t[28] !== P || t[29] !== z ? (B = /* @__PURE__ */ d(lt, {
3049
- filteredFaqs: P,
3050
- emptyMessage: C
3051
- }, z), t[27] = C, t[28] = P, t[29] = z, t[30] = B) : B = t[30];
3052
- let V;
3053
- return t[31] !== I || t[32] !== L || t[33] !== R || t[34] !== B ? (V = /* @__PURE__ */ f("div", {
3054
- className: I,
3055
- children: [
3056
- L,
3057
- R,
3058
- B
3059
- ]
3060
- }), t[31] = I, t[32] = L, t[33] = R, t[34] = B, t[35] = V) : V = t[35], V;
3061
- }
3062
- var dt = ut;
3063
- function ft(e) {
3064
- let t = (0, D.c)(44), n, r, i, a, s, c, l, u, p, m, h;
3065
- t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], s = t[5], c = t[6], l = t[7], u = t[8], p = t[9], m = t[10], h = t[11]) : ({onDelete: a, header: i, children: n, showDeleteButton: u, className: p, expanded: r, defaultExpanded: m, onExpandedChange: s, onToggle: c, keepMounted: h, ...l} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = s, t[6] = c, t[7] = l, t[8] = u, t[9] = p, t[10] = m, t[11] = h);
3066
- let g = u === void 0 ? !0 : u, _ = p === void 0 ? "" : p, v = m === void 0 ? !1 : m, y = h === void 0 ? !1 : h, [b, x] = o(v), S = r !== void 0, C = S ? r : b, w;
3067
- t[12] !== S || t[13] !== C || t[14] !== s || t[15] !== c ? (w = () => {
3068
- if (c) {
3069
- c();
3070
- return;
3071
- }
3072
- let e = !C;
3073
- S ? s?.(e) : x(e);
3074
- }, t[12] = S, t[13] = C, t[14] = s, t[15] = c, t[16] = w) : w = t[16];
3075
- let T = w, E = `overflow-hidden rounded-lg border border-primary ${_}`, O;
3076
- t[17] === E ? O = t[18] : (O = E.trim(), t[17] = E, t[18] = O);
3077
- let k;
3078
- t[19] === i ? k = t[20] : (k = /* @__PURE__ */ d("div", {
3079
- className: "flex items-center gap-3",
3080
- children: /* @__PURE__ */ d("span", {
3081
- className: "paragraph-text font-semibold",
3082
- children: i
3083
- })
3084
- }), t[19] = i, t[20] = k);
3085
- let A;
3086
- t[21] !== a || t[22] !== g ? (A = g && a ? /* @__PURE__ */ d("button", {
3087
- type: "button",
3088
- onClick: (e) => {
3089
- e.stopPropagation(), a();
3090
- },
3091
- className: "cursor-pointer border-0 bg-transparent p-0 text-white transition-colors hover:text-red-200",
3092
- title: "Delete item",
3093
- children: /* @__PURE__ */ d("svg", {
3094
- className: "h-5 w-5",
3095
- fill: "none",
3096
- stroke: "currentColor",
3097
- viewBox: "0 0 24 24",
3098
- "aria-hidden": !0,
3099
- children: /* @__PURE__ */ d("path", {
3100
- strokeLinecap: "round",
3101
- strokeLinejoin: "round",
3102
- strokeWidth: 2,
3103
- d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"
3104
- })
3105
- })
3106
- }) : null, t[21] = a, t[22] = g, t[23] = A) : A = t[23];
3107
- let j = `h-5 w-5 transform transition-transform ${C ? "rotate-180" : ""}`, M;
3108
- t[24] === Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ d("path", {
3109
- strokeLinecap: "round",
3110
- strokeLinejoin: "round",
3111
- strokeWidth: 2,
3112
- d: "M19 9l-7 7-7-7"
3113
- }), t[24] = M) : M = t[24];
3114
- let N;
3115
- t[25] === j ? N = t[26] : (N = /* @__PURE__ */ d("span", {
3116
- className: "text-white",
3117
- "aria-hidden": !0,
3118
- children: /* @__PURE__ */ d("svg", {
3119
- className: j,
3120
- fill: "none",
3121
- stroke: "currentColor",
3122
- viewBox: "0 0 24 24",
3123
- children: M
3124
- })
3125
- }), t[25] = j, t[26] = N);
3126
- let P;
3127
- t[27] !== N || t[28] !== A ? (P = /* @__PURE__ */ f("div", {
3128
- className: "flex items-center gap-2",
3129
- children: [A, N]
3130
- }), t[27] = N, t[28] = A, t[29] = P) : P = t[29];
3131
- let F;
3132
- t[30] !== C || t[31] !== P || t[32] !== k || t[33] !== T ? (F = /* @__PURE__ */ f("button", {
3133
- type: "button",
3134
- className: "flex w-full cursor-pointer items-center justify-between bg-primary p-4 text-left text-white",
3135
- onClick: T,
3136
- "aria-expanded": C,
3137
- children: [k, P]
3138
- }), t[30] = C, t[31] = P, t[32] = k, t[33] = T, t[34] = F) : F = t[34];
3139
- let I;
3140
- t[35] !== n || t[36] !== C || t[37] !== y ? (I = y ? /* @__PURE__ */ d("div", {
3141
- className: `bg-white p-4 ${C ? "" : "hidden"}`,
3142
- children: /* @__PURE__ */ d("div", {
3143
- className: "space-y-4",
3144
- children: n
3145
- })
3146
- }) : C ? /* @__PURE__ */ d("div", {
3147
- className: "bg-white p-4",
3148
- children: /* @__PURE__ */ d("div", {
3149
- className: "space-y-4",
3150
- children: n
3151
- })
3152
- }) : null, t[35] = n, t[36] = C, t[37] = y, t[38] = I) : I = t[38];
3153
- let L;
3154
- return t[39] !== l || t[40] !== F || t[41] !== I || t[42] !== O ? (L = /* @__PURE__ */ f("div", {
3155
- ...l,
3156
- className: O,
3157
- children: [F, I]
3158
- }), t[39] = l, t[40] = F, t[41] = I, t[42] = O, t[43] = L) : L = t[43], L;
3159
- }
3160
- //#endregion
3161
- //#region src/ui/Breadcrumbs.tsx
3162
- function pt(e) {
3163
- let t = (0, D.c)(3), { className: n } = e, r;
3164
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ d("path", {
3165
- strokeLinecap: "round",
3166
- strokeLinejoin: "round",
3167
- d: "M9 5l7 7-7 7"
3168
- }), t[0] = r) : r = t[0];
3169
- let i;
3170
- return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ d("svg", {
3171
- className: n,
3172
- viewBox: "0 0 24 24",
3173
- fill: "none",
3174
- stroke: "currentColor",
3175
- strokeWidth: 2,
3176
- "aria-hidden": !0,
3177
- children: r
3178
- }), t[1] = n, t[2] = i), i;
3179
- }
3180
- var mt = "max-w-[120px] cursor-pointer truncate text-secondary hover:underline sm:max-w-[180px] md:max-w-[240px]", ht = "max-w-[120px] truncate font-bold text-primary sm:max-w-[180px] md:max-w-[240px]", gt = "max-w-[120px] truncate text-secondary sm:max-w-[180px] md:max-w-[240px]";
3181
- function _t(e) {
3182
- let t = (0, D.c)(11), { items: n, className: r, separatorClassName: i } = e, a = r === void 0 ? "" : r, o = i === void 0 ? "ms-2 me-2 h-2 w-2 shrink-0 text-secondary sm:h-4 sm:w-4" : i, c = `breadcrum-text mt-10 flex flex-wrap items-center gap-x-1 gap-y-2 px-6 ${a}`, l;
3183
- t[0] === c ? l = t[1] : (l = c.trim(), t[0] = c, t[1] = l);
3184
- let p;
3185
- if (t[2] !== n || t[3] !== o) {
3186
- let e;
3187
- t[5] !== n.length || t[6] !== o ? (e = (e, t) => /* @__PURE__ */ d("span", {
3188
- className: "flex items-center justify-center",
3189
- children: t === n.length - 1 ? /* @__PURE__ */ d("span", {
3190
- className: ht,
3191
- children: e.label
3192
- }) : /* @__PURE__ */ f(u, { children: [e.to == null ? /* @__PURE__ */ d("span", {
3193
- className: gt,
3194
- children: e.label
3195
- }) : /* @__PURE__ */ d(s, {
3196
- to: e.to,
3197
- className: mt,
3198
- children: e.label
3199
- }), /* @__PURE__ */ d(pt, { className: o })] })
3200
- }, `${String(e.to ?? "item")}-${t}`), t[5] = n.length, t[6] = o, t[7] = e) : e = t[7], p = n.map(e), t[2] = n, t[3] = o, t[4] = p;
3201
- } else p = t[4];
3202
- let m;
3203
- return t[8] !== l || t[9] !== p ? (m = /* @__PURE__ */ d("nav", {
3204
- className: l,
3205
- "aria-label": "Breadcrumb",
3206
- children: p
3207
- }), t[8] = l, t[9] = p, t[10] = m) : m = t[10], m;
3208
- }
3209
- function vt(e) {
3210
- let t = (0, D.c)(11), { className: n, separatorClassName: r } = e, i = n === void 0 ? "" : n, a = r === void 0 ? "ms-2 me-2 h-2 w-2 shrink-0 text-secondary sm:h-4 sm:w-4" : r, o = c(), [s] = l(), u;
3211
- t[0] === s ? u = t[1] : (u = s.toString() ? `?${s.toString()}` : "", t[0] = s, t[1] = u);
3212
- let f = u, p;
3213
- if (t[2] !== o || t[3] !== f) {
3214
- let e;
3215
- t[5] === f ? e = t[6] : (e = (e) => ({
3216
- name: e.handle.crumb,
3217
- pathname: e.pathname,
3218
- search: f
3219
- }), t[5] = f, t[6] = e);
3220
- let n = o.filter(yt).map(e);
3221
- p = n.map((e, t) => ({
3222
- label: e.name,
3223
- to: t < n.length - 1 ? e.pathname + e.search : void 0
3224
- })), t[2] = o, t[3] = f, t[4] = p;
3225
- } else p = t[4];
3226
- let m = p;
3227
- if (m.length === 0) return null;
3228
- let h;
3229
- return t[7] !== i || t[8] !== m || t[9] !== a ? (h = /* @__PURE__ */ d(_t, {
3230
- items: m,
3231
- className: i,
3232
- separatorClassName: a
3233
- }), t[7] = i, t[8] = m, t[9] = a, t[10] = h) : h = t[10], h;
3234
- }
3235
- function yt(e) {
3236
- let t = e.handle;
3237
- return t != null && t.crumb != null && t.crumb !== "";
3238
- }
3239
- //#endregion
3240
- //#region src/ui/ProgressBar.tsx
3241
- function bt(e) {
3242
- let t = (0, D.c)(59), { progress: n, currentStep: i, totalSteps: a, height: s, bgColor: c, fillColor: l, animated: u, showPercentage: p, showMovingPercentage: m, showMovingIcon: h, showStepNumbers: g, icon: _, duration: v, label: y, progressLabel: b, iconClassName: x, className: S } = e, C = n === void 0 ? 0 : n, w = i === void 0 ? null : i, T = a === void 0 ? null : a, E = s === void 0 ? "h-2" : s, O = c === void 0 ? "bg-primary/50" : c, k = l === void 0 ? "bg-primary" : l, A = u === void 0 ? !0 : u, j = p === void 0 ? !0 : p, M = m === void 0 ? !0 : m, N = h === void 0 ? !0 : h, P = g === void 0 ? !1 : g, F = _ === void 0 ? null : _, I = v === void 0 ? 3e3 : v, L = y === void 0 ? "" : y, R = x === void 0 ? "" : x, z = S === void 0 ? "" : S, [B, V] = o(0), H = w != null && T != null && T > 0, U = H ? Math.min(w / T * 100, 100) : C, W, G;
3243
- t[0] !== A || t[1] !== U ? (W = () => {
3244
- if (!A) return;
3245
- let e = window.setTimeout(() => {
3246
- V(U);
3247
- }, 100);
3248
- return () => window.clearTimeout(e);
3249
- }, G = [U, A], t[0] = A, t[1] = U, t[2] = W, t[3] = G) : (W = t[2], G = t[3]), r(W, G);
3250
- let K = Math.min(Math.max(A ? B : U, 0), 100), q;
3251
- t[4] !== K || t[5] !== w || t[6] !== H || t[7] !== b || t[8] !== P || t[9] !== T ? (q = () => b ?? (H && P ? `${w}/${T}` : `${Math.round(K)}%`), t[4] = K, t[5] = w, t[6] = H, t[7] = b, t[8] = P, t[9] = T, t[10] = q) : q = t[10];
3252
- let J = q, ee = typeof F == "string" && H ? w : F, Y = !!L || j, X = `relative w-full space-y-2 ${z}`, Z;
3253
- t[11] === X ? Z = t[12] : (Z = X.trim(), t[11] = X, t[12] = Z);
3254
- let Q;
3255
- t[13] !== w || t[14] !== J || t[15] !== H || t[16] !== L || t[17] !== M || t[18] !== j || t[19] !== P || t[20] !== Y || t[21] !== T ? (Q = Y ? /* @__PURE__ */ f("div", {
3256
- className: "flex items-center justify-between text-sm text-gray-700",
3257
- children: [
3258
- L ? /* @__PURE__ */ d("span", {
3259
- className: "font-medium",
3260
- children: L
3261
- }) : null,
3262
- j && !M ? /* @__PURE__ */ d("span", {
3263
- className: "font-medium",
3264
- children: J()
3265
- }) : null,
3266
- H && P && !M ? /* @__PURE__ */ f("span", {
3267
- className: "font-medium",
3268
- children: [
3269
- "Step ",
3270
- w,
3271
- " of ",
3272
- T
3273
- ]
3274
- }) : null
3275
- ]
3276
- }) : null, t[13] = w, t[14] = J, t[15] = H, t[16] = L, t[17] = M, t[18] = j, t[19] = P, t[20] = Y, t[21] = T, t[22] = Q) : Q = t[22];
3277
- let te;
3278
- t[23] !== A || t[24] !== K || t[25] !== I || t[26] !== F || t[27] !== R || t[28] !== ee || t[29] !== N ? (te = N && F != null ? /* @__PURE__ */ d("div", {
3279
- className: "relative h-2 sm:h-8",
3280
- children: /* @__PURE__ */ d("div", {
3281
- className: `absolute top-0 -translate-x-1/2 transform transition-all ease-out ${R}`.trim(),
3282
- style: {
3283
- left: `${K}%`,
3284
- transitionDuration: A ? `${I}ms` : "0ms"
3285
- },
3286
- children: /* @__PURE__ */ d("div", {
3287
- className: "text-lg",
3288
- children: ee
3289
- })
3290
- })
3291
- }) : null, t[23] = A, t[24] = K, t[25] = I, t[26] = F, t[27] = R, t[28] = ee, t[29] = N, t[30] = te) : te = t[30];
3292
- let $ = `relative w-full overflow-hidden ${O} mt-[14px] sm:mt-0 ${E}`, ne;
3293
- t[31] === $ ? ne = t[32] : (ne = $.trim(), t[31] = $, t[32] = ne);
3294
- let re = `relative overflow-hidden ${E} ${k} transition-all ease-out`, ie = `${K}%`, ae = A ? `${I}ms` : "0ms", oe;
3295
- t[33] !== ie || t[34] !== ae ? (oe = {
3296
- width: ie,
3297
- transitionDuration: ae
3298
- }, t[33] = ie, t[34] = ae, t[35] = oe) : oe = t[35];
3299
- let se;
3300
- t[36] === Symbol.for("react.memo_cache_sentinel") ? (se = /* @__PURE__ */ d("div", { className: "pointer-events-none absolute inset-0 -skew-x-12 animate-shimmer bg-gradient-to-r from-transparent via-white/20 to-transparent" }), t[36] = se) : se = t[36];
3301
- let ce;
3302
- t[37] !== re || t[38] !== oe ? (ce = /* @__PURE__ */ d("div", {
3303
- className: re,
3304
- style: oe,
3305
- children: se
3306
- }), t[37] = re, t[38] = oe, t[39] = ce) : ce = t[39];
3307
- let le;
3308
- t[40] !== ne || t[41] !== ce ? (le = /* @__PURE__ */ d("div", {
3309
- className: ne,
3310
- children: ce
3311
- }), t[40] = ne, t[41] = ce, t[42] = le) : le = t[42];
3312
- let ue;
3313
- t[43] !== A || t[44] !== K || t[45] !== w || t[46] !== I || t[47] !== J || t[48] !== H || t[49] !== M || t[50] !== P || t[51] !== T ? (ue = M ? /* @__PURE__ */ d("div", {
3314
- className: "relative -mt-[8px] h-2 sm:h-8",
3315
- children: /* @__PURE__ */ d("div", {
3316
- className: "absolute top-0 -translate-x-1/2 transform transition-all ease-out",
3317
- style: {
3318
- left: `${K}%`,
3319
- transitionDuration: A ? `${I}ms` : "0ms"
3320
- },
3321
- children: /* @__PURE__ */ d("span", {
3322
- className: "text-lg font-bold text-primary/75",
3323
- children: H && P ? `${w}/${T}` : J()
3324
- })
3325
- })
3326
- }) : null, t[43] = A, t[44] = K, t[45] = w, t[46] = I, t[47] = J, t[48] = H, t[49] = M, t[50] = P, t[51] = T, t[52] = ue) : ue = t[52];
3327
- let de;
3328
- return t[53] !== Z || t[54] !== Q || t[55] !== te || t[56] !== le || t[57] !== ue ? (de = /* @__PURE__ */ f("div", {
3329
- className: Z,
3330
- children: [
3331
- Q,
3332
- te,
3333
- le,
3334
- ue
3335
- ]
3336
- }), t[53] = Z, t[54] = Q, t[55] = te, t[56] = le, t[57] = ue, t[58] = de) : de = t[58], de;
3337
- }
3338
- function xt(e) {
3339
- let t = (0, D.c)(40), { sqSize: n, strokeWidth: r, percentage: i, textClassName: a, className: o, trackClassName: s, progressClassName: c } = e, l = n === void 0 ? 60 : n, u = r === void 0 ? 5 : r, p = i === void 0 ? 0 : i, m = a === void 0 ? "" : a, h = o === void 0 ? "" : o, g = s === void 0 ? "text-primary/25" : s, _ = c === void 0 ? "text-primary" : c, v = (l - u) / 2, y = 2 * Math.PI * v, b = y - y * p / 100, x = Math.min(Math.max(p, 0), 100), S = `relative ${h}`, C;
3340
- t[0] === S ? C = t[1] : (C = S.trim(), t[0] = S, t[1] = C);
3341
- let w;
3342
- t[2] === l ? w = t[3] : (w = {
3343
- width: l,
3344
- height: l
3345
- }, t[2] = l, t[3] = w);
3346
- let T;
3347
- t[4] === x ? T = t[5] : (T = Math.round(x), t[4] = x, t[5] = T);
3348
- let E = `0 0 ${l} ${l}`, O = l / 2, k = l / 2, A;
3349
- t[6] !== v || t[7] !== u || t[8] !== O || t[9] !== k || t[10] !== g ? (A = /* @__PURE__ */ d("circle", {
3350
- className: g,
3351
- strokeWidth: u,
3352
- stroke: "currentColor",
3353
- fill: "transparent",
3354
- r: v,
3355
- cx: O,
3356
- cy: k
3357
- }), t[6] = v, t[7] = u, t[8] = O, t[9] = k, t[10] = g, t[11] = A) : A = t[11];
3358
- let j = `transition-all duration-500 ease-in-out ${_}`, M;
3359
- t[12] === j ? M = t[13] : (M = j.trim(), t[12] = j, t[13] = M);
3360
- let N = l / 2, P = l / 2, F;
3361
- t[14] !== y || t[15] !== v || t[16] !== b || t[17] !== u || t[18] !== M || t[19] !== N || t[20] !== P ? (F = /* @__PURE__ */ d("circle", {
3362
- className: M,
3363
- strokeWidth: u,
3364
- strokeLinecap: "round",
3365
- stroke: "currentColor",
3366
- fill: "transparent",
3367
- r: v,
3368
- cx: N,
3369
- cy: P,
3370
- strokeDasharray: y,
3371
- strokeDashoffset: b
3372
- }), t[14] = y, t[15] = v, t[16] = b, t[17] = u, t[18] = M, t[19] = N, t[20] = P, t[21] = F) : F = t[21];
3373
- let I;
3374
- t[22] !== l || t[23] !== E || t[24] !== A || t[25] !== F ? (I = /* @__PURE__ */ f("svg", {
3375
- className: "-rotate-90 transform",
3376
- width: l,
3377
- height: l,
3378
- viewBox: E,
3379
- "aria-hidden": !0,
3380
- children: [A, F]
3381
- }), t[22] = l, t[23] = E, t[24] = A, t[25] = F, t[26] = I) : I = t[26];
3382
- let L = `absolute inset-0 flex flex-col items-center justify-center text-sm font-semibold text-secondary ${m}`, R;
3383
- t[27] === L ? R = t[28] : (R = L.trim(), t[27] = L, t[28] = R);
3384
- let z;
3385
- t[29] === x ? z = t[30] : (z = Math.round(x), t[29] = x, t[30] = z);
3386
- let B;
3387
- t[31] !== R || t[32] !== z ? (B = /* @__PURE__ */ f("span", {
3388
- className: R,
3389
- children: [z, "%"]
3390
- }), t[31] = R, t[32] = z, t[33] = B) : B = t[33];
3391
- let V;
3392
- return t[34] !== w || t[35] !== T || t[36] !== I || t[37] !== B || t[38] !== C ? (V = /* @__PURE__ */ f("div", {
3393
- className: C,
3394
- style: w,
3395
- role: "progressbar",
3396
- "aria-valuenow": T,
3397
- "aria-valuemin": 0,
3398
- "aria-valuemax": 100,
3399
- children: [I, B]
3400
- }), t[34] = w, t[35] = T, t[36] = I, t[37] = B, t[38] = C, t[39] = V) : V = t[39], V;
3401
- }
3402
- //#endregion
3403
- //#region src/ui/ImagePreviewModal.tsx
3404
- function St(e) {
3405
- let t = (0, D.c)(3), { className: n } = e, r;
3406
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ d("path", { d: "M18 6L6 18M6 6l12 12" }), t[0] = r) : r = t[0];
3407
- let i;
3408
- return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ d("svg", {
3409
- xmlns: "http://www.w3.org/2000/svg",
3410
- viewBox: "0 0 24 24",
3411
- fill: "none",
3412
- stroke: "currentColor",
3413
- strokeWidth: 2,
3414
- className: n,
3415
- "aria-hidden": !0,
3416
- children: r
3417
- }), t[1] = n, t[2] = i), i;
3418
- }
3419
- function Ct(e) {
3420
- let t = (0, D.c)(2), { dir: n } = e, r;
3421
- return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ d("svg", {
3422
- xmlns: "http://www.w3.org/2000/svg",
3423
- viewBox: "0 0 24 24",
3424
- className: "h-4 w-4 fill-primary",
3425
- "aria-hidden": !0,
3426
- children: n === "left" ? /* @__PURE__ */ d("path", { d: "M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z" }) : /* @__PURE__ */ d("path", { d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" })
3427
- }), t[0] = n, t[1] = r), r;
3428
- }
3429
- function wt(e) {
3430
- return ["relative !max-w-[min(96vw,1200px)] w-full overflow-hidden p-0", e].filter(Boolean).join(" ");
3431
- }
3432
- function Tt(e) {
3433
- let t = (0, D.c)(19), { images: n, initialIndex: i, imageUrl: a, placeholderUrl: s, className: c, alt: l, onClose: p } = e, m = i === void 0 ? 0 : i, h = Math.max(0, n.length - 1), [g, _] = o(Math.min(Math.max(0, m), h)), v, y;
3434
- t[0] === n.length ? (v = t[1], y = t[2]) : (v = () => {
3435
- if (n.length <= 1) return;
3436
- let e = (e) => {
3437
- e.key === "ArrowLeft" && (e.preventDefault(), _((e) => (e - 1 + n.length) % n.length)), e.key === "ArrowRight" && (e.preventDefault(), _((e) => (e + 1) % n.length));
3438
- };
3439
- return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
3440
- }, y = [n.length], t[0] = n.length, t[1] = v, t[2] = y), r(v, y);
3441
- let b = n.length > 1, x = n[g] ?? a ?? s ?? "", S;
3442
- t[3] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ d(St, { className: "h-5 w-5" }), t[3] = S) : S = t[3];
3443
- let C;
3444
- t[4] === p ? C = t[5] : (C = /* @__PURE__ */ d("button", {
3445
- type: "button",
3446
- onClick: p,
3447
- className: "absolute top-3 right-3 z-10 cursor-pointer text-gray-400 transition-colors hover:text-gray-500 sm:top-5 sm:right-5",
3448
- "aria-label": "Close",
3449
- children: S
3450
- }), t[4] = p, t[5] = C);
3451
- let w;
3452
- t[6] !== l || t[7] !== c || t[8] !== x ? (w = x ? /* @__PURE__ */ d("img", {
3453
- src: x,
3454
- className: `block max-h-[68vh] w-auto max-w-full rounded-lg object-contain ${c}`.trim(),
3455
- alt: l
3456
- }) : /* @__PURE__ */ d("div", {
3457
- className: "flex min-h-[40vh] items-center justify-center px-4 text-center paragraph-text text-secondary",
3458
- children: "No image URL provided."
3459
- }), t[6] = l, t[7] = c, t[8] = x, t[9] = w) : w = t[9];
3460
- let T;
3461
- t[10] !== b || t[11] !== n.length ? (T = b ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("button", {
3462
- type: "button",
3463
- className: "absolute left-2 flex h-9 w-9 items-center justify-center rounded-md border border-primary/50 bg-white/90 sm:left-4",
3464
- onClick: () => _((e) => (e - 1 + n.length) % n.length),
3465
- "aria-label": "Previous image",
3466
- children: /* @__PURE__ */ d(Ct, { dir: "left" })
3467
- }), /* @__PURE__ */ d("button", {
3468
- type: "button",
3469
- className: "absolute right-2 flex h-9 w-9 items-center justify-center rounded-md border border-primary/50 bg-white/90 sm:right-4",
3470
- onClick: () => _((e) => (e + 1) % n.length),
3471
- "aria-label": "Next image",
3472
- children: /* @__PURE__ */ d(Ct, { dir: "right" })
3473
- })] }) : null, t[10] = b, t[11] = n.length, t[12] = T) : T = t[12];
3474
- let E;
3475
- t[13] !== w || t[14] !== T ? (E = /* @__PURE__ */ f("div", {
3476
- className: "relative flex items-center justify-center px-10 py-8 sm:px-14 sm:py-10",
3477
- children: [w, T]
3478
- }), t[13] = w, t[14] = T, t[15] = E) : E = t[15];
3479
- let O;
3480
- return t[16] !== C || t[17] !== E ? (O = /* @__PURE__ */ f(u, { children: [C, E] }), t[16] = C, t[17] = E, t[18] = O) : O = t[18], O;
3481
- }
3482
- function Et(e) {
3483
- let t = (0, D.c)(25), { isOpen: n, onClose: r, imageUrl: i, imageUrls: a, initialIndex: o, className: s, modalClassName: c, alt: l, placeholderUrl: u } = e, f;
3484
- t[0] === a ? f = t[1] : (f = a === void 0 ? [] : a, t[0] = a, t[1] = f);
3485
- let p = f, m = o === void 0 ? 0 : o, h = s === void 0 ? "" : s, g = c === void 0 ? "" : c, _ = l === void 0 ? "Preview" : l, v;
3486
- bb0: {
3487
- if (Array.isArray(p) && p.length > 0) {
3488
- let e;
3489
- t[2] === p ? e = t[3] : (e = p.filter(Boolean), t[2] = p, t[3] = e), v = e;
3490
- break bb0;
3491
- }
3492
- let e;
3493
- t[4] === i ? e = t[5] : (e = i ? [i] : [], t[4] = i, t[5] = e), v = e;
3494
- }
3495
- let y = v, b;
3496
- t[6] === y ? b = t[7] : (b = y.join(""), t[6] = y, t[7] = b);
3497
- let x = `${b}::${m}`, S;
3498
- t[8] === g ? S = t[9] : (S = wt(g), t[8] = g, t[9] = S);
3499
- let C;
3500
- t[10] !== _ || t[11] !== h || t[12] !== i || t[13] !== y || t[14] !== m || t[15] !== n || t[16] !== r || t[17] !== x || t[18] !== u ? (C = n ? /* @__PURE__ */ d(Tt, {
3501
- images: y,
3502
- initialIndex: m,
3503
- imageUrl: i,
3504
- placeholderUrl: u,
3505
- className: h,
3506
- alt: _,
3507
- onClose: r
3508
- }, x) : null, t[10] = _, t[11] = h, t[12] = i, t[13] = y, t[14] = m, t[15] = n, t[16] = r, t[17] = x, t[18] = u, t[19] = C) : C = t[19];
3509
- let w;
3510
- return t[20] !== n || t[21] !== r || t[22] !== C || t[23] !== S ? (w = /* @__PURE__ */ d(Xe, {
3511
- isOpen: n,
3512
- onClose: r,
3513
- className: S,
3514
- children: C
3515
- }), t[20] = n, t[21] = r, t[22] = C, t[23] = S, t[24] = w) : w = t[24], w;
3516
- }
3517
- //#endregion
3518
- //#region src/ui/List.tsx
3519
- var Dt = "text-secondary paragraph-text leading-relaxed whitespace-pre-line", Ot = "list-disc pl-5 text-secondary paragraph-text leading-relaxed space-y-2", kt = "text-secondary paragraph-text leading-relaxed space-y-2", At = `${Dt}`, jt = "text-base sm:text-lg md:text-xl font-bold text-secondary w-full text-left block";
3520
- function Mt(e) {
3521
- let t = (0, D.c)(29), { content: n, variant: r, headerSubtitle: i, className: a, listClassName: o, listItemClassName: s, blocksWrapperClassName: c, blockClassName: l, paragraphClassName: u, headerSubtitleClassName: p } = e, m = r === void 0 ? "bullets" : r, h = a === void 0 ? "" : a, g = o === void 0 ? "" : o, _ = s === void 0 ? "" : s, v = c === void 0 ? "" : c, y = l === void 0 ? "" : l, b = u === void 0 ? "" : u, x = p === void 0 ? "" : p;
3522
- if (Array.isArray(n)) {
3523
- if (n.length === 0) return null;
3524
- if (m === "bullets") {
3525
- let e = `${Ot} ${g} ${h}`, r;
3526
- t[0] === e ? r = t[1] : (r = e.trim(), t[0] = e, t[1] = r);
3527
- let i;
3528
- if (t[2] !== n || t[3] !== _) {
3529
- let e;
3530
- t[5] === _ ? e = t[6] : (e = (e, t) => /* @__PURE__ */ d("li", {
3531
- className: _.trim() || void 0,
3532
- children: e
3533
- }, t), t[5] = _, t[6] = e), i = n.map(e), t[2] = n, t[3] = _, t[4] = i;
3534
- } else i = t[4];
3535
- let a;
3536
- return t[7] !== r || t[8] !== i ? (a = /* @__PURE__ */ d("ul", {
3537
- className: r,
3538
- children: i
3539
- }), t[7] = r, t[8] = i, t[9] = a) : a = t[9], a;
3540
- }
3541
- let e = `${kt} ${v} ${h}`, r;
3542
- t[10] === e ? r = t[11] : (r = e.trim(), t[10] = e, t[11] = r);
3543
- let a;
3544
- t[12] !== i || t[13] !== x ? (a = i ? /* @__PURE__ */ d("span", {
3545
- className: `${jt} ${x}`.trim(),
3546
- children: i
3547
- }) : null, t[12] = i, t[13] = x, t[14] = a) : a = t[14];
3548
- let o;
3549
- if (t[15] !== y || t[16] !== n) {
3550
- let e;
3551
- t[18] === y ? e = t[19] : (e = (e, t) => /* @__PURE__ */ d("p", {
3552
- className: `${At} ${y}`.trim(),
3553
- children: e
3554
- }, t), t[18] = y, t[19] = e), o = n.map(e), t[15] = y, t[16] = n, t[17] = o;
3555
- } else o = t[17];
3556
- let s;
3557
- return t[20] !== r || t[21] !== a || t[22] !== o ? (s = /* @__PURE__ */ f("div", {
3558
- className: r,
3559
- children: [a, o]
3560
- }), t[20] = r, t[21] = a, t[22] = o, t[23] = s) : s = t[23], s;
3561
- }
3562
- let S = `${Dt} ${b} ${h}`, C;
3563
- t[24] === S ? C = t[25] : (C = S.trim(), t[24] = S, t[25] = C);
3564
- let w;
3565
- return t[26] !== n || t[27] !== C ? (w = /* @__PURE__ */ d("p", {
3566
- className: C,
3567
- children: n
3568
- }), t[26] = n, t[27] = C, t[28] = w) : w = t[28], w;
3569
- }
3570
- //#endregion
3571
- //#region src/ui/Tabs.tsx
3572
- function Nt(e, t) {
3573
- return e ? /* @__PURE__ */ d(e, { className: t }) : null;
3574
- }
3575
- function Pt(e) {
3576
- let t = (0, D.c)(30), { items: n, activeId: r, onActiveIdChange: i, className: a, desktopNavClassName: o, mobileScrollClassName: s } = e, c = a === void 0 ? "" : a, l = o === void 0 ? "" : o, u = s === void 0 ? "" : s;
3577
- if (!n.length) return null;
3578
- let p;
3579
- t[0] === c ? p = t[1] : (p = c.trim() || void 0, t[0] = c, t[1] = p);
3580
- let m = `hidden lg:block space-y-1 ${l}`, h;
3581
- t[2] === m ? h = t[3] : (h = m.trim(), t[2] = m, t[3] = h);
3582
- let g;
3583
- if (t[4] !== r || t[5] !== n || t[6] !== i) {
3584
- let e;
3585
- t[8] !== r || t[9] !== i ? (e = (e) => {
3586
- let t = e.id === r;
3587
- return /* @__PURE__ */ f("button", {
3588
- type: "button",
3589
- role: "tab",
3590
- "aria-selected": t,
3591
- onClick: () => i(e.id),
3592
- className: "flex w-full cursor-pointer items-center gap-3 py-3 title-text",
3593
- children: [Nt(e.icon, "h-6 w-6 shrink-0 fill-primary text-primary"), /* @__PURE__ */ d("span", {
3594
- className: t ? "font-bold text-secondary" : "font-semibold text-secondary/80",
3595
- children: e.label
3596
- })]
3597
- }, e.id);
3598
- }, t[8] = r, t[9] = i, t[10] = e) : e = t[10], g = n.map(e), t[4] = r, t[5] = n, t[6] = i, t[7] = g;
3599
- } else g = t[7];
3600
- let _;
3601
- t[11] !== h || t[12] !== g ? (_ = /* @__PURE__ */ d("nav", {
3602
- className: h,
3603
- role: "tablist",
3604
- "aria-orientation": "vertical",
3605
- children: g
3606
- }), t[11] = h, t[12] = g, t[13] = _) : _ = t[13];
3607
- let v = `flex gap-2 overflow-x-auto pb-2 no-scrollbar lg:hidden ${u}`, y;
3608
- t[14] === v ? y = t[15] : (y = v.trim(), t[14] = v, t[15] = y);
3609
- let b;
3610
- if (t[16] !== r || t[17] !== n || t[18] !== i) {
3611
- let e;
3612
- t[20] !== r || t[21] !== i ? (e = (e) => {
3613
- let t = e.id === r;
3614
- return /* @__PURE__ */ f("button", {
3615
- type: "button",
3616
- role: "tab",
3617
- "aria-selected": t,
3618
- onClick: () => i(e.id),
3619
- className: `title-text flex shrink-0 items-center gap-1 rounded-lg px-3 py-2 whitespace-nowrap ${t ? "bg-primary text-white" : "border border-primary text-secondary"}`.trim(),
3620
- children: [Nt(e.icon, t ? "h-4 w-4 shrink-0 fill-white text-white" : "h-4 w-4 shrink-0 fill-primary text-primary"), e.label]
3621
- }, e.id);
3622
- }, t[20] = r, t[21] = i, t[22] = e) : e = t[22], b = n.map(e), t[16] = r, t[17] = n, t[18] = i, t[19] = b;
3623
- } else b = t[19];
3624
- let x;
3625
- t[23] !== y || t[24] !== b ? (x = /* @__PURE__ */ d("div", {
3626
- className: y,
3627
- role: "tablist",
3628
- "aria-orientation": "horizontal",
3629
- children: b
3630
- }), t[23] = y, t[24] = b, t[25] = x) : x = t[25];
3631
- let S;
3632
- return t[26] !== x || t[27] !== p || t[28] !== _ ? (S = /* @__PURE__ */ f("div", {
3633
- className: p,
3634
- children: [_, x]
3635
- }), t[26] = x, t[27] = p, t[28] = _, t[29] = S) : S = t[29], S;
3636
- }
3637
- //#endregion
3638
- //#region src/ui/GoogleMap.tsx
3639
- var Ft = m;
3640
- function It(e) {
3641
- let t = (0, D.c)(12), n, r, i;
3642
- t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({className: i, style: r, ...n} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i);
3643
- let a = i === void 0 ? "" : i, o;
3644
- t[4] === a ? o = t[5] : (o = ["w-full min-h-[280px]", a].filter(Boolean), t[4] = a, t[5] = o);
3645
- let s = o.join(" "), c;
3646
- t[6] === r ? c = t[7] : (c = {
3647
- width: "100%",
3648
- height: "100%",
3649
- minHeight: 280,
3650
- ...r
3651
- }, t[6] = r, t[7] = c);
3652
- let l;
3653
- return t[8] !== n || t[9] !== s || t[10] !== c ? (l = /* @__PURE__ */ d(h, {
3654
- ...n,
3655
- className: s,
3656
- style: c
3657
- }), t[8] = n, t[9] = s, t[10] = c, t[11] = l) : l = t[11], l;
3658
- }
3659
- //#endregion
3660
- //#region src/ui/Tooltip.tsx
3661
- var Lt = "!w-fit !text-xs text-black rounded-primary shadow-primary font-normal whitespace-break-spaces text-left", Rt = {
3662
- backgroundColor: "rgb(255, 255, 255)",
3663
- color: "#1b1b33",
3664
- borderRadius: "8px",
3665
- boxShadow: "0 2px 8px rgba(0, 0, 0, 0.1)"
3666
- }, zt = t(function(e, t) {
3667
- let n = (0, D.c)(13), r, i, a;
3668
- n[0] === e ? (r = n[1], i = n[2], a = n[3]) : ({className: r, style: a, ...i} = e, n[0] = e, n[1] = r, n[2] = i, n[3] = a);
3669
- let o;
3670
- n[4] === r ? o = n[5] : (o = [Lt, r].filter(Boolean), n[4] = r, n[5] = o);
3671
- let s = o.join(" "), c;
3672
- n[6] === a ? c = n[7] : (c = {
3673
- ...Rt,
3674
- ...a
3675
- }, n[6] = a, n[7] = c);
3676
- let l;
3677
- return n[8] !== t || n[9] !== i || n[10] !== s || n[11] !== c ? (l = /* @__PURE__ */ d(g, {
3678
- ref: t,
3679
- ...i,
3680
- className: s,
3681
- style: c
3682
- }), n[8] = t, n[9] = i, n[10] = s, n[11] = c, n[12] = l) : l = n[12], l;
3683
- });
3684
- //#endregion
3685
- //#region src/ui/SearchBar.tsx
3686
- function Bt(e) {
3687
- let t = (0, D.c)(3), { className: n } = e, r;
3688
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ d("path", { d: "M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" }), t[0] = r) : r = t[0];
3689
- let i;
3690
- return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ d("svg", {
3691
- className: n,
3692
- viewBox: "0 0 24 24",
3693
- "aria-hidden": !0,
3694
- fill: "currentColor",
3695
- children: r
3696
- }), t[1] = n, t[2] = i), i;
3697
- }
3698
- function Vt(e) {
3699
- let t = (0, D.c)(3), { className: n } = e, r;
3700
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ d("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 0 1 0-5 2.5 2.5 0 0 1 0 5z" }), t[0] = r) : r = t[0];
3701
- let i;
3702
- return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ d("svg", {
3703
- className: n,
3704
- viewBox: "0 0 24 24",
3705
- "aria-hidden": !0,
3706
- fill: "currentColor",
3707
- children: r
3708
- }), t[1] = n, t[2] = i), i;
3709
- }
3710
- function Ht(e) {
3711
- let t = (0, D.c)(3), { className: n } = e, r;
3712
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ d("path", { d: "M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z" }), t[0] = r) : r = t[0];
3713
- let i;
3714
- return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ d("svg", {
3715
- className: n,
3716
- viewBox: "0 0 24 24",
3717
- "aria-hidden": !0,
3718
- fill: "currentColor",
3719
- children: r
3720
- }), t[1] = n, t[2] = i), i;
3721
- }
3722
- function Ut(e) {
3723
- let t = (0, D.c)(3), { className: n } = e, r;
3724
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ d("path", { d: "M18 6L6 18M6 6l12 12" }), t[0] = r) : r = t[0];
3725
- let i;
3726
- return t[1] === n ? i = t[2] : (i = /* @__PURE__ */ d("svg", {
3727
- xmlns: "http://www.w3.org/2000/svg",
3728
- viewBox: "0 0 24 24",
3729
- fill: "none",
3730
- stroke: "currentColor",
3731
- strokeWidth: 2,
3732
- className: n,
3733
- "aria-hidden": !0,
3734
- children: r
3735
- }), t[1] = n, t[2] = i), i;
3736
- }
3737
- function Wt() {
3738
- return (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
3739
- }
3740
- function Gt(e, t) {
3741
- let n = /* @__PURE__ */ new Date(e + "T12:00:00");
3742
- return n.setDate(n.getDate() + t), n.toISOString().slice(0, 10);
3743
- }
3744
- function Kt({ destination: e, placeId: t, onDestinationChange: s, onPlaceIdChange: c, fetchSuggestions: l, fetchDebounceMs: u = 750, autoCompleteLoading: p, autoCompleteResults: m, variant: h = "default", placeholder: g = "Search destination", whereLabel: _ = "Where", noResultsText: v = "No results", className: y = "" }) {
3745
- let b = a(null), [x, S] = o(!1), [C, w] = o(-1), [T, E] = o(!1), [D, O] = o([]), k = !!l, A = i(() => k ? T : p ?? !1, [
3746
- k,
3747
- T,
3748
- p
3749
- ]), j = i(() => k ? D : m ?? [], [
3750
- k,
3751
- D,
3752
- m
3753
- ]);
3754
- r(() => {
3755
- if (!k || !l) return;
3756
- if (!e.trim() || t) {
3757
- O([]);
3758
- return;
3759
- }
3760
- let n = !1;
3761
- E(!0);
3762
- let r = window.setTimeout(async () => {
3763
- try {
3764
- let t = await l(e.trim());
3765
- n || O(t ?? []);
3766
- } catch {
3767
- n || O([]);
3768
- } finally {
3769
- n || E(!1);
3770
- }
3771
- }, u);
3772
- return () => {
3773
- n = !0, window.clearTimeout(r);
3774
- };
3775
- }, [
3776
- e,
3777
- t,
3778
- l,
3779
- u,
3780
- k
3781
- ]);
3782
- let M = n((e) => {
3783
- s(e.description), c(e.place_id), S(!1), w(-1);
3784
- }, [s, c]), N = n((e) => {
3785
- b.current && !b.current.contains(e.target) && (S(!1), w(-1));
3786
- }, []), P = n((e) => {
3787
- e.key === "Escape" ? (S(!1), w(-1)) : x && j.length > 0 && (e.key === "ArrowDown" ? (e.preventDefault(), w((e) => e < j.length - 1 ? e + 1 : 0)) : e.key === "ArrowUp" ? (e.preventDefault(), w((e) => e > 0 ? e - 1 : j.length - 1)) : e.key === "Enter" && C !== -1 && (e.preventDefault(), M(j[C])));
3788
- }, [
3789
- x,
3790
- j,
3791
- C,
3792
- M
3793
- ]);
3794
- r(() => (document.addEventListener("mousedown", N), document.addEventListener("keydown", P), () => {
3795
- document.removeEventListener("mousedown", N), document.removeEventListener("keydown", P);
3796
- }), [N, P]), r(() => {
3797
- w(-1);
3798
- }, [x, j]);
3799
- let F = x && e.trim() && !t && e.trim().length > 0 ? /* @__PURE__ */ d("div", {
3800
- className: "absolute top-full left-0 z-[100] mt-2 max-h-60 w-full divide-y divide-primary/50 overflow-y-auto rounded bg-white shadow-[0px_1px_12px_0px_rgba(0,_0,_0,_0.15)] md:min-w-[300px]",
3801
- children: A ? /* @__PURE__ */ d("div", {
3802
- className: "flex w-full items-center justify-center p-3",
3803
- children: /* @__PURE__ */ d(Ke, {})
3804
- }) : j.length > 0 ? j.map((e, t) => /* @__PURE__ */ d("button", {
3805
- type: "button",
3806
- className: `m-1 w-[calc(100%-8px)] cursor-pointer rounded p-2 text-left text-sm ${t === C ? "bg-primary/75 text-white" : "hover:bg-primary/75 hover:text-white"}`,
3807
- onClick: () => M(e),
3808
- children: e.description
3809
- }, e.place_id || t)) : /* @__PURE__ */ d("div", {
3810
- className: "p-3 text-sm text-gray-500",
3811
- children: v
3812
- })
3813
- }) : null;
3814
- return h === "horizontal" ? /* @__PURE__ */ f("div", {
3815
- className: `relative w-full sm:w-full md:w-1/5 ${y}`.trim(),
3816
- ref: b,
3817
- children: [/* @__PURE__ */ d("div", {
3818
- className: "flex h-full w-full flex-col justify-center pb-3 sm:border-r sm:border-dashed sm:border-primary/50 sm:pr-3 md:pb-0",
3819
- children: /* @__PURE__ */ d("div", {
3820
- className: "flex w-full flex-col items-center gap-2 p-2",
3821
- children: /* @__PURE__ */ f("div", {
3822
- className: "flex w-full items-start gap-2",
3823
- children: [/* @__PURE__ */ d(Vt, { className: "mt-0.5 h-4 w-4 shrink-0 fill-primary" }), /* @__PURE__ */ f("div", {
3824
- className: "min-w-0 flex-1",
3825
- children: [/* @__PURE__ */ d("label", {
3826
- className: "block text-base font-bold text-primary",
3827
- children: _
3828
- }), /* @__PURE__ */ f("div", {
3829
- className: "relative mt-2 flex w-full",
3830
- children: [/* @__PURE__ */ d("input", {
3831
- type: "text",
3832
- placeholder: g,
3833
- className: "w-full border-none bg-transparent text-sm font-bold text-secondary outline-none placeholder:text-secondary/50",
3834
- value: e,
3835
- onChange: (e) => {
3836
- s(e.target.value), c(""), S(!!e.target.value.trim()), w(-1);
3837
- },
3838
- onFocus: () => {
3839
- e?.trim() && S(!0);
3840
- }
3841
- }), e ? /* @__PURE__ */ d("button", {
3842
- type: "button",
3843
- className: "absolute top-0 right-0 -mt-1 text-gray-400 transition-colors hover:text-gray-500",
3844
- onClick: () => {
3845
- s(""), c(""), w(-1);
3846
- },
3847
- "aria-label": "Clear",
3848
- children: /* @__PURE__ */ d(Ut, { className: "h-5 w-5" })
3849
- }) : null]
3850
- })]
3851
- })]
3852
- })
3853
- })
3854
- }), F]
3855
- }) : /* @__PURE__ */ f("div", {
3856
- className: `relative ${y}`.trim(),
3857
- ref: b,
3858
- children: [
3859
- /* @__PURE__ */ d(Bt, { className: "absolute top-3 left-2 h-4 w-4 fill-primary" }),
3860
- /* @__PURE__ */ d("input", {
3861
- type: "text",
3862
- placeholder: g,
3863
- className: "w-full rounded-[5px] border border-primary/50 bg-white py-2 pr-4 pl-8 text-base font-bold text-secondary placeholder:text-primary focus-visible:outline-0",
3864
- value: e,
3865
- onChange: (e) => {
3866
- s(e.target.value), c(""), S(!!e.target.value.trim()), w(-1);
3867
- },
3868
- onFocus: () => {
3869
- e.trim() && S(!0);
3870
- }
3871
- }),
3872
- F
3873
- ]
3874
- });
3875
- }
3876
- function qt(e) {
3877
- let t = (0, D.c)(45), { value: n, onChange: r, label: i, minAdults: a, maxAdults: o, maxChildren: s, className: c, adultsLabel: l, childrenLabel: u } = e, p = i === void 0 ? "Guests" : i, m = a === void 0 ? 1 : a, h = o === void 0 ? 16 : o, g = s === void 0 ? 16 : s, _ = c === void 0 ? "" : c, v = l === void 0 ? "Adults" : l, y = u === void 0 ? "Children" : u, b;
3878
- t[0] !== h || t[1] !== g || t[2] !== m || t[3] !== r || t[4] !== n ? (b = (e, t) => {
3879
- let i = {
3880
- ...n,
3881
- [e]: n[e] + t
3882
- };
3883
- e === "adults" ? i.adults = Math.min(h, Math.max(m, i.adults)) : i.children = Math.min(g, Math.max(0, i.children)), r(i);
3884
- }, t[0] = h, t[1] = g, t[2] = m, t[3] = r, t[4] = n, t[5] = b) : b = t[5];
3885
- let x = b, S = `flex flex-col gap-3 rounded-[5px] border border-primary/50 bg-white p-3 ${_}`, C;
3886
- t[6] === S ? C = t[7] : (C = S.trim(), t[6] = S, t[7] = C);
3887
- let w;
3888
- t[8] === p ? w = t[9] : (w = p ? /* @__PURE__ */ d("span", {
3889
- className: "text-base font-bold text-primary",
3890
- children: p
3891
- }) : null, t[8] = p, t[9] = w);
3892
- let T;
3893
- t[10] === v ? T = t[11] : (T = /* @__PURE__ */ d("span", {
3894
- className: "text-sm font-semibold text-secondary",
3895
- children: v
3896
- }), t[10] = v, t[11] = T);
3897
- let E;
3898
- t[12] === x ? E = t[13] : (E = /* @__PURE__ */ d("button", {
3899
- type: "button",
3900
- className: "flex h-8 w-8 items-center justify-center rounded border border-primary/50 text-primary",
3901
- onClick: () => x("adults", -1),
3902
- "aria-label": "Decrease adults",
3903
- children: "−"
3904
- }), t[12] = x, t[13] = E);
3905
- let O;
3906
- t[14] === n.adults ? O = t[15] : (O = /* @__PURE__ */ d("span", {
3907
- className: "min-w-[2ch] text-center font-bold text-secondary",
3908
- children: n.adults
3909
- }), t[14] = n.adults, t[15] = O);
3910
- let k;
3911
- t[16] === x ? k = t[17] : (k = /* @__PURE__ */ d("button", {
3912
- type: "button",
3913
- className: "flex h-8 w-8 items-center justify-center rounded border border-primary/50 text-primary",
3914
- onClick: () => x("adults", 1),
3915
- "aria-label": "Increase adults",
3916
- children: "+"
3917
- }), t[16] = x, t[17] = k);
3918
- let A;
3919
- t[18] !== E || t[19] !== O || t[20] !== k ? (A = /* @__PURE__ */ f("div", {
3920
- className: "flex items-center gap-2",
3921
- children: [
3922
- E,
3923
- O,
3924
- k
3925
- ]
3926
- }), t[18] = E, t[19] = O, t[20] = k, t[21] = A) : A = t[21];
3927
- let j;
3928
- t[22] !== T || t[23] !== A ? (j = /* @__PURE__ */ f("div", {
3929
- className: "flex items-center justify-between gap-2",
3930
- children: [T, A]
3931
- }), t[22] = T, t[23] = A, t[24] = j) : j = t[24];
3932
- let M;
3933
- t[25] === y ? M = t[26] : (M = /* @__PURE__ */ d("span", {
3934
- className: "text-sm font-semibold text-secondary",
3935
- children: y
3936
- }), t[25] = y, t[26] = M);
3937
- let N;
3938
- t[27] === x ? N = t[28] : (N = /* @__PURE__ */ d("button", {
3939
- type: "button",
3940
- className: "flex h-8 w-8 items-center justify-center rounded border border-primary/50 text-primary",
3941
- onClick: () => x("children", -1),
3942
- "aria-label": "Decrease children",
3943
- children: "−"
3944
- }), t[27] = x, t[28] = N);
3945
- let P;
3946
- t[29] === n.children ? P = t[30] : (P = /* @__PURE__ */ d("span", {
3947
- className: "min-w-[2ch] text-center font-bold text-secondary",
3948
- children: n.children
3949
- }), t[29] = n.children, t[30] = P);
3950
- let F;
3951
- t[31] === x ? F = t[32] : (F = /* @__PURE__ */ d("button", {
3952
- type: "button",
3953
- className: "flex h-8 w-8 items-center justify-center rounded border border-primary/50 text-primary",
3954
- onClick: () => x("children", 1),
3955
- "aria-label": "Increase children",
3956
- children: "+"
3957
- }), t[31] = x, t[32] = F);
3958
- let I;
3959
- t[33] !== N || t[34] !== P || t[35] !== F ? (I = /* @__PURE__ */ f("div", {
3960
- className: "flex items-center gap-2",
3961
- children: [
3962
- N,
3963
- P,
3964
- F
3965
- ]
3966
- }), t[33] = N, t[34] = P, t[35] = F, t[36] = I) : I = t[36];
3967
- let L;
3968
- t[37] !== M || t[38] !== I ? (L = /* @__PURE__ */ f("div", {
3969
- className: "flex items-center justify-between gap-2",
3970
- children: [M, I]
3971
- }), t[37] = M, t[38] = I, t[39] = L) : L = t[39];
3972
- let R;
3973
- return t[40] !== C || t[41] !== w || t[42] !== j || t[43] !== L ? (R = /* @__PURE__ */ f("div", {
3974
- className: C,
3975
- children: [
3976
- w,
3977
- j,
3978
- L
3979
- ]
3980
- }), t[40] = C, t[41] = w, t[42] = j, t[43] = L, t[44] = R) : R = t[44], R;
3981
- }
3982
- var Jt = {
3983
- destinationPlaceholder: "Search destination",
3984
- whereLabel: "Where",
3985
- checkIn: "Check-in",
3986
- checkOut: "Check-out",
3987
- selectDate: "Select date",
3988
- guests: "Guests",
3989
- search: "Search",
3990
- noResults: "No results"
3991
- };
3992
- function Yt(e) {
3993
- let t = (0, D.c)(83), { destination: n, placeId: r, onDestinationChange: i, onPlaceIdChange: o, checkIn: s, onCheckInChange: c, checkOut: l, onCheckOutChange: u, guests: p, onGuestsChange: m, onSearch: h, fetchSuggestions: g, fetchDebounceMs: _, autoCompleteLoading: v, autoCompleteResults: y, labels: b, requireCheckoutWhenCheckIn: x, onValidationError: S, className: C } = e, w = x === void 0 ? !0 : x, T = C === void 0 ? "" : C, E;
3994
- t[0] === b ? E = t[1] : (E = {
3995
- ...Jt,
3996
- ...b
3997
- }, t[0] = b, t[1] = E);
3998
- let O = E, k = a(null), A = a(null), j;
3999
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (j = Wt(), t[2] = j) : j = t[2];
4000
- let M = j, N;
4001
- t[3] === s ? N = t[4] : (N = s ? Gt(s, 1) : M, t[3] = s, t[4] = N);
4002
- let P = N, F;
4003
- t[5] !== s || t[6] !== l || t[7] !== h || t[8] !== S || t[9] !== w ? (F = () => {
4004
- if (w && s && !l) {
4005
- S?.("Please select check-out date.");
4006
- return;
4007
- }
4008
- h();
4009
- }, t[5] = s, t[6] = l, t[7] = h, t[8] = S, t[9] = w, t[10] = F) : F = t[10];
4010
- let I = F, L = `mx-auto mb-4 w-full lg:max-w-[80%] xl:max-w-[70%] ${T}`, R;
4011
- t[11] === L ? R = t[12] : (R = L.trim(), t[11] = L, t[12] = R);
4012
- let z;
4013
- t[13] !== v || t[14] !== y || t[15] !== n || t[16] !== _ || t[17] !== g || t[18] !== O.destinationPlaceholder || t[19] !== O.noResults || t[20] !== i || t[21] !== o || t[22] !== r ? (z = /* @__PURE__ */ d(Kt, {
4014
- destination: n,
4015
- placeId: r,
4016
- onDestinationChange: i,
4017
- onPlaceIdChange: o,
4018
- fetchSuggestions: g,
4019
- fetchDebounceMs: _,
4020
- autoCompleteLoading: v,
4021
- autoCompleteResults: y,
4022
- variant: "default",
4023
- placeholder: O.destinationPlaceholder,
4024
- noResultsText: O.noResults
4025
- }), t[13] = v, t[14] = y, t[15] = n, t[16] = _, t[17] = g, t[18] = O.destinationPlaceholder, t[19] = O.noResults, t[20] = i, t[21] = o, t[22] = r, t[23] = z) : z = t[23];
4026
- let B;
4027
- t[24] === Symbol.for("react.memo_cache_sentinel") ? (B = () => k.current?.open(), t[24] = B) : B = t[24];
4028
- let V;
4029
- t[25] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ d(Ht, { className: "h-5 w-5 fill-primary" }), t[25] = V) : V = t[25];
4030
- let H;
4031
- t[26] === O.checkIn ? H = t[27] : (H = /* @__PURE__ */ d("button", {
4032
- type: "button",
4033
- className: "cursor-pointer",
4034
- onClick: B,
4035
- "aria-label": O.checkIn,
4036
- children: V
4037
- }), t[26] = O.checkIn, t[27] = H);
4038
- let U;
4039
- t[28] === Symbol.for("react.memo_cache_sentinel") ? (U = () => k.current?.open(), t[28] = U) : U = t[28];
4040
- let W;
4041
- t[29] === O.checkIn ? W = t[30] : (W = /* @__PURE__ */ d("button", {
4042
- type: "button",
4043
- className: "block cursor-pointer text-left text-base font-bold text-primary",
4044
- onClick: U,
4045
- children: O.checkIn
4046
- }), t[29] = O.checkIn, t[30] = W);
4047
- let G;
4048
- t[31] !== s || t[32] !== O.selectDate || t[33] !== c ? (G = /* @__PURE__ */ d(ke, {
4049
- ref: k,
4050
- value: s,
4051
- onChange: c,
4052
- placeholder: O.selectDate,
4053
- valueFormat: "iso",
4054
- min: M,
4055
- className: "w-full min-w-0",
4056
- inputClassName: "text-sm font-bold"
4057
- }), t[31] = s, t[32] = O.selectDate, t[33] = c, t[34] = G) : G = t[34];
4058
- let K;
4059
- t[35] !== W || t[36] !== G ? (K = /* @__PURE__ */ f("div", {
4060
- className: "flex w-full min-w-0 flex-col",
4061
- children: [W, G]
4062
- }), t[35] = W, t[36] = G, t[37] = K) : K = t[37];
4063
- let q;
4064
- t[38] !== H || t[39] !== K ? (q = /* @__PURE__ */ d("div", {
4065
- className: "flex w-full flex-col items-center justify-center rounded-[5px] border border-primary/50 bg-white",
4066
- children: /* @__PURE__ */ f("div", {
4067
- className: "flex w-full flex-row items-center gap-2 p-2",
4068
- children: [H, K]
4069
- })
4070
- }), t[38] = H, t[39] = K, t[40] = q) : q = t[40];
4071
- let J = `flex w-full flex-col items-center justify-center rounded-[5px] border border-primary/50 bg-white ${s ? "" : "cursor-not-allowed opacity-50"}`, ee = !s, Y;
4072
- t[41] === Symbol.for("react.memo_cache_sentinel") ? (Y = () => A.current?.open(), t[41] = Y) : Y = t[41];
4073
- let X;
4074
- t[42] === Symbol.for("react.memo_cache_sentinel") ? (X = /* @__PURE__ */ d(Ht, { className: "h-5 w-5 fill-primary" }), t[42] = X) : X = t[42];
4075
- let Z;
4076
- t[43] !== O.checkOut || t[44] !== ee ? (Z = /* @__PURE__ */ d("button", {
4077
- type: "button",
4078
- className: "cursor-pointer disabled:pointer-events-none",
4079
- disabled: ee,
4080
- onClick: Y,
4081
- "aria-label": O.checkOut,
4082
- children: X
4083
- }), t[43] = O.checkOut, t[44] = ee, t[45] = Z) : Z = t[45];
4084
- let Q = !s, te;
4085
- t[46] === Symbol.for("react.memo_cache_sentinel") ? (te = () => A.current?.open(), t[46] = te) : te = t[46];
4086
- let $;
4087
- t[47] !== O.checkOut || t[48] !== Q ? ($ = /* @__PURE__ */ d("button", {
4088
- type: "button",
4089
- className: "block cursor-pointer text-left text-base font-bold text-primary disabled:cursor-not-allowed",
4090
- disabled: Q,
4091
- onClick: te,
4092
- children: O.checkOut
4093
- }), t[47] = O.checkOut, t[48] = Q, t[49] = $) : $ = t[49];
4094
- let ne = !s, re;
4095
- t[50] !== l || t[51] !== O.selectDate || t[52] !== P || t[53] !== u || t[54] !== ne ? (re = /* @__PURE__ */ d(ke, {
4096
- ref: A,
4097
- value: l,
4098
- onChange: u,
4099
- placeholder: O.selectDate,
4100
- valueFormat: "iso",
4101
- min: P,
4102
- disabled: ne,
4103
- className: "w-full min-w-0",
4104
- inputClassName: "text-sm font-bold"
4105
- }), t[50] = l, t[51] = O.selectDate, t[52] = P, t[53] = u, t[54] = ne, t[55] = re) : re = t[55];
4106
- let ie;
4107
- t[56] !== $ || t[57] !== re ? (ie = /* @__PURE__ */ f("div", {
4108
- className: "flex w-full min-w-0 flex-col",
4109
- children: [$, re]
4110
- }), t[56] = $, t[57] = re, t[58] = ie) : ie = t[58];
4111
- let ae;
4112
- t[59] !== Z || t[60] !== ie ? (ae = /* @__PURE__ */ f("div", {
4113
- className: "flex w-full flex-row items-center gap-2 p-2",
4114
- children: [Z, ie]
4115
- }), t[59] = Z, t[60] = ie, t[61] = ae) : ae = t[61];
4116
- let oe;
4117
- t[62] !== J || t[63] !== ae ? (oe = /* @__PURE__ */ d("div", {
4118
- className: J,
4119
- children: ae
4120
- }), t[62] = J, t[63] = ae, t[64] = oe) : oe = t[64];
4121
- let se;
4122
- t[65] !== q || t[66] !== oe ? (se = /* @__PURE__ */ f("div", {
4123
- className: "grid grid-cols-2 gap-2",
4124
- children: [q, oe]
4125
- }), t[65] = q, t[66] = oe, t[67] = se) : se = t[67];
4126
- let ce;
4127
- t[68] !== p || t[69] !== O.guests || t[70] !== m ? (ce = /* @__PURE__ */ d(qt, {
4128
- label: O.guests,
4129
- value: p,
4130
- onChange: m
4131
- }), t[68] = p, t[69] = O.guests, t[70] = m, t[71] = ce) : ce = t[71];
4132
- let le;
4133
- t[72] !== I || t[73] !== O.search ? (le = /* @__PURE__ */ d("button", {
4134
- type: "button",
4135
- className: "flex w-full cursor-pointer items-center justify-center rounded-[5px] bg-primary px-5 py-2.5 text-[14px] font-bold text-white transition-colors md:text-[16px]",
4136
- onClick: I,
4137
- children: O.search
4138
- }), t[72] = I, t[73] = O.search, t[74] = le) : le = t[74];
4139
- let ue;
4140
- t[75] !== se || t[76] !== ce || t[77] !== le || t[78] !== z ? (ue = /* @__PURE__ */ f("div", {
4141
- className: "space-y-2 rounded-[10px] p-[10px] shadow-primary",
4142
- children: [
4143
- z,
4144
- se,
4145
- ce,
4146
- le
4147
- ]
4148
- }), t[75] = se, t[76] = ce, t[77] = le, t[78] = z, t[79] = ue) : ue = t[79];
4149
- let de;
4150
- return t[80] !== ue || t[81] !== R ? (de = /* @__PURE__ */ d("div", {
4151
- className: R,
4152
- children: ue
4153
- }), t[80] = ue, t[81] = R, t[82] = de) : de = t[82], de;
4154
- }
4155
- function Xt(e) {
4156
- let t = (0, D.c)(73), { destination: n, placeId: r, onDestinationChange: i, onPlaceIdChange: a, checkIn: o, onCheckInChange: s, checkOut: c, onCheckOutChange: l, guests: u, onGuestsChange: p, onSearch: m, fetchSuggestions: h, fetchDebounceMs: g, autoCompleteLoading: _, autoCompleteResults: v, labels: y, guestsPlaceholder: b, requireCheckoutWhenCheckIn: x, onValidationError: S, className: C } = e, w = b === void 0 ? "Add guests" : b, T = x === void 0 ? !0 : x, E = C === void 0 ? "" : C, O;
4157
- t[0] === y ? O = t[1] : (O = {
4158
- ...Jt,
4159
- ...y
4160
- }, t[0] = y, t[1] = O);
4161
- let A = O, j;
4162
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (j = Wt(), t[2] = j) : j = t[2];
4163
- let M = j, N;
4164
- t[3] === o ? N = t[4] : (N = o ? Gt(o, 1) : M, t[3] = o, t[4] = N);
4165
- let P = N, F;
4166
- t[5] !== o || t[6] !== c || t[7] !== m || t[8] !== S || t[9] !== T ? (F = () => {
4167
- if (T && o && !c) {
4168
- S?.("Please select check-out date.");
4169
- return;
4170
- }
4171
- m();
4172
- }, t[5] = o, t[6] = c, t[7] = m, t[8] = S, t[9] = T, t[10] = F) : F = t[10];
4173
- let I = F, L = `flex w-full flex-col ${E}`, R;
4174
- t[11] === L ? R = t[12] : (R = L.trim(), t[11] = L, t[12] = R);
4175
- let z;
4176
- t[13] !== _ || t[14] !== v || t[15] !== n || t[16] !== g || t[17] !== h || t[18] !== A.destinationPlaceholder || t[19] !== A.noResults || t[20] !== A.whereLabel || t[21] !== i || t[22] !== a || t[23] !== r ? (z = /* @__PURE__ */ d(Kt, {
4177
- destination: n,
4178
- placeId: r,
4179
- onDestinationChange: i,
4180
- onPlaceIdChange: a,
4181
- fetchSuggestions: h,
4182
- fetchDebounceMs: g,
4183
- autoCompleteLoading: _,
4184
- autoCompleteResults: v,
4185
- variant: "horizontal",
4186
- placeholder: A.destinationPlaceholder,
4187
- whereLabel: A.whereLabel,
4188
- noResultsText: A.noResults
4189
- }), t[13] = _, t[14] = v, t[15] = n, t[16] = g, t[17] = h, t[18] = A.destinationPlaceholder, t[19] = A.noResults, t[20] = A.whereLabel, t[21] = i, t[22] = a, t[23] = r, t[24] = z) : z = t[24];
4190
- let B;
4191
- t[25] === Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ d("div", { className: "w-full border-t border-dashed border-primary/20 sm:hidden" }), t[25] = B) : B = t[25];
4192
- let V;
4193
- t[26] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ d(Ht, { className: "h-5 w-5 shrink-0 fill-primary" }), t[26] = V) : V = t[26];
4194
- let H;
4195
- t[27] === A.checkIn ? H = t[28] : (H = /* @__PURE__ */ d("span", {
4196
- className: "text-base font-bold text-primary",
4197
- children: A.checkIn
4198
- }), t[27] = A.checkIn, t[28] = H);
4199
- let U;
4200
- t[29] !== o || t[30] !== A.selectDate || t[31] !== s ? (U = /* @__PURE__ */ d(ke, {
4201
- value: o,
4202
- onChange: s,
4203
- placeholder: A.selectDate,
4204
- valueFormat: "iso",
4205
- min: M,
4206
- className: "w-full min-w-0",
4207
- inputClassName: "!h-auto !p-0 !text-sm font-bold"
4208
- }), t[29] = o, t[30] = A.selectDate, t[31] = s, t[32] = U) : U = t[32];
4209
- let W;
4210
- t[33] !== H || t[34] !== U ? (W = /* @__PURE__ */ d("div", {
4211
- className: "relative flex w-1/2 flex-col sm:w-full sm:border-r sm:border-dashed sm:border-primary/50 md:w-1/5 sm:px-3 sm:pb-0",
4212
- children: /* @__PURE__ */ f("div", {
4213
- className: "flex w-full items-center gap-2 p-2",
4214
- children: [V, /* @__PURE__ */ f("div", {
4215
- className: "flex min-w-0 flex-col items-start",
4216
- children: [H, U]
4217
- })]
4218
- })
4219
- }), t[33] = H, t[34] = U, t[35] = W) : W = t[35];
4220
- let G;
4221
- t[36] === Symbol.for("react.memo_cache_sentinel") ? (G = /* @__PURE__ */ d("div", { className: "mx-1 h-8 border-r border-dashed border-primary/50 sm:hidden" }), t[36] = G) : G = t[36];
4222
- let K;
4223
- t[37] === Symbol.for("react.memo_cache_sentinel") ? (K = /* @__PURE__ */ d(Ht, { className: "h-5 w-5 shrink-0 fill-primary" }), t[37] = K) : K = t[37];
4224
- let q;
4225
- t[38] === A.checkOut ? q = t[39] : (q = /* @__PURE__ */ d("span", {
4226
- className: "text-base font-bold text-primary",
4227
- children: A.checkOut
4228
- }), t[38] = A.checkOut, t[39] = q);
4229
- let J = !o, ee;
4230
- t[40] !== c || t[41] !== A.selectDate || t[42] !== P || t[43] !== l || t[44] !== J ? (ee = /* @__PURE__ */ d(ke, {
4231
- value: c,
4232
- onChange: l,
4233
- placeholder: A.selectDate,
4234
- valueFormat: "iso",
4235
- min: P,
4236
- disabled: J,
4237
- className: "w-full min-w-0",
4238
- inputClassName: "!h-auto !p-0 !text-sm font-bold"
4239
- }), t[40] = c, t[41] = A.selectDate, t[42] = P, t[43] = l, t[44] = J, t[45] = ee) : ee = t[45];
4240
- let Y;
4241
- t[46] !== q || t[47] !== ee ? (Y = /* @__PURE__ */ d("div", {
4242
- className: "relative flex w-1/2 flex-col sm:w-full sm:border-r sm:border-dashed sm:border-primary/50 md:w-1/5 sm:px-3 sm:pb-0",
4243
- children: /* @__PURE__ */ f("div", {
4244
- className: "flex w-full items-center gap-2 p-2",
4245
- children: [K, /* @__PURE__ */ f("div", {
4246
- className: "flex min-w-0 flex-col items-start",
4247
- children: [q, ee]
4248
- })]
4249
- })
4250
- }), t[46] = q, t[47] = ee, t[48] = Y) : Y = t[48];
4251
- let X;
4252
- t[49] !== W || t[50] !== Y ? (X = /* @__PURE__ */ f("div", {
4253
- className: "flex w-full flex-row items-center py-2 sm:contents sm:py-0",
4254
- children: [
4255
- W,
4256
- G,
4257
- Y
4258
- ]
4259
- }), t[49] = W, t[50] = Y, t[51] = X) : X = t[51];
4260
- let Z;
4261
- t[52] === Symbol.for("react.memo_cache_sentinel") ? (Z = /* @__PURE__ */ d("div", { className: "w-full border-t border-dashed border-primary/20 sm:hidden" }), t[52] = Z) : Z = t[52];
4262
- let Q;
4263
- t[53] !== u || t[54] !== A.guests || t[55] !== p ? (Q = /* @__PURE__ */ d(qt, {
4264
- label: A.guests,
4265
- value: u,
4266
- onChange: p,
4267
- className: "border-0 p-2 shadow-none"
4268
- }), t[53] = u, t[54] = A.guests, t[55] = p, t[56] = Q) : Q = t[56];
4269
- let te;
4270
- t[57] === w ? te = t[58] : (te = /* @__PURE__ */ d("span", {
4271
- className: "px-3 pb-1 text-xs text-secondary/70 sm:hidden",
4272
- children: w
4273
- }), t[57] = w, t[58] = te);
4274
- let $;
4275
- t[59] !== Q || t[60] !== te ? ($ = /* @__PURE__ */ f("div", {
4276
- className: "flex w-full flex-col pb-3 sm:w-full sm:px-3 md:w-1/5 sm:pb-0",
4277
- children: [Q, te]
4278
- }), t[59] = Q, t[60] = te, t[61] = $) : $ = t[61];
4279
- let ne;
4280
- t[62] !== I || t[63] !== A.search ? (ne = /* @__PURE__ */ d("div", {
4281
- className: "flex w-full items-center justify-center sm:min-w-[120px] sm:max-w-[200px] sm:shrink-0 sm:pl-2",
4282
- children: /* @__PURE__ */ d(k, {
4283
- type: "button",
4284
- title: A.search,
4285
- width: "full",
4286
- className: "w-full rounded-medium sm:rounded-primary md:rounded-medium lg:rounded-primary",
4287
- onClick: I
4288
- })
4289
- }), t[62] = I, t[63] = A.search, t[64] = ne) : ne = t[64];
4290
- let re;
4291
- t[65] !== z || t[66] !== X || t[67] !== $ || t[68] !== ne ? (re = /* @__PURE__ */ f("div", {
4292
- className: "flex w-full flex-col items-stretch justify-between rounded-xl bg-white p-3 text-start shadow-primary sm:flex-row sm:gap-2 sm:p-4",
4293
- children: [
4294
- z,
4295
- B,
4296
- X,
4297
- Z,
4298
- $,
4299
- ne
4300
- ]
4301
- }), t[65] = z, t[66] = X, t[67] = $, t[68] = ne, t[69] = re) : re = t[69];
4302
- let ie;
4303
- return t[70] !== re || t[71] !== R ? (ie = /* @__PURE__ */ d("div", {
4304
- className: R,
4305
- children: re
4306
- }), t[70] = re, t[71] = R, t[72] = ie) : ie = t[72], ie;
4307
- }
4308
- //#endregion
4309
- //#region src/ui/Toast.tsx
4310
- var Zt = {
4311
- position: "top-right",
4312
- autoClose: 3e3
4313
- };
4314
- function Qt(e) {
4315
- let t = (0, D.c)(2), n;
4316
- return t[0] === e ? n = t[1] : (n = /* @__PURE__ */ d(b, {
4317
- ...Zt,
4318
- ...e
4319
- }), t[0] = e, t[1] = n), n;
4320
- }
4321
- //#endregion
4322
- export { tt as AboutCard, dt as Accordion, at as BookingDetailsCard, _ as Bounce, _t as BreadcrumbTrail, vt as Breadcrumbs, k as Button, et as Card, xt as CircularProgressBar, $e as CongratulationsBox, ke as DatePicker, Ae as DatePickerFloatingInput, je as DatePickerStacked, Ne as DateRangePicker, re as Dropdown, ut as FaqAccordion, v as Flip, It as GoogleMap, Ft as GoogleMapsProvider, Xt as HorizontalSearchBar, qe as IconLoader, Et as ImagePreviewModal, Mt as List, Ke as Loader, Xe as Modal, bt as ProgressBar, ft as ReusableAccordion, Je as RingSpinner, Ye as RingSpinnerOverlay, Yt as SearchBar, Kt as SearchBarDestinationField, qt as SearchGuestsField, y as Slide, ce as Slider, de as SliderCards, Pt as Tabs, V as TextInput, We as TimePicker, Qt as ToastContainer, zt as Tooltip, x as Zoom, H as normalizeDropdownOptions, S as toast };
1
+ import { Button as e } from "./ui/Button.js";
2
+ import { TextInput as t } from "./ui/TextInput.js";
3
+ import { Dropdown as n, normalizeDropdownOptions as r } from "./ui/Dropdown.js";
4
+ import { Slider as i, SliderCards as a } from "./ui/Slider.js";
5
+ import { DatePicker as o, DatePickerFloatingInput as s, DatePickerStacked as c, DateRangePicker as l } from "./ui/DatePicker.js";
6
+ import { TimePicker as u } from "./ui/TimePicker.js";
7
+ import { IconLoader as d, Loader as f, RingSpinner as p, RingSpinnerOverlay as m } from "./ui/Loader.js";
8
+ import { Modal as h } from "./ui/Modal.js";
9
+ import { CongratulationsBox as g } from "./ui/CongratulationsBox.js";
10
+ import { AboutCard as _, Card as v } from "./ui/Card.js";
11
+ import { BookingDetailsCard as y } from "./ui/BookingDetailsCard.js";
12
+ import { Accordion as b, FaqAccordion as x, ReusableAccordion as S } from "./ui/Accordion.js";
13
+ import { BreadcrumbTrail as C, Breadcrumbs as w } from "./ui/Breadcrumbs.js";
14
+ import { CircularProgressBar as T, ProgressBar as E } from "./ui/ProgressBar.js";
15
+ import { ImagePreviewModal as D } from "./ui/ImagePreviewModal.js";
16
+ import { List as O } from "./ui/List.js";
17
+ import { Tabs as k } from "./ui/Tabs.js";
18
+ import { GoogleMap as A, GoogleMapsProvider as j } from "./ui/GoogleMap.js";
19
+ import { Tooltip as M } from "./ui/Tooltip.js";
20
+ import { HorizontalSearchBar as N, SearchBar as P, SearchBarDestinationField as F, SearchGuestsField as I } from "./ui/SearchBar.js";
21
+ import { Bounce as L, Flip as R, Slide as z, ToastContainer as B, Zoom as V, toast as H } from "./ui/Toast.js";
22
+ export { _ as AboutCard, b as Accordion, y as BookingDetailsCard, L as Bounce, C as BreadcrumbTrail, w as Breadcrumbs, e as Button, v as Card, T as CircularProgressBar, g as CongratulationsBox, o as DatePicker, s as DatePickerFloatingInput, c as DatePickerStacked, l as DateRangePicker, n as Dropdown, x as FaqAccordion, R as Flip, A as GoogleMap, j as GoogleMapsProvider, N as HorizontalSearchBar, d as IconLoader, D as ImagePreviewModal, O as List, f as Loader, h as Modal, E as ProgressBar, S as ReusableAccordion, p as RingSpinner, m as RingSpinnerOverlay, P as SearchBar, F as SearchBarDestinationField, I as SearchGuestsField, z as Slide, i as Slider, a as SliderCards, k as Tabs, t as TextInput, u as TimePicker, B as ToastContainer, M as Tooltip, V as Zoom, r as normalizeDropdownOptions, H as toast };