@builder.io/sdk-react-nextjs 0.14.26 → 0.14.27
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/{USE_CLIENT_BUNDLE-26be487e.cjs → USE_CLIENT_BUNDLE-2cf82d62.cjs} +5 -5
- package/lib/{node/USE_CLIENT_BUNDLE-07e24176.js → browser/USE_CLIENT_BUNDLE-6310e997.js} +36 -35
- package/lib/{edge/USE_SERVER_BUNDLE-06472a9d.cjs → browser/USE_SERVER_BUNDLE-96b0d36a.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-3c38a1b1.js → browser/USE_SERVER_BUNDLE-af025398.js} +1 -1
- package/lib/browser/bundle-301a174a.cjs +169 -0
- package/lib/browser/{bundle-999a2785.js → bundle-9a8df6bb.js} +309 -302
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-9966f569.cjs → edge/USE_CLIENT_BUNDLE-23fc72a9.cjs} +5 -5
- package/lib/{browser/USE_CLIENT_BUNDLE-4c845b66.js → edge/USE_CLIENT_BUNDLE-890ac9eb.js} +36 -35
- package/lib/{node/USE_SERVER_BUNDLE-aa3e89ff.js → edge/USE_SERVER_BUNDLE-317929d2.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-e36813e6.cjs → edge/USE_SERVER_BUNDLE-73825717.cjs} +1 -1
- package/lib/edge/bundle-8d9ad243.cjs +189 -0
- package/lib/edge/{bundle-66b04b60.js → bundle-db39aa05.js} +841 -842
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-6a4fcac3.js → node/USE_CLIENT_BUNDLE-70674322.js} +36 -35
- package/lib/{edge/USE_CLIENT_BUNDLE-7517cd42.cjs → node/USE_CLIENT_BUNDLE-f80aef0a.cjs} +5 -5
- package/lib/{browser/USE_SERVER_BUNDLE-f8a1ee85.js → node/USE_SERVER_BUNDLE-07526cde.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-a3f3b1f7.cjs → node/USE_SERVER_BUNDLE-07fef498.cjs} +1 -1
- package/lib/node/{bundle-1b7db75b.js → bundle-ae4a53d3.js} +24 -17
- package/lib/node/{bundle-e09f3bd9.cjs → bundle-c7a93d74.cjs} +6 -6
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/blocks/image/image.types.d.ts +1 -0
- package/types/cjs/components/block/block.helpers.d.ts +20 -2
- package/types/cjs/components/block/components/block-wrapper.d.ts +0 -1
- package/types/cjs/components/content/components/enable-editor.d.ts +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/esm/blocks/image/image.types.d.ts +1 -0
- package/types/esm/components/block/block.helpers.d.ts +20 -2
- package/types/esm/components/block/components/block-wrapper.d.ts +0 -1
- package/types/esm/components/content/components/enable-editor.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/lib/browser/bundle-476e30d7.cjs +0 -169
- package/lib/edge/bundle-ba82c7f5.cjs +0 -189
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as l, Fragment as C, jsxs as R } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { LRUCache as Fe } from "lru-cache";
|
|
4
|
-
import { I as Le, B as Ue, a as De, D as _e, C as Me, E as je, b as He, V as Ke, c as ze, F as qe, d as Ye, S as Ge, e as Je } from "./USE_CLIENT_BUNDLE-
|
|
4
|
+
import { I as Le, B as Ue, a as De, D as _e, C as Me, E as je, b as He, V as Ke, c as ze, F as qe, d as Ye, S as Ge, e as Je } from "./USE_CLIENT_BUNDLE-6310e997.js";
|
|
5
5
|
import "next/navigation";
|
|
6
|
-
const Qe = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]),
|
|
7
|
-
switch (
|
|
6
|
+
const Qe = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), go = (e) => typeof e == "string" && Qe.has(e.toLowerCase()), x = "rsc", M = () => {
|
|
7
|
+
switch (x) {
|
|
8
8
|
case "react":
|
|
9
9
|
case "reactNative":
|
|
10
10
|
case "rsc":
|
|
@@ -21,14 +21,10 @@ function Xe(e) {
|
|
|
21
21
|
var t;
|
|
22
22
|
return {
|
|
23
23
|
...(t = e.component) == null ? void 0 : t.options,
|
|
24
|
-
...e.options
|
|
25
|
-
/**
|
|
26
|
-
* Our built-in components frequently make use of the block, so we provide all of it under `builderBlock`
|
|
27
|
-
*/
|
|
28
|
-
builderBlock: e
|
|
24
|
+
...e.options
|
|
29
25
|
};
|
|
30
26
|
}
|
|
31
|
-
const P = "[Builder.io]: ",
|
|
27
|
+
const P = "[Builder.io]: ", I = {
|
|
32
28
|
log: (...e) => console.log(P, ...e),
|
|
33
29
|
error: (...e) => console.error(P, ...e),
|
|
34
30
|
warn: (...e) => console.warn(P, ...e),
|
|
@@ -74,7 +70,7 @@ const tt = () => {
|
|
|
74
70
|
return e.match(/IEMobile/i) || e.match(/WPDesktop/i);
|
|
75
71
|
},
|
|
76
72
|
any() {
|
|
77
|
-
return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() ||
|
|
73
|
+
return t.Android() || t.BlackBerry() || t.iOS() || t.Opera() || t.Windows() || x === "reactNative";
|
|
78
74
|
}
|
|
79
75
|
}, n = e.match(/Tablet|iPad/i), o = tt();
|
|
80
76
|
return {
|
|
@@ -147,17 +143,17 @@ function pe({
|
|
|
147
143
|
}
|
|
148
144
|
});
|
|
149
145
|
}
|
|
150
|
-
const
|
|
146
|
+
const T = (e) => e != null;
|
|
151
147
|
function at() {
|
|
152
148
|
var e;
|
|
153
|
-
return typeof process < "u" &&
|
|
149
|
+
return typeof process < "u" && T((e = process == null ? void 0 : process.versions) == null ? void 0 : e.node);
|
|
154
150
|
}
|
|
155
151
|
const st = () => {
|
|
156
152
|
var o;
|
|
157
153
|
if (!at())
|
|
158
154
|
return !1;
|
|
159
155
|
const e = process.arch === "arm64", t = process.version.startsWith("v20"), n = (o = process.env.NODE_OPTIONS) == null ? void 0 : o.includes("--no-node-snapshot");
|
|
160
|
-
return e && t && !n ? (
|
|
156
|
+
return e && t && !n ? (I.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;
|
|
161
157
|
}, ct = (e) => (k() || st(), Q(e)), j = class A {
|
|
162
158
|
static getCacheKey(t) {
|
|
163
159
|
return JSON.stringify({
|
|
@@ -178,7 +174,7 @@ const st = () => {
|
|
|
178
174
|
};
|
|
179
175
|
j.cacheLimit = 20;
|
|
180
176
|
j.cache = /* @__PURE__ */ new Map();
|
|
181
|
-
let
|
|
177
|
+
let B = j;
|
|
182
178
|
function H({
|
|
183
179
|
code: e,
|
|
184
180
|
context: t,
|
|
@@ -203,25 +199,25 @@ function H({
|
|
|
203
199
|
localState: n
|
|
204
200
|
};
|
|
205
201
|
if (s) {
|
|
206
|
-
const u =
|
|
202
|
+
const u = B.getCacheKey(c), h = B.getCachedValue(u);
|
|
207
203
|
if (h)
|
|
208
204
|
return h.value;
|
|
209
205
|
}
|
|
210
206
|
try {
|
|
211
207
|
const u = ct(c);
|
|
212
208
|
if (s) {
|
|
213
|
-
const h =
|
|
214
|
-
|
|
209
|
+
const h = B.getCacheKey(c);
|
|
210
|
+
B.setCachedValue(h, u);
|
|
215
211
|
}
|
|
216
212
|
return u;
|
|
217
213
|
} catch (u) {
|
|
218
|
-
|
|
214
|
+
I.error("Failed code evaluation: " + u.message, {
|
|
219
215
|
code: e
|
|
220
216
|
});
|
|
221
217
|
return;
|
|
222
218
|
}
|
|
223
219
|
}
|
|
224
|
-
const
|
|
220
|
+
const O = (e) => JSON.parse(JSON.stringify(e)), lt = (e, t, n) => {
|
|
225
221
|
if (Object(e) !== e)
|
|
226
222
|
return e;
|
|
227
223
|
const o = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
|
|
@@ -236,7 +232,7 @@ const dt = ({
|
|
|
236
232
|
}) => {
|
|
237
233
|
if (!e.bindings)
|
|
238
234
|
return e;
|
|
239
|
-
const r =
|
|
235
|
+
const r = O(e), a = {
|
|
240
236
|
...r,
|
|
241
237
|
properties: {
|
|
242
238
|
...r.properties
|
|
@@ -258,7 +254,7 @@ const dt = ({
|
|
|
258
254
|
}
|
|
259
255
|
return a;
|
|
260
256
|
};
|
|
261
|
-
function
|
|
257
|
+
function N({
|
|
262
258
|
block: e,
|
|
263
259
|
context: t,
|
|
264
260
|
shouldEvaluateBindings: n,
|
|
@@ -278,8 +274,8 @@ function O({
|
|
|
278
274
|
const K = (e) => e ? e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase() : "", ge = (e) => Object.entries(e).map(([n, o]) => {
|
|
279
275
|
if (typeof o == "string")
|
|
280
276
|
return `${K(n)}: ${o};`;
|
|
281
|
-
}).filter(
|
|
282
|
-
`),
|
|
277
|
+
}).filter(T), ut = (e) => ge(e).join(`
|
|
278
|
+
`), V = ({
|
|
283
279
|
mediaQuery: e,
|
|
284
280
|
className: t,
|
|
285
281
|
styles: n
|
|
@@ -305,7 +301,7 @@ const ft = ({
|
|
|
305
301
|
block: e
|
|
306
302
|
}));
|
|
307
303
|
function be(e) {
|
|
308
|
-
switch (
|
|
304
|
+
switch (x) {
|
|
309
305
|
case "svelte":
|
|
310
306
|
case "vue":
|
|
311
307
|
case "solid":
|
|
@@ -324,7 +320,7 @@ const ht = ({
|
|
|
324
320
|
registeredComponents: n
|
|
325
321
|
}) => {
|
|
326
322
|
var r;
|
|
327
|
-
const o = (r =
|
|
323
|
+
const o = (r = N({
|
|
328
324
|
block: e,
|
|
329
325
|
localState: t.localState,
|
|
330
326
|
rootState: t.rootState,
|
|
@@ -374,7 +370,15 @@ const ht = ({
|
|
|
374
370
|
},
|
|
375
371
|
block: o
|
|
376
372
|
}));
|
|
377
|
-
}, gt = (e) => e && (e.isRSC
|
|
373
|
+
}, gt = (e, t) => e && (e.isRSC && x === "rsc" || ["Core:Button", "Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(e.name)) ? {
|
|
374
|
+
builderLinkComponent: t
|
|
375
|
+
} : {}, bt = (e, t) => e && (e.isRSC && x === "rsc" || ["Symbol", "Columns", "Form:Form", "Builder: Tabs", "Builder:Accordion"].includes(e.name)) ? {
|
|
376
|
+
builderComponents: t
|
|
377
|
+
} : {}, yt = (e, t) => e && (e.isRSC && x === "rsc" || x === "reactNative" || ["Builder:Accordion", "Columns", "Form:Form", "Builder: Tabs", "Symbol", "Image", "Video"].includes(e.name)) ? {
|
|
378
|
+
builderBlock: t
|
|
379
|
+
} : {}, St = (e, t) => e && (e.isRSC && x === "rsc" || ["Builder:Accordion", "Columns", "Form:Form", "Builder: Tabs", "Symbol", "Slot"].includes(e.name)) ? {
|
|
380
|
+
builderContext: t
|
|
381
|
+
} : {}, ye = {
|
|
378
382
|
small: {
|
|
379
383
|
min: 320,
|
|
380
384
|
default: 321,
|
|
@@ -394,7 +398,7 @@ const ht = ({
|
|
|
394
398
|
small: e,
|
|
395
399
|
medium: t
|
|
396
400
|
}) => {
|
|
397
|
-
const n =
|
|
401
|
+
const n = O(ye);
|
|
398
402
|
if (!e || !t)
|
|
399
403
|
return n;
|
|
400
404
|
const o = Math.floor(e / 2);
|
|
@@ -417,7 +421,7 @@ const ht = ({
|
|
|
417
421
|
default: r + 1
|
|
418
422
|
}, n;
|
|
419
423
|
};
|
|
420
|
-
function
|
|
424
|
+
function $(e) {
|
|
421
425
|
return /* @__PURE__ */ l(
|
|
422
426
|
"style",
|
|
423
427
|
{
|
|
@@ -426,9 +430,9 @@ function N(e) {
|
|
|
426
430
|
}
|
|
427
431
|
);
|
|
428
432
|
}
|
|
429
|
-
function
|
|
433
|
+
function vt(e) {
|
|
430
434
|
const t = function() {
|
|
431
|
-
const i =
|
|
435
|
+
const i = N({
|
|
432
436
|
block: e.block,
|
|
433
437
|
localState: e.context.localState,
|
|
434
438
|
rootState: e.context.rootState,
|
|
@@ -436,10 +440,10 @@ function yt(e) {
|
|
|
436
440
|
context: e.context.context,
|
|
437
441
|
shouldEvaluateBindings: !0
|
|
438
442
|
});
|
|
439
|
-
return
|
|
443
|
+
return T(i.hide) ? !i.hide : T(i.show) ? i.show : !0;
|
|
440
444
|
}, n = function() {
|
|
441
445
|
var m, p, y;
|
|
442
|
-
const i =
|
|
446
|
+
const i = N({
|
|
443
447
|
block: e.block,
|
|
444
448
|
localState: e.context.localState,
|
|
445
449
|
rootState: e.context.rootState,
|
|
@@ -451,17 +455,17 @@ function yt(e) {
|
|
|
451
455
|
), c = r == null ? void 0 : r.large, u = r == null ? void 0 : r.medium, h = r == null ? void 0 : r.small, d = i.id;
|
|
452
456
|
if (!d)
|
|
453
457
|
return "";
|
|
454
|
-
const f = c ?
|
|
458
|
+
const f = c ? V({
|
|
455
459
|
className: d,
|
|
456
460
|
styles: c
|
|
457
|
-
}) : "", g = u ?
|
|
461
|
+
}) : "", g = u ? V({
|
|
458
462
|
className: d,
|
|
459
463
|
styles: u,
|
|
460
464
|
mediaQuery: X(
|
|
461
465
|
"medium",
|
|
462
466
|
s
|
|
463
467
|
)
|
|
464
|
-
}) : "", v = h ?
|
|
468
|
+
}) : "", v = h ? V({
|
|
465
469
|
className: d,
|
|
466
470
|
styles: h,
|
|
467
471
|
mediaQuery: X(
|
|
@@ -472,7 +476,7 @@ function yt(e) {
|
|
|
472
476
|
let E = "";
|
|
473
477
|
if (b) {
|
|
474
478
|
const S = ((y = (p = b.steps) == null ? void 0 : p[1]) == null ? void 0 : y.styles) || {};
|
|
475
|
-
E =
|
|
479
|
+
E = V({
|
|
476
480
|
className: `${d}:hover`,
|
|
477
481
|
styles: {
|
|
478
482
|
...S,
|
|
@@ -490,12 +494,12 @@ function yt(e) {
|
|
|
490
494
|
E
|
|
491
495
|
].join(" ");
|
|
492
496
|
};
|
|
493
|
-
return /* @__PURE__ */ l(C, { children: n() && t() ? /* @__PURE__ */ l(C, { children: /* @__PURE__ */ l(
|
|
497
|
+
return /* @__PURE__ */ l(C, { children: n() && t() ? /* @__PURE__ */ l(C, { children: /* @__PURE__ */ l($, { id: "builderio-block", styles: n() }) }) : null });
|
|
494
498
|
}
|
|
495
|
-
function
|
|
499
|
+
function kt(e) {
|
|
496
500
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
497
501
|
}
|
|
498
|
-
const
|
|
502
|
+
const xt = (e) => `on${kt(e)}`, Ct = (e, t) => (n) => H({
|
|
499
503
|
code: e,
|
|
500
504
|
context: t.context,
|
|
501
505
|
localState: t.localState,
|
|
@@ -505,15 +509,15 @@ const vt = (e) => `on${St(e)}`, kt = (e, t) => (n) => H({
|
|
|
505
509
|
isExpression: !1,
|
|
506
510
|
enableCache: !0
|
|
507
511
|
});
|
|
508
|
-
function
|
|
512
|
+
function bo(e) {
|
|
509
513
|
const t = {}, n = e.block.actions ?? {};
|
|
510
514
|
for (const o in n) {
|
|
511
515
|
if (!n.hasOwnProperty(o))
|
|
512
516
|
continue;
|
|
513
517
|
const i = n[o];
|
|
514
|
-
let r =
|
|
518
|
+
let r = xt(o);
|
|
515
519
|
if (e.stripPrefix)
|
|
516
|
-
switch (
|
|
520
|
+
switch (x) {
|
|
517
521
|
case "vue":
|
|
518
522
|
r = r.replace("v-on:", "");
|
|
519
523
|
break;
|
|
@@ -521,25 +525,25 @@ function po(e) {
|
|
|
521
525
|
r = r.replace("on:", "");
|
|
522
526
|
break;
|
|
523
527
|
}
|
|
524
|
-
t[r] =
|
|
528
|
+
t[r] = Ct(i, e);
|
|
525
529
|
}
|
|
526
530
|
return t;
|
|
527
531
|
}
|
|
528
|
-
function
|
|
532
|
+
function wt({
|
|
529
533
|
properties: e
|
|
530
534
|
}) {
|
|
531
535
|
return e;
|
|
532
536
|
}
|
|
533
|
-
const
|
|
537
|
+
const It = (e) => ({
|
|
534
538
|
href: e.href
|
|
535
539
|
});
|
|
536
|
-
function
|
|
540
|
+
function Tt({
|
|
537
541
|
block: e,
|
|
538
542
|
context: t
|
|
539
543
|
}) {
|
|
540
544
|
var o;
|
|
541
545
|
const n = {
|
|
542
|
-
...
|
|
546
|
+
...It(e),
|
|
543
547
|
...e.properties,
|
|
544
548
|
"builder-id": e.id,
|
|
545
549
|
style: ft({
|
|
@@ -548,13 +552,13 @@ function wt({
|
|
|
548
552
|
}),
|
|
549
553
|
[M()]: [e.id, "builder-block", e.class, (o = e.properties) == null ? void 0 : o.class].filter(Boolean).join(" ")
|
|
550
554
|
};
|
|
551
|
-
return
|
|
555
|
+
return wt({
|
|
552
556
|
properties: n,
|
|
553
557
|
context: t,
|
|
554
558
|
block: e
|
|
555
559
|
});
|
|
556
560
|
}
|
|
557
|
-
const
|
|
561
|
+
const Et = ({
|
|
558
562
|
componentOptions: e,
|
|
559
563
|
builderBlock: t,
|
|
560
564
|
context: n,
|
|
@@ -570,7 +574,7 @@ const It = ({
|
|
|
570
574
|
* component itself directly. Otherwise, they are provided to the wrapper element.
|
|
571
575
|
*/
|
|
572
576
|
...i ? {
|
|
573
|
-
attributes:
|
|
577
|
+
attributes: Tt({
|
|
574
578
|
block: t,
|
|
575
579
|
context: a
|
|
576
580
|
})
|
|
@@ -590,7 +594,7 @@ function Z(e) {
|
|
|
590
594
|
return /* @__PURE__ */ l(C, { children: e.componentRef ? /* @__PURE__ */ l(C, { children: /* @__PURE__ */ l(
|
|
591
595
|
t,
|
|
592
596
|
{
|
|
593
|
-
...
|
|
597
|
+
...Et({
|
|
594
598
|
componentOptions: e.componentOptions,
|
|
595
599
|
builderBlock: e.builderBlock,
|
|
596
600
|
context: e.context,
|
|
@@ -613,7 +617,7 @@ function Z(e) {
|
|
|
613
617
|
}
|
|
614
618
|
) }) : null });
|
|
615
619
|
}
|
|
616
|
-
function
|
|
620
|
+
function Rt(e) {
|
|
617
621
|
const t = e.repeatContext;
|
|
618
622
|
return /* @__PURE__ */ l(
|
|
619
623
|
F,
|
|
@@ -640,7 +644,7 @@ function F(e) {
|
|
|
640
644
|
});
|
|
641
645
|
}, o = function() {
|
|
642
646
|
var f;
|
|
643
|
-
return (f = e.block.repeat) != null && f.collection ? e.block :
|
|
647
|
+
return (f = e.block.repeat) != null && f.collection ? e.block : N({
|
|
644
648
|
block: e.block,
|
|
645
649
|
localState: e.context.localState,
|
|
646
650
|
rootState: e.context.rootState,
|
|
@@ -667,13 +671,13 @@ function F(e) {
|
|
|
667
671
|
componentRef: (f = t()) == null ? void 0 : f.component,
|
|
668
672
|
componentOptions: {
|
|
669
673
|
...Xe(o()),
|
|
670
|
-
|
|
671
|
-
...
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
674
|
+
...yt(t(), o()),
|
|
675
|
+
...St(t(), e.context),
|
|
676
|
+
...gt(t(), e.linkComponent),
|
|
677
|
+
...bt(
|
|
678
|
+
t(),
|
|
679
|
+
e.registeredComponents
|
|
680
|
+
)
|
|
677
681
|
},
|
|
678
682
|
context: e.context,
|
|
679
683
|
linkComponent: e.linkComponent,
|
|
@@ -684,7 +688,7 @@ function F(e) {
|
|
|
684
688
|
};
|
|
685
689
|
};
|
|
686
690
|
return /* @__PURE__ */ l(C, { children: r() ? /* @__PURE__ */ R(C, { children: [
|
|
687
|
-
/* @__PURE__ */ l(
|
|
691
|
+
/* @__PURE__ */ l(vt, { block: e.block, context: e.context }),
|
|
688
692
|
(c = t()) != null && c.noWrap ? /* @__PURE__ */ l(C, { children: /* @__PURE__ */ l(
|
|
689
693
|
Z,
|
|
690
694
|
{
|
|
@@ -699,7 +703,7 @@ function F(e) {
|
|
|
699
703
|
isInteractive: s().isInteractive
|
|
700
704
|
}
|
|
701
705
|
) }) : /* @__PURE__ */ l(C, { children: n() ? /* @__PURE__ */ l(C, { children: (h = n()) == null ? void 0 : h.map((d, f) => /* @__PURE__ */ l(
|
|
702
|
-
|
|
706
|
+
Rt,
|
|
703
707
|
{
|
|
704
708
|
repeatContext: d.context,
|
|
705
709
|
block: d.block,
|
|
@@ -713,7 +717,6 @@ function F(e) {
|
|
|
713
717
|
Wrapper: i(),
|
|
714
718
|
block: o(),
|
|
715
719
|
context: e.context,
|
|
716
|
-
linkComponent: e.linkComponent,
|
|
717
720
|
children: [
|
|
718
721
|
/* @__PURE__ */ l(
|
|
719
722
|
Z,
|
|
@@ -768,8 +771,8 @@ function z(e) {
|
|
|
768
771
|
}
|
|
769
772
|
);
|
|
770
773
|
}
|
|
771
|
-
const
|
|
772
|
-
function
|
|
774
|
+
const At = (e) => `builder-columns ${e}-breakpoints`;
|
|
775
|
+
function Pt(e) {
|
|
773
776
|
var b, E;
|
|
774
777
|
const t = typeof e.space == "number" ? e.space || 0 : 20, n = e.columns || [], o = e.stackColumnsAt || "tablet", i = function(p) {
|
|
775
778
|
return p.link ? e.builderLinkComponent || "a" : "div";
|
|
@@ -798,7 +801,7 @@ function Rt(e) {
|
|
|
798
801
|
})
|
|
799
802
|
};
|
|
800
803
|
}, d = function(p) {
|
|
801
|
-
const y = p === 0 ? 0 : t, S = a(p),
|
|
804
|
+
const y = p === 0 ? 0 : t, S = a(p), w = `${y}px`, G = "100%", J = 0;
|
|
802
805
|
return {
|
|
803
806
|
...{
|
|
804
807
|
display: "flex",
|
|
@@ -806,14 +809,14 @@ function Rt(e) {
|
|
|
806
809
|
alignItems: "stretch"
|
|
807
810
|
},
|
|
808
811
|
width: S,
|
|
809
|
-
["marginLeft"]:
|
|
812
|
+
["marginLeft"]: w,
|
|
810
813
|
"--column-width-mobile": c({
|
|
811
814
|
stackedStyle: G,
|
|
812
815
|
desktopStyle: S
|
|
813
816
|
}),
|
|
814
817
|
"--column-margin-left-mobile": c({
|
|
815
818
|
stackedStyle: J,
|
|
816
|
-
desktopStyle:
|
|
819
|
+
desktopStyle: w
|
|
817
820
|
}),
|
|
818
821
|
"--column-width-tablet": s({
|
|
819
822
|
stackedStyle: G,
|
|
@@ -821,13 +824,13 @@ function Rt(e) {
|
|
|
821
824
|
}),
|
|
822
825
|
"--column-margin-left-tablet": s({
|
|
823
826
|
stackedStyle: J,
|
|
824
|
-
desktopStyle:
|
|
827
|
+
desktopStyle: w
|
|
825
828
|
})
|
|
826
829
|
};
|
|
827
830
|
}, f = function(p) {
|
|
828
|
-
var S,
|
|
831
|
+
var S, w;
|
|
829
832
|
return Se(
|
|
830
|
-
((
|
|
833
|
+
((w = (S = e.builderContext.content) == null ? void 0 : S.meta) == null ? void 0 : w.breakpoints) || {}
|
|
831
834
|
)[p].max;
|
|
832
835
|
}, g = function() {
|
|
833
836
|
return `
|
|
@@ -868,10 +871,10 @@ function Rt(e) {
|
|
|
868
871
|
/* @__PURE__ */ R(
|
|
869
872
|
"div",
|
|
870
873
|
{
|
|
871
|
-
className:
|
|
874
|
+
className: At((b = e.builderBlock) == null ? void 0 : b.id) + " div-eeca3604",
|
|
872
875
|
style: h(),
|
|
873
876
|
children: [
|
|
874
|
-
/* @__PURE__ */ l(
|
|
877
|
+
/* @__PURE__ */ l($, { id: "builderio-columns", styles: g() }),
|
|
875
878
|
(E = e.columns) == null ? void 0 : E.map((m, p) => /* @__PURE__ */ l(
|
|
876
879
|
_e,
|
|
877
880
|
{
|
|
@@ -907,11 +910,11 @@ function Rt(e) {
|
|
|
907
910
|
function ee(e) {
|
|
908
911
|
return e.replace(/http(s)?:/, "");
|
|
909
912
|
}
|
|
910
|
-
function
|
|
913
|
+
function Bt(e = "", t, n) {
|
|
911
914
|
const o = new RegExp("([?&])" + t + "=.*?(&|$)", "i"), i = e.indexOf("?") !== -1 ? "&" : "?";
|
|
912
915
|
return e.match(o) ? e.replace(o, "$1" + t + "=" + encodeURIComponent(n) + "$2") : e + i + t + "=" + encodeURIComponent(n);
|
|
913
916
|
}
|
|
914
|
-
function
|
|
917
|
+
function Vt(e, t) {
|
|
915
918
|
if (!e || !(e != null && e.match(/cdn\.shopify\.com/)) || !t)
|
|
916
919
|
return e;
|
|
917
920
|
if (t === "master")
|
|
@@ -923,18 +926,18 @@ function Pt(e, t) {
|
|
|
923
926
|
}
|
|
924
927
|
return null;
|
|
925
928
|
}
|
|
926
|
-
function
|
|
929
|
+
function yo(e) {
|
|
927
930
|
if (!e)
|
|
928
931
|
return e;
|
|
929
932
|
const t = [100, 200, 400, 800, 1200, 1600, 2e3];
|
|
930
933
|
if (e.match(/builder\.io/)) {
|
|
931
934
|
let n = e;
|
|
932
935
|
const o = Number(e.split("?width=")[1]);
|
|
933
|
-
return isNaN(o) || (n = `${n} ${o}w`), t.filter((i) => i !== o).map((i) => `${
|
|
936
|
+
return isNaN(o) || (n = `${n} ${o}w`), t.filter((i) => i !== o).map((i) => `${Bt(e, "width", i)} ${i}w`).concat([n]).join(", ");
|
|
934
937
|
}
|
|
935
|
-
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [
|
|
938
|
+
return e.match(/cdn\.shopify\.com/) ? t.map((n) => [Vt(e, `${n}x${n}`), n]).filter(([n]) => !!n).map(([n, o]) => `${n} ${o}w`).concat([e]).join(", ") : e;
|
|
936
939
|
}
|
|
937
|
-
const
|
|
940
|
+
const Wt = (e) => {
|
|
938
941
|
if (e === "localhost" || e === "127.0.0.1")
|
|
939
942
|
return e;
|
|
940
943
|
const t = e.split(".");
|
|
@@ -947,17 +950,17 @@ const Vt = (e) => {
|
|
|
947
950
|
try {
|
|
948
951
|
return t ? (n = document.cookie.split("; ").find((o) => o.startsWith(`${e}=`))) == null ? void 0 : n.split("=")[1] : void 0;
|
|
949
952
|
} catch (o) {
|
|
950
|
-
|
|
953
|
+
I.warn("[COOKIE] GET error: ", (o == null ? void 0 : o.message) || o);
|
|
951
954
|
return;
|
|
952
955
|
}
|
|
953
|
-
}, ke = async (e) => ve(e),
|
|
956
|
+
}, ke = async (e) => ve(e), Nt = (e) => e.map(([t, n]) => n ? `${t}=${n}` : t).filter(T).join("; "), Ot = [["secure", ""], ["SameSite", "None"]], $t = ({
|
|
954
957
|
name: e,
|
|
955
958
|
value: t,
|
|
956
959
|
expires: n
|
|
957
960
|
}) => {
|
|
958
|
-
const i = (k() ? location.protocol === "https:" : !0) ?
|
|
959
|
-
return
|
|
960
|
-
},
|
|
961
|
+
const i = (k() ? location.protocol === "https:" : !0) ? Ot : [[]], r = n ? [["expires", n.toUTCString()]] : [[]], a = [[e, t], ...r, ["path", "/"], ["domain", Wt(window.location.hostname)], ...i];
|
|
962
|
+
return Nt(a);
|
|
963
|
+
}, xe = async ({
|
|
961
964
|
name: e,
|
|
962
965
|
value: t,
|
|
963
966
|
expires: n,
|
|
@@ -966,33 +969,33 @@ const Vt = (e) => {
|
|
|
966
969
|
try {
|
|
967
970
|
if (!o)
|
|
968
971
|
return;
|
|
969
|
-
const i =
|
|
972
|
+
const i = $t({
|
|
970
973
|
name: e,
|
|
971
974
|
value: t,
|
|
972
975
|
expires: n
|
|
973
976
|
});
|
|
974
977
|
document.cookie = i;
|
|
975
978
|
} catch (i) {
|
|
976
|
-
|
|
979
|
+
I.warn("[COOKIE] SET error: ", (i == null ? void 0 : i.message) || i);
|
|
977
980
|
}
|
|
978
|
-
},
|
|
981
|
+
}, Ft = "builder.tests", q = (e) => `${Ft}.${e}`, Lt = ({
|
|
979
982
|
contentId: e
|
|
980
983
|
}) => ke({
|
|
981
984
|
name: q(e),
|
|
982
985
|
canTrack: !0
|
|
983
|
-
}),
|
|
986
|
+
}), Ut = ({
|
|
984
987
|
contentId: e
|
|
985
988
|
}) => ve({
|
|
986
989
|
name: q(e),
|
|
987
990
|
canTrack: !0
|
|
988
|
-
}),
|
|
991
|
+
}), Dt = ({
|
|
989
992
|
contentId: e,
|
|
990
993
|
value: t
|
|
991
|
-
}) =>
|
|
994
|
+
}) => xe({
|
|
992
995
|
name: q(e),
|
|
993
996
|
value: t,
|
|
994
997
|
canTrack: !0
|
|
995
|
-
}),
|
|
998
|
+
}), Ce = (e) => T(e.id) && T(e.variations) && Object.keys(e.variations).length > 0, _t = ({
|
|
996
999
|
id: e,
|
|
997
1000
|
variations: t
|
|
998
1001
|
}) => {
|
|
@@ -1006,12 +1009,12 @@ const Vt = (e) => {
|
|
|
1006
1009
|
}
|
|
1007
1010
|
return e;
|
|
1008
1011
|
}, we = (e) => {
|
|
1009
|
-
const t =
|
|
1010
|
-
return
|
|
1012
|
+
const t = _t(e);
|
|
1013
|
+
return Dt({
|
|
1011
1014
|
contentId: e.id,
|
|
1012
1015
|
value: t
|
|
1013
1016
|
}).catch((n) => {
|
|
1014
|
-
|
|
1017
|
+
I.error("could not store A/B test variation: ", n);
|
|
1015
1018
|
}), t;
|
|
1016
1019
|
}, Ie = ({
|
|
1017
1020
|
item: e,
|
|
@@ -1027,7 +1030,7 @@ const Vt = (e) => {
|
|
|
1027
1030
|
testVariationId: n.id,
|
|
1028
1031
|
testVariationName: n.name || (n.id === e.id ? "Default" : "")
|
|
1029
1032
|
};
|
|
1030
|
-
},
|
|
1033
|
+
}, Mt = ({
|
|
1031
1034
|
item: e,
|
|
1032
1035
|
canTrack: t
|
|
1033
1036
|
}) => {
|
|
@@ -1035,9 +1038,9 @@ const Vt = (e) => {
|
|
|
1035
1038
|
return e;
|
|
1036
1039
|
if (!e)
|
|
1037
1040
|
return;
|
|
1038
|
-
if (!
|
|
1041
|
+
if (!Ce(e))
|
|
1039
1042
|
return e;
|
|
1040
|
-
const n =
|
|
1043
|
+
const n = Ut({
|
|
1041
1044
|
contentId: e.id
|
|
1042
1045
|
}) || we({
|
|
1043
1046
|
variations: e.variations,
|
|
@@ -1050,13 +1053,13 @@ const Vt = (e) => {
|
|
|
1050
1053
|
...e,
|
|
1051
1054
|
...o
|
|
1052
1055
|
};
|
|
1053
|
-
},
|
|
1056
|
+
}, jt = async ({
|
|
1054
1057
|
item: e,
|
|
1055
1058
|
canTrack: t
|
|
1056
1059
|
}) => {
|
|
1057
|
-
if (!t || !
|
|
1060
|
+
if (!t || !Ce(e))
|
|
1058
1061
|
return e;
|
|
1059
|
-
const o = await
|
|
1062
|
+
const o = await Lt({
|
|
1060
1063
|
contentId: e.id
|
|
1061
1064
|
}) || we({
|
|
1062
1065
|
variations: e.variations,
|
|
@@ -1069,7 +1072,7 @@ const Vt = (e) => {
|
|
|
1069
1072
|
...e,
|
|
1070
1073
|
...i
|
|
1071
1074
|
};
|
|
1072
|
-
}, L = (e) =>
|
|
1075
|
+
}, L = (e) => T(e) ? e : !0, Ht = {
|
|
1073
1076
|
name: "Core:Button",
|
|
1074
1077
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
1075
1078
|
defaultStyles: {
|
|
@@ -1102,7 +1105,7 @@ const Vt = (e) => {
|
|
|
1102
1105
|
}],
|
|
1103
1106
|
static: !0,
|
|
1104
1107
|
noWrap: !0
|
|
1105
|
-
},
|
|
1108
|
+
}, Kt = {
|
|
1106
1109
|
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
1107
1110
|
name: "Columns",
|
|
1108
1111
|
isRSC: !0,
|
|
@@ -1303,13 +1306,13 @@ const Vt = (e) => {
|
|
|
1303
1306
|
helperText: "When stacking columns for mobile devices, reverse the ordering",
|
|
1304
1307
|
advanced: !0
|
|
1305
1308
|
}]
|
|
1306
|
-
},
|
|
1309
|
+
}, zt = {
|
|
1307
1310
|
name: "Fragment",
|
|
1308
1311
|
static: !0,
|
|
1309
1312
|
hidden: !0,
|
|
1310
1313
|
canHaveChildren: !0,
|
|
1311
1314
|
noWrap: !0
|
|
1312
|
-
},
|
|
1315
|
+
}, qt = {
|
|
1313
1316
|
name: "Image",
|
|
1314
1317
|
static: !0,
|
|
1315
1318
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
@@ -1402,6 +1405,11 @@ const Vt = (e) => {
|
|
|
1402
1405
|
type: "boolean",
|
|
1403
1406
|
helperText: "When child blocks are provided, fit to them instead of using the image's aspect ratio",
|
|
1404
1407
|
defaultValue: !0
|
|
1408
|
+
}, {
|
|
1409
|
+
name: "highPriority",
|
|
1410
|
+
type: "boolean",
|
|
1411
|
+
advanced: !0,
|
|
1412
|
+
helperText: "Mark this image as high priority compared to other images on the page. This prevents lazy loading of the image and tells the browser to load this image before others on the page."
|
|
1405
1413
|
}, {
|
|
1406
1414
|
name: "aspectRatio",
|
|
1407
1415
|
type: "number",
|
|
@@ -1409,7 +1417,7 @@ const Vt = (e) => {
|
|
|
1409
1417
|
advanced: !0,
|
|
1410
1418
|
defaultValue: 0.7041
|
|
1411
1419
|
}]
|
|
1412
|
-
},
|
|
1420
|
+
}, Yt = {
|
|
1413
1421
|
name: "Core:Section",
|
|
1414
1422
|
static: !0,
|
|
1415
1423
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F682efef23ace49afac61748dd305c70a",
|
|
@@ -1448,7 +1456,7 @@ const Vt = (e) => {
|
|
|
1448
1456
|
}
|
|
1449
1457
|
}
|
|
1450
1458
|
}]
|
|
1451
|
-
},
|
|
1459
|
+
}, Gt = {
|
|
1452
1460
|
name: "Slot",
|
|
1453
1461
|
isRSC: !0,
|
|
1454
1462
|
description: "Allow child blocks to be inserted into this content when used as a Symbol",
|
|
@@ -1462,7 +1470,7 @@ const Vt = (e) => {
|
|
|
1462
1470
|
defaultValue: "children"
|
|
1463
1471
|
}]
|
|
1464
1472
|
};
|
|
1465
|
-
function
|
|
1473
|
+
function Jt(e) {
|
|
1466
1474
|
var t, n, o;
|
|
1467
1475
|
return /* @__PURE__ */ l(
|
|
1468
1476
|
"div",
|
|
@@ -1485,7 +1493,7 @@ function Yt(e) {
|
|
|
1485
1493
|
}
|
|
1486
1494
|
);
|
|
1487
1495
|
}
|
|
1488
|
-
const
|
|
1496
|
+
const Qt = {
|
|
1489
1497
|
name: "Symbol",
|
|
1490
1498
|
noWrap: !0,
|
|
1491
1499
|
static: !0,
|
|
@@ -1518,7 +1526,7 @@ const Gt = {
|
|
|
1518
1526
|
hideFromUI: !0,
|
|
1519
1527
|
type: "boolean"
|
|
1520
1528
|
}]
|
|
1521
|
-
},
|
|
1529
|
+
}, Xt = {
|
|
1522
1530
|
name: "Text",
|
|
1523
1531
|
static: !0,
|
|
1524
1532
|
isRSC: !0,
|
|
@@ -1537,7 +1545,7 @@ const Gt = {
|
|
|
1537
1545
|
textAlign: "center"
|
|
1538
1546
|
}
|
|
1539
1547
|
};
|
|
1540
|
-
function
|
|
1548
|
+
function Zt(e) {
|
|
1541
1549
|
var t;
|
|
1542
1550
|
return /* @__PURE__ */ l(
|
|
1543
1551
|
"div",
|
|
@@ -1550,7 +1558,7 @@ function Qt(e) {
|
|
|
1550
1558
|
}
|
|
1551
1559
|
);
|
|
1552
1560
|
}
|
|
1553
|
-
const
|
|
1561
|
+
const en = {
|
|
1554
1562
|
name: "Custom Code",
|
|
1555
1563
|
static: !0,
|
|
1556
1564
|
requiredPermissions: ["editCode"],
|
|
@@ -1572,7 +1580,7 @@ const Xt = {
|
|
|
1572
1580
|
helperText: "Only print and run scripts on the client. Important when scripts influence DOM that could be replaced when client loads",
|
|
1573
1581
|
advanced: !0
|
|
1574
1582
|
}]
|
|
1575
|
-
},
|
|
1583
|
+
}, tn = {
|
|
1576
1584
|
name: "Embed",
|
|
1577
1585
|
static: !0,
|
|
1578
1586
|
inputs: [{
|
|
@@ -1597,7 +1605,7 @@ const Xt = {
|
|
|
1597
1605
|
defaultValue: '<div style="padding: 20px; text-align: center">(Choose an embed URL)<div>',
|
|
1598
1606
|
hideFromUI: !0
|
|
1599
1607
|
}]
|
|
1600
|
-
},
|
|
1608
|
+
}, nn = ["text/javascript", "application/javascript", "application/ecmascript"], So = (e) => nn.includes(e.type), on = {
|
|
1601
1609
|
// friendlyName?
|
|
1602
1610
|
name: "Raw:Img",
|
|
1603
1611
|
hideFromInsertMenu: !0,
|
|
@@ -1611,7 +1619,7 @@ const Xt = {
|
|
|
1611
1619
|
}],
|
|
1612
1620
|
noWrap: !0,
|
|
1613
1621
|
static: !0
|
|
1614
|
-
},
|
|
1622
|
+
}, rn = {
|
|
1615
1623
|
name: "Video",
|
|
1616
1624
|
canHaveChildren: !0,
|
|
1617
1625
|
defaultStyles: {
|
|
@@ -1692,58 +1700,58 @@ const Xt = {
|
|
|
1692
1700
|
defaultValue: !0,
|
|
1693
1701
|
advanced: !0
|
|
1694
1702
|
}]
|
|
1695
|
-
},
|
|
1703
|
+
}, an = () => [{
|
|
1696
1704
|
component: Me,
|
|
1697
|
-
...
|
|
1705
|
+
...en
|
|
1698
1706
|
}, {
|
|
1699
1707
|
component: je,
|
|
1700
|
-
...
|
|
1708
|
+
...tn
|
|
1701
1709
|
}, {
|
|
1702
1710
|
component: He,
|
|
1703
|
-
...
|
|
1711
|
+
...on
|
|
1704
1712
|
}, {
|
|
1705
1713
|
component: Ke,
|
|
1706
|
-
...
|
|
1714
|
+
...rn
|
|
1707
1715
|
}], te = () => [{
|
|
1708
1716
|
component: ze,
|
|
1709
|
-
...Mt
|
|
1710
|
-
}, {
|
|
1711
|
-
component: Rt,
|
|
1712
|
-
...jt
|
|
1713
|
-
}, {
|
|
1714
|
-
component: qe,
|
|
1715
1717
|
...Ht
|
|
1716
1718
|
}, {
|
|
1717
|
-
component:
|
|
1719
|
+
component: Pt,
|
|
1718
1720
|
...Kt
|
|
1719
1721
|
}, {
|
|
1720
|
-
component:
|
|
1722
|
+
component: qe,
|
|
1721
1723
|
...zt
|
|
1722
1724
|
}, {
|
|
1723
|
-
component:
|
|
1725
|
+
component: Ye,
|
|
1724
1726
|
...qt
|
|
1725
1727
|
}, {
|
|
1726
|
-
component:
|
|
1728
|
+
component: Ge,
|
|
1729
|
+
...Yt
|
|
1730
|
+
}, {
|
|
1731
|
+
component: Jt,
|
|
1727
1732
|
...Gt
|
|
1728
1733
|
}, {
|
|
1729
|
-
component:
|
|
1730
|
-
...
|
|
1731
|
-
},
|
|
1734
|
+
component: so,
|
|
1735
|
+
...Qt
|
|
1736
|
+
}, {
|
|
1737
|
+
component: Zt,
|
|
1738
|
+
...Xt
|
|
1739
|
+
}, ...an()], vo = (e) => ({
|
|
1732
1740
|
type: "builder.registerComponent",
|
|
1733
1741
|
data: U(e)
|
|
1734
|
-
}),
|
|
1742
|
+
}), sn = (e) => {
|
|
1735
1743
|
const t = e.toString().trim();
|
|
1736
1744
|
return `return (${!t.startsWith("function") && !t.startsWith("(") ? "function " : ""}${t}).apply(this, arguments)`;
|
|
1737
|
-
},
|
|
1745
|
+
}, cn = (e) => typeof e == "function" ? sn(e) : O(e), U = ({
|
|
1738
1746
|
inputs: e,
|
|
1739
1747
|
...t
|
|
1740
1748
|
}) => ({
|
|
1741
|
-
|
|
1749
|
+
...O(t),
|
|
1742
1750
|
inputs: e == null ? void 0 : e.map((n) => Object.entries(n).reduce((o, [i, r]) => ({
|
|
1743
1751
|
...o,
|
|
1744
|
-
[i]:
|
|
1752
|
+
[i]: cn(r)
|
|
1745
1753
|
}), {}))
|
|
1746
|
-
}),
|
|
1754
|
+
}), ln = `function updateCookiesAndStyles(contentId, variants, isHydrationTarget) {
|
|
1747
1755
|
function getAndSetVariantId() {
|
|
1748
1756
|
function setCookie(name, value, days) {
|
|
1749
1757
|
let expires = '';
|
|
@@ -1799,7 +1807,7 @@ const Xt = {
|
|
|
1799
1807
|
}).join('');
|
|
1800
1808
|
styleEl.innerHTML = newStyleStr;
|
|
1801
1809
|
}
|
|
1802
|
-
}`,
|
|
1810
|
+
}`, dn = `function updateVariantVisibility(variantContentId, defaultContentId, isHydrationTarget) {
|
|
1803
1811
|
if (!navigator.cookieEnabled) {
|
|
1804
1812
|
return;
|
|
1805
1813
|
}
|
|
@@ -1837,16 +1845,16 @@ const Xt = {
|
|
|
1837
1845
|
...t,
|
|
1838
1846
|
testVariationId: t.id,
|
|
1839
1847
|
id: e == null ? void 0 : e.id
|
|
1840
|
-
})),
|
|
1848
|
+
})), un = ({
|
|
1841
1849
|
canTrack: e,
|
|
1842
1850
|
content: t
|
|
1843
|
-
}) => !(!(W(t).length > 0) || !e || k()),
|
|
1844
|
-
window.${Te} = ${
|
|
1845
|
-
window.${Ee} = ${
|
|
1846
|
-
`,
|
|
1851
|
+
}) => !(!(W(t).length > 0) || !e || k()), mn = (e) => e === "react" || e === "reactNative", Re = mn(x), fn = () => `
|
|
1852
|
+
window.${Te} = ${ln}
|
|
1853
|
+
window.${Ee} = ${dn}
|
|
1854
|
+
`, hn = (e, t) => `
|
|
1847
1855
|
window.${Te}(
|
|
1848
1856
|
"${t}",${JSON.stringify(e)}, ${Re}
|
|
1849
|
-
)`,
|
|
1857
|
+
)`, pn = ({
|
|
1850
1858
|
contentId: e,
|
|
1851
1859
|
variationId: t
|
|
1852
1860
|
}) => `window.${Ee}(
|
|
@@ -1861,33 +1869,33 @@ function D(e) {
|
|
|
1861
1869
|
}
|
|
1862
1870
|
);
|
|
1863
1871
|
}
|
|
1864
|
-
const
|
|
1872
|
+
const gn = (e) => {
|
|
1865
1873
|
const t = e.get("preview"), n = e.get("overrides." + t);
|
|
1866
|
-
return n ||
|
|
1874
|
+
return n || I.warn("No previewed ID found in search params."), n;
|
|
1867
1875
|
};
|
|
1868
|
-
function
|
|
1876
|
+
function bn() {
|
|
1869
1877
|
globalThis._BUILDER_PREVIEW_LRU_CACHE || (globalThis._BUILDER_PREVIEW_LRU_CACHE = new Fe({
|
|
1870
1878
|
max: 500,
|
|
1871
1879
|
// how long to live in ms
|
|
1872
1880
|
ttl: 1e3 * 60 * 5
|
|
1873
1881
|
}));
|
|
1874
1882
|
}
|
|
1875
|
-
function
|
|
1876
|
-
|
|
1877
|
-
const t =
|
|
1883
|
+
function yn(e) {
|
|
1884
|
+
bn();
|
|
1885
|
+
const t = gn(e);
|
|
1878
1886
|
return typeof t == "string" ? globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t) : void 0;
|
|
1879
1887
|
}
|
|
1880
|
-
function
|
|
1888
|
+
function Sn() {
|
|
1881
1889
|
return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : globalThis;
|
|
1882
1890
|
}
|
|
1883
|
-
function
|
|
1884
|
-
const e =
|
|
1891
|
+
function vn() {
|
|
1892
|
+
const e = Sn().fetch;
|
|
1885
1893
|
if (typeof e > "u")
|
|
1886
1894
|
throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
1887
1895
|
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`), new Error("Builder SDK could not find a global `fetch` function");
|
|
1888
1896
|
return e;
|
|
1889
1897
|
}
|
|
1890
|
-
const
|
|
1898
|
+
const kn = vn();
|
|
1891
1899
|
function _(e, t = null, n = ".") {
|
|
1892
1900
|
return Object.keys(e).reduce((o, i) => {
|
|
1893
1901
|
const r = e[i], a = [t, i].filter(Boolean).join(n);
|
|
@@ -1907,17 +1915,17 @@ function Ae(e, t, n = {}) {
|
|
|
1907
1915
|
}
|
|
1908
1916
|
return n;
|
|
1909
1917
|
}
|
|
1910
|
-
const
|
|
1918
|
+
const xn = "v3", ne = "builder.", Cn = "options.", Pe = (e) => {
|
|
1911
1919
|
if (!e)
|
|
1912
1920
|
return {};
|
|
1913
1921
|
const t = ue(e), n = {};
|
|
1914
1922
|
return Object.keys(t).forEach((o) => {
|
|
1915
1923
|
if (o.startsWith(ne)) {
|
|
1916
|
-
const i = o.replace(ne, "").replace(
|
|
1924
|
+
const i = o.replace(ne, "").replace(Cn, "");
|
|
1917
1925
|
n[i] = t[o];
|
|
1918
1926
|
}
|
|
1919
1927
|
}), n;
|
|
1920
|
-
},
|
|
1928
|
+
}, wn = () => {
|
|
1921
1929
|
if (!k())
|
|
1922
1930
|
return {};
|
|
1923
1931
|
const e = new URLSearchParams(window.location.search);
|
|
@@ -1931,7 +1939,7 @@ const vn = "v3", ne = "builder.", kn = "options.", Pe = (e) => {
|
|
|
1931
1939
|
apiKey: r,
|
|
1932
1940
|
enrich: a,
|
|
1933
1941
|
locale: s,
|
|
1934
|
-
apiVersion: c =
|
|
1942
|
+
apiVersion: c = xn,
|
|
1935
1943
|
fields: u,
|
|
1936
1944
|
omit: h,
|
|
1937
1945
|
offset: d,
|
|
@@ -1949,11 +1957,11 @@ const vn = "v3", ne = "builder.", kn = "options.", Pe = (e) => {
|
|
|
1949
1957
|
const S = _({
|
|
1950
1958
|
sort: v
|
|
1951
1959
|
});
|
|
1952
|
-
for (const
|
|
1953
|
-
m.searchParams.set(
|
|
1960
|
+
for (const w in S)
|
|
1961
|
+
m.searchParams.set(w, JSON.stringify(S[w]));
|
|
1954
1962
|
}
|
|
1955
1963
|
const p = {
|
|
1956
|
-
...
|
|
1964
|
+
...wn(),
|
|
1957
1965
|
...ue(e.options || {})
|
|
1958
1966
|
}, y = _(p);
|
|
1959
1967
|
for (const S in y)
|
|
@@ -1962,72 +1970,72 @@ const vn = "v3", ne = "builder.", kn = "options.", Pe = (e) => {
|
|
|
1962
1970
|
const S = Ae({
|
|
1963
1971
|
query: o
|
|
1964
1972
|
});
|
|
1965
|
-
for (const
|
|
1966
|
-
m.searchParams.set(
|
|
1973
|
+
for (const w in S)
|
|
1974
|
+
m.searchParams.set(w, JSON.stringify(S[w]));
|
|
1967
1975
|
}
|
|
1968
1976
|
return m;
|
|
1969
|
-
},
|
|
1970
|
-
async function
|
|
1971
|
-
const t = await
|
|
1977
|
+
}, In = (e) => "results" in e;
|
|
1978
|
+
async function Be(e) {
|
|
1979
|
+
const t = await Rn({
|
|
1972
1980
|
...e,
|
|
1973
1981
|
limit: 1
|
|
1974
1982
|
});
|
|
1975
1983
|
return t && t[0] || null;
|
|
1976
1984
|
}
|
|
1977
|
-
const
|
|
1985
|
+
const Tn = async (e) => {
|
|
1978
1986
|
const t = Y(e);
|
|
1979
|
-
return await (await (e.fetch ??
|
|
1980
|
-
},
|
|
1987
|
+
return await (await (e.fetch ?? kn)(t.href, e.fetchOptions)).json();
|
|
1988
|
+
}, En = async (e, t, n = Y(e)) => {
|
|
1981
1989
|
const o = L(e.canTrack);
|
|
1982
1990
|
if (n.search.includes("preview=")) {
|
|
1983
1991
|
const r = [];
|
|
1984
1992
|
for (const a of t.results) {
|
|
1985
|
-
const s =
|
|
1993
|
+
const s = yn(n.searchParams);
|
|
1986
1994
|
r.push(s || a);
|
|
1987
1995
|
}
|
|
1988
1996
|
t.results = r;
|
|
1989
1997
|
}
|
|
1990
|
-
if (!o || !(k() ||
|
|
1998
|
+
if (!o || !(k() || x === "reactNative"))
|
|
1991
1999
|
return t.results;
|
|
1992
2000
|
try {
|
|
1993
2001
|
const r = [];
|
|
1994
2002
|
for (const a of t.results)
|
|
1995
|
-
r.push(await
|
|
2003
|
+
r.push(await jt({
|
|
1996
2004
|
item: a,
|
|
1997
2005
|
canTrack: o
|
|
1998
2006
|
}));
|
|
1999
2007
|
t.results = r;
|
|
2000
2008
|
} catch (r) {
|
|
2001
|
-
|
|
2009
|
+
I.error("Could not process A/B tests. ", r);
|
|
2002
2010
|
}
|
|
2003
2011
|
return t.results;
|
|
2004
2012
|
};
|
|
2005
|
-
async function
|
|
2013
|
+
async function Rn(e) {
|
|
2006
2014
|
try {
|
|
2007
|
-
const t = Y(e), n = await
|
|
2008
|
-
return
|
|
2015
|
+
const t = Y(e), n = await Tn(e);
|
|
2016
|
+
return In(n) ? En(e, n) : (I.error("Error fetching data. ", {
|
|
2009
2017
|
url: t,
|
|
2010
2018
|
content: n,
|
|
2011
2019
|
options: e
|
|
2012
2020
|
}), null);
|
|
2013
2021
|
} catch (t) {
|
|
2014
|
-
return
|
|
2022
|
+
return I.error("Error fetching data. ", t), null;
|
|
2015
2023
|
}
|
|
2016
2024
|
}
|
|
2017
|
-
function
|
|
2025
|
+
function ko(e) {
|
|
2018
2026
|
const t = e || (k() ? window.location.search : void 0);
|
|
2019
2027
|
return t ? me(t).indexOf("builder.preview=") !== -1 : !1;
|
|
2020
2028
|
}
|
|
2021
|
-
function
|
|
2029
|
+
function An() {
|
|
2022
2030
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
2023
2031
|
const t = Math.random() * 16 | 0;
|
|
2024
2032
|
return (e == "x" ? t : t & 3 | 8).toString(16);
|
|
2025
2033
|
});
|
|
2026
2034
|
}
|
|
2027
|
-
function
|
|
2028
|
-
return
|
|
2035
|
+
function Ve() {
|
|
2036
|
+
return An().replace(/-/g, "");
|
|
2029
2037
|
}
|
|
2030
|
-
const We = "builderSessionId",
|
|
2038
|
+
const We = "builderSessionId", Pn = async ({
|
|
2031
2039
|
canTrack: e
|
|
2032
2040
|
}) => {
|
|
2033
2041
|
if (!e)
|
|
@@ -2036,70 +2044,70 @@ const We = "builderSessionId", Rn = async ({
|
|
|
2036
2044
|
name: We,
|
|
2037
2045
|
canTrack: e
|
|
2038
2046
|
});
|
|
2039
|
-
if (
|
|
2047
|
+
if (T(t))
|
|
2040
2048
|
return t;
|
|
2041
2049
|
{
|
|
2042
|
-
const n =
|
|
2043
|
-
return
|
|
2050
|
+
const n = Bn();
|
|
2051
|
+
return Vn({
|
|
2044
2052
|
id: n,
|
|
2045
2053
|
canTrack: e
|
|
2046
2054
|
}), n;
|
|
2047
2055
|
}
|
|
2048
|
-
},
|
|
2056
|
+
}, Bn = () => Ve(), Vn = ({
|
|
2049
2057
|
id: e,
|
|
2050
2058
|
canTrack: t
|
|
2051
|
-
}) =>
|
|
2059
|
+
}) => xe({
|
|
2052
2060
|
name: We,
|
|
2053
2061
|
value: e,
|
|
2054
2062
|
canTrack: t
|
|
2055
|
-
}),
|
|
2063
|
+
}), Ne = () => k() && typeof localStorage < "u" ? localStorage : void 0, Wn = ({
|
|
2056
2064
|
key: e,
|
|
2057
2065
|
canTrack: t
|
|
2058
2066
|
}) => {
|
|
2059
2067
|
var n;
|
|
2060
2068
|
try {
|
|
2061
|
-
return t ? (n =
|
|
2069
|
+
return t ? (n = Ne()) == null ? void 0 : n.getItem(e) : void 0;
|
|
2062
2070
|
} catch (o) {
|
|
2063
2071
|
console.debug("[LocalStorage] GET error: ", o);
|
|
2064
2072
|
return;
|
|
2065
2073
|
}
|
|
2066
|
-
},
|
|
2074
|
+
}, Nn = ({
|
|
2067
2075
|
key: e,
|
|
2068
2076
|
canTrack: t,
|
|
2069
2077
|
value: n
|
|
2070
2078
|
}) => {
|
|
2071
2079
|
var o;
|
|
2072
2080
|
try {
|
|
2073
|
-
t && ((o =
|
|
2081
|
+
t && ((o = Ne()) == null || o.setItem(e, n));
|
|
2074
2082
|
} catch (i) {
|
|
2075
2083
|
console.debug("[LocalStorage] SET error: ", i);
|
|
2076
2084
|
}
|
|
2077
|
-
},
|
|
2085
|
+
}, Oe = "builderVisitorId", On = ({
|
|
2078
2086
|
canTrack: e
|
|
2079
2087
|
}) => {
|
|
2080
2088
|
if (!e)
|
|
2081
2089
|
return;
|
|
2082
|
-
const t =
|
|
2083
|
-
key:
|
|
2090
|
+
const t = Wn({
|
|
2091
|
+
key: Oe,
|
|
2084
2092
|
canTrack: e
|
|
2085
2093
|
});
|
|
2086
|
-
if (
|
|
2094
|
+
if (T(t))
|
|
2087
2095
|
return t;
|
|
2088
2096
|
{
|
|
2089
|
-
const n =
|
|
2090
|
-
return
|
|
2097
|
+
const n = $n();
|
|
2098
|
+
return Fn({
|
|
2091
2099
|
id: n,
|
|
2092
2100
|
canTrack: e
|
|
2093
2101
|
}), n;
|
|
2094
2102
|
}
|
|
2095
|
-
},
|
|
2103
|
+
}, $n = () => Ve(), Fn = ({
|
|
2096
2104
|
id: e,
|
|
2097
2105
|
canTrack: t
|
|
2098
|
-
}) =>
|
|
2099
|
-
key:
|
|
2106
|
+
}) => Nn({
|
|
2107
|
+
key: Oe,
|
|
2100
2108
|
value: e,
|
|
2101
2109
|
canTrack: t
|
|
2102
|
-
}),
|
|
2110
|
+
}), Ln = async ({
|
|
2103
2111
|
canTrack: e
|
|
2104
2112
|
}) => {
|
|
2105
2113
|
if (!e)
|
|
@@ -2107,16 +2115,16 @@ const We = "builderSessionId", Rn = async ({
|
|
|
2107
2115
|
visitorId: void 0,
|
|
2108
2116
|
sessionId: void 0
|
|
2109
2117
|
};
|
|
2110
|
-
const t = await
|
|
2118
|
+
const t = await Pn({
|
|
2111
2119
|
canTrack: e
|
|
2112
|
-
}), n =
|
|
2120
|
+
}), n = On({
|
|
2113
2121
|
canTrack: e
|
|
2114
2122
|
});
|
|
2115
2123
|
return {
|
|
2116
2124
|
sessionId: t,
|
|
2117
2125
|
visitorId: n
|
|
2118
2126
|
};
|
|
2119
|
-
},
|
|
2127
|
+
}, Un = async ({
|
|
2120
2128
|
type: e,
|
|
2121
2129
|
canTrack: t,
|
|
2122
2130
|
apiKey: n,
|
|
@@ -2130,23 +2138,23 @@ const We = "builderSessionId", Rn = async ({
|
|
|
2130
2138
|
url: location.href,
|
|
2131
2139
|
...o
|
|
2132
2140
|
},
|
|
2133
|
-
...await
|
|
2141
|
+
...await Ln({
|
|
2134
2142
|
canTrack: t
|
|
2135
2143
|
}),
|
|
2136
2144
|
userAttributes: he(),
|
|
2137
2145
|
ownerId: n
|
|
2138
2146
|
}
|
|
2139
2147
|
});
|
|
2140
|
-
async function
|
|
2148
|
+
async function Dn(e) {
|
|
2141
2149
|
if (!e.apiKey) {
|
|
2142
|
-
|
|
2150
|
+
I.error("Missing API key for track call. Please provide your API key.");
|
|
2143
2151
|
return;
|
|
2144
2152
|
}
|
|
2145
|
-
if (e.canTrack && !fe() && (k() ||
|
|
2153
|
+
if (e.canTrack && !fe() && (k() || x === "reactNative"))
|
|
2146
2154
|
return fetch("https://cdn.builder.io/api/v1/track", {
|
|
2147
2155
|
method: "POST",
|
|
2148
2156
|
body: JSON.stringify({
|
|
2149
|
-
events: [await
|
|
2157
|
+
events: [await Un(e)]
|
|
2150
2158
|
}),
|
|
2151
2159
|
headers: {
|
|
2152
2160
|
"content-type": "application/json"
|
|
@@ -2156,14 +2164,14 @@ async function Ln(e) {
|
|
|
2156
2164
|
console.error("Failed to track: ", t);
|
|
2157
2165
|
});
|
|
2158
2166
|
}
|
|
2159
|
-
const
|
|
2167
|
+
const xo = (e) => Dn({
|
|
2160
2168
|
...e,
|
|
2161
2169
|
canTrack: !0
|
|
2162
2170
|
});
|
|
2163
2171
|
function ie(e) {
|
|
2164
2172
|
return Math.round(e * 1e3) / 1e3;
|
|
2165
2173
|
}
|
|
2166
|
-
const
|
|
2174
|
+
const _n = (e, t, n = !0) => {
|
|
2167
2175
|
if (!(e instanceof HTMLElement))
|
|
2168
2176
|
return null;
|
|
2169
2177
|
let o = n ? e : e.parentElement;
|
|
@@ -2174,7 +2182,7 @@ const Un = (e, t, n = !0) => {
|
|
|
2174
2182
|
return o;
|
|
2175
2183
|
} while (o = o.parentElement);
|
|
2176
2184
|
return null;
|
|
2177
|
-
},
|
|
2185
|
+
}, Mn = (e) => _n(e, (t) => {
|
|
2178
2186
|
const n = t.getAttribute("builder-id") || t.id;
|
|
2179
2187
|
return (n == null ? void 0 : n.indexOf("builder-")) === 0;
|
|
2180
2188
|
}), re = ({
|
|
@@ -2186,8 +2194,8 @@ const Un = (e, t, n = !0) => {
|
|
|
2186
2194
|
x: r,
|
|
2187
2195
|
y: a
|
|
2188
2196
|
};
|
|
2189
|
-
},
|
|
2190
|
-
const t = e.target, n = t &&
|
|
2197
|
+
}, Co = (e) => {
|
|
2198
|
+
const t = e.target, n = t && Mn(t), o = (n == null ? void 0 : n.getAttribute("builder-id")) || (n == null ? void 0 : n.id);
|
|
2191
2199
|
return {
|
|
2192
2200
|
targetBuilderElement: o || void 0,
|
|
2193
2201
|
metadata: {
|
|
@@ -2202,13 +2210,13 @@ const Un = (e, t, n = !0) => {
|
|
|
2202
2210
|
builderElementIndex: n && o ? [].slice.call(document.getElementsByClassName(o)).indexOf(n) : void 0
|
|
2203
2211
|
}
|
|
2204
2212
|
};
|
|
2205
|
-
},
|
|
2206
|
-
function
|
|
2213
|
+
}, jn = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
2214
|
+
function $e(e, t) {
|
|
2207
2215
|
const n = new URL(t.origin), o = n.hostname;
|
|
2208
|
-
return (e ||
|
|
2216
|
+
return (e || jn).findIndex((i) => i.startsWith("*.") ? o.endsWith(i.slice(1)) : i === o) > -1;
|
|
2209
2217
|
}
|
|
2210
|
-
const
|
|
2211
|
-
function
|
|
2218
|
+
const Hn = "0.14.27", ae = {};
|
|
2219
|
+
function Kn(e, t) {
|
|
2212
2220
|
let n = ae[e];
|
|
2213
2221
|
if (n || (n = ae[e] = []), n.push(t), k()) {
|
|
2214
2222
|
const o = {
|
|
@@ -2225,8 +2233,8 @@ function jn(e, t) {
|
|
|
2225
2233
|
}
|
|
2226
2234
|
}
|
|
2227
2235
|
}
|
|
2228
|
-
const
|
|
2229
|
-
|
|
2236
|
+
const wo = () => {
|
|
2237
|
+
Kn("insertMenu", {
|
|
2230
2238
|
name: "_default",
|
|
2231
2239
|
default: !0,
|
|
2232
2240
|
items: [{
|
|
@@ -2249,13 +2257,13 @@ const Co = () => {
|
|
|
2249
2257
|
});
|
|
2250
2258
|
};
|
|
2251
2259
|
let se = !1;
|
|
2252
|
-
const
|
|
2260
|
+
const zn = (e = {}) => {
|
|
2253
2261
|
var t, n;
|
|
2254
2262
|
se || (se = !0, k() && ((t = window.parent) == null || t.postMessage({
|
|
2255
2263
|
type: "builder.sdkInfo",
|
|
2256
2264
|
data: {
|
|
2257
|
-
target:
|
|
2258
|
-
version:
|
|
2265
|
+
target: x,
|
|
2266
|
+
version: Hn,
|
|
2259
2267
|
supportsPatchUpdates: !1,
|
|
2260
2268
|
// Supports builder-model="..." attribute which is needed to
|
|
2261
2269
|
// scope our '+ add block' button styling
|
|
@@ -2269,7 +2277,7 @@ const Hn = (e = {}) => {
|
|
|
2269
2277
|
}
|
|
2270
2278
|
}, "*"), window.addEventListener("message", (o) => {
|
|
2271
2279
|
var r, a;
|
|
2272
|
-
if (
|
|
2280
|
+
if (!$e(e.trustedHosts, o))
|
|
2273
2281
|
return;
|
|
2274
2282
|
const {
|
|
2275
2283
|
data: i
|
|
@@ -2310,12 +2318,12 @@ const Hn = (e = {}) => {
|
|
|
2310
2318
|
}
|
|
2311
2319
|
}
|
|
2312
2320
|
})));
|
|
2313
|
-
},
|
|
2321
|
+
}, qn = ({
|
|
2314
2322
|
model: e,
|
|
2315
2323
|
trustedHosts: t,
|
|
2316
2324
|
callbacks: n
|
|
2317
2325
|
}) => (o) => {
|
|
2318
|
-
if (
|
|
2326
|
+
if (!$e(t, o))
|
|
2319
2327
|
return;
|
|
2320
2328
|
const {
|
|
2321
2329
|
data: i
|
|
@@ -2336,12 +2344,12 @@ const Hn = (e = {}) => {
|
|
|
2336
2344
|
break;
|
|
2337
2345
|
}
|
|
2338
2346
|
}
|
|
2339
|
-
},
|
|
2347
|
+
}, Io = (e, t, n) => {
|
|
2340
2348
|
if (!k)
|
|
2341
|
-
return
|
|
2349
|
+
return I.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."), () => {
|
|
2342
2350
|
};
|
|
2343
|
-
|
|
2344
|
-
const o =
|
|
2351
|
+
zn();
|
|
2352
|
+
const o = qn({
|
|
2345
2353
|
callbacks: {
|
|
2346
2354
|
contentUpdate: t,
|
|
2347
2355
|
animation: () => {
|
|
@@ -2366,37 +2374,37 @@ function ce(e, ...t) {
|
|
|
2366
2374
|
}
|
|
2367
2375
|
return n;
|
|
2368
2376
|
}
|
|
2369
|
-
function
|
|
2377
|
+
function Yn(e) {
|
|
2370
2378
|
console.warn(`Cannot animate element: element with ID ${e} not found!`);
|
|
2371
2379
|
}
|
|
2372
|
-
function
|
|
2373
|
-
const n =
|
|
2380
|
+
function Gn(e, t) {
|
|
2381
|
+
const n = Jn(e), o = getComputedStyle(t), i = e.steps[0].styles, r = e.steps[e.steps.length - 1].styles, a = [i, r];
|
|
2374
2382
|
for (const s of a)
|
|
2375
2383
|
for (const c of n)
|
|
2376
2384
|
c in s || (s[c] = o[c]);
|
|
2377
2385
|
}
|
|
2378
|
-
function
|
|
2386
|
+
function Jn(e) {
|
|
2379
2387
|
const t = [];
|
|
2380
2388
|
for (const n of e.steps)
|
|
2381
2389
|
for (const o in n.styles)
|
|
2382
2390
|
t.indexOf(o) === -1 && t.push(o);
|
|
2383
2391
|
return t;
|
|
2384
2392
|
}
|
|
2385
|
-
function
|
|
2393
|
+
function To(e) {
|
|
2386
2394
|
const t = Array.prototype.slice.call(document.getElementsByClassName(e.elementId || e.id || ""));
|
|
2387
2395
|
if (!t.length) {
|
|
2388
|
-
|
|
2396
|
+
Yn(e.elementId || e.id || "");
|
|
2389
2397
|
return;
|
|
2390
2398
|
}
|
|
2391
2399
|
Array.from(t).forEach((n) => {
|
|
2392
|
-
|
|
2400
|
+
Gn(e, n), n.style.transition = "none", n.style.transitionDelay = "0", ce(n.style, e.steps[0].styles), setTimeout(() => {
|
|
2393
2401
|
n.style.transition = `all ${e.duration}s ${K(e.easing)}`, e.delay && (n.style.transitionDelay = e.delay + "s"), ce(n.style, e.steps[1].styles), setTimeout(() => {
|
|
2394
2402
|
n.style.transition = "", n.style.transitionDelay = "";
|
|
2395
2403
|
}, (e.delay || 0) * 1e3 + e.duration * 1e3 + 100);
|
|
2396
2404
|
});
|
|
2397
2405
|
});
|
|
2398
2406
|
}
|
|
2399
|
-
const
|
|
2407
|
+
const Qn = (e) => {
|
|
2400
2408
|
var r;
|
|
2401
2409
|
const t = e.family + (e.kind && !e.kind.includes("#") ? ", " + e.kind : ""), n = t.split(",")[0], o = e.fileUrl ?? ((r = e == null ? void 0 : e.files) == null ? void 0 : r.regular);
|
|
2402
2410
|
let i = "";
|
|
@@ -2422,15 +2430,15 @@ font-weight: ${a};
|
|
|
2422
2430
|
`.trim());
|
|
2423
2431
|
}
|
|
2424
2432
|
return i;
|
|
2425
|
-
},
|
|
2433
|
+
}, Xn = ({
|
|
2426
2434
|
customFonts: e
|
|
2427
2435
|
}) => {
|
|
2428
2436
|
var t;
|
|
2429
|
-
return ((t = e == null ? void 0 : e.map((n) =>
|
|
2430
|
-
},
|
|
2437
|
+
return ((t = e == null ? void 0 : e.map((n) => Qn(n))) == null ? void 0 : t.join(" ")) || "";
|
|
2438
|
+
}, Zn = ({
|
|
2431
2439
|
cssCode: e,
|
|
2432
2440
|
contentId: t
|
|
2433
|
-
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "",
|
|
2441
|
+
}) => e ? t ? (e == null ? void 0 : e.replace(/&/g, `div[builder-content-id="${t}"]`)) || "" : e : "", eo = `
|
|
2434
2442
|
.builder-button {
|
|
2435
2443
|
all: unset;
|
|
2436
2444
|
}
|
|
@@ -2447,21 +2455,21 @@ font-weight: ${a};
|
|
|
2447
2455
|
text-align: inherit;
|
|
2448
2456
|
font-family: inherit;
|
|
2449
2457
|
}
|
|
2450
|
-
`,
|
|
2451
|
-
function
|
|
2458
|
+
`, to = (e) => e ? "" : eo, Eo = (e) => `variant-${e}`;
|
|
2459
|
+
function no(e) {
|
|
2452
2460
|
const t = `
|
|
2453
|
-
${
|
|
2461
|
+
${Zn({
|
|
2454
2462
|
cssCode: e.cssCode,
|
|
2455
2463
|
contentId: e.contentId
|
|
2456
2464
|
})}
|
|
2457
|
-
${
|
|
2465
|
+
${Xn({
|
|
2458
2466
|
customFonts: e.customFonts
|
|
2459
2467
|
})}
|
|
2460
|
-
${
|
|
2468
|
+
${to(e.isNestedRender)}
|
|
2461
2469
|
`.trim();
|
|
2462
|
-
return /* @__PURE__ */ l(
|
|
2470
|
+
return /* @__PURE__ */ l($, { id: "builderio-content", styles: t });
|
|
2463
2471
|
}
|
|
2464
|
-
const
|
|
2472
|
+
const oo = ({
|
|
2465
2473
|
content: e,
|
|
2466
2474
|
data: t,
|
|
2467
2475
|
locale: n
|
|
@@ -2478,7 +2486,7 @@ const to = ({
|
|
|
2478
2486
|
locale: n
|
|
2479
2487
|
} : {}
|
|
2480
2488
|
};
|
|
2481
|
-
},
|
|
2489
|
+
}, io = ({
|
|
2482
2490
|
content: e,
|
|
2483
2491
|
data: t
|
|
2484
2492
|
}) => e ? {
|
|
@@ -2491,7 +2499,7 @@ const to = ({
|
|
|
2491
2499
|
} : void 0;
|
|
2492
2500
|
function le(e) {
|
|
2493
2501
|
var i, r, a, s, c, u, h, d, f;
|
|
2494
|
-
const t =
|
|
2502
|
+
const t = pn({
|
|
2495
2503
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
2496
2504
|
variationId: (i = e.content) == null ? void 0 : i.testVariationId,
|
|
2497
2505
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
@@ -2509,12 +2517,12 @@ function le(e) {
|
|
|
2509
2517
|
}),
|
|
2510
2518
|
{}
|
|
2511
2519
|
), o = {
|
|
2512
|
-
content:
|
|
2520
|
+
content: io({
|
|
2513
2521
|
content: e.content,
|
|
2514
2522
|
data: e.data
|
|
2515
2523
|
}),
|
|
2516
2524
|
localState: void 0,
|
|
2517
|
-
rootState:
|
|
2525
|
+
rootState: oo({
|
|
2518
2526
|
content: e.content,
|
|
2519
2527
|
data: e.data,
|
|
2520
2528
|
locale: e.locale
|
|
@@ -2553,7 +2561,6 @@ function le(e) {
|
|
|
2553
2561
|
builderContextSignal: o,
|
|
2554
2562
|
contentWrapper: e.contentWrapper,
|
|
2555
2563
|
contentWrapperProps: e.contentWrapperProps,
|
|
2556
|
-
linkComponent: e.linkComponent,
|
|
2557
2564
|
trustedHosts: e.trustedHosts,
|
|
2558
2565
|
children: [
|
|
2559
2566
|
e.isSsrAbTest ? /* @__PURE__ */ l(
|
|
@@ -2564,7 +2571,7 @@ function le(e) {
|
|
|
2564
2571
|
}
|
|
2565
2572
|
) : null,
|
|
2566
2573
|
/* @__PURE__ */ l(
|
|
2567
|
-
|
|
2574
|
+
no,
|
|
2568
2575
|
{
|
|
2569
2576
|
isNestedRender: e.isNestedRender,
|
|
2570
2577
|
contentId: (a = o.content) == null ? void 0 : a.id,
|
|
@@ -2585,14 +2592,14 @@ function le(e) {
|
|
|
2585
2592
|
}
|
|
2586
2593
|
);
|
|
2587
2594
|
}
|
|
2588
|
-
function
|
|
2595
|
+
function ro(e) {
|
|
2589
2596
|
var r;
|
|
2590
|
-
const t =
|
|
2597
|
+
const t = un({
|
|
2591
2598
|
canTrack: L(e.canTrack),
|
|
2592
2599
|
content: e.content
|
|
2593
2600
|
}), n = function() {
|
|
2594
2601
|
var s;
|
|
2595
|
-
return
|
|
2602
|
+
return hn(
|
|
2596
2603
|
W(e.content).map((c) => ({
|
|
2597
2604
|
id: c.testVariationId,
|
|
2598
2605
|
testRatio: c.testRatio
|
|
@@ -2606,22 +2613,22 @@ function oo(e) {
|
|
|
2606
2613
|
return t ? {
|
|
2607
2614
|
...e.content,
|
|
2608
2615
|
testVariationId: (s = e.content) == null ? void 0 : s.id
|
|
2609
|
-
} :
|
|
2616
|
+
} : Mt({
|
|
2610
2617
|
item: e.content,
|
|
2611
2618
|
canTrack: L(e.canTrack)
|
|
2612
2619
|
});
|
|
2613
2620
|
};
|
|
2614
2621
|
return /* @__PURE__ */ R(C, { children: [
|
|
2615
|
-
!e.isNestedRender &&
|
|
2622
|
+
!e.isNestedRender && x !== "reactNative" ? /* @__PURE__ */ l(
|
|
2616
2623
|
D,
|
|
2617
2624
|
{
|
|
2618
2625
|
id: "builderio-init-variants-fns",
|
|
2619
|
-
scriptStr:
|
|
2626
|
+
scriptStr: fn()
|
|
2620
2627
|
}
|
|
2621
2628
|
) : null,
|
|
2622
2629
|
t ? /* @__PURE__ */ R(C, { children: [
|
|
2623
2630
|
/* @__PURE__ */ l(
|
|
2624
|
-
|
|
2631
|
+
$,
|
|
2625
2632
|
{
|
|
2626
2633
|
id: "builderio-variants",
|
|
2627
2634
|
styles: o()
|
|
@@ -2686,13 +2693,13 @@ function oo(e) {
|
|
|
2686
2693
|
)
|
|
2687
2694
|
] });
|
|
2688
2695
|
}
|
|
2689
|
-
const
|
|
2696
|
+
const ao = async ({
|
|
2690
2697
|
builderContextValue: e,
|
|
2691
2698
|
symbol: t
|
|
2692
2699
|
}) => {
|
|
2693
2700
|
if (t != null && t.model && // This is a hack, we should not need to check for this, but it is needed for Svelte.
|
|
2694
2701
|
(e != null && e.apiKey))
|
|
2695
|
-
return
|
|
2702
|
+
return Be({
|
|
2696
2703
|
model: t.model,
|
|
2697
2704
|
apiKey: e.apiKey,
|
|
2698
2705
|
apiVersion: e.apiVersion,
|
|
@@ -2702,10 +2709,10 @@ const io = async ({
|
|
|
2702
2709
|
}
|
|
2703
2710
|
}
|
|
2704
2711
|
}).catch((n) => {
|
|
2705
|
-
|
|
2712
|
+
I.error("Could not fetch symbol content: ", n);
|
|
2706
2713
|
});
|
|
2707
2714
|
};
|
|
2708
|
-
async function
|
|
2715
|
+
async function so(e) {
|
|
2709
2716
|
var r, a, s, c, u;
|
|
2710
2717
|
const t = function() {
|
|
2711
2718
|
return "div";
|
|
@@ -2719,12 +2726,12 @@ async function ro(e) {
|
|
|
2719
2726
|
(d = e.symbol) != null && d.inline ? "builder-inline-symbol" : void 0,
|
|
2720
2727
|
(f = e.symbol) != null && f.dynamic || e.dynamic ? "builder-dynamic-symbol" : void 0
|
|
2721
2728
|
].filter(Boolean).join(" ");
|
|
2722
|
-
}, i = ((r = e.symbol) == null ? void 0 : r.content) || await
|
|
2729
|
+
}, i = ((r = e.symbol) == null ? void 0 : r.content) || await ao({
|
|
2723
2730
|
symbol: e.symbol,
|
|
2724
2731
|
builderContextValue: e.builderContext
|
|
2725
2732
|
});
|
|
2726
2733
|
return /* @__PURE__ */ l("div", { ...e.attributes, className: o(), children: /* @__PURE__ */ l(
|
|
2727
|
-
|
|
2734
|
+
ro,
|
|
2728
2735
|
{
|
|
2729
2736
|
isNestedRender: !0,
|
|
2730
2737
|
apiVersion: e.builderContext.apiVersion,
|
|
@@ -2749,7 +2756,7 @@ async function ro(e) {
|
|
|
2749
2756
|
) });
|
|
2750
2757
|
}
|
|
2751
2758
|
const de = {};
|
|
2752
|
-
function
|
|
2759
|
+
function Ro(e) {
|
|
2753
2760
|
if (k()) {
|
|
2754
2761
|
Object.assign(de, e);
|
|
2755
2762
|
const t = {
|
|
@@ -2759,7 +2766,7 @@ function To(e) {
|
|
|
2759
2766
|
parent.postMessage(t, "*");
|
|
2760
2767
|
}
|
|
2761
2768
|
}
|
|
2762
|
-
const
|
|
2769
|
+
const Ao = async (e) => {
|
|
2763
2770
|
var o, i, r;
|
|
2764
2771
|
const t = e.path || ((o = e.url) == null ? void 0 : o.pathname) || ((i = e.userAttributes) == null ? void 0 : i.urlPath), n = {
|
|
2765
2772
|
...e,
|
|
@@ -2776,45 +2783,45 @@ const Eo = async (e) => {
|
|
|
2776
2783
|
return {
|
|
2777
2784
|
apiKey: n.apiKey,
|
|
2778
2785
|
model: n.model,
|
|
2779
|
-
content: await
|
|
2786
|
+
content: await Be(n)
|
|
2780
2787
|
};
|
|
2781
2788
|
};
|
|
2782
2789
|
export {
|
|
2783
2790
|
Pe as A,
|
|
2784
2791
|
z as B,
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2792
|
+
Pt as C,
|
|
2793
|
+
xo as D,
|
|
2794
|
+
Io as E,
|
|
2795
|
+
Ao as F,
|
|
2796
|
+
En as G,
|
|
2797
|
+
Rn as H,
|
|
2798
|
+
so as S,
|
|
2799
|
+
Zt as T,
|
|
2800
|
+
Dn as _,
|
|
2801
|
+
Tt as a,
|
|
2802
|
+
bo as b,
|
|
2796
2803
|
fe as c,
|
|
2797
|
-
|
|
2798
|
-
|
|
2804
|
+
yo as d,
|
|
2805
|
+
So as e,
|
|
2799
2806
|
k as f,
|
|
2800
2807
|
M as g,
|
|
2801
2808
|
L as h,
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2809
|
+
go as i,
|
|
2810
|
+
ko as j,
|
|
2811
|
+
Eo as k,
|
|
2812
|
+
I as l,
|
|
2813
|
+
qn as m,
|
|
2807
2814
|
H as n,
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2815
|
+
Co as o,
|
|
2816
|
+
kn as p,
|
|
2817
|
+
O as q,
|
|
2818
|
+
wo as r,
|
|
2819
|
+
zn as s,
|
|
2820
|
+
To as t,
|
|
2821
|
+
vo as u,
|
|
2822
|
+
Be as v,
|
|
2823
|
+
bn as w,
|
|
2824
|
+
ro as x,
|
|
2825
|
+
Kn as y,
|
|
2826
|
+
Ro as z
|
|
2820
2827
|
};
|