@a-tech.jo/atech_payment 1.0.16 → 1.0.18
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.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.LICENSE.txt +1 -0
- package/dist/src/config.d.ts +13 -0
- package/dist/src/config.d.ts.map +1 -0
- package/dist/src/hyperpay/hyperpayOrder.d.ts +5 -0
- package/dist/src/hyperpay/hyperpayOrder.d.ts.map +1 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/meps/mepsOrder.d.ts +5 -0
- package/dist/src/meps/mepsOrder.d.ts.map +1 -0
- package/dist/src/network/networkOrder.d.ts +5 -0
- package/dist/src/network/networkOrder.d.ts.map +1 -0
- package/dist/src/paypal/paypalOrder.d.ts +5 -0
- package/dist/src/paypal/paypalOrder.d.ts.map +1 -0
- package/dist/src/shared/config.d.ts +7 -0
- package/dist/src/shared/config.d.ts.map +1 -0
- package/dist/src/shared/requests/backendConnector.d.ts +9 -0
- package/dist/src/shared/requests/backendConnector.d.ts.map +1 -0
- package/dist/src/shared/requests/stripeConnector.d.ts +13 -0
- package/dist/src/shared/requests/stripeConnector.d.ts.map +1 -0
- package/dist/src/stripe/stripeOrder.d.ts +5 -0
- package/dist/src/stripe/stripeOrder.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +70 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/tsup.config.d.ts +3 -0
- package/dist/tsup.config.d.ts.map +1 -0
- package/package.json +27 -19
- package/.babelrc +0 -4
- package/.env.example +0 -1
- package/build/index.js +0 -2
- package/build/index.js.LICENSE.txt +0 -11
- package/documentation/hyperpay.md +0 -18
- package/example/hyperpay/requests/createOrder.json +0 -37
- package/example/hyperpay/use.js +0 -0
- package/example/paypal.js +0 -0
- package/index.html +0 -12
- package/index.js +0 -45
- package/src/hyperpay/hyperpayOrder.js +0 -100
- package/src/paypal/buttonWrapper.js +0 -76
- package/src/paypal/paypalOrder.js +0 -33
- package/src/shared/config.js +0 -20
- package/src/shared/paypalService.js +0 -16
- package/src/shared/requests/backendConnector.js +0 -24
- package/src/shared/requests/hyperpayConnector.js +0 -56
- package/src/shared/requests/request.js +0 -92
- package/webpack.config.js +0 -47
package/build/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
(()=>{"use strict";var t={287:(t,e)=>{var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.iterator,d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,m={};function v(t,e,r){this.props=t,this.context=e,this.refs=m,this.updater=r||d}function b(){}function g(t,e,r){this.props=t,this.context=e,this.refs=m,this.updater=r||d}v.prototype.isReactComponent={},v.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")},v.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},b.prototype=v.prototype;var w=g.prototype=new b;w.constructor=g,y(w,v.prototype),w.isPureReactComponent=!0;var E=Array.isArray,O=Object.prototype.hasOwnProperty,S={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function x(t,e,n){var o,i={},a=null,s=null;if(null!=e)for(o in void 0!==e.ref&&(s=e.ref),void 0!==e.key&&(a=""+e.key),e)O.call(e,o)&&!R.hasOwnProperty(o)&&(i[o]=e[o]);var c=arguments.length-2;if(1===c)i.children=n;else if(1<c){for(var u=Array(c),l=0;l<c;l++)u[l]=arguments[l+2];i.children=u}if(t&&t.defaultProps)for(o in c=t.defaultProps)void 0===i[o]&&(i[o]=c[o]);return{$$typeof:r,type:t,key:a,ref:s,props:i,_owner:S.current}}function P(t){return"object"==typeof t&&null!==t&&t.$$typeof===r}var j=/\/+/g;function _(t,e){return"object"==typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,(function(t){return e[t]}))}(""+t.key):e.toString(36)}function T(t,e,o,i,a){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var c=!1;if(null===t)c=!0;else switch(s){case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case r:case n:c=!0}}if(c)return a=a(c=t),t=""===i?"."+_(c,0):i,E(a)?(o="",null!=t&&(o=t.replace(j,"$&/")+"/"),T(a,e,o,"",(function(t){return t}))):null!=a&&(P(a)&&(a=function(t,e){return{$$typeof:r,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}(a,o+(!a.key||c&&c.key===a.key?"":(""+a.key).replace(j,"$&/")+"/")+t)),e.push(a)),1;if(c=0,i=""===i?".":i+":",E(t))for(var u=0;u<t.length;u++){var l=i+_(s=t[u],u);c+=T(s,e,o,l,a)}else if(l=function(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=h&&t[h]||t["@@iterator"])?t:null}(t),"function"==typeof l)for(t=l.call(t),u=0;!(s=t.next()).done;)c+=T(s=s.value,e,o,l=i+_(s,u++),a);else if("object"===s)throw e=String(t),Error("Objects are not valid as a React child (found: "+("[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return c}function L(t,e,r){if(null==t)return t;var n=[],o=0;return T(t,n,"","",(function(t){return e.call(r,t,o++)})),n}function N(t){if(-1===t._status){var e=t._result;(e=e()).then((function(e){0!==t._status&&-1!==t._status||(t._status=1,t._result=e)}),(function(e){0!==t._status&&-1!==t._status||(t._status=2,t._result=e)})),-1===t._status&&(t._status=0,t._result=e)}if(1===t._status)return t._result.default;throw t._result}var A={current:null},k={transition:null},C={ReactCurrentDispatcher:A,ReactCurrentBatchConfig:k,ReactCurrentOwner:S};e.Children={map:L,forEach:function(t,e,r){L(t,(function(){e.apply(this,arguments)}),r)},count:function(t){var e=0;return L(t,(function(){e++})),e},toArray:function(t){return L(t,(function(t){return t}))||[]},only:function(t){if(!P(t))throw Error("React.Children.only expected to receive a single React element child.");return t}},e.Component=v,e.Fragment=o,e.Profiler=a,e.PureComponent=g,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=C,e.cloneElement=function(t,e,n){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var o=y({},t.props),i=t.key,a=t.ref,s=t._owner;if(null!=e){if(void 0!==e.ref&&(a=e.ref,s=S.current),void 0!==e.key&&(i=""+e.key),t.type&&t.type.defaultProps)var c=t.type.defaultProps;for(u in e)O.call(e,u)&&!R.hasOwnProperty(u)&&(o[u]=void 0===e[u]&&void 0!==c?c[u]:e[u])}var u=arguments.length-2;if(1===u)o.children=n;else if(1<u){c=Array(u);for(var l=0;l<u;l++)c[l]=arguments[l+2];o.children=c}return{$$typeof:r,type:t.type,key:i,ref:a,props:o,_owner:s}},e.createContext=function(t){return(t={$$typeof:c,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:t},t.Consumer=t},e.createElement=x,e.createFactory=function(t){var e=x.bind(null,t);return e.type=t,e},e.createRef=function(){return{current:null}},e.forwardRef=function(t){return{$$typeof:u,render:t}},e.isValidElement=P,e.lazy=function(t){return{$$typeof:p,_payload:{_status:-1,_result:t},_init:N}},e.memo=function(t,e){return{$$typeof:f,type:t,compare:void 0===e?null:e}},e.startTransition=function(t){var e=k.transition;k.transition={};try{t()}finally{k.transition=e}},e.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},e.useCallback=function(t,e){return A.current.useCallback(t,e)},e.useContext=function(t){return A.current.useContext(t)},e.useDebugValue=function(){},e.useDeferredValue=function(t){return A.current.useDeferredValue(t)},e.useEffect=function(t,e){return A.current.useEffect(t,e)},e.useId=function(){return A.current.useId()},e.useImperativeHandle=function(t,e,r){return A.current.useImperativeHandle(t,e,r)},e.useInsertionEffect=function(t,e){return A.current.useInsertionEffect(t,e)},e.useLayoutEffect=function(t,e){return A.current.useLayoutEffect(t,e)},e.useMemo=function(t,e){return A.current.useMemo(t,e)},e.useReducer=function(t,e,r){return A.current.useReducer(t,e,r)},e.useRef=function(t){return A.current.useRef(t)},e.useState=function(t){return A.current.useState(t)},e.useSyncExternalStore=function(t,e,r){return A.current.useSyncExternalStore(t,e,r)},e.useTransition=function(){return A.current.useTransition()},e.version="18.2.0"},540:(t,e,r)=>{t.exports=r(287)}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={};r.r(t),r.d(t,{hasBrowserEnv:()=>bt,hasStandardBrowserEnv:()=>wt,hasStandardBrowserWebWorkerEnv:()=>Et,navigator:()=>gt,origin:()=>Ot});var e=r(540);function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s={NODE_ENV:"staging",BACKEND_BASE_URL:"http://localhost:5000/api",HYPERPAY_BASE_URL:"https://eu-test.oppwa.com/"};const c=s=i(i({},s),{BACKEND_BASE_URL:"https://stage.payment.atech-workspace.com/api"});function u(t,e){return function(){return t.apply(e,arguments)}}const{toString:l}=Object.prototype,{getPrototypeOf:f}=Object,p=(h=Object.create(null),t=>{const e=l.call(t);return h[e]||(h[e]=e.slice(8,-1).toLowerCase())});var h;const d=t=>(t=t.toLowerCase(),e=>p(e)===t),y=t=>e=>typeof e===t,{isArray:m}=Array,v=y("undefined"),b=d("ArrayBuffer"),g=y("string"),w=y("function"),E=y("number"),O=t=>null!==t&&"object"==typeof t,S=t=>{if("object"!==p(t))return!1;const e=f(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},R=d("Date"),x=d("File"),P=d("Blob"),j=d("FileList"),_=d("URLSearchParams"),[T,L,N,A]=["ReadableStream","Request","Response","Headers"].map(d);function k(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),m(t))for(n=0,o=t.length;n<o;n++)e.call(null,t[n],n,t);else{const o=r?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let a;for(n=0;n<i;n++)a=o[n],e.call(null,t[a],a,t)}}function C(t,e){e=e.toLowerCase();const r=Object.keys(t);let n,o=r.length;for(;o-- >0;)if(n=r[o],e===n.toLowerCase())return n;return null}const F="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,D=t=>!v(t)&&t!==F,B=(U="undefined"!=typeof Uint8Array&&f(Uint8Array),t=>U&&t instanceof U);var U;const I=d("HTMLFormElement"),q=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),M=d("RegExp"),G=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};k(r,((r,o)=>{let i;!1!==(i=e(r,o,t))&&(n[o]=i||r)})),Object.defineProperties(t,n)},H="abcdefghijklmnopqrstuvwxyz",$="0123456789",z={DIGIT:$,ALPHA:H,ALPHA_DIGIT:H+H.toUpperCase()+$},V=d("AsyncFunction"),K=(J="function"==typeof setImmediate,W=w(F.postMessage),J?setImmediate:W?(Y=`axios@${Math.random()}`,X=[],F.addEventListener("message",(({source:t,data:e})=>{t===F&&e===Y&&X.length&&X.shift()()}),!1),t=>{X.push(t),F.postMessage(Y,"*")}):t=>setTimeout(t));var J,W,Y,X;const Q="undefined"!=typeof queueMicrotask?queueMicrotask.bind(F):"undefined"!=typeof process&&process.nextTick||K,Z={isArray:m,isArrayBuffer:b,isBuffer:function(t){return null!==t&&!v(t)&&null!==t.constructor&&!v(t.constructor)&&w(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||w(t.append)&&("formdata"===(e=p(t))||"object"===e&&w(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&b(t.buffer),e},isString:g,isNumber:E,isBoolean:t=>!0===t||!1===t,isObject:O,isPlainObject:S,isReadableStream:T,isRequest:L,isResponse:N,isHeaders:A,isUndefined:v,isDate:R,isFile:x,isBlob:P,isRegExp:M,isFunction:w,isStream:t=>O(t)&&w(t.pipe),isURLSearchParams:_,isTypedArray:B,isFileList:j,forEach:k,merge:function t(){const{caseless:e}=D(this)&&this||{},r={},n=(n,o)=>{const i=e&&C(r,o)||o;S(r[i])&&S(n)?r[i]=t(r[i],n):S(n)?r[i]=t({},n):m(n)?r[i]=n.slice():r[i]=n};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&k(arguments[t],n);return r},extend:(t,e,r,{allOwnKeys:n}={})=>(k(e,((e,n)=>{r&&w(e)?t[n]=u(e,r):t[n]=e}),{allOwnKeys:n}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},toFlatObject:(t,e,r,n)=>{let o,i,a;const s={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)a=o[i],n&&!n(a,t,e)||s[a]||(e[a]=t[a],s[a]=!0);t=!1!==r&&f(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:p,kindOfTest:d,endsWith:(t,e,r)=>{t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return-1!==n&&n===r},toArray:t=>{if(!t)return null;if(m(t))return t;let e=t.length;if(!E(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},forEachEntry:(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let n;for(;(n=r.next())&&!n.done;){const r=n.value;e.call(t,r[0],r[1])}},matchAll:(t,e)=>{let r;const n=[];for(;null!==(r=t.exec(e));)n.push(r);return n},isHTMLForm:I,hasOwnProperty:q,hasOwnProp:q,reduceDescriptors:G,freezeMethods:t=>{G(t,((e,r)=>{if(w(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];w(n)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(t,e)=>{const r={},n=t=>{t.forEach((t=>{r[t]=!0}))};return m(t)?n(t):n(String(t).split(e)),r},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,r){return e.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:C,global:F,isContextDefined:D,ALPHABET:z,generateString:(t=16,e=z.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r},isSpecCompliantForm:function(t){return!!(t&&w(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(O(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=m(t)?[]:{};return k(t,((t,e)=>{const i=r(t,n+1);!v(i)&&(o[e]=i)})),e[n]=void 0,o}}return t};return r(t,0)},isAsyncFn:V,isThenable:t=>t&&(O(t)||w(t))&&w(t.then)&&w(t.catch),setImmediate:K,asap:Q};function tt(t,e,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}Z.inherits(tt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Z.toJSONObject(this.config),code:this.code,status:this.status}}});const et=tt.prototype,rt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{rt[t]={value:t}})),Object.defineProperties(tt,rt),Object.defineProperty(et,"isAxiosError",{value:!0}),tt.from=(t,e,r,n,o,i)=>{const a=Object.create(et);return Z.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),tt.call(a,t.message,e,r,n,o),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const nt=tt;function ot(t){return Z.isPlainObject(t)||Z.isArray(t)}function it(t){return Z.endsWith(t,"[]")?t.slice(0,-2):t}function at(t,e,r){return t?t.concat(e).map((function(t,e){return t=it(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const st=Z.toFlatObject(Z,{},null,(function(t){return/^is[A-Z]/.test(t)})),ct=function(t,e,r){if(!Z.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=Z.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!Z.isUndefined(e[t])}))).metaTokens,o=r.visitor||u,i=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Z.isSpecCompliantForm(e);if(!Z.isFunction(o))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(Z.isDate(t))return t.toISOString();if(!s&&Z.isBlob(t))throw new nt("Blob is not supported. Use a Buffer instead.");return Z.isArrayBuffer(t)||Z.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,r,o){let s=t;if(t&&!o&&"object"==typeof t)if(Z.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(Z.isArray(t)&&function(t){return Z.isArray(t)&&!t.some(ot)}(t)||(Z.isFileList(t)||Z.endsWith(r,"[]"))&&(s=Z.toArray(t)))return r=it(r),s.forEach((function(t,n){!Z.isUndefined(t)&&null!==t&&e.append(!0===a?at([r],n,i):null===a?r:r+"[]",c(t))})),!1;return!!ot(t)||(e.append(at(o,r,i),c(t)),!1)}const l=[],f=Object.assign(st,{defaultVisitor:u,convertValue:c,isVisitable:ot});if(!Z.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!Z.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),Z.forEach(r,(function(r,i){!0===(!(Z.isUndefined(r)||null===r)&&o.call(e,r,Z.isString(i)?i.trim():i,n,f))&&t(r,n?n.concat(i):[i])})),l.pop()}}(t),e};function ut(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function lt(t,e){this._pairs=[],t&&ct(t,this,e)}const ft=lt.prototype;ft.append=function(t,e){this._pairs.push([t,e])},ft.toString=function(t){const e=t?function(e){return t.call(this,e,ut)}:ut;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const pt=lt;function ht(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function dt(t,e,r){if(!e)return t;const n=r&&r.encode||ht,o=r&&r.serialize;let i;if(i=o?o(e,r):Z.isURLSearchParams(e)?e.toString():new pt(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const yt=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Z.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},mt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},vt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:pt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},bt="undefined"!=typeof window&&"undefined"!=typeof document,gt="object"==typeof navigator&&navigator||void 0,wt=bt&&(!gt||["ReactNative","NativeScript","NS"].indexOf(gt.product)<0),Et="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ot=bt&&window.location.href||"http://localhost",St={...t,...vt},Rt=function(t){function e(t,r,n,o){let i=t[o++];if("__proto__"===i)return!0;const a=Number.isFinite(+i),s=o>=t.length;return i=!i&&Z.isArray(n)?n.length:i,s?(Z.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a):(n[i]&&Z.isObject(n[i])||(n[i]=[]),e(t,r,n[i],o)&&Z.isArray(n[i])&&(n[i]=function(t){const e={},r=Object.keys(t);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],e[i]=t[i];return e}(n[i])),!a)}if(Z.isFormData(t)&&Z.isFunction(t.entries)){const r={};return Z.forEachEntry(t,((t,n)=>{e(function(t){return Z.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,r,0)})),r}return null},xt={transitional:mt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,o=Z.isObject(t);if(o&&Z.isHTMLForm(t)&&(t=new FormData(t)),Z.isFormData(t))return n?JSON.stringify(Rt(t)):t;if(Z.isArrayBuffer(t)||Z.isBuffer(t)||Z.isStream(t)||Z.isFile(t)||Z.isBlob(t)||Z.isReadableStream(t))return t;if(Z.isArrayBufferView(t))return t.buffer;if(Z.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return ct(t,new St.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return St.isNode&&Z.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=Z.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return ct(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,r){if(Z.isString(t))try{return(0,JSON.parse)(t),Z.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||xt.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(Z.isResponse(t)||Z.isReadableStream(t))return t;if(t&&Z.isString(t)&&(r&&!this.responseType||n)){const r=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw nt.from(t,nt.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:St.classes.FormData,Blob:St.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(["delete","get","head","post","put","patch"],(t=>{xt.headers[t]={}}));const Pt=xt,jt=Z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),_t=Symbol("internals");function Tt(t){return t&&String(t).trim().toLowerCase()}function Lt(t){return!1===t||null==t?t:Z.isArray(t)?t.map(Lt):String(t)}function Nt(t,e,r,n,o){return Z.isFunction(n)?n.call(this,e,r):(o&&(e=r),Z.isString(e)?Z.isString(n)?-1!==e.indexOf(n):Z.isRegExp(n)?n.test(e):void 0:void 0)}class At{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=Tt(e);if(!o)throw new Error("header name must be a non-empty string");const i=Z.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||e]=Lt(t))}const i=(t,e)=>Z.forEach(t,((t,r)=>o(t,r,e)));if(Z.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(Z.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))i((t=>{const e={};let r,n,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),r=t.substring(0,o).trim().toLowerCase(),n=t.substring(o+1).trim(),!r||e[r]&&jt[r]||("set-cookie"===r?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)})),e})(t),e);else if(Z.isHeaders(t))for(const[e,n]of t.entries())o(n,e,r);else null!=t&&o(e,t,r);return this}get(t,e){if(t=Tt(t)){const r=Z.findKey(this,t);if(r){const t=this[r];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}(t);if(Z.isFunction(e))return e.call(this,t,r);if(Z.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Tt(t)){const r=Z.findKey(this,t);return!(!r||void 0===this[r]||e&&!Nt(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function o(t){if(t=Tt(t)){const o=Z.findKey(r,t);!o||e&&!Nt(0,r[o],o,e)||(delete r[o],n=!0)}}return Z.isArray(t)?t.forEach(o):o(t),n}clear(t){const e=Object.keys(this);let r=e.length,n=!1;for(;r--;){const o=e[r];t&&!Nt(0,this[o],o,t,!0)||(delete this[o],n=!0)}return n}normalize(t){const e=this,r={};return Z.forEach(this,((n,o)=>{const i=Z.findKey(r,o);if(i)return e[i]=Lt(n),void delete e[o];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,r)=>e.toUpperCase()+r))}(o):String(o).trim();a!==o&&delete e[o],e[a]=Lt(n),r[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return Z.forEach(this,((r,n)=>{null!=r&&!1!==r&&(e[n]=t&&Z.isArray(r)?r.join(", "):r)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const r=new this(t);return e.forEach((t=>r.set(t))),r}static accessor(t){const e=(this[_t]=this[_t]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=Tt(t);e[n]||(function(t,e){const r=Z.toCamelCase(" "+e);["get","set","has"].forEach((n=>{Object.defineProperty(t,n+r,{value:function(t,r,o){return this[n].call(this,e,t,r,o)},configurable:!0})}))}(r,t),e[n]=!0)}return Z.isArray(t)?t.forEach(n):n(t),this}}At.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Z.reduceDescriptors(At.prototype,(({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}})),Z.freezeMethods(At);const kt=At;function Ct(t,e){const r=this||Pt,n=e||r,o=kt.from(n.headers);let i=n.data;return Z.forEach(t,(function(t){i=t.call(r,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function Ft(t){return!(!t||!t.__CANCEL__)}function Dt(t,e,r){nt.call(this,null==t?"canceled":t,nt.ERR_CANCELED,e,r),this.name="CanceledError"}Z.inherits(Dt,nt,{__CANCEL__:!0});const Bt=Dt;function Ut(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new nt("Request failed with status code "+r.status,[nt.ERR_BAD_REQUEST,nt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}const It=(t,e,r=3)=>{let n=0;const o=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o,i=0,a=0;return e=void 0!==e?e:1e3,function(s){const c=Date.now(),u=n[a];o||(o=c),r[i]=s,n[i]=c;let l=a,f=0;for(;l!==i;)f+=r[l++],l%=t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),c-o<e)return;const p=u&&c-u;return p?Math.round(1e3*f/p):void 0}}(50,250);return function(t,e){let r,n,o=0,i=1e3/e;const a=(e,i=Date.now())=>{o=i,r=null,n&&(clearTimeout(n),n=null),t.apply(null,e)};return[(...t)=>{const e=Date.now(),s=e-o;s>=i?a(t,e):(r=t,n||(n=setTimeout((()=>{n=null,a(r)}),i-s)))},()=>r&&a(r)]}((r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,s=i-n,c=o(s);n=i,t({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:r,lengthComputable:null!=a,[e?"download":"upload"]:!0})}),r)},qt=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},Mt=t=>(...e)=>Z.asap((()=>t(...e))),Gt=St.hasStandardBrowserEnv?function(){const t=St.navigator&&/(msie|trident)/i.test(St.navigator.userAgent),e=document.createElement("a");let r;function n(r){let n=r;return t&&(e.setAttribute("href",n),n=e.href),e.setAttribute("href",n),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return r=n(window.location.href),function(t){const e=Z.isString(t)?n(t):t;return e.protocol===r.protocol&&e.host===r.host}}():function(){return!0},Ht=St.hasStandardBrowserEnv?{write(t,e,r,n,o,i){const a=[t+"="+encodeURIComponent(e)];Z.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),Z.isString(n)&&a.push("path="+n),Z.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function $t(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const zt=t=>t instanceof kt?{...t}:t;function Vt(t,e){e=e||{};const r={};function n(t,e,r){return Z.isPlainObject(t)&&Z.isPlainObject(e)?Z.merge.call({caseless:r},t,e):Z.isPlainObject(e)?Z.merge({},e):Z.isArray(e)?e.slice():e}function o(t,e,r){return Z.isUndefined(e)?Z.isUndefined(t)?void 0:n(void 0,t,r):n(t,e,r)}function i(t,e){if(!Z.isUndefined(e))return n(void 0,e)}function a(t,e){return Z.isUndefined(e)?Z.isUndefined(t)?void 0:n(void 0,t):n(void 0,e)}function s(r,o,i){return i in e?n(r,o):i in t?n(void 0,r):void 0}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(t,e)=>o(zt(t),zt(e),!0)};return Z.forEach(Object.keys(Object.assign({},t,e)),(function(n){const i=c[n]||o,a=i(t[n],e[n],n);Z.isUndefined(a)&&i!==s||(r[n]=a)})),r}const Kt=t=>{const e=Vt({},t);let r,{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:c}=e;if(e.headers=s=kt.from(s),e.url=dt($t(e.baseURL,e.url),t.params,t.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),Z.isFormData(n))if(St.hasStandardBrowserEnv||St.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(r=s.getContentType())){const[t,...e]=r?r.split(";").map((t=>t.trim())).filter(Boolean):[];s.setContentType([t||"multipart/form-data",...e].join("; "))}if(St.hasStandardBrowserEnv&&(o&&Z.isFunction(o)&&(o=o(e)),o||!1!==o&&Gt(e.url))){const t=i&&a&&Ht.read(a);t&&s.set(i,t)}return e},Jt="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){const n=Kt(t);let o=n.data;const i=kt.from(n.headers).normalize();let a,s,c,u,l,{responseType:f,onUploadProgress:p,onDownloadProgress:h}=n;function d(){u&&u(),l&&l(),n.cancelToken&&n.cancelToken.unsubscribe(a),n.signal&&n.signal.removeEventListener("abort",a)}let y=new XMLHttpRequest;function m(){if(!y)return;const n=kt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Ut((function(t){e(t),d()}),(function(t){r(t),d()}),{data:f&&"text"!==f&&"json"!==f?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:n,config:t,request:y}),y=null}y.open(n.method.toUpperCase(),n.url,!0),y.timeout=n.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(r(new nt("Request aborted",nt.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new nt("Network Error",nt.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let e=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const o=n.transitional||mt;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new nt(e,o.clarifyTimeoutError?nt.ETIMEDOUT:nt.ECONNABORTED,t,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&Z.forEach(i.toJSON(),(function(t,e){y.setRequestHeader(e,t)})),Z.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),f&&"json"!==f&&(y.responseType=n.responseType),h&&([c,l]=It(h,!0),y.addEventListener("progress",c)),p&&y.upload&&([s,u]=It(p),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(a=e=>{y&&(r(!e||e.type?new Bt(null,t,y):e),y.abort(),y=null)},n.cancelToken&&n.cancelToken.subscribe(a),n.signal&&(n.signal.aborted?a():n.signal.addEventListener("abort",a)));const v=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);v&&-1===St.protocols.indexOf(v)?r(new nt("Unsupported protocol "+v+":",nt.ERR_BAD_REQUEST,t)):y.send(o||null)}))},Wt=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let r,n=new AbortController;const o=function(t){if(!r){r=!0,a();const e=t instanceof Error?t:this.reason;n.abort(e instanceof nt?e:new Bt(e instanceof Error?e.message:e))}};let i=e&&setTimeout((()=>{i=null,o(new nt(`timeout ${e} of ms exceeded`,nt.ETIMEDOUT))}),e);const a=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((t=>t.addEventListener("abort",o)));const{signal:s}=n;return s.unsubscribe=()=>Z.asap(a),s}},Yt=function*(t,e){let r=t.byteLength;if(!e||r<e)return void(yield t);let n,o=0;for(;o<r;)n=o+e,yield t.slice(o,n),o=n},Xt=(t,e,r,n)=>{const o=async function*(t,e){for await(const r of async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}}(t))yield*Yt(r,e)}(t,e);let i,a=0,s=t=>{i||(i=!0,n&&n(t))};return new ReadableStream({async pull(t){try{const{done:e,value:n}=await o.next();if(e)return s(),void t.close();let i=n.byteLength;if(r){let t=a+=i;r(t)}t.enqueue(new Uint8Array(n))}catch(t){throw s(t),t}},cancel:t=>(s(t),o.return())},{highWaterMark:2})},Qt="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,Zt=Qt&&"function"==typeof ReadableStream,te=Qt&&("function"==typeof TextEncoder?(ee=new TextEncoder,t=>ee.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var ee;const re=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},ne=Zt&&re((()=>{let t=!1;const e=new Request(St.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),oe=Zt&&re((()=>Z.isReadableStream(new Response("").body))),ie={stream:oe&&(t=>t.body)};var ae;Qt&&(ae=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!ie[t]&&(ie[t]=Z.isFunction(ae[t])?e=>e[t]():(e,r)=>{throw new nt(`Response type '${t}' is not supported`,nt.ERR_NOT_SUPPORT,r)})})));const se=Qt&&(async t=>{let{url:e,method:r,data:n,signal:o,cancelToken:i,timeout:a,onDownloadProgress:s,onUploadProgress:c,responseType:u,headers:l,withCredentials:f="same-origin",fetchOptions:p}=Kt(t);u=u?(u+"").toLowerCase():"text";let h,d=Wt([o,i&&i.toAbortSignal()],a);const y=d&&d.unsubscribe&&(()=>{d.unsubscribe()});let m;try{if(c&&ne&&"get"!==r&&"head"!==r&&0!==(m=await(async(t,e)=>{const r=Z.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(Z.isBlob(t))return t.size;if(Z.isSpecCompliantForm(t)){const e=new Request(St.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return Z.isArrayBufferView(t)||Z.isArrayBuffer(t)?t.byteLength:(Z.isURLSearchParams(t)&&(t+=""),Z.isString(t)?(await te(t)).byteLength:void 0)})(e):r})(l,n))){let t,r=new Request(e,{method:"POST",body:n,duplex:"half"});if(Z.isFormData(n)&&(t=r.headers.get("content-type"))&&l.setContentType(t),r.body){const[t,e]=qt(m,It(Mt(c)));n=Xt(r.body,65536,t,e)}}Z.isString(f)||(f=f?"include":"omit");const o="credentials"in Request.prototype;h=new Request(e,{...p,signal:d,method:r.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:o?f:void 0});let i=await fetch(h);const a=oe&&("stream"===u||"response"===u);if(oe&&(s||a&&y)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=i[e]}));const e=Z.toFiniteNumber(i.headers.get("content-length")),[r,n]=s&&qt(e,It(Mt(s),!0))||[];i=new Response(Xt(i.body,65536,r,(()=>{n&&n(),y&&y()})),t)}u=u||"text";let v=await ie[Z.findKey(ie,u)||"text"](i,t);return!a&&y&&y(),await new Promise(((e,r)=>{Ut(e,r,{data:v,headers:kt.from(i.headers),status:i.status,statusText:i.statusText,config:t,request:h})}))}catch(e){if(y&&y(),e&&"TypeError"===e.name&&/fetch/i.test(e.message))throw Object.assign(new nt("Network Error",nt.ERR_NETWORK,t,h),{cause:e.cause||e});throw nt.from(e,e&&e.code,t,h)}}),ce={http:null,xhr:Jt,fetch:se};Z.forEach(ce,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const ue=t=>`- ${t}`,le=t=>Z.isFunction(t)||null===t||!1===t,fe=t=>{t=Z.isArray(t)?t:[t];const{length:e}=t;let r,n;const o={};for(let i=0;i<e;i++){let e;if(r=t[i],n=r,!le(r)&&(n=ce[(e=String(r)).toLowerCase()],void 0===n))throw new nt(`Unknown adapter '${e}'`);if(n)break;o[e||"#"+i]=n}if(!n){const t=Object.entries(o).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let r=e?t.length>1?"since :\n"+t.map(ue).join("\n"):" "+ue(t[0]):"as no adapter specified";throw new nt("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return n};function pe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Bt(null,t)}function he(t){return pe(t),t.headers=kt.from(t.headers),t.data=Ct.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),fe(t.adapter||Pt.adapter)(t).then((function(e){return pe(t),e.data=Ct.call(t,t.transformResponse,e),e.headers=kt.from(e.headers),e}),(function(e){return Ft(e)||(pe(t),e&&e.response&&(e.response.data=Ct.call(t,t.transformResponse,e.response),e.response.headers=kt.from(e.response.headers))),Promise.reject(e)}))}const de={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{de[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const ye={};de.transitional=function(t,e,r){function n(t,e){return"[Axios v1.7.7] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(r,o,i)=>{if(!1===t)throw new nt(n(o," has been removed"+(e?" in "+e:"")),nt.ERR_DEPRECATED);return e&&!ye[o]&&(ye[o]=!0,console.warn(n(o," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(r,o,i)}};const me={assertOptions:function(t,e,r){if("object"!=typeof t)throw new nt("options must be an object",nt.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let o=n.length;for(;o-- >0;){const i=n[o],a=e[i];if(a){const e=t[i],r=void 0===e||a(e,i,t);if(!0!==r)throw new nt("option "+i+" must be "+r,nt.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new nt("Unknown option "+i,nt.ERR_BAD_OPTION)}},validators:de},ve=me.validators;class be{constructor(t){this.defaults=t,this.interceptors={request:new yt,response:new yt}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const r=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?r&&!String(t.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+r):t.stack=r}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Vt(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;void 0!==r&&me.assertOptions(r,{silentJSONParsing:ve.transitional(ve.boolean),forcedJSONParsing:ve.transitional(ve.boolean),clarifyTimeoutError:ve.transitional(ve.boolean)},!1),null!=n&&(Z.isFunction(n)?e.paramsSerializer={serialize:n}:me.assertOptions(n,{encode:ve.function,serialize:ve.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&Z.merge(o.common,o[e.method]);o&&Z.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=kt.concat(i,o);const a=[];let s=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(s=s&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let l,f=0;if(!s){const t=[he.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,c),l=t.length,u=Promise.resolve(e);f<l;)u=u.then(t[f++],t[f++]);return u}l=a.length;let p=e;for(f=0;f<l;){const t=a[f++],e=a[f++];try{p=t(p)}catch(t){e.call(this,t);break}}try{u=he.call(this,p)}catch(t){return Promise.reject(t)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(t){return dt($t((t=Vt(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}Z.forEach(["delete","get","head","options"],(function(t){be.prototype[t]=function(e,r){return this.request(Vt(r||{},{method:t,url:e,data:(r||{}).data}))}})),Z.forEach(["post","put","patch"],(function(t){function e(e){return function(r,n,o){return this.request(Vt(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}be.prototype[t]=e(),be.prototype[t+"Form"]=e(!0)}));const ge=be;class we{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const r=this;this.promise.then((t=>{if(!r._listeners)return;let e=r._listeners.length;for(;e-- >0;)r._listeners[e](t);r._listeners=null})),this.promise.then=t=>{let e;const n=new Promise((t=>{r.subscribe(t),e=t})).then(t);return n.cancel=function(){r.unsubscribe(e)},n},t((function(t,n,o){r.reason||(r.reason=new Bt(t,n,o),e(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new we((function(e){t=e})),cancel:t}}}const Ee=we,Oe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Oe).forEach((([t,e])=>{Oe[e]=t}));const Se=Oe,Re=function t(e){const r=new ge(e),n=u(ge.prototype.request,r);return Z.extend(n,ge.prototype,r,{allOwnKeys:!0}),Z.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(Vt(e,r))},n}(Pt);Re.Axios=ge,Re.CanceledError=Bt,Re.CancelToken=Ee,Re.isCancel=Ft,Re.VERSION="1.7.7",Re.toFormData=ct,Re.AxiosError=nt,Re.Cancel=Re.CanceledError,Re.all=function(t){return Promise.all(t)},Re.spread=function(t){return function(e){return t.apply(null,e)}},Re.isAxiosError=function(t){return Z.isObject(t)&&!0===t.isAxiosError},Re.mergeConfig=Vt,Re.AxiosHeaders=kt,Re.formToJSON=t=>Rt(Z.isHTMLForm(t)?new FormData(t):t),Re.getAdapter=fe,Re.HttpStatusCode=Se,Re.default=Re;const xe=Re;function Pe(t){return Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pe(t)}function je(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _e(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?je(Object(r),!0).forEach((function(e){Te(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):je(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Te(t,e,r){return(e=Ce(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Le(){Le=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new L(n||[]);return o(a,"_invoke",{value:P(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",m={};function v(){}function b(){}function g(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(N([])));O&&O!==r&&n.call(O,a)&&(w=O);var S=g.prototype=v.prototype=Object.create(w);function R(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==Pe(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=p;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=j(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:h,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Pe(e)+" is not iterable")}return b.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:b,configurable:!0}),b.displayName=u(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},R(x.prototype),u(x.prototype,s,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},R(S),u(S,c,"Generator"),u(S,a,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Ne(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Ae(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ne(i,n,o,a,s,"next",t)}function s(t){Ne(i,n,o,a,s,"throw",t)}a(void 0)}))}}function ke(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ce(n.key),n)}}function Ce(t){var e=function(t,e){if("object"!=Pe(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Pe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pe(e)?e:e+""}const Fe=new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"handleRequests",value:(s=Ae(Le().mark((function t(e){var r;return Le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,xe.defaults.baseURL=c.BACKEND_BASE_URL,t.next=4,xe.request(e);case 4:return r=t.sent,t.abrupt("return",r.data);case 8:if(t.prev=8,t.t0=t.catch(0),console.log("err",t.t0),!t.t0.response){t.next=17;break}if(401!==t.t0.response.status){t.next=14;break}return t.abrupt("return",window.location.href="/login");case 14:return t.abrupt("return",t.t0.response.data);case 17:if(!t.t0.request){t.next=21;break}return t.abrupt("return",{success:!1,message:"No response received, please try again later."});case 21:return t.abrupt("return",{success:!1,message:"An unexpected error occurred."});case 22:case"end":return t.stop()}}),t,null,[[0,8]])}))),function(t){return s.apply(this,arguments)})},{key:"post",value:(a=Ae(Le().mark((function t(e){var r;return Le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=_e(_e({},{method:"post"}),e),t.next=4,this.handleRequests(r);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return a.apply(this,arguments)})},{key:"get",value:(i=Ae(Le().mark((function t(){var e,r,n=arguments;return Le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:{},r=_e(_e({},{method:"get"}),e),t.next=5,this.handleRequests(r);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)}))),function(){return i.apply(this,arguments)})},{key:"put",value:(o=Ae(Le().mark((function t(e){var r;return Le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=_e(_e({},{method:"put"}),e),t.next=4,this.handleRequests(r);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"patch",value:(n=Ae(Le().mark((function t(e){var r;return Le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=_e(_e({},{method:"patch"}),e),t.next=4,this.handleRequests(r);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"delete",value:(r=Ae(Le().mark((function t(e){var r;return Le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=_e(_e({},{method:"delete"}),e),t.next=4,this.handleRequests(r);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})}],e&&ke(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o,i,a,s}());function De(t){return De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},De(t)}function Be(){Be=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new L(n||[]);return o(a,"_invoke",{value:P(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",m={};function v(){}function b(){}function g(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(N([])));O&&O!==r&&n.call(O,a)&&(w=O);var S=g.prototype=v.prototype=Object.create(w);function R(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==De(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=p;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=j(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:h,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(De(e)+" is not iterable")}return b.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:b,configurable:!0}),b.displayName=u(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},R(x.prototype),u(x.prototype,s,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},R(S),u(S,c,"Generator"),u(S,a,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Ue(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Ie(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ue(i,n,o,a,s,"next",t)}function s(t){Ue(i,n,o,a,s,"throw",t)}a(void 0)}))}}function qe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Me(n.key),n)}}function Me(t){var e=function(t,e){if("object"!=De(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=De(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==De(e)?e:e+""}var Ge,He,$e;function ze(t){return ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ze(t)}function Ve(){Ve=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),s=new L(n||[]);return o(a,"_invoke",{value:P(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",m={};function v(){}function b(){}function g(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(N([])));O&&O!==r&&n.call(O,a)&&(w=O);var S=g.prototype=v.prototype=Object.create(w);function R(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,s){var c=f(t[o],t,i);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==ze(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(l).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function P(e,r,n){var o=p;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=j(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:h,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function N(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(ze(e)+" is not iterable")}return b.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:b,configurable:!0}),b.displayName=u(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},R(x.prototype),u(x.prototype,s,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},R(S),u(S,c,"Generator"),u(S,a,(function(){return this})),u(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Ke(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Je(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ke(i,n,o,a,s,"next",t)}function s(t){Ke(i,n,o,a,s,"throw",t)}a(void 0)}))}}function We(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ye(n.key),n)}}function Ye(t){var e=function(t,e){if("object"!=ze(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=ze(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ze(e)?e:e+""}new(function(){return t=function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=function(t){return{"Content-Type":"application/x-www-form-urlencoded","Content-Length":null==t?void 0:t.length}},(r=Me(r="defaultHeaders"))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,this.BASEURL=c.BACKEND_BASE_URL,xe.defaults.baseURL=c.BACKEND_BASE_URL},e=[{key:"createHyperpayOrder",value:(o=Ie(Be().mark((function t(e){var r,n,o;return Be().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.defaultHeaders(),n={url:"/hyperpay/orders/create-order",data:e,headers:r},console.log("requestConfig",n),t.next=6,Fe.post(n);case 6:return o=t.sent,console.log("result",o),t.abrupt("return",o);case 9:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"getOrderStatus",value:(n=Ie(Be().mark((function t(e,r){var n,o,i;return Be().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.defaultHeaders(),o={url:"/hyperpay/orders/get-order/".concat(e,"?resoucePath=").concat(r),headers:n},t.next=4,Fe.get(o);case 4:return i=t.sent,t.abrupt("return",i);case 6:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"captureOrder",value:(r=Ie(Be().mark((function t(e){var r,n,o;return Be().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.defaultHeaders(),n={url:"/hyperpay/orders/capture-order/".concat(e),headers:r},t.next=4,Fe.post(n);case 4:return o=t.sent,t.abrupt("return",o);case 6:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})}],e&&qe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}()),new(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"createPaypalOrder",value:(n=Je(Ve().mark((function t(e){var r,n;return Ve().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={url:"/paypal/orders/create-order",data:e},t.next=3,Fe.post(r);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t)}))),function(t){return n.apply(this,arguments)})},{key:"approveOrder",value:(r=Je(Ve().mark((function t(e){var r,n;return Ve().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={url:"/paypal/orders/capture-order",data:e},t.next=3,Fe.post(r);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t)}))),function(t){return r.apply(this,arguments)})}],e&&We(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n}()),function(t){t.INITIAL="initial",t.PENDING="pending",t.REJECTED="rejected",t.RESOLVED="resolved"}(Ge||(Ge={})),function(t){t.LOADING_STATUS="setLoadingStatus",t.RESET_OPTIONS="resetOptions",t.SET_BRAINTREE_INSTANCE="braintreeInstance"}(He||(He={})),function(t){t.NUMBER="number",t.CVV="cvv",t.EXPIRATION_DATE="expirationDate",t.EXPIRATION_MONTH="expirationMonth",t.EXPIRATION_YEAR="expirationYear",t.POSTAL_CODE="postalCode"}($e||($e={}));var Xe=function(){return Xe=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Xe.apply(this,arguments)};function Qe(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}function Ze(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var tr="dataNamespace",er="3.84.0",rr=("https://js.braintreegateway.com/web/".concat(er,"/js/client.min.js"),"https://js.braintreegateway.com/web/".concat(er,"/js/paypal-checkout.min.js"),"paypal"),nr="usePayPalScriptReducer must be used within a PayPalScriptProvider";function or(t){return void 0===t&&(t=rr),window[t]}function ir(t){var e=t.reactComponentName,r=t.sdkComponentKey,n=t.sdkRequestedComponents,o=void 0===n?"":n,i=t.sdkDataNamespace,a=void 0===i?rr:i,s=r.charAt(0).toUpperCase().concat(r.substring(1)),c="Unable to render <".concat(e," /> because window.").concat(a,".").concat(s," is undefined."),u="string"==typeof o?o:o.join(",");if(!u.includes(r)){var l=[u,r].filter(Boolean).join();c+="\nTo fix the issue, add '".concat(r,"' to the list of components passed to the parent PayPalScriptProvider:")+"\n`<PayPalScriptProvider options={{ components: '".concat(l,"'}}>`.")}return c}var ar=(0,e.createContext)(null);function sr(){var t=function(t){if("function"==typeof(null==t?void 0:t.dispatch)&&0!==t.dispatch.length)return t;throw new Error(nr)}((0,e.useContext)(ar));return[Xe(Xe({},t),{isInitial:t.loadingStatus===Ge.INITIAL,isPending:t.loadingStatus===Ge.PENDING,isResolved:t.loadingStatus===Ge.RESOLVED,isRejected:t.loadingStatus===Ge.REJECTED}),t.dispatch]}(0,e.createContext)({});var cr=function(t){var r,n=t.className,o=void 0===n?"":n,i=t.disabled,a=void 0!==i&&i,s=t.children,c=t.forceReRender,u=void 0===c?[]:c,l=Qe(t,["className","disabled","children","forceReRender"]),f=a?{opacity:.38}:{},p="".concat(o," ").concat(a?"paypal-buttons-disabled":"").trim(),h=(0,e.useRef)(null),d=(0,e.useRef)(null),y=sr()[0],m=y.isResolved,v=y.options,b=(0,e.useState)(null),g=b[0],w=b[1],E=(0,e.useState)(!0),O=E[0],S=E[1],R=(0,e.useState)(null)[1];function x(){null!==d.current&&d.current.close().catch((function(){}))}return(null===(r=d.current)||void 0===r?void 0:r.updateProps)&&d.current.updateProps({message:l.message}),(0,e.useEffect)((function(){if(!1===m)return x;var t=or(v.dataNamespace);if(void 0===t||void 0===t.Buttons)return R((function(){throw new Error(ir({reactComponentName:cr.displayName,sdkComponentKey:"buttons",sdkRequestedComponents:v.components,sdkDataNamespace:v[tr]}))})),x;try{d.current=t.Buttons(Xe(Xe({},l),{onInit:function(t,e){w(e),"function"==typeof l.onInit&&l.onInit(t,e)}}))}catch(t){return R((function(){throw new Error("Failed to render <PayPalButtons /> component. Failed to initialize: ".concat(t))}))}return!1===d.current.isEligible()?(S(!1),x):h.current?(d.current.render(h.current).catch((function(t){null!==h.current&&0!==h.current.children.length&&R((function(){throw new Error("Failed to render <PayPalButtons /> component. ".concat(t))}))})),x):x}),Ze(Ze([m],u,!0),[l.fundingSource],!1)),(0,e.useEffect)((function(){null!==g&&(!0===a?g.disable().catch((function(){})):g.enable().catch((function(){})))}),[a,g]),e.createElement(e.Fragment,null,O?e.createElement("div",{ref:h,style:f,className:p}):s)};cr.displayName="PayPalButtons";var ur=function(t){var r=t.className,n=void 0===r?"":r,o=t.children,i=Qe(t,["className","children"]),a=sr()[0],s=a.isResolved,c=a.options,u=(0,e.useRef)(null),l=(0,e.useState)(!0),f=l[0],p=l[1],h=(0,e.useState)(null)[1];return(0,e.useEffect)((function(){if(!1!==s){var t=or(c[tr]);if(void 0===t||void 0===t.Marks)return h((function(){throw new Error(ir({reactComponentName:ur.displayName,sdkComponentKey:"marks",sdkRequestedComponents:c.components,sdkDataNamespace:c[tr]}))}));!function(t){var e=u.current;if(!e||!t.isEligible())return p(!1);e.firstChild&&e.removeChild(e.firstChild),t.render(e).catch((function(t){null!==e&&0!==e.children.length&&h((function(){throw new Error("Failed to render <PayPalMarks /> component. ".concat(t))}))}))}(t.Marks(Xe({},i)))}}),[s,i.fundingSource]),e.createElement(e.Fragment,null,f?e.createElement("div",{ref:u,className:n}):o)};ur.displayName="PayPalMarks";var lr=function(t){var r=t.className,n=void 0===r?"":r,o=t.forceReRender,i=void 0===o?[]:o,a=Qe(t,["className","forceReRender"]),s=sr()[0],c=s.isResolved,u=s.options,l=(0,e.useRef)(null),f=(0,e.useRef)(null),p=(0,e.useState)(null)[1];return(0,e.useEffect)((function(){if(!1!==c){var t=or(u[tr]);if(void 0===t||void 0===t.Messages)return p((function(){throw new Error(ir({reactComponentName:lr.displayName,sdkComponentKey:"messages",sdkRequestedComponents:u.components,sdkDataNamespace:u[tr]}))}));f.current=t.Messages(Xe({},a)),f.current.render(l.current).catch((function(t){null!==l.current&&0!==l.current.children.length&&p((function(){throw new Error("Failed to render <PayPalMessages /> component. ".concat(t))}))}))}}),Ze([c],i,!0)),e.createElement("div",{ref:l,className:n})};function fr(){}lr.displayName="PayPalMessages",(0,e.createContext)({cardFieldsForm:null,fields:{},registerField:fr,unregisterField:fr})})()})();
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @license React
|
|
5
|
-
* react.production.min.js
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
Test cards:
|
|
3
|
-
https://wordpresshyperpay.docs.oppwa.com/reference/parameters#test-accounts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Purchase a product:
|
|
8
|
-
References:
|
|
9
|
-
https://wordpresshyperpay.docs.oppwa.com/integrations/widget
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Subscribe:
|
|
16
|
-
References:
|
|
17
|
-
|
|
18
|
-
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"entityId":"8a8294174d0595bb014d05d82e5b01d2",
|
|
3
|
-
"amount":"0.00",
|
|
4
|
-
"paymentType":"PA",
|
|
5
|
-
"createRegistration":"true",
|
|
6
|
-
"currency":"EUR",
|
|
7
|
-
"testMode":"EXTERNAL",
|
|
8
|
-
"paymentBrand":"VISA",
|
|
9
|
-
"card.number":"4242426505984705",
|
|
10
|
-
"card.holder":"John Smith",
|
|
11
|
-
"card.expiryMonth":"12",
|
|
12
|
-
"card.expiryYear":"2026",
|
|
13
|
-
"card.cvv":"123",
|
|
14
|
-
"customer.email":"john.smith@gmail.com",
|
|
15
|
-
"customer.givenName":"Smith",
|
|
16
|
-
"customer.ip":"192.168.0.0",
|
|
17
|
-
"customer.surname":"John",
|
|
18
|
-
"customer.language":"DE",
|
|
19
|
-
"billing.city":"MyCity",
|
|
20
|
-
"billing.country":"DE",
|
|
21
|
-
"billing.postcode":"712121",
|
|
22
|
-
"billing.state":"DE",
|
|
23
|
-
"billing.street1":"MyStreet",
|
|
24
|
-
"standingInstruction.type":"RECURRING",
|
|
25
|
-
"standingInstruction.mode":"INITIAL",
|
|
26
|
-
"standingInstruction.source":"CIT",
|
|
27
|
-
"standingInstruction.recurringType":"SUBSCRIPTION",
|
|
28
|
-
"threeDSecure.eci":"05",
|
|
29
|
-
"threeDSecure.authenticationStatus":"Y",
|
|
30
|
-
"threeDSecure.version":"2.2.0",
|
|
31
|
-
"threeDSecure.dsTransactionId":"c75f23af-9454-43f6-ba17-130ed529507e",
|
|
32
|
-
"threeDSecure.acsTransactionId":"2c42c553-176f-4f08-af6c-f9364ecbd0e8",
|
|
33
|
-
"threeDSecure.verificationId":"MTIzNDU2Nzg5MDEyMzQ1Njc4OTA=",
|
|
34
|
-
"threeDSecure.amount":"19.99",
|
|
35
|
-
"threeDSecure.currency":"EUR",
|
|
36
|
-
"threeDSecure.flow":"challenge"
|
|
37
|
-
}
|
package/example/hyperpay/use.js
DELETED
|
File without changes
|
package/example/paypal.js
DELETED
|
File without changes
|
package/index.html
DELETED
package/index.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import HyperpayOrder from "./src/hyperpay/hyperpayOrder.js";
|
|
2
|
-
import PaypalOrder from "./src/paypal/paypalOrder.js";
|
|
3
|
-
import hyperpayConnector from "./src/shared/requests/hyperpayConnector.js";
|
|
4
|
-
|
|
5
|
-
const PymentOrder = ({
|
|
6
|
-
provider = "hyperpay",
|
|
7
|
-
order = {},
|
|
8
|
-
clientId = "test",
|
|
9
|
-
onChange = () => {},
|
|
10
|
-
onStatusChange = () => {},
|
|
11
|
-
redirectUrl = "",
|
|
12
|
-
}) => {
|
|
13
|
-
if (provider === "paypal") {
|
|
14
|
-
return (
|
|
15
|
-
<PaypalOrder
|
|
16
|
-
order={order}
|
|
17
|
-
clientId={clientId}
|
|
18
|
-
onChange={onChange}
|
|
19
|
-
onStatusChange={onStatusChange}
|
|
20
|
-
/>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (provider === "hyperpay") {
|
|
25
|
-
return <HyperpayOrder order={order} redirectUrl={redirectUrl} />;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return <div />;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const verifyCheckout = async (provider, checkoutId, env, resoucePath) => {
|
|
32
|
-
if (provider === "hyperpay") {
|
|
33
|
-
const response = await hyperpayConnector.getOrderStatus(
|
|
34
|
-
checkoutId,
|
|
35
|
-
env,
|
|
36
|
-
resoucePath
|
|
37
|
-
);
|
|
38
|
-
console.log(response);
|
|
39
|
-
return response;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return false;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export { PymentOrder, verifyCheckout };
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import hyperpayConnector from "../shared/requests/hyperpayConnector.js";
|
|
3
|
-
import backendConnector from "../shared/requests/backendConnector.js";
|
|
4
|
-
import config from "../shared/config.js";
|
|
5
|
-
|
|
6
|
-
const HyperpayOrder = ({ redirectUrl, order }) => {
|
|
7
|
-
const [error, setError] = useState(null);
|
|
8
|
-
const [checkoutId, setCheckoutId] = useState(null);
|
|
9
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
10
|
-
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
if (order) {
|
|
13
|
-
initiateOrder();
|
|
14
|
-
}
|
|
15
|
-
}, [order]);
|
|
16
|
-
|
|
17
|
-
const initiateOrder = async () => {
|
|
18
|
-
try {
|
|
19
|
-
if (!order) {
|
|
20
|
-
setError("Order data must be provided");
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
setIsLoading(true);
|
|
24
|
-
const result = await hyperpayConnector.createHyperpayOrder(order);
|
|
25
|
-
setIsLoading(false);
|
|
26
|
-
|
|
27
|
-
if (result?.error) {
|
|
28
|
-
setError(result.error);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (result?.id) return setCheckoutId(result.id);
|
|
33
|
-
} catch (err) {
|
|
34
|
-
console.error("err", err);
|
|
35
|
-
setError("An unexpected error occurred.");
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const checkout = async () => {
|
|
40
|
-
try {
|
|
41
|
-
if (!checkoutId) {
|
|
42
|
-
setError("Checkout ID must be provided");
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
setIsLoading(true);
|
|
46
|
-
const result = await hyperpayConnector.getOrderStatus(checkoutId);
|
|
47
|
-
setIsLoading(false);
|
|
48
|
-
|
|
49
|
-
if (result?.error) {
|
|
50
|
-
setError(result.error);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return result;
|
|
55
|
-
} catch (err) {
|
|
56
|
-
console.error("err", err);
|
|
57
|
-
setError("An unexpected error occurred.");
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
if (checkoutId) {
|
|
63
|
-
const script = document.createElement("script");
|
|
64
|
-
script.src = `${config?.HYPERPAY_BASE_URL}/v1/paymentWidgets.js?checkoutId=${checkoutId}`;
|
|
65
|
-
script.async = true;
|
|
66
|
-
script.crossOrigin = "anonymous";
|
|
67
|
-
document.body.appendChild(script);
|
|
68
|
-
|
|
69
|
-
return () => {
|
|
70
|
-
document.body.removeChild(script);
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
}, [checkoutId]);
|
|
74
|
-
|
|
75
|
-
if (error) {
|
|
76
|
-
return <p>Error: {error}</p>;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (isLoading) {
|
|
80
|
-
return <p>Loading...</p>;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (checkoutId) {
|
|
84
|
-
return (
|
|
85
|
-
<form
|
|
86
|
-
action={redirectUrl}
|
|
87
|
-
className="paymentWidgets"
|
|
88
|
-
data-brands="VISA MASTER AMEX"
|
|
89
|
-
></form>
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return (
|
|
94
|
-
<div>
|
|
95
|
-
<p>No order</p>
|
|
96
|
-
</div>
|
|
97
|
-
);
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export default HyperpayOrder;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { PayPalButtons, usePayPalScriptReducer } from "@paypal/react-paypal-js";
|
|
3
|
-
import backendConnector from "../shared/requests/backendConnector.js";
|
|
4
|
-
|
|
5
|
-
const Spinner = () => <div className="spinner">Processing payment...</div>;
|
|
6
|
-
|
|
7
|
-
const ButtonWrapper = ({
|
|
8
|
-
order,
|
|
9
|
-
onChange = () => {},
|
|
10
|
-
onStatusChange = () => {},
|
|
11
|
-
env,
|
|
12
|
-
}) => {
|
|
13
|
-
if (env !== "production" && env !== "development") {
|
|
14
|
-
return <div>Invalid Env</div>;
|
|
15
|
-
}
|
|
16
|
-
const [{ isPending }] = usePayPalScriptReducer();
|
|
17
|
-
|
|
18
|
-
const createOrderOrSubscription = async () => {
|
|
19
|
-
try {
|
|
20
|
-
const response = await backendConnector.createPaypalOrder(order, env);
|
|
21
|
-
onChange({ event: "createOrder", data: response });
|
|
22
|
-
return response.id;
|
|
23
|
-
} catch (error) {
|
|
24
|
-
console.error("Error creating PayPal transaction:", error);
|
|
25
|
-
throw new Error("Transaction creation failed");
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const handleApproval = async (data, actions) => {
|
|
30
|
-
try {
|
|
31
|
-
console.log(data);
|
|
32
|
-
const captureData = {
|
|
33
|
-
orderId: data?.orderID || undefined,
|
|
34
|
-
subscriptionId: data?.subscriptionID || data?.id,
|
|
35
|
-
type: order.type,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
await backendConnector.approveOrder(captureData, env);
|
|
39
|
-
if (order.type == "order") {
|
|
40
|
-
return actions.order.capture().then(function (details) {
|
|
41
|
-
onStatusChange(true);
|
|
42
|
-
onChange({ event: "approveOrder", data: data });
|
|
43
|
-
|
|
44
|
-
console.log(
|
|
45
|
-
"Transaction completed by " + details.payer.name.given_name
|
|
46
|
-
);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
onStatusChange(true);
|
|
50
|
-
onChange({ event: "approveOrder", data: data });
|
|
51
|
-
} catch (error) {
|
|
52
|
-
console.error("Error capturing PayPal transaction:", error);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<>
|
|
58
|
-
{isPending ? <Spinner /> : null}
|
|
59
|
-
<PayPalButtons
|
|
60
|
-
style={{ layout: "vertical" }}
|
|
61
|
-
disabled={false}
|
|
62
|
-
fundingSource={undefined}
|
|
63
|
-
createOrder={
|
|
64
|
-
order.type === "order" ? createOrderOrSubscription : undefined
|
|
65
|
-
}
|
|
66
|
-
createSubscription={
|
|
67
|
-
order.type === "subscription" ? createOrderOrSubscription : undefined
|
|
68
|
-
}
|
|
69
|
-
onError={(err) => console.log(err)}
|
|
70
|
-
onApprove={handleApproval}
|
|
71
|
-
/>
|
|
72
|
-
</>
|
|
73
|
-
);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export default ButtonWrapper;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { PayPalScriptProvider } from "@paypal/react-paypal-js";
|
|
3
|
-
import ButtonWrapper from "./buttonWrapper.js";
|
|
4
|
-
import config from "../shared/config.js";
|
|
5
|
-
|
|
6
|
-
const PaypalOrder = ({
|
|
7
|
-
currency = "USD",
|
|
8
|
-
clientId = "test",
|
|
9
|
-
order = {},
|
|
10
|
-
onChange = () => {},
|
|
11
|
-
onStatusChange = () => {},
|
|
12
|
-
}) => {
|
|
13
|
-
const env = config.NODE_ENV;
|
|
14
|
-
const initialOptions = {
|
|
15
|
-
clientId: clientId,
|
|
16
|
-
currency: currency,
|
|
17
|
-
vault: order.type === "subscription",
|
|
18
|
-
};
|
|
19
|
-
return (
|
|
20
|
-
<div style={{ maxWidth: "750px", minHeight: "200px" }}>
|
|
21
|
-
<PayPalScriptProvider options={initialOptions}>
|
|
22
|
-
<ButtonWrapper
|
|
23
|
-
order={order}
|
|
24
|
-
onChange={onChange}
|
|
25
|
-
onStatusChange={onStatusChange}
|
|
26
|
-
env={env}
|
|
27
|
-
/>
|
|
28
|
-
</PayPalScriptProvider>
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default PaypalOrder;
|
package/src/shared/config.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const env = process.env.NEXT_PUBLIC_NODE_ENV || "production";
|
|
2
|
-
let config = {
|
|
3
|
-
NODE_ENV: env,
|
|
4
|
-
BACKEND_BASE_URL: "http://localhost:5000/api",
|
|
5
|
-
HYPERPAY_BASE_URL: "https://eu-test.oppwa.com/",
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
const production = {
|
|
9
|
-
BACKEND_BASE_URL: "https://payment.atech-workspace.com/api",
|
|
10
|
-
HYPERPAY_BASE_URL: "https://eu-prod.oppwa.com/",
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const staging = {
|
|
14
|
-
BACKEND_BASE_URL: "https://stage.payment.atech-workspace.com/api",
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
if (env === "production") config = { ...config, ...production };
|
|
18
|
-
if (env === "staging") config = { ...config, ...staging };
|
|
19
|
-
|
|
20
|
-
export default config;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// Services
|
|
2
|
-
import backendConnector from "./requests/backendConnector";
|
|
3
|
-
|
|
4
|
-
class PaypalService {
|
|
5
|
-
async createOrder(data) {
|
|
6
|
-
const result = await backendConnector.createPaypalOrder(data);
|
|
7
|
-
if (result?.id) return result?.id;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
async onApprove(data) {
|
|
11
|
-
const result = await backendConnector.approveOrder(data);
|
|
12
|
-
return result;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default new PaypalService();
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// Services
|
|
2
|
-
import request from "./request.js";
|
|
3
|
-
|
|
4
|
-
class BackendConnector {
|
|
5
|
-
async createPaypalOrder(data) {
|
|
6
|
-
const requestConfig = {
|
|
7
|
-
url: "/paypal/orders/create-order",
|
|
8
|
-
data,
|
|
9
|
-
};
|
|
10
|
-
const result = await request.post(requestConfig);
|
|
11
|
-
return result;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async approveOrder(data) {
|
|
15
|
-
const requestConfig = {
|
|
16
|
-
url: "/paypal/orders/capture-order",
|
|
17
|
-
data,
|
|
18
|
-
};
|
|
19
|
-
const result = await request.post(requestConfig);
|
|
20
|
-
return result;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default new BackendConnector();
|