@levo-so/site-runtime 0.3.28 → 0.3.29
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/{BillingStep-CzrxHzkA.js → BillingStep-OT3ayt8x.js} +1 -1
- package/{BookingCard-DOHYKI_6.js → BookingCard-mqroL-wV.js} +2 -2
- package/CHANGELOG.md +19 -0
- package/{DateTimeWidget-B7p-A0FY.js → DateTimeWidget-DcsuQf6T.js} +1 -1
- package/{PhoneWidget-Rh1eP4pP.js → PhoneWidget-DbhgbvKH.js} +1 -1
- package/{PopupBody-DWM55Zh5-Cy9rnVZv.js → PopupBody-DWM55Zh5-BaxCgy8c.js} +2 -2
- package/{PopupDialog-DwAAJ8JS-niDho4kU.js → PopupDialog-DwAAJ8JS-DzVJh1br.js} +2 -2
- package/{PopupRenderer-BVtV4b9I-S7vK9JNa.js → PopupRenderer-BVtV4b9I-Z7QWR6y6.js} +2 -2
- package/{RichTextWidget-ClgWi7ZW.js → RichTextWidget-B_olC979.js} +1 -1
- package/blog-content.js +2 -2
- package/{dist-ZKuRfAWn.js → dist-B_29IiED.js} +3 -3
- package/{dist-DZ9NFwK3.js → dist-DTszGV-P.js} +1 -1
- package/index.js +133 -110
- package/package.json +3 -3
- package/popups.js +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { s as e } from "./dist-
|
|
2
|
+
import { s as e } from "./dist-B_29IiED.js";
|
|
3
3
|
import { n as t, t as n } from "./CollectionLabel-CmUFfc_7.js";
|
|
4
4
|
import { m as ee } from "./theme.cssm-iXnQwMCp.js";
|
|
5
5
|
import { c as te } from "react/compiler-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { c as e, r as t } from "./dist-
|
|
2
|
+
import { c as e, r as t } from "./dist-B_29IiED.js";
|
|
3
3
|
import { m as n } from "./theme.cssm-iXnQwMCp.js";
|
|
4
4
|
import { a as r } from "./inlineBaseTheme-DcNdMEYp.js";
|
|
5
|
-
import { BillingStep as i } from "./BillingStep-
|
|
5
|
+
import { BillingStep as i } from "./BillingStep-OT3ayt8x.js";
|
|
6
6
|
import a from "dayjs";
|
|
7
7
|
import { c as o } from "react/compiler-runtime";
|
|
8
8
|
import { useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @levo-so/site-runtime
|
|
2
2
|
|
|
3
|
+
## 0.3.29
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Verification-code boxes built on `useLevoOtpInput` no longer jump back after a digit. Typing a digit moved focus to the next box, but that box still saw the code from before the digit and sent focus back to the box just filled, selected, so the next digit typed over it. Focus now moves forward one box per digit, as it should. Pasting a code, backspace and the arrow keys behave as before. Nothing to change in site code.
|
|
8
|
+
- The multi-ticket cart (`LevoEventRegister` with `enableMultipleTicketBooking`) respects a ticket's per-account registration limit within the order. When one email repeats on a ticket more often than its `max_registrations_per_account` allows, the extra attendee's email field shows "This ticket allows N per email. Use a different email." and the order cannot go on until it changes. Before, the order went through to Pay and the server refused it there.
|
|
9
|
+
|
|
10
|
+
- Emails are compared ignoring case and surrounding spaces, as the server does.
|
|
11
|
+
- The first N attendees on a ticket stay valid and only the extras are flagged, so the error lands on the entry just typed.
|
|
12
|
+
- An email that is missing or malformed keeps that error first.
|
|
13
|
+
- Only this order is counted. Registrations made earlier are still checked by the server at Pay ("Registration limit reached").
|
|
14
|
+
- A ticket with no limit is never flagged. The one-ticket sheet is unchanged.
|
|
15
|
+
|
|
16
|
+
Nothing to change in site code.
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
- @levo-so/core@0.3.29
|
|
20
|
+
- @levo-so/insights@0.3.29
|
|
21
|
+
|
|
3
22
|
## 0.3.28
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as e, p as t, s as n } from "./dist-
|
|
1
|
+
import { h as e, p as t, s as n } from "./dist-B_29IiED.js";
|
|
2
2
|
import { m as r } from "./theme.cssm-iXnQwMCp.js";
|
|
3
3
|
import { a as i, i as a, n as o, r as s, t as c } from "./Popover-MSrVDAzg.js";
|
|
4
4
|
import { FieldInterfaces as l } from "@levo-so/core";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { h as e, o as t, p as ee, s as n } from "./dist-
|
|
2
|
+
import { h as e, o as t, p as ee, s as n } from "./dist-B_29IiED.js";
|
|
3
3
|
import { c as te } from "react/compiler-runtime";
|
|
4
4
|
import { useState as r } from "react";
|
|
5
5
|
import { useController as i } from "react-hook-form";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as e, i as t, m as n, n as r } from "./theme.cssm-iXnQwMCp.js";
|
|
2
|
-
import { a as i, i as a, l as o, n as s, o as c, r as l, u } from "./PopupDialog-DwAAJ8JS-
|
|
2
|
+
import { a as i, i as a, l as o, n as s, o as c, r as l, u } from "./PopupDialog-DwAAJ8JS-DzVJh1br.js";
|
|
3
3
|
import { o as d } from "./inlineBaseTheme-DcNdMEYp.js";
|
|
4
4
|
import { t as f } from "./inlineCollectionTheme-DjXuH3bK.js";
|
|
5
5
|
import { _ as p, a as m, c as h, d as g, f as _, g as v, h as y, i as b, l as x, m as S, n as C, o as w, p as T, r as E, s as D, t as O, u as k, v as A } from "./react-CENbCy5d.js";
|
|
@@ -59,7 +59,7 @@ var Z = [
|
|
|
59
59
|
...r,
|
|
60
60
|
children: a
|
|
61
61
|
}) : null;
|
|
62
|
-
}, $ = /* @__PURE__ */ u({ PopupBody: () => oe }), ne = F(() => import("./dist-
|
|
62
|
+
}, $ = /* @__PURE__ */ u({ PopupBody: () => oe }), ne = F(() => import("./dist-B_29IiED.js").then((e) => e.t).then((e) => ({ default: e.CollectionFormBuilder }))), re = N({ baseSpacing: ".625rem" }), ie = { style: f({ form: { gap: "1rem" } }) }, ae = {
|
|
63
63
|
left: s,
|
|
64
64
|
center: a,
|
|
65
65
|
right: o
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as e, d as t, l as n, o as r, p as i, s as a, t as o, u as s } from "./theme.cssm-iXnQwMCp.js";
|
|
2
|
-
import { a as c, c as l, f as u, i as d, o as f, p, r as m, s as h } from "./dist-
|
|
2
|
+
import { a as c, c as l, f as u, i as d, o as f, p, r as m, s as h } from "./dist-DTszGV-P.js";
|
|
3
3
|
import { t as g } from "./rteTheme.cssm-BRxusHY4.js";
|
|
4
4
|
import { c as _ } from "react/compiler-runtime";
|
|
5
5
|
import { Suspense as v, createContext as y, lazy as b, useContext as x, useEffect as S, useRef as C } from "react";
|
|
@@ -171,7 +171,7 @@ var R = Object.defineProperty, z = (e, t) => {
|
|
|
171
171
|
...a,
|
|
172
172
|
children: n
|
|
173
173
|
}), t[15] = n, t[16] = a, t[17] = h, t[18] = v) : v = t[18], v;
|
|
174
|
-
}, ce = b(() => import("./PopupBody-DWM55Zh5-
|
|
174
|
+
}, ce = b(() => import("./PopupBody-DWM55Zh5-BaxCgy8c.js").then((e) => e.n).then((e) => ({ default: e.PopupBody }))), le = (e) => {
|
|
175
175
|
let t = _(7), { size: n } = e, r = n ?? "medium", i;
|
|
176
176
|
t[0] === r ? i = t[1] : (i = U({ size: r }), t[0] = r, t[1] = i);
|
|
177
177
|
let a, o, s;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as e, r as t, s as n, t as r, u as i } from "./PopupDialog-DwAAJ8JS-
|
|
1
|
+
import { c as e, r as t, s as n, t as r, u as i } from "./PopupDialog-DwAAJ8JS-DzVJh1br.js";
|
|
2
2
|
import { a, c as o } from "./inlineBaseTheme-DcNdMEYp.js";
|
|
3
|
-
import { d as s, l as c, r as l, u } from "./dist-
|
|
3
|
+
import { d as s, l as c, r as l, u } from "./dist-DTszGV-P.js";
|
|
4
4
|
import { c as d } from "react/compiler-runtime";
|
|
5
5
|
import { useEffect as f, useRef as p } from "react";
|
|
6
6
|
import { Fragment as m, jsx as h } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { d as e, f as t, h as n, l as r, m as i, p as a, u as o } from "./dist-
|
|
2
|
+
import { d as e, f as t, h as n, l as r, m as i, p as a, u as o } from "./dist-B_29IiED.js";
|
|
3
3
|
import { m as s } from "./theme.cssm-iXnQwMCp.js";
|
|
4
4
|
import { n as c, t as l } from "./content.cssm-D_LSloGW.js";
|
|
5
5
|
import { t as u } from "./inlineRteTheme-BYGIJM7P.js";
|
package/blog-content.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { i as e } from "./dist-
|
|
2
|
+
import { i as e } from "./dist-B_29IiED.js";
|
|
3
3
|
import { a as t, t as n } from "./inlineBaseTheme-DcNdMEYp.js";
|
|
4
|
-
import { t as r } from "./dist-
|
|
4
|
+
import { t as r } from "./dist-DTszGV-P.js";
|
|
5
5
|
import { _ as i, a, c as o, d as s, f as c, g as l, h as u, i as d, l as f, m as p, n as m, o as h, p as g, r as _, s as v, t as y, u as b, v as x } from "./react-CENbCy5d.js";
|
|
6
6
|
import { i as S, n as C, r as w, t as T } from "./content.cssm-D_LSloGW.js";
|
|
7
7
|
import { t as E } from "./RteThemeProvider-DtTXGcCT.js";
|
|
@@ -2638,7 +2638,7 @@ var ki = "_156u72w0", Ai = "_156u72w1", ji = (e) => Array.isArray(e) && e.every(
|
|
|
2638
2638
|
leftIcon: n,
|
|
2639
2639
|
...e
|
|
2640
2640
|
}), t[1] = e, t[2] = r), r;
|
|
2641
|
-
}, Pi = M(() => import("./DateTimeWidget-
|
|
2641
|
+
}, Pi = M(() => import("./DateTimeWidget-DcsuQf6T.js")), Fi = M(() => import("./PhoneWidget-DbhgbvKH.js")), Ii = M(() => import("./RichTextWidget-B_olC979.js")), Li = {
|
|
2642
2642
|
TextWidget: $((e) => /* @__PURE__ */ X($r, { ...e })),
|
|
2643
2643
|
NumberWidget: $((e) => /* @__PURE__ */ X($r, {
|
|
2644
2644
|
type: "number",
|
|
@@ -2870,7 +2870,7 @@ var Ui = ((e) => (t) => t ? Hi(e, t) : e)({
|
|
|
2870
2870
|
}), t[23] = p, t[24] = h, t[25] = i, t[26] = a, t[27] = o, t[28] = v, t[29] = y) : y = t[29], y;
|
|
2871
2871
|
}, Yi = (e, t) => e?.map((e) => ({
|
|
2872
2872
|
...e,
|
|
2873
|
-
hidden: e.hidden || t.includes(e.key) || t.includes(e.id) || e.allow_public_submit === !1,
|
|
2873
|
+
hidden: e.hidden || t.includes(e.key) || t.includes(e.id) || e.allow_public_view === !1 || e.allow_public_submit === !1,
|
|
2874
2874
|
fields: Yi(e.fields, t)
|
|
2875
2875
|
})), Xi = (e, t = []) => ({
|
|
2876
2876
|
...e,
|
|
@@ -4386,7 +4386,7 @@ var Bo = (e) => e && typeof e == "object" && "_id" in e ? e._id : e, Vo = (e) =>
|
|
|
4386
4386
|
} catch {
|
|
4387
4387
|
return !0;
|
|
4388
4388
|
}
|
|
4389
|
-
}, Uo = (e) => e ? { headers: { Origin: e } } : {}, Wo = "_165z1im3", Go = "_165z1im4", Ko = M(() => import("./BillingStep-
|
|
4389
|
+
}, Uo = (e) => e ? { headers: { Origin: e } } : {}, Wo = "_165z1im3", Go = "_165z1im4", Ko = M(() => import("./BillingStep-OT3ayt8x.js").then((e) => ({ default: e.BillingStep }))), qo = M(() => import("./BookingCard-mqroL-wV.js").then((e) => ({ default: e.BookingCard }))), Jo = "We couldn't start your booking. Please try again.", Yo = ({ hiddenFields: e, fetchedSchema: t, isLoading: n, enableVerification: r = !0, workspace_id: i, workspace_name: a, onBookingComplete: o, onSuccess: s, ...c }) => {
|
|
4390
4390
|
let { fetch: l, collection: u, logger: d } = f(), [p, m] = R({ name: "form" }), [h, g] = R(null), [_, v] = R(null), y = I(() => t ? Xi(t, e) : null, [t, e]), b = y?.settings?.booking_config ?? {}, x = async (e) => {
|
|
4391
4391
|
let t = e?.meta?.booking_config;
|
|
4392
4392
|
if (t?.enabled && e?.response?._id && await Ho({
|
|
@@ -311,7 +311,7 @@ var he = /* @__PURE__ */ e({
|
|
|
311
311
|
}), Q = async (e, t) => {
|
|
312
312
|
let n = {};
|
|
313
313
|
return t?.site_id && (n.site_id = t.site_id), t?.locale && (n.locale = t.locale), t?.country && (n.country = t.country), (await e.url("/v1/studio/popup/list-active").query(n).get().json())?.content?.data ?? [];
|
|
314
|
-
}, ge = a(() => import("./PopupRenderer-BVtV4b9I-
|
|
314
|
+
}, ge = a(() => import("./PopupRenderer-BVtV4b9I-Z7QWR6y6.js").then((e) => e.t).then((e) => ({ default: e.PopupRenderer }))), _e = (e) => {
|
|
315
315
|
let n = r(9), { siteId: a, pageId: o } = e, { fetch: u, logger: p } = t(), [m, h] = l(null), g = c(!1), _, v;
|
|
316
316
|
if (n[0] !== u || n[1] !== p || n[2] !== a ? (_ = () => {
|
|
317
317
|
if (g.current) return;
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as e, n as t } from "./dist-
|
|
2
|
+
import { a as e, n as t } from "./dist-B_29IiED.js";
|
|
3
3
|
import { c as n, o as r, s as i, t as a } from "./inlineBaseTheme-DcNdMEYp.js";
|
|
4
4
|
import { t as o } from "./inlineCollectionTheme-DjXuH3bK.js";
|
|
5
5
|
import { a as s, c, d as l, f as u, i as d, l as f, n as p, o as m, r as h, s as g, t as _, u as v } from "./routes-DO1BLfh9.js";
|
|
@@ -666,78 +666,83 @@ var q = ["levo-auth", "session"], nt = () => {
|
|
|
666
666
|
}, kt = (e) => /^\+[1-9]\d{7,14}$/.test(Ot(e)), At = ({ value: e, onChange: t, length: n = 4, onComplete: r, autoFocus: i, disabled: a }) => {
|
|
667
667
|
let o = k([]), [s, c] = A(null), l = k(r);
|
|
668
668
|
l.current = r;
|
|
669
|
-
let u =
|
|
669
|
+
let u = k(e);
|
|
670
|
+
D(() => {
|
|
671
|
+
u.current = e;
|
|
672
|
+
});
|
|
673
|
+
let d = Array.from({ length: n }, (t, n) => e[n] ?? ""), f = w((e) => {
|
|
670
674
|
let t = Math.max(0, Math.min(n - 1, e)), r = o.current[t];
|
|
671
675
|
r?.focus(), r?.select();
|
|
672
676
|
}, [n]);
|
|
673
677
|
E(() => {
|
|
674
|
-
i && !a &&
|
|
678
|
+
i && !a && f(0);
|
|
675
679
|
}, [
|
|
676
680
|
i,
|
|
677
681
|
a,
|
|
678
|
-
|
|
682
|
+
f
|
|
679
683
|
]);
|
|
680
|
-
let
|
|
684
|
+
let p = w((e, r) => {
|
|
681
685
|
let i = e.slice(0, n);
|
|
682
|
-
t(i),
|
|
686
|
+
u.current = i, t(i), f(r), i.length === n && l.current?.(i);
|
|
683
687
|
}, [
|
|
684
688
|
n,
|
|
685
689
|
t,
|
|
686
|
-
|
|
687
|
-
]),
|
|
690
|
+
f
|
|
691
|
+
]), m = (t, r) => {
|
|
688
692
|
let i = r.replace(/\D/g, "");
|
|
689
693
|
if (!i) return;
|
|
690
694
|
if (i.length > 1) {
|
|
691
695
|
let r = (e.slice(0, t) + i).slice(0, n);
|
|
692
|
-
|
|
696
|
+
p(r, r.length);
|
|
693
697
|
return;
|
|
694
698
|
}
|
|
695
|
-
let a = [...
|
|
696
|
-
a[t] = i,
|
|
697
|
-
},
|
|
699
|
+
let a = [...d];
|
|
700
|
+
a[t] = i, p(a.join("").slice(0, Math.max(t + 1, e.length)), t + 1);
|
|
701
|
+
}, h = (t, n) => {
|
|
698
702
|
if (n.key === "Backspace") {
|
|
699
703
|
n.preventDefault();
|
|
700
|
-
let r =
|
|
704
|
+
let r = d[t] ? t : t - 1;
|
|
701
705
|
if (r < 0) return;
|
|
702
|
-
|
|
706
|
+
p(e.slice(0, r), r);
|
|
703
707
|
return;
|
|
704
708
|
}
|
|
705
709
|
if (n.key === "ArrowLeft") {
|
|
706
|
-
n.preventDefault(),
|
|
710
|
+
n.preventDefault(), f(t - 1);
|
|
707
711
|
return;
|
|
708
712
|
}
|
|
709
|
-
n.key === "ArrowRight" && (n.preventDefault(),
|
|
710
|
-
},
|
|
713
|
+
n.key === "ArrowRight" && (n.preventDefault(), f(Math.min(t + 1, e.length)));
|
|
714
|
+
}, g = (e) => {
|
|
711
715
|
e.preventDefault();
|
|
712
716
|
let t = e.clipboardData.getData("text").replace(/\D/g, "");
|
|
713
717
|
if (!t) return;
|
|
714
718
|
let r = t.slice(0, n);
|
|
715
|
-
|
|
719
|
+
p(r, r.length);
|
|
716
720
|
};
|
|
717
721
|
return {
|
|
718
|
-
slots:
|
|
719
|
-
char:
|
|
720
|
-
isActive: s ===
|
|
722
|
+
slots: d.map((e, t) => ({
|
|
723
|
+
char: e,
|
|
724
|
+
isActive: s === t,
|
|
721
725
|
inputProps: {
|
|
722
726
|
ref: (e) => {
|
|
723
|
-
o.current[
|
|
727
|
+
o.current[t] = e;
|
|
724
728
|
},
|
|
725
|
-
value:
|
|
729
|
+
value: e,
|
|
726
730
|
inputMode: "numeric",
|
|
727
|
-
autoComplete:
|
|
731
|
+
autoComplete: t === 0 ? "one-time-code" : "off",
|
|
728
732
|
type: "text",
|
|
729
|
-
"aria-label": `Digit ${
|
|
730
|
-
onChange: (e) =>
|
|
731
|
-
onKeyDown: (e) =>
|
|
732
|
-
onPaste:
|
|
733
|
+
"aria-label": `Digit ${t + 1} of ${n}`,
|
|
734
|
+
onChange: (e) => m(t, e.target.value),
|
|
735
|
+
onKeyDown: (e) => h(t, e),
|
|
736
|
+
onPaste: g,
|
|
733
737
|
onFocus: () => {
|
|
734
|
-
|
|
735
|
-
|
|
738
|
+
let e = u.current;
|
|
739
|
+
if (t > e.length) {
|
|
740
|
+
f(e.length);
|
|
736
741
|
return;
|
|
737
742
|
}
|
|
738
|
-
c(
|
|
743
|
+
c(t);
|
|
739
744
|
},
|
|
740
|
-
onBlur: () => c((e) => e ===
|
|
745
|
+
onBlur: () => c((e) => e === t ? null : e),
|
|
741
746
|
disabled: a
|
|
742
747
|
}
|
|
743
748
|
})),
|
|
@@ -745,7 +750,7 @@ var q = ["levo-auth", "session"], nt = () => {
|
|
|
745
750
|
role: "group",
|
|
746
751
|
"aria-label": `${n}-digit verification code`
|
|
747
752
|
},
|
|
748
|
-
clear: w(() =>
|
|
753
|
+
clear: w(() => p("", 0), [p])
|
|
749
754
|
};
|
|
750
755
|
}, jt = C(() => import("./kbChat-eFsau7hG.js")), Mt = ({ site: e, path: t }) => {
|
|
751
756
|
let n = K(), r = e.workspace_id || void 0;
|
|
@@ -1897,7 +1902,7 @@ var $n = "levo-made-with", er = `.${$n}{opacity:.2;transition:opacity 150ms,tran
|
|
|
1897
1902
|
if (typeof document > "u") return null;
|
|
1898
1903
|
let e = document.querySelectorAll(`meta[name="${nr}"]`);
|
|
1899
1904
|
return e[e.length - 1]?.getAttribute("content")?.trim() || null;
|
|
1900
|
-
}, ir = C(() => import("./dist-
|
|
1905
|
+
}, ir = C(() => import("./dist-DTszGV-P.js").then((e) => e.n).then((e) => ({ default: e.PopupLoader }))), ar = ({ siteId: e, pageId: t }) => {
|
|
1901
1906
|
let n = K(), r = i();
|
|
1902
1907
|
return !n || !r ? null : /* @__PURE__ */ M(x, {
|
|
1903
1908
|
fallback: null,
|
|
@@ -3158,12 +3163,21 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3158
3163
|
];
|
|
3159
3164
|
for (let [e, i] of r) t[e] !== "off" && i && (n[e] = i);
|
|
3160
3165
|
return n;
|
|
3161
|
-
}, vi = (e
|
|
3166
|
+
}, vi = (e) => {
|
|
3167
|
+
let t = {}, n = /* @__PURE__ */ new Map();
|
|
3168
|
+
for (let r of e) {
|
|
3169
|
+
let e = r.ticket.max_registrations_per_account, i = r.email.trim().toLowerCase();
|
|
3170
|
+
if (!e || !i) continue;
|
|
3171
|
+
let a = `${r.ticket._id}|${i}`, o = (n.get(a) ?? 0) + 1;
|
|
3172
|
+
n.set(a, o), o > e && (t[r.key] = `This ticket allows ${e} per email. Use a different email.`);
|
|
3173
|
+
}
|
|
3174
|
+
return t;
|
|
3175
|
+
}, yi = (e, t) => {
|
|
3162
3176
|
let n = {};
|
|
3163
3177
|
e.name.trim() || (n.name = "Please enter your name"), t.email !== "off" && (e.email.trim() ? /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(e.email.trim()) || (n.email = "That email address doesn't look right") : t.email === "required" && (n.email = "Please enter your email")), t.mobile !== "off" && (e.mobile.trim() ? gi(e.mobile) || (n.mobile = "That doesn't look like a valid phone number") : t.mobile === "required" && (n.mobile = "Please enter your phone number"));
|
|
3164
3178
|
for (let r of ["organization", "designation"]) t[r] === "required" && !e[r].trim() && (n[r] = `Please enter your ${r}`);
|
|
3165
3179
|
return n;
|
|
3166
|
-
},
|
|
3180
|
+
}, bi = (e) => e.quantity === null || e.quantity === void 0 ? 10 : Math.max(0, Math.min(10, e.quantity - (e.sale_count ?? 0))), xi = "inline-flex size-8 items-center justify-center rounded-full border border-border text-ink transition hover:border-brand hover:text-brand active:scale-95 disabled:pointer-events-none disabled:opacity-35", Si = ({ tickets: e, counts: t, onChange: n, error: r }) => /* @__PURE__ */ N("fieldset", {
|
|
3167
3181
|
className: "m-0 flex min-w-0 flex-col gap-2 border-0 p-0",
|
|
3168
3182
|
children: [
|
|
3169
3183
|
/* @__PURE__ */ M("legend", {
|
|
@@ -3171,7 +3185,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3171
3185
|
children: "Choose your tickets"
|
|
3172
3186
|
}),
|
|
3173
3187
|
e.map((e) => {
|
|
3174
|
-
let r = t[e._id] ?? 0, i =
|
|
3188
|
+
let r = t[e._id] ?? 0, i = bi(e), a = i === 0, o = Br(e);
|
|
3175
3189
|
return /* @__PURE__ */ N("div", {
|
|
3176
3190
|
className: X("flex w-full items-start gap-3 rounded-xl border px-3.5 py-3 transition", r > 0 ? "border-brand bg-brand/5" : "border-border", a && "opacity-60"),
|
|
3177
3191
|
children: [/* @__PURE__ */ N("div", {
|
|
@@ -3207,7 +3221,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3207
3221
|
"aria-label": `Remove one ${e.title} ticket`,
|
|
3208
3222
|
disabled: r === 0,
|
|
3209
3223
|
onClick: () => n(e._id, r - 1),
|
|
3210
|
-
className:
|
|
3224
|
+
className: xi,
|
|
3211
3225
|
children: /* @__PURE__ */ M(le, { className: "size-3.5" })
|
|
3212
3226
|
}),
|
|
3213
3227
|
/* @__PURE__ */ N("span", {
|
|
@@ -3223,7 +3237,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3223
3237
|
"aria-label": `Add one ${e.title} ticket`,
|
|
3224
3238
|
disabled: r >= i,
|
|
3225
3239
|
onClick: () => n(e._id, r + 1),
|
|
3226
|
-
className:
|
|
3240
|
+
className: xi,
|
|
3227
3241
|
children: /* @__PURE__ */ M(ue, { className: "size-3.5" })
|
|
3228
3242
|
})
|
|
3229
3243
|
]
|
|
@@ -3262,13 +3276,13 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3262
3276
|
country: ""
|
|
3263
3277
|
}
|
|
3264
3278
|
}
|
|
3265
|
-
},
|
|
3279
|
+
}, Ci = {
|
|
3266
3280
|
name: !0,
|
|
3267
3281
|
email: !0,
|
|
3268
3282
|
mobile: !0,
|
|
3269
3283
|
organization: !0,
|
|
3270
3284
|
designation: !0
|
|
3271
|
-
},
|
|
3285
|
+
}, wi = (e, t) => {
|
|
3272
3286
|
let [n, r] = A(Q), [i, a] = A({}), [o, s] = A(!1), c = k(!1);
|
|
3273
3287
|
E(() => {
|
|
3274
3288
|
c.current || !e || (c.current = !0, r((t) => ({
|
|
@@ -3277,7 +3291,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3277
3291
|
email: t.email || e.email || ""
|
|
3278
3292
|
})));
|
|
3279
3293
|
}, [e]);
|
|
3280
|
-
let l =
|
|
3294
|
+
let l = yi(n, t), u = w((e, t) => r((n) => ({
|
|
3281
3295
|
...n,
|
|
3282
3296
|
[e]: t
|
|
3283
3297
|
})), []), d = w((e) => a((t) => ({
|
|
@@ -3298,9 +3312,9 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3298
3312
|
touchField: d,
|
|
3299
3313
|
reset: f,
|
|
3300
3314
|
resetValidationDisplay: p,
|
|
3301
|
-
touched: o ?
|
|
3315
|
+
touched: o ? Ci : i
|
|
3302
3316
|
};
|
|
3303
|
-
},
|
|
3317
|
+
}, Ti = (e, t, n) => {
|
|
3304
3318
|
let [r, i] = A({}), [a, o] = A({}), [s, c] = A({
|
|
3305
3319
|
is_business_purchase: Q.is_business_purchase,
|
|
3306
3320
|
billing_details: Q.billing_details
|
|
@@ -3324,7 +3338,16 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3324
3338
|
}, [e, p]);
|
|
3325
3339
|
let m = (e) => r[e] ?? Q, h = O(() => {
|
|
3326
3340
|
let e = {};
|
|
3327
|
-
for (let t of f) e[t.key] =
|
|
3341
|
+
for (let t of f) e[t.key] = yi(r[t.key] ?? Q, t.rules);
|
|
3342
|
+
let t = vi(f.map((e) => ({
|
|
3343
|
+
key: e.key,
|
|
3344
|
+
ticket: e.ticket,
|
|
3345
|
+
email: (r[e.key] ?? Q).email
|
|
3346
|
+
})));
|
|
3347
|
+
for (let [n, r] of Object.entries(t)) {
|
|
3348
|
+
let t = e[n];
|
|
3349
|
+
t && !t.email && (t.email = r);
|
|
3350
|
+
}
|
|
3328
3351
|
return e;
|
|
3329
3352
|
}, [f, r]), g = (e) => Object.keys(h[e] ?? {}).length === 0, _ = w((e, t, n) => i((r) => ({
|
|
3330
3353
|
...r,
|
|
@@ -3340,7 +3363,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3340
3363
|
}
|
|
3341
3364
|
})), []), y = w((e) => o((t) => ({
|
|
3342
3365
|
...t,
|
|
3343
|
-
[e]:
|
|
3366
|
+
[e]: Ci
|
|
3344
3367
|
})), []), b = w((e, t) => c((n) => ({
|
|
3345
3368
|
...n,
|
|
3346
3369
|
[e]: t
|
|
@@ -3358,7 +3381,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3358
3381
|
errors: h,
|
|
3359
3382
|
isSlotValid: g,
|
|
3360
3383
|
isValid: f.every((e) => g(e.key)),
|
|
3361
|
-
getTouched: (e) => l ?
|
|
3384
|
+
getTouched: (e) => l ? Ci : a[e] ?? {},
|
|
3362
3385
|
isSlotVisited: (e) => l || !!a[e],
|
|
3363
3386
|
submitAttempted: l,
|
|
3364
3387
|
markSubmitted: () => u(!0),
|
|
@@ -3370,15 +3393,15 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3370
3393
|
reset: x,
|
|
3371
3394
|
resetValidationDisplay: S
|
|
3372
3395
|
};
|
|
3373
|
-
},
|
|
3374
|
-
if (e.status === "archived" || e.starts_at && new Date(e.starts_at).getTime() > n || e.expires_at && new Date(e.expires_at).getTime() < n || e.max_redemptions && e.redeem_count >= e.max_redemptions || e.min_trnx_amount &&
|
|
3375
|
-
let r = e.tickets.map(
|
|
3396
|
+
}, Ei = (e) => typeof e == "string" ? e : e._id, Di = (e) => e.reduce((e, t) => e + (t.unit_amount ?? 0), 0), Oi = (e, t, n = Date.now()) => e.flatMap((e) => {
|
|
3397
|
+
if (e.status === "archived" || e.starts_at && new Date(e.starts_at).getTime() > n || e.expires_at && new Date(e.expires_at).getTime() < n || e.max_redemptions && e.redeem_count >= e.max_redemptions || e.min_trnx_amount && Di(t) < e.min_trnx_amount) return [];
|
|
3398
|
+
let r = e.tickets.map(Ei), i = Di(t.filter((e) => r.includes(e._id))), a = e.kind === "percent" ? Math.round(i * (e.percent_off ?? 0) / 100) : Math.min(e.amount_off ?? 0, i), o = e.max_amount_off ? Math.min(a, e.max_amount_off) : a;
|
|
3376
3399
|
return o > 0 ? [{
|
|
3377
3400
|
coupon: e,
|
|
3378
3401
|
saving: o
|
|
3379
3402
|
}] : [];
|
|
3380
|
-
}).sort((e, t) => t.saving - e.saving),
|
|
3381
|
-
let r = i(), a = t.map((e) => e._id).join(","), [o, s] = A(null), [c, l] = A(null), [u, d] = A(null), [f, p] = A(null), m = k(0), h = k(null), g =
|
|
3403
|
+
}).sort((e, t) => t.saving - e.saving), ki = ({ eventID: e, tickets: t, enabled: n }) => {
|
|
3404
|
+
let r = i(), a = t.map((e) => e._id).join(","), [o, s] = A(null), [c, l] = A(null), [u, d] = A(null), [f, p] = A(null), m = k(0), h = k(null), g = Oi(f ?? [], t), _ = g[0]?.coupon.code;
|
|
3382
3405
|
E(() => {
|
|
3383
3406
|
!n || !e || !r || r.fetch?.url(`/v1/event/event/${e}/coupon/list-public-coupons`)?.get().json().then((e) => {
|
|
3384
3407
|
p(e?.status ? e.content?.data ?? [] : []);
|
|
@@ -3446,13 +3469,13 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3446
3469
|
apply: v,
|
|
3447
3470
|
reset: y
|
|
3448
3471
|
};
|
|
3449
|
-
},
|
|
3472
|
+
}, Ai = async (e, t) => {
|
|
3450
3473
|
let n = new URLSearchParams();
|
|
3451
3474
|
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 ?? [];
|
|
3452
|
-
},
|
|
3475
|
+
}, ji = ({ eventID: e, external: t }) => {
|
|
3453
3476
|
let n = i(), [r, a] = A([]), [o, s] = A(!t), [c, l] = A(!1), [u, d] = A(null);
|
|
3454
3477
|
return E(() => {
|
|
3455
|
-
t || !e || !n || (s(!0), l(!1),
|
|
3478
|
+
t || !e || !n || (s(!0), l(!1), Ai(n, e).then((e) => {
|
|
3456
3479
|
a(e), e.length === 1 && d(e[0] ?? null);
|
|
3457
3480
|
}).catch((e) => {
|
|
3458
3481
|
l(!0), n.logger?.error("Failed to load event tickets", { exception: b(e) });
|
|
@@ -3468,7 +3491,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3468
3491
|
selectedTicket: u,
|
|
3469
3492
|
selectTicket: d
|
|
3470
3493
|
};
|
|
3471
|
-
},
|
|
3494
|
+
}, Mi = async (e) => {
|
|
3472
3495
|
let { payment_session_id: t, order_id: n } = e;
|
|
3473
3496
|
if (!t || !n) throw Error("Cashfree payment session missing");
|
|
3474
3497
|
let { load: r } = await import("./script.esm-D4nvz3-k.js"), i = await r({ mode: e.environment || "production" });
|
|
@@ -3484,7 +3507,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3484
3507
|
status: "closed",
|
|
3485
3508
|
message: a.error?.message
|
|
3486
3509
|
};
|
|
3487
|
-
},
|
|
3510
|
+
}, Ni = () => typeof window < "u" && "Razorpay" in window, Pi = ({ order: e, onSettled: t, onError: n }) => {
|
|
3488
3511
|
let { Razorpay: r, isLoading: i, error: a } = fe(), o = k({
|
|
3489
3512
|
onSettled: t,
|
|
3490
3513
|
onError: n
|
|
@@ -3500,7 +3523,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3500
3523
|
s.current = !0, o.current.onError(Error(a));
|
|
3501
3524
|
return;
|
|
3502
3525
|
}
|
|
3503
|
-
if (!r || !
|
|
3526
|
+
if (!r || !Ni()) return;
|
|
3504
3527
|
s.current = !0;
|
|
3505
3528
|
let t;
|
|
3506
3529
|
try {
|
|
@@ -3538,7 +3561,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3538
3561
|
a,
|
|
3539
3562
|
e
|
|
3540
3563
|
]), null;
|
|
3541
|
-
},
|
|
3564
|
+
}, Fi = ({ stripePromise: e, clientSecret: t, onClose: n, onComplete: r }) => {
|
|
3542
3565
|
let i = k(r);
|
|
3543
3566
|
i.current = r;
|
|
3544
3567
|
let a = O(() => ({
|
|
@@ -3566,9 +3589,9 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3566
3589
|
})]
|
|
3567
3590
|
})] })
|
|
3568
3591
|
});
|
|
3569
|
-
},
|
|
3592
|
+
}, Ii = () => {
|
|
3570
3593
|
let [e, t] = A(null), n = w(async (e, n) => {
|
|
3571
|
-
if (e.provider === "cashfree") return
|
|
3594
|
+
if (e.provider === "cashfree") return Mi(e);
|
|
3572
3595
|
if (e.provider === "stripe") {
|
|
3573
3596
|
let { client_secret: n, session_id: r } = e;
|
|
3574
3597
|
if (!n || !r) throw Error("Stripe checkout session missing");
|
|
@@ -3602,7 +3625,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3602
3625
|
}, []), r = (e, n) => {
|
|
3603
3626
|
t(null), n instanceof Error ? e.settle.reject(n) : e.settle.resolve(n);
|
|
3604
3627
|
}, i = null;
|
|
3605
|
-
return e?.provider === "stripe" ? i = /* @__PURE__ */ M(
|
|
3628
|
+
return e?.provider === "stripe" ? i = /* @__PURE__ */ M(Fi, {
|
|
3606
3629
|
stripePromise: e.stripePromise,
|
|
3607
3630
|
clientSecret: e.clientSecret,
|
|
3608
3631
|
onComplete: () => r(e, {
|
|
@@ -3610,7 +3633,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3610
3633
|
confirmation: { session_id: e.sessionId }
|
|
3611
3634
|
}),
|
|
3612
3635
|
onClose: () => r(e, { status: "closed" })
|
|
3613
|
-
}) : e?.provider === "razorpay" && (i = /* @__PURE__ */ M(
|
|
3636
|
+
}) : e?.provider === "razorpay" && (i = /* @__PURE__ */ M(Pi, {
|
|
3614
3637
|
order: e.order,
|
|
3615
3638
|
onSettled: (t) => r(e, t),
|
|
3616
3639
|
onError: (t) => r(e, t)
|
|
@@ -3624,8 +3647,8 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3624
3647
|
providerUnreachable: "We couldn't reach the payment provider. Check your connection and try again.",
|
|
3625
3648
|
confirmationFailed: "We couldn't confirm your payment. Your details are saved — try again.",
|
|
3626
3649
|
generic: "Something went wrong. Please try again."
|
|
3627
|
-
},
|
|
3628
|
-
let r = i(), a =
|
|
3650
|
+
}, Li = (e) => !!e && e.status !== "requires_payment", Ri = ({ eventID: e, details: t, onConfirmed: n }) => {
|
|
3651
|
+
let r = i(), a = Ii(), [o, s] = A({ kind: "idle" }), c = k({
|
|
3629
3652
|
details: t,
|
|
3630
3653
|
onConfirmed: n
|
|
3631
3654
|
});
|
|
@@ -3641,7 +3664,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3641
3664
|
message: t
|
|
3642
3665
|
}), d = async (e, t) => {
|
|
3643
3666
|
if (!t?.key) {
|
|
3644
|
-
|
|
3667
|
+
Li(e) ? l(e) : s({
|
|
3645
3668
|
kind: "failed",
|
|
3646
3669
|
message: $.registrationFailed
|
|
3647
3670
|
});
|
|
@@ -3675,7 +3698,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3675
3698
|
}
|
|
3676
3699
|
try {
|
|
3677
3700
|
let t = (await r?.fetch?.url(`/v1/event/booking/${e._id}/confirm-booking`)?.post(n.confirmation)?.json())?.content?.data;
|
|
3678
|
-
|
|
3701
|
+
Li(t) ? l(t) : u(e._id, $.paymentAbandoned);
|
|
3679
3702
|
} catch (t) {
|
|
3680
3703
|
r?.logger?.error("Failed to confirm booking after payment", { exception: b(t) }), u(e._id, $.confirmationFailed);
|
|
3681
3704
|
}
|
|
@@ -3714,67 +3737,67 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3714
3737
|
},
|
|
3715
3738
|
reset: () => s({ kind: "idle" })
|
|
3716
3739
|
};
|
|
3717
|
-
},
|
|
3740
|
+
}, zi = (e) => `levo:event-registration:${e}`, Bi = (e) => {
|
|
3718
3741
|
if (typeof window > "u") return null;
|
|
3719
3742
|
try {
|
|
3720
|
-
let t = window.localStorage.getItem(
|
|
3743
|
+
let t = window.localStorage.getItem(zi(e));
|
|
3721
3744
|
return t ? JSON.parse(t) : null;
|
|
3722
3745
|
} catch {
|
|
3723
3746
|
return null;
|
|
3724
3747
|
}
|
|
3725
|
-
},
|
|
3748
|
+
}, Vi = (e, t) => {
|
|
3726
3749
|
if (!(typeof window > "u")) try {
|
|
3727
|
-
window.localStorage.setItem(
|
|
3750
|
+
window.localStorage.setItem(zi(e), JSON.stringify(t));
|
|
3728
3751
|
} catch {}
|
|
3729
|
-
},
|
|
3752
|
+
}, Hi = (e) => {
|
|
3730
3753
|
if (!(typeof window > "u")) try {
|
|
3731
|
-
window.localStorage.removeItem(
|
|
3754
|
+
window.localStorage.removeItem(zi(e));
|
|
3732
3755
|
} catch {}
|
|
3733
|
-
},
|
|
3756
|
+
}, Ui = (e) => {
|
|
3734
3757
|
let [t, n] = A(null), [r, i] = A(null);
|
|
3735
3758
|
return E(() => {
|
|
3736
|
-
let t =
|
|
3759
|
+
let t = Bi(e);
|
|
3737
3760
|
t && i(t.email);
|
|
3738
3761
|
}, [e]), {
|
|
3739
3762
|
booking: t,
|
|
3740
3763
|
registeredEmail: r,
|
|
3741
3764
|
complete: (t, r) => {
|
|
3742
|
-
n(t), i(r),
|
|
3765
|
+
n(t), i(r), Vi(e, {
|
|
3743
3766
|
bookingId: t._id,
|
|
3744
3767
|
email: r,
|
|
3745
3768
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
3746
3769
|
});
|
|
3747
3770
|
},
|
|
3748
3771
|
clear: () => {
|
|
3749
|
-
|
|
3772
|
+
Hi(e), i(null), n(null);
|
|
3750
3773
|
}
|
|
3751
3774
|
};
|
|
3752
|
-
},
|
|
3775
|
+
}, Wi = "register", Gi = () => {
|
|
3753
3776
|
if (typeof window > "u") return !1;
|
|
3754
|
-
let e = new URLSearchParams(window.location.search).get(
|
|
3777
|
+
let e = new URLSearchParams(window.location.search).get(Wi);
|
|
3755
3778
|
return e !== null && e !== "0" && e !== "false";
|
|
3756
|
-
},
|
|
3779
|
+
}, Ki = ({ canAutoOpen: e }) => {
|
|
3757
3780
|
let [t, n] = A(!1), r = k(!1), i = w(() => n(!0), []), a = w(() => n(!1), []);
|
|
3758
3781
|
return E(() => {
|
|
3759
|
-
r.current || !e || !
|
|
3782
|
+
r.current || !e || !Gi() || (r.current = !0, n(!0));
|
|
3760
3783
|
}, [e]), {
|
|
3761
3784
|
isOpen: t,
|
|
3762
3785
|
open: i,
|
|
3763
3786
|
close: a
|
|
3764
3787
|
};
|
|
3765
|
-
},
|
|
3766
|
-
let { account: o } = nt(), s = cr(), c =
|
|
3788
|
+
}, qi = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Ji = ({ eventID: e, title: t, buttonText: n = "Register Now", startsAt: r, endsAt: i, eventUrl: a }) => {
|
|
3789
|
+
let { account: o } = nt(), s = cr(), c = ji({ eventID: e }), [l, u] = A({}), [d, f] = A("tickets"), [p, m] = A(!1), [h, g] = A(null), _ = c.tickets.length === 1 ? c.tickets[0]?._id : void 0;
|
|
3767
3790
|
E(() => {
|
|
3768
3791
|
_ && u((e) => ({ [_]: e[_] || 1 }));
|
|
3769
3792
|
}, [_]);
|
|
3770
3793
|
let v = O(() => c.tickets.map((e) => ({
|
|
3771
3794
|
ticket: e,
|
|
3772
3795
|
count: l[e._id] ?? 0
|
|
3773
|
-
})).filter((e) => e.count > 0), [c.tickets, l]), y = v.reduce((e, t) => e + t.count, 0), b =
|
|
3796
|
+
})).filter((e) => e.count > 0), [c.tickets, l]), y = v.reduce((e, t) => e + t.count, 0), b = Ti(o, c.tickets, l), x = b.slots[0] ? b.getValues(b.slots[0].key) : null, S = Ui(e), { booking: C } = S, w = Ki({ canAutoOpen: !c.isLoading && c.tickets.length > 0 && !S.registeredEmail }), T = v.some((e) => Ur(e.ticket, null) > 0), D = ki({
|
|
3774
3797
|
eventID: e,
|
|
3775
3798
|
tickets: b.slots.map((e) => e.ticket),
|
|
3776
3799
|
enabled: w.isOpen && T && d === "review"
|
|
3777
|
-
}), k = Jr(v, D.discount), ee = !!k && !k.isFree, P = O(() => ei(r, i), [r, i]), F = t || "this event", I =
|
|
3800
|
+
}), k = Jr(v, D.discount), ee = !!k && !k.isFree, P = O(() => ei(r, i), [r, i]), F = t || "this event", I = Ri({
|
|
3778
3801
|
eventID: e,
|
|
3779
3802
|
details: {
|
|
3780
3803
|
merchantName: s?.name || t || "",
|
|
@@ -3849,7 +3872,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3849
3872
|
className: "min-w-0 flex-1",
|
|
3850
3873
|
children: [/* @__PURE__ */ M("span", {
|
|
3851
3874
|
className: "block font-semibold text-[15px] text-ink tabular-nums",
|
|
3852
|
-
children: y === 0 ? "No tickets yet" :
|
|
3875
|
+
children: y === 0 ? "No tickets yet" : qi(y, "ticket")
|
|
3853
3876
|
}), y > 0 && /* @__PURE__ */ M("span", {
|
|
3854
3877
|
className: "block text-[12.5px] text-ink-soft tabular-nums",
|
|
3855
3878
|
children: z ?? "Free"
|
|
@@ -3905,7 +3928,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3905
3928
|
attendeeCount: b.slots.length,
|
|
3906
3929
|
onClose: w.close,
|
|
3907
3930
|
onRegisterAnother: R
|
|
3908
|
-
}) : d === "tickets" ? /* @__PURE__ */ M(
|
|
3931
|
+
}) : d === "tickets" ? /* @__PURE__ */ M(Si, {
|
|
3909
3932
|
tickets: c.tickets,
|
|
3910
3933
|
counts: l,
|
|
3911
3934
|
onChange: L,
|
|
@@ -3949,7 +3972,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
3949
3972
|
]
|
|
3950
3973
|
})
|
|
3951
3974
|
})] });
|
|
3952
|
-
},
|
|
3975
|
+
}, Yi = ({ selectedTicket: e, discount: t }) => {
|
|
3953
3976
|
let [n, r] = A(!1), i = e?.currency, a = Ur(e, t), o = Gr(e, t), s = Kr(e, t), c = t?.discount ?? 0, l = s.length > 0 || c > 0 || o !== a, u = /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ N("span", {
|
|
3954
3977
|
className: "inline-flex items-center gap-1.5",
|
|
3955
3978
|
children: ["Total", l && /* @__PURE__ */ M(oe, { className: X("size-4 text-ink-muted transition-transform", n && "rotate-180") })]
|
|
@@ -4007,7 +4030,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
4007
4030
|
})
|
|
4008
4031
|
})]
|
|
4009
4032
|
});
|
|
4010
|
-
},
|
|
4033
|
+
}, Xi = ({ tickets: e, selectedTicket: t, onSelect: n, error: r }) => {
|
|
4011
4034
|
let [i, a] = A(!t);
|
|
4012
4035
|
return /* @__PURE__ */ N("fieldset", {
|
|
4013
4036
|
className: "m-0 flex min-w-0 flex-col gap-2 border-0 p-0",
|
|
@@ -4084,15 +4107,15 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
4084
4107
|
})
|
|
4085
4108
|
]
|
|
4086
4109
|
});
|
|
4087
|
-
},
|
|
4088
|
-
let { account: s } = nt(), c = cr(), l =
|
|
4110
|
+
}, Zi = (e) => e.enableMultipleTicketBooking && !e.external ? /* @__PURE__ */ M(Ji, { ...e }, e.eventID) : /* @__PURE__ */ M(Qi, { ...e }, e.eventID), Qi = ({ eventID: e, title: t, external: n, buttonText: r = "Register Now", startsAt: i, endsAt: a, eventUrl: o }) => {
|
|
4111
|
+
let { account: s } = nt(), c = cr(), l = ji({
|
|
4089
4112
|
eventID: e,
|
|
4090
4113
|
external: n
|
|
4091
|
-
}), u = l.selectedTicket?.registration_fields ?? mi, d =
|
|
4114
|
+
}), u = l.selectedTicket?.registration_fields ?? mi, d = wi(s, u), f = Wr(l.selectedTicket, null)?.isFree === !1, p = Ui(e), { booking: m } = p, h = Ki({ canAutoOpen: !n && !l.isLoading && l.tickets.length > 0 && !p.registeredEmail }), g = k(null), _ = ki({
|
|
4092
4115
|
eventID: e,
|
|
4093
4116
|
tickets: l.selectedTicket ? [l.selectedTicket] : [],
|
|
4094
4117
|
enabled: h.isOpen && f
|
|
4095
|
-
}), v = Wr(l.selectedTicket, _.discount), y = !!v && !v.isFree, b = l.tickets.length > 1, x = O(() => ei(i, a), [i, a]), S = t || "this event", C = b || f, w =
|
|
4118
|
+
}), v = Wr(l.selectedTicket, _.discount), y = !!v && !v.isFree, b = l.tickets.length > 1, x = O(() => ei(i, a), [i, a]), S = t || "this event", C = b || f, w = Ri({
|
|
4096
4119
|
eventID: e,
|
|
4097
4120
|
details: {
|
|
4098
4121
|
merchantName: c?.name || t || "",
|
|
@@ -4179,13 +4202,13 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
4179
4202
|
}) : /* @__PURE__ */ N("div", {
|
|
4180
4203
|
className: "flex flex-col gap-4",
|
|
4181
4204
|
children: [
|
|
4182
|
-
b && /* @__PURE__ */ M(
|
|
4205
|
+
b && /* @__PURE__ */ M(Xi, {
|
|
4183
4206
|
tickets: l.tickets,
|
|
4184
4207
|
selectedTicket: l.selectedTicket,
|
|
4185
4208
|
onSelect: T,
|
|
4186
4209
|
error: d.submitAttempted && !l.selectedTicket ? "Choose a ticket to continue" : void 0
|
|
4187
4210
|
}),
|
|
4188
|
-
f && /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(
|
|
4211
|
+
f && /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(Yi, {
|
|
4189
4212
|
selectedTicket: l.selectedTicket,
|
|
4190
4213
|
discount: _.discount
|
|
4191
4214
|
}), /* @__PURE__ */ M(Qr, {
|
|
@@ -4216,7 +4239,7 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
4216
4239
|
]
|
|
4217
4240
|
})
|
|
4218
4241
|
})] });
|
|
4219
|
-
},
|
|
4242
|
+
}, $i = (e) => e.length > 1 ? e.replace(/\/+$/, "") : e, ea = (e) => typeof e == "string" && e.trim() ? e : void 0, ta = (e) => typeof e == "string" ? e : e?.location ?? void 0, na = (e, t) => {
|
|
4220
4243
|
let n = e.meta ?? {}, r = e.title && t ? `${e.title} | ${t}` : e.title || t || void 0;
|
|
4221
4244
|
return {
|
|
4222
4245
|
title: n.meta_title || r,
|
|
@@ -4226,32 +4249,32 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
4226
4249
|
og: {
|
|
4227
4250
|
title: n.og_title || void 0,
|
|
4228
4251
|
description: n.og_description || void 0,
|
|
4229
|
-
image:
|
|
4252
|
+
image: ta(n.og_image),
|
|
4230
4253
|
url: n.og_url || void 0
|
|
4231
4254
|
},
|
|
4232
4255
|
twitter: { card: n.twitter_card || void 0 },
|
|
4233
4256
|
ldJson: n.ld_json || void 0,
|
|
4234
4257
|
customHead: n.head_code || void 0
|
|
4235
4258
|
};
|
|
4236
|
-
},
|
|
4259
|
+
}, ra = (e) => ({
|
|
4237
4260
|
description: e.description || void 0,
|
|
4238
4261
|
customHead: e.settings?.head_code || void 0
|
|
4239
|
-
}),
|
|
4240
|
-
let i =
|
|
4262
|
+
}), ia = (e) => (t = {}, n) => (r) => {
|
|
4263
|
+
let i = na(t, e.name);
|
|
4241
4264
|
if (n) {
|
|
4242
4265
|
let t = r?.loaderData?.[n.source];
|
|
4243
4266
|
if (t) {
|
|
4244
|
-
let r = n.title ?
|
|
4267
|
+
let r = n.title ? ea(t[n.title]) : void 0;
|
|
4245
4268
|
r && (i.title = e.name ? `${r} | ${e.name}` : r, i.og = {
|
|
4246
4269
|
...i.og,
|
|
4247
4270
|
title: r
|
|
4248
4271
|
});
|
|
4249
|
-
let a = n.description ?
|
|
4272
|
+
let a = n.description ? ea(t[n.description]) : void 0;
|
|
4250
4273
|
a && (i.description = a, i.og = {
|
|
4251
4274
|
...i.og,
|
|
4252
4275
|
description: a
|
|
4253
4276
|
});
|
|
4254
|
-
let o = n.image ?
|
|
4277
|
+
let o = n.image ? ta(t[n.image]) : void 0;
|
|
4255
4278
|
o && (i.og = {
|
|
4256
4279
|
...i.og,
|
|
4257
4280
|
image: o
|
|
@@ -4260,14 +4283,14 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
4260
4283
|
}
|
|
4261
4284
|
if (!i.canonical) {
|
|
4262
4285
|
let t = r?.match?.pathname, n = (e.domain || "").trim();
|
|
4263
|
-
n && t?.startsWith("/") && (i.canonical = (/^https?:\/\//.test(n) ? n : `https://${n}`).replace(/\/+$/, "") +
|
|
4286
|
+
n && t?.startsWith("/") && (i.canonical = (/^https?:\/\//.test(n) ? n : `https://${n}`).replace(/\/+$/, "") + $i(t));
|
|
4264
4287
|
}
|
|
4265
|
-
let a = Dr(i,
|
|
4288
|
+
let a = Dr(i, ra(e)), o = t.id?.trim();
|
|
4266
4289
|
return o && a.meta.push({
|
|
4267
4290
|
name: nr,
|
|
4268
4291
|
content: o
|
|
4269
4292
|
}), a;
|
|
4270
|
-
},
|
|
4293
|
+
}, aa = (e) => e.params, oa = (e) => {
|
|
4271
4294
|
let t = Ne(e);
|
|
4272
4295
|
return (e, n) => {
|
|
4273
4296
|
let { rules: r, invalid: i } = Te(n?.access), a = r.length > 0 || i;
|
|
@@ -4275,16 +4298,16 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
4275
4298
|
queryClient: n.context.queryClient,
|
|
4276
4299
|
config: t,
|
|
4277
4300
|
sources: e,
|
|
4278
|
-
params:
|
|
4301
|
+
params: aa(n)
|
|
4279
4302
|
});
|
|
4280
4303
|
};
|
|
4281
|
-
},
|
|
4304
|
+
}, sa = 2, ca = (e) => {
|
|
4282
4305
|
let { limit: t = 20, debounceMs: n = 300, hotkey: r = !0 } = e ?? {}, a = i(), o = cr(), s = K(), [c, l] = A(""), [u, d] = A(!1), [f, p] = A("");
|
|
4283
4306
|
E(() => {
|
|
4284
4307
|
let e = setTimeout(() => p(c.trim()), n);
|
|
4285
4308
|
return () => clearTimeout(e);
|
|
4286
4309
|
}, [c, n]);
|
|
4287
|
-
let m = f.length >=
|
|
4310
|
+
let m = f.length >= sa, h = L({
|
|
4288
4311
|
queryKey: [
|
|
4289
4312
|
"levo-search",
|
|
4290
4313
|
o?.id ?? null,
|
|
@@ -4333,4 +4356,4 @@ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, ch
|
|
|
4333
4356
|
};
|
|
4334
4357
|
};
|
|
4335
4358
|
//#endregion
|
|
4336
|
-
export { Bt as ColorModeProvider, Zn as Inspector, _e as LEVO_AUTH_METHODS, q as LEVO_AUTH_QUERY_KEY, ge as LEVO_OAUTH_METHODS, Tt as LEVO_OTP_LENGTH, ht as LEVO_PENDING_APPROVAL_CODE, he as LEVO_PRIMARY_AUTH_METHODS, m as LOCALE_COOKIE, l as LOCALE_REDIRECT_CACHE_CONTROL, Mt as LevoChat, Ut as LevoEditForm, rt as LevoEntryForm,
|
|
4359
|
+
export { Bt as ColorModeProvider, Zn as Inspector, _e as LEVO_AUTH_METHODS, q as LEVO_AUTH_QUERY_KEY, ge as LEVO_OAUTH_METHODS, Tt as LEVO_OTP_LENGTH, ht as LEVO_PENDING_APPROVAL_CODE, he as LEVO_PRIMARY_AUTH_METHODS, m as LOCALE_COOKIE, l as LOCALE_REDIRECT_CACHE_CONTROL, Mt as LevoChat, Ut as LevoEditForm, rt as LevoEntryForm, Zi as LevoEventRegister, Wt as LevoForm, gr as LevoLink, ar as LevoPopups, ct as LevoProfileForm, dr as LevoSiteProvider, _r as LocaleHreflang, yr as LocaleProvider, nr as PAGE_ID_META, Or as PageHead, Sr as SiteLocaleProvider, hr as buildHreflangLinks, ia as createLevoHead, oa as createLevoLoader, _ as createRouteTreeMatcher, Me as createSiteClient, je as decideAccess, v as extractGeoAndLanguageData, gt as isPendingApprovalError, Et as isValidEmail, Dt as isValidOtp, kt as isValidPhone, ze as levoParams, fr as localeBeforeLoad, p as localePath, d as localeRedirectResponse, Ot as normalizePhone, Dr as pageHead, Te as parseAccess, Er as parseRawHead, $e as prefetchLevoSources, pr as readLocaleConfig, rr as readPageId, Ee as resolveAuthMethods, g as resolveLocale, u as resolveLocaleRedirect, s as resolveLocaleRequest, Ne as siteConfigFromJson, f as splitLocalePrefix, Vt as useColorMode, Cr as useLanguageOptions, mt as useLevoAccess, nt as useLevoAuth, Ze as useLevoForm, ur as useLevoInsights, yt as useLevoLogin, wt as useLevoOAuth, At as useLevoOtpInput, Xe as useLevoRecord, ca as useLevoSearch, lr as useLevoSite, Ye as useLevoSource, br as useLocale, xr as useUrlLocale };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levo-so/site-runtime",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.29",
|
|
4
4
|
"description": "Runtime for Levo Studio v3 sites — the editor preview inspector, page head metadata, and the Levo data client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"@assistant-ui/store": "0.3.13",
|
|
83
83
|
"@assistant-ui/tap": "0.9.17",
|
|
84
84
|
"remark-gfm": "4.0.1",
|
|
85
|
-
"@levo-so/core": "0.3.
|
|
86
|
-
"@levo-so/insights": "0.3.
|
|
85
|
+
"@levo-so/core": "0.3.29",
|
|
86
|
+
"@levo-so/insights": "0.3.29",
|
|
87
87
|
"@stripe/react-stripe-js": "3.1.1",
|
|
88
88
|
"@stripe/stripe-js": "5.5.0",
|
|
89
89
|
"react-razorpay": "3.0.1"
|
package/popups.js
CHANGED