@builder.io/sdk-react 4.0.2 → 4.0.4-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +944 -0
  2. package/lib/browser/blocks-exports.cjs +32 -29
  3. package/lib/browser/blocks-exports.mjs +484 -465
  4. package/lib/browser/index.cjs +1 -1
  5. package/lib/browser/index.mjs +1 -1
  6. package/lib/browser/{server-entry-9e5daeda.cjs → server-entry-c40e781d.cjs} +1 -1
  7. package/lib/browser/{server-entry-25e49efc.js → server-entry-e6ae7704.js} +1 -1
  8. package/lib/browser/server-entry.cjs +1 -1
  9. package/lib/browser/server-entry.mjs +1 -1
  10. package/lib/edge/{accordion-f5e5687b.cjs → accordion-8934ef4b.cjs} +1 -1
  11. package/lib/edge/{accordion-5063d748.js → accordion-e657c96d.js} +1 -1
  12. package/lib/edge/{blocks-f3b2fbd5.js → blocks-890ac50f.js} +243 -241
  13. package/lib/edge/{blocks-d690074d.cjs → blocks-efa04c3b.cjs} +10 -10
  14. package/lib/edge/blocks-exports.cjs +1 -1
  15. package/lib/edge/blocks-exports.mjs +2 -2
  16. package/lib/edge/{button-0d0430e9.js → button-3522aac2.js} +2 -2
  17. package/lib/edge/{button-7cac2c65.cjs → button-49563e3b.cjs} +1 -1
  18. package/lib/edge/{columns-19b22772.js → columns-70b88fce.js} +3 -3
  19. package/lib/edge/{columns-87b82f2f.cjs → columns-eb192117.cjs} +1 -1
  20. package/lib/edge/{content-variants-0f0a71cb.js → content-variants-6a73b6e9.js} +125 -118
  21. package/lib/edge/{content-variants-80fc28d8.cjs → content-variants-893bba4d.cjs} +16 -13
  22. package/lib/edge/custom-code-1a43bbd7.js +52 -0
  23. package/lib/edge/custom-code-ae3262be.cjs +1 -0
  24. package/lib/edge/embed-106f0066.js +38 -0
  25. package/lib/edge/embed-8d302933.cjs +1 -0
  26. package/lib/edge/{form-0b5bd2e3.cjs → form-89839d91.cjs} +1 -1
  27. package/lib/edge/{form-b8f74b68.js → form-e6ea2320.js} +3 -3
  28. package/lib/edge/{get-class-prop-name-6ef08339.cjs → get-class-prop-name-dad1ee7e.cjs} +1 -1
  29. package/lib/edge/{get-class-prop-name-f3ce6ca4.js → get-class-prop-name-e44df0c8.js} +1 -1
  30. package/lib/edge/{image-38917f45.js → image-1729f079.js} +20 -19
  31. package/lib/edge/{image-590e36ae.cjs → image-a6fbd15b.cjs} +3 -3
  32. package/lib/edge/img-337990c2.cjs +1 -0
  33. package/lib/edge/{img-4becc0d4.js → img-3efcbcca.js} +4 -3
  34. package/lib/edge/index.cjs +1 -1
  35. package/lib/edge/index.mjs +1 -1
  36. package/lib/edge/{input-6884ec2d.cjs → input-92aaa4f2.cjs} +1 -1
  37. package/lib/edge/{input-768a5984.js → input-d6338de6.js} +1 -1
  38. package/lib/edge/{personalization-container-8b32ce9d.cjs → personalization-container-576b7363.cjs} +1 -1
  39. package/lib/edge/{personalization-container-b581d0f6.js → personalization-container-c8d741e6.js} +4 -4
  40. package/lib/edge/{select-e54dc6bc.js → select-1538b41a.js} +1 -1
  41. package/lib/edge/{select-ac5b39d8.cjs → select-5ce728b4.cjs} +1 -1
  42. package/lib/edge/{server-entry-818ae9c6.js → server-entry-2e94ad2c.js} +1 -1
  43. package/lib/edge/{server-entry-a60fb569.cjs → server-entry-46e686b9.cjs} +1 -1
  44. package/lib/edge/server-entry.cjs +1 -1
  45. package/lib/edge/server-entry.mjs +1 -1
  46. package/lib/edge/{slot-05218273.js → slot-26162c51.js} +3 -3
  47. package/lib/edge/{slot-5dba6213.cjs → slot-ed4d2827.cjs} +1 -1
  48. package/lib/edge/{symbol-9f247918.js → symbol-3b2e7ebf.js} +2 -2
  49. package/lib/edge/{symbol-f4b09828.cjs → symbol-cd10b6f0.cjs} +1 -1
  50. package/lib/edge/{tabs-02960a8c.cjs → tabs-7273a1e3.cjs} +1 -1
  51. package/lib/edge/{tabs-a0b38dde.js → tabs-c576cd8f.js} +3 -3
  52. package/lib/node/blocks-exports.cjs +32 -29
  53. package/lib/node/blocks-exports.mjs +493 -474
  54. package/lib/node/index.cjs +1 -1
  55. package/lib/node/index.mjs +3 -3
  56. package/lib/node/init.cjs +1 -1
  57. package/lib/node/init.mjs +3 -3
  58. package/lib/node/{server-entry-2a2cad4a.cjs → server-entry-6b05381c.cjs} +1 -1
  59. package/lib/node/{server-entry-702b1a29.js → server-entry-c1000f54.js} +1 -1
  60. package/lib/node/server-entry.cjs +1 -1
  61. package/lib/node/server-entry.mjs +1 -1
  62. package/lib/node/{setIvm-0a6b0788.js → setIvm-011d6eb2.js} +1 -1
  63. package/lib/node/{setIvm-9cddfc1a.cjs → setIvm-4ae0308c.cjs} +1 -1
  64. package/lib/node/setIvm.cjs +1 -1
  65. package/lib/node/setIvm.mjs +2 -2
  66. package/lib/node/{should-force-browser-runtime-in-node-d6c9e985.cjs → should-force-browser-runtime-in-node-5d513614.cjs} +1 -1
  67. package/lib/node/{should-force-browser-runtime-in-node-dfff7f8f.js → should-force-browser-runtime-in-node-abf8d0a7.js} +1 -1
  68. package/package.json +4 -4
  69. package/types/blocks/image/image.types.d.ts +1 -0
  70. package/types/blocks/img/img.d.ts +1 -0
  71. package/types/components/content-variants/inlined-fns.d.ts +1 -1
  72. package/types/constants/sdk-version.d.ts +1 -1
  73. package/lib/edge/custom-code-7786788e.js +0 -43
  74. package/lib/edge/custom-code-8119ea3f.cjs +0 -1
  75. package/lib/edge/embed-32bdd007.cjs +0 -1
  76. package/lib/edge/embed-5c1bbe12.js +0 -37
  77. package/lib/edge/img-20126279.cjs +0 -1
@@ -1,9 +1,9 @@
1
- import { jsx as h, jsxs as K, Fragment as Q } from "react/jsx-runtime";
2
- import { lazy as y, useRef as O, useState as T, useEffect as E } from "react";
3
- import { isBrowser as M, TARGET as J, isEditing as W, isPreviewing as oe, registerInsertMenu as ce, setupBrowserForEditing as me, createRegisterComponentMessage as pe, getDefaultCanTrack as L, getCookieSync as fe, _track as X, fetchOneEntry as ge, createEditorListener as he, logFetch as be, serializeIncludingFunctions as Z, logger as ye, handleABTestingSync as xe } from "./server-entry-818ae9c6.js";
1
+ import { jsx as h, jsxs as O, Fragment as Q } from "react/jsx-runtime";
2
+ import { lazy as y, useRef as M, useState as T, useEffect as E } from "react";
3
+ import { isBrowser as z, TARGET as N, isEditing as A, isPreviewing as oe, registerInsertMenu as ce, setupBrowserForEditing as me, createRegisterComponentMessage as pe, getDefaultCanTrack as L, getCookieSync as ge, _track as X, fetchOneEntry as fe, createEditorListener as he, logFetch as be, serializeIncludingFunctions as Z, logger as ye, handleABTestingSync as xe } from "./server-entry-2e94ad2c.js";
4
4
  import { Video as ve, Button as Se, Columns as Te, Fragment as Ie, Image as ke, Section as Ce, Symbol as we, Text as Ve, BuilderContext as Re } from "./blocks-exports.mjs";
5
- import { triggerAnimation as Ee, evaluate as re, fastClone as Fe, InlinedStyles as le, ComponentsContext as Pe, Blocks as We } from "./blocks-f3b2fbd5.js";
6
- const q = {
5
+ import { triggerAnimation as Ee, evaluate as re, fastClone as Fe, InlinedStyles as le, ComponentsContext as Pe, Blocks as Ae } from "./blocks-890ac50f.js";
6
+ const $ = {
7
7
  "@type": "@builder.io/sdk:Element",
8
8
  layerName: "Accordion item title",
9
9
  responsiveStyles: {
@@ -32,7 +32,7 @@ const q = {
32
32
  }
33
33
  }
34
34
  }]
35
- }, $ = {
35
+ }, _ = {
36
36
  "@type": "@builder.io/sdk:Element",
37
37
  layerName: "Accordion item detail",
38
38
  responsiveStyles: {
@@ -63,7 +63,7 @@ const q = {
63
63
  }
64
64
  }
65
65
  }]
66
- }, Ae = {
66
+ }, We = {
67
67
  name: "Builder:Accordion",
68
68
  canHaveChildren: !0,
69
69
  image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
@@ -80,19 +80,19 @@ const q = {
80
80
  name: "title",
81
81
  type: "uiBlocks",
82
82
  hideFromUI: !0,
83
- defaultValue: [q]
83
+ defaultValue: [$]
84
84
  }, {
85
85
  name: "detail",
86
86
  type: "uiBlocks",
87
87
  hideFromUI: !0,
88
- defaultValue: [$]
88
+ defaultValue: [_]
89
89
  }],
90
90
  defaultValue: [{
91
- title: [q],
92
- detail: [$]
91
+ title: [$],
92
+ detail: [_]
93
93
  }, {
94
- title: [q],
95
- detail: [$]
94
+ title: [$],
95
+ detail: [_]
96
96
  }],
97
97
  showIf: (e) => !e.get("useChildrenForItems")
98
98
  }, {
@@ -127,7 +127,7 @@ const q = {
127
127
  builderComponents: !0,
128
128
  builderLinkComponent: !0
129
129
  }
130
- }, Be = y(() => import("./accordion-5063d748.js")), De = {
130
+ }, Be = y(() => import("./accordion-e657c96d.js")), De = {
131
131
  name: "Core:Button",
132
132
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
133
133
  defaultStyles: {
@@ -443,6 +443,10 @@ const q = {
443
443
  name: "altText",
444
444
  type: "string",
445
445
  helperText: "Text to display when the user has images off"
446
+ }, {
447
+ name: "title",
448
+ type: "string",
449
+ helperText: "Text to display when hovering over the asset"
446
450
  }, {
447
451
  name: "height",
448
452
  type: "number",
@@ -519,7 +523,7 @@ const q = {
519
523
  defaultValue: []
520
524
  }]
521
525
  }]
522
- }, $e = y(() => import("./personalization-container-b581d0f6.js")), _e = {
526
+ }, $e = y(() => import("./personalization-container-c8d741e6.js")), _e = {
523
527
  name: "Core:Section",
524
528
  static: !0,
525
529
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -558,7 +562,7 @@ const q = {
558
562
  }
559
563
  }
560
564
  }]
561
- }, je = {
565
+ }, Ke = {
562
566
  name: "Slot",
563
567
  isRSC: !0,
564
568
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -575,7 +579,7 @@ const q = {
575
579
  builderContext: !0,
576
580
  builderComponents: !0
577
581
  }
578
- }, Ke = y(() => import("./slot-05218273.js")), Oe = {
582
+ }, je = y(() => import("./slot-26162c51.js")), Oe = {
579
583
  name: "Symbol",
580
584
  noWrap: !0,
581
585
  static: !0,
@@ -614,7 +618,7 @@ const q = {
614
618
  builderComponents: !0,
615
619
  builderLinkComponent: !0
616
620
  }
617
- }, _ = {
621
+ }, K = {
618
622
  "@type": "@builder.io/sdk:Element",
619
623
  responsiveStyles: {
620
624
  large: {
@@ -662,7 +666,7 @@ const q = {
662
666
  name: "label",
663
667
  type: "uiBlocks",
664
668
  hideFromUI: !0,
665
- defaultValue: [_]
669
+ defaultValue: [K]
666
670
  }, {
667
671
  name: "content",
668
672
  type: "uiBlocks",
@@ -671,7 +675,7 @@ const q = {
671
675
  }],
672
676
  defaultValue: [{
673
677
  label: [{
674
- ..._,
678
+ ...K,
675
679
  component: {
676
680
  name: "Text",
677
681
  options: {
@@ -690,7 +694,7 @@ const q = {
690
694
  }]
691
695
  }, {
692
696
  label: [{
693
- ..._,
697
+ ...K,
694
698
  component: {
695
699
  name: "Text",
696
700
  options: {
@@ -755,7 +759,7 @@ const q = {
755
759
  builderComponents: !0,
756
760
  builderLinkComponent: !0
757
761
  }
758
- }, ze = y(() => import("./tabs-a0b38dde.js")), Je = {
762
+ }, ze = y(() => import("./tabs-c576cd8f.js")), Je = {
759
763
  shouldReceiveBuilderProps: {
760
764
  builderBlock: !1,
761
765
  builderContext: !0
@@ -799,7 +803,7 @@ const q = {
799
803
  helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
800
804
  advanced: !0
801
805
  }]
802
- }, Ge = y(() => import("./custom-code-7786788e.js")), Qe = {
806
+ }, Ge = y(() => import("./custom-code-1a43bbd7.js")), Qe = {
803
807
  name: "Embed",
804
808
  static: !0,
805
809
  inputs: [{
@@ -814,7 +818,7 @@ const q = {
814
818
  defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
815
819
  hideFromUI: !0
816
820
  }]
817
- }, Xe = y(() => import("./embed-5c1bbe12.js")), Ze = {
821
+ }, Xe = y(() => import("./embed-106f0066.js")), Ze = {
818
822
  name: "Form:Form",
819
823
  // editableTags: ['builder-form-error']
820
824
  defaults: {
@@ -1051,7 +1055,7 @@ const q = {
1051
1055
  builderComponents: !0,
1052
1056
  builderLinkComponent: !0
1053
1057
  }
1054
- }, et = y(() => import("./form-b8f74b68.js")), tt = {
1058
+ }, et = y(() => import("./form-e6ea2320.js")), tt = {
1055
1059
  name: "Form:Input",
1056
1060
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
1057
1061
  inputs: [
@@ -1102,7 +1106,7 @@ const q = {
1102
1106
  borderStyle: "solid",
1103
1107
  borderColor: "#ccc"
1104
1108
  }
1105
- }, nt = y(() => import("./input-768a5984.js")), at = {
1109
+ }, nt = y(() => import("./input-d6338de6.js")), at = {
1106
1110
  name: "Form:Select",
1107
1111
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
1108
1112
  defaultStyles: {
@@ -1144,7 +1148,7 @@ const q = {
1144
1148
  }],
1145
1149
  static: !0,
1146
1150
  noWrap: !0
1147
- }, it = y(() => import("./select-e54dc6bc.js")), ot = {
1151
+ }, it = y(() => import("./select-1538b41a.js")), ot = {
1148
1152
  name: "Form:SubmitButton",
1149
1153
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
1150
1154
  defaultStyles: {
@@ -1219,7 +1223,7 @@ const q = {
1219
1223
  }],
1220
1224
  noWrap: !0,
1221
1225
  static: !0
1222
- }, ut = y(() => import("./img-4becc0d4.js")), ct = {
1226
+ }, ut = y(() => import("./img-3efcbcca.js")), ct = {
1223
1227
  name: "Video",
1224
1228
  canHaveChildren: !0,
1225
1229
  defaultStyles: {
@@ -1346,8 +1350,8 @@ const q = {
1346
1350
  component: Ce,
1347
1351
  ..._e
1348
1352
  }, {
1349
- component: Ke,
1350
- ...je
1353
+ component: je,
1354
+ ...Ke
1351
1355
  }, {
1352
1356
  component: we,
1353
1357
  ...Oe
@@ -1362,8 +1366,8 @@ const q = {
1362
1366
  ...Me
1363
1367
  }, {
1364
1368
  component: Be,
1365
- ...Ae
1366
- }, ...mt()], pt = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
1369
+ ...We
1370
+ }, ...mt()], pt = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget, isAngularSDK) {
1367
1371
  function getAndSetVariantId() {
1368
1372
  function setCookie(name, value, days) {
1369
1373
  let expires = '';
@@ -1405,7 +1409,10 @@ const q = {
1405
1409
  return contentId;
1406
1410
  }
1407
1411
  const winningVariantId = getAndSetVariantId();
1408
- const styleEl = document.currentScript?.previousElementSibling;
1412
+ let styleEl = document.currentScript?.previousElementSibling;
1413
+ if (isAngularSDK) {
1414
+ styleEl = document.currentScript?.parentElement?.previousElementSibling?.querySelector('style');
1415
+ }
1409
1416
  if (isHydrationTarget) {
1410
1417
  styleEl.remove();
1411
1418
  const thisScriptEl = document.currentScript;
@@ -1419,7 +1426,7 @@ const q = {
1419
1426
  }).join('');
1420
1427
  styleEl.innerHTML = newStyleStr;
1421
1428
  }
1422
- }`, ft = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
1429
+ }`, gt = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
1423
1430
  if (!navigator.cookieEnabled) {
1424
1431
  return;
1425
1432
  }
@@ -1457,22 +1464,22 @@ const q = {
1457
1464
  ...t,
1458
1465
  testVariationId: t.id,
1459
1466
  id: e == null ? void 0 : e.id
1460
- })), gt = ({
1467
+ })), ft = ({
1461
1468
  canTrack: e,
1462
1469
  content: t
1463
- }) => !(!(H(t).length > 0) || !e || M()), ht = (e) => e === "react" || e === "reactNative", ue = ht(J), bt = () => `
1470
+ }) => !(!(H(t).length > 0) || !e || z()), ht = (e) => e === "react" || e === "reactNative", bt = N === "angular", ue = ht(N), yt = () => `
1464
1471
  window.${se} = ${pt}
1465
- window.${de} = ${ft}
1466
- `, yt = (e, t) => `
1472
+ window.${de} = ${gt}
1473
+ `, xt = (e, t) => `
1467
1474
  window.${se}(
1468
- "${t}",${JSON.stringify(e)}, ${ue}
1469
- )`, xt = ({
1475
+ "${t}",${JSON.stringify(e)}, ${ue}, ${bt}
1476
+ )`, vt = ({
1470
1477
  contentId: e,
1471
1478
  variationId: t
1472
1479
  }) => `window.${de}(
1473
1480
  "${t}", "${e}", ${ue}
1474
1481
  )`;
1475
- function z(e) {
1482
+ function J(e) {
1476
1483
  return /* @__PURE__ */ h(
1477
1484
  "script",
1478
1485
  {
@@ -1485,7 +1492,7 @@ function z(e) {
1485
1492
  function te(e) {
1486
1493
  return Math.round(e * 1e3) / 1e3;
1487
1494
  }
1488
- const vt = (e, t, n = !0) => {
1495
+ const St = (e, t, n = !0) => {
1489
1496
  if (!(e instanceof HTMLElement))
1490
1497
  return null;
1491
1498
  let i = n ? e : e.parentElement;
@@ -1496,7 +1503,7 @@ const vt = (e, t, n = !0) => {
1496
1503
  return i;
1497
1504
  } while (i = i.parentElement);
1498
1505
  return null;
1499
- }, St = (e) => vt(e, (t) => {
1506
+ }, Tt = (e) => St(e, (t) => {
1500
1507
  const n = t.getAttribute("builder-id") || t.id;
1501
1508
  return (n == null ? void 0 : n.indexOf("builder-")) === 0;
1502
1509
  }), ne = ({
@@ -1508,8 +1515,8 @@ const vt = (e, t, n = !0) => {
1508
1515
  x: u,
1509
1516
  y: a
1510
1517
  };
1511
- }, Tt = (e) => {
1512
- const t = e.target, n = t && St(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
1518
+ }, It = (e) => {
1519
+ const t = e.target, n = t && Tt(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
1513
1520
  return {
1514
1521
  targetBuilderElement: i || void 0,
1515
1522
  metadata: {
@@ -1524,7 +1531,7 @@ const vt = (e, t, n = !0) => {
1524
1531
  builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
1525
1532
  }
1526
1533
  };
1527
- }, It = ["svelte", "qwik", "vue"], ae = () => It.includes(J) && (W() || oe()), kt = (e) => {
1534
+ }, kt = ["svelte", "qwik", "vue"], ae = () => kt.includes(N) && (A() || oe()), Ct = (e) => {
1528
1535
  var u, a;
1529
1536
  const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (a = e.fileUrl) != null ? a : (u = e == null ? void 0 : e.files) == null ? void 0 : u.regular;
1530
1537
  let r = "";
@@ -1550,15 +1557,15 @@ font-weight: ${o};
1550
1557
  `.trim());
1551
1558
  }
1552
1559
  return r;
1553
- }, Ct = ({
1560
+ }, wt = ({
1554
1561
  customFonts: e
1555
1562
  }) => {
1556
1563
  var t;
1557
- return ((t = e == null ? void 0 : e.map((n) => kt(n))) == null ? void 0 : t.join(" ")) || "";
1558
- }, wt = ({
1564
+ return ((t = e == null ? void 0 : e.map((n) => Ct(n))) == null ? void 0 : t.join(" ")) || "";
1565
+ }, Vt = ({
1559
1566
  cssCode: e,
1560
1567
  contentId: t
1561
- }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", Vt = `
1568
+ }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", Rt = `
1562
1569
  .builder-button {
1563
1570
  all: unset;
1564
1571
  }
@@ -1575,10 +1582,10 @@ font-weight: ${o};
1575
1582
  text-align: inherit;
1576
1583
  font-family: inherit;
1577
1584
  }
1578
- `, Rt = (e) => e ? "" : Vt, Et = (e) => `variant-${e}`;
1579
- function Ft(e) {
1580
- var f, b, w;
1581
- const t = O(null);
1585
+ `, Et = (e) => e ? "" : Rt, Ft = (e) => `variant-${e}`;
1586
+ function Pt(e) {
1587
+ var g, b, w;
1588
+ const t = M(null);
1582
1589
  T(() => !1);
1583
1590
  function n(l) {
1584
1591
  var m, p;
@@ -1646,7 +1653,7 @@ function Ft(e) {
1646
1653
  }
1647
1654
  })(l);
1648
1655
  }
1649
- const [c, v] = T(() => ({})), [x, F] = T(() => ({})), [C, A] = T(() => !1);
1656
+ const [c, v] = T(() => ({})), [x, F] = T(() => ({})), [C, W] = T(() => !1);
1650
1657
  function B(l) {
1651
1658
  var s, m;
1652
1659
  if (e.builderContextSignal.content) {
@@ -1658,24 +1665,24 @@ function Ft(e) {
1658
1665
  contentId: d,
1659
1666
  apiKey: e.apiKey,
1660
1667
  variationId: p !== d ? p : void 0,
1661
- ...Tt(l),
1668
+ ...It(l),
1662
1669
  unique: !C
1663
1670
  });
1664
1671
  }
1665
- C || A(!0);
1672
+ C || W(!0);
1666
1673
  }
1667
1674
  function D() {
1668
1675
  var s, m, p;
1669
1676
  const l = (p = (m = (s = e.builderContextSignal.content) == null ? void 0 : s.data) == null ? void 0 : m.httpRequests) != null ? p : {};
1670
1677
  Object.entries(l).forEach(([d, V]) => {
1671
- if (!V || x[d] || c[d] && !W())
1678
+ if (!V || x[d] || c[d] && !A())
1672
1679
  return;
1673
1680
  x[d] = !0;
1674
1681
  const I = V.replace(
1675
1682
  /{{([^}]+)}}/g,
1676
- (S, g) => String(
1683
+ (S, f) => String(
1677
1684
  re({
1678
- code: g,
1685
+ code: f,
1679
1686
  context: e.context || {},
1680
1687
  localState: void 0,
1681
1688
  rootState: e.builderContextSignal.rootState,
@@ -1695,7 +1702,7 @@ function Ft(e) {
1695
1702
  });
1696
1703
  }
1697
1704
  function R() {
1698
- W() && window.dispatchEvent(
1705
+ A() && window.dispatchEvent(
1699
1706
  new CustomEvent(
1700
1707
  "builder:component:stateChange",
1701
1708
  {
@@ -1709,11 +1716,11 @@ function Ft(e) {
1709
1716
  )
1710
1717
  );
1711
1718
  }
1712
- const P = O(!1);
1719
+ const P = M(!1);
1713
1720
  return P.current || (D(), R(), P.current = !0), E(() => {
1714
1721
  var l, s, m, p, d;
1715
- if (M()) {
1716
- W() && !e.isNestedRender && (window.addEventListener("message", o), ce(), me({
1722
+ if (z()) {
1723
+ A() && !e.isNestedRender && (window.addEventListener("message", o), ce(), me({
1717
1724
  ...e.locale ? {
1718
1725
  locale: e.locale
1719
1726
  } : {},
@@ -1727,36 +1734,36 @@ function Ft(e) {
1727
1734
  apiKey: e.apiKey
1728
1735
  }), Object.values(
1729
1736
  e.builderContextSignal.componentInfos
1730
- ).forEach((g) => {
1737
+ ).forEach((f) => {
1731
1738
  var k, U;
1732
- if (!((k = g.models) != null && k.length) || g.models.includes(e.model)) {
1733
- const N = pe(g);
1734
- (U = window.parent) == null || U.postMessage(N, "*");
1739
+ if (!((k = f.models) != null && k.length) || f.models.includes(e.model)) {
1740
+ const q = pe(f);
1741
+ (U = window.parent) == null || U.postMessage(q, "*");
1735
1742
  }
1736
1743
  }), window.addEventListener(
1737
1744
  "builder:component:stateChangeListenerActivated",
1738
1745
  R
1739
1746
  ));
1740
- const V = e.builderContextSignal.content && L(e.canTrack), I = fe({
1747
+ const V = e.builderContextSignal.content && L(e.canTrack), I = ge({
1741
1748
  name: `builder.tests.${(s = e.builderContextSignal.content) == null ? void 0 : s.id}`,
1742
1749
  canTrack: !0
1743
1750
  }), S = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId;
1744
1751
  if (V && S === I) {
1745
- const g = (p = e.builderContextSignal.content) == null ? void 0 : p.id, k = e.apiKey;
1752
+ const f = (p = e.builderContextSignal.content) == null ? void 0 : p.id, k = e.apiKey;
1746
1753
  X({
1747
1754
  apiHost: e.apiHost,
1748
1755
  type: "impression",
1749
1756
  canTrack: !0,
1750
- contentId: g,
1757
+ contentId: f,
1751
1758
  apiKey: k,
1752
- variationId: I !== g ? I : void 0
1759
+ variationId: I !== f ? I : void 0
1753
1760
  });
1754
1761
  }
1755
- if (oe() && !W()) {
1756
- const g = new URL(location.href).searchParams, k = g.get("builder.preview"), U = g.get(
1762
+ if (oe() && !A()) {
1763
+ const f = new URL(location.href).searchParams, k = f.get("builder.preview"), U = f.get(
1757
1764
  `builder.overrides.${k}`
1758
- ), N = g.get("apiKey") || g.get("builder.space");
1759
- (k === "BUILDER_STUDIO" || k === e.model && N === e.apiKey && (!e.content || U === e.content.id)) && ge({
1765
+ ), q = f.get("apiKey") || f.get("builder.space");
1766
+ (k === "BUILDER_STUDIO" || k === e.model && q === e.apiKey && (!e.content || U === e.content.id)) && fe({
1760
1767
  model: e.model,
1761
1768
  apiKey: e.apiKey,
1762
1769
  apiVersion: e.builderContextSignal.apiVersion,
@@ -1781,7 +1788,7 @@ function Ft(e) {
1781
1788
  locale: e.locale
1782
1789
  });
1783
1790
  }, [e.locale]), E(() => () => {
1784
- M() && (window.removeEventListener("message", o), window.removeEventListener(
1791
+ z() && (window.removeEventListener("message", o), window.removeEventListener(
1785
1792
  "builder:component:stateChangeListenerActivated",
1786
1793
  R
1787
1794
  ));
@@ -1790,9 +1797,9 @@ function Ft(e) {
1790
1797
  {
1791
1798
  ref: t,
1792
1799
  onClick: (l) => B(l),
1793
- "builder-content-id": (f = e.builderContextSignal.content) == null ? void 0 : f.id,
1800
+ "builder-content-id": (g = e.builderContextSignal.content) == null ? void 0 : g.id,
1794
1801
  "builder-model": e.model,
1795
- className: Et(
1802
+ className: Ft(
1796
1803
  ((b = e.content) == null ? void 0 : b.testVariationId) || ((w = e.content) == null ? void 0 : w.id)
1797
1804
  ),
1798
1805
  style: {
@@ -1804,17 +1811,17 @@ function Ft(e) {
1804
1811
  }
1805
1812
  ) : null });
1806
1813
  }
1807
- function Pt(e) {
1814
+ function At(e) {
1808
1815
  const [t, n] = T(
1809
1816
  () => `
1810
- ${wt({
1817
+ ${Vt({
1811
1818
  cssCode: e.cssCode,
1812
1819
  contentId: e.contentId
1813
1820
  })}
1814
- ${Ct({
1821
+ ${wt({
1815
1822
  customFonts: e.customFonts
1816
1823
  })}
1817
- ${Rt(e.isNestedRender)}
1824
+ ${Et(e.isNestedRender)}
1818
1825
  `.trim()
1819
1826
  );
1820
1827
  return /* @__PURE__ */ h(
@@ -1843,7 +1850,7 @@ const Wt = ({
1843
1850
  locale: n
1844
1851
  } : {}
1845
1852
  };
1846
- }, At = ({
1853
+ }, Bt = ({
1847
1854
  content: e,
1848
1855
  data: t
1849
1856
  }) => e ? {
@@ -1855,22 +1862,22 @@ const Wt = ({
1855
1862
  meta: e == null ? void 0 : e.meta
1856
1863
  } : void 0;
1857
1864
  function ie(e) {
1858
- var v, x, F, C, A, B, D, R, P;
1865
+ var v, x, F, C, W, B, D, R, P;
1859
1866
  const [t, n] = T(
1860
1867
  () => {
1861
- var f, b;
1862
- return xt({
1868
+ var g, b;
1869
+ return vt({
1863
1870
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
1864
- variationId: (f = e.content) == null ? void 0 : f.testVariationId,
1871
+ variationId: (g = e.content) == null ? void 0 : g.testVariationId,
1865
1872
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
1866
1873
  contentId: (b = e.content) == null ? void 0 : b.id
1867
1874
  });
1868
1875
  }
1869
1876
  );
1870
- function i(f) {
1877
+ function i(g) {
1871
1878
  o((b) => ({
1872
1879
  ...b,
1873
- rootState: f
1880
+ rootState: g
1874
1881
  }));
1875
1882
  }
1876
1883
  const [r, u] = T(
@@ -1878,8 +1885,8 @@ function ie(e) {
1878
1885
  ...ee(),
1879
1886
  ...e.customComponents || []
1880
1887
  ].reduce(
1881
- (f, { component: b, ...w }) => ({
1882
- ...f,
1888
+ (g, { component: b, ...w }) => ({
1889
+ ...g,
1883
1890
  [w.name]: {
1884
1891
  component: b,
1885
1892
  ...Z(w)
@@ -1888,7 +1895,7 @@ function ie(e) {
1888
1895
  {}
1889
1896
  )
1890
1897
  ), [a, o] = T(() => ({
1891
- content: At({
1898
+ content: Bt({
1892
1899
  content: e.content,
1893
1900
  data: e.data
1894
1901
  }),
@@ -1907,8 +1914,8 @@ function ie(e) {
1907
1914
  ...ee(),
1908
1915
  ...e.customComponents || []
1909
1916
  ].reduce(
1910
- (f, { component: b, ...w }) => ({
1911
- ...f,
1917
+ (g, { component: b, ...w }) => ({
1918
+ ...g,
1912
1919
  [w.name]: Z(w)
1913
1920
  }),
1914
1921
  {}
@@ -1918,14 +1925,14 @@ function ie(e) {
1918
1925
  BlocksWrapperProps: e.blocksWrapperProps || {},
1919
1926
  nonce: e.nonce || "",
1920
1927
  model: e.model
1921
- })), c = O(!1);
1928
+ })), c = M(!1);
1922
1929
  if (!c.current) {
1923
1930
  e.apiKey || ye.error(
1924
1931
  "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
1925
1932
  );
1926
- const f = (x = (v = a.content) == null ? void 0 : v.data) == null ? void 0 : x.jsCode;
1927
- f && re({
1928
- code: f,
1933
+ const g = (x = (v = a.content) == null ? void 0 : v.data) == null ? void 0 : x.jsCode;
1934
+ g && re({
1935
+ code: g,
1929
1936
  context: e.context || {},
1930
1937
  localState: void 0,
1931
1938
  rootState: a.rootState,
@@ -1941,8 +1948,8 @@ function ie(e) {
1941
1948
  value: {
1942
1949
  registeredComponents: r
1943
1950
  },
1944
- children: /* @__PURE__ */ K(
1945
- Ft,
1951
+ children: /* @__PURE__ */ O(
1952
+ Pt,
1946
1953
  {
1947
1954
  apiHost: e.apiHost,
1948
1955
  nonce: e.nonce,
@@ -1963,7 +1970,7 @@ function ie(e) {
1963
1970
  setBuilderContextSignal: o,
1964
1971
  children: [
1965
1972
  e.isSsrAbTest ? /* @__PURE__ */ h(
1966
- z,
1973
+ J,
1967
1974
  {
1968
1975
  id: "builderio-variant-visibility",
1969
1976
  scriptStr: t,
@@ -1971,17 +1978,17 @@ function ie(e) {
1971
1978
  }
1972
1979
  ) : null,
1973
1980
  /* @__PURE__ */ h(
1974
- Pt,
1981
+ At,
1975
1982
  {
1976
1983
  nonce: e.nonce || "",
1977
1984
  isNestedRender: e.isNestedRender,
1978
1985
  contentId: (F = a.content) == null ? void 0 : F.id,
1979
- cssCode: (A = (C = a.content) == null ? void 0 : C.data) == null ? void 0 : A.cssCode,
1986
+ cssCode: (W = (C = a.content) == null ? void 0 : C.data) == null ? void 0 : W.cssCode,
1980
1987
  customFonts: (D = (B = a.content) == null ? void 0 : B.data) == null ? void 0 : D.customFonts
1981
1988
  }
1982
1989
  ),
1983
1990
  /* @__PURE__ */ h(
1984
- We,
1991
+ Ae,
1985
1992
  {
1986
1993
  blocks: (P = (R = a.content) == null ? void 0 : R.data) == null ? void 0 : P.blocks,
1987
1994
  context: a,
@@ -1995,17 +2002,17 @@ function ie(e) {
1995
2002
  }
1996
2003
  );
1997
2004
  }
1998
- function Bt(e) {
2005
+ function Dt(e) {
1999
2006
  var a;
2000
2007
  const [t, n] = T(
2001
- () => gt({
2008
+ () => ft({
2002
2009
  canTrack: L(e.canTrack),
2003
2010
  content: e.content
2004
2011
  })
2005
2012
  );
2006
2013
  function i() {
2007
2014
  var o;
2008
- return yt(
2015
+ return xt(
2009
2016
  H(e.content).map((c) => ({
2010
2017
  id: c.testVariationId,
2011
2018
  testRatio: c.testRatio
@@ -2027,16 +2034,16 @@ function Bt(e) {
2027
2034
  });
2028
2035
  }
2029
2036
  return E(() => {
2030
- }, []), /* @__PURE__ */ K(Q, { children: [
2031
- !e.isNestedRender && J !== "reactNative" ? /* @__PURE__ */ h(
2032
- z,
2037
+ }, []), /* @__PURE__ */ O(Q, { children: [
2038
+ !e.isNestedRender && N !== "reactNative" ? /* @__PURE__ */ h(
2039
+ J,
2033
2040
  {
2034
2041
  id: "builderio-init-variants-fns",
2035
- scriptStr: bt(),
2042
+ scriptStr: yt(),
2036
2043
  nonce: e.nonce || ""
2037
2044
  }
2038
2045
  ) : null,
2039
- t ? /* @__PURE__ */ K(Q, { children: [
2046
+ t ? /* @__PURE__ */ O(Q, { children: [
2040
2047
  /* @__PURE__ */ h(
2041
2048
  le,
2042
2049
  {
@@ -2046,7 +2053,7 @@ function Bt(e) {
2046
2053
  }
2047
2054
  ),
2048
2055
  /* @__PURE__ */ h(
2049
- z,
2056
+ J,
2050
2057
  {
2051
2058
  id: "builderio-variants-visibility",
2052
2059
  scriptStr: i(),
@@ -2109,11 +2116,11 @@ function Bt(e) {
2109
2116
  )
2110
2117
  ] });
2111
2118
  }
2112
- const qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2119
+ const $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2113
2120
  __proto__: null,
2114
- default: Bt
2121
+ default: Dt
2115
2122
  }, Symbol.toStringTag, { value: "Module" }));
2116
2123
  export {
2117
- z as InlinedScript,
2118
- qt as contentVariants
2124
+ J as InlinedScript,
2125
+ $t as contentVariants
2119
2126
  };