@builder.io/sdk-react-nextjs 0.16.3 → 0.16.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/lib/browser/blocks-exports.cjs +10 -10
  2. package/lib/browser/blocks-exports.mjs +152 -132
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +1 -1
  5. package/lib/browser/init.cjs +1 -1
  6. package/lib/browser/init.mjs +1 -1
  7. package/lib/browser/{server-entry-8a47b9f9.cjs → server-entry-15a258a6.cjs} +1 -1
  8. package/lib/{node/server-entry-b8ecec52.js → browser/server-entry-3336d7c2.js} +1 -1
  9. package/lib/browser/server-entry.cjs +1 -1
  10. package/lib/browser/server-entry.mjs +1 -1
  11. package/lib/edge/blocks-exports.cjs +16 -16
  12. package/lib/edge/blocks-exports.mjs +174 -154
  13. package/lib/edge/index.cjs +1 -1
  14. package/lib/edge/index.mjs +1 -1
  15. package/lib/edge/init.cjs +1 -1
  16. package/lib/edge/init.mjs +1 -1
  17. package/lib/{node/server-entry-8a47b9f9.cjs → edge/server-entry-15a258a6.cjs} +1 -1
  18. package/lib/{browser/server-entry-b8ecec52.js → edge/server-entry-3336d7c2.js} +1 -1
  19. package/lib/edge/server-entry.cjs +1 -1
  20. package/lib/edge/server-entry.mjs +1 -1
  21. package/lib/node/blocks-exports.cjs +13 -13
  22. package/lib/node/blocks-exports.mjs +99 -79
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +2 -2
  25. package/lib/node/init.cjs +1 -1
  26. package/lib/node/init.mjs +2 -2
  27. package/lib/node/{node-runtime-e2a21ba1.cjs → node-runtime-7537779c.cjs} +1 -1
  28. package/lib/node/{node-runtime-ffe74dec.js → node-runtime-adcc8fa1.js} +1 -1
  29. package/lib/{edge/server-entry-8a47b9f9.cjs → node/server-entry-15a258a6.cjs} +1 -1
  30. package/lib/{edge/server-entry-b8ecec52.js → node/server-entry-3336d7c2.js} +1 -1
  31. package/lib/node/server-entry.cjs +1 -1
  32. package/lib/node/server-entry.mjs +1 -1
  33. package/package.json +1 -1
  34. package/types/cjs/blocks/image/image.types.d.ts +2 -0
  35. package/types/cjs/blocks/symbol/symbol.types.d.ts +1 -0
  36. package/types/cjs/constants/sdk-version.d.ts +1 -1
  37. package/types/esm/blocks/image/image.types.d.ts +2 -0
  38. package/types/esm/blocks/symbol/symbol.types.d.ts +1 -0
  39. package/types/esm/constants/sdk-version.d.ts +1 -1
@@ -3,15 +3,15 @@ var Ae = Object.defineProperty;
3
3
  var Ve = (e, t, n) => t in e ? Ae(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
4
  var ee = (e, t, n) => (Ve(e, typeof t != "symbol" ? t + "" : t, n), n);
5
5
  import { jsx as l, Fragment as C, jsxs as E } from "react/jsx-runtime";
6
- import { TARGET as M, isEditing as V, isBrowser as L, getUserAttributes as $e, checkIsDefined as z, logger as J, init as Fe, getDefaultCanTrack as q, _track as ue, isPreviewing as Le, createEditorListener as Oe, fetch as De, registerInsertMenu as je, setupBrowserForEditing as He, createRegisterComponentMessage as Me, fetchOneEntry as ke, serializeComponentInfo as me, handleABTestingSync as Ue } from "./server-entry-b8ecec52.js";
7
- import { useRef as ie, useState as A, useEffect as R, createContext as _e } from "react";
6
+ import { TARGET as M, isEditing as V, isBrowser as L, getUserAttributes as $e, checkIsDefined as z, logger as J, init as Fe, getDefaultCanTrack as q, _track as ue, isPreviewing as Le, createEditorListener as Oe, fetch as De, registerInsertMenu as je, setupBrowserForEditing as He, createRegisterComponentMessage as Me, fetchOneEntry as ke, serializeComponentInfo as me, handleABTestingSync as Ue } from "./server-entry-3336d7c2.js";
7
+ import { useEffect as R, useRef as ie, useState as A, createContext as _e } from "react";
8
8
  import { useRouter as Ke } from "next/navigation";
9
9
  import "lru-cache";
10
10
  const ze = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), qe = (e) => typeof e == "string" && ze.has(e.toLowerCase());
11
11
  function oe(e) {
12
12
  return /* @__PURE__ */ l(C, { children: qe(e.TagName) ? /* @__PURE__ */ l(C, { children: /* @__PURE__ */ l(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ l(C, { children: typeof e.TagName == "string" ? /* @__PURE__ */ l(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ l(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
13
13
  }
14
- const j = () => {
14
+ const H = () => {
15
15
  switch (M) {
16
16
  case "react":
17
17
  case "reactNative":
@@ -29,7 +29,7 @@ function Ye(e) {
29
29
  function t() {
30
30
  return {
31
31
  ...e.attributes,
32
- [j()]: `${e.link ? "" : "builder-button"} ${e.attributes[j()] || ""}`,
32
+ [H()]: `${e.link ? "" : "builder-button"} ${e.attributes[H()] || ""}`,
33
33
  ...e.link ? {
34
34
  href: e.link,
35
35
  target: e.openLinkInNewTab ? "_blank" : void 0,
@@ -75,7 +75,7 @@ const Qe = ({
75
75
  getUserAttributes: () => $e()
76
76
  }), Xe = (e, {
77
77
  isExpression: t = !0
78
- }) => /* we disable this for cases where we definitely don't want a return */ t && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e, he = ({
78
+ }) => /* we disable this for cases where we definitely don't want a return */ t && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e, fe = ({
79
79
  code: e,
80
80
  builder: t,
81
81
  context: n,
@@ -131,7 +131,7 @@ const et = () => {
131
131
  return !1;
132
132
  const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (i = process.env.NODE_OPTIONS) == null ? void 0 : i.includes("--no-node-snapshot");
133
133
  return e && t && !n ? (J.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "), !0) : !1;
134
- }, tt = (e) => (L() || et(), he(e)), N = class N {
134
+ }, tt = (e) => (L() || et(), fe(e)), N = class N {
135
135
  static getCacheKey(t) {
136
136
  return JSON.stringify({
137
137
  ...t,
@@ -151,7 +151,7 @@ const et = () => {
151
151
  };
152
152
  ee(N, "cacheLimit", 20), ee(N, "cache", /* @__PURE__ */ new Map());
153
153
  let F = N;
154
- function H({
154
+ function O({
155
155
  code: e,
156
156
  context: t,
157
157
  localState: n,
@@ -218,7 +218,7 @@ const it = ({
218
218
  }
219
219
  };
220
220
  for (const c in e.bindings) {
221
- const s = e.bindings[c], d = H({
221
+ const s = e.bindings[c], d = O({
222
222
  code: s,
223
223
  localState: n,
224
224
  rootState: i,
@@ -322,7 +322,7 @@ const ct = ({
322
322
  } = e;
323
323
  if (!(n != null && n.collection))
324
324
  return;
325
- const o = H({
325
+ const o = O({
326
326
  code: n.collection,
327
327
  localState: t.localState,
328
328
  rootState: t.rootState,
@@ -382,7 +382,7 @@ const ct = ({
382
382
  default: 991,
383
383
  max: 1200
384
384
  }
385
- }, fe = (e, t = Te) => `@media (max-width: ${t[e].max}px)`, Re = ({
385
+ }, he = (e, t = Te) => `@media (max-width: ${t[e].max}px)`, Re = ({
386
386
  small: e,
387
387
  medium: t
388
388
  }) => {
@@ -419,7 +419,7 @@ function Q(e) {
419
419
  }
420
420
  );
421
421
  }
422
- function ht(e) {
422
+ function ft(e) {
423
423
  const t = function() {
424
424
  const o = Y({
425
425
  block: e.block,
@@ -431,7 +431,7 @@ function ht(e) {
431
431
  });
432
432
  return z(o.hide) ? !o.hide : z(o.show) ? o.show : !0;
433
433
  }, n = function() {
434
- var v, y, p;
434
+ var x, y, p;
435
435
  const o = Y({
436
436
  block: e.block,
437
437
  localState: e.context.localState,
@@ -440,24 +440,24 @@ function ht(e) {
440
440
  context: e.context.context,
441
441
  shouldEvaluateBindings: !0
442
442
  }), a = o.responsiveStyles, r = e.context.content, c = Re(
443
- ((v = r == null ? void 0 : r.meta) == null ? void 0 : v.breakpoints) || {}
443
+ ((x = r == null ? void 0 : r.meta) == null ? void 0 : x.breakpoints) || {}
444
444
  ), s = a == null ? void 0 : a.large, d = a == null ? void 0 : a.medium, m = a == null ? void 0 : a.small, u = o.id;
445
445
  if (!u)
446
446
  return "";
447
- const f = s ? _({
447
+ const h = s ? _({
448
448
  className: u,
449
449
  styles: s
450
450
  }) : "", w = d ? _({
451
451
  className: u,
452
452
  styles: d,
453
- mediaQuery: fe(
453
+ mediaQuery: he(
454
454
  "medium",
455
455
  c
456
456
  )
457
457
  }) : "", I = m ? _({
458
458
  className: u,
459
459
  styles: m,
460
- mediaQuery: fe(
460
+ mediaQuery: he(
461
461
  "small",
462
462
  c
463
463
  )
@@ -477,7 +477,7 @@ function ht(e) {
477
477
  }) || "";
478
478
  }
479
479
  return [
480
- f,
480
+ h,
481
481
  w,
482
482
  I,
483
483
  P
@@ -492,10 +492,10 @@ function ht(e) {
492
492
  }
493
493
  ) }) : null });
494
494
  }
495
- function ft(e) {
495
+ function ht(e) {
496
496
  return e.charAt(0).toUpperCase() + e.slice(1);
497
497
  }
498
- const gt = (e) => `on${ft(e)}`, bt = (e, t) => (n) => H({
498
+ const gt = (e) => `on${ht(e)}`, bt = (e, t) => (n) => O({
499
499
  code: e,
500
500
  context: t.context,
501
501
  localState: t.localState,
@@ -531,7 +531,7 @@ function yt({
531
531
  }) {
532
532
  return e;
533
533
  }
534
- const vt = (e) => ({
534
+ const xt = (e) => ({
535
535
  href: e.href
536
536
  });
537
537
  function ce({
@@ -540,14 +540,14 @@ function ce({
540
540
  }) {
541
541
  var i;
542
542
  const n = {
543
- ...vt(e),
543
+ ...xt(e),
544
544
  ...e.properties,
545
545
  "builder-id": e.id,
546
546
  style: rt({
547
547
  block: e,
548
548
  context: t
549
549
  }),
550
- [j()]: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
550
+ [H()]: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
551
551
  };
552
552
  return yt({
553
553
  properties: n,
@@ -576,7 +576,7 @@ function St(e) {
576
576
  }
577
577
  );
578
578
  }
579
- function xt(e) {
579
+ function vt(e) {
580
580
  function t() {
581
581
  return e.includeBlockProps ? {
582
582
  ...ce({
@@ -626,7 +626,7 @@ const pt = ({
626
626
  };
627
627
  function ge(e) {
628
628
  var n;
629
- const t = e.isInteractive ? xt : e.componentRef;
629
+ const t = e.isInteractive ? vt : e.componentRef;
630
630
  return /* @__PURE__ */ l(C, { children: e.componentRef ? /* @__PURE__ */ l(C, { children: /* @__PURE__ */ l(
631
631
  t,
632
632
  {
@@ -679,8 +679,8 @@ function G(e) {
679
679
  context: e.context
680
680
  });
681
681
  }, i = function() {
682
- var f;
683
- return (f = e.block.repeat) != null && f.collection ? e.block : Y({
682
+ var h;
683
+ return (h = e.block.repeat) != null && h.collection ? e.block : Y({
684
684
  block: e.block,
685
685
  localState: e.context.localState,
686
686
  rootState: e.context.rootState,
@@ -695,15 +695,15 @@ function G(e) {
695
695
  var I, b;
696
696
  if ((I = e.block.repeat) != null && I.collection)
697
697
  return !!((b = n()) != null && b.length);
698
- const f = "hide" in i() ? i().hide : !1;
699
- return ("show" in i() ? i().show : !0) && !f;
698
+ const h = "hide" in i() ? i().hide : !1;
699
+ return ("show" in i() ? i().show : !0) && !h;
700
700
  }, r = function() {
701
701
  var w, I;
702
702
  return !((w = t()) != null && w.component) && !n() ? (I = i().children) != null ? I : [] : [];
703
703
  }, c = function() {
704
- var f, w, I, b;
704
+ var h, w, I, b;
705
705
  return {
706
- blockChildren: (f = i().children) != null ? f : [],
706
+ blockChildren: (h = i().children) != null ? h : [],
707
707
  componentRef: (w = t()) == null ? void 0 : w.component,
708
708
  componentOptions: {
709
709
  ...Je(i()),
@@ -724,7 +724,7 @@ function G(e) {
724
724
  };
725
725
  };
726
726
  return /* @__PURE__ */ l(C, { children: a() ? /* @__PURE__ */ E(C, { children: [
727
- /* @__PURE__ */ l(ht, { block: e.block, context: e.context }),
727
+ /* @__PURE__ */ l(ft, { block: e.block, context: e.context }),
728
728
  (s = t()) != null && s.noWrap ? /* @__PURE__ */ l(C, { children: /* @__PURE__ */ l(
729
729
  ge,
730
730
  {
@@ -738,7 +738,7 @@ function G(e) {
738
738
  includeBlockProps: c().includeBlockProps,
739
739
  isInteractive: c().isInteractive
740
740
  }
741
- ) }) : /* @__PURE__ */ l(C, { children: n() ? /* @__PURE__ */ l(C, { children: (m = n()) == null ? void 0 : m.map((u, f) => /* @__PURE__ */ l(
741
+ ) }) : /* @__PURE__ */ l(C, { children: n() ? /* @__PURE__ */ l(C, { children: (m = n()) == null ? void 0 : m.map((u, h) => /* @__PURE__ */ l(
742
742
  kt,
743
743
  {
744
744
  repeatContext: u.context,
@@ -746,7 +746,7 @@ function G(e) {
746
746
  registeredComponents: e.registeredComponents,
747
747
  linkComponent: e.linkComponent
748
748
  },
749
- f
749
+ h
750
750
  )) }) : /* @__PURE__ */ E(
751
751
  St,
752
752
  {
@@ -890,7 +890,7 @@ function It(e) {
890
890
  })
891
891
  };
892
892
  }, u = function(y) {
893
- const p = y === 0 ? 0 : t, T = r(y), W = `${p}px`, O = "100%", D = 0;
893
+ const p = y === 0 ? 0 : t, T = r(y), W = `${p}px`, D = "100%", j = 0;
894
894
  return {
895
895
  ...{
896
896
  display: "flex",
@@ -900,23 +900,23 @@ function It(e) {
900
900
  width: T,
901
901
  ["marginLeft"]: W,
902
902
  "--column-width-mobile": s({
903
- stackedStyle: O,
903
+ stackedStyle: D,
904
904
  desktopStyle: T
905
905
  }),
906
906
  "--column-margin-left-mobile": s({
907
- stackedStyle: D,
907
+ stackedStyle: j,
908
908
  desktopStyle: W
909
909
  }),
910
910
  "--column-width-tablet": c({
911
- stackedStyle: O,
911
+ stackedStyle: D,
912
912
  desktopStyle: T
913
913
  }),
914
914
  "--column-margin-left-tablet": c({
915
- stackedStyle: D,
915
+ stackedStyle: j,
916
916
  desktopStyle: W
917
917
  })
918
918
  };
919
- }, f = function(y) {
919
+ }, h = function(y) {
920
920
  var T, W;
921
921
  return Re(
922
922
  ((W = (T = e.builderContext.content) == null ? void 0 : T.meta) == null ? void 0 : W.breakpoints) || {}
@@ -924,7 +924,7 @@ function It(e) {
924
924
  }, w = function() {
925
925
  const y = `.${e.builderBlock.id}-breakpoints > .builder-column`;
926
926
  return `
927
- @media (max-width: ${f("medium")}px) {
927
+ @media (max-width: ${h("medium")}px) {
928
928
  .${e.builderBlock.id}-breakpoints {
929
929
  flex-direction: var(--flex-dir-tablet);
930
930
  align-items: stretch;
@@ -936,7 +936,7 @@ function It(e) {
936
936
  }
937
937
  }
938
938
 
939
- @media (max-width: ${f("small")}px) {
939
+ @media (max-width: ${h("small")}px) {
940
940
  .${e.builderBlock.id}-breakpoints {
941
941
  flex-direction: var(--flex-dir);
942
942
  align-items: stretch;
@@ -953,7 +953,7 @@ function It(e) {
953
953
  ...y.link ? {
954
954
  href: y.link
955
955
  } : {},
956
- [j()]: "builder-column",
956
+ [H()]: "builder-column",
957
957
  style: Ie(u(p))
958
958
  };
959
959
  };
@@ -972,12 +972,12 @@ function It(e) {
972
972
  nonce: e.builderContext.nonce
973
973
  }
974
974
  ),
975
- (P = e.columns) == null ? void 0 : P.map((v, y) => /* @__PURE__ */ l(
975
+ (P = e.columns) == null ? void 0 : P.map((x, y) => /* @__PURE__ */ l(
976
976
  oe,
977
977
  {
978
- TagName: o(v),
978
+ TagName: o(x),
979
979
  actionAttributes: {},
980
- attributes: I(v, y),
980
+ attributes: I(x, y),
981
981
  children: /* @__PURE__ */ l(
982
982
  le,
983
983
  {
@@ -989,7 +989,7 @@ function It(e) {
989
989
  context: e.builderContext,
990
990
  registeredComponents: e.builderComponents,
991
991
  linkComponent: e.builderLinkComponent,
992
- blocks: v.blocks
992
+ blocks: x.blocks
993
993
  }
994
994
  )
995
995
  },
@@ -1040,14 +1040,14 @@ function te(e) {
1040
1040
  function Pt(e) {
1041
1041
  var o, a, r, c, s, d;
1042
1042
  function t() {
1043
- var f;
1043
+ var h;
1044
1044
  const u = e.image || e.src;
1045
1045
  if (!u || // We can auto add srcset for cdn.builder.io and shopify
1046
1046
  // images, otherwise you can supply this prop manually
1047
1047
  !(u.match(/builder\.io/) || u.match(/cdn\.shopify\.com/)))
1048
1048
  return e.srcset;
1049
1049
  if (!e.noWebp) {
1050
- if (e.srcset && ((f = e.image) != null && f.includes("builder.io/api/v1/image"))) {
1050
+ if (e.srcset && ((h = e.image) != null && h.includes("builder.io/api/v1/image"))) {
1051
1051
  if (!e.srcset.includes(e.image.split("?")[0]))
1052
1052
  return console.debug("Removed given srcset"), te(u);
1053
1053
  } else if (e.image && !e.srcset)
@@ -1069,7 +1069,8 @@ function Pt(e) {
1069
1069
  };
1070
1070
  return e.aspectRatio ? m : void 0;
1071
1071
  }
1072
- return /* @__PURE__ */ E(C, { children: [
1072
+ return R(() => {
1073
+ }, []), /* @__PURE__ */ E(C, { children: [
1073
1074
  /* @__PURE__ */ E(C, { children: [
1074
1075
  /* @__PURE__ */ E("picture", { children: [
1075
1076
  n() ? /* @__PURE__ */ l("source", { type: "image/webp", srcSet: n() }) : null,
@@ -1085,7 +1086,7 @@ function Pt(e) {
1085
1086
  objectFit: e.backgroundSize || "cover",
1086
1087
  ...i()
1087
1088
  },
1088
- className: "builder-image" + (e.className ? " " + e.className : "") + " img-56bbd606",
1089
+ className: "builder-image" + (e.className ? " " + e.className : "") + " img-2d6925f2",
1089
1090
  src: e.image,
1090
1091
  srcSet: t(),
1091
1092
  sizes: e.sizes
@@ -1095,23 +1096,23 @@ function Pt(e) {
1095
1096
  e.aspectRatio && !((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ l(
1096
1097
  "div",
1097
1098
  {
1098
- className: "builder-image-sizer div-56bbd606",
1099
+ className: "builder-image-sizer div-2d6925f2",
1099
1100
  style: {
1100
1101
  paddingTop: e.aspectRatio * 100 + "%"
1101
1102
  }
1102
1103
  }
1103
1104
  ) : null,
1104
1105
  (c = (r = e.builderBlock) == null ? void 0 : r.children) != null && c.length && e.fitContent ? /* @__PURE__ */ l(C, { children: e.children }) : null,
1105
- !e.fitContent && ((d = (s = e.builderBlock) == null ? void 0 : s.children) != null && d.length) ? /* @__PURE__ */ l("div", { className: "div-56bbd606-2", children: e.children }) : null
1106
+ !e.fitContent && ((d = (s = e.builderBlock) == null ? void 0 : s.children) != null && d.length) ? /* @__PURE__ */ l("div", { className: "div-2d6925f2-2", children: e.children }) : null
1106
1107
  ] }),
1107
- /* @__PURE__ */ l("style", { children: `.img-56bbd606 {
1108
+ /* @__PURE__ */ l("style", { children: `.img-2d6925f2 {
1108
1109
  opacity: 1;
1109
1110
  transition: opacity 0.2s ease-in-out;
1110
- }.div-56bbd606 {
1111
+ }.div-2d6925f2 {
1111
1112
  width: 100%;
1112
1113
  pointer-events: none;
1113
1114
  font-size: 0;
1114
- }.div-56bbd606-2 {
1115
+ }.div-2d6925f2-2 {
1115
1116
  display: flex;
1116
1117
  flex-direction: column;
1117
1118
  align-items: stretch;
@@ -1419,8 +1420,8 @@ const Wt = {
1419
1420
  let u = !1;
1420
1421
  m.onload = () => {
1421
1422
  u = !0, s(m);
1422
- }, m.addEventListener("error", (f) => {
1423
- console.warn("Image load failed", f.error), d(f.error);
1423
+ }, m.addEventListener("error", (h) => {
1424
+ console.warn("Image load failed", h.error), d(h.error);
1424
1425
  }), m.src = r, setTimeout(() => {
1425
1426
  u || d(new Error("Image load timed out"));
1426
1427
  }, c);
@@ -1621,7 +1622,8 @@ const Ot = {
1621
1622
  }
1622
1623
  }, Dt = {
1623
1624
  shouldReceiveBuilderProps: {
1624
- builderBlock: !1
1625
+ builderBlock: !1,
1626
+ builderContext: !0
1625
1627
  },
1626
1628
  name: "Text",
1627
1629
  static: !0,
@@ -1642,12 +1644,30 @@ const Ot = {
1642
1644
  }
1643
1645
  };
1644
1646
  function jt(e) {
1645
- var t;
1646
1647
  return /* @__PURE__ */ l(
1647
1648
  "div",
1648
1649
  {
1649
1650
  className: "builder-text",
1650
- dangerouslySetInnerHTML: { __html: ((t = e.text) == null ? void 0 : t.toString()) || "" },
1651
+ dangerouslySetInnerHTML: { __html: function() {
1652
+ var s;
1653
+ const i = e.builderContext, {
1654
+ context: o,
1655
+ localState: a,
1656
+ rootState: r,
1657
+ rootSetState: c
1658
+ } = i;
1659
+ return String(((s = e.text) == null ? void 0 : s.toString()) || "").replace(
1660
+ /{{([^}]+)}}/g,
1661
+ (d, m) => O({
1662
+ code: m,
1663
+ context: o,
1664
+ localState: a,
1665
+ rootState: r,
1666
+ rootSetState: c,
1667
+ enableCache: !1
1668
+ })
1669
+ );
1670
+ }() },
1651
1671
  style: {
1652
1672
  outline: "none"
1653
1673
  }
@@ -1741,13 +1761,13 @@ function zt(e) {
1741
1761
  const u = d[m];
1742
1762
  if (u.src && !n.includes(u.src)) {
1743
1763
  n.push(u.src);
1744
- const f = document.createElement("script");
1745
- f.async = !0, f.src = u.src, document.head.appendChild(f);
1764
+ const h = document.createElement("script");
1765
+ h.async = !0, h.src = u.src, document.head.appendChild(h);
1746
1766
  } else if (Kt(u) && !o.includes(u.innerText))
1747
1767
  try {
1748
1768
  o.push(u.innerText), new Function(u.innerText)();
1749
- } catch (f) {
1750
- console.warn("`Embed`: Error running script:", f);
1769
+ } catch (h) {
1770
+ console.warn("`Embed`: Error running script:", h);
1751
1771
  }
1752
1772
  }
1753
1773
  }
@@ -2148,7 +2168,7 @@ const rn = _e({
2148
2168
  BlocksWrapperProps: {},
2149
2169
  nonce: ""
2150
2170
  });
2151
- function ve(e) {
2171
+ function xe(e) {
2152
2172
  return Math.round(e * 1e3) / 1e3;
2153
2173
  }
2154
2174
  const cn = (e, t, n = !0) => {
@@ -2169,7 +2189,7 @@ const cn = (e, t, n = !0) => {
2169
2189
  event: e,
2170
2190
  target: t
2171
2191
  }) => {
2172
- const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, a = ve(i / n.width), r = ve(o / n.height);
2192
+ const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, a = xe(i / n.width), r = xe(o / n.height);
2173
2193
  return {
2174
2194
  x: a,
2175
2195
  y: r
@@ -2197,7 +2217,7 @@ async function dn({
2197
2217
  }) {
2198
2218
  return Fe(), globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e, t), { [e]: t };
2199
2219
  }
2200
- function xe(e, ...t) {
2220
+ function ve(e, ...t) {
2201
2221
  const n = Object(e);
2202
2222
  for (let i = 1; i < arguments.length; i++) {
2203
2223
  const o = arguments[i];
@@ -2211,27 +2231,27 @@ function un(e) {
2211
2231
  console.warn(`Cannot animate element: element with ID ${e} not found!`);
2212
2232
  }
2213
2233
  function mn(e, t) {
2214
- const n = hn(e), i = getComputedStyle(t), o = e.steps[0].styles, a = e.steps[e.steps.length - 1].styles, r = [o, a];
2234
+ const n = fn(e), i = getComputedStyle(t), o = e.steps[0].styles, a = e.steps[e.steps.length - 1].styles, r = [o, a];
2215
2235
  for (const c of r)
2216
2236
  for (const s of n)
2217
2237
  s in c || (c[s] = i[s]);
2218
2238
  }
2219
- function hn(e) {
2239
+ function fn(e) {
2220
2240
  const t = [];
2221
2241
  for (const n of e.steps)
2222
2242
  for (const i in n.styles)
2223
2243
  t.indexOf(i) === -1 && t.push(i);
2224
2244
  return t;
2225
2245
  }
2226
- function fn(e) {
2246
+ function hn(e) {
2227
2247
  const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
2228
2248
  if (!t.length) {
2229
2249
  un(e.elementId || e.id || "");
2230
2250
  return;
2231
2251
  }
2232
2252
  Array.from(t).forEach((n) => {
2233
- mn(e, n), n.style.transition = "none", n.style.transitionDelay = "0", xe(n.style, e.steps[0].styles), setTimeout(() => {
2234
- n.style.transition = `all ${e.duration}s ${re(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), xe(n.style, e.steps[1].styles), setTimeout(() => {
2253
+ mn(e, n), n.style.transition = "none", n.style.transitionDelay = "0", ve(n.style, e.steps[0].styles), setTimeout(() => {
2254
+ n.style.transition = `all ${e.duration}s ${re(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), ve(n.style, e.steps[1].styles), setTimeout(() => {
2235
2255
  n.style.transition = "", n.style.transitionDelay = "";
2236
2256
  }, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
2237
2257
  });
@@ -2271,7 +2291,7 @@ font-weight: ${c};
2271
2291
  }, yn = ({
2272
2292
  cssCode: e,
2273
2293
  contentId: t
2274
- }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", vn = `
2294
+ }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", xn = `
2275
2295
  .builder-button {
2276
2296
  all: unset;
2277
2297
  }
@@ -2288,21 +2308,21 @@ font-weight: ${c};
2288
2308
  text-align: inherit;
2289
2309
  font-family: inherit;
2290
2310
  }
2291
- `, Sn = (e) => e ? "" : vn, xn = (e) => `variant-${e}`;
2311
+ `, Sn = (e) => e ? "" : xn, vn = (e) => `variant-${e}`;
2292
2312
  function pn(e) {
2293
- var W, O, D, X, Z, se, de;
2313
+ var W, D, j, X, Z, se, de;
2294
2314
  const t = ie(null);
2295
2315
  function n(g) {
2296
- var S, x;
2297
- const h = {
2316
+ var S, v;
2317
+ const f = {
2298
2318
  ...e.builderContextSignal.rootState,
2299
2319
  ...g
2300
2320
  };
2301
- e.builderContextSignal.rootSetState ? (x = (S = e.builderContextSignal).rootSetState) == null || x.call(S, h) : e.builderContextSignal.rootState = h;
2321
+ e.builderContextSignal.rootSetState ? (v = (S = e.builderContextSignal).rootSetState) == null || v.call(S, f) : e.builderContextSignal.rootState = f;
2302
2322
  }
2303
2323
  function i(g) {
2304
- var S, x, k, B, U;
2305
- const h = {
2324
+ var S, v, k, B, U;
2325
+ const f = {
2306
2326
  ...e.builderContextSignal.content,
2307
2327
  ...g,
2308
2328
  data: {
@@ -2310,14 +2330,14 @@ function pn(e) {
2310
2330
  ...g == null ? void 0 : g.data
2311
2331
  },
2312
2332
  meta: {
2313
- ...(x = e.builderContextSignal.content) == null ? void 0 : x.meta,
2333
+ ...(v = e.builderContextSignal.content) == null ? void 0 : v.meta,
2314
2334
  ...g == null ? void 0 : g.meta,
2315
2335
  breakpoints: ((k = g == null ? void 0 : g.meta) == null ? void 0 : k.breakpoints) || ((U = (B = e.builderContextSignal.content) == null ? void 0 : B.meta) == null ? void 0 : U.breakpoints)
2316
2336
  }
2317
2337
  };
2318
2338
  dn({
2319
- value: h,
2320
- key: h.id
2339
+ value: f,
2340
+ key: f.id
2321
2341
  }).then(() => {
2322
2342
  T.refresh();
2323
2343
  });
@@ -2336,28 +2356,28 @@ function pn(e) {
2336
2356
  model: e.model,
2337
2357
  trustedHosts: e.trustedHosts,
2338
2358
  callbacks: {
2339
- configureSdk: (h) => {
2359
+ configureSdk: (f) => {
2340
2360
  var k;
2341
- const { breakpoints: S, contentId: x } = h;
2342
- !x || x !== ((k = e.builderContextSignal.content) == null ? void 0 : k.id) || S && i({
2361
+ const { breakpoints: S, contentId: v } = f;
2362
+ !v || v !== ((k = e.builderContextSignal.content) == null ? void 0 : k.id) || S && i({
2343
2363
  meta: {
2344
2364
  breakpoints: S
2345
2365
  }
2346
2366
  });
2347
2367
  },
2348
- animation: (h) => {
2349
- fn(h);
2368
+ animation: (f) => {
2369
+ hn(f);
2350
2370
  },
2351
- contentUpdate: (h) => {
2352
- i(h);
2371
+ contentUpdate: (f) => {
2372
+ i(f);
2353
2373
  }
2354
2374
  }
2355
2375
  })(g);
2356
2376
  }
2357
2377
  function s() {
2358
- var h, S;
2359
- const g = (S = (h = e.builderContextSignal.content) == null ? void 0 : h.data) == null ? void 0 : S.jsCode;
2360
- g && H({
2378
+ var f, S;
2379
+ const g = (S = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : S.jsCode;
2380
+ g && O({
2361
2381
  code: g,
2362
2382
  context: e.context || {},
2363
2383
  localState: void 0,
@@ -2369,17 +2389,17 @@ function pn(e) {
2369
2389
  enableCache: !1
2370
2390
  });
2371
2391
  }
2372
- const [d, m] = A(() => ({})), [u, f] = A(() => ({})), [w, I] = A(() => !1);
2392
+ const [d, m] = A(() => ({})), [u, h] = A(() => ({})), [w, I] = A(() => !1);
2373
2393
  function b(g) {
2374
- var h, S;
2394
+ var f, S;
2375
2395
  if (e.builderContextSignal.content) {
2376
- const x = (h = e.builderContextSignal.content) == null ? void 0 : h.testVariationId, k = (S = e.builderContextSignal.content) == null ? void 0 : S.id;
2396
+ const v = (f = e.builderContextSignal.content) == null ? void 0 : f.testVariationId, k = (S = e.builderContextSignal.content) == null ? void 0 : S.id;
2377
2397
  ue({
2378
2398
  type: "click",
2379
2399
  canTrack: q(e.canTrack),
2380
2400
  contentId: k,
2381
2401
  apiKey: e.apiKey,
2382
- variationId: x !== k ? x : void 0,
2402
+ variationId: v !== k ? v : void 0,
2383
2403
  ...sn(g),
2384
2404
  unique: !w
2385
2405
  });
@@ -2387,8 +2407,8 @@ function pn(e) {
2387
2407
  w || I(!0);
2388
2408
  }
2389
2409
  function P() {
2390
- var h, S, x;
2391
- const g = (x = (S = (h = e.builderContextSignal.content) == null ? void 0 : h.data) == null ? void 0 : S.httpRequests) != null ? x : {};
2410
+ var f, S, v;
2411
+ const g = (v = (S = (f = e.builderContextSignal.content) == null ? void 0 : f.data) == null ? void 0 : S.httpRequests) != null ? v : {};
2392
2412
  Object.entries(g).forEach(([k, B]) => {
2393
2413
  if (!B || u[k] || d[k] && !V())
2394
2414
  return;
@@ -2396,7 +2416,7 @@ function pn(e) {
2396
2416
  const U = B.replace(
2397
2417
  /{{([^}]+)}}/g,
2398
2418
  ($, Ne) => String(
2399
- H({
2419
+ O({
2400
2420
  code: Ne,
2401
2421
  context: e.context || {},
2402
2422
  localState: void 0,
@@ -2417,7 +2437,7 @@ function pn(e) {
2417
2437
  });
2418
2438
  });
2419
2439
  }
2420
- function v() {
2440
+ function x() {
2421
2441
  V() && window.dispatchEvent(
2422
2442
  new CustomEvent(
2423
2443
  "builder:component:stateChange",
@@ -2445,20 +2465,20 @@ function pn(e) {
2445
2465
  } : {}
2446
2466
  }), Object.values(
2447
2467
  e.builderContextSignal.componentInfos
2448
- ).forEach((h) => {
2449
- var x;
2450
- const S = Me(h);
2451
- (x = window.parent) == null || x.postMessage(S, "*");
2468
+ ).forEach((f) => {
2469
+ var v;
2470
+ const S = Me(f);
2471
+ (v = window.parent) == null || v.postMessage(S, "*");
2452
2472
  }), window.addEventListener(
2453
2473
  "builder:component:stateChangeListenerActivated",
2454
- v
2474
+ x
2455
2475
  );
2456
2476
  }
2457
2477
  function p(g) {
2458
- const h = new URL(location.href).searchParams, S = h.get("builder.preview"), x = h.get(
2478
+ const f = new URL(location.href).searchParams, S = f.get("builder.preview"), v = f.get(
2459
2479
  `builder.overrides.${S}`
2460
- ), k = h.get("apiKey") || h.get("builder.space");
2461
- S === e.model && k === e.apiKey && (!e.content || x === e.content.id) && ke({
2480
+ ), k = f.get("apiKey") || f.get("builder.space");
2481
+ S === e.model && k === e.apiKey && (!e.content || v === e.content.id) && ke({
2462
2482
  model: e.model,
2463
2483
  apiKey: e.apiKey,
2464
2484
  apiVersion: e.builderContextSignal.apiVersion
@@ -2473,8 +2493,8 @@ function pn(e) {
2473
2493
  "initeditingbldr",
2474
2494
  y
2475
2495
  ), () => {
2476
- var h;
2477
- return (h = t.current) == null ? void 0 : h.removeEventListener(
2496
+ var f;
2497
+ return (f = t.current) == null ? void 0 : f.removeEventListener(
2478
2498
  "initeditingbldr",
2479
2499
  y
2480
2500
  );
@@ -2485,23 +2505,23 @@ function pn(e) {
2485
2505
  "initpreviewingbldr",
2486
2506
  p
2487
2507
  ), () => {
2488
- var h;
2489
- return (h = t.current) == null ? void 0 : h.removeEventListener(
2508
+ var f;
2509
+ return (f = t.current) == null ? void 0 : f.removeEventListener(
2490
2510
  "initpreviewingbldr",
2491
2511
  p
2492
2512
  );
2493
2513
  };
2494
2514
  }, []), R(() => {
2495
- var g, h;
2515
+ var g, f;
2496
2516
  if (L()) {
2497
2517
  if (V() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && q(e.canTrack)) {
2498
- const x = (g = e.builderContextSignal.content) == null ? void 0 : g.testVariationId, k = (h = e.builderContextSignal.content) == null ? void 0 : h.id, B = e.apiKey;
2518
+ const v = (g = e.builderContextSignal.content) == null ? void 0 : g.testVariationId, k = (f = e.builderContextSignal.content) == null ? void 0 : f.id, B = e.apiKey;
2499
2519
  ue({
2500
2520
  type: "impression",
2501
2521
  canTrack: !0,
2502
2522
  contentId: k,
2503
2523
  apiKey: B,
2504
- variationId: x !== k ? x : void 0
2524
+ variationId: v !== k ? v : void 0
2505
2525
  });
2506
2526
  }
2507
2527
  Le() && V();
@@ -2509,14 +2529,14 @@ function pn(e) {
2509
2529
  }, []), R(() => {
2510
2530
  e.apiKey || J.error(
2511
2531
  "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
2512
- ), s(), P(), v();
2532
+ ), s(), P(), x();
2513
2533
  }, []), R(() => {
2514
2534
  }, [e.content]), R(() => {
2515
2535
  s();
2516
- }, [(O = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : O.jsCode]), R(() => {
2536
+ }, [(D = (W = e.builderContextSignal.content) == null ? void 0 : W.data) == null ? void 0 : D.jsCode]), R(() => {
2517
2537
  P();
2518
- }, [(X = (D = e.builderContextSignal.content) == null ? void 0 : D.data) == null ? void 0 : X.httpRequests]), R(() => {
2519
- v();
2538
+ }, [(X = (j = e.builderContextSignal.content) == null ? void 0 : j.data) == null ? void 0 : X.httpRequests]), R(() => {
2539
+ x();
2520
2540
  }, [e.builderContextSignal.rootState]), R(() => {
2521
2541
  e.data && n(e.data);
2522
2542
  }, [e.data]), R(() => {
@@ -2526,7 +2546,7 @@ function pn(e) {
2526
2546
  }, [e.locale]), R(() => () => {
2527
2547
  L() && (window.removeEventListener("message", c), window.removeEventListener(
2528
2548
  "builder:component:stateChangeListenerActivated",
2529
- v
2549
+ x
2530
2550
  ));
2531
2551
  }, []), /* @__PURE__ */ l(rn.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ l(
2532
2552
  a,
@@ -2537,7 +2557,7 @@ function pn(e) {
2537
2557
  "builder-model": e.model,
2538
2558
  ...o(),
2539
2559
  ...e.contentWrapperProps,
2540
- className: xn(
2560
+ className: vn(
2541
2561
  ((se = e.content) == null ? void 0 : se.testVariationId) || ((de = e.content) == null ? void 0 : de.id)
2542
2562
  ),
2543
2563
  children: e.children
@@ -2593,7 +2613,7 @@ const Cn = ({
2593
2613
  meta: e == null ? void 0 : e.meta
2594
2614
  } : void 0;
2595
2615
  function pe(e) {
2596
- var o, a, r, c, s, d, m, u, f, w, I;
2616
+ var o, a, r, c, s, d, m, u, h, w, I;
2597
2617
  const t = an({
2598
2618
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2599
2619
  variationId: (o = e.content) == null ? void 0 : o.testVariationId,
@@ -2603,11 +2623,11 @@ function pe(e) {
2603
2623
  ...ye(),
2604
2624
  ...((r = e.customComponents) == null ? void 0 : r.filter(({ models: b }) => !(b != null && b.length) || !e.model ? !0 : b.includes(e.model))) || []
2605
2625
  ].reduce(
2606
- (b, { component: P, ...v }) => ({
2626
+ (b, { component: P, ...x }) => ({
2607
2627
  ...b,
2608
- [v.name]: {
2628
+ [x.name]: {
2609
2629
  component: P,
2610
- ...me(v)
2630
+ ...me(x)
2611
2631
  }
2612
2632
  }),
2613
2633
  {}
@@ -2631,9 +2651,9 @@ function pe(e) {
2631
2651
  ...ye(),
2632
2652
  ...((c = e.customComponents) == null ? void 0 : c.filter(({ models: b }) => !(b != null && b.length) || !e.model ? !0 : b.includes(e.model))) || []
2633
2653
  ].reduce(
2634
- (b, { component: P, ...v }) => ({
2654
+ (b, { component: P, ...x }) => ({
2635
2655
  ...b,
2636
- [v.name]: me(v)
2656
+ [x.name]: me(x)
2637
2657
  }),
2638
2658
  {}
2639
2659
  ),
@@ -2675,7 +2695,7 @@ function pe(e) {
2675
2695
  isNestedRender: e.isNestedRender,
2676
2696
  contentId: (s = i.content) == null ? void 0 : s.id,
2677
2697
  cssCode: (m = (d = i.content) == null ? void 0 : d.data) == null ? void 0 : m.cssCode,
2678
- customFonts: (f = (u = i.content) == null ? void 0 : u.data) == null ? void 0 : f.customFonts
2698
+ customFonts: (h = (u = i.content) == null ? void 0 : u.data) == null ? void 0 : h.customFonts
2679
2699
  }
2680
2700
  ),
2681
2701
  /* @__PURE__ */ l(
@@ -2823,12 +2843,12 @@ async function Rn(e) {
2823
2843
  }, n = function() {
2824
2844
  return "div";
2825
2845
  }, i = function() {
2826
- var u, f;
2846
+ var u, h;
2827
2847
  return [
2828
- e.attributes[j()],
2848
+ e.attributes[H()],
2829
2849
  "builder-symbol",
2830
2850
  (u = e.symbol) != null && u.inline ? "builder-inline-symbol" : void 0,
2831
- (f = e.symbol) != null && f.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2851
+ (h = e.symbol) != null && h.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2832
2852
  ].filter(Boolean).join(" ");
2833
2853
  }, o = ((a = e.symbol) == null ? void 0 : a.content) || await Tn({
2834
2854
  symbol: e.symbol,