@obb871001/api-integration-sdk 1.0.13 → 1.0.15

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 CHANGED
@@ -1,22 +1,30 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@tanstack/react-query");const A=require("react"),re=require("axios"),S=A.createContext(null),te=()=>{const s=A.useContext(S);if(!s)throw new Error("useApiContext must be used within ApiProvider");return s};var T={exports:{}},E={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@tanstack/react-query");const D=require("react"),fr=require("axios"),N=D.createContext(null),dr=()=>{const b=D.useContext(N);if(!b)throw new Error("useApiContext must be used within ApiProvider");return b},vr=()=>D.useContext(N)||{recentlyCreatedOwnerStacks:[]};var q={exports:{}},$={};/**
2
2
  * @license React
3
- * react-jsx-runtime.production.js
3
+ * react-jsx-runtime.production.min.js
4
4
  *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
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 ne(){if(D)return E;D=1;var s=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function f(m,u,l){var d=null;if(l!==void 0&&(d=""+l),u.key!==void 0&&(d=""+u.key),"key"in u){l={};for(var i in u)i!=="key"&&(l[i]=u[i])}else l=u;return u=l.ref,{$$typeof:s,type:m,key:d,ref:u!==void 0?u:null,props:l}}return E.Fragment=c,E.jsx=f,E.jsxs=f,E}var p={};/**
9
+ */var Oe;function pr(){if(Oe)return $;Oe=1;var b=D,E=Symbol.for("react.element"),T=Symbol.for("react.fragment"),R=Object.prototype.hasOwnProperty,O=b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w={key:!0,ref:!0,__self:!0,__source:!0};function m(p,u,g){var h,_={},x=null,Y=null;g!==void 0&&(x=""+g),u.key!==void 0&&(x=""+u.key),u.ref!==void 0&&(Y=u.ref);for(h in u)R.call(u,h)&&!w.hasOwnProperty(h)&&(_[h]=u[h]);if(p&&p.defaultProps)for(h in u=p.defaultProps,u)_[h]===void 0&&(_[h]=u[h]);return{$$typeof:E,type:p,key:x,ref:Y,props:_,_owner:O.current}}return $.Fragment=T,$.jsx=m,$.jsxs=m,$}var W={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
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 ae(){return M||(M=1,process.env.NODE_ENV!=="production"&&(function(){function s(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 z: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 V:return e.displayName||"Context";case J: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:s(e.type)||"Memo";case x:r=e._payload,e=e._init;try{return s(e(r))}catch{}}return null}function c(e){return""+e}function f(e){try{c(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),c(e)}}function m(e){if(e===k)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===x)return"<...>";try{var r=s(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function u(){var e=P.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function d(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 i(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 o(){var e=s(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 v(e,r,t,n,b,h){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:o}):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:b}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:h}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function w(e,r,t,n,b,h){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=s(e);var _=Object.keys(r).filter(function(ee){return ee!=="key"});n=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",q[a+n]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var xe;function hr(){return xe||(xe=1,process.env.NODE_ENV!=="production"&&(function(){var b=D,E=Symbol.for("react.element"),T=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),m=Symbol.for("react.provider"),p=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),Q=Symbol.iterator,Pe="@@iterator";function we(e){if(e===null||typeof e!="object")return null;var r=Q&&e[Q]||e[Pe];return typeof r=="function"?r:null}var j=b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function f(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];je("error",e,t)}}function je(e,r,t){{var n=j.ReactDebugCurrentFrame,o=n.getStackAddendum();o!==""&&(r+="%s",t=t.concat([o]));var s=t.map(function(i){return String(i)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var ke=!1,Ae=!1,De=!1,Fe=!1,Ie=!1,ee;ee=Symbol.for("react.module.reference");function $e(e){return!!(typeof e=="string"||typeof e=="function"||e===R||e===w||Ie||e===O||e===g||e===h||Fe||e===Y||ke||Ae||De||typeof e=="object"&&e!==null&&(e.$$typeof===x||e.$$typeof===_||e.$$typeof===m||e.$$typeof===p||e.$$typeof===u||e.$$typeof===ee||e.getModuleId!==void 0))}function We(e,r,t){var n=e.displayName;if(n)return n;var o=r.displayName||r.name||"";return o!==""?t+"("+o+")":t}function re(e){return e.displayName||"Context"}function C(e){if(e==null)return null;if(typeof e.tag=="number"&&f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case R:return"Fragment";case T:return"Portal";case w:return"Profiler";case O:return"StrictMode";case g:return"Suspense";case h:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case p:var r=e;return re(r)+".Consumer";case m:var t=e;return re(t._context)+".Provider";case u:return We(e,e.render,"ForwardRef");case _:var n=e.displayName||null;return n!==null?n:C(e.type)||"Memo";case x:{var o=e,s=o._payload,i=o._init;try{return C(i(s))}catch{return null}}}return null}var S=Object.assign,F=0,te,ne,ae,ie,oe,ue,se;function le(){}le.__reactDisabledLog=!0;function Ye(){{if(F===0){te=console.log,ne=console.info,ae=console.warn,ie=console.error,oe=console.group,ue=console.groupCollapsed,se=console.groupEnd;var e={configurable:!0,enumerable:!0,value:le,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}F++}}function Le(){{if(F--,F===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:S({},e,{value:te}),info:S({},e,{value:ne}),warn:S({},e,{value:ae}),error:S({},e,{value:ie}),group:S({},e,{value:oe}),groupCollapsed:S({},e,{value:ue}),groupEnd:S({},e,{value:se})})}F<0&&f("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var J=j.ReactCurrentDispatcher,B;function L(e,r,t){{if(B===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);B=n&&n[1]||""}return`
18
+ `+B+e}}var K=!1,M;{var Me=typeof WeakMap=="function"?WeakMap:Map;M=new Me}function ce(e,r){if(!e||K)return"";{var t=M.get(e);if(t!==void 0)return t}var n;K=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=J.current,J.current=null,Ye();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(v){n=v}Reflect.construct(e,[],i)}else{try{i.call()}catch(v){n=v}e.call(i.prototype)}}else{try{throw Error()}catch(v){n=v}e()}}catch(v){if(v&&n&&typeof v.stack=="string"){for(var a=v.stack.split(`
19
+ `),d=n.stack.split(`
20
+ `),l=a.length-1,c=d.length-1;l>=1&&c>=0&&a[l]!==d[c];)c--;for(;l>=1&&c>=0;l--,c--)if(a[l]!==d[c]){if(l!==1||c!==1)do if(l--,c--,c<0||a[l]!==d[c]){var y=`
21
+ `+a[l].replace(" at new "," at ");return e.displayName&&y.includes("<anonymous>")&&(y=y.replace("<anonymous>",e.displayName)),typeof e=="function"&&M.set(e,y),y}while(l>=1&&c>=0);break}}}finally{K=!1,J.current=s,Le(),Error.prepareStackTrace=o}var A=e?e.displayName||e.name:"",P=A?L(A):"";return typeof e=="function"&&M.set(e,P),P}function Ve(e,r,t){return ce(e,!1)}function Ue(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function V(e,r,t){if(e==null)return"";if(typeof e=="function")return ce(e,Ue(e));if(typeof e=="string")return L(e);switch(e){case g:return L("Suspense");case h:return L("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return Ve(e.render);case _:return V(e.type,r,t);case x:{var n=e,o=n._payload,s=n._init;try{return V(s(o),r,t)}catch{}}}return""}var I=Object.prototype.hasOwnProperty,fe={},de=j.ReactDebugCurrentFrame;function U(e){if(e){var r=e._owner,t=V(e.type,e._source,r?r.type:null);de.setExtraStackFrame(t)}else de.setExtraStackFrame(null)}function qe(e,r,t,n,o){{var s=Function.call.bind(I);for(var i in e)if(s(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var d=Error((n||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(l){a=l}a&&!(a instanceof Error)&&(U(o),f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,i,typeof a),U(null)),a instanceof Error&&!(a.message in fe)&&(fe[a.message]=!0,U(o),f("Failed %s type: %s",t,a.message),U(null))}}}var Ne=Array.isArray;function z(e){return Ne(e)}function Je(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Be(e){try{return ve(e),!1}catch{return!0}}function ve(e){return""+e}function pe(e){if(Be(e))return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Je(e)),ve(e)}var he=j.ReactCurrentOwner,Ke={key:!0,ref:!0,__self:!0,__source:!0},ye,be;function ze(e){if(I.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ge(e){if(I.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Xe(e,r){typeof e.ref=="string"&&he.current}function He(e,r){{var t=function(){ye||(ye=!0,f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Ze(e,r){{var t=function(){be||(be=!0,f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var Qe=function(e,r,t,n,o,s,i){var a={$$typeof:E,type:e,key:r,ref:t,props:i,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function er(e,r,t,n,o){{var s,i={},a=null,d=null;t!==void 0&&(pe(t),a=""+t),Ge(r)&&(pe(r.key),a=""+r.key),ze(r)&&(d=r.ref,Xe(r,o));for(s in r)I.call(r,s)&&!Ke.hasOwnProperty(s)&&(i[s]=r[s]);if(e&&e.defaultProps){var l=e.defaultProps;for(s in l)i[s]===void 0&&(i[s]=l[s])}if(a||d){var c=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&He(i,c),d&&Ze(i,c)}return Qe(e,a,d,o,n,he.current,i)}}var G=j.ReactCurrentOwner,Ee=j.ReactDebugCurrentFrame;function k(e){if(e){var r=e._owner,t=V(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var X;X=!1;function H(e){return typeof e=="object"&&e!==null&&e.$$typeof===E}function Re(){{if(G.current){var e=C(G.current.type);if(e)return`
22
+
23
+ Check the render method of \``+e+"`."}return""}}function rr(e){return""}var ge={};function tr(e){{var r=Re();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
24
+
25
+ Check the top-level render call using <`+t+">.")}return r}}function _e(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=tr(r);if(ge[t])return;ge[t]=!0;var n="";e&&e._owner&&e._owner!==G.current&&(n=" It was passed a child from "+C(e._owner.type)+"."),k(e),f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),k(null)}}function me(e,r){{if(typeof e!="object")return;if(z(e))for(var t=0;t<e.length;t++){var n=e[t];H(n)&&_e(n,r)}else if(H(e))e._store&&(e._store.validated=!0);else if(e){var o=we(e);if(typeof o=="function"&&o!==e.entries)for(var s=o.call(e),i;!(i=s.next()).done;)H(i.value)&&_e(i.value,r)}}}function nr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===_))t=r.propTypes;else return;if(t){var n=C(r);qe(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!X){X=!0;var o=C(r);f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",o||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ar(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){k(e),f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),k(null);break}}e.ref!==null&&(k(e),f("Invalid attribute `ref` supplied to `React.Fragment`."),k(null))}}var Ce={};function Te(e,r,t,n,o,s){{var i=$e(e);if(!i){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var d=rr();d?a+=d:a+=Re();var l;e===null?l="null":z(e)?l="array":e!==void 0&&e.$$typeof===E?(l="<"+(C(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):l=typeof e,f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,a)}var c=er(e,r,t,o,s);if(c==null)return c;if(i){var y=r.children;if(y!==void 0)if(n)if(z(y)){for(var A=0;A<y.length;A++)me(y[A],e);Object.freeze&&Object.freeze(y)}else f("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 me(y,e)}if(I.call(r,"key")){var P=C(e),v=Object.keys(r).filter(function(cr){return cr!=="key"}),Z=v.length>0?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}";if(!Ce[P+Z]){var lr=v.length>0?"{"+v.join(": ..., ")+": ...}":"{}";f(`A props object containing a "key" prop is being spread into JSX:
18
26
  let props = %s;
19
27
  <%s {...props} />
20
28
  React keys must be passed directly to JSX without using spread:
21
29
  let props = %s;
22
- <%s key={someKey} {...props} />`,n,a,_,a),q[a+n]=!0)}if(a=null,t!==void 0&&(f(t),a=""+t),d(r)&&(f(r.key),a=""+r.key),"key"in r){t={};for(var y in r)y!=="key"&&(t[y]=r[y])}else t=r;return a&&i(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),v(e,a,t,u(),b,h)}function j(e){C(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===x&&(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 R=A,g=Symbol.for("react.transitional.element"),U=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),V=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"),x=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),Q=Symbol.for("react.client.reference"),P=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,K=Array.isArray,O=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(e){return e()}};var Y,$={},I=R.react_stack_bottom_frame.bind(R,l)(),F=O(m(l)),q={};p.Fragment=k,p.jsx=function(e,r,t){var n=1e4>P.recentlyCreatedOwnerStacks++;return w(e,r,t,!1,n?Error("react-stack-top-frame"):I,n?O(m(e)):F)},p.jsxs=function(e,r,t){var n=1e4>P.recentlyCreatedOwnerStacks++;return w(e,r,t,!0,n?Error("react-stack-top-frame"):I,n?O(m(e)):F)}})()),p}var L;function oe(){return L||(L=1,process.env.NODE_ENV==="production"?T.exports=ne():T.exports=ae()),T.exports}var se=oe();function ue({baseURL:s,getToken:c,timeoutMs:f=15e3,axiosInstance:m,currency:u,lng:l,onError:d}={}){const i=m??re.create({baseURL:s,timeout:f,headers:{"Content-Type":"application/json"}});return i.interceptors.request.use(async o=>{if(c){const v=await c();v&&(o.headers=o.headers||{},o.headers.Authorization=`Bearer ${v}`)}return o}),i.interceptors.request.use(o=>{o.headers.Currency=u,o.headers["currency-code"]=u,o.headers.lang=l}),i.interceptors.response.use(o=>o,o=>d?d(o,{instance:i}):Promise.reject(o)),i}function le({children:s,...c}){const f=A.useMemo(()=>ue(c),[c]);return se.jsx(S.Provider,{value:{client:f},children:s})}exports.ApiCtx=S;exports.ApiProvider=le;exports.useApiContext=te;
30
+ <%s key={someKey} {...props} />`,Z,P,lr,P),Ce[P+Z]=!0}}return e===R?ar(c):nr(c),c}}function ir(e,r,t){return Te(e,r,t,!0)}function or(e,r,t){return Te(e,r,t,!1)}var ur=or,sr=ir;W.Fragment=R,W.jsx=ur,W.jsxs=sr})()),W}var Se;function yr(){return Se||(Se=1,process.env.NODE_ENV==="production"?q.exports=pr():q.exports=hr()),q.exports}var br=yr();function Er({baseURL:b,getToken:E,timeoutMs:T=15e3,axiosInstance:R,currency:O,lng:w,onError:m}={}){const p=R??fr.create({baseURL:b,timeout:T,headers:{"Content-Type":"application/json"}});return p.interceptors.request.use(async u=>{if(E){const g=await E();g&&(u.headers=u.headers||{},u.headers.Authorization=`Bearer ${g}`)}return u}),p.interceptors.request.use(u=>{u.headers.Currency=O,u.headers["currency-code"]=O,u.headers.lang=w}),p.interceptors.response.use(u=>u,u=>m?m(u,{instance:p}):Promise.reject(u)),p}function Rr({children:b,...E}){const T={recentlyCreatedOwnerStacks:[]},R=D.useMemo(()=>Er(E),[E]);return br.jsx(N.Provider,{value:{client:R,...T},children:b})}exports.ApiCtx=N;exports.ApiProvider=Rr;exports.useApiContext=dr;exports.useApiContextSafe=vr;
package/dist/index.js CHANGED
@@ -1,323 +1,681 @@
1
1
  import "@tanstack/react-query";
2
- import ee, { createContext as re, useContext as te, useMemo as ne } from "react";
3
- import ae from "axios";
4
- const M = re(null), me = () => {
5
- const s = te(M);
6
- if (!s)
2
+ import xe, { createContext as dr, useContext as Pe, useMemo as vr } from "react";
3
+ import pr from "axios";
4
+ const H = dr(null), Tr = () => {
5
+ const b = Pe(H);
6
+ if (!b)
7
7
  throw new Error("useApiContext must be used within ApiProvider");
8
- return s;
8
+ return b;
9
+ }, Cr = () => Pe(H) || {
10
+ recentlyCreatedOwnerStacks: []
11
+ // 其他預設屬性...
9
12
  };
10
- var T = { exports: {} }, E = {};
13
+ var U = { exports: {} }, I = {};
11
14
  /**
12
15
  * @license React
13
- * react-jsx-runtime.production.js
16
+ * react-jsx-runtime.production.min.js
14
17
  *
15
- * Copyright (c) Meta Platforms, Inc. and affiliates.
18
+ * Copyright (c) Facebook, Inc. and its affiliates.
16
19
  *
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 F;
21
- function oe() {
22
- if (F) return E;
23
- F = 1;
24
- var s = Symbol.for("react.transitional.element"), c = Symbol.for("react.fragment");
25
- function f(m, u, l) {
26
- var d = null;
27
- if (l !== void 0 && (d = "" + l), u.key !== void 0 && (d = "" + u.key), "key" in u) {
28
- l = {};
29
- for (var i in u)
30
- i !== "key" && (l[i] = u[i]);
31
- } else l = u;
32
- return u = l.ref, {
33
- $$typeof: s,
34
- type: m,
35
- key: d,
36
- ref: u !== void 0 ? u : null,
37
- props: l
38
- };
23
+ var Ce;
24
+ function hr() {
25
+ if (Ce) return I;
26
+ Ce = 1;
27
+ var b = xe, E = Symbol.for("react.element"), C = Symbol.for("react.fragment"), R = Object.prototype.hasOwnProperty, O = b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, S = { key: !0, ref: !0, __self: !0, __source: !0 };
28
+ function m(p, u, _) {
29
+ var h, g = {}, w = null, W = null;
30
+ _ !== void 0 && (w = "" + _), u.key !== void 0 && (w = "" + u.key), u.ref !== void 0 && (W = u.ref);
31
+ for (h in u) R.call(u, h) && !S.hasOwnProperty(h) && (g[h] = u[h]);
32
+ if (p && p.defaultProps) for (h in u = p.defaultProps, u) g[h] === void 0 && (g[h] = u[h]);
33
+ return { $$typeof: E, type: p, key: w, ref: W, props: g, _owner: O.current };
39
34
  }
40
- return E.Fragment = c, E.jsx = f, E.jsxs = f, E;
35
+ return I.Fragment = C, I.jsx = m, I.jsxs = m, I;
41
36
  }
42
- var p = {};
37
+ var $ = {};
43
38
  /**
44
39
  * @license React
45
40
  * react-jsx-runtime.development.js
46
41
  *
47
- * Copyright (c) Meta Platforms, Inc. and affiliates.
42
+ * Copyright (c) Facebook, Inc. and its affiliates.
48
43
  *
49
44
  * This source code is licensed under the MIT license found in the
50
45
  * LICENSE file in the root directory of this source tree.
51
46
  */
52
- var D;
53
- function se() {
54
- return D || (D = 1, process.env.NODE_ENV !== "production" && (function() {
55
- function s(e) {
56
- if (e == null) return null;
57
- if (typeof e == "function")
58
- return e.$$typeof === Z ? null : e.displayName || e.name || null;
59
- if (typeof e == "string") return e;
47
+ var Oe;
48
+ function yr() {
49
+ return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && (function() {
50
+ var b = xe, E = Symbol.for("react.element"), C = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), O = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), p = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), W = Symbol.for("react.offscreen"), Z = Symbol.iterator, Se = "@@iterator";
51
+ function je(e) {
52
+ if (e === null || typeof e != "object")
53
+ return null;
54
+ var r = Z && e[Z] || e[Se];
55
+ return typeof r == "function" ? r : null;
56
+ }
57
+ var j = b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
58
+ function f(e) {
59
+ {
60
+ for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
61
+ t[n - 1] = arguments[n];
62
+ ke("error", e, t);
63
+ }
64
+ }
65
+ function ke(e, r, t) {
66
+ {
67
+ var n = j.ReactDebugCurrentFrame, o = n.getStackAddendum();
68
+ o !== "" && (r += "%s", t = t.concat([o]));
69
+ var s = t.map(function(i) {
70
+ return String(i);
71
+ });
72
+ s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
73
+ }
74
+ }
75
+ var Ae = !1, De = !1, Fe = !1, Ie = !1, $e = !1, Q;
76
+ Q = Symbol.for("react.module.reference");
77
+ function We(e) {
78
+ return !!(typeof e == "string" || typeof e == "function" || e === R || e === S || $e || e === O || e === _ || e === h || Ie || e === W || Ae || De || Fe || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === g || e.$$typeof === m || e.$$typeof === p || e.$$typeof === u || // This needs to include all possible module reference object
79
+ // types supported by any Flight configuration anywhere since
80
+ // we don't know which Flight build this will end up being used
81
+ // with.
82
+ e.$$typeof === Q || e.getModuleId !== void 0));
83
+ }
84
+ function Ye(e, r, t) {
85
+ var n = e.displayName;
86
+ if (n)
87
+ return n;
88
+ var o = r.displayName || r.name || "";
89
+ return o !== "" ? t + "(" + o + ")" : t;
90
+ }
91
+ function ee(e) {
92
+ return e.displayName || "Context";
93
+ }
94
+ function T(e) {
95
+ if (e == null)
96
+ return null;
97
+ if (typeof e.tag == "number" && f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
98
+ return e.displayName || e.name || null;
99
+ if (typeof e == "string")
100
+ return e;
60
101
  switch (e) {
61
- case A:
102
+ case R:
62
103
  return "Fragment";
63
- case q:
104
+ case C:
105
+ return "Portal";
106
+ case S:
64
107
  return "Profiler";
65
- case W:
108
+ case O:
66
109
  return "StrictMode";
67
- case G:
110
+ case _:
68
111
  return "Suspense";
69
- case X:
112
+ case h:
70
113
  return "SuspenseList";
71
- case H:
72
- return "Activity";
73
114
  }
74
115
  if (typeof e == "object")
75
- switch (typeof e.tag == "number" && console.error(
76
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
77
- ), e.$$typeof) {
78
- case U:
79
- return "Portal";
80
- case J:
81
- return e.displayName || "Context";
82
- case z:
83
- return (e._context.displayName || "Context") + ".Consumer";
84
- case V:
85
- var r = e.render;
86
- return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
87
- case B:
88
- return r = e.displayName || null, r !== null ? r : s(e.type) || "Memo";
89
- case k:
90
- r = e._payload, e = e._init;
116
+ switch (e.$$typeof) {
117
+ case p:
118
+ var r = e;
119
+ return ee(r) + ".Consumer";
120
+ case m:
121
+ var t = e;
122
+ return ee(t._context) + ".Provider";
123
+ case u:
124
+ return Ye(e, e.render, "ForwardRef");
125
+ case g:
126
+ var n = e.displayName || null;
127
+ return n !== null ? n : T(e.type) || "Memo";
128
+ case w: {
129
+ var o = e, s = o._payload, i = o._init;
91
130
  try {
92
- return s(e(r));
131
+ return T(i(s));
93
132
  } catch {
133
+ return null;
94
134
  }
135
+ }
95
136
  }
96
137
  return null;
97
138
  }
98
- function c(e) {
99
- return "" + e;
139
+ var x = Object.assign, D = 0, re, te, ne, ae, ie, oe, ue;
140
+ function se() {
100
141
  }
101
- function f(e) {
142
+ se.__reactDisabledLog = !0;
143
+ function Le() {
144
+ {
145
+ if (D === 0) {
146
+ re = console.log, te = console.info, ne = console.warn, ae = console.error, ie = console.group, oe = console.groupCollapsed, ue = console.groupEnd;
147
+ var e = {
148
+ configurable: !0,
149
+ enumerable: !0,
150
+ value: se,
151
+ writable: !0
152
+ };
153
+ Object.defineProperties(console, {
154
+ info: e,
155
+ log: e,
156
+ warn: e,
157
+ error: e,
158
+ group: e,
159
+ groupCollapsed: e,
160
+ groupEnd: e
161
+ });
162
+ }
163
+ D++;
164
+ }
165
+ }
166
+ function Ve() {
167
+ {
168
+ if (D--, D === 0) {
169
+ var e = {
170
+ configurable: !0,
171
+ enumerable: !0,
172
+ writable: !0
173
+ };
174
+ Object.defineProperties(console, {
175
+ log: x({}, e, {
176
+ value: re
177
+ }),
178
+ info: x({}, e, {
179
+ value: te
180
+ }),
181
+ warn: x({}, e, {
182
+ value: ne
183
+ }),
184
+ error: x({}, e, {
185
+ value: ae
186
+ }),
187
+ group: x({}, e, {
188
+ value: ie
189
+ }),
190
+ groupCollapsed: x({}, e, {
191
+ value: oe
192
+ }),
193
+ groupEnd: x({}, e, {
194
+ value: ue
195
+ })
196
+ });
197
+ }
198
+ D < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
199
+ }
200
+ }
201
+ var N = j.ReactCurrentDispatcher, q;
202
+ function Y(e, r, t) {
203
+ {
204
+ if (q === void 0)
205
+ try {
206
+ throw Error();
207
+ } catch (o) {
208
+ var n = o.stack.trim().match(/\n( *(at )?)/);
209
+ q = n && n[1] || "";
210
+ }
211
+ return `
212
+ ` + q + e;
213
+ }
214
+ }
215
+ var J = !1, L;
216
+ {
217
+ var Me = typeof WeakMap == "function" ? WeakMap : Map;
218
+ L = new Me();
219
+ }
220
+ function le(e, r) {
221
+ if (!e || J)
222
+ return "";
223
+ {
224
+ var t = L.get(e);
225
+ if (t !== void 0)
226
+ return t;
227
+ }
228
+ var n;
229
+ J = !0;
230
+ var o = Error.prepareStackTrace;
231
+ Error.prepareStackTrace = void 0;
232
+ var s;
233
+ s = N.current, N.current = null, Le();
102
234
  try {
103
- c(e);
104
- var r = !1;
105
- } catch {
106
- r = !0;
235
+ if (r) {
236
+ var i = function() {
237
+ throw Error();
238
+ };
239
+ if (Object.defineProperty(i.prototype, "props", {
240
+ set: function() {
241
+ throw Error();
242
+ }
243
+ }), typeof Reflect == "object" && Reflect.construct) {
244
+ try {
245
+ Reflect.construct(i, []);
246
+ } catch (v) {
247
+ n = v;
248
+ }
249
+ Reflect.construct(e, [], i);
250
+ } else {
251
+ try {
252
+ i.call();
253
+ } catch (v) {
254
+ n = v;
255
+ }
256
+ e.call(i.prototype);
257
+ }
258
+ } else {
259
+ try {
260
+ throw Error();
261
+ } catch (v) {
262
+ n = v;
263
+ }
264
+ e();
265
+ }
266
+ } catch (v) {
267
+ if (v && n && typeof v.stack == "string") {
268
+ for (var a = v.stack.split(`
269
+ `), d = n.stack.split(`
270
+ `), l = a.length - 1, c = d.length - 1; l >= 1 && c >= 0 && a[l] !== d[c]; )
271
+ c--;
272
+ for (; l >= 1 && c >= 0; l--, c--)
273
+ if (a[l] !== d[c]) {
274
+ if (l !== 1 || c !== 1)
275
+ do
276
+ if (l--, c--, c < 0 || a[l] !== d[c]) {
277
+ var y = `
278
+ ` + a[l].replace(" at new ", " at ");
279
+ return e.displayName && y.includes("<anonymous>") && (y = y.replace("<anonymous>", e.displayName)), typeof e == "function" && L.set(e, y), y;
280
+ }
281
+ while (l >= 1 && c >= 0);
282
+ break;
283
+ }
284
+ }
285
+ } finally {
286
+ J = !1, N.current = s, Ve(), Error.prepareStackTrace = o;
287
+ }
288
+ var A = e ? e.displayName || e.name : "", P = A ? Y(A) : "";
289
+ return typeof e == "function" && L.set(e, P), P;
290
+ }
291
+ function Ue(e, r, t) {
292
+ return le(e, !1);
293
+ }
294
+ function Ne(e) {
295
+ var r = e.prototype;
296
+ return !!(r && r.isReactComponent);
297
+ }
298
+ function V(e, r, t) {
299
+ if (e == null)
300
+ return "";
301
+ if (typeof e == "function")
302
+ return le(e, Ne(e));
303
+ if (typeof e == "string")
304
+ return Y(e);
305
+ switch (e) {
306
+ case _:
307
+ return Y("Suspense");
308
+ case h:
309
+ return Y("SuspenseList");
107
310
  }
108
- if (r) {
109
- r = console;
110
- var t = r.error, n = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
111
- return t.call(
112
- r,
113
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
114
- n
115
- ), c(e);
311
+ if (typeof e == "object")
312
+ switch (e.$$typeof) {
313
+ case u:
314
+ return Ue(e.render);
315
+ case g:
316
+ return V(e.type, r, t);
317
+ case w: {
318
+ var n = e, o = n._payload, s = n._init;
319
+ try {
320
+ return V(s(o), r, t);
321
+ } catch {
322
+ }
323
+ }
324
+ }
325
+ return "";
326
+ }
327
+ var F = Object.prototype.hasOwnProperty, ce = {}, fe = j.ReactDebugCurrentFrame;
328
+ function M(e) {
329
+ if (e) {
330
+ var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
331
+ fe.setExtraStackFrame(t);
332
+ } else
333
+ fe.setExtraStackFrame(null);
334
+ }
335
+ function qe(e, r, t, n, o) {
336
+ {
337
+ var s = Function.call.bind(F);
338
+ for (var i in e)
339
+ if (s(e, i)) {
340
+ var a = void 0;
341
+ try {
342
+ if (typeof e[i] != "function") {
343
+ var d = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
344
+ throw d.name = "Invariant Violation", d;
345
+ }
346
+ a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
347
+ } catch (l) {
348
+ a = l;
349
+ }
350
+ a && !(a instanceof Error) && (M(o), f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), M(null)), a instanceof Error && !(a.message in ce) && (ce[a.message] = !0, M(o), f("Failed %s type: %s", t, a.message), M(null));
351
+ }
352
+ }
353
+ }
354
+ var Je = Array.isArray;
355
+ function B(e) {
356
+ return Je(e);
357
+ }
358
+ function Be(e) {
359
+ {
360
+ var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
361
+ return t;
116
362
  }
117
363
  }
118
- function m(e) {
119
- if (e === A) return "<>";
120
- if (typeof e == "object" && e !== null && e.$$typeof === k)
121
- return "<...>";
364
+ function Ke(e) {
122
365
  try {
123
- var r = s(e);
124
- return r ? "<" + r + ">" : "<...>";
366
+ return de(e), !1;
125
367
  } catch {
126
- return "<...>";
368
+ return !0;
127
369
  }
128
370
  }
129
- function u() {
130
- var e = x.A;
131
- return e === null ? null : e.getOwner();
371
+ function de(e) {
372
+ return "" + e;
373
+ }
374
+ function ve(e) {
375
+ if (Ke(e))
376
+ return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Be(e)), de(e);
132
377
  }
133
- function l() {
134
- return Error("react-stack-top-frame");
378
+ var pe = j.ReactCurrentOwner, ze = {
379
+ key: !0,
380
+ ref: !0,
381
+ __self: !0,
382
+ __source: !0
383
+ }, he, ye;
384
+ function Ge(e) {
385
+ if (F.call(e, "ref")) {
386
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
387
+ if (r && r.isReactWarning)
388
+ return !1;
389
+ }
390
+ return e.ref !== void 0;
135
391
  }
136
- function d(e) {
137
- if (C.call(e, "key")) {
392
+ function Xe(e) {
393
+ if (F.call(e, "key")) {
138
394
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
139
- if (r && r.isReactWarning) return !1;
395
+ if (r && r.isReactWarning)
396
+ return !1;
140
397
  }
141
398
  return e.key !== void 0;
142
399
  }
143
- function i(e, r) {
144
- function t() {
145
- N || (N = !0, console.error(
146
- "%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
- r
148
- ));
400
+ function He(e, r) {
401
+ typeof e.ref == "string" && pe.current;
402
+ }
403
+ function Ze(e, r) {
404
+ {
405
+ var t = function() {
406
+ he || (he = !0, f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
407
+ };
408
+ t.isReactWarning = !0, Object.defineProperty(e, "key", {
409
+ get: t,
410
+ configurable: !0
411
+ });
412
+ }
413
+ }
414
+ function Qe(e, r) {
415
+ {
416
+ var t = function() {
417
+ ye || (ye = !0, f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
418
+ };
419
+ t.isReactWarning = !0, Object.defineProperty(e, "ref", {
420
+ get: t,
421
+ configurable: !0
422
+ });
149
423
  }
150
- t.isReactWarning = !0, Object.defineProperty(e, "key", {
151
- get: t,
152
- configurable: !0
153
- });
154
- }
155
- function o() {
156
- var e = s(this.type);
157
- return g[e] || (g[e] = !0, console.error(
158
- "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
- )), e = this.props.ref, e !== void 0 ? e : null;
160
- }
161
- function R(e, r, t, n, b, O) {
162
- var a = t.ref;
163
- return e = {
164
- $$typeof: j,
424
+ }
425
+ var er = function(e, r, t, n, o, s, i) {
426
+ var a = {
427
+ // This tag allows us to uniquely identify this as a React Element
428
+ $$typeof: E,
429
+ // Built-in properties that belong on the element
165
430
  type: e,
166
431
  key: r,
167
- props: t,
168
- _owner: n
169
- }, (a !== void 0 ? a : null) !== null ? Object.defineProperty(e, "ref", {
170
- enumerable: !1,
171
- get: o
172
- }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
173
- configurable: !1,
174
- enumerable: !1,
175
- writable: !0,
176
- value: 0
177
- }), Object.defineProperty(e, "_debugInfo", {
432
+ ref: t,
433
+ props: i,
434
+ // Record the component responsible for creating this element.
435
+ _owner: s
436
+ };
437
+ return a._store = {}, Object.defineProperty(a._store, "validated", {
178
438
  configurable: !1,
179
439
  enumerable: !1,
180
440
  writable: !0,
181
- value: null
182
- }), Object.defineProperty(e, "_debugStack", {
441
+ value: !1
442
+ }), Object.defineProperty(a, "_self", {
183
443
  configurable: !1,
184
444
  enumerable: !1,
185
- writable: !0,
186
- value: b
187
- }), Object.defineProperty(e, "_debugTask", {
445
+ writable: !1,
446
+ value: n
447
+ }), Object.defineProperty(a, "_source", {
188
448
  configurable: !1,
189
449
  enumerable: !1,
190
- writable: !0,
191
- value: O
192
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
193
- }
194
- function w(e, r, t, n, b, O) {
195
- var a = r.children;
196
- if (a !== void 0)
197
- if (n)
198
- if (Q(a)) {
199
- for (n = 0; n < a.length; n++)
200
- y(a[n]);
201
- Object.freeze && Object.freeze(a);
202
- } else
203
- console.error(
204
- "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
- );
206
- else y(a);
207
- if (C.call(r, "key")) {
208
- a = s(e);
209
- var _ = Object.keys(r).filter(function(K) {
210
- return K !== "key";
211
- });
212
- n = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", I[a + n] || (_ = 0 < _.length ? "{" + _.join(": ..., ") + ": ...}" : "{}", console.error(
213
- `A props object containing a "key" prop is being spread into JSX:
450
+ writable: !1,
451
+ value: o
452
+ }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
453
+ };
454
+ function rr(e, r, t, n, o) {
455
+ {
456
+ var s, i = {}, a = null, d = null;
457
+ t !== void 0 && (ve(t), a = "" + t), Xe(r) && (ve(r.key), a = "" + r.key), Ge(r) && (d = r.ref, He(r, o));
458
+ for (s in r)
459
+ F.call(r, s) && !ze.hasOwnProperty(s) && (i[s] = r[s]);
460
+ if (e && e.defaultProps) {
461
+ var l = e.defaultProps;
462
+ for (s in l)
463
+ i[s] === void 0 && (i[s] = l[s]);
464
+ }
465
+ if (a || d) {
466
+ var c = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
467
+ a && Ze(i, c), d && Qe(i, c);
468
+ }
469
+ return er(e, a, d, o, n, pe.current, i);
470
+ }
471
+ }
472
+ var K = j.ReactCurrentOwner, be = j.ReactDebugCurrentFrame;
473
+ function k(e) {
474
+ if (e) {
475
+ var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
476
+ be.setExtraStackFrame(t);
477
+ } else
478
+ be.setExtraStackFrame(null);
479
+ }
480
+ var z;
481
+ z = !1;
482
+ function G(e) {
483
+ return typeof e == "object" && e !== null && e.$$typeof === E;
484
+ }
485
+ function Ee() {
486
+ {
487
+ if (K.current) {
488
+ var e = T(K.current.type);
489
+ if (e)
490
+ return `
491
+
492
+ Check the render method of \`` + e + "`.";
493
+ }
494
+ return "";
495
+ }
496
+ }
497
+ function tr(e) {
498
+ return "";
499
+ }
500
+ var Re = {};
501
+ function nr(e) {
502
+ {
503
+ var r = Ee();
504
+ if (!r) {
505
+ var t = typeof e == "string" ? e : e.displayName || e.name;
506
+ t && (r = `
507
+
508
+ Check the top-level render call using <` + t + ">.");
509
+ }
510
+ return r;
511
+ }
512
+ }
513
+ function _e(e, r) {
514
+ {
515
+ if (!e._store || e._store.validated || e.key != null)
516
+ return;
517
+ e._store.validated = !0;
518
+ var t = nr(r);
519
+ if (Re[t])
520
+ return;
521
+ Re[t] = !0;
522
+ var n = "";
523
+ e && e._owner && e._owner !== K.current && (n = " It was passed a child from " + T(e._owner.type) + "."), k(e), f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), k(null);
524
+ }
525
+ }
526
+ function ge(e, r) {
527
+ {
528
+ if (typeof e != "object")
529
+ return;
530
+ if (B(e))
531
+ for (var t = 0; t < e.length; t++) {
532
+ var n = e[t];
533
+ G(n) && _e(n, r);
534
+ }
535
+ else if (G(e))
536
+ e._store && (e._store.validated = !0);
537
+ else if (e) {
538
+ var o = je(e);
539
+ if (typeof o == "function" && o !== e.entries)
540
+ for (var s = o.call(e), i; !(i = s.next()).done; )
541
+ G(i.value) && _e(i.value, r);
542
+ }
543
+ }
544
+ }
545
+ function ar(e) {
546
+ {
547
+ var r = e.type;
548
+ if (r == null || typeof r == "string")
549
+ return;
550
+ var t;
551
+ if (typeof r == "function")
552
+ t = r.propTypes;
553
+ else if (typeof r == "object" && (r.$$typeof === u || // Note: Memo only checks outer props here.
554
+ // Inner props are checked in the reconciler.
555
+ r.$$typeof === g))
556
+ t = r.propTypes;
557
+ else
558
+ return;
559
+ if (t) {
560
+ var n = T(r);
561
+ qe(t, e.props, "prop", n, e);
562
+ } else if (r.PropTypes !== void 0 && !z) {
563
+ z = !0;
564
+ var o = T(r);
565
+ f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
566
+ }
567
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
568
+ }
569
+ }
570
+ function ir(e) {
571
+ {
572
+ for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
573
+ var n = r[t];
574
+ if (n !== "children" && n !== "key") {
575
+ k(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), k(null);
576
+ break;
577
+ }
578
+ }
579
+ e.ref !== null && (k(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
580
+ }
581
+ }
582
+ var me = {};
583
+ function Te(e, r, t, n, o, s) {
584
+ {
585
+ var i = We(e);
586
+ if (!i) {
587
+ var a = "";
588
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
589
+ var d = tr();
590
+ d ? a += d : a += Ee();
591
+ var l;
592
+ e === null ? l = "null" : B(e) ? l = "array" : e !== void 0 && e.$$typeof === E ? (l = "<" + (T(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
593
+ }
594
+ var c = rr(e, r, t, o, s);
595
+ if (c == null)
596
+ return c;
597
+ if (i) {
598
+ var y = r.children;
599
+ if (y !== void 0)
600
+ if (n)
601
+ if (B(y)) {
602
+ for (var A = 0; A < y.length; A++)
603
+ ge(y[A], e);
604
+ Object.freeze && Object.freeze(y);
605
+ } else
606
+ f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
607
+ else
608
+ ge(y, e);
609
+ }
610
+ if (F.call(r, "key")) {
611
+ var P = T(e), v = Object.keys(r).filter(function(fr) {
612
+ return fr !== "key";
613
+ }), X = v.length > 0 ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}";
614
+ if (!me[P + X]) {
615
+ var cr = v.length > 0 ? "{" + v.join(": ..., ") + ": ...}" : "{}";
616
+ f(`A props object containing a "key" prop is being spread into JSX:
214
617
  let props = %s;
215
618
  <%s {...props} />
216
619
  React keys must be passed directly to JSX without using spread:
217
620
  let props = %s;
218
- <%s key={someKey} {...props} />`,
219
- n,
220
- a,
221
- _,
222
- a
223
- ), I[a + n] = !0);
224
- }
225
- if (a = null, t !== void 0 && (f(t), a = "" + t), d(r) && (f(r.key), a = "" + r.key), "key" in r) {
226
- t = {};
227
- for (var P in r)
228
- P !== "key" && (t[P] = r[P]);
229
- } else t = r;
230
- return a && i(
231
- t,
232
- typeof e == "function" ? e.displayName || e.name || "Unknown" : e
233
- ), R(
234
- e,
235
- a,
236
- t,
237
- u(),
238
- b,
239
- O
240
- );
241
- }
242
- function y(e) {
243
- S(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === k && (e._payload.status === "fulfilled" ? S(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
244
- }
245
- function S(e) {
246
- return typeof e == "object" && e !== null && e.$$typeof === j;
247
- }
248
- var v = ee, j = Symbol.for("react.transitional.element"), U = Symbol.for("react.portal"), A = Symbol.for("react.fragment"), W = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), z = Symbol.for("react.consumer"), J = Symbol.for("react.context"), V = Symbol.for("react.forward_ref"), G = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), x = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, C = Object.prototype.hasOwnProperty, Q = Array.isArray, h = console.createTask ? console.createTask : function() {
249
- return null;
250
- };
251
- v = {
252
- react_stack_bottom_frame: function(e) {
253
- return e();
621
+ <%s key={someKey} {...props} />`, X, P, cr, P), me[P + X] = !0;
622
+ }
623
+ }
624
+ return e === R ? ir(c) : ar(c), c;
254
625
  }
255
- };
256
- var N, g = {}, Y = v.react_stack_bottom_frame.bind(
257
- v,
258
- l
259
- )(), $ = h(m(l)), I = {};
260
- p.Fragment = A, p.jsx = function(e, r, t) {
261
- var n = 1e4 > x.recentlyCreatedOwnerStacks++;
262
- return w(
263
- e,
264
- r,
265
- t,
266
- !1,
267
- n ? Error("react-stack-top-frame") : Y,
268
- n ? h(m(e)) : $
269
- );
270
- }, p.jsxs = function(e, r, t) {
271
- var n = 1e4 > x.recentlyCreatedOwnerStacks++;
272
- return w(
273
- e,
274
- r,
275
- t,
276
- !0,
277
- n ? Error("react-stack-top-frame") : Y,
278
- n ? h(m(e)) : $
279
- );
280
- };
281
- })()), p;
626
+ }
627
+ function or(e, r, t) {
628
+ return Te(e, r, t, !0);
629
+ }
630
+ function ur(e, r, t) {
631
+ return Te(e, r, t, !1);
632
+ }
633
+ var sr = ur, lr = or;
634
+ $.Fragment = R, $.jsx = sr, $.jsxs = lr;
635
+ })()), $;
282
636
  }
283
- var L;
284
- function ue() {
285
- return L || (L = 1, process.env.NODE_ENV === "production" ? T.exports = oe() : T.exports = se()), T.exports;
637
+ var we;
638
+ function br() {
639
+ return we || (we = 1, process.env.NODE_ENV === "production" ? U.exports = hr() : U.exports = yr()), U.exports;
286
640
  }
287
- var le = ue();
288
- function ie({
289
- baseURL: s,
290
- getToken: c,
291
- timeoutMs: f = 15e3,
292
- axiosInstance: m,
293
- currency: u,
294
- lng: l,
295
- onError: d
641
+ var Er = br();
642
+ function Rr({
643
+ baseURL: b,
644
+ getToken: E,
645
+ timeoutMs: C = 15e3,
646
+ axiosInstance: R,
647
+ currency: O,
648
+ lng: S,
649
+ onError: m
296
650
  } = {}) {
297
- const i = m ?? ae.create({
298
- baseURL: s,
299
- timeout: f,
651
+ const p = R ?? pr.create({
652
+ baseURL: b,
653
+ timeout: C,
300
654
  headers: { "Content-Type": "application/json" }
301
655
  });
302
- return i.interceptors.request.use(async (o) => {
303
- if (c) {
304
- const R = await c();
305
- R && (o.headers = o.headers || {}, o.headers.Authorization = `Bearer ${R}`);
306
- }
307
- return o;
308
- }), i.interceptors.request.use((o) => {
309
- o.headers.Currency = u, o.headers["currency-code"] = u, o.headers.lang = l;
310
- }), i.interceptors.response.use(
311
- (o) => o,
312
- (o) => d ? d(o, { instance: i }) : Promise.reject(o)
313
- ), i;
656
+ return p.interceptors.request.use(async (u) => {
657
+ if (E) {
658
+ const _ = await E();
659
+ _ && (u.headers = u.headers || {}, u.headers.Authorization = `Bearer ${_}`);
660
+ }
661
+ return u;
662
+ }), p.interceptors.request.use((u) => {
663
+ u.headers.Currency = O, u.headers["currency-code"] = O, u.headers.lang = S;
664
+ }), p.interceptors.response.use(
665
+ (u) => u,
666
+ (u) => m ? m(u, { instance: p }) : Promise.reject(u)
667
+ ), p;
314
668
  }
315
- function _e({ children: s, ...c }) {
316
- const f = ne(() => ie(c), [c]);
317
- return /* @__PURE__ */ le.jsx(M.Provider, { value: { client: f }, children: s });
669
+ function Or({ children: b, ...E }) {
670
+ const C = {
671
+ recentlyCreatedOwnerStacks: []
672
+ // 其他 API 相關狀態...
673
+ }, R = vr(() => Rr(E), [E]);
674
+ return /* @__PURE__ */ Er.jsx(H.Provider, { value: { client: R, ...C }, children: b });
318
675
  }
319
676
  export {
320
- M as ApiCtx,
321
- _e as ApiProvider,
322
- me as useApiContext
677
+ H as ApiCtx,
678
+ Or as ApiProvider,
679
+ Tr as useApiContext,
680
+ Cr as useApiContextSafe
323
681
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@obb871001/api-integration-sdk",
3
3
  "private": false,
4
- "version": "1.0.13",
4
+ "version": "1.0.15",
5
5
  "description": "集成API",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.js",
@@ -57,15 +57,15 @@
57
57
  "@eslint/js": "^9.36.0",
58
58
  "@tanstack/react-query": "^5.90.5",
59
59
  "@tanstack/react-query-devtools": "^5.90.2",
60
- "@types/react": "^19.1.16",
61
- "@types/react-dom": "^19.1.9",
60
+ "@types/react": "^18.3.3",
61
+ "@types/react-dom": "^18.3.0",
62
62
  "@vitejs/plugin-react": "^5.0.4",
63
63
  "eslint": "^9.36.0",
64
64
  "eslint-plugin-react-hooks": "^5.2.0",
65
65
  "eslint-plugin-react-refresh": "^0.4.22",
66
66
  "globals": "^16.4.0",
67
- "react": "^19.1.1",
68
- "react-dom": "^19.1.1",
67
+ "react": "^18.3.1",
68
+ "react-dom": "^18.3.1",
69
69
  "vite": "^7.1.7"
70
70
  }
71
71
  }