@builder.io/sdk-react 4.0.9 → 4.1.0
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 +10 -10
- package/lib/browser/blocks-exports.mjs +480 -459
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/server-entry-9ed7eace.cjs +2 -0
- package/lib/{edge/server-entry-8dc3478a.js → browser/server-entry-cddec22e.js} +272 -265
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{accordion-e3f81e74.cjs → accordion-59aed902.cjs} +1 -1
- package/lib/edge/{accordion-b551e135.js → accordion-88f5ca79.js} +1 -1
- package/lib/edge/{blocks-cd1feef2.js → blocks-1bfa0619.js} +2 -2
- package/lib/edge/{blocks-eb6fa21f.cjs → blocks-e5610e53.cjs} +1 -1
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +2 -2
- package/lib/edge/{button-f390f723.js → button-cfcad5ee.js} +2 -2
- package/lib/edge/{button-5c6a9392.cjs → button-d4969c10.cjs} +1 -1
- package/lib/edge/{columns-ad17139e.cjs → columns-4c22f5f9.cjs} +1 -1
- package/lib/edge/{columns-7018a027.js → columns-840b77f4.js} +3 -3
- package/lib/edge/{content-variants-dc54ce4f.js → content-variants-5b95a71c.js} +13 -13
- package/lib/edge/{content-variants-c72ca81f.cjs → content-variants-9084d7cf.cjs} +3 -3
- package/lib/edge/{custom-code-0daf1c91.js → custom-code-c12691cc.js} +1 -1
- package/lib/edge/{custom-code-e87af7b1.cjs → custom-code-f0f3bef1.cjs} +1 -1
- package/lib/edge/{embed-1dfcba43.js → embed-46acac57.js} +1 -1
- package/lib/edge/{embed-c695c98e.cjs → embed-95c874d3.cjs} +1 -1
- package/lib/edge/form-49928227.js +178 -0
- package/lib/edge/form-e74d90ef.cjs +1 -0
- package/lib/edge/{get-class-prop-name-c479656a.cjs → get-class-prop-name-5d642918.cjs} +1 -1
- package/lib/edge/{get-class-prop-name-5edacc3b.js → get-class-prop-name-de337a1b.js} +1 -1
- package/lib/edge/image-209835f4.js +94 -0
- package/lib/edge/image-87a4e006.cjs +17 -0
- package/lib/edge/image.helpers-3e926d47.js +33 -0
- package/lib/edge/image.helpers-dba8a869.cjs +1 -0
- package/lib/edge/img-0fe56811.cjs +1 -0
- package/lib/edge/img-a0115c68.js +27 -0
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/edge/{input-3d4f956b.js → input-2a39a1a8.js} +1 -1
- package/lib/edge/{input-8c7008b5.cjs → input-4f2e451f.cjs} +1 -1
- package/lib/edge/personalization-container-9ddd7a55.cjs +1 -0
- package/lib/edge/{personalization-container-3a8dc18a.js → personalization-container-d477347e.js} +35 -32
- package/lib/edge/{select-2efc7503.cjs → select-b5449eba.cjs} +1 -1
- package/lib/edge/{select-153586f8.js → select-d1902b94.js} +1 -1
- package/lib/{node/server-entry-f03c1146.js → edge/server-entry-50618347.js} +306 -303
- package/lib/edge/server-entry-a24928b8.cjs +2 -0
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/{slot-f1f7513c.cjs → slot-e2f8c494.cjs} +1 -1
- package/lib/edge/{slot-d268693c.js → slot-f37576fc.js} +3 -3
- package/lib/edge/{symbol-0344516c.cjs → symbol-8424cd54.cjs} +1 -1
- package/lib/edge/{symbol-378e19ee.js → symbol-a34eea2a.js} +2 -2
- package/lib/edge/{tabs-29ff78a0.js → tabs-b97f9798.js} +3 -3
- package/lib/edge/{tabs-4e931765.cjs → tabs-e686d11f.cjs} +1 -1
- package/lib/node/blocks-exports.cjs +16 -16
- package/lib/node/blocks-exports.mjs +502 -481
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +3 -3
- package/lib/{browser/server-entry-231f8ecd.js → node/server-entry-1556528d.js} +205 -199
- package/lib/node/server-entry-ecee24b6.cjs +2 -0
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/lib/node/{setIvm-044ce9e7.js → setIvm-15c96eda.js} +1 -1
- package/lib/node/{setIvm-3761bb10.cjs → setIvm-432010ba.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-e760d4f2.cjs → should-force-browser-runtime-in-node-4128d124.cjs} +1 -1
- package/lib/node/{should-force-browser-runtime-in-node-f620dcdc.js → should-force-browser-runtime-in-node-d0bca779.js} +1 -1
- package/package.json +1 -1
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/helpers/no-serialize-wrapper.d.ts +1 -0
- package/types/helpers/user-attributes.d.ts +6 -2
- package/lib/browser/server-entry-bdbd3c0d.cjs +0 -2
- package/lib/edge/form-5a0c89d9.js +0 -166
- package/lib/edge/form-ba54942c.cjs +0 -1
- package/lib/edge/image-cce92f6c.cjs +0 -17
- package/lib/edge/image-d87761af.js +0 -123
- package/lib/edge/img-6982d6eb.cjs +0 -1
- package/lib/edge/img-882c7222.js +0 -20
- package/lib/edge/personalization-container-4557a50b.cjs +0 -1
- package/lib/edge/server-entry-9d269960.cjs +0 -2
- package/lib/node/server-entry-916c726c.cjs +0 -2
|
@@ -1,120 +1,77 @@
|
|
|
1
|
+
const y = "react", v = "[Builder.io]: ", f = {
|
|
2
|
+
log: (...t) => console.log(v, ...t),
|
|
3
|
+
error: (...t) => console.error(v, ...t),
|
|
4
|
+
warn: (...t) => console.warn(v, ...t),
|
|
5
|
+
debug: (...t) => console.debug(v, ...t)
|
|
6
|
+
};
|
|
1
7
|
function c() {
|
|
2
8
|
return typeof window != "undefined" && typeof document != "undefined";
|
|
3
9
|
}
|
|
4
|
-
const
|
|
5
|
-
log: (...t) => console.log(k, ...t),
|
|
6
|
-
error: (...t) => console.error(k, ...t),
|
|
7
|
-
warn: (...t) => console.warn(k, ...t),
|
|
8
|
-
debug: (...t) => console.debug(k, ...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
|
-
}, R = "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: R,
|
|
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: R,
|
|
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
|
-
}, I = "react", lt = (t) => {
|
|
10
|
+
const at = (t) => {
|
|
87
11
|
const e = {};
|
|
88
12
|
return t.forEach((n, r) => {
|
|
89
13
|
e[r] = n;
|
|
90
14
|
}), e;
|
|
91
|
-
},
|
|
92
|
-
function
|
|
15
|
+
}, K = (t) => t instanceof URLSearchParams ? at(t) : t, W = (t) => typeof t == "string" ? t : t instanceof URLSearchParams ? t.toString() : new URLSearchParams(t).toString();
|
|
16
|
+
function ct() {
|
|
93
17
|
return c() && window.self !== window.top;
|
|
94
18
|
}
|
|
95
|
-
function
|
|
96
|
-
return
|
|
19
|
+
function ut(t) {
|
|
20
|
+
return ct() && // accessing window.location.search is safe here because `isIframe()` is only `true` if we're in a browser.
|
|
97
21
|
W(t || window.location.search).indexOf("builder.frameEditing=") !== -1;
|
|
98
22
|
}
|
|
23
|
+
const lt = () => {
|
|
24
|
+
if (c()) {
|
|
25
|
+
const t = new URL(location.href);
|
|
26
|
+
return t.pathname === "" && (t.pathname = "/"), t;
|
|
27
|
+
} else
|
|
28
|
+
return console.warn("Cannot get location for tracking in non-browser environment"), null;
|
|
29
|
+
}, dt = () => typeof navigator == "object" && navigator.userAgent || "", ft = () => {
|
|
30
|
+
const t = dt(), e = {
|
|
31
|
+
Android() {
|
|
32
|
+
return t.match(/Android/i);
|
|
33
|
+
},
|
|
34
|
+
BlackBerry() {
|
|
35
|
+
return t.match(/BlackBerry/i);
|
|
36
|
+
},
|
|
37
|
+
iOS() {
|
|
38
|
+
return t.match(/iPhone|iPod/i);
|
|
39
|
+
},
|
|
40
|
+
Opera() {
|
|
41
|
+
return t.match(/Opera Mini/i);
|
|
42
|
+
},
|
|
43
|
+
Windows() {
|
|
44
|
+
return t.match(/IEMobile/i) || t.match(/WPDesktop/i);
|
|
45
|
+
},
|
|
46
|
+
any() {
|
|
47
|
+
return e.Android() || e.BlackBerry() || e.iOS() || e.Opera() || e.Windows() || y === "reactNative";
|
|
48
|
+
}
|
|
49
|
+
}, n = t.match(/Tablet|iPad/i), r = lt();
|
|
50
|
+
return {
|
|
51
|
+
urlPath: r == null ? void 0 : r.pathname,
|
|
52
|
+
host: (r == null ? void 0 : r.host) || (r == null ? void 0 : r.hostname),
|
|
53
|
+
device: n ? "tablet" : e.any() ? "mobile" : "desktop"
|
|
54
|
+
};
|
|
55
|
+
}, S = (t) => t != null;
|
|
99
56
|
function ne(t) {
|
|
100
57
|
const e = t || (c() ? window.location.search : void 0);
|
|
101
58
|
return e ? W(e).indexOf("builder.preview=") !== -1 : !1;
|
|
102
59
|
}
|
|
103
60
|
const re = (t) => ({
|
|
104
61
|
type: "builder.registerComponent",
|
|
105
|
-
data:
|
|
62
|
+
data: j(t)
|
|
106
63
|
}), ht = (t) => {
|
|
107
64
|
const e = t.toString().trim(), n = /^[a-zA-Z0-9_]+\s*=>/i.test(e);
|
|
108
65
|
return `return (${!e.startsWith("function") && !e.startsWith("async") && !e.startsWith("(") && !n ? "function " : ""}${e}).apply(this, arguments)`;
|
|
109
66
|
};
|
|
110
|
-
function
|
|
67
|
+
function j(t) {
|
|
111
68
|
return JSON.parse(JSON.stringify(t, (e, n) => typeof n == "function" ? ht(n) : n));
|
|
112
69
|
}
|
|
113
|
-
const
|
|
70
|
+
const _ = {};
|
|
114
71
|
function gt(t, e) {
|
|
115
|
-
t === "plugin" && (e =
|
|
116
|
-
let n =
|
|
117
|
-
if (n || (n =
|
|
72
|
+
t === "plugin" && (e = j(e));
|
|
73
|
+
let n = _[t];
|
|
74
|
+
if (n || (n = _[t] = []), n.push(e), c()) {
|
|
118
75
|
const r = {
|
|
119
76
|
type: "builder.register",
|
|
120
77
|
data: {
|
|
@@ -129,24 +86,24 @@ function gt(t, e) {
|
|
|
129
86
|
}
|
|
130
87
|
}
|
|
131
88
|
}
|
|
132
|
-
const
|
|
89
|
+
const L = {};
|
|
133
90
|
function se(t) {
|
|
134
91
|
if (c()) {
|
|
135
|
-
Object.assign(
|
|
92
|
+
Object.assign(L, t);
|
|
136
93
|
const e = {
|
|
137
94
|
type: "builder.settingsChange",
|
|
138
|
-
data:
|
|
95
|
+
data: L
|
|
139
96
|
};
|
|
140
97
|
parent.postMessage(e, "*");
|
|
141
98
|
}
|
|
142
99
|
}
|
|
143
|
-
const
|
|
100
|
+
const N = "builder.", pt = "options.", $ = (t) => {
|
|
144
101
|
if (!t)
|
|
145
102
|
return {};
|
|
146
|
-
const e =
|
|
103
|
+
const e = K(t), n = {};
|
|
147
104
|
return Object.keys(e).forEach((r) => {
|
|
148
|
-
if (r.startsWith(
|
|
149
|
-
const s = r.replace(
|
|
105
|
+
if (r.startsWith(N)) {
|
|
106
|
+
const s = r.replace(N, "").replace(pt, "");
|
|
150
107
|
n[s] = e[r];
|
|
151
108
|
}
|
|
152
109
|
}), n;
|
|
@@ -155,130 +112,139 @@ const V = "builder.", pt = "options.", $ = (t) => {
|
|
|
155
112
|
return {};
|
|
156
113
|
const t = new URLSearchParams(window.location.search);
|
|
157
114
|
return $(t);
|
|
158
|
-
}, G = "4.0
|
|
159
|
-
"X-Builder-SDK":
|
|
115
|
+
}, G = "4.1.0", J = () => ({
|
|
116
|
+
"X-Builder-SDK": y,
|
|
160
117
|
"X-Builder-SDK-GEN": "2",
|
|
161
118
|
"X-Builder-SDK-Version": G
|
|
162
|
-
})
|
|
163
|
-
|
|
119
|
+
}), St = (t) => {
|
|
120
|
+
if (t === "localhost" || t === "127.0.0.1")
|
|
121
|
+
return t;
|
|
122
|
+
const e = t.split(".");
|
|
123
|
+
return e.length > 2 ? e.slice(1).join(".") : t;
|
|
124
|
+
}, O = ({
|
|
125
|
+
name: t,
|
|
126
|
+
canTrack: e
|
|
127
|
+
}) => {
|
|
128
|
+
var n;
|
|
129
|
+
try {
|
|
130
|
+
return e ? (n = document.cookie.split("; ").find((r) => r.startsWith(`${t}=`))) == null ? void 0 : n.split("=")[1] : void 0;
|
|
131
|
+
} catch (r) {
|
|
132
|
+
f.warn("[COOKIE] GET error: ", (r == null ? void 0 : r.message) || r);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
}, z = async (t) => O(t), yt = (t) => t.map(([e, n]) => n ? `${e}=${n}` : e).filter(S).join("; "), bt = [["secure", ""], ["SameSite", "None"]], wt = ({
|
|
136
|
+
name: t,
|
|
137
|
+
value: e,
|
|
138
|
+
expires: n
|
|
139
|
+
}) => {
|
|
140
|
+
const s = (c() ? location.protocol === "https:" : !0) ? bt : [[]], o = n ? [["expires", n.toUTCString()]] : [[]], i = [[t, e], ...o, ["path", "/"], ["domain", St(window.location.hostname)], ...s];
|
|
141
|
+
return yt(i);
|
|
142
|
+
}, T = async ({
|
|
143
|
+
name: t,
|
|
144
|
+
value: e,
|
|
145
|
+
expires: n,
|
|
146
|
+
canTrack: r
|
|
147
|
+
}) => {
|
|
148
|
+
try {
|
|
149
|
+
if (!r)
|
|
150
|
+
return;
|
|
151
|
+
const s = wt({
|
|
152
|
+
name: t,
|
|
153
|
+
value: e,
|
|
154
|
+
expires: n
|
|
155
|
+
});
|
|
156
|
+
document.cookie = s;
|
|
157
|
+
} catch (s) {
|
|
158
|
+
f.warn("[COOKIE] SET error: ", (s == null ? void 0 : s.message) || s);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
function Et() {
|
|
164
162
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
|
|
165
163
|
const e = Math.random() * 16 | 0;
|
|
166
164
|
return (t == "x" ? e : e & 3 | 8).toString(16);
|
|
167
165
|
});
|
|
168
166
|
}
|
|
169
167
|
function X() {
|
|
170
|
-
return
|
|
168
|
+
return Et().replace(/-/g, "");
|
|
171
169
|
}
|
|
172
|
-
const
|
|
170
|
+
const H = "builderSessionId", It = async ({
|
|
173
171
|
canTrack: t
|
|
174
172
|
}) => {
|
|
175
173
|
if (!t)
|
|
176
174
|
return;
|
|
177
|
-
const e = await
|
|
178
|
-
name:
|
|
175
|
+
const e = await z({
|
|
176
|
+
name: H,
|
|
179
177
|
canTrack: t
|
|
180
178
|
});
|
|
181
|
-
if (
|
|
179
|
+
if (S(e))
|
|
182
180
|
return e;
|
|
183
181
|
{
|
|
184
|
-
const n =
|
|
185
|
-
return
|
|
182
|
+
const n = vt();
|
|
183
|
+
return At({
|
|
186
184
|
id: n,
|
|
187
185
|
canTrack: t
|
|
188
186
|
}), n;
|
|
189
187
|
}
|
|
190
|
-
},
|
|
188
|
+
}, vt = () => X(), At = ({
|
|
191
189
|
id: t,
|
|
192
190
|
canTrack: e
|
|
193
|
-
}) =>
|
|
194
|
-
name:
|
|
191
|
+
}) => T({
|
|
192
|
+
name: H,
|
|
195
193
|
value: t,
|
|
196
194
|
canTrack: e
|
|
197
|
-
}),
|
|
195
|
+
}), Q = () => c() && typeof localStorage != "undefined" ? localStorage : void 0, kt = ({
|
|
198
196
|
key: t,
|
|
199
197
|
canTrack: e
|
|
200
198
|
}) => {
|
|
201
199
|
var n;
|
|
202
200
|
try {
|
|
203
|
-
return e ? (n =
|
|
201
|
+
return e ? (n = Q()) == null ? void 0 : n.getItem(t) : void 0;
|
|
204
202
|
} catch (r) {
|
|
205
203
|
console.debug("[LocalStorage] GET error: ", r);
|
|
206
204
|
return;
|
|
207
205
|
}
|
|
208
|
-
},
|
|
206
|
+
}, Ut = ({
|
|
209
207
|
key: t,
|
|
210
208
|
canTrack: e,
|
|
211
209
|
value: n
|
|
212
210
|
}) => {
|
|
213
211
|
var r;
|
|
214
212
|
try {
|
|
215
|
-
e && ((r =
|
|
213
|
+
e && ((r = Q()) == null || r.setItem(t, n));
|
|
216
214
|
} catch (s) {
|
|
217
215
|
console.debug("[LocalStorage] SET error: ", s);
|
|
218
216
|
}
|
|
219
|
-
},
|
|
217
|
+
}, Y = "builderVisitorId", Ot = ({
|
|
220
218
|
canTrack: t
|
|
221
219
|
}) => {
|
|
222
220
|
if (!t)
|
|
223
221
|
return;
|
|
224
|
-
const e =
|
|
225
|
-
key:
|
|
222
|
+
const e = kt({
|
|
223
|
+
key: Y,
|
|
226
224
|
canTrack: t
|
|
227
225
|
});
|
|
228
|
-
if (
|
|
226
|
+
if (S(e))
|
|
229
227
|
return e;
|
|
230
228
|
{
|
|
231
|
-
const n =
|
|
232
|
-
return
|
|
229
|
+
const n = Tt();
|
|
230
|
+
return Ct({
|
|
233
231
|
id: n,
|
|
234
232
|
canTrack: t
|
|
235
233
|
}), n;
|
|
236
234
|
}
|
|
237
|
-
},
|
|
235
|
+
}, Tt = () => X(), Ct = ({
|
|
238
236
|
id: t,
|
|
239
237
|
canTrack: e
|
|
240
|
-
}) =>
|
|
241
|
-
key:
|
|
238
|
+
}) => Ut({
|
|
239
|
+
key: Y,
|
|
242
240
|
value: t,
|
|
243
241
|
canTrack: e
|
|
244
242
|
});
|
|
245
|
-
function
|
|
243
|
+
function Pt(t) {
|
|
246
244
|
var e;
|
|
247
245
|
typeof process != "undefined" && ((e = process.env) != null && e.DEBUG) && String(process.env.DEBUG) == "true" && f.log(t);
|
|
248
246
|
}
|
|
249
|
-
const
|
|
250
|
-
if (c()) {
|
|
251
|
-
const t = new URL(location.href);
|
|
252
|
-
return t.pathname === "" && (t.pathname = "/"), t;
|
|
253
|
-
} else
|
|
254
|
-
return console.warn("Cannot get location for tracking in non-browser environment"), null;
|
|
255
|
-
}, Ct = () => typeof navigator == "object" && navigator.userAgent || "", Ut = () => {
|
|
256
|
-
const t = Ct(), e = {
|
|
257
|
-
Android() {
|
|
258
|
-
return t.match(/Android/i);
|
|
259
|
-
},
|
|
260
|
-
BlackBerry() {
|
|
261
|
-
return t.match(/BlackBerry/i);
|
|
262
|
-
},
|
|
263
|
-
iOS() {
|
|
264
|
-
return t.match(/iPhone|iPod/i);
|
|
265
|
-
},
|
|
266
|
-
Opera() {
|
|
267
|
-
return t.match(/Opera Mini/i);
|
|
268
|
-
},
|
|
269
|
-
Windows() {
|
|
270
|
-
return t.match(/IEMobile/i) || t.match(/WPDesktop/i);
|
|
271
|
-
},
|
|
272
|
-
any() {
|
|
273
|
-
return e.Android() || e.BlackBerry() || e.iOS() || e.Opera() || e.Windows() || I === "reactNative";
|
|
274
|
-
}
|
|
275
|
-
}, n = t.match(/Tablet|iPad/i), r = Pt();
|
|
276
|
-
return {
|
|
277
|
-
urlPath: r == null ? void 0 : r.pathname,
|
|
278
|
-
host: (r == null ? void 0 : r.host) || (r == null ? void 0 : r.hostname),
|
|
279
|
-
device: n ? "tablet" : e.any() ? "mobile" : "desktop"
|
|
280
|
-
};
|
|
281
|
-
}, Tt = async ({
|
|
247
|
+
const Rt = async ({
|
|
282
248
|
canTrack: t
|
|
283
249
|
}) => {
|
|
284
250
|
if (!t)
|
|
@@ -286,16 +252,16 @@ const Pt = () => {
|
|
|
286
252
|
visitorId: void 0,
|
|
287
253
|
sessionId: void 0
|
|
288
254
|
};
|
|
289
|
-
const e = await
|
|
255
|
+
const e = await It({
|
|
290
256
|
canTrack: t
|
|
291
|
-
}), n =
|
|
257
|
+
}), n = Ot({
|
|
292
258
|
canTrack: t
|
|
293
259
|
});
|
|
294
260
|
return {
|
|
295
261
|
sessionId: e,
|
|
296
262
|
visitorId: n
|
|
297
263
|
};
|
|
298
|
-
},
|
|
264
|
+
}, Bt = async ({
|
|
299
265
|
type: t,
|
|
300
266
|
canTrack: e,
|
|
301
267
|
apiKey: n,
|
|
@@ -309,14 +275,14 @@ const Pt = () => {
|
|
|
309
275
|
url: location.href,
|
|
310
276
|
...r
|
|
311
277
|
},
|
|
312
|
-
...await
|
|
278
|
+
...await Rt({
|
|
313
279
|
canTrack: e
|
|
314
280
|
}),
|
|
315
|
-
userAttributes:
|
|
281
|
+
userAttributes: ft(),
|
|
316
282
|
ownerId: n
|
|
317
283
|
}
|
|
318
284
|
});
|
|
319
|
-
async function
|
|
285
|
+
async function xt({
|
|
320
286
|
apiHost: t,
|
|
321
287
|
...e
|
|
322
288
|
}) {
|
|
@@ -324,13 +290,13 @@ async function Bt({
|
|
|
324
290
|
f.error("Missing API key for track call. Please provide your API key.");
|
|
325
291
|
return;
|
|
326
292
|
}
|
|
327
|
-
if (!e.canTrack ||
|
|
293
|
+
if (!e.canTrack || ut() || !(c() || y === "reactNative"))
|
|
328
294
|
return;
|
|
329
295
|
const r = `${t || "https://cdn.builder.io"}/api/v1/track`;
|
|
330
|
-
return
|
|
296
|
+
return Pt(r), fetch(r, {
|
|
331
297
|
method: "POST",
|
|
332
298
|
body: JSON.stringify({
|
|
333
|
-
events: [await
|
|
299
|
+
events: [await Bt(e)]
|
|
334
300
|
}),
|
|
335
301
|
headers: {
|
|
336
302
|
"content-type": "application/json",
|
|
@@ -341,15 +307,15 @@ async function Bt({
|
|
|
341
307
|
console.error("Failed to track: ", s);
|
|
342
308
|
});
|
|
343
309
|
}
|
|
344
|
-
const oe = (t) =>
|
|
310
|
+
const oe = (t) => xt({
|
|
345
311
|
...t,
|
|
346
312
|
canTrack: !0
|
|
347
|
-
}),
|
|
348
|
-
function
|
|
313
|
+
}), _t = ["*.beta.builder.io", "beta.builder.io", "builder.io", "localhost", "qa.builder.io"];
|
|
314
|
+
function Z(t, e) {
|
|
349
315
|
if (!e.origin.startsWith("http") && !e.origin.startsWith("https"))
|
|
350
316
|
return !1;
|
|
351
317
|
const n = new URL(e.origin), r = n.hostname;
|
|
352
|
-
return (t ||
|
|
318
|
+
return (t || _t).findIndex((s) => s.startsWith("*.") ? r.endsWith(s.slice(1)) : s === r) > -1;
|
|
353
319
|
}
|
|
354
320
|
const ie = () => {
|
|
355
321
|
gt("insertMenu", {
|
|
@@ -374,13 +340,13 @@ const ie = () => {
|
|
|
374
340
|
}]
|
|
375
341
|
});
|
|
376
342
|
};
|
|
377
|
-
let
|
|
343
|
+
let V = !1;
|
|
378
344
|
const Lt = (t) => {
|
|
379
345
|
var e, n;
|
|
380
|
-
|
|
346
|
+
V || (V = !0, c() && ((e = window.parent) == null || e.postMessage({
|
|
381
347
|
type: "builder.sdkInfo",
|
|
382
348
|
data: {
|
|
383
|
-
target:
|
|
349
|
+
target: y,
|
|
384
350
|
version: G,
|
|
385
351
|
supportsPatchUpdates: !1,
|
|
386
352
|
// Supports builder-model="..." attribute which is needed to
|
|
@@ -399,7 +365,7 @@ const Lt = (t) => {
|
|
|
399
365
|
}
|
|
400
366
|
}, "*"), window.addEventListener("message", (r) => {
|
|
401
367
|
var o, i;
|
|
402
|
-
if (!
|
|
368
|
+
if (!Z(t.trustedHosts, r))
|
|
403
369
|
return;
|
|
404
370
|
const {
|
|
405
371
|
data: s
|
|
@@ -407,10 +373,10 @@ const Lt = (t) => {
|
|
|
407
373
|
if (s != null && s.type)
|
|
408
374
|
switch (s.type) {
|
|
409
375
|
case "builder.evaluate": {
|
|
410
|
-
const u = s.data.text, b = s.data.arguments || [], p = s.data.id,
|
|
376
|
+
const u = s.data.text, b = s.data.arguments || [], p = s.data.id, w = new Function(u);
|
|
411
377
|
let l, h = null;
|
|
412
378
|
try {
|
|
413
|
-
l =
|
|
379
|
+
l = w.apply(null, b);
|
|
414
380
|
} catch (g) {
|
|
415
381
|
h = g;
|
|
416
382
|
}
|
|
@@ -421,8 +387,8 @@ const Lt = (t) => {
|
|
|
421
387
|
error: h.message
|
|
422
388
|
}
|
|
423
389
|
}, "*") : l && typeof l.then == "function" ? l.then((g) => {
|
|
424
|
-
var
|
|
425
|
-
(
|
|
390
|
+
var E;
|
|
391
|
+
(E = window.parent) == null || E.postMessage({
|
|
426
392
|
type: "builder.evaluateResult",
|
|
427
393
|
data: {
|
|
428
394
|
id: p,
|
|
@@ -445,7 +411,7 @@ const Lt = (t) => {
|
|
|
445
411
|
trustedHosts: e,
|
|
446
412
|
callbacks: n
|
|
447
413
|
}) => (r) => {
|
|
448
|
-
if (!
|
|
414
|
+
if (!Z(e, r))
|
|
449
415
|
return;
|
|
450
416
|
const {
|
|
451
417
|
data: s
|
|
@@ -500,12 +466,12 @@ const Lt = (t) => {
|
|
|
500
466
|
return window.addEventListener("message", s), () => {
|
|
501
467
|
window.removeEventListener("message", s);
|
|
502
468
|
};
|
|
503
|
-
}, Vt = "builder.tests", C = (t) => `${Vt}.${t}`,
|
|
469
|
+
}, Vt = "builder.tests", C = (t) => `${Vt}.${t}`, Dt = ({
|
|
504
470
|
contentId: t
|
|
505
|
-
}) =>
|
|
471
|
+
}) => z({
|
|
506
472
|
name: C(t),
|
|
507
473
|
canTrack: !0
|
|
508
|
-
}),
|
|
474
|
+
}), Ft = ({
|
|
509
475
|
contentId: t
|
|
510
476
|
}) => O({
|
|
511
477
|
name: C(t),
|
|
@@ -513,11 +479,11 @@ const Lt = (t) => {
|
|
|
513
479
|
}), Mt = ({
|
|
514
480
|
contentId: t,
|
|
515
481
|
value: e
|
|
516
|
-
}) =>
|
|
482
|
+
}) => T({
|
|
517
483
|
name: C(t),
|
|
518
484
|
value: e,
|
|
519
485
|
canTrack: !0
|
|
520
|
-
}),
|
|
486
|
+
}), q = (t) => S(t.id) && S(t.variations) && Object.keys(t.variations).length > 0, Kt = ({
|
|
521
487
|
id: t,
|
|
522
488
|
variations: e
|
|
523
489
|
}) => {
|
|
@@ -530,7 +496,7 @@ const Lt = (t) => {
|
|
|
530
496
|
return o;
|
|
531
497
|
}
|
|
532
498
|
return t;
|
|
533
|
-
},
|
|
499
|
+
}, tt = (t) => {
|
|
534
500
|
const e = Kt(t);
|
|
535
501
|
return Mt({
|
|
536
502
|
contentId: t.id,
|
|
@@ -538,7 +504,7 @@ const Lt = (t) => {
|
|
|
538
504
|
}).catch((n) => {
|
|
539
505
|
f.error("could not store A/B test variation: ", n);
|
|
540
506
|
}), e;
|
|
541
|
-
},
|
|
507
|
+
}, et = ({
|
|
542
508
|
item: t,
|
|
543
509
|
testGroupId: e
|
|
544
510
|
}) => {
|
|
@@ -560,14 +526,14 @@ const Lt = (t) => {
|
|
|
560
526
|
return t;
|
|
561
527
|
if (!t)
|
|
562
528
|
return;
|
|
563
|
-
if (!
|
|
529
|
+
if (!q(t))
|
|
564
530
|
return t;
|
|
565
|
-
const n =
|
|
531
|
+
const n = Ft({
|
|
566
532
|
contentId: t.id
|
|
567
|
-
}) ||
|
|
533
|
+
}) || tt({
|
|
568
534
|
variations: t.variations,
|
|
569
535
|
id: t.id
|
|
570
|
-
}), r =
|
|
536
|
+
}), r = et({
|
|
571
537
|
item: t,
|
|
572
538
|
testGroupId: n
|
|
573
539
|
});
|
|
@@ -575,18 +541,18 @@ const Lt = (t) => {
|
|
|
575
541
|
...t,
|
|
576
542
|
...r
|
|
577
543
|
};
|
|
578
|
-
},
|
|
544
|
+
}, Wt = async ({
|
|
579
545
|
item: t,
|
|
580
546
|
canTrack: e
|
|
581
547
|
}) => {
|
|
582
|
-
if (!e || !
|
|
548
|
+
if (!e || !q(t))
|
|
583
549
|
return t;
|
|
584
|
-
const r = await
|
|
550
|
+
const r = await Dt({
|
|
585
551
|
contentId: t.id
|
|
586
|
-
}) ||
|
|
552
|
+
}) || tt({
|
|
587
553
|
variations: t.variations,
|
|
588
554
|
id: t.id
|
|
589
|
-
}), s =
|
|
555
|
+
}), s = et({
|
|
590
556
|
item: t,
|
|
591
557
|
testGroupId: r
|
|
592
558
|
});
|
|
@@ -594,41 +560,82 @@ const Lt = (t) => {
|
|
|
594
560
|
...t,
|
|
595
561
|
...s
|
|
596
562
|
};
|
|
597
|
-
}, Wt = (t) => {
|
|
598
|
-
const e = y(t) ? t : !0;
|
|
599
|
-
return K.setCanTrack(e), e;
|
|
600
563
|
};
|
|
601
|
-
|
|
602
|
-
|
|
564
|
+
const D = "builder.userAttributes";
|
|
565
|
+
function F() {
|
|
566
|
+
let t = !0;
|
|
567
|
+
const e = /* @__PURE__ */ new Set();
|
|
568
|
+
return {
|
|
569
|
+
setUserAttributes(n) {
|
|
570
|
+
if (!c())
|
|
571
|
+
return;
|
|
572
|
+
const r = {
|
|
573
|
+
...this.getUserAttributes(),
|
|
574
|
+
...n
|
|
575
|
+
};
|
|
576
|
+
T({
|
|
577
|
+
name: D,
|
|
578
|
+
value: JSON.stringify(r),
|
|
579
|
+
canTrack: t
|
|
580
|
+
}), e.forEach((s) => s(r));
|
|
581
|
+
},
|
|
582
|
+
getUserAttributes() {
|
|
583
|
+
return c() ? JSON.parse(O({
|
|
584
|
+
name: D,
|
|
585
|
+
canTrack: t
|
|
586
|
+
}) || "{}") : {};
|
|
587
|
+
},
|
|
588
|
+
subscribeOnUserAttributesChange(n, {
|
|
589
|
+
fireImmediately: r
|
|
590
|
+
} = {}) {
|
|
591
|
+
return e.add(n), r && n(this.getUserAttributes()), function() {
|
|
592
|
+
e.delete(n);
|
|
593
|
+
};
|
|
594
|
+
},
|
|
595
|
+
setCanTrack(n) {
|
|
596
|
+
t = n;
|
|
597
|
+
}
|
|
598
|
+
};
|
|
603
599
|
}
|
|
600
|
+
let k;
|
|
601
|
+
c() && y === "qwik" ? (window.__BUILDER_USER_ATTRIBUTES_SERVICE__ || (window.__BUILDER_USER_ATTRIBUTES_SERVICE__ = F()), k = window.__BUILDER_USER_ATTRIBUTES_SERVICE__) : k = F();
|
|
602
|
+
const nt = k, ue = (t) => {
|
|
603
|
+
nt.setUserAttributes(t);
|
|
604
|
+
}, jt = (t) => {
|
|
605
|
+
const e = S(t) ? t : !0;
|
|
606
|
+
return nt.setCanTrack(e), e;
|
|
607
|
+
};
|
|
604
608
|
function $t() {
|
|
605
|
-
|
|
609
|
+
return typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : globalThis;
|
|
610
|
+
}
|
|
611
|
+
function Gt() {
|
|
612
|
+
const t = $t().fetch;
|
|
606
613
|
if (typeof t == "undefined")
|
|
607
614
|
throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
608
615
|
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`), new Error("Builder SDK could not find a global `fetch` function");
|
|
609
616
|
return t;
|
|
610
617
|
}
|
|
611
|
-
const
|
|
612
|
-
function
|
|
618
|
+
const Jt = Gt();
|
|
619
|
+
function U(t, e = null, n = ".") {
|
|
613
620
|
return Object.keys(t).reduce((r, s) => {
|
|
614
621
|
const o = t[s], i = [e, s].filter(Boolean).join(n);
|
|
615
622
|
return [typeof o == "object", o !== null, !(Array.isArray(o) && o.length === 0)].every(Boolean) ? {
|
|
616
623
|
...r,
|
|
617
|
-
...
|
|
624
|
+
...U(o, i, n)
|
|
618
625
|
} : {
|
|
619
626
|
...r,
|
|
620
627
|
[i]: o
|
|
621
628
|
};
|
|
622
629
|
}, {});
|
|
623
630
|
}
|
|
624
|
-
function
|
|
631
|
+
function rt(t, e, n = {}) {
|
|
625
632
|
for (const r in t) {
|
|
626
633
|
const s = t[r], o = e ? e + "." + r : r;
|
|
627
|
-
s && typeof s == "object" && !Array.isArray(s) && !Object.keys(s).find((i) => i.startsWith("$")) ?
|
|
634
|
+
s && typeof s == "object" && !Array.isArray(s) && !Object.keys(s).find((i) => i.startsWith("$")) ? rt(s, o, n) : n[o] = s;
|
|
628
635
|
}
|
|
629
636
|
return n;
|
|
630
637
|
}
|
|
631
|
-
function
|
|
638
|
+
function zt(t) {
|
|
632
639
|
const e = {};
|
|
633
640
|
for (const n in t) {
|
|
634
641
|
const r = n.split(".");
|
|
@@ -640,7 +647,7 @@ function Jt(t) {
|
|
|
640
647
|
}
|
|
641
648
|
return e;
|
|
642
649
|
}
|
|
643
|
-
const Xt = "v3",
|
|
650
|
+
const Xt = "v3", M = (t) => typeof t == "number" && !isNaN(t) && t >= 0, P = (t) => {
|
|
644
651
|
const {
|
|
645
652
|
limit: e = 30,
|
|
646
653
|
userAttributes: n,
|
|
@@ -651,76 +658,76 @@ const Xt = "v3", D = (t) => typeof t == "number" && !isNaN(t) && t >= 0, U = (t)
|
|
|
651
658
|
locale: u,
|
|
652
659
|
apiVersion: b = Xt,
|
|
653
660
|
fields: p,
|
|
654
|
-
omit:
|
|
661
|
+
omit: w,
|
|
655
662
|
offset: l,
|
|
656
663
|
cacheSeconds: h,
|
|
657
664
|
staleCacheSeconds: g,
|
|
658
|
-
sort:
|
|
659
|
-
includeUnpublished:
|
|
660
|
-
apiHost:
|
|
665
|
+
sort: E,
|
|
666
|
+
includeUnpublished: R,
|
|
667
|
+
apiHost: st
|
|
661
668
|
} = t;
|
|
662
669
|
if (!o)
|
|
663
670
|
throw new Error("Missing API key");
|
|
664
671
|
if (!["v3"].includes(b))
|
|
665
672
|
throw new Error(`Invalid apiVersion: expected 'v3', received '${b}'`);
|
|
666
|
-
const
|
|
667
|
-
a.searchParams.set("apiKey", o), a.searchParams.set("limit", String(e)), a.searchParams.set("noTraverse", String(
|
|
673
|
+
const ot = e !== 1, it = st || "https://cdn.builder.io", a = new URL(`${it}/api/${b}/content/${s}`);
|
|
674
|
+
a.searchParams.set("apiKey", o), a.searchParams.set("limit", String(e)), a.searchParams.set("noTraverse", String(ot)), a.searchParams.set("includeRefs", String(!0));
|
|
668
675
|
const A = u || (n == null ? void 0 : n.locale);
|
|
669
676
|
let m = n || {};
|
|
670
677
|
if (A && (a.searchParams.set("locale", A), m = {
|
|
671
678
|
locale: A,
|
|
672
679
|
...m
|
|
673
|
-
}), i && a.searchParams.set("enrich", String(i)), a.searchParams.set("omit",
|
|
674
|
-
const d =
|
|
675
|
-
sort:
|
|
680
|
+
}), i && a.searchParams.set("enrich", String(i)), a.searchParams.set("omit", w != null ? w : "meta.componentsUsed"), p && a.searchParams.set("fields", p), Number.isFinite(l) && l > -1 && a.searchParams.set("offset", String(Math.floor(l))), typeof R == "boolean" && a.searchParams.set("includeUnpublished", String(R)), h && M(h) && a.searchParams.set("cacheSeconds", String(h)), g && M(g) && a.searchParams.set("staleCacheSeconds", String(g)), E) {
|
|
681
|
+
const d = U({
|
|
682
|
+
sort: E
|
|
676
683
|
});
|
|
677
|
-
for (const
|
|
678
|
-
a.searchParams.set(
|
|
684
|
+
for (const I in d)
|
|
685
|
+
a.searchParams.set(I, JSON.stringify(d[I]));
|
|
679
686
|
}
|
|
680
|
-
const
|
|
687
|
+
const B = {
|
|
681
688
|
...mt(),
|
|
682
|
-
...
|
|
689
|
+
...K(t.options || {})
|
|
683
690
|
};
|
|
684
691
|
m = {
|
|
685
692
|
...m,
|
|
686
|
-
...
|
|
693
|
+
...Qt(B)
|
|
687
694
|
};
|
|
688
|
-
const
|
|
689
|
-
for (const d in
|
|
690
|
-
a.searchParams.set(d, String(
|
|
695
|
+
const x = U(B);
|
|
696
|
+
for (const d in x)
|
|
697
|
+
a.searchParams.set(d, String(x[d]));
|
|
691
698
|
if (Object.keys(m).length > 0 && a.searchParams.set("userAttributes", JSON.stringify(m)), r) {
|
|
692
|
-
const d =
|
|
699
|
+
const d = rt({
|
|
693
700
|
query: r
|
|
694
701
|
});
|
|
695
|
-
for (const
|
|
696
|
-
a.searchParams.set(
|
|
702
|
+
for (const I in d)
|
|
703
|
+
a.searchParams.set(I, JSON.stringify(d[I]));
|
|
697
704
|
}
|
|
698
705
|
return a;
|
|
699
|
-
},
|
|
706
|
+
}, Ht = (t) => {
|
|
700
707
|
const e = {};
|
|
701
708
|
for (const n in t)
|
|
702
709
|
n.startsWith("userAttributes.") && (e[n] = t[n], delete t[n]);
|
|
703
710
|
return e;
|
|
704
|
-
},
|
|
711
|
+
}, Qt = (t) => {
|
|
705
712
|
if (c() && t.preview === "BUILDER_STUDIO") {
|
|
706
713
|
t["userAttributes.urlPath"] = window.location.pathname, t["userAttributes.host"] = window.location.host;
|
|
707
|
-
const e =
|
|
714
|
+
const e = Ht(t), {
|
|
708
715
|
userAttributes: n
|
|
709
|
-
} =
|
|
716
|
+
} = zt(e);
|
|
710
717
|
return n;
|
|
711
718
|
}
|
|
712
719
|
return {};
|
|
713
|
-
},
|
|
714
|
-
async function
|
|
715
|
-
const e = await
|
|
720
|
+
}, Yt = (t) => "results" in t;
|
|
721
|
+
async function Zt(t) {
|
|
722
|
+
const e = await ee({
|
|
716
723
|
...t,
|
|
717
724
|
limit: 1
|
|
718
725
|
});
|
|
719
726
|
return e && e[0] || null;
|
|
720
727
|
}
|
|
721
|
-
const
|
|
728
|
+
const qt = async (t) => {
|
|
722
729
|
var i, u;
|
|
723
|
-
const e =
|
|
730
|
+
const e = P(t), n = (i = t.fetch) != null ? i : Jt, r = {
|
|
724
731
|
...t.fetchOptions,
|
|
725
732
|
headers: {
|
|
726
733
|
...(u = t.fetchOptions) == null ? void 0 : u.headers,
|
|
@@ -728,14 +735,14 @@ const Zt = async (t) => {
|
|
|
728
735
|
}
|
|
729
736
|
};
|
|
730
737
|
return await (await n(e.href, r)).json();
|
|
731
|
-
},
|
|
732
|
-
const r =
|
|
733
|
-
if (n.search.includes("preview="), !r || !(c() ||
|
|
738
|
+
}, te = async (t, e, n = P(t)) => {
|
|
739
|
+
const r = jt(t.canTrack);
|
|
740
|
+
if (n.search.includes("preview="), !r || !(c() || y === "reactNative"))
|
|
734
741
|
return e.results;
|
|
735
742
|
try {
|
|
736
743
|
const s = [];
|
|
737
744
|
for (const o of e.results)
|
|
738
|
-
s.push(await
|
|
745
|
+
s.push(await Wt({
|
|
739
746
|
item: o,
|
|
740
747
|
canTrack: r
|
|
741
748
|
}));
|
|
@@ -745,17 +752,17 @@ const Zt = async (t) => {
|
|
|
745
752
|
}
|
|
746
753
|
return e.results;
|
|
747
754
|
};
|
|
748
|
-
async function
|
|
749
|
-
const e =
|
|
750
|
-
if (!
|
|
755
|
+
async function ee(t) {
|
|
756
|
+
const e = P(t), n = await qt(t);
|
|
757
|
+
if (!Yt(n))
|
|
751
758
|
throw f.error("Error fetching data. ", {
|
|
752
759
|
url: e,
|
|
753
760
|
content: n,
|
|
754
761
|
options: t
|
|
755
762
|
}), n;
|
|
756
|
-
return
|
|
763
|
+
return te(t, n);
|
|
757
764
|
}
|
|
758
|
-
const
|
|
765
|
+
const le = async (t) => {
|
|
759
766
|
var r, s, o;
|
|
760
767
|
const e = t.path || ((r = t.url) == null ? void 0 : r.pathname) || ((s = t.userAttributes) == null ? void 0 : s.urlPath), n = {
|
|
761
768
|
...t,
|
|
@@ -772,36 +779,36 @@ const ue = async (t) => {
|
|
|
772
779
|
return {
|
|
773
780
|
apiKey: n.apiKey,
|
|
774
781
|
model: n.model,
|
|
775
|
-
content: await
|
|
782
|
+
content: await Zt(n)
|
|
776
783
|
};
|
|
777
784
|
};
|
|
778
785
|
export {
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
786
|
+
y as TARGET,
|
|
787
|
+
te as _processContentResult,
|
|
788
|
+
xt as _track,
|
|
789
|
+
S as checkIsDefined,
|
|
783
790
|
Nt as createEditorListener,
|
|
784
791
|
re as createRegisterComponentMessage,
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
792
|
+
le as fetchBuilderProps,
|
|
793
|
+
ee as fetchEntries,
|
|
794
|
+
Zt as fetchOneEntry,
|
|
788
795
|
$ as getBuilderSearchParams,
|
|
789
796
|
O as getCookieSync,
|
|
790
|
-
|
|
791
|
-
|
|
797
|
+
jt as getDefaultCanTrack,
|
|
798
|
+
ft as getUserAttributes,
|
|
792
799
|
ce as handleABTestingSync,
|
|
793
800
|
c as isBrowser,
|
|
794
|
-
|
|
801
|
+
ut as isEditing,
|
|
795
802
|
ne as isPreviewing,
|
|
796
|
-
|
|
803
|
+
Pt as logFetch,
|
|
797
804
|
f as logger,
|
|
798
805
|
gt as register,
|
|
799
806
|
ie as registerInsertMenu,
|
|
800
|
-
|
|
801
|
-
|
|
807
|
+
j as serializeIncludingFunctions,
|
|
808
|
+
ue as setClientUserAttributes,
|
|
802
809
|
se as setEditorSettings,
|
|
803
810
|
Lt as setupBrowserForEditing,
|
|
804
811
|
ae as subscribeToEditor,
|
|
805
812
|
oe as track,
|
|
806
|
-
|
|
813
|
+
nt as userAttributesService
|
|
807
814
|
};
|