@builder.io/sdk-react 1.0.11 → 1.0.13
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.
- package/lib/browser/blocks-exports.cjs +32 -31
- package/lib/browser/blocks-exports.mjs +914 -877
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{server-entry-acc5a9c8.js → server-entry-1a840bf8.js} +1 -1
- package/lib/browser/{server-entry-4829e1ce.cjs → server-entry-20402a85.cjs} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/blocks-ca61b343.cjs +32 -0
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{blocks-244199ab.js → blocks-fd4ab30c.js} +1003 -967
- package/lib/edge/{button-73916377.js → button-45681a80.js} +3 -3
- package/lib/edge/{button-8cd5d71a.cjs → button-6d8b002c.cjs} +1 -1
- package/lib/edge/{columns-c7d9b9f1.js → columns-61e1043d.js} +33 -33
- package/lib/edge/{columns-88c9df52.cjs → columns-77e4f17d.cjs} +2 -2
- package/lib/edge/{content-variants-d5455178.js → content-variants-c085fa7f.js} +135 -124
- package/lib/edge/{content-variants-1a65d814.cjs → content-variants-c86fdb5a.cjs} +13 -12
- package/lib/edge/dynamic-renderer-8b343325.js +8 -0
- package/lib/edge/{dynamic-renderer-1c9f24c0.cjs → dynamic-renderer-b29b45ca.cjs} +1 -1
- package/lib/edge/{form-ad532981.js → form-4fae6192.js} +56 -66
- package/lib/edge/form-b996f9f9.cjs +1 -0
- package/lib/edge/{get-class-prop-name-1178de8b.js → get-class-prop-name-0e4b7b88.js} +1 -1
- package/lib/edge/{get-class-prop-name-c082f4f3.cjs → get-class-prop-name-14e14eea.cjs} +1 -1
- package/lib/edge/{image-2cc909d9.js → image-0008c792.js} +25 -25
- package/lib/edge/image-ee3dd857.cjs +17 -0
- package/lib/edge/{img-749d10ed.js → img-1259941e.js} +1 -1
- package/lib/edge/{img-f61f7931.cjs → img-c623011b.cjs} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-ccec5aae.js → input-02a1cd9f.js} +1 -1
- package/lib/edge/{input-184da708.cjs → input-2c618b06.cjs} +1 -1
- package/lib/edge/{select-a5fc0333.cjs → select-3acbf5f6.cjs} +1 -1
- package/lib/edge/{select-50a6db92.js → select-b1b6d0bf.js} +1 -1
- package/lib/edge/{server-entry-1cbf5bef.js → server-entry-3f0061ea.js} +1 -1
- package/lib/edge/{server-entry-178f215d.cjs → server-entry-d8f950e0.cjs} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-dad01f2d.js → slot-3cefe326.js} +4 -4
- package/lib/edge/{slot-d3ff8e4d.cjs → slot-92eac261.cjs} +1 -1
- package/lib/edge/{symbol-31283b30.cjs → symbol-741f0aee.cjs} +1 -1
- package/lib/edge/{symbol-b6db0014.js → symbol-e2a47b92.js} +3 -3
- package/lib/edge/{video-d02ff89b.js → video-58c2cc8d.js} +15 -15
- package/lib/edge/video-e20dcbbc.cjs +1 -0
- package/lib/node/blocks-exports.cjs +22 -21
- package/lib/node/blocks-exports.mjs +492 -455
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +1 -1
- package/lib/node/{server-entry-09a75819.js → server-entry-383e8da6.js} +1 -1
- package/lib/node/{server-entry-856d379b.cjs → server-entry-6d61d1cf.cjs} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +1 -1
- package/types/components/block/block.helpers.d.ts +4 -0
- package/types/components/content/components/enable-editor.d.ts +1 -1
- package/types/components/content/components/styles.d.ts +1 -0
- package/types/components/content/components/styles.helpers.d.ts +1 -0
- package/types/components/content/contentProps.types.d.ts +6 -1
- package/types/components/content-variants/content-variants.d.ts +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/evaluate/evaluate.d.ts +3 -1
- package/types/functions/evaluate/helpers.d.ts +1 -0
- package/lib/edge/blocks-a05f6af2.cjs +0 -32
- package/lib/edge/dynamic-renderer-96ba4e48.js +0 -8
- package/lib/edge/form-713c6da6.cjs +0 -1
- package/lib/edge/image-7e1361ce.cjs +0 -17
- package/lib/edge/video-64014cc4.cjs +0 -1
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
var D = Object.defineProperty;
|
|
3
|
+
var _ = (e, t, n) => t in e ? D(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var W = (e, t, n) => (_(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
2
5
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { TARGET, isEditing, isBrowser, getUserAttributes, fastClone, checkIsDefined, logger, registerInsertMenu, setupBrowserForEditing, createRegisterComponentMessage, getDefaultCanTrack, _track, isPreviewing, fetchOneEntry, createEditorListener, fetch as fetch$1, serializeComponentInfo, handleABTestingSync } from "./server-entry-
|
|
6
|
+
import { TARGET, isEditing, isBrowser, getUserAttributes, fastClone, checkIsDefined, logger, registerInsertMenu, setupBrowserForEditing, createRegisterComponentMessage, getDefaultCanTrack, _track, isPreviewing, fetchOneEntry, createEditorListener, fetch as fetch$1, serializeComponentInfo, handleABTestingSync } from "./server-entry-383e8da6.js";
|
|
4
7
|
import { createContext, useState, useEffect, useContext, useRef, createElement } from "react";
|
|
5
8
|
const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase());
|
|
6
9
|
function DynamicRenderer(e) {
|
|
7
|
-
return /* @__PURE__ */ jsx(Fragment, { children: isEmptyElement(e.TagName) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ jsx(Fragment, { children: typeof e.TagName == "string" ? /* @__PURE__ */ jsx(
|
|
10
|
+
return /* @__PURE__ */ jsx(Fragment, { children: isEmptyElement(e.TagName) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ jsx(Fragment, { children: typeof e.TagName == "string" ? /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ jsx(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
|
|
8
11
|
}
|
|
9
12
|
const getClassPropName = () => {
|
|
10
13
|
switch (TARGET) {
|
|
@@ -103,7 +106,7 @@ const getFunctionArguments = ({
|
|
|
103
106
|
rootSetState: a
|
|
104
107
|
})
|
|
105
108
|
});
|
|
106
|
-
return new Function(...s.map(([
|
|
109
|
+
return new Function(...s.map(([c]) => c), e)(...s.map(([, c]) => c));
|
|
107
110
|
};
|
|
108
111
|
function flattenState({
|
|
109
112
|
rootState: e,
|
|
@@ -115,7 +118,7 @@ function flattenState({
|
|
|
115
118
|
if (t && i in t)
|
|
116
119
|
return t[i];
|
|
117
120
|
const a = o[i];
|
|
118
|
-
return typeof a == "object" ? flattenState({
|
|
121
|
+
return typeof a == "object" && a !== null ? flattenState({
|
|
119
122
|
rootState: a,
|
|
120
123
|
localState: void 0,
|
|
121
124
|
rootSetState: n ? (r) => {
|
|
@@ -202,37 +205,37 @@ output;
|
|
|
202
205
|
rootSetState: a,
|
|
203
206
|
rootState: r
|
|
204
207
|
}) => {
|
|
205
|
-
const s = safeDynamicRequire("isolated-vm"),
|
|
208
|
+
const s = safeDynamicRequire("isolated-vm"), c = fastClone({
|
|
206
209
|
...r,
|
|
207
210
|
...i
|
|
208
|
-
}),
|
|
211
|
+
}), l = getFunctionArguments({
|
|
209
212
|
builder: t,
|
|
210
213
|
context: n,
|
|
211
214
|
event: o,
|
|
212
|
-
state:
|
|
213
|
-
}), d = getIsolateContext(),
|
|
214
|
-
|
|
215
|
-
console.log(...
|
|
216
|
-
}),
|
|
217
|
-
set(r,
|
|
218
|
-
}),
|
|
219
|
-
const
|
|
215
|
+
state: c
|
|
216
|
+
}), d = getIsolateContext(), u = d.global;
|
|
217
|
+
u.setSync("global", u.derefInto()), u.setSync("log", function(...h) {
|
|
218
|
+
console.log(...h);
|
|
219
|
+
}), u.setSync(BUILDER_SET_STATE_NAME, function(h, y) {
|
|
220
|
+
set(r, h, y), a == null || a(r);
|
|
221
|
+
}), l.forEach(([h, y]) => {
|
|
222
|
+
const T = typeof y == "object" ? new s.Reference(
|
|
220
223
|
// workaround: methods with default values for arguments is not being cloned over
|
|
221
|
-
|
|
222
|
-
...
|
|
223
|
-
getUserAttributes: () =>
|
|
224
|
-
} :
|
|
224
|
+
h === "builder" ? {
|
|
225
|
+
...y,
|
|
226
|
+
getUserAttributes: () => y.getUserAttributes()
|
|
227
|
+
} : y
|
|
225
228
|
) : null;
|
|
226
|
-
|
|
227
|
-
}),
|
|
228
|
-
const
|
|
229
|
+
u.setSync(getSyncValName(h), T);
|
|
230
|
+
}), u.setSync(INJECTED_IVM_GLOBAL, s);
|
|
231
|
+
const m = processCode({
|
|
229
232
|
code: e,
|
|
230
|
-
args:
|
|
231
|
-
}),
|
|
233
|
+
args: l
|
|
234
|
+
}), g = d.evalSync(m);
|
|
232
235
|
try {
|
|
233
|
-
return JSON.parse(
|
|
236
|
+
return JSON.parse(g);
|
|
234
237
|
} catch {
|
|
235
|
-
return
|
|
238
|
+
return g;
|
|
236
239
|
}
|
|
237
240
|
};
|
|
238
241
|
function isNodeRuntime() {
|
|
@@ -245,7 +248,26 @@ const shouldForceBrowserRuntimeInNode = () => {
|
|
|
245
248
|
return !1;
|
|
246
249
|
const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (o = process.env.NODE_OPTIONS) == null ? void 0 : o.includes("--no-node-snapshot");
|
|
247
250
|
return e && t && !n ? (logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "), !0) : !1;
|
|
248
|
-
}, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e)
|
|
251
|
+
}, chooseBrowserOrServerEval = (e) => isBrowser() || shouldForceBrowserRuntimeInNode() ? runInBrowser(e) : runInNode(e), A = class A {
|
|
252
|
+
static getCacheKey(t) {
|
|
253
|
+
return JSON.stringify({
|
|
254
|
+
...t,
|
|
255
|
+
// replace the event with a random number to break cache
|
|
256
|
+
// thats because we can't serialize the event object due to circular refs in DOM node refs.
|
|
257
|
+
event: t.event ? Math.random() : void 0
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
static getCachedValue(t) {
|
|
261
|
+
return A.cache.get(t);
|
|
262
|
+
}
|
|
263
|
+
static setCachedValue(t, n) {
|
|
264
|
+
A.cache.size > 20 && A.cache.delete(A.cache.keys().next().value), A.cache.set(t, {
|
|
265
|
+
value: n
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
W(A, "cacheLimit", 20), W(A, "cache", /* @__PURE__ */ new Map());
|
|
270
|
+
let EvalCache = A;
|
|
249
271
|
function evaluate({
|
|
250
272
|
code: e,
|
|
251
273
|
context: t,
|
|
@@ -253,13 +275,14 @@ function evaluate({
|
|
|
253
275
|
rootState: o,
|
|
254
276
|
rootSetState: i,
|
|
255
277
|
event: a,
|
|
256
|
-
isExpression: r = !0
|
|
278
|
+
isExpression: r = !0,
|
|
279
|
+
enableCache: s
|
|
257
280
|
}) {
|
|
258
281
|
if (e === "") {
|
|
259
282
|
logger.warn("Skipping evaluation of empty code block.");
|
|
260
283
|
return;
|
|
261
284
|
}
|
|
262
|
-
const
|
|
285
|
+
const c = {
|
|
263
286
|
code: parseCode(e, {
|
|
264
287
|
isExpression: r
|
|
265
288
|
}),
|
|
@@ -270,8 +293,18 @@ function evaluate({
|
|
|
270
293
|
rootState: o,
|
|
271
294
|
localState: n
|
|
272
295
|
};
|
|
296
|
+
if (s) {
|
|
297
|
+
const l = EvalCache.getCacheKey(c), d = EvalCache.getCachedValue(l);
|
|
298
|
+
if (d)
|
|
299
|
+
return d.value;
|
|
300
|
+
}
|
|
273
301
|
try {
|
|
274
|
-
|
|
302
|
+
const l = chooseBrowserOrServerEval(c);
|
|
303
|
+
if (s) {
|
|
304
|
+
const d = EvalCache.getCacheKey(c);
|
|
305
|
+
EvalCache.setCachedValue(d, l);
|
|
306
|
+
}
|
|
307
|
+
return l;
|
|
275
308
|
} catch (l) {
|
|
276
309
|
logger.error("Failed code evaluation: " + l.message, {
|
|
277
310
|
code: e
|
|
@@ -301,14 +334,15 @@ const evaluateBindings = ({
|
|
|
301
334
|
}
|
|
302
335
|
};
|
|
303
336
|
for (const s in e.bindings) {
|
|
304
|
-
const
|
|
305
|
-
code:
|
|
337
|
+
const c = e.bindings[s], l = evaluate({
|
|
338
|
+
code: c,
|
|
306
339
|
localState: n,
|
|
307
340
|
rootState: o,
|
|
308
341
|
rootSetState: i,
|
|
309
|
-
context: t
|
|
342
|
+
context: t,
|
|
343
|
+
enableCache: !0
|
|
310
344
|
});
|
|
311
|
-
set(r, s,
|
|
345
|
+
set(r, s, l);
|
|
312
346
|
}
|
|
313
347
|
return r;
|
|
314
348
|
};
|
|
@@ -331,14 +365,14 @@ function getProcessedBlock({
|
|
|
331
365
|
}
|
|
332
366
|
function throttle(e, t, n = {}) {
|
|
333
367
|
let o, i, a, r = null, s = 0;
|
|
334
|
-
const
|
|
368
|
+
const c = function() {
|
|
335
369
|
s = n.leading === !1 ? 0 : Date.now(), r = null, a = e.apply(o, i), r || (o = i = null);
|
|
336
370
|
};
|
|
337
371
|
return function() {
|
|
338
|
-
const
|
|
339
|
-
!s && n.leading === !1 && (s =
|
|
340
|
-
const d = t - (
|
|
341
|
-
return o = this, i = arguments, d <= 0 || d > t ? (r && (clearTimeout(r), r = null), s =
|
|
372
|
+
const l = Date.now();
|
|
373
|
+
!s && n.leading === !1 && (s = l);
|
|
374
|
+
const d = t - (l - s);
|
|
375
|
+
return o = this, i = arguments, d <= 0 || d > t ? (r && (clearTimeout(r), r = null), s = l, a = e.apply(o, i), r || (o = i = null)) : !r && n.trailing !== !1 && (r = setTimeout(c, d)), a;
|
|
342
376
|
};
|
|
343
377
|
}
|
|
344
378
|
function assign(e, ...t) {
|
|
@@ -372,8 +406,8 @@ function warnElementNotPresent(e) {
|
|
|
372
406
|
function augmentAnimation(e, t) {
|
|
373
407
|
const n = getAllStylesUsed(e), o = getComputedStyle(t), i = e.steps[0].styles, a = e.steps[e.steps.length - 1].styles, r = [i, a];
|
|
374
408
|
for (const s of r)
|
|
375
|
-
for (const
|
|
376
|
-
|
|
409
|
+
for (const c of n)
|
|
410
|
+
c in s || (s[c] = o[c]);
|
|
377
411
|
}
|
|
378
412
|
function getAllStylesUsed(e) {
|
|
379
413
|
const t = [];
|
|
@@ -436,14 +470,14 @@ function bindScrollInViewAnimation(e) {
|
|
|
436
470
|
leading: !1
|
|
437
471
|
});
|
|
438
472
|
function s(d) {
|
|
439
|
-
const
|
|
440
|
-
return
|
|
473
|
+
const u = d.getBoundingClientRect(), m = window.innerHeight, h = (e.thresholdPercent || 0) / 100 * m;
|
|
474
|
+
return u.bottom > h && u.top < m - h;
|
|
441
475
|
}
|
|
442
|
-
const
|
|
443
|
-
function
|
|
444
|
-
assign(n.style,
|
|
476
|
+
const c = e.steps[0].styles;
|
|
477
|
+
function l() {
|
|
478
|
+
assign(n.style, c);
|
|
445
479
|
}
|
|
446
|
-
|
|
480
|
+
l(), setTimeout(() => {
|
|
447
481
|
n.style.transition = `all ${e.duration}s ${camelCaseToKebabCase(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s");
|
|
448
482
|
}), document.addEventListener("scroll", r, {
|
|
449
483
|
capture: !0,
|
|
@@ -451,6 +485,48 @@ function bindScrollInViewAnimation(e) {
|
|
|
451
485
|
}), a();
|
|
452
486
|
});
|
|
453
487
|
}
|
|
488
|
+
const camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, o]) => {
|
|
489
|
+
if (typeof o == "string")
|
|
490
|
+
return `${camelToKebabCase(n)}: ${o};`;
|
|
491
|
+
}).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
|
|
492
|
+
`), createCssClass = ({
|
|
493
|
+
mediaQuery: e,
|
|
494
|
+
className: t,
|
|
495
|
+
styles: n
|
|
496
|
+
}) => {
|
|
497
|
+
const o = `.${t} {
|
|
498
|
+
${convertStyleMapToCSS(n)}
|
|
499
|
+
}`;
|
|
500
|
+
return e ? `${e} {
|
|
501
|
+
${o}
|
|
502
|
+
}` : o;
|
|
503
|
+
};
|
|
504
|
+
function transformStyleProperty({
|
|
505
|
+
style: e
|
|
506
|
+
}) {
|
|
507
|
+
return e;
|
|
508
|
+
}
|
|
509
|
+
const getStyle = ({
|
|
510
|
+
block: e,
|
|
511
|
+
context: t
|
|
512
|
+
}) => mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
513
|
+
style: e.style || {},
|
|
514
|
+
context: t,
|
|
515
|
+
block: e
|
|
516
|
+
}));
|
|
517
|
+
function mapStyleObjToStrIfNeeded(e) {
|
|
518
|
+
switch (TARGET) {
|
|
519
|
+
case "svelte":
|
|
520
|
+
case "vue":
|
|
521
|
+
case "solid":
|
|
522
|
+
return convertStyleMapToCSSArray(e).join(" ");
|
|
523
|
+
case "qwik":
|
|
524
|
+
case "reactNative":
|
|
525
|
+
case "react":
|
|
526
|
+
case "rsc":
|
|
527
|
+
return e;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
454
530
|
const getComponent = ({
|
|
455
531
|
block: e,
|
|
456
532
|
context: t,
|
|
@@ -488,20 +564,21 @@ const getComponent = ({
|
|
|
488
564
|
localState: t.localState,
|
|
489
565
|
rootState: t.rootState,
|
|
490
566
|
rootSetState: t.rootSetState,
|
|
491
|
-
context: t.context
|
|
567
|
+
context: t.context,
|
|
568
|
+
enableCache: !0
|
|
492
569
|
});
|
|
493
570
|
if (!Array.isArray(i))
|
|
494
571
|
return;
|
|
495
572
|
const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
|
|
496
|
-
return i.map((
|
|
573
|
+
return i.map((c, l) => ({
|
|
497
574
|
context: {
|
|
498
575
|
...t,
|
|
499
576
|
localState: {
|
|
500
577
|
...t.localState,
|
|
501
|
-
$index:
|
|
502
|
-
$item:
|
|
503
|
-
[r]:
|
|
504
|
-
[`$${r}Index`]:
|
|
578
|
+
$index: l,
|
|
579
|
+
$item: c,
|
|
580
|
+
[r]: c,
|
|
581
|
+
[`$${r}Index`]: l
|
|
505
582
|
}
|
|
506
583
|
},
|
|
507
584
|
block: o
|
|
@@ -548,21 +625,6 @@ const getComponent = ({
|
|
|
548
625
|
min: a,
|
|
549
626
|
default: a + 1
|
|
550
627
|
}, n;
|
|
551
|
-
}, camelToKebabCase = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), convertStyleMapToCSSArray = (e) => Object.entries(e).map(([n, o]) => {
|
|
552
|
-
if (typeof o == "string")
|
|
553
|
-
return `${camelToKebabCase(n)}: ${o};`;
|
|
554
|
-
}).filter(checkIsDefined), convertStyleMapToCSS = (e) => convertStyleMapToCSSArray(e).join(`
|
|
555
|
-
`), createCssClass = ({
|
|
556
|
-
mediaQuery: e,
|
|
557
|
-
className: t,
|
|
558
|
-
styles: n
|
|
559
|
-
}) => {
|
|
560
|
-
const o = `.${t} {
|
|
561
|
-
${convertStyleMapToCSS(n)}
|
|
562
|
-
}`;
|
|
563
|
-
return e ? `${e} {
|
|
564
|
-
${o}
|
|
565
|
-
}` : o;
|
|
566
628
|
};
|
|
567
629
|
function InlinedStyles(e) {
|
|
568
630
|
return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: e.styles }, id: e.id });
|
|
@@ -580,7 +642,7 @@ function BlockStyles(e) {
|
|
|
580
642
|
return checkIsDefined(o.hide) ? !o.hide : checkIsDefined(o.show) ? o.show : !0;
|
|
581
643
|
}
|
|
582
644
|
function n() {
|
|
583
|
-
var
|
|
645
|
+
var h;
|
|
584
646
|
const o = getProcessedBlock({
|
|
585
647
|
block: e.block,
|
|
586
648
|
localState: e.context.localState,
|
|
@@ -589,29 +651,29 @@ function BlockStyles(e) {
|
|
|
589
651
|
context: e.context.context,
|
|
590
652
|
shouldEvaluateBindings: !0
|
|
591
653
|
}), i = o.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
|
|
592
|
-
((
|
|
593
|
-
), s = i == null ? void 0 : i.large,
|
|
654
|
+
((h = a == null ? void 0 : a.meta) == null ? void 0 : h.breakpoints) || {}
|
|
655
|
+
), s = i == null ? void 0 : i.large, c = i == null ? void 0 : i.medium, l = i == null ? void 0 : i.small, d = o.id;
|
|
594
656
|
if (!d)
|
|
595
657
|
return "";
|
|
596
|
-
const
|
|
658
|
+
const u = s ? createCssClass({
|
|
597
659
|
className: d,
|
|
598
660
|
styles: s
|
|
599
|
-
}) : "",
|
|
661
|
+
}) : "", m = c ? createCssClass({
|
|
600
662
|
className: d,
|
|
601
|
-
styles:
|
|
663
|
+
styles: c,
|
|
602
664
|
mediaQuery: getMaxWidthQueryForSize(
|
|
603
665
|
"medium",
|
|
604
666
|
r
|
|
605
667
|
)
|
|
606
|
-
}) : "",
|
|
668
|
+
}) : "", g = l ? createCssClass({
|
|
607
669
|
className: d,
|
|
608
|
-
styles:
|
|
670
|
+
styles: l,
|
|
609
671
|
mediaQuery: getMaxWidthQueryForSize(
|
|
610
672
|
"small",
|
|
611
673
|
r
|
|
612
674
|
)
|
|
613
675
|
}) : "";
|
|
614
|
-
return [
|
|
676
|
+
return [u, m, g].join(" ");
|
|
615
677
|
}
|
|
616
678
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
617
679
|
}
|
|
@@ -625,7 +687,8 @@ const getEventHandlerName = (e) => `on${capitalizeFirstLetter(e)}`, createEventH
|
|
|
625
687
|
rootState: t.rootState,
|
|
626
688
|
rootSetState: t.rootSetState,
|
|
627
689
|
event: n,
|
|
628
|
-
isExpression: !1
|
|
690
|
+
isExpression: !1,
|
|
691
|
+
enableCache: !0
|
|
629
692
|
});
|
|
630
693
|
function getBlockActions(e) {
|
|
631
694
|
var o;
|
|
@@ -648,32 +711,6 @@ function getBlockActions(e) {
|
|
|
648
711
|
}
|
|
649
712
|
return t;
|
|
650
713
|
}
|
|
651
|
-
function transformStyleProperty({
|
|
652
|
-
style: e
|
|
653
|
-
}) {
|
|
654
|
-
return e;
|
|
655
|
-
}
|
|
656
|
-
const getStyle = ({
|
|
657
|
-
block: e,
|
|
658
|
-
context: t
|
|
659
|
-
}) => mapStyleObjToStrIfNeeded(transformStyleProperty({
|
|
660
|
-
style: e.style || {},
|
|
661
|
-
context: t,
|
|
662
|
-
block: e
|
|
663
|
-
}));
|
|
664
|
-
function mapStyleObjToStrIfNeeded(e) {
|
|
665
|
-
switch (TARGET) {
|
|
666
|
-
case "svelte":
|
|
667
|
-
case "vue":
|
|
668
|
-
case "solid":
|
|
669
|
-
return convertStyleMapToCSSArray(e).join(" ");
|
|
670
|
-
case "qwik":
|
|
671
|
-
case "reactNative":
|
|
672
|
-
case "react":
|
|
673
|
-
case "rsc":
|
|
674
|
-
return e;
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
714
|
function transformBlockProperties({
|
|
678
715
|
properties: e
|
|
679
716
|
}) {
|
|
@@ -820,7 +857,7 @@ function RepeatedBlock(e) {
|
|
|
820
857
|
) });
|
|
821
858
|
}
|
|
822
859
|
function Block(e) {
|
|
823
|
-
var
|
|
860
|
+
var c, l, d;
|
|
824
861
|
function t() {
|
|
825
862
|
return getComponent({
|
|
826
863
|
block: e.block,
|
|
@@ -835,8 +872,8 @@ function Block(e) {
|
|
|
835
872
|
});
|
|
836
873
|
}
|
|
837
874
|
function o() {
|
|
838
|
-
var
|
|
839
|
-
return (
|
|
875
|
+
var u;
|
|
876
|
+
return (u = e.block.repeat) != null && u.collection ? e.block : getProcessedBlock({
|
|
840
877
|
block: e.block,
|
|
841
878
|
localState: e.context.localState,
|
|
842
879
|
rootState: e.context.rootState,
|
|
@@ -846,55 +883,54 @@ function Block(e) {
|
|
|
846
883
|
});
|
|
847
884
|
}
|
|
848
885
|
function i() {
|
|
849
|
-
var
|
|
850
|
-
return e.block.tagName === "a" || ((
|
|
886
|
+
var m;
|
|
887
|
+
return e.block.tagName === "a" || ((m = o().properties) == null ? void 0 : m.href) || o().href ? e.linkComponent || "a" : e.block.tagName || "div";
|
|
851
888
|
}
|
|
852
889
|
function a() {
|
|
853
|
-
var
|
|
854
|
-
if ((
|
|
855
|
-
return !!((
|
|
856
|
-
const
|
|
857
|
-
return ("show" in o() ? o().show : !0) && !
|
|
890
|
+
var g, h;
|
|
891
|
+
if ((g = e.block.repeat) != null && g.collection)
|
|
892
|
+
return !!((h = n == null ? void 0 : n()) != null && h.length);
|
|
893
|
+
const u = "hide" in o() ? o().hide : !1;
|
|
894
|
+
return ("show" in o() ? o().show : !0) && !u;
|
|
858
895
|
}
|
|
859
896
|
function r() {
|
|
860
|
-
var
|
|
861
|
-
return !((
|
|
897
|
+
var m, g;
|
|
898
|
+
return !((m = t == null ? void 0 : t()) != null && m.component) && !n() ? (g = o().children) != null ? g : [] : [];
|
|
862
899
|
}
|
|
863
900
|
function s() {
|
|
864
|
-
var m,
|
|
901
|
+
var u, m, g, h, y, T, R, p, C, w, E;
|
|
865
902
|
return {
|
|
866
|
-
blockChildren: (
|
|
867
|
-
componentRef: (
|
|
903
|
+
blockChildren: (u = o().children) != null ? u : [],
|
|
904
|
+
componentRef: (m = t == null ? void 0 : t()) == null ? void 0 : m.component,
|
|
868
905
|
componentOptions: {
|
|
869
906
|
...getBlockComponentOptions(o()),
|
|
870
907
|
builderContext: e.context,
|
|
871
|
-
...((
|
|
908
|
+
...((g = t == null ? void 0 : t()) == null ? void 0 : g.name) === "Core:Button" || ((h = t == null ? void 0 : t()) == null ? void 0 : h.name) === "Symbol" || ((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Columns" || ((T = t == null ? void 0 : t()) == null ? void 0 : T.name) === "Form:Form" ? {
|
|
872
909
|
builderLinkComponent: e.linkComponent
|
|
873
910
|
} : {},
|
|
874
|
-
...((
|
|
911
|
+
...((R = t == null ? void 0 : t()) == null ? void 0 : R.name) === "Symbol" || ((p = t == null ? void 0 : t()) == null ? void 0 : p.name) === "Columns" || ((C = t == null ? void 0 : t()) == null ? void 0 : C.name) === "Form:Form" ? {
|
|
875
912
|
builderComponents: e.registeredComponents
|
|
876
913
|
} : {}
|
|
877
914
|
},
|
|
878
|
-
context:
|
|
915
|
+
context: e.context,
|
|
879
916
|
linkComponent: e.linkComponent,
|
|
880
917
|
registeredComponents: e.registeredComponents,
|
|
881
918
|
builderBlock: o(),
|
|
882
|
-
includeBlockProps: ((
|
|
883
|
-
isInteractive: !((
|
|
919
|
+
includeBlockProps: ((w = t == null ? void 0 : t()) == null ? void 0 : w.noWrap) === !0,
|
|
920
|
+
isInteractive: !((E = t == null ? void 0 : t()) != null && E.isRSC)
|
|
884
921
|
};
|
|
885
922
|
}
|
|
886
|
-
const [l, c] = useState(() => e.context);
|
|
887
923
|
return useEffect(() => {
|
|
888
|
-
const
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
...
|
|
892
|
-
elementId:
|
|
924
|
+
const u = o().id, m = o().animations;
|
|
925
|
+
m && u && bindAnimations(
|
|
926
|
+
m.filter((g) => g.trigger !== "hover").map((g) => ({
|
|
927
|
+
...g,
|
|
928
|
+
elementId: u
|
|
893
929
|
}))
|
|
894
930
|
);
|
|
895
931
|
}, []), /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
896
932
|
/* @__PURE__ */ jsx(BlockStyles, { block: e.block, context: e.context }),
|
|
897
|
-
(
|
|
933
|
+
(c = t == null ? void 0 : t()) != null && c.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
898
934
|
ComponentRef,
|
|
899
935
|
{
|
|
900
936
|
componentRef: s().componentRef,
|
|
@@ -907,16 +943,16 @@ function Block(e) {
|
|
|
907
943
|
includeBlockProps: s().includeBlockProps,
|
|
908
944
|
isInteractive: s().isInteractive
|
|
909
945
|
}
|
|
910
|
-
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
946
|
+
) }) : /* @__PURE__ */ jsx(Fragment, { children: n() ? /* @__PURE__ */ jsx(Fragment, { children: (d = n()) == null ? void 0 : d.map((u, m) => /* @__PURE__ */ jsx(
|
|
911
947
|
RepeatedBlock,
|
|
912
948
|
{
|
|
913
|
-
repeatContext:
|
|
914
|
-
block:
|
|
949
|
+
repeatContext: u.context,
|
|
950
|
+
block: u.block,
|
|
915
951
|
registeredComponents: e.registeredComponents,
|
|
916
952
|
linkComponent: e.linkComponent
|
|
917
953
|
},
|
|
918
|
-
|
|
919
|
-
)) }) : /* @__PURE__ */
|
|
954
|
+
m
|
|
955
|
+
)) }) : /* @__PURE__ */ jsxs(
|
|
920
956
|
BlockWrapper,
|
|
921
957
|
{
|
|
922
958
|
Wrapper: i(),
|
|
@@ -938,19 +974,19 @@ function Block(e) {
|
|
|
938
974
|
isInteractive: s().isInteractive
|
|
939
975
|
}
|
|
940
976
|
),
|
|
941
|
-
(
|
|
977
|
+
(l = r()) == null ? void 0 : l.map((u) => /* @__PURE__ */ jsx(
|
|
942
978
|
Block,
|
|
943
979
|
{
|
|
944
|
-
block:
|
|
945
|
-
context: l,
|
|
980
|
+
block: u,
|
|
946
981
|
registeredComponents: e.registeredComponents,
|
|
947
|
-
linkComponent: e.linkComponent
|
|
982
|
+
linkComponent: e.linkComponent,
|
|
983
|
+
context: e.context
|
|
948
984
|
},
|
|
949
|
-
|
|
985
|
+
u.id
|
|
950
986
|
))
|
|
951
987
|
]
|
|
952
988
|
}
|
|
953
|
-
) })
|
|
989
|
+
) })
|
|
954
990
|
] }) : null });
|
|
955
991
|
}
|
|
956
992
|
function BlocksWrapper(e) {
|
|
@@ -988,7 +1024,7 @@ function BlocksWrapper(e) {
|
|
|
988
1024
|
/* @__PURE__ */ jsx(
|
|
989
1025
|
e.BlocksWrapper,
|
|
990
1026
|
{
|
|
991
|
-
className: t() + " props-blocks-wrapper-
|
|
1027
|
+
className: t() + " props-blocks-wrapper-7cd1560e",
|
|
992
1028
|
"builder-path": e.path,
|
|
993
1029
|
"builder-parent-id": e.parent,
|
|
994
1030
|
style: e.styleProp,
|
|
@@ -999,7 +1035,7 @@ function BlocksWrapper(e) {
|
|
|
999
1035
|
children: e.children
|
|
1000
1036
|
}
|
|
1001
1037
|
),
|
|
1002
|
-
/* @__PURE__ */ jsx("style", { children: `.props-blocks-wrapper-
|
|
1038
|
+
/* @__PURE__ */ jsx("style", { children: `.props-blocks-wrapper-7cd1560e {
|
|
1003
1039
|
display: flex;
|
|
1004
1040
|
flex-direction: column;
|
|
1005
1041
|
align-items: stretch;
|
|
@@ -1039,39 +1075,39 @@ function Columns(e) {
|
|
|
1039
1075
|
() => e.stackColumnsAt || "tablet"
|
|
1040
1076
|
);
|
|
1041
1077
|
function s(p) {
|
|
1042
|
-
var
|
|
1043
|
-
return ((
|
|
1078
|
+
var C;
|
|
1079
|
+
return ((C = o[p]) == null ? void 0 : C.width) || 100 / o.length;
|
|
1044
1080
|
}
|
|
1045
|
-
function
|
|
1046
|
-
const
|
|
1047
|
-
return `calc(${s(p)}% - ${
|
|
1081
|
+
function c(p) {
|
|
1082
|
+
const C = t * (o.length - 1) / o.length;
|
|
1083
|
+
return `calc(${s(p)}% - ${C}px)`;
|
|
1048
1084
|
}
|
|
1049
|
-
function
|
|
1085
|
+
function l({
|
|
1050
1086
|
stackedStyle: p,
|
|
1051
|
-
desktopStyle:
|
|
1087
|
+
desktopStyle: C
|
|
1052
1088
|
}) {
|
|
1053
|
-
return a === "tablet" ? p :
|
|
1089
|
+
return a === "tablet" ? p : C;
|
|
1054
1090
|
}
|
|
1055
1091
|
function d({
|
|
1056
1092
|
stackedStyle: p,
|
|
1057
|
-
desktopStyle:
|
|
1093
|
+
desktopStyle: C
|
|
1058
1094
|
}) {
|
|
1059
|
-
return a === "never" ?
|
|
1095
|
+
return a === "never" ? C : p;
|
|
1060
1096
|
}
|
|
1061
|
-
const [
|
|
1097
|
+
const [u, m] = useState(
|
|
1062
1098
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
1063
1099
|
);
|
|
1064
|
-
function
|
|
1100
|
+
function g() {
|
|
1065
1101
|
return {
|
|
1066
|
-
"--flex-dir":
|
|
1067
|
-
"--flex-dir-tablet":
|
|
1068
|
-
stackedStyle:
|
|
1102
|
+
"--flex-dir": u,
|
|
1103
|
+
"--flex-dir-tablet": l({
|
|
1104
|
+
stackedStyle: u,
|
|
1069
1105
|
desktopStyle: "row"
|
|
1070
1106
|
})
|
|
1071
1107
|
};
|
|
1072
1108
|
}
|
|
1073
|
-
function
|
|
1074
|
-
const
|
|
1109
|
+
function h(p) {
|
|
1110
|
+
const C = p === 0 ? 0 : t, w = c(p), E = `${C}px`, F = "100%", N = 0;
|
|
1075
1111
|
return {
|
|
1076
1112
|
...{
|
|
1077
1113
|
display: "flex",
|
|
@@ -1081,32 +1117,32 @@ function Columns(e) {
|
|
|
1081
1117
|
width: w,
|
|
1082
1118
|
["marginLeft"]: E,
|
|
1083
1119
|
"--column-width-mobile": d({
|
|
1084
|
-
stackedStyle:
|
|
1120
|
+
stackedStyle: F,
|
|
1085
1121
|
desktopStyle: w
|
|
1086
1122
|
}),
|
|
1087
1123
|
"--column-margin-left-mobile": d({
|
|
1088
|
-
stackedStyle:
|
|
1124
|
+
stackedStyle: N,
|
|
1089
1125
|
desktopStyle: E
|
|
1090
1126
|
}),
|
|
1091
|
-
"--column-width-tablet":
|
|
1092
|
-
stackedStyle:
|
|
1127
|
+
"--column-width-tablet": l({
|
|
1128
|
+
stackedStyle: F,
|
|
1093
1129
|
desktopStyle: w
|
|
1094
1130
|
}),
|
|
1095
|
-
"--column-margin-left-tablet":
|
|
1096
|
-
stackedStyle:
|
|
1131
|
+
"--column-margin-left-tablet": l({
|
|
1132
|
+
stackedStyle: N,
|
|
1097
1133
|
desktopStyle: E
|
|
1098
1134
|
})
|
|
1099
1135
|
};
|
|
1100
1136
|
}
|
|
1101
|
-
function
|
|
1137
|
+
function y(p) {
|
|
1102
1138
|
var w, E;
|
|
1103
1139
|
return getSizesForBreakpoints(
|
|
1104
1140
|
((E = (w = e.builderContext.content) == null ? void 0 : w.meta) == null ? void 0 : E.breakpoints) || {}
|
|
1105
1141
|
)[p].max;
|
|
1106
1142
|
}
|
|
1107
|
-
function
|
|
1143
|
+
function T() {
|
|
1108
1144
|
return `
|
|
1109
|
-
@media (max-width: ${
|
|
1145
|
+
@media (max-width: ${y("medium")}px) {
|
|
1110
1146
|
.${e.builderBlock.id}-breakpoints {
|
|
1111
1147
|
flex-direction: var(--flex-dir-tablet);
|
|
1112
1148
|
align-items: stretch;
|
|
@@ -1118,7 +1154,7 @@ function Columns(e) {
|
|
|
1118
1154
|
}
|
|
1119
1155
|
}
|
|
1120
1156
|
|
|
1121
|
-
@media (max-width: ${
|
|
1157
|
+
@media (max-width: ${y("small")}px) {
|
|
1122
1158
|
.${e.builderBlock.id}-breakpoints {
|
|
1123
1159
|
flex-direction: var(--flex-dir);
|
|
1124
1160
|
align-items: stretch;
|
|
@@ -1135,11 +1171,11 @@ function Columns(e) {
|
|
|
1135
1171
|
/* @__PURE__ */ jsxs(
|
|
1136
1172
|
"div",
|
|
1137
1173
|
{
|
|
1138
|
-
className: `builder-columns ${e.builderBlock.id}-breakpoints div-
|
|
1139
|
-
style:
|
|
1174
|
+
className: `builder-columns ${e.builderBlock.id}-breakpoints div-5e636bea`,
|
|
1175
|
+
style: g(),
|
|
1140
1176
|
children: [
|
|
1141
|
-
/* @__PURE__ */ jsx(
|
|
1142
|
-
(R = e.columns) == null ? void 0 : R.map((p,
|
|
1177
|
+
/* @__PURE__ */ jsx(InlinedStyles, { styles: T() }),
|
|
1178
|
+
(R = e.columns) == null ? void 0 : R.map((p, C) => /* @__PURE__ */ jsx(
|
|
1143
1179
|
DynamicRenderer,
|
|
1144
1180
|
{
|
|
1145
1181
|
TagName: p.link ? e.builderLinkComponent || "a" : "div",
|
|
@@ -1149,12 +1185,12 @@ function Columns(e) {
|
|
|
1149
1185
|
href: p.link
|
|
1150
1186
|
} : {},
|
|
1151
1187
|
[getClassPropName()]: "builder-column",
|
|
1152
|
-
style: mapStyleObjToStrIfNeeded(
|
|
1188
|
+
style: mapStyleObjToStrIfNeeded(h(C))
|
|
1153
1189
|
},
|
|
1154
1190
|
children: /* @__PURE__ */ jsx(
|
|
1155
1191
|
Blocks,
|
|
1156
1192
|
{
|
|
1157
|
-
path: `component.options.columns.${
|
|
1193
|
+
path: `component.options.columns.${C}.blocks`,
|
|
1158
1194
|
parent: e.builderBlock.id,
|
|
1159
1195
|
styleProp: {
|
|
1160
1196
|
flexGrow: "1"
|
|
@@ -1166,12 +1202,12 @@ function Columns(e) {
|
|
|
1166
1202
|
}
|
|
1167
1203
|
)
|
|
1168
1204
|
},
|
|
1169
|
-
|
|
1205
|
+
C
|
|
1170
1206
|
))
|
|
1171
1207
|
]
|
|
1172
1208
|
}
|
|
1173
1209
|
),
|
|
1174
|
-
/* @__PURE__ */ jsx("style", { children: `.div-
|
|
1210
|
+
/* @__PURE__ */ jsx("style", { children: `.div-5e636bea {
|
|
1175
1211
|
display: flex;
|
|
1176
1212
|
line-height: normal;
|
|
1177
1213
|
}` })
|
|
@@ -1214,36 +1250,36 @@ function Image(e) {
|
|
|
1214
1250
|
var i, a, r, s;
|
|
1215
1251
|
function t() {
|
|
1216
1252
|
var d;
|
|
1217
|
-
const
|
|
1218
|
-
if (!
|
|
1253
|
+
const l = e.image || e.src;
|
|
1254
|
+
if (!l || // We can auto add srcset for cdn.builder.io and shopify
|
|
1219
1255
|
// images, otherwise you can supply this prop manually
|
|
1220
|
-
!(
|
|
1256
|
+
!(l.match(/builder\.io/) || l.match(/cdn\.shopify\.com/)))
|
|
1221
1257
|
return e.srcset;
|
|
1222
1258
|
if (e.srcset && ((d = e.image) != null && d.includes("builder.io/api/v1/image"))) {
|
|
1223
1259
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
1224
|
-
return console.debug("Removed given srcset"), getSrcSet(
|
|
1260
|
+
return console.debug("Removed given srcset"), getSrcSet(l);
|
|
1225
1261
|
} else if (e.image && !e.srcset)
|
|
1226
|
-
return getSrcSet(
|
|
1227
|
-
return getSrcSet(
|
|
1262
|
+
return getSrcSet(l);
|
|
1263
|
+
return getSrcSet(l);
|
|
1228
1264
|
}
|
|
1229
1265
|
function n() {
|
|
1230
|
-
var
|
|
1231
|
-
return (
|
|
1266
|
+
var c;
|
|
1267
|
+
return (c = t == null ? void 0 : t()) != null && c.match(/builder\.io/) && !e.noWebp ? t().replace(/\?/g, "?format=webp&") : "";
|
|
1232
1268
|
}
|
|
1233
1269
|
function o() {
|
|
1234
|
-
const
|
|
1270
|
+
const c = {
|
|
1235
1271
|
position: "absolute",
|
|
1236
1272
|
height: "100%",
|
|
1237
1273
|
width: "100%",
|
|
1238
1274
|
left: "0px",
|
|
1239
1275
|
top: "0px"
|
|
1240
1276
|
};
|
|
1241
|
-
return e.aspectRatio ?
|
|
1277
|
+
return e.aspectRatio ? c : void 0;
|
|
1242
1278
|
}
|
|
1243
1279
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1244
1280
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1245
1281
|
/* @__PURE__ */ jsxs("picture", { children: [
|
|
1246
|
-
n() ? /* @__PURE__ */ jsx(
|
|
1282
|
+
n() ? /* @__PURE__ */ jsx("source", { type: "image/webp", srcSet: n() }) : null,
|
|
1247
1283
|
/* @__PURE__ */ jsx(
|
|
1248
1284
|
"img",
|
|
1249
1285
|
{
|
|
@@ -1255,33 +1291,33 @@ function Image(e) {
|
|
|
1255
1291
|
objectFit: e.backgroundSize || "cover",
|
|
1256
1292
|
...o()
|
|
1257
1293
|
},
|
|
1258
|
-
className: "builder-image" + (e.className ? " " + e.className : "") + " img-
|
|
1294
|
+
className: "builder-image" + (e.className ? " " + e.className : "") + " img-a0c95e8c",
|
|
1259
1295
|
src: e.image,
|
|
1260
1296
|
srcSet: t(),
|
|
1261
1297
|
sizes: e.sizes
|
|
1262
1298
|
}
|
|
1263
1299
|
)
|
|
1264
1300
|
] }),
|
|
1265
|
-
e.aspectRatio && !((a = (i = e.builderBlock) == null ? void 0 : i.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ jsx(
|
|
1301
|
+
e.aspectRatio && !((a = (i = e.builderBlock) == null ? void 0 : i.children) != null && a.length && e.fitContent) ? /* @__PURE__ */ jsx(
|
|
1266
1302
|
"div",
|
|
1267
1303
|
{
|
|
1268
|
-
className: "builder-image-sizer div-
|
|
1304
|
+
className: "builder-image-sizer div-a0c95e8c",
|
|
1269
1305
|
style: {
|
|
1270
1306
|
paddingTop: e.aspectRatio * 100 + "%"
|
|
1271
1307
|
}
|
|
1272
1308
|
}
|
|
1273
|
-
)
|
|
1309
|
+
) : null,
|
|
1274
1310
|
(s = (r = e.builderBlock) == null ? void 0 : r.children) != null && s.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
|
|
1275
|
-
!e.fitContent && e.children ? /* @__PURE__ */ jsx(
|
|
1311
|
+
!e.fitContent && e.children ? /* @__PURE__ */ jsx("div", { className: "div-a0c95e8c-2", children: e.children }) : null
|
|
1276
1312
|
] }),
|
|
1277
|
-
/* @__PURE__ */ jsx("style", { children: `.img-
|
|
1313
|
+
/* @__PURE__ */ jsx("style", { children: `.img-a0c95e8c {
|
|
1278
1314
|
opacity: 1;
|
|
1279
1315
|
transition: opacity 0.2s ease-in-out;
|
|
1280
|
-
}.div-
|
|
1316
|
+
}.div-a0c95e8c {
|
|
1281
1317
|
width: 100%;
|
|
1282
1318
|
pointer-events: none;
|
|
1283
1319
|
font-size: 0;
|
|
1284
|
-
}.div-
|
|
1320
|
+
}.div-a0c95e8c-2 {
|
|
1285
1321
|
display: flex;
|
|
1286
1322
|
flex-direction: column;
|
|
1287
1323
|
align-items: stretch;
|
|
@@ -1526,7 +1562,7 @@ const componentInfo$f = {
|
|
|
1526
1562
|
});
|
|
1527
1563
|
}
|
|
1528
1564
|
const n = e.get("columns");
|
|
1529
|
-
Array.isArray(n) && n.find((i) => i.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((s,
|
|
1565
|
+
Array.isArray(n) && n.find((i) => i.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((s, c) => s + c.get("width"), 0) !== 100) && t();
|
|
1530
1566
|
}
|
|
1531
1567
|
}, {
|
|
1532
1568
|
name: "space",
|
|
@@ -1575,15 +1611,15 @@ const componentInfo$f = {
|
|
|
1575
1611
|
onChange: (e) => {
|
|
1576
1612
|
e.delete("srcset"), e.delete("noWebp");
|
|
1577
1613
|
function n(r, s = 6e4) {
|
|
1578
|
-
return new Promise((
|
|
1614
|
+
return new Promise((c, l) => {
|
|
1579
1615
|
const d = document.createElement("img");
|
|
1580
|
-
let
|
|
1616
|
+
let u = !1;
|
|
1581
1617
|
d.onload = () => {
|
|
1582
|
-
|
|
1583
|
-
}, d.addEventListener("error", (
|
|
1584
|
-
console.warn("Image load failed",
|
|
1618
|
+
u = !0, c(d);
|
|
1619
|
+
}, d.addEventListener("error", (m) => {
|
|
1620
|
+
console.warn("Image load failed", m.error), l(m.error);
|
|
1585
1621
|
}), d.src = r, setTimeout(() => {
|
|
1586
|
-
|
|
1622
|
+
u || l(new Error("Image load timed out"));
|
|
1587
1623
|
}, s);
|
|
1588
1624
|
});
|
|
1589
1625
|
}
|
|
@@ -1825,23 +1861,23 @@ function CustomCode(e) {
|
|
|
1825
1861
|
if (!((s = t.current) != null && s.getElementsByTagName) || typeof window == "undefined")
|
|
1826
1862
|
return;
|
|
1827
1863
|
const r = t.current.getElementsByTagName("script");
|
|
1828
|
-
for (let
|
|
1829
|
-
const
|
|
1830
|
-
if (
|
|
1831
|
-
if (n.includes(
|
|
1864
|
+
for (let c = 0; c < r.length; c++) {
|
|
1865
|
+
const l = r[c];
|
|
1866
|
+
if (l.src) {
|
|
1867
|
+
if (n.includes(l.src))
|
|
1832
1868
|
continue;
|
|
1833
|
-
n.push(
|
|
1869
|
+
n.push(l.src);
|
|
1834
1870
|
const d = document.createElement("script");
|
|
1835
|
-
d.async = !0, d.src =
|
|
1836
|
-
} else if (!
|
|
1871
|
+
d.async = !0, d.src = l.src, document.head.appendChild(d);
|
|
1872
|
+
} else if (!l.type || [
|
|
1837
1873
|
"text/javascript",
|
|
1838
1874
|
"application/javascript",
|
|
1839
1875
|
"application/ecmascript"
|
|
1840
|
-
].includes(
|
|
1841
|
-
if (i.includes(
|
|
1876
|
+
].includes(l.type)) {
|
|
1877
|
+
if (i.includes(l.innerText))
|
|
1842
1878
|
continue;
|
|
1843
1879
|
try {
|
|
1844
|
-
i.push(
|
|
1880
|
+
i.push(l.innerText), new Function(l.innerText)();
|
|
1845
1881
|
} catch (d) {
|
|
1846
1882
|
console.warn("`CustomCode`: Error running script:", d);
|
|
1847
1883
|
}
|
|
@@ -1884,26 +1920,26 @@ const componentInfo$6 = {
|
|
|
1884
1920
|
}, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
|
|
1885
1921
|
function Embed(e) {
|
|
1886
1922
|
const t = useRef(null), [n, o] = useState(() => []), [i, a] = useState(() => []), [r, s] = useState(() => !1);
|
|
1887
|
-
function
|
|
1923
|
+
function c() {
|
|
1888
1924
|
if (!t.current || !t.current.getElementsByTagName)
|
|
1889
1925
|
return;
|
|
1890
|
-
const
|
|
1891
|
-
for (let d = 0; d <
|
|
1892
|
-
const
|
|
1893
|
-
if (
|
|
1894
|
-
n.push(
|
|
1895
|
-
const
|
|
1896
|
-
|
|
1897
|
-
} else if (isJsScript(
|
|
1926
|
+
const l = t.current.getElementsByTagName("script");
|
|
1927
|
+
for (let d = 0; d < l.length; d++) {
|
|
1928
|
+
const u = l[d];
|
|
1929
|
+
if (u.src && !n.includes(u.src)) {
|
|
1930
|
+
n.push(u.src);
|
|
1931
|
+
const m = document.createElement("script");
|
|
1932
|
+
m.async = !0, m.src = u.src, document.head.appendChild(m);
|
|
1933
|
+
} else if (isJsScript(u) && !i.includes(u.innerText))
|
|
1898
1934
|
try {
|
|
1899
|
-
i.push(
|
|
1900
|
-
} catch (
|
|
1901
|
-
console.warn("`Embed`: Error running script:",
|
|
1935
|
+
i.push(u.innerText), new Function(u.innerText)();
|
|
1936
|
+
} catch (m) {
|
|
1937
|
+
console.warn("`Embed`: Error running script:", m);
|
|
1902
1938
|
}
|
|
1903
1939
|
}
|
|
1904
1940
|
}
|
|
1905
1941
|
return useEffect(() => {
|
|
1906
|
-
t.current && !r && (s(!0),
|
|
1942
|
+
t.current && !r && (s(!0), c());
|
|
1907
1943
|
}, [t.current, r]), /* @__PURE__ */ jsx(
|
|
1908
1944
|
"div",
|
|
1909
1945
|
{
|
|
@@ -2152,94 +2188,94 @@ const componentInfo$5 = {
|
|
|
2152
2188
|
return o === void 0 || o === e ? n : o;
|
|
2153
2189
|
};
|
|
2154
2190
|
function FormComponent(e) {
|
|
2155
|
-
var
|
|
2191
|
+
var u, m;
|
|
2156
2192
|
const t = useRef(null), [n, o] = useState(() => "unsubmitted"), [i, a] = useState(() => null), [r, s] = useState(() => "");
|
|
2157
|
-
function
|
|
2158
|
-
var
|
|
2159
|
-
const
|
|
2193
|
+
function c(g) {
|
|
2194
|
+
var y, T;
|
|
2195
|
+
const h = {
|
|
2160
2196
|
...e.builderContext.rootState,
|
|
2161
|
-
...
|
|
2197
|
+
...g
|
|
2162
2198
|
};
|
|
2163
|
-
e.builderContext.rootSetState ? (
|
|
2199
|
+
e.builderContext.rootSetState ? (T = (y = e.builderContext).rootSetState) == null || T.call(y, h) : e.builderContext.rootState = h;
|
|
2164
2200
|
}
|
|
2165
|
-
function
|
|
2201
|
+
function l() {
|
|
2166
2202
|
return isEditing() && e.previewState || n;
|
|
2167
2203
|
}
|
|
2168
|
-
function d(
|
|
2169
|
-
var
|
|
2170
|
-
const
|
|
2204
|
+
function d(g) {
|
|
2205
|
+
var y;
|
|
2206
|
+
const h = e.sendWithJs || e.sendSubmissionsTo === "email";
|
|
2171
2207
|
if (e.sendSubmissionsTo === "zapier")
|
|
2172
|
-
|
|
2173
|
-
else if (
|
|
2208
|
+
g.preventDefault();
|
|
2209
|
+
else if (h) {
|
|
2174
2210
|
if (!(e.action || e.sendSubmissionsTo === "email")) {
|
|
2175
|
-
|
|
2211
|
+
g.preventDefault();
|
|
2176
2212
|
return;
|
|
2177
2213
|
}
|
|
2178
|
-
|
|
2179
|
-
const
|
|
2214
|
+
g.preventDefault();
|
|
2215
|
+
const T = g.currentTarget, R = e.customHeaders || {};
|
|
2180
2216
|
let p;
|
|
2181
|
-
const
|
|
2182
|
-
|
|
2183
|
-
).filter((
|
|
2184
|
-
let
|
|
2185
|
-
const
|
|
2186
|
-
if (
|
|
2187
|
-
if (
|
|
2188
|
-
if (
|
|
2189
|
-
return
|
|
2190
|
-
key:
|
|
2191
|
-
value:
|
|
2217
|
+
const C = new FormData(T), w = Array.from(
|
|
2218
|
+
g.currentTarget.querySelectorAll("input,select,textarea")
|
|
2219
|
+
).filter((f) => !!f.name).map((f) => {
|
|
2220
|
+
let I;
|
|
2221
|
+
const j = f.name;
|
|
2222
|
+
if (f instanceof HTMLInputElement)
|
|
2223
|
+
if (f.type === "radio") {
|
|
2224
|
+
if (f.checked)
|
|
2225
|
+
return I = f.name, {
|
|
2226
|
+
key: j,
|
|
2227
|
+
value: I
|
|
2192
2228
|
};
|
|
2193
|
-
} else if (
|
|
2194
|
-
|
|
2195
|
-
else if (
|
|
2196
|
-
const
|
|
2197
|
-
isNaN(
|
|
2229
|
+
} else if (f.type === "checkbox")
|
|
2230
|
+
I = f.checked;
|
|
2231
|
+
else if (f.type === "number" || f.type === "range") {
|
|
2232
|
+
const P = f.valueAsNumber;
|
|
2233
|
+
isNaN(P) || (I = P);
|
|
2198
2234
|
} else
|
|
2199
|
-
|
|
2235
|
+
f.type === "file" ? I = f.files : I = f.value;
|
|
2200
2236
|
else
|
|
2201
|
-
|
|
2237
|
+
I = f.value;
|
|
2202
2238
|
return {
|
|
2203
|
-
key:
|
|
2204
|
-
value:
|
|
2239
|
+
key: j,
|
|
2240
|
+
value: I
|
|
2205
2241
|
};
|
|
2206
2242
|
});
|
|
2207
2243
|
let E = e.contentType;
|
|
2208
|
-
if (e.sendSubmissionsTo === "email" && (E = "multipart/form-data"), Array.from(w).forEach(({ value:
|
|
2209
|
-
(
|
|
2244
|
+
if (e.sendSubmissionsTo === "email" && (E = "multipart/form-data"), Array.from(w).forEach(({ value: f }) => {
|
|
2245
|
+
(f instanceof File || Array.isArray(f) && f[0] instanceof File || f instanceof FileList) && (E = "multipart/form-data");
|
|
2210
2246
|
}), E !== "application/json")
|
|
2211
|
-
p =
|
|
2247
|
+
p = C;
|
|
2212
2248
|
else {
|
|
2213
|
-
const
|
|
2214
|
-
Array.from(w).forEach(({ value:
|
|
2215
|
-
set(
|
|
2216
|
-
}), p = JSON.stringify(
|
|
2249
|
+
const f = {};
|
|
2250
|
+
Array.from(w).forEach(({ value: I, key: j }) => {
|
|
2251
|
+
set(f, j, I);
|
|
2252
|
+
}), p = JSON.stringify(f);
|
|
2217
2253
|
}
|
|
2218
|
-
E && E !== "multipart/form-data" && (
|
|
2219
|
-
const
|
|
2220
|
-
if (t.current && (t.current.dispatchEvent(
|
|
2254
|
+
E && E !== "multipart/form-data" && (h && ((y = e.action) != null && y.includes("zapier.com")) || (R["content-type"] = E));
|
|
2255
|
+
const F = new CustomEvent("presubmit", { detail: { body: p } });
|
|
2256
|
+
if (t.current && (t.current.dispatchEvent(F), F.defaultPrevented))
|
|
2221
2257
|
return;
|
|
2222
2258
|
o("sending");
|
|
2223
|
-
const
|
|
2259
|
+
const N = `${getEnv() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
|
|
2224
2260
|
e.sendSubmissionsToEmail || ""
|
|
2225
2261
|
)}&name=${encodeURIComponent(e.name || "")}`;
|
|
2226
2262
|
fetch(
|
|
2227
|
-
e.sendSubmissionsTo === "email" ?
|
|
2263
|
+
e.sendSubmissionsTo === "email" ? N : e.action,
|
|
2228
2264
|
{ body: p, headers: R, method: e.method || "post" }
|
|
2229
2265
|
).then(
|
|
2230
|
-
async (
|
|
2231
|
-
let
|
|
2232
|
-
const
|
|
2233
|
-
if (
|
|
2234
|
-
let
|
|
2235
|
-
|
|
2266
|
+
async (f) => {
|
|
2267
|
+
let I;
|
|
2268
|
+
const j = f.headers.get("content-type");
|
|
2269
|
+
if (j && j.indexOf("application/json") !== -1 ? I = await f.json() : I = await f.text(), !f.ok && e.errorMessagePath) {
|
|
2270
|
+
let P = get(I, e.errorMessagePath);
|
|
2271
|
+
P && (typeof P != "string" && (P = JSON.stringify(P)), s(P), c({ formErrorMessage: P }));
|
|
2236
2272
|
}
|
|
2237
|
-
if (a(
|
|
2238
|
-
const
|
|
2239
|
-
detail: { res:
|
|
2273
|
+
if (a(I), o(f.ok ? "success" : "error"), f.ok) {
|
|
2274
|
+
const P = new CustomEvent("submit:success", {
|
|
2275
|
+
detail: { res: f, body: I }
|
|
2240
2276
|
});
|
|
2241
2277
|
if (t.current) {
|
|
2242
|
-
if (t.current.dispatchEvent(
|
|
2278
|
+
if (t.current.dispatchEvent(P), P.defaultPrevented)
|
|
2243
2279
|
return;
|
|
2244
2280
|
e.resetFormOnSubmit !== !1 && t.current.reset();
|
|
2245
2281
|
}
|
|
@@ -2253,11 +2289,11 @@ function FormComponent(e) {
|
|
|
2253
2289
|
location.href = e.successUrl;
|
|
2254
2290
|
}
|
|
2255
2291
|
},
|
|
2256
|
-
(
|
|
2257
|
-
const
|
|
2258
|
-
detail: { error:
|
|
2292
|
+
(f) => {
|
|
2293
|
+
const I = new CustomEvent("submit:error", {
|
|
2294
|
+
detail: { error: f }
|
|
2259
2295
|
});
|
|
2260
|
-
t.current && (t.current.dispatchEvent(
|
|
2296
|
+
t.current && (t.current.dispatchEvent(I), I.defaultPrevented) || (a(f), o("error"));
|
|
2261
2297
|
}
|
|
2262
2298
|
);
|
|
2263
2299
|
}
|
|
@@ -2272,59 +2308,49 @@ function FormComponent(e) {
|
|
|
2272
2308
|
action: !e.sendWithJs && e.action,
|
|
2273
2309
|
method: e.method,
|
|
2274
2310
|
name: e.name,
|
|
2275
|
-
onSubmit: (
|
|
2311
|
+
onSubmit: (g) => d(g),
|
|
2276
2312
|
...e.attributes,
|
|
2277
2313
|
children: [
|
|
2278
|
-
|
|
2279
|
-
e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ jsx(Fragment, { children: (y = (h = e.builderBlock) == null ? void 0 : h.children) == null ? void 0 : y.map((m, u) => /* @__PURE__ */ jsx(
|
|
2314
|
+
e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ jsx(Fragment, { children: (m = (u = e.builderBlock) == null ? void 0 : u.children) == null ? void 0 : m.map((g, h) => /* @__PURE__ */ jsx(
|
|
2280
2315
|
Block,
|
|
2281
2316
|
{
|
|
2282
|
-
block:
|
|
2317
|
+
block: g,
|
|
2283
2318
|
context: e.builderContext,
|
|
2284
2319
|
registeredComponents: e.builderComponents,
|
|
2285
2320
|
linkComponent: e.builderLinkComponent
|
|
2286
2321
|
},
|
|
2287
|
-
`form-block-${
|
|
2322
|
+
`form-block-${h}`
|
|
2288
2323
|
)) }) : null,
|
|
2289
|
-
"
|
|
2290
|
-
c() === "error" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2324
|
+
l() === "error" ? /* @__PURE__ */ jsx(
|
|
2291
2325
|
Blocks,
|
|
2292
2326
|
{
|
|
2293
2327
|
path: "errorMessage",
|
|
2294
2328
|
blocks: e.errorMessage,
|
|
2295
2329
|
context: e.builderContext
|
|
2296
2330
|
}
|
|
2297
|
-
)
|
|
2298
|
-
"
|
|
2299
|
-
c() === "sending" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2331
|
+
) : null,
|
|
2332
|
+
l() === "sending" ? /* @__PURE__ */ jsx(
|
|
2300
2333
|
Blocks,
|
|
2301
2334
|
{
|
|
2302
2335
|
path: "sendingMessage",
|
|
2303
2336
|
blocks: e.sendingMessage,
|
|
2304
2337
|
context: e.builderContext
|
|
2305
2338
|
}
|
|
2306
|
-
)
|
|
2307
|
-
" ",
|
|
2308
|
-
|
|
2309
|
-
" ",
|
|
2310
|
-
JSON.stringify(i, null, 2),
|
|
2311
|
-
" "
|
|
2312
|
-
] }) }) : null,
|
|
2313
|
-
" ",
|
|
2314
|
-
c() === "success" ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2339
|
+
) : null,
|
|
2340
|
+
l() === "error" && i ? /* @__PURE__ */ jsx("pre", { className: "builder-form-error-text pre-31bf8a14", children: JSON.stringify(i, null, 2) }) : null,
|
|
2341
|
+
l() === "success" ? /* @__PURE__ */ jsx(
|
|
2315
2342
|
Blocks,
|
|
2316
2343
|
{
|
|
2317
2344
|
path: "successMessage",
|
|
2318
2345
|
blocks: e.successMessage,
|
|
2319
2346
|
context: e.builderContext
|
|
2320
2347
|
}
|
|
2321
|
-
)
|
|
2322
|
-
" "
|
|
2348
|
+
) : null
|
|
2323
2349
|
]
|
|
2324
2350
|
}
|
|
2325
2351
|
),
|
|
2326
2352
|
" ",
|
|
2327
|
-
/* @__PURE__ */ jsx("style", { children: ".pre-
|
|
2353
|
+
/* @__PURE__ */ jsx("style", { children: ".pre-31bf8a14 { padding: 10px; color: red; text-align: center; }" }),
|
|
2328
2354
|
" "
|
|
2329
2355
|
] });
|
|
2330
2356
|
}
|
|
@@ -2594,7 +2620,7 @@ const componentInfo = {
|
|
|
2594
2620
|
}]
|
|
2595
2621
|
};
|
|
2596
2622
|
function Video(e) {
|
|
2597
|
-
var o, i, a, r, s,
|
|
2623
|
+
var o, i, a, r, s, c, l;
|
|
2598
2624
|
function t() {
|
|
2599
2625
|
return {
|
|
2600
2626
|
...e.autoPlay === !0 ? {
|
|
@@ -2651,7 +2677,7 @@ function Video(e) {
|
|
|
2651
2677
|
children: e.lazyLoad ? null : /* @__PURE__ */ jsx("source", { type: "video/mp4", src: e.video })
|
|
2652
2678
|
}
|
|
2653
2679
|
),
|
|
2654
|
-
e.aspectRatio && !(e.fitContent && ((a = (i = e.builderBlock) == null ? void 0 : i.children) != null && a.length)) ? /* @__PURE__ */ jsx(
|
|
2680
|
+
e.aspectRatio && !(e.fitContent && ((a = (i = e.builderBlock) == null ? void 0 : i.children) != null && a.length)) ? /* @__PURE__ */ jsx(
|
|
2655
2681
|
"div",
|
|
2656
2682
|
{
|
|
2657
2683
|
style: {
|
|
@@ -2661,8 +2687,8 @@ function Video(e) {
|
|
|
2661
2687
|
fontSize: "0px"
|
|
2662
2688
|
}
|
|
2663
2689
|
}
|
|
2664
|
-
)
|
|
2665
|
-
(s = (r = e.builderBlock) == null ? void 0 : r.children) != null && s.length && e.fitContent ? /* @__PURE__ */ jsx(
|
|
2690
|
+
) : null,
|
|
2691
|
+
(s = (r = e.builderBlock) == null ? void 0 : r.children) != null && s.length && e.fitContent ? /* @__PURE__ */ jsx(
|
|
2666
2692
|
"div",
|
|
2667
2693
|
{
|
|
2668
2694
|
style: {
|
|
@@ -2672,8 +2698,8 @@ function Video(e) {
|
|
|
2672
2698
|
},
|
|
2673
2699
|
children: e.children
|
|
2674
2700
|
}
|
|
2675
|
-
)
|
|
2676
|
-
(
|
|
2701
|
+
) : null,
|
|
2702
|
+
(l = (c = e.builderBlock) == null ? void 0 : c.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ jsx(
|
|
2677
2703
|
"div",
|
|
2678
2704
|
{
|
|
2679
2705
|
style: {
|
|
@@ -2689,7 +2715,7 @@ function Video(e) {
|
|
|
2689
2715
|
},
|
|
2690
2716
|
children: e.children
|
|
2691
2717
|
}
|
|
2692
|
-
)
|
|
2718
|
+
) : null
|
|
2693
2719
|
]
|
|
2694
2720
|
}
|
|
2695
2721
|
);
|
|
@@ -2904,44 +2930,44 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2904
2930
|
};
|
|
2905
2931
|
};
|
|
2906
2932
|
function EnableEditor(e) {
|
|
2907
|
-
var E,
|
|
2933
|
+
var E, F, N, f, I, j, P;
|
|
2908
2934
|
const t = useRef(null), [n, o] = useState(() => 0);
|
|
2909
2935
|
useState(() => !0);
|
|
2910
2936
|
function i(b) {
|
|
2911
|
-
var
|
|
2912
|
-
const
|
|
2937
|
+
var x, v;
|
|
2938
|
+
const S = {
|
|
2913
2939
|
...e.builderContextSignal.rootState,
|
|
2914
2940
|
...b
|
|
2915
2941
|
};
|
|
2916
|
-
e.builderContextSignal.rootSetState ? (v = (
|
|
2917
|
-
...
|
|
2918
|
-
rootState:
|
|
2942
|
+
e.builderContextSignal.rootSetState ? (v = (x = e.builderContextSignal).rootSetState) == null || v.call(x, S) : e.setBuilderContextSignal((k) => ({
|
|
2943
|
+
...k,
|
|
2944
|
+
rootState: S
|
|
2919
2945
|
}));
|
|
2920
2946
|
}
|
|
2921
2947
|
function a(b) {
|
|
2922
|
-
var
|
|
2923
|
-
const
|
|
2948
|
+
var x, v, k, B, V;
|
|
2949
|
+
const S = {
|
|
2924
2950
|
...e.builderContextSignal.content,
|
|
2925
2951
|
...b,
|
|
2926
2952
|
data: {
|
|
2927
|
-
...(
|
|
2953
|
+
...(x = e.builderContextSignal.content) == null ? void 0 : x.data,
|
|
2928
2954
|
...b == null ? void 0 : b.data
|
|
2929
2955
|
},
|
|
2930
2956
|
meta: {
|
|
2931
2957
|
...(v = e.builderContextSignal.content) == null ? void 0 : v.meta,
|
|
2932
2958
|
...b == null ? void 0 : b.meta,
|
|
2933
|
-
breakpoints: ((
|
|
2959
|
+
breakpoints: ((k = b == null ? void 0 : b.meta) == null ? void 0 : k.breakpoints) || ((V = (B = e.builderContextSignal.content) == null ? void 0 : B.meta) == null ? void 0 : V.breakpoints)
|
|
2934
2960
|
}
|
|
2935
2961
|
};
|
|
2936
|
-
e.setBuilderContextSignal((
|
|
2937
|
-
|
|
2938
|
-
content:
|
|
2962
|
+
e.setBuilderContextSignal(($) => ({
|
|
2963
|
+
...$,
|
|
2964
|
+
content: S
|
|
2939
2965
|
}));
|
|
2940
2966
|
}
|
|
2941
2967
|
useState(() => 0);
|
|
2942
2968
|
const [r, s] = useState(
|
|
2943
2969
|
() => !1
|
|
2944
|
-
), [
|
|
2970
|
+
), [c, l] = useState(
|
|
2945
2971
|
() => e.contentWrapper || "div"
|
|
2946
2972
|
);
|
|
2947
2973
|
function d(b) {
|
|
@@ -2949,85 +2975,92 @@ function EnableEditor(e) {
|
|
|
2949
2975
|
model: e.model,
|
|
2950
2976
|
trustedHosts: e.trustedHosts,
|
|
2951
2977
|
callbacks: {
|
|
2952
|
-
configureSdk: (
|
|
2953
|
-
var
|
|
2954
|
-
const { breakpoints:
|
|
2955
|
-
!v || v !== ((
|
|
2978
|
+
configureSdk: (S) => {
|
|
2979
|
+
var k;
|
|
2980
|
+
const { breakpoints: x, contentId: v } = S;
|
|
2981
|
+
!v || v !== ((k = e.builderContextSignal.content) == null ? void 0 : k.id) || x && (a({
|
|
2956
2982
|
meta: {
|
|
2957
|
-
breakpoints:
|
|
2983
|
+
breakpoints: x
|
|
2958
2984
|
}
|
|
2959
2985
|
}), o(n + 1));
|
|
2960
2986
|
},
|
|
2961
|
-
animation: (
|
|
2962
|
-
triggerAnimation(
|
|
2987
|
+
animation: (S) => {
|
|
2988
|
+
triggerAnimation(S);
|
|
2963
2989
|
},
|
|
2964
|
-
contentUpdate: (
|
|
2965
|
-
a(
|
|
2990
|
+
contentUpdate: (S) => {
|
|
2991
|
+
a(S), o(n + 1);
|
|
2966
2992
|
}
|
|
2967
2993
|
}
|
|
2968
2994
|
})(b);
|
|
2969
2995
|
}
|
|
2970
|
-
function
|
|
2971
|
-
var
|
|
2972
|
-
const b = (
|
|
2996
|
+
function u() {
|
|
2997
|
+
var S, x;
|
|
2998
|
+
const b = (x = (S = e.builderContextSignal.content) == null ? void 0 : S.data) == null ? void 0 : x.jsCode;
|
|
2973
2999
|
b && evaluate({
|
|
2974
3000
|
code: b,
|
|
2975
3001
|
context: e.context || {},
|
|
2976
3002
|
localState: void 0,
|
|
2977
3003
|
rootState: e.builderContextSignal.rootState,
|
|
2978
|
-
rootSetState: e.builderContextSignal.rootSetState
|
|
3004
|
+
rootSetState: e.builderContextSignal.rootSetState,
|
|
3005
|
+
/**
|
|
3006
|
+
* We don't want to cache the result of the JS code, since it's arbitrary side effect code.
|
|
3007
|
+
*/
|
|
3008
|
+
enableCache: !1
|
|
2979
3009
|
});
|
|
2980
3010
|
}
|
|
2981
|
-
const [
|
|
2982
|
-
function
|
|
2983
|
-
var
|
|
3011
|
+
const [m, g] = useState(() => ({})), [h, y] = useState(() => !1);
|
|
3012
|
+
function T(b) {
|
|
3013
|
+
var S, x;
|
|
2984
3014
|
if (e.builderContextSignal.content) {
|
|
2985
|
-
const v = (
|
|
3015
|
+
const v = (S = e.builderContextSignal.content) == null ? void 0 : S.testVariationId, k = (x = e.builderContextSignal.content) == null ? void 0 : x.id;
|
|
2986
3016
|
_track({
|
|
2987
3017
|
type: "click",
|
|
2988
3018
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
2989
|
-
contentId:
|
|
3019
|
+
contentId: k,
|
|
2990
3020
|
apiKey: e.apiKey,
|
|
2991
|
-
variationId: v !==
|
|
3021
|
+
variationId: v !== k ? v : void 0,
|
|
2992
3022
|
...getInteractionPropertiesForEvent(b),
|
|
2993
|
-
unique: !
|
|
3023
|
+
unique: !h
|
|
2994
3024
|
});
|
|
2995
3025
|
}
|
|
2996
|
-
|
|
3026
|
+
h || y(!0);
|
|
2997
3027
|
}
|
|
2998
3028
|
function R(b) {
|
|
2999
3029
|
return b.replace(
|
|
3000
3030
|
/{{([^}]+)}}/g,
|
|
3001
|
-
(
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3031
|
+
(S, x) => String(
|
|
3032
|
+
evaluate({
|
|
3033
|
+
code: x,
|
|
3034
|
+
context: e.context || {},
|
|
3035
|
+
localState: void 0,
|
|
3036
|
+
rootState: e.builderContextSignal.rootState,
|
|
3037
|
+
rootSetState: e.builderContextSignal.rootSetState,
|
|
3038
|
+
enableCache: !0
|
|
3039
|
+
})
|
|
3040
|
+
)
|
|
3008
3041
|
);
|
|
3009
3042
|
}
|
|
3010
|
-
function p({ url: b, key:
|
|
3011
|
-
fetch$1(b).then((
|
|
3012
|
-
var
|
|
3043
|
+
function p({ url: b, key: S }) {
|
|
3044
|
+
fetch$1(b).then((x) => x.json()).then((x) => {
|
|
3045
|
+
var k, B;
|
|
3013
3046
|
const v = {
|
|
3014
3047
|
...e.builderContextSignal.rootState,
|
|
3015
|
-
[
|
|
3048
|
+
[S]: x
|
|
3016
3049
|
};
|
|
3017
|
-
(
|
|
3018
|
-
}).catch((
|
|
3019
|
-
console.error("error fetching dynamic data", b,
|
|
3050
|
+
(B = (k = e.builderContextSignal).rootSetState) == null || B.call(k, v), m[S] = !0;
|
|
3051
|
+
}).catch((x) => {
|
|
3052
|
+
console.error("error fetching dynamic data", b, x);
|
|
3020
3053
|
});
|
|
3021
3054
|
}
|
|
3022
|
-
function
|
|
3023
|
-
var
|
|
3024
|
-
const b = (v = (
|
|
3025
|
-
Object.entries(b).forEach(([
|
|
3026
|
-
if (
|
|
3027
|
-
const V = R(
|
|
3055
|
+
function C() {
|
|
3056
|
+
var S, x, v;
|
|
3057
|
+
const b = (v = (x = (S = e.builderContextSignal.content) == null ? void 0 : S.data) == null ? void 0 : x.httpRequests) != null ? v : {};
|
|
3058
|
+
Object.entries(b).forEach(([k, B]) => {
|
|
3059
|
+
if (B && (!m[k] || isEditing())) {
|
|
3060
|
+
const V = R(B);
|
|
3028
3061
|
p({
|
|
3029
3062
|
url: V,
|
|
3030
|
-
key:
|
|
3063
|
+
key: k
|
|
3031
3064
|
});
|
|
3032
3065
|
}
|
|
3033
3066
|
});
|
|
@@ -3048,7 +3081,7 @@ function EnableEditor(e) {
|
|
|
3048
3081
|
);
|
|
3049
3082
|
}
|
|
3050
3083
|
return useEffect(() => {
|
|
3051
|
-
var b,
|
|
3084
|
+
var b, S;
|
|
3052
3085
|
if (isBrowser()) {
|
|
3053
3086
|
if (isEditing() && (o(n + 1), window.addEventListener("message", d), registerInsertMenu(), setupBrowserForEditing({
|
|
3054
3087
|
...e.locale ? {
|
|
@@ -3063,47 +3096,47 @@ function EnableEditor(e) {
|
|
|
3063
3096
|
}), Object.values(
|
|
3064
3097
|
e.builderContextSignal.componentInfos
|
|
3065
3098
|
).forEach((v) => {
|
|
3066
|
-
var
|
|
3067
|
-
const
|
|
3068
|
-
(
|
|
3099
|
+
var B;
|
|
3100
|
+
const k = createRegisterComponentMessage(v);
|
|
3101
|
+
(B = window.parent) == null || B.postMessage(k, "*");
|
|
3069
3102
|
}), window.addEventListener(
|
|
3070
3103
|
"builder:component:stateChangeListenerActivated",
|
|
3071
3104
|
w
|
|
3072
3105
|
)), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
|
|
3073
|
-
const v = (b = e.builderContextSignal.content) == null ? void 0 : b.testVariationId,
|
|
3106
|
+
const v = (b = e.builderContextSignal.content) == null ? void 0 : b.testVariationId, k = (S = e.builderContextSignal.content) == null ? void 0 : S.id, B = e.apiKey;
|
|
3074
3107
|
_track({
|
|
3075
3108
|
type: "impression",
|
|
3076
3109
|
canTrack: !0,
|
|
3077
|
-
contentId:
|
|
3078
|
-
apiKey:
|
|
3079
|
-
variationId: v !==
|
|
3110
|
+
contentId: k,
|
|
3111
|
+
apiKey: B,
|
|
3112
|
+
variationId: v !== k ? v : void 0
|
|
3080
3113
|
});
|
|
3081
3114
|
}
|
|
3082
3115
|
if (isPreviewing()) {
|
|
3083
|
-
const v = new URL(location.href).searchParams,
|
|
3084
|
-
`builder.preview.${
|
|
3116
|
+
const v = new URL(location.href).searchParams, k = v.get("builder.preview"), B = v.get(
|
|
3117
|
+
`builder.preview.${k}`
|
|
3085
3118
|
), V = v.get("apiKey") || v.get("builder.space");
|
|
3086
|
-
|
|
3119
|
+
k === e.model && V === e.apiKey && (!e.content || B === e.content.id) && fetchOneEntry({
|
|
3087
3120
|
model: e.model,
|
|
3088
3121
|
apiKey: e.apiKey,
|
|
3089
3122
|
apiVersion: e.builderContextSignal.apiVersion
|
|
3090
|
-
}).then((
|
|
3091
|
-
|
|
3123
|
+
}).then(($) => {
|
|
3124
|
+
$ && a($);
|
|
3092
3125
|
});
|
|
3093
3126
|
}
|
|
3094
3127
|
}
|
|
3095
3128
|
}, []), useEffect(() => {
|
|
3096
3129
|
e.apiKey || logger.error(
|
|
3097
3130
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
3098
|
-
),
|
|
3131
|
+
), u(), C(), w();
|
|
3099
3132
|
}, []), useEffect(() => {
|
|
3100
3133
|
e.content && a(e.content);
|
|
3101
3134
|
}, [e.content]), useEffect(() => {
|
|
3102
3135
|
}, [r]), useEffect(() => {
|
|
3103
|
-
|
|
3104
|
-
}, [(
|
|
3105
|
-
|
|
3106
|
-
}, [(
|
|
3136
|
+
u();
|
|
3137
|
+
}, [(F = (E = e.builderContextSignal.content) == null ? void 0 : E.data) == null ? void 0 : F.jsCode]), useEffect(() => {
|
|
3138
|
+
C();
|
|
3139
|
+
}, [(f = (N = e.builderContextSignal.content) == null ? void 0 : N.data) == null ? void 0 : f.httpRequests]), useEffect(() => {
|
|
3107
3140
|
w();
|
|
3108
3141
|
}, [e.builderContextSignal.rootState]), useEffect(() => {
|
|
3109
3142
|
e.data && i(e.data);
|
|
@@ -3116,23 +3149,23 @@ function EnableEditor(e) {
|
|
|
3116
3149
|
"builder:component:stateChangeListenerActivated",
|
|
3117
3150
|
w
|
|
3118
3151
|
));
|
|
3119
|
-
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */
|
|
3120
|
-
|
|
3152
|
+
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ createElement(
|
|
3153
|
+
c,
|
|
3121
3154
|
{
|
|
3122
3155
|
key: n,
|
|
3123
3156
|
ref: t,
|
|
3124
|
-
onClick: (b) =>
|
|
3125
|
-
"builder-content-id": (
|
|
3157
|
+
onClick: (b) => T(b),
|
|
3158
|
+
"builder-content-id": (I = e.builderContextSignal.content) == null ? void 0 : I.id,
|
|
3126
3159
|
"builder-model": e.model,
|
|
3127
3160
|
...e.showContent ? {} : {
|
|
3128
3161
|
hidden: !0,
|
|
3129
3162
|
"aria-hidden": !0
|
|
3130
3163
|
},
|
|
3131
3164
|
...e.contentWrapperProps,
|
|
3132
|
-
className: `variant-${((
|
|
3165
|
+
className: `variant-${((j = e.content) == null ? void 0 : j.testVariationId) || ((P = e.content) == null ? void 0 : P.id)}`
|
|
3133
3166
|
},
|
|
3134
3167
|
e.children
|
|
3135
|
-
)
|
|
3168
|
+
) : null });
|
|
3136
3169
|
}
|
|
3137
3170
|
const getCssFromFont = (e) => {
|
|
3138
3171
|
var a, r;
|
|
@@ -3149,11 +3182,11 @@ font-weight: 400;
|
|
|
3149
3182
|
for (const s in e.files) {
|
|
3150
3183
|
if (!(String(Number(s)) === s))
|
|
3151
3184
|
continue;
|
|
3152
|
-
const
|
|
3153
|
-
|
|
3185
|
+
const l = e.files[s];
|
|
3186
|
+
l && l !== o && (i += `
|
|
3154
3187
|
@font-face {
|
|
3155
3188
|
font-family: "${t}";
|
|
3156
|
-
src: url('${
|
|
3189
|
+
src: url('${l}') format('woff2');
|
|
3157
3190
|
font-display: fallback;
|
|
3158
3191
|
font-weight: ${s};
|
|
3159
3192
|
}
|
|
@@ -3168,18 +3201,7 @@ font-weight: ${s};
|
|
|
3168
3201
|
}, getCss = ({
|
|
3169
3202
|
cssCode: e,
|
|
3170
3203
|
contentId: t
|
|
3171
|
-
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : ""
|
|
3172
|
-
function ContentStyles(e) {
|
|
3173
|
-
const [t, n] = useState(
|
|
3174
|
-
() => `
|
|
3175
|
-
${getCss({
|
|
3176
|
-
cssCode: e.cssCode,
|
|
3177
|
-
contentId: e.contentId
|
|
3178
|
-
})}
|
|
3179
|
-
${getFontCss({
|
|
3180
|
-
customFonts: e.customFonts
|
|
3181
|
-
})}
|
|
3182
|
-
|
|
3204
|
+
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", DEFAULT_STYLES = `
|
|
3183
3205
|
.builder-button {
|
|
3184
3206
|
all: unset;
|
|
3185
3207
|
}
|
|
@@ -3196,6 +3218,18 @@ ${getFontCss({
|
|
|
3196
3218
|
text-align: inherit;
|
|
3197
3219
|
font-family: inherit;
|
|
3198
3220
|
}
|
|
3221
|
+
`, getDefaultStyles = (e) => e ? "" : DEFAULT_STYLES;
|
|
3222
|
+
function ContentStyles(e) {
|
|
3223
|
+
const [t, n] = useState(
|
|
3224
|
+
() => `
|
|
3225
|
+
${getCss({
|
|
3226
|
+
cssCode: e.cssCode,
|
|
3227
|
+
contentId: e.contentId
|
|
3228
|
+
})}
|
|
3229
|
+
${getFontCss({
|
|
3230
|
+
customFonts: e.customFonts
|
|
3231
|
+
})}
|
|
3232
|
+
${getDefaultStyles(e.isNestedRender)}
|
|
3199
3233
|
`.trim()
|
|
3200
3234
|
);
|
|
3201
3235
|
return /* @__PURE__ */ jsx(InlinedStyles, { styles: t });
|
|
@@ -3207,8 +3241,8 @@ const getRootStateInitialValue = ({
|
|
|
3207
3241
|
}) => {
|
|
3208
3242
|
var a, r, s;
|
|
3209
3243
|
const o = {}, i = ((a = e == null ? void 0 : e.data) == null ? void 0 : a.state) || {};
|
|
3210
|
-
return (s = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || s.forEach((
|
|
3211
|
-
|
|
3244
|
+
return (s = (r = e == null ? void 0 : e.data) == null ? void 0 : r.inputs) == null || s.forEach((c) => {
|
|
3245
|
+
c.name && c.defaultValue !== void 0 && (o[c.name] = c.defaultValue);
|
|
3212
3246
|
}), {
|
|
3213
3247
|
...o,
|
|
3214
3248
|
...i,
|
|
@@ -3229,22 +3263,22 @@ const getRootStateInitialValue = ({
|
|
|
3229
3263
|
meta: e == null ? void 0 : e.meta
|
|
3230
3264
|
} : void 0;
|
|
3231
3265
|
function ContentComponent(e) {
|
|
3232
|
-
var
|
|
3266
|
+
var c, l, d, u, m, g, h;
|
|
3233
3267
|
const [t, n] = useState(
|
|
3234
3268
|
() => {
|
|
3235
|
-
var
|
|
3269
|
+
var y, T;
|
|
3236
3270
|
return getUpdateVariantVisibilityScript({
|
|
3237
3271
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3238
|
-
variationId: (
|
|
3272
|
+
variationId: (y = e.content) == null ? void 0 : y.testVariationId,
|
|
3239
3273
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
3240
|
-
contentId: (
|
|
3274
|
+
contentId: (T = e.content) == null ? void 0 : T.id
|
|
3241
3275
|
});
|
|
3242
3276
|
}
|
|
3243
3277
|
);
|
|
3244
|
-
function o(
|
|
3245
|
-
s((
|
|
3246
|
-
...
|
|
3247
|
-
rootState:
|
|
3278
|
+
function o(y) {
|
|
3279
|
+
s((T) => ({
|
|
3280
|
+
...T,
|
|
3281
|
+
rootState: y
|
|
3248
3282
|
}));
|
|
3249
3283
|
}
|
|
3250
3284
|
const [i, a] = useState(
|
|
@@ -3252,10 +3286,10 @@ function ContentComponent(e) {
|
|
|
3252
3286
|
...getDefaultRegisteredComponents(),
|
|
3253
3287
|
...e.customComponents || []
|
|
3254
3288
|
].reduce(
|
|
3255
|
-
(
|
|
3256
|
-
...
|
|
3289
|
+
(y, { component: T, ...R }) => ({
|
|
3290
|
+
...y,
|
|
3257
3291
|
[R.name]: {
|
|
3258
|
-
component:
|
|
3292
|
+
component: T,
|
|
3259
3293
|
...serializeComponentInfo(R)
|
|
3260
3294
|
}
|
|
3261
3295
|
}),
|
|
@@ -3280,8 +3314,8 @@ function ContentComponent(e) {
|
|
|
3280
3314
|
...getDefaultRegisteredComponents(),
|
|
3281
3315
|
...e.customComponents || []
|
|
3282
3316
|
].reduce(
|
|
3283
|
-
(
|
|
3284
|
-
...
|
|
3317
|
+
(y, { component: T, ...R }) => ({
|
|
3318
|
+
...y,
|
|
3285
3319
|
[R.name]: serializeComponentInfo(R)
|
|
3286
3320
|
}),
|
|
3287
3321
|
{}
|
|
@@ -3315,19 +3349,20 @@ function ContentComponent(e) {
|
|
|
3315
3349
|
trustedHosts: e.trustedHosts,
|
|
3316
3350
|
setBuilderContextSignal: s,
|
|
3317
3351
|
children: [
|
|
3318
|
-
e.isSsrAbTest ? /* @__PURE__ */ jsx(
|
|
3319
|
-
/* @__PURE__ */ jsx(
|
|
3352
|
+
e.isSsrAbTest ? /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) : null,
|
|
3353
|
+
/* @__PURE__ */ jsx(
|
|
3320
3354
|
ContentStyles,
|
|
3321
3355
|
{
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3356
|
+
isNestedRender: e.isNestedRender,
|
|
3357
|
+
contentId: (c = r.content) == null ? void 0 : c.id,
|
|
3358
|
+
cssCode: (d = (l = r.content) == null ? void 0 : l.data) == null ? void 0 : d.cssCode,
|
|
3359
|
+
customFonts: (m = (u = r.content) == null ? void 0 : u.data) == null ? void 0 : m.customFonts
|
|
3325
3360
|
}
|
|
3326
|
-
)
|
|
3361
|
+
),
|
|
3327
3362
|
/* @__PURE__ */ jsx(
|
|
3328
3363
|
Blocks,
|
|
3329
3364
|
{
|
|
3330
|
-
blocks: (
|
|
3365
|
+
blocks: (h = (g = r.content) == null ? void 0 : g.data) == null ? void 0 : h.blocks,
|
|
3331
3366
|
context: r,
|
|
3332
3367
|
registeredComponents: i,
|
|
3333
3368
|
linkComponent: e.linkComponent
|
|
@@ -3348,23 +3383,23 @@ function ContentVariants(e) {
|
|
|
3348
3383
|
})
|
|
3349
3384
|
);
|
|
3350
3385
|
function o() {
|
|
3351
|
-
var
|
|
3386
|
+
var c;
|
|
3352
3387
|
return getUpdateCookieAndStylesScript(
|
|
3353
|
-
getVariants(e.content).map((
|
|
3354
|
-
id:
|
|
3355
|
-
testRatio:
|
|
3388
|
+
getVariants(e.content).map((l) => ({
|
|
3389
|
+
id: l.testVariationId,
|
|
3390
|
+
testRatio: l.testRatio
|
|
3356
3391
|
})),
|
|
3357
|
-
((
|
|
3392
|
+
((c = e.content) == null ? void 0 : c.id) || ""
|
|
3358
3393
|
);
|
|
3359
3394
|
}
|
|
3360
3395
|
function i() {
|
|
3361
|
-
return getVariants(e.content).map((
|
|
3396
|
+
return getVariants(e.content).map((c) => `.variant-${c.testVariationId} { display: none; } `).join("");
|
|
3362
3397
|
}
|
|
3363
3398
|
function a() {
|
|
3364
|
-
var
|
|
3399
|
+
var c;
|
|
3365
3400
|
return t ? {
|
|
3366
3401
|
...e.content,
|
|
3367
|
-
testVariationId: (
|
|
3402
|
+
testVariationId: (c = e.content) == null ? void 0 : c.id
|
|
3368
3403
|
} : handleABTestingSync({
|
|
3369
3404
|
item: e.content,
|
|
3370
3405
|
canTrack: getDefaultCanTrack(e.canTrack)
|
|
@@ -3372,7 +3407,7 @@ function ContentVariants(e) {
|
|
|
3372
3407
|
}
|
|
3373
3408
|
return useEffect(() => {
|
|
3374
3409
|
}, []), /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3375
|
-
!e.
|
|
3410
|
+
!e.isNestedRender && TARGET !== "reactNative" ? /* @__PURE__ */ jsx(InlinedScript, { scriptStr: getScriptString() }) : null,
|
|
3376
3411
|
t ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3377
3412
|
/* @__PURE__ */ jsx(
|
|
3378
3413
|
InlinedStyles,
|
|
@@ -3382,10 +3417,11 @@ function ContentVariants(e) {
|
|
|
3382
3417
|
}
|
|
3383
3418
|
),
|
|
3384
3419
|
/* @__PURE__ */ jsx(InlinedScript, { scriptStr: o() }),
|
|
3385
|
-
(s = getVariants(e.content)) == null ? void 0 : s.map((
|
|
3420
|
+
(s = getVariants(e.content)) == null ? void 0 : s.map((c) => /* @__PURE__ */ jsx(
|
|
3386
3421
|
ContentComponent,
|
|
3387
3422
|
{
|
|
3388
|
-
|
|
3423
|
+
isNestedRender: e.isNestedRender,
|
|
3424
|
+
content: c,
|
|
3389
3425
|
showContent: !1,
|
|
3390
3426
|
model: e.model,
|
|
3391
3427
|
data: e.data,
|
|
@@ -3404,12 +3440,13 @@ function ContentVariants(e) {
|
|
|
3404
3440
|
contentWrapperProps: e.contentWrapperProps,
|
|
3405
3441
|
trustedHosts: e.trustedHosts
|
|
3406
3442
|
},
|
|
3407
|
-
|
|
3443
|
+
c.testVariationId
|
|
3408
3444
|
))
|
|
3409
3445
|
] }) : null,
|
|
3410
3446
|
/* @__PURE__ */ jsx(
|
|
3411
3447
|
ContentComponent,
|
|
3412
3448
|
{
|
|
3449
|
+
isNestedRender: e.isNestedRender,
|
|
3413
3450
|
content: a(),
|
|
3414
3451
|
showContent: !0,
|
|
3415
3452
|
model: e.model,
|
|
@@ -3452,26 +3489,26 @@ const fetchSymbolContent = async ({
|
|
|
3452
3489
|
});
|
|
3453
3490
|
};
|
|
3454
3491
|
function Symbol$1(e) {
|
|
3455
|
-
var a, r, s,
|
|
3492
|
+
var a, r, s, c;
|
|
3456
3493
|
function t() {
|
|
3457
|
-
var
|
|
3494
|
+
var l, d;
|
|
3458
3495
|
return [
|
|
3459
3496
|
e.attributes[getClassPropName()],
|
|
3460
3497
|
"builder-symbol",
|
|
3461
|
-
(
|
|
3498
|
+
(l = e.symbol) != null && l.inline ? "builder-inline-symbol" : void 0,
|
|
3462
3499
|
(d = e.symbol) != null && d.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
3463
3500
|
].filter(Boolean).join(" ");
|
|
3464
3501
|
}
|
|
3465
3502
|
const [n, o] = useState(() => {
|
|
3466
|
-
var
|
|
3467
|
-
return (
|
|
3503
|
+
var l;
|
|
3504
|
+
return (l = e.symbol) == null ? void 0 : l.content;
|
|
3468
3505
|
});
|
|
3469
3506
|
function i() {
|
|
3470
3507
|
n || fetchSymbolContent({
|
|
3471
3508
|
symbol: e.symbol,
|
|
3472
3509
|
builderContextValue: e.builderContext
|
|
3473
|
-
}).then((
|
|
3474
|
-
|
|
3510
|
+
}).then((l) => {
|
|
3511
|
+
l && o(l);
|
|
3475
3512
|
});
|
|
3476
3513
|
}
|
|
3477
3514
|
return useEffect(() => {
|
|
@@ -3480,7 +3517,7 @@ function Symbol$1(e) {
|
|
|
3480
3517
|
}, [e.symbol]), /* @__PURE__ */ jsx("div", { ...e.attributes, className: t(), children: /* @__PURE__ */ jsx(
|
|
3481
3518
|
ContentVariants,
|
|
3482
3519
|
{
|
|
3483
|
-
|
|
3520
|
+
isNestedRender: !0,
|
|
3484
3521
|
apiVersion: e.builderContext.apiVersion,
|
|
3485
3522
|
apiKey: e.builderContext.apiKey,
|
|
3486
3523
|
context: {
|
|
@@ -3493,7 +3530,7 @@ function Symbol$1(e) {
|
|
|
3493
3530
|
...e.builderContext.localState,
|
|
3494
3531
|
...(s = n == null ? void 0 : n.data) == null ? void 0 : s.state
|
|
3495
3532
|
},
|
|
3496
|
-
model: (
|
|
3533
|
+
model: (c = e.symbol) == null ? void 0 : c.model,
|
|
3497
3534
|
content: n,
|
|
3498
3535
|
linkComponent: e.builderLinkComponent,
|
|
3499
3536
|
blocksWrapper: "div",
|