@instockng/storefront-ui 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contexts/CartContext.d.ts.map +1 -1
- package/dist/index105.mjs +1 -1
- package/dist/index20.mjs +2 -2
- package/dist/index21.mjs +1 -1
- package/dist/index28.mjs +11 -11
- package/dist/index3.mjs +65 -67
- package/dist/index37.mjs +1 -1
- package/dist/index41.mjs +23 -36
- package/dist/index42.mjs +36 -44
- package/dist/index43.mjs +44 -99
- package/dist/index44.mjs +99 -112
- package/dist/index45.mjs +80 -44
- package/dist/index46.mjs +53 -64
- package/dist/index47.mjs +48 -65
- package/dist/index48.mjs +73 -54
- package/dist/index49.mjs +63 -52
- package/dist/index50.mjs +70 -14
- package/dist/index51.mjs +14 -13
- package/dist/index52.mjs +13 -58
- package/dist/index53.mjs +34 -101
- package/dist/index54.mjs +95 -99
- package/dist/index55.mjs +132 -22
- package/dist/index81.mjs +1 -1
- package/dist/index83.mjs +1 -1
- package/dist/index84.mjs +2 -2
- package/dist/index88.mjs +2 -2
- package/dist/index93.mjs +12 -30
- package/dist/index94.mjs +7 -11
- package/dist/index95.mjs +30 -3
- package/dist/index96.mjs +10 -3
- package/dist/index97.mjs +4 -13
- package/dist/index98.mjs +4 -7
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartContext.d.ts","sourceRoot":"","sources":["../../src/contexts/CartContext.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,EAAkD,SAAS,EAAuB,MAAM,OAAO,CAAC;AACvG,OAAO,EAGL,aAAa,EAMb,eAAe,EACf,KAAK,IAAI,EACV,MAAM,iBAAiB,CAAC;AAKzB,UAAU,gBAAgB;IACxB,wBAAwB;IACxB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,mDAAmD;IACnD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,oBAAo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,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,6CAA6C;IAC7C,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,wBAAwB;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,qCAAqC;IACrC,MAAM,EAAE,OAAO,CAAC;IAChB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,2BAA2B;IAC3B,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,eAAO,MAAM,WAAW,kDAA+C,CAAC;AAExE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,IAAI,CAAC,OAAO,4BAA4B,EAAE,iBAAiB,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAC;CACxG;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,EAAE,iBAAiB,2CA0LxG;AAED;;GAEG;AACH,wBAAgB,OAAO,qBAMtB"}
|
package/dist/index105.mjs
CHANGED
package/dist/index20.mjs
CHANGED
package/dist/index21.mjs
CHANGED
package/dist/index28.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useCreateOrder as s, useDeleteOrder as r, useGetOrder as u, useListOrders as o, useUpdateOrder as a, useUpdateOrderStatus as n } from "./
|
|
3
|
-
import { useCreateBrand as i, useDeleteBrand as p, useGetBrand as C, useListBrands as D, useUpdateBrand as c } from "./
|
|
4
|
-
import { useCreateProduct as G, useDeleteProduct as f, useGetProduct as m, useListProducts as v, useUpdateProduct as x } from "./
|
|
5
|
-
import { useCreateVariant as L, useDeleteVariant as S, useGetVariantInventory as U, useListProductVariants as O, useSearchVariants as V, useUpdateVariant as h } from "./
|
|
6
|
-
import { useCreateWarehouse as I, useDeleteWarehouse as P, useGetWarehouseInventory as A, useListWarehouses as W, useUpdateWarehouse as Z } from "./
|
|
7
|
-
import { useAdjustInventory as k, useGetInventoryTransactions as w, useGetLowStockVariants as T, useListInventory as j, useTransferInventory as E } from "./
|
|
8
|
-
import { useGetCustomerHistory as g } from "./
|
|
9
|
-
import { useGetStats as z } from "./
|
|
10
|
-
import { useCleanupExpiredCarts as J, useGetAbandonedCart as K, useGetAbandonedCartStats as M, useListAbandonedCarts as N } from "./
|
|
11
|
-
import { useBulkGenerateDiscountCodes as R, useCreateDiscountCode as X, useDeleteDiscountCode as Y, useGetDiscountCode as _, useGetDiscountCodeAnalytics as $, useGetDiscountCodeOverviewStats as ee, useListDiscountCodes as te, useUpdateDiscountCode as se } from "./
|
|
12
|
-
import { useCreateDeliveryZone as ue, useCreateState as oe, useDeleteDeliveryZone as ae, useDeleteState as ne, useListDeliveryZones as de, useListStates as ie, useUpdateDeliveryZone as pe, useUpdateState as Ce } from "./
|
|
2
|
+
import { useCreateOrder as s, useDeleteOrder as r, useGetOrder as u, useListOrders as o, useUpdateOrder as a, useUpdateOrderStatus as n } from "./index45.mjs";
|
|
3
|
+
import { useCreateBrand as i, useDeleteBrand as p, useGetBrand as C, useListBrands as D, useUpdateBrand as c } from "./index46.mjs";
|
|
4
|
+
import { useCreateProduct as G, useDeleteProduct as f, useGetProduct as m, useListProducts as v, useUpdateProduct as x } from "./index47.mjs";
|
|
5
|
+
import { useCreateVariant as L, useDeleteVariant as S, useGetVariantInventory as U, useListProductVariants as O, useSearchVariants as V, useUpdateVariant as h } from "./index48.mjs";
|
|
6
|
+
import { useCreateWarehouse as I, useDeleteWarehouse as P, useGetWarehouseInventory as A, useListWarehouses as W, useUpdateWarehouse as Z } from "./index49.mjs";
|
|
7
|
+
import { useAdjustInventory as k, useGetInventoryTransactions as w, useGetLowStockVariants as T, useListInventory as j, useTransferInventory as E } from "./index50.mjs";
|
|
8
|
+
import { useGetCustomerHistory as g } from "./index51.mjs";
|
|
9
|
+
import { useGetStats as z } from "./index52.mjs";
|
|
10
|
+
import { useCleanupExpiredCarts as J, useGetAbandonedCart as K, useGetAbandonedCartStats as M, useListAbandonedCarts as N } from "./index53.mjs";
|
|
11
|
+
import { useBulkGenerateDiscountCodes as R, useCreateDiscountCode as X, useDeleteDiscountCode as Y, useGetDiscountCode as _, useGetDiscountCodeAnalytics as $, useGetDiscountCodeOverviewStats as ee, useListDiscountCodes as te, useUpdateDiscountCode as se } from "./index54.mjs";
|
|
12
|
+
import { useCreateDeliveryZone as ue, useCreateState as oe, useDeleteDeliveryZone as ae, useDeleteState as ne, useListDeliveryZones as de, useListStates as ie, useUpdateDeliveryZone as pe, useUpdateState as Ce } from "./index55.mjs";
|
|
13
13
|
export {
|
|
14
14
|
k as useAdjustInventory,
|
|
15
15
|
R as useBulkGenerateDiscountCodes,
|
package/dist/index3.mjs
CHANGED
|
@@ -1,133 +1,131 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { createContext as
|
|
2
|
+
import { jsxs as L, jsx as O } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as z, useState as p, useRef as G, useEffect as l, useCallback as r, useContext as K } from "react";
|
|
4
4
|
import "./index18.mjs";
|
|
5
|
-
import { useCreateCart as
|
|
5
|
+
import { useCreateCart as T, useGetCart as Y, useAddCartItem as q, useUpdateCartItem as B, useRemoveCartItem as H, useApplyDiscount as J, useRemoveDiscount as Q, useUpdateCart as V, useCheckoutCart as W } from "./index29.mjs";
|
|
6
6
|
import "@tanstack/react-query";
|
|
7
|
-
import { ShoppingCart as
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
const [t,
|
|
11
|
-
if (
|
|
7
|
+
import { ShoppingCart as X } from "./index8.mjs";
|
|
8
|
+
const s = "oms_cart_id", C = z(null);
|
|
9
|
+
function nt({ children: a, brandSlug: I, initialCartId: u, shoppingCartProps: y }) {
|
|
10
|
+
const [t, i] = p(() => {
|
|
11
|
+
if (u) return u;
|
|
12
12
|
if (typeof window < "u") {
|
|
13
13
|
const n = new URLSearchParams(window.location.search).get("cartId");
|
|
14
|
-
return n || localStorage.getItem(
|
|
14
|
+
return n || localStorage.getItem(s);
|
|
15
15
|
}
|
|
16
16
|
return null;
|
|
17
|
-
}), [
|
|
17
|
+
}), [m, f] = p(!1), d = G(!1), h = T({
|
|
18
18
|
onSuccess: (e) => {
|
|
19
|
-
if (
|
|
19
|
+
if ("error" in e) {
|
|
20
20
|
console.error("Failed to create cart:", e.error);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
i(e.id);
|
|
24
24
|
},
|
|
25
25
|
onError: (e) => {
|
|
26
|
-
|
|
26
|
+
console.error("Failed to create cart:", e);
|
|
27
27
|
}
|
|
28
|
-
})
|
|
29
|
-
m(() => {
|
|
30
|
-
!t && !s && !c.current && !u.current && (c.current = !0, v.mutate(d));
|
|
31
|
-
}, [t, s, d]);
|
|
32
|
-
const { data: D, isLoading: A, error: i, refetch: o } = z(t || "", {
|
|
28
|
+
}), { data: S, isLoading: v, error: c, refetch: o } = Y(t || "", {
|
|
33
29
|
enabled: !!t,
|
|
34
30
|
retry: !1
|
|
35
31
|
// Don't retry on failure - cart might be invalid/expired
|
|
36
32
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
|
|
33
|
+
l(() => {
|
|
34
|
+
!d.current && !t && !u && (d.current = !0, h.mutate(I));
|
|
35
|
+
}, []), l(() => {
|
|
36
|
+
c && t && (console.warn("Cart fetch failed, clearing invalid cart:", c), i(null), typeof window < "u" && localStorage.removeItem(s));
|
|
37
|
+
}, [c, t]);
|
|
38
|
+
const D = q(t || "", {
|
|
41
39
|
onSuccess: () => o()
|
|
42
|
-
}), g =
|
|
40
|
+
}), g = B(t || "", {
|
|
43
41
|
onSuccess: () => o()
|
|
44
|
-
}),
|
|
42
|
+
}), E = H(t || "", {
|
|
45
43
|
onSuccess: () => o()
|
|
46
|
-
}),
|
|
44
|
+
}), A = J(t || "", {
|
|
47
45
|
onSuccess: () => o()
|
|
48
|
-
}),
|
|
46
|
+
}), M = Q(t || "", {
|
|
49
47
|
onSuccess: () => o()
|
|
50
|
-
}),
|
|
48
|
+
}), x = V(t || "", {
|
|
51
49
|
onSuccess: () => o()
|
|
52
|
-
}),
|
|
53
|
-
|
|
54
|
-
t && typeof window < "u" && localStorage.setItem(
|
|
50
|
+
}), P = W(t || "");
|
|
51
|
+
l(() => {
|
|
52
|
+
t && typeof window < "u" && localStorage.setItem(s, t);
|
|
55
53
|
}, [t]);
|
|
56
|
-
const
|
|
54
|
+
const R = r(
|
|
57
55
|
async (e, n) => {
|
|
58
56
|
if (!t) throw new Error("No cart ID");
|
|
59
|
-
await
|
|
57
|
+
await D.mutateAsync({ sku: e, quantity: n });
|
|
60
58
|
},
|
|
61
59
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62
60
|
[t]
|
|
63
|
-
),
|
|
61
|
+
), N = r(
|
|
64
62
|
async (e, n) => {
|
|
65
63
|
if (!t) throw new Error("No cart ID");
|
|
66
64
|
await g.mutateAsync({ itemId: e, quantity: n });
|
|
67
65
|
},
|
|
68
66
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
69
67
|
[t]
|
|
70
|
-
),
|
|
68
|
+
), U = r(
|
|
71
69
|
async (e) => {
|
|
72
70
|
if (!t) throw new Error("No cart ID");
|
|
73
|
-
await
|
|
71
|
+
await E.mutateAsync(e);
|
|
74
72
|
},
|
|
75
73
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
76
74
|
[t]
|
|
77
|
-
),
|
|
75
|
+
), _ = r(
|
|
78
76
|
async (e) => {
|
|
79
77
|
if (!t) throw new Error("No cart ID");
|
|
80
|
-
await
|
|
78
|
+
await A.mutateAsync({ code: e });
|
|
81
79
|
},
|
|
82
80
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
83
81
|
[t]
|
|
84
82
|
), b = r(async () => {
|
|
85
83
|
if (!t) throw new Error("No cart ID");
|
|
86
|
-
await
|
|
87
|
-
}, [t]),
|
|
88
|
-
|
|
89
|
-
}, []),
|
|
90
|
-
|
|
91
|
-
}, []),
|
|
92
|
-
|
|
93
|
-
}, []),
|
|
94
|
-
cart:
|
|
84
|
+
await M.mutateAsync();
|
|
85
|
+
}, [t]), k = r(() => {
|
|
86
|
+
i(null), typeof window < "u" && localStorage.removeItem(s);
|
|
87
|
+
}, []), F = r(() => {
|
|
88
|
+
f(!0);
|
|
89
|
+
}, []), w = r(() => {
|
|
90
|
+
f(!1);
|
|
91
|
+
}, []), j = {
|
|
92
|
+
cart: S || null,
|
|
95
93
|
cartId: t,
|
|
96
|
-
isLoading:
|
|
97
|
-
error:
|
|
98
|
-
updateCartMutation:
|
|
99
|
-
checkoutMutation:
|
|
100
|
-
addItem:
|
|
101
|
-
updateItem:
|
|
102
|
-
removeItem:
|
|
103
|
-
applyDiscount:
|
|
94
|
+
isLoading: v,
|
|
95
|
+
error: c,
|
|
96
|
+
updateCartMutation: x,
|
|
97
|
+
checkoutMutation: P,
|
|
98
|
+
addItem: R,
|
|
99
|
+
updateItem: N,
|
|
100
|
+
removeItem: U,
|
|
101
|
+
applyDiscount: _,
|
|
104
102
|
removeDiscount: b,
|
|
105
|
-
clearCart:
|
|
103
|
+
clearCart: k,
|
|
106
104
|
refetch: o,
|
|
107
|
-
isOpen:
|
|
108
|
-
open:
|
|
109
|
-
close:
|
|
105
|
+
isOpen: m,
|
|
106
|
+
open: F,
|
|
107
|
+
close: w
|
|
110
108
|
};
|
|
111
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ L(C.Provider, { value: j, children: [
|
|
112
110
|
a,
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
111
|
+
/* @__PURE__ */ O(
|
|
112
|
+
X,
|
|
115
113
|
{
|
|
116
|
-
isOpen:
|
|
117
|
-
onClose:
|
|
118
|
-
...
|
|
114
|
+
isOpen: m,
|
|
115
|
+
onClose: w,
|
|
116
|
+
...y
|
|
119
117
|
}
|
|
120
118
|
)
|
|
121
119
|
] });
|
|
122
120
|
}
|
|
123
121
|
function at() {
|
|
124
|
-
const a =
|
|
122
|
+
const a = K(C);
|
|
125
123
|
if (!a)
|
|
126
124
|
throw new Error("useCart must be used within CartProvider");
|
|
127
125
|
return a;
|
|
128
126
|
}
|
|
129
127
|
export {
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
C as CartContext,
|
|
129
|
+
nt as CartProvider,
|
|
132
130
|
at as useCart
|
|
133
131
|
};
|
package/dist/index37.mjs
CHANGED
package/dist/index41.mjs
CHANGED
|
@@ -1,39 +1,26 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
2
|
+
import "react";
|
|
3
|
+
function i(n, o) {
|
|
4
|
+
if (typeof n == "function")
|
|
5
|
+
return n(o);
|
|
6
|
+
n != null && (n.current = o);
|
|
7
|
+
}
|
|
8
|
+
function f(...n) {
|
|
9
|
+
return (o) => {
|
|
10
|
+
let u = !1;
|
|
11
|
+
const c = n.map((t) => {
|
|
12
|
+
const e = i(t, o);
|
|
13
|
+
return !u && typeof e == "function" && (u = !0), e;
|
|
14
|
+
});
|
|
15
|
+
if (u)
|
|
16
|
+
return () => {
|
|
17
|
+
for (let t = 0; t < c.length; t++) {
|
|
18
|
+
const e = c[t];
|
|
19
|
+
typeof e == "function" ? e() : i(n[t], null);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
21
24
|
export {
|
|
22
|
-
|
|
23
|
-
a as AxiosError,
|
|
24
|
-
m as AxiosHeaders,
|
|
25
|
-
d as Cancel,
|
|
26
|
-
i as CancelToken,
|
|
27
|
-
s as CanceledError,
|
|
28
|
-
p as HttpStatusCode,
|
|
29
|
-
l as VERSION,
|
|
30
|
-
n as all,
|
|
31
|
-
o as default,
|
|
32
|
-
A as formToJSON,
|
|
33
|
-
f as getAdapter,
|
|
34
|
-
x as isAxiosError,
|
|
35
|
-
t as isCancel,
|
|
36
|
-
E as mergeConfig,
|
|
37
|
-
C as spread,
|
|
38
|
-
c as toFormData
|
|
25
|
+
f as composeRefs
|
|
39
26
|
};
|
package/dist/index42.mjs
CHANGED
|
@@ -1,47 +1,39 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return a.extend(e, m.prototype, t, { allOwnKeys: !0 }), a.extend(e, t, null, { allOwnKeys: !0 }), e.create = function(s) {
|
|
22
|
-
return n(i(o, s));
|
|
23
|
-
}, e;
|
|
24
|
-
}
|
|
25
|
-
const r = n(f);
|
|
26
|
-
r.Axios = m;
|
|
27
|
-
r.CanceledError = c;
|
|
28
|
-
r.CancelToken = d;
|
|
29
|
-
r.isCancel = u;
|
|
30
|
-
r.VERSION = x;
|
|
31
|
-
r.toFormData = C;
|
|
32
|
-
r.AxiosError = A;
|
|
33
|
-
r.Cancel = r.CanceledError;
|
|
34
|
-
r.all = function(t) {
|
|
35
|
-
return Promise.all(t);
|
|
36
|
-
};
|
|
37
|
-
r.spread = E;
|
|
38
|
-
r.isAxiosError = O;
|
|
39
|
-
r.mergeConfig = i;
|
|
40
|
-
r.AxiosHeaders = S;
|
|
41
|
-
r.formToJSON = (o) => l(a.isHTMLForm(o) ? new FormData(o) : o);
|
|
42
|
-
r.getAdapter = H.getAdapter;
|
|
43
|
-
r.HttpStatusCode = T;
|
|
44
|
-
r.default = r;
|
|
2
|
+
import o from "./index43.mjs";
|
|
3
|
+
const {
|
|
4
|
+
Axios: e,
|
|
5
|
+
AxiosError: a,
|
|
6
|
+
CanceledError: s,
|
|
7
|
+
isCancel: t,
|
|
8
|
+
CancelToken: i,
|
|
9
|
+
VERSION: l,
|
|
10
|
+
all: n,
|
|
11
|
+
Cancel: d,
|
|
12
|
+
isAxiosError: x,
|
|
13
|
+
spread: C,
|
|
14
|
+
toFormData: c,
|
|
15
|
+
AxiosHeaders: m,
|
|
16
|
+
HttpStatusCode: p,
|
|
17
|
+
formToJSON: A,
|
|
18
|
+
getAdapter: f,
|
|
19
|
+
mergeConfig: E
|
|
20
|
+
} = o;
|
|
45
21
|
export {
|
|
46
|
-
|
|
22
|
+
e as Axios,
|
|
23
|
+
a as AxiosError,
|
|
24
|
+
m as AxiosHeaders,
|
|
25
|
+
d as Cancel,
|
|
26
|
+
i as CancelToken,
|
|
27
|
+
s as CanceledError,
|
|
28
|
+
p as HttpStatusCode,
|
|
29
|
+
l as VERSION,
|
|
30
|
+
n as all,
|
|
31
|
+
o as default,
|
|
32
|
+
A as formToJSON,
|
|
33
|
+
f as getAdapter,
|
|
34
|
+
x as isAxiosError,
|
|
35
|
+
t as isCancel,
|
|
36
|
+
E as mergeConfig,
|
|
37
|
+
C as spread,
|
|
38
|
+
c as toFormData
|
|
47
39
|
};
|
package/dist/index43.mjs
CHANGED
|
@@ -1,102 +1,47 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
if (r != null && r.cookie) {
|
|
47
|
-
const o = [];
|
|
48
|
-
for (const [c, f] of Object.entries(r.cookie))
|
|
49
|
-
o.push(j(c, f, { path: "/" }));
|
|
50
|
-
t.Cookie = o.join(",");
|
|
51
|
-
}
|
|
52
|
-
this.cType && (t["Content-Type"] = this.cType);
|
|
53
|
-
const s = new Headers(t ?? void 0);
|
|
54
|
-
let a = this.url;
|
|
55
|
-
a = w(a), a = P(a, this.pathParams), this.queryParams && (a = a + "?" + this.queryParams.toString()), i = this.method.toUpperCase();
|
|
56
|
-
const u = !(i === "GET" || i === "HEAD");
|
|
57
|
-
return ((e == null ? void 0 : e.fetch) || fetch)(a, {
|
|
58
|
-
body: u ? this.rBody : void 0,
|
|
59
|
-
method: i,
|
|
60
|
-
headers: s,
|
|
61
|
-
...e == null ? void 0 : e.init
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
this.url = r, this.method = e;
|
|
65
|
-
}
|
|
66
|
-
}, E = (r, e) => v(function i(t) {
|
|
67
|
-
var l;
|
|
68
|
-
const s = [...t.path], a = s.slice(-3).reverse();
|
|
69
|
-
if (a[0] === "toString")
|
|
70
|
-
return a[1] === "name" ? a[2] || "" : i.toString();
|
|
71
|
-
if (a[0] === "valueOf")
|
|
72
|
-
return a[1] === "name" ? a[2] || "" : i;
|
|
73
|
-
let u = "";
|
|
74
|
-
if (/^\$/.test(a[0])) {
|
|
75
|
-
const n = s.pop();
|
|
76
|
-
n && (u = n.replace(/^\$/, ""));
|
|
77
|
-
}
|
|
78
|
-
const o = s.join("/"), c = U(r, o);
|
|
79
|
-
if (u === "url") {
|
|
80
|
-
let n = c;
|
|
81
|
-
return t.args[0] && (t.args[0].param && (n = P(c, t.args[0].param)), t.args[0].query && (n = n + "?" + S(t.args[0].query).toString())), n = w(n), new URL(n);
|
|
82
|
-
}
|
|
83
|
-
if (u === "ws") {
|
|
84
|
-
const n = x(
|
|
85
|
-
t.args[0] && t.args[0].param ? P(c, t.args[0].param) : c,
|
|
86
|
-
"ws"
|
|
87
|
-
), y = new URL(n), b = (l = t.args[0]) == null ? void 0 : l.query;
|
|
88
|
-
return b && Object.entries(b).forEach(([m, d]) => {
|
|
89
|
-
Array.isArray(d) ? d.forEach((q) => y.searchParams.append(m, q)) : y.searchParams.set(m, d);
|
|
90
|
-
}), ((...m) => (e == null ? void 0 : e.webSocket) !== void 0 && typeof e.webSocket == "function" ? e.webSocket(...m) : new WebSocket(...m))(y.toString());
|
|
91
|
-
}
|
|
92
|
-
const f = new T(c, u);
|
|
93
|
-
if (u) {
|
|
94
|
-
e ?? (e = {});
|
|
95
|
-
const n = C(e, { ...t.args[1] });
|
|
96
|
-
return f.fetch(t.args[0], n);
|
|
97
|
-
}
|
|
98
|
-
return f;
|
|
99
|
-
}, []);
|
|
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
|
+
function n(o) {
|
|
20
|
+
const t = new m(o), e = p(m.prototype.request, t);
|
|
21
|
+
return a.extend(e, m.prototype, t, { allOwnKeys: !0 }), a.extend(e, t, null, { allOwnKeys: !0 }), e.create = function(s) {
|
|
22
|
+
return n(i(o, s));
|
|
23
|
+
}, e;
|
|
24
|
+
}
|
|
25
|
+
const r = n(f);
|
|
26
|
+
r.Axios = m;
|
|
27
|
+
r.CanceledError = c;
|
|
28
|
+
r.CancelToken = d;
|
|
29
|
+
r.isCancel = u;
|
|
30
|
+
r.VERSION = x;
|
|
31
|
+
r.toFormData = C;
|
|
32
|
+
r.AxiosError = A;
|
|
33
|
+
r.Cancel = r.CanceledError;
|
|
34
|
+
r.all = function(t) {
|
|
35
|
+
return Promise.all(t);
|
|
36
|
+
};
|
|
37
|
+
r.spread = E;
|
|
38
|
+
r.isAxiosError = O;
|
|
39
|
+
r.mergeConfig = i;
|
|
40
|
+
r.AxiosHeaders = S;
|
|
41
|
+
r.formToJSON = (o) => l(a.isHTMLForm(o) ? new FormData(o) : o);
|
|
42
|
+
r.getAdapter = H.getAdapter;
|
|
43
|
+
r.HttpStatusCode = T;
|
|
44
|
+
r.default = r;
|
|
100
45
|
export {
|
|
101
|
-
|
|
46
|
+
r as default
|
|
102
47
|
};
|