@levo-so/studio 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 (69) hide show
  1. package/BillingStep-ioR7mSo5.js +249 -0
  2. package/BookingCard-DEkBXh7O.js +646 -0
  3. package/DateTimeWidget-B-dajfHj.js +253 -0
  4. package/{EntryCard-9yv0KJTB.js → EntryCard-CZfljZAY.js} +4 -4
  5. package/{KBChatWidget-D39Z3HIl.js → KBChatWidget-BXRRgelS.js} +1 -1
  6. package/{LoginCard-D9vEC_g0.js → LoginCard-BVjeN1J0.js} +3 -3
  7. package/{LoginForm-kI_b_7Tc.js → LoginForm-DQVwLQCx.js} +19 -19
  8. package/{LoginModal-C-9BhmoO.js → LoginModal-C6TdAh-0.js} +5 -6
  9. package/{MessageCard-Nsxr98n6.js → MessageCard-B5MbVDJ8.js} +2 -2
  10. package/{MessageFooter-K4Zd_eFO.js → MessageFooter-DrlKXE9a.js} +1 -2
  11. package/{PendingApprovalCard-CzoBgYNy.js → PendingApprovalCard-5iFAeE1s.js} +3 -3
  12. package/{PhoneWidget-BtMMfGLu.js → PhoneWidget-B4KHlFjT.js} +6 -7
  13. package/{Popover-Iis-qOn1.js → Popover-y8XkbYNh.js} +7 -7
  14. package/{PopupBody-BI-MJqmd-B3ltSYMP.js → PopupBody-DWM55Zh5-DuOPsCAn.js} +53 -55
  15. package/PopupDialog-DwAAJ8JS-9xm5jrXW.js +261 -0
  16. package/PopupRenderer-BVtV4b9I-BdPryfLY.js +208 -0
  17. package/{ProfileCard-Chg20HBa.js → ProfileCard-WgFT-T4U.js} +5 -5
  18. package/{RichTextWidget-C3Y-0pNy.js → RichTextWidget-DKYm1cSW.js} +120 -123
  19. package/{Spinner-D5spB_Mv.js → Spinner-LdYfm4S7.js} +1 -1
  20. package/{VerifyButton-BwTbzSwS.js → VerifyButton-CNq78zG4.js} +5 -7
  21. package/collection.d.ts +9 -1
  22. package/collection.js +1 -1
  23. package/dialog-CU5nHKc5.js +119 -0
  24. package/dist-IMRD6dob.js +3858 -0
  25. package/index.js +3280 -2848
  26. package/{inlineRteTheme-BOAno9MG.js → inlineRteTheme-DFg69bqP.js} +50 -37
  27. package/{kbChat-zXbn56Zb.js → kbChat-eFsau7hG.js} +2 -2
  28. package/package.json +42 -43
  29. package/{pillChrome-QDjBETmP.js → pillChrome-Dy3ApFI5.js} +5 -5
  30. package/price-BUDkN5Me.js +823 -0
  31. package/script.esm-uVCZU25S.js +62 -0
  32. package/studio.css +1 -1
  33. package/themeMapping-DH_NoXK8-H-EHXbBt.js +156 -0
  34. package/useCheckout-gscmzFLD.js +179 -0
  35. package/useLogin-BYVekOp9.js +237 -0
  36. package/AuthProvider-B5NfFwbG.js +0 -118
  37. package/BillingStep-BTDOMFHV.js +0 -181
  38. package/Button-DXLWW3dp.js +0 -504
  39. package/CollectionField-BZmxRB5D.js +0 -270
  40. package/CollectionInput-DyNbxIZ8.js +0 -147
  41. package/DateTimeWidget-Bt1UcCnx.js +0 -255
  42. package/Dialog-CPE8yUqK.js +0 -130
  43. package/ModalManager-CzH36UIk.js +0 -32
  44. package/PopupRenderer-D66Gx63H-ChI4WBer.js +0 -389
  45. package/RteThemeProvider-owl5oajj.js +0 -20
  46. package/ThemeProvider-CqPHzkW9.js +0 -116
  47. package/Tooltip-DHU1QD-n.js +0 -67
  48. package/authentication-BXQbxiPP.js +0 -36
  49. package/bookingCard-g0n3ksiC.js +0 -605
  50. package/createThemeExtension-C0PSYy0J.js +0 -15
  51. package/dialog-8LH_ihs4.js +0 -92
  52. package/dist-Dijjo-5m.js +0 -3794
  53. package/generateRadiusScale-RROt8ppa.js +0 -71
  54. package/inlineCollectionTheme-uhBXoF1F.js +0 -19
  55. package/popupState-JmpeKzgM-UECLsSbL.js +0 -100
  56. package/rteTheme.cssm-W4gTOijw.js +0 -4
  57. package/theme.cssm-Czj9sF4X.js +0 -4
  58. package/themeMapping-Bi9Rcr5G-C7UXWE6o.js +0 -61
  59. package/useCheckout-DFalmfEQ.js +0 -161
  60. package/useLogin-CfnGrLdO.js +0 -127
  61. package/usePopupRedirect-CAAdcpaW-DdME0F7f.js +0 -82
  62. /package/{Beams-WJN38XSv.js → Beams-KsU_ixpY.js} +0 -0
  63. /package/{Dots-DggLz5I7.js → Dots-C_ja_PPu.js} +0 -0
  64. /package/{Gradient-BSWJAu0a.js → Gradient-CDGFLaA-.js} +0 -0
  65. /package/{Grid-BFKl0MUt.js → Grid-C22rTkrs.js} +0 -0
  66. /package/{Waves-BPEgTYoO.js → Waves-Cl5rKcFJ.js} +0 -0
  67. /package/{card-5ooLmYSr.js → card-BIebVDA0.js} +0 -0
  68. /package/{cn-B6c1DjO_.js → cn-CzJDhklM.js} +0 -0
  69. /package/{fontSize-B-ba6pvx.js → fontSize-DowUyWe-.js} +0 -0
@@ -1,181 +0,0 @@
1
- "use client";
2
- import { t as e } from "./Button-DXLWW3dp.js";
3
- import { useState as t } from "react";
4
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
5
- //#region src/components/bookingCard/BillingStep.tsx
6
- var a = ({ onSubmit: a, prefillName: o, prefillData: s, isEdit: c, onClose: l }) => {
7
- let u = !!s?.tax_id, [d, f] = t(u), [p, m] = t(o || (u ? "" : s?.name) || ""), [h, g] = t(u && s?.name || ""), [_, v] = t(s?.tax_id || ""), [y, b] = t({
8
- line1: s?.address?.line1 || "",
9
- line2: s?.address?.line2 || "",
10
- city: s?.address?.city || "",
11
- state: s?.address?.state || "",
12
- postal_code: s?.address?.postal_code || "",
13
- country: s?.address?.country || ""
14
- }), x = (e) => {
15
- e.preventDefault();
16
- let t = {
17
- name: d ? h.trim() : p.trim(),
18
- address: {
19
- line1: y.line1.trim(),
20
- line2: y.line2.trim() || void 0,
21
- city: y.city.trim(),
22
- state: y.state.trim(),
23
- postal_code: y.postal_code.trim(),
24
- country: y.country.trim()
25
- }
26
- };
27
- d && _.trim() && (t.tax_id = _.trim()), a(t);
28
- }, S = (e, t) => {
29
- b((n) => ({
30
- ...n,
31
- [e]: t
32
- }));
33
- }, C = "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none";
34
- return /* @__PURE__ */ i("div", {
35
- className: "mx-auto w-full max-w-lg px-4 py-6",
36
- children: [/* @__PURE__ */ i("div", {
37
- className: "mb-6 text-center",
38
- children: [/* @__PURE__ */ r("p", {
39
- className: "mb-1 font-medium text-gray-500 text-xs uppercase tracking-wider",
40
- children: "Billing Information"
41
- }), /* @__PURE__ */ r("p", {
42
- className: "text-gray-500 text-sm",
43
- children: "Add your billing details for the invoice"
44
- })]
45
- }), /* @__PURE__ */ i("form", {
46
- onSubmit: x,
47
- className: "flex flex-col gap-4",
48
- children: [
49
- /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ i("label", {
50
- htmlFor: "billing_name",
51
- className: "font-medium text-sm",
52
- children: ["Name ", /* @__PURE__ */ r("span", {
53
- className: "text-red-500",
54
- children: "*"
55
- })]
56
- }), /* @__PURE__ */ r("input", {
57
- id: "billing_name",
58
- className: C,
59
- placeholder: "Full Name",
60
- value: p,
61
- onChange: (e) => m(e.target.value),
62
- required: !0
63
- })] }),
64
- /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ i("label", {
65
- htmlFor: "billing_is_business",
66
- className: "flex items-center gap-2 text-sm",
67
- children: [/* @__PURE__ */ r("input", {
68
- id: "billing_is_business",
69
- type: "checkbox",
70
- checked: d,
71
- onChange: (e) => f(e.target.checked),
72
- className: "rounded border-gray-300"
73
- }), /* @__PURE__ */ r("span", {
74
- className: "font-medium",
75
- children: "This is a business purchase"
76
- })]
77
- }), /* @__PURE__ */ r("p", {
78
- className: "mt-1 text-gray-500 text-xs",
79
- children: "Check this if you need a tax-compliant invoice with business details"
80
- })] }),
81
- d && /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ i("div", { children: [/* @__PURE__ */ i("label", {
82
- htmlFor: "billing_business_name",
83
- className: "font-medium text-sm",
84
- children: ["Business Name ", /* @__PURE__ */ r("span", {
85
- className: "text-red-500",
86
- children: "*"
87
- })]
88
- }), /* @__PURE__ */ r("input", {
89
- id: "billing_business_name",
90
- className: C,
91
- value: h,
92
- onChange: (e) => g(e.target.value),
93
- required: d
94
- })] }), /* @__PURE__ */ i("div", { children: [/* @__PURE__ */ i("label", {
95
- htmlFor: "billing_tax_id",
96
- className: "font-medium text-sm",
97
- children: ["Tax ID ", /* @__PURE__ */ r("span", {
98
- className: "text-red-500",
99
- children: "*"
100
- })]
101
- }), /* @__PURE__ */ r("input", {
102
- id: "billing_tax_id",
103
- className: C,
104
- value: _,
105
- onChange: (e) => v(e.target.value),
106
- required: d
107
- })] })] }),
108
- /* @__PURE__ */ i("div", { children: [
109
- /* @__PURE__ */ i("label", {
110
- className: "font-medium text-sm",
111
- children: ["Address ", /* @__PURE__ */ r("span", {
112
- className: "text-red-500",
113
- children: "*"
114
- })]
115
- }),
116
- /* @__PURE__ */ r("input", {
117
- className: `mb-2 ${C}`,
118
- placeholder: "Street Address Line 1",
119
- value: y.line1,
120
- onChange: (e) => S("line1", e.target.value),
121
- required: !0
122
- }),
123
- /* @__PURE__ */ r("input", {
124
- className: `mb-2 ${C}`,
125
- placeholder: "Street Address Line 2 (Optional)",
126
- value: y.line2,
127
- onChange: (e) => S("line2", e.target.value)
128
- }),
129
- /* @__PURE__ */ i("div", {
130
- className: "grid grid-cols-2 gap-2",
131
- children: [/* @__PURE__ */ r("input", {
132
- className: C,
133
- placeholder: "City",
134
- value: y.city,
135
- onChange: (e) => S("city", e.target.value),
136
- required: !0
137
- }), /* @__PURE__ */ r("input", {
138
- className: C,
139
- placeholder: "State/Province",
140
- value: y.state,
141
- onChange: (e) => S("state", e.target.value),
142
- required: !0
143
- })]
144
- }),
145
- /* @__PURE__ */ i("div", {
146
- className: "mt-2 grid grid-cols-2 gap-2",
147
- children: [/* @__PURE__ */ r("input", {
148
- className: C,
149
- placeholder: "Postal Code",
150
- value: y.postal_code,
151
- onChange: (e) => S("postal_code", e.target.value),
152
- required: !0
153
- }), /* @__PURE__ */ r("input", {
154
- className: C,
155
- placeholder: "Country",
156
- value: y.country,
157
- onChange: (e) => S("country", e.target.value),
158
- required: !0
159
- })]
160
- })
161
- ] }),
162
- /* @__PURE__ */ i("div", {
163
- className: "flex flex-col-reverse justify-end gap-3 pt-2 md:flex-row",
164
- children: [/* @__PURE__ */ r("button", {
165
- type: "button",
166
- onClick: () => c && l ? l() : a(null),
167
- className: "rounded-lg px-6 py-2.5 font-medium text-gray-500 text-sm hover:text-gray-700",
168
- children: c ? "Close" : "Skip"
169
- }), /* @__PURE__ */ r(e, {
170
- elementKey: "billing-continue-btn",
171
- className: "rounded-lg px-6 py-2.5 font-semibold",
172
- type: "submit",
173
- children: c ? "Update" : "Continue"
174
- })]
175
- })
176
- ]
177
- })]
178
- });
179
- };
180
- //#endregion
181
- export { a as BillingStep };
@@ -1,504 +0,0 @@
1
- "use client";
2
- import { a as e, c as t, i as n, l as r, o as i, t as a, u as o } from "./popupState-JmpeKzgM-UECLsSbL.js";
3
- import { n as s } from "./AuthProvider-B5NfFwbG.js";
4
- import { n as c } from "./ModalManager-CzH36UIk.js";
5
- import { t as l } from "./cn-B6c1DjO_.js";
6
- import { c as u } from "react/compiler-runtime";
7
- import { $isIdentityContextReady as d } from "@levo-so/insights/stores";
8
- import { useLevo as f } from "@levo-so/react";
9
- import * as p from "react";
10
- import { Suspense as m, createContext as h, forwardRef as g, lazy as _, memo as v, useContext as ee, useEffect as y, useMemo as b, useRef as x, useState as S } from "react";
11
- import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
12
- import { useStore as E } from "@nanostores/react";
13
- import { animate as te, scroll as ne } from "motion/react";
14
- import D from "html-react-parser";
15
- import { LoaderCircle as re } from "lucide-react";
16
- import * as ie from "motion/react-m";
17
- import ae from "next/link";
18
- import oe from "isomorphic-dompurify";
19
- //#region ../../libraries/popups/dist/index.js
20
- var O = async (e, t) => {
21
- let n = {};
22
- 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 ?? [];
23
- }, k = _(() => import("./PopupRenderer-D66Gx63H-ChI4WBer.js").then((e) => e.t).then((e) => ({ default: e.PopupRenderer }))), A = (e) => {
24
- let t = u(9), { siteId: n, pageId: r } = e, { fetch: a, logger: o } = f(), [s, c] = S(null), l = x(!1), p, h;
25
- if (t[0] !== a || t[1] !== o || t[2] !== n ? (p = () => {
26
- if (l.current) return;
27
- let e = () => {
28
- l.current || (l.current = !0, O(a, n ? { site_id: n } : void 0).then((e) => {
29
- i(e), c(e);
30
- }).catch((e) => {
31
- o?.error("Failed to fetch popups", { exception: e }), i([]), c([]);
32
- }).finally(j));
33
- };
34
- if (d.get()) {
35
- e();
36
- return;
37
- }
38
- let t = d.listen((n) => {
39
- n && (t(), e());
40
- });
41
- return () => t();
42
- }, h = [
43
- a,
44
- o,
45
- n
46
- ], t[0] = a, t[1] = o, t[2] = n, t[3] = p, t[4] = h) : (p = t[3], h = t[4]), y(p, h), !s || s.length === 0) return null;
47
- let g;
48
- t[5] === Symbol.for("react.memo_cache_sentinel") ? (g = {
49
- position: "relative",
50
- zIndex: 99999
51
- }, t[5] = g) : g = t[5];
52
- let _;
53
- return t[6] !== r || t[7] !== s ? (_ = /* @__PURE__ */ w("div", {
54
- style: g,
55
- children: /* @__PURE__ */ w(m, { children: /* @__PURE__ */ w(k, {
56
- popups: s,
57
- pageId: r
58
- }) })
59
- }), t[6] = r, t[7] = s, t[8] = _) : _ = t[8], _;
60
- };
61
- function j() {
62
- return r(!1);
63
- }
64
- var M = () => {
65
- let t = u(3), n = E(e), r = E(o), i = se, a = ce, s;
66
- return t[0] !== r || t[1] !== n ? (s = {
67
- popups: n,
68
- isLoading: r,
69
- openPopup: i,
70
- closePopup: a
71
- }, t[0] = r, t[1] = n, t[2] = s) : s = t[2], s;
72
- };
73
- function se(t) {
74
- let n = e.get().find((e) => e.id === t);
75
- n && a(n, {
76
- force: !0,
77
- trigger_type: "manual"
78
- });
79
- }
80
- function ce() {
81
- let e = n.get().active_popup_id;
82
- e && t(e);
83
- }
84
- //#endregion
85
- //#region src/providers/BlockContext.tsx
86
- var N = h({
87
- isStudio: !1,
88
- renderMode: "live",
89
- workspace_id: "",
90
- pageSource: []
91
- }), le = ({ children: e, value: t }) => {
92
- let [n, r] = S(t.parsedBlockData);
93
- y(() => {
94
- r((e) => t.parsedBlockData === e ? e : t.parsedBlockData);
95
- }, [t.parsedBlockData]);
96
- let i = b(() => ({
97
- parsedBlockData: n,
98
- setParsedBlockData: r,
99
- blockData: t.blockData,
100
- pageContext: t.pageContext,
101
- pageMeta: t.pageMeta,
102
- blockContext: t.blockContext,
103
- isStudio: t.renderMode?.startsWith("studio.") ?? !1,
104
- renderMode: t.renderMode,
105
- workspace_id: t.workspace_id,
106
- pageSource: t.pageSource,
107
- languageVariants: t.languageVariants,
108
- language: t.language
109
- }), [
110
- n,
111
- r,
112
- t.blockData,
113
- t.pageContext,
114
- t.pageMeta,
115
- t.blockContext,
116
- t.renderMode,
117
- t.workspace_id,
118
- t.pageSource,
119
- t.languageVariants,
120
- t.language
121
- ]);
122
- return /* @__PURE__ */ w(N.Provider, {
123
- value: i,
124
- children: e
125
- });
126
- }, P = () => ee(N), F = () => {
127
- let { languageVariants: e } = P();
128
- return { languageVariants: e ?? [] };
129
- }, I = {
130
- opacity: 1,
131
- scale: 1,
132
- rotate: 0,
133
- rotateX: 0,
134
- rotateY: 0,
135
- x: 0,
136
- y: 0,
137
- skewX: 0,
138
- skewY: 0
139
- }, L = {
140
- opacity: 0,
141
- scale: 1,
142
- rotate: 0,
143
- rotateX: 0,
144
- rotateY: 0,
145
- x: 0,
146
- y: 0,
147
- skewX: 0,
148
- skewY: 0
149
- }, R = {
150
- type: "spring",
151
- duration: .5,
152
- delay: 0,
153
- bounce: .25,
154
- ease: "easeOut"
155
- }, z = {
156
- once: !0,
157
- amount: "some",
158
- margin: "0px 0px -150px 0px"
159
- }, B = (e, t) => {
160
- if (!(!e || !t)) return t.split(".").reduce((e, t) => {
161
- if (e == null) return;
162
- let n = /^\d+$/.test(t), r = e;
163
- if (n) {
164
- let e = parseInt(t, 10);
165
- return Array.isArray(r) ? r[e] : r?.[e];
166
- }
167
- return r?.[t];
168
- }, e);
169
- }, V = (e) => !!e && typeof e == "object" && "selectedVariants" in e, H = (e) => e?.replaceAll(".", "-").replace(/[^a-zA-Z0-9_-]/g, ""), U = (e) => {
170
- let t = e.split(".");
171
- for (let e = t.length - 2; e >= 1; e--) if (t[e] && /^\d+$/.test(t[e])) {
172
- let n = t[e - 1], r = parseInt(t[e], 10), i = t.slice(e + 1).join("."), a = [];
173
- for (let n = 0; n <= e - 1; n++) {
174
- let e = t[n];
175
- if (/^\d+$/.test(e)) continue;
176
- let r = t[n + 1];
177
- r && /^\d+$/.test(r) ? (a.push(`${e}_levoGroupItem`), n++) : a.push(e);
178
- }
179
- i && a.push(i);
180
- let o = a.join(".");
181
- return {
182
- isGroupItem: !0,
183
- groupKey: n,
184
- itemIndex: r,
185
- childKey: i,
186
- groupItemKey: `${n}_levoGroupItem`,
187
- sharedPath: o
188
- };
189
- }
190
- return { isGroupItem: !1 };
191
- }, W = (e) => {
192
- let t = [];
193
- return V(e) && Object.entries(e.selectedVariants).forEach(([e, n]) => {
194
- typeof n == "string" && t.push(`levo-variant-${e}-${n}`);
195
- }), t;
196
- }, G = (e, t, n) => b(() => {
197
- let r = W(n), i = `levo-${t}-${H(e)}`, a = U(e);
198
- return a.isGroupItem && a.sharedPath ? [
199
- `levo-${t}-${H(a.sharedPath)}`,
200
- i,
201
- ...r
202
- ].filter(Boolean).join(" ") : [i, ...r].join(" ");
203
- }, [
204
- n?.selectedVariants,
205
- e,
206
- t
207
- ]), K = (e, t, n, r, i, a) => b(() => {
208
- let { className: o, style: s, config: c, styles: l, content: u, ...d } = e;
209
- return {
210
- ...d,
211
- elementKey: t,
212
- config: {
213
- ...n,
214
- ...c
215
- },
216
- styles: {
217
- ...r,
218
- ...l
219
- },
220
- content: u ?? i,
221
- generatedClassName: a,
222
- className: o,
223
- style: s
224
- };
225
- }, [
226
- e,
227
- t,
228
- n,
229
- r,
230
- i,
231
- a
232
- ]), q = ({ children: e, ...t }) => {
233
- let { isStudio: n, renderMode: r } = P();
234
- return n ? e : /* @__PURE__ */ w(ae, {
235
- ...t,
236
- children: e
237
- });
238
- }, ue = (e) => {
239
- if (e?.action) switch (e.action.type) {
240
- case "external_link": {
241
- let t = e.action.value;
242
- return t ? /^([a-z][a-z0-9+.-]*:|\/\/)/.test(t) || t.startsWith("#") || t.startsWith("/") ? t : `https://${t}` : void 0;
243
- }
244
- case "page": return e.action.value;
245
- case "page_section": return e.action.value ? `#${e.action.value}` : void 0;
246
- case "email": return `mailto:${e.action.value}`;
247
- case "phone": return `tel:${e.action.value}`;
248
- default: return;
249
- }
250
- }, J = ({ children: e, config: t }) => {
251
- let { openModal: n } = c(), { isLoggedIn: r } = s(), { openPopup: i } = M(), a = t?.action?.alt;
252
- if (t?.action?.type === "popup") {
253
- let n = t.action.value, r = () => {
254
- n && i(n);
255
- };
256
- return /* @__PURE__ */ w("div", {
257
- style: { display: "contents" },
258
- role: "button",
259
- tabIndex: 0,
260
- "aria-label": a || void 0,
261
- onClick: r,
262
- onKeyDown: (e) => {
263
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), r());
264
- },
265
- children: e
266
- });
267
- }
268
- if (t?.action?.type === "login") {
269
- if (r) return /* @__PURE__ */ w(q, {
270
- href: t?.action?.value || "",
271
- style: { display: "contents" },
272
- "aria-label": a || void 0,
273
- children: e
274
- });
275
- let i = () => {
276
- n("login", { redirect_uri: t?.action?.value });
277
- };
278
- return /* @__PURE__ */ w("div", {
279
- style: { display: "contents" },
280
- role: "button",
281
- tabIndex: 0,
282
- "aria-label": a || void 0,
283
- onClick: i,
284
- onKeyDown: (e) => {
285
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), i());
286
- },
287
- children: e
288
- });
289
- }
290
- let o = ue(t), l = t?.action?.options?.openInNewTab ? "_blank" : void 0;
291
- return o ? /* @__PURE__ */ w(q, {
292
- href: o,
293
- style: { display: "contents" },
294
- ...l && {
295
- target: l,
296
- rel: "noopener noreferrer"
297
- },
298
- ...a && { "aria-label": a },
299
- children: e
300
- }) : e;
301
- }, Y = {
302
- once: !0,
303
- margin: "0px 0px -150px 0px"
304
- }, de = ({ children: e, MotionComponent: t, motionProps: n, scroll: r, entry: i, whileHover: a, exit: o }) => {
305
- let s = x(null);
306
- if (y(() => {
307
- if (!r) return;
308
- let e = s.current;
309
- if (!e || !(e instanceof Element)) return;
310
- let { from: t, to: n, offset: i } = r, a = {}, o = Array.from(new Set([...Object.keys(t), ...Object.keys(n)]));
311
- for (let e of o) {
312
- let r = t[e] ?? n[e], i = n[e] ?? t[e];
313
- r !== i && typeof r == "number" && typeof i == "number" && (a[e] = [r, i]);
314
- }
315
- if (Object.keys(a).length === 0) return;
316
- let c = te(e, a, { ease: "linear" });
317
- try {
318
- return ne(c, {
319
- target: e,
320
- offset: [i.start, i.end]
321
- });
322
- } catch (e) {
323
- console.error("[AnimatedBlock] Failed to initialise scroll-linked animation", {
324
- error: e,
325
- offset: i
326
- });
327
- return;
328
- }
329
- }, [r]), r) {
330
- let i = {};
331
- for (let [e, t] of Object.entries(r.from)) t !== void 0 && (i[e] = t);
332
- return /* @__PURE__ */ w(t, {
333
- ref: s,
334
- ...n,
335
- style: {
336
- ...n.style || {},
337
- ...i
338
- },
339
- whileHover: a,
340
- exit: o,
341
- children: e
342
- });
343
- }
344
- let c = i ? {
345
- ...I,
346
- ...i.to,
347
- transition: i.transition
348
- } : void 0, l = i ? {
349
- once: i.viewport?.once ?? Y.once,
350
- amount: i.viewport?.amount,
351
- margin: i.viewport?.margin ?? Y.margin
352
- } : void 0;
353
- return /* @__PURE__ */ w(t, {
354
- ...n,
355
- initial: i?.from,
356
- whileInView: c,
357
- viewport: l,
358
- whileHover: a,
359
- exit: o,
360
- children: e
361
- });
362
- }, X = (e) => {
363
- let t = ie.create(e), n = ({ elementKey: n, children: r, ...i }) => {
364
- let { parsedBlockData: a, renderMode: o } = P(), { config: s, styles: c, content: l, id: u } = a || {}, d = s ? B(s, n) : void 0, f = c ? B(c, n) : void 0, p = l ? B(l, n) : void 0, m = b(() => {
365
- let e = d || {}, t = i.config || {}, n = e.selectedVariants || {}, r = t.selectedVariants || {};
366
- return {
367
- ...e,
368
- ...t,
369
- selectedVariants: {
370
- ...n,
371
- ...r
372
- }
373
- };
374
- }, [d, i.config]), h = K(i, n, m, f, p, G(n, u || "", m)), g = h.config?.animation, _ = b(() => g?.scroll ? {
375
- from: {
376
- ...L,
377
- ...g.scroll.from
378
- },
379
- to: {
380
- ...I,
381
- ...g.scroll.to
382
- },
383
- offset: g.scroll.offset ?? {
384
- start: "start end",
385
- end: "end center"
386
- }
387
- } : void 0, [g?.scroll]), v = b(() => g?.entry ? {
388
- from: {
389
- ...L,
390
- ...g.entry.from
391
- },
392
- to: {
393
- ...I,
394
- ...g.entry.to
395
- },
396
- transition: g.entry.transition,
397
- viewport: g.entry.viewport
398
- } : void 0, [g?.entry]);
399
- return !a || h.config?.enabled === !1 ? null : g && Object.keys(g).length > 0 && o !== "studio.block" ? /* @__PURE__ */ w(J, {
400
- config: h?.config || {},
401
- children: /* @__PURE__ */ w(de, {
402
- MotionComponent: t,
403
- motionProps: h,
404
- scroll: _,
405
- entry: v,
406
- whileHover: g.whileHover,
407
- exit: g.exit,
408
- children: r
409
- })
410
- }) : /* @__PURE__ */ w(J, {
411
- config: h?.config || {},
412
- children: /* @__PURE__ */ w(e, {
413
- ...h,
414
- children: r
415
- })
416
- });
417
- };
418
- return n.displayName = `withBlockProps(${e.displayName || e.name || "Component"})`, v(n);
419
- }, Z = g(({ className: e, config: t, content: n, elementKey: r, generatedClassName: i, styles: a, noElementKey: o, ...s }, c) => {
420
- if (!n) return /* @__PURE__ */ w("span", {
421
- ref: c,
422
- style: { display: "none" }
423
- });
424
- let { kind: u, data: d } = n, f = t?.icon?.alt, p = l(e, i), m = {
425
- "data-levo_element_key": o ? void 0 : r,
426
- "data-levo_element_type": "Icon",
427
- className: p,
428
- ...s
429
- }, h = f ? {
430
- "aria-label": f,
431
- role: "img"
432
- } : {};
433
- switch (u) {
434
- case "emoji": return /* @__PURE__ */ w("p", {
435
- style: {
436
- width: "auto",
437
- height: "auto",
438
- ...m.style
439
- },
440
- ref: c,
441
- ...m,
442
- ...h,
443
- children: d?.unicode
444
- });
445
- case "icon": {
446
- let e = d;
447
- return e?.svgCode ? /* @__PURE__ */ w("div", {
448
- ref: c,
449
- ...m,
450
- ...h,
451
- style: {
452
- display: a?.display ? void 0 : "inline-block",
453
- ...m.style
454
- },
455
- dangerouslySetInnerHTML: { __html: e.svgCode }
456
- }) : /* @__PURE__ */ w("span", {
457
- ref: c,
458
- ...m
459
- });
460
- }
461
- case "custom": return /* @__PURE__ */ w("img", {
462
- ref: c,
463
- src: d?.location,
464
- srcSet: d?.srcset?.path,
465
- decoding: "async",
466
- alt: f ?? "icon",
467
- ...m
468
- });
469
- default: return /* @__PURE__ */ w("span", {
470
- ref: c,
471
- ...m
472
- });
473
- }
474
- });
475
- Z.displayName = "BaseIcon";
476
- var Q = X(Z), $ = p.forwardRef(({ className: e, isLoading: t, loadingText: n, children: r, config: i = {}, styles: a, content: o, elementKey: s, generatedClassName: c, ...u }, d) => {
477
- let f = r ?? o, p = i, m = typeof f == "string" ? D(oe.sanitize(f)) : f, h = (e, t) => e?.enabled ? /* @__PURE__ */ w(Q, {
478
- noElementKey: !0,
479
- elementKey: `${s}_${t}Icon`
480
- }) : null;
481
- return f ? /* @__PURE__ */ w("button", {
482
- "data-levo_element_key": s,
483
- "data-levo_element_type": "Button",
484
- type: "button",
485
- className: l("inline-flex items-center justify-center", e, c),
486
- ref: d,
487
- ...u,
488
- children: t ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(re, { className: l("h-4 w-4 animate-spin", n ? "mr-2" : "") }), n] }) : /* @__PURE__ */ T(C, { children: [
489
- h(p?.button_icons?.left, "left"),
490
- /* @__PURE__ */ w("span", {
491
- className: "button-content",
492
- children: m
493
- }),
494
- h(p?.button_icons?.right, "right")
495
- ] })
496
- }) : /* @__PURE__ */ w("span", {
497
- ref: d,
498
- style: { display: "none" }
499
- });
500
- });
501
- $.displayName = "BaseButton";
502
- var fe = X($);
503
- //#endregion
504
- export { P as _, W as a, A as b, U as c, G as d, L as f, le as g, I as h, X as i, H as l, z as m, fe as n, B as o, R as p, Q as r, V as s, $ as t, K as u, F as v, M as y };