@builder.io/sdk-react 0.7.3 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/index.cjs +117 -25
- package/lib/browser/index.mjs +835 -767
- package/lib/edge/index.cjs +121 -29
- package/lib/edge/index.mjs +1112 -1044
- package/lib/node/index.cjs +106 -14
- package/lib/node/index.mjs +492 -424
- package/package.json +8 -1
- package/types/blocks/video/video.d.ts +4 -0
- package/types/components/content/content.types.d.ts +0 -4
- package/types/components/content-variants/helpers.d.ts +3 -3
- package/types/components/content-variants/inlined-fns.d.ts +14 -0
- package/types/constants/sdk-version.d.ts +1 -1
package/lib/node/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { createContext, useState, useContext, createElement, useRef, useEffect } from "react";
|
|
4
4
|
import { i as isEditing, j as isBrowser, k as getUserAttributes, l as fastClone, m as logger, n as checkIsDefined, T as TARGET, r as register, o as getDefaultCanTrack, p as _track, a as isPreviewing, c as createRegisterComponentMessage, b as fetchOneEntry, q as fetch$1, u as components, v as serializeComponentInfo, w as handleABTestingSync } from "./server-entry-e4cd1e05.mjs";
|
|
5
|
-
import { _ as
|
|
5
|
+
import { _ as L, h as W, f as O, g as U, e as H, d as K, s as z, t as q } from "./server-entry-e4cd1e05.mjs";
|
|
6
6
|
function Button(e) {
|
|
7
7
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8
8
|
e.link ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
@@ -79,13 +79,13 @@ const getFunctionArguments = ({
|
|
|
79
79
|
rootSetState: a,
|
|
80
80
|
rootState: r
|
|
81
81
|
}) => {
|
|
82
|
-
const
|
|
82
|
+
const l = getFunctionArguments({
|
|
83
83
|
builder: t,
|
|
84
84
|
context: n,
|
|
85
85
|
event: i,
|
|
86
86
|
state: flattenState(r, o, a)
|
|
87
87
|
});
|
|
88
|
-
return new Function(...
|
|
88
|
+
return new Function(...l.map(([c]) => c), e)(...l.map(([, c]) => c));
|
|
89
89
|
};
|
|
90
90
|
function flattenState(e, t, n) {
|
|
91
91
|
if (e === t)
|
|
@@ -167,37 +167,37 @@ output;
|
|
|
167
167
|
rootSetState: a,
|
|
168
168
|
rootState: r
|
|
169
169
|
}) => {
|
|
170
|
-
const
|
|
170
|
+
const l = fastClone({
|
|
171
171
|
...r,
|
|
172
172
|
...o
|
|
173
173
|
}), c = getFunctionArguments({
|
|
174
174
|
builder: t,
|
|
175
175
|
context: n,
|
|
176
176
|
event: i,
|
|
177
|
-
state:
|
|
178
|
-
}),
|
|
179
|
-
|
|
180
|
-
console.log(...
|
|
181
|
-
}),
|
|
182
|
-
set(r,
|
|
183
|
-
}), c.forEach(([
|
|
184
|
-
const
|
|
177
|
+
state: l
|
|
178
|
+
}), s = getIsolateContext(), d = s.global;
|
|
179
|
+
d.setSync("global", d.derefInto()), d.setSync("log", function(...S) {
|
|
180
|
+
console.log(...S);
|
|
181
|
+
}), d.setSync(BUILDER_SET_STATE_NAME, function(S, g) {
|
|
182
|
+
set(r, S, g), a == null || a(r);
|
|
183
|
+
}), c.forEach(([S, g]) => {
|
|
184
|
+
const y = typeof g == "object" ? new ivm.Reference(
|
|
185
185
|
// workaround: methods with default values for arguments is not being cloned over
|
|
186
|
-
|
|
187
|
-
...
|
|
188
|
-
getUserAttributes: () =>
|
|
189
|
-
} :
|
|
186
|
+
S === "builder" ? {
|
|
187
|
+
...g,
|
|
188
|
+
getUserAttributes: () => g.getUserAttributes()
|
|
189
|
+
} : g
|
|
190
190
|
) : null;
|
|
191
|
-
|
|
192
|
-
}),
|
|
191
|
+
d.setSync(getSyncValName(S), y);
|
|
192
|
+
}), d.setSync(INJECTED_IVM_GLOBAL, ivm);
|
|
193
193
|
const f = processCode({
|
|
194
194
|
code: e,
|
|
195
195
|
args: c
|
|
196
|
-
}),
|
|
196
|
+
}), b = s.evalSync(f);
|
|
197
197
|
try {
|
|
198
|
-
return JSON.parse(
|
|
198
|
+
return JSON.parse(b);
|
|
199
199
|
} catch {
|
|
200
|
-
return
|
|
200
|
+
return b;
|
|
201
201
|
}
|
|
202
202
|
}, chooseBrowserOrServerEval = (e) => isBrowser() ? runInBrowser(e) : runInNode(e);
|
|
203
203
|
function evaluate({
|
|
@@ -213,7 +213,7 @@ function evaluate({
|
|
|
213
213
|
logger.warn("Skipping evaluation of empty code block.");
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
|
-
const
|
|
216
|
+
const l = {
|
|
217
217
|
code: parseCode(e, {
|
|
218
218
|
isExpression: r
|
|
219
219
|
}),
|
|
@@ -225,7 +225,7 @@ function evaluate({
|
|
|
225
225
|
localState: n
|
|
226
226
|
};
|
|
227
227
|
try {
|
|
228
|
-
return chooseBrowserOrServerEval(
|
|
228
|
+
return chooseBrowserOrServerEval(l);
|
|
229
229
|
} catch (c) {
|
|
230
230
|
logger.error("Failed code evaluation: " + c.message, {
|
|
231
231
|
code: e
|
|
@@ -254,15 +254,15 @@ const evaluateBindings = ({
|
|
|
254
254
|
...a.actions
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
for (const
|
|
258
|
-
const c = e.bindings[
|
|
257
|
+
for (const l in e.bindings) {
|
|
258
|
+
const c = e.bindings[l], s = evaluate({
|
|
259
259
|
code: c,
|
|
260
260
|
localState: n,
|
|
261
261
|
rootState: i,
|
|
262
262
|
rootSetState: o,
|
|
263
263
|
context: t
|
|
264
264
|
});
|
|
265
|
-
set(r,
|
|
265
|
+
set(r, l, s);
|
|
266
266
|
}
|
|
267
267
|
return r;
|
|
268
268
|
};
|
|
@@ -325,15 +325,15 @@ const EMPTY_HTML_ELEMENTS = ["area", "base", "br", "col", "embed", "hr", "img",
|
|
|
325
325
|
if (!Array.isArray(o))
|
|
326
326
|
return;
|
|
327
327
|
const a = n.collection.split(".").pop(), r = n.itemName || (a ? a + "Item" : "item");
|
|
328
|
-
return o.map((c,
|
|
328
|
+
return o.map((c, s) => ({
|
|
329
329
|
context: {
|
|
330
330
|
...t,
|
|
331
331
|
localState: {
|
|
332
332
|
...t.localState,
|
|
333
|
-
$index:
|
|
333
|
+
$index: s,
|
|
334
334
|
$item: c,
|
|
335
335
|
[r]: c,
|
|
336
|
-
[`$${r}Index`]:
|
|
336
|
+
[`$${r}Index`]: s
|
|
337
337
|
}
|
|
338
338
|
},
|
|
339
339
|
block: i
|
|
@@ -412,7 +412,7 @@ function BlockStyles(e) {
|
|
|
412
412
|
return checkIsDefined(i.hide) ? !i.hide : checkIsDefined(i.show) ? i.show : !0;
|
|
413
413
|
}
|
|
414
414
|
function n() {
|
|
415
|
-
var
|
|
415
|
+
var g;
|
|
416
416
|
const i = getProcessedBlock({
|
|
417
417
|
block: e.block,
|
|
418
418
|
localState: e.context.localState,
|
|
@@ -421,29 +421,29 @@ function BlockStyles(e) {
|
|
|
421
421
|
context: e.context.context,
|
|
422
422
|
shouldEvaluateBindings: !0
|
|
423
423
|
}), o = i.responsiveStyles, a = e.context.content, r = getSizesForBreakpoints(
|
|
424
|
-
((
|
|
425
|
-
),
|
|
426
|
-
if (!
|
|
424
|
+
((g = a == null ? void 0 : a.meta) == null ? void 0 : g.breakpoints) || {}
|
|
425
|
+
), l = o == null ? void 0 : o.large, c = o == null ? void 0 : o.medium, s = o == null ? void 0 : o.small, d = i.id;
|
|
426
|
+
if (!d)
|
|
427
427
|
return "";
|
|
428
|
-
const f =
|
|
429
|
-
className:
|
|
430
|
-
styles:
|
|
431
|
-
}) : "",
|
|
432
|
-
className:
|
|
428
|
+
const f = l ? createCssClass({
|
|
429
|
+
className: d,
|
|
430
|
+
styles: l
|
|
431
|
+
}) : "", b = c ? createCssClass({
|
|
432
|
+
className: d,
|
|
433
433
|
styles: c,
|
|
434
434
|
mediaQuery: getMaxWidthQueryForSize(
|
|
435
435
|
"medium",
|
|
436
436
|
r
|
|
437
437
|
)
|
|
438
|
-
}) : "",
|
|
439
|
-
className:
|
|
440
|
-
styles:
|
|
438
|
+
}) : "", S = s ? createCssClass({
|
|
439
|
+
className: d,
|
|
440
|
+
styles: s,
|
|
441
441
|
mediaQuery: getMaxWidthQueryForSize(
|
|
442
442
|
"small",
|
|
443
443
|
r
|
|
444
444
|
)
|
|
445
445
|
}) : "";
|
|
446
|
-
return [f,
|
|
446
|
+
return [f, b, S].join(" ");
|
|
447
447
|
}
|
|
448
448
|
return /* @__PURE__ */ jsx(Fragment, { children: n() && t() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: n() }) }) : null });
|
|
449
449
|
}
|
|
@@ -657,7 +657,7 @@ function RepeatedBlock(e) {
|
|
|
657
657
|
) });
|
|
658
658
|
}
|
|
659
659
|
function Block(e) {
|
|
660
|
-
var
|
|
660
|
+
var d, f, b, S;
|
|
661
661
|
function t() {
|
|
662
662
|
return getComponent({
|
|
663
663
|
block: e.block,
|
|
@@ -688,40 +688,40 @@ function Block(e) {
|
|
|
688
688
|
return "hide" in i() ? !i().hide : "show" in i() ? i().show : !0;
|
|
689
689
|
}
|
|
690
690
|
function r() {
|
|
691
|
-
var
|
|
692
|
-
return !((
|
|
691
|
+
var y;
|
|
692
|
+
return !((y = t == null ? void 0 : t()) != null && y.component) && !n() ? i().children ?? [] : [];
|
|
693
693
|
}
|
|
694
|
-
function
|
|
695
|
-
var
|
|
694
|
+
function l() {
|
|
695
|
+
var g, y, E, I, v;
|
|
696
696
|
return {
|
|
697
697
|
blockChildren: i().children ?? [],
|
|
698
|
-
componentRef: (
|
|
698
|
+
componentRef: (g = t == null ? void 0 : t()) == null ? void 0 : g.component,
|
|
699
699
|
componentOptions: {
|
|
700
700
|
...getBlockComponentOptions(i()),
|
|
701
701
|
builderContext: e.context,
|
|
702
|
-
...((
|
|
702
|
+
...((y = t == null ? void 0 : t()) == null ? void 0 : y.name) === "Symbol" || ((E = t == null ? void 0 : t()) == null ? void 0 : E.name) === "Columns" ? {
|
|
703
703
|
builderComponents: e.registeredComponents
|
|
704
704
|
} : {}
|
|
705
705
|
},
|
|
706
706
|
context: c,
|
|
707
707
|
registeredComponents: e.registeredComponents,
|
|
708
708
|
builderBlock: i(),
|
|
709
|
-
includeBlockProps: ((
|
|
710
|
-
isInteractive: !((
|
|
709
|
+
includeBlockProps: ((I = t == null ? void 0 : t()) == null ? void 0 : I.noWrap) === !0,
|
|
710
|
+
isInteractive: !((v = t == null ? void 0 : t()) != null && v.isRSC)
|
|
711
711
|
};
|
|
712
712
|
}
|
|
713
|
-
const [c,
|
|
714
|
-
return /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsx(Fragment, { children: (
|
|
713
|
+
const [c, s] = useState(() => e.context);
|
|
714
|
+
return /* @__PURE__ */ jsx(Fragment, { children: a() ? /* @__PURE__ */ jsx(Fragment, { children: (d = t == null ? void 0 : t()) != null && d.noWrap ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
715
715
|
ComponentRef,
|
|
716
716
|
{
|
|
717
|
-
componentRef:
|
|
718
|
-
componentOptions:
|
|
719
|
-
blockChildren:
|
|
720
|
-
context:
|
|
721
|
-
registeredComponents:
|
|
722
|
-
builderBlock:
|
|
723
|
-
includeBlockProps:
|
|
724
|
-
isInteractive:
|
|
717
|
+
componentRef: l().componentRef,
|
|
718
|
+
componentOptions: l().componentOptions,
|
|
719
|
+
blockChildren: l().blockChildren,
|
|
720
|
+
context: l().context,
|
|
721
|
+
registeredComponents: l().registeredComponents,
|
|
722
|
+
builderBlock: l().builderBlock,
|
|
723
|
+
includeBlockProps: l().includeBlockProps,
|
|
724
|
+
isInteractive: l().isInteractive
|
|
725
725
|
}
|
|
726
726
|
) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
727
727
|
isEmptyHtmlElement(o()) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
@@ -733,14 +733,14 @@ function Block(e) {
|
|
|
733
733
|
hasChildren: !1
|
|
734
734
|
}
|
|
735
735
|
) }) : null,
|
|
736
|
-
!isEmptyHtmlElement(o()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (f = n()) == null ? void 0 : f.map((
|
|
736
|
+
!isEmptyHtmlElement(o()) && n() ? /* @__PURE__ */ jsx(Fragment, { children: (f = n()) == null ? void 0 : f.map((g, y) => /* @__PURE__ */ jsx(
|
|
737
737
|
RepeatedBlock,
|
|
738
738
|
{
|
|
739
|
-
repeatContext:
|
|
740
|
-
block:
|
|
739
|
+
repeatContext: g.context,
|
|
740
|
+
block: g.block,
|
|
741
741
|
registeredComponents: e.registeredComponents
|
|
742
742
|
},
|
|
743
|
-
|
|
743
|
+
y
|
|
744
744
|
)) }) : null,
|
|
745
745
|
!isEmptyHtmlElement(o()) && !n() ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(
|
|
746
746
|
BlockWrapper,
|
|
@@ -753,32 +753,32 @@ function Block(e) {
|
|
|
753
753
|
/* @__PURE__ */ jsx(
|
|
754
754
|
ComponentRef,
|
|
755
755
|
{
|
|
756
|
-
componentRef:
|
|
757
|
-
componentOptions:
|
|
758
|
-
blockChildren:
|
|
759
|
-
context:
|
|
760
|
-
registeredComponents:
|
|
761
|
-
builderBlock:
|
|
762
|
-
includeBlockProps:
|
|
763
|
-
isInteractive:
|
|
756
|
+
componentRef: l().componentRef,
|
|
757
|
+
componentOptions: l().componentOptions,
|
|
758
|
+
blockChildren: l().blockChildren,
|
|
759
|
+
context: l().context,
|
|
760
|
+
registeredComponents: l().registeredComponents,
|
|
761
|
+
builderBlock: l().builderBlock,
|
|
762
|
+
includeBlockProps: l().includeBlockProps,
|
|
763
|
+
isInteractive: l().isInteractive
|
|
764
764
|
}
|
|
765
765
|
),
|
|
766
|
-
(
|
|
766
|
+
(b = r()) == null ? void 0 : b.map((g) => /* @__PURE__ */ jsx(
|
|
767
767
|
Block,
|
|
768
768
|
{
|
|
769
|
-
block:
|
|
769
|
+
block: g,
|
|
770
770
|
context: c,
|
|
771
771
|
registeredComponents: e.registeredComponents
|
|
772
772
|
},
|
|
773
|
-
"block-" +
|
|
773
|
+
"block-" + g.id
|
|
774
774
|
)),
|
|
775
|
-
(
|
|
775
|
+
(S = r()) == null ? void 0 : S.map((g) => /* @__PURE__ */ jsx(
|
|
776
776
|
BlockStyles,
|
|
777
777
|
{
|
|
778
|
-
block:
|
|
778
|
+
block: g,
|
|
779
779
|
context: c
|
|
780
780
|
},
|
|
781
|
-
"block-style-" +
|
|
781
|
+
"block-style-" + g.id
|
|
782
782
|
))
|
|
783
783
|
]
|
|
784
784
|
}
|
|
@@ -870,76 +870,76 @@ function Blocks(e) {
|
|
|
870
870
|
);
|
|
871
871
|
}
|
|
872
872
|
function Columns(e) {
|
|
873
|
-
var
|
|
873
|
+
var I;
|
|
874
874
|
const [t, n] = useState(
|
|
875
875
|
() => typeof e.space == "number" ? e.space || 0 : 20
|
|
876
876
|
), [i, o] = useState(() => e.columns || []), [a, r] = useState(
|
|
877
877
|
() => e.stackColumnsAt || "tablet"
|
|
878
878
|
);
|
|
879
|
-
function
|
|
880
|
-
var
|
|
881
|
-
return ((
|
|
879
|
+
function l(v) {
|
|
880
|
+
var C;
|
|
881
|
+
return ((C = i[v]) == null ? void 0 : C.width) || 100 / i.length;
|
|
882
882
|
}
|
|
883
|
-
function c(
|
|
884
|
-
const
|
|
885
|
-
return `calc(${
|
|
883
|
+
function c(v) {
|
|
884
|
+
const C = t * (i.length - 1) / i.length;
|
|
885
|
+
return `calc(${l(v)}% - ${C}px)`;
|
|
886
886
|
}
|
|
887
|
-
function
|
|
888
|
-
stackedStyle:
|
|
889
|
-
desktopStyle:
|
|
887
|
+
function s({
|
|
888
|
+
stackedStyle: v,
|
|
889
|
+
desktopStyle: C
|
|
890
890
|
}) {
|
|
891
|
-
return a === "tablet" ?
|
|
891
|
+
return a === "tablet" ? v : C;
|
|
892
892
|
}
|
|
893
|
-
function
|
|
894
|
-
stackedStyle:
|
|
895
|
-
desktopStyle:
|
|
893
|
+
function d({
|
|
894
|
+
stackedStyle: v,
|
|
895
|
+
desktopStyle: C
|
|
896
896
|
}) {
|
|
897
|
-
return a === "never" ?
|
|
897
|
+
return a === "never" ? C : v;
|
|
898
898
|
}
|
|
899
|
-
const [f,
|
|
899
|
+
const [f, b] = useState(
|
|
900
900
|
() => e.stackColumnsAt === "never" ? "row" : e.reverseColumnsWhenStacked ? "column-reverse" : "column"
|
|
901
901
|
);
|
|
902
|
-
function
|
|
902
|
+
function S() {
|
|
903
903
|
return {
|
|
904
904
|
"--flex-dir": f,
|
|
905
|
-
"--flex-dir-tablet":
|
|
905
|
+
"--flex-dir-tablet": s({
|
|
906
906
|
stackedStyle: f,
|
|
907
907
|
desktopStyle: "row"
|
|
908
908
|
})
|
|
909
909
|
};
|
|
910
910
|
}
|
|
911
|
-
function
|
|
912
|
-
const
|
|
911
|
+
function g(v) {
|
|
912
|
+
const C = v === 0 ? 0 : t, T = c(v), w = `${C}px`, R = "100%", j = 0;
|
|
913
913
|
return {
|
|
914
|
-
width:
|
|
915
|
-
["marginLeft"]:
|
|
916
|
-
"--column-width-mobile":
|
|
914
|
+
width: T,
|
|
915
|
+
["marginLeft"]: w,
|
|
916
|
+
"--column-width-mobile": d({
|
|
917
917
|
stackedStyle: R,
|
|
918
|
-
desktopStyle:
|
|
918
|
+
desktopStyle: T
|
|
919
919
|
}),
|
|
920
|
-
"--column-margin-left-mobile":
|
|
920
|
+
"--column-margin-left-mobile": d({
|
|
921
921
|
stackedStyle: j,
|
|
922
|
-
desktopStyle:
|
|
922
|
+
desktopStyle: w
|
|
923
923
|
}),
|
|
924
|
-
"--column-width-tablet":
|
|
924
|
+
"--column-width-tablet": s({
|
|
925
925
|
stackedStyle: R,
|
|
926
|
-
desktopStyle:
|
|
926
|
+
desktopStyle: T
|
|
927
927
|
}),
|
|
928
|
-
"--column-margin-left-tablet":
|
|
928
|
+
"--column-margin-left-tablet": s({
|
|
929
929
|
stackedStyle: j,
|
|
930
|
-
desktopStyle:
|
|
930
|
+
desktopStyle: w
|
|
931
931
|
})
|
|
932
932
|
};
|
|
933
933
|
}
|
|
934
|
-
function
|
|
935
|
-
var
|
|
934
|
+
function y(v) {
|
|
935
|
+
var T, w;
|
|
936
936
|
return getSizesForBreakpoints(
|
|
937
|
-
((
|
|
938
|
-
)[
|
|
937
|
+
((w = (T = e.builderContext.content) == null ? void 0 : T.meta) == null ? void 0 : w.breakpoints) || {}
|
|
938
|
+
)[v].max;
|
|
939
939
|
}
|
|
940
|
-
function
|
|
940
|
+
function E() {
|
|
941
941
|
return `
|
|
942
|
-
@media (max-width: ${
|
|
942
|
+
@media (max-width: ${y("medium")}px) {
|
|
943
943
|
.${e.builderBlock.id}-breakpoints {
|
|
944
944
|
flex-direction: var(--flex-dir-tablet);
|
|
945
945
|
align-items: stretch;
|
|
@@ -951,7 +951,7 @@ function Columns(e) {
|
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
|
|
954
|
-
@media (max-width: ${
|
|
954
|
+
@media (max-width: ${y("small")}px) {
|
|
955
955
|
.${e.builderBlock.id}-breakpoints {
|
|
956
956
|
flex-direction: var(--flex-dir);
|
|
957
957
|
align-items: stretch;
|
|
@@ -969,27 +969,27 @@ function Columns(e) {
|
|
|
969
969
|
"div",
|
|
970
970
|
{
|
|
971
971
|
className: `builder-columns ${e.builderBlock.id}-breakpoints div-53636e90`,
|
|
972
|
-
style:
|
|
972
|
+
style: S(),
|
|
973
973
|
children: [
|
|
974
|
-
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles:
|
|
975
|
-
(
|
|
974
|
+
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedStyles, { styles: E() }) }),
|
|
975
|
+
(I = e.columns) == null ? void 0 : I.map((v, C) => /* @__PURE__ */ createElement(
|
|
976
976
|
"div",
|
|
977
977
|
{
|
|
978
978
|
className: "builder-column div-53636e90-2",
|
|
979
|
-
style:
|
|
980
|
-
key:
|
|
979
|
+
style: g(C),
|
|
980
|
+
key: C
|
|
981
981
|
},
|
|
982
982
|
/* @__PURE__ */ jsx(
|
|
983
983
|
Blocks,
|
|
984
984
|
{
|
|
985
|
-
path: `component.options.columns.${
|
|
985
|
+
path: `component.options.columns.${C}.blocks`,
|
|
986
986
|
parent: e.builderBlock.id,
|
|
987
987
|
styleProp: {
|
|
988
988
|
flexGrow: "1"
|
|
989
989
|
},
|
|
990
990
|
context: e.builderContext,
|
|
991
991
|
registeredComponents: e.builderComponents,
|
|
992
|
-
blocks:
|
|
992
|
+
blocks: v.blocks
|
|
993
993
|
}
|
|
994
994
|
)
|
|
995
995
|
))
|
|
@@ -1040,20 +1040,20 @@ function getSrcSet(e) {
|
|
|
1040
1040
|
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [getShopifyImageUrl(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, i]) => `${n} ${i}w`).concat([e]).join(", ") : e;
|
|
1041
1041
|
}
|
|
1042
1042
|
function Image(e) {
|
|
1043
|
-
var o, a, r,
|
|
1043
|
+
var o, a, r, l;
|
|
1044
1044
|
function t() {
|
|
1045
|
-
var
|
|
1046
|
-
const
|
|
1047
|
-
if (!
|
|
1045
|
+
var d;
|
|
1046
|
+
const s = e.image || e.src;
|
|
1047
|
+
if (!s || // We can auto add srcset for cdn.builder.io and shopify
|
|
1048
1048
|
// images, otherwise you can supply this prop manually
|
|
1049
|
-
!(
|
|
1049
|
+
!(s.match(/builder\.io/) || s.match(/cdn\.shopify\.com/)))
|
|
1050
1050
|
return e.srcset;
|
|
1051
|
-
if (e.srcset && ((
|
|
1051
|
+
if (e.srcset && ((d = e.image) != null && d.includes("builder.io/api/v1/image"))) {
|
|
1052
1052
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
1053
|
-
return console.debug("Removed given srcset"), getSrcSet(
|
|
1053
|
+
return console.debug("Removed given srcset"), getSrcSet(s);
|
|
1054
1054
|
} else if (e.image && !e.srcset)
|
|
1055
|
-
return getSrcSet(
|
|
1056
|
-
return getSrcSet(
|
|
1055
|
+
return getSrcSet(s);
|
|
1056
|
+
return getSrcSet(s);
|
|
1057
1057
|
}
|
|
1058
1058
|
function n() {
|
|
1059
1059
|
var c;
|
|
@@ -1100,7 +1100,7 @@ function Image(e) {
|
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
1102
|
) }) : null,
|
|
1103
|
-
(
|
|
1103
|
+
(l = (r = e.builderBlock) == null ? void 0 : r.children) != null && l.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: e.children }) : null,
|
|
1104
1104
|
!e.fitContent && e.children ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { className: "div-dbab4030-2", children: e.children }) }) : null
|
|
1105
1105
|
] }),
|
|
1106
1106
|
/* @__PURE__ */ jsx("style", { children: `.img-dbab4030 {
|
|
@@ -1355,7 +1355,7 @@ const componentInfo$a = {
|
|
|
1355
1355
|
});
|
|
1356
1356
|
}
|
|
1357
1357
|
const n = e.get("columns");
|
|
1358
|
-
Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((
|
|
1358
|
+
Array.isArray(n) && n.find((o) => o.get("width")) && (n.find((a) => !a.get("width")) || n.reduce((l, c) => l + c.get("width"), 0) !== 100) && t();
|
|
1359
1359
|
}
|
|
1360
1360
|
}, {
|
|
1361
1361
|
name: "space",
|
|
@@ -1403,29 +1403,29 @@ const componentInfo$a = {
|
|
|
1403
1403
|
function CustomCode(e) {
|
|
1404
1404
|
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []);
|
|
1405
1405
|
return useEffect(() => {
|
|
1406
|
-
var
|
|
1407
|
-
if (!((
|
|
1406
|
+
var l;
|
|
1407
|
+
if (!((l = t.current) != null && l.getElementsByTagName) || typeof window > "u")
|
|
1408
1408
|
return;
|
|
1409
1409
|
const r = t.current.getElementsByTagName("script");
|
|
1410
1410
|
for (let c = 0; c < r.length; c++) {
|
|
1411
|
-
const
|
|
1412
|
-
if (
|
|
1413
|
-
if (n.includes(
|
|
1411
|
+
const s = r[c];
|
|
1412
|
+
if (s.src) {
|
|
1413
|
+
if (n.includes(s.src))
|
|
1414
1414
|
continue;
|
|
1415
|
-
n.push(
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1418
|
-
} else if (!
|
|
1415
|
+
n.push(s.src);
|
|
1416
|
+
const d = document.createElement("script");
|
|
1417
|
+
d.async = !0, d.src = s.src, document.head.appendChild(d);
|
|
1418
|
+
} else if (!s.type || [
|
|
1419
1419
|
"text/javascript",
|
|
1420
1420
|
"application/javascript",
|
|
1421
1421
|
"application/ecmascript"
|
|
1422
|
-
].includes(
|
|
1423
|
-
if (o.includes(
|
|
1422
|
+
].includes(s.type)) {
|
|
1423
|
+
if (o.includes(s.innerText))
|
|
1424
1424
|
continue;
|
|
1425
1425
|
try {
|
|
1426
|
-
o.push(
|
|
1427
|
-
} catch (
|
|
1428
|
-
console.warn("`CustomCode`: Error running script:",
|
|
1426
|
+
o.push(s.innerText), new Function(s.innerText)();
|
|
1427
|
+
} catch (d) {
|
|
1428
|
+
console.warn("`CustomCode`: Error running script:", d);
|
|
1429
1429
|
}
|
|
1430
1430
|
}
|
|
1431
1431
|
}
|
|
@@ -1465,27 +1465,27 @@ const componentInfo$7 = {
|
|
|
1465
1465
|
}]
|
|
1466
1466
|
}, SCRIPT_MIME_TYPES = ["text/javascript", "application/javascript", "application/ecmascript"], isJsScript = (e) => SCRIPT_MIME_TYPES.includes(e.type);
|
|
1467
1467
|
function Embed(e) {
|
|
1468
|
-
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r,
|
|
1468
|
+
const t = useRef(null), [n, i] = useState(() => []), [o, a] = useState(() => []), [r, l] = useState(() => !1);
|
|
1469
1469
|
function c() {
|
|
1470
1470
|
if (!t.current || !t.current.getElementsByTagName)
|
|
1471
1471
|
return;
|
|
1472
|
-
const
|
|
1473
|
-
for (let
|
|
1474
|
-
const f =
|
|
1472
|
+
const s = t.current.getElementsByTagName("script");
|
|
1473
|
+
for (let d = 0; d < s.length; d++) {
|
|
1474
|
+
const f = s[d];
|
|
1475
1475
|
if (f.src && !n.includes(f.src)) {
|
|
1476
1476
|
n.push(f.src);
|
|
1477
|
-
const
|
|
1478
|
-
|
|
1477
|
+
const b = document.createElement("script");
|
|
1478
|
+
b.async = !0, b.src = f.src, document.head.appendChild(b);
|
|
1479
1479
|
} else if (isJsScript(f) && !o.includes(f.innerText))
|
|
1480
1480
|
try {
|
|
1481
1481
|
o.push(f.innerText), new Function(f.innerText)();
|
|
1482
|
-
} catch (
|
|
1483
|
-
console.warn("`Embed`: Error running script:",
|
|
1482
|
+
} catch (b) {
|
|
1483
|
+
console.warn("`Embed`: Error running script:", b);
|
|
1484
1484
|
}
|
|
1485
1485
|
}
|
|
1486
1486
|
}
|
|
1487
1487
|
return useEffect(() => {
|
|
1488
|
-
t.current && !r && (
|
|
1488
|
+
t.current && !r && (l(!0), c());
|
|
1489
1489
|
}, [t.current, r]), /* @__PURE__ */ jsx(
|
|
1490
1490
|
"div",
|
|
1491
1491
|
{
|
|
@@ -1521,17 +1521,17 @@ const componentInfo$6 = {
|
|
|
1521
1521
|
defaultValue: "https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a",
|
|
1522
1522
|
onChange: (e) => {
|
|
1523
1523
|
e.delete("srcset"), e.delete("noWebp");
|
|
1524
|
-
function n(r,
|
|
1525
|
-
return new Promise((c,
|
|
1526
|
-
const
|
|
1524
|
+
function n(r, l = 6e4) {
|
|
1525
|
+
return new Promise((c, s) => {
|
|
1526
|
+
const d = document.createElement("img");
|
|
1527
1527
|
let f = !1;
|
|
1528
|
-
|
|
1529
|
-
f = !0, c(
|
|
1530
|
-
},
|
|
1531
|
-
console.warn("Image load failed",
|
|
1532
|
-
}),
|
|
1533
|
-
f ||
|
|
1534
|
-
},
|
|
1528
|
+
d.onload = () => {
|
|
1529
|
+
f = !0, c(d);
|
|
1530
|
+
}, d.addEventListener("error", (b) => {
|
|
1531
|
+
console.warn("Image load failed", b.error), s(b.error);
|
|
1532
|
+
}), d.src = r, setTimeout(() => {
|
|
1533
|
+
f || s(new Error("Image load timed out"));
|
|
1534
|
+
}, l);
|
|
1535
1535
|
});
|
|
1536
1536
|
}
|
|
1537
1537
|
function i(r) {
|
|
@@ -1542,8 +1542,8 @@ const componentInfo$6 = {
|
|
|
1542
1542
|
r.type.includes("svg") && e.set("noWebp", !0);
|
|
1543
1543
|
}), o && (!a || a === 0.7041))
|
|
1544
1544
|
return n(o).then((r) => {
|
|
1545
|
-
const
|
|
1546
|
-
e.get("image") === o && (!
|
|
1545
|
+
const l = e.get("aspectRatio");
|
|
1546
|
+
e.get("image") === o && (!l || l === 0.7041) && r.width && r.height && (e.set("aspectRatio", i(r.height / r.width)), e.set("height", r.height), e.set("width", r.width));
|
|
1547
1547
|
});
|
|
1548
1548
|
}
|
|
1549
1549
|
}, {
|
|
@@ -1818,7 +1818,7 @@ const componentInfo = {
|
|
|
1818
1818
|
}]
|
|
1819
1819
|
};
|
|
1820
1820
|
function Video(e) {
|
|
1821
|
-
var i;
|
|
1821
|
+
var i, o, a, r, l, c, s;
|
|
1822
1822
|
function t() {
|
|
1823
1823
|
return {
|
|
1824
1824
|
...e.autoPlay === !0 ? {
|
|
@@ -1840,27 +1840,81 @@ function Video(e) {
|
|
|
1840
1840
|
}
|
|
1841
1841
|
function n() {
|
|
1842
1842
|
return {
|
|
1843
|
-
...e.attributes,
|
|
1844
1843
|
...t()
|
|
1845
1844
|
};
|
|
1846
1845
|
}
|
|
1847
|
-
return /* @__PURE__ */
|
|
1848
|
-
"
|
|
1846
|
+
return /* @__PURE__ */ jsxs(
|
|
1847
|
+
"div",
|
|
1849
1848
|
{
|
|
1850
|
-
...n(),
|
|
1851
|
-
preload: e.preload || "metadata",
|
|
1852
1849
|
style: {
|
|
1853
|
-
|
|
1854
|
-
height: "100%",
|
|
1855
|
-
...(i = e.attributes) == null ? void 0 : i.style,
|
|
1856
|
-
objectFit: e.fit,
|
|
1857
|
-
objectPosition: e.position,
|
|
1858
|
-
// Hack to get object fit to work as expected and
|
|
1859
|
-
// not have the video overflow
|
|
1860
|
-
borderRadius: 1
|
|
1850
|
+
position: "relative"
|
|
1861
1851
|
},
|
|
1862
|
-
|
|
1863
|
-
|
|
1852
|
+
children: [
|
|
1853
|
+
/* @__PURE__ */ jsx(
|
|
1854
|
+
"video",
|
|
1855
|
+
{
|
|
1856
|
+
className: "builder-video",
|
|
1857
|
+
...n(),
|
|
1858
|
+
preload: e.preload || "metadata",
|
|
1859
|
+
style: {
|
|
1860
|
+
width: "100%",
|
|
1861
|
+
height: "100%",
|
|
1862
|
+
...(i = e.attributes) == null ? void 0 : i.style,
|
|
1863
|
+
objectFit: e.fit,
|
|
1864
|
+
objectPosition: e.position,
|
|
1865
|
+
// Hack to get object fit to work as expected and
|
|
1866
|
+
// not have the video overflow
|
|
1867
|
+
zIndex: 2,
|
|
1868
|
+
borderRadius: "1px",
|
|
1869
|
+
...e.aspectRatio ? {
|
|
1870
|
+
position: "absolute"
|
|
1871
|
+
} : null
|
|
1872
|
+
},
|
|
1873
|
+
src: e.video || "no-src",
|
|
1874
|
+
poster: e.posterImage,
|
|
1875
|
+
children: e.lazyLoad ? null : /* @__PURE__ */ jsx("source", { type: "video/mp4", src: e.video })
|
|
1876
|
+
}
|
|
1877
|
+
),
|
|
1878
|
+
e.aspectRatio && !(e.fitContent && ((a = (o = e.builderBlock) == null ? void 0 : o.children) != null && a.length)) ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1879
|
+
"div",
|
|
1880
|
+
{
|
|
1881
|
+
style: {
|
|
1882
|
+
width: "100%",
|
|
1883
|
+
paddingTop: e.aspectRatio * 100 + "%",
|
|
1884
|
+
pointerEvents: "none",
|
|
1885
|
+
fontSize: "0px"
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
) }) : null,
|
|
1889
|
+
(l = (r = e.builderBlock) == null ? void 0 : r.children) != null && l.length && e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1890
|
+
"div",
|
|
1891
|
+
{
|
|
1892
|
+
style: {
|
|
1893
|
+
display: "flex",
|
|
1894
|
+
flexDirection: "column",
|
|
1895
|
+
alignItems: "stretch"
|
|
1896
|
+
},
|
|
1897
|
+
children: e.children
|
|
1898
|
+
}
|
|
1899
|
+
) }) : null,
|
|
1900
|
+
(s = (c = e.builderBlock) == null ? void 0 : c.children) != null && s.length && !e.fitContent ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
1901
|
+
"div",
|
|
1902
|
+
{
|
|
1903
|
+
style: {
|
|
1904
|
+
pointerEvents: "none",
|
|
1905
|
+
display: "flex",
|
|
1906
|
+
flexDirection: "column",
|
|
1907
|
+
alignItems: "stretch",
|
|
1908
|
+
position: "absolute",
|
|
1909
|
+
top: "0",
|
|
1910
|
+
left: "0",
|
|
1911
|
+
width: "100%",
|
|
1912
|
+
height: "100%"
|
|
1913
|
+
},
|
|
1914
|
+
children: e.children
|
|
1915
|
+
}
|
|
1916
|
+
) }) : null
|
|
1917
|
+
]
|
|
1864
1918
|
}
|
|
1865
1919
|
);
|
|
1866
1920
|
}
|
|
@@ -1897,104 +1951,121 @@ const getDefaultRegisteredComponents = () => [{
|
|
|
1897
1951
|
}, {
|
|
1898
1952
|
component: Video,
|
|
1899
1953
|
...componentInfo
|
|
1900
|
-
}],
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
function bldrAbTest(e, t, n) {
|
|
1909
|
-
var r;
|
|
1910
|
-
function i() {
|
|
1911
|
-
function s(d, x, v) {
|
|
1912
|
-
let C = "";
|
|
1913
|
-
if (v) {
|
|
1914
|
-
const S = /* @__PURE__ */ new Date();
|
|
1915
|
-
S.setTime(S.getTime() + v * 24 * 60 * 60 * 1e3), C = "; expires=" + S.toUTCString();
|
|
1954
|
+
}], UPDATE_COOKIES_AND_STYLES_SCRIPT = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
1955
|
+
function getAndSetVariantId() {
|
|
1956
|
+
function setCookie(name, value, days) {
|
|
1957
|
+
let expires = '';
|
|
1958
|
+
if (days) {
|
|
1959
|
+
const date = new Date();
|
|
1960
|
+
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
1961
|
+
expires = '; expires=' + date.toUTCString();
|
|
1916
1962
|
}
|
|
1917
|
-
document.cookie =
|
|
1963
|
+
document.cookie = name + '=' + (value || '') + expires + '; path=/' + '; Secure; SameSite=None';
|
|
1918
1964
|
}
|
|
1919
|
-
function
|
|
1920
|
-
const
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
if (
|
|
1926
|
-
return S.substring(x.length, S.length);
|
|
1965
|
+
function getCookie(name) {
|
|
1966
|
+
const nameEQ = name + '=';
|
|
1967
|
+
const ca = document.cookie.split(';');
|
|
1968
|
+
for (let i = 0; i < ca.length; i++) {
|
|
1969
|
+
let c = ca[i];
|
|
1970
|
+
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
1971
|
+
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
1927
1972
|
}
|
|
1928
1973
|
return null;
|
|
1929
1974
|
}
|
|
1930
|
-
const
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1975
|
+
const cookieName = \`builder.tests.\${contentId}\`;
|
|
1976
|
+
const variantInCookie = getCookie(cookieName);
|
|
1977
|
+
const availableIDs = variants.map(vr => vr.id).concat(contentId);
|
|
1978
|
+
if (variantInCookie && availableIDs.includes(variantInCookie)) {
|
|
1979
|
+
return variantInCookie;
|
|
1980
|
+
}
|
|
1981
|
+
let n = 0;
|
|
1982
|
+
const random = Math.random();
|
|
1983
|
+
for (let i = 0; i < variants.length; i++) {
|
|
1984
|
+
const variant = variants[i];
|
|
1985
|
+
const testRatio = variant.testRatio;
|
|
1986
|
+
n += testRatio;
|
|
1987
|
+
if (random < n) {
|
|
1988
|
+
setCookie(cookieName, variant.id);
|
|
1989
|
+
return variant.id;
|
|
1990
|
+
}
|
|
1939
1991
|
}
|
|
1940
|
-
|
|
1992
|
+
setCookie(cookieName, contentId);
|
|
1993
|
+
return contentId;
|
|
1941
1994
|
}
|
|
1942
|
-
const
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1995
|
+
const winningVariantId = getAndSetVariantId();
|
|
1996
|
+
const styleEl = document.currentScript?.previousElementSibling;
|
|
1997
|
+
if (isHydrationTarget) {
|
|
1998
|
+
styleEl.remove();
|
|
1999
|
+
const thisScriptEl = document.currentScript;
|
|
2000
|
+
thisScriptEl?.remove();
|
|
1947
2001
|
} else {
|
|
1948
|
-
const
|
|
1949
|
-
id:
|
|
1950
|
-
}).filter(
|
|
1951
|
-
|
|
1952
|
-
|
|
2002
|
+
const newStyleStr = variants.concat({
|
|
2003
|
+
id: contentId
|
|
2004
|
+
}).filter(variant => variant.id !== winningVariantId).map(value => {
|
|
2005
|
+
return \`.variant-\${value.id} { display: none; }
|
|
2006
|
+
\`;
|
|
2007
|
+
}).join('');
|
|
2008
|
+
styleEl.innerHTML = newStyleStr;
|
|
1953
2009
|
}
|
|
1954
|
-
}
|
|
1955
|
-
|
|
1956
|
-
var c;
|
|
1957
|
-
if (!navigator.cookieEnabled)
|
|
2010
|
+
}`, UPDATE_VARIANT_VISIBILITY_SCRIPT = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
2011
|
+
if (!navigator.cookieEnabled) {
|
|
1958
2012
|
return;
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
2013
|
+
}
|
|
2014
|
+
function getCookie(name) {
|
|
2015
|
+
const nameEQ = name + '=';
|
|
2016
|
+
const ca = document.cookie.split(';');
|
|
2017
|
+
for (let i = 0; i < ca.length; i++) {
|
|
2018
|
+
let c = ca[i];
|
|
2019
|
+
while (c.charAt(0) === ' ') c = c.substring(1, c.length);
|
|
2020
|
+
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
1967
2021
|
}
|
|
1968
2022
|
return null;
|
|
1969
2023
|
}
|
|
1970
|
-
const
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
2024
|
+
const cookieName = \`builder.tests.\${defaultContentId}\`;
|
|
2025
|
+
const winningVariant = getCookie(cookieName);
|
|
2026
|
+
const parentDiv = document.currentScript?.parentElement;
|
|
2027
|
+
const isDefaultContent = variantContentId === defaultContentId;
|
|
2028
|
+
const isWinningVariant = winningVariant === variantContentId;
|
|
2029
|
+
if (isWinningVariant && !isDefaultContent) {
|
|
2030
|
+
parentDiv?.removeAttribute('hidden');
|
|
2031
|
+
parentDiv?.removeAttribute('aria-hidden');
|
|
2032
|
+
} else if (!isWinningVariant && isDefaultContent) {
|
|
2033
|
+
parentDiv?.setAttribute('hidden', 'true');
|
|
2034
|
+
parentDiv?.setAttribute('aria-hidden', 'true');
|
|
1978
2035
|
}
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
2036
|
+
if (isHydrationTarget) {
|
|
2037
|
+
if (!isWinningVariant) {
|
|
2038
|
+
parentDiv?.remove();
|
|
2039
|
+
}
|
|
2040
|
+
const thisScriptEl = document.currentScript;
|
|
2041
|
+
thisScriptEl?.remove();
|
|
2042
|
+
}
|
|
2043
|
+
return;
|
|
2044
|
+
}`, UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME = "builderIoAbTest", UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME = "builderIoRenderContent", getVariants = (e) => Object.values((e == null ? void 0 : e.variations) || {}).map((t) => ({
|
|
2045
|
+
...t,
|
|
2046
|
+
testVariationId: t.id,
|
|
2047
|
+
id: e == null ? void 0 : e.id
|
|
2048
|
+
})), checkShouldRenderVariants = ({
|
|
2049
|
+
canTrack: e,
|
|
2050
|
+
content: t
|
|
2051
|
+
}) => !(!(getVariants(t).length > 0) || !e || isBrowser()), getIsHydrationTarget = (e) => e === "react" || e === "reactNative", isHydrationTarget = getIsHydrationTarget(TARGET), getScriptString = () => `
|
|
2052
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME} = ${UPDATE_COOKIES_AND_STYLES_SCRIPT}
|
|
2053
|
+
window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME} = ${UPDATE_VARIANT_VISIBILITY_SCRIPT}
|
|
2054
|
+
`, getUpdateCookieAndStylesScript = (e, t) => `
|
|
2055
|
+
window.${UPDATE_COOKIES_AND_STYLES_SCRIPT_NAME}(
|
|
2056
|
+
"${t}",${JSON.stringify(e)}, ${isHydrationTarget}
|
|
2057
|
+
)`, getUpdateVariantVisibilityScript = ({
|
|
1988
2058
|
contentId: e,
|
|
1989
2059
|
variationId: t
|
|
1990
|
-
}) => `
|
|
1991
|
-
|
|
2060
|
+
}) => `window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
2061
|
+
"${t}", "${e}", ${isHydrationTarget}
|
|
2062
|
+
)`;
|
|
1992
2063
|
function InlinedScript(e) {
|
|
1993
2064
|
return /* @__PURE__ */ jsx(
|
|
1994
2065
|
"script",
|
|
1995
2066
|
{
|
|
1996
2067
|
dangerouslySetInnerHTML: { __html: e.scriptStr },
|
|
1997
|
-
id: e.id
|
|
2068
|
+
id: e.id || ""
|
|
1998
2069
|
}
|
|
1999
2070
|
);
|
|
2000
2071
|
}
|
|
@@ -2040,7 +2111,7 @@ const findParentElement = (e, t, n = !0) => {
|
|
|
2040
2111
|
builderElementIndex: n && i ? [].slice.call(document.getElementsByClassName(i)).indexOf(n) : void 0
|
|
2041
2112
|
}
|
|
2042
2113
|
};
|
|
2043
|
-
}, SDK_VERSION = "0.7.
|
|
2114
|
+
}, SDK_VERSION = "0.7.4", registerInsertMenu = () => {
|
|
2044
2115
|
register("insertMenu", {
|
|
2045
2116
|
name: "_default",
|
|
2046
2117
|
default: !0,
|
|
@@ -2089,12 +2160,12 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2089
2160
|
if (i != null && i.type)
|
|
2090
2161
|
switch (i.type) {
|
|
2091
2162
|
case "builder.evaluate": {
|
|
2092
|
-
const r = i.data.text,
|
|
2093
|
-
let
|
|
2163
|
+
const r = i.data.text, l = i.data.arguments || [], c = i.data.id, s = new Function(r);
|
|
2164
|
+
let d, f = null;
|
|
2094
2165
|
try {
|
|
2095
|
-
|
|
2096
|
-
} catch (
|
|
2097
|
-
f =
|
|
2166
|
+
d = s.apply(null, l);
|
|
2167
|
+
} catch (b) {
|
|
2168
|
+
f = b;
|
|
2098
2169
|
}
|
|
2099
2170
|
f ? (o = window.parent) == null || o.postMessage({
|
|
2100
2171
|
type: "builder.evaluateError",
|
|
@@ -2102,19 +2173,19 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2102
2173
|
id: c,
|
|
2103
2174
|
error: f.message
|
|
2104
2175
|
}
|
|
2105
|
-
}, "*") :
|
|
2106
|
-
var
|
|
2107
|
-
(
|
|
2176
|
+
}, "*") : d && typeof d.then == "function" ? d.then((b) => {
|
|
2177
|
+
var S;
|
|
2178
|
+
(S = window.parent) == null || S.postMessage({
|
|
2108
2179
|
type: "builder.evaluateResult",
|
|
2109
2180
|
data: {
|
|
2110
2181
|
id: c,
|
|
2111
|
-
result:
|
|
2182
|
+
result: b
|
|
2112
2183
|
}
|
|
2113
2184
|
}, "*");
|
|
2114
2185
|
}).catch(console.error) : (a = window.parent) == null || a.postMessage({
|
|
2115
2186
|
type: "builder.evaluateResult",
|
|
2116
2187
|
data: {
|
|
2117
|
-
result:
|
|
2188
|
+
result: d,
|
|
2118
2189
|
id: c
|
|
2119
2190
|
}
|
|
2120
2191
|
}, "*");
|
|
@@ -2124,88 +2195,88 @@ const setupBrowserForEditing = (e = {}) => {
|
|
|
2124
2195
|
})));
|
|
2125
2196
|
};
|
|
2126
2197
|
function EnableEditor(e) {
|
|
2127
|
-
var
|
|
2198
|
+
var T, w, R, j, B, A, P;
|
|
2128
2199
|
const t = useRef(null), [n, i] = useState(() => 0);
|
|
2129
|
-
function o(
|
|
2130
|
-
var
|
|
2131
|
-
const
|
|
2200
|
+
function o(u) {
|
|
2201
|
+
var h, x, p, k, F;
|
|
2202
|
+
const m = {
|
|
2132
2203
|
...e.builderContextSignal.content,
|
|
2133
|
-
...
|
|
2204
|
+
...u,
|
|
2134
2205
|
data: {
|
|
2135
|
-
...(
|
|
2136
|
-
...
|
|
2206
|
+
...(h = e.builderContextSignal.content) == null ? void 0 : h.data,
|
|
2207
|
+
...u == null ? void 0 : u.data
|
|
2137
2208
|
},
|
|
2138
2209
|
meta: {
|
|
2139
|
-
...(
|
|
2140
|
-
...
|
|
2141
|
-
breakpoints: ((
|
|
2210
|
+
...(x = e.builderContextSignal.content) == null ? void 0 : x.meta,
|
|
2211
|
+
...u == null ? void 0 : u.meta,
|
|
2212
|
+
breakpoints: ((p = u == null ? void 0 : u.meta) == null ? void 0 : p.breakpoints) || ((F = (k = e.builderContextSignal.content) == null ? void 0 : k.meta) == null ? void 0 : F.breakpoints)
|
|
2142
2213
|
}
|
|
2143
2214
|
};
|
|
2144
|
-
e.setBuilderContextSignal((
|
|
2145
|
-
...
|
|
2146
|
-
content:
|
|
2215
|
+
e.setBuilderContextSignal((_) => ({
|
|
2216
|
+
..._,
|
|
2217
|
+
content: m
|
|
2147
2218
|
}));
|
|
2148
2219
|
}
|
|
2149
2220
|
useState(() => 0);
|
|
2150
2221
|
const [a, r] = useState(
|
|
2151
2222
|
() => !1
|
|
2152
2223
|
);
|
|
2153
|
-
function
|
|
2154
|
-
var
|
|
2155
|
-
const { data:
|
|
2156
|
-
if (
|
|
2157
|
-
switch (
|
|
2224
|
+
function l(u) {
|
|
2225
|
+
var h;
|
|
2226
|
+
const { data: m } = u;
|
|
2227
|
+
if (m)
|
|
2228
|
+
switch (m.type) {
|
|
2158
2229
|
case "builder.configureSdk": {
|
|
2159
|
-
const
|
|
2160
|
-
if (!
|
|
2230
|
+
const x = m.data, { breakpoints: p, contentId: k } = x;
|
|
2231
|
+
if (!k || k !== ((h = e.builderContextSignal.content) == null ? void 0 : h.id))
|
|
2161
2232
|
return;
|
|
2162
|
-
|
|
2233
|
+
p && o({
|
|
2163
2234
|
meta: {
|
|
2164
|
-
breakpoints:
|
|
2235
|
+
breakpoints: p
|
|
2165
2236
|
}
|
|
2166
2237
|
}), i(n + 1);
|
|
2167
2238
|
break;
|
|
2168
2239
|
}
|
|
2169
2240
|
case "builder.contentUpdate": {
|
|
2170
|
-
const
|
|
2171
|
-
|
|
2241
|
+
const x = m.data, p = x.key || x.alias || x.entry || x.modelName, k = x.data;
|
|
2242
|
+
p === e.model && (o(k), i(n + 1));
|
|
2172
2243
|
break;
|
|
2173
2244
|
}
|
|
2174
2245
|
}
|
|
2175
2246
|
}
|
|
2176
2247
|
function c() {
|
|
2177
|
-
var
|
|
2178
|
-
const
|
|
2179
|
-
|
|
2180
|
-
code:
|
|
2248
|
+
var m, h;
|
|
2249
|
+
const u = (h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.jsCode;
|
|
2250
|
+
u && evaluate({
|
|
2251
|
+
code: u,
|
|
2181
2252
|
context: e.context || {},
|
|
2182
2253
|
localState: void 0,
|
|
2183
2254
|
rootState: e.builderContextSignal.rootState,
|
|
2184
2255
|
rootSetState: e.builderContextSignal.rootSetState
|
|
2185
2256
|
});
|
|
2186
2257
|
}
|
|
2187
|
-
const [
|
|
2188
|
-
function
|
|
2189
|
-
var
|
|
2258
|
+
const [s, d] = useState(() => ({})), [f, b] = useState(() => !1);
|
|
2259
|
+
function S(u) {
|
|
2260
|
+
var m, h;
|
|
2190
2261
|
if (e.builderContextSignal.content) {
|
|
2191
|
-
const
|
|
2262
|
+
const x = (m = e.builderContextSignal.content) == null ? void 0 : m.testVariationId, p = (h = e.builderContextSignal.content) == null ? void 0 : h.id;
|
|
2192
2263
|
_track({
|
|
2193
2264
|
type: "click",
|
|
2194
2265
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
2195
|
-
contentId:
|
|
2266
|
+
contentId: p,
|
|
2196
2267
|
apiKey: e.apiKey,
|
|
2197
|
-
variationId:
|
|
2198
|
-
...getInteractionPropertiesForEvent(
|
|
2268
|
+
variationId: x !== p ? x : void 0,
|
|
2269
|
+
...getInteractionPropertiesForEvent(u),
|
|
2199
2270
|
unique: !f
|
|
2200
2271
|
});
|
|
2201
2272
|
}
|
|
2202
|
-
f ||
|
|
2273
|
+
f || b(!0);
|
|
2203
2274
|
}
|
|
2204
|
-
function
|
|
2205
|
-
return
|
|
2275
|
+
function g(u) {
|
|
2276
|
+
return u.replace(
|
|
2206
2277
|
/{{([^}]+)}}/g,
|
|
2207
|
-
(
|
|
2208
|
-
code:
|
|
2278
|
+
(m, h) => evaluate({
|
|
2279
|
+
code: h,
|
|
2209
2280
|
context: e.context || {},
|
|
2210
2281
|
localState: void 0,
|
|
2211
2282
|
rootState: e.builderContextSignal.rootState,
|
|
@@ -2213,32 +2284,32 @@ function EnableEditor(e) {
|
|
|
2213
2284
|
})
|
|
2214
2285
|
);
|
|
2215
2286
|
}
|
|
2216
|
-
function
|
|
2217
|
-
fetch$1(
|
|
2218
|
-
var
|
|
2219
|
-
const
|
|
2287
|
+
function y({ url: u, key: m }) {
|
|
2288
|
+
fetch$1(u).then((h) => h.json()).then((h) => {
|
|
2289
|
+
var p, k;
|
|
2290
|
+
const x = {
|
|
2220
2291
|
...e.builderContextSignal.rootState,
|
|
2221
|
-
[
|
|
2292
|
+
[m]: h
|
|
2222
2293
|
};
|
|
2223
|
-
(
|
|
2224
|
-
}).catch((
|
|
2225
|
-
console.error("error fetching dynamic data",
|
|
2294
|
+
(k = (p = e.builderContextSignal).rootSetState) == null || k.call(p, x), s[m] = !0;
|
|
2295
|
+
}).catch((h) => {
|
|
2296
|
+
console.error("error fetching dynamic data", u, h);
|
|
2226
2297
|
});
|
|
2227
2298
|
}
|
|
2228
|
-
function
|
|
2229
|
-
var
|
|
2230
|
-
const
|
|
2231
|
-
Object.entries(
|
|
2232
|
-
if (
|
|
2233
|
-
const
|
|
2234
|
-
|
|
2235
|
-
url:
|
|
2236
|
-
key:
|
|
2299
|
+
function E() {
|
|
2300
|
+
var m, h;
|
|
2301
|
+
const u = ((h = (m = e.builderContextSignal.content) == null ? void 0 : m.data) == null ? void 0 : h.httpRequests) ?? {};
|
|
2302
|
+
Object.entries(u).forEach(([x, p]) => {
|
|
2303
|
+
if (p && (!s[x] || isEditing())) {
|
|
2304
|
+
const k = g(p);
|
|
2305
|
+
y({
|
|
2306
|
+
url: k,
|
|
2307
|
+
key: x
|
|
2237
2308
|
});
|
|
2238
2309
|
}
|
|
2239
2310
|
});
|
|
2240
2311
|
}
|
|
2241
|
-
function
|
|
2312
|
+
function I() {
|
|
2242
2313
|
isEditing() && window.dispatchEvent(
|
|
2243
2314
|
new CustomEvent(
|
|
2244
2315
|
"builder:component:stateChange",
|
|
@@ -2253,8 +2324,8 @@ function EnableEditor(e) {
|
|
|
2253
2324
|
)
|
|
2254
2325
|
);
|
|
2255
2326
|
}
|
|
2256
|
-
function
|
|
2257
|
-
i(n + 1), window.addEventListener("message",
|
|
2327
|
+
function v(u) {
|
|
2328
|
+
i(n + 1), window.addEventListener("message", l), registerInsertMenu(), setupBrowserForEditing({
|
|
2258
2329
|
...e.locale ? {
|
|
2259
2330
|
locale: e.locale
|
|
2260
2331
|
} : {},
|
|
@@ -2266,62 +2337,62 @@ function EnableEditor(e) {
|
|
|
2266
2337
|
} : {}
|
|
2267
2338
|
}), Object.values(
|
|
2268
2339
|
e.builderContextSignal.componentInfos
|
|
2269
|
-
).forEach((
|
|
2270
|
-
var
|
|
2271
|
-
const
|
|
2272
|
-
(
|
|
2340
|
+
).forEach((m) => {
|
|
2341
|
+
var x;
|
|
2342
|
+
const h = createRegisterComponentMessage(m);
|
|
2343
|
+
(x = window.parent) == null || x.postMessage(h, "*");
|
|
2273
2344
|
}), window.addEventListener(
|
|
2274
2345
|
"builder:component:stateChangeListenerActivated",
|
|
2275
|
-
|
|
2346
|
+
I
|
|
2276
2347
|
);
|
|
2277
2348
|
}
|
|
2278
|
-
function
|
|
2279
|
-
const
|
|
2280
|
-
`builder.preview.${
|
|
2281
|
-
),
|
|
2282
|
-
|
|
2349
|
+
function C(u) {
|
|
2350
|
+
const m = new URL(location.href).searchParams, h = m.get("builder.preview"), x = m.get(
|
|
2351
|
+
`builder.preview.${h}`
|
|
2352
|
+
), p = m.get("apiKey") || m.get("builder.space");
|
|
2353
|
+
h === e.model && p === e.apiKey && (!e.content || x === e.content.id) && fetchOneEntry({
|
|
2283
2354
|
model: e.model,
|
|
2284
2355
|
apiKey: e.apiKey,
|
|
2285
2356
|
apiVersion: e.builderContextSignal.apiVersion
|
|
2286
|
-
}).then((
|
|
2287
|
-
|
|
2357
|
+
}).then((k) => {
|
|
2358
|
+
k && o(k);
|
|
2288
2359
|
});
|
|
2289
2360
|
}
|
|
2290
2361
|
return useEffect(() => {
|
|
2291
|
-
var
|
|
2292
|
-
return (
|
|
2362
|
+
var u;
|
|
2363
|
+
return (u = t.current) == null || u.addEventListener(
|
|
2293
2364
|
"initeditingbldr",
|
|
2294
|
-
|
|
2365
|
+
v
|
|
2295
2366
|
), () => {
|
|
2296
|
-
var
|
|
2297
|
-
return (
|
|
2367
|
+
var m;
|
|
2368
|
+
return (m = t.current) == null ? void 0 : m.removeEventListener(
|
|
2298
2369
|
"initeditingbldr",
|
|
2299
|
-
|
|
2370
|
+
v
|
|
2300
2371
|
);
|
|
2301
2372
|
};
|
|
2302
2373
|
}, []), useEffect(() => {
|
|
2303
|
-
var
|
|
2304
|
-
return (
|
|
2374
|
+
var u;
|
|
2375
|
+
return (u = t.current) == null || u.addEventListener(
|
|
2305
2376
|
"initpreviewingbldr",
|
|
2306
|
-
|
|
2377
|
+
C
|
|
2307
2378
|
), () => {
|
|
2308
|
-
var
|
|
2309
|
-
return (
|
|
2379
|
+
var m;
|
|
2380
|
+
return (m = t.current) == null ? void 0 : m.removeEventListener(
|
|
2310
2381
|
"initpreviewingbldr",
|
|
2311
|
-
|
|
2382
|
+
C
|
|
2312
2383
|
);
|
|
2313
2384
|
};
|
|
2314
2385
|
}, []), useEffect(() => {
|
|
2315
|
-
var
|
|
2386
|
+
var u, m;
|
|
2316
2387
|
if (isBrowser()) {
|
|
2317
2388
|
if (isEditing() && t.current && t.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && getDefaultCanTrack(e.canTrack)) {
|
|
2318
|
-
const
|
|
2389
|
+
const x = (u = e.builderContextSignal.content) == null ? void 0 : u.testVariationId, p = (m = e.builderContextSignal.content) == null ? void 0 : m.id, k = e.apiKey;
|
|
2319
2390
|
_track({
|
|
2320
2391
|
type: "impression",
|
|
2321
2392
|
canTrack: !0,
|
|
2322
|
-
contentId:
|
|
2323
|
-
apiKey:
|
|
2324
|
-
variationId:
|
|
2393
|
+
contentId: p,
|
|
2394
|
+
apiKey: k,
|
|
2395
|
+
variationId: x !== p ? x : void 0
|
|
2325
2396
|
});
|
|
2326
2397
|
}
|
|
2327
2398
|
isPreviewing() && t.current && t.current.dispatchEvent(new CustomEvent("initpreviewingbldr"));
|
|
@@ -2329,37 +2400,37 @@ function EnableEditor(e) {
|
|
|
2329
2400
|
}, []), useEffect(() => {
|
|
2330
2401
|
e.apiKey || logger.error(
|
|
2331
2402
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
2332
|
-
), c(),
|
|
2403
|
+
), c(), E(), I();
|
|
2333
2404
|
}, []), useEffect(() => {
|
|
2334
2405
|
e.content && o(e.content);
|
|
2335
2406
|
}, [e.content]), useEffect(() => {
|
|
2336
2407
|
}, [a]), useEffect(() => {
|
|
2337
2408
|
c();
|
|
2338
2409
|
}, [
|
|
2339
|
-
(
|
|
2410
|
+
(w = (T = e.builderContextSignal.content) == null ? void 0 : T.data) == null ? void 0 : w.jsCode,
|
|
2340
2411
|
e.builderContextSignal.rootState
|
|
2341
2412
|
]), useEffect(() => {
|
|
2342
|
-
|
|
2413
|
+
E();
|
|
2343
2414
|
}, [(j = (R = e.builderContextSignal.content) == null ? void 0 : R.data) == null ? void 0 : j.httpRequests]), useEffect(() => {
|
|
2344
|
-
|
|
2415
|
+
I();
|
|
2345
2416
|
}, [e.builderContextSignal.rootState]), useEffect(() => () => {
|
|
2346
|
-
isBrowser() && (window.removeEventListener("message",
|
|
2417
|
+
isBrowser() && (window.removeEventListener("message", l), window.removeEventListener(
|
|
2347
2418
|
"builder:component:stateChangeListenerActivated",
|
|
2348
|
-
|
|
2419
|
+
I
|
|
2349
2420
|
));
|
|
2350
2421
|
}, []), /* @__PURE__ */ jsx(builderContext.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ createElement(
|
|
2351
2422
|
"div",
|
|
2352
2423
|
{
|
|
2353
2424
|
key: n,
|
|
2354
2425
|
ref: t,
|
|
2355
|
-
onClick: (
|
|
2426
|
+
onClick: (u) => S(u),
|
|
2356
2427
|
"builder-content-id": (B = e.builderContextSignal.content) == null ? void 0 : B.id,
|
|
2357
2428
|
"builder-model": e.model,
|
|
2358
2429
|
...e.showContent ? {} : {
|
|
2359
2430
|
hidden: !0,
|
|
2360
2431
|
"aria-hidden": !0
|
|
2361
2432
|
},
|
|
2362
|
-
className: e.
|
|
2433
|
+
className: `variant-${((A = e.content) == null ? void 0 : A.testVariationId) || ((P = e.content) == null ? void 0 : P.id)}`
|
|
2363
2434
|
},
|
|
2364
2435
|
e.children
|
|
2365
2436
|
) }) : null });
|
|
@@ -2431,14 +2502,14 @@ const getContextStateInitialValue = ({
|
|
|
2431
2502
|
data: t,
|
|
2432
2503
|
locale: n
|
|
2433
2504
|
}) => {
|
|
2434
|
-
var a, r,
|
|
2505
|
+
var a, r, l;
|
|
2435
2506
|
const i = {};
|
|
2436
2507
|
(r = (a = e == null ? void 0 : e.data) == null ? void 0 : a.inputs) == null || r.forEach((c) => {
|
|
2437
|
-
var
|
|
2438
|
-
c.name && c.defaultValue !== void 0 && ((
|
|
2508
|
+
var s;
|
|
2509
|
+
c.name && c.defaultValue !== void 0 && ((s = e == null ? void 0 : e.data) != null && s.state) && e.data.state[c.name] === void 0 && (i[c.name] = c.defaultValue);
|
|
2439
2510
|
});
|
|
2440
2511
|
const o = {
|
|
2441
|
-
...(
|
|
2512
|
+
...(l = e == null ? void 0 : e.data) == null ? void 0 : l.state,
|
|
2442
2513
|
...t,
|
|
2443
2514
|
...n ? {
|
|
2444
2515
|
locale: n
|
|
@@ -2460,22 +2531,22 @@ const getContextStateInitialValue = ({
|
|
|
2460
2531
|
meta: e == null ? void 0 : e.meta
|
|
2461
2532
|
} : void 0;
|
|
2462
2533
|
function ContentComponent(e) {
|
|
2463
|
-
var c,
|
|
2534
|
+
var c, s, d, f, b, S, g;
|
|
2464
2535
|
const [t, n] = useState(
|
|
2465
2536
|
() => {
|
|
2466
|
-
var
|
|
2467
|
-
return
|
|
2537
|
+
var y, E;
|
|
2538
|
+
return getUpdateVariantVisibilityScript({
|
|
2468
2539
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2469
|
-
variationId: (
|
|
2540
|
+
variationId: (y = e.content) == null ? void 0 : y.testVariationId,
|
|
2470
2541
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2471
|
-
contentId: (
|
|
2542
|
+
contentId: (E = e.content) == null ? void 0 : E.id
|
|
2472
2543
|
});
|
|
2473
2544
|
}
|
|
2474
2545
|
);
|
|
2475
|
-
function i(
|
|
2476
|
-
|
|
2477
|
-
...
|
|
2478
|
-
rootState:
|
|
2546
|
+
function i(y) {
|
|
2547
|
+
l((E) => ({
|
|
2548
|
+
...E,
|
|
2549
|
+
rootState: y
|
|
2479
2550
|
}));
|
|
2480
2551
|
}
|
|
2481
2552
|
const [o, a] = useState(
|
|
@@ -2489,16 +2560,16 @@ function ContentComponent(e) {
|
|
|
2489
2560
|
...components,
|
|
2490
2561
|
...e.customComponents || []
|
|
2491
2562
|
].reduce(
|
|
2492
|
-
(
|
|
2493
|
-
...
|
|
2494
|
-
[
|
|
2495
|
-
component:
|
|
2496
|
-
...serializeComponentInfo(
|
|
2563
|
+
(y, { component: E, ...I }) => ({
|
|
2564
|
+
...y,
|
|
2565
|
+
[I.name]: {
|
|
2566
|
+
component: E,
|
|
2567
|
+
...serializeComponentInfo(I)
|
|
2497
2568
|
}
|
|
2498
2569
|
}),
|
|
2499
2570
|
{}
|
|
2500
2571
|
)
|
|
2501
|
-
), [r,
|
|
2572
|
+
), [r, l] = useState(() => ({
|
|
2502
2573
|
content: getContentInitialValue({
|
|
2503
2574
|
content: e.content,
|
|
2504
2575
|
data: e.data
|
|
@@ -2523,9 +2594,9 @@ function ContentComponent(e) {
|
|
|
2523
2594
|
...components,
|
|
2524
2595
|
...e.customComponents || []
|
|
2525
2596
|
].reduce(
|
|
2526
|
-
(
|
|
2527
|
-
...
|
|
2528
|
-
[
|
|
2597
|
+
(y, { component: E, ...I }) => ({
|
|
2598
|
+
...y,
|
|
2599
|
+
[I.name]: serializeComponentInfo(I)
|
|
2529
2600
|
}),
|
|
2530
2601
|
{}
|
|
2531
2602
|
),
|
|
@@ -2548,24 +2619,23 @@ function ContentComponent(e) {
|
|
|
2548
2619
|
locale: e.locale,
|
|
2549
2620
|
includeRefs: e.includeRefs,
|
|
2550
2621
|
enrich: e.enrich,
|
|
2551
|
-
classNameProp: e.classNameProp,
|
|
2552
2622
|
showContent: e.showContent,
|
|
2553
2623
|
builderContextSignal: r,
|
|
2554
|
-
setBuilderContextSignal:
|
|
2624
|
+
setBuilderContextSignal: l,
|
|
2555
2625
|
children: [
|
|
2556
2626
|
e.isSsrAbTest ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(InlinedScript, { scriptStr: t }) }) : null,
|
|
2557
2627
|
/* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
2558
2628
|
ContentStyles,
|
|
2559
2629
|
{
|
|
2560
2630
|
contentId: (c = r.content) == null ? void 0 : c.id,
|
|
2561
|
-
cssCode: (
|
|
2562
|
-
customFonts: (
|
|
2631
|
+
cssCode: (d = (s = r.content) == null ? void 0 : s.data) == null ? void 0 : d.cssCode,
|
|
2632
|
+
customFonts: (b = (f = r.content) == null ? void 0 : f.data) == null ? void 0 : b.customFonts
|
|
2563
2633
|
}
|
|
2564
2634
|
) }),
|
|
2565
2635
|
/* @__PURE__ */ jsx(
|
|
2566
2636
|
Blocks,
|
|
2567
2637
|
{
|
|
2568
|
-
blocks: (
|
|
2638
|
+
blocks: (g = (S = r.content) == null ? void 0 : S.data) == null ? void 0 : g.blocks,
|
|
2569
2639
|
context: r,
|
|
2570
2640
|
registeredComponents: o
|
|
2571
2641
|
}
|
|
@@ -2577,31 +2647,31 @@ function ContentComponent(e) {
|
|
|
2577
2647
|
);
|
|
2578
2648
|
}
|
|
2579
2649
|
function ContentVariants(e) {
|
|
2580
|
-
var r,
|
|
2650
|
+
var r, l;
|
|
2581
2651
|
const [t, n] = useState(
|
|
2582
|
-
() =>
|
|
2652
|
+
() => checkShouldRenderVariants({
|
|
2583
2653
|
canTrack: getDefaultCanTrack(e.canTrack),
|
|
2584
2654
|
content: e.content
|
|
2585
2655
|
})
|
|
2586
2656
|
);
|
|
2587
2657
|
function i() {
|
|
2588
|
-
var
|
|
2589
|
-
return
|
|
2590
|
-
getVariants(e.content).map((
|
|
2591
|
-
id:
|
|
2592
|
-
testRatio:
|
|
2658
|
+
var c;
|
|
2659
|
+
return getUpdateCookieAndStylesScript(
|
|
2660
|
+
getVariants(e.content).map((s) => ({
|
|
2661
|
+
id: s.testVariationId,
|
|
2662
|
+
testRatio: s.testRatio
|
|
2593
2663
|
})),
|
|
2594
|
-
((
|
|
2664
|
+
((c = e.content) == null ? void 0 : c.id) || ""
|
|
2595
2665
|
);
|
|
2596
2666
|
}
|
|
2597
2667
|
function o() {
|
|
2598
|
-
return getVariants(e.content).map((
|
|
2668
|
+
return getVariants(e.content).map((c) => `.variant-${c.testVariationId} { display: none; } `).join("");
|
|
2599
2669
|
}
|
|
2600
2670
|
function a() {
|
|
2601
|
-
var
|
|
2671
|
+
var c;
|
|
2602
2672
|
return t ? {
|
|
2603
2673
|
...e.content,
|
|
2604
|
-
testVariationId: (
|
|
2674
|
+
testVariationId: (c = e.content) == null ? void 0 : c.id
|
|
2605
2675
|
} : handleABTestingSync({
|
|
2606
2676
|
item: e.content,
|
|
2607
2677
|
canTrack: getDefaultCanTrack(e.canTrack)
|
|
@@ -2619,12 +2689,11 @@ function ContentVariants(e) {
|
|
|
2619
2689
|
}
|
|
2620
2690
|
),
|
|
2621
2691
|
/* @__PURE__ */ jsx(InlinedScript, { scriptStr: i() }),
|
|
2622
|
-
(
|
|
2692
|
+
(l = getVariants(e.content)) == null ? void 0 : l.map((c) => /* @__PURE__ */ jsx(
|
|
2623
2693
|
ContentComponent,
|
|
2624
2694
|
{
|
|
2625
|
-
content:
|
|
2695
|
+
content: c,
|
|
2626
2696
|
showContent: !1,
|
|
2627
|
-
classNameProp: void 0,
|
|
2628
2697
|
model: e.model,
|
|
2629
2698
|
data: e.data,
|
|
2630
2699
|
context: e.context,
|
|
@@ -2637,14 +2706,13 @@ function ContentVariants(e) {
|
|
|
2637
2706
|
enrich: e.enrich,
|
|
2638
2707
|
isSsrAbTest: t
|
|
2639
2708
|
},
|
|
2640
|
-
|
|
2709
|
+
c.testVariationId
|
|
2641
2710
|
))
|
|
2642
2711
|
] }) : null,
|
|
2643
2712
|
/* @__PURE__ */ jsx(
|
|
2644
2713
|
ContentComponent,
|
|
2645
2714
|
{
|
|
2646
2715
|
content: a(),
|
|
2647
|
-
classNameProp: `variant-${(c = e.content) == null ? void 0 : c.id}`,
|
|
2648
2716
|
showContent: !0,
|
|
2649
2717
|
model: e.model,
|
|
2650
2718
|
data: e.data,
|
|
@@ -2681,14 +2749,14 @@ const fetchSymbolContent = async ({
|
|
|
2681
2749
|
});
|
|
2682
2750
|
};
|
|
2683
2751
|
function Symbol$1(e) {
|
|
2684
|
-
var a, r,
|
|
2752
|
+
var a, r, l;
|
|
2685
2753
|
function t() {
|
|
2686
|
-
var c,
|
|
2754
|
+
var c, s;
|
|
2687
2755
|
return [
|
|
2688
2756
|
e.attributes.className,
|
|
2689
2757
|
"builder-symbol",
|
|
2690
2758
|
(c = e.symbol) != null && c.inline ? "builder-inline-symbol" : void 0,
|
|
2691
|
-
(
|
|
2759
|
+
(s = e.symbol) != null && s.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2692
2760
|
].filter(Boolean).join(" ");
|
|
2693
2761
|
}
|
|
2694
2762
|
const [n, i] = useState(() => {
|
|
@@ -2719,7 +2787,7 @@ function Symbol$1(e) {
|
|
|
2719
2787
|
...e.builderContext.localState,
|
|
2720
2788
|
...(r = n == null ? void 0 : n.data) == null ? void 0 : r.state
|
|
2721
2789
|
},
|
|
2722
|
-
model: (
|
|
2790
|
+
model: (l = e.symbol) == null ? void 0 : l.model,
|
|
2723
2791
|
content: n
|
|
2724
2792
|
}
|
|
2725
2793
|
) });
|
|
@@ -2738,17 +2806,17 @@ export {
|
|
|
2738
2806
|
Symbol$1 as Symbol,
|
|
2739
2807
|
Text,
|
|
2740
2808
|
Video,
|
|
2741
|
-
|
|
2809
|
+
L as _processContentResult,
|
|
2742
2810
|
createRegisterComponentMessage,
|
|
2743
2811
|
W as fetchBuilderProps,
|
|
2744
|
-
|
|
2812
|
+
O as fetchEntries,
|
|
2745
2813
|
fetchOneEntry,
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2814
|
+
U as getAllContent,
|
|
2815
|
+
H as getBuilderSearchParams,
|
|
2816
|
+
K as getContent,
|
|
2749
2817
|
isEditing,
|
|
2750
2818
|
isPreviewing,
|
|
2751
2819
|
register,
|
|
2752
|
-
|
|
2753
|
-
|
|
2820
|
+
z as setEditorSettings,
|
|
2821
|
+
q as track
|
|
2754
2822
|
};
|