@builder.io/sdk-react-nextjs 0.12.2 → 0.12.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/lib/{node/USE_CLIENT_BUNDLE-d30db795.js → browser/USE_CLIENT_BUNDLE-e6d429be.js} +212 -215
  2. package/lib/browser/{USE_CLIENT_BUNDLE-4b1b3c99.cjs → USE_CLIENT_BUNDLE-e9e1ee85.cjs} +3 -5
  3. package/lib/{edge/USE_SERVER_BUNDLE-70c27ea1.js → browser/USE_SERVER_BUNDLE-44c49b1e.js} +1 -1
  4. package/lib/{edge/USE_SERVER_BUNDLE-f0eeb33e.cjs → browser/USE_SERVER_BUNDLE-9bcc0ad4.cjs} +1 -1
  5. package/lib/browser/bundle-0e5cec1c.cjs +168 -0
  6. package/lib/browser/{bundle-d905bf70.js → bundle-bab67847.js} +577 -516
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.mjs +14 -14
  9. package/lib/{browser/USE_CLIENT_BUNDLE-550679f9.js → edge/USE_CLIENT_BUNDLE-8d251b8b.js} +212 -215
  10. package/lib/{node/USE_CLIENT_BUNDLE-def5165a.cjs → edge/USE_CLIENT_BUNDLE-d87c391a.cjs} +3 -5
  11. package/lib/{node/USE_SERVER_BUNDLE-a5db98bc.cjs → edge/USE_SERVER_BUNDLE-816ab6e4.cjs} +1 -1
  12. package/lib/{node/USE_SERVER_BUNDLE-610c83b3.js → edge/USE_SERVER_BUNDLE-c0911af0.js} +1 -1
  13. package/lib/edge/{bundle-834dbf29.js → bundle-28d9d04c.js} +1022 -961
  14. package/lib/edge/{bundle-25fa71b1.cjs → bundle-e64fe0fd.cjs} +37 -37
  15. package/lib/edge/index.cjs +1 -1
  16. package/lib/edge/index.mjs +14 -14
  17. package/lib/{edge/USE_CLIENT_BUNDLE-aa38a343.js → node/USE_CLIENT_BUNDLE-75f921e2.js} +212 -215
  18. package/lib/{edge/USE_CLIENT_BUNDLE-edb18eb8.cjs → node/USE_CLIENT_BUNDLE-ee5a9d6f.cjs} +3 -5
  19. package/lib/{browser/USE_SERVER_BUNDLE-6234c5ea.cjs → node/USE_SERVER_BUNDLE-793c12c9.cjs} +1 -1
  20. package/lib/{browser/USE_SERVER_BUNDLE-464dccd7.js → node/USE_SERVER_BUNDLE-86d90afe.js} +1 -1
  21. package/lib/node/{bundle-1f73ead0.js → bundle-031e3608.js} +352 -291
  22. package/lib/node/{bundle-4efd9623.cjs → bundle-72df28b3.cjs} +10 -10
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +14 -14
  25. package/package.json +1 -1
  26. package/types/cjs/blocks/button/button.types.d.ts +2 -1
  27. package/types/cjs/blocks/columns/columns.types.d.ts +3 -3
  28. package/types/cjs/blocks/symbol/symbol.types.d.ts +2 -2
  29. package/types/cjs/components/block/block.d.ts +1 -0
  30. package/types/cjs/components/block/components/block-wrapper.d.ts +1 -0
  31. package/types/cjs/components/block/components/component-ref/component-ref.helpers.d.ts +8 -1
  32. package/types/cjs/components/block/components/repeated-block.d.ts +3 -5
  33. package/types/cjs/components/blocks/blocks.types.d.ts +1 -0
  34. package/types/cjs/components/content-variants/content-variants.types.d.ts +6 -2
  35. package/types/cjs/constants/sdk-version.d.ts +1 -1
  36. package/types/cjs/functions/get-block-properties.d.ts +5 -1
  37. package/types/cjs/functions/get-class-prop-name.d.ts +1 -0
  38. package/types/cjs/functions/get-style.d.ts +12 -0
  39. package/types/cjs/functions/transform-block-properties.d.ts +7 -5
  40. package/types/cjs/functions/transform-style-property.d.ts +7 -0
  41. package/types/cjs/types/builder-block.d.ts +1 -0
  42. package/types/cjs/types/builder-props.d.ts +3 -0
  43. package/types/esm/blocks/button/button.types.d.ts +2 -1
  44. package/types/esm/blocks/columns/columns.types.d.ts +3 -3
  45. package/types/esm/blocks/symbol/symbol.types.d.ts +2 -2
  46. package/types/esm/components/block/block.d.ts +1 -0
  47. package/types/esm/components/block/components/block-wrapper.d.ts +1 -0
  48. package/types/esm/components/block/components/component-ref/component-ref.helpers.d.ts +8 -1
  49. package/types/esm/components/block/components/repeated-block.d.ts +3 -5
  50. package/types/esm/components/blocks/blocks.types.d.ts +1 -0
  51. package/types/esm/components/content-variants/content-variants.types.d.ts +6 -2
  52. package/types/esm/constants/sdk-version.d.ts +1 -1
  53. package/types/esm/functions/get-block-properties.d.ts +5 -1
  54. package/types/esm/functions/get-class-prop-name.d.ts +1 -0
  55. package/types/esm/functions/get-style.d.ts +12 -0
  56. package/types/esm/functions/transform-block-properties.d.ts +7 -5
  57. package/types/esm/functions/transform-style-property.d.ts +7 -0
  58. package/types/esm/types/builder-block.d.ts +1 -0
  59. package/types/esm/types/builder-props.d.ts +3 -0
  60. package/lib/browser/bundle-1d763be7.cjs +0 -168
@@ -1,43 +1,39 @@
1
1
  "use client";
2
- import { jsxs as w, Fragment as s, jsx as t } from "react/jsx-runtime";
3
- import { i as Y, g as U, a as O, b as E, c as R, d as Z, e as P, f as H, _ as V, h as p, l as ee, j as te, k as D, m as ne, n as ie, r as ae, s as ce, o as le, p as re, q as oe } from "./bundle-d905bf70.js";
4
- import { useRef as T, useState as x, useEffect as f, createContext as de, createElement as se } from "react";
5
- import { p as ue } from "./USE_SERVER_BUNDLE-464dccd7.js";
6
- import { useRouter as me } from "next/navigation";
7
- function ke(e) {
8
- return /* @__PURE__ */ w(s, { children: [
9
- e.link ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
10
- "a",
11
- {
12
- ...e.attributes,
13
- href: e.link,
14
- target: e.openLinkInNewTab ? "_blank" : void 0,
15
- role: "button",
16
- children: e.text
17
- }
18
- ) }) : /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
19
- "button",
20
- {
21
- ...e.attributes,
22
- style: e.attributes.style,
23
- className: e.attributes.className + " button-fdf49de0",
24
- children: e.text
25
- }
26
- ) }),
27
- /* @__PURE__ */ t("style", { children: `.button-fdf49de0 {
28
- all: unset;
29
- }` })
30
- ] });
31
- }
32
- function ge(e) {
33
- return /* @__PURE__ */ t(s, { children: Y(e.TagName) ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ t(s, { children: typeof e.TagName == "string" ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
2
+ import { jsx as i, Fragment as h, jsxs as E } from "react/jsx-runtime";
3
+ import { i as p, g as D, a as $, b as O, c as w, d as R, e as ee, f as P, h as H, _ as V, j as te, l as ne, k as ie, m as U, n as ae, o as ce, r as re, s as le, p as oe, q as de, t as se } from "./bundle-28d9d04c.js";
4
+ import { useRef as T, useState as x, useEffect as f, createContext as ue, createElement as me } from "react";
5
+ import { p as ge } from "./USE_SERVER_BUNDLE-c0911af0.js";
6
+ import { useRouter as be } from "next/navigation";
7
+ function J(e) {
8
+ return /* @__PURE__ */ i(h, { children: p(e.TagName) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ i(h, { children: typeof e.TagName == "string" ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
34
9
  }
35
10
  function Ce(e) {
36
- return /* @__PURE__ */ t(
37
- ge,
11
+ return /* @__PURE__ */ i(
12
+ J,
13
+ {
14
+ TagName: e.link ? e.builderLinkComponent || "a" : "button",
15
+ attributes: {
16
+ ...e.attributes,
17
+ [D()]: `${e.link ? "" : "builder-button"} ${e.attributes[D()] || ""}`,
18
+ ...e.link ? {
19
+ href: e.link,
20
+ target: e.openLinkInNewTab ? "_blank" : void 0,
21
+ role: "link"
22
+ } : {
23
+ role: "button"
24
+ }
25
+ },
26
+ actionAttributes: {},
27
+ children: e.text
28
+ }
29
+ );
30
+ }
31
+ function we(e) {
32
+ return /* @__PURE__ */ i(
33
+ J,
38
34
  {
39
35
  TagName: e.Wrapper,
40
- attributes: U({
36
+ attributes: $({
41
37
  block: e.block,
42
38
  context: e.context
43
39
  }),
@@ -53,13 +49,13 @@ function Ce(e) {
53
49
  }
54
50
  );
55
51
  }
56
- function we(e) {
57
- return /* @__PURE__ */ t(
52
+ function Ee(e) {
53
+ return /* @__PURE__ */ i(
58
54
  e.Wrapper,
59
55
  {
60
56
  ...e.wrapperProps,
61
57
  attributes: e.includeBlockProps ? {
62
- ...U({
58
+ ...$({
63
59
  block: e.block,
64
60
  context: e.context
65
61
  }),
@@ -75,14 +71,14 @@ function we(e) {
75
71
  }
76
72
  );
77
73
  }
78
- function Ee(e) {
74
+ function Ie(e) {
79
75
  function c() {
80
- var r;
81
- return "builder-blocks" + ((r = e.blocks) != null && r.length ? "" : " no-blocks");
76
+ var l;
77
+ return "builder-blocks" + ((l = e.blocks) != null && l.length ? "" : " no-blocks");
82
78
  }
83
- function u() {
84
- var r, m;
85
- E() && !((r = e.blocks) != null && r.length) && ((m = window.parent) == null || m.postMessage(
79
+ function s() {
80
+ var l, u;
81
+ w() && !((l = e.blocks) != null && l.length) && ((u = window.parent) == null || u.postMessage(
86
82
  {
87
83
  type: "builder.clickEmptyBlocks",
88
84
  data: {
@@ -94,8 +90,8 @@ function Ee(e) {
94
90
  ));
95
91
  }
96
92
  function v() {
97
- var r, m;
98
- E() && !((r = e.blocks) != null && r.length) && ((m = window.parent) == null || m.postMessage(
93
+ var l, u;
94
+ w() && !((l = e.blocks) != null && l.length) && ((u = window.parent) == null || u.postMessage(
99
95
  {
100
96
  type: "builder.hoverEmptyBlocks",
101
97
  data: {
@@ -106,48 +102,48 @@ function Ee(e) {
106
102
  "*"
107
103
  ));
108
104
  }
109
- return /* @__PURE__ */ w(s, { children: [
110
- /* @__PURE__ */ t(
105
+ return /* @__PURE__ */ E(h, { children: [
106
+ /* @__PURE__ */ i(
111
107
  e.BlocksWrapper,
112
108
  {
113
109
  className: c() + " props-blocks-wrapper-4f2c12d8",
114
110
  "builder-path": e.path,
115
111
  "builder-parent-id": e.parent,
116
112
  style: e.styleProp,
117
- onClick: (r) => u(),
118
- onMouseEnter: (r) => v(),
119
- onKeyPress: (r) => u(),
113
+ onClick: (l) => s(),
114
+ onMouseEnter: (l) => v(),
115
+ onKeyPress: (l) => s(),
120
116
  ...e.BlocksWrapperProps,
121
117
  children: e.children
122
118
  }
123
119
  ),
124
- /* @__PURE__ */ t("style", { children: `.props-blocks-wrapper-4f2c12d8 {
120
+ /* @__PURE__ */ i("style", { children: `.props-blocks-wrapper-4f2c12d8 {
125
121
  display: flex;
126
122
  flex-direction: column;
127
123
  align-items: stretch;
128
124
  }` })
129
125
  ] });
130
126
  }
131
- function Ie(e) {
132
- return /* @__PURE__ */ t("span", { children: e.children });
133
- }
134
127
  function Re(e) {
135
- var r, m, S, y;
128
+ return /* @__PURE__ */ i("span", { children: e.children });
129
+ }
130
+ function Pe(e) {
131
+ var l, u, S, y;
136
132
  function c() {
137
- var g;
133
+ var m;
138
134
  const o = e.image || e.src;
139
135
  if (!o || // We can auto add srcset for cdn.builder.io and shopify
140
136
  // images, otherwise you can supply this prop manually
141
137
  !(o.match(/builder\.io/) || o.match(/cdn\.shopify\.com/)))
142
138
  return e.srcset;
143
- if (e.srcset && ((g = e.image) != null && g.includes("builder.io/api/v1/image"))) {
139
+ if (e.srcset && ((m = e.image) != null && m.includes("builder.io/api/v1/image"))) {
144
140
  if (!e.srcset.includes(e.image.split("?")[0]))
145
141
  return console.debug("Removed given srcset"), R(o);
146
142
  } else if (e.image && !e.srcset)
147
143
  return R(o);
148
144
  return R(o);
149
145
  }
150
- function u() {
146
+ function s() {
151
147
  var b;
152
148
  return (b = c == null ? void 0 : c()) != null && b.match(/builder\.io/) && !e.noWebp ? c().replace(/\?/g, "?format=webp&") : "";
153
149
  }
@@ -161,11 +157,11 @@ function Re(e) {
161
157
  };
162
158
  return e.aspectRatio ? b : void 0;
163
159
  }
164
- return /* @__PURE__ */ w(s, { children: [
165
- /* @__PURE__ */ w(s, { children: [
166
- /* @__PURE__ */ w("picture", { children: [
167
- u() ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t("source", { type: "image/webp", srcSet: u() }) }) : null,
168
- /* @__PURE__ */ t(
160
+ return /* @__PURE__ */ E(h, { children: [
161
+ /* @__PURE__ */ E(h, { children: [
162
+ /* @__PURE__ */ E("picture", { children: [
163
+ s() ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i("source", { type: "image/webp", srcSet: s() }) }) : null,
164
+ /* @__PURE__ */ i(
169
165
  "img",
170
166
  {
171
167
  loading: "lazy",
@@ -183,7 +179,7 @@ function Re(e) {
183
179
  }
184
180
  )
185
181
  ] }),
186
- e.aspectRatio && !((m = (r = e.builderBlock) == null ? void 0 : r.children) != null && m.length && e.fitContent) ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
182
+ e.aspectRatio && !((u = (l = e.builderBlock) == null ? void 0 : l.children) != null && u.length && e.fitContent) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
187
183
  "div",
188
184
  {
189
185
  className: "builder-image-sizer div-40c70c9b",
@@ -192,10 +188,10 @@ function Re(e) {
192
188
  }
193
189
  }
194
190
  ) }) : null,
195
- (y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */ t(s, { children: e.children }) : null,
196
- !e.fitContent && e.children ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
191
+ (y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */ i(h, { children: e.children }) : null,
192
+ !e.fitContent && e.children ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i("div", { className: "div-40c70c9b-2", children: e.children }) }) : null
197
193
  ] }),
198
- /* @__PURE__ */ t("style", { children: `.img-40c70c9b {
194
+ /* @__PURE__ */ i("style", { children: `.img-40c70c9b {
199
195
  opacity: 1;
200
196
  transition: opacity 0.2s ease-in-out;
201
197
  }.div-40c70c9b {
@@ -214,8 +210,8 @@ function Re(e) {
214
210
  }` })
215
211
  ] });
216
212
  }
217
- function Pe(e) {
218
- return /* @__PURE__ */ t(
213
+ function Te(e) {
214
+ return /* @__PURE__ */ i(
219
215
  "section",
220
216
  {
221
217
  ...e.attributes,
@@ -235,8 +231,8 @@ function Pe(e) {
235
231
  }
236
232
  );
237
233
  }
238
- function Te(e) {
239
- const c = T(null), [u, v] = x(() => []), [r, m] = x(() => []);
234
+ function Ne(e) {
235
+ const c = T(null), [s, v] = x(() => []), [l, u] = x(() => []);
240
236
  return f(() => {
241
237
  var y;
242
238
  if (!((y = c.current) != null && y.getElementsByTagName) || typeof window > "u")
@@ -245,26 +241,26 @@ function Te(e) {
245
241
  for (let b = 0; b < S.length; b++) {
246
242
  const o = S[b];
247
243
  if (o.src) {
248
- if (u.includes(o.src))
244
+ if (s.includes(o.src))
249
245
  continue;
250
- u.push(o.src);
251
- const g = document.createElement("script");
252
- g.async = !0, g.src = o.src, document.head.appendChild(g);
246
+ s.push(o.src);
247
+ const m = document.createElement("script");
248
+ m.async = !0, m.src = o.src, document.head.appendChild(m);
253
249
  } else if (!o.type || [
254
250
  "text/javascript",
255
251
  "application/javascript",
256
252
  "application/ecmascript"
257
253
  ].includes(o.type)) {
258
- if (r.includes(o.innerText))
254
+ if (l.includes(o.innerText))
259
255
  continue;
260
256
  try {
261
- r.push(o.innerText), new Function(o.innerText)();
262
- } catch (g) {
263
- console.warn("`CustomCode`: Error running script:", g);
257
+ l.push(o.innerText), new Function(o.innerText)();
258
+ } catch (m) {
259
+ console.warn("`CustomCode`: Error running script:", m);
264
260
  }
265
261
  }
266
262
  }
267
- }, []), /* @__PURE__ */ t(
263
+ }, []), /* @__PURE__ */ i(
268
264
  "div",
269
265
  {
270
266
  ref: c,
@@ -273,21 +269,21 @@ function Te(e) {
273
269
  }
274
270
  );
275
271
  }
276
- function Ne(e) {
277
- const c = T(null), [u, v] = x(() => []), [r, m] = x(() => []), [S, y] = x(() => !1);
272
+ function Be(e) {
273
+ const c = T(null), [s, v] = x(() => []), [l, u] = x(() => []), [S, y] = x(() => !1);
278
274
  function b() {
279
275
  if (!c.current || !c.current.getElementsByTagName)
280
276
  return;
281
277
  const o = c.current.getElementsByTagName("script");
282
- for (let g = 0; g < o.length; g++) {
283
- const k = o[g];
284
- if (k.src && !u.includes(k.src)) {
285
- u.push(k.src);
278
+ for (let m = 0; m < o.length; m++) {
279
+ const k = o[m];
280
+ if (k.src && !s.includes(k.src)) {
281
+ s.push(k.src);
286
282
  const C = document.createElement("script");
287
283
  C.async = !0, C.src = k.src, document.head.appendChild(C);
288
- } else if (Z(k) && !r.includes(k.innerText))
284
+ } else if (ee(k) && !l.includes(k.innerText))
289
285
  try {
290
- r.push(k.innerText), new Function(k.innerText)();
286
+ l.push(k.innerText), new Function(k.innerText)();
291
287
  } catch (C) {
292
288
  console.warn("`Embed`: Error running script:", C);
293
289
  }
@@ -295,7 +291,7 @@ function Ne(e) {
295
291
  }
296
292
  return f(() => {
297
293
  c.current && !S && (y(!0), b());
298
- }, [c.current, S]), /* @__PURE__ */ t(
294
+ }, [c.current, S]), /* @__PURE__ */ i(
299
295
  "div",
300
296
  {
301
297
  className: "builder-embed",
@@ -304,8 +300,8 @@ function Ne(e) {
304
300
  }
305
301
  );
306
302
  }
307
- function Be(e) {
308
- return /* @__PURE__ */ t(
303
+ function Le(e) {
304
+ return /* @__PURE__ */ i(
309
305
  "img",
310
306
  {
311
307
  style: {
@@ -316,11 +312,11 @@ function Be(e) {
316
312
  src: e.imgSrc || e.image,
317
313
  ...e.attributes
318
314
  },
319
- E() && e.imgSrc || "default-key"
315
+ w() && e.imgSrc || "default-key"
320
316
  );
321
317
  }
322
- function Le(e) {
323
- var v, r, m, S, y, b, o;
318
+ function je(e) {
319
+ var v, l, u, S, y, b, o;
324
320
  function c() {
325
321
  return {
326
322
  ...e.autoPlay === !0 ? {
@@ -340,23 +336,23 @@ function Le(e) {
340
336
  } : {}
341
337
  };
342
338
  }
343
- function u() {
339
+ function s() {
344
340
  return {
345
341
  ...c()
346
342
  };
347
343
  }
348
- return /* @__PURE__ */ w(
344
+ return /* @__PURE__ */ E(
349
345
  "div",
350
346
  {
351
347
  style: {
352
348
  position: "relative"
353
349
  },
354
350
  children: [
355
- /* @__PURE__ */ t(
351
+ /* @__PURE__ */ i(
356
352
  "video",
357
353
  {
358
354
  className: "builder-video",
359
- ...u(),
355
+ ...s(),
360
356
  preload: e.preload || "metadata",
361
357
  style: {
362
358
  width: "100%",
@@ -374,10 +370,10 @@ function Le(e) {
374
370
  },
375
371
  src: e.video || "no-src",
376
372
  poster: e.posterImage,
377
- children: e.lazyLoad ? null : /* @__PURE__ */ t("source", { type: "video/mp4", src: e.video })
373
+ children: e.lazyLoad ? null : /* @__PURE__ */ i("source", { type: "video/mp4", src: e.video })
378
374
  }
379
375
  ),
380
- e.aspectRatio && !(e.fitContent && ((m = (r = e.builderBlock) == null ? void 0 : r.children) != null && m.length)) ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
376
+ e.aspectRatio && !(e.fitContent && ((u = (l = e.builderBlock) == null ? void 0 : l.children) != null && u.length)) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
381
377
  "div",
382
378
  {
383
379
  style: {
@@ -388,7 +384,7 @@ function Le(e) {
388
384
  }
389
385
  }
390
386
  ) }) : null,
391
- (y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
387
+ (y = (S = e.builderBlock) == null ? void 0 : S.children) != null && y.length && e.fitContent ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
392
388
  "div",
393
389
  {
394
390
  style: {
@@ -399,7 +395,7 @@ function Le(e) {
399
395
  children: e.children
400
396
  }
401
397
  ) }) : null,
402
- (o = (b = e.builderBlock) == null ? void 0 : b.children) != null && o.length && !e.fitContent ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ t(
398
+ (o = (b = e.builderBlock) == null ? void 0 : b.children) != null && o.length && !e.fitContent ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(
403
399
  "div",
404
400
  {
405
401
  style: {
@@ -420,7 +416,7 @@ function Le(e) {
420
416
  }
421
417
  );
422
418
  }
423
- const he = de({
419
+ const he = ue({
424
420
  content: null,
425
421
  context: {},
426
422
  localState: void 0,
@@ -434,38 +430,38 @@ const he = de({
434
430
  BlocksWrapper: "div",
435
431
  BlocksWrapperProps: {}
436
432
  });
437
- function je(e) {
438
- var W, F, K, z, A, M, _;
439
- const c = T(null), [u, v] = x(() => 0);
433
+ function We(e) {
434
+ var W, F, K, A, z, M, _;
435
+ const c = T(null), [s, v] = x(() => 0);
440
436
  x(() => !0);
441
- function r(n) {
442
- var a, l;
443
- const i = {
437
+ function l(t) {
438
+ var a, r;
439
+ const n = {
444
440
  ...e.builderContextSignal.rootState,
445
- ...n
441
+ ...t
446
442
  };
447
- e.builderContextSignal.rootSetState ? (l = (a = e.builderContextSignal).rootSetState) == null || l.call(a, i) : e.builderContextSignal.rootState = i;
443
+ e.builderContextSignal.rootSetState ? (r = (a = e.builderContextSignal).rootSetState) == null || r.call(a, n) : e.builderContextSignal.rootState = n;
448
444
  }
449
- function m(n) {
450
- var a, l, d, h, q;
451
- const i = {
445
+ function u(t) {
446
+ var a, r, d, g, q;
447
+ const n = {
452
448
  ...e.builderContextSignal.content,
453
- ...n,
449
+ ...t,
454
450
  data: {
455
451
  ...(a = e.builderContextSignal.content) == null ? void 0 : a.data,
456
- ...n == null ? void 0 : n.data
452
+ ...t == null ? void 0 : t.data
457
453
  },
458
454
  meta: {
459
- ...(l = e.builderContextSignal.content) == null ? void 0 : l.meta,
460
- ...n == null ? void 0 : n.meta,
461
- breakpoints: ((d = n == null ? void 0 : n.meta) == null ? void 0 : d.breakpoints) || ((q = (h = e.builderContextSignal.content) == null ? void 0 : h.meta) == null ? void 0 : q.breakpoints)
455
+ ...(r = e.builderContextSignal.content) == null ? void 0 : r.meta,
456
+ ...t == null ? void 0 : t.meta,
457
+ breakpoints: ((d = t == null ? void 0 : t.meta) == null ? void 0 : d.breakpoints) || ((q = (g = e.builderContextSignal.content) == null ? void 0 : g.meta) == null ? void 0 : q.breakpoints)
462
458
  }
463
459
  };
464
- ue({
465
- value: i,
466
- key: i.id
460
+ ge({
461
+ value: n,
462
+ key: n.id
467
463
  }).then(() => {
468
- X.refresh();
464
+ Z.refresh();
469
465
  });
470
466
  }
471
467
  x(() => 0);
@@ -474,63 +470,63 @@ function je(e) {
474
470
  ), [b, o] = x(
475
471
  () => e.contentWrapper || "div"
476
472
  );
477
- function g(n) {
473
+ function m(t) {
478
474
  var a;
479
- if (!te(e.trustedHosts, n))
475
+ if (!ie(e.trustedHosts, t))
480
476
  return;
481
- const { data: i } = n;
482
- if (i)
483
- switch (i.type) {
477
+ const { data: n } = t;
478
+ if (n)
479
+ switch (n.type) {
484
480
  case "builder.configureSdk": {
485
- const l = i.data, { breakpoints: d, contentId: h } = l;
486
- if (!h || h !== ((a = e.builderContextSignal.content) == null ? void 0 : a.id))
481
+ const r = n.data, { breakpoints: d, contentId: g } = r;
482
+ if (!g || g !== ((a = e.builderContextSignal.content) == null ? void 0 : a.id))
487
483
  return;
488
- d && m({
484
+ d && u({
489
485
  meta: {
490
486
  breakpoints: d
491
487
  }
492
- }), v(u + 1);
488
+ }), v(s + 1);
493
489
  break;
494
490
  }
495
491
  case "builder.contentUpdate": {
496
- const l = i.data, d = l.key || l.alias || l.entry || l.modelName, h = l.data;
497
- d === e.model && (m(h), v(u + 1));
492
+ const r = n.data, d = r.key || r.alias || r.entry || r.modelName, g = r.data;
493
+ d === e.model && (u(g), v(s + 1));
498
494
  break;
499
495
  }
500
496
  }
501
497
  }
502
498
  function k() {
503
- var i, a;
504
- const n = (a = (i = e.builderContextSignal.content) == null ? void 0 : i.data) == null ? void 0 : a.jsCode;
505
- n && D({
506
- code: n,
499
+ var n, a;
500
+ const t = (a = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : a.jsCode;
501
+ t && U({
502
+ code: t,
507
503
  context: e.context || {},
508
504
  localState: void 0,
509
505
  rootState: e.builderContextSignal.rootState,
510
506
  rootSetState: e.builderContextSignal.rootSetState
511
507
  });
512
508
  }
513
- const [C, be] = x(() => ({})), [N, J] = x(() => !1);
514
- function $(n) {
515
- var i, a;
509
+ const [C, fe] = x(() => ({})), [N, G] = x(() => !1);
510
+ function Q(t) {
511
+ var n, a;
516
512
  if (e.builderContextSignal.content) {
517
- const l = (i = e.builderContextSignal.content) == null ? void 0 : i.testVariationId, d = (a = e.builderContextSignal.content) == null ? void 0 : a.id;
513
+ const r = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (a = e.builderContextSignal.content) == null ? void 0 : a.id;
518
514
  V({
519
515
  type: "click",
520
516
  canTrack: H(e.canTrack),
521
517
  contentId: d,
522
518
  apiKey: e.apiKey,
523
- variationId: l !== d ? l : void 0,
524
- ...ne(n),
519
+ variationId: r !== d ? r : void 0,
520
+ ...ae(t),
525
521
  unique: !N
526
522
  });
527
523
  }
528
- N || J(!0);
524
+ N || G(!0);
529
525
  }
530
- function G(n) {
531
- return n.replace(
526
+ function X(t) {
527
+ return t.replace(
532
528
  /{{([^}]+)}}/g,
533
- (i, a) => D({
529
+ (n, a) => U({
534
530
  code: a,
535
531
  context: e.context || {},
536
532
  localState: void 0,
@@ -539,38 +535,38 @@ function je(e) {
539
535
  })
540
536
  );
541
537
  }
542
- function Q({ url: n, key: i }) {
543
- oe(n).then((a) => a.json()).then((a) => {
544
- var d, h;
545
- const l = {
538
+ function Y({ url: t, key: n }) {
539
+ se(t).then((a) => a.json()).then((a) => {
540
+ var d, g;
541
+ const r = {
546
542
  ...e.builderContextSignal.rootState,
547
- [i]: a
543
+ [n]: a
548
544
  };
549
- (h = (d = e.builderContextSignal).rootSetState) == null || h.call(d, l), C[i] = !0;
545
+ (g = (d = e.builderContextSignal).rootSetState) == null || g.call(d, r), C[n] = !0;
550
546
  }).catch((a) => {
551
- console.error("error fetching dynamic data", n, a);
547
+ console.error("error fetching dynamic data", t, a);
552
548
  });
553
549
  }
554
550
  function B() {
555
- var i, a;
556
- const n = ((a = (i = e.builderContextSignal.content) == null ? void 0 : i.data) == null ? void 0 : a.httpRequests) ?? {};
557
- Object.entries(n).forEach(([l, d]) => {
558
- if (d && (!C[l] || E())) {
559
- const h = G(d);
560
- Q({
561
- url: h,
562
- key: l
551
+ var n, a;
552
+ const t = ((a = (n = e.builderContextSignal.content) == null ? void 0 : n.data) == null ? void 0 : a.httpRequests) ?? {};
553
+ Object.entries(t).forEach(([r, d]) => {
554
+ if (d && (!C[r] || w())) {
555
+ const g = X(d);
556
+ Y({
557
+ url: g,
558
+ key: r
563
559
  });
564
560
  }
565
561
  });
566
562
  }
567
563
  function I() {
568
- E() && window.dispatchEvent(
564
+ w() && window.dispatchEvent(
569
565
  new CustomEvent(
570
566
  "builder:component:stateChange",
571
567
  {
572
568
  detail: {
573
- state: ie(e.builderContextSignal.rootState),
569
+ state: ce(e.builderContextSignal.rootState),
574
570
  ref: {
575
571
  name: e.model
576
572
  }
@@ -579,8 +575,8 @@ function je(e) {
579
575
  )
580
576
  );
581
577
  }
582
- function L(n) {
583
- v(u + 1), window.addEventListener("message", g), ae(), ce({
578
+ function L(t) {
579
+ v(s + 1), window.addEventListener("message", m), re(), le({
584
580
  ...e.locale ? {
585
581
  locale: e.locale
586
582
  } : {},
@@ -595,74 +591,74 @@ function je(e) {
595
591
  } : {}
596
592
  }), Object.values(
597
593
  e.builderContextSignal.componentInfos
598
- ).forEach((i) => {
599
- var l;
600
- const a = le(i);
601
- (l = window.parent) == null || l.postMessage(a, "*");
594
+ ).forEach((n) => {
595
+ var r;
596
+ const a = oe(n);
597
+ (r = window.parent) == null || r.postMessage(a, "*");
602
598
  }), window.addEventListener(
603
599
  "builder:component:stateChangeListenerActivated",
604
600
  I
605
601
  );
606
602
  }
607
- function j(n) {
608
- const i = new URL(location.href).searchParams, a = i.get("builder.preview"), l = i.get(
603
+ function j(t) {
604
+ const n = new URL(location.href).searchParams, a = n.get("builder.preview"), r = n.get(
609
605
  `builder.preview.${a}`
610
- ), d = i.get("apiKey") || i.get("builder.space");
611
- a === e.model && d === e.apiKey && (!e.content || l === e.content.id) && re({
606
+ ), d = n.get("apiKey") || n.get("builder.space");
607
+ a === e.model && d === e.apiKey && (!e.content || r === e.content.id) && de({
612
608
  model: e.model,
613
609
  apiKey: e.apiKey,
614
610
  apiVersion: e.builderContextSignal.apiVersion
615
- }).then((h) => {
616
- h && m(h);
611
+ }).then((g) => {
612
+ g && u(g);
617
613
  });
618
614
  }
619
- const X = me();
615
+ const Z = be();
620
616
  return f(() => {
621
- var n;
622
- return (n = c.current) == null || n.addEventListener(
617
+ var t;
618
+ return (t = c.current) == null || t.addEventListener(
623
619
  "initeditingbldr",
624
620
  L
625
621
  ), () => {
626
- var i;
627
- return (i = c.current) == null ? void 0 : i.removeEventListener(
622
+ var n;
623
+ return (n = c.current) == null ? void 0 : n.removeEventListener(
628
624
  "initeditingbldr",
629
625
  L
630
626
  );
631
627
  };
632
628
  }, []), f(() => {
633
- var n;
634
- return (n = c.current) == null || n.addEventListener(
629
+ var t;
630
+ return (t = c.current) == null || t.addEventListener(
635
631
  "initpreviewingbldr",
636
632
  j
637
633
  ), () => {
638
- var i;
639
- return (i = c.current) == null ? void 0 : i.removeEventListener(
634
+ var n;
635
+ return (n = c.current) == null ? void 0 : n.removeEventListener(
640
636
  "initpreviewingbldr",
641
637
  j
642
638
  );
643
639
  };
644
640
  }, []), f(() => {
645
- var n, i;
641
+ var t, n;
646
642
  if (P()) {
647
- if (E() && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && H(e.canTrack)) {
648
- const l = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, d = (i = e.builderContextSignal.content) == null ? void 0 : i.id, h = e.apiKey;
643
+ if (w() && c.current && c.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && H(e.canTrack)) {
644
+ const r = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, d = (n = e.builderContextSignal.content) == null ? void 0 : n.id, g = e.apiKey;
649
645
  V({
650
646
  type: "impression",
651
647
  canTrack: !0,
652
648
  contentId: d,
653
- apiKey: h,
654
- variationId: l !== d ? l : void 0
649
+ apiKey: g,
650
+ variationId: r !== d ? r : void 0
655
651
  });
656
652
  }
657
- p() && c.current;
653
+ te() && c.current;
658
654
  }
659
655
  }, []), f(() => {
660
- e.apiKey || ee.error(
656
+ e.apiKey || ne.error(
661
657
  "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
662
658
  ), k(), B(), I();
663
659
  }, []), f(() => {
664
660
  }, [e.content]), f(() => {
665
- P() && (window.removeEventListener("message", g), window.addEventListener("message", g));
661
+ P() && (window.removeEventListener("message", m), window.addEventListener("message", m));
666
662
  }, [S]), f(() => {
667
663
  k();
668
664
  }, [
@@ -670,26 +666,26 @@ function je(e) {
670
666
  e.builderContextSignal.rootState
671
667
  ]), f(() => {
672
668
  B();
673
- }, [(z = (K = e.builderContextSignal.content) == null ? void 0 : K.data) == null ? void 0 : z.httpRequests]), f(() => {
669
+ }, [(A = (K = e.builderContextSignal.content) == null ? void 0 : K.data) == null ? void 0 : A.httpRequests]), f(() => {
674
670
  I();
675
671
  }, [e.builderContextSignal.rootState]), f(() => {
676
- e.data && r(e.data);
672
+ e.data && l(e.data);
677
673
  }, [e.data]), f(() => {
678
- e.locale && r({
674
+ e.locale && l({
679
675
  locale: e.locale
680
676
  });
681
677
  }, [e.locale]), f(() => () => {
682
- P() && (window.removeEventListener("message", g), window.removeEventListener(
678
+ P() && (window.removeEventListener("message", m), window.removeEventListener(
683
679
  "builder:component:stateChangeListenerActivated",
684
680
  I
685
681
  ));
686
- }, []), /* @__PURE__ */ t(he.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ t(s, { children: /* @__PURE__ */ se(
682
+ }, []), /* @__PURE__ */ i(he.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ me(
687
683
  b,
688
684
  {
689
- key: u,
685
+ key: s,
690
686
  ref: c,
691
- onClick: (n) => $(n),
692
- "builder-content-id": (A = e.builderContextSignal.content) == null ? void 0 : A.id,
687
+ onClick: (t) => Q(t),
688
+ "builder-content-id": (z = e.builderContextSignal.content) == null ? void 0 : z.id,
693
689
  "builder-model": e.model,
694
690
  ...e.showContent ? {} : {
695
691
  hidden: !0,
@@ -702,16 +698,17 @@ function je(e) {
702
698
  ) }) : null });
703
699
  }
704
700
  export {
705
- Ce as B,
706
- Te as C,
707
- Ne as E,
708
- Ie as F,
709
- we as I,
710
- Pe as S,
711
- Le as V,
712
- Ee as a,
713
- ke as b,
714
- Re as c,
715
- Be as d,
716
- je as e
701
+ we as B,
702
+ Ne as C,
703
+ J as D,
704
+ Be as E,
705
+ Re as F,
706
+ Ee as I,
707
+ Te as S,
708
+ je as V,
709
+ Ie as a,
710
+ Ce as b,
711
+ Pe as c,
712
+ Le as d,
713
+ We as e
717
714
  };