@levo-so/site-runtime 0.3.12 → 0.3.14
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/{KBChatWidget-CXIsQEgj.js → KBChatWidget-DCj3mo3P.js} +280 -211
- package/{PopupBody-BI-MJqmd-Dy94OeBQ.js → PopupBody-BI-MJqmd-DgTQEzda.js} +1 -1
- package/{PopupRenderer-D66Gx63H-DkprAQH7.js → PopupRenderer-D66Gx63H-Cd9xJv33.js} +1 -1
- package/blog-content.js +93 -77
- package/{dist-B7c9xjWu.js → dist-6AIgW_iB.js} +1 -1
- package/{dist-1r8apbDv.js → dist-CEdznbFW.js} +3 -3
- package/index.d.ts +10 -1
- package/index.js +285 -282
- package/{kbChat-jqrzqmaT.js → kbChat-BIzoQwEC.js} +1 -1
- package/package.json +4 -4
- package/popups.js +1 -1
- package/styles.css +1 -1
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { i as e, n as t } from "./dist-
|
|
2
|
+
import { i as e, n as t } from "./dist-CEdznbFW.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";
|
|
@@ -157,7 +157,7 @@ var ue = [
|
|
|
157
157
|
let r = t.module === "collection" ? await e.collection.getCollectionContentList({
|
|
158
158
|
collection_key: t.identifier,
|
|
159
159
|
...t.query ?? {}
|
|
160
|
-
}) : t.module === "blog" ? await e.blog.getAllBlogs(t.identifier, t.query ?? {}) : await e.event.getAllEvents(t.identifier, t.query ?? {});
|
|
160
|
+
}) : t.module === "blog" ? await e.blog.getAllBlogs(t.identifier, t.query ?? {}, { workspace_id: e.workspace ?? "" }) : await e.event.getAllEvents(t.identifier, t.query ?? {}, { workspace_id: e.workspace ?? "" });
|
|
161
161
|
return {
|
|
162
162
|
data: r.content.data ?? [],
|
|
163
163
|
meta: r.content.meta ?? null
|
|
@@ -167,7 +167,7 @@ var ue = [
|
|
|
167
167
|
return r ? (await e.fetch.url(r).get().json()).content.data ?? null : (t.module === "collection" ? await e.collection.getCollectionContent({
|
|
168
168
|
collection_key: t.identifier,
|
|
169
169
|
slug: n
|
|
170
|
-
}) : t.module === "blog" ? await e.blog.getSingleBlog(t.identifier, n) : await e.event.getSingleEvent(n)).content.data ?? null;
|
|
170
|
+
}) : t.module === "blog" ? await e.blog.getSingleBlog(t.identifier, n, { workspace_id: e.workspace ?? "" }) : await e.event.getSingleEvent(n, { workspace_id: e.workspace ?? "" })).content.data ?? null;
|
|
171
171
|
}, Pe = async (e, t) => (await e.collection.getCollectionByIDExpanded(t.identifier)).content.data ?? null, Fe = (e) => {
|
|
172
172
|
let t = i(), n = z({
|
|
173
173
|
queryKey: De(e),
|
|
@@ -214,12 +214,15 @@ var ue = [
|
|
|
214
214
|
...e
|
|
215
215
|
}) }
|
|
216
216
|
};
|
|
217
|
-
}, Re =
|
|
217
|
+
}, Re = (e) => {
|
|
218
|
+
let t = Object.values(e ?? {});
|
|
219
|
+
return t.length === 1 ? t[0] : e?.slug;
|
|
220
|
+
}, ze = async ({ queryClient: e, config: t, sources: n, params: r }) => {
|
|
218
221
|
let i = Te(t);
|
|
219
222
|
if (!i || !n) return {};
|
|
220
223
|
let a = await Promise.all(Object.entries(n).map(async ([t, n]) => {
|
|
221
224
|
if (n.mode === "record") {
|
|
222
|
-
let a = r?.
|
|
225
|
+
let a = n.param ? r?.[n.param] : Re(r);
|
|
223
226
|
return a ? [t, await e.ensureQueryData({
|
|
224
227
|
queryKey: Oe(n, a),
|
|
225
228
|
queryFn: () => Ne(i, n, a)
|
|
@@ -234,7 +237,7 @@ var ue = [
|
|
|
234
237
|
}).catch(() => null)];
|
|
235
238
|
}));
|
|
236
239
|
return Object.fromEntries(a);
|
|
237
|
-
},
|
|
240
|
+
}, Be = {
|
|
238
241
|
background: "var(--color-page)",
|
|
239
242
|
foreground: "var(--color-ink)",
|
|
240
243
|
text: "var(--color-ink)",
|
|
@@ -256,10 +259,10 @@ var ue = [
|
|
|
256
259
|
input: "var(--color-background1)",
|
|
257
260
|
inputForeground: "var(--color-ink)",
|
|
258
261
|
ring: "var(--color-brand)"
|
|
259
|
-
},
|
|
262
|
+
}, Ve = (e) => M(() => ({
|
|
260
263
|
...o({
|
|
261
264
|
colors: {
|
|
262
|
-
...
|
|
265
|
+
...Be,
|
|
263
266
|
...e?.colors
|
|
264
267
|
},
|
|
265
268
|
radius: e?.radius ?? "var(--radius-token)",
|
|
@@ -278,7 +281,7 @@ function J() {
|
|
|
278
281
|
}
|
|
279
282
|
//#endregion
|
|
280
283
|
//#region src/access/useLevoAuth.ts
|
|
281
|
-
var Y = ["levo-auth", "session"],
|
|
284
|
+
var Y = ["levo-auth", "session"], He = () => {
|
|
282
285
|
let e = i(), t = B(), n = J(), r = z({
|
|
283
286
|
queryKey: Y,
|
|
284
287
|
queryFn: async () => {
|
|
@@ -313,11 +316,11 @@ var Y = ["levo-auth", "session"], Ve = () => {
|
|
|
313
316
|
signOut: s,
|
|
314
317
|
isSigningOut: a.isPending
|
|
315
318
|
};
|
|
316
|
-
},
|
|
317
|
-
let c = i(), { account: l } =
|
|
319
|
+
}, Ue = ({ collection: e, hidden: n, submitLabel: r = "Submit", onSuccess: a, theme: o, className: s }) => {
|
|
320
|
+
let c = i(), { account: l } = He(), { schema: u, isLoading: d } = Le({
|
|
318
321
|
module: "collection",
|
|
319
322
|
identifier: e
|
|
320
|
-
}), f =
|
|
323
|
+
}), f = Ve(o);
|
|
321
324
|
return c ? /* @__PURE__ */ S("div", {
|
|
322
325
|
className: s,
|
|
323
326
|
children: /* @__PURE__ */ S(t, {
|
|
@@ -341,17 +344,17 @@ var Y = ["levo-auth", "session"], Ve = () => {
|
|
|
341
344
|
onSuccess: () => a?.()
|
|
342
345
|
})
|
|
343
346
|
}) : null;
|
|
344
|
-
},
|
|
347
|
+
}, We = "so_levo_membership_account", Ge = [
|
|
345
348
|
"profile_picture",
|
|
346
349
|
"first_name",
|
|
347
350
|
"last_name",
|
|
348
351
|
"email",
|
|
349
352
|
"username",
|
|
350
353
|
"socials"
|
|
351
|
-
],
|
|
352
|
-
let c = i(), l = J(), { account: u } =
|
|
354
|
+
], Ke = ["email", "username"], qe = (e) => Ge.includes(e.key) || e.editable === !0, Je = ({ hidden: t, submitLabel: n = "Save and continue", onSuccess: r, errorClassName: a = "text-sm text-[var(--color-danger)]", theme: o, className: s }) => {
|
|
355
|
+
let c = i(), l = J(), { account: u } = He(), d = Ve(o), [f, p] = P(""), m = z({
|
|
353
356
|
queryKey: ["levo-access", "profile-schema"],
|
|
354
|
-
queryFn: async () => (await c?.collection?.getCollectionByIDExpanded(
|
|
357
|
+
queryFn: async () => (await c?.collection?.getCollectionByIDExpanded(We))?.content?.data ?? null,
|
|
355
358
|
enabled: l && !!c,
|
|
356
359
|
staleTime: 5 * 6e4,
|
|
357
360
|
retry: 1
|
|
@@ -363,14 +366,14 @@ var Y = ["levo-auth", "session"], Ve = () => {
|
|
|
363
366
|
...e,
|
|
364
367
|
fields: e.fields?.map((e) => ({
|
|
365
368
|
...e,
|
|
366
|
-
hidden: !
|
|
367
|
-
readonly: e.readonly ||
|
|
369
|
+
hidden: !qe(e) || !!t?.includes(e.key),
|
|
370
|
+
readonly: e.readonly || Ke.includes(e.key)
|
|
368
371
|
}))
|
|
369
372
|
}))
|
|
370
373
|
} : null;
|
|
371
374
|
}, [m.data, h]), _ = R({
|
|
372
375
|
mutationFn: async (e) => {
|
|
373
|
-
let n = g?.sections?.flatMap((e) => e?.fields ?? [])?.filter((e) =>
|
|
376
|
+
let n = g?.sections?.flatMap((e) => e?.fields ?? [])?.filter((e) => qe(e) && !Ke.includes(e.key) && !t?.includes(e.key))?.map((e) => e?.key) ?? [];
|
|
374
377
|
await c?.membership?.updateMe(Object.fromEntries(Object.entries(e).filter(([e]) => n.includes(e))));
|
|
375
378
|
},
|
|
376
379
|
onMutate: () => p(""),
|
|
@@ -401,15 +404,15 @@ var Y = ["levo-auth", "session"], Ve = () => {
|
|
|
401
404
|
onSubmit: (e) => _.mutate(e)
|
|
402
405
|
}) : null]
|
|
403
406
|
}) : null;
|
|
404
|
-
},
|
|
405
|
-
if (
|
|
406
|
-
|
|
407
|
-
for (let e of
|
|
407
|
+
}, Ye = null, Xe = /* @__PURE__ */ new Set(), Ze = (e) => {
|
|
408
|
+
if (Ye !== e) {
|
|
409
|
+
Ye = e;
|
|
410
|
+
for (let e of Xe) e();
|
|
408
411
|
}
|
|
409
|
-
},
|
|
410
|
-
|
|
411
|
-
}),
|
|
412
|
-
let t = i(), n = B(), r = J(), { isLoggedIn: a, isLoaded: o } =
|
|
412
|
+
}, Qe = (e) => (Xe.add(e), () => {
|
|
413
|
+
Xe.delete(e);
|
|
414
|
+
}), $e = () => F(Qe, () => Ye, () => null), et = (e) => {
|
|
415
|
+
let t = i(), n = B(), r = J(), { isLoggedIn: a, isLoaded: o } = He(), s = $e(), c = e.id?.trim() || "", { rules: l, invalid: u } = M(() => ve(e.access), [e.access]), d = M(() => ye(l), [l]), f = r && !!t && l.length > 0 && !u && !!c && a && !s, p = z({
|
|
413
416
|
queryKey: ["levo-access", c],
|
|
414
417
|
queryFn: async () => (await t?.fetch.url(`/v1/builder/page/${c}/check-access`).post().json())?.content?.data ?? null,
|
|
415
418
|
enabled: f,
|
|
@@ -445,26 +448,26 @@ var Y = ["levo-auth", "session"], Ve = () => {
|
|
|
445
448
|
recheck: m,
|
|
446
449
|
isChecking: p.isFetching
|
|
447
450
|
};
|
|
448
|
-
},
|
|
451
|
+
}, tt = "membership.account.ACCOUNT_PENDING_APPROVAL", nt = (e) => e ? e === "membership.account.ACCOUNT_PENDING_APPROVAL" || e.includes("ACCOUNT_PENDING_APPROVAL") : !1, rt = (e) => {
|
|
449
452
|
let t = b(e);
|
|
450
453
|
return {
|
|
451
454
|
code: t?.code || "SOMETHING_WENT_WRONG",
|
|
452
455
|
title: t?.title || "Something went wrong",
|
|
453
456
|
message: t?.message || "Something went wrong. Please try again.",
|
|
454
457
|
fieldErrors: Object.fromEntries((t?.fieldErrors ?? []).map((e) => [e.param, e.message])),
|
|
455
|
-
isPendingApproval:
|
|
458
|
+
isPendingApproval: nt(t?.code)
|
|
456
459
|
};
|
|
457
|
-
},
|
|
460
|
+
}, it = {
|
|
458
461
|
code: "site.NOT_CONNECTED",
|
|
459
462
|
title: "Sign-in unavailable",
|
|
460
463
|
message: "This site is not connected to an account system yet.",
|
|
461
464
|
fieldErrors: {},
|
|
462
465
|
isPendingApproval: !1
|
|
463
|
-
},
|
|
466
|
+
}, at = () => {
|
|
464
467
|
let e = i(), t = B(), n = O(async (t, n) => {
|
|
465
468
|
if (!e?.membership) return {
|
|
466
469
|
ok: !1,
|
|
467
|
-
error:
|
|
470
|
+
error: it
|
|
468
471
|
};
|
|
469
472
|
try {
|
|
470
473
|
return {
|
|
@@ -475,7 +478,7 @@ var Y = ["levo-auth", "session"], Ve = () => {
|
|
|
475
478
|
let r = b(n);
|
|
476
479
|
return e.logger?.error(t, { exception: r }), {
|
|
477
480
|
ok: !1,
|
|
478
|
-
error:
|
|
481
|
+
error: rt(r)
|
|
479
482
|
};
|
|
480
483
|
}
|
|
481
484
|
}, [e]), r = O(async ({ identifier: t, medium: n }) => {
|
|
@@ -502,10 +505,10 @@ var Y = ["levo-auth", "session"], Ve = () => {
|
|
|
502
505
|
isVerifying: s.isPending,
|
|
503
506
|
isSendingMagicLink: c.isPending
|
|
504
507
|
};
|
|
505
|
-
},
|
|
506
|
-
let n = window.screenX + (window.outerWidth -
|
|
507
|
-
return window.open(e, t, `width=${
|
|
508
|
-
},
|
|
508
|
+
}, ot = 700, st = 500, ct = 700, lt = (e, t) => {
|
|
509
|
+
let n = window.screenX + (window.outerWidth - st) / 2, r = window.screenY + (window.outerHeight - ct) / 2.5;
|
|
510
|
+
return window.open(e, t, `width=${st},height=${ct},left=${n},top=${r}`);
|
|
511
|
+
}, ut = ({ methods: e, title: t = "Sign in", onSuccess: n, onError: r }) => {
|
|
509
512
|
let a = i(), o = B(), s = J(), [c, l] = P(null), [u, d] = P(null), f = N(null), p = N(void 0), m = N({
|
|
510
513
|
onSuccess: n,
|
|
511
514
|
onError: r
|
|
@@ -562,10 +565,10 @@ var Y = ["levo-auth", "session"], Ve = () => {
|
|
|
562
565
|
title: t.get("title") || "Sign-in failed",
|
|
563
566
|
message: t.get("message") || "We could not sign you in. Please try again.",
|
|
564
567
|
fieldErrors: {},
|
|
565
|
-
isPendingApproval:
|
|
568
|
+
isPendingApproval: nt(t.get("code"))
|
|
566
569
|
};
|
|
567
570
|
r.isPendingApproval || d(r), m.current.onError?.(r);
|
|
568
|
-
},
|
|
571
|
+
}, ot);
|
|
569
572
|
}, [o, g]), v = M(() => {
|
|
570
573
|
let e = h.data;
|
|
571
574
|
if (!e || typeof window > "u") return {};
|
|
@@ -586,7 +589,7 @@ var Y = ["levo-auth", "session"], Ve = () => {
|
|
|
586
589
|
signIn: () => {
|
|
587
590
|
let n = v[e];
|
|
588
591
|
if (n) {
|
|
589
|
-
if (d(null), f.current?.close(), f.current =
|
|
592
|
+
if (d(null), f.current?.close(), f.current = lt(n, t), !f.current) {
|
|
590
593
|
d({
|
|
591
594
|
code: "POPUP_BLOCKED",
|
|
592
595
|
title: "Popup blocked",
|
|
@@ -610,10 +613,10 @@ var Y = ["levo-auth", "session"], Ve = () => {
|
|
|
610
613
|
error: u,
|
|
611
614
|
clearError: O(() => d(null), [])
|
|
612
615
|
};
|
|
613
|
-
},
|
|
616
|
+
}, dt = 4, ft = (e) => /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(e.trim()), pt = (e) => RegExp("^\\d{4}$").test(e.trim()), mt = (e) => {
|
|
614
617
|
let t = e.replace(/\D/g, "").replace(/^0+/, "");
|
|
615
618
|
return t ? `+${t}` : "";
|
|
616
|
-
},
|
|
619
|
+
}, ht = (e) => /^\+[1-9]\d{7,14}$/.test(mt(e)), gt = ({ value: e, onChange: t, length: n = 4, onComplete: r, autoFocus: i, disabled: a }) => {
|
|
617
620
|
let o = N([]), [s, c] = P(null), l = N(r);
|
|
618
621
|
l.current = r;
|
|
619
622
|
let u = Array.from({ length: n }, (t, n) => e[n] ?? ""), d = O((e) => {
|
|
@@ -697,11 +700,11 @@ var Y = ["levo-auth", "session"], Ve = () => {
|
|
|
697
700
|
},
|
|
698
701
|
clear: O(() => f("", 0), [f])
|
|
699
702
|
};
|
|
700
|
-
},
|
|
703
|
+
}, _t = D(() => import("./kbChat-BIzoQwEC.js")), vt = ({ site: e, path: t }) => {
|
|
701
704
|
let n = J(), r = e.workspace_id || void 0;
|
|
702
705
|
return !n || !r ? null : /* @__PURE__ */ S(T, {
|
|
703
706
|
fallback: null,
|
|
704
|
-
children: /* @__PURE__ */ S(
|
|
707
|
+
children: /* @__PURE__ */ S(_t, {
|
|
705
708
|
workspaceId: r,
|
|
706
709
|
siteName: e.name || void 0,
|
|
707
710
|
siteLogo: void 0,
|
|
@@ -711,61 +714,61 @@ var Y = ["levo-auth", "session"], Ve = () => {
|
|
|
711
714
|
path: t
|
|
712
715
|
})
|
|
713
716
|
});
|
|
714
|
-
},
|
|
717
|
+
}, yt = "(prefers-color-scheme: dark)", bt = (e) => {
|
|
715
718
|
try {
|
|
716
719
|
let t = localStorage.getItem(e);
|
|
717
720
|
return t === "light" || t === "dark" || t === "system" ? t : null;
|
|
718
721
|
} catch {
|
|
719
722
|
return null;
|
|
720
723
|
}
|
|
721
|
-
},
|
|
724
|
+
}, xt = (e, t) => {
|
|
722
725
|
try {
|
|
723
726
|
localStorage.setItem(e, t);
|
|
724
727
|
} catch {}
|
|
725
728
|
};
|
|
726
|
-
function
|
|
727
|
-
return `(function(){try{var t=localStorage.getItem(${JSON.stringify(e)});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${JSON.stringify(t)}}var d=matchMedia('${
|
|
729
|
+
function St(e, t) {
|
|
730
|
+
return `(function(){try{var t=localStorage.getItem(${JSON.stringify(e)});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${JSON.stringify(t)}}var d=matchMedia('${yt}').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){}})();`;
|
|
728
731
|
}
|
|
729
|
-
var
|
|
730
|
-
function
|
|
732
|
+
var Ct = E(void 0), wt = (e) => e === "system" ? window.matchMedia(yt).matches ? "dark" : "light" : e;
|
|
733
|
+
function Tt(e) {
|
|
731
734
|
let t = document.documentElement;
|
|
732
735
|
t.classList.remove("light", "dark"), t.classList.add(e), t.style.colorScheme = e;
|
|
733
736
|
}
|
|
734
|
-
var
|
|
737
|
+
var Et = ({ children: e, defaultMode: t = "system", storageKey: n = "color-mode" }) => {
|
|
735
738
|
let [r, i] = P(t), [a, o] = P(t === "dark" ? "dark" : "light"), s = J();
|
|
736
739
|
return A(() => {
|
|
737
|
-
i(
|
|
740
|
+
i(bt(n) ?? t);
|
|
738
741
|
}, [t, n]), A(() => {
|
|
739
742
|
if (!s) return;
|
|
740
|
-
let e =
|
|
741
|
-
|
|
743
|
+
let e = wt(r);
|
|
744
|
+
Tt(e), o(e);
|
|
742
745
|
}, [r, s]), A(() => {
|
|
743
746
|
if (!s || r !== "system") return;
|
|
744
|
-
let e = window.matchMedia(
|
|
747
|
+
let e = window.matchMedia(yt), t = () => {
|
|
745
748
|
let t = e.matches ? "dark" : "light";
|
|
746
|
-
|
|
749
|
+
Tt(t), o(t);
|
|
747
750
|
};
|
|
748
751
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
749
|
-
}, [r, s]), /* @__PURE__ */ C(
|
|
752
|
+
}, [r, s]), /* @__PURE__ */ C(Ct.Provider, {
|
|
750
753
|
value: {
|
|
751
754
|
mode: r,
|
|
752
755
|
resolvedMode: a,
|
|
753
756
|
setMode: (e) => {
|
|
754
|
-
|
|
757
|
+
xt(n, e), i(e);
|
|
755
758
|
}
|
|
756
759
|
},
|
|
757
|
-
children: [/* @__PURE__ */ S(V, { children:
|
|
760
|
+
children: [/* @__PURE__ */ S(V, { children: St(n, t) }), e]
|
|
758
761
|
});
|
|
759
762
|
};
|
|
760
|
-
function
|
|
761
|
-
let e = k(
|
|
763
|
+
function Dt() {
|
|
764
|
+
let e = k(Ct);
|
|
762
765
|
if (e === void 0) throw Error("useColorMode must be used within a ColorModeProvider");
|
|
763
766
|
return e;
|
|
764
767
|
}
|
|
765
768
|
//#endregion
|
|
766
769
|
//#region src/form/LevoForm.tsx
|
|
767
|
-
var
|
|
768
|
-
let m = i(), { schema: h, isLoading: g, bind: _ } = Le(e), v =
|
|
770
|
+
var Ot = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant: a = "default", successConfig: o, theme: s, className: c, defaultValues: l, disabled: u, showSuccessScreen: d = !0, onSuccess: f, onError: p }) => {
|
|
771
|
+
let m = i(), { schema: h, isLoading: g, bind: _ } = Le(e), v = Ve(s);
|
|
769
772
|
return m ? /* @__PURE__ */ S("div", {
|
|
770
773
|
..._,
|
|
771
774
|
className: c,
|
|
@@ -795,28 +798,28 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
795
798
|
onError: p
|
|
796
799
|
})
|
|
797
800
|
}) : null;
|
|
798
|
-
},
|
|
801
|
+
}, kt = 1400, At = 12 * 1024 * 1024, jt = new Set(["transparent", "rgba(0, 0, 0, 0)"]), Mt = {
|
|
799
802
|
imagePlaceholder: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",
|
|
800
803
|
onImageErrorHandler: () => void 0
|
|
801
|
-
}, Mt = (e) => {
|
|
802
|
-
let t = getComputedStyle(e);
|
|
803
|
-
return !At.has(t.backgroundColor) || t.backgroundImage !== "none";
|
|
804
804
|
}, Nt = (e) => {
|
|
805
|
+
let t = getComputedStyle(e);
|
|
806
|
+
return !jt.has(t.backgroundColor) || t.backgroundImage !== "none";
|
|
807
|
+
}, Pt = (e) => {
|
|
805
808
|
for (let t = e; t; t = t.parentElement) {
|
|
806
809
|
let e = getComputedStyle(t).backgroundColor;
|
|
807
|
-
if (!
|
|
810
|
+
if (!jt.has(e)) return e;
|
|
808
811
|
}
|
|
809
812
|
return "#ffffff";
|
|
810
|
-
},
|
|
811
|
-
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,
|
|
812
|
-
...
|
|
813
|
+
}, Ft = async (e, t) => {
|
|
814
|
+
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, kt / i)), o = await n(e, {
|
|
815
|
+
...Mt,
|
|
813
816
|
pixelRatio: a,
|
|
814
|
-
backgroundColor:
|
|
817
|
+
backgroundColor: Pt(e),
|
|
815
818
|
filter: (e) => !t.includes(e)
|
|
816
819
|
});
|
|
817
|
-
if (o.length >
|
|
820
|
+
if (o.length > At) throw Error("capture too large");
|
|
818
821
|
return o;
|
|
819
|
-
},
|
|
822
|
+
}, It = 4, Lt = 4e3, Rt = (e, t) => {
|
|
820
823
|
let n = document.elementFromPoint(e.x + e.width / 2, e.y + e.height / 2);
|
|
821
824
|
for (; n && t.includes(n);) n = n.parentElement;
|
|
822
825
|
let r = document.body;
|
|
@@ -827,8 +830,8 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
827
830
|
break;
|
|
828
831
|
}
|
|
829
832
|
}
|
|
830
|
-
let i = window.innerWidth * window.innerHeight *
|
|
831
|
-
for (; !
|
|
833
|
+
let i = window.innerWidth * window.innerHeight * It || 2 ** 53 - 1, a = r;
|
|
834
|
+
for (; !Nt(a);) {
|
|
832
835
|
let e = a.parentElement;
|
|
833
836
|
if (!e || e === document.documentElement) break;
|
|
834
837
|
let t = e.getBoundingClientRect();
|
|
@@ -836,13 +839,13 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
836
839
|
a = e;
|
|
837
840
|
}
|
|
838
841
|
return a;
|
|
839
|
-
},
|
|
840
|
-
let { toCanvas: n } = await import("./es-ByBbirnH.js"), r =
|
|
841
|
-
o = Math.min(o,
|
|
842
|
+
}, zt = async (e, t) => {
|
|
843
|
+
let { toCanvas: n } = await import("./es-ByBbirnH.js"), r = Rt(e, t), i = r.getBoundingClientRect(), a = Math.max(e.width, e.height, 1), o = Math.min(2, Math.max(.4, kt / a)), s = Math.max(i.width, i.height, 1);
|
|
844
|
+
o = Math.min(o, Lt / s);
|
|
842
845
|
let c = await n(r, {
|
|
843
|
-
...
|
|
846
|
+
...Mt,
|
|
844
847
|
pixelRatio: o,
|
|
845
|
-
backgroundColor:
|
|
848
|
+
backgroundColor: Pt(r),
|
|
846
849
|
filter: (e) => !t.includes(e)
|
|
847
850
|
}), l = document.createElement("canvas");
|
|
848
851
|
l.width = Math.max(1, Math.round(e.width * o)), l.height = Math.max(1, Math.round(e.height * o));
|
|
@@ -850,9 +853,9 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
850
853
|
if (!u) throw Error("no 2d context");
|
|
851
854
|
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);
|
|
852
855
|
let d = l.toDataURL("image/png");
|
|
853
|
-
if (d.length >
|
|
856
|
+
if (d.length > At) throw Error("capture too large");
|
|
854
857
|
return d;
|
|
855
|
-
},
|
|
858
|
+
}, Bt = {
|
|
856
859
|
ring: 99997,
|
|
857
860
|
overlay: 99998,
|
|
858
861
|
label: 99999
|
|
@@ -865,24 +868,24 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
865
868
|
}, Z = (e) => {
|
|
866
869
|
let t = e?.getAttribute("data-tsd-source");
|
|
867
870
|
return t ? t.replace(/^\//, "") : null;
|
|
868
|
-
},
|
|
869
|
-
let n =
|
|
871
|
+
}, Vt = (e) => Array.from(document.querySelectorAll("[data-tsd-source]")).filter((t) => Z(t) === e), Ht = (e, t) => {
|
|
872
|
+
let n = Vt(t).indexOf(e);
|
|
870
873
|
return n < 0 ? 0 : n;
|
|
871
|
-
},
|
|
872
|
-
let n =
|
|
874
|
+
}, Ut = (e, t = 0) => {
|
|
875
|
+
let n = Vt(e);
|
|
873
876
|
return n[t] ?? n[0] ?? null;
|
|
874
|
-
},
|
|
877
|
+
}, Wt = (e, t) => {
|
|
875
878
|
let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter(Boolean);
|
|
876
879
|
n.includes(t) || e.setAttribute("data-staged-key", [...n, t].join(" "));
|
|
877
|
-
},
|
|
880
|
+
}, Gt = (e, t) => {
|
|
878
881
|
let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter((e) => e && e !== t);
|
|
879
882
|
n.length ? e.setAttribute("data-staged-key", n.join(" ")) : e.removeAttribute("data-staged-key");
|
|
880
|
-
},
|
|
883
|
+
}, Kt = (e, t) => {
|
|
881
884
|
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("");
|
|
882
885
|
if (!n) return "";
|
|
883
886
|
let r = `[data-staged-key~="${CSS.escape(e)}"]{${n}}`, i = t.media?.replace(/[;{}]/g, "").trim();
|
|
884
887
|
return i ? `@media ${i}{${r}}` : r;
|
|
885
|
-
},
|
|
888
|
+
}, qt = (e) => {
|
|
886
889
|
let t = e.tagName.toLowerCase();
|
|
887
890
|
return t === "input" ? {
|
|
888
891
|
checkbox: "Checkbox",
|
|
@@ -924,31 +927,31 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
924
927
|
aside: "Sidebar",
|
|
925
928
|
div: "Container"
|
|
926
929
|
}[t] || `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
|
|
927
|
-
},
|
|
928
|
-
let t =
|
|
929
|
-
return n ? `${t} · ${n.length >
|
|
930
|
-
},
|
|
930
|
+
}, Jt = 36, Yt = (e) => {
|
|
931
|
+
let t = qt(e), n = ((e) => e.replace(/\s+/g, " ").trim())(e.getAttribute("aria-label") || e.getAttribute("alt") || e.getAttribute("title") || e.getAttribute("name") || "");
|
|
932
|
+
return n ? `${t} · ${n.length > Jt ? `${n.slice(0, Jt - 1).trimEnd()}…` : n}` : t;
|
|
933
|
+
}, Xt = (e) => {
|
|
931
934
|
let t = [], n = e;
|
|
932
935
|
for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) t.unshift(n.tagName.toLowerCase()), n = n.parentElement;
|
|
933
936
|
return t.join(" > ");
|
|
934
|
-
},
|
|
937
|
+
}, Zt = () => {
|
|
935
938
|
let e = document.createElement("div");
|
|
936
|
-
e.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
939
|
+
e.style.cssText = `position:fixed;pointer-events:none;z-index:${Bt.overlay};background:${X.hoverBg};outline:2px solid ${X.hover};border-radius:2px;display:none`;
|
|
937
940
|
let t = document.createElement("div");
|
|
938
|
-
t.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
941
|
+
t.style.cssText = `position:fixed;pointer-events:none;z-index:${Bt.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`;
|
|
939
942
|
let n = document.createElement("div");
|
|
940
|
-
n.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
943
|
+
n.style.cssText = `position:fixed;pointer-events:none;z-index:${Bt.ring};outline:2px solid ${X.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 4px ${X.selectGlow};display:none`;
|
|
941
944
|
let r = document.createElement("div");
|
|
942
|
-
return r.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
945
|
+
return r.style.cssText = `position:fixed;pointer-events:none;z-index:${Bt.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`, {
|
|
943
946
|
overlay: e,
|
|
944
947
|
label: t,
|
|
945
948
|
ring: n,
|
|
946
949
|
ringLabel: r
|
|
947
950
|
};
|
|
948
|
-
},
|
|
951
|
+
}, Qt = (e, t, n) => {
|
|
949
952
|
let r = n.getBoundingClientRect();
|
|
950
|
-
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 =
|
|
951
|
-
},
|
|
953
|
+
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 = Yt(n), t.style.left = `${Math.max(4, r.left)}px`, t.style.top = `${r.top > 26 ? r.top - 22 : r.bottom + 4}px`;
|
|
954
|
+
}, $t = (e) => {
|
|
952
955
|
let t = (e instanceof Element ? e : null)?.closest("a[href]");
|
|
953
956
|
if (!t || t.target === "_blank") return null;
|
|
954
957
|
let n;
|
|
@@ -958,11 +961,11 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
958
961
|
return null;
|
|
959
962
|
}
|
|
960
963
|
return n.protocol !== "http:" && n.protocol !== "https:" || n.origin === location.origin ? null : n.href;
|
|
961
|
-
},
|
|
964
|
+
}, en = (e) => {
|
|
962
965
|
if (!e) return !1;
|
|
963
966
|
let t = e.tagName;
|
|
964
967
|
return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable === !0;
|
|
965
|
-
},
|
|
968
|
+
}, tn = (e) => {
|
|
966
969
|
if (!e.childNodes.length) return !1;
|
|
967
970
|
let t = !1;
|
|
968
971
|
for (let n of e.childNodes) {
|
|
@@ -970,7 +973,7 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
970
973
|
(n.textContent ?? "").trim() && (t = !0);
|
|
971
974
|
}
|
|
972
975
|
return t;
|
|
973
|
-
},
|
|
976
|
+
}, nn = 2e3, rn = (e) => {
|
|
974
977
|
let t = [], n = e;
|
|
975
978
|
for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) {
|
|
976
979
|
let e = Z(n);
|
|
@@ -981,22 +984,22 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
981
984
|
}), n = n.parentElement;
|
|
982
985
|
}
|
|
983
986
|
return t;
|
|
984
|
-
},
|
|
985
|
-
let t = Z(e), n = t ?
|
|
987
|
+
}, an = (e) => {
|
|
988
|
+
let t = Z(e), n = t ? Vt(t).length : 1, r = t ? Ht(e, t) : 0, i = t && tn(e) ? (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, nn) : void 0, a = on(e);
|
|
986
989
|
return {
|
|
987
990
|
tag: e.tagName.toLowerCase(),
|
|
988
991
|
classes: typeof e.className == "string" ? e.className.trim() : "",
|
|
989
992
|
text: (e.innerText || "").trim().slice(0, 120),
|
|
990
|
-
label:
|
|
991
|
-
path:
|
|
993
|
+
label: Yt(e),
|
|
994
|
+
path: Xt(e),
|
|
992
995
|
source: t,
|
|
993
996
|
index: r,
|
|
994
997
|
occurrences: n,
|
|
995
|
-
ancestors:
|
|
998
|
+
ancestors: rn(e),
|
|
996
999
|
...i === void 0 ? {} : { fullText: i },
|
|
997
1000
|
...a ? { sourceBinding: a } : {}
|
|
998
1001
|
};
|
|
999
|
-
},
|
|
1002
|
+
}, on = (e) => {
|
|
1000
1003
|
let t = e.closest("[data-levo-source]");
|
|
1001
1004
|
if (!t) return;
|
|
1002
1005
|
let n = t.getAttribute("data-levo-source") ?? "", r = Z(t), i;
|
|
@@ -1009,11 +1012,11 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1009
1012
|
raw: n,
|
|
1010
1013
|
element: {
|
|
1011
1014
|
source: r ?? "",
|
|
1012
|
-
index: r ?
|
|
1015
|
+
index: r ? Ht(t, r) : 0
|
|
1013
1016
|
},
|
|
1014
1017
|
...i === void 0 ? {} : { config: i }
|
|
1015
1018
|
};
|
|
1016
|
-
},
|
|
1019
|
+
}, sn = () => Array.from(document.querySelectorAll("[data-levo-source]")).map((e) => {
|
|
1017
1020
|
let t = e.getAttribute("data-levo-source") ?? "", n = Z(e), r;
|
|
1018
1021
|
try {
|
|
1019
1022
|
r = JSON.parse(t);
|
|
@@ -1024,18 +1027,18 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1024
1027
|
raw: t,
|
|
1025
1028
|
element: {
|
|
1026
1029
|
source: n ?? "",
|
|
1027
|
-
index: n ?
|
|
1030
|
+
index: n ? Ht(e, n) : 0
|
|
1028
1031
|
},
|
|
1029
1032
|
tag: e.tagName.toLowerCase(),
|
|
1030
|
-
label:
|
|
1033
|
+
label: Yt(e),
|
|
1031
1034
|
...r === void 0 ? {} : { config: r }
|
|
1032
1035
|
};
|
|
1033
|
-
}),
|
|
1036
|
+
}), cn = 14, ln = 2e3, un = 100, dn = 48, fn = new Set([
|
|
1034
1037
|
"script",
|
|
1035
1038
|
"style",
|
|
1036
1039
|
"template",
|
|
1037
1040
|
"noscript"
|
|
1038
|
-
]),
|
|
1041
|
+
]), pn = (e, t) => t.includes(e) || e.id === "studio-staged" || fn.has(e.tagName.toLowerCase()), mn = (e) => {
|
|
1039
1042
|
let t = !1, n = 0, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
1040
1043
|
for (let e of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
|
|
1041
1044
|
let t = Z(e);
|
|
@@ -1047,11 +1050,11 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1047
1050
|
for (let t of e.childNodes) {
|
|
1048
1051
|
if (t.nodeType !== 3) continue;
|
|
1049
1052
|
let e = (t.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
1050
|
-
if (e) return e.length >
|
|
1053
|
+
if (e) return e.length > dn ? `${e.slice(0, dn).trimEnd()}…` : e;
|
|
1051
1054
|
}
|
|
1052
1055
|
}, o = (i, s) => {
|
|
1053
1056
|
n++;
|
|
1054
|
-
let c = Z(i), l = a(i), u = Array.from(i.children).filter((t) => !
|
|
1057
|
+
let c = Z(i), l = a(i), u = Array.from(i.children).filter((t) => !pn(t, e)), d = {
|
|
1055
1058
|
tag: i.tagName.toLowerCase(),
|
|
1056
1059
|
...c ? {
|
|
1057
1060
|
source: c,
|
|
@@ -1062,9 +1065,9 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1062
1065
|
childCount: u.length,
|
|
1063
1066
|
children: []
|
|
1064
1067
|
};
|
|
1065
|
-
if (s >=
|
|
1068
|
+
if (s >= cn) return u.length && (t = !0), d;
|
|
1066
1069
|
for (let e of u) {
|
|
1067
|
-
if (d.children.length >=
|
|
1070
|
+
if (d.children.length >= un || n >= ln) {
|
|
1068
1071
|
t = !0;
|
|
1069
1072
|
break;
|
|
1070
1073
|
}
|
|
@@ -1076,7 +1079,7 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1076
1079
|
tree: o(document.body, 0),
|
|
1077
1080
|
truncated: t
|
|
1078
1081
|
};
|
|
1079
|
-
},
|
|
1082
|
+
}, hn = () => {
|
|
1080
1083
|
let e = null;
|
|
1081
1084
|
return {
|
|
1082
1085
|
send: (t) => {
|
|
@@ -1091,7 +1094,7 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1091
1094
|
return !0;
|
|
1092
1095
|
}
|
|
1093
1096
|
};
|
|
1094
|
-
},
|
|
1097
|
+
}, gn = (e) => {
|
|
1095
1098
|
let t = location.pathname, n = () => {
|
|
1096
1099
|
location.pathname !== t && (t = location.pathname, e.onPathChange());
|
|
1097
1100
|
}, r = !1;
|
|
@@ -1111,23 +1114,23 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1111
1114
|
e.__inspectorPatched && e.__orig && (history.pushState = e.__orig), t.__inspectorPatched && t.__orig && (history.replaceState = t.__orig);
|
|
1112
1115
|
}
|
|
1113
1116
|
} };
|
|
1114
|
-
},
|
|
1115
|
-
if (!
|
|
1116
|
-
|
|
1117
|
-
for (let e of
|
|
1117
|
+
}, _n = !1, vn = /* @__PURE__ */ new Set(), yn = () => {
|
|
1118
|
+
if (!_n) {
|
|
1119
|
+
_n = !0;
|
|
1120
|
+
for (let e of vn) e();
|
|
1118
1121
|
}
|
|
1119
|
-
},
|
|
1120
|
-
|
|
1121
|
-
}),
|
|
1122
|
+
}, bn = (e) => (vn.add(e), () => {
|
|
1123
|
+
vn.delete(e);
|
|
1124
|
+
}), xn = () => F(bn, () => _n, () => !1), Sn = (e) => {
|
|
1122
1125
|
let { channel: t, originals: n, staged: r } = e, i = t.send, a = null;
|
|
1123
1126
|
return { onMessage: (o) => {
|
|
1124
1127
|
let s = o.data;
|
|
1125
1128
|
if (!(!s || s.source !== "web-chat") && t.acceptOrigin(o)) {
|
|
1126
|
-
if (
|
|
1129
|
+
if (yn(), s.type === "set-access-preview") Ze(s.stage ?? null);
|
|
1127
1130
|
else if (s.type === "set-inspect") e.setInspect(s.enabled);
|
|
1128
1131
|
else if (s.type === "set-text-edit") e.setTextEdit(s.enabled);
|
|
1129
1132
|
else if (s.type === "revert-text") {
|
|
1130
|
-
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 :
|
|
1133
|
+
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 : Ut(e, t);
|
|
1131
1134
|
i && r != null && (i.textContent = r);
|
|
1132
1135
|
} else if (s.type === "stage-style") {
|
|
1133
1136
|
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;
|
|
@@ -1186,7 +1189,7 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1186
1189
|
}
|
|
1187
1190
|
e.syncDomObserver();
|
|
1188
1191
|
} else if (s.type === "select-element") {
|
|
1189
|
-
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ?
|
|
1192
|
+
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? Ut(t, n) : null;
|
|
1190
1193
|
if (!r) {
|
|
1191
1194
|
i({
|
|
1192
1195
|
type: "select-miss",
|
|
@@ -1202,10 +1205,10 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1202
1205
|
behavior: "smooth"
|
|
1203
1206
|
}), i({
|
|
1204
1207
|
type: "element-selected",
|
|
1205
|
-
element:
|
|
1208
|
+
element: an(r)
|
|
1206
1209
|
});
|
|
1207
1210
|
} else if (s.type === "edit-element") {
|
|
1208
|
-
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ?
|
|
1211
|
+
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? Ut(t, n) : null;
|
|
1209
1212
|
if (!r) {
|
|
1210
1213
|
i({
|
|
1211
1214
|
type: "select-miss",
|
|
@@ -1221,12 +1224,12 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1221
1224
|
behavior: "smooth"
|
|
1222
1225
|
}), i({
|
|
1223
1226
|
type: "element-selected",
|
|
1224
|
-
element:
|
|
1227
|
+
element: an(r)
|
|
1225
1228
|
}), e.isTextEditing() || e.setTextEdit(!0);
|
|
1226
1229
|
let o = e.editableTarget(r);
|
|
1227
1230
|
o && e.startEditAtEnd(o);
|
|
1228
1231
|
} else if (s.type === "highlight-element") {
|
|
1229
|
-
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ?
|
|
1232
|
+
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? Ut(t, n) : null;
|
|
1230
1233
|
if (!r) a = null, e.hideTextHover(), i({
|
|
1231
1234
|
type: "highlight-miss",
|
|
1232
1235
|
element: {
|
|
@@ -1244,7 +1247,7 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1244
1247
|
}
|
|
1245
1248
|
} else if (s.type === "clear-highlight") a && (a = null, !e.isInspecting() && !e.editingNode() && e.hideTextHover());
|
|
1246
1249
|
else if (s.type === "request-layers") {
|
|
1247
|
-
let { tree: t, truncated: n } =
|
|
1250
|
+
let { tree: t, truncated: n } = mn(e.ownNodes);
|
|
1248
1251
|
i({
|
|
1249
1252
|
type: "layers-tree",
|
|
1250
1253
|
tree: t,
|
|
@@ -1252,7 +1255,7 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1252
1255
|
});
|
|
1253
1256
|
} else if (s.type === "request-sources") i({
|
|
1254
1257
|
type: "sources-list",
|
|
1255
|
-
sources:
|
|
1258
|
+
sources: sn()
|
|
1256
1259
|
});
|
|
1257
1260
|
else if (s.type === "capture-selected") {
|
|
1258
1261
|
let t = String(s.requestId || "");
|
|
@@ -1267,7 +1270,7 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1267
1270
|
});
|
|
1268
1271
|
return;
|
|
1269
1272
|
}
|
|
1270
|
-
|
|
1273
|
+
Ft(n, e.ownNodes).then((e) => {
|
|
1271
1274
|
console.info(`[levo-inspector] element capture ok <${n.tagName.toLowerCase()}> (${Math.round(e.length / 1024)}kB)`), i({
|
|
1272
1275
|
type: "capture-result",
|
|
1273
1276
|
requestId: t,
|
|
@@ -1288,7 +1291,7 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1288
1291
|
}
|
|
1289
1292
|
}
|
|
1290
1293
|
} };
|
|
1291
|
-
},
|
|
1294
|
+
}, Cn = () => {
|
|
1292
1295
|
let e = /* @__PURE__ */ new Map(), t = () => {
|
|
1293
1296
|
if (e.size > 50) {
|
|
1294
1297
|
let t = e.keys().next().value;
|
|
@@ -1308,31 +1311,31 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1308
1311
|
return e.delete(t), n;
|
|
1309
1312
|
}
|
|
1310
1313
|
};
|
|
1311
|
-
},
|
|
1314
|
+
}, wn = 6, Tn = 12, En = 12, Dn = .6, On = (e, t, n, r) => ({
|
|
1312
1315
|
x: Math.min(e, n),
|
|
1313
1316
|
y: Math.min(t, r),
|
|
1314
1317
|
width: Math.abs(n - e),
|
|
1315
1318
|
height: Math.abs(r - t)
|
|
1316
|
-
}),
|
|
1319
|
+
}), kn = (e, t) => {
|
|
1317
1320
|
let n = e.x + e.width, r = e.y + e.height, i = [];
|
|
1318
1321
|
for (let a of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
|
|
1319
1322
|
if (t.includes(a)) continue;
|
|
1320
1323
|
let o = a.getBoundingClientRect(), s = o.width * o.height;
|
|
1321
|
-
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 >=
|
|
1324
|
+
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 >= Dn && i.push(a);
|
|
1322
1325
|
}
|
|
1323
1326
|
let a = new Set(i), o = i.filter((e) => {
|
|
1324
1327
|
for (let t = e.parentElement; t; t = t.parentElement) if (a.has(t)) return !1;
|
|
1325
1328
|
return !0;
|
|
1326
|
-
}), s = o.length >
|
|
1327
|
-
for (let e of o.slice(0,
|
|
1329
|
+
}), s = o.length > En, c = [], l = [];
|
|
1330
|
+
for (let e of o.slice(0, En)) {
|
|
1328
1331
|
let t = Z(e);
|
|
1329
1332
|
if (!t) continue;
|
|
1330
1333
|
let n = (e.innerText || "").replace(/\s+/g, " ").trim().slice(0, 80);
|
|
1331
1334
|
c.push({
|
|
1332
1335
|
source: t,
|
|
1333
|
-
index:
|
|
1336
|
+
index: Ht(e, t),
|
|
1334
1337
|
tag: e.tagName.toLowerCase(),
|
|
1335
|
-
label:
|
|
1338
|
+
label: Yt(e),
|
|
1336
1339
|
...n ? { text: n } : {}
|
|
1337
1340
|
}), l.push(e);
|
|
1338
1341
|
}
|
|
@@ -1341,12 +1344,12 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1341
1344
|
nodes: l,
|
|
1342
1345
|
truncated: s
|
|
1343
1346
|
};
|
|
1344
|
-
},
|
|
1347
|
+
}, An = () => Array.from({ length: En }, () => {
|
|
1345
1348
|
let e = document.createElement("div");
|
|
1346
|
-
return e.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
1347
|
-
}),
|
|
1349
|
+
return e.style.cssText = `position:fixed;pointer-events:none;z-index:${Bt.ring};outline:1.5px solid ${X.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 3px ${X.selectGlow};display:none`, e;
|
|
1350
|
+
}), jn = () => {
|
|
1348
1351
|
let e = document.createElement("div");
|
|
1349
|
-
e.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
1352
|
+
e.style.cssText = `position:fixed;pointer-events:none;z-index:${Bt.overlay};border:1.5px dashed ${X.select};background:${X.selectGlow};border-radius:2px;display:none`;
|
|
1350
1353
|
let t = null, n = !1, r = 0, i = 0, a = () => {
|
|
1351
1354
|
e.style.display = "none";
|
|
1352
1355
|
};
|
|
@@ -1361,31 +1364,31 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1361
1364
|
pointerMove: (a, o) => {
|
|
1362
1365
|
if (!t) return;
|
|
1363
1366
|
if (a = Math.min(Math.max(0, a), window.innerWidth), o = Math.min(Math.max(0, o), window.innerHeight), r = a, i = o, !n) {
|
|
1364
|
-
if (Math.abs(a - t.x) <
|
|
1367
|
+
if (Math.abs(a - t.x) < wn && Math.abs(o - t.y) < wn) return;
|
|
1365
1368
|
n = !0;
|
|
1366
1369
|
}
|
|
1367
|
-
let s =
|
|
1370
|
+
let s = On(t.x, t.y, a, o);
|
|
1368
1371
|
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`;
|
|
1369
1372
|
},
|
|
1370
1373
|
pointerUp: () => {
|
|
1371
1374
|
let e = n, o = t;
|
|
1372
1375
|
if (t = null, n = !1, a(), !e || !o) return null;
|
|
1373
|
-
let s =
|
|
1374
|
-
return s.width <
|
|
1376
|
+
let s = On(o.x, o.y, r, i);
|
|
1377
|
+
return s.width < Tn || s.height < Tn ? null : s;
|
|
1375
1378
|
},
|
|
1376
1379
|
cancel: () => {
|
|
1377
1380
|
t = null, n = !1, a();
|
|
1378
1381
|
},
|
|
1379
1382
|
isDragging: () => n
|
|
1380
1383
|
};
|
|
1381
|
-
},
|
|
1384
|
+
}, Mn = (e) => {
|
|
1382
1385
|
let { originals: t, editingNode: n } = e, r = /* @__PURE__ */ new Map(), i = () => {
|
|
1383
1386
|
let e = document.getElementById("studio-staged");
|
|
1384
1387
|
return e || (e = document.createElement("style"), e.id = "studio-staged", document.head.appendChild(e)), e;
|
|
1385
1388
|
}, a = () => {
|
|
1386
1389
|
let e = [];
|
|
1387
1390
|
for (let [t, n] of r) if (n.kind === "style") {
|
|
1388
|
-
let r =
|
|
1391
|
+
let r = Kt(t, n);
|
|
1389
1392
|
r && e.push(r);
|
|
1390
1393
|
}
|
|
1391
1394
|
let t = e.join("\n");
|
|
@@ -1393,8 +1396,8 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1393
1396
|
let n = i();
|
|
1394
1397
|
n.textContent !== t && (n.textContent = t);
|
|
1395
1398
|
}, o = (e, r) => {
|
|
1396
|
-
let i =
|
|
1397
|
-
if (i) if (r.kind === "style")
|
|
1399
|
+
let i = Ut(r.source, r.index);
|
|
1400
|
+
if (i) if (r.kind === "style") Wt(i, e);
|
|
1398
1401
|
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");
|
|
1399
1402
|
else {
|
|
1400
1403
|
if (i === n()) return;
|
|
@@ -1407,8 +1410,8 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1407
1410
|
let n = r.get(e);
|
|
1408
1411
|
if (!n) return;
|
|
1409
1412
|
r.delete(e);
|
|
1410
|
-
let i =
|
|
1411
|
-
if (n.kind === "style") i &&
|
|
1413
|
+
let i = Ut(n.source, n.index);
|
|
1414
|
+
if (n.kind === "style") i && Gt(i, e), a();
|
|
1412
1415
|
else if (n.kind === "image") {
|
|
1413
1416
|
let e = t.restore(`${n.source}#${n.index}:src`), r = t.restore(`${n.source}#${n.index}:srcset`);
|
|
1414
1417
|
i && (e != null && (e ? i.setAttribute("src", e) : i.removeAttribute("src")), r != null && (r ? i.setAttribute("srcset", r) : i.removeAttribute("srcset")));
|
|
@@ -1437,7 +1440,7 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1437
1440
|
for (let e of Array.from(document.querySelectorAll("[data-staged-key]"))) e.removeAttribute("data-staged-key");
|
|
1438
1441
|
}
|
|
1439
1442
|
};
|
|
1440
|
-
},
|
|
1443
|
+
}, Nn = (e) => {
|
|
1441
1444
|
let { channel: t, originals: n, clearTextHover: r } = e, i = null, a = "", o = 0, s = (() => {
|
|
1442
1445
|
try {
|
|
1443
1446
|
let e = document.createElement("div");
|
|
@@ -1456,7 +1459,7 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1456
1459
|
n.selectNodeContents(e), n.collapse(!1), t.removeAllRanges(), t.addRange(n);
|
|
1457
1460
|
}, d = (e, t = !1) => {
|
|
1458
1461
|
if (i === e) return;
|
|
1459
|
-
i && p(i), i = e, a = Z(e) || "", o =
|
|
1462
|
+
i && p(i), i = e, a = Z(e) || "", o = Ht(e, a), r(), n.capture(`${a}#${o}`, e.textContent ?? ""), e.setAttribute("contenteditable", s ? "plaintext-only" : "true");
|
|
1460
1463
|
let d = e;
|
|
1461
1464
|
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);
|
|
1462
1465
|
}, f = (e) => {
|
|
@@ -1475,7 +1478,7 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1475
1478
|
tag: e.tagName.toLowerCase(),
|
|
1476
1479
|
value: c,
|
|
1477
1480
|
previous: s,
|
|
1478
|
-
occurrences: r ?
|
|
1481
|
+
occurrences: r ? Vt(r).length : 1
|
|
1479
1482
|
}
|
|
1480
1483
|
});
|
|
1481
1484
|
}, m = (e) => {
|
|
@@ -1494,16 +1497,16 @@ var Dt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant:
|
|
|
1494
1497
|
i && f(i);
|
|
1495
1498
|
}
|
|
1496
1499
|
};
|
|
1497
|
-
},
|
|
1498
|
-
function Pn() {
|
|
1499
|
-
return A(() => Fn(), []), null;
|
|
1500
|
-
}
|
|
1500
|
+
}, Pn = "2026-07-24g · element-capture + region-drag + region-highlights (stale-region guard)";
|
|
1501
1501
|
function Fn() {
|
|
1502
|
-
|
|
1502
|
+
return A(() => In(), []), null;
|
|
1503
|
+
}
|
|
1504
|
+
function In() {
|
|
1505
|
+
let e = !1, t = null, n = null, r = !1, i = null, a = Cn(), o = hn(), { overlay: s, label: c, ring: l, ringLabel: u } = Zt();
|
|
1503
1506
|
document.body.append(s, c, l, u);
|
|
1504
|
-
let d =
|
|
1507
|
+
let d = jn();
|
|
1505
1508
|
document.body.append(d.node);
|
|
1506
|
-
let f =
|
|
1509
|
+
let f = An();
|
|
1507
1510
|
document.body.append(...f);
|
|
1508
1511
|
let p = [
|
|
1509
1512
|
s,
|
|
@@ -1533,14 +1536,14 @@ function Fn() {
|
|
|
1533
1536
|
}, S = (e) => !e || p.includes(e) || e === document.body || e === document.documentElement, C = (e) => {
|
|
1534
1537
|
if (!e || S(e)) return null;
|
|
1535
1538
|
let t = Z(e) ? e : e.closest("[data-tsd-source]");
|
|
1536
|
-
return !t || S(t) || !
|
|
1537
|
-
}, w = (e) =>
|
|
1539
|
+
return !t || S(t) || !tn(t) ? null : t;
|
|
1540
|
+
}, w = (e) => Qt(s, c, e), T = () => {
|
|
1538
1541
|
if (n) {
|
|
1539
1542
|
if (!n.isConnected) {
|
|
1540
1543
|
P();
|
|
1541
1544
|
return;
|
|
1542
1545
|
}
|
|
1543
|
-
|
|
1546
|
+
Qt(l, u, n);
|
|
1544
1547
|
}
|
|
1545
1548
|
}, E = 0, D = () => {
|
|
1546
1549
|
E || !n || r || (E = requestAnimationFrame(() => {
|
|
@@ -1569,13 +1572,13 @@ function Fn() {
|
|
|
1569
1572
|
n = null, O.disconnect(), z(), E &&= (cancelAnimationFrame(E), 0), l.style.display = "none", u.style.display = "none", y(), g();
|
|
1570
1573
|
}, F = (e) => w(e), I = () => {
|
|
1571
1574
|
s.style.display = "none", c.style.display = "none";
|
|
1572
|
-
}, L =
|
|
1575
|
+
}, L = Nn({
|
|
1573
1576
|
channel: o,
|
|
1574
1577
|
originals: a,
|
|
1575
1578
|
clearTextHover: () => {
|
|
1576
1579
|
i = null, I();
|
|
1577
1580
|
}
|
|
1578
|
-
}), R =
|
|
1581
|
+
}), R = Mn({
|
|
1579
1582
|
originals: a,
|
|
1580
1583
|
editingNode: L.editingNode
|
|
1581
1584
|
}), z = () => {
|
|
@@ -1646,10 +1649,10 @@ function Fn() {
|
|
|
1646
1649
|
let n = d.pointerUp();
|
|
1647
1650
|
if (!n) return;
|
|
1648
1651
|
se = !0, P();
|
|
1649
|
-
let { elements: r, nodes: i, truncated: a } =
|
|
1652
|
+
let { elements: r, nodes: i, truncated: a } = kn(n, p);
|
|
1650
1653
|
console.info(`[levo-inspector] region drag: ${Math.round(n.width)}×${Math.round(n.height)} — ${r.length} element(s)${a ? " (truncated)" : ""}`), v(i);
|
|
1651
1654
|
let s = ++h;
|
|
1652
|
-
|
|
1655
|
+
zt(n, p).then((e) => {
|
|
1653
1656
|
s === h && (console.info(`[levo-inspector] region capture ok (${Math.round(e.length / 1024)}kB)`), o.send({
|
|
1654
1657
|
type: "region-selected",
|
|
1655
1658
|
rect: n,
|
|
@@ -1667,7 +1670,7 @@ function Fn() {
|
|
|
1667
1670
|
}));
|
|
1668
1671
|
});
|
|
1669
1672
|
}, fe = () => W(), K = (e) => {
|
|
1670
|
-
let t =
|
|
1673
|
+
let t = $t(e.target);
|
|
1671
1674
|
return t ? (e.preventDefault(), e.stopPropagation(), window.open(t, "_blank", "noopener,noreferrer"), !0) : !1;
|
|
1672
1675
|
}, pe = (i) => {
|
|
1673
1676
|
if (se) {
|
|
@@ -1693,9 +1696,9 @@ function Fn() {
|
|
|
1693
1696
|
let s = a.closest("[data-tsd-source]") || a;
|
|
1694
1697
|
y(), g(), n = s, T(), N(), o.send({
|
|
1695
1698
|
type: "element-selected",
|
|
1696
|
-
element:
|
|
1699
|
+
element: an(s)
|
|
1697
1700
|
});
|
|
1698
|
-
}, me =
|
|
1701
|
+
}, me = Sn({
|
|
1699
1702
|
channel: o,
|
|
1700
1703
|
originals: a,
|
|
1701
1704
|
staged: R,
|
|
@@ -1744,7 +1747,7 @@ function Fn() {
|
|
|
1744
1747
|
type: "route",
|
|
1745
1748
|
route: e
|
|
1746
1749
|
});
|
|
1747
|
-
}, ye =
|
|
1750
|
+
}, ye = gn({ onPathChange: () => {
|
|
1748
1751
|
P(), ve();
|
|
1749
1752
|
} }), be = (t) => {
|
|
1750
1753
|
if (L.editingNode()) return;
|
|
@@ -1756,13 +1759,13 @@ function Fn() {
|
|
|
1756
1759
|
r ? (t.stopPropagation(), V(!1)) : e && (t.stopPropagation(), B(!1));
|
|
1757
1760
|
return;
|
|
1758
1761
|
}
|
|
1759
|
-
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat ||
|
|
1762
|
+
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat || en(document.activeElement)) return;
|
|
1760
1763
|
let n = t.key.toLowerCase();
|
|
1761
1764
|
n === "s" ? (t.preventDefault(), t.stopPropagation(), B(!e)) : n === "t" && (t.preventDefault(), t.stopPropagation(), V(!r));
|
|
1762
1765
|
};
|
|
1763
1766
|
window.addEventListener("mousemove", U, !0), window.addEventListener("scroll", ae, !0), window.addEventListener("resize", _e), window.addEventListener("click", pe, !0), window.addEventListener("keydown", be, !0), window.addEventListener("message", me.onMessage), window.addEventListener("mouseout", oe, !0), window.addEventListener("pointerdown", ue, !0), window.addEventListener("pointermove", G, !0), window.addEventListener("pointerup", de, !0), window.addEventListener("pointercancel", fe, !0);
|
|
1764
1767
|
for (let e of he) window.addEventListener(e, ge, !0);
|
|
1765
|
-
return console.info(`[levo-inspector] build ${
|
|
1768
|
+
return console.info(`[levo-inspector] build ${Pn} — runtime mounted`), ve(), o.send({ type: "ready" }), () => {
|
|
1766
1769
|
window.removeEventListener("mousemove", U, !0), window.removeEventListener("keydown", be, !0), window.removeEventListener("scroll", ae, !0), window.removeEventListener("resize", _e), window.removeEventListener("mouseout", oe, !0), window.removeEventListener("pointerdown", ue, !0), window.removeEventListener("pointermove", G, !0), window.removeEventListener("pointerup", de, !0), window.removeEventListener("pointercancel", fe, !0), window.removeEventListener("click", pe, !0), window.removeEventListener("message", me.onMessage);
|
|
1767
1770
|
for (let e of he) window.removeEventListener(e, ge, !0);
|
|
1768
1771
|
O.disconnect(), k.disconnect(), E && cancelAnimationFrame(E), ee && cancelAnimationFrame(ee), re && cancelAnimationFrame(re), R.teardown(), ye.teardown(), L.teardown(), document.documentElement.style.cursor = "", b?.remove(), s.remove(), c.remove(), l.remove(), u.remove(), W(), d.node.remove();
|
|
@@ -1771,15 +1774,15 @@ function Fn() {
|
|
|
1771
1774
|
}
|
|
1772
1775
|
//#endregion
|
|
1773
1776
|
//#region src/branding/MadeWithLevo.tsx
|
|
1774
|
-
var
|
|
1775
|
-
.${
|
|
1777
|
+
var Ln = "levo-made-with", Rn = `.${Ln}{opacity:.2;transition:opacity 150ms,transform 150ms}
|
|
1778
|
+
.${Ln}:hover,.${Ln}:focus-visible{opacity:1;transform:translateY(-2px)}`, zn = ({ slug: e }) => {
|
|
1776
1779
|
let t = `utm_source=${encodeURIComponent(e || "website")}&utm_term=Made%20With%20Levo&utm_campaign=footer_branding&utm_medium=organic_footer_branding`;
|
|
1777
1780
|
return /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("style", {
|
|
1778
1781
|
href: "levo-made-with",
|
|
1779
1782
|
precedence: "default",
|
|
1780
|
-
children:
|
|
1783
|
+
children: Rn
|
|
1781
1784
|
}), /* @__PURE__ */ C("a", {
|
|
1782
|
-
className:
|
|
1785
|
+
className: Ln,
|
|
1783
1786
|
href: `https://levo.so/?${t}`,
|
|
1784
1787
|
target: "_blank",
|
|
1785
1788
|
rel: "noopener noreferrer",
|
|
@@ -1810,20 +1813,20 @@ var In = "levo-made-with", Ln = `.${In}{opacity:.2;transition:opacity 150ms,tran
|
|
|
1810
1813
|
}
|
|
1811
1814
|
}), "Made with Levo"]
|
|
1812
1815
|
})] });
|
|
1813
|
-
},
|
|
1816
|
+
}, Bn = "levo:page-id", Vn = () => {
|
|
1814
1817
|
if (typeof document > "u") return null;
|
|
1815
|
-
let e = document.querySelectorAll(`meta[name="${
|
|
1818
|
+
let e = document.querySelectorAll(`meta[name="${Bn}"]`);
|
|
1816
1819
|
return e[e.length - 1]?.getAttribute("content")?.trim() || null;
|
|
1817
|
-
},
|
|
1820
|
+
}, Hn = D(() => import("./dist-6AIgW_iB.js").then((e) => e.n).then((e) => ({ default: e.PopupLoader }))), Un = ({ siteId: e, pageId: t }) => {
|
|
1818
1821
|
let n = J(), r = i();
|
|
1819
1822
|
return !n || !r ? null : /* @__PURE__ */ S(T, {
|
|
1820
1823
|
fallback: null,
|
|
1821
|
-
children: /* @__PURE__ */ S(
|
|
1824
|
+
children: /* @__PURE__ */ S(Hn, {
|
|
1822
1825
|
pageId: t,
|
|
1823
1826
|
siteId: e
|
|
1824
1827
|
})
|
|
1825
1828
|
});
|
|
1826
|
-
},
|
|
1829
|
+
}, Wn = E(null), Gn = Wn.Provider, Kn = () => k(Wn), qn = () => i(), Jn = () => n(), Yn = ({ site: e, analytics: t = !0, children: n }) => {
|
|
1827
1830
|
let [i] = P(() => {
|
|
1828
1831
|
if (!e) return null;
|
|
1829
1832
|
let n = Ee(e), r = Te(n);
|
|
@@ -1835,33 +1838,33 @@ var In = "levo-made-with", Ln = `.${In}{opacity:.2;transition:opacity 150ms,tran
|
|
|
1835
1838
|
}),
|
|
1836
1839
|
site: e
|
|
1837
1840
|
} : null;
|
|
1838
|
-
}), [a, o] = P(null), s = H({ select: (e) => e.location.pathname }), c =
|
|
1841
|
+
}), [a, o] = P(null), s = H({ select: (e) => e.location.pathname }), c = xn();
|
|
1839
1842
|
return A(() => {
|
|
1840
1843
|
i && (window.levo_client = i.client, window.levo_insights = i.insights);
|
|
1841
1844
|
}, [i]), j(() => {
|
|
1842
1845
|
if (!i) return;
|
|
1843
|
-
let e =
|
|
1846
|
+
let e = Vn();
|
|
1844
1847
|
o(e), i.insights.init({ pageId: e });
|
|
1845
1848
|
}, [i, s]), i ? /* @__PURE__ */ C(r, {
|
|
1846
1849
|
client: i.client,
|
|
1847
1850
|
insights: i.insights,
|
|
1848
1851
|
children: [
|
|
1849
|
-
/* @__PURE__ */ S(
|
|
1852
|
+
/* @__PURE__ */ S(Gn, {
|
|
1850
1853
|
value: i.site,
|
|
1851
1854
|
children: n
|
|
1852
1855
|
}),
|
|
1853
|
-
!c && /* @__PURE__ */ S(
|
|
1856
|
+
!c && /* @__PURE__ */ S(vt, {
|
|
1854
1857
|
site: i.site,
|
|
1855
1858
|
path: s
|
|
1856
1859
|
}),
|
|
1857
|
-
/* @__PURE__ */ S(
|
|
1860
|
+
/* @__PURE__ */ S(Un, {
|
|
1858
1861
|
pageId: a ?? void 0,
|
|
1859
1862
|
siteId: i.site.id
|
|
1860
1863
|
}),
|
|
1861
|
-
!c && !!i.site.feature_flag?.branding && /* @__PURE__ */ S(
|
|
1864
|
+
!c && !!i.site.feature_flag?.branding && /* @__PURE__ */ S(zn, { slug: i.site.slug })
|
|
1862
1865
|
]
|
|
1863
1866
|
}) : /* @__PURE__ */ S(x, { children: n });
|
|
1864
|
-
},
|
|
1867
|
+
}, Xn = (e, t) => {
|
|
1865
1868
|
let n = h(t);
|
|
1866
1869
|
return ({ location: t }) => {
|
|
1867
1870
|
if (!e.isLocalized) return;
|
|
@@ -1874,7 +1877,7 @@ var In = "levo-made-with", Ln = `.${In}{opacity:.2;transition:opacity 150ms,tran
|
|
|
1874
1877
|
});
|
|
1875
1878
|
if (r.kind === "redirect" && r.path !== t.pathname) throw ee({ href: `${r.path}${t.searchStr ?? ""}` });
|
|
1876
1879
|
};
|
|
1877
|
-
},
|
|
1880
|
+
}, Zn = (e) => {
|
|
1878
1881
|
let t = e.locales ?? [], n = e.domain?.trim().replace(/^https?:\/\//, "").replace(/\/+$/, "");
|
|
1879
1882
|
return {
|
|
1880
1883
|
locales: t,
|
|
@@ -1882,8 +1885,8 @@ var In = "levo-made-with", Ln = `.${In}{opacity:.2;transition:opacity 150ms,tran
|
|
|
1882
1885
|
isLocalized: t.length > 1,
|
|
1883
1886
|
origin: n ? `https://${n}` : null
|
|
1884
1887
|
};
|
|
1885
|
-
},
|
|
1886
|
-
let { neutralPath: t, locales: n, activePrefix: r, hasRoute: i } = e, a =
|
|
1888
|
+
}, Qn = (e) => e.replace(/\/$/, ""), $n = (e) => {
|
|
1889
|
+
let { neutralPath: t, locales: n, activePrefix: r, hasRoute: i } = e, a = Qn(e.origin), o = `${a}${t}`;
|
|
1887
1890
|
if (n.length <= 1) return [{
|
|
1888
1891
|
rel: "canonical",
|
|
1889
1892
|
href: o
|
|
@@ -1905,11 +1908,11 @@ var In = "levo-made-with", Ln = `.${In}{opacity:.2;transition:opacity 150ms,tran
|
|
|
1905
1908
|
hrefLang: "x-default",
|
|
1906
1909
|
href: o
|
|
1907
1910
|
}), s;
|
|
1908
|
-
},
|
|
1911
|
+
}, er = ({ config: e, routeTree: t }) => {
|
|
1909
1912
|
let n = H({ select: (e) => e.location.pathname });
|
|
1910
1913
|
if (!e.isLocalized || !e.origin) return null;
|
|
1911
1914
|
let { neutralPath: r } = f(n, e.locales);
|
|
1912
|
-
return /* @__PURE__ */ S(x, { children:
|
|
1915
|
+
return /* @__PURE__ */ S(x, { children: $n({
|
|
1913
1916
|
neutralPath: r,
|
|
1914
1917
|
origin: e.origin,
|
|
1915
1918
|
locales: e.locales,
|
|
@@ -1919,7 +1922,7 @@ var In = "levo-made-with", Ln = `.${In}{opacity:.2;transition:opacity 150ms,tran
|
|
|
1919
1922
|
hrefLang: e.hrefLang,
|
|
1920
1923
|
rel: e.rel
|
|
1921
1924
|
}, e.hrefLang ?? e.href)) });
|
|
1922
|
-
},
|
|
1925
|
+
}, tr = E(void 0), nr = ({ children: e, locale: t, locales: n, defaultLocale: r, source: i = "default", hasRoute: a }) => {
|
|
1923
1926
|
let o = M(() => {
|
|
1924
1927
|
let e = n?.length ? n : [t];
|
|
1925
1928
|
return {
|
|
@@ -1943,13 +1946,13 @@ var In = "levo-made-with", Ln = `.${In}{opacity:.2;transition:opacity 150ms,tran
|
|
|
1943
1946
|
i,
|
|
1944
1947
|
a
|
|
1945
1948
|
]);
|
|
1946
|
-
return /* @__PURE__ */ S(
|
|
1949
|
+
return /* @__PURE__ */ S(tr.Provider, {
|
|
1947
1950
|
value: o,
|
|
1948
1951
|
children: e
|
|
1949
1952
|
});
|
|
1950
1953
|
};
|
|
1951
|
-
function
|
|
1952
|
-
return k(
|
|
1954
|
+
function rr() {
|
|
1955
|
+
return k(tr) || {
|
|
1953
1956
|
locale: "en",
|
|
1954
1957
|
locales: ["en"],
|
|
1955
1958
|
defaultLocale: "en",
|
|
@@ -1959,13 +1962,13 @@ function nr() {
|
|
|
1959
1962
|
pathFor: (e) => e
|
|
1960
1963
|
};
|
|
1961
1964
|
}
|
|
1962
|
-
function
|
|
1965
|
+
function ir(e) {
|
|
1963
1966
|
let { prefix: t } = f(H({ select: (e) => e.location.pathname }), e.locales);
|
|
1964
1967
|
return t ?? e.defaultLocale;
|
|
1965
1968
|
}
|
|
1966
|
-
var
|
|
1969
|
+
var ar = ({ config: e, children: t, routeTree: n }) => {
|
|
1967
1970
|
let { prefix: r } = f(H({ select: (e) => e.location.pathname }), e.locales);
|
|
1968
|
-
return /* @__PURE__ */ S(
|
|
1971
|
+
return /* @__PURE__ */ S(nr, {
|
|
1969
1972
|
defaultLocale: e.defaultLocale,
|
|
1970
1973
|
hasRoute: n ? h(n) : void 0,
|
|
1971
1974
|
locale: r ?? e.defaultLocale,
|
|
@@ -1974,8 +1977,8 @@ var ir = ({ config: e, children: t, routeTree: n }) => {
|
|
|
1974
1977
|
children: t
|
|
1975
1978
|
});
|
|
1976
1979
|
};
|
|
1977
|
-
function
|
|
1978
|
-
let { locale: e, locales: t, isMultiLocale: n, setLocale: r, pathFor: i, hasRoute: a } =
|
|
1980
|
+
function or() {
|
|
1981
|
+
let { locale: e, locales: t, isMultiLocale: n, setLocale: r, pathFor: i, hasRoute: a } = rr(), o = H({ select: (e) => e.location.pathname });
|
|
1979
1982
|
return M(() => {
|
|
1980
1983
|
if (!n) return [];
|
|
1981
1984
|
let { neutralPath: s } = f(o, t), c = t.filter((e) => !a || a(i(s, e)));
|
|
@@ -2002,14 +2005,14 @@ function ar() {
|
|
|
2002
2005
|
}
|
|
2003
2006
|
//#endregion
|
|
2004
2007
|
//#region src/pageHead.tsx
|
|
2005
|
-
var
|
|
2008
|
+
var sr = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), cr = (e) => {
|
|
2006
2009
|
let t = {}, n = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*("([^"]*)"|'([^']*)'|[^\s"'>]+))?/g;
|
|
2007
2010
|
for (let r = n.exec(e); r; r = n.exec(e)) {
|
|
2008
2011
|
let e = r[1];
|
|
2009
2012
|
!e || /^on/i.test(e) || (t[e] = r[3] ?? r[4] ?? (r[2] ? r[2] : ""));
|
|
2010
2013
|
}
|
|
2011
2014
|
return t;
|
|
2012
|
-
},
|
|
2015
|
+
}, lr = (e) => {
|
|
2013
2016
|
let t = {
|
|
2014
2017
|
meta: [],
|
|
2015
2018
|
links: [],
|
|
@@ -2017,11 +2020,11 @@ var or = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), sr = (e) => {
|
|
|
2017
2020
|
};
|
|
2018
2021
|
if (!e?.trim()) return t;
|
|
2019
2022
|
let n = e.replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi, (e, n, r) => {
|
|
2020
|
-
let i =
|
|
2023
|
+
let i = cr(n), a = r.trim();
|
|
2021
2024
|
return a && (i.children = a), t.scripts.push(i), "";
|
|
2022
2025
|
});
|
|
2023
|
-
return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(
|
|
2024
|
-
},
|
|
2026
|
+
return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(cr(r)), "")), t;
|
|
2027
|
+
}, ur = (e = {}, t = {}) => {
|
|
2025
2028
|
let n = {
|
|
2026
2029
|
meta: [],
|
|
2027
2030
|
links: [],
|
|
@@ -2086,17 +2089,17 @@ var or = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), sr = (e) => {
|
|
|
2086
2089
|
let y = e.ldJson ? Array.isArray(e.ldJson) ? e.ldJson : [e.ldJson] : [];
|
|
2087
2090
|
for (let e of y) n.scripts.push({
|
|
2088
2091
|
type: "application/ld+json",
|
|
2089
|
-
children:
|
|
2092
|
+
children: sr(e)
|
|
2090
2093
|
});
|
|
2091
2094
|
for (let r of [t.customHead, e.customHead]) {
|
|
2092
2095
|
if (!r) continue;
|
|
2093
|
-
let e =
|
|
2096
|
+
let e = lr(r);
|
|
2094
2097
|
n.meta.push(...e.meta), n.links.push(...e.links), n.scripts.push(...e.scripts);
|
|
2095
2098
|
}
|
|
2096
2099
|
return n;
|
|
2097
2100
|
};
|
|
2098
|
-
function
|
|
2099
|
-
let n =
|
|
2101
|
+
function dr({ meta: e, site: t }) {
|
|
2102
|
+
let n = ur(e, t);
|
|
2100
2103
|
return /* @__PURE__ */ C(x, { children: [
|
|
2101
2104
|
n.meta.map((e, t) => e.title === void 0 ? /* @__PURE__ */ S("meta", { ...e }, `m${t}`) : /* @__PURE__ */ S("title", { children: e.title }, `t${t}`)),
|
|
2102
2105
|
n.links.map((e, t) => /* @__PURE__ */ S("link", { ...e }, `l${t}`)),
|
|
@@ -2108,17 +2111,17 @@ function ur({ meta: e, site: t }) {
|
|
|
2108
2111
|
}
|
|
2109
2112
|
//#endregion
|
|
2110
2113
|
//#region src/registration/ui.tsx
|
|
2111
|
-
var
|
|
2114
|
+
var fr = (...e) => e.filter(Boolean).join(" "), Q = w.forwardRef(({ className: e, isLoading: t, loadingText: n, children: r, type: i = "button", ...a }, o) => /* @__PURE__ */ S("button", {
|
|
2112
2115
|
ref: o,
|
|
2113
2116
|
type: i,
|
|
2114
|
-
className:
|
|
2117
|
+
className: fr("inline-flex items-center justify-center", e),
|
|
2115
2118
|
...a,
|
|
2116
|
-
children: t ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(ie, { className:
|
|
2119
|
+
children: t ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(ie, { className: fr("h-4 w-4 animate-spin", n ? "mr-2" : "") }), n] }) : r
|
|
2117
2120
|
}));
|
|
2118
2121
|
Q.displayName = "Btn";
|
|
2119
2122
|
//#endregion
|
|
2120
2123
|
//#region src/registration/AttendeeForm.tsx
|
|
2121
|
-
var
|
|
2124
|
+
var pr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, registerLoading: i, onBack: a, submitLabel: o, showBusinessBilling: s = !0 }) => /* @__PURE__ */ C("form", {
|
|
2122
2125
|
onSubmit: r,
|
|
2123
2126
|
className: "flex flex-col gap-4",
|
|
2124
2127
|
children: [
|
|
@@ -2283,22 +2286,22 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2283
2286
|
})]
|
|
2284
2287
|
})
|
|
2285
2288
|
]
|
|
2286
|
-
}),
|
|
2289
|
+
}), mr = {
|
|
2287
2290
|
USD: "$",
|
|
2288
2291
|
EUR: "€",
|
|
2289
2292
|
GBP: "£",
|
|
2290
2293
|
INR: "₹"
|
|
2291
|
-
}, $ = (e) => e?.unit_amount ? `${
|
|
2294
|
+
}, $ = (e) => e?.unit_amount ? `${mr[e.currency ?? "INR"]} ${(e.unit_amount ?? 0) / 100}` : "Free", hr = (e) => {
|
|
2292
2295
|
if (!e) return null;
|
|
2293
2296
|
let t = e.tax_enabled ?? !1, n = e.tax_inclusive ?? !1, r = e.taxes ?? [];
|
|
2294
2297
|
return !t || r.length === 0 ? null : n ? "(inclusive of taxes)" : "+ taxes";
|
|
2295
|
-
},
|
|
2298
|
+
}, gr = (e) => !!(e?.taxes && e.taxes.length > 0 && e.tax_amount !== void 0), _r = (e) => {
|
|
2296
2299
|
if (!e) return !1;
|
|
2297
2300
|
let t = e;
|
|
2298
2301
|
return t.tax_enabled === !0 && t.taxes !== void 0 && t.taxes.length > 0 && t.subtotal !== void 0;
|
|
2299
|
-
},
|
|
2302
|
+
}, vr = (e, t) => t ? t.total_amount ?? t.sale_amount ?? 0 : _r(e) ? e.total ?? e.unit_amount ?? 0 : e?.unit_amount ?? 0, yr = (e, t) => !t || e.tickets.length === 0 ? !0 : e.tickets.some((e) => typeof e == "string" ? e === t : e._id === t), br = ({ couponCode: e, onCouponCodeChange: t, couponError: n, couponLoading: r, onValidateCoupon: i, publicCoupons: a, onBack: o, selectedTicket: s }) => {
|
|
2300
2303
|
let c = [...a].sort((e, t) => {
|
|
2301
|
-
let n =
|
|
2304
|
+
let n = yr(e, s?._id), r = yr(t, s?._id);
|
|
2302
2305
|
return n && !r ? -1 : !n && r ? 1 : 0;
|
|
2303
2306
|
});
|
|
2304
2307
|
return /* @__PURE__ */ C("div", { children: [
|
|
@@ -2347,12 +2350,12 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2347
2350
|
}),
|
|
2348
2351
|
c.length > 0 && /* @__PURE__ */ C("div", {
|
|
2349
2352
|
className: "mt-4 flex flex-col gap-4",
|
|
2350
|
-
children: [c.filter((e) =>
|
|
2353
|
+
children: [c.filter((e) => yr(e, s?._id)).length > 0 && /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
|
|
2351
2354
|
className: "mb-2 text-gray-600 text-sm",
|
|
2352
2355
|
children: "Available Coupons"
|
|
2353
2356
|
}), /* @__PURE__ */ S("div", {
|
|
2354
2357
|
className: "flex flex-col gap-2",
|
|
2355
|
-
children: c.filter((e) =>
|
|
2358
|
+
children: c.filter((e) => yr(e, s?._id)).map((e) => /* @__PURE__ */ C("button", {
|
|
2356
2359
|
type: "button",
|
|
2357
2360
|
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",
|
|
2358
2361
|
onClick: () => {
|
|
@@ -2365,19 +2368,19 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2365
2368
|
children: e.code
|
|
2366
2369
|
}), /* @__PURE__ */ S("span", {
|
|
2367
2370
|
className: "text-gray-500 text-sm",
|
|
2368
|
-
children: e.kind === "percent" ? `${e.percent_off}% off` : `${
|
|
2371
|
+
children: e.kind === "percent" ? `${e.percent_off}% off` : `${mr[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
|
|
2369
2372
|
})]
|
|
2370
2373
|
}), e.description && /* @__PURE__ */ S("span", {
|
|
2371
2374
|
className: "text-gray-500 text-xs",
|
|
2372
2375
|
children: e.description
|
|
2373
2376
|
})]
|
|
2374
2377
|
}, e._id))
|
|
2375
|
-
})] }), c.filter((e) => !
|
|
2378
|
+
})] }), c.filter((e) => !yr(e, s?._id)).length > 0 && /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
|
|
2376
2379
|
className: "mb-2 text-gray-400 text-sm",
|
|
2377
2380
|
children: "Not Applicable"
|
|
2378
2381
|
}), /* @__PURE__ */ S("div", {
|
|
2379
2382
|
className: "flex flex-col gap-2",
|
|
2380
|
-
children: c.filter((e) => !
|
|
2383
|
+
children: c.filter((e) => !yr(e, s?._id)).map((e) => /* @__PURE__ */ C("button", {
|
|
2381
2384
|
type: "button",
|
|
2382
2385
|
disabled: !0,
|
|
2383
2386
|
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",
|
|
@@ -2388,7 +2391,7 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2388
2391
|
children: e.code
|
|
2389
2392
|
}), /* @__PURE__ */ S("span", {
|
|
2390
2393
|
className: "text-gray-500 text-sm",
|
|
2391
|
-
children: e.kind === "percent" ? `${e.percent_off}% off` : `${
|
|
2394
|
+
children: e.kind === "percent" ? `${e.percent_off}% off` : `${mr[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
|
|
2392
2395
|
})]
|
|
2393
2396
|
}), e.description && /* @__PURE__ */ S("span", {
|
|
2394
2397
|
className: "text-gray-500 text-xs",
|
|
@@ -2398,7 +2401,7 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2398
2401
|
})] })]
|
|
2399
2402
|
})
|
|
2400
2403
|
] });
|
|
2401
|
-
},
|
|
2404
|
+
}, xr = (e) => {
|
|
2402
2405
|
let t = new Date(e);
|
|
2403
2406
|
return `${new Intl.DateTimeFormat("en-GB", {
|
|
2404
2407
|
day: "numeric",
|
|
@@ -2409,7 +2412,7 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2409
2412
|
minute: "2-digit",
|
|
2410
2413
|
hour12: !0
|
|
2411
2414
|
}).format(t)}`;
|
|
2412
|
-
},
|
|
2415
|
+
}, Sr = ({ ticketData: e, paymentData: t, type: n }) => {
|
|
2413
2416
|
let [r, i] = P(!0), a = (t.total_amount || t.unit_amount) / 100, o = t.unit_amount === 0, s = (e) => new Intl.NumberFormat("en-IN", {
|
|
2414
2417
|
style: "currency",
|
|
2415
2418
|
currency: t.currency || "INR",
|
|
@@ -2557,7 +2560,7 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2557
2560
|
]
|
|
2558
2561
|
}), /* @__PURE__ */ S("p", {
|
|
2559
2562
|
className: "mt-3 text-center text-gray-400 text-xs",
|
|
2560
|
-
children:
|
|
2563
|
+
children: xr(t.created_at)
|
|
2561
2564
|
})]
|
|
2562
2565
|
}),
|
|
2563
2566
|
/* @__PURE__ */ C("div", {
|
|
@@ -2597,7 +2600,7 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2597
2600
|
]
|
|
2598
2601
|
})] })
|
|
2599
2602
|
});
|
|
2600
|
-
},
|
|
2603
|
+
}, Cr = ({ isOpen: e, onClose: t, stripePromise: n, clientSecret: r, onComplete: i }) => !n || !r ? null : /* @__PURE__ */ S(I.Root, {
|
|
2601
2604
|
open: e,
|
|
2602
2605
|
onOpenChange: (e) => {
|
|
2603
2606
|
e || t();
|
|
@@ -2619,14 +2622,14 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2619
2622
|
})
|
|
2620
2623
|
})]
|
|
2621
2624
|
})] })
|
|
2622
|
-
}),
|
|
2623
|
-
let l =
|
|
2625
|
+
}), wr = ({ tickets: e, selectedTicket: t, onSelectTicket: n, discount: r, couponCode: i, publicCouponsCount: a, onApplyCouponClick: o, onRemoveCoupon: s, onNext: c }) => {
|
|
2626
|
+
let l = _r(t), u = gr(r);
|
|
2624
2627
|
return /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("div", {
|
|
2625
2628
|
className: "flex max-h-[64dvh] w-full flex-col justify-between gap-6 overflow-y-auto md:max-h-[unset] md:flex-row",
|
|
2626
2629
|
children: [/* @__PURE__ */ S("div", {
|
|
2627
2630
|
className: "flex w-full flex-col gap-3 md:w-[55%]",
|
|
2628
2631
|
children: e.map((e) => /* @__PURE__ */ S("div", {
|
|
2629
|
-
className:
|
|
2632
|
+
className: fr("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" : ""),
|
|
2630
2633
|
onClick: () => n(e),
|
|
2631
2634
|
children: /* @__PURE__ */ C("div", { children: [
|
|
2632
2635
|
/* @__PURE__ */ S("p", {
|
|
@@ -2639,9 +2642,9 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2639
2642
|
}),
|
|
2640
2643
|
/* @__PURE__ */ C("p", {
|
|
2641
2644
|
className: "text-md",
|
|
2642
|
-
children: [$(e),
|
|
2645
|
+
children: [$(e), hr(e) && /* @__PURE__ */ C("span", {
|
|
2643
2646
|
className: "text-gray-500 text-sm",
|
|
2644
|
-
children: [" ",
|
|
2647
|
+
children: [" ", hr(e)]
|
|
2645
2648
|
})]
|
|
2646
2649
|
})
|
|
2647
2650
|
] })
|
|
@@ -2899,7 +2902,7 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2899
2902
|
})]
|
|
2900
2903
|
})
|
|
2901
2904
|
}) : /* @__PURE__ */ C("div", {
|
|
2902
|
-
className:
|
|
2905
|
+
className: fr("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"),
|
|
2903
2906
|
onClick: () => t ? o() : null,
|
|
2904
2907
|
children: [/* @__PURE__ */ C("span", {
|
|
2905
2908
|
className: "flex items-center gap-2",
|
|
@@ -2918,7 +2921,7 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2918
2921
|
children: "Continue for Payment"
|
|
2919
2922
|
})
|
|
2920
2923
|
})] });
|
|
2921
|
-
},
|
|
2924
|
+
}, Tr = () => {
|
|
2922
2925
|
let [e, t] = P(null), [n, r] = P(null), [i, a] = P(!1), [o, s] = P(null);
|
|
2923
2926
|
return {
|
|
2924
2927
|
stripePromise: e,
|
|
@@ -2942,7 +2945,7 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2942
2945
|
s(() => e);
|
|
2943
2946
|
}, [])
|
|
2944
2947
|
};
|
|
2945
|
-
},
|
|
2948
|
+
}, Er = {
|
|
2946
2949
|
name: "",
|
|
2947
2950
|
email: "",
|
|
2948
2951
|
is_business_purchase: !1,
|
|
@@ -2958,22 +2961,22 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2958
2961
|
country: ""
|
|
2959
2962
|
}
|
|
2960
2963
|
}
|
|
2961
|
-
},
|
|
2964
|
+
}, Dr = (e, t, n) => {
|
|
2962
2965
|
let r = t.split("."), i = structuredClone(e), a = i, o = r.length - 1;
|
|
2963
2966
|
return r.forEach((e, t) => {
|
|
2964
2967
|
t === o ? a[e] = n : a = a[e];
|
|
2965
2968
|
}), i;
|
|
2966
|
-
},
|
|
2969
|
+
}, Or = async (e, t) => {
|
|
2967
2970
|
try {
|
|
2968
2971
|
let n = new URLSearchParams();
|
|
2969
2972
|
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;
|
|
2970
2973
|
} catch (t) {
|
|
2971
2974
|
e.logger?.error("Failed to fetch event tickets", { exception: b(t) });
|
|
2972
2975
|
}
|
|
2973
|
-
},
|
|
2974
|
-
let a = i(), [o, s] = P([]), [c, l] = P(!0), [u, d] = P(!1), [f, p] = P(!1), [m, h] = P(null), [g, _] = P(void 0), [v, y] = P(""), [w, T] = P(null), [E, D] = P(!1), [k, j] = P(null), [M, F] = P(!1), [L, R] = P(1), [z, B] = P(null), [V, ee] = P([]), [H, te] = P(
|
|
2976
|
+
}, kr = ({ eventID: e, title: t, external: n, buttonText: r = "Register Now" }) => {
|
|
2977
|
+
let a = i(), [o, s] = P([]), [c, l] = P(!0), [u, d] = P(!1), [f, p] = P(!1), [m, h] = P(null), [g, _] = P(void 0), [v, y] = P(""), [w, T] = P(null), [E, D] = P(!1), [k, j] = P(null), [M, F] = P(!1), [L, R] = P(1), [z, B] = P(null), [V, ee] = P([]), [H, te] = P(Er), ne = vr(m, w) === 0, U = N(null), re = () => te(Er), ie = () => {
|
|
2975
2978
|
T(null), _(void 0), j(null), D(!1), y(""), B(null), d(!1), R(1), re();
|
|
2976
|
-
}, { Razorpay: ae } = ce(), { stripePromise: oe, config: le, isOpen: W, openStripeCheckout: ue, closeStripeCheckout: G, setOnComplete: de } =
|
|
2979
|
+
}, { Razorpay: ae } = ce(), { stripePromise: oe, config: le, isOpen: W, openStripeCheckout: ue, closeStripeCheckout: G, setOnComplete: de } = Tr(), fe = () => {
|
|
2977
2980
|
let e = U.current;
|
|
2978
2981
|
!e || !a || a.fetch?.url(`/v1/event/booking/${e.bookingId}/confirm-booking`)?.post({ session_id: e.sessionId })?.json().then((e) => {
|
|
2979
2982
|
e?.content?.data && _(e?.content?.data), G(), U.current = null;
|
|
@@ -3089,7 +3092,7 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
3089
3092
|
j(null), D(!1), y(""), F(!1);
|
|
3090
3093
|
}, ye = (e) => {
|
|
3091
3094
|
let { name: t, value: n, type: r, checked: i } = e.target;
|
|
3092
|
-
te((e) =>
|
|
3095
|
+
te((e) => Dr(e, t, r === "checkbox" ? i : n));
|
|
3093
3096
|
}, be = () => {}, xe = (e) => {
|
|
3094
3097
|
e?.preventDefault(), K();
|
|
3095
3098
|
};
|
|
@@ -3098,7 +3101,7 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
3098
3101
|
l(!1);
|
|
3099
3102
|
return;
|
|
3100
3103
|
}
|
|
3101
|
-
e && a && (l(!0),
|
|
3104
|
+
e && a && (l(!0), Or(a, e).then((e) => {
|
|
3102
3105
|
s(e ?? []), e && e.length > 0 && h(e[0] || null), l(!1);
|
|
3103
3106
|
}));
|
|
3104
3107
|
}, [
|
|
@@ -3147,7 +3150,7 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
3147
3150
|
e || ie();
|
|
3148
3151
|
},
|
|
3149
3152
|
children: /* @__PURE__ */ C(I.Portal, { children: [/* @__PURE__ */ S(I.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ C(I.Popup, {
|
|
3150
|
-
className:
|
|
3153
|
+
className: fr("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", M ? "md:w-[30%]" : "md:w-[40%]"),
|
|
3151
3154
|
children: [/* @__PURE__ */ C("div", {
|
|
3152
3155
|
className: `mb-4 flex w-full items-start justify-between ${M ? "" : "pb-[6px]"} `,
|
|
3153
3156
|
children: [/* @__PURE__ */ C(I.Title, {
|
|
@@ -3164,7 +3167,7 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
3164
3167
|
}), /* @__PURE__ */ C("div", { children: [z && /* @__PURE__ */ S("div", {
|
|
3165
3168
|
className: "mb-4 rounded-md bg-red-50 p-3 text-red-600 text-sm",
|
|
3166
3169
|
children: z
|
|
3167
|
-
}), L === 1 ? /* @__PURE__ */ S("div", { children: M ? /* @__PURE__ */ S(
|
|
3170
|
+
}), L === 1 ? /* @__PURE__ */ S("div", { children: M ? /* @__PURE__ */ S(br, {
|
|
3168
3171
|
couponCode: v,
|
|
3169
3172
|
onCouponCodeChange: y,
|
|
3170
3173
|
couponError: k,
|
|
@@ -3173,7 +3176,7 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
3173
3176
|
publicCoupons: V,
|
|
3174
3177
|
onBack: ve,
|
|
3175
3178
|
selectedTicket: m
|
|
3176
|
-
}) : /* @__PURE__ */ S(
|
|
3179
|
+
}) : /* @__PURE__ */ S(wr, {
|
|
3177
3180
|
tickets: o,
|
|
3178
3181
|
selectedTicket: m,
|
|
3179
3182
|
onSelectTicket: ge,
|
|
@@ -3183,7 +3186,7 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
3183
3186
|
onApplyCouponClick: () => F(!0),
|
|
3184
3187
|
onRemoveCoupon: _e,
|
|
3185
3188
|
onNext: () => R(2)
|
|
3186
|
-
}) }) : /* @__PURE__ */ S(
|
|
3189
|
+
}) }) : /* @__PURE__ */ S(pr, {
|
|
3187
3190
|
values: H,
|
|
3188
3191
|
handleChange: ye,
|
|
3189
3192
|
handleBlur: be,
|
|
@@ -3195,12 +3198,12 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
3195
3198
|
})] })]
|
|
3196
3199
|
})] })
|
|
3197
3200
|
}),
|
|
3198
|
-
g && /* @__PURE__ */ S(
|
|
3201
|
+
g && /* @__PURE__ */ S(Sr, {
|
|
3199
3202
|
paymentData: g,
|
|
3200
3203
|
ticketData: o,
|
|
3201
3204
|
type: "confirm"
|
|
3202
3205
|
}),
|
|
3203
|
-
W && le && /* @__PURE__ */ S(
|
|
3206
|
+
W && le && /* @__PURE__ */ S(Cr, {
|
|
3204
3207
|
isOpen: W,
|
|
3205
3208
|
onClose: G,
|
|
3206
3209
|
stripePromise: oe,
|
|
@@ -3208,7 +3211,7 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
3208
3211
|
onComplete: fe
|
|
3209
3212
|
})
|
|
3210
3213
|
] });
|
|
3211
|
-
},
|
|
3214
|
+
}, Ar = (e) => e.length > 1 ? e.replace(/\/+$/, "") : e, jr = (e) => typeof e == "string" && e.trim() ? e : void 0, Mr = (e) => typeof e == "string" ? e : e?.location ?? void 0, Nr = (e, t) => {
|
|
3212
3215
|
let n = e.meta ?? {}, r = e.title && t ? `${e.title} | ${t}` : e.title || t || void 0;
|
|
3213
3216
|
return {
|
|
3214
3217
|
title: n.meta_title || r,
|
|
@@ -3218,33 +3221,33 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
3218
3221
|
og: {
|
|
3219
3222
|
title: n.og_title || void 0,
|
|
3220
3223
|
description: n.og_description || void 0,
|
|
3221
|
-
image:
|
|
3224
|
+
image: Mr(n.og_image),
|
|
3222
3225
|
url: n.og_url || void 0
|
|
3223
3226
|
},
|
|
3224
3227
|
twitter: { card: n.twitter_card || void 0 },
|
|
3225
3228
|
ldJson: n.ld_json || void 0,
|
|
3226
3229
|
customHead: n.head_code || void 0
|
|
3227
3230
|
};
|
|
3228
|
-
},
|
|
3231
|
+
}, Pr = (e) => ({
|
|
3229
3232
|
description: e.description || void 0,
|
|
3230
3233
|
icon: e.icon?.location || void 0,
|
|
3231
3234
|
customHead: e.settings?.head_code || void 0
|
|
3232
|
-
}),
|
|
3233
|
-
let i =
|
|
3235
|
+
}), Fr = (e) => (t = {}, n) => (r) => {
|
|
3236
|
+
let i = Nr(t, e.name);
|
|
3234
3237
|
if (n) {
|
|
3235
3238
|
let t = r?.loaderData?.[n.source];
|
|
3236
3239
|
if (t) {
|
|
3237
|
-
let r = n.title ?
|
|
3240
|
+
let r = n.title ? jr(t[n.title]) : void 0;
|
|
3238
3241
|
r && (i.title = e.name ? `${r} | ${e.name}` : r, i.og = {
|
|
3239
3242
|
...i.og,
|
|
3240
3243
|
title: r
|
|
3241
3244
|
});
|
|
3242
|
-
let a = n.description ?
|
|
3245
|
+
let a = n.description ? jr(t[n.description]) : void 0;
|
|
3243
3246
|
a && (i.description = a, i.og = {
|
|
3244
3247
|
...i.og,
|
|
3245
3248
|
description: a
|
|
3246
3249
|
});
|
|
3247
|
-
let o = n.image ?
|
|
3250
|
+
let o = n.image ? Mr(t[n.image]) : void 0;
|
|
3248
3251
|
o && (i.og = {
|
|
3249
3252
|
...i.og,
|
|
3250
3253
|
image: o
|
|
@@ -3253,31 +3256,31 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
3253
3256
|
}
|
|
3254
3257
|
if (!i.canonical) {
|
|
3255
3258
|
let t = r?.match?.pathname, n = (e.domain || "").trim();
|
|
3256
|
-
n && t?.startsWith("/") && (i.canonical = (/^https?:\/\//.test(n) ? n : `https://${n}`).replace(/\/+$/, "") +
|
|
3259
|
+
n && t?.startsWith("/") && (i.canonical = (/^https?:\/\//.test(n) ? n : `https://${n}`).replace(/\/+$/, "") + Ar(t));
|
|
3257
3260
|
}
|
|
3258
|
-
let a =
|
|
3261
|
+
let a = ur(i, Pr(e)), o = t.id?.trim();
|
|
3259
3262
|
return o && a.meta.push({
|
|
3260
|
-
name:
|
|
3263
|
+
name: Bn,
|
|
3261
3264
|
content: o
|
|
3262
3265
|
}), a;
|
|
3263
|
-
},
|
|
3266
|
+
}, Ir = (e) => {
|
|
3264
3267
|
let t = Ee(e);
|
|
3265
3268
|
return (e, n) => {
|
|
3266
3269
|
let { rules: r, invalid: i } = ve(n?.access), a = r.length > 0 || i;
|
|
3267
|
-
return ({ context: n, params: r }) => a ? Promise.resolve({}) :
|
|
3270
|
+
return ({ context: n, params: r }) => a ? Promise.resolve({}) : ze({
|
|
3268
3271
|
queryClient: n.queryClient,
|
|
3269
3272
|
config: t,
|
|
3270
3273
|
sources: e,
|
|
3271
3274
|
params: r
|
|
3272
3275
|
});
|
|
3273
3276
|
};
|
|
3274
|
-
},
|
|
3275
|
-
let { limit: t = 20, debounceMs: n = 300, hotkey: r = !0 } = e ?? {}, a = i(), o =
|
|
3277
|
+
}, Lr = 2, Rr = (e) => {
|
|
3278
|
+
let { limit: t = 20, debounceMs: n = 300, hotkey: r = !0 } = e ?? {}, a = i(), o = Kn(), s = J(), [c, l] = P(""), [u, d] = P(!1), [f, p] = P("");
|
|
3276
3279
|
A(() => {
|
|
3277
3280
|
let e = setTimeout(() => p(c.trim()), n);
|
|
3278
3281
|
return () => clearTimeout(e);
|
|
3279
3282
|
}, [c, n]);
|
|
3280
|
-
let m = f.length >=
|
|
3283
|
+
let m = f.length >= Lr, h = z({
|
|
3281
3284
|
queryKey: [
|
|
3282
3285
|
"levo-search",
|
|
3283
3286
|
o?.id ?? null,
|
|
@@ -3326,4 +3329,4 @@ var fr = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
3326
3329
|
};
|
|
3327
3330
|
};
|
|
3328
3331
|
//#endregion
|
|
3329
|
-
export {
|
|
3332
|
+
export { Et as ColorModeProvider, Fn as Inspector, de as LEVO_AUTH_METHODS, Y as LEVO_AUTH_QUERY_KEY, G as LEVO_OAUTH_METHODS, dt as LEVO_OTP_LENGTH, tt as LEVO_PENDING_APPROVAL_CODE, ue as LEVO_PRIMARY_AUTH_METHODS, m as LOCALE_COOKIE, l as LOCALE_REDIRECT_CACHE_CONTROL, vt as LevoChat, Ue as LevoEntryForm, kr as LevoEventRegister, Ot as LevoForm, Un as LevoPopups, Je as LevoProfileForm, Yn as LevoSiteProvider, er as LocaleHreflang, nr as LocaleProvider, Bn as PAGE_ID_META, dr as PageHead, ar as SiteLocaleProvider, $n as buildHreflangLinks, Fr as createLevoHead, Ir as createLevoLoader, _ as createRouteTreeMatcher, Te as createSiteClient, we as decideAccess, v as extractGeoAndLanguageData, nt as isPendingApprovalError, ft as isValidEmail, pt as isValidOtp, ht as isValidPhone, Xn as localeBeforeLoad, p as localePath, d as localeRedirectResponse, mt as normalizePhone, ur as pageHead, ve as parseAccess, lr as parseRawHead, ze as prefetchLevoSources, Zn as readLocaleConfig, Vn as readPageId, ye as resolveAuthMethods, g as resolveLocale, u as resolveLocaleRedirect, s as resolveLocaleRequest, Ee as siteConfigFromJson, f as splitLocalePrefix, Dt as useColorMode, or as useLanguageOptions, et as useLevoAccess, He as useLevoAuth, Le as useLevoForm, Jn as useLevoInsights, at as useLevoLogin, ut as useLevoOAuth, gt as useLevoOtpInput, Ie as useLevoRecord, Rr as useLevoSearch, qn as useLevoSite, Fe as useLevoSource, rr as useLocale, ir as useUrlLocale };
|