@levo-so/studio 0.3.20 → 0.3.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/BillingStep-ioR7mSo5.js +249 -0
  2. package/BookingCard-DEkBXh7O.js +646 -0
  3. package/DateTimeWidget-B-dajfHj.js +253 -0
  4. package/{EntryCard-9yv0KJTB.js → EntryCard-CZfljZAY.js} +4 -4
  5. package/{KBChatWidget-D39Z3HIl.js → KBChatWidget-BXRRgelS.js} +1 -1
  6. package/{LoginCard-D9vEC_g0.js → LoginCard-BVjeN1J0.js} +3 -3
  7. package/{LoginForm-kI_b_7Tc.js → LoginForm-DQVwLQCx.js} +19 -19
  8. package/{LoginModal-C-9BhmoO.js → LoginModal-C6TdAh-0.js} +5 -6
  9. package/{MessageCard-Nsxr98n6.js → MessageCard-B5MbVDJ8.js} +2 -2
  10. package/{MessageFooter-K4Zd_eFO.js → MessageFooter-DrlKXE9a.js} +1 -2
  11. package/{PendingApprovalCard-CzoBgYNy.js → PendingApprovalCard-5iFAeE1s.js} +3 -3
  12. package/{PhoneWidget-BtMMfGLu.js → PhoneWidget-B4KHlFjT.js} +6 -7
  13. package/{Popover-Iis-qOn1.js → Popover-y8XkbYNh.js} +7 -7
  14. package/{PopupBody-BI-MJqmd-B3ltSYMP.js → PopupBody-DWM55Zh5-DuOPsCAn.js} +53 -55
  15. package/PopupDialog-DwAAJ8JS-9xm5jrXW.js +261 -0
  16. package/PopupRenderer-BVtV4b9I-BdPryfLY.js +208 -0
  17. package/{ProfileCard-Chg20HBa.js → ProfileCard-WgFT-T4U.js} +5 -5
  18. package/{RichTextWidget-C3Y-0pNy.js → RichTextWidget-DKYm1cSW.js} +120 -123
  19. package/{Spinner-D5spB_Mv.js → Spinner-LdYfm4S7.js} +1 -1
  20. package/{VerifyButton-BwTbzSwS.js → VerifyButton-CNq78zG4.js} +5 -7
  21. package/collection.d.ts +9 -1
  22. package/collection.js +1 -1
  23. package/dialog-CU5nHKc5.js +119 -0
  24. package/dist-IMRD6dob.js +3858 -0
  25. package/index.js +3280 -2848
  26. package/{inlineRteTheme-BOAno9MG.js → inlineRteTheme-DFg69bqP.js} +50 -37
  27. package/{kbChat-zXbn56Zb.js → kbChat-eFsau7hG.js} +2 -2
  28. package/package.json +42 -43
  29. package/{pillChrome-QDjBETmP.js → pillChrome-Dy3ApFI5.js} +5 -5
  30. package/price-BUDkN5Me.js +823 -0
  31. package/script.esm-uVCZU25S.js +62 -0
  32. package/studio.css +1 -1
  33. package/themeMapping-DH_NoXK8-H-EHXbBt.js +156 -0
  34. package/useCheckout-gscmzFLD.js +179 -0
  35. package/useLogin-BYVekOp9.js +237 -0
  36. package/AuthProvider-B5NfFwbG.js +0 -118
  37. package/BillingStep-BTDOMFHV.js +0 -181
  38. package/Button-DXLWW3dp.js +0 -504
  39. package/CollectionField-BZmxRB5D.js +0 -270
  40. package/CollectionInput-DyNbxIZ8.js +0 -147
  41. package/DateTimeWidget-Bt1UcCnx.js +0 -255
  42. package/Dialog-CPE8yUqK.js +0 -130
  43. package/ModalManager-CzH36UIk.js +0 -32
  44. package/PopupRenderer-D66Gx63H-ChI4WBer.js +0 -389
  45. package/RteThemeProvider-owl5oajj.js +0 -20
  46. package/ThemeProvider-CqPHzkW9.js +0 -116
  47. package/Tooltip-DHU1QD-n.js +0 -67
  48. package/authentication-BXQbxiPP.js +0 -36
  49. package/bookingCard-g0n3ksiC.js +0 -605
  50. package/createThemeExtension-C0PSYy0J.js +0 -15
  51. package/dialog-8LH_ihs4.js +0 -92
  52. package/dist-Dijjo-5m.js +0 -3794
  53. package/generateRadiusScale-RROt8ppa.js +0 -71
  54. package/inlineCollectionTheme-uhBXoF1F.js +0 -19
  55. package/popupState-JmpeKzgM-UECLsSbL.js +0 -100
  56. package/rteTheme.cssm-W4gTOijw.js +0 -4
  57. package/theme.cssm-Czj9sF4X.js +0 -4
  58. package/themeMapping-Bi9Rcr5G-C7UXWE6o.js +0 -61
  59. package/useCheckout-DFalmfEQ.js +0 -161
  60. package/useLogin-CfnGrLdO.js +0 -127
  61. package/usePopupRedirect-CAAdcpaW-DdME0F7f.js +0 -82
  62. /package/{Beams-WJN38XSv.js → Beams-KsU_ixpY.js} +0 -0
  63. /package/{Dots-DggLz5I7.js → Dots-C_ja_PPu.js} +0 -0
  64. /package/{Gradient-BSWJAu0a.js → Gradient-CDGFLaA-.js} +0 -0
  65. /package/{Grid-BFKl0MUt.js → Grid-C22rTkrs.js} +0 -0
  66. /package/{Waves-BPEgTYoO.js → Waves-Cl5rKcFJ.js} +0 -0
  67. /package/{card-5ooLmYSr.js → card-BIebVDA0.js} +0 -0
  68. /package/{cn-B6c1DjO_.js → cn-CzJDhklM.js} +0 -0
  69. /package/{fontSize-B-ba6pvx.js → fontSize-DowUyWe-.js} +0 -0
@@ -1,605 +0,0 @@
1
- "use client";
2
- import { t as e } from "./Button-DXLWW3dp.js";
3
- import { n as t } from "./AuthProvider-B5NfFwbG.js";
4
- import { t as n } from "./cn-B6c1DjO_.js";
5
- import { t as r } from "./useCheckout-DFalmfEQ.js";
6
- import { BillingStep as i } from "./BillingStep-BTDOMFHV.js";
7
- import { errorHandler as a, useLevo as o } from "@levo-so/react";
8
- import { useEffect as s, useRef as c, useState as l } from "react";
9
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
10
- import { Calendar as p, CheckCircle2 as m, Clock as h, CreditCard as ee, Download as te, Loader2 as ne, Pencil as re, RefreshCw as g, ShieldCheck as _, Ticket as v, XCircle as ie } from "lucide-react";
11
- import y from "dayjs";
12
- //#region src/components/bookingCard/BookingCard.tsx
13
- var b = {
14
- cashfree: "Cashfree",
15
- razorpay: "Razorpay",
16
- stripe: "Stripe"
17
- }, x = ({ items: e, textSizeClass: t = "text-sm" }) => {
18
- let [r, i] = l(!1), a = c(null);
19
- if (s(() => {
20
- if (!r) return;
21
- let e = (e) => {
22
- a.current && !a.current.contains(e.target) && i(!1);
23
- };
24
- return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
25
- }, [r]), e.length === 0) return /* @__PURE__ */ d("span", {
26
- className: n("text-gray-900", t),
27
- children: "-"
28
- });
29
- let o = String(e[0] ?? "-"), u = e.length - 1;
30
- return /* @__PURE__ */ f("div", {
31
- ref: a,
32
- className: "relative inline-block",
33
- onMouseEnter: () => i(!0),
34
- onMouseLeave: () => i(!1),
35
- children: [/* @__PURE__ */ f("button", {
36
- type: "button",
37
- onClick: () => i((e) => !e),
38
- className: n("cursor-pointer text-right font-medium text-gray-900 underline decoration-gray-300 decoration-dotted underline-offset-2 hover:decoration-gray-500", t),
39
- children: [o, u > 0 && /* @__PURE__ */ f("span", {
40
- className: "ml-1 font-normal text-gray-500",
41
- children: [
42
- "+",
43
- u,
44
- " more"
45
- ]
46
- })]
47
- }), r && /* @__PURE__ */ d("div", {
48
- className: "absolute right-0 z-20 mt-1.5 min-w-[200px] max-w-[280px] rounded-md border border-gray-200 bg-white p-2.5 shadow-lg",
49
- children: /* @__PURE__ */ d("ul", {
50
- className: "space-y-1.5 text-left",
51
- children: e.map((e, t) => /* @__PURE__ */ f("li", {
52
- className: "flex items-start gap-2 text-gray-700 text-xs leading-snug",
53
- children: [/* @__PURE__ */ d("span", { className: "mt-1.5 size-1 shrink-0 rounded-full bg-orange-400" }), /* @__PURE__ */ d("span", {
54
- className: "break-words",
55
- children: String(e ?? "-")
56
- })]
57
- }, t))
58
- })
59
- })]
60
- });
61
- }, S = ({ summary: s, billingDetails: c, onBillingEdit: S, onComplete: C, className: w }) => {
62
- let T = o(), { workspace: E } = t(), D = r(), [O, k] = l("summary"), [A, j] = l(null), [M, N] = l(!1), [P, F] = l(null), [I, L] = l("razorpay"), R = (e, t) => {
63
- let n = t && t.trim() ? t : "INR", r = e / 100;
64
- return new Intl.NumberFormat("en-IN", {
65
- style: "currency",
66
- currency: n,
67
- minimumFractionDigits: 0
68
- }).format(r);
69
- }, z = (e) => e ? y(e).format("D MMM YYYY") : null, B = (e) => e ? y(e).format("h:mm A") : null, V = (e) => e.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (e) => e.toUpperCase()), H = (e) => e == null ? "-" : typeof e == "boolean" ? e ? "Yes" : "No" : Array.isArray(e) ? e.join(", ") : typeof e == "object" ? JSON.stringify(e) : String(e), U = () => {
70
- try {
71
- Object.keys(localStorage).forEach((e) => {
72
- e.startsWith("levo_collection_cart_") && localStorage.removeItem(e);
73
- }), window.dispatchEvent(new Event("levo_cart_updated"));
74
- } catch (e) {
75
- a(e);
76
- }
77
- }, W = Object.entries(s.form_data || {}).filter(([e, t]) => t != null && t !== ""), G = async () => {
78
- k("processing"), j(null);
79
- try {
80
- let e = c || s.billing_details, t = e ? { billing_details: e } : {}, n = await T?.fetch?.url(`/v1/payment/booking/${s._id}/pay`)?.options({ headers: { Origin: E?.id || "" } })?.post(t).json(), r = n?.content?.meta;
81
- if (!n?.status || !r?.key) {
82
- j("Unable to initiate payment. Please try again."), k("failed");
83
- return;
84
- }
85
- L(r.provider || "razorpay");
86
- let i = await D.open(r, {
87
- amount: r.amount ?? 0,
88
- merchantName: E?.name ?? "",
89
- description: X || "Booking Payment",
90
- prefill: {
91
- name: "",
92
- email: "",
93
- contact: ""
94
- },
95
- themeColor: "#FC751A"
96
- });
97
- i.status === "completed" ? await ae(i.confirmation) : i.status === "closed" && (i.message ? (j(i.message), k("failed")) : k("summary"));
98
- } catch (e) {
99
- console.error("Initiate payment error:", e), a(e), j("Unable to initiate payment. Please check your connection and try again."), k("failed");
100
- }
101
- }, ae = async (e) => {
102
- try {
103
- let t = await T?.fetch?.url(`/v1/payment/booking/${s._id}/confirm`)?.options({ headers: { Origin: E?.id || "" } })?.post(e).json();
104
- t?.status && t?.content?.data ? (F(t.content.data), k("confirmed"), U()) : (j("Payment received but confirmation failed. Please contact support."), k("failed"));
105
- } catch (e) {
106
- console.error("Confirm payment error:", e), a(e), j("Payment received but confirmation failed. Please contact support."), k("failed");
107
- }
108
- }, K = !s.total_amount || s.total_amount === 0, q = s.line_items || [], J = q[0], Y = q.length > 1, X = Y ? s.context_label || "Booking" : J?.instance_label || s.context_label || "Booking", Z = J?.cover_image?.location || null, Q = J?.starts_at || null, $ = J?.ends_at || null;
109
- return /* @__PURE__ */ f(u, { children: [
110
- /* @__PURE__ */ f("div", {
111
- className: n("overflow-hidden rounded-xl border border-gray-200 bg-white shadow-sm", w),
112
- children: [
113
- O === "summary" && /* @__PURE__ */ f("div", {
114
- className: "flex flex-col",
115
- children: [Z && /* @__PURE__ */ f("div", {
116
- className: "relative h-44 w-full overflow-hidden bg-gray-100",
117
- children: [/* @__PURE__ */ d("img", {
118
- src: Z,
119
- alt: X,
120
- className: "h-full w-full object-cover"
121
- }), /* @__PURE__ */ d("div", { className: "absolute inset-0 bg-gradient-to-t from-black/30 to-transparent" })]
122
- }), /* @__PURE__ */ f("div", {
123
- className: "flex flex-col px-6 py-5 sm:px-8",
124
- children: [
125
- /* @__PURE__ */ f("div", {
126
- className: "mx-auto mb-5 w-full max-w-lg text-center",
127
- children: [/* @__PURE__ */ d("p", {
128
- className: "mb-1 font-medium text-gray-500 text-xs uppercase tracking-wider",
129
- children: "Booking Summary"
130
- }), /* @__PURE__ */ d("h3", {
131
- className: "font-semibold text-gray-900 text-xl leading-tight",
132
- children: X
133
- })]
134
- }),
135
- !Y && (Q || $) && /* @__PURE__ */ f("div", {
136
- className: "mx-auto mb-5 flex w-full max-w-lg flex-wrap justify-center gap-4 rounded-lg bg-orange-50 px-4 py-3",
137
- children: [Q && /* @__PURE__ */ f("div", {
138
- className: "flex items-center gap-2 text-gray-700 text-sm",
139
- children: [/* @__PURE__ */ d(p, { className: "size-4 text-orange-500" }), /* @__PURE__ */ d("span", { children: z(Q) })]
140
- }), Q && /* @__PURE__ */ f("div", {
141
- className: "flex items-center gap-2 text-gray-700 text-sm",
142
- children: [/* @__PURE__ */ d(h, { className: "size-4 text-orange-500" }), /* @__PURE__ */ d("span", { children: B(Q) })]
143
- })]
144
- }),
145
- W.length > 0 && /* @__PURE__ */ f("div", {
146
- className: "mx-auto mb-5 w-full max-w-lg",
147
- children: [/* @__PURE__ */ d("h4", {
148
- className: "mb-3 text-center font-medium text-gray-500 text-xs uppercase tracking-wider",
149
- children: "Your Details"
150
- }), /* @__PURE__ */ d("div", {
151
- className: "rounded-lg border border-gray-100 bg-gray-50/50 p-4",
152
- children: /* @__PURE__ */ d("div", {
153
- className: "space-y-2.5",
154
- children: W.map(([e, t]) => /* @__PURE__ */ f("div", {
155
- className: "flex items-start justify-between gap-3",
156
- children: [/* @__PURE__ */ d("span", {
157
- className: "text-gray-500 text-sm",
158
- children: V(e)
159
- }), Array.isArray(t) ? /* @__PURE__ */ d(x, {
160
- items: t,
161
- textSizeClass: "text-sm"
162
- }) : /* @__PURE__ */ d("span", {
163
- className: "text-right font-medium text-gray-900 text-sm",
164
- children: H(t)
165
- })]
166
- }, e))
167
- })
168
- })]
169
- }),
170
- (() => {
171
- let e = c || s.billing_details;
172
- return e ? /* @__PURE__ */ f("div", {
173
- className: "mx-auto mb-5 w-full max-w-lg",
174
- children: [/* @__PURE__ */ f("div", {
175
- className: "mb-3 flex items-center justify-center gap-2",
176
- children: [/* @__PURE__ */ d("h4", {
177
- className: "text-center font-medium text-gray-500 text-xs uppercase tracking-wider",
178
- children: "Billing Details"
179
- }), S && /* @__PURE__ */ d("button", {
180
- type: "button",
181
- onClick: () => N(!0),
182
- className: "text-orange-500 hover:text-orange-600",
183
- children: /* @__PURE__ */ d(re, { className: "size-3.5" })
184
- })]
185
- }), /* @__PURE__ */ d("div", {
186
- className: "rounded-lg border border-gray-100 bg-gray-50/50 p-4",
187
- children: /* @__PURE__ */ f("div", {
188
- className: "space-y-2.5",
189
- children: [
190
- /* @__PURE__ */ f("div", {
191
- className: "flex items-start justify-between gap-3",
192
- children: [/* @__PURE__ */ d("span", {
193
- className: "text-gray-500 text-sm",
194
- children: "Name"
195
- }), /* @__PURE__ */ d("span", {
196
- className: "text-right font-medium text-gray-900 text-sm",
197
- children: e.name
198
- })]
199
- }),
200
- e.tax_id && /* @__PURE__ */ f("div", {
201
- className: "flex items-start justify-between gap-3",
202
- children: [/* @__PURE__ */ d("span", {
203
- className: "text-gray-500 text-sm",
204
- children: "Tax ID"
205
- }), /* @__PURE__ */ d("span", {
206
- className: "text-right font-medium text-gray-900 text-sm",
207
- children: e.tax_id
208
- })]
209
- }),
210
- /* @__PURE__ */ f("div", {
211
- className: "flex items-start justify-between gap-3",
212
- children: [/* @__PURE__ */ d("span", {
213
- className: "text-gray-500 text-sm",
214
- children: "Address"
215
- }), /* @__PURE__ */ d("span", {
216
- className: "text-right font-medium text-gray-900 text-sm",
217
- children: [
218
- e.address.line1,
219
- e.address.line2,
220
- e.address.city,
221
- e.address.state,
222
- e.address.postal_code,
223
- e.address.country
224
- ].filter(Boolean).join(", ")
225
- })]
226
- })
227
- ]
228
- })
229
- })]
230
- }) : null;
231
- })(),
232
- /* @__PURE__ */ f("div", {
233
- className: "mx-auto mb-5 w-full max-w-lg",
234
- children: [/* @__PURE__ */ d("h4", {
235
- className: "mb-3 text-center font-medium text-gray-500 text-xs uppercase tracking-wider",
236
- children: "Payment"
237
- }), /* @__PURE__ */ f("div", {
238
- className: "rounded-lg border border-gray-200 bg-white p-4",
239
- children: [/* @__PURE__ */ f("div", {
240
- className: "space-y-2",
241
- children: [
242
- q.map((e) => /* @__PURE__ */ f("div", {
243
- className: "flex items-start justify-between gap-3 text-sm",
244
- children: [/* @__PURE__ */ f("span", {
245
- className: "min-w-0 flex-1 text-gray-600",
246
- children: [/* @__PURE__ */ d("span", {
247
- className: "break-words",
248
- children: e.instance_label
249
- }), e.quantity > 1 && /* @__PURE__ */ f("span", {
250
- className: "ml-1 text-gray-400",
251
- children: ["×", e.quantity]
252
- })]
253
- }), /* @__PURE__ */ d("span", {
254
- className: "shrink-0 text-gray-900",
255
- children: R(e.line_subtotal, s.currency)
256
- })]
257
- }, e.resource_instance)),
258
- typeof s.discount == "number" && s.discount > 0 && /* @__PURE__ */ f("div", {
259
- className: "flex items-center justify-between text-sm",
260
- children: [/* @__PURE__ */ d("span", {
261
- className: "text-gray-600",
262
- children: "Discount"
263
- }), /* @__PURE__ */ f("span", {
264
- className: "text-green-600",
265
- children: ["-", R(s.discount, s.currency)]
266
- })]
267
- }),
268
- s.taxes && s.taxes.length > 0 && s.taxes.map((e) => /* @__PURE__ */ f("div", {
269
- className: "flex items-center justify-between text-sm",
270
- children: [/* @__PURE__ */ d("span", {
271
- className: "text-gray-600",
272
- children: e.label
273
- }), /* @__PURE__ */ d("span", {
274
- className: "text-gray-900",
275
- children: R(e.amount, s.currency)
276
- })]
277
- }, e.id))
278
- ]
279
- }), /* @__PURE__ */ f("div", {
280
- className: "mt-3 flex items-center justify-between border-gray-100 border-t pt-3",
281
- children: [/* @__PURE__ */ d("span", {
282
- className: "font-medium text-gray-900",
283
- children: "Total"
284
- }), /* @__PURE__ */ d("span", {
285
- className: "font-bold text-gray-900 text-xl",
286
- children: K ? "Free" : R(s.total_amount, s.currency)
287
- })]
288
- })]
289
- })]
290
- }),
291
- /* @__PURE__ */ d(e, {
292
- elementKey: "booking-pay-btn",
293
- onClick: K ? () => {
294
- k("confirmed"), U();
295
- } : G,
296
- className: "mx-auto w-full max-w-lg rounded-lg px-4 py-3.5 font-semibold",
297
- children: /* @__PURE__ */ d("span", {
298
- className: "flex items-center justify-center gap-2",
299
- children: K ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(m, { className: "size-5" }), /* @__PURE__ */ d("span", { children: "Confirm Booking" })] }) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(ee, { className: "size-5" }), /* @__PURE__ */ f("span", { children: ["Pay ", R(s.total_amount, s.currency)] })] })
300
- })
301
- }),
302
- !K && /* @__PURE__ */ f("div", {
303
- className: "mx-auto mt-4 flex w-full max-w-lg items-center justify-center gap-1.5 text-gray-400 text-xs",
304
- children: [/* @__PURE__ */ d(_, { className: "size-3.5" }), /* @__PURE__ */ d("span", { children: "Secure payment" })]
305
- })
306
- ]
307
- })]
308
- }),
309
- O === "processing" && /* @__PURE__ */ f("div", {
310
- className: "flex flex-col items-center justify-center px-6 py-16",
311
- children: [
312
- /* @__PURE__ */ f("div", {
313
- className: "relative mb-6",
314
- children: [/* @__PURE__ */ d("div", { className: "absolute inset-0 animate-ping rounded-full bg-orange-200 opacity-75" }), /* @__PURE__ */ d("div", {
315
- className: "relative flex size-16 items-center justify-center rounded-full bg-orange-100",
316
- children: /* @__PURE__ */ d(ne, { className: "size-8 animate-spin text-orange-500" })
317
- })]
318
- }),
319
- /* @__PURE__ */ d("h3", {
320
- className: "mb-1 font-semibold text-gray-900 text-lg",
321
- children: "Processing Payment"
322
- }),
323
- /* @__PURE__ */ d("p", {
324
- className: "text-center text-gray-500 text-sm",
325
- children: "Please wait while we confirm your payment..."
326
- }),
327
- /* @__PURE__ */ d("div", {
328
- className: "mt-6 rounded-lg bg-gray-50 px-6 py-3",
329
- children: /* @__PURE__ */ f("p", {
330
- className: "text-center text-gray-600 text-sm",
331
- children: [
332
- "Amount:",
333
- " ",
334
- /* @__PURE__ */ d("span", {
335
- className: "font-semibold text-gray-900",
336
- children: R(s.total_amount, s.currency)
337
- })
338
- ]
339
- })
340
- })
341
- ]
342
- }),
343
- O === "failed" && /* @__PURE__ */ f("div", {
344
- className: "flex flex-col",
345
- children: [/* @__PURE__ */ d("div", {
346
- className: "bg-gradient-to-br from-red-50 to-orange-50 px-6 py-6",
347
- children: /* @__PURE__ */ f("div", {
348
- className: "flex flex-col items-center",
349
- children: [
350
- /* @__PURE__ */ d("div", {
351
- className: "mb-3 flex size-14 items-center justify-center rounded-full bg-red-100",
352
- children: /* @__PURE__ */ d(ie, { className: "size-8 text-red-500" })
353
- }),
354
- /* @__PURE__ */ d("h3", {
355
- className: "mb-1 font-semibold text-gray-900 text-lg",
356
- children: "Payment Failed"
357
- }),
358
- /* @__PURE__ */ d("p", {
359
- className: "text-center text-gray-600 text-sm",
360
- children: A || "Something went wrong. Please try again."
361
- })
362
- ]
363
- })
364
- }), /* @__PURE__ */ f("div", {
365
- className: "flex flex-col px-6 py-5 sm:px-8",
366
- children: [
367
- /* @__PURE__ */ d("div", {
368
- className: "mx-auto mb-4 w-full max-w-lg text-center",
369
- children: /* @__PURE__ */ d("h4", {
370
- className: "font-semibold text-base text-gray-900",
371
- children: X
372
- })
373
- }),
374
- !Y && (Q || $) && /* @__PURE__ */ f("div", {
375
- className: "mx-auto mb-4 flex w-full max-w-lg flex-wrap justify-center gap-4 rounded-lg bg-gray-50 px-4 py-2.5",
376
- children: [Q && /* @__PURE__ */ f("div", {
377
- className: "flex items-center gap-2 text-gray-600 text-sm",
378
- children: [/* @__PURE__ */ d(p, { className: "size-4 text-gray-400" }), /* @__PURE__ */ d("span", { children: z(Q) })]
379
- }), Q && /* @__PURE__ */ f("div", {
380
- className: "flex items-center gap-2 text-gray-600 text-sm",
381
- children: [/* @__PURE__ */ d(h, { className: "size-4 text-gray-400" }), /* @__PURE__ */ d("span", { children: B(Q) })]
382
- })]
383
- }),
384
- W.length > 0 && /* @__PURE__ */ d("div", {
385
- className: "mx-auto mb-4 w-full max-w-lg rounded-lg border border-gray-100 bg-gray-50/50 p-3",
386
- children: /* @__PURE__ */ f("div", {
387
- className: "space-y-1.5",
388
- children: [W.slice(0, 3).map(([e, t]) => /* @__PURE__ */ f("div", {
389
- className: "flex items-center justify-between gap-3 text-sm",
390
- children: [/* @__PURE__ */ d("span", {
391
- className: "text-gray-500",
392
- children: V(e)
393
- }), Array.isArray(t) ? /* @__PURE__ */ d(x, {
394
- items: t,
395
- textSizeClass: "text-sm"
396
- }) : /* @__PURE__ */ d("span", {
397
- className: "max-w-[50%] truncate font-medium text-gray-900",
398
- children: H(t)
399
- })]
400
- }, e)), W.length > 3 && /* @__PURE__ */ f("p", {
401
- className: "pt-1 text-center text-gray-400 text-xs",
402
- children: [
403
- "+",
404
- W.length - 3,
405
- " more"
406
- ]
407
- })]
408
- })
409
- }),
410
- /* @__PURE__ */ d("div", {
411
- className: "mx-auto mb-5 w-full max-w-lg rounded-lg border border-gray-200 bg-white p-4",
412
- children: /* @__PURE__ */ f("div", {
413
- className: "flex items-center justify-between",
414
- children: [/* @__PURE__ */ d("span", {
415
- className: "font-medium text-gray-700",
416
- children: "Amount to Pay"
417
- }), /* @__PURE__ */ d("span", {
418
- className: "font-bold text-gray-900 text-xl",
419
- children: R(s.total_amount, s.currency)
420
- })]
421
- })
422
- }),
423
- /* @__PURE__ */ d(e, {
424
- elementKey: "booking-retry-btn",
425
- onClick: () => {
426
- j(null), G();
427
- },
428
- className: "mx-auto w-full max-w-lg rounded-lg px-4 py-3.5 font-semibold",
429
- children: /* @__PURE__ */ f("span", {
430
- className: "flex items-center justify-center gap-2",
431
- children: [/* @__PURE__ */ d(g, { className: "size-5" }), /* @__PURE__ */ d("span", { children: "Try Again" })]
432
- })
433
- }),
434
- /* @__PURE__ */ f("div", {
435
- className: "mx-auto mt-4 flex w-full max-w-lg items-center justify-center gap-1.5 text-gray-400 text-xs",
436
- children: [/* @__PURE__ */ d(_, { className: "size-3.5" }), /* @__PURE__ */ f("span", { children: ["Secured by ", b[I]] })]
437
- }),
438
- /* @__PURE__ */ d("p", {
439
- className: "mx-auto mt-3 w-full max-w-lg text-center text-gray-400 text-xs",
440
- children: "If the problem persists, please contact support"
441
- })
442
- ]
443
- })]
444
- }),
445
- O === "confirmed" && /* @__PURE__ */ f("div", {
446
- className: "flex flex-col",
447
- children: [/* @__PURE__ */ d("div", {
448
- className: "bg-gradient-to-br from-green-50 to-emerald-50 px-6 py-8",
449
- children: /* @__PURE__ */ f("div", {
450
- className: "flex flex-col items-center",
451
- children: [
452
- /* @__PURE__ */ f("div", {
453
- className: "relative mb-4",
454
- children: [/* @__PURE__ */ d("div", { className: "absolute -inset-2 animate-pulse rounded-full bg-green-200/50" }), /* @__PURE__ */ d("div", {
455
- className: "relative flex size-16 items-center justify-center rounded-full bg-green-100 ring-4 ring-green-50",
456
- children: /* @__PURE__ */ d(m, { className: "size-9 text-green-600" })
457
- })]
458
- }),
459
- /* @__PURE__ */ d("h3", {
460
- className: "mb-1 font-bold text-gray-900 text-xl",
461
- children: K ? "Booking Confirmed!" : "Payment Successful!"
462
- }),
463
- /* @__PURE__ */ d("p", {
464
- className: "text-center text-gray-600 text-sm",
465
- children: K ? "Your booking has been confirmed" : "Your payment has been processed successfully"
466
- })
467
- ]
468
- })
469
- }), /* @__PURE__ */ f("div", {
470
- className: "px-6 py-5 sm:px-8",
471
- children: [
472
- /* @__PURE__ */ f("div", {
473
- className: "relative mx-auto max-w-lg overflow-hidden rounded-xl border border-gray-200 bg-white",
474
- children: [
475
- /* @__PURE__ */ d("div", { className: "absolute top-1/2 -left-3 size-6 -translate-y-1/2 rounded-full bg-gray-100" }),
476
- /* @__PURE__ */ d("div", { className: "absolute top-1/2 -right-3 size-6 -translate-y-1/2 rounded-full bg-gray-100" }),
477
- /* @__PURE__ */ f("div", {
478
- className: "px-5 py-4",
479
- children: [
480
- /* @__PURE__ */ f("div", {
481
- className: "mb-4 flex items-start gap-3",
482
- children: [/* @__PURE__ */ d("div", {
483
- className: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-orange-100",
484
- children: /* @__PURE__ */ d(v, { className: "size-5 text-orange-600" })
485
- }), /* @__PURE__ */ d("div", {
486
- className: "min-w-0 flex-1",
487
- children: /* @__PURE__ */ d("p", {
488
- className: "font-semibold text-gray-900 leading-tight",
489
- children: X
490
- })
491
- })]
492
- }),
493
- s.qr_image?.location && /* @__PURE__ */ d("div", {
494
- className: "mb-4 flex flex-col items-center",
495
- children: /* @__PURE__ */ d("div", {
496
- className: "rounded-lg border border-gray-200 bg-white p-2",
497
- children: /* @__PURE__ */ d("img", {
498
- src: s.qr_image.location,
499
- alt: "Booking QR Code",
500
- className: "size-24"
501
- })
502
- })
503
- }),
504
- /* @__PURE__ */ f("div", {
505
- className: "mb-4 flex items-center justify-between rounded-lg bg-gray-50 px-3 py-2.5",
506
- children: [/* @__PURE__ */ d("span", {
507
- className: "font-medium text-gray-500 text-xs uppercase tracking-wide",
508
- children: "Booking ID"
509
- }), /* @__PURE__ */ d("span", {
510
- className: "font-mono font-semibold text-gray-900 text-sm",
511
- children: s._id
512
- })]
513
- }),
514
- /* @__PURE__ */ d("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
515
- /* @__PURE__ */ f("div", {
516
- className: "space-y-2.5",
517
- children: [!Y && Q && /* @__PURE__ */ f("div", {
518
- className: "flex items-center justify-between",
519
- children: [/* @__PURE__ */ f("div", {
520
- className: "flex items-center gap-2 text-gray-500 text-sm",
521
- children: [/* @__PURE__ */ d(p, { className: "size-4" }), /* @__PURE__ */ d("span", { children: "Date & Time" })]
522
- }), /* @__PURE__ */ f("p", {
523
- className: "font-medium text-gray-900 text-sm",
524
- children: [
525
- z(Q),
526
- ", ",
527
- B(Q)
528
- ]
529
- })]
530
- }), W.slice(0, 3).map(([e, t]) => /* @__PURE__ */ f("div", {
531
- className: "flex items-center justify-between",
532
- children: [/* @__PURE__ */ d("span", {
533
- className: "text-gray-500 text-sm",
534
- children: V(e)
535
- }), Array.isArray(t) ? /* @__PURE__ */ d(x, {
536
- items: t,
537
- textSizeClass: "text-sm"
538
- }) : /* @__PURE__ */ d("span", {
539
- className: "max-w-[50%] truncate font-medium text-gray-900 text-sm",
540
- children: H(t)
541
- })]
542
- }, e))]
543
- }),
544
- /* @__PURE__ */ d("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
545
- /* @__PURE__ */ f("div", {
546
- className: "flex items-center justify-between",
547
- children: [/* @__PURE__ */ d("span", {
548
- className: "font-medium text-gray-700",
549
- children: K ? "Total" : "Amount Paid"
550
- }), /* @__PURE__ */ d("span", {
551
- className: "font-bold text-gray-900 text-lg",
552
- children: K ? "Free" : R(s.total_amount, s.currency)
553
- })]
554
- }),
555
- (() => {
556
- let e = P?.invoice?.location || s.invoice?.location;
557
- return e ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { className: "my-4 border-gray-200 border-t border-dashed" }), /* @__PURE__ */ f("a", {
558
- href: e,
559
- target: "_blank",
560
- rel: "noopener noreferrer",
561
- className: "flex w-full items-center justify-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-2.5 font-medium text-gray-700 text-sm transition-colors hover:bg-gray-100",
562
- children: [/* @__PURE__ */ d(te, { className: "size-4" }), "Download Invoice"]
563
- })] }) : null;
564
- })()
565
- ]
566
- })
567
- ]
568
- }),
569
- C && /* @__PURE__ */ d("div", {
570
- className: "mx-auto mt-5 max-w-lg",
571
- children: /* @__PURE__ */ d(e, {
572
- elementKey: "booking-done-btn",
573
- onClick: C,
574
- className: "flex w-full items-center justify-center gap-2 rounded-lg bg-gray-900 px-4 py-3.5 font-semibold text-white transition-colors hover:bg-gray-800",
575
- children: "Done"
576
- })
577
- }),
578
- /* @__PURE__ */ d("p", {
579
- className: "mt-4 text-center text-gray-400 text-xs",
580
- children: "A confirmation has been sent to your email"
581
- })
582
- ]
583
- })]
584
- })
585
- ]
586
- }),
587
- M && S && /* @__PURE__ */ d("div", {
588
- className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
589
- children: /* @__PURE__ */ d("div", {
590
- className: "max-h-[90vh] w-full max-w-lg overflow-auto rounded-xl bg-white shadow-xl",
591
- children: /* @__PURE__ */ d(i, {
592
- isEdit: !0,
593
- prefillData: c || s.billing_details,
594
- onSubmit: (e) => {
595
- S(e), N(!1);
596
- },
597
- onClose: () => N(!1)
598
- })
599
- })
600
- }),
601
- D.element
602
- ] });
603
- };
604
- //#endregion
605
- export { S as BookingCard };
@@ -1,15 +0,0 @@
1
- import { assignInlineVars as e } from "@vanilla-extract/dynamic";
2
- //#region ../../libraries/levocn/dist/theme/utils/createThemeExtension.js
3
- var t = (e, n) => {
4
- let r = {};
5
- for (let i of Object.keys(n)) {
6
- let a = n[i], o = e[i];
7
- if (!(a === void 0 || o === void 0)) if (typeof a == "object" && a && !Array.isArray(a)) {
8
- let e = t(o, a);
9
- Object.assign(r, e);
10
- } else typeof o == "string" && (r[o] = String(a));
11
- }
12
- return r;
13
- }, n = (n) => (r) => r ? e(t(n, r)) : {};
14
- //#endregion
15
- export { n as t };