@builder.io/sdk-react 2.0.19 → 2.0.22

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 (68) hide show
  1. package/lib/browser/blocks-exports.cjs +31 -31
  2. package/lib/browser/blocks-exports.mjs +833 -833
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +1 -1
  5. package/lib/browser/{server-entry-c8020f19.cjs → server-entry-5770bca9.cjs} +2 -2
  6. package/lib/browser/{server-entry-12189812.js → server-entry-b83ba684.js} +1 -2
  7. package/lib/browser/server-entry.cjs +1 -1
  8. package/lib/browser/server-entry.mjs +1 -1
  9. package/lib/edge/{accordion-634b0466.js → accordion-78c3d81b.js} +1 -1
  10. package/lib/edge/{accordion-eaf2e50a.cjs → accordion-80133dd8.cjs} +1 -1
  11. package/lib/edge/blocks-5084bbec.cjs +12 -0
  12. package/lib/edge/{blocks-51761337.js → blocks-852d317b.js} +240 -233
  13. package/lib/edge/blocks-exports.cjs +1 -1
  14. package/lib/edge/blocks-exports.mjs +2 -2
  15. package/lib/edge/{button-6d2144c3.js → button-0a729557.js} +2 -2
  16. package/lib/edge/{button-a0aad19e.cjs → button-a97c0d05.cjs} +1 -1
  17. package/lib/edge/{columns-030a6892.js → columns-1149d23a.js} +6 -6
  18. package/lib/edge/{columns-44d76a14.cjs → columns-2bd50130.cjs} +4 -4
  19. package/lib/edge/{content-variants-46a433c2.js → content-variants-86962b96.js} +306 -308
  20. package/lib/edge/content-variants-cbd84920.cjs +134 -0
  21. package/lib/edge/{evaluate-6febb3ef.js → evaluate-46f56681.js} +671 -659
  22. package/lib/edge/{evaluate-29260bf8.cjs → evaluate-617e3bee.cjs} +11 -13
  23. package/lib/edge/{form-855a28fc.js → form-1811c08f.js} +6 -6
  24. package/lib/edge/form-c42561fb.cjs +1 -0
  25. package/lib/edge/{get-class-prop-name-a6353748.js → get-class-prop-name-6e4205e7.js} +1 -1
  26. package/lib/edge/{get-class-prop-name-6320e936.cjs → get-class-prop-name-dc89023a.cjs} +1 -1
  27. package/lib/edge/{image-eebfcbac.cjs → image-54d2f755.cjs} +3 -3
  28. package/lib/edge/{image-6a074aab.js → image-6970c193.js} +24 -24
  29. package/lib/edge/{img-56b4a196.js → img-0bc990ef.js} +1 -1
  30. package/lib/edge/{img-1f88586f.cjs → img-70b9d719.cjs} +1 -1
  31. package/lib/edge/index.cjs +1 -1
  32. package/lib/edge/index.mjs +1 -1
  33. package/lib/edge/{input-35f6fbdd.cjs → input-21071030.cjs} +1 -1
  34. package/lib/edge/{input-7873f170.js → input-3689c63d.js} +1 -1
  35. package/lib/edge/{select-eb16d7cc.js → select-65ebd3fd.js} +1 -1
  36. package/lib/edge/{select-f03c5ba6.cjs → select-cb7c2f44.cjs} +1 -1
  37. package/lib/edge/{server-entry-dbe27fb2.cjs → server-entry-8ce6f347.cjs} +2 -2
  38. package/lib/edge/{server-entry-77a5a1a0.js → server-entry-9d83b8e5.js} +1 -2
  39. package/lib/edge/server-entry.cjs +1 -1
  40. package/lib/edge/server-entry.mjs +1 -1
  41. package/lib/edge/{slot-93865012.cjs → slot-21cc91d8.cjs} +1 -1
  42. package/lib/edge/{slot-c9a7a451.js → slot-e5f3b92d.js} +4 -4
  43. package/lib/edge/{symbol-b6b36212.cjs → symbol-0cc07e41.cjs} +1 -1
  44. package/lib/edge/{symbol-6657c638.js → symbol-56e5b927.js} +2 -2
  45. package/lib/edge/{tabs-44484f49.js → tabs-0e6f6b5b.js} +4 -4
  46. package/lib/edge/{tabs-020fedaa.cjs → tabs-9390d611.cjs} +1 -1
  47. package/lib/edge/{text-e00e3cdc.js → text-b68c0d5a.js} +2 -2
  48. package/lib/edge/{text-562c8568.cjs → text-baaedac7.cjs} +1 -1
  49. package/lib/node/blocks-exports.cjs +31 -31
  50. package/lib/node/blocks-exports.mjs +817 -844
  51. package/lib/node/index.cjs +1 -1
  52. package/lib/node/index.mjs +2 -2
  53. package/lib/node/init.cjs +1 -1
  54. package/lib/node/init.mjs +2 -2
  55. package/lib/node/{server-entry-82ab17f2.cjs → server-entry-52b8f10a.cjs} +2 -2
  56. package/lib/node/{server-entry-902ea0c4.js → server-entry-5b32494d.js} +1 -2
  57. package/lib/node/server-entry.cjs +1 -1
  58. package/lib/node/server-entry.mjs +1 -1
  59. package/lib/node/{should-force-browser-runtime-in-node-f20178fa.cjs → should-force-browser-runtime-in-node-253f1726.cjs} +4 -4
  60. package/lib/node/{should-force-browser-runtime-in-node-0b0cefdf.js → should-force-browser-runtime-in-node-68bc74aa.js} +56 -29
  61. package/package.json +1 -1
  62. package/types/constants/sdk-version.d.ts +1 -1
  63. package/types/functions/evaluate/browser-runtime/browser.d.ts +0 -6
  64. package/types/functions/evaluate/helpers.d.ts +5 -0
  65. package/types/types/input.d.ts +1 -1
  66. package/lib/edge/blocks-b8c9a72a.cjs +0 -12
  67. package/lib/edge/content-variants-3eef022e.cjs +0 -134
  68. package/lib/edge/form-59059e97.cjs +0 -1
@@ -1,12 +1,12 @@
1
- import { jsx as h, jsxs as H, Fragment as z } from "react/jsx-runtime";
2
- import { lazy as v, useRef as le, useState as k, useEffect as S } from "react";
3
- import { isBrowser as $, TARGET as te, isEditing as P, registerInsertMenu as se, setupBrowserForEditing as de, createRegisterComponentMessage as ue, getDefaultCanTrack as A, _track as J, isPreviewing as ce, fetchOneEntry as me, logger as pe, createEditorListener as ge, fetch as fe, serializeIncludingFunctions as Y, handleABTestingSync as he } from "./server-entry-77a5a1a0.js";
4
- import { Video as be, Button as xe, Columns as ye, Fragment as ve, Image as Se, Section as Te, Symbol as ke, Text as Ce, BuilderContext as Ie } from "./blocks-exports.mjs";
5
- import { triggerAnimation as we, fastClone as Ve, InlinedStyles as ne, ComponentsContext as Re, Blocks as Ee } from "./blocks-51761337.js";
6
- import { evaluate as Q } from "./evaluate-6febb3ef.js";
7
- import "./get-class-prop-name-a6353748.js";
1
+ import { jsx as b, jsxs as N, Fragment as M } from "react/jsx-runtime";
2
+ import { lazy as v, useRef as q, useState as T, useEffect as C } from "react";
3
+ import { isBrowser as j, TARGET as G, isEditing as A, registerInsertMenu as ie, setupBrowserForEditing as oe, createRegisterComponentMessage as re, getDefaultCanTrack as D, _track as O, isPreviewing as le, fetchOneEntry as se, createEditorListener as de, serializeIncludingFunctions as _, logger as ue, handleABTestingSync as ce } from "./server-entry-9d83b8e5.js";
4
+ import { Video as me, Button as pe, Columns as ge, Fragment as fe, Image as he, Section as be, Symbol as ye, Text as xe, BuilderContext as ve } from "./blocks-exports.mjs";
5
+ import { triggerAnimation as Se, fastClone as Te, InlinedStyles as X, ComponentsContext as ke, Blocks as Ie } from "./blocks-852d317b.js";
6
+ import { evaluate as Z } from "./evaluate-46f56681.js";
7
+ import "./get-class-prop-name-6e4205e7.js";
8
8
  import "./dynamic-renderer-8b343325.js";
9
- const B = {
9
+ const U = {
10
10
  "@type": "@builder.io/sdk:Element",
11
11
  layerName: "Accordion item title",
12
12
  responsiveStyles: {
@@ -35,7 +35,7 @@ const B = {
35
35
  }
36
36
  }
37
37
  }]
38
- }, D = {
38
+ }, L = {
39
39
  "@type": "@builder.io/sdk:Element",
40
40
  layerName: "Accordion item detail",
41
41
  responsiveStyles: {
@@ -66,7 +66,7 @@ const B = {
66
66
  }
67
67
  }
68
68
  }]
69
- }, Fe = {
69
+ }, Ce = {
70
70
  name: "Builder:Accordion",
71
71
  canHaveChildren: !0,
72
72
  image: "https://cdn.builder.io/api/v1/image/assets%2FagZ9n5CUKRfbL9t6CaJOyVSK4Es2%2Ffab6c1fd3fe542408cbdec078bca7f35",
@@ -83,19 +83,19 @@ const B = {
83
83
  name: "title",
84
84
  type: "uiBlocks",
85
85
  hideFromUI: !0,
86
- defaultValue: [B]
86
+ defaultValue: [U]
87
87
  }, {
88
88
  name: "detail",
89
89
  type: "uiBlocks",
90
90
  hideFromUI: !0,
91
- defaultValue: [D]
91
+ defaultValue: [L]
92
92
  }],
93
93
  defaultValue: [{
94
- title: [B],
95
- detail: [D]
94
+ title: [U],
95
+ detail: [L]
96
96
  }, {
97
- title: [B],
98
- detail: [D]
97
+ title: [U],
98
+ detail: [L]
99
99
  }],
100
100
  showIf: (e) => !e.get("useChildrenForItems")
101
101
  }, {
@@ -130,7 +130,7 @@ const B = {
130
130
  builderComponents: !0,
131
131
  builderLinkComponent: !0
132
132
  }
133
- }, Pe = v(() => import("./accordion-634b0466.js")), We = {
133
+ }, we = v(() => import("./accordion-78c3d81b.js")), Ve = {
134
134
  name: "Core:Button",
135
135
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
136
136
  defaultStyles: {
@@ -166,7 +166,7 @@ const B = {
166
166
  shouldReceiveBuilderProps: {
167
167
  builderLinkComponent: !0
168
168
  }
169
- }, Ae = {
169
+ }, Re = {
170
170
  // TODO: ways to statically preprocess JSON for references, functions, etc
171
171
  name: "Columns",
172
172
  isRSC: !0,
@@ -373,13 +373,13 @@ const B = {
373
373
  builderComponents: !0,
374
374
  builderLinkComponent: !0
375
375
  }
376
- }, Be = {
376
+ }, Ee = {
377
377
  name: "Fragment",
378
378
  static: !0,
379
379
  hidden: !0,
380
380
  canHaveChildren: !0,
381
381
  noWrap: !0
382
- }, De = {
382
+ }, Fe = {
383
383
  name: "Image",
384
384
  static: !0,
385
385
  image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
@@ -400,15 +400,15 @@ const B = {
400
400
  onChange: (e) => {
401
401
  e.delete("srcset"), e.delete("noWebp");
402
402
  function n(a, o = 6e4) {
403
- return new Promise((p, b) => {
404
- const C = document.createElement("img");
405
- let T = !1;
406
- C.onload = () => {
407
- T = !0, p(C);
408
- }, C.addEventListener("error", (V) => {
409
- console.warn("Image load failed", V.error), b(V.error);
410
- }), C.src = a, setTimeout(() => {
411
- T || b(new Error("Image load timed out"));
403
+ return new Promise((p, S) => {
404
+ const y = document.createElement("img");
405
+ let w = !1;
406
+ y.onload = () => {
407
+ w = !0, p(y);
408
+ }, y.addEventListener("error", (k) => {
409
+ console.warn("Image load failed", k.error), S(k.error);
410
+ }), y.src = a, setTimeout(() => {
411
+ w || S(new Error("Image load timed out"));
412
412
  }, o);
413
413
  });
414
414
  }
@@ -487,7 +487,7 @@ const B = {
487
487
  shouldReceiveBuilderProps: {
488
488
  builderBlock: !0
489
489
  }
490
- }, Ue = {
490
+ }, Pe = {
491
491
  name: "Core:Section",
492
492
  static: !0,
493
493
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -526,7 +526,7 @@ const B = {
526
526
  }
527
527
  }
528
528
  }]
529
- }, Le = {
529
+ }, We = {
530
530
  name: "Slot",
531
531
  isRSC: !0,
532
532
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -543,7 +543,7 @@ const B = {
543
543
  builderContext: !0,
544
544
  builderComponents: !0
545
545
  }
546
- }, He = v(() => import("./slot-c9a7a451.js")), $e = {
546
+ }, Ae = v(() => import("./slot-e5f3b92d.js")), Be = {
547
547
  name: "Symbol",
548
548
  noWrap: !0,
549
549
  static: !0,
@@ -582,7 +582,7 @@ const B = {
582
582
  builderComponents: !0,
583
583
  builderLinkComponent: !0
584
584
  }
585
- }, U = {
585
+ }, H = {
586
586
  "@type": "@builder.io/sdk:Element",
587
587
  responsiveStyles: {
588
588
  large: {
@@ -604,7 +604,7 @@ const B = {
604
604
  text: "New tab"
605
605
  }
606
606
  }
607
- }, L = {
607
+ }, $ = {
608
608
  "@type": "@builder.io/sdk:Element",
609
609
  responsiveStyles: {
610
610
  large: {
@@ -620,7 +620,7 @@ const B = {
620
620
  text: "New tab content "
621
621
  }
622
622
  }
623
- }, Ne = {
623
+ }, De = {
624
624
  name: "Builder: Tabs",
625
625
  inputs: [{
626
626
  name: "tabs",
@@ -630,16 +630,16 @@ const B = {
630
630
  name: "label",
631
631
  type: "uiBlocks",
632
632
  hideFromUI: !0,
633
- defaultValue: [U]
633
+ defaultValue: [H]
634
634
  }, {
635
635
  name: "content",
636
636
  type: "uiBlocks",
637
637
  hideFromUI: !0,
638
- defaultValue: [L]
638
+ defaultValue: [$]
639
639
  }],
640
640
  defaultValue: [{
641
641
  label: [{
642
- ...U,
642
+ ...H,
643
643
  component: {
644
644
  name: "Text",
645
645
  options: {
@@ -648,7 +648,7 @@ const B = {
648
648
  }
649
649
  }],
650
650
  content: [{
651
- ...L,
651
+ ...$,
652
652
  component: {
653
653
  name: "Text",
654
654
  options: {
@@ -658,7 +658,7 @@ const B = {
658
658
  }]
659
659
  }, {
660
660
  label: [{
661
- ...U,
661
+ ...H,
662
662
  component: {
663
663
  name: "Text",
664
664
  options: {
@@ -667,7 +667,7 @@ const B = {
667
667
  }
668
668
  }],
669
669
  content: [{
670
- ...L,
670
+ ...$,
671
671
  component: {
672
672
  name: "Text",
673
673
  options: {
@@ -723,7 +723,7 @@ const B = {
723
723
  builderComponents: !0,
724
724
  builderLinkComponent: !0
725
725
  }
726
- }, qe = v(() => import("./tabs-44484f49.js")), je = {
726
+ }, Ue = v(() => import("./tabs-0e6f6b5b.js")), Le = {
727
727
  shouldReceiveBuilderProps: {
728
728
  builderBlock: !1,
729
729
  builderContext: !0
@@ -745,7 +745,7 @@ const B = {
745
745
  height: "auto",
746
746
  textAlign: "center"
747
747
  }
748
- }, Ke = {
748
+ }, He = {
749
749
  name: "Custom Code",
750
750
  static: !0,
751
751
  requiredPermissions: ["editCode"],
@@ -767,7 +767,7 @@ const B = {
767
767
  helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
768
768
  advanced: !0
769
769
  }]
770
- }, Me = v(() => import("./custom-code-7786788e.js")), Oe = {
770
+ }, $e = v(() => import("./custom-code-7786788e.js")), Ne = {
771
771
  name: "Embed",
772
772
  static: !0,
773
773
  inputs: [{
@@ -782,7 +782,7 @@ const B = {
782
782
  defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
783
783
  hideFromUI: !0
784
784
  }]
785
- }, _e = v(() => import("./embed-5c1bbe12.js")), ze = {
785
+ }, qe = v(() => import("./embed-5c1bbe12.js")), je = {
786
786
  name: "Form:Form",
787
787
  // editableTags: ['builder-form-error']
788
788
  defaults: {
@@ -1019,7 +1019,7 @@ const B = {
1019
1019
  builderComponents: !0,
1020
1020
  builderLinkComponent: !0
1021
1021
  }
1022
- }, Je = v(() => import("./form-855a28fc.js")), Ye = {
1022
+ }, Ke = v(() => import("./form-1811c08f.js")), Me = {
1023
1023
  name: "Form:Input",
1024
1024
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
1025
1025
  inputs: [
@@ -1070,7 +1070,7 @@ const B = {
1070
1070
  borderStyle: "solid",
1071
1071
  borderColor: "#ccc"
1072
1072
  }
1073
- }, Qe = v(() => import("./input-7873f170.js")), Ge = {
1073
+ }, Oe = v(() => import("./input-3689c63d.js")), _e = {
1074
1074
  name: "Form:Select",
1075
1075
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
1076
1076
  defaultStyles: {
@@ -1112,7 +1112,7 @@ const B = {
1112
1112
  }],
1113
1113
  static: !0,
1114
1114
  noWrap: !0
1115
- }, Xe = v(() => import("./select-eb16d7cc.js")), Ze = {
1115
+ }, ze = v(() => import("./select-65ebd3fd.js")), Je = {
1116
1116
  name: "Form:SubmitButton",
1117
1117
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
1118
1118
  defaultStyles: {
@@ -1137,7 +1137,7 @@ const B = {
1137
1137
  // that only shows if advanced setting is flipped
1138
1138
  // TODO: defaultChildren
1139
1139
  // canHaveChildren: true,
1140
- }, et = v(() => import("./submit-button-b48361a7.js")), tt = {
1140
+ }, Ye = v(() => import("./submit-button-b48361a7.js")), Qe = {
1141
1141
  name: "Form:TextArea",
1142
1142
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
1143
1143
  inputs: [{
@@ -1173,7 +1173,7 @@ const B = {
1173
1173
  },
1174
1174
  static: !0,
1175
1175
  noWrap: !0
1176
- }, nt = v(() => import("./textarea-d29025e9.js")), at = {
1176
+ }, Ge = v(() => import("./textarea-d29025e9.js")), Xe = {
1177
1177
  // friendlyName?
1178
1178
  name: "Raw:Img",
1179
1179
  hideFromInsertMenu: !0,
@@ -1187,7 +1187,7 @@ const B = {
1187
1187
  }],
1188
1188
  noWrap: !0,
1189
1189
  static: !0
1190
- }, it = v(() => import("./img-56b4a196.js")), ot = {
1190
+ }, Ze = v(() => import("./img-0bc990ef.js")), et = {
1191
1191
  name: "Video",
1192
1192
  canHaveChildren: !0,
1193
1193
  defaultStyles: {
@@ -1271,64 +1271,64 @@ const B = {
1271
1271
  shouldReceiveBuilderProps: {
1272
1272
  builderBlock: !0
1273
1273
  }
1274
- }, rt = () => [{
1275
- component: Me,
1276
- ...Ke
1274
+ }, tt = () => [{
1275
+ component: $e,
1276
+ ...He
1277
1277
  }, {
1278
- component: _e,
1279
- ...Oe
1278
+ component: qe,
1279
+ ...Ne
1280
1280
  }, {
1281
- component: Je,
1282
- ...ze
1281
+ component: Ke,
1282
+ ...je
1283
1283
  }, {
1284
- component: Qe,
1285
- ...Ye
1284
+ component: Oe,
1285
+ ...Me
1286
1286
  }, {
1287
- component: et,
1288
- ...Ze
1287
+ component: Ye,
1288
+ ...Je
1289
1289
  }, {
1290
- component: Xe,
1291
- ...Ge
1290
+ component: ze,
1291
+ ..._e
1292
1292
  }, {
1293
- component: nt,
1294
- ...tt
1293
+ component: Ge,
1294
+ ...Qe
1295
1295
  }, {
1296
- component: it,
1297
- ...at
1296
+ component: Ze,
1297
+ ...Xe
1298
1298
  }, {
1299
- component: be,
1300
- ...ot
1301
- }], G = () => [{
1302
- component: xe,
1303
- ...We
1299
+ component: me,
1300
+ ...et
1301
+ }], z = () => [{
1302
+ component: pe,
1303
+ ...Ve
1304
1304
  }, {
1305
- component: ye,
1306
- ...Ae
1305
+ component: ge,
1306
+ ...Re
1307
1307
  }, {
1308
- component: ve,
1309
- ...Be
1308
+ component: fe,
1309
+ ...Ee
1310
1310
  }, {
1311
- component: Se,
1312
- ...De
1311
+ component: he,
1312
+ ...Fe
1313
1313
  }, {
1314
- component: Te,
1315
- ...Ue
1314
+ component: be,
1315
+ ...Pe
1316
1316
  }, {
1317
- component: He,
1318
- ...Le
1317
+ component: Ae,
1318
+ ...We
1319
1319
  }, {
1320
- component: ke,
1321
- ...$e
1320
+ component: ye,
1321
+ ...Be
1322
1322
  }, {
1323
- component: Ce,
1324
- ...je
1323
+ component: xe,
1324
+ ...Le
1325
1325
  }, {
1326
- component: qe,
1327
- ...Ne
1326
+ component: Ue,
1327
+ ...De
1328
1328
  }, {
1329
- component: Pe,
1330
- ...Fe
1331
- }, ...rt()], lt = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
1329
+ component: we,
1330
+ ...Ce
1331
+ }, ...tt()], nt = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
1332
1332
  function getAndSetVariantId() {
1333
1333
  function setCookie(name, value, days) {
1334
1334
  let expires = '';
@@ -1384,7 +1384,7 @@ const B = {
1384
1384
  }).join('');
1385
1385
  styleEl.innerHTML = newStyleStr;
1386
1386
  }
1387
- }`, st = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
1387
+ }`, at = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
1388
1388
  if (!navigator.cookieEnabled) {
1389
1389
  return;
1390
1390
  }
@@ -1418,27 +1418,27 @@ const B = {
1418
1418
  thisScriptEl?.remove();
1419
1419
  }
1420
1420
  return;
1421
- }`, ae = "builderIoAbTest", ie = "builderIoRenderContent", W = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
1421
+ }`, ee = "builderIoAbTest", te = "builderIoRenderContent", B = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
1422
1422
  ...t,
1423
1423
  testVariationId: t.id,
1424
1424
  id: e == null ? void 0 : e.id
1425
- })), dt = ({
1425
+ })), it = ({
1426
1426
  canTrack: e,
1427
1427
  content: t
1428
- }) => !(!(W(t).length > 0) || !e || $()), ut = (e) => e === "react" || e === "reactNative", oe = ut(te), ct = () => `
1429
- window.${ae} = ${lt}
1430
- window.${ie} = ${st}
1431
- `, mt = (e, t) => `
1432
- window.${ae}(
1433
- "${t}",${JSON.stringify(e)}, ${oe}
1434
- )`, pt = ({
1428
+ }) => !(!(B(t).length > 0) || !e || j()), ot = (e) => e === "react" || e === "reactNative", ne = ot(G), rt = () => `
1429
+ window.${ee} = ${nt}
1430
+ window.${te} = ${at}
1431
+ `, lt = (e, t) => `
1432
+ window.${ee}(
1433
+ "${t}",${JSON.stringify(e)}, ${ne}
1434
+ )`, st = ({
1435
1435
  contentId: e,
1436
1436
  variationId: t
1437
- }) => `window.${ie}(
1438
- "${t}", "${e}", ${oe}
1437
+ }) => `window.${te}(
1438
+ "${t}", "${e}", ${ne}
1439
1439
  )`;
1440
- function N(e) {
1441
- return /* @__PURE__ */ h(
1440
+ function K(e) {
1441
+ return /* @__PURE__ */ b(
1442
1442
  "script",
1443
1443
  {
1444
1444
  dangerouslySetInnerHTML: { __html: e.scriptStr },
@@ -1447,10 +1447,10 @@ function N(e) {
1447
1447
  }
1448
1448
  );
1449
1449
  }
1450
- function X(e) {
1450
+ function J(e) {
1451
1451
  return Math.round(e * 1e3) / 1e3;
1452
1452
  }
1453
- const gt = (e, t, n = !0) => {
1453
+ const dt = (e, t, n = !0) => {
1454
1454
  if (!(e instanceof HTMLElement))
1455
1455
  return null;
1456
1456
  let i = n ? e : e.parentElement;
@@ -1461,35 +1461,35 @@ const gt = (e, t, n = !0) => {
1461
1461
  return i;
1462
1462
  } while (i = i.parentElement);
1463
1463
  return null;
1464
- }, ft = (e) => gt(e, (t) => {
1464
+ }, ut = (e) => dt(e, (t) => {
1465
1465
  const n = t.getAttribute("builder-id") || t.id;
1466
1466
  return (n == null ? void 0 : n.indexOf("builder-")) === 0;
1467
- }), Z = ({
1467
+ }), Y = ({
1468
1468
  event: e,
1469
1469
  target: t
1470
1470
  }) => {
1471
- const n = t.getBoundingClientRect(), i = e.clientX - n.left, d = e.clientY - n.top, m = X(i / n.width), a = X(d / n.height);
1471
+ const n = t.getBoundingClientRect(), i = e.clientX - n.left, d = e.clientY - n.top, m = J(i / n.width), a = J(d / n.height);
1472
1472
  return {
1473
1473
  x: m,
1474
1474
  y: a
1475
1475
  };
1476
- }, ht = (e) => {
1477
- const t = e.target, n = t && ft(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
1476
+ }, ct = (e) => {
1477
+ const t = e.target, n = t && ut(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
1478
1478
  return {
1479
1479
  targetBuilderElement: i || void 0,
1480
1480
  metadata: {
1481
- targetOffset: t ? Z({
1481
+ targetOffset: t ? Y({
1482
1482
  event: e,
1483
1483
  target: t
1484
1484
  }) : void 0,
1485
- builderTargetOffset: n ? Z({
1485
+ builderTargetOffset: n ? Y({
1486
1486
  event: e,
1487
1487
  target: n
1488
1488
  }) : void 0,
1489
1489
  builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
1490
1490
  }
1491
1491
  };
1492
- }, bt = (e) => {
1492
+ }, mt = (e) => {
1493
1493
  var m, a;
1494
1494
  const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (a = e.fileUrl) != null ? a : (m = e == null ? void 0 : e.files) == null ? void 0 : m.regular;
1495
1495
  let d = "";
@@ -1504,26 +1504,26 @@ font-weight: 400;
1504
1504
  for (const o in e.files) {
1505
1505
  if (!(String(Number(o)) === o))
1506
1506
  continue;
1507
- const b = e.files[o];
1508
- b && b !== i && (d += `
1507
+ const S = e.files[o];
1508
+ S && S !== i && (d += `
1509
1509
  @font-face {
1510
1510
  font-family: "${t}";
1511
- src: url('${b}') format('woff2');
1511
+ src: url('${S}') format('woff2');
1512
1512
  font-display: fallback;
1513
1513
  font-weight: ${o};
1514
1514
  }
1515
1515
  `.trim());
1516
1516
  }
1517
1517
  return d;
1518
- }, xt = ({
1518
+ }, pt = ({
1519
1519
  customFonts: e
1520
1520
  }) => {
1521
1521
  var t;
1522
- return ((t = e == null ? void 0 : e.map((n) => bt(n))) == null ? void 0 : t.join(" ")) || "";
1523
- }, yt = ({
1522
+ return ((t = e == null ? void 0 : e.map((n) => mt(n))) == null ? void 0 : t.join(" ")) || "";
1523
+ }, gt = ({
1524
1524
  cssCode: e,
1525
1525
  contentId: t
1526
- }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", vt = `
1526
+ }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", ft = `
1527
1527
  .builder-button {
1528
1528
  all: unset;
1529
1529
  }
@@ -1540,39 +1540,39 @@ font-weight: ${o};
1540
1540
  text-align: inherit;
1541
1541
  font-family: inherit;
1542
1542
  }
1543
- `, St = (e) => e ? "" : vt, Tt = (e) => `variant-${e}`;
1544
- function kt(e) {
1545
- var I, q, j, K, M, O, _;
1546
- const t = le(null);
1543
+ `, ht = (e) => e ? "" : ft, bt = (e) => `variant-${e}`;
1544
+ function yt(e) {
1545
+ var g, u, E;
1546
+ const t = q(null);
1547
1547
  function n(r) {
1548
- var g, s;
1549
- const u = {
1548
+ var f, s;
1549
+ const c = {
1550
1550
  ...e.builderContextSignal.rootState,
1551
1551
  ...r
1552
1552
  };
1553
- e.builderContextSignal.rootSetState ? (s = (g = e.builderContextSignal).rootSetState) == null || s.call(g, u) : e.setBuilderContextSignal((l) => ({
1553
+ e.builderContextSignal.rootSetState ? (s = (f = e.builderContextSignal).rootSetState) == null || s.call(f, c) : e.setBuilderContextSignal((l) => ({
1554
1554
  ...l,
1555
- rootState: u
1555
+ rootState: c
1556
1556
  }));
1557
1557
  }
1558
1558
  function i(r) {
1559
- var g, s, l, f, R;
1560
- const u = {
1559
+ var f, s, l, h, V;
1560
+ const c = {
1561
1561
  ...e.builderContextSignal.content,
1562
1562
  ...r,
1563
1563
  data: {
1564
- ...(g = e.builderContextSignal.content) == null ? void 0 : g.data,
1564
+ ...(f = e.builderContextSignal.content) == null ? void 0 : f.data,
1565
1565
  ...r == null ? void 0 : r.data
1566
1566
  },
1567
1567
  meta: {
1568
1568
  ...(s = e.builderContextSignal.content) == null ? void 0 : s.meta,
1569
1569
  ...r == null ? void 0 : r.meta,
1570
- breakpoints: ((l = r == null ? void 0 : r.meta) == null ? void 0 : l.breakpoints) || ((R = (f = e.builderContextSignal.content) == null ? void 0 : f.meta) == null ? void 0 : R.breakpoints)
1570
+ breakpoints: ((l = r == null ? void 0 : r.meta) == null ? void 0 : l.breakpoints) || ((V = (h = e.builderContextSignal.content) == null ? void 0 : h.meta) == null ? void 0 : V.breakpoints)
1571
1571
  }
1572
1572
  };
1573
- e.setBuilderContextSignal((y) => ({
1574
- ...y,
1575
- content: u
1573
+ e.setBuilderContextSignal((x) => ({
1574
+ ...x,
1575
+ content: c
1576
1576
  }));
1577
1577
  }
1578
1578
  function d() {
@@ -1581,76 +1581,61 @@ function kt(e) {
1581
1581
  "aria-hidden": !0
1582
1582
  };
1583
1583
  }
1584
- const [m, a] = k(
1584
+ const [m, a] = T(
1585
1585
  () => e.contentWrapper || "div"
1586
1586
  );
1587
1587
  function o(r) {
1588
- return ge({
1588
+ return de({
1589
1589
  model: e.model,
1590
1590
  trustedHosts: e.trustedHosts,
1591
1591
  callbacks: {
1592
- configureSdk: (u) => {
1592
+ configureSdk: (c) => {
1593
1593
  var l;
1594
- const { breakpoints: g, contentId: s } = u;
1595
- !s || s !== ((l = e.builderContextSignal.content) == null ? void 0 : l.id) || g && i({
1594
+ const { breakpoints: f, contentId: s } = c;
1595
+ !s || s !== ((l = e.builderContextSignal.content) == null ? void 0 : l.id) || f && i({
1596
1596
  meta: {
1597
- breakpoints: g
1597
+ breakpoints: f
1598
1598
  }
1599
1599
  });
1600
1600
  },
1601
- animation: (u) => {
1602
- we(u);
1601
+ animation: (c) => {
1602
+ Se(c);
1603
1603
  },
1604
- contentUpdate: (u) => {
1605
- i(u);
1604
+ contentUpdate: (c) => {
1605
+ i(c);
1606
1606
  }
1607
1607
  }
1608
1608
  })(r);
1609
1609
  }
1610
- function p() {
1611
- var u, g;
1612
- const r = (g = (u = e.builderContextSignal.content) == null ? void 0 : u.data) == null ? void 0 : g.jsCode;
1613
- r && Q({
1614
- code: r,
1615
- context: e.context || {},
1616
- localState: void 0,
1617
- rootState: e.builderContextSignal.rootState,
1618
- rootSetState: e.builderContextSignal.rootSetState,
1619
- /**
1620
- * We don't want to cache the result of the JS code, since it's arbitrary side effect code.
1621
- */
1622
- enableCache: !1
1623
- });
1624
- }
1625
- const [b, C] = k(() => ({})), [T, V] = k(() => ({})), [E, F] = k(() => !1);
1626
- function x(r) {
1627
- var u, g;
1610
+ const [p, S] = T(() => ({})), [y, w] = T(() => ({})), [k, F] = T(() => !1);
1611
+ function P(r) {
1612
+ var c, f;
1628
1613
  if (e.builderContextSignal.content) {
1629
- const s = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, l = (g = e.builderContextSignal.content) == null ? void 0 : g.id;
1630
- J({
1614
+ const s = (c = e.builderContextSignal.content) == null ? void 0 : c.testVariationId, l = (f = e.builderContextSignal.content) == null ? void 0 : f.id;
1615
+ O({
1631
1616
  type: "click",
1632
- canTrack: A(e.canTrack),
1617
+ canTrack: D(e.canTrack),
1633
1618
  contentId: l,
1634
1619
  apiKey: e.apiKey,
1635
1620
  variationId: s !== l ? s : void 0,
1636
- ...ht(r),
1637
- unique: !E
1621
+ ...ct(r),
1622
+ unique: !k
1638
1623
  });
1639
1624
  }
1640
- E || F(!0);
1625
+ k || F(!0);
1641
1626
  }
1642
- function c() {
1643
- var u, g, s;
1644
- const r = (s = (g = (u = e.builderContextSignal.content) == null ? void 0 : u.data) == null ? void 0 : g.httpRequests) != null ? s : {};
1645
- Object.entries(r).forEach(([l, f]) => {
1646
- if (!f || T[l] || b[l] && !P())
1627
+ function W() {
1628
+ var c, f, s;
1629
+ const r = (s = (f = (c = e.builderContextSignal.content) == null ? void 0 : c.data) == null ? void 0 : f.httpRequests) != null ? s : {};
1630
+ Object.entries(r).forEach(([l, h]) => {
1631
+ if (!h || y[l] || p[l] && !A())
1647
1632
  return;
1648
- T[l] = !0;
1649
- const R = f.replace(
1633
+ y[l] = !0;
1634
+ const V = h.replace(
1650
1635
  /{{([^}]+)}}/g,
1651
- (y, re) => String(
1652
- Q({
1653
- code: re,
1636
+ (x, ae) => String(
1637
+ Z({
1638
+ code: ae,
1654
1639
  context: e.context || {},
1655
1640
  localState: void 0,
1656
1641
  rootState: e.builderContextSignal.rootState,
@@ -1659,24 +1644,24 @@ function kt(e) {
1659
1644
  })
1660
1645
  )
1661
1646
  );
1662
- fe(R).then((y) => y.json()).then((y) => {
1647
+ fetch(V).then((x) => x.json()).then((x) => {
1663
1648
  n({
1664
- [l]: y
1665
- }), b[l] = !0;
1666
- }).catch((y) => {
1667
- console.error("error fetching dynamic data", f, y);
1649
+ [l]: x
1650
+ }), p[l] = !0;
1651
+ }).catch((x) => {
1652
+ console.error("error fetching dynamic data", h, x);
1668
1653
  }).finally(() => {
1669
- T[l] = !1;
1654
+ y[l] = !1;
1670
1655
  });
1671
1656
  });
1672
1657
  }
1673
- function w() {
1674
- P() && window.dispatchEvent(
1658
+ function I() {
1659
+ A() && window.dispatchEvent(
1675
1660
  new CustomEvent(
1676
1661
  "builder:component:stateChange",
1677
1662
  {
1678
1663
  detail: {
1679
- state: Ve(e.builderContextSignal.rootState),
1664
+ state: Te(e.builderContextSignal.rootState),
1680
1665
  ref: {
1681
1666
  name: e.model
1682
1667
  }
@@ -1685,10 +1670,11 @@ function kt(e) {
1685
1670
  )
1686
1671
  );
1687
1672
  }
1688
- return S(() => {
1689
- var r, u;
1690
- if ($()) {
1691
- if (P() && (window.addEventListener("message", o), se(), de({
1673
+ const R = q(!1);
1674
+ return R.current || (W(), I(), R.current = !0), C(() => {
1675
+ var r, c;
1676
+ if (j()) {
1677
+ if (A() && (window.addEventListener("message", o), ie(), oe({
1692
1678
  ...e.locale ? {
1693
1679
  locale: e.locale
1694
1680
  } : {},
@@ -1701,89 +1687,81 @@ function kt(e) {
1701
1687
  }), Object.values(
1702
1688
  e.builderContextSignal.componentInfos
1703
1689
  ).forEach((s) => {
1704
- var f;
1705
- const l = ue(s);
1706
- (f = window.parent) == null || f.postMessage(l, "*");
1690
+ var h;
1691
+ const l = re(s);
1692
+ (h = window.parent) == null || h.postMessage(l, "*");
1707
1693
  }), window.addEventListener(
1708
1694
  "builder:component:stateChangeListenerActivated",
1709
- w
1710
- )), e.builderContextSignal.content && A(e.canTrack)) {
1711
- const s = (r = e.builderContextSignal.content) == null ? void 0 : r.testVariationId, l = (u = e.builderContextSignal.content) == null ? void 0 : u.id, f = e.apiKey;
1712
- J({
1695
+ I
1696
+ )), e.builderContextSignal.content && D(e.canTrack)) {
1697
+ const s = (r = e.builderContextSignal.content) == null ? void 0 : r.testVariationId, l = (c = e.builderContextSignal.content) == null ? void 0 : c.id, h = e.apiKey;
1698
+ O({
1713
1699
  type: "impression",
1714
1700
  canTrack: !0,
1715
1701
  contentId: l,
1716
- apiKey: f,
1702
+ apiKey: h,
1717
1703
  variationId: s !== l ? s : void 0
1718
1704
  });
1719
1705
  }
1720
- if (ce() && !P()) {
1721
- const s = new URL(location.href).searchParams, l = s.get("builder.preview"), f = s.get(
1706
+ if (le() && !A()) {
1707
+ const s = new URL(location.href).searchParams, l = s.get("builder.preview"), h = s.get(
1722
1708
  `builder.overrides.${l}`
1723
- ), R = s.get("apiKey") || s.get("builder.space");
1724
- l === e.model && R === e.apiKey && (!e.content || f === e.content.id) && me({
1709
+ ), V = s.get("apiKey") || s.get("builder.space");
1710
+ l === e.model && V === e.apiKey && (!e.content || h === e.content.id) && se({
1725
1711
  model: e.model,
1726
1712
  apiKey: e.apiKey,
1727
1713
  apiVersion: e.builderContextSignal.apiVersion
1728
- }).then((y) => {
1729
- y && i(y);
1714
+ }).then((x) => {
1715
+ x && i(x);
1730
1716
  });
1731
1717
  }
1732
1718
  }
1733
- }, []), S(() => {
1734
- e.apiKey || pe.error(
1735
- "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
1736
- ), p(), c(), w();
1737
- }, []), S(() => {
1719
+ }, []), C(() => {
1738
1720
  e.content && i(e.content);
1739
- }, [e.content]), S(() => {
1740
- p();
1741
- }, [(q = (I = e.builderContextSignal.content) == null ? void 0 : I.data) == null ? void 0 : q.jsCode]), S(() => {
1742
- c();
1743
- }, [(K = (j = e.builderContextSignal.content) == null ? void 0 : j.data) == null ? void 0 : K.httpRequests]), S(() => {
1744
- w();
1745
- }, [e.builderContextSignal.rootState]), S(() => {
1721
+ }, [e.content]), C(() => {
1722
+ I();
1723
+ }, [e.builderContextSignal.rootState]), C(() => {
1746
1724
  e.data && n(e.data);
1747
- }, [e.data]), S(() => {
1725
+ }, [e.data]), C(() => {
1748
1726
  e.locale && n({
1749
1727
  locale: e.locale
1750
1728
  });
1751
- }, [e.locale]), S(() => () => {
1752
- $() && (window.removeEventListener("message", o), window.removeEventListener(
1729
+ }, [e.locale]), C(() => () => {
1730
+ j() && (window.removeEventListener("message", o), window.removeEventListener(
1753
1731
  "builder:component:stateChangeListenerActivated",
1754
- w
1732
+ I
1755
1733
  ));
1756
- }, []), /* @__PURE__ */ h(Ie.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ h(
1734
+ }, []), /* @__PURE__ */ b(ve.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ b(
1757
1735
  m,
1758
1736
  {
1759
1737
  ref: t,
1760
- onClick: (r) => x(r),
1761
- "builder-content-id": (M = e.builderContextSignal.content) == null ? void 0 : M.id,
1738
+ onClick: (r) => P(r),
1739
+ "builder-content-id": (g = e.builderContextSignal.content) == null ? void 0 : g.id,
1762
1740
  "builder-model": e.model,
1741
+ className: bt(
1742
+ ((u = e.content) == null ? void 0 : u.testVariationId) || ((E = e.content) == null ? void 0 : E.id)
1743
+ ),
1763
1744
  ...d(),
1764
1745
  ...e.contentWrapperProps,
1765
- className: Tt(
1766
- ((O = e.content) == null ? void 0 : O.testVariationId) || ((_ = e.content) == null ? void 0 : _.id)
1767
- ),
1768
1746
  children: e.children
1769
1747
  }
1770
1748
  ) : null });
1771
1749
  }
1772
- function Ct(e) {
1773
- const [t, n] = k(
1750
+ function xt(e) {
1751
+ const [t, n] = T(
1774
1752
  () => `
1775
- ${yt({
1753
+ ${gt({
1776
1754
  cssCode: e.cssCode,
1777
1755
  contentId: e.contentId
1778
1756
  })}
1779
- ${xt({
1757
+ ${pt({
1780
1758
  customFonts: e.customFonts
1781
1759
  })}
1782
- ${St(e.isNestedRender)}
1760
+ ${ht(e.isNestedRender)}
1783
1761
  `.trim()
1784
1762
  );
1785
- return /* @__PURE__ */ h(
1786
- ne,
1763
+ return /* @__PURE__ */ b(
1764
+ X,
1787
1765
  {
1788
1766
  id: "builderio-content",
1789
1767
  styles: t,
@@ -1791,7 +1769,7 @@ ${St(e.isNestedRender)}
1791
1769
  }
1792
1770
  );
1793
1771
  }
1794
- const It = ({
1772
+ const vt = ({
1795
1773
  content: e,
1796
1774
  data: t,
1797
1775
  locale: n
@@ -1808,7 +1786,7 @@ const It = ({
1808
1786
  locale: n
1809
1787
  } : {}
1810
1788
  };
1811
- }, wt = ({
1789
+ }, St = ({
1812
1790
  content: e,
1813
1791
  data: t
1814
1792
  }) => e ? {
@@ -1819,51 +1797,51 @@ const It = ({
1819
1797
  },
1820
1798
  meta: e == null ? void 0 : e.meta
1821
1799
  } : void 0;
1822
- function ee(e) {
1823
- var p, b, C, T, V, E, F;
1824
- const [t, n] = k(
1800
+ function Q(e) {
1801
+ var S, y, w, k, F, P, W, I, R;
1802
+ const [t, n] = T(
1825
1803
  () => {
1826
- var x, c;
1827
- return pt({
1804
+ var g, u;
1805
+ return st({
1828
1806
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
1829
- variationId: (x = e.content) == null ? void 0 : x.testVariationId,
1807
+ variationId: (g = e.content) == null ? void 0 : g.testVariationId,
1830
1808
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
1831
- contentId: (c = e.content) == null ? void 0 : c.id
1809
+ contentId: (u = e.content) == null ? void 0 : u.id
1832
1810
  });
1833
1811
  }
1834
1812
  );
1835
- function i(x) {
1836
- o((c) => ({
1837
- ...c,
1838
- rootState: x
1813
+ function i(g) {
1814
+ o((u) => ({
1815
+ ...u,
1816
+ rootState: g
1839
1817
  }));
1840
1818
  }
1841
- const [d, m] = k(
1819
+ const [d, m] = T(
1842
1820
  () => {
1843
- var x;
1821
+ var g;
1844
1822
  return [
1845
- ...G(),
1846
- ...((x = e.customComponents) == null ? void 0 : x.filter(({ models: c }) => !(c != null && c.length) || !e.model ? !0 : c.includes(e.model))) || []
1823
+ ...z(),
1824
+ ...((g = e.customComponents) == null ? void 0 : g.filter(({ models: u }) => !(u != null && u.length) || !e.model ? !0 : u.includes(e.model))) || []
1847
1825
  ].reduce(
1848
- (c, { component: w, ...I }) => ({
1849
- ...c,
1850
- [I.name]: {
1851
- component: w,
1852
- ...Y(I)
1826
+ (u, { component: E, ...r }) => ({
1827
+ ...u,
1828
+ [r.name]: {
1829
+ component: E,
1830
+ ..._(r)
1853
1831
  }
1854
1832
  }),
1855
1833
  {}
1856
1834
  );
1857
1835
  }
1858
- ), [a, o] = k(() => {
1859
- var x;
1836
+ ), [a, o] = T(() => {
1837
+ var g;
1860
1838
  return {
1861
- content: wt({
1839
+ content: St({
1862
1840
  content: e.content,
1863
1841
  data: e.data
1864
1842
  }),
1865
1843
  localState: void 0,
1866
- rootState: It({
1844
+ rootState: vt({
1867
1845
  content: e.content,
1868
1846
  data: e.data,
1869
1847
  locale: e.locale
@@ -1874,12 +1852,12 @@ function ee(e) {
1874
1852
  apiKey: e.apiKey,
1875
1853
  apiVersion: e.apiVersion,
1876
1854
  componentInfos: [
1877
- ...G(),
1878
- ...((x = e.customComponents) == null ? void 0 : x.filter(({ models: c }) => !(c != null && c.length) || !e.model ? !0 : c.includes(e.model))) || []
1855
+ ...z(),
1856
+ ...((g = e.customComponents) == null ? void 0 : g.filter(({ models: u }) => !(u != null && u.length) || !e.model ? !0 : u.includes(e.model))) || []
1879
1857
  ].reduce(
1880
- (c, { component: w, ...I }) => ({
1881
- ...c,
1882
- [I.name]: Y(I)
1858
+ (u, { component: E, ...r }) => ({
1859
+ ...u,
1860
+ [r.name]: _(r)
1883
1861
  }),
1884
1862
  {}
1885
1863
  ),
@@ -1888,15 +1866,35 @@ function ee(e) {
1888
1866
  BlocksWrapperProps: e.blocksWrapperProps || {},
1889
1867
  nonce: e.nonce || ""
1890
1868
  };
1891
- });
1892
- return /* @__PURE__ */ h(
1893
- Re.Provider,
1869
+ }), p = q(!1);
1870
+ if (!p.current) {
1871
+ e.apiKey || ue.error(
1872
+ "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
1873
+ );
1874
+ const g = (y = (S = a.content) == null ? void 0 : S.data) == null ? void 0 : y.jsCode;
1875
+ g && Z({
1876
+ code: g,
1877
+ context: e.context || {},
1878
+ localState: void 0,
1879
+ rootState: a.rootState,
1880
+ rootSetState: (u) => {
1881
+ Object.assign(a.rootState, u);
1882
+ },
1883
+ isExpression: !1,
1884
+ /**
1885
+ * We don't want to cache the result of the JS code, since it's arbitrary side effect code.
1886
+ */
1887
+ enableCache: !1
1888
+ }), p.current = !0;
1889
+ }
1890
+ return /* @__PURE__ */ b(
1891
+ ke.Provider,
1894
1892
  {
1895
1893
  value: {
1896
1894
  registeredComponents: d
1897
1895
  },
1898
- children: /* @__PURE__ */ H(
1899
- kt,
1896
+ children: /* @__PURE__ */ N(
1897
+ yt,
1900
1898
  {
1901
1899
  nonce: e.nonce,
1902
1900
  content: e.content,
@@ -1914,28 +1912,28 @@ function ee(e) {
1914
1912
  trustedHosts: e.trustedHosts,
1915
1913
  setBuilderContextSignal: o,
1916
1914
  children: [
1917
- e.isSsrAbTest ? /* @__PURE__ */ h(
1918
- N,
1915
+ e.isSsrAbTest ? /* @__PURE__ */ b(
1916
+ K,
1919
1917
  {
1920
1918
  id: "builderio-variant-visibility",
1921
1919
  scriptStr: t,
1922
1920
  nonce: e.nonce || ""
1923
1921
  }
1924
1922
  ) : null,
1925
- /* @__PURE__ */ h(
1926
- Ct,
1923
+ /* @__PURE__ */ b(
1924
+ xt,
1927
1925
  {
1928
1926
  nonce: e.nonce || "",
1929
1927
  isNestedRender: e.isNestedRender,
1930
- contentId: (p = a.content) == null ? void 0 : p.id,
1931
- cssCode: (C = (b = a.content) == null ? void 0 : b.data) == null ? void 0 : C.cssCode,
1932
- customFonts: (V = (T = a.content) == null ? void 0 : T.data) == null ? void 0 : V.customFonts
1928
+ contentId: (w = a.content) == null ? void 0 : w.id,
1929
+ cssCode: (F = (k = a.content) == null ? void 0 : k.data) == null ? void 0 : F.cssCode,
1930
+ customFonts: (W = (P = a.content) == null ? void 0 : P.data) == null ? void 0 : W.customFonts
1933
1931
  }
1934
1932
  ),
1935
- /* @__PURE__ */ h(
1936
- Ee,
1933
+ /* @__PURE__ */ b(
1934
+ Ie,
1937
1935
  {
1938
- blocks: (F = (E = a.content) == null ? void 0 : E.data) == null ? void 0 : F.blocks,
1936
+ blocks: (R = (I = a.content) == null ? void 0 : I.data) == null ? void 0 : R.blocks,
1939
1937
  context: a,
1940
1938
  registeredComponents: d,
1941
1939
  linkComponent: e.linkComponent
@@ -1947,18 +1945,18 @@ function ee(e) {
1947
1945
  }
1948
1946
  );
1949
1947
  }
1950
- function Dt(e) {
1948
+ function Ft(e) {
1951
1949
  var a;
1952
- const [t, n] = k(
1953
- () => dt({
1954
- canTrack: A(e.canTrack),
1950
+ const [t, n] = T(
1951
+ () => it({
1952
+ canTrack: D(e.canTrack),
1955
1953
  content: e.content
1956
1954
  })
1957
1955
  );
1958
1956
  function i() {
1959
1957
  var o;
1960
- return mt(
1961
- W(e.content).map((p) => ({
1958
+ return lt(
1959
+ B(e.content).map((p) => ({
1962
1960
  id: p.testVariationId,
1963
1961
  testRatio: p.testRatio
1964
1962
  })),
@@ -1966,47 +1964,47 @@ function Dt(e) {
1966
1964
  );
1967
1965
  }
1968
1966
  function d() {
1969
- return W(e.content).map((o) => `.variant-${o.testVariationId} { display: none; } `).join("");
1967
+ return B(e.content).map((o) => `.variant-${o.testVariationId} { display: none; } `).join("");
1970
1968
  }
1971
1969
  function m() {
1972
1970
  var o;
1973
1971
  return t ? {
1974
1972
  ...e.content,
1975
1973
  testVariationId: (o = e.content) == null ? void 0 : o.id
1976
- } : he({
1974
+ } : ce({
1977
1975
  item: e.content,
1978
- canTrack: A(e.canTrack)
1976
+ canTrack: D(e.canTrack)
1979
1977
  });
1980
1978
  }
1981
- return S(() => {
1982
- }, []), /* @__PURE__ */ H(z, { children: [
1983
- !e.isNestedRender && te !== "reactNative" ? /* @__PURE__ */ h(
1984
- N,
1979
+ return C(() => {
1980
+ }, []), /* @__PURE__ */ N(M, { children: [
1981
+ !e.isNestedRender && G !== "reactNative" ? /* @__PURE__ */ b(
1982
+ K,
1985
1983
  {
1986
1984
  id: "builderio-init-variants-fns",
1987
- scriptStr: ct(),
1985
+ scriptStr: rt(),
1988
1986
  nonce: e.nonce || ""
1989
1987
  }
1990
1988
  ) : null,
1991
- t ? /* @__PURE__ */ H(z, { children: [
1992
- /* @__PURE__ */ h(
1993
- ne,
1989
+ t ? /* @__PURE__ */ N(M, { children: [
1990
+ /* @__PURE__ */ b(
1991
+ X,
1994
1992
  {
1995
1993
  id: "builderio-variants",
1996
1994
  styles: d(),
1997
1995
  nonce: e.nonce || ""
1998
1996
  }
1999
1997
  ),
2000
- /* @__PURE__ */ h(
2001
- N,
1998
+ /* @__PURE__ */ b(
1999
+ K,
2002
2000
  {
2003
2001
  id: "builderio-variants-visibility",
2004
2002
  scriptStr: i(),
2005
2003
  nonce: e.nonce || ""
2006
2004
  }
2007
2005
  ),
2008
- (a = W(e.content)) == null ? void 0 : a.map((o) => /* @__PURE__ */ h(
2009
- ee,
2006
+ (a = B(e.content)) == null ? void 0 : a.map((o) => /* @__PURE__ */ b(
2007
+ Q,
2010
2008
  {
2011
2009
  isNestedRender: e.isNestedRender,
2012
2010
  nonce: e.nonce,
@@ -2032,8 +2030,8 @@ function Dt(e) {
2032
2030
  o.testVariationId
2033
2031
  ))
2034
2032
  ] }) : null,
2035
- /* @__PURE__ */ h(
2036
- ee,
2033
+ /* @__PURE__ */ b(
2034
+ Q,
2037
2035
  {
2038
2036
  nonce: e.nonce,
2039
2037
  isNestedRender: e.isNestedRender,
@@ -2060,5 +2058,5 @@ function Dt(e) {
2060
2058
  ] });
2061
2059
  }
2062
2060
  export {
2063
- Dt as default
2061
+ Ft as default
2064
2062
  };