@builder.io/sdk-react-nextjs 0.14.11 → 0.14.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/{USE_CLIENT_BUNDLE-3b942ae2.js → USE_CLIENT_BUNDLE-6ac6c863.js} +203 -211
- package/lib/browser/USE_CLIENT_BUNDLE-c6228734.cjs +21 -0
- package/lib/{edge/USE_SERVER_BUNDLE-ef053564.js → browser/USE_SERVER_BUNDLE-1de84180.js} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-812e699d.cjs → browser/USE_SERVER_BUNDLE-8d870a7d.cjs} +1 -1
- package/lib/browser/{bundle-260ced55.cjs → bundle-f15c021e.cjs} +2 -2
- package/lib/browser/{bundle-76453d46.js → bundle-f830d2ad.js} +21 -21
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +24 -23
- package/lib/{node/USE_CLIENT_BUNDLE-64c45aac.js → edge/USE_CLIENT_BUNDLE-20aebe3e.js} +203 -211
- package/lib/edge/USE_CLIENT_BUNDLE-714c22c7.cjs +21 -0
- package/lib/{node/USE_SERVER_BUNDLE-ed1c8346.js → edge/USE_SERVER_BUNDLE-87b221af.js} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-299ebfe7.cjs → edge/USE_SERVER_BUNDLE-dfe3d2e3.cjs} +1 -1
- package/lib/edge/{bundle-c186261f.cjs → bundle-5a4040f8.cjs} +2 -2
- package/lib/edge/{bundle-19c1b23d.js → bundle-d7a3ce0a.js} +21 -21
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +24 -23
- package/lib/node/USE_CLIENT_BUNDLE-9fbb2664.cjs +21 -0
- package/lib/{edge/USE_CLIENT_BUNDLE-42619af6.js → node/USE_CLIENT_BUNDLE-e6e77d7b.js} +203 -211
- package/lib/{browser/USE_SERVER_BUNDLE-ec83933e.cjs → node/USE_SERVER_BUNDLE-44095c01.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-0fe135ea.js → node/USE_SERVER_BUNDLE-c4348bf9.js} +1 -1
- package/lib/node/{bundle-b5555d47.cjs → bundle-3f8cf8a2.cjs} +2 -2
- package/lib/node/{bundle-1a5c4f3c.js → bundle-b1907ae3.js} +6 -6
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +24 -23
- package/package.json +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/context/index.d.ts +1 -0
- package/types/cjs/index-helpers/blocks-exports.d.ts +4 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/context/index.d.ts +1 -0
- package/types/esm/index-helpers/blocks-exports.d.ts +4 -0
- package/lib/browser/USE_CLIENT_BUNDLE-4cb813ce.cjs +0 -21
- package/lib/edge/USE_CLIENT_BUNDLE-dfe5c354.cjs +0 -21
- package/lib/node/USE_CLIENT_BUNDLE-7dfe38c5.cjs +0 -21
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { i as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { p as
|
|
6
|
-
import { useRouter as
|
|
2
|
+
import { jsx as i, Fragment as E, jsxs as I } from "react/jsx-runtime";
|
|
3
|
+
import { i as Y, g as q, a as U, b as $, c as w, d as R, e as Z, f as H, h as _, _ as V, j as p, l as ee, k as te, t as ne, m as D, n as ie, o as ae, p as ce, r as re, s as le, q as oe, u as de } from "./bundle-f830d2ad.js";
|
|
4
|
+
import { useRef as T, useState as k, useEffect as f, createContext as se } from "react";
|
|
5
|
+
import { p as ue } from "./USE_SERVER_BUNDLE-1de84180.js";
|
|
6
|
+
import { useRouter as me } from "next/navigation";
|
|
7
7
|
function O(e) {
|
|
8
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ i(E, { children: Y(e.TagName) ? /* @__PURE__ */ i(E, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ i(E, { children: typeof e.TagName == "string" ? /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return /* @__PURE__ */
|
|
10
|
+
function xe(e) {
|
|
11
|
+
return /* @__PURE__ */ i(
|
|
12
12
|
O,
|
|
13
13
|
{
|
|
14
14
|
attributes: {
|
|
15
15
|
...e.attributes,
|
|
16
|
-
[
|
|
16
|
+
[q()]: `${e.link ? "" : "builder-button"} ${e.attributes[q()] || ""}`,
|
|
17
17
|
...e.link ? {
|
|
18
18
|
href: e.link,
|
|
19
19
|
target: e.openLinkInNewTab ? "_blank" : void 0,
|
|
@@ -28,8 +28,8 @@ function ve(e) {
|
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return /* @__PURE__ */
|
|
31
|
+
function ye(e) {
|
|
32
|
+
return /* @__PURE__ */ i(
|
|
33
33
|
O,
|
|
34
34
|
{
|
|
35
35
|
TagName: e.Wrapper,
|
|
@@ -49,8 +49,8 @@ function xe(e) {
|
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
return /* @__PURE__ */
|
|
52
|
+
function ke(e) {
|
|
53
|
+
return /* @__PURE__ */ i(
|
|
54
54
|
e.Wrapper,
|
|
55
55
|
{
|
|
56
56
|
...e.wrapperProps,
|
|
@@ -71,14 +71,14 @@ function ye(e) {
|
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
function
|
|
74
|
+
function Ce(e) {
|
|
75
|
+
function a() {
|
|
76
76
|
var r;
|
|
77
77
|
return "builder-blocks" + ((r = e.blocks) != null && r.length ? "" : " no-blocks");
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function d() {
|
|
80
80
|
var r, g;
|
|
81
|
-
|
|
81
|
+
w() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
|
|
82
82
|
{
|
|
83
83
|
type: "builder.clickEmptyBlocks",
|
|
84
84
|
data: {
|
|
@@ -91,7 +91,7 @@ function ke(e) {
|
|
|
91
91
|
}
|
|
92
92
|
function S() {
|
|
93
93
|
var r, g;
|
|
94
|
-
|
|
94
|
+
w() && !((r = e.blocks) != null && r.length) && ((g = window.parent) == null || g.postMessage(
|
|
95
95
|
{
|
|
96
96
|
type: "builder.hoverEmptyBlocks",
|
|
97
97
|
data: {
|
|
@@ -102,34 +102,34 @@ function ke(e) {
|
|
|
102
102
|
"*"
|
|
103
103
|
));
|
|
104
104
|
}
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ I(E, { children: [
|
|
106
|
+
/* @__PURE__ */ i(
|
|
107
107
|
e.BlocksWrapper,
|
|
108
108
|
{
|
|
109
|
-
className:
|
|
109
|
+
className: a() + " props-blocks-wrapper-7cd1560e",
|
|
110
110
|
"builder-path": e.path,
|
|
111
111
|
"builder-parent-id": e.parent,
|
|
112
112
|
style: e.styleProp,
|
|
113
|
-
onClick: (r) =>
|
|
113
|
+
onClick: (r) => d(),
|
|
114
114
|
onMouseEnter: (r) => S(),
|
|
115
|
-
onKeyPress: (r) =>
|
|
115
|
+
onKeyPress: (r) => d(),
|
|
116
116
|
...e.BlocksWrapperProps,
|
|
117
117
|
children: e.children
|
|
118
118
|
}
|
|
119
119
|
),
|
|
120
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ i("style", { children: `.props-blocks-wrapper-7cd1560e {
|
|
121
121
|
display: flex;
|
|
122
122
|
flex-direction: column;
|
|
123
123
|
align-items: stretch;
|
|
124
124
|
}` })
|
|
125
125
|
] });
|
|
126
126
|
}
|
|
127
|
-
function Ce(e) {
|
|
128
|
-
return /* @__PURE__ */ a("span", { children: e.children });
|
|
129
|
-
}
|
|
130
127
|
function Ee(e) {
|
|
128
|
+
return /* @__PURE__ */ i("span", { children: e.children });
|
|
129
|
+
}
|
|
130
|
+
function we(e) {
|
|
131
131
|
var r, g, b, h;
|
|
132
|
-
function
|
|
132
|
+
function a() {
|
|
133
133
|
var m;
|
|
134
134
|
const l = e.image || e.src;
|
|
135
135
|
if (!l || // We can auto add srcset for cdn.builder.io and shopify
|
|
@@ -138,14 +138,14 @@ function Ee(e) {
|
|
|
138
138
|
return e.srcset;
|
|
139
139
|
if (e.srcset && ((m = e.image) != null && m.includes("builder.io/api/v1/image"))) {
|
|
140
140
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
141
|
-
return console.debug("Removed given srcset"),
|
|
141
|
+
return console.debug("Removed given srcset"), R(l);
|
|
142
142
|
} else if (e.image && !e.srcset)
|
|
143
|
-
return
|
|
144
|
-
return
|
|
143
|
+
return R(l);
|
|
144
|
+
return R(l);
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function d() {
|
|
147
147
|
var s;
|
|
148
|
-
return (s =
|
|
148
|
+
return (s = a == null ? void 0 : a()) != null && s.match(/builder\.io/) && !e.noWebp ? a().replace(/\?/g, "?format=webp&") : "";
|
|
149
149
|
}
|
|
150
150
|
function S() {
|
|
151
151
|
const s = {
|
|
@@ -157,11 +157,11 @@ function Ee(e) {
|
|
|
157
157
|
};
|
|
158
158
|
return e.aspectRatio ? s : void 0;
|
|
159
159
|
}
|
|
160
|
-
return /* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
|
|
164
|
-
/* @__PURE__ */
|
|
160
|
+
return /* @__PURE__ */ I(E, { children: [
|
|
161
|
+
/* @__PURE__ */ I(E, { children: [
|
|
162
|
+
/* @__PURE__ */ I("picture", { children: [
|
|
163
|
+
d() ? /* @__PURE__ */ i("source", { type: "image/webp", srcSet: d() }) : null,
|
|
164
|
+
/* @__PURE__ */ i(
|
|
165
165
|
"img",
|
|
166
166
|
{
|
|
167
167
|
loading: "lazy",
|
|
@@ -174,12 +174,12 @@ function Ee(e) {
|
|
|
174
174
|
},
|
|
175
175
|
className: "builder-image" + (e.className ? " " + e.className : "") + " img-a0c95e8c",
|
|
176
176
|
src: e.image,
|
|
177
|
-
srcSet:
|
|
177
|
+
srcSet: a(),
|
|
178
178
|
sizes: e.sizes
|
|
179
179
|
}
|
|
180
180
|
)
|
|
181
181
|
] }),
|
|
182
|
-
e.aspectRatio && !((g = (r = e.builderBlock) == null ? void 0 : r.children) != null && g.length && e.fitContent) ? /* @__PURE__ */
|
|
182
|
+
e.aspectRatio && !((g = (r = e.builderBlock) == null ? void 0 : r.children) != null && g.length && e.fitContent) ? /* @__PURE__ */ i(
|
|
183
183
|
"div",
|
|
184
184
|
{
|
|
185
185
|
className: "builder-image-sizer div-a0c95e8c",
|
|
@@ -188,10 +188,10 @@ function Ee(e) {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
) : null,
|
|
191
|
-
(h = (b = e.builderBlock) == null ? void 0 : b.children) != null && h.length && e.fitContent ? /* @__PURE__ */
|
|
192
|
-
!e.fitContent && e.children ? /* @__PURE__ */
|
|
191
|
+
(h = (b = e.builderBlock) == null ? void 0 : b.children) != null && h.length && e.fitContent ? /* @__PURE__ */ i(E, { children: e.children }) : null,
|
|
192
|
+
!e.fitContent && e.children ? /* @__PURE__ */ i("div", { className: "div-a0c95e8c-2", children: e.children }) : null
|
|
193
193
|
] }),
|
|
194
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ i("style", { children: `.img-a0c95e8c {
|
|
195
195
|
opacity: 1;
|
|
196
196
|
transition: opacity 0.2s ease-in-out;
|
|
197
197
|
}.div-a0c95e8c {
|
|
@@ -210,8 +210,8 @@ function Ee(e) {
|
|
|
210
210
|
}` })
|
|
211
211
|
] });
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
return /* @__PURE__ */
|
|
213
|
+
function Ie(e) {
|
|
214
|
+
return /* @__PURE__ */ i(
|
|
215
215
|
"section",
|
|
216
216
|
{
|
|
217
217
|
...e.attributes,
|
|
@@ -231,19 +231,19 @@ function we(e) {
|
|
|
231
231
|
}
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
const
|
|
234
|
+
function Pe(e) {
|
|
235
|
+
const a = T(null), [d, S] = k(() => []), [r, g] = k(() => []);
|
|
236
236
|
return f(() => {
|
|
237
237
|
var h;
|
|
238
|
-
if (!((h =
|
|
238
|
+
if (!((h = a.current) != null && h.getElementsByTagName) || typeof window > "u")
|
|
239
239
|
return;
|
|
240
|
-
const b =
|
|
240
|
+
const b = a.current.getElementsByTagName("script");
|
|
241
241
|
for (let s = 0; s < b.length; s++) {
|
|
242
242
|
const l = b[s];
|
|
243
243
|
if (l.src) {
|
|
244
|
-
if (
|
|
244
|
+
if (d.includes(l.src))
|
|
245
245
|
continue;
|
|
246
|
-
|
|
246
|
+
d.push(l.src);
|
|
247
247
|
const m = document.createElement("script");
|
|
248
248
|
m.async = !0, m.src = l.src, document.head.appendChild(m);
|
|
249
249
|
} else if (!l.type || [
|
|
@@ -260,48 +260,48 @@ function Ie(e) {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
}, []), /* @__PURE__ */
|
|
263
|
+
}, []), /* @__PURE__ */ i(
|
|
264
264
|
"div",
|
|
265
265
|
{
|
|
266
|
-
ref:
|
|
266
|
+
ref: a,
|
|
267
267
|
className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
|
|
268
268
|
dangerouslySetInnerHTML: { __html: e.code }
|
|
269
269
|
}
|
|
270
270
|
);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
const
|
|
272
|
+
function Re(e) {
|
|
273
|
+
const a = T(null), [d, S] = k(() => []), [r, g] = k(() => []), [b, h] = k(() => !1);
|
|
274
274
|
function s() {
|
|
275
|
-
if (!
|
|
275
|
+
if (!a.current || !a.current.getElementsByTagName)
|
|
276
276
|
return;
|
|
277
|
-
const l =
|
|
277
|
+
const l = a.current.getElementsByTagName("script");
|
|
278
278
|
for (let m = 0; m < l.length; m++) {
|
|
279
|
-
const
|
|
280
|
-
if (
|
|
281
|
-
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
} else if (
|
|
279
|
+
const v = l[m];
|
|
280
|
+
if (v.src && !d.includes(v.src)) {
|
|
281
|
+
d.push(v.src);
|
|
282
|
+
const C = document.createElement("script");
|
|
283
|
+
C.async = !0, C.src = v.src, document.head.appendChild(C);
|
|
284
|
+
} else if (Z(v) && !r.includes(v.innerText))
|
|
285
285
|
try {
|
|
286
|
-
r.push(
|
|
287
|
-
} catch (
|
|
288
|
-
console.warn("`Embed`: Error running script:",
|
|
286
|
+
r.push(v.innerText), new Function(v.innerText)();
|
|
287
|
+
} catch (C) {
|
|
288
|
+
console.warn("`Embed`: Error running script:", C);
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
return f(() => {
|
|
293
|
-
|
|
294
|
-
}, [
|
|
293
|
+
a.current && !b && (h(!0), s());
|
|
294
|
+
}, [a.current, b]), /* @__PURE__ */ i(
|
|
295
295
|
"div",
|
|
296
296
|
{
|
|
297
297
|
className: "builder-embed",
|
|
298
|
-
ref:
|
|
298
|
+
ref: a,
|
|
299
299
|
dangerouslySetInnerHTML: { __html: e.content }
|
|
300
300
|
}
|
|
301
301
|
);
|
|
302
302
|
}
|
|
303
|
-
function
|
|
304
|
-
return /* @__PURE__ */
|
|
303
|
+
function Te(e) {
|
|
304
|
+
return /* @__PURE__ */ i(
|
|
305
305
|
"img",
|
|
306
306
|
{
|
|
307
307
|
style: {
|
|
@@ -312,12 +312,12 @@ function Re(e) {
|
|
|
312
312
|
src: e.imgSrc || e.image,
|
|
313
313
|
...e.attributes
|
|
314
314
|
},
|
|
315
|
-
|
|
315
|
+
w() && e.imgSrc || "default-key"
|
|
316
316
|
);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function Ne(e) {
|
|
319
319
|
var S, r, g, b, h, s, l;
|
|
320
|
-
function
|
|
320
|
+
function a() {
|
|
321
321
|
return {
|
|
322
322
|
...e.autoPlay === !0 ? {
|
|
323
323
|
autoPlay: !0
|
|
@@ -336,23 +336,23 @@ function Te(e) {
|
|
|
336
336
|
} : {}
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function d() {
|
|
340
340
|
return {
|
|
341
|
-
...
|
|
341
|
+
...a()
|
|
342
342
|
};
|
|
343
343
|
}
|
|
344
|
-
return /* @__PURE__ */
|
|
344
|
+
return /* @__PURE__ */ I(
|
|
345
345
|
"div",
|
|
346
346
|
{
|
|
347
347
|
style: {
|
|
348
348
|
position: "relative"
|
|
349
349
|
},
|
|
350
350
|
children: [
|
|
351
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ i(
|
|
352
352
|
"video",
|
|
353
353
|
{
|
|
354
354
|
className: "builder-video",
|
|
355
|
-
...
|
|
355
|
+
...d(),
|
|
356
356
|
preload: e.preload || "metadata",
|
|
357
357
|
style: {
|
|
358
358
|
width: "100%",
|
|
@@ -370,10 +370,10 @@ function Te(e) {
|
|
|
370
370
|
},
|
|
371
371
|
src: e.video || "no-src",
|
|
372
372
|
poster: e.posterImage,
|
|
373
|
-
children: e.lazyLoad ? null : /* @__PURE__ */
|
|
373
|
+
children: e.lazyLoad ? null : /* @__PURE__ */ i("source", { type: "video/mp4", src: e.video })
|
|
374
374
|
}
|
|
375
375
|
),
|
|
376
|
-
e.aspectRatio && !(e.fitContent && ((g = (r = e.builderBlock) == null ? void 0 : r.children) != null && g.length)) ? /* @__PURE__ */
|
|
376
|
+
e.aspectRatio && !(e.fitContent && ((g = (r = e.builderBlock) == null ? void 0 : r.children) != null && g.length)) ? /* @__PURE__ */ i(
|
|
377
377
|
"div",
|
|
378
378
|
{
|
|
379
379
|
style: {
|
|
@@ -384,7 +384,7 @@ function Te(e) {
|
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
) : null,
|
|
387
|
-
(h = (b = e.builderBlock) == null ? void 0 : b.children) != null && h.length && e.fitContent ? /* @__PURE__ */
|
|
387
|
+
(h = (b = e.builderBlock) == null ? void 0 : b.children) != null && h.length && e.fitContent ? /* @__PURE__ */ i(
|
|
388
388
|
"div",
|
|
389
389
|
{
|
|
390
390
|
style: {
|
|
@@ -395,7 +395,7 @@ function Te(e) {
|
|
|
395
395
|
children: e.children
|
|
396
396
|
}
|
|
397
397
|
) : null,
|
|
398
|
-
(l = (s = e.builderBlock) == null ? void 0 : s.children) != null && l.length && !e.fitContent ? /* @__PURE__ */
|
|
398
|
+
(l = (s = e.builderBlock) == null ? void 0 : s.children) != null && l.length && !e.fitContent ? /* @__PURE__ */ i(
|
|
399
399
|
"div",
|
|
400
400
|
{
|
|
401
401
|
style: {
|
|
@@ -416,7 +416,7 @@ function Te(e) {
|
|
|
416
416
|
}
|
|
417
417
|
);
|
|
418
418
|
}
|
|
419
|
-
const
|
|
419
|
+
const ge = se({
|
|
420
420
|
content: null,
|
|
421
421
|
context: {},
|
|
422
422
|
localState: void 0,
|
|
@@ -430,58 +430,58 @@ const me = de({
|
|
|
430
430
|
BlocksWrapper: "div",
|
|
431
431
|
BlocksWrapperProps: {}
|
|
432
432
|
});
|
|
433
|
-
function
|
|
434
|
-
var
|
|
435
|
-
const
|
|
436
|
-
function
|
|
437
|
-
var
|
|
433
|
+
function Be(e) {
|
|
434
|
+
var j, W, K, A, F, z, M;
|
|
435
|
+
const a = T(null);
|
|
436
|
+
function d(n) {
|
|
437
|
+
var o, c;
|
|
438
438
|
const t = {
|
|
439
439
|
...e.builderContextSignal.rootState,
|
|
440
440
|
...n
|
|
441
441
|
};
|
|
442
|
-
e.builderContextSignal.rootSetState ? (
|
|
442
|
+
e.builderContextSignal.rootSetState ? (c = (o = e.builderContextSignal).rootSetState) == null || c.call(o, t) : e.builderContextSignal.rootState = t;
|
|
443
443
|
}
|
|
444
444
|
function S(n) {
|
|
445
|
-
var
|
|
445
|
+
var o, c, u, x, y;
|
|
446
446
|
const t = {
|
|
447
447
|
...e.builderContextSignal.content,
|
|
448
448
|
...n,
|
|
449
449
|
data: {
|
|
450
|
-
...(
|
|
450
|
+
...(o = e.builderContextSignal.content) == null ? void 0 : o.data,
|
|
451
451
|
...n == null ? void 0 : n.data
|
|
452
452
|
},
|
|
453
453
|
meta: {
|
|
454
|
-
...(
|
|
454
|
+
...(c = e.builderContextSignal.content) == null ? void 0 : c.meta,
|
|
455
455
|
...n == null ? void 0 : n.meta,
|
|
456
|
-
breakpoints: ((
|
|
456
|
+
breakpoints: ((u = n == null ? void 0 : n.meta) == null ? void 0 : u.breakpoints) || ((y = (x = e.builderContextSignal.content) == null ? void 0 : x.meta) == null ? void 0 : y.breakpoints)
|
|
457
457
|
}
|
|
458
458
|
};
|
|
459
|
-
|
|
459
|
+
ue({
|
|
460
460
|
value: t,
|
|
461
461
|
key: t.id
|
|
462
462
|
}).then(() => {
|
|
463
463
|
Q.refresh();
|
|
464
464
|
});
|
|
465
465
|
}
|
|
466
|
-
const [r, g] =
|
|
466
|
+
const [r, g] = k(
|
|
467
467
|
() => e.contentWrapper || "div"
|
|
468
468
|
);
|
|
469
469
|
function b(n) {
|
|
470
|
-
return
|
|
470
|
+
return te({
|
|
471
471
|
model: e.model,
|
|
472
472
|
trustedHosts: e.trustedHosts,
|
|
473
473
|
callbacks: {
|
|
474
474
|
configureSdk: (t) => {
|
|
475
|
-
var
|
|
476
|
-
const { breakpoints:
|
|
477
|
-
!
|
|
475
|
+
var u;
|
|
476
|
+
const { breakpoints: o, contentId: c } = t;
|
|
477
|
+
!c || c !== ((u = e.builderContextSignal.content) == null ? void 0 : u.id) || o && S({
|
|
478
478
|
meta: {
|
|
479
|
-
breakpoints:
|
|
479
|
+
breakpoints: o
|
|
480
480
|
}
|
|
481
481
|
});
|
|
482
482
|
},
|
|
483
483
|
animation: (t) => {
|
|
484
|
-
|
|
484
|
+
ne(t);
|
|
485
485
|
},
|
|
486
486
|
contentUpdate: (t) => {
|
|
487
487
|
S(t);
|
|
@@ -490,8 +490,8 @@ function Ne(e) {
|
|
|
490
490
|
})(n);
|
|
491
491
|
}
|
|
492
492
|
function h() {
|
|
493
|
-
var t,
|
|
494
|
-
const n = (
|
|
493
|
+
var t, o;
|
|
494
|
+
const n = (o = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : o.jsCode;
|
|
495
495
|
n && D({
|
|
496
496
|
code: n,
|
|
497
497
|
context: e.context || {},
|
|
@@ -504,70 +504,61 @@ function Ne(e) {
|
|
|
504
504
|
enableCache: !1
|
|
505
505
|
});
|
|
506
506
|
}
|
|
507
|
-
const [s, l] =
|
|
508
|
-
function
|
|
509
|
-
var t,
|
|
507
|
+
const [s, l] = k(() => ({})), [m, v] = k(() => ({})), [C, J] = k(() => !1);
|
|
508
|
+
function G(n) {
|
|
509
|
+
var t, o;
|
|
510
510
|
if (e.builderContextSignal.content) {
|
|
511
|
-
const
|
|
511
|
+
const c = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, u = (o = e.builderContextSignal.content) == null ? void 0 : o.id;
|
|
512
512
|
V({
|
|
513
513
|
type: "click",
|
|
514
|
-
canTrack:
|
|
515
|
-
contentId:
|
|
514
|
+
canTrack: _(e.canTrack),
|
|
515
|
+
contentId: u,
|
|
516
516
|
apiKey: e.apiKey,
|
|
517
|
-
variationId:
|
|
518
|
-
...
|
|
519
|
-
unique: !
|
|
517
|
+
variationId: c !== u ? c : void 0,
|
|
518
|
+
...ie(n),
|
|
519
|
+
unique: !C
|
|
520
520
|
});
|
|
521
521
|
}
|
|
522
|
-
|
|
523
|
-
}
|
|
524
|
-
function J(n) {
|
|
525
|
-
return n.replace(
|
|
526
|
-
/{{([^}]+)}}/g,
|
|
527
|
-
(t, i) => String(
|
|
528
|
-
D({
|
|
529
|
-
code: i,
|
|
530
|
-
context: e.context || {},
|
|
531
|
-
localState: void 0,
|
|
532
|
-
rootState: e.builderContextSignal.rootState,
|
|
533
|
-
rootSetState: e.builderContextSignal.rootSetState,
|
|
534
|
-
enableCache: !0
|
|
535
|
-
})
|
|
536
|
-
)
|
|
537
|
-
);
|
|
538
|
-
}
|
|
539
|
-
function G({ url: n, key: t }) {
|
|
540
|
-
oe(n).then((i) => i.json()).then((i) => {
|
|
541
|
-
var d, v;
|
|
542
|
-
const o = {
|
|
543
|
-
...e.builderContextSignal.rootState,
|
|
544
|
-
[t]: i
|
|
545
|
-
};
|
|
546
|
-
(v = (d = e.builderContextSignal).rootSetState) == null || v.call(d, o), s[t] = !0;
|
|
547
|
-
}).catch((i) => {
|
|
548
|
-
console.error("error fetching dynamic data", n, i);
|
|
549
|
-
});
|
|
522
|
+
C || J(!0);
|
|
550
523
|
}
|
|
551
|
-
function
|
|
552
|
-
var t,
|
|
553
|
-
const n = ((
|
|
554
|
-
Object.entries(n).forEach(([
|
|
555
|
-
if (
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
524
|
+
function N() {
|
|
525
|
+
var t, o;
|
|
526
|
+
const n = ((o = (t = e.builderContextSignal.content) == null ? void 0 : t.data) == null ? void 0 : o.httpRequests) ?? {};
|
|
527
|
+
Object.entries(n).forEach(([c, u]) => {
|
|
528
|
+
if (!u || m[c] || s[c] && !w())
|
|
529
|
+
return;
|
|
530
|
+
m[c] = !0;
|
|
531
|
+
const x = u.replace(
|
|
532
|
+
/{{([^}]+)}}/g,
|
|
533
|
+
(y, X) => String(
|
|
534
|
+
D({
|
|
535
|
+
code: X,
|
|
536
|
+
context: e.context || {},
|
|
537
|
+
localState: void 0,
|
|
538
|
+
rootState: e.builderContextSignal.rootState,
|
|
539
|
+
rootSetState: e.builderContextSignal.rootSetState,
|
|
540
|
+
enableCache: !0
|
|
541
|
+
})
|
|
542
|
+
)
|
|
543
|
+
);
|
|
544
|
+
ae(x).then((y) => y.json()).then((y) => {
|
|
545
|
+
d({
|
|
546
|
+
[c]: y
|
|
547
|
+
}), s[c] = !0;
|
|
548
|
+
}).catch((y) => {
|
|
549
|
+
console.error("error fetching dynamic data", u, y);
|
|
550
|
+
}).finally(() => {
|
|
551
|
+
m[c] = !1;
|
|
552
|
+
});
|
|
562
553
|
});
|
|
563
554
|
}
|
|
564
|
-
function
|
|
565
|
-
|
|
555
|
+
function P() {
|
|
556
|
+
w() && window.dispatchEvent(
|
|
566
557
|
new CustomEvent(
|
|
567
558
|
"builder:component:stateChange",
|
|
568
559
|
{
|
|
569
560
|
detail: {
|
|
570
|
-
state:
|
|
561
|
+
state: ce(e.builderContextSignal.rootState),
|
|
571
562
|
ref: {
|
|
572
563
|
name: e.model
|
|
573
564
|
}
|
|
@@ -576,8 +567,8 @@ function Ne(e) {
|
|
|
576
567
|
)
|
|
577
568
|
);
|
|
578
569
|
}
|
|
579
|
-
function
|
|
580
|
-
window.addEventListener("message", b),
|
|
570
|
+
function B(n) {
|
|
571
|
+
window.addEventListener("message", b), re(), le({
|
|
581
572
|
...e.locale ? {
|
|
582
573
|
locale: e.locale
|
|
583
574
|
} : {},
|
|
@@ -590,117 +581,118 @@ function Ne(e) {
|
|
|
590
581
|
}), Object.values(
|
|
591
582
|
e.builderContextSignal.componentInfos
|
|
592
583
|
).forEach((t) => {
|
|
593
|
-
var
|
|
594
|
-
const
|
|
595
|
-
(
|
|
584
|
+
var c;
|
|
585
|
+
const o = oe(t);
|
|
586
|
+
(c = window.parent) == null || c.postMessage(o, "*");
|
|
596
587
|
}), window.addEventListener(
|
|
597
588
|
"builder:component:stateChangeListenerActivated",
|
|
598
|
-
|
|
589
|
+
P
|
|
599
590
|
);
|
|
600
591
|
}
|
|
601
|
-
function
|
|
602
|
-
const t = new URL(location.href).searchParams,
|
|
603
|
-
`builder.preview.${
|
|
604
|
-
),
|
|
605
|
-
|
|
592
|
+
function L(n) {
|
|
593
|
+
const t = new URL(location.href).searchParams, o = t.get("builder.preview"), c = t.get(
|
|
594
|
+
`builder.preview.${o}`
|
|
595
|
+
), u = t.get("apiKey") || t.get("builder.space");
|
|
596
|
+
o === e.model && u === e.apiKey && (!e.content || c === e.content.id) && de({
|
|
606
597
|
model: e.model,
|
|
607
598
|
apiKey: e.apiKey,
|
|
608
599
|
apiVersion: e.builderContextSignal.apiVersion
|
|
609
|
-
}).then((
|
|
610
|
-
|
|
600
|
+
}).then((x) => {
|
|
601
|
+
x && S(x);
|
|
611
602
|
});
|
|
612
603
|
}
|
|
613
|
-
const Q =
|
|
604
|
+
const Q = me();
|
|
614
605
|
return f(() => {
|
|
615
606
|
var n;
|
|
616
|
-
return (n =
|
|
607
|
+
return (n = a.current) == null || n.addEventListener(
|
|
617
608
|
"initeditingbldr",
|
|
618
|
-
|
|
609
|
+
B
|
|
619
610
|
), () => {
|
|
620
611
|
var t;
|
|
621
|
-
return (t =
|
|
612
|
+
return (t = a.current) == null ? void 0 : t.removeEventListener(
|
|
622
613
|
"initeditingbldr",
|
|
623
|
-
|
|
614
|
+
B
|
|
624
615
|
);
|
|
625
616
|
};
|
|
626
617
|
}, []), f(() => {
|
|
627
618
|
var n;
|
|
628
|
-
return (n =
|
|
619
|
+
return (n = a.current) == null || n.addEventListener(
|
|
629
620
|
"initpreviewingbldr",
|
|
630
|
-
|
|
621
|
+
L
|
|
631
622
|
), () => {
|
|
632
623
|
var t;
|
|
633
|
-
return (t =
|
|
624
|
+
return (t = a.current) == null ? void 0 : t.removeEventListener(
|
|
634
625
|
"initpreviewingbldr",
|
|
635
|
-
|
|
626
|
+
L
|
|
636
627
|
);
|
|
637
628
|
};
|
|
638
629
|
}, []), f(() => {
|
|
639
630
|
var n, t;
|
|
640
|
-
if (
|
|
641
|
-
if (
|
|
642
|
-
const
|
|
631
|
+
if (H()) {
|
|
632
|
+
if (w() && a.current && a.current.dispatchEvent(new CustomEvent("initeditingbldr")), e.builderContextSignal.content && _(e.canTrack)) {
|
|
633
|
+
const c = (n = e.builderContextSignal.content) == null ? void 0 : n.testVariationId, u = (t = e.builderContextSignal.content) == null ? void 0 : t.id, x = e.apiKey;
|
|
643
634
|
V({
|
|
644
635
|
type: "impression",
|
|
645
636
|
canTrack: !0,
|
|
646
|
-
contentId:
|
|
647
|
-
apiKey:
|
|
648
|
-
variationId:
|
|
637
|
+
contentId: u,
|
|
638
|
+
apiKey: x,
|
|
639
|
+
variationId: c !== u ? c : void 0
|
|
649
640
|
});
|
|
650
641
|
}
|
|
651
|
-
|
|
642
|
+
p();
|
|
652
643
|
}
|
|
653
644
|
}, []), f(() => {
|
|
654
|
-
e.apiKey ||
|
|
645
|
+
e.apiKey || ee.error(
|
|
655
646
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
656
|
-
), h(),
|
|
647
|
+
), h(), N(), P();
|
|
657
648
|
}, []), f(() => {
|
|
658
649
|
}, [e.content]), f(() => {
|
|
659
650
|
h();
|
|
660
|
-
}, [(
|
|
661
|
-
|
|
662
|
-
}, [(
|
|
663
|
-
|
|
651
|
+
}, [(W = (j = e.builderContextSignal.content) == null ? void 0 : j.data) == null ? void 0 : W.jsCode]), f(() => {
|
|
652
|
+
N();
|
|
653
|
+
}, [(A = (K = e.builderContextSignal.content) == null ? void 0 : K.data) == null ? void 0 : A.httpRequests]), f(() => {
|
|
654
|
+
P();
|
|
664
655
|
}, [e.builderContextSignal.rootState]), f(() => {
|
|
665
|
-
e.data &&
|
|
656
|
+
e.data && d(e.data);
|
|
666
657
|
}, [e.data]), f(() => {
|
|
667
|
-
e.locale &&
|
|
658
|
+
e.locale && d({
|
|
668
659
|
locale: e.locale
|
|
669
660
|
});
|
|
670
661
|
}, [e.locale]), f(() => () => {
|
|
671
|
-
|
|
662
|
+
H() && (window.removeEventListener("message", b), window.removeEventListener(
|
|
672
663
|
"builder:component:stateChangeListenerActivated",
|
|
673
|
-
|
|
664
|
+
P
|
|
674
665
|
));
|
|
675
|
-
}, []), /* @__PURE__ */
|
|
666
|
+
}, []), /* @__PURE__ */ i(ge.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ i(
|
|
676
667
|
r,
|
|
677
668
|
{
|
|
678
|
-
ref:
|
|
679
|
-
onClick: (n) =>
|
|
680
|
-
"builder-content-id": (
|
|
669
|
+
ref: a,
|
|
670
|
+
onClick: (n) => G(n),
|
|
671
|
+
"builder-content-id": (F = e.builderContextSignal.content) == null ? void 0 : F.id,
|
|
681
672
|
"builder-model": e.model,
|
|
682
673
|
...e.showContent ? {} : {
|
|
683
674
|
hidden: !0,
|
|
684
675
|
"aria-hidden": !0
|
|
685
676
|
},
|
|
686
677
|
...e.contentWrapperProps,
|
|
687
|
-
className: `variant-${((
|
|
678
|
+
className: `variant-${((z = e.content) == null ? void 0 : z.testVariationId) || ((M = e.content) == null ? void 0 : M.id)}`,
|
|
688
679
|
children: e.children
|
|
689
680
|
}
|
|
690
681
|
) : null });
|
|
691
682
|
}
|
|
692
683
|
export {
|
|
693
|
-
|
|
694
|
-
|
|
684
|
+
ye as B,
|
|
685
|
+
Pe as C,
|
|
695
686
|
O as D,
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
687
|
+
Re as E,
|
|
688
|
+
Ee as F,
|
|
689
|
+
ke as I,
|
|
690
|
+
Ie as S,
|
|
691
|
+
Ne as V,
|
|
692
|
+
Ce as a,
|
|
693
|
+
Te as b,
|
|
694
|
+
xe as c,
|
|
695
|
+
we as d,
|
|
696
|
+
Be as e,
|
|
697
|
+
ge as f
|
|
706
698
|
};
|