@builder.io/sdk-react 3.0.3 → 3.0.6

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 (87) hide show
  1. package/lib/browser/blocks-exports.cjs +169 -32
  2. package/lib/browser/blocks-exports.mjs +1286 -884
  3. package/lib/browser/index.cjs +1 -1
  4. package/lib/browser/index.mjs +17 -16
  5. package/lib/browser/server-entry-a1c64831.cjs +2 -0
  6. package/lib/browser/{server-entry-c904f136.js → server-entry-df5e89e5.js} +279 -237
  7. package/lib/browser/server-entry.cjs +1 -1
  8. package/lib/browser/server-entry.mjs +1 -1
  9. package/lib/edge/{accordion-c786f197.js → accordion-289f3464.js} +1 -1
  10. package/lib/edge/{accordion-032726a7.cjs → accordion-fbfb71f4.cjs} +1 -1
  11. package/lib/edge/{blocks-827b0a87.cjs → blocks-459a090b.cjs} +11 -11
  12. package/lib/edge/{blocks-105e50e5.js → blocks-582a7fd7.js} +87 -88
  13. package/lib/edge/blocks-exports.cjs +1 -1
  14. package/lib/edge/blocks-exports.mjs +13 -12
  15. package/lib/edge/{button-f0e0ea72.js → button-9b112da6.js} +2 -2
  16. package/lib/edge/{button-5cbfe22c.cjs → button-da357144.cjs} +1 -1
  17. package/lib/edge/{columns-d07da61d.cjs → columns-a211113f.cjs} +2 -2
  18. package/lib/edge/{columns-9e187314.js → columns-aba58dda.js} +18 -18
  19. package/lib/edge/{content-variants-59dc0824.js → content-variants-08f4371c.js} +165 -124
  20. package/lib/edge/content-variants-4b5899b5.cjs +134 -0
  21. package/lib/edge/dynamic-blocks-exports.cjs +3 -1
  22. package/lib/edge/dynamic-blocks-exports.mjs +5 -2
  23. package/lib/edge/form-4d4553c2.js +166 -0
  24. package/lib/edge/form-e3a3afd4.cjs +1 -0
  25. package/lib/edge/{get-class-prop-name-6b143ec7.js → get-class-prop-name-38c2baca.js} +1 -1
  26. package/lib/edge/{get-class-prop-name-8fb0e5ad.cjs → get-class-prop-name-fbe244e3.cjs} +1 -1
  27. package/lib/edge/{image-2a2b26d2.js → image-38917f45.js} +22 -24
  28. package/lib/edge/image-590e36ae.cjs +17 -0
  29. package/lib/edge/{img-72bf9d21.cjs → img-8d549af8.cjs} +1 -1
  30. package/lib/edge/{img-2c4c6b78.js → img-c49066fa.js} +1 -1
  31. package/lib/edge/index.cjs +1 -1
  32. package/lib/edge/index.mjs +18 -17
  33. package/lib/edge/{input-6eca8427.cjs → input-1ae3842f.cjs} +1 -1
  34. package/lib/edge/{input-752f3ce9.js → input-e7301f4e.js} +1 -1
  35. package/lib/edge/personalization-container-035be6ba.js +384 -0
  36. package/lib/edge/personalization-container-25cd8b5e.cjs +138 -0
  37. package/lib/edge/{select-a1d6e80e.js → select-4187b229.js} +1 -1
  38. package/lib/edge/{select-49a73a0b.cjs → select-64fdaa79.cjs} +1 -1
  39. package/lib/edge/server-entry-2ef4e66a.cjs +2 -0
  40. package/lib/edge/{server-entry-35f12729.js → server-entry-61fca4f7.js} +322 -280
  41. package/lib/edge/server-entry.cjs +1 -1
  42. package/lib/edge/server-entry.mjs +1 -1
  43. package/lib/edge/{slot-2327e009.cjs → slot-995f63c2.cjs} +1 -1
  44. package/lib/edge/{slot-b9bcbd41.js → slot-d6c46a42.js} +3 -3
  45. package/lib/edge/{symbol-3527699b.cjs → symbol-498daa97.cjs} +1 -1
  46. package/lib/edge/{symbol-33e7736f.js → symbol-623dc717.js} +2 -2
  47. package/lib/edge/{tabs-bc422e4c.js → tabs-12ba41b1.js} +3 -3
  48. package/lib/edge/{tabs-2df0eaa2.cjs → tabs-d39499cd.cjs} +1 -1
  49. package/lib/edge/video-4ecfd08b.cjs +1 -0
  50. package/lib/edge/{video-58c2cc8d.js → video-a3f10439.js} +0 -1
  51. package/lib/node/blocks-exports.cjs +170 -33
  52. package/lib/node/blocks-exports.mjs +1372 -970
  53. package/lib/node/index.cjs +1 -1
  54. package/lib/node/index.mjs +17 -16
  55. package/lib/node/init.cjs +1 -1
  56. package/lib/node/init.mjs +3 -3
  57. package/lib/node/{server-entry-d1ed35c5.js → server-entry-27d9d31e.js} +279 -237
  58. package/lib/node/server-entry-98ebff74.cjs +2 -0
  59. package/lib/node/server-entry.cjs +1 -1
  60. package/lib/node/server-entry.mjs +1 -1
  61. package/lib/node/{setIvm-6675714a.js → setIvm-2dde9074.js} +1 -1
  62. package/lib/node/{setIvm-e4deba11.cjs → setIvm-784fe19f.cjs} +1 -1
  63. package/lib/node/setIvm.cjs +1 -1
  64. package/lib/node/setIvm.mjs +2 -2
  65. package/lib/node/{should-force-browser-runtime-in-node-75b2b3a0.js → should-force-browser-runtime-in-node-80f081c8.js} +1 -1
  66. package/lib/node/{should-force-browser-runtime-in-node-03adae17.cjs → should-force-browser-runtime-in-node-cd6baa94.cjs} +1 -1
  67. package/package.json +2 -2
  68. package/types/blocks/form/form/form.d.ts +1 -0
  69. package/types/blocks/personalization-container/component-info.d.ts +2 -0
  70. package/types/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -0
  71. package/types/blocks/personalization-container/helpers.d.ts +27 -0
  72. package/types/blocks/personalization-container/index.d.ts +1 -0
  73. package/types/blocks/personalization-container/personalization-container.d.ts +4 -0
  74. package/types/blocks/personalization-container/personalization-container.types.d.ts +14 -0
  75. package/types/constants/sdk-version.d.ts +1 -1
  76. package/types/helpers/user-attributes.d.ts +17 -0
  77. package/types/index-helpers/blocks-exports.d.ts +1 -0
  78. package/types/types/components.d.ts +2 -2
  79. package/types/types/input.d.ts +1 -0
  80. package/lib/browser/server-entry-5eafc5bd.cjs +0 -2
  81. package/lib/edge/content-variants-0db90715.cjs +0 -134
  82. package/lib/edge/form-79639135.cjs +0 -1
  83. package/lib/edge/form-7a7b98cf.js +0 -176
  84. package/lib/edge/image-4db81d72.cjs +0 -17
  85. package/lib/edge/server-entry-6b2058e2.cjs +0 -2
  86. package/lib/edge/video-e20dcbbc.cjs +0 -1
  87. package/lib/node/server-entry-606ce65a.cjs +0 -2
@@ -1,10 +1,8 @@
1
1
  import { jsx as h, jsxs as $, Fragment as z } from "react/jsx-runtime";
2
- import { lazy as S, useRef as _, useState as I, useEffect as V } from "react";
3
- import { isBrowser as j, TARGET as O, isEditing as F, isPreviewing as te, registerInsertMenu as le, setupBrowserForEditing as se, createRegisterComponentMessage as de, getDefaultCanTrack as H, _track as J, fetchOneEntry as ce, createEditorListener as ue, logFetch as me, serializeIncludingFunctions as Y, logger as pe, handleABTestingSync as fe } from "./server-entry-35f12729.js";
2
+ import { lazy as v, useRef as _, useState as I, useEffect as V } from "react";
3
+ import { isBrowser as j, TARGET as K, isEditing as F, isPreviewing as te, registerInsertMenu as le, setupBrowserForEditing as se, createRegisterComponentMessage as de, getDefaultCanTrack as H, _track as J, fetchOneEntry as ue, createEditorListener as ce, logFetch as me, serializeIncludingFunctions as Y, logger as pe, handleABTestingSync as fe } from "./server-entry-61fca4f7.js";
4
4
  import { Video as ge, Button as he, Columns as be, Fragment as ye, Image as xe, Section as ve, Symbol as Se, Text as Te, BuilderContext as Ie } from "./blocks-exports.mjs";
5
- import { triggerAnimation as ke, evaluate as ne, fastClone as Ce, InlinedStyles as ae, ComponentsContext as we, Blocks as Ve } from "./blocks-105e50e5.js";
6
- import "./get-class-prop-name-6b143ec7.js";
7
- import "./dynamic-renderer-8b343325.js";
5
+ import { triggerAnimation as ke, evaluate as ne, fastClone as Ce, InlinedStyles as ae, ComponentsContext as we, Blocks as Ve } from "./blocks-582a7fd7.js";
8
6
  const U = {
9
7
  "@type": "@builder.io/sdk:Element",
10
8
  layerName: "Accordion item title",
@@ -129,7 +127,7 @@ const U = {
129
127
  builderComponents: !0,
130
128
  builderLinkComponent: !0
131
129
  }
132
- }, Ee = S(() => import("./accordion-c786f197.js")), Fe = {
130
+ }, Ee = v(() => import("./accordion-289f3464.js")), Fe = {
133
131
  name: "Core:Button",
134
132
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
135
133
  defaultStyles: {
@@ -344,7 +342,7 @@ const U = {
344
342
  });
345
343
  }
346
344
  const n = e.get("columns");
347
- Array.isArray(n) && n.find((l) => l.get("width")) && (n.find((c) => !c.get("width")) || n.reduce((o, u) => o + u.get("width"), 0) !== 100) && t();
345
+ Array.isArray(n) && n.find((l) => l.get("width")) && (n.find((u) => !u.get("width")) || n.reduce((o, c) => o + c.get("width"), 0) !== 100) && t();
348
346
  }
349
347
  }, {
350
348
  name: "space",
@@ -372,13 +370,13 @@ const U = {
372
370
  builderComponents: !0,
373
371
  builderLinkComponent: !0
374
372
  }
375
- }, Ae = {
373
+ }, We = {
376
374
  name: "Fragment",
377
375
  static: !0,
378
376
  hidden: !0,
379
377
  canHaveChildren: !0,
380
378
  noWrap: !0
381
- }, M = ["jpeg", "jpg", "png", "svg", "webp", "gif", "jfif", "pjpeg", "pjp", "apng", "avif", "tif", "tiff", "heif", "bmp", "eps", "raw", "cr2", "nef", "orf", "sr2", "psd", "heic", "dib", "ai"], We = ["mp4", "webm", "mkv", "flv", "vob", "ogv", "ogg", "drc", "gif", "gifv", "mng", "avi", "mov", "qt", "mts", "m2ts", "ts", "wmv", "yuv", "rm", "rmvb", "viv", "asf", "amv", "m4p", "mpeg", "mpe", "m2v", "m4v", "svi", "3gp", "3g2", "mxf", "roq", "nsv", "f4v", "f4p", "f4a", "f4b"], Be = {
379
+ }, M = ["jpeg", "jpg", "png", "svg", "webp", "gif", "jfif", "pjpeg", "pjp", "apng", "avif", "tif", "tiff", "heif", "bmp", "eps", "raw", "cr2", "nef", "orf", "sr2", "psd", "heic", "dib", "ai"], Ae = ["mp4", "webm", "mkv", "flv", "vob", "ogv", "ogg", "drc", "gif", "gifv", "mng", "avi", "mov", "qt", "mts", "m2ts", "ts", "wmv", "yuv", "rm", "rmvb", "viv", "asf", "amv", "m4p", "mpeg", "mpe", "m2v", "m4v", "svi", "3gp", "3g2", "mxf", "roq", "nsv", "f4v", "f4p", "f4a", "f4b"], Be = {
382
380
  name: "Image",
383
381
  static: !0,
384
382
  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",
@@ -399,14 +397,14 @@ const U = {
399
397
  onChange: (e) => {
400
398
  e.delete("srcset"), e.delete("noWebp");
401
399
  function n(a, o = 6e4) {
402
- return new Promise((u, T) => {
403
- const v = document.createElement("img");
400
+ return new Promise((c, T) => {
401
+ const S = document.createElement("img");
404
402
  let R = !1;
405
- v.onload = () => {
406
- R = !0, u(v);
407
- }, v.addEventListener("error", (k) => {
403
+ S.onload = () => {
404
+ R = !0, c(S);
405
+ }, S.addEventListener("error", (k) => {
408
406
  console.warn("Image load failed", k.error), T(k.error);
409
- }), v.src = a, setTimeout(() => {
407
+ }), S.src = a, setTimeout(() => {
410
408
  R || T(new Error("Image load timed out"));
411
409
  }, o);
412
410
  });
@@ -414,10 +412,10 @@ const U = {
414
412
  function i(a) {
415
413
  return Math.round(a * 1e3) / 1e3;
416
414
  }
417
- const l = e.get("image"), c = e.get("aspectRatio");
415
+ const l = e.get("image"), u = e.get("aspectRatio");
418
416
  if (fetch(l).then((a) => a.blob()).then((a) => {
419
417
  a.type.includes("svg") && e.set("noWebp", !0);
420
- }), l && (!c || c === 0.7041))
418
+ }), l && (!u || u === 0.7041))
421
419
  return n(l).then((a) => {
422
420
  const o = e.get("aspectRatio");
423
421
  e.get("image") === l && (!o || o === 0.7041) && a.width && a.height && (e.set("aspectRatio", i(a.height / a.width)), e.set("height", a.height), e.set("width", a.width));
@@ -487,6 +485,41 @@ const U = {
487
485
  builderBlock: !0
488
486
  }
489
487
  }, De = {
488
+ name: "PersonalizationContainer",
489
+ shouldReceiveBuilderProps: {
490
+ builderBlock: !0,
491
+ builderContext: !0
492
+ },
493
+ noWrap: !0,
494
+ image: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F37229ed30d8c41dfb10b8cca1992053a",
495
+ canHaveChildren: !0,
496
+ inputs: [{
497
+ name: "variants",
498
+ defaultValue: [],
499
+ behavior: "personalizationVariantList",
500
+ type: "list",
501
+ subFields: [{
502
+ name: "name",
503
+ type: "text"
504
+ }, {
505
+ name: "query",
506
+ friendlyName: "Targeting rules",
507
+ type: "BuilderQuery",
508
+ defaultValue: []
509
+ }, {
510
+ name: "startDate",
511
+ type: "date"
512
+ }, {
513
+ name: "endDate",
514
+ type: "date"
515
+ }, {
516
+ name: "blocks",
517
+ type: "uiBlocks",
518
+ hideFromUI: !0,
519
+ defaultValue: []
520
+ }]
521
+ }]
522
+ }, He = v(() => import("./personalization-container-035be6ba.js")), Ue = {
490
523
  name: "Core:Section",
491
524
  static: !0,
492
525
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -525,7 +558,7 @@ const U = {
525
558
  }
526
559
  }
527
560
  }]
528
- }, He = {
561
+ }, Le = {
529
562
  name: "Slot",
530
563
  isRSC: !0,
531
564
  description: "Allow child blocks to be inserted into this content when used as a Symbol",
@@ -542,7 +575,7 @@ const U = {
542
575
  builderContext: !0,
543
576
  builderComponents: !0
544
577
  }
545
- }, Ue = S(() => import("./slot-b9bcbd41.js")), Le = {
578
+ }, Ne = v(() => import("./slot-d6c46a42.js")), qe = {
546
579
  name: "Symbol",
547
580
  noWrap: !0,
548
581
  static: !0,
@@ -619,7 +652,7 @@ const U = {
619
652
  text: "New tab content "
620
653
  }
621
654
  }
622
- }, Ne = {
655
+ }, $e = {
623
656
  name: "Builder: Tabs",
624
657
  inputs: [{
625
658
  name: "tabs",
@@ -722,7 +755,7 @@ const U = {
722
755
  builderComponents: !0,
723
756
  builderLinkComponent: !0
724
757
  }
725
- }, qe = S(() => import("./tabs-bc422e4c.js")), $e = {
758
+ }, _e = v(() => import("./tabs-12ba41b1.js")), je = {
726
759
  shouldReceiveBuilderProps: {
727
760
  builderBlock: !1,
728
761
  builderContext: !0
@@ -744,7 +777,7 @@ const U = {
744
777
  height: "auto",
745
778
  textAlign: "center"
746
779
  }
747
- }, _e = {
780
+ }, Oe = {
748
781
  name: "Custom Code",
749
782
  static: !0,
750
783
  requiredPermissions: ["editCode"],
@@ -766,7 +799,7 @@ const U = {
766
799
  helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
767
800
  advanced: !0
768
801
  }]
769
- }, je = S(() => import("./custom-code-7786788e.js")), Ke = {
802
+ }, Ke = v(() => import("./custom-code-7786788e.js")), Me = {
770
803
  name: "Embed",
771
804
  static: !0,
772
805
  inputs: [{
@@ -781,7 +814,7 @@ const U = {
781
814
  defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
782
815
  hideFromUI: !0
783
816
  }]
784
- }, Oe = S(() => import("./embed-5c1bbe12.js")), Me = {
817
+ }, ze = v(() => import("./embed-5c1bbe12.js")), Je = {
785
818
  name: "Form:Form",
786
819
  // editableTags: ['builder-form-error']
787
820
  defaults: {
@@ -1018,7 +1051,7 @@ const U = {
1018
1051
  builderComponents: !0,
1019
1052
  builderLinkComponent: !0
1020
1053
  }
1021
- }, ze = S(() => import("./form-7a7b98cf.js")), Je = {
1054
+ }, Ye = v(() => import("./form-4d4553c2.js")), Ge = {
1022
1055
  name: "Form:Input",
1023
1056
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fad6f37889d9e40bbbbc72cdb5875d6ca",
1024
1057
  inputs: [
@@ -1069,7 +1102,7 @@ const U = {
1069
1102
  borderStyle: "solid",
1070
1103
  borderColor: "#ccc"
1071
1104
  }
1072
- }, Ye = S(() => import("./input-752f3ce9.js")), Ge = {
1105
+ }, Qe = v(() => import("./input-e7301f4e.js")), Xe = {
1073
1106
  name: "Form:Select",
1074
1107
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F83acca093fb24aaf94dee136e9a4b045",
1075
1108
  defaultStyles: {
@@ -1111,7 +1144,7 @@ const U = {
1111
1144
  }],
1112
1145
  static: !0,
1113
1146
  noWrap: !0
1114
- }, Qe = S(() => import("./select-a1d6e80e.js")), Xe = {
1147
+ }, Ze = v(() => import("./select-4187b229.js")), et = {
1115
1148
  name: "Form:SubmitButton",
1116
1149
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Fdf2820ffed1f4349a94c40b3221f5b98",
1117
1150
  defaultStyles: {
@@ -1136,7 +1169,7 @@ const U = {
1136
1169
  // that only shows if advanced setting is flipped
1137
1170
  // TODO: defaultChildren
1138
1171
  // canHaveChildren: true,
1139
- }, Ze = S(() => import("./submit-button-b48361a7.js")), et = {
1172
+ }, tt = v(() => import("./submit-button-b48361a7.js")), nt = {
1140
1173
  name: "Form:TextArea",
1141
1174
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2Ff74a2f3de58c4c3e939204e5b6b8f6c3",
1142
1175
  inputs: [{
@@ -1172,7 +1205,7 @@ const U = {
1172
1205
  },
1173
1206
  static: !0,
1174
1207
  noWrap: !0
1175
- }, tt = S(() => import("./textarea-d29025e9.js")), nt = {
1208
+ }, at = v(() => import("./textarea-d29025e9.js")), it = {
1176
1209
  // friendlyName?
1177
1210
  name: "Raw:Img",
1178
1211
  hideFromInsertMenu: !0,
@@ -1186,7 +1219,7 @@ const U = {
1186
1219
  }],
1187
1220
  noWrap: !0,
1188
1221
  static: !0
1189
- }, at = S(() => import("./img-2c4c6b78.js")), it = {
1222
+ }, ot = v(() => import("./img-c49066fa.js")), rt = {
1190
1223
  name: "Video",
1191
1224
  canHaveChildren: !0,
1192
1225
  defaultStyles: {
@@ -1197,7 +1230,7 @@ const U = {
1197
1230
  inputs: [{
1198
1231
  name: "video",
1199
1232
  type: "file",
1200
- allowedFileTypes: We,
1233
+ allowedFileTypes: Ae,
1201
1234
  bubble: !0,
1202
1235
  defaultValue: "https://cdn.builder.io/o/assets%2FYJIGb4i01jvw0SRdL5Bt%2Fd27731a526464deba0016216f5f9e570%2Fcompressed?apiKey=YJIGb4i01jvw0SRdL5Bt&token=d27731a526464deba0016216f5f9e570&alt=media&optimized=true",
1203
1236
  required: !0
@@ -1270,33 +1303,33 @@ const U = {
1270
1303
  shouldReceiveBuilderProps: {
1271
1304
  builderBlock: !0
1272
1305
  }
1273
- }, ot = () => [{
1274
- component: je,
1275
- ..._e
1276
- }, {
1277
- component: Oe,
1278
- ...Ke
1306
+ }, lt = () => [{
1307
+ component: Ke,
1308
+ ...Oe
1279
1309
  }, {
1280
1310
  component: ze,
1281
1311
  ...Me
1282
1312
  }, {
1283
1313
  component: Ye,
1284
1314
  ...Je
1285
- }, {
1286
- component: Ze,
1287
- ...Xe
1288
1315
  }, {
1289
1316
  component: Qe,
1290
1317
  ...Ge
1291
1318
  }, {
1292
1319
  component: tt,
1293
1320
  ...et
1321
+ }, {
1322
+ component: Ze,
1323
+ ...Xe
1294
1324
  }, {
1295
1325
  component: at,
1296
1326
  ...nt
1297
1327
  }, {
1298
- component: ge,
1328
+ component: ot,
1299
1329
  ...it
1330
+ }, {
1331
+ component: ge,
1332
+ ...rt
1300
1333
  }], G = () => [{
1301
1334
  component: he,
1302
1335
  ...Fe
@@ -1305,29 +1338,32 @@ const U = {
1305
1338
  ...Pe
1306
1339
  }, {
1307
1340
  component: ye,
1308
- ...Ae
1341
+ ...We
1309
1342
  }, {
1310
1343
  component: xe,
1311
1344
  ...Be
1312
1345
  }, {
1313
1346
  component: ve,
1314
- ...De
1347
+ ...Ue
1315
1348
  }, {
1316
- component: Ue,
1317
- ...He
1349
+ component: Ne,
1350
+ ...Le
1318
1351
  }, {
1319
1352
  component: Se,
1320
- ...Le
1353
+ ...qe
1321
1354
  }, {
1322
1355
  component: Te,
1323
- ...$e
1356
+ ...je
1357
+ }, {
1358
+ component: He,
1359
+ ...De
1324
1360
  }, {
1325
- component: qe,
1326
- ...Ne
1361
+ component: _e,
1362
+ ...$e
1327
1363
  }, {
1328
1364
  component: Ee,
1329
1365
  ...Re
1330
- }, ...ot()], rt = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
1366
+ }, ...lt()], st = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
1331
1367
  function getAndSetVariantId() {
1332
1368
  function setCookie(name, value, days) {
1333
1369
  let expires = '';
@@ -1383,7 +1419,7 @@ const U = {
1383
1419
  }).join('');
1384
1420
  styleEl.innerHTML = newStyleStr;
1385
1421
  }
1386
- }`, lt = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
1422
+ }`, dt = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
1387
1423
  if (!navigator.cookieEnabled) {
1388
1424
  return;
1389
1425
  }
@@ -1421,22 +1457,22 @@ const U = {
1421
1457
  ...t,
1422
1458
  testVariationId: t.id,
1423
1459
  id: e == null ? void 0 : e.id
1424
- })), st = ({
1460
+ })), ut = ({
1425
1461
  canTrack: e,
1426
1462
  content: t
1427
- }) => !(!(D(t).length > 0) || !e || j()), dt = (e) => e === "react" || e === "reactNative", re = dt(O), ct = () => `
1428
- window.${ie} = ${rt}
1429
- window.${oe} = ${lt}
1430
- `, ut = (e, t) => `
1463
+ }) => !(!(D(t).length > 0) || !e || j()), ct = (e) => e === "react" || e === "reactNative", re = ct(K), mt = () => `
1464
+ window.${ie} = ${st}
1465
+ window.${oe} = ${dt}
1466
+ `, pt = (e, t) => `
1431
1467
  window.${ie}(
1432
1468
  "${t}",${JSON.stringify(e)}, ${re}
1433
- )`, mt = ({
1469
+ )`, ft = ({
1434
1470
  contentId: e,
1435
1471
  variationId: t
1436
1472
  }) => `window.${oe}(
1437
1473
  "${t}", "${e}", ${re}
1438
1474
  )`;
1439
- function K(e) {
1475
+ function O(e) {
1440
1476
  return /* @__PURE__ */ h(
1441
1477
  "script",
1442
1478
  {
@@ -1449,7 +1485,7 @@ function K(e) {
1449
1485
  function Q(e) {
1450
1486
  return Math.round(e * 1e3) / 1e3;
1451
1487
  }
1452
- const pt = (e, t, n = !0) => {
1488
+ const gt = (e, t, n = !0) => {
1453
1489
  if (!(e instanceof HTMLElement))
1454
1490
  return null;
1455
1491
  let i = n ? e : e.parentElement;
@@ -1460,20 +1496,20 @@ const pt = (e, t, n = !0) => {
1460
1496
  return i;
1461
1497
  } while (i = i.parentElement);
1462
1498
  return null;
1463
- }, ft = (e) => pt(e, (t) => {
1499
+ }, ht = (e) => gt(e, (t) => {
1464
1500
  const n = t.getAttribute("builder-id") || t.id;
1465
1501
  return (n == null ? void 0 : n.indexOf("builder-")) === 0;
1466
1502
  }), X = ({
1467
1503
  event: e,
1468
1504
  target: t
1469
1505
  }) => {
1470
- const n = t.getBoundingClientRect(), i = e.clientX - n.left, l = e.clientY - n.top, c = Q(i / n.width), a = Q(l / n.height);
1506
+ const n = t.getBoundingClientRect(), i = e.clientX - n.left, l = e.clientY - n.top, u = Q(i / n.width), a = Q(l / n.height);
1471
1507
  return {
1472
- x: c,
1508
+ x: u,
1473
1509
  y: a
1474
1510
  };
1475
- }, gt = (e) => {
1476
- const t = e.target, n = t && ft(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
1511
+ }, bt = (e) => {
1512
+ const t = e.target, n = t && ht(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
1477
1513
  return {
1478
1514
  targetBuilderElement: i || void 0,
1479
1515
  metadata: {
@@ -1488,9 +1524,9 @@ const pt = (e, t, n = !0) => {
1488
1524
  builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
1489
1525
  }
1490
1526
  };
1491
- }, ht = ["svelte", "qwik", "vue"], Z = () => ht.includes(O) && (F() || te()), bt = (e) => {
1492
- var c, a;
1493
- const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = (a = e.fileUrl) != null ? a : (c = e == null ? void 0 : e.files) == null ? void 0 : c.regular;
1527
+ }, yt = ["svelte", "qwik", "vue"], Z = () => yt.includes(K) && (F() || te()), xt = (e) => {
1528
+ var u, a;
1529
+ 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;
1494
1530
  let l = "";
1495
1531
  if (i && t && n && (l += `
1496
1532
  @font-face {
@@ -1514,15 +1550,15 @@ font-weight: ${o};
1514
1550
  `.trim());
1515
1551
  }
1516
1552
  return l;
1517
- }, yt = ({
1553
+ }, vt = ({
1518
1554
  customFonts: e
1519
1555
  }) => {
1520
1556
  var t;
1521
- return ((t = e == null ? void 0 : e.map((n) => bt(n))) == null ? void 0 : t.join(" ")) || "";
1522
- }, xt = ({
1557
+ return ((t = e == null ? void 0 : e.map((n) => xt(n))) == null ? void 0 : t.join(" ")) || "";
1558
+ }, St = ({
1523
1559
  cssCode: e,
1524
1560
  contentId: t
1525
- }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", vt = `
1561
+ }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", Tt = `
1526
1562
  .builder-button {
1527
1563
  all: unset;
1528
1564
  }
@@ -1539,8 +1575,8 @@ font-weight: ${o};
1539
1575
  text-align: inherit;
1540
1576
  font-family: inherit;
1541
1577
  }
1542
- `, St = (e) => e ? "" : vt, Tt = (e) => `variant-${e}`;
1543
- function It(e) {
1578
+ `, It = (e) => e ? "" : Tt, kt = (e) => `variant-${e}`;
1579
+ function Ct(e) {
1544
1580
  var g, b, C;
1545
1581
  const t = _(null);
1546
1582
  function n(s) {
@@ -1580,11 +1616,11 @@ function It(e) {
1580
1616
  "aria-hidden": !0
1581
1617
  };
1582
1618
  }
1583
- const [c, a] = I(
1619
+ const [u, a] = I(
1584
1620
  () => e.contentWrapper || "div"
1585
1621
  );
1586
1622
  function o(s) {
1587
- return ue({
1623
+ return ce({
1588
1624
  model: e.model,
1589
1625
  trustedHosts: e.trustedHosts,
1590
1626
  callbacks: {
@@ -1606,8 +1642,8 @@ function It(e) {
1606
1642
  }
1607
1643
  })(s);
1608
1644
  }
1609
- const [u, T] = I(() => ({})), [v, R] = I(() => ({})), [k, P] = I(() => !1);
1610
- function A(s) {
1645
+ const [c, T] = I(() => ({})), [S, R] = I(() => ({})), [k, P] = I(() => !1);
1646
+ function W(s) {
1611
1647
  var d, m;
1612
1648
  if (e.builderContextSignal.content) {
1613
1649
  const f = (d = e.builderContextSignal.content) == null ? void 0 : d.testVariationId, r = (m = e.builderContextSignal.content) == null ? void 0 : m.id;
@@ -1618,19 +1654,19 @@ function It(e) {
1618
1654
  contentId: r,
1619
1655
  apiKey: e.apiKey,
1620
1656
  variationId: f !== r ? f : void 0,
1621
- ...gt(s),
1657
+ ...bt(s),
1622
1658
  unique: !k
1623
1659
  });
1624
1660
  }
1625
1661
  k || P(!0);
1626
1662
  }
1627
- function W() {
1663
+ function A() {
1628
1664
  var d, m, f;
1629
1665
  const s = (f = (m = (d = e.builderContextSignal.content) == null ? void 0 : d.data) == null ? void 0 : m.httpRequests) != null ? f : {};
1630
1666
  Object.entries(s).forEach(([r, p]) => {
1631
- if (!p || v[r] || u[r] && !F())
1667
+ if (!p || S[r] || c[r] && !F())
1632
1668
  return;
1633
- v[r] = !0;
1669
+ S[r] = !0;
1634
1670
  const y = p.replace(
1635
1671
  /{{([^}]+)}}/g,
1636
1672
  (x, B) => String(
@@ -1646,11 +1682,11 @@ function It(e) {
1646
1682
  me(y), fetch(y).then((x) => x.json()).then((x) => {
1647
1683
  n({
1648
1684
  [r]: x
1649
- }), u[r] = !0;
1685
+ }), c[r] = !0;
1650
1686
  }).catch((x) => {
1651
1687
  console.error("error fetching dynamic data", p, x);
1652
1688
  }).finally(() => {
1653
- v[r] = !1;
1689
+ S[r] = !1;
1654
1690
  });
1655
1691
  });
1656
1692
  }
@@ -1670,7 +1706,7 @@ function It(e) {
1670
1706
  );
1671
1707
  }
1672
1708
  const E = _(!1);
1673
- return E.current || (W(), w(), E.current = !0), V(() => {
1709
+ return E.current || (A(), w(), E.current = !0), V(() => {
1674
1710
  var s, d, m;
1675
1711
  if (j()) {
1676
1712
  if (F() && !e.isNestedRender && (window.addEventListener("message", o), le(), se({
@@ -1709,7 +1745,7 @@ function It(e) {
1709
1745
  const r = new URL(location.href).searchParams, p = r.get("builder.preview"), y = r.get(
1710
1746
  `builder.overrides.${p}`
1711
1747
  ), x = r.get("apiKey") || r.get("builder.space");
1712
- (p === "BUILDER_STUDIO" || p === e.model && x === e.apiKey && (!e.content || y === e.content.id)) && ce({
1748
+ (p === "BUILDER_STUDIO" || p === e.model && x === e.apiKey && (!e.content || y === e.content.id)) && ue({
1713
1749
  model: e.model || "",
1714
1750
  apiKey: e.apiKey,
1715
1751
  apiVersion: e.builderContextSignal.apiVersion,
@@ -1739,13 +1775,13 @@ function It(e) {
1739
1775
  w
1740
1776
  ));
1741
1777
  }, []), /* @__PURE__ */ h(Ie.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content || Z() ? /* @__PURE__ */ h(
1742
- c,
1778
+ u,
1743
1779
  {
1744
1780
  ref: t,
1745
- onClick: (s) => A(s),
1781
+ onClick: (s) => W(s),
1746
1782
  "builder-content-id": (g = e.builderContextSignal.content) == null ? void 0 : g.id,
1747
1783
  "builder-model": e.model,
1748
- className: Tt(
1784
+ className: kt(
1749
1785
  ((b = e.content) == null ? void 0 : b.testVariationId) || ((C = e.content) == null ? void 0 : C.id)
1750
1786
  ),
1751
1787
  style: {
@@ -1757,17 +1793,17 @@ function It(e) {
1757
1793
  }
1758
1794
  ) : null });
1759
1795
  }
1760
- function kt(e) {
1796
+ function wt(e) {
1761
1797
  const [t, n] = I(
1762
1798
  () => `
1763
- ${xt({
1799
+ ${St({
1764
1800
  cssCode: e.cssCode,
1765
1801
  contentId: e.contentId
1766
1802
  })}
1767
- ${yt({
1803
+ ${vt({
1768
1804
  customFonts: e.customFonts
1769
1805
  })}
1770
- ${St(e.isNestedRender)}
1806
+ ${It(e.isNestedRender)}
1771
1807
  `.trim()
1772
1808
  );
1773
1809
  return /* @__PURE__ */ h(
@@ -1779,15 +1815,15 @@ ${St(e.isNestedRender)}
1779
1815
  }
1780
1816
  );
1781
1817
  }
1782
- const Ct = ({
1818
+ const Vt = ({
1783
1819
  content: e,
1784
1820
  data: t,
1785
1821
  locale: n
1786
1822
  }) => {
1787
- var c, a, o;
1788
- const i = {}, l = ((c = e == null ? void 0 : e.data) == null ? void 0 : c.state) || {};
1789
- return (o = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || o.forEach((u) => {
1790
- u.name && u.defaultValue !== void 0 && (i[u.name] = u.defaultValue);
1823
+ var u, a, o;
1824
+ const i = {}, l = ((u = e == null ? void 0 : e.data) == null ? void 0 : u.state) || {};
1825
+ return (o = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || o.forEach((c) => {
1826
+ c.name && c.defaultValue !== void 0 && (i[c.name] = c.defaultValue);
1791
1827
  }), {
1792
1828
  ...i,
1793
1829
  ...l,
@@ -1796,7 +1832,7 @@ const Ct = ({
1796
1832
  locale: n
1797
1833
  } : {}
1798
1834
  };
1799
- }, wt = ({
1835
+ }, Rt = ({
1800
1836
  content: e,
1801
1837
  data: t
1802
1838
  }) => e ? {
@@ -1808,11 +1844,11 @@ const Ct = ({
1808
1844
  meta: e == null ? void 0 : e.meta
1809
1845
  } : void 0;
1810
1846
  function ee(e) {
1811
- var T, v, R, k, P, A, W, w, E;
1847
+ var T, S, R, k, P, W, A, w, E;
1812
1848
  const [t, n] = I(
1813
1849
  () => {
1814
1850
  var g, b;
1815
- return mt({
1851
+ return ft({
1816
1852
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
1817
1853
  variationId: (g = e.content) == null ? void 0 : g.testVariationId,
1818
1854
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
@@ -1826,7 +1862,7 @@ function ee(e) {
1826
1862
  rootState: g
1827
1863
  }));
1828
1864
  }
1829
- const [l, c] = I(
1865
+ const [l, u] = I(
1830
1866
  () => [
1831
1867
  ...G(),
1832
1868
  ...e.customComponents || []
@@ -1841,12 +1877,12 @@ function ee(e) {
1841
1877
  {}
1842
1878
  )
1843
1879
  ), [a, o] = I(() => ({
1844
- content: wt({
1880
+ content: Rt({
1845
1881
  content: e.content,
1846
1882
  data: e.data
1847
1883
  }),
1848
1884
  localState: void 0,
1849
- rootState: Ct({
1885
+ rootState: Vt({
1850
1886
  content: e.content,
1851
1887
  data: e.data,
1852
1888
  locale: e.locale
@@ -1871,12 +1907,12 @@ function ee(e) {
1871
1907
  BlocksWrapperProps: e.blocksWrapperProps || {},
1872
1908
  nonce: e.nonce || "",
1873
1909
  model: e.model || ""
1874
- })), u = _(!1);
1875
- if (!u.current) {
1910
+ })), c = _(!1);
1911
+ if (!c.current) {
1876
1912
  e.apiKey || pe.error(
1877
1913
  "No API key provided to `Content` component. This can cause issues. Please provide an API key using the `apiKey` prop."
1878
1914
  );
1879
- const g = (v = (T = a.content) == null ? void 0 : T.data) == null ? void 0 : v.jsCode;
1915
+ const g = (S = (T = a.content) == null ? void 0 : T.data) == null ? void 0 : S.jsCode;
1880
1916
  g && ne({
1881
1917
  code: g,
1882
1918
  context: e.context || {},
@@ -1886,7 +1922,7 @@ function ee(e) {
1886
1922
  Object.assign(a.rootState, b);
1887
1923
  },
1888
1924
  isExpression: !1
1889
- }), u.current = !0;
1925
+ }), c.current = !0;
1890
1926
  }
1891
1927
  return /* @__PURE__ */ h(
1892
1928
  we.Provider,
@@ -1895,7 +1931,7 @@ function ee(e) {
1895
1931
  registeredComponents: l
1896
1932
  },
1897
1933
  children: /* @__PURE__ */ $(
1898
- It,
1934
+ Ct,
1899
1935
  {
1900
1936
  apiHost: e.apiHost,
1901
1937
  nonce: e.nonce,
@@ -1916,7 +1952,7 @@ function ee(e) {
1916
1952
  setBuilderContextSignal: o,
1917
1953
  children: [
1918
1954
  e.isSsrAbTest ? /* @__PURE__ */ h(
1919
- K,
1955
+ O,
1920
1956
  {
1921
1957
  id: "builderio-variant-visibility",
1922
1958
  scriptStr: t,
@@ -1924,13 +1960,13 @@ function ee(e) {
1924
1960
  }
1925
1961
  ) : null,
1926
1962
  /* @__PURE__ */ h(
1927
- kt,
1963
+ wt,
1928
1964
  {
1929
1965
  nonce: e.nonce || "",
1930
1966
  isNestedRender: e.isNestedRender,
1931
1967
  contentId: (R = a.content) == null ? void 0 : R.id,
1932
1968
  cssCode: (P = (k = a.content) == null ? void 0 : k.data) == null ? void 0 : P.cssCode,
1933
- customFonts: (W = (A = a.content) == null ? void 0 : A.data) == null ? void 0 : W.customFonts
1969
+ customFonts: (A = (W = a.content) == null ? void 0 : W.data) == null ? void 0 : A.customFonts
1934
1970
  }
1935
1971
  ),
1936
1972
  /* @__PURE__ */ h(
@@ -1948,20 +1984,20 @@ function ee(e) {
1948
1984
  }
1949
1985
  );
1950
1986
  }
1951
- function Bt(e) {
1987
+ function Et(e) {
1952
1988
  var a;
1953
1989
  const [t, n] = I(
1954
- () => st({
1990
+ () => ut({
1955
1991
  canTrack: H(e.canTrack),
1956
1992
  content: e.content
1957
1993
  })
1958
1994
  );
1959
1995
  function i() {
1960
1996
  var o;
1961
- return ut(
1962
- D(e.content).map((u) => ({
1963
- id: u.testVariationId,
1964
- testRatio: u.testRatio
1997
+ return pt(
1998
+ D(e.content).map((c) => ({
1999
+ id: c.testVariationId,
2000
+ testRatio: c.testRatio
1965
2001
  })),
1966
2002
  ((o = e.content) == null ? void 0 : o.id) || ""
1967
2003
  );
@@ -1969,7 +2005,7 @@ function Bt(e) {
1969
2005
  function l() {
1970
2006
  return D(e.content).map((o) => `.variant-${o.testVariationId} { display: none; } `).join("");
1971
2007
  }
1972
- function c() {
2008
+ function u() {
1973
2009
  var o;
1974
2010
  return t ? {
1975
2011
  ...e.content,
@@ -1981,11 +2017,11 @@ function Bt(e) {
1981
2017
  }
1982
2018
  return V(() => {
1983
2019
  }, []), /* @__PURE__ */ $(z, { children: [
1984
- !e.isNestedRender && O !== "reactNative" ? /* @__PURE__ */ h(
1985
- K,
2020
+ !e.isNestedRender && K !== "reactNative" ? /* @__PURE__ */ h(
2021
+ O,
1986
2022
  {
1987
2023
  id: "builderio-init-variants-fns",
1988
- scriptStr: ct(),
2024
+ scriptStr: mt(),
1989
2025
  nonce: e.nonce || ""
1990
2026
  }
1991
2027
  ) : null,
@@ -1999,7 +2035,7 @@ function Bt(e) {
1999
2035
  }
2000
2036
  ),
2001
2037
  /* @__PURE__ */ h(
2002
- K,
2038
+ O,
2003
2039
  {
2004
2040
  id: "builderio-variants-visibility",
2005
2041
  scriptStr: i(),
@@ -2040,7 +2076,7 @@ function Bt(e) {
2040
2076
  apiHost: e.apiHost,
2041
2077
  nonce: e.nonce,
2042
2078
  isNestedRender: e.isNestedRender,
2043
- content: c(),
2079
+ content: u(),
2044
2080
  showContent: !0,
2045
2081
  model: e.model,
2046
2082
  data: e.data,
@@ -2062,6 +2098,11 @@ function Bt(e) {
2062
2098
  )
2063
2099
  ] });
2064
2100
  }
2101
+ const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2102
+ __proto__: null,
2103
+ default: Et
2104
+ }, Symbol.toStringTag, { value: "Module" }));
2065
2105
  export {
2066
- Bt as default
2106
+ O as InlinedScript,
2107
+ Dt as contentVariants
2067
2108
  };