@levo-so/site-runtime 0.3.20 → 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.
Files changed (53) hide show
  1. package/BillingStep-ByiYjJ0S.js +251 -0
  2. package/BookingCard-DdwLHVGw.js +816 -0
  3. package/CollectionLabel-CmUFfc_7.js +35 -0
  4. package/DateTimeWidget-Bk2tk_CT.js +254 -0
  5. package/{KBChatWidget-BMuZ-VI3.js → KBChatWidget-BXRRgelS.js} +1 -1
  6. package/{PhoneWidget-DPECohGT.js → PhoneWidget-FWE3jD_L.js} +3 -5
  7. package/{Popover-Cr0-X_ch.js → Popover-MSrVDAzg.js} +7 -7
  8. package/PopupBody-DWM55Zh5-B3ysApDM.js +158 -0
  9. package/PopupDialog-DwAAJ8JS-DkxjZaJL.js +260 -0
  10. package/PopupRenderer-BVtV4b9I-Dot4Syse.js +207 -0
  11. package/{RichTextWidget-C1QECDcg.js → RichTextWidget-KnIKESAD.js} +134 -135
  12. package/{RteThemeProvider-CMbSaFRQ.js → RteThemeProvider-DtTXGcCT.js} +2 -3
  13. package/Sonner-BsE4Y_t4.js +21 -0
  14. package/blog-content.js +8 -9
  15. package/dist-BVFCdirT.js +4471 -0
  16. package/dist-DEXGyFeH.js +376 -0
  17. package/index.js +12 -13
  18. package/{themeVars.cssm-ByhhC2Jm.js → inlineBaseTheme-DcNdMEYp.js} +35 -5
  19. package/{inlineCollectionTheme-CWcMCUti.js → inlineCollectionTheme-DjXuH3bK.js} +1 -1
  20. package/{inlineRteTheme-CRPtkNXy.js → inlineRteTheme-BYGIJM7P.js} +1 -1
  21. package/{kbChat-DtZ4vuCZ.js → kbChat-eFsau7hG.js} +2 -2
  22. package/package.json +23 -23
  23. package/{pillChrome-CEpWGNZB.js → pillChrome-Dy3ApFI5.js} +5 -5
  24. package/popups.js +1 -1
  25. package/{react-Cj_U6VZQ.js → react-CENbCy5d.js} +6 -5
  26. package/script.esm-uVCZU25S.js +62 -0
  27. package/start.js +1 -1
  28. package/styles.css +1 -1
  29. package/theme.cssm-iXnQwMCp.js +238 -0
  30. package/CollectionField-DCAXOmBN.js +0 -270
  31. package/CollectionInput-BJ__qcbk.js +0 -147
  32. package/DateTimeWidget-I0LvR-tO.js +0 -255
  33. package/Dialog-D-vRkU9N.js +0 -130
  34. package/LevoProvider-BkbKrvrI.js +0 -20
  35. package/PopupBody-BI-MJqmd-a-l3CaKZ.js +0 -159
  36. package/PopupRenderer-D66Gx63H-DpcNpbtU.js +0 -388
  37. package/ThemeProvider-DlFehjh1.js +0 -116
  38. package/Tooltip-BKQ5rIDh.js +0 -67
  39. package/VerifyButton-D0cj9Z5Q.js +0 -192
  40. package/createThemeExtension-4AUn51iJ.js +0 -15
  41. package/dist-IxiGbP-3.js +0 -3783
  42. package/dist-_lwl0kZw.js +0 -79
  43. package/inlineBaseTheme-BB9e6h5f.js +0 -9
  44. package/popupState-JmpeKzgM-D_77LiAa.js +0 -229
  45. package/react-B9yvlbH0.js +0 -74
  46. package/theme.cssm-DUzmx76l.js +0 -4
  47. package/usePopupRedirect-CAAdcpaW-BDa44PXN.js +0 -82
  48. /package/{content.cssm-XdMsTGIB.js → content.cssm-D_LSloGW.js} +0 -0
  49. /package/{es-CGQflL9T.js → es-CK20DkgT.js} +0 -0
  50. /package/{rolldown-runtime-CAFD8bLK.js → rolldown-runtime-Dy4uBu1J.js} +0 -0
  51. /package/{routes-CyKmkoRM.js → routes-DO1BLfh9.js} +0 -0
  52. /package/{rteTheme.cssm-W4gTOijw.js → rteTheme.cssm-BRxusHY4.js} +0 -0
  53. /package/{script.esm-wR2d7rrv.js → script.esm-D4nvz3-k.js} +0 -0
@@ -0,0 +1,260 @@
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-DEXGyFeH.js";
3
+ import { t as g } from "./rteTheme.cssm-BRxusHY4.js";
4
+ import { c as _ } from "react/compiler-runtime";
5
+ import { Suspense as v, createContext as y, lazy as b, useContext as x, useEffect as S, useRef as C } from "react";
6
+ import w from "clsx";
7
+ import { jsx as T, jsxs as E } from "react/jsx-runtime";
8
+ import { createRuntimeFn as D } from "@vanilla-extract/recipes/createRuntimeFn";
9
+ import { IconX as O } from "@tabler/icons-react";
10
+ //#region ../../libraries/levocn/dist/theme/utils/googleFonts.js
11
+ var k = "wght@300;400;500;600;700;900", A = (e) => !!e && e !== "inherit" && !e.includes(",") && !e.includes("var("), j = (...e) => {
12
+ let t = Array.from(new Set(e.filter((e) => typeof e == "string").map((e) => e.trim()).filter(A)));
13
+ return t.length === 0 ? null : `https://fonts.googleapis.com/css2?${t.map((e) => `family=${e.replace(/ /g, "+")}:${k}`).join("&")}&display=swap`;
14
+ }, M = (e) => {
15
+ if (document.querySelector(`link[rel="preconnect"][href="${e}"]`)) return;
16
+ let t = document.createElement("link");
17
+ t.rel = "preconnect", t.href = e, t.crossOrigin = "anonymous", document.head.appendChild(t);
18
+ }, N = (e) => {
19
+ let t = `family=${e.replace(/ /g, "+")}:`;
20
+ return Array.from(document.querySelectorAll("link[rel=\"stylesheet\"][href*=\"fonts.googleapis.com\"]")).some((e) => e.href.includes(t));
21
+ }, P = (...e) => {
22
+ let t = _(5), n = e, r;
23
+ t[0] === n ? r = t[1] : (r = n.filter(F).map(I).join("|"), t[0] = n, t[1] = r);
24
+ let i = r, a, o;
25
+ t[2] === i ? (a = t[3], o = t[4]) : (a = () => {
26
+ let e = j(...(i ? i.split("|") : []).filter(L));
27
+ if (!e) return;
28
+ M("https://fonts.googleapis.com"), M("https://fonts.gstatic.com");
29
+ let t = document.createElement("link");
30
+ t.rel = "stylesheet", t.href = e, t.crossOrigin = "anonymous", t.setAttribute("data-levo-fonts", e), document.head.appendChild(t);
31
+ }, o = [i], t[2] = i, t[3] = a, t[4] = o), S(a, o);
32
+ };
33
+ function F(e) {
34
+ return typeof e == "string" && e.trim() !== "";
35
+ }
36
+ function I(e) {
37
+ return e.trim();
38
+ }
39
+ function L(e) {
40
+ return !N(e);
41
+ }
42
+ //#endregion
43
+ //#region ../../libraries/popups/dist/rolldown-runtime-Dy4uBu1J.js
44
+ var R = Object.defineProperty, z = (e, t) => {
45
+ let n = {};
46
+ for (var r in e) R(n, r, {
47
+ get: e[r],
48
+ enumerable: !0
49
+ });
50
+ return t || R(n, Symbol.toStringTag, { value: "Module" }), n;
51
+ }, B = D({
52
+ defaultClassName: "_1gklknd4",
53
+ variantClassNames: {
54
+ placement: {
55
+ popup: "_1gklknd5",
56
+ slide_in: "_1gklknd6"
57
+ },
58
+ position: {
59
+ "top-left": "_1gklknd7",
60
+ "top-right": "_1gklknd8",
61
+ "bottom-left": "_1gklknd9",
62
+ "bottom-right": "_1gklknda"
63
+ }
64
+ },
65
+ defaultVariants: { placement: "popup" },
66
+ compoundVariants: []
67
+ }), V = "_1gklkndb", H = "_1gklkndc", U = D({
68
+ defaultClassName: "_1gklknde",
69
+ variantClassNames: { size: {
70
+ small: "_1gklkndf",
71
+ medium: "_1gklkndg",
72
+ large: "_1gklkndh",
73
+ xlarge: "_1gklkndi"
74
+ } },
75
+ defaultVariants: { size: "medium" },
76
+ compoundVariants: []
77
+ }), W = "_1gklkndn", G = y(null), K = (e) => {
78
+ let t = _(8), { popup: n, callbacks: r, client: i, preview: a, children: o } = e, s;
79
+ t[0] !== r || t[1] !== i || t[2] !== n || t[3] !== a ? (s = {
80
+ popup: n,
81
+ callbacks: r,
82
+ client: i,
83
+ preview: a
84
+ }, t[0] = r, t[1] = i, t[2] = n, t[3] = a, t[4] = s) : s = t[4];
85
+ let c;
86
+ return t[5] !== o || t[6] !== s ? (c = /* @__PURE__ */ T(G.Provider, {
87
+ value: s,
88
+ children: o
89
+ }), t[5] = o, t[6] = s, t[7] = c) : c = t[7], c;
90
+ }, q = () => {
91
+ let e = x(G);
92
+ if (!e) throw Error("usePopupContext must be used within a PopupProvider");
93
+ return e;
94
+ }, J = () => x(G), Y = () => {
95
+ let e = _(2), t = J(), n;
96
+ return e[0] === t ? n = e[1] : (n = (e) => {
97
+ let n = e === void 0 ? "programmatic" : e;
98
+ if (!t || l().active_popup_id !== t.popup.id) return;
99
+ let r = u();
100
+ t.callbacks?.onPopupClose?.(t.popup, {
101
+ trigger_type: p(),
102
+ dismiss_reason: n,
103
+ time_shown_ms: r ? Date.now() - r : null
104
+ }), d(t.popup.id);
105
+ }, e[0] = t, e[1] = n), n;
106
+ }, X = "zv6sjd1", Z = "zv6sjd2 zv6sjd1", ee = "zv6sjd3", te = "zv6sjd8", ne = "zv6sjd9", re = "zv6sjda", Q = (e) => {
107
+ let t = _(6), n = J(), r = n?.callbacks?.onAction, i = Y(), { action: a } = e.content, o;
108
+ t[0] !== a || t[1] !== i || t[2] !== n || t[3] !== r || t[4] !== e ? (o = () => {
109
+ a?.type === "redirect" && (!n || n.preview || (r?.(e, {
110
+ action_type: "redirect",
111
+ redirect_url: a.url,
112
+ open_in_new_tab: !!a.openInNewTab
113
+ }), i("cta_click"), a.openInNewTab ? window.open(a.url, "_blank", "noopener,noreferrer") : window.location.href = a.url));
114
+ }, t[0] = a, t[1] = i, t[2] = n, t[3] = r, t[4] = e, t[5] = o) : o = t[5];
115
+ let s = o;
116
+ return a?.type === "redirect" && a.url ? s : null;
117
+ }, ie = (e) => (e ?? "16:9").replace(":", " / "), ae = (e) => {
118
+ if (e.content.coverImage?.srcset) return Object.entries(e.content.coverImage.srcset).filter(([e]) => e !== "path").map(([e, t]) => `${t} ${e}`).join(", ");
119
+ }, oe = (e) => {
120
+ let t = _(18), { popup: n, disableInteraction: r, children: i } = e, { content: a } = n, o = Q(n), s = !!o && !r, c;
121
+ t[0] !== a.coverImage || t[1] !== a.coverImageFocus || t[2] !== n ? (c = a.coverImage && /* @__PURE__ */ T("img", {
122
+ src: a.coverImage.location,
123
+ srcSet: ae(n),
124
+ alt: "",
125
+ className: "_1gklkndl",
126
+ style: a.coverImageFocus ? { objectPosition: a.coverImageFocus.replace("-", " ") } : void 0
127
+ }), t[0] = a.coverImage, t[1] = a.coverImageFocus, t[2] = n, t[3] = c) : c = t[3];
128
+ let l = c, u;
129
+ t[4] === a.coverImageRatio ? u = t[5] : (u = ie(a.coverImageRatio), t[4] = a.coverImageRatio, t[5] = u);
130
+ let d;
131
+ t[6] === u ? d = t[7] : (d = { aspectRatio: u }, t[6] = u, t[7] = d);
132
+ let f = d, p;
133
+ t[8] !== a.action || t[9] !== a.coverImage || t[10] !== s || t[11] !== l || t[12] !== f || t[13] !== o ? (p = a.coverImage && (s ? /* @__PURE__ */ T("button", {
134
+ type: "button",
135
+ className: w("_1gklkndj", "_1gklkndk"),
136
+ style: f,
137
+ onClick: o ?? void 0,
138
+ "aria-label": a.action?.type === "redirect" ? a.action.label : void 0,
139
+ children: l
140
+ }) : /* @__PURE__ */ T("div", {
141
+ className: "_1gklkndj",
142
+ style: f,
143
+ children: l
144
+ })), t[8] = a.action, t[9] = a.coverImage, t[10] = s, t[11] = l, t[12] = f, t[13] = o, t[14] = p) : p = t[14];
145
+ let m;
146
+ return t[15] !== i || t[16] !== p ? (m = /* @__PURE__ */ E("div", {
147
+ className: V,
148
+ children: [p, i]
149
+ }), t[15] = i, t[16] = p, t[17] = m) : m = t[17], m;
150
+ }, se = (e) => {
151
+ let t = _(19), n, r, a, s, l;
152
+ t[0] === e ? (n = t[1], r = t[2], a = t[3], s = t[4], l = t[5]) : ({children: n, popupTheme: r, siteTheme: s, style: l, ...a} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = a, t[4] = s, t[5] = l);
153
+ let u;
154
+ t[6] !== r || t[7] !== s ? (u = r ?? (s ? f(s) : null), t[6] = r, t[7] = s, t[8] = u) : u = t[8];
155
+ let d = u;
156
+ P(d?.fonts?.heading, d?.fonts?.body);
157
+ let p;
158
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (p = w(o, g), t[9] = p) : p = t[9];
159
+ let m;
160
+ t[10] === d ? m = t[11] : (m = c(d), t[10] = d, t[11] = m);
161
+ let h;
162
+ t[12] !== l || t[13] !== m ? (h = {
163
+ ...m,
164
+ ...l
165
+ }, t[12] = l, t[13] = m, t[14] = h) : h = t[14];
166
+ let v;
167
+ return t[15] !== n || t[16] !== a || t[17] !== h ? (v = /* @__PURE__ */ T(i, {
168
+ className: p,
169
+ cssReset: !0,
170
+ style: h,
171
+ ...a,
172
+ children: n
173
+ }), t[15] = n, t[16] = a, t[17] = h, t[18] = v) : v = t[18], v;
174
+ }, ce = b(() => import("./PopupBody-DWM55Zh5-B3ysApDM.js").then((e) => e.n).then((e) => ({ default: e.PopupBody }))), le = (e) => {
175
+ let t = _(7), { size: n } = e, r = n ?? "medium", i;
176
+ t[0] === r ? i = t[1] : (i = U({ size: r }), t[0] = r, t[1] = i);
177
+ let a, o, s;
178
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ T("div", { className: X }), o = /* @__PURE__ */ T("div", { className: Z }), s = /* @__PURE__ */ T("div", { className: ee }), t[2] = a, t[3] = o, t[4] = s) : (a = t[2], o = t[3], s = t[4]);
179
+ let c;
180
+ return t[5] === i ? c = t[6] : (c = /* @__PURE__ */ E("div", {
181
+ className: i,
182
+ children: [
183
+ a,
184
+ o,
185
+ s
186
+ ]
187
+ }), t[5] = i, t[6] = c), c;
188
+ }, $ = () => {
189
+ let e = _(8), { popup: t } = q(), n;
190
+ e[0] === t.content.size ? n = e[1] : (n = /* @__PURE__ */ T(le, { size: t.content.size }), e[0] = t.content.size, e[1] = n);
191
+ let r;
192
+ e[2] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ T(ce, {}), e[2] = r) : r = e[2];
193
+ let i;
194
+ e[3] === n ? i = e[4] : (i = /* @__PURE__ */ T(v, {
195
+ fallback: n,
196
+ children: r
197
+ }), e[3] = n, e[4] = i);
198
+ let a;
199
+ return e[5] !== t || e[6] !== i ? (a = /* @__PURE__ */ T(oe, {
200
+ popup: t,
201
+ children: i
202
+ }), e[5] = t, e[6] = i, e[7] = a) : a = e[7], a;
203
+ }, ue = (e) => e.content.position || "top-right", de = (e) => {
204
+ switch (e) {
205
+ case "close-press": return "close_button";
206
+ case "outside-press": return "outside_click";
207
+ case "escape-key": return "escape_key";
208
+ default: return "programmatic";
209
+ }
210
+ }, fe = () => {
211
+ let i = _(32), { popup: o, callbacks: c } = q(), { placement: l, id: u } = o, d = m(h).active_popup_id === u, f = C(!1), g, v;
212
+ i[0] !== c || i[1] !== d || i[2] !== o ? (g = () => {
213
+ d && !f.current && (f.current = !0, c?.onPopupOpen?.(o, { trigger_type: p() })), d || (f.current = !1);
214
+ }, v = [
215
+ d,
216
+ o,
217
+ c
218
+ ], i[0] = c, i[1] = d, i[2] = o, i[3] = g, i[4] = v) : (g = i[3], v = i[4]), S(g, v);
219
+ let y = Y(), b, x, D, k, A, j, M, N;
220
+ if (i[5] !== y || i[6] !== d || i[7] !== l || i[8] !== o) {
221
+ let c = ue(o), u = l === "popup", f = l === "slide_in";
222
+ x = a, A = d, i[17] === y ? j = i[18] : (j = (e, t) => !e && y(de(t?.reason)), i[17] = y, i[18] = j), M = u, N = !u, b = n, i[19] === u ? D = i[20] : (D = u && /* @__PURE__ */ T(s, {}), i[19] = u, i[20] = D), k = u ? /* @__PURE__ */ T(t, {
223
+ className: H,
224
+ children: /* @__PURE__ */ E(e.Popup, {
225
+ className: B({ placement: l }),
226
+ children: [/* @__PURE__ */ T(r, {
227
+ variant: "ghost",
228
+ size: "icon-xs",
229
+ className: W,
230
+ "aria-label": "Close popup",
231
+ children: /* @__PURE__ */ T(O, { size: 16 })
232
+ }), /* @__PURE__ */ T($, {})]
233
+ })
234
+ }) : /* @__PURE__ */ E(e.Popup, {
235
+ className: w(B({
236
+ placement: l,
237
+ position: c
238
+ }), f && "_1gklkndd"),
239
+ children: [/* @__PURE__ */ T(r, {
240
+ variant: "ghost",
241
+ size: "icon-xs",
242
+ className: W,
243
+ "aria-label": "Close popup",
244
+ children: /* @__PURE__ */ T(O, { size: 16 })
245
+ }), /* @__PURE__ */ T($, {})]
246
+ }), i[5] = y, i[6] = d, i[7] = l, i[8] = o, i[9] = b, i[10] = x, i[11] = D, i[12] = k, i[13] = A, i[14] = j, i[15] = M, i[16] = N;
247
+ } else b = i[9], x = i[10], D = i[11], k = i[12], A = i[13], j = i[14], M = i[15], N = i[16];
248
+ let P;
249
+ i[21] !== b || i[22] !== D || i[23] !== k ? (P = /* @__PURE__ */ E(b, { children: [D, k] }), i[21] = b, i[22] = D, i[23] = k, i[24] = P) : P = i[24];
250
+ let F;
251
+ return i[25] !== x || i[26] !== A || i[27] !== j || i[28] !== M || i[29] !== N || i[30] !== P ? (F = /* @__PURE__ */ T(x, {
252
+ open: A,
253
+ onOpenChange: j,
254
+ modal: M,
255
+ disablePointerDismissal: N,
256
+ children: P
257
+ }), i[25] = x, i[26] = A, i[27] = j, i[28] = M, i[29] = N, i[30] = P, i[31] = F) : F = i[31], F;
258
+ };
259
+ //#endregion
260
+ export { Q as a, fe as c, ne as i, re as l, te as n, U as o, q as r, se as s, K as t, z as u };
@@ -0,0 +1,207 @@
1
+ import { c as e, r as t, s as n, t as r, u as i } from "./PopupDialog-DwAAJ8JS-DkxjZaJL.js";
2
+ import { a, c as o } from "./inlineBaseTheme-DcNdMEYp.js";
3
+ import { d as s, l as c, r as l, u } from "./dist-DEXGyFeH.js";
4
+ import { c as d } from "react/compiler-runtime";
5
+ import { useEffect as f, useRef as p } from "react";
6
+ import { Fragment as m, jsx as h } from "react/jsx-runtime";
7
+ import { $activity as g, $isIdentityContextReady as _, $pageLifecycle as v, $scrollBehavior as y, $session as b, getTabCount as x } from "@levo-so/insights/stores";
8
+ //#region ../../libraries/popups/dist/PopupRenderer-BVtV4b9I.js
9
+ var S = 3e4, C = 5e3, w = 5e3, T = 100, E = .5, D = 5, O = (e) => {
10
+ if (typeof document > "u") return () => {};
11
+ let t = !1, n = Date.now(), r = [], i = 0, a = null, o = () => Date.now() - n >= S, s = () => {
12
+ t || (t = !0, c(), e());
13
+ }, c = () => {
14
+ a &&= (clearTimeout(a), null);
15
+ }, l = () => {
16
+ if (r.length < 2) return 0;
17
+ let e = r[0], t = r[r.length - 1], n = t.t - e.t;
18
+ return n === 0 ? 0 : (e.y - t.y) / n;
19
+ }, u = () => r.reduce((e, t) => t.y > e ? t.y : e, 0), d = (e) => {
20
+ r.push({
21
+ y: e.clientY,
22
+ t: Date.now()
23
+ }), r.length > D && r.shift();
24
+ }, f = (e) => {
25
+ t || !o() || e.clientY > 0 || u() < T || Date.now() - i < w || l() < E || (c(), a = setTimeout(s, C));
26
+ }, p = () => {
27
+ c();
28
+ }, m = () => {
29
+ i = Date.now();
30
+ }, h = v.listen((e) => {
31
+ o() && (e === "hidden" || e === "frozen") && s();
32
+ });
33
+ return document.addEventListener("mousemove", d, { passive: !0 }), document.addEventListener("mouseleave", f), document.addEventListener("mouseenter", p), window.addEventListener("scroll", m, { passive: !0 }), () => {
34
+ c(), document.removeEventListener("mousemove", d), document.removeEventListener("mouseleave", f), document.removeEventListener("mouseenter", p), window.removeEventListener("scroll", m), h();
35
+ };
36
+ }, k = (e, t) => {
37
+ if (!e) return null;
38
+ let n = setTimeout(() => u(t, { trigger_type: "time_on_page" }), e);
39
+ return () => clearTimeout(n);
40
+ }, A = (e, t) => {
41
+ if (e === void 0) return null;
42
+ let n = !1;
43
+ return y.listen((r) => {
44
+ n || r.depth >= e && (n = !0, u(t, { trigger_type: "scroll_depth" }));
45
+ });
46
+ }, j = (e) => {
47
+ let t = !1;
48
+ return g.listen((n) => {
49
+ t || n.status === "idle" && (t = !0, u(e, { trigger_type: "inactivity" }));
50
+ });
51
+ }, M = (e, t) => {
52
+ let n = d(11), r = t === void 0 ? !0 : t, { triggers: i, id: a } = e, o = l(_), s;
53
+ n[0] === Symbol.for("react.memo_cache_sentinel") ? (s = [], n[0] = s) : s = n[0];
54
+ let c = p(s), m;
55
+ n[1] !== r || n[2] !== o || n[3] !== e || n[4] !== i ? (m = () => {
56
+ if (!r || !o || !i) return;
57
+ let t = [];
58
+ if (i.time_on_page.enabled) {
59
+ let n = k(i.time_on_page.delay_ms, e);
60
+ n && t.push(n);
61
+ }
62
+ if (i.scroll_depth.enabled) {
63
+ let n = A(i.scroll_depth.percent, e);
64
+ n && t.push(n);
65
+ }
66
+ return i.exit_intent.enabled && t.push(O(() => u(e, { trigger_type: "exit_intent" }))), i.inactivity.enabled && t.push(j(e)), c.current = t, () => {
67
+ t.forEach(N), c.current = [];
68
+ };
69
+ }, n[1] = r, n[2] = o, n[3] = e, n[4] = i, n[5] = m) : m = n[5];
70
+ let h;
71
+ n[6] !== r || n[7] !== o || n[8] !== a || n[9] !== i ? (h = [
72
+ r,
73
+ o,
74
+ a,
75
+ i
76
+ ], n[6] = r, n[7] = o, n[8] = a, n[9] = i, n[10] = h) : h = n[10], f(m, h);
77
+ };
78
+ function N(e) {
79
+ return e();
80
+ }
81
+ var P = (e, t) => {
82
+ switch (e.match_type) {
83
+ case "is_all_pages": return !0;
84
+ case "is": return e.page_id ? t.pageId === e.page_id ? e.value == null || e.value === t.path : !1 : e.value != null && e.value === t.path;
85
+ case "contains": return e.value != null && t.path.includes(e.value);
86
+ case "begins_with": return e.value != null && t.path.startsWith(e.value);
87
+ default: return !1;
88
+ }
89
+ }, F = (e, t) => {
90
+ switch (e.match_type) {
91
+ case "exact": return t === e.value;
92
+ case "contains": return t.includes(e.value);
93
+ case "domain": try {
94
+ let n = new URL(t).hostname, r = e.value.toLowerCase();
95
+ return n === r || n.endsWith(`.${r}`);
96
+ } catch {
97
+ return !1;
98
+ }
99
+ default: return !1;
100
+ }
101
+ }, I = (e, t, n) => {
102
+ let r = e.pages?.exclude ?? [];
103
+ if (r.length > 0 && r.some((e) => P(e, t))) return !1;
104
+ let i = e.pages?.include ?? [];
105
+ if (i.length > 0 && !i.some((e) => P(e, t))) return !1;
106
+ let a = e.referrer?.include ?? [];
107
+ if (a.length > 0 && (!n || !a.some((e) => F(e, n)))) return !1;
108
+ let o = e.referrer?.exclude ?? [];
109
+ return !(o.length > 0 && n && o.some((e) => F(e, n)));
110
+ }, L = (n) => {
111
+ let r = d(4), { pageId: i } = n, { popup: a } = t(), o;
112
+ bb0: {
113
+ if (!a.target) {
114
+ o = !0;
115
+ break bb0;
116
+ }
117
+ if (typeof window > "u") {
118
+ o = !1;
119
+ break bb0;
120
+ }
121
+ let e;
122
+ if (r[0] !== i || r[1] !== a.target) {
123
+ let t = b.get().identity?.referrer?.raw || document.referrer || null, n = new URL(window.location.href, window.location.origin);
124
+ e = I(a.target, {
125
+ pageId: i,
126
+ path: n.pathname
127
+ }, t), r[0] = i, r[1] = a.target, r[2] = e;
128
+ } else e = r[2];
129
+ o = e;
130
+ }
131
+ let s = o;
132
+ if (M(a, s), !s) return null;
133
+ let c;
134
+ return r[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ h(e, {}), r[3] = c) : c = r[3], c;
135
+ }, R = () => {
136
+ let e = y.get(), t = g.get();
137
+ return {
138
+ trigger_scroll_depth: e.depth,
139
+ trigger_scroll_speed: e.speedCategory,
140
+ trigger_scroll_direction: e.direction,
141
+ trigger_activity_status: t.status,
142
+ trigger_activity_seconds: t.seconds,
143
+ trigger_tab_count: x()
144
+ };
145
+ }, z = (e) => {
146
+ let t = d(18), { popups: i, pageId: l } = e, u = o(), p = a(), g, _;
147
+ t[0] === i ? (g = t[1], _ = t[2]) : (g = () => {
148
+ s(i), c(!1);
149
+ }, _ = [i], t[0] = i, t[1] = g, t[2] = _), f(g, _);
150
+ let v;
151
+ t[3] === u ? v = t[4] : (v = (e, t) => {
152
+ !u || typeof u.track != "function" || u?.track(e, t);
153
+ }, t[3] = u, t[4] = v);
154
+ let y = v, b = B, x;
155
+ t[5] === y ? x = t[6] : (x = {
156
+ onPopupOpen: (e, t) => {
157
+ y("popup.view", {
158
+ ...b(e),
159
+ trigger_type: t.trigger_type,
160
+ language: e.language,
161
+ ...R()
162
+ });
163
+ },
164
+ onPopupClose: (e, t) => {
165
+ y("popup.close", {
166
+ ...b(e),
167
+ trigger_type: t.trigger_type,
168
+ dismiss_reason: t.dismiss_reason,
169
+ time_shown_ms: t.time_shown_ms
170
+ });
171
+ },
172
+ onAction: (e, t) => {
173
+ y("popup.action", {
174
+ ...b(e),
175
+ ...t
176
+ });
177
+ }
178
+ }, t[5] = y, t[6] = x);
179
+ let S = x, C;
180
+ if (t[7] !== S || t[8] !== p || t[9] !== l || t[10] !== i) {
181
+ let e;
182
+ t[12] !== S || t[13] !== p || t[14] !== l ? (e = (e) => /* @__PURE__ */ h(n, {
183
+ popupTheme: e.theme,
184
+ siteTheme: e.site?.theme,
185
+ children: /* @__PURE__ */ h(r, {
186
+ popup: e,
187
+ callbacks: S,
188
+ client: p,
189
+ children: /* @__PURE__ */ h(L, { pageId: l })
190
+ })
191
+ }, e.id), t[12] = S, t[13] = p, t[14] = l, t[15] = e) : e = t[15], C = i.map(e), t[7] = S, t[8] = p, t[9] = l, t[10] = i, t[11] = C;
192
+ } else C = t[11];
193
+ let w;
194
+ return t[16] === C ? w = t[17] : (w = /* @__PURE__ */ h(m, { children: C }), t[16] = C, t[17] = w), w;
195
+ };
196
+ function B(e) {
197
+ return {
198
+ resource: "builder.popup",
199
+ identifier: e.id,
200
+ popup_title: e.title,
201
+ placement: e.placement,
202
+ popup_action_kind: e.content.action?.type || "none"
203
+ };
204
+ }
205
+ var V = /* @__PURE__ */ i({ PopupRenderer: () => z });
206
+ //#endregion
207
+ export { V as t };