@builder.io/sdk-react-nextjs 0.7.0 → 0.7.1-1

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 (43) hide show
  1. package/lib/browser/USE_CLIENT_BUNDLE-34ca6573.js +23 -0
  2. package/lib/browser/USE_CLIENT_BUNDLE-35cf57f2.mjs +657 -0
  3. package/lib/browser/USE_SERVER_BUNDLE-5f0752b4.mjs +11 -0
  4. package/lib/{edge/USE_SERVER_BUNDLE-105e9ef3.js → browser/USE_SERVER_BUNDLE-da1cf240.js} +1 -1
  5. package/lib/browser/{bundle-3b073b16.mjs → bundle-f0e86750.mjs} +680 -663
  6. package/lib/browser/bundle-fa4c07cb.js +76 -0
  7. package/lib/browser/index.cjs +1 -1
  8. package/lib/browser/index.mjs +7 -7
  9. package/lib/edge/USE_CLIENT_BUNDLE-2841cf29.js +23 -0
  10. package/lib/edge/USE_CLIENT_BUNDLE-aeac6d00.mjs +657 -0
  11. package/lib/edge/USE_SERVER_BUNDLE-015ab545.mjs +11 -0
  12. package/lib/{node/USE_SERVER_BUNDLE-d8c698c8.js → edge/USE_SERVER_BUNDLE-ef1618a6.js} +1 -1
  13. package/lib/edge/{bundle-ed178c62.mjs → bundle-3c711a0f.mjs} +2053 -2008
  14. package/lib/edge/bundle-bfbd5fa6.js +96 -0
  15. package/lib/edge/index.cjs +1 -1
  16. package/lib/edge/index.mjs +7 -7
  17. package/lib/node/USE_CLIENT_BUNDLE-a30d8b97.js +23 -0
  18. package/lib/node/USE_CLIENT_BUNDLE-fc82531c.mjs +657 -0
  19. package/lib/node/USE_SERVER_BUNDLE-25e36fa7.mjs +11 -0
  20. package/lib/{browser/USE_SERVER_BUNDLE-d8c698c8.js → node/USE_SERVER_BUNDLE-b26e79d4.js} +1 -1
  21. package/lib/node/bundle-23b73f20.js +116 -0
  22. package/lib/node/{bundle-3b073b16.mjs → bundle-4a8d8d92.mjs} +895 -781
  23. package/lib/node/index.cjs +1 -1
  24. package/lib/node/index.mjs +7 -7
  25. package/package.json +4 -3
  26. package/types/blocks/image/image.d.ts +1 -1
  27. package/types/constants/sdk-version.d.ts +1 -1
  28. package/types/functions/evaluate/choose-eval.d.ts +6 -0
  29. package/types/functions/evaluate/evaluate.d.ts +1 -5
  30. package/types/functions/evaluate/helpers.d.ts +7 -1
  31. package/types/functions/get-content/types.d.ts +94 -3
  32. package/lib/browser/USE_CLIENT_BUNDLE-3a41b1ba.js +0 -23
  33. package/lib/browser/USE_CLIENT_BUNDLE-fc8c1bc0.mjs +0 -618
  34. package/lib/browser/USE_SERVER_BUNDLE-226a15ac.mjs +0 -11
  35. package/lib/browser/bundle-0fae602b.js +0 -76
  36. package/lib/edge/USE_CLIENT_BUNDLE-0e9f8e67.mjs +0 -618
  37. package/lib/edge/USE_CLIENT_BUNDLE-d48583e8.js +0 -23
  38. package/lib/edge/USE_SERVER_BUNDLE-f6a1e321.mjs +0 -11
  39. package/lib/edge/bundle-0c1d9099.js +0 -96
  40. package/lib/node/USE_CLIENT_BUNDLE-3a41b1ba.js +0 -23
  41. package/lib/node/USE_CLIENT_BUNDLE-fc8c1bc0.mjs +0 -618
  42. package/lib/node/USE_SERVER_BUNDLE-226a15ac.mjs +0 -11
  43. package/lib/node/bundle-0fae602b.js +0 -76
@@ -1,9 +1,9 @@
1
- import { LRUCache as Re } from "lru-cache";
2
- import { jsx as l, Fragment as x, jsxs as w } from "react/jsx-runtime";
3
- import { createElement as Ee } from "react";
4
- import { I as Ae, B as q, a as Ve, b as $e, C as Be, E as Pe, F as Fe, c as Oe, d as We, S as Ne, V as Le, e as Me } from "./USE_CLIENT_BUNDLE-fc8c1bc0.mjs";
1
+ import { LRUCache } from "lru-cache";
2
+ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
3
+ import { createElement } from "react";
4
+ import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, b as Button, C as CustomCode, E as Embed, F as FragmentComponent, c as Image, d as ImgComponent, S as SectionComponent, V as Video, e as EnableEditor } from "./USE_CLIENT_BUNDLE-fc82531c.mjs";
5
5
  import "next/navigation";
6
- const A = (e) => JSON.parse(JSON.stringify(e)), ae = {
6
+ const fastClone = (e) => JSON.parse(JSON.stringify(e)), SIZES = {
7
7
  small: {
8
8
  min: 320,
9
9
  default: 321,
@@ -19,11 +19,11 @@ const A = (e) => JSON.parse(JSON.stringify(e)), ae = {
19
19
  default: 991,
20
20
  max: 1200
21
21
  }
22
- }, G = (e, t = ae) => `@media (max-width: ${t[e].max}px)`, se = ({
22
+ }, getMaxWidthQueryForSize = (e, t = SIZES) => `@media (max-width: ${t[e].max}px)`, getSizesForBreakpoints = ({
23
23
  small: e,
24
24
  medium: t
25
25
  }) => {
26
- const n = A(ae);
26
+ const n = fastClone(SIZES);
27
27
  if (!e || !t)
28
28
  return n;
29
29
  const o = Math.floor(e / 2);
@@ -32,42 +32,42 @@ const A = (e) => JSON.parse(JSON.stringify(e)), ae = {
32
32
  min: o,
33
33
  default: o + 1
34
34
  };
35
- const i = n.small.max + 1;
35
+ const r = n.small.max + 1;
36
36
  n.medium = {
37
37
  max: t,
38
- min: i,
39
- default: i + 1
38
+ min: r,
39
+ default: r + 1
40
40
  };
41
- const r = n.medium.max + 1;
41
+ const i = n.medium.max + 1;
42
42
  return n.large = {
43
43
  max: 2e3,
44
44
  // TODO: decide upper limit
45
- min: r,
46
- default: r + 1
45
+ min: i,
46
+ default: i + 1
47
47
  }, n;
48
- }, I = "rsc", T = "[Builder.io]: ", k = {
49
- log: (...e) => console.log(T, ...e),
50
- error: (...e) => console.error(T, ...e),
51
- warn: (...e) => console.warn(T, ...e),
52
- debug: (...e) => console.debug(T, ...e)
48
+ }, TARGET = "rsc", MSG_PREFIX = "[Builder.io]: ", logger = {
49
+ log: (...e) => console.log(MSG_PREFIX, ...e),
50
+ error: (...e) => console.error(MSG_PREFIX, ...e),
51
+ warn: (...e) => console.warn(MSG_PREFIX, ...e),
52
+ debug: (...e) => console.debug(MSG_PREFIX, ...e)
53
53
  };
54
- function v() {
54
+ function isBrowser() {
55
55
  return typeof window < "u" && typeof document < "u";
56
56
  }
57
- function Ue() {
58
- return v() && window.self !== window.top;
57
+ function isIframe() {
58
+ return isBrowser() && window.self !== window.top;
59
59
  }
60
- function L() {
61
- return Ue() && window.location.search.indexOf("builder.frameEditing=") !== -1;
60
+ function isEditing() {
61
+ return isIframe() && window.location.search.indexOf("builder.frameEditing=") !== -1;
62
62
  }
63
- const _e = () => {
64
- if (v()) {
63
+ const getLocation = () => {
64
+ if (isBrowser()) {
65
65
  const e = new URL(location.href);
66
66
  return e.pathname === "" && (e.pathname = "/"), e;
67
67
  } else
68
68
  return console.warn("Cannot get location for tracking in non-browser environment"), null;
69
- }, je = () => typeof navigator == "object" && navigator.userAgent || "", ce = () => {
70
- const e = je(), t = {
69
+ }, getUserAgent = () => typeof navigator == "object" && navigator.userAgent || "", getUserAttributes = () => {
70
+ const e = getUserAgent(), t = {
71
71
  Android() {
72
72
  return e.match(/Android/i);
73
73
  },
@@ -84,15 +84,15 @@ const _e = () => {
84
84
  return e.match(/IEMobile/i) || e.match(/WPDesktop/i);
85
85
  },
86
86
  any() {
87
- return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() || I === "reactNative";
87
+ return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() || TARGET === "reactNative";
88
88
  }
89
- }, n = e.match(/Tablet|iPad/i), o = _e();
89
+ }, n = e.match(/Tablet|iPad/i), o = getLocation();
90
90
  return {
91
91
  urlPath: o == null ? void 0 : o.pathname,
92
92
  host: (o == null ? void 0 : o.host) || (o == null ? void 0 : o.hostname),
93
93
  device: n ? "tablet" : t.any() ? "mobile" : "desktop"
94
94
  };
95
- }, Ke = ({
95
+ }, getFunctionArguments = ({
96
96
  builder: e,
97
97
  context: t,
98
98
  event: n,
@@ -104,146 +104,248 @@ const _e = () => {
104
104
  builder: e,
105
105
  context: t,
106
106
  event: n
107
- }), He = ({
107
+ }), getBuilderGlobals = () => ({
108
+ isEditing: isEditing(),
109
+ isBrowser: isBrowser(),
110
+ isServer: !isBrowser(),
111
+ getUserAttributes: () => getUserAttributes()
112
+ }), parseCode = (e, {
113
+ isExpression: t = !0
114
+ }) => /* 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 = ({
108
115
  code: e,
109
116
  builder: t,
110
117
  context: n,
111
118
  event: o,
112
- localState: i,
113
- rootSetState: r,
119
+ localState: r,
120
+ rootSetState: i,
114
121
  rootState: a
115
122
  }) => {
116
- const c = Ke({
123
+ const c = getFunctionArguments({
117
124
  builder: t,
118
125
  context: n,
119
126
  event: o,
120
- state: De(a, i, r)
127
+ state: flattenState(a, r, i)
121
128
  });
122
129
  return new Function(...c.map(([s]) => s), e)(...c.map(([, s]) => s));
123
130
  };
124
- function De(e, t, n) {
131
+ function flattenState(e, t, n) {
125
132
  if (e === t)
126
133
  throw new Error("rootState === localState");
127
134
  return new Proxy(e, {
128
- get: (o, i) => t && i in t ? t[i] : e[i],
129
- set: (o, i, r) => {
130
- if (t && i in t)
135
+ get: (o, r) => t && r in t ? t[r] : e[r],
136
+ set: (o, r, i) => {
137
+ if (t && r in t)
131
138
  throw new Error("Writing to local state is not allowed as it is read-only.");
132
- return e[i] = r, n == null || n(e), !0;
139
+ return e[r] = i, n == null || n(e), !0;
133
140
  }
134
141
  });
135
142
  }
136
- function M({
143
+ const noop = () => null;
144
+ let safeDynamicRequire = noop;
145
+ try {
146
+ safeDynamicRequire = eval("require");
147
+ } catch (e) {
148
+ }
149
+ const set = (e, t, n) => {
150
+ if (Object(e) !== e)
151
+ return e;
152
+ const o = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
153
+ return o.slice(0, -1).reduce((r, i, a) => Object(r[i]) === r[i] ? r[i] : r[i] = Math.abs(Number(o[a + 1])) >> 0 === +o[a + 1] ? [] : {}, e)[o[o.length - 1]] = n, e;
154
+ }, 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 = `
155
+ var refToProxy = (obj) => {
156
+ if (typeof obj !== 'object' || obj === null) {
157
+ return obj;
158
+ }
159
+ return new Proxy({}, {
160
+ get(target, key) {
161
+ if (key === 'copySync') {
162
+ return () => obj.copySync();
163
+ }
164
+ const val = obj.getSync(key);
165
+ if (typeof val?.getSync === 'function') {
166
+ return refToProxy(val);
167
+ }
168
+ return val;
169
+ },
170
+ set(target, key, value) {
171
+ const v = typeof value === 'object' ? new ${INJECTED_IVM_GLOBAL}.Reference(value) : value;
172
+ obj.setSync(key, v);
173
+ ${BUILDER_SET_STATE_NAME}(key, value)
174
+ },
175
+ deleteProperty(target, key) {
176
+ obj.deleteSync(key);
177
+ }
178
+ })
179
+ }
180
+ `, processCode = ({
181
+ code: e,
182
+ args: t
183
+ }) => {
184
+ const n = t.map(([o]) => `var ${o} = refToProxy(${getSyncValName(o)}); `).join("");
185
+ return `
186
+ ${REF_TO_PROXY_FN}
187
+ ${n}
188
+ function theFunction() {
189
+ ${e}
190
+ }
191
+
192
+ let output = theFunction()
193
+
194
+ if (typeof output === 'object' && output !== null) {
195
+ output = JSON.stringify(output.copySync ? output.copySync() : output);
196
+ }
197
+
198
+ output;
199
+ `;
200
+ }, getIsolateContext = () => new ivm.Isolate({
201
+ memoryLimit: 128
202
+ }).createContextSync(), runInNode = ({
203
+ code: e,
204
+ builder: t,
205
+ context: n,
206
+ event: o,
207
+ localState: r,
208
+ rootSetState: i,
209
+ rootState: a
210
+ }) => {
211
+ const c = fastClone({
212
+ ...a,
213
+ ...r
214
+ }), s = getFunctionArguments({
215
+ builder: t,
216
+ context: n,
217
+ event: o,
218
+ state: c
219
+ }), u = getIsolateContext(), m = u.global;
220
+ m.setSync("global", m.derefInto()), m.setSync("log", function(...l) {
221
+ console.log(...l);
222
+ }), m.setSync(BUILDER_SET_STATE_NAME, function(l, f) {
223
+ set(a, l, f), i == null || i(a);
224
+ }), s.forEach(([l, f]) => {
225
+ const d = typeof f == "object" ? new ivm.Reference(
226
+ // workaround: methods with default values for arguments is not being cloned over
227
+ l === "builder" ? {
228
+ ...f,
229
+ getUserAttributes: () => f.getUserAttributes()
230
+ } : f
231
+ ) : null;
232
+ m.setSync(getSyncValName(l), d);
233
+ }), m.setSync(INJECTED_IVM_GLOBAL, ivm);
234
+ const h = processCode({
235
+ code: e,
236
+ args: s
237
+ }), p = u.evalSync(h);
238
+ try {
239
+ return JSON.parse(p);
240
+ } catch {
241
+ return p;
242
+ }
243
+ }, chooseBrowserOrServerEval = (e) => isBrowser() ? runInBrowser(e) : runInNode(e);
244
+ function evaluate({
137
245
  code: e,
138
246
  context: t,
139
247
  localState: n,
140
248
  rootState: o,
141
- rootSetState: i,
142
- event: r,
249
+ rootSetState: r,
250
+ event: i,
143
251
  isExpression: a = !0
144
252
  }) {
145
253
  if (e === "") {
146
- k.warn("Skipping evaluation of empty code block.");
254
+ logger.warn("Skipping evaluation of empty code block.");
147
255
  return;
148
256
  }
149
257
  const c = {
150
- isEditing: L(),
151
- isBrowser: v(),
152
- isServer: !v(),
153
- getUserAttributes: () => ce()
154
- }, f = {
155
- code: /* we disable this for cases where we definitely don't want a return */ a && !(e.includes(";") || e.includes(" return ") || e.trim().startsWith("return ")) ? `return (${e});` : e,
156
- builder: c,
258
+ code: parseCode(e, {
259
+ isExpression: a
260
+ }),
261
+ builder: getBuilderGlobals(),
157
262
  context: t,
158
- event: r,
159
- rootSetState: i,
263
+ event: i,
264
+ rootSetState: r,
160
265
  rootState: o,
161
266
  localState: n
162
267
  };
163
268
  try {
164
- return He(f);
165
- } catch (g) {
166
- k.error("Failed code evaluation: " + g.message, {
269
+ return chooseBrowserOrServerEval(c);
270
+ } catch (s) {
271
+ logger.error("Failed code evaluation: " + s.message, {
167
272
  code: e
168
273
  });
169
274
  return;
170
275
  }
171
276
  }
172
- const ze = (e, t, n) => {
173
- if (Object(e) !== e)
174
- return e;
175
- const o = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
176
- return o.slice(0, -1).reduce((i, r, a) => Object(i[r]) === i[r] ? i[r] : i[r] = Math.abs(Number(o[a + 1])) >> 0 === +o[a + 1] ? [] : {}, e)[o[o.length - 1]] = n, e;
177
- };
178
- const qe = ({
277
+ function transformBlock(e) {
278
+ return e;
279
+ }
280
+ const evaluateBindings = ({
179
281
  block: e,
180
282
  context: t,
181
283
  localState: n,
182
284
  rootState: o,
183
- rootSetState: i
285
+ rootSetState: r
184
286
  }) => {
185
287
  if (!e.bindings)
186
288
  return e;
187
- const r = A(e), a = {
188
- ...r,
289
+ const i = fastClone(e), a = {
290
+ ...i,
189
291
  properties: {
190
- ...r.properties
292
+ ...i.properties
191
293
  },
192
294
  actions: {
193
- ...r.actions
295
+ ...i.actions
194
296
  }
195
297
  };
196
298
  for (const c in e.bindings) {
197
- const s = e.bindings[c], u = M({
299
+ const s = e.bindings[c], u = evaluate({
198
300
  code: s,
199
301
  localState: n,
200
302
  rootState: o,
201
- rootSetState: i,
303
+ rootSetState: r,
202
304
  context: t
203
305
  });
204
- ze(a, c, u);
306
+ set(a, c, u);
205
307
  }
206
308
  return a;
207
309
  };
208
- function E({
310
+ function getProcessedBlock({
209
311
  block: e,
210
312
  context: t,
211
313
  shouldEvaluateBindings: n,
212
314
  localState: o,
213
- rootState: i,
214
- rootSetState: r
315
+ rootState: r,
316
+ rootSetState: i
215
317
  }) {
216
318
  const a = e;
217
- return n ? qe({
319
+ return n ? evaluateBindings({
218
320
  block: a,
219
321
  localState: o,
220
- rootState: i,
221
- rootSetState: r,
322
+ rootState: r,
323
+ rootSetState: i,
222
324
  context: t
223
325
  }) : a;
224
326
  }
225
- const Ge = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), C = (e) => e != null, le = (e) => Object.entries(e).map(([n, o]) => {
327
+ const camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), checkIsDefined = (e) => e != null, convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, o]) => {
226
328
  if (typeof o == "string")
227
- return `${Ge(n)}: ${o};`;
228
- }).filter(C), Je = (e) => le(e).join(`
229
- `), B = ({
329
+ return `${camelToKebabCase(n)}: ${o};`;
330
+ }).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
331
+ `), createCssClass = ({
230
332
  mediaQuery: e,
231
333
  className: t,
232
334
  styles: n
233
335
  }) => {
234
336
  const o = `.${t} {
235
- ${Je(n)}
337
+ ${convertStyleMapToCSS(n)}
236
338
  }`;
237
339
  return e ? `${e} {
238
340
  ${o}
239
341
  }` : o;
240
342
  };
241
- function V(e) {
242
- return /* @__PURE__ */ l("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
343
+ function InlinedStyles(e) {
344
+ return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
243
345
  }
244
- function U(e) {
346
+ function BlockStyles(e) {
245
347
  const t = function() {
246
- const i = E({
348
+ const r = getProcessedBlock({
247
349
  block: e.block,
248
350
  localState: e.context.localState,
249
351
  rootState: e.context.rootState,
@@ -251,44 +353,44 @@ function U(e) {
251
353
  context: e.context.context,
252
354
  shouldEvaluateBindings: !0
253
355
  });
254
- return C(i.hide) ? !i.hide : C(i.show) ? i.show : !0;
356
+ return checkIsDefined(r.hide) ? !r.hide : checkIsDefined(r.show) ? r.show : !0;
255
357
  }, n = function() {
256
358
  var d;
257
- const i = E({
359
+ const r = getProcessedBlock({
258
360
  block: e.block,
259
361
  localState: e.context.localState,
260
362
  rootState: e.context.rootState,
261
363
  rootSetState: e.context.rootSetState,
262
364
  context: e.context.context,
263
365
  shouldEvaluateBindings: !0
264
- }), r = i.responsiveStyles, a = e.context.content, c = se(
366
+ }), i = r.responsiveStyles, a = e.context.content, c = getSizesForBreakpoints(
265
367
  ((d = a == null ? void 0 : a.meta) == null ? void 0 : d.breakpoints) || {}
266
- ), s = r == null ? void 0 : r.large, u = r == null ? void 0 : r.medium, f = r == null ? void 0 : r.small, g = i.id;
267
- if (!g)
368
+ ), s = i == null ? void 0 : i.large, u = i == null ? void 0 : i.medium, m = i == null ? void 0 : i.small, h = r.id;
369
+ if (!h)
268
370
  return "";
269
- const p = s ? B({
270
- className: g,
371
+ const p = s ? createCssClass({
372
+ className: h,
271
373
  styles: s
272
- }) : "", m = u ? B({
273
- className: g,
374
+ }) : "", l = u ? createCssClass({
375
+ className: h,
274
376
  styles: u,
275
- mediaQuery: G(
377
+ mediaQuery: getMaxWidthQueryForSize(
276
378
  "medium",
277
379
  c
278
380
  )
279
- }) : "", h = f ? B({
280
- className: g,
281
- styles: f,
282
- mediaQuery: G(
381
+ }) : "", f = m ? createCssClass({
382
+ className: h,
383
+ styles: m,
384
+ mediaQuery: getMaxWidthQueryForSize(
283
385
  "small",
284
386
  c
285
387
  )
286
388
  }) : "";
287
- return [p, m, h].join(" ");
389
+ return [p, l, f].join(" ");
288
390
  };
289
- return /* @__PURE__ */ l(x, { children: n() && t() ? /* @__PURE__ */ l(x, { children: /* @__PURE__ */ l(V, { styles: n() }) }) : null });
391
+ return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
290
392
  }
291
- function Ye(e) {
393
+ function getBlockComponentOptions(e) {
292
394
  var t;
293
395
  return {
294
396
  ...(t = e.component) == null ? void 0 : t.options,
@@ -299,29 +401,29 @@ function Ye(e) {
299
401
  builderBlock: e
300
402
  };
301
403
  }
302
- const Xe = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"], P = (e) => typeof e == "string" && Xe.includes(e.toLowerCase()), Qe = ({
404
+ 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 = ({
303
405
  block: e,
304
406
  context: t,
305
407
  registeredComponents: n
306
408
  }) => {
307
- var r;
308
- const o = (r = E({
409
+ var i;
410
+ const o = (i = getProcessedBlock({
309
411
  block: e,
310
412
  localState: t.localState,
311
413
  rootState: t.rootState,
312
414
  rootSetState: t.rootSetState,
313
415
  context: t.context,
314
416
  shouldEvaluateBindings: !1
315
- }).component) == null ? void 0 : r.name;
417
+ }).component) == null ? void 0 : i.name;
316
418
  if (!o)
317
419
  return null;
318
- const i = n[o];
319
- if (i)
320
- return i;
420
+ const r = n[o];
421
+ if (r)
422
+ return r;
321
423
  console.warn(`
322
424
  Could not find a registered component named "${o}".
323
425
  If you registered it, is the file that registered it imported by the file that needs to render it?`);
324
- }, Ze = ({
426
+ }, getRepeatItemData = ({
325
427
  block: e,
326
428
  context: t
327
429
  }) => {
@@ -331,17 +433,17 @@ const Xe = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen"
331
433
  } = e;
332
434
  if (!(n != null && n.collection))
333
435
  return;
334
- const i = M({
436
+ const r = evaluate({
335
437
  code: n.collection,
336
438
  localState: t.localState,
337
439
  rootState: t.rootState,
338
440
  rootSetState: t.rootSetState,
339
441
  context: t.context
340
442
  });
341
- if (!Array.isArray(i))
443
+ if (!Array.isArray(r))
342
444
  return;
343
- const r = n.collection.split(".").pop(), a = n.itemName || (r ? r + "Item" : "item");
344
- return i.map((s, u) => ({
445
+ const i = n.collection.split(".").pop(), a = n.itemName || (i ? i + "Item" : "item");
446
+ return r.map((s, u) => ({
345
447
  context: {
346
448
  ...t,
347
449
  localState: {
@@ -355,10 +457,10 @@ const Xe = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen"
355
457
  block: o
356
458
  }));
357
459
  };
358
- function et(e) {
460
+ function RepeatedBlock(e) {
359
461
  const t = e.repeatContext;
360
- return /* @__PURE__ */ l(
361
- $,
462
+ return /* @__PURE__ */ jsx(
463
+ Block,
362
464
  {
363
465
  block: e.block,
364
466
  context: t,
@@ -366,10 +468,10 @@ function et(e) {
366
468
  }
367
469
  );
368
470
  }
369
- function tt(e) {
471
+ function capitalizeFirstLetter(e) {
370
472
  return e.charAt(0).toUpperCase() + e.slice(1);
371
473
  }
372
- const nt = (e) => `on${tt(e)}`, ot = (e, t) => (n) => M({
474
+ const getEventHandlerName = (e) => `on${capitalizeFirstLetter(e)}`, createEventHandler = (e, t) => (n) => evaluate({
373
475
  code: e,
374
476
  context: t.context,
375
477
  localState: t.localState,
@@ -378,54 +480,54 @@ const nt = (e) => `on${tt(e)}`, ot = (e, t) => (n) => M({
378
480
  event: n,
379
481
  isExpression: !1
380
482
  });
381
- function On(e) {
483
+ function getBlockActions(e) {
382
484
  const t = {}, n = e.block.actions ?? {};
383
485
  for (const o in n) {
384
486
  if (!n.hasOwnProperty(o))
385
487
  continue;
386
- const i = n[o];
387
- let r = nt(o);
488
+ const r = n[o];
489
+ let i = getEventHandlerName(o);
388
490
  if (e.stripPrefix)
389
- switch (I) {
491
+ switch (TARGET) {
390
492
  case "vue2":
391
493
  case "vue3":
392
- r = r.replace("v-on:", "");
494
+ i = i.replace("v-on:", "");
393
495
  break;
394
496
  case "svelte":
395
- r = r.replace("on:", "");
497
+ i = i.replace("on:", "");
396
498
  break;
397
499
  }
398
- t[r] = ot(i, e);
500
+ t[i] = createEventHandler(r, e);
399
501
  }
400
502
  return t;
401
503
  }
402
- function it(e) {
504
+ function transformBlockProperties(e) {
403
505
  return e.className = e.class, delete e.class, e;
404
506
  }
405
- const rt = (e) => ({
507
+ const extractRelevantRootBlockProperties = (e) => ({
406
508
  href: e.href
407
509
  });
408
- function at({
510
+ function getBlockProperties({
409
511
  block: e,
410
512
  context: t
411
513
  }) {
412
514
  var o;
413
515
  const n = {
414
- ...rt(e),
516
+ ...extractRelevantRootBlockProperties(e),
415
517
  ...e.properties,
416
518
  "builder-id": e.id,
417
- style: e.style ? st(e.style) : void 0,
519
+ style: e.style ? getStyleAttribute(e.style) : void 0,
418
520
  class: [e.id, "builder-block", e.class, (o = e.properties) == null ? void 0 : o.class].filter(Boolean).join(" ")
419
521
  };
420
- return it(n);
522
+ return transformBlockProperties(n);
421
523
  }
422
- function st(e) {
423
- switch (I) {
524
+ function getStyleAttribute(e) {
525
+ switch (TARGET) {
424
526
  case "svelte":
425
527
  case "vue2":
426
528
  case "vue3":
427
529
  case "solid":
428
- return le(e).join(" ");
530
+ return convertStyleMapToCSSArray(e).join(" ");
429
531
  case "qwik":
430
532
  case "reactNative":
431
533
  case "react":
@@ -433,15 +535,15 @@ function st(e) {
433
535
  return e;
434
536
  }
435
537
  }
436
- const ct = ({
538
+ const getWrapperProps = ({
437
539
  componentOptions: e,
438
540
  builderBlock: t,
439
541
  context: n,
440
542
  componentRef: o,
441
- includeBlockProps: i,
442
- isInteractive: r,
543
+ includeBlockProps: r,
544
+ isInteractive: i,
443
545
  contextValue: a
444
- }) => r ? {
546
+ }) => i ? {
445
547
  Wrapper: o,
446
548
  block: t,
447
549
  context: n,
@@ -452,20 +554,20 @@ const ct = ({
452
554
  * If `noWrap` is set to `true`, then the block's props/attributes are provided to the
453
555
  * component itself directly. Otherwise, they are provided to the wrapper element.
454
556
  */
455
- ...i ? {
456
- attributes: at({
557
+ ...r ? {
558
+ attributes: getBlockProperties({
457
559
  block: t,
458
560
  context: a
459
561
  })
460
562
  } : {}
461
563
  };
462
- function J(e) {
564
+ function ComponentRef(e) {
463
565
  var n, o;
464
- const t = e.isInteractive ? Ae : e.componentRef;
465
- return /* @__PURE__ */ l(x, { children: e.componentRef ? /* @__PURE__ */ l(x, { children: /* @__PURE__ */ w(
566
+ const t = e.isInteractive ? InteractiveElement : e.componentRef;
567
+ return /* @__PURE__ */ jsx(Fragment, { children: e.componentRef ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
466
568
  t,
467
569
  {
468
- ...ct({
570
+ ...getWrapperProps({
469
571
  componentOptions: e.componentOptions,
470
572
  builderBlock: e.builderBlock,
471
573
  context: e.context,
@@ -475,42 +577,42 @@ function J(e) {
475
577
  contextValue: e.context
476
578
  }),
477
579
  children: [
478
- (n = e.blockChildren) == null ? void 0 : n.map((i) => /* @__PURE__ */ l(
479
- $,
580
+ (n = e.blockChildren) == null ? void 0 : n.map((r) => /* @__PURE__ */ jsx(
581
+ Block,
480
582
  {
481
- block: i,
583
+ block: r,
482
584
  context: e.context,
483
585
  registeredComponents: e.registeredComponents
484
586
  },
485
- "block-" + i.id
587
+ "block-" + r.id
486
588
  )),
487
- (o = e.blockChildren) == null ? void 0 : o.map((i) => /* @__PURE__ */ l(
488
- U,
589
+ (o = e.blockChildren) == null ? void 0 : o.map((r) => /* @__PURE__ */ jsx(
590
+ BlockStyles,
489
591
  {
490
- block: i,
592
+ block: r,
491
593
  context: e.context
492
594
  },
493
- "block-style-" + i.id
595
+ "block-style-" + r.id
494
596
  ))
495
597
  ]
496
598
  }
497
599
  ) }) : null });
498
600
  }
499
- function $(e) {
500
- var u, f, g, p;
601
+ function Block(e) {
602
+ var u, m, h, p;
501
603
  const t = function() {
502
- return Qe({
604
+ return getComponent({
503
605
  block: e.block,
504
606
  context: e.context,
505
607
  registeredComponents: e.registeredComponents
506
608
  });
507
609
  }, n = function() {
508
- return Ze({
610
+ return getRepeatItemData({
509
611
  block: e.block,
510
612
  context: e.context
511
613
  });
512
614
  }, o = function() {
513
- return n() ? e.block : E({
615
+ return n() ? e.block : getProcessedBlock({
514
616
  block: e.block,
515
617
  localState: e.context.localState,
516
618
  rootState: e.context.rootState,
@@ -518,20 +620,20 @@ function $(e) {
518
620
  context: e.context.context,
519
621
  shouldEvaluateBindings: !0
520
622
  });
521
- }, i = function() {
522
- return e.block.tagName || "div";
523
623
  }, r = function() {
624
+ return e.block.tagName || "div";
625
+ }, i = function() {
524
626
  return "hide" in o() ? !o().hide : "show" in o() ? o().show : !0;
525
627
  }, a = function() {
526
628
  var d;
527
629
  return !((d = t()) != null && d.component) && !n() ? o().children ?? [] : [];
528
630
  }, c = function() {
529
- var h, d, b, S, y;
631
+ var f, d, b, y, g;
530
632
  return {
531
633
  blockChildren: o().children ?? [],
532
- componentRef: (h = t()) == null ? void 0 : h.component,
634
+ componentRef: (f = t()) == null ? void 0 : f.component,
533
635
  componentOptions: {
534
- ...Ye(o()),
636
+ ...getBlockComponentOptions(o()),
535
637
  builderContext: e.context,
536
638
  ...((d = t()) == null ? void 0 : d.name) === "Symbol" || ((b = t()) == null ? void 0 : b.name) === "Columns" ? {
537
639
  builderComponents: e.registeredComponents
@@ -540,72 +642,72 @@ function $(e) {
540
642
  context: s,
541
643
  registeredComponents: e.registeredComponents,
542
644
  builderBlock: o(),
543
- includeBlockProps: ((S = t()) == null ? void 0 : S.noWrap) === !0,
544
- isInteractive: !((y = t()) != null && y.isRSC)
645
+ includeBlockProps: ((y = t()) == null ? void 0 : y.noWrap) === !0,
646
+ isInteractive: !((g = t()) != null && g.isRSC)
545
647
  };
546
648
  }, s = e.context;
547
- return /* @__PURE__ */ l(x, { children: r() ? /* @__PURE__ */ l(x, { children: (u = t()) != null && u.noWrap ? /* @__PURE__ */ l(x, { children: /* @__PURE__ */ l(J, { ...c() }) }) : /* @__PURE__ */ w(x, { children: [
548
- P(i()) ? /* @__PURE__ */ l(x, { children: /* @__PURE__ */ l(
549
- q,
649
+ return /* @__PURE__ */ jsx(Fragment, { children: i() ? /* @__PURE__ */ jsx(Fragment, { children: (u = t()) != null && u.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ComponentRef, { ...c() }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
650
+ isEmptyHtmlElement(r()) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
651
+ BlockWrapper,
550
652
  {
551
- Wrapper: i(),
653
+ Wrapper: r(),
552
654
  block: o(),
553
655
  context: e.context,
554
656
  hasChildren: !1
555
657
  }
556
658
  ) }) : null,
557
- !P(i()) && n() ? /* @__PURE__ */ l(x, { children: (f = n()) == null ? void 0 : f.map((m, h) => /* @__PURE__ */ l(
558
- et,
659
+ !isEmptyHtmlElement(r()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (m = n()) == null ? void 0 : m.map((l, f) => /* @__PURE__ */ jsx(
660
+ RepeatedBlock,
559
661
  {
560
- repeatContext: m.context,
561
- block: m.block,
662
+ repeatContext: l.context,
663
+ block: l.block,
562
664
  registeredComponents: e.registeredComponents
563
665
  },
564
- h
666
+ f
565
667
  )) }) : null,
566
- !P(i()) && !n() ? /* @__PURE__ */ l(x, { children: /* @__PURE__ */ w(
567
- q,
668
+ !isEmptyHtmlElement(r()) && !n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
669
+ BlockWrapper,
568
670
  {
569
- Wrapper: i(),
671
+ Wrapper: r(),
570
672
  block: o(),
571
673
  context: e.context,
572
674
  hasChildren: !0,
573
675
  children: [
574
- /* @__PURE__ */ l(J, { ...c() }),
575
- (g = a()) == null ? void 0 : g.map((m) => /* @__PURE__ */ l(
576
- $,
676
+ /* @__PURE__ */ jsx(ComponentRef, { ...c() }),
677
+ (h = a()) == null ? void 0 : h.map((l) => /* @__PURE__ */ jsx(
678
+ Block,
577
679
  {
578
- block: m,
680
+ block: l,
579
681
  context: s,
580
682
  registeredComponents: e.registeredComponents
581
683
  },
582
- "block-" + m.id
684
+ "block-" + l.id
583
685
  )),
584
- (p = a()) == null ? void 0 : p.map((m) => /* @__PURE__ */ l(
585
- U,
686
+ (p = a()) == null ? void 0 : p.map((l) => /* @__PURE__ */ jsx(
687
+ BlockStyles,
586
688
  {
587
- block: m,
689
+ block: l,
588
690
  context: s
589
691
  },
590
- "block-style-" + m.id
692
+ "block-style-" + l.id
591
693
  ))
592
694
  ]
593
695
  }
594
696
  ) }) : null
595
697
  ] }) }) : null });
596
698
  }
597
- function _(e) {
699
+ function Blocks(e) {
598
700
  var t, n;
599
- return /* @__PURE__ */ w(
600
- Ve,
701
+ return /* @__PURE__ */ jsxs(
702
+ BlocksWrapper,
601
703
  {
602
704
  blocks: e.blocks,
603
705
  parent: e.parent,
604
706
  path: e.path,
605
707
  styleProp: e.styleProp,
606
708
  children: [
607
- e.blocks ? /* @__PURE__ */ l(x, { children: (t = e.blocks) == null ? void 0 : t.map((o) => /* @__PURE__ */ l(
608
- $,
709
+ e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (t = e.blocks) == null ? void 0 : t.map((o) => /* @__PURE__ */ jsx(
710
+ Block,
609
711
  {
610
712
  block: o,
611
713
  context: e.context,
@@ -613,8 +715,8 @@ function _(e) {
613
715
  },
614
716
  "render-block-" + o.id
615
717
  )) }) : null,
616
- e.blocks ? /* @__PURE__ */ l(x, { children: (n = e.blocks) == null ? void 0 : n.map((o) => /* @__PURE__ */ l(
617
- U,
718
+ e.blocks ? /* @__PURE__ */ jsx(Fragment, { children: (n = e.blocks) == null ? void 0 : n.map((o) => /* @__PURE__ */ jsx(
719
+ BlockStyles,
618
720
  {
619
721
  block: o,
620
722
  context: e.context
@@ -625,14 +727,14 @@ function _(e) {
625
727
  }
626
728
  );
627
729
  }
628
- function lt(e) {
629
- var m;
630
- const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", i = function(d) {
730
+ function Columns(e) {
731
+ var l;
732
+ const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", r = function(d) {
631
733
  var b;
632
734
  return ((b = n[d]) == null ? void 0 : b.width) || 100 / n.length;
633
- }, r = function(d) {
735
+ }, i = function(d) {
634
736
  const b = t * (n.length - 1) / n.length;
635
- return `calc(${i(d)}% - ${b}px)`;
737
+ return `calc(${r(d)}% - ${b}px)`;
636
738
  }, a = function({
637
739
  stackedStyle: d,
638
740
  desktopStyle: b
@@ -651,36 +753,36 @@ function lt(e) {
651
753
  desktopStyle: "row"
652
754
  })
653
755
  };
654
- }, f = function(d) {
655
- const b = d === 0 ? 0 : t, S = r(d), y = `${b}px`, D = "100%", z = 0;
756
+ }, m = function(d) {
757
+ const b = d === 0 ? 0 : t, y = i(d), g = `${b}px`, v = "100%", x = 0;
656
758
  return {
657
- width: S,
658
- ["marginLeft"]: y,
759
+ width: y,
760
+ ["marginLeft"]: g,
659
761
  "--column-width-mobile": c({
660
- stackedStyle: D,
661
- desktopStyle: S
762
+ stackedStyle: v,
763
+ desktopStyle: y
662
764
  }),
663
765
  "--column-margin-left-mobile": c({
664
- stackedStyle: z,
665
- desktopStyle: y
766
+ stackedStyle: x,
767
+ desktopStyle: g
666
768
  }),
667
769
  "--column-width-tablet": a({
668
- stackedStyle: D,
669
- desktopStyle: S
770
+ stackedStyle: v,
771
+ desktopStyle: y
670
772
  }),
671
773
  "--column-margin-left-tablet": a({
672
- stackedStyle: z,
673
- desktopStyle: y
774
+ stackedStyle: x,
775
+ desktopStyle: g
674
776
  })
675
777
  };
676
- }, g = function(d) {
677
- var S, y;
678
- return se(
679
- ((y = (S = e.builderContext.content) == null ? void 0 : S.meta) == null ? void 0 : y.breakpoints) || {}
778
+ }, h = function(d) {
779
+ var y, g;
780
+ return getSizesForBreakpoints(
781
+ ((g = (y = e.builderContext.content) == null ? void 0 : y.meta) == null ? void 0 : g.breakpoints) || {}
680
782
  )[d].max;
681
783
  }, p = function() {
682
784
  return `
683
- @media (max-width: ${g("medium")}px) {
785
+ @media (max-width: ${h("medium")}px) {
684
786
  .${e.builderBlock.id}-breakpoints {
685
787
  flex-direction: var(--flex-dir-tablet);
686
788
  align-items: stretch;
@@ -692,7 +794,7 @@ function lt(e) {
692
794
  }
693
795
  }
694
796
 
695
- @media (max-width: ${g("small")}px) {
797
+ @media (max-width: ${h("small")}px) {
696
798
  .${e.builderBlock.id}-breakpoints {
697
799
  flex-direction: var(--flex-dir);
698
800
  align-items: stretch;
@@ -705,23 +807,23 @@ function lt(e) {
705
807
  },
706
808
  `;
707
809
  };
708
- return /* @__PURE__ */ w(x, { children: [
709
- /* @__PURE__ */ w(
810
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
811
+ /* @__PURE__ */ jsxs(
710
812
  "div",
711
813
  {
712
- className: `builder-columns ${e.builderBlock.id}-breakpoints div-119431c8`,
814
+ className: `builder-columns ${e.builderBlock.id}-breakpoints div-666689ca`,
713
815
  style: u(),
714
816
  children: [
715
- /* @__PURE__ */ l(x, { children: /* @__PURE__ */ l(V, { styles: p() }) }),
716
- (m = e.columns) == null ? void 0 : m.map((h, d) => /* @__PURE__ */ Ee(
817
+ /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: p() }) }),
818
+ (l = e.columns) == null ? void 0 : l.map((f, d) => /* @__PURE__ */ createElement(
717
819
  "div",
718
820
  {
719
- className: "builder-column div-119431c8-2",
720
- style: f(d),
821
+ className: "builder-column div-666689ca-2",
822
+ style: m(d),
721
823
  key: d
722
824
  },
723
- /* @__PURE__ */ l(
724
- _,
825
+ /* @__PURE__ */ jsx(
826
+ Blocks,
725
827
  {
726
828
  path: `component.options.columns.${d}.blocks`,
727
829
  parent: e.builderBlock.id,
@@ -730,125 +832,125 @@ function lt(e) {
730
832
  },
731
833
  context: e.builderContext,
732
834
  registeredComponents: e.builderComponents,
733
- blocks: h.blocks
835
+ blocks: f.blocks
734
836
  }
735
837
  )
736
838
  ))
737
839
  ]
738
840
  }
739
841
  ),
740
- /* @__PURE__ */ l("style", { children: `.div-119431c8 {
842
+ /* @__PURE__ */ jsx("style", { children: `.div-666689ca {
741
843
  display: flex;
742
844
  line-height: normal;
743
- }.div-119431c8-2 {
845
+ }.div-666689ca-2 {
744
846
  display: flex;
745
847
  flex-direction: column;
746
848
  align-items: stretch;
747
849
  }` })
748
850
  ] });
749
851
  }
750
- function Y(e) {
852
+ function removeProtocol(e) {
751
853
  return e.replace(/http(s)?:/, "");
752
854
  }
753
- function ut(e = "", t, n) {
754
- const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), i = e.indexOf("?") !== -1 ? "&" : "?";
755
- return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + i + t + "=" + encodeURIComponent(n);
855
+ function updateQueryParam(e = "", t, n) {
856
+ const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), r = e.indexOf("?") !== -1 ? "&" : "?";
857
+ return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + r + t + "=" + encodeURIComponent(n);
756
858
  }
757
- function dt(e, t) {
859
+ function getShopifyImageUrl(e, t) {
758
860
  if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
759
861
  return e;
760
862
  if (t === "master")
761
- return Y(e);
863
+ return removeProtocol(e);
762
864
  const n = e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);
763
865
  if (n) {
764
- const o = e.split(n[0]), i = n[3], r = t.match("x") ? t : `${t}x`;
765
- return Y(`${o[0]}_${r}${i}`);
866
+ const o = e.split(n[0]), r = n[3], i = t.match("x") ? t : `${t}x`;
867
+ return removeProtocol(`${o[0]}_${i}${r}`);
766
868
  }
767
869
  return null;
768
870
  }
769
- function Wn(e) {
871
+ function getSrcSet(e) {
770
872
  if (!e)
771
873
  return e;
772
874
  const t = [100, 200, 400, 800, 1200, 1600, 2e3];
773
875
  if (e.match(/builder\.io/)) {
774
876
  let n = e;
775
877
  const o = Number(e.split("?width=")[1]);
776
- return isNaN(o) || (n = `${n} ${o}w`), t.filter((i) => i !== o).map((i) => `${ut(e, "width", i)} ${i}w`).concat([n]).join(", ");
878
+ return isNaN(o) || (n = `${n} ${o}w`), t.filter((r) => r !== o).map((r) => `${updateQueryParam(e, "width", r)} ${r}w`).concat([n]).join(", ");
777
879
  }
778
- return e.match(/cdn\.shopify\.com/) ? t.map((n) => [dt(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, o]) => `${n} ${o}w`).concat([e]).join(", ") : e;
880
+ return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, o]) => `${n} ${o}w`).concat([e]).join(", ") : e;
779
881
  }
780
- const R = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
882
+ const getVariants = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
781
883
  ...t,
782
884
  testVariationId: t.id,
783
885
  id: e == null ? void 0 : e.id
784
- })), mt = ({
886
+ })), checkShouldRunVariants = ({
785
887
  canTrack: e,
786
888
  content: t
787
- }) => !(!(R(t).length > 0) || !e || v());
788
- function ft(e, t, n) {
889
+ }) => !(!(getVariants(t).length > 0) || !e || isBrowser());
890
+ function bldrAbTest(e, t, n) {
789
891
  var a;
790
892
  function o() {
791
- function c(h, d, b) {
792
- let S = "";
893
+ function c(f, d, b) {
894
+ let y = "";
793
895
  if (b) {
794
- const y = /* @__PURE__ */ new Date();
795
- y.setTime(y.getTime() + b * 24 * 60 * 60 * 1e3), S = "; expires=" + y.toUTCString();
896
+ const g = /* @__PURE__ */ new Date();
897
+ g.setTime(g.getTime() + b * 24 * 60 * 60 * 1e3), y = "; expires=" + g.toUTCString();
796
898
  }
797
- document.cookie = h + "=" + (d || "") + S + "; path=/; Secure; SameSite=None";
899
+ document.cookie = f + "=" + (d || "") + y + "; path=/; Secure; SameSite=None";
798
900
  }
799
- function s(h) {
800
- const d = h + "=", b = document.cookie.split(";");
801
- for (let S = 0; S < b.length; S++) {
802
- let y = b[S];
803
- for (; y.charAt(0) === " "; )
804
- y = y.substring(1, y.length);
805
- if (y.indexOf(d) === 0)
806
- return y.substring(d.length, y.length);
901
+ function s(f) {
902
+ const d = f + "=", b = document.cookie.split(";");
903
+ for (let y = 0; y < b.length; y++) {
904
+ let g = b[y];
905
+ for (; g.charAt(0) === " "; )
906
+ g = g.substring(1, g.length);
907
+ if (g.indexOf(d) === 0)
908
+ return g.substring(d.length, g.length);
807
909
  }
808
910
  return null;
809
911
  }
810
- const u = `builder.tests.${e}`, f = s(u), g = t.map((h) => h.id).concat(e);
811
- if (f && g.includes(f))
812
- return f;
912
+ const u = `builder.tests.${e}`, m = s(u), h = t.map((f) => f.id).concat(e);
913
+ if (m && h.includes(m))
914
+ return m;
813
915
  let p = 0;
814
- const m = Math.random();
815
- for (let h = 0; h < t.length; h++) {
816
- const d = t[h], b = d.testRatio;
817
- if (p += b, m < p)
916
+ const l = Math.random();
917
+ for (let f = 0; f < t.length; f++) {
918
+ const d = t[f], b = d.testRatio;
919
+ if (p += b, l < p)
818
920
  return c(u, d.id), d.id;
819
921
  }
820
922
  return c(u, e), e;
821
923
  }
822
- const i = o(), r = (a = document.currentScript) == null ? void 0 : a.previousElementSibling;
924
+ const r = o(), i = (a = document.currentScript) == null ? void 0 : a.previousElementSibling;
823
925
  if (n) {
824
- r.remove();
926
+ i.remove();
825
927
  const c = document.currentScript;
826
928
  c == null || c.remove();
827
929
  } else {
828
930
  const c = t.concat({
829
931
  id: e
830
- }).filter((s) => s.id !== i).map((s) => `.variant-${s.id} { display: none; }
932
+ }).filter((s) => s.id !== r).map((s) => `.variant-${s.id} { display: none; }
831
933
  `).join("");
832
- r.innerHTML = c;
934
+ i.innerHTML = c;
833
935
  }
834
936
  }
835
- function ht(e, t, n) {
937
+ function bldrCntntScrpt(e, t, n) {
836
938
  var s;
837
939
  if (!navigator.cookieEnabled)
838
940
  return;
839
941
  function o(u) {
840
- const f = u + "=", g = document.cookie.split(";");
841
- for (let p = 0; p < g.length; p++) {
842
- let m = g[p];
843
- for (; m.charAt(0) === " "; )
844
- m = m.substring(1, m.length);
845
- if (m.indexOf(f) === 0)
846
- return m.substring(f.length, m.length);
942
+ const m = u + "=", h = document.cookie.split(";");
943
+ for (let p = 0; p < h.length; p++) {
944
+ let l = h[p];
945
+ for (; l.charAt(0) === " "; )
946
+ l = l.substring(1, l.length);
947
+ if (l.indexOf(m) === 0)
948
+ return l.substring(m.length, l.length);
847
949
  }
848
950
  return null;
849
951
  }
850
- const i = `builder.tests.${t}`, r = o(i), a = (s = document.currentScript) == null ? void 0 : s.parentElement, c = e === t;
851
- if (r === e) {
952
+ const r = `builder.tests.${t}`, i = o(r), a = (s = document.currentScript) == null ? void 0 : s.parentElement, c = e === t;
953
+ if (i === e) {
852
954
  if (c)
853
955
  return;
854
956
  a == null || a.removeAttribute("hidden"), a == null || a.removeAttribute("aria-hidden");
@@ -857,18 +959,18 @@ function ht(e, t, n) {
857
959
  return;
858
960
  }
859
961
  }
860
- const gt = (e) => e === "react" || e === "reactNative", ue = gt(I), de = "builderIoAbTest", me = "builderIoRenderContent", pt = () => {
861
- const e = ft.toString().replace(/\s+/g, " "), t = ht.toString().replace(/\s+/g, " ");
962
+ const getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydrationTarget = getIsHydrationTarget(TARGET), AB_TEST_FN_NAME = "builderIoAbTest", CONTENT_FN_NAME = "builderIoRenderContent", getScriptString = () => {
963
+ const e = bldrAbTest.toString().replace(/\s+/g, " "), t = bldrCntntScrpt.toString().replace(/\s+/g, " ");
862
964
  return `
863
- window.${de} = ${e}
864
- window.${me} = ${t}
965
+ window.${AB_TEST_FN_NAME} = ${e}
966
+ window.${CONTENT_FN_NAME} = ${t}
865
967
  `;
866
- }, bt = (e, t) => `
867
- window.${de}("${t}",${JSON.stringify(e)}, ${ue})`, yt = ({
968
+ }, getVariantsScriptString = (e, t) => `
969
+ window.${AB_TEST_FN_NAME}("${t}",${JSON.stringify(e)}, ${isHydrationTarget})`, getRenderContentScriptString = ({
868
970
  contentId: e,
869
971
  variationId: t
870
972
  }) => `
871
- window.${me}("${t}", "${e}", ${ue})`, xt = {
973
+ window.${CONTENT_FN_NAME}("${t}", "${e}", ${isHydrationTarget})`, componentInfo$a = {
872
974
  name: "Core:Button",
873
975
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
874
976
  defaultStyles: {
@@ -901,7 +1003,7 @@ const gt = (e) => e === "react" || e === "reactNative", ue = gt(I), de = "builde
901
1003
  }],
902
1004
  static: !0,
903
1005
  noWrap: !0
904
- }, St = {
1006
+ }, componentInfo$9 = {
905
1007
  // TODO: ways to statically preprocess JSON for references, functions, etc
906
1008
  name: "Columns",
907
1009
  isRSC: !0,
@@ -1080,7 +1182,7 @@ const gt = (e) => e === "react" || e === "reactNative", ue = gt(I), de = "builde
1080
1182
  });
1081
1183
  }
1082
1184
  const n = e.get("columns");
1083
- Array.isArray(n) && n.find((i) => i.get("width")) && (n.find((r) => !r.get("width")) || n.reduce((c, s) => c + s.get("width"), 0) !== 100) && t();
1185
+ Array.isArray(n) && n.find((r) => r.get("width")) && (n.find((i) => !i.get("width")) || n.reduce((c, s) => c + s.get("width"), 0) !== 100) && t();
1084
1186
  }
1085
1187
  }, {
1086
1188
  name: "space",
@@ -1102,13 +1204,13 @@ const gt = (e) => e === "react" || e === "reactNative", ue = gt(I), de = "builde
1102
1204
  helperText: "When stacking columns for mobile devices, reverse the ordering",
1103
1205
  advanced: !0
1104
1206
  }]
1105
- }, vt = {
1207
+ }, componentInfo$8 = {
1106
1208
  name: "Fragment",
1107
1209
  static: !0,
1108
1210
  hidden: !0,
1109
1211
  canHaveChildren: !0,
1110
1212
  noWrap: !0
1111
- }, kt = {
1213
+ }, componentInfo$7 = {
1112
1214
  name: "Image",
1113
1215
  static: !0,
1114
1216
  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",
@@ -1130,27 +1232,27 @@ const gt = (e) => e === "react" || e === "reactNative", ue = gt(I), de = "builde
1130
1232
  e.delete("srcset"), e.delete("noWebp");
1131
1233
  function n(a, c = 6e4) {
1132
1234
  return new Promise((s, u) => {
1133
- const f = document.createElement("img");
1134
- let g = !1;
1135
- f.onload = () => {
1136
- g = !0, s(f);
1137
- }, f.addEventListener("error", (p) => {
1235
+ const m = document.createElement("img");
1236
+ let h = !1;
1237
+ m.onload = () => {
1238
+ h = !0, s(m);
1239
+ }, m.addEventListener("error", (p) => {
1138
1240
  console.warn("Image load failed", p.error), u(p.error);
1139
- }), f.src = a, setTimeout(() => {
1140
- g || u(new Error("Image load timed out"));
1241
+ }), m.src = a, setTimeout(() => {
1242
+ h || u(new Error("Image load timed out"));
1141
1243
  }, c);
1142
1244
  });
1143
1245
  }
1144
1246
  function o(a) {
1145
1247
  return Math.round(a * 1e3) / 1e3;
1146
1248
  }
1147
- const i = e.get("image"), r = e.get("aspectRatio");
1148
- if (fetch(i).then((a) => a.blob()).then((a) => {
1249
+ const r = e.get("image"), i = e.get("aspectRatio");
1250
+ if (fetch(r).then((a) => a.blob()).then((a) => {
1149
1251
  a.type.includes("svg") && e.set("noWebp", !0);
1150
- }), i && (!r || r === 0.7041))
1151
- return n(i).then((a) => {
1252
+ }), r && (!i || i === 0.7041))
1253
+ return n(r).then((a) => {
1152
1254
  const c = e.get("aspectRatio");
1153
- e.get("image") === i && (!c || c === 0.7041) && a.width && a.height && (e.set("aspectRatio", o(a.height / a.width)), e.set("height", a.height), e.set("width", a.width));
1255
+ e.get("image") === r && (!c || c === 0.7041) && a.width && a.height && (e.set("aspectRatio", o(a.height / a.width)), e.set("height", a.height), e.set("width", a.width));
1154
1256
  });
1155
1257
  }
1156
1258
  }, {
@@ -1208,7 +1310,7 @@ const gt = (e) => e === "react" || e === "reactNative", ue = gt(I), de = "builde
1208
1310
  advanced: !0,
1209
1311
  defaultValue: 0.7041
1210
1312
  }]
1211
- }, wt = {
1313
+ }, componentInfo$6 = {
1212
1314
  name: "Core:Section",
1213
1315
  static: !0,
1214
1316
  image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
@@ -1247,7 +1349,7 @@ const gt = (e) => e === "react" || e === "reactNative", ue = gt(I), de = "builde
1247
1349
  }
1248
1350
  }
1249
1351
  }]
1250
- }, Ct = {
1352
+ }, componentInfo$5 = {
1251
1353
  name: "Symbol",
1252
1354
  noWrap: !0,
1253
1355
  static: !0,
@@ -1280,7 +1382,7 @@ const gt = (e) => e === "react" || e === "reactNative", ue = gt(I), de = "builde
1280
1382
  hideFromUI: !0,
1281
1383
  type: "boolean"
1282
1384
  }]
1283
- }, It = {
1385
+ }, componentInfo$4 = {
1284
1386
  name: "Text",
1285
1387
  static: !0,
1286
1388
  isRSC: !0,
@@ -1299,9 +1401,9 @@ const gt = (e) => e === "react" || e === "reactNative", ue = gt(I), de = "builde
1299
1401
  textAlign: "center"
1300
1402
  }
1301
1403
  };
1302
- function Tt(e) {
1404
+ function Text(e) {
1303
1405
  var t;
1304
- return /* @__PURE__ */ l(
1406
+ return /* @__PURE__ */ jsx(
1305
1407
  "div",
1306
1408
  {
1307
1409
  className: "builder-text",
@@ -1312,7 +1414,7 @@ function Tt(e) {
1312
1414
  }
1313
1415
  );
1314
1416
  }
1315
- const Rt = {
1417
+ const componentInfo$3 = {
1316
1418
  name: "Video",
1317
1419
  canHaveChildren: !0,
1318
1420
  defaultStyles: {
@@ -1393,7 +1495,7 @@ const Rt = {
1393
1495
  defaultValue: !0,
1394
1496
  advanced: !0
1395
1497
  }]
1396
- }, Et = {
1498
+ }, componentInfo$2 = {
1397
1499
  name: "Embed",
1398
1500
  static: !0,
1399
1501
  inputs: [{
@@ -1418,7 +1520,7 @@ const Rt = {
1418
1520
  defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
1419
1521
  hideFromUI: !0
1420
1522
  }]
1421
- }, At = ["text/javascript", "application/javascript", "application/ecmascript"], Nn = (e) => At.includes(e.type), Vt = {
1523
+ }, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type), componentInfo$1 = {
1422
1524
  // friendlyName?
1423
1525
  name: "Raw:Img",
1424
1526
  hideFromInsertMenu: !0,
@@ -1432,7 +1534,7 @@ const Rt = {
1432
1534
  }],
1433
1535
  noWrap: !0,
1434
1536
  static: !0
1435
- }, $t = {
1537
+ }, componentInfo = {
1436
1538
  name: "Custom Code",
1437
1539
  static: !0,
1438
1540
  requiredPermissions: ["editCode"],
@@ -1454,59 +1556,59 @@ const Rt = {
1454
1556
  helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
1455
1557
  advanced: !0
1456
1558
  }]
1457
- }, X = () => [{
1458
- component: $e,
1459
- ...xt
1559
+ }, getDefaultRegisteredComponents = () => [{
1560
+ component: Button,
1561
+ ...componentInfo$a
1460
1562
  }, {
1461
- component: lt,
1462
- ...St
1563
+ component: Columns,
1564
+ ...componentInfo$9
1463
1565
  }, {
1464
- component: Be,
1465
- ...$t
1566
+ component: CustomCode,
1567
+ ...componentInfo
1466
1568
  }, {
1467
- component: Pe,
1468
- ...Et
1569
+ component: Embed,
1570
+ ...componentInfo$2
1469
1571
  }, {
1470
- component: Fe,
1471
- ...vt
1572
+ component: FragmentComponent,
1573
+ ...componentInfo$8
1472
1574
  }, {
1473
- component: Oe,
1474
- ...kt
1575
+ component: Image,
1576
+ ...componentInfo$7
1475
1577
  }, {
1476
- component: We,
1477
- ...Vt
1578
+ component: ImgComponent,
1579
+ ...componentInfo$1
1478
1580
  }, {
1479
- component: Ne,
1480
- ...wt
1581
+ component: SectionComponent,
1582
+ ...componentInfo$6
1481
1583
  }, {
1482
- component: xn,
1483
- ...Ct
1584
+ component: Symbol$1,
1585
+ ...componentInfo$5
1484
1586
  }, {
1485
- component: Tt,
1486
- ...It
1587
+ component: Text,
1588
+ ...componentInfo$4
1487
1589
  }, {
1488
- component: Le,
1489
- ...Rt
1490
- }], Q = [], Ln = (e) => ({
1590
+ component: Video,
1591
+ ...componentInfo$3
1592
+ }], components = [], createRegisterComponentMessage = (e) => ({
1491
1593
  type: "builder.registerComponent",
1492
- data: F(e)
1493
- }), Bt = (e) => {
1594
+ data: serializeComponentInfo(e)
1595
+ }), serializeFn = (e) => {
1494
1596
  const t = e.toString().trim();
1495
1597
  return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
1496
- }, Pt = (e) => typeof e == "function" ? Bt(e) : A(e), F = ({
1598
+ }, serializeValue = (e) => typeof e == "function" ? serializeFn(e) : fastClone(e), serializeComponentInfo = ({
1497
1599
  inputs: e,
1498
1600
  ...t
1499
1601
  }) => ({
1500
- ...A(t),
1501
- inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [i, r]) => ({
1602
+ ...fastClone(t),
1603
+ inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [r, i]) => ({
1502
1604
  ...o,
1503
- [i]: Pt(r)
1605
+ [r]: serializeValue(i)
1504
1606
  }), {}))
1505
- }), Ft = (e) => {
1506
- var r;
1507
- const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = e.fileUrl ?? ((r = e == null ? void 0 : e.files) == null ? void 0 : r.regular);
1508
- let i = "";
1509
- if (o && t && n && (i += `
1607
+ }), getCssFromFont = (e) => {
1608
+ var i;
1609
+ const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = e.fileUrl ?? ((i = e == null ? void 0 : e.files) == null ? void 0 : i.regular);
1610
+ let r = "";
1611
+ if (o && t && n && (r += `
1510
1612
  @font-face {
1511
1613
  font-family: "${t}";
1512
1614
  src: local("${n}"), url('${o}') format('woff2');
@@ -1518,7 +1620,7 @@ font-weight: 400;
1518
1620
  if (!(String(Number(a)) === a))
1519
1621
  continue;
1520
1622
  const s = e.files[a];
1521
- s && s !== o && (i += `
1623
+ s && s !== o && (r += `
1522
1624
  @font-face {
1523
1625
  font-family: "${t}";
1524
1626
  src: url('${s}') format('woff2');
@@ -1527,23 +1629,23 @@ font-weight: ${a};
1527
1629
  }
1528
1630
  `.trim());
1529
1631
  }
1530
- return i;
1531
- }, Ot = ({
1632
+ return r;
1633
+ }, getFontCss = ({
1532
1634
  customFonts: e
1533
1635
  }) => {
1534
1636
  var t;
1535
- return ((t = e == null ? void 0 : e.map((n) => Ft(n))) == null ? void 0 : t.join(" ")) || "";
1536
- }, Wt = ({
1637
+ return ((t = e == null ? void 0 : e.map((n) => getCssFromFont(n))) == null ? void 0 : t.join(" ")) || "";
1638
+ }, getCss = ({
1537
1639
  cssCode: e,
1538
1640
  contentId: t
1539
1641
  }) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "";
1540
- function Nt(e) {
1642
+ function ContentStyles(e) {
1541
1643
  const t = `
1542
- ${Wt({
1644
+ ${getCss({
1543
1645
  cssCode: e.cssCode,
1544
1646
  contentId: e.contentId
1545
1647
  })}
1546
- ${Ot({
1648
+ ${getFontCss({
1547
1649
  customFonts: e.customFonts
1548
1650
  })}
1549
1651
 
@@ -1560,20 +1662,20 @@ ${Ot({
1560
1662
  font-family: inherit;
1561
1663
  }
1562
1664
  `.trim();
1563
- return /* @__PURE__ */ l(V, { styles: t });
1665
+ return /* @__PURE__ */ jsx(InlinedStyles, { styles: t });
1564
1666
  }
1565
- const Lt = ({
1667
+ const getContextStateInitialValue = ({
1566
1668
  content: e,
1567
1669
  data: t,
1568
1670
  locale: n
1569
1671
  }) => {
1570
- var r, a, c;
1672
+ var i, a, c;
1571
1673
  const o = {};
1572
- (a = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || a.forEach((s) => {
1674
+ (a = (i = e == null ? void 0 : e.data) == null ? void 0 : i.inputs) == null || a.forEach((s) => {
1573
1675
  var u;
1574
1676
  s.name && s.defaultValue !== void 0 && ((u = e == null ? void 0 : e.data) != null && u.state) && e.data.state[s.name] === void 0 && (o[s.name] = s.defaultValue);
1575
1677
  });
1576
- const i = {
1678
+ const r = {
1577
1679
  ...(c = e == null ? void 0 : e.data) == null ? void 0 : c.state,
1578
1680
  ...t,
1579
1681
  ...n ? {
@@ -1582,9 +1684,9 @@ const Lt = ({
1582
1684
  };
1583
1685
  return {
1584
1686
  ...o,
1585
- ...i
1687
+ ...r
1586
1688
  };
1587
- }, Mt = ({
1689
+ }, getContentInitialValue = ({
1588
1690
  content: e,
1589
1691
  data: t
1590
1692
  }) => e ? {
@@ -1595,22 +1697,22 @@ const Lt = ({
1595
1697
  },
1596
1698
  meta: e == null ? void 0 : e.meta
1597
1699
  } : void 0;
1598
- function Ut() {
1700
+ function getGlobalThis() {
1599
1701
  return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : globalThis;
1600
1702
  }
1601
- function _t() {
1602
- const e = Ut().fetch;
1703
+ function getFetch() {
1704
+ const e = getGlobalThis().fetch;
1603
1705
  if (typeof e > "u")
1604
1706
  throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
1605
1707
  For more information, read https://github.com/BuilderIO/this-package-uses-fetch`), new Error("Builder SDK could not find a global `fetch` function");
1606
1708
  return e;
1607
1709
  }
1608
- const jt = _t(), Kt = (e) => {
1710
+ const fetch$1 = getFetch(), getTopLevelDomain = (e) => {
1609
1711
  if (e === "localhost" || e === "127.0.0.1")
1610
1712
  return e;
1611
1713
  const t = e.split(".");
1612
1714
  return t.length > 2 ? t.slice(1).join(".") : e;
1613
- }, fe = ({
1715
+ }, getCookieSync = ({
1614
1716
  name: e,
1615
1717
  canTrack: t
1616
1718
  }) => {
@@ -1618,17 +1720,17 @@ const jt = _t(), Kt = (e) => {
1618
1720
  try {
1619
1721
  return t ? (n = document.cookie.split("; ").find((o) => o.startsWith(`${e}=`))) == null ? void 0 : n.split("=")[1] : void 0;
1620
1722
  } catch (o) {
1621
- k.warn("[COOKIE] GET error: ", (o == null ? void 0 : o.message) || o);
1723
+ logger.warn("[COOKIE] GET error: ", (o == null ? void 0 : o.message) || o);
1622
1724
  return;
1623
1725
  }
1624
- }, he = async (e) => fe(e), Ht = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(C).join("; "), Dt = [["secure", ""], ["SameSite", "None"]], zt = ({
1726
+ }, getCookie = async (e) => getCookieSync(e), stringifyCookie = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(checkIsDefined).join("; "), SECURE_CONFIG = [["secure", ""], ["SameSite", "None"]], createCookieString = ({
1625
1727
  name: e,
1626
1728
  value: t,
1627
1729
  expires: n
1628
1730
  }) => {
1629
- const i = (v() ? location.protocol === "https:" : !0) ? Dt : [[]], r = n ? [["expires", n.toUTCString()]] : [[]], a = [[e, t], ...r, ["path", "/"], ["domain", Kt(window.location.hostname)], ...i];
1630
- return Ht(a);
1631
- }, ge = async ({
1731
+ const r = (isBrowser() ? location.protocol === "https:" : !0) ? SECURE_CONFIG : [[]], i = n ? [["expires", n.toUTCString()]] : [[]], a = [[e, t], ...i, ["path", "/"], ["domain", getTopLevelDomain(window.location.hostname)], ...r];
1732
+ return stringifyCookie(a);
1733
+ }, setCookie = async ({
1632
1734
  name: e,
1633
1735
  value: t,
1634
1736
  expires: n,
@@ -1637,98 +1739,98 @@ const jt = _t(), Kt = (e) => {
1637
1739
  try {
1638
1740
  if (!o)
1639
1741
  return;
1640
- const i = zt({
1742
+ const r = createCookieString({
1641
1743
  name: e,
1642
1744
  value: t,
1643
1745
  expires: n
1644
1746
  });
1645
- document.cookie = i;
1646
- } catch (i) {
1647
- k.warn("[COOKIE] SET error: ", (i == null ? void 0 : i.message) || i);
1747
+ document.cookie = r;
1748
+ } catch (r) {
1749
+ logger.warn("[COOKIE] SET error: ", (r == null ? void 0 : r.message) || r);
1648
1750
  }
1649
1751
  };
1650
- function qt() {
1752
+ function uuidv4() {
1651
1753
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
1652
1754
  const t = Math.random() * 16 | 0;
1653
1755
  return (e == "x" ? t : t & 3 | 8).toString(16);
1654
1756
  });
1655
1757
  }
1656
- function pe() {
1657
- return qt().replace(/-/g, "");
1758
+ function uuid() {
1759
+ return uuidv4().replace(/-/g, "");
1658
1760
  }
1659
- const be = "builderSessionId", Gt = async ({
1761
+ const SESSION_LOCAL_STORAGE_KEY = "builderSessionId", getSessionId = async ({
1660
1762
  canTrack: e
1661
1763
  }) => {
1662
1764
  if (!e)
1663
1765
  return;
1664
- const t = await he({
1665
- name: be,
1766
+ const t = await getCookie({
1767
+ name: SESSION_LOCAL_STORAGE_KEY,
1666
1768
  canTrack: e
1667
1769
  });
1668
- if (C(t))
1770
+ if (checkIsDefined(t))
1669
1771
  return t;
1670
1772
  {
1671
- const n = Jt();
1672
- return Yt({
1773
+ const n = createSessionId();
1774
+ return setSessionId({
1673
1775
  id: n,
1674
1776
  canTrack: e
1675
1777
  }), n;
1676
1778
  }
1677
- }, Jt = () => pe(), Yt = ({
1779
+ }, createSessionId = () => uuid(), setSessionId = ({
1678
1780
  id: e,
1679
1781
  canTrack: t
1680
- }) => ge({
1681
- name: be,
1782
+ }) => setCookie({
1783
+ name: SESSION_LOCAL_STORAGE_KEY,
1682
1784
  value: e,
1683
1785
  canTrack: t
1684
- }), ye = () => v() && typeof localStorage < "u" ? localStorage : void 0, Xt = ({
1786
+ }), getLocalStorage = () => isBrowser() && typeof localStorage < "u" ? localStorage : void 0, getLocalStorageItem = ({
1685
1787
  key: e,
1686
1788
  canTrack: t
1687
1789
  }) => {
1688
1790
  var n;
1689
1791
  try {
1690
- return t ? (n = ye()) == null ? void 0 : n.getItem(e) : void 0;
1792
+ return t ? (n = getLocalStorage()) == null ? void 0 : n.getItem(e) : void 0;
1691
1793
  } catch (o) {
1692
1794
  console.debug("[LocalStorage] GET error: ", o);
1693
1795
  return;
1694
1796
  }
1695
- }, Qt = ({
1797
+ }, setLocalStorageItem = ({
1696
1798
  key: e,
1697
1799
  canTrack: t,
1698
1800
  value: n
1699
1801
  }) => {
1700
1802
  var o;
1701
1803
  try {
1702
- t && ((o = ye()) == null || o.setItem(e, n));
1703
- } catch (i) {
1704
- console.debug("[LocalStorage] SET error: ", i);
1804
+ t && ((o = getLocalStorage()) == null || o.setItem(e, n));
1805
+ } catch (r) {
1806
+ console.debug("[LocalStorage] SET error: ", r);
1705
1807
  }
1706
- }, xe = "builderVisitorId", Zt = ({
1808
+ }, VISITOR_LOCAL_STORAGE_KEY = "builderVisitorId", getVisitorId = ({
1707
1809
  canTrack: e
1708
1810
  }) => {
1709
1811
  if (!e)
1710
1812
  return;
1711
- const t = Xt({
1712
- key: xe,
1813
+ const t = getLocalStorageItem({
1814
+ key: VISITOR_LOCAL_STORAGE_KEY,
1713
1815
  canTrack: e
1714
1816
  });
1715
- if (C(t))
1817
+ if (checkIsDefined(t))
1716
1818
  return t;
1717
1819
  {
1718
- const n = en();
1719
- return tn({
1820
+ const n = createVisitorId();
1821
+ return setVisitorId({
1720
1822
  id: n,
1721
1823
  canTrack: e
1722
1824
  }), n;
1723
1825
  }
1724
- }, en = () => pe(), tn = ({
1826
+ }, createVisitorId = () => uuid(), setVisitorId = ({
1725
1827
  id: e,
1726
1828
  canTrack: t
1727
- }) => Qt({
1728
- key: xe,
1829
+ }) => setLocalStorageItem({
1830
+ key: VISITOR_LOCAL_STORAGE_KEY,
1729
1831
  value: e,
1730
1832
  canTrack: t
1731
- }), nn = async ({
1833
+ }), getTrackingEventData = async ({
1732
1834
  canTrack: e
1733
1835
  }) => {
1734
1836
  if (!e)
@@ -1736,46 +1838,46 @@ const be = "builderSessionId", Gt = async ({
1736
1838
  visitorId: void 0,
1737
1839
  sessionId: void 0
1738
1840
  };
1739
- const t = await Gt({
1841
+ const t = await getSessionId({
1740
1842
  canTrack: e
1741
- }), n = Zt({
1843
+ }), n = getVisitorId({
1742
1844
  canTrack: e
1743
1845
  });
1744
1846
  return {
1745
1847
  sessionId: t,
1746
1848
  visitorId: n
1747
1849
  };
1748
- }, on = async ({
1850
+ }, createEvent = async ({
1749
1851
  type: e,
1750
1852
  canTrack: t,
1751
1853
  apiKey: n,
1752
1854
  metadata: o,
1753
- ...i
1855
+ ...r
1754
1856
  }) => ({
1755
1857
  type: e,
1756
1858
  data: {
1757
- ...i,
1859
+ ...r,
1758
1860
  metadata: {
1759
1861
  url: location.href,
1760
1862
  ...o
1761
1863
  },
1762
- ...await nn({
1864
+ ...await getTrackingEventData({
1763
1865
  canTrack: t
1764
1866
  }),
1765
- userAttributes: ce(),
1867
+ userAttributes: getUserAttributes(),
1766
1868
  ownerId: n
1767
1869
  }
1768
1870
  });
1769
- async function rn(e) {
1871
+ async function _track(e) {
1770
1872
  if (!e.apiKey) {
1771
- k.error("Missing API key for track call. Please provide your API key.");
1873
+ logger.error("Missing API key for track call. Please provide your API key.");
1772
1874
  return;
1773
1875
  }
1774
- if (e.canTrack && !L() && (v() || I === "reactNative"))
1876
+ if (e.canTrack && !isEditing() && (isBrowser() || TARGET === "reactNative"))
1775
1877
  return fetch("https://cdn.builder.io/api/v1/track", {
1776
1878
  method: "POST",
1777
1879
  body: JSON.stringify({
1778
- events: [await on(e)]
1880
+ events: [await createEvent(e)]
1779
1881
  }),
1780
1882
  headers: {
1781
1883
  "content-type": "application/json"
@@ -1785,13 +1887,13 @@ async function rn(e) {
1785
1887
  console.error("Failed to track: ", t);
1786
1888
  });
1787
1889
  }
1788
- const Mn = (e) => rn({
1890
+ const track = (e) => _track({
1789
1891
  ...e,
1790
1892
  canTrack: !0
1791
- }), an = "0.7.0", Z = {};
1792
- function sn(e, t) {
1793
- let n = Z[e];
1794
- if (n || (n = Z[e] = []), n.push(t), v()) {
1893
+ }), SDK_VERSION = "0.7.1-0", registry = {};
1894
+ function register(e, t) {
1895
+ let n = registry[e];
1896
+ if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
1795
1897
  const o = {
1796
1898
  type: "builder.register",
1797
1899
  data: {
@@ -1801,13 +1903,13 @@ function sn(e, t) {
1801
1903
  };
1802
1904
  try {
1803
1905
  parent.postMessage(o, "*"), parent !== window && window.postMessage(o, "*");
1804
- } catch (i) {
1805
- console.debug("Could not postmessage", i);
1906
+ } catch (r) {
1907
+ console.debug("Could not postmessage", r);
1806
1908
  }
1807
1909
  }
1808
1910
  }
1809
- const Un = () => {
1810
- sn("insertMenu", {
1911
+ const registerInsertMenu = () => {
1912
+ register("insertMenu", {
1811
1913
  name: "_default",
1812
1914
  default: !0,
1813
1915
  items: [{
@@ -1829,14 +1931,14 @@ const Un = () => {
1829
1931
  }]
1830
1932
  });
1831
1933
  };
1832
- let ee = !1;
1833
- const _n = (e = {}) => {
1934
+ let isSetupForEditing = !1;
1935
+ const setupBrowserForEditing = (e = {}) => {
1834
1936
  var t, n;
1835
- ee || (ee = !0, v() && ((t = window.parent) == null || t.postMessage({
1937
+ isSetupForEditing || (isSetupForEditing = !0, isBrowser() && ((t = window.parent) == null || t.postMessage({
1836
1938
  type: "builder.sdkInfo",
1837
1939
  data: {
1838
- target: I,
1839
- version: an,
1940
+ target: TARGET,
1941
+ version: SDK_VERSION,
1840
1942
  supportsPatchUpdates: !1,
1841
1943
  // Supports builder-model="..." attribute which is needed to
1842
1944
  // scope our '+ add block' button styling
@@ -1851,36 +1953,36 @@ const _n = (e = {}) => {
1851
1953
  }, "*"), window.addEventListener("message", ({
1852
1954
  data: o
1853
1955
  }) => {
1854
- var i, r;
1956
+ var r, i;
1855
1957
  if (o != null && o.type)
1856
1958
  switch (o.type) {
1857
1959
  case "builder.evaluate": {
1858
1960
  const a = o.data.text, c = o.data.arguments || [], s = o.data.id, u = new Function(a);
1859
- let f, g = null;
1961
+ let m, h = null;
1860
1962
  try {
1861
- f = u.apply(null, c);
1963
+ m = u.apply(null, c);
1862
1964
  } catch (p) {
1863
- g = p;
1965
+ h = p;
1864
1966
  }
1865
- g ? (i = window.parent) == null || i.postMessage({
1967
+ h ? (r = window.parent) == null || r.postMessage({
1866
1968
  type: "builder.evaluateError",
1867
1969
  data: {
1868
1970
  id: s,
1869
- error: g.message
1971
+ error: h.message
1870
1972
  }
1871
- }, "*") : f && typeof f.then == "function" ? f.then((p) => {
1872
- var m;
1873
- (m = window.parent) == null || m.postMessage({
1973
+ }, "*") : m && typeof m.then == "function" ? m.then((p) => {
1974
+ var l;
1975
+ (l = window.parent) == null || l.postMessage({
1874
1976
  type: "builder.evaluateResult",
1875
1977
  data: {
1876
1978
  id: s,
1877
1979
  result: p
1878
1980
  }
1879
1981
  }, "*");
1880
- }).catch(console.error) : (r = window.parent) == null || r.postMessage({
1982
+ }).catch(console.error) : (i = window.parent) == null || i.postMessage({
1881
1983
  type: "builder.evaluateResult",
1882
1984
  data: {
1883
- result: f,
1985
+ result: m,
1884
1986
  id: s
1885
1987
  }
1886
1988
  }, "*");
@@ -1889,10 +1991,10 @@ const _n = (e = {}) => {
1889
1991
  }
1890
1992
  })));
1891
1993
  };
1892
- function te(e) {
1994
+ function round(e) {
1893
1995
  return Math.round(e * 1e3) / 1e3;
1894
1996
  }
1895
- const cn = (e, t, n = !0) => {
1997
+ const findParentElement = (e, t, n = !0) => {
1896
1998
  if (!(e instanceof HTMLElement))
1897
1999
  return null;
1898
2000
  let o = n ? e : e.parentElement;
@@ -1903,45 +2005,279 @@ const cn = (e, t, n = !0) => {
1903
2005
  return o;
1904
2006
  } while (o = o.parentElement);
1905
2007
  return null;
1906
- }, ln = (e) => cn(e, (t) => {
2008
+ }, findBuilderParent = (e) => findParentElement(e, (t) => {
1907
2009
  const n = t.getAttribute("builder-id") || t.id;
1908
2010
  return (n == null ? void 0 : n.indexOf("builder-")) === 0;
1909
- }), ne = ({
2011
+ }), computeOffset = ({
1910
2012
  event: e,
1911
2013
  target: t
1912
2014
  }) => {
1913
- const n = t.getBoundingClientRect(), o = e.clientX - n.left, i = e.clientY - n.top, r = te(o / n.width), a = te(i / n.height);
2015
+ const n = t.getBoundingClientRect(), o = e.clientX - n.left, r = e.clientY - n.top, i = round(o / n.width), a = round(r / n.height);
1914
2016
  return {
1915
- x: r,
2017
+ x: i,
1916
2018
  y: a
1917
2019
  };
1918
- }, jn = (e) => {
1919
- const t = e.target, n = t && ln(t), o = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
2020
+ }, getInteractionPropertiesForEvent = (e) => {
2021
+ const t = e.target, n = t && findBuilderParent(t), o = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
1920
2022
  return {
1921
2023
  targetBuilderElement: o || void 0,
1922
2024
  metadata: {
1923
- targetOffset: t ? ne({
2025
+ targetOffset: t ? computeOffset({
1924
2026
  event: e,
1925
2027
  target: t
1926
2028
  }) : void 0,
1927
- builderTargetOffset: n ? ne({
2029
+ builderTargetOffset: n ? computeOffset({
1928
2030
  event: e,
1929
2031
  target: n
1930
2032
  }) : void 0,
1931
2033
  builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
1932
2034
  }
1933
2035
  };
2036
+ }, BUILDER_STORE_PREFIX = "builder.tests", getContentTestKey = (e) => `${BUILDER_STORE_PREFIX}.${e}`, getContentVariationCookie = ({
2037
+ contentId: e
2038
+ }) => getCookie({
2039
+ name: getContentTestKey(e),
2040
+ canTrack: !0
2041
+ }), getContentVariationCookieSync = ({
2042
+ contentId: e
2043
+ }) => getCookieSync({
2044
+ name: getContentTestKey(e),
2045
+ canTrack: !0
2046
+ }), setContentVariationCookie = ({
2047
+ contentId: e,
2048
+ value: t
2049
+ }) => setCookie({
2050
+ name: getContentTestKey(e),
2051
+ value: t,
2052
+ canTrack: !0
2053
+ }), checkIsBuilderContentWithVariations = (e) => checkIsDefined(e.id) && checkIsDefined(e.variations) && Object.keys(e.variations).length > 0, getRandomVariationId = ({
2054
+ id: e,
2055
+ variations: t
2056
+ }) => {
2057
+ var r;
2058
+ let n = 0;
2059
+ const o = Math.random();
2060
+ for (const i in t) {
2061
+ const a = (r = t[i]) == null ? void 0 : r.testRatio;
2062
+ if (n += a, o < n)
2063
+ return i;
2064
+ }
2065
+ return e;
2066
+ }, getAndSetVariantId = (e) => {
2067
+ const t = getRandomVariationId(e);
2068
+ return setContentVariationCookie({
2069
+ contentId: e.id,
2070
+ value: t
2071
+ }).catch((n) => {
2072
+ logger.error("could not store A/B test variation: ", n);
2073
+ }), t;
2074
+ }, getTestFields = ({
2075
+ item: e,
2076
+ testGroupId: t
2077
+ }) => {
2078
+ const n = e.variations[t];
2079
+ return t === e.id || // handle edge-case where `testGroupId` points to non-existing variation
2080
+ !n ? {
2081
+ testVariationId: e.id,
2082
+ testVariationName: "Default"
2083
+ } : {
2084
+ data: n.data,
2085
+ testVariationId: n.id,
2086
+ testVariationName: n.name || (n.id === e.id ? "Default" : "")
2087
+ };
2088
+ }, handleABTestingSync = ({
2089
+ item: e,
2090
+ canTrack: t
2091
+ }) => {
2092
+ if (!t)
2093
+ return e;
2094
+ if (!e)
2095
+ return;
2096
+ if (!checkIsBuilderContentWithVariations(e))
2097
+ return e;
2098
+ const n = getContentVariationCookieSync({
2099
+ contentId: e.id
2100
+ }) || getAndSetVariantId({
2101
+ variations: e.variations,
2102
+ id: e.id
2103
+ }), o = getTestFields({
2104
+ item: e,
2105
+ testGroupId: n
2106
+ });
2107
+ return {
2108
+ ...e,
2109
+ ...o
2110
+ };
2111
+ }, handleABTesting = async ({
2112
+ item: e,
2113
+ canTrack: t
2114
+ }) => {
2115
+ if (!t || !checkIsBuilderContentWithVariations(e))
2116
+ return e;
2117
+ const o = await getContentVariationCookie({
2118
+ contentId: e.id
2119
+ }) || getAndSetVariantId({
2120
+ variations: e.variations,
2121
+ id: e.id
2122
+ }), r = getTestFields({
2123
+ item: e,
2124
+ testGroupId: o
2125
+ });
2126
+ return {
2127
+ ...e,
2128
+ ...r
2129
+ };
2130
+ }, getDefaultCanTrack = (e) => checkIsDefined(e) ? e : !0, getIdFromSearchParams = (e) => {
2131
+ const t = e.get("preview"), n = e.get("overrides." + t);
2132
+ return n || logger.warn("No previewed ID found in search params."), n;
1934
2133
  };
1935
- function un() {
1936
- globalThis._BUILDER_PREVIEW_LRU_CACHE || (globalThis._BUILDER_PREVIEW_LRU_CACHE = new Re({
2134
+ function init() {
2135
+ globalThis._BUILDER_PREVIEW_LRU_CACHE || (globalThis._BUILDER_PREVIEW_LRU_CACHE = new LRUCache({
1937
2136
  max: 500,
1938
2137
  // how long to live in ms
1939
2138
  ttl: 1e3 * 60 * 5
1940
2139
  }));
1941
2140
  }
1942
- const O = (e) => C(e) ? e : !0;
1943
- function W(e) {
1944
- return /* @__PURE__ */ l(
2141
+ function getPreviewContent(e) {
2142
+ init();
2143
+ const t = getIdFromSearchParams(e);
2144
+ return typeof t == "string" ? globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t) : void 0;
2145
+ }
2146
+ function flatten(e, t = null, n = ".") {
2147
+ return Object.keys(e).reduce((o, r) => {
2148
+ const i = e[r], a = [t, r].filter(Boolean).join(n);
2149
+ return [typeof i == "object", i !== null, !(Array.isArray(i) && i.length === 0)].every(Boolean) ? {
2150
+ ...o,
2151
+ ...flatten(i, a, n)
2152
+ } : {
2153
+ ...o,
2154
+ [a]: i
2155
+ };
2156
+ }, {});
2157
+ }
2158
+ const BUILDER_SEARCHPARAMS_PREFIX = "builder.", BUILDER_OPTIONS_PREFIX = "options.", convertSearchParamsToQueryObject = (e) => {
2159
+ const t = {};
2160
+ return e.forEach((n, o) => {
2161
+ t[o] = n;
2162
+ }), t;
2163
+ }, getBuilderSearchParams = (e) => {
2164
+ if (!e)
2165
+ return {};
2166
+ const t = normalizeSearchParams(e), n = {};
2167
+ return Object.keys(t).forEach((o) => {
2168
+ if (o.startsWith(BUILDER_SEARCHPARAMS_PREFIX)) {
2169
+ const r = o.replace(BUILDER_SEARCHPARAMS_PREFIX, "").replace(BUILDER_OPTIONS_PREFIX, "");
2170
+ n[r] = t[o];
2171
+ }
2172
+ }), n;
2173
+ }, getBuilderSearchParamsFromWindow = () => {
2174
+ if (!isBrowser())
2175
+ return {};
2176
+ const e = new URLSearchParams(window.location.search);
2177
+ return getBuilderSearchParams(e);
2178
+ }, normalizeSearchParams = (e) => e instanceof URLSearchParams ? convertSearchParamsToQueryObject(e) : e, DEFAULT_API_VERSION = "v3", isPositiveNumber = (e) => typeof e == "number" && !isNaN(e) && e >= 0, generateContentUrl = (e) => {
2179
+ let {
2180
+ noTraverse: t = !1
2181
+ } = e;
2182
+ const {
2183
+ limit: n = 30,
2184
+ userAttributes: o,
2185
+ query: r,
2186
+ model: i,
2187
+ apiKey: a,
2188
+ includeRefs: c = !0,
2189
+ enrich: s,
2190
+ locale: u,
2191
+ apiVersion: m = DEFAULT_API_VERSION,
2192
+ fields: h,
2193
+ omit: p,
2194
+ offset: l,
2195
+ cacheSeconds: f,
2196
+ staleCacheSeconds: d,
2197
+ sort: b,
2198
+ includeUnpublished: y
2199
+ } = e;
2200
+ if (!a)
2201
+ throw new Error("Missing API key");
2202
+ if (!["v2", "v3"].includes(m))
2203
+ throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${m}'`);
2204
+ (e.limit === void 0 || e.limit > 1) && !("noTraverse" in e) && (t = !0);
2205
+ const g = new URL(`https://cdn.builder.io/api/${m}/content/${i}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${c}${u ? `&locale=${u}` : ""}${s ? `&enrich=${s}` : ""}`);
2206
+ if (g.searchParams.set("omit", p || "meta.componentsUsed"), h && g.searchParams.set("fields", h), Number.isFinite(l) && l > -1 && g.searchParams.set("offset", String(Math.floor(l))), typeof y == "boolean" && g.searchParams.set("includeUnpublished", String(y)), f && isPositiveNumber(f) && g.searchParams.set("cacheSeconds", String(f)), d && isPositiveNumber(d) && g.searchParams.set("staleCacheSeconds", String(d)), b) {
2207
+ const S = flatten({
2208
+ sort: b
2209
+ });
2210
+ for (const C in S)
2211
+ g.searchParams.set(C, JSON.stringify(S[C]));
2212
+ }
2213
+ const v = {
2214
+ ...getBuilderSearchParamsFromWindow(),
2215
+ ...normalizeSearchParams(e.options || {})
2216
+ }, x = flatten(v);
2217
+ for (const S in x)
2218
+ g.searchParams.set(S, String(x[S]));
2219
+ if (o && g.searchParams.set("userAttributes", JSON.stringify(o)), r) {
2220
+ const S = flatten({
2221
+ query: r
2222
+ });
2223
+ for (const C in S)
2224
+ g.searchParams.set(C, JSON.stringify(S[C]));
2225
+ }
2226
+ return g;
2227
+ }, checkContentHasResults = (e) => "results" in e;
2228
+ async function fetchOneEntry(e) {
2229
+ const t = await fetchEntries({
2230
+ ...e,
2231
+ limit: 1
2232
+ });
2233
+ return t && t.results[0] || null;
2234
+ }
2235
+ const getContent = fetchOneEntry, _fetchContent = async (e) => {
2236
+ const t = generateContentUrl(e);
2237
+ return await (await fetch$1(t.href)).json();
2238
+ }, _processContentResult = async (e, t, n = generateContentUrl(e)) => {
2239
+ const o = getDefaultCanTrack(e.canTrack);
2240
+ if (n.search.includes("preview=")) {
2241
+ const i = [];
2242
+ for (const a of t.results) {
2243
+ const c = getPreviewContent(n.searchParams);
2244
+ i.push(c || a);
2245
+ }
2246
+ t.results = i;
2247
+ }
2248
+ if (!o || !(isBrowser() || TARGET === "reactNative"))
2249
+ return t;
2250
+ try {
2251
+ const i = [];
2252
+ for (const a of t.results)
2253
+ i.push(await handleABTesting({
2254
+ item: a,
2255
+ canTrack: o
2256
+ }));
2257
+ t.results = i;
2258
+ } catch (i) {
2259
+ logger.error("Could not process A/B tests. ", i);
2260
+ }
2261
+ return t;
2262
+ };
2263
+ async function fetchEntries(e) {
2264
+ try {
2265
+ const t = generateContentUrl(e), n = await _fetchContent(e);
2266
+ return checkContentHasResults(n) ? _processContentResult(e, n) : (logger.error("Error fetching data. ", {
2267
+ url: t,
2268
+ content: n,
2269
+ options: e
2270
+ }), null);
2271
+ } catch (t) {
2272
+ return logger.error("Error fetching data. ", t), null;
2273
+ }
2274
+ }
2275
+ const getAllContent = fetchEntries;
2276
+ function isPreviewing() {
2277
+ return !isBrowser() || isEditing() ? !1 : location.search.indexOf("builder.preview=") !== -1;
2278
+ }
2279
+ function InlinedScript(e) {
2280
+ return /* @__PURE__ */ jsx(
1945
2281
  "script",
1946
2282
  {
1947
2283
  dangerouslySetInnerHTML: { __html: e.scriptStr },
@@ -1949,38 +2285,38 @@ function W(e) {
1949
2285
  }
1950
2286
  );
1951
2287
  }
1952
- function oe(e) {
1953
- var i, r, a, c, s, u, f, g, p;
1954
- const t = yt({
2288
+ function ContentComponent(e) {
2289
+ var r, i, a, c, s, u, m, h, p;
2290
+ const t = getRenderContentScriptString({
1955
2291
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
1956
- variationId: (i = e.content) == null ? void 0 : i.testVariationId,
2292
+ variationId: (r = e.content) == null ? void 0 : r.testVariationId,
1957
2293
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
1958
- contentId: (r = e.content) == null ? void 0 : r.id
2294
+ contentId: (i = e.content) == null ? void 0 : i.id
1959
2295
  }), n = [
1960
- ...X(),
2296
+ ...getDefaultRegisteredComponents(),
1961
2297
  // While this `components` object is deprecated, we must maintain support for it.
1962
2298
  // Since users are able to override our default components, we need to make sure that we do not break such
1963
2299
  // existing usage.
1964
2300
  // This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
1965
2301
  // which is the new standard way of providing custom components, and must therefore take precedence.
1966
- ...Q,
2302
+ ...components,
1967
2303
  ...e.customComponents || []
1968
2304
  ].reduce(
1969
- (m, { component: h, ...d }) => ({
1970
- ...m,
2305
+ (l, { component: f, ...d }) => ({
2306
+ ...l,
1971
2307
  [d.name]: {
1972
- component: h,
1973
- ...F(d)
2308
+ component: f,
2309
+ ...serializeComponentInfo(d)
1974
2310
  }
1975
2311
  }),
1976
2312
  {}
1977
2313
  ), o = {
1978
- content: Mt({
2314
+ content: getContentInitialValue({
1979
2315
  content: e.content,
1980
2316
  data: e.data
1981
2317
  }),
1982
2318
  localState: void 0,
1983
- rootState: Lt({
2319
+ rootState: getContextStateInitialValue({
1984
2320
  content: e.content,
1985
2321
  data: e.data,
1986
2322
  locale: e.locale
@@ -1990,25 +2326,25 @@ function oe(e) {
1990
2326
  apiKey: e.apiKey,
1991
2327
  apiVersion: e.apiVersion,
1992
2328
  componentInfos: [
1993
- ...X(),
2329
+ ...getDefaultRegisteredComponents(),
1994
2330
  // While this `components` object is deprecated, we must maintain support for it.
1995
2331
  // Since users are able to override our default components, we need to make sure that we do not break such
1996
2332
  // existing usage.
1997
2333
  // This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
1998
2334
  // which is the new standard way of providing custom components, and must therefore take precedence.
1999
- ...Q,
2335
+ ...components,
2000
2336
  ...e.customComponents || []
2001
2337
  ].reduce(
2002
- (m, { component: h, ...d }) => ({
2003
- ...m,
2004
- [d.name]: F(d)
2338
+ (l, { component: f, ...d }) => ({
2339
+ ...l,
2340
+ [d.name]: serializeComponentInfo(d)
2005
2341
  }),
2006
2342
  {}
2007
2343
  ),
2008
2344
  inheritedStyles: {}
2009
2345
  };
2010
- return /* @__PURE__ */ w(
2011
- Me,
2346
+ return /* @__PURE__ */ jsxs(
2347
+ EnableEditor,
2012
2348
  {
2013
2349
  content: e.content,
2014
2350
  model: e.model,
@@ -2022,19 +2358,19 @@ function oe(e) {
2022
2358
  showContent: e.showContent,
2023
2359
  builderContextSignal: o,
2024
2360
  children: [
2025
- e.isSsrAbTest ? /* @__PURE__ */ l(x, { children: /* @__PURE__ */ l(W, { scriptStr: t }) }) : null,
2026
- /* @__PURE__ */ l(x, { children: /* @__PURE__ */ l(
2027
- Nt,
2361
+ e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
2362
+ /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2363
+ ContentStyles,
2028
2364
  {
2029
2365
  contentId: (a = o.content) == null ? void 0 : a.id,
2030
2366
  cssCode: (s = (c = o.content) == null ? void 0 : c.data) == null ? void 0 : s.cssCode,
2031
- customFonts: (f = (u = o.content) == null ? void 0 : u.data) == null ? void 0 : f.customFonts
2367
+ customFonts: (m = (u = o.content) == null ? void 0 : u.data) == null ? void 0 : m.customFonts
2032
2368
  }
2033
2369
  ) }),
2034
- /* @__PURE__ */ l(
2035
- _,
2370
+ /* @__PURE__ */ jsx(
2371
+ Blocks,
2036
2372
  {
2037
- blocks: (p = (g = o.content) == null ? void 0 : g.data) == null ? void 0 : p.blocks,
2373
+ blocks: (p = (h = o.content) == null ? void 0 : h.data) == null ? void 0 : p.blocks,
2038
2374
  context: o,
2039
2375
  registeredComponents: n
2040
2376
  }
@@ -2043,140 +2379,45 @@ function oe(e) {
2043
2379
  }
2044
2380
  );
2045
2381
  }
2046
- const dn = "builder.tests", j = (e) => `${dn}.${e}`, mn = ({
2047
- contentId: e
2048
- }) => he({
2049
- name: j(e),
2050
- canTrack: !0
2051
- }), fn = ({
2052
- contentId: e
2053
- }) => fe({
2054
- name: j(e),
2055
- canTrack: !0
2056
- }), hn = ({
2057
- contentId: e,
2058
- value: t
2059
- }) => ge({
2060
- name: j(e),
2061
- value: t,
2062
- canTrack: !0
2063
- }), Se = (e) => C(e.id) && C(e.variations) && Object.keys(e.variations).length > 0, gn = ({
2064
- id: e,
2065
- variations: t
2066
- }) => {
2067
- var i;
2068
- let n = 0;
2069
- const o = Math.random();
2070
- for (const r in t) {
2071
- const a = (i = t[r]) == null ? void 0 : i.testRatio;
2072
- if (n += a, o < n)
2073
- return r;
2074
- }
2075
- return e;
2076
- }, ve = (e) => {
2077
- const t = gn(e);
2078
- return hn({
2079
- contentId: e.id,
2080
- value: t
2081
- }).catch((n) => {
2082
- k.error("could not store A/B test variation: ", n);
2083
- }), t;
2084
- }, ke = ({
2085
- item: e,
2086
- testGroupId: t
2087
- }) => {
2088
- const n = e.variations[t];
2089
- return t === e.id || // handle edge-case where `testGroupId` points to non-existing variation
2090
- !n ? {
2091
- testVariationId: e.id,
2092
- testVariationName: "Default"
2093
- } : {
2094
- data: n.data,
2095
- testVariationId: n.id,
2096
- testVariationName: n.name || (n.id === e.id ? "Default" : "")
2097
- };
2098
- }, pn = ({
2099
- item: e,
2100
- canTrack: t
2101
- }) => {
2102
- if (!t)
2103
- return e;
2104
- if (!e)
2105
- return;
2106
- if (!Se(e))
2107
- return e;
2108
- const n = fn({
2109
- contentId: e.id
2110
- }) || ve({
2111
- variations: e.variations,
2112
- id: e.id
2113
- }), o = ke({
2114
- item: e,
2115
- testGroupId: n
2116
- });
2117
- return {
2118
- ...e,
2119
- ...o
2120
- };
2121
- }, bn = async ({
2122
- item: e,
2123
- canTrack: t
2124
- }) => {
2125
- if (!t || !Se(e))
2126
- return e;
2127
- const o = await mn({
2128
- contentId: e.id
2129
- }) || ve({
2130
- variations: e.variations,
2131
- id: e.id
2132
- }), i = ke({
2133
- item: e,
2134
- testGroupId: o
2135
- });
2136
- return {
2137
- ...e,
2138
- ...i
2139
- };
2140
- };
2141
- function we(e) {
2142
- var r, a, c;
2143
- const t = mt({
2144
- canTrack: O(e.canTrack),
2382
+ function ContentVariants(e) {
2383
+ var i, a, c;
2384
+ const t = checkShouldRunVariants({
2385
+ canTrack: getDefaultCanTrack(e.canTrack),
2145
2386
  content: e.content
2146
2387
  }), n = function() {
2147
2388
  var u;
2148
- return bt(
2149
- R(e.content).map((f) => ({
2150
- id: f.testVariationId,
2151
- testRatio: f.testRatio
2389
+ return getVariantsScriptString(
2390
+ getVariants(e.content).map((m) => ({
2391
+ id: m.testVariationId,
2392
+ testRatio: m.testRatio
2152
2393
  })),
2153
2394
  ((u = e.content) == null ? void 0 : u.id) || ""
2154
2395
  );
2155
2396
  }, o = function() {
2156
- return R(e.content).map((u) => `.variant-${u.testVariationId} { display: none; } `).join("");
2157
- }, i = function() {
2397
+ return getVariants(e.content).map((u) => `.variant-${u.testVariationId} { display: none; } `).join("");
2398
+ }, r = function() {
2158
2399
  var u;
2159
2400
  return t ? {
2160
2401
  ...e.content,
2161
2402
  testVariationId: (u = e.content) == null ? void 0 : u.id
2162
- } : pn({
2403
+ } : handleABTestingSync({
2163
2404
  item: e.content,
2164
- canTrack: O(e.canTrack)
2405
+ canTrack: getDefaultCanTrack(e.canTrack)
2165
2406
  });
2166
2407
  };
2167
- return /* @__PURE__ */ w(x, { children: [
2168
- !e.__isNestedRender && I !== "reactNative" ? /* @__PURE__ */ l(x, { children: /* @__PURE__ */ l(W, { scriptStr: pt() }) }) : null,
2169
- t ? /* @__PURE__ */ w(x, { children: [
2170
- /* @__PURE__ */ l(
2171
- V,
2408
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2409
+ !e.__isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: getScriptString() }) }) : null,
2410
+ t ? /* @__PURE__ */ jsxs(Fragment, { children: [
2411
+ /* @__PURE__ */ jsx(
2412
+ InlinedStyles,
2172
2413
  {
2173
- id: `variants-styles-${(r = e.content) == null ? void 0 : r.id}`,
2414
+ id: `variants-styles-${(i = e.content) == null ? void 0 : i.id}`,
2174
2415
  styles: o()
2175
2416
  }
2176
2417
  ),
2177
- /* @__PURE__ */ l(W, { scriptStr: n() }),
2178
- (a = R(e.content)) == null ? void 0 : a.map((s) => /* @__PURE__ */ l(
2179
- oe,
2418
+ /* @__PURE__ */ jsx(InlinedScript, { scriptStr: n() }),
2419
+ (a = getVariants(e.content)) == null ? void 0 : a.map((s) => /* @__PURE__ */ jsx(
2420
+ ContentComponent,
2180
2421
  {
2181
2422
  content: s,
2182
2423
  showContent: !1,
@@ -2196,10 +2437,10 @@ function we(e) {
2196
2437
  s.testVariationId
2197
2438
  ))
2198
2439
  ] }) : null,
2199
- /* @__PURE__ */ l(
2200
- oe,
2440
+ /* @__PURE__ */ jsx(
2441
+ ContentComponent,
2201
2442
  {
2202
- content: i(),
2443
+ content: r(),
2203
2444
  classNameProp: `variant-${(c = e.content) == null ? void 0 : c.id}`,
2204
2445
  showContent: !0,
2205
2446
  model: e.model,
@@ -2217,13 +2458,13 @@ function we(e) {
2217
2458
  )
2218
2459
  ] });
2219
2460
  }
2220
- const yn = async ({
2461
+ const fetchSymbolContent = async ({
2221
2462
  builderContextValue: e,
2222
2463
  symbol: t
2223
2464
  }) => {
2224
2465
  if (t != null && t.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
2225
2466
  (e != null && e.apiKey))
2226
- return H({
2467
+ return fetchOneEntry({
2227
2468
  model: t.model,
2228
2469
  apiKey: e.apiKey,
2229
2470
  apiVersion: e.apiVersion,
@@ -2233,11 +2474,11 @@ const yn = async ({
2233
2474
  }
2234
2475
  }
2235
2476
  }).catch((n) => {
2236
- k.error("Could not fetch symbol content: ", n);
2477
+ logger.error("Could not fetch symbol content: ", n);
2237
2478
  });
2238
2479
  };
2239
- async function xn(e) {
2240
- var o, i, r, a;
2480
+ async function Symbol$1(e) {
2481
+ var o, r, i, a;
2241
2482
  const t = function() {
2242
2483
  var s, u;
2243
2484
  return [
@@ -2246,12 +2487,12 @@ async function xn(e) {
2246
2487
  (s = e.symbol) != null && s.inline ? "builder-inline-symbol" : void 0,
2247
2488
  (u = e.symbol) != null && u.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
2248
2489
  ].filter(Boolean).join(" ");
2249
- }, n = ((o = e.symbol) == null ? void 0 : o.content) || await yn({
2490
+ }, n = ((o = e.symbol) == null ? void 0 : o.content) || await fetchSymbolContent({
2250
2491
  symbol: e.symbol,
2251
2492
  builderContextValue: e.builderContext
2252
2493
  });
2253
- return /* @__PURE__ */ l("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ l(
2254
- we,
2494
+ return /* @__PURE__ */ jsx("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ jsx(
2495
+ ContentVariants,
2255
2496
  {
2256
2497
  __isNestedRender: !0,
2257
2498
  apiVersion: e.builderContext.apiVersion,
@@ -2259,156 +2500,29 @@ async function xn(e) {
2259
2500
  context: e.builderContext.context,
2260
2501
  customComponents: Object.values(e.builderComponents),
2261
2502
  data: {
2262
- ...(i = e.symbol) == null ? void 0 : i.data,
2503
+ ...(r = e.symbol) == null ? void 0 : r.data,
2263
2504
  ...e.builderContext.localState,
2264
- ...(r = n == null ? void 0 : n.data) == null ? void 0 : r.state
2505
+ ...(i = n == null ? void 0 : n.data) == null ? void 0 : i.state
2265
2506
  },
2266
2507
  model: (a = e.symbol) == null ? void 0 : a.model,
2267
2508
  content: n
2268
2509
  }
2269
2510
  ) });
2270
2511
  }
2271
- const Kn = _, Hn = we;
2272
- function Dn() {
2273
- return !v() || L() ? !1 : location.search.indexOf("builder.preview=") !== -1;
2274
- }
2275
- const ie = {};
2276
- function zn(e) {
2277
- if (v()) {
2278
- Object.assign(ie, e);
2512
+ const RenderBlocks = Blocks, RenderContent = ContentVariants, settings = {};
2513
+ function setEditorSettings(e) {
2514
+ if (isBrowser()) {
2515
+ Object.assign(settings, e);
2279
2516
  const t = {
2280
2517
  type: "builder.settingsChange",
2281
- data: ie
2518
+ data: settings
2282
2519
  };
2283
2520
  parent.postMessage(t, "*");
2284
2521
  }
2285
2522
  }
2286
- const Sn = (e) => {
2287
- const t = e.get("preview"), n = e.get("overrides." + t);
2288
- return n || k.warn("No previewed ID found in search params."), n;
2289
- };
2290
- function vn(e) {
2291
- un();
2292
- const t = Sn(e);
2293
- return typeof t == "string" ? globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t) : void 0;
2294
- }
2295
- function N(e, t = null, n = ".") {
2296
- return Object.keys(e).reduce((o, i) => {
2297
- const r = e[i], a = [t, i].filter(Boolean).join(n);
2298
- return [typeof r == "object", r !== null, !(Array.isArray(r) && r.length === 0)].every(Boolean) ? {
2299
- ...o,
2300
- ...N(r, a, n)
2301
- } : {
2302
- ...o,
2303
- [a]: r
2304
- };
2305
- }, {});
2306
- }
2307
- const re = "builder.", kn = "options.", wn = (e) => {
2308
- const t = {};
2309
- return e.forEach((n, o) => {
2310
- t[o] = n;
2311
- }), t;
2312
- }, Ce = (e) => {
2313
- if (!e)
2314
- return {};
2315
- const t = Ie(e), n = {};
2316
- return Object.keys(t).forEach((o) => {
2317
- if (o.startsWith(re)) {
2318
- const i = o.replace(re, "").replace(kn, "");
2319
- n[i] = t[o];
2320
- }
2321
- }), n;
2322
- }, Cn = () => {
2323
- if (!v())
2324
- return {};
2325
- const e = new URLSearchParams(window.location.search);
2326
- return Ce(e);
2327
- }, Ie = (e) => e instanceof URLSearchParams ? wn(e) : e, In = "v3", K = (e) => {
2328
- let {
2329
- noTraverse: t = !1
2330
- } = e;
2331
- const {
2332
- limit: n = 30,
2333
- userAttributes: o,
2334
- query: i,
2335
- model: r,
2336
- apiKey: a,
2337
- includeRefs: c = !0,
2338
- enrich: s,
2339
- locale: u,
2340
- apiVersion: f = In
2341
- } = e;
2342
- if (!a)
2343
- throw new Error("Missing API key");
2344
- if (!["v2", "v3"].includes(f))
2345
- throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${f}'`);
2346
- (e.limit === void 0 || e.limit > 1) && !("noTraverse" in e) && (t = !0);
2347
- const g = new URL(`https://cdn.builder.io/api/${f}/content/${r}?apiKey=${a}&limit=${n}&noTraverse=${t}&includeRefs=${c}${u ? `&locale=${u}` : ""}${s ? `&enrich=${s}` : ""}`), p = {
2348
- ...Cn(),
2349
- ...Ie(e.options || {})
2350
- }, m = N(p);
2351
- for (const h in m)
2352
- g.searchParams.set(h, String(m[h]));
2353
- if (o && g.searchParams.set("userAttributes", JSON.stringify(o)), i) {
2354
- const h = N({
2355
- query: i
2356
- });
2357
- for (const d in h)
2358
- g.searchParams.set(d, JSON.stringify(h[d]));
2359
- }
2360
- return g;
2361
- }, Tn = (e) => "results" in e;
2362
- async function H(e) {
2363
- const t = await Te({
2364
- ...e,
2365
- limit: 1
2366
- });
2367
- return t && t.results[0] || null;
2368
- }
2369
- const qn = H, Rn = async (e) => {
2370
- const t = K(e);
2371
- return await (await jt(t.href)).json();
2372
- }, En = async (e, t, n = K(e)) => {
2373
- const o = O(e.canTrack);
2374
- if (n.search.includes("preview=")) {
2375
- const r = [];
2376
- for (const a of t.results) {
2377
- const c = vn(n.searchParams);
2378
- r.push(c || a);
2379
- }
2380
- t.results = r;
2381
- }
2382
- if (!o || !(v() || I === "reactNative"))
2383
- return t;
2384
- try {
2385
- const r = [];
2386
- for (const a of t.results)
2387
- r.push(await bn({
2388
- item: a,
2389
- canTrack: o
2390
- }));
2391
- t.results = r;
2392
- } catch (r) {
2393
- k.error("Could not process A/B tests. ", r);
2394
- }
2395
- return t;
2396
- };
2397
- async function Te(e) {
2398
- try {
2399
- const t = K(e), n = await Rn(e);
2400
- return Tn(n) ? En(e, n) : (k.error("Error fetching data. ", {
2401
- url: t,
2402
- content: n,
2403
- options: e
2404
- }), null);
2405
- } catch (t) {
2406
- return k.error("Error fetching data. ", t), null;
2407
- }
2408
- }
2409
- const Gn = Te, Jn = async (e) => {
2410
- var o, i, r;
2411
- const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((i = e.userAttributes) == null ? void 0 : i.urlPath), n = {
2523
+ const fetchBuilderProps = async (e) => {
2524
+ var o, r, i;
2525
+ const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((r = e.userAttributes) == null ? void 0 : r.urlPath), n = {
2412
2526
  ...e,
2413
2527
  apiKey: e.apiKey,
2414
2528
  model: e.model || "page",
@@ -2418,48 +2532,48 @@ const Gn = Te, Jn = async (e) => {
2418
2532
  urlPath: t
2419
2533
  } : {}
2420
2534
  },
2421
- options: Ce(e.searchParams || ((r = e.url) == null ? void 0 : r.searchParams) || e.options)
2535
+ options: getBuilderSearchParams(e.searchParams || ((i = e.url) == null ? void 0 : i.searchParams) || e.options)
2422
2536
  };
2423
2537
  return {
2424
2538
  apiKey: n.apiKey,
2425
2539
  model: n.model,
2426
- content: await H(n)
2540
+ content: await fetchOneEntry(n)
2427
2541
  };
2428
2542
  };
2429
2543
  export {
2430
- Ce as A,
2431
- _ as B,
2432
- we as C,
2433
- Mn as D,
2434
- Jn as E,
2435
- Kn as R,
2436
- xn as S,
2437
- Tt as T,
2438
- rn as _,
2439
- On as a,
2440
- Wn as b,
2441
- Nn as c,
2442
- v as d,
2443
- Ln as e,
2444
- O as f,
2445
- at as g,
2446
- M as h,
2447
- L as i,
2448
- jn as j,
2449
- A as k,
2450
- k as l,
2451
- jt as m,
2452
- un as n,
2453
- Hn as o,
2454
- lt as p,
2455
- Dn as q,
2456
- Un as r,
2457
- _n as s,
2458
- sn as t,
2459
- zn as u,
2460
- Te as v,
2461
- H as w,
2462
- Gn as x,
2463
- qn as y,
2464
- En as z
2544
+ getBuilderSearchParams as A,
2545
+ Blocks as B,
2546
+ ContentVariants as C,
2547
+ track as D,
2548
+ fetchBuilderProps as E,
2549
+ RenderBlocks as R,
2550
+ Symbol$1 as S,
2551
+ Text as T,
2552
+ _track as _,
2553
+ getBlockActions as a,
2554
+ getSrcSet as b,
2555
+ isJsScript as c,
2556
+ isBrowser as d,
2557
+ getDefaultCanTrack as e,
2558
+ isPreviewing as f,
2559
+ getBlockProperties as g,
2560
+ evaluate as h,
2561
+ isEditing as i,
2562
+ getInteractionPropertiesForEvent as j,
2563
+ fastClone as k,
2564
+ logger as l,
2565
+ createRegisterComponentMessage as m,
2566
+ fetchOneEntry as n,
2567
+ fetch$1 as o,
2568
+ init as p,
2569
+ RenderContent as q,
2570
+ registerInsertMenu as r,
2571
+ setupBrowserForEditing as s,
2572
+ Columns as t,
2573
+ register as u,
2574
+ setEditorSettings as v,
2575
+ fetchEntries as w,
2576
+ getAllContent as x,
2577
+ getContent as y,
2578
+ _processContentResult as z
2465
2579
  };