@builder.io/sdk-react 3.0.5 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/blocks-exports.cjs +166 -29
- package/lib/browser/blocks-exports.mjs +1179 -765
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +17 -16
- package/lib/browser/server-entry-a1c64831.cjs +2 -0
- package/lib/browser/{server-entry-785c0408.js → server-entry-df5e89e5.js} +279 -237
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-cd6e0363.js → accordion-289f3464.js} +1 -1
- package/lib/edge/{accordion-190c4426.cjs → accordion-fbfb71f4.cjs} +1 -1
- package/lib/edge/{blocks-766e8d45.cjs → blocks-459a090b.cjs} +10 -10
- package/lib/edge/{blocks-fe2d7c1a.js → blocks-582a7fd7.js} +87 -87
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +13 -12
- package/lib/edge/{button-6a27481c.js → button-9b112da6.js} +2 -2
- package/lib/edge/{button-694fcd4f.cjs → button-da357144.cjs} +1 -1
- package/lib/edge/{columns-b38bf0f7.cjs → columns-a211113f.cjs} +1 -1
- package/lib/edge/{columns-90e6407e.js → columns-aba58dda.js} +3 -3
- package/lib/edge/{content-variants-cbb89349.js → content-variants-08f4371c.js} +165 -124
- package/lib/edge/content-variants-4b5899b5.cjs +134 -0
- package/lib/edge/dynamic-blocks-exports.cjs +3 -1
- package/lib/edge/dynamic-blocks-exports.mjs +5 -2
- package/lib/edge/{form-16bbf874.js → form-4d4553c2.js} +3 -3
- package/lib/edge/{form-547645eb.cjs → form-e3a3afd4.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-8b719c6b.js → get-class-prop-name-38c2baca.js} +1 -1
- package/lib/edge/{get-class-prop-name-58770197.cjs → get-class-prop-name-fbe244e3.cjs} +1 -1
- package/lib/edge/{img-8859c851.cjs → img-8d549af8.cjs} +1 -1
- package/lib/edge/{img-d3351743.js → img-c49066fa.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +18 -17
- package/lib/edge/{input-4fe0fc6d.cjs → input-1ae3842f.cjs} +1 -1
- package/lib/edge/{input-24c601b4.js → input-e7301f4e.js} +1 -1
- package/lib/edge/personalization-container-035be6ba.js +384 -0
- package/lib/edge/personalization-container-25cd8b5e.cjs +138 -0
- package/lib/edge/{select-af05377b.js → select-4187b229.js} +1 -1
- package/lib/edge/{select-c73bd418.cjs → select-64fdaa79.cjs} +1 -1
- package/lib/edge/server-entry-2ef4e66a.cjs +2 -0
- package/lib/edge/{server-entry-67bfc740.js → server-entry-61fca4f7.js} +322 -280
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-759c8dd9.cjs → slot-995f63c2.cjs} +1 -1
- package/lib/edge/{slot-32a4df0c.js → slot-d6c46a42.js} +3 -3
- package/lib/edge/{symbol-8d63aa7d.cjs → symbol-498daa97.cjs} +1 -1
- package/lib/edge/{symbol-50360a37.js → symbol-623dc717.js} +2 -2
- package/lib/edge/{tabs-6535c934.js → tabs-12ba41b1.js} +3 -3
- package/lib/edge/{tabs-fc6c1700.cjs → tabs-d39499cd.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +168 -31
- package/lib/node/blocks-exports.mjs +1292 -878
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +17 -16
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/node/{server-entry-ffc70868.js → server-entry-27d9d31e.js} +279 -237
- package/lib/node/server-entry-98ebff74.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-2cea7252.js → setIvm-2dde9074.js} +1 -1
- package/lib/node/{setIvm-4ce0db03.cjs → setIvm-784fe19f.cjs} +1 -1
- package/lib/node/setIvm.cjs +1 -1
- package/lib/node/setIvm.mjs +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-c0d50009.js → should-force-browser-runtime-in-node-80f081c8.js} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-d3e6df07.cjs → should-force-browser-runtime-in-node-cd6baa94.cjs} +1 -1
- package/package.json +1 -1
- package/types/blocks/personalization-container/component-info.d.ts +2 -0
- package/types/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -0
- package/types/blocks/personalization-container/helpers.d.ts +27 -0
- package/types/blocks/personalization-container/index.d.ts +1 -0
- package/types/blocks/personalization-container/personalization-container.d.ts +4 -0
- package/types/blocks/personalization-container/personalization-container.types.d.ts +14 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/helpers/user-attributes.d.ts +17 -0
- package/types/index-helpers/blocks-exports.d.ts +1 -0
- package/types/types/input.d.ts +1 -0
- package/lib/browser/server-entry-101d66b8.cjs +0 -2
- package/lib/edge/content-variants-4e385c19.cjs +0 -134
- package/lib/edge/server-entry-3c7fa63a.cjs +0 -2
- package/lib/node/server-entry-95273908.cjs +0 -2
|
@@ -1,38 +1,120 @@
|
|
|
1
|
-
|
|
1
|
+
function c() {
|
|
2
|
+
return typeof window != "undefined" && typeof document != "undefined";
|
|
3
|
+
}
|
|
4
|
+
const I = "[Builder.io]: ", f = {
|
|
5
|
+
log: (...t) => console.log(I, ...t),
|
|
6
|
+
error: (...t) => console.error(I, ...t),
|
|
7
|
+
warn: (...t) => console.warn(I, ...t),
|
|
8
|
+
debug: (...t) => console.debug(I, ...t)
|
|
9
|
+
}, y = (t) => t != null, ot = (t) => {
|
|
10
|
+
if (t === "localhost" || t === "127.0.0.1")
|
|
11
|
+
return t;
|
|
12
|
+
const e = t.split(".");
|
|
13
|
+
return e.length > 2 ? e.slice(1).join(".") : t;
|
|
14
|
+
}, O = ({
|
|
15
|
+
name: t,
|
|
16
|
+
canTrack: e
|
|
17
|
+
}) => {
|
|
18
|
+
var n;
|
|
19
|
+
try {
|
|
20
|
+
return e ? (n = document.cookie.split("; ").find((r) => r.startsWith(`${t}=`))) == null ? void 0 : n.split("=")[1] : void 0;
|
|
21
|
+
} catch (r) {
|
|
22
|
+
f.warn("[COOKIE] GET error: ", (r == null ? void 0 : r.message) || r);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
}, M = async (t) => O(t), it = (t) => t.map(([e, n]) => n ? `${e}=${n}` : e).filter(y).join("; "), at = [["secure", ""], ["SameSite", "None"]], ct = ({
|
|
26
|
+
name: t,
|
|
27
|
+
value: e,
|
|
28
|
+
expires: n
|
|
29
|
+
}) => {
|
|
30
|
+
const s = (c() ? location.protocol === "https:" : !0) ? at : [[]], o = n ? [["expires", n.toUTCString()]] : [[]], i = [[t, e], ...o, ["path", "/"], ["domain", ot(window.location.hostname)], ...s];
|
|
31
|
+
return it(i);
|
|
32
|
+
}, P = async ({
|
|
33
|
+
name: t,
|
|
34
|
+
value: e,
|
|
35
|
+
expires: n,
|
|
36
|
+
canTrack: r
|
|
37
|
+
}) => {
|
|
38
|
+
try {
|
|
39
|
+
if (!r)
|
|
40
|
+
return;
|
|
41
|
+
const s = ct({
|
|
42
|
+
name: t,
|
|
43
|
+
value: e,
|
|
44
|
+
expires: n
|
|
45
|
+
});
|
|
46
|
+
document.cookie = s;
|
|
47
|
+
} catch (s) {
|
|
48
|
+
f.warn("[COOKIE] SET error: ", (s == null ? void 0 : s.message) || s);
|
|
49
|
+
}
|
|
50
|
+
}, B = "builder.userAttributes";
|
|
51
|
+
function ut() {
|
|
52
|
+
let t = !0;
|
|
53
|
+
const e = /* @__PURE__ */ new Set();
|
|
54
|
+
return {
|
|
55
|
+
setUserAttributes(n) {
|
|
56
|
+
if (!c())
|
|
57
|
+
return;
|
|
58
|
+
const r = {
|
|
59
|
+
...this.getUserAttributes(),
|
|
60
|
+
...n
|
|
61
|
+
};
|
|
62
|
+
P({
|
|
63
|
+
name: B,
|
|
64
|
+
value: JSON.stringify(r),
|
|
65
|
+
canTrack: t
|
|
66
|
+
}), e.forEach((s) => s(r));
|
|
67
|
+
},
|
|
68
|
+
getUserAttributes() {
|
|
69
|
+
return c() ? JSON.parse(O({
|
|
70
|
+
name: B,
|
|
71
|
+
canTrack: t
|
|
72
|
+
}) || "{}") : {};
|
|
73
|
+
},
|
|
74
|
+
subscribeOnUserAttributesChange(n) {
|
|
75
|
+
return e.add(n), () => {
|
|
76
|
+
e.delete(n);
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
setCanTrack(n) {
|
|
80
|
+
t = n;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const K = ut(), ee = (t) => {
|
|
85
|
+
K.setUserAttributes(t);
|
|
86
|
+
}, v = "react", lt = (t) => {
|
|
2
87
|
const e = {};
|
|
3
88
|
return t.forEach((n, r) => {
|
|
4
89
|
e[r] = n;
|
|
5
90
|
}), e;
|
|
6
|
-
},
|
|
7
|
-
function
|
|
8
|
-
return typeof window != "undefined" && typeof document != "undefined";
|
|
9
|
-
}
|
|
10
|
-
function ot() {
|
|
91
|
+
}, j = (t) => t instanceof URLSearchParams ? lt(t) : t, W = (t) => typeof t == "string" ? t : t instanceof URLSearchParams ? t.toString() : new URLSearchParams(t).toString();
|
|
92
|
+
function dt() {
|
|
11
93
|
return c() && window.self !== window.top;
|
|
12
94
|
}
|
|
13
|
-
function
|
|
14
|
-
return
|
|
15
|
-
|
|
95
|
+
function ft(t) {
|
|
96
|
+
return dt() && // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
|
|
97
|
+
W(t || window.location.search).indexOf("builder.frameEditing=") !== -1;
|
|
16
98
|
}
|
|
17
|
-
function
|
|
99
|
+
function ne(t) {
|
|
18
100
|
const e = t || (c() ? window.location.search : void 0);
|
|
19
|
-
return e ?
|
|
101
|
+
return e ? W(e).indexOf("builder.preview=") !== -1 : !1;
|
|
20
102
|
}
|
|
21
|
-
const
|
|
103
|
+
const re = (t) => ({
|
|
22
104
|
type: "builder.registerComponent",
|
|
23
|
-
data:
|
|
24
|
-
}),
|
|
105
|
+
data: _(t)
|
|
106
|
+
}), ht = (t) => {
|
|
25
107
|
const e = t.toString().trim(), n = /^[a-zA-Z0-9_]+\s*=>/i.test(e);
|
|
26
108
|
return `return (${!e.startsWith("function") && !e.startsWith("async") && !e.startsWith("(") && !n ? "function " : ""}${e}).apply(this, arguments)`;
|
|
27
109
|
};
|
|
28
|
-
function
|
|
29
|
-
return JSON.parse(JSON.stringify(t, (e, n) => typeof n == "function" ?
|
|
110
|
+
function _(t) {
|
|
111
|
+
return JSON.parse(JSON.stringify(t, (e, n) => typeof n == "function" ? ht(n) : n));
|
|
30
112
|
}
|
|
31
|
-
const
|
|
32
|
-
function
|
|
33
|
-
t === "plugin" && (e =
|
|
34
|
-
let n =
|
|
35
|
-
if (n || (n =
|
|
113
|
+
const L = {};
|
|
114
|
+
function gt(t, e) {
|
|
115
|
+
t === "plugin" && (e = _(e));
|
|
116
|
+
let n = L[t];
|
|
117
|
+
if (n || (n = L[t] = []), n.push(e), c()) {
|
|
36
118
|
const r = {
|
|
37
119
|
type: "builder.register",
|
|
38
120
|
data: {
|
|
@@ -42,182 +124,136 @@ function at(t, e) {
|
|
|
42
124
|
};
|
|
43
125
|
try {
|
|
44
126
|
parent.postMessage(r, "*"), parent !== window && window.postMessage(r, "*");
|
|
45
|
-
} catch (
|
|
46
|
-
console.debug("Could not postmessage",
|
|
127
|
+
} catch (s) {
|
|
128
|
+
console.debug("Could not postmessage", s);
|
|
47
129
|
}
|
|
48
130
|
}
|
|
49
131
|
}
|
|
50
|
-
const
|
|
51
|
-
function
|
|
132
|
+
const V = {};
|
|
133
|
+
function se(t) {
|
|
52
134
|
if (c()) {
|
|
53
|
-
Object.assign(
|
|
135
|
+
Object.assign(V, t);
|
|
54
136
|
const e = {
|
|
55
137
|
type: "builder.settingsChange",
|
|
56
|
-
data:
|
|
138
|
+
data: V
|
|
57
139
|
};
|
|
58
140
|
parent.postMessage(e, "*");
|
|
59
141
|
}
|
|
60
142
|
}
|
|
61
|
-
const
|
|
143
|
+
const N = "builder.", pt = "options.", $ = (t) => {
|
|
62
144
|
if (!t)
|
|
63
145
|
return {};
|
|
64
|
-
const e =
|
|
146
|
+
const e = j(t), n = {};
|
|
65
147
|
return Object.keys(e).forEach((r) => {
|
|
66
|
-
if (r.startsWith(
|
|
67
|
-
const
|
|
68
|
-
n[
|
|
148
|
+
if (r.startsWith(N)) {
|
|
149
|
+
const s = r.replace(N, "").replace(pt, "");
|
|
150
|
+
n[s] = e[r];
|
|
69
151
|
}
|
|
70
152
|
}), n;
|
|
71
|
-
},
|
|
153
|
+
}, mt = () => {
|
|
72
154
|
if (!c())
|
|
73
155
|
return {};
|
|
74
156
|
const t = new URLSearchParams(window.location.search);
|
|
75
|
-
return
|
|
76
|
-
},
|
|
77
|
-
log: (...t) => console.log(I, ...t),
|
|
78
|
-
error: (...t) => console.error(I, ...t),
|
|
79
|
-
warn: (...t) => console.warn(I, ...t),
|
|
80
|
-
debug: (...t) => console.debug(I, ...t)
|
|
81
|
-
}, K = "3.0.5", j = () => ({
|
|
157
|
+
return $(t);
|
|
158
|
+
}, G = "3.0.6", J = () => ({
|
|
82
159
|
"X-Builder-SDK": v,
|
|
83
160
|
"X-Builder-SDK-GEN": "2",
|
|
84
|
-
"X-Builder-SDK-Version":
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
return t;
|
|
88
|
-
const e = t.split(".");
|
|
89
|
-
return e.length > 2 ? e.slice(1).join(".") : t;
|
|
90
|
-
}, W = ({
|
|
91
|
-
name: t,
|
|
92
|
-
canTrack: e
|
|
93
|
-
}) => {
|
|
94
|
-
var n;
|
|
95
|
-
try {
|
|
96
|
-
return e ? (n = document.cookie.split("; ").find((r) => r.startsWith(`${t}=`))) == null ? void 0 : n.split("=")[1] : void 0;
|
|
97
|
-
} catch (r) {
|
|
98
|
-
f.warn("[COOKIE] GET error: ", (r == null ? void 0 : r.message) || r);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
}, $ = async (t) => W(t), dt = (t) => t.map(([e, n]) => n ? `${e}=${n}` : e).filter(y).join("; "), ft = [["secure", ""], ["SameSite", "None"]], ht = ({
|
|
102
|
-
name: t,
|
|
103
|
-
value: e,
|
|
104
|
-
expires: n
|
|
105
|
-
}) => {
|
|
106
|
-
const o = (c() ? location.protocol === "https:" : !0) ? ft : [[]], s = n ? [["expires", n.toUTCString()]] : [[]], i = [[t, e], ...s, ["path", "/"], ["domain", lt(window.location.hostname)], ...o];
|
|
107
|
-
return dt(i);
|
|
108
|
-
}, _ = async ({
|
|
109
|
-
name: t,
|
|
110
|
-
value: e,
|
|
111
|
-
expires: n,
|
|
112
|
-
canTrack: r
|
|
113
|
-
}) => {
|
|
114
|
-
try {
|
|
115
|
-
if (!r)
|
|
116
|
-
return;
|
|
117
|
-
const o = ht({
|
|
118
|
-
name: t,
|
|
119
|
-
value: e,
|
|
120
|
-
expires: n
|
|
121
|
-
});
|
|
122
|
-
document.cookie = o;
|
|
123
|
-
} catch (o) {
|
|
124
|
-
f.warn("[COOKIE] SET error: ", (o == null ? void 0 : o.message) || o);
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
function gt() {
|
|
161
|
+
"X-Builder-SDK-Version": G
|
|
162
|
+
});
|
|
163
|
+
function yt() {
|
|
128
164
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
|
|
129
165
|
const e = Math.random() * 16 | 0;
|
|
130
166
|
return (t == "x" ? e : e & 3 | 8).toString(16);
|
|
131
167
|
});
|
|
132
168
|
}
|
|
133
|
-
function
|
|
134
|
-
return
|
|
169
|
+
function z() {
|
|
170
|
+
return yt().replace(/-/g, "");
|
|
135
171
|
}
|
|
136
|
-
const H = "builderSessionId",
|
|
172
|
+
const H = "builderSessionId", bt = async ({
|
|
137
173
|
canTrack: t
|
|
138
174
|
}) => {
|
|
139
175
|
if (!t)
|
|
140
176
|
return;
|
|
141
|
-
const e = await
|
|
177
|
+
const e = await M({
|
|
142
178
|
name: H,
|
|
143
179
|
canTrack: t
|
|
144
180
|
});
|
|
145
181
|
if (y(e))
|
|
146
182
|
return e;
|
|
147
183
|
{
|
|
148
|
-
const n =
|
|
149
|
-
return
|
|
184
|
+
const n = St();
|
|
185
|
+
return wt({
|
|
150
186
|
id: n,
|
|
151
187
|
canTrack: t
|
|
152
188
|
}), n;
|
|
153
189
|
}
|
|
154
|
-
},
|
|
190
|
+
}, St = () => z(), wt = ({
|
|
155
191
|
id: t,
|
|
156
192
|
canTrack: e
|
|
157
|
-
}) =>
|
|
193
|
+
}) => P({
|
|
158
194
|
name: H,
|
|
159
195
|
value: t,
|
|
160
196
|
canTrack: e
|
|
161
|
-
}),
|
|
197
|
+
}), X = () => c() && typeof localStorage != "undefined" ? localStorage : void 0, vt = ({
|
|
162
198
|
key: t,
|
|
163
199
|
canTrack: e
|
|
164
200
|
}) => {
|
|
165
201
|
var n;
|
|
166
202
|
try {
|
|
167
|
-
return e ? (n =
|
|
203
|
+
return e ? (n = X()) == null ? void 0 : n.getItem(t) : void 0;
|
|
168
204
|
} catch (r) {
|
|
169
205
|
console.debug("[LocalStorage] GET error: ", r);
|
|
170
206
|
return;
|
|
171
207
|
}
|
|
172
|
-
},
|
|
208
|
+
}, It = ({
|
|
173
209
|
key: t,
|
|
174
210
|
canTrack: e,
|
|
175
211
|
value: n
|
|
176
212
|
}) => {
|
|
177
213
|
var r;
|
|
178
214
|
try {
|
|
179
|
-
e && ((r =
|
|
180
|
-
} catch (
|
|
181
|
-
console.debug("[LocalStorage] SET error: ",
|
|
215
|
+
e && ((r = X()) == null || r.setItem(t, n));
|
|
216
|
+
} catch (s) {
|
|
217
|
+
console.debug("[LocalStorage] SET error: ", s);
|
|
182
218
|
}
|
|
183
|
-
},
|
|
219
|
+
}, Q = "builderVisitorId", kt = ({
|
|
184
220
|
canTrack: t
|
|
185
221
|
}) => {
|
|
186
222
|
if (!t)
|
|
187
223
|
return;
|
|
188
|
-
const e =
|
|
189
|
-
key:
|
|
224
|
+
const e = vt({
|
|
225
|
+
key: Q,
|
|
190
226
|
canTrack: t
|
|
191
227
|
});
|
|
192
228
|
if (y(e))
|
|
193
229
|
return e;
|
|
194
230
|
{
|
|
195
|
-
const n =
|
|
196
|
-
return
|
|
231
|
+
const n = At();
|
|
232
|
+
return Et({
|
|
197
233
|
id: n,
|
|
198
234
|
canTrack: t
|
|
199
235
|
}), n;
|
|
200
236
|
}
|
|
201
|
-
},
|
|
237
|
+
}, At = () => z(), Et = ({
|
|
202
238
|
id: t,
|
|
203
239
|
canTrack: e
|
|
204
|
-
}) =>
|
|
205
|
-
key:
|
|
240
|
+
}) => It({
|
|
241
|
+
key: Q,
|
|
206
242
|
value: t,
|
|
207
243
|
canTrack: e
|
|
208
244
|
});
|
|
209
|
-
function
|
|
245
|
+
function Ot(t) {
|
|
210
246
|
var e;
|
|
211
247
|
typeof process != "undefined" && ((e = process.env) != null && e.DEBUG) && String(process.env.DEBUG) == "true" && f.log(t);
|
|
212
248
|
}
|
|
213
|
-
const
|
|
249
|
+
const Pt = () => {
|
|
214
250
|
if (c()) {
|
|
215
251
|
const t = new URL(location.href);
|
|
216
252
|
return t.pathname === "" && (t.pathname = "/"), t;
|
|
217
253
|
} else
|
|
218
254
|
return console.warn("Cannot get location for tracking in non-browser environment"), null;
|
|
219
|
-
},
|
|
220
|
-
const t =
|
|
255
|
+
}, Ct = () => typeof navigator == "object" && navigator.userAgent || "", Ut = () => {
|
|
256
|
+
const t = Ct(), e = {
|
|
221
257
|
Android() {
|
|
222
258
|
return t.match(/Android/i);
|
|
223
259
|
},
|
|
@@ -236,13 +272,13 @@ const Et = () => {
|
|
|
236
272
|
any() {
|
|
237
273
|
return e.Android() || e.BlackBerry() || e.iOS() || e.Opera() || e.Windows() || v === "reactNative";
|
|
238
274
|
}
|
|
239
|
-
}, n = t.match(/Tablet|iPad/i), r =
|
|
275
|
+
}, n = t.match(/Tablet|iPad/i), r = Pt();
|
|
240
276
|
return {
|
|
241
277
|
urlPath: r == null ? void 0 : r.pathname,
|
|
242
278
|
host: (r == null ? void 0 : r.host) || (r == null ? void 0 : r.hostname),
|
|
243
279
|
device: n ? "tablet" : e.any() ? "mobile" : "desktop"
|
|
244
280
|
};
|
|
245
|
-
},
|
|
281
|
+
}, Tt = async ({
|
|
246
282
|
canTrack: t
|
|
247
283
|
}) => {
|
|
248
284
|
if (!t)
|
|
@@ -250,37 +286,37 @@ const Et = () => {
|
|
|
250
286
|
visitorId: void 0,
|
|
251
287
|
sessionId: void 0
|
|
252
288
|
};
|
|
253
|
-
const e = await
|
|
289
|
+
const e = await bt({
|
|
254
290
|
canTrack: t
|
|
255
|
-
}), n =
|
|
291
|
+
}), n = kt({
|
|
256
292
|
canTrack: t
|
|
257
293
|
});
|
|
258
294
|
return {
|
|
259
295
|
sessionId: e,
|
|
260
296
|
visitorId: n
|
|
261
297
|
};
|
|
262
|
-
},
|
|
298
|
+
}, xt = async ({
|
|
263
299
|
type: t,
|
|
264
300
|
canTrack: e,
|
|
265
301
|
apiKey: n,
|
|
266
302
|
metadata: r,
|
|
267
|
-
...
|
|
303
|
+
...s
|
|
268
304
|
}) => ({
|
|
269
305
|
type: t,
|
|
270
306
|
data: {
|
|
271
|
-
...
|
|
307
|
+
...s,
|
|
272
308
|
metadata: {
|
|
273
309
|
url: location.href,
|
|
274
310
|
...r
|
|
275
311
|
},
|
|
276
|
-
...await
|
|
312
|
+
...await Tt({
|
|
277
313
|
canTrack: e
|
|
278
314
|
}),
|
|
279
|
-
userAttributes:
|
|
315
|
+
userAttributes: Ut(),
|
|
280
316
|
ownerId: n
|
|
281
317
|
}
|
|
282
318
|
});
|
|
283
|
-
async function
|
|
319
|
+
async function Rt({
|
|
284
320
|
apiHost: t,
|
|
285
321
|
...e
|
|
286
322
|
}) {
|
|
@@ -288,35 +324,35 @@ async function xt({
|
|
|
288
324
|
f.error("Missing API key for track call. Please provide your API key.");
|
|
289
325
|
return;
|
|
290
326
|
}
|
|
291
|
-
if (!e.canTrack ||
|
|
327
|
+
if (!e.canTrack || ft() || !(c() || v === "reactNative"))
|
|
292
328
|
return;
|
|
293
329
|
const r = `${t || "https://cdn.builder.io"}/api/v1/track`;
|
|
294
|
-
return
|
|
330
|
+
return Ot(r), fetch(r, {
|
|
295
331
|
method: "POST",
|
|
296
332
|
body: JSON.stringify({
|
|
297
|
-
events: [await
|
|
333
|
+
events: [await xt(e)]
|
|
298
334
|
}),
|
|
299
335
|
headers: {
|
|
300
336
|
"content-type": "application/json",
|
|
301
|
-
...
|
|
337
|
+
...J()
|
|
302
338
|
},
|
|
303
339
|
mode: "cors"
|
|
304
|
-
}).catch((
|
|
305
|
-
console.error("Failed to track: ",
|
|
340
|
+
}).catch((s) => {
|
|
341
|
+
console.error("Failed to track: ", s);
|
|
306
342
|
});
|
|
307
343
|
}
|
|
308
|
-
const
|
|
344
|
+
const oe = (t) => Rt({
|
|
309
345
|
...t,
|
|
310
346
|
canTrack: !0
|
|
311
|
-
}),
|
|
312
|
-
function
|
|
347
|
+
}), Bt = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
348
|
+
function Y(t, e) {
|
|
313
349
|
if (!e.origin.startsWith("http") && !e.origin.startsWith("https"))
|
|
314
350
|
return !1;
|
|
315
351
|
const n = new URL(e.origin), r = n.hostname;
|
|
316
|
-
return (t ||
|
|
352
|
+
return (t || Bt).findIndex((s) => s.startsWith("*.") ? r.endsWith(s.slice(1)) : s === r) > -1;
|
|
317
353
|
}
|
|
318
|
-
const
|
|
319
|
-
|
|
354
|
+
const ie = () => {
|
|
355
|
+
gt("insertMenu", {
|
|
320
356
|
name: "_default",
|
|
321
357
|
default: !0,
|
|
322
358
|
items: [{
|
|
@@ -338,19 +374,20 @@ const ne = () => {
|
|
|
338
374
|
}]
|
|
339
375
|
});
|
|
340
376
|
};
|
|
341
|
-
let
|
|
342
|
-
const
|
|
377
|
+
let F = !1;
|
|
378
|
+
const Lt = (t = {}) => {
|
|
343
379
|
var e, n;
|
|
344
|
-
|
|
380
|
+
F || (F = !0, c() && ((e = window.parent) == null || e.postMessage({
|
|
345
381
|
type: "builder.sdkInfo",
|
|
346
382
|
data: {
|
|
347
383
|
target: v,
|
|
348
|
-
version:
|
|
384
|
+
version: G,
|
|
349
385
|
supportsPatchUpdates: !1,
|
|
350
386
|
// Supports builder-model="..." attribute which is needed to
|
|
351
387
|
// scope our '+ add block' button styling
|
|
352
388
|
supportsAddBlockScoping: !0,
|
|
353
|
-
supportsCustomBreakpoints: !0
|
|
389
|
+
supportsCustomBreakpoints: !0,
|
|
390
|
+
blockLevelPersonalization: !0
|
|
354
391
|
}
|
|
355
392
|
}, "*"), (n = window.parent) == null || n.postMessage({
|
|
356
393
|
type: "builder.updateContent",
|
|
@@ -358,23 +395,23 @@ const Ut = (t = {}) => {
|
|
|
358
395
|
options: t
|
|
359
396
|
}
|
|
360
397
|
}, "*"), window.addEventListener("message", (r) => {
|
|
361
|
-
var
|
|
362
|
-
if (!
|
|
398
|
+
var o, i;
|
|
399
|
+
if (!Y(t.trustedHosts, r))
|
|
363
400
|
return;
|
|
364
401
|
const {
|
|
365
|
-
data:
|
|
402
|
+
data: s
|
|
366
403
|
} = r;
|
|
367
|
-
if (
|
|
368
|
-
switch (
|
|
404
|
+
if (s != null && s.type)
|
|
405
|
+
switch (s.type) {
|
|
369
406
|
case "builder.evaluate": {
|
|
370
|
-
const u =
|
|
407
|
+
const u = s.data.text, b = s.data.arguments || [], p = s.data.id, k = new Function(u);
|
|
371
408
|
let l, h = null;
|
|
372
409
|
try {
|
|
373
|
-
l = k.apply(null,
|
|
410
|
+
l = k.apply(null, b);
|
|
374
411
|
} catch (g) {
|
|
375
412
|
h = g;
|
|
376
413
|
}
|
|
377
|
-
h ? (
|
|
414
|
+
h ? (o = window.parent) == null || o.postMessage({
|
|
378
415
|
type: "builder.evaluateError",
|
|
379
416
|
data: {
|
|
380
417
|
id: p,
|
|
@@ -400,38 +437,38 @@ const Ut = (t = {}) => {
|
|
|
400
437
|
}
|
|
401
438
|
}
|
|
402
439
|
})));
|
|
403
|
-
},
|
|
440
|
+
}, Vt = ({
|
|
404
441
|
model: t,
|
|
405
442
|
trustedHosts: e,
|
|
406
443
|
callbacks: n
|
|
407
444
|
}) => (r) => {
|
|
408
|
-
if (!
|
|
445
|
+
if (!Y(e, r))
|
|
409
446
|
return;
|
|
410
447
|
const {
|
|
411
|
-
data:
|
|
448
|
+
data: s
|
|
412
449
|
} = r;
|
|
413
|
-
if (
|
|
414
|
-
switch (
|
|
450
|
+
if (s)
|
|
451
|
+
switch (s.type) {
|
|
415
452
|
case "builder.configureSdk": {
|
|
416
|
-
n.configureSdk(
|
|
453
|
+
n.configureSdk(s.data);
|
|
417
454
|
break;
|
|
418
455
|
}
|
|
419
456
|
case "builder.triggerAnimation": {
|
|
420
|
-
n.animation(
|
|
457
|
+
n.animation(s.data);
|
|
421
458
|
break;
|
|
422
459
|
}
|
|
423
460
|
case "builder.contentUpdate": {
|
|
424
|
-
const
|
|
461
|
+
const o = s.data, i = o.key || o.alias || o.entry || o.modelName, u = o.data;
|
|
425
462
|
i === t && n.contentUpdate(u);
|
|
426
463
|
break;
|
|
427
464
|
}
|
|
428
465
|
}
|
|
429
|
-
},
|
|
466
|
+
}, ae = (t, e, n) => {
|
|
430
467
|
if (!c)
|
|
431
468
|
return f.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."), () => {
|
|
432
469
|
};
|
|
433
|
-
|
|
434
|
-
const r =
|
|
470
|
+
Lt();
|
|
471
|
+
const r = Vt({
|
|
435
472
|
callbacks: {
|
|
436
473
|
contentUpdate: e,
|
|
437
474
|
animation: () => {
|
|
@@ -445,45 +482,45 @@ const Ut = (t = {}) => {
|
|
|
445
482
|
return window.addEventListener("message", r), () => {
|
|
446
483
|
window.removeEventListener("message", r);
|
|
447
484
|
};
|
|
448
|
-
},
|
|
485
|
+
}, Nt = "builder.tests", C = (t) => `${Nt}.${t}`, Ft = ({
|
|
449
486
|
contentId: t
|
|
450
|
-
}) =>
|
|
451
|
-
name:
|
|
487
|
+
}) => M({
|
|
488
|
+
name: C(t),
|
|
452
489
|
canTrack: !0
|
|
453
|
-
}),
|
|
490
|
+
}), Dt = ({
|
|
454
491
|
contentId: t
|
|
455
|
-
}) =>
|
|
456
|
-
name:
|
|
492
|
+
}) => O({
|
|
493
|
+
name: C(t),
|
|
457
494
|
canTrack: !0
|
|
458
|
-
}),
|
|
495
|
+
}), Mt = ({
|
|
459
496
|
contentId: t,
|
|
460
497
|
value: e
|
|
461
|
-
}) =>
|
|
462
|
-
name:
|
|
498
|
+
}) => P({
|
|
499
|
+
name: C(t),
|
|
463
500
|
value: e,
|
|
464
501
|
canTrack: !0
|
|
465
|
-
}),
|
|
502
|
+
}), Z = (t) => y(t.id) && y(t.variations) && Object.keys(t.variations).length > 0, Kt = ({
|
|
466
503
|
id: t,
|
|
467
504
|
variations: e
|
|
468
505
|
}) => {
|
|
469
|
-
var
|
|
506
|
+
var s;
|
|
470
507
|
let n = 0;
|
|
471
508
|
const r = Math.random();
|
|
472
|
-
for (const
|
|
473
|
-
const i = (
|
|
509
|
+
for (const o in e) {
|
|
510
|
+
const i = (s = e[o]) == null ? void 0 : s.testRatio;
|
|
474
511
|
if (n += i, r < n)
|
|
475
|
-
return
|
|
512
|
+
return o;
|
|
476
513
|
}
|
|
477
514
|
return t;
|
|
478
|
-
},
|
|
479
|
-
const e =
|
|
480
|
-
return
|
|
515
|
+
}, q = (t) => {
|
|
516
|
+
const e = Kt(t);
|
|
517
|
+
return Mt({
|
|
481
518
|
contentId: t.id,
|
|
482
519
|
value: e
|
|
483
520
|
}).catch((n) => {
|
|
484
521
|
f.error("could not store A/B test variation: ", n);
|
|
485
522
|
}), e;
|
|
486
|
-
},
|
|
523
|
+
}, tt = ({
|
|
487
524
|
item: t,
|
|
488
525
|
testGroupId: e
|
|
489
526
|
}) => {
|
|
@@ -497,7 +534,7 @@ const Ut = (t = {}) => {
|
|
|
497
534
|
testVariationId: n.id,
|
|
498
535
|
testVariationName: n.name || (n.id === t.id ? "Default" : "")
|
|
499
536
|
};
|
|
500
|
-
},
|
|
537
|
+
}, ce = ({
|
|
501
538
|
item: t,
|
|
502
539
|
canTrack: e
|
|
503
540
|
}) => {
|
|
@@ -505,14 +542,14 @@ const Ut = (t = {}) => {
|
|
|
505
542
|
return t;
|
|
506
543
|
if (!t)
|
|
507
544
|
return;
|
|
508
|
-
if (!
|
|
545
|
+
if (!Z(t))
|
|
509
546
|
return t;
|
|
510
|
-
const n =
|
|
547
|
+
const n = Dt({
|
|
511
548
|
contentId: t.id
|
|
512
|
-
}) ||
|
|
549
|
+
}) || q({
|
|
513
550
|
variations: t.variations,
|
|
514
551
|
id: t.id
|
|
515
|
-
}), r =
|
|
552
|
+
}), r = tt({
|
|
516
553
|
item: t,
|
|
517
554
|
testGroupId: n
|
|
518
555
|
});
|
|
@@ -520,186 +557,189 @@ const Ut = (t = {}) => {
|
|
|
520
557
|
...t,
|
|
521
558
|
...r
|
|
522
559
|
};
|
|
523
|
-
},
|
|
560
|
+
}, jt = async ({
|
|
524
561
|
item: t,
|
|
525
562
|
canTrack: e
|
|
526
563
|
}) => {
|
|
527
|
-
if (!e || !
|
|
564
|
+
if (!e || !Z(t))
|
|
528
565
|
return t;
|
|
529
|
-
const r = await
|
|
566
|
+
const r = await Ft({
|
|
530
567
|
contentId: t.id
|
|
531
|
-
}) ||
|
|
568
|
+
}) || q({
|
|
532
569
|
variations: t.variations,
|
|
533
570
|
id: t.id
|
|
534
|
-
}),
|
|
571
|
+
}), s = tt({
|
|
535
572
|
item: t,
|
|
536
573
|
testGroupId: r
|
|
537
574
|
});
|
|
538
575
|
return {
|
|
539
576
|
...t,
|
|
540
|
-
...
|
|
577
|
+
...s
|
|
541
578
|
};
|
|
542
|
-
},
|
|
543
|
-
|
|
579
|
+
}, Wt = (t) => {
|
|
580
|
+
const e = y(t) ? t : !0;
|
|
581
|
+
return K.setCanTrack(e), e;
|
|
582
|
+
};
|
|
583
|
+
function _t() {
|
|
544
584
|
return typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : globalThis;
|
|
545
585
|
}
|
|
546
|
-
function
|
|
547
|
-
const t =
|
|
586
|
+
function $t() {
|
|
587
|
+
const t = _t().fetch;
|
|
548
588
|
if (typeof t == "undefined")
|
|
549
589
|
throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
550
590
|
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`), new Error("Builder SDK could not find a global `fetch` function");
|
|
551
591
|
return t;
|
|
552
592
|
}
|
|
553
|
-
const
|
|
554
|
-
function
|
|
555
|
-
return Object.keys(t).reduce((r,
|
|
556
|
-
const
|
|
557
|
-
return [typeof
|
|
593
|
+
const Gt = $t();
|
|
594
|
+
function E(t, e = null, n = ".") {
|
|
595
|
+
return Object.keys(t).reduce((r, s) => {
|
|
596
|
+
const o = t[s], i = [e, s].filter(Boolean).join(n);
|
|
597
|
+
return [typeof o == "object", o !== null, !(Array.isArray(o) && o.length === 0)].every(Boolean) ? {
|
|
558
598
|
...r,
|
|
559
|
-
...
|
|
599
|
+
...E(o, i, n)
|
|
560
600
|
} : {
|
|
561
601
|
...r,
|
|
562
|
-
[i]:
|
|
602
|
+
[i]: o
|
|
563
603
|
};
|
|
564
604
|
}, {});
|
|
565
605
|
}
|
|
566
|
-
function
|
|
606
|
+
function et(t, e, n = {}) {
|
|
567
607
|
for (const r in t) {
|
|
568
|
-
const
|
|
569
|
-
|
|
608
|
+
const s = t[r], o = e ? e + "." + r : r;
|
|
609
|
+
s && typeof s == "object" && !Array.isArray(s) && !Object.keys(s).find((i) => i.startsWith("$")) ? et(s, o, n) : n[o] = s;
|
|
570
610
|
}
|
|
571
611
|
return n;
|
|
572
612
|
}
|
|
573
|
-
function
|
|
613
|
+
function Jt(t) {
|
|
574
614
|
const e = {};
|
|
575
615
|
for (const n in t) {
|
|
576
616
|
const r = n.split(".");
|
|
577
|
-
let
|
|
578
|
-
for (let
|
|
579
|
-
const i = r[
|
|
580
|
-
|
|
617
|
+
let s = e;
|
|
618
|
+
for (let o = 0; o < r.length; o++) {
|
|
619
|
+
const i = r[o];
|
|
620
|
+
o === r.length - 1 ? s[i] = t[n] : (s[i] = s[i] || {}, s = s[i]);
|
|
581
621
|
}
|
|
582
622
|
}
|
|
583
623
|
return e;
|
|
584
624
|
}
|
|
585
|
-
const
|
|
625
|
+
const zt = "v3", D = (t) => typeof t == "number" && !isNaN(t) && t >= 0, U = (t) => {
|
|
586
626
|
const {
|
|
587
627
|
limit: e = 30,
|
|
588
628
|
userAttributes: n,
|
|
589
629
|
query: r,
|
|
590
|
-
model:
|
|
591
|
-
apiKey:
|
|
630
|
+
model: s,
|
|
631
|
+
apiKey: o,
|
|
592
632
|
enrich: i,
|
|
593
633
|
locale: u,
|
|
594
|
-
apiVersion:
|
|
634
|
+
apiVersion: b = zt,
|
|
595
635
|
fields: p,
|
|
596
636
|
omit: k,
|
|
597
637
|
offset: l,
|
|
598
638
|
cacheSeconds: h,
|
|
599
639
|
staleCacheSeconds: g,
|
|
600
640
|
sort: S,
|
|
601
|
-
includeUnpublished:
|
|
602
|
-
apiHost:
|
|
641
|
+
includeUnpublished: T,
|
|
642
|
+
apiHost: nt
|
|
603
643
|
} = t;
|
|
604
|
-
if (!
|
|
644
|
+
if (!o)
|
|
605
645
|
throw new Error("Missing API key");
|
|
606
|
-
if (!["v3"].includes(
|
|
607
|
-
throw new Error(`Invalid apiVersion: expected 'v3', received '${
|
|
608
|
-
const
|
|
609
|
-
a.searchParams.set("apiKey",
|
|
610
|
-
const
|
|
646
|
+
if (!["v3"].includes(b))
|
|
647
|
+
throw new Error(`Invalid apiVersion: expected 'v3', received '${b}'`);
|
|
648
|
+
const rt = e !== 1, st = nt || "https://cdn.builder.io", a = new URL(`${st}/api/${b}/content/${s}`);
|
|
649
|
+
a.searchParams.set("apiKey", o), a.searchParams.set("limit", String(e)), a.searchParams.set("noTraverse", String(rt)), a.searchParams.set("includeRefs", String(!0));
|
|
650
|
+
const A = u || (n == null ? void 0 : n.locale);
|
|
611
651
|
let m = n || {};
|
|
612
|
-
if (
|
|
613
|
-
locale:
|
|
652
|
+
if (A && (a.searchParams.set("locale", A), m = {
|
|
653
|
+
locale: A,
|
|
614
654
|
...m
|
|
615
|
-
}), i && a.searchParams.set("enrich", String(i)), a.searchParams.set("omit", k || "meta.componentsUsed"), p && a.searchParams.set("fields", p), Number.isFinite(l) && l > -1 && a.searchParams.set("offset", String(Math.floor(l))), typeof
|
|
616
|
-
const d =
|
|
655
|
+
}), i && a.searchParams.set("enrich", String(i)), a.searchParams.set("omit", k || "meta.componentsUsed"), p && a.searchParams.set("fields", p), Number.isFinite(l) && l > -1 && a.searchParams.set("offset", String(Math.floor(l))), typeof T == "boolean" && a.searchParams.set("includeUnpublished", String(T)), h && D(h) && a.searchParams.set("cacheSeconds", String(h)), g && D(g) && a.searchParams.set("staleCacheSeconds", String(g)), S) {
|
|
656
|
+
const d = E({
|
|
617
657
|
sort: S
|
|
618
658
|
});
|
|
619
|
-
for (const
|
|
620
|
-
a.searchParams.set(
|
|
659
|
+
for (const w in d)
|
|
660
|
+
a.searchParams.set(w, JSON.stringify(d[w]));
|
|
621
661
|
}
|
|
622
662
|
const x = {
|
|
623
|
-
...
|
|
624
|
-
...
|
|
663
|
+
...mt(),
|
|
664
|
+
...j(t.options || {})
|
|
625
665
|
};
|
|
626
666
|
m = {
|
|
627
667
|
...m,
|
|
628
|
-
...
|
|
668
|
+
...Xt(x)
|
|
629
669
|
};
|
|
630
|
-
const
|
|
631
|
-
for (const d in
|
|
632
|
-
a.searchParams.set(d, String(
|
|
670
|
+
const R = E(x);
|
|
671
|
+
for (const d in R)
|
|
672
|
+
a.searchParams.set(d, String(R[d]));
|
|
633
673
|
if (Object.keys(m).length > 0 && a.searchParams.set("userAttributes", JSON.stringify(m)), r) {
|
|
634
|
-
const d =
|
|
674
|
+
const d = et({
|
|
635
675
|
query: r
|
|
636
676
|
});
|
|
637
|
-
for (const
|
|
638
|
-
a.searchParams.set(
|
|
677
|
+
for (const w in d)
|
|
678
|
+
a.searchParams.set(w, JSON.stringify(d[w]));
|
|
639
679
|
}
|
|
640
680
|
return a;
|
|
641
|
-
},
|
|
681
|
+
}, Ht = (t) => {
|
|
642
682
|
const e = {};
|
|
643
683
|
for (const n in t)
|
|
644
684
|
n.startsWith("userAttributes.") && (e[n] = t[n], delete t[n]);
|
|
645
685
|
return e;
|
|
646
|
-
},
|
|
686
|
+
}, Xt = (t) => {
|
|
647
687
|
if (c() && t.preview === "BUILDER_STUDIO") {
|
|
648
688
|
t["userAttributes.urlPath"] = window.location.pathname, t["userAttributes.host"] = window.location.host;
|
|
649
|
-
const e =
|
|
689
|
+
const e = Ht(t), {
|
|
650
690
|
userAttributes: n
|
|
651
|
-
} =
|
|
691
|
+
} = Jt(e);
|
|
652
692
|
return n;
|
|
653
693
|
}
|
|
654
694
|
return {};
|
|
655
|
-
},
|
|
656
|
-
async function
|
|
657
|
-
const e = await
|
|
695
|
+
}, Qt = (t) => "results" in t;
|
|
696
|
+
async function Yt(t) {
|
|
697
|
+
const e = await te({
|
|
658
698
|
...t,
|
|
659
699
|
limit: 1
|
|
660
700
|
});
|
|
661
701
|
return e && e[0] || null;
|
|
662
702
|
}
|
|
663
|
-
const
|
|
703
|
+
const Zt = async (t) => {
|
|
664
704
|
var i, u;
|
|
665
|
-
const e =
|
|
705
|
+
const e = U(t), n = (i = t.fetch) != null ? i : Gt, r = {
|
|
666
706
|
...t.fetchOptions,
|
|
667
707
|
headers: {
|
|
668
708
|
...(u = t.fetchOptions) == null ? void 0 : u.headers,
|
|
669
|
-
...
|
|
709
|
+
...J()
|
|
670
710
|
}
|
|
671
711
|
};
|
|
672
712
|
return await (await n(e.href, r)).json();
|
|
673
|
-
},
|
|
674
|
-
const r =
|
|
713
|
+
}, qt = async (t, e, n = U(t)) => {
|
|
714
|
+
const r = Wt(t.canTrack);
|
|
675
715
|
if (n.search.includes("preview="), !r || !(c() || v === "reactNative"))
|
|
676
716
|
return e.results;
|
|
677
717
|
try {
|
|
678
|
-
const
|
|
679
|
-
for (const
|
|
680
|
-
|
|
681
|
-
item:
|
|
718
|
+
const s = [];
|
|
719
|
+
for (const o of e.results)
|
|
720
|
+
s.push(await jt({
|
|
721
|
+
item: o,
|
|
682
722
|
canTrack: r
|
|
683
723
|
}));
|
|
684
|
-
e.results =
|
|
685
|
-
} catch (
|
|
686
|
-
f.error("Could not process A/B tests. ",
|
|
724
|
+
e.results = s;
|
|
725
|
+
} catch (s) {
|
|
726
|
+
f.error("Could not process A/B tests. ", s);
|
|
687
727
|
}
|
|
688
728
|
return e.results;
|
|
689
729
|
};
|
|
690
|
-
async function
|
|
691
|
-
const e =
|
|
692
|
-
if (!
|
|
730
|
+
async function te(t) {
|
|
731
|
+
const e = U(t), n = await Zt(t);
|
|
732
|
+
if (!Qt(n))
|
|
693
733
|
throw f.error("Error fetching data. ", {
|
|
694
734
|
url: e,
|
|
695
735
|
content: n,
|
|
696
736
|
options: t
|
|
697
737
|
}), n;
|
|
698
|
-
return
|
|
738
|
+
return qt(t, n);
|
|
699
739
|
}
|
|
700
|
-
const
|
|
701
|
-
var r,
|
|
702
|
-
const e = t.path || ((r = t.url) == null ? void 0 : r.pathname) || ((
|
|
740
|
+
const ue = async (t) => {
|
|
741
|
+
var r, s, o;
|
|
742
|
+
const e = t.path || ((r = t.url) == null ? void 0 : r.pathname) || ((s = t.userAttributes) == null ? void 0 : s.urlPath), n = {
|
|
703
743
|
...t,
|
|
704
744
|
apiKey: t.apiKey,
|
|
705
745
|
model: t.model || "page",
|
|
@@ -709,38 +749,40 @@ const se = async (t) => {
|
|
|
709
749
|
urlPath: e
|
|
710
750
|
} : {}
|
|
711
751
|
},
|
|
712
|
-
options:
|
|
752
|
+
options: $(t.searchParams || ((o = t.url) == null ? void 0 : o.searchParams) || t.options)
|
|
713
753
|
};
|
|
714
754
|
return {
|
|
715
755
|
apiKey: n.apiKey,
|
|
716
756
|
model: n.model,
|
|
717
|
-
content: await
|
|
757
|
+
content: await Yt(n)
|
|
718
758
|
};
|
|
719
759
|
};
|
|
720
760
|
export {
|
|
721
761
|
v as TARGET,
|
|
722
|
-
|
|
723
|
-
|
|
762
|
+
qt as _processContentResult,
|
|
763
|
+
Rt as _track,
|
|
724
764
|
y as checkIsDefined,
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
765
|
+
Vt as createEditorListener,
|
|
766
|
+
re as createRegisterComponentMessage,
|
|
767
|
+
ue as fetchBuilderProps,
|
|
768
|
+
te as fetchEntries,
|
|
769
|
+
Yt as fetchOneEntry,
|
|
770
|
+
$ as getBuilderSearchParams,
|
|
771
|
+
Wt as getDefaultCanTrack,
|
|
772
|
+
Ut as getUserAttributes,
|
|
773
|
+
ce as handleABTestingSync,
|
|
734
774
|
c as isBrowser,
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
775
|
+
ft as isEditing,
|
|
776
|
+
ne as isPreviewing,
|
|
777
|
+
Ot as logFetch,
|
|
738
778
|
f as logger,
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
779
|
+
gt as register,
|
|
780
|
+
ie as registerInsertMenu,
|
|
781
|
+
_ as serializeIncludingFunctions,
|
|
782
|
+
ee as setClientUserAttributes,
|
|
783
|
+
se as setEditorSettings,
|
|
784
|
+
Lt as setupBrowserForEditing,
|
|
785
|
+
ae as subscribeToEditor,
|
|
786
|
+
oe as track,
|
|
787
|
+
K as userAttributesService
|
|
746
788
|
};
|