@nosto/nosto-react 0.4.3 → 0.5.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/dist/index.d.ts +519 -0
- package/dist/index.es.js +947 -449
- package/dist/index.umd.js +18 -2
- package/package.json +8 -6
- package/src/types.ts +6 -6
package/dist/index.es.js
CHANGED
|
@@ -1,89 +1,62 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { createRoot } from "react-dom/client";
|
|
3
|
-
const
|
|
1
|
+
import z, { createContext as Cr, useContext as br, useEffect as ae, useRef as ve, useMemo as Er, isValidElement as wr, useState as Sr } from "react";
|
|
2
|
+
import { createRoot as Tr } from "react-dom/client";
|
|
3
|
+
const Je = Cr({
|
|
4
4
|
account: "",
|
|
5
5
|
currentVariation: "",
|
|
6
6
|
pageType: "",
|
|
7
7
|
responseMode: "HTML",
|
|
8
|
-
clientScriptLoaded:
|
|
9
|
-
useRenderCampaigns: () => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
}
|
|
8
|
+
clientScriptLoaded: !1,
|
|
9
|
+
useRenderCampaigns: () => ({
|
|
10
|
+
renderCampaigns: () => {
|
|
11
|
+
},
|
|
12
|
+
pageTypeUpdated: !1
|
|
13
|
+
})
|
|
16
14
|
});
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
if (!
|
|
15
|
+
function x() {
|
|
16
|
+
const o = br(Je);
|
|
17
|
+
if (!o)
|
|
20
18
|
throw new Error("No nosto context found");
|
|
21
|
-
|
|
22
|
-
return context;
|
|
19
|
+
return o;
|
|
23
20
|
}
|
|
24
|
-
const
|
|
25
|
-
function
|
|
26
|
-
if (!
|
|
27
|
-
return
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
return
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
return false;
|
|
34
|
-
if (!prototype.hasOwnProperty("isPrototypeOf")) {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
return true;
|
|
21
|
+
const qe = (o) => String(o) === "[object Object]";
|
|
22
|
+
function Be(o) {
|
|
23
|
+
if (!qe(o))
|
|
24
|
+
return !1;
|
|
25
|
+
const s = o.constructor;
|
|
26
|
+
if (s === void 0)
|
|
27
|
+
return !0;
|
|
28
|
+
const r = s.prototype;
|
|
29
|
+
return !(!qe(r) || !r.hasOwnProperty("isPrototypeOf"));
|
|
38
30
|
}
|
|
39
|
-
function
|
|
40
|
-
if (
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
return a.every((v, i) => deepCompare(v, b[i]));
|
|
31
|
+
function ye(o, s) {
|
|
32
|
+
if (o === s)
|
|
33
|
+
return !0;
|
|
34
|
+
if (o instanceof Date && s instanceof Date)
|
|
35
|
+
return o.getTime() === s.getTime();
|
|
36
|
+
if (o instanceof Array && s instanceof Array)
|
|
37
|
+
return o.length !== s.length ? !1 : o.every((r, d) => ye(r, s[d]));
|
|
38
|
+
if (Be(o) && Be(s)) {
|
|
39
|
+
const r = Object.entries(o);
|
|
40
|
+
return r.length !== Object.keys(s).length ? !1 : r.every(([d, m]) => ye(m, s[d]));
|
|
51
41
|
}
|
|
52
|
-
|
|
53
|
-
const entriesA = Object.entries(a);
|
|
54
|
-
if (entriesA.length !== Object.keys(b).length) {
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
return entriesA.every(([k2, v]) => deepCompare(v, b[k2]));
|
|
58
|
-
}
|
|
59
|
-
return false;
|
|
42
|
+
return !1;
|
|
60
43
|
}
|
|
61
|
-
function
|
|
62
|
-
return
|
|
44
|
+
function ze(o, s) {
|
|
45
|
+
return ae(o, Pr(s));
|
|
63
46
|
}
|
|
64
|
-
function
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
if (!deepCompare(value, ref.current)) {
|
|
68
|
-
ref.current = value;
|
|
69
|
-
signalRef.current += 1;
|
|
70
|
-
}
|
|
71
|
-
return useMemo(() => ref.current, [signalRef.current]);
|
|
47
|
+
function Pr(o) {
|
|
48
|
+
const s = ve(o), r = ve(0);
|
|
49
|
+
return ye(o, s.current) || (s.current = o, r.current += 1), Er(() => s.current, [r.current]);
|
|
72
50
|
}
|
|
73
|
-
function
|
|
74
|
-
const { clientScriptLoaded, currentVariation, responseMode } =
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
cb(api);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}, [clientScriptLoaded, currentVariation, responseMode, ...deps != null ? deps : []]);
|
|
51
|
+
function U(o, s, r) {
|
|
52
|
+
const { clientScriptLoaded: d, currentVariation: m, responseMode: u } = x();
|
|
53
|
+
(r != null && r.deep ? ze : ae)(() => {
|
|
54
|
+
d && window.nostojs((y) => {
|
|
55
|
+
y.defaultSession().setVariation(m).setResponseMode(u), o(y);
|
|
56
|
+
});
|
|
57
|
+
}, [d, m, u, ...s ?? []]);
|
|
84
58
|
}
|
|
85
|
-
var
|
|
86
|
-
var reactJsxRuntime_production_min = {};
|
|
59
|
+
var he = { exports: {} }, H = {};
|
|
87
60
|
/**
|
|
88
61
|
* @license React
|
|
89
62
|
* react-jsx-runtime.production.min.js
|
|
@@ -93,43 +66,629 @@ var reactJsxRuntime_production_min = {};
|
|
|
93
66
|
* This source code is licensed under the MIT license found in the
|
|
94
67
|
* LICENSE file in the root directory of this source tree.
|
|
95
68
|
*/
|
|
96
|
-
var
|
|
97
|
-
function
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
for (
|
|
106
|
-
|
|
107
|
-
|
|
69
|
+
var Ge;
|
|
70
|
+
function gr() {
|
|
71
|
+
if (Ge)
|
|
72
|
+
return H;
|
|
73
|
+
Ge = 1;
|
|
74
|
+
var o = z, s = Symbol.for("react.element"), r = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, m = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
75
|
+
function l(y, n, R) {
|
|
76
|
+
var w, T = {}, F = null, L = null;
|
|
77
|
+
R !== void 0 && (F = "" + R), n.key !== void 0 && (F = "" + n.key), n.ref !== void 0 && (L = n.ref);
|
|
78
|
+
for (w in n)
|
|
79
|
+
d.call(n, w) && !u.hasOwnProperty(w) && (T[w] = n[w]);
|
|
80
|
+
if (y && y.defaultProps)
|
|
81
|
+
for (w in n = y.defaultProps, n)
|
|
82
|
+
T[w] === void 0 && (T[w] = n[w]);
|
|
83
|
+
return { $$typeof: s, type: y, key: F, ref: L, props: T, _owner: m.current };
|
|
84
|
+
}
|
|
85
|
+
return H.Fragment = r, H.jsx = l, H.jsxs = l, H;
|
|
108
86
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
87
|
+
var J = {};
|
|
88
|
+
/**
|
|
89
|
+
* @license React
|
|
90
|
+
* react-jsx-runtime.development.js
|
|
91
|
+
*
|
|
92
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the MIT license found in the
|
|
95
|
+
* LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/
|
|
97
|
+
var He;
|
|
98
|
+
function Or() {
|
|
99
|
+
return He || (He = 1, process.env.NODE_ENV !== "production" && function() {
|
|
100
|
+
var o = z, s = Symbol.for("react.element"), r = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), u = Symbol.for("react.profiler"), l = Symbol.for("react.provider"), y = Symbol.for("react.context"), n = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), L = Symbol.for("react.offscreen"), X = Symbol.iterator, oe = "@@iterator";
|
|
101
|
+
function j(e) {
|
|
102
|
+
if (e === null || typeof e != "object")
|
|
103
|
+
return null;
|
|
104
|
+
var t = X && e[X] || e[oe];
|
|
105
|
+
return typeof t == "function" ? t : null;
|
|
106
|
+
}
|
|
107
|
+
var P = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
108
|
+
function b(e) {
|
|
109
|
+
{
|
|
110
|
+
for (var t = arguments.length, a = new Array(t > 1 ? t - 1 : 0), c = 1; c < t; c++)
|
|
111
|
+
a[c - 1] = arguments[c];
|
|
112
|
+
_("error", e, a);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function _(e, t, a) {
|
|
116
|
+
{
|
|
117
|
+
var c = P.ReactDebugCurrentFrame, v = c.getStackAddendum();
|
|
118
|
+
v !== "" && (t += "%s", a = a.concat([v]));
|
|
119
|
+
var h = a.map(function(p) {
|
|
120
|
+
return String(p);
|
|
121
|
+
});
|
|
122
|
+
h.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, h);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
var g = !1, O = !1, $ = !1, V = !1, se = !1, Z;
|
|
126
|
+
Z = Symbol.for("react.module.reference");
|
|
127
|
+
function Q(e) {
|
|
128
|
+
return !!(typeof e == "string" || typeof e == "function" || e === d || e === u || se || e === m || e === R || e === w || V || e === L || g || O || $ || typeof e == "object" && e !== null && (e.$$typeof === F || e.$$typeof === T || e.$$typeof === l || e.$$typeof === y || e.$$typeof === n || // This needs to include all possible module reference object
|
|
129
|
+
// types supported by any Flight configuration anywhere since
|
|
130
|
+
// we don't know which Flight build this will end up being used
|
|
131
|
+
// with.
|
|
132
|
+
e.$$typeof === Z || e.getModuleId !== void 0));
|
|
133
|
+
}
|
|
134
|
+
function Re(e, t, a) {
|
|
135
|
+
var c = e.displayName;
|
|
136
|
+
if (c)
|
|
137
|
+
return c;
|
|
138
|
+
var v = t.displayName || t.name || "";
|
|
139
|
+
return v !== "" ? a + "(" + v + ")" : a;
|
|
140
|
+
}
|
|
141
|
+
function Ce(e) {
|
|
142
|
+
return e.displayName || "Context";
|
|
143
|
+
}
|
|
144
|
+
function A(e) {
|
|
145
|
+
if (e == null)
|
|
146
|
+
return null;
|
|
147
|
+
if (typeof e.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
148
|
+
return e.displayName || e.name || null;
|
|
149
|
+
if (typeof e == "string")
|
|
150
|
+
return e;
|
|
151
|
+
switch (e) {
|
|
152
|
+
case d:
|
|
153
|
+
return "Fragment";
|
|
154
|
+
case r:
|
|
155
|
+
return "Portal";
|
|
156
|
+
case u:
|
|
157
|
+
return "Profiler";
|
|
158
|
+
case m:
|
|
159
|
+
return "StrictMode";
|
|
160
|
+
case R:
|
|
161
|
+
return "Suspense";
|
|
162
|
+
case w:
|
|
163
|
+
return "SuspenseList";
|
|
164
|
+
}
|
|
165
|
+
if (typeof e == "object")
|
|
166
|
+
switch (e.$$typeof) {
|
|
167
|
+
case y:
|
|
168
|
+
var t = e;
|
|
169
|
+
return Ce(t) + ".Consumer";
|
|
170
|
+
case l:
|
|
171
|
+
var a = e;
|
|
172
|
+
return Ce(a._context) + ".Provider";
|
|
173
|
+
case n:
|
|
174
|
+
return Re(e, e.render, "ForwardRef");
|
|
175
|
+
case T:
|
|
176
|
+
var c = e.displayName || null;
|
|
177
|
+
return c !== null ? c : A(e.type) || "Memo";
|
|
178
|
+
case F: {
|
|
179
|
+
var v = e, h = v._payload, p = v._init;
|
|
180
|
+
try {
|
|
181
|
+
return A(p(h));
|
|
182
|
+
} catch {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
var W = Object.assign, B = 0, be, Ee, we, Se, Te, Pe, ge;
|
|
190
|
+
function Oe() {
|
|
191
|
+
}
|
|
192
|
+
Oe.__reactDisabledLog = !0;
|
|
193
|
+
function Ke() {
|
|
194
|
+
{
|
|
195
|
+
if (B === 0) {
|
|
196
|
+
be = console.log, Ee = console.info, we = console.warn, Se = console.error, Te = console.group, Pe = console.groupCollapsed, ge = console.groupEnd;
|
|
197
|
+
var e = {
|
|
198
|
+
configurable: !0,
|
|
199
|
+
enumerable: !0,
|
|
200
|
+
value: Oe,
|
|
201
|
+
writable: !0
|
|
202
|
+
};
|
|
203
|
+
Object.defineProperties(console, {
|
|
204
|
+
info: e,
|
|
205
|
+
log: e,
|
|
206
|
+
warn: e,
|
|
207
|
+
error: e,
|
|
208
|
+
group: e,
|
|
209
|
+
groupCollapsed: e,
|
|
210
|
+
groupEnd: e
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
B++;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function Xe() {
|
|
217
|
+
{
|
|
218
|
+
if (B--, B === 0) {
|
|
219
|
+
var e = {
|
|
220
|
+
configurable: !0,
|
|
221
|
+
enumerable: !0,
|
|
222
|
+
writable: !0
|
|
223
|
+
};
|
|
224
|
+
Object.defineProperties(console, {
|
|
225
|
+
log: W({}, e, {
|
|
226
|
+
value: be
|
|
227
|
+
}),
|
|
228
|
+
info: W({}, e, {
|
|
229
|
+
value: Ee
|
|
230
|
+
}),
|
|
231
|
+
warn: W({}, e, {
|
|
232
|
+
value: we
|
|
233
|
+
}),
|
|
234
|
+
error: W({}, e, {
|
|
235
|
+
value: Se
|
|
236
|
+
}),
|
|
237
|
+
group: W({}, e, {
|
|
238
|
+
value: Te
|
|
239
|
+
}),
|
|
240
|
+
groupCollapsed: W({}, e, {
|
|
241
|
+
value: Pe
|
|
242
|
+
}),
|
|
243
|
+
groupEnd: W({}, e, {
|
|
244
|
+
value: ge
|
|
245
|
+
})
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
B < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
var ie = P.ReactCurrentDispatcher, ce;
|
|
252
|
+
function k(e, t, a) {
|
|
253
|
+
{
|
|
254
|
+
if (ce === void 0)
|
|
255
|
+
try {
|
|
256
|
+
throw Error();
|
|
257
|
+
} catch (v) {
|
|
258
|
+
var c = v.stack.trim().match(/\n( *(at )?)/);
|
|
259
|
+
ce = c && c[1] || "";
|
|
260
|
+
}
|
|
261
|
+
return `
|
|
262
|
+
` + ce + e;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
var le = !1, ee;
|
|
266
|
+
{
|
|
267
|
+
var Ze = typeof WeakMap == "function" ? WeakMap : Map;
|
|
268
|
+
ee = new Ze();
|
|
269
|
+
}
|
|
270
|
+
function Ne(e, t) {
|
|
271
|
+
if (!e || le)
|
|
272
|
+
return "";
|
|
273
|
+
{
|
|
274
|
+
var a = ee.get(e);
|
|
275
|
+
if (a !== void 0)
|
|
276
|
+
return a;
|
|
277
|
+
}
|
|
278
|
+
var c;
|
|
279
|
+
le = !0;
|
|
280
|
+
var v = Error.prepareStackTrace;
|
|
281
|
+
Error.prepareStackTrace = void 0;
|
|
282
|
+
var h;
|
|
283
|
+
h = ie.current, ie.current = null, Ke();
|
|
284
|
+
try {
|
|
285
|
+
if (t) {
|
|
286
|
+
var p = function() {
|
|
287
|
+
throw Error();
|
|
288
|
+
};
|
|
289
|
+
if (Object.defineProperty(p.prototype, "props", {
|
|
290
|
+
set: function() {
|
|
291
|
+
throw Error();
|
|
292
|
+
}
|
|
293
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
294
|
+
try {
|
|
295
|
+
Reflect.construct(p, []);
|
|
296
|
+
} catch (D) {
|
|
297
|
+
c = D;
|
|
298
|
+
}
|
|
299
|
+
Reflect.construct(e, [], p);
|
|
300
|
+
} else {
|
|
301
|
+
try {
|
|
302
|
+
p.call();
|
|
303
|
+
} catch (D) {
|
|
304
|
+
c = D;
|
|
305
|
+
}
|
|
306
|
+
e.call(p.prototype);
|
|
307
|
+
}
|
|
308
|
+
} else {
|
|
309
|
+
try {
|
|
310
|
+
throw Error();
|
|
311
|
+
} catch (D) {
|
|
312
|
+
c = D;
|
|
313
|
+
}
|
|
314
|
+
e();
|
|
315
|
+
}
|
|
316
|
+
} catch (D) {
|
|
317
|
+
if (D && c && typeof D.stack == "string") {
|
|
318
|
+
for (var f = D.stack.split(`
|
|
319
|
+
`), S = c.stack.split(`
|
|
320
|
+
`), C = f.length - 1, E = S.length - 1; C >= 1 && E >= 0 && f[C] !== S[E]; )
|
|
321
|
+
E--;
|
|
322
|
+
for (; C >= 1 && E >= 0; C--, E--)
|
|
323
|
+
if (f[C] !== S[E]) {
|
|
324
|
+
if (C !== 1 || E !== 1)
|
|
325
|
+
do
|
|
326
|
+
if (C--, E--, E < 0 || f[C] !== S[E]) {
|
|
327
|
+
var N = `
|
|
328
|
+
` + f[C].replace(" at new ", " at ");
|
|
329
|
+
return e.displayName && N.includes("<anonymous>") && (N = N.replace("<anonymous>", e.displayName)), typeof e == "function" && ee.set(e, N), N;
|
|
330
|
+
}
|
|
331
|
+
while (C >= 1 && E >= 0);
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
} finally {
|
|
336
|
+
le = !1, ie.current = h, Xe(), Error.prepareStackTrace = v;
|
|
337
|
+
}
|
|
338
|
+
var M = e ? e.displayName || e.name : "", Me = M ? k(M) : "";
|
|
339
|
+
return typeof e == "function" && ee.set(e, Me), Me;
|
|
340
|
+
}
|
|
341
|
+
function Qe(e, t, a) {
|
|
342
|
+
return Ne(e, !1);
|
|
343
|
+
}
|
|
344
|
+
function ke(e) {
|
|
345
|
+
var t = e.prototype;
|
|
346
|
+
return !!(t && t.isReactComponent);
|
|
347
|
+
}
|
|
348
|
+
function re(e, t, a) {
|
|
349
|
+
if (e == null)
|
|
350
|
+
return "";
|
|
351
|
+
if (typeof e == "function")
|
|
352
|
+
return Ne(e, ke(e));
|
|
353
|
+
if (typeof e == "string")
|
|
354
|
+
return k(e);
|
|
355
|
+
switch (e) {
|
|
356
|
+
case R:
|
|
357
|
+
return k("Suspense");
|
|
358
|
+
case w:
|
|
359
|
+
return k("SuspenseList");
|
|
360
|
+
}
|
|
361
|
+
if (typeof e == "object")
|
|
362
|
+
switch (e.$$typeof) {
|
|
363
|
+
case n:
|
|
364
|
+
return Qe(e.render);
|
|
365
|
+
case T:
|
|
366
|
+
return re(e.type, t, a);
|
|
367
|
+
case F: {
|
|
368
|
+
var c = e, v = c._payload, h = c._init;
|
|
369
|
+
try {
|
|
370
|
+
return re(h(v), t, a);
|
|
371
|
+
} catch {
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
return "";
|
|
376
|
+
}
|
|
377
|
+
var te = Object.prototype.hasOwnProperty, je = {}, xe = P.ReactDebugCurrentFrame;
|
|
378
|
+
function ne(e) {
|
|
379
|
+
if (e) {
|
|
380
|
+
var t = e._owner, a = re(e.type, e._source, t ? t.type : null);
|
|
381
|
+
xe.setExtraStackFrame(a);
|
|
382
|
+
} else
|
|
383
|
+
xe.setExtraStackFrame(null);
|
|
384
|
+
}
|
|
385
|
+
function er(e, t, a, c, v) {
|
|
386
|
+
{
|
|
387
|
+
var h = Function.call.bind(te);
|
|
388
|
+
for (var p in e)
|
|
389
|
+
if (h(e, p)) {
|
|
390
|
+
var f = void 0;
|
|
391
|
+
try {
|
|
392
|
+
if (typeof e[p] != "function") {
|
|
393
|
+
var S = Error((c || "React class") + ": " + a + " type `" + p + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[p] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
394
|
+
throw S.name = "Invariant Violation", S;
|
|
395
|
+
}
|
|
396
|
+
f = e[p](t, p, c, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
397
|
+
} catch (C) {
|
|
398
|
+
f = C;
|
|
399
|
+
}
|
|
400
|
+
f && !(f instanceof Error) && (ne(v), b("%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).", c || "React class", a, p, typeof f), ne(null)), f instanceof Error && !(f.message in je) && (je[f.message] = !0, ne(v), b("Failed %s type: %s", a, f.message), ne(null));
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
var rr = Array.isArray;
|
|
405
|
+
function ue(e) {
|
|
406
|
+
return rr(e);
|
|
407
|
+
}
|
|
408
|
+
function tr(e) {
|
|
409
|
+
{
|
|
410
|
+
var t = typeof Symbol == "function" && Symbol.toStringTag, a = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
411
|
+
return a;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
function nr(e) {
|
|
415
|
+
try {
|
|
416
|
+
return Fe(e), !1;
|
|
417
|
+
} catch {
|
|
418
|
+
return !0;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
function Fe(e) {
|
|
422
|
+
return "" + e;
|
|
423
|
+
}
|
|
424
|
+
function Ae(e) {
|
|
425
|
+
if (nr(e))
|
|
426
|
+
return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", tr(e)), Fe(e);
|
|
427
|
+
}
|
|
428
|
+
var G = P.ReactCurrentOwner, ar = {
|
|
429
|
+
key: !0,
|
|
430
|
+
ref: !0,
|
|
431
|
+
__self: !0,
|
|
432
|
+
__source: !0
|
|
433
|
+
}, De, Ie, de;
|
|
434
|
+
de = {};
|
|
435
|
+
function or(e) {
|
|
436
|
+
if (te.call(e, "ref")) {
|
|
437
|
+
var t = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
438
|
+
if (t && t.isReactWarning)
|
|
439
|
+
return !1;
|
|
440
|
+
}
|
|
441
|
+
return e.ref !== void 0;
|
|
442
|
+
}
|
|
443
|
+
function sr(e) {
|
|
444
|
+
if (te.call(e, "key")) {
|
|
445
|
+
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
446
|
+
if (t && t.isReactWarning)
|
|
447
|
+
return !1;
|
|
448
|
+
}
|
|
449
|
+
return e.key !== void 0;
|
|
450
|
+
}
|
|
451
|
+
function ir(e, t) {
|
|
452
|
+
if (typeof e.ref == "string" && G.current && t && G.current.stateNode !== t) {
|
|
453
|
+
var a = A(G.current.type);
|
|
454
|
+
de[a] || (b('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', A(G.current.type), e.ref), de[a] = !0);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
function cr(e, t) {
|
|
458
|
+
{
|
|
459
|
+
var a = function() {
|
|
460
|
+
De || (De = !0, b("%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)", t));
|
|
461
|
+
};
|
|
462
|
+
a.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
463
|
+
get: a,
|
|
464
|
+
configurable: !0
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
function lr(e, t) {
|
|
469
|
+
{
|
|
470
|
+
var a = function() {
|
|
471
|
+
Ie || (Ie = !0, b("%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)", t));
|
|
472
|
+
};
|
|
473
|
+
a.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
474
|
+
get: a,
|
|
475
|
+
configurable: !0
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
var ur = function(e, t, a, c, v, h, p) {
|
|
480
|
+
var f = {
|
|
481
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
482
|
+
$$typeof: s,
|
|
483
|
+
// Built-in properties that belong on the element
|
|
484
|
+
type: e,
|
|
485
|
+
key: t,
|
|
486
|
+
ref: a,
|
|
487
|
+
props: p,
|
|
488
|
+
// Record the component responsible for creating this element.
|
|
489
|
+
_owner: h
|
|
490
|
+
};
|
|
491
|
+
return f._store = {}, Object.defineProperty(f._store, "validated", {
|
|
492
|
+
configurable: !1,
|
|
493
|
+
enumerable: !1,
|
|
494
|
+
writable: !0,
|
|
495
|
+
value: !1
|
|
496
|
+
}), Object.defineProperty(f, "_self", {
|
|
497
|
+
configurable: !1,
|
|
498
|
+
enumerable: !1,
|
|
499
|
+
writable: !1,
|
|
500
|
+
value: c
|
|
501
|
+
}), Object.defineProperty(f, "_source", {
|
|
502
|
+
configurable: !1,
|
|
503
|
+
enumerable: !1,
|
|
504
|
+
writable: !1,
|
|
505
|
+
value: v
|
|
506
|
+
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
507
|
+
};
|
|
508
|
+
function dr(e, t, a, c, v) {
|
|
509
|
+
{
|
|
510
|
+
var h, p = {}, f = null, S = null;
|
|
511
|
+
a !== void 0 && (Ae(a), f = "" + a), sr(t) && (Ae(t.key), f = "" + t.key), or(t) && (S = t.ref, ir(t, v));
|
|
512
|
+
for (h in t)
|
|
513
|
+
te.call(t, h) && !ar.hasOwnProperty(h) && (p[h] = t[h]);
|
|
514
|
+
if (e && e.defaultProps) {
|
|
515
|
+
var C = e.defaultProps;
|
|
516
|
+
for (h in C)
|
|
517
|
+
p[h] === void 0 && (p[h] = C[h]);
|
|
518
|
+
}
|
|
519
|
+
if (f || S) {
|
|
520
|
+
var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
521
|
+
f && cr(p, E), S && lr(p, E);
|
|
522
|
+
}
|
|
523
|
+
return ur(e, f, S, v, c, G.current, p);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
var fe = P.ReactCurrentOwner, Le = P.ReactDebugCurrentFrame;
|
|
527
|
+
function Y(e) {
|
|
528
|
+
if (e) {
|
|
529
|
+
var t = e._owner, a = re(e.type, e._source, t ? t.type : null);
|
|
530
|
+
Le.setExtraStackFrame(a);
|
|
531
|
+
} else
|
|
532
|
+
Le.setExtraStackFrame(null);
|
|
533
|
+
}
|
|
534
|
+
var pe;
|
|
535
|
+
pe = !1;
|
|
536
|
+
function me(e) {
|
|
537
|
+
return typeof e == "object" && e !== null && e.$$typeof === s;
|
|
538
|
+
}
|
|
539
|
+
function Ue() {
|
|
540
|
+
{
|
|
541
|
+
if (fe.current) {
|
|
542
|
+
var e = A(fe.current.type);
|
|
543
|
+
if (e)
|
|
544
|
+
return `
|
|
545
|
+
|
|
546
|
+
Check the render method of \`` + e + "`.";
|
|
547
|
+
}
|
|
548
|
+
return "";
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
function fr(e) {
|
|
552
|
+
return "";
|
|
553
|
+
}
|
|
554
|
+
var $e = {};
|
|
555
|
+
function pr(e) {
|
|
556
|
+
{
|
|
557
|
+
var t = Ue();
|
|
558
|
+
if (!t) {
|
|
559
|
+
var a = typeof e == "string" ? e : e.displayName || e.name;
|
|
560
|
+
a && (t = `
|
|
561
|
+
|
|
562
|
+
Check the top-level render call using <` + a + ">.");
|
|
563
|
+
}
|
|
564
|
+
return t;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
function Ve(e, t) {
|
|
568
|
+
{
|
|
569
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
570
|
+
return;
|
|
571
|
+
e._store.validated = !0;
|
|
572
|
+
var a = pr(t);
|
|
573
|
+
if ($e[a])
|
|
574
|
+
return;
|
|
575
|
+
$e[a] = !0;
|
|
576
|
+
var c = "";
|
|
577
|
+
e && e._owner && e._owner !== fe.current && (c = " It was passed a child from " + A(e._owner.type) + "."), Y(e), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', a, c), Y(null);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
function We(e, t) {
|
|
581
|
+
{
|
|
582
|
+
if (typeof e != "object")
|
|
583
|
+
return;
|
|
584
|
+
if (ue(e))
|
|
585
|
+
for (var a = 0; a < e.length; a++) {
|
|
586
|
+
var c = e[a];
|
|
587
|
+
me(c) && Ve(c, t);
|
|
588
|
+
}
|
|
589
|
+
else if (me(e))
|
|
590
|
+
e._store && (e._store.validated = !0);
|
|
591
|
+
else if (e) {
|
|
592
|
+
var v = j(e);
|
|
593
|
+
if (typeof v == "function" && v !== e.entries)
|
|
594
|
+
for (var h = v.call(e), p; !(p = h.next()).done; )
|
|
595
|
+
me(p.value) && Ve(p.value, t);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
function mr(e) {
|
|
600
|
+
{
|
|
601
|
+
var t = e.type;
|
|
602
|
+
if (t == null || typeof t == "string")
|
|
603
|
+
return;
|
|
604
|
+
var a;
|
|
605
|
+
if (typeof t == "function")
|
|
606
|
+
a = t.propTypes;
|
|
607
|
+
else if (typeof t == "object" && (t.$$typeof === n || // Note: Memo only checks outer props here.
|
|
608
|
+
// Inner props are checked in the reconciler.
|
|
609
|
+
t.$$typeof === T))
|
|
610
|
+
a = t.propTypes;
|
|
611
|
+
else
|
|
612
|
+
return;
|
|
613
|
+
if (a) {
|
|
614
|
+
var c = A(t);
|
|
615
|
+
er(a, e.props, "prop", c, e);
|
|
616
|
+
} else if (t.PropTypes !== void 0 && !pe) {
|
|
617
|
+
pe = !0;
|
|
618
|
+
var v = A(t);
|
|
619
|
+
b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", v || "Unknown");
|
|
620
|
+
}
|
|
621
|
+
typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
function vr(e) {
|
|
625
|
+
{
|
|
626
|
+
for (var t = Object.keys(e.props), a = 0; a < t.length; a++) {
|
|
627
|
+
var c = t[a];
|
|
628
|
+
if (c !== "children" && c !== "key") {
|
|
629
|
+
Y(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", c), Y(null);
|
|
630
|
+
break;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
e.ref !== null && (Y(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), Y(null));
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
function Ye(e, t, a, c, v, h) {
|
|
637
|
+
{
|
|
638
|
+
var p = Q(e);
|
|
639
|
+
if (!p) {
|
|
640
|
+
var f = "";
|
|
641
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (f += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
642
|
+
var S = fr();
|
|
643
|
+
S ? f += S : f += Ue();
|
|
644
|
+
var C;
|
|
645
|
+
e === null ? C = "null" : ue(e) ? C = "array" : e !== void 0 && e.$$typeof === s ? (C = "<" + (A(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : C = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", C, f);
|
|
646
|
+
}
|
|
647
|
+
var E = dr(e, t, a, v, h);
|
|
648
|
+
if (E == null)
|
|
649
|
+
return E;
|
|
650
|
+
if (p) {
|
|
651
|
+
var N = t.children;
|
|
652
|
+
if (N !== void 0)
|
|
653
|
+
if (c)
|
|
654
|
+
if (ue(N)) {
|
|
655
|
+
for (var M = 0; M < N.length; M++)
|
|
656
|
+
We(N[M], e);
|
|
657
|
+
Object.freeze && Object.freeze(N);
|
|
658
|
+
} else
|
|
659
|
+
b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
660
|
+
else
|
|
661
|
+
We(N, e);
|
|
662
|
+
}
|
|
663
|
+
return e === d ? vr(E) : mr(E), E;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
function yr(e, t, a) {
|
|
667
|
+
return Ye(e, t, a, !0);
|
|
668
|
+
}
|
|
669
|
+
function hr(e, t, a) {
|
|
670
|
+
return Ye(e, t, a, !1);
|
|
671
|
+
}
|
|
672
|
+
var _r = hr, Rr = yr;
|
|
673
|
+
J.Fragment = d, J.jsx = _r, J.jsxs = Rr;
|
|
674
|
+
}()), J;
|
|
114
675
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
function
|
|
676
|
+
process.env.NODE_ENV === "production" ? he.exports = gr() : he.exports = Or();
|
|
677
|
+
var _e = he.exports;
|
|
678
|
+
const i = _e.jsx, q = _e.jsxs, I = _e.Fragment;
|
|
679
|
+
function Ar(o) {
|
|
119
680
|
const {
|
|
120
|
-
recommendationComponent,
|
|
121
|
-
useRenderCampaigns
|
|
122
|
-
} =
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return /* @__PURE__ */ jsx(Fragment, {
|
|
132
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
681
|
+
recommendationComponent: s,
|
|
682
|
+
useRenderCampaigns: r
|
|
683
|
+
} = x(), {
|
|
684
|
+
renderCampaigns: d,
|
|
685
|
+
pageTypeUpdated: m
|
|
686
|
+
} = r("404");
|
|
687
|
+
return U(async (u) => {
|
|
688
|
+
const l = await u.defaultSession().viewNotFound().setPlacements(o.placements || u.placements.getPlacements()).load();
|
|
689
|
+
d(l, u);
|
|
690
|
+
}, [s, m]), /* @__PURE__ */ i(I, {
|
|
691
|
+
children: /* @__PURE__ */ i("div", {
|
|
133
692
|
className: "nosto_page_type",
|
|
134
693
|
style: {
|
|
135
694
|
display: "none"
|
|
@@ -138,21 +697,19 @@ function Nosto404(props) {
|
|
|
138
697
|
})
|
|
139
698
|
});
|
|
140
699
|
}
|
|
141
|
-
function
|
|
142
|
-
const {
|
|
143
|
-
recommendationComponent,
|
|
144
|
-
useRenderCampaigns
|
|
145
|
-
} = useNostoContext();
|
|
700
|
+
function Dr(o) {
|
|
146
701
|
const {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
} =
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
702
|
+
recommendationComponent: s,
|
|
703
|
+
useRenderCampaigns: r
|
|
704
|
+
} = x(), {
|
|
705
|
+
renderCampaigns: d,
|
|
706
|
+
pageTypeUpdated: m
|
|
707
|
+
} = r("other");
|
|
708
|
+
return U(async (u) => {
|
|
709
|
+
const l = await u.defaultSession().viewOther().setPlacements(o.placements || u.placements.getPlacements()).load();
|
|
710
|
+
d(l, u);
|
|
711
|
+
}, [s, m]), /* @__PURE__ */ i(I, {
|
|
712
|
+
children: /* @__PURE__ */ i("div", {
|
|
156
713
|
className: "nosto_page_type",
|
|
157
714
|
style: {
|
|
158
715
|
display: "none"
|
|
@@ -161,21 +718,19 @@ function NostoOther(props) {
|
|
|
161
718
|
})
|
|
162
719
|
});
|
|
163
720
|
}
|
|
164
|
-
function
|
|
721
|
+
function Ir(o) {
|
|
165
722
|
const {
|
|
166
|
-
recommendationComponent,
|
|
167
|
-
useRenderCampaigns
|
|
168
|
-
} =
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
return /* @__PURE__ */ jsx(Fragment, {
|
|
178
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
723
|
+
recommendationComponent: s,
|
|
724
|
+
useRenderCampaigns: r
|
|
725
|
+
} = x(), {
|
|
726
|
+
renderCampaigns: d,
|
|
727
|
+
pageTypeUpdated: m
|
|
728
|
+
} = r("checkout");
|
|
729
|
+
return U(async (u) => {
|
|
730
|
+
const l = await u.defaultSession().viewCart().setPlacements(o.placements || u.placements.getPlacements()).load();
|
|
731
|
+
d(l, u);
|
|
732
|
+
}, [s, m]), /* @__PURE__ */ i(I, {
|
|
733
|
+
children: /* @__PURE__ */ i("div", {
|
|
179
734
|
className: "nosto_page_type",
|
|
180
735
|
style: {
|
|
181
736
|
display: "none"
|
|
@@ -184,282 +739,256 @@ function NostoCheckout(props) {
|
|
|
184
739
|
})
|
|
185
740
|
});
|
|
186
741
|
}
|
|
187
|
-
function
|
|
188
|
-
const {
|
|
189
|
-
product,
|
|
190
|
-
tagging,
|
|
191
|
-
placements
|
|
192
|
-
} = props;
|
|
193
|
-
const {
|
|
194
|
-
recommendationComponent,
|
|
195
|
-
useRenderCampaigns
|
|
196
|
-
} = useNostoContext();
|
|
742
|
+
function Lr(o) {
|
|
197
743
|
const {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
744
|
+
product: s,
|
|
745
|
+
tagging: r,
|
|
746
|
+
placements: d
|
|
747
|
+
} = o, {
|
|
748
|
+
recommendationComponent: m,
|
|
749
|
+
useRenderCampaigns: u
|
|
750
|
+
} = x(), {
|
|
751
|
+
renderCampaigns: l,
|
|
752
|
+
pageTypeUpdated: y
|
|
753
|
+
} = u("product");
|
|
754
|
+
return U(async (n) => {
|
|
755
|
+
const R = await n.defaultSession().viewProduct(s).setPlacements(d || n.placements.getPlacements()).load();
|
|
756
|
+
l(R, n);
|
|
757
|
+
}, [s, m, y], {
|
|
758
|
+
deep: !0
|
|
759
|
+
}), /* @__PURE__ */ q(I, {
|
|
760
|
+
children: [/* @__PURE__ */ i("div", {
|
|
209
761
|
className: "nosto_page_type",
|
|
210
762
|
style: {
|
|
211
763
|
display: "none"
|
|
212
764
|
},
|
|
213
765
|
children: "product"
|
|
214
|
-
}), /* @__PURE__ */
|
|
766
|
+
}), /* @__PURE__ */ q("div", {
|
|
215
767
|
className: "nosto_product",
|
|
216
768
|
style: {
|
|
217
769
|
display: "none"
|
|
218
770
|
},
|
|
219
|
-
children: [(
|
|
771
|
+
children: [(r == null ? void 0 : r.variationId) && /* @__PURE__ */ i("span", {
|
|
220
772
|
className: "variation_id",
|
|
221
|
-
children:
|
|
222
|
-
}),
|
|
773
|
+
children: r.variationId
|
|
774
|
+
}), s && /* @__PURE__ */ i("span", {
|
|
223
775
|
className: "product_id",
|
|
224
|
-
children:
|
|
225
|
-
}), (
|
|
776
|
+
children: s
|
|
777
|
+
}), (r == null ? void 0 : r.name) && /* @__PURE__ */ i("span", {
|
|
226
778
|
className: "name",
|
|
227
|
-
children:
|
|
228
|
-
}), (
|
|
779
|
+
children: r.name
|
|
780
|
+
}), (r == null ? void 0 : r.url) && /* @__PURE__ */ i("span", {
|
|
229
781
|
className: "url",
|
|
230
|
-
children:
|
|
231
|
-
}), (
|
|
782
|
+
children: r.url.toString()
|
|
783
|
+
}), (r == null ? void 0 : r.imageUrl) && /* @__PURE__ */ i("span", {
|
|
232
784
|
className: "image_url",
|
|
233
|
-
children:
|
|
234
|
-
}), (
|
|
785
|
+
children: r.imageUrl.toString()
|
|
786
|
+
}), (r == null ? void 0 : r.availability) && /* @__PURE__ */ i("span", {
|
|
235
787
|
className: "availability",
|
|
236
|
-
children:
|
|
237
|
-
}), (
|
|
788
|
+
children: r.availability
|
|
789
|
+
}), (r == null ? void 0 : r.price) && /* @__PURE__ */ i("span", {
|
|
238
790
|
className: "price",
|
|
239
|
-
children:
|
|
240
|
-
}), (
|
|
791
|
+
children: r.price
|
|
792
|
+
}), (r == null ? void 0 : r.listPrice) && /* @__PURE__ */ i("span", {
|
|
241
793
|
className: "list_price",
|
|
242
|
-
children:
|
|
243
|
-
}), (
|
|
794
|
+
children: r.listPrice
|
|
795
|
+
}), (r == null ? void 0 : r.priceCurrencyCode) && /* @__PURE__ */ i("span", {
|
|
244
796
|
className: "price_currency_code",
|
|
245
|
-
children:
|
|
246
|
-
}), (
|
|
797
|
+
children: r.priceCurrencyCode
|
|
798
|
+
}), (r == null ? void 0 : r.brand) && /* @__PURE__ */ i("span", {
|
|
247
799
|
className: "brand",
|
|
248
|
-
children:
|
|
249
|
-
}), (
|
|
800
|
+
children: r.brand
|
|
801
|
+
}), (r == null ? void 0 : r.description) && /* @__PURE__ */ i("span", {
|
|
250
802
|
className: "description",
|
|
251
|
-
children:
|
|
252
|
-
}), (
|
|
803
|
+
children: r.description
|
|
804
|
+
}), (r == null ? void 0 : r.googleCategory) && /* @__PURE__ */ i("span", {
|
|
253
805
|
className: "description",
|
|
254
|
-
children:
|
|
255
|
-
}), (
|
|
806
|
+
children: r.googleCategory
|
|
807
|
+
}), (r == null ? void 0 : r.condition) && /* @__PURE__ */ i("span", {
|
|
256
808
|
className: "condition",
|
|
257
|
-
children:
|
|
258
|
-
}), (
|
|
809
|
+
children: r.condition
|
|
810
|
+
}), (r == null ? void 0 : r.gender) && /* @__PURE__ */ i("span", {
|
|
259
811
|
className: "gender",
|
|
260
|
-
children:
|
|
261
|
-
}), (
|
|
812
|
+
children: r.gender
|
|
813
|
+
}), (r == null ? void 0 : r.ageGroup) && /* @__PURE__ */ i("span", {
|
|
262
814
|
className: "age_group",
|
|
263
|
-
children:
|
|
264
|
-
}), (
|
|
815
|
+
children: r.ageGroup
|
|
816
|
+
}), (r == null ? void 0 : r.gtin) && /* @__PURE__ */ i("span", {
|
|
265
817
|
className: "gtin",
|
|
266
|
-
children:
|
|
267
|
-
}), (
|
|
818
|
+
children: r.gtin
|
|
819
|
+
}), (r == null ? void 0 : r.category) && (r == null ? void 0 : r.category.map((n, R) => /* @__PURE__ */ i("span", {
|
|
268
820
|
className: "category",
|
|
269
|
-
children:
|
|
270
|
-
},
|
|
821
|
+
children: n
|
|
822
|
+
}, R))), (r == null ? void 0 : r.tags1) && r.tags1.map((n, R) => /* @__PURE__ */ i("span", {
|
|
271
823
|
className: "tag1",
|
|
272
|
-
children:
|
|
273
|
-
},
|
|
824
|
+
children: n
|
|
825
|
+
}, R)), (r == null ? void 0 : r.tags2) && r.tags2.map((n, R) => /* @__PURE__ */ i("span", {
|
|
274
826
|
className: "tag2",
|
|
275
|
-
children:
|
|
276
|
-
},
|
|
827
|
+
children: n
|
|
828
|
+
}, R)), (r == null ? void 0 : r.tags3) && r.tags3.map((n, R) => /* @__PURE__ */ i("span", {
|
|
277
829
|
className: "tag3",
|
|
278
|
-
children:
|
|
279
|
-
},
|
|
830
|
+
children: n
|
|
831
|
+
}, R)), (r == null ? void 0 : r.ratingValue) && /* @__PURE__ */ i("span", {
|
|
280
832
|
className: "rating_value",
|
|
281
|
-
children:
|
|
282
|
-
}), (
|
|
833
|
+
children: r.ratingValue
|
|
834
|
+
}), (r == null ? void 0 : r.reviewCount) && /* @__PURE__ */ i("span", {
|
|
283
835
|
className: "review_count",
|
|
284
|
-
children:
|
|
285
|
-
}), (
|
|
836
|
+
children: r.reviewCount
|
|
837
|
+
}), (r == null ? void 0 : r.alternateImageUrls) && r.alternateImageUrls.map((n, R) => /* @__PURE__ */ i("span", {
|
|
286
838
|
className: "alternate_image_url",
|
|
287
|
-
children:
|
|
288
|
-
},
|
|
289
|
-
className:
|
|
290
|
-
children:
|
|
291
|
-
},
|
|
839
|
+
children: n.toString()
|
|
840
|
+
}, R)), (r == null ? void 0 : r.customFields) && Object.keys(r.customFields).map((n, R) => r.customFields && r.customFields[n] && /* @__PURE__ */ i("span", {
|
|
841
|
+
className: n,
|
|
842
|
+
children: r.customFields[n]
|
|
843
|
+
}, R)), (r == null ? void 0 : r.skus) && r.skus.map((n, R) => /* @__PURE__ */ q("span", {
|
|
292
844
|
className: "nosto_sku",
|
|
293
|
-
children: [(
|
|
845
|
+
children: [(n == null ? void 0 : n.id) && /* @__PURE__ */ i("span", {
|
|
294
846
|
className: "product_id",
|
|
295
|
-
children:
|
|
296
|
-
}), (
|
|
847
|
+
children: n.id
|
|
848
|
+
}), (n == null ? void 0 : n.name) && /* @__PURE__ */ i("span", {
|
|
297
849
|
className: "name",
|
|
298
|
-
children:
|
|
299
|
-
}), (
|
|
850
|
+
children: n.name
|
|
851
|
+
}), (n == null ? void 0 : n.price) && /* @__PURE__ */ i("span", {
|
|
300
852
|
className: "price",
|
|
301
|
-
children:
|
|
302
|
-
}), (
|
|
853
|
+
children: n.price
|
|
854
|
+
}), (n == null ? void 0 : n.listPrice) && /* @__PURE__ */ i("span", {
|
|
303
855
|
className: "list_price",
|
|
304
|
-
children:
|
|
305
|
-
}), (
|
|
856
|
+
children: n.listPrice
|
|
857
|
+
}), (n == null ? void 0 : n.url) && /* @__PURE__ */ i("span", {
|
|
306
858
|
className: "url",
|
|
307
|
-
children:
|
|
308
|
-
}), (
|
|
859
|
+
children: n.url.toString()
|
|
860
|
+
}), (n == null ? void 0 : n.imageUrl) && /* @__PURE__ */ i("span", {
|
|
309
861
|
className: "image_url",
|
|
310
|
-
children:
|
|
311
|
-
}), (
|
|
862
|
+
children: n.imageUrl.toString()
|
|
863
|
+
}), (n == null ? void 0 : n.gtin) && /* @__PURE__ */ i("span", {
|
|
312
864
|
className: "gtin",
|
|
313
|
-
children:
|
|
314
|
-
}), (
|
|
865
|
+
children: n.gtin
|
|
866
|
+
}), (n == null ? void 0 : n.availability) && /* @__PURE__ */ i("span", {
|
|
315
867
|
className: "availability",
|
|
316
|
-
children:
|
|
317
|
-
}), (
|
|
318
|
-
className:
|
|
319
|
-
children:
|
|
320
|
-
},
|
|
321
|
-
},
|
|
868
|
+
children: n.availability
|
|
869
|
+
}), (n == null ? void 0 : n.customFields) && Object.keys(n.customFields).map((w, T) => n.customFields && n.customFields[w] && /* @__PURE__ */ i("span", {
|
|
870
|
+
className: w,
|
|
871
|
+
children: n.customFields[w]
|
|
872
|
+
}, T))]
|
|
873
|
+
}, R))]
|
|
322
874
|
})]
|
|
323
875
|
});
|
|
324
876
|
}
|
|
325
|
-
function
|
|
326
|
-
const {
|
|
327
|
-
category,
|
|
328
|
-
placements
|
|
329
|
-
} = props;
|
|
877
|
+
function Ur(o) {
|
|
330
878
|
const {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
} =
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
879
|
+
category: s,
|
|
880
|
+
placements: r
|
|
881
|
+
} = o, {
|
|
882
|
+
recommendationComponent: d,
|
|
883
|
+
useRenderCampaigns: m
|
|
884
|
+
} = x(), {
|
|
885
|
+
renderCampaigns: u,
|
|
886
|
+
pageTypeUpdated: l
|
|
887
|
+
} = m("home");
|
|
888
|
+
return U(async (y) => {
|
|
889
|
+
const n = await y.defaultSession().viewCategory(s).setPlacements(r || y.placements.getPlacements()).load();
|
|
890
|
+
u(n, y);
|
|
891
|
+
}, [s, d, l]), /* @__PURE__ */ q(I, {
|
|
892
|
+
children: [/* @__PURE__ */ i("div", {
|
|
344
893
|
className: "nosto_page_type",
|
|
345
894
|
style: {
|
|
346
895
|
display: "none"
|
|
347
896
|
},
|
|
348
897
|
children: "category"
|
|
349
|
-
}), /* @__PURE__ */
|
|
898
|
+
}), /* @__PURE__ */ i("div", {
|
|
350
899
|
className: "nosto_category",
|
|
351
900
|
style: {
|
|
352
901
|
display: "none"
|
|
353
902
|
},
|
|
354
|
-
children:
|
|
903
|
+
children: s
|
|
355
904
|
})]
|
|
356
905
|
});
|
|
357
906
|
}
|
|
358
|
-
function
|
|
359
|
-
const {
|
|
360
|
-
query,
|
|
361
|
-
placements
|
|
362
|
-
} = props;
|
|
907
|
+
function $r(o) {
|
|
363
908
|
const {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
} =
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
909
|
+
query: s,
|
|
910
|
+
placements: r
|
|
911
|
+
} = o, {
|
|
912
|
+
recommendationComponent: d,
|
|
913
|
+
useRenderCampaigns: m
|
|
914
|
+
} = x(), {
|
|
915
|
+
renderCampaigns: u,
|
|
916
|
+
pageTypeUpdated: l
|
|
917
|
+
} = m("search");
|
|
918
|
+
return U(async (y) => {
|
|
919
|
+
const n = await y.defaultSession().viewSearch(s).setPlacements(r || y.placements.getPlacements()).load();
|
|
920
|
+
u(n, y);
|
|
921
|
+
}, [s, d, l]), /* @__PURE__ */ q(I, {
|
|
922
|
+
children: [/* @__PURE__ */ i("div", {
|
|
377
923
|
className: "nosto_page_type",
|
|
378
924
|
style: {
|
|
379
925
|
display: "none"
|
|
380
926
|
},
|
|
381
927
|
children: "search"
|
|
382
|
-
}), /* @__PURE__ */
|
|
928
|
+
}), /* @__PURE__ */ i("div", {
|
|
383
929
|
className: "nosto_search",
|
|
384
930
|
style: {
|
|
385
931
|
display: "none"
|
|
386
932
|
},
|
|
387
|
-
children:
|
|
933
|
+
children: s
|
|
388
934
|
})]
|
|
389
935
|
});
|
|
390
936
|
}
|
|
391
|
-
function
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
if (isDate(obj) || isRegex(obj)) {
|
|
396
|
-
return obj;
|
|
397
|
-
}
|
|
398
|
-
if (Array.isArray(obj)) {
|
|
399
|
-
return obj.map(snakeize);
|
|
400
|
-
}
|
|
401
|
-
return Object.keys(obj).reduce((acc, key) => {
|
|
402
|
-
const camel = key[0].toLowerCase() + key.slice(1).replace(/([A-Z]+)/g, (_, x) => {
|
|
403
|
-
return "_" + x.toLowerCase();
|
|
404
|
-
});
|
|
405
|
-
acc[camel] = snakeize(obj[key]);
|
|
406
|
-
return acc;
|
|
937
|
+
function K(o) {
|
|
938
|
+
return !o || typeof o != "object" || Nr(o) || jr(o) ? o : Array.isArray(o) ? o.map(K) : Object.keys(o).reduce((s, r) => {
|
|
939
|
+
const d = r[0].toLowerCase() + r.slice(1).replace(/([A-Z]+)/g, (m, u) => "_" + u.toLowerCase());
|
|
940
|
+
return s[d] = K(o[r]), s;
|
|
407
941
|
}, {});
|
|
408
942
|
}
|
|
409
|
-
function
|
|
410
|
-
return Object.prototype.toString.call(
|
|
943
|
+
function Nr(o) {
|
|
944
|
+
return Object.prototype.toString.call(o) === "[object Date]";
|
|
411
945
|
}
|
|
412
|
-
function
|
|
413
|
-
return Object.prototype.toString.call(
|
|
946
|
+
function jr(o) {
|
|
947
|
+
return Object.prototype.toString.call(o) === "[object RegExp]";
|
|
414
948
|
}
|
|
415
|
-
function
|
|
416
|
-
const {
|
|
417
|
-
order,
|
|
418
|
-
placements
|
|
419
|
-
} = props;
|
|
420
|
-
const {
|
|
421
|
-
recommendationComponent,
|
|
422
|
-
useRenderCampaigns
|
|
423
|
-
} = useNostoContext();
|
|
949
|
+
function Vr(o) {
|
|
424
950
|
const {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
} =
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
951
|
+
order: s,
|
|
952
|
+
placements: r
|
|
953
|
+
} = o, {
|
|
954
|
+
recommendationComponent: d,
|
|
955
|
+
useRenderCampaigns: m
|
|
956
|
+
} = x(), {
|
|
957
|
+
renderCampaigns: u,
|
|
958
|
+
pageTypeUpdated: l
|
|
959
|
+
} = m("order");
|
|
960
|
+
return U(async (y) => {
|
|
961
|
+
const n = await y.defaultSession().addOrder(K(s)).setPlacements(r || y.placements.getPlacements()).load();
|
|
962
|
+
u(n, y);
|
|
963
|
+
}, [d, l]), /* @__PURE__ */ q(I, {
|
|
964
|
+
children: [/* @__PURE__ */ i("div", {
|
|
434
965
|
className: "nosto_page_type",
|
|
435
966
|
style: {
|
|
436
967
|
display: "none"
|
|
437
968
|
},
|
|
438
969
|
children: "order"
|
|
439
|
-
}), /* @__PURE__ */
|
|
970
|
+
}), /* @__PURE__ */ i("div", {
|
|
440
971
|
className: "nosto_order",
|
|
441
972
|
style: {
|
|
442
973
|
display: "none"
|
|
443
974
|
},
|
|
444
|
-
children:
|
|
975
|
+
children: s.purchase.number
|
|
445
976
|
})]
|
|
446
977
|
});
|
|
447
978
|
}
|
|
448
|
-
function
|
|
979
|
+
function Wr(o) {
|
|
449
980
|
const {
|
|
450
|
-
recommendationComponent,
|
|
451
|
-
useRenderCampaigns
|
|
452
|
-
} =
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
return /* @__PURE__ */ jsx(Fragment, {
|
|
462
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
981
|
+
recommendationComponent: s,
|
|
982
|
+
useRenderCampaigns: r
|
|
983
|
+
} = x(), {
|
|
984
|
+
renderCampaigns: d,
|
|
985
|
+
pageTypeUpdated: m
|
|
986
|
+
} = r("home");
|
|
987
|
+
return U(async (u) => {
|
|
988
|
+
const l = await u.defaultSession().viewFrontPage().setPlacements(o.placements || u.placements.getPlacements()).load();
|
|
989
|
+
d(l, u);
|
|
990
|
+
}, [s, m]), /* @__PURE__ */ i(I, {
|
|
991
|
+
children: /* @__PURE__ */ i("div", {
|
|
463
992
|
className: "nosto_page_type",
|
|
464
993
|
style: {
|
|
465
994
|
display: "none"
|
|
@@ -468,152 +997,121 @@ function NostoHome(props) {
|
|
|
468
997
|
})
|
|
469
998
|
});
|
|
470
999
|
}
|
|
471
|
-
function
|
|
1000
|
+
function Yr(o) {
|
|
472
1001
|
const {
|
|
473
|
-
id,
|
|
474
|
-
pageType
|
|
475
|
-
} =
|
|
476
|
-
return /* @__PURE__ */
|
|
1002
|
+
id: s,
|
|
1003
|
+
pageType: r
|
|
1004
|
+
} = o;
|
|
1005
|
+
return /* @__PURE__ */ i("div", {
|
|
477
1006
|
className: "nosto_element",
|
|
478
|
-
id
|
|
479
|
-
},
|
|
1007
|
+
id: s
|
|
1008
|
+
}, s + (r || ""));
|
|
480
1009
|
}
|
|
481
|
-
function
|
|
1010
|
+
function Mr(o) {
|
|
482
1011
|
const {
|
|
483
|
-
account,
|
|
484
|
-
multiCurrency =
|
|
485
|
-
host,
|
|
486
|
-
children,
|
|
487
|
-
recommendationComponent,
|
|
488
|
-
shopifyMarkets
|
|
489
|
-
} =
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
function RecommendationComponentWrapper(props2) {
|
|
495
|
-
return React.cloneElement(recommendationComponent, {
|
|
496
|
-
nostoRecommendation: props2.nostoRecommendation
|
|
1012
|
+
account: s,
|
|
1013
|
+
multiCurrency: r = !1,
|
|
1014
|
+
host: d,
|
|
1015
|
+
children: m,
|
|
1016
|
+
recommendationComponent: u,
|
|
1017
|
+
shopifyMarkets: l
|
|
1018
|
+
} = o, [y, n] = z.useState(!1), R = z.useMemo(() => y, [y]), w = r ? o.currentVariation : "", T = wr(u) ? "JSON_ORIGINAL" : "HTML";
|
|
1019
|
+
function F(j) {
|
|
1020
|
+
return z.cloneElement(u, {
|
|
1021
|
+
// eslint-disable-next-line react/prop-types
|
|
1022
|
+
nostoRecommendation: j.nostoRecommendation
|
|
497
1023
|
});
|
|
498
1024
|
}
|
|
499
|
-
const [
|
|
500
|
-
function
|
|
501
|
-
const
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
setPageType(type);
|
|
505
|
-
}
|
|
1025
|
+
const [L, X] = Sr("");
|
|
1026
|
+
function oe(j = "") {
|
|
1027
|
+
const P = ve({});
|
|
1028
|
+
ae(() => {
|
|
1029
|
+
L !== j && X(j);
|
|
506
1030
|
}, []);
|
|
507
|
-
const
|
|
508
|
-
function
|
|
509
|
-
if (
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
const
|
|
513
|
-
for (const
|
|
514
|
-
const
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
if (!placementRefs.current[key])
|
|
519
|
-
placementRefs.current[key] = createRoot(placement());
|
|
520
|
-
const root = placementRefs.current[key];
|
|
521
|
-
root.render(/* @__PURE__ */ jsx(RecommendationComponentWrapper, {
|
|
522
|
-
nostoRecommendation: recommendation
|
|
523
|
-
}));
|
|
524
|
-
}
|
|
1031
|
+
const b = j === L;
|
|
1032
|
+
function _(g, O) {
|
|
1033
|
+
if (T == "HTML")
|
|
1034
|
+
O.placements.injectCampaigns(g.recommendations);
|
|
1035
|
+
else {
|
|
1036
|
+
const $ = g.campaigns.recommendations;
|
|
1037
|
+
for (const V in $) {
|
|
1038
|
+
const se = $[V], Z = "#" + V, Q = () => document.querySelector(Z);
|
|
1039
|
+
Q() && (P.current[V] || (P.current[V] = Tr(Q())), P.current[V].render(/* @__PURE__ */ i(F, {
|
|
1040
|
+
nostoRecommendation: se
|
|
1041
|
+
})));
|
|
525
1042
|
}
|
|
526
1043
|
}
|
|
527
1044
|
}
|
|
528
1045
|
return {
|
|
529
|
-
renderCampaigns,
|
|
530
|
-
pageTypeUpdated
|
|
1046
|
+
renderCampaigns: _,
|
|
1047
|
+
pageTypeUpdated: b
|
|
531
1048
|
};
|
|
532
1049
|
}
|
|
533
|
-
|
|
534
|
-
var
|
|
535
|
-
if (
|
|
536
|
-
window.nostojs = (
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
1050
|
+
return ae(() => {
|
|
1051
|
+
var j, P, b;
|
|
1052
|
+
if (window.nostojs || (window.nostojs = (_) => {
|
|
1053
|
+
(window.nostojs.q = window.nostojs.q || []).push(_);
|
|
1054
|
+
}, window.nostojs((_) => _.setAutoLoad(!1))), !document.querySelectorAll("[nosto-client-script]").length && !l) {
|
|
1055
|
+
const _ = document.createElement("script");
|
|
1056
|
+
_.type = "text/javascript", _.src = "//" + (d || "connect.nosto.com") + "/include/" + s, _.async = !0, _.setAttribute("nosto-client-script", ""), _.onload = () => {
|
|
1057
|
+
var g;
|
|
1058
|
+
typeof jest < "u" && ((g = window.nosto) == null || g.reload({
|
|
1059
|
+
site: "localhost"
|
|
1060
|
+
})), n(!0);
|
|
1061
|
+
}, document.body.appendChild(_);
|
|
1062
|
+
}
|
|
1063
|
+
if (l) {
|
|
1064
|
+
const _ = document.querySelector("[nosto-client-script]"), g = document.querySelector("#nosto-sandbox");
|
|
1065
|
+
if (!_ || (_ == null ? void 0 : _.getAttribute("nosto-language")) !== (l == null ? void 0 : l.language) || (_ == null ? void 0 : _.getAttribute("nosto-market-id")) !== (l == null ? void 0 : l.marketId)) {
|
|
1066
|
+
y && n(!1), (j = _ == null ? void 0 : _.parentNode) == null || j.removeChild(_), (P = g == null ? void 0 : g.parentNode) == null || P.removeChild(g);
|
|
1067
|
+
const O = document.createElement("script");
|
|
1068
|
+
O.type = "text/javascript", O.src = "//" + (d || "connect.nosto.com") + `/script/shopify/market/nosto.js?merchant=${s}&market=${l.marketId || ""}&locale=${((b = l == null ? void 0 : l.language) == null ? void 0 : b.toLowerCase()) || ""}`, O.async = !0, O.setAttribute("nosto-client-script", ""), O.setAttribute("nosto-language", (l == null ? void 0 : l.language) || ""), O.setAttribute("nosto-market-id", String(l == null ? void 0 : l.marketId)), O.onload = () => {
|
|
1069
|
+
var $;
|
|
1070
|
+
typeof jest < "u" && (($ = window.nosto) == null || $.reload({
|
|
551
1071
|
site: "localhost"
|
|
552
|
-
});
|
|
553
|
-
}
|
|
554
|
-
setClientScriptLoadedState(true);
|
|
555
|
-
};
|
|
556
|
-
document.body.appendChild(script);
|
|
557
|
-
}
|
|
558
|
-
if (shopifyMarkets) {
|
|
559
|
-
const existingScript = document.querySelector("[nosto-client-script]");
|
|
560
|
-
const nostoSandbox = document.querySelector("#nosto-sandbox");
|
|
561
|
-
if (!existingScript || (existingScript == null ? void 0 : existingScript.getAttribute("nosto-language")) !== (shopifyMarkets == null ? void 0 : shopifyMarkets.language) || (existingScript == null ? void 0 : existingScript.getAttribute("nosto-market-id")) !== (shopifyMarkets == null ? void 0 : shopifyMarkets.marketId)) {
|
|
562
|
-
if (clientScriptLoadedState) {
|
|
563
|
-
setClientScriptLoadedState(false);
|
|
564
|
-
}
|
|
565
|
-
(_a = existingScript == null ? void 0 : existingScript.parentNode) == null ? void 0 : _a.removeChild(existingScript);
|
|
566
|
-
(_b = nostoSandbox == null ? void 0 : nostoSandbox.parentNode) == null ? void 0 : _b.removeChild(nostoSandbox);
|
|
567
|
-
const script = document.createElement("script");
|
|
568
|
-
script.type = "text/javascript";
|
|
569
|
-
script.src = "//" + (host || "connect.nosto.com") + `/script/shopify/market/nosto.js?merchant=${account}&market=${shopifyMarkets.marketId || ""}&locale=${((_c = shopifyMarkets == null ? void 0 : shopifyMarkets.language) == null ? void 0 : _c.toLowerCase()) || ""}`;
|
|
570
|
-
script.async = true;
|
|
571
|
-
script.setAttribute("nosto-client-script", "");
|
|
572
|
-
script.setAttribute("nosto-language", (shopifyMarkets == null ? void 0 : shopifyMarkets.language) || "");
|
|
573
|
-
script.setAttribute("nosto-market-id", String(shopifyMarkets == null ? void 0 : shopifyMarkets.marketId));
|
|
574
|
-
script.onload = () => {
|
|
575
|
-
var _a2;
|
|
576
|
-
if (typeof jest !== "undefined") {
|
|
577
|
-
(_a2 = window.nosto) == null ? void 0 : _a2.reload({
|
|
578
|
-
site: "localhost"
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
setClientScriptLoadedState(true);
|
|
582
|
-
};
|
|
583
|
-
document.body.appendChild(script);
|
|
1072
|
+
})), n(!0);
|
|
1073
|
+
}, document.body.appendChild(O);
|
|
584
1074
|
}
|
|
585
1075
|
}
|
|
586
|
-
}, [
|
|
587
|
-
return /* @__PURE__ */ jsx(NostoContext.Provider, {
|
|
1076
|
+
}, [y, l]), /* @__PURE__ */ i(Je.Provider, {
|
|
588
1077
|
value: {
|
|
589
|
-
account,
|
|
590
|
-
clientScriptLoaded,
|
|
591
|
-
currentVariation,
|
|
592
|
-
responseMode,
|
|
593
|
-
recommendationComponent,
|
|
594
|
-
useRenderCampaigns,
|
|
595
|
-
pageType
|
|
1078
|
+
account: s,
|
|
1079
|
+
clientScriptLoaded: R,
|
|
1080
|
+
currentVariation: w,
|
|
1081
|
+
responseMode: T,
|
|
1082
|
+
recommendationComponent: u,
|
|
1083
|
+
useRenderCampaigns: oe,
|
|
1084
|
+
pageType: L
|
|
596
1085
|
},
|
|
597
|
-
children
|
|
1086
|
+
children: m
|
|
598
1087
|
});
|
|
599
1088
|
}
|
|
600
|
-
function
|
|
1089
|
+
function qr(o) {
|
|
601
1090
|
const {
|
|
602
|
-
cart,
|
|
603
|
-
customer
|
|
604
|
-
} =
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
api.defaultSession().setResponseMode("HTML").setCart(currentCart).setCustomer(currentCustomer).viewOther().load();
|
|
614
|
-
});
|
|
615
|
-
}
|
|
616
|
-
}, [clientScriptLoaded, cart, customer]);
|
|
617
|
-
return /* @__PURE__ */ jsx(Fragment, {});
|
|
1091
|
+
cart: s,
|
|
1092
|
+
customer: r
|
|
1093
|
+
} = o, {
|
|
1094
|
+
clientScriptLoaded: d
|
|
1095
|
+
} = x();
|
|
1096
|
+
return ze(() => {
|
|
1097
|
+
const m = s ? K(s) : void 0, u = r ? K(r) : void 0;
|
|
1098
|
+
d && window.nostojs((l) => {
|
|
1099
|
+
l.defaultSession().setResponseMode("HTML").setCart(m).setCustomer(u).viewOther().load();
|
|
1100
|
+
});
|
|
1101
|
+
}, [d, s, r]), /* @__PURE__ */ i(I, {});
|
|
618
1102
|
}
|
|
619
|
-
export {
|
|
1103
|
+
export {
|
|
1104
|
+
Ar as Nosto404,
|
|
1105
|
+
Ur as NostoCategory,
|
|
1106
|
+
Ir as NostoCheckout,
|
|
1107
|
+
Je as NostoContext,
|
|
1108
|
+
Wr as NostoHome,
|
|
1109
|
+
Vr as NostoOrder,
|
|
1110
|
+
Dr as NostoOther,
|
|
1111
|
+
Yr as NostoPlacement,
|
|
1112
|
+
Lr as NostoProduct,
|
|
1113
|
+
Mr as NostoProvider,
|
|
1114
|
+
$r as NostoSearch,
|
|
1115
|
+
qr as NostoSession,
|
|
1116
|
+
x as useNostoContext
|
|
1117
|
+
};
|