@instockng/storefront-ui 1.0.12 → 1.0.13

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.
Files changed (46) hide show
  1. package/dist/components/Checkout.d.ts.map +1 -1
  2. package/dist/contexts/CartContext.d.ts +2 -0
  3. package/dist/contexts/CartContext.d.ts.map +1 -1
  4. package/dist/index10.mjs +70 -70
  5. package/dist/index101.mjs +1 -1
  6. package/dist/index102.mjs +3 -3
  7. package/dist/index103.mjs +3 -3
  8. package/dist/index111.mjs +1 -1
  9. package/dist/index3.mjs +80 -75
  10. package/dist/index42.mjs +17 -17
  11. package/dist/index43.mjs +2 -2
  12. package/dist/index62.mjs +231 -30
  13. package/dist/index63.mjs +5 -42
  14. package/dist/index64.mjs +127 -228
  15. package/dist/index65.mjs +66 -4
  16. package/dist/index66.mjs +77 -124
  17. package/dist/index67.mjs +26 -65
  18. package/dist/index68.mjs +6 -84
  19. package/dist/index69.mjs +72 -26
  20. package/dist/index70.mjs +3 -8
  21. package/dist/index71.mjs +2 -75
  22. package/dist/index72.mjs +82 -3
  23. package/dist/index73.mjs +54 -2
  24. package/dist/index74.mjs +5 -82
  25. package/dist/index75.mjs +4 -53
  26. package/dist/index76.mjs +178 -5
  27. package/dist/index77.mjs +53 -5
  28. package/dist/index78.mjs +68 -178
  29. package/dist/index79.mjs +31 -50
  30. package/dist/index80.mjs +43 -69
  31. package/dist/index81.mjs +1 -1
  32. package/dist/index82.mjs +1 -1
  33. package/dist/index83.mjs +5 -5
  34. package/dist/index85.mjs +2 -2
  35. package/dist/index87.mjs +2 -2
  36. package/dist/index89.mjs +1 -1
  37. package/dist/index91.mjs +4 -4
  38. package/dist/index92.mjs +3 -3
  39. package/dist/index95.mjs +1 -1
  40. package/dist/index96.mjs +3 -3
  41. package/dist/index99.mjs +1 -1
  42. package/dist/test-utils/MockCartProvider.d.ts.map +1 -1
  43. package/package.json +3 -3
  44. package/src/components/Checkout.tsx +9 -1
  45. package/src/contexts/CartContext.tsx +17 -1
  46. package/src/test-utils/MockCartProvider.tsx +8 -0
package/dist/index3.mjs CHANGED
@@ -1,145 +1,150 @@
1
1
  'use client';
2
- import { jsxs as Y, jsx as q } from "react/jsx-runtime";
3
- import { createContext as z, useState as d, useRef as w, useEffect as a, useCallback as r, useContext as B } from "react";
2
+ import { jsxs as z, jsx as B } from "react/jsx-runtime";
3
+ import { createContext as J, useState as w, useRef as C, useEffect as c, useCallback as r, useContext as Q } from "react";
4
4
  import "./index18.mjs";
5
- import { useGetCart as J, useCreateCart as Q, useAddCartItem as V, useUpdateCartItem as W, useRemoveCartItem as X, useApplyDiscount as Z, useRemoveDiscount as $, useUpdateCart as tt, useCheckoutCart as et } from "./index29.mjs";
5
+ import { useGetCart as V, useCreateCart as W, useAddCartItem as X, useUpdateCartItem as Z, useRemoveCartItem as $, useApplyDiscount as b, useRemoveDiscount as tt, useUpdateCart as et, useCheckoutCart as rt } from "./index29.mjs";
6
6
  import "@tanstack/react-query";
7
- import { ShoppingCart as rt } from "./index8.mjs";
8
- const m = "oms_cart_id", D = z(null);
9
- function it({ children: c, brandSlug: f, initialCartId: u, shoppingCartProps: E }) {
10
- const [t, s] = d(u || null), [p, C] = d(!1), [M, g] = d(!1), I = w(!1), h = w(!1), l = w(!1);
11
- a(() => {
7
+ import { ShoppingCart as ot } from "./index8.mjs";
8
+ const u = "oms_cart_id", A = J(null);
9
+ function mt({ children: i, brandSlug: s, initialCartId: m, shoppingCartProps: E }) {
10
+ const [t, a] = w(m || null), [p, I] = w(!1), [M, g] = w(!1), y = C(!1), h = C(!1), l = C(!1);
11
+ c(() => {
12
12
  g(!0);
13
- }, []), a(() => {
14
- if (u || I.current) return;
15
- I.current = !0;
13
+ }, []), c(() => {
14
+ if (m || y.current) return;
15
+ y.current = !0;
16
16
  const n = new URLSearchParams(window.location.search).get("cartId");
17
17
  if (n) {
18
- s(n);
18
+ a(n);
19
19
  return;
20
20
  }
21
- const v = localStorage.getItem(m);
22
- v && s(v);
23
- }, [u]);
24
- const { data: A, isLoading: R, error: i, refetch: o } = J(t || "", {
21
+ const S = localStorage.getItem(u);
22
+ S && a(S);
23
+ }, [m]);
24
+ const { data: R, isLoading: x, error: f, refetch: o } = V(t || "", {
25
25
  enabled: !!t,
26
26
  retry: !1
27
27
  // Don't retry on failure - cart might be invalid/expired
28
- }), y = Q({
28
+ }), d = W({
29
29
  onSuccess: (e) => {
30
30
  if ("error" in e) {
31
31
  console.error("Failed to create cart:", e.error);
32
32
  return;
33
33
  }
34
- s(e.id);
34
+ a(e.id);
35
35
  },
36
36
  onError: (e) => {
37
37
  console.error("Failed to create cart:", e);
38
- }
38
+ },
39
+ retry: 10
39
40
  });
40
- a(() => {
41
+ c(() => {
41
42
  if (h.current) return;
42
43
  h.current = !0;
43
44
  const e = setTimeout(() => {
44
- !t && !u && y.mutate(f);
45
+ !(typeof window < "u" ? localStorage.getItem(u) : null) && !m && d.mutate(s);
45
46
  }, 150);
46
47
  return () => clearTimeout(e);
47
- }, []), a(() => {
48
- i && t && !l.current && (l.current = !0, console.warn("Cart fetch failed, creating new cart:", i), s(null), typeof window < "u" && localStorage.removeItem(m), setTimeout(() => {
49
- y.mutate(f), l.current = !1;
48
+ }, []), c(() => {
49
+ f && t && !l.current && (l.current = !0, console.warn("Cart fetch failed, creating new cart:", f), a(null), typeof window < "u" && localStorage.removeItem(u), setTimeout(() => {
50
+ d.mutate(s), l.current = !1;
50
51
  }, 100));
51
- }, [i, t, f]);
52
- const x = V(t || "", {
52
+ }, [f, t, s]);
53
+ const N = X(t || "", {
53
54
  onSuccess: () => o()
54
- }), P = W(t || "", {
55
+ }), P = Z(t || "", {
55
56
  onSuccess: () => o()
56
- }), N = X(t || "", {
57
+ }), F = $(t || "", {
57
58
  onSuccess: () => o()
58
- }), F = Z(t || "", {
59
- onSuccess: () => o()
60
- }), T = $(t || "", {
59
+ }), T = b(t || "", {
61
60
  onSuccess: () => o()
62
61
  }), U = tt(t || "", {
63
62
  onSuccess: () => o()
64
- }), _ = et(t || "");
65
- a(() => {
66
- t && typeof window < "u" && localStorage.setItem(m, t);
63
+ }), _ = et(t || "", {
64
+ onSuccess: () => o(),
65
+ retry: 3
66
+ }), k = rt(t || "");
67
+ c(() => {
68
+ t && typeof window < "u" && localStorage.setItem(u, t);
67
69
  }, [t]);
68
- const k = r(
70
+ const L = r(
69
71
  async (e, n) => {
70
72
  if (!t) throw new Error("No cart ID");
71
- await x.mutateAsync({ sku: e, quantity: n });
73
+ await N.mutateAsync({ sku: e, quantity: n });
72
74
  },
73
75
  // eslint-disable-next-line react-hooks/exhaustive-deps
74
76
  [t]
75
- ), L = r(
77
+ ), j = r(
76
78
  async (e, n) => {
77
79
  if (!t) throw new Error("No cart ID");
78
80
  await P.mutateAsync({ itemId: e, quantity: n });
79
81
  },
80
82
  // eslint-disable-next-line react-hooks/exhaustive-deps
81
83
  [t]
82
- ), j = r(
84
+ ), O = r(
83
85
  async (e) => {
84
86
  if (!t) throw new Error("No cart ID");
85
- await N.mutateAsync(e);
87
+ await F.mutateAsync(e);
86
88
  },
87
89
  // eslint-disable-next-line react-hooks/exhaustive-deps
88
90
  [t]
89
- ), O = r(
91
+ ), G = r(
90
92
  async (e) => {
91
93
  if (!t) throw new Error("No cart ID");
92
- await F.mutateAsync({ code: e });
94
+ await T.mutateAsync({ code: e });
93
95
  },
94
96
  // eslint-disable-next-line react-hooks/exhaustive-deps
95
97
  [t]
96
- ), b = r(async () => {
98
+ ), H = r(async () => {
97
99
  if (!t) throw new Error("No cart ID");
98
- await T.mutateAsync();
99
- }, [t]), G = r(() => {
100
- s(null), typeof window < "u" && localStorage.removeItem(m);
101
- }, []), H = r(() => {
102
- C(!0);
103
- }, []), S = r(() => {
104
- C(!1);
105
- }, []), K = {
106
- cart: A || null,
100
+ await U.mutateAsync();
101
+ }, [t]), v = r(() => {
102
+ a(null), typeof window < "u" && localStorage.removeItem(u);
103
+ }, []), K = r(() => {
104
+ v(), d.mutate(s);
105
+ }, [s]), Y = r(() => {
106
+ I(!0);
107
+ }, []), D = r(() => {
108
+ I(!1);
109
+ }, []), q = {
110
+ cart: R || null,
107
111
  cartId: t,
108
- isLoading: R,
109
- error: i,
110
- updateCartMutation: U,
111
- checkoutMutation: _,
112
- addItem: k,
113
- updateItem: L,
114
- removeItem: j,
115
- applyDiscount: O,
116
- removeDiscount: b,
117
- clearCart: G,
112
+ isLoading: x,
113
+ error: f,
114
+ updateCartMutation: _,
115
+ checkoutMutation: k,
116
+ addItem: L,
117
+ updateItem: j,
118
+ removeItem: O,
119
+ applyDiscount: G,
120
+ removeDiscount: H,
121
+ clearCart: v,
122
+ clearAndCreateNewCart: K,
118
123
  refetch: o,
119
124
  isOpen: p,
120
- open: H,
121
- close: S
125
+ open: Y,
126
+ close: D
122
127
  };
123
- return /* @__PURE__ */ Y(D.Provider, { value: K, children: [
124
- c,
125
- M && /* @__PURE__ */ q(
126
- rt,
128
+ return /* @__PURE__ */ z(A.Provider, { value: q, children: [
129
+ i,
130
+ M && /* @__PURE__ */ B(
131
+ ot,
127
132
  {
128
133
  isOpen: p,
129
- onClose: S,
134
+ onClose: D,
130
135
  ...E
131
136
  }
132
137
  )
133
138
  ] });
134
139
  }
135
- function mt() {
136
- const c = B(D);
137
- if (!c)
140
+ function ft() {
141
+ const i = Q(A);
142
+ if (!i)
138
143
  throw new Error("useCart must be used within CartProvider");
139
- return c;
144
+ return i;
140
145
  }
141
146
  export {
142
- D as CartContext,
143
- it as CartProvider,
144
- mt as useCart
147
+ A as CartContext,
148
+ mt as CartProvider,
149
+ ft as useCart
145
150
  };
package/dist/index42.mjs CHANGED
@@ -1,21 +1,21 @@
1
1
  'use client';
2
- import a from "./index64.mjs";
3
- import p from "./index65.mjs";
4
- import m from "./index66.mjs";
5
- import i from "./index67.mjs";
6
- import f from "./index68.mjs";
7
- import l from "./index69.mjs";
8
- import c from "./index70.mjs";
9
- import d from "./index71.mjs";
10
- import u from "./index72.mjs";
11
- import { VERSION as x } from "./index73.mjs";
12
- import C from "./index74.mjs";
13
- import A from "./index75.mjs";
14
- import E from "./index76.mjs";
15
- import O from "./index77.mjs";
16
- import S from "./index78.mjs";
17
- import H from "./index79.mjs";
18
- import T from "./index80.mjs";
2
+ import a from "./index62.mjs";
3
+ import p from "./index63.mjs";
4
+ import m from "./index64.mjs";
5
+ import i from "./index65.mjs";
6
+ import f from "./index66.mjs";
7
+ import l from "./index67.mjs";
8
+ import c from "./index68.mjs";
9
+ import d from "./index69.mjs";
10
+ import u from "./index70.mjs";
11
+ import { VERSION as x } from "./index71.mjs";
12
+ import C from "./index72.mjs";
13
+ import A from "./index73.mjs";
14
+ import E from "./index74.mjs";
15
+ import O from "./index75.mjs";
16
+ import S from "./index76.mjs";
17
+ import H from "./index77.mjs";
18
+ import T from "./index78.mjs";
19
19
  function n(o) {
20
20
  const t = new m(o), e = p(m.prototype.request, t);
21
21
  return a.extend(e, m.prototype, t, { allOwnKeys: !0 }), a.extend(e, t, null, { allOwnKeys: !0 }), e.create = function(s) {
package/dist/index43.mjs CHANGED
@@ -2,8 +2,8 @@
2
2
  var p = Object.defineProperty;
3
3
  var k = (r, e, i) => e in r ? p(r, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[e] = i;
4
4
  var h = (r, e, i) => k(r, typeof e != "symbol" ? e + "" : e, i);
5
- import { serialize as j } from "./index62.mjs";
6
- import { mergePath as U, replaceUrlParam as P, buildSearchParams as S, removeIndexString as w, replaceUrlProtocol as x, deepMerge as C } from "./index63.mjs";
5
+ import { serialize as j } from "./index79.mjs";
6
+ import { mergePath as U, replaceUrlParam as P, buildSearchParams as S, removeIndexString as w, replaceUrlProtocol as x, deepMerge as C } from "./index80.mjs";
7
7
  var v = (r, e) => new Proxy(() => {
8
8
  }, {
9
9
  get(t, s) {
package/dist/index62.mjs CHANGED
@@ -1,37 +1,238 @@
1
1
  'use client';
2
- var a = (i, t, e = {}) => {
3
- let r = `${i}=${t}`;
4
- if (i.startsWith("__Secure-") && !e.secure)
5
- throw new Error("__Secure- Cookie must have Secure attributes");
6
- if (i.startsWith("__Host-")) {
7
- if (!e.secure)
8
- throw new Error("__Host- Cookie must have Secure attributes");
9
- if (e.path !== "/")
10
- throw new Error('__Host- Cookie must have Path attributes with "/"');
11
- if (e.domain)
12
- throw new Error("__Host- Cookie must not have Domain attributes");
2
+ import R from "./index63.mjs";
3
+ const { toString: T } = Object.prototype, { getPrototypeOf: A } = Object, { iterator: g, toStringTag: S } = Symbol, F = /* @__PURE__ */ ((e) => (t) => {
4
+ const n = T.call(t);
5
+ return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
6
+ })(/* @__PURE__ */ Object.create(null)), f = (e) => (e = e.toLowerCase(), (t) => F(t) === e), O = (e) => (t) => typeof t === e, { isArray: p } = Array, a = O("undefined");
7
+ function d(e) {
8
+ return e !== null && !a(e) && e.constructor !== null && !a(e.constructor) && c(e.constructor.isBuffer) && e.constructor.isBuffer(e);
9
+ }
10
+ const B = f("ArrayBuffer");
11
+ function M(e) {
12
+ let t;
13
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && B(e.buffer), t;
14
+ }
15
+ const k = O("string"), c = O("function"), E = O("number"), y = (e) => e !== null && typeof e == "object", N = (e) => e === !0 || e === !1, w = (e) => {
16
+ if (F(e) !== "object")
17
+ return !1;
18
+ const t = A(e);
19
+ return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(S in e) && !(g in e);
20
+ }, U = (e) => {
21
+ if (!y(e) || d(e))
22
+ return !1;
23
+ try {
24
+ return Object.keys(e).length === 0 && Object.getPrototypeOf(e) === Object.prototype;
25
+ } catch {
26
+ return !1;
13
27
  }
14
- if (e && typeof e.maxAge == "number" && e.maxAge >= 0) {
15
- if (e.maxAge > 3456e4)
16
- throw new Error(
17
- "Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration."
18
- );
19
- r += `; Max-Age=${e.maxAge | 0}`;
28
+ }, I = f("Date"), V = f("File"), _ = f("Blob"), q = f("FileList"), H = (e) => y(e) && c(e.pipe), z = (e) => {
29
+ let t;
30
+ return e && (typeof FormData == "function" && e instanceof FormData || c(e.append) && ((t = F(e)) === "formdata" || // detect form-data instance
31
+ t === "object" && c(e.toString) && e.toString() === "[object FormData]"));
32
+ }, J = f("URLSearchParams"), [K, $, W, G] = ["ReadableStream", "Request", "Response", "Headers"].map(f), Q = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
33
+ function m(e, t, { allOwnKeys: n = !1 } = {}) {
34
+ if (e === null || typeof e > "u")
35
+ return;
36
+ let r, s;
37
+ if (typeof e != "object" && (e = [e]), p(e))
38
+ for (r = 0, s = e.length; r < s; r++)
39
+ t.call(null, e[r], r, e);
40
+ else {
41
+ if (d(e))
42
+ return;
43
+ const o = n ? Object.getOwnPropertyNames(e) : Object.keys(e), i = o.length;
44
+ let l;
45
+ for (r = 0; r < i; r++)
46
+ l = o[r], t.call(null, e[l], l, e);
20
47
  }
21
- if (e.domain && e.prefix !== "host" && (r += `; Domain=${e.domain}`), e.path && (r += `; Path=${e.path}`), e.expires) {
22
- if (e.expires.getTime() - Date.now() > 3456e7)
23
- throw new Error(
24
- "Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future."
25
- );
26
- r += `; Expires=${e.expires.toUTCString()}`;
27
- }
28
- if (e.httpOnly && (r += "; HttpOnly"), e.secure && (r += "; Secure"), e.sameSite && (r += `; SameSite=${e.sameSite.charAt(0).toUpperCase() + e.sameSite.slice(1)}`), e.priority && (r += `; Priority=${e.priority.charAt(0).toUpperCase() + e.priority.slice(1)}`), e.partitioned) {
29
- if (!e.secure)
30
- throw new Error("Partitioned Cookie must have Secure attributes");
31
- r += "; Partitioned";
48
+ }
49
+ function P(e, t) {
50
+ if (d(e))
51
+ return null;
52
+ t = t.toLowerCase();
53
+ const n = Object.keys(e);
54
+ let r = n.length, s;
55
+ for (; r-- > 0; )
56
+ if (s = n[r], t === s.toLowerCase())
57
+ return s;
58
+ return null;
59
+ }
60
+ const u = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, L = (e) => !a(e) && e !== u;
61
+ function h() {
62
+ const { caseless: e, skipUndefined: t } = L(this) && this || {}, n = {}, r = (s, o) => {
63
+ const i = e && P(n, o) || o;
64
+ w(n[i]) && w(s) ? n[i] = h(n[i], s) : w(s) ? n[i] = h({}, s) : p(s) ? n[i] = s.slice() : (!t || !a(s)) && (n[i] = s);
65
+ };
66
+ for (let s = 0, o = arguments.length; s < o; s++)
67
+ arguments[s] && m(arguments[s], r);
68
+ return n;
69
+ }
70
+ const X = (e, t, n, { allOwnKeys: r } = {}) => (m(t, (s, o) => {
71
+ n && c(s) ? e[o] = R(s, n) : e[o] = s;
72
+ }, { allOwnKeys: r }), e), Y = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), Z = (e, t, n, r) => {
73
+ e.prototype = Object.create(t.prototype, r), e.prototype.constructor = e, Object.defineProperty(e, "super", {
74
+ value: t.prototype
75
+ }), n && Object.assign(e.prototype, n);
76
+ }, j = (e, t, n, r) => {
77
+ let s, o, i;
78
+ const l = {};
79
+ if (t = t || {}, e == null) return t;
80
+ do {
81
+ for (s = Object.getOwnPropertyNames(e), o = s.length; o-- > 0; )
82
+ i = s[o], (!r || r(i, e, t)) && !l[i] && (t[i] = e[i], l[i] = !0);
83
+ e = n !== !1 && A(e);
84
+ } while (e && (!n || n(e, t)) && e !== Object.prototype);
85
+ return t;
86
+ }, v = (e, t, n) => {
87
+ e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
88
+ const r = e.indexOf(t, n);
89
+ return r !== -1 && r === n;
90
+ }, ee = (e) => {
91
+ if (!e) return null;
92
+ if (p(e)) return e;
93
+ let t = e.length;
94
+ if (!E(t)) return null;
95
+ const n = new Array(t);
96
+ for (; t-- > 0; )
97
+ n[t] = e[t];
98
+ return n;
99
+ }, te = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && A(Uint8Array)), ne = (e, t) => {
100
+ const r = (e && e[g]).call(e);
101
+ let s;
102
+ for (; (s = r.next()) && !s.done; ) {
103
+ const o = s.value;
104
+ t.call(e, o[0], o[1]);
32
105
  }
106
+ }, re = (e, t) => {
107
+ let n;
108
+ const r = [];
109
+ for (; (n = e.exec(t)) !== null; )
110
+ r.push(n);
33
111
  return r;
34
- }, s = (i, t, e) => (t = encodeURIComponent(t), a(i, t, e));
112
+ }, se = f("HTMLFormElement"), oe = (e) => e.toLowerCase().replace(
113
+ /[-_\s]([a-z\d])(\w*)/g,
114
+ function(n, r, s) {
115
+ return r.toUpperCase() + s;
116
+ }
117
+ ), x = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), ie = f("RegExp"), C = (e, t) => {
118
+ const n = Object.getOwnPropertyDescriptors(e), r = {};
119
+ m(n, (s, o) => {
120
+ let i;
121
+ (i = t(s, o, e)) !== !1 && (r[o] = i || s);
122
+ }), Object.defineProperties(e, r);
123
+ }, ce = (e) => {
124
+ C(e, (t, n) => {
125
+ if (c(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
126
+ return !1;
127
+ const r = e[n];
128
+ if (c(r)) {
129
+ if (t.enumerable = !1, "writable" in t) {
130
+ t.writable = !1;
131
+ return;
132
+ }
133
+ t.set || (t.set = () => {
134
+ throw Error("Can not rewrite read-only method '" + n + "'");
135
+ });
136
+ }
137
+ });
138
+ }, fe = (e, t) => {
139
+ const n = {}, r = (s) => {
140
+ s.forEach((o) => {
141
+ n[o] = !0;
142
+ });
143
+ };
144
+ return p(e) ? r(e) : r(String(e).split(t)), n;
145
+ }, le = () => {
146
+ }, ue = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
147
+ function ae(e) {
148
+ return !!(e && c(e.append) && e[S] === "FormData" && e[g]);
149
+ }
150
+ const pe = (e) => {
151
+ const t = new Array(10), n = (r, s) => {
152
+ if (y(r)) {
153
+ if (t.indexOf(r) >= 0)
154
+ return;
155
+ if (d(r))
156
+ return r;
157
+ if (!("toJSON" in r)) {
158
+ t[s] = r;
159
+ const o = p(r) ? [] : {};
160
+ return m(r, (i, l) => {
161
+ const b = n(i, s + 1);
162
+ !a(b) && (o[l] = b);
163
+ }), t[s] = void 0, o;
164
+ }
165
+ }
166
+ return r;
167
+ };
168
+ return n(e, 0);
169
+ }, de = f("AsyncFunction"), ye = (e) => e && (y(e) || c(e)) && c(e.then) && c(e.catch), D = ((e, t) => e ? setImmediate : t ? ((n, r) => (u.addEventListener("message", ({ source: s, data: o }) => {
170
+ s === u && o === n && r.length && r.shift()();
171
+ }, !1), (s) => {
172
+ r.push(s), u.postMessage(n, "*");
173
+ }))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
174
+ typeof setImmediate == "function",
175
+ c(u.postMessage)
176
+ ), me = typeof queueMicrotask < "u" ? queueMicrotask.bind(u) : typeof process < "u" && process.nextTick || D, we = (e) => e != null && c(e[g]), Fe = {
177
+ isArray: p,
178
+ isArrayBuffer: B,
179
+ isBuffer: d,
180
+ isFormData: z,
181
+ isArrayBufferView: M,
182
+ isString: k,
183
+ isNumber: E,
184
+ isBoolean: N,
185
+ isObject: y,
186
+ isPlainObject: w,
187
+ isEmptyObject: U,
188
+ isReadableStream: K,
189
+ isRequest: $,
190
+ isResponse: W,
191
+ isHeaders: G,
192
+ isUndefined: a,
193
+ isDate: I,
194
+ isFile: V,
195
+ isBlob: _,
196
+ isRegExp: ie,
197
+ isFunction: c,
198
+ isStream: H,
199
+ isURLSearchParams: J,
200
+ isTypedArray: te,
201
+ isFileList: q,
202
+ forEach: m,
203
+ merge: h,
204
+ extend: X,
205
+ trim: Q,
206
+ stripBOM: Y,
207
+ inherits: Z,
208
+ toFlatObject: j,
209
+ kindOf: F,
210
+ kindOfTest: f,
211
+ endsWith: v,
212
+ toArray: ee,
213
+ forEachEntry: ne,
214
+ matchAll: re,
215
+ isHTMLForm: se,
216
+ hasOwnProperty: x,
217
+ hasOwnProp: x,
218
+ // an alias to avoid ESLint no-prototype-builtins detection
219
+ reduceDescriptors: C,
220
+ freezeMethods: ce,
221
+ toObjectSet: fe,
222
+ toCamelCase: oe,
223
+ noop: le,
224
+ toFiniteNumber: ue,
225
+ findKey: P,
226
+ global: u,
227
+ isContextDefined: L,
228
+ isSpecCompliantForm: ae,
229
+ toJSONObject: pe,
230
+ isAsyncFn: de,
231
+ isThenable: ye,
232
+ setImmediate: D,
233
+ asap: me,
234
+ isIterable: we
235
+ };
35
236
  export {
36
- s as serialize
237
+ Fe as default
37
238
  };
package/dist/index63.mjs CHANGED
@@ -1,46 +1,9 @@
1
1
  'use client';
2
- var s = (e, r) => (e = e.replace(/\/+$/, ""), e = e + "/", r = r.replace(/^\/+/, ""), e + r), p = (e, r) => {
3
- for (const [n, t] of Object.entries(r)) {
4
- const c = new RegExp("/:" + n + "(?:{[^/]+})?\\??");
5
- e = e.replace(c, t ? `/${t}` : "");
6
- }
7
- return e;
8
- }, f = (e) => {
9
- const r = new URLSearchParams();
10
- for (const [n, t] of Object.entries(e))
11
- if (t !== void 0)
12
- if (Array.isArray(t))
13
- for (const c of t)
14
- r.append(n, c);
15
- else
16
- r.set(n, t);
17
- return r;
18
- }, i = (e, r) => {
19
- switch (r) {
20
- case "ws":
21
- return e.replace(/^http/, "ws");
22
- case "http":
23
- return e.replace(/^ws/, "http");
24
- }
25
- }, l = (e) => /^https?:\/\/[^\/]+?\/index(?=\?|$)/.test(e) ? e.replace(/\/index(?=\?|$)/, "/") : e.replace(/\/index(?=\?|$)/, "");
26
- function a(e) {
27
- return typeof e == "object" && e !== null && !Array.isArray(e);
28
- }
29
- function o(e, r) {
30
- if (!a(e) && !a(r))
31
- return r;
32
- const n = { ...e };
33
- for (const t in r) {
34
- const c = r[t];
35
- a(n[t]) && a(c) ? n[t] = o(n[t], c) : n[t] = c;
36
- }
37
- return n;
2
+ function u(n, r) {
3
+ return function() {
4
+ return n.apply(r, arguments);
5
+ };
38
6
  }
39
7
  export {
40
- f as buildSearchParams,
41
- o as deepMerge,
42
- s as mergePath,
43
- l as removeIndexString,
44
- p as replaceUrlParam,
45
- i as replaceUrlProtocol
8
+ u as default
46
9
  };