@builder.io/sdk-react 0.6.4 → 0.7.1-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/lib/browser/index.cjs +25 -25
  2. package/lib/browser/index.mjs +617 -587
  3. package/lib/{node/server-entry-f7504f89.mjs → browser/server-entry-13b7e1e6.mjs} +208 -190
  4. package/lib/browser/server-entry-c98db16c.js +2 -0
  5. package/lib/browser/server-entry.cjs +1 -1
  6. package/lib/browser/server-entry.mjs +1 -1
  7. package/lib/edge/index.cjs +32 -32
  8. package/lib/edge/index.mjs +1284 -1226
  9. package/lib/{browser/server-entry-f7504f89.mjs → edge/server-entry-13b7e1e6.mjs} +208 -190
  10. package/lib/edge/server-entry-c98db16c.js +2 -0
  11. package/lib/edge/server-entry.cjs +1 -1
  12. package/lib/edge/server-entry.mjs +1 -1
  13. package/lib/index.cjs +14 -0
  14. package/lib/index.mjs +10 -0
  15. package/lib/node/index.cjs +68 -28
  16. package/lib/node/index.mjs +929 -802
  17. package/lib/{edge/server-entry-f7504f89.mjs → node/server-entry-13b7e1e6.mjs} +208 -190
  18. package/lib/node/server-entry-c98db16c.js +2 -0
  19. package/lib/node/server-entry.cjs +1 -1
  20. package/lib/node/server-entry.mjs +1 -1
  21. package/package.json +3 -1
  22. package/types/blocks/image/image.d.ts +1 -1
  23. package/types/constants/sdk-version.d.ts +1 -1
  24. package/types/functions/evaluate/choose-eval.d.ts +6 -0
  25. package/types/functions/evaluate/evaluate.d.ts +1 -5
  26. package/types/functions/evaluate/helpers.d.ts +7 -1
  27. package/types/functions/evaluate/node-runtime/index.d.ts +1 -1
  28. package/types/functions/evaluate/node-runtime/node-runtime.d.ts +2 -0
  29. package/types/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +13 -0
  30. package/types/functions/get-content/types.d.ts +94 -3
  31. package/types/functions/is-node-runtime.d.ts +4 -0
  32. package/types/node-runtime/index.d.ts +1 -0
  33. package/types/node-runtime/node-runtime.d.ts +1 -0
  34. package/types/node-runtime.d.ts +1 -0
  35. package/lib/browser/server-entry-2e639417.js +0 -2
  36. package/lib/edge/server-entry-2e639417.js +0 -2
  37. package/lib/node/server-entry-2e639417.js +0 -2
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { jsxs as E, Fragment as f, jsx as l } from "react/jsx-runtime";
3
- import { createContext as ye, useState as p, useContext as ae, createElement as $e, useRef as Z, useEffect as P } from "react";
4
- import { j as ee, l as _, i as V, k as F, m as Pe, n as K, T as U, r as Ae, c as Be, o as oe, a as Ve, b as Se, p as Fe, q as re, u as le, v as ce, w as Ne } from "./server-entry-f7504f89.mjs";
5
- import { _ as an, h as on, f as rn, g as ln, e as cn, d as sn, s as dn, t as un } from "./server-entry-f7504f89.mjs";
6
- function We(e) {
7
- return /* @__PURE__ */ E(f, { children: [
8
- e.link ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
2
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
3
+ import { createContext, useState, useContext, createElement, useRef, useEffect } from "react";
4
+ import { j as fastClone, i as isEditing, k as isBrowser, l as getUserAttributes, m as logger, n as checkIsDefined, T as TARGET, r as register, o as getDefaultCanTrack, p as _track, a as isPreviewing, c as createRegisterComponentMessage, b as fetchOneEntry, q as fetch$1, u as components, v as serializeComponentInfo, w as handleABTestingSync } from "./server-entry-13b7e1e6.mjs";
5
+ import { _ as M, h as W, f as L, g as O, e as U, d as D, s as H, t as K } from "./server-entry-13b7e1e6.mjs";
6
+ function Button(e) {
7
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
8
+ e.link ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
9
9
  "a",
10
10
  {
11
11
  role: "button",
@@ -14,21 +14,21 @@ function We(e) {
14
14
  target: e.openLinkInNewTab ? "_blank" : void 0,
15
15
  children: e.text
16
16
  }
17
- ) }) : /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
17
+ ) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
18
18
  "button",
19
19
  {
20
20
  ...e.attributes,
21
21
  style: e.attributes.style,
22
- className: e.attributes.className + " button-3e7bc8b2",
22
+ className: e.attributes.className + " button-35669e6c",
23
23
  children: e.text
24
24
  }
25
25
  ) }),
26
- /* @__PURE__ */ l("style", { children: `.button-3e7bc8b2 {
26
+ /* @__PURE__ */ jsx("style", { children: `.button-35669e6c {
27
27
  all: unset;
28
28
  }` })
29
29
  ] });
30
30
  }
31
- const ve = {
31
+ const SIZES = {
32
32
  small: {
33
33
  min: 320,
34
34
  default: 321,
@@ -44,11 +44,11 @@ const ve = {
44
44
  default: 991,
45
45
  max: 1200
46
46
  }
47
- }, se = (e, t = ve) => `@media (max-width: ${t[e].max}px)`, ke = ({
47
+ }, getMaxWidthQueryForSize = (e, t = SIZES) => `@media (max-width: ${t[e].max}px)`, getSizesForBreakpoints = ({
48
48
  small: e,
49
49
  medium: t
50
50
  }) => {
51
- const n = ee(ve);
51
+ const n = fastClone(SIZES);
52
52
  if (!e || !t)
53
53
  return n;
54
54
  const i = Math.floor(e / 2);
@@ -57,20 +57,20 @@ const ve = {
57
57
  min: i,
58
58
  default: i + 1
59
59
  };
60
- const a = n.small.max + 1;
60
+ const o = n.small.max + 1;
61
61
  n.medium = {
62
62
  max: t,
63
- min: a,
64
- default: a + 1
63
+ min: o,
64
+ default: o + 1
65
65
  };
66
- const o = n.medium.max + 1;
66
+ const a = n.medium.max + 1;
67
67
  return n.large = {
68
68
  max: 2e3,
69
69
  // TODO: decide upper limit
70
- min: o,
71
- default: o + 1
70
+ min: a,
71
+ default: a + 1
72
72
  }, n;
73
- }, je = ({
73
+ }, getFunctionArguments = ({
74
74
  builder: e,
75
75
  context: t,
76
76
  event: n,
@@ -82,146 +82,248 @@ const ve = {
82
82
  builder: e,
83
83
  context: t,
84
84
  event: n
85
- }), Me = ({
85
+ }), getBuilderGlobals = () => ({
86
+ isEditing: isEditing(),
87
+ isBrowser: isBrowser(),
88
+ isServer: !isBrowser(),
89
+ getUserAttributes: () => getUserAttributes()
90
+ }), parseCode = (e, {
91
+ isExpression: t = !0
92
+ }) => /* we disable this for cases where we definitely don't want a return */ t && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e, runInBrowser = ({
86
93
  code: e,
87
94
  builder: t,
88
95
  context: n,
89
96
  event: i,
90
- localState: a,
91
- rootSetState: o,
97
+ localState: o,
98
+ rootSetState: a,
92
99
  rootState: r
93
100
  }) => {
94
- const d = je({
101
+ const l = getFunctionArguments({
95
102
  builder: t,
96
103
  context: n,
97
104
  event: i,
98
- state: Ue(r, a, o)
105
+ state: flattenState(r, o, a)
99
106
  });
100
- return new Function(...d.map(([c]) => c), e)(...d.map(([, c]) => c));
107
+ return new Function(...l.map(([s]) => s), e)(...l.map(([, s]) => s));
101
108
  };
102
- function Ue(e, t, n) {
109
+ function flattenState(e, t, n) {
103
110
  if (e === t)
104
111
  throw new Error("rootState === localState");
105
112
  return new Proxy(e, {
106
- get: (i, a) => t && a in t ? t[a] : e[a],
107
- set: (i, a, o) => {
108
- if (t && a in t)
113
+ get: (i, o) => t && o in t ? t[o] : e[o],
114
+ set: (i, o, a) => {
115
+ if (t && o in t)
109
116
  throw new Error("Writing to local state is not allowed as it is read-only.");
110
- return e[a] = o, n == null || n(e), !0;
117
+ return e[o] = a, n == null || n(e), !0;
111
118
  }
112
119
  });
113
120
  }
114
- function M({
121
+ const noop = () => null;
122
+ let safeDynamicRequire = noop;
123
+ try {
124
+ safeDynamicRequire = eval("require");
125
+ } catch (e) {
126
+ }
127
+ const set = (e, t, n) => {
128
+ if (Object(e) !== e)
129
+ return e;
130
+ const i = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
131
+ return i.slice(0, -1).reduce((o, a, r) => Object(o[a]) === o[a] ? o[a] : o[a] = Math.abs(Number(i[r + 1])) >> 0 === +i[r + 1] ? [] : {}, e)[i[i.length - 1]] = n, e;
132
+ }, ivm = safeDynamicRequire("isolated-vm"), getSyncValName = (e) => `bldr_${e}_sync`, BUILDER_SET_STATE_NAME = "BUILDER_SET_STATE", INJECTED_IVM_GLOBAL = "BUILDER_IVM", REF_TO_PROXY_FN = `
133
+ var refToProxy = (obj) => {
134
+ if (typeof obj !== 'object' || obj === null) {
135
+ return obj;
136
+ }
137
+ return new Proxy({}, {
138
+ get(target, key) {
139
+ if (key === 'copySync') {
140
+ return () => obj.copySync();
141
+ }
142
+ const val = obj.getSync(key);
143
+ if (typeof val?.getSync === 'function') {
144
+ return refToProxy(val);
145
+ }
146
+ return val;
147
+ },
148
+ set(target, key, value) {
149
+ const v = typeof value === 'object' ? new ${INJECTED_IVM_GLOBAL}.Reference(value) : value;
150
+ obj.setSync(key, v);
151
+ ${BUILDER_SET_STATE_NAME}(key, value)
152
+ },
153
+ deleteProperty(target, key) {
154
+ obj.deleteSync(key);
155
+ }
156
+ })
157
+ }
158
+ `, processCode = ({
159
+ code: e,
160
+ args: t
161
+ }) => {
162
+ const n = t.map(([i]) => `var ${i} = refToProxy(${getSyncValName(i)}); `).join("");
163
+ return `
164
+ ${REF_TO_PROXY_FN}
165
+ ${n}
166
+ function theFunction() {
167
+ ${e}
168
+ }
169
+
170
+ let output = theFunction()
171
+
172
+ if (typeof output === 'object' && output !== null) {
173
+ output = JSON.stringify(output.copySync ? output.copySync() : output);
174
+ }
175
+
176
+ output;
177
+ `;
178
+ }, getIsolateContext = () => new ivm.Isolate({
179
+ memoryLimit: 128
180
+ }).createContextSync(), runInNode = ({
181
+ code: e,
182
+ builder: t,
183
+ context: n,
184
+ event: i,
185
+ localState: o,
186
+ rootSetState: a,
187
+ rootState: r
188
+ }) => {
189
+ const l = fastClone({
190
+ ...r,
191
+ ...o
192
+ }), s = getFunctionArguments({
193
+ builder: t,
194
+ context: n,
195
+ event: i,
196
+ state: l
197
+ }), c = getIsolateContext(), u = c.global;
198
+ u.setSync("global", u.derefInto()), u.setSync("log", function(...b) {
199
+ console.log(...b);
200
+ }), u.setSync(BUILDER_SET_STATE_NAME, function(b, d) {
201
+ set(r, b, d), a == null || a(r);
202
+ }), s.forEach(([b, d]) => {
203
+ const x = typeof d == "object" ? new ivm.Reference(
204
+ // workaround: methods with default values for arguments is not being cloned over
205
+ b === "builder" ? {
206
+ ...d,
207
+ getUserAttributes: () => d.getUserAttributes()
208
+ } : d
209
+ ) : null;
210
+ u.setSync(getSyncValName(b), x);
211
+ }), u.setSync(INJECTED_IVM_GLOBAL, ivm);
212
+ const f = processCode({
213
+ code: e,
214
+ args: s
215
+ }), h = c.evalSync(f);
216
+ try {
217
+ return JSON.parse(h);
218
+ } catch {
219
+ return h;
220
+ }
221
+ }, chooseBrowserOrServerEval = (e) => isBrowser() ? runInBrowser(e) : runInNode(e);
222
+ function evaluate({
115
223
  code: e,
116
224
  context: t,
117
225
  localState: n,
118
226
  rootState: i,
119
- rootSetState: a,
120
- event: o,
227
+ rootSetState: o,
228
+ event: a,
121
229
  isExpression: r = !0
122
230
  }) {
123
231
  if (e === "") {
124
- _.warn("Skipping evaluation of empty code block.");
232
+ logger.warn("Skipping evaluation of empty code block.");
125
233
  return;
126
234
  }
127
- const d = {
128
- isEditing: V(),
129
- isBrowser: F(),
130
- isServer: !F(),
131
- getUserAttributes: () => Pe()
132
- }, u = {
133
- code: /* we disable this for cases where we definitely don't want a return */ r && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e,
134
- builder: d,
235
+ const l = {
236
+ code: parseCode(e, {
237
+ isExpression: r
238
+ }),
239
+ builder: getBuilderGlobals(),
135
240
  context: t,
136
- event: o,
137
- rootSetState: a,
241
+ event: a,
242
+ rootSetState: o,
138
243
  rootState: i,
139
244
  localState: n
140
245
  };
141
246
  try {
142
- return Me(u);
143
- } catch (m) {
144
- _.error("Failed code evaluation: " + m.message, {
247
+ return chooseBrowserOrServerEval(l);
248
+ } catch (s) {
249
+ logger.error("Failed code evaluation: " + s.message, {
145
250
  code: e
146
251
  });
147
252
  return;
148
253
  }
149
254
  }
150
- const Le = (e, t, n) => {
151
- if (Object(e) !== e)
152
- return e;
153
- const i = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
154
- return i.slice(0, -1).reduce((a, o, r) => Object(a[o]) === a[o] ? a[o] : a[o] = Math.abs(Number(i[r + 1])) >> 0 === +i[r + 1] ? [] : {}, e)[i[i.length - 1]] = n, e;
155
- };
156
- const _e = ({
255
+ function transformBlock(e) {
256
+ return e;
257
+ }
258
+ const evaluateBindings = ({
157
259
  block: e,
158
260
  context: t,
159
261
  localState: n,
160
262
  rootState: i,
161
- rootSetState: a
263
+ rootSetState: o
162
264
  }) => {
163
265
  if (!e.bindings)
164
266
  return e;
165
- const o = ee(e), r = {
166
- ...o,
267
+ const a = fastClone(e), r = {
268
+ ...a,
167
269
  properties: {
168
- ...o.properties
270
+ ...a.properties
169
271
  },
170
272
  actions: {
171
- ...o.actions
273
+ ...a.actions
172
274
  }
173
275
  };
174
- for (const d in e.bindings) {
175
- const c = e.bindings[d], s = M({
176
- code: c,
276
+ for (const l in e.bindings) {
277
+ const s = e.bindings[l], c = evaluate({
278
+ code: s,
177
279
  localState: n,
178
280
  rootState: i,
179
- rootSetState: a,
281
+ rootSetState: o,
180
282
  context: t
181
283
  });
182
- Le(r, d, s);
284
+ set(r, l, c);
183
285
  }
184
286
  return r;
185
287
  };
186
- function O({
288
+ function getProcessedBlock({
187
289
  block: e,
188
290
  context: t,
189
291
  shouldEvaluateBindings: n,
190
292
  localState: i,
191
- rootState: a,
192
- rootSetState: o
293
+ rootState: o,
294
+ rootSetState: a
193
295
  }) {
194
296
  const r = e;
195
- return n ? _e({
297
+ return n ? evaluateBindings({
196
298
  block: r,
197
299
  localState: i,
198
- rootState: a,
199
- rootSetState: o,
300
+ rootState: o,
301
+ rootSetState: a,
200
302
  context: t
201
303
  }) : r;
202
304
  }
203
- const Ke = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), pe = (e) => Object.entries(e).map(([n, i]) => {
305
+ const camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, i]) => {
204
306
  if (typeof i == "string")
205
- return `${Ke(n)}: ${i};`;
206
- }).filter(K), Oe = (e) => pe(e).join(`
207
- `), J = ({
307
+ return `${camelToKebabCase(n)}: ${i};`;
308
+ }).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
309
+ `), createCssClass = ({
208
310
  mediaQuery: e,
209
311
  className: t,
210
312
  styles: n
211
313
  }) => {
212
314
  const i = `.${t} {
213
- ${Oe(n)}
315
+ ${convertStyleMapToCSS(n)}
214
316
  }`;
215
317
  return e ? `${e} {
216
318
  ${i}
217
319
  }` : i;
218
320
  };
219
- function z(e) {
220
- return /* @__PURE__ */ l("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
321
+ function InlinedStyles(e) {
322
+ return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
221
323
  }
222
- function te(e) {
324
+ function BlockStyles(e) {
223
325
  function t() {
224
- const i = O({
326
+ const i = getProcessedBlock({
225
327
  block: e.block,
226
328
  localState: e.context.localState,
227
329
  rootState: e.context.rootState,
@@ -229,45 +331,45 @@ function te(e) {
229
331
  context: e.context.context,
230
332
  shouldEvaluateBindings: !0
231
333
  });
232
- return K(i.hide) ? !i.hide : K(i.show) ? i.show : !0;
334
+ return checkIsDefined(i.hide) ? !i.hide : checkIsDefined(i.show) ? i.show : !0;
233
335
  }
234
336
  function n() {
235
- var h;
236
- const i = O({
337
+ var d;
338
+ const i = getProcessedBlock({
237
339
  block: e.block,
238
340
  localState: e.context.localState,
239
341
  rootState: e.context.rootState,
240
342
  rootSetState: e.context.rootSetState,
241
343
  context: e.context.context,
242
344
  shouldEvaluateBindings: !0
243
- }), a = i.responsiveStyles, o = e.context.content, r = ke(
244
- ((h = o == null ? void 0 : o.meta) == null ? void 0 : h.breakpoints) || {}
245
- ), d = a == null ? void 0 : a.large, c = a == null ? void 0 : a.medium, s = a == null ? void 0 : a.small, u = i.id;
345
+ }), o = i.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
346
+ ((d = a == null ? void 0 : a.meta) == null ? void 0 : d.breakpoints) || {}
347
+ ), l = o == null ? void 0 : o.large, s = o == null ? void 0 : o.medium, c = o == null ? void 0 : o.small, u = i.id;
246
348
  if (!u)
247
349
  return "";
248
- const m = d ? J({
350
+ const f = l ? createCssClass({
249
351
  className: u,
250
- styles: d
251
- }) : "", y = c ? J({
352
+ styles: l
353
+ }) : "", h = s ? createCssClass({
252
354
  className: u,
253
- styles: c,
254
- mediaQuery: se(
355
+ styles: s,
356
+ mediaQuery: getMaxWidthQueryForSize(
255
357
  "medium",
256
358
  r
257
359
  )
258
- }) : "", k = s ? J({
360
+ }) : "", b = c ? createCssClass({
259
361
  className: u,
260
- styles: s,
261
- mediaQuery: se(
362
+ styles: c,
363
+ mediaQuery: getMaxWidthQueryForSize(
262
364
  "small",
263
365
  r
264
366
  )
265
367
  }) : "";
266
- return [m, y, k].join(" ");
368
+ return [f, h, b].join(" ");
267
369
  }
268
- return /* @__PURE__ */ l(f, { children: n() && t() ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(z, { styles: n() }) }) : null });
370
+ return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
269
371
  }
270
- function He(e) {
372
+ function getBlockComponentOptions(e) {
271
373
  var t;
272
374
  return {
273
375
  ...(t = e.component) == null ? void 0 : t.options,
@@ -278,29 +380,29 @@ function He(e) {
278
380
  builderBlock: e
279
381
  };
280
382
  }
281
- const ze = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"], Y = (e) => typeof e == "string" && ze.includes(e.toLowerCase()), qe = ({
383
+ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"], isEmptyHtmlElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.includes(e.toLowerCase()), getComponent = ({
282
384
  block: e,
283
385
  context: t,
284
386
  registeredComponents: n
285
387
  }) => {
286
- var o;
287
- const i = (o = O({
388
+ var a;
389
+ const i = (a = getProcessedBlock({
288
390
  block: e,
289
391
  localState: t.localState,
290
392
  rootState: t.rootState,
291
393
  rootSetState: t.rootSetState,
292
394
  context: t.context,
293
395
  shouldEvaluateBindings: !1
294
- }).component) == null ? void 0 : o.name;
396
+ }).component) == null ? void 0 : a.name;
295
397
  if (!i)
296
398
  return null;
297
- const a = n[i];
298
- if (a)
299
- return a;
399
+ const o = n[i];
400
+ if (o)
401
+ return o;
300
402
  console.warn(`
301
403
  Could not find a registered component named "${i}".
302
404
  If you registered it, is the file that registered it imported by the file that needs to render it?`);
303
- }, De = ({
405
+ }, getRepeatItemData = ({
304
406
  block: e,
305
407
  context: t
306
408
  }) => {
@@ -310,30 +412,30 @@ const ze = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen"
310
412
  } = e;
311
413
  if (!(n != null && n.collection))
312
414
  return;
313
- const a = M({
415
+ const o = evaluate({
314
416
  code: n.collection,
315
417
  localState: t.localState,
316
418
  rootState: t.rootState,
317
419
  rootSetState: t.rootSetState,
318
420
  context: t.context
319
421
  });
320
- if (!Array.isArray(a))
422
+ if (!Array.isArray(o))
321
423
  return;
322
- const o = n.collection.split(".").pop(), r = n.itemName || (o ? o + "Item" : "item");
323
- return a.map((c, s) => ({
424
+ const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
425
+ return o.map((s, c) => ({
324
426
  context: {
325
427
  ...t,
326
428
  localState: {
327
429
  ...t.localState,
328
- $index: s,
329
- $item: c,
330
- [r]: c,
331
- [`$${r}Index`]: s
430
+ $index: c,
431
+ $item: s,
432
+ [r]: s,
433
+ [`$${r}Index`]: c
332
434
  }
333
435
  },
334
436
  block: i
335
437
  }));
336
- }, ne = ye({
438
+ }, builderContext = createContext({
337
439
  content: null,
338
440
  context: {},
339
441
  localState: void 0,
@@ -345,10 +447,10 @@ const ze = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen"
345
447
  componentInfos: {},
346
448
  inheritedStyles: {}
347
449
  });
348
- function Je(e) {
349
- const [t, n] = p(() => e.repeatContext);
350
- return /* @__PURE__ */ l(ne.Provider, { value: t, children: /* @__PURE__ */ l(
351
- q,
450
+ function RepeatedBlock(e) {
451
+ const [t, n] = useState(() => e.repeatContext);
452
+ return /* @__PURE__ */ jsx(builderContext.Provider, { value: t, children: /* @__PURE__ */ jsx(
453
+ Block,
352
454
  {
353
455
  block: e.block,
354
456
  context: t,
@@ -356,10 +458,10 @@ function Je(e) {
356
458
  }
357
459
  ) });
358
460
  }
359
- function Ye(e) {
461
+ function capitalizeFirstLetter(e) {
360
462
  return e.charAt(0).toUpperCase() + e.slice(1);
361
463
  }
362
- const Ge = (e) => `on${Ye(e)}`, Qe = (e, t) => (n) => M({
464
+ const getEventHandlerName = (e) => `on${capitalizeFirstLetter(e)}`, createEventHandler = (e, t) => (n) => evaluate({
363
465
  code: e,
364
466
  context: t.context,
365
467
  localState: t.localState,
@@ -368,54 +470,54 @@ const Ge = (e) => `on${Ye(e)}`, Qe = (e, t) => (n) => M({
368
470
  event: n,
369
471
  isExpression: !1
370
472
  });
371
- function Q(e) {
473
+ function getBlockActions(e) {
372
474
  const t = {}, n = e.block.actions ?? {};
373
475
  for (const i in n) {
374
476
  if (!n.hasOwnProperty(i))
375
477
  continue;
376
- const a = n[i];
377
- let o = Ge(i);
478
+ const o = n[i];
479
+ let a = getEventHandlerName(i);
378
480
  if (e.stripPrefix)
379
- switch (U) {
481
+ switch (TARGET) {
380
482
  case "vue2":
381
483
  case "vue3":
382
- o = o.replace("v-on:", "");
484
+ a = a.replace("v-on:", "");
383
485
  break;
384
486
  case "svelte":
385
- o = o.replace("on:", "");
487
+ a = a.replace("on:", "");
386
488
  break;
387
489
  }
388
- t[o] = Qe(a, e);
490
+ t[a] = createEventHandler(o, e);
389
491
  }
390
492
  return t;
391
493
  }
392
- function Xe(e) {
494
+ function transformBlockProperties(e) {
393
495
  return e.className = e.class, delete e.class, e;
394
496
  }
395
- const Ze = (e) => ({
497
+ const extractRelevantRootBlockProperties = (e) => ({
396
498
  href: e.href
397
499
  });
398
- function H({
500
+ function getBlockProperties({
399
501
  block: e,
400
502
  context: t
401
503
  }) {
402
504
  var i;
403
505
  const n = {
404
- ...Ze(e),
506
+ ...extractRelevantRootBlockProperties(e),
405
507
  ...e.properties,
406
508
  "builder-id": e.id,
407
- style: e.style ? et(e.style) : void 0,
509
+ style: e.style ? getStyleAttribute(e.style) : void 0,
408
510
  class: [e.id, "builder-block", e.class, (i = e.properties) == null ? void 0 : i.class].filter(Boolean).join(" ")
409
511
  };
410
- return Xe(n);
512
+ return transformBlockProperties(n);
411
513
  }
412
- function et(e) {
413
- switch (U) {
514
+ function getStyleAttribute(e) {
515
+ switch (TARGET) {
414
516
  case "svelte":
415
517
  case "vue2":
416
518
  case "vue3":
417
519
  case "solid":
418
- return pe(e).join(" ");
520
+ return convertStyleMapToCSSArray(e).join(" ");
419
521
  case "qwik":
420
522
  case "reactNative":
421
523
  case "react":
@@ -423,17 +525,17 @@ function et(e) {
423
525
  return e;
424
526
  }
425
527
  }
426
- function tt(e) {
427
- return /* @__PURE__ */ l(
528
+ function InteractiveElement(e) {
529
+ return /* @__PURE__ */ jsx(
428
530
  e.Wrapper,
429
531
  {
430
532
  ...e.wrapperProps,
431
533
  attributes: {
432
- ...H({
534
+ ...getBlockProperties({
433
535
  block: e.block,
434
536
  context: e.context
435
537
  }),
436
- ...Q({
538
+ ...getBlockActions({
437
539
  block: e.block,
438
540
  rootState: e.context.rootState,
439
541
  rootSetState: e.context.rootSetState,
@@ -445,15 +547,15 @@ function tt(e) {
445
547
  }
446
548
  );
447
549
  }
448
- const nt = ({
550
+ const getWrapperProps = ({
449
551
  componentOptions: e,
450
552
  builderBlock: t,
451
553
  context: n,
452
554
  componentRef: i,
453
- includeBlockProps: a,
454
- isInteractive: o,
555
+ includeBlockProps: o,
556
+ isInteractive: a,
455
557
  contextValue: r
456
- }) => o ? {
558
+ }) => a ? {
457
559
  Wrapper: i,
458
560
  block: t,
459
561
  context: n,
@@ -464,22 +566,22 @@ const nt = ({
464
566
  * If `noWrap` is set to `true`, then the block's props/attributes are provided to the
465
567
  * component itself directly. Otherwise, they are provided to the wrapper element.
466
568
  */
467
- ...a ? {
468
- attributes: H({
569
+ ...o ? {
570
+ attributes: getBlockProperties({
469
571
  block: t,
470
572
  context: r
471
573
  })
472
574
  } : {}
473
575
  };
474
- function de(e) {
475
- var i, a;
476
- const [t, n] = p(
477
- () => e.isInteractive ? tt : e.componentRef
576
+ function ComponentRef(e) {
577
+ var i, o;
578
+ const [t, n] = useState(
579
+ () => e.isInteractive ? InteractiveElement : e.componentRef
478
580
  );
479
- return /* @__PURE__ */ l(f, { children: e.componentRef ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ E(
581
+ return /* @__PURE__ */ jsx(Fragment, { children: e.componentRef ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
480
582
  t,
481
583
  {
482
- ...nt({
584
+ ...getWrapperProps({
483
585
  componentOptions: e.componentOptions,
484
586
  builderBlock: e.builderBlock,
485
587
  context: e.context,
@@ -489,38 +591,38 @@ function de(e) {
489
591
  contextValue: e.context
490
592
  }),
491
593
  children: [
492
- (i = e.blockChildren) == null ? void 0 : i.map((o) => /* @__PURE__ */ l(
493
- q,
594
+ (i = e.blockChildren) == null ? void 0 : i.map((a) => /* @__PURE__ */ jsx(
595
+ Block,
494
596
  {
495
- block: o,
597
+ block: a,
496
598
  context: e.context,
497
599
  registeredComponents: e.registeredComponents
498
600
  },
499
- "block-" + o.id
601
+ "block-" + a.id
500
602
  )),
501
- (a = e.blockChildren) == null ? void 0 : a.map((o) => /* @__PURE__ */ l(
502
- te,
603
+ (o = e.blockChildren) == null ? void 0 : o.map((a) => /* @__PURE__ */ jsx(
604
+ BlockStyles,
503
605
  {
504
- block: o,
606
+ block: a,
505
607
  context: e.context
506
608
  },
507
- "block-style-" + o.id
609
+ "block-style-" + a.id
508
610
  ))
509
611
  ]
510
612
  }
511
613
  ) }) : null });
512
614
  }
513
- function ue(e) {
514
- return /* @__PURE__ */ E(f, { children: [
615
+ function BlockWrapper(e) {
616
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
515
617
  " ",
516
- e.hasChildren ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ E(
618
+ e.hasChildren ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
517
619
  e.Wrapper,
518
620
  {
519
- ...H({
621
+ ...getBlockProperties({
520
622
  block: e.block,
521
623
  context: e.context
522
624
  }),
523
- ...Q({
625
+ ...getBlockActions({
524
626
  block: e.block,
525
627
  rootState: e.context.rootState,
526
628
  rootSetState: e.context.rootSetState,
@@ -534,14 +636,14 @@ function ue(e) {
534
636
  " "
535
637
  ]
536
638
  }
537
- ) }) : /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
639
+ ) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
538
640
  e.Wrapper,
539
641
  {
540
- ...H({
642
+ ...getBlockProperties({
541
643
  block: e.block,
542
644
  context: e.context
543
645
  }),
544
- ...Q({
646
+ ...getBlockActions({
545
647
  block: e.block,
546
648
  rootState: e.context.rootState,
547
649
  rootSetState: e.context.rootSetState,
@@ -554,23 +656,23 @@ function ue(e) {
554
656
  " "
555
657
  ] });
556
658
  }
557
- function q(e) {
558
- var u, m, y, k;
659
+ function Block(e) {
660
+ var u, f, h, b;
559
661
  function t() {
560
- return qe({
662
+ return getComponent({
561
663
  block: e.block,
562
664
  context: e.context,
563
665
  registeredComponents: e.registeredComponents
564
666
  });
565
667
  }
566
668
  function n() {
567
- return De({
669
+ return getRepeatItemData({
568
670
  block: e.block,
569
671
  context: e.context
570
672
  });
571
673
  }
572
674
  function i() {
573
- return n() ? e.block : O({
675
+ return n() ? e.block : getProcessedBlock({
574
676
  block: e.block,
575
677
  localState: e.context.localState,
576
678
  rootState: e.context.rootState,
@@ -579,94 +681,94 @@ function q(e) {
579
681
  shouldEvaluateBindings: !0
580
682
  });
581
683
  }
582
- function a() {
684
+ function o() {
583
685
  return e.block.tagName || "div";
584
686
  }
585
- function o() {
687
+ function a() {
586
688
  return "hide" in i() ? !i().hide : "show" in i() ? i().show : !0;
587
689
  }
588
690
  function r() {
589
691
  var x;
590
692
  return !((x = t == null ? void 0 : t()) != null && x.component) && !n() ? i().children ?? [] : [];
591
693
  }
592
- function d() {
593
- var h, x, C, T, g;
694
+ function l() {
695
+ var d, x, v, C, S;
594
696
  return {
595
697
  blockChildren: i().children ?? [],
596
- componentRef: (h = t == null ? void 0 : t()) == null ? void 0 : h.component,
698
+ componentRef: (d = t == null ? void 0 : t()) == null ? void 0 : d.component,
597
699
  componentOptions: {
598
- ...He(i()),
700
+ ...getBlockComponentOptions(i()),
599
701
  builderContext: e.context,
600
- ...((x = t == null ? void 0 : t()) == null ? void 0 : x.name) === "Symbol" || ((C = t == null ? void 0 : t()) == null ? void 0 : C.name) === "Columns" ? {
702
+ ...((x = t == null ? void 0 : t()) == null ? void 0 : x.name) === "Symbol" || ((v = t == null ? void 0 : t()) == null ? void 0 : v.name) === "Columns" ? {
601
703
  builderComponents: e.registeredComponents
602
704
  } : {}
603
705
  },
604
- context: c,
706
+ context: s,
605
707
  registeredComponents: e.registeredComponents,
606
708
  builderBlock: i(),
607
- includeBlockProps: ((T = t == null ? void 0 : t()) == null ? void 0 : T.noWrap) === !0,
608
- isInteractive: !((g = t == null ? void 0 : t()) != null && g.isRSC)
709
+ includeBlockProps: ((C = t == null ? void 0 : t()) == null ? void 0 : C.noWrap) === !0,
710
+ isInteractive: !((S = t == null ? void 0 : t()) != null && S.isRSC)
609
711
  };
610
712
  }
611
- const [c, s] = p(() => e.context);
612
- return /* @__PURE__ */ l(f, { children: o() ? /* @__PURE__ */ l(f, { children: (u = t == null ? void 0 : t()) != null && u.noWrap ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(de, { ...d() }) }) : /* @__PURE__ */ E(f, { children: [
613
- Y(a()) ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
614
- ue,
713
+ const [s, c] = useState(() => e.context);
714
+ return /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsx(Fragment, { children: (u = t == null ? void 0 : t()) != null && u.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ComponentRef, { ...l() }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
715
+ isEmptyHtmlElement(o()) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
716
+ BlockWrapper,
615
717
  {
616
- Wrapper: a(),
718
+ Wrapper: o(),
617
719
  block: i(),
618
720
  context: e.context,
619
721
  hasChildren: !1
620
722
  }
621
723
  ) }) : null,
622
- !Y(a()) && n() ? /* @__PURE__ */ l(f, { children: (m = n()) == null ? void 0 : m.map((h, x) => /* @__PURE__ */ l(
623
- Je,
724
+ !isEmptyHtmlElement(o()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (f = n()) == null ? void 0 : f.map((d, x) => /* @__PURE__ */ jsx(
725
+ RepeatedBlock,
624
726
  {
625
- repeatContext: h.context,
626
- block: h.block,
727
+ repeatContext: d.context,
728
+ block: d.block,
627
729
  registeredComponents: e.registeredComponents
628
730
  },
629
731
  x
630
732
  )) }) : null,
631
- !Y(a()) && !n() ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ E(
632
- ue,
733
+ !isEmptyHtmlElement(o()) && !n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
734
+ BlockWrapper,
633
735
  {
634
- Wrapper: a(),
736
+ Wrapper: o(),
635
737
  block: i(),
636
738
  context: e.context,
637
739
  hasChildren: !0,
638
740
  children: [
639
- /* @__PURE__ */ l(de, { ...d() }),
640
- (y = r()) == null ? void 0 : y.map((h) => /* @__PURE__ */ l(
641
- q,
741
+ /* @__PURE__ */ jsx(ComponentRef, { ...l() }),
742
+ (h = r()) == null ? void 0 : h.map((d) => /* @__PURE__ */ jsx(
743
+ Block,
642
744
  {
643
- block: h,
644
- context: c,
745
+ block: d,
746
+ context: s,
645
747
  registeredComponents: e.registeredComponents
646
748
  },
647
- "block-" + h.id
749
+ "block-" + d.id
648
750
  )),
649
- (k = r()) == null ? void 0 : k.map((h) => /* @__PURE__ */ l(
650
- te,
751
+ (b = r()) == null ? void 0 : b.map((d) => /* @__PURE__ */ jsx(
752
+ BlockStyles,
651
753
  {
652
- block: h,
653
- context: c
754
+ block: d,
755
+ context: s
654
756
  },
655
- "block-style-" + h.id
757
+ "block-style-" + d.id
656
758
  ))
657
759
  ]
658
760
  }
659
761
  ) }) : null
660
762
  ] }) }) : null });
661
763
  }
662
- function it(e) {
764
+ function BlocksWrapper(e) {
663
765
  function t() {
664
- var a;
665
- return "builder-blocks" + ((a = e.blocks) != null && a.length ? "" : " no-blocks");
766
+ var o;
767
+ return "builder-blocks" + ((o = e.blocks) != null && o.length ? "" : " no-blocks");
666
768
  }
667
769
  function n() {
668
- var a, o;
669
- V() && !((a = e.blocks) != null && a.length) && ((o = window.parent) == null || o.postMessage(
770
+ var o, a;
771
+ isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
670
772
  {
671
773
  type: "builder.clickEmptyBlocks",
672
774
  data: {
@@ -678,8 +780,8 @@ function it(e) {
678
780
  ));
679
781
  }
680
782
  function i() {
681
- var a, o;
682
- V() && !((a = e.blocks) != null && a.length) && ((o = window.parent) == null || o.postMessage(
783
+ var o, a;
784
+ isEditing() && !((o = e.blocks) != null && o.length) && ((a = window.parent) == null || a.postMessage(
683
785
  {
684
786
  type: "builder.hoverEmptyBlocks",
685
787
  data: {
@@ -690,129 +792,129 @@ function it(e) {
690
792
  "*"
691
793
  ));
692
794
  }
693
- return /* @__PURE__ */ E(f, { children: [
694
- /* @__PURE__ */ l(
795
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
796
+ /* @__PURE__ */ jsx(
695
797
  "div",
696
798
  {
697
- className: t() + " div-5821bd52",
799
+ className: t() + " div-02c7a115",
698
800
  "builder-path": e.path,
699
801
  "builder-parent-id": e.parent,
700
802
  style: e.styleProp,
701
- onClick: (a) => n(),
702
- onMouseEnter: (a) => i(),
703
- onKeyPress: (a) => n(),
803
+ onClick: (o) => n(),
804
+ onMouseEnter: (o) => i(),
805
+ onKeyPress: (o) => n(),
704
806
  children: e.children
705
807
  }
706
808
  ),
707
- /* @__PURE__ */ l("style", { children: `.div-5821bd52 {
809
+ /* @__PURE__ */ jsx("style", { children: `.div-02c7a115 {
708
810
  display: flex;
709
811
  flex-direction: column;
710
812
  align-items: stretch;
711
813
  }` })
712
814
  ] });
713
815
  }
714
- const Ce = ye({ registeredComponents: {} });
715
- function ie(e) {
716
- var i, a;
717
- const t = ae(ne), n = ae(Ce);
718
- return /* @__PURE__ */ E(
719
- it,
816
+ const ComponentsContext = createContext({ registeredComponents: {} });
817
+ function Blocks(e) {
818
+ var i, o;
819
+ const t = useContext(builderContext), n = useContext(ComponentsContext);
820
+ return /* @__PURE__ */ jsxs(
821
+ BlocksWrapper,
720
822
  {
721
823
  blocks: e.blocks,
722
824
  parent: e.parent,
723
825
  path: e.path,
724
826
  styleProp: e.styleProp,
725
827
  children: [
726
- e.blocks ? /* @__PURE__ */ l(f, { children: (i = e.blocks) == null ? void 0 : i.map((o) => /* @__PURE__ */ l(
727
- q,
828
+ e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (i = e.blocks) == null ? void 0 : i.map((a) => /* @__PURE__ */ jsx(
829
+ Block,
728
830
  {
729
- block: o,
831
+ block: a,
730
832
  context: e.context || t,
731
833
  registeredComponents: e.registeredComponents || n.registeredComponents
732
834
  },
733
- "render-block-" + o.id
835
+ "render-block-" + a.id
734
836
  )) }) : null,
735
- e.blocks ? /* @__PURE__ */ l(f, { children: (a = e.blocks) == null ? void 0 : a.map((o) => /* @__PURE__ */ l(
736
- te,
837
+ e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (o = e.blocks) == null ? void 0 : o.map((a) => /* @__PURE__ */ jsx(
838
+ BlockStyles,
737
839
  {
738
- block: o,
840
+ block: a,
739
841
  context: e.context || t
740
842
  },
741
- "block-style-" + o.id
843
+ "block-style-" + a.id
742
844
  )) }) : null
743
845
  ]
744
846
  }
745
847
  );
746
848
  }
747
- function at(e) {
748
- var T;
749
- const [t, n] = p(
849
+ function Columns(e) {
850
+ var C;
851
+ const [t, n] = useState(
750
852
  () => typeof e.space == "number" ? e.space || 0 : 20
751
- ), [i, a] = p(() => e.columns || []), [o, r] = p(
853
+ ), [i, o] = useState(() => e.columns || []), [a, r] = useState(
752
854
  () => e.stackColumnsAt || "tablet"
753
855
  );
754
- function d(g) {
755
- var R;
756
- return ((R = i[g]) == null ? void 0 : R.width) || 100 / i.length;
856
+ function l(S) {
857
+ var E;
858
+ return ((E = i[S]) == null ? void 0 : E.width) || 100 / i.length;
757
859
  }
758
- function c(g) {
759
- const R = t * (i.length - 1) / i.length;
760
- return `calc(${d(g)}% - ${R}px)`;
860
+ function s(S) {
861
+ const E = t * (i.length - 1) / i.length;
862
+ return `calc(${l(S)}% - ${E}px)`;
761
863
  }
762
- function s({
763
- stackedStyle: g,
764
- desktopStyle: R
864
+ function c({
865
+ stackedStyle: S,
866
+ desktopStyle: E
765
867
  }) {
766
- return o === "tablet" ? g : R;
868
+ return a === "tablet" ? S : E;
767
869
  }
768
870
  function u({
769
- stackedStyle: g,
770
- desktopStyle: R
871
+ stackedStyle: S,
872
+ desktopStyle: E
771
873
  }) {
772
- return o === "never" ? R : g;
874
+ return a === "never" ? E : S;
773
875
  }
774
- const [m, y] = p(
876
+ const [f, h] = useState(
775
877
  () => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
776
878
  );
777
- function k() {
879
+ function b() {
778
880
  return {
779
- "--flex-dir": m,
780
- "--flex-dir-tablet": s({
781
- stackedStyle: m,
881
+ "--flex-dir": f,
882
+ "--flex-dir-tablet": c({
883
+ stackedStyle: f,
782
884
  desktopStyle: "row"
783
885
  })
784
886
  };
785
887
  }
786
- function h(g) {
787
- const R = g === 0 ? 0 : t, A = c(g), B = `${R}px`, N = "100%", W = 0;
888
+ function d(S) {
889
+ const E = S === 0 ? 0 : t, I = s(S), T = `${E}px`, R = "100%", j = 0;
788
890
  return {
789
- width: A,
790
- ["marginLeft"]: B,
891
+ width: I,
892
+ ["marginLeft"]: T,
791
893
  "--column-width-mobile": u({
792
- stackedStyle: N,
793
- desktopStyle: A
894
+ stackedStyle: R,
895
+ desktopStyle: I
794
896
  }),
795
897
  "--column-margin-left-mobile": u({
796
- stackedStyle: W,
797
- desktopStyle: B
898
+ stackedStyle: j,
899
+ desktopStyle: T
798
900
  }),
799
- "--column-width-tablet": s({
800
- stackedStyle: N,
801
- desktopStyle: A
901
+ "--column-width-tablet": c({
902
+ stackedStyle: R,
903
+ desktopStyle: I
802
904
  }),
803
- "--column-margin-left-tablet": s({
804
- stackedStyle: W,
805
- desktopStyle: B
905
+ "--column-margin-left-tablet": c({
906
+ stackedStyle: j,
907
+ desktopStyle: T
806
908
  })
807
909
  };
808
910
  }
809
- function x(g) {
810
- var A, B;
811
- return ke(
812
- ((B = (A = e.builderContext.content) == null ? void 0 : A.meta) == null ? void 0 : B.breakpoints) || {}
813
- )[g].max;
911
+ function x(S) {
912
+ var I, T;
913
+ return getSizesForBreakpoints(
914
+ ((T = (I = e.builderContext.content) == null ? void 0 : I.meta) == null ? void 0 : T.breakpoints) || {}
915
+ )[S].max;
814
916
  }
815
- function C() {
917
+ function v() {
816
918
  return `
817
919
  @media (max-width: ${x("medium")}px) {
818
920
  .${e.builderBlock.id}-breakpoints {
@@ -839,116 +941,116 @@ function at(e) {
839
941
  },
840
942
  `;
841
943
  }
842
- return /* @__PURE__ */ E(f, { children: [
843
- /* @__PURE__ */ E(
944
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
945
+ /* @__PURE__ */ jsxs(
844
946
  "div",
845
947
  {
846
- className: `builder-columns ${e.builderBlock.id}-breakpoints div-d734ad62`,
847
- style: k(),
948
+ className: `builder-columns ${e.builderBlock.id}-breakpoints div-ac8f4142`,
949
+ style: b(),
848
950
  children: [
849
- /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(z, { styles: C() }) }),
850
- (T = e.columns) == null ? void 0 : T.map((g, R) => /* @__PURE__ */ $e(
951
+ /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: v() }) }),
952
+ (C = e.columns) == null ? void 0 : C.map((S, E) => /* @__PURE__ */ createElement(
851
953
  "div",
852
954
  {
853
- className: "builder-column div-d734ad62-2",
854
- style: h(R),
855
- key: R
955
+ className: "builder-column div-ac8f4142-2",
956
+ style: d(E),
957
+ key: E
856
958
  },
857
- /* @__PURE__ */ l(
858
- ie,
959
+ /* @__PURE__ */ jsx(
960
+ Blocks,
859
961
  {
860
- path: `component.options.columns.${R}.blocks`,
962
+ path: `component.options.columns.${E}.blocks`,
861
963
  parent: e.builderBlock.id,
862
964
  styleProp: {
863
965
  flexGrow: "1"
864
966
  },
865
967
  context: e.builderContext,
866
968
  registeredComponents: e.builderComponents,
867
- blocks: g.blocks
969
+ blocks: S.blocks
868
970
  }
869
971
  )
870
972
  ))
871
973
  ]
872
974
  }
873
975
  ),
874
- /* @__PURE__ */ l("style", { children: `.div-d734ad62 {
976
+ /* @__PURE__ */ jsx("style", { children: `.div-ac8f4142 {
875
977
  display: flex;
876
978
  line-height: normal;
877
- }.div-d734ad62-2 {
979
+ }.div-ac8f4142-2 {
878
980
  display: flex;
879
981
  flex-direction: column;
880
982
  align-items: stretch;
881
983
  }` })
882
984
  ] });
883
985
  }
884
- function ot(e) {
885
- return /* @__PURE__ */ l("span", { children: e.children });
986
+ function FragmentComponent(e) {
987
+ return /* @__PURE__ */ jsx("span", { children: e.children });
886
988
  }
887
- function me(e) {
989
+ function removeProtocol(e) {
888
990
  return e.replace(/http(s)?:/, "");
889
991
  }
890
- function rt(e = "", t, n) {
891
- const i = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), a = e.indexOf("?") !== -1 ? "&" : "?";
892
- return e.match(i) ? e.replace(i, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + a + t + "=" + encodeURIComponent(n);
992
+ function updateQueryParam(e = "", t, n) {
993
+ const i = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), o = e.indexOf("?") !== -1 ? "&" : "?";
994
+ return e.match(i) ? e.replace(i, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + o + t + "=" + encodeURIComponent(n);
893
995
  }
894
- function lt(e, t) {
996
+ function getShopifyImageUrl(e, t) {
895
997
  if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
896
998
  return e;
897
999
  if (t === "master")
898
- return me(e);
1000
+ return removeProtocol(e);
899
1001
  const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
900
1002
  if (n) {
901
- const i = e.split(n[0]), a = n[3], o = t.match("x") ? t : `${t}x`;
902
- return me(`${i[0]}_${o}${a}`);
1003
+ const i = e.split(n[0]), o = n[3], a = t.match("x") ? t : `${t}x`;
1004
+ return removeProtocol(`${i[0]}_${a}${o}`);
903
1005
  }
904
1006
  return null;
905
1007
  }
906
- function G(e) {
1008
+ function getSrcSet(e) {
907
1009
  if (!e)
908
1010
  return e;
909
1011
  const t = [100, 200, 400, 800, 1200, 1600, 2e3];
910
1012
  if (e.match(/builder\.io/)) {
911
1013
  let n = e;
912
1014
  const i = Number(e.split("?width=")[1]);
913
- return isNaN(i) || (n = `${n} ${i}w`), t.filter((a) => a !== i).map((a) => `${rt(e, "width", a)} ${a}w`).concat([n]).join(", ");
1015
+ return isNaN(i) || (n = `${n} ${i}w`), t.filter((o) => o !== i).map((o) => `${updateQueryParam(e, "width", o)} ${o}w`).concat([n]).join(", ");
914
1016
  }
915
- return e.match(/cdn\.shopify\.com/) ? t.map((n) => [lt(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, i]) => `${n} ${i}w`).concat([e]).join(", ") : e;
1017
+ return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, i]) => `${n} ${i}w`).concat([e]).join(", ") : e;
916
1018
  }
917
- function ct(e) {
918
- var a, o, r, d;
1019
+ function Image(e) {
1020
+ var o, a, r, l;
919
1021
  function t() {
920
1022
  var u;
921
- const s = e.image || e.src;
922
- if (!s || // We can auto add srcset for cdn.builder.io and shopify
1023
+ const c = e.image || e.src;
1024
+ if (!c || // We can auto add srcset for cdn.builder.io and shopify
923
1025
  // images, otherwise you can supply this prop manually
924
- !(s.match(/builder\.io/) || s.match(/cdn\.shopify\.com/)))
1026
+ !(c.match(/builder\.io/) || c.match(/cdn\.shopify\.com/)))
925
1027
  return e.srcset;
926
1028
  if (e.srcset && ((u = e.image) != null && u.includes("builder.io/api/v1/image"))) {
927
1029
  if (!e.srcset.includes(e.image.split("?")[0]))
928
- return console.debug("Removed given srcset"), G(s);
1030
+ return console.debug("Removed given srcset"), getSrcSet(c);
929
1031
  } else if (e.image && !e.srcset)
930
- return G(s);
931
- return G(s);
1032
+ return getSrcSet(c);
1033
+ return getSrcSet(c);
932
1034
  }
933
1035
  function n() {
934
- var c;
935
- return (c = t == null ? void 0 : t()) != null && c.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
1036
+ var s;
1037
+ return (s = t == null ? void 0 : t()) != null && s.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
936
1038
  }
937
1039
  function i() {
938
- const c = {
1040
+ const s = {
939
1041
  position: "absolute",
940
1042
  height: "100%",
941
1043
  width: "100%",
942
1044
  left: "0px",
943
1045
  top: "0px"
944
1046
  };
945
- return e.aspectRatio ? c : void 0;
1047
+ return e.aspectRatio ? s : void 0;
946
1048
  }
947
- return /* @__PURE__ */ E(f, { children: [
948
- /* @__PURE__ */ E(f, { children: [
949
- /* @__PURE__ */ E("picture", { children: [
950
- n() ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l("source", { type: "image/webp", srcSet: n() }) }) : null,
951
- /* @__PURE__ */ l(
1049
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1050
+ /* @__PURE__ */ jsxs(Fragment, { children: [
1051
+ /* @__PURE__ */ jsxs("picture", { children: [
1052
+ n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("source", { type: "image/webp", srcSet: n() }) }) : null,
1053
+ /* @__PURE__ */ jsx(
952
1054
  "img",
953
1055
  {
954
1056
  loading: "lazy",
@@ -959,33 +1061,33 @@ function ct(e) {
959
1061
  objectFit: e.backgroundSize || "cover",
960
1062
  ...i()
961
1063
  },
962
- className: "builder-image" + (e.className ? " " + e.className : "") + " img-ef11a6be",
1064
+ className: "builder-image" + (e.className ? " " + e.className : "") + " img-497e0136",
963
1065
  src: e.image,
964
1066
  srcSet: t(),
965
1067
  sizes: e.sizes
966
1068
  }
967
1069
  )
968
1070
  ] }),
969
- e.aspectRatio && !((o = (a = e.builderBlock) == null ? void 0 : a.children) != null && o.length && e.fitContent) ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
1071
+ e.aspectRatio && !((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
970
1072
  "div",
971
1073
  {
972
- className: "builder-image-sizer div-ef11a6be",
1074
+ className: "builder-image-sizer div-497e0136",
973
1075
  style: {
974
1076
  paddingTop: e.aspectRatio * 100 + "%"
975
1077
  }
976
1078
  }
977
1079
  ) }) : null,
978
- (d = (r = e.builderBlock) == null ? void 0 : r.children) != null && d.length && e.fitContent ? /* @__PURE__ */ l(f, { children: e.children }) : null,
979
- !e.fitContent && e.children ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l("div", { className: "div-ef11a6be-2", children: e.children }) }) : null
1080
+ (l = (r = e.builderBlock) == null ? void 0 : r.children) != null && l.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
1081
+ !e.fitContent && e.children ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "div-497e0136-2", children: e.children }) }) : null
980
1082
  ] }),
981
- /* @__PURE__ */ l("style", { children: `.img-ef11a6be {
1083
+ /* @__PURE__ */ jsx("style", { children: `.img-497e0136 {
982
1084
  opacity: 1;
983
1085
  transition: opacity 0.2s ease-in-out;
984
- }.div-ef11a6be {
1086
+ }.div-497e0136 {
985
1087
  width: 100%;
986
1088
  pointer-events: none;
987
1089
  font-size: 0;
988
- }.div-ef11a6be-2 {
1090
+ }.div-497e0136-2 {
989
1091
  display: flex;
990
1092
  flex-direction: column;
991
1093
  align-items: stretch;
@@ -997,8 +1099,8 @@ function ct(e) {
997
1099
  }` })
998
1100
  ] });
999
1101
  }
1000
- function st(e) {
1001
- return /* @__PURE__ */ l(
1102
+ function SectionComponent(e) {
1103
+ return /* @__PURE__ */ jsx(
1002
1104
  "section",
1003
1105
  {
1004
1106
  ...e.attributes,
@@ -1018,98 +1120,98 @@ function st(e) {
1018
1120
  }
1019
1121
  );
1020
1122
  }
1021
- const L = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
1123
+ const getVariants = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
1022
1124
  ...t,
1023
1125
  testVariationId: t.id,
1024
1126
  id: e == null ? void 0 : e.id
1025
- })), dt = ({
1127
+ })), checkShouldRunVariants = ({
1026
1128
  canTrack: e,
1027
1129
  content: t
1028
- }) => !(!(L(t).length > 0) || !e || F());
1029
- function ut(e, t, n) {
1130
+ }) => !(!(getVariants(t).length > 0) || !e || isBrowser());
1131
+ function bldrAbTest(e, t, n) {
1030
1132
  var r;
1031
1133
  function i() {
1032
- function d(h, x, C) {
1033
- let T = "";
1034
- if (C) {
1035
- const g = /* @__PURE__ */ new Date();
1036
- g.setTime(g.getTime() + C * 24 * 60 * 60 * 1e3), T = "; expires=" + g.toUTCString();
1134
+ function l(d, x, v) {
1135
+ let C = "";
1136
+ if (v) {
1137
+ const S = /* @__PURE__ */ new Date();
1138
+ S.setTime(S.getTime() + v * 24 * 60 * 60 * 1e3), C = "; expires=" + S.toUTCString();
1037
1139
  }
1038
- document.cookie = h + "=" + (x || "") + T + "; path=/; Secure; SameSite=None";
1140
+ document.cookie = d + "=" + (x || "") + C + "; path=/; Secure; SameSite=None";
1039
1141
  }
1040
- function c(h) {
1041
- const x = h + "=", C = document.cookie.split(";");
1042
- for (let T = 0; T < C.length; T++) {
1043
- let g = C[T];
1044
- for (; g.charAt(0) === " "; )
1045
- g = g.substring(1, g.length);
1046
- if (g.indexOf(x) === 0)
1047
- return g.substring(x.length, g.length);
1142
+ function s(d) {
1143
+ const x = d + "=", v = document.cookie.split(";");
1144
+ for (let C = 0; C < v.length; C++) {
1145
+ let S = v[C];
1146
+ for (; S.charAt(0) === " "; )
1147
+ S = S.substring(1, S.length);
1148
+ if (S.indexOf(x) === 0)
1149
+ return S.substring(x.length, S.length);
1048
1150
  }
1049
1151
  return null;
1050
1152
  }
1051
- const s = `builder.tests.${e}`, u = c(s), m = t.map((h) => h.id).concat(e);
1052
- if (u && m.includes(u))
1153
+ const c = `builder.tests.${e}`, u = s(c), f = t.map((d) => d.id).concat(e);
1154
+ if (u && f.includes(u))
1053
1155
  return u;
1054
- let y = 0;
1055
- const k = Math.random();
1056
- for (let h = 0; h < t.length; h++) {
1057
- const x = t[h], C = x.testRatio;
1058
- if (y += C, k < y)
1059
- return d(s, x.id), x.id;
1156
+ let h = 0;
1157
+ const b = Math.random();
1158
+ for (let d = 0; d < t.length; d++) {
1159
+ const x = t[d], v = x.testRatio;
1160
+ if (h += v, b < h)
1161
+ return l(c, x.id), x.id;
1060
1162
  }
1061
- return d(s, e), e;
1163
+ return l(c, e), e;
1062
1164
  }
1063
- const a = i(), o = (r = document.currentScript) == null ? void 0 : r.previousElementSibling;
1165
+ const o = i(), a = (r = document.currentScript) == null ? void 0 : r.previousElementSibling;
1064
1166
  if (n) {
1065
- o.remove();
1066
- const d = document.currentScript;
1067
- d == null || d.remove();
1167
+ a.remove();
1168
+ const l = document.currentScript;
1169
+ l == null || l.remove();
1068
1170
  } else {
1069
- const d = t.concat({
1171
+ const l = t.concat({
1070
1172
  id: e
1071
- }).filter((c) => c.id !== a).map((c) => `.variant-${c.id} { display: none; }
1173
+ }).filter((s) => s.id !== o).map((s) => `.variant-${s.id} { display: none; }
1072
1174
  `).join("");
1073
- o.innerHTML = d;
1175
+ a.innerHTML = l;
1074
1176
  }
1075
1177
  }
1076
- function mt(e, t, n) {
1077
- var c;
1178
+ function bldrCntntScrpt(e, t, n) {
1179
+ var s;
1078
1180
  if (!navigator.cookieEnabled)
1079
1181
  return;
1080
- function i(s) {
1081
- const u = s + "=", m = document.cookie.split(";");
1082
- for (let y = 0; y < m.length; y++) {
1083
- let k = m[y];
1084
- for (; k.charAt(0) === " "; )
1085
- k = k.substring(1, k.length);
1086
- if (k.indexOf(u) === 0)
1087
- return k.substring(u.length, k.length);
1182
+ function i(c) {
1183
+ const u = c + "=", f = document.cookie.split(";");
1184
+ for (let h = 0; h < f.length; h++) {
1185
+ let b = f[h];
1186
+ for (; b.charAt(0) === " "; )
1187
+ b = b.substring(1, b.length);
1188
+ if (b.indexOf(u) === 0)
1189
+ return b.substring(u.length, b.length);
1088
1190
  }
1089
1191
  return null;
1090
1192
  }
1091
- const a = `builder.tests.${t}`, o = i(a), r = (c = document.currentScript) == null ? void 0 : c.parentElement, d = e === t;
1092
- if (o === e) {
1093
- if (d)
1193
+ const o = `builder.tests.${t}`, a = i(o), r = (s = document.currentScript) == null ? void 0 : s.parentElement, l = e === t;
1194
+ if (a === e) {
1195
+ if (l)
1094
1196
  return;
1095
1197
  r == null || r.removeAttribute("hidden"), r == null || r.removeAttribute("aria-hidden");
1096
1198
  } else {
1097
- d && (n ? r == null || r.remove() : (r == null || r.setAttribute("hidden", "true"), r == null || r.setAttribute("aria-hidden", "true")));
1199
+ l && (n ? r == null || r.remove() : (r == null || r.setAttribute("hidden", "true"), r == null || r.setAttribute("aria-hidden", "true")));
1098
1200
  return;
1099
1201
  }
1100
1202
  }
1101
- const ft = (e) => e === "react" || e === "reactNative", we = ft(U), Ie = "builderIoAbTest", Te = "builderIoRenderContent", ht = () => {
1102
- const e = ut.toString().replace(/\s+/g, " "), t = mt.toString().replace(/\s+/g, " ");
1203
+ const getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydrationTarget = getIsHydrationTarget(TARGET), AB_TEST_FN_NAME = "builderIoAbTest", CONTENT_FN_NAME = "builderIoRenderContent", getScriptString = () => {
1204
+ const e = bldrAbTest.toString().replace(/\s+/g, " "), t = bldrCntntScrpt.toString().replace(/\s+/g, " ");
1103
1205
  return `
1104
- window.${Ie} = ${e}
1105
- window.${Te} = ${t}
1206
+ window.${AB_TEST_FN_NAME} = ${e}
1207
+ window.${CONTENT_FN_NAME} = ${t}
1106
1208
  `;
1107
- }, gt = (e, t) => `
1108
- window.${Ie}("${t}",${JSON.stringify(e)}, ${we})`, bt = ({
1209
+ }, getVariantsScriptString = (e, t) => `
1210
+ window.${AB_TEST_FN_NAME}("${t}",${JSON.stringify(e)}, ${isHydrationTarget})`, getRenderContentScriptString = ({
1109
1211
  contentId: e,
1110
1212
  variationId: t
1111
1213
  }) => `
1112
- window.${Te}("${t}", "${e}", ${we})`, xt = {
1214
+ window.${CONTENT_FN_NAME}("${t}", "${e}", ${isHydrationTarget})`, componentInfo$a = {
1113
1215
  name: "Core:Button",
1114
1216
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
1115
1217
  defaultStyles: {
@@ -1142,7 +1244,7 @@ const ft = (e) => e === "react" || e === "reactNative", we = ft(U), Ie = "builde
1142
1244
  }],
1143
1245
  static: !0,
1144
1246
  noWrap: !0
1145
- }, yt = {
1247
+ }, componentInfo$9 = {
1146
1248
  // TODO: ways to statically preprocess JSON for references, functions, etc
1147
1249
  name: "Columns",
1148
1250
  isRSC: !0,
@@ -1321,7 +1423,7 @@ const ft = (e) => e === "react" || e === "reactNative", we = ft(U), Ie = "builde
1321
1423
  });
1322
1424
  }
1323
1425
  const n = e.get("columns");
1324
- Array.isArray(n) && n.find((a) => a.get("width")) && (n.find((o) => !o.get("width")) || n.reduce((d, c) => d + c.get("width"), 0) !== 100) && t();
1426
+ Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((l, s) => l + s.get("width"), 0) !== 100) && t();
1325
1427
  }
1326
1428
  }, {
1327
1429
  name: "space",
@@ -1343,13 +1445,13 @@ const ft = (e) => e === "react" || e === "reactNative", we = ft(U), Ie = "builde
1343
1445
  helperText: "When stacking columns for mobile devices, reverse the ordering",
1344
1446
  advanced: !0
1345
1447
  }]
1346
- }, St = {
1448
+ }, componentInfo$8 = {
1347
1449
  name: "Fragment",
1348
1450
  static: !0,
1349
1451
  hidden: !0,
1350
1452
  canHaveChildren: !0,
1351
1453
  noWrap: !0
1352
- }, vt = {
1454
+ }, componentInfo$7 = {
1353
1455
  name: "Image",
1354
1456
  static: !0,
1355
1457
  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",
@@ -1369,29 +1471,29 @@ const ft = (e) => e === "react" || e === "reactNative", we = ft(U), Ie = "builde
1369
1471
  defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
1370
1472
  onChange: (e) => {
1371
1473
  e.delete("srcset"), e.delete("noWebp");
1372
- function n(r, d = 6e4) {
1373
- return new Promise((c, s) => {
1474
+ function n(r, l = 6e4) {
1475
+ return new Promise((s, c) => {
1374
1476
  const u = document.createElement("img");
1375
- let m = !1;
1477
+ let f = !1;
1376
1478
  u.onload = () => {
1377
- m = !0, c(u);
1378
- }, u.addEventListener("error", (y) => {
1379
- console.warn("Image load failed", y.error), s(y.error);
1479
+ f = !0, s(u);
1480
+ }, u.addEventListener("error", (h) => {
1481
+ console.warn("Image load failed", h.error), c(h.error);
1380
1482
  }), u.src = r, setTimeout(() => {
1381
- m || s(new Error("Image load timed out"));
1382
- }, d);
1483
+ f || c(new Error("Image load timed out"));
1484
+ }, l);
1383
1485
  });
1384
1486
  }
1385
1487
  function i(r) {
1386
1488
  return Math.round(r * 1e3) / 1e3;
1387
1489
  }
1388
- const a = e.get("image"), o = e.get("aspectRatio");
1389
- if (fetch(a).then((r) => r.blob()).then((r) => {
1490
+ const o = e.get("image"), a = e.get("aspectRatio");
1491
+ if (fetch(o).then((r) => r.blob()).then((r) => {
1390
1492
  r.type.includes("svg") && e.set("noWebp", !0);
1391
- }), a && (!o || o === 0.7041))
1392
- return n(a).then((r) => {
1393
- const d = e.get("aspectRatio");
1394
- e.get("image") === a && (!d || d === 0.7041) && r.width && r.height && (e.set("aspectRatio", i(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
1493
+ }), o && (!a || a === 0.7041))
1494
+ return n(o).then((r) => {
1495
+ const l = e.get("aspectRatio");
1496
+ e.get("image") === o && (!l || l === 0.7041) && r.width && r.height && (e.set("aspectRatio", i(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
1395
1497
  });
1396
1498
  }
1397
1499
  }, {
@@ -1449,7 +1551,7 @@ const ft = (e) => e === "react" || e === "reactNative", we = ft(U), Ie = "builde
1449
1551
  advanced: !0,
1450
1552
  defaultValue: 0.7041
1451
1553
  }]
1452
- }, kt = {
1554
+ }, componentInfo$6 = {
1453
1555
  name: "Core:Section",
1454
1556
  static: !0,
1455
1557
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -1488,7 +1590,7 @@ const ft = (e) => e === "react" || e === "reactNative", we = ft(U), Ie = "builde
1488
1590
  }
1489
1591
  }
1490
1592
  }]
1491
- }, pt = {
1593
+ }, componentInfo$5 = {
1492
1594
  name: "Symbol",
1493
1595
  noWrap: !0,
1494
1596
  static: !0,
@@ -1521,7 +1623,7 @@ const ft = (e) => e === "react" || e === "reactNative", we = ft(U), Ie = "builde
1521
1623
  hideFromUI: !0,
1522
1624
  type: "boolean"
1523
1625
  }]
1524
- }, Ct = {
1626
+ }, componentInfo$4 = {
1525
1627
  name: "Text",
1526
1628
  static: !0,
1527
1629
  isRSC: !0,
@@ -1540,9 +1642,9 @@ const ft = (e) => e === "react" || e === "reactNative", we = ft(U), Ie = "builde
1540
1642
  textAlign: "center"
1541
1643
  }
1542
1644
  };
1543
- function wt(e) {
1645
+ function Text(e) {
1544
1646
  var t;
1545
- return /* @__PURE__ */ l(
1647
+ return /* @__PURE__ */ jsx(
1546
1648
  "div",
1547
1649
  {
1548
1650
  className: "builder-text",
@@ -1553,7 +1655,7 @@ function wt(e) {
1553
1655
  }
1554
1656
  );
1555
1657
  }
1556
- const It = {
1658
+ const componentInfo$3 = {
1557
1659
  name: "Video",
1558
1660
  canHaveChildren: !0,
1559
1661
  defaultStyles: {
@@ -1635,7 +1737,7 @@ const It = {
1635
1737
  advanced: !0
1636
1738
  }]
1637
1739
  };
1638
- function Tt(e) {
1740
+ function Video(e) {
1639
1741
  var i;
1640
1742
  function t() {
1641
1743
  return {
@@ -1662,7 +1764,7 @@ function Tt(e) {
1662
1764
  ...t()
1663
1765
  };
1664
1766
  }
1665
- return /* @__PURE__ */ l(
1767
+ return /* @__PURE__ */ jsx(
1666
1768
  "video",
1667
1769
  {
1668
1770
  ...n(),
@@ -1682,7 +1784,7 @@ function Tt(e) {
1682
1784
  }
1683
1785
  );
1684
1786
  }
1685
- const Rt = {
1787
+ const componentInfo$2 = {
1686
1788
  name: "Embed",
1687
1789
  static: !0,
1688
1790
  inputs: [{
@@ -1707,30 +1809,30 @@ const Rt = {
1707
1809
  defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1708
1810
  hideFromUI: !0
1709
1811
  }]
1710
- }, Et = ["text/javascript", "application/javascript", "application/ecmascript"], $t = (e) => Et.includes(e.type);
1711
- function Pt(e) {
1712
- const t = Z(null), [n, i] = p(() => []), [a, o] = p(() => []), [r, d] = p(() => !1);
1713
- function c() {
1812
+ }, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
1813
+ function Embed(e) {
1814
+ const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, l] = useState(() => !1);
1815
+ function s() {
1714
1816
  if (!t.current || !t.current.getElementsByTagName)
1715
1817
  return;
1716
- const s = t.current.getElementsByTagName("script");
1717
- for (let u = 0; u < s.length; u++) {
1718
- const m = s[u];
1719
- if (m.src && !n.includes(m.src)) {
1720
- n.push(m.src);
1721
- const y = document.createElement("script");
1722
- y.async = !0, y.src = m.src, document.head.appendChild(y);
1723
- } else if ($t(m) && !a.includes(m.innerText))
1818
+ const c = t.current.getElementsByTagName("script");
1819
+ for (let u = 0; u < c.length; u++) {
1820
+ const f = c[u];
1821
+ if (f.src && !n.includes(f.src)) {
1822
+ n.push(f.src);
1823
+ const h = document.createElement("script");
1824
+ h.async = !0, h.src = f.src, document.head.appendChild(h);
1825
+ } else if (isJsScript(f) && !o.includes(f.innerText))
1724
1826
  try {
1725
- a.push(m.innerText), new Function(m.innerText)();
1726
- } catch (y) {
1727
- console.warn("`Embed`: Error running script:", y);
1827
+ o.push(f.innerText), new Function(f.innerText)();
1828
+ } catch (h) {
1829
+ console.warn("`Embed`: Error running script:", h);
1728
1830
  }
1729
1831
  }
1730
1832
  }
1731
- return P(() => {
1732
- t.current && !r && (d(!0), c());
1733
- }, [t.current, r]), /* @__PURE__ */ l(
1833
+ return useEffect(() => {
1834
+ t.current && !r && (l(!0), s());
1835
+ }, [t.current, r]), /* @__PURE__ */ jsx(
1734
1836
  "div",
1735
1837
  {
1736
1838
  className: "builder-embed",
@@ -1739,8 +1841,8 @@ function Pt(e) {
1739
1841
  }
1740
1842
  );
1741
1843
  }
1742
- function At(e) {
1743
- return /* @__PURE__ */ l(
1844
+ function ImgComponent(e) {
1845
+ return /* @__PURE__ */ jsx(
1744
1846
  "img",
1745
1847
  {
1746
1848
  style: {
@@ -1751,10 +1853,10 @@ function At(e) {
1751
1853
  src: e.imgSrc || e.image,
1752
1854
  ...e.attributes
1753
1855
  },
1754
- V() && e.imgSrc || "default-key"
1856
+ isEditing() && e.imgSrc || "default-key"
1755
1857
  );
1756
1858
  }
1757
- const Bt = {
1859
+ const componentInfo$1 = {
1758
1860
  // friendlyName?
1759
1861
  name: "Raw:Img",
1760
1862
  hideFromInsertMenu: !0,
@@ -1769,38 +1871,36 @@ const Bt = {
1769
1871
  noWrap: !0,
1770
1872
  static: !0
1771
1873
  };
1772
- function Vt(e) {
1773
- const t = Z(null), [n, i] = p(() => []), [a, o] = p(() => []);
1774
- function r() {
1775
- if (t.current && t.current.getElementsByTagName && typeof window < "u") {
1776
- const d = t.current.getElementsByTagName("script");
1777
- for (let c = 0; c < d.length; c++) {
1778
- const s = d[c];
1779
- if (s.src) {
1780
- if (n.includes(s.src))
1781
- continue;
1782
- n.push(s.src);
1783
- const u = document.createElement("script");
1784
- u.async = !0, u.src = s.src, document.head.appendChild(u);
1785
- } else if (!s.type || [
1786
- "text/javascript",
1787
- "application/javascript",
1788
- "application/ecmascript"
1789
- ].includes(s.type)) {
1790
- if (a.includes(s.innerText))
1791
- continue;
1792
- try {
1793
- a.push(s.innerText), new Function(s.innerText)();
1794
- } catch (u) {
1795
- console.warn("`CustomCode`: Error running script:", u);
1796
- }
1874
+ function CustomCode(e) {
1875
+ const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []);
1876
+ return useEffect(() => {
1877
+ var l;
1878
+ if (!((l = t.current) != null && l.getElementsByTagName) || typeof window > "u")
1879
+ return;
1880
+ const r = t.current.getElementsByTagName("script");
1881
+ for (let s = 0; s < r.length; s++) {
1882
+ const c = r[s];
1883
+ if (c.src) {
1884
+ if (n.includes(c.src))
1885
+ continue;
1886
+ n.push(c.src);
1887
+ const u = document.createElement("script");
1888
+ u.async = !0, u.src = c.src, document.head.appendChild(u);
1889
+ } else if (!c.type || [
1890
+ "text/javascript",
1891
+ "application/javascript",
1892
+ "application/ecmascript"
1893
+ ].includes(c.type)) {
1894
+ if (o.includes(c.innerText))
1895
+ continue;
1896
+ try {
1897
+ o.push(c.innerText), new Function(c.innerText)();
1898
+ } catch (u) {
1899
+ console.warn("`CustomCode`: Error running script:", u);
1797
1900
  }
1798
1901
  }
1799
1902
  }
1800
- }
1801
- return P(() => {
1802
- r();
1803
- }, []), /* @__PURE__ */ l(
1903
+ }, []), /* @__PURE__ */ jsx(
1804
1904
  "div",
1805
1905
  {
1806
1906
  ref: t,
@@ -1809,7 +1909,7 @@ function Vt(e) {
1809
1909
  }
1810
1910
  );
1811
1911
  }
1812
- const Ft = {
1912
+ const componentInfo = {
1813
1913
  name: "Custom Code",
1814
1914
  static: !0,
1815
1915
  requiredPermissions: ["editCode"],
@@ -1831,44 +1931,44 @@ const Ft = {
1831
1931
  helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
1832
1932
  advanced: !0
1833
1933
  }]
1834
- }, fe = () => [{
1835
- component: We,
1836
- ...xt
1934
+ }, getDefaultRegisteredComponents = () => [{
1935
+ component: Button,
1936
+ ...componentInfo$a
1837
1937
  }, {
1838
- component: at,
1839
- ...yt
1938
+ component: Columns,
1939
+ ...componentInfo$9
1840
1940
  }, {
1841
- component: Vt,
1842
- ...Ft
1941
+ component: CustomCode,
1942
+ ...componentInfo
1843
1943
  }, {
1844
- component: Pt,
1845
- ...Rt
1944
+ component: Embed,
1945
+ ...componentInfo$2
1846
1946
  }, {
1847
- component: ot,
1848
- ...St
1947
+ component: FragmentComponent,
1948
+ ...componentInfo$8
1849
1949
  }, {
1850
- component: ct,
1851
- ...vt
1950
+ component: Image,
1951
+ ...componentInfo$7
1852
1952
  }, {
1853
- component: At,
1854
- ...Bt
1953
+ component: ImgComponent,
1954
+ ...componentInfo$1
1855
1955
  }, {
1856
- component: st,
1857
- ...kt
1956
+ component: SectionComponent,
1957
+ ...componentInfo$6
1858
1958
  }, {
1859
- component: Yt,
1860
- ...pt
1959
+ component: Symbol$1,
1960
+ ...componentInfo$5
1861
1961
  }, {
1862
- component: wt,
1863
- ...Ct
1962
+ component: Text,
1963
+ ...componentInfo$4
1864
1964
  }, {
1865
- component: Tt,
1866
- ...It
1867
- }], Nt = (e) => {
1868
- var o;
1869
- const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = e.fileUrl ?? ((o = e == null ? void 0 : e.files) == null ? void 0 : o.regular);
1870
- let a = "";
1871
- if (i && t && n && (a += `
1965
+ component: Video,
1966
+ ...componentInfo$3
1967
+ }], getCssFromFont = (e) => {
1968
+ var a;
1969
+ const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], i = e.fileUrl ?? ((a = e == null ? void 0 : e.files) == null ? void 0 : a.regular);
1970
+ let o = "";
1971
+ if (i && t && n && (o += `
1872
1972
  @font-face {
1873
1973
  font-family: "${t}";
1874
1974
  src: local("${n}"), url('${i}') format('woff2');
@@ -1879,34 +1979,34 @@ font-weight: 400;
1879
1979
  for (const r in e.files) {
1880
1980
  if (!(String(Number(r)) === r))
1881
1981
  continue;
1882
- const c = e.files[r];
1883
- c && c !== i && (a += `
1982
+ const s = e.files[r];
1983
+ s && s !== i && (o += `
1884
1984
  @font-face {
1885
1985
  font-family: "${t}";
1886
- src: url('${c}') format('woff2');
1986
+ src: url('${s}') format('woff2');
1887
1987
  font-display: fallback;
1888
1988
  font-weight: ${r};
1889
1989
  }
1890
1990
  `.trim());
1891
1991
  }
1892
- return a;
1893
- }, Wt = ({
1992
+ return o;
1993
+ }, getFontCss = ({
1894
1994
  customFonts: e
1895
1995
  }) => {
1896
1996
  var t;
1897
- return ((t = e == null ? void 0 : e.map((n) => Nt(n))) == null ? void 0 : t.join(" ")) || "";
1898
- }, jt = ({
1997
+ return ((t = e == null ? void 0 : e.map((n) => getCssFromFont(n))) == null ? void 0 : t.join(" ")) || "";
1998
+ }, getCss = ({
1899
1999
  cssCode: e,
1900
2000
  contentId: t
1901
2001
  }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
1902
- function Mt(e) {
1903
- const [t, n] = p(
2002
+ function ContentStyles(e) {
2003
+ const [t, n] = useState(
1904
2004
  () => `
1905
- ${jt({
2005
+ ${getCss({
1906
2006
  cssCode: e.cssCode,
1907
2007
  contentId: e.contentId
1908
2008
  })}
1909
- ${Wt({
2009
+ ${getFontCss({
1910
2010
  customFonts: e.customFonts
1911
2011
  })}
1912
2012
 
@@ -1924,21 +2024,21 @@ ${Wt({
1924
2024
  }
1925
2025
  `.trim()
1926
2026
  );
1927
- return /* @__PURE__ */ l(z, { styles: t });
2027
+ return /* @__PURE__ */ jsx(InlinedStyles, { styles: t });
1928
2028
  }
1929
- const Ut = ({
2029
+ const getContextStateInitialValue = ({
1930
2030
  content: e,
1931
2031
  data: t,
1932
2032
  locale: n
1933
2033
  }) => {
1934
- var o, r, d;
2034
+ var a, r, l;
1935
2035
  const i = {};
1936
- (r = (o = e == null ? void 0 : e.data) == null ? void 0 : o.inputs) == null || r.forEach((c) => {
1937
- var s;
1938
- c.name && c.defaultValue !== void 0 && ((s = e == null ? void 0 : e.data) != null && s.state) && e.data.state[c.name] === void 0 && (i[c.name] = c.defaultValue);
2036
+ (r = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || r.forEach((s) => {
2037
+ var c;
2038
+ s.name && s.defaultValue !== void 0 && ((c = e == null ? void 0 : e.data) != null && c.state) && e.data.state[s.name] === void 0 && (i[s.name] = s.defaultValue);
1939
2039
  });
1940
- const a = {
1941
- ...(d = e == null ? void 0 : e.data) == null ? void 0 : d.state,
2040
+ const o = {
2041
+ ...(l = e == null ? void 0 : e.data) == null ? void 0 : l.state,
1942
2042
  ...t,
1943
2043
  ...n ? {
1944
2044
  locale: n
@@ -1946,9 +2046,9 @@ const Ut = ({
1946
2046
  };
1947
2047
  return {
1948
2048
  ...i,
1949
- ...a
2049
+ ...o
1950
2050
  };
1951
- }, Lt = ({
2051
+ }, getContentInitialValue = ({
1952
2052
  content: e,
1953
2053
  data: t
1954
2054
  }) => e ? {
@@ -1958,8 +2058,8 @@ const Ut = ({
1958
2058
  ...t
1959
2059
  },
1960
2060
  meta: e == null ? void 0 : e.meta
1961
- } : void 0, _t = "0.6.4", Kt = () => {
1962
- Ae("insertMenu", {
2061
+ } : void 0, SDK_VERSION = "0.7.1-0", registerInsertMenu = () => {
2062
+ register("insertMenu", {
1963
2063
  name: "_default",
1964
2064
  default: !0,
1965
2065
  items: [{
@@ -1981,14 +2081,14 @@ const Ut = ({
1981
2081
  }]
1982
2082
  });
1983
2083
  };
1984
- let he = !1;
1985
- const Ot = (e = {}) => {
2084
+ let isSetupForEditing = !1;
2085
+ const setupBrowserForEditing = (e = {}) => {
1986
2086
  var t, n;
1987
- he || (he = !0, F() && ((t = window.parent) == null || t.postMessage({
2087
+ isSetupForEditing || (isSetupForEditing = !0, isBrowser() && ((t = window.parent) == null || t.postMessage({
1988
2088
  type: "builder.sdkInfo",
1989
2089
  data: {
1990
- target: U,
1991
- version: _t,
2090
+ target: TARGET,
2091
+ version: SDK_VERSION,
1992
2092
  supportsPatchUpdates: !1,
1993
2093
  // Supports builder-model="..." attribute which is needed to
1994
2094
  // scope our '+ add block' button styling
@@ -2003,37 +2103,37 @@ const Ot = (e = {}) => {
2003
2103
  }, "*"), window.addEventListener("message", ({
2004
2104
  data: i
2005
2105
  }) => {
2006
- var a, o;
2106
+ var o, a;
2007
2107
  if (i != null && i.type)
2008
2108
  switch (i.type) {
2009
2109
  case "builder.evaluate": {
2010
- const r = i.data.text, d = i.data.arguments || [], c = i.data.id, s = new Function(r);
2011
- let u, m = null;
2110
+ const r = i.data.text, l = i.data.arguments || [], s = i.data.id, c = new Function(r);
2111
+ let u, f = null;
2012
2112
  try {
2013
- u = s.apply(null, d);
2014
- } catch (y) {
2015
- m = y;
2113
+ u = c.apply(null, l);
2114
+ } catch (h) {
2115
+ f = h;
2016
2116
  }
2017
- m ? (a = window.parent) == null || a.postMessage({
2117
+ f ? (o = window.parent) == null || o.postMessage({
2018
2118
  type: "builder.evaluateError",
2019
2119
  data: {
2020
- id: c,
2021
- error: m.message
2120
+ id: s,
2121
+ error: f.message
2022
2122
  }
2023
- }, "*") : u && typeof u.then == "function" ? u.then((y) => {
2024
- var k;
2025
- (k = window.parent) == null || k.postMessage({
2123
+ }, "*") : u && typeof u.then == "function" ? u.then((h) => {
2124
+ var b;
2125
+ (b = window.parent) == null || b.postMessage({
2026
2126
  type: "builder.evaluateResult",
2027
2127
  data: {
2028
- id: c,
2029
- result: y
2128
+ id: s,
2129
+ result: h
2030
2130
  }
2031
2131
  }, "*");
2032
- }).catch(console.error) : (o = window.parent) == null || o.postMessage({
2132
+ }).catch(console.error) : (a = window.parent) == null || a.postMessage({
2033
2133
  type: "builder.evaluateResult",
2034
2134
  data: {
2035
2135
  result: u,
2036
- id: c
2136
+ id: s
2037
2137
  }
2038
2138
  }, "*");
2039
2139
  break;
@@ -2041,10 +2141,10 @@ const Ot = (e = {}) => {
2041
2141
  }
2042
2142
  })));
2043
2143
  };
2044
- function ge(e) {
2144
+ function round(e) {
2045
2145
  return Math.round(e * 1e3) / 1e3;
2046
2146
  }
2047
- const Ht = (e, t, n = !0) => {
2147
+ const findParentElement = (e, t, n = !0) => {
2048
2148
  if (!(e instanceof HTMLElement))
2049
2149
  return null;
2050
2150
  let i = n ? e : e.parentElement;
@@ -2055,28 +2155,28 @@ const Ht = (e, t, n = !0) => {
2055
2155
  return i;
2056
2156
  } while (i = i.parentElement);
2057
2157
  return null;
2058
- }, zt = (e) => Ht(e, (t) => {
2158
+ }, findBuilderParent = (e) => findParentElement(e, (t) => {
2059
2159
  const n = t.getAttribute("builder-id") || t.id;
2060
2160
  return (n == null ? void 0 : n.indexOf("builder-")) === 0;
2061
- }), be = ({
2161
+ }), computeOffset = ({
2062
2162
  event: e,
2063
2163
  target: t
2064
2164
  }) => {
2065
- const n = t.getBoundingClientRect(), i = e.clientX - n.left, a = e.clientY - n.top, o = ge(i / n.width), r = ge(a / n.height);
2165
+ const n = t.getBoundingClientRect(), i = e.clientX - n.left, o = e.clientY - n.top, a = round(i / n.width), r = round(o / n.height);
2066
2166
  return {
2067
- x: o,
2167
+ x: a,
2068
2168
  y: r
2069
2169
  };
2070
- }, qt = (e) => {
2071
- const t = e.target, n = t && zt(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2170
+ }, getInteractionPropertiesForEvent = (e) => {
2171
+ const t = e.target, n = t && findBuilderParent(t), i = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2072
2172
  return {
2073
2173
  targetBuilderElement: i || void 0,
2074
2174
  metadata: {
2075
- targetOffset: t ? be({
2175
+ targetOffset: t ? computeOffset({
2076
2176
  event: e,
2077
2177
  target: t
2078
2178
  }) : void 0,
2079
- builderTargetOffset: n ? be({
2179
+ builderTargetOffset: n ? computeOffset({
2080
2180
  event: e,
2081
2181
  target: n
2082
2182
  }) : void 0,
@@ -2084,91 +2184,89 @@ const Ht = (e, t, n = !0) => {
2084
2184
  }
2085
2185
  };
2086
2186
  };
2087
- function Dt(e) {
2088
- var A, B, N, W, D;
2089
- const t = Z(null), [n, i] = p(
2090
- () => K(e.canTrack) ? e.canTrack : !0
2091
- ), [a, o] = p(() => 0);
2092
- function r(S) {
2093
- var b, v, I, $, j;
2094
- const w = {
2187
+ function EnableEditor(e) {
2188
+ var I, T, R, j, B;
2189
+ const t = useRef(null), [n, i] = useState(() => 0);
2190
+ function o(m) {
2191
+ var y, p, k, w, F;
2192
+ const g = {
2095
2193
  ...e.builderContextSignal.content,
2096
- ...S,
2194
+ ...m,
2097
2195
  data: {
2098
- ...(b = e.builderContextSignal.content) == null ? void 0 : b.data,
2099
- ...S == null ? void 0 : S.data
2196
+ ...(y = e.builderContextSignal.content) == null ? void 0 : y.data,
2197
+ ...m == null ? void 0 : m.data
2100
2198
  },
2101
2199
  meta: {
2102
- ...(v = e.builderContextSignal.content) == null ? void 0 : v.meta,
2103
- ...S == null ? void 0 : S.meta,
2104
- breakpoints: ((I = S == null ? void 0 : S.meta) == null ? void 0 : I.breakpoints) || ((j = ($ = e.builderContextSignal.content) == null ? void 0 : $.meta) == null ? void 0 : j.breakpoints)
2200
+ ...(p = e.builderContextSignal.content) == null ? void 0 : p.meta,
2201
+ ...m == null ? void 0 : m.meta,
2202
+ breakpoints: ((k = m == null ? void 0 : m.meta) == null ? void 0 : k.breakpoints) || ((F = (w = e.builderContextSignal.content) == null ? void 0 : w.meta) == null ? void 0 : F.breakpoints)
2105
2203
  }
2106
2204
  };
2107
- e.setBuilderContextSignal((Ee) => ({
2108
- ...Ee,
2109
- content: w
2205
+ e.setBuilderContextSignal((P) => ({
2206
+ ...P,
2207
+ content: g
2110
2208
  }));
2111
2209
  }
2112
- p(() => 0);
2113
- const [d, c] = p(
2210
+ useState(() => 0);
2211
+ const [a, r] = useState(
2114
2212
  () => !1
2115
2213
  );
2116
- function s(S) {
2117
- var b;
2118
- const { data: w } = S;
2119
- if (w)
2120
- switch (w.type) {
2214
+ function l(m) {
2215
+ var y;
2216
+ const { data: g } = m;
2217
+ if (g)
2218
+ switch (g.type) {
2121
2219
  case "builder.configureSdk": {
2122
- const v = w.data, { breakpoints: I, contentId: $ } = v;
2123
- if (!$ || $ !== ((b = e.builderContextSignal.content) == null ? void 0 : b.id))
2220
+ const p = g.data, { breakpoints: k, contentId: w } = p;
2221
+ if (!w || w !== ((y = e.builderContextSignal.content) == null ? void 0 : y.id))
2124
2222
  return;
2125
- I && r({
2223
+ k && o({
2126
2224
  meta: {
2127
- breakpoints: I
2225
+ breakpoints: k
2128
2226
  }
2129
- }), o(a + 1);
2227
+ }), i(n + 1);
2130
2228
  break;
2131
2229
  }
2132
2230
  case "builder.contentUpdate": {
2133
- const v = w.data, I = v.key || v.alias || v.entry || v.modelName, $ = v.data;
2134
- I === e.model && (r($), o(a + 1));
2231
+ const p = g.data, k = p.key || p.alias || p.entry || p.modelName, w = p.data;
2232
+ k === e.model && (o(w), i(n + 1));
2135
2233
  break;
2136
2234
  }
2137
2235
  }
2138
2236
  }
2139
- function u() {
2140
- var w, b;
2141
- const S = (b = (w = e.builderContextSignal.content) == null ? void 0 : w.data) == null ? void 0 : b.jsCode;
2142
- S && M({
2143
- code: S,
2237
+ function s() {
2238
+ var g, y;
2239
+ const m = (y = (g = e.builderContextSignal.content) == null ? void 0 : g.data) == null ? void 0 : y.jsCode;
2240
+ m && evaluate({
2241
+ code: m,
2144
2242
  context: e.context || {},
2145
2243
  localState: void 0,
2146
2244
  rootState: e.builderContextSignal.rootState,
2147
2245
  rootSetState: e.builderContextSignal.rootSetState
2148
2246
  });
2149
2247
  }
2150
- const [m, y] = p(() => ({})), [k, h] = p(() => !1);
2151
- function x(S) {
2152
- var w, b;
2248
+ const [c, u] = useState(() => ({})), [f, h] = useState(() => !1);
2249
+ function b(m) {
2250
+ var g, y;
2153
2251
  if (e.builderContextSignal.content) {
2154
- const v = (w = e.builderContextSignal.content) == null ? void 0 : w.testVariationId, I = (b = e.builderContextSignal.content) == null ? void 0 : b.id;
2155
- oe({
2252
+ const p = (g = e.builderContextSignal.content) == null ? void 0 : g.testVariationId, k = (y = e.builderContextSignal.content) == null ? void 0 : y.id;
2253
+ _track({
2156
2254
  type: "click",
2157
- canTrack: n,
2158
- contentId: I,
2255
+ canTrack: getDefaultCanTrack(e.canTrack),
2256
+ contentId: k,
2159
2257
  apiKey: e.apiKey,
2160
- variationId: v !== I ? v : void 0,
2161
- ...qt(S),
2162
- unique: !k
2258
+ variationId: p !== k ? p : void 0,
2259
+ ...getInteractionPropertiesForEvent(m),
2260
+ unique: !f
2163
2261
  });
2164
2262
  }
2165
- k || h(!0);
2263
+ f || h(!0);
2166
2264
  }
2167
- function C(S) {
2168
- return S.replace(
2265
+ function d(m) {
2266
+ return m.replace(
2169
2267
  /{{([^}]+)}}/g,
2170
- (w, b) => M({
2171
- code: b,
2268
+ (g, y) => evaluate({
2269
+ code: y,
2172
2270
  context: e.context || {},
2173
2271
  localState: void 0,
2174
2272
  rootState: e.builderContextSignal.rootState,
@@ -2176,38 +2274,38 @@ function Dt(e) {
2176
2274
  })
2177
2275
  );
2178
2276
  }
2179
- function T({ url: S, key: w }) {
2180
- Fe(S).then((b) => b.json()).then((b) => {
2181
- var I, $;
2182
- const v = {
2277
+ function x({ url: m, key: g }) {
2278
+ fetch$1(m).then((y) => y.json()).then((y) => {
2279
+ var k, w;
2280
+ const p = {
2183
2281
  ...e.builderContextSignal.rootState,
2184
- [w]: b
2282
+ [g]: y
2185
2283
  };
2186
- ($ = (I = e.builderContextSignal).rootSetState) == null || $.call(I, v), m[w] = !0;
2187
- }).catch((b) => {
2188
- console.error("error fetching dynamic data", S, b);
2284
+ (w = (k = e.builderContextSignal).rootSetState) == null || w.call(k, p), c[g] = !0;
2285
+ }).catch((y) => {
2286
+ console.error("error fetching dynamic data", m, y);
2189
2287
  });
2190
2288
  }
2191
- function g() {
2192
- var w, b;
2193
- const S = ((b = (w = e.builderContextSignal.content) == null ? void 0 : w.data) == null ? void 0 : b.httpRequests) ?? {};
2194
- Object.entries(S).forEach(([v, I]) => {
2195
- if (I && (!m[v] || V())) {
2196
- const $ = C(I);
2197
- T({
2198
- url: $,
2199
- key: v
2289
+ function v() {
2290
+ var g, y;
2291
+ const m = ((y = (g = e.builderContextSignal.content) == null ? void 0 : g.data) == null ? void 0 : y.httpRequests) ?? {};
2292
+ Object.entries(m).forEach(([p, k]) => {
2293
+ if (k && (!c[p] || isEditing())) {
2294
+ const w = d(k);
2295
+ x({
2296
+ url: w,
2297
+ key: p
2200
2298
  });
2201
2299
  }
2202
2300
  });
2203
2301
  }
2204
- function R() {
2205
- V() && window.dispatchEvent(
2302
+ function C() {
2303
+ isEditing() && window.dispatchEvent(
2206
2304
  new CustomEvent(
2207
2305
  "builder:component:stateChange",
2208
2306
  {
2209
2307
  detail: {
2210
- state: ee(e.builderContextSignal.rootState),
2308
+ state: fastClone(e.builderContextSignal.rootState),
2211
2309
  ref: {
2212
2310
  name: e.model
2213
2311
  }
@@ -2216,90 +2314,119 @@ function Dt(e) {
2216
2314
  )
2217
2315
  );
2218
2316
  }
2219
- return P(() => {
2220
- var S, w;
2221
- if (e.apiKey || _.error(
2222
- "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
2223
- ), F()) {
2224
- if (V() && (o(a + 1), window.addEventListener("message", s), Kt(), Ot({
2225
- ...e.locale ? {
2226
- locale: e.locale
2227
- } : {},
2228
- ...e.includeRefs ? {
2229
- includeRefs: e.includeRefs
2230
- } : {},
2231
- ...e.enrich ? {
2232
- enrich: e.enrich
2233
- } : {}
2234
- }), Object.values(
2235
- e.builderContextSignal.componentInfos
2236
- ).forEach((b) => {
2237
- var I;
2238
- const v = Be(b);
2239
- (I = window.parent) == null || I.postMessage(v, "*");
2240
- }), window.addEventListener(
2241
- "builder:component:stateChangeListenerActivated",
2242
- R
2243
- )), e.builderContextSignal.content) {
2244
- const b = (S = e.builderContextSignal.content) == null ? void 0 : S.testVariationId, v = (w = e.builderContextSignal.content) == null ? void 0 : w.id;
2245
- oe({
2317
+ function S(m) {
2318
+ i(n + 1), window.addEventListener("message", l), registerInsertMenu(), setupBrowserForEditing({
2319
+ ...e.locale ? {
2320
+ locale: e.locale
2321
+ } : {},
2322
+ ...e.includeRefs ? {
2323
+ includeRefs: e.includeRefs
2324
+ } : {},
2325
+ ...e.enrich ? {
2326
+ enrich: e.enrich
2327
+ } : {}
2328
+ }), Object.values(
2329
+ e.builderContextSignal.componentInfos
2330
+ ).forEach((g) => {
2331
+ var p;
2332
+ const y = createRegisterComponentMessage(g);
2333
+ (p = window.parent) == null || p.postMessage(y, "*");
2334
+ }), window.addEventListener(
2335
+ "builder:component:stateChangeListenerActivated",
2336
+ C
2337
+ );
2338
+ }
2339
+ function E(m) {
2340
+ const g = new URL(location.href).searchParams, y = g.get("builder.preview"), p = g.get(
2341
+ `builder.preview.${y}`
2342
+ ), k = g.get("apiKey") || g.get("builder.space");
2343
+ y === e.model && k === e.apiKey && (!e.content || p === e.content.id) && fetchOneEntry({
2344
+ model: e.model,
2345
+ apiKey: e.apiKey,
2346
+ apiVersion: e.builderContextSignal.apiVersion
2347
+ }).then((w) => {
2348
+ w && o(w);
2349
+ });
2350
+ }
2351
+ return useEffect(() => {
2352
+ var m;
2353
+ return (m = t.current) == null || m.addEventListener(
2354
+ "initeditingbldr",
2355
+ S
2356
+ ), () => {
2357
+ var g;
2358
+ return (g = t.current) == null ? void 0 : g.removeEventListener(
2359
+ "initeditingbldr",
2360
+ S
2361
+ );
2362
+ };
2363
+ }, []), useEffect(() => {
2364
+ var m;
2365
+ return (m = t.current) == null || m.addEventListener(
2366
+ "initpreviewingbldr",
2367
+ E
2368
+ ), () => {
2369
+ var g;
2370
+ return (g = t.current) == null ? void 0 : g.removeEventListener(
2371
+ "initpreviewingbldr",
2372
+ E
2373
+ );
2374
+ };
2375
+ }, []), useEffect(() => {
2376
+ var m, g;
2377
+ if (isBrowser()) {
2378
+ if (isEditing() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
2379
+ const p = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, k = (g = e.builderContextSignal.content) == null ? void 0 : g.id, w = e.apiKey;
2380
+ _track({
2246
2381
  type: "impression",
2247
- canTrack: n,
2248
- contentId: v,
2249
- apiKey: e.apiKey,
2250
- variationId: b !== v ? b : void 0
2251
- });
2252
- }
2253
- if (Ve()) {
2254
- const b = new URL(location.href).searchParams, v = b.get("builder.preview"), I = b.get(
2255
- `builder.preview.${v}`
2256
- ), $ = b.get("apiKey") || b.get("builder.space");
2257
- v === e.model && $ === e.apiKey && (!e.content || I === e.content.id) && Se({
2258
- model: e.model,
2259
- apiKey: e.apiKey,
2260
- apiVersion: e.builderContextSignal.apiVersion
2261
- }).then((j) => {
2262
- j && r(j);
2382
+ canTrack: !0,
2383
+ contentId: k,
2384
+ apiKey: w,
2385
+ variationId: p !== k ? p : void 0
2263
2386
  });
2264
2387
  }
2265
- u(), g(), R();
2388
+ isPreviewing() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
2266
2389
  }
2267
- }, []), P(() => {
2268
- e.content && r(e.content);
2269
- }, [e.content]), P(() => {
2270
- }, [d]), P(() => {
2271
- u();
2390
+ }, []), useEffect(() => {
2391
+ e.apiKey || logger.error(
2392
+ "No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
2393
+ ), s(), v(), C();
2394
+ }, []), useEffect(() => {
2395
+ e.content && o(e.content);
2396
+ }, [e.content]), useEffect(() => {
2397
+ }, [a]), useEffect(() => {
2398
+ s();
2272
2399
  }, [
2273
- (B = (A = e.builderContextSignal.content) == null ? void 0 : A.data) == null ? void 0 : B.jsCode,
2400
+ (T = (I = e.builderContextSignal.content) == null ? void 0 : I.data) == null ? void 0 : T.jsCode,
2274
2401
  e.builderContextSignal.rootState
2275
- ]), P(() => {
2276
- g();
2277
- }, [(W = (N = e.builderContextSignal.content) == null ? void 0 : N.data) == null ? void 0 : W.httpRequests]), P(() => {
2278
- R();
2279
- }, [e.builderContextSignal.rootState]), P(() => () => {
2280
- F() && (window.removeEventListener("message", s), window.removeEventListener(
2402
+ ]), useEffect(() => {
2403
+ v();
2404
+ }, [(j = (R = e.builderContextSignal.content) == null ? void 0 : R.data) == null ? void 0 : j.httpRequests]), useEffect(() => {
2405
+ C();
2406
+ }, [e.builderContextSignal.rootState]), useEffect(() => () => {
2407
+ isBrowser() && (window.removeEventListener("message", l), window.removeEventListener(
2281
2408
  "builder:component:stateChangeListenerActivated",
2282
- R
2409
+ C
2283
2410
  ));
2284
- }, []), /* @__PURE__ */ l(ne.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
2411
+ }, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
2285
2412
  "div",
2286
2413
  {
2414
+ key: n,
2287
2415
  ref: t,
2288
- onClick: (S) => x(S),
2289
- "builder-content-id": (D = e.builderContextSignal.content) == null ? void 0 : D.id,
2416
+ onClick: (m) => b(m),
2417
+ "builder-content-id": (B = e.builderContextSignal.content) == null ? void 0 : B.id,
2290
2418
  "builder-model": e.model,
2291
2419
  ...e.showContent ? {} : {
2292
2420
  hidden: !0,
2293
2421
  "aria-hidden": !0
2294
2422
  },
2295
- className: e.classNameProp,
2296
- children: e.children
2423
+ className: e.classNameProp
2297
2424
  },
2298
- a
2425
+ e.children
2299
2426
  ) }) : null });
2300
2427
  }
2301
- function X(e) {
2302
- return /* @__PURE__ */ l(
2428
+ function InlinedScript(e) {
2429
+ return /* @__PURE__ */ jsx(
2303
2430
  "script",
2304
2431
  {
2305
2432
  dangerouslySetInnerHTML: { __html: e.scriptStr },
@@ -2307,52 +2434,52 @@ function X(e) {
2307
2434
  }
2308
2435
  );
2309
2436
  }
2310
- function xe(e) {
2311
- var c, s, u, m, y, k, h;
2312
- const [t, n] = p(
2437
+ function ContentComponent(e) {
2438
+ var s, c, u, f, h, b, d;
2439
+ const [t, n] = useState(
2313
2440
  () => {
2314
- var x, C;
2315
- return bt({
2441
+ var x, v;
2442
+ return getRenderContentScriptString({
2316
2443
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2317
2444
  variationId: (x = e.content) == null ? void 0 : x.testVariationId,
2318
2445
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
2319
- contentId: (C = e.content) == null ? void 0 : C.id
2446
+ contentId: (v = e.content) == null ? void 0 : v.id
2320
2447
  });
2321
2448
  }
2322
2449
  );
2323
2450
  function i(x) {
2324
- d((C) => ({
2325
- ...C,
2451
+ l((v) => ({
2452
+ ...v,
2326
2453
  rootState: x
2327
2454
  }));
2328
2455
  }
2329
- const [a, o] = p(
2456
+ const [o, a] = useState(
2330
2457
  () => [
2331
- ...fe(),
2458
+ ...getDefaultRegisteredComponents(),
2332
2459
  // While this `components` object is deprecated, we must maintain support for it.
2333
2460
  // Since users are able to override our default components, we need to make sure that we do not break such
2334
2461
  // existing usage.
2335
2462
  // This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
2336
2463
  // which is the new standard way of providing custom components, and must therefore take precedence.
2337
- ...re,
2464
+ ...components,
2338
2465
  ...e.customComponents || []
2339
2466
  ].reduce(
2340
- (x, { component: C, ...T }) => ({
2467
+ (x, { component: v, ...C }) => ({
2341
2468
  ...x,
2342
- [T.name]: {
2343
- component: C,
2344
- ...le(T)
2469
+ [C.name]: {
2470
+ component: v,
2471
+ ...serializeComponentInfo(C)
2345
2472
  }
2346
2473
  }),
2347
2474
  {}
2348
2475
  )
2349
- ), [r, d] = p(() => ({
2350
- content: Lt({
2476
+ ), [r, l] = useState(() => ({
2477
+ content: getContentInitialValue({
2351
2478
  content: e.content,
2352
2479
  data: e.data
2353
2480
  }),
2354
2481
  localState: void 0,
2355
- rootState: Ut({
2482
+ rootState: getContextStateInitialValue({
2356
2483
  content: e.content,
2357
2484
  data: e.data,
2358
2485
  locale: e.locale
@@ -2362,31 +2489,31 @@ function xe(e) {
2362
2489
  apiKey: e.apiKey,
2363
2490
  apiVersion: e.apiVersion,
2364
2491
  componentInfos: [
2365
- ...fe(),
2492
+ ...getDefaultRegisteredComponents(),
2366
2493
  // While this `components` object is deprecated, we must maintain support for it.
2367
2494
  // Since users are able to override our default components, we need to make sure that we do not break such
2368
2495
  // existing usage.
2369
2496
  // This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
2370
2497
  // which is the new standard way of providing custom components, and must therefore take precedence.
2371
- ...re,
2498
+ ...components,
2372
2499
  ...e.customComponents || []
2373
2500
  ].reduce(
2374
- (x, { component: C, ...T }) => ({
2501
+ (x, { component: v, ...C }) => ({
2375
2502
  ...x,
2376
- [T.name]: le(T)
2503
+ [C.name]: serializeComponentInfo(C)
2377
2504
  }),
2378
2505
  {}
2379
2506
  ),
2380
2507
  inheritedStyles: {}
2381
2508
  }));
2382
- return /* @__PURE__ */ l(
2383
- Ce.Provider,
2509
+ return /* @__PURE__ */ jsx(
2510
+ ComponentsContext.Provider,
2384
2511
  {
2385
2512
  value: {
2386
- registeredComponents: a
2513
+ registeredComponents: o
2387
2514
  },
2388
- children: /* @__PURE__ */ E(
2389
- Dt,
2515
+ children: /* @__PURE__ */ jsxs(
2516
+ EnableEditor,
2390
2517
  {
2391
2518
  content: e.content,
2392
2519
  model: e.model,
@@ -2399,23 +2526,23 @@ function xe(e) {
2399
2526
  classNameProp: e.classNameProp,
2400
2527
  showContent: e.showContent,
2401
2528
  builderContextSignal: r,
2402
- setBuilderContextSignal: d,
2529
+ setBuilderContextSignal: l,
2403
2530
  children: [
2404
- e.isSsrAbTest ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(X, { scriptStr: t }) }) : null,
2405
- /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
2406
- Mt,
2531
+ e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
2532
+ /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2533
+ ContentStyles,
2407
2534
  {
2408
- contentId: (c = r.content) == null ? void 0 : c.id,
2409
- cssCode: (u = (s = r.content) == null ? void 0 : s.data) == null ? void 0 : u.cssCode,
2410
- customFonts: (y = (m = r.content) == null ? void 0 : m.data) == null ? void 0 : y.customFonts
2535
+ contentId: (s = r.content) == null ? void 0 : s.id,
2536
+ cssCode: (u = (c = r.content) == null ? void 0 : c.data) == null ? void 0 : u.cssCode,
2537
+ customFonts: (h = (f = r.content) == null ? void 0 : f.data) == null ? void 0 : h.customFonts
2411
2538
  }
2412
2539
  ) }),
2413
- /* @__PURE__ */ l(
2414
- ie,
2540
+ /* @__PURE__ */ jsx(
2541
+ Blocks,
2415
2542
  {
2416
- blocks: (h = (k = r.content) == null ? void 0 : k.data) == null ? void 0 : h.blocks,
2543
+ blocks: (d = (b = r.content) == null ? void 0 : b.data) == null ? void 0 : d.blocks,
2417
2544
  context: r,
2418
- registeredComponents: a
2545
+ registeredComponents: o
2419
2546
  }
2420
2547
  )
2421
2548
  ]
@@ -2424,53 +2551,53 @@ function xe(e) {
2424
2551
  }
2425
2552
  );
2426
2553
  }
2427
- function Re(e) {
2428
- var r, d, c;
2429
- const [t, n] = p(
2430
- () => dt({
2431
- canTrack: ce(e.canTrack),
2554
+ function ContentVariants(e) {
2555
+ var r, l, s;
2556
+ const [t, n] = useState(
2557
+ () => checkShouldRunVariants({
2558
+ canTrack: getDefaultCanTrack(e.canTrack),
2432
2559
  content: e.content
2433
2560
  })
2434
2561
  );
2435
2562
  function i() {
2436
- var s;
2437
- return gt(
2438
- L(e.content).map((u) => ({
2563
+ var c;
2564
+ return getVariantsScriptString(
2565
+ getVariants(e.content).map((u) => ({
2439
2566
  id: u.testVariationId,
2440
2567
  testRatio: u.testRatio
2441
2568
  })),
2442
- ((s = e.content) == null ? void 0 : s.id) || ""
2569
+ ((c = e.content) == null ? void 0 : c.id) || ""
2443
2570
  );
2444
2571
  }
2445
- function a() {
2446
- return L(e.content).map((s) => `.variant-${s.testVariationId} { display: none; } `).join("");
2447
- }
2448
2572
  function o() {
2449
- var s;
2573
+ return getVariants(e.content).map((c) => `.variant-${c.testVariationId} { display: none; } `).join("");
2574
+ }
2575
+ function a() {
2576
+ var c;
2450
2577
  return t ? {
2451
2578
  ...e.content,
2452
- testVariationId: (s = e.content) == null ? void 0 : s.id
2453
- } : Ne({
2579
+ testVariationId: (c = e.content) == null ? void 0 : c.id
2580
+ } : handleABTestingSync({
2454
2581
  item: e.content,
2455
- canTrack: ce(e.canTrack)
2582
+ canTrack: getDefaultCanTrack(e.canTrack)
2456
2583
  });
2457
2584
  }
2458
- return P(() => {
2459
- }, []), /* @__PURE__ */ E(f, { children: [
2460
- !e.__isNestedRender && U !== "reactNative" ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(X, { scriptStr: ht() }) }) : null,
2461
- t ? /* @__PURE__ */ E(f, { children: [
2462
- /* @__PURE__ */ l(
2463
- z,
2585
+ return useEffect(() => {
2586
+ }, []), /* @__PURE__ */ jsxs(Fragment, { children: [
2587
+ !e.__isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: getScriptString() }) }) : null,
2588
+ t ? /* @__PURE__ */ jsxs(Fragment, { children: [
2589
+ /* @__PURE__ */ jsx(
2590
+ InlinedStyles,
2464
2591
  {
2465
2592
  id: `variants-styles-${(r = e.content) == null ? void 0 : r.id}`,
2466
- styles: a()
2593
+ styles: o()
2467
2594
  }
2468
2595
  ),
2469
- /* @__PURE__ */ l(X, { scriptStr: i() }),
2470
- (d = L(e.content)) == null ? void 0 : d.map((s) => /* @__PURE__ */ l(
2471
- xe,
2596
+ /* @__PURE__ */ jsx(InlinedScript, { scriptStr: i() }),
2597
+ (l = getVariants(e.content)) == null ? void 0 : l.map((c) => /* @__PURE__ */ jsx(
2598
+ ContentComponent,
2472
2599
  {
2473
- content: s,
2600
+ content: c,
2474
2601
  showContent: !1,
2475
2602
  classNameProp: void 0,
2476
2603
  model: e.model,
@@ -2485,14 +2612,14 @@ function Re(e) {
2485
2612
  enrich: e.enrich,
2486
2613
  isSsrAbTest: t
2487
2614
  },
2488
- s.testVariationId
2615
+ c.testVariationId
2489
2616
  ))
2490
2617
  ] }) : null,
2491
- /* @__PURE__ */ l(
2492
- xe,
2618
+ /* @__PURE__ */ jsx(
2619
+ ContentComponent,
2493
2620
  {
2494
- content: o(),
2495
- classNameProp: `variant-${(c = e.content) == null ? void 0 : c.id}`,
2621
+ content: a(),
2622
+ classNameProp: `variant-${(s = e.content) == null ? void 0 : s.id}`,
2496
2623
  showContent: !0,
2497
2624
  model: e.model,
2498
2625
  data: e.data,
@@ -2509,13 +2636,13 @@ function Re(e) {
2509
2636
  )
2510
2637
  ] });
2511
2638
  }
2512
- const Jt = async ({
2639
+ const fetchSymbolContent = async ({
2513
2640
  builderContextValue: e,
2514
2641
  symbol: t
2515
2642
  }) => {
2516
2643
  if (t != null && t.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
2517
2644
  (e != null && e.apiKey))
2518
- return Se({
2645
+ return fetchOneEntry({
2519
2646
  model: t.model,
2520
2647
  apiKey: e.apiKey,
2521
2648
  apiVersion: e.apiVersion,
@@ -2525,38 +2652,38 @@ const Jt = async ({
2525
2652
  }
2526
2653
  }
2527
2654
  }).catch((n) => {
2528
- _.error("Could not fetch symbol content: ", n);
2655
+ logger.error("Could not fetch symbol content: ", n);
2529
2656
  });
2530
2657
  };
2531
- function Yt(e) {
2532
- var o, r, d;
2658
+ function Symbol$1(e) {
2659
+ var a, r, l;
2533
2660
  function t() {
2534
- var c, s;
2661
+ var s, c;
2535
2662
  return [
2536
2663
  e.attributes.className,
2537
2664
  "builder-symbol",
2538
- (c = e.symbol) != null && c.inline ? "builder-inline-symbol" : void 0,
2539
- (s = e.symbol) != null && s.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2665
+ (s = e.symbol) != null && s.inline ? "builder-inline-symbol" : void 0,
2666
+ (c = e.symbol) != null && c.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2540
2667
  ].filter(Boolean).join(" ");
2541
2668
  }
2542
- const [n, i] = p(() => {
2543
- var c;
2544
- return (c = e.symbol) == null ? void 0 : c.content;
2669
+ const [n, i] = useState(() => {
2670
+ var s;
2671
+ return (s = e.symbol) == null ? void 0 : s.content;
2545
2672
  });
2546
- function a() {
2547
- n || Jt({
2673
+ function o() {
2674
+ n || fetchSymbolContent({
2548
2675
  symbol: e.symbol,
2549
2676
  builderContextValue: e.builderContext
2550
- }).then((c) => {
2551
- c && i(c);
2677
+ }).then((s) => {
2678
+ s && i(s);
2552
2679
  });
2553
2680
  }
2554
- return P(() => {
2555
- a();
2556
- }, []), P(() => {
2557
- a();
2558
- }, [e.symbol]), /* @__PURE__ */ l("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ l(
2559
- Re,
2681
+ return useEffect(() => {
2682
+ o();
2683
+ }, []), useEffect(() => {
2684
+ o();
2685
+ }, [e.symbol]), /* @__PURE__ */ jsx("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ jsx(
2686
+ ContentVariants,
2560
2687
  {
2561
2688
  __isNestedRender: !0,
2562
2689
  apiVersion: e.builderContext.apiVersion,
@@ -2564,40 +2691,40 @@ function Yt(e) {
2564
2691
  context: e.builderContext.context,
2565
2692
  customComponents: Object.values(e.builderComponents),
2566
2693
  data: {
2567
- ...(o = e.symbol) == null ? void 0 : o.data,
2694
+ ...(a = e.symbol) == null ? void 0 : a.data,
2568
2695
  ...e.builderContext.localState,
2569
2696
  ...(r = n == null ? void 0 : n.data) == null ? void 0 : r.state
2570
2697
  },
2571
- model: (d = e.symbol) == null ? void 0 : d.model,
2698
+ model: (l = e.symbol) == null ? void 0 : l.model,
2572
2699
  content: n
2573
2700
  }
2574
2701
  ) });
2575
2702
  }
2576
- const Zt = ie, en = Re;
2703
+ const RenderBlocks = Blocks, RenderContent = ContentVariants;
2577
2704
  export {
2578
- ie as Blocks,
2579
- We as Button,
2580
- at as Columns,
2581
- Re as Content,
2582
- ot as Fragment,
2583
- ct as Image,
2584
- Zt as RenderBlocks,
2585
- en as RenderContent,
2586
- st as Section,
2587
- Yt as Symbol,
2588
- wt as Text,
2589
- Tt as Video,
2590
- an as _processContentResult,
2591
- Be as createRegisterComponentMessage,
2592
- on as fetchBuilderProps,
2593
- rn as fetchEntries,
2594
- Se as fetchOneEntry,
2595
- ln as getAllContent,
2596
- cn as getBuilderSearchParams,
2597
- sn as getContent,
2598
- V as isEditing,
2599
- Ve as isPreviewing,
2600
- Ae as register,
2601
- dn as setEditorSettings,
2602
- un as track
2705
+ Blocks,
2706
+ Button,
2707
+ Columns,
2708
+ ContentVariants as Content,
2709
+ FragmentComponent as Fragment,
2710
+ Image,
2711
+ RenderBlocks,
2712
+ RenderContent,
2713
+ SectionComponent as Section,
2714
+ Symbol$1 as Symbol,
2715
+ Text,
2716
+ Video,
2717
+ M as _processContentResult,
2718
+ createRegisterComponentMessage,
2719
+ W as fetchBuilderProps,
2720
+ L as fetchEntries,
2721
+ fetchOneEntry,
2722
+ O as getAllContent,
2723
+ U as getBuilderSearchParams,
2724
+ D as getContent,
2725
+ isEditing,
2726
+ isPreviewing,
2727
+ register,
2728
+ H as setEditorSettings,
2729
+ K as track
2603
2730
  };