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