@levo-so/site-runtime 0.3.19 → 0.3.21
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-ByiYjJ0S.js +251 -0
- package/BookingCard-DdwLHVGw.js +816 -0
- package/CollectionLabel-CmUFfc_7.js +35 -0
- package/DateTimeWidget-Bk2tk_CT.js +254 -0
- package/{KBChatWidget-GRi6sLpp.js → KBChatWidget-BXRRgelS.js} +223 -223
- package/PhoneWidget-FWE3jD_L.js +97 -0
- package/{Popover-C29yJ7rz.js → Popover-MSrVDAzg.js} +7 -7
- package/PopupBody-DWM55Zh5-B3ysApDM.js +158 -0
- package/PopupDialog-DwAAJ8JS-DkxjZaJL.js +260 -0
- package/PopupRenderer-BVtV4b9I-Dot4Syse.js +207 -0
- package/{RichTextWidget-DfakML79.js → RichTextWidget-KnIKESAD.js} +189 -190
- package/{RteThemeProvider-BQmfSXSl.js → RteThemeProvider-DtTXGcCT.js} +2 -3
- package/Sonner-BsE4Y_t4.js +21 -0
- package/blog-content.js +71 -72
- package/dist-BVFCdirT.js +4471 -0
- package/dist-DEXGyFeH.js +376 -0
- package/index.d.ts +21 -11
- package/index.js +1702 -1390
- package/{themeVars.cssm-ByhhC2Jm.js → inlineBaseTheme-DcNdMEYp.js} +35 -5
- package/{inlineCollectionTheme-CWcMCUti.js → inlineCollectionTheme-DjXuH3bK.js} +1 -1
- package/{inlineRteTheme-CRPtkNXy.js → inlineRteTheme-BYGIJM7P.js} +1 -1
- package/{kbChat-a2dXSeRc.js → kbChat-eFsau7hG.js} +27 -27
- package/package.json +23 -23
- package/{pillChrome-CEpWGNZB.js → pillChrome-Dy3ApFI5.js} +5 -5
- package/popups.js +1 -1
- package/{react-Cj_U6VZQ.js → react-CENbCy5d.js} +6 -5
- package/script.esm-D4nvz3-k.js +62 -0
- package/script.esm-uVCZU25S.js +62 -0
- package/start.js +1 -1
- package/styles.css +1 -1
- package/theme.cssm-iXnQwMCp.js +238 -0
- package/CollectionField-C-6a1ud4.js +0 -270
- package/CollectionInput-BJ__qcbk.js +0 -147
- package/DateTimeWidget-U3lD0q1q.js +0 -255
- package/Dialog-dT7y641z.js +0 -130
- package/LevoProvider-Bsjkcwc8.js +0 -20
- package/PhoneWidget-DQQa4bL6.js +0 -99
- package/PopupBody-BI-MJqmd-DgTQEzda.js +0 -159
- package/PopupRenderer-D66Gx63H-Cd9xJv33.js +0 -388
- package/ThemeProvider-DutrjSTF.js +0 -116
- package/Tooltip-CQB0LyxK.js +0 -67
- package/VerifyButton-BUT70lgz.js +0 -192
- package/createThemeExtension-4AUn51iJ.js +0 -15
- package/dist-6AIgW_iB.js +0 -79
- package/dist-CEdznbFW.js +0 -3668
- package/inlineBaseTheme-BB9e6h5f.js +0 -9
- package/popupState-JmpeKzgM-D_77LiAa.js +0 -229
- package/react-B9yvlbH0.js +0 -74
- package/theme.cssm-DUzmx76l.js +0 -4
- package/usePopupRedirect-CAAdcpaW-Ddjyf4KK.js +0 -82
- /package/{content.cssm-XdMsTGIB.js → content.cssm-D_LSloGW.js} +0 -0
- /package/{es-ByBbirnH.js → es-CK20DkgT.js} +0 -0
- /package/{rolldown-runtime-CAFD8bLK.js → rolldown-runtime-Dy4uBu1J.js} +0 -0
- /package/{routes-CyKmkoRM.js → routes-DO1BLfh9.js} +0 -0
- /package/{rteTheme.cssm-W4gTOijw.js → rteTheme.cssm-BRxusHY4.js} +0 -0
package/VerifyButton-BUT70lgz.js
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { r as e } from "./ThemeProvider-DutrjSTF.js";
|
|
3
|
-
import { t } from "./LevoProvider-Bsjkcwc8.js";
|
|
4
|
-
import { t as n } from "./CollectionInput-BJ__qcbk.js";
|
|
5
|
-
import { i as r, n as i, o as a, t as o } from "./Dialog-dT7y641z.js";
|
|
6
|
-
import { c as s } from "react/compiler-runtime";
|
|
7
|
-
import c from "clsx";
|
|
8
|
-
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
|
-
import { useEffect as f, useState as p } from "react";
|
|
10
|
-
import { IconCircleCheck as m, IconLoader as h } from "@tabler/icons-react";
|
|
11
|
-
import { toast as g } from "sonner";
|
|
12
|
-
//#region ../../libraries/levocn/dist/ui/spinner/Spinner.cssm.js
|
|
13
|
-
var _ = "_1k4xirc1", v = (e) => {
|
|
14
|
-
let t = s(8), n, r;
|
|
15
|
-
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
16
|
-
let i;
|
|
17
|
-
t[3] === n ? i = t[4] : (i = c(_, n), t[3] = n, t[4] = i);
|
|
18
|
-
let a;
|
|
19
|
-
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ u(h, {
|
|
20
|
-
role: "status",
|
|
21
|
-
"aria-label": "Loading",
|
|
22
|
-
className: i,
|
|
23
|
-
...r
|
|
24
|
-
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
25
|
-
}, y = (e, t = "Error", n = {}) => {
|
|
26
|
-
g.error(t, {
|
|
27
|
-
description: e,
|
|
28
|
-
duration: 4e3,
|
|
29
|
-
position: "bottom-right",
|
|
30
|
-
...n
|
|
31
|
-
});
|
|
32
|
-
}, b = (e, t = "Success", n = {}) => {
|
|
33
|
-
n?.id && g.dismiss(n?.id), g.success(t, {
|
|
34
|
-
description: e,
|
|
35
|
-
duration: 4e3,
|
|
36
|
-
position: "bottom-right",
|
|
37
|
-
...n
|
|
38
|
-
});
|
|
39
|
-
}, x = "_6o7s4x0", S = "qkytrb0", C = "qkytrb1", w = "qkytrb2", T = "qkytrb3", E = "qkytrb4", D = "qkytrb5", O = "qkytrb6", k = ({ isOpen: s, onClose: c, value: l, type: m = "email", onVerifySuccess: h }) => {
|
|
40
|
-
let { membership: g } = t(), [_, v] = p(""), [k, A] = p(!1), [j, M] = p(!1), [N, P] = p(30);
|
|
41
|
-
return f(() => {
|
|
42
|
-
let e;
|
|
43
|
-
return s && N > 0 && (e = setInterval(() => {
|
|
44
|
-
P((e) => e - 1);
|
|
45
|
-
}, 1e3)), () => clearInterval(e);
|
|
46
|
-
}, [s, N]), f(() => {
|
|
47
|
-
s && (v(""), P(30), A(!1), M(!1));
|
|
48
|
-
}, [s]), /* @__PURE__ */ u(a, {
|
|
49
|
-
open: s,
|
|
50
|
-
onOpenChange: (e) => {
|
|
51
|
-
e || c();
|
|
52
|
-
},
|
|
53
|
-
children: /* @__PURE__ */ d(i, {
|
|
54
|
-
className: x,
|
|
55
|
-
children: [/* @__PURE__ */ u(o, { children: /* @__PURE__ */ u(r, { children: `Verify ${m === "email" ? "Email" : "Phone"}` }) }), /* @__PURE__ */ d("div", {
|
|
56
|
-
className: S,
|
|
57
|
-
children: [
|
|
58
|
-
/* @__PURE__ */ d("div", {
|
|
59
|
-
className: C,
|
|
60
|
-
children: [
|
|
61
|
-
"Enter the 4-digit code sent to ",
|
|
62
|
-
/* @__PURE__ */ u("strong", { children: l }),
|
|
63
|
-
".",
|
|
64
|
-
" ",
|
|
65
|
-
/* @__PURE__ */ u("button", {
|
|
66
|
-
onClick: () => c(),
|
|
67
|
-
className: w,
|
|
68
|
-
children: "Change?"
|
|
69
|
-
})
|
|
70
|
-
]
|
|
71
|
-
}),
|
|
72
|
-
/* @__PURE__ */ u("div", {
|
|
73
|
-
className: T,
|
|
74
|
-
children: /* @__PURE__ */ u(n, {
|
|
75
|
-
value: _,
|
|
76
|
-
onChange: (e) => {
|
|
77
|
-
v(e.target.value.replace(/\D/g, "").slice(0, 4));
|
|
78
|
-
},
|
|
79
|
-
placeholder: "0000",
|
|
80
|
-
maxLength: 4,
|
|
81
|
-
className: D
|
|
82
|
-
})
|
|
83
|
-
}),
|
|
84
|
-
/* @__PURE__ */ d("div", {
|
|
85
|
-
className: E,
|
|
86
|
-
children: [/* @__PURE__ */ u(e, {
|
|
87
|
-
onClick: async () => {
|
|
88
|
-
if (!(!_ || _.length !== 4)) {
|
|
89
|
-
A(!0);
|
|
90
|
-
try {
|
|
91
|
-
await g?.signInWithOtp({
|
|
92
|
-
content: l,
|
|
93
|
-
code: _
|
|
94
|
-
}), b("Verification successful"), h(l), c();
|
|
95
|
-
} catch (e) {
|
|
96
|
-
let t = e;
|
|
97
|
-
y(t?.message || "Invalid OTP", t?.title || "Verification Failed");
|
|
98
|
-
} finally {
|
|
99
|
-
A(!1);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
disabled: _.length !== 4 || k,
|
|
104
|
-
className: "w-full",
|
|
105
|
-
children: k ? "Verifying..." : "Verify"
|
|
106
|
-
}), /* @__PURE__ */ u("div", {
|
|
107
|
-
className: O,
|
|
108
|
-
children: N > 0 ? /* @__PURE__ */ d("span", { children: [
|
|
109
|
-
"Resend code in ",
|
|
110
|
-
N,
|
|
111
|
-
"s"
|
|
112
|
-
] }) : /* @__PURE__ */ u("button", {
|
|
113
|
-
onClick: async () => {
|
|
114
|
-
if (!(N > 0)) {
|
|
115
|
-
M(!0);
|
|
116
|
-
try {
|
|
117
|
-
await g?.requestOtp({
|
|
118
|
-
content: l,
|
|
119
|
-
medium: m === "phone" ? "whatsapp" : "email"
|
|
120
|
-
}), b("OTP resent successfully"), P(30);
|
|
121
|
-
} catch (e) {
|
|
122
|
-
let t = e;
|
|
123
|
-
y(t?.message || "Failed to resend OTP", t?.title || "Error");
|
|
124
|
-
} finally {
|
|
125
|
-
M(!1);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
disabled: j,
|
|
130
|
-
className: w,
|
|
131
|
-
children: j ? "Resending..." : "Resend Code"
|
|
132
|
-
})
|
|
133
|
-
})]
|
|
134
|
-
})
|
|
135
|
-
]
|
|
136
|
-
})]
|
|
137
|
-
})
|
|
138
|
-
});
|
|
139
|
-
}, A = "jfrbe10", j = "jfrbe11", M = "jfrbe12", N = ({ value: n, type: r, isVerified: i, onVerifySuccess: a, onStateChange: o }) => {
|
|
140
|
-
let { membership: s } = t(), [c, f] = p(!1), [h, g] = p(!1), _ = (e) => {
|
|
141
|
-
o && o(e);
|
|
142
|
-
}, b = async () => {
|
|
143
|
-
let e = n?.trim()?.toLowerCase();
|
|
144
|
-
if (!e) {
|
|
145
|
-
y(`Please enter a ${r}`);
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
if (r === "email" && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) {
|
|
149
|
-
y("Please enter a valid email address");
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
g(!0), _(!0);
|
|
153
|
-
try {
|
|
154
|
-
await s?.requestOtp({
|
|
155
|
-
content: e,
|
|
156
|
-
medium: r === "phone" ? "whatsapp" : "email"
|
|
157
|
-
}), f(!0);
|
|
158
|
-
} catch (e) {
|
|
159
|
-
let t = e;
|
|
160
|
-
y(t?.message || "Failed to send OTP", t?.title || "Error"), _(!1);
|
|
161
|
-
} finally {
|
|
162
|
-
g(!1);
|
|
163
|
-
}
|
|
164
|
-
}, x = () => {
|
|
165
|
-
f(!1), _(!1);
|
|
166
|
-
};
|
|
167
|
-
return i ? /* @__PURE__ */ d("div", {
|
|
168
|
-
className: A,
|
|
169
|
-
children: [/* @__PURE__ */ u(m, { className: M }), /* @__PURE__ */ u("span", {
|
|
170
|
-
className: j,
|
|
171
|
-
children: "Verified"
|
|
172
|
-
})]
|
|
173
|
-
}) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(e, {
|
|
174
|
-
size: "default",
|
|
175
|
-
variant: "ghost",
|
|
176
|
-
onClick: b,
|
|
177
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
178
|
-
disabled: !n || h,
|
|
179
|
-
type: "button",
|
|
180
|
-
children: h ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(v, { size: 14 }), "Sending..."] }) : "Verify"
|
|
181
|
-
}), c && /* @__PURE__ */ u(k, {
|
|
182
|
-
isOpen: c,
|
|
183
|
-
onClose: x,
|
|
184
|
-
value: n?.trim()?.toLowerCase() || "",
|
|
185
|
-
type: r,
|
|
186
|
-
onVerifySuccess: (e) => {
|
|
187
|
-
a(e), x();
|
|
188
|
-
}
|
|
189
|
-
})] });
|
|
190
|
-
};
|
|
191
|
-
//#endregion
|
|
192
|
-
export { v as a, y as i, x as n, b as r, N as t };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { assignInlineVars as e } from "@vanilla-extract/dynamic";
|
|
2
|
-
//#region ../../libraries/levocn/dist/theme/utils/createThemeExtension.js
|
|
3
|
-
var t = (e, n) => {
|
|
4
|
-
let r = {};
|
|
5
|
-
for (let i of Object.keys(n)) {
|
|
6
|
-
let a = n[i], o = e[i];
|
|
7
|
-
if (!(a === void 0 || o === void 0)) if (typeof a == "object" && a && !Array.isArray(a)) {
|
|
8
|
-
let e = t(o, a);
|
|
9
|
-
Object.assign(r, e);
|
|
10
|
-
} else typeof o == "string" && (r[o] = String(a));
|
|
11
|
-
}
|
|
12
|
-
return r;
|
|
13
|
-
}, n = (n) => (r) => r ? e(t(n, r)) : {};
|
|
14
|
-
//#endregion
|
|
15
|
-
export { n as t };
|
package/dist-6AIgW_iB.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
|
|
2
|
-
import { t } from "./LevoProvider-Bsjkcwc8.js";
|
|
3
|
-
import { a as n, c as r, i, l as a, o, t as s, u as c } from "./popupState-JmpeKzgM-D_77LiAa.js";
|
|
4
|
-
import { t as l } from "./react-B9yvlbH0.js";
|
|
5
|
-
import { c as u } from "react/compiler-runtime";
|
|
6
|
-
import { jsx as d } from "react/jsx-runtime";
|
|
7
|
-
import { Suspense as f, lazy as p, useEffect as m, useRef as h, useState as g } from "react";
|
|
8
|
-
import { $isIdentityContextReady as _ } from "@levo-so/insights/stores";
|
|
9
|
-
//#region ../../libraries/popups/dist/index.js
|
|
10
|
-
var v = /* @__PURE__ */ e({
|
|
11
|
-
PopupLoader: () => x,
|
|
12
|
-
fetchActivePopups: () => y,
|
|
13
|
-
usePopup: () => C
|
|
14
|
-
}), y = async (e, t) => {
|
|
15
|
-
let n = {};
|
|
16
|
-
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 ?? [];
|
|
17
|
-
}, b = p(() => import("./PopupRenderer-D66Gx63H-Cd9xJv33.js").then((e) => e.t).then((e) => ({ default: e.PopupRenderer }))), x = (e) => {
|
|
18
|
-
let n = u(9), { siteId: r, pageId: i } = e, { fetch: a, logger: s } = t(), [c, l] = g(null), p = h(!1), v, x;
|
|
19
|
-
if (n[0] !== a || n[1] !== s || n[2] !== r ? (v = () => {
|
|
20
|
-
if (p.current) return;
|
|
21
|
-
let e = () => {
|
|
22
|
-
p.current || (p.current = !0, y(a, r ? { site_id: r } : void 0).then((e) => {
|
|
23
|
-
o(e), l(e);
|
|
24
|
-
}).catch((e) => {
|
|
25
|
-
s?.error("Failed to fetch popups", { exception: e }), o([]), l([]);
|
|
26
|
-
}).finally(S));
|
|
27
|
-
};
|
|
28
|
-
if (_.get()) {
|
|
29
|
-
e();
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
let t = _.listen((n) => {
|
|
33
|
-
n && (t(), e());
|
|
34
|
-
});
|
|
35
|
-
return () => t();
|
|
36
|
-
}, x = [
|
|
37
|
-
a,
|
|
38
|
-
s,
|
|
39
|
-
r
|
|
40
|
-
], n[0] = a, n[1] = s, n[2] = r, n[3] = v, n[4] = x) : (v = n[3], x = n[4]), m(v, x), !c || c.length === 0) return null;
|
|
41
|
-
let C;
|
|
42
|
-
n[5] === Symbol.for("react.memo_cache_sentinel") ? (C = {
|
|
43
|
-
position: "relative",
|
|
44
|
-
zIndex: 99999
|
|
45
|
-
}, n[5] = C) : C = n[5];
|
|
46
|
-
let w;
|
|
47
|
-
return n[6] !== i || n[7] !== c ? (w = /* @__PURE__ */ d("div", {
|
|
48
|
-
style: C,
|
|
49
|
-
children: /* @__PURE__ */ d(f, { children: /* @__PURE__ */ d(b, {
|
|
50
|
-
popups: c,
|
|
51
|
-
pageId: i
|
|
52
|
-
}) })
|
|
53
|
-
}), n[6] = i, n[7] = c, n[8] = w) : w = n[8], w;
|
|
54
|
-
};
|
|
55
|
-
function S() {
|
|
56
|
-
return a(!1);
|
|
57
|
-
}
|
|
58
|
-
var C = () => {
|
|
59
|
-
let e = u(3), t = l(n), r = l(c), i = w, a = T, o;
|
|
60
|
-
return e[0] !== r || e[1] !== t ? (o = {
|
|
61
|
-
popups: t,
|
|
62
|
-
isLoading: r,
|
|
63
|
-
openPopup: i,
|
|
64
|
-
closePopup: a
|
|
65
|
-
}, e[0] = r, e[1] = t, e[2] = o) : o = e[2], o;
|
|
66
|
-
};
|
|
67
|
-
function w(e) {
|
|
68
|
-
let t = n.get().find((t) => t.id === e);
|
|
69
|
-
t && s(t, {
|
|
70
|
-
force: !0,
|
|
71
|
-
trigger_type: "manual"
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
function T() {
|
|
75
|
-
let e = i.get().active_popup_id;
|
|
76
|
-
e && r(e);
|
|
77
|
-
}
|
|
78
|
-
//#endregion
|
|
79
|
-
export { v as n, C as t };
|