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