@levo-so/site-runtime 0.3.7 → 0.3.8

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 (37) hide show
  1. package/CollectionField-C-6a1ud4.js +270 -0
  2. package/{CollectionInput-B1qV4QEH.js → CollectionInput-BJ__qcbk.js} +40 -40
  3. package/DateTimeWidget-hFjcn3o6.js +255 -0
  4. package/{Dialog-DVB4WpBS.js → Dialog-dT7y641z.js} +43 -43
  5. package/{KBChatWidget-Cnq0DCOQ.js → KBChatWidget-ClHFDgJ5.js} +236 -236
  6. package/{LevoProvider-nmIbMlsk.js → LevoProvider-Bsjkcwc8.js} +8 -8
  7. package/PhoneWidget-BmBO-kvA.js +99 -0
  8. package/{Popover-C7zZHBIc.js → Popover-3N88sRp4.js} +20 -20
  9. package/{PopupBody-DZVwDLkg-yrot8Uqb.js → PopupBody-DZVwDLkg-Cfy3lWGs.js} +33 -33
  10. package/{PopupRenderer-BjW1jg70-Biwj2bIc.js → PopupRenderer-BjW1jg70-W2y-PEPH.js} +81 -81
  11. package/{RichTextWidget-BOrVIR2j.js → RichTextWidget-DkKHEq4j.js} +139 -139
  12. package/ThemeProvider-DutrjSTF.js +116 -0
  13. package/{Tooltip-BIgrpetu.js → Tooltip-CQB0LyxK.js} +20 -20
  14. package/{VerifyButton-CA1GtEZJ.js → VerifyButton-BUT70lgz.js} +65 -65
  15. package/dist-CRDgdAkQ.js +3631 -0
  16. package/{dist-Cb6sb7nO.js → dist-DPmVG7VB.js} +13 -13
  17. package/index.d.ts +560 -3
  18. package/index.js +1203 -713
  19. package/inlineBaseTheme-BB9e6h5f.js +9 -0
  20. package/{inlineCollectionTheme-DYYMrmcE.js → inlineCollectionTheme-CWcMCUti.js} +1 -1
  21. package/{kbChat-DIb4AS7E.js → kbChat-C00LVlxP.js} +27 -27
  22. package/{nodeAlignment-D70kOcui.js → nodeAlignment-BnJljFlw.js} +1 -1
  23. package/package.json +3 -3
  24. package/popups.js +1 -1
  25. package/{react-6kO0cqgr.js → react-CV3jf2mc.js} +1 -1
  26. package/styles.css +1 -1
  27. package/{generateRadiusScale-54mE9ikx.js → themeVars.cssm-ByhhC2Jm.js} +17 -17
  28. package/usePopupRedirect-BThP_YPW-COUseDik.js +80 -0
  29. package/CollectionField-C59pmeQw.js +0 -270
  30. package/DateTimeWidget-Cctsvcrs.js +0 -255
  31. package/PhoneWidget-J3VTMWJH.js +0 -99
  32. package/ThemeProvider-BQmIB5tr.js +0 -116
  33. package/dist-C8gLeklT.js +0 -3559
  34. package/inlineBaseTheme-B6E9zzyp.js +0 -9
  35. package/usePopupRedirect-BThP_YPW-DoixMAB9.js +0 -80
  36. /package/{createThemeExtension-DhGk81nV.js → createThemeExtension-4AUn51iJ.js} +0 -0
  37. /package/{theme.cssm-mkQwezuj.js → theme.cssm-DUzmx76l.js} +0 -0
package/index.js CHANGED
@@ -1,127 +1,127 @@
1
1
  "use client";
2
- import { i as e, n as t, r as n } from "./LevoProvider-nmIbMlsk.js";
3
- import { n as r } from "./dist-C8gLeklT.js";
4
- import { t as i } from "./inlineBaseTheme-B6E9zzyp.js";
5
- import { t as a } from "./inlineCollectionTheme-DYYMrmcE.js";
6
- import * as o from "react";
7
- import { Suspense as s, createContext as c, lazy as l, useCallback as u, useContext as d, useEffect as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g } from "react";
8
- import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
9
- import { createLevoClient as b, getLevoError as x } from "@levo-so/core";
10
- import { ScriptOnce as S, useRouterState as C } from "@tanstack/react-router";
11
- import { useQuery as w } from "@tanstack/react-query";
12
- import { Dialog as T } from "@base-ui/react/dialog";
13
- import { createLevoInsights as E } from "@levo-so/insights";
14
- import { CheckIcon as D, ChevronLeftIcon as O, ChevronRightIcon as k, LoaderCircle as A, Tag as ee, X as j, XIcon as te } from "lucide-react";
15
- import { useRazorpay as ne } from "react-razorpay";
16
- import { EmbeddedCheckout as re, EmbeddedCheckoutProvider as M } from "@stripe/react-stripe-js";
17
- //#region src/hooks/useMounted.ts
18
- function N() {
19
- let [e, t] = g(!1);
20
- return f(() => t(!0), []), e;
21
- }
22
- //#endregion
23
- //#region src/chat/LevoChat.tsx
24
- var P = l(() => import("./kbChat-DIb4AS7E.js")), ie = ({ site: e, path: t }) => {
25
- let n = N(), r = e.workspace_id || void 0;
26
- return !n || !r ? null : /* @__PURE__ */ v(s, {
27
- fallback: null,
28
- children: /* @__PURE__ */ v(P, {
29
- workspaceId: r,
30
- siteName: e.name || void 0,
31
- siteLogo: void 0,
32
- siteIcon: e.icon?.location,
33
- siteSlug: e.slug || void 0,
34
- showBranding: !!e.feature_flag?.branding,
35
- path: t
36
- })
37
- });
38
- }, F = (e) => {
2
+ import { n as e, r as t } from "./dist-CRDgdAkQ.js";
3
+ import { i as n, n as r, r as i } from "./LevoProvider-Bsjkcwc8.js";
4
+ import { t as a } from "./inlineCollectionTheme-CWcMCUti.js";
5
+ import { t as o } from "./inlineBaseTheme-BB9e6h5f.js";
6
+ import { createLevoClient as s, getLevoError as c } from "@levo-so/core";
7
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
8
+ import * as f from "react";
9
+ import { Suspense as p, createContext as m, lazy as h, useCallback as g, useContext as _, useEffect as v, useLayoutEffect as y, useMemo as b, useRef as x, useState as S } from "react";
10
+ import { Dialog as C } from "@base-ui/react/dialog";
11
+ import { useMutation as w, useQuery as T, useQueryClient as E } from "@tanstack/react-query";
12
+ import { ScriptOnce as D, useRouterState as O } from "@tanstack/react-router";
13
+ import { createLevoInsights as ee } from "@levo-so/insights";
14
+ import { CheckIcon as k, ChevronLeftIcon as te, ChevronRightIcon as A, LoaderCircle as ne, Tag as j, X as re, XIcon as M } from "lucide-react";
15
+ import { useRazorpay as N } from "react-razorpay";
16
+ import { EmbeddedCheckout as P, EmbeddedCheckoutProvider as ie } from "@stripe/react-stripe-js";
17
+ //#region src/access/types.ts
18
+ var F = [
19
+ "otp",
20
+ "magiclink",
21
+ "whatsapp"
22
+ ], I = [
23
+ "google",
24
+ "microsoft",
25
+ "linkedin"
26
+ ], L = [...F, ...I], ae = "otp", R = (e) => typeof e == "object" && !!e && !Array.isArray(e), z = (e) => F.includes(e), oe = (e) => I.includes(e), B = (e) => Array.isArray(e) ? e.filter((e) => typeof e == "string") : [], V = (e) => e, se = (e) => {
27
+ if (!R(e)) return null;
28
+ let t = e.enabled === void 0 ? !0 : e.enabled === !0, n = R(e.options) ? e.options : {};
29
+ switch (e.kind) {
30
+ case "authentication": return {
31
+ kind: "authentication",
32
+ enabled: t,
33
+ options: {
34
+ methods: B(n.methods).filter((e) => z(e) || oe(e)),
35
+ ...z(n.primary_method) ? { primary_method: n.primary_method } : {}
36
+ }
37
+ };
38
+ case "gating": return typeof n.collection != "string" || !n.collection.trim() ? null : {
39
+ kind: "gating",
40
+ enabled: t,
41
+ options: {
42
+ collection: n.collection.trim(),
43
+ ...R(n.condition) ? { condition: V(n.condition) } : {},
44
+ hidden: B(n.hidden)
45
+ }
46
+ };
47
+ case "profile": return {
48
+ kind: "profile",
49
+ enabled: t,
50
+ options: {
51
+ ...R(n.condition) ? { condition: V(n.condition) } : {},
52
+ hidden: B(n.hidden)
53
+ }
54
+ };
55
+ default: return null;
56
+ }
57
+ }, H = (e) => {
58
+ if (!Array.isArray(e) || e.length === 0) return {
59
+ rules: [],
60
+ invalid: !1
61
+ };
62
+ let t = e.map(se).filter((e) => e !== null);
63
+ return {
64
+ rules: t.filter((e) => e.enabled !== !1),
65
+ invalid: t.length === 0
66
+ };
67
+ }, U = (e) => {
68
+ let t = e.find((e) => e.kind === "authentication"), n = t?.kind === "authentication" ? t.options?.methods ?? [] : [];
69
+ return {
70
+ primary: (t?.kind === "authentication" ? t.options?.primary_method : void 0) ?? n.find(z) ?? ae,
71
+ oauth: n.filter(oe)
72
+ };
73
+ }, W = (e = null) => ({
74
+ state: "granted",
75
+ code: e,
76
+ message: null,
77
+ rule: null
78
+ }), ce = () => ({
79
+ state: "checking",
80
+ code: null,
81
+ message: null,
82
+ rule: null
83
+ }), G = (e, t, n = null) => ({
84
+ state: "blocked",
85
+ code: e,
86
+ message: t,
87
+ rule: n
88
+ }), le = (e, t) => {
89
+ let n = t?.split(".")[0];
90
+ return e.find((e) => e.kind === n) ?? null;
91
+ }, K = ({ rules: e, invalid: t, pageId: n, hasClient: r, isReady: i, isLoggedIn: a, check: o }) => e.length === 0 && !t ? W() : t ? G("access.CONFIG_INVALID", "This page's access rules could not be read.") : i ? r ? a ? n ? o.isError ? G("access.CHECK_FAILED", "We could not verify your access.") : o.isSuccess ? o.data ? o.data.has_access ? W(o.data.code ?? null) : G(o.data.code ?? "access.CHECK_FAILED", o.data.message ?? null, le(e, o.data.code)) : G("access.CHECK_FAILED", "We could not verify your access.") : ce() : G("access.PAGE_NOT_IDENTIFIED", "This page is not linked to its access rules yet.") : G("authentication.NOT_LOGGED_IN", "You need to be signed in to view this page.", e.find((e) => e.kind === "authentication") ?? e[0] ?? null) : G("access.UNWIRED", "This site is not connected to an account system.") : ce(), ue = (e) => {
39
92
  let t = (e?.apiUrl || "").replace(/\/$/, "");
40
- return t ? b({
93
+ return t ? s({
41
94
  apiUrl: t,
42
95
  workspace: e?.workspace ? e.workspace : null,
43
96
  appName: "studio-site",
44
97
  NODE_ENV: "",
45
98
  APP_MODE: e?.appMode || "production"
46
99
  }) : null;
47
- }, I = (e) => ({
100
+ }, q = (e) => ({
48
101
  apiUrl: e.levo?.api_url || "",
49
102
  workspace: e.workspace_id || "",
50
103
  siteId: e.id || "",
51
104
  insightsUrl: e.levo?.insights_url || null,
52
105
  appMode: e.levo?.app_mode || "production"
53
- }), L = "(prefers-color-scheme: dark)", ae = (e) => {
54
- try {
55
- let t = localStorage.getItem(e);
56
- return t === "light" || t === "dark" || t === "system" ? t : null;
57
- } catch {
58
- return null;
59
- }
60
- }, oe = (e, t) => {
61
- try {
62
- localStorage.setItem(e, t);
63
- } catch {}
64
- };
65
- function se(e, t) {
66
- return `(function(){try{var t=localStorage.getItem(${JSON.stringify(e)});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${JSON.stringify(t)}}var d=matchMedia('${L}').matches;var r=t==='system'?(d?'dark':'light'):t;var e=document.documentElement;e.classList.remove('light','dark');e.classList.add(r);e.style.colorScheme=r}catch(e){}})();`;
67
- }
68
- var R = c(void 0), z = (e) => e === "system" ? window.matchMedia(L).matches ? "dark" : "light" : e;
69
- function B(e) {
70
- let t = document.documentElement;
71
- t.classList.remove("light", "dark"), t.classList.add(e), t.style.colorScheme = e;
72
- }
73
- var ce = ({ children: e, defaultMode: t = "system", storageKey: n = "color-mode" }) => {
74
- let [r, i] = g(t), [a, o] = g(t === "dark" ? "dark" : "light"), s = N();
75
- return f(() => {
76
- i(ae(n) ?? t);
77
- }, [t, n]), f(() => {
78
- if (!s) return;
79
- let e = z(r);
80
- B(e), o(e);
81
- }, [r, s]), f(() => {
82
- if (!s || r !== "system") return;
83
- let e = window.matchMedia(L), t = () => {
84
- let t = e.matches ? "dark" : "light";
85
- B(t), o(t);
86
- };
87
- return e.addEventListener("change", t), () => e.removeEventListener("change", t);
88
- }, [r, s]), /* @__PURE__ */ y(R.Provider, {
89
- value: {
90
- mode: r,
91
- resolvedMode: a,
92
- setMode: (e) => {
93
- oe(n, e), i(e);
94
- }
95
- },
96
- children: [/* @__PURE__ */ v(S, { children: se(n, t) }), e]
97
- });
98
- };
99
- function V() {
100
- let e = d(R);
101
- if (e === void 0) throw Error("useColorMode must be used within a ColorModeProvider");
102
- return e;
103
- }
104
- //#endregion
105
- //#region src/data/index.ts
106
- var H = (e) => [
106
+ }), de = (e) => [
107
107
  "levo-source",
108
108
  "list",
109
109
  e.module,
110
110
  e.identifier,
111
111
  e.query ?? null,
112
112
  e.options ?? null
113
- ], U = (e, t) => [
113
+ ], fe = (e, t) => [
114
114
  "levo-source",
115
115
  "record",
116
116
  e.module,
117
117
  e.identifier,
118
118
  t ?? null
119
- ], W = (e) => [
119
+ ], pe = (e) => [
120
120
  "levo-source",
121
121
  "form",
122
122
  e.module,
123
123
  e.identifier
124
- ], G = async (e, t) => {
124
+ ], me = async (e, t) => {
125
125
  let n = t.module === "collection" ? await e.collection.getCollectionContentList({
126
126
  collection_key: t.identifier,
127
127
  ...t.query ?? {}
@@ -130,76 +130,76 @@ var H = (e) => [
130
130
  data: n.content.data ?? [],
131
131
  meta: n.content.meta ?? null
132
132
  };
133
- }, le = async (e, t, n) => (t.module === "collection" ? await e.collection.getCollectionContent({
133
+ }, he = async (e, t, n) => (t.module === "collection" ? await e.collection.getCollectionContent({
134
134
  collection_key: t.identifier,
135
135
  slug: n
136
- }) : t.module === "blog" ? await e.blog.getSingleBlog(t.identifier, n) : await e.event.getSingleEvent(n)).content.data ?? null, K = async (e, t) => (await e.collection.getCollectionByIDExpanded(t.identifier)).content.data ?? null, ue = (e) => {
137
- let t = n(), r = w({
138
- queryKey: H(e),
139
- queryFn: () => G(t, e),
136
+ }) : t.module === "blog" ? await e.blog.getSingleBlog(t.identifier, n) : await e.event.getSingleEvent(n)).content.data ?? null, ge = async (e, t) => (await e.collection.getCollectionByIDExpanded(t.identifier)).content.data ?? null, _e = (e) => {
137
+ let t = i(), n = T({
138
+ queryKey: de(e),
139
+ queryFn: () => me(t, e),
140
140
  enabled: !!t
141
141
  });
142
142
  return {
143
- data: r.data?.data ?? null,
144
- meta: r.data?.meta ?? null,
145
- isLoading: r.isLoading,
146
- error: r.error ? x(r.error).message : null,
143
+ data: n.data?.data ?? null,
144
+ meta: n.data?.meta ?? null,
145
+ isLoading: n.isLoading,
146
+ error: n.error ? c(n.error).message : null,
147
147
  bind: { "data-levo-source": JSON.stringify({
148
148
  mode: "list",
149
149
  ...e
150
150
  }) }
151
151
  };
152
- }, de = (e, t) => {
153
- let r = n(), i = w({
154
- queryKey: U(e, t),
155
- queryFn: () => le(r, e, t),
156
- enabled: !!r && !!t
152
+ }, ve = (e, t) => {
153
+ let n = i(), r = T({
154
+ queryKey: fe(e, t),
155
+ queryFn: () => he(n, e, t),
156
+ enabled: !!n && !!t
157
157
  });
158
158
  return {
159
- data: i.data ?? null,
160
- isLoading: i.isLoading,
161
- error: i.error ? x(i.error).message : null,
159
+ data: r.data ?? null,
160
+ isLoading: r.isLoading,
161
+ error: r.error ? c(r.error).message : null,
162
162
  bind: { "data-levo-source": JSON.stringify({
163
163
  mode: "record",
164
164
  ...e
165
165
  }) }
166
166
  };
167
- }, fe = (e) => {
168
- let t = n(), r = w({
169
- queryKey: W(e),
170
- queryFn: () => K(t, e),
167
+ }, ye = (e) => {
168
+ let t = i(), n = T({
169
+ queryKey: pe(e),
170
+ queryFn: () => ge(t, e),
171
171
  enabled: !!t
172
172
  });
173
173
  return {
174
- schema: r.data ?? null,
175
- isLoading: r.isLoading,
176
- error: r.error ? x(r.error).message : null,
174
+ schema: n.data ?? null,
175
+ isLoading: n.isLoading,
176
+ error: n.error ? c(n.error).message : null,
177
177
  bind: { "data-levo-source": JSON.stringify({
178
178
  mode: "form",
179
179
  ...e
180
180
  }) }
181
181
  };
182
- }, pe = async ({ queryClient: e, config: t, sources: n, params: r }) => {
183
- let i = F(t);
182
+ }, be = async ({ queryClient: e, config: t, sources: n, params: r }) => {
183
+ let i = ue(t);
184
184
  if (!i || !n) return {};
185
185
  let a = await Promise.all(Object.entries(n).map(async ([t, n]) => {
186
186
  if (n.mode === "record") {
187
187
  let a = r?.slug;
188
188
  return a ? [t, await e.ensureQueryData({
189
- queryKey: U(n, a),
190
- queryFn: () => le(i, n, a)
189
+ queryKey: fe(n, a),
190
+ queryFn: () => he(i, n, a)
191
191
  }).catch(() => null)] : [t, null];
192
192
  }
193
193
  return n.mode === "form" ? [t, await e.ensureQueryData({
194
- queryKey: W(n),
195
- queryFn: () => K(i, n)
194
+ queryKey: pe(n),
195
+ queryFn: () => ge(i, n)
196
196
  }).catch(() => null)] : [t, await e.ensureQueryData({
197
- queryKey: H(n),
198
- queryFn: () => G(i, n)
197
+ queryKey: de(n),
198
+ queryFn: () => me(i, n)
199
199
  }).catch(() => null)];
200
200
  }));
201
201
  return Object.fromEntries(a);
202
- }, me = {
202
+ }, xe = {
203
203
  background: "var(--color-page)",
204
204
  foreground: "var(--color-ink)",
205
205
  text: "var(--color-ink)",
@@ -221,63 +221,550 @@ var H = (e) => [
221
221
  input: "var(--color-background1)",
222
222
  inputForeground: "var(--color-ink)",
223
223
  ring: "var(--color-brand)"
224
- }, he = ({ source: e, submitLabel: t = "Submit", hiddenFields: o, formVariant: s = "default", successConfig: c, theme: l, className: u }) => {
225
- let d = n(), { schema: f, isLoading: p, bind: h } = fe(e), g = m(() => ({
226
- ...i({
227
- colors: {
228
- ...me,
229
- ...l?.colors
224
+ }, Se = (e) => b(() => ({
225
+ ...o({
226
+ colors: {
227
+ ...xe,
228
+ ...e?.colors
229
+ },
230
+ radius: e?.radius ?? "var(--radius-token)",
231
+ fonts: {
232
+ body: "var(--font-body)",
233
+ heading: "var(--font-heading)"
234
+ }
235
+ }),
236
+ ...e?.gap ? a({ form: { gap: e.gap } }) : {}
237
+ }), [e]);
238
+ //#endregion
239
+ //#region src/hooks/useMounted.ts
240
+ function J() {
241
+ let [e, t] = S(!1);
242
+ return v(() => t(!0), []), e;
243
+ }
244
+ //#endregion
245
+ //#region src/access/useLevoAuth.ts
246
+ var Y = ["levo-auth", "session"], Ce = () => {
247
+ let e = i(), t = E(), n = J(), r = T({
248
+ queryKey: Y,
249
+ queryFn: async () => {
250
+ try {
251
+ return await e?.membership?.getMe() ?? null;
252
+ } catch (t) {
253
+ return e?.logger?.debug?.("Session check returned no account", { exception: c(t) }), null;
254
+ }
255
+ },
256
+ enabled: n && !!e,
257
+ staleTime: 3e4,
258
+ retry: !1
259
+ }), a = w({
260
+ mutationFn: async () => {
261
+ await e?.membership?.signOut();
262
+ },
263
+ onSettled: () => t.invalidateQueries({ queryKey: Y }),
264
+ onError: (t) => {
265
+ e?.logger?.error("Sign out failed", { exception: c(t) });
266
+ }
267
+ }), o = g(async () => {
268
+ await t.invalidateQueries({ queryKey: Y });
269
+ }, [t]), s = g(async () => {
270
+ await a.mutateAsync().catch(() => void 0);
271
+ }, [a]), l = r.data ?? null;
272
+ return {
273
+ account: l,
274
+ isLoggedIn: !!l,
275
+ isLoaded: n && (!e || r.isSuccess),
276
+ isLoading: r.isFetching,
277
+ refresh: o,
278
+ signOut: s,
279
+ isSigningOut: a.isPending
280
+ };
281
+ }, we = ({ collection: t, hidden: n, submitLabel: r = "Submit", onSuccess: a, theme: o, className: s }) => {
282
+ let c = i(), { account: l } = Ce(), { schema: d, isLoading: f } = ye({
283
+ module: "collection",
284
+ identifier: t
285
+ }), p = Se(o);
286
+ return c ? /* @__PURE__ */ u("div", {
287
+ className: s,
288
+ children: /* @__PURE__ */ u(e, {
289
+ fetchedSchema: d,
290
+ isLoading: f,
291
+ submitButtonConfig: {
292
+ show: !0,
293
+ text: r
230
294
  },
231
- radius: l?.radius ?? "var(--radius-token)",
232
- fonts: {
233
- body: "var(--font-body)",
234
- heading: "var(--font-heading)"
295
+ uiConfig: {
296
+ hideFormHeading: !0,
297
+ hideSectionHeadings: !0
298
+ },
299
+ theme: { style: p },
300
+ hiddenFields: n,
301
+ isLoggedIn: !!l,
302
+ account: {
303
+ email: l?.email,
304
+ mobile: l?.mobile
305
+ },
306
+ onSuccess: () => a?.()
307
+ })
308
+ }) : null;
309
+ }, Te = "so_levo_membership_account", Ee = [
310
+ "profile_picture",
311
+ "first_name",
312
+ "last_name",
313
+ "email",
314
+ "username",
315
+ "socials"
316
+ ], De = ["email", "username"], Oe = (e) => Ee.includes(e.key) || e.editable === !0, ke = ({ hidden: e, submitLabel: n = "Save and continue", onSuccess: r, errorClassName: a = "text-sm text-[var(--color-danger)]", theme: o, className: s }) => {
317
+ let l = i(), f = J(), { account: p } = Ce(), m = Se(o), [h, g] = S(""), _ = T({
318
+ queryKey: ["levo-access", "profile-schema"],
319
+ queryFn: async () => (await l?.collection?.getCollectionByIDExpanded(Te))?.content?.data ?? null,
320
+ enabled: f && !!l,
321
+ staleTime: 5 * 6e4,
322
+ retry: 1
323
+ }), v = e?.join("|") ?? "", y = b(() => {
324
+ let t = _.data;
325
+ return t ? {
326
+ ...t,
327
+ sections: t.sections?.map((t) => ({
328
+ ...t,
329
+ fields: t.fields?.map((t) => ({
330
+ ...t,
331
+ hidden: !Oe(t) || !!e?.includes(t.key),
332
+ readonly: t.readonly || De.includes(t.key)
333
+ }))
334
+ }))
335
+ } : null;
336
+ }, [_.data, v]), x = w({
337
+ mutationFn: async (t) => {
338
+ let n = y?.sections?.flatMap((e) => e?.fields ?? [])?.filter((t) => Oe(t) && !De.includes(t.key) && !e?.includes(t.key))?.map((e) => e?.key) ?? [];
339
+ await l?.membership?.updateMe(Object.fromEntries(Object.entries(t).filter(([e]) => n.includes(e))));
340
+ },
341
+ onMutate: () => g(""),
342
+ onSuccess: () => r?.(),
343
+ onError: (e) => {
344
+ let t = c(e);
345
+ l?.logger?.error("Failed to update profile", { exception: t }), g(t?.message || "Something went wrong. Please try again.");
346
+ }
347
+ });
348
+ return l ? /* @__PURE__ */ d("div", {
349
+ className: s,
350
+ children: [h ? /* @__PURE__ */ u("p", {
351
+ className: a,
352
+ children: h
353
+ }) : null, y ? /* @__PURE__ */ u(t, {
354
+ schema: y,
355
+ initialValues: p ?? {},
356
+ uiConfig: {
357
+ hideFormHeading: !0,
358
+ hideSectionHeadings: !0
359
+ },
360
+ submitButtonConfig: {
361
+ show: !0,
362
+ text: n
363
+ },
364
+ theme: { style: m },
365
+ isLoading: x.isPending,
366
+ onSubmit: (e) => x.mutate(e)
367
+ }) : null]
368
+ }) : null;
369
+ }, Ae = (e) => {
370
+ let t = i(), n = E(), r = J(), { isLoggedIn: a, isLoaded: o } = Ce(), s = e.id?.trim() || "", { rules: l, invalid: u } = b(() => H(e.access), [e.access]), d = b(() => U(l), [l]), f = r && !!t && l.length > 0 && !u && !!s && a, p = T({
371
+ queryKey: ["levo-access", s],
372
+ queryFn: async () => (await t?.fetch.url(`/v1/builder/page/${s}/check-access`).post().json())?.content?.data ?? null,
373
+ enabled: f,
374
+ staleTime: 0,
375
+ retry: 1
376
+ });
377
+ v(() => {
378
+ p.isError && t?.logger?.error("Page access check failed", { exception: c(p.error) });
379
+ }, [
380
+ p.isError,
381
+ p.error,
382
+ t
383
+ ]);
384
+ let m = g(() => {
385
+ n.invalidateQueries({ queryKey: Y }), n.invalidateQueries({ queryKey: ["levo-access", s] });
386
+ }, [n, s]);
387
+ return {
388
+ ...K({
389
+ rules: l,
390
+ invalid: u,
391
+ pageId: s,
392
+ hasClient: !!t,
393
+ isReady: r && o,
394
+ isLoggedIn: a,
395
+ check: {
396
+ isError: p.isError,
397
+ isSuccess: p.isSuccess,
398
+ data: p.data ?? null
235
399
  }
236
400
  }),
237
- ...l?.gap ? a({ form: { gap: l.gap } }) : {}
238
- }), [l]);
239
- return d ? /* @__PURE__ */ v("div", {
240
- ...h,
241
- className: u,
242
- children: /* @__PURE__ */ v(r, {
243
- fetchedSchema: f,
244
- isLoading: p,
401
+ authMethods: d,
402
+ recheck: m,
403
+ isChecking: p.isFetching
404
+ };
405
+ }, je = "membership.account.ACCOUNT_PENDING_APPROVAL", Me = (e) => e ? e === "membership.account.ACCOUNT_PENDING_APPROVAL" || e.includes("ACCOUNT_PENDING_APPROVAL") : !1, Ne = (e) => {
406
+ let t = c(e);
407
+ return {
408
+ code: t?.code || "SOMETHING_WENT_WRONG",
409
+ title: t?.title || "Something went wrong",
410
+ message: t?.message || "Something went wrong. Please try again.",
411
+ fieldErrors: Object.fromEntries((t?.fieldErrors ?? []).map((e) => [e.param, e.message])),
412
+ isPendingApproval: Me(t?.code)
413
+ };
414
+ }, Pe = {
415
+ code: "site.NOT_CONNECTED",
416
+ title: "Sign-in unavailable",
417
+ message: "This site is not connected to an account system yet.",
418
+ fieldErrors: {},
419
+ isPendingApproval: !1
420
+ }, Fe = () => {
421
+ let e = i(), t = E(), n = g(async (t, n) => {
422
+ if (!e?.membership) return {
423
+ ok: !1,
424
+ error: Pe
425
+ };
426
+ try {
427
+ return {
428
+ ok: !0,
429
+ data: await n()
430
+ };
431
+ } catch (n) {
432
+ let r = c(n);
433
+ return e.logger?.error(t, { exception: r }), {
434
+ ok: !1,
435
+ error: Ne(r)
436
+ };
437
+ }
438
+ }, [e]), r = g(async ({ identifier: t, medium: n }) => {
439
+ await e?.membership?.requestOtp({
440
+ content: t,
441
+ ...n === "whatsapp" ? { medium: "whatsapp" } : {}
442
+ });
443
+ }, [e]), a = w({ mutationFn: (e) => n("Failed to send verification code", () => r(e)) }), o = w({ mutationFn: (e) => n("Failed to resend verification code", () => r(e)) }), s = w({ mutationFn: ({ identifier: r, code: i }) => n("Verification failed", async () => {
444
+ let n = await e?.membership?.signInWithOtp({
445
+ content: r,
446
+ code: i
447
+ }) ?? null;
448
+ return t.setQueryData(Y, n), t.invalidateQueries({ queryKey: Y }), n;
449
+ }) }), l = w({ mutationFn: (t) => n("Failed to send magic link", async () => {
450
+ await e?.membership?.requestMagicLink({ content: t });
451
+ }) });
452
+ return {
453
+ sendCode: (e) => a.mutateAsync(e),
454
+ resendCode: (e) => o.mutateAsync(e),
455
+ verifyCode: (e) => s.mutateAsync(e),
456
+ sendMagicLink: (e) => l.mutateAsync(e),
457
+ isSendingCode: a.isPending,
458
+ isResendingCode: o.isPending,
459
+ isVerifying: s.isPending,
460
+ isSendingMagicLink: l.isPending
461
+ };
462
+ }, Ie = 700, Le = 500, Re = 700, ze = (e, t) => {
463
+ let n = window.screenX + (window.outerWidth - Le) / 2, r = window.screenY + (window.outerHeight - Re) / 2.5;
464
+ return window.open(e, t, `width=${Le},height=${Re},left=${n},top=${r}`);
465
+ }, Be = ({ methods: e, title: t = "Sign in", onSuccess: n, onError: r }) => {
466
+ let a = i(), o = E(), s = J(), [l, u] = S(null), [d, f] = S(null), p = x(null), m = x(void 0), h = x({
467
+ onSuccess: n,
468
+ onError: r
469
+ });
470
+ h.current = {
471
+ onSuccess: n,
472
+ onError: r
473
+ };
474
+ let _ = T({
475
+ queryKey: ["levo-auth", "oauth-urls"],
476
+ queryFn: async () => await a?.membership?.getOAuthURL() ?? null,
477
+ enabled: s && !!a && e.length > 0,
478
+ staleTime: 5 * 6e4,
479
+ retry: !1
480
+ });
481
+ v(() => {
482
+ if (!_.error) return;
483
+ let e = c(_.error);
484
+ a?.logger?.error("Failed to load OAuth URLs", { exception: e }), f({
485
+ code: e?.code || "SOMETHING_WENT_WRONG",
486
+ title: e?.title || "Sign-in unavailable",
487
+ message: e?.message || "We could not connect to the sign-in service.",
488
+ fieldErrors: {},
489
+ isPendingApproval: !1
490
+ });
491
+ }, [_.error, a]);
492
+ let y = g(() => {
493
+ window.clearInterval(m.current), m.current = void 0, p.current?.close(), p.current = null, u(null);
494
+ }, []);
495
+ v(() => () => {
496
+ window.clearInterval(m.current), p.current?.close();
497
+ }, []);
498
+ let C = g(() => {
499
+ window.clearInterval(m.current), m.current = window.setInterval(() => {
500
+ let e = p.current;
501
+ if (!e || e.closed) {
502
+ y();
503
+ return;
504
+ }
505
+ let t;
506
+ try {
507
+ t = new URL(e.location.href).searchParams;
508
+ } catch {
509
+ return;
510
+ }
511
+ let n = t.get("code");
512
+ if (!n) return;
513
+ if (y(), n.toLowerCase() === "success") {
514
+ f(null), o.invalidateQueries({ queryKey: Y }), h.current.onSuccess?.();
515
+ return;
516
+ }
517
+ let r = {
518
+ code: t.get("code") || "SOMETHING_WENT_WRONG",
519
+ title: t.get("title") || "Sign-in failed",
520
+ message: t.get("message") || "We could not sign you in. Please try again.",
521
+ fieldErrors: {},
522
+ isPendingApproval: Me(t.get("code"))
523
+ };
524
+ r.isPendingApproval || f(r), h.current.onError?.(r);
525
+ }, Ie);
526
+ }, [o, y]), w = b(() => {
527
+ let e = _.data;
528
+ if (!e || typeof window > "u") return {};
529
+ let t = window.location.href, n = a?.pageContext;
530
+ return Object.fromEntries(Object.entries(e).flatMap(([e, r]) => {
531
+ if (typeof r != "string" || !r) return [];
532
+ try {
533
+ let i = new URL(r);
534
+ return i.searchParams.set("redirect_uri", t), n && i.searchParams.set("page_context", JSON.stringify(n)), [[e, i.toString()]];
535
+ } catch {
536
+ return [];
537
+ }
538
+ }));
539
+ }, [_.data, a]);
540
+ return {
541
+ providers: b(() => e.filter((e) => !!w[e]).map((e) => ({
542
+ provider: e,
543
+ signIn: () => {
544
+ let n = w[e];
545
+ if (n) {
546
+ if (f(null), p.current?.close(), p.current = ze(n, t), !p.current) {
547
+ f({
548
+ code: "POPUP_BLOCKED",
549
+ title: "Popup blocked",
550
+ message: "Allow popups for this site, then try again.",
551
+ fieldErrors: {},
552
+ isPendingApproval: !1
553
+ });
554
+ return;
555
+ }
556
+ u(e), C();
557
+ }
558
+ }
559
+ })), [
560
+ e,
561
+ w,
562
+ t,
563
+ C
564
+ ]),
565
+ isLoading: _.isFetching,
566
+ pendingProvider: l,
567
+ error: d,
568
+ clearError: g(() => f(null), [])
569
+ };
570
+ }, Ve = 4, He = (e) => /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(e.trim()), Ue = (e) => RegExp("^\\d{4}$").test(e.trim()), We = (e) => {
571
+ let t = e.replace(/\D/g, "").replace(/^0+/, "");
572
+ return t ? `+${t}` : "";
573
+ }, Ge = (e) => /^\+[1-9]\d{7,14}$/.test(We(e)), Ke = ({ value: e, onChange: t, length: n = 4, onComplete: r, autoFocus: i, disabled: a }) => {
574
+ let o = x([]), [s, c] = S(null), l = x(r);
575
+ l.current = r;
576
+ let u = Array.from({ length: n }, (t, n) => e[n] ?? ""), d = g((e) => {
577
+ let t = Math.max(0, Math.min(n - 1, e)), r = o.current[t];
578
+ r?.focus(), r?.select();
579
+ }, [n]);
580
+ v(() => {
581
+ i && !a && d(0);
582
+ }, [
583
+ i,
584
+ a,
585
+ d
586
+ ]);
587
+ let f = g((e, r) => {
588
+ let i = e.slice(0, n);
589
+ t(i), d(r), i.length === n && l.current?.(i);
590
+ }, [
591
+ n,
592
+ t,
593
+ d
594
+ ]), p = (t, r) => {
595
+ let i = r.replace(/\D/g, "");
596
+ if (!i) return;
597
+ if (i.length > 1) {
598
+ let r = (e.slice(0, t) + i).slice(0, n);
599
+ f(r, r.length);
600
+ return;
601
+ }
602
+ let a = [...u];
603
+ a[t] = i, f(a.join("").slice(0, Math.max(t + 1, e.length)), t + 1);
604
+ }, m = (t, n) => {
605
+ if (n.key === "Backspace") {
606
+ n.preventDefault();
607
+ let r = u[t] ? t : t - 1;
608
+ if (r < 0) return;
609
+ f(e.slice(0, r), r);
610
+ return;
611
+ }
612
+ if (n.key === "ArrowLeft") {
613
+ n.preventDefault(), d(t - 1);
614
+ return;
615
+ }
616
+ n.key === "ArrowRight" && (n.preventDefault(), d(Math.min(t + 1, e.length)));
617
+ }, h = (e) => {
618
+ e.preventDefault();
619
+ let t = e.clipboardData.getData("text").replace(/\D/g, "");
620
+ if (!t) return;
621
+ let r = t.slice(0, n);
622
+ f(r, r.length);
623
+ };
624
+ return {
625
+ slots: u.map((t, r) => ({
626
+ char: t,
627
+ isActive: s === r,
628
+ inputProps: {
629
+ ref: (e) => {
630
+ o.current[r] = e;
631
+ },
632
+ value: t,
633
+ inputMode: "numeric",
634
+ autoComplete: r === 0 ? "one-time-code" : "off",
635
+ type: "text",
636
+ "aria-label": `Digit ${r + 1} of ${n}`,
637
+ onChange: (e) => p(r, e.target.value),
638
+ onKeyDown: (e) => m(r, e),
639
+ onPaste: h,
640
+ onFocus: () => {
641
+ if (r > e.length) {
642
+ d(e.length);
643
+ return;
644
+ }
645
+ c(r);
646
+ },
647
+ onBlur: () => c((e) => e === r ? null : e),
648
+ disabled: a
649
+ }
650
+ })),
651
+ containerProps: {
652
+ role: "group",
653
+ "aria-label": `${n}-digit verification code`
654
+ },
655
+ clear: g(() => f("", 0), [f])
656
+ };
657
+ }, qe = h(() => import("./kbChat-C00LVlxP.js")), Je = ({ site: e, path: t }) => {
658
+ let n = J(), r = e.workspace_id || void 0;
659
+ return !n || !r ? null : /* @__PURE__ */ u(p, {
660
+ fallback: null,
661
+ children: /* @__PURE__ */ u(qe, {
662
+ workspaceId: r,
663
+ siteName: e.name || void 0,
664
+ siteLogo: void 0,
665
+ siteIcon: e.icon?.location,
666
+ siteSlug: e.slug || void 0,
667
+ showBranding: !!e.feature_flag?.branding,
668
+ path: t
669
+ })
670
+ });
671
+ }, Ye = "(prefers-color-scheme: dark)", Xe = (e) => {
672
+ try {
673
+ let t = localStorage.getItem(e);
674
+ return t === "light" || t === "dark" || t === "system" ? t : null;
675
+ } catch {
676
+ return null;
677
+ }
678
+ }, Ze = (e, t) => {
679
+ try {
680
+ localStorage.setItem(e, t);
681
+ } catch {}
682
+ };
683
+ function Qe(e, t) {
684
+ return `(function(){try{var t=localStorage.getItem(${JSON.stringify(e)});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${JSON.stringify(t)}}var d=matchMedia('${Ye}').matches;var r=t==='system'?(d?'dark':'light'):t;var e=document.documentElement;e.classList.remove('light','dark');e.classList.add(r);e.style.colorScheme=r}catch(e){}})();`;
685
+ }
686
+ var $e = m(void 0), et = (e) => e === "system" ? window.matchMedia(Ye).matches ? "dark" : "light" : e;
687
+ function tt(e) {
688
+ let t = document.documentElement;
689
+ t.classList.remove("light", "dark"), t.classList.add(e), t.style.colorScheme = e;
690
+ }
691
+ var nt = ({ children: e, defaultMode: t = "system", storageKey: n = "color-mode" }) => {
692
+ let [r, i] = S(t), [a, o] = S(t === "dark" ? "dark" : "light"), s = J();
693
+ return v(() => {
694
+ i(Xe(n) ?? t);
695
+ }, [t, n]), v(() => {
696
+ if (!s) return;
697
+ let e = et(r);
698
+ tt(e), o(e);
699
+ }, [r, s]), v(() => {
700
+ if (!s || r !== "system") return;
701
+ let e = window.matchMedia(Ye), t = () => {
702
+ let t = e.matches ? "dark" : "light";
703
+ tt(t), o(t);
704
+ };
705
+ return e.addEventListener("change", t), () => e.removeEventListener("change", t);
706
+ }, [r, s]), /* @__PURE__ */ d($e.Provider, {
707
+ value: {
708
+ mode: r,
709
+ resolvedMode: a,
710
+ setMode: (e) => {
711
+ Ze(n, e), i(e);
712
+ }
713
+ },
714
+ children: [/* @__PURE__ */ u(D, { children: Qe(n, t) }), e]
715
+ });
716
+ };
717
+ function rt() {
718
+ let e = _($e);
719
+ if (e === void 0) throw Error("useColorMode must be used within a ColorModeProvider");
720
+ return e;
721
+ }
722
+ //#endregion
723
+ //#region src/form/LevoForm.tsx
724
+ var it = ({ source: t, submitLabel: n = "Submit", hiddenFields: r, formVariant: a = "default", successConfig: o, theme: s, className: c }) => {
725
+ let l = i(), { schema: d, isLoading: f, bind: p } = ye(t), m = Se(s);
726
+ return l ? /* @__PURE__ */ u("div", {
727
+ ...p,
728
+ className: c,
729
+ children: /* @__PURE__ */ u(e, {
730
+ fetchedSchema: d,
731
+ isLoading: f,
245
732
  submitButtonConfig: {
246
733
  show: !0,
247
- text: t
734
+ text: n
248
735
  },
249
736
  uiConfig: {
250
737
  hideFormHeading: !0,
251
738
  hideSectionHeadings: !0
252
739
  },
253
- theme: { style: g },
254
- hiddenFields: o,
255
- formVariant: s,
256
- successConfig: c
740
+ theme: { style: m },
741
+ hiddenFields: r,
742
+ formVariant: a,
743
+ successConfig: o
257
744
  })
258
745
  }) : null;
259
- }, ge = 1400, _e = 12 * 1024 * 1024, ve = new Set(["transparent", "rgba(0, 0, 0, 0)"]), ye = {
746
+ }, at = 1400, ot = 12 * 1024 * 1024, st = new Set(["transparent", "rgba(0, 0, 0, 0)"]), ct = {
260
747
  imagePlaceholder: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",
261
748
  onImageErrorHandler: () => void 0
262
- }, be = (e) => {
749
+ }, lt = (e) => {
263
750
  let t = getComputedStyle(e);
264
- return !ve.has(t.backgroundColor) || t.backgroundImage !== "none";
265
- }, xe = (e) => {
751
+ return !st.has(t.backgroundColor) || t.backgroundImage !== "none";
752
+ }, ut = (e) => {
266
753
  for (let t = e; t; t = t.parentElement) {
267
754
  let e = getComputedStyle(t).backgroundColor;
268
- if (!ve.has(e)) return e;
755
+ if (!st.has(e)) return e;
269
756
  }
270
757
  return "#ffffff";
271
- }, Se = async (e, t) => {
272
- let { toPng: n } = await import("./es-CztjLuNy.js"), r = e.getBoundingClientRect(), i = Math.max(r.width, r.height, 1), a = Math.min(2, Math.max(.4, ge / i)), o = await n(e, {
273
- ...ye,
758
+ }, dt = async (e, t) => {
759
+ let { toPng: n } = await import("./es-CztjLuNy.js"), r = e.getBoundingClientRect(), i = Math.max(r.width, r.height, 1), a = Math.min(2, Math.max(.4, at / i)), o = await n(e, {
760
+ ...ct,
274
761
  pixelRatio: a,
275
- backgroundColor: xe(e),
762
+ backgroundColor: ut(e),
276
763
  filter: (e) => !t.includes(e)
277
764
  });
278
- if (o.length > _e) throw Error("capture too large");
765
+ if (o.length > ot) throw Error("capture too large");
279
766
  return o;
280
- }, Ce = 4, we = 4e3, Te = (e, t) => {
767
+ }, ft = 4, pt = 4e3, mt = (e, t) => {
281
768
  let n = document.elementFromPoint(e.x + e.width / 2, e.y + e.height / 2);
282
769
  for (; n && t.includes(n);) n = n.parentElement;
283
770
  let r = document.body;
@@ -288,8 +775,8 @@ var H = (e) => [
288
775
  break;
289
776
  }
290
777
  }
291
- let i = window.innerWidth * window.innerHeight * Ce || 2 ** 53 - 1, a = r;
292
- for (; !be(a);) {
778
+ let i = window.innerWidth * window.innerHeight * ft || 2 ** 53 - 1, a = r;
779
+ for (; !lt(a);) {
293
780
  let e = a.parentElement;
294
781
  if (!e || e === document.documentElement) break;
295
782
  let t = e.getBoundingClientRect();
@@ -297,13 +784,13 @@ var H = (e) => [
297
784
  a = e;
298
785
  }
299
786
  return a;
300
- }, Ee = async (e, t) => {
301
- let { toCanvas: n } = await import("./es-CztjLuNy.js"), r = Te(e, t), i = r.getBoundingClientRect(), a = Math.max(e.width, e.height, 1), o = Math.min(2, Math.max(.4, ge / a)), s = Math.max(i.width, i.height, 1);
302
- o = Math.min(o, we / s);
787
+ }, ht = async (e, t) => {
788
+ let { toCanvas: n } = await import("./es-CztjLuNy.js"), r = mt(e, t), i = r.getBoundingClientRect(), a = Math.max(e.width, e.height, 1), o = Math.min(2, Math.max(.4, at / a)), s = Math.max(i.width, i.height, 1);
789
+ o = Math.min(o, pt / s);
303
790
  let c = await n(r, {
304
- ...ye,
791
+ ...ct,
305
792
  pixelRatio: o,
306
- backgroundColor: xe(r),
793
+ backgroundColor: ut(r),
307
794
  filter: (e) => !t.includes(e)
308
795
  }), l = document.createElement("canvas");
309
796
  l.width = Math.max(1, Math.round(e.width * o)), l.height = Math.max(1, Math.round(e.height * o));
@@ -311,39 +798,39 @@ var H = (e) => [
311
798
  if (!u) throw Error("no 2d context");
312
799
  u.drawImage(c, (e.x - i.left) * o, (e.y - i.top) * o, e.width * o, e.height * o, 0, 0, l.width, l.height);
313
800
  let d = l.toDataURL("image/png");
314
- if (d.length > _e) throw Error("capture too large");
801
+ if (d.length > ot) throw Error("capture too large");
315
802
  return d;
316
- }, q = {
803
+ }, gt = {
317
804
  ring: 99997,
318
805
  overlay: 99998,
319
806
  label: 99999
320
- }, J = {
807
+ }, X = {
321
808
  hover: "#3b82f6",
322
809
  hoverBg: "rgba(59,130,246,0.12)",
323
810
  hoverLabelBg: "#1d4ed8",
324
811
  select: "#16a34a",
325
812
  selectGlow: "rgba(22,163,74,0.18)"
326
- }, Y = (e) => {
813
+ }, Z = (e) => {
327
814
  let t = e?.getAttribute("data-tsd-source");
328
815
  return t ? t.replace(/^\//, "") : null;
329
- }, De = (e) => Array.from(document.querySelectorAll("[data-tsd-source]")).filter((t) => Y(t) === e), Oe = (e, t) => {
330
- let n = De(t).indexOf(e);
816
+ }, _t = (e) => Array.from(document.querySelectorAll("[data-tsd-source]")).filter((t) => Z(t) === e), vt = (e, t) => {
817
+ let n = _t(t).indexOf(e);
331
818
  return n < 0 ? 0 : n;
332
- }, X = (e, t = 0) => {
333
- let n = De(e);
819
+ }, yt = (e, t = 0) => {
820
+ let n = _t(e);
334
821
  return n[t] ?? n[0] ?? null;
335
- }, ke = (e, t) => {
822
+ }, bt = (e, t) => {
336
823
  let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter(Boolean);
337
824
  n.includes(t) || e.setAttribute("data-staged-key", [...n, t].join(" "));
338
- }, Ae = (e, t) => {
825
+ }, xt = (e, t) => {
339
826
  let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter((e) => e && e !== t);
340
827
  n.length ? e.setAttribute("data-staged-key", n.join(" ")) : e.removeAttribute("data-staged-key");
341
- }, je = (e, t) => {
828
+ }, St = (e, t) => {
342
829
  let n = Object.entries(t.styles).filter(([e]) => /^-?[a-zA-Z][a-zA-Z0-9-]*$/.test(e)).map(([e, t]) => `${e}:${String(t).replace(/[;{}]/g, "")} !important;`).join("");
343
830
  if (!n) return "";
344
831
  let r = `[data-staged-key~="${CSS.escape(e)}"]{${n}}`, i = t.media?.replace(/[;{}]/g, "").trim();
345
832
  return i ? `@media ${i}{${r}}` : r;
346
- }, Me = (e) => {
833
+ }, Ct = (e) => {
347
834
  let t = e.tagName.toLowerCase();
348
835
  return t === "input" ? {
349
836
  checkbox: "Checkbox",
@@ -385,31 +872,31 @@ var H = (e) => [
385
872
  aside: "Sidebar",
386
873
  div: "Container"
387
874
  }[t] || `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
388
- }, Ne = 36, Pe = (e) => {
389
- let t = Me(e), n = ((e) => e.replace(/\s+/g, " ").trim())(e.getAttribute("aria-label") || e.getAttribute("alt") || e.getAttribute("title") || e.getAttribute("name") || "");
390
- return n ? `${t} · ${n.length > Ne ? `${n.slice(0, Ne - 1).trimEnd()}…` : n}` : t;
391
- }, Fe = (e) => {
875
+ }, wt = 36, Tt = (e) => {
876
+ let t = Ct(e), n = ((e) => e.replace(/\s+/g, " ").trim())(e.getAttribute("aria-label") || e.getAttribute("alt") || e.getAttribute("title") || e.getAttribute("name") || "");
877
+ return n ? `${t} · ${n.length > wt ? `${n.slice(0, wt - 1).trimEnd()}…` : n}` : t;
878
+ }, Et = (e) => {
392
879
  let t = [], n = e;
393
880
  for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) t.unshift(n.tagName.toLowerCase()), n = n.parentElement;
394
881
  return t.join(" > ");
395
- }, Ie = () => {
882
+ }, Dt = () => {
396
883
  let e = document.createElement("div");
397
- e.style.cssText = `position:fixed;pointer-events:none;z-index:${q.overlay};background:${J.hoverBg};outline:2px solid ${J.hover};border-radius:2px;display:none`;
884
+ e.style.cssText = `position:fixed;pointer-events:none;z-index:${gt.overlay};background:${X.hoverBg};outline:2px solid ${X.hover};border-radius:2px;display:none`;
398
885
  let t = document.createElement("div");
399
- t.style.cssText = `position:fixed;pointer-events:none;z-index:${q.label};background:${J.hoverLabelBg};color:#fff;font:11px/1.6 ui-monospace,monospace;padding:1px 6px;border-radius:4px;display:none;max-width:70vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis`;
886
+ t.style.cssText = `position:fixed;pointer-events:none;z-index:${gt.label};background:${X.hoverLabelBg};color:#fff;font:11px/1.6 ui-monospace,monospace;padding:1px 6px;border-radius:4px;display:none;max-width:70vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis`;
400
887
  let n = document.createElement("div");
401
- n.style.cssText = `position:fixed;pointer-events:none;z-index:${q.ring};outline:2px solid ${J.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 4px ${J.selectGlow};display:none`;
888
+ n.style.cssText = `position:fixed;pointer-events:none;z-index:${gt.ring};outline:2px solid ${X.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 4px ${X.selectGlow};display:none`;
402
889
  let r = document.createElement("div");
403
- return r.style.cssText = `position:fixed;pointer-events:none;z-index:${q.label};background:${J.select};color:#fff;font:11px/1.6 ui-monospace,monospace;padding:1px 6px;border-radius:4px;display:none;max-width:70vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis`, {
890
+ return r.style.cssText = `position:fixed;pointer-events:none;z-index:${gt.label};background:${X.select};color:#fff;font:11px/1.6 ui-monospace,monospace;padding:1px 6px;border-radius:4px;display:none;max-width:70vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis`, {
404
891
  overlay: e,
405
892
  label: t,
406
893
  ring: n,
407
894
  ringLabel: r
408
895
  };
409
- }, Le = (e, t, n) => {
896
+ }, Ot = (e, t, n) => {
410
897
  let r = n.getBoundingClientRect();
411
- e.style.display = "block", e.style.left = `${r.left}px`, e.style.top = `${r.top}px`, e.style.width = `${r.width}px`, e.style.height = `${r.height}px`, t.style.display = "block", t.textContent = Pe(n), t.style.left = `${Math.max(4, r.left)}px`, t.style.top = `${r.top > 26 ? r.top - 22 : r.bottom + 4}px`;
412
- }, Re = (e) => {
898
+ e.style.display = "block", e.style.left = `${r.left}px`, e.style.top = `${r.top}px`, e.style.width = `${r.width}px`, e.style.height = `${r.height}px`, t.style.display = "block", t.textContent = Tt(n), t.style.left = `${Math.max(4, r.left)}px`, t.style.top = `${r.top > 26 ? r.top - 22 : r.bottom + 4}px`;
899
+ }, kt = (e) => {
413
900
  let t = (e instanceof Element ? e : null)?.closest("a[href]");
414
901
  if (!t || t.target === "_blank") return null;
415
902
  let n;
@@ -419,11 +906,11 @@ var H = (e) => [
419
906
  return null;
420
907
  }
421
908
  return n.protocol !== "http:" && n.protocol !== "https:" || n.origin === location.origin ? null : n.href;
422
- }, ze = (e) => {
909
+ }, At = (e) => {
423
910
  if (!e) return !1;
424
911
  let t = e.tagName;
425
912
  return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable === !0;
426
- }, Be = (e) => {
913
+ }, jt = (e) => {
427
914
  if (!e.childNodes.length) return !1;
428
915
  let t = !1;
429
916
  for (let n of e.childNodes) {
@@ -431,10 +918,10 @@ var H = (e) => [
431
918
  (n.textContent ?? "").trim() && (t = !0);
432
919
  }
433
920
  return t;
434
- }, Ve = 2e3, He = (e) => {
921
+ }, Mt = 2e3, Nt = (e) => {
435
922
  let t = [], n = e;
436
923
  for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) {
437
- let e = Y(n);
924
+ let e = Z(n);
438
925
  e && t.unshift({
439
926
  tag: n.tagName.toLowerCase(),
440
927
  text: (n.textContent || "").trim().slice(0, 60),
@@ -442,25 +929,25 @@ var H = (e) => [
442
929
  }), n = n.parentElement;
443
930
  }
444
931
  return t;
445
- }, Ue = (e) => {
446
- let t = Y(e), n = t ? De(t).length : 1, r = t ? Oe(e, t) : 0, i = t && Be(e) ? (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, Ve) : void 0, a = We(e);
932
+ }, Pt = (e) => {
933
+ let t = Z(e), n = t ? _t(t).length : 1, r = t ? vt(e, t) : 0, i = t && jt(e) ? (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, Mt) : void 0, a = Ft(e);
447
934
  return {
448
935
  tag: e.tagName.toLowerCase(),
449
936
  classes: typeof e.className == "string" ? e.className.trim() : "",
450
937
  text: (e.innerText || "").trim().slice(0, 120),
451
- label: Pe(e),
452
- path: Fe(e),
938
+ label: Tt(e),
939
+ path: Et(e),
453
940
  source: t,
454
941
  index: r,
455
942
  occurrences: n,
456
- ancestors: He(e),
943
+ ancestors: Nt(e),
457
944
  ...i === void 0 ? {} : { fullText: i },
458
945
  ...a ? { sourceBinding: a } : {}
459
946
  };
460
- }, We = (e) => {
947
+ }, Ft = (e) => {
461
948
  let t = e.closest("[data-levo-source]");
462
949
  if (!t) return;
463
- let n = t.getAttribute("data-levo-source") ?? "", r = Y(t), i;
950
+ let n = t.getAttribute("data-levo-source") ?? "", r = Z(t), i;
464
951
  try {
465
952
  i = JSON.parse(n);
466
953
  } catch {
@@ -470,12 +957,12 @@ var H = (e) => [
470
957
  raw: n,
471
958
  element: {
472
959
  source: r ?? "",
473
- index: r ? Oe(t, r) : 0
960
+ index: r ? vt(t, r) : 0
474
961
  },
475
962
  ...i === void 0 ? {} : { config: i }
476
963
  };
477
- }, Ge = () => Array.from(document.querySelectorAll("[data-levo-source]")).map((e) => {
478
- let t = e.getAttribute("data-levo-source") ?? "", n = Y(e), r;
964
+ }, It = () => Array.from(document.querySelectorAll("[data-levo-source]")).map((e) => {
965
+ let t = e.getAttribute("data-levo-source") ?? "", n = Z(e), r;
479
966
  try {
480
967
  r = JSON.parse(t);
481
968
  } catch {
@@ -485,21 +972,21 @@ var H = (e) => [
485
972
  raw: t,
486
973
  element: {
487
974
  source: n ?? "",
488
- index: n ? Oe(e, n) : 0
975
+ index: n ? vt(e, n) : 0
489
976
  },
490
977
  tag: e.tagName.toLowerCase(),
491
- label: Pe(e),
978
+ label: Tt(e),
492
979
  ...r === void 0 ? {} : { config: r }
493
980
  };
494
- }), Ke = 14, qe = 2e3, Je = 100, Ye = 48, Xe = new Set([
981
+ }), Lt = 14, Rt = 2e3, zt = 100, Bt = 48, Vt = new Set([
495
982
  "script",
496
983
  "style",
497
984
  "template",
498
985
  "noscript"
499
- ]), Ze = (e, t) => t.includes(e) || e.id === "studio-staged" || Xe.has(e.tagName.toLowerCase()), Qe = (e) => {
986
+ ]), Ht = (e, t) => t.includes(e) || e.id === "studio-staged" || Vt.has(e.tagName.toLowerCase()), Ut = (e) => {
500
987
  let t = !1, n = 0, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
501
988
  for (let e of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
502
- let t = Y(e);
989
+ let t = Z(e);
503
990
  if (!t) continue;
504
991
  let n = i.get(t) ?? 0;
505
992
  r.set(e, n), i.set(t, n + 1);
@@ -508,11 +995,11 @@ var H = (e) => [
508
995
  for (let t of e.childNodes) {
509
996
  if (t.nodeType !== 3) continue;
510
997
  let e = (t.textContent ?? "").replace(/\s+/g, " ").trim();
511
- if (e) return e.length > Ye ? `${e.slice(0, Ye).trimEnd()}…` : e;
998
+ if (e) return e.length > Bt ? `${e.slice(0, Bt).trimEnd()}…` : e;
512
999
  }
513
1000
  }, o = (i, s) => {
514
1001
  n++;
515
- let c = Y(i), l = a(i), u = Array.from(i.children).filter((t) => !Ze(t, e)), d = {
1002
+ let c = Z(i), l = a(i), u = Array.from(i.children).filter((t) => !Ht(t, e)), d = {
516
1003
  tag: i.tagName.toLowerCase(),
517
1004
  ...c ? {
518
1005
  source: c,
@@ -523,9 +1010,9 @@ var H = (e) => [
523
1010
  childCount: u.length,
524
1011
  children: []
525
1012
  };
526
- if (s >= Ke) return u.length && (t = !0), d;
1013
+ if (s >= Lt) return u.length && (t = !0), d;
527
1014
  for (let e of u) {
528
- if (d.children.length >= Je || n >= qe) {
1015
+ if (d.children.length >= zt || n >= Rt) {
529
1016
  t = !0;
530
1017
  break;
531
1018
  }
@@ -537,7 +1024,7 @@ var H = (e) => [
537
1024
  tree: o(document.body, 0),
538
1025
  truncated: t
539
1026
  };
540
- }, $e = () => {
1027
+ }, Wt = () => {
541
1028
  let e = null;
542
1029
  return {
543
1030
  send: (t) => {
@@ -552,7 +1039,7 @@ var H = (e) => [
552
1039
  return !0;
553
1040
  }
554
1041
  };
555
- }, et = (e) => {
1042
+ }, Gt = (e) => {
556
1043
  let t = location.pathname, n = () => {
557
1044
  location.pathname !== t && (t = location.pathname, e.onPathChange());
558
1045
  }, r = !1;
@@ -572,7 +1059,7 @@ var H = (e) => [
572
1059
  e.__inspectorPatched && e.__orig && (history.pushState = e.__orig), t.__inspectorPatched && t.__orig && (history.replaceState = t.__orig);
573
1060
  }
574
1061
  } };
575
- }, tt = (e) => {
1062
+ }, Kt = (e) => {
576
1063
  let { channel: t, originals: n, staged: r } = e, i = t.send, a = null;
577
1064
  return { onMessage: (o) => {
578
1065
  let s = o.data;
@@ -580,7 +1067,7 @@ var H = (e) => [
580
1067
  if (s.type === "set-inspect") e.setInspect(s.enabled);
581
1068
  else if (s.type === "set-text-edit") e.setTextEdit(s.enabled);
582
1069
  else if (s.type === "revert-text") {
583
- let e = String(s.element?.source || ""), t = Number.isInteger(s.element?.index) ? s.element.index : 0, r = n.restore(`${e}#${t}`), i = r == null ? null : X(e, t);
1070
+ let e = String(s.element?.source || ""), t = Number.isInteger(s.element?.index) ? s.element.index : 0, r = n.restore(`${e}#${t}`), i = r == null ? null : yt(e, t);
584
1071
  i && r != null && (i.textContent = r);
585
1072
  } else if (s.type === "stage-style") {
586
1073
  let t = String(s.stageId || ""), n = String(s.element?.source || ""), a = Number.isInteger(s.element?.index) ? s.element.index : 0, o = s.styles && typeof s.styles == "object" ? s.styles : null;
@@ -639,7 +1126,7 @@ var H = (e) => [
639
1126
  }
640
1127
  e.syncDomObserver();
641
1128
  } else if (s.type === "select-element") {
642
- let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? X(t, n) : null;
1129
+ let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? yt(t, n) : null;
643
1130
  if (!r) {
644
1131
  i({
645
1132
  type: "select-miss",
@@ -655,10 +1142,10 @@ var H = (e) => [
655
1142
  behavior: "smooth"
656
1143
  }), i({
657
1144
  type: "element-selected",
658
- element: Ue(r)
1145
+ element: Pt(r)
659
1146
  });
660
1147
  } else if (s.type === "edit-element") {
661
- let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? X(t, n) : null;
1148
+ let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? yt(t, n) : null;
662
1149
  if (!r) {
663
1150
  i({
664
1151
  type: "select-miss",
@@ -674,12 +1161,12 @@ var H = (e) => [
674
1161
  behavior: "smooth"
675
1162
  }), i({
676
1163
  type: "element-selected",
677
- element: Ue(r)
1164
+ element: Pt(r)
678
1165
  }), e.isTextEditing() || e.setTextEdit(!0);
679
1166
  let o = e.editableTarget(r);
680
1167
  o && e.startEditAtEnd(o);
681
1168
  } else if (s.type === "highlight-element") {
682
- let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? X(t, n) : null;
1169
+ let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? yt(t, n) : null;
683
1170
  if (!r) a = null, e.hideTextHover(), i({
684
1171
  type: "highlight-miss",
685
1172
  element: {
@@ -697,7 +1184,7 @@ var H = (e) => [
697
1184
  }
698
1185
  } else if (s.type === "clear-highlight") a && (a = null, !e.isInspecting() && !e.editingNode() && e.hideTextHover());
699
1186
  else if (s.type === "request-layers") {
700
- let { tree: t, truncated: n } = Qe(e.ownNodes);
1187
+ let { tree: t, truncated: n } = Ut(e.ownNodes);
701
1188
  i({
702
1189
  type: "layers-tree",
703
1190
  tree: t,
@@ -705,7 +1192,7 @@ var H = (e) => [
705
1192
  });
706
1193
  } else if (s.type === "request-sources") i({
707
1194
  type: "sources-list",
708
- sources: Ge()
1195
+ sources: It()
709
1196
  });
710
1197
  else if (s.type === "capture-selected") {
711
1198
  let t = String(s.requestId || "");
@@ -720,7 +1207,7 @@ var H = (e) => [
720
1207
  });
721
1208
  return;
722
1209
  }
723
- Se(n, e.ownNodes).then((e) => {
1210
+ dt(n, e.ownNodes).then((e) => {
724
1211
  console.info(`[levo-inspector] element capture ok <${n.tagName.toLowerCase()}> (${Math.round(e.length / 1024)}kB)`), i({
725
1212
  type: "capture-result",
726
1213
  requestId: t,
@@ -741,7 +1228,7 @@ var H = (e) => [
741
1228
  }
742
1229
  }
743
1230
  } };
744
- }, nt = () => {
1231
+ }, qt = () => {
745
1232
  let e = /* @__PURE__ */ new Map(), t = () => {
746
1233
  if (e.size > 50) {
747
1234
  let t = e.keys().next().value;
@@ -761,31 +1248,31 @@ var H = (e) => [
761
1248
  return e.delete(t), n;
762
1249
  }
763
1250
  };
764
- }, rt = 6, it = 12, at = 12, ot = .6, st = (e, t, n, r) => ({
1251
+ }, Jt = 6, Yt = 12, Xt = 12, Zt = .6, Qt = (e, t, n, r) => ({
765
1252
  x: Math.min(e, n),
766
1253
  y: Math.min(t, r),
767
1254
  width: Math.abs(n - e),
768
1255
  height: Math.abs(r - t)
769
- }), ct = (e, t) => {
1256
+ }), $t = (e, t) => {
770
1257
  let n = e.x + e.width, r = e.y + e.height, i = [];
771
1258
  for (let a of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
772
1259
  if (t.includes(a)) continue;
773
1260
  let o = a.getBoundingClientRect(), s = o.width * o.height;
774
- s <= 0 || Math.max(0, Math.min(n, o.right) - Math.max(e.x, o.left)) * Math.max(0, Math.min(r, o.bottom) - Math.max(e.y, o.top)) / s >= ot && i.push(a);
1261
+ s <= 0 || Math.max(0, Math.min(n, o.right) - Math.max(e.x, o.left)) * Math.max(0, Math.min(r, o.bottom) - Math.max(e.y, o.top)) / s >= Zt && i.push(a);
775
1262
  }
776
1263
  let a = new Set(i), o = i.filter((e) => {
777
1264
  for (let t = e.parentElement; t; t = t.parentElement) if (a.has(t)) return !1;
778
1265
  return !0;
779
- }), s = o.length > at, c = [], l = [];
780
- for (let e of o.slice(0, at)) {
781
- let t = Y(e);
1266
+ }), s = o.length > Xt, c = [], l = [];
1267
+ for (let e of o.slice(0, Xt)) {
1268
+ let t = Z(e);
782
1269
  if (!t) continue;
783
1270
  let n = (e.innerText || "").replace(/\s+/g, " ").trim().slice(0, 80);
784
1271
  c.push({
785
1272
  source: t,
786
- index: Oe(e, t),
1273
+ index: vt(e, t),
787
1274
  tag: e.tagName.toLowerCase(),
788
- label: Pe(e),
1275
+ label: Tt(e),
789
1276
  ...n ? { text: n } : {}
790
1277
  }), l.push(e);
791
1278
  }
@@ -794,12 +1281,12 @@ var H = (e) => [
794
1281
  nodes: l,
795
1282
  truncated: s
796
1283
  };
797
- }, lt = () => Array.from({ length: at }, () => {
1284
+ }, en = () => Array.from({ length: Xt }, () => {
798
1285
  let e = document.createElement("div");
799
- return e.style.cssText = `position:fixed;pointer-events:none;z-index:${q.ring};outline:1.5px solid ${J.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 3px ${J.selectGlow};display:none`, e;
800
- }), ut = () => {
1286
+ return e.style.cssText = `position:fixed;pointer-events:none;z-index:${gt.ring};outline:1.5px solid ${X.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 3px ${X.selectGlow};display:none`, e;
1287
+ }), tn = () => {
801
1288
  let e = document.createElement("div");
802
- e.style.cssText = `position:fixed;pointer-events:none;z-index:${q.overlay};border:1.5px dashed ${J.select};background:${J.selectGlow};border-radius:2px;display:none`;
1289
+ e.style.cssText = `position:fixed;pointer-events:none;z-index:${gt.overlay};border:1.5px dashed ${X.select};background:${X.selectGlow};border-radius:2px;display:none`;
803
1290
  let t = null, n = !1, r = 0, i = 0, a = () => {
804
1291
  e.style.display = "none";
805
1292
  };
@@ -814,31 +1301,31 @@ var H = (e) => [
814
1301
  pointerMove: (a, o) => {
815
1302
  if (!t) return;
816
1303
  if (a = Math.min(Math.max(0, a), window.innerWidth), o = Math.min(Math.max(0, o), window.innerHeight), r = a, i = o, !n) {
817
- if (Math.abs(a - t.x) < rt && Math.abs(o - t.y) < rt) return;
1304
+ if (Math.abs(a - t.x) < Jt && Math.abs(o - t.y) < Jt) return;
818
1305
  n = !0;
819
1306
  }
820
- let s = st(t.x, t.y, a, o);
1307
+ let s = Qt(t.x, t.y, a, o);
821
1308
  e.style.display = "block", e.style.left = `${s.x}px`, e.style.top = `${s.y}px`, e.style.width = `${s.width}px`, e.style.height = `${s.height}px`;
822
1309
  },
823
1310
  pointerUp: () => {
824
1311
  let e = n, o = t;
825
1312
  if (t = null, n = !1, a(), !e || !o) return null;
826
- let s = st(o.x, o.y, r, i);
827
- return s.width < it || s.height < it ? null : s;
1313
+ let s = Qt(o.x, o.y, r, i);
1314
+ return s.width < Yt || s.height < Yt ? null : s;
828
1315
  },
829
1316
  cancel: () => {
830
1317
  t = null, n = !1, a();
831
1318
  },
832
1319
  isDragging: () => n
833
1320
  };
834
- }, dt = (e) => {
1321
+ }, nn = (e) => {
835
1322
  let { originals: t, editingNode: n } = e, r = /* @__PURE__ */ new Map(), i = () => {
836
1323
  let e = document.getElementById("studio-staged");
837
1324
  return e || (e = document.createElement("style"), e.id = "studio-staged", document.head.appendChild(e)), e;
838
1325
  }, a = () => {
839
1326
  let e = [];
840
1327
  for (let [t, n] of r) if (n.kind === "style") {
841
- let r = je(t, n);
1328
+ let r = St(t, n);
842
1329
  r && e.push(r);
843
1330
  }
844
1331
  let t = e.join("\n");
@@ -846,8 +1333,8 @@ var H = (e) => [
846
1333
  let n = i();
847
1334
  n.textContent !== t && (n.textContent = t);
848
1335
  }, o = (e, r) => {
849
- let i = X(r.source, r.index);
850
- if (i) if (r.kind === "style") ke(i, e);
1336
+ let i = yt(r.source, r.index);
1337
+ if (i) if (r.kind === "style") bt(i, e);
851
1338
  else if (r.kind === "image") t.captureOnce(`${r.source}#${r.index}:src`, i.getAttribute("src") ?? ""), t.captureOnce(`${r.source}#${r.index}:srcset`, i.getAttribute("srcset") ?? ""), i.getAttribute("src") !== r.value && i.setAttribute("src", r.value), i.hasAttribute("srcset") && i.removeAttribute("srcset");
852
1339
  else {
853
1340
  if (i === n()) return;
@@ -860,8 +1347,8 @@ var H = (e) => [
860
1347
  let n = r.get(e);
861
1348
  if (!n) return;
862
1349
  r.delete(e);
863
- let i = X(n.source, n.index);
864
- if (n.kind === "style") i && Ae(i, e), a();
1350
+ let i = yt(n.source, n.index);
1351
+ if (n.kind === "style") i && xt(i, e), a();
865
1352
  else if (n.kind === "image") {
866
1353
  let e = t.restore(`${n.source}#${n.index}:src`), r = t.restore(`${n.source}#${n.index}:srcset`);
867
1354
  i && (e != null && (e ? i.setAttribute("src", e) : i.removeAttribute("src")), r != null && (r ? i.setAttribute("srcset", r) : i.removeAttribute("srcset")));
@@ -890,7 +1377,7 @@ var H = (e) => [
890
1377
  for (let e of Array.from(document.querySelectorAll("[data-staged-key]"))) e.removeAttribute("data-staged-key");
891
1378
  }
892
1379
  };
893
- }, ft = (e) => {
1380
+ }, rn = (e) => {
894
1381
  let { channel: t, originals: n, clearTextHover: r } = e, i = null, a = "", o = 0, s = (() => {
895
1382
  try {
896
1383
  let e = document.createElement("div");
@@ -909,15 +1396,15 @@ var H = (e) => [
909
1396
  n.selectNodeContents(e), n.collapse(!1), t.removeAllRanges(), t.addRange(n);
910
1397
  }, d = (e, t = !1) => {
911
1398
  if (i === e) return;
912
- i && p(i), i = e, a = Y(e) || "", o = Oe(e, a), r(), n.capture(`${a}#${o}`, e.textContent ?? ""), e.setAttribute("contenteditable", s ? "plaintext-only" : "true");
1399
+ i && p(i), i = e, a = Z(e) || "", o = vt(e, a), r(), n.capture(`${a}#${o}`, e.textContent ?? ""), e.setAttribute("contenteditable", s ? "plaintext-only" : "true");
913
1400
  let d = e;
914
- d.style.outline = `2px solid ${J.hover}`, d.style.outlineOffset = "3px", d.style.borderRadius = "3px", d.focus(), t && u(e), d.addEventListener("blur", c, !0), d.addEventListener("keydown", l, !0);
1401
+ d.style.outline = `2px solid ${X.hover}`, d.style.outlineOffset = "3px", d.style.borderRadius = "3px", d.focus(), t && u(e), d.addEventListener("blur", c, !0), d.addEventListener("keydown", l, !0);
915
1402
  }, f = (e) => {
916
1403
  e.removeAttribute("contenteditable");
917
1404
  let t = e;
918
1405
  t.style.outline = "", t.style.outlineOffset = "", t.style.borderRadius = "", t.removeEventListener("blur", c, !0), t.removeEventListener("keydown", l, !0), i = null;
919
1406
  }, p = (e) => {
920
- let r = Y(e), i = o, s = n.get(`${a}#${o}`);
1407
+ let r = Z(e), i = o, s = n.get(`${a}#${o}`);
921
1408
  f(e);
922
1409
  let c = (e.textContent ?? "").replace(/\s+/g, " ").trim();
923
1410
  t.send({
@@ -928,7 +1415,7 @@ var H = (e) => [
928
1415
  tag: e.tagName.toLowerCase(),
929
1416
  value: c,
930
1417
  previous: s,
931
- occurrences: r ? De(r).length : 1
1418
+ occurrences: r ? _t(r).length : 1
932
1419
  }
933
1420
  });
934
1421
  }, m = (e) => {
@@ -947,16 +1434,16 @@ var H = (e) => [
947
1434
  i && f(i);
948
1435
  }
949
1436
  };
950
- }, pt = "2026-07-24g · element-capture + region-drag + region-highlights (stale-region guard)";
951
- function mt() {
952
- return f(() => ht(), []), null;
1437
+ }, an = "2026-07-24g · element-capture + region-drag + region-highlights (stale-region guard)";
1438
+ function on() {
1439
+ return v(() => sn(), []), null;
953
1440
  }
954
- function ht() {
955
- let e = !1, t = null, n = null, r = !1, i = null, a = nt(), o = $e(), { overlay: s, label: c, ring: l, ringLabel: u } = Ie();
1441
+ function sn() {
1442
+ let e = !1, t = null, n = null, r = !1, i = null, a = qt(), o = Wt(), { overlay: s, label: c, ring: l, ringLabel: u } = Dt();
956
1443
  document.body.append(s, c, l, u);
957
- let d = ut();
1444
+ let d = tn();
958
1445
  document.body.append(d.node);
959
- let f = lt();
1446
+ let f = en();
960
1447
  document.body.append(...f);
961
1448
  let p = [
962
1449
  s,
@@ -985,21 +1472,21 @@ function ht() {
985
1472
  e && !b ? (b = document.createElement("style"), b.id = "studio-pick-cursor", b.textContent = "*,*::before,*::after{cursor:crosshair !important}", document.head.appendChild(b)) : !e && b && (b.remove(), b = null);
986
1473
  }, S = (e) => !e || p.includes(e) || e === document.body || e === document.documentElement, C = (e) => {
987
1474
  if (!e || S(e)) return null;
988
- let t = Y(e) ? e : e.closest("[data-tsd-source]");
989
- return !t || S(t) || !Be(t) ? null : t;
990
- }, w = (e) => Le(s, c, e), T = () => {
1475
+ let t = Z(e) ? e : e.closest("[data-tsd-source]");
1476
+ return !t || S(t) || !jt(t) ? null : t;
1477
+ }, w = (e) => Ot(s, c, e), T = () => {
991
1478
  if (n) {
992
1479
  if (!n.isConnected) {
993
- ne();
1480
+ j();
994
1481
  return;
995
1482
  }
996
- Le(l, u, n);
1483
+ Ot(l, u, n);
997
1484
  }
998
1485
  }, E = 0, D = () => {
999
1486
  E || !n || r || (E = requestAnimationFrame(() => {
1000
1487
  E = 0, T();
1001
1488
  }));
1002
- }, O = new ResizeObserver(D), k = new MutationObserver((e) => {
1489
+ }, O = new ResizeObserver(D), ee = new MutationObserver((e) => {
1003
1490
  for (let t of e) {
1004
1491
  let e = t.target;
1005
1492
  if (!p.some((t) => t === e) && !(t.type === "attributes" && t.attributeName === "data-staged-key")) {
@@ -1007,32 +1494,32 @@ function ht() {
1007
1494
  return;
1008
1495
  }
1009
1496
  }
1010
- }), A = !1, ee = () => {
1011
- A ||= (k.observe(document.documentElement, {
1497
+ }), k = !1, te = () => {
1498
+ k ||= (ee.observe(document.documentElement, {
1012
1499
  attributes: !0,
1013
1500
  childList: !0,
1014
1501
  characterData: !0,
1015
1502
  subtree: !0
1016
1503
  }), !0);
1017
- }, j = () => {
1018
- A &&= (k.disconnect(), !1);
1019
- }, te = () => {
1020
- O.disconnect(), n?.isConnected && (O.observe(n), ee());
1504
+ }, A = () => {
1505
+ k &&= (ee.disconnect(), !1);
1021
1506
  }, ne = () => {
1507
+ O.disconnect(), n?.isConnected && (O.observe(n), te());
1508
+ }, j = () => {
1022
1509
  n = null, O.disconnect(), ie(), E &&= (cancelAnimationFrame(E), 0), l.style.display = "none", u.style.display = "none", y(), g();
1023
1510
  }, re = (e) => w(e), M = () => {
1024
1511
  s.style.display = "none", c.style.display = "none";
1025
- }, N = ft({
1512
+ }, N = rn({
1026
1513
  channel: o,
1027
1514
  originals: a,
1028
1515
  clearTextHover: () => {
1029
1516
  i = null, M();
1030
1517
  }
1031
- }), P = dt({
1518
+ }), P = nn({
1032
1519
  originals: a,
1033
1520
  editingNode: N.editingNode
1034
1521
  }), ie = () => {
1035
- n?.isConnected || P.count() ? ee() : j();
1522
+ n?.isConnected || P.count() ? te() : A();
1036
1523
  }, F = (n) => {
1037
1524
  n && r && I(!1), e = !!n, x(e), e || (t = null, s.style.display = "none", c.style.display = "none", G()), o.send({
1038
1525
  type: "inspect-state",
@@ -1047,9 +1534,9 @@ function ht() {
1047
1534
  type: "text-edit-state",
1048
1535
  enabled: r
1049
1536
  });
1050
- }, L = 0, ae = 0, oe = 0, se = () => {
1537
+ }, L = 0, ae = 0, R = 0, z = () => {
1051
1538
  L = 0;
1052
- let n = document.elementFromPoint(ae, oe);
1539
+ let n = document.elementFromPoint(ae, R);
1053
1540
  if (!S(n)) {
1054
1541
  if (r) {
1055
1542
  let e = C(n);
@@ -1062,31 +1549,31 @@ function ht() {
1062
1549
  }
1063
1550
  e && (d.isDragging() || (t = n, n && w(n)));
1064
1551
  }
1065
- }, R = (t) => {
1066
- !e && !r || (ae = t.clientX, oe = t.clientY, L ||= requestAnimationFrame(se));
1067
- }, z = 0, B = () => {
1068
- z = 0, e && t && w(t), r && !N.editingNode() && i?.isConnected && re(i), n && !r && T(), m.length > 0 && !r && _();
1069
- }, ce = () => {
1070
- z ||= requestAnimationFrame(B);
1071
- }, V = (n) => {
1552
+ }, oe = (t) => {
1553
+ !e && !r || (ae = t.clientX, R = t.clientY, L ||= requestAnimationFrame(z));
1554
+ }, B = 0, V = () => {
1555
+ B = 0, e && t && w(t), r && !N.editingNode() && i?.isConnected && re(i), n && !r && T(), m.length > 0 && !r && _();
1556
+ }, se = () => {
1557
+ B ||= requestAnimationFrame(V);
1558
+ }, H = (n) => {
1072
1559
  n.relatedTarget || (e ? (t = null, s.style.display = "none", c.style.display = "none") : r && !N.editingNode() && (i = null, M(), document.documentElement.style.cursor = ""));
1073
- }, H = !1, U = null, W = () => {
1074
- if (U != null) {
1560
+ }, U = !1, W = null, ce = () => {
1561
+ if (W != null) {
1075
1562
  try {
1076
- document.documentElement.releasePointerCapture(U);
1563
+ document.documentElement.releasePointerCapture(W);
1077
1564
  } catch {}
1078
- U = null;
1565
+ W = null;
1079
1566
  }
1080
1567
  }, G = () => {
1081
- W(), d.cancel();
1568
+ ce(), d.cancel();
1082
1569
  }, le = (t) => {
1083
- !e || t.button !== 0 || !t.isPrimary || (H = !1, d.pointerDown(t.clientX, t.clientY));
1570
+ !e || t.button !== 0 || !t.isPrimary || (U = !1, d.pointerDown(t.clientX, t.clientY));
1084
1571
  }, K = (n) => {
1085
1572
  if (!e || !n.isPrimary) return;
1086
1573
  let r = d.isDragging();
1087
1574
  if (d.pointerMove(n.clientX, n.clientY), d.isDragging()) {
1088
1575
  if (!r) {
1089
- U = n.pointerId;
1576
+ W = n.pointerId;
1090
1577
  try {
1091
1578
  document.documentElement.setPointerCapture(n.pointerId);
1092
1579
  } catch {}
@@ -1095,14 +1582,14 @@ function ht() {
1095
1582
  }
1096
1583
  }, ue = (t) => {
1097
1584
  if (!e || !t.isPrimary) return;
1098
- W();
1585
+ ce();
1099
1586
  let n = d.pointerUp();
1100
1587
  if (!n) return;
1101
- H = !0, ne();
1102
- let { elements: r, nodes: i, truncated: a } = ct(n, p);
1588
+ U = !0, j();
1589
+ let { elements: r, nodes: i, truncated: a } = $t(n, p);
1103
1590
  console.info(`[levo-inspector] region drag: ${Math.round(n.width)}×${Math.round(n.height)} — ${r.length} element(s)${a ? " (truncated)" : ""}`), v(i);
1104
1591
  let s = ++h;
1105
- Ee(n, p).then((e) => {
1592
+ ht(n, p).then((e) => {
1106
1593
  s === h && (console.info(`[levo-inspector] region capture ok (${Math.round(e.length / 1024)}kB)`), o.send({
1107
1594
  type: "region-selected",
1108
1595
  rect: n,
@@ -1119,36 +1606,36 @@ function ht() {
1119
1606
  dataUrl: null
1120
1607
  }));
1121
1608
  });
1122
- }, de = () => G(), fe = (e) => {
1123
- let t = Re(e.target);
1609
+ }, q = () => G(), de = (e) => {
1610
+ let t = kt(e.target);
1124
1611
  return t ? (e.preventDefault(), e.stopPropagation(), window.open(t, "_blank", "noopener,noreferrer"), !0) : !1;
1125
- }, pe = (i) => {
1126
- if (H) {
1127
- H = !1, i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
1612
+ }, fe = (i) => {
1613
+ if (U) {
1614
+ U = !1, i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
1128
1615
  return;
1129
1616
  }
1130
1617
  if (r) {
1131
1618
  let e = C(document.elementFromPoint(i.clientX, i.clientY) || i.target);
1132
1619
  if (!e || e === N.editingNode()) {
1133
- fe(i);
1620
+ de(i);
1134
1621
  return;
1135
1622
  }
1136
1623
  i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation(), N.startEdit(e);
1137
1624
  return;
1138
1625
  }
1139
1626
  if (!e) {
1140
- fe(i);
1627
+ de(i);
1141
1628
  return;
1142
1629
  }
1143
1630
  i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
1144
1631
  let a = t || i.target;
1145
1632
  if (S(a)) return;
1146
1633
  let s = a.closest("[data-tsd-source]") || a;
1147
- y(), g(), n = s, T(), te(), o.send({
1634
+ y(), g(), n = s, T(), ne(), o.send({
1148
1635
  type: "element-selected",
1149
- element: Ue(s)
1636
+ element: Pt(s)
1150
1637
  });
1151
- }, me = tt({
1638
+ }, pe = Kt({
1152
1639
  channel: o,
1153
1640
  originals: a,
1154
1641
  staged: P,
@@ -1158,18 +1645,18 @@ function ht() {
1158
1645
  isTextEditing: () => r,
1159
1646
  editingNode: N.editingNode,
1160
1647
  setSelected: (e) => {
1161
- y(), g(), n = e, te();
1648
+ y(), g(), n = e, ne();
1162
1649
  },
1163
1650
  selectedNode: () => n,
1164
1651
  positionSelected: T,
1165
- clearSelection: ne,
1652
+ clearSelection: j,
1166
1653
  syncDomObserver: ie,
1167
1654
  positionHover: w,
1168
1655
  hideTextHover: M,
1169
1656
  startEditAtEnd: (e) => N.startEdit(e, !0),
1170
1657
  editableTarget: C,
1171
1658
  ownNodes: p
1172
- }), he = [
1659
+ }), me = [
1173
1660
  "mousedown",
1174
1661
  "mouseup",
1175
1662
  "dblclick",
@@ -1187,19 +1674,19 @@ function ht() {
1187
1674
  "touchstart",
1188
1675
  "touchend",
1189
1676
  "submit"
1190
- ], ge = (t) => {
1677
+ ], he = (t) => {
1191
1678
  e && (t.cancelable && t.preventDefault(), t.stopPropagation(), t.stopImmediatePropagation());
1192
- }, _e = () => {
1679
+ }, ge = () => {
1193
1680
  n && !r && T(), m.length > 0 && !r && _();
1194
- }, ve = () => {
1681
+ }, _e = () => {
1195
1682
  let e = location.pathname.replace(/\/$/, "") || "/";
1196
1683
  o.send({
1197
1684
  type: "route",
1198
1685
  route: e
1199
1686
  });
1200
- }, ye = et({ onPathChange: () => {
1201
- ne(), ve();
1202
- } }), be = (t) => {
1687
+ }, ve = Gt({ onPathChange: () => {
1688
+ j(), _e();
1689
+ } }), ye = (t) => {
1203
1690
  if (N.editingNode()) return;
1204
1691
  if (t.key === "Escape") {
1205
1692
  if (e && d.isDragging()) {
@@ -1209,76 +1696,76 @@ function ht() {
1209
1696
  r ? (t.stopPropagation(), I(!1)) : e && (t.stopPropagation(), F(!1));
1210
1697
  return;
1211
1698
  }
1212
- if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat || ze(document.activeElement)) return;
1699
+ if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat || At(document.activeElement)) return;
1213
1700
  let n = t.key.toLowerCase();
1214
1701
  n === "s" ? (t.preventDefault(), t.stopPropagation(), F(!e)) : n === "t" && (t.preventDefault(), t.stopPropagation(), I(!r));
1215
1702
  };
1216
- window.addEventListener("mousemove", R, !0), window.addEventListener("scroll", ce, !0), window.addEventListener("resize", _e), window.addEventListener("click", pe, !0), window.addEventListener("keydown", be, !0), window.addEventListener("message", me.onMessage), window.addEventListener("mouseout", V, !0), window.addEventListener("pointerdown", le, !0), window.addEventListener("pointermove", K, !0), window.addEventListener("pointerup", ue, !0), window.addEventListener("pointercancel", de, !0);
1217
- for (let e of he) window.addEventListener(e, ge, !0);
1218
- return console.info(`[levo-inspector] build ${pt} — runtime mounted`), ve(), o.send({ type: "ready" }), () => {
1219
- window.removeEventListener("mousemove", R, !0), window.removeEventListener("keydown", be, !0), window.removeEventListener("scroll", ce, !0), window.removeEventListener("resize", _e), window.removeEventListener("mouseout", V, !0), window.removeEventListener("pointerdown", le, !0), window.removeEventListener("pointermove", K, !0), window.removeEventListener("pointerup", ue, !0), window.removeEventListener("pointercancel", de, !0), window.removeEventListener("click", pe, !0), window.removeEventListener("message", me.onMessage);
1220
- for (let e of he) window.removeEventListener(e, ge, !0);
1221
- O.disconnect(), k.disconnect(), E && cancelAnimationFrame(E), L && cancelAnimationFrame(L), z && cancelAnimationFrame(z), P.teardown(), ye.teardown(), N.teardown(), document.documentElement.style.cursor = "", b?.remove(), s.remove(), c.remove(), l.remove(), u.remove(), G(), d.node.remove();
1703
+ window.addEventListener("mousemove", oe, !0), window.addEventListener("scroll", se, !0), window.addEventListener("resize", ge), window.addEventListener("click", fe, !0), window.addEventListener("keydown", ye, !0), window.addEventListener("message", pe.onMessage), window.addEventListener("mouseout", H, !0), window.addEventListener("pointerdown", le, !0), window.addEventListener("pointermove", K, !0), window.addEventListener("pointerup", ue, !0), window.addEventListener("pointercancel", q, !0);
1704
+ for (let e of me) window.addEventListener(e, he, !0);
1705
+ return console.info(`[levo-inspector] build ${an} — runtime mounted`), _e(), o.send({ type: "ready" }), () => {
1706
+ window.removeEventListener("mousemove", oe, !0), window.removeEventListener("keydown", ye, !0), window.removeEventListener("scroll", se, !0), window.removeEventListener("resize", ge), window.removeEventListener("mouseout", H, !0), window.removeEventListener("pointerdown", le, !0), window.removeEventListener("pointermove", K, !0), window.removeEventListener("pointerup", ue, !0), window.removeEventListener("pointercancel", q, !0), window.removeEventListener("click", fe, !0), window.removeEventListener("message", pe.onMessage);
1707
+ for (let e of me) window.removeEventListener(e, he, !0);
1708
+ O.disconnect(), ee.disconnect(), E && cancelAnimationFrame(E), L && cancelAnimationFrame(L), B && cancelAnimationFrame(B), P.teardown(), ve.teardown(), N.teardown(), document.documentElement.style.cursor = "", b?.remove(), s.remove(), c.remove(), l.remove(), u.remove(), G(), d.node.remove();
1222
1709
  for (let e of f) e.remove();
1223
1710
  };
1224
1711
  }
1225
1712
  //#endregion
1226
1713
  //#region src/pageId.ts
1227
- var gt = "levo:page-id", _t = () => {
1714
+ var cn = "levo:page-id", ln = () => {
1228
1715
  if (typeof document > "u") return null;
1229
- let e = document.querySelectorAll(`meta[name="${gt}"]`);
1716
+ let e = document.querySelectorAll(`meta[name="${cn}"]`);
1230
1717
  return e[e.length - 1]?.getAttribute("content")?.trim() || null;
1231
- }, vt = l(() => import("./dist-Cb6sb7nO.js").then((e) => e.n).then((e) => ({ default: e.PopupLoader }))), yt = ({ siteId: e, pageId: t }) => {
1232
- let r = N(), i = n();
1233
- return !r || !i ? null : /* @__PURE__ */ v(s, {
1718
+ }, un = h(() => import("./dist-DPmVG7VB.js").then((e) => e.n).then((e) => ({ default: e.PopupLoader }))), dn = ({ siteId: e, pageId: t }) => {
1719
+ let n = J(), r = i();
1720
+ return !n || !r ? null : /* @__PURE__ */ u(p, {
1234
1721
  fallback: null,
1235
- children: /* @__PURE__ */ v(vt, {
1722
+ children: /* @__PURE__ */ u(un, {
1236
1723
  pageId: t,
1237
1724
  siteId: e
1238
1725
  })
1239
1726
  });
1240
- }, bt = () => n(), xt = () => e(), St = ({ site: e, children: n }) => {
1241
- let [r] = g(() => {
1727
+ }, fn = () => i(), pn = () => n(), mn = ({ site: e, children: t }) => {
1728
+ let [n] = S(() => {
1242
1729
  if (!e) return null;
1243
- let t = I(e), n = F(t);
1730
+ let t = q(e), n = ue(t);
1244
1731
  return n ? {
1245
1732
  client: n,
1246
- insights: E(n, {
1733
+ insights: ee(n, {
1247
1734
  insightsUrl: t.insightsUrl || null,
1248
1735
  site: t.siteId || null
1249
1736
  }),
1250
1737
  site: e
1251
1738
  } : null;
1252
- }), [i, a] = g(null), o = C({ select: (e) => e.location.pathname });
1253
- return f(() => {
1254
- r && (window.levo_client = r.client, window.levo_insights = r.insights);
1255
- }, [r]), p(() => {
1256
- if (!r) return;
1257
- let e = _t();
1258
- a(e), r.insights.init({ pageId: e });
1259
- }, [r, o]), r ? /* @__PURE__ */ y(t, {
1260
- client: r.client,
1261
- insights: r.insights,
1739
+ }), [i, a] = S(null), o = O({ select: (e) => e.location.pathname });
1740
+ return v(() => {
1741
+ n && (window.levo_client = n.client, window.levo_insights = n.insights);
1742
+ }, [n]), y(() => {
1743
+ if (!n) return;
1744
+ let e = ln();
1745
+ a(e), n.insights.init({ pageId: e });
1746
+ }, [n, o]), n ? /* @__PURE__ */ d(r, {
1747
+ client: n.client,
1748
+ insights: n.insights,
1262
1749
  children: [
1263
- n,
1264
- /* @__PURE__ */ v(ie, {
1265
- site: r.site,
1750
+ t,
1751
+ /* @__PURE__ */ u(Je, {
1752
+ site: n.site,
1266
1753
  path: o
1267
1754
  }),
1268
- /* @__PURE__ */ v(yt, {
1755
+ /* @__PURE__ */ u(dn, {
1269
1756
  pageId: i ?? void 0,
1270
- siteId: r.site.id
1757
+ siteId: n.site.id
1271
1758
  })
1272
1759
  ]
1273
- }) : /* @__PURE__ */ v(_, { children: n });
1274
- }, Ct = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), wt = (e) => {
1760
+ }) : /* @__PURE__ */ u(l, { children: t });
1761
+ }, hn = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), gn = (e) => {
1275
1762
  let t = {}, n = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*("([^"]*)"|'([^']*)'|[^\s"'>]+))?/g;
1276
1763
  for (let r = n.exec(e); r; r = n.exec(e)) {
1277
1764
  let e = r[1];
1278
1765
  !e || /^on/i.test(e) || (t[e] = r[3] ?? r[4] ?? (r[2] ? r[2] : ""));
1279
1766
  }
1280
1767
  return t;
1281
- }, Tt = (e) => {
1768
+ }, _n = (e) => {
1282
1769
  let t = {
1283
1770
  meta: [],
1284
1771
  links: [],
@@ -1286,11 +1773,11 @@ var gt = "levo:page-id", _t = () => {
1286
1773
  };
1287
1774
  if (!e?.trim()) return t;
1288
1775
  let n = e.replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi, (e, n, r) => {
1289
- let i = wt(n), a = r.trim();
1776
+ let i = gn(n), a = r.trim();
1290
1777
  return a && (i.children = a), t.scripts.push(i), "";
1291
1778
  });
1292
- return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(wt(r)), "")), t;
1293
- }, Et = (e = {}, t = {}) => {
1779
+ return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(gn(r)), "")), t;
1780
+ }, vn = (e = {}, t = {}) => {
1294
1781
  let n = {
1295
1782
  meta: [],
1296
1783
  links: [],
@@ -1355,21 +1842,21 @@ var gt = "levo:page-id", _t = () => {
1355
1842
  let y = e.ldJson ? Array.isArray(e.ldJson) ? e.ldJson : [e.ldJson] : [];
1356
1843
  for (let e of y) n.scripts.push({
1357
1844
  type: "application/ld+json",
1358
- children: Ct(e)
1845
+ children: hn(e)
1359
1846
  });
1360
1847
  for (let r of [t.customHead, e.customHead]) {
1361
1848
  if (!r) continue;
1362
- let e = Tt(r);
1849
+ let e = _n(r);
1363
1850
  n.meta.push(...e.meta), n.links.push(...e.links), n.scripts.push(...e.scripts);
1364
1851
  }
1365
1852
  return n;
1366
1853
  };
1367
- function Dt({ meta: e, site: t }) {
1368
- let n = Et(e, t);
1369
- return /* @__PURE__ */ y(_, { children: [
1370
- n.meta.map((e, t) => e.title === void 0 ? /* @__PURE__ */ v("meta", { ...e }, `m${t}`) : /* @__PURE__ */ v("title", { children: e.title }, `t${t}`)),
1371
- n.links.map((e, t) => /* @__PURE__ */ v("link", { ...e }, `l${t}`)),
1372
- n.scripts.map(({ children: e, ...t }, n) => e === void 0 ? /* @__PURE__ */ v("script", { ...t }, `s${n}`) : /* @__PURE__ */ v("script", {
1854
+ function yn({ meta: e, site: t }) {
1855
+ let n = vn(e, t);
1856
+ return /* @__PURE__ */ d(l, { children: [
1857
+ n.meta.map((e, t) => e.title === void 0 ? /* @__PURE__ */ u("meta", { ...e }, `m${t}`) : /* @__PURE__ */ u("title", { children: e.title }, `t${t}`)),
1858
+ n.links.map((e, t) => /* @__PURE__ */ u("link", { ...e }, `l${t}`)),
1859
+ n.scripts.map(({ children: e, ...t }, n) => e === void 0 ? /* @__PURE__ */ u("script", { ...t }, `s${n}`) : /* @__PURE__ */ u("script", {
1373
1860
  ...t,
1374
1861
  dangerouslySetInnerHTML: { __html: e }
1375
1862
  }, `s${n}`))
@@ -1377,25 +1864,25 @@ function Dt({ meta: e, site: t }) {
1377
1864
  }
1378
1865
  //#endregion
1379
1866
  //#region src/registration/ui.tsx
1380
- var Ot = (...e) => e.filter(Boolean).join(" "), Z = o.forwardRef(({ className: e, isLoading: t, loadingText: n, children: r, type: i = "button", ...a }, o) => /* @__PURE__ */ v("button", {
1867
+ var bn = (...e) => e.filter(Boolean).join(" "), Q = f.forwardRef(({ className: e, isLoading: t, loadingText: n, children: r, type: i = "button", ...a }, o) => /* @__PURE__ */ u("button", {
1381
1868
  ref: o,
1382
1869
  type: i,
1383
- className: Ot("inline-flex items-center justify-center", e),
1870
+ className: bn("inline-flex items-center justify-center", e),
1384
1871
  ...a,
1385
- children: t ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(A, { className: Ot("h-4 w-4 animate-spin", n ? "mr-2" : "") }), n] }) : r
1872
+ children: t ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(ne, { className: bn("h-4 w-4 animate-spin", n ? "mr-2" : "") }), n] }) : r
1386
1873
  }));
1387
- Z.displayName = "Btn";
1874
+ Q.displayName = "Btn";
1388
1875
  //#endregion
1389
1876
  //#region src/registration/AttendeeForm.tsx
1390
- var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, registerLoading: i, onBack: a, submitLabel: o, showBusinessBilling: s = !0 }) => /* @__PURE__ */ y("form", {
1877
+ var xn = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, registerLoading: i, onBack: a, submitLabel: o, showBusinessBilling: s = !0 }) => /* @__PURE__ */ d("form", {
1391
1878
  onSubmit: r,
1392
1879
  className: "flex flex-col gap-4",
1393
1880
  children: [
1394
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
1881
+ /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
1395
1882
  htmlFor: "name",
1396
1883
  className: "font-medium text-sm",
1397
1884
  children: "Name"
1398
- }), /* @__PURE__ */ v("input", {
1885
+ }), /* @__PURE__ */ u("input", {
1399
1886
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1400
1887
  placeholder: "Name",
1401
1888
  name: "name",
@@ -1404,11 +1891,11 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1404
1891
  onBlur: n,
1405
1892
  required: !0
1406
1893
  })] }),
1407
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
1894
+ /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
1408
1895
  htmlFor: "email",
1409
1896
  className: "font-medium text-sm",
1410
1897
  children: "Email"
1411
- }), /* @__PURE__ */ v("input", {
1898
+ }), /* @__PURE__ */ u("input", {
1412
1899
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1413
1900
  placeholder: "Email",
1414
1901
  name: "email",
@@ -1418,32 +1905,32 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1418
1905
  type: "email",
1419
1906
  required: !0
1420
1907
  })] }),
1421
- s && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
1908
+ s && /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
1422
1909
  htmlFor: "is_business_purchase",
1423
1910
  className: "flex items-center gap-2 text-sm",
1424
- children: [/* @__PURE__ */ v("input", {
1911
+ children: [/* @__PURE__ */ u("input", {
1425
1912
  type: "checkbox",
1426
1913
  name: "is_business_purchase",
1427
1914
  checked: e.is_business_purchase || !1,
1428
1915
  onChange: t,
1429
1916
  className: "rounded border-gray-300"
1430
- }), /* @__PURE__ */ v("span", {
1917
+ }), /* @__PURE__ */ u("span", {
1431
1918
  className: "font-medium",
1432
1919
  children: "Tax for Business"
1433
1920
  })]
1434
- }), /* @__PURE__ */ v("p", {
1921
+ }), /* @__PURE__ */ u("p", {
1435
1922
  className: "mt-1 text-gray-500 text-xs",
1436
1923
  children: "Check this if you're purchasing for a business and need a tax-compliant invoice"
1437
1924
  })] }),
1438
- s && e.is_business_purchase && /* @__PURE__ */ y(_, { children: [
1439
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
1925
+ s && e.is_business_purchase && /* @__PURE__ */ d(l, { children: [
1926
+ /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
1440
1927
  htmlFor: "business_name",
1441
1928
  className: "font-medium text-sm",
1442
- children: ["Company Name ", /* @__PURE__ */ v("span", {
1929
+ children: ["Company Name ", /* @__PURE__ */ u("span", {
1443
1930
  className: "text-red-500",
1444
1931
  children: "*"
1445
1932
  })]
1446
- }), /* @__PURE__ */ v("input", {
1933
+ }), /* @__PURE__ */ u("input", {
1447
1934
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1448
1935
  placeholder: "Acme Corporation",
1449
1936
  name: "billing_details.name",
@@ -1452,14 +1939,14 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1452
1939
  onBlur: n,
1453
1940
  required: e.is_business_purchase
1454
1941
  })] }),
1455
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
1942
+ /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("label", {
1456
1943
  htmlFor: "business_tax_id",
1457
1944
  className: "font-medium text-sm",
1458
- children: ["Tax ID / GST Number ", /* @__PURE__ */ v("span", {
1945
+ children: ["Tax ID / GST Number ", /* @__PURE__ */ u("span", {
1459
1946
  className: "text-red-500",
1460
1947
  children: "*"
1461
1948
  })]
1462
- }), /* @__PURE__ */ v("input", {
1949
+ }), /* @__PURE__ */ u("input", {
1463
1950
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1464
1951
  placeholder: "GST123456789",
1465
1952
  name: "billing_details.tax_id",
@@ -1468,15 +1955,15 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1468
1955
  onBlur: n,
1469
1956
  required: e.is_business_purchase
1470
1957
  })] }),
1471
- /* @__PURE__ */ y("div", { children: [
1472
- /* @__PURE__ */ y("p", {
1958
+ /* @__PURE__ */ d("div", { children: [
1959
+ /* @__PURE__ */ d("p", {
1473
1960
  className: "mb-1 font-medium text-sm",
1474
- children: ["Business Address ", /* @__PURE__ */ v("span", {
1961
+ children: ["Business Address ", /* @__PURE__ */ u("span", {
1475
1962
  className: "text-red-500",
1476
1963
  children: "*"
1477
1964
  })]
1478
1965
  }),
1479
- /* @__PURE__ */ v("input", {
1966
+ /* @__PURE__ */ u("input", {
1480
1967
  className: "mb-2 w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1481
1968
  placeholder: "Street Address Line 1",
1482
1969
  name: "billing_details.address.line1",
@@ -1485,7 +1972,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1485
1972
  onBlur: n,
1486
1973
  required: e.is_business_purchase
1487
1974
  }),
1488
- /* @__PURE__ */ v("input", {
1975
+ /* @__PURE__ */ u("input", {
1489
1976
  className: "mb-2 w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1490
1977
  placeholder: "Street Address Line 2 (Optional)",
1491
1978
  name: "billing_details.address.line2",
@@ -1493,9 +1980,9 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1493
1980
  onChange: t,
1494
1981
  onBlur: n
1495
1982
  }),
1496
- /* @__PURE__ */ y("div", {
1983
+ /* @__PURE__ */ d("div", {
1497
1984
  className: "grid grid-cols-2 gap-2",
1498
- children: [/* @__PURE__ */ v("input", {
1985
+ children: [/* @__PURE__ */ u("input", {
1499
1986
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1500
1987
  placeholder: "City",
1501
1988
  name: "billing_details.address.city",
@@ -1503,7 +1990,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1503
1990
  onChange: t,
1504
1991
  onBlur: n,
1505
1992
  required: e.is_business_purchase
1506
- }), /* @__PURE__ */ v("input", {
1993
+ }), /* @__PURE__ */ u("input", {
1507
1994
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1508
1995
  placeholder: "State/Province",
1509
1996
  name: "billing_details.address.state",
@@ -1513,9 +2000,9 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1513
2000
  required: e.is_business_purchase
1514
2001
  })]
1515
2002
  }),
1516
- /* @__PURE__ */ y("div", {
2003
+ /* @__PURE__ */ d("div", {
1517
2004
  className: "mt-2 grid grid-cols-2 gap-2",
1518
- children: [/* @__PURE__ */ v("input", {
2005
+ children: [/* @__PURE__ */ u("input", {
1519
2006
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1520
2007
  placeholder: "Postal Code",
1521
2008
  name: "billing_details.address.postal_code",
@@ -1523,7 +2010,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1523
2010
  onChange: t,
1524
2011
  onBlur: n,
1525
2012
  required: e.is_business_purchase
1526
- }), /* @__PURE__ */ v("input", {
2013
+ }), /* @__PURE__ */ u("input", {
1527
2014
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1528
2015
  placeholder: "Country",
1529
2016
  name: "billing_details.address.country",
@@ -1535,15 +2022,15 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1535
2022
  })
1536
2023
  ] })
1537
2024
  ] }),
1538
- /* @__PURE__ */ y("div", {
2025
+ /* @__PURE__ */ d("div", {
1539
2026
  className: "flex flex-col-reverse justify-end gap-4 md:flex-row",
1540
- children: [/* @__PURE__ */ v(Z, {
2027
+ children: [/* @__PURE__ */ u(Q, {
1541
2028
  className: "rounded-lg bg-gray-100 px-6 py-2 font-semibold text-black hover:bg-gray-200",
1542
2029
  type: "button",
1543
2030
  onClick: a,
1544
2031
  disabled: i,
1545
2032
  children: "Back"
1546
- }), /* @__PURE__ */ v(Z, {
2033
+ }), /* @__PURE__ */ u(Q, {
1547
2034
  className: "rounded-lg bg-brand px-6 py-2 font-semibold text-brand-foreground hover:opacity-90",
1548
2035
  type: "submit",
1549
2036
  isLoading: i,
@@ -1552,57 +2039,57 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1552
2039
  })]
1553
2040
  })
1554
2041
  ]
1555
- }), At = {
2042
+ }), Sn = {
1556
2043
  USD: "$",
1557
2044
  EUR: "€",
1558
2045
  GBP: "£",
1559
2046
  INR: "₹"
1560
- }, Q = (e) => e?.unit_amount ? `${At[e.currency ?? "INR"]} ${(e.unit_amount ?? 0) / 100}` : "Free", jt = (e) => {
2047
+ }, $ = (e) => e?.unit_amount ? `${Sn[e.currency ?? "INR"]} ${(e.unit_amount ?? 0) / 100}` : "Free", Cn = (e) => {
1561
2048
  if (!e) return null;
1562
2049
  let t = e.tax_enabled ?? !1, n = e.tax_inclusive ?? !1, r = e.taxes ?? [];
1563
2050
  return !t || r.length === 0 ? null : n ? "(inclusive of taxes)" : "+ taxes";
1564
- }, Mt = (e) => !!(e?.taxes && e.taxes.length > 0 && e.tax_amount !== void 0), Nt = (e) => {
2051
+ }, wn = (e) => !!(e?.taxes && e.taxes.length > 0 && e.tax_amount !== void 0), Tn = (e) => {
1565
2052
  if (!e) return !1;
1566
2053
  let t = e;
1567
2054
  return t.tax_enabled === !0 && t.taxes !== void 0 && t.taxes.length > 0 && t.subtotal !== void 0;
1568
- }, Pt = (e, t) => t ? t.total_amount ?? t.sale_amount ?? 0 : Nt(e) ? e.total ?? e.unit_amount ?? 0 : e?.unit_amount ?? 0, $ = (e, t) => !t || e.tickets.length === 0 ? !0 : e.tickets.some((e) => typeof e == "string" ? e === t : e._id === t), Ft = ({ couponCode: e, onCouponCodeChange: t, couponError: n, couponLoading: r, onValidateCoupon: i, publicCoupons: a, onBack: o, selectedTicket: s }) => {
2055
+ }, En = (e, t) => t ? t.total_amount ?? t.sale_amount ?? 0 : Tn(e) ? e.total ?? e.unit_amount ?? 0 : e?.unit_amount ?? 0, Dn = (e, t) => !t || e.tickets.length === 0 ? !0 : e.tickets.some((e) => typeof e == "string" ? e === t : e._id === t), On = ({ couponCode: e, onCouponCodeChange: t, couponError: n, couponLoading: r, onValidateCoupon: i, publicCoupons: a, onBack: o, selectedTicket: s }) => {
1569
2056
  let c = [...a].sort((e, t) => {
1570
- let n = $(e, s?._id), r = $(t, s?._id);
2057
+ let n = Dn(e, s?._id), r = Dn(t, s?._id);
1571
2058
  return n && !r ? -1 : !n && r ? 1 : 0;
1572
2059
  });
1573
- return /* @__PURE__ */ y("div", { children: [
1574
- /* @__PURE__ */ y("div", {
2060
+ return /* @__PURE__ */ d("div", { children: [
2061
+ /* @__PURE__ */ d("div", {
1575
2062
  className: "flex items-center justify-between text-center",
1576
2063
  children: [
1577
- /* @__PURE__ */ v("button", {
2064
+ /* @__PURE__ */ u("button", {
1578
2065
  type: "button",
1579
2066
  className: "rounded-md p-2 hover:bg-gray-50 focus:outline-none",
1580
2067
  "aria-label": "Back",
1581
2068
  onClick: o,
1582
- children: /* @__PURE__ */ v(O, { className: "size-4" })
2069
+ children: /* @__PURE__ */ u(te, { className: "size-4" })
1583
2070
  }),
1584
- /* @__PURE__ */ y("p", {
2071
+ /* @__PURE__ */ d("p", {
1585
2072
  className: "font-semibold text-md",
1586
2073
  children: ["Apply Coupon for ", s?.title]
1587
2074
  }),
1588
- /* @__PURE__ */ v("div", { className: "w-4" })
2075
+ /* @__PURE__ */ u("div", { className: "w-4" })
1589
2076
  ]
1590
2077
  }),
1591
- /* @__PURE__ */ y("div", {
2078
+ /* @__PURE__ */ d("div", {
1592
2079
  className: "mt-2 flex gap-4",
1593
- children: [/* @__PURE__ */ y("div", {
2080
+ children: [/* @__PURE__ */ d("div", {
1594
2081
  className: "w-full",
1595
- children: [/* @__PURE__ */ v("input", {
2082
+ children: [/* @__PURE__ */ u("input", {
1596
2083
  className: "w-full rounded border border-gray-300 px-3 py-2 focus:border-brand focus:outline-none",
1597
2084
  type: "text",
1598
2085
  placeholder: "Enter Coupon Code",
1599
2086
  value: e,
1600
2087
  onChange: (e) => t(e.target.value)
1601
- }), n && /* @__PURE__ */ v("p", {
2088
+ }), n && /* @__PURE__ */ u("p", {
1602
2089
  className: "mt-1 text-red-400 text-xs",
1603
2090
  children: n
1604
2091
  })]
1605
- }), /* @__PURE__ */ v(Z, {
2092
+ }), /* @__PURE__ */ u(Q, {
1606
2093
  "aria-label": "Apply Coupon",
1607
2094
  onClick: () => i(),
1608
2095
  className: "rounded-lg bg-brand px-3 text-brand-foreground hover:opacity-90",
@@ -1611,55 +2098,55 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1611
2098
  zIndex: e ? 1 : -1
1612
2099
  },
1613
2100
  isLoading: r,
1614
- children: /* @__PURE__ */ v(D, { className: "h-fit" })
2101
+ children: /* @__PURE__ */ u(k, { className: "h-fit" })
1615
2102
  })]
1616
2103
  }),
1617
- c.length > 0 && /* @__PURE__ */ y("div", {
2104
+ c.length > 0 && /* @__PURE__ */ d("div", {
1618
2105
  className: "mt-4 flex flex-col gap-4",
1619
- children: [c.filter((e) => $(e, s?._id)).length > 0 && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
2106
+ children: [c.filter((e) => Dn(e, s?._id)).length > 0 && /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("p", {
1620
2107
  className: "mb-2 text-gray-600 text-sm",
1621
2108
  children: "Available Coupons"
1622
- }), /* @__PURE__ */ v("div", {
2109
+ }), /* @__PURE__ */ u("div", {
1623
2110
  className: "flex flex-col gap-2",
1624
- children: c.filter((e) => $(e, s?._id)).map((e) => /* @__PURE__ */ y("button", {
2111
+ children: c.filter((e) => Dn(e, s?._id)).map((e) => /* @__PURE__ */ d("button", {
1625
2112
  type: "button",
1626
2113
  className: "flex flex-col gap-1 rounded-md border border-gray-300 border-dashed px-3 py-2 text-left transition hover:border-gray-400 hover:bg-gray-50",
1627
2114
  onClick: () => {
1628
2115
  i(e.code), t(e.code);
1629
2116
  },
1630
- children: [/* @__PURE__ */ y("div", {
2117
+ children: [/* @__PURE__ */ d("div", {
1631
2118
  className: "flex w-full items-center justify-between",
1632
- children: [/* @__PURE__ */ v("span", {
2119
+ children: [/* @__PURE__ */ u("span", {
1633
2120
  className: "font-medium",
1634
2121
  children: e.code
1635
- }), /* @__PURE__ */ v("span", {
2122
+ }), /* @__PURE__ */ u("span", {
1636
2123
  className: "text-gray-500 text-sm",
1637
- children: e.kind === "percent" ? `${e.percent_off}% off` : `${At[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
2124
+ children: e.kind === "percent" ? `${e.percent_off}% off` : `${Sn[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
1638
2125
  })]
1639
- }), e.description && /* @__PURE__ */ v("span", {
2126
+ }), e.description && /* @__PURE__ */ u("span", {
1640
2127
  className: "text-gray-500 text-xs",
1641
2128
  children: e.description
1642
2129
  })]
1643
2130
  }, e._id))
1644
- })] }), c.filter((e) => !$(e, s?._id)).length > 0 && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
2131
+ })] }), c.filter((e) => !Dn(e, s?._id)).length > 0 && /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("p", {
1645
2132
  className: "mb-2 text-gray-400 text-sm",
1646
2133
  children: "Not Applicable"
1647
- }), /* @__PURE__ */ v("div", {
2134
+ }), /* @__PURE__ */ u("div", {
1648
2135
  className: "flex flex-col gap-2",
1649
- children: c.filter((e) => !$(e, s?._id)).map((e) => /* @__PURE__ */ y("button", {
2136
+ children: c.filter((e) => !Dn(e, s?._id)).map((e) => /* @__PURE__ */ d("button", {
1650
2137
  type: "button",
1651
2138
  disabled: !0,
1652
2139
  className: "flex cursor-not-allowed flex-col gap-1 rounded-md border border-gray-200 border-dashed px-3 py-2 text-left opacity-50",
1653
- children: [/* @__PURE__ */ y("div", {
2140
+ children: [/* @__PURE__ */ d("div", {
1654
2141
  className: "flex w-full items-center justify-between",
1655
- children: [/* @__PURE__ */ v("span", {
2142
+ children: [/* @__PURE__ */ u("span", {
1656
2143
  className: "font-medium",
1657
2144
  children: e.code
1658
- }), /* @__PURE__ */ v("span", {
2145
+ }), /* @__PURE__ */ u("span", {
1659
2146
  className: "text-gray-500 text-sm",
1660
- children: e.kind === "percent" ? `${e.percent_off}% off` : `${At[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
2147
+ children: e.kind === "percent" ? `${e.percent_off}% off` : `${Sn[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
1661
2148
  })]
1662
- }), e.description && /* @__PURE__ */ v("span", {
2149
+ }), e.description && /* @__PURE__ */ u("span", {
1663
2150
  className: "text-gray-500 text-xs",
1664
2151
  children: e.description
1665
2152
  })]
@@ -1667,7 +2154,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1667
2154
  })] })]
1668
2155
  })
1669
2156
  ] });
1670
- }, It = (e) => {
2157
+ }, kn = (e) => {
1671
2158
  let t = new Date(e);
1672
2159
  return `${new Intl.DateTimeFormat("en-GB", {
1673
2160
  day: "numeric",
@@ -1678,24 +2165,24 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1678
2165
  minute: "2-digit",
1679
2166
  hour12: !0
1680
2167
  }).format(t)}`;
1681
- }, Lt = ({ ticketData: e, paymentData: t, type: n }) => {
1682
- let [r, i] = g(!0), a = (t.total_amount || t.unit_amount) / 100, o = t.unit_amount === 0, s = (e) => new Intl.NumberFormat("en-IN", {
2168
+ }, An = ({ ticketData: e, paymentData: t, type: n }) => {
2169
+ let [r, i] = S(!0), a = (t.total_amount || t.unit_amount) / 100, o = t.unit_amount === 0, s = (e) => new Intl.NumberFormat("en-IN", {
1683
2170
  style: "currency",
1684
2171
  currency: t.currency || "INR",
1685
2172
  minimumFractionDigits: 0
1686
2173
  }).format(e);
1687
- return /* @__PURE__ */ v(T.Root, {
2174
+ return /* @__PURE__ */ u(C.Root, {
1688
2175
  open: r,
1689
2176
  onOpenChange: (e) => i(e),
1690
- children: /* @__PURE__ */ y(T.Portal, { children: [/* @__PURE__ */ v(T.Backdrop, { className: "fixed inset-0 z-50 bg-black/50" }), /* @__PURE__ */ y(T.Popup, {
2177
+ children: /* @__PURE__ */ d(C.Portal, { children: [/* @__PURE__ */ u(C.Backdrop, { className: "fixed inset-0 z-50 bg-black/50" }), /* @__PURE__ */ d(C.Popup, {
1691
2178
  className: "fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-2rem)] w-full max-w-md -translate-x-1/2 -translate-y-1/2 flex-col overflow-y-auto rounded-2xl bg-white shadow-2xl",
1692
2179
  children: [
1693
- /* @__PURE__ */ y("div", {
2180
+ /* @__PURE__ */ d("div", {
1694
2181
  className: "bg-gradient-to-br from-green-50 to-emerald-50 px-6 py-6 text-center",
1695
2182
  children: [
1696
- /* @__PURE__ */ v("div", {
2183
+ /* @__PURE__ */ u("div", {
1697
2184
  className: "mx-auto mb-3 flex size-14 items-center justify-center rounded-full bg-green-100 ring-4 ring-green-50",
1698
- children: /* @__PURE__ */ y("svg", {
2185
+ children: /* @__PURE__ */ d("svg", {
1699
2186
  xmlns: "http://www.w3.org/2000/svg",
1700
2187
  width: "28",
1701
2188
  height: "28",
@@ -1707,72 +2194,72 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1707
2194
  strokeLinejoin: "round",
1708
2195
  className: "text-green-600",
1709
2196
  "aria-hidden": "true",
1710
- children: [/* @__PURE__ */ v("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }), /* @__PURE__ */ v("polyline", { points: "22 4 12 14.01 9 11.01" })]
2197
+ children: [/* @__PURE__ */ u("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }), /* @__PURE__ */ u("polyline", { points: "22 4 12 14.01 9 11.01" })]
1711
2198
  })
1712
2199
  }),
1713
- /* @__PURE__ */ v(T.Title, {
2200
+ /* @__PURE__ */ u(C.Title, {
1714
2201
  className: "font-bold text-gray-900 text-lg",
1715
2202
  children: n === "view" ? "Booking Details" : "Tickets Confirmed!"
1716
2203
  }),
1717
- /* @__PURE__ */ v(T.Description, {
2204
+ /* @__PURE__ */ u(C.Description, {
1718
2205
  className: "mt-1 text-gray-600 text-sm",
1719
2206
  children: n === "confirm" ? "Your tickets have been confirmed. A confirmation email is on its way." : "Here are the details about your booking."
1720
2207
  })
1721
2208
  ]
1722
2209
  }),
1723
- /* @__PURE__ */ y("div", {
2210
+ /* @__PURE__ */ d("div", {
1724
2211
  className: "px-6 py-5",
1725
- children: [/* @__PURE__ */ y("div", {
2212
+ children: [/* @__PURE__ */ d("div", {
1726
2213
  className: "relative overflow-hidden rounded-xl border border-gray-200 bg-white",
1727
2214
  children: [
1728
- /* @__PURE__ */ v("div", { className: "absolute top-1/2 -left-3 size-6 -translate-y-1/2 rounded-full bg-gray-100" }),
1729
- /* @__PURE__ */ v("div", { className: "absolute top-1/2 -right-3 size-6 -translate-y-1/2 rounded-full bg-gray-100" }),
1730
- /* @__PURE__ */ y("div", {
2215
+ /* @__PURE__ */ u("div", { className: "absolute top-1/2 -left-3 size-6 -translate-y-1/2 rounded-full bg-gray-100" }),
2216
+ /* @__PURE__ */ u("div", { className: "absolute top-1/2 -right-3 size-6 -translate-y-1/2 rounded-full bg-gray-100" }),
2217
+ /* @__PURE__ */ d("div", {
1731
2218
  className: "px-5 py-4",
1732
2219
  children: [
1733
- t.qr_image && /* @__PURE__ */ v("div", {
2220
+ t.qr_image && /* @__PURE__ */ u("div", {
1734
2221
  className: "mb-4 flex flex-col items-center",
1735
- children: /* @__PURE__ */ v("div", {
2222
+ children: /* @__PURE__ */ u("div", {
1736
2223
  className: "rounded-lg border border-gray-200 bg-white p-2",
1737
- children: /* @__PURE__ */ v("img", {
2224
+ children: /* @__PURE__ */ u("img", {
1738
2225
  src: t.qr_image.location,
1739
2226
  alt: "Booking QR Code",
1740
2227
  className: "size-24"
1741
2228
  })
1742
2229
  })
1743
2230
  }),
1744
- /* @__PURE__ */ y("div", {
2231
+ /* @__PURE__ */ d("div", {
1745
2232
  className: "mb-4 flex items-center justify-between rounded-lg bg-gray-50 px-3 py-2.5",
1746
- children: [/* @__PURE__ */ v("span", {
2233
+ children: [/* @__PURE__ */ u("span", {
1747
2234
  className: "font-medium text-gray-500 text-xs uppercase tracking-wide",
1748
2235
  children: "Booking ID"
1749
- }), /* @__PURE__ */ v("span", {
2236
+ }), /* @__PURE__ */ u("span", {
1750
2237
  className: "font-mono font-semibold text-gray-900 text-sm",
1751
2238
  children: t._id
1752
2239
  })]
1753
2240
  }),
1754
- /* @__PURE__ */ v("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
1755
- /* @__PURE__ */ v("div", {
2241
+ /* @__PURE__ */ u("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
2242
+ /* @__PURE__ */ u("div", {
1756
2243
  className: "space-y-3",
1757
2244
  children: t.attendees.map((t) => {
1758
2245
  let n = e.find((e) => e._id === t.ticket._id);
1759
- return n ? /* @__PURE__ */ y("div", {
2246
+ return n ? /* @__PURE__ */ d("div", {
1760
2247
  className: "flex items-center justify-between",
1761
- children: [/* @__PURE__ */ y("div", {
2248
+ children: [/* @__PURE__ */ d("div", {
1762
2249
  className: "min-w-0 flex-1",
1763
- children: [/* @__PURE__ */ v("p", {
2250
+ children: [/* @__PURE__ */ u("p", {
1764
2251
  className: "truncate font-medium text-gray-900 text-sm",
1765
2252
  children: t.name
1766
- }), /* @__PURE__ */ v("p", {
2253
+ }), /* @__PURE__ */ u("p", {
1767
2254
  className: "truncate text-gray-500 text-xs",
1768
2255
  children: t.email
1769
2256
  })]
1770
- }), /* @__PURE__ */ y("div", {
2257
+ }), /* @__PURE__ */ d("div", {
1771
2258
  className: "ml-3 shrink-0 text-right",
1772
- children: [/* @__PURE__ */ v("p", {
2259
+ children: [/* @__PURE__ */ u("p", {
1773
2260
  className: "font-medium text-gray-900 text-sm",
1774
2261
  children: n.title
1775
- }), /* @__PURE__ */ v("p", {
2262
+ }), /* @__PURE__ */ u("p", {
1776
2263
  className: "text-gray-500 text-xs",
1777
2264
  children: s(t.ticket.unit_amount / 100)
1778
2265
  })]
@@ -1780,63 +2267,63 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1780
2267
  }, t._id) : null;
1781
2268
  })
1782
2269
  }),
1783
- /* @__PURE__ */ v("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
1784
- !o && /* @__PURE__ */ y("div", {
2270
+ /* @__PURE__ */ u("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
2271
+ !o && /* @__PURE__ */ d("div", {
1785
2272
  className: "space-y-1.5 text-sm",
1786
2273
  children: [
1787
- /* @__PURE__ */ y("div", {
2274
+ /* @__PURE__ */ d("div", {
1788
2275
  className: "flex justify-between",
1789
- children: [/* @__PURE__ */ v("span", {
2276
+ children: [/* @__PURE__ */ u("span", {
1790
2277
  className: "text-gray-500",
1791
2278
  children: "Base Amount"
1792
- }), /* @__PURE__ */ v("span", {
2279
+ }), /* @__PURE__ */ u("span", {
1793
2280
  className: "font-medium text-gray-700",
1794
2281
  children: s(t.unit_amount / 100)
1795
2282
  })]
1796
2283
  }),
1797
- t.discount > 0 && /* @__PURE__ */ y("div", {
2284
+ t.discount > 0 && /* @__PURE__ */ d("div", {
1798
2285
  className: "flex justify-between text-green-600",
1799
- children: [/* @__PURE__ */ v("span", { children: "Discount" }), /* @__PURE__ */ y("span", {
2286
+ children: [/* @__PURE__ */ u("span", { children: "Discount" }), /* @__PURE__ */ d("span", {
1800
2287
  className: "font-medium",
1801
2288
  children: ["- ", s(t.discount / 100)]
1802
2289
  })]
1803
2290
  }),
1804
- t.taxes && Array.isArray(t.taxes) && t.taxes.length > 0 && t.taxes.map((e, t) => /* @__PURE__ */ y("div", {
2291
+ t.taxes && Array.isArray(t.taxes) && t.taxes.length > 0 && t.taxes.map((e, t) => /* @__PURE__ */ d("div", {
1805
2292
  className: "flex justify-between",
1806
- children: [/* @__PURE__ */ v("span", {
2293
+ children: [/* @__PURE__ */ u("span", {
1807
2294
  className: "text-gray-500",
1808
2295
  children: e.label
1809
- }), /* @__PURE__ */ v("span", {
2296
+ }), /* @__PURE__ */ u("span", {
1810
2297
  className: "font-medium text-gray-700",
1811
2298
  children: s(e.amount / 100)
1812
2299
  })]
1813
2300
  }, t)),
1814
- /* @__PURE__ */ y("div", {
2301
+ /* @__PURE__ */ d("div", {
1815
2302
  className: "flex justify-between border-gray-200 border-t pt-2 font-semibold text-gray-900",
1816
- children: [/* @__PURE__ */ v("span", { children: "Total Paid" }), /* @__PURE__ */ v("span", { children: s(a) })]
2303
+ children: [/* @__PURE__ */ u("span", { children: "Total Paid" }), /* @__PURE__ */ u("span", { children: s(a) })]
1817
2304
  })
1818
2305
  ]
1819
2306
  }),
1820
- o && /* @__PURE__ */ y("div", {
2307
+ o && /* @__PURE__ */ d("div", {
1821
2308
  className: "flex items-center justify-between font-semibold text-gray-900",
1822
- children: [/* @__PURE__ */ v("span", { children: "Total" }), /* @__PURE__ */ v("span", { children: "Free" })]
2309
+ children: [/* @__PURE__ */ u("span", { children: "Total" }), /* @__PURE__ */ u("span", { children: "Free" })]
1823
2310
  })
1824
2311
  ]
1825
2312
  })
1826
2313
  ]
1827
- }), /* @__PURE__ */ v("p", {
2314
+ }), /* @__PURE__ */ u("p", {
1828
2315
  className: "mt-3 text-center text-gray-400 text-xs",
1829
- children: It(t.created_at)
2316
+ children: kn(t.created_at)
1830
2317
  })]
1831
2318
  }),
1832
- /* @__PURE__ */ y("div", {
2319
+ /* @__PURE__ */ d("div", {
1833
2320
  className: "flex flex-col gap-2 px-6 pb-5",
1834
- children: [t.invoice?.location && /* @__PURE__ */ y("a", {
2321
+ children: [t.invoice?.location && /* @__PURE__ */ d("a", {
1835
2322
  href: t.invoice.location,
1836
2323
  target: "_blank",
1837
2324
  rel: "noopener noreferrer",
1838
2325
  className: "flex w-full items-center justify-center gap-2 rounded-lg border border-gray-200 px-4 py-2.5 font-medium text-gray-700 text-sm transition-colors hover:bg-gray-50",
1839
- children: [/* @__PURE__ */ y("svg", {
2326
+ children: [/* @__PURE__ */ d("svg", {
1840
2327
  xmlns: "http://www.w3.org/2000/svg",
1841
2328
  width: "16",
1842
2329
  height: "16",
@@ -1848,9 +2335,9 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1848
2335
  strokeLinejoin: "round",
1849
2336
  "aria-hidden": "true",
1850
2337
  children: [
1851
- /* @__PURE__ */ v("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
1852
- /* @__PURE__ */ v("polyline", { points: "7 10 12 15 17 10" }),
1853
- /* @__PURE__ */ v("line", {
2338
+ /* @__PURE__ */ u("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
2339
+ /* @__PURE__ */ u("polyline", { points: "7 10 12 15 17 10" }),
2340
+ /* @__PURE__ */ u("line", {
1854
2341
  x1: "12",
1855
2342
  x2: "12",
1856
2343
  y1: "15",
@@ -1858,7 +2345,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1858
2345
  })
1859
2346
  ]
1860
2347
  }), "Download Invoice"]
1861
- }), /* @__PURE__ */ v(T.Close, {
2348
+ }), /* @__PURE__ */ u(C.Close, {
1862
2349
  className: "w-full rounded-lg bg-gray-900 px-4 py-2.5 font-medium text-sm text-white transition-colors hover:bg-gray-800",
1863
2350
  children: "Done"
1864
2351
  })]
@@ -1866,123 +2353,123 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1866
2353
  ]
1867
2354
  })] })
1868
2355
  });
1869
- }, Rt = ({ isOpen: e, onClose: t, stripePromise: n, clientSecret: r, onComplete: i }) => !n || !r ? null : /* @__PURE__ */ v(T.Root, {
2356
+ }, jn = ({ isOpen: e, onClose: t, stripePromise: n, clientSecret: r, onComplete: i }) => !n || !r ? null : /* @__PURE__ */ u(C.Root, {
1870
2357
  open: e,
1871
2358
  onOpenChange: (e) => {
1872
2359
  e || t();
1873
2360
  },
1874
- children: /* @__PURE__ */ y(T.Portal, { children: [/* @__PURE__ */ v(T.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ y(T.Popup, {
2361
+ children: /* @__PURE__ */ d(C.Portal, { children: [/* @__PURE__ */ u(C.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ d(C.Popup, {
1875
2362
  className: "fixed top-8 left-1/2 z-[100] flex max-h-[calc(100vh-4rem)] min-h-[500px] w-[98vw] -translate-x-1/2 flex-col overflow-hidden rounded-2xl bg-white shadow-2xl md:top-10 md:w-auto md:max-w-[1000px] lg:max-w-[1100px]",
1876
- children: [/* @__PURE__ */ v(T.Close, {
2363
+ children: [/* @__PURE__ */ u(C.Close, {
1877
2364
  className: "absolute top-4 right-4 z-10 rounded-full bg-white/90 p-2.5 text-gray-500 shadow-md backdrop-blur-sm transition-all hover:bg-white hover:text-gray-700",
1878
- children: /* @__PURE__ */ v(te, { className: "size-5" })
1879
- }), /* @__PURE__ */ v("div", {
2365
+ children: /* @__PURE__ */ u(M, { className: "size-5" })
2366
+ }), /* @__PURE__ */ u("div", {
1880
2367
  className: "flex-1 overflow-y-auto rounded-2xl py-6",
1881
- children: /* @__PURE__ */ v(M, {
2368
+ children: /* @__PURE__ */ u(ie, {
1882
2369
  stripe: n,
1883
2370
  options: {
1884
2371
  clientSecret: r,
1885
2372
  onComplete: i
1886
2373
  },
1887
- children: /* @__PURE__ */ v(re, { className: "stripe-embedded-checkout h-full" })
2374
+ children: /* @__PURE__ */ u(P, { className: "stripe-embedded-checkout h-full" })
1888
2375
  })
1889
2376
  })]
1890
2377
  })] })
1891
- }), zt = ({ tickets: e, selectedTicket: t, onSelectTicket: n, discount: r, couponCode: i, publicCouponsCount: a, onApplyCouponClick: o, onRemoveCoupon: s, onNext: c }) => {
1892
- let l = Nt(t), u = Mt(r);
1893
- return /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("div", {
2378
+ }), Mn = ({ tickets: e, selectedTicket: t, onSelectTicket: n, discount: r, couponCode: i, publicCouponsCount: a, onApplyCouponClick: o, onRemoveCoupon: s, onNext: c }) => {
2379
+ let l = Tn(t), f = wn(r);
2380
+ return /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("div", {
1894
2381
  className: "flex max-h-[64dvh] w-full flex-col justify-between gap-6 overflow-y-auto md:max-h-[unset] md:flex-row",
1895
- children: [/* @__PURE__ */ v("div", {
2382
+ children: [/* @__PURE__ */ u("div", {
1896
2383
  className: "flex w-full flex-col gap-3 md:w-[55%]",
1897
- children: e.map((e) => /* @__PURE__ */ v("div", {
1898
- className: Ot("flex cursor-pointer items-center justify-between rounded-md border border-gray-300 px-3 py-2 transition duration-300 hover:bg-gray-50", e._id === t?._id ? "border-brand bg-brand/10 hover:bg-brand/20" : ""),
2384
+ children: e.map((e) => /* @__PURE__ */ u("div", {
2385
+ className: bn("flex cursor-pointer items-center justify-between rounded-md border border-gray-300 px-3 py-2 transition duration-300 hover:bg-gray-50", e._id === t?._id ? "border-brand bg-brand/10 hover:bg-brand/20" : ""),
1899
2386
  onClick: () => n(e),
1900
- children: /* @__PURE__ */ y("div", { children: [
1901
- /* @__PURE__ */ v("p", {
2387
+ children: /* @__PURE__ */ d("div", { children: [
2388
+ /* @__PURE__ */ u("p", {
1902
2389
  className: "text-md",
1903
2390
  children: e.title
1904
2391
  }),
1905
- /* @__PURE__ */ v("p", {
2392
+ /* @__PURE__ */ u("p", {
1906
2393
  className: "-mt-[2px] mb-1 text-gray-600 text-xs",
1907
2394
  children: e.description
1908
2395
  }),
1909
- /* @__PURE__ */ y("p", {
2396
+ /* @__PURE__ */ d("p", {
1910
2397
  className: "text-md",
1911
- children: [Q(e), jt(e) && /* @__PURE__ */ y("span", {
2398
+ children: [$(e), Cn(e) && /* @__PURE__ */ d("span", {
1912
2399
  className: "text-gray-500 text-sm",
1913
- children: [" ", jt(e)]
2400
+ children: [" ", Cn(e)]
1914
2401
  })]
1915
2402
  })
1916
2403
  ] })
1917
2404
  }, e._id))
1918
- }), /* @__PURE__ */ y("div", {
2405
+ }), /* @__PURE__ */ d("div", {
1919
2406
  className: "w-full md:w-[45%]",
1920
- children: [/* @__PURE__ */ y("div", {
2407
+ children: [/* @__PURE__ */ d("div", {
1921
2408
  className: "mt-4 flex min-h-[250px] flex-col justify-between rounded-md border border-gray-300 p-4 md:mt-0",
1922
- children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
2409
+ children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("p", {
1923
2410
  className: "border-b border-b-gray-200 pb-1 text-md",
1924
2411
  children: "Confirm Details"
1925
- }), /* @__PURE__ */ v("div", {
2412
+ }), /* @__PURE__ */ u("div", {
1926
2413
  className: "mt-2 flex flex-col gap-2",
1927
- children: t && /* @__PURE__ */ y("div", {
2414
+ children: t && /* @__PURE__ */ d("div", {
1928
2415
  className: "flex justify-between",
1929
- children: [/* @__PURE__ */ v("span", {
2416
+ children: [/* @__PURE__ */ u("span", {
1930
2417
  className: "text-md",
1931
2418
  children: t.title
1932
- }), /* @__PURE__ */ v("span", { children: Q({
2419
+ }), /* @__PURE__ */ u("span", { children: $({
1933
2420
  unit_amount: l ? t.subtotal : t.unit_amount,
1934
2421
  currency: t.currency
1935
2422
  }) })]
1936
2423
  })
1937
- })] }), r && u ? /* @__PURE__ */ y("div", {
2424
+ })] }), r && f ? /* @__PURE__ */ d("div", {
1938
2425
  className: "mt-2",
1939
2426
  children: [
1940
- /* @__PURE__ */ y("div", {
2427
+ /* @__PURE__ */ d("div", {
1941
2428
  className: "flex items-center justify-between",
1942
- children: [/* @__PURE__ */ v("span", {
2429
+ children: [/* @__PURE__ */ u("span", {
1943
2430
  className: "text-md",
1944
2431
  children: "Subtotal"
1945
- }), /* @__PURE__ */ v("span", {
2432
+ }), /* @__PURE__ */ u("span", {
1946
2433
  className: "text-md",
1947
- children: Q({
2434
+ children: $({
1948
2435
  unit_amount: r.base_amount,
1949
2436
  currency: t?.currency
1950
2437
  })
1951
2438
  })]
1952
2439
  }),
1953
- /* @__PURE__ */ y("div", {
2440
+ /* @__PURE__ */ d("div", {
1954
2441
  className: "flex items-center justify-between text-green-600",
1955
- children: [/* @__PURE__ */ v("span", {
2442
+ children: [/* @__PURE__ */ u("span", {
1956
2443
  className: "text-md",
1957
2444
  children: "Discount"
1958
- }), /* @__PURE__ */ y("span", {
2445
+ }), /* @__PURE__ */ d("span", {
1959
2446
  className: "text-md",
1960
2447
  children: [
1961
2448
  "-",
1962
2449
  " ",
1963
- Q({
2450
+ $({
1964
2451
  unit_amount: r.discount,
1965
2452
  currency: t?.currency
1966
2453
  })
1967
2454
  ]
1968
2455
  })]
1969
2456
  }),
1970
- /* @__PURE__ */ y("div", {
2457
+ /* @__PURE__ */ d("div", {
1971
2458
  className: "flex items-center justify-between border-t border-t-gray-200 pt-1",
1972
- children: [/* @__PURE__ */ v("span", {
2459
+ children: [/* @__PURE__ */ u("span", {
1973
2460
  className: "text-md",
1974
2461
  children: "Taxable Amount"
1975
- }), /* @__PURE__ */ v("span", {
2462
+ }), /* @__PURE__ */ u("span", {
1976
2463
  className: "text-md",
1977
- children: Q({
2464
+ children: $({
1978
2465
  unit_amount: r.taxable_amount,
1979
2466
  currency: t?.currency
1980
2467
  })
1981
2468
  })]
1982
2469
  }),
1983
- r.taxes?.map((e, n) => /* @__PURE__ */ y("div", {
2470
+ r.taxes?.map((e, n) => /* @__PURE__ */ d("div", {
1984
2471
  className: "flex items-center justify-between text-gray-600",
1985
- children: [/* @__PURE__ */ y("span", {
2472
+ children: [/* @__PURE__ */ d("span", {
1986
2473
  className: "text-sm",
1987
2474
  children: [
1988
2475
  e.label,
@@ -1990,94 +2477,94 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1990
2477
  e.percentage,
1991
2478
  "%)"
1992
2479
  ]
1993
- }), /* @__PURE__ */ v("span", {
2480
+ }), /* @__PURE__ */ u("span", {
1994
2481
  className: "text-sm",
1995
- children: Q({
2482
+ children: $({
1996
2483
  unit_amount: e.amount,
1997
2484
  currency: t?.currency
1998
2485
  })
1999
2486
  })]
2000
2487
  }, e.id || e._id || n)),
2001
- /* @__PURE__ */ y("div", {
2488
+ /* @__PURE__ */ d("div", {
2002
2489
  className: "mt-1 flex items-center justify-between border-t border-t-gray-200 pt-1 font-medium",
2003
- children: [/* @__PURE__ */ v("span", {
2490
+ children: [/* @__PURE__ */ u("span", {
2004
2491
  className: "text-md",
2005
2492
  children: "Payable"
2006
- }), /* @__PURE__ */ v("span", {
2493
+ }), /* @__PURE__ */ u("span", {
2007
2494
  className: "text-md",
2008
- children: Q({
2495
+ children: $({
2009
2496
  unit_amount: r.total_amount,
2010
2497
  currency: t?.currency
2011
2498
  })
2012
2499
  })]
2013
2500
  })
2014
2501
  ]
2015
- }) : r ? /* @__PURE__ */ y("div", {
2502
+ }) : r ? /* @__PURE__ */ d("div", {
2016
2503
  className: "mt-2",
2017
2504
  children: [
2018
- /* @__PURE__ */ y("div", {
2505
+ /* @__PURE__ */ d("div", {
2019
2506
  className: "flex items-center justify-between",
2020
- children: [/* @__PURE__ */ v("span", {
2507
+ children: [/* @__PURE__ */ u("span", {
2021
2508
  className: "text-md",
2022
2509
  children: "Subtotal"
2023
- }), /* @__PURE__ */ v("span", {
2510
+ }), /* @__PURE__ */ u("span", {
2024
2511
  className: "text-md",
2025
- children: Q({
2512
+ children: $({
2026
2513
  unit_amount: r.base_amount,
2027
2514
  currency: t?.currency
2028
2515
  })
2029
2516
  })]
2030
2517
  }),
2031
- /* @__PURE__ */ y("div", {
2518
+ /* @__PURE__ */ d("div", {
2032
2519
  className: "flex items-center justify-between text-green-600",
2033
- children: [/* @__PURE__ */ v("span", {
2520
+ children: [/* @__PURE__ */ u("span", {
2034
2521
  className: "text-md",
2035
2522
  children: "Discount"
2036
- }), /* @__PURE__ */ y("span", {
2523
+ }), /* @__PURE__ */ d("span", {
2037
2524
  className: "text-md",
2038
2525
  children: [
2039
2526
  "-",
2040
2527
  " ",
2041
- Q({
2528
+ $({
2042
2529
  unit_amount: r.discount,
2043
2530
  currency: t?.currency
2044
2531
  })
2045
2532
  ]
2046
2533
  })]
2047
2534
  }),
2048
- /* @__PURE__ */ y("div", {
2535
+ /* @__PURE__ */ d("div", {
2049
2536
  className: "mt-1 flex items-center justify-between border-t border-t-gray-200 pt-1 font-medium",
2050
- children: [/* @__PURE__ */ v("span", {
2537
+ children: [/* @__PURE__ */ u("span", {
2051
2538
  className: "text-md",
2052
2539
  children: "Payable"
2053
- }), /* @__PURE__ */ v("span", {
2540
+ }), /* @__PURE__ */ u("span", {
2054
2541
  className: "text-md",
2055
- children: Q({
2542
+ children: $({
2056
2543
  unit_amount: r.sale_amount,
2057
2544
  currency: t?.currency
2058
2545
  })
2059
2546
  })]
2060
2547
  })
2061
2548
  ]
2062
- }) : l ? /* @__PURE__ */ y("div", {
2549
+ }) : l ? /* @__PURE__ */ d("div", {
2063
2550
  className: "mt-2",
2064
2551
  children: [
2065
- /* @__PURE__ */ y("div", {
2552
+ /* @__PURE__ */ d("div", {
2066
2553
  className: "flex items-center justify-between",
2067
- children: [/* @__PURE__ */ v("span", {
2554
+ children: [/* @__PURE__ */ u("span", {
2068
2555
  className: "text-md",
2069
2556
  children: "Subtotal"
2070
- }), /* @__PURE__ */ v("span", {
2557
+ }), /* @__PURE__ */ u("span", {
2071
2558
  className: "text-md",
2072
- children: Q({
2559
+ children: $({
2073
2560
  unit_amount: t.subtotal,
2074
2561
  currency: t?.currency
2075
2562
  })
2076
2563
  })]
2077
2564
  }),
2078
- t.taxes.map((e, n) => /* @__PURE__ */ y("div", {
2565
+ t.taxes.map((e, n) => /* @__PURE__ */ d("div", {
2079
2566
  className: "flex items-center justify-between text-gray-600",
2080
- children: [/* @__PURE__ */ y("span", {
2567
+ children: [/* @__PURE__ */ d("span", {
2081
2568
  className: "text-sm",
2082
2569
  children: [
2083
2570
  e.label,
@@ -2085,81 +2572,81 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2085
2572
  e.percentage,
2086
2573
  "%)"
2087
2574
  ]
2088
- }), /* @__PURE__ */ v("span", {
2575
+ }), /* @__PURE__ */ u("span", {
2089
2576
  className: "text-sm",
2090
- children: Q({
2577
+ children: $({
2091
2578
  unit_amount: e.amount,
2092
2579
  currency: t?.currency
2093
2580
  })
2094
2581
  })]
2095
2582
  }, e.id || e._id || n)),
2096
- /* @__PURE__ */ y("div", {
2583
+ /* @__PURE__ */ d("div", {
2097
2584
  className: "mt-1 flex items-center justify-between border-t border-t-gray-200 pt-1 font-medium",
2098
- children: [/* @__PURE__ */ v("span", {
2585
+ children: [/* @__PURE__ */ u("span", {
2099
2586
  className: "text-md",
2100
2587
  children: "Payable"
2101
- }), /* @__PURE__ */ v("span", {
2588
+ }), /* @__PURE__ */ u("span", {
2102
2589
  className: "text-md",
2103
- children: Q({
2590
+ children: $({
2104
2591
  unit_amount: t.total,
2105
2592
  currency: t?.currency
2106
2593
  })
2107
2594
  })]
2108
2595
  }),
2109
- t.tax_inclusive && /* @__PURE__ */ v("p", {
2596
+ t.tax_inclusive && /* @__PURE__ */ u("p", {
2110
2597
  className: "mt-1 text-gray-500 text-xs",
2111
2598
  children: "* Price is inclusive of taxes"
2112
2599
  })
2113
2600
  ]
2114
- }) : /* @__PURE__ */ v("div", {
2601
+ }) : /* @__PURE__ */ u("div", {
2115
2602
  className: "mt-2",
2116
- children: /* @__PURE__ */ y("div", {
2603
+ children: /* @__PURE__ */ d("div", {
2117
2604
  className: "flex items-center justify-between font-medium",
2118
- children: [/* @__PURE__ */ v("span", {
2605
+ children: [/* @__PURE__ */ u("span", {
2119
2606
  className: "text-md",
2120
2607
  children: "Payable"
2121
- }), /* @__PURE__ */ v("span", {
2608
+ }), /* @__PURE__ */ u("span", {
2122
2609
  className: "text-md",
2123
- children: Q(t)
2610
+ children: $(t)
2124
2611
  })]
2125
2612
  })
2126
2613
  })]
2127
- }), r ? /* @__PURE__ */ v("div", {
2614
+ }), r ? /* @__PURE__ */ u("div", {
2128
2615
  className: "flex flex-col justify-between gap-1 py-2",
2129
- children: /* @__PURE__ */ y("div", {
2616
+ children: /* @__PURE__ */ d("div", {
2130
2617
  className: "mt-2 mb-1 space-y-1 rounded-lg border border-green-200 bg-green-50 px-3 py-3",
2131
- children: [/* @__PURE__ */ y("div", {
2618
+ children: [/* @__PURE__ */ d("div", {
2132
2619
  className: "flex items-start justify-between gap-2",
2133
- children: [/* @__PURE__ */ y("div", {
2620
+ children: [/* @__PURE__ */ d("div", {
2134
2621
  className: "flex max-w-16 items-center gap-2",
2135
- children: [/* @__PURE__ */ v("div", {
2622
+ children: [/* @__PURE__ */ u("div", {
2136
2623
  className: "rounded bg-green-500 p-2",
2137
- children: /* @__PURE__ */ v(ee, {
2624
+ children: /* @__PURE__ */ u(j, {
2138
2625
  size: 16,
2139
2626
  className: "text-white"
2140
2627
  })
2141
- }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("div", {
2628
+ }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("div", {
2142
2629
  className: "font-medium text-green-700 text-xs uppercase opacity-60",
2143
2630
  children: "Coupon Applied"
2144
- }), /* @__PURE__ */ v("div", {
2631
+ }), /* @__PURE__ */ u("div", {
2145
2632
  className: "-mt-0.5 max-w-32 truncate font-bold text-green-900 text-sm tracking-wide",
2146
2633
  children: i
2147
2634
  })] })]
2148
- }), /* @__PURE__ */ v("button", {
2635
+ }), /* @__PURE__ */ u("button", {
2149
2636
  type: "button",
2150
2637
  onClick: s,
2151
2638
  className: "rounded-md p-1 text-green-600 transition-colors hover:bg-green-100 hover:text-green-800",
2152
2639
  "aria-label": "Remove coupon",
2153
- children: /* @__PURE__ */ v(j, { size: 18 })
2640
+ children: /* @__PURE__ */ u(re, { size: 18 })
2154
2641
  })]
2155
- }), /* @__PURE__ */ y("div", {
2642
+ }), /* @__PURE__ */ d("div", {
2156
2643
  className: "text-green-700 text-xs",
2157
2644
  children: [
2158
2645
  "You are saving",
2159
2646
  " ",
2160
- /* @__PURE__ */ v("span", {
2647
+ /* @__PURE__ */ u("span", {
2161
2648
  className: "font-semibold",
2162
- children: Q({
2649
+ children: $({
2163
2650
  unit_amount: r.discount,
2164
2651
  currency: t?.currency
2165
2652
  })
@@ -2167,33 +2654,33 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2167
2654
  ]
2168
2655
  })]
2169
2656
  })
2170
- }) : /* @__PURE__ */ y("div", {
2171
- className: Ot("flex cursor-pointer items-center justify-between border-b border-b-gray-300 pr-1 pl-4 transition-all duration-200 hover:bg-gray-50", t ? "h-[50px] py-3" : "py-3"),
2657
+ }) : /* @__PURE__ */ d("div", {
2658
+ className: bn("flex cursor-pointer items-center justify-between border-b border-b-gray-300 pr-1 pl-4 transition-all duration-200 hover:bg-gray-50", t ? "h-[50px] py-3" : "py-3"),
2172
2659
  onClick: () => t ? o() : null,
2173
- children: [/* @__PURE__ */ y("span", {
2660
+ children: [/* @__PURE__ */ d("span", {
2174
2661
  className: "flex items-center gap-2",
2175
- children: ["Apply Coupon", a > 0 && /* @__PURE__ */ v("span", {
2662
+ children: ["Apply Coupon", a > 0 && /* @__PURE__ */ u("span", {
2176
2663
  className: "rounded-full bg-gray-200 px-2 py-0.5 text-gray-600 text-xs",
2177
2664
  children: a
2178
2665
  })]
2179
- }), /* @__PURE__ */ v("span", { children: /* @__PURE__ */ v(k, {}) })]
2666
+ }), /* @__PURE__ */ u("span", { children: /* @__PURE__ */ u(A, {}) })]
2180
2667
  })]
2181
2668
  })]
2182
- }), /* @__PURE__ */ v("div", {
2669
+ }), /* @__PURE__ */ u("div", {
2183
2670
  className: "mt-3 flex justify-start",
2184
- children: /* @__PURE__ */ v(Z, {
2671
+ children: /* @__PURE__ */ u(Q, {
2185
2672
  onClick: c,
2186
2673
  className: "rounded-lg bg-brand px-6 py-2 font-semibold text-brand-foreground hover:opacity-90",
2187
2674
  children: "Continue for Payment"
2188
2675
  })
2189
2676
  })] });
2190
- }, Bt = () => {
2191
- let [e, t] = g(null), [n, r] = g(null), [i, a] = g(!1), [o, s] = g(null);
2677
+ }, Nn = () => {
2678
+ let [e, t] = S(null), [n, r] = S(null), [i, a] = S(!1), [o, s] = S(null);
2192
2679
  return {
2193
2680
  stripePromise: e,
2194
2681
  config: n,
2195
2682
  isOpen: i,
2196
- openStripeCheckout: u(async (e) => {
2683
+ openStripeCheckout: g(async (e) => {
2197
2684
  try {
2198
2685
  let { loadStripe: n } = await import("@stripe/stripe-js");
2199
2686
  t(n(e.key)), r({ clientSecret: e.client_secret }), a(!0);
@@ -2201,17 +2688,17 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2201
2688
  console.error("Failed to initialize Stripe checkout:", e);
2202
2689
  }
2203
2690
  }, []),
2204
- closeStripeCheckout: u(() => {
2691
+ closeStripeCheckout: g(() => {
2205
2692
  a(!1), setTimeout(() => {
2206
2693
  r(null), t(null);
2207
2694
  }, 300);
2208
2695
  }, []),
2209
2696
  onComplete: o,
2210
- setOnComplete: u((e) => {
2697
+ setOnComplete: g((e) => {
2211
2698
  s(() => e);
2212
2699
  }, [])
2213
2700
  };
2214
- }, Vt = {
2701
+ }, Pn = {
2215
2702
  name: "",
2216
2703
  email: "",
2217
2704
  is_business_purchase: !1,
@@ -2227,32 +2714,32 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2227
2714
  country: ""
2228
2715
  }
2229
2716
  }
2230
- }, Ht = (e, t, n) => {
2717
+ }, Fn = (e, t, n) => {
2231
2718
  let r = t.split("."), i = structuredClone(e), a = i, o = r.length - 1;
2232
2719
  return r.forEach((e, t) => {
2233
2720
  t === o ? a[e] = n : a = a[e];
2234
2721
  }), i;
2235
- }, Ut = async (e, t) => {
2722
+ }, In = async (e, t) => {
2236
2723
  try {
2237
2724
  let n = new URLSearchParams();
2238
2725
  return n.append("query", JSON.stringify({ where: { status: "active" } })), (await e.fetch?.url(`/v1/event/event/${t}/ticket/query?${n.toString()}`).get().json())?.content?.data;
2239
2726
  } catch (t) {
2240
- e.logger?.error("Failed to fetch event tickets", { exception: x(t) });
2727
+ e.logger?.error("Failed to fetch event tickets", { exception: c(t) });
2241
2728
  }
2242
- }, Wt = ({ eventID: e, title: t, external: r, buttonText: i = "Register Now" }) => {
2243
- let a = n(), [o, s] = g([]), [c, l] = g(!0), [d, p] = g(!1), [m, b] = g(!1), [S, C] = g(null), [w, E] = g(void 0), [D, O] = g(""), [k, A] = g(null), [ee, j] = g(!1), [re, M] = g(null), [N, P] = g(!1), [ie, F] = g(1), [I, L] = g(null), [ae, oe] = g([]), [se, R] = g(Vt), z = Pt(S, k) === 0, B = h(null), ce = () => R(Vt), V = () => {
2244
- A(null), E(void 0), M(null), j(!1), O(""), L(null), p(!1), F(1), ce();
2245
- }, { Razorpay: H } = ne(), { stripePromise: U, config: W, isOpen: G, openStripeCheckout: le, closeStripeCheckout: K, setOnComplete: ue } = Bt(), de = () => {
2246
- let e = B.current;
2729
+ }, Ln = ({ eventID: e, title: t, external: n, buttonText: r = "Register Now" }) => {
2730
+ let a = i(), [o, s] = S([]), [f, p] = S(!0), [m, h] = S(!1), [_, y] = S(!1), [b, w] = S(null), [T, E] = S(void 0), [D, O] = S(""), [ee, k] = S(null), [te, A] = S(!1), [ne, j] = S(null), [re, P] = S(!1), [ie, F] = S(1), [I, L] = S(null), [ae, R] = S([]), [z, oe] = S(Pn), B = En(b, ee) === 0, V = x(null), se = () => oe(Pn), H = () => {
2731
+ k(null), E(void 0), j(null), A(!1), O(""), L(null), h(!1), F(1), se();
2732
+ }, { Razorpay: U } = N(), { stripePromise: W, config: ce, isOpen: G, openStripeCheckout: le, closeStripeCheckout: K, setOnComplete: ue } = Nn(), q = () => {
2733
+ let e = V.current;
2247
2734
  !e || !a || a.fetch?.url(`/v1/event/booking/${e.bookingId}/confirm-booking`)?.post({ session_id: e.sessionId })?.json().then((e) => {
2248
- e?.content?.data && E(e?.content?.data), K(), B.current = null;
2735
+ e?.content?.data && E(e?.content?.data), K(), V.current = null;
2249
2736
  }).catch((e) => {
2250
- a.logger?.error("Failed to confirm booking after Stripe payment", { exception: x(e) }), K(), B.current = null;
2737
+ a.logger?.error("Failed to confirm booking after Stripe payment", { exception: c(e) }), K(), V.current = null;
2251
2738
  });
2252
- }, fe = async () => {
2739
+ }, de = async () => {
2253
2740
  if (!a) return;
2254
- b(!0), L(null);
2255
- let { name: t, email: n, is_business_purchase: r, billing_details: i } = se;
2741
+ y(!0), L(null);
2742
+ let { name: t, email: n, is_business_purchase: r, billing_details: i } = z;
2256
2743
  try {
2257
2744
  let o = {
2258
2745
  event: e,
@@ -2260,29 +2747,29 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2260
2747
  attendees: [{
2261
2748
  name: t,
2262
2749
  email: n,
2263
- ticket: S?._id,
2750
+ ticket: b?._id,
2264
2751
  details: {}
2265
2752
  }]
2266
2753
  };
2267
- r && !z && (o.is_business_purchase = !0, o.billing_details = i);
2754
+ r && !B && (o.is_business_purchase = !0, o.billing_details = i);
2268
2755
  let s = await a.fetch?.url(`/v1/event/event/${e}/booking/create-new-booking`)?.post(o).json();
2269
2756
  if (!s?.status) L("Booking failed. Please try again.");
2270
2757
  else {
2271
- V();
2758
+ H();
2272
2759
  let e = s?.content?.meta;
2273
2760
  if (e?.key) {
2274
2761
  let t = s?.content.data?._id;
2275
- e.provider === "stripe" && e.client_secret ? (B.current = t && e.session_id ? {
2762
+ e.provider === "stripe" && e.client_secret ? (V.current = t && e.session_id ? {
2276
2763
  bookingId: t,
2277
2764
  sessionId: e.session_id
2278
- } : null, ue(de), await le({
2765
+ } : null, ue(q), await le({
2279
2766
  key: e.key,
2280
2767
  client_secret: e.client_secret,
2281
2768
  amount: s?.content.data?.unit_amount || 0,
2282
2769
  currency: e.currency || "USD",
2283
2770
  provider: "stripe",
2284
2771
  reference_id: e.reference_id || ""
2285
- })) : pe({
2772
+ })) : fe({
2286
2773
  key: e.key,
2287
2774
  amount: s?.content.data?.unit_amount,
2288
2775
  currency: e.currency || "INR",
@@ -2292,12 +2779,12 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2292
2779
  } else E(s?.content.data);
2293
2780
  }
2294
2781
  } catch (e) {
2295
- L(x(e).message || "Something went wrong. Please try again.");
2782
+ L(c(e).message || "Something went wrong. Please try again.");
2296
2783
  }
2297
- b(!1);
2298
- }, pe = async (e) => {
2784
+ y(!1);
2785
+ }, fe = async (e) => {
2299
2786
  if (!a) return;
2300
- let n = new H({
2787
+ let n = new U({
2301
2788
  key: e.key,
2302
2789
  amount: e.amount ?? 0,
2303
2790
  currency: e.currency,
@@ -2312,7 +2799,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2312
2799
  })?.json().then((e) => {
2313
2800
  e?.content?.data?.status && E(e?.content?.data);
2314
2801
  }).catch((e) => {
2315
- a.logger?.error("Failed to confirm Razorpay booking", { exception: x(e) });
2802
+ a.logger?.error("Failed to confirm Razorpay booking", { exception: c(e) });
2316
2803
  });
2317
2804
  },
2318
2805
  prefill: {
@@ -2323,19 +2810,19 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2323
2810
  theme: { color: "#FC751A" }
2324
2811
  });
2325
2812
  n.on("payment.failed", (e) => {
2326
- a.logger?.error("Razorpay payment failed", { exception: x(e.error) });
2813
+ a.logger?.error("Razorpay payment failed", { exception: c(e.error) });
2327
2814
  }), n.open();
2328
- }, me = u(async () => {
2815
+ }, pe = g(async () => {
2329
2816
  if (a) try {
2330
2817
  let t = await a.fetch?.url(`/v1/event/event/${e}/coupon/list-public-coupons`)?.get().json();
2331
- t?.status && t?.content?.data && oe(t.content.data);
2818
+ t?.status && t?.content?.data && R(t.content.data);
2332
2819
  } catch (e) {
2333
- a.logger?.error("Failed to fetch public coupons", { exception: x(e) });
2820
+ a.logger?.error("Failed to fetch public coupons", { exception: c(e) });
2334
2821
  }
2335
- }, [a, e]), he = async (t) => {
2822
+ }, [a, e]), me = async (t) => {
2336
2823
  if (!a) return;
2337
2824
  let n = t ?? D;
2338
- j(!0), M(null);
2825
+ A(!0), j(null);
2339
2826
  try {
2340
2827
  let t = await a.fetch?.url(`/v1/event/event/${e}/coupon/validate-coupon-code`)?.post({
2341
2828
  coupon: n,
@@ -2343,141 +2830,141 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2343
2830
  attendees: [{
2344
2831
  name: "",
2345
2832
  email: "",
2346
- ticket: S?._id
2833
+ ticket: b?._id
2347
2834
  }]
2348
2835
  }).json();
2349
- t?.status && (A(t.content.data), O(n)), P(!1), j(!1);
2836
+ t?.status && (k(t.content.data), O(n)), P(!1), A(!1);
2350
2837
  } catch (e) {
2351
- M(x(e).message), j(!1);
2838
+ j(c(e).message), A(!1);
2352
2839
  }
2353
- }, ge = (e) => {
2354
- O(""), A(null), M(null), j(!1), L(null), C(e);
2840
+ }, he = (e) => {
2841
+ O(""), k(null), j(null), A(!1), L(null), w(e);
2842
+ }, ge = () => {
2843
+ k(null), j(null), O("");
2355
2844
  }, _e = () => {
2356
- A(null), M(null), O("");
2357
- }, ve = () => {
2358
- M(null), j(!1), O(""), P(!1);
2359
- }, ye = (e) => {
2845
+ j(null), A(!1), O(""), P(!1);
2846
+ }, ve = (e) => {
2360
2847
  let { name: t, value: n, type: r, checked: i } = e.target;
2361
- R((e) => Ht(e, t, r === "checkbox" ? i : n));
2362
- }, be = () => {}, xe = (e) => {
2363
- e?.preventDefault(), fe();
2848
+ oe((e) => Fn(e, t, r === "checkbox" ? i : n));
2849
+ }, ye = () => {}, be = (e) => {
2850
+ e?.preventDefault(), de();
2364
2851
  };
2365
- if (f(() => {
2366
- if (r) {
2367
- l(!1);
2852
+ if (v(() => {
2853
+ if (n) {
2854
+ p(!1);
2368
2855
  return;
2369
2856
  }
2370
- e && a && (l(!0), Ut(a, e).then((e) => {
2371
- s(e ?? []), e && e.length > 0 && C(e[0] || null), l(!1);
2857
+ e && a && (p(!0), In(a, e).then((e) => {
2858
+ s(e ?? []), e && e.length > 0 && w(e[0] || null), p(!1);
2372
2859
  }));
2373
2860
  }, [
2374
2861
  e,
2375
- r,
2862
+ n,
2376
2863
  a
2377
- ]), f(() => {
2378
- S?.unit_amount === 0 && o?.length === 1 && F(2);
2379
- }, [S, o]), f(() => {
2380
- d && e && me();
2864
+ ]), v(() => {
2865
+ b?.unit_amount === 0 && o?.length === 1 && F(2);
2866
+ }, [b, o]), v(() => {
2867
+ m && e && pe();
2381
2868
  }, [
2382
- d,
2869
+ m,
2383
2870
  e,
2384
- me
2385
- ]), r) return /* @__PURE__ */ v("div", {
2871
+ pe
2872
+ ]), n) return /* @__PURE__ */ u("div", {
2386
2873
  className: "my-2",
2387
- children: /* @__PURE__ */ v(Z, {
2874
+ children: /* @__PURE__ */ u(Q, {
2388
2875
  className: "rounded-lg bg-brand px-4 py-3 font-semibold text-brand-foreground hover:opacity-90",
2389
- onClick: () => window.open(r, "_blank", "noopener,noreferrer"),
2390
- children: i
2876
+ onClick: () => window.open(n, "_blank", "noopener,noreferrer"),
2877
+ children: r
2391
2878
  })
2392
2879
  });
2393
- if (c) return /* @__PURE__ */ v("div", {
2880
+ if (f) return /* @__PURE__ */ u("div", {
2394
2881
  className: "my-2",
2395
- children: /* @__PURE__ */ v(Z, {
2882
+ children: /* @__PURE__ */ u(Q, {
2396
2883
  className: "rounded-lg bg-brand px-4 py-2 font-bold text-brand-foreground",
2397
2884
  children: "Loading..."
2398
2885
  })
2399
2886
  });
2400
- let Se = z ? "Complete Registration" : "Pay";
2401
- return /* @__PURE__ */ y(_, { children: [
2402
- /* @__PURE__ */ v("div", {
2887
+ let xe = B ? "Complete Registration" : "Pay";
2888
+ return /* @__PURE__ */ d(l, { children: [
2889
+ /* @__PURE__ */ u("div", {
2403
2890
  className: "my-2",
2404
- children: o?.length ? /* @__PURE__ */ v(Z, {
2405
- onClick: () => p(!0),
2891
+ children: o?.length ? /* @__PURE__ */ u(Q, {
2892
+ onClick: () => h(!0),
2406
2893
  className: "rounded-lg bg-brand px-4 py-3 font-semibold text-brand-foreground hover:opacity-90",
2407
- children: i
2408
- }) : /* @__PURE__ */ v("p", {
2894
+ children: r
2895
+ }) : /* @__PURE__ */ u("p", {
2409
2896
  className: "text-red-500",
2410
2897
  children: "No tickets available for this event."
2411
2898
  })
2412
2899
  }),
2413
- /* @__PURE__ */ v(T.Root, {
2414
- open: d,
2900
+ /* @__PURE__ */ u(C.Root, {
2901
+ open: m,
2415
2902
  onOpenChange: (e) => {
2416
- e || V();
2903
+ e || H();
2417
2904
  },
2418
- children: /* @__PURE__ */ y(T.Portal, { children: [/* @__PURE__ */ v(T.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ y(T.Popup, {
2419
- className: Ot("fixed top-24 left-1/2 z-[100] flex max-h-[calc(100dvh-12rem)] w-[90%] -translate-x-1/2 flex-col overflow-y-auto rounded-lg bg-white p-4", N ? "md:w-[30%]" : "md:w-[40%]"),
2420
- children: [/* @__PURE__ */ y("div", {
2421
- className: `mb-4 flex w-full items-start justify-between ${N ? "" : "pb-[6px]"} `,
2422
- children: [/* @__PURE__ */ y(T.Title, {
2905
+ children: /* @__PURE__ */ d(C.Portal, { children: [/* @__PURE__ */ u(C.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ d(C.Popup, {
2906
+ className: bn("fixed top-24 left-1/2 z-[100] flex max-h-[calc(100dvh-12rem)] w-[90%] -translate-x-1/2 flex-col overflow-y-auto rounded-lg bg-white p-4", re ? "md:w-[30%]" : "md:w-[40%]"),
2907
+ children: [/* @__PURE__ */ d("div", {
2908
+ className: `mb-4 flex w-full items-start justify-between ${re ? "" : "pb-[6px]"} `,
2909
+ children: [/* @__PURE__ */ d(C.Title, {
2423
2910
  className: "font-semibold text-lg",
2424
2911
  children: [
2425
2912
  "Register for ",
2426
2913
  t,
2427
2914
  "!"
2428
2915
  ]
2429
- }), /* @__PURE__ */ v(T.Close, {
2916
+ }), /* @__PURE__ */ u(C.Close, {
2430
2917
  className: "rounded-md p-2 hover:bg-gray-100 focus:outline-none",
2431
- children: /* @__PURE__ */ v(te, { className: "size-4" })
2918
+ children: /* @__PURE__ */ u(M, { className: "size-4" })
2432
2919
  })]
2433
- }), /* @__PURE__ */ y("div", { children: [I && /* @__PURE__ */ v("div", {
2920
+ }), /* @__PURE__ */ d("div", { children: [I && /* @__PURE__ */ u("div", {
2434
2921
  className: "mb-4 rounded-md bg-red-50 p-3 text-red-600 text-sm",
2435
2922
  children: I
2436
- }), ie === 1 ? /* @__PURE__ */ v("div", { children: N ? /* @__PURE__ */ v(Ft, {
2923
+ }), ie === 1 ? /* @__PURE__ */ u("div", { children: re ? /* @__PURE__ */ u(On, {
2437
2924
  couponCode: D,
2438
2925
  onCouponCodeChange: O,
2439
- couponError: re,
2440
- couponLoading: ee,
2441
- onValidateCoupon: he,
2926
+ couponError: ne,
2927
+ couponLoading: te,
2928
+ onValidateCoupon: me,
2442
2929
  publicCoupons: ae,
2443
- onBack: ve,
2444
- selectedTicket: S
2445
- }) : /* @__PURE__ */ v(zt, {
2930
+ onBack: _e,
2931
+ selectedTicket: b
2932
+ }) : /* @__PURE__ */ u(Mn, {
2446
2933
  tickets: o,
2447
- selectedTicket: S,
2448
- onSelectTicket: ge,
2449
- discount: k,
2934
+ selectedTicket: b,
2935
+ onSelectTicket: he,
2936
+ discount: ee,
2450
2937
  couponCode: D,
2451
2938
  publicCouponsCount: ae.length,
2452
2939
  onApplyCouponClick: () => P(!0),
2453
- onRemoveCoupon: _e,
2940
+ onRemoveCoupon: ge,
2454
2941
  onNext: () => F(2)
2455
- }) }) : /* @__PURE__ */ v(kt, {
2456
- values: se,
2457
- handleChange: ye,
2458
- handleBlur: be,
2459
- handleSubmit: xe,
2460
- registerLoading: m,
2942
+ }) }) : /* @__PURE__ */ u(xn, {
2943
+ values: z,
2944
+ handleChange: ve,
2945
+ handleBlur: ye,
2946
+ handleSubmit: be,
2947
+ registerLoading: _,
2461
2948
  onBack: () => F(1),
2462
- submitLabel: Se,
2463
- showBusinessBilling: !z
2949
+ submitLabel: xe,
2950
+ showBusinessBilling: !B
2464
2951
  })] })]
2465
2952
  })] })
2466
2953
  }),
2467
- w && /* @__PURE__ */ v(Lt, {
2468
- paymentData: w,
2954
+ T && /* @__PURE__ */ u(An, {
2955
+ paymentData: T,
2469
2956
  ticketData: o,
2470
2957
  type: "confirm"
2471
2958
  }),
2472
- G && W && /* @__PURE__ */ v(Rt, {
2959
+ G && ce && /* @__PURE__ */ u(jn, {
2473
2960
  isOpen: G,
2474
2961
  onClose: K,
2475
- stripePromise: U,
2476
- clientSecret: W.clientSecret,
2477
- onComplete: de
2962
+ stripePromise: W,
2963
+ clientSecret: ce.clientSecret,
2964
+ onComplete: q
2478
2965
  })
2479
2966
  ] });
2480
- }, Gt = (e) => typeof e == "string" && e.trim() ? e : void 0, Kt = (e) => typeof e == "string" ? e : e?.location ?? void 0, qt = (e, t) => {
2967
+ }, Rn = (e) => typeof e == "string" && e.trim() ? e : void 0, zn = (e) => typeof e == "string" ? e : e?.location ?? void 0, Bn = (e, t) => {
2481
2968
  let n = e.meta ?? {}, r = e.title && t ? `${e.title} | ${t}` : e.title || t || void 0;
2482
2969
  return {
2483
2970
  title: n.meta_title || r,
@@ -2487,33 +2974,33 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2487
2974
  og: {
2488
2975
  title: n.og_title || void 0,
2489
2976
  description: n.og_description || void 0,
2490
- image: Kt(n.og_image),
2977
+ image: zn(n.og_image),
2491
2978
  url: n.og_url || void 0
2492
2979
  },
2493
2980
  twitter: { card: n.twitter_card || void 0 },
2494
2981
  ldJson: n.ld_json || void 0,
2495
2982
  customHead: n.head_code || void 0
2496
2983
  };
2497
- }, Jt = (e) => ({
2984
+ }, Vn = (e) => ({
2498
2985
  description: e.description || void 0,
2499
2986
  icon: e.icon?.location || void 0,
2500
2987
  customHead: e.settings?.head_code || void 0
2501
- }), Yt = (e) => (t = {}, n) => (r) => {
2502
- let i = qt(t, e.name);
2988
+ }), Hn = (e) => (t = {}, n) => (r) => {
2989
+ let i = Bn(t, e.name);
2503
2990
  if (n) {
2504
2991
  let t = r?.loaderData?.[n.source];
2505
2992
  if (t) {
2506
- let r = n.title ? Gt(t[n.title]) : void 0;
2993
+ let r = n.title ? Rn(t[n.title]) : void 0;
2507
2994
  r && (i.title = e.name ? `${r} | ${e.name}` : r, i.og = {
2508
2995
  ...i.og,
2509
2996
  title: r
2510
2997
  });
2511
- let a = n.description ? Gt(t[n.description]) : void 0;
2998
+ let a = n.description ? Rn(t[n.description]) : void 0;
2512
2999
  a && (i.description = a, i.og = {
2513
3000
  ...i.og,
2514
3001
  description: a
2515
3002
  });
2516
- let o = n.image ? Kt(t[n.image]) : void 0;
3003
+ let o = n.image ? zn(t[n.image]) : void 0;
2517
3004
  o && (i.og = {
2518
3005
  ...i.og,
2519
3006
  image: o
@@ -2524,19 +3011,22 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2524
3011
  let t = r?.match?.pathname, n = (e.domain || "").trim();
2525
3012
  n && t?.startsWith("/") && (i.canonical = (/^https?:\/\//.test(n) ? n : `https://${n}`).replace(/\/+$/, "") + t);
2526
3013
  }
2527
- let a = Et(i, Jt(e)), o = t.id?.trim();
3014
+ let a = vn(i, Vn(e)), o = t.id?.trim();
2528
3015
  return o && a.meta.push({
2529
- name: gt,
3016
+ name: cn,
2530
3017
  content: o
2531
3018
  }), a;
2532
- }, Xt = (e) => {
2533
- let t = I(e);
2534
- return (e) => ({ context: n, params: r }) => pe({
2535
- queryClient: n.queryClient,
2536
- config: t,
2537
- sources: e,
2538
- params: r
2539
- });
3019
+ }, Un = (e) => {
3020
+ let t = q(e);
3021
+ return (e, n) => {
3022
+ let { rules: r, invalid: i } = H(n?.access), a = r.length > 0 || i;
3023
+ return ({ context: n, params: r }) => a ? Promise.resolve({}) : be({
3024
+ queryClient: n.queryClient,
3025
+ config: t,
3026
+ sources: e,
3027
+ params: r
3028
+ });
3029
+ };
2540
3030
  };
2541
3031
  //#endregion
2542
- export { ce as ColorModeProvider, mt as Inspector, ie as LevoChat, Wt as LevoEventRegister, he as LevoForm, yt as LevoPopups, St as LevoSiteProvider, gt as PAGE_ID_META, Dt as PageHead, Yt as createLevoHead, Xt as createLevoLoader, F as createSiteClient, Et as pageHead, Tt as parseRawHead, pe as prefetchLevoSources, _t as readPageId, I as siteConfigFromJson, V as useColorMode, fe as useLevoForm, xt as useLevoInsights, de as useLevoRecord, bt as useLevoSite, ue as useLevoSource };
3032
+ export { nt as ColorModeProvider, on as Inspector, L as LEVO_AUTH_METHODS, Y as LEVO_AUTH_QUERY_KEY, I as LEVO_OAUTH_METHODS, Ve as LEVO_OTP_LENGTH, je as LEVO_PENDING_APPROVAL_CODE, F as LEVO_PRIMARY_AUTH_METHODS, Je as LevoChat, we as LevoEntryForm, Ln as LevoEventRegister, it as LevoForm, dn as LevoPopups, ke as LevoProfileForm, mn as LevoSiteProvider, cn as PAGE_ID_META, yn as PageHead, Hn as createLevoHead, Un as createLevoLoader, ue as createSiteClient, K as decideAccess, Me as isPendingApprovalError, He as isValidEmail, Ue as isValidOtp, Ge as isValidPhone, We as normalizePhone, vn as pageHead, H as parseAccess, _n as parseRawHead, be as prefetchLevoSources, ln as readPageId, U as resolveAuthMethods, q as siteConfigFromJson, rt as useColorMode, Ae as useLevoAccess, Ce as useLevoAuth, ye as useLevoForm, pn as useLevoInsights, Fe as useLevoLogin, Be as useLevoOAuth, Ke as useLevoOtpInput, ve as useLevoRecord, fn as useLevoSite, _e as useLevoSource };