@builder.io/sdk-react 0.7.1-0 → 0.7.1

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 (64) hide show
  1. package/lib/browser/index.cjs +26 -26
  2. package/lib/browser/index.mjs +942 -918
  3. package/lib/{node/server-entry-13b7e1e6.mjs → browser/server-entry-0aebe4be.mjs} +261 -261
  4. package/lib/browser/server-entry-a5d2c777.js +2 -0
  5. package/lib/browser/server-entry.cjs +1 -1
  6. package/lib/browser/server-entry.mjs +1 -1
  7. package/lib/edge/index.cjs +34 -34
  8. package/lib/edge/index.mjs +1056 -1032
  9. package/lib/edge/{server-entry-13b7e1e6.mjs → server-entry-0aebe4be.mjs} +261 -261
  10. package/lib/edge/server-entry-a5d2c777.js +2 -0
  11. package/lib/edge/server-entry.cjs +1 -1
  12. package/lib/edge/server-entry.mjs +1 -1
  13. package/lib/node/index.cjs +16 -16
  14. package/lib/node/index.mjs +796 -772
  15. package/lib/node/server-entry-a5d2c777.js +2 -0
  16. package/lib/{browser/server-entry-13b7e1e6.mjs → node/server-entry-e4cd1e05.mjs} +260 -260
  17. package/lib/node/server-entry.cjs +1 -1
  18. package/lib/node/server-entry.mjs +1 -1
  19. package/package.json +5 -3
  20. package/types/blocks/BaseText.d.ts +2 -2
  21. package/types/blocks/button/button.d.ts +4 -3
  22. package/types/blocks/columns/columns.d.ts +2 -2
  23. package/types/blocks/custom-code/custom-code.d.ts +2 -2
  24. package/types/blocks/embed/embed.d.ts +2 -2
  25. package/types/blocks/form/form.d.ts +2 -2
  26. package/types/blocks/fragment/fragment.d.ts +2 -2
  27. package/types/blocks/image/image.d.ts +2 -2
  28. package/types/blocks/img/img.d.ts +4 -3
  29. package/types/blocks/input/input.d.ts +4 -3
  30. package/types/blocks/raw-text/raw-text.d.ts +2 -2
  31. package/types/blocks/section/section.d.ts +4 -3
  32. package/types/blocks/select/select.d.ts +4 -3
  33. package/types/blocks/submit-button/submit-button.d.ts +4 -3
  34. package/types/blocks/symbol/symbol.d.ts +6 -4
  35. package/types/blocks/text/text.d.ts +2 -2
  36. package/types/blocks/textarea/textarea.d.ts +4 -3
  37. package/types/blocks/video/video.d.ts +2 -2
  38. package/types/components/block/block.d.ts +2 -2
  39. package/types/components/block/components/block-styles.d.ts +2 -2
  40. package/types/components/block/components/block-wrapper.d.ts +6 -5
  41. package/types/components/block/components/component-ref/component-ref.d.ts +2 -2
  42. package/types/components/block/components/interactive-element.d.ts +2 -2
  43. package/types/components/block/components/repeated-block.d.ts +2 -2
  44. package/types/components/blocks/blocks-wrapper.d.ts +2 -2
  45. package/types/components/blocks/blocks.d.ts +3 -3
  46. package/types/components/content/components/enable-editor.d.ts +2 -2
  47. package/types/components/content/components/styles.d.ts +2 -2
  48. package/types/components/content/content.d.ts +2 -2
  49. package/types/components/content-variants/content-variants.d.ts +2 -2
  50. package/types/components/inlined-script.d.ts +2 -2
  51. package/types/components/inlined-styles.d.ts +2 -2
  52. package/types/constants/sdk-version.d.ts +1 -1
  53. package/types/context/types.d.ts +1 -1
  54. package/types/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +0 -2
  55. package/types/helpers/ab-tests.d.ts +1 -1
  56. package/types/server-index.d.ts +2 -2
  57. package/lib/browser/server-entry-c98db16c.js +0 -2
  58. package/lib/edge/server-entry-c98db16c.js +0 -2
  59. package/lib/index.cjs +0 -14
  60. package/lib/index.mjs +0 -10
  61. package/lib/node/server-entry-c98db16c.js +0 -2
  62. package/types/node-runtime/index.d.ts +0 -1
  63. package/types/node-runtime/node-runtime.d.ts +0 -1
  64. package/types/node-runtime.d.ts +0 -1
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
3
3
  import { createContext, useState, useContext, createElement, useRef, useEffect } from "react";
4
- import { j as fastClone, i as isEditing, k as isBrowser, l as getUserAttributes, m as logger, n as checkIsDefined, T as TARGET, r as register, o as getDefaultCanTrack, p as _track, a as isPreviewing, c as createRegisterComponentMessage, b as fetchOneEntry, q as fetch$1, u as components, v as serializeComponentInfo, w as handleABTestingSync } from "./server-entry-13b7e1e6.mjs";
5
- import { _ as M, h as W, f as L, g as O, e as U, d as D, s as H, t as K } from "./server-entry-13b7e1e6.mjs";
4
+ import { i as isEditing, j as isBrowser, k as getUserAttributes, l as fastClone, m as logger, n as checkIsDefined, T as TARGET, r as register, o as getDefaultCanTrack, p as _track, a as isPreviewing, c as createRegisterComponentMessage, b as fetchOneEntry, q as fetch$1, u as components, v as serializeComponentInfo, w as handleABTestingSync } from "./server-entry-e4cd1e05.mjs";
5
+ import { _ as M, h as W, f as L, g as O, e as U, d as D, s as H, t as K } from "./server-entry-e4cd1e05.mjs";
6
6
  function Button(e) {
7
7
  return /* @__PURE__ */ jsxs(Fragment, { children: [
8
8
  e.link ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
9
9
  "a",
10
10
  {
11
- role: "button",
12
11
  ...e.attributes,
13
12
  href: e.link,
14
13
  target: e.openLinkInNewTab ? "_blank" : void 0,
14
+ role: "button",
15
15
  children: e.text
16
16
  }
17
17
  ) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
@@ -19,58 +19,39 @@ function Button(e) {
19
19
  {
20
20
  ...e.attributes,
21
21
  style: e.attributes.style,
22
- className: e.attributes.className + " button-35669e6c",
22
+ className: e.attributes.className + " button-5294b10c",
23
23
  children: e.text
24
24
  }
25
25
  ) }),
26
- /* @__PURE__ */ jsx("style", { children: `.button-35669e6c {
26
+ /* @__PURE__ */ jsx("style", { children: `.button-5294b10c {
27
27
  all: unset;
28
28
  }` })
29
29
  ] });
30
30
  }
31
- const SIZES = {
32
- small: {
33
- min: 320,
34
- default: 321,
35
- max: 640
36
- },
37
- medium: {
38
- min: 641,
39
- default: 642,
40
- max: 991
31
+ const builderContext = createContext({
32
+ content: null,
33
+ context: {},
34
+ localState: void 0,
35
+ rootSetState() {
41
36
  },
42
- large: {
43
- min: 990,
44
- default: 991,
45
- max: 1200
46
- }
47
- }, getMaxWidthQueryForSize = (e, t = SIZES) => `@media (max-width: ${t[e].max}px)`, getSizesForBreakpoints = ({
48
- small: e,
49
- medium: t
50
- }) => {
51
- const n = fastClone(SIZES);
52
- if (!e || !t)
53
- return n;
54
- const i = Math.floor(e / 2);
55
- n.small = {
56
- max: e,
57
- min: i,
58
- default: i + 1
59
- };
60
- const o = n.small.max + 1;
61
- n.medium = {
62
- max: t,
63
- min: o,
64
- default: o + 1
37
+ rootState: {},
38
+ apiKey: null,
39
+ apiVersion: void 0,
40
+ componentInfos: {},
41
+ inheritedStyles: {}
42
+ }), ComponentsContext = createContext({ registeredComponents: {} });
43
+ function getBlockComponentOptions(e) {
44
+ var t;
45
+ return {
46
+ ...(t = e.component) == null ? void 0 : t.options,
47
+ ...e.options,
48
+ /**
49
+ * Our built-in components frequently make use of the block, so we provide all of it under `builderBlock`
50
+ */
51
+ builderBlock: e
65
52
  };
66
- const a = n.medium.max + 1;
67
- return n.large = {
68
- max: 2e3,
69
- // TODO: decide upper limit
70
- min: a,
71
- default: a + 1
72
- }, n;
73
- }, getFunctionArguments = ({
53
+ }
54
+ const getFunctionArguments = ({
74
55
  builder: e,
75
56
  context: t,
76
57
  event: n,
@@ -98,13 +79,13 @@ const SIZES = {
98
79
  rootSetState: a,
99
80
  rootState: r
100
81
  }) => {
101
- const l = getFunctionArguments({
82
+ const s = getFunctionArguments({
102
83
  builder: t,
103
84
  context: n,
104
85
  event: i,
105
86
  state: flattenState(r, o, a)
106
87
  });
107
- return new Function(...l.map(([s]) => s), e)(...l.map(([, s]) => s));
88
+ return new Function(...s.map(([c]) => c), e)(...s.map(([, c]) => c));
108
89
  };
109
90
  function flattenState(e, t, n) {
110
91
  if (e === t)
@@ -118,18 +99,18 @@ function flattenState(e, t, n) {
118
99
  }
119
100
  });
120
101
  }
121
- const noop = () => null;
122
- let safeDynamicRequire = noop;
123
- try {
124
- safeDynamicRequire = eval("require");
125
- } catch (e) {
126
- }
127
102
  const set = (e, t, n) => {
128
103
  if (Object(e) !== e)
129
104
  return e;
130
105
  const i = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
131
106
  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;
132
- }, ivm = safeDynamicRequire("isolated-vm"), getSyncValName = (e) => `bldr_${e}_sync`, BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE", INJECTED_IVM_GLOBAL = "BUILDER_IVM", REF_TO_PROXY_FN = `
107
+ }, noop = () => null;
108
+ let safeDynamicRequire = noop;
109
+ try {
110
+ safeDynamicRequire = eval("require");
111
+ } catch (e) {
112
+ }
113
+ const ivm = safeDynamicRequire("isolated-vm"), getSyncValName = (e) => `bldr_${e}_sync`, BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE", INJECTED_IVM_GLOBAL = "BUILDER_IVM", REF_TO_PROXY_FN = `
133
114
  var refToProxy = (obj) => {
134
115
  if (typeof obj !== 'object' || obj === null) {
135
116
  return obj;
@@ -186,20 +167,20 @@ output;
186
167
  rootSetState: a,
187
168
  rootState: r
188
169
  }) => {
189
- const l = fastClone({
170
+ const s = fastClone({
190
171
  ...r,
191
172
  ...o
192
- }), s = getFunctionArguments({
173
+ }), c = getFunctionArguments({
193
174
  builder: t,
194
175
  context: n,
195
176
  event: i,
196
- state: l
197
- }), c = getIsolateContext(), u = c.global;
177
+ state: s
178
+ }), l = getIsolateContext(), u = l.global;
198
179
  u.setSync("global", u.derefInto()), u.setSync("log", function(...b) {
199
180
  console.log(...b);
200
181
  }), u.setSync(BUILDER_SET_STATE_NAME, function(b, d) {
201
182
  set(r, b, d), a == null || a(r);
202
- }), s.forEach(([b, d]) => {
183
+ }), c.forEach(([b, d]) => {
203
184
  const x = typeof d == "object" ? new ivm.Reference(
204
185
  // workaround: methods with default values for arguments is not being cloned over
205
186
  b === "builder" ? {
@@ -211,8 +192,8 @@ output;
211
192
  }), u.setSync(INJECTED_IVM_GLOBAL, ivm);
212
193
  const f = processCode({
213
194
  code: e,
214
- args: s
215
- }), h = c.evalSync(f);
195
+ args: c
196
+ }), h = l.evalSync(f);
216
197
  try {
217
198
  return JSON.parse(h);
218
199
  } catch {
@@ -232,7 +213,7 @@ function evaluate({
232
213
  logger.warn("Skipping evaluation of empty code block.");
233
214
  return;
234
215
  }
235
- const l = {
216
+ const s = {
236
217
  code: parseCode(e, {
237
218
  isExpression: r
238
219
  }),
@@ -244,9 +225,9 @@ function evaluate({
244
225
  localState: n
245
226
  };
246
227
  try {
247
- return chooseBrowserOrServerEval(l);
248
- } catch (s) {
249
- logger.error("Failed code evaluation: " + s.message, {
228
+ return chooseBrowserOrServerEval(s);
229
+ } catch (c) {
230
+ logger.error("Failed code evaluation: " + c.message, {
250
231
  code: e
251
232
  });
252
233
  return;
@@ -273,15 +254,15 @@ const evaluateBindings = ({
273
254
  ...a.actions
274
255
  }
275
256
  };
276
- for (const l in e.bindings) {
277
- const s = e.bindings[l], c = evaluate({
278
- code: s,
257
+ for (const s in e.bindings) {
258
+ const c = e.bindings[s], l = evaluate({
259
+ code: c,
279
260
  localState: n,
280
261
  rootState: i,
281
262
  rootSetState: o,
282
263
  context: t
283
264
  });
284
- set(r, l, c);
265
+ set(r, s, l);
285
266
  }
286
267
  return r;
287
268
  };
@@ -302,7 +283,104 @@ function getProcessedBlock({
302
283
  context: t
303
284
  }) : r;
304
285
  }
305
- const camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, i]) => {
286
+ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"], isEmptyHtmlElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.includes(e.toLowerCase()), getComponent = ({
287
+ block: e,
288
+ context: t,
289
+ registeredComponents: n
290
+ }) => {
291
+ var a;
292
+ const i = (a = getProcessedBlock({
293
+ block: e,
294
+ localState: t.localState,
295
+ rootState: t.rootState,
296
+ rootSetState: t.rootSetState,
297
+ context: t.context,
298
+ shouldEvaluateBindings: !1
299
+ }).component) == null ? void 0 : a.name;
300
+ if (!i)
301
+ return null;
302
+ const o = n[i];
303
+ if (o)
304
+ return o;
305
+ console.warn(`
306
+ Could not find a registered component named "${i}".
307
+ If you registered it, is the file that registered it imported by the file that needs to render it?`);
308
+ }, getRepeatItemData = ({
309
+ block: e,
310
+ context: t
311
+ }) => {
312
+ const {
313
+ repeat: n,
314
+ ...i
315
+ } = e;
316
+ if (!(n != null && n.collection))
317
+ return;
318
+ const o = evaluate({
319
+ code: n.collection,
320
+ localState: t.localState,
321
+ rootState: t.rootState,
322
+ rootSetState: t.rootSetState,
323
+ context: t.context
324
+ });
325
+ if (!Array.isArray(o))
326
+ return;
327
+ const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
328
+ return o.map((c, l) => ({
329
+ context: {
330
+ ...t,
331
+ localState: {
332
+ ...t.localState,
333
+ $index: l,
334
+ $item: c,
335
+ [r]: c,
336
+ [`$${r}Index`]: l
337
+ }
338
+ },
339
+ block: i
340
+ }));
341
+ }, SIZES = {
342
+ small: {
343
+ min: 320,
344
+ default: 321,
345
+ max: 640
346
+ },
347
+ medium: {
348
+ min: 641,
349
+ default: 642,
350
+ max: 991
351
+ },
352
+ large: {
353
+ min: 990,
354
+ default: 991,
355
+ max: 1200
356
+ }
357
+ }, getMaxWidthQueryForSize = (e, t = SIZES) => `@media (max-width: ${t[e].max}px)`, getSizesForBreakpoints = ({
358
+ small: e,
359
+ medium: t
360
+ }) => {
361
+ const n = fastClone(SIZES);
362
+ if (!e || !t)
363
+ return n;
364
+ const i = Math.floor(e / 2);
365
+ n.small = {
366
+ max: e,
367
+ min: i,
368
+ default: i + 1
369
+ };
370
+ const o = n.small.max + 1;
371
+ n.medium = {
372
+ max: t,
373
+ min: o,
374
+ default: o + 1
375
+ };
376
+ const a = n.medium.max + 1;
377
+ return n.large = {
378
+ max: 2e3,
379
+ // TODO: decide upper limit
380
+ min: a,
381
+ default: a + 1
382
+ }, n;
383
+ }, camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, i]) => {
306
384
  if (typeof i == "string")
307
385
  return `${camelToKebabCase(n)}: ${i};`;
308
386
  }).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
@@ -344,22 +422,22 @@ function BlockStyles(e) {
344
422
  shouldEvaluateBindings: !0
345
423
  }), o = i.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
346
424
  ((d = a == null ? void 0 : a.meta) == null ? void 0 : d.breakpoints) || {}
347
- ), l = o == null ? void 0 : o.large, s = o == null ? void 0 : o.medium, c = o == null ? void 0 : o.small, u = i.id;
425
+ ), s = o == null ? void 0 : o.large, c = o == null ? void 0 : o.medium, l = o == null ? void 0 : o.small, u = i.id;
348
426
  if (!u)
349
427
  return "";
350
- const f = l ? createCssClass({
428
+ const f = s ? createCssClass({
351
429
  className: u,
352
- styles: l
353
- }) : "", h = s ? createCssClass({
430
+ styles: s
431
+ }) : "", h = c ? createCssClass({
354
432
  className: u,
355
- styles: s,
433
+ styles: c,
356
434
  mediaQuery: getMaxWidthQueryForSize(
357
435
  "medium",
358
436
  r
359
437
  )
360
- }) : "", b = c ? createCssClass({
438
+ }) : "", b = l ? createCssClass({
361
439
  className: u,
362
- styles: c,
440
+ styles: l,
363
441
  mediaQuery: getMaxWidthQueryForSize(
364
442
  "small",
365
443
  r
@@ -369,95 +447,6 @@ function BlockStyles(e) {
369
447
  }
370
448
  return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
371
449
  }
372
- function getBlockComponentOptions(e) {
373
- var t;
374
- return {
375
- ...(t = e.component) == null ? void 0 : t.options,
376
- ...e.options,
377
- /**
378
- * Our built-in components frequently make use of the block, so we provide all of it under `builderBlock`
379
- */
380
- builderBlock: e
381
- };
382
- }
383
- const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"], isEmptyHtmlElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.includes(e.toLowerCase()), getComponent = ({
384
- block: e,
385
- context: t,
386
- registeredComponents: n
387
- }) => {
388
- var a;
389
- const i = (a = getProcessedBlock({
390
- block: e,
391
- localState: t.localState,
392
- rootState: t.rootState,
393
- rootSetState: t.rootSetState,
394
- context: t.context,
395
- shouldEvaluateBindings: !1
396
- }).component) == null ? void 0 : a.name;
397
- if (!i)
398
- return null;
399
- const o = n[i];
400
- if (o)
401
- return o;
402
- console.warn(`
403
- Could not find a registered component named "${i}".
404
- If you registered it, is the file that registered it imported by the file that needs to render it?`);
405
- }, getRepeatItemData = ({
406
- block: e,
407
- context: t
408
- }) => {
409
- const {
410
- repeat: n,
411
- ...i
412
- } = e;
413
- if (!(n != null && n.collection))
414
- return;
415
- const o = evaluate({
416
- code: n.collection,
417
- localState: t.localState,
418
- rootState: t.rootState,
419
- rootSetState: t.rootSetState,
420
- context: t.context
421
- });
422
- if (!Array.isArray(o))
423
- return;
424
- const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
425
- return o.map((s, c) => ({
426
- context: {
427
- ...t,
428
- localState: {
429
- ...t.localState,
430
- $index: c,
431
- $item: s,
432
- [r]: s,
433
- [`$${r}Index`]: c
434
- }
435
- },
436
- block: i
437
- }));
438
- }, builderContext = createContext({
439
- content: null,
440
- context: {},
441
- localState: void 0,
442
- rootSetState() {
443
- },
444
- rootState: {},
445
- apiKey: null,
446
- apiVersion: void 0,
447
- componentInfos: {},
448
- inheritedStyles: {}
449
- });
450
- function RepeatedBlock(e) {
451
- const [t, n] = useState(() => e.repeatContext);
452
- return /* @__PURE__ */ jsx(builderContext.Provider, { value: t, children: /* @__PURE__ */ jsx(
453
- Block,
454
- {
455
- block: e.block,
456
- context: t,
457
- registeredComponents: e.registeredComponents
458
- }
459
- ) });
460
- }
461
450
  function capitalizeFirstLetter(e) {
462
451
  return e.charAt(0).toUpperCase() + e.slice(1);
463
452
  }
@@ -525,16 +514,60 @@ function getStyleAttribute(e) {
525
514
  return e;
526
515
  }
527
516
  }
528
- function InteractiveElement(e) {
529
- return /* @__PURE__ */ jsx(
530
- e.Wrapper,
531
- {
532
- ...e.wrapperProps,
533
- attributes: {
534
- ...getBlockProperties({
535
- block: e.block,
536
- context: e.context
537
- }),
517
+ function BlockWrapper(e) {
518
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
519
+ " ",
520
+ e.hasChildren ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
521
+ e.Wrapper,
522
+ {
523
+ ...getBlockProperties({
524
+ block: e.block,
525
+ context: e.context
526
+ }),
527
+ ...getBlockActions({
528
+ block: e.block,
529
+ rootState: e.context.rootState,
530
+ rootSetState: e.context.rootSetState,
531
+ localState: e.context.localState,
532
+ context: e.context.context,
533
+ stripPrefix: !0
534
+ }),
535
+ children: [
536
+ " ",
537
+ e.children,
538
+ " "
539
+ ]
540
+ }
541
+ ) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
542
+ e.Wrapper,
543
+ {
544
+ ...getBlockProperties({
545
+ block: e.block,
546
+ context: e.context
547
+ }),
548
+ ...getBlockActions({
549
+ block: e.block,
550
+ rootState: e.context.rootState,
551
+ rootSetState: e.context.rootSetState,
552
+ localState: e.context.localState,
553
+ context: e.context.context,
554
+ stripPrefix: !0
555
+ })
556
+ }
557
+ ) }),
558
+ " "
559
+ ] });
560
+ }
561
+ function InteractiveElement(e) {
562
+ return /* @__PURE__ */ jsx(
563
+ e.Wrapper,
564
+ {
565
+ ...e.wrapperProps,
566
+ attributes: {
567
+ ...getBlockProperties({
568
+ block: e.block,
569
+ context: e.context
570
+ }),
538
571
  ...getBlockActions({
539
572
  block: e.block,
540
573
  rootState: e.context.rootState,
@@ -612,49 +645,16 @@ function ComponentRef(e) {
612
645
  }
613
646
  ) }) : null });
614
647
  }
615
- function BlockWrapper(e) {
616
- return /* @__PURE__ */ jsxs(Fragment, { children: [
617
- " ",
618
- e.hasChildren ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
619
- e.Wrapper,
620
- {
621
- ...getBlockProperties({
622
- block: e.block,
623
- context: e.context
624
- }),
625
- ...getBlockActions({
626
- block: e.block,
627
- rootState: e.context.rootState,
628
- rootSetState: e.context.rootSetState,
629
- localState: e.context.localState,
630
- context: e.context.context,
631
- stripPrefix: !0
632
- }),
633
- children: [
634
- " ",
635
- e.children,
636
- " "
637
- ]
638
- }
639
- ) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
640
- e.Wrapper,
641
- {
642
- ...getBlockProperties({
643
- block: e.block,
644
- context: e.context
645
- }),
646
- ...getBlockActions({
647
- block: e.block,
648
- rootState: e.context.rootState,
649
- rootSetState: e.context.rootSetState,
650
- localState: e.context.localState,
651
- context: e.context.context,
652
- stripPrefix: !0
653
- })
654
- }
655
- ) }),
656
- " "
657
- ] });
648
+ function RepeatedBlock(e) {
649
+ const [t, n] = useState(() => e.repeatContext);
650
+ return /* @__PURE__ */ jsx(builderContext.Provider, { value: t, children: /* @__PURE__ */ jsx(
651
+ Block,
652
+ {
653
+ block: e.block,
654
+ context: t,
655
+ registeredComponents: e.registeredComponents
656
+ }
657
+ ) });
658
658
  }
659
659
  function Block(e) {
660
660
  var u, f, h, b;
@@ -691,7 +691,7 @@ function Block(e) {
691
691
  var x;
692
692
  return !((x = t == null ? void 0 : t()) != null && x.component) && !n() ? i().children ?? [] : [];
693
693
  }
694
- function l() {
694
+ function s() {
695
695
  var d, x, v, C, S;
696
696
  return {
697
697
  blockChildren: i().children ?? [],
@@ -703,15 +703,27 @@ function Block(e) {
703
703
  builderComponents: e.registeredComponents
704
704
  } : {}
705
705
  },
706
- context: s,
706
+ context: c,
707
707
  registeredComponents: e.registeredComponents,
708
708
  builderBlock: i(),
709
709
  includeBlockProps: ((C = t == null ? void 0 : t()) == null ? void 0 : C.noWrap) === !0,
710
710
  isInteractive: !((S = t == null ? void 0 : t()) != null && S.isRSC)
711
711
  };
712
712
  }
713
- const [s, c] = useState(() => e.context);
714
- return /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsx(Fragment, { children: (u = t == null ? void 0 : t()) != null && u.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ComponentRef, { ...l() }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
713
+ const [c, l] = useState(() => e.context);
714
+ return /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsx(Fragment, { children: (u = t == null ? void 0 : t()) != null && u.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
715
+ ComponentRef,
716
+ {
717
+ componentRef: s().componentRef,
718
+ componentOptions: s().componentOptions,
719
+ blockChildren: s().blockChildren,
720
+ context: s().context,
721
+ registeredComponents: s().registeredComponents,
722
+ builderBlock: s().builderBlock,
723
+ includeBlockProps: s().includeBlockProps,
724
+ isInteractive: s().isInteractive
725
+ }
726
+ ) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
715
727
  isEmptyHtmlElement(o()) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
716
728
  BlockWrapper,
717
729
  {
@@ -738,12 +750,24 @@ function Block(e) {
738
750
  context: e.context,
739
751
  hasChildren: !0,
740
752
  children: [
741
- /* @__PURE__ */ jsx(ComponentRef, { ...l() }),
753
+ /* @__PURE__ */ jsx(
754
+ ComponentRef,
755
+ {
756
+ componentRef: s().componentRef,
757
+ componentOptions: s().componentOptions,
758
+ blockChildren: s().blockChildren,
759
+ context: s().context,
760
+ registeredComponents: s().registeredComponents,
761
+ builderBlock: s().builderBlock,
762
+ includeBlockProps: s().includeBlockProps,
763
+ isInteractive: s().isInteractive
764
+ }
765
+ ),
742
766
  (h = r()) == null ? void 0 : h.map((d) => /* @__PURE__ */ jsx(
743
767
  Block,
744
768
  {
745
769
  block: d,
746
- context: s,
770
+ context: c,
747
771
  registeredComponents: e.registeredComponents
748
772
  },
749
773
  "block-" + d.id
@@ -752,7 +776,7 @@ function Block(e) {
752
776
  BlockStyles,
753
777
  {
754
778
  block: d,
755
- context: s
779
+ context: c
756
780
  },
757
781
  "block-style-" + d.id
758
782
  ))
@@ -813,7 +837,6 @@ function BlocksWrapper(e) {
813
837
  }` })
814
838
  ] });
815
839
  }
816
- const ComponentsContext = createContext({ registeredComponents: {} });
817
840
  function Blocks(e) {
818
841
  var i, o;
819
842
  const t = useContext(builderContext), n = useContext(ComponentsContext);
@@ -853,15 +876,15 @@ function Columns(e) {
853
876
  ), [i, o] = useState(() => e.columns || []), [a, r] = useState(
854
877
  () => e.stackColumnsAt || "tablet"
855
878
  );
856
- function l(S) {
879
+ function s(S) {
857
880
  var E;
858
881
  return ((E = i[S]) == null ? void 0 : E.width) || 100 / i.length;
859
882
  }
860
- function s(S) {
883
+ function c(S) {
861
884
  const E = t * (i.length - 1) / i.length;
862
- return `calc(${l(S)}% - ${E}px)`;
885
+ return `calc(${s(S)}% - ${E}px)`;
863
886
  }
864
- function c({
887
+ function l({
865
888
  stackedStyle: S,
866
889
  desktopStyle: E
867
890
  }) {
@@ -879,39 +902,39 @@ function Columns(e) {
879
902
  function b() {
880
903
  return {
881
904
  "--flex-dir": f,
882
- "--flex-dir-tablet": c({
905
+ "--flex-dir-tablet": l({
883
906
  stackedStyle: f,
884
907
  desktopStyle: "row"
885
908
  })
886
909
  };
887
910
  }
888
911
  function d(S) {
889
- const E = S === 0 ? 0 : t, I = s(S), T = `${E}px`, R = "100%", j = 0;
912
+ const E = S === 0 ? 0 : t, w = c(S), T = `${E}px`, R = "100%", j = 0;
890
913
  return {
891
- width: I,
914
+ width: w,
892
915
  ["marginLeft"]: T,
893
916
  "--column-width-mobile": u({
894
917
  stackedStyle: R,
895
- desktopStyle: I
918
+ desktopStyle: w
896
919
  }),
897
920
  "--column-margin-left-mobile": u({
898
921
  stackedStyle: j,
899
922
  desktopStyle: T
900
923
  }),
901
- "--column-width-tablet": c({
924
+ "--column-width-tablet": l({
902
925
  stackedStyle: R,
903
- desktopStyle: I
926
+ desktopStyle: w
904
927
  }),
905
- "--column-margin-left-tablet": c({
928
+ "--column-margin-left-tablet": l({
906
929
  stackedStyle: j,
907
930
  desktopStyle: T
908
931
  })
909
932
  };
910
933
  }
911
934
  function x(S) {
912
- var I, T;
935
+ var w, T;
913
936
  return getSizesForBreakpoints(
914
- ((T = (I = e.builderContext.content) == null ? void 0 : I.meta) == null ? void 0 : T.breakpoints) || {}
937
+ ((T = (w = e.builderContext.content) == null ? void 0 : w.meta) == null ? void 0 : T.breakpoints) || {}
915
938
  )[S].max;
916
939
  }
917
940
  function v() {
@@ -945,14 +968,14 @@ function Columns(e) {
945
968
  /* @__PURE__ */ jsxs(
946
969
  "div",
947
970
  {
948
- className: `builder-columns ${e.builderBlock.id}-breakpoints div-ac8f4142`,
971
+ className: `builder-columns ${e.builderBlock.id}-breakpoints div-53636e90`,
949
972
  style: b(),
950
973
  children: [
951
974
  /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: v() }) }),
952
975
  (C = e.columns) == null ? void 0 : C.map((S, E) => /* @__PURE__ */ createElement(
953
976
  "div",
954
977
  {
955
- className: "builder-column div-ac8f4142-2",
978
+ className: "builder-column div-53636e90-2",
956
979
  style: d(E),
957
980
  key: E
958
981
  },
@@ -973,10 +996,10 @@ function Columns(e) {
973
996
  ]
974
997
  }
975
998
  ),
976
- /* @__PURE__ */ jsx("style", { children: `.div-ac8f4142 {
999
+ /* @__PURE__ */ jsx("style", { children: `.div-53636e90 {
977
1000
  display: flex;
978
1001
  line-height: normal;
979
- }.div-ac8f4142-2 {
1002
+ }.div-53636e90-2 {
980
1003
  display: flex;
981
1004
  flex-direction: column;
982
1005
  align-items: stretch;
@@ -1017,34 +1040,34 @@ function getSrcSet(e) {
1017
1040
  return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, i]) => `${n} ${i}w`).concat([e]).join(", ") : e;
1018
1041
  }
1019
1042
  function Image(e) {
1020
- var o, a, r, l;
1043
+ var o, a, r, s;
1021
1044
  function t() {
1022
1045
  var u;
1023
- const c = e.image || e.src;
1024
- if (!c || // We can auto add srcset for cdn.builder.io and shopify
1046
+ const l = e.image || e.src;
1047
+ if (!l || // We can auto add srcset for cdn.builder.io and shopify
1025
1048
  // images, otherwise you can supply this prop manually
1026
- !(c.match(/builder\.io/) || c.match(/cdn\.shopify\.com/)))
1049
+ !(l.match(/builder\.io/) || l.match(/cdn\.shopify\.com/)))
1027
1050
  return e.srcset;
1028
1051
  if (e.srcset && ((u = e.image) != null && u.includes("builder.io/api/v1/image"))) {
1029
1052
  if (!e.srcset.includes(e.image.split("?")[0]))
1030
- return console.debug("Removed given srcset"), getSrcSet(c);
1053
+ return console.debug("Removed given srcset"), getSrcSet(l);
1031
1054
  } else if (e.image && !e.srcset)
1032
- return getSrcSet(c);
1033
- return getSrcSet(c);
1055
+ return getSrcSet(l);
1056
+ return getSrcSet(l);
1034
1057
  }
1035
1058
  function n() {
1036
- var s;
1037
- return (s = t == null ? void 0 : t()) != null && s.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
1059
+ var c;
1060
+ return (c = t == null ? void 0 : t()) != null && c.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
1038
1061
  }
1039
1062
  function i() {
1040
- const s = {
1063
+ const c = {
1041
1064
  position: "absolute",
1042
1065
  height: "100%",
1043
1066
  width: "100%",
1044
1067
  left: "0px",
1045
1068
  top: "0px"
1046
1069
  };
1047
- return e.aspectRatio ? s : void 0;
1070
+ return e.aspectRatio ? c : void 0;
1048
1071
  }
1049
1072
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1050
1073
  /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1061,7 +1084,7 @@ function Image(e) {
1061
1084
  objectFit: e.backgroundSize || "cover",
1062
1085
  ...i()
1063
1086
  },
1064
- className: "builder-image" + (e.className ? " " + e.className : "") + " img-497e0136",
1087
+ className: "builder-image" + (e.className ? " " + e.className : "") + " img-dbab4030",
1065
1088
  src: e.image,
1066
1089
  srcSet: t(),
1067
1090
  sizes: e.sizes
@@ -1071,23 +1094,23 @@ function Image(e) {
1071
1094
  e.aspectRatio && !((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1072
1095
  "div",
1073
1096
  {
1074
- className: "builder-image-sizer div-497e0136",
1097
+ className: "builder-image-sizer div-dbab4030",
1075
1098
  style: {
1076
1099
  paddingTop: e.aspectRatio * 100 + "%"
1077
1100
  }
1078
1101
  }
1079
1102
  ) }) : null,
1080
- (l = (r = e.builderBlock) == null ? void 0 : r.children) != null && l.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
1081
- !e.fitContent && e.children ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "div-497e0136-2", children: e.children }) }) : null
1103
+ (s = (r = e.builderBlock) == null ? void 0 : r.children) != null && s.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
1104
+ !e.fitContent && e.children ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "div-dbab4030-2", children: e.children }) }) : null
1082
1105
  ] }),
1083
- /* @__PURE__ */ jsx("style", { children: `.img-497e0136 {
1106
+ /* @__PURE__ */ jsx("style", { children: `.img-dbab4030 {
1084
1107
  opacity: 1;
1085
1108
  transition: opacity 0.2s ease-in-out;
1086
- }.div-497e0136 {
1109
+ }.div-dbab4030 {
1087
1110
  width: 100%;
1088
1111
  pointer-events: none;
1089
1112
  font-size: 0;
1090
- }.div-497e0136-2 {
1113
+ }.div-dbab4030-2 {
1091
1114
  display: flex;
1092
1115
  flex-direction: column;
1093
1116
  align-items: stretch;
@@ -1120,98 +1143,7 @@ function SectionComponent(e) {
1120
1143
  }
1121
1144
  );
1122
1145
  }
1123
- const getVariants = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
1124
- ...t,
1125
- testVariationId: t.id,
1126
- id: e == null ? void 0 : e.id
1127
- })), checkShouldRunVariants = ({
1128
- canTrack: e,
1129
- content: t
1130
- }) => !(!(getVariants(t).length > 0) || !e || isBrowser());
1131
- function bldrAbTest(e, t, n) {
1132
- var r;
1133
- function i() {
1134
- function l(d, x, v) {
1135
- let C = "";
1136
- if (v) {
1137
- const S = /* @__PURE__ */ new Date();
1138
- S.setTime(S.getTime() + v * 24 * 60 * 60 * 1e3), C = "; expires=" + S.toUTCString();
1139
- }
1140
- document.cookie = d + "=" + (x || "") + C + "; path=/; Secure; SameSite=None";
1141
- }
1142
- function s(d) {
1143
- const x = d + "=", v = document.cookie.split(";");
1144
- for (let C = 0; C < v.length; C++) {
1145
- let S = v[C];
1146
- for (; S.charAt(0) === " "; )
1147
- S = S.substring(1, S.length);
1148
- if (S.indexOf(x) === 0)
1149
- return S.substring(x.length, S.length);
1150
- }
1151
- return null;
1152
- }
1153
- const c = `builder.tests.${e}`, u = s(c), f = t.map((d) => d.id).concat(e);
1154
- if (u && f.includes(u))
1155
- return u;
1156
- let h = 0;
1157
- const b = Math.random();
1158
- for (let d = 0; d < t.length; d++) {
1159
- const x = t[d], v = x.testRatio;
1160
- if (h += v, b < h)
1161
- return l(c, x.id), x.id;
1162
- }
1163
- return l(c, e), e;
1164
- }
1165
- const o = i(), a = (r = document.currentScript) == null ? void 0 : r.previousElementSibling;
1166
- if (n) {
1167
- a.remove();
1168
- const l = document.currentScript;
1169
- l == null || l.remove();
1170
- } else {
1171
- const l = t.concat({
1172
- id: e
1173
- }).filter((s) => s.id !== o).map((s) => `.variant-${s.id} { display: none; }
1174
- `).join("");
1175
- a.innerHTML = l;
1176
- }
1177
- }
1178
- function bldrCntntScrpt(e, t, n) {
1179
- var s;
1180
- if (!navigator.cookieEnabled)
1181
- return;
1182
- function i(c) {
1183
- const u = c + "=", f = document.cookie.split(";");
1184
- for (let h = 0; h < f.length; h++) {
1185
- let b = f[h];
1186
- for (; b.charAt(0) === " "; )
1187
- b = b.substring(1, b.length);
1188
- if (b.indexOf(u) === 0)
1189
- return b.substring(u.length, b.length);
1190
- }
1191
- return null;
1192
- }
1193
- const o = `builder.tests.${t}`, a = i(o), r = (s = document.currentScript) == null ? void 0 : s.parentElement, l = e === t;
1194
- if (a === e) {
1195
- if (l)
1196
- return;
1197
- r == null || r.removeAttribute("hidden"), r == null || r.removeAttribute("aria-hidden");
1198
- } else {
1199
- l && (n ? r == null || r.remove() : (r == null || r.setAttribute("hidden", "true"), r == null || r.setAttribute("aria-hidden", "true")));
1200
- return;
1201
- }
1202
- }
1203
- const getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydrationTarget = getIsHydrationTarget(TARGET), AB_TEST_FN_NAME = "builderIoAbTest", CONTENT_FN_NAME = "builderIoRenderContent", getScriptString = () => {
1204
- const e = bldrAbTest.toString().replace(/\s+/g, " "), t = bldrCntntScrpt.toString().replace(/\s+/g, " ");
1205
- return `
1206
- window.${AB_TEST_FN_NAME} = ${e}
1207
- window.${CONTENT_FN_NAME} = ${t}
1208
- `;
1209
- }, getVariantsScriptString = (e, t) => `
1210
- window.${AB_TEST_FN_NAME}("${t}",${JSON.stringify(e)}, ${isHydrationTarget})`, getRenderContentScriptString = ({
1211
- contentId: e,
1212
- variationId: t
1213
- }) => `
1214
- window.${CONTENT_FN_NAME}("${t}", "${e}", ${isHydrationTarget})`, componentInfo$a = {
1146
+ const componentInfo$a = {
1215
1147
  name: "Core:Button",
1216
1148
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
1217
1149
  defaultStyles: {
@@ -1423,7 +1355,7 @@ const getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydr
1423
1355
  });
1424
1356
  }
1425
1357
  const n = e.get("columns");
1426
- Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((l, s) => l + s.get("width"), 0) !== 100) && t();
1358
+ 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();
1427
1359
  }
1428
1360
  }, {
1429
1361
  name: "space",
@@ -1446,76 +1378,194 @@ const getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydr
1446
1378
  advanced: !0
1447
1379
  }]
1448
1380
  }, componentInfo$8 = {
1449
- name: "Fragment",
1450
- static: !0,
1451
- hidden: !0,
1452
- canHaveChildren: !0,
1453
- noWrap: !0
1454
- }, componentInfo$7 = {
1455
- name: "Image",
1381
+ name: "Custom Code",
1456
1382
  static: !0,
1457
- 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",
1458
- defaultStyles: {
1459
- position: "relative",
1460
- minHeight: "20px",
1461
- minWidth: "20px",
1462
- overflow: "hidden"
1463
- },
1464
- canHaveChildren: !0,
1383
+ requiredPermissions: ["editCode"],
1465
1384
  inputs: [{
1466
- name: "image",
1467
- type: "file",
1468
- bubble: !0,
1469
- allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
1385
+ name: "code",
1386
+ type: "html",
1470
1387
  required: !0,
1471
- defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
1472
- onChange: (e) => {
1473
- e.delete("srcset"), e.delete("noWebp");
1474
- function n(r, l = 6e4) {
1475
- return new Promise((s, c) => {
1476
- const u = document.createElement("img");
1477
- let f = !1;
1478
- u.onload = () => {
1479
- f = !0, s(u);
1480
- }, u.addEventListener("error", (h) => {
1481
- console.warn("Image load failed", h.error), c(h.error);
1482
- }), u.src = r, setTimeout(() => {
1483
- f || c(new Error("Image load timed out"));
1484
- }, l);
1485
- });
1486
- }
1487
- function i(r) {
1488
- return Math.round(r * 1e3) / 1e3;
1489
- }
1490
- const o = e.get("image"), a = e.get("aspectRatio");
1491
- if (fetch(o).then((r) => r.blob()).then((r) => {
1492
- r.type.includes("svg") && e.set("noWebp", !0);
1493
- }), o && (!a || a === 0.7041))
1494
- return n(o).then((r) => {
1495
- const l = e.get("aspectRatio");
1496
- e.get("image") === o && (!l || l === 0.7041) && r.width && r.height && (e.set("aspectRatio", i(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
1497
- });
1498
- }
1499
- }, {
1500
- name: "backgroundSize",
1501
- type: "text",
1502
- defaultValue: "cover",
1503
- enum: [{
1504
- label: "contain",
1505
- value: "contain",
1506
- helperText: "The image should never get cropped"
1507
- }, {
1508
- label: "cover",
1509
- value: "cover",
1510
- helperText: "The image should fill it's box, cropping when needed"
1511
- }]
1388
+ defaultValue: "<p>Hello there, I am custom HTML code!</p>",
1389
+ code: !0
1512
1390
  }, {
1513
- name: "backgroundPosition",
1514
- type: "text",
1515
- defaultValue: "center",
1516
- enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
1391
+ name: "replaceNodes",
1392
+ type: "boolean",
1393
+ helperText: "Preserve server rendered dom nodes",
1394
+ advanced: !0
1517
1395
  }, {
1518
- name: "altText",
1396
+ name: "scriptsClientOnly",
1397
+ type: "boolean",
1398
+ defaultValue: !1,
1399
+ helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
1400
+ advanced: !0
1401
+ }]
1402
+ };
1403
+ function CustomCode(e) {
1404
+ const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []);
1405
+ return useEffect(() => {
1406
+ var s;
1407
+ if (!((s = t.current) != null && s.getElementsByTagName) || typeof window > "u")
1408
+ return;
1409
+ const r = t.current.getElementsByTagName("script");
1410
+ for (let c = 0; c < r.length; c++) {
1411
+ const l = r[c];
1412
+ if (l.src) {
1413
+ if (n.includes(l.src))
1414
+ continue;
1415
+ n.push(l.src);
1416
+ const u = document.createElement("script");
1417
+ u.async = !0, u.src = l.src, document.head.appendChild(u);
1418
+ } else if (!l.type || [
1419
+ "text/javascript",
1420
+ "application/javascript",
1421
+ "application/ecmascript"
1422
+ ].includes(l.type)) {
1423
+ if (o.includes(l.innerText))
1424
+ continue;
1425
+ try {
1426
+ o.push(l.innerText), new Function(l.innerText)();
1427
+ } catch (u) {
1428
+ console.warn("`CustomCode`: Error running script:", u);
1429
+ }
1430
+ }
1431
+ }
1432
+ }, []), /* @__PURE__ */ jsx(
1433
+ "div",
1434
+ {
1435
+ ref: t,
1436
+ className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
1437
+ dangerouslySetInnerHTML: { __html: e.code }
1438
+ }
1439
+ );
1440
+ }
1441
+ const componentInfo$7 = {
1442
+ name: "Embed",
1443
+ static: !0,
1444
+ inputs: [{
1445
+ name: "url",
1446
+ type: "url",
1447
+ required: !0,
1448
+ defaultValue: "",
1449
+ helperText: "e.g. enter a youtube url, google map, etc",
1450
+ onChange: (e) => {
1451
+ const t = e.get("url");
1452
+ if (t)
1453
+ return e.set("content", "Loading..."), fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then((i) => i.json()).then((i) => {
1454
+ e.get("url") === t && (i.html ? e.set("content", i.html) : e.set("content", "Invalid url, please try another"));
1455
+ }).catch((i) => {
1456
+ e.set("content", "There was an error embedding this URL, please try again or another URL");
1457
+ });
1458
+ e.delete("content");
1459
+ }
1460
+ }, {
1461
+ name: "content",
1462
+ type: "html",
1463
+ defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1464
+ hideFromUI: !0
1465
+ }]
1466
+ }, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
1467
+ function Embed(e) {
1468
+ const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, s] = useState(() => !1);
1469
+ function c() {
1470
+ if (!t.current || !t.current.getElementsByTagName)
1471
+ return;
1472
+ const l = t.current.getElementsByTagName("script");
1473
+ for (let u = 0; u < l.length; u++) {
1474
+ const f = l[u];
1475
+ if (f.src && !n.includes(f.src)) {
1476
+ n.push(f.src);
1477
+ const h = document.createElement("script");
1478
+ h.async = !0, h.src = f.src, document.head.appendChild(h);
1479
+ } else if (isJsScript(f) && !o.includes(f.innerText))
1480
+ try {
1481
+ o.push(f.innerText), new Function(f.innerText)();
1482
+ } catch (h) {
1483
+ console.warn("`Embed`: Error running script:", h);
1484
+ }
1485
+ }
1486
+ }
1487
+ return useEffect(() => {
1488
+ t.current && !r && (s(!0), c());
1489
+ }, [t.current, r]), /* @__PURE__ */ jsx(
1490
+ "div",
1491
+ {
1492
+ className: "builder-embed",
1493
+ ref: t,
1494
+ dangerouslySetInnerHTML: { __html: e.content }
1495
+ }
1496
+ );
1497
+ }
1498
+ const componentInfo$6 = {
1499
+ name: "Fragment",
1500
+ static: !0,
1501
+ hidden: !0,
1502
+ canHaveChildren: !0,
1503
+ noWrap: !0
1504
+ }, componentInfo$5 = {
1505
+ name: "Image",
1506
+ static: !0,
1507
+ 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",
1508
+ defaultStyles: {
1509
+ position: "relative",
1510
+ minHeight: "20px",
1511
+ minWidth: "20px",
1512
+ overflow: "hidden"
1513
+ },
1514
+ canHaveChildren: !0,
1515
+ inputs: [{
1516
+ name: "image",
1517
+ type: "file",
1518
+ bubble: !0,
1519
+ allowedFileTypes: ["jpeg", "jpg", "png", "svg"],
1520
+ required: !0,
1521
+ defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
1522
+ onChange: (e) => {
1523
+ e.delete("srcset"), e.delete("noWebp");
1524
+ function n(r, s = 6e4) {
1525
+ return new Promise((c, l) => {
1526
+ const u = document.createElement("img");
1527
+ let f = !1;
1528
+ u.onload = () => {
1529
+ f = !0, c(u);
1530
+ }, u.addEventListener("error", (h) => {
1531
+ console.warn("Image load failed", h.error), l(h.error);
1532
+ }), u.src = r, setTimeout(() => {
1533
+ f || l(new Error("Image load timed out"));
1534
+ }, s);
1535
+ });
1536
+ }
1537
+ function i(r) {
1538
+ return Math.round(r * 1e3) / 1e3;
1539
+ }
1540
+ const o = e.get("image"), a = e.get("aspectRatio");
1541
+ if (fetch(o).then((r) => r.blob()).then((r) => {
1542
+ r.type.includes("svg") && e.set("noWebp", !0);
1543
+ }), o && (!a || a === 0.7041))
1544
+ return n(o).then((r) => {
1545
+ const s = e.get("aspectRatio");
1546
+ 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));
1547
+ });
1548
+ }
1549
+ }, {
1550
+ name: "backgroundSize",
1551
+ type: "text",
1552
+ defaultValue: "cover",
1553
+ enum: [{
1554
+ label: "contain",
1555
+ value: "contain",
1556
+ helperText: "The image should never get cropped"
1557
+ }, {
1558
+ label: "cover",
1559
+ value: "cover",
1560
+ helperText: "The image should fill it's box, cropping when needed"
1561
+ }]
1562
+ }, {
1563
+ name: "backgroundPosition",
1564
+ type: "text",
1565
+ defaultValue: "center",
1566
+ enum: ["center", "top", "left", "right", "bottom", "top left", "top right", "bottom left", "bottom right"]
1567
+ }, {
1568
+ name: "altText",
1519
1569
  type: "string",
1520
1570
  helperText: "Text to display when the user has images off"
1521
1571
  }, {
@@ -1551,7 +1601,37 @@ const getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydr
1551
1601
  advanced: !0,
1552
1602
  defaultValue: 0.7041
1553
1603
  }]
1554
- }, componentInfo$6 = {
1604
+ }, componentInfo$4 = {
1605
+ // friendlyName?
1606
+ name: "Raw:Img",
1607
+ hideFromInsertMenu: !0,
1608
+ 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",
1609
+ inputs: [{
1610
+ name: "image",
1611
+ bubble: !0,
1612
+ type: "file",
1613
+ allowedFileTypes: ["jpeg", "jpg", "png", "svg", "gif", "webp"],
1614
+ required: !0
1615
+ }],
1616
+ noWrap: !0,
1617
+ static: !0
1618
+ };
1619
+ function ImgComponent(e) {
1620
+ return /* @__PURE__ */ jsx(
1621
+ "img",
1622
+ {
1623
+ style: {
1624
+ objectFit: e.backgroundSize || "cover",
1625
+ objectPosition: e.backgroundPosition || "center"
1626
+ },
1627
+ alt: e.altText,
1628
+ src: e.imgSrc || e.image,
1629
+ ...e.attributes
1630
+ },
1631
+ isEditing() && e.imgSrc || "default-key"
1632
+ );
1633
+ }
1634
+ const componentInfo$3 = {
1555
1635
  name: "Core:Section",
1556
1636
  static: !0,
1557
1637
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -1590,7 +1670,7 @@ const getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydr
1590
1670
  }
1591
1671
  }
1592
1672
  }]
1593
- }, componentInfo$5 = {
1673
+ }, componentInfo$2 = {
1594
1674
  name: "Symbol",
1595
1675
  noWrap: !0,
1596
1676
  static: !0,
@@ -1623,7 +1703,7 @@ const getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydr
1623
1703
  hideFromUI: !0,
1624
1704
  type: "boolean"
1625
1705
  }]
1626
- }, componentInfo$4 = {
1706
+ }, componentInfo$1 = {
1627
1707
  name: "Text",
1628
1708
  static: !0,
1629
1709
  isRSC: !0,
@@ -1655,7 +1735,7 @@ function Text(e) {
1655
1735
  }
1656
1736
  );
1657
1737
  }
1658
- const componentInfo$3 = {
1738
+ const componentInfo = {
1659
1739
  name: "Video",
1660
1740
  canHaveChildren: !0,
1661
1741
  defaultStyles: {
@@ -1784,154 +1864,7 @@ function Video(e) {
1784
1864
  }
1785
1865
  );
1786
1866
  }
1787
- const componentInfo$2 = {
1788
- name: "Embed",
1789
- static: !0,
1790
- inputs: [{
1791
- name: "url",
1792
- type: "url",
1793
- required: !0,
1794
- defaultValue: "",
1795
- helperText: "e.g. enter a youtube url, google map, etc",
1796
- onChange: (e) => {
1797
- const t = e.get("url");
1798
- if (t)
1799
- return e.set("content", "Loading..."), fetch(`https://iframe.ly/api/iframely?url=${t}&api_key=ae0e60e78201a3f2b0de4b`).then((i) => i.json()).then((i) => {
1800
- e.get("url") === t && (i.html ? e.set("content", i.html) : e.set("content", "Invalid url, please try another"));
1801
- }).catch((i) => {
1802
- e.set("content", "There was an error embedding this URL, please try again or another URL");
1803
- });
1804
- e.delete("content");
1805
- }
1806
- }, {
1807
- name: "content",
1808
- type: "html",
1809
- defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1810
- hideFromUI: !0
1811
- }]
1812
- }, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
1813
- function Embed(e) {
1814
- const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, l] = useState(() => !1);
1815
- function s() {
1816
- if (!t.current || !t.current.getElementsByTagName)
1817
- return;
1818
- const c = t.current.getElementsByTagName("script");
1819
- for (let u = 0; u < c.length; u++) {
1820
- const f = c[u];
1821
- if (f.src && !n.includes(f.src)) {
1822
- n.push(f.src);
1823
- const h = document.createElement("script");
1824
- h.async = !0, h.src = f.src, document.head.appendChild(h);
1825
- } else if (isJsScript(f) && !o.includes(f.innerText))
1826
- try {
1827
- o.push(f.innerText), new Function(f.innerText)();
1828
- } catch (h) {
1829
- console.warn("`Embed`: Error running script:", h);
1830
- }
1831
- }
1832
- }
1833
- return useEffect(() => {
1834
- t.current && !r && (l(!0), s());
1835
- }, [t.current, r]), /* @__PURE__ */ jsx(
1836
- "div",
1837
- {
1838
- className: "builder-embed",
1839
- ref: t,
1840
- dangerouslySetInnerHTML: { __html: e.content }
1841
- }
1842
- );
1843
- }
1844
- function ImgComponent(e) {
1845
- return /* @__PURE__ */ jsx(
1846
- "img",
1847
- {
1848
- style: {
1849
- objectFit: e.backgroundSize || "cover",
1850
- objectPosition: e.backgroundPosition || "center"
1851
- },
1852
- alt: e.altText,
1853
- src: e.imgSrc || e.image,
1854
- ...e.attributes
1855
- },
1856
- isEditing() && e.imgSrc || "default-key"
1857
- );
1858
- }
1859
- const componentInfo$1 = {
1860
- // friendlyName?
1861
- name: "Raw:Img",
1862
- hideFromInsertMenu: !0,
1863
- 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",
1864
- inputs: [{
1865
- name: "image",
1866
- bubble: !0,
1867
- type: "file",
1868
- allowedFileTypes: ["jpeg", "jpg", "png", "svg", "gif", "webp"],
1869
- required: !0
1870
- }],
1871
- noWrap: !0,
1872
- static: !0
1873
- };
1874
- function CustomCode(e) {
1875
- const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []);
1876
- return useEffect(() => {
1877
- var l;
1878
- if (!((l = t.current) != null && l.getElementsByTagName) || typeof window > "u")
1879
- return;
1880
- const r = t.current.getElementsByTagName("script");
1881
- for (let s = 0; s < r.length; s++) {
1882
- const c = r[s];
1883
- if (c.src) {
1884
- if (n.includes(c.src))
1885
- continue;
1886
- n.push(c.src);
1887
- const u = document.createElement("script");
1888
- u.async = !0, u.src = c.src, document.head.appendChild(u);
1889
- } else if (!c.type || [
1890
- "text/javascript",
1891
- "application/javascript",
1892
- "application/ecmascript"
1893
- ].includes(c.type)) {
1894
- if (o.includes(c.innerText))
1895
- continue;
1896
- try {
1897
- o.push(c.innerText), new Function(c.innerText)();
1898
- } catch (u) {
1899
- console.warn("`CustomCode`: Error running script:", u);
1900
- }
1901
- }
1902
- }
1903
- }, []), /* @__PURE__ */ jsx(
1904
- "div",
1905
- {
1906
- ref: t,
1907
- className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
1908
- dangerouslySetInnerHTML: { __html: e.code }
1909
- }
1910
- );
1911
- }
1912
- const componentInfo = {
1913
- name: "Custom Code",
1914
- static: !0,
1915
- requiredPermissions: ["editCode"],
1916
- inputs: [{
1917
- name: "code",
1918
- type: "html",
1919
- required: !0,
1920
- defaultValue: "<p>Hello there, I am custom HTML code!</p>",
1921
- code: !0
1922
- }, {
1923
- name: "replaceNodes",
1924
- type: "boolean",
1925
- helperText: "Preserve server rendered dom nodes",
1926
- advanced: !0
1927
- }, {
1928
- name: "scriptsClientOnly",
1929
- type: "boolean",
1930
- defaultValue: !1,
1931
- helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
1932
- advanced: !0
1933
- }]
1934
- }, getDefaultRegisteredComponents = () => [{
1867
+ const getDefaultRegisteredComponents = () => [{
1935
1868
  component: Button,
1936
1869
  ...componentInfo$a
1937
1870
  }, {
@@ -1939,126 +1872,175 @@ const componentInfo = {
1939
1872
  ...componentInfo$9
1940
1873
  }, {
1941
1874
  component: CustomCode,
1942
- ...componentInfo
1875
+ ...componentInfo$8
1943
1876
  }, {
1944
1877
  component: Embed,
1945
- ...componentInfo$2
1878
+ ...componentInfo$7
1946
1879
  }, {
1947
1880
  component: FragmentComponent,
1948
- ...componentInfo$8
1881
+ ...componentInfo$6
1949
1882
  }, {
1950
1883
  component: Image,
1951
- ...componentInfo$7
1884
+ ...componentInfo$5
1952
1885
  }, {
1953
1886
  component: ImgComponent,
1954
- ...componentInfo$1
1887
+ ...componentInfo$4
1955
1888
  }, {
1956
1889
  component: SectionComponent,
1957
- ...componentInfo$6
1890
+ ...componentInfo$3
1958
1891
  }, {
1959
1892
  component: Symbol$1,
1960
- ...componentInfo$5
1893
+ ...componentInfo$2
1961
1894
  }, {
1962
1895
  component: Text,
1963
- ...componentInfo$4
1896
+ ...componentInfo$1
1964
1897
  }, {
1965
1898
  component: Video,
1966
- ...componentInfo$3
1967
- }], getCssFromFont = (e) => {
1968
- var a;
1969
- const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = e.fileUrl ?? ((a = e == null ? void 0 : e.files) == null ? void 0 : a.regular);
1970
- let o = "";
1971
- if (i && t && n && (o += `
1972
- @font-face {
1973
- font-family: "${t}";
1974
- src: local("${n}"), url('${i}') format('woff2');
1975
- font-display: fallback;
1976
- font-weight: 400;
1977
- }
1978
- `.trim()), e.files)
1979
- for (const r in e.files) {
1980
- if (!(String(Number(r)) === r))
1981
- continue;
1982
- const s = e.files[r];
1983
- s && s !== i && (o += `
1984
- @font-face {
1985
- font-family: "${t}";
1986
- src: url('${s}') format('woff2');
1987
- font-display: fallback;
1988
- font-weight: ${r};
1989
- }
1990
- `.trim());
1899
+ ...componentInfo
1900
+ }], getVariants = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
1901
+ ...t,
1902
+ testVariationId: t.id,
1903
+ id: e == null ? void 0 : e.id
1904
+ })), checkShouldRunVariants = ({
1905
+ canTrack: e,
1906
+ content: t
1907
+ }) => !(!(getVariants(t).length > 0) || !e || isBrowser());
1908
+ function bldrAbTest(e, t, n) {
1909
+ var r;
1910
+ function i() {
1911
+ function s(d, x, v) {
1912
+ let C = "";
1913
+ if (v) {
1914
+ const S = /* @__PURE__ */ new Date();
1915
+ S.setTime(S.getTime() + v * 24 * 60 * 60 * 1e3), C = "; expires=" + S.toUTCString();
1916
+ }
1917
+ document.cookie = d + "=" + (x || "") + C + "; path=/; Secure; SameSite=None";
1991
1918
  }
1992
- return o;
1993
- }, getFontCss = ({
1994
- customFonts: e
1995
- }) => {
1996
- var t;
1997
- return ((t = e == null ? void 0 : e.map((n) => getCssFromFont(n))) == null ? void 0 : t.join(" ")) || "";
1998
- }, getCss = ({
1999
- cssCode: e,
2000
- contentId: t
2001
- }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
2002
- function ContentStyles(e) {
2003
- const [t, n] = useState(
2004
- () => `
2005
- ${getCss({
2006
- cssCode: e.cssCode,
2007
- contentId: e.contentId
2008
- })}
2009
- ${getFontCss({
2010
- customFonts: e.customFonts
2011
- })}
2012
-
2013
- .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
2014
- margin: 0;
1919
+ function c(d) {
1920
+ const x = d + "=", v = document.cookie.split(";");
1921
+ for (let C = 0; C < v.length; C++) {
1922
+ let S = v[C];
1923
+ for (; S.charAt(0) === " "; )
1924
+ S = S.substring(1, S.length);
1925
+ if (S.indexOf(x) === 0)
1926
+ return S.substring(x.length, S.length);
1927
+ }
1928
+ return null;
1929
+ }
1930
+ const l = `builder.tests.${e}`, u = c(l), f = t.map((d) => d.id).concat(e);
1931
+ if (u && f.includes(u))
1932
+ return u;
1933
+ let h = 0;
1934
+ const b = Math.random();
1935
+ for (let d = 0; d < t.length; d++) {
1936
+ const x = t[d], v = x.testRatio;
1937
+ if (h += v, b < h)
1938
+ return s(l, x.id), x.id;
1939
+ }
1940
+ return s(l, e), e;
1941
+ }
1942
+ const o = i(), a = (r = document.currentScript) == null ? void 0 : r.previousElementSibling;
1943
+ if (n) {
1944
+ a.remove();
1945
+ const s = document.currentScript;
1946
+ s == null || s.remove();
1947
+ } else {
1948
+ const s = t.concat({
1949
+ id: e
1950
+ }).filter((c) => c.id !== o).map((c) => `.variant-${c.id} { display: none; }
1951
+ `).join("");
1952
+ a.innerHTML = s;
1953
+ }
2015
1954
  }
2016
- .builder-text > p, .builder-text > .builder-paragraph {
2017
- color: inherit;
2018
- line-height: inherit;
2019
- letter-spacing: inherit;
2020
- font-weight: inherit;
2021
- font-size: inherit;
2022
- text-align: inherit;
2023
- font-family: inherit;
1955
+ function bldrCntntScrpt(e, t, n) {
1956
+ var c;
1957
+ if (!navigator.cookieEnabled)
1958
+ return;
1959
+ function i(l) {
1960
+ const u = l + "=", f = document.cookie.split(";");
1961
+ for (let h = 0; h < f.length; h++) {
1962
+ let b = f[h];
1963
+ for (; b.charAt(0) === " "; )
1964
+ b = b.substring(1, b.length);
1965
+ if (b.indexOf(u) === 0)
1966
+ return b.substring(u.length, b.length);
1967
+ }
1968
+ return null;
1969
+ }
1970
+ const o = `builder.tests.${t}`, a = i(o), r = (c = document.currentScript) == null ? void 0 : c.parentElement, s = e === t;
1971
+ if (a === e) {
1972
+ if (s)
1973
+ return;
1974
+ r == null || r.removeAttribute("hidden"), r == null || r.removeAttribute("aria-hidden");
1975
+ } else {
1976
+ s && (n ? r == null || r.remove() : (r == null || r.setAttribute("hidden", "true"), r == null || r.setAttribute("aria-hidden", "true")));
1977
+ return;
1978
+ }
2024
1979
  }
2025
- `.trim()
1980
+ const getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydrationTarget = getIsHydrationTarget(TARGET), AB_TEST_FN_NAME = "builderIoAbTest", CONTENT_FN_NAME = "builderIoRenderContent", getScriptString = () => {
1981
+ const e = bldrAbTest.toString().replace(/\s+/g, " "), t = bldrCntntScrpt.toString().replace(/\s+/g, " ");
1982
+ return `
1983
+ window.${AB_TEST_FN_NAME} = ${e}
1984
+ window.${CONTENT_FN_NAME} = ${t}
1985
+ `;
1986
+ }, getVariantsScriptString = (e, t) => `
1987
+ window.${AB_TEST_FN_NAME}("${t}",${JSON.stringify(e)}, ${isHydrationTarget})`, getRenderContentScriptString = ({
1988
+ contentId: e,
1989
+ variationId: t
1990
+ }) => `
1991
+ window.${CONTENT_FN_NAME}("${t}", "${e}", ${isHydrationTarget})`;
1992
+ function InlinedScript(e) {
1993
+ return /* @__PURE__ */ jsx(
1994
+ "script",
1995
+ {
1996
+ dangerouslySetInnerHTML: { __html: e.scriptStr },
1997
+ id: e.id
1998
+ }
2026
1999
  );
2027
- return /* @__PURE__ */ jsx(InlinedStyles, { styles: t });
2028
2000
  }
2029
- const getContextStateInitialValue = ({
2030
- content: e,
2031
- data: t,
2032
- locale: n
2001
+ function round(e) {
2002
+ return Math.round(e * 1e3) / 1e3;
2003
+ }
2004
+ const findParentElement = (e, t, n = !0) => {
2005
+ if (!(e instanceof HTMLElement))
2006
+ return null;
2007
+ let i = n ? e : e.parentElement;
2008
+ do {
2009
+ if (!i)
2010
+ return null;
2011
+ if (t(i))
2012
+ return i;
2013
+ } while (i = i.parentElement);
2014
+ return null;
2015
+ }, findBuilderParent = (e) => findParentElement(e, (t) => {
2016
+ const n = t.getAttribute("builder-id") || t.id;
2017
+ return (n == null ? void 0 : n.indexOf("builder-")) === 0;
2018
+ }), computeOffset = ({
2019
+ event: e,
2020
+ target: t
2033
2021
  }) => {
2034
- var a, r, l;
2035
- const i = {};
2036
- (r = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || r.forEach((s) => {
2037
- var c;
2038
- s.name && s.defaultValue !== void 0 && ((c = e == null ? void 0 : e.data) != null && c.state) && e.data.state[s.name] === void 0 && (i[s.name] = s.defaultValue);
2039
- });
2040
- const o = {
2041
- ...(l = e == null ? void 0 : e.data) == null ? void 0 : l.state,
2042
- ...t,
2043
- ...n ? {
2044
- locale: n
2045
- } : {}
2022
+ const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, a = round(i / n.width), r = round(o / n.height);
2023
+ return {
2024
+ x: a,
2025
+ y: r
2046
2026
  };
2027
+ }, getInteractionPropertiesForEvent = (e) => {
2028
+ const t = e.target, n = t && findBuilderParent(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2047
2029
  return {
2048
- ...i,
2049
- ...o
2030
+ targetBuilderElement: i || void 0,
2031
+ metadata: {
2032
+ targetOffset: t ? computeOffset({
2033
+ event: e,
2034
+ target: t
2035
+ }) : void 0,
2036
+ builderTargetOffset: n ? computeOffset({
2037
+ event: e,
2038
+ target: n
2039
+ }) : void 0,
2040
+ builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
2041
+ }
2050
2042
  };
2051
- }, getContentInitialValue = ({
2052
- content: e,
2053
- data: t
2054
- }) => e ? {
2055
- ...e,
2056
- data: {
2057
- ...e == null ? void 0 : e.data,
2058
- ...t
2059
- },
2060
- meta: e == null ? void 0 : e.meta
2061
- } : void 0, SDK_VERSION = "0.7.1-0", registerInsertMenu = () => {
2043
+ }, SDK_VERSION = "0.7.1", registerInsertMenu = () => {
2062
2044
  register("insertMenu", {
2063
2045
  name: "_default",
2064
2046
  default: !0,
@@ -2107,17 +2089,17 @@ const setupBrowserForEditing = (e = {}) => {
2107
2089
  if (i != null && i.type)
2108
2090
  switch (i.type) {
2109
2091
  case "builder.evaluate": {
2110
- const r = i.data.text, l = i.data.arguments || [], s = i.data.id, c = new Function(r);
2092
+ const r = i.data.text, s = i.data.arguments || [], c = i.data.id, l = new Function(r);
2111
2093
  let u, f = null;
2112
2094
  try {
2113
- u = c.apply(null, l);
2095
+ u = l.apply(null, s);
2114
2096
  } catch (h) {
2115
2097
  f = h;
2116
2098
  }
2117
2099
  f ? (o = window.parent) == null || o.postMessage({
2118
2100
  type: "builder.evaluateError",
2119
2101
  data: {
2120
- id: s,
2102
+ id: c,
2121
2103
  error: f.message
2122
2104
  }
2123
2105
  }, "*") : u && typeof u.then == "function" ? u.then((h) => {
@@ -2125,7 +2107,7 @@ const setupBrowserForEditing = (e = {}) => {
2125
2107
  (b = window.parent) == null || b.postMessage({
2126
2108
  type: "builder.evaluateResult",
2127
2109
  data: {
2128
- id: s,
2110
+ id: c,
2129
2111
  result: h
2130
2112
  }
2131
2113
  }, "*");
@@ -2133,7 +2115,7 @@ const setupBrowserForEditing = (e = {}) => {
2133
2115
  type: "builder.evaluateResult",
2134
2116
  data: {
2135
2117
  result: u,
2136
- id: s
2118
+ id: c
2137
2119
  }
2138
2120
  }, "*");
2139
2121
  break;
@@ -2141,54 +2123,11 @@ const setupBrowserForEditing = (e = {}) => {
2141
2123
  }
2142
2124
  })));
2143
2125
  };
2144
- function round(e) {
2145
- return Math.round(e * 1e3) / 1e3;
2146
- }
2147
- const findParentElement = (e, t, n = !0) => {
2148
- if (!(e instanceof HTMLElement))
2149
- return null;
2150
- let i = n ? e : e.parentElement;
2151
- do {
2152
- if (!i)
2153
- return null;
2154
- if (t(i))
2155
- return i;
2156
- } while (i = i.parentElement);
2157
- return null;
2158
- }, findBuilderParent = (e) => findParentElement(e, (t) => {
2159
- const n = t.getAttribute("builder-id") || t.id;
2160
- return (n == null ? void 0 : n.indexOf("builder-")) === 0;
2161
- }), computeOffset = ({
2162
- event: e,
2163
- target: t
2164
- }) => {
2165
- const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, a = round(i / n.width), r = round(o / n.height);
2166
- return {
2167
- x: a,
2168
- y: r
2169
- };
2170
- }, getInteractionPropertiesForEvent = (e) => {
2171
- const t = e.target, n = t && findBuilderParent(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2172
- return {
2173
- targetBuilderElement: i || void 0,
2174
- metadata: {
2175
- targetOffset: t ? computeOffset({
2176
- event: e,
2177
- target: t
2178
- }) : void 0,
2179
- builderTargetOffset: n ? computeOffset({
2180
- event: e,
2181
- target: n
2182
- }) : void 0,
2183
- builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
2184
- }
2185
- };
2186
- };
2187
2126
  function EnableEditor(e) {
2188
- var I, T, R, j, B;
2127
+ var w, T, R, j, B;
2189
2128
  const t = useRef(null), [n, i] = useState(() => 0);
2190
2129
  function o(m) {
2191
- var y, p, k, w, F;
2130
+ var y, p, k, I, F;
2192
2131
  const g = {
2193
2132
  ...e.builderContextSignal.content,
2194
2133
  ...m,
@@ -2199,7 +2138,7 @@ function EnableEditor(e) {
2199
2138
  meta: {
2200
2139
  ...(p = e.builderContextSignal.content) == null ? void 0 : p.meta,
2201
2140
  ...m == null ? void 0 : m.meta,
2202
- breakpoints: ((k = m == null ? void 0 : m.meta) == null ? void 0 : k.breakpoints) || ((F = (w = e.builderContextSignal.content) == null ? void 0 : w.meta) == null ? void 0 : F.breakpoints)
2141
+ breakpoints: ((k = m == null ? void 0 : m.meta) == null ? void 0 : k.breakpoints) || ((F = (I = e.builderContextSignal.content) == null ? void 0 : I.meta) == null ? void 0 : F.breakpoints)
2203
2142
  }
2204
2143
  };
2205
2144
  e.setBuilderContextSignal((P) => ({
@@ -2211,14 +2150,14 @@ function EnableEditor(e) {
2211
2150
  const [a, r] = useState(
2212
2151
  () => !1
2213
2152
  );
2214
- function l(m) {
2153
+ function s(m) {
2215
2154
  var y;
2216
2155
  const { data: g } = m;
2217
2156
  if (g)
2218
2157
  switch (g.type) {
2219
2158
  case "builder.configureSdk": {
2220
- const p = g.data, { breakpoints: k, contentId: w } = p;
2221
- if (!w || w !== ((y = e.builderContextSignal.content) == null ? void 0 : y.id))
2159
+ const p = g.data, { breakpoints: k, contentId: I } = p;
2160
+ if (!I || I !== ((y = e.builderContextSignal.content) == null ? void 0 : y.id))
2222
2161
  return;
2223
2162
  k && o({
2224
2163
  meta: {
@@ -2228,13 +2167,13 @@ function EnableEditor(e) {
2228
2167
  break;
2229
2168
  }
2230
2169
  case "builder.contentUpdate": {
2231
- const p = g.data, k = p.key || p.alias || p.entry || p.modelName, w = p.data;
2232
- k === e.model && (o(w), i(n + 1));
2170
+ const p = g.data, k = p.key || p.alias || p.entry || p.modelName, I = p.data;
2171
+ k === e.model && (o(I), i(n + 1));
2233
2172
  break;
2234
2173
  }
2235
2174
  }
2236
2175
  }
2237
- function s() {
2176
+ function c() {
2238
2177
  var g, y;
2239
2178
  const m = (y = (g = e.builderContextSignal.content) == null ? void 0 : g.data) == null ? void 0 : y.jsCode;
2240
2179
  m && evaluate({
@@ -2245,7 +2184,7 @@ function EnableEditor(e) {
2245
2184
  rootSetState: e.builderContextSignal.rootSetState
2246
2185
  });
2247
2186
  }
2248
- const [c, u] = useState(() => ({})), [f, h] = useState(() => !1);
2187
+ const [l, u] = useState(() => ({})), [f, h] = useState(() => !1);
2249
2188
  function b(m) {
2250
2189
  var g, y;
2251
2190
  if (e.builderContextSignal.content) {
@@ -2276,12 +2215,12 @@ function EnableEditor(e) {
2276
2215
  }
2277
2216
  function x({ url: m, key: g }) {
2278
2217
  fetch$1(m).then((y) => y.json()).then((y) => {
2279
- var k, w;
2218
+ var k, I;
2280
2219
  const p = {
2281
2220
  ...e.builderContextSignal.rootState,
2282
2221
  [g]: y
2283
2222
  };
2284
- (w = (k = e.builderContextSignal).rootSetState) == null || w.call(k, p), c[g] = !0;
2223
+ (I = (k = e.builderContextSignal).rootSetState) == null || I.call(k, p), l[g] = !0;
2285
2224
  }).catch((y) => {
2286
2225
  console.error("error fetching dynamic data", m, y);
2287
2226
  });
@@ -2290,10 +2229,10 @@ function EnableEditor(e) {
2290
2229
  var g, y;
2291
2230
  const m = ((y = (g = e.builderContextSignal.content) == null ? void 0 : g.data) == null ? void 0 : y.httpRequests) ?? {};
2292
2231
  Object.entries(m).forEach(([p, k]) => {
2293
- if (k && (!c[p] || isEditing())) {
2294
- const w = d(k);
2232
+ if (k && (!l[p] || isEditing())) {
2233
+ const I = d(k);
2295
2234
  x({
2296
- url: w,
2235
+ url: I,
2297
2236
  key: p
2298
2237
  });
2299
2238
  }
@@ -2315,7 +2254,7 @@ function EnableEditor(e) {
2315
2254
  );
2316
2255
  }
2317
2256
  function S(m) {
2318
- i(n + 1), window.addEventListener("message", l), registerInsertMenu(), setupBrowserForEditing({
2257
+ i(n + 1), window.addEventListener("message", s), registerInsertMenu(), setupBrowserForEditing({
2319
2258
  ...e.locale ? {
2320
2259
  locale: e.locale
2321
2260
  } : {},
@@ -2344,8 +2283,8 @@ function EnableEditor(e) {
2344
2283
  model: e.model,
2345
2284
  apiKey: e.apiKey,
2346
2285
  apiVersion: e.builderContextSignal.apiVersion
2347
- }).then((w) => {
2348
- w && o(w);
2286
+ }).then((I) => {
2287
+ I && o(I);
2349
2288
  });
2350
2289
  }
2351
2290
  return useEffect(() => {
@@ -2376,12 +2315,12 @@ function EnableEditor(e) {
2376
2315
  var m, g;
2377
2316
  if (isBrowser()) {
2378
2317
  if (isEditing() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
2379
- const p = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, k = (g = e.builderContextSignal.content) == null ? void 0 : g.id, w = e.apiKey;
2318
+ const p = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, k = (g = e.builderContextSignal.content) == null ? void 0 : g.id, I = e.apiKey;
2380
2319
  _track({
2381
2320
  type: "impression",
2382
2321
  canTrack: !0,
2383
2322
  contentId: k,
2384
- apiKey: w,
2323
+ apiKey: I,
2385
2324
  variationId: p !== k ? p : void 0
2386
2325
  });
2387
2326
  }
@@ -2390,21 +2329,21 @@ function EnableEditor(e) {
2390
2329
  }, []), useEffect(() => {
2391
2330
  e.apiKey || logger.error(
2392
2331
  "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
2393
- ), s(), v(), C();
2332
+ ), c(), v(), C();
2394
2333
  }, []), useEffect(() => {
2395
2334
  e.content && o(e.content);
2396
2335
  }, [e.content]), useEffect(() => {
2397
2336
  }, [a]), useEffect(() => {
2398
- s();
2337
+ c();
2399
2338
  }, [
2400
- (T = (I = e.builderContextSignal.content) == null ? void 0 : I.data) == null ? void 0 : T.jsCode,
2339
+ (T = (w = e.builderContextSignal.content) == null ? void 0 : w.data) == null ? void 0 : T.jsCode,
2401
2340
  e.builderContextSignal.rootState
2402
2341
  ]), useEffect(() => {
2403
2342
  v();
2404
2343
  }, [(j = (R = e.builderContextSignal.content) == null ? void 0 : R.data) == null ? void 0 : j.httpRequests]), useEffect(() => {
2405
2344
  C();
2406
2345
  }, [e.builderContextSignal.rootState]), useEffect(() => () => {
2407
- isBrowser() && (window.removeEventListener("message", l), window.removeEventListener(
2346
+ isBrowser() && (window.removeEventListener("message", s), window.removeEventListener(
2408
2347
  "builder:component:stateChangeListenerActivated",
2409
2348
  C
2410
2349
  ));
@@ -2425,17 +2364,103 @@ function EnableEditor(e) {
2425
2364
  e.children
2426
2365
  ) }) : null });
2427
2366
  }
2428
- function InlinedScript(e) {
2429
- return /* @__PURE__ */ jsx(
2430
- "script",
2431
- {
2432
- dangerouslySetInnerHTML: { __html: e.scriptStr },
2433
- id: e.id
2367
+ const getCssFromFont = (e) => {
2368
+ var a;
2369
+ const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = e.fileUrl ?? ((a = e == null ? void 0 : e.files) == null ? void 0 : a.regular);
2370
+ let o = "";
2371
+ if (i && t && n && (o += `
2372
+ @font-face {
2373
+ font-family: "${t}";
2374
+ src: local("${n}"), url('${i}') format('woff2');
2375
+ font-display: fallback;
2376
+ font-weight: 400;
2377
+ }
2378
+ `.trim()), e.files)
2379
+ for (const r in e.files) {
2380
+ if (!(String(Number(r)) === r))
2381
+ continue;
2382
+ const c = e.files[r];
2383
+ c && c !== i && (o += `
2384
+ @font-face {
2385
+ font-family: "${t}";
2386
+ src: url('${c}') format('woff2');
2387
+ font-display: fallback;
2388
+ font-weight: ${r};
2389
+ }
2390
+ `.trim());
2434
2391
  }
2392
+ return o;
2393
+ }, getFontCss = ({
2394
+ customFonts: e
2395
+ }) => {
2396
+ var t;
2397
+ return ((t = e == null ? void 0 : e.map((n) => getCssFromFont(n))) == null ? void 0 : t.join(" ")) || "";
2398
+ }, getCss = ({
2399
+ cssCode: e,
2400
+ contentId: t
2401
+ }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
2402
+ function ContentStyles(e) {
2403
+ const [t, n] = useState(
2404
+ () => `
2405
+ ${getCss({
2406
+ cssCode: e.cssCode,
2407
+ contentId: e.contentId
2408
+ })}
2409
+ ${getFontCss({
2410
+ customFonts: e.customFonts
2411
+ })}
2412
+
2413
+ .builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
2414
+ margin: 0;
2415
+ }
2416
+ .builder-text > p, .builder-text > .builder-paragraph {
2417
+ color: inherit;
2418
+ line-height: inherit;
2419
+ letter-spacing: inherit;
2420
+ font-weight: inherit;
2421
+ font-size: inherit;
2422
+ text-align: inherit;
2423
+ font-family: inherit;
2424
+ }
2425
+ `.trim()
2435
2426
  );
2427
+ return /* @__PURE__ */ jsx(InlinedStyles, { styles: t });
2436
2428
  }
2429
+ const getContextStateInitialValue = ({
2430
+ content: e,
2431
+ data: t,
2432
+ locale: n
2433
+ }) => {
2434
+ var a, r, s;
2435
+ const i = {};
2436
+ (r = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || r.forEach((c) => {
2437
+ var l;
2438
+ c.name && c.defaultValue !== void 0 && ((l = e == null ? void 0 : e.data) != null && l.state) && e.data.state[c.name] === void 0 && (i[c.name] = c.defaultValue);
2439
+ });
2440
+ const o = {
2441
+ ...(s = e == null ? void 0 : e.data) == null ? void 0 : s.state,
2442
+ ...t,
2443
+ ...n ? {
2444
+ locale: n
2445
+ } : {}
2446
+ };
2447
+ return {
2448
+ ...i,
2449
+ ...o
2450
+ };
2451
+ }, getContentInitialValue = ({
2452
+ content: e,
2453
+ data: t
2454
+ }) => e ? {
2455
+ ...e,
2456
+ data: {
2457
+ ...e == null ? void 0 : e.data,
2458
+ ...t
2459
+ },
2460
+ meta: e == null ? void 0 : e.meta
2461
+ } : void 0;
2437
2462
  function ContentComponent(e) {
2438
- var s, c, u, f, h, b, d;
2463
+ var c, l, u, f, h, b, d;
2439
2464
  const [t, n] = useState(
2440
2465
  () => {
2441
2466
  var x, v;
@@ -2448,7 +2473,7 @@ function ContentComponent(e) {
2448
2473
  }
2449
2474
  );
2450
2475
  function i(x) {
2451
- l((v) => ({
2476
+ s((v) => ({
2452
2477
  ...v,
2453
2478
  rootState: x
2454
2479
  }));
@@ -2473,7 +2498,7 @@ function ContentComponent(e) {
2473
2498
  }),
2474
2499
  {}
2475
2500
  )
2476
- ), [r, l] = useState(() => ({
2501
+ ), [r, s] = useState(() => ({
2477
2502
  content: getContentInitialValue({
2478
2503
  content: e.content,
2479
2504
  data: e.data
@@ -2526,14 +2551,14 @@ function ContentComponent(e) {
2526
2551
  classNameProp: e.classNameProp,
2527
2552
  showContent: e.showContent,
2528
2553
  builderContextSignal: r,
2529
- setBuilderContextSignal: l,
2554
+ setBuilderContextSignal: s,
2530
2555
  children: [
2531
2556
  e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
2532
2557
  /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2533
2558
  ContentStyles,
2534
2559
  {
2535
- contentId: (s = r.content) == null ? void 0 : s.id,
2536
- cssCode: (u = (c = r.content) == null ? void 0 : c.data) == null ? void 0 : u.cssCode,
2560
+ contentId: (c = r.content) == null ? void 0 : c.id,
2561
+ cssCode: (u = (l = r.content) == null ? void 0 : l.data) == null ? void 0 : u.cssCode,
2537
2562
  customFonts: (h = (f = r.content) == null ? void 0 : f.data) == null ? void 0 : h.customFonts
2538
2563
  }
2539
2564
  ) }),
@@ -2552,7 +2577,7 @@ function ContentComponent(e) {
2552
2577
  );
2553
2578
  }
2554
2579
  function ContentVariants(e) {
2555
- var r, l, s;
2580
+ var r, s, c;
2556
2581
  const [t, n] = useState(
2557
2582
  () => checkShouldRunVariants({
2558
2583
  canTrack: getDefaultCanTrack(e.canTrack),
@@ -2560,23 +2585,23 @@ function ContentVariants(e) {
2560
2585
  })
2561
2586
  );
2562
2587
  function i() {
2563
- var c;
2588
+ var l;
2564
2589
  return getVariantsScriptString(
2565
2590
  getVariants(e.content).map((u) => ({
2566
2591
  id: u.testVariationId,
2567
2592
  testRatio: u.testRatio
2568
2593
  })),
2569
- ((c = e.content) == null ? void 0 : c.id) || ""
2594
+ ((l = e.content) == null ? void 0 : l.id) || ""
2570
2595
  );
2571
2596
  }
2572
2597
  function o() {
2573
- return getVariants(e.content).map((c) => `.variant-${c.testVariationId} { display: none; } `).join("");
2598
+ return getVariants(e.content).map((l) => `.variant-${l.testVariationId} { display: none; } `).join("");
2574
2599
  }
2575
2600
  function a() {
2576
- var c;
2601
+ var l;
2577
2602
  return t ? {
2578
2603
  ...e.content,
2579
- testVariationId: (c = e.content) == null ? void 0 : c.id
2604
+ testVariationId: (l = e.content) == null ? void 0 : l.id
2580
2605
  } : handleABTestingSync({
2581
2606
  item: e.content,
2582
2607
  canTrack: getDefaultCanTrack(e.canTrack)
@@ -2594,10 +2619,10 @@ function ContentVariants(e) {
2594
2619
  }
2595
2620
  ),
2596
2621
  /* @__PURE__ */ jsx(InlinedScript, { scriptStr: i() }),
2597
- (l = getVariants(e.content)) == null ? void 0 : l.map((c) => /* @__PURE__ */ jsx(
2622
+ (s = getVariants(e.content)) == null ? void 0 : s.map((l) => /* @__PURE__ */ jsx(
2598
2623
  ContentComponent,
2599
2624
  {
2600
- content: c,
2625
+ content: l,
2601
2626
  showContent: !1,
2602
2627
  classNameProp: void 0,
2603
2628
  model: e.model,
@@ -2612,14 +2637,14 @@ function ContentVariants(e) {
2612
2637
  enrich: e.enrich,
2613
2638
  isSsrAbTest: t
2614
2639
  },
2615
- c.testVariationId
2640
+ l.testVariationId
2616
2641
  ))
2617
2642
  ] }) : null,
2618
2643
  /* @__PURE__ */ jsx(
2619
2644
  ContentComponent,
2620
2645
  {
2621
2646
  content: a(),
2622
- classNameProp: `variant-${(s = e.content) == null ? void 0 : s.id}`,
2647
+ classNameProp: `variant-${(c = e.content) == null ? void 0 : c.id}`,
2623
2648
  showContent: !0,
2624
2649
  model: e.model,
2625
2650
  data: e.data,
@@ -2656,30 +2681,29 @@ const fetchSymbolContent = async ({
2656
2681
  });
2657
2682
  };
2658
2683
  function Symbol$1(e) {
2659
- var a, r, l;
2684
+ var a, r, s;
2660
2685
  function t() {
2661
- var s, c;
2686
+ var c, l;
2662
2687
  return [
2663
2688
  e.attributes.className,
2664
2689
  "builder-symbol",
2665
- (s = e.symbol) != null && s.inline ? "builder-inline-symbol" : void 0,
2666
- (c = e.symbol) != null && c.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2690
+ (c = e.symbol) != null && c.inline ? "builder-inline-symbol" : void 0,
2691
+ (l = e.symbol) != null && l.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2667
2692
  ].filter(Boolean).join(" ");
2668
2693
  }
2669
2694
  const [n, i] = useState(() => {
2670
- var s;
2671
- return (s = e.symbol) == null ? void 0 : s.content;
2695
+ var c;
2696
+ return (c = e.symbol) == null ? void 0 : c.content;
2672
2697
  });
2673
2698
  function o() {
2674
2699
  n || fetchSymbolContent({
2675
2700
  symbol: e.symbol,
2676
2701
  builderContextValue: e.builderContext
2677
- }).then((s) => {
2678
- s && i(s);
2702
+ }).then((c) => {
2703
+ c && i(c);
2679
2704
  });
2680
2705
  }
2681
2706
  return useEffect(() => {
2682
- o();
2683
2707
  }, []), useEffect(() => {
2684
2708
  o();
2685
2709
  }, [e.symbol]), /* @__PURE__ */ jsx("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ jsx(
@@ -2695,7 +2719,7 @@ function Symbol$1(e) {
2695
2719
  ...e.builderContext.localState,
2696
2720
  ...(r = n == null ? void 0 : n.data) == null ? void 0 : r.state
2697
2721
  },
2698
- model: (l = e.symbol) == null ? void 0 : l.model,
2722
+ model: (s = e.symbol) == null ? void 0 : s.model,
2699
2723
  content: n
2700
2724
  }
2701
2725
  ) });