@builder.io/sdk-react 1.0.2 → 1.0.4

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 (93) hide show
  1. package/README.md +4 -3
  2. package/lib/browser/blocks-exports.cjs +187 -0
  3. package/lib/browser/blocks-exports.mjs +3441 -0
  4. package/lib/browser/index.cjs +1 -187
  5. package/lib/browser/index.mjs +26 -3449
  6. package/lib/browser/{server-entry-a595b1cf.cjs → server-entry-093e302c.cjs} +1 -1
  7. package/lib/browser/{server-entry-f6f9bdcb.js → server-entry-7839c812.js} +1 -1
  8. package/lib/browser/server-entry.cjs +1 -1
  9. package/lib/browser/server-entry.mjs +1 -1
  10. package/lib/edge/blocks-0fc8e8d2.js +3385 -0
  11. package/lib/edge/blocks-exports.cjs +1 -0
  12. package/lib/edge/blocks-exports.mjs +16 -0
  13. package/lib/edge/blocks-f8688fcb.cjs +32 -0
  14. package/lib/edge/button-61181684.cjs +1 -0
  15. package/lib/edge/button-d9bbef90.js +29 -0
  16. package/lib/edge/columns-d152e266.cjs +28 -0
  17. package/lib/edge/columns-f7a9bca7.js +156 -0
  18. package/lib/edge/content-variants-cdcbcdd8.js +1711 -0
  19. package/lib/edge/content-variants-d2500971.cjs +133 -0
  20. package/lib/edge/custom-code-33b73ed1.js +44 -0
  21. package/lib/edge/custom-code-7390ba8b.cjs +1 -0
  22. package/lib/edge/dynamic-blocks-exports.cjs +39 -0
  23. package/lib/edge/dynamic-blocks-exports.mjs +37 -0
  24. package/lib/edge/dynamic-renderer-b5124984.js +9 -0
  25. package/lib/edge/dynamic-renderer-c00b8bcb.cjs +1 -0
  26. package/lib/edge/embed-11e03fa7.js +38 -0
  27. package/lib/edge/embed-9edce7df.cjs +1 -0
  28. package/lib/edge/form-ac531791.cjs +1 -0
  29. package/lib/edge/form-fb5fd55e.js +194 -0
  30. package/lib/edge/fragment-015b0912.js +8 -0
  31. package/lib/edge/fragment-61ef192d.cjs +1 -0
  32. package/lib/edge/get-class-prop-name-caee6506.cjs +1 -0
  33. package/lib/edge/get-class-prop-name-f22d7d53.js +18 -0
  34. package/lib/edge/image-6a3654d5.js +118 -0
  35. package/lib/edge/image-e4128296.cjs +17 -0
  36. package/lib/edge/img-317659e2.js +21 -0
  37. package/lib/edge/img-f2eeaa75.cjs +1 -0
  38. package/lib/edge/index.cjs +1 -207
  39. package/lib/edge/index.mjs +25 -5922
  40. package/lib/edge/input-526ea905.js +21 -0
  41. package/lib/edge/input-562438c4.cjs +1 -0
  42. package/lib/edge/section-68fbc212.js +26 -0
  43. package/lib/edge/section-70c8b709.cjs +1 -0
  44. package/lib/edge/select-17802399.js +21 -0
  45. package/lib/edge/select-d87a6280.cjs +1 -0
  46. package/lib/edge/server-entry-88f58ed4.cjs +2 -0
  47. package/lib/edge/{server-entry-f6f9bdcb.js → server-entry-e0830caf.js} +373 -372
  48. package/lib/edge/server-entry.cjs +1 -1
  49. package/lib/edge/server-entry.mjs +1 -1
  50. package/lib/edge/slot-39b50f6b.cjs +1 -0
  51. package/lib/edge/slot-eb244885.js +33 -0
  52. package/lib/edge/submit-button-13d8d5a7.cjs +1 -0
  53. package/lib/edge/submit-button-71dd4015.js +8 -0
  54. package/lib/edge/symbol-bf773f2a.js +78 -0
  55. package/lib/edge/symbol-ee31bb7f.cjs +1 -0
  56. package/lib/edge/text-15f0a6f4.js +18 -0
  57. package/lib/edge/text-7fdbde16.cjs +1 -0
  58. package/lib/edge/video-66b20833.js +106 -0
  59. package/lib/edge/video-702696a8.cjs +1 -0
  60. package/lib/node/blocks-exports.cjs +227 -0
  61. package/lib/node/blocks-exports.mjs +3548 -0
  62. package/lib/node/index.cjs +1 -227
  63. package/lib/node/index.mjs +27 -3556
  64. package/lib/node/{server-entry-31b5d683.cjs → server-entry-0e638a4f.cjs} +1 -1
  65. package/lib/node/{server-entry-c2b6d198.js → server-entry-e1cc0803.js} +1 -1
  66. package/lib/node/server-entry.cjs +1 -1
  67. package/lib/node/server-entry.mjs +1 -1
  68. package/package.json +19 -13
  69. package/types/blocks/button/index.d.ts +1 -0
  70. package/types/blocks/columns/index.d.ts +1 -0
  71. package/types/blocks/custom-code/index.d.ts +1 -0
  72. package/types/blocks/embed/index.d.ts +1 -0
  73. package/types/blocks/form/form/index.d.ts +1 -0
  74. package/types/blocks/form/input/index.d.ts +1 -0
  75. package/types/blocks/form/select/index.d.ts +1 -0
  76. package/types/blocks/form/submit-button/index.d.ts +1 -0
  77. package/types/blocks/fragment/index.d.ts +1 -0
  78. package/types/blocks/image/index.d.ts +1 -0
  79. package/types/blocks/img/index.d.ts +1 -0
  80. package/types/blocks/raw-text/index.d.ts +1 -0
  81. package/types/blocks/section/index.d.ts +1 -0
  82. package/types/blocks/slot/index.d.ts +1 -0
  83. package/types/blocks/symbol/index.d.ts +1 -0
  84. package/types/blocks/text/index.d.ts +1 -0
  85. package/types/blocks/textarea/index.d.ts +1 -0
  86. package/types/blocks/video/index.d.ts +1 -0
  87. package/types/components/blocks/index.d.ts +1 -0
  88. package/types/components/content-variants/index.d.ts +1 -0
  89. package/types/components/error-boundary.d.ts +11 -0
  90. package/types/constants/sdk-version.d.ts +1 -1
  91. package/types/functions/get-content/types.d.ts +1 -1
  92. package/types/index-helpers/blocks-exports.d.ts +10 -11
  93. package/lib/edge/server-entry-a595b1cf.cjs +0 -2
@@ -0,0 +1,3441 @@
1
+ "use client";
2
+ import { jsx as l, Fragment as m, jsxs as F } from "react/jsx-runtime";
3
+ import { T as z, i as M, h as U, j as Oe, k as Q, l as _, m as ae, n as X, o as he, a as je, p as Ue, q as He, u as _e, c as Ke, e as Ie, v as qe, w as ge, x as ze } from "./server-entry-7839c812.js";
4
+ import { createContext as Te, useState as v, useEffect as V, useContext as be, useRef as ee, createElement as re } from "react";
5
+ const Je = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), Ye = (e) => typeof e == "string" && Je.has(e.toLowerCase());
6
+ function le(e) {
7
+ return /* @__PURE__ */ l(m, { children: Ye(e.TagName) ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ l(m, { children: typeof e.TagName == "string" ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
8
+ }
9
+ const K = () => {
10
+ switch (z) {
11
+ case "react":
12
+ case "reactNative":
13
+ case "rsc":
14
+ return "className";
15
+ case "svelte":
16
+ case "vue":
17
+ case "solid":
18
+ case "qwik":
19
+ return "class";
20
+ }
21
+ };
22
+ function Ge(e) {
23
+ return /* @__PURE__ */ l(
24
+ le,
25
+ {
26
+ attributes: {
27
+ ...e.attributes,
28
+ [K()]: `${e.link ? "" : "builder-button"} ${e.attributes[K()] || ""}`,
29
+ ...e.link ? {
30
+ href: e.link,
31
+ target: e.openLinkInNewTab ? "_blank" : void 0,
32
+ role: "link"
33
+ } : {
34
+ role: "button"
35
+ }
36
+ },
37
+ TagName: e.link ? e.builderLinkComponent || "a" : "button",
38
+ actionAttributes: {},
39
+ children: e.text
40
+ }
41
+ );
42
+ }
43
+ const se = Te({
44
+ content: null,
45
+ context: {},
46
+ localState: void 0,
47
+ rootSetState() {
48
+ },
49
+ rootState: {},
50
+ apiKey: null,
51
+ apiVersion: void 0,
52
+ componentInfos: {},
53
+ inheritedStyles: {},
54
+ BlocksWrapper: "div",
55
+ BlocksWrapperProps: {}
56
+ }), Ee = Te({ registeredComponents: {} });
57
+ function Qe(e) {
58
+ var t;
59
+ return {
60
+ ...(t = e.component) == null ? void 0 : t.options,
61
+ ...e.options,
62
+ /**
63
+ * Our built-in components frequently make use of the block, so we provide all of it under `builderBlock`
64
+ */
65
+ builderBlock: e
66
+ };
67
+ }
68
+ const Xe = ({
69
+ builder: e,
70
+ context: t,
71
+ event: n,
72
+ state: i
73
+ }) => Object.entries({
74
+ state: i,
75
+ Builder: e,
76
+ // legacy
77
+ builder: e,
78
+ context: t,
79
+ event: n
80
+ }), Ze = () => ({
81
+ isEditing: M(),
82
+ isBrowser: U(),
83
+ isServer: !U(),
84
+ getUserAttributes: () => Oe()
85
+ }), et = (e, {
86
+ isExpression: t = !0
87
+ }) => /* 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, ye = ({
88
+ code: e,
89
+ builder: t,
90
+ context: n,
91
+ event: i,
92
+ localState: o,
93
+ rootSetState: a,
94
+ rootState: r
95
+ }) => {
96
+ const s = Xe({
97
+ builder: t,
98
+ context: n,
99
+ event: i,
100
+ state: Re({
101
+ rootState: r,
102
+ localState: o,
103
+ rootSetState: a
104
+ })
105
+ });
106
+ return new Function(...s.map(([c]) => c), e)(...s.map(([, c]) => c));
107
+ };
108
+ function Re({
109
+ rootState: e,
110
+ localState: t,
111
+ rootSetState: n
112
+ }) {
113
+ return new Proxy(e, {
114
+ get: (i, o) => {
115
+ if (t && o in t)
116
+ return t[o];
117
+ const a = i[o];
118
+ return typeof a == "object" ? Re({
119
+ rootState: a,
120
+ localState: void 0,
121
+ rootSetState: n ? (r) => {
122
+ i[o] = r, n(i);
123
+ } : void 0
124
+ }) : a;
125
+ },
126
+ set: (i, o, a) => {
127
+ if (t && o in t)
128
+ throw new Error("Writing to local state is not allowed as it is read-only.");
129
+ return i[o] = a, n == null || n(i), !0;
130
+ }
131
+ });
132
+ }
133
+ function tt() {
134
+ var e;
135
+ return typeof process != "undefined" && Q((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
136
+ }
137
+ const nt = () => {
138
+ var i;
139
+ if (!tt())
140
+ return !1;
141
+ const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (i = process.env.NODE_OPTIONS) == null ? void 0 : i.includes("--no-node-snapshot");
142
+ return e && t && !n ? (_.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;
143
+ }, it = (e) => (U() || nt(), ye(e));
144
+ function q({
145
+ code: e,
146
+ context: t,
147
+ localState: n,
148
+ rootState: i,
149
+ rootSetState: o,
150
+ event: a,
151
+ isExpression: r = !0
152
+ }) {
153
+ if (e === "") {
154
+ _.warn("Skipping evaluation of empty code block.");
155
+ return;
156
+ }
157
+ const s = {
158
+ code: et(e, {
159
+ isExpression: r
160
+ }),
161
+ builder: Ze(),
162
+ context: t,
163
+ event: a,
164
+ rootSetState: o,
165
+ rootState: i,
166
+ localState: n
167
+ };
168
+ try {
169
+ return it(s);
170
+ } catch (c) {
171
+ _.error("Failed code evaluation: " + c.message, {
172
+ code: e
173
+ });
174
+ return;
175
+ }
176
+ }
177
+ const Pe = (e, t, n) => {
178
+ if (Object(e) !== e)
179
+ return e;
180
+ const i = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
181
+ 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;
182
+ };
183
+ const ot = ({
184
+ block: e,
185
+ context: t,
186
+ localState: n,
187
+ rootState: i,
188
+ rootSetState: o
189
+ }) => {
190
+ if (!e.bindings)
191
+ return e;
192
+ const a = ae(e), r = {
193
+ ...a,
194
+ properties: {
195
+ ...a.properties
196
+ },
197
+ actions: {
198
+ ...a.actions
199
+ }
200
+ };
201
+ for (const s in e.bindings) {
202
+ const c = e.bindings[s], d = q({
203
+ code: c,
204
+ localState: n,
205
+ rootState: i,
206
+ rootSetState: o,
207
+ context: t
208
+ });
209
+ Pe(r, s, d);
210
+ }
211
+ return r;
212
+ };
213
+ function Z({
214
+ block: e,
215
+ context: t,
216
+ shouldEvaluateBindings: n,
217
+ localState: i,
218
+ rootState: o,
219
+ rootSetState: a
220
+ }) {
221
+ const r = e;
222
+ return n ? ot({
223
+ block: r,
224
+ localState: i,
225
+ rootState: o,
226
+ rootSetState: a,
227
+ context: t
228
+ }) : r;
229
+ }
230
+ function at(e, t, n = {}) {
231
+ let i, o, a, r = null, s = 0;
232
+ const c = function() {
233
+ s = n.leading === !1 ? 0 : Date.now(), r = null, a = e.apply(i, o), r || (i = o = null);
234
+ };
235
+ return function() {
236
+ const d = Date.now();
237
+ !s && n.leading === !1 && (s = d);
238
+ const u = t - (d - s);
239
+ return i = this, o = arguments, u <= 0 || u > t ? (r && (clearTimeout(r), r = null), s = d, a = e.apply(i, o), r || (i = o = null)) : !r && n.trailing !== !1 && (r = setTimeout(c, u)), a;
240
+ };
241
+ }
242
+ function O(e, ...t) {
243
+ const n = Object(e);
244
+ for (let i = 1; i < arguments.length; i++) {
245
+ const o = arguments[i];
246
+ if (o != null)
247
+ for (const a in o)
248
+ Object.prototype.hasOwnProperty.call(o, a) && (n[a] = o[a]);
249
+ }
250
+ return n;
251
+ }
252
+ const ce = (e) => e ? e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`) : "";
253
+ function rt(e) {
254
+ for (const t of e)
255
+ switch (t.trigger) {
256
+ case "pageLoad":
257
+ Ve(t);
258
+ break;
259
+ case "hover":
260
+ st(t);
261
+ break;
262
+ case "scrollInView":
263
+ ct(t);
264
+ break;
265
+ }
266
+ }
267
+ function de(e) {
268
+ console.warn(`Cannot animate element: element with ID ${e} not found!`);
269
+ }
270
+ function ue(e, t) {
271
+ const n = lt(e), i = getComputedStyle(t), o = e.steps[0].styles, a = e.steps[e.steps.length - 1].styles, r = [o, a];
272
+ for (const s of r)
273
+ for (const c of n)
274
+ c in s || (s[c] = i[c]);
275
+ }
276
+ function lt(e) {
277
+ const t = [];
278
+ for (const n of e.steps)
279
+ for (const i in n.styles)
280
+ t.indexOf(i) === -1 && t.push(i);
281
+ return t;
282
+ }
283
+ function Ve(e) {
284
+ const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
285
+ if (!t.length) {
286
+ de(e.elementId || e.id || "");
287
+ return;
288
+ }
289
+ Array.from(t).forEach((n) => {
290
+ ue(e, n), n.style.transition = "none", n.style.transitionDelay = "0", O(n.style, e.steps[0].styles), setTimeout(() => {
291
+ n.style.transition = `all ${e.duration}s ${ce(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), O(n.style, e.steps[1].styles), setTimeout(() => {
292
+ n.style.transition = "", n.style.transitionDelay = "";
293
+ }, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
294
+ });
295
+ });
296
+ }
297
+ function st(e) {
298
+ const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
299
+ if (!t.length) {
300
+ de(e.elementId || e.id || "");
301
+ return;
302
+ }
303
+ Array.from(t).forEach((n) => {
304
+ ue(e, n);
305
+ const i = e.steps[0].styles, o = e.steps[1].styles;
306
+ function a() {
307
+ O(n.style, i);
308
+ }
309
+ function r() {
310
+ O(n.style, o);
311
+ }
312
+ a(), n.addEventListener("mouseenter", r), n.addEventListener("mouseleave", a), setTimeout(() => {
313
+ n.style.transition = `all ${e.duration}s ${ce(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
314
+ });
315
+ });
316
+ }
317
+ function ct(e) {
318
+ const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
319
+ if (!t.length) {
320
+ de(e.elementId || e.id || "");
321
+ return;
322
+ }
323
+ Array.from(t).forEach((n) => {
324
+ ue(e, n);
325
+ let i = !1, o = !1;
326
+ function a() {
327
+ !i && s(n) ? (i = !0, o = !0, setTimeout(() => {
328
+ O(n.style, e.steps[1].styles), e.repeat || document.removeEventListener("scroll", r), setTimeout(() => {
329
+ o = !1, e.repeat || (n.style.transition = "", n.style.transitionDelay = "");
330
+ }, (e.duration + (e.delay || 0)) * 1e3 + 100);
331
+ })) : e.repeat && i && !o && !s(n) && (i = !1, O(n.style, e.steps[0].styles));
332
+ }
333
+ const r = at(a, 200, {
334
+ leading: !1
335
+ });
336
+ function s(u) {
337
+ const x = u.getBoundingClientRect(), C = window.innerHeight, y = (e.thresholdPercent || 0) / 100 * C;
338
+ return x.bottom > y && x.top < C - y;
339
+ }
340
+ const c = e.steps[0].styles;
341
+ function d() {
342
+ O(n.style, c);
343
+ }
344
+ d(), setTimeout(() => {
345
+ n.style.transition = `all ${e.duration}s ${ce(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
346
+ }), document.addEventListener("scroll", r, {
347
+ capture: !0,
348
+ passive: !0
349
+ }), a();
350
+ });
351
+ }
352
+ const dt = ({
353
+ block: e,
354
+ context: t,
355
+ registeredComponents: n
356
+ }) => {
357
+ var a;
358
+ const i = (a = Z({
359
+ block: e,
360
+ localState: t.localState,
361
+ rootState: t.rootState,
362
+ rootSetState: t.rootSetState,
363
+ context: t.context,
364
+ shouldEvaluateBindings: !1
365
+ }).component) == null ? void 0 : a.name;
366
+ if (!i)
367
+ return null;
368
+ const o = n[i];
369
+ if (o)
370
+ return o;
371
+ console.warn(`
372
+ Could not find a registered component named "${i}".
373
+ If you registered it, is the file that registered it imported by the file that needs to render it?`);
374
+ }, ut = ({
375
+ block: e,
376
+ context: t
377
+ }) => {
378
+ const {
379
+ repeat: n,
380
+ ...i
381
+ } = e;
382
+ if (!(n != null && n.collection))
383
+ return;
384
+ const o = q({
385
+ code: n.collection,
386
+ localState: t.localState,
387
+ rootState: t.rootState,
388
+ rootSetState: t.rootSetState,
389
+ context: t.context
390
+ });
391
+ if (!Array.isArray(o))
392
+ return;
393
+ const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
394
+ return o.map((c, d) => ({
395
+ context: {
396
+ ...t,
397
+ localState: {
398
+ ...t.localState,
399
+ $index: d,
400
+ $item: c,
401
+ [r]: c,
402
+ [`$${r}Index`]: d
403
+ }
404
+ },
405
+ block: i
406
+ }));
407
+ }, Be = {
408
+ small: {
409
+ min: 320,
410
+ default: 321,
411
+ max: 640
412
+ },
413
+ medium: {
414
+ min: 641,
415
+ default: 642,
416
+ max: 991
417
+ },
418
+ large: {
419
+ min: 990,
420
+ default: 991,
421
+ max: 1200
422
+ }
423
+ }, pe = (e, t = Be) => `@media (max-width: ${t[e].max}px)`, Ae = ({
424
+ small: e,
425
+ medium: t
426
+ }) => {
427
+ const n = ae(Be);
428
+ if (!e || !t)
429
+ return n;
430
+ const i = Math.floor(e / 2);
431
+ n.small = {
432
+ max: e,
433
+ min: i,
434
+ default: i + 1
435
+ };
436
+ const o = n.small.max + 1;
437
+ n.medium = {
438
+ max: t,
439
+ min: o,
440
+ default: o + 1
441
+ };
442
+ const a = n.medium.max + 1;
443
+ return n.large = {
444
+ max: 2e3,
445
+ // TODO: decide upper limit
446
+ min: a,
447
+ default: a + 1
448
+ }, n;
449
+ }, mt = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), We = (e) => Object.entries(e).map(([n, i]) => {
450
+ if (typeof i == "string")
451
+ return `${mt(n)}: ${i};`;
452
+ }).filter(Q), ft = (e) => We(e).join(`
453
+ `), ne = ({
454
+ mediaQuery: e,
455
+ className: t,
456
+ styles: n
457
+ }) => {
458
+ const i = `.${t} {
459
+ ${ft(n)}
460
+ }`;
461
+ return e ? `${e} {
462
+ ${i}
463
+ }` : i;
464
+ };
465
+ function te(e) {
466
+ return /* @__PURE__ */ l("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
467
+ }
468
+ function ht(e) {
469
+ function t() {
470
+ const i = Z({
471
+ block: e.block,
472
+ localState: e.context.localState,
473
+ rootState: e.context.rootState,
474
+ rootSetState: e.context.rootSetState,
475
+ context: e.context.context,
476
+ shouldEvaluateBindings: !0
477
+ });
478
+ return Q(i.hide) ? !i.hide : Q(i.show) ? i.show : !0;
479
+ }
480
+ function n() {
481
+ var y;
482
+ const i = Z({
483
+ block: e.block,
484
+ localState: e.context.localState,
485
+ rootState: e.context.rootState,
486
+ rootSetState: e.context.rootSetState,
487
+ context: e.context.context,
488
+ shouldEvaluateBindings: !0
489
+ }), o = i.responsiveStyles, a = e.context.content, r = Ae(
490
+ ((y = a == null ? void 0 : a.meta) == null ? void 0 : y.breakpoints) || {}
491
+ ), s = o == null ? void 0 : o.large, c = o == null ? void 0 : o.medium, d = o == null ? void 0 : o.small, u = i.id;
492
+ if (!u)
493
+ return "";
494
+ const x = s ? ne({
495
+ className: u,
496
+ styles: s
497
+ }) : "", C = c ? ne({
498
+ className: u,
499
+ styles: c,
500
+ mediaQuery: pe(
501
+ "medium",
502
+ r
503
+ )
504
+ }) : "", f = d ? ne({
505
+ className: u,
506
+ styles: d,
507
+ mediaQuery: pe(
508
+ "small",
509
+ r
510
+ )
511
+ }) : "";
512
+ return [x, C, f].join(" ");
513
+ }
514
+ return /* @__PURE__ */ l(m, { children: n() && t() ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(te, { styles: n() }) }) : null });
515
+ }
516
+ function gt(e) {
517
+ return e.charAt(0).toUpperCase() + e.slice(1);
518
+ }
519
+ const bt = (e) => `on${gt(e)}`, yt = (e, t) => (n) => q({
520
+ code: e,
521
+ context: t.context,
522
+ localState: t.localState,
523
+ rootState: t.rootState,
524
+ rootSetState: t.rootSetState,
525
+ event: n,
526
+ isExpression: !1
527
+ });
528
+ function Fe(e) {
529
+ var i;
530
+ const t = {}, n = (i = e.block.actions) != null ? i : {};
531
+ for (const o in n) {
532
+ if (!n.hasOwnProperty(o))
533
+ continue;
534
+ const a = n[o];
535
+ let r = bt(o);
536
+ if (e.stripPrefix)
537
+ switch (z) {
538
+ case "vue":
539
+ r = r.replace("v-on:", "");
540
+ break;
541
+ case "svelte":
542
+ r = r.replace("on:", "");
543
+ break;
544
+ }
545
+ t[r] = yt(a, e);
546
+ }
547
+ return t;
548
+ }
549
+ function pt({
550
+ style: e
551
+ }) {
552
+ return e;
553
+ }
554
+ const xt = ({
555
+ block: e,
556
+ context: t
557
+ }) => Ne(pt({
558
+ style: e.style || {},
559
+ context: t,
560
+ block: e
561
+ }));
562
+ function Ne(e) {
563
+ switch (z) {
564
+ case "svelte":
565
+ case "vue":
566
+ case "solid":
567
+ return We(e).join(" ");
568
+ case "qwik":
569
+ case "reactNative":
570
+ case "react":
571
+ case "rsc":
572
+ return e;
573
+ }
574
+ }
575
+ function St({
576
+ properties: e
577
+ }) {
578
+ return e;
579
+ }
580
+ const vt = (e) => ({
581
+ href: e.href
582
+ });
583
+ function me({
584
+ block: e,
585
+ context: t
586
+ }) {
587
+ var i;
588
+ const n = {
589
+ ...vt(e),
590
+ ...e.properties,
591
+ "builder-id": e.id,
592
+ style: xt({
593
+ block: e,
594
+ context: t
595
+ }),
596
+ [K()]: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
597
+ };
598
+ return St({
599
+ properties: n,
600
+ context: t,
601
+ block: e
602
+ });
603
+ }
604
+ function kt(e) {
605
+ return /* @__PURE__ */ l(
606
+ le,
607
+ {
608
+ TagName: e.Wrapper,
609
+ attributes: me({
610
+ block: e.block,
611
+ context: e.context
612
+ }),
613
+ actionAttributes: Fe({
614
+ block: e.block,
615
+ rootState: e.context.rootState,
616
+ rootSetState: e.context.rootSetState,
617
+ localState: e.context.localState,
618
+ context: e.context.context,
619
+ stripPrefix: !0
620
+ }),
621
+ children: e.children
622
+ }
623
+ );
624
+ }
625
+ function Ct(e) {
626
+ return /* @__PURE__ */ l(
627
+ e.Wrapper,
628
+ {
629
+ ...e.wrapperProps,
630
+ attributes: e.includeBlockProps ? {
631
+ ...me({
632
+ block: e.block,
633
+ context: e.context
634
+ }),
635
+ ...Fe({
636
+ block: e.block,
637
+ rootState: e.context.rootState,
638
+ rootSetState: e.context.rootSetState,
639
+ localState: e.context.localState,
640
+ context: e.context.context
641
+ })
642
+ } : {},
643
+ children: e.children
644
+ }
645
+ );
646
+ }
647
+ const wt = ({
648
+ componentOptions: e,
649
+ builderBlock: t,
650
+ context: n,
651
+ componentRef: i,
652
+ includeBlockProps: o,
653
+ isInteractive: a,
654
+ contextValue: r
655
+ }) => {
656
+ const s = {
657
+ ...e,
658
+ /**
659
+ * If `noWrap` is set to `true`, then the block's props/attributes are provided to the
660
+ * component itself directly. Otherwise, they are provided to the wrapper element.
661
+ */
662
+ ...o ? {
663
+ attributes: me({
664
+ block: t,
665
+ context: r
666
+ })
667
+ } : {}
668
+ };
669
+ return a ? {
670
+ Wrapper: i,
671
+ block: t,
672
+ context: n,
673
+ wrapperProps: e,
674
+ includeBlockProps: o
675
+ } : s;
676
+ };
677
+ function xe(e) {
678
+ var i;
679
+ const [t, n] = v(
680
+ () => e.isInteractive ? Ct : e.componentRef
681
+ );
682
+ return /* @__PURE__ */ l(m, { children: e.componentRef ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(
683
+ t,
684
+ {
685
+ ...wt({
686
+ componentOptions: e.componentOptions,
687
+ builderBlock: e.builderBlock,
688
+ context: e.context,
689
+ componentRef: e.componentRef,
690
+ linkComponent: e.linkComponent,
691
+ includeBlockProps: e.includeBlockProps,
692
+ isInteractive: e.isInteractive,
693
+ contextValue: e.context
694
+ }),
695
+ children: (i = e.blockChildren) == null ? void 0 : i.map((o) => /* @__PURE__ */ l(
696
+ J,
697
+ {
698
+ block: o,
699
+ context: e.context,
700
+ registeredComponents: e.registeredComponents,
701
+ linkComponent: e.linkComponent
702
+ },
703
+ o.id
704
+ ))
705
+ }
706
+ ) }) : null });
707
+ }
708
+ function It(e) {
709
+ const [t, n] = v(() => e.repeatContext);
710
+ return /* @__PURE__ */ l(se.Provider, { value: t, children: /* @__PURE__ */ l(
711
+ J,
712
+ {
713
+ block: e.block,
714
+ context: t,
715
+ registeredComponents: e.registeredComponents,
716
+ linkComponent: e.linkComponent
717
+ }
718
+ ) });
719
+ }
720
+ function J(e) {
721
+ var u, x, C;
722
+ function t() {
723
+ return dt({
724
+ block: e.block,
725
+ context: e.context,
726
+ registeredComponents: e.registeredComponents
727
+ });
728
+ }
729
+ function n() {
730
+ return ut({
731
+ block: e.block,
732
+ context: e.context
733
+ });
734
+ }
735
+ function i() {
736
+ var f;
737
+ return (f = e.block.repeat) != null && f.collection ? e.block : Z({
738
+ block: e.block,
739
+ localState: e.context.localState,
740
+ rootState: e.context.rootState,
741
+ rootSetState: e.context.rootSetState,
742
+ context: e.context.context,
743
+ shouldEvaluateBindings: !0
744
+ });
745
+ }
746
+ function o() {
747
+ var y;
748
+ return e.block.tagName === "a" || ((y = i().properties) == null ? void 0 : y.href) || i().href ? e.linkComponent || "a" : e.block.tagName || "div";
749
+ }
750
+ function a() {
751
+ var p, E;
752
+ if ((p = e.block.repeat) != null && p.collection)
753
+ return !!((E = n == null ? void 0 : n()) != null && E.length);
754
+ const f = "hide" in i() ? i().hide : !1;
755
+ return ("show" in i() ? i().show : !0) && !f;
756
+ }
757
+ function r() {
758
+ var y, p;
759
+ return !((y = t == null ? void 0 : t()) != null && y.component) && !n() ? (p = i().children) != null ? p : [] : [];
760
+ }
761
+ function s() {
762
+ var f, y, p, E, A, k, I, B, P, $, L;
763
+ return {
764
+ blockChildren: (f = i().children) != null ? f : [],
765
+ componentRef: (y = t == null ? void 0 : t()) == null ? void 0 : y.component,
766
+ componentOptions: {
767
+ ...Qe(i()),
768
+ builderContext: e.context,
769
+ ...((p = t == null ? void 0 : t()) == null ? void 0 : p.name) === "Core:Button" || ((E = t == null ? void 0 : t()) == null ? void 0 : E.name) === "Symbol" || ((A = t == null ? void 0 : t()) == null ? void 0 : A.name) === "Columns" || ((k = t == null ? void 0 : t()) == null ? void 0 : k.name) === "Form:Form" ? {
770
+ builderLinkComponent: e.linkComponent
771
+ } : {},
772
+ ...((I = t == null ? void 0 : t()) == null ? void 0 : I.name) === "Symbol" || ((B = t == null ? void 0 : t()) == null ? void 0 : B.name) === "Columns" || ((P = t == null ? void 0 : t()) == null ? void 0 : P.name) === "Form:Form" ? {
773
+ builderComponents: e.registeredComponents
774
+ } : {}
775
+ },
776
+ context: c,
777
+ linkComponent: e.linkComponent,
778
+ registeredComponents: e.registeredComponents,
779
+ builderBlock: i(),
780
+ includeBlockProps: (($ = t == null ? void 0 : t()) == null ? void 0 : $.noWrap) === !0,
781
+ isInteractive: !((L = t == null ? void 0 : t()) != null && L.isRSC)
782
+ };
783
+ }
784
+ const [c, d] = v(() => e.context);
785
+ return V(() => {
786
+ const f = i().id, y = i().animations;
787
+ y && f && rt(
788
+ y.filter((p) => p.trigger !== "hover").map((p) => ({
789
+ ...p,
790
+ elementId: f
791
+ }))
792
+ );
793
+ }, []), /* @__PURE__ */ l(m, { children: a() ? /* @__PURE__ */ F(m, { children: [
794
+ /* @__PURE__ */ l(ht, { block: e.block, context: e.context }),
795
+ (u = t == null ? void 0 : t()) != null && u.noWrap ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(
796
+ xe,
797
+ {
798
+ componentRef: s().componentRef,
799
+ componentOptions: s().componentOptions,
800
+ blockChildren: s().blockChildren,
801
+ context: s().context,
802
+ registeredComponents: s().registeredComponents,
803
+ linkComponent: s().linkComponent,
804
+ builderBlock: s().builderBlock,
805
+ includeBlockProps: s().includeBlockProps,
806
+ isInteractive: s().isInteractive
807
+ }
808
+ ) }) : /* @__PURE__ */ l(m, { children: n() ? /* @__PURE__ */ l(m, { children: (C = n()) == null ? void 0 : C.map((f, y) => /* @__PURE__ */ l(
809
+ It,
810
+ {
811
+ repeatContext: f.context,
812
+ block: f.block,
813
+ registeredComponents: e.registeredComponents,
814
+ linkComponent: e.linkComponent
815
+ },
816
+ y
817
+ )) }) : /* @__PURE__ */ l(m, { children: /* @__PURE__ */ F(
818
+ kt,
819
+ {
820
+ Wrapper: o(),
821
+ block: i(),
822
+ context: e.context,
823
+ linkComponent: e.linkComponent,
824
+ children: [
825
+ /* @__PURE__ */ l(
826
+ xe,
827
+ {
828
+ componentRef: s().componentRef,
829
+ componentOptions: s().componentOptions,
830
+ blockChildren: s().blockChildren,
831
+ context: s().context,
832
+ registeredComponents: s().registeredComponents,
833
+ linkComponent: s().linkComponent,
834
+ builderBlock: s().builderBlock,
835
+ includeBlockProps: s().includeBlockProps,
836
+ isInteractive: s().isInteractive
837
+ }
838
+ ),
839
+ (x = r()) == null ? void 0 : x.map((f) => /* @__PURE__ */ l(
840
+ J,
841
+ {
842
+ block: f,
843
+ context: c,
844
+ registeredComponents: e.registeredComponents,
845
+ linkComponent: e.linkComponent
846
+ },
847
+ f.id
848
+ ))
849
+ ]
850
+ }
851
+ ) }) })
852
+ ] }) : null });
853
+ }
854
+ function Tt(e) {
855
+ function t() {
856
+ var o;
857
+ return "builder-blocks" + ((o = e.blocks) != null && o.length ? "" : " no-blocks");
858
+ }
859
+ function n() {
860
+ var o, a;
861
+ M() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
862
+ {
863
+ type: "builder.clickEmptyBlocks",
864
+ data: {
865
+ parentElementId: e.parent,
866
+ dataPath: e.path
867
+ }
868
+ },
869
+ "*"
870
+ ));
871
+ }
872
+ function i() {
873
+ var o, a;
874
+ M() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
875
+ {
876
+ type: "builder.hoverEmptyBlocks",
877
+ data: {
878
+ parentElementId: e.parent,
879
+ dataPath: e.path
880
+ }
881
+ },
882
+ "*"
883
+ ));
884
+ }
885
+ return /* @__PURE__ */ F(m, { children: [
886
+ /* @__PURE__ */ l(
887
+ e.BlocksWrapper,
888
+ {
889
+ className: t() + " props-blocks-wrapper-7354e098",
890
+ "builder-path": e.path,
891
+ "builder-parent-id": e.parent,
892
+ style: e.styleProp,
893
+ onClick: (o) => n(),
894
+ onMouseEnter: (o) => i(),
895
+ onKeyPress: (o) => n(),
896
+ ...e.BlocksWrapperProps,
897
+ children: e.children
898
+ }
899
+ ),
900
+ /* @__PURE__ */ l("style", { children: `.props-blocks-wrapper-7354e098 {
901
+ display: flex;
902
+ flex-direction: column;
903
+ align-items: stretch;
904
+ }` })
905
+ ] });
906
+ }
907
+ function j(e) {
908
+ var i, o, a;
909
+ const t = be(se), n = be(Ee);
910
+ return /* @__PURE__ */ l(
911
+ Tt,
912
+ {
913
+ blocks: e.blocks,
914
+ parent: e.parent,
915
+ path: e.path,
916
+ styleProp: e.styleProp,
917
+ BlocksWrapper: (i = e.context) == null ? void 0 : i.BlocksWrapper,
918
+ BlocksWrapperProps: (o = e.context) == null ? void 0 : o.BlocksWrapperProps,
919
+ children: e.blocks ? /* @__PURE__ */ l(m, { children: (a = e.blocks) == null ? void 0 : a.map((r) => /* @__PURE__ */ l(
920
+ J,
921
+ {
922
+ block: r,
923
+ linkComponent: e.linkComponent,
924
+ context: e.context || t,
925
+ registeredComponents: e.registeredComponents || n.registeredComponents
926
+ },
927
+ r.id
928
+ )) }) : null
929
+ }
930
+ );
931
+ }
932
+ function Et(e) {
933
+ var A;
934
+ const [t, n] = v(
935
+ () => typeof e.space == "number" ? e.space || 0 : 20
936
+ ), [i, o] = v(() => e.columns || []), [a, r] = v(
937
+ () => e.stackColumnsAt || "tablet"
938
+ );
939
+ function s(k) {
940
+ var I;
941
+ return ((I = i[k]) == null ? void 0 : I.width) || 100 / i.length;
942
+ }
943
+ function c(k) {
944
+ const I = t * (i.length - 1) / i.length;
945
+ return `calc(${s(k)}% - ${I}px)`;
946
+ }
947
+ function d({
948
+ stackedStyle: k,
949
+ desktopStyle: I
950
+ }) {
951
+ return a === "tablet" ? k : I;
952
+ }
953
+ function u({
954
+ stackedStyle: k,
955
+ desktopStyle: I
956
+ }) {
957
+ return a === "never" ? I : k;
958
+ }
959
+ const [x, C] = v(
960
+ () => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
961
+ );
962
+ function f() {
963
+ return {
964
+ "--flex-dir": x,
965
+ "--flex-dir-tablet": d({
966
+ stackedStyle: x,
967
+ desktopStyle: "row"
968
+ })
969
+ };
970
+ }
971
+ function y(k) {
972
+ const I = k === 0 ? 0 : t, B = c(k), P = `${I}px`, $ = "100%", L = 0;
973
+ return {
974
+ ...{
975
+ display: "flex",
976
+ flexDirection: "column",
977
+ alignItems: "stretch"
978
+ },
979
+ width: B,
980
+ ["marginLeft"]: P,
981
+ "--column-width-mobile": u({
982
+ stackedStyle: $,
983
+ desktopStyle: B
984
+ }),
985
+ "--column-margin-left-mobile": u({
986
+ stackedStyle: L,
987
+ desktopStyle: P
988
+ }),
989
+ "--column-width-tablet": d({
990
+ stackedStyle: $,
991
+ desktopStyle: B
992
+ }),
993
+ "--column-margin-left-tablet": d({
994
+ stackedStyle: L,
995
+ desktopStyle: P
996
+ })
997
+ };
998
+ }
999
+ function p(k) {
1000
+ var B, P;
1001
+ return Ae(
1002
+ ((P = (B = e.builderContext.content) == null ? void 0 : B.meta) == null ? void 0 : P.breakpoints) || {}
1003
+ )[k].max;
1004
+ }
1005
+ function E() {
1006
+ return `
1007
+ @media (max-width: ${p("medium")}px) {
1008
+ .${e.builderBlock.id}-breakpoints {
1009
+ flex-direction: var(--flex-dir-tablet);
1010
+ align-items: stretch;
1011
+ }
1012
+
1013
+ .${e.builderBlock.id}-breakpoints > .builder-column {
1014
+ width: var(--column-width-tablet) !important;
1015
+ margin-left: var(--column-margin-left-tablet) !important;
1016
+ }
1017
+ }
1018
+
1019
+ @media (max-width: ${p("small")}px) {
1020
+ .${e.builderBlock.id}-breakpoints {
1021
+ flex-direction: var(--flex-dir);
1022
+ align-items: stretch;
1023
+ }
1024
+
1025
+ .${e.builderBlock.id}-breakpoints > .builder-column {
1026
+ width: var(--column-width-mobile) !important;
1027
+ margin-left: var(--column-margin-left-mobile) !important;
1028
+ }
1029
+ },
1030
+ `;
1031
+ }
1032
+ return /* @__PURE__ */ F(m, { children: [
1033
+ /* @__PURE__ */ F(
1034
+ "div",
1035
+ {
1036
+ className: `builder-columns ${e.builderBlock.id}-breakpoints div-f5024694`,
1037
+ style: f(),
1038
+ children: [
1039
+ /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(te, { styles: E() }) }),
1040
+ (A = e.columns) == null ? void 0 : A.map((k, I) => /* @__PURE__ */ l(
1041
+ le,
1042
+ {
1043
+ TagName: k.link ? e.builderLinkComponent || "a" : "div",
1044
+ actionAttributes: {},
1045
+ attributes: {
1046
+ ...k.link ? {
1047
+ href: k.link
1048
+ } : {},
1049
+ [K()]: "builder-column",
1050
+ style: Ne(y(I))
1051
+ },
1052
+ children: /* @__PURE__ */ l(
1053
+ j,
1054
+ {
1055
+ path: `component.options.columns.${I}.blocks`,
1056
+ parent: e.builderBlock.id,
1057
+ styleProp: {
1058
+ flexGrow: "1"
1059
+ },
1060
+ context: e.builderContext,
1061
+ registeredComponents: e.builderComponents,
1062
+ linkComponent: e.builderLinkComponent,
1063
+ blocks: k.blocks
1064
+ }
1065
+ )
1066
+ },
1067
+ I
1068
+ ))
1069
+ ]
1070
+ }
1071
+ ),
1072
+ /* @__PURE__ */ l("style", { children: `.div-f5024694 {
1073
+ display: flex;
1074
+ line-height: normal;
1075
+ }` })
1076
+ ] });
1077
+ }
1078
+ function Rt(e) {
1079
+ return /* @__PURE__ */ l("span", { children: e.children });
1080
+ }
1081
+ function Se(e) {
1082
+ return e.replace(/http(s)?:/, "");
1083
+ }
1084
+ function Pt(e = "", t, n) {
1085
+ const i = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), o = e.indexOf("?") !== -1 ? "&" : "?";
1086
+ return e.match(i) ? e.replace(i, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + o + t + "=" + encodeURIComponent(n);
1087
+ }
1088
+ function Vt(e, t) {
1089
+ if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
1090
+ return e;
1091
+ if (t === "master")
1092
+ return Se(e);
1093
+ const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
1094
+ if (n) {
1095
+ const i = e.split(n[0]), o = n[3], a = t.match("x") ? t : `${t}x`;
1096
+ return Se(`${i[0]}_${a}${o}`);
1097
+ }
1098
+ return null;
1099
+ }
1100
+ function ie(e) {
1101
+ if (!e)
1102
+ return e;
1103
+ const t = [100, 200, 400, 800, 1200, 1600, 2e3];
1104
+ if (e.match(/builder\.io/)) {
1105
+ let n = e;
1106
+ const i = Number(e.split("?width=")[1]);
1107
+ return isNaN(i) || (n = `${n} ${i}w`), t.filter((o) => o !== i).map((o) => `${Pt(e, "width", o)} ${o}w`).concat([n]).join(", ");
1108
+ }
1109
+ return e.match(/cdn\.shopify\.com/) ? t.map((n) => [Vt(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, i]) => `${n} ${i}w`).concat([e]).join(", ") : e;
1110
+ }
1111
+ function Bt(e) {
1112
+ var o, a, r, s;
1113
+ function t() {
1114
+ var u;
1115
+ const d = e.image || e.src;
1116
+ if (!d || // We can auto add srcset for cdn.builder.io and shopify
1117
+ // images, otherwise you can supply this prop manually
1118
+ !(d.match(/builder\.io/) || d.match(/cdn\.shopify\.com/)))
1119
+ return e.srcset;
1120
+ if (e.srcset && ((u = e.image) != null && u.includes("builder.io/api/v1/image"))) {
1121
+ if (!e.srcset.includes(e.image.split("?")[0]))
1122
+ return console.debug("Removed given srcset"), ie(d);
1123
+ } else if (e.image && !e.srcset)
1124
+ return ie(d);
1125
+ return ie(d);
1126
+ }
1127
+ function n() {
1128
+ var c;
1129
+ return (c = t == null ? void 0 : t()) != null && c.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
1130
+ }
1131
+ function i() {
1132
+ const c = {
1133
+ position: "absolute",
1134
+ height: "100%",
1135
+ width: "100%",
1136
+ left: "0px",
1137
+ top: "0px"
1138
+ };
1139
+ return e.aspectRatio ? c : void 0;
1140
+ }
1141
+ return /* @__PURE__ */ F(m, { children: [
1142
+ /* @__PURE__ */ F(m, { children: [
1143
+ /* @__PURE__ */ F("picture", { children: [
1144
+ n() ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l("source", { type: "image/webp", srcSet: n() }) }) : null,
1145
+ /* @__PURE__ */ l(
1146
+ "img",
1147
+ {
1148
+ loading: "lazy",
1149
+ alt: e.altText,
1150
+ role: e.altText ? "presentation" : void 0,
1151
+ style: {
1152
+ objectPosition: e.backgroundPosition || "center",
1153
+ objectFit: e.backgroundSize || "cover",
1154
+ ...i()
1155
+ },
1156
+ className: "builder-image" + (e.className ? " " + e.className : "") + " img-40c70c9b",
1157
+ src: e.image,
1158
+ srcSet: t(),
1159
+ sizes: e.sizes
1160
+ }
1161
+ )
1162
+ ] }),
1163
+ e.aspectRatio && !((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(
1164
+ "div",
1165
+ {
1166
+ className: "builder-image-sizer div-40c70c9b",
1167
+ style: {
1168
+ paddingTop: e.aspectRatio * 100 + "%"
1169
+ }
1170
+ }
1171
+ ) }) : null,
1172
+ (s = (r = e.builderBlock) == null ? void 0 : r.children) != null && s.length && e.fitContent ? /* @__PURE__ */ l(m, { children: e.children }) : null,
1173
+ !e.fitContent && e.children ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
1174
+ ] }),
1175
+ /* @__PURE__ */ l("style", { children: `.img-40c70c9b {
1176
+ opacity: 1;
1177
+ transition: opacity 0.2s ease-in-out;
1178
+ }.div-40c70c9b {
1179
+ width: 100%;
1180
+ pointer-events: none;
1181
+ font-size: 0;
1182
+ }.div-40c70c9b-2 {
1183
+ display: flex;
1184
+ flex-direction: column;
1185
+ align-items: stretch;
1186
+ position: absolute;
1187
+ top: 0;
1188
+ left: 0;
1189
+ width: 100%;
1190
+ height: 100%;
1191
+ }` })
1192
+ ] });
1193
+ }
1194
+ function At(e) {
1195
+ return /* @__PURE__ */ l(
1196
+ "section",
1197
+ {
1198
+ ...e.attributes,
1199
+ style: {
1200
+ width: "100%",
1201
+ alignSelf: "stretch",
1202
+ flexGrow: 1,
1203
+ boxSizing: "border-box",
1204
+ maxWidth: e.maxWidth || 1200,
1205
+ display: "flex",
1206
+ flexDirection: "column",
1207
+ alignItems: "stretch",
1208
+ marginLeft: "auto",
1209
+ marginRight: "auto"
1210
+ },
1211
+ children: e.children
1212
+ }
1213
+ );
1214
+ }
1215
+ const Wt = {
1216
+ name: "Core:Button",
1217
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
1218
+ defaultStyles: {
1219
+ // TODO: make min width more intuitive and set one
1220
+ appearance: "none",
1221
+ paddingTop: "15px",
1222
+ paddingBottom: "15px",
1223
+ paddingLeft: "25px",
1224
+ paddingRight: "25px",
1225
+ backgroundColor: "#000000",
1226
+ color: "white",
1227
+ borderRadius: "4px",
1228
+ textAlign: "center",
1229
+ cursor: "pointer"
1230
+ },
1231
+ inputs: [{
1232
+ name: "text",
1233
+ type: "text",
1234
+ defaultValue: "Click me!",
1235
+ bubble: !0
1236
+ }, {
1237
+ name: "link",
1238
+ type: "url",
1239
+ bubble: !0
1240
+ }, {
1241
+ name: "openLinkInNewTab",
1242
+ type: "boolean",
1243
+ defaultValue: !1,
1244
+ friendlyName: "Open link in new tab"
1245
+ }],
1246
+ static: !0,
1247
+ noWrap: !0
1248
+ }, Ft = {
1249
+ // TODO: ways to statically preprocess JSON for references, functions, etc
1250
+ name: "Columns",
1251
+ isRSC: !0,
1252
+ inputs: [{
1253
+ name: "columns",
1254
+ type: "array",
1255
+ broadcast: !0,
1256
+ subFields: [{
1257
+ name: "blocks",
1258
+ type: "array",
1259
+ hideFromUI: !0,
1260
+ defaultValue: [{
1261
+ "@type": "@builder.io/sdk:Element",
1262
+ responsiveStyles: {
1263
+ large: {
1264
+ display: "flex",
1265
+ flexDirection: "column",
1266
+ alignItems: "stretch",
1267
+ flexShrink: "0",
1268
+ position: "relative",
1269
+ marginTop: "30px",
1270
+ textAlign: "center",
1271
+ lineHeight: "normal",
1272
+ height: "auto",
1273
+ minHeight: "20px",
1274
+ minWidth: "20px",
1275
+ overflow: "hidden"
1276
+ }
1277
+ },
1278
+ component: {
1279
+ name: "Image",
1280
+ options: {
1281
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1282
+ backgroundPosition: "center",
1283
+ backgroundSize: "cover",
1284
+ aspectRatio: 0.7004048582995948
1285
+ }
1286
+ }
1287
+ }, {
1288
+ "@type": "@builder.io/sdk:Element",
1289
+ responsiveStyles: {
1290
+ large: {
1291
+ display: "flex",
1292
+ flexDirection: "column",
1293
+ alignItems: "stretch",
1294
+ flexShrink: "0",
1295
+ position: "relative",
1296
+ marginTop: "30px",
1297
+ textAlign: "center",
1298
+ lineHeight: "normal",
1299
+ height: "auto"
1300
+ }
1301
+ },
1302
+ component: {
1303
+ name: "Text",
1304
+ options: {
1305
+ text: "<p>Enter some text...</p>"
1306
+ }
1307
+ }
1308
+ }]
1309
+ }, {
1310
+ name: "width",
1311
+ type: "number",
1312
+ hideFromUI: !0,
1313
+ helperText: "Width %, e.g. set to 50 to fill half of the space"
1314
+ }, {
1315
+ name: "link",
1316
+ type: "url",
1317
+ helperText: "Optionally set a url that clicking this column will link to"
1318
+ }],
1319
+ defaultValue: [{
1320
+ blocks: [{
1321
+ "@type": "@builder.io/sdk:Element",
1322
+ responsiveStyles: {
1323
+ large: {
1324
+ display: "flex",
1325
+ flexDirection: "column",
1326
+ alignItems: "stretch",
1327
+ flexShrink: "0",
1328
+ position: "relative",
1329
+ marginTop: "30px",
1330
+ textAlign: "center",
1331
+ lineHeight: "normal",
1332
+ height: "auto",
1333
+ minHeight: "20px",
1334
+ minWidth: "20px",
1335
+ overflow: "hidden"
1336
+ }
1337
+ },
1338
+ component: {
1339
+ name: "Image",
1340
+ options: {
1341
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1342
+ backgroundPosition: "center",
1343
+ backgroundSize: "cover",
1344
+ aspectRatio: 0.7004048582995948
1345
+ }
1346
+ }
1347
+ }, {
1348
+ "@type": "@builder.io/sdk:Element",
1349
+ responsiveStyles: {
1350
+ large: {
1351
+ display: "flex",
1352
+ flexDirection: "column",
1353
+ alignItems: "stretch",
1354
+ flexShrink: "0",
1355
+ position: "relative",
1356
+ marginTop: "30px",
1357
+ textAlign: "center",
1358
+ lineHeight: "normal",
1359
+ height: "auto"
1360
+ }
1361
+ },
1362
+ component: {
1363
+ name: "Text",
1364
+ options: {
1365
+ text: "<p>Enter some text...</p>"
1366
+ }
1367
+ }
1368
+ }]
1369
+ }, {
1370
+ blocks: [{
1371
+ "@type": "@builder.io/sdk:Element",
1372
+ responsiveStyles: {
1373
+ large: {
1374
+ display: "flex",
1375
+ flexDirection: "column",
1376
+ alignItems: "stretch",
1377
+ flexShrink: "0",
1378
+ position: "relative",
1379
+ marginTop: "30px",
1380
+ textAlign: "center",
1381
+ lineHeight: "normal",
1382
+ height: "auto",
1383
+ minHeight: "20px",
1384
+ minWidth: "20px",
1385
+ overflow: "hidden"
1386
+ }
1387
+ },
1388
+ component: {
1389
+ name: "Image",
1390
+ options: {
1391
+ image: "https://builder.io/api/v1/image/assets%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d",
1392
+ backgroundPosition: "center",
1393
+ backgroundSize: "cover",
1394
+ aspectRatio: 0.7004048582995948
1395
+ }
1396
+ }
1397
+ }, {
1398
+ "@type": "@builder.io/sdk:Element",
1399
+ responsiveStyles: {
1400
+ large: {
1401
+ display: "flex",
1402
+ flexDirection: "column",
1403
+ alignItems: "stretch",
1404
+ flexShrink: "0",
1405
+ position: "relative",
1406
+ marginTop: "30px",
1407
+ textAlign: "center",
1408
+ lineHeight: "normal",
1409
+ height: "auto"
1410
+ }
1411
+ },
1412
+ component: {
1413
+ name: "Text",
1414
+ options: {
1415
+ text: "<p>Enter some text...</p>"
1416
+ }
1417
+ }
1418
+ }]
1419
+ }],
1420
+ onChange: (e) => {
1421
+ function t() {
1422
+ n.forEach((i) => {
1423
+ i.delete("width");
1424
+ });
1425
+ }
1426
+ const n = e.get("columns");
1427
+ Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((s, c) => s + c.get("width"), 0) !== 100) && t();
1428
+ }
1429
+ }, {
1430
+ name: "space",
1431
+ type: "number",
1432
+ defaultValue: 20,
1433
+ helperText: "Size of gap between columns",
1434
+ advanced: !0
1435
+ }, {
1436
+ name: "stackColumnsAt",
1437
+ type: "string",
1438
+ defaultValue: "tablet",
1439
+ helperText: "Convert horizontal columns to vertical at what device size",
1440
+ enum: ["tablet", "mobile", "never"],
1441
+ advanced: !0
1442
+ }, {
1443
+ name: "reverseColumnsWhenStacked",
1444
+ type: "boolean",
1445
+ defaultValue: !1,
1446
+ helperText: "When stacking columns for mobile devices, reverse the ordering",
1447
+ advanced: !0
1448
+ }]
1449
+ }, Nt = {
1450
+ name: "Fragment",
1451
+ static: !0,
1452
+ hidden: !0,
1453
+ canHaveChildren: !0,
1454
+ noWrap: !0
1455
+ }, $t = {
1456
+ name: "Image",
1457
+ static: !0,
1458
+ 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",
1459
+ defaultStyles: {
1460
+ position: "relative",
1461
+ minHeight: "20px",
1462
+ minWidth: "20px",
1463
+ overflow: "hidden"
1464
+ },
1465
+ canHaveChildren: !0,
1466
+ inputs: [{
1467
+ name: "image",
1468
+ type: "file",
1469
+ bubble: !0,
1470
+ allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
1471
+ required: !0,
1472
+ defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
1473
+ onChange: (e) => {
1474
+ e.delete("srcset"), e.delete("noWebp");
1475
+ function n(r, s = 6e4) {
1476
+ return new Promise((c, d) => {
1477
+ const u = document.createElement("img");
1478
+ let x = !1;
1479
+ u.onload = () => {
1480
+ x = !0, c(u);
1481
+ }, u.addEventListener("error", (C) => {
1482
+ console.warn("Image load failed", C.error), d(C.error);
1483
+ }), u.src = r, setTimeout(() => {
1484
+ x || d(new Error("Image load timed out"));
1485
+ }, s);
1486
+ });
1487
+ }
1488
+ function i(r) {
1489
+ return Math.round(r * 1e3) / 1e3;
1490
+ }
1491
+ const o = e.get("image"), a = e.get("aspectRatio");
1492
+ if (fetch(o).then((r) => r.blob()).then((r) => {
1493
+ r.type.includes("svg") && e.set("noWebp", !0);
1494
+ }), o && (!a || a === 0.7041))
1495
+ return n(o).then((r) => {
1496
+ const s = e.get("aspectRatio");
1497
+ e.get("image") === o && (!s || s === 0.7041) && r.width && r.height && (e.set("aspectRatio", i(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
1498
+ });
1499
+ }
1500
+ }, {
1501
+ name: "backgroundSize",
1502
+ type: "text",
1503
+ defaultValue: "cover",
1504
+ enum: [{
1505
+ label: "contain",
1506
+ value: "contain",
1507
+ helperText: "The image should never get cropped"
1508
+ }, {
1509
+ label: "cover",
1510
+ value: "cover",
1511
+ helperText: "The image should fill it's box, cropping when needed"
1512
+ }]
1513
+ }, {
1514
+ name: "backgroundPosition",
1515
+ type: "text",
1516
+ defaultValue: "center",
1517
+ enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
1518
+ }, {
1519
+ name: "altText",
1520
+ type: "string",
1521
+ helperText: "Text to display when the user has images off"
1522
+ }, {
1523
+ name: "height",
1524
+ type: "number",
1525
+ hideFromUI: !0
1526
+ }, {
1527
+ name: "width",
1528
+ type: "number",
1529
+ hideFromUI: !0
1530
+ }, {
1531
+ name: "sizes",
1532
+ type: "string",
1533
+ hideFromUI: !0
1534
+ }, {
1535
+ name: "srcset",
1536
+ type: "string",
1537
+ hideFromUI: !0
1538
+ }, {
1539
+ name: "lazy",
1540
+ type: "boolean",
1541
+ defaultValue: !0,
1542
+ hideFromUI: !0
1543
+ }, {
1544
+ name: "fitContent",
1545
+ type: "boolean",
1546
+ helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
1547
+ defaultValue: !0
1548
+ }, {
1549
+ name: "aspectRatio",
1550
+ type: "number",
1551
+ 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",
1552
+ advanced: !0,
1553
+ defaultValue: 0.7041
1554
+ }]
1555
+ }, Lt = {
1556
+ name: "Core:Section",
1557
+ static: !0,
1558
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
1559
+ inputs: [{
1560
+ name: "maxWidth",
1561
+ type: "number",
1562
+ defaultValue: 1200
1563
+ }, {
1564
+ name: "lazyLoad",
1565
+ type: "boolean",
1566
+ defaultValue: !1,
1567
+ advanced: !0,
1568
+ description: "Only render this section when in view"
1569
+ }],
1570
+ defaultStyles: {
1571
+ paddingLeft: "20px",
1572
+ paddingRight: "20px",
1573
+ paddingTop: "50px",
1574
+ paddingBottom: "50px",
1575
+ marginTop: "0px",
1576
+ width: "100vw",
1577
+ marginLeft: "calc(50% - 50vw)"
1578
+ },
1579
+ canHaveChildren: !0,
1580
+ defaultChildren: [{
1581
+ "@type": "@builder.io/sdk:Element",
1582
+ responsiveStyles: {
1583
+ large: {
1584
+ textAlign: "center"
1585
+ }
1586
+ },
1587
+ component: {
1588
+ name: "Text",
1589
+ options: {
1590
+ 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>"
1591
+ }
1592
+ }
1593
+ }]
1594
+ }, Dt = {
1595
+ name: "Slot",
1596
+ isRSC: !0,
1597
+ description: "Allow child blocks to be inserted into this content when used as a Symbol",
1598
+ docsLink: "https://www.builder.io/c/docs/symbols-with-blocks",
1599
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F3aad6de36eae43b59b52c85190fdef56",
1600
+ // Maybe wrap this for canHaveChildren so bind children to this hm
1601
+ inputs: [{
1602
+ name: "name",
1603
+ type: "string",
1604
+ required: !0,
1605
+ defaultValue: "children"
1606
+ }]
1607
+ };
1608
+ function Mt(e) {
1609
+ var t, n, i;
1610
+ return /* @__PURE__ */ l(
1611
+ "div",
1612
+ {
1613
+ style: {
1614
+ pointerEvents: "auto"
1615
+ },
1616
+ ...!((t = e.builderContext.context) != null && t.symbolId) && {
1617
+ "builder-slot": e.name
1618
+ },
1619
+ children: /* @__PURE__ */ l(
1620
+ j,
1621
+ {
1622
+ parent: (n = e.builderContext.context) == null ? void 0 : n.symbolId,
1623
+ path: `symbol.data.${e.name}`,
1624
+ context: e.builderContext,
1625
+ blocks: (i = e.builderContext.rootState) == null ? void 0 : i[e.name]
1626
+ }
1627
+ )
1628
+ }
1629
+ );
1630
+ }
1631
+ const Ot = {
1632
+ name: "Symbol",
1633
+ noWrap: !0,
1634
+ static: !0,
1635
+ isRSC: !0,
1636
+ inputs: [{
1637
+ name: "symbol",
1638
+ type: "uiSymbol"
1639
+ }, {
1640
+ name: "dataOnly",
1641
+ helperText: "Make this a data symbol that doesn't display any UI",
1642
+ type: "boolean",
1643
+ defaultValue: !1,
1644
+ advanced: !0,
1645
+ hideFromUI: !0
1646
+ }, {
1647
+ name: "inheritState",
1648
+ helperText: "Inherit the parent component state and data",
1649
+ type: "boolean",
1650
+ defaultValue: !1,
1651
+ advanced: !0
1652
+ }, {
1653
+ name: "renderToLiquid",
1654
+ helperText: "Render this symbols contents to liquid. Turn off to fetch with javascript and use custom targeting",
1655
+ type: "boolean",
1656
+ defaultValue: !1,
1657
+ advanced: !0,
1658
+ hideFromUI: !0
1659
+ }, {
1660
+ name: "useChildren",
1661
+ hideFromUI: !0,
1662
+ type: "boolean"
1663
+ }]
1664
+ }, jt = {
1665
+ name: "Text",
1666
+ static: !0,
1667
+ isRSC: !0,
1668
+ 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",
1669
+ inputs: [{
1670
+ name: "text",
1671
+ type: "html",
1672
+ required: !0,
1673
+ autoFocus: !0,
1674
+ bubble: !0,
1675
+ defaultValue: "Enter some text..."
1676
+ }],
1677
+ defaultStyles: {
1678
+ lineHeight: "normal",
1679
+ height: "auto",
1680
+ textAlign: "center"
1681
+ }
1682
+ };
1683
+ function Ut(e) {
1684
+ var t;
1685
+ return /* @__PURE__ */ l(
1686
+ "div",
1687
+ {
1688
+ className: "builder-text",
1689
+ dangerouslySetInnerHTML: { __html: ((t = e.text) == null ? void 0 : t.toString()) || "" },
1690
+ style: {
1691
+ outline: "none"
1692
+ }
1693
+ }
1694
+ );
1695
+ }
1696
+ const Ht = {
1697
+ name: "Custom Code",
1698
+ static: !0,
1699
+ requiredPermissions: ["editCode"],
1700
+ inputs: [{
1701
+ name: "code",
1702
+ type: "html",
1703
+ required: !0,
1704
+ defaultValue: "<p>Hello there, I am custom HTML code!</p>",
1705
+ code: !0
1706
+ }, {
1707
+ name: "replaceNodes",
1708
+ type: "boolean",
1709
+ helperText: "Preserve server rendered dom nodes",
1710
+ advanced: !0
1711
+ }, {
1712
+ name: "scriptsClientOnly",
1713
+ type: "boolean",
1714
+ defaultValue: !1,
1715
+ helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
1716
+ advanced: !0
1717
+ }]
1718
+ };
1719
+ function _t(e) {
1720
+ const t = ee(null), [n, i] = v(() => []), [o, a] = v(() => []);
1721
+ return V(() => {
1722
+ var s;
1723
+ if (!((s = t.current) != null && s.getElementsByTagName) || typeof window == "undefined")
1724
+ return;
1725
+ const r = t.current.getElementsByTagName("script");
1726
+ for (let c = 0; c < r.length; c++) {
1727
+ const d = r[c];
1728
+ if (d.src) {
1729
+ if (n.includes(d.src))
1730
+ continue;
1731
+ n.push(d.src);
1732
+ const u = document.createElement("script");
1733
+ u.async = !0, u.src = d.src, document.head.appendChild(u);
1734
+ } else if (!d.type || [
1735
+ "text/javascript",
1736
+ "application/javascript",
1737
+ "application/ecmascript"
1738
+ ].includes(d.type)) {
1739
+ if (o.includes(d.innerText))
1740
+ continue;
1741
+ try {
1742
+ o.push(d.innerText), new Function(d.innerText)();
1743
+ } catch (u) {
1744
+ console.warn("`CustomCode`: Error running script:", u);
1745
+ }
1746
+ }
1747
+ }
1748
+ }, []), /* @__PURE__ */ l(
1749
+ "div",
1750
+ {
1751
+ ref: t,
1752
+ className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
1753
+ dangerouslySetInnerHTML: { __html: e.code }
1754
+ }
1755
+ );
1756
+ }
1757
+ const Kt = {
1758
+ name: "Embed",
1759
+ static: !0,
1760
+ inputs: [{
1761
+ name: "url",
1762
+ type: "url",
1763
+ required: !0,
1764
+ defaultValue: "",
1765
+ helperText: "e.g. enter a youtube url, google map, etc",
1766
+ onChange: (e) => {
1767
+ const t = e.get("url");
1768
+ if (t)
1769
+ return e.set("content", "Loading..."), fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then((i) => i.json()).then((i) => {
1770
+ e.get("url") === t && (i.html ? e.set("content", i.html) : e.set("content", "Invalid url, please try another"));
1771
+ }).catch((i) => {
1772
+ e.set("content", "There was an error embedding this URL, please try again or another URL");
1773
+ });
1774
+ e.delete("content");
1775
+ }
1776
+ }, {
1777
+ name: "content",
1778
+ type: "html",
1779
+ defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1780
+ hideFromUI: !0
1781
+ }]
1782
+ }, qt = ["text/javascript", "application/javascript", "application/ecmascript"], zt = (e) => qt.includes(e.type);
1783
+ function Jt(e) {
1784
+ const t = ee(null), [n, i] = v(() => []), [o, a] = v(() => []), [r, s] = v(() => !1);
1785
+ function c() {
1786
+ if (!t.current || !t.current.getElementsByTagName)
1787
+ return;
1788
+ const d = t.current.getElementsByTagName("script");
1789
+ for (let u = 0; u < d.length; u++) {
1790
+ const x = d[u];
1791
+ if (x.src && !n.includes(x.src)) {
1792
+ n.push(x.src);
1793
+ const C = document.createElement("script");
1794
+ C.async = !0, C.src = x.src, document.head.appendChild(C);
1795
+ } else if (zt(x) && !o.includes(x.innerText))
1796
+ try {
1797
+ o.push(x.innerText), new Function(x.innerText)();
1798
+ } catch (C) {
1799
+ console.warn("`Embed`: Error running script:", C);
1800
+ }
1801
+ }
1802
+ }
1803
+ return V(() => {
1804
+ t.current && !r && (s(!0), c());
1805
+ }, [t.current, r]), /* @__PURE__ */ l(
1806
+ "div",
1807
+ {
1808
+ className: "builder-embed",
1809
+ ref: t,
1810
+ dangerouslySetInnerHTML: { __html: e.content }
1811
+ }
1812
+ );
1813
+ }
1814
+ const Yt = {
1815
+ name: "Form:Form",
1816
+ // editableTags: ['builder-form-error']
1817
+ defaults: {
1818
+ responsiveStyles: {
1819
+ large: {
1820
+ marginTop: "15px",
1821
+ paddingBottom: "15px"
1822
+ }
1823
+ }
1824
+ },
1825
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fef36d2a846134910b64b88e6d18c5ca5",
1826
+ inputs: [{
1827
+ name: "sendSubmissionsTo",
1828
+ type: "string",
1829
+ // TODO: save to builder data and user can download as csv
1830
+ // TODO: easy for mode too or computed add/remove fields form mode
1831
+ // so you can edit details and high level mode at same time...
1832
+ // Later - more integrations like mailchimp
1833
+ // /api/v1/form-submit?to=mailchimp
1834
+ enum: [{
1835
+ label: "Send to email",
1836
+ value: "email",
1837
+ helperText: "Send form submissions to the email address of your choosing"
1838
+ }, {
1839
+ label: "Custom",
1840
+ value: "custom",
1841
+ helperText: "Handle where the form requests go manually with a little code, e.g. to your own custom backend"
1842
+ }],
1843
+ defaultValue: "email"
1844
+ }, {
1845
+ name: "sendSubmissionsToEmail",
1846
+ type: "string",
1847
+ required: !0,
1848
+ // TODO: required: () => options.get("sendSubmissionsTo") === "email"
1849
+ defaultValue: "your@email.com",
1850
+ showIf: 'options.get("sendSubmissionsTo") === "email"'
1851
+ }, {
1852
+ name: "sendWithJs",
1853
+ type: "boolean",
1854
+ helperText: "Set to false to use basic html form action",
1855
+ defaultValue: !0,
1856
+ showIf: 'options.get("sendSubmissionsTo") === "custom"'
1857
+ }, {
1858
+ name: "name",
1859
+ type: "string",
1860
+ defaultValue: "My form"
1861
+ // advanced: true
1862
+ }, {
1863
+ name: "action",
1864
+ type: "string",
1865
+ helperText: "URL to send the form data to",
1866
+ showIf: 'options.get("sendSubmissionsTo") === "custom"'
1867
+ }, {
1868
+ name: "contentType",
1869
+ type: "string",
1870
+ defaultValue: "application/json",
1871
+ advanced: !0,
1872
+ // TODO: do automatically if file input
1873
+ enum: ["application/json", "multipart/form-data", "application/x-www-form-urlencoded"],
1874
+ showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
1875
+ }, {
1876
+ name: "method",
1877
+ type: "string",
1878
+ showIf: 'options.get("sendSubmissionsTo") === "custom"',
1879
+ defaultValue: "POST",
1880
+ advanced: !0
1881
+ }, {
1882
+ name: "previewState",
1883
+ type: "string",
1884
+ // TODO: persist: false flag
1885
+ enum: ["unsubmitted", "sending", "success", "error"],
1886
+ defaultValue: "unsubmitted",
1887
+ helperText: 'Choose a state to edit, e.g. choose "success" to show what users see on success and edit the message',
1888
+ showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
1889
+ }, {
1890
+ name: "successUrl",
1891
+ type: "url",
1892
+ helperText: "Optional URL to redirect the user to on form submission success",
1893
+ showIf: 'options.get("sendSubmissionsTo") !== "zapier" && options.get("sendWithJs") === true'
1894
+ }, {
1895
+ name: "resetFormOnSubmit",
1896
+ type: "boolean",
1897
+ showIf: "options.get('sendSubmissionsTo') === 'custom' && options.get('sendWithJs') === true",
1898
+ advanced: !0
1899
+ }, {
1900
+ name: "successMessage",
1901
+ type: "uiBlocks",
1902
+ hideFromUI: !0,
1903
+ defaultValue: [{
1904
+ "@type": "@builder.io/sdk:Element",
1905
+ responsiveStyles: {
1906
+ large: {
1907
+ marginTop: "10px"
1908
+ }
1909
+ },
1910
+ component: {
1911
+ name: "Text",
1912
+ options: {
1913
+ text: "<span>Thanks!</span>"
1914
+ }
1915
+ }
1916
+ }]
1917
+ }, {
1918
+ name: "validate",
1919
+ type: "boolean",
1920
+ defaultValue: !0,
1921
+ advanced: !0
1922
+ }, {
1923
+ name: "errorMessagePath",
1924
+ type: "text",
1925
+ advanced: !0,
1926
+ helperText: 'Path to where to get the error message from in a JSON response to display to the user, e.g. "error.message" for a response like { "error": { "message": "this username is taken" }}'
1927
+ }, {
1928
+ name: "errorMessage",
1929
+ type: "uiBlocks",
1930
+ hideFromUI: !0,
1931
+ defaultValue: [{
1932
+ "@type": "@builder.io/sdk:Element",
1933
+ responsiveStyles: {
1934
+ large: {
1935
+ marginTop: "10px"
1936
+ }
1937
+ },
1938
+ bindings: {
1939
+ "component.options.text": "state.formErrorMessage || block.component.options.text"
1940
+ },
1941
+ component: {
1942
+ name: "Text",
1943
+ options: {
1944
+ text: "<span>Form submission error :( Please check your answers and try again</span>"
1945
+ }
1946
+ }
1947
+ }]
1948
+ }, {
1949
+ name: "sendingMessage",
1950
+ type: "uiBlocks",
1951
+ hideFromUI: !0,
1952
+ defaultValue: [{
1953
+ "@type": "@builder.io/sdk:Element",
1954
+ responsiveStyles: {
1955
+ large: {
1956
+ marginTop: "10px"
1957
+ }
1958
+ },
1959
+ component: {
1960
+ name: "Text",
1961
+ options: {
1962
+ text: "<span>Sending...</span>"
1963
+ }
1964
+ }
1965
+ }]
1966
+ }, {
1967
+ name: "customHeaders",
1968
+ type: "map",
1969
+ valueType: {
1970
+ type: "string"
1971
+ },
1972
+ advanced: !0,
1973
+ showIf: 'options.get("sendSubmissionsTo") === "custom" && options.get("sendWithJs") === true'
1974
+ }],
1975
+ noWrap: !0,
1976
+ canHaveChildren: !0,
1977
+ defaultChildren: [{
1978
+ "@type": "@builder.io/sdk:Element",
1979
+ responsiveStyles: {
1980
+ large: {
1981
+ marginTop: "10px"
1982
+ }
1983
+ },
1984
+ component: {
1985
+ name: "Text",
1986
+ options: {
1987
+ text: "<span>Enter your name</span>"
1988
+ }
1989
+ }
1990
+ }, {
1991
+ "@type": "@builder.io/sdk:Element",
1992
+ responsiveStyles: {
1993
+ large: {
1994
+ marginTop: "10px"
1995
+ }
1996
+ },
1997
+ component: {
1998
+ name: "Form:Input",
1999
+ options: {
2000
+ name: "name",
2001
+ placeholder: "Jane Doe"
2002
+ }
2003
+ }
2004
+ }, {
2005
+ "@type": "@builder.io/sdk:Element",
2006
+ responsiveStyles: {
2007
+ large: {
2008
+ marginTop: "10px"
2009
+ }
2010
+ },
2011
+ component: {
2012
+ name: "Text",
2013
+ options: {
2014
+ text: "<span>Enter your email</span>"
2015
+ }
2016
+ }
2017
+ }, {
2018
+ "@type": "@builder.io/sdk:Element",
2019
+ responsiveStyles: {
2020
+ large: {
2021
+ marginTop: "10px"
2022
+ }
2023
+ },
2024
+ component: {
2025
+ name: "Form:Input",
2026
+ options: {
2027
+ name: "email",
2028
+ placeholder: "jane@doe.com"
2029
+ }
2030
+ }
2031
+ }, {
2032
+ "@type": "@builder.io/sdk:Element",
2033
+ responsiveStyles: {
2034
+ large: {
2035
+ marginTop: "10px"
2036
+ }
2037
+ },
2038
+ component: {
2039
+ name: "Form:SubmitButton",
2040
+ options: {
2041
+ text: "Submit"
2042
+ }
2043
+ }
2044
+ }]
2045
+ }, Gt = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"], Qt = () => {
2046
+ const e = process.env.NODE_ENV || "production";
2047
+ return Gt.includes(e) ? e : "production";
2048
+ }, Xt = (e, t, n) => {
2049
+ const i = String.prototype.split.call(t, /[,[\].]+?/).filter(Boolean).reduce((o, a) => o != null ? o[a] : o, e);
2050
+ return i === void 0 || i === e ? n : i;
2051
+ };
2052
+ function Zt(e) {
2053
+ var x, C;
2054
+ const t = ee(null), [n, i] = v(() => "unsubmitted"), [o, a] = v(() => null), [r, s] = v(() => "");
2055
+ function c(f) {
2056
+ var p, E;
2057
+ const y = {
2058
+ ...e.builderContext.rootState,
2059
+ ...f
2060
+ };
2061
+ e.builderContext.rootSetState ? (E = (p = e.builderContext).rootSetState) == null || E.call(p, y) : e.builderContext.rootState = y;
2062
+ }
2063
+ function d() {
2064
+ return M() && e.previewState || n;
2065
+ }
2066
+ function u(f) {
2067
+ var p;
2068
+ const y = e.sendWithJs || e.sendSubmissionsTo === "email";
2069
+ if (e.sendSubmissionsTo === "zapier")
2070
+ f.preventDefault();
2071
+ else if (y) {
2072
+ if (!(e.action || e.sendSubmissionsTo === "email")) {
2073
+ f.preventDefault();
2074
+ return;
2075
+ }
2076
+ f.preventDefault();
2077
+ const E = f.currentTarget, A = e.customHeaders || {};
2078
+ let k;
2079
+ const I = new FormData(E), B = Array.from(
2080
+ f.currentTarget.querySelectorAll("input,select,textarea")
2081
+ ).filter((h) => !!h.name).map((h) => {
2082
+ let T;
2083
+ const D = h.name;
2084
+ if (h instanceof HTMLInputElement)
2085
+ if (h.type === "radio") {
2086
+ if (h.checked)
2087
+ return T = h.name, {
2088
+ key: D,
2089
+ value: T
2090
+ };
2091
+ } else if (h.type === "checkbox")
2092
+ T = h.checked;
2093
+ else if (h.type === "number" || h.type === "range") {
2094
+ const W = h.valueAsNumber;
2095
+ isNaN(W) || (T = W);
2096
+ } else
2097
+ h.type === "file" ? T = h.files : T = h.value;
2098
+ else
2099
+ T = h.value;
2100
+ return {
2101
+ key: D,
2102
+ value: T
2103
+ };
2104
+ });
2105
+ let P = e.contentType;
2106
+ if (e.sendSubmissionsTo === "email" && (P = "multipart/form-data"), Array.from(B).forEach(({ value: h }) => {
2107
+ (h instanceof File || Array.isArray(h) && h[0] instanceof File || h instanceof FileList) && (P = "multipart/form-data");
2108
+ }), P !== "application/json")
2109
+ k = I;
2110
+ else {
2111
+ const h = {};
2112
+ Array.from(B).forEach(({ value: T, key: D }) => {
2113
+ Pe(h, D, T);
2114
+ }), k = JSON.stringify(h);
2115
+ }
2116
+ P && P !== "multipart/form-data" && (y && ((p = e.action) != null && p.includes("zapier.com")) || (A["content-type"] = P));
2117
+ const $ = new CustomEvent("presubmit", { detail: { body: k } });
2118
+ if (t.current && (t.current.dispatchEvent($), $.defaultPrevented))
2119
+ return;
2120
+ i("sending");
2121
+ const L = `${Qt() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
2122
+ e.sendSubmissionsToEmail || ""
2123
+ )}&name=${encodeURIComponent(e.name || "")}`;
2124
+ fetch(
2125
+ e.sendSubmissionsTo === "email" ? L : e.action,
2126
+ { body: k, headers: A, method: e.method || "post" }
2127
+ ).then(
2128
+ async (h) => {
2129
+ let T;
2130
+ const D = h.headers.get("content-type");
2131
+ if (D && D.indexOf("application/json") !== -1 ? T = await h.json() : T = await h.text(), !h.ok && e.errorMessagePath) {
2132
+ let W = Xt(T, e.errorMessagePath);
2133
+ W && (typeof W != "string" && (W = JSON.stringify(W)), s(W), c({ formErrorMessage: W }));
2134
+ }
2135
+ if (a(T), i(h.ok ? "success" : "error"), h.ok) {
2136
+ const W = new CustomEvent("submit:success", {
2137
+ detail: { res: h, body: T }
2138
+ });
2139
+ if (t.current) {
2140
+ if (t.current.dispatchEvent(W), W.defaultPrevented)
2141
+ return;
2142
+ e.resetFormOnSubmit !== !1 && t.current.reset();
2143
+ }
2144
+ if (e.successUrl)
2145
+ if (t.current) {
2146
+ const H = new CustomEvent("route", {
2147
+ detail: { url: e.successUrl }
2148
+ });
2149
+ t.current.dispatchEvent(H), H.defaultPrevented || (location.href = e.successUrl);
2150
+ } else
2151
+ location.href = e.successUrl;
2152
+ }
2153
+ },
2154
+ (h) => {
2155
+ const T = new CustomEvent("submit:error", {
2156
+ detail: { error: h }
2157
+ });
2158
+ t.current && (t.current.dispatchEvent(T), T.defaultPrevented) || (a(h), i("error"));
2159
+ }
2160
+ );
2161
+ }
2162
+ }
2163
+ return /* @__PURE__ */ F(m, { children: [
2164
+ " ",
2165
+ /* @__PURE__ */ F(
2166
+ "form",
2167
+ {
2168
+ validate: e.validate,
2169
+ ref: t,
2170
+ action: !e.sendWithJs && e.action,
2171
+ method: e.method,
2172
+ name: e.name,
2173
+ onSubmit: (f) => u(f),
2174
+ ...e.attributes,
2175
+ children: [
2176
+ " ",
2177
+ e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ l(m, { children: (C = (x = e.builderBlock) == null ? void 0 : x.children) == null ? void 0 : C.map((f, y) => /* @__PURE__ */ l(
2178
+ J,
2179
+ {
2180
+ block: f,
2181
+ context: e.builderContext,
2182
+ registeredComponents: e.builderComponents,
2183
+ linkComponent: e.builderLinkComponent
2184
+ },
2185
+ `form-block-${y}`
2186
+ )) }) : null,
2187
+ " ",
2188
+ d() === "error" ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(
2189
+ j,
2190
+ {
2191
+ path: "errorMessage",
2192
+ blocks: e.errorMessage,
2193
+ context: e.builderContext
2194
+ }
2195
+ ) }) : null,
2196
+ " ",
2197
+ d() === "sending" ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(
2198
+ j,
2199
+ {
2200
+ path: "sendingMessage",
2201
+ blocks: e.sendingMessage,
2202
+ context: e.builderContext
2203
+ }
2204
+ ) }) : null,
2205
+ " ",
2206
+ d() === "error" && o ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ F("pre", { className: "builder-form-error-text pre-25b9edf0", children: [
2207
+ " ",
2208
+ JSON.stringify(o, null, 2),
2209
+ " "
2210
+ ] }) }) : null,
2211
+ " ",
2212
+ d() === "success" ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(
2213
+ j,
2214
+ {
2215
+ path: "successMessage",
2216
+ blocks: e.successMessage,
2217
+ context: e.builderContext
2218
+ }
2219
+ ) }) : null,
2220
+ " "
2221
+ ]
2222
+ }
2223
+ ),
2224
+ " ",
2225
+ /* @__PURE__ */ l("style", { children: ".pre-25b9edf0 { padding: 10px; color: red; text-align: center; }" }),
2226
+ " "
2227
+ ] });
2228
+ }
2229
+ const en = {
2230
+ name: "Form:Input",
2231
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
2232
+ inputs: [
2233
+ {
2234
+ name: "type",
2235
+ type: "text",
2236
+ enum: ["text", "number", "email", "url", "checkbox", "radio", "range", "date", "datetime-local", "search", "tel", "time", "file", "month", "week", "password", "color", "hidden"],
2237
+ defaultValue: "text"
2238
+ },
2239
+ {
2240
+ name: "name",
2241
+ type: "string",
2242
+ required: !0,
2243
+ helperText: 'Every input in a form needs a unique name describing what it takes, e.g. "email"'
2244
+ },
2245
+ {
2246
+ name: "placeholder",
2247
+ type: "string",
2248
+ defaultValue: "Hello there",
2249
+ helperText: "Text to display when there is no value"
2250
+ },
2251
+ // TODO: handle value vs default value automatically like ng-model
2252
+ {
2253
+ name: "defaultValue",
2254
+ type: "string"
2255
+ },
2256
+ {
2257
+ name: "value",
2258
+ type: "string",
2259
+ advanced: !0
2260
+ },
2261
+ {
2262
+ name: "required",
2263
+ type: "boolean",
2264
+ helperText: "Is this input required to be filled out to submit a form",
2265
+ defaultValue: !1
2266
+ }
2267
+ ],
2268
+ noWrap: !0,
2269
+ static: !0,
2270
+ defaultStyles: {
2271
+ paddingTop: "10px",
2272
+ paddingBottom: "10px",
2273
+ paddingLeft: "10px",
2274
+ paddingRight: "10px",
2275
+ borderRadius: "3px",
2276
+ borderWidth: "1px",
2277
+ borderStyle: "solid",
2278
+ borderColor: "#ccc"
2279
+ }
2280
+ };
2281
+ function tn(e) {
2282
+ return /* @__PURE__ */ re(
2283
+ "input",
2284
+ {
2285
+ ...e.attributes,
2286
+ key: M() && e.defaultValue ? e.defaultValue : "default-key",
2287
+ placeholder: e.placeholder,
2288
+ type: e.type,
2289
+ name: e.name,
2290
+ value: e.value,
2291
+ defaultValue: e.defaultValue,
2292
+ required: e.required
2293
+ }
2294
+ );
2295
+ }
2296
+ const nn = {
2297
+ name: "Form:Select",
2298
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
2299
+ defaultStyles: {
2300
+ alignSelf: "flex-start"
2301
+ },
2302
+ inputs: [{
2303
+ name: "options",
2304
+ type: "list",
2305
+ required: !0,
2306
+ subFields: [{
2307
+ name: "value",
2308
+ type: "text",
2309
+ required: !0
2310
+ }, {
2311
+ name: "name",
2312
+ type: "text"
2313
+ }],
2314
+ defaultValue: [{
2315
+ value: "option 1"
2316
+ }, {
2317
+ value: "option 2"
2318
+ }]
2319
+ }, {
2320
+ name: "name",
2321
+ type: "string",
2322
+ required: !0,
2323
+ helperText: 'Every select in a form needs a unique name describing what it gets, e.g. "email"'
2324
+ }, {
2325
+ name: "defaultValue",
2326
+ type: "string"
2327
+ }, {
2328
+ name: "value",
2329
+ type: "string",
2330
+ advanced: !0
2331
+ }, {
2332
+ name: "required",
2333
+ type: "boolean",
2334
+ defaultValue: !1
2335
+ }],
2336
+ static: !0,
2337
+ noWrap: !0
2338
+ };
2339
+ function on(e) {
2340
+ var t;
2341
+ return /* @__PURE__ */ re(
2342
+ "select",
2343
+ {
2344
+ ...e.attributes,
2345
+ value: e.value,
2346
+ key: M() && e.defaultValue ? e.defaultValue : "default-key",
2347
+ defaultValue: e.defaultValue,
2348
+ name: e.name
2349
+ },
2350
+ (t = e.options) == null ? void 0 : t.map((n) => /* @__PURE__ */ l("option", { value: n.value, children: n.name || n.value }))
2351
+ );
2352
+ }
2353
+ const an = {
2354
+ name: "Form:SubmitButton",
2355
+ image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
2356
+ defaultStyles: {
2357
+ appearance: "none",
2358
+ paddingTop: "15px",
2359
+ paddingBottom: "15px",
2360
+ paddingLeft: "25px",
2361
+ paddingRight: "25px",
2362
+ backgroundColor: "#3898EC",
2363
+ color: "white",
2364
+ borderRadius: "4px",
2365
+ cursor: "pointer"
2366
+ },
2367
+ inputs: [{
2368
+ name: "text",
2369
+ type: "text",
2370
+ defaultValue: "Click me"
2371
+ }],
2372
+ static: !0,
2373
+ noWrap: !0
2374
+ // TODO: optional children? maybe as optional form input
2375
+ // that only shows if advanced setting is flipped
2376
+ // TODO: defaultChildren
2377
+ // canHaveChildren: true,
2378
+ };
2379
+ function rn(e) {
2380
+ return /* @__PURE__ */ l("button", { type: "submit", ...e.attributes, children: e.text });
2381
+ }
2382
+ const ln = {
2383
+ // friendlyName?
2384
+ name: "Raw:Img",
2385
+ hideFromInsertMenu: !0,
2386
+ 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",
2387
+ inputs: [{
2388
+ name: "image",
2389
+ bubble: !0,
2390
+ type: "file",
2391
+ allowedFileTypes: ["jpeg", "jpg", "png", "svg", "gif", "webp"],
2392
+ required: !0
2393
+ }],
2394
+ noWrap: !0,
2395
+ static: !0
2396
+ };
2397
+ function sn(e) {
2398
+ return /* @__PURE__ */ l(
2399
+ "img",
2400
+ {
2401
+ style: {
2402
+ objectFit: e.backgroundSize || "cover",
2403
+ objectPosition: e.backgroundPosition || "center"
2404
+ },
2405
+ alt: e.altText,
2406
+ src: e.imgSrc || e.image,
2407
+ ...e.attributes
2408
+ },
2409
+ M() && e.imgSrc || "default-key"
2410
+ );
2411
+ }
2412
+ const cn = {
2413
+ name: "Video",
2414
+ canHaveChildren: !0,
2415
+ defaultStyles: {
2416
+ minHeight: "20px",
2417
+ minWidth: "20px"
2418
+ },
2419
+ 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",
2420
+ inputs: [{
2421
+ name: "video",
2422
+ type: "file",
2423
+ allowedFileTypes: ["mp4"],
2424
+ bubble: !0,
2425
+ defaultValue: "https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",
2426
+ required: !0
2427
+ }, {
2428
+ name: "posterImage",
2429
+ type: "file",
2430
+ allowedFileTypes: ["jpeg", "png"],
2431
+ helperText: "Image to show before the video plays"
2432
+ }, {
2433
+ name: "autoPlay",
2434
+ type: "boolean",
2435
+ defaultValue: !0
2436
+ }, {
2437
+ name: "controls",
2438
+ type: "boolean",
2439
+ defaultValue: !1
2440
+ }, {
2441
+ name: "muted",
2442
+ type: "boolean",
2443
+ defaultValue: !0
2444
+ }, {
2445
+ name: "loop",
2446
+ type: "boolean",
2447
+ defaultValue: !0
2448
+ }, {
2449
+ name: "playsInline",
2450
+ type: "boolean",
2451
+ defaultValue: !0
2452
+ }, {
2453
+ name: "fit",
2454
+ type: "text",
2455
+ defaultValue: "cover",
2456
+ enum: ["contain", "cover", "fill", "auto"]
2457
+ }, {
2458
+ name: "preload",
2459
+ type: "text",
2460
+ defaultValue: "metadata",
2461
+ enum: ["auto", "metadata", "none"]
2462
+ }, {
2463
+ name: "fitContent",
2464
+ type: "boolean",
2465
+ helperText: "When child blocks are provided, fit to them instead of using the aspect ratio",
2466
+ defaultValue: !0,
2467
+ advanced: !0
2468
+ }, {
2469
+ name: "position",
2470
+ type: "text",
2471
+ defaultValue: "center",
2472
+ enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
2473
+ }, {
2474
+ name: "height",
2475
+ type: "number",
2476
+ advanced: !0
2477
+ }, {
2478
+ name: "width",
2479
+ type: "number",
2480
+ advanced: !0
2481
+ }, {
2482
+ name: "aspectRatio",
2483
+ type: "number",
2484
+ advanced: !0,
2485
+ defaultValue: 0.7004048582995948
2486
+ }, {
2487
+ name: "lazyLoad",
2488
+ type: "boolean",
2489
+ helperText: 'Load this video "lazily" - as in only when a user scrolls near the video. Recommended for optmized performance and bandwidth consumption',
2490
+ defaultValue: !0,
2491
+ advanced: !0
2492
+ }]
2493
+ };
2494
+ function dn(e) {
2495
+ var i, o, a, r, s, c, d;
2496
+ function t() {
2497
+ return {
2498
+ ...e.autoPlay === !0 ? {
2499
+ autoPlay: !0
2500
+ } : {},
2501
+ ...e.muted === !0 ? {
2502
+ muted: !0
2503
+ } : {},
2504
+ ...e.controls === !0 ? {
2505
+ controls: !0
2506
+ } : {},
2507
+ ...e.loop === !0 ? {
2508
+ loop: !0
2509
+ } : {},
2510
+ ...e.playsInline === !0 ? {
2511
+ playsInline: !0
2512
+ } : {}
2513
+ };
2514
+ }
2515
+ function n() {
2516
+ return {
2517
+ ...t()
2518
+ };
2519
+ }
2520
+ return /* @__PURE__ */ F(
2521
+ "div",
2522
+ {
2523
+ style: {
2524
+ position: "relative"
2525
+ },
2526
+ children: [
2527
+ /* @__PURE__ */ l(
2528
+ "video",
2529
+ {
2530
+ className: "builder-video",
2531
+ ...n(),
2532
+ preload: e.preload || "metadata",
2533
+ style: {
2534
+ width: "100%",
2535
+ height: "100%",
2536
+ ...(i = e.attributes) == null ? void 0 : i.style,
2537
+ objectFit: e.fit,
2538
+ objectPosition: e.position,
2539
+ // Hack to get object fit to work as expected and
2540
+ // not have the video overflow
2541
+ zIndex: 2,
2542
+ borderRadius: "1px",
2543
+ ...e.aspectRatio ? {
2544
+ position: "absolute"
2545
+ } : null
2546
+ },
2547
+ src: e.video || "no-src",
2548
+ poster: e.posterImage,
2549
+ children: e.lazyLoad ? null : /* @__PURE__ */ l("source", { type: "video/mp4", src: e.video })
2550
+ }
2551
+ ),
2552
+ e.aspectRatio && !(e.fitContent && ((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length)) ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(
2553
+ "div",
2554
+ {
2555
+ style: {
2556
+ width: "100%",
2557
+ paddingTop: e.aspectRatio * 100 + "%",
2558
+ pointerEvents: "none",
2559
+ fontSize: "0px"
2560
+ }
2561
+ }
2562
+ ) }) : null,
2563
+ (s = (r = e.builderBlock) == null ? void 0 : r.children) != null && s.length && e.fitContent ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(
2564
+ "div",
2565
+ {
2566
+ style: {
2567
+ display: "flex",
2568
+ flexDirection: "column",
2569
+ alignItems: "stretch"
2570
+ },
2571
+ children: e.children
2572
+ }
2573
+ ) }) : null,
2574
+ (d = (c = e.builderBlock) == null ? void 0 : c.children) != null && d.length && !e.fitContent ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(
2575
+ "div",
2576
+ {
2577
+ style: {
2578
+ pointerEvents: "none",
2579
+ display: "flex",
2580
+ flexDirection: "column",
2581
+ alignItems: "stretch",
2582
+ position: "absolute",
2583
+ top: "0",
2584
+ left: "0",
2585
+ width: "100%",
2586
+ height: "100%"
2587
+ },
2588
+ children: e.children
2589
+ }
2590
+ ) }) : null
2591
+ ]
2592
+ }
2593
+ );
2594
+ }
2595
+ const un = () => [{
2596
+ component: _t,
2597
+ ...Ht
2598
+ }, {
2599
+ component: Jt,
2600
+ ...Kt
2601
+ }, {
2602
+ component: Zt,
2603
+ ...Yt
2604
+ }, {
2605
+ component: tn,
2606
+ ...en
2607
+ }, {
2608
+ component: rn,
2609
+ ...an
2610
+ }, {
2611
+ component: on,
2612
+ ...nn
2613
+ }, {
2614
+ component: sn,
2615
+ ...ln
2616
+ }, {
2617
+ component: dn,
2618
+ ...cn
2619
+ }], ve = () => [{
2620
+ component: Ge,
2621
+ ...Wt
2622
+ }, {
2623
+ component: Et,
2624
+ ...Ft
2625
+ }, {
2626
+ component: Rt,
2627
+ ...Nt
2628
+ }, {
2629
+ component: Bt,
2630
+ ...$t
2631
+ }, {
2632
+ component: At,
2633
+ ...Lt
2634
+ }, {
2635
+ component: Mt,
2636
+ ...Dt
2637
+ }, {
2638
+ component: Bn,
2639
+ ...Ot
2640
+ }, {
2641
+ component: Ut,
2642
+ ...jt
2643
+ }, ...un()], mn = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
2644
+ function getAndSetVariantId() {
2645
+ function setCookie(name, value, days) {
2646
+ let expires = '';
2647
+ if (days) {
2648
+ const date = new Date();
2649
+ date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
2650
+ expires = '; expires=' + date.toUTCString();
2651
+ }
2652
+ document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';
2653
+ }
2654
+ function getCookie(name) {
2655
+ const nameEQ = name + '=';
2656
+ const ca = document.cookie.split(';');
2657
+ for (let i = 0; i < ca.length; i++) {
2658
+ let c = ca[i];
2659
+ while (c.charAt(0) === ' ') c = c.substring(1, c.length);
2660
+ if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
2661
+ }
2662
+ return null;
2663
+ }
2664
+ const cookieName = \`builder.tests.\${contentId}\`;
2665
+ const variantInCookie = getCookie(cookieName);
2666
+ const availableIDs = variants.map(vr => vr.id).concat(contentId);
2667
+ if (variantInCookie && availableIDs.includes(variantInCookie)) {
2668
+ return variantInCookie;
2669
+ }
2670
+ let n = 0;
2671
+ const random = Math.random();
2672
+ for (let i = 0; i < variants.length; i++) {
2673
+ const variant = variants[i];
2674
+ const testRatio = variant.testRatio;
2675
+ n += testRatio;
2676
+ if (random < n) {
2677
+ setCookie(cookieName, variant.id);
2678
+ return variant.id;
2679
+ }
2680
+ }
2681
+ setCookie(cookieName, contentId);
2682
+ return contentId;
2683
+ }
2684
+ const winningVariantId = getAndSetVariantId();
2685
+ const styleEl = document.currentScript?.previousElementSibling;
2686
+ if (isHydrationTarget) {
2687
+ styleEl.remove();
2688
+ const thisScriptEl = document.currentScript;
2689
+ thisScriptEl?.remove();
2690
+ } else {
2691
+ const newStyleStr = variants.concat({
2692
+ id: contentId
2693
+ }).filter(variant => variant.id !== winningVariantId).map(value => {
2694
+ return \`.variant-\${value.id} { display: none; }
2695
+ \`;
2696
+ }).join('');
2697
+ styleEl.innerHTML = newStyleStr;
2698
+ }
2699
+ }`, fn = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
2700
+ if (!navigator.cookieEnabled) {
2701
+ return;
2702
+ }
2703
+ function getCookie(name) {
2704
+ const nameEQ = name + '=';
2705
+ const ca = document.cookie.split(';');
2706
+ for (let i = 0; i < ca.length; i++) {
2707
+ let c = ca[i];
2708
+ while (c.charAt(0) === ' ') c = c.substring(1, c.length);
2709
+ if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
2710
+ }
2711
+ return null;
2712
+ }
2713
+ const cookieName = \`builder.tests.\${defaultContentId}\`;
2714
+ const winningVariant = getCookie(cookieName);
2715
+ const parentDiv = document.currentScript?.parentElement;
2716
+ const isDefaultContent = variantContentId === defaultContentId;
2717
+ const isWinningVariant = winningVariant === variantContentId;
2718
+ if (isWinningVariant && !isDefaultContent) {
2719
+ parentDiv?.removeAttribute('hidden');
2720
+ parentDiv?.removeAttribute('aria-hidden');
2721
+ } else if (!isWinningVariant && isDefaultContent) {
2722
+ parentDiv?.setAttribute('hidden', 'true');
2723
+ parentDiv?.setAttribute('aria-hidden', 'true');
2724
+ }
2725
+ if (isHydrationTarget) {
2726
+ if (!isWinningVariant) {
2727
+ parentDiv?.remove();
2728
+ }
2729
+ const thisScriptEl = document.currentScript;
2730
+ thisScriptEl?.remove();
2731
+ }
2732
+ return;
2733
+ }`, $e = "builderIoAbTest", Le = "builderIoRenderContent", G = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
2734
+ ...t,
2735
+ testVariationId: t.id,
2736
+ id: e == null ? void 0 : e.id
2737
+ })), hn = ({
2738
+ canTrack: e,
2739
+ content: t
2740
+ }) => !(!(G(t).length > 0) || !e || U()), gn = (e) => e === "react" || e === "reactNative", De = gn(z), bn = () => `
2741
+ window.${$e} = ${mn}
2742
+ window.${Le} = ${fn}
2743
+ `, yn = (e, t) => `
2744
+ window.${$e}(
2745
+ "${t}",${JSON.stringify(e)}, ${De}
2746
+ )`, pn = ({
2747
+ contentId: e,
2748
+ variationId: t
2749
+ }) => `window.${Le}(
2750
+ "${t}", "${e}", ${De}
2751
+ )`;
2752
+ function oe(e) {
2753
+ return /* @__PURE__ */ l(
2754
+ "script",
2755
+ {
2756
+ dangerouslySetInnerHTML: { __html: e.scriptStr },
2757
+ id: e.id || ""
2758
+ }
2759
+ );
2760
+ }
2761
+ function ke(e) {
2762
+ return Math.round(e * 1e3) / 1e3;
2763
+ }
2764
+ const xn = (e, t, n = !0) => {
2765
+ if (!(e instanceof HTMLElement))
2766
+ return null;
2767
+ let i = n ? e : e.parentElement;
2768
+ do {
2769
+ if (!i)
2770
+ return null;
2771
+ if (t(i))
2772
+ return i;
2773
+ } while (i = i.parentElement);
2774
+ return null;
2775
+ }, Sn = (e) => xn(e, (t) => {
2776
+ const n = t.getAttribute("builder-id") || t.id;
2777
+ return (n == null ? void 0 : n.indexOf("builder-")) === 0;
2778
+ }), Ce = ({
2779
+ event: e,
2780
+ target: t
2781
+ }) => {
2782
+ const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, a = ke(i / n.width), r = ke(o / n.height);
2783
+ return {
2784
+ x: a,
2785
+ y: r
2786
+ };
2787
+ }, vn = (e) => {
2788
+ const t = e.target, n = t && Sn(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2789
+ return {
2790
+ targetBuilderElement: i || void 0,
2791
+ metadata: {
2792
+ targetOffset: t ? Ce({
2793
+ event: e,
2794
+ target: t
2795
+ }) : void 0,
2796
+ builderTargetOffset: n ? Ce({
2797
+ event: e,
2798
+ target: n
2799
+ }) : void 0,
2800
+ builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
2801
+ }
2802
+ };
2803
+ };
2804
+ function kn(e) {
2805
+ var L, h, T, D, W, H, fe;
2806
+ const t = ee(null), [n, i] = v(() => 0);
2807
+ v(() => !0);
2808
+ function o(g) {
2809
+ var S, w;
2810
+ const b = {
2811
+ ...e.builderContextSignal.rootState,
2812
+ ...g
2813
+ };
2814
+ e.builderContextSignal.rootSetState ? (w = (S = e.builderContextSignal).rootSetState) == null || w.call(S, b) : e.setBuilderContextSignal((R) => ({
2815
+ ...R,
2816
+ rootState: b
2817
+ }));
2818
+ }
2819
+ function a(g) {
2820
+ var S, w, R, N, Y;
2821
+ const b = {
2822
+ ...e.builderContextSignal.content,
2823
+ ...g,
2824
+ data: {
2825
+ ...(S = e.builderContextSignal.content) == null ? void 0 : S.data,
2826
+ ...g == null ? void 0 : g.data
2827
+ },
2828
+ meta: {
2829
+ ...(w = e.builderContextSignal.content) == null ? void 0 : w.meta,
2830
+ ...g == null ? void 0 : g.meta,
2831
+ breakpoints: ((R = g == null ? void 0 : g.meta) == null ? void 0 : R.breakpoints) || ((Y = (N = e.builderContextSignal.content) == null ? void 0 : N.meta) == null ? void 0 : Y.breakpoints)
2832
+ }
2833
+ };
2834
+ e.setBuilderContextSignal((Me) => ({
2835
+ ...Me,
2836
+ content: b
2837
+ }));
2838
+ }
2839
+ v(() => 0);
2840
+ const [r, s] = v(
2841
+ () => !1
2842
+ ), [c, d] = v(
2843
+ () => e.contentWrapper || "div"
2844
+ );
2845
+ function u(g) {
2846
+ return Ue({
2847
+ model: e.model,
2848
+ trustedHosts: e.trustedHosts,
2849
+ callbacks: {
2850
+ configureSdk: (b) => {
2851
+ var R;
2852
+ const { breakpoints: S, contentId: w } = b;
2853
+ !w || w !== ((R = e.builderContextSignal.content) == null ? void 0 : R.id) || S && (a({
2854
+ meta: {
2855
+ breakpoints: S
2856
+ }
2857
+ }), i(n + 1));
2858
+ },
2859
+ animation: (b) => {
2860
+ Ve(b);
2861
+ },
2862
+ contentUpdate: (b) => {
2863
+ a(b), i(n + 1);
2864
+ }
2865
+ }
2866
+ })(g);
2867
+ }
2868
+ function x() {
2869
+ var b, S;
2870
+ const g = (S = (b = e.builderContextSignal.content) == null ? void 0 : b.data) == null ? void 0 : S.jsCode;
2871
+ g && q({
2872
+ code: g,
2873
+ context: e.context || {},
2874
+ localState: void 0,
2875
+ rootState: e.builderContextSignal.rootState,
2876
+ rootSetState: e.builderContextSignal.rootSetState
2877
+ });
2878
+ }
2879
+ const [C, f] = v(() => ({})), [y, p] = v(() => !1);
2880
+ function E(g) {
2881
+ var b, S;
2882
+ if (e.builderContextSignal.content) {
2883
+ const w = (b = e.builderContextSignal.content) == null ? void 0 : b.testVariationId, R = (S = e.builderContextSignal.content) == null ? void 0 : S.id;
2884
+ he({
2885
+ type: "click",
2886
+ canTrack: X(e.canTrack),
2887
+ contentId: R,
2888
+ apiKey: e.apiKey,
2889
+ variationId: w !== R ? w : void 0,
2890
+ ...vn(g),
2891
+ unique: !y
2892
+ });
2893
+ }
2894
+ y || p(!0);
2895
+ }
2896
+ function A(g) {
2897
+ return g.replace(
2898
+ /{{([^}]+)}}/g,
2899
+ (b, S) => q({
2900
+ code: S,
2901
+ context: e.context || {},
2902
+ localState: void 0,
2903
+ rootState: e.builderContextSignal.rootState,
2904
+ rootSetState: e.builderContextSignal.rootSetState
2905
+ })
2906
+ );
2907
+ }
2908
+ function k({ url: g, key: b }) {
2909
+ qe(g).then((S) => S.json()).then((S) => {
2910
+ var R, N;
2911
+ const w = {
2912
+ ...e.builderContextSignal.rootState,
2913
+ [b]: S
2914
+ };
2915
+ (N = (R = e.builderContextSignal).rootSetState) == null || N.call(R, w), C[b] = !0;
2916
+ }).catch((S) => {
2917
+ console.error("error fetching dynamic data", g, S);
2918
+ });
2919
+ }
2920
+ function I() {
2921
+ var b, S, w;
2922
+ const g = (w = (S = (b = e.builderContextSignal.content) == null ? void 0 : b.data) == null ? void 0 : S.httpRequests) != null ? w : {};
2923
+ Object.entries(g).forEach(([R, N]) => {
2924
+ if (N && (!C[R] || M())) {
2925
+ const Y = A(N);
2926
+ k({
2927
+ url: Y,
2928
+ key: R
2929
+ });
2930
+ }
2931
+ });
2932
+ }
2933
+ function B() {
2934
+ M() && window.dispatchEvent(
2935
+ new CustomEvent(
2936
+ "builder:component:stateChange",
2937
+ {
2938
+ detail: {
2939
+ state: ae(e.builderContextSignal.rootState),
2940
+ ref: {
2941
+ name: e.model
2942
+ }
2943
+ }
2944
+ }
2945
+ )
2946
+ );
2947
+ }
2948
+ function P(g) {
2949
+ i(n + 1), window.addEventListener("message", u), He(), _e({
2950
+ ...e.locale ? {
2951
+ locale: e.locale
2952
+ } : {},
2953
+ ...e.enrich ? {
2954
+ enrich: e.enrich
2955
+ } : {},
2956
+ ...e.trustedHosts ? {
2957
+ trustedHosts: e.trustedHosts
2958
+ } : {}
2959
+ }), Object.values(
2960
+ e.builderContextSignal.componentInfos
2961
+ ).forEach((b) => {
2962
+ var w;
2963
+ const S = Ke(b);
2964
+ (w = window.parent) == null || w.postMessage(S, "*");
2965
+ }), window.addEventListener(
2966
+ "builder:component:stateChangeListenerActivated",
2967
+ B
2968
+ );
2969
+ }
2970
+ function $(g) {
2971
+ const b = new URL(location.href).searchParams, S = b.get("builder.preview"), w = b.get(
2972
+ `builder.preview.${S}`
2973
+ ), R = b.get("apiKey") || b.get("builder.space");
2974
+ S === e.model && R === e.apiKey && (!e.content || w === e.content.id) && Ie({
2975
+ model: e.model,
2976
+ apiKey: e.apiKey,
2977
+ apiVersion: e.builderContextSignal.apiVersion
2978
+ }).then((N) => {
2979
+ N && a(N);
2980
+ });
2981
+ }
2982
+ return V(() => {
2983
+ var g;
2984
+ return (g = t.current) == null || g.addEventListener(
2985
+ "initeditingbldr",
2986
+ P
2987
+ ), () => {
2988
+ var b;
2989
+ return (b = t.current) == null ? void 0 : b.removeEventListener(
2990
+ "initeditingbldr",
2991
+ P
2992
+ );
2993
+ };
2994
+ }, []), V(() => {
2995
+ var g;
2996
+ return (g = t.current) == null || g.addEventListener(
2997
+ "initpreviewingbldr",
2998
+ $
2999
+ ), () => {
3000
+ var b;
3001
+ return (b = t.current) == null ? void 0 : b.removeEventListener(
3002
+ "initpreviewingbldr",
3003
+ $
3004
+ );
3005
+ };
3006
+ }, []), V(() => {
3007
+ var g, b;
3008
+ if (U()) {
3009
+ if (M() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && X(e.canTrack)) {
3010
+ const w = (g = e.builderContextSignal.content) == null ? void 0 : g.testVariationId, R = (b = e.builderContextSignal.content) == null ? void 0 : b.id, N = e.apiKey;
3011
+ he({
3012
+ type: "impression",
3013
+ canTrack: !0,
3014
+ contentId: R,
3015
+ apiKey: N,
3016
+ variationId: w !== R ? w : void 0
3017
+ });
3018
+ }
3019
+ je() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
3020
+ }
3021
+ }, []), V(() => {
3022
+ e.apiKey || _.error(
3023
+ "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
3024
+ ), x(), I(), B();
3025
+ }, []), V(() => {
3026
+ e.content && a(e.content);
3027
+ }, [e.content]), V(() => {
3028
+ }, [r]), V(() => {
3029
+ x();
3030
+ }, [(h = (L = e.builderContextSignal.content) == null ? void 0 : L.data) == null ? void 0 : h.jsCode]), V(() => {
3031
+ I();
3032
+ }, [(D = (T = e.builderContextSignal.content) == null ? void 0 : T.data) == null ? void 0 : D.httpRequests]), V(() => {
3033
+ B();
3034
+ }, [e.builderContextSignal.rootState]), V(() => {
3035
+ e.data && o(e.data);
3036
+ }, [e.data]), V(() => {
3037
+ e.locale && o({
3038
+ locale: e.locale
3039
+ });
3040
+ }, [e.locale]), V(() => () => {
3041
+ U() && (window.removeEventListener("message", u), window.removeEventListener(
3042
+ "builder:component:stateChangeListenerActivated",
3043
+ B
3044
+ ));
3045
+ }, []), /* @__PURE__ */ l(se.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ re(
3046
+ c,
3047
+ {
3048
+ key: n,
3049
+ ref: t,
3050
+ onClick: (g) => E(g),
3051
+ "builder-content-id": (W = e.builderContextSignal.content) == null ? void 0 : W.id,
3052
+ "builder-model": e.model,
3053
+ ...e.showContent ? {} : {
3054
+ hidden: !0,
3055
+ "aria-hidden": !0
3056
+ },
3057
+ ...e.contentWrapperProps,
3058
+ className: `variant-${((H = e.content) == null ? void 0 : H.testVariationId) || ((fe = e.content) == null ? void 0 : fe.id)}`
3059
+ },
3060
+ e.children
3061
+ ) }) : null });
3062
+ }
3063
+ const Cn = (e) => {
3064
+ var a, r;
3065
+ 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;
3066
+ let o = "";
3067
+ if (i && t && n && (o += `
3068
+ @font-face {
3069
+ font-family: "${t}";
3070
+ src: local("${n}"), url('${i}') format('woff2');
3071
+ font-display: fallback;
3072
+ font-weight: 400;
3073
+ }
3074
+ `.trim()), e.files)
3075
+ for (const s in e.files) {
3076
+ if (!(String(Number(s)) === s))
3077
+ continue;
3078
+ const d = e.files[s];
3079
+ d && d !== i && (o += `
3080
+ @font-face {
3081
+ font-family: "${t}";
3082
+ src: url('${d}') format('woff2');
3083
+ font-display: fallback;
3084
+ font-weight: ${s};
3085
+ }
3086
+ `.trim());
3087
+ }
3088
+ return o;
3089
+ }, wn = ({
3090
+ customFonts: e
3091
+ }) => {
3092
+ var t;
3093
+ return ((t = e == null ? void 0 : e.map((n) => Cn(n))) == null ? void 0 : t.join(" ")) || "";
3094
+ }, In = ({
3095
+ cssCode: e,
3096
+ contentId: t
3097
+ }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
3098
+ function Tn(e) {
3099
+ const [t, n] = v(
3100
+ () => `
3101
+ ${In({
3102
+ cssCode: e.cssCode,
3103
+ contentId: e.contentId
3104
+ })}
3105
+ ${wn({
3106
+ customFonts: e.customFonts
3107
+ })}
3108
+
3109
+ .builder-button {
3110
+ all: unset;
3111
+ }
3112
+
3113
+ .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
3114
+ margin: 0;
3115
+ }
3116
+ .builder-text > p, .builder-text > .builder-paragraph {
3117
+ color: inherit;
3118
+ line-height: inherit;
3119
+ letter-spacing: inherit;
3120
+ font-weight: inherit;
3121
+ font-size: inherit;
3122
+ text-align: inherit;
3123
+ font-family: inherit;
3124
+ }
3125
+ `.trim()
3126
+ );
3127
+ return /* @__PURE__ */ l(te, { styles: t });
3128
+ }
3129
+ const En = ({
3130
+ content: e,
3131
+ data: t,
3132
+ locale: n
3133
+ }) => {
3134
+ var a, r, s;
3135
+ const i = {}, o = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
3136
+ return (s = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || s.forEach((c) => {
3137
+ c.name && c.defaultValue !== void 0 && (i[c.name] = c.defaultValue);
3138
+ }), {
3139
+ ...i,
3140
+ ...o,
3141
+ ...t,
3142
+ ...n ? {
3143
+ locale: n
3144
+ } : {}
3145
+ };
3146
+ }, Rn = ({
3147
+ content: e,
3148
+ data: t
3149
+ }) => e ? {
3150
+ ...e,
3151
+ data: {
3152
+ ...e == null ? void 0 : e.data,
3153
+ ...t
3154
+ },
3155
+ meta: e == null ? void 0 : e.meta
3156
+ } : void 0;
3157
+ function we(e) {
3158
+ var c, d, u, x, C, f, y;
3159
+ const [t, n] = v(
3160
+ () => {
3161
+ var p, E;
3162
+ return pn({
3163
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
3164
+ variationId: (p = e.content) == null ? void 0 : p.testVariationId,
3165
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
3166
+ contentId: (E = e.content) == null ? void 0 : E.id
3167
+ });
3168
+ }
3169
+ );
3170
+ function i(p) {
3171
+ s((E) => ({
3172
+ ...E,
3173
+ rootState: p
3174
+ }));
3175
+ }
3176
+ const [o, a] = v(
3177
+ () => [
3178
+ ...ve(),
3179
+ ...e.customComponents || []
3180
+ ].reduce(
3181
+ (p, { component: E, ...A }) => ({
3182
+ ...p,
3183
+ [A.name]: {
3184
+ component: E,
3185
+ ...ge(A)
3186
+ }
3187
+ }),
3188
+ {}
3189
+ )
3190
+ ), [r, s] = v(() => ({
3191
+ content: Rn({
3192
+ content: e.content,
3193
+ data: e.data
3194
+ }),
3195
+ localState: void 0,
3196
+ rootState: En({
3197
+ content: e.content,
3198
+ data: e.data,
3199
+ locale: e.locale
3200
+ }),
3201
+ rootSetState: i,
3202
+ context: e.context || {},
3203
+ apiKey: e.apiKey,
3204
+ apiVersion: e.apiVersion,
3205
+ componentInfos: [
3206
+ ...ve(),
3207
+ ...e.customComponents || []
3208
+ ].reduce(
3209
+ (p, { component: E, ...A }) => ({
3210
+ ...p,
3211
+ [A.name]: ge(A)
3212
+ }),
3213
+ {}
3214
+ ),
3215
+ inheritedStyles: {},
3216
+ BlocksWrapper: e.blocksWrapper || "div",
3217
+ BlocksWrapperProps: e.blocksWrapperProps || {}
3218
+ }));
3219
+ return /* @__PURE__ */ l(
3220
+ Ee.Provider,
3221
+ {
3222
+ value: {
3223
+ registeredComponents: o
3224
+ },
3225
+ children: /* @__PURE__ */ F(
3226
+ kn,
3227
+ {
3228
+ content: e.content,
3229
+ data: e.data,
3230
+ model: e.model,
3231
+ context: e.context,
3232
+ apiKey: e.apiKey,
3233
+ canTrack: e.canTrack,
3234
+ locale: e.locale,
3235
+ enrich: e.enrich,
3236
+ showContent: e.showContent,
3237
+ builderContextSignal: r,
3238
+ contentWrapper: e.contentWrapper,
3239
+ contentWrapperProps: e.contentWrapperProps,
3240
+ linkComponent: e.linkComponent,
3241
+ trustedHosts: e.trustedHosts,
3242
+ setBuilderContextSignal: s,
3243
+ children: [
3244
+ e.isSsrAbTest ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(oe, { scriptStr: t }) }) : null,
3245
+ /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(
3246
+ Tn,
3247
+ {
3248
+ contentId: (c = r.content) == null ? void 0 : c.id,
3249
+ cssCode: (u = (d = r.content) == null ? void 0 : d.data) == null ? void 0 : u.cssCode,
3250
+ customFonts: (C = (x = r.content) == null ? void 0 : x.data) == null ? void 0 : C.customFonts
3251
+ }
3252
+ ) }),
3253
+ /* @__PURE__ */ l(
3254
+ j,
3255
+ {
3256
+ blocks: (y = (f = r.content) == null ? void 0 : f.data) == null ? void 0 : y.blocks,
3257
+ context: r,
3258
+ registeredComponents: o,
3259
+ linkComponent: e.linkComponent
3260
+ }
3261
+ )
3262
+ ]
3263
+ }
3264
+ )
3265
+ }
3266
+ );
3267
+ }
3268
+ function Pn(e) {
3269
+ var r, s;
3270
+ const [t, n] = v(
3271
+ () => hn({
3272
+ canTrack: X(e.canTrack),
3273
+ content: e.content
3274
+ })
3275
+ );
3276
+ function i() {
3277
+ var c;
3278
+ return yn(
3279
+ G(e.content).map((d) => ({
3280
+ id: d.testVariationId,
3281
+ testRatio: d.testRatio
3282
+ })),
3283
+ ((c = e.content) == null ? void 0 : c.id) || ""
3284
+ );
3285
+ }
3286
+ function o() {
3287
+ return G(e.content).map((c) => `.variant-${c.testVariationId} { display: none; } `).join("");
3288
+ }
3289
+ function a() {
3290
+ var c;
3291
+ return t ? {
3292
+ ...e.content,
3293
+ testVariationId: (c = e.content) == null ? void 0 : c.id
3294
+ } : ze({
3295
+ item: e.content,
3296
+ canTrack: X(e.canTrack)
3297
+ });
3298
+ }
3299
+ return V(() => {
3300
+ }, []), /* @__PURE__ */ F(m, { children: [
3301
+ !e.__isNestedRender && z !== "reactNative" ? /* @__PURE__ */ l(m, { children: /* @__PURE__ */ l(oe, { scriptStr: bn() }) }) : null,
3302
+ t ? /* @__PURE__ */ F(m, { children: [
3303
+ /* @__PURE__ */ l(
3304
+ te,
3305
+ {
3306
+ id: `variants-styles-${(r = e.content) == null ? void 0 : r.id}`,
3307
+ styles: o()
3308
+ }
3309
+ ),
3310
+ /* @__PURE__ */ l(oe, { scriptStr: i() }),
3311
+ (s = G(e.content)) == null ? void 0 : s.map((c) => /* @__PURE__ */ l(
3312
+ we,
3313
+ {
3314
+ content: c,
3315
+ showContent: !1,
3316
+ model: e.model,
3317
+ data: e.data,
3318
+ context: e.context,
3319
+ apiKey: e.apiKey,
3320
+ apiVersion: e.apiVersion,
3321
+ customComponents: e.customComponents,
3322
+ linkComponent: e.linkComponent,
3323
+ canTrack: e.canTrack,
3324
+ locale: e.locale,
3325
+ enrich: e.enrich,
3326
+ isSsrAbTest: t,
3327
+ blocksWrapper: e.blocksWrapper,
3328
+ blocksWrapperProps: e.blocksWrapperProps,
3329
+ contentWrapper: e.contentWrapper,
3330
+ contentWrapperProps: e.contentWrapperProps,
3331
+ trustedHosts: e.trustedHosts
3332
+ },
3333
+ c.testVariationId
3334
+ ))
3335
+ ] }) : null,
3336
+ /* @__PURE__ */ l(
3337
+ we,
3338
+ {
3339
+ content: a(),
3340
+ showContent: !0,
3341
+ model: e.model,
3342
+ data: e.data,
3343
+ context: e.context,
3344
+ apiKey: e.apiKey,
3345
+ apiVersion: e.apiVersion,
3346
+ customComponents: e.customComponents,
3347
+ linkComponent: e.linkComponent,
3348
+ canTrack: e.canTrack,
3349
+ locale: e.locale,
3350
+ enrich: e.enrich,
3351
+ isSsrAbTest: t,
3352
+ blocksWrapper: e.blocksWrapper,
3353
+ blocksWrapperProps: e.blocksWrapperProps,
3354
+ contentWrapper: e.contentWrapper,
3355
+ contentWrapperProps: e.contentWrapperProps,
3356
+ trustedHosts: e.trustedHosts
3357
+ }
3358
+ )
3359
+ ] });
3360
+ }
3361
+ const Vn = async ({
3362
+ builderContextValue: e,
3363
+ symbol: t
3364
+ }) => {
3365
+ if (t != null && t.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
3366
+ (e != null && e.apiKey))
3367
+ return Ie({
3368
+ model: t.model,
3369
+ apiKey: e.apiKey,
3370
+ apiVersion: e.apiVersion,
3371
+ ...(t == null ? void 0 : t.entry) && {
3372
+ query: {
3373
+ id: t.entry
3374
+ }
3375
+ }
3376
+ }).catch((n) => {
3377
+ _.error("Could not fetch symbol content: ", n);
3378
+ });
3379
+ };
3380
+ function Bn(e) {
3381
+ var a, r, s, c;
3382
+ function t() {
3383
+ var d, u;
3384
+ return [
3385
+ e.attributes[K()],
3386
+ "builder-symbol",
3387
+ (d = e.symbol) != null && d.inline ? "builder-inline-symbol" : void 0,
3388
+ (u = e.symbol) != null && u.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
3389
+ ].filter(Boolean).join(" ");
3390
+ }
3391
+ const [n, i] = v(() => {
3392
+ var d;
3393
+ return (d = e.symbol) == null ? void 0 : d.content;
3394
+ });
3395
+ function o() {
3396
+ n || Vn({
3397
+ symbol: e.symbol,
3398
+ builderContextValue: e.builderContext
3399
+ }).then((d) => {
3400
+ d && i(d);
3401
+ });
3402
+ }
3403
+ return V(() => {
3404
+ }, []), V(() => {
3405
+ o();
3406
+ }, [e.symbol]), /* @__PURE__ */ l("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ l(
3407
+ Pn,
3408
+ {
3409
+ __isNestedRender: !0,
3410
+ apiVersion: e.builderContext.apiVersion,
3411
+ apiKey: e.builderContext.apiKey,
3412
+ context: {
3413
+ ...e.builderContext.context,
3414
+ symbolId: (a = e.builderBlock) == null ? void 0 : a.id
3415
+ },
3416
+ customComponents: Object.values(e.builderComponents),
3417
+ data: {
3418
+ ...(r = e.symbol) == null ? void 0 : r.data,
3419
+ ...e.builderContext.localState,
3420
+ ...(s = n == null ? void 0 : n.data) == null ? void 0 : s.state
3421
+ },
3422
+ model: (c = e.symbol) == null ? void 0 : c.model,
3423
+ content: n,
3424
+ linkComponent: e.builderLinkComponent,
3425
+ blocksWrapper: "div",
3426
+ contentWrapper: "div"
3427
+ }
3428
+ ) });
3429
+ }
3430
+ export {
3431
+ j as Blocks,
3432
+ Ge as Button,
3433
+ Et as Columns,
3434
+ Pn as Content,
3435
+ Rt as Fragment,
3436
+ Bt as Image,
3437
+ At as Section,
3438
+ Bn as Symbol,
3439
+ Ut as Text,
3440
+ dn as Video
3441
+ };