@levo-so/site-runtime 0.3.26 → 0.3.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/index.js +975 -873
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -4,36 +4,36 @@ import { c as n, o as r, s as i, t as a } from "./inlineBaseTheme-DcNdMEYp.js";
|
|
|
4
4
|
import { t as o } from "./inlineCollectionTheme-DjXuH3bK.js";
|
|
5
5
|
import { a as s, c, d as l, f as u, i as d, l as f, n as p, o as m, r as h, s as g, t as _, u as v } from "./routes-DO1BLfh9.js";
|
|
6
6
|
import { createLevoClient as y, getLevoError as b } from "@levo-so/core";
|
|
7
|
-
import { Suspense as x, createContext as S, lazy as C, useCallback as w, useContext as T, useEffect as E, useLayoutEffect as D, useMemo as O, useRef as k, useState as A, useSyncExternalStore as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { Dialog as
|
|
10
|
-
import { keepPreviousData as
|
|
11
|
-
import { Link as
|
|
12
|
-
import { createLevoInsights as
|
|
13
|
-
import { ArrowLeftIcon as
|
|
7
|
+
import { Suspense as x, createContext as S, lazy as C, useCallback as w, useContext as T, useEffect as E, useLayoutEffect as D, useMemo as O, useRef as k, useState as A, useSyncExternalStore as ee } from "react";
|
|
8
|
+
import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
9
|
+
import { Dialog as P } from "@base-ui/react/dialog";
|
|
10
|
+
import { keepPreviousData as F, useMutation as I, useQuery as L, useQueryClient as R } from "@tanstack/react-query";
|
|
11
|
+
import { Link as te, ScriptOnce as z, redirect as ne, useRouterState as B } from "@tanstack/react-router";
|
|
12
|
+
import { createLevoInsights as re } from "@levo-so/insights";
|
|
13
|
+
import { ArrowLeftIcon as ie, CalendarPlusIcon as ae, CheckIcon as V, ChevronDownIcon as oe, DownloadIcon as se, LoaderCircleIcon as ce, MinusIcon as le, PlusIcon as ue, TagIcon as de, XIcon as H } from "lucide-react";
|
|
14
14
|
import { Accordion as U } from "@base-ui/react/accordion";
|
|
15
15
|
import { Popover as W } from "@base-ui/react/popover";
|
|
16
|
-
import { useRazorpay as
|
|
17
|
-
import { EmbeddedCheckout as
|
|
16
|
+
import { useRazorpay as fe } from "react-razorpay";
|
|
17
|
+
import { EmbeddedCheckout as pe, EmbeddedCheckoutProvider as me } from "@stripe/react-stripe-js";
|
|
18
18
|
//#region src/access/types.ts
|
|
19
|
-
var
|
|
19
|
+
var he = [
|
|
20
20
|
"otp",
|
|
21
21
|
"magiclink",
|
|
22
22
|
"whatsapp"
|
|
23
|
-
],
|
|
23
|
+
], ge = [
|
|
24
24
|
"google",
|
|
25
25
|
"microsoft",
|
|
26
26
|
"linkedin"
|
|
27
|
-
],
|
|
28
|
-
if (!
|
|
29
|
-
let t = e.enabled === void 0 ? !0 : e.enabled === !0, n =
|
|
27
|
+
], _e = [...he, ...ge], ve = "otp", ye = (e) => typeof e == "object" && !!e && !Array.isArray(e), be = (e) => he.includes(e), xe = (e) => ge.includes(e), Se = (e) => Array.isArray(e) ? e.filter((e) => typeof e == "string") : [], Ce = (e) => e, we = (e) => {
|
|
28
|
+
if (!ye(e)) return null;
|
|
29
|
+
let t = e.enabled === void 0 ? !0 : e.enabled === !0, n = ye(e.options) ? e.options : {};
|
|
30
30
|
switch (e.kind) {
|
|
31
31
|
case "authentication": return {
|
|
32
32
|
kind: "authentication",
|
|
33
33
|
enabled: t,
|
|
34
34
|
options: {
|
|
35
|
-
methods:
|
|
36
|
-
...
|
|
35
|
+
methods: Se(n.methods).filter((e) => be(e) || xe(e)),
|
|
36
|
+
...be(n.primary_method) ? { primary_method: n.primary_method } : {}
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
case "gating": return typeof n.collection != "string" || !n.collection.trim() ? null : {
|
|
@@ -41,42 +41,42 @@ var me = [
|
|
|
41
41
|
enabled: t,
|
|
42
42
|
options: {
|
|
43
43
|
collection: n.collection.trim(),
|
|
44
|
-
...
|
|
45
|
-
hidden:
|
|
44
|
+
...ye(n.condition) ? { condition: Ce(n.condition) } : {},
|
|
45
|
+
hidden: Se(n.hidden)
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
case "profile": return {
|
|
49
49
|
kind: "profile",
|
|
50
50
|
enabled: t,
|
|
51
51
|
options: {
|
|
52
|
-
...
|
|
53
|
-
hidden:
|
|
52
|
+
...ye(n.condition) ? { condition: Ce(n.condition) } : {},
|
|
53
|
+
hidden: Se(n.hidden)
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
default: return null;
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, Te = (e) => {
|
|
59
59
|
if (!Array.isArray(e) || e.length === 0) return {
|
|
60
60
|
rules: [],
|
|
61
61
|
invalid: !1
|
|
62
62
|
};
|
|
63
|
-
let t = e.map(
|
|
63
|
+
let t = e.map(we).filter((e) => e !== null);
|
|
64
64
|
return {
|
|
65
65
|
rules: t.filter((e) => e.enabled !== !1),
|
|
66
66
|
invalid: t.length === 0
|
|
67
67
|
};
|
|
68
|
-
},
|
|
68
|
+
}, Ee = (e) => {
|
|
69
69
|
let t = e.find((e) => e.kind === "authentication"), n = t?.kind === "authentication" ? t.options?.methods ?? [] : [];
|
|
70
70
|
return {
|
|
71
|
-
primary: (t?.kind === "authentication" ? t.options?.primary_method : void 0) ?? n.find(
|
|
72
|
-
oauth: n.filter(
|
|
71
|
+
primary: (t?.kind === "authentication" ? t.options?.primary_method : void 0) ?? n.find(be) ?? ve,
|
|
72
|
+
oauth: n.filter(xe)
|
|
73
73
|
};
|
|
74
|
-
},
|
|
74
|
+
}, De = (e = null) => ({
|
|
75
75
|
state: "granted",
|
|
76
76
|
code: e,
|
|
77
77
|
message: null,
|
|
78
78
|
rule: null
|
|
79
|
-
}),
|
|
79
|
+
}), Oe = () => ({
|
|
80
80
|
state: "checking",
|
|
81
81
|
code: null,
|
|
82
82
|
message: null,
|
|
@@ -86,26 +86,26 @@ var me = [
|
|
|
86
86
|
code: e,
|
|
87
87
|
message: t,
|
|
88
88
|
rule: n
|
|
89
|
-
}),
|
|
89
|
+
}), ke = (e, t) => {
|
|
90
90
|
let n = t?.split(".")[0];
|
|
91
91
|
return e.find((e) => e.kind === n) ?? null;
|
|
92
|
-
},
|
|
92
|
+
}, Ae = (e, t) => {
|
|
93
93
|
let n = (e) => t.find((t) => t.kind === e);
|
|
94
|
-
if (e === "granted") return
|
|
94
|
+
if (e === "granted") return De();
|
|
95
95
|
if (e === "signed_out") return G("authentication.NOT_LOGGED_IN", "You need to be signed in to view this page.", n("authentication") ?? t[0] ?? null);
|
|
96
96
|
let r = n("gating");
|
|
97
97
|
if (e === "entry_missing" && r) return G("gating.ENTRY_NOT_FOUND", null, r);
|
|
98
98
|
if (e === "entry_under_review" && r) return G("gating.ENTRY_CONDITION_NOT_FULFILLED", "Your submission is being reviewed.", r);
|
|
99
99
|
let i = n("profile");
|
|
100
100
|
return e === "profile_incomplete" && i ? G("profile.CONDITION_NOT_FULFILLED", null, i) : null;
|
|
101
|
-
},
|
|
102
|
-
if (e.length === 0 && !t) return
|
|
101
|
+
}, je = ({ rules: e, invalid: t, pageId: n, hasClient: r, isReady: i, isLoggedIn: a, check: o, preview: s }) => {
|
|
102
|
+
if (e.length === 0 && !t) return De();
|
|
103
103
|
if (s) {
|
|
104
|
-
let t =
|
|
104
|
+
let t = Ae(s, e);
|
|
105
105
|
if (t) return t;
|
|
106
106
|
}
|
|
107
|
-
return 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 ?
|
|
108
|
-
},
|
|
107
|
+
return 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 ? De(o.data.code ?? null) : G(o.data.code ?? "access.CHECK_FAILED", o.data.message ?? null, ke(e, o.data.code)) : G("access.CHECK_FAILED", "We could not verify your access.") : Oe() : 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.") : Oe();
|
|
108
|
+
}, Me = (e) => {
|
|
109
109
|
let t = (e?.apiUrl || "").replace(/\/$/, "");
|
|
110
110
|
return t ? y({
|
|
111
111
|
apiUrl: t,
|
|
@@ -114,15 +114,15 @@ var me = [
|
|
|
114
114
|
NODE_ENV: "",
|
|
115
115
|
APP_MODE: e?.appMode || "production"
|
|
116
116
|
}) : null;
|
|
117
|
-
},
|
|
117
|
+
}, Ne = (e) => ({
|
|
118
118
|
apiUrl: e.levo?.api_url || "",
|
|
119
119
|
workspace: e.workspace_id || "",
|
|
120
120
|
siteId: e.id || "",
|
|
121
121
|
insightsUrl: e.levo?.insights_url || null,
|
|
122
122
|
appMode: e.levo?.app_mode || "production"
|
|
123
|
-
}),
|
|
123
|
+
}), Pe = /\{\$([A-Za-z0-9_]+)\}/g, Fe = (e) => {
|
|
124
124
|
let t = [], n = [], r = 0;
|
|
125
|
-
for (let i of e.matchAll(
|
|
125
|
+
for (let i of e.matchAll(Pe)) n.push(e.slice(r, i.index)), t.push(i[1]), r = i.index + i[0].length;
|
|
126
126
|
n.push(e.slice(r));
|
|
127
127
|
let i = (t) => /* @__PURE__ */ Error(`Levo pattern "${e}" ${t}`);
|
|
128
128
|
if (t.length === 0) throw i("names no variable: write each record as {$name}");
|
|
@@ -133,10 +133,10 @@ var me = [
|
|
|
133
133
|
names: t,
|
|
134
134
|
literals: n
|
|
135
135
|
};
|
|
136
|
-
},
|
|
137
|
-
let r =
|
|
136
|
+
}, Ie = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), Le = ({ literals: e }) => RegExp(`^${e.map(Ie).join("([^/]+)")}$`), Re = /* @__PURE__ */ new Set(), ze = (e, t, n) => {
|
|
137
|
+
let r = Fe(t), i = Le(r), a = (e) => {
|
|
138
138
|
let n = e;
|
|
139
|
-
return t.replace(
|
|
139
|
+
return t.replace(Pe, (e, r) => {
|
|
140
140
|
let i = n[r];
|
|
141
141
|
if (!i) throw Error(`Levo pattern "${t}" has no value for {$${r}}`);
|
|
142
142
|
return i;
|
|
@@ -146,7 +146,7 @@ var me = [
|
|
|
146
146
|
parse: (t) => {
|
|
147
147
|
if (!Object.hasOwn(t, e)) {
|
|
148
148
|
let n = Object.keys(t).join(", ") || "none";
|
|
149
|
-
return
|
|
149
|
+
return Re.has(e) || (Re.add(e), console.error(`levoParams("${e}", …) names a param this route does not have. Its params are: ${n}. The first argument must be the file's $param name.`)), !1;
|
|
150
150
|
}
|
|
151
151
|
let n = t[e], a = n ? i.exec(n) : null;
|
|
152
152
|
if (!a) return !1;
|
|
@@ -162,33 +162,33 @@ var me = [
|
|
|
162
162
|
[e]: a(t)
|
|
163
163
|
})
|
|
164
164
|
};
|
|
165
|
-
},
|
|
165
|
+
}, Be = (e, t, n) => Object.prototype.hasOwnProperty.call(n, t) ? null : `Record binding "${e}" reads param "${t}", but this route has no such param. Its params are: ${Object.keys(n).join(", ") || "none"}. On a levoParams page, param names a pattern variable (packages, cities), never the segment.`, Ve = (e) => [
|
|
166
166
|
"levo-source",
|
|
167
167
|
"list",
|
|
168
168
|
e.module,
|
|
169
169
|
e.identifier,
|
|
170
170
|
e.query ?? null,
|
|
171
171
|
e.options ?? null
|
|
172
|
-
],
|
|
172
|
+
], He = (e, t) => [
|
|
173
173
|
"levo-source",
|
|
174
174
|
"record",
|
|
175
175
|
e.module,
|
|
176
176
|
e.identifier,
|
|
177
177
|
t ?? null
|
|
178
|
-
],
|
|
178
|
+
], Ue = (e) => [
|
|
179
179
|
"levo-source",
|
|
180
180
|
"form",
|
|
181
181
|
e.module,
|
|
182
182
|
e.identifier
|
|
183
|
-
],
|
|
183
|
+
], We = {
|
|
184
184
|
blog_author: "author",
|
|
185
185
|
blog_category: "category",
|
|
186
186
|
blog_tag: "tag"
|
|
187
|
-
},
|
|
188
|
-
let n = encodeURIComponent(e.identifier), r = t ? `${encodeURIComponent(t)}/get-single` : "list", i =
|
|
187
|
+
}, Ge = (e, t) => {
|
|
188
|
+
let n = encodeURIComponent(e.identifier), r = t ? `${encodeURIComponent(t)}/get-single` : "list", i = We[e.module];
|
|
189
189
|
return i ? `/v1/blog/${n}/${i}/${r}` : e.module === "community" ? `/v1/community/${n}/post/${r}` : null;
|
|
190
|
-
},
|
|
191
|
-
let n =
|
|
190
|
+
}, Ke = async (e, t) => {
|
|
191
|
+
let n = Ge(t);
|
|
192
192
|
if (n) {
|
|
193
193
|
let r = await e.fetch.url(n).post(t.query ?? {}).json();
|
|
194
194
|
return {
|
|
@@ -204,16 +204,16 @@ var me = [
|
|
|
204
204
|
data: r.content.data ?? [],
|
|
205
205
|
meta: r.content.meta ?? null
|
|
206
206
|
};
|
|
207
|
-
},
|
|
208
|
-
let r =
|
|
207
|
+
}, qe = async (e, t, n) => {
|
|
208
|
+
let r = Ge(t, n);
|
|
209
209
|
return r ? (await e.fetch.url(r).get().json()).content.data ?? null : (t.module === "collection" ? await e.collection.getCollectionContent({
|
|
210
210
|
collection_key: t.identifier,
|
|
211
211
|
slug: n
|
|
212
212
|
}) : t.module === "blog" ? await e.blog.getSingleBlog(t.identifier, n, { workspace_id: e.workspace ?? "" }) : await e.event.getSingleEvent(n, { workspace_id: e.workspace ?? "" })).content.data ?? null;
|
|
213
|
-
},
|
|
214
|
-
let t = i(), n =
|
|
215
|
-
queryKey:
|
|
216
|
-
queryFn: () =>
|
|
213
|
+
}, Je = async (e, t) => (await e.collection.getCollectionByIDExpanded(t.identifier)).content.data ?? null, Ye = (e) => {
|
|
214
|
+
let t = i(), n = L({
|
|
215
|
+
queryKey: Ve(e),
|
|
216
|
+
queryFn: () => Ke(t, e),
|
|
217
217
|
enabled: !!t
|
|
218
218
|
});
|
|
219
219
|
return {
|
|
@@ -226,10 +226,10 @@ var me = [
|
|
|
226
226
|
...e
|
|
227
227
|
}) }
|
|
228
228
|
};
|
|
229
|
-
},
|
|
230
|
-
let n = i(), r =
|
|
231
|
-
queryKey:
|
|
232
|
-
queryFn: () =>
|
|
229
|
+
}, Xe = (e, t) => {
|
|
230
|
+
let n = i(), r = L({
|
|
231
|
+
queryKey: He(e, t),
|
|
232
|
+
queryFn: () => qe(n, e, t),
|
|
233
233
|
enabled: !!n && !!t
|
|
234
234
|
});
|
|
235
235
|
return {
|
|
@@ -241,10 +241,10 @@ var me = [
|
|
|
241
241
|
...e
|
|
242
242
|
}) }
|
|
243
243
|
};
|
|
244
|
-
},
|
|
245
|
-
let t = i(), n =
|
|
246
|
-
queryKey:
|
|
247
|
-
queryFn: () =>
|
|
244
|
+
}, Ze = (e) => {
|
|
245
|
+
let t = i(), n = L({
|
|
246
|
+
queryKey: Ue(e),
|
|
247
|
+
queryFn: () => Je(t, e),
|
|
248
248
|
enabled: !!t
|
|
249
249
|
});
|
|
250
250
|
return {
|
|
@@ -256,35 +256,35 @@ var me = [
|
|
|
256
256
|
...e
|
|
257
257
|
}) }
|
|
258
258
|
};
|
|
259
|
-
},
|
|
259
|
+
}, Qe = (e) => {
|
|
260
260
|
let t = Object.values(e ?? {});
|
|
261
261
|
return t.length === 1 ? t[0] : e?.slug;
|
|
262
|
-
},
|
|
263
|
-
let i =
|
|
262
|
+
}, $e = async ({ queryClient: e, config: t, sources: n, params: r }) => {
|
|
263
|
+
let i = Me(t);
|
|
264
264
|
if (!i || !n) return {};
|
|
265
265
|
let a = await Promise.all(Object.entries(n).map(async ([t, n]) => {
|
|
266
266
|
if (n.mode === "record") {
|
|
267
|
-
let a = n.param ?
|
|
267
|
+
let a = n.param ? Be(t, n.param, r ?? {}) : null;
|
|
268
268
|
if (a) {
|
|
269
269
|
if (i.APP_MODE !== "production") throw Error(a);
|
|
270
270
|
return i.logger.error(a), [t, null];
|
|
271
271
|
}
|
|
272
|
-
let o = n.param ? r?.[n.param] :
|
|
272
|
+
let o = n.param ? r?.[n.param] : Qe(r);
|
|
273
273
|
return o ? [t, await e.ensureQueryData({
|
|
274
|
-
queryKey:
|
|
275
|
-
queryFn: () =>
|
|
274
|
+
queryKey: He(n, o),
|
|
275
|
+
queryFn: () => qe(i, n, o)
|
|
276
276
|
}).catch(() => null)] : [t, null];
|
|
277
277
|
}
|
|
278
278
|
return n.mode === "form" ? [t, await e.ensureQueryData({
|
|
279
|
-
queryKey:
|
|
280
|
-
queryFn: () =>
|
|
279
|
+
queryKey: Ue(n),
|
|
280
|
+
queryFn: () => Je(i, n)
|
|
281
281
|
}).catch(() => null)] : [t, await e.ensureQueryData({
|
|
282
|
-
queryKey:
|
|
283
|
-
queryFn: () =>
|
|
282
|
+
queryKey: Ve(n),
|
|
283
|
+
queryFn: () => Ke(i, n)
|
|
284
284
|
}).catch(() => null)];
|
|
285
285
|
}));
|
|
286
286
|
return Object.fromEntries(a);
|
|
287
|
-
},
|
|
287
|
+
}, et = {
|
|
288
288
|
background: "var(--color-page)",
|
|
289
289
|
foreground: "var(--color-ink)",
|
|
290
290
|
text: "var(--color-ink)",
|
|
@@ -306,10 +306,10 @@ var me = [
|
|
|
306
306
|
input: "var(--color-background1)",
|
|
307
307
|
inputForeground: "var(--color-ink)",
|
|
308
308
|
ring: "var(--color-brand)"
|
|
309
|
-
},
|
|
309
|
+
}, tt = (e) => O(() => ({
|
|
310
310
|
...a({
|
|
311
311
|
colors: {
|
|
312
|
-
|
|
312
|
+
...et,
|
|
313
313
|
...e?.colors
|
|
314
314
|
},
|
|
315
315
|
radius: e?.radius ?? "var(--radius-token)",
|
|
@@ -328,8 +328,8 @@ function K() {
|
|
|
328
328
|
}
|
|
329
329
|
//#endregion
|
|
330
330
|
//#region src/access/useLevoAuth.ts
|
|
331
|
-
var q = ["levo-auth", "session"],
|
|
332
|
-
let e = i(), t =
|
|
331
|
+
var q = ["levo-auth", "session"], nt = () => {
|
|
332
|
+
let e = i(), t = R(), n = K(), r = L({
|
|
333
333
|
queryKey: q,
|
|
334
334
|
queryFn: async () => {
|
|
335
335
|
try {
|
|
@@ -341,7 +341,7 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
341
341
|
enabled: n && !!e,
|
|
342
342
|
staleTime: 3e4,
|
|
343
343
|
retry: !1
|
|
344
|
-
}), a =
|
|
344
|
+
}), a = I({
|
|
345
345
|
mutationFn: async () => {
|
|
346
346
|
await e?.membership?.signOut();
|
|
347
347
|
},
|
|
@@ -363,14 +363,14 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
363
363
|
signOut: s,
|
|
364
364
|
isSigningOut: a.isPending
|
|
365
365
|
};
|
|
366
|
-
},
|
|
367
|
-
let c = i(), { account: l } =
|
|
366
|
+
}, rt = ({ collection: e, hidden: n, submitLabel: r = "Submit", onSuccess: a, theme: o, className: s }) => {
|
|
367
|
+
let c = i(), { account: l } = nt(), { schema: u, isLoading: d } = Ze({
|
|
368
368
|
module: "collection",
|
|
369
369
|
identifier: e
|
|
370
|
-
}), f =
|
|
371
|
-
return c ? /* @__PURE__ */
|
|
370
|
+
}), f = tt(o);
|
|
371
|
+
return c ? /* @__PURE__ */ M("div", {
|
|
372
372
|
className: s,
|
|
373
|
-
children: /* @__PURE__ */
|
|
373
|
+
children: /* @__PURE__ */ M(t, {
|
|
374
374
|
fetchedSchema: u,
|
|
375
375
|
isLoading: d,
|
|
376
376
|
submitButtonConfig: {
|
|
@@ -391,17 +391,17 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
391
391
|
onSuccess: () => a?.()
|
|
392
392
|
})
|
|
393
393
|
}) : null;
|
|
394
|
-
},
|
|
394
|
+
}, it = "so_levo_membership_account", at = [
|
|
395
395
|
"profile_picture",
|
|
396
396
|
"first_name",
|
|
397
397
|
"last_name",
|
|
398
398
|
"email",
|
|
399
399
|
"username",
|
|
400
400
|
"socials"
|
|
401
|
-
],
|
|
402
|
-
let c = i(), l = K(), { account: u } =
|
|
401
|
+
], ot = ["email", "username"], st = (e) => at.includes(e.key) || e.editable === !0, ct = ({ hidden: t, submitLabel: n = "Save and continue", onSuccess: r, errorClassName: a = "text-sm text-[var(--color-danger)]", theme: o, className: s }) => {
|
|
402
|
+
let c = i(), l = K(), { account: u } = nt(), d = tt(o), [f, p] = A(""), m = L({
|
|
403
403
|
queryKey: ["levo-access", "profile-schema"],
|
|
404
|
-
queryFn: async () => (await c?.collection?.getCollectionByIDExpanded(
|
|
404
|
+
queryFn: async () => (await c?.collection?.getCollectionByIDExpanded(it))?.content?.data ?? null,
|
|
405
405
|
enabled: l && !!c,
|
|
406
406
|
staleTime: 5 * 6e4,
|
|
407
407
|
retry: 1
|
|
@@ -413,14 +413,14 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
413
413
|
...e,
|
|
414
414
|
fields: e.fields?.map((e) => ({
|
|
415
415
|
...e,
|
|
416
|
-
hidden: !
|
|
417
|
-
readonly: e.readonly ||
|
|
416
|
+
hidden: !st(e) || !!t?.includes(e.key),
|
|
417
|
+
readonly: e.readonly || ot.includes(e.key)
|
|
418
418
|
}))
|
|
419
419
|
}))
|
|
420
420
|
} : null;
|
|
421
|
-
}, [m.data, h]), _ =
|
|
421
|
+
}, [m.data, h]), _ = I({
|
|
422
422
|
mutationFn: async (e) => {
|
|
423
|
-
let n = g?.sections?.flatMap((e) => e?.fields ?? [])?.filter((e) =>
|
|
423
|
+
let n = g?.sections?.flatMap((e) => e?.fields ?? [])?.filter((e) => st(e) && !ot.includes(e.key) && !t?.includes(e.key))?.map((e) => e?.key) ?? [];
|
|
424
424
|
await c?.membership?.updateMe(Object.fromEntries(Object.entries(e).filter(([e]) => n.includes(e))));
|
|
425
425
|
},
|
|
426
426
|
onMutate: () => p(""),
|
|
@@ -430,12 +430,12 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
430
430
|
c?.logger?.error("Failed to update profile", { exception: t }), p(t?.message || "Something went wrong. Please try again.");
|
|
431
431
|
}
|
|
432
432
|
});
|
|
433
|
-
return c ? /* @__PURE__ */
|
|
433
|
+
return c ? /* @__PURE__ */ N("div", {
|
|
434
434
|
className: s,
|
|
435
|
-
children: [f ? /* @__PURE__ */
|
|
435
|
+
children: [f ? /* @__PURE__ */ M("p", {
|
|
436
436
|
className: a,
|
|
437
437
|
children: f
|
|
438
|
-
}) : null, g ? /* @__PURE__ */
|
|
438
|
+
}) : null, g ? /* @__PURE__ */ M(e, {
|
|
439
439
|
schema: g,
|
|
440
440
|
initialValues: u ?? {},
|
|
441
441
|
uiConfig: {
|
|
@@ -451,15 +451,15 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
451
451
|
onSubmit: (e) => _.mutate(e)
|
|
452
452
|
}) : null]
|
|
453
453
|
}) : null;
|
|
454
|
-
},
|
|
455
|
-
if (
|
|
456
|
-
|
|
457
|
-
for (let e of
|
|
454
|
+
}, lt = null, ut = /* @__PURE__ */ new Set(), dt = (e) => {
|
|
455
|
+
if (lt !== e) {
|
|
456
|
+
lt = e;
|
|
457
|
+
for (let e of ut) e();
|
|
458
458
|
}
|
|
459
|
-
},
|
|
460
|
-
|
|
461
|
-
}),
|
|
462
|
-
let t = i(), n =
|
|
459
|
+
}, ft = (e) => (ut.add(e), () => {
|
|
460
|
+
ut.delete(e);
|
|
461
|
+
}), pt = () => ee(ft, () => lt, () => null), mt = (e) => {
|
|
462
|
+
let t = i(), n = R(), r = K(), { isLoggedIn: a, isLoaded: o } = nt(), s = pt(), c = e.id?.trim() || "", { rules: l, invalid: u } = O(() => Te(e.access), [e.access]), d = O(() => Ee(l), [l]), f = r && !!t && l.length > 0 && !u && !!c && a && !s, p = L({
|
|
463
463
|
queryKey: ["levo-access", c],
|
|
464
464
|
queryFn: async () => (await t?.fetch.url(`/v1/builder/page/${c}/check-access`).post().json())?.content?.data ?? null,
|
|
465
465
|
enabled: f,
|
|
@@ -477,7 +477,7 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
477
477
|
n.invalidateQueries({ queryKey: q }), n.invalidateQueries({ queryKey: ["levo-access", c] });
|
|
478
478
|
}, [n, c]);
|
|
479
479
|
return {
|
|
480
|
-
...
|
|
480
|
+
...je({
|
|
481
481
|
rules: l,
|
|
482
482
|
invalid: u,
|
|
483
483
|
pageId: c,
|
|
@@ -495,26 +495,26 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
495
495
|
recheck: m,
|
|
496
496
|
isChecking: p.isFetching
|
|
497
497
|
};
|
|
498
|
-
},
|
|
498
|
+
}, ht = "membership.account.ACCOUNT_PENDING_APPROVAL", gt = (e) => e ? e === "membership.account.ACCOUNT_PENDING_APPROVAL" || e.includes("ACCOUNT_PENDING_APPROVAL") : !1, _t = (e) => {
|
|
499
499
|
let t = b(e);
|
|
500
500
|
return {
|
|
501
501
|
code: t?.code || "SOMETHING_WENT_WRONG",
|
|
502
502
|
title: t?.title || "Something went wrong",
|
|
503
503
|
message: t?.message || "Something went wrong. Please try again.",
|
|
504
504
|
fieldErrors: Object.fromEntries((t?.fieldErrors ?? []).map((e) => [e.param, e.message])),
|
|
505
|
-
isPendingApproval:
|
|
505
|
+
isPendingApproval: gt(t?.code)
|
|
506
506
|
};
|
|
507
|
-
},
|
|
507
|
+
}, vt = {
|
|
508
508
|
code: "site.NOT_CONNECTED",
|
|
509
509
|
title: "Sign-in unavailable",
|
|
510
510
|
message: "This site is not connected to an account system yet.",
|
|
511
511
|
fieldErrors: {},
|
|
512
512
|
isPendingApproval: !1
|
|
513
|
-
},
|
|
514
|
-
let e = i(), t =
|
|
513
|
+
}, yt = () => {
|
|
514
|
+
let e = i(), t = R(), n = w(async (t, n) => {
|
|
515
515
|
if (!e?.membership) return {
|
|
516
516
|
ok: !1,
|
|
517
|
-
error:
|
|
517
|
+
error: vt
|
|
518
518
|
};
|
|
519
519
|
try {
|
|
520
520
|
return {
|
|
@@ -525,7 +525,7 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
525
525
|
let r = b(n);
|
|
526
526
|
return e.logger?.error(t, { exception: r }), {
|
|
527
527
|
ok: !1,
|
|
528
|
-
error:
|
|
528
|
+
error: _t(r)
|
|
529
529
|
};
|
|
530
530
|
}
|
|
531
531
|
}, [e]), r = w(async ({ identifier: t, medium: n }) => {
|
|
@@ -533,13 +533,13 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
533
533
|
content: t,
|
|
534
534
|
...n === "whatsapp" ? { medium: "whatsapp" } : {}
|
|
535
535
|
});
|
|
536
|
-
}, [e]), a =
|
|
536
|
+
}, [e]), a = I({ mutationFn: (e) => n("Failed to send verification code", () => r(e)) }), o = I({ mutationFn: (e) => n("Failed to resend verification code", () => r(e)) }), s = I({ mutationFn: ({ identifier: r, code: i }) => n("Verification failed", async () => {
|
|
537
537
|
let n = await e?.membership?.signInWithOtp({
|
|
538
538
|
content: r,
|
|
539
539
|
code: i
|
|
540
540
|
}) ?? null;
|
|
541
541
|
return t.setQueryData(q, n), t.invalidateQueries({ queryKey: q }), n;
|
|
542
|
-
}) }), c =
|
|
542
|
+
}) }), c = I({ mutationFn: (t) => n("Failed to send magic link", async () => {
|
|
543
543
|
await e?.membership?.requestMagicLink({ content: t });
|
|
544
544
|
}) });
|
|
545
545
|
return {
|
|
@@ -552,11 +552,11 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
552
552
|
isVerifying: s.isPending,
|
|
553
553
|
isSendingMagicLink: c.isPending
|
|
554
554
|
};
|
|
555
|
-
},
|
|
556
|
-
let n = window.screenX + (window.outerWidth -
|
|
557
|
-
return window.open(e, t, `width=${
|
|
558
|
-
},
|
|
559
|
-
let a = i(), o =
|
|
555
|
+
}, bt = 700, xt = 500, St = 700, Ct = (e, t) => {
|
|
556
|
+
let n = window.screenX + (window.outerWidth - xt) / 2, r = window.screenY + (window.outerHeight - St) / 2.5;
|
|
557
|
+
return window.open(e, t, `width=${xt},height=${St},left=${n},top=${r}`);
|
|
558
|
+
}, wt = ({ methods: e, title: t = "Sign in", onSuccess: n, onError: r }) => {
|
|
559
|
+
let a = i(), o = R(), s = K(), [c, l] = A(null), [u, d] = A(null), f = k(null), p = k(void 0), m = k({
|
|
560
560
|
onSuccess: n,
|
|
561
561
|
onError: r
|
|
562
562
|
});
|
|
@@ -564,7 +564,7 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
564
564
|
onSuccess: n,
|
|
565
565
|
onError: r
|
|
566
566
|
};
|
|
567
|
-
let h =
|
|
567
|
+
let h = L({
|
|
568
568
|
queryKey: ["levo-auth", "oauth-urls"],
|
|
569
569
|
queryFn: async () => await a?.membership?.getOAuthURL() ?? null,
|
|
570
570
|
enabled: s && !!a && e.length > 0,
|
|
@@ -612,10 +612,10 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
612
612
|
title: t.get("title") || "Sign-in failed",
|
|
613
613
|
message: t.get("message") || "We could not sign you in. Please try again.",
|
|
614
614
|
fieldErrors: {},
|
|
615
|
-
isPendingApproval:
|
|
615
|
+
isPendingApproval: gt(t.get("code"))
|
|
616
616
|
};
|
|
617
617
|
r.isPendingApproval || d(r), m.current.onError?.(r);
|
|
618
|
-
},
|
|
618
|
+
}, bt);
|
|
619
619
|
}, [o, g]), v = O(() => {
|
|
620
620
|
let e = h.data;
|
|
621
621
|
if (!e || typeof window > "u") return {};
|
|
@@ -636,7 +636,7 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
636
636
|
signIn: () => {
|
|
637
637
|
let n = v[e];
|
|
638
638
|
if (n) {
|
|
639
|
-
if (d(null), f.current?.close(), f.current =
|
|
639
|
+
if (d(null), f.current?.close(), f.current = Ct(n, t), !f.current) {
|
|
640
640
|
d({
|
|
641
641
|
code: "POPUP_BLOCKED",
|
|
642
642
|
title: "Popup blocked",
|
|
@@ -660,10 +660,10 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
660
660
|
error: u,
|
|
661
661
|
clearError: w(() => d(null), [])
|
|
662
662
|
};
|
|
663
|
-
},
|
|
663
|
+
}, Tt = 4, Et = (e) => /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(e.trim()), Dt = (e) => (/* @__PURE__ */ RegExp("^\\d{4}$")).test(e.trim()), Ot = (e) => {
|
|
664
664
|
let t = e.replace(/\D/g, "").replace(/^0+/, "");
|
|
665
665
|
return t ? `+${t}` : "";
|
|
666
|
-
},
|
|
666
|
+
}, kt = (e) => /^\+[1-9]\d{7,14}$/.test(Ot(e)), At = ({ value: e, onChange: t, length: n = 4, onComplete: r, autoFocus: i, disabled: a }) => {
|
|
667
667
|
let o = k([]), [s, c] = A(null), l = k(r);
|
|
668
668
|
l.current = r;
|
|
669
669
|
let u = Array.from({ length: n }, (t, n) => e[n] ?? ""), d = w((e) => {
|
|
@@ -747,11 +747,11 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
747
747
|
},
|
|
748
748
|
clear: w(() => f("", 0), [f])
|
|
749
749
|
};
|
|
750
|
-
},
|
|
750
|
+
}, jt = C(() => import("./kbChat-eFsau7hG.js")), Mt = ({ site: e, path: t }) => {
|
|
751
751
|
let n = K(), r = e.workspace_id || void 0;
|
|
752
|
-
return !n || !r ? null : /* @__PURE__ */
|
|
752
|
+
return !n || !r ? null : /* @__PURE__ */ M(x, {
|
|
753
753
|
fallback: null,
|
|
754
|
-
children: /* @__PURE__ */
|
|
754
|
+
children: /* @__PURE__ */ M(jt, {
|
|
755
755
|
workspaceId: r,
|
|
756
756
|
siteName: e.name || void 0,
|
|
757
757
|
siteLogo: void 0,
|
|
@@ -761,77 +761,77 @@ var q = ["levo-auth", "session"], tt = () => {
|
|
|
761
761
|
path: t
|
|
762
762
|
})
|
|
763
763
|
});
|
|
764
|
-
},
|
|
764
|
+
}, Nt = "(prefers-color-scheme: dark)", Pt = (e) => {
|
|
765
765
|
try {
|
|
766
766
|
let t = localStorage.getItem(e);
|
|
767
767
|
return t === "light" || t === "dark" || t === "system" ? t : null;
|
|
768
768
|
} catch {
|
|
769
769
|
return null;
|
|
770
770
|
}
|
|
771
|
-
},
|
|
771
|
+
}, Ft = (e, t) => {
|
|
772
772
|
try {
|
|
773
773
|
localStorage.setItem(e, t);
|
|
774
774
|
} catch {}
|
|
775
775
|
};
|
|
776
|
-
function
|
|
777
|
-
return `(function(){try{var t=localStorage.getItem(${JSON.stringify(e)});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${JSON.stringify(t)}}var d=matchMedia('${
|
|
776
|
+
function It(e, t) {
|
|
777
|
+
return `(function(){try{var t=localStorage.getItem(${JSON.stringify(e)});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${JSON.stringify(t)}}var d=matchMedia('${Nt}').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){}})();`;
|
|
778
778
|
}
|
|
779
|
-
var
|
|
780
|
-
function
|
|
779
|
+
var Lt = S(void 0), Rt = (e) => e === "system" ? window.matchMedia(Nt).matches ? "dark" : "light" : e;
|
|
780
|
+
function zt(e) {
|
|
781
781
|
let t = document.documentElement;
|
|
782
782
|
t.classList.remove("light", "dark"), t.classList.add(e), t.style.colorScheme = e;
|
|
783
783
|
}
|
|
784
|
-
var
|
|
784
|
+
var Bt = ({ children: e, defaultMode: t = "system", storageKey: n = "color-mode" }) => {
|
|
785
785
|
let [r, i] = A(t), [a, o] = A(t === "dark" ? "dark" : "light"), s = K();
|
|
786
786
|
return E(() => {
|
|
787
|
-
i(
|
|
787
|
+
i(Pt(n) ?? t);
|
|
788
788
|
}, [t, n]), E(() => {
|
|
789
789
|
if (!s) return;
|
|
790
|
-
let e =
|
|
791
|
-
|
|
790
|
+
let e = Rt(r);
|
|
791
|
+
zt(e), o(e);
|
|
792
792
|
}, [r, s]), E(() => {
|
|
793
793
|
if (!s || r !== "system") return;
|
|
794
|
-
let e = window.matchMedia(
|
|
794
|
+
let e = window.matchMedia(Nt), t = () => {
|
|
795
795
|
let t = e.matches ? "dark" : "light";
|
|
796
|
-
|
|
796
|
+
zt(t), o(t);
|
|
797
797
|
};
|
|
798
798
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
799
|
-
}, [r, s]), /* @__PURE__ */
|
|
799
|
+
}, [r, s]), /* @__PURE__ */ N(Lt.Provider, {
|
|
800
800
|
value: {
|
|
801
801
|
mode: r,
|
|
802
802
|
resolvedMode: a,
|
|
803
803
|
setMode: (e) => {
|
|
804
|
-
|
|
804
|
+
Ft(n, e), i(e);
|
|
805
805
|
}
|
|
806
806
|
},
|
|
807
|
-
children: [/* @__PURE__ */
|
|
807
|
+
children: [/* @__PURE__ */ M(z, { children: It(n, t) }), e]
|
|
808
808
|
});
|
|
809
809
|
};
|
|
810
|
-
function
|
|
811
|
-
let e = T(
|
|
810
|
+
function Vt() {
|
|
811
|
+
let e = T(Lt);
|
|
812
812
|
if (e === void 0) throw Error("useColorMode must be used within a ColorModeProvider");
|
|
813
813
|
return e;
|
|
814
814
|
}
|
|
815
815
|
//#endregion
|
|
816
816
|
//#region src/form/LevoEditForm.tsx
|
|
817
|
-
var
|
|
818
|
-
let { schema: l, bind: u } =
|
|
817
|
+
var Ht = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.allow_public_view !== !1 && e.allow_public_submit !== !1, Ut = ({ source: t, initialValues: n, onSubmit: r, isLoading: i, hiddenFields: a, submitLabel: o = "Save changes", theme: s, className: c }) => {
|
|
818
|
+
let { schema: l, bind: u } = Ze(t), d = tt(s), f = O(() => l ? {
|
|
819
819
|
...l,
|
|
820
820
|
sections: l.sections?.map((e) => ({
|
|
821
821
|
...e,
|
|
822
822
|
fields: e.fields?.map((e) => ({
|
|
823
823
|
...e,
|
|
824
|
-
hidden: !
|
|
824
|
+
hidden: !Ht(e, a)
|
|
825
825
|
}))
|
|
826
826
|
}))
|
|
827
827
|
} : null, [l, a?.join("|") ?? ""]), p = (e) => {
|
|
828
|
-
let t = l?.sections?.flatMap((e) => e?.fields ?? []).filter((e) =>
|
|
828
|
+
let t = l?.sections?.flatMap((e) => e?.fields ?? []).filter((e) => Ht(e, a)).map((e) => e.key) ?? [];
|
|
829
829
|
r(Object.fromEntries(Object.entries(e).filter(([e]) => t.includes(e))));
|
|
830
830
|
};
|
|
831
|
-
return /* @__PURE__ */
|
|
831
|
+
return /* @__PURE__ */ M("div", {
|
|
832
832
|
...u,
|
|
833
833
|
className: c,
|
|
834
|
-
children: f ? /* @__PURE__ */
|
|
834
|
+
children: f ? /* @__PURE__ */ M(e, {
|
|
835
835
|
schema: f,
|
|
836
836
|
initialValues: n ?? {},
|
|
837
837
|
uiConfig: {
|
|
@@ -847,12 +847,12 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
847
847
|
onSubmit: (e) => p(e)
|
|
848
848
|
}) : null
|
|
849
849
|
});
|
|
850
|
-
},
|
|
851
|
-
let m = i(), { schema: h, isLoading: g, bind: _ } =
|
|
852
|
-
return m ? /* @__PURE__ */
|
|
850
|
+
}, Wt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant: a = "default", successConfig: o, theme: s, className: c, defaultValues: l, disabled: u, showSuccessScreen: d = !0, onSuccess: f, onError: p }) => {
|
|
851
|
+
let m = i(), { schema: h, isLoading: g, bind: _ } = Ze(e), v = tt(s);
|
|
852
|
+
return m ? /* @__PURE__ */ M("div", {
|
|
853
853
|
..._,
|
|
854
854
|
className: c,
|
|
855
|
-
children: /* @__PURE__ */
|
|
855
|
+
children: /* @__PURE__ */ M(t, {
|
|
856
856
|
fetchedSchema: h,
|
|
857
857
|
isLoading: g,
|
|
858
858
|
submitButtonConfig: {
|
|
@@ -878,28 +878,28 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
878
878
|
onError: p
|
|
879
879
|
})
|
|
880
880
|
}) : null;
|
|
881
|
-
},
|
|
881
|
+
}, Gt = 1400, Kt = 12 * 1024 * 1024, qt = new Set(["transparent", "rgba(0, 0, 0, 0)"]), Jt = {
|
|
882
882
|
imagePlaceholder: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",
|
|
883
883
|
onImageErrorHandler: () => void 0
|
|
884
|
-
}, Jt = (e) => {
|
|
885
|
-
let t = getComputedStyle(e);
|
|
886
|
-
return !Kt.has(t.backgroundColor) || t.backgroundImage !== "none";
|
|
887
884
|
}, Yt = (e) => {
|
|
885
|
+
let t = getComputedStyle(e);
|
|
886
|
+
return !qt.has(t.backgroundColor) || t.backgroundImage !== "none";
|
|
887
|
+
}, Xt = (e) => {
|
|
888
888
|
for (let t = e; t; t = t.parentElement) {
|
|
889
889
|
let e = getComputedStyle(t).backgroundColor;
|
|
890
|
-
if (!
|
|
890
|
+
if (!qt.has(e)) return e;
|
|
891
891
|
}
|
|
892
892
|
return "#ffffff";
|
|
893
|
-
},
|
|
894
|
-
let { toPng: n } = await import("./es-CK20DkgT.js"), r = e.getBoundingClientRect(), i = Math.max(r.width, r.height, 1), a = Math.min(2, Math.max(.4,
|
|
895
|
-
...
|
|
893
|
+
}, Zt = async (e, t) => {
|
|
894
|
+
let { toPng: n } = await import("./es-CK20DkgT.js"), r = e.getBoundingClientRect(), i = Math.max(r.width, r.height, 1), a = Math.min(2, Math.max(.4, Gt / i)), o = await n(e, {
|
|
895
|
+
...Jt,
|
|
896
896
|
pixelRatio: a,
|
|
897
|
-
backgroundColor:
|
|
897
|
+
backgroundColor: Xt(e),
|
|
898
898
|
filter: (e) => !t.includes(e)
|
|
899
899
|
});
|
|
900
|
-
if (o.length >
|
|
900
|
+
if (o.length > Kt) throw Error("capture too large");
|
|
901
901
|
return o;
|
|
902
|
-
},
|
|
902
|
+
}, Qt = 4, $t = 4e3, en = (e, t) => {
|
|
903
903
|
let n = document.elementFromPoint(e.x + e.width / 2, e.y + e.height / 2);
|
|
904
904
|
for (; n && t.includes(n);) n = n.parentElement;
|
|
905
905
|
let r = document.body;
|
|
@@ -910,8 +910,8 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
910
910
|
break;
|
|
911
911
|
}
|
|
912
912
|
}
|
|
913
|
-
let i = window.innerWidth * window.innerHeight *
|
|
914
|
-
for (; !
|
|
913
|
+
let i = window.innerWidth * window.innerHeight * Qt || 2 ** 53 - 1, a = r;
|
|
914
|
+
for (; !Yt(a);) {
|
|
915
915
|
let e = a.parentElement;
|
|
916
916
|
if (!e || e === document.documentElement) break;
|
|
917
917
|
let t = e.getBoundingClientRect();
|
|
@@ -919,13 +919,13 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
919
919
|
a = e;
|
|
920
920
|
}
|
|
921
921
|
return a;
|
|
922
|
-
},
|
|
923
|
-
let { toCanvas: n } = await import("./es-CK20DkgT.js"), r =
|
|
924
|
-
o = Math.min(o,
|
|
922
|
+
}, tn = async (e, t) => {
|
|
923
|
+
let { toCanvas: n } = await import("./es-CK20DkgT.js"), r = en(e, t), i = r.getBoundingClientRect(), a = Math.max(e.width, e.height, 1), o = Math.min(2, Math.max(.4, Gt / a)), s = Math.max(i.width, i.height, 1);
|
|
924
|
+
o = Math.min(o, $t / s);
|
|
925
925
|
let c = await n(r, {
|
|
926
|
-
...
|
|
926
|
+
...Jt,
|
|
927
927
|
pixelRatio: o,
|
|
928
|
-
backgroundColor:
|
|
928
|
+
backgroundColor: Xt(r),
|
|
929
929
|
filter: (e) => !t.includes(e)
|
|
930
930
|
}), l = document.createElement("canvas");
|
|
931
931
|
l.width = Math.max(1, Math.round(e.width * o)), l.height = Math.max(1, Math.round(e.height * o));
|
|
@@ -933,9 +933,9 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
933
933
|
if (!u) throw Error("no 2d context");
|
|
934
934
|
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);
|
|
935
935
|
let d = l.toDataURL("image/png");
|
|
936
|
-
if (d.length >
|
|
936
|
+
if (d.length > Kt) throw Error("capture too large");
|
|
937
937
|
return d;
|
|
938
|
-
},
|
|
938
|
+
}, nn = {
|
|
939
939
|
ring: 99997,
|
|
940
940
|
overlay: 99998,
|
|
941
941
|
label: 99999
|
|
@@ -948,24 +948,24 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
948
948
|
}, Y = (e) => {
|
|
949
949
|
let t = e?.getAttribute("data-tsd-source");
|
|
950
950
|
return t ? t.replace(/^\//, "") : null;
|
|
951
|
-
},
|
|
952
|
-
let n =
|
|
951
|
+
}, rn = (e) => Array.from(document.querySelectorAll("[data-tsd-source]")).filter((t) => Y(t) === e), an = (e, t) => {
|
|
952
|
+
let n = rn(t).indexOf(e);
|
|
953
953
|
return n < 0 ? 0 : n;
|
|
954
|
-
},
|
|
955
|
-
let n =
|
|
954
|
+
}, on = (e, t = 0) => {
|
|
955
|
+
let n = rn(e);
|
|
956
956
|
return n[t] ?? n[0] ?? null;
|
|
957
|
-
},
|
|
957
|
+
}, sn = (e, t) => {
|
|
958
958
|
let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter(Boolean);
|
|
959
959
|
n.includes(t) || e.setAttribute("data-staged-key", [...n, t].join(" "));
|
|
960
|
-
},
|
|
960
|
+
}, cn = (e, t) => {
|
|
961
961
|
let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter((e) => e && e !== t);
|
|
962
962
|
n.length ? e.setAttribute("data-staged-key", n.join(" ")) : e.removeAttribute("data-staged-key");
|
|
963
|
-
},
|
|
963
|
+
}, ln = (e, t) => {
|
|
964
964
|
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("");
|
|
965
965
|
if (!n) return "";
|
|
966
966
|
let r = `[data-staged-key~="${CSS.escape(e)}"]{${n}}`, i = t.media?.replace(/[;{}]/g, "").trim();
|
|
967
967
|
return i ? `@media ${i}{${r}}` : r;
|
|
968
|
-
},
|
|
968
|
+
}, un = (e) => {
|
|
969
969
|
let t = e.tagName.toLowerCase();
|
|
970
970
|
return t === "input" ? {
|
|
971
971
|
checkbox: "Checkbox",
|
|
@@ -1007,31 +1007,31 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1007
1007
|
aside: "Sidebar",
|
|
1008
1008
|
div: "Container"
|
|
1009
1009
|
}[t] || `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
|
|
1010
|
-
},
|
|
1011
|
-
let t =
|
|
1012
|
-
return n ? `${t} · ${n.length >
|
|
1013
|
-
},
|
|
1010
|
+
}, dn = 36, fn = (e) => {
|
|
1011
|
+
let t = un(e), n = ((e) => e.replace(/\s+/g, " ").trim())(e.getAttribute("aria-label") || e.getAttribute("alt") || e.getAttribute("title") || e.getAttribute("name") || "");
|
|
1012
|
+
return n ? `${t} · ${n.length > dn ? `${n.slice(0, dn - 1).trimEnd()}…` : n}` : t;
|
|
1013
|
+
}, pn = (e) => {
|
|
1014
1014
|
let t = [], n = e;
|
|
1015
1015
|
for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) t.unshift(n.tagName.toLowerCase()), n = n.parentElement;
|
|
1016
1016
|
return t.join(" > ");
|
|
1017
|
-
},
|
|
1017
|
+
}, mn = () => {
|
|
1018
1018
|
let e = document.createElement("div");
|
|
1019
|
-
e.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
1019
|
+
e.style.cssText = `position:fixed;pointer-events:none;z-index:${nn.overlay};background:${J.hoverBg};outline:2px solid ${J.hover};border-radius:2px;display:none`;
|
|
1020
1020
|
let t = document.createElement("div");
|
|
1021
|
-
t.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
1021
|
+
t.style.cssText = `position:fixed;pointer-events:none;z-index:${nn.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`;
|
|
1022
1022
|
let n = document.createElement("div");
|
|
1023
|
-
n.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
1023
|
+
n.style.cssText = `position:fixed;pointer-events:none;z-index:${nn.ring};outline:2px solid ${J.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 4px ${J.selectGlow};display:none`;
|
|
1024
1024
|
let r = document.createElement("div");
|
|
1025
|
-
return r.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
1025
|
+
return r.style.cssText = `position:fixed;pointer-events:none;z-index:${nn.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`, {
|
|
1026
1026
|
overlay: e,
|
|
1027
1027
|
label: t,
|
|
1028
1028
|
ring: n,
|
|
1029
1029
|
ringLabel: r
|
|
1030
1030
|
};
|
|
1031
|
-
},
|
|
1031
|
+
}, hn = (e, t, n) => {
|
|
1032
1032
|
let r = n.getBoundingClientRect();
|
|
1033
|
-
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 =
|
|
1034
|
-
},
|
|
1033
|
+
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 = fn(n), t.style.left = `${Math.max(4, r.left)}px`, t.style.top = `${r.top > 26 ? r.top - 22 : r.bottom + 4}px`;
|
|
1034
|
+
}, gn = (e) => {
|
|
1035
1035
|
let t = (e instanceof Element ? e : null)?.closest("a[href]");
|
|
1036
1036
|
if (!t || t.target === "_blank") return null;
|
|
1037
1037
|
let n;
|
|
@@ -1041,11 +1041,11 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1041
1041
|
return null;
|
|
1042
1042
|
}
|
|
1043
1043
|
return n.protocol !== "http:" && n.protocol !== "https:" || n.origin === location.origin ? null : n.href;
|
|
1044
|
-
},
|
|
1044
|
+
}, _n = (e) => {
|
|
1045
1045
|
if (!e) return !1;
|
|
1046
1046
|
let t = e.tagName;
|
|
1047
1047
|
return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable === !0;
|
|
1048
|
-
},
|
|
1048
|
+
}, vn = (e) => {
|
|
1049
1049
|
if (!e.childNodes.length) return !1;
|
|
1050
1050
|
let t = !1;
|
|
1051
1051
|
for (let n of e.childNodes) {
|
|
@@ -1053,7 +1053,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1053
1053
|
(n.textContent ?? "").trim() && (t = !0);
|
|
1054
1054
|
}
|
|
1055
1055
|
return t;
|
|
1056
|
-
},
|
|
1056
|
+
}, yn = 2e3, bn = (e) => {
|
|
1057
1057
|
let t = [], n = e;
|
|
1058
1058
|
for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) {
|
|
1059
1059
|
let e = Y(n);
|
|
@@ -1064,22 +1064,22 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1064
1064
|
}), n = n.parentElement;
|
|
1065
1065
|
}
|
|
1066
1066
|
return t;
|
|
1067
|
-
},
|
|
1068
|
-
let t = Y(e), n = t ?
|
|
1067
|
+
}, xn = (e) => {
|
|
1068
|
+
let t = Y(e), n = t ? rn(t).length : 1, r = t ? an(e, t) : 0, i = t && vn(e) ? (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, yn) : void 0, a = Sn(e);
|
|
1069
1069
|
return {
|
|
1070
1070
|
tag: e.tagName.toLowerCase(),
|
|
1071
1071
|
classes: typeof e.className == "string" ? e.className.trim() : "",
|
|
1072
1072
|
text: (e.innerText || "").trim().slice(0, 120),
|
|
1073
|
-
label:
|
|
1074
|
-
path:
|
|
1073
|
+
label: fn(e),
|
|
1074
|
+
path: pn(e),
|
|
1075
1075
|
source: t,
|
|
1076
1076
|
index: r,
|
|
1077
1077
|
occurrences: n,
|
|
1078
|
-
ancestors:
|
|
1078
|
+
ancestors: bn(e),
|
|
1079
1079
|
...i === void 0 ? {} : { fullText: i },
|
|
1080
1080
|
...a ? { sourceBinding: a } : {}
|
|
1081
1081
|
};
|
|
1082
|
-
},
|
|
1082
|
+
}, Sn = (e) => {
|
|
1083
1083
|
let t = e.closest("[data-levo-source]");
|
|
1084
1084
|
if (!t) return;
|
|
1085
1085
|
let n = t.getAttribute("data-levo-source") ?? "", r = Y(t), i;
|
|
@@ -1092,11 +1092,11 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1092
1092
|
raw: n,
|
|
1093
1093
|
element: {
|
|
1094
1094
|
source: r ?? "",
|
|
1095
|
-
index: r ?
|
|
1095
|
+
index: r ? an(t, r) : 0
|
|
1096
1096
|
},
|
|
1097
1097
|
...i === void 0 ? {} : { config: i }
|
|
1098
1098
|
};
|
|
1099
|
-
},
|
|
1099
|
+
}, Cn = () => Array.from(document.querySelectorAll("[data-levo-source]")).map((e) => {
|
|
1100
1100
|
let t = e.getAttribute("data-levo-source") ?? "", n = Y(e), r;
|
|
1101
1101
|
try {
|
|
1102
1102
|
r = JSON.parse(t);
|
|
@@ -1107,18 +1107,18 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1107
1107
|
raw: t,
|
|
1108
1108
|
element: {
|
|
1109
1109
|
source: n ?? "",
|
|
1110
|
-
index: n ?
|
|
1110
|
+
index: n ? an(e, n) : 0
|
|
1111
1111
|
},
|
|
1112
1112
|
tag: e.tagName.toLowerCase(),
|
|
1113
|
-
label:
|
|
1113
|
+
label: fn(e),
|
|
1114
1114
|
...r === void 0 ? {} : { config: r }
|
|
1115
1115
|
};
|
|
1116
|
-
}),
|
|
1116
|
+
}), wn = 14, Tn = 2e3, En = 100, Dn = 48, On = new Set([
|
|
1117
1117
|
"script",
|
|
1118
1118
|
"style",
|
|
1119
1119
|
"template",
|
|
1120
1120
|
"noscript"
|
|
1121
|
-
]),
|
|
1121
|
+
]), kn = (e, t) => t.includes(e) || e.id === "studio-staged" || On.has(e.tagName.toLowerCase()), An = (e) => {
|
|
1122
1122
|
let t = !1, n = 0, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
1123
1123
|
for (let e of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
|
|
1124
1124
|
let t = Y(e);
|
|
@@ -1130,11 +1130,11 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1130
1130
|
for (let t of e.childNodes) {
|
|
1131
1131
|
if (t.nodeType !== 3) continue;
|
|
1132
1132
|
let e = (t.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
1133
|
-
if (e) return e.length >
|
|
1133
|
+
if (e) return e.length > Dn ? `${e.slice(0, Dn).trimEnd()}…` : e;
|
|
1134
1134
|
}
|
|
1135
1135
|
}, o = (i, s) => {
|
|
1136
1136
|
n++;
|
|
1137
|
-
let c = Y(i), l = a(i), u = Array.from(i.children).filter((t) => !
|
|
1137
|
+
let c = Y(i), l = a(i), u = Array.from(i.children).filter((t) => !kn(t, e)), d = {
|
|
1138
1138
|
tag: i.tagName.toLowerCase(),
|
|
1139
1139
|
...c ? {
|
|
1140
1140
|
source: c,
|
|
@@ -1145,9 +1145,9 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1145
1145
|
childCount: u.length,
|
|
1146
1146
|
children: []
|
|
1147
1147
|
};
|
|
1148
|
-
if (s >=
|
|
1148
|
+
if (s >= wn) return u.length && (t = !0), d;
|
|
1149
1149
|
for (let e of u) {
|
|
1150
|
-
if (d.children.length >=
|
|
1150
|
+
if (d.children.length >= En || n >= Tn) {
|
|
1151
1151
|
t = !0;
|
|
1152
1152
|
break;
|
|
1153
1153
|
}
|
|
@@ -1159,7 +1159,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1159
1159
|
tree: o(document.body, 0),
|
|
1160
1160
|
truncated: t
|
|
1161
1161
|
};
|
|
1162
|
-
},
|
|
1162
|
+
}, jn = () => {
|
|
1163
1163
|
let e = null;
|
|
1164
1164
|
return {
|
|
1165
1165
|
send: (t) => {
|
|
@@ -1174,7 +1174,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1174
1174
|
return !0;
|
|
1175
1175
|
}
|
|
1176
1176
|
};
|
|
1177
|
-
},
|
|
1177
|
+
}, Mn = (e) => {
|
|
1178
1178
|
let t = location.pathname, n = () => {
|
|
1179
1179
|
location.pathname !== t && (t = location.pathname, e.onPathChange());
|
|
1180
1180
|
}, r = !1;
|
|
@@ -1194,23 +1194,23 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1194
1194
|
e.__inspectorPatched && e.__orig && (history.pushState = e.__orig), t.__inspectorPatched && t.__orig && (history.replaceState = t.__orig);
|
|
1195
1195
|
}
|
|
1196
1196
|
} };
|
|
1197
|
-
},
|
|
1198
|
-
if (!
|
|
1199
|
-
|
|
1200
|
-
for (let e of
|
|
1197
|
+
}, Nn = !1, Pn = /* @__PURE__ */ new Set(), Fn = () => {
|
|
1198
|
+
if (!Nn) {
|
|
1199
|
+
Nn = !0;
|
|
1200
|
+
for (let e of Pn) e();
|
|
1201
1201
|
}
|
|
1202
|
-
},
|
|
1203
|
-
|
|
1204
|
-
}),
|
|
1202
|
+
}, In = (e) => (Pn.add(e), () => {
|
|
1203
|
+
Pn.delete(e);
|
|
1204
|
+
}), Ln = () => ee(In, () => Nn, () => !1), Rn = (e) => {
|
|
1205
1205
|
let { channel: t, originals: n, staged: r } = e, i = t.send, a = null;
|
|
1206
1206
|
return { onMessage: (o) => {
|
|
1207
1207
|
let s = o.data;
|
|
1208
1208
|
if (!(!s || s.source !== "web-chat") && t.acceptOrigin(o)) {
|
|
1209
|
-
if (
|
|
1209
|
+
if (Fn(), s.type === "set-access-preview") dt(s.stage ?? null);
|
|
1210
1210
|
else if (s.type === "set-inspect") e.setInspect(s.enabled);
|
|
1211
1211
|
else if (s.type === "set-text-edit") e.setTextEdit(s.enabled);
|
|
1212
1212
|
else if (s.type === "revert-text") {
|
|
1213
|
-
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 :
|
|
1213
|
+
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 : on(e, t);
|
|
1214
1214
|
i && r != null && (i.textContent = r);
|
|
1215
1215
|
} else if (s.type === "stage-style") {
|
|
1216
1216
|
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;
|
|
@@ -1269,7 +1269,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1269
1269
|
}
|
|
1270
1270
|
e.syncDomObserver();
|
|
1271
1271
|
} else if (s.type === "select-element") {
|
|
1272
|
-
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ?
|
|
1272
|
+
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? on(t, n) : null;
|
|
1273
1273
|
if (!r) {
|
|
1274
1274
|
i({
|
|
1275
1275
|
type: "select-miss",
|
|
@@ -1285,10 +1285,10 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1285
1285
|
behavior: "smooth"
|
|
1286
1286
|
}), i({
|
|
1287
1287
|
type: "element-selected",
|
|
1288
|
-
element:
|
|
1288
|
+
element: xn(r)
|
|
1289
1289
|
});
|
|
1290
1290
|
} else if (s.type === "edit-element") {
|
|
1291
|
-
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ?
|
|
1291
|
+
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? on(t, n) : null;
|
|
1292
1292
|
if (!r) {
|
|
1293
1293
|
i({
|
|
1294
1294
|
type: "select-miss",
|
|
@@ -1304,12 +1304,12 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1304
1304
|
behavior: "smooth"
|
|
1305
1305
|
}), i({
|
|
1306
1306
|
type: "element-selected",
|
|
1307
|
-
element:
|
|
1307
|
+
element: xn(r)
|
|
1308
1308
|
}), e.isTextEditing() || e.setTextEdit(!0);
|
|
1309
1309
|
let o = e.editableTarget(r);
|
|
1310
1310
|
o && e.startEditAtEnd(o);
|
|
1311
1311
|
} else if (s.type === "highlight-element") {
|
|
1312
|
-
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ?
|
|
1312
|
+
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? on(t, n) : null;
|
|
1313
1313
|
if (!r) a = null, e.hideTextHover(), i({
|
|
1314
1314
|
type: "highlight-miss",
|
|
1315
1315
|
element: {
|
|
@@ -1327,7 +1327,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1327
1327
|
}
|
|
1328
1328
|
} else if (s.type === "clear-highlight") a && (a = null, !e.isInspecting() && !e.editingNode() && e.hideTextHover());
|
|
1329
1329
|
else if (s.type === "request-layers") {
|
|
1330
|
-
let { tree: t, truncated: n } =
|
|
1330
|
+
let { tree: t, truncated: n } = An(e.ownNodes);
|
|
1331
1331
|
i({
|
|
1332
1332
|
type: "layers-tree",
|
|
1333
1333
|
tree: t,
|
|
@@ -1335,7 +1335,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1335
1335
|
});
|
|
1336
1336
|
} else if (s.type === "request-sources") i({
|
|
1337
1337
|
type: "sources-list",
|
|
1338
|
-
sources:
|
|
1338
|
+
sources: Cn()
|
|
1339
1339
|
});
|
|
1340
1340
|
else if (s.type === "capture-selected") {
|
|
1341
1341
|
let t = String(s.requestId || "");
|
|
@@ -1350,7 +1350,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1350
1350
|
});
|
|
1351
1351
|
return;
|
|
1352
1352
|
}
|
|
1353
|
-
|
|
1353
|
+
Zt(n, e.ownNodes).then((e) => {
|
|
1354
1354
|
console.info(`[levo-inspector] element capture ok <${n.tagName.toLowerCase()}> (${Math.round(e.length / 1024)}kB)`), i({
|
|
1355
1355
|
type: "capture-result",
|
|
1356
1356
|
requestId: t,
|
|
@@ -1371,7 +1371,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1371
1371
|
}
|
|
1372
1372
|
}
|
|
1373
1373
|
} };
|
|
1374
|
-
},
|
|
1374
|
+
}, zn = () => {
|
|
1375
1375
|
let e = /* @__PURE__ */ new Map(), t = () => {
|
|
1376
1376
|
if (e.size > 50) {
|
|
1377
1377
|
let t = e.keys().next().value;
|
|
@@ -1391,31 +1391,31 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1391
1391
|
return e.delete(t), n;
|
|
1392
1392
|
}
|
|
1393
1393
|
};
|
|
1394
|
-
},
|
|
1394
|
+
}, Bn = 6, Vn = 12, Hn = 12, Un = .6, Wn = (e, t, n, r) => ({
|
|
1395
1395
|
x: Math.min(e, n),
|
|
1396
1396
|
y: Math.min(t, r),
|
|
1397
1397
|
width: Math.abs(n - e),
|
|
1398
1398
|
height: Math.abs(r - t)
|
|
1399
|
-
}),
|
|
1399
|
+
}), Gn = (e, t) => {
|
|
1400
1400
|
let n = e.x + e.width, r = e.y + e.height, i = [];
|
|
1401
1401
|
for (let a of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
|
|
1402
1402
|
if (t.includes(a)) continue;
|
|
1403
1403
|
let o = a.getBoundingClientRect(), s = o.width * o.height;
|
|
1404
|
-
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 >=
|
|
1404
|
+
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 >= Un && i.push(a);
|
|
1405
1405
|
}
|
|
1406
1406
|
let a = new Set(i), o = i.filter((e) => {
|
|
1407
1407
|
for (let t = e.parentElement; t; t = t.parentElement) if (a.has(t)) return !1;
|
|
1408
1408
|
return !0;
|
|
1409
|
-
}), s = o.length >
|
|
1410
|
-
for (let e of o.slice(0,
|
|
1409
|
+
}), s = o.length > Hn, c = [], l = [];
|
|
1410
|
+
for (let e of o.slice(0, Hn)) {
|
|
1411
1411
|
let t = Y(e);
|
|
1412
1412
|
if (!t) continue;
|
|
1413
1413
|
let n = (e.innerText || "").replace(/\s+/g, " ").trim().slice(0, 80);
|
|
1414
1414
|
c.push({
|
|
1415
1415
|
source: t,
|
|
1416
|
-
index:
|
|
1416
|
+
index: an(e, t),
|
|
1417
1417
|
tag: e.tagName.toLowerCase(),
|
|
1418
|
-
label:
|
|
1418
|
+
label: fn(e),
|
|
1419
1419
|
...n ? { text: n } : {}
|
|
1420
1420
|
}), l.push(e);
|
|
1421
1421
|
}
|
|
@@ -1424,12 +1424,12 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1424
1424
|
nodes: l,
|
|
1425
1425
|
truncated: s
|
|
1426
1426
|
};
|
|
1427
|
-
},
|
|
1427
|
+
}, Kn = () => Array.from({ length: Hn }, () => {
|
|
1428
1428
|
let e = document.createElement("div");
|
|
1429
|
-
return e.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
1430
|
-
}),
|
|
1429
|
+
return e.style.cssText = `position:fixed;pointer-events:none;z-index:${nn.ring};outline:1.5px solid ${J.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 3px ${J.selectGlow};display:none`, e;
|
|
1430
|
+
}), qn = () => {
|
|
1431
1431
|
let e = document.createElement("div");
|
|
1432
|
-
e.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
1432
|
+
e.style.cssText = `position:fixed;pointer-events:none;z-index:${nn.overlay};border:1.5px dashed ${J.select};background:${J.selectGlow};border-radius:2px;display:none`;
|
|
1433
1433
|
let t = null, n = !1, r = 0, i = 0, a = () => {
|
|
1434
1434
|
e.style.display = "none";
|
|
1435
1435
|
};
|
|
@@ -1444,31 +1444,31 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1444
1444
|
pointerMove: (a, o) => {
|
|
1445
1445
|
if (!t) return;
|
|
1446
1446
|
if (a = Math.min(Math.max(0, a), window.innerWidth), o = Math.min(Math.max(0, o), window.innerHeight), r = a, i = o, !n) {
|
|
1447
|
-
if (Math.abs(a - t.x) <
|
|
1447
|
+
if (Math.abs(a - t.x) < Bn && Math.abs(o - t.y) < Bn) return;
|
|
1448
1448
|
n = !0;
|
|
1449
1449
|
}
|
|
1450
|
-
let s =
|
|
1450
|
+
let s = Wn(t.x, t.y, a, o);
|
|
1451
1451
|
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`;
|
|
1452
1452
|
},
|
|
1453
1453
|
pointerUp: () => {
|
|
1454
1454
|
let e = n, o = t;
|
|
1455
1455
|
if (t = null, n = !1, a(), !e || !o) return null;
|
|
1456
|
-
let s =
|
|
1457
|
-
return s.width <
|
|
1456
|
+
let s = Wn(o.x, o.y, r, i);
|
|
1457
|
+
return s.width < Vn || s.height < Vn ? null : s;
|
|
1458
1458
|
},
|
|
1459
1459
|
cancel: () => {
|
|
1460
1460
|
t = null, n = !1, a();
|
|
1461
1461
|
},
|
|
1462
1462
|
isDragging: () => n
|
|
1463
1463
|
};
|
|
1464
|
-
},
|
|
1464
|
+
}, Jn = (e) => {
|
|
1465
1465
|
let { originals: t, editingNode: n } = e, r = /* @__PURE__ */ new Map(), i = () => {
|
|
1466
1466
|
let e = document.getElementById("studio-staged");
|
|
1467
1467
|
return e || (e = document.createElement("style"), e.id = "studio-staged", document.head.appendChild(e)), e;
|
|
1468
1468
|
}, a = () => {
|
|
1469
1469
|
let e = [];
|
|
1470
1470
|
for (let [t, n] of r) if (n.kind === "style") {
|
|
1471
|
-
let r =
|
|
1471
|
+
let r = ln(t, n);
|
|
1472
1472
|
r && e.push(r);
|
|
1473
1473
|
}
|
|
1474
1474
|
let t = e.join("\n");
|
|
@@ -1476,8 +1476,8 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1476
1476
|
let n = i();
|
|
1477
1477
|
n.textContent !== t && (n.textContent = t);
|
|
1478
1478
|
}, o = (e, r) => {
|
|
1479
|
-
let i =
|
|
1480
|
-
if (i) if (r.kind === "style")
|
|
1479
|
+
let i = on(r.source, r.index);
|
|
1480
|
+
if (i) if (r.kind === "style") sn(i, e);
|
|
1481
1481
|
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");
|
|
1482
1482
|
else {
|
|
1483
1483
|
if (i === n()) return;
|
|
@@ -1490,8 +1490,8 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1490
1490
|
let n = r.get(e);
|
|
1491
1491
|
if (!n) return;
|
|
1492
1492
|
r.delete(e);
|
|
1493
|
-
let i =
|
|
1494
|
-
if (n.kind === "style") i &&
|
|
1493
|
+
let i = on(n.source, n.index);
|
|
1494
|
+
if (n.kind === "style") i && cn(i, e), a();
|
|
1495
1495
|
else if (n.kind === "image") {
|
|
1496
1496
|
let e = t.restore(`${n.source}#${n.index}:src`), r = t.restore(`${n.source}#${n.index}:srcset`);
|
|
1497
1497
|
i && (e != null && (e ? i.setAttribute("src", e) : i.removeAttribute("src")), r != null && (r ? i.setAttribute("srcset", r) : i.removeAttribute("srcset")));
|
|
@@ -1520,7 +1520,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1520
1520
|
for (let e of Array.from(document.querySelectorAll("[data-staged-key]"))) e.removeAttribute("data-staged-key");
|
|
1521
1521
|
}
|
|
1522
1522
|
};
|
|
1523
|
-
},
|
|
1523
|
+
}, Yn = (e) => {
|
|
1524
1524
|
let { channel: t, originals: n, clearTextHover: r } = e, i = null, a = "", o = 0, s = (() => {
|
|
1525
1525
|
try {
|
|
1526
1526
|
let e = document.createElement("div");
|
|
@@ -1539,7 +1539,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1539
1539
|
n.selectNodeContents(e), n.collapse(!1), t.removeAllRanges(), t.addRange(n);
|
|
1540
1540
|
}, d = (e, t = !1) => {
|
|
1541
1541
|
if (i === e) return;
|
|
1542
|
-
i && p(i), i = e, a = Y(e) || "", o =
|
|
1542
|
+
i && p(i), i = e, a = Y(e) || "", o = an(e, a), r(), n.capture(`${a}#${o}`, e.textContent ?? ""), e.setAttribute("contenteditable", s ? "plaintext-only" : "true");
|
|
1543
1543
|
let d = e;
|
|
1544
1544
|
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);
|
|
1545
1545
|
}, f = (e) => {
|
|
@@ -1558,7 +1558,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1558
1558
|
tag: e.tagName.toLowerCase(),
|
|
1559
1559
|
value: c,
|
|
1560
1560
|
previous: s,
|
|
1561
|
-
occurrences: r ?
|
|
1561
|
+
occurrences: r ? rn(r).length : 1
|
|
1562
1562
|
}
|
|
1563
1563
|
});
|
|
1564
1564
|
}, m = (e) => {
|
|
@@ -1577,16 +1577,16 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
|
|
|
1577
1577
|
i && f(i);
|
|
1578
1578
|
}
|
|
1579
1579
|
};
|
|
1580
|
-
},
|
|
1581
|
-
function Xn() {
|
|
1582
|
-
return E(() => Zn(), []), null;
|
|
1583
|
-
}
|
|
1580
|
+
}, Xn = "2026-07-24g · element-capture + region-drag + region-highlights (stale-region guard)";
|
|
1584
1581
|
function Zn() {
|
|
1585
|
-
|
|
1582
|
+
return E(() => Qn(), []), null;
|
|
1583
|
+
}
|
|
1584
|
+
function Qn() {
|
|
1585
|
+
let e = !1, t = null, n = null, r = !1, i = null, a = zn(), o = jn(), { overlay: s, label: c, ring: l, ringLabel: u } = mn();
|
|
1586
1586
|
document.body.append(s, c, l, u);
|
|
1587
|
-
let d =
|
|
1587
|
+
let d = qn();
|
|
1588
1588
|
document.body.append(d.node);
|
|
1589
|
-
let f =
|
|
1589
|
+
let f = Kn();
|
|
1590
1590
|
document.body.append(...f);
|
|
1591
1591
|
let p = [
|
|
1592
1592
|
s,
|
|
@@ -1616,14 +1616,14 @@ function Zn() {
|
|
|
1616
1616
|
}, S = (e) => !e || p.includes(e) || e === document.body || e === document.documentElement, C = (e) => {
|
|
1617
1617
|
if (!e || S(e)) return null;
|
|
1618
1618
|
let t = Y(e) ? e : e.closest("[data-tsd-source]");
|
|
1619
|
-
return !t || S(t) || !
|
|
1620
|
-
}, w = (e) =>
|
|
1619
|
+
return !t || S(t) || !vn(t) ? null : t;
|
|
1620
|
+
}, w = (e) => hn(s, c, e), T = () => {
|
|
1621
1621
|
if (n) {
|
|
1622
1622
|
if (!n.isConnected) {
|
|
1623
|
-
|
|
1623
|
+
N();
|
|
1624
1624
|
return;
|
|
1625
1625
|
}
|
|
1626
|
-
|
|
1626
|
+
hn(l, u, n);
|
|
1627
1627
|
}
|
|
1628
1628
|
}, E = 0, D = () => {
|
|
1629
1629
|
E || !n || r || (E = requestAnimationFrame(() => {
|
|
@@ -1633,90 +1633,90 @@ function Zn() {
|
|
|
1633
1633
|
for (let t of e) {
|
|
1634
1634
|
let e = t.target;
|
|
1635
1635
|
if (!p.some((t) => t === e) && !(t.type === "attributes" && t.attributeName === "data-staged-key")) {
|
|
1636
|
-
D(),
|
|
1636
|
+
D(), L.scheduleReapply();
|
|
1637
1637
|
return;
|
|
1638
1638
|
}
|
|
1639
1639
|
}
|
|
1640
|
-
}), A = !1,
|
|
1640
|
+
}), A = !1, ee = () => {
|
|
1641
1641
|
A ||= (k.observe(document.documentElement, {
|
|
1642
1642
|
attributes: !0,
|
|
1643
1643
|
childList: !0,
|
|
1644
1644
|
characterData: !0,
|
|
1645
1645
|
subtree: !0
|
|
1646
1646
|
}), !0);
|
|
1647
|
-
},
|
|
1647
|
+
}, j = () => {
|
|
1648
1648
|
A &&= (k.disconnect(), !1);
|
|
1649
|
+
}, M = () => {
|
|
1650
|
+
O.disconnect(), n?.isConnected && (O.observe(n), ee());
|
|
1649
1651
|
}, N = () => {
|
|
1650
|
-
O.disconnect(),
|
|
1651
|
-
}, P = () => {
|
|
1652
|
-
n = null, O.disconnect(), z(), E &&= (cancelAnimationFrame(E), 0), l.style.display = "none", u.style.display = "none", y(), g();
|
|
1653
|
-
}, F = (e) => w(e), I = () => {
|
|
1652
|
+
n = null, O.disconnect(), R(), E &&= (cancelAnimationFrame(E), 0), l.style.display = "none", u.style.display = "none", y(), g();
|
|
1653
|
+
}, P = (e) => w(e), F = () => {
|
|
1654
1654
|
s.style.display = "none", c.style.display = "none";
|
|
1655
|
-
},
|
|
1655
|
+
}, I = Yn({
|
|
1656
1656
|
channel: o,
|
|
1657
1657
|
originals: a,
|
|
1658
1658
|
clearTextHover: () => {
|
|
1659
|
-
i = null,
|
|
1659
|
+
i = null, F();
|
|
1660
1660
|
}
|
|
1661
|
-
}),
|
|
1661
|
+
}), L = Jn({
|
|
1662
1662
|
originals: a,
|
|
1663
|
-
editingNode:
|
|
1664
|
-
}),
|
|
1665
|
-
n?.isConnected ||
|
|
1666
|
-
},
|
|
1667
|
-
n && r &&
|
|
1663
|
+
editingNode: I.editingNode
|
|
1664
|
+
}), R = () => {
|
|
1665
|
+
n?.isConnected || L.count() ? ee() : j();
|
|
1666
|
+
}, te = (n) => {
|
|
1667
|
+
n && r && z(!1), e = !!n, x(e), e || (t = null, s.style.display = "none", c.style.display = "none", H()), o.send({
|
|
1668
1668
|
type: "inspect-state",
|
|
1669
1669
|
enabled: e
|
|
1670
1670
|
});
|
|
1671
|
-
},
|
|
1671
|
+
}, z = (t) => {
|
|
1672
1672
|
if (r = !!t, r) {
|
|
1673
|
-
e &&
|
|
1673
|
+
e && te(!1), l.style.display = "none", u.style.display = "none";
|
|
1674
1674
|
for (let e of f) e.style.display = "none";
|
|
1675
|
-
} else
|
|
1675
|
+
} else I.commitIfEditing(), F(), document.documentElement.style.cursor = "", n && T(), m.length > 0 && _();
|
|
1676
1676
|
o.send({
|
|
1677
1677
|
type: "text-edit-state",
|
|
1678
1678
|
enabled: r
|
|
1679
1679
|
});
|
|
1680
|
-
},
|
|
1681
|
-
|
|
1682
|
-
let n = document.elementFromPoint(
|
|
1680
|
+
}, ne = 0, B = 0, re = 0, ie = () => {
|
|
1681
|
+
ne = 0;
|
|
1682
|
+
let n = document.elementFromPoint(B, re);
|
|
1683
1683
|
if (!S(n)) {
|
|
1684
1684
|
if (r) {
|
|
1685
1685
|
let e = C(n);
|
|
1686
|
-
if (e && e ===
|
|
1687
|
-
i = null,
|
|
1686
|
+
if (e && e === I.editingNode()) {
|
|
1687
|
+
i = null, F(), document.documentElement.style.cursor = "";
|
|
1688
1688
|
return;
|
|
1689
1689
|
}
|
|
1690
|
-
i = e, document.documentElement.style.cursor = e ? "text" : "", e ?
|
|
1690
|
+
i = e, document.documentElement.style.cursor = e ? "text" : "", e ? P(e) : F();
|
|
1691
1691
|
return;
|
|
1692
1692
|
}
|
|
1693
1693
|
e && (d.isDragging() || (t = n, n && w(n)));
|
|
1694
1694
|
}
|
|
1695
|
-
},
|
|
1696
|
-
!e && !r || (
|
|
1697
|
-
},
|
|
1698
|
-
|
|
1699
|
-
},
|
|
1700
|
-
|
|
1701
|
-
},
|
|
1702
|
-
n.relatedTarget || (e ? (t = null, s.style.display = "none", c.style.display = "none") : r && !
|
|
1703
|
-
},
|
|
1704
|
-
if (
|
|
1695
|
+
}, ae = (t) => {
|
|
1696
|
+
!e && !r || (B = t.clientX, re = t.clientY, ne ||= requestAnimationFrame(ie));
|
|
1697
|
+
}, V = 0, oe = () => {
|
|
1698
|
+
V = 0, e && t && w(t), r && !I.editingNode() && i?.isConnected && P(i), n && !r && T(), m.length > 0 && !r && _();
|
|
1699
|
+
}, se = () => {
|
|
1700
|
+
V ||= requestAnimationFrame(oe);
|
|
1701
|
+
}, ce = (n) => {
|
|
1702
|
+
n.relatedTarget || (e ? (t = null, s.style.display = "none", c.style.display = "none") : r && !I.editingNode() && (i = null, F(), document.documentElement.style.cursor = ""));
|
|
1703
|
+
}, le = !1, ue = null, de = () => {
|
|
1704
|
+
if (ue != null) {
|
|
1705
1705
|
try {
|
|
1706
|
-
document.documentElement.releasePointerCapture(
|
|
1706
|
+
document.documentElement.releasePointerCapture(ue);
|
|
1707
1707
|
} catch {}
|
|
1708
|
-
|
|
1708
|
+
ue = null;
|
|
1709
1709
|
}
|
|
1710
|
-
},
|
|
1711
|
-
|
|
1712
|
-
},
|
|
1713
|
-
!e || t.button !== 0 || !t.isPrimary || (
|
|
1714
|
-
},
|
|
1710
|
+
}, H = () => {
|
|
1711
|
+
de(), d.cancel();
|
|
1712
|
+
}, U = (t) => {
|
|
1713
|
+
!e || t.button !== 0 || !t.isPrimary || (le = !1, d.pointerDown(t.clientX, t.clientY));
|
|
1714
|
+
}, W = (n) => {
|
|
1715
1715
|
if (!e || !n.isPrimary) return;
|
|
1716
1716
|
let r = d.isDragging();
|
|
1717
1717
|
if (d.pointerMove(n.clientX, n.clientY), d.isDragging()) {
|
|
1718
1718
|
if (!r) {
|
|
1719
|
-
|
|
1719
|
+
ue = n.pointerId;
|
|
1720
1720
|
try {
|
|
1721
1721
|
document.documentElement.setPointerCapture(n.pointerId);
|
|
1722
1722
|
} catch {}
|
|
@@ -1725,14 +1725,14 @@ function Zn() {
|
|
|
1725
1725
|
}
|
|
1726
1726
|
}, fe = (t) => {
|
|
1727
1727
|
if (!e || !t.isPrimary) return;
|
|
1728
|
-
|
|
1728
|
+
de();
|
|
1729
1729
|
let n = d.pointerUp();
|
|
1730
1730
|
if (!n) return;
|
|
1731
|
-
|
|
1732
|
-
let { elements: r, nodes: i, truncated: a } =
|
|
1731
|
+
le = !0, N();
|
|
1732
|
+
let { elements: r, nodes: i, truncated: a } = Gn(n, p);
|
|
1733
1733
|
console.info(`[levo-inspector] region drag: ${Math.round(n.width)}×${Math.round(n.height)} — ${r.length} element(s)${a ? " (truncated)" : ""}`), v(i);
|
|
1734
1734
|
let s = ++h;
|
|
1735
|
-
|
|
1735
|
+
tn(n, p).then((e) => {
|
|
1736
1736
|
s === h && (console.info(`[levo-inspector] region capture ok (${Math.round(e.length / 1024)}kB)`), o.send({
|
|
1737
1737
|
type: "region-selected",
|
|
1738
1738
|
rect: n,
|
|
@@ -1749,21 +1749,21 @@ function Zn() {
|
|
|
1749
1749
|
dataUrl: null
|
|
1750
1750
|
}));
|
|
1751
1751
|
});
|
|
1752
|
-
}, pe = () =>
|
|
1753
|
-
let t =
|
|
1752
|
+
}, pe = () => H(), me = (e) => {
|
|
1753
|
+
let t = gn(e.target);
|
|
1754
1754
|
return t ? (e.preventDefault(), e.stopPropagation(), window.open(t, "_blank", "noopener,noreferrer"), !0) : !1;
|
|
1755
1755
|
}, he = (i) => {
|
|
1756
|
-
if (
|
|
1757
|
-
|
|
1756
|
+
if (le) {
|
|
1757
|
+
le = !1, i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
|
|
1758
1758
|
return;
|
|
1759
1759
|
}
|
|
1760
1760
|
if (r) {
|
|
1761
1761
|
let e = C(document.elementFromPoint(i.clientX, i.clientY) || i.target);
|
|
1762
|
-
if (!e || e ===
|
|
1762
|
+
if (!e || e === I.editingNode()) {
|
|
1763
1763
|
me(i);
|
|
1764
1764
|
return;
|
|
1765
1765
|
}
|
|
1766
|
-
i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation(),
|
|
1766
|
+
i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation(), I.startEdit(e);
|
|
1767
1767
|
return;
|
|
1768
1768
|
}
|
|
1769
1769
|
if (!e) {
|
|
@@ -1774,29 +1774,29 @@ function Zn() {
|
|
|
1774
1774
|
let a = t || i.target;
|
|
1775
1775
|
if (S(a)) return;
|
|
1776
1776
|
let s = a.closest("[data-tsd-source]") || a;
|
|
1777
|
-
y(), g(), n = s, T(),
|
|
1777
|
+
y(), g(), n = s, T(), M(), o.send({
|
|
1778
1778
|
type: "element-selected",
|
|
1779
|
-
element:
|
|
1779
|
+
element: xn(s)
|
|
1780
1780
|
});
|
|
1781
|
-
}, ge =
|
|
1781
|
+
}, ge = Rn({
|
|
1782
1782
|
channel: o,
|
|
1783
1783
|
originals: a,
|
|
1784
|
-
staged:
|
|
1785
|
-
setInspect:
|
|
1786
|
-
setTextEdit:
|
|
1784
|
+
staged: L,
|
|
1785
|
+
setInspect: te,
|
|
1786
|
+
setTextEdit: z,
|
|
1787
1787
|
isInspecting: () => e,
|
|
1788
1788
|
isTextEditing: () => r,
|
|
1789
|
-
editingNode:
|
|
1789
|
+
editingNode: I.editingNode,
|
|
1790
1790
|
setSelected: (e) => {
|
|
1791
|
-
y(), g(), n = e,
|
|
1791
|
+
y(), g(), n = e, M();
|
|
1792
1792
|
},
|
|
1793
1793
|
selectedNode: () => n,
|
|
1794
1794
|
positionSelected: T,
|
|
1795
|
-
clearSelection:
|
|
1796
|
-
syncDomObserver:
|
|
1795
|
+
clearSelection: N,
|
|
1796
|
+
syncDomObserver: R,
|
|
1797
1797
|
positionHover: w,
|
|
1798
|
-
hideTextHover:
|
|
1799
|
-
startEditAtEnd: (e) =>
|
|
1798
|
+
hideTextHover: F,
|
|
1799
|
+
startEditAtEnd: (e) => I.startEdit(e, !0),
|
|
1800
1800
|
editableTarget: C,
|
|
1801
1801
|
ownNodes: p
|
|
1802
1802
|
}), _e = [
|
|
@@ -1827,42 +1827,42 @@ function Zn() {
|
|
|
1827
1827
|
type: "route",
|
|
1828
1828
|
route: e
|
|
1829
1829
|
});
|
|
1830
|
-
}, xe =
|
|
1831
|
-
|
|
1830
|
+
}, xe = Mn({ onPathChange: () => {
|
|
1831
|
+
N(), be();
|
|
1832
1832
|
} }), Se = (t) => {
|
|
1833
|
-
if (
|
|
1833
|
+
if (I.editingNode()) return;
|
|
1834
1834
|
if (t.key === "Escape") {
|
|
1835
1835
|
if (e && d.isDragging()) {
|
|
1836
|
-
t.stopPropagation(),
|
|
1836
|
+
t.stopPropagation(), H();
|
|
1837
1837
|
return;
|
|
1838
1838
|
}
|
|
1839
|
-
r ? (t.stopPropagation(),
|
|
1839
|
+
r ? (t.stopPropagation(), z(!1)) : e && (t.stopPropagation(), te(!1));
|
|
1840
1840
|
return;
|
|
1841
1841
|
}
|
|
1842
|
-
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat ||
|
|
1842
|
+
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat || _n(document.activeElement)) return;
|
|
1843
1843
|
let n = t.key.toLowerCase();
|
|
1844
|
-
n === "s" ? (t.preventDefault(), t.stopPropagation(),
|
|
1844
|
+
n === "s" ? (t.preventDefault(), t.stopPropagation(), te(!e)) : n === "t" && (t.preventDefault(), t.stopPropagation(), z(!r));
|
|
1845
1845
|
};
|
|
1846
|
-
window.addEventListener("mousemove",
|
|
1846
|
+
window.addEventListener("mousemove", ae, !0), window.addEventListener("scroll", se, !0), window.addEventListener("resize", ye), window.addEventListener("click", he, !0), window.addEventListener("keydown", Se, !0), window.addEventListener("message", ge.onMessage), window.addEventListener("mouseout", ce, !0), window.addEventListener("pointerdown", U, !0), window.addEventListener("pointermove", W, !0), window.addEventListener("pointerup", fe, !0), window.addEventListener("pointercancel", pe, !0);
|
|
1847
1847
|
for (let e of _e) window.addEventListener(e, ve, !0);
|
|
1848
|
-
return console.info(`[levo-inspector] build ${
|
|
1849
|
-
window.removeEventListener("mousemove",
|
|
1848
|
+
return console.info(`[levo-inspector] build ${Xn} — runtime mounted`), be(), o.send({ type: "ready" }), () => {
|
|
1849
|
+
window.removeEventListener("mousemove", ae, !0), window.removeEventListener("keydown", Se, !0), window.removeEventListener("scroll", se, !0), window.removeEventListener("resize", ye), window.removeEventListener("mouseout", ce, !0), window.removeEventListener("pointerdown", U, !0), window.removeEventListener("pointermove", W, !0), window.removeEventListener("pointerup", fe, !0), window.removeEventListener("pointercancel", pe, !0), window.removeEventListener("click", he, !0), window.removeEventListener("message", ge.onMessage);
|
|
1850
1850
|
for (let e of _e) window.removeEventListener(e, ve, !0);
|
|
1851
|
-
O.disconnect(), k.disconnect(), E && cancelAnimationFrame(E),
|
|
1851
|
+
O.disconnect(), k.disconnect(), E && cancelAnimationFrame(E), ne && cancelAnimationFrame(ne), V && cancelAnimationFrame(V), L.teardown(), xe.teardown(), I.teardown(), document.documentElement.style.cursor = "", b?.remove(), s.remove(), c.remove(), l.remove(), u.remove(), H(), d.node.remove();
|
|
1852
1852
|
for (let e of f) e.remove();
|
|
1853
1853
|
};
|
|
1854
1854
|
}
|
|
1855
1855
|
//#endregion
|
|
1856
1856
|
//#region src/branding/MadeWithLevo.tsx
|
|
1857
|
-
var
|
|
1858
|
-
.${
|
|
1857
|
+
var $n = "levo-made-with", er = `.${$n}{opacity:.2;transition:opacity 150ms,transform 150ms}
|
|
1858
|
+
.${$n}:hover,.${$n}:focus-visible{opacity:1;transform:translateY(-2px)}`, tr = ({ slug: e }) => {
|
|
1859
1859
|
let t = `utm_source=${encodeURIComponent(e || "website")}&utm_term=Made%20With%20Levo&utm_campaign=footer_branding&utm_medium=organic_footer_branding`;
|
|
1860
|
-
return /* @__PURE__ */
|
|
1860
|
+
return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M("style", {
|
|
1861
1861
|
href: "levo-made-with",
|
|
1862
1862
|
precedence: "default",
|
|
1863
|
-
children:
|
|
1864
|
-
}), /* @__PURE__ */
|
|
1865
|
-
className:
|
|
1863
|
+
children: er
|
|
1864
|
+
}), /* @__PURE__ */ N("a", {
|
|
1865
|
+
className: $n,
|
|
1866
1866
|
href: `https://levo.so/?${t}`,
|
|
1867
1867
|
target: "_blank",
|
|
1868
1868
|
rel: "noopener noreferrer",
|
|
@@ -1882,7 +1882,7 @@ var Qn = "levo-made-with", $n = `.${Qn}{opacity:.2;transition:opacity 150ms,tran
|
|
|
1882
1882
|
textDecoration: "none",
|
|
1883
1883
|
boxShadow: "0 4px 12px rgb(0 0 0 / 0.25)"
|
|
1884
1884
|
},
|
|
1885
|
-
children: [/* @__PURE__ */
|
|
1885
|
+
children: [/* @__PURE__ */ M("img", {
|
|
1886
1886
|
alt: "",
|
|
1887
1887
|
src: "https://static.levocdn.com/WLZ1TXTD/Levo-Logo-moxa93IxlVi0W.webp",
|
|
1888
1888
|
width: 20,
|
|
@@ -1893,58 +1893,58 @@ var Qn = "levo-made-with", $n = `.${Qn}{opacity:.2;transition:opacity 150ms,tran
|
|
|
1893
1893
|
}
|
|
1894
1894
|
}), "Made with Levo"]
|
|
1895
1895
|
})] });
|
|
1896
|
-
},
|
|
1896
|
+
}, nr = "levo:page-id", rr = () => {
|
|
1897
1897
|
if (typeof document > "u") return null;
|
|
1898
|
-
let e = document.querySelectorAll(`meta[name="${
|
|
1898
|
+
let e = document.querySelectorAll(`meta[name="${nr}"]`);
|
|
1899
1899
|
return e[e.length - 1]?.getAttribute("content")?.trim() || null;
|
|
1900
|
-
},
|
|
1900
|
+
}, ir = C(() => import("./dist-DTszGV-P.js").then((e) => e.n).then((e) => ({ default: e.PopupLoader }))), ar = ({ siteId: e, pageId: t }) => {
|
|
1901
1901
|
let n = K(), r = i();
|
|
1902
|
-
return !n || !r ? null : /* @__PURE__ */
|
|
1902
|
+
return !n || !r ? null : /* @__PURE__ */ M(x, {
|
|
1903
1903
|
fallback: null,
|
|
1904
|
-
children: /* @__PURE__ */
|
|
1904
|
+
children: /* @__PURE__ */ M(ir, {
|
|
1905
1905
|
pageId: t,
|
|
1906
1906
|
siteId: e
|
|
1907
1907
|
})
|
|
1908
1908
|
});
|
|
1909
|
-
},
|
|
1909
|
+
}, or = S(null), sr = or.Provider, cr = () => T(or), lr = () => i(), ur = () => n(), dr = ({ site: e, analytics: t = !0, children: n }) => {
|
|
1910
1910
|
let [i] = A(() => {
|
|
1911
1911
|
if (!e) return null;
|
|
1912
|
-
let n =
|
|
1912
|
+
let n = Ne(e), r = Me(n);
|
|
1913
1913
|
return r ? {
|
|
1914
1914
|
client: r,
|
|
1915
|
-
insights:
|
|
1915
|
+
insights: re(r, {
|
|
1916
1916
|
insightsUrl: t && n.insightsUrl || null,
|
|
1917
1917
|
site: n.siteId || null
|
|
1918
1918
|
}),
|
|
1919
1919
|
site: e
|
|
1920
1920
|
} : null;
|
|
1921
|
-
}), [a, o] = A(null), s =
|
|
1921
|
+
}), [a, o] = A(null), s = B({ select: (e) => e.location.pathname }), c = Ln();
|
|
1922
1922
|
return E(() => {
|
|
1923
1923
|
i && (window.levo_client = i.client, window.levo_insights = i.insights);
|
|
1924
1924
|
}, [i]), D(() => {
|
|
1925
1925
|
if (!i) return;
|
|
1926
|
-
let e =
|
|
1926
|
+
let e = rr();
|
|
1927
1927
|
o(e), i.insights.init({ pageId: e });
|
|
1928
|
-
}, [i, s]), i ? /* @__PURE__ */
|
|
1928
|
+
}, [i, s]), i ? /* @__PURE__ */ N(r, {
|
|
1929
1929
|
client: i.client,
|
|
1930
1930
|
insights: i.insights,
|
|
1931
1931
|
children: [
|
|
1932
|
-
/* @__PURE__ */
|
|
1932
|
+
/* @__PURE__ */ M(sr, {
|
|
1933
1933
|
value: i.site,
|
|
1934
1934
|
children: n
|
|
1935
1935
|
}),
|
|
1936
|
-
!c && /* @__PURE__ */
|
|
1936
|
+
!c && /* @__PURE__ */ M(Mt, {
|
|
1937
1937
|
site: i.site,
|
|
1938
1938
|
path: s
|
|
1939
1939
|
}),
|
|
1940
|
-
/* @__PURE__ */
|
|
1940
|
+
/* @__PURE__ */ M(ar, {
|
|
1941
1941
|
pageId: a ?? void 0,
|
|
1942
1942
|
siteId: i.site.id
|
|
1943
1943
|
}),
|
|
1944
|
-
!c && !!i.site.feature_flag?.branding && /* @__PURE__ */
|
|
1944
|
+
!c && !!i.site.feature_flag?.branding && /* @__PURE__ */ M(tr, { slug: i.site.slug })
|
|
1945
1945
|
]
|
|
1946
|
-
}) : /* @__PURE__ */
|
|
1947
|
-
},
|
|
1946
|
+
}) : /* @__PURE__ */ M(j, { children: n });
|
|
1947
|
+
}, fr = (e, t) => {
|
|
1948
1948
|
let n = h(t);
|
|
1949
1949
|
return ({ location: t }) => {
|
|
1950
1950
|
if (!e.isLocalized) return;
|
|
@@ -1955,12 +1955,12 @@ var Qn = "levo-made-with", $n = `.${Qn}{opacity:.2;transition:opacity 150ms,tran
|
|
|
1955
1955
|
cookie: typeof document > "u" ? null : document.cookie,
|
|
1956
1956
|
hasRoute: n
|
|
1957
1957
|
});
|
|
1958
|
-
if (r.kind === "redirect" && r.path !== t.pathname) throw
|
|
1958
|
+
if (r.kind === "redirect" && r.path !== t.pathname) throw ne({
|
|
1959
1959
|
search: !0,
|
|
1960
1960
|
to: r.path
|
|
1961
1961
|
});
|
|
1962
1962
|
};
|
|
1963
|
-
},
|
|
1963
|
+
}, pr = (e) => {
|
|
1964
1964
|
let t = e.locales ?? [], n = e.domain?.trim().replace(/^https?:\/\//, "").replace(/\/+$/, "");
|
|
1965
1965
|
return {
|
|
1966
1966
|
locales: t,
|
|
@@ -1968,8 +1968,8 @@ var Qn = "levo-made-with", $n = `.${Qn}{opacity:.2;transition:opacity 150ms,tran
|
|
|
1968
1968
|
isLocalized: t.length > 1,
|
|
1969
1969
|
origin: n ? `https://${n}` : null
|
|
1970
1970
|
};
|
|
1971
|
-
},
|
|
1972
|
-
let { neutralPath: t, locales: n, activePrefix: r, hasRoute: i } = e, a =
|
|
1971
|
+
}, mr = (e) => e.replace(/\/$/, ""), hr = (e) => {
|
|
1972
|
+
let { neutralPath: t, locales: n, activePrefix: r, hasRoute: i } = e, a = mr(e.origin), o = `${a}${t}`;
|
|
1973
1973
|
if (n.length <= 1) return [{
|
|
1974
1974
|
rel: "canonical",
|
|
1975
1975
|
href: o
|
|
@@ -1991,24 +1991,24 @@ var Qn = "levo-made-with", $n = `.${Qn}{opacity:.2;transition:opacity 150ms,tran
|
|
|
1991
1991
|
hrefLang: "x-default",
|
|
1992
1992
|
href: o
|
|
1993
1993
|
}), s;
|
|
1994
|
-
},
|
|
1994
|
+
}, gr = ({ to: e, ...t }) => /* @__PURE__ */ M(te, {
|
|
1995
1995
|
...t,
|
|
1996
1996
|
to: e
|
|
1997
|
-
}),
|
|
1998
|
-
let n =
|
|
1997
|
+
}), _r = ({ config: e, routeTree: t }) => {
|
|
1998
|
+
let n = B({ select: (e) => e.location.pathname });
|
|
1999
1999
|
if (!e.isLocalized || !e.origin) return null;
|
|
2000
2000
|
let { neutralPath: r } = f(n, e.locales);
|
|
2001
|
-
return /* @__PURE__ */
|
|
2001
|
+
return /* @__PURE__ */ M(j, { children: hr({
|
|
2002
2002
|
neutralPath: r,
|
|
2003
2003
|
origin: e.origin,
|
|
2004
2004
|
locales: e.locales,
|
|
2005
2005
|
hasRoute: t ? h(t) : void 0
|
|
2006
|
-
}).filter((e) => e.rel === "alternate").map((e) => /* @__PURE__ */
|
|
2006
|
+
}).filter((e) => e.rel === "alternate").map((e) => /* @__PURE__ */ M("link", {
|
|
2007
2007
|
href: e.href,
|
|
2008
2008
|
hrefLang: e.hrefLang,
|
|
2009
2009
|
rel: e.rel
|
|
2010
2010
|
}, e.hrefLang ?? e.href)) });
|
|
2011
|
-
},
|
|
2011
|
+
}, vr = S(void 0), yr = ({ children: e, locale: t, locales: n, defaultLocale: r, source: i = "default", hasRoute: a }) => {
|
|
2012
2012
|
let o = O(() => {
|
|
2013
2013
|
let e = n?.length ? n : [t];
|
|
2014
2014
|
return {
|
|
@@ -2032,13 +2032,13 @@ var Qn = "levo-made-with", $n = `.${Qn}{opacity:.2;transition:opacity 150ms,tran
|
|
|
2032
2032
|
i,
|
|
2033
2033
|
a
|
|
2034
2034
|
]);
|
|
2035
|
-
return /* @__PURE__ */
|
|
2035
|
+
return /* @__PURE__ */ M(vr.Provider, {
|
|
2036
2036
|
value: o,
|
|
2037
2037
|
children: e
|
|
2038
2038
|
});
|
|
2039
2039
|
};
|
|
2040
|
-
function
|
|
2041
|
-
return T(
|
|
2040
|
+
function br() {
|
|
2041
|
+
return T(vr) || {
|
|
2042
2042
|
locale: "en",
|
|
2043
2043
|
locales: ["en"],
|
|
2044
2044
|
defaultLocale: "en",
|
|
@@ -2048,13 +2048,13 @@ function yr() {
|
|
|
2048
2048
|
pathFor: (e) => e
|
|
2049
2049
|
};
|
|
2050
2050
|
}
|
|
2051
|
-
function
|
|
2052
|
-
let { prefix: t } = f(
|
|
2051
|
+
function xr(e) {
|
|
2052
|
+
let { prefix: t } = f(B({ select: (e) => e.location.pathname }), e.locales);
|
|
2053
2053
|
return t ?? e.defaultLocale;
|
|
2054
2054
|
}
|
|
2055
|
-
var
|
|
2056
|
-
let { prefix: r } = f(
|
|
2057
|
-
return /* @__PURE__ */
|
|
2055
|
+
var Sr = ({ config: e, children: t, routeTree: n }) => {
|
|
2056
|
+
let { prefix: r } = f(B({ select: (e) => e.location.pathname }), e.locales);
|
|
2057
|
+
return /* @__PURE__ */ M(yr, {
|
|
2058
2058
|
defaultLocale: e.defaultLocale,
|
|
2059
2059
|
hasRoute: n ? h(n) : void 0,
|
|
2060
2060
|
locale: r ?? e.defaultLocale,
|
|
@@ -2063,8 +2063,8 @@ var xr = ({ config: e, children: t, routeTree: n }) => {
|
|
|
2063
2063
|
children: t
|
|
2064
2064
|
});
|
|
2065
2065
|
};
|
|
2066
|
-
function
|
|
2067
|
-
let { locale: e, locales: t, isMultiLocale: n, setLocale: r, pathFor: i, hasRoute: a } =
|
|
2066
|
+
function Cr() {
|
|
2067
|
+
let { locale: e, locales: t, isMultiLocale: n, setLocale: r, pathFor: i, hasRoute: a } = br(), o = B({ select: (e) => e.location.pathname });
|
|
2068
2068
|
return O(() => {
|
|
2069
2069
|
if (!n) return [];
|
|
2070
2070
|
let { neutralPath: s } = f(o, t), c = t.filter((e) => !a || a(i(s, e)));
|
|
@@ -2091,14 +2091,14 @@ function Sr() {
|
|
|
2091
2091
|
}
|
|
2092
2092
|
//#endregion
|
|
2093
2093
|
//#region src/pageHead.tsx
|
|
2094
|
-
var
|
|
2094
|
+
var wr = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), Tr = (e) => {
|
|
2095
2095
|
let t = {}, n = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*("([^"]*)"|'([^']*)'|[^\s"'>]+))?/g;
|
|
2096
2096
|
for (let r = n.exec(e); r; r = n.exec(e)) {
|
|
2097
2097
|
let e = r[1];
|
|
2098
2098
|
!e || /^on/i.test(e) || (t[e] = r[3] ?? r[4] ?? (r[2] ? r[2] : ""));
|
|
2099
2099
|
}
|
|
2100
2100
|
return t;
|
|
2101
|
-
},
|
|
2101
|
+
}, Er = (e) => {
|
|
2102
2102
|
let t = {
|
|
2103
2103
|
meta: [],
|
|
2104
2104
|
links: [],
|
|
@@ -2106,11 +2106,11 @@ var Cr = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), wr = (e) => {
|
|
|
2106
2106
|
};
|
|
2107
2107
|
if (!e?.trim()) return t;
|
|
2108
2108
|
let n = e.replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi, (e, n, r) => {
|
|
2109
|
-
let i =
|
|
2109
|
+
let i = Tr(n), a = r.trim();
|
|
2110
2110
|
return a && (i.children = a), t.scripts.push(i), "";
|
|
2111
2111
|
});
|
|
2112
|
-
return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(
|
|
2113
|
-
},
|
|
2112
|
+
return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(Tr(r)), "")), t;
|
|
2113
|
+
}, Dr = (e = {}, t = {}) => {
|
|
2114
2114
|
let n = {
|
|
2115
2115
|
meta: [],
|
|
2116
2116
|
links: [],
|
|
@@ -2172,21 +2172,21 @@ var Cr = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), wr = (e) => {
|
|
|
2172
2172
|
let y = e.ldJson ? Array.isArray(e.ldJson) ? e.ldJson : [e.ldJson] : [];
|
|
2173
2173
|
for (let e of y) n.scripts.push({
|
|
2174
2174
|
type: "application/ld+json",
|
|
2175
|
-
children:
|
|
2175
|
+
children: wr(e)
|
|
2176
2176
|
});
|
|
2177
2177
|
for (let r of [t.customHead, e.customHead]) {
|
|
2178
2178
|
if (!r) continue;
|
|
2179
|
-
let e =
|
|
2179
|
+
let e = Er(r);
|
|
2180
2180
|
n.meta.push(...e.meta), n.links.push(...e.links), n.scripts.push(...e.scripts);
|
|
2181
2181
|
}
|
|
2182
2182
|
return n;
|
|
2183
2183
|
};
|
|
2184
|
-
function
|
|
2185
|
-
let n =
|
|
2186
|
-
return /* @__PURE__ */
|
|
2187
|
-
n.meta.map((e, t) => e.title === void 0 ? /* @__PURE__ */
|
|
2188
|
-
n.links.map((e, t) => /* @__PURE__ */
|
|
2189
|
-
n.scripts.map(({ children: e, ...t }, n) => e === void 0 ? /* @__PURE__ */
|
|
2184
|
+
function Or({ meta: e, site: t }) {
|
|
2185
|
+
let n = Dr(e, t);
|
|
2186
|
+
return /* @__PURE__ */ N(j, { children: [
|
|
2187
|
+
n.meta.map((e, t) => e.title === void 0 ? /* @__PURE__ */ M("meta", { ...e }, `m${t}`) : /* @__PURE__ */ M("title", { children: e.title }, `t${t}`)),
|
|
2188
|
+
n.links.map((e, t) => /* @__PURE__ */ M("link", { ...e }, `l${t}`)),
|
|
2189
|
+
n.scripts.map(({ children: e, ...t }, n) => e === void 0 ? /* @__PURE__ */ M("script", { ...t }, `s${n}`) : /* @__PURE__ */ M("script", {
|
|
2190
2190
|
...t,
|
|
2191
2191
|
dangerouslySetInnerHTML: { __html: e }
|
|
2192
2192
|
}, `s${n}`))
|
|
@@ -2194,17 +2194,17 @@ function Dr({ meta: e, site: t }) {
|
|
|
2194
2194
|
}
|
|
2195
2195
|
//#endregion
|
|
2196
2196
|
//#region src/registration/ui.tsx
|
|
2197
|
-
var X = (...e) => e.filter(Boolean).join(" "),
|
|
2197
|
+
var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, children: n }) => /* @__PURE__ */ M("div", {
|
|
2198
2198
|
inert: !e,
|
|
2199
2199
|
className: X("grid transition-[grid-template-rows,opacity] duration-250 ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:transition-none", e ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"),
|
|
2200
|
-
children: /* @__PURE__ */
|
|
2200
|
+
children: /* @__PURE__ */ M("div", {
|
|
2201
2201
|
className: "overflow-hidden",
|
|
2202
|
-
children: /* @__PURE__ */
|
|
2202
|
+
children: /* @__PURE__ */ M("div", {
|
|
2203
2203
|
className: t,
|
|
2204
2204
|
children: n
|
|
2205
2205
|
})
|
|
2206
2206
|
})
|
|
2207
|
-
}),
|
|
2207
|
+
}), Ar = [
|
|
2208
2208
|
{
|
|
2209
2209
|
key: "email",
|
|
2210
2210
|
label: "Email",
|
|
@@ -2237,7 +2237,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2237
2237
|
inputMode: void 0,
|
|
2238
2238
|
autoComplete: "organization-title"
|
|
2239
2239
|
}
|
|
2240
|
-
],
|
|
2240
|
+
], jr = [{
|
|
2241
2241
|
key: "name",
|
|
2242
2242
|
label: "Registered company name",
|
|
2243
2243
|
placeholder: "Acme Corporation",
|
|
@@ -2247,7 +2247,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2247
2247
|
label: "Tax ID / GST number",
|
|
2248
2248
|
placeholder: "22AAAAA0000A1Z5",
|
|
2249
2249
|
autoComplete: "off"
|
|
2250
|
-
}],
|
|
2250
|
+
}], Mr = [
|
|
2251
2251
|
{
|
|
2252
2252
|
key: "line1",
|
|
2253
2253
|
label: "Billing address",
|
|
@@ -2296,22 +2296,22 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2296
2296
|
wide: !1,
|
|
2297
2297
|
optional: !1
|
|
2298
2298
|
}
|
|
2299
|
-
],
|
|
2299
|
+
], Nr = (e) => X("w-full rounded-xl border bg-page px-3.5 py-2.5 text-base text-ink outline-none transition placeholder:text-ink-muted/60", e ? "border-danger focus:ring-[3px] focus:ring-danger/15" : "border-border focus:border-brand focus:ring-[3px] focus:ring-brand/20"), Pr = "flex items-baseline gap-1.5 font-medium text-ink text-sm", Fr = () => /* @__PURE__ */ M("span", {
|
|
2300
2300
|
"aria-hidden": !0,
|
|
2301
2301
|
className: "text-danger",
|
|
2302
2302
|
children: "*"
|
|
2303
|
-
}),
|
|
2303
|
+
}), Ir = ({ values: e, errors: t, touched: n, onChange: r, onBlur: i, showBusinessBilling: a = !1, registrationFields: o, nameInputRef: s, idPrefix: c = "attendee", nameLabel: l = "Your name" }) => /* @__PURE__ */ N("div", {
|
|
2304
2304
|
className: "flex flex-col gap-4",
|
|
2305
2305
|
children: [
|
|
2306
|
-
/* @__PURE__ */
|
|
2306
|
+
/* @__PURE__ */ N("div", {
|
|
2307
2307
|
className: "flex flex-col gap-1.5",
|
|
2308
2308
|
children: [
|
|
2309
|
-
/* @__PURE__ */
|
|
2309
|
+
/* @__PURE__ */ N("label", {
|
|
2310
2310
|
htmlFor: `${c}-name`,
|
|
2311
|
-
className:
|
|
2312
|
-
children: [l, /* @__PURE__ */
|
|
2311
|
+
className: Pr,
|
|
2312
|
+
children: [l, /* @__PURE__ */ M(Fr, {})]
|
|
2313
2313
|
}),
|
|
2314
|
-
/* @__PURE__ */
|
|
2314
|
+
/* @__PURE__ */ M("input", {
|
|
2315
2315
|
ref: s,
|
|
2316
2316
|
id: `${c}-name`,
|
|
2317
2317
|
name: "name",
|
|
@@ -2321,31 +2321,31 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2321
2321
|
value: e.name,
|
|
2322
2322
|
onChange: (e) => r("name", e.target.value),
|
|
2323
2323
|
onBlur: () => i("name"),
|
|
2324
|
-
className:
|
|
2324
|
+
className: Nr(n.name && !!t.name),
|
|
2325
2325
|
required: !0
|
|
2326
2326
|
}),
|
|
2327
|
-
n.name && t.name && /* @__PURE__ */
|
|
2327
|
+
n.name && t.name && /* @__PURE__ */ M("p", {
|
|
2328
2328
|
className: "m-0 text-danger text-xs",
|
|
2329
2329
|
children: t.name
|
|
2330
2330
|
})
|
|
2331
2331
|
]
|
|
2332
2332
|
}),
|
|
2333
|
-
|
|
2333
|
+
Ar.map((a) => {
|
|
2334
2334
|
let s = o[a.key];
|
|
2335
2335
|
if (s === "off") return null;
|
|
2336
2336
|
let l = n[a.key] ? t[a.key] : void 0, u = a.key === "email" || a.key === "mobile";
|
|
2337
|
-
return /* @__PURE__ */
|
|
2337
|
+
return /* @__PURE__ */ N("div", {
|
|
2338
2338
|
className: "flex flex-col gap-1.5",
|
|
2339
2339
|
children: [
|
|
2340
|
-
/* @__PURE__ */
|
|
2340
|
+
/* @__PURE__ */ N("label", {
|
|
2341
2341
|
htmlFor: `${c}-${a.key}`,
|
|
2342
|
-
className:
|
|
2343
|
-
children: [a.label, s === "required" ? /* @__PURE__ */
|
|
2342
|
+
className: Pr,
|
|
2343
|
+
children: [a.label, s === "required" ? /* @__PURE__ */ M(Fr, {}) : /* @__PURE__ */ M("span", {
|
|
2344
2344
|
className: "font-normal text-ink-muted text-xs",
|
|
2345
2345
|
children: "Optional"
|
|
2346
2346
|
})]
|
|
2347
2347
|
}),
|
|
2348
|
-
/* @__PURE__ */
|
|
2348
|
+
/* @__PURE__ */ M("input", {
|
|
2349
2349
|
id: `${c}-${a.key}`,
|
|
2350
2350
|
name: a.key,
|
|
2351
2351
|
type: a.type,
|
|
@@ -2358,22 +2358,22 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2358
2358
|
value: e[a.key],
|
|
2359
2359
|
onChange: (e) => r(a.key, e.target.value),
|
|
2360
2360
|
onBlur: () => i(a.key),
|
|
2361
|
-
className:
|
|
2361
|
+
className: Nr(!!l),
|
|
2362
2362
|
required: s === "required"
|
|
2363
2363
|
}),
|
|
2364
|
-
l && /* @__PURE__ */
|
|
2364
|
+
l && /* @__PURE__ */ M("p", {
|
|
2365
2365
|
className: "m-0 text-danger text-xs",
|
|
2366
2366
|
children: l
|
|
2367
2367
|
})
|
|
2368
2368
|
]
|
|
2369
2369
|
}, a.key);
|
|
2370
2370
|
}),
|
|
2371
|
-
a && /* @__PURE__ */
|
|
2371
|
+
a && /* @__PURE__ */ M(Lr, {
|
|
2372
2372
|
values: e,
|
|
2373
2373
|
onChange: r
|
|
2374
2374
|
})
|
|
2375
2375
|
]
|
|
2376
|
-
}),
|
|
2376
|
+
}), Lr = ({ values: e, onChange: t }) => {
|
|
2377
2377
|
let n = (n, r) => t("billing_details", {
|
|
2378
2378
|
...e.billing_details,
|
|
2379
2379
|
[n]: r
|
|
@@ -2384,13 +2384,13 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2384
2384
|
[n]: r
|
|
2385
2385
|
}
|
|
2386
2386
|
}), i = !!e.billing_details.name.trim() || !!e.billing_details.tax_id.trim() || Object.values(e.billing_details.address).some((e) => !!e.trim());
|
|
2387
|
-
return /* @__PURE__ */
|
|
2387
|
+
return /* @__PURE__ */ N("div", {
|
|
2388
2388
|
className: "rounded-xl border border-border bg-ink/3",
|
|
2389
2389
|
children: [
|
|
2390
|
-
/* @__PURE__ */
|
|
2390
|
+
/* @__PURE__ */ N("label", {
|
|
2391
2391
|
htmlFor: "is_business_purchase",
|
|
2392
2392
|
className: "flex w-full cursor-pointer items-center gap-2.5 px-3.5 py-3 text-ink text-sm",
|
|
2393
|
-
children: [/* @__PURE__ */
|
|
2393
|
+
children: [/* @__PURE__ */ M("input", {
|
|
2394
2394
|
id: "is_business_purchase",
|
|
2395
2395
|
type: "checkbox",
|
|
2396
2396
|
checked: e.is_business_purchase,
|
|
@@ -2399,29 +2399,29 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2399
2399
|
className: "size-4 shrink-0 cursor-pointer rounded accent-brand"
|
|
2400
2400
|
}), "Bill this to a business — I need a GST invoice"]
|
|
2401
2401
|
}),
|
|
2402
|
-
!e.is_business_purchase && i && /* @__PURE__ */
|
|
2402
|
+
!e.is_business_purchase && i && /* @__PURE__ */ M("p", {
|
|
2403
2403
|
className: "m-0 px-3.5 pb-3 text-amber-700 text-xs leading-relaxed starting:opacity-0 transition-opacity duration-200 dark:text-amber-400",
|
|
2404
2404
|
children: "Your billing details are still saved — tick the box to apply them."
|
|
2405
2405
|
}),
|
|
2406
|
-
/* @__PURE__ */
|
|
2406
|
+
/* @__PURE__ */ M(kr, {
|
|
2407
2407
|
open: e.is_business_purchase,
|
|
2408
2408
|
className: "px-3.5 pb-3.5",
|
|
2409
|
-
children: /* @__PURE__ */
|
|
2409
|
+
children: /* @__PURE__ */ N("div", {
|
|
2410
2410
|
className: "flex flex-col gap-3",
|
|
2411
2411
|
children: [
|
|
2412
|
-
/* @__PURE__ */
|
|
2412
|
+
/* @__PURE__ */ M("p", {
|
|
2413
2413
|
className: "m-0 text-ink-muted text-xs leading-relaxed",
|
|
2414
2414
|
children: "This booking will be billed to your business. The invoice is raised against the details below."
|
|
2415
2415
|
}),
|
|
2416
|
-
|
|
2416
|
+
jr.map((t) => /* @__PURE__ */ N("div", {
|
|
2417
2417
|
className: "flex flex-col gap-1.5",
|
|
2418
|
-
children: [/* @__PURE__ */
|
|
2418
|
+
children: [/* @__PURE__ */ N("label", {
|
|
2419
2419
|
htmlFor: `billing-${t.key}`,
|
|
2420
|
-
className:
|
|
2421
|
-
children: [t.label, /* @__PURE__ */
|
|
2422
|
-
}), /* @__PURE__ */
|
|
2420
|
+
className: Pr,
|
|
2421
|
+
children: [t.label, /* @__PURE__ */ M(Fr, {})]
|
|
2422
|
+
}), /* @__PURE__ */ M("input", {
|
|
2423
2423
|
id: `billing-${t.key}`,
|
|
2424
|
-
className:
|
|
2424
|
+
className: Nr(),
|
|
2425
2425
|
placeholder: t.placeholder,
|
|
2426
2426
|
autoComplete: t.autoComplete,
|
|
2427
2427
|
value: e.billing_details[t.key],
|
|
@@ -2429,17 +2429,17 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2429
2429
|
required: e.is_business_purchase
|
|
2430
2430
|
})]
|
|
2431
2431
|
}, t.key)),
|
|
2432
|
-
/* @__PURE__ */
|
|
2432
|
+
/* @__PURE__ */ M("div", {
|
|
2433
2433
|
className: "grid grid-cols-2 gap-3",
|
|
2434
|
-
children:
|
|
2434
|
+
children: Mr.map((t) => /* @__PURE__ */ N("div", {
|
|
2435
2435
|
className: X("flex flex-col gap-1.5", t.wide && "col-span-2"),
|
|
2436
|
-
children: [/* @__PURE__ */
|
|
2436
|
+
children: [/* @__PURE__ */ N("label", {
|
|
2437
2437
|
htmlFor: `billing-${t.key}`,
|
|
2438
|
-
className:
|
|
2439
|
-
children: [t.label, !t.optional && /* @__PURE__ */
|
|
2440
|
-
}), /* @__PURE__ */
|
|
2438
|
+
className: Pr,
|
|
2439
|
+
children: [t.label, !t.optional && /* @__PURE__ */ M(Fr, {})]
|
|
2440
|
+
}), /* @__PURE__ */ M("input", {
|
|
2441
2441
|
id: `billing-${t.key}`,
|
|
2442
|
-
className:
|
|
2442
|
+
className: Nr(),
|
|
2443
2443
|
placeholder: t.placeholder,
|
|
2444
2444
|
autoComplete: t.autoComplete,
|
|
2445
2445
|
inputMode: t.key === "postal_code" ? "numeric" : void 0,
|
|
@@ -2454,7 +2454,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2454
2454
|
})
|
|
2455
2455
|
]
|
|
2456
2456
|
});
|
|
2457
|
-
},
|
|
2457
|
+
}, Rr = ({ attendees: e, openKey: t, onOpenChange: n }) => {
|
|
2458
2458
|
let { slots: r } = e, i = [];
|
|
2459
2459
|
for (let e of r) {
|
|
2460
2460
|
let t = i.at(-1);
|
|
@@ -2467,54 +2467,54 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2467
2467
|
let a = (t) => {
|
|
2468
2468
|
e.touchSlot(t), e.isSlotValid(t) && n(r[r.findIndex((e) => e.key === t) + 1]?.key ?? null);
|
|
2469
2469
|
};
|
|
2470
|
-
return /* @__PURE__ */
|
|
2470
|
+
return /* @__PURE__ */ M(U.Root, {
|
|
2471
2471
|
value: t ? [t] : [],
|
|
2472
2472
|
onValueChange: (e) => n(e[0] ?? null),
|
|
2473
2473
|
className: "flex flex-col gap-5",
|
|
2474
|
-
children: i.map((n) => /* @__PURE__ */
|
|
2474
|
+
children: i.map((n) => /* @__PURE__ */ N("section", {
|
|
2475
2475
|
className: "flex flex-col gap-2",
|
|
2476
|
-
children: [/* @__PURE__ */
|
|
2476
|
+
children: [/* @__PURE__ */ N("h4", {
|
|
2477
2477
|
className: "m-0 font-semibold text-[15px] text-ink leading-snug [overflow-wrap:anywhere]",
|
|
2478
|
-
children: [n.title, n.slots.length > 1 && /* @__PURE__ */
|
|
2478
|
+
children: [n.title, n.slots.length > 1 && /* @__PURE__ */ N("span", {
|
|
2479
2479
|
className: "ml-1.5 font-normal text-ink-muted tabular-nums",
|
|
2480
2480
|
children: ["× ", n.slots.length]
|
|
2481
2481
|
})]
|
|
2482
2482
|
}), n.slots.map((n, i) => {
|
|
2483
2483
|
let o = n.key === t, s = n.key === r.at(-1)?.key, c = e.getValues(n.key), l = e.isSlotValid(n.key), u = !l && e.isSlotVisited(n.key), d = n.key === r[0]?.key;
|
|
2484
|
-
return /* @__PURE__ */
|
|
2484
|
+
return /* @__PURE__ */ N(U.Item, {
|
|
2485
2485
|
value: n.key,
|
|
2486
2486
|
className: X("rounded-xl border transition-colors", o ? "border-brand/60" : u ? "border-danger/50" : "border-border"),
|
|
2487
|
-
children: [/* @__PURE__ */
|
|
2487
|
+
children: [/* @__PURE__ */ M(U.Header, {
|
|
2488
2488
|
className: "m-0",
|
|
2489
|
-
children: /* @__PURE__ */
|
|
2489
|
+
children: /* @__PURE__ */ N(U.Trigger, {
|
|
2490
2490
|
className: "group flex w-full items-center gap-3 px-3.5 py-3 text-left",
|
|
2491
2491
|
children: [
|
|
2492
|
-
/* @__PURE__ */
|
|
2492
|
+
/* @__PURE__ */ M("span", {
|
|
2493
2493
|
"aria-hidden": !0,
|
|
2494
2494
|
className: X("inline-flex size-7 shrink-0 items-center justify-center rounded-full font-semibold text-[12.5px] tabular-nums transition-colors", l ? "bg-emerald-500/10 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400" : u ? "bg-danger/10 text-danger" : "bg-ink/5 text-ink-soft"),
|
|
2495
|
-
children: l ? /* @__PURE__ */
|
|
2495
|
+
children: l ? /* @__PURE__ */ M(V, { className: "size-3.5" }) : i + 1
|
|
2496
2496
|
}),
|
|
2497
|
-
/* @__PURE__ */
|
|
2497
|
+
/* @__PURE__ */ N("span", {
|
|
2498
2498
|
className: "min-w-0 flex-1",
|
|
2499
|
-
children: [/* @__PURE__ */
|
|
2499
|
+
children: [/* @__PURE__ */ N("span", {
|
|
2500
2500
|
className: "block font-medium text-[14.5px] text-ink",
|
|
2501
2501
|
children: ["Attendee ", i + 1]
|
|
2502
|
-
}), !o && /* @__PURE__ */
|
|
2502
|
+
}), !o && /* @__PURE__ */ M("span", {
|
|
2503
2503
|
className: X("mt-0.5 block truncate text-[12.5px]", u ? "text-danger" : "text-ink-muted"),
|
|
2504
2504
|
children: u ? "Details missing" : c.name.trim() || (d ? "Your details" : "Add details")
|
|
2505
2505
|
})]
|
|
2506
2506
|
}),
|
|
2507
|
-
/* @__PURE__ */
|
|
2507
|
+
/* @__PURE__ */ M(oe, {
|
|
2508
2508
|
"aria-hidden": !0,
|
|
2509
2509
|
className: "size-4 shrink-0 text-ink-muted transition-transform group-data-[panel-open]:rotate-180"
|
|
2510
2510
|
})
|
|
2511
2511
|
]
|
|
2512
2512
|
})
|
|
2513
|
-
}), /* @__PURE__ */
|
|
2513
|
+
}), /* @__PURE__ */ M(U.Panel, {
|
|
2514
2514
|
className: "h-[var(--accordion-panel-height)] overflow-hidden transition-[height] duration-250 ease-[cubic-bezier(0.32,0.72,0,1)] data-[ending-style]:h-0 data-[starting-style]:h-0 motion-reduce:transition-none",
|
|
2515
|
-
children: /* @__PURE__ */
|
|
2515
|
+
children: /* @__PURE__ */ N("div", {
|
|
2516
2516
|
className: "flex flex-col gap-4 px-3.5 pb-3.5",
|
|
2517
|
-
children: [/* @__PURE__ */
|
|
2517
|
+
children: [/* @__PURE__ */ M(Ir, {
|
|
2518
2518
|
idPrefix: `attendee-${n.key.replace(":", "-")}`,
|
|
2519
2519
|
nameLabel: "Full name",
|
|
2520
2520
|
values: c,
|
|
@@ -2523,7 +2523,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2523
2523
|
onChange: (t, r) => e.setField(n.key, t, r),
|
|
2524
2524
|
onBlur: (t) => e.touchField(n.key, t),
|
|
2525
2525
|
registrationFields: n.rules
|
|
2526
|
-
}), !s && /* @__PURE__ */
|
|
2526
|
+
}), !s && /* @__PURE__ */ M("button", {
|
|
2527
2527
|
type: "button",
|
|
2528
2528
|
onClick: () => a(n.key),
|
|
2529
2529
|
className: "inline-flex min-h-[42px] items-center justify-center rounded-xl border border-border font-medium text-[14px] text-ink transition hover:border-brand active:scale-[0.985]",
|
|
@@ -2535,7 +2535,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2535
2535
|
})]
|
|
2536
2536
|
}, n.ticketId))
|
|
2537
2537
|
});
|
|
2538
|
-
},
|
|
2538
|
+
}, zr = {
|
|
2539
2539
|
USD: "$",
|
|
2540
2540
|
EUR: "€",
|
|
2541
2541
|
GBP: "£",
|
|
@@ -2553,54 +2553,54 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2553
2553
|
maximumFractionDigits: 2
|
|
2554
2554
|
}).format(r);
|
|
2555
2555
|
} catch {
|
|
2556
|
-
return `${
|
|
2556
|
+
return `${zr[n] ?? n} ${r.toLocaleString()}`;
|
|
2557
2557
|
}
|
|
2558
|
-
},
|
|
2558
|
+
}, Br = (e) => !e.tax_enabled || !e.taxes?.length ? null : e.tax_inclusive ? "incl. taxes" : "+ taxes", Vr = (e) => !!e?.taxes?.length && e.tax_amount !== void 0, Hr = (e) => !!e && "subtotal" in e && e.tax_enabled === !0 && !!e.taxes?.length, Ur = (e, t) => t ? t.total_amount ?? t.sale_amount ?? 0 : Hr(e) ? e.total ?? e.unit_amount ?? 0 : e?.unit_amount ?? 0, Wr = (e, t) => {
|
|
2559
2559
|
if (!e) return null;
|
|
2560
|
-
let n =
|
|
2560
|
+
let n = Ur(e, t);
|
|
2561
2561
|
return {
|
|
2562
2562
|
amount: n,
|
|
2563
2563
|
currency: e.currency,
|
|
2564
2564
|
isFree: n === 0
|
|
2565
2565
|
};
|
|
2566
|
-
},
|
|
2566
|
+
}, Gr = (e, t) => t ? t.base_amount ?? 0 : Hr(e) ? e.subtotal ?? e.unit_amount ?? 0 : e?.unit_amount ?? 0, Kr = (e, t) => Vr(t) ? t.taxes : !t && Hr(e) ? e.taxes : [], qr = ({ ticket: e, count: t }) => Ur(e, null) * t, Jr = (e, t) => {
|
|
2567
2567
|
if (e.length === 0) return null;
|
|
2568
|
-
let n = t ?
|
|
2568
|
+
let n = t ? Ur(null, t) : e.reduce((e, t) => e + qr(t), 0);
|
|
2569
2569
|
return {
|
|
2570
2570
|
amount: n,
|
|
2571
2571
|
currency: e[0]?.ticket.currency,
|
|
2572
2572
|
isFree: n === 0
|
|
2573
2573
|
};
|
|
2574
|
-
},
|
|
2575
|
-
let r = n?.currency, i = e.some((e) =>
|
|
2576
|
-
return /* @__PURE__ */
|
|
2574
|
+
}, Yr = ({ lines: e, discount: t, pricing: n }) => {
|
|
2575
|
+
let r = n?.currency, i = e.some((e) => Br(e.ticket));
|
|
2576
|
+
return /* @__PURE__ */ N("div", {
|
|
2577
2577
|
className: "rounded-xl border border-border bg-ink/3 px-3.5 py-3",
|
|
2578
|
-
children: [/* @__PURE__ */
|
|
2578
|
+
children: [/* @__PURE__ */ N("div", {
|
|
2579
2579
|
className: "flex flex-col gap-1.5 text-[13.5px] text-ink-soft",
|
|
2580
2580
|
children: [
|
|
2581
|
-
e.map((e) => /* @__PURE__ */
|
|
2581
|
+
e.map((e) => /* @__PURE__ */ N("div", {
|
|
2582
2582
|
className: "flex items-baseline justify-between gap-3",
|
|
2583
|
-
children: [/* @__PURE__ */
|
|
2583
|
+
children: [/* @__PURE__ */ N("span", {
|
|
2584
2584
|
className: "min-w-0 [overflow-wrap:anywhere]",
|
|
2585
2585
|
children: [
|
|
2586
|
-
/* @__PURE__ */
|
|
2586
|
+
/* @__PURE__ */ N("span", {
|
|
2587
2587
|
className: "text-ink tabular-nums",
|
|
2588
2588
|
children: [e.count, " ×"]
|
|
2589
2589
|
}),
|
|
2590
2590
|
" ",
|
|
2591
2591
|
e.ticket.title
|
|
2592
2592
|
]
|
|
2593
|
-
}), /* @__PURE__ */
|
|
2593
|
+
}), /* @__PURE__ */ M("span", {
|
|
2594
2594
|
className: "shrink-0 tabular-nums",
|
|
2595
2595
|
children: Z({
|
|
2596
|
-
unit_amount:
|
|
2596
|
+
unit_amount: qr(e),
|
|
2597
2597
|
currency: r
|
|
2598
2598
|
})
|
|
2599
2599
|
})]
|
|
2600
2600
|
}, e.ticket._id)),
|
|
2601
|
-
t && t.discount > 0 && /* @__PURE__ */
|
|
2601
|
+
t && t.discount > 0 && /* @__PURE__ */ N("div", {
|
|
2602
2602
|
className: "flex items-center justify-between gap-3 text-emerald-700 dark:text-emerald-400",
|
|
2603
|
-
children: [/* @__PURE__ */
|
|
2603
|
+
children: [/* @__PURE__ */ M("span", { children: "Discount" }), /* @__PURE__ */ N("span", {
|
|
2604
2604
|
className: "tabular-nums",
|
|
2605
2605
|
children: ["-", Z({
|
|
2606
2606
|
unit_amount: t.discount,
|
|
@@ -2608,14 +2608,14 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2608
2608
|
})]
|
|
2609
2609
|
})]
|
|
2610
2610
|
}),
|
|
2611
|
-
i && /* @__PURE__ */
|
|
2611
|
+
i && /* @__PURE__ */ M("p", {
|
|
2612
2612
|
className: "m-0 text-ink-muted text-xs",
|
|
2613
2613
|
children: "Prices include applicable taxes"
|
|
2614
2614
|
})
|
|
2615
2615
|
]
|
|
2616
|
-
}), /* @__PURE__ */
|
|
2616
|
+
}), /* @__PURE__ */ N("div", {
|
|
2617
2617
|
className: "mt-2.5 flex items-center justify-between gap-3 border-border border-t pt-2.5 font-semibold text-[15px] text-ink",
|
|
2618
|
-
children: [/* @__PURE__ */
|
|
2618
|
+
children: [/* @__PURE__ */ M("span", { children: "Total" }), /* @__PURE__ */ M("span", {
|
|
2619
2619
|
className: "tabular-nums",
|
|
2620
2620
|
children: Z({
|
|
2621
2621
|
unit_amount: n?.amount,
|
|
@@ -2624,120 +2624,202 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2624
2624
|
})]
|
|
2625
2625
|
})]
|
|
2626
2626
|
});
|
|
2627
|
-
},
|
|
2627
|
+
}, Xr = ({ payment: e, label: t, isPaid: n, blockedReason: r }) => {
|
|
2628
2628
|
let { state: i } = e, a = i.kind === "busy";
|
|
2629
|
-
return /* @__PURE__ */
|
|
2630
|
-
(i.kind === "unpaid" || i.kind === "failed") && /* @__PURE__ */
|
|
2629
|
+
return /* @__PURE__ */ N(j, { children: [
|
|
2630
|
+
(i.kind === "unpaid" || i.kind === "failed") && /* @__PURE__ */ N("p", {
|
|
2631
2631
|
role: "alert",
|
|
2632
2632
|
className: "m-0 mb-2.5 rounded-xl bg-danger/10 px-3 py-2.5 text-danger text-sm starting:opacity-0 transition-opacity duration-200 motion-reduce:transition-none",
|
|
2633
|
-
children: [i.message, i.kind === "unpaid" && /* @__PURE__ */
|
|
2633
|
+
children: [i.message, i.kind === "unpaid" && /* @__PURE__ */ M("button", {
|
|
2634
2634
|
type: "button",
|
|
2635
2635
|
onClick: e.retry,
|
|
2636
2636
|
className: "ml-1.5 inline-flex items-center gap-1 font-semibold underline underline-offset-[3px]",
|
|
2637
2637
|
children: "Pay again"
|
|
2638
2638
|
})]
|
|
2639
2639
|
}),
|
|
2640
|
-
/* @__PURE__ */
|
|
2640
|
+
/* @__PURE__ */ N("button", {
|
|
2641
2641
|
type: "submit",
|
|
2642
2642
|
disabled: a || !!r,
|
|
2643
2643
|
className: "inline-flex min-h-[50px] w-full items-center justify-center gap-2 rounded-xl bg-brand font-semibold text-[15.5px] text-brand-foreground transition active:scale-[0.985] disabled:opacity-55",
|
|
2644
|
-
children: [a && /* @__PURE__ */
|
|
2644
|
+
children: [a && /* @__PURE__ */ M(ce, { className: "size-4 animate-spin" }), a && i.stage === "paying" ? "Opening secure checkout" : t]
|
|
2645
2645
|
}),
|
|
2646
|
-
/* @__PURE__ */
|
|
2646
|
+
/* @__PURE__ */ M("p", {
|
|
2647
2647
|
className: "m-0 mt-2 text-center text-ink-muted text-xs",
|
|
2648
2648
|
children: r ?? (n ? "Secure payment · confirmation sent to your email" : "No card needed · joining link sent to your email")
|
|
2649
2649
|
})
|
|
2650
2650
|
] });
|
|
2651
|
-
},
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2651
|
+
}, Zr = (e) => {
|
|
2652
|
+
if (e.kind !== "percent") return "Flat discount";
|
|
2653
|
+
let t = e.max_amount_off ? `, up to ${Z({
|
|
2654
|
+
unit_amount: e.max_amount_off,
|
|
2655
|
+
currency: e.currency
|
|
2656
|
+
})}` : "";
|
|
2657
|
+
return `${e.percent_off}% off${t}`;
|
|
2658
|
+
}, Qr = ({ applied: e, pending: t, couponError: n, onValidateCoupon: r, onRemoveCoupon: i, offers: a, currency: o }) => {
|
|
2659
|
+
let [s, c] = A(!1), [l, u] = A(""), [d, f] = A(!1), p = async (e) => {
|
|
2660
|
+
await r(e) && (u(""), c(!1));
|
|
2661
|
+
}, m = () => {
|
|
2662
|
+
l.trim() && p(l);
|
|
2663
|
+
}, h = e ? a.filter((t) => t.coupon.code !== e.code) : a, g = h.length > 0 && /* @__PURE__ */ M("ul", {
|
|
2664
|
+
className: "m-0 flex list-none flex-col gap-2 p-0",
|
|
2665
|
+
children: h.map(({ coupon: n, saving: r }, i) => {
|
|
2666
|
+
let s = t?.code === n.code;
|
|
2667
|
+
return /* @__PURE__ */ N("li", {
|
|
2668
|
+
className: "flex items-center gap-3 rounded-xl border border-border border-dashed px-3.5 py-2.5",
|
|
2669
|
+
children: [/* @__PURE__ */ N("div", {
|
|
2670
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
2671
|
+
children: [
|
|
2672
|
+
/* @__PURE__ */ N("div", {
|
|
2673
|
+
className: "flex items-center gap-2",
|
|
2674
|
+
children: [/* @__PURE__ */ M("span", {
|
|
2675
|
+
className: "truncate font-medium font-mono text-ink text-xs tracking-wide",
|
|
2676
|
+
children: n.code
|
|
2677
|
+
}), !e && i === 0 && a.length > 1 && /* @__PURE__ */ M("span", {
|
|
2678
|
+
className: "shrink-0 rounded-full bg-emerald-500/10 px-1.5 py-px font-medium text-[11px] text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400",
|
|
2679
|
+
children: "Best"
|
|
2680
|
+
})]
|
|
2681
|
+
}),
|
|
2682
|
+
/* @__PURE__ */ N("span", {
|
|
2683
|
+
className: "text-[13px] text-ink",
|
|
2684
|
+
children: [/* @__PURE__ */ N("span", {
|
|
2685
|
+
className: "font-semibold",
|
|
2686
|
+
children: ["Save ", Z({
|
|
2687
|
+
unit_amount: r,
|
|
2688
|
+
currency: o
|
|
2689
|
+
})]
|
|
2690
|
+
}), /* @__PURE__ */ N("span", {
|
|
2691
|
+
className: "text-ink-muted",
|
|
2692
|
+
children: [" · ", Zr(n)]
|
|
2693
|
+
})]
|
|
2694
|
+
}),
|
|
2695
|
+
n.description && /* @__PURE__ */ M("span", {
|
|
2696
|
+
className: "truncate text-ink-muted text-xs",
|
|
2697
|
+
title: n.description,
|
|
2698
|
+
children: n.description
|
|
2699
|
+
})
|
|
2700
|
+
]
|
|
2701
|
+
}), /* @__PURE__ */ N("button", {
|
|
2702
|
+
type: "button",
|
|
2703
|
+
disabled: !!t,
|
|
2704
|
+
onClick: () => void p(n.code),
|
|
2705
|
+
"aria-label": `${e ? "Switch to" : "Apply"} ${n.code}`,
|
|
2706
|
+
className: "inline-flex shrink-0 items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 font-medium text-ink text-sm transition hover:border-brand disabled:opacity-50",
|
|
2707
|
+
children: [s && /* @__PURE__ */ M(ce, { className: "size-3.5 animate-spin" }), e ? "Switch" : "Apply"]
|
|
2708
|
+
})]
|
|
2709
|
+
}, n._id);
|
|
2710
|
+
})
|
|
2711
|
+
}), _ = n && /* @__PURE__ */ M("p", {
|
|
2712
|
+
className: "m-0 text-danger text-xs",
|
|
2713
|
+
children: n
|
|
2714
|
+
}), v = "inline-flex items-center gap-1 self-start text-[13px] text-ink-soft underline underline-offset-[3px] hover:text-ink", y = /* @__PURE__ */ M("button", {
|
|
2715
|
+
type: "button",
|
|
2716
|
+
"aria-expanded": s,
|
|
2717
|
+
onClick: () => c((e) => !e),
|
|
2718
|
+
className: v,
|
|
2719
|
+
children: e || g ? "Have a different code?" : "Have a code?"
|
|
2720
|
+
}), b = /* @__PURE__ */ M(kr, {
|
|
2721
|
+
open: s,
|
|
2722
|
+
children: /* @__PURE__ */ N("div", {
|
|
2723
|
+
className: "flex gap-2 pt-2",
|
|
2724
|
+
children: [/* @__PURE__ */ M("input", {
|
|
2725
|
+
type: "text",
|
|
2726
|
+
value: l,
|
|
2727
|
+
placeholder: "Coupon code",
|
|
2728
|
+
"aria-label": "Coupon code",
|
|
2729
|
+
autoCapitalize: "characters",
|
|
2730
|
+
autoCorrect: "off",
|
|
2731
|
+
spellCheck: !1,
|
|
2732
|
+
onChange: (e) => u(e.target.value),
|
|
2733
|
+
onKeyDown: (e) => {
|
|
2734
|
+
e.key === "Enter" && (e.preventDefault(), m());
|
|
2735
|
+
},
|
|
2736
|
+
className: X("w-full min-w-0 rounded-xl border bg-page px-3.5 py-2.5 text-base text-ink uppercase outline-none transition placeholder:text-ink-muted/60 placeholder:normal-case", n ? "border-danger focus:ring-[3px] focus:ring-danger/15" : "border-border focus:border-brand focus:ring-[3px] focus:ring-brand/20")
|
|
2737
|
+
}), /* @__PURE__ */ N("button", {
|
|
2738
|
+
type: "button",
|
|
2739
|
+
disabled: !l.trim() || !!t,
|
|
2740
|
+
onClick: m,
|
|
2741
|
+
className: "inline-flex shrink-0 items-center gap-1.5 rounded-xl border border-border px-4 font-medium text-ink text-sm transition hover:border-brand disabled:opacity-50",
|
|
2742
|
+
children: [t?.code === l.trim().toUpperCase() && /* @__PURE__ */ M(ce, { className: "size-3.5 animate-spin" }), "Apply"]
|
|
2670
2743
|
})]
|
|
2671
|
-
})
|
|
2672
|
-
type: "button",
|
|
2673
|
-
onClick: () => {
|
|
2674
|
-
a(), u(!1);
|
|
2675
|
-
},
|
|
2676
|
-
"aria-label": "Remove coupon",
|
|
2677
|
-
className: "inline-flex shrink-0 rounded-md p-1 hover:bg-emerald-600/15",
|
|
2678
|
-
children: /* @__PURE__ */ N(ue, { className: "size-4" })
|
|
2679
|
-
})]
|
|
2744
|
+
})
|
|
2680
2745
|
});
|
|
2681
|
-
|
|
2682
|
-
return /* @__PURE__ */ P("div", {
|
|
2746
|
+
return e ? /* @__PURE__ */ N("div", {
|
|
2683
2747
|
className: "flex flex-col",
|
|
2684
|
-
children: [
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
className: "flex gap-2",
|
|
2697
|
-
children: [/* @__PURE__ */ N("input", {
|
|
2698
|
-
type: "text",
|
|
2699
|
-
value: e,
|
|
2700
|
-
placeholder: "Coupon code",
|
|
2701
|
-
"aria-label": "Coupon code",
|
|
2702
|
-
autoCapitalize: "characters",
|
|
2703
|
-
autoCorrect: "off",
|
|
2704
|
-
spellCheck: !1,
|
|
2705
|
-
onChange: (e) => t(e.target.value),
|
|
2706
|
-
onKeyDown: (t) => {
|
|
2707
|
-
t.key === "Enter" && (t.preventDefault(), e.trim() && i());
|
|
2708
|
-
},
|
|
2709
|
-
className: X("w-full min-w-0 rounded-xl border bg-page px-3.5 py-2.5 text-base text-ink uppercase outline-none transition placeholder:text-ink-muted/60 placeholder:normal-case", n ? "border-danger focus:ring-[3px] focus:ring-danger/15" : "border-border focus:border-brand focus:ring-[3px] focus:ring-brand/20")
|
|
2710
|
-
}), /* @__PURE__ */ P("button", {
|
|
2711
|
-
type: "button",
|
|
2712
|
-
disabled: !e.trim() || r,
|
|
2713
|
-
onClick: () => i(),
|
|
2714
|
-
className: "inline-flex shrink-0 items-center gap-1.5 rounded-xl border border-border px-4 font-medium text-ink text-sm transition hover:border-brand disabled:opacity-50",
|
|
2715
|
-
children: [r && /* @__PURE__ */ N(se, { className: "size-3.5 animate-spin" }), "Apply"]
|
|
2716
|
-
})]
|
|
2717
|
-
}),
|
|
2718
|
-
n && /* @__PURE__ */ N("p", {
|
|
2719
|
-
className: "m-0 text-danger text-xs",
|
|
2720
|
-
children: n
|
|
2721
|
-
}),
|
|
2722
|
-
d.length > 0 && /* @__PURE__ */ N("div", {
|
|
2723
|
-
className: "flex flex-wrap gap-1.5",
|
|
2724
|
-
children: d.map((e) => /* @__PURE__ */ P("button", {
|
|
2725
|
-
type: "button",
|
|
2726
|
-
onClick: () => {
|
|
2727
|
-
t(e.code), i(e.code);
|
|
2728
|
-
},
|
|
2729
|
-
title: e.description || void 0,
|
|
2730
|
-
className: "rounded-full border border-border border-dashed px-2.5 py-1 text-[12.5px] text-ink-soft transition hover:border-brand hover:text-ink",
|
|
2748
|
+
children: [
|
|
2749
|
+
/* @__PURE__ */ N("div", {
|
|
2750
|
+
className: "flex starting:scale-95 items-center justify-between gap-2.5 rounded-xl border border-emerald-600/40 bg-emerald-500/10 px-3.5 py-2.5 text-[13px] text-emerald-800 starting:opacity-0 transition-[opacity,scale] duration-200 ease-out dark:bg-emerald-500/15 dark:text-emerald-300",
|
|
2751
|
+
children: [/* @__PURE__ */ N("span", {
|
|
2752
|
+
className: "flex min-w-0 items-center gap-2",
|
|
2753
|
+
children: [/* @__PURE__ */ M(de, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ N("span", {
|
|
2754
|
+
className: "min-w-0",
|
|
2755
|
+
children: [/* @__PURE__ */ M("span", {
|
|
2756
|
+
className: "font-semibold tracking-wide",
|
|
2757
|
+
children: e.code
|
|
2758
|
+
}), /* @__PURE__ */ N("span", {
|
|
2759
|
+
className: "ml-2 text-emerald-700 dark:text-emerald-400",
|
|
2731
2760
|
children: [
|
|
2732
|
-
|
|
2733
|
-
"
|
|
2734
|
-
|
|
2761
|
+
"applied · you save",
|
|
2762
|
+
" ",
|
|
2763
|
+
Z({
|
|
2764
|
+
unit_amount: e.discount.discount,
|
|
2765
|
+
currency: o
|
|
2766
|
+
})
|
|
2735
2767
|
]
|
|
2736
|
-
}
|
|
2737
|
-
})
|
|
2738
|
-
|
|
2768
|
+
})]
|
|
2769
|
+
})]
|
|
2770
|
+
}), /* @__PURE__ */ M("button", {
|
|
2771
|
+
type: "button",
|
|
2772
|
+
onClick: () => {
|
|
2773
|
+
i(), f(!1);
|
|
2774
|
+
},
|
|
2775
|
+
"aria-label": "Remove coupon",
|
|
2776
|
+
className: "inline-flex shrink-0 rounded-md p-1 hover:bg-emerald-600/15",
|
|
2777
|
+
children: /* @__PURE__ */ M(H, { className: "size-4" })
|
|
2778
|
+
})]
|
|
2779
|
+
}),
|
|
2780
|
+
/* @__PURE__ */ N("div", {
|
|
2781
|
+
className: "mt-2 flex flex-wrap gap-x-4 gap-y-1",
|
|
2782
|
+
children: [h.length > 0 && /* @__PURE__ */ N("button", {
|
|
2783
|
+
type: "button",
|
|
2784
|
+
"aria-expanded": d,
|
|
2785
|
+
onClick: () => f((e) => !e),
|
|
2786
|
+
className: v,
|
|
2787
|
+
children: [h.length === 1 ? "1 more offer" : `${h.length} more offers`, /* @__PURE__ */ M(oe, { className: X("size-3.5 transition-transform", d && "rotate-180") })]
|
|
2788
|
+
}), y]
|
|
2789
|
+
}),
|
|
2790
|
+
/* @__PURE__ */ M(kr, {
|
|
2791
|
+
open: d,
|
|
2792
|
+
children: /* @__PURE__ */ M("div", {
|
|
2793
|
+
className: "pt-2",
|
|
2794
|
+
children: g
|
|
2795
|
+
})
|
|
2796
|
+
}),
|
|
2797
|
+
b,
|
|
2798
|
+
_ && /* @__PURE__ */ M("div", {
|
|
2799
|
+
className: "pt-2",
|
|
2800
|
+
children: _
|
|
2739
2801
|
})
|
|
2740
|
-
|
|
2802
|
+
]
|
|
2803
|
+
}) : t?.auto ? /* @__PURE__ */ N("p", {
|
|
2804
|
+
className: "m-0 inline-flex items-center gap-2 rounded-xl border border-border border-dashed px-3.5 py-2.5 text-[13px] text-ink-muted",
|
|
2805
|
+
children: [/* @__PURE__ */ M(ce, { className: "size-3.5 animate-spin" }), "Finding your best offer…"]
|
|
2806
|
+
}) : /* @__PURE__ */ N("div", {
|
|
2807
|
+
className: "flex flex-col",
|
|
2808
|
+
children: [
|
|
2809
|
+
g && /* @__PURE__ */ N("div", {
|
|
2810
|
+
className: "mb-2 flex flex-col gap-2",
|
|
2811
|
+
children: [/* @__PURE__ */ M("span", {
|
|
2812
|
+
className: "font-medium text-ink text-sm",
|
|
2813
|
+
children: h.length === 1 ? "Offer for you" : "Offers for you"
|
|
2814
|
+
}), g]
|
|
2815
|
+
}),
|
|
2816
|
+
y,
|
|
2817
|
+
b,
|
|
2818
|
+
_ && /* @__PURE__ */ M("div", {
|
|
2819
|
+
className: "pt-2",
|
|
2820
|
+
children: _
|
|
2821
|
+
})
|
|
2822
|
+
]
|
|
2741
2823
|
});
|
|
2742
2824
|
}, $r = (e) => {
|
|
2743
2825
|
if (e < 60) return `${e} min`;
|
|
@@ -2825,21 +2907,21 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2825
2907
|
};
|
|
2826
2908
|
}, [e]), t;
|
|
2827
2909
|
}, oi = ({ open: e, title: t, when: n, onClose: r, onClosed: i, onSubmit: a, footer: o, wide: s, initialFocusRef: c, layers: l, children: u }) => {
|
|
2828
|
-
let d = k(null), f = ai(e), [p, m] = A(!1), h = /* @__PURE__ */
|
|
2910
|
+
let d = k(null), f = ai(e), [p, m] = A(!1), h = /* @__PURE__ */ M("div", {
|
|
2829
2911
|
onScroll: (e) => m(e.currentTarget.scrollTop > 2),
|
|
2830
2912
|
className: "min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain",
|
|
2831
|
-
children: /* @__PURE__ */
|
|
2913
|
+
children: /* @__PURE__ */ N("div", {
|
|
2832
2914
|
className: "flex min-h-full flex-col",
|
|
2833
|
-
children: [/* @__PURE__ */
|
|
2915
|
+
children: [/* @__PURE__ */ M("div", {
|
|
2834
2916
|
className: "flex flex-1 flex-col px-5 pt-3 pb-3",
|
|
2835
2917
|
children: u
|
|
2836
|
-
}), o && /* @__PURE__ */
|
|
2918
|
+
}), o && /* @__PURE__ */ M("div", {
|
|
2837
2919
|
className: "border-border border-t bg-page px-5 pt-3 pb-[max(env(safe-area-inset-bottom),16px)] sm:sticky sm:bottom-0 sm:z-10",
|
|
2838
2920
|
children: o
|
|
2839
2921
|
})]
|
|
2840
2922
|
})
|
|
2841
2923
|
});
|
|
2842
|
-
return /* @__PURE__ */
|
|
2924
|
+
return /* @__PURE__ */ M(P.Root, {
|
|
2843
2925
|
open: e,
|
|
2844
2926
|
onOpenChange: (e) => {
|
|
2845
2927
|
e || r();
|
|
@@ -2847,7 +2929,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2847
2929
|
onOpenChangeComplete: (e) => {
|
|
2848
2930
|
e || (m(!1), i());
|
|
2849
2931
|
},
|
|
2850
|
-
children: /* @__PURE__ */ P
|
|
2932
|
+
children: /* @__PURE__ */ N(P.Portal, { children: [/* @__PURE__ */ M(P.Backdrop, { className: "fixed inset-0 z-[2147483000] bg-black/40 transition-opacity duration-200 ease-out data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 data-[ending-style]:duration-150 motion-reduce:transition-none sm:backdrop-blur-[3px]" }), /* @__PURE__ */ N(P.Popup, {
|
|
2851
2933
|
ref: d,
|
|
2852
2934
|
initialFocus: (e) => {
|
|
2853
2935
|
let t = c?.current;
|
|
@@ -2859,19 +2941,19 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2859
2941
|
},
|
|
2860
2942
|
className: X("fixed inset-x-0 top-[var(--viewport-top)] z-[2147483000] flex h-[var(--viewport-height)] flex-col overflow-hidden bg-page font-body text-ink antialiased outline-none", "sm:inset-x-auto sm:top-[6vh] sm:left-1/2 sm:h-auto sm:max-h-[min(88dvh,var(--viewport-height))] sm:w-[calc(100%-2rem)] sm:-translate-x-1/2 sm:rounded-2xl sm:border sm:border-border sm:shadow-2xl", s ? "sm:max-w-[540px]" : "sm:max-w-[460px]", "transition-[opacity,translate] duration-200 ease-out data-[ending-style]:duration-150 motion-reduce:transition-none", "data-[ending-style]:translate-y-4 data-[starting-style]:translate-y-4 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0", "sm:data-[ending-style]:translate-y-2 sm:data-[starting-style]:translate-y-2"),
|
|
2861
2943
|
children: [
|
|
2862
|
-
/* @__PURE__ */
|
|
2944
|
+
/* @__PURE__ */ N("div", {
|
|
2863
2945
|
className: X("sticky top-0 z-10 shrink-0 border-b bg-page px-5 pt-[max(env(safe-area-inset-top),16px)] pb-2 transition-colors", p ? "border-border" : "border-transparent"),
|
|
2864
|
-
children: [/* @__PURE__ */
|
|
2946
|
+
children: [/* @__PURE__ */ N("div", {
|
|
2865
2947
|
className: "flex items-center justify-between gap-3",
|
|
2866
|
-
children: [/* @__PURE__ */
|
|
2948
|
+
children: [/* @__PURE__ */ M(P.Title, {
|
|
2867
2949
|
className: "m-0 line-clamp-2 font-heading font-semibold text-[19px] text-ink leading-snug tracking-[-0.011em] [overflow-wrap:anywhere]",
|
|
2868
2950
|
children: t
|
|
2869
|
-
}), /* @__PURE__ */
|
|
2951
|
+
}), /* @__PURE__ */ M(P.Close, {
|
|
2870
2952
|
"aria-label": "Close",
|
|
2871
2953
|
className: "-mr-1.5 inline-flex size-8 shrink-0 items-center justify-center rounded-full text-ink-soft transition hover:bg-ink/5 hover:text-ink",
|
|
2872
|
-
children: /* @__PURE__ */
|
|
2954
|
+
children: /* @__PURE__ */ M(H, { className: "size-4" })
|
|
2873
2955
|
})]
|
|
2874
|
-
}), n && /* @__PURE__ */
|
|
2956
|
+
}), n && /* @__PURE__ */ N("p", {
|
|
2875
2957
|
className: "m-0 mt-3.5 text-[13.5px] text-ink-soft",
|
|
2876
2958
|
children: [
|
|
2877
2959
|
n.day,
|
|
@@ -2881,7 +2963,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2881
2963
|
]
|
|
2882
2964
|
})]
|
|
2883
2965
|
}),
|
|
2884
|
-
a ? /* @__PURE__ */
|
|
2966
|
+
a ? /* @__PURE__ */ M("form", {
|
|
2885
2967
|
onSubmit: a,
|
|
2886
2968
|
className: "flex min-h-0 flex-1 flex-col",
|
|
2887
2969
|
children: h
|
|
@@ -2890,31 +2972,31 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2890
2972
|
]
|
|
2891
2973
|
})] })
|
|
2892
2974
|
});
|
|
2893
|
-
}, si = "inline-flex items-center justify-center rounded-lg bg-brand px-4 py-3 font-semibold text-brand-foreground transition hover:opacity-90", ci = ({ buttonText: e, registeredEmail: t, isSheetOpen: n, isLoading: r, onOpen: i, onRegisterAnother: a }) => /* @__PURE__ */
|
|
2975
|
+
}, si = "inline-flex items-center justify-center rounded-lg bg-brand px-4 py-3 font-semibold text-brand-foreground transition hover:opacity-90", ci = ({ buttonText: e, registeredEmail: t, isSheetOpen: n, isLoading: r, onOpen: i, onRegisterAnother: a }) => /* @__PURE__ */ M("div", {
|
|
2894
2976
|
className: "my-2",
|
|
2895
|
-
children: t && !n ? /* @__PURE__ */
|
|
2977
|
+
children: t && !n ? /* @__PURE__ */ N("span", {
|
|
2896
2978
|
className: "inline-flex flex-wrap items-center gap-2 rounded-xl border border-border bg-ink/3 px-3.5 py-2.5 text-ink text-sm",
|
|
2897
2979
|
children: [
|
|
2898
|
-
/* @__PURE__ */
|
|
2980
|
+
/* @__PURE__ */ M(V, { className: "size-4 text-emerald-600 dark:text-emerald-400" }),
|
|
2899
2981
|
"You're registered as ",
|
|
2900
2982
|
t,
|
|
2901
|
-
/* @__PURE__ */
|
|
2983
|
+
/* @__PURE__ */ M("button", {
|
|
2902
2984
|
type: "button",
|
|
2903
2985
|
onClick: a,
|
|
2904
2986
|
className: "text-ink-soft underline underline-offset-[3px] hover:text-ink",
|
|
2905
2987
|
children: "Register someone else"
|
|
2906
2988
|
})
|
|
2907
2989
|
]
|
|
2908
|
-
}) : /* @__PURE__ */
|
|
2990
|
+
}) : /* @__PURE__ */ M("button", {
|
|
2909
2991
|
type: "button",
|
|
2910
2992
|
onClick: i,
|
|
2911
2993
|
disabled: r,
|
|
2912
2994
|
className: X(si, "disabled:opacity-60"),
|
|
2913
2995
|
children: e
|
|
2914
2996
|
})
|
|
2915
|
-
}), li = ({ hasFailed: e }) => /* @__PURE__ */
|
|
2997
|
+
}), li = ({ hasFailed: e }) => /* @__PURE__ */ M("div", {
|
|
2916
2998
|
className: "my-2",
|
|
2917
|
-
children: /* @__PURE__ */
|
|
2999
|
+
children: /* @__PURE__ */ M("p", {
|
|
2918
3000
|
className: "m-0 text-ink-soft text-sm",
|
|
2919
3001
|
children: e ? "We couldn't load tickets for this event. Please refresh the page." : "Registration isn't open for this event yet."
|
|
2920
3002
|
})
|
|
@@ -2927,12 +3009,12 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2927
3009
|
});
|
|
2928
3010
|
return E(() => {
|
|
2929
3011
|
navigator.vibrate?.(12);
|
|
2930
|
-
}, []), /* @__PURE__ */
|
|
3012
|
+
}, []), /* @__PURE__ */ N("div", {
|
|
2931
3013
|
className: "flex flex-1 flex-col items-center justify-center px-6 py-9 text-center",
|
|
2932
3014
|
children: [
|
|
2933
|
-
/* @__PURE__ */
|
|
3015
|
+
/* @__PURE__ */ M("div", {
|
|
2934
3016
|
className: "flex size-[68px] starting:scale-50 items-center justify-center rounded-full bg-emerald-500/10 text-emerald-700 starting:opacity-0 transition-[opacity,scale] duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:transition-none dark:bg-emerald-500/15 dark:text-emerald-400",
|
|
2935
|
-
children: /* @__PURE__ */
|
|
3017
|
+
children: /* @__PURE__ */ N("svg", {
|
|
2936
3018
|
width: "30",
|
|
2937
3019
|
height: "30",
|
|
2938
3020
|
viewBox: "0 0 24 24",
|
|
@@ -2942,17 +3024,17 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2942
3024
|
strokeLinecap: "round",
|
|
2943
3025
|
strokeLinejoin: "round",
|
|
2944
3026
|
"aria-hidden": "true",
|
|
2945
|
-
children: [/* @__PURE__ */
|
|
3027
|
+
children: [/* @__PURE__ */ M("title", { children: "Registered" }), /* @__PURE__ */ M("path", {
|
|
2946
3028
|
d: "M4 12.5 L9.5 18 L20 7",
|
|
2947
3029
|
className: "transition-[stroke-dashoffset] delay-200 duration-[420ms] ease-[cubic-bezier(0.32,0.72,0,1)] [stroke-dasharray:30] starting:[stroke-dashoffset:30] motion-reduce:transition-none"
|
|
2948
3030
|
})]
|
|
2949
3031
|
})
|
|
2950
3032
|
}),
|
|
2951
|
-
/* @__PURE__ */
|
|
3033
|
+
/* @__PURE__ */ M("h3", {
|
|
2952
3034
|
className: X(di, "m-0 mt-[18px] font-heading font-semibold text-[22px] text-ink tracking-[-0.016em] delay-[260ms]"),
|
|
2953
3035
|
children: "You're in"
|
|
2954
3036
|
}),
|
|
2955
|
-
a && /* @__PURE__ */
|
|
3037
|
+
a && /* @__PURE__ */ N("p", {
|
|
2956
3038
|
className: X(di, "m-0 mt-1.5 text-[14.5px] text-ink delay-[320ms]"),
|
|
2957
3039
|
children: [
|
|
2958
3040
|
a.day,
|
|
@@ -2960,74 +3042,74 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
2960
3042
|
a.time
|
|
2961
3043
|
]
|
|
2962
3044
|
}),
|
|
2963
|
-
/* @__PURE__ */
|
|
3045
|
+
/* @__PURE__ */ N("p", {
|
|
2964
3046
|
className: X(di, "m-0 mt-1 max-w-[300px] text-[13.5px] text-ink-soft leading-relaxed delay-[360ms]"),
|
|
2965
|
-
children: [l > 1 ? `${l} spots booked · confirmation sent to ` : "Joining link sent to ", /* @__PURE__ */
|
|
3047
|
+
children: [l > 1 ? `${l} spots booked · confirmation sent to ` : "Joining link sent to ", /* @__PURE__ */ M("span", {
|
|
2966
3048
|
className: "text-ink [overflow-wrap:anywhere]",
|
|
2967
3049
|
children: e
|
|
2968
3050
|
})]
|
|
2969
3051
|
}),
|
|
2970
|
-
/* @__PURE__ */
|
|
3052
|
+
/* @__PURE__ */ N("div", {
|
|
2971
3053
|
className: X(di, "relative mt-5 w-full max-w-[340px] overflow-hidden rounded-2xl border border-border bg-ink/3 px-4 py-3.5 delay-[420ms]"),
|
|
2972
3054
|
children: [
|
|
2973
|
-
/* @__PURE__ */
|
|
3055
|
+
/* @__PURE__ */ M("span", {
|
|
2974
3056
|
"aria-hidden": !0,
|
|
2975
3057
|
className: "pointer-events-none absolute inset-0 starting:-translate-x-[140%] translate-x-[240%] bg-linear-to-r from-transparent via-white/45 to-transparent transition-transform delay-700 duration-900 ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:hidden dark:via-white/10"
|
|
2976
3058
|
}),
|
|
2977
|
-
s && /* @__PURE__ */
|
|
3059
|
+
s && /* @__PURE__ */ M("img", {
|
|
2978
3060
|
src: s,
|
|
2979
3061
|
alt: "Booking QR code",
|
|
2980
3062
|
className: "mx-auto mb-3 block size-24 rounded-lg bg-white p-1.5"
|
|
2981
3063
|
}),
|
|
2982
|
-
/* @__PURE__ */
|
|
3064
|
+
/* @__PURE__ */ N("div", {
|
|
2983
3065
|
className: "flex items-center justify-between gap-3 text-[13.5px]",
|
|
2984
|
-
children: [/* @__PURE__ */
|
|
3066
|
+
children: [/* @__PURE__ */ M("span", {
|
|
2985
3067
|
className: "text-ink-soft",
|
|
2986
3068
|
children: "Event"
|
|
2987
|
-
}), /* @__PURE__ */
|
|
3069
|
+
}), /* @__PURE__ */ M("span", {
|
|
2988
3070
|
className: "min-w-0 truncate font-medium text-ink",
|
|
2989
3071
|
children: t
|
|
2990
3072
|
})]
|
|
2991
3073
|
}),
|
|
2992
|
-
o && /* @__PURE__ */
|
|
3074
|
+
o && /* @__PURE__ */ N("div", {
|
|
2993
3075
|
className: "mt-2 flex items-center justify-between gap-3 border-border border-t border-dashed pt-2 text-[13.5px]",
|
|
2994
|
-
children: [/* @__PURE__ */
|
|
3076
|
+
children: [/* @__PURE__ */ M("span", {
|
|
2995
3077
|
className: "text-ink-soft",
|
|
2996
3078
|
children: "Booking ref"
|
|
2997
|
-
}), /* @__PURE__ */
|
|
3079
|
+
}), /* @__PURE__ */ M("span", {
|
|
2998
3080
|
className: "min-w-0 truncate font-medium font-mono text-ink text-xs",
|
|
2999
3081
|
children: o
|
|
3000
3082
|
})]
|
|
3001
3083
|
})
|
|
3002
3084
|
]
|
|
3003
3085
|
}),
|
|
3004
|
-
/* @__PURE__ */
|
|
3086
|
+
/* @__PURE__ */ N("div", {
|
|
3005
3087
|
className: X(di, "mt-4 flex w-full max-w-[340px] flex-col gap-2 delay-[520ms]"),
|
|
3006
3088
|
children: [
|
|
3007
|
-
f && /* @__PURE__ */
|
|
3089
|
+
f && /* @__PURE__ */ N(W.Root, { children: [/* @__PURE__ */ N(W.Trigger, {
|
|
3008
3090
|
className: fi,
|
|
3009
|
-
children: [/* @__PURE__ */
|
|
3010
|
-
}), /* @__PURE__ */
|
|
3091
|
+
children: [/* @__PURE__ */ M(ae, { className: "size-4" }), "Add to calendar"]
|
|
3092
|
+
}), /* @__PURE__ */ M(W.Portal, { children: /* @__PURE__ */ M(W.Positioner, {
|
|
3011
3093
|
sideOffset: 6,
|
|
3012
3094
|
className: "z-[2147483001]",
|
|
3013
|
-
children: /* @__PURE__ */
|
|
3095
|
+
children: /* @__PURE__ */ N(W.Popup, {
|
|
3014
3096
|
className: "flex w-[220px] origin-[var(--transform-origin)] flex-col gap-0.5 rounded-2xl border border-border bg-page p-1.5 font-body text-ink shadow-xl outline-none transition-[opacity,scale] duration-150 ease-out data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 motion-reduce:transition-none",
|
|
3015
3097
|
children: [
|
|
3016
|
-
/* @__PURE__ */
|
|
3098
|
+
/* @__PURE__ */ M("a", {
|
|
3017
3099
|
href: f.google,
|
|
3018
3100
|
target: "_blank",
|
|
3019
3101
|
rel: "noopener noreferrer",
|
|
3020
3102
|
className: ui,
|
|
3021
3103
|
children: "Google Calendar"
|
|
3022
3104
|
}),
|
|
3023
|
-
/* @__PURE__ */
|
|
3105
|
+
/* @__PURE__ */ M("a", {
|
|
3024
3106
|
href: f.outlook,
|
|
3025
3107
|
target: "_blank",
|
|
3026
3108
|
rel: "noopener noreferrer",
|
|
3027
3109
|
className: ui,
|
|
3028
3110
|
children: "Outlook"
|
|
3029
3111
|
}),
|
|
3030
|
-
/* @__PURE__ */
|
|
3112
|
+
/* @__PURE__ */ M("button", {
|
|
3031
3113
|
type: "button",
|
|
3032
3114
|
onClick: () => {
|
|
3033
3115
|
if (!f) return;
|
|
@@ -3040,14 +3122,14 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3040
3122
|
]
|
|
3041
3123
|
})
|
|
3042
3124
|
}) })] }),
|
|
3043
|
-
c && /* @__PURE__ */
|
|
3125
|
+
c && /* @__PURE__ */ N("a", {
|
|
3044
3126
|
href: c,
|
|
3045
3127
|
target: "_blank",
|
|
3046
3128
|
rel: "noopener noreferrer",
|
|
3047
3129
|
className: fi,
|
|
3048
|
-
children: [/* @__PURE__ */
|
|
3130
|
+
children: [/* @__PURE__ */ M(se, { className: "size-4" }), "Download invoice"]
|
|
3049
3131
|
}),
|
|
3050
|
-
/* @__PURE__ */
|
|
3132
|
+
/* @__PURE__ */ M("button", {
|
|
3051
3133
|
type: "button",
|
|
3052
3134
|
onClick: u,
|
|
3053
3135
|
className: "inline-flex min-h-[46px] w-full items-center justify-center rounded-xl bg-brand font-semibold text-[15px] text-brand-foreground transition active:scale-[0.985]",
|
|
@@ -3055,7 +3137,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3055
3137
|
})
|
|
3056
3138
|
]
|
|
3057
3139
|
}),
|
|
3058
|
-
/* @__PURE__ */
|
|
3140
|
+
/* @__PURE__ */ M("button", {
|
|
3059
3141
|
type: "button",
|
|
3060
3142
|
onClick: d,
|
|
3061
3143
|
className: "mt-4 text-[13px] text-ink-muted underline underline-offset-[3px] starting:opacity-0 transition-opacity delay-[600ms] duration-300 hover:text-ink motion-reduce:transition-none",
|
|
@@ -3081,71 +3163,71 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3081
3163
|
e.name.trim() || (n.name = "Please enter your name"), t.email !== "off" && (e.email.trim() ? /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(e.email.trim()) || (n.email = "That email address doesn't look right") : t.email === "required" && (n.email = "Please enter your email")), t.mobile !== "off" && (e.mobile.trim() ? gi(e.mobile) || (n.mobile = "That doesn't look like a valid phone number") : t.mobile === "required" && (n.mobile = "Please enter your phone number"));
|
|
3082
3164
|
for (let r of ["organization", "designation"]) t[r] === "required" && !e[r].trim() && (n[r] = `Please enter your ${r}`);
|
|
3083
3165
|
return n;
|
|
3084
|
-
}, yi = (e) => e.quantity === null || e.quantity === void 0 ? 10 : Math.max(0, Math.min(10, e.quantity - (e.sale_count ?? 0))), bi = "inline-flex size-8 items-center justify-center rounded-full border border-border text-ink transition hover:border-brand hover:text-brand active:scale-95 disabled:pointer-events-none disabled:opacity-35", xi = ({ tickets: e, counts: t, onChange: n, error: r }) => /* @__PURE__ */
|
|
3166
|
+
}, yi = (e) => e.quantity === null || e.quantity === void 0 ? 10 : Math.max(0, Math.min(10, e.quantity - (e.sale_count ?? 0))), bi = "inline-flex size-8 items-center justify-center rounded-full border border-border text-ink transition hover:border-brand hover:text-brand active:scale-95 disabled:pointer-events-none disabled:opacity-35", xi = ({ tickets: e, counts: t, onChange: n, error: r }) => /* @__PURE__ */ N("fieldset", {
|
|
3085
3167
|
className: "m-0 flex min-w-0 flex-col gap-2 border-0 p-0",
|
|
3086
3168
|
children: [
|
|
3087
|
-
/* @__PURE__ */
|
|
3169
|
+
/* @__PURE__ */ M("legend", {
|
|
3088
3170
|
className: "mb-2 p-0 font-medium text-ink text-sm",
|
|
3089
3171
|
children: "Choose your tickets"
|
|
3090
3172
|
}),
|
|
3091
3173
|
e.map((e) => {
|
|
3092
|
-
let r = t[e._id] ?? 0, i = yi(e), a = i === 0, o =
|
|
3093
|
-
return /* @__PURE__ */
|
|
3174
|
+
let r = t[e._id] ?? 0, i = yi(e), a = i === 0, o = Br(e);
|
|
3175
|
+
return /* @__PURE__ */ N("div", {
|
|
3094
3176
|
className: X("flex w-full items-start gap-3 rounded-xl border px-3.5 py-3 transition", r > 0 ? "border-brand bg-brand/5" : "border-border", a && "opacity-60"),
|
|
3095
|
-
children: [/* @__PURE__ */
|
|
3177
|
+
children: [/* @__PURE__ */ N("div", {
|
|
3096
3178
|
className: "min-w-0 flex-1 [overflow-wrap:anywhere]",
|
|
3097
3179
|
children: [
|
|
3098
|
-
/* @__PURE__ */
|
|
3180
|
+
/* @__PURE__ */ M("span", {
|
|
3099
3181
|
className: "block font-medium text-[14.5px] text-ink leading-snug",
|
|
3100
3182
|
children: e.title
|
|
3101
3183
|
}),
|
|
3102
|
-
/* @__PURE__ */
|
|
3184
|
+
/* @__PURE__ */ N("span", {
|
|
3103
3185
|
className: "mt-0.5 block font-medium text-[13.5px] text-ink",
|
|
3104
|
-
children: [Z(e), o && /* @__PURE__ */
|
|
3186
|
+
children: [Z(e), o && /* @__PURE__ */ M("span", {
|
|
3105
3187
|
className: "ml-1 font-normal text-[11.5px] text-ink-muted",
|
|
3106
3188
|
children: o
|
|
3107
3189
|
})]
|
|
3108
3190
|
}),
|
|
3109
|
-
e.description && /* @__PURE__ */
|
|
3191
|
+
e.description && /* @__PURE__ */ M("span", {
|
|
3110
3192
|
title: e.description,
|
|
3111
3193
|
className: "mt-1 line-clamp-2 block text-[12.5px] text-ink-soft leading-snug",
|
|
3112
3194
|
children: e.description
|
|
3113
3195
|
})
|
|
3114
3196
|
]
|
|
3115
|
-
}), a ? /* @__PURE__ */
|
|
3197
|
+
}), a ? /* @__PURE__ */ M("span", {
|
|
3116
3198
|
className: "shrink-0 rounded-full bg-ink/5 px-2.5 py-1 font-medium text-[12px] text-ink-soft",
|
|
3117
3199
|
children: "Sold out"
|
|
3118
|
-
}) : /* @__PURE__ */
|
|
3200
|
+
}) : /* @__PURE__ */ N("div", {
|
|
3119
3201
|
className: "flex shrink-0 flex-col items-end gap-1",
|
|
3120
|
-
children: [/* @__PURE__ */
|
|
3202
|
+
children: [/* @__PURE__ */ N("div", {
|
|
3121
3203
|
className: "flex items-center gap-2",
|
|
3122
3204
|
children: [
|
|
3123
|
-
/* @__PURE__ */
|
|
3205
|
+
/* @__PURE__ */ M("button", {
|
|
3124
3206
|
type: "button",
|
|
3125
3207
|
"aria-label": `Remove one ${e.title} ticket`,
|
|
3126
3208
|
disabled: r === 0,
|
|
3127
3209
|
onClick: () => n(e._id, r - 1),
|
|
3128
3210
|
className: bi,
|
|
3129
|
-
children: /* @__PURE__ */
|
|
3211
|
+
children: /* @__PURE__ */ M(le, { className: "size-3.5" })
|
|
3130
3212
|
}),
|
|
3131
|
-
/* @__PURE__ */
|
|
3213
|
+
/* @__PURE__ */ N("span", {
|
|
3132
3214
|
"aria-live": "polite",
|
|
3133
3215
|
className: "w-5 text-center font-semibold text-[15px] text-ink tabular-nums",
|
|
3134
|
-
children: [r, /* @__PURE__ */
|
|
3216
|
+
children: [r, /* @__PURE__ */ N("span", {
|
|
3135
3217
|
className: "sr-only",
|
|
3136
3218
|
children: [" ", e.title]
|
|
3137
3219
|
})]
|
|
3138
3220
|
}),
|
|
3139
|
-
/* @__PURE__ */
|
|
3221
|
+
/* @__PURE__ */ M("button", {
|
|
3140
3222
|
type: "button",
|
|
3141
3223
|
"aria-label": `Add one ${e.title} ticket`,
|
|
3142
3224
|
disabled: r >= i,
|
|
3143
3225
|
onClick: () => n(e._id, r + 1),
|
|
3144
3226
|
className: bi,
|
|
3145
|
-
children: /* @__PURE__ */
|
|
3227
|
+
children: /* @__PURE__ */ M(ue, { className: "size-3.5" })
|
|
3146
3228
|
})
|
|
3147
3229
|
]
|
|
3148
|
-
}), r > 0 && r >= i && /* @__PURE__ */
|
|
3230
|
+
}), r > 0 && r >= i && /* @__PURE__ */ N("span", {
|
|
3149
3231
|
className: "text-[11.5px] text-ink-muted",
|
|
3150
3232
|
children: [
|
|
3151
3233
|
"Max ",
|
|
@@ -3156,7 +3238,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3156
3238
|
})]
|
|
3157
3239
|
}, e._id);
|
|
3158
3240
|
}),
|
|
3159
|
-
r && /* @__PURE__ */
|
|
3241
|
+
r && /* @__PURE__ */ M("p", {
|
|
3160
3242
|
className: "m-0 text-danger text-xs",
|
|
3161
3243
|
children: r
|
|
3162
3244
|
})
|
|
@@ -3288,11 +3370,18 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3288
3370
|
reset: x,
|
|
3289
3371
|
resetValidationDisplay: S
|
|
3290
3372
|
};
|
|
3291
|
-
}, Ti = (
|
|
3292
|
-
|
|
3293
|
-
|
|
3373
|
+
}, Ti = (e) => typeof e == "string" ? e : e._id, Ei = (e) => e.reduce((e, t) => e + (t.unit_amount ?? 0), 0), Di = (e, t, n = Date.now()) => e.flatMap((e) => {
|
|
3374
|
+
if (e.status === "archived" || e.starts_at && new Date(e.starts_at).getTime() > n || e.expires_at && new Date(e.expires_at).getTime() < n || e.max_redemptions && e.redeem_count >= e.max_redemptions || e.min_trnx_amount && Ei(t) < e.min_trnx_amount) return [];
|
|
3375
|
+
let r = e.tickets.map(Ti), i = Ei(t.filter((e) => r.includes(e._id))), a = e.kind === "percent" ? Math.round(i * (e.percent_off ?? 0) / 100) : Math.min(e.amount_off ?? 0, i), o = e.max_amount_off ? Math.min(a, e.max_amount_off) : a;
|
|
3376
|
+
return o > 0 ? [{
|
|
3377
|
+
coupon: e,
|
|
3378
|
+
saving: o
|
|
3379
|
+
}] : [];
|
|
3380
|
+
}).sort((e, t) => t.saving - e.saving), Oi = ({ eventID: e, tickets: t, enabled: n }) => {
|
|
3381
|
+
let r = i(), a = t.map((e) => e._id).join(","), [o, s] = A(null), [c, l] = A(null), [u, d] = A(null), [f, p] = A([]), m = k(0), h = k(null), g = Di(f, t), _ = g[0]?.coupon.code;
|
|
3382
|
+
E(() => {
|
|
3294
3383
|
!n || !e || !r || r.fetch?.url(`/v1/event/event/${e}/coupon/list-public-coupons`)?.get().json().then((e) => {
|
|
3295
|
-
e?.status && e?.content?.data &&
|
|
3384
|
+
e?.status && e?.content?.data && p(e.content.data);
|
|
3296
3385
|
}).catch((e) => {
|
|
3297
3386
|
r.logger?.error("Failed to fetch public coupons", { exception: b(e) });
|
|
3298
3387
|
});
|
|
@@ -3300,52 +3389,69 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3300
3389
|
n,
|
|
3301
3390
|
e,
|
|
3302
3391
|
r
|
|
3303
|
-
])
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
}
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
}
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3392
|
+
]);
|
|
3393
|
+
let v = w(async (t, { auto: n = !1 } = {}) => {
|
|
3394
|
+
let i = t.trim().toUpperCase();
|
|
3395
|
+
if (!i || !r) return !1;
|
|
3396
|
+
n || (h.current = a);
|
|
3397
|
+
let o = ++m.current, c = () => o === m.current;
|
|
3398
|
+
l({
|
|
3399
|
+
code: i,
|
|
3400
|
+
auto: n
|
|
3401
|
+
}), d(null);
|
|
3402
|
+
try {
|
|
3403
|
+
let t = await r.fetch?.url(`/v1/event/event/${e}/coupon/validate-coupon-code`)?.post({
|
|
3404
|
+
coupon: i,
|
|
3405
|
+
event: e,
|
|
3406
|
+
attendees: a.split(",").filter(Boolean).map((e) => ({
|
|
3407
|
+
name: "",
|
|
3408
|
+
email: "",
|
|
3409
|
+
ticket: e
|
|
3410
|
+
}))
|
|
3411
|
+
}).json();
|
|
3412
|
+
return !c() || !t?.status ? !1 : (s({
|
|
3413
|
+
code: i,
|
|
3414
|
+
discount: t.content.data
|
|
3415
|
+
}), !0);
|
|
3416
|
+
} catch (e) {
|
|
3417
|
+
let t = b(e);
|
|
3418
|
+
return c() && !n && d(t.message), r.logger?.error("Coupon validation failed", { exception: t }), !1;
|
|
3419
|
+
} finally {
|
|
3420
|
+
c() && l(null);
|
|
3421
|
+
}
|
|
3422
|
+
}, [
|
|
3423
|
+
r,
|
|
3424
|
+
e,
|
|
3425
|
+
a
|
|
3426
|
+
]);
|
|
3427
|
+
E(() => {
|
|
3428
|
+
!n || !_ || o || h.current === a || (h.current = a, v(_, { auto: !0 }));
|
|
3429
|
+
}, [
|
|
3430
|
+
n,
|
|
3431
|
+
_,
|
|
3432
|
+
o,
|
|
3433
|
+
a,
|
|
3434
|
+
v
|
|
3435
|
+
]);
|
|
3436
|
+
let y = w(() => {
|
|
3437
|
+
m.current += 1, l(null), s(null), d(null);
|
|
3438
|
+
}, []);
|
|
3439
|
+
return {
|
|
3440
|
+
applied: o,
|
|
3441
|
+
discount: o?.discount ?? null,
|
|
3442
|
+
pending: c,
|
|
3443
|
+
error: u,
|
|
3444
|
+
offers: g,
|
|
3445
|
+
apply: v,
|
|
3446
|
+
reset: y
|
|
3341
3447
|
};
|
|
3342
|
-
},
|
|
3448
|
+
}, ki = async (e, t) => {
|
|
3343
3449
|
let n = new URLSearchParams();
|
|
3344
3450
|
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 ?? [];
|
|
3345
|
-
},
|
|
3451
|
+
}, Ai = ({ eventID: e, external: t }) => {
|
|
3346
3452
|
let n = i(), [r, a] = A([]), [o, s] = A(!t), [c, l] = A(!1), [u, d] = A(null);
|
|
3347
3453
|
return E(() => {
|
|
3348
|
-
t || !e || !n || (s(!0), l(!1),
|
|
3454
|
+
t || !e || !n || (s(!0), l(!1), ki(n, e).then((e) => {
|
|
3349
3455
|
a(e), e.length === 1 && d(e[0] ?? null);
|
|
3350
3456
|
}).catch((e) => {
|
|
3351
3457
|
l(!0), n.logger?.error("Failed to load event tickets", { exception: b(e) });
|
|
@@ -3361,7 +3467,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3361
3467
|
selectedTicket: u,
|
|
3362
3468
|
selectTicket: d
|
|
3363
3469
|
};
|
|
3364
|
-
},
|
|
3470
|
+
}, ji = async (e) => {
|
|
3365
3471
|
let { payment_session_id: t, order_id: n } = e;
|
|
3366
3472
|
if (!t || !n) throw Error("Cashfree payment session missing");
|
|
3367
3473
|
let { load: r } = await import("./script.esm-D4nvz3-k.js"), i = await r({ mode: e.environment || "production" });
|
|
@@ -3377,8 +3483,8 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3377
3483
|
status: "closed",
|
|
3378
3484
|
message: a.error?.message
|
|
3379
3485
|
};
|
|
3380
|
-
},
|
|
3381
|
-
let { Razorpay: r, isLoading: i, error: a } =
|
|
3486
|
+
}, Mi = () => typeof window < "u" && "Razorpay" in window, Ni = ({ order: e, onSettled: t, onError: n }) => {
|
|
3487
|
+
let { Razorpay: r, isLoading: i, error: a } = fe(), o = k({
|
|
3382
3488
|
onSettled: t,
|
|
3383
3489
|
onError: n
|
|
3384
3490
|
});
|
|
@@ -3393,7 +3499,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3393
3499
|
s.current = !0, o.current.onError(Error(a));
|
|
3394
3500
|
return;
|
|
3395
3501
|
}
|
|
3396
|
-
if (!r || !
|
|
3502
|
+
if (!r || !Mi()) return;
|
|
3397
3503
|
s.current = !0;
|
|
3398
3504
|
let t;
|
|
3399
3505
|
try {
|
|
@@ -3431,37 +3537,37 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3431
3537
|
a,
|
|
3432
3538
|
e
|
|
3433
3539
|
]), null;
|
|
3434
|
-
},
|
|
3540
|
+
}, Pi = ({ stripePromise: e, clientSecret: t, onClose: n, onComplete: r }) => {
|
|
3435
3541
|
let i = k(r);
|
|
3436
3542
|
i.current = r;
|
|
3437
3543
|
let a = O(() => ({
|
|
3438
3544
|
clientSecret: t,
|
|
3439
3545
|
onComplete: () => i.current()
|
|
3440
3546
|
}), [t]);
|
|
3441
|
-
return /* @__PURE__ */
|
|
3547
|
+
return /* @__PURE__ */ M(P.Root, {
|
|
3442
3548
|
open: !0,
|
|
3443
3549
|
onOpenChange: (e) => {
|
|
3444
3550
|
e || n();
|
|
3445
3551
|
},
|
|
3446
|
-
children: /* @__PURE__ */ P
|
|
3552
|
+
children: /* @__PURE__ */ N(P.Portal, { children: [/* @__PURE__ */ M(P.Backdrop, { className: "fixed inset-0 z-[2147483001] bg-black/50" }), /* @__PURE__ */ N(P.Popup, {
|
|
3447
3553
|
className: "fixed top-8 left-1/2 z-[2147483001] flex max-h-[calc(100dvh-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]",
|
|
3448
|
-
children: [/* @__PURE__ */
|
|
3554
|
+
children: [/* @__PURE__ */ M(P.Close, {
|
|
3449
3555
|
"aria-label": "Close payment",
|
|
3450
3556
|
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",
|
|
3451
|
-
children: /* @__PURE__ */
|
|
3452
|
-
}), /* @__PURE__ */
|
|
3557
|
+
children: /* @__PURE__ */ M(H, { className: "size-5" })
|
|
3558
|
+
}), /* @__PURE__ */ M("div", {
|
|
3453
3559
|
className: "flex-1 overflow-y-auto rounded-2xl py-6",
|
|
3454
|
-
children: /* @__PURE__ */
|
|
3560
|
+
children: /* @__PURE__ */ M(me, {
|
|
3455
3561
|
stripe: e,
|
|
3456
3562
|
options: a,
|
|
3457
|
-
children: /* @__PURE__ */
|
|
3563
|
+
children: /* @__PURE__ */ M(pe, { className: "stripe-embedded-checkout h-full" })
|
|
3458
3564
|
})
|
|
3459
3565
|
})]
|
|
3460
3566
|
})] })
|
|
3461
3567
|
});
|
|
3462
|
-
},
|
|
3568
|
+
}, Fi = () => {
|
|
3463
3569
|
let [e, t] = A(null), n = w(async (e, n) => {
|
|
3464
|
-
if (e.provider === "cashfree") return
|
|
3570
|
+
if (e.provider === "cashfree") return ji(e);
|
|
3465
3571
|
if (e.provider === "stripe") {
|
|
3466
3572
|
let { client_secret: n, session_id: r } = e;
|
|
3467
3573
|
if (!n || !r) throw Error("Stripe checkout session missing");
|
|
@@ -3495,7 +3601,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3495
3601
|
}, []), r = (e, n) => {
|
|
3496
3602
|
t(null), n instanceof Error ? e.settle.reject(n) : e.settle.resolve(n);
|
|
3497
3603
|
}, i = null;
|
|
3498
|
-
return e?.provider === "stripe" ? i = /* @__PURE__ */
|
|
3604
|
+
return e?.provider === "stripe" ? i = /* @__PURE__ */ M(Pi, {
|
|
3499
3605
|
stripePromise: e.stripePromise,
|
|
3500
3606
|
clientSecret: e.clientSecret,
|
|
3501
3607
|
onComplete: () => r(e, {
|
|
@@ -3503,7 +3609,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3503
3609
|
confirmation: { session_id: e.sessionId }
|
|
3504
3610
|
}),
|
|
3505
3611
|
onClose: () => r(e, { status: "closed" })
|
|
3506
|
-
}) : e?.provider === "razorpay" && (i = /* @__PURE__ */
|
|
3612
|
+
}) : e?.provider === "razorpay" && (i = /* @__PURE__ */ M(Ni, {
|
|
3507
3613
|
order: e.order,
|
|
3508
3614
|
onSettled: (t) => r(e, t),
|
|
3509
3615
|
onError: (t) => r(e, t)
|
|
@@ -3517,8 +3623,8 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3517
3623
|
providerUnreachable: "We couldn't reach the payment provider. Check your connection and try again.",
|
|
3518
3624
|
confirmationFailed: "We couldn't confirm your payment. Your details are saved — try again.",
|
|
3519
3625
|
generic: "Something went wrong. Please try again."
|
|
3520
|
-
},
|
|
3521
|
-
let r = i(), a =
|
|
3626
|
+
}, Ii = (e) => !!e && e.status !== "requires_payment", Li = ({ eventID: e, details: t, onConfirmed: n }) => {
|
|
3627
|
+
let r = i(), a = Fi(), [o, s] = A({ kind: "idle" }), c = k({
|
|
3522
3628
|
details: t,
|
|
3523
3629
|
onConfirmed: n
|
|
3524
3630
|
});
|
|
@@ -3534,7 +3640,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3534
3640
|
message: t
|
|
3535
3641
|
}), d = async (e, t) => {
|
|
3536
3642
|
if (!t?.key) {
|
|
3537
|
-
|
|
3643
|
+
Ii(e) ? l(e) : s({
|
|
3538
3644
|
kind: "failed",
|
|
3539
3645
|
message: $.registrationFailed
|
|
3540
3646
|
});
|
|
@@ -3568,7 +3674,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3568
3674
|
}
|
|
3569
3675
|
try {
|
|
3570
3676
|
let t = (await r?.fetch?.url(`/v1/event/booking/${e._id}/confirm-booking`)?.post(n.confirmation)?.json())?.content?.data;
|
|
3571
|
-
|
|
3677
|
+
Ii(t) ? l(t) : u(e._id, $.paymentAbandoned);
|
|
3572
3678
|
} catch (t) {
|
|
3573
3679
|
r?.logger?.error("Failed to confirm booking after payment", { exception: b(t) }), u(e._id, $.confirmationFailed);
|
|
3574
3680
|
}
|
|
@@ -3607,67 +3713,67 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3607
3713
|
},
|
|
3608
3714
|
reset: () => s({ kind: "idle" })
|
|
3609
3715
|
};
|
|
3610
|
-
},
|
|
3716
|
+
}, Ri = (e) => `levo:event-registration:${e}`, zi = (e) => {
|
|
3611
3717
|
if (typeof window > "u") return null;
|
|
3612
3718
|
try {
|
|
3613
|
-
let t = window.localStorage.getItem(
|
|
3719
|
+
let t = window.localStorage.getItem(Ri(e));
|
|
3614
3720
|
return t ? JSON.parse(t) : null;
|
|
3615
3721
|
} catch {
|
|
3616
3722
|
return null;
|
|
3617
3723
|
}
|
|
3618
|
-
},
|
|
3724
|
+
}, Bi = (e, t) => {
|
|
3619
3725
|
if (!(typeof window > "u")) try {
|
|
3620
|
-
window.localStorage.setItem(
|
|
3726
|
+
window.localStorage.setItem(Ri(e), JSON.stringify(t));
|
|
3621
3727
|
} catch {}
|
|
3622
|
-
},
|
|
3728
|
+
}, Vi = (e) => {
|
|
3623
3729
|
if (!(typeof window > "u")) try {
|
|
3624
|
-
window.localStorage.removeItem(
|
|
3730
|
+
window.localStorage.removeItem(Ri(e));
|
|
3625
3731
|
} catch {}
|
|
3626
|
-
},
|
|
3732
|
+
}, Hi = (e) => {
|
|
3627
3733
|
let [t, n] = A(null), [r, i] = A(null);
|
|
3628
3734
|
return E(() => {
|
|
3629
|
-
let t =
|
|
3735
|
+
let t = zi(e);
|
|
3630
3736
|
t && i(t.email);
|
|
3631
3737
|
}, [e]), {
|
|
3632
3738
|
booking: t,
|
|
3633
3739
|
registeredEmail: r,
|
|
3634
3740
|
complete: (t, r) => {
|
|
3635
|
-
n(t), i(r),
|
|
3741
|
+
n(t), i(r), Bi(e, {
|
|
3636
3742
|
bookingId: t._id,
|
|
3637
3743
|
email: r,
|
|
3638
3744
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3639
3745
|
});
|
|
3640
3746
|
},
|
|
3641
3747
|
clear: () => {
|
|
3642
|
-
|
|
3748
|
+
Vi(e), i(null), n(null);
|
|
3643
3749
|
}
|
|
3644
3750
|
};
|
|
3645
|
-
},
|
|
3751
|
+
}, Ui = "register", Wi = () => {
|
|
3646
3752
|
if (typeof window > "u") return !1;
|
|
3647
|
-
let e = new URLSearchParams(window.location.search).get(
|
|
3753
|
+
let e = new URLSearchParams(window.location.search).get(Ui);
|
|
3648
3754
|
return e !== null && e !== "0" && e !== "false";
|
|
3649
|
-
},
|
|
3755
|
+
}, Gi = ({ canAutoOpen: e }) => {
|
|
3650
3756
|
let [t, n] = A(!1), r = k(!1), i = w(() => n(!0), []), a = w(() => n(!1), []);
|
|
3651
3757
|
return E(() => {
|
|
3652
|
-
r.current || !e || !
|
|
3758
|
+
r.current || !e || !Wi() || (r.current = !0, n(!0));
|
|
3653
3759
|
}, [e]), {
|
|
3654
3760
|
isOpen: t,
|
|
3655
3761
|
open: i,
|
|
3656
3762
|
close: a
|
|
3657
3763
|
};
|
|
3658
|
-
},
|
|
3659
|
-
let { account: o } =
|
|
3764
|
+
}, Ki = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, qi = ({ eventID: e, title: t, buttonText: n = "Register Now", startsAt: r, endsAt: i, eventUrl: a }) => {
|
|
3765
|
+
let { account: o } = nt(), s = cr(), c = Ai({ eventID: e }), [l, u] = A({}), [d, f] = A("tickets"), [p, m] = A(!1), [h, g] = A(null), _ = c.tickets.length === 1 ? c.tickets[0]?._id : void 0;
|
|
3660
3766
|
E(() => {
|
|
3661
3767
|
_ && u((e) => ({ [_]: e[_] || 1 }));
|
|
3662
3768
|
}, [_]);
|
|
3663
3769
|
let v = O(() => c.tickets.map((e) => ({
|
|
3664
3770
|
ticket: e,
|
|
3665
3771
|
count: l[e._id] ?? 0
|
|
3666
|
-
})).filter((e) => e.count > 0), [c.tickets, l]), y = v.reduce((e, t) => e + t.count, 0), b = wi(o, c.tickets, l), x = b.slots[0] ? b.getValues(b.slots[0].key) : null, S =
|
|
3772
|
+
})).filter((e) => e.count > 0), [c.tickets, l]), y = v.reduce((e, t) => e + t.count, 0), b = wi(o, c.tickets, l), x = b.slots[0] ? b.getValues(b.slots[0].key) : null, S = Hi(e), { booking: C } = S, w = Gi({ canAutoOpen: !c.isLoading && c.tickets.length > 0 && !S.registeredEmail }), T = v.some((e) => Ur(e.ticket, null) > 0), D = Oi({
|
|
3667
3773
|
eventID: e,
|
|
3668
|
-
|
|
3669
|
-
enabled: w.isOpen && T
|
|
3670
|
-
}), k =
|
|
3774
|
+
tickets: b.slots.map((e) => e.ticket),
|
|
3775
|
+
enabled: w.isOpen && T && d === "review"
|
|
3776
|
+
}), k = Jr(v, D.discount), ee = !!k && !k.isFree, P = O(() => ei(r, i), [r, i]), F = t || "this event", I = Li({
|
|
3671
3777
|
eventID: e,
|
|
3672
3778
|
details: {
|
|
3673
3779
|
merchantName: s?.name || t || "",
|
|
@@ -3679,14 +3785,14 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3679
3785
|
}
|
|
3680
3786
|
},
|
|
3681
3787
|
onConfirmed: (e) => S.complete(e, x?.email.trim() ?? "")
|
|
3682
|
-
}),
|
|
3683
|
-
D.reset(),
|
|
3788
|
+
}), L = (e, t) => {
|
|
3789
|
+
D.reset(), I.reset(), m(!1), u((n) => ({
|
|
3684
3790
|
...n,
|
|
3685
3791
|
[e]: t
|
|
3686
3792
|
}));
|
|
3687
|
-
},
|
|
3688
|
-
S.clear(),
|
|
3689
|
-
},
|
|
3793
|
+
}, R = () => {
|
|
3794
|
+
S.clear(), I.reset(), D.reset(), b.reset(), u(_ ? { [_]: 1 } : {}), f("tickets"), g(null);
|
|
3795
|
+
}, te = (t) => {
|
|
3690
3796
|
if (t.preventDefault(), d === "tickets") {
|
|
3691
3797
|
if (y === 0) {
|
|
3692
3798
|
m(!0);
|
|
@@ -3705,9 +3811,9 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3705
3811
|
return;
|
|
3706
3812
|
}
|
|
3707
3813
|
}
|
|
3708
|
-
|
|
3814
|
+
I.register({
|
|
3709
3815
|
event: e,
|
|
3710
|
-
coupon: D.code,
|
|
3816
|
+
coupon: D.applied?.code ?? "",
|
|
3711
3817
|
attendees: b.slots.map((e) => {
|
|
3712
3818
|
let t = b.getValues(e.key);
|
|
3713
3819
|
return {
|
|
@@ -3718,183 +3824,181 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3718
3824
|
details: {}
|
|
3719
3825
|
};
|
|
3720
3826
|
}),
|
|
3721
|
-
...b.billing.is_business_purchase &&
|
|
3827
|
+
...b.billing.is_business_purchase && ee ? {
|
|
3722
3828
|
is_business_purchase: !0,
|
|
3723
3829
|
billing_details: b.billing.billing_details
|
|
3724
3830
|
} : {}
|
|
3725
3831
|
});
|
|
3726
3832
|
};
|
|
3727
|
-
if (!c.isLoading && c.tickets.length === 0) return /* @__PURE__ */
|
|
3728
|
-
let
|
|
3833
|
+
if (!c.isLoading && c.tickets.length === 0) return /* @__PURE__ */ M(li, { hasFailed: c.hasFailed });
|
|
3834
|
+
let z = k && !k.isFree ? Z({
|
|
3729
3835
|
unit_amount: k.amount,
|
|
3730
3836
|
currency: k.currency
|
|
3731
|
-
}) : null,
|
|
3837
|
+
}) : null, ne = z ? `Pay ${z}` : y === 1 ? "Save my spot" : `Save ${y} spots`, B = (e, t) => /* @__PURE__ */ N("button", {
|
|
3732
3838
|
type: "button",
|
|
3733
|
-
disabled:
|
|
3839
|
+
disabled: I.state.kind === "busy",
|
|
3734
3840
|
onClick: () => {
|
|
3735
|
-
|
|
3841
|
+
I.reset(), f(t);
|
|
3736
3842
|
},
|
|
3737
3843
|
className: "-ml-1 inline-flex items-center gap-1.5 self-start rounded-lg px-1 py-0.5 text-[13px] text-ink-soft transition hover:text-ink disabled:pointer-events-none disabled:opacity-50",
|
|
3738
|
-
children: [/* @__PURE__ */
|
|
3739
|
-
}),
|
|
3844
|
+
children: [/* @__PURE__ */ M(ie, { className: "size-3.5" }), e]
|
|
3845
|
+
}), re = "inline-flex min-h-[50px] items-center justify-center rounded-xl bg-brand px-6 font-semibold text-[15.5px] text-brand-foreground transition active:scale-[0.985] disabled:opacity-55", ae = /* @__PURE__ */ N("div", {
|
|
3740
3846
|
className: "flex items-center gap-3",
|
|
3741
|
-
children: [/* @__PURE__ */
|
|
3847
|
+
children: [/* @__PURE__ */ N("div", {
|
|
3742
3848
|
className: "min-w-0 flex-1",
|
|
3743
|
-
children: [/* @__PURE__ */
|
|
3849
|
+
children: [/* @__PURE__ */ M("span", {
|
|
3744
3850
|
className: "block font-semibold text-[15px] text-ink tabular-nums",
|
|
3745
|
-
children: y === 0 ? "No tickets yet" :
|
|
3746
|
-
}), y > 0 && /* @__PURE__ */
|
|
3851
|
+
children: y === 0 ? "No tickets yet" : Ki(y, "ticket")
|
|
3852
|
+
}), y > 0 && /* @__PURE__ */ M("span", {
|
|
3747
3853
|
className: "block text-[12.5px] text-ink-soft tabular-nums",
|
|
3748
|
-
children:
|
|
3854
|
+
children: z ?? "Free"
|
|
3749
3855
|
})]
|
|
3750
|
-
}), /* @__PURE__ */
|
|
3856
|
+
}), /* @__PURE__ */ M("button", {
|
|
3751
3857
|
type: "submit",
|
|
3752
|
-
className:
|
|
3858
|
+
className: re,
|
|
3753
3859
|
children: "Continue"
|
|
3754
3860
|
})]
|
|
3755
|
-
}),
|
|
3861
|
+
}), V = b.isValid ? void 0 : "Fill in every attendee's details to continue", oe = d === "tickets" ? ae : d === "details" && T ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M("button", {
|
|
3756
3862
|
type: "submit",
|
|
3757
3863
|
disabled: !b.isValid,
|
|
3758
|
-
className: X(
|
|
3864
|
+
className: X(re, "w-full"),
|
|
3759
3865
|
children: "Review order"
|
|
3760
|
-
}),
|
|
3866
|
+
}), V && /* @__PURE__ */ M("p", {
|
|
3761
3867
|
className: "m-0 mt-2 text-center text-ink-muted text-xs",
|
|
3762
|
-
children:
|
|
3763
|
-
})] }) : /* @__PURE__ */
|
|
3764
|
-
payment:
|
|
3765
|
-
label:
|
|
3766
|
-
isPaid:
|
|
3767
|
-
blockedReason: d === "details" ?
|
|
3868
|
+
children: V
|
|
3869
|
+
})] }) : /* @__PURE__ */ M(Xr, {
|
|
3870
|
+
payment: I,
|
|
3871
|
+
label: ne,
|
|
3872
|
+
isPaid: ee,
|
|
3873
|
+
blockedReason: d === "details" ? V : void 0
|
|
3768
3874
|
});
|
|
3769
|
-
return /* @__PURE__ */
|
|
3875
|
+
return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(ci, {
|
|
3770
3876
|
buttonText: n,
|
|
3771
3877
|
registeredEmail: S.registeredEmail,
|
|
3772
3878
|
isSheetOpen: w.isOpen,
|
|
3773
3879
|
isLoading: c.isLoading,
|
|
3774
3880
|
onOpen: w.open,
|
|
3775
|
-
onRegisterAnother:
|
|
3776
|
-
}), /* @__PURE__ */
|
|
3881
|
+
onRegisterAnother: R
|
|
3882
|
+
}), /* @__PURE__ */ M(oi, {
|
|
3777
3883
|
open: w.isOpen,
|
|
3778
|
-
title: C ?
|
|
3779
|
-
when:
|
|
3884
|
+
title: C ? F : `Register for ${F}`,
|
|
3885
|
+
when: P,
|
|
3780
3886
|
wide: !0,
|
|
3781
3887
|
onClose: w.close,
|
|
3782
3888
|
onClosed: () => {
|
|
3783
|
-
|
|
3889
|
+
I.reset(), b.resetValidationDisplay(), m(!1);
|
|
3784
3890
|
},
|
|
3785
|
-
layers:
|
|
3786
|
-
onSubmit: C ? void 0 :
|
|
3787
|
-
footer: C ? void 0 :
|
|
3788
|
-
children: C ? /* @__PURE__ */
|
|
3891
|
+
layers: I.checkoutElement,
|
|
3892
|
+
onSubmit: C ? void 0 : te,
|
|
3893
|
+
footer: C ? void 0 : oe,
|
|
3894
|
+
children: C ? /* @__PURE__ */ M(pi, {
|
|
3789
3895
|
email: x?.email.trim() ?? "",
|
|
3790
|
-
eventTitle:
|
|
3896
|
+
eventTitle: F,
|
|
3791
3897
|
startsAt: r,
|
|
3792
3898
|
endsAt: i,
|
|
3793
3899
|
eventUrl: a,
|
|
3794
|
-
when:
|
|
3900
|
+
when: P,
|
|
3795
3901
|
bookingRef: C._id,
|
|
3796
3902
|
qrImageUrl: C.qr_image?.location,
|
|
3797
3903
|
invoiceUrl: C.invoice?.location,
|
|
3798
3904
|
attendeeCount: b.slots.length,
|
|
3799
3905
|
onClose: w.close,
|
|
3800
|
-
onRegisterAnother:
|
|
3801
|
-
}) : d === "tickets" ? /* @__PURE__ */
|
|
3906
|
+
onRegisterAnother: R
|
|
3907
|
+
}) : d === "tickets" ? /* @__PURE__ */ M(xi, {
|
|
3802
3908
|
tickets: c.tickets,
|
|
3803
3909
|
counts: l,
|
|
3804
|
-
onChange:
|
|
3910
|
+
onChange: L,
|
|
3805
3911
|
error: p ? "Add at least one ticket to continue" : void 0
|
|
3806
|
-
}) : d === "details" ? /* @__PURE__ */
|
|
3912
|
+
}) : d === "details" ? /* @__PURE__ */ N("div", {
|
|
3807
3913
|
className: "flex flex-col gap-4",
|
|
3808
3914
|
children: [
|
|
3809
|
-
|
|
3810
|
-
/* @__PURE__ */
|
|
3915
|
+
B("Change tickets", "tickets"),
|
|
3916
|
+
/* @__PURE__ */ M("span", {
|
|
3811
3917
|
className: "font-semibold text-[16px] text-ink",
|
|
3812
3918
|
children: y === 1 ? "Your details" : "Attendee details"
|
|
3813
3919
|
}),
|
|
3814
|
-
/* @__PURE__ */
|
|
3920
|
+
/* @__PURE__ */ M(Rr, {
|
|
3815
3921
|
attendees: b,
|
|
3816
3922
|
openKey: h,
|
|
3817
3923
|
onOpenChange: g
|
|
3818
3924
|
})
|
|
3819
3925
|
]
|
|
3820
|
-
}) : /* @__PURE__ */
|
|
3926
|
+
}) : /* @__PURE__ */ N("div", {
|
|
3821
3927
|
className: "flex flex-col gap-4",
|
|
3822
3928
|
children: [
|
|
3823
|
-
|
|
3824
|
-
/* @__PURE__ */
|
|
3929
|
+
B("Edit attendee details", "details"),
|
|
3930
|
+
/* @__PURE__ */ M(Yr, {
|
|
3825
3931
|
lines: v,
|
|
3826
3932
|
discount: D.discount,
|
|
3827
3933
|
pricing: k
|
|
3828
3934
|
}),
|
|
3829
|
-
/* @__PURE__ */
|
|
3830
|
-
|
|
3831
|
-
|
|
3935
|
+
/* @__PURE__ */ M(Qr, {
|
|
3936
|
+
applied: D.applied,
|
|
3937
|
+
pending: D.pending,
|
|
3832
3938
|
couponError: D.error,
|
|
3833
|
-
couponLoading: D.isLoading,
|
|
3834
3939
|
onValidateCoupon: D.apply,
|
|
3835
3940
|
onRemoveCoupon: D.reset,
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
tickets: v.map((e) => e.ticket)
|
|
3941
|
+
offers: D.offers,
|
|
3942
|
+
currency: v[0]?.ticket.currency
|
|
3839
3943
|
}),
|
|
3840
|
-
|
|
3944
|
+
ee && /* @__PURE__ */ M(Lr, {
|
|
3841
3945
|
values: b.billing,
|
|
3842
3946
|
onChange: b.setBillingField
|
|
3843
3947
|
})
|
|
3844
3948
|
]
|
|
3845
3949
|
})
|
|
3846
3950
|
})] });
|
|
3847
|
-
},
|
|
3848
|
-
let [n, r] = A(!1), i = e?.currency, a =
|
|
3951
|
+
}, Ji = ({ selectedTicket: e, discount: t }) => {
|
|
3952
|
+
let [n, r] = A(!1), i = e?.currency, a = Ur(e, t), o = Gr(e, t), s = Kr(e, t), c = t?.discount ?? 0, l = s.length > 0 || c > 0 || o !== a, u = /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ N("span", {
|
|
3849
3953
|
className: "inline-flex items-center gap-1.5",
|
|
3850
|
-
children: ["Total", l && /* @__PURE__ */
|
|
3851
|
-
}), /* @__PURE__ */
|
|
3954
|
+
children: ["Total", l && /* @__PURE__ */ M(oe, { className: X("size-4 text-ink-muted transition-transform", n && "rotate-180") })]
|
|
3955
|
+
}), /* @__PURE__ */ M("span", { children: Z({
|
|
3852
3956
|
unit_amount: a,
|
|
3853
3957
|
currency: i
|
|
3854
3958
|
}) })] }), d = "flex w-full items-center justify-between gap-3 px-3.5 py-3 font-semibold text-[15px] text-ink";
|
|
3855
|
-
return /* @__PURE__ */
|
|
3959
|
+
return /* @__PURE__ */ N("div", {
|
|
3856
3960
|
className: "rounded-xl border border-border bg-ink/3",
|
|
3857
|
-
children: [l ? /* @__PURE__ */
|
|
3961
|
+
children: [l ? /* @__PURE__ */ M("button", {
|
|
3858
3962
|
type: "button",
|
|
3859
3963
|
onClick: () => r((e) => !e),
|
|
3860
3964
|
"aria-expanded": n,
|
|
3861
3965
|
className: d,
|
|
3862
3966
|
children: u
|
|
3863
|
-
}) : /* @__PURE__ */
|
|
3967
|
+
}) : /* @__PURE__ */ M("div", {
|
|
3864
3968
|
className: d,
|
|
3865
3969
|
children: u
|
|
3866
|
-
}), l && /* @__PURE__ */
|
|
3970
|
+
}), l && /* @__PURE__ */ M(kr, {
|
|
3867
3971
|
open: n,
|
|
3868
|
-
children: /* @__PURE__ */
|
|
3972
|
+
children: /* @__PURE__ */ N("div", {
|
|
3869
3973
|
className: "flex flex-col gap-1.5 px-3.5 pb-3 text-[13px] text-ink-soft",
|
|
3870
3974
|
children: [
|
|
3871
|
-
/* @__PURE__ */
|
|
3975
|
+
/* @__PURE__ */ N("div", {
|
|
3872
3976
|
className: "flex items-center justify-between gap-3",
|
|
3873
|
-
children: [/* @__PURE__ */
|
|
3977
|
+
children: [/* @__PURE__ */ M("span", { children: "Subtotal" }), /* @__PURE__ */ M("span", { children: Z({
|
|
3874
3978
|
unit_amount: o,
|
|
3875
3979
|
currency: i
|
|
3876
3980
|
}) })]
|
|
3877
3981
|
}),
|
|
3878
|
-
c > 0 && /* @__PURE__ */
|
|
3982
|
+
c > 0 && /* @__PURE__ */ N("div", {
|
|
3879
3983
|
className: "flex items-center justify-between gap-3 text-emerald-700 dark:text-emerald-400",
|
|
3880
|
-
children: [/* @__PURE__ */
|
|
3984
|
+
children: [/* @__PURE__ */ M("span", { children: "Discount" }), /* @__PURE__ */ N("span", { children: ["-", Z({
|
|
3881
3985
|
unit_amount: c,
|
|
3882
3986
|
currency: i
|
|
3883
3987
|
})] })]
|
|
3884
3988
|
}),
|
|
3885
|
-
s.map((e, t) => /* @__PURE__ */
|
|
3989
|
+
s.map((e, t) => /* @__PURE__ */ N("div", {
|
|
3886
3990
|
className: "flex items-center justify-between gap-3",
|
|
3887
|
-
children: [/* @__PURE__ */
|
|
3991
|
+
children: [/* @__PURE__ */ N("span", { children: [
|
|
3888
3992
|
e.label,
|
|
3889
3993
|
" (",
|
|
3890
3994
|
e.percentage,
|
|
3891
3995
|
"%)"
|
|
3892
|
-
] }), /* @__PURE__ */
|
|
3996
|
+
] }), /* @__PURE__ */ M("span", { children: Z({
|
|
3893
3997
|
unit_amount: e.amount,
|
|
3894
3998
|
currency: i
|
|
3895
3999
|
}) })]
|
|
3896
4000
|
}, e.id || e._id || t)),
|
|
3897
|
-
e?.tax_inclusive && /* @__PURE__ */
|
|
4001
|
+
e?.tax_inclusive && /* @__PURE__ */ M("p", {
|
|
3898
4002
|
className: "m-0 text-ink-muted text-xs",
|
|
3899
4003
|
children: "Price is inclusive of taxes"
|
|
3900
4004
|
})
|
|
@@ -3902,25 +4006,25 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3902
4006
|
})
|
|
3903
4007
|
})]
|
|
3904
4008
|
});
|
|
3905
|
-
},
|
|
4009
|
+
}, Yi = ({ tickets: e, selectedTicket: t, onSelect: n, error: r }) => {
|
|
3906
4010
|
let [i, a] = A(!t);
|
|
3907
|
-
return /* @__PURE__ */
|
|
4011
|
+
return /* @__PURE__ */ N("fieldset", {
|
|
3908
4012
|
className: "m-0 flex min-w-0 flex-col gap-2 border-0 p-0",
|
|
3909
4013
|
children: [
|
|
3910
|
-
/* @__PURE__ */
|
|
4014
|
+
/* @__PURE__ */ M("legend", {
|
|
3911
4015
|
className: "mb-2 p-0 font-medium text-ink text-sm",
|
|
3912
4016
|
children: "Choose your ticket"
|
|
3913
4017
|
}),
|
|
3914
|
-
/* @__PURE__ */
|
|
4018
|
+
/* @__PURE__ */ M("div", {
|
|
3915
4019
|
className: "-mb-2 flex flex-col",
|
|
3916
4020
|
children: e.map((r) => {
|
|
3917
|
-
let o = r._id === t?._id, s = i || o, c =
|
|
3918
|
-
return /* @__PURE__ */
|
|
4021
|
+
let o = r._id === t?._id, s = i || o, c = Br(r);
|
|
4022
|
+
return /* @__PURE__ */ M(kr, {
|
|
3919
4023
|
open: s,
|
|
3920
|
-
children: /* @__PURE__ */
|
|
4024
|
+
children: /* @__PURE__ */ N("label", {
|
|
3921
4025
|
className: X("mb-2 flex w-full cursor-pointer items-start gap-2.5 rounded-xl border px-3.5 py-3 transition", o ? "border-brand bg-brand/5" : "border-border hover:border-brand/50"),
|
|
3922
4026
|
children: [
|
|
3923
|
-
/* @__PURE__ */
|
|
4027
|
+
/* @__PURE__ */ M("input", {
|
|
3924
4028
|
type: "radio",
|
|
3925
4029
|
name: "ticket",
|
|
3926
4030
|
value: r._id,
|
|
@@ -3933,35 +4037,35 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3933
4037
|
},
|
|
3934
4038
|
className: "sr-only"
|
|
3935
4039
|
}),
|
|
3936
|
-
/* @__PURE__ */
|
|
4040
|
+
/* @__PURE__ */ M("span", {
|
|
3937
4041
|
"aria-hidden": !0,
|
|
3938
4042
|
className: X("mt-0.5 size-[17px] shrink-0 rounded-full border transition-all", o ? "border-[5px] border-brand" : "border-border")
|
|
3939
4043
|
}),
|
|
3940
|
-
/* @__PURE__ */
|
|
4044
|
+
/* @__PURE__ */ N("span", {
|
|
3941
4045
|
className: "min-w-0 flex-1 [overflow-wrap:anywhere]",
|
|
3942
|
-
children: [/* @__PURE__ */
|
|
4046
|
+
children: [/* @__PURE__ */ M("span", {
|
|
3943
4047
|
className: "block font-medium text-[14.5px] text-ink leading-snug",
|
|
3944
4048
|
children: r.title
|
|
3945
|
-
}), r.description && /* @__PURE__ */
|
|
4049
|
+
}), r.description && /* @__PURE__ */ M("span", {
|
|
3946
4050
|
title: r.description,
|
|
3947
4051
|
className: X("mt-0.5 block text-[12.5px] text-ink-soft leading-snug", !i && "line-clamp-2"),
|
|
3948
4052
|
children: r.description
|
|
3949
4053
|
})]
|
|
3950
4054
|
}),
|
|
3951
|
-
/* @__PURE__ */
|
|
4055
|
+
/* @__PURE__ */ N("span", {
|
|
3952
4056
|
className: "flex shrink-0 flex-col items-end gap-1.5",
|
|
3953
|
-
children: [/* @__PURE__ */
|
|
4057
|
+
children: [/* @__PURE__ */ N("span", {
|
|
3954
4058
|
className: "text-right font-medium text-[14.5px] text-ink",
|
|
3955
|
-
children: [Z(r), c && /* @__PURE__ */
|
|
4059
|
+
children: [Z(r), c && /* @__PURE__ */ M("span", {
|
|
3956
4060
|
className: "block font-normal text-[11.5px] text-ink-muted",
|
|
3957
4061
|
children: c
|
|
3958
4062
|
})]
|
|
3959
|
-
}), o && !i && e.length > 1 && /* @__PURE__ */
|
|
4063
|
+
}), o && !i && e.length > 1 && /* @__PURE__ */ N("span", {
|
|
3960
4064
|
className: "inline-flex items-center gap-1 whitespace-nowrap rounded-full border border-brand/40 px-2.5 py-1 font-medium text-[12px] text-brand",
|
|
3961
4065
|
children: [
|
|
3962
4066
|
e.length - 1,
|
|
3963
4067
|
" more",
|
|
3964
|
-
/* @__PURE__ */
|
|
4068
|
+
/* @__PURE__ */ M(oe, {
|
|
3965
4069
|
"aria-hidden": !0,
|
|
3966
4070
|
className: "size-3.5"
|
|
3967
4071
|
})
|
|
@@ -3973,21 +4077,21 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
3973
4077
|
}, r._id);
|
|
3974
4078
|
})
|
|
3975
4079
|
}),
|
|
3976
|
-
r && /* @__PURE__ */
|
|
4080
|
+
r && /* @__PURE__ */ M("p", {
|
|
3977
4081
|
className: "m-0 text-danger text-xs",
|
|
3978
4082
|
children: r
|
|
3979
4083
|
})
|
|
3980
4084
|
]
|
|
3981
4085
|
});
|
|
3982
|
-
},
|
|
3983
|
-
let { account: s } =
|
|
4086
|
+
}, Xi = (e) => e.enableMultipleTicketBooking && !e.external ? /* @__PURE__ */ M(qi, { ...e }, e.eventID) : /* @__PURE__ */ M(Zi, { ...e }, e.eventID), Zi = ({ eventID: e, title: t, external: n, buttonText: r = "Register Now", startsAt: i, endsAt: a, eventUrl: o }) => {
|
|
4087
|
+
let { account: s } = nt(), c = cr(), l = Ai({
|
|
3984
4088
|
eventID: e,
|
|
3985
4089
|
external: n
|
|
3986
|
-
}), u = l.selectedTicket?.registration_fields ?? mi, d = Ci(s, u), f =
|
|
4090
|
+
}), u = l.selectedTicket?.registration_fields ?? mi, d = Ci(s, u), f = Wr(l.selectedTicket, null)?.isFree === !1, p = Hi(e), { booking: m } = p, h = Gi({ canAutoOpen: !n && !l.isLoading && l.tickets.length > 0 && !p.registeredEmail }), g = k(null), _ = Oi({
|
|
3987
4091
|
eventID: e,
|
|
3988
|
-
|
|
4092
|
+
tickets: l.selectedTicket ? [l.selectedTicket] : [],
|
|
3989
4093
|
enabled: h.isOpen && f
|
|
3990
|
-
}), v =
|
|
4094
|
+
}), v = Wr(l.selectedTicket, _.discount), y = !!v && !v.isFree, b = l.tickets.length > 1, x = O(() => ei(i, a), [i, a]), S = t || "this event", C = b || f, w = Li({
|
|
3991
4095
|
eventID: e,
|
|
3992
4096
|
details: {
|
|
3993
4097
|
merchantName: c?.name || t || "",
|
|
@@ -4006,7 +4110,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
4006
4110
|
}, D = (t) => {
|
|
4007
4111
|
t.preventDefault(), d.markSubmitted(), !(!l.selectedTicket || !d.isValid) && w.register({
|
|
4008
4112
|
event: e,
|
|
4009
|
-
coupon: _.code,
|
|
4113
|
+
coupon: _.applied?.code ?? "",
|
|
4010
4114
|
attendees: [{
|
|
4011
4115
|
name: d.values.name.trim(),
|
|
4012
4116
|
email: d.values.email.trim(),
|
|
@@ -4020,28 +4124,28 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
4020
4124
|
} : {}
|
|
4021
4125
|
});
|
|
4022
4126
|
};
|
|
4023
|
-
if (n) return /* @__PURE__ */
|
|
4127
|
+
if (n) return /* @__PURE__ */ M("div", {
|
|
4024
4128
|
className: "my-2",
|
|
4025
|
-
children: /* @__PURE__ */
|
|
4129
|
+
children: /* @__PURE__ */ M("button", {
|
|
4026
4130
|
type: "button",
|
|
4027
4131
|
className: si,
|
|
4028
4132
|
onClick: () => window.open(n, "_blank", "noopener,noreferrer"),
|
|
4029
4133
|
children: r
|
|
4030
4134
|
})
|
|
4031
4135
|
});
|
|
4032
|
-
if (!l.isLoading && l.tickets.length === 0) return /* @__PURE__ */
|
|
4136
|
+
if (!l.isLoading && l.tickets.length === 0) return /* @__PURE__ */ M(li, { hasFailed: l.hasFailed });
|
|
4033
4137
|
let A = v ? v.isFree ? "Save my spot" : `Pay ${Z({
|
|
4034
4138
|
unit_amount: v.amount,
|
|
4035
4139
|
currency: v.currency
|
|
4036
4140
|
})}` : "Choose a ticket";
|
|
4037
|
-
return /* @__PURE__ */
|
|
4141
|
+
return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(ci, {
|
|
4038
4142
|
buttonText: r,
|
|
4039
4143
|
registeredEmail: p.registeredEmail,
|
|
4040
4144
|
isSheetOpen: h.isOpen,
|
|
4041
4145
|
isLoading: l.isLoading,
|
|
4042
4146
|
onOpen: h.open,
|
|
4043
4147
|
onRegisterAnother: E
|
|
4044
|
-
}), /* @__PURE__ */
|
|
4148
|
+
}), /* @__PURE__ */ M(oi, {
|
|
4045
4149
|
open: h.isOpen,
|
|
4046
4150
|
title: m ? S : `Register for ${S}`,
|
|
4047
4151
|
when: x,
|
|
@@ -4053,12 +4157,12 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
4053
4157
|
initialFocusRef: b ? void 0 : g,
|
|
4054
4158
|
layers: w.checkoutElement,
|
|
4055
4159
|
onSubmit: m ? void 0 : D,
|
|
4056
|
-
footer: m ? void 0 : /* @__PURE__ */
|
|
4160
|
+
footer: m ? void 0 : /* @__PURE__ */ M(Xr, {
|
|
4057
4161
|
payment: w,
|
|
4058
4162
|
label: A,
|
|
4059
4163
|
isPaid: y
|
|
4060
4164
|
}),
|
|
4061
|
-
children: m ? /* @__PURE__ */
|
|
4165
|
+
children: m ? /* @__PURE__ */ M(pi, {
|
|
4062
4166
|
email: d.values.email.trim(),
|
|
4063
4167
|
eventTitle: S,
|
|
4064
4168
|
startsAt: i,
|
|
@@ -4070,35 +4174,33 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
4070
4174
|
invoiceUrl: m.invoice?.location,
|
|
4071
4175
|
onClose: h.close,
|
|
4072
4176
|
onRegisterAnother: E
|
|
4073
|
-
}) : /* @__PURE__ */
|
|
4177
|
+
}) : /* @__PURE__ */ N("div", {
|
|
4074
4178
|
className: "flex flex-col gap-4",
|
|
4075
4179
|
children: [
|
|
4076
|
-
b && /* @__PURE__ */
|
|
4180
|
+
b && /* @__PURE__ */ M(Yi, {
|
|
4077
4181
|
tickets: l.tickets,
|
|
4078
4182
|
selectedTicket: l.selectedTicket,
|
|
4079
4183
|
onSelect: T,
|
|
4080
4184
|
error: d.submitAttempted && !l.selectedTicket ? "Choose a ticket to continue" : void 0
|
|
4081
4185
|
}),
|
|
4082
|
-
|
|
4186
|
+
f && /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(Ji, {
|
|
4083
4187
|
selectedTicket: l.selectedTicket,
|
|
4084
4188
|
discount: _.discount
|
|
4085
|
-
}), /* @__PURE__ */
|
|
4086
|
-
|
|
4087
|
-
|
|
4189
|
+
}), /* @__PURE__ */ M(Qr, {
|
|
4190
|
+
applied: _.applied,
|
|
4191
|
+
pending: _.pending,
|
|
4088
4192
|
couponError: _.error,
|
|
4089
|
-
couponLoading: _.isLoading,
|
|
4090
4193
|
onValidateCoupon: _.apply,
|
|
4091
4194
|
onRemoveCoupon: _.reset,
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
tickets: l.selectedTicket ? [l.selectedTicket] : []
|
|
4195
|
+
offers: _.offers,
|
|
4196
|
+
currency: l.selectedTicket?.currency
|
|
4095
4197
|
})] }),
|
|
4096
|
-
/* @__PURE__ */
|
|
4198
|
+
/* @__PURE__ */ N("div", {
|
|
4097
4199
|
className: X("flex flex-col gap-4", C && "border-border border-t pt-4"),
|
|
4098
|
-
children: [C && /* @__PURE__ */
|
|
4200
|
+
children: [C && /* @__PURE__ */ M("span", {
|
|
4099
4201
|
className: "font-medium text-ink text-sm",
|
|
4100
4202
|
children: "Your details"
|
|
4101
|
-
}), /* @__PURE__ */
|
|
4203
|
+
}), /* @__PURE__ */ M(Ir, {
|
|
4102
4204
|
values: d.values,
|
|
4103
4205
|
errors: d.errors,
|
|
4104
4206
|
touched: d.touched,
|
|
@@ -4112,7 +4214,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
4112
4214
|
]
|
|
4113
4215
|
})
|
|
4114
4216
|
})] });
|
|
4115
|
-
},
|
|
4217
|
+
}, Qi = (e) => e.length > 1 ? e.replace(/\/+$/, "") : e, $i = (e) => typeof e == "string" && e.trim() ? e : void 0, ea = (e) => typeof e == "string" ? e : e?.location ?? void 0, ta = (e, t) => {
|
|
4116
4218
|
let n = e.meta ?? {}, r = e.title && t ? `${e.title} | ${t}` : e.title || t || void 0;
|
|
4117
4219
|
return {
|
|
4118
4220
|
title: n.meta_title || r,
|
|
@@ -4122,32 +4224,32 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
4122
4224
|
og: {
|
|
4123
4225
|
title: n.og_title || void 0,
|
|
4124
4226
|
description: n.og_description || void 0,
|
|
4125
|
-
image:
|
|
4227
|
+
image: ea(n.og_image),
|
|
4126
4228
|
url: n.og_url || void 0
|
|
4127
4229
|
},
|
|
4128
4230
|
twitter: { card: n.twitter_card || void 0 },
|
|
4129
4231
|
ldJson: n.ld_json || void 0,
|
|
4130
4232
|
customHead: n.head_code || void 0
|
|
4131
4233
|
};
|
|
4132
|
-
},
|
|
4234
|
+
}, na = (e) => ({
|
|
4133
4235
|
description: e.description || void 0,
|
|
4134
4236
|
customHead: e.settings?.head_code || void 0
|
|
4135
|
-
}),
|
|
4136
|
-
let i =
|
|
4237
|
+
}), ra = (e) => (t = {}, n) => (r) => {
|
|
4238
|
+
let i = ta(t, e.name);
|
|
4137
4239
|
if (n) {
|
|
4138
4240
|
let t = r?.loaderData?.[n.source];
|
|
4139
4241
|
if (t) {
|
|
4140
|
-
let r = n.title ?
|
|
4242
|
+
let r = n.title ? $i(t[n.title]) : void 0;
|
|
4141
4243
|
r && (i.title = e.name ? `${r} | ${e.name}` : r, i.og = {
|
|
4142
4244
|
...i.og,
|
|
4143
4245
|
title: r
|
|
4144
4246
|
});
|
|
4145
|
-
let a = n.description ?
|
|
4247
|
+
let a = n.description ? $i(t[n.description]) : void 0;
|
|
4146
4248
|
a && (i.description = a, i.og = {
|
|
4147
4249
|
...i.og,
|
|
4148
4250
|
description: a
|
|
4149
4251
|
});
|
|
4150
|
-
let o = n.image ?
|
|
4252
|
+
let o = n.image ? ea(t[n.image]) : void 0;
|
|
4151
4253
|
o && (i.og = {
|
|
4152
4254
|
...i.og,
|
|
4153
4255
|
image: o
|
|
@@ -4156,31 +4258,31 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
4156
4258
|
}
|
|
4157
4259
|
if (!i.canonical) {
|
|
4158
4260
|
let t = r?.match?.pathname, n = (e.domain || "").trim();
|
|
4159
|
-
n && t?.startsWith("/") && (i.canonical = (/^https?:\/\//.test(n) ? n : `https://${n}`).replace(/\/+$/, "") +
|
|
4261
|
+
n && t?.startsWith("/") && (i.canonical = (/^https?:\/\//.test(n) ? n : `https://${n}`).replace(/\/+$/, "") + Qi(t));
|
|
4160
4262
|
}
|
|
4161
|
-
let a =
|
|
4263
|
+
let a = Dr(i, na(e)), o = t.id?.trim();
|
|
4162
4264
|
return o && a.meta.push({
|
|
4163
|
-
name:
|
|
4265
|
+
name: nr,
|
|
4164
4266
|
content: o
|
|
4165
4267
|
}), a;
|
|
4166
|
-
},
|
|
4167
|
-
let t =
|
|
4268
|
+
}, ia = (e) => e.params, aa = (e) => {
|
|
4269
|
+
let t = Ne(e);
|
|
4168
4270
|
return (e, n) => {
|
|
4169
|
-
let { rules: r, invalid: i } =
|
|
4170
|
-
return (n) => a ? Promise.resolve({}) :
|
|
4271
|
+
let { rules: r, invalid: i } = Te(n?.access), a = r.length > 0 || i;
|
|
4272
|
+
return (n) => a ? Promise.resolve({}) : $e({
|
|
4171
4273
|
queryClient: n.context.queryClient,
|
|
4172
4274
|
config: t,
|
|
4173
4275
|
sources: e,
|
|
4174
|
-
params:
|
|
4276
|
+
params: ia(n)
|
|
4175
4277
|
});
|
|
4176
4278
|
};
|
|
4177
|
-
},
|
|
4178
|
-
let { limit: t = 20, debounceMs: n = 300, hotkey: r = !0 } = e ?? {}, a = i(), o =
|
|
4279
|
+
}, oa = 2, sa = (e) => {
|
|
4280
|
+
let { limit: t = 20, debounceMs: n = 300, hotkey: r = !0 } = e ?? {}, a = i(), o = cr(), s = K(), [c, l] = A(""), [u, d] = A(!1), [f, p] = A("");
|
|
4179
4281
|
E(() => {
|
|
4180
4282
|
let e = setTimeout(() => p(c.trim()), n);
|
|
4181
4283
|
return () => clearTimeout(e);
|
|
4182
4284
|
}, [c, n]);
|
|
4183
|
-
let m = f.length >=
|
|
4285
|
+
let m = f.length >= oa, h = L({
|
|
4184
4286
|
queryKey: [
|
|
4185
4287
|
"levo-search",
|
|
4186
4288
|
o?.id ?? null,
|
|
@@ -4200,7 +4302,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
4200
4302
|
}
|
|
4201
4303
|
},
|
|
4202
4304
|
enabled: s && !!a && !!o?.id && m,
|
|
4203
|
-
placeholderData:
|
|
4305
|
+
placeholderData: F,
|
|
4204
4306
|
staleTime: 3e4
|
|
4205
4307
|
}), g = w(() => {
|
|
4206
4308
|
l(""), p("");
|
|
@@ -4229,4 +4331,4 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
|
|
|
4229
4331
|
};
|
|
4230
4332
|
};
|
|
4231
4333
|
//#endregion
|
|
4232
|
-
export {
|
|
4334
|
+
export { Bt as ColorModeProvider, Zn as Inspector, _e as LEVO_AUTH_METHODS, q as LEVO_AUTH_QUERY_KEY, ge as LEVO_OAUTH_METHODS, Tt as LEVO_OTP_LENGTH, ht as LEVO_PENDING_APPROVAL_CODE, he as LEVO_PRIMARY_AUTH_METHODS, m as LOCALE_COOKIE, l as LOCALE_REDIRECT_CACHE_CONTROL, Mt as LevoChat, Ut as LevoEditForm, rt as LevoEntryForm, Xi as LevoEventRegister, Wt as LevoForm, gr as LevoLink, ar as LevoPopups, ct as LevoProfileForm, dr as LevoSiteProvider, _r as LocaleHreflang, yr as LocaleProvider, nr as PAGE_ID_META, Or as PageHead, Sr as SiteLocaleProvider, hr as buildHreflangLinks, ra as createLevoHead, aa as createLevoLoader, _ as createRouteTreeMatcher, Me as createSiteClient, je as decideAccess, v as extractGeoAndLanguageData, gt as isPendingApprovalError, Et as isValidEmail, Dt as isValidOtp, kt as isValidPhone, ze as levoParams, fr as localeBeforeLoad, p as localePath, d as localeRedirectResponse, Ot as normalizePhone, Dr as pageHead, Te as parseAccess, Er as parseRawHead, $e as prefetchLevoSources, pr as readLocaleConfig, rr as readPageId, Ee as resolveAuthMethods, g as resolveLocale, u as resolveLocaleRedirect, s as resolveLocaleRequest, Ne as siteConfigFromJson, f as splitLocalePrefix, Vt as useColorMode, Cr as useLanguageOptions, mt as useLevoAccess, nt as useLevoAuth, Ze as useLevoForm, ur as useLevoInsights, yt as useLevoLogin, wt as useLevoOAuth, At as useLevoOtpInput, Xe as useLevoRecord, sa as useLevoSearch, lr as useLevoSite, Ye as useLevoSource, br as useLocale, xr as useUrlLocale };
|