@obb871001/api-integration-sdk 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -4
- package/dist/index.js +123 -116
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@tanstack/react-query");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@tanstack/react-query");const v=require("react"),re=require("axios"),x=v.createContext(null),te=()=>{const o=v.useContext(x);if(!o)throw new Error("useApiContext must be used within ApiProvider");return o},ne=()=>v.useContext(x)||{recentlyCreatedOwnerStacks:[]};var A={exports:{}},_={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var D;function
|
|
9
|
+
*/var D;function ae(){if(D)return _;D=1;var o=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function f(d,u,c){var m=null;if(c!==void 0&&(m=""+c),u.key!==void 0&&(m=""+u.key),"key"in u){c={};for(var l in u)l!=="key"&&(c[l]=u[l])}else c=u;return u=c.ref,{$$typeof:o,type:d,key:m,ref:u!==void 0?u:null,props:c}}return _.Fragment=i,_.jsx=f,_.jsxs=f,_}var E={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var M;function
|
|
17
|
+
*/var M;function oe(){return M||(M=1,process.env.NODE_ENV!=="production"&&(function(){function o(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case V:return"Profiler";case W:return"StrictMode";case X:return"Suspense";case B:return"SuspenseList";case Z:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case U:return"Portal";case J:return e.displayName||"Context";case z:return(e._context.displayName||"Context")+".Consumer";case G:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return r=e.displayName||null,r!==null?r:o(e.type)||"Memo";case O:r=e._payload,e=e._init;try{return o(e(r))}catch{}}return null}function i(e){return""+e}function f(e){try{i(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),i(e)}}function d(e){if(e===k)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===O)return"<...>";try{var r=o(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function u(){var e=S.A;return e===null?null:e.getOwner()}function c(){return Error("react-stack-top-frame")}function m(e){if(N.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function l(e,r){function t(){Y||(Y=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function s(){var e=o(this.type);return $[e]||($[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function R(e,r,t,n,T,y){var a=t.ref;return e={$$typeof:g,type:e,key:r,props:t,_owner:n},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:s}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:T}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:y}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function w(e,r,t,n,T,y){var a=r.children;if(a!==void 0)if(n)if(K(a)){for(n=0;n<a.length;n++)j(a[n]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else j(a);if(N.call(r,"key")){a=o(e);var p=Object.keys(r).filter(function(ee){return ee!=="key"});n=0<p.length?"{key: someKey, "+p.join(": ..., ")+": ...}":"{key: someKey}",q[a+n]||(p=0<p.length?"{"+p.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,n,a,
|
|
22
|
+
<%s key={someKey} {...props} />`,n,a,p,a),q[a+n]=!0)}if(a=null,t!==void 0&&(f(t),a=""+t),m(r)&&(f(r.key),a=""+r.key),"key"in r){t={};for(var h in r)h!=="key"&&(t[h]=r[h])}else t=r;return a&&l(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),R(e,a,t,u(),T,y)}function j(e){C(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===O&&(e._payload.status==="fulfilled"?C(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function C(e){return typeof e=="object"&&e!==null&&e.$$typeof===g}var b=v,g=Symbol.for("react.transitional.element"),U=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),J=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),Q=Symbol.for("react.client.reference"),S=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,K=Array.isArray,P=console.createTask?console.createTask:function(){return null};b={react_stack_bottom_frame:function(e){return e()}};var Y,$={},I=b.react_stack_bottom_frame.bind(b,c)(),F=P(d(c)),q={};E.Fragment=k,E.jsx=function(e,r,t){var n=1e4>S.recentlyCreatedOwnerStacks++;return w(e,r,t,!1,n?Error("react-stack-top-frame"):I,n?P(d(e)):F)},E.jsxs=function(e,r,t){var n=1e4>S.recentlyCreatedOwnerStacks++;return w(e,r,t,!0,n?Error("react-stack-top-frame"):I,n?P(d(e)):F)}})()),E}var L;function se(){return L||(L=1,process.env.NODE_ENV==="production"?A.exports=ae():A.exports=oe()),A.exports}var ue=se();function ce({baseURL:o,getToken:i,timeoutMs:f=15e3,axiosInstance:d,currency:u,lng:c,onError:m}={}){const l=d??re.create({baseURL:o,timeout:f,headers:{"Content-Type":"application/json"}});return l.interceptors.request.use(async s=>{if(i){const R=await i();R&&(s.headers=s.headers||{},s.headers.Authorization=`Bearer ${R}`)}return s}),l.interceptors.request.use(s=>{s.headers.Currency=u,s.headers["currency-code"]=u,s.headers.lang=c}),l.interceptors.response.use(s=>s,s=>m?m(s,{instance:l}):Promise.reject(s)),l}function le({children:o,...i}){const f={recentlyCreatedOwnerStacks:[]},d=v.useMemo(()=>ce(i),[i]);return ue.jsx(x.Provider,{value:{client:d,...f},children:o})}exports.ApiCtx=x;exports.ApiProvider=le;exports.useApiContext=te;exports.useApiContextSafe=ne;
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import "@tanstack/react-query";
|
|
2
|
-
import
|
|
2
|
+
import re, { createContext as te, useContext as U, useMemo as ne } from "react";
|
|
3
3
|
import ae from "axios";
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
if (!
|
|
4
|
+
const P = te(null), me = () => {
|
|
5
|
+
const o = U(P);
|
|
6
|
+
if (!o)
|
|
7
7
|
throw new Error("useApiContext must be used within ApiProvider");
|
|
8
|
-
return
|
|
8
|
+
return o;
|
|
9
|
+
}, _e = () => U(P) || {
|
|
10
|
+
recentlyCreatedOwnerStacks: []
|
|
11
|
+
// 其他預設屬性...
|
|
9
12
|
};
|
|
10
|
-
var T = { exports: {} },
|
|
13
|
+
var T = { exports: {} }, p = {};
|
|
11
14
|
/**
|
|
12
15
|
* @license React
|
|
13
16
|
* react-jsx-runtime.production.js
|
|
@@ -17,29 +20,29 @@ var T = { exports: {} }, E = {};
|
|
|
17
20
|
* This source code is licensed under the MIT license found in the
|
|
18
21
|
* LICENSE file in the root directory of this source tree.
|
|
19
22
|
*/
|
|
20
|
-
var
|
|
23
|
+
var D;
|
|
21
24
|
function oe() {
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
function f(
|
|
26
|
-
var
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
for (var
|
|
30
|
-
|
|
31
|
-
} else
|
|
32
|
-
return u =
|
|
33
|
-
$$typeof:
|
|
34
|
-
type:
|
|
35
|
-
key:
|
|
25
|
+
if (D) return p;
|
|
26
|
+
D = 1;
|
|
27
|
+
var o = Symbol.for("react.transitional.element"), i = Symbol.for("react.fragment");
|
|
28
|
+
function f(d, u, c) {
|
|
29
|
+
var m = null;
|
|
30
|
+
if (c !== void 0 && (m = "" + c), u.key !== void 0 && (m = "" + u.key), "key" in u) {
|
|
31
|
+
c = {};
|
|
32
|
+
for (var l in u)
|
|
33
|
+
l !== "key" && (c[l] = u[l]);
|
|
34
|
+
} else c = u;
|
|
35
|
+
return u = c.ref, {
|
|
36
|
+
$$typeof: o,
|
|
37
|
+
type: d,
|
|
38
|
+
key: m,
|
|
36
39
|
ref: u !== void 0 ? u : null,
|
|
37
|
-
props:
|
|
40
|
+
props: c
|
|
38
41
|
};
|
|
39
42
|
}
|
|
40
|
-
return
|
|
43
|
+
return p.Fragment = i, p.jsx = f, p.jsxs = f, p;
|
|
41
44
|
}
|
|
42
|
-
var
|
|
45
|
+
var E = {};
|
|
43
46
|
/**
|
|
44
47
|
* @license React
|
|
45
48
|
* react-jsx-runtime.development.js
|
|
@@ -49,58 +52,58 @@ var p = {};
|
|
|
49
52
|
* This source code is licensed under the MIT license found in the
|
|
50
53
|
* LICENSE file in the root directory of this source tree.
|
|
51
54
|
*/
|
|
52
|
-
var
|
|
55
|
+
var L;
|
|
53
56
|
function se() {
|
|
54
|
-
return
|
|
55
|
-
function
|
|
57
|
+
return L || (L = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
58
|
+
function o(e) {
|
|
56
59
|
if (e == null) return null;
|
|
57
60
|
if (typeof e == "function")
|
|
58
|
-
return e.$$typeof ===
|
|
61
|
+
return e.$$typeof === Q ? null : e.displayName || e.name || null;
|
|
59
62
|
if (typeof e == "string") return e;
|
|
60
63
|
switch (e) {
|
|
61
|
-
case
|
|
64
|
+
case k:
|
|
62
65
|
return "Fragment";
|
|
63
|
-
case
|
|
66
|
+
case V:
|
|
64
67
|
return "Profiler";
|
|
65
|
-
case
|
|
68
|
+
case q:
|
|
66
69
|
return "StrictMode";
|
|
67
|
-
case G:
|
|
68
|
-
return "Suspense";
|
|
69
70
|
case X:
|
|
71
|
+
return "Suspense";
|
|
72
|
+
case B:
|
|
70
73
|
return "SuspenseList";
|
|
71
|
-
case
|
|
74
|
+
case Z:
|
|
72
75
|
return "Activity";
|
|
73
76
|
}
|
|
74
77
|
if (typeof e == "object")
|
|
75
78
|
switch (typeof e.tag == "number" && console.error(
|
|
76
79
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
77
80
|
), e.$$typeof) {
|
|
78
|
-
case
|
|
81
|
+
case W:
|
|
79
82
|
return "Portal";
|
|
80
83
|
case J:
|
|
81
84
|
return e.displayName || "Context";
|
|
82
85
|
case z:
|
|
83
86
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
84
|
-
case
|
|
87
|
+
case G:
|
|
85
88
|
var r = e.render;
|
|
86
89
|
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
87
|
-
case
|
|
88
|
-
return r = e.displayName || null, r !== null ? r :
|
|
89
|
-
case
|
|
90
|
+
case H:
|
|
91
|
+
return r = e.displayName || null, r !== null ? r : o(e.type) || "Memo";
|
|
92
|
+
case A:
|
|
90
93
|
r = e._payload, e = e._init;
|
|
91
94
|
try {
|
|
92
|
-
return
|
|
95
|
+
return o(e(r));
|
|
93
96
|
} catch {
|
|
94
97
|
}
|
|
95
98
|
}
|
|
96
99
|
return null;
|
|
97
100
|
}
|
|
98
|
-
function
|
|
101
|
+
function i(e) {
|
|
99
102
|
return "" + e;
|
|
100
103
|
}
|
|
101
104
|
function f(e) {
|
|
102
105
|
try {
|
|
103
|
-
|
|
106
|
+
i(e);
|
|
104
107
|
var r = !1;
|
|
105
108
|
} catch {
|
|
106
109
|
r = !0;
|
|
@@ -112,15 +115,15 @@ function se() {
|
|
|
112
115
|
r,
|
|
113
116
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
114
117
|
n
|
|
115
|
-
),
|
|
118
|
+
), i(e);
|
|
116
119
|
}
|
|
117
120
|
}
|
|
118
|
-
function
|
|
119
|
-
if (e ===
|
|
120
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
121
|
+
function d(e) {
|
|
122
|
+
if (e === k) return "<>";
|
|
123
|
+
if (typeof e == "object" && e !== null && e.$$typeof === A)
|
|
121
124
|
return "<...>";
|
|
122
125
|
try {
|
|
123
|
-
var r =
|
|
126
|
+
var r = o(e);
|
|
124
127
|
return r ? "<" + r + ">" : "<...>";
|
|
125
128
|
} catch {
|
|
126
129
|
return "<...>";
|
|
@@ -130,19 +133,19 @@ function se() {
|
|
|
130
133
|
var e = x.A;
|
|
131
134
|
return e === null ? null : e.getOwner();
|
|
132
135
|
}
|
|
133
|
-
function
|
|
136
|
+
function c() {
|
|
134
137
|
return Error("react-stack-top-frame");
|
|
135
138
|
}
|
|
136
|
-
function
|
|
137
|
-
if (
|
|
139
|
+
function m(e) {
|
|
140
|
+
if (N.call(e, "key")) {
|
|
138
141
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
139
142
|
if (r && r.isReactWarning) return !1;
|
|
140
143
|
}
|
|
141
144
|
return e.key !== void 0;
|
|
142
145
|
}
|
|
143
|
-
function
|
|
146
|
+
function l(e, r) {
|
|
144
147
|
function t() {
|
|
145
|
-
|
|
148
|
+
g || (g = !0, console.error(
|
|
146
149
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
147
150
|
r
|
|
148
151
|
));
|
|
@@ -152,23 +155,23 @@ function se() {
|
|
|
152
155
|
configurable: !0
|
|
153
156
|
});
|
|
154
157
|
}
|
|
155
|
-
function
|
|
156
|
-
var e =
|
|
157
|
-
return
|
|
158
|
+
function s() {
|
|
159
|
+
var e = o(this.type);
|
|
160
|
+
return Y[e] || (Y[e] = !0, console.error(
|
|
158
161
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
159
162
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
160
163
|
}
|
|
161
|
-
function R(e, r, t, n, b,
|
|
164
|
+
function R(e, r, t, n, b, h) {
|
|
162
165
|
var a = t.ref;
|
|
163
166
|
return e = {
|
|
164
|
-
$$typeof:
|
|
167
|
+
$$typeof: C,
|
|
165
168
|
type: e,
|
|
166
169
|
key: r,
|
|
167
170
|
props: t,
|
|
168
171
|
_owner: n
|
|
169
172
|
}, (a !== void 0 ? a : null) !== null ? Object.defineProperty(e, "ref", {
|
|
170
173
|
enumerable: !1,
|
|
171
|
-
get:
|
|
174
|
+
get: s
|
|
172
175
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
173
176
|
configurable: !1,
|
|
174
177
|
enumerable: !1,
|
|
@@ -188,14 +191,14 @@ function se() {
|
|
|
188
191
|
configurable: !1,
|
|
189
192
|
enumerable: !1,
|
|
190
193
|
writable: !0,
|
|
191
|
-
value:
|
|
194
|
+
value: h
|
|
192
195
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
193
196
|
}
|
|
194
|
-
function
|
|
197
|
+
function S(e, r, t, n, b, h) {
|
|
195
198
|
var a = r.children;
|
|
196
199
|
if (a !== void 0)
|
|
197
200
|
if (n)
|
|
198
|
-
if (
|
|
201
|
+
if (K(a)) {
|
|
199
202
|
for (n = 0; n < a.length; n++)
|
|
200
203
|
y(a[n]);
|
|
201
204
|
Object.freeze && Object.freeze(a);
|
|
@@ -204,12 +207,12 @@ function se() {
|
|
|
204
207
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
205
208
|
);
|
|
206
209
|
else y(a);
|
|
207
|
-
if (
|
|
208
|
-
a =
|
|
209
|
-
var _ = Object.keys(r).filter(function(
|
|
210
|
-
return
|
|
210
|
+
if (N.call(r, "key")) {
|
|
211
|
+
a = o(e);
|
|
212
|
+
var _ = Object.keys(r).filter(function(ee) {
|
|
213
|
+
return ee !== "key";
|
|
211
214
|
});
|
|
212
|
-
n = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
215
|
+
n = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", F[a + n] || (_ = 0 < _.length ? "{" + _.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
213
216
|
`A props object containing a "key" prop is being spread into JSX:
|
|
214
217
|
let props = %s;
|
|
215
218
|
<%s {...props} />
|
|
@@ -220,14 +223,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
220
223
|
a,
|
|
221
224
|
_,
|
|
222
225
|
a
|
|
223
|
-
),
|
|
226
|
+
), F[a + n] = !0);
|
|
224
227
|
}
|
|
225
|
-
if (a = null, t !== void 0 && (f(t), a = "" + t),
|
|
228
|
+
if (a = null, t !== void 0 && (f(t), a = "" + t), m(r) && (f(r.key), a = "" + r.key), "key" in r) {
|
|
226
229
|
t = {};
|
|
227
|
-
for (var
|
|
228
|
-
|
|
230
|
+
for (var w in r)
|
|
231
|
+
w !== "key" && (t[w] = r[w]);
|
|
229
232
|
} else t = r;
|
|
230
|
-
return a &&
|
|
233
|
+
return a && l(
|
|
231
234
|
t,
|
|
232
235
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
233
236
|
), R(
|
|
@@ -236,16 +239,16 @@ React keys must be passed directly to JSX without using spread:
|
|
|
236
239
|
t,
|
|
237
240
|
u(),
|
|
238
241
|
b,
|
|
239
|
-
|
|
242
|
+
h
|
|
240
243
|
);
|
|
241
244
|
}
|
|
242
245
|
function y(e) {
|
|
243
|
-
|
|
246
|
+
j(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === A && (e._payload.status === "fulfilled" ? j(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
244
247
|
}
|
|
245
|
-
function
|
|
246
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
248
|
+
function j(e) {
|
|
249
|
+
return typeof e == "object" && e !== null && e.$$typeof === C;
|
|
247
250
|
}
|
|
248
|
-
var v =
|
|
251
|
+
var v = re, C = Symbol.for("react.transitional.element"), W = Symbol.for("react.portal"), k = Symbol.for("react.fragment"), q = Symbol.for("react.strict_mode"), V = Symbol.for("react.profiler"), z = Symbol.for("react.consumer"), J = Symbol.for("react.context"), G = Symbol.for("react.forward_ref"), X = Symbol.for("react.suspense"), B = Symbol.for("react.suspense_list"), H = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), Z = Symbol.for("react.activity"), Q = Symbol.for("react.client.reference"), x = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, N = Object.prototype.hasOwnProperty, K = Array.isArray, O = console.createTask ? console.createTask : function() {
|
|
249
252
|
return null;
|
|
250
253
|
};
|
|
251
254
|
v = {
|
|
@@ -253,71 +256,75 @@ React keys must be passed directly to JSX without using spread:
|
|
|
253
256
|
return e();
|
|
254
257
|
}
|
|
255
258
|
};
|
|
256
|
-
var
|
|
259
|
+
var g, Y = {}, $ = v.react_stack_bottom_frame.bind(
|
|
257
260
|
v,
|
|
258
|
-
|
|
259
|
-
)(),
|
|
260
|
-
|
|
261
|
+
c
|
|
262
|
+
)(), I = O(d(c)), F = {};
|
|
263
|
+
E.Fragment = k, E.jsx = function(e, r, t) {
|
|
261
264
|
var n = 1e4 > x.recentlyCreatedOwnerStacks++;
|
|
262
|
-
return
|
|
265
|
+
return S(
|
|
263
266
|
e,
|
|
264
267
|
r,
|
|
265
268
|
t,
|
|
266
269
|
!1,
|
|
267
|
-
n ? Error("react-stack-top-frame") :
|
|
268
|
-
n ?
|
|
270
|
+
n ? Error("react-stack-top-frame") : $,
|
|
271
|
+
n ? O(d(e)) : I
|
|
269
272
|
);
|
|
270
|
-
},
|
|
273
|
+
}, E.jsxs = function(e, r, t) {
|
|
271
274
|
var n = 1e4 > x.recentlyCreatedOwnerStacks++;
|
|
272
|
-
return
|
|
275
|
+
return S(
|
|
273
276
|
e,
|
|
274
277
|
r,
|
|
275
278
|
t,
|
|
276
279
|
!0,
|
|
277
|
-
n ? Error("react-stack-top-frame") :
|
|
278
|
-
n ?
|
|
280
|
+
n ? Error("react-stack-top-frame") : $,
|
|
281
|
+
n ? O(d(e)) : I
|
|
279
282
|
);
|
|
280
283
|
};
|
|
281
|
-
})()),
|
|
284
|
+
})()), E;
|
|
282
285
|
}
|
|
283
|
-
var
|
|
286
|
+
var M;
|
|
284
287
|
function ue() {
|
|
285
|
-
return
|
|
288
|
+
return M || (M = 1, process.env.NODE_ENV === "production" ? T.exports = oe() : T.exports = se()), T.exports;
|
|
286
289
|
}
|
|
287
|
-
var
|
|
288
|
-
function
|
|
289
|
-
baseURL:
|
|
290
|
-
getToken:
|
|
290
|
+
var ce = ue();
|
|
291
|
+
function le({
|
|
292
|
+
baseURL: o,
|
|
293
|
+
getToken: i,
|
|
291
294
|
timeoutMs: f = 15e3,
|
|
292
|
-
axiosInstance:
|
|
295
|
+
axiosInstance: d,
|
|
293
296
|
currency: u,
|
|
294
|
-
lng:
|
|
295
|
-
onError:
|
|
297
|
+
lng: c,
|
|
298
|
+
onError: m
|
|
296
299
|
} = {}) {
|
|
297
|
-
const
|
|
298
|
-
baseURL:
|
|
300
|
+
const l = d ?? ae.create({
|
|
301
|
+
baseURL: o,
|
|
299
302
|
timeout: f,
|
|
300
303
|
headers: { "Content-Type": "application/json" }
|
|
301
304
|
});
|
|
302
|
-
return
|
|
303
|
-
if (
|
|
304
|
-
const R = await
|
|
305
|
-
R && (
|
|
305
|
+
return l.interceptors.request.use(async (s) => {
|
|
306
|
+
if (i) {
|
|
307
|
+
const R = await i();
|
|
308
|
+
R && (s.headers = s.headers || {}, s.headers.Authorization = `Bearer ${R}`);
|
|
306
309
|
}
|
|
307
|
-
return
|
|
308
|
-
}),
|
|
309
|
-
|
|
310
|
-
}),
|
|
311
|
-
(
|
|
312
|
-
(
|
|
313
|
-
),
|
|
310
|
+
return s;
|
|
311
|
+
}), l.interceptors.request.use((s) => {
|
|
312
|
+
s.headers.Currency = u, s.headers["currency-code"] = u, s.headers.lang = c;
|
|
313
|
+
}), l.interceptors.response.use(
|
|
314
|
+
(s) => s,
|
|
315
|
+
(s) => m ? m(s, { instance: l }) : Promise.reject(s)
|
|
316
|
+
), l;
|
|
314
317
|
}
|
|
315
|
-
function
|
|
316
|
-
const f =
|
|
317
|
-
|
|
318
|
+
function pe({ children: o, ...i }) {
|
|
319
|
+
const f = {
|
|
320
|
+
recentlyCreatedOwnerStacks: []
|
|
321
|
+
// 其他 API 相關狀態...
|
|
322
|
+
}, d = ne(() => le(i), [i]);
|
|
323
|
+
return /* @__PURE__ */ ce.jsx(P.Provider, { value: { client: d, ...f }, children: o });
|
|
318
324
|
}
|
|
319
325
|
export {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
me as useApiContext
|
|
326
|
+
P as ApiCtx,
|
|
327
|
+
pe as ApiProvider,
|
|
328
|
+
me as useApiContext,
|
|
329
|
+
_e as useApiContextSafe
|
|
323
330
|
};
|