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