@builder.io/sdk-react-nextjs 0.14.28 → 0.14.30-0

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 (118) hide show
  1. package/lib/browser/blocks-exports.cjs +188 -0
  2. package/lib/browser/blocks-exports.mjs +2812 -0
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +25 -26
  5. package/lib/browser/init.cjs +8 -0
  6. package/lib/browser/init.mjs +60 -0
  7. package/lib/browser/server-entry-5cac64f5.js +720 -0
  8. package/lib/browser/server-entry-c9d4cfc0.cjs +2 -0
  9. package/lib/browser/server-entry.cjs +1 -0
  10. package/lib/browser/server-entry.mjs +16 -0
  11. package/lib/edge/blocks-exports.cjs +208 -0
  12. package/lib/edge/{bundle-c67d25d8.js → blocks-exports.mjs} +2388 -2405
  13. package/lib/edge/index.cjs +1 -1
  14. package/lib/edge/index.mjs +25 -26
  15. package/lib/edge/init.cjs +8 -0
  16. package/lib/edge/init.mjs +60 -0
  17. package/lib/edge/server-entry-5cac64f5.js +720 -0
  18. package/lib/edge/server-entry-c9d4cfc0.cjs +2 -0
  19. package/lib/edge/server-entry.cjs +1 -0
  20. package/lib/edge/server-entry.mjs +16 -0
  21. package/lib/node/blocks-exports.cjs +188 -0
  22. package/lib/node/blocks-exports.mjs +2788 -0
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +23 -23
  25. package/lib/node/init.cjs +1 -0
  26. package/lib/node/init.mjs +13 -0
  27. package/lib/node/node-runtime-591c4640.cjs +48 -0
  28. package/lib/node/node-runtime-8d503570.js +167 -0
  29. package/lib/node/server-entry-00baa89f.js +720 -0
  30. package/lib/node/server-entry-1c6e06e6.cjs +2 -0
  31. package/lib/node/server-entry.cjs +1 -0
  32. package/lib/node/server-entry.mjs +16 -0
  33. package/package.json +14 -9
  34. package/types/cjs/blocks/BaseText.d.ts +6 -0
  35. package/types/cjs/blocks/form/component-info.d.ts +2 -0
  36. package/types/cjs/blocks/form/form.d.ts +33 -0
  37. package/types/cjs/blocks/input/component-info.d.ts +2 -0
  38. package/types/cjs/blocks/input/input.d.ts +15 -0
  39. package/types/cjs/blocks/raw-text/component-info.d.ts +2 -0
  40. package/types/cjs/blocks/raw-text/index.d.ts +1 -0
  41. package/types/cjs/blocks/raw-text/raw-text.d.ts +7 -0
  42. package/types/cjs/blocks/submit-button/component-info.d.ts +2 -0
  43. package/types/cjs/blocks/submit-button/submit-button.d.ts +10 -0
  44. package/types/cjs/blocks/textarea/component-info.d.ts +2 -0
  45. package/types/cjs/blocks/textarea/index.d.ts +1 -0
  46. package/types/cjs/blocks/textarea/textarea.d.ts +13 -0
  47. package/types/cjs/components/content/index.d.ts +1 -0
  48. package/types/cjs/components/error-boundary.d.ts +11 -0
  49. package/types/cjs/constants/sdk-name.d.ts +1 -0
  50. package/types/cjs/constants/sdk-version.d.ts +1 -1
  51. package/types/cjs/functions/apply-patch-with-mutation.d.ts +10 -0
  52. package/types/cjs/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +2 -0
  53. package/types/cjs/functions/evaluate/edge-runtime/edge-runtime.d.ts +2 -0
  54. package/types/cjs/functions/evaluate/edge-runtime/index.d.ts +1 -0
  55. package/types/cjs/functions/evaluate/node-runtime/index.d.ts +1 -0
  56. package/types/cjs/functions/evaluate/node-runtime/init.d.ts +13 -0
  57. package/types/cjs/functions/evaluate/node-runtime/node-runtime.d.ts +11 -0
  58. package/types/cjs/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +8 -0
  59. package/types/cjs/functions/evaluate/placeholder-runtime.d.ts +2 -0
  60. package/types/cjs/functions/extract-css-var-default-value.d.ts +1 -0
  61. package/types/cjs/functions/get-react-native-block-styles.d.ts +15 -0
  62. package/types/cjs/functions/is-edge-runtime.d.ts +4 -0
  63. package/types/cjs/functions/on-change.d.ts +7 -0
  64. package/types/cjs/functions/sanitize-react-native-block-styles.d.ts +3 -0
  65. package/types/cjs/functions/sanitize-rn-allowed-css.d.ts +8 -0
  66. package/types/cjs/helpers/omit.d.ts +1 -0
  67. package/types/cjs/helpers/time.d.ts +1 -0
  68. package/types/esm/blocks/BaseText.d.ts +6 -0
  69. package/types/esm/blocks/form/component-info.d.ts +2 -0
  70. package/types/esm/blocks/form/form.d.ts +33 -0
  71. package/types/esm/blocks/input/component-info.d.ts +2 -0
  72. package/types/esm/blocks/input/input.d.ts +15 -0
  73. package/types/esm/blocks/raw-text/component-info.d.ts +2 -0
  74. package/types/esm/blocks/raw-text/index.d.ts +1 -0
  75. package/types/esm/blocks/raw-text/raw-text.d.ts +7 -0
  76. package/types/esm/blocks/submit-button/component-info.d.ts +2 -0
  77. package/types/esm/blocks/submit-button/submit-button.d.ts +10 -0
  78. package/types/esm/blocks/textarea/component-info.d.ts +2 -0
  79. package/types/esm/blocks/textarea/index.d.ts +1 -0
  80. package/types/esm/blocks/textarea/textarea.d.ts +13 -0
  81. package/types/esm/components/content/index.d.ts +1 -0
  82. package/types/esm/components/error-boundary.d.ts +11 -0
  83. package/types/esm/constants/sdk-name.d.ts +1 -0
  84. package/types/esm/constants/sdk-version.d.ts +1 -1
  85. package/types/esm/functions/apply-patch-with-mutation.d.ts +10 -0
  86. package/types/esm/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +2 -0
  87. package/types/esm/functions/evaluate/edge-runtime/edge-runtime.d.ts +2 -0
  88. package/types/esm/functions/evaluate/edge-runtime/index.d.ts +1 -0
  89. package/types/esm/functions/evaluate/node-runtime/index.d.ts +1 -0
  90. package/types/esm/functions/evaluate/node-runtime/init.d.ts +13 -0
  91. package/types/esm/functions/evaluate/node-runtime/node-runtime.d.ts +11 -0
  92. package/types/esm/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +8 -0
  93. package/types/esm/functions/evaluate/placeholder-runtime.d.ts +2 -0
  94. package/types/esm/functions/extract-css-var-default-value.d.ts +1 -0
  95. package/types/esm/functions/get-react-native-block-styles.d.ts +15 -0
  96. package/types/esm/functions/is-edge-runtime.d.ts +4 -0
  97. package/types/esm/functions/on-change.d.ts +7 -0
  98. package/types/esm/functions/sanitize-react-native-block-styles.d.ts +3 -0
  99. package/types/esm/functions/sanitize-rn-allowed-css.d.ts +8 -0
  100. package/types/esm/helpers/omit.d.ts +1 -0
  101. package/types/esm/helpers/time.d.ts +1 -0
  102. package/lib/browser/USE_CLIENT_BUNDLE-1c35fc0a.js +0 -703
  103. package/lib/browser/USE_CLIENT_BUNDLE-65950ed4.cjs +0 -21
  104. package/lib/browser/USE_SERVER_BUNDLE-3ea7f606.cjs +0 -1
  105. package/lib/browser/USE_SERVER_BUNDLE-812dfc95.js +0 -11
  106. package/lib/browser/bundle-763c7cf6.js +0 -2829
  107. package/lib/browser/bundle-aff841a2.cjs +0 -169
  108. package/lib/edge/USE_CLIENT_BUNDLE-cf0350f7.js +0 -703
  109. package/lib/edge/USE_CLIENT_BUNDLE-fc025b97.cjs +0 -21
  110. package/lib/edge/USE_SERVER_BUNDLE-8e198f44.cjs +0 -1
  111. package/lib/edge/USE_SERVER_BUNDLE-ded4dbdc.js +0 -11
  112. package/lib/edge/bundle-05000fd3.cjs +0 -189
  113. package/lib/node/USE_CLIENT_BUNDLE-0fda6fd8.js +0 -703
  114. package/lib/node/USE_CLIENT_BUNDLE-c57c9376.cjs +0 -21
  115. package/lib/node/USE_SERVER_BUNDLE-15a235fc.js +0 -11
  116. package/lib/node/USE_SERVER_BUNDLE-5472e997.cjs +0 -1
  117. package/lib/node/bundle-40b09581.js +0 -2950
  118. package/lib/node/bundle-acffe20a.cjs +0 -216
@@ -0,0 +1,2812 @@
1
+ "use client";
2
+ var Ne = Object.defineProperty;
3
+ var Ve = (e, t, n) => t in e ? Ne(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
+ var ee = (e, t, n) => (Ve(e, typeof t != "symbol" ? t + "" : t, n), n);
5
+ import { jsx as c, Fragment as C, jsxs as E } from "react/jsx-runtime";
6
+ import { TARGET as B, isEditing as $, isBrowser as O, getUserAttributes as $e, checkIsDefined as z, logger as J, fastClone as ie, init as Fe, getDefaultCanTrack as q, _track as ue, isPreviewing as Le, createEditorListener as Oe, fetch as je, registerInsertMenu as De, setupBrowserForEditing as Ue, createRegisterComponentMessage as He, fetchOneEntry as ke, serializeComponentInfo as me, handleABTestingSync as Me } from "./server-entry-5cac64f5.js";
7
+ import { useRef as oe, useState as N, useEffect as T, createContext as _e } from "react";
8
+ import { useRouter as Ke } from "next/navigation";
9
+ import "lru-cache";
10
+ const ze = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), qe = (e) => typeof e == "string" && ze.has(e.toLowerCase());
11
+ function ae(e) {
12
+ return /* @__PURE__ */ c(C, { children: qe(e.TagName) ? /* @__PURE__ */ c(C, { children: /* @__PURE__ */ c(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ c(C, { children: typeof e.TagName == "string" ? /* @__PURE__ */ c(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ c(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
13
+ }
14
+ const U = () => {
15
+ switch (B) {
16
+ case "react":
17
+ case "reactNative":
18
+ case "rsc":
19
+ return "className";
20
+ case "svelte":
21
+ case "vue":
22
+ case "solid":
23
+ case "qwik":
24
+ case "angular":
25
+ return "class";
26
+ }
27
+ };
28
+ function Ye(e) {
29
+ function t() {
30
+ return {
31
+ ...e.attributes,
32
+ [U()]: `${e.link ? "" : "builder-button"} ${e.attributes[U()] || ""}`,
33
+ ...e.link ? {
34
+ href: e.link,
35
+ target: e.openLinkInNewTab ? "_blank" : void 0,
36
+ role: "link"
37
+ } : {
38
+ role: "button"
39
+ }
40
+ };
41
+ }
42
+ return /* @__PURE__ */ c(
43
+ ae,
44
+ {
45
+ attributes: t(),
46
+ TagName: e.link ? e.builderLinkComponent || "a" : "button",
47
+ actionAttributes: {},
48
+ children: e.text
49
+ }
50
+ );
51
+ }
52
+ function Je(e) {
53
+ var t;
54
+ return {
55
+ ...(t = e.component) == null ? void 0 : t.options,
56
+ ...e.options
57
+ };
58
+ }
59
+ const Qe = ({
60
+ builder: e,
61
+ context: t,
62
+ event: n,
63
+ state: i
64
+ }) => Object.entries({
65
+ state: i,
66
+ Builder: e,
67
+ // legacy
68
+ builder: e,
69
+ context: t,
70
+ event: n
71
+ }), Ge = () => ({
72
+ isEditing: $(),
73
+ isBrowser: O(),
74
+ isServer: !O(),
75
+ getUserAttributes: () => $e()
76
+ }), Xe = (e, {
77
+ isExpression: t = !0
78
+ }) => /* we disable this for cases where we definitely don't want a return */ t && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e, fe = ({
79
+ code: e,
80
+ builder: t,
81
+ context: n,
82
+ event: i,
83
+ localState: o,
84
+ rootSetState: a,
85
+ rootState: r
86
+ }) => {
87
+ const l = Qe({
88
+ builder: t,
89
+ context: n,
90
+ event: i,
91
+ state: Ce({
92
+ rootState: r,
93
+ localState: o,
94
+ rootSetState: a
95
+ })
96
+ });
97
+ return new Function(...l.map(([s]) => s), e)(...l.map(([, s]) => s));
98
+ };
99
+ function Ce({
100
+ rootState: e,
101
+ localState: t,
102
+ rootSetState: n
103
+ }) {
104
+ return new Proxy(e, {
105
+ get: (i, o) => {
106
+ if (t && o in t)
107
+ return t[o];
108
+ const a = i[o];
109
+ return typeof a == "object" && a !== null ? Ce({
110
+ rootState: a,
111
+ localState: void 0,
112
+ rootSetState: n ? (r) => {
113
+ i[o] = r, n(i);
114
+ } : void 0
115
+ }) : a;
116
+ },
117
+ set: (i, o, a) => {
118
+ if (t && o in t)
119
+ throw new Error("Writing to local state is not allowed as it is read-only.");
120
+ return i[o] = a, n == null || n(i), !0;
121
+ }
122
+ });
123
+ }
124
+ function Ze() {
125
+ var e;
126
+ return typeof process != "undefined" && z((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
127
+ }
128
+ const et = () => {
129
+ var i;
130
+ if (!Ze())
131
+ return !1;
132
+ const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (i = process.env.NODE_OPTIONS) == null ? void 0 : i.includes("--no-node-snapshot");
133
+ return e && t && !n ? (J.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "), !0) : !1;
134
+ }, tt = (e) => (O() || et(), fe(e)), W = class W {
135
+ static getCacheKey(t) {
136
+ return JSON.stringify({
137
+ ...t,
138
+ // replace the event with a random number to break cache
139
+ // thats because we can't serialize the event object due to circular refs in DOM node refs.
140
+ event: t.event ? Math.random() : void 0
141
+ });
142
+ }
143
+ static getCachedValue(t) {
144
+ return W.cache.get(t);
145
+ }
146
+ static setCachedValue(t, n) {
147
+ W.cache.size > 20 && W.cache.delete(W.cache.keys().next().value), W.cache.set(t, {
148
+ value: n
149
+ });
150
+ }
151
+ };
152
+ ee(W, "cacheLimit", 20), ee(W, "cache", /* @__PURE__ */ new Map());
153
+ let L = W;
154
+ function H({
155
+ code: e,
156
+ context: t,
157
+ localState: n,
158
+ rootState: i,
159
+ rootSetState: o,
160
+ event: a,
161
+ isExpression: r = !0,
162
+ enableCache: l
163
+ }) {
164
+ if (e === "")
165
+ return;
166
+ const s = {
167
+ code: Xe(e, {
168
+ isExpression: r
169
+ }),
170
+ builder: Ge(),
171
+ context: t,
172
+ event: a,
173
+ rootSetState: o,
174
+ rootState: i,
175
+ localState: n
176
+ };
177
+ if (l) {
178
+ const d = L.getCacheKey(s), m = L.getCachedValue(d);
179
+ if (m)
180
+ return m.value;
181
+ }
182
+ try {
183
+ const d = tt(s);
184
+ if (l) {
185
+ const m = L.getCacheKey(s);
186
+ L.setCachedValue(m, d);
187
+ }
188
+ return d;
189
+ } catch (d) {
190
+ J.error("Failed code evaluation: " + d.message, {
191
+ code: e
192
+ });
193
+ return;
194
+ }
195
+ }
196
+ const nt = (e, t, n) => {
197
+ if (Object(e) !== e)
198
+ return e;
199
+ const i = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
200
+ return i.slice(0, -1).reduce((o, a, r) => Object(o[a]) === o[a] ? o[a] : o[a] = Math.abs(Number(i[r + 1])) >> 0 === +i[r + 1] ? [] : {}, e)[i[i.length - 1]] = n, e;
201
+ };
202
+ const it = ({
203
+ block: e,
204
+ context: t,
205
+ localState: n,
206
+ rootState: i,
207
+ rootSetState: o
208
+ }) => {
209
+ if (!e.bindings)
210
+ return e;
211
+ const a = ie(e), r = {
212
+ ...a,
213
+ properties: {
214
+ ...a.properties
215
+ },
216
+ actions: {
217
+ ...a.actions
218
+ }
219
+ };
220
+ for (const l in e.bindings) {
221
+ const s = e.bindings[l], d = H({
222
+ code: s,
223
+ localState: n,
224
+ rootState: i,
225
+ rootSetState: o,
226
+ context: t,
227
+ enableCache: !0
228
+ });
229
+ nt(r, l, d);
230
+ }
231
+ return r;
232
+ };
233
+ function Y({
234
+ block: e,
235
+ context: t,
236
+ shouldEvaluateBindings: n,
237
+ localState: i,
238
+ rootState: o,
239
+ rootSetState: a
240
+ }) {
241
+ const r = e;
242
+ return n ? it({
243
+ block: r,
244
+ localState: i,
245
+ rootState: o,
246
+ rootSetState: a,
247
+ context: t
248
+ }) : r;
249
+ }
250
+ const re = (e) => e ? e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "", Ie = (e) => Object.entries(e).map(([n, i]) => {
251
+ if (typeof i == "string")
252
+ return `${re(n)}: ${i};`;
253
+ }).filter(z), ot = (e) => Ie(e).join(`
254
+ `), _ = ({
255
+ mediaQuery: e,
256
+ className: t,
257
+ styles: n
258
+ }) => {
259
+ const i = `.${t} {
260
+ ${ot(n)}
261
+ }`;
262
+ return e ? `${e} {
263
+ ${i}
264
+ }` : i;
265
+ };
266
+ function at({
267
+ style: e
268
+ }) {
269
+ return e;
270
+ }
271
+ const rt = ({
272
+ block: e,
273
+ context: t
274
+ }) => we(at({
275
+ style: e.style || {},
276
+ context: t,
277
+ block: e
278
+ }));
279
+ function we(e) {
280
+ switch (B) {
281
+ case "svelte":
282
+ case "vue":
283
+ case "solid":
284
+ case "angular":
285
+ return Ie(e).join(" ");
286
+ case "qwik":
287
+ case "reactNative":
288
+ case "react":
289
+ case "rsc":
290
+ return e;
291
+ }
292
+ }
293
+ const lt = ({
294
+ block: e,
295
+ context: t,
296
+ registeredComponents: n
297
+ }) => {
298
+ var a;
299
+ const i = (a = Y({
300
+ block: e,
301
+ localState: t.localState,
302
+ rootState: t.rootState,
303
+ rootSetState: t.rootSetState,
304
+ context: t.context,
305
+ shouldEvaluateBindings: !1
306
+ }).component) == null ? void 0 : a.name;
307
+ if (!i)
308
+ return null;
309
+ const o = n[i];
310
+ if (o)
311
+ return o;
312
+ console.warn(`
313
+ Could not find a registered component named "${i}".
314
+ If you registered it, is the file that registered it imported by the file that needs to render it?`);
315
+ }, ct = ({
316
+ block: e,
317
+ context: t
318
+ }) => {
319
+ const {
320
+ repeat: n,
321
+ ...i
322
+ } = e;
323
+ if (!(n != null && n.collection))
324
+ return;
325
+ const o = H({
326
+ code: n.collection,
327
+ localState: t.localState,
328
+ rootState: t.rootState,
329
+ rootSetState: t.rootSetState,
330
+ context: t.context,
331
+ enableCache: !0
332
+ });
333
+ if (!Array.isArray(o))
334
+ return;
335
+ const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
336
+ return o.map((s, d) => ({
337
+ context: {
338
+ ...t,
339
+ localState: {
340
+ ...t.localState,
341
+ $index: d,
342
+ $item: s,
343
+ [r]: s,
344
+ [`$${r}Index`]: d
345
+ }
346
+ },
347
+ block: i
348
+ }));
349
+ }, st = (e, t) => e && (e.isRSC && B === "rsc" || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(e.name)) ? {
350
+ builderLinkComponent: t
351
+ } : {}, dt = (e, t) => e && (e.isRSC && B === "rsc" || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(e.name)) ? {
352
+ builderComponents: t
353
+ } : {}, ut = (e, t) => e && (e.isRSC && B === "rsc" || B === "reactNative" || ["Builder:Accordion", "Columns", "Form:Form", "Builder: Tabs", "Symbol", "Image", "Video"].includes(e.name)) ? {
354
+ builderBlock: t
355
+ } : {}, mt = (e, t) => e && (e.isRSC && B === "rsc" || ["Builder:Accordion", "Columns", "Form:Form", "Builder: Tabs", "Symbol", "Slot"].includes(e.name)) ? {
356
+ builderContext: t
357
+ } : {}, Te = {
358
+ small: {
359
+ min: 320,
360
+ default: 321,
361
+ max: 640
362
+ },
363
+ medium: {
364
+ min: 641,
365
+ default: 642,
366
+ max: 991
367
+ },
368
+ large: {
369
+ min: 990,
370
+ default: 991,
371
+ max: 1200
372
+ }
373
+ }, he = (e, t = Te) => `@media (max-width: ${t[e].max}px)`, Re = ({
374
+ small: e,
375
+ medium: t
376
+ }) => {
377
+ const n = ie(Te);
378
+ if (!e || !t)
379
+ return n;
380
+ const i = Math.floor(e / 2);
381
+ n.small = {
382
+ max: e,
383
+ min: i,
384
+ default: i + 1
385
+ };
386
+ const o = n.small.max + 1;
387
+ n.medium = {
388
+ max: t,
389
+ min: o,
390
+ default: o + 1
391
+ };
392
+ const a = n.medium.max + 1;
393
+ return n.large = {
394
+ max: 2e3,
395
+ // TODO: decide upper limit
396
+ min: a,
397
+ default: a + 1
398
+ }, n;
399
+ };
400
+ function Q(e) {
401
+ return /* @__PURE__ */ c(
402
+ "style",
403
+ {
404
+ dangerouslySetInnerHTML: { __html: e.styles },
405
+ "data-id": e.id
406
+ }
407
+ );
408
+ }
409
+ function ft(e) {
410
+ const t = function() {
411
+ const o = Y({
412
+ block: e.block,
413
+ localState: e.context.localState,
414
+ rootState: e.context.rootState,
415
+ rootSetState: e.context.rootSetState,
416
+ context: e.context.context,
417
+ shouldEvaluateBindings: !0
418
+ });
419
+ return z(o.hide) ? !o.hide : z(o.show) ? o.show : !0;
420
+ }, n = function() {
421
+ var v, b, I;
422
+ const o = Y({
423
+ block: e.block,
424
+ localState: e.context.localState,
425
+ rootState: e.context.rootState,
426
+ rootSetState: e.context.rootSetState,
427
+ context: e.context.context,
428
+ shouldEvaluateBindings: !0
429
+ }), a = o.responsiveStyles, r = e.context.content, l = Re(
430
+ ((v = r == null ? void 0 : r.meta) == null ? void 0 : v.breakpoints) || {}
431
+ ), s = a == null ? void 0 : a.large, d = a == null ? void 0 : a.medium, m = a == null ? void 0 : a.small, u = o.id;
432
+ if (!u)
433
+ return "";
434
+ const h = s ? _({
435
+ className: u,
436
+ styles: s
437
+ }) : "", x = d ? _({
438
+ className: u,
439
+ styles: d,
440
+ mediaQuery: he(
441
+ "medium",
442
+ l
443
+ )
444
+ }) : "", w = m ? _({
445
+ className: u,
446
+ styles: m,
447
+ mediaQuery: he(
448
+ "small",
449
+ l
450
+ )
451
+ }) : "", y = o.animations && o.animations.find((R) => R.trigger === "hover");
452
+ let V = "";
453
+ if (y) {
454
+ const R = ((I = (b = y.steps) == null ? void 0 : b[1]) == null ? void 0 : I.styles) || {};
455
+ V = _({
456
+ className: `${u}:hover`,
457
+ styles: {
458
+ ...R,
459
+ transition: `all ${y.duration}s ${re(
460
+ y.easing
461
+ )}`,
462
+ transitionDelay: y.delay ? `${y.delay}s` : "0s"
463
+ }
464
+ }) || "";
465
+ }
466
+ return [
467
+ h,
468
+ x,
469
+ w,
470
+ V
471
+ ].join(" ");
472
+ };
473
+ return /* @__PURE__ */ c(C, { children: n() && t() ? /* @__PURE__ */ c(C, { children: /* @__PURE__ */ c(Q, { id: "builderio-block", styles: n() }) }) : null });
474
+ }
475
+ function ht(e) {
476
+ return e.charAt(0).toUpperCase() + e.slice(1);
477
+ }
478
+ const gt = (e) => `on${ht(e)}`, bt = (e, t) => (n) => H({
479
+ code: e,
480
+ context: t.context,
481
+ localState: t.localState,
482
+ rootState: t.rootState,
483
+ rootSetState: t.rootSetState,
484
+ event: n,
485
+ isExpression: !1,
486
+ enableCache: !0
487
+ });
488
+ function Ee(e) {
489
+ var i;
490
+ const t = {}, n = (i = e.block.actions) != null ? i : {};
491
+ for (const o in n) {
492
+ if (!n.hasOwnProperty(o))
493
+ continue;
494
+ const a = n[o];
495
+ let r = gt(o);
496
+ if (e.stripPrefix)
497
+ switch (B) {
498
+ case "vue":
499
+ r = r.replace("v-on:", "");
500
+ break;
501
+ case "svelte":
502
+ r = r.replace("on:", "");
503
+ break;
504
+ }
505
+ t[r] = bt(a, e);
506
+ }
507
+ return t;
508
+ }
509
+ function yt({
510
+ properties: e
511
+ }) {
512
+ return e;
513
+ }
514
+ const St = (e) => ({
515
+ href: e.href
516
+ });
517
+ function le({
518
+ block: e,
519
+ context: t
520
+ }) {
521
+ var i;
522
+ const n = {
523
+ ...St(e),
524
+ ...e.properties,
525
+ "builder-id": e.id,
526
+ style: rt({
527
+ block: e,
528
+ context: t
529
+ }),
530
+ [U()]: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
531
+ };
532
+ return yt({
533
+ properties: n,
534
+ context: t,
535
+ block: e
536
+ });
537
+ }
538
+ function pt(e) {
539
+ return /* @__PURE__ */ c(
540
+ ae,
541
+ {
542
+ TagName: e.Wrapper,
543
+ attributes: le({
544
+ block: e.block,
545
+ context: e.context
546
+ }),
547
+ actionAttributes: Ee({
548
+ block: e.block,
549
+ rootState: e.context.rootState,
550
+ rootSetState: e.context.rootSetState,
551
+ localState: e.context.localState,
552
+ context: e.context.context,
553
+ stripPrefix: !0
554
+ }),
555
+ children: e.children
556
+ }
557
+ );
558
+ }
559
+ function vt(e) {
560
+ function t() {
561
+ return e.includeBlockProps ? {
562
+ ...le({
563
+ block: e.block,
564
+ context: e.context
565
+ }),
566
+ ...Ee({
567
+ block: e.block,
568
+ rootState: e.context.rootState,
569
+ rootSetState: e.context.rootSetState,
570
+ localState: e.context.localState,
571
+ context: e.context.context
572
+ })
573
+ } : {};
574
+ }
575
+ return /* @__PURE__ */ c(e.Wrapper, { ...e.wrapperProps, attributes: t(), children: e.children });
576
+ }
577
+ const xt = ({
578
+ componentOptions: e,
579
+ builderBlock: t,
580
+ context: n,
581
+ componentRef: i,
582
+ includeBlockProps: o,
583
+ isInteractive: a,
584
+ contextValue: r
585
+ }) => {
586
+ const l = {
587
+ ...e,
588
+ /**
589
+ * If `noWrap` is set to `true`, then the block's props/attributes are provided to the
590
+ * component itself directly. Otherwise, they are provided to the wrapper element.
591
+ */
592
+ ...o ? {
593
+ attributes: le({
594
+ block: t,
595
+ context: r
596
+ })
597
+ } : {}
598
+ };
599
+ return a ? {
600
+ Wrapper: i,
601
+ block: t,
602
+ context: n,
603
+ wrapperProps: e,
604
+ includeBlockProps: o
605
+ } : l;
606
+ };
607
+ function ge(e) {
608
+ var n;
609
+ const t = e.isInteractive ? vt : e.componentRef;
610
+ return /* @__PURE__ */ c(C, { children: e.componentRef ? /* @__PURE__ */ c(C, { children: /* @__PURE__ */ c(
611
+ t,
612
+ {
613
+ ...xt({
614
+ componentOptions: e.componentOptions,
615
+ builderBlock: e.builderBlock,
616
+ context: e.context,
617
+ componentRef: e.componentRef,
618
+ linkComponent: e.linkComponent,
619
+ includeBlockProps: e.includeBlockProps,
620
+ isInteractive: e.isInteractive,
621
+ contextValue: e.context
622
+ }),
623
+ children: (n = e.blockChildren) == null ? void 0 : n.map((i) => /* @__PURE__ */ c(
624
+ G,
625
+ {
626
+ block: i,
627
+ context: e.context,
628
+ registeredComponents: e.registeredComponents,
629
+ linkComponent: e.linkComponent
630
+ },
631
+ i.id
632
+ ))
633
+ }
634
+ ) }) : null });
635
+ }
636
+ function kt(e) {
637
+ const t = e.repeatContext;
638
+ return /* @__PURE__ */ c(
639
+ G,
640
+ {
641
+ block: e.block,
642
+ context: t,
643
+ registeredComponents: e.registeredComponents,
644
+ linkComponent: e.linkComponent
645
+ }
646
+ );
647
+ }
648
+ function G(e) {
649
+ var s, d, m;
650
+ const t = function() {
651
+ return lt({
652
+ block: e.block,
653
+ context: e.context,
654
+ registeredComponents: e.registeredComponents
655
+ });
656
+ }, n = function() {
657
+ return ct({
658
+ block: e.block,
659
+ context: e.context
660
+ });
661
+ }, i = function() {
662
+ var h;
663
+ return (h = e.block.repeat) != null && h.collection ? e.block : Y({
664
+ block: e.block,
665
+ localState: e.context.localState,
666
+ rootState: e.context.rootState,
667
+ rootSetState: e.context.rootSetState,
668
+ context: e.context.context,
669
+ shouldEvaluateBindings: !0
670
+ });
671
+ }, o = function() {
672
+ var x;
673
+ return e.block.tagName === "a" || ((x = i().properties) == null ? void 0 : x.href) || i().href ? e.linkComponent || "a" : e.block.tagName || "div";
674
+ }, a = function() {
675
+ var w, y;
676
+ if ((w = e.block.repeat) != null && w.collection)
677
+ return !!((y = n()) != null && y.length);
678
+ const h = "hide" in i() ? i().hide : !1;
679
+ return ("show" in i() ? i().show : !0) && !h;
680
+ }, r = function() {
681
+ var x, w;
682
+ return !((x = t()) != null && x.component) && !n() ? (w = i().children) != null ? w : [] : [];
683
+ }, l = function() {
684
+ var h, x, w, y;
685
+ return {
686
+ blockChildren: (h = i().children) != null ? h : [],
687
+ componentRef: (x = t()) == null ? void 0 : x.component,
688
+ componentOptions: {
689
+ ...Je(i()),
690
+ ...ut(t(), i()),
691
+ ...mt(t(), e.context),
692
+ ...st(t(), e.linkComponent),
693
+ ...dt(
694
+ t(),
695
+ e.registeredComponents
696
+ )
697
+ },
698
+ context: e.context,
699
+ linkComponent: e.linkComponent,
700
+ registeredComponents: e.registeredComponents,
701
+ builderBlock: i(),
702
+ includeBlockProps: ((w = t()) == null ? void 0 : w.noWrap) === !0,
703
+ isInteractive: !((y = t()) != null && y.isRSC)
704
+ };
705
+ };
706
+ return /* @__PURE__ */ c(C, { children: a() ? /* @__PURE__ */ E(C, { children: [
707
+ /* @__PURE__ */ c(ft, { block: e.block, context: e.context }),
708
+ (s = t()) != null && s.noWrap ? /* @__PURE__ */ c(C, { children: /* @__PURE__ */ c(
709
+ ge,
710
+ {
711
+ componentRef: l().componentRef,
712
+ componentOptions: l().componentOptions,
713
+ blockChildren: l().blockChildren,
714
+ context: l().context,
715
+ registeredComponents: l().registeredComponents,
716
+ linkComponent: l().linkComponent,
717
+ builderBlock: l().builderBlock,
718
+ includeBlockProps: l().includeBlockProps,
719
+ isInteractive: l().isInteractive
720
+ }
721
+ ) }) : /* @__PURE__ */ c(C, { children: n() ? /* @__PURE__ */ c(C, { children: (m = n()) == null ? void 0 : m.map((u, h) => /* @__PURE__ */ c(
722
+ kt,
723
+ {
724
+ repeatContext: u.context,
725
+ block: u.block,
726
+ registeredComponents: e.registeredComponents,
727
+ linkComponent: e.linkComponent
728
+ },
729
+ h
730
+ )) }) : /* @__PURE__ */ E(
731
+ pt,
732
+ {
733
+ Wrapper: o(),
734
+ block: i(),
735
+ context: e.context,
736
+ children: [
737
+ /* @__PURE__ */ c(
738
+ ge,
739
+ {
740
+ componentRef: l().componentRef,
741
+ componentOptions: l().componentOptions,
742
+ blockChildren: l().blockChildren,
743
+ context: l().context,
744
+ registeredComponents: l().registeredComponents,
745
+ linkComponent: l().linkComponent,
746
+ builderBlock: l().builderBlock,
747
+ includeBlockProps: l().includeBlockProps,
748
+ isInteractive: l().isInteractive
749
+ }
750
+ ),
751
+ (d = r()) == null ? void 0 : d.map((u) => /* @__PURE__ */ c(
752
+ G,
753
+ {
754
+ block: u,
755
+ registeredComponents: e.registeredComponents,
756
+ linkComponent: e.linkComponent,
757
+ context: e.context
758
+ },
759
+ u.id
760
+ ))
761
+ ]
762
+ }
763
+ ) })
764
+ ] }) : null });
765
+ }
766
+ function Ct(e) {
767
+ function t() {
768
+ var o;
769
+ return "builder-blocks" + ((o = e.blocks) != null && o.length ? "" : " no-blocks");
770
+ }
771
+ function n() {
772
+ var o, a;
773
+ $() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
774
+ {
775
+ type: "builder.clickEmptyBlocks",
776
+ data: {
777
+ parentElementId: e.parent,
778
+ dataPath: e.path
779
+ }
780
+ },
781
+ "*"
782
+ ));
783
+ }
784
+ function i() {
785
+ var o, a;
786
+ $() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
787
+ {
788
+ type: "builder.hoverEmptyBlocks",
789
+ data: {
790
+ parentElementId: e.parent,
791
+ dataPath: e.path
792
+ }
793
+ },
794
+ "*"
795
+ ));
796
+ }
797
+ return /* @__PURE__ */ E(C, { children: [
798
+ /* @__PURE__ */ c(
799
+ e.BlocksWrapper,
800
+ {
801
+ className: t() + " props-blocks-wrapper-7cd1560e",
802
+ "builder-path": e.path,
803
+ "builder-parent-id": e.parent,
804
+ style: e.styleProp,
805
+ onClick: (o) => n(),
806
+ onMouseEnter: (o) => i(),
807
+ onKeyPress: (o) => n(),
808
+ ...e.BlocksWrapperProps,
809
+ children: e.children
810
+ }
811
+ ),
812
+ /* @__PURE__ */ c("style", { children: `.props-blocks-wrapper-7cd1560e {
813
+ display: flex;
814
+ flex-direction: column;
815
+ align-items: stretch;
816
+ }` })
817
+ ] });
818
+ }
819
+ function ce(e) {
820
+ var t, n, i;
821
+ return /* @__PURE__ */ c(
822
+ Ct,
823
+ {
824
+ blocks: e.blocks,
825
+ parent: e.parent,
826
+ path: e.path,
827
+ styleProp: e.styleProp,
828
+ BlocksWrapper: (t = e.context) == null ? void 0 : t.BlocksWrapper,
829
+ BlocksWrapperProps: (n = e.context) == null ? void 0 : n.BlocksWrapperProps,
830
+ children: e.blocks ? /* @__PURE__ */ c(C, { children: (i = e.blocks) == null ? void 0 : i.map((o) => /* @__PURE__ */ c(
831
+ G,
832
+ {
833
+ block: o,
834
+ linkComponent: e.linkComponent,
835
+ context: e.context,
836
+ registeredComponents: e.registeredComponents
837
+ },
838
+ o.id
839
+ )) }) : null
840
+ }
841
+ );
842
+ }
843
+ const It = (e) => `builder-columns ${e}-breakpoints`;
844
+ function wt(e) {
845
+ var y, V;
846
+ const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], i = e.stackColumnsAt || "tablet", o = function(b) {
847
+ return b.link ? e.builderLinkComponent || "a" : "div";
848
+ }, a = function(b) {
849
+ var I;
850
+ return ((I = n[b]) == null ? void 0 : I.width) || 100 / n.length;
851
+ }, r = function(b) {
852
+ const I = t * (n.length - 1) / n.length;
853
+ return `calc(${a(b)}% - ${I}px)`;
854
+ }, l = function({
855
+ stackedStyle: b,
856
+ desktopStyle: I
857
+ }) {
858
+ return i === "tablet" ? b : I;
859
+ }, s = function({
860
+ stackedStyle: b,
861
+ desktopStyle: I
862
+ }) {
863
+ return i === "never" ? I : b;
864
+ }, d = e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column", m = function() {
865
+ return {
866
+ "--flex-dir": d,
867
+ "--flex-dir-tablet": l({
868
+ stackedStyle: d,
869
+ desktopStyle: "row"
870
+ })
871
+ };
872
+ }, u = function(b) {
873
+ const I = b === 0 ? 0 : t, R = r(b), A = `${I}px`, j = "100%", D = 0;
874
+ return {
875
+ ...{
876
+ display: "flex",
877
+ flexDirection: "column",
878
+ alignItems: "stretch"
879
+ },
880
+ width: R,
881
+ ["marginLeft"]: A,
882
+ "--column-width-mobile": s({
883
+ stackedStyle: j,
884
+ desktopStyle: R
885
+ }),
886
+ "--column-margin-left-mobile": s({
887
+ stackedStyle: D,
888
+ desktopStyle: A
889
+ }),
890
+ "--column-width-tablet": l({
891
+ stackedStyle: j,
892
+ desktopStyle: R
893
+ }),
894
+ "--column-margin-left-tablet": l({
895
+ stackedStyle: D,
896
+ desktopStyle: A
897
+ })
898
+ };
899
+ }, h = function(b) {
900
+ var R, A;
901
+ return Re(
902
+ ((A = (R = e.builderContext.content) == null ? void 0 : R.meta) == null ? void 0 : A.breakpoints) || {}
903
+ )[b].max;
904
+ }, x = function() {
905
+ return `
906
+ @media (max-width: ${h("medium")}px) {
907
+ .${e.builderBlock.id}-breakpoints {
908
+ flex-direction: var(--flex-dir-tablet);
909
+ align-items: stretch;
910
+ }
911
+
912
+ .${e.builderBlock.id}-breakpoints > .builder-column {
913
+ width: var(--column-width-tablet) !important;
914
+ margin-left: var(--column-margin-left-tablet) !important;
915
+ }
916
+ }
917
+
918
+ @media (max-width: ${h("small")}px) {
919
+ .${e.builderBlock.id}-breakpoints {
920
+ flex-direction: var(--flex-dir);
921
+ align-items: stretch;
922
+ }
923
+
924
+ .${e.builderBlock.id}-breakpoints > .builder-column {
925
+ width: var(--column-width-mobile) !important;
926
+ margin-left: var(--column-margin-left-mobile) !important;
927
+ }
928
+ },
929
+ `;
930
+ }, w = function(b, I) {
931
+ return {
932
+ ...b.link ? {
933
+ href: b.link
934
+ } : {},
935
+ [U()]: "builder-column",
936
+ style: we(u(I))
937
+ };
938
+ };
939
+ return /* @__PURE__ */ E(C, { children: [
940
+ /* @__PURE__ */ E(
941
+ "div",
942
+ {
943
+ className: It((y = e.builderBlock) == null ? void 0 : y.id) + " div-eeca3604",
944
+ style: m(),
945
+ children: [
946
+ /* @__PURE__ */ c(Q, { id: "builderio-columns", styles: x() }),
947
+ (V = e.columns) == null ? void 0 : V.map((v, b) => /* @__PURE__ */ c(
948
+ ae,
949
+ {
950
+ TagName: o(v),
951
+ actionAttributes: {},
952
+ attributes: w(v, b),
953
+ children: /* @__PURE__ */ c(
954
+ ce,
955
+ {
956
+ path: `component.options.columns.${b}.blocks`,
957
+ parent: e.builderBlock.id,
958
+ styleProp: {
959
+ flexGrow: "1"
960
+ },
961
+ context: e.builderContext,
962
+ registeredComponents: e.builderComponents,
963
+ linkComponent: e.builderLinkComponent,
964
+ blocks: v.blocks
965
+ }
966
+ )
967
+ },
968
+ b
969
+ ))
970
+ ]
971
+ }
972
+ ),
973
+ /* @__PURE__ */ c("style", { children: `.div-eeca3604 {
974
+ display: flex;
975
+ line-height: normal;
976
+ }` })
977
+ ] });
978
+ }
979
+ function Tt(e) {
980
+ return /* @__PURE__ */ c("span", { children: e.children });
981
+ }
982
+ function be(e) {
983
+ return e.replace(/http(s)?:/, "");
984
+ }
985
+ function Rt(e = "", t, n) {
986
+ const i = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), o = e.indexOf("?") !== -1 ? "&" : "?";
987
+ return e.match(i) ? e.replace(i, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + o + t + "=" + encodeURIComponent(n);
988
+ }
989
+ function Et(e, t) {
990
+ if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
991
+ return e;
992
+ if (t === "master")
993
+ return be(e);
994
+ const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
995
+ if (n) {
996
+ const i = e.split(n[0]), o = n[3], a = t.match("x") ? t : `${t}x`;
997
+ return be(`${i[0]}_${a}${o}`);
998
+ }
999
+ return null;
1000
+ }
1001
+ function te(e) {
1002
+ if (!e)
1003
+ return e;
1004
+ const t = [100, 200, 400, 800, 1200, 1600, 2e3];
1005
+ if (e.match(/builder\.io/)) {
1006
+ let n = e;
1007
+ const i = Number(e.split("?width=")[1]);
1008
+ return isNaN(i) || (n = `${n} ${i}w`), t.filter((o) => o !== i).map((o) => `${Rt(e, "width", o)} ${o}w`).concat([n]).join(", ");
1009
+ }
1010
+ return e.match(/cdn\.shopify\.com/) ? t.map((n) => [Et(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, i]) => `${n} ${i}w`).concat([e]).join(", ") : e;
1011
+ }
1012
+ function Pt(e) {
1013
+ var o, a, r, l, s, d;
1014
+ function t() {
1015
+ var h;
1016
+ const u = e.image || e.src;
1017
+ if (!u || // We can auto add srcset for cdn.builder.io and shopify
1018
+ // images, otherwise you can supply this prop manually
1019
+ !(u.match(/builder\.io/) || u.match(/cdn\.shopify\.com/)))
1020
+ return e.srcset;
1021
+ if (e.srcset && ((h = e.image) != null && h.includes("builder.io/api/v1/image"))) {
1022
+ if (!e.srcset.includes(e.image.split("?")[0]))
1023
+ return console.debug("Removed given srcset"), te(u);
1024
+ } else if (e.image && !e.srcset)
1025
+ return te(u);
1026
+ return te(u);
1027
+ }
1028
+ function n() {
1029
+ var m;
1030
+ return (m = t == null ? void 0 : t()) != null && m.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
1031
+ }
1032
+ function i() {
1033
+ const m = {
1034
+ position: "absolute",
1035
+ height: "100%",
1036
+ width: "100%",
1037
+ left: "0px",
1038
+ top: "0px"
1039
+ };
1040
+ return e.aspectRatio ? m : void 0;
1041
+ }
1042
+ return /* @__PURE__ */ E(C, { children: [
1043
+ /* @__PURE__ */ E(C, { children: [
1044
+ /* @__PURE__ */ E("picture", { children: [
1045
+ n() ? /* @__PURE__ */ c("source", { type: "image/webp", srcSet: n() }) : null,
1046
+ /* @__PURE__ */ c(
1047
+ "img",
1048
+ {
1049
+ loading: e.highPriority ? "eager" : "lazy",
1050
+ fetchPriority: e.highPriority ? "high" : "auto",
1051
+ alt: e.altText,
1052
+ role: e.altText ? void 0 : "presentation",
1053
+ style: {
1054
+ objectPosition: e.backgroundPosition || "center",
1055
+ objectFit: e.backgroundSize || "cover",
1056
+ ...i()
1057
+ },
1058
+ className: "builder-image" + (e.className ? " " + e.className : "") + " img-ac3dff4a",
1059
+ src: e.image,
1060
+ srcSet: t(),
1061
+ sizes: e.sizes
1062
+ }
1063
+ )
1064
+ ] }),
1065
+ e.aspectRatio && !((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ c(
1066
+ "div",
1067
+ {
1068
+ className: "builder-image-sizer div-ac3dff4a",
1069
+ style: {
1070
+ paddingTop: e.aspectRatio * 100 + "%"
1071
+ }
1072
+ }
1073
+ ) : null,
1074
+ (l = (r = e.builderBlock) == null ? void 0 : r.children) != null && l.length && e.fitContent ? /* @__PURE__ */ c(C, { children: e.children }) : null,
1075
+ !e.fitContent && ((d = (s = e.builderBlock) == null ? void 0 : s.children) != null && d.length) ? /* @__PURE__ */ c("div", { className: "div-ac3dff4a-2", children: e.children }) : null
1076
+ ] }),
1077
+ /* @__PURE__ */ c("style", { children: `.img-ac3dff4a {
1078
+ opacity: 1;
1079
+ transition: opacity 0.2s ease-in-out;
1080
+ }.div-ac3dff4a {
1081
+ width: 100%;
1082
+ pointer-events: none;
1083
+ font-size: 0;
1084
+ }.div-ac3dff4a-2 {
1085
+ display: flex;
1086
+ flex-direction: column;
1087
+ align-items: stretch;
1088
+ position: absolute;
1089
+ top: 0;
1090
+ left: 0;
1091
+ width: 100%;
1092
+ height: 100%;
1093
+ }` })
1094
+ ] });
1095
+ }
1096
+ function Bt(e) {
1097
+ return /* @__PURE__ */ c(
1098
+ "section",
1099
+ {
1100
+ ...e.attributes,
1101
+ style: {
1102
+ width: "100%",
1103
+ alignSelf: "stretch",
1104
+ flexGrow: 1,
1105
+ boxSizing: "border-box",
1106
+ maxWidth: e.maxWidth || 1200,
1107
+ display: "flex",
1108
+ flexDirection: "column",
1109
+ alignItems: "stretch",
1110
+ marginLeft: "auto",
1111
+ marginRight: "auto"
1112
+ },
1113
+ children: e.children
1114
+ }
1115
+ );
1116
+ }
1117
+ const At = {
1118
+ name: "Core:Button",
1119
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
1120
+ defaultStyles: {
1121
+ // TODO: make min width more intuitive and set one
1122
+ appearance: "none",
1123
+ paddingTop: "15px",
1124
+ paddingBottom: "15px",
1125
+ paddingLeft: "25px",
1126
+ paddingRight: "25px",
1127
+ backgroundColor: "#000000",
1128
+ color: "white",
1129
+ borderRadius: "4px",
1130
+ textAlign: "center",
1131
+ cursor: "pointer"
1132
+ },
1133
+ inputs: [{
1134
+ name: "text",
1135
+ type: "text",
1136
+ defaultValue: "Click me!",
1137
+ bubble: !0
1138
+ }, {
1139
+ name: "link",
1140
+ type: "url",
1141
+ bubble: !0
1142
+ }, {
1143
+ name: "openLinkInNewTab",
1144
+ type: "boolean",
1145
+ defaultValue: !1,
1146
+ friendlyName: "Open link in new tab"
1147
+ }],
1148
+ static: !0,
1149
+ noWrap: !0
1150
+ }, Wt = {
1151
+ // TODO: ways to statically preprocess JSON for references, functions, etc
1152
+ name: "Columns",
1153
+ isRSC: !0,
1154
+ inputs: [{
1155
+ name: "columns",
1156
+ type: "array",
1157
+ broadcast: !0,
1158
+ subFields: [{
1159
+ name: "blocks",
1160
+ type: "array",
1161
+ hideFromUI: !0,
1162
+ defaultValue: [{
1163
+ "@type": "@builder.io/sdk:Element",
1164
+ responsiveStyles: {
1165
+ large: {
1166
+ display: "flex",
1167
+ flexDirection: "column",
1168
+ alignItems: "stretch",
1169
+ flexShrink: "0",
1170
+ position: "relative",
1171
+ marginTop: "30px",
1172
+ textAlign: "center",
1173
+ lineHeight: "normal",
1174
+ height: "auto",
1175
+ minHeight: "20px",
1176
+ minWidth: "20px",
1177
+ overflow: "hidden"
1178
+ }
1179
+ },
1180
+ component: {
1181
+ name: "Image",
1182
+ options: {
1183
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1184
+ backgroundPosition: "center",
1185
+ backgroundSize: "cover",
1186
+ aspectRatio: 0.7004048582995948
1187
+ }
1188
+ }
1189
+ }, {
1190
+ "@type": "@builder.io/sdk:Element",
1191
+ responsiveStyles: {
1192
+ large: {
1193
+ display: "flex",
1194
+ flexDirection: "column",
1195
+ alignItems: "stretch",
1196
+ flexShrink: "0",
1197
+ position: "relative",
1198
+ marginTop: "30px",
1199
+ textAlign: "center",
1200
+ lineHeight: "normal",
1201
+ height: "auto"
1202
+ }
1203
+ },
1204
+ component: {
1205
+ name: "Text",
1206
+ options: {
1207
+ text: "<p>Enter some text...</p>"
1208
+ }
1209
+ }
1210
+ }]
1211
+ }, {
1212
+ name: "width",
1213
+ type: "number",
1214
+ hideFromUI: !0,
1215
+ helperText: "Width %, e.g. set to 50 to fill half of the space"
1216
+ }, {
1217
+ name: "link",
1218
+ type: "url",
1219
+ helperText: "Optionally set a url that clicking this column will link to"
1220
+ }],
1221
+ defaultValue: [{
1222
+ blocks: [{
1223
+ "@type": "@builder.io/sdk:Element",
1224
+ responsiveStyles: {
1225
+ large: {
1226
+ display: "flex",
1227
+ flexDirection: "column",
1228
+ alignItems: "stretch",
1229
+ flexShrink: "0",
1230
+ position: "relative",
1231
+ marginTop: "30px",
1232
+ textAlign: "center",
1233
+ lineHeight: "normal",
1234
+ height: "auto",
1235
+ minHeight: "20px",
1236
+ minWidth: "20px",
1237
+ overflow: "hidden"
1238
+ }
1239
+ },
1240
+ component: {
1241
+ name: "Image",
1242
+ options: {
1243
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1244
+ backgroundPosition: "center",
1245
+ backgroundSize: "cover",
1246
+ aspectRatio: 0.7004048582995948
1247
+ }
1248
+ }
1249
+ }, {
1250
+ "@type": "@builder.io/sdk:Element",
1251
+ responsiveStyles: {
1252
+ large: {
1253
+ display: "flex",
1254
+ flexDirection: "column",
1255
+ alignItems: "stretch",
1256
+ flexShrink: "0",
1257
+ position: "relative",
1258
+ marginTop: "30px",
1259
+ textAlign: "center",
1260
+ lineHeight: "normal",
1261
+ height: "auto"
1262
+ }
1263
+ },
1264
+ component: {
1265
+ name: "Text",
1266
+ options: {
1267
+ text: "<p>Enter some text...</p>"
1268
+ }
1269
+ }
1270
+ }]
1271
+ }, {
1272
+ blocks: [{
1273
+ "@type": "@builder.io/sdk:Element",
1274
+ responsiveStyles: {
1275
+ large: {
1276
+ display: "flex",
1277
+ flexDirection: "column",
1278
+ alignItems: "stretch",
1279
+ flexShrink: "0",
1280
+ position: "relative",
1281
+ marginTop: "30px",
1282
+ textAlign: "center",
1283
+ lineHeight: "normal",
1284
+ height: "auto",
1285
+ minHeight: "20px",
1286
+ minWidth: "20px",
1287
+ overflow: "hidden"
1288
+ }
1289
+ },
1290
+ component: {
1291
+ name: "Image",
1292
+ options: {
1293
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1294
+ backgroundPosition: "center",
1295
+ backgroundSize: "cover",
1296
+ aspectRatio: 0.7004048582995948
1297
+ }
1298
+ }
1299
+ }, {
1300
+ "@type": "@builder.io/sdk:Element",
1301
+ responsiveStyles: {
1302
+ large: {
1303
+ display: "flex",
1304
+ flexDirection: "column",
1305
+ alignItems: "stretch",
1306
+ flexShrink: "0",
1307
+ position: "relative",
1308
+ marginTop: "30px",
1309
+ textAlign: "center",
1310
+ lineHeight: "normal",
1311
+ height: "auto"
1312
+ }
1313
+ },
1314
+ component: {
1315
+ name: "Text",
1316
+ options: {
1317
+ text: "<p>Enter some text...</p>"
1318
+ }
1319
+ }
1320
+ }]
1321
+ }],
1322
+ onChange: (e) => {
1323
+ function t() {
1324
+ n.forEach((i) => {
1325
+ i.delete("width");
1326
+ });
1327
+ }
1328
+ const n = e.get("columns");
1329
+ Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((l, s) => l + s.get("width"), 0) !== 100) && t();
1330
+ }
1331
+ }, {
1332
+ name: "space",
1333
+ type: "number",
1334
+ defaultValue: 20,
1335
+ helperText: "Size of gap between columns",
1336
+ advanced: !0
1337
+ }, {
1338
+ name: "stackColumnsAt",
1339
+ type: "string",
1340
+ defaultValue: "tablet",
1341
+ helperText: "Convert horizontal columns to vertical at what device size",
1342
+ enum: ["tablet", "mobile", "never"],
1343
+ advanced: !0
1344
+ }, {
1345
+ name: "reverseColumnsWhenStacked",
1346
+ type: "boolean",
1347
+ defaultValue: !1,
1348
+ helperText: "When stacking columns for mobile devices, reverse the ordering",
1349
+ advanced: !0
1350
+ }]
1351
+ }, Nt = {
1352
+ name: "Fragment",
1353
+ static: !0,
1354
+ hidden: !0,
1355
+ canHaveChildren: !0,
1356
+ noWrap: !0
1357
+ }, Vt = {
1358
+ name: "Image",
1359
+ static: !0,
1360
+ image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
1361
+ defaultStyles: {
1362
+ position: "relative",
1363
+ minHeight: "20px",
1364
+ minWidth: "20px",
1365
+ overflow: "hidden"
1366
+ },
1367
+ canHaveChildren: !0,
1368
+ inputs: [{
1369
+ name: "image",
1370
+ type: "file",
1371
+ bubble: !0,
1372
+ allowedFileTypes: ["jpeg", "jpg", "png", "svg", "webp"],
1373
+ required: !0,
1374
+ defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
1375
+ onChange: (e) => {
1376
+ e.delete("srcset"), e.delete("noWebp");
1377
+ function n(r, l = 6e4) {
1378
+ return new Promise((s, d) => {
1379
+ const m = document.createElement("img");
1380
+ let u = !1;
1381
+ m.onload = () => {
1382
+ u = !0, s(m);
1383
+ }, m.addEventListener("error", (h) => {
1384
+ console.warn("Image load failed", h.error), d(h.error);
1385
+ }), m.src = r, setTimeout(() => {
1386
+ u || d(new Error("Image load timed out"));
1387
+ }, l);
1388
+ });
1389
+ }
1390
+ function i(r) {
1391
+ return Math.round(r * 1e3) / 1e3;
1392
+ }
1393
+ const o = e.get("image"), a = e.get("aspectRatio");
1394
+ if (fetch(o).then((r) => r.blob()).then((r) => {
1395
+ r.type.includes("svg") && e.set("noWebp", !0);
1396
+ }), o && (!a || a === 0.7041))
1397
+ return n(o).then((r) => {
1398
+ const l = e.get("aspectRatio");
1399
+ e.get("image") === o && (!l || l === 0.7041) && r.width && r.height && (e.set("aspectRatio", i(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
1400
+ });
1401
+ }
1402
+ }, {
1403
+ name: "backgroundSize",
1404
+ type: "text",
1405
+ defaultValue: "cover",
1406
+ enum: [{
1407
+ label: "contain",
1408
+ value: "contain",
1409
+ helperText: "The image should never get cropped"
1410
+ }, {
1411
+ label: "cover",
1412
+ value: "cover",
1413
+ helperText: "The image should fill it's box, cropping when needed"
1414
+ }]
1415
+ }, {
1416
+ name: "backgroundPosition",
1417
+ type: "text",
1418
+ defaultValue: "center",
1419
+ enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
1420
+ }, {
1421
+ name: "altText",
1422
+ type: "string",
1423
+ helperText: "Text to display when the user has images off"
1424
+ }, {
1425
+ name: "height",
1426
+ type: "number",
1427
+ hideFromUI: !0
1428
+ }, {
1429
+ name: "width",
1430
+ type: "number",
1431
+ hideFromUI: !0
1432
+ }, {
1433
+ name: "sizes",
1434
+ type: "string",
1435
+ hideFromUI: !0
1436
+ }, {
1437
+ name: "srcset",
1438
+ type: "string",
1439
+ hideFromUI: !0
1440
+ }, {
1441
+ name: "lazy",
1442
+ type: "boolean",
1443
+ defaultValue: !0,
1444
+ hideFromUI: !0
1445
+ }, {
1446
+ name: "fitContent",
1447
+ type: "boolean",
1448
+ helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
1449
+ defaultValue: !0
1450
+ }, {
1451
+ name: "highPriority",
1452
+ type: "boolean",
1453
+ advanced: !0,
1454
+ helperText: "Mark this image as high priority compared to other images on the page. This prevents lazy loading of the image and tells the browser to load this image before others on the page."
1455
+ }, {
1456
+ name: "aspectRatio",
1457
+ type: "number",
1458
+ helperText: "This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",
1459
+ advanced: !0,
1460
+ defaultValue: 0.7041
1461
+ }]
1462
+ }, $t = {
1463
+ name: "Core:Section",
1464
+ static: !0,
1465
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
1466
+ inputs: [{
1467
+ name: "maxWidth",
1468
+ type: "number",
1469
+ defaultValue: 1200
1470
+ }, {
1471
+ name: "lazyLoad",
1472
+ type: "boolean",
1473
+ defaultValue: !1,
1474
+ advanced: !0,
1475
+ description: "Only render this section when in view"
1476
+ }],
1477
+ defaultStyles: {
1478
+ paddingLeft: "20px",
1479
+ paddingRight: "20px",
1480
+ paddingTop: "50px",
1481
+ paddingBottom: "50px",
1482
+ marginTop: "0px",
1483
+ width: "100vw",
1484
+ marginLeft: "calc(50% - 50vw)"
1485
+ },
1486
+ canHaveChildren: !0,
1487
+ defaultChildren: [{
1488
+ "@type": "@builder.io/sdk:Element",
1489
+ responsiveStyles: {
1490
+ large: {
1491
+ textAlign: "center"
1492
+ }
1493
+ },
1494
+ component: {
1495
+ name: "Text",
1496
+ options: {
1497
+ text: "<p><b>I am a section! My content keeps from getting too wide, so that it's easy to read even on big screens.</b></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur</p>"
1498
+ }
1499
+ }
1500
+ }]
1501
+ }, Ft = {
1502
+ name: "Slot",
1503
+ isRSC: !0,
1504
+ description: "Allow child blocks to be inserted into this content when used as a Symbol",
1505
+ docsLink: "https://www.builder.io/c/docs/symbols-with-blocks",
1506
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",
1507
+ // Maybe wrap this for canHaveChildren so bind children to this hm
1508
+ inputs: [{
1509
+ name: "name",
1510
+ type: "string",
1511
+ required: !0,
1512
+ defaultValue: "children"
1513
+ }]
1514
+ };
1515
+ function Lt(e) {
1516
+ var t, n, i;
1517
+ return /* @__PURE__ */ c(
1518
+ "div",
1519
+ {
1520
+ style: {
1521
+ pointerEvents: "auto"
1522
+ },
1523
+ ...!((t = e.builderContext.context) != null && t.symbolId) && {
1524
+ "builder-slot": e.name
1525
+ },
1526
+ children: /* @__PURE__ */ c(
1527
+ ce,
1528
+ {
1529
+ parent: (n = e.builderContext.context) == null ? void 0 : n.symbolId,
1530
+ path: `symbol.data.${e.name}`,
1531
+ context: e.builderContext,
1532
+ blocks: (i = e.builderContext.rootState) == null ? void 0 : i[e.name]
1533
+ }
1534
+ )
1535
+ }
1536
+ );
1537
+ }
1538
+ const Ot = {
1539
+ name: "Symbol",
1540
+ noWrap: !0,
1541
+ static: !0,
1542
+ isRSC: !0,
1543
+ inputs: [{
1544
+ name: "symbol",
1545
+ type: "uiSymbol"
1546
+ }, {
1547
+ name: "dataOnly",
1548
+ helperText: "Make this a data symbol that doesn't display any UI",
1549
+ type: "boolean",
1550
+ defaultValue: !1,
1551
+ advanced: !0,
1552
+ hideFromUI: !0
1553
+ }, {
1554
+ name: "inheritState",
1555
+ helperText: "Inherit the parent component state and data",
1556
+ type: "boolean",
1557
+ defaultValue: !1,
1558
+ advanced: !0
1559
+ }, {
1560
+ name: "renderToLiquid",
1561
+ helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
1562
+ type: "boolean",
1563
+ defaultValue: !1,
1564
+ advanced: !0,
1565
+ hideFromUI: !0
1566
+ }, {
1567
+ name: "useChildren",
1568
+ hideFromUI: !0,
1569
+ type: "boolean"
1570
+ }]
1571
+ }, jt = {
1572
+ name: "Text",
1573
+ static: !0,
1574
+ isRSC: !0,
1575
+ image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929",
1576
+ inputs: [{
1577
+ name: "text",
1578
+ type: "html",
1579
+ required: !0,
1580
+ autoFocus: !0,
1581
+ bubble: !0,
1582
+ defaultValue: "Enter some text..."
1583
+ }],
1584
+ defaultStyles: {
1585
+ lineHeight: "normal",
1586
+ height: "auto",
1587
+ textAlign: "center"
1588
+ }
1589
+ };
1590
+ function Dt(e) {
1591
+ var t;
1592
+ return /* @__PURE__ */ c(
1593
+ "div",
1594
+ {
1595
+ className: "builder-text",
1596
+ dangerouslySetInnerHTML: { __html: ((t = e.text) == null ? void 0 : t.toString()) || "" },
1597
+ style: {
1598
+ outline: "none"
1599
+ }
1600
+ }
1601
+ );
1602
+ }
1603
+ const Ut = {
1604
+ name: "Custom Code",
1605
+ static: !0,
1606
+ requiredPermissions: ["editCode"],
1607
+ inputs: [{
1608
+ name: "code",
1609
+ type: "html",
1610
+ required: !0,
1611
+ defaultValue: "<p>Hello there, I am custom HTML code!</p>",
1612
+ code: !0
1613
+ }, {
1614
+ name: "replaceNodes",
1615
+ type: "boolean",
1616
+ helperText: "Preserve server rendered dom nodes",
1617
+ advanced: !0
1618
+ }, {
1619
+ name: "scriptsClientOnly",
1620
+ type: "boolean",
1621
+ defaultValue: !1,
1622
+ helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
1623
+ advanced: !0
1624
+ }]
1625
+ };
1626
+ function Ht(e) {
1627
+ const t = oe(null), [n, i] = N(() => []), [o, a] = N(() => []);
1628
+ return T(() => {
1629
+ var l;
1630
+ if (!((l = t.current) != null && l.getElementsByTagName) || typeof window == "undefined")
1631
+ return;
1632
+ const r = t.current.getElementsByTagName("script");
1633
+ for (let s = 0; s < r.length; s++) {
1634
+ const d = r[s];
1635
+ if (d.src) {
1636
+ if (n.includes(d.src))
1637
+ continue;
1638
+ n.push(d.src);
1639
+ const m = document.createElement("script");
1640
+ m.async = !0, m.src = d.src, document.head.appendChild(m);
1641
+ } else if (!d.type || [
1642
+ "text/javascript",
1643
+ "application/javascript",
1644
+ "application/ecmascript"
1645
+ ].includes(d.type)) {
1646
+ if (o.includes(d.innerText))
1647
+ continue;
1648
+ try {
1649
+ o.push(d.innerText), new Function(d.innerText)();
1650
+ } catch (m) {
1651
+ console.warn("`CustomCode`: Error running script:", m);
1652
+ }
1653
+ }
1654
+ }
1655
+ }, []), /* @__PURE__ */ c(
1656
+ "div",
1657
+ {
1658
+ ref: t,
1659
+ className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
1660
+ dangerouslySetInnerHTML: { __html: e.code }
1661
+ }
1662
+ );
1663
+ }
1664
+ const Mt = {
1665
+ name: "Embed",
1666
+ static: !0,
1667
+ inputs: [{
1668
+ name: "url",
1669
+ type: "url",
1670
+ required: !0,
1671
+ defaultValue: "",
1672
+ helperText: "e.g. enter a youtube url, google map, etc",
1673
+ onChange: (e) => {
1674
+ const t = e.get("url");
1675
+ if (t) {
1676
+ e.set("content", "Loading...");
1677
+ const n = _iframelyApiKey;
1678
+ return fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=${n}`).then((i) => i.json()).then((i) => {
1679
+ e.get("url") === t && (i.html ? e.set("content", i.html) : e.set("content", "Invalid url, please try another"));
1680
+ }).catch((i) => {
1681
+ e.set("content", "There was an error embedding this URL, please try again or another URL");
1682
+ });
1683
+ } else
1684
+ e.delete("content");
1685
+ }
1686
+ }, {
1687
+ name: "content",
1688
+ type: "html",
1689
+ defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1690
+ hideFromUI: !0
1691
+ }]
1692
+ }, _t = ["text/javascript", "application/javascript", "application/ecmascript"], Kt = (e) => _t.includes(e.type);
1693
+ function zt(e) {
1694
+ const t = oe(null), [n, i] = N(() => []), [o, a] = N(() => []), [r, l] = N(() => !1);
1695
+ function s() {
1696
+ if (!t.current || !t.current.getElementsByTagName)
1697
+ return;
1698
+ const d = t.current.getElementsByTagName("script");
1699
+ for (let m = 0; m < d.length; m++) {
1700
+ const u = d[m];
1701
+ if (u.src && !n.includes(u.src)) {
1702
+ n.push(u.src);
1703
+ const h = document.createElement("script");
1704
+ h.async = !0, h.src = u.src, document.head.appendChild(h);
1705
+ } else if (Kt(u) && !o.includes(u.innerText))
1706
+ try {
1707
+ o.push(u.innerText), new Function(u.innerText)();
1708
+ } catch (h) {
1709
+ console.warn("`Embed`: Error running script:", h);
1710
+ }
1711
+ }
1712
+ }
1713
+ return T(() => {
1714
+ t.current && !r && (l(!0), s());
1715
+ }, [t.current, r]), /* @__PURE__ */ c(
1716
+ "div",
1717
+ {
1718
+ className: "builder-embed",
1719
+ ref: t,
1720
+ dangerouslySetInnerHTML: { __html: e.content }
1721
+ }
1722
+ );
1723
+ }
1724
+ const qt = {
1725
+ // friendlyName?
1726
+ name: "Raw:Img",
1727
+ hideFromInsertMenu: !0,
1728
+ image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
1729
+ inputs: [{
1730
+ name: "image",
1731
+ bubble: !0,
1732
+ type: "file",
1733
+ allowedFileTypes: ["jpeg", "jpg", "png", "svg", "gif", "webp"],
1734
+ required: !0
1735
+ }],
1736
+ noWrap: !0,
1737
+ static: !0
1738
+ };
1739
+ function Yt(e) {
1740
+ return /* @__PURE__ */ c(
1741
+ "img",
1742
+ {
1743
+ style: {
1744
+ objectFit: e.backgroundSize || "cover",
1745
+ objectPosition: e.backgroundPosition || "center"
1746
+ },
1747
+ alt: e.altText,
1748
+ src: e.imgSrc || e.image,
1749
+ ...e.attributes
1750
+ },
1751
+ $() && e.imgSrc || "default-key"
1752
+ );
1753
+ }
1754
+ const Jt = {
1755
+ name: "Video",
1756
+ canHaveChildren: !0,
1757
+ defaultStyles: {
1758
+ minHeight: "20px",
1759
+ minWidth: "20px"
1760
+ },
1761
+ image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-videocam-24px%20(1).svg?alt=media&token=49a84e4a-b20e-4977-a650-047f986874bb",
1762
+ inputs: [{
1763
+ name: "video",
1764
+ type: "file",
1765
+ allowedFileTypes: ["mp4"],
1766
+ bubble: !0,
1767
+ defaultValue: "https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",
1768
+ required: !0
1769
+ }, {
1770
+ name: "posterImage",
1771
+ type: "file",
1772
+ allowedFileTypes: ["jpeg", "png"],
1773
+ helperText: "Image to show before the video plays"
1774
+ }, {
1775
+ name: "autoPlay",
1776
+ type: "boolean",
1777
+ defaultValue: !0
1778
+ }, {
1779
+ name: "controls",
1780
+ type: "boolean",
1781
+ defaultValue: !1
1782
+ }, {
1783
+ name: "muted",
1784
+ type: "boolean",
1785
+ defaultValue: !0
1786
+ }, {
1787
+ name: "loop",
1788
+ type: "boolean",
1789
+ defaultValue: !0
1790
+ }, {
1791
+ name: "playsInline",
1792
+ type: "boolean",
1793
+ defaultValue: !0
1794
+ }, {
1795
+ name: "fit",
1796
+ type: "text",
1797
+ defaultValue: "cover",
1798
+ enum: ["contain", "cover", "fill", "auto"]
1799
+ }, {
1800
+ name: "preload",
1801
+ type: "text",
1802
+ defaultValue: "metadata",
1803
+ enum: ["auto", "metadata", "none"]
1804
+ }, {
1805
+ name: "fitContent",
1806
+ type: "boolean",
1807
+ helperText: "When child blocks are provided, fit to them instead of using the aspect ratio",
1808
+ defaultValue: !0,
1809
+ advanced: !0
1810
+ }, {
1811
+ name: "position",
1812
+ type: "text",
1813
+ defaultValue: "center",
1814
+ enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
1815
+ }, {
1816
+ name: "height",
1817
+ type: "number",
1818
+ advanced: !0
1819
+ }, {
1820
+ name: "width",
1821
+ type: "number",
1822
+ advanced: !0
1823
+ }, {
1824
+ name: "aspectRatio",
1825
+ type: "number",
1826
+ advanced: !0,
1827
+ defaultValue: 0.7004048582995948
1828
+ }, {
1829
+ name: "lazyLoad",
1830
+ type: "boolean",
1831
+ helperText: 'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',
1832
+ defaultValue: !0,
1833
+ advanced: !0
1834
+ }]
1835
+ };
1836
+ function Qt(e) {
1837
+ var i, o, a, r, l, s, d;
1838
+ function t() {
1839
+ return {
1840
+ ...e.autoPlay === !0 ? {
1841
+ autoPlay: !0
1842
+ } : {},
1843
+ ...e.muted === !0 ? {
1844
+ muted: !0
1845
+ } : {},
1846
+ ...e.controls === !0 ? {
1847
+ controls: !0
1848
+ } : {},
1849
+ ...e.loop === !0 ? {
1850
+ loop: !0
1851
+ } : {},
1852
+ ...e.playsInline === !0 ? {
1853
+ playsInline: !0
1854
+ } : {}
1855
+ };
1856
+ }
1857
+ function n() {
1858
+ return {
1859
+ ...t()
1860
+ };
1861
+ }
1862
+ return /* @__PURE__ */ E(
1863
+ "div",
1864
+ {
1865
+ style: {
1866
+ position: "relative"
1867
+ },
1868
+ children: [
1869
+ /* @__PURE__ */ c(
1870
+ "video",
1871
+ {
1872
+ className: "builder-video",
1873
+ ...n(),
1874
+ preload: e.preload || "metadata",
1875
+ style: {
1876
+ width: "100%",
1877
+ height: "100%",
1878
+ ...(i = e.attributes) == null ? void 0 : i.style,
1879
+ objectFit: e.fit,
1880
+ objectPosition: e.position,
1881
+ // Hack to get object fit to work as expected and
1882
+ // not have the video overflow
1883
+ zIndex: 2,
1884
+ borderRadius: "1px",
1885
+ ...e.aspectRatio ? {
1886
+ position: "absolute"
1887
+ } : null
1888
+ },
1889
+ src: e.video || "no-src",
1890
+ poster: e.posterImage,
1891
+ children: e.lazyLoad ? null : /* @__PURE__ */ c("source", { type: "video/mp4", src: e.video })
1892
+ }
1893
+ ),
1894
+ e.aspectRatio && !(e.fitContent && ((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length)) ? /* @__PURE__ */ c(
1895
+ "div",
1896
+ {
1897
+ style: {
1898
+ width: "100%",
1899
+ paddingTop: e.aspectRatio * 100 + "%",
1900
+ pointerEvents: "none",
1901
+ fontSize: "0px"
1902
+ }
1903
+ }
1904
+ ) : null,
1905
+ (l = (r = e.builderBlock) == null ? void 0 : r.children) != null && l.length && e.fitContent ? /* @__PURE__ */ c(
1906
+ "div",
1907
+ {
1908
+ style: {
1909
+ display: "flex",
1910
+ flexDirection: "column",
1911
+ alignItems: "stretch"
1912
+ },
1913
+ children: e.children
1914
+ }
1915
+ ) : null,
1916
+ (d = (s = e.builderBlock) == null ? void 0 : s.children) != null && d.length && !e.fitContent ? /* @__PURE__ */ c(
1917
+ "div",
1918
+ {
1919
+ style: {
1920
+ pointerEvents: "none",
1921
+ display: "flex",
1922
+ flexDirection: "column",
1923
+ alignItems: "stretch",
1924
+ position: "absolute",
1925
+ top: "0",
1926
+ left: "0",
1927
+ width: "100%",
1928
+ height: "100%"
1929
+ },
1930
+ children: e.children
1931
+ }
1932
+ ) : null
1933
+ ]
1934
+ }
1935
+ );
1936
+ }
1937
+ const Gt = () => [{
1938
+ component: Ht,
1939
+ ...Ut
1940
+ }, {
1941
+ component: zt,
1942
+ ...Mt
1943
+ }, {
1944
+ component: Yt,
1945
+ ...qt
1946
+ }, {
1947
+ component: Qt,
1948
+ ...Jt
1949
+ }], ye = () => [{
1950
+ component: Ye,
1951
+ ...At
1952
+ }, {
1953
+ component: wt,
1954
+ ...Wt
1955
+ }, {
1956
+ component: Tt,
1957
+ ...Nt
1958
+ }, {
1959
+ component: Pt,
1960
+ ...Vt
1961
+ }, {
1962
+ component: Bt,
1963
+ ...$t
1964
+ }, {
1965
+ component: Lt,
1966
+ ...Ft
1967
+ }, {
1968
+ component: Rn,
1969
+ ...Ot
1970
+ }, {
1971
+ component: Dt,
1972
+ ...jt
1973
+ }, ...Gt()], Xt = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
1974
+ function getAndSetVariantId() {
1975
+ function setCookie(name, value, days) {
1976
+ let expires = '';
1977
+ if (days) {
1978
+ const date = new Date();
1979
+ date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
1980
+ expires = '; expires=' + date.toUTCString();
1981
+ }
1982
+ document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';
1983
+ }
1984
+ function getCookie(name) {
1985
+ const nameEQ = name + '=';
1986
+ const ca = document.cookie.split(';');
1987
+ for (let i = 0; i < ca.length; i++) {
1988
+ let c = ca[i];
1989
+ while (c.charAt(0) === ' ') c = c.substring(1, c.length);
1990
+ if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
1991
+ }
1992
+ return null;
1993
+ }
1994
+ const cookieName = \`builder.tests.\${contentId}\`;
1995
+ const variantInCookie = getCookie(cookieName);
1996
+ const availableIDs = variants.map(vr => vr.id).concat(contentId);
1997
+ if (variantInCookie && availableIDs.includes(variantInCookie)) {
1998
+ return variantInCookie;
1999
+ }
2000
+ let n = 0;
2001
+ const random = Math.random();
2002
+ for (let i = 0; i < variants.length; i++) {
2003
+ const variant = variants[i];
2004
+ const testRatio = variant.testRatio;
2005
+ n += testRatio;
2006
+ if (random < n) {
2007
+ setCookie(cookieName, variant.id);
2008
+ return variant.id;
2009
+ }
2010
+ }
2011
+ setCookie(cookieName, contentId);
2012
+ return contentId;
2013
+ }
2014
+ const winningVariantId = getAndSetVariantId();
2015
+ const styleEl = document.currentScript?.previousElementSibling;
2016
+ if (isHydrationTarget) {
2017
+ styleEl.remove();
2018
+ const thisScriptEl = document.currentScript;
2019
+ thisScriptEl?.remove();
2020
+ } else {
2021
+ const newStyleStr = variants.concat({
2022
+ id: contentId
2023
+ }).filter(variant => variant.id !== winningVariantId).map(value => {
2024
+ return \`.variant-\${value.id} { display: none; }
2025
+ \`;
2026
+ }).join('');
2027
+ styleEl.innerHTML = newStyleStr;
2028
+ }
2029
+ }`, Zt = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
2030
+ if (!navigator.cookieEnabled) {
2031
+ return;
2032
+ }
2033
+ function getCookie(name) {
2034
+ const nameEQ = name + '=';
2035
+ const ca = document.cookie.split(';');
2036
+ for (let i = 0; i < ca.length; i++) {
2037
+ let c = ca[i];
2038
+ while (c.charAt(0) === ' ') c = c.substring(1, c.length);
2039
+ if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
2040
+ }
2041
+ return null;
2042
+ }
2043
+ const cookieName = \`builder.tests.\${defaultContentId}\`;
2044
+ const winningVariant = getCookie(cookieName);
2045
+ const parentDiv = document.currentScript?.parentElement;
2046
+ const isDefaultContent = variantContentId === defaultContentId;
2047
+ const isWinningVariant = winningVariant === variantContentId;
2048
+ if (isWinningVariant && !isDefaultContent) {
2049
+ parentDiv?.removeAttribute('hidden');
2050
+ parentDiv?.removeAttribute('aria-hidden');
2051
+ } else if (!isWinningVariant && isDefaultContent) {
2052
+ parentDiv?.setAttribute('hidden', 'true');
2053
+ parentDiv?.setAttribute('aria-hidden', 'true');
2054
+ }
2055
+ if (isHydrationTarget) {
2056
+ if (!isWinningVariant) {
2057
+ parentDiv?.remove();
2058
+ }
2059
+ const thisScriptEl = document.currentScript;
2060
+ thisScriptEl?.remove();
2061
+ }
2062
+ return;
2063
+ }`, Pe = "builderIoAbTest", Be = "builderIoRenderContent", K = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
2064
+ ...t,
2065
+ testVariationId: t.id,
2066
+ id: e == null ? void 0 : e.id
2067
+ })), en = ({
2068
+ canTrack: e,
2069
+ content: t
2070
+ }) => !(!(K(t).length > 0) || !e || O()), tn = (e) => e === "react" || e === "reactNative", Ae = tn(B), nn = () => `
2071
+ window.${Pe} = ${Xt}
2072
+ window.${Be} = ${Zt}
2073
+ `, on = (e, t) => `
2074
+ window.${Pe}(
2075
+ "${t}",${JSON.stringify(e)}, ${Ae}
2076
+ )`, an = ({
2077
+ contentId: e,
2078
+ variationId: t
2079
+ }) => `window.${Be}(
2080
+ "${t}", "${e}", ${Ae}
2081
+ )`;
2082
+ function ne(e) {
2083
+ return /* @__PURE__ */ c(
2084
+ "script",
2085
+ {
2086
+ dangerouslySetInnerHTML: { __html: e.scriptStr },
2087
+ "data-id": e.id
2088
+ }
2089
+ );
2090
+ }
2091
+ const rn = _e({
2092
+ content: null,
2093
+ context: {},
2094
+ localState: void 0,
2095
+ rootSetState() {
2096
+ },
2097
+ rootState: {},
2098
+ apiKey: null,
2099
+ apiVersion: void 0,
2100
+ componentInfos: {},
2101
+ inheritedStyles: {},
2102
+ BlocksWrapper: "div",
2103
+ BlocksWrapperProps: {}
2104
+ });
2105
+ function Se(e) {
2106
+ return Math.round(e * 1e3) / 1e3;
2107
+ }
2108
+ const ln = (e, t, n = !0) => {
2109
+ if (!(e instanceof HTMLElement))
2110
+ return null;
2111
+ let i = n ? e : e.parentElement;
2112
+ do {
2113
+ if (!i)
2114
+ return null;
2115
+ if (t(i))
2116
+ return i;
2117
+ } while (i = i.parentElement);
2118
+ return null;
2119
+ }, cn = (e) => ln(e, (t) => {
2120
+ const n = t.getAttribute("builder-id") || t.id;
2121
+ return (n == null ? void 0 : n.indexOf("builder-")) === 0;
2122
+ }), pe = ({
2123
+ event: e,
2124
+ target: t
2125
+ }) => {
2126
+ const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, a = Se(i / n.width), r = Se(o / n.height);
2127
+ return {
2128
+ x: a,
2129
+ y: r
2130
+ };
2131
+ }, sn = (e) => {
2132
+ const t = e.target, n = t && cn(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2133
+ return {
2134
+ targetBuilderElement: i || void 0,
2135
+ metadata: {
2136
+ targetOffset: t ? pe({
2137
+ event: e,
2138
+ target: t
2139
+ }) : void 0,
2140
+ builderTargetOffset: n ? pe({
2141
+ event: e,
2142
+ target: n
2143
+ }) : void 0,
2144
+ builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
2145
+ }
2146
+ };
2147
+ };
2148
+ async function dn({
2149
+ key: e,
2150
+ value: t
2151
+ }) {
2152
+ return Fe(), globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e, t), { [e]: t };
2153
+ }
2154
+ function ve(e, ...t) {
2155
+ const n = Object(e);
2156
+ for (let i = 1; i < arguments.length; i++) {
2157
+ const o = arguments[i];
2158
+ if (o != null)
2159
+ for (const a in o)
2160
+ Object.prototype.hasOwnProperty.call(o, a) && (n[a] = o[a]);
2161
+ }
2162
+ return n;
2163
+ }
2164
+ function un(e) {
2165
+ console.warn(`Cannot animate element: element with ID ${e} not found!`);
2166
+ }
2167
+ function mn(e, t) {
2168
+ const n = fn(e), i = getComputedStyle(t), o = e.steps[0].styles, a = e.steps[e.steps.length - 1].styles, r = [o, a];
2169
+ for (const l of r)
2170
+ for (const s of n)
2171
+ s in l || (l[s] = i[s]);
2172
+ }
2173
+ function fn(e) {
2174
+ const t = [];
2175
+ for (const n of e.steps)
2176
+ for (const i in n.styles)
2177
+ t.indexOf(i) === -1 && t.push(i);
2178
+ return t;
2179
+ }
2180
+ function hn(e) {
2181
+ const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
2182
+ if (!t.length) {
2183
+ un(e.elementId || e.id || "");
2184
+ return;
2185
+ }
2186
+ Array.from(t).forEach((n) => {
2187
+ mn(e, n), n.style.transition = "none", n.style.transitionDelay = "0", ve(n.style, e.steps[0].styles), setTimeout(() => {
2188
+ n.style.transition = `all ${e.duration}s ${re(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), ve(n.style, e.steps[1].styles), setTimeout(() => {
2189
+ n.style.transition = "", n.style.transitionDelay = "";
2190
+ }, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
2191
+ });
2192
+ });
2193
+ }
2194
+ const gn = (e) => {
2195
+ var a, r;
2196
+ const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (r = e.fileUrl) != null ? r : (a = e == null ? void 0 : e.files) == null ? void 0 : a.regular;
2197
+ let o = "";
2198
+ if (i && t && n && (o += `
2199
+ @font-face {
2200
+ font-family: "${t}";
2201
+ src: local("${n}"), url('${i}') format('woff2');
2202
+ font-display: fallback;
2203
+ font-weight: 400;
2204
+ }
2205
+ `.trim()), e.files)
2206
+ for (const l in e.files) {
2207
+ if (!(String(Number(l)) === l))
2208
+ continue;
2209
+ const d = e.files[l];
2210
+ d && d !== i && (o += `
2211
+ @font-face {
2212
+ font-family: "${t}";
2213
+ src: url('${d}') format('woff2');
2214
+ font-display: fallback;
2215
+ font-weight: ${l};
2216
+ }
2217
+ `.trim());
2218
+ }
2219
+ return o;
2220
+ }, bn = ({
2221
+ customFonts: e
2222
+ }) => {
2223
+ var t;
2224
+ return ((t = e == null ? void 0 : e.map((n) => gn(n))) == null ? void 0 : t.join(" ")) || "";
2225
+ }, yn = ({
2226
+ cssCode: e,
2227
+ contentId: t
2228
+ }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", Sn = `
2229
+ .builder-button {
2230
+ all: unset;
2231
+ }
2232
+
2233
+ .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
2234
+ margin: 0;
2235
+ }
2236
+ .builder-text > p, .builder-text > .builder-paragraph {
2237
+ color: inherit;
2238
+ line-height: inherit;
2239
+ letter-spacing: inherit;
2240
+ font-weight: inherit;
2241
+ font-size: inherit;
2242
+ text-align: inherit;
2243
+ font-family: inherit;
2244
+ }
2245
+ `, pn = (e) => e ? "" : Sn, vn = (e) => `variant-${e}`;
2246
+ function xn(e) {
2247
+ var A, j, D, X, Z, se, de;
2248
+ const t = oe(null);
2249
+ function n(g) {
2250
+ var S, p;
2251
+ const f = {
2252
+ ...e.builderContextSignal.rootState,
2253
+ ...g
2254
+ };
2255
+ e.builderContextSignal.rootSetState ? (p = (S = e.builderContextSignal).rootSetState) == null || p.call(S, f) : e.builderContextSignal.rootState = f;
2256
+ }
2257
+ function i(g) {
2258
+ var S, p, k, P, M;
2259
+ const f = {
2260
+ ...e.builderContextSignal.content,
2261
+ ...g,
2262
+ data: {
2263
+ ...(S = e.builderContextSignal.content) == null ? void 0 : S.data,
2264
+ ...g == null ? void 0 : g.data
2265
+ },
2266
+ meta: {
2267
+ ...(p = e.builderContextSignal.content) == null ? void 0 : p.meta,
2268
+ ...g == null ? void 0 : g.meta,
2269
+ breakpoints: ((k = g == null ? void 0 : g.meta) == null ? void 0 : k.breakpoints) || ((M = (P = e.builderContextSignal.content) == null ? void 0 : P.meta) == null ? void 0 : M.breakpoints)
2270
+ }
2271
+ };
2272
+ dn({
2273
+ value: f,
2274
+ key: f.id
2275
+ }).then(() => {
2276
+ R.refresh();
2277
+ });
2278
+ }
2279
+ function o() {
2280
+ return e.showContent ? {} : {
2281
+ hidden: !0,
2282
+ "aria-hidden": !0
2283
+ };
2284
+ }
2285
+ const [a, r] = N(
2286
+ () => e.contentWrapper || "div"
2287
+ );
2288
+ function l(g) {
2289
+ return Oe({
2290
+ model: e.model,
2291
+ trustedHosts: e.trustedHosts,
2292
+ callbacks: {
2293
+ configureSdk: (f) => {
2294
+ var k;
2295
+ const { breakpoints: S, contentId: p } = f;
2296
+ !p || p !== ((k = e.builderContextSignal.content) == null ? void 0 : k.id) || S && i({
2297
+ meta: {
2298
+ breakpoints: S
2299
+ }
2300
+ });
2301
+ },
2302
+ animation: (f) => {
2303
+ hn(f);
2304
+ },
2305
+ contentUpdate: (f) => {
2306
+ i(f);
2307
+ }
2308
+ }
2309
+ })(g);
2310
+ }
2311
+ function s() {
2312
+ var f, S;
2313
+ const g = (S = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : S.jsCode;
2314
+ g && H({
2315
+ code: g,
2316
+ context: e.context || {},
2317
+ localState: void 0,
2318
+ rootState: e.builderContextSignal.rootState,
2319
+ rootSetState: e.builderContextSignal.rootSetState,
2320
+ /**
2321
+ * We don't want to cache the result of the JS code, since it's arbitrary side effect code.
2322
+ */
2323
+ enableCache: !1
2324
+ });
2325
+ }
2326
+ const [d, m] = N(() => ({})), [u, h] = N(() => ({})), [x, w] = N(() => !1);
2327
+ function y(g) {
2328
+ var f, S;
2329
+ if (e.builderContextSignal.content) {
2330
+ const p = (f = e.builderContextSignal.content) == null ? void 0 : f.testVariationId, k = (S = e.builderContextSignal.content) == null ? void 0 : S.id;
2331
+ ue({
2332
+ type: "click",
2333
+ canTrack: q(e.canTrack),
2334
+ contentId: k,
2335
+ apiKey: e.apiKey,
2336
+ variationId: p !== k ? p : void 0,
2337
+ ...sn(g),
2338
+ unique: !x
2339
+ });
2340
+ }
2341
+ x || w(!0);
2342
+ }
2343
+ function V() {
2344
+ var f, S, p;
2345
+ const g = (p = (S = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : S.httpRequests) != null ? p : {};
2346
+ Object.entries(g).forEach(([k, P]) => {
2347
+ if (!P || u[k] || d[k] && !$())
2348
+ return;
2349
+ u[k] = !0;
2350
+ const M = P.replace(
2351
+ /{{([^}]+)}}/g,
2352
+ (F, We) => String(
2353
+ H({
2354
+ code: We,
2355
+ context: e.context || {},
2356
+ localState: void 0,
2357
+ rootState: e.builderContextSignal.rootState,
2358
+ rootSetState: e.builderContextSignal.rootSetState,
2359
+ enableCache: !0
2360
+ })
2361
+ )
2362
+ );
2363
+ je(M).then((F) => F.json()).then((F) => {
2364
+ n({
2365
+ [k]: F
2366
+ }), d[k] = !0;
2367
+ }).catch((F) => {
2368
+ console.error("error fetching dynamic data", P, F);
2369
+ }).finally(() => {
2370
+ u[k] = !1;
2371
+ });
2372
+ });
2373
+ }
2374
+ function v() {
2375
+ $() && window.dispatchEvent(
2376
+ new CustomEvent(
2377
+ "builder:component:stateChange",
2378
+ {
2379
+ detail: {
2380
+ state: ie(e.builderContextSignal.rootState),
2381
+ ref: {
2382
+ name: e.model
2383
+ }
2384
+ }
2385
+ }
2386
+ )
2387
+ );
2388
+ }
2389
+ function b(g) {
2390
+ window.addEventListener("message", l), De(), Ue({
2391
+ ...e.locale ? {
2392
+ locale: e.locale
2393
+ } : {},
2394
+ ...e.enrich ? {
2395
+ enrich: e.enrich
2396
+ } : {},
2397
+ ...e.trustedHosts ? {
2398
+ trustedHosts: e.trustedHosts
2399
+ } : {}
2400
+ }), Object.values(
2401
+ e.builderContextSignal.componentInfos
2402
+ ).forEach((f) => {
2403
+ var p;
2404
+ const S = He(f);
2405
+ (p = window.parent) == null || p.postMessage(S, "*");
2406
+ }), window.addEventListener(
2407
+ "builder:component:stateChangeListenerActivated",
2408
+ v
2409
+ );
2410
+ }
2411
+ function I(g) {
2412
+ const f = new URL(location.href).searchParams, S = f.get("builder.preview"), p = f.get(
2413
+ `builder.overrides.${S}`
2414
+ ), k = f.get("apiKey") || f.get("builder.space");
2415
+ S === e.model && k === e.apiKey && (!e.content || p === e.content.id) && ke({
2416
+ model: e.model,
2417
+ apiKey: e.apiKey,
2418
+ apiVersion: e.builderContextSignal.apiVersion
2419
+ }).then((P) => {
2420
+ P && i(P);
2421
+ });
2422
+ }
2423
+ const R = Ke();
2424
+ return T(() => {
2425
+ var g;
2426
+ return (g = t.current) == null || g.addEventListener(
2427
+ "initeditingbldr",
2428
+ b
2429
+ ), () => {
2430
+ var f;
2431
+ return (f = t.current) == null ? void 0 : f.removeEventListener(
2432
+ "initeditingbldr",
2433
+ b
2434
+ );
2435
+ };
2436
+ }, []), T(() => {
2437
+ var g;
2438
+ return (g = t.current) == null || g.addEventListener(
2439
+ "initpreviewingbldr",
2440
+ I
2441
+ ), () => {
2442
+ var f;
2443
+ return (f = t.current) == null ? void 0 : f.removeEventListener(
2444
+ "initpreviewingbldr",
2445
+ I
2446
+ );
2447
+ };
2448
+ }, []), T(() => {
2449
+ var g, f;
2450
+ if (O()) {
2451
+ if ($() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && q(e.canTrack)) {
2452
+ const p = (g = e.builderContextSignal.content) == null ? void 0 : g.testVariationId, k = (f = e.builderContextSignal.content) == null ? void 0 : f.id, P = e.apiKey;
2453
+ ue({
2454
+ type: "impression",
2455
+ canTrack: !0,
2456
+ contentId: k,
2457
+ apiKey: P,
2458
+ variationId: p !== k ? p : void 0
2459
+ });
2460
+ }
2461
+ Le() && $();
2462
+ }
2463
+ }, []), T(() => {
2464
+ e.apiKey || J.error(
2465
+ "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
2466
+ ), s(), V(), v();
2467
+ }, []), T(() => {
2468
+ }, [e.content]), T(() => {
2469
+ s();
2470
+ }, [(j = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : j.jsCode]), T(() => {
2471
+ V();
2472
+ }, [(X = (D = e.builderContextSignal.content) == null ? void 0 : D.data) == null ? void 0 : X.httpRequests]), T(() => {
2473
+ v();
2474
+ }, [e.builderContextSignal.rootState]), T(() => {
2475
+ e.data && n(e.data);
2476
+ }, [e.data]), T(() => {
2477
+ e.locale && n({
2478
+ locale: e.locale
2479
+ });
2480
+ }, [e.locale]), T(() => () => {
2481
+ O() && (window.removeEventListener("message", l), window.removeEventListener(
2482
+ "builder:component:stateChangeListenerActivated",
2483
+ v
2484
+ ));
2485
+ }, []), /* @__PURE__ */ c(rn.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ c(
2486
+ a,
2487
+ {
2488
+ ref: t,
2489
+ onClick: (g) => y(g),
2490
+ "builder-content-id": (Z = e.builderContextSignal.content) == null ? void 0 : Z.id,
2491
+ "builder-model": e.model,
2492
+ ...o(),
2493
+ ...e.contentWrapperProps,
2494
+ className: vn(
2495
+ ((se = e.content) == null ? void 0 : se.testVariationId) || ((de = e.content) == null ? void 0 : de.id)
2496
+ ),
2497
+ children: e.children
2498
+ }
2499
+ ) : null });
2500
+ }
2501
+ function kn(e) {
2502
+ const t = `
2503
+ ${yn({
2504
+ cssCode: e.cssCode,
2505
+ contentId: e.contentId
2506
+ })}
2507
+ ${bn({
2508
+ customFonts: e.customFonts
2509
+ })}
2510
+ ${pn(e.isNestedRender)}
2511
+ `.trim();
2512
+ return /* @__PURE__ */ c(Q, { id: "builderio-content", styles: t });
2513
+ }
2514
+ const Cn = ({
2515
+ content: e,
2516
+ data: t,
2517
+ locale: n
2518
+ }) => {
2519
+ var a, r, l;
2520
+ const i = {}, o = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
2521
+ return (l = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || l.forEach((s) => {
2522
+ s.name && s.defaultValue !== void 0 && (i[s.name] = s.defaultValue);
2523
+ }), {
2524
+ ...i,
2525
+ ...o,
2526
+ ...t,
2527
+ ...n ? {
2528
+ locale: n
2529
+ } : {}
2530
+ };
2531
+ }, In = ({
2532
+ content: e,
2533
+ data: t
2534
+ }) => e ? {
2535
+ ...e,
2536
+ data: {
2537
+ ...e == null ? void 0 : e.data,
2538
+ ...t
2539
+ },
2540
+ meta: e == null ? void 0 : e.meta
2541
+ } : void 0;
2542
+ function xe(e) {
2543
+ var o, a, r, l, s, d, m, u, h;
2544
+ const t = an({
2545
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2546
+ variationId: (o = e.content) == null ? void 0 : o.testVariationId,
2547
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2548
+ contentId: (a = e.content) == null ? void 0 : a.id
2549
+ }), n = [
2550
+ ...ye(),
2551
+ ...e.customComponents || []
2552
+ ].reduce(
2553
+ (x, { component: w, ...y }) => ({
2554
+ ...x,
2555
+ [y.name]: {
2556
+ component: w,
2557
+ ...me(y)
2558
+ }
2559
+ }),
2560
+ {}
2561
+ ), i = {
2562
+ content: In({
2563
+ content: e.content,
2564
+ data: e.data
2565
+ }),
2566
+ localState: void 0,
2567
+ rootState: Cn({
2568
+ content: e.content,
2569
+ data: e.data,
2570
+ locale: e.locale
2571
+ }),
2572
+ rootSetState: void 0,
2573
+ context: e.context || {},
2574
+ canTrack: e.canTrack,
2575
+ apiKey: e.apiKey,
2576
+ apiVersion: e.apiVersion,
2577
+ componentInfos: [
2578
+ ...ye(),
2579
+ ...e.customComponents || []
2580
+ ].reduce(
2581
+ (x, { component: w, ...y }) => ({
2582
+ ...x,
2583
+ [y.name]: me(y)
2584
+ }),
2585
+ {}
2586
+ ),
2587
+ inheritedStyles: {},
2588
+ BlocksWrapper: e.blocksWrapper || "div",
2589
+ BlocksWrapperProps: e.blocksWrapperProps || {}
2590
+ };
2591
+ return /* @__PURE__ */ E(
2592
+ xn,
2593
+ {
2594
+ content: e.content,
2595
+ data: e.data,
2596
+ model: e.model,
2597
+ context: e.context,
2598
+ apiKey: e.apiKey,
2599
+ canTrack: e.canTrack,
2600
+ locale: e.locale,
2601
+ enrich: e.enrich,
2602
+ showContent: e.showContent,
2603
+ builderContextSignal: i,
2604
+ contentWrapper: e.contentWrapper,
2605
+ contentWrapperProps: e.contentWrapperProps,
2606
+ trustedHosts: e.trustedHosts,
2607
+ children: [
2608
+ e.isSsrAbTest ? /* @__PURE__ */ c(
2609
+ ne,
2610
+ {
2611
+ id: "builderio-variant-visibility",
2612
+ scriptStr: t
2613
+ }
2614
+ ) : null,
2615
+ /* @__PURE__ */ c(
2616
+ kn,
2617
+ {
2618
+ isNestedRender: e.isNestedRender,
2619
+ contentId: (r = i.content) == null ? void 0 : r.id,
2620
+ cssCode: (s = (l = i.content) == null ? void 0 : l.data) == null ? void 0 : s.cssCode,
2621
+ customFonts: (m = (d = i.content) == null ? void 0 : d.data) == null ? void 0 : m.customFonts
2622
+ }
2623
+ ),
2624
+ /* @__PURE__ */ c(
2625
+ ce,
2626
+ {
2627
+ blocks: (h = (u = i.content) == null ? void 0 : u.data) == null ? void 0 : h.blocks,
2628
+ context: i,
2629
+ registeredComponents: n,
2630
+ linkComponent: e.linkComponent
2631
+ }
2632
+ )
2633
+ ]
2634
+ }
2635
+ );
2636
+ }
2637
+ function wn(e) {
2638
+ var a;
2639
+ const t = en({
2640
+ canTrack: q(e.canTrack),
2641
+ content: e.content
2642
+ }), n = function() {
2643
+ var l;
2644
+ return on(
2645
+ K(e.content).map((s) => ({
2646
+ id: s.testVariationId,
2647
+ testRatio: s.testRatio
2648
+ })),
2649
+ ((l = e.content) == null ? void 0 : l.id) || ""
2650
+ );
2651
+ }, i = function() {
2652
+ return K(e.content).map((l) => `.variant-${l.testVariationId} { display: none; } `).join("");
2653
+ }, o = function() {
2654
+ var l;
2655
+ return t ? {
2656
+ ...e.content,
2657
+ testVariationId: (l = e.content) == null ? void 0 : l.id
2658
+ } : Me({
2659
+ item: e.content,
2660
+ canTrack: q(e.canTrack)
2661
+ });
2662
+ };
2663
+ return /* @__PURE__ */ E(C, { children: [
2664
+ !e.isNestedRender && B !== "reactNative" ? /* @__PURE__ */ c(
2665
+ ne,
2666
+ {
2667
+ id: "builderio-init-variants-fns",
2668
+ scriptStr: nn()
2669
+ }
2670
+ ) : null,
2671
+ t ? /* @__PURE__ */ E(C, { children: [
2672
+ /* @__PURE__ */ c(
2673
+ Q,
2674
+ {
2675
+ id: "builderio-variants",
2676
+ styles: i()
2677
+ }
2678
+ ),
2679
+ /* @__PURE__ */ c(
2680
+ ne,
2681
+ {
2682
+ id: "builderio-variants-visibility",
2683
+ scriptStr: n()
2684
+ }
2685
+ ),
2686
+ (a = K(e.content)) == null ? void 0 : a.map((r) => /* @__PURE__ */ c(
2687
+ xe,
2688
+ {
2689
+ isNestedRender: e.isNestedRender,
2690
+ content: r,
2691
+ showContent: !1,
2692
+ model: e.model,
2693
+ data: e.data,
2694
+ context: e.context,
2695
+ apiKey: e.apiKey,
2696
+ apiVersion: e.apiVersion,
2697
+ customComponents: e.customComponents,
2698
+ linkComponent: e.linkComponent,
2699
+ canTrack: e.canTrack,
2700
+ locale: e.locale,
2701
+ enrich: e.enrich,
2702
+ isSsrAbTest: t,
2703
+ blocksWrapper: e.blocksWrapper,
2704
+ blocksWrapperProps: e.blocksWrapperProps,
2705
+ contentWrapper: e.contentWrapper,
2706
+ contentWrapperProps: e.contentWrapperProps,
2707
+ trustedHosts: e.trustedHosts
2708
+ },
2709
+ r.testVariationId
2710
+ ))
2711
+ ] }) : null,
2712
+ /* @__PURE__ */ c(
2713
+ xe,
2714
+ {
2715
+ isNestedRender: e.isNestedRender,
2716
+ content: o(),
2717
+ showContent: !0,
2718
+ model: e.model,
2719
+ data: e.data,
2720
+ context: e.context,
2721
+ apiKey: e.apiKey,
2722
+ apiVersion: e.apiVersion,
2723
+ customComponents: e.customComponents,
2724
+ linkComponent: e.linkComponent,
2725
+ canTrack: e.canTrack,
2726
+ locale: e.locale,
2727
+ enrich: e.enrich,
2728
+ isSsrAbTest: t,
2729
+ blocksWrapper: e.blocksWrapper,
2730
+ blocksWrapperProps: e.blocksWrapperProps,
2731
+ contentWrapper: e.contentWrapper,
2732
+ contentWrapperProps: e.contentWrapperProps,
2733
+ trustedHosts: e.trustedHosts
2734
+ }
2735
+ )
2736
+ ] });
2737
+ }
2738
+ const Tn = async ({
2739
+ builderContextValue: e,
2740
+ symbol: t
2741
+ }) => {
2742
+ if (t != null && t.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
2743
+ (e != null && e.apiKey))
2744
+ return ke({
2745
+ model: t.model,
2746
+ apiKey: e.apiKey,
2747
+ apiVersion: e.apiVersion,
2748
+ ...(t == null ? void 0 : t.entry) && {
2749
+ query: {
2750
+ id: t.entry
2751
+ }
2752
+ }
2753
+ }).catch((n) => {
2754
+ J.error("Could not fetch symbol content: ", n);
2755
+ });
2756
+ };
2757
+ async function Rn(e) {
2758
+ var a, r, l, s, d;
2759
+ const t = function() {
2760
+ return "div";
2761
+ }, n = function() {
2762
+ return "div";
2763
+ }, i = function() {
2764
+ var u, h;
2765
+ return [
2766
+ e.attributes[U()],
2767
+ "builder-symbol",
2768
+ (u = e.symbol) != null && u.inline ? "builder-inline-symbol" : void 0,
2769
+ (h = e.symbol) != null && h.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2770
+ ].filter(Boolean).join(" ");
2771
+ }, o = ((a = e.symbol) == null ? void 0 : a.content) || await Tn({
2772
+ symbol: e.symbol,
2773
+ builderContextValue: e.builderContext
2774
+ });
2775
+ return /* @__PURE__ */ c("div", { ...e.attributes, className: i(), children: /* @__PURE__ */ c(
2776
+ wn,
2777
+ {
2778
+ isNestedRender: !0,
2779
+ apiVersion: e.builderContext.apiVersion,
2780
+ apiKey: e.builderContext.apiKey,
2781
+ context: {
2782
+ ...e.builderContext.context,
2783
+ symbolId: (r = e.builderBlock) == null ? void 0 : r.id
2784
+ },
2785
+ customComponents: Object.values(e.builderComponents),
2786
+ data: {
2787
+ ...(l = e.symbol) == null ? void 0 : l.data,
2788
+ ...e.builderContext.localState,
2789
+ ...(s = o == null ? void 0 : o.data) == null ? void 0 : s.state
2790
+ },
2791
+ canTrack: e.builderContext.canTrack,
2792
+ model: (d = e.symbol) == null ? void 0 : d.model,
2793
+ content: o,
2794
+ linkComponent: e.builderLinkComponent,
2795
+ blocksWrapper: t(),
2796
+ contentWrapper: n()
2797
+ }
2798
+ ) });
2799
+ }
2800
+ export {
2801
+ ce as Blocks,
2802
+ rn as BuilderContext,
2803
+ Ye as Button,
2804
+ wt as Columns,
2805
+ wn as Content,
2806
+ Tt as Fragment,
2807
+ Pt as Image,
2808
+ Bt as Section,
2809
+ Rn as Symbol,
2810
+ Dt as Text,
2811
+ Qt as Video
2812
+ };