@nosto/nosto-react 2.1.0 → 2.2.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/README.md +13 -0
- package/dist/index.d.ts +146 -23
- package/dist/index.es.js +428 -393
- package/dist/index.umd.js +9 -9
- package/package.json +1 -1
- package/src/components/Nosto404.tsx +17 -3
- package/src/components/NostoCategory.tsx +19 -3
- package/src/components/NostoCheckout.tsx +17 -3
- package/src/components/NostoHome.tsx +17 -3
- package/src/components/NostoOrder.tsx +19 -6
- package/src/components/NostoOther.tsx +17 -3
- package/src/components/NostoPlacement.tsx +6 -2
- package/src/components/NostoProduct.tsx +21 -8
- package/src/components/NostoSearch.tsx +19 -3
- package/src/components/NostoSession.tsx +26 -6
- package/src/components/index.ts +10 -10
- package/src/utils/snakeize.ts +5 -1
- package/src/utils/types.ts +29 -0
package/dist/index.es.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { createRoot as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
if (!
|
|
1
|
+
import Le, { useEffect as ae, useRef as re, useMemo as yt, createContext as Et, useContext as Rt, cloneElement as wt, useState as bt, isValidElement as _t } from "react";
|
|
2
|
+
import { createRoot as Ct } from "react-dom/client";
|
|
3
|
+
const Ne = (t) => String(t) === "[object Object]";
|
|
4
|
+
function Ae(t) {
|
|
5
|
+
if (!Ne(t))
|
|
6
6
|
return !1;
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
7
|
+
const o = t.constructor;
|
|
8
|
+
if (o === void 0)
|
|
9
9
|
return !0;
|
|
10
|
-
const a =
|
|
11
|
-
return !(!
|
|
10
|
+
const a = o.prototype;
|
|
11
|
+
return !(!Ne(a) || !a.hasOwnProperty("isPrototypeOf"));
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
if (t ===
|
|
13
|
+
function ne(t, o) {
|
|
14
|
+
if (t === o)
|
|
15
15
|
return !0;
|
|
16
|
-
if (t instanceof Date &&
|
|
17
|
-
return t.getTime() ===
|
|
18
|
-
if (t instanceof Array &&
|
|
19
|
-
return t.length !==
|
|
20
|
-
if (
|
|
16
|
+
if (t instanceof Date && o instanceof Date)
|
|
17
|
+
return t.getTime() === o.getTime();
|
|
18
|
+
if (t instanceof Array && o instanceof Array)
|
|
19
|
+
return t.length !== o.length ? !1 : t.every((a, u) => ne(a, o[u]));
|
|
20
|
+
if (Ae(t) && Ae(o)) {
|
|
21
21
|
const a = Object.entries(t);
|
|
22
|
-
return a.length !== Object.keys(
|
|
22
|
+
return a.length !== Object.keys(o).length ? !1 : a.every(([u, i]) => ne(i, o[u]));
|
|
23
23
|
}
|
|
24
24
|
return !1;
|
|
25
25
|
}
|
|
26
|
-
function Ie(t,
|
|
27
|
-
return
|
|
26
|
+
function Ie(t, o) {
|
|
27
|
+
return ae(t, Pt(o));
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
const
|
|
31
|
-
return
|
|
29
|
+
function Pt(t) {
|
|
30
|
+
const o = re(t), a = re(0);
|
|
31
|
+
return ne(t, o.current) || (o.current = t, a.current += 1), yt(() => o.current, [a.current]);
|
|
32
32
|
}
|
|
33
|
-
const $e =
|
|
33
|
+
const $e = Et({
|
|
34
34
|
account: "",
|
|
35
35
|
currentVariation: "",
|
|
36
36
|
responseMode: "HTML",
|
|
37
37
|
clientScriptLoaded: !1
|
|
38
38
|
});
|
|
39
|
-
function
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
function x(t,
|
|
43
|
-
const { clientScriptLoaded:
|
|
44
|
-
(a != null && a.deep ? Ie :
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
function ie() {
|
|
40
|
+
return Rt($e);
|
|
41
|
+
}
|
|
42
|
+
function x(t, o, a) {
|
|
43
|
+
const { clientScriptLoaded: u, currentVariation: i, responseMode: v } = ie();
|
|
44
|
+
(a != null && a.deep ? Ie : ae)(() => {
|
|
45
|
+
u && window.nostojs((p) => {
|
|
46
|
+
p.defaultSession().setVariation(i).setResponseMode(v), t(p);
|
|
47
47
|
});
|
|
48
|
-
}, [
|
|
48
|
+
}, [u, i, v, ...o ?? []]);
|
|
49
49
|
}
|
|
50
|
-
var
|
|
50
|
+
var oe = { exports: {} }, $ = {};
|
|
51
51
|
/**
|
|
52
52
|
* @license React
|
|
53
53
|
* react-jsx-runtime.production.min.js
|
|
@@ -57,23 +57,23 @@ var ae = { exports: {} }, $ = {};
|
|
|
57
57
|
* This source code is licensed under the MIT license found in the
|
|
58
58
|
* LICENSE file in the root directory of this source tree.
|
|
59
59
|
*/
|
|
60
|
-
var
|
|
61
|
-
function
|
|
62
|
-
if (
|
|
60
|
+
var De;
|
|
61
|
+
function St() {
|
|
62
|
+
if (De)
|
|
63
63
|
return $;
|
|
64
|
-
|
|
65
|
-
var t =
|
|
66
|
-
function
|
|
67
|
-
var
|
|
64
|
+
De = 1;
|
|
65
|
+
var t = Le, o = Symbol.for("react.element"), a = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, i = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, v = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
66
|
+
function w(p, g, P) {
|
|
67
|
+
var E, f = {}, _ = null, O = null;
|
|
68
68
|
P !== void 0 && (_ = "" + P), g.key !== void 0 && (_ = "" + g.key), g.ref !== void 0 && (O = g.ref);
|
|
69
|
-
for (
|
|
70
|
-
|
|
71
|
-
if (
|
|
72
|
-
for (
|
|
73
|
-
f[
|
|
74
|
-
return { $$typeof:
|
|
69
|
+
for (E in g)
|
|
70
|
+
u.call(g, E) && !v.hasOwnProperty(E) && (f[E] = g[E]);
|
|
71
|
+
if (p && p.defaultProps)
|
|
72
|
+
for (E in g = p.defaultProps, g)
|
|
73
|
+
f[E] === void 0 && (f[E] = g[E]);
|
|
74
|
+
return { $$typeof: o, type: p, key: _, ref: O, props: f, _owner: i.current };
|
|
75
75
|
}
|
|
76
|
-
return $.Fragment = a, $.jsx =
|
|
76
|
+
return $.Fragment = a, $.jsx = w, $.jsxs = w, $;
|
|
77
77
|
}
|
|
78
78
|
var W = {};
|
|
79
79
|
/**
|
|
@@ -85,91 +85,91 @@ var W = {};
|
|
|
85
85
|
* This source code is licensed under the MIT license found in the
|
|
86
86
|
* LICENSE file in the root directory of this source tree.
|
|
87
87
|
*/
|
|
88
|
-
var
|
|
89
|
-
function
|
|
90
|
-
return
|
|
91
|
-
var t =
|
|
92
|
-
function
|
|
88
|
+
var Fe;
|
|
89
|
+
function Ot() {
|
|
90
|
+
return Fe || (Fe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
91
|
+
var t = Le, o = Symbol.for("react.element"), a = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), w = Symbol.for("react.provider"), p = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), A = Symbol.iterator, M = "@@iterator";
|
|
92
|
+
function Y(e) {
|
|
93
93
|
if (e === null || typeof e != "object")
|
|
94
94
|
return null;
|
|
95
|
-
var r =
|
|
95
|
+
var r = A && e[A] || e[M];
|
|
96
96
|
return typeof r == "function" ? r : null;
|
|
97
97
|
}
|
|
98
98
|
var S = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
99
|
-
function
|
|
99
|
+
function R(e) {
|
|
100
100
|
{
|
|
101
|
-
for (var r = arguments.length,
|
|
102
|
-
|
|
103
|
-
We("error", e,
|
|
101
|
+
for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
|
|
102
|
+
n[s - 1] = arguments[s];
|
|
103
|
+
We("error", e, n);
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
function We(e, r,
|
|
106
|
+
function We(e, r, n) {
|
|
107
107
|
{
|
|
108
108
|
var s = S.ReactDebugCurrentFrame, d = s.getStackAddendum();
|
|
109
|
-
d !== "" && (r += "%s",
|
|
110
|
-
var
|
|
109
|
+
d !== "" && (r += "%s", n = n.concat([d]));
|
|
110
|
+
var m = n.map(function(l) {
|
|
111
111
|
return String(l);
|
|
112
112
|
});
|
|
113
|
-
|
|
113
|
+
m.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, m);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
var
|
|
117
|
-
|
|
116
|
+
var Ve = !1, Me = !1, Ye = !1, Ue = !1, qe = !1, ue;
|
|
117
|
+
ue = Symbol.for("react.module.reference");
|
|
118
118
|
function Be(e) {
|
|
119
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
119
|
+
return !!(typeof e == "string" || typeof e == "function" || e === u || e === v || qe || e === i || e === P || e === E || Ue || e === O || Ve || Me || Ye || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === f || e.$$typeof === w || e.$$typeof === p || e.$$typeof === g || // This needs to include all possible module reference object
|
|
120
120
|
// types supported by any Flight configuration anywhere since
|
|
121
121
|
// we don't know which Flight build this will end up being used
|
|
122
122
|
// with.
|
|
123
|
-
e.$$typeof ===
|
|
123
|
+
e.$$typeof === ue || e.getModuleId !== void 0));
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function He(e, r, n) {
|
|
126
126
|
var s = e.displayName;
|
|
127
127
|
if (s)
|
|
128
128
|
return s;
|
|
129
129
|
var d = r.displayName || r.name || "";
|
|
130
|
-
return d !== "" ?
|
|
130
|
+
return d !== "" ? n + "(" + d + ")" : n;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function ce(e) {
|
|
133
133
|
return e.displayName || "Context";
|
|
134
134
|
}
|
|
135
135
|
function T(e) {
|
|
136
136
|
if (e == null)
|
|
137
137
|
return null;
|
|
138
|
-
if (typeof e.tag == "number" &&
|
|
138
|
+
if (typeof e.tag == "number" && R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
139
139
|
return e.displayName || e.name || null;
|
|
140
140
|
if (typeof e == "string")
|
|
141
141
|
return e;
|
|
142
142
|
switch (e) {
|
|
143
|
-
case
|
|
143
|
+
case u:
|
|
144
144
|
return "Fragment";
|
|
145
145
|
case a:
|
|
146
146
|
return "Portal";
|
|
147
|
-
case
|
|
147
|
+
case v:
|
|
148
148
|
return "Profiler";
|
|
149
149
|
case i:
|
|
150
150
|
return "StrictMode";
|
|
151
151
|
case P:
|
|
152
152
|
return "Suspense";
|
|
153
|
-
case
|
|
153
|
+
case E:
|
|
154
154
|
return "SuspenseList";
|
|
155
155
|
}
|
|
156
156
|
if (typeof e == "object")
|
|
157
157
|
switch (e.$$typeof) {
|
|
158
|
-
case
|
|
158
|
+
case p:
|
|
159
159
|
var r = e;
|
|
160
|
-
return
|
|
161
|
-
case
|
|
162
|
-
var
|
|
163
|
-
return
|
|
160
|
+
return ce(r) + ".Consumer";
|
|
161
|
+
case w:
|
|
162
|
+
var n = e;
|
|
163
|
+
return ce(n._context) + ".Provider";
|
|
164
164
|
case g:
|
|
165
|
-
return
|
|
165
|
+
return He(e, e.render, "ForwardRef");
|
|
166
166
|
case f:
|
|
167
167
|
var s = e.displayName || null;
|
|
168
168
|
return s !== null ? s : T(e.type) || "Memo";
|
|
169
169
|
case _: {
|
|
170
|
-
var d = e,
|
|
170
|
+
var d = e, m = d._payload, l = d._init;
|
|
171
171
|
try {
|
|
172
|
-
return T(l(
|
|
172
|
+
return T(l(m));
|
|
173
173
|
} catch {
|
|
174
174
|
return null;
|
|
175
175
|
}
|
|
@@ -177,18 +177,18 @@ function Or() {
|
|
|
177
177
|
}
|
|
178
178
|
return null;
|
|
179
179
|
}
|
|
180
|
-
var
|
|
181
|
-
function
|
|
180
|
+
var N = Object.assign, L = 0, le, fe, de, me, ve, pe, ge;
|
|
181
|
+
function he() {
|
|
182
182
|
}
|
|
183
|
-
|
|
184
|
-
function
|
|
183
|
+
he.__reactDisabledLog = !0;
|
|
184
|
+
function ze() {
|
|
185
185
|
{
|
|
186
|
-
if (
|
|
187
|
-
le = console.log, fe = console.info, de = console.warn, me = console.error,
|
|
186
|
+
if (L === 0) {
|
|
187
|
+
le = console.log, fe = console.info, de = console.warn, me = console.error, ve = console.group, pe = console.groupCollapsed, ge = console.groupEnd;
|
|
188
188
|
var e = {
|
|
189
189
|
configurable: !0,
|
|
190
190
|
enumerable: !0,
|
|
191
|
-
value:
|
|
191
|
+
value: he,
|
|
192
192
|
writable: !0
|
|
193
193
|
};
|
|
194
194
|
Object.defineProperties(console, {
|
|
@@ -201,77 +201,77 @@ function Or() {
|
|
|
201
201
|
groupEnd: e
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
|
-
|
|
204
|
+
L++;
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
function Je() {
|
|
208
208
|
{
|
|
209
|
-
if (
|
|
209
|
+
if (L--, L === 0) {
|
|
210
210
|
var e = {
|
|
211
211
|
configurable: !0,
|
|
212
212
|
enumerable: !0,
|
|
213
213
|
writable: !0
|
|
214
214
|
};
|
|
215
215
|
Object.defineProperties(console, {
|
|
216
|
-
log:
|
|
216
|
+
log: N({}, e, {
|
|
217
217
|
value: le
|
|
218
218
|
}),
|
|
219
|
-
info:
|
|
219
|
+
info: N({}, e, {
|
|
220
220
|
value: fe
|
|
221
221
|
}),
|
|
222
|
-
warn:
|
|
222
|
+
warn: N({}, e, {
|
|
223
223
|
value: de
|
|
224
224
|
}),
|
|
225
|
-
error:
|
|
225
|
+
error: N({}, e, {
|
|
226
226
|
value: me
|
|
227
227
|
}),
|
|
228
|
-
group:
|
|
229
|
-
value: pe
|
|
230
|
-
}),
|
|
231
|
-
groupCollapsed: A({}, e, {
|
|
228
|
+
group: N({}, e, {
|
|
232
229
|
value: ve
|
|
233
230
|
}),
|
|
234
|
-
|
|
231
|
+
groupCollapsed: N({}, e, {
|
|
232
|
+
value: pe
|
|
233
|
+
}),
|
|
234
|
+
groupEnd: N({}, e, {
|
|
235
235
|
value: ge
|
|
236
236
|
})
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
|
-
|
|
239
|
+
L < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
var
|
|
243
|
-
function
|
|
242
|
+
var J = S.ReactCurrentDispatcher, G;
|
|
243
|
+
function U(e, r, n) {
|
|
244
244
|
{
|
|
245
|
-
if (
|
|
245
|
+
if (G === void 0)
|
|
246
246
|
try {
|
|
247
247
|
throw Error();
|
|
248
248
|
} catch (d) {
|
|
249
249
|
var s = d.stack.trim().match(/\n( *(at )?)/);
|
|
250
|
-
|
|
250
|
+
G = s && s[1] || "";
|
|
251
251
|
}
|
|
252
252
|
return `
|
|
253
|
-
` +
|
|
253
|
+
` + G + e;
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
var
|
|
256
|
+
var K = !1, q;
|
|
257
257
|
{
|
|
258
258
|
var Ge = typeof WeakMap == "function" ? WeakMap : Map;
|
|
259
|
-
|
|
259
|
+
q = new Ge();
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
if (!e ||
|
|
261
|
+
function ye(e, r) {
|
|
262
|
+
if (!e || K)
|
|
263
263
|
return "";
|
|
264
264
|
{
|
|
265
|
-
var
|
|
266
|
-
if (
|
|
267
|
-
return
|
|
265
|
+
var n = q.get(e);
|
|
266
|
+
if (n !== void 0)
|
|
267
|
+
return n;
|
|
268
268
|
}
|
|
269
269
|
var s;
|
|
270
|
-
|
|
270
|
+
K = !0;
|
|
271
271
|
var d = Error.prepareStackTrace;
|
|
272
272
|
Error.prepareStackTrace = void 0;
|
|
273
|
-
var
|
|
274
|
-
|
|
273
|
+
var m;
|
|
274
|
+
m = J.current, J.current = null, ze();
|
|
275
275
|
try {
|
|
276
276
|
if (r) {
|
|
277
277
|
var l = function() {
|
|
@@ -306,59 +306,59 @@ function Or() {
|
|
|
306
306
|
}
|
|
307
307
|
} catch (j) {
|
|
308
308
|
if (j && s && typeof j.stack == "string") {
|
|
309
|
-
for (var
|
|
309
|
+
for (var c = j.stack.split(`
|
|
310
310
|
`), b = s.stack.split(`
|
|
311
|
-
`),
|
|
312
|
-
|
|
313
|
-
for (;
|
|
314
|
-
if (
|
|
315
|
-
if (
|
|
311
|
+
`), h = c.length - 1, y = b.length - 1; h >= 1 && y >= 0 && c[h] !== b[y]; )
|
|
312
|
+
y--;
|
|
313
|
+
for (; h >= 1 && y >= 0; h--, y--)
|
|
314
|
+
if (c[h] !== b[y]) {
|
|
315
|
+
if (h !== 1 || y !== 1)
|
|
316
316
|
do
|
|
317
|
-
if (
|
|
317
|
+
if (h--, y--, y < 0 || c[h] !== b[y]) {
|
|
318
318
|
var C = `
|
|
319
|
-
` +
|
|
320
|
-
return e.displayName && C.includes("<anonymous>") && (C = C.replace("<anonymous>", e.displayName)), typeof e == "function" &&
|
|
319
|
+
` + c[h].replace(" at new ", " at ");
|
|
320
|
+
return e.displayName && C.includes("<anonymous>") && (C = C.replace("<anonymous>", e.displayName)), typeof e == "function" && q.set(e, C), C;
|
|
321
321
|
}
|
|
322
|
-
while (
|
|
322
|
+
while (h >= 1 && y >= 0);
|
|
323
323
|
break;
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
} finally {
|
|
327
|
-
|
|
327
|
+
K = !1, J.current = m, Je(), Error.prepareStackTrace = d;
|
|
328
328
|
}
|
|
329
|
-
var
|
|
330
|
-
return typeof e == "function" &&
|
|
329
|
+
var F = e ? e.displayName || e.name : "", ke = F ? U(F) : "";
|
|
330
|
+
return typeof e == "function" && q.set(e, ke), ke;
|
|
331
331
|
}
|
|
332
|
-
function Ke(e, r,
|
|
333
|
-
return
|
|
332
|
+
function Ke(e, r, n) {
|
|
333
|
+
return ye(e, !1);
|
|
334
334
|
}
|
|
335
335
|
function Xe(e) {
|
|
336
336
|
var r = e.prototype;
|
|
337
337
|
return !!(r && r.isReactComponent);
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function B(e, r, n) {
|
|
340
340
|
if (e == null)
|
|
341
341
|
return "";
|
|
342
342
|
if (typeof e == "function")
|
|
343
|
-
return
|
|
343
|
+
return ye(e, Xe(e));
|
|
344
344
|
if (typeof e == "string")
|
|
345
|
-
return
|
|
345
|
+
return U(e);
|
|
346
346
|
switch (e) {
|
|
347
347
|
case P:
|
|
348
|
-
return
|
|
349
|
-
case
|
|
350
|
-
return
|
|
348
|
+
return U("Suspense");
|
|
349
|
+
case E:
|
|
350
|
+
return U("SuspenseList");
|
|
351
351
|
}
|
|
352
352
|
if (typeof e == "object")
|
|
353
353
|
switch (e.$$typeof) {
|
|
354
354
|
case g:
|
|
355
355
|
return Ke(e.render);
|
|
356
356
|
case f:
|
|
357
|
-
return
|
|
357
|
+
return B(e.type, r, n);
|
|
358
358
|
case _: {
|
|
359
|
-
var s = e, d = s._payload,
|
|
359
|
+
var s = e, d = s._payload, m = s._init;
|
|
360
360
|
try {
|
|
361
|
-
return
|
|
361
|
+
return B(m(d), r, n);
|
|
362
362
|
} catch {
|
|
363
363
|
}
|
|
364
364
|
}
|
|
@@ -366,43 +366,43 @@ function Or() {
|
|
|
366
366
|
return "";
|
|
367
367
|
}
|
|
368
368
|
var H = Object.prototype.hasOwnProperty, Ee = {}, Re = S.ReactDebugCurrentFrame;
|
|
369
|
-
function
|
|
369
|
+
function z(e) {
|
|
370
370
|
if (e) {
|
|
371
|
-
var r = e._owner,
|
|
372
|
-
Re.setExtraStackFrame(
|
|
371
|
+
var r = e._owner, n = B(e.type, e._source, r ? r.type : null);
|
|
372
|
+
Re.setExtraStackFrame(n);
|
|
373
373
|
} else
|
|
374
374
|
Re.setExtraStackFrame(null);
|
|
375
375
|
}
|
|
376
|
-
function Ze(e, r,
|
|
376
|
+
function Ze(e, r, n, s, d) {
|
|
377
377
|
{
|
|
378
|
-
var
|
|
378
|
+
var m = Function.call.bind(H);
|
|
379
379
|
for (var l in e)
|
|
380
|
-
if (
|
|
381
|
-
var
|
|
380
|
+
if (m(e, l)) {
|
|
381
|
+
var c = void 0;
|
|
382
382
|
try {
|
|
383
383
|
if (typeof e[l] != "function") {
|
|
384
|
-
var b = Error((s || "React class") + ": " +
|
|
384
|
+
var b = Error((s || "React class") + ": " + n + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
385
385
|
throw b.name = "Invariant Violation", b;
|
|
386
386
|
}
|
|
387
|
-
|
|
388
|
-
} catch (
|
|
389
|
-
|
|
387
|
+
c = e[l](r, l, s, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
388
|
+
} catch (h) {
|
|
389
|
+
c = h;
|
|
390
390
|
}
|
|
391
|
-
|
|
391
|
+
c && !(c instanceof Error) && (z(d), R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", s || "React class", n, l, typeof c), z(null)), c instanceof Error && !(c.message in Ee) && (Ee[c.message] = !0, z(d), R("Failed %s type: %s", n, c.message), z(null));
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
}
|
|
395
395
|
var Qe = Array.isArray;
|
|
396
|
-
function
|
|
396
|
+
function X(e) {
|
|
397
397
|
return Qe(e);
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function et(e) {
|
|
400
400
|
{
|
|
401
|
-
var r = typeof Symbol == "function" && Symbol.toStringTag,
|
|
402
|
-
return
|
|
401
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
402
|
+
return n;
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function tt(e) {
|
|
406
406
|
try {
|
|
407
407
|
return we(e), !1;
|
|
408
408
|
} catch {
|
|
@@ -413,17 +413,17 @@ function Or() {
|
|
|
413
413
|
return "" + e;
|
|
414
414
|
}
|
|
415
415
|
function be(e) {
|
|
416
|
-
if (
|
|
417
|
-
return
|
|
416
|
+
if (tt(e))
|
|
417
|
+
return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", et(e)), we(e);
|
|
418
418
|
}
|
|
419
|
-
var I = S.ReactCurrentOwner,
|
|
419
|
+
var I = S.ReactCurrentOwner, rt = {
|
|
420
420
|
key: !0,
|
|
421
421
|
ref: !0,
|
|
422
422
|
__self: !0,
|
|
423
423
|
__source: !0
|
|
424
|
-
}, _e, Ce,
|
|
425
|
-
|
|
426
|
-
function
|
|
424
|
+
}, _e, Ce, Z;
|
|
425
|
+
Z = {};
|
|
426
|
+
function nt(e) {
|
|
427
427
|
if (H.call(e, "ref")) {
|
|
428
428
|
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
429
429
|
if (r && r.isReactWarning)
|
|
@@ -431,7 +431,7 @@ function Or() {
|
|
|
431
431
|
}
|
|
432
432
|
return e.ref !== void 0;
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function ot(e) {
|
|
435
435
|
if (H.call(e, "key")) {
|
|
436
436
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
437
437
|
if (r && r.isReactWarning)
|
|
@@ -439,98 +439,98 @@ function Or() {
|
|
|
439
439
|
}
|
|
440
440
|
return e.key !== void 0;
|
|
441
441
|
}
|
|
442
|
-
function
|
|
442
|
+
function at(e, r) {
|
|
443
443
|
if (typeof e.ref == "string" && I.current && r && I.current.stateNode !== r) {
|
|
444
|
-
var
|
|
445
|
-
|
|
444
|
+
var n = T(I.current.type);
|
|
445
|
+
Z[n] || (R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', T(I.current.type), e.ref), Z[n] = !0);
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
|
-
function
|
|
448
|
+
function it(e, r) {
|
|
449
449
|
{
|
|
450
|
-
var
|
|
451
|
-
_e || (_e = !0,
|
|
450
|
+
var n = function() {
|
|
451
|
+
_e || (_e = !0, R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
452
452
|
};
|
|
453
|
-
|
|
454
|
-
get:
|
|
453
|
+
n.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
454
|
+
get: n,
|
|
455
455
|
configurable: !0
|
|
456
456
|
});
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function st(e, r) {
|
|
460
460
|
{
|
|
461
|
-
var
|
|
462
|
-
Ce || (Ce = !0,
|
|
461
|
+
var n = function() {
|
|
462
|
+
Ce || (Ce = !0, R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
463
463
|
};
|
|
464
|
-
|
|
465
|
-
get:
|
|
464
|
+
n.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
465
|
+
get: n,
|
|
466
466
|
configurable: !0
|
|
467
467
|
});
|
|
468
468
|
}
|
|
469
469
|
}
|
|
470
|
-
var
|
|
471
|
-
var
|
|
470
|
+
var ut = function(e, r, n, s, d, m, l) {
|
|
471
|
+
var c = {
|
|
472
472
|
// This tag allows us to uniquely identify this as a React Element
|
|
473
|
-
$$typeof:
|
|
473
|
+
$$typeof: o,
|
|
474
474
|
// Built-in properties that belong on the element
|
|
475
475
|
type: e,
|
|
476
476
|
key: r,
|
|
477
|
-
ref:
|
|
477
|
+
ref: n,
|
|
478
478
|
props: l,
|
|
479
479
|
// Record the component responsible for creating this element.
|
|
480
|
-
_owner:
|
|
480
|
+
_owner: m
|
|
481
481
|
};
|
|
482
|
-
return
|
|
482
|
+
return c._store = {}, Object.defineProperty(c._store, "validated", {
|
|
483
483
|
configurable: !1,
|
|
484
484
|
enumerable: !1,
|
|
485
485
|
writable: !0,
|
|
486
486
|
value: !1
|
|
487
|
-
}), Object.defineProperty(
|
|
487
|
+
}), Object.defineProperty(c, "_self", {
|
|
488
488
|
configurable: !1,
|
|
489
489
|
enumerable: !1,
|
|
490
490
|
writable: !1,
|
|
491
491
|
value: s
|
|
492
|
-
}), Object.defineProperty(
|
|
492
|
+
}), Object.defineProperty(c, "_source", {
|
|
493
493
|
configurable: !1,
|
|
494
494
|
enumerable: !1,
|
|
495
495
|
writable: !1,
|
|
496
496
|
value: d
|
|
497
|
-
}), Object.freeze && (Object.freeze(
|
|
497
|
+
}), Object.freeze && (Object.freeze(c.props), Object.freeze(c)), c;
|
|
498
498
|
};
|
|
499
|
-
function
|
|
499
|
+
function ct(e, r, n, s, d) {
|
|
500
500
|
{
|
|
501
|
-
var
|
|
502
|
-
|
|
503
|
-
for (
|
|
504
|
-
H.call(r,
|
|
501
|
+
var m, l = {}, c = null, b = null;
|
|
502
|
+
n !== void 0 && (be(n), c = "" + n), ot(r) && (be(r.key), c = "" + r.key), nt(r) && (b = r.ref, at(r, d));
|
|
503
|
+
for (m in r)
|
|
504
|
+
H.call(r, m) && !rt.hasOwnProperty(m) && (l[m] = r[m]);
|
|
505
505
|
if (e && e.defaultProps) {
|
|
506
|
-
var
|
|
507
|
-
for (
|
|
508
|
-
l[
|
|
506
|
+
var h = e.defaultProps;
|
|
507
|
+
for (m in h)
|
|
508
|
+
l[m] === void 0 && (l[m] = h[m]);
|
|
509
509
|
}
|
|
510
|
-
if (
|
|
511
|
-
var
|
|
512
|
-
|
|
510
|
+
if (c || b) {
|
|
511
|
+
var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
512
|
+
c && it(l, y), b && st(l, y);
|
|
513
513
|
}
|
|
514
|
-
return
|
|
514
|
+
return ut(e, c, b, d, s, I.current, l);
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
var
|
|
518
|
-
function
|
|
517
|
+
var Q = S.ReactCurrentOwner, Pe = S.ReactDebugCurrentFrame;
|
|
518
|
+
function D(e) {
|
|
519
519
|
if (e) {
|
|
520
|
-
var r = e._owner,
|
|
521
|
-
Pe.setExtraStackFrame(
|
|
520
|
+
var r = e._owner, n = B(e.type, e._source, r ? r.type : null);
|
|
521
|
+
Pe.setExtraStackFrame(n);
|
|
522
522
|
} else
|
|
523
523
|
Pe.setExtraStackFrame(null);
|
|
524
524
|
}
|
|
525
|
-
var
|
|
526
|
-
|
|
525
|
+
var ee;
|
|
526
|
+
ee = !1;
|
|
527
527
|
function te(e) {
|
|
528
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
528
|
+
return typeof e == "object" && e !== null && e.$$typeof === o;
|
|
529
529
|
}
|
|
530
530
|
function Se() {
|
|
531
531
|
{
|
|
532
|
-
if (
|
|
533
|
-
var e = T(
|
|
532
|
+
if (Q.current) {
|
|
533
|
+
var e = T(Q.current.type);
|
|
534
534
|
if (e)
|
|
535
535
|
return `
|
|
536
536
|
|
|
@@ -539,18 +539,18 @@ Check the render method of \`` + e + "`.";
|
|
|
539
539
|
return "";
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function lt(e) {
|
|
543
543
|
return "";
|
|
544
544
|
}
|
|
545
545
|
var Oe = {};
|
|
546
|
-
function
|
|
546
|
+
function ft(e) {
|
|
547
547
|
{
|
|
548
548
|
var r = Se();
|
|
549
549
|
if (!r) {
|
|
550
|
-
var
|
|
551
|
-
|
|
550
|
+
var n = typeof e == "string" ? e : e.displayName || e.name;
|
|
551
|
+
n && (r = `
|
|
552
552
|
|
|
553
|
-
Check the top-level render call using <` +
|
|
553
|
+
Check the top-level render call using <` + n + ">.");
|
|
554
554
|
}
|
|
555
555
|
return r;
|
|
556
556
|
}
|
|
@@ -560,333 +560,368 @@ Check the top-level render call using <` + o + ">.");
|
|
|
560
560
|
if (!e._store || e._store.validated || e.key != null)
|
|
561
561
|
return;
|
|
562
562
|
e._store.validated = !0;
|
|
563
|
-
var
|
|
564
|
-
if (Oe[
|
|
563
|
+
var n = ft(r);
|
|
564
|
+
if (Oe[n])
|
|
565
565
|
return;
|
|
566
|
-
Oe[
|
|
566
|
+
Oe[n] = !0;
|
|
567
567
|
var s = "";
|
|
568
|
-
e && e._owner && e._owner !==
|
|
568
|
+
e && e._owner && e._owner !== Q.current && (s = " It was passed a child from " + T(e._owner.type) + "."), D(e), R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, s), D(null);
|
|
569
569
|
}
|
|
570
570
|
}
|
|
571
571
|
function je(e, r) {
|
|
572
572
|
{
|
|
573
573
|
if (typeof e != "object")
|
|
574
574
|
return;
|
|
575
|
-
if (
|
|
576
|
-
for (var
|
|
577
|
-
var s = e[
|
|
575
|
+
if (X(e))
|
|
576
|
+
for (var n = 0; n < e.length; n++) {
|
|
577
|
+
var s = e[n];
|
|
578
578
|
te(s) && Te(s, r);
|
|
579
579
|
}
|
|
580
580
|
else if (te(e))
|
|
581
581
|
e._store && (e._store.validated = !0);
|
|
582
582
|
else if (e) {
|
|
583
|
-
var d =
|
|
583
|
+
var d = Y(e);
|
|
584
584
|
if (typeof d == "function" && d !== e.entries)
|
|
585
|
-
for (var
|
|
585
|
+
for (var m = d.call(e), l; !(l = m.next()).done; )
|
|
586
586
|
te(l.value) && Te(l.value, r);
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function dt(e) {
|
|
591
591
|
{
|
|
592
592
|
var r = e.type;
|
|
593
593
|
if (r == null || typeof r == "string")
|
|
594
594
|
return;
|
|
595
|
-
var
|
|
595
|
+
var n;
|
|
596
596
|
if (typeof r == "function")
|
|
597
|
-
|
|
597
|
+
n = r.propTypes;
|
|
598
598
|
else if (typeof r == "object" && (r.$$typeof === g || // Note: Memo only checks outer props here.
|
|
599
599
|
// Inner props are checked in the reconciler.
|
|
600
600
|
r.$$typeof === f))
|
|
601
|
-
|
|
601
|
+
n = r.propTypes;
|
|
602
602
|
else
|
|
603
603
|
return;
|
|
604
|
-
if (
|
|
604
|
+
if (n) {
|
|
605
605
|
var s = T(r);
|
|
606
|
-
Ze(
|
|
607
|
-
} else if (r.PropTypes !== void 0 && !
|
|
608
|
-
|
|
606
|
+
Ze(n, e.props, "prop", s, e);
|
|
607
|
+
} else if (r.PropTypes !== void 0 && !ee) {
|
|
608
|
+
ee = !0;
|
|
609
609
|
var d = T(r);
|
|
610
|
-
|
|
610
|
+
R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", d || "Unknown");
|
|
611
611
|
}
|
|
612
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved &&
|
|
612
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
|
-
function
|
|
615
|
+
function mt(e) {
|
|
616
616
|
{
|
|
617
|
-
for (var r = Object.keys(e.props),
|
|
618
|
-
var s = r[
|
|
617
|
+
for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
|
|
618
|
+
var s = r[n];
|
|
619
619
|
if (s !== "children" && s !== "key") {
|
|
620
|
-
|
|
620
|
+
D(e), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), D(null);
|
|
621
621
|
break;
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
|
-
e.ref !== null && (
|
|
624
|
+
e.ref !== null && (D(e), R("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
|
|
625
625
|
}
|
|
626
626
|
}
|
|
627
|
-
function xe(e, r,
|
|
627
|
+
function xe(e, r, n, s, d, m) {
|
|
628
628
|
{
|
|
629
629
|
var l = Be(e);
|
|
630
630
|
if (!l) {
|
|
631
|
-
var
|
|
632
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
633
|
-
var b =
|
|
634
|
-
b ?
|
|
635
|
-
var
|
|
636
|
-
e === null ?
|
|
631
|
+
var c = "";
|
|
632
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (c += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
633
|
+
var b = lt();
|
|
634
|
+
b ? c += b : c += Se();
|
|
635
|
+
var h;
|
|
636
|
+
e === null ? h = "null" : X(e) ? h = "array" : e !== void 0 && e.$$typeof === o ? (h = "<" + (T(e.type) || "Unknown") + " />", c = " Did you accidentally export a JSX literal instead of a component?") : h = typeof e, R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", h, c);
|
|
637
637
|
}
|
|
638
|
-
var
|
|
639
|
-
if (
|
|
640
|
-
return
|
|
638
|
+
var y = ct(e, r, n, d, m);
|
|
639
|
+
if (y == null)
|
|
640
|
+
return y;
|
|
641
641
|
if (l) {
|
|
642
642
|
var C = r.children;
|
|
643
643
|
if (C !== void 0)
|
|
644
644
|
if (s)
|
|
645
|
-
if (
|
|
646
|
-
for (var
|
|
647
|
-
je(C[
|
|
645
|
+
if (X(C)) {
|
|
646
|
+
for (var F = 0; F < C.length; F++)
|
|
647
|
+
je(C[F], e);
|
|
648
648
|
Object.freeze && Object.freeze(C);
|
|
649
649
|
} else
|
|
650
|
-
|
|
650
|
+
R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
651
651
|
else
|
|
652
652
|
je(C, e);
|
|
653
653
|
}
|
|
654
|
-
return e ===
|
|
654
|
+
return e === u ? mt(y) : dt(y), y;
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
|
-
function
|
|
658
|
-
return xe(e, r,
|
|
657
|
+
function vt(e, r, n) {
|
|
658
|
+
return xe(e, r, n, !0);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
661
|
-
return xe(e, r,
|
|
660
|
+
function pt(e, r, n) {
|
|
661
|
+
return xe(e, r, n, !1);
|
|
662
662
|
}
|
|
663
|
-
var
|
|
664
|
-
W.Fragment =
|
|
663
|
+
var gt = pt, ht = vt;
|
|
664
|
+
W.Fragment = u, W.jsx = gt, W.jsxs = ht;
|
|
665
665
|
}()), W;
|
|
666
666
|
}
|
|
667
|
-
process.env.NODE_ENV === "production" ?
|
|
668
|
-
var
|
|
669
|
-
function
|
|
670
|
-
return
|
|
667
|
+
process.env.NODE_ENV === "production" ? oe.exports = St() : oe.exports = Ot();
|
|
668
|
+
var se = oe.exports;
|
|
669
|
+
function Tt(t) {
|
|
670
|
+
return wt(t.recommendationComponent, {
|
|
671
671
|
// eslint-disable-next-line react/prop-types
|
|
672
672
|
nostoRecommendation: t.nostoRecommendation
|
|
673
673
|
});
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function jt(t) {
|
|
676
676
|
if (!window.nostojs)
|
|
677
677
|
throw new Error("Nosto has not yet been initialized");
|
|
678
|
-
window.nostojs((
|
|
679
|
-
|
|
678
|
+
window.nostojs((o) => {
|
|
679
|
+
o.placements.injectCampaigns(t.recommendations);
|
|
680
680
|
});
|
|
681
681
|
}
|
|
682
682
|
function k() {
|
|
683
|
-
const { responseMode: t, recommendationComponent:
|
|
683
|
+
const { responseMode: t, recommendationComponent: o } = ie(), a = re({});
|
|
684
684
|
if (t == "HTML")
|
|
685
|
-
return { renderCampaigns:
|
|
686
|
-
function
|
|
687
|
-
var
|
|
688
|
-
const
|
|
689
|
-
for (const
|
|
690
|
-
const g =
|
|
691
|
-
|
|
692
|
-
/* @__PURE__ */
|
|
693
|
-
|
|
685
|
+
return { renderCampaigns: jt };
|
|
686
|
+
function u(i) {
|
|
687
|
+
var w;
|
|
688
|
+
const v = ((w = i.campaigns) == null ? void 0 : w.recommendations) ?? {};
|
|
689
|
+
for (const p in v) {
|
|
690
|
+
const g = v[p], P = "#" + p, E = document.querySelector(P);
|
|
691
|
+
E && (a.current[p] || (a.current[p] = Ct(E)), a.current[p].render(
|
|
692
|
+
/* @__PURE__ */ se.jsx(
|
|
693
|
+
Tt,
|
|
694
694
|
{
|
|
695
|
-
recommendationComponent:
|
|
695
|
+
recommendationComponent: o,
|
|
696
696
|
nostoRecommendation: g
|
|
697
697
|
}
|
|
698
698
|
)
|
|
699
699
|
));
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
|
-
return { renderCampaigns:
|
|
702
|
+
return { renderCampaigns: u };
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function xt() {
|
|
705
705
|
return typeof window.nosto < "u";
|
|
706
706
|
}
|
|
707
|
-
function
|
|
708
|
-
return new Promise((a,
|
|
707
|
+
function kt(t, o) {
|
|
708
|
+
return new Promise((a, u) => {
|
|
709
709
|
const i = document.createElement("script");
|
|
710
|
-
i.type = "text/javascript", i.src = t, i.async = !0, i.onload = () => a(), i.onerror = () =>
|
|
710
|
+
i.type = "text/javascript", i.src = t, i.async = !0, i.onload = () => a(), i.onerror = () => u(), Object.entries((o == null ? void 0 : o.attributes) ?? {}).forEach(([v, w]) => i.setAttribute(v, w)), (o == null ? void 0 : o.position) === "head" ? document.head.appendChild(i) : document.body.appendChild(i);
|
|
711
711
|
});
|
|
712
712
|
}
|
|
713
|
-
function
|
|
714
|
-
const { host:
|
|
715
|
-
return
|
|
713
|
+
function Nt(t) {
|
|
714
|
+
const { host: o = "connect.nosto.com", scriptLoader: a = kt, account: u, shopifyMarkets: i, loadScript: v = !0 } = t, [w, p] = bt(!1);
|
|
715
|
+
return ae(() => {
|
|
716
716
|
function g() {
|
|
717
717
|
var f;
|
|
718
718
|
"nostoReactTest" in window && ((f = window.nosto) == null || f.reload({
|
|
719
719
|
site: "localhost"
|
|
720
|
-
})),
|
|
720
|
+
})), p(!0);
|
|
721
721
|
}
|
|
722
722
|
async function P(f, _ = {}) {
|
|
723
|
-
const O = `//${
|
|
724
|
-
await a(O, { attributes:
|
|
725
|
-
}
|
|
726
|
-
function
|
|
727
|
-
var
|
|
728
|
-
const f = document.querySelector("[nosto-client-script]"), _ = String((i == null ? void 0 : i.marketId) || ""), O = (i == null ? void 0 : i.language) || "",
|
|
729
|
-
if (!f ||
|
|
730
|
-
|
|
723
|
+
const O = `//${o}${f}`, A = { "nosto-client-script": "", ..._ };
|
|
724
|
+
await a(O, { attributes: A }), g();
|
|
725
|
+
}
|
|
726
|
+
function E() {
|
|
727
|
+
var M, Y;
|
|
728
|
+
const f = document.querySelector("[nosto-client-script]"), _ = String((i == null ? void 0 : i.marketId) || ""), O = (i == null ? void 0 : i.language) || "", A = (f == null ? void 0 : f.getAttribute("nosto-language")) !== O || (f == null ? void 0 : f.getAttribute("nosto-market-id")) !== _;
|
|
729
|
+
if (!f || A) {
|
|
730
|
+
w && p(!1);
|
|
731
731
|
const S = document.querySelector("#nosto-sandbox");
|
|
732
|
-
(
|
|
733
|
-
const
|
|
734
|
-
P(
|
|
732
|
+
(M = f == null ? void 0 : f.parentNode) == null || M.removeChild(f), (Y = S == null ? void 0 : S.parentNode) == null || Y.removeChild(S);
|
|
733
|
+
const R = `/script/shopify/market/nosto.js?merchant=${u}&market=${_}&locale=${O.toLowerCase()}`;
|
|
734
|
+
P(R, { "nosto-language": O, "nosto-market-id": _ });
|
|
735
735
|
}
|
|
736
736
|
}
|
|
737
737
|
if (window.nostojs || (window.nostojs = (f) => {
|
|
738
738
|
(window.nostojs.q = window.nostojs.q || []).push(f);
|
|
739
|
-
}, window.nostojs((f) => f.setAutoLoad(!1))), !
|
|
739
|
+
}, window.nostojs((f) => f.setAutoLoad(!1))), !v) {
|
|
740
740
|
window.nosto ? g() : window.nostojs(g);
|
|
741
741
|
return;
|
|
742
742
|
}
|
|
743
|
-
if (!
|
|
744
|
-
const f = `/include/${
|
|
743
|
+
if (!xt() && !i) {
|
|
744
|
+
const f = `/include/${u}`;
|
|
745
745
|
P(f);
|
|
746
746
|
}
|
|
747
|
-
i &&
|
|
748
|
-
}, [i == null ? void 0 : i.marketId, i == null ? void 0 : i.language]), { clientScriptLoaded:
|
|
747
|
+
i && E();
|
|
748
|
+
}, [i == null ? void 0 : i.marketId, i == null ? void 0 : i.language]), { clientScriptLoaded: w };
|
|
749
749
|
}
|
|
750
|
-
function
|
|
751
|
-
|
|
752
|
-
|
|
750
|
+
function Ht(t) {
|
|
751
|
+
return At(t), null;
|
|
752
|
+
}
|
|
753
|
+
function At(t) {
|
|
754
|
+
const { renderCampaigns: o } = k();
|
|
755
|
+
x(
|
|
753
756
|
async (a) => {
|
|
754
|
-
const
|
|
755
|
-
|
|
757
|
+
const u = await a.defaultSession().viewNotFound().setPlacements((t == null ? void 0 : t.placements) || a.placements.getPlacements()).load();
|
|
758
|
+
o(u);
|
|
756
759
|
}
|
|
757
|
-
)
|
|
760
|
+
);
|
|
758
761
|
}
|
|
759
|
-
function
|
|
760
|
-
|
|
761
|
-
|
|
762
|
+
function zt(t) {
|
|
763
|
+
return Dt(t), null;
|
|
764
|
+
}
|
|
765
|
+
function Dt(t) {
|
|
766
|
+
const { renderCampaigns: o } = k();
|
|
767
|
+
x(
|
|
762
768
|
async (a) => {
|
|
763
|
-
const
|
|
764
|
-
|
|
769
|
+
const u = await a.defaultSession().viewOther().setPlacements((t == null ? void 0 : t.placements) || a.placements.getPlacements()).load();
|
|
770
|
+
o(u);
|
|
765
771
|
}
|
|
766
|
-
)
|
|
772
|
+
);
|
|
767
773
|
}
|
|
768
|
-
function
|
|
769
|
-
|
|
770
|
-
|
|
774
|
+
function Jt(t) {
|
|
775
|
+
return Ft(t), null;
|
|
776
|
+
}
|
|
777
|
+
function Ft(t) {
|
|
778
|
+
const { renderCampaigns: o } = k();
|
|
779
|
+
x(
|
|
771
780
|
async (a) => {
|
|
772
|
-
const
|
|
773
|
-
|
|
781
|
+
const u = await a.defaultSession().viewCart().setPlacements((t == null ? void 0 : t.placements) || a.placements.getPlacements()).load();
|
|
782
|
+
o(u);
|
|
774
783
|
}
|
|
775
|
-
)
|
|
784
|
+
);
|
|
776
785
|
}
|
|
777
|
-
function
|
|
778
|
-
|
|
779
|
-
return x(
|
|
780
|
-
async (m) => {
|
|
781
|
-
const h = await m.defaultSession().viewProduct(a ?? n).setPlacements(c || m.placements.getPlacements()).load();
|
|
782
|
-
i(h);
|
|
783
|
-
},
|
|
784
|
-
[n, a == null ? void 0 : a.selected_sku_id]
|
|
785
|
-
), null;
|
|
786
|
+
function Gt(t) {
|
|
787
|
+
return Lt(t), null;
|
|
786
788
|
}
|
|
787
|
-
function
|
|
788
|
-
const {
|
|
789
|
-
|
|
789
|
+
function Lt({ product: t, tagging: o, placements: a }) {
|
|
790
|
+
const { renderCampaigns: u } = k();
|
|
791
|
+
x(
|
|
790
792
|
async (i) => {
|
|
791
|
-
const
|
|
792
|
-
|
|
793
|
+
const v = await i.defaultSession().viewProduct(o ?? t).setPlacements(a || i.placements.getPlacements()).load();
|
|
794
|
+
u(v);
|
|
793
795
|
},
|
|
794
|
-
[
|
|
795
|
-
)
|
|
796
|
+
[t, o == null ? void 0 : o.selected_sku_id]
|
|
797
|
+
);
|
|
796
798
|
}
|
|
797
|
-
function
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
799
|
+
function Kt(t) {
|
|
800
|
+
return It(t), null;
|
|
801
|
+
}
|
|
802
|
+
function It({ category: t, placements: o }) {
|
|
803
|
+
const { renderCampaigns: a } = k();
|
|
804
|
+
x(
|
|
805
|
+
async (u) => {
|
|
806
|
+
const i = await u.defaultSession().viewCategory(t).setPlacements(o || u.placements.getPlacements()).load();
|
|
807
|
+
a(i);
|
|
808
|
+
},
|
|
809
|
+
[t]
|
|
810
|
+
);
|
|
811
|
+
}
|
|
812
|
+
function Xt(t) {
|
|
813
|
+
return $t(t), null;
|
|
814
|
+
}
|
|
815
|
+
function $t({ query: t, placements: o }) {
|
|
816
|
+
const { renderCampaigns: a } = k();
|
|
817
|
+
x(
|
|
818
|
+
async (u) => {
|
|
819
|
+
const i = await u.defaultSession().viewSearch(t).setPlacements(o || u.placements.getPlacements()).load();
|
|
820
|
+
a(i);
|
|
803
821
|
},
|
|
804
|
-
[
|
|
805
|
-
)
|
|
822
|
+
[t]
|
|
823
|
+
);
|
|
806
824
|
}
|
|
807
825
|
function V(t) {
|
|
808
|
-
return !t || typeof t != "object" ||
|
|
809
|
-
const
|
|
810
|
-
return
|
|
826
|
+
return !t || typeof t != "object" || Wt(t) || Vt(t) ? t : Array.isArray(t) ? t.map(V) : Object.keys(t).reduce((o, a) => {
|
|
827
|
+
const u = a[0].toLowerCase() + a.slice(1).replace(/([A-Z]+)/g, (i, v) => "_" + v.toLowerCase());
|
|
828
|
+
return o[u] = V(t[a]), o;
|
|
811
829
|
}, {});
|
|
812
830
|
}
|
|
813
|
-
function
|
|
831
|
+
function Wt(t) {
|
|
814
832
|
return Object.prototype.toString.call(t) === "[object Date]";
|
|
815
833
|
}
|
|
816
|
-
function
|
|
834
|
+
function Vt(t) {
|
|
817
835
|
return Object.prototype.toString.call(t) === "[object RegExp]";
|
|
818
836
|
}
|
|
819
|
-
function
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
837
|
+
function Zt(t) {
|
|
838
|
+
return Mt(t), null;
|
|
839
|
+
}
|
|
840
|
+
function Mt({ order: t, placements: o }) {
|
|
841
|
+
const { renderCampaigns: a } = k();
|
|
842
|
+
x(
|
|
843
|
+
async (u) => {
|
|
844
|
+
const i = await u.defaultSession().addOrder(V(t)).setPlacements(o || u.placements.getPlacements()).load();
|
|
845
|
+
a(i);
|
|
825
846
|
},
|
|
826
|
-
[
|
|
847
|
+
[t],
|
|
827
848
|
{ deep: !0 }
|
|
828
|
-
)
|
|
849
|
+
);
|
|
829
850
|
}
|
|
830
|
-
function
|
|
831
|
-
|
|
832
|
-
|
|
851
|
+
function Qt(t) {
|
|
852
|
+
return Yt(t), null;
|
|
853
|
+
}
|
|
854
|
+
function Yt(t) {
|
|
855
|
+
const { renderCampaigns: o } = k();
|
|
856
|
+
x(
|
|
833
857
|
async (a) => {
|
|
834
|
-
const
|
|
835
|
-
|
|
858
|
+
const u = await a.defaultSession().viewFrontPage().setPlacements((t == null ? void 0 : t.placements) || a.placements.getPlacements()).load();
|
|
859
|
+
o(u);
|
|
836
860
|
}
|
|
837
|
-
)
|
|
861
|
+
);
|
|
838
862
|
}
|
|
839
|
-
function
|
|
840
|
-
|
|
841
|
-
return /* @__PURE__ */ M.jsx("div", { className: "nosto_element", id: n }, n + (a || ""));
|
|
863
|
+
function er({ id: t, pageType: o }) {
|
|
864
|
+
return /* @__PURE__ */ se.jsx("div", { className: "nosto_element", id: t }, t + (o || ""));
|
|
842
865
|
}
|
|
843
|
-
function
|
|
866
|
+
function tr(t) {
|
|
844
867
|
const {
|
|
845
|
-
account:
|
|
868
|
+
account: o,
|
|
846
869
|
multiCurrency: a = !1,
|
|
847
|
-
children:
|
|
870
|
+
children: u,
|
|
848
871
|
recommendationComponent: i
|
|
849
|
-
} = t,
|
|
850
|
-
if (i && !
|
|
872
|
+
} = t, v = a ? t.currentVariation : "";
|
|
873
|
+
if (i && !_t(i))
|
|
851
874
|
throw new Error(
|
|
852
875
|
"The recommendationComponent prop must be a valid React element. Please provide a valid React element."
|
|
853
876
|
);
|
|
854
|
-
const
|
|
855
|
-
return /* @__PURE__ */
|
|
877
|
+
const w = i ? "JSON_ORIGINAL" : "HTML", { clientScriptLoaded: p } = Nt(t);
|
|
878
|
+
return /* @__PURE__ */ se.jsx(
|
|
856
879
|
$e.Provider,
|
|
857
880
|
{
|
|
858
881
|
value: {
|
|
859
|
-
account:
|
|
860
|
-
clientScriptLoaded:
|
|
861
|
-
currentVariation:
|
|
862
|
-
responseMode:
|
|
882
|
+
account: o,
|
|
883
|
+
clientScriptLoaded: p,
|
|
884
|
+
currentVariation: v,
|
|
885
|
+
responseMode: w,
|
|
863
886
|
recommendationComponent: i
|
|
864
887
|
},
|
|
865
|
-
children:
|
|
888
|
+
children: u
|
|
866
889
|
}
|
|
867
890
|
);
|
|
868
891
|
}
|
|
869
|
-
function
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
892
|
+
function rr(t) {
|
|
893
|
+
return Ut(t), null;
|
|
894
|
+
}
|
|
895
|
+
function Ut({ cart: t, customer: o } = {}) {
|
|
896
|
+
const { clientScriptLoaded: a } = ie();
|
|
897
|
+
Ie(() => {
|
|
898
|
+
const u = t ? V(t) : void 0, i = o ? V(o) : void 0;
|
|
899
|
+
a && window.nostojs((v) => {
|
|
900
|
+
v.defaultSession().setResponseMode("HTML").setCart(u).setCustomer(i).viewOther().load({ skipPageViews: !0 });
|
|
875
901
|
});
|
|
876
|
-
}, [
|
|
902
|
+
}, [a, t, o]);
|
|
877
903
|
}
|
|
878
904
|
export {
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
905
|
+
Ht as Nosto404,
|
|
906
|
+
Kt as NostoCategory,
|
|
907
|
+
Jt as NostoCheckout,
|
|
882
908
|
$e as NostoContext,
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
909
|
+
Qt as NostoHome,
|
|
910
|
+
Zt as NostoOrder,
|
|
911
|
+
zt as NostoOther,
|
|
912
|
+
er as NostoPlacement,
|
|
913
|
+
Gt as NostoProduct,
|
|
914
|
+
tr as NostoProvider,
|
|
915
|
+
Xt as NostoSearch,
|
|
916
|
+
rr as NostoSession,
|
|
917
|
+
At as useNosto404,
|
|
918
|
+
It as useNostoCategory,
|
|
919
|
+
Ft as useNostoCheckout,
|
|
920
|
+
ie as useNostoContext,
|
|
921
|
+
Yt as useNostoHome,
|
|
922
|
+
Mt as useNostoOrder,
|
|
923
|
+
Dt as useNostoOther,
|
|
924
|
+
Lt as useNostoProduct,
|
|
925
|
+
$t as useNostoSearch,
|
|
926
|
+
Ut as useNostoSession
|
|
892
927
|
};
|