@haus-storefront-react/vendure-plugin-configs 1.0.4-next.2 → 1.0.4-next.4

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/badge.mjs CHANGED
@@ -1,19 +1,21 @@
1
- import { V as hr, l as jt } from "./index-BRlTlK6a.mjs";
2
- import { c as U, j as F, r as Ft } from "./index-BCrKAB0K.mjs";
3
- import * as E from "react";
4
- import mr, { createContext as yr, useContext as gr, useRef as br } from "react";
5
- import { QueryClient as Ke } from "@tanstack/react-query";
6
- const Z = new hr({
1
+ import { V as j, l as R } from "./index-BRlTlK6a.mjs";
2
+ import { c as P, j as y } from "./compiler-runtime-qHgugrLy.mjs";
3
+ import * as m from "react";
4
+ import $, { useRef as N } from "react";
5
+ import { r as V } from "./index-C0E-40z0.mjs";
6
+ import { u as k } from "./useSdk-DOrZRSHz.mjs";
7
+ import "@tanstack/react-query";
8
+ const v = new j({
7
9
  name: "badges",
8
10
  enableFeatures: {
9
11
  showBadges: ({
10
12
  badges: t = [],
11
13
  parentComponent: e
12
14
  }) => {
13
- const r = e ? Z.getSettings().availablePositions[e] : Z.getSettings().defaultPositions;
15
+ const n = e ? v.getSettings().availablePositions[e] : v.getSettings().defaultPositions;
14
16
  return {
15
- badges: jt.filter(t, (o) => r ? r.includes(o.position) : !0),
16
- availablePositions: r
17
+ badges: R.filter(t, (c) => n ? n.includes(c.position) : !0),
18
+ availablePositions: n
17
19
  };
18
20
  }
19
21
  },
@@ -27,7 +29,7 @@ const Z = new hr({
27
29
  }
28
30
  }
29
31
  });
30
- Z.setQueryUpdates({
32
+ v.setQueryUpdates({
31
33
  product: {
32
34
  fields: [{
33
35
  badges: ["id", "position", "assetId", {
@@ -71,8 +73,8 @@ Z.setQueryUpdates({
71
73
  }]
72
74
  }
73
75
  });
74
- Z.setRequests({
75
- getBadges: async () => Z.getSdk().createRequest({
76
+ v.setRequests({
77
+ getBadges: async () => v.getSdk().createRequest({
76
78
  operation: "badges",
77
79
  fields: ["totalItems", {
78
80
  items: ["id", "createdAt", "updatedAt", "collectionId", "position", "assetId", {
@@ -90,88 +92,88 @@ Z.setRequests({
90
92
  errorCode: t.code || "unknown"
91
93
  }))
92
94
  });
93
- function wr(t) {
95
+ function A(t) {
94
96
  const e = [];
95
- function r(o, s) {
96
- const i = E.createContext(s), a = e.length;
97
- e.push(i);
98
- const c = (l) => {
99
- const d = U.c(8);
100
- let m, g, p;
101
- d[0] !== l ? ({
102
- scope: p,
103
- children: m,
104
- ...g
105
- } = l, d[0] = l, d[1] = m, d[2] = g, d[3] = p) : (m = d[1], g = d[2], p = d[3]);
106
- const y = p?.[t]?.[a] || i, h = g;
107
- let w;
108
- return d[4] !== y.Provider || d[5] !== m || d[6] !== h ? (w = /* @__PURE__ */ F.jsx(y.Provider, { value: h, children: m }), d[4] = y.Provider, d[5] = m, d[6] = h, d[7] = w) : w = d[7], w;
97
+ function n(c, o) {
98
+ const s = m.createContext(o), r = e.length;
99
+ e.push(s);
100
+ const l = (u) => {
101
+ const f = P.c(8);
102
+ let d, p, g;
103
+ f[0] !== u ? ({
104
+ scope: g,
105
+ children: d,
106
+ ...p
107
+ } = u, f[0] = u, f[1] = d, f[2] = p, f[3] = g) : (d = f[1], p = f[2], g = f[3]);
108
+ const h = g?.[t]?.[r] || s, b = p;
109
+ let x;
110
+ return f[4] !== h.Provider || f[5] !== d || f[6] !== b ? (x = /* @__PURE__ */ y.jsx(h.Provider, { value: b, children: d }), f[4] = h.Provider, f[5] = d, f[6] = b, f[7] = x) : x = f[7], x;
109
111
  };
110
- c.displayName = o + "Provider";
111
- function u(l, d) {
112
- const m = d?.[t]?.[a] || i, g = E.useContext(m);
113
- if (g)
114
- return g;
115
- if (s !== void 0)
116
- return s;
117
- throw new Error(`\`${l}\` must be used within \`${o}\``);
118
- }
119
- return [c, u];
120
- }
121
- function n() {
122
- const o = e.map((s) => E.createContext(s));
123
- return function(i) {
124
- const a = i?.[t] || o;
125
- return E.useMemo(() => ({
112
+ l.displayName = c + "Provider";
113
+ function a(u, f) {
114
+ const d = f?.[t]?.[r] || s, p = m.useContext(d);
115
+ if (p)
116
+ return p;
117
+ if (o !== void 0)
118
+ return o;
119
+ throw new Error(`\`${u}\` must be used within \`${c}\``);
120
+ }
121
+ return [l, a];
122
+ }
123
+ function i() {
124
+ const c = e.map((o) => m.createContext(o));
125
+ return function(s) {
126
+ const r = s?.[t] || c;
127
+ return m.useMemo(() => ({
126
128
  [`__scope${t}`]: {
127
- ...i,
128
- [t]: a
129
+ ...s,
130
+ [t]: r
129
131
  }
130
- }), [i, a]);
132
+ }), [s, r]);
131
133
  };
132
134
  }
133
- return n.scopeName = t, [r, n];
135
+ return i.scopeName = t, [n, i];
134
136
  }
135
- function Ar(t, e) {
137
+ function O(t, e) {
136
138
  if (e === "web")
137
139
  return t;
138
140
  const {
139
- src: r,
140
- alt: n,
141
- width: o,
142
- height: s,
143
- ...i
144
- } = t, a = [typeof o == "number" ? {
145
- width: o
146
- } : void 0, typeof s == "number" ? {
147
- height: s
141
+ src: n,
142
+ alt: i,
143
+ width: c,
144
+ height: o,
145
+ ...s
146
+ } = t, r = [typeof c == "number" ? {
147
+ width: c
148
+ } : void 0, typeof o == "number" ? {
149
+ height: o
148
150
  } : void 0].filter(Boolean);
149
- let c;
150
- return a.length === 1 ? c = a[0] : a.length > 1 && (c = a), {
151
- ...i,
151
+ let l;
152
+ return r.length === 1 ? l = r[0] : r.length > 1 && (l = r), {
153
+ ...s,
152
154
  source: {
153
- uri: r
155
+ uri: n
154
156
  },
155
- ...c ? {
156
- style: c
157
+ ...l ? {
158
+ style: l
157
159
  } : {}
158
160
  // alt tas bort, finns inte i RN
159
161
  };
160
162
  }
161
- function Sr(t) {
163
+ function D(t) {
162
164
  const {
163
165
  src: e,
164
- alt: r,
165
- ...n
166
+ alt: n,
167
+ ...i
166
168
  } = t;
167
169
  return e ? {
168
- ...n,
170
+ ...i,
169
171
  source: {
170
172
  uri: e
171
173
  }
172
- } : n;
174
+ } : i;
173
175
  }
174
- const Er = {
176
+ const q = {
175
177
  div: "View",
176
178
  span: "Text",
177
179
  p: "Text",
@@ -201,2862 +203,236 @@ const Er = {
201
203
  select: "Pressable",
202
204
  option: "Text"
203
205
  };
204
- function Or(t, e) {
206
+ function F(t, e) {
205
207
  if (e === "web")
206
208
  return t;
207
- let r = null;
209
+ let n = null;
208
210
  try {
209
- r = require("react-native");
211
+ n = require("react-native");
210
212
  } catch {
211
- r = null;
213
+ n = null;
212
214
  }
213
- if (!r)
214
- return console.warn(`react-native is not available at runtime; falling back to 'View' for '${t}'`), "div";
215
- const n = Er[t];
216
215
  if (!n)
217
- return console.warn(`No native component mapping found for '${t}', falling back to View`), r.View;
218
- if (n === "Image") {
219
- const s = mr.forwardRef((i, a) => {
220
- const c = U.c(5);
221
- if (!i.src)
216
+ return console.warn(`react-native is not available at runtime; falling back to 'View' for '${t}'`), "div";
217
+ const i = q[t];
218
+ if (!i)
219
+ return console.warn(`No native component mapping found for '${t}', falling back to View`), n.View;
220
+ if (i === "Image") {
221
+ const o = $.forwardRef((s, r) => {
222
+ const l = P.c(5);
223
+ if (!s.src)
222
224
  return null;
225
+ let a;
226
+ l[0] !== s ? (a = D(s), l[0] = s, l[1] = a) : a = l[1];
223
227
  let u;
224
- c[0] !== i ? (u = Sr(i), c[0] = i, c[1] = u) : u = c[1];
225
- let l;
226
- return c[2] !== a || c[3] !== u ? (l = /* @__PURE__ */ F.jsx(r.Image, { ref: a, ...u }), c[2] = a, c[3] = u, c[4] = l) : l = c[4], l;
228
+ return l[2] !== r || l[3] !== a ? (u = /* @__PURE__ */ y.jsx(n.Image, { ref: r, ...a }), l[2] = r, l[3] = a, l[4] = u) : u = l[4], u;
227
229
  });
228
- return s.displayName = "PlatformPrimitiveImage", s;
230
+ return o.displayName = "PlatformPrimitiveImage", o;
229
231
  }
230
- const o = r[n];
231
- return o || (console.warn(`Native component '${n}' not found, falling back to View`), r.View);
232
+ const c = n[i];
233
+ return c || (console.warn(`Native component '${i}' not found, falling back to View`), n.View);
232
234
  }
233
- const vr = /* @__PURE__ */ Symbol("radix.slottable");
234
- function Tr(...t) {
235
- return (e) => t.forEach((r) => {
236
- typeof r == "function" ? r(e) : r != null && (r.current = e);
235
+ const W = /* @__PURE__ */ Symbol("radix.slottable");
236
+ function G(...t) {
237
+ return (e) => t.forEach((n) => {
238
+ typeof n == "function" ? n(e) : n != null && (n.current = e);
237
239
  });
238
240
  }
239
- function Rr(t, e) {
240
- const r = {
241
+ function L(t, e) {
242
+ const n = {
241
243
  ...e
242
244
  };
243
- for (const n in e) {
244
- const o = t[n], s = e[n];
245
- /^on[A-Z]/.test(n) ? o && s ? r[n] = (...a) => {
246
- const c = s(...a);
247
- return o(...a), c;
248
- } : o && (r[n] = o) : n === "style" ? r[n] = _r(o, s) : n === "className" && (r[n] = [o, s].filter(Boolean).join(" "));
245
+ for (const i in e) {
246
+ const c = t[i], o = e[i];
247
+ /^on[A-Z]/.test(i) ? c && o ? n[i] = (...r) => {
248
+ const l = o(...r);
249
+ return c(...r), l;
250
+ } : c && (n[i] = c) : i === "style" ? n[i] = M(c, o) : i === "className" && (n[i] = [c, o].filter(Boolean).join(" "));
249
251
  }
250
252
  return {
251
253
  ...t,
252
- ...r
254
+ ...n
253
255
  };
254
256
  }
255
- function _r(t, e) {
256
- let r = null;
257
+ function M(t, e) {
258
+ let n = null;
257
259
  try {
258
- r = require("react-native");
260
+ n = require("react-native");
259
261
  } catch {
260
- r = null;
262
+ n = null;
261
263
  }
262
- const n = r?.StyleSheet?.flatten;
264
+ const i = n?.StyleSheet?.flatten;
263
265
  if (typeof t == "function" && typeof e == "function")
264
- return (s) => {
265
- const i = [t(s), e(s)];
266
- return n ? n(i) : i;
266
+ return (o) => {
267
+ const s = [t(o), e(o)];
268
+ return i ? i(s) : s;
267
269
  };
268
270
  if (typeof t == "function")
269
- return (s) => {
270
- const i = e ? [t(s), e] : t(s);
271
- return n ? n(i) : i;
271
+ return (o) => {
272
+ const s = e ? [t(o), e] : t(o);
273
+ return i ? i(s) : s;
272
274
  };
273
275
  if (typeof e == "function")
274
- return (s) => {
275
- const i = t ? [t, e(s)] : e(s);
276
- return n ? n(i) : i;
276
+ return (o) => {
277
+ const s = t ? [t, e(o)] : e(o);
278
+ return i ? i(s) : s;
277
279
  };
278
- const o = [t, e].filter(Boolean);
279
- return n ? n(o) : o;
280
+ const c = [t, e].filter(Boolean);
281
+ return i ? i(c) : c;
280
282
  }
281
- function xr(t) {
282
- return E.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === vr;
283
+ function U(t) {
284
+ return m.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === W;
283
285
  }
284
- function Cr(t) {
285
- let e = Object.getOwnPropertyDescriptor(t.props, "ref")?.get, r = e && "isReactWarning" in e && e.isReactWarning;
286
- return r ? t.ref : (e = Object.getOwnPropertyDescriptor(t, "ref")?.get, r = e && "isReactWarning" in e && e.isReactWarning, r ? t.props.ref : t.props.ref || t.ref);
286
+ function H(t) {
287
+ let e = Object.getOwnPropertyDescriptor(t.props, "ref")?.get, n = e && "isReactWarning" in e && e.isReactWarning;
288
+ return n ? t.ref : (e = Object.getOwnPropertyDescriptor(t, "ref")?.get, n = e && "isReactWarning" in e && e.isReactWarning, n ? t.props.ref : t.props.ref || t.ref);
287
289
  }
288
- function Pr(t, e) {
289
- const r = E.forwardRef((n, o) => {
290
+ function K(t, e) {
291
+ const n = m.forwardRef((i, c) => {
290
292
  const {
291
- children: s,
292
- ...i
293
- } = n;
294
- if (E.isValidElement(s)) {
295
- const a = Cr(s), c = Rr(i, s.props);
296
- return s.type !== E.Fragment && (c.ref = o ? Tr(o, a) : a), E.cloneElement(s, c);
297
- }
298
- return E.Children.count(s) > 1 ? E.Children.only(null) : null;
293
+ children: o,
294
+ ...s
295
+ } = i;
296
+ if (m.isValidElement(o)) {
297
+ const r = H(o), l = L(s, o.props);
298
+ return o.type !== m.Fragment && (l.ref = c ? G(c, r) : r), m.cloneElement(o, l);
299
+ }
300
+ return m.Children.count(o) > 1 ? m.Children.only(null) : null;
299
301
  });
300
- return r.displayName = `${t}.SlotClone`, r;
302
+ return n.displayName = `${t}.SlotClone`, n;
301
303
  }
302
- function Re(t, e = !1, r = "div") {
304
+ function w(t, e = !1, n = "div") {
303
305
  if (!e)
304
- return Or(r, t);
305
- const n = Pr("Slot"), o = E.forwardRef((s, i) => {
306
- const a = U.c(15);
307
- let c, u;
308
- a[0] !== s ? ({
309
- children: c,
310
- ...u
311
- } = s, a[0] = s, a[1] = c, a[2] = u) : (c = a[1], u = a[2]);
312
- let l;
313
- if (a[3] !== c || a[4] !== i || a[5] !== u) {
314
- l = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
306
+ return F(n, t);
307
+ const i = K("Slot"), c = m.forwardRef((o, s) => {
308
+ const r = P.c(15);
309
+ let l, a;
310
+ r[0] !== o ? ({
311
+ children: l,
312
+ ...a
313
+ } = o, r[0] = o, r[1] = l, r[2] = a) : (l = r[1], a = r[2]);
314
+ let u;
315
+ if (r[3] !== l || r[4] !== s || r[5] !== a) {
316
+ u = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
315
317
  e: {
316
- const m = E.Children.toArray(c), g = m.find(xr);
317
- if (g) {
318
- const p = g.props.children, y = m.map((v) => v === g ? E.Children.count(p) > 1 ? E.Children.only(null) : E.isValidElement(p) ? p.props.children : null : v), h = E.isValidElement(p) ? E.cloneElement(p, void 0, y) : null;
319
- let w;
320
- a[7] !== i || a[8] !== u || a[9] !== h ? (w = /* @__PURE__ */ F.jsx(n, { ...u, ref: i, children: h }), a[7] = i, a[8] = u, a[9] = h, a[10] = w) : w = a[10], l = w;
318
+ const d = m.Children.toArray(l), p = d.find(U);
319
+ if (p) {
320
+ const g = p.props.children, h = d.map((B) => B === p ? m.Children.count(g) > 1 ? m.Children.only(null) : m.isValidElement(g) ? g.props.children : null : B), b = m.isValidElement(g) ? m.cloneElement(g, void 0, h) : null;
321
+ let x;
322
+ r[7] !== s || r[8] !== a || r[9] !== b ? (x = /* @__PURE__ */ y.jsx(i, { ...a, ref: s, children: b }), r[7] = s, r[8] = a, r[9] = b, r[10] = x) : x = r[10], u = x;
321
323
  break e;
322
324
  }
323
325
  }
324
- a[3] = c, a[4] = i, a[5] = u, a[6] = l;
325
- } else
326
- l = a[6];
327
- if (l !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
328
- return l;
329
- let d;
330
- return a[11] !== c || a[12] !== i || a[13] !== u ? (d = /* @__PURE__ */ F.jsx(n, { ...u, ref: i, children: c }), a[11] = c, a[12] = i, a[13] = u, a[14] = d) : d = a[14], d;
331
- });
332
- return o.displayName = "Slot", o;
333
- }
334
- const Nr = "debug", P = () => {
335
- try {
336
- if (typeof window > "u" || typeof localStorage > "u")
337
- return !1;
338
- const t = localStorage.getItem(Nr);
339
- return t === "true" || t === "1";
340
- } catch {
341
- return !1;
342
- }
343
- }, qr = () => {
344
- const t = (e, r, n = []) => r ? typeof e == "string" ? [`<${r}> ${e}`, ...n] : [`<${r}>`, e, ...n] : Array.isArray(e) ? [...e, ...n] : [e, ...n];
345
- return {
346
- log: (e, r, ...n) => {
347
- P() && console.log(...t(e, r, n));
348
- },
349
- info: (e, r, ...n) => {
350
- P() && console.info(...t(e, r, n));
351
- },
352
- warn: (e, r, ...n) => {
353
- P() && console.warn(...t(e, r, n));
354
- },
355
- error: (e, r, ...n) => {
356
- P() && console.error(...t(e, r, n));
357
- },
358
- debug: (e, r, ...n) => {
359
- P() && console.debug(...t(e, r, n));
360
- },
361
- group: (e, r) => {
362
- if (P()) {
363
- const n = typeof e == "string" ? e : void 0;
364
- console.group(r ? n ? `<${r}> ${n}` : `<${r}>` : n);
365
- }
366
- },
367
- groupCollapsed: (e, r) => {
368
- if (P()) {
369
- const n = typeof e == "string" ? e : void 0;
370
- console.groupCollapsed(r ? n ? `<${r}> ${n}` : `<${r}>` : n);
371
- }
372
- },
373
- groupEnd: () => {
374
- P() && console.groupEnd();
375
- },
376
- table: (e, r, n) => {
377
- P() && (r && console.log(`<${r}>`), console.table(e, n));
378
- },
379
- time: (e, r) => {
380
- if (P()) {
381
- const n = typeof e == "string" ? e : void 0;
382
- console.time(r ? n ? `<${r}> ${n}` : `<${r}>` : n);
383
- }
384
- },
385
- timeEnd: (e, r) => {
386
- if (P()) {
387
- const n = typeof e == "string" ? e : void 0;
388
- console.timeEnd(r ? n ? `<${r}> ${n}` : `<${r}>` : n);
389
- }
390
- }
391
- };
392
- }, Dr = qr();
393
- function jr(t) {
394
- return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, r) {
395
- var n = t.get(e);
396
- n ? n.push(r) : t.set(e, [r]);
397
- }, off: function(e, r) {
398
- var n = t.get(e);
399
- n && (r ? n.splice(n.indexOf(r) >>> 0, 1) : t.set(e, []));
400
- }, emit: function(e, r) {
401
- var n = t.get(e);
402
- n && n.slice().map(function(o) {
403
- o(r);
404
- }), (n = t.get("*")) && n.slice().map(function(o) {
405
- o(e, r);
406
- });
407
- } };
408
- }
409
- let Y;
410
- try {
411
- Y = require("@react-native-async-storage/async-storage").default;
412
- } catch {
413
- Y = null;
414
- }
415
- let ke = null;
416
- try {
417
- const {
418
- AsyncLocalStorage: t
419
- } = require("node:async_hooks");
420
- ke = new t();
421
- } catch {
422
- ke = null;
423
- }
424
- const K = typeof window < "u" && typeof window.localStorage < "u", z = !!Y, me = {}, Be = {
425
- getItem: async () => null,
426
- setItem: async () => {
427
- },
428
- removeItem: async () => {
429
- }
430
- }, Ie = () => {
431
- try {
432
- return ke?.getStore?.() ?? null;
433
- } catch {
434
- return null;
435
- }
436
- }, Me = {
437
- getItem: async (t) => {
438
- const e = !K && !z ? Ie() : null;
439
- return e ? e.getItem(t) : z ? Y.getItem(t) : K ? new Promise((r) => {
440
- Promise.resolve().then(() => {
441
- const n = window.localStorage.getItem(t), o = me[t];
442
- n !== o && (me[t] = n || ""), r(n);
443
- });
444
- }) : Be.getItem(t);
445
- },
446
- setItem: async (t, e) => {
447
- const r = !K && !z ? Ie() : null;
448
- return r ? r.setItem(t, e) : z ? Y.setItem(t, e) : K ? new Promise((n, o) => {
449
- Promise.resolve().then(() => {
450
- try {
451
- window.localStorage.setItem(t, e);
452
- const s = window.localStorage.getItem(t);
453
- s === e ? (me[t] = e, n()) : o(new Error(`Failed to set localStorage item: expected "${e}", got "${s}"`));
454
- } catch (s) {
455
- o(s);
456
- }
457
- });
458
- }) : Be.setItem(t, e);
459
- },
460
- removeItem: async (t) => {
461
- const e = !K && !z ? Ie() : null;
462
- return e ? e.removeItem(t) : z ? Y.removeItem(t) : K ? new Promise((r, n) => {
463
- Promise.resolve().then(() => {
464
- try {
465
- window.localStorage.removeItem(t);
466
- const o = window.localStorage.getItem(t);
467
- o === null ? (delete me[t], r()) : n(new Error(`Failed to remove localStorage item: key "${t}" still exists with value "${o}"`));
468
- } catch (o) {
469
- n(o);
470
- }
471
- });
472
- }) : Be.removeItem(t);
473
- }
474
- }, st = 50, M = {
475
- get: async () => {
476
- try {
477
- const t = await Me.getItem("eventHistory");
478
- return t ? JSON.parse(t) : [];
479
- } catch (t) {
480
- return console.error("Error getting event history", t), [];
481
- }
482
- },
483
- set: async (t) => {
484
- try {
485
- await Me.setItem("eventHistory", JSON.stringify(t.slice(-st)));
486
- } catch (e) {
487
- console.error("Error setting event history", e);
488
- }
489
- },
490
- clear: async () => {
491
- try {
492
- await Me.removeItem("eventHistory");
493
- } catch (t) {
494
- console.error("Error clearing event history", t);
495
- }
496
- },
497
- push: async (t) => {
498
- const e = await M.get();
499
- await M.set([{
500
- ...t,
501
- timestamp: Date.now()
502
- }, ...e].slice(-st));
503
- },
504
- find: async (t) => (await M.get()).find((r) => r.key === t.key && r.identifier === t.identifier),
505
- filter: async (t, e) => {
506
- const r = await M.get();
507
- return e ? r.filter(e) : r.filter(({
508
- key: n,
509
- identifier: o
510
- }) => (!n || t.key === n) && (!o || t.identifier === o));
511
- }
512
- };
513
- function Fr() {
514
- const t = globalThis;
515
- return t.__HAUS_EVENT_EMITTER__ ||= jr(), t.__HAUS_EVENT_EMITTER__;
516
- }
517
- function W(t) {
518
- const e = Fr(), r = ((...c) => console.error(...c));
519
- M.get().then((c) => {
520
- const l = jt.first(c)?.timestamp;
521
- l && l < Date.now() - 1e3 * 60 * 60 && (Dr.info("Clearing event history since it is older than 1 hour:", "eventBus", l), M.clear());
522
- });
523
- const n = (c, u, l) => {
524
- const d = (m) => {
525
- try {
526
- if (typeof m == "object" && m !== null) {
527
- const {
528
- identifier: g,
529
- data: p
530
- } = m;
531
- (!g || g === l) && u(p);
532
- } else
533
- u(m);
534
- } catch (g) {
535
- r(g);
536
- }
537
- };
538
- return e.on(c, d), () => {
539
- o(c, u, l);
540
- };
541
- }, o = (c, u, l) => {
542
- const d = (m) => {
543
- if (typeof m == "object" && m !== null) {
544
- const {
545
- identifier: g
546
- } = m;
547
- (!g || g === l) && e.off(c, u);
548
- }
549
- };
550
- e.off(c, d);
551
- };
552
- return {
553
- on: n,
554
- off: o,
555
- once: (c, u, l) => {
556
- const d = (m) => {
557
- try {
558
- if (typeof m == "object" && m !== null) {
559
- const {
560
- identifier: g,
561
- data: p
562
- } = m;
563
- (!g || g === l) && u(p);
564
- } else
565
- u(m);
566
- } finally {
567
- o(c, d, l);
568
- }
569
- };
570
- e.on(c, d);
571
- },
572
- emit: (c, u, ...l) => {
573
- const d = {
574
- identifier: u,
575
- data: l.length === 1 ? l[0] : l
576
- };
577
- M.push({
578
- key: c,
579
- identifier: u,
580
- payload: d.data
581
- }), e.emit(c, d);
582
- },
583
- getEventHistory: (c, u) => M.filter({
584
- key: c,
585
- identifier: u
586
- })
587
- };
588
- }
589
- W();
590
- W();
591
- W();
592
- W();
593
- W();
594
- W();
595
- W();
596
- const Br = globalThis.__STORE_SDK_CONTEXT__ ||= yr(void 0);
597
- function Bt(t, e) {
598
- return function() {
599
- return t.apply(e, arguments);
600
- };
601
- }
602
- const { toString: Ir } = Object.prototype, { getPrototypeOf: ze } = Object, { iterator: _e, toStringTag: It } = Symbol, xe = /* @__PURE__ */ ((t) => (e) => {
603
- const r = Ir.call(e);
604
- return t[r] || (t[r] = r.slice(8, -1).toLowerCase());
605
- })(/* @__PURE__ */ Object.create(null)), q = (t) => (t = t.toLowerCase(), (e) => xe(e) === t), Ce = (t) => (e) => typeof e === t, { isArray: te } = Array, ee = Ce("undefined");
606
- function ie(t) {
607
- return t !== null && !ee(t) && t.constructor !== null && !ee(t.constructor) && R(t.constructor.isBuffer) && t.constructor.isBuffer(t);
608
- }
609
- const Mt = q("ArrayBuffer");
610
- function Mr(t) {
611
- let e;
612
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && Mt(t.buffer), e;
613
- }
614
- const Ur = Ce("string"), R = Ce("function"), Ut = Ce("number"), ae = (t) => t !== null && typeof t == "object", Lr = (t) => t === !0 || t === !1, Ee = (t) => {
615
- if (xe(t) !== "object")
616
- return !1;
617
- const e = ze(t);
618
- return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(It in t) && !(_e in t);
619
- }, $r = (t) => {
620
- if (!ae(t) || ie(t))
621
- return !1;
622
- try {
623
- return Object.keys(t).length === 0 && Object.getPrototypeOf(t) === Object.prototype;
624
- } catch {
625
- return !1;
626
- }
627
- }, kr = q("Date"), Hr = q("File"), Vr = q("Blob"), Wr = q("FileList"), Qr = (t) => ae(t) && R(t.pipe), Kr = (t) => {
628
- let e;
629
- return t && (typeof FormData == "function" && t instanceof FormData || R(t.append) && ((e = xe(t)) === "formdata" || // detect form-data instance
630
- e === "object" && R(t.toString) && t.toString() === "[object FormData]"));
631
- }, zr = q("URLSearchParams"), [Jr, Gr, Xr, Yr] = ["ReadableStream", "Request", "Response", "Headers"].map(q), Zr = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
632
- function ce(t, e, { allOwnKeys: r = !1 } = {}) {
633
- if (t === null || typeof t > "u")
634
- return;
635
- let n, o;
636
- if (typeof t != "object" && (t = [t]), te(t))
637
- for (n = 0, o = t.length; n < o; n++)
638
- e.call(null, t[n], n, t);
639
- else {
640
- if (ie(t))
641
- return;
642
- const s = r ? Object.getOwnPropertyNames(t) : Object.keys(t), i = s.length;
643
- let a;
644
- for (n = 0; n < i; n++)
645
- a = s[n], e.call(null, t[a], a, t);
646
- }
647
- }
648
- function Lt(t, e) {
649
- if (ie(t))
650
- return null;
651
- e = e.toLowerCase();
652
- const r = Object.keys(t);
653
- let n = r.length, o;
654
- for (; n-- > 0; )
655
- if (o = r[n], e === o.toLowerCase())
656
- return o;
657
- return null;
658
- }
659
- const k = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, $t = (t) => !ee(t) && t !== k;
660
- function He() {
661
- const { caseless: t, skipUndefined: e } = $t(this) && this || {}, r = {}, n = (o, s) => {
662
- const i = t && Lt(r, s) || s;
663
- Ee(r[i]) && Ee(o) ? r[i] = He(r[i], o) : Ee(o) ? r[i] = He({}, o) : te(o) ? r[i] = o.slice() : (!e || !ee(o)) && (r[i] = o);
664
- };
665
- for (let o = 0, s = arguments.length; o < s; o++)
666
- arguments[o] && ce(arguments[o], n);
667
- return r;
668
- }
669
- const en = (t, e, r, { allOwnKeys: n } = {}) => (ce(e, (o, s) => {
670
- r && R(o) ? t[s] = Bt(o, r) : t[s] = o;
671
- }, { allOwnKeys: n }), t), tn = (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), rn = (t, e, r, n) => {
672
- t.prototype = Object.create(e.prototype, n), t.prototype.constructor = t, Object.defineProperty(t, "super", {
673
- value: e.prototype
674
- }), r && Object.assign(t.prototype, r);
675
- }, nn = (t, e, r, n) => {
676
- let o, s, i;
677
- const a = {};
678
- if (e = e || {}, t == null) return e;
679
- do {
680
- for (o = Object.getOwnPropertyNames(t), s = o.length; s-- > 0; )
681
- i = o[s], (!n || n(i, t, e)) && !a[i] && (e[i] = t[i], a[i] = !0);
682
- t = r !== !1 && ze(t);
683
- } while (t && (!r || r(t, e)) && t !== Object.prototype);
684
- return e;
685
- }, on = (t, e, r) => {
686
- t = String(t), (r === void 0 || r > t.length) && (r = t.length), r -= e.length;
687
- const n = t.indexOf(e, r);
688
- return n !== -1 && n === r;
689
- }, sn = (t) => {
690
- if (!t) return null;
691
- if (te(t)) return t;
692
- let e = t.length;
693
- if (!Ut(e)) return null;
694
- const r = new Array(e);
695
- for (; e-- > 0; )
696
- r[e] = t[e];
697
- return r;
698
- }, an = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && ze(Uint8Array)), cn = (t, e) => {
699
- const n = (t && t[_e]).call(t);
700
- let o;
701
- for (; (o = n.next()) && !o.done; ) {
702
- const s = o.value;
703
- e.call(t, s[0], s[1]);
704
- }
705
- }, un = (t, e) => {
706
- let r;
707
- const n = [];
708
- for (; (r = t.exec(e)) !== null; )
709
- n.push(r);
710
- return n;
711
- }, ln = q("HTMLFormElement"), fn = (t) => t.toLowerCase().replace(
712
- /[-_\s]([a-z\d])(\w*)/g,
713
- function(r, n, o) {
714
- return n.toUpperCase() + o;
715
- }
716
- ), it = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), dn = q("RegExp"), kt = (t, e) => {
717
- const r = Object.getOwnPropertyDescriptors(t), n = {};
718
- ce(r, (o, s) => {
719
- let i;
720
- (i = e(o, s, t)) !== !1 && (n[s] = i || o);
721
- }), Object.defineProperties(t, n);
722
- }, pn = (t) => {
723
- kt(t, (e, r) => {
724
- if (R(t) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
725
- return !1;
726
- const n = t[r];
727
- if (R(n)) {
728
- if (e.enumerable = !1, "writable" in e) {
729
- e.writable = !1;
730
- return;
731
- }
732
- e.set || (e.set = () => {
733
- throw Error("Can not rewrite read-only method '" + r + "'");
734
- });
735
- }
736
- });
737
- }, hn = (t, e) => {
738
- const r = {}, n = (o) => {
739
- o.forEach((s) => {
740
- r[s] = !0;
741
- });
742
- };
743
- return te(t) ? n(t) : n(String(t).split(e)), r;
744
- }, mn = () => {
745
- }, yn = (t, e) => t != null && Number.isFinite(t = +t) ? t : e;
746
- function gn(t) {
747
- return !!(t && R(t.append) && t[It] === "FormData" && t[_e]);
748
- }
749
- const bn = (t) => {
750
- const e = new Array(10), r = (n, o) => {
751
- if (ae(n)) {
752
- if (e.indexOf(n) >= 0)
753
- return;
754
- if (ie(n))
755
- return n;
756
- if (!("toJSON" in n)) {
757
- e[o] = n;
758
- const s = te(n) ? [] : {};
759
- return ce(n, (i, a) => {
760
- const c = r(i, o + 1);
761
- !ee(c) && (s[a] = c);
762
- }), e[o] = void 0, s;
763
- }
764
- }
765
- return n;
766
- };
767
- return r(t, 0);
768
- }, wn = q("AsyncFunction"), An = (t) => t && (ae(t) || R(t)) && R(t.then) && R(t.catch), Ht = ((t, e) => t ? setImmediate : e ? ((r, n) => (k.addEventListener("message", ({ source: o, data: s }) => {
769
- o === k && s === r && n.length && n.shift()();
770
- }, !1), (o) => {
771
- n.push(o), k.postMessage(r, "*");
772
- }))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
773
- typeof setImmediate == "function",
774
- R(k.postMessage)
775
- ), Sn = typeof queueMicrotask < "u" ? queueMicrotask.bind(k) : typeof process < "u" && process.nextTick || Ht, En = (t) => t != null && R(t[_e]), f = {
776
- isArray: te,
777
- isArrayBuffer: Mt,
778
- isBuffer: ie,
779
- isFormData: Kr,
780
- isArrayBufferView: Mr,
781
- isString: Ur,
782
- isNumber: Ut,
783
- isBoolean: Lr,
784
- isObject: ae,
785
- isPlainObject: Ee,
786
- isEmptyObject: $r,
787
- isReadableStream: Jr,
788
- isRequest: Gr,
789
- isResponse: Xr,
790
- isHeaders: Yr,
791
- isUndefined: ee,
792
- isDate: kr,
793
- isFile: Hr,
794
- isBlob: Vr,
795
- isRegExp: dn,
796
- isFunction: R,
797
- isStream: Qr,
798
- isURLSearchParams: zr,
799
- isTypedArray: an,
800
- isFileList: Wr,
801
- forEach: ce,
802
- merge: He,
803
- extend: en,
804
- trim: Zr,
805
- stripBOM: tn,
806
- inherits: rn,
807
- toFlatObject: nn,
808
- kindOf: xe,
809
- kindOfTest: q,
810
- endsWith: on,
811
- toArray: sn,
812
- forEachEntry: cn,
813
- matchAll: un,
814
- isHTMLForm: ln,
815
- hasOwnProperty: it,
816
- hasOwnProp: it,
817
- // an alias to avoid ESLint no-prototype-builtins detection
818
- reduceDescriptors: kt,
819
- freezeMethods: pn,
820
- toObjectSet: hn,
821
- toCamelCase: fn,
822
- noop: mn,
823
- toFiniteNumber: yn,
824
- findKey: Lt,
825
- global: k,
826
- isContextDefined: $t,
827
- isSpecCompliantForm: gn,
828
- toJSONObject: bn,
829
- isAsyncFn: wn,
830
- isThenable: An,
831
- setImmediate: Ht,
832
- asap: Sn,
833
- isIterable: En
834
- };
835
- function b(t, e, r, n, o) {
836
- Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), r && (this.config = r), n && (this.request = n), o && (this.response = o, this.status = o.status ? o.status : null);
837
- }
838
- f.inherits(b, Error, {
839
- toJSON: function() {
840
- return {
841
- // Standard
842
- message: this.message,
843
- name: this.name,
844
- // Microsoft
845
- description: this.description,
846
- number: this.number,
847
- // Mozilla
848
- fileName: this.fileName,
849
- lineNumber: this.lineNumber,
850
- columnNumber: this.columnNumber,
851
- stack: this.stack,
852
- // Axios
853
- config: f.toJSONObject(this.config),
854
- code: this.code,
855
- status: this.status
856
- };
857
- }
858
- });
859
- const Vt = b.prototype, Wt = {};
860
- [
861
- "ERR_BAD_OPTION_VALUE",
862
- "ERR_BAD_OPTION",
863
- "ECONNABORTED",
864
- "ETIMEDOUT",
865
- "ERR_NETWORK",
866
- "ERR_FR_TOO_MANY_REDIRECTS",
867
- "ERR_DEPRECATED",
868
- "ERR_BAD_RESPONSE",
869
- "ERR_BAD_REQUEST",
870
- "ERR_CANCELED",
871
- "ERR_NOT_SUPPORT",
872
- "ERR_INVALID_URL"
873
- // eslint-disable-next-line func-names
874
- ].forEach((t) => {
875
- Wt[t] = { value: t };
876
- });
877
- Object.defineProperties(b, Wt);
878
- Object.defineProperty(Vt, "isAxiosError", { value: !0 });
879
- b.from = (t, e, r, n, o, s) => {
880
- const i = Object.create(Vt);
881
- f.toFlatObject(t, i, function(l) {
882
- return l !== Error.prototype;
883
- }, (u) => u !== "isAxiosError");
884
- const a = t && t.message ? t.message : "Error", c = e == null && t ? t.code : e;
885
- return b.call(i, a, c, r, n, o), t && i.cause == null && Object.defineProperty(i, "cause", { value: t, configurable: !0 }), i.name = t && t.name || "Error", s && Object.assign(i, s), i;
886
- };
887
- const On = null;
888
- function Ve(t) {
889
- return f.isPlainObject(t) || f.isArray(t);
890
- }
891
- function Qt(t) {
892
- return f.endsWith(t, "[]") ? t.slice(0, -2) : t;
893
- }
894
- function at(t, e, r) {
895
- return t ? t.concat(e).map(function(o, s) {
896
- return o = Qt(o), !r && s ? "[" + o + "]" : o;
897
- }).join(r ? "." : "") : e;
898
- }
899
- function vn(t) {
900
- return f.isArray(t) && !t.some(Ve);
901
- }
902
- const Tn = f.toFlatObject(f, {}, null, function(e) {
903
- return /^is[A-Z]/.test(e);
904
- });
905
- function Pe(t, e, r) {
906
- if (!f.isObject(t))
907
- throw new TypeError("target must be an object");
908
- e = e || new FormData(), r = f.toFlatObject(r, {
909
- metaTokens: !0,
910
- dots: !1,
911
- indexes: !1
912
- }, !1, function(y, h) {
913
- return !f.isUndefined(h[y]);
914
- });
915
- const n = r.metaTokens, o = r.visitor || l, s = r.dots, i = r.indexes, c = (r.Blob || typeof Blob < "u" && Blob) && f.isSpecCompliantForm(e);
916
- if (!f.isFunction(o))
917
- throw new TypeError("visitor must be a function");
918
- function u(p) {
919
- if (p === null) return "";
920
- if (f.isDate(p))
921
- return p.toISOString();
922
- if (f.isBoolean(p))
923
- return p.toString();
924
- if (!c && f.isBlob(p))
925
- throw new b("Blob is not supported. Use a Buffer instead.");
926
- return f.isArrayBuffer(p) || f.isTypedArray(p) ? c && typeof Blob == "function" ? new Blob([p]) : Buffer.from(p) : p;
927
- }
928
- function l(p, y, h) {
929
- let w = p;
930
- if (p && !h && typeof p == "object") {
931
- if (f.endsWith(y, "{}"))
932
- y = n ? y : y.slice(0, -2), p = JSON.stringify(p);
933
- else if (f.isArray(p) && vn(p) || (f.isFileList(p) || f.endsWith(y, "[]")) && (w = f.toArray(p)))
934
- return y = Qt(y), w.forEach(function(S, T) {
935
- !(f.isUndefined(S) || S === null) && e.append(
936
- // eslint-disable-next-line no-nested-ternary
937
- i === !0 ? at([y], T, s) : i === null ? y : y + "[]",
938
- u(S)
939
- );
940
- }), !1;
941
- }
942
- return Ve(p) ? !0 : (e.append(at(h, y, s), u(p)), !1);
943
- }
944
- const d = [], m = Object.assign(Tn, {
945
- defaultVisitor: l,
946
- convertValue: u,
947
- isVisitable: Ve
948
- });
949
- function g(p, y) {
950
- if (!f.isUndefined(p)) {
951
- if (d.indexOf(p) !== -1)
952
- throw Error("Circular reference detected in " + y.join("."));
953
- d.push(p), f.forEach(p, function(w, v) {
954
- (!(f.isUndefined(w) || w === null) && o.call(
955
- e,
956
- w,
957
- f.isString(v) ? v.trim() : v,
958
- y,
959
- m
960
- )) === !0 && g(w, y ? y.concat(v) : [v]);
961
- }), d.pop();
962
- }
963
- }
964
- if (!f.isObject(t))
965
- throw new TypeError("data must be an object");
966
- return g(t), e;
967
- }
968
- function ct(t) {
969
- const e = {
970
- "!": "%21",
971
- "'": "%27",
972
- "(": "%28",
973
- ")": "%29",
974
- "~": "%7E",
975
- "%20": "+",
976
- "%00": "\0"
977
- };
978
- return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(n) {
979
- return e[n];
980
- });
981
- }
982
- function Je(t, e) {
983
- this._pairs = [], t && Pe(t, this, e);
984
- }
985
- const Kt = Je.prototype;
986
- Kt.append = function(e, r) {
987
- this._pairs.push([e, r]);
988
- };
989
- Kt.toString = function(e) {
990
- const r = e ? function(n) {
991
- return e.call(this, n, ct);
992
- } : ct;
993
- return this._pairs.map(function(o) {
994
- return r(o[0]) + "=" + r(o[1]);
995
- }, "").join("&");
996
- };
997
- function Rn(t) {
998
- return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
999
- }
1000
- function zt(t, e, r) {
1001
- if (!e)
1002
- return t;
1003
- const n = r && r.encode || Rn;
1004
- f.isFunction(r) && (r = {
1005
- serialize: r
1006
- });
1007
- const o = r && r.serialize;
1008
- let s;
1009
- if (o ? s = o(e, r) : s = f.isURLSearchParams(e) ? e.toString() : new Je(e, r).toString(n), s) {
1010
- const i = t.indexOf("#");
1011
- i !== -1 && (t = t.slice(0, i)), t += (t.indexOf("?") === -1 ? "?" : "&") + s;
1012
- }
1013
- return t;
1014
- }
1015
- class ut {
1016
- constructor() {
1017
- this.handlers = [];
1018
- }
1019
- /**
1020
- * Add a new interceptor to the stack
1021
- *
1022
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
1023
- * @param {Function} rejected The function to handle `reject` for a `Promise`
1024
- *
1025
- * @return {Number} An ID used to remove interceptor later
1026
- */
1027
- use(e, r, n) {
1028
- return this.handlers.push({
1029
- fulfilled: e,
1030
- rejected: r,
1031
- synchronous: n ? n.synchronous : !1,
1032
- runWhen: n ? n.runWhen : null
1033
- }), this.handlers.length - 1;
1034
- }
1035
- /**
1036
- * Remove an interceptor from the stack
1037
- *
1038
- * @param {Number} id The ID that was returned by `use`
1039
- *
1040
- * @returns {void}
1041
- */
1042
- eject(e) {
1043
- this.handlers[e] && (this.handlers[e] = null);
1044
- }
1045
- /**
1046
- * Clear all interceptors from the stack
1047
- *
1048
- * @returns {void}
1049
- */
1050
- clear() {
1051
- this.handlers && (this.handlers = []);
1052
- }
1053
- /**
1054
- * Iterate over all the registered interceptors
1055
- *
1056
- * This method is particularly useful for skipping over any
1057
- * interceptors that may have become `null` calling `eject`.
1058
- *
1059
- * @param {Function} fn The function to call for each interceptor
1060
- *
1061
- * @returns {void}
1062
- */
1063
- forEach(e) {
1064
- f.forEach(this.handlers, function(n) {
1065
- n !== null && e(n);
1066
- });
1067
- }
1068
- }
1069
- const Jt = {
1070
- silentJSONParsing: !0,
1071
- forcedJSONParsing: !0,
1072
- clarifyTimeoutError: !1
1073
- }, _n = typeof URLSearchParams < "u" ? URLSearchParams : Je, xn = typeof FormData < "u" ? FormData : null, Cn = typeof Blob < "u" ? Blob : null, Pn = {
1074
- isBrowser: !0,
1075
- classes: {
1076
- URLSearchParams: _n,
1077
- FormData: xn,
1078
- Blob: Cn
1079
- },
1080
- protocols: ["http", "https", "file", "blob", "url", "data"]
1081
- }, Ge = typeof window < "u" && typeof document < "u", We = typeof navigator == "object" && navigator || void 0, Nn = Ge && (!We || ["ReactNative", "NativeScript", "NS"].indexOf(We.product) < 0), qn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
1082
- self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Dn = Ge && window.location.href || "http://localhost", jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1083
- __proto__: null,
1084
- hasBrowserEnv: Ge,
1085
- hasStandardBrowserEnv: Nn,
1086
- hasStandardBrowserWebWorkerEnv: qn,
1087
- navigator: We,
1088
- origin: Dn
1089
- }, Symbol.toStringTag, { value: "Module" })), O = {
1090
- ...jn,
1091
- ...Pn
1092
- };
1093
- function Fn(t, e) {
1094
- return Pe(t, new O.classes.URLSearchParams(), {
1095
- visitor: function(r, n, o, s) {
1096
- return O.isNode && f.isBuffer(r) ? (this.append(n, r.toString("base64")), !1) : s.defaultVisitor.apply(this, arguments);
1097
- },
1098
- ...e
1099
- });
1100
- }
1101
- function Bn(t) {
1102
- return f.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
1103
- }
1104
- function In(t) {
1105
- const e = {}, r = Object.keys(t);
1106
- let n;
1107
- const o = r.length;
1108
- let s;
1109
- for (n = 0; n < o; n++)
1110
- s = r[n], e[s] = t[s];
1111
- return e;
1112
- }
1113
- function Gt(t) {
1114
- function e(r, n, o, s) {
1115
- let i = r[s++];
1116
- if (i === "__proto__") return !0;
1117
- const a = Number.isFinite(+i), c = s >= r.length;
1118
- return i = !i && f.isArray(o) ? o.length : i, c ? (f.hasOwnProp(o, i) ? o[i] = [o[i], n] : o[i] = n, !a) : ((!o[i] || !f.isObject(o[i])) && (o[i] = []), e(r, n, o[i], s) && f.isArray(o[i]) && (o[i] = In(o[i])), !a);
1119
- }
1120
- if (f.isFormData(t) && f.isFunction(t.entries)) {
1121
- const r = {};
1122
- return f.forEachEntry(t, (n, o) => {
1123
- e(Bn(n), o, r, 0);
1124
- }), r;
1125
- }
1126
- return null;
1127
- }
1128
- function Mn(t, e, r) {
1129
- if (f.isString(t))
1130
- try {
1131
- return (e || JSON.parse)(t), f.trim(t);
1132
- } catch (n) {
1133
- if (n.name !== "SyntaxError")
1134
- throw n;
1135
- }
1136
- return (r || JSON.stringify)(t);
1137
- }
1138
- const ue = {
1139
- transitional: Jt,
1140
- adapter: ["xhr", "http", "fetch"],
1141
- transformRequest: [function(e, r) {
1142
- const n = r.getContentType() || "", o = n.indexOf("application/json") > -1, s = f.isObject(e);
1143
- if (s && f.isHTMLForm(e) && (e = new FormData(e)), f.isFormData(e))
1144
- return o ? JSON.stringify(Gt(e)) : e;
1145
- if (f.isArrayBuffer(e) || f.isBuffer(e) || f.isStream(e) || f.isFile(e) || f.isBlob(e) || f.isReadableStream(e))
1146
- return e;
1147
- if (f.isArrayBufferView(e))
1148
- return e.buffer;
1149
- if (f.isURLSearchParams(e))
1150
- return r.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
1151
- let a;
1152
- if (s) {
1153
- if (n.indexOf("application/x-www-form-urlencoded") > -1)
1154
- return Fn(e, this.formSerializer).toString();
1155
- if ((a = f.isFileList(e)) || n.indexOf("multipart/form-data") > -1) {
1156
- const c = this.env && this.env.FormData;
1157
- return Pe(
1158
- a ? { "files[]": e } : e,
1159
- c && new c(),
1160
- this.formSerializer
1161
- );
1162
- }
1163
- }
1164
- return s || o ? (r.setContentType("application/json", !1), Mn(e)) : e;
1165
- }],
1166
- transformResponse: [function(e) {
1167
- const r = this.transitional || ue.transitional, n = r && r.forcedJSONParsing, o = this.responseType === "json";
1168
- if (f.isResponse(e) || f.isReadableStream(e))
1169
- return e;
1170
- if (e && f.isString(e) && (n && !this.responseType || o)) {
1171
- const i = !(r && r.silentJSONParsing) && o;
1172
- try {
1173
- return JSON.parse(e, this.parseReviver);
1174
- } catch (a) {
1175
- if (i)
1176
- throw a.name === "SyntaxError" ? b.from(a, b.ERR_BAD_RESPONSE, this, null, this.response) : a;
1177
- }
1178
- }
1179
- return e;
1180
- }],
1181
- /**
1182
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
1183
- * timeout is not created.
1184
- */
1185
- timeout: 0,
1186
- xsrfCookieName: "XSRF-TOKEN",
1187
- xsrfHeaderName: "X-XSRF-TOKEN",
1188
- maxContentLength: -1,
1189
- maxBodyLength: -1,
1190
- env: {
1191
- FormData: O.classes.FormData,
1192
- Blob: O.classes.Blob
1193
- },
1194
- validateStatus: function(e) {
1195
- return e >= 200 && e < 300;
1196
- },
1197
- headers: {
1198
- common: {
1199
- Accept: "application/json, text/plain, */*",
1200
- "Content-Type": void 0
1201
- }
1202
- }
1203
- };
1204
- f.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
1205
- ue.headers[t] = {};
1206
- });
1207
- const Un = f.toObjectSet([
1208
- "age",
1209
- "authorization",
1210
- "content-length",
1211
- "content-type",
1212
- "etag",
1213
- "expires",
1214
- "from",
1215
- "host",
1216
- "if-modified-since",
1217
- "if-unmodified-since",
1218
- "last-modified",
1219
- "location",
1220
- "max-forwards",
1221
- "proxy-authorization",
1222
- "referer",
1223
- "retry-after",
1224
- "user-agent"
1225
- ]), Ln = (t) => {
1226
- const e = {};
1227
- let r, n, o;
1228
- return t && t.split(`
1229
- `).forEach(function(i) {
1230
- o = i.indexOf(":"), r = i.substring(0, o).trim().toLowerCase(), n = i.substring(o + 1).trim(), !(!r || e[r] && Un[r]) && (r === "set-cookie" ? e[r] ? e[r].push(n) : e[r] = [n] : e[r] = e[r] ? e[r] + ", " + n : n);
1231
- }), e;
1232
- }, lt = /* @__PURE__ */ Symbol("internals");
1233
- function oe(t) {
1234
- return t && String(t).trim().toLowerCase();
1235
- }
1236
- function Oe(t) {
1237
- return t === !1 || t == null ? t : f.isArray(t) ? t.map(Oe) : String(t);
1238
- }
1239
- function $n(t) {
1240
- const e = /* @__PURE__ */ Object.create(null), r = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1241
- let n;
1242
- for (; n = r.exec(t); )
1243
- e[n[1]] = n[2];
1244
- return e;
1245
- }
1246
- const kn = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
1247
- function Ue(t, e, r, n, o) {
1248
- if (f.isFunction(n))
1249
- return n.call(this, e, r);
1250
- if (o && (e = r), !!f.isString(e)) {
1251
- if (f.isString(n))
1252
- return e.indexOf(n) !== -1;
1253
- if (f.isRegExp(n))
1254
- return n.test(e);
1255
- }
1256
- }
1257
- function Hn(t) {
1258
- return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, r, n) => r.toUpperCase() + n);
1259
- }
1260
- function Vn(t, e) {
1261
- const r = f.toCamelCase(" " + e);
1262
- ["get", "set", "has"].forEach((n) => {
1263
- Object.defineProperty(t, n + r, {
1264
- value: function(o, s, i) {
1265
- return this[n].call(this, e, o, s, i);
1266
- },
1267
- configurable: !0
1268
- });
1269
- });
1270
- }
1271
- let _ = class {
1272
- constructor(e) {
1273
- e && this.set(e);
1274
- }
1275
- set(e, r, n) {
1276
- const o = this;
1277
- function s(a, c, u) {
1278
- const l = oe(c);
1279
- if (!l)
1280
- throw new Error("header name must be a non-empty string");
1281
- const d = f.findKey(o, l);
1282
- (!d || o[d] === void 0 || u === !0 || u === void 0 && o[d] !== !1) && (o[d || c] = Oe(a));
1283
- }
1284
- const i = (a, c) => f.forEach(a, (u, l) => s(u, l, c));
1285
- if (f.isPlainObject(e) || e instanceof this.constructor)
1286
- i(e, r);
1287
- else if (f.isString(e) && (e = e.trim()) && !kn(e))
1288
- i(Ln(e), r);
1289
- else if (f.isObject(e) && f.isIterable(e)) {
1290
- let a = {}, c, u;
1291
- for (const l of e) {
1292
- if (!f.isArray(l))
1293
- throw TypeError("Object iterator must return a key-value pair");
1294
- a[u = l[0]] = (c = a[u]) ? f.isArray(c) ? [...c, l[1]] : [c, l[1]] : l[1];
1295
- }
1296
- i(a, r);
326
+ r[3] = l, r[4] = s, r[5] = a, r[6] = u;
1297
327
  } else
1298
- e != null && s(r, e, n);
1299
- return this;
1300
- }
1301
- get(e, r) {
1302
- if (e = oe(e), e) {
1303
- const n = f.findKey(this, e);
1304
- if (n) {
1305
- const o = this[n];
1306
- if (!r)
1307
- return o;
1308
- if (r === !0)
1309
- return $n(o);
1310
- if (f.isFunction(r))
1311
- return r.call(this, o, n);
1312
- if (f.isRegExp(r))
1313
- return r.exec(o);
1314
- throw new TypeError("parser must be boolean|regexp|function");
1315
- }
1316
- }
1317
- }
1318
- has(e, r) {
1319
- if (e = oe(e), e) {
1320
- const n = f.findKey(this, e);
1321
- return !!(n && this[n] !== void 0 && (!r || Ue(this, this[n], n, r)));
1322
- }
1323
- return !1;
1324
- }
1325
- delete(e, r) {
1326
- const n = this;
1327
- let o = !1;
1328
- function s(i) {
1329
- if (i = oe(i), i) {
1330
- const a = f.findKey(n, i);
1331
- a && (!r || Ue(n, n[a], a, r)) && (delete n[a], o = !0);
1332
- }
1333
- }
1334
- return f.isArray(e) ? e.forEach(s) : s(e), o;
1335
- }
1336
- clear(e) {
1337
- const r = Object.keys(this);
1338
- let n = r.length, o = !1;
1339
- for (; n--; ) {
1340
- const s = r[n];
1341
- (!e || Ue(this, this[s], s, e, !0)) && (delete this[s], o = !0);
1342
- }
1343
- return o;
1344
- }
1345
- normalize(e) {
1346
- const r = this, n = {};
1347
- return f.forEach(this, (o, s) => {
1348
- const i = f.findKey(n, s);
1349
- if (i) {
1350
- r[i] = Oe(o), delete r[s];
1351
- return;
1352
- }
1353
- const a = e ? Hn(s) : String(s).trim();
1354
- a !== s && delete r[s], r[a] = Oe(o), n[a] = !0;
1355
- }), this;
1356
- }
1357
- concat(...e) {
1358
- return this.constructor.concat(this, ...e);
1359
- }
1360
- toJSON(e) {
1361
- const r = /* @__PURE__ */ Object.create(null);
1362
- return f.forEach(this, (n, o) => {
1363
- n != null && n !== !1 && (r[o] = e && f.isArray(n) ? n.join(", ") : n);
1364
- }), r;
1365
- }
1366
- [Symbol.iterator]() {
1367
- return Object.entries(this.toJSON())[Symbol.iterator]();
1368
- }
1369
- toString() {
1370
- return Object.entries(this.toJSON()).map(([e, r]) => e + ": " + r).join(`
1371
- `);
1372
- }
1373
- getSetCookie() {
1374
- return this.get("set-cookie") || [];
1375
- }
1376
- get [Symbol.toStringTag]() {
1377
- return "AxiosHeaders";
1378
- }
1379
- static from(e) {
1380
- return e instanceof this ? e : new this(e);
1381
- }
1382
- static concat(e, ...r) {
1383
- const n = new this(e);
1384
- return r.forEach((o) => n.set(o)), n;
1385
- }
1386
- static accessor(e) {
1387
- const n = (this[lt] = this[lt] = {
1388
- accessors: {}
1389
- }).accessors, o = this.prototype;
1390
- function s(i) {
1391
- const a = oe(i);
1392
- n[a] || (Vn(o, i), n[a] = !0);
1393
- }
1394
- return f.isArray(e) ? e.forEach(s) : s(e), this;
1395
- }
1396
- };
1397
- _.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1398
- f.reduceDescriptors(_.prototype, ({ value: t }, e) => {
1399
- let r = e[0].toUpperCase() + e.slice(1);
1400
- return {
1401
- get: () => t,
1402
- set(n) {
1403
- this[r] = n;
1404
- }
1405
- };
1406
- });
1407
- f.freezeMethods(_);
1408
- function Le(t, e) {
1409
- const r = this || ue, n = e || r, o = _.from(n.headers);
1410
- let s = n.data;
1411
- return f.forEach(t, function(a) {
1412
- s = a.call(r, s, o.normalize(), e ? e.status : void 0);
1413
- }), o.normalize(), s;
1414
- }
1415
- function Xt(t) {
1416
- return !!(t && t.__CANCEL__);
1417
- }
1418
- function re(t, e, r) {
1419
- b.call(this, t ?? "canceled", b.ERR_CANCELED, e, r), this.name = "CanceledError";
1420
- }
1421
- f.inherits(re, b, {
1422
- __CANCEL__: !0
1423
- });
1424
- function Yt(t, e, r) {
1425
- const n = r.config.validateStatus;
1426
- !r.status || !n || n(r.status) ? t(r) : e(new b(
1427
- "Request failed with status code " + r.status,
1428
- [b.ERR_BAD_REQUEST, b.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4],
1429
- r.config,
1430
- r.request,
1431
- r
1432
- ));
1433
- }
1434
- function Wn(t) {
1435
- const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(t);
1436
- return e && e[1] || "";
1437
- }
1438
- function Qn(t, e) {
1439
- t = t || 10;
1440
- const r = new Array(t), n = new Array(t);
1441
- let o = 0, s = 0, i;
1442
- return e = e !== void 0 ? e : 1e3, function(c) {
1443
- const u = Date.now(), l = n[s];
1444
- i || (i = u), r[o] = c, n[o] = u;
1445
- let d = s, m = 0;
1446
- for (; d !== o; )
1447
- m += r[d++], d = d % t;
1448
- if (o = (o + 1) % t, o === s && (s = (s + 1) % t), u - i < e)
1449
- return;
1450
- const g = l && u - l;
1451
- return g ? Math.round(m * 1e3 / g) : void 0;
1452
- };
1453
- }
1454
- function Kn(t, e) {
1455
- let r = 0, n = 1e3 / e, o, s;
1456
- const i = (u, l = Date.now()) => {
1457
- r = l, o = null, s && (clearTimeout(s), s = null), t(...u);
1458
- };
1459
- return [(...u) => {
1460
- const l = Date.now(), d = l - r;
1461
- d >= n ? i(u, l) : (o = u, s || (s = setTimeout(() => {
1462
- s = null, i(o);
1463
- }, n - d)));
1464
- }, () => o && i(o)];
1465
- }
1466
- const Te = (t, e, r = 3) => {
1467
- let n = 0;
1468
- const o = Qn(50, 250);
1469
- return Kn((s) => {
1470
- const i = s.loaded, a = s.lengthComputable ? s.total : void 0, c = i - n, u = o(c), l = i <= a;
1471
- n = i;
1472
- const d = {
1473
- loaded: i,
1474
- total: a,
1475
- progress: a ? i / a : void 0,
1476
- bytes: c,
1477
- rate: u || void 0,
1478
- estimated: u && a && l ? (a - i) / u : void 0,
1479
- event: s,
1480
- lengthComputable: a != null,
1481
- [e ? "download" : "upload"]: !0
1482
- };
1483
- t(d);
1484
- }, r);
1485
- }, ft = (t, e) => {
1486
- const r = t != null;
1487
- return [(n) => e[0]({
1488
- lengthComputable: r,
1489
- total: t,
1490
- loaded: n
1491
- }), e[1]];
1492
- }, dt = (t) => (...e) => f.asap(() => t(...e)), zn = O.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (r) => (r = new URL(r, O.origin), t.protocol === r.protocol && t.host === r.host && (e || t.port === r.port)))(
1493
- new URL(O.origin),
1494
- O.navigator && /(msie|trident)/i.test(O.navigator.userAgent)
1495
- ) : () => !0, Jn = O.hasStandardBrowserEnv ? (
1496
- // Standard browser envs support document.cookie
1497
- {
1498
- write(t, e, r, n, o, s, i) {
1499
- if (typeof document > "u") return;
1500
- const a = [`${t}=${encodeURIComponent(e)}`];
1501
- f.isNumber(r) && a.push(`expires=${new Date(r).toUTCString()}`), f.isString(n) && a.push(`path=${n}`), f.isString(o) && a.push(`domain=${o}`), s === !0 && a.push("secure"), f.isString(i) && a.push(`SameSite=${i}`), document.cookie = a.join("; ");
1502
- },
1503
- read(t) {
1504
- if (typeof document > "u") return null;
1505
- const e = document.cookie.match(new RegExp("(?:^|; )" + t + "=([^;]*)"));
1506
- return e ? decodeURIComponent(e[1]) : null;
1507
- },
1508
- remove(t) {
1509
- this.write(t, "", Date.now() - 864e5, "/");
1510
- }
1511
- }
1512
- ) : (
1513
- // Non-standard browser env (web workers, react-native) lack needed support.
1514
- {
1515
- write() {
1516
- },
1517
- read() {
1518
- return null;
1519
- },
1520
- remove() {
1521
- }
1522
- }
1523
- );
1524
- function Gn(t) {
1525
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
1526
- }
1527
- function Xn(t, e) {
1528
- return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
1529
- }
1530
- function Zt(t, e, r) {
1531
- let n = !Gn(e);
1532
- return t && (n || r == !1) ? Xn(t, e) : e;
1533
- }
1534
- const pt = (t) => t instanceof _ ? { ...t } : t;
1535
- function V(t, e) {
1536
- e = e || {};
1537
- const r = {};
1538
- function n(u, l, d, m) {
1539
- return f.isPlainObject(u) && f.isPlainObject(l) ? f.merge.call({ caseless: m }, u, l) : f.isPlainObject(l) ? f.merge({}, l) : f.isArray(l) ? l.slice() : l;
1540
- }
1541
- function o(u, l, d, m) {
1542
- if (f.isUndefined(l)) {
1543
- if (!f.isUndefined(u))
1544
- return n(void 0, u, d, m);
1545
- } else return n(u, l, d, m);
1546
- }
1547
- function s(u, l) {
1548
- if (!f.isUndefined(l))
1549
- return n(void 0, l);
1550
- }
1551
- function i(u, l) {
1552
- if (f.isUndefined(l)) {
1553
- if (!f.isUndefined(u))
1554
- return n(void 0, u);
1555
- } else return n(void 0, l);
1556
- }
1557
- function a(u, l, d) {
1558
- if (d in e)
1559
- return n(u, l);
1560
- if (d in t)
1561
- return n(void 0, u);
1562
- }
1563
- const c = {
1564
- url: s,
1565
- method: s,
1566
- data: s,
1567
- baseURL: i,
1568
- transformRequest: i,
1569
- transformResponse: i,
1570
- paramsSerializer: i,
1571
- timeout: i,
1572
- timeoutMessage: i,
1573
- withCredentials: i,
1574
- withXSRFToken: i,
1575
- adapter: i,
1576
- responseType: i,
1577
- xsrfCookieName: i,
1578
- xsrfHeaderName: i,
1579
- onUploadProgress: i,
1580
- onDownloadProgress: i,
1581
- decompress: i,
1582
- maxContentLength: i,
1583
- maxBodyLength: i,
1584
- beforeRedirect: i,
1585
- transport: i,
1586
- httpAgent: i,
1587
- httpsAgent: i,
1588
- cancelToken: i,
1589
- socketPath: i,
1590
- responseEncoding: i,
1591
- validateStatus: a,
1592
- headers: (u, l, d) => o(pt(u), pt(l), d, !0)
1593
- };
1594
- return f.forEach(Object.keys({ ...t, ...e }), function(l) {
1595
- const d = c[l] || o, m = d(t[l], e[l], l);
1596
- f.isUndefined(m) && d !== a || (r[l] = m);
1597
- }), r;
1598
- }
1599
- const er = (t) => {
1600
- const e = V({}, t);
1601
- let { data: r, withXSRFToken: n, xsrfHeaderName: o, xsrfCookieName: s, headers: i, auth: a } = e;
1602
- if (e.headers = i = _.from(i), e.url = zt(Zt(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), a && i.set(
1603
- "Authorization",
1604
- "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
1605
- ), f.isFormData(r)) {
1606
- if (O.hasStandardBrowserEnv || O.hasStandardBrowserWebWorkerEnv)
1607
- i.setContentType(void 0);
1608
- else if (f.isFunction(r.getHeaders)) {
1609
- const c = r.getHeaders(), u = ["content-type", "content-length"];
1610
- Object.entries(c).forEach(([l, d]) => {
1611
- u.includes(l.toLowerCase()) && i.set(l, d);
1612
- });
1613
- }
1614
- }
1615
- if (O.hasStandardBrowserEnv && (n && f.isFunction(n) && (n = n(e)), n || n !== !1 && zn(e.url))) {
1616
- const c = o && s && Jn.read(s);
1617
- c && i.set(o, c);
1618
- }
1619
- return e;
1620
- }, Yn = typeof XMLHttpRequest < "u", Zn = Yn && function(t) {
1621
- return new Promise(function(r, n) {
1622
- const o = er(t);
1623
- let s = o.data;
1624
- const i = _.from(o.headers).normalize();
1625
- let { responseType: a, onUploadProgress: c, onDownloadProgress: u } = o, l, d, m, g, p;
1626
- function y() {
1627
- g && g(), p && p(), o.cancelToken && o.cancelToken.unsubscribe(l), o.signal && o.signal.removeEventListener("abort", l);
1628
- }
1629
- let h = new XMLHttpRequest();
1630
- h.open(o.method.toUpperCase(), o.url, !0), h.timeout = o.timeout;
1631
- function w() {
1632
- if (!h)
1633
- return;
1634
- const S = _.from(
1635
- "getAllResponseHeaders" in h && h.getAllResponseHeaders()
1636
- ), C = {
1637
- data: !a || a === "text" || a === "json" ? h.responseText : h.response,
1638
- status: h.status,
1639
- statusText: h.statusText,
1640
- headers: S,
1641
- config: t,
1642
- request: h
1643
- };
1644
- Yt(function(x) {
1645
- r(x), y();
1646
- }, function(x) {
1647
- n(x), y();
1648
- }, C), h = null;
1649
- }
1650
- "onloadend" in h ? h.onloadend = w : h.onreadystatechange = function() {
1651
- !h || h.readyState !== 4 || h.status === 0 && !(h.responseURL && h.responseURL.indexOf("file:") === 0) || setTimeout(w);
1652
- }, h.onabort = function() {
1653
- h && (n(new b("Request aborted", b.ECONNABORTED, t, h)), h = null);
1654
- }, h.onerror = function(T) {
1655
- const C = T && T.message ? T.message : "Network Error", L = new b(C, b.ERR_NETWORK, t, h);
1656
- L.event = T || null, n(L), h = null;
1657
- }, h.ontimeout = function() {
1658
- let T = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
1659
- const C = o.transitional || Jt;
1660
- o.timeoutErrorMessage && (T = o.timeoutErrorMessage), n(new b(
1661
- T,
1662
- C.clarifyTimeoutError ? b.ETIMEDOUT : b.ECONNABORTED,
1663
- t,
1664
- h
1665
- )), h = null;
1666
- }, s === void 0 && i.setContentType(null), "setRequestHeader" in h && f.forEach(i.toJSON(), function(T, C) {
1667
- h.setRequestHeader(C, T);
1668
- }), f.isUndefined(o.withCredentials) || (h.withCredentials = !!o.withCredentials), a && a !== "json" && (h.responseType = o.responseType), u && ([m, p] = Te(u, !0), h.addEventListener("progress", m)), c && h.upload && ([d, g] = Te(c), h.upload.addEventListener("progress", d), h.upload.addEventListener("loadend", g)), (o.cancelToken || o.signal) && (l = (S) => {
1669
- h && (n(!S || S.type ? new re(null, t, h) : S), h.abort(), h = null);
1670
- }, o.cancelToken && o.cancelToken.subscribe(l), o.signal && (o.signal.aborted ? l() : o.signal.addEventListener("abort", l)));
1671
- const v = Wn(o.url);
1672
- if (v && O.protocols.indexOf(v) === -1) {
1673
- n(new b("Unsupported protocol " + v + ":", b.ERR_BAD_REQUEST, t));
1674
- return;
1675
- }
1676
- h.send(s || null);
1677
- });
1678
- }, eo = (t, e) => {
1679
- const { length: r } = t = t ? t.filter(Boolean) : [];
1680
- if (e || r) {
1681
- let n = new AbortController(), o;
1682
- const s = function(u) {
1683
- if (!o) {
1684
- o = !0, a();
1685
- const l = u instanceof Error ? u : this.reason;
1686
- n.abort(l instanceof b ? l : new re(l instanceof Error ? l.message : l));
1687
- }
1688
- };
1689
- let i = e && setTimeout(() => {
1690
- i = null, s(new b(`timeout ${e} of ms exceeded`, b.ETIMEDOUT));
1691
- }, e);
1692
- const a = () => {
1693
- t && (i && clearTimeout(i), i = null, t.forEach((u) => {
1694
- u.unsubscribe ? u.unsubscribe(s) : u.removeEventListener("abort", s);
1695
- }), t = null);
1696
- };
1697
- t.forEach((u) => u.addEventListener("abort", s));
1698
- const { signal: c } = n;
1699
- return c.unsubscribe = () => f.asap(a), c;
1700
- }
1701
- }, to = function* (t, e) {
1702
- let r = t.byteLength;
1703
- if (r < e) {
1704
- yield t;
1705
- return;
1706
- }
1707
- let n = 0, o;
1708
- for (; n < r; )
1709
- o = n + e, yield t.slice(n, o), n = o;
1710
- }, ro = async function* (t, e) {
1711
- for await (const r of no(t))
1712
- yield* to(r, e);
1713
- }, no = async function* (t) {
1714
- if (t[Symbol.asyncIterator]) {
1715
- yield* t;
1716
- return;
1717
- }
1718
- const e = t.getReader();
1719
- try {
1720
- for (; ; ) {
1721
- const { done: r, value: n } = await e.read();
1722
- if (r)
1723
- break;
1724
- yield n;
1725
- }
1726
- } finally {
1727
- await e.cancel();
1728
- }
1729
- }, ht = (t, e, r, n) => {
1730
- const o = ro(t, e);
1731
- let s = 0, i, a = (c) => {
1732
- i || (i = !0, n && n(c));
1733
- };
1734
- return new ReadableStream({
1735
- async pull(c) {
1736
- try {
1737
- const { done: u, value: l } = await o.next();
1738
- if (u) {
1739
- a(), c.close();
1740
- return;
1741
- }
1742
- let d = l.byteLength;
1743
- if (r) {
1744
- let m = s += d;
1745
- r(m);
1746
- }
1747
- c.enqueue(new Uint8Array(l));
1748
- } catch (u) {
1749
- throw a(u), u;
1750
- }
1751
- },
1752
- cancel(c) {
1753
- return a(c), o.return();
1754
- }
1755
- }, {
1756
- highWaterMark: 2
1757
- });
1758
- }, mt = 64 * 1024, { isFunction: ye } = f, oo = (({ Request: t, Response: e }) => ({
1759
- Request: t,
1760
- Response: e
1761
- }))(f.global), {
1762
- ReadableStream: yt,
1763
- TextEncoder: gt
1764
- } = f.global, bt = (t, ...e) => {
1765
- try {
1766
- return !!t(...e);
1767
- } catch {
1768
- return !1;
1769
- }
1770
- }, so = (t) => {
1771
- t = f.merge.call({
1772
- skipUndefined: !0
1773
- }, oo, t);
1774
- const { fetch: e, Request: r, Response: n } = t, o = e ? ye(e) : typeof fetch == "function", s = ye(r), i = ye(n);
1775
- if (!o)
1776
- return !1;
1777
- const a = o && ye(yt), c = o && (typeof gt == "function" ? /* @__PURE__ */ ((p) => (y) => p.encode(y))(new gt()) : async (p) => new Uint8Array(await new r(p).arrayBuffer())), u = s && a && bt(() => {
1778
- let p = !1;
1779
- const y = new r(O.origin, {
1780
- body: new yt(),
1781
- method: "POST",
1782
- get duplex() {
1783
- return p = !0, "half";
1784
- }
1785
- }).headers.has("Content-Type");
1786
- return p && !y;
1787
- }), l = i && a && bt(() => f.isReadableStream(new n("").body)), d = {
1788
- stream: l && ((p) => p.body)
1789
- };
1790
- o && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((p) => {
1791
- !d[p] && (d[p] = (y, h) => {
1792
- let w = y && y[p];
1793
- if (w)
1794
- return w.call(y);
1795
- throw new b(`Response type '${p}' is not supported`, b.ERR_NOT_SUPPORT, h);
1796
- });
1797
- });
1798
- const m = async (p) => {
1799
- if (p == null)
1800
- return 0;
1801
- if (f.isBlob(p))
1802
- return p.size;
1803
- if (f.isSpecCompliantForm(p))
1804
- return (await new r(O.origin, {
1805
- method: "POST",
1806
- body: p
1807
- }).arrayBuffer()).byteLength;
1808
- if (f.isArrayBufferView(p) || f.isArrayBuffer(p))
1809
- return p.byteLength;
1810
- if (f.isURLSearchParams(p) && (p = p + ""), f.isString(p))
1811
- return (await c(p)).byteLength;
1812
- }, g = async (p, y) => {
1813
- const h = f.toFiniteNumber(p.getContentLength());
1814
- return h ?? m(y);
1815
- };
1816
- return async (p) => {
1817
- let {
1818
- url: y,
1819
- method: h,
1820
- data: w,
1821
- signal: v,
1822
- cancelToken: S,
1823
- timeout: T,
1824
- onDownloadProgress: C,
1825
- onUploadProgress: L,
1826
- responseType: x,
1827
- headers: je,
1828
- withCredentials: de = "same-origin",
1829
- fetchOptions: Ze
1830
- } = er(p), et = e || fetch;
1831
- x = x ? (x + "").toLowerCase() : "text";
1832
- let pe = eo([v, S && S.toAbortSignal()], T), ne = null;
1833
- const $ = pe && pe.unsubscribe && (() => {
1834
- pe.unsubscribe();
1835
- });
1836
- let tt;
1837
- try {
1838
- if (L && u && h !== "get" && h !== "head" && (tt = await g(je, w)) !== 0) {
1839
- let I = new r(y, {
1840
- method: "POST",
1841
- body: w,
1842
- duplex: "half"
1843
- }), Q;
1844
- if (f.isFormData(w) && (Q = I.headers.get("content-type")) && je.setContentType(Q), I.body) {
1845
- const [Fe, he] = ft(
1846
- tt,
1847
- Te(dt(L))
1848
- );
1849
- w = ht(I.body, mt, Fe, he);
1850
- }
1851
- }
1852
- f.isString(de) || (de = de ? "include" : "omit");
1853
- const D = s && "credentials" in r.prototype, rt = {
1854
- ...Ze,
1855
- signal: pe,
1856
- method: h.toUpperCase(),
1857
- headers: je.normalize().toJSON(),
1858
- body: w,
1859
- duplex: "half",
1860
- credentials: D ? de : void 0
1861
- };
1862
- ne = s && new r(y, rt);
1863
- let B = await (s ? et(ne, Ze) : et(y, rt));
1864
- const nt = l && (x === "stream" || x === "response");
1865
- if (l && (C || nt && $)) {
1866
- const I = {};
1867
- ["status", "statusText", "headers"].forEach((ot) => {
1868
- I[ot] = B[ot];
1869
- });
1870
- const Q = f.toFiniteNumber(B.headers.get("content-length")), [Fe, he] = C && ft(
1871
- Q,
1872
- Te(dt(C), !0)
1873
- ) || [];
1874
- B = new n(
1875
- ht(B.body, mt, Fe, () => {
1876
- he && he(), $ && $();
1877
- }),
1878
- I
1879
- );
1880
- }
1881
- x = x || "text";
1882
- let pr = await d[f.findKey(d, x) || "text"](B, p);
1883
- return !nt && $ && $(), await new Promise((I, Q) => {
1884
- Yt(I, Q, {
1885
- data: pr,
1886
- headers: _.from(B.headers),
1887
- status: B.status,
1888
- statusText: B.statusText,
1889
- config: p,
1890
- request: ne
1891
- });
1892
- });
1893
- } catch (D) {
1894
- throw $ && $(), D && D.name === "TypeError" && /Load failed|fetch/i.test(D.message) ? Object.assign(
1895
- new b("Network Error", b.ERR_NETWORK, p, ne),
1896
- {
1897
- cause: D.cause || D
1898
- }
1899
- ) : b.from(D, D && D.code, p, ne);
1900
- }
1901
- };
1902
- }, io = /* @__PURE__ */ new Map(), tr = (t) => {
1903
- let e = t && t.env || {};
1904
- const { fetch: r, Request: n, Response: o } = e, s = [
1905
- n,
1906
- o,
1907
- r
1908
- ];
1909
- let i = s.length, a = i, c, u, l = io;
1910
- for (; a--; )
1911
- c = s[a], u = l.get(c), u === void 0 && l.set(c, u = a ? /* @__PURE__ */ new Map() : so(e)), l = u;
1912
- return u;
1913
- };
1914
- tr();
1915
- const Xe = {
1916
- http: On,
1917
- xhr: Zn,
1918
- fetch: {
1919
- get: tr
1920
- }
1921
- };
1922
- f.forEach(Xe, (t, e) => {
1923
- if (t) {
1924
- try {
1925
- Object.defineProperty(t, "name", { value: e });
1926
- } catch {
1927
- }
1928
- Object.defineProperty(t, "adapterName", { value: e });
1929
- }
1930
- });
1931
- const wt = (t) => `- ${t}`, ao = (t) => f.isFunction(t) || t === null || t === !1;
1932
- function co(t, e) {
1933
- t = f.isArray(t) ? t : [t];
1934
- const { length: r } = t;
1935
- let n, o;
1936
- const s = {};
1937
- for (let i = 0; i < r; i++) {
1938
- n = t[i];
1939
- let a;
1940
- if (o = n, !ao(n) && (o = Xe[(a = String(n)).toLowerCase()], o === void 0))
1941
- throw new b(`Unknown adapter '${a}'`);
1942
- if (o && (f.isFunction(o) || (o = o.get(e))))
1943
- break;
1944
- s[a || "#" + i] = o;
1945
- }
1946
- if (!o) {
1947
- const i = Object.entries(s).map(
1948
- ([c, u]) => `adapter ${c} ` + (u === !1 ? "is not supported by the environment" : "is not available in the build")
1949
- );
1950
- let a = r ? i.length > 1 ? `since :
1951
- ` + i.map(wt).join(`
1952
- `) : " " + wt(i[0]) : "as no adapter specified";
1953
- throw new b(
1954
- "There is no suitable adapter to dispatch the request " + a,
1955
- "ERR_NOT_SUPPORT"
1956
- );
1957
- }
1958
- return o;
1959
- }
1960
- const rr = {
1961
- /**
1962
- * Resolve an adapter from a list of adapter names or functions.
1963
- * @type {Function}
1964
- */
1965
- getAdapter: co,
1966
- /**
1967
- * Exposes all known adapters
1968
- * @type {Object<string, Function|Object>}
1969
- */
1970
- adapters: Xe
1971
- };
1972
- function $e(t) {
1973
- if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
1974
- throw new re(null, t);
1975
- }
1976
- function At(t) {
1977
- return $e(t), t.headers = _.from(t.headers), t.data = Le.call(
1978
- t,
1979
- t.transformRequest
1980
- ), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), rr.getAdapter(t.adapter || ue.adapter, t)(t).then(function(n) {
1981
- return $e(t), n.data = Le.call(
1982
- t,
1983
- t.transformResponse,
1984
- n
1985
- ), n.headers = _.from(n.headers), n;
1986
- }, function(n) {
1987
- return Xt(n) || ($e(t), n && n.response && (n.response.data = Le.call(
1988
- t,
1989
- t.transformResponse,
1990
- n.response
1991
- ), n.response.headers = _.from(n.response.headers))), Promise.reject(n);
1992
- });
1993
- }
1994
- const nr = "1.13.2", Ne = {};
1995
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
1996
- Ne[t] = function(n) {
1997
- return typeof n === t || "a" + (e < 1 ? "n " : " ") + t;
1998
- };
1999
- });
2000
- const St = {};
2001
- Ne.transitional = function(e, r, n) {
2002
- function o(s, i) {
2003
- return "[Axios v" + nr + "] Transitional option '" + s + "'" + i + (n ? ". " + n : "");
2004
- }
2005
- return (s, i, a) => {
2006
- if (e === !1)
2007
- throw new b(
2008
- o(i, " has been removed" + (r ? " in " + r : "")),
2009
- b.ERR_DEPRECATED
2010
- );
2011
- return r && !St[i] && (St[i] = !0, console.warn(
2012
- o(
2013
- i,
2014
- " has been deprecated since v" + r + " and will be removed in the near future"
2015
- )
2016
- )), e ? e(s, i, a) : !0;
2017
- };
2018
- };
2019
- Ne.spelling = function(e) {
2020
- return (r, n) => (console.warn(`${n} is likely a misspelling of ${e}`), !0);
2021
- };
2022
- function uo(t, e, r) {
2023
- if (typeof t != "object")
2024
- throw new b("options must be an object", b.ERR_BAD_OPTION_VALUE);
2025
- const n = Object.keys(t);
2026
- let o = n.length;
2027
- for (; o-- > 0; ) {
2028
- const s = n[o], i = e[s];
2029
- if (i) {
2030
- const a = t[s], c = a === void 0 || i(a, s, t);
2031
- if (c !== !0)
2032
- throw new b("option " + s + " must be " + c, b.ERR_BAD_OPTION_VALUE);
2033
- continue;
2034
- }
2035
- if (r !== !0)
2036
- throw new b("Unknown option " + s, b.ERR_BAD_OPTION);
2037
- }
2038
- }
2039
- const ve = {
2040
- assertOptions: uo,
2041
- validators: Ne
2042
- }, j = ve.validators;
2043
- let H = class {
2044
- constructor(e) {
2045
- this.defaults = e || {}, this.interceptors = {
2046
- request: new ut(),
2047
- response: new ut()
2048
- };
2049
- }
2050
- /**
2051
- * Dispatch a request
2052
- *
2053
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
2054
- * @param {?Object} config
2055
- *
2056
- * @returns {Promise} The Promise to be fulfilled
2057
- */
2058
- async request(e, r) {
2059
- try {
2060
- return await this._request(e, r);
2061
- } catch (n) {
2062
- if (n instanceof Error) {
2063
- let o = {};
2064
- Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
2065
- const s = o.stack ? o.stack.replace(/^.+\n/, "") : "";
2066
- try {
2067
- n.stack ? s && !String(n.stack).endsWith(s.replace(/^.+\n.+\n/, "")) && (n.stack += `
2068
- ` + s) : n.stack = s;
2069
- } catch {
2070
- }
2071
- }
2072
- throw n;
2073
- }
2074
- }
2075
- _request(e, r) {
2076
- typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r = V(this.defaults, r);
2077
- const { transitional: n, paramsSerializer: o, headers: s } = r;
2078
- n !== void 0 && ve.assertOptions(n, {
2079
- silentJSONParsing: j.transitional(j.boolean),
2080
- forcedJSONParsing: j.transitional(j.boolean),
2081
- clarifyTimeoutError: j.transitional(j.boolean)
2082
- }, !1), o != null && (f.isFunction(o) ? r.paramsSerializer = {
2083
- serialize: o
2084
- } : ve.assertOptions(o, {
2085
- encode: j.function,
2086
- serialize: j.function
2087
- }, !0)), r.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? r.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : r.allowAbsoluteUrls = !0), ve.assertOptions(r, {
2088
- baseUrl: j.spelling("baseURL"),
2089
- withXsrfToken: j.spelling("withXSRFToken")
2090
- }, !0), r.method = (r.method || this.defaults.method || "get").toLowerCase();
2091
- let i = s && f.merge(
2092
- s.common,
2093
- s[r.method]
2094
- );
2095
- s && f.forEach(
2096
- ["delete", "get", "head", "post", "put", "patch", "common"],
2097
- (p) => {
2098
- delete s[p];
2099
- }
2100
- ), r.headers = _.concat(i, s);
2101
- const a = [];
2102
- let c = !0;
2103
- this.interceptors.request.forEach(function(y) {
2104
- typeof y.runWhen == "function" && y.runWhen(r) === !1 || (c = c && y.synchronous, a.unshift(y.fulfilled, y.rejected));
2105
- });
2106
- const u = [];
2107
- this.interceptors.response.forEach(function(y) {
2108
- u.push(y.fulfilled, y.rejected);
2109
- });
2110
- let l, d = 0, m;
2111
- if (!c) {
2112
- const p = [At.bind(this), void 0];
2113
- for (p.unshift(...a), p.push(...u), m = p.length, l = Promise.resolve(r); d < m; )
2114
- l = l.then(p[d++], p[d++]);
2115
- return l;
2116
- }
2117
- m = a.length;
2118
- let g = r;
2119
- for (; d < m; ) {
2120
- const p = a[d++], y = a[d++];
2121
- try {
2122
- g = p(g);
2123
- } catch (h) {
2124
- y.call(this, h);
2125
- break;
2126
- }
2127
- }
2128
- try {
2129
- l = At.call(this, g);
2130
- } catch (p) {
2131
- return Promise.reject(p);
2132
- }
2133
- for (d = 0, m = u.length; d < m; )
2134
- l = l.then(u[d++], u[d++]);
2135
- return l;
2136
- }
2137
- getUri(e) {
2138
- e = V(this.defaults, e);
2139
- const r = Zt(e.baseURL, e.url, e.allowAbsoluteUrls);
2140
- return zt(r, e.params, e.paramsSerializer);
2141
- }
2142
- };
2143
- f.forEach(["delete", "get", "head", "options"], function(e) {
2144
- H.prototype[e] = function(r, n) {
2145
- return this.request(V(n || {}, {
2146
- method: e,
2147
- url: r,
2148
- data: (n || {}).data
2149
- }));
2150
- };
2151
- });
2152
- f.forEach(["post", "put", "patch"], function(e) {
2153
- function r(n) {
2154
- return function(s, i, a) {
2155
- return this.request(V(a || {}, {
2156
- method: e,
2157
- headers: n ? {
2158
- "Content-Type": "multipart/form-data"
2159
- } : {},
2160
- url: s,
2161
- data: i
2162
- }));
2163
- };
2164
- }
2165
- H.prototype[e] = r(), H.prototype[e + "Form"] = r(!0);
2166
- });
2167
- let lo = class or {
2168
- constructor(e) {
2169
- if (typeof e != "function")
2170
- throw new TypeError("executor must be a function.");
2171
- let r;
2172
- this.promise = new Promise(function(s) {
2173
- r = s;
2174
- });
2175
- const n = this;
2176
- this.promise.then((o) => {
2177
- if (!n._listeners) return;
2178
- let s = n._listeners.length;
2179
- for (; s-- > 0; )
2180
- n._listeners[s](o);
2181
- n._listeners = null;
2182
- }), this.promise.then = (o) => {
2183
- let s;
2184
- const i = new Promise((a) => {
2185
- n.subscribe(a), s = a;
2186
- }).then(o);
2187
- return i.cancel = function() {
2188
- n.unsubscribe(s);
2189
- }, i;
2190
- }, e(function(s, i, a) {
2191
- n.reason || (n.reason = new re(s, i, a), r(n.reason));
2192
- });
2193
- }
2194
- /**
2195
- * Throws a `CanceledError` if cancellation has been requested.
2196
- */
2197
- throwIfRequested() {
2198
- if (this.reason)
2199
- throw this.reason;
2200
- }
2201
- /**
2202
- * Subscribe to the cancel signal
2203
- */
2204
- subscribe(e) {
2205
- if (this.reason) {
2206
- e(this.reason);
2207
- return;
2208
- }
2209
- this._listeners ? this._listeners.push(e) : this._listeners = [e];
2210
- }
2211
- /**
2212
- * Unsubscribe from the cancel signal
2213
- */
2214
- unsubscribe(e) {
2215
- if (!this._listeners)
2216
- return;
2217
- const r = this._listeners.indexOf(e);
2218
- r !== -1 && this._listeners.splice(r, 1);
2219
- }
2220
- toAbortSignal() {
2221
- const e = new AbortController(), r = (n) => {
2222
- e.abort(n);
2223
- };
2224
- return this.subscribe(r), e.signal.unsubscribe = () => this.unsubscribe(r), e.signal;
2225
- }
2226
- /**
2227
- * Returns an object that contains a new `CancelToken` and a function that, when called,
2228
- * cancels the `CancelToken`.
2229
- */
2230
- static source() {
2231
- let e;
2232
- return {
2233
- token: new or(function(o) {
2234
- e = o;
2235
- }),
2236
- cancel: e
2237
- };
2238
- }
2239
- };
2240
- function fo(t) {
2241
- return function(r) {
2242
- return t.apply(null, r);
2243
- };
2244
- }
2245
- function po(t) {
2246
- return f.isObject(t) && t.isAxiosError === !0;
2247
- }
2248
- const Qe = {
2249
- Continue: 100,
2250
- SwitchingProtocols: 101,
2251
- Processing: 102,
2252
- EarlyHints: 103,
2253
- Ok: 200,
2254
- Created: 201,
2255
- Accepted: 202,
2256
- NonAuthoritativeInformation: 203,
2257
- NoContent: 204,
2258
- ResetContent: 205,
2259
- PartialContent: 206,
2260
- MultiStatus: 207,
2261
- AlreadyReported: 208,
2262
- ImUsed: 226,
2263
- MultipleChoices: 300,
2264
- MovedPermanently: 301,
2265
- Found: 302,
2266
- SeeOther: 303,
2267
- NotModified: 304,
2268
- UseProxy: 305,
2269
- Unused: 306,
2270
- TemporaryRedirect: 307,
2271
- PermanentRedirect: 308,
2272
- BadRequest: 400,
2273
- Unauthorized: 401,
2274
- PaymentRequired: 402,
2275
- Forbidden: 403,
2276
- NotFound: 404,
2277
- MethodNotAllowed: 405,
2278
- NotAcceptable: 406,
2279
- ProxyAuthenticationRequired: 407,
2280
- RequestTimeout: 408,
2281
- Conflict: 409,
2282
- Gone: 410,
2283
- LengthRequired: 411,
2284
- PreconditionFailed: 412,
2285
- PayloadTooLarge: 413,
2286
- UriTooLong: 414,
2287
- UnsupportedMediaType: 415,
2288
- RangeNotSatisfiable: 416,
2289
- ExpectationFailed: 417,
2290
- ImATeapot: 418,
2291
- MisdirectedRequest: 421,
2292
- UnprocessableEntity: 422,
2293
- Locked: 423,
2294
- FailedDependency: 424,
2295
- TooEarly: 425,
2296
- UpgradeRequired: 426,
2297
- PreconditionRequired: 428,
2298
- TooManyRequests: 429,
2299
- RequestHeaderFieldsTooLarge: 431,
2300
- UnavailableForLegalReasons: 451,
2301
- InternalServerError: 500,
2302
- NotImplemented: 501,
2303
- BadGateway: 502,
2304
- ServiceUnavailable: 503,
2305
- GatewayTimeout: 504,
2306
- HttpVersionNotSupported: 505,
2307
- VariantAlsoNegotiates: 506,
2308
- InsufficientStorage: 507,
2309
- LoopDetected: 508,
2310
- NotExtended: 510,
2311
- NetworkAuthenticationRequired: 511,
2312
- WebServerIsDown: 521,
2313
- ConnectionTimedOut: 522,
2314
- OriginIsUnreachable: 523,
2315
- TimeoutOccurred: 524,
2316
- SslHandshakeFailed: 525,
2317
- InvalidSslCertificate: 526
2318
- };
2319
- Object.entries(Qe).forEach(([t, e]) => {
2320
- Qe[e] = t;
2321
- });
2322
- function sr(t) {
2323
- const e = new H(t), r = Bt(H.prototype.request, e);
2324
- return f.extend(r, H.prototype, e, { allOwnKeys: !0 }), f.extend(r, e, null, { allOwnKeys: !0 }), r.create = function(o) {
2325
- return sr(V(t, o));
2326
- }, r;
2327
- }
2328
- const A = sr(ue);
2329
- A.Axios = H;
2330
- A.CanceledError = re;
2331
- A.CancelToken = lo;
2332
- A.isCancel = Xt;
2333
- A.VERSION = nr;
2334
- A.toFormData = Pe;
2335
- A.AxiosError = b;
2336
- A.Cancel = A.CanceledError;
2337
- A.all = function(e) {
2338
- return Promise.all(e);
2339
- };
2340
- A.spread = fo;
2341
- A.isAxiosError = po;
2342
- A.mergeConfig = V;
2343
- A.AxiosHeaders = _;
2344
- A.formToJSON = (t) => Gt(f.isHTMLForm(t) ? new FormData(t) : t);
2345
- A.getAdapter = rr.getAdapter;
2346
- A.HttpStatusCode = Qe;
2347
- A.default = A;
2348
- const {
2349
- Axios: Io,
2350
- AxiosError: Mo,
2351
- CanceledError: Uo,
2352
- isCancel: Lo,
2353
- CancelToken: $o,
2354
- VERSION: ko,
2355
- all: Ho,
2356
- Cancel: Vo,
2357
- isAxiosError: Wo,
2358
- spread: Qo,
2359
- toFormData: Ko,
2360
- AxiosHeaders: zo,
2361
- HttpStatusCode: Jo,
2362
- formToJSON: Go,
2363
- getAdapter: Xo,
2364
- mergeConfig: Yo
2365
- } = A, Et = typeof window < "u";
2366
- class ho {
2367
- constructor(e = {}) {
2368
- this.requestStrategy = async (r, n) => {
2369
- await n(r);
2370
- }, this.responseStrategy = async (r, n) => {
2371
- await n(r);
2372
- }, this.defaultBaseUrl = e.defaultBaseUrl, this.useGlobalSingletons = e.useGlobalSingletons ?? !1, this.globalQueryClientKey = e.globalQueryClientKey || "__STORE_QUERY_CLIENT__", this.globalAxiosKey = e.globalAxiosKey || "__STORE_API_CLIENT__", this.createQueryClientImpl = e.createQueryClient || (() => new Ke({
2373
- defaultOptions: {
2374
- queries: {
2375
- refetchOnWindowFocus: !0,
2376
- refetchOnMount: !1,
2377
- retry: 3,
2378
- staleTime: 1e3 * 60 * 5
2379
- }
2380
- }
2381
- })), this.createAxiosImpl = e.createAxios || ((r) => {
2382
- const n = A.create({
2383
- baseURL: r || this.defaultBaseUrl,
2384
- withCredentials: !0
2385
- });
2386
- return this.configureAxios(n);
2387
- });
2388
- }
2389
- getQueryClient(e) {
2390
- if (Et) {
2391
- if (e?.client) return e.client;
2392
- if (this.useGlobalSingletons) {
2393
- const r = globalThis, n = r[this.globalQueryClientKey];
2394
- if (n)
2395
- return n;
2396
- const o = this.createQueryClientImpl();
2397
- return r[this.globalQueryClientKey] = o, o;
2398
- }
2399
- return this.queryClientSingleton || (this.queryClientSingleton = this.createQueryClientImpl()), this.queryClientSingleton;
2400
- }
2401
- return this.createQueryClientImpl();
2402
- }
2403
- getAxiosInstance() {
2404
- if (Et) {
2405
- if (this.useGlobalSingletons) {
2406
- const e = globalThis, r = e[this.globalAxiosKey];
2407
- if (r)
2408
- return r;
2409
- const n = this.configureAxios(this.createAxiosImpl());
2410
- return e[this.globalAxiosKey] = n, n;
2411
- }
2412
- return this.axiosSingleton || (this.axiosSingleton = this.configureAxios(this.createAxiosImpl())), this.axiosSingleton;
2413
- }
2414
- return this.configureAxios(this.createAxiosImpl());
2415
- }
2416
- setDefaultApiBaseUrl(e) {
2417
- this.defaultBaseUrl = e;
2418
- }
2419
- async setApiUrl(e) {
2420
- const r = this.getAxiosInstance();
2421
- r.defaults.baseURL = e;
2422
- }
2423
- setRequestInterceptorStrategy(e) {
2424
- this.requestStrategy = e, this.axiosSingleton && (this.axiosSingleton = this.configureAxios(this.axiosSingleton));
2425
- }
2426
- setResponseInterceptorStrategy(e) {
2427
- this.responseStrategy = e, this.axiosSingleton && (this.axiosSingleton = this.configureAxios(this.axiosSingleton));
2428
- }
2429
- getAxiosProxy() {
2430
- return new Proxy({}, {
2431
- get: (e, r) => {
2432
- const n = this.getAxiosInstance(), o = Reflect.get(n, r);
2433
- return typeof o == "function" ? o.bind(n) : o;
2434
- },
2435
- set: (e, r, n) => Reflect.set(this.getAxiosInstance(), r, n)
2436
- });
2437
- }
2438
- getQueryClientProxy() {
2439
- return new Proxy({}, {
2440
- get: (e, r) => {
2441
- const n = this.getQueryClient(), o = Reflect.get(n, r);
2442
- return typeof o == "function" ? o.bind(n) : o;
2443
- },
2444
- set: (e, r, n) => Reflect.set(this.getQueryClient(), r, n)
2445
- });
2446
- }
2447
- configureAxios(e) {
2448
- return e.interceptors.request.clear(), e.interceptors.response.clear(), e.interceptors.request.use(async (r) => {
2449
- const n = async (o) => {
2450
- };
2451
- return await this.requestStrategy(r, n), r;
2452
- }), e.interceptors.response.use(async (r) => {
2453
- const n = async (o) => {
2454
- };
2455
- return await this.responseStrategy(r, n), r;
2456
- }), e;
2457
- }
2458
- }
2459
- const Ot = "__HAUS_NAMED_HTTP_CLIENTS__", mo = typeof window < "u", ir = "default";
2460
- function Ye() {
2461
- if (mo) {
2462
- const e = globalThis, r = e[Ot];
2463
- if (r) return r;
2464
- const n = {};
2465
- return e[Ot] = n, n;
2466
- }
2467
- const t = Ye;
2468
- return t._ssr || (t._ssr = {}), t._ssr;
2469
- }
2470
- function ar(t = {}) {
2471
- return new ho({
2472
- createQueryClient: t.createQueryClient || (() => new Ke({
2473
- defaultOptions: {
2474
- queries: {
2475
- refetchOnWindowFocus: !0,
2476
- refetchOnMount: !1,
2477
- retry: 3,
2478
- staleTime: 1e3 * 60 * 5
2479
- }
2480
- }
2481
- })),
2482
- createAxios: t.createAxios || ((e) => A.create({
2483
- baseURL: e ?? t.defaultBaseUrl,
2484
- withCredentials: !0
2485
- })),
2486
- defaultBaseUrl: t.defaultBaseUrl,
2487
- useGlobalSingletons: t.useGlobalSingletons,
2488
- globalQueryClientKey: t.globalQueryClientKey,
2489
- globalAxiosKey: t.globalAxiosKey
328
+ u = r[6];
329
+ if (u !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
330
+ return u;
331
+ let f;
332
+ return r[11] !== l || r[12] !== s || r[13] !== a ? (f = /* @__PURE__ */ y.jsx(i, { ...a, ref: s, children: l }), r[11] = l, r[12] = s, r[13] = a, r[14] = f) : f = r[14], f;
2490
333
  });
334
+ return c.displayName = "Slot", c;
2491
335
  }
2492
- function yo(t, e = {}, r = {}) {
2493
- const n = Ye();
2494
- if (n[t] && !r.overwrite) return n[t];
2495
- const o = ar(e);
2496
- return n[t] = o, o;
2497
- }
2498
- function go(t, e = {}) {
2499
- const r = Ye();
2500
- return r[t] || (r[t] = ar(e)), r[t];
2501
- }
2502
- yo(ir, {
2503
- // Keep WP / multi-react-tree compatibility by using global singletons for the default client
2504
- useGlobalSingletons: !0,
2505
- globalQueryClientKey: "__STORE_QUERY_CLIENT__",
2506
- globalAxiosKey: "__STORE_API_CLIENT__"
2507
- }, {
2508
- overwrite: !1
2509
- });
2510
- const cr = go(ir, {
2511
- createQueryClient: () => new Ke({
2512
- defaultOptions: {
2513
- queries: {
2514
- refetchOnWindowFocus: !0,
2515
- refetchOnMount: !1,
2516
- retry: 3,
2517
- staleTime: 1e3 * 60 * 5
2518
- }
2519
- }
2520
- }),
2521
- createAxios: (t) => A.create({
2522
- baseURL: t,
2523
- withCredentials: !0
2524
- })
2525
- // NOTE: useGlobalSingletons is configured in namedClients.ts for the default client
2526
- });
2527
- cr.getAxiosProxy();
2528
- cr.getQueryClientProxy();
2529
- var N = {}, ge = {}, be = {}, we = {}, vt;
2530
- function le() {
2531
- if (vt) return we;
2532
- vt = 1, Object.defineProperty(we, "__esModule", { value: !0 });
2533
- var t;
2534
- return (function(e) {
2535
- e.Mutation = "mutation", e.Query = "query", e.Subscription = "subscription";
2536
- })(t || (t = {})), we.default = t, we;
2537
- }
2538
- var J = {}, se = {}, Tt;
2539
- function bo() {
2540
- if (Tt) return se;
2541
- Tt = 1, Object.defineProperty(se, "__esModule", { value: !0 }), se.isNestedField = void 0;
2542
- function t(e) {
2543
- return typeof e == "object" && e.hasOwnProperty("operation") && e.hasOwnProperty("variables") && e.hasOwnProperty("fields") || typeof e == "object" && e.hasOwnProperty("operation") && e.hasOwnProperty("fragment") && e.hasOwnProperty("fields");
2544
- }
2545
- return se.isNestedField = t, se;
2546
- }
2547
- var Rt;
2548
- function fe() {
2549
- if (Rt) return J;
2550
- Rt = 1;
2551
- var t = J && J.__assign || function() {
2552
- return t = Object.assign || function(n) {
2553
- for (var o, s = 1, i = arguments.length; s < i; s++) {
2554
- o = arguments[s];
2555
- for (var a in o) Object.prototype.hasOwnProperty.call(o, a) && (n[a] = o[a]);
2556
- }
2557
- return n;
2558
- }, t.apply(this, arguments);
2559
- };
2560
- Object.defineProperty(J, "__esModule", { value: !0 });
2561
- var e = bo(), r = (
2562
- /** @class */
2563
- (function() {
2564
- function n() {
2565
- }
2566
- return n.resolveVariables = function(o) {
2567
- for (var s = {}, i = 0, a = o; i < a.length; i++) {
2568
- var c = a[i], u = c.variables, l = c.fields;
2569
- s = t(t(t({}, s), u), l && n.getNestedVariables(l) || {});
2570
- }
2571
- return s;
2572
- }, n.queryDataNameAndArgumentMap = function(o) {
2573
- return o && Object.keys(o).length ? "(".concat(Object.entries(o).reduce(function(s, i, a) {
2574
- var c = i[0], u = i[1];
2575
- return "".concat(s).concat(a !== 0 ? ", " : "").concat(u && u.name ? u.name : c, ": $").concat(c);
2576
- }, ""), ")") : "";
2577
- }, n.queryFieldsMap = function(o) {
2578
- var s = this;
2579
- return o ? o.map(function(i) {
2580
- if ((0, e.isNestedField)(i))
2581
- return n.queryNestedFieldMap(i);
2582
- if (typeof i == "object") {
2583
- var a = "";
2584
- return Object.entries(i).forEach(function(c, u, l) {
2585
- var d = c[0], m = c[1];
2586
- a += "".concat(d, " ").concat(m.length > 0 ? "{ " + s.queryFieldsMap(m) + " }" : ""), u < l.length - 1 && (a += ", ");
2587
- }), a;
2588
- } else
2589
- return "".concat(i);
2590
- }).join(", ") : "";
2591
- }, n.operationOrAlias = function(o) {
2592
- return typeof o == "string" ? o : "".concat(o.alias, ": ").concat(o.name);
2593
- }, n.isFragment = function(o) {
2594
- var s;
2595
- return (s = o?.fragment === !0) !== null && s !== void 0 ? s : !1;
2596
- }, n.operationOrFragment = function(o) {
2597
- return n.isFragment(o) ? o.operation : n.operationOrAlias(o.operation);
2598
- }, n.getFragment = function(o) {
2599
- return n.isFragment(o) ? "... on " : "";
2600
- }, n.queryNestedFieldMap = function(o) {
2601
- return "".concat(n.getFragment(o)).concat(n.operationOrFragment(o), " ").concat(this.isFragment(o) ? "" : this.queryDataNameAndArgumentMap(o.variables), " ").concat(o.fields.length > 0 ? "{ " + this.queryFieldsMap(o.fields) + " }" : "");
2602
- }, n.queryVariablesMap = function(o, s) {
2603
- var i = {}, a = function(c) {
2604
- c && Object.keys(c).map(function(u) {
2605
- i[u] = typeof c[u] == "object" ? c[u].value : c[u];
2606
- });
2607
- };
2608
- return a(o), s && typeof s == "object" && a(n.getNestedVariables(s)), i;
2609
- }, n.getNestedVariables = function(o) {
2610
- var s = {};
2611
- function i(a) {
2612
- return a?.forEach(function(c) {
2613
- if ((0, e.isNestedField)(c))
2614
- s = t(t(t({}, c.variables), s), c.fields && i(c.fields));
2615
- else if (typeof c == "object")
2616
- for (var u = 0, l = Object.entries(c); u < l.length; u++) {
2617
- var d = l[u], m = d[1];
2618
- i(m);
2619
- }
2620
- }), s;
2621
- }
2622
- return i(o), s;
2623
- }, n.queryDataType = function(o) {
2624
- var s = "String", i = typeof o == "object" ? o.value : o;
2625
- if (o?.type != null)
2626
- s = o.type;
2627
- else {
2628
- var a = Array.isArray(i) ? i[0] : i;
2629
- switch (typeof a) {
2630
- case "object":
2631
- s = "Object";
2632
- break;
2633
- case "boolean":
2634
- s = "Boolean";
2635
- break;
2636
- case "number":
2637
- s = a % 1 === 0 ? "Int" : "Float";
2638
- break;
2639
- }
2640
- }
2641
- return typeof o == "object" && (o.list === !0 ? s = "[".concat(s, "]") : Array.isArray(o.list) && (s = "[".concat(s).concat(o.list[0] ? "!" : "", "]")), o.required && (s += "!")), s;
2642
- }, n;
2643
- })()
2644
- );
2645
- return J.default = r, J;
2646
- }
2647
- var _t;
2648
- function wo() {
2649
- if (_t) return be;
2650
- _t = 1, Object.defineProperty(be, "__esModule", { value: !0 });
2651
- var t = le(), e = fe(), r = (
2652
- /** @class */
2653
- (function() {
2654
- function n(o) {
2655
- Array.isArray(o) ? this.variables = e.default.resolveVariables(o) : (this.variables = o.variables, this.fields = o.fields, this.operation = o.operation);
2656
- }
2657
- return n.prototype.mutationBuilder = function() {
2658
- return this.operationWrapperTemplate(this.variables, this.operationTemplate(this.operation));
2659
- }, n.prototype.mutationsBuilder = function(o) {
2660
- var s = this, i = o.map(function(a) {
2661
- return s.operation = a.operation, s.variables = a.variables, s.fields = a.fields, s.operationTemplate(a.operation);
2662
- });
2663
- return this.operationWrapperTemplate(e.default.resolveVariables(o), i.join(`
2664
- `));
2665
- }, n.prototype.queryDataNameAndArgumentMap = function() {
2666
- return this.variables && Object.keys(this.variables).length ? "(".concat(Object.keys(this.variables).reduce(function(o, s, i) {
2667
- return "".concat(o).concat(i !== 0 ? ", " : "").concat(s, ": $").concat(s);
2668
- }, ""), ")") : "";
2669
- }, n.prototype.queryDataArgumentAndTypeMap = function(o) {
2670
- return Object.keys(o).length ? "(".concat(Object.keys(o).reduce(function(s, i, a) {
2671
- return "".concat(s).concat(a !== 0 ? ", " : "", "$").concat(i, ": ").concat(e.default.queryDataType(o[i]));
2672
- }, ""), ")") : "";
2673
- }, n.prototype.operationWrapperTemplate = function(o, s) {
2674
- var i = typeof this.operation == "string" ? this.operation : this.operation.name;
2675
- return {
2676
- query: "".concat(t.default.Mutation, " ").concat(i.charAt(0).toUpperCase() + i.slice(1), " ").concat(this.queryDataArgumentAndTypeMap(o), ` {
2677
- `).concat(s, `
2678
- }`),
2679
- variables: e.default.queryVariablesMap(o)
2680
- };
2681
- }, n.prototype.operationTemplate = function(o) {
2682
- var s = typeof o == "string" ? o : "".concat(o.alias, ": ").concat(o.name);
2683
- return "".concat(s, " ").concat(this.queryDataNameAndArgumentMap(), ` {
2684
- `).concat(this.queryFieldsMap(this.fields), `
2685
- }`);
2686
- }, n.prototype.queryFieldsMap = function(o) {
2687
- var s = this;
2688
- return Array.isArray(o) ? o.map(function(i) {
2689
- return typeof i == "object" ? "".concat(Object.keys(i)[0], " { ").concat(s.queryFieldsMap(Object.values(i)[0]), " }") : "".concat(i);
2690
- }).join(", ") : "";
2691
- }, n;
2692
- })()
2693
- );
2694
- return be.default = r, be;
2695
- }
2696
- var Ae = {}, xt;
2697
- function Ao() {
2698
- if (xt) return Ae;
2699
- xt = 1, Object.defineProperty(Ae, "__esModule", { value: !0 });
2700
- var t = le(), e = fe(), r = (
2701
- /** @class */
2702
- (function() {
2703
- function n(o) {
2704
- this.queryDataType = function(s) {
2705
- var i = "String", a = typeof s == "object" ? s.value : s;
2706
- if (s.type !== void 0)
2707
- i = s.type;
2708
- else
2709
- switch (typeof a) {
2710
- case "object":
2711
- i = "Object";
2712
- break;
2713
- case "boolean":
2714
- i = "Boolean";
2715
- break;
2716
- case "number":
2717
- i = a % 1 === 0 ? "Int" : "Float";
2718
- break;
2719
- }
2720
- return typeof s == "object" && s.required && (i += "!"), i;
2721
- }, Array.isArray(o) ? this.variables = e.default.resolveVariables(o) : (this.variables = o.variables, this.fields = o.fields || [], this.operation = o.operation);
2722
- }
2723
- return n.prototype.queryBuilder = function() {
2724
- return this.operationWrapperTemplate(this.operationTemplate());
2725
- }, n.prototype.queriesBuilder = function(o) {
2726
- var s = this, i = function() {
2727
- var a = [];
2728
- return o.forEach(function(c) {
2729
- c && (s.operation = c.operation, s.fields = c.fields, s.variables = c.variables, a.push(s.operationTemplate()));
2730
- }), a.join(" ");
2731
- };
2732
- return this.operationWrapperTemplate(i());
2733
- }, n.prototype.queryDataNameAndArgumentMap = function() {
2734
- return this.variables && Object.keys(this.variables).length ? "(".concat(Object.keys(this.variables).reduce(function(o, s, i) {
2735
- return "".concat(o).concat(i !== 0 ? ", " : "").concat(s, ": $").concat(s);
2736
- }, ""), ")") : "";
2737
- }, n.prototype.queryDataArgumentAndTypeMap = function() {
2738
- var o = this;
2739
- return this.variables && Object.keys(this.variables).length ? "(".concat(Object.keys(this.variables).reduce(function(s, i, a) {
2740
- return "".concat(s).concat(a !== 0 ? ", " : "", "$").concat(i, ": ").concat(o.queryDataType(o.variables[i]));
2741
- }, ""), ")") : "";
2742
- }, n.prototype.operationWrapperTemplate = function(o) {
2743
- var s = typeof this.operation == "string" ? this.operation : this.operation.name;
2744
- return {
2745
- query: "".concat(t.default.Query, " ").concat(s.charAt(0).toUpperCase()).concat(s.slice(1), " ").concat(this.queryDataArgumentAndTypeMap(), " { ").concat(o, " }"),
2746
- variables: e.default.queryVariablesMap(this.variables)
2747
- };
2748
- }, n.prototype.operationTemplate = function() {
2749
- var o = typeof this.operation == "string" ? this.operation : "".concat(this.operation.alias, ": ").concat(this.operation.name);
2750
- return "".concat(o, " ").concat(this.queryDataNameAndArgumentMap(), " { nodes { ").concat(e.default.queryFieldsMap(this.fields), " } }");
2751
- }, n;
2752
- })()
2753
- );
2754
- return Ae.default = r, Ae;
2755
- }
2756
- var Ct;
2757
- function So() {
2758
- if (Ct) return ge;
2759
- Ct = 1, Object.defineProperty(ge, "__esModule", { value: !0 });
2760
- var t = wo(), e = Ao();
2761
- return ge.default = { DefaultAppSyncQueryAdapter: e.default, DefaultAppSyncMutationAdapter: t.default }, ge;
2762
- }
2763
- var G = {}, Pt;
2764
- function Eo() {
2765
- if (Pt) return G;
2766
- Pt = 1;
2767
- var t = G && G.__assign || function() {
2768
- return t = Object.assign || function(o) {
2769
- for (var s, i = 1, a = arguments.length; i < a; i++) {
2770
- s = arguments[i];
2771
- for (var c in s) Object.prototype.hasOwnProperty.call(s, c) && (o[c] = s[c]);
2772
- }
2773
- return o;
2774
- }, t.apply(this, arguments);
2775
- };
2776
- Object.defineProperty(G, "__esModule", { value: !0 });
2777
- var e = le(), r = fe(), n = (
2778
- /** @class */
2779
- (function() {
2780
- function o(s, i) {
2781
- var a = this;
2782
- Array.isArray(s) ? this.variables = r.default.resolveVariables(s) : (this.variables = s.variables, this.fields = s.fields, this.operation = s.operation), this.config = {
2783
- operationName: ""
2784
- }, i && Object.entries(i).forEach(function(c) {
2785
- var u = c[0], l = c[1];
2786
- a.config[u] = l;
2787
- });
2788
- }
2789
- return o.prototype.mutationBuilder = function() {
2790
- return this.operationWrapperTemplate(e.default.Mutation, this.variables, this.operationTemplate(this.operation));
2791
- }, o.prototype.mutationsBuilder = function(s) {
2792
- var i = this, a = s.map(function(c) {
2793
- return i.operation = c.operation, i.variables = c.variables, i.fields = c.fields, i.operationTemplate(c.operation);
2794
- });
2795
- return this.operationWrapperTemplate(e.default.Mutation, r.default.resolveVariables(s), a.join(`
2796
- `));
2797
- }, o.prototype.queryDataArgumentAndTypeMap = function(s) {
2798
- return this.fields && typeof this.fields == "object" && (s = t(t({}, r.default.getNestedVariables(this.fields)), s)), s && Object.keys(s).length > 0 ? "(".concat(Object.keys(s).reduce(function(i, a, c) {
2799
- return "".concat(i).concat(c !== 0 ? ", " : "", "$").concat(a, ": ").concat(r.default.queryDataType(s[a]));
2800
- }, ""), ")") : "";
2801
- }, o.prototype.operationWrapperTemplate = function(s, i, a) {
2802
- var c = "".concat(s, " ").concat(this.queryDataArgumentAndTypeMap(i), ` {
2803
- `).concat(a, `
2804
- }`);
2805
- return this.config.operationName && (c = c.replace("mutation", "mutation ".concat(this.config.operationName))), {
2806
- query: c,
2807
- variables: r.default.queryVariablesMap(i, this.fields)
2808
- };
2809
- }, o.prototype.operationTemplate = function(s) {
2810
- var i = typeof s == "string" ? s : "".concat(s.alias, ": ").concat(s.name);
2811
- return "".concat(i, " ").concat(r.default.queryDataNameAndArgumentMap(this.variables), " ").concat(this.fields && this.fields.length > 0 ? `{
2812
- `.concat(r.default.queryFieldsMap(this.fields), `
2813
- }`) : "");
2814
- }, o;
2815
- })()
2816
- );
2817
- return G.default = n, G;
2818
- }
2819
- var X = {}, Nt;
2820
- function Oo() {
2821
- if (Nt) return X;
2822
- Nt = 1;
2823
- var t = X && X.__assign || function() {
2824
- return t = Object.assign || function(o) {
2825
- for (var s, i = 1, a = arguments.length; i < a; i++) {
2826
- s = arguments[i];
2827
- for (var c in s) Object.prototype.hasOwnProperty.call(s, c) && (o[c] = s[c]);
2828
- }
2829
- return o;
2830
- }, t.apply(this, arguments);
2831
- };
2832
- Object.defineProperty(X, "__esModule", { value: !0 });
2833
- var e = le(), r = fe(), n = (
2834
- /** @class */
2835
- (function() {
2836
- function o(s, i) {
2837
- var a = this;
2838
- this.config = {
2839
- operationName: ""
2840
- }, i && Object.entries(i).forEach(function(c) {
2841
- var u = c[0], l = c[1];
2842
- a.config[u] = l;
2843
- }), Array.isArray(s) ? this.variables = r.default.resolveVariables(s) : (this.variables = s.variables, this.fields = s.fields || [], this.operation = s.operation);
2844
- }
2845
- return o.prototype.queryBuilder = function() {
2846
- return this.operationWrapperTemplate(this.operationTemplate(this.variables));
2847
- }, o.prototype.queriesBuilder = function(s) {
2848
- var i = this, a = function() {
2849
- var c = [];
2850
- return s.forEach(function(u) {
2851
- u && (i.operation = u.operation, i.fields = u.fields, c.push(i.operationTemplate(u.variables)));
2852
- }), c.join(" ");
2853
- };
2854
- return this.operationWrapperTemplate(a());
2855
- }, o.prototype.queryDataArgumentAndTypeMap = function() {
2856
- var s = this.variables;
2857
- return this.fields && typeof this.fields == "object" && (s = t(t({}, r.default.getNestedVariables(this.fields)), s)), s && Object.keys(s).length > 0 ? "(".concat(Object.keys(s).reduce(function(i, a, c) {
2858
- return "".concat(i).concat(c !== 0 ? ", " : "", "$").concat(a, ": ").concat(r.default.queryDataType(s[a]));
2859
- }, ""), ")") : "";
2860
- }, o.prototype.operationWrapperTemplate = function(s) {
2861
- var i = "".concat(e.default.Query, " ").concat(this.queryDataArgumentAndTypeMap(), " { ").concat(s, " }");
2862
- return i = i.replace("query", "query".concat(this.config.operationName !== "" ? " " + this.config.operationName : "")), {
2863
- query: i,
2864
- variables: r.default.queryVariablesMap(this.variables, this.fields)
2865
- };
2866
- }, o.prototype.operationTemplate = function(s) {
2867
- var i = typeof this.operation == "string" ? this.operation : "".concat(this.operation.alias, ": ").concat(this.operation.name);
2868
- return "".concat(i, " ").concat(s ? r.default.queryDataNameAndArgumentMap(s) : "", " ").concat(this.fields && this.fields.length > 0 ? "{ " + r.default.queryFieldsMap(this.fields) + " }" : "");
2869
- }, o;
2870
- })()
2871
- );
2872
- return X.default = n, X;
2873
- }
2874
- var Se = {}, qt;
2875
- function vo() {
2876
- if (qt) return Se;
2877
- qt = 1, Object.defineProperty(Se, "__esModule", { value: !0 });
2878
- var t = le(), e = fe(), r = (
2879
- /** @class */
2880
- (function() {
2881
- function n(o) {
2882
- Array.isArray(o) ? this.variables = e.default.resolveVariables(o) : (this.variables = o.variables, this.fields = o.fields, this.operation = o.operation);
2883
- }
2884
- return n.prototype.subscriptionBuilder = function() {
2885
- return this.operationWrapperTemplate(t.default.Subscription, this.variables, this.operationTemplate(this.operation));
2886
- }, n.prototype.subscriptionsBuilder = function(o) {
2887
- var s = this, i = o.map(function(a) {
2888
- return s.operation = a.operation, s.variables = a.variables, s.fields = a.fields, s.operationTemplate(a.operation);
2889
- });
2890
- return this.operationWrapperTemplate(t.default.Subscription, e.default.resolveVariables(o), i.join(`
2891
- `));
2892
- }, n.prototype.queryDataNameAndArgumentMap = function() {
2893
- return this.variables && Object.keys(this.variables).length ? "(".concat(Object.keys(this.variables).reduce(function(o, s, i) {
2894
- return "".concat(o).concat(i !== 0 ? ", " : "").concat(s, ": $").concat(s);
2895
- }, ""), ")") : "";
2896
- }, n.prototype.queryDataArgumentAndTypeMap = function(o) {
2897
- return Object.keys(o).length ? "(".concat(Object.keys(o).reduce(function(s, i, a) {
2898
- return "".concat(s).concat(a !== 0 ? ", " : "", "$").concat(i, ": ").concat(e.default.queryDataType(o[i]));
2899
- }, ""), ")") : "";
2900
- }, n.prototype.operationWrapperTemplate = function(o, s, i) {
2901
- return {
2902
- query: "".concat(o, " ").concat(this.queryDataArgumentAndTypeMap(s), ` {
2903
- `).concat(i, `
2904
- }`),
2905
- variables: e.default.queryVariablesMap(s)
2906
- };
2907
- }, n.prototype.operationTemplate = function(o) {
2908
- var s = typeof this.operation == "string" ? this.operation : "".concat(this.operation.alias, ": ").concat(this.operation.name);
2909
- return "".concat(s, " ").concat(this.queryDataNameAndArgumentMap(), ` {
2910
- `).concat(this.queryFieldsMap(this.fields), `
2911
- }`);
2912
- }, n.prototype.queryFieldsMap = function(o) {
2913
- var s = this;
2914
- return o ? o.map(function(i) {
2915
- return typeof i == "object" ? "".concat(Object.keys(i)[0], " { ").concat(s.queryFieldsMap(Object.values(i)[0]), " }") : "".concat(i);
2916
- }).join(", ") : "";
2917
- }, n;
2918
- })()
2919
- );
2920
- return Se.default = r, Se;
2921
- }
2922
- var Dt;
2923
- function To() {
2924
- if (Dt) return N;
2925
- Dt = 1, Object.defineProperty(N, "__esModule", { value: !0 }), N.adapters = N.query = N.mutation = N.subscription = void 0;
2926
- var t = So();
2927
- N.adapters = t.default;
2928
- var e = Eo(), r = Oo(), n = vo();
2929
- function o(a, c, u) {
2930
- var l;
2931
- if (Array.isArray(a)) {
2932
- if (c) {
2933
- var d = new c(a, u);
2934
- return d.queriesBuilder(a);
2935
- }
2936
- return l = new r.default(a, u), l.queriesBuilder(a);
2937
- }
2938
- if (c) {
2939
- var d = new c(a, u);
2940
- return d.queryBuilder();
2941
- }
2942
- return l = new r.default(a, u), l.queryBuilder();
2943
- }
2944
- N.query = o;
2945
- function s(a, c, u) {
2946
- var l, d;
2947
- return Array.isArray(a) ? c ? (l = new c(a, u), l.mutationsBuilder(a)) : (d = new e.default(a, u), d.mutationsBuilder(a)) : c ? (l = new c(a, u), l.mutationBuilder()) : (d = new e.default(a, u), d.mutationBuilder());
2948
- }
2949
- N.mutation = s;
2950
- function i(a, c) {
2951
- var u, l;
2952
- return Array.isArray(a) ? c ? (u = new c(a), u.subscriptionsBuilder(a)) : (l = new n.default(a), l.subscriptionsBuilder(a)) : c ? (u = new c(a), u.subscriptionBuilder()) : (l = new n.default(a), l.subscriptionBuilder());
2953
- }
2954
- return N.subscription = i, N;
2955
- }
2956
- To();
2957
- const Ro = () => {
2958
- const e = gr(Br)?.sdk;
2959
- return e || console.error("You must wrap your component in a <DataProvider>"), e?.sdkType === "dummy" || e?.sdkType === "vendure", e;
2960
- }, qe = () => {
2961
- const t = U.c(2), {
336
+ const C = () => {
337
+ const t = P.c(2), {
2962
338
  getPlatform: e
2963
- } = Ro();
2964
- let r;
2965
- return t[0] !== e ? (r = e(), t[0] = e, t[1] = r) : r = t[1], r;
2966
- }, De = "ProductBadge", [_o] = wr(De), [xo, Co] = _o(De), ur = (t) => {
2967
- const e = U.c(13);
2968
- let r, n, o, s, i;
339
+ } = k();
340
+ let n;
341
+ return t[0] !== e ? (n = e(), t[0] = e, t[1] = n) : n = t[1], n;
342
+ }, I = "ProductBadge", [Q] = A(I), [Z, z] = Q(I), _ = (t) => {
343
+ const e = P.c(13);
344
+ let n, i, c, o, s;
2969
345
  e[0] !== t ? ({
2970
- children: n,
2971
- product: o,
2972
- __scopeProductBadge: r,
2973
- style: i,
2974
- ...s
2975
- } = t, e[0] = t, e[1] = r, e[2] = n, e[3] = o, e[4] = s, e[5] = i) : (r = e[1], n = e[2], o = e[3], s = e[4], i = e[5]);
2976
- const a = br(null), c = qe();
2977
- let u;
2978
- e[6] !== c ? (u = Re(c), e[6] = c, e[7] = u) : u = e[7];
2979
- const l = u;
2980
- if (!Z.getEnabled())
346
+ children: i,
347
+ product: c,
348
+ __scopeProductBadge: n,
349
+ style: s,
350
+ ...o
351
+ } = t, e[0] = t, e[1] = n, e[2] = i, e[3] = c, e[4] = o, e[5] = s) : (n = e[1], i = e[2], c = e[3], o = e[4], s = e[5]);
352
+ const r = N(null), l = C();
353
+ let a;
354
+ e[6] !== l ? (a = w(l), e[6] = l, e[7] = a) : a = e[7];
355
+ const u = a;
356
+ if (!v.getEnabled())
2981
357
  return null;
2982
358
  const {
2983
- badges: d
2984
- } = o;
2985
- if (!d)
359
+ badges: f
360
+ } = c;
361
+ if (!f)
2986
362
  return null;
2987
- const m = d.reduce(Po, {}), g = Object.keys(m), p = {
2988
- groupedBadges: m,
2989
- badges: d,
2990
- badgesRef: a,
2991
- positions: g
2992
- }, y = Ft(n, p);
2993
- let h;
2994
- return e[8] !== l || e[9] !== s || e[10] !== i || e[11] !== y ? (h = /* @__PURE__ */ F.jsx(l, { ...s, style: i, children: y }), e[8] = l, e[9] = s, e[10] = i, e[11] = y, e[12] = h) : h = e[12], /* @__PURE__ */ F.jsx(xo, { scope: r, ...p, children: h });
363
+ const d = f.reduce(J, {}), p = Object.keys(d), g = {
364
+ groupedBadges: d,
365
+ badges: f,
366
+ badgesRef: r,
367
+ positions: p
368
+ }, h = V(i, g);
369
+ let b;
370
+ return e[8] !== u || e[9] !== o || e[10] !== s || e[11] !== h ? (b = /* @__PURE__ */ y.jsx(u, { ...o, style: s, children: h }), e[8] = u, e[9] = o, e[10] = s, e[11] = h, e[12] = b) : b = e[12], /* @__PURE__ */ y.jsx(Z, { scope: n, ...g, children: b });
2995
371
  };
2996
- ur.displayName = De;
2997
- const lr = (t) => {
2998
- const e = U.c(18);
2999
- let r, n, o, s, i;
3000
- e[0] !== t ? ({
3001
- children: o,
3002
- position: s,
3003
- asChild: n,
3004
- __scopeProductBadge: r,
3005
- ...i
3006
- } = t, e[0] = t, e[1] = r, e[2] = n, e[3] = o, e[4] = s, e[5] = i) : (r = e[1], n = e[2], o = e[3], s = e[4], i = e[5]);
3007
- const a = qe();
3008
- let c;
3009
- e[6] !== n || e[7] !== a ? (c = Re(a, n, "div"), e[6] = n, e[7] = a, e[8] = c) : c = e[8];
3010
- const u = c, {
3011
- groupedBadges: l
3012
- } = Co(De, r), d = l[s];
3013
- let m;
3014
- e[9] !== d || e[10] !== o || e[11] !== s ? (m = Ft(o, {
3015
- badges: d,
3016
- position: s
3017
- }), e[9] = d, e[10] = o, e[11] = s, e[12] = m) : m = e[12];
3018
- let g;
3019
- return e[13] !== u || e[14] !== s || e[15] !== i || e[16] !== m ? (g = /* @__PURE__ */ F.jsx(u, { ...i, "data-position": s, children: m }), e[13] = u, e[14] = s, e[15] = i, e[16] = m, e[17] = g) : g = e[17], g;
3020
- }, fr = (t) => {
3021
- const e = U.c(13);
3022
- let r, n, o, s;
372
+ _.displayName = I;
373
+ const E = (t) => {
374
+ const e = P.c(18);
375
+ let n, i, c, o, s;
3023
376
  e[0] !== t ? ({
3024
- children: o,
3025
- asChild: r,
3026
- badge: n,
377
+ children: c,
378
+ position: o,
379
+ asChild: i,
380
+ __scopeProductBadge: n,
3027
381
  ...s
3028
- } = t, e[0] = t, e[1] = r, e[2] = n, e[3] = o, e[4] = s) : (r = e[1], n = e[2], o = e[3], s = e[4]);
3029
- const i = qe();
3030
- let a;
3031
- e[5] !== r || e[6] !== i ? (a = Re(i, r, "div"), e[5] = r, e[6] = i, e[7] = a) : a = e[7];
3032
- const c = a, u = n?.id;
382
+ } = t, e[0] = t, e[1] = n, e[2] = i, e[3] = c, e[4] = o, e[5] = s) : (n = e[1], i = e[2], c = e[3], o = e[4], s = e[5]);
383
+ const r = C();
3033
384
  let l;
3034
- return e[8] !== c || e[9] !== o || e[10] !== s || e[11] !== u ? (l = /* @__PURE__ */ F.jsx(c, { ...s, "data-badge-id": u, children: o }), e[8] = c, e[9] = o, e[10] = s, e[11] = u, e[12] = l) : l = e[12], l;
3035
- }, dr = (t) => {
3036
- const e = U.c(8), {
3037
- badge: r,
385
+ e[6] !== i || e[7] !== r ? (l = w(r, i, "div"), e[6] = i, e[7] = r, e[8] = l) : l = e[8];
386
+ const a = l, {
387
+ groupedBadges: u
388
+ } = z(I, n), f = u[o];
389
+ let d;
390
+ e[9] !== f || e[10] !== c || e[11] !== o ? (d = V(c, {
391
+ badges: f,
392
+ position: o
393
+ }), e[9] = f, e[10] = c, e[11] = o, e[12] = d) : d = e[12];
394
+ let p;
395
+ return e[13] !== a || e[14] !== o || e[15] !== s || e[16] !== d ? (p = /* @__PURE__ */ y.jsx(a, { ...s, "data-position": o, children: d }), e[13] = a, e[14] = o, e[15] = s, e[16] = d, e[17] = p) : p = e[17], p;
396
+ }, S = (t) => {
397
+ const e = P.c(13);
398
+ let n, i, c, o;
399
+ e[0] !== t ? ({
400
+ children: c,
3038
401
  asChild: n,
402
+ badge: i,
3039
403
  ...o
3040
- } = t, s = qe();
3041
- let i;
3042
- e[0] !== n || e[1] !== s ? (i = Re(s, n, "img"), e[0] = n, e[1] = s, e[2] = i) : i = e[2];
3043
- const a = i, c = Ar(o, s), u = r.asset?.preview;
3044
- let l;
3045
- return e[3] !== a || e[4] !== r.collection.name || e[5] !== u || e[6] !== c ? (l = /* @__PURE__ */ F.jsx(a, { src: u, alt: r.collection.name, "data-badge-name": r.collection.name, ...c }), e[3] = a, e[4] = r.collection.name, e[5] = u, e[6] = c, e[7] = l) : l = e[7], l;
404
+ } = t, e[0] = t, e[1] = n, e[2] = i, e[3] = c, e[4] = o) : (n = e[1], i = e[2], c = e[3], o = e[4]);
405
+ const s = C();
406
+ let r;
407
+ e[5] !== n || e[6] !== s ? (r = w(s, n, "div"), e[5] = n, e[6] = s, e[7] = r) : r = e[7];
408
+ const l = r, a = i?.id;
409
+ let u;
410
+ return e[8] !== l || e[9] !== c || e[10] !== o || e[11] !== a ? (u = /* @__PURE__ */ y.jsx(l, { ...o, "data-badge-id": a, children: c }), e[8] = l, e[9] = c, e[10] = o, e[11] = a, e[12] = u) : u = e[12], u;
411
+ }, T = (t) => {
412
+ const e = P.c(8), {
413
+ badge: n,
414
+ asChild: i,
415
+ ...c
416
+ } = t, o = C();
417
+ let s;
418
+ e[0] !== i || e[1] !== o ? (s = w(o, i, "img"), e[0] = i, e[1] = o, e[2] = s) : s = e[2];
419
+ const r = s, l = O(c, o), a = n.asset?.preview;
420
+ let u;
421
+ return e[3] !== r || e[4] !== n.collection.name || e[5] !== a || e[6] !== l ? (u = /* @__PURE__ */ y.jsx(r, { src: a, alt: n.collection.name, "data-badge-name": n.collection.name, ...l }), e[3] = r, e[4] = n.collection.name, e[5] = a, e[6] = l, e[7] = u) : u = e[7], u;
3046
422
  };
3047
- lr.displayName = "ProductBadgeGroup";
3048
- fr.displayName = "ProductBadgeItem";
3049
- dr.displayName = "ProductBadgeImage";
3050
- const Zo = {
3051
- Root: ur,
3052
- Group: lr,
3053
- Item: fr,
3054
- Image: dr
423
+ E.displayName = "ProductBadgeGroup";
424
+ S.displayName = "ProductBadgeItem";
425
+ T.displayName = "ProductBadgeImage";
426
+ const re = {
427
+ Root: _,
428
+ Group: E,
429
+ Item: S,
430
+ Image: T
3055
431
  };
3056
- function Po(t, e) {
432
+ function J(t, e) {
3057
433
  return t[e.position] || (t[e.position] = []), t[e.position].push(e), t;
3058
434
  }
3059
435
  export {
3060
- Zo as ProductBadge,
3061
- Z as VendureBadgePlugin
436
+ re as ProductBadge,
437
+ v as VendureBadgePlugin
3062
438
  };