@builder.io/sdk-react-nextjs 0.6.2-0 → 0.6.3
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/README.md +1 -1
- package/lib/browser/USE_CLIENT_BUNDLE-7df521d2.mjs +620 -0
- package/lib/browser/USE_CLIENT_BUNDLE-ba140db3.js +23 -0
- package/lib/browser/USE_SERVER_BUNDLE-4eda8de6.mjs +11 -0
- package/lib/{edge/USE_SERVER_BUNDLE-dc7c843d.js → browser/USE_SERVER_BUNDLE-7d2b1f4f.js} +1 -1
- package/lib/browser/bundle-a1b650c9.js +76 -0
- package/lib/browser/{bundle-b0c14a2f.mjs → bundle-c727cf36.mjs} +420 -378
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +14 -14
- package/lib/edge/USE_CLIENT_BUNDLE-88bd3402.mjs +620 -0
- package/lib/edge/USE_CLIENT_BUNDLE-c1e8e1b1.js +23 -0
- package/lib/edge/USE_SERVER_BUNDLE-6554eb5e.mjs +11 -0
- package/lib/{node/USE_SERVER_BUNDLE-e7c2df57.js → edge/USE_SERVER_BUNDLE-b339a170.js} +1 -1
- package/lib/edge/bundle-56d2ffe3.js +96 -0
- package/lib/edge/{bundle-e2e962a8.mjs → bundle-75be1e37.mjs} +1764 -1722
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +14 -14
- package/lib/node/USE_CLIENT_BUNDLE-7df521d2.mjs +620 -0
- package/lib/node/USE_CLIENT_BUNDLE-ba140db3.js +23 -0
- package/lib/node/USE_SERVER_BUNDLE-4eda8de6.mjs +11 -0
- package/lib/{browser/USE_SERVER_BUNDLE-e7c2df57.js → node/USE_SERVER_BUNDLE-7d2b1f4f.js} +1 -1
- package/lib/node/bundle-a1b650c9.js +76 -0
- package/lib/node/{bundle-b0c14a2f.mjs → bundle-c727cf36.mjs} +420 -378
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +14 -14
- package/package.json +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/functions/fetch-builder-props.d.ts +13 -0
- package/types/types/components.d.ts +0 -1
- package/lib/browser/USE_CLIENT_BUNDLE-778eeeb3.js +0 -23
- package/lib/browser/USE_CLIENT_BUNDLE-a73198a1.mjs +0 -664
- package/lib/browser/USE_SERVER_BUNDLE-80e10cfe.mjs +0 -11
- package/lib/browser/bundle-c3b66b2f.js +0 -76
- package/lib/edge/USE_CLIENT_BUNDLE-777b23e5.mjs +0 -664
- package/lib/edge/USE_CLIENT_BUNDLE-7b4d63a6.js +0 -23
- package/lib/edge/USE_SERVER_BUNDLE-2c7d68ff.mjs +0 -11
- package/lib/edge/bundle-8124c323.js +0 -96
- package/lib/node/USE_CLIENT_BUNDLE-778eeeb3.js +0 -23
- package/lib/node/USE_CLIENT_BUNDLE-a73198a1.mjs +0 -664
- package/lib/node/USE_SERVER_BUNDLE-80e10cfe.mjs +0 -11
- package/lib/node/bundle-c3b66b2f.js +0 -76
package/lib/edge/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bundle-56d2ffe3.js"),t=require("./USE_CLIENT_BUNDLE-c1e8e1b1.js");require("lru-cache");require("react/jsx-runtime");require("react");require("next/navigation");require("./USE_SERVER_BUNDLE-b339a170.js");exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.RenderBlocks=e.RenderBlocks;exports.RenderContent=e.RenderContent;exports.Symbol=e.Symbol;exports.Text=e.Text;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getAllContent=e.getAllContent;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.getContent=e.getContent;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.track=e.track;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;
|
package/lib/edge/index.mjs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { B as i,
|
|
2
|
-
import {
|
|
1
|
+
import { B as i, p as m, C as c, R as g, o as p, S as l, T as C, z as d, f, E as u, v as B, w as S, x as E, A as R, y as h, i as x, q as k, t as y, u as P, D as b } from "./bundle-75be1e37.mjs";
|
|
2
|
+
import { b as w, F as A, c as F, S as T, V } from "./USE_CLIENT_BUNDLE-88bd3402.mjs";
|
|
3
3
|
import "lru-cache";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "react";
|
|
6
6
|
import "next/navigation";
|
|
7
|
-
import "./USE_SERVER_BUNDLE-
|
|
7
|
+
import "./USE_SERVER_BUNDLE-6554eb5e.mjs";
|
|
8
8
|
export {
|
|
9
9
|
i as Blocks,
|
|
10
10
|
w as Button,
|
|
11
11
|
m as Columns,
|
|
12
12
|
c as Content,
|
|
13
13
|
A as Fragment,
|
|
14
|
-
|
|
14
|
+
F as Image,
|
|
15
15
|
g as RenderBlocks,
|
|
16
16
|
p as RenderContent,
|
|
17
|
-
|
|
17
|
+
T as Section,
|
|
18
18
|
l as Symbol,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
C as Text,
|
|
20
|
+
V as Video,
|
|
21
|
+
d as _processContentResult,
|
|
22
|
+
f as createRegisterComponentMessage,
|
|
23
|
+
u as fetchBuilderProps,
|
|
24
|
+
B as fetchEntries,
|
|
25
|
+
S as fetchOneEntry,
|
|
26
26
|
E as getAllContent,
|
|
27
27
|
R as getBuilderSearchParams,
|
|
28
28
|
h as getContent,
|
|
29
29
|
x as isEditing,
|
|
30
30
|
k as isPreviewing,
|
|
31
31
|
y as register,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
P as setEditorSettings,
|
|
33
|
+
b as track
|
|
34
34
|
};
|
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as C, Fragment as b, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { g as P, a as N, i as I, b as w, c as O, d as G, l as Q, e as T, r as X, s as Y, f as Z, _, h as A, j as $, k as p, m as ee } from "./bundle-c727cf36.mjs";
|
|
4
|
+
import { useRef as j, useState as S, useEffect as y, createContext as te } from "react";
|
|
5
|
+
import { p as ne } from "./USE_SERVER_BUNDLE-4eda8de6.mjs";
|
|
6
|
+
import { useRouter as ie } from "next/navigation";
|
|
7
|
+
function se(e) {
|
|
8
|
+
return /* @__PURE__ */ C(b, { children: [
|
|
9
|
+
e.link ? /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(
|
|
10
|
+
"a",
|
|
11
|
+
{
|
|
12
|
+
role: "button",
|
|
13
|
+
...e.attributes,
|
|
14
|
+
href: e.link,
|
|
15
|
+
target: e.openLinkInNewTab ? "_blank" : void 0,
|
|
16
|
+
children: e.text
|
|
17
|
+
}
|
|
18
|
+
) }) : /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(
|
|
19
|
+
"button",
|
|
20
|
+
{
|
|
21
|
+
...e.attributes,
|
|
22
|
+
style: e.attributes.style,
|
|
23
|
+
className: e.attributes.className + " button-3e7bc8b2",
|
|
24
|
+
children: e.text
|
|
25
|
+
}
|
|
26
|
+
) }),
|
|
27
|
+
/* @__PURE__ */ n("style", { children: `.button-3e7bc8b2 {
|
|
28
|
+
all: unset;
|
|
29
|
+
}` })
|
|
30
|
+
] });
|
|
31
|
+
}
|
|
32
|
+
function ue(e) {
|
|
33
|
+
return /* @__PURE__ */ n(
|
|
34
|
+
e.Wrapper,
|
|
35
|
+
{
|
|
36
|
+
...e.wrapperProps,
|
|
37
|
+
attributes: {
|
|
38
|
+
...P({
|
|
39
|
+
block: e.block,
|
|
40
|
+
context: e.context
|
|
41
|
+
}),
|
|
42
|
+
...N({
|
|
43
|
+
block: e.block,
|
|
44
|
+
rootState: e.context.rootState,
|
|
45
|
+
rootSetState: e.context.rootSetState,
|
|
46
|
+
localState: e.context.localState,
|
|
47
|
+
context: e.context.context
|
|
48
|
+
})
|
|
49
|
+
},
|
|
50
|
+
children: e.children
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function me(e) {
|
|
55
|
+
return /* @__PURE__ */ C(b, { children: [
|
|
56
|
+
" ",
|
|
57
|
+
e.hasChildren ? /* @__PURE__ */ n(b, { children: /* @__PURE__ */ C(
|
|
58
|
+
e.Wrapper,
|
|
59
|
+
{
|
|
60
|
+
...P({
|
|
61
|
+
block: e.block,
|
|
62
|
+
context: e.context
|
|
63
|
+
}),
|
|
64
|
+
...N({
|
|
65
|
+
block: e.block,
|
|
66
|
+
rootState: e.context.rootState,
|
|
67
|
+
rootSetState: e.context.rootSetState,
|
|
68
|
+
localState: e.context.localState,
|
|
69
|
+
context: e.context.context,
|
|
70
|
+
stripPrefix: !0
|
|
71
|
+
}),
|
|
72
|
+
children: [
|
|
73
|
+
" ",
|
|
74
|
+
e.children,
|
|
75
|
+
" "
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
) }) : /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(
|
|
79
|
+
e.Wrapper,
|
|
80
|
+
{
|
|
81
|
+
...P({
|
|
82
|
+
block: e.block,
|
|
83
|
+
context: e.context
|
|
84
|
+
}),
|
|
85
|
+
...N({
|
|
86
|
+
block: e.block,
|
|
87
|
+
rootState: e.context.rootState,
|
|
88
|
+
rootSetState: e.context.rootSetState,
|
|
89
|
+
localState: e.context.localState,
|
|
90
|
+
context: e.context.context,
|
|
91
|
+
stripPrefix: !0
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
) }),
|
|
95
|
+
" "
|
|
96
|
+
] });
|
|
97
|
+
}
|
|
98
|
+
function be(e) {
|
|
99
|
+
function o() {
|
|
100
|
+
var a;
|
|
101
|
+
return "builder-blocks" + ((a = e.blocks) != null && a.length ? "" : " no-blocks");
|
|
102
|
+
}
|
|
103
|
+
function s() {
|
|
104
|
+
var a, m;
|
|
105
|
+
I() && !((a = e.blocks) != null && a.length) && ((m = window.parent) == null || m.postMessage(
|
|
106
|
+
{
|
|
107
|
+
type: "builder.clickEmptyBlocks",
|
|
108
|
+
data: {
|
|
109
|
+
parentElementId: e.parent,
|
|
110
|
+
dataPath: e.path
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"*"
|
|
114
|
+
));
|
|
115
|
+
}
|
|
116
|
+
function v() {
|
|
117
|
+
var a, m;
|
|
118
|
+
I() && !((a = e.blocks) != null && a.length) && ((m = window.parent) == null || m.postMessage(
|
|
119
|
+
{
|
|
120
|
+
type: "builder.hoverEmptyBlocks",
|
|
121
|
+
data: {
|
|
122
|
+
parentElementId: e.parent,
|
|
123
|
+
dataPath: e.path
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"*"
|
|
127
|
+
));
|
|
128
|
+
}
|
|
129
|
+
return /* @__PURE__ */ C(b, { children: [
|
|
130
|
+
/* @__PURE__ */ n(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
className: o() + " div-5821bd52",
|
|
134
|
+
"builder-path": e.path,
|
|
135
|
+
"builder-parent-id": e.parent,
|
|
136
|
+
style: e.styleProp,
|
|
137
|
+
onClick: (a) => s(),
|
|
138
|
+
onMouseEnter: (a) => v(),
|
|
139
|
+
onKeyPress: (a) => s(),
|
|
140
|
+
children: e.children
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
/* @__PURE__ */ n("style", { children: `.div-5821bd52 {
|
|
144
|
+
display: flex;
|
|
145
|
+
flex-direction: column;
|
|
146
|
+
align-items: stretch;
|
|
147
|
+
}` })
|
|
148
|
+
] });
|
|
149
|
+
}
|
|
150
|
+
function fe(e) {
|
|
151
|
+
return /* @__PURE__ */ n("span", { children: e.children });
|
|
152
|
+
}
|
|
153
|
+
function ge(e) {
|
|
154
|
+
var a, m, x, k;
|
|
155
|
+
function o() {
|
|
156
|
+
var u;
|
|
157
|
+
const c = e.image || e.src;
|
|
158
|
+
if (!c || // We can auto add srcset for cdn.builder.io and shopify
|
|
159
|
+
// images, otherwise you can supply this prop manually
|
|
160
|
+
!(c.match(/builder\.io/) || c.match(/cdn\.shopify\.com/)))
|
|
161
|
+
return e.srcset;
|
|
162
|
+
if (e.srcset && ((u = e.image) != null && u.includes("builder.io/api/v1/image"))) {
|
|
163
|
+
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
164
|
+
return console.debug("Removed given srcset"), w(c);
|
|
165
|
+
} else if (e.image && !e.srcset)
|
|
166
|
+
return w(c);
|
|
167
|
+
return w(c);
|
|
168
|
+
}
|
|
169
|
+
function s() {
|
|
170
|
+
var f;
|
|
171
|
+
return (f = o == null ? void 0 : o()) != null && f.match(/builder\.io/) && !e.noWebp ? o().replace(/\?/g, "?format=webp&") : "";
|
|
172
|
+
}
|
|
173
|
+
function v() {
|
|
174
|
+
const f = {
|
|
175
|
+
position: "absolute",
|
|
176
|
+
height: "100%",
|
|
177
|
+
width: "100%",
|
|
178
|
+
left: "0px",
|
|
179
|
+
top: "0px"
|
|
180
|
+
};
|
|
181
|
+
return e.aspectRatio ? f : void 0;
|
|
182
|
+
}
|
|
183
|
+
return /* @__PURE__ */ C(b, { children: [
|
|
184
|
+
/* @__PURE__ */ C(b, { children: [
|
|
185
|
+
/* @__PURE__ */ C("picture", { children: [
|
|
186
|
+
s() ? /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n("source", { type: "image/webp", srcSet: s() }) }) : null,
|
|
187
|
+
/* @__PURE__ */ n(
|
|
188
|
+
"img",
|
|
189
|
+
{
|
|
190
|
+
loading: "lazy",
|
|
191
|
+
alt: e.altText,
|
|
192
|
+
role: e.altText ? "presentation" : void 0,
|
|
193
|
+
style: {
|
|
194
|
+
objectPosition: e.backgroundPosition || "center",
|
|
195
|
+
objectFit: e.backgroundSize || "cover",
|
|
196
|
+
...v()
|
|
197
|
+
},
|
|
198
|
+
className: "builder-image" + (e.className ? " " + e.className : "") + " img-ef11a6be",
|
|
199
|
+
src: e.image,
|
|
200
|
+
srcSet: o(),
|
|
201
|
+
sizes: e.sizes
|
|
202
|
+
}
|
|
203
|
+
)
|
|
204
|
+
] }),
|
|
205
|
+
e.aspectRatio && !((m = (a = e.builderBlock) == null ? void 0 : a.children) != null && m.length && e.fitContent) ? /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(
|
|
206
|
+
"div",
|
|
207
|
+
{
|
|
208
|
+
className: "builder-image-sizer div-ef11a6be",
|
|
209
|
+
style: {
|
|
210
|
+
paddingTop: e.aspectRatio * 100 + "%"
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
) }) : null,
|
|
214
|
+
(k = (x = e.builderBlock) == null ? void 0 : x.children) != null && k.length && e.fitContent ? /* @__PURE__ */ n(b, { children: e.children }) : null,
|
|
215
|
+
!e.fitContent && e.children ? /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n("div", { className: "div-ef11a6be-2", children: e.children }) }) : null
|
|
216
|
+
] }),
|
|
217
|
+
/* @__PURE__ */ n("style", { children: `.img-ef11a6be {
|
|
218
|
+
opacity: 1;
|
|
219
|
+
transition: opacity 0.2s ease-in-out;
|
|
220
|
+
}.div-ef11a6be {
|
|
221
|
+
width: 100%;
|
|
222
|
+
pointer-events: none;
|
|
223
|
+
font-size: 0;
|
|
224
|
+
}.div-ef11a6be-2 {
|
|
225
|
+
display: flex;
|
|
226
|
+
flex-direction: column;
|
|
227
|
+
align-items: stretch;
|
|
228
|
+
position: absolute;
|
|
229
|
+
top: 0;
|
|
230
|
+
left: 0;
|
|
231
|
+
width: 100%;
|
|
232
|
+
height: 100%;
|
|
233
|
+
}` })
|
|
234
|
+
] });
|
|
235
|
+
}
|
|
236
|
+
function he(e) {
|
|
237
|
+
return /* @__PURE__ */ n(
|
|
238
|
+
"section",
|
|
239
|
+
{
|
|
240
|
+
...e.attributes,
|
|
241
|
+
style: {
|
|
242
|
+
width: "100%",
|
|
243
|
+
alignSelf: "stretch",
|
|
244
|
+
flexGrow: 1,
|
|
245
|
+
boxSizing: "border-box",
|
|
246
|
+
maxWidth: e.maxWidth || 1200,
|
|
247
|
+
display: "flex",
|
|
248
|
+
flexDirection: "column",
|
|
249
|
+
alignItems: "stretch",
|
|
250
|
+
marginLeft: "auto",
|
|
251
|
+
marginRight: "auto"
|
|
252
|
+
},
|
|
253
|
+
children: e.children
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
function Se(e) {
|
|
258
|
+
var v;
|
|
259
|
+
function o() {
|
|
260
|
+
return {
|
|
261
|
+
...e.autoPlay === !0 ? {
|
|
262
|
+
autoPlay: !0
|
|
263
|
+
} : {},
|
|
264
|
+
...e.muted === !0 ? {
|
|
265
|
+
muted: !0
|
|
266
|
+
} : {},
|
|
267
|
+
...e.controls === !0 ? {
|
|
268
|
+
controls: !0
|
|
269
|
+
} : {},
|
|
270
|
+
...e.loop === !0 ? {
|
|
271
|
+
loop: !0
|
|
272
|
+
} : {},
|
|
273
|
+
...e.playsInline === !0 ? {
|
|
274
|
+
playsInline: !0
|
|
275
|
+
} : {}
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function s() {
|
|
279
|
+
return {
|
|
280
|
+
...e.attributes,
|
|
281
|
+
...o()
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
return /* @__PURE__ */ n(
|
|
285
|
+
"video",
|
|
286
|
+
{
|
|
287
|
+
...s(),
|
|
288
|
+
preload: e.preload || "metadata",
|
|
289
|
+
style: {
|
|
290
|
+
width: "100%",
|
|
291
|
+
height: "100%",
|
|
292
|
+
...(v = e.attributes) == null ? void 0 : v.style,
|
|
293
|
+
objectFit: e.fit,
|
|
294
|
+
objectPosition: e.position,
|
|
295
|
+
// Hack to get object fit to work as expected and
|
|
296
|
+
// not have the video overflow
|
|
297
|
+
borderRadius: 1
|
|
298
|
+
},
|
|
299
|
+
src: e.video || "no-src",
|
|
300
|
+
poster: e.posterImage
|
|
301
|
+
}
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
function xe(e) {
|
|
305
|
+
const o = j(null), [s, v] = S(() => []), [a, m] = S(() => []), [x, k] = S(() => !1);
|
|
306
|
+
function f() {
|
|
307
|
+
if (!o.current || !o.current.getElementsByTagName)
|
|
308
|
+
return;
|
|
309
|
+
const c = o.current.getElementsByTagName("script");
|
|
310
|
+
for (let u = 0; u < c.length; u++) {
|
|
311
|
+
const h = c[u];
|
|
312
|
+
if (h.src && !s.includes(h.src)) {
|
|
313
|
+
s.push(h.src);
|
|
314
|
+
const E = document.createElement("script");
|
|
315
|
+
E.async = !0, E.src = h.src, document.head.appendChild(E);
|
|
316
|
+
} else if (O(h) && !a.includes(h.innerText))
|
|
317
|
+
try {
|
|
318
|
+
a.push(h.innerText), new Function(h.innerText)();
|
|
319
|
+
} catch (E) {
|
|
320
|
+
console.warn("`Embed`: Error running script:", E);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return y(() => {
|
|
325
|
+
o.current && !x && (k(!0), f());
|
|
326
|
+
}, [o.current, x]), /* @__PURE__ */ n(
|
|
327
|
+
"div",
|
|
328
|
+
{
|
|
329
|
+
className: "builder-embed",
|
|
330
|
+
ref: o,
|
|
331
|
+
dangerouslySetInnerHTML: { __html: e.content }
|
|
332
|
+
}
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
function ve(e) {
|
|
336
|
+
return /* @__PURE__ */ n(
|
|
337
|
+
"img",
|
|
338
|
+
{
|
|
339
|
+
style: {
|
|
340
|
+
objectFit: e.backgroundSize || "cover",
|
|
341
|
+
objectPosition: e.backgroundPosition || "center"
|
|
342
|
+
},
|
|
343
|
+
alt: e.altText,
|
|
344
|
+
src: e.imgSrc || e.image,
|
|
345
|
+
...e.attributes
|
|
346
|
+
},
|
|
347
|
+
I() && e.imgSrc || "default-key"
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
function ke(e) {
|
|
351
|
+
const o = j(null), [s, v] = S(() => []), [a, m] = S(() => []);
|
|
352
|
+
function x() {
|
|
353
|
+
if (o.current && o.current.getElementsByTagName && typeof window < "u") {
|
|
354
|
+
const k = o.current.getElementsByTagName("script");
|
|
355
|
+
for (let f = 0; f < k.length; f++) {
|
|
356
|
+
const c = k[f];
|
|
357
|
+
if (c.src) {
|
|
358
|
+
if (s.includes(c.src))
|
|
359
|
+
continue;
|
|
360
|
+
s.push(c.src);
|
|
361
|
+
const u = document.createElement("script");
|
|
362
|
+
u.async = !0, u.src = c.src, document.head.appendChild(u);
|
|
363
|
+
} else if (!c.type || [
|
|
364
|
+
"text/javascript",
|
|
365
|
+
"application/javascript",
|
|
366
|
+
"application/ecmascript"
|
|
367
|
+
].includes(c.type)) {
|
|
368
|
+
if (a.includes(c.innerText))
|
|
369
|
+
continue;
|
|
370
|
+
try {
|
|
371
|
+
a.push(c.innerText), new Function(c.innerText)();
|
|
372
|
+
} catch (u) {
|
|
373
|
+
console.warn("`CustomCode`: Error running script:", u);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
return y(() => {
|
|
380
|
+
x();
|
|
381
|
+
}, []), /* @__PURE__ */ n(
|
|
382
|
+
"div",
|
|
383
|
+
{
|
|
384
|
+
ref: o,
|
|
385
|
+
className: "builder-custom-code" + (e.replaceNodes ? " replace-nodes" : ""),
|
|
386
|
+
dangerouslySetInnerHTML: { __html: e.code }
|
|
387
|
+
}
|
|
388
|
+
);
|
|
389
|
+
}
|
|
390
|
+
const ae = te({
|
|
391
|
+
content: null,
|
|
392
|
+
context: {},
|
|
393
|
+
localState: void 0,
|
|
394
|
+
rootSetState() {
|
|
395
|
+
},
|
|
396
|
+
rootState: {},
|
|
397
|
+
apiKey: null,
|
|
398
|
+
apiVersion: void 0,
|
|
399
|
+
componentInfos: {},
|
|
400
|
+
inheritedStyles: {}
|
|
401
|
+
});
|
|
402
|
+
function ye(e) {
|
|
403
|
+
var L, M, q, z, K;
|
|
404
|
+
const o = j(null), [s, v] = S(
|
|
405
|
+
() => G(e.canTrack) ? e.canTrack : !0
|
|
406
|
+
), [a, m] = S(() => 0);
|
|
407
|
+
function x(t) {
|
|
408
|
+
var i, r, d, g, W;
|
|
409
|
+
const l = {
|
|
410
|
+
...e.builderContextSignal.content,
|
|
411
|
+
...t,
|
|
412
|
+
data: {
|
|
413
|
+
...(i = e.builderContextSignal.content) == null ? void 0 : i.data,
|
|
414
|
+
...t == null ? void 0 : t.data
|
|
415
|
+
},
|
|
416
|
+
meta: {
|
|
417
|
+
...(r = e.builderContextSignal.content) == null ? void 0 : r.meta,
|
|
418
|
+
...t == null ? void 0 : t.meta,
|
|
419
|
+
breakpoints: ((d = t == null ? void 0 : t.meta) == null ? void 0 : d.breakpoints) || ((W = (g = e.builderContextSignal.content) == null ? void 0 : g.meta) == null ? void 0 : W.breakpoints)
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
ne({
|
|
423
|
+
value: l,
|
|
424
|
+
key: l.id
|
|
425
|
+
}).then(() => {
|
|
426
|
+
J.refresh();
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
S(() => 0);
|
|
430
|
+
const [k, f] = S(
|
|
431
|
+
() => !1
|
|
432
|
+
);
|
|
433
|
+
function c(t) {
|
|
434
|
+
var i;
|
|
435
|
+
const { data: l } = t;
|
|
436
|
+
if (l)
|
|
437
|
+
switch (l.type) {
|
|
438
|
+
case "builder.configureSdk": {
|
|
439
|
+
const r = l.data, { breakpoints: d, contentId: g } = r;
|
|
440
|
+
if (!g || g !== ((i = e.builderContextSignal.content) == null ? void 0 : i.id))
|
|
441
|
+
return;
|
|
442
|
+
d && x({
|
|
443
|
+
meta: {
|
|
444
|
+
breakpoints: d
|
|
445
|
+
}
|
|
446
|
+
}), m(a + 1);
|
|
447
|
+
break;
|
|
448
|
+
}
|
|
449
|
+
case "builder.contentUpdate": {
|
|
450
|
+
const r = l.data, d = r.key || r.alias || r.entry || r.modelName, g = r.data;
|
|
451
|
+
d === e.model && (x(g), m(a + 1));
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
function u() {
|
|
457
|
+
var l, i;
|
|
458
|
+
const t = (i = (l = e.builderContextSignal.content) == null ? void 0 : l.data) == null ? void 0 : i.jsCode;
|
|
459
|
+
t && A({
|
|
460
|
+
code: t,
|
|
461
|
+
context: e.context || {},
|
|
462
|
+
localState: void 0,
|
|
463
|
+
rootState: e.builderContextSignal.rootState,
|
|
464
|
+
rootSetState: e.builderContextSignal.rootSetState
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
const [h, E] = S(() => ({})), [B, U] = S(() => !1);
|
|
468
|
+
function V(t) {
|
|
469
|
+
var l, i;
|
|
470
|
+
if (e.builderContextSignal.content) {
|
|
471
|
+
const r = (l = e.builderContextSignal.content) == null ? void 0 : l.testVariationId, d = (i = e.builderContextSignal.content) == null ? void 0 : i.id;
|
|
472
|
+
_({
|
|
473
|
+
type: "click",
|
|
474
|
+
canTrack: s,
|
|
475
|
+
contentId: d,
|
|
476
|
+
apiKey: e.apiKey,
|
|
477
|
+
variationId: r !== d ? r : void 0,
|
|
478
|
+
...$(t),
|
|
479
|
+
unique: !B
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
B || U(!0);
|
|
483
|
+
}
|
|
484
|
+
function D(t) {
|
|
485
|
+
return t.replace(
|
|
486
|
+
/{{([^}]+)}}/g,
|
|
487
|
+
(l, i) => A({
|
|
488
|
+
code: i,
|
|
489
|
+
context: e.context || {},
|
|
490
|
+
localState: void 0,
|
|
491
|
+
rootState: e.builderContextSignal.rootState,
|
|
492
|
+
rootSetState: e.builderContextSignal.rootSetState
|
|
493
|
+
})
|
|
494
|
+
);
|
|
495
|
+
}
|
|
496
|
+
function H({ url: t, key: l }) {
|
|
497
|
+
ee(t).then((i) => i.json()).then((i) => {
|
|
498
|
+
var d, g;
|
|
499
|
+
const r = {
|
|
500
|
+
...e.builderContextSignal.rootState,
|
|
501
|
+
[l]: i
|
|
502
|
+
};
|
|
503
|
+
(g = (d = e.builderContextSignal).rootSetState) == null || g.call(d, r), h[l] = !0;
|
|
504
|
+
}).catch((i) => {
|
|
505
|
+
console.error("error fetching dynamic data", t, i);
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
function F() {
|
|
509
|
+
var l, i;
|
|
510
|
+
const t = ((i = (l = e.builderContextSignal.content) == null ? void 0 : l.data) == null ? void 0 : i.httpRequests) ?? {};
|
|
511
|
+
Object.entries(t).forEach(([r, d]) => {
|
|
512
|
+
if (d && (!h[r] || I())) {
|
|
513
|
+
const g = D(d);
|
|
514
|
+
H({
|
|
515
|
+
url: g,
|
|
516
|
+
key: r
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
function R() {
|
|
522
|
+
I() && window.dispatchEvent(
|
|
523
|
+
new CustomEvent(
|
|
524
|
+
"builder:component:stateChange",
|
|
525
|
+
{
|
|
526
|
+
detail: {
|
|
527
|
+
state: p(e.builderContextSignal.rootState),
|
|
528
|
+
ref: {
|
|
529
|
+
name: e.model
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
)
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
const J = ie();
|
|
537
|
+
return y(() => {
|
|
538
|
+
var t, l;
|
|
539
|
+
if (e.apiKey || Q.error(
|
|
540
|
+
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
541
|
+
), T()) {
|
|
542
|
+
if (I() && (m(a + 1), window.addEventListener("message", c), X(), Y({
|
|
543
|
+
...e.locale ? {
|
|
544
|
+
locale: e.locale
|
|
545
|
+
} : {},
|
|
546
|
+
...e.includeRefs ? {
|
|
547
|
+
includeRefs: e.includeRefs
|
|
548
|
+
} : {},
|
|
549
|
+
...e.enrich ? {
|
|
550
|
+
enrich: e.enrich
|
|
551
|
+
} : {}
|
|
552
|
+
}), Object.values(
|
|
553
|
+
e.builderContextSignal.componentInfos
|
|
554
|
+
).forEach((i) => {
|
|
555
|
+
var d;
|
|
556
|
+
const r = Z(i);
|
|
557
|
+
(d = window.parent) == null || d.postMessage(r, "*");
|
|
558
|
+
}), window.addEventListener(
|
|
559
|
+
"builder:component:stateChangeListenerActivated",
|
|
560
|
+
R
|
|
561
|
+
)), e.builderContextSignal.content) {
|
|
562
|
+
const i = (t = e.builderContextSignal.content) == null ? void 0 : t.testVariationId, r = (l = e.builderContextSignal.content) == null ? void 0 : l.id;
|
|
563
|
+
_({
|
|
564
|
+
type: "impression",
|
|
565
|
+
canTrack: s,
|
|
566
|
+
contentId: r,
|
|
567
|
+
apiKey: e.apiKey,
|
|
568
|
+
variationId: i !== r ? i : void 0
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
u(), F(), R();
|
|
572
|
+
}
|
|
573
|
+
}, []), y(() => {
|
|
574
|
+
}, [e.content]), y(() => {
|
|
575
|
+
T() && (window.removeEventListener("message", c), window.addEventListener("message", c));
|
|
576
|
+
}, [k]), y(() => {
|
|
577
|
+
u();
|
|
578
|
+
}, [
|
|
579
|
+
(M = (L = e.builderContextSignal.content) == null ? void 0 : L.data) == null ? void 0 : M.jsCode,
|
|
580
|
+
e.builderContextSignal.rootState
|
|
581
|
+
]), y(() => {
|
|
582
|
+
F();
|
|
583
|
+
}, [(z = (q = e.builderContextSignal.content) == null ? void 0 : q.data) == null ? void 0 : z.httpRequests]), y(() => {
|
|
584
|
+
R();
|
|
585
|
+
}, [e.builderContextSignal.rootState]), y(() => () => {
|
|
586
|
+
T() && (window.removeEventListener("message", c), window.removeEventListener(
|
|
587
|
+
"builder:component:stateChangeListenerActivated",
|
|
588
|
+
R
|
|
589
|
+
));
|
|
590
|
+
}, []), /* @__PURE__ */ n(ae.Provider, { value: e.builderContextSignal, children: e.builderContextSignal.content ? /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(
|
|
591
|
+
"div",
|
|
592
|
+
{
|
|
593
|
+
ref: o,
|
|
594
|
+
onClick: (t) => V(t),
|
|
595
|
+
"builder-content-id": (K = e.builderContextSignal.content) == null ? void 0 : K.id,
|
|
596
|
+
"builder-model": e.model,
|
|
597
|
+
...e.showContent ? {} : {
|
|
598
|
+
hidden: !0,
|
|
599
|
+
"aria-hidden": !0
|
|
600
|
+
},
|
|
601
|
+
className: e.classNameProp,
|
|
602
|
+
children: e.children
|
|
603
|
+
},
|
|
604
|
+
a
|
|
605
|
+
) }) : null });
|
|
606
|
+
}
|
|
607
|
+
export {
|
|
608
|
+
me as B,
|
|
609
|
+
ke as C,
|
|
610
|
+
xe as E,
|
|
611
|
+
fe as F,
|
|
612
|
+
ue as I,
|
|
613
|
+
he as S,
|
|
614
|
+
Se as V,
|
|
615
|
+
be as a,
|
|
616
|
+
se as b,
|
|
617
|
+
ge as c,
|
|
618
|
+
ve as d,
|
|
619
|
+
ye as e
|
|
620
|
+
};
|