@builder.io/sdk-react 0.12.6 → 0.12.8

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.
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
3
- import { createContext, useState, useContext, useRef, useEffect, createElement } from "react";
4
- import { T as TARGET, i as isEditing, j as isBrowser, k as getUserAttributes, l as fastClone, m as checkIsDefined, n as logger, 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-0457c4c8.js";
5
- import { _ as H, h as K, f as z, g as q, e as Y, d as G, s as J, t as Q } from "./server-entry-0457c4c8.js";
3
+ import { createContext, useState, useEffect, useContext, useRef, createElement } from "react";
4
+ import { T as TARGET, i as isEditing, k as isBrowser, l as getUserAttributes, m as fastClone, n as checkIsDefined, o as logger, p as getDefaultCanTrack, q as _track, a as isPreviewing, u as createEditorListener, v as registerInsertMenu, w as setupBrowserForEditing, c as createRegisterComponentMessage, e as fetchOneEntry, x as fetch$1, y as components, z as serializeComponentInfo, A as handleABTestingSync } from "./server-entry-d816840a.js";
5
+ import { _ as H, f as K, d as z, h as q, g as Y, j as G, r as J, s as Q, b as X, t as Z } from "./server-entry-d816840a.js";
6
6
  import { createRequire } from "node:module";
7
7
  const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase());
8
8
  function DynamicRenderer(e) {
@@ -105,7 +105,7 @@ const getFunctionArguments = ({
105
105
  rootSetState: a
106
106
  })
107
107
  });
108
- return new Function(...s.map(([c]) => c), e)(...s.map(([, c]) => c));
108
+ return new Function(...s.map(([l]) => l), e)(...s.map(([, l]) => l));
109
109
  };
110
110
  function flattenState({
111
111
  rootState: e,
@@ -208,34 +208,34 @@ output;
208
208
  const s = fastClone({
209
209
  ...r,
210
210
  ...o
211
- }), c = getFunctionArguments({
211
+ }), l = getFunctionArguments({
212
212
  builder: t,
213
213
  context: n,
214
214
  event: i,
215
215
  state: s
216
- }), l = getIsolateContext(), d = l.global;
216
+ }), c = getIsolateContext(), d = c.global;
217
217
  d.setSync("global", d.derefInto()), d.setSync("log", function(...f) {
218
218
  console.log(...f);
219
- }), d.setSync(BUILDER_SET_STATE_NAME, function(f, h) {
220
- set(r, f, h), a == null || a(r);
221
- }), c.forEach(([f, h]) => {
222
- const y = typeof h == "object" ? new ivm.Reference(
219
+ }), d.setSync(BUILDER_SET_STATE_NAME, function(f, g) {
220
+ set(r, f, g), a == null || a(r);
221
+ }), l.forEach(([f, g]) => {
222
+ const y = typeof g == "object" ? new ivm.Reference(
223
223
  // workaround: methods with default values for arguments is not being cloned over
224
224
  f === "builder" ? {
225
- ...h,
226
- getUserAttributes: () => h.getUserAttributes()
227
- } : h
225
+ ...g,
226
+ getUserAttributes: () => g.getUserAttributes()
227
+ } : g
228
228
  ) : null;
229
229
  d.setSync(getSyncValName(f), y);
230
230
  }), d.setSync(INJECTED_IVM_GLOBAL, ivm);
231
- const g = processCode({
231
+ const b = processCode({
232
232
  code: e,
233
- args: c
234
- }), x = l.evalSync(g);
233
+ args: l
234
+ }), S = c.evalSync(b);
235
235
  try {
236
- return JSON.parse(x);
236
+ return JSON.parse(S);
237
237
  } catch {
238
- return x;
238
+ return S;
239
239
  }
240
240
  };
241
241
  function isNodeRuntime() {
@@ -275,8 +275,8 @@ function evaluate({
275
275
  };
276
276
  try {
277
277
  return chooseBrowserOrServerEval(s);
278
- } catch (c) {
279
- logger.error("Failed code evaluation: " + c.message, {
278
+ } catch (l) {
279
+ logger.error("Failed code evaluation: " + l.message, {
280
280
  code: e
281
281
  });
282
282
  return;
@@ -304,14 +304,14 @@ const evaluateBindings = ({
304
304
  }
305
305
  };
306
306
  for (const s in e.bindings) {
307
- const c = e.bindings[s], l = evaluate({
308
- code: c,
307
+ const l = e.bindings[s], c = evaluate({
308
+ code: l,
309
309
  localState: n,
310
310
  rootState: i,
311
311
  rootSetState: o,
312
312
  context: t
313
313
  });
314
- set(r, s, l);
314
+ set(r, s, c);
315
315
  }
316
316
  return r;
317
317
  };
@@ -332,6 +332,128 @@ function getProcessedBlock({
332
332
  context: t
333
333
  }) : r;
334
334
  }
335
+ function throttle(e, t, n = {}) {
336
+ let i, o, a, r = null, s = 0;
337
+ const l = function() {
338
+ s = n.leading === !1 ? 0 : Date.now(), r = null, a = e.apply(i, o), r || (i = o = null);
339
+ };
340
+ return function() {
341
+ const c = Date.now();
342
+ !s && n.leading === !1 && (s = c);
343
+ const d = t - (c - s);
344
+ return i = this, o = arguments, d <= 0 || d > t ? (r && (clearTimeout(r), r = null), s = c, a = e.apply(i, o), r || (i = o = null)) : !r && n.trailing !== !1 && (r = setTimeout(l, d)), a;
345
+ };
346
+ }
347
+ function assign(e, ...t) {
348
+ const n = Object(e);
349
+ for (let i = 1; i < arguments.length; i++) {
350
+ const o = arguments[i];
351
+ if (o != null)
352
+ for (const a in o)
353
+ Object.prototype.hasOwnProperty.call(o, a) && (n[a] = o[a]);
354
+ }
355
+ return n;
356
+ }
357
+ const camelCaseToKebabCase = (e) => e ? e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`) : "";
358
+ function bindAnimations(e) {
359
+ for (const t of e)
360
+ switch (t.trigger) {
361
+ case "pageLoad":
362
+ triggerAnimation(t);
363
+ break;
364
+ case "hover":
365
+ bindHoverAnimation(t);
366
+ break;
367
+ case "scrollInView":
368
+ bindScrollInViewAnimation(t);
369
+ break;
370
+ }
371
+ }
372
+ function warnElementNotPresent(e) {
373
+ console.warn(`Cannot animate element: element with ID ${e} not found!`);
374
+ }
375
+ function augmentAnimation(e, t) {
376
+ const n = getAllStylesUsed(e), i = getComputedStyle(t), o = e.steps[0].styles, a = e.steps[e.steps.length - 1].styles, r = [o, a];
377
+ for (const s of r)
378
+ for (const l of n)
379
+ l in s || (s[l] = i[l]);
380
+ }
381
+ function getAllStylesUsed(e) {
382
+ const t = [];
383
+ for (const n of e.steps)
384
+ for (const i in n.styles)
385
+ t.indexOf(i) === -1 && t.push(i);
386
+ return t;
387
+ }
388
+ function triggerAnimation(e) {
389
+ const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
390
+ if (!t.length) {
391
+ warnElementNotPresent(e.elementId || e.id || "");
392
+ return;
393
+ }
394
+ Array.from(t).forEach((n) => {
395
+ augmentAnimation(e, n), n.style.transition = "none", n.style.transitionDelay = "0", assign(n.style, e.steps[0].styles), setTimeout(() => {
396
+ n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), assign(n.style, e.steps[1].styles), setTimeout(() => {
397
+ n.style.transition = "", n.style.transitionDelay = "";
398
+ }, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
399
+ });
400
+ });
401
+ }
402
+ function bindHoverAnimation(e) {
403
+ const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
404
+ if (!t.length) {
405
+ warnElementNotPresent(e.elementId || e.id || "");
406
+ return;
407
+ }
408
+ Array.from(t).forEach((n) => {
409
+ augmentAnimation(e, n);
410
+ const i = e.steps[0].styles, o = e.steps[1].styles;
411
+ function a() {
412
+ assign(n.style, i);
413
+ }
414
+ function r() {
415
+ assign(n.style, o);
416
+ }
417
+ a(), n.addEventListener("mouseenter", r), n.addEventListener("mouseleave", a), setTimeout(() => {
418
+ n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
419
+ });
420
+ });
421
+ }
422
+ function bindScrollInViewAnimation(e) {
423
+ const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
424
+ if (!t.length) {
425
+ warnElementNotPresent(e.elementId || e.id || "");
426
+ return;
427
+ }
428
+ Array.from(t).forEach((n) => {
429
+ augmentAnimation(e, n);
430
+ let i = !1, o = !1;
431
+ function a() {
432
+ !i && s(n) ? (i = !0, o = !0, setTimeout(() => {
433
+ assign(n.style, e.steps[1].styles), e.repeat || document.removeEventListener("scroll", r), setTimeout(() => {
434
+ o = !1, e.repeat || (n.style.transition = "", n.style.transitionDelay = "");
435
+ }, (e.duration + (e.delay || 0)) * 1e3 + 100);
436
+ })) : e.repeat && i && !o && !s(n) && (i = !1, assign(n.style, e.steps[0].styles));
437
+ }
438
+ const r = throttle(a, 200, {
439
+ leading: !1
440
+ });
441
+ function s(d) {
442
+ const b = d.getBoundingClientRect(), S = window.innerHeight, g = (e.thresholdPercent || 0) / 100 * S;
443
+ return b.bottom > g && b.top < S - g;
444
+ }
445
+ const l = e.steps[0].styles;
446
+ function c() {
447
+ assign(n.style, l);
448
+ }
449
+ c(), setTimeout(() => {
450
+ n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
451
+ }), document.addEventListener("scroll", r, {
452
+ capture: !0,
453
+ passive: !0
454
+ }), a();
455
+ });
456
+ }
335
457
  const getComponent = ({
336
458
  block: e,
337
459
  context: t,
@@ -374,15 +496,15 @@ const getComponent = ({
374
496
  if (!Array.isArray(o))
375
497
  return;
376
498
  const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
377
- return o.map((c, l) => ({
499
+ return o.map((l, c) => ({
378
500
  context: {
379
501
  ...t,
380
502
  localState: {
381
503
  ...t.localState,
382
- $index: l,
383
- $item: c,
384
- [r]: c,
385
- [`$${r}Index`]: l
504
+ $index: c,
505
+ $item: l,
506
+ [r]: l,
507
+ [`$${r}Index`]: c
386
508
  }
387
509
  },
388
510
  block: i
@@ -461,7 +583,7 @@ function BlockStyles(e) {
461
583
  return checkIsDefined(i.hide) ? !i.hide : checkIsDefined(i.show) ? i.show : !0;
462
584
  }
463
585
  function n() {
464
- var h;
586
+ var g;
465
587
  const i = getProcessedBlock({
466
588
  block: e.block,
467
589
  localState: e.context.localState,
@@ -470,29 +592,29 @@ function BlockStyles(e) {
470
592
  context: e.context.context,
471
593
  shouldEvaluateBindings: !0
472
594
  }), o = i.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
473
- ((h = a == null ? void 0 : a.meta) == null ? void 0 : h.breakpoints) || {}
474
- ), s = o == null ? void 0 : o.large, c = o == null ? void 0 : o.medium, l = o == null ? void 0 : o.small, d = i.id;
595
+ ((g = a == null ? void 0 : a.meta) == null ? void 0 : g.breakpoints) || {}
596
+ ), s = o == null ? void 0 : o.large, l = o == null ? void 0 : o.medium, c = o == null ? void 0 : o.small, d = i.id;
475
597
  if (!d)
476
598
  return "";
477
- const g = s ? createCssClass({
599
+ const b = s ? createCssClass({
478
600
  className: d,
479
601
  styles: s
480
- }) : "", x = c ? createCssClass({
602
+ }) : "", S = l ? createCssClass({
481
603
  className: d,
482
- styles: c,
604
+ styles: l,
483
605
  mediaQuery: getMaxWidthQueryForSize(
484
606
  "medium",
485
607
  r
486
608
  )
487
- }) : "", f = l ? createCssClass({
609
+ }) : "", f = c ? createCssClass({
488
610
  className: d,
489
- styles: l,
611
+ styles: c,
490
612
  mediaQuery: getMaxWidthQueryForSize(
491
613
  "small",
492
614
  r
493
615
  )
494
616
  }) : "";
495
- return [g, x, f].join(" ");
617
+ return [b, S, f].join(" ");
496
618
  }
497
619
  return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
498
620
  }
@@ -701,7 +823,7 @@ function RepeatedBlock(e) {
701
823
  ) });
702
824
  }
703
825
  function Block(e) {
704
- var d, g, x;
826
+ var d, b, S;
705
827
  function t() {
706
828
  return getComponent({
707
829
  block: e.block,
@@ -727,45 +849,53 @@ function Block(e) {
727
849
  });
728
850
  }
729
851
  function o() {
730
- var h;
731
- return e.block.tagName === "a" || ((h = i().properties) == null ? void 0 : h.href) || i().href ? e.linkComponent || "a" : e.block.tagName || "div";
852
+ var g;
853
+ return e.block.tagName === "a" || ((g = i().properties) == null ? void 0 : g.href) || i().href ? e.linkComponent || "a" : e.block.tagName || "div";
732
854
  }
733
855
  function a() {
734
- var y, I;
856
+ var y, k;
735
857
  if ((y = e.block.repeat) != null && y.collection)
736
- return !!((I = n == null ? void 0 : n()) != null && I.length);
858
+ return !!((k = n == null ? void 0 : n()) != null && k.length);
737
859
  const f = "hide" in i() ? i().hide : !1;
738
860
  return ("show" in i() ? i().show : !0) && !f;
739
861
  }
740
862
  function r() {
741
- var h, y;
742
- return !((h = t == null ? void 0 : t()) != null && h.component) && !n() ? (y = i().children) != null ? y : [] : [];
863
+ var g, y;
864
+ return !((g = t == null ? void 0 : t()) != null && g.component) && !n() ? (y = i().children) != null ? y : [] : [];
743
865
  }
744
866
  function s() {
745
- var f, h, y, I, E, v, C, T, w;
867
+ var f, g, y, k, E, p, v, I, w;
746
868
  return {
747
869
  blockChildren: (f = i().children) != null ? f : [],
748
- componentRef: (h = t == null ? void 0 : t()) == null ? void 0 : h.component,
870
+ componentRef: (g = t == null ? void 0 : t()) == null ? void 0 : g.component,
749
871
  componentOptions: {
750
872
  ...getBlockComponentOptions(i()),
751
873
  builderContext: e.context,
752
- ...((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Core:Button" || ((I = t == null ? void 0 : t()) == null ? void 0 : I.name) === "Symbol" || ((E = t == null ? void 0 : t()) == null ? void 0 : E.name) === "Columns" ? {
874
+ ...((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Core:Button" || ((k = t == null ? void 0 : t()) == null ? void 0 : k.name) === "Symbol" || ((E = t == null ? void 0 : t()) == null ? void 0 : E.name) === "Columns" ? {
753
875
  builderLinkComponent: e.linkComponent
754
876
  } : {},
755
- ...((v = t == null ? void 0 : t()) == null ? void 0 : v.name) === "Symbol" || ((C = t == null ? void 0 : t()) == null ? void 0 : C.name) === "Columns" ? {
877
+ ...((p = t == null ? void 0 : t()) == null ? void 0 : p.name) === "Symbol" || ((v = t == null ? void 0 : t()) == null ? void 0 : v.name) === "Columns" ? {
756
878
  builderComponents: e.registeredComponents
757
879
  } : {}
758
880
  },
759
- context: c,
881
+ context: l,
760
882
  linkComponent: e.linkComponent,
761
883
  registeredComponents: e.registeredComponents,
762
884
  builderBlock: i(),
763
- includeBlockProps: ((T = t == null ? void 0 : t()) == null ? void 0 : T.noWrap) === !0,
885
+ includeBlockProps: ((I = t == null ? void 0 : t()) == null ? void 0 : I.noWrap) === !0,
764
886
  isInteractive: !((w = t == null ? void 0 : t()) != null && w.isRSC)
765
887
  };
766
888
  }
767
- const [c, l] = useState(() => e.context);
768
- return /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsxs(Fragment, { children: [
889
+ const [l, c] = useState(() => e.context);
890
+ return useEffect(() => {
891
+ const f = i().id, g = i().animations;
892
+ g && f && bindAnimations(
893
+ g.filter((y) => y.trigger !== "hover").map((y) => ({
894
+ ...y,
895
+ elementId: f
896
+ }))
897
+ );
898
+ }, []), /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsxs(Fragment, { children: [
769
899
  /* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
770
900
  (d = t == null ? void 0 : t()) != null && d.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
771
901
  ComponentRef,
@@ -780,7 +910,7 @@ function Block(e) {
780
910
  includeBlockProps: s().includeBlockProps,
781
911
  isInteractive: s().isInteractive
782
912
  }
783
- ) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (x = n()) == null ? void 0 : x.map((f, h) => /* @__PURE__ */ jsx(
913
+ ) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (S = n()) == null ? void 0 : S.map((f, g) => /* @__PURE__ */ jsx(
784
914
  RepeatedBlock,
785
915
  {
786
916
  repeatContext: f.context,
@@ -788,7 +918,7 @@ function Block(e) {
788
918
  registeredComponents: e.registeredComponents,
789
919
  linkComponent: e.linkComponent
790
920
  },
791
- h
921
+ g
792
922
  )) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
793
923
  BlockWrapper,
794
924
  {
@@ -811,11 +941,11 @@ function Block(e) {
811
941
  isInteractive: s().isInteractive
812
942
  }
813
943
  ),
814
- (g = r()) == null ? void 0 : g.map((f) => /* @__PURE__ */ jsx(
944
+ (b = r()) == null ? void 0 : b.map((f) => /* @__PURE__ */ jsx(
815
945
  Block,
816
946
  {
817
947
  block: f,
818
- context: c,
948
+ context: l,
819
949
  registeredComponents: e.registeredComponents,
820
950
  linkComponent: e.linkComponent
821
951
  },
@@ -911,73 +1041,73 @@ function Columns(e) {
911
1041
  ), [i, o] = useState(() => e.columns || []), [a, r] = useState(
912
1042
  () => e.stackColumnsAt || "tablet"
913
1043
  );
914
- function s(v) {
915
- var C;
916
- return ((C = i[v]) == null ? void 0 : C.width) || 100 / i.length;
1044
+ function s(p) {
1045
+ var v;
1046
+ return ((v = i[p]) == null ? void 0 : v.width) || 100 / i.length;
917
1047
  }
918
- function c(v) {
919
- const C = t * (i.length - 1) / i.length;
920
- return `calc(${s(v)}% - ${C}px)`;
1048
+ function l(p) {
1049
+ const v = t * (i.length - 1) / i.length;
1050
+ return `calc(${s(p)}% - ${v}px)`;
921
1051
  }
922
- function l({
923
- stackedStyle: v,
924
- desktopStyle: C
1052
+ function c({
1053
+ stackedStyle: p,
1054
+ desktopStyle: v
925
1055
  }) {
926
- return a === "tablet" ? v : C;
1056
+ return a === "tablet" ? p : v;
927
1057
  }
928
1058
  function d({
929
- stackedStyle: v,
930
- desktopStyle: C
1059
+ stackedStyle: p,
1060
+ desktopStyle: v
931
1061
  }) {
932
- return a === "never" ? C : v;
1062
+ return a === "never" ? v : p;
933
1063
  }
934
- const [g, x] = useState(
1064
+ const [b, S] = useState(
935
1065
  () => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
936
1066
  );
937
1067
  function f() {
938
1068
  return {
939
- "--flex-dir": g,
940
- "--flex-dir-tablet": l({
941
- stackedStyle: g,
1069
+ "--flex-dir": b,
1070
+ "--flex-dir-tablet": c({
1071
+ stackedStyle: b,
942
1072
  desktopStyle: "row"
943
1073
  })
944
1074
  };
945
1075
  }
946
- function h(v) {
947
- const C = v === 0 ? 0 : t, T = c(v), w = `${C}px`, R = "100%", j = 0;
1076
+ function g(p) {
1077
+ const v = p === 0 ? 0 : t, I = l(p), w = `${v}px`, R = "100%", j = 0;
948
1078
  return {
949
1079
  ...{
950
1080
  display: "flex",
951
1081
  flexDirection: "column",
952
1082
  alignItems: "stretch"
953
1083
  },
954
- width: T,
1084
+ width: I,
955
1085
  ["marginLeft"]: w,
956
1086
  "--column-width-mobile": d({
957
1087
  stackedStyle: R,
958
- desktopStyle: T
1088
+ desktopStyle: I
959
1089
  }),
960
1090
  "--column-margin-left-mobile": d({
961
1091
  stackedStyle: j,
962
1092
  desktopStyle: w
963
1093
  }),
964
- "--column-width-tablet": l({
1094
+ "--column-width-tablet": c({
965
1095
  stackedStyle: R,
966
- desktopStyle: T
1096
+ desktopStyle: I
967
1097
  }),
968
- "--column-margin-left-tablet": l({
1098
+ "--column-margin-left-tablet": c({
969
1099
  stackedStyle: j,
970
1100
  desktopStyle: w
971
1101
  })
972
1102
  };
973
1103
  }
974
- function y(v) {
975
- var T, w;
1104
+ function y(p) {
1105
+ var I, w;
976
1106
  return getSizesForBreakpoints(
977
- ((w = (T = e.builderContext.content) == null ? void 0 : T.meta) == null ? void 0 : w.breakpoints) || {}
978
- )[v].max;
1107
+ ((w = (I = e.builderContext.content) == null ? void 0 : I.meta) == null ? void 0 : w.breakpoints) || {}
1108
+ )[p].max;
979
1109
  }
980
- function I() {
1110
+ function k() {
981
1111
  return `
982
1112
  @media (max-width: ${y("medium")}px) {
983
1113
  .${e.builderBlock.id}-breakpoints {
@@ -1011,23 +1141,23 @@ function Columns(e) {
1011
1141
  className: `builder-columns ${e.builderBlock.id}-breakpoints div-6f826264`,
1012
1142
  style: f(),
1013
1143
  children: [
1014
- /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: I() }) }),
1015
- (E = e.columns) == null ? void 0 : E.map((v, C) => /* @__PURE__ */ jsx(
1144
+ /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: k() }) }),
1145
+ (E = e.columns) == null ? void 0 : E.map((p, v) => /* @__PURE__ */ jsx(
1016
1146
  DynamicRenderer,
1017
1147
  {
1018
- TagName: v.link ? e.builderLinkComponent || "a" : "div",
1148
+ TagName: p.link ? e.builderLinkComponent || "a" : "div",
1019
1149
  actionAttributes: {},
1020
1150
  attributes: {
1021
- ...v.link ? {
1022
- href: v.link
1151
+ ...p.link ? {
1152
+ href: p.link
1023
1153
  } : {},
1024
1154
  [getClassPropName()]: "builder-column",
1025
- style: mapStyleObjToStrIfNeeded(h(C))
1155
+ style: mapStyleObjToStrIfNeeded(g(v))
1026
1156
  },
1027
1157
  children: /* @__PURE__ */ jsx(
1028
1158
  Blocks,
1029
1159
  {
1030
- path: `component.options.columns.${C}.blocks`,
1160
+ path: `component.options.columns.${v}.blocks`,
1031
1161
  parent: e.builderBlock.id,
1032
1162
  styleProp: {
1033
1163
  flexGrow: "1"
@@ -1035,11 +1165,11 @@ function Columns(e) {
1035
1165
  context: e.builderContext,
1036
1166
  registeredComponents: e.builderComponents,
1037
1167
  linkComponent: e.builderLinkComponent,
1038
- blocks: v.blocks
1168
+ blocks: p.blocks
1039
1169
  }
1040
1170
  )
1041
1171
  },
1042
- C
1172
+ v
1043
1173
  ))
1044
1174
  ]
1045
1175
  }
@@ -1087,31 +1217,31 @@ function Image(e) {
1087
1217
  var o, a, r, s;
1088
1218
  function t() {
1089
1219
  var d;
1090
- const l = e.image || e.src;
1091
- if (!l || // We can auto add srcset for cdn.builder.io and shopify
1220
+ const c = e.image || e.src;
1221
+ if (!c || // We can auto add srcset for cdn.builder.io and shopify
1092
1222
  // images, otherwise you can supply this prop manually
1093
- !(l.match(/builder\.io/) || l.match(/cdn\.shopify\.com/)))
1223
+ !(c.match(/builder\.io/) || c.match(/cdn\.shopify\.com/)))
1094
1224
  return e.srcset;
1095
1225
  if (e.srcset && ((d = e.image) != null && d.includes("builder.io/api/v1/image"))) {
1096
1226
  if (!e.srcset.includes(e.image.split("?")[0]))
1097
- return console.debug("Removed given srcset"), getSrcSet(l);
1227
+ return console.debug("Removed given srcset"), getSrcSet(c);
1098
1228
  } else if (e.image && !e.srcset)
1099
- return getSrcSet(l);
1100
- return getSrcSet(l);
1229
+ return getSrcSet(c);
1230
+ return getSrcSet(c);
1101
1231
  }
1102
1232
  function n() {
1103
- var c;
1104
- return (c = t == null ? void 0 : t()) != null && c.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
1233
+ var l;
1234
+ return (l = t == null ? void 0 : t()) != null && l.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
1105
1235
  }
1106
1236
  function i() {
1107
- const c = {
1237
+ const l = {
1108
1238
  position: "absolute",
1109
1239
  height: "100%",
1110
1240
  width: "100%",
1111
1241
  left: "0px",
1112
1242
  top: "0px"
1113
1243
  };
1114
- return e.aspectRatio ? c : void 0;
1244
+ return e.aspectRatio ? l : void 0;
1115
1245
  }
1116
1246
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1117
1247
  /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1399,7 +1529,7 @@ const componentInfo$b = {
1399
1529
  });
1400
1530
  }
1401
1531
  const n = e.get("columns");
1402
- 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();
1532
+ Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((s, l) => s + l.get("width"), 0) !== 100) && t();
1403
1533
  }
1404
1534
  }, {
1405
1535
  name: "space",
@@ -1451,23 +1581,23 @@ function CustomCode(e) {
1451
1581
  if (!((s = t.current) != null && s.getElementsByTagName) || typeof window == "undefined")
1452
1582
  return;
1453
1583
  const r = t.current.getElementsByTagName("script");
1454
- for (let c = 0; c < r.length; c++) {
1455
- const l = r[c];
1456
- if (l.src) {
1457
- if (n.includes(l.src))
1584
+ for (let l = 0; l < r.length; l++) {
1585
+ const c = r[l];
1586
+ if (c.src) {
1587
+ if (n.includes(c.src))
1458
1588
  continue;
1459
- n.push(l.src);
1589
+ n.push(c.src);
1460
1590
  const d = document.createElement("script");
1461
- d.async = !0, d.src = l.src, document.head.appendChild(d);
1462
- } else if (!l.type || [
1591
+ d.async = !0, d.src = c.src, document.head.appendChild(d);
1592
+ } else if (!c.type || [
1463
1593
  "text/javascript",
1464
1594
  "application/javascript",
1465
1595
  "application/ecmascript"
1466
- ].includes(l.type)) {
1467
- if (o.includes(l.innerText))
1596
+ ].includes(c.type)) {
1597
+ if (o.includes(c.innerText))
1468
1598
  continue;
1469
1599
  try {
1470
- o.push(l.innerText), new Function(l.innerText)();
1600
+ o.push(c.innerText), new Function(c.innerText)();
1471
1601
  } catch (d) {
1472
1602
  console.warn("`CustomCode`: Error running script:", d);
1473
1603
  }
@@ -1510,26 +1640,26 @@ const componentInfo$8 = {
1510
1640
  }, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
1511
1641
  function Embed(e) {
1512
1642
  const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, s] = useState(() => !1);
1513
- function c() {
1643
+ function l() {
1514
1644
  if (!t.current || !t.current.getElementsByTagName)
1515
1645
  return;
1516
- const l = t.current.getElementsByTagName("script");
1517
- for (let d = 0; d < l.length; d++) {
1518
- const g = l[d];
1519
- if (g.src && !n.includes(g.src)) {
1520
- n.push(g.src);
1521
- const x = document.createElement("script");
1522
- x.async = !0, x.src = g.src, document.head.appendChild(x);
1523
- } else if (isJsScript(g) && !o.includes(g.innerText))
1646
+ const c = t.current.getElementsByTagName("script");
1647
+ for (let d = 0; d < c.length; d++) {
1648
+ const b = c[d];
1649
+ if (b.src && !n.includes(b.src)) {
1650
+ n.push(b.src);
1651
+ const S = document.createElement("script");
1652
+ S.async = !0, S.src = b.src, document.head.appendChild(S);
1653
+ } else if (isJsScript(b) && !o.includes(b.innerText))
1524
1654
  try {
1525
- o.push(g.innerText), new Function(g.innerText)();
1526
- } catch (x) {
1527
- console.warn("`Embed`: Error running script:", x);
1655
+ o.push(b.innerText), new Function(b.innerText)();
1656
+ } catch (S) {
1657
+ console.warn("`Embed`: Error running script:", S);
1528
1658
  }
1529
1659
  }
1530
1660
  }
1531
1661
  return useEffect(() => {
1532
- t.current && !r && (s(!0), c());
1662
+ t.current && !r && (s(!0), l());
1533
1663
  }, [t.current, r]), /* @__PURE__ */ jsx(
1534
1664
  "div",
1535
1665
  {
@@ -1566,15 +1696,15 @@ const componentInfo$7 = {
1566
1696
  onChange: (e) => {
1567
1697
  e.delete("srcset"), e.delete("noWebp");
1568
1698
  function n(r, s = 6e4) {
1569
- return new Promise((c, l) => {
1699
+ return new Promise((l, c) => {
1570
1700
  const d = document.createElement("img");
1571
- let g = !1;
1701
+ let b = !1;
1572
1702
  d.onload = () => {
1573
- g = !0, c(d);
1574
- }, d.addEventListener("error", (x) => {
1575
- console.warn("Image load failed", x.error), l(x.error);
1703
+ b = !0, l(d);
1704
+ }, d.addEventListener("error", (S) => {
1705
+ console.warn("Image load failed", S.error), c(S.error);
1576
1706
  }), d.src = r, setTimeout(() => {
1577
- g || l(new Error("Image load timed out"));
1707
+ b || c(new Error("Image load timed out"));
1578
1708
  }, s);
1579
1709
  });
1580
1710
  }
@@ -1899,7 +2029,7 @@ const componentInfo = {
1899
2029
  }]
1900
2030
  };
1901
2031
  function Video(e) {
1902
- var i, o, a, r, s, c, l;
2032
+ var i, o, a, r, s, l, c;
1903
2033
  function t() {
1904
2034
  return {
1905
2035
  ...e.autoPlay === !0 ? {
@@ -1978,7 +2108,7 @@ function Video(e) {
1978
2108
  children: e.children
1979
2109
  }
1980
2110
  ) }) : null,
1981
- (l = (c = e.builderBlock) == null ? void 0 : c.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2111
+ (c = (l = e.builderBlock) == null ? void 0 : l.children) != null && c.length && !e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1982
2112
  "div",
1983
2113
  {
1984
2114
  style: {
@@ -2153,11 +2283,6 @@ function InlinedScript(e) {
2153
2283
  }
2154
2284
  );
2155
2285
  }
2156
- const DEFAULT_TRUSTED_HOSTS = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
2157
- function isFromTrustedHost(e, t) {
2158
- const n = new URL(t.origin), i = n.hostname;
2159
- return (e || DEFAULT_TRUSTED_HOSTS).findIndex((o) => o.startsWith("*.") ? i.endsWith(o.slice(1)) : o === i) > -1;
2160
- }
2161
2286
  function round(e) {
2162
2287
  return Math.round(e * 1e3) / 1e3;
2163
2288
  }
@@ -2200,161 +2325,74 @@ const findParentElement = (e, t, n = !0) => {
2200
2325
  builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
2201
2326
  }
2202
2327
  };
2203
- }, SDK_VERSION = "0.12.6", registerInsertMenu = () => {
2204
- register("insertMenu", {
2205
- name: "_default",
2206
- default: !0,
2207
- items: [{
2208
- name: "Box"
2209
- }, {
2210
- name: "Text"
2211
- }, {
2212
- name: "Image"
2213
- }, {
2214
- name: "Columns"
2215
- }, {
2216
- name: "Core:Section"
2217
- }, {
2218
- name: "Core:Button"
2219
- }, {
2220
- name: "Embed"
2221
- }, {
2222
- name: "Custom Code"
2223
- }]
2224
- });
2225
- };
2226
- let isSetupForEditing = !1;
2227
- const setupBrowserForEditing = (e = {}) => {
2228
- var t, n;
2229
- isSetupForEditing || (isSetupForEditing = !0, isBrowser() && ((t = window.parent) == null || t.postMessage({
2230
- type: "builder.sdkInfo",
2231
- data: {
2232
- target: TARGET,
2233
- version: SDK_VERSION,
2234
- supportsPatchUpdates: !1,
2235
- // Supports builder-model="..." attribute which is needed to
2236
- // scope our '+ add block' button styling
2237
- supportsAddBlockScoping: !0,
2238
- supportsCustomBreakpoints: !0
2239
- }
2240
- }, "*"), (n = window.parent) == null || n.postMessage({
2241
- type: "builder.updateContent",
2242
- data: {
2243
- options: e
2244
- }
2245
- }, "*"), window.addEventListener("message", (i) => {
2246
- var a, r;
2247
- if (!isFromTrustedHost(e.trustedHosts, i))
2248
- return;
2249
- const {
2250
- data: o
2251
- } = i;
2252
- if (o != null && o.type)
2253
- switch (o.type) {
2254
- case "builder.evaluate": {
2255
- const s = o.data.text, c = o.data.arguments || [], l = o.data.id, d = new Function(s);
2256
- let g, x = null;
2257
- try {
2258
- g = d.apply(null, c);
2259
- } catch (f) {
2260
- x = f;
2261
- }
2262
- x ? (a = window.parent) == null || a.postMessage({
2263
- type: "builder.evaluateError",
2264
- data: {
2265
- id: l,
2266
- error: x.message
2267
- }
2268
- }, "*") : g && typeof g.then == "function" ? g.then((f) => {
2269
- var h;
2270
- (h = window.parent) == null || h.postMessage({
2271
- type: "builder.evaluateResult",
2272
- data: {
2273
- id: l,
2274
- result: f
2275
- }
2276
- }, "*");
2277
- }).catch(console.error) : (r = window.parent) == null || r.postMessage({
2278
- type: "builder.evaluateResult",
2279
- data: {
2280
- result: g,
2281
- id: l
2282
- }
2283
- }, "*");
2284
- break;
2285
- }
2286
- }
2287
- })));
2288
2328
  };
2289
2329
  function EnableEditor(e) {
2290
- var j, P, A, F, N, _, V;
2330
+ var j, P, B, N, F, V, $;
2291
2331
  const t = useRef(null), [n, i] = useState(() => 0);
2292
2332
  useState(() => !0);
2293
2333
  function o(u) {
2294
- var b, S;
2334
+ var h, x;
2295
2335
  const m = {
2296
2336
  ...e.builderContextSignal.rootState,
2297
2337
  ...u
2298
2338
  };
2299
- e.builderContextSignal.rootSetState ? (S = (b = e.builderContextSignal).rootSetState) == null || S.call(b, m) : e.setBuilderContextSignal((p) => ({
2300
- ...p,
2339
+ e.builderContextSignal.rootSetState ? (x = (h = e.builderContextSignal).rootSetState) == null || x.call(h, m) : e.setBuilderContextSignal((C) => ({
2340
+ ...C,
2301
2341
  rootState: m
2302
2342
  }));
2303
2343
  }
2304
2344
  function a(u) {
2305
- var b, S, p, k, B;
2345
+ var h, x, C, T, A;
2306
2346
  const m = {
2307
2347
  ...e.builderContextSignal.content,
2308
2348
  ...u,
2309
2349
  data: {
2310
- ...(b = e.builderContextSignal.content) == null ? void 0 : b.data,
2350
+ ...(h = e.builderContextSignal.content) == null ? void 0 : h.data,
2311
2351
  ...u == null ? void 0 : u.data
2312
2352
  },
2313
2353
  meta: {
2314
- ...(S = e.builderContextSignal.content) == null ? void 0 : S.meta,
2354
+ ...(x = e.builderContextSignal.content) == null ? void 0 : x.meta,
2315
2355
  ...u == null ? void 0 : u.meta,
2316
- breakpoints: ((p = u == null ? void 0 : u.meta) == null ? void 0 : p.breakpoints) || ((B = (k = e.builderContextSignal.content) == null ? void 0 : k.meta) == null ? void 0 : B.breakpoints)
2356
+ breakpoints: ((C = u == null ? void 0 : u.meta) == null ? void 0 : C.breakpoints) || ((A = (T = e.builderContextSignal.content) == null ? void 0 : T.meta) == null ? void 0 : A.breakpoints)
2317
2357
  }
2318
2358
  };
2319
- e.setBuilderContextSignal(($) => ({
2320
- ...$,
2359
+ e.setBuilderContextSignal((_) => ({
2360
+ ..._,
2321
2361
  content: m
2322
2362
  }));
2323
2363
  }
2324
2364
  useState(() => 0);
2325
2365
  const [r, s] = useState(
2326
2366
  () => !1
2327
- ), [c, l] = useState(
2367
+ ), [l, c] = useState(
2328
2368
  () => e.contentWrapper || "div"
2329
2369
  );
2330
2370
  function d(u) {
2331
- var b;
2332
- if (!isFromTrustedHost(e.trustedHosts, u))
2333
- return;
2334
- const { data: m } = u;
2335
- if (m)
2336
- switch (m.type) {
2337
- case "builder.configureSdk": {
2338
- const S = m.data, { breakpoints: p, contentId: k } = S;
2339
- if (!k || k !== ((b = e.builderContextSignal.content) == null ? void 0 : b.id))
2340
- return;
2341
- p && a({
2371
+ return createEditorListener({
2372
+ model: e.model,
2373
+ trustedHosts: e.trustedHosts,
2374
+ callbacks: {
2375
+ configureSdk: (m) => {
2376
+ var C;
2377
+ const { breakpoints: h, contentId: x } = m;
2378
+ !x || x !== ((C = e.builderContextSignal.content) == null ? void 0 : C.id) || h && (a({
2342
2379
  meta: {
2343
- breakpoints: p
2380
+ breakpoints: h
2344
2381
  }
2345
- }), i(n + 1);
2346
- break;
2347
- }
2348
- case "builder.contentUpdate": {
2349
- const S = m.data, p = S.key || S.alias || S.entry || S.modelName, k = S.data;
2350
- p === e.model && (a(k), i(n + 1));
2351
- break;
2382
+ }), i(n + 1));
2383
+ },
2384
+ animation: (m) => {
2385
+ triggerAnimation(m);
2386
+ },
2387
+ contentUpdate: (m) => {
2388
+ a(m), i(n + 1);
2352
2389
  }
2353
2390
  }
2391
+ })(u);
2354
2392
  }
2355
- function g() {
2356
- var m, b;
2357
- const u = (b = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : b.jsCode;
2393
+ function b() {
2394
+ var m, h;
2395
+ const u = (h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.jsCode;
2358
2396
  u && evaluate({
2359
2397
  code: u,
2360
2398
  context: e.context || {},
@@ -2363,28 +2401,28 @@ function EnableEditor(e) {
2363
2401
  rootSetState: e.builderContextSignal.rootSetState
2364
2402
  });
2365
2403
  }
2366
- const [x, f] = useState(() => ({})), [h, y] = useState(() => !1);
2367
- function I(u) {
2368
- var m, b;
2404
+ const [S, f] = useState(() => ({})), [g, y] = useState(() => !1);
2405
+ function k(u) {
2406
+ var m, h;
2369
2407
  if (e.builderContextSignal.content) {
2370
- const S = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, p = (b = e.builderContextSignal.content) == null ? void 0 : b.id;
2408
+ const x = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, C = (h = e.builderContextSignal.content) == null ? void 0 : h.id;
2371
2409
  _track({
2372
2410
  type: "click",
2373
2411
  canTrack: getDefaultCanTrack(e.canTrack),
2374
- contentId: p,
2412
+ contentId: C,
2375
2413
  apiKey: e.apiKey,
2376
- variationId: S !== p ? S : void 0,
2414
+ variationId: x !== C ? x : void 0,
2377
2415
  ...getInteractionPropertiesForEvent(u),
2378
- unique: !h
2416
+ unique: !g
2379
2417
  });
2380
2418
  }
2381
- h || y(!0);
2419
+ g || y(!0);
2382
2420
  }
2383
2421
  function E(u) {
2384
2422
  return u.replace(
2385
2423
  /{{([^}]+)}}/g,
2386
- (m, b) => evaluate({
2387
- code: b,
2424
+ (m, h) => evaluate({
2425
+ code: h,
2388
2426
  context: e.context || {},
2389
2427
  localState: void 0,
2390
2428
  rootState: e.builderContextSignal.rootState,
@@ -2392,32 +2430,32 @@ function EnableEditor(e) {
2392
2430
  })
2393
2431
  );
2394
2432
  }
2395
- function v({ url: u, key: m }) {
2396
- fetch$1(u).then((b) => b.json()).then((b) => {
2397
- var p, k;
2398
- const S = {
2433
+ function p({ url: u, key: m }) {
2434
+ fetch$1(u).then((h) => h.json()).then((h) => {
2435
+ var C, T;
2436
+ const x = {
2399
2437
  ...e.builderContextSignal.rootState,
2400
- [m]: b
2438
+ [m]: h
2401
2439
  };
2402
- (k = (p = e.builderContextSignal).rootSetState) == null || k.call(p, S), x[m] = !0;
2403
- }).catch((b) => {
2404
- console.error("error fetching dynamic data", u, b);
2440
+ (T = (C = e.builderContextSignal).rootSetState) == null || T.call(C, x), S[m] = !0;
2441
+ }).catch((h) => {
2442
+ console.error("error fetching dynamic data", u, h);
2405
2443
  });
2406
2444
  }
2407
- function C() {
2408
- var m, b, S;
2409
- const u = (S = (b = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : b.httpRequests) != null ? S : {};
2410
- Object.entries(u).forEach(([p, k]) => {
2411
- if (k && (!x[p] || isEditing())) {
2412
- const B = E(k);
2413
- v({
2414
- url: B,
2415
- key: p
2445
+ function v() {
2446
+ var m, h, x;
2447
+ const u = (x = (h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.httpRequests) != null ? x : {};
2448
+ Object.entries(u).forEach(([C, T]) => {
2449
+ if (T && (!S[C] || isEditing())) {
2450
+ const A = E(T);
2451
+ p({
2452
+ url: A,
2453
+ key: C
2416
2454
  });
2417
2455
  }
2418
2456
  });
2419
2457
  }
2420
- function T() {
2458
+ function I() {
2421
2459
  isEditing() && window.dispatchEvent(
2422
2460
  new CustomEvent(
2423
2461
  "builder:component:stateChange",
@@ -2449,24 +2487,24 @@ function EnableEditor(e) {
2449
2487
  }), Object.values(
2450
2488
  e.builderContextSignal.componentInfos
2451
2489
  ).forEach((m) => {
2452
- var S;
2453
- const b = createRegisterComponentMessage(m);
2454
- (S = window.parent) == null || S.postMessage(b, "*");
2490
+ var x;
2491
+ const h = createRegisterComponentMessage(m);
2492
+ (x = window.parent) == null || x.postMessage(h, "*");
2455
2493
  }), window.addEventListener(
2456
2494
  "builder:component:stateChangeListenerActivated",
2457
- T
2495
+ I
2458
2496
  );
2459
2497
  }
2460
2498
  function R(u) {
2461
- const m = new URL(location.href).searchParams, b = m.get("builder.preview"), S = m.get(
2462
- `builder.preview.${b}`
2463
- ), p = m.get("apiKey") || m.get("builder.space");
2464
- b === e.model && p === e.apiKey && (!e.content || S === e.content.id) && fetchOneEntry({
2499
+ const m = new URL(location.href).searchParams, h = m.get("builder.preview"), x = m.get(
2500
+ `builder.preview.${h}`
2501
+ ), C = m.get("apiKey") || m.get("builder.space");
2502
+ h === e.model && C === e.apiKey && (!e.content || x === e.content.id) && fetchOneEntry({
2465
2503
  model: e.model,
2466
2504
  apiKey: e.apiKey,
2467
2505
  apiVersion: e.builderContextSignal.apiVersion
2468
- }).then((k) => {
2469
- k && a(k);
2506
+ }).then((T) => {
2507
+ T && a(T);
2470
2508
  });
2471
2509
  }
2472
2510
  return useEffect(() => {
@@ -2497,13 +2535,13 @@ function EnableEditor(e) {
2497
2535
  var u, m;
2498
2536
  if (isBrowser()) {
2499
2537
  if (isEditing() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
2500
- const S = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, p = (m = e.builderContextSignal.content) == null ? void 0 : m.id, k = e.apiKey;
2538
+ const x = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, C = (m = e.builderContextSignal.content) == null ? void 0 : m.id, T = e.apiKey;
2501
2539
  _track({
2502
2540
  type: "impression",
2503
2541
  canTrack: !0,
2504
- contentId: p,
2505
- apiKey: k,
2506
- variationId: S !== p ? S : void 0
2542
+ contentId: C,
2543
+ apiKey: T,
2544
+ variationId: x !== C ? x : void 0
2507
2545
  });
2508
2546
  }
2509
2547
  isPreviewing() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
@@ -2511,16 +2549,16 @@ function EnableEditor(e) {
2511
2549
  }, []), useEffect(() => {
2512
2550
  e.apiKey || logger.error(
2513
2551
  "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
2514
- ), g(), C(), T();
2552
+ ), b(), v(), I();
2515
2553
  }, []), useEffect(() => {
2516
2554
  e.content && a(e.content);
2517
2555
  }, [e.content]), useEffect(() => {
2518
2556
  }, [r]), useEffect(() => {
2519
- g();
2557
+ b();
2520
2558
  }, [(P = (j = e.builderContextSignal.content) == null ? void 0 : j.data) == null ? void 0 : P.jsCode]), useEffect(() => {
2521
- C();
2522
- }, [(F = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : F.httpRequests]), useEffect(() => {
2523
- T();
2559
+ v();
2560
+ }, [(N = (B = e.builderContextSignal.content) == null ? void 0 : B.data) == null ? void 0 : N.httpRequests]), useEffect(() => {
2561
+ I();
2524
2562
  }, [e.builderContextSignal.rootState]), useEffect(() => {
2525
2563
  e.data && o(e.data);
2526
2564
  }, [e.data]), useEffect(() => {
@@ -2530,22 +2568,22 @@ function EnableEditor(e) {
2530
2568
  }, [e.locale]), useEffect(() => () => {
2531
2569
  isBrowser() && (window.removeEventListener("message", d), window.removeEventListener(
2532
2570
  "builder:component:stateChangeListenerActivated",
2533
- T
2571
+ I
2534
2572
  ));
2535
2573
  }, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
2536
- c,
2574
+ l,
2537
2575
  {
2538
2576
  key: n,
2539
2577
  ref: t,
2540
- onClick: (u) => I(u),
2541
- "builder-content-id": (N = e.builderContextSignal.content) == null ? void 0 : N.id,
2578
+ onClick: (u) => k(u),
2579
+ "builder-content-id": (F = e.builderContextSignal.content) == null ? void 0 : F.id,
2542
2580
  "builder-model": e.model,
2543
2581
  ...e.showContent ? {} : {
2544
2582
  hidden: !0,
2545
2583
  "aria-hidden": !0
2546
2584
  },
2547
2585
  ...e.contentWrapperProps,
2548
- className: `variant-${((_ = e.content) == null ? void 0 : _.testVariationId) || ((V = e.content) == null ? void 0 : V.id)}`
2586
+ className: `variant-${((V = e.content) == null ? void 0 : V.testVariationId) || (($ = e.content) == null ? void 0 : $.id)}`
2549
2587
  },
2550
2588
  e.children
2551
2589
  ) }) : null });
@@ -2565,11 +2603,11 @@ font-weight: 400;
2565
2603
  for (const s in e.files) {
2566
2604
  if (!(String(Number(s)) === s))
2567
2605
  continue;
2568
- const l = e.files[s];
2569
- l && l !== i && (o += `
2606
+ const c = e.files[s];
2607
+ c && c !== i && (o += `
2570
2608
  @font-face {
2571
2609
  font-family: "${t}";
2572
- src: url('${l}') format('woff2');
2610
+ src: url('${c}') format('woff2');
2573
2611
  font-display: fallback;
2574
2612
  font-weight: ${s};
2575
2613
  }
@@ -2623,8 +2661,8 @@ const getRootStateInitialValue = ({
2623
2661
  }) => {
2624
2662
  var a, r, s;
2625
2663
  const i = {}, o = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
2626
- return (s = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || s.forEach((c) => {
2627
- c.name && c.defaultValue !== void 0 && (i[c.name] = c.defaultValue);
2664
+ return (s = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || s.forEach((l) => {
2665
+ l.name && l.defaultValue !== void 0 && (i[l.name] = l.defaultValue);
2628
2666
  }), {
2629
2667
  ...i,
2630
2668
  ...o,
@@ -2645,21 +2683,21 @@ const getRootStateInitialValue = ({
2645
2683
  meta: e == null ? void 0 : e.meta
2646
2684
  } : void 0;
2647
2685
  function ContentComponent(e) {
2648
- var c, l, d, g, x, f, h;
2686
+ var l, c, d, b, S, f, g;
2649
2687
  const [t, n] = useState(
2650
2688
  () => {
2651
- var y, I;
2689
+ var y, k;
2652
2690
  return getUpdateVariantVisibilityScript({
2653
2691
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2654
2692
  variationId: (y = e.content) == null ? void 0 : y.testVariationId,
2655
2693
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2656
- contentId: (I = e.content) == null ? void 0 : I.id
2694
+ contentId: (k = e.content) == null ? void 0 : k.id
2657
2695
  });
2658
2696
  }
2659
2697
  );
2660
2698
  function i(y) {
2661
- s((I) => ({
2662
- ...I,
2699
+ s((k) => ({
2700
+ ...k,
2663
2701
  rootState: y
2664
2702
  }));
2665
2703
  }
@@ -2674,10 +2712,10 @@ function ContentComponent(e) {
2674
2712
  ...components,
2675
2713
  ...e.customComponents || []
2676
2714
  ].reduce(
2677
- (y, { component: I, ...E }) => ({
2715
+ (y, { component: k, ...E }) => ({
2678
2716
  ...y,
2679
2717
  [E.name]: {
2680
- component: I,
2718
+ component: k,
2681
2719
  ...serializeComponentInfo(E)
2682
2720
  }
2683
2721
  }),
@@ -2708,7 +2746,7 @@ function ContentComponent(e) {
2708
2746
  ...components,
2709
2747
  ...e.customComponents || []
2710
2748
  ].reduce(
2711
- (y, { component: I, ...E }) => ({
2749
+ (y, { component: k, ...E }) => ({
2712
2750
  ...y,
2713
2751
  [E.name]: serializeComponentInfo(E)
2714
2752
  }),
@@ -2748,15 +2786,15 @@ function ContentComponent(e) {
2748
2786
  /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2749
2787
  ContentStyles,
2750
2788
  {
2751
- contentId: (c = r.content) == null ? void 0 : c.id,
2752
- cssCode: (d = (l = r.content) == null ? void 0 : l.data) == null ? void 0 : d.cssCode,
2753
- customFonts: (x = (g = r.content) == null ? void 0 : g.data) == null ? void 0 : x.customFonts
2789
+ contentId: (l = r.content) == null ? void 0 : l.id,
2790
+ cssCode: (d = (c = r.content) == null ? void 0 : c.data) == null ? void 0 : d.cssCode,
2791
+ customFonts: (S = (b = r.content) == null ? void 0 : b.data) == null ? void 0 : S.customFonts
2754
2792
  }
2755
2793
  ) }),
2756
2794
  /* @__PURE__ */ jsx(
2757
2795
  Blocks,
2758
2796
  {
2759
- blocks: (h = (f = r.content) == null ? void 0 : f.data) == null ? void 0 : h.blocks,
2797
+ blocks: (g = (f = r.content) == null ? void 0 : f.data) == null ? void 0 : g.blocks,
2760
2798
  context: r,
2761
2799
  registeredComponents: o,
2762
2800
  linkComponent: e.linkComponent
@@ -2777,23 +2815,23 @@ function ContentVariants(e) {
2777
2815
  })
2778
2816
  );
2779
2817
  function i() {
2780
- var c;
2818
+ var l;
2781
2819
  return getUpdateCookieAndStylesScript(
2782
- getVariants(e.content).map((l) => ({
2783
- id: l.testVariationId,
2784
- testRatio: l.testRatio
2820
+ getVariants(e.content).map((c) => ({
2821
+ id: c.testVariationId,
2822
+ testRatio: c.testRatio
2785
2823
  })),
2786
- ((c = e.content) == null ? void 0 : c.id) || ""
2824
+ ((l = e.content) == null ? void 0 : l.id) || ""
2787
2825
  );
2788
2826
  }
2789
2827
  function o() {
2790
- return getVariants(e.content).map((c) => `.variant-${c.testVariationId} { display: none; } `).join("");
2828
+ return getVariants(e.content).map((l) => `.variant-${l.testVariationId} { display: none; } `).join("");
2791
2829
  }
2792
2830
  function a() {
2793
- var c;
2831
+ var l;
2794
2832
  return t ? {
2795
2833
  ...e.content,
2796
- testVariationId: (c = e.content) == null ? void 0 : c.id
2834
+ testVariationId: (l = e.content) == null ? void 0 : l.id
2797
2835
  } : handleABTestingSync({
2798
2836
  item: e.content,
2799
2837
  canTrack: getDefaultCanTrack(e.canTrack)
@@ -2811,10 +2849,10 @@ function ContentVariants(e) {
2811
2849
  }
2812
2850
  ),
2813
2851
  /* @__PURE__ */ jsx(InlinedScript, { scriptStr: i() }),
2814
- (s = getVariants(e.content)) == null ? void 0 : s.map((c) => /* @__PURE__ */ jsx(
2852
+ (s = getVariants(e.content)) == null ? void 0 : s.map((l) => /* @__PURE__ */ jsx(
2815
2853
  ContentComponent,
2816
2854
  {
2817
- content: c,
2855
+ content: l,
2818
2856
  showContent: !1,
2819
2857
  model: e.model,
2820
2858
  data: e.data,
@@ -2834,7 +2872,7 @@ function ContentVariants(e) {
2834
2872
  contentWrapperProps: e.contentWrapperProps,
2835
2873
  trustedHosts: e.trustedHosts
2836
2874
  },
2837
- c.testVariationId
2875
+ l.testVariationId
2838
2876
  ))
2839
2877
  ] }) : null,
2840
2878
  /* @__PURE__ */ jsx(
@@ -2883,26 +2921,26 @@ const fetchSymbolContent = async ({
2883
2921
  });
2884
2922
  };
2885
2923
  function Symbol$1(e) {
2886
- var a, r, s, c;
2924
+ var a, r, s, l;
2887
2925
  function t() {
2888
- var l, d;
2926
+ var c, d;
2889
2927
  return [
2890
2928
  e.attributes[getClassPropName()],
2891
2929
  "builder-symbol",
2892
- (l = e.symbol) != null && l.inline ? "builder-inline-symbol" : void 0,
2930
+ (c = e.symbol) != null && c.inline ? "builder-inline-symbol" : void 0,
2893
2931
  (d = e.symbol) != null && d.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2894
2932
  ].filter(Boolean).join(" ");
2895
2933
  }
2896
2934
  const [n, i] = useState(() => {
2897
- var l;
2898
- return (l = e.symbol) == null ? void 0 : l.content;
2935
+ var c;
2936
+ return (c = e.symbol) == null ? void 0 : c.content;
2899
2937
  });
2900
2938
  function o() {
2901
2939
  n || fetchSymbolContent({
2902
2940
  symbol: e.symbol,
2903
2941
  builderContextValue: e.builderContext
2904
- }).then((l) => {
2905
- l && i(l);
2942
+ }).then((c) => {
2943
+ c && i(c);
2906
2944
  });
2907
2945
  }
2908
2946
  return useEffect(() => {
@@ -2924,7 +2962,7 @@ function Symbol$1(e) {
2924
2962
  ...e.builderContext.localState,
2925
2963
  ...(s = n == null ? void 0 : n.data) == null ? void 0 : s.state
2926
2964
  },
2927
- model: (c = e.symbol) == null ? void 0 : c.model,
2965
+ model: (l = e.symbol) == null ? void 0 : l.model,
2928
2966
  content: n,
2929
2967
  linkComponent: e.builderLinkComponent
2930
2968
  }
@@ -2954,7 +2992,8 @@ export {
2954
2992
  G as getContent,
2955
2993
  isEditing,
2956
2994
  isPreviewing,
2957
- register,
2958
- J as setEditorSettings,
2959
- Q as track
2995
+ J as register,
2996
+ Q as setEditorSettings,
2997
+ X as subscribeToEditor,
2998
+ Z as track
2960
2999
  };