@a-tech.jo/atech_payment 1.0.19 → 1.0.21
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.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
import*as t from"react";import*as e from"react/jsx-runtime";var 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]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};r.d(n,{qT:()=>Qe,Rb:()=>Ze,IZ:()=>tr});var o={};r.r(o),r.d(o,{hasBrowserEnv:()=>_t,hasStandardBrowserEnv:()=>kt,hasStandardBrowserWebWorkerEnv:()=>It,navigator:()=>Ct,origin:()=>Ut});const i=(a={default:()=>t.default,useEffect:()=>t.useEffect,useState:()=>t.useState},s={},r.d(s,a),s);var a,s;function c(t){return c="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},c(t)}function u(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 l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var d=function(t){switch((process.env.NEXT_PUBLIC_PAYMENT_ENV||"").trim().toLowerCase()){case"stage":case"staging":return"staging";case"dev":case"development":case"local":return"development";default:return"production"}}(),h={BACKEND_DOMAIN:"https://stage.banking.atech-workspace.com/api/sdk",HYPERPAY_DOMAIN:"https://test.oppwa.com",MEPS_DOMAIN:"https://meps-test.gateway.mastercard.com",STRIPE_DOMAIN:"https://js.stripe.com",NETWORK_DOMAIN:"https://network-test.payment.com",PAYPAL_DOMAIN:"https://www.sandbox.paypal.com"},p={production:{BACKEND_DOMAIN:"https://banking.atech-workspace.com/api/sdk",HYPERPAY_DOMAIN:"https://oppwa.com",MEPS_DOMAIN:"https://meps.gateway.mastercard.com",STRIPE_DOMAIN:"https://js.stripe.com",NETWORK_DOMAIN:"https://network.payment.com",PAYPAL_DOMAIN:"https://www.paypal.com"},staging:h,development:h}[d],y=l(l({ENV:d},p),{},{getGatewayCheckoutUrl:function(t,e){return function(t,e,r){switch(e.toLowerCase()){case"hyperpay":return r?"".concat(t.HYPERPAY_DOMAIN,"/v1/paymentWidgets.js?checkoutId=").concat(r):t.HYPERPAY_DOMAIN;case"meps":return r?"".concat(t.MEPS_DOMAIN,"/checkout/version/60/checkout.js"):t.MEPS_DOMAIN;case"stripe":return t.STRIPE_DOMAIN;case"paypal":return r&&!r.startsWith("http")?"".concat(t.PAYPAL_DOMAIN).concat(r):r||t.PAYPAL_DOMAIN;case"network":return r&&!r.startsWith("http")?"".concat(t.NETWORK_DOMAIN).concat(r):r||t.NETWORK_DOMAIN;default:return t.BACKEND_DOMAIN}}(p,t,e)}});const m=y,g=(t=>{var e={};return r.d(e,t),e})({jsx:()=>e.jsx}),b=function(t){var e=t.checkoutId,r=t.redirectUrl;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("hyperpay",e),r=document.createElement("script");return r.src=t,r.async=!0,document.body.appendChild(r),function(){document.body.contains(r)&&document.body.removeChild(r)}}}),[e]),e?(0,g.jsx)("form",{action:r||window.location.href,className:"paymentWidgets","data-brands":"VISA MASTER AMEX"}):(0,g.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing HyperPay checkoutId"})},v=function(t){var e=t.approvalUrl;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("paypal",e);window.location.href=t}}),[e]),e?(0,g.jsx)("p",{className:"text-slate-300 font-mono text-xs",children:"Redirecting to PayPal secure checkout..."}):(0,g.jsx)("p",{className:"text-red-500 font-mono text-xs",children:"Error: Missing PayPal approval URL."})},w=function(t){var e=t.clientSecret,r=t.publishableKey;return(0,i.useEffect)((function(){if(e&&r){var t=m.getGatewayCheckoutUrl("stripe"),n=document.createElement("script");return n.src=t,n.async=!0,n.onload=function(){console.log("Stripe JS loaded from:",t)},document.body.appendChild(n),function(){document.body.contains(n)&&document.body.removeChild(n)}}}),[e,r]),e&&r?(0,g.jsx)("div",{id:"stripe-checkout-container",className:"stripe-payment-container",children:(0,g.jsx)("p",{className:"text-slate-400 text-xs font-mono",children:"Initializing Stripe Payment Elements..."})}):(0,g.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing Stripe clientSecret or publishableKey"})},E=function(t){var e=t.checkoutId;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("meps",e),r=document.createElement("script");return r.src=t,r.async=!0,r.setAttribute("data-error","errorCallback"),r.setAttribute("data-cancel","cancelCallback"),document.body.appendChild(r),function(){document.body.contains(r)&&document.body.removeChild(r)}}}),[e]),e?(0,g.jsx)("div",{id:"embed-target",className:"meps-payment-container",children:(0,g.jsx)("p",{className:"text-slate-400 text-xs font-mono",children:"Loading MEPS checkout session..."})}):(0,g.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing MEPS Checkout ID"})},O=function(t){var e=t.approvalUrl;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("network",e);window.location.href=t}}),[e]),e?(0,g.jsx)("p",{className:"text-slate-300 font-mono text-xs",children:"Redirecting to Network International payment page..."}):(0,g.jsx)("p",{className:"text-red-500 font-mono text-xs",children:"Error: Missing Network International payment URL."})};function S(t,e){return function(){return t.apply(e,arguments)}}const{toString:x}=Object.prototype,{getPrototypeOf:R}=Object,A=(j=Object.create(null),t=>{const e=x.call(t);return j[e]||(j[e]=e.slice(8,-1).toLowerCase())});var j;const P=t=>(t=t.toLowerCase(),e=>A(e)===t),N=t=>e=>typeof e===t,{isArray:T}=Array,L=N("undefined"),_=P("ArrayBuffer"),C=N("string"),k=N("function"),I=N("number"),U=t=>null!==t&&"object"==typeof t,D=t=>{if("object"!==A(t))return!1;const e=R(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},F=P("Date"),B=P("File"),M=P("Blob"),q=P("FileList"),z=P("URLSearchParams"),[G,H,K,W]=["ReadableStream","Request","Response","Headers"].map(P);function J(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),T(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 V(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 Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,$=t=>!L(t)&&t!==Y,X=(Z="undefined"!=typeof Uint8Array&&R(Uint8Array),t=>Z&&t instanceof Z);var Z;const Q=P("HTMLFormElement"),tt=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),et=P("RegExp"),rt=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};J(r,((r,o)=>{let i;!1!==(i=e(r,o,t))&&(n[o]=i||r)})),Object.defineProperties(t,n)},nt="abcdefghijklmnopqrstuvwxyz",ot="0123456789",it={DIGIT:ot,ALPHA:nt,ALPHA_DIGIT:nt+nt.toUpperCase()+ot},at=P("AsyncFunction"),st=(ct="function"==typeof setImmediate,ut=k(Y.postMessage),ct?setImmediate:ut?(lt=`axios@${Math.random()}`,ft=[],Y.addEventListener("message",(({source:t,data:e})=>{t===Y&&e===lt&&ft.length&&ft.shift()()}),!1),t=>{ft.push(t),Y.postMessage(lt,"*")}):t=>setTimeout(t));var ct,ut,lt,ft;const dt="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Y):"undefined"!=typeof process&&process.nextTick||st,ht={isArray:T,isArrayBuffer:_,isBuffer:function(t){return null!==t&&!L(t)&&null!==t.constructor&&!L(t.constructor)&&k(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||k(t.append)&&("formdata"===(e=A(t))||"object"===e&&k(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&_(t.buffer),e},isString:C,isNumber:I,isBoolean:t=>!0===t||!1===t,isObject:U,isPlainObject:D,isReadableStream:G,isRequest:H,isResponse:K,isHeaders:W,isUndefined:L,isDate:F,isFile:B,isBlob:M,isRegExp:et,isFunction:k,isStream:t=>U(t)&&k(t.pipe),isURLSearchParams:z,isTypedArray:X,isFileList:q,forEach:J,merge:function t(){const{caseless:e}=$(this)&&this||{},r={},n=(n,o)=>{const i=e&&V(r,o)||o;D(r[i])&&D(n)?r[i]=t(r[i],n):D(n)?r[i]=t({},n):T(n)?r[i]=n.slice():r[i]=n};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&J(arguments[t],n);return r},extend:(t,e,r,{allOwnKeys:n}={})=>(J(e,((e,n)=>{r&&k(e)?t[n]=S(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&&R(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:A,kindOfTest:P,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(T(t))return t;let e=t.length;if(!I(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:Q,hasOwnProperty:tt,hasOwnProp:tt,reduceDescriptors:rt,freezeMethods:t=>{rt(t,((e,r)=>{if(k(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];k(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 T(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:V,global:Y,isContextDefined:$,ALPHABET:it,generateString:(t=16,e=it.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r},isSpecCompliantForm:function(t){return!!(t&&k(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(U(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=T(t)?[]:{};return J(t,((t,e)=>{const i=r(t,n+1);!L(i)&&(o[e]=i)})),e[n]=void 0,o}}return t};return r(t,0)},isAsyncFn:at,isThenable:t=>t&&(U(t)||k(t))&&k(t.then)&&k(t.catch),setImmediate:st,asap:dt};function pt(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)}ht.inherits(pt,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:ht.toJSONObject(this.config),code:this.code,status:this.status}}});const yt=pt.prototype,mt={};["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=>{mt[t]={value:t}})),Object.defineProperties(pt,mt),Object.defineProperty(yt,"isAxiosError",{value:!0}),pt.from=(t,e,r,n,o,i)=>{const a=Object.create(yt);return ht.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),pt.call(a,t.message,e,r,n,o),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const gt=pt;function bt(t){return ht.isPlainObject(t)||ht.isArray(t)}function vt(t){return ht.endsWith(t,"[]")?t.slice(0,-2):t}function wt(t,e,r){return t?t.concat(e).map((function(t,e){return t=vt(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const Et=ht.toFlatObject(ht,{},null,(function(t){return/^is[A-Z]/.test(t)})),Ot=function(t,e,r){if(!ht.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=ht.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!ht.isUndefined(e[t])}))).metaTokens,o=r.visitor||u,i=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&ht.isSpecCompliantForm(e);if(!ht.isFunction(o))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(ht.isDate(t))return t.toISOString();if(!s&&ht.isBlob(t))throw new gt("Blob is not supported. Use a Buffer instead.");return ht.isArrayBuffer(t)||ht.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(ht.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(ht.isArray(t)&&function(t){return ht.isArray(t)&&!t.some(bt)}(t)||(ht.isFileList(t)||ht.endsWith(r,"[]"))&&(s=ht.toArray(t)))return r=vt(r),s.forEach((function(t,n){!ht.isUndefined(t)&&null!==t&&e.append(!0===a?wt([r],n,i):null===a?r:r+"[]",c(t))})),!1;return!!bt(t)||(e.append(wt(o,r,i),c(t)),!1)}const l=[],f=Object.assign(Et,{defaultVisitor:u,convertValue:c,isVisitable:bt});if(!ht.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!ht.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),ht.forEach(r,(function(r,i){!0===(!(ht.isUndefined(r)||null===r)&&o.call(e,r,ht.isString(i)?i.trim():i,n,f))&&t(r,n?n.concat(i):[i])})),l.pop()}}(t),e};function St(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function xt(t,e){this._pairs=[],t&&Ot(t,this,e)}const Rt=xt.prototype;Rt.append=function(t,e){this._pairs.push([t,e])},Rt.toString=function(t){const e=t?function(e){return t.call(this,e,St)}:St;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const At=xt;function jt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Pt(t,e,r){if(!e)return t;const n=r&&r.encode||jt,o=r&&r.serialize;let i;if(i=o?o(e,r):ht.isURLSearchParams(e)?e.toString():new At(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const Nt=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){ht.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},Tt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Lt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:At,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},_t="undefined"!=typeof window&&"undefined"!=typeof document,Ct="object"==typeof navigator&&navigator||void 0,kt=_t&&(!Ct||["ReactNative","NativeScript","NS"].indexOf(Ct.product)<0),It="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ut=_t&&window.location.href||"http://localhost",Dt={...o,...Lt},Ft=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&&ht.isArray(n)?n.length:i,s?(ht.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a):(n[i]&&ht.isObject(n[i])||(n[i]=[]),e(t,r,n[i],o)&&ht.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(ht.isFormData(t)&&ht.isFunction(t.entries)){const r={};return ht.forEachEntry(t,((t,n)=>{e(function(t){return ht.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,r,0)})),r}return null},Bt={transitional:Tt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,o=ht.isObject(t);if(o&&ht.isHTMLForm(t)&&(t=new FormData(t)),ht.isFormData(t))return n?JSON.stringify(Ft(t)):t;if(ht.isArrayBuffer(t)||ht.isBuffer(t)||ht.isStream(t)||ht.isFile(t)||ht.isBlob(t)||ht.isReadableStream(t))return t;if(ht.isArrayBufferView(t))return t.buffer;if(ht.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 Ot(t,new Dt.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return Dt.isNode&&ht.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=ht.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Ot(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,r){if(ht.isString(t))try{return(0,JSON.parse)(t),ht.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||Bt.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(ht.isResponse(t)||ht.isReadableStream(t))return t;if(t&&ht.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 gt.from(t,gt.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:Dt.classes.FormData,Blob:Dt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ht.forEach(["delete","get","head","post","put","patch"],(t=>{Bt.headers[t]={}}));const Mt=Bt,qt=ht.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"]),zt=Symbol("internals");function Gt(t){return t&&String(t).trim().toLowerCase()}function Ht(t){return!1===t||null==t?t:ht.isArray(t)?t.map(Ht):String(t)}function Kt(t,e,r,n,o){return ht.isFunction(n)?n.call(this,e,r):(o&&(e=r),ht.isString(e)?ht.isString(n)?-1!==e.indexOf(n):ht.isRegExp(n)?n.test(e):void 0:void 0)}class Wt{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=Gt(e);if(!o)throw new Error("header name must be a non-empty string");const i=ht.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||e]=Ht(t))}const i=(t,e)=>ht.forEach(t,((t,r)=>o(t,r,e)));if(ht.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(ht.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]&&qt[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(ht.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=Gt(t)){const r=ht.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(ht.isFunction(e))return e.call(this,t,r);if(ht.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Gt(t)){const r=ht.findKey(this,t);return!(!r||void 0===this[r]||e&&!Kt(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function o(t){if(t=Gt(t)){const o=ht.findKey(r,t);!o||e&&!Kt(0,r[o],o,e)||(delete r[o],n=!0)}}return ht.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&&!Kt(0,this[o],o,t,!0)||(delete this[o],n=!0)}return n}normalize(t){const e=this,r={};return ht.forEach(this,((n,o)=>{const i=ht.findKey(r,o);if(i)return e[i]=Ht(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]=Ht(n),r[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return ht.forEach(this,((r,n)=>{null!=r&&!1!==r&&(e[n]=t&&ht.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[zt]=this[zt]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=Gt(t);e[n]||(function(t,e){const r=ht.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 ht.isArray(t)?t.forEach(n):n(t),this}}Wt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ht.reduceDescriptors(Wt.prototype,(({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}})),ht.freezeMethods(Wt);const Jt=Wt;function Vt(t,e){const r=this||Mt,n=e||r,o=Jt.from(n.headers);let i=n.data;return ht.forEach(t,(function(t){i=t.call(r,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function Yt(t){return!(!t||!t.__CANCEL__)}function $t(t,e,r){gt.call(this,null==t?"canceled":t,gt.ERR_CANCELED,e,r),this.name="CanceledError"}ht.inherits($t,gt,{__CANCEL__:!0});const Xt=$t;function Zt(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new gt("Request failed with status code "+r.status,[gt.ERR_BAD_REQUEST,gt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}const Qt=(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 d=u&&c-u;return d?Math.round(1e3*f/d):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)},te=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},ee=t=>(...e)=>ht.asap((()=>t(...e))),re=Dt.hasStandardBrowserEnv?function(){const t=Dt.navigator&&/(msie|trident)/i.test(Dt.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=ht.isString(t)?n(t):t;return e.protocol===r.protocol&&e.host===r.host}}():function(){return!0},ne=Dt.hasStandardBrowserEnv?{write(t,e,r,n,o,i){const a=[t+"="+encodeURIComponent(e)];ht.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),ht.isString(n)&&a.push("path="+n),ht.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 oe(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 ie=t=>t instanceof Jt?{...t}:t;function ae(t,e){e=e||{};const r={};function n(t,e,r){return ht.isPlainObject(t)&&ht.isPlainObject(e)?ht.merge.call({caseless:r},t,e):ht.isPlainObject(e)?ht.merge({},e):ht.isArray(e)?e.slice():e}function o(t,e,r){return ht.isUndefined(e)?ht.isUndefined(t)?void 0:n(void 0,t,r):n(t,e,r)}function i(t,e){if(!ht.isUndefined(e))return n(void 0,e)}function a(t,e){return ht.isUndefined(e)?ht.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(ie(t),ie(e),!0)};return ht.forEach(Object.keys(Object.assign({},t,e)),(function(n){const i=c[n]||o,a=i(t[n],e[n],n);ht.isUndefined(a)&&i!==s||(r[n]=a)})),r}const se=t=>{const e=ae({},t);let r,{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:c}=e;if(e.headers=s=Jt.from(s),e.url=Pt(oe(e.baseURL,e.url),t.params,t.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),ht.isFormData(n))if(Dt.hasStandardBrowserEnv||Dt.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(Dt.hasStandardBrowserEnv&&(o&&ht.isFunction(o)&&(o=o(e)),o||!1!==o&&re(e.url))){const t=i&&a&&ne.read(a);t&&s.set(i,t)}return e},ce="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){const n=se(t);let o=n.data;const i=Jt.from(n.headers).normalize();let a,s,c,u,l,{responseType:f,onUploadProgress:d,onDownloadProgress:h}=n;function p(){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=Jt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Zt((function(t){e(t),p()}),(function(t){r(t),p()}),{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 gt("Request aborted",gt.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new gt("Network Error",gt.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||Tt;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new gt(e,o.clarifyTimeoutError?gt.ETIMEDOUT:gt.ECONNABORTED,t,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&ht.forEach(i.toJSON(),(function(t,e){y.setRequestHeader(e,t)})),ht.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),f&&"json"!==f&&(y.responseType=n.responseType),h&&([c,l]=Qt(h,!0),y.addEventListener("progress",c)),d&&y.upload&&([s,u]=Qt(d),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(a=e=>{y&&(r(!e||e.type?new Xt(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 g=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);g&&-1===Dt.protocols.indexOf(g)?r(new gt("Unsupported protocol "+g+":",gt.ERR_BAD_REQUEST,t)):y.send(o||null)}))},ue=(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 gt?e:new Xt(e instanceof Error?e.message:e))}};let i=e&&setTimeout((()=>{i=null,o(new gt(`timeout ${e} of ms exceeded`,gt.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=()=>ht.asap(a),s}},le=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},fe=(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*le(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})},de="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,he=de&&"function"==typeof ReadableStream,pe=de&&("function"==typeof TextEncoder?(ye=new TextEncoder,t=>ye.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var ye;const me=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},ge=he&&me((()=>{let t=!1;const e=new Request(Dt.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),be=he&&me((()=>ht.isReadableStream(new Response("").body))),ve={stream:be&&(t=>t.body)};var we;de&&(we=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!ve[t]&&(ve[t]=ht.isFunction(we[t])?e=>e[t]():(e,r)=>{throw new gt(`Response type '${t}' is not supported`,gt.ERR_NOT_SUPPORT,r)})})));const Ee=de&&(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:d}=se(t);u=u?(u+"").toLowerCase():"text";let h,p=ue([o,i&&i.toAbortSignal()],a);const y=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let m;try{if(c&&ge&&"get"!==r&&"head"!==r&&0!==(m=await(async(t,e)=>{const r=ht.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(ht.isBlob(t))return t.size;if(ht.isSpecCompliantForm(t)){const e=new Request(Dt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return ht.isArrayBufferView(t)||ht.isArrayBuffer(t)?t.byteLength:(ht.isURLSearchParams(t)&&(t+=""),ht.isString(t)?(await pe(t)).byteLength:void 0)})(e):r})(l,n))){let t,r=new Request(e,{method:"POST",body:n,duplex:"half"});if(ht.isFormData(n)&&(t=r.headers.get("content-type"))&&l.setContentType(t),r.body){const[t,e]=te(m,Qt(ee(c)));n=fe(r.body,65536,t,e)}}ht.isString(f)||(f=f?"include":"omit");const o="credentials"in Request.prototype;h=new Request(e,{...d,signal:p,method:r.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:o?f:void 0});let i=await fetch(h);const a=be&&("stream"===u||"response"===u);if(be&&(s||a&&y)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=i[e]}));const e=ht.toFiniteNumber(i.headers.get("content-length")),[r,n]=s&&te(e,Qt(ee(s),!0))||[];i=new Response(fe(i.body,65536,r,(()=>{n&&n(),y&&y()})),t)}u=u||"text";let g=await ve[ht.findKey(ve,u)||"text"](i,t);return!a&&y&&y(),await new Promise(((e,r)=>{Zt(e,r,{data:g,headers:Jt.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 gt("Network Error",gt.ERR_NETWORK,t,h),{cause:e.cause||e});throw gt.from(e,e&&e.code,t,h)}}),Oe={http:null,xhr:ce,fetch:Ee};ht.forEach(Oe,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Se=t=>`- ${t}`,xe=t=>ht.isFunction(t)||null===t||!1===t,Re=t=>{t=ht.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,!xe(r)&&(n=Oe[(e=String(r)).toLowerCase()],void 0===n))throw new gt(`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(Se).join("\n"):" "+Se(t[0]):"as no adapter specified";throw new gt("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return n};function Ae(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Xt(null,t)}function je(t){return Ae(t),t.headers=Jt.from(t.headers),t.data=Vt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Re(t.adapter||Mt.adapter)(t).then((function(e){return Ae(t),e.data=Vt.call(t,t.transformResponse,e),e.headers=Jt.from(e.headers),e}),(function(e){return Yt(e)||(Ae(t),e&&e.response&&(e.response.data=Vt.call(t,t.transformResponse,e.response),e.response.headers=Jt.from(e.response.headers))),Promise.reject(e)}))}const Pe={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Pe[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const Ne={};Pe.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 gt(n(o," has been removed"+(e?" in "+e:"")),gt.ERR_DEPRECATED);return e&&!Ne[o]&&(Ne[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 Te={assertOptions:function(t,e,r){if("object"!=typeof t)throw new gt("options must be an object",gt.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 gt("option "+i+" must be "+r,gt.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new gt("Unknown option "+i,gt.ERR_BAD_OPTION)}},validators:Pe},Le=Te.validators;class _e{constructor(t){this.defaults=t,this.interceptors={request:new Nt,response:new Nt}}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=ae(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;void 0!==r&&Te.assertOptions(r,{silentJSONParsing:Le.transitional(Le.boolean),forcedJSONParsing:Le.transitional(Le.boolean),clarifyTimeoutError:Le.transitional(Le.boolean)},!1),null!=n&&(ht.isFunction(n)?e.paramsSerializer={serialize:n}:Te.assertOptions(n,{encode:Le.function,serialize:Le.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&ht.merge(o.common,o[e.method]);o&&ht.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=Jt.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=[je.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 d=e;for(f=0;f<l;){const t=a[f++],e=a[f++];try{d=t(d)}catch(t){e.call(this,t);break}}try{u=je.call(this,d)}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 Pt(oe((t=ae(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}ht.forEach(["delete","get","head","options"],(function(t){_e.prototype[t]=function(e,r){return this.request(ae(r||{},{method:t,url:e,data:(r||{}).data}))}})),ht.forEach(["post","put","patch"],(function(t){function e(e){return function(r,n,o){return this.request(ae(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}_e.prototype[t]=e(),_e.prototype[t+"Form"]=e(!0)}));const Ce=_e;class ke{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 Xt(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 ke((function(e){t=e})),cancel:t}}}const Ie=ke,Ue={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(Ue).forEach((([t,e])=>{Ue[e]=t}));const De=Ue,Fe=function t(e){const r=new Ce(e),n=S(Ce.prototype.request,r);return ht.extend(n,Ce.prototype,r,{allOwnKeys:!0}),ht.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(ae(e,r))},n}(Mt);function Be(t){return Be="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},Be(t)}function Me(){Me=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 g?e:g,a=Object.create(i.prototype),s=new T(n||[]);return o(a,"_invoke",{value:A(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 d="suspendedStart",h="suspendedYield",p="executing",y="completed",m={};function g(){}function b(){}function v(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(L([])));O&&O!==r&&n.call(O,a)&&(w=O);var S=v.prototype=g.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function R(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"==Be(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 A(e,r,n){var o=d;return function(i,a){if(o===p)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===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;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 P(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 N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(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(Be(e)+" is not iterable")}return b.prototype=v,o(S,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:b,configurable:!0}),b.displayName=u(v,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,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},x(R.prototype),u(R.prototype,s,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new R(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(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=L,T.prototype={constructor:T,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(N),!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),N(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;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function qe(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 ze(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){qe(i,n,o,a,s,"next",t)}function s(t){qe(i,n,o,a,s,"throw",t)}a(void 0)}))}}Fe.Axios=Ce,Fe.CanceledError=Xt,Fe.CancelToken=Ie,Fe.isCancel=Yt,Fe.VERSION="1.7.7",Fe.toFormData=Ot,Fe.AxiosError=gt,Fe.Cancel=Fe.CanceledError,Fe.all=function(t){return Promise.all(t)},Fe.spread=function(t){return function(e){return t.apply(null,e)}},Fe.isAxiosError=function(t){return ht.isObject(t)&&!0===t.isAxiosError},Fe.mergeConfig=ae,Fe.AxiosHeaders=Jt,Fe.formToJSON=t=>Ft(ht.isHTMLForm(t)?new FormData(t):t),Fe.getAdapter=Re,Fe.HttpStatusCode=De,Fe.default=Fe;var Ge=Fe.create({baseURL:m.BACKEND_DOMAIN,headers:{"Content-Type":"application/json"},timeout:15e3});const He={createOrder:function(){var t=ze(Me().mark((function t(e){var r,n,o,i,a;return Me().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.entityId,n=e.appId,o=e.order,i=e.redirectUrl,t.next=3,Ge.post("/api/payments/create-order",{entityId:r,appId:n,order:o,redirectUrl:i});case 3:return a=t.sent,t.abrupt("return",a.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),verifyOrderStatus:function(){var t=ze(Me().mark((function t(e){var r,n,o,i,a;return Me().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.entityId,o=e.checkoutId,i=e.resourcePath,t.next=3,Ge.post("/api/payments/verify-status",{appId:r,entityId:n,checkoutId:o,resourcePath:i});case 3:return a=t.sent,t.abrupt("return",a.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()};function Ke(t){return Ke="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},Ke(t)}function We(){We=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 g?e:g,a=Object.create(i.prototype),s=new T(n||[]);return o(a,"_invoke",{value:A(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 d="suspendedStart",h="suspendedYield",p="executing",y="completed",m={};function g(){}function b(){}function v(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(L([])));O&&O!==r&&n.call(O,a)&&(w=O);var S=v.prototype=g.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function R(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"==Ke(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 A(e,r,n){var o=d;return function(i,a){if(o===p)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===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;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 P(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 N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(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(Ke(e)+" is not iterable")}return b.prototype=v,o(S,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:b,configurable:!0}),b.displayName=u(v,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,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},x(R.prototype),u(R.prototype,s,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new R(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(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=L,T.prototype={constructor:T,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(N),!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),N(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;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Je(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 Ve(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Je(i,n,o,a,s,"next",t)}function s(t){Je(i,n,o,a,s,"throw",t)}a(void 0)}))}}function Ye(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return $e(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$e(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Xe={hyperpay:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,g.jsx)(b,{checkoutId:e.checkoutId,redirectUrl:r,onChange:n})},paypal:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,g.jsx)(v,{approvalUrl:e.approvalUrl,redirectUrl:r,onChange:n})},stripe:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,g.jsx)(w,{clientSecret:e.clientSecret,publishableKey:e.publishableKey,redirectUrl:r,onChange:n})},meps:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,g.jsx)(E,{checkoutId:e.checkoutId,redirectUrl:r,onChange:n})},network:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,g.jsx)(O,{approvalUrl:e.approvalUrl,redirectUrl:r,onChange:n})}},Ze=function(t,e){Xe[t]=e},Qe=function(t){var e=t.entityId,r=void 0===e?null:e,n=t.appId,o=void 0===n?null:n,a=t.order,s=void 0===a?null:a,c=t.redirectUrl,u=void 0===c?"":c,l=t.onChange,f=Ye((0,i.useState)(!1),2),d=f[0],h=f[1],p=Ye((0,i.useState)(null),2),y=p[0],m=p[1],g=Ye((0,i.useState)(null),2),b=g[0],v=g[1];return(0,i.useEffect)((function(){if(s&&r&&o){var t=!0,e=function(){var e=Ve(We().mark((function e(){var n,i;return We().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,h(!0),m(null),e.next=5,He.createOrder({entityId:r,appId:o,order:s,redirectUrl:u});case 5:n=e.sent,t&&(v(n),l&&l({status:"order_created",provider:n.provider,data:n})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),console.error("Order creation error:",e.t0),t&&(i=(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Failed to initiate payment order.",m(i),l&&l({status:"error",error:i}));case 13:return e.prev=13,t&&h(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[0,9,13,16]])})));return function(){return e.apply(this,arguments)}}();return e(),function(){t=!1}}}),[r,o,s,u]),d?i.default.createElement("div",{className:"payment-sdk-loading"},"Initializing payment..."):y?i.default.createElement("div",{className:"payment-sdk-error"},y):null!=b&&b.provider&&Xe[b.provider]?(0,Xe[b.provider])({orderData:b,redirectUrl:u,onChange:l}):null},tr=function(){var t=Ve(We().mark((function t(e){var r,n,o,i;return We().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.entityId,o=e.checkoutId,i=e.resourcePath,t.next=3,He.verifyOrderStatus({appId:r,entityId:n,checkoutId:o,resourcePath:i});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),er=n.qT,rr=n.Rb,nr=n.IZ;export{er as PymentOrder,rr as registerPaymentProvider,nr as verifyOrder};
|
|
2
|
+
import*as t from"react";import*as e from"react/jsx-runtime";var 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]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};r.d(n,{qT:()=>rr,Rb:()=>er,IZ:()=>nr});var o={};r.r(o),r.d(o,{hasBrowserEnv:()=>_t,hasStandardBrowserEnv:()=>kt,hasStandardBrowserWebWorkerEnv:()=>Dt,navigator:()=>Ct,origin:()=>It});const i=(a={default:()=>t.default,useEffect:()=>t.useEffect,useState:()=>t.useState},s={},r.d(s,a),s);var a,s;function c(t){return c="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},c(t)}function u(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 l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==c(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var d=function(t){switch((process.env.NEXT_PUBLIC_PAYMENT_ENV||"").trim().toLowerCase()){case"stage":case"staging":return"staging";case"dev":case"development":case"local":return"development";default:return"production"}}(),p={BACKEND_DOMAIN:"https://stage.banking.atech-workspace.com/api/sdk",HYPERPAY_DOMAIN:"https://test.oppwa.com",MEPS_DOMAIN:"https://meps-test.gateway.mastercard.com",STRIPE_DOMAIN:"https://js.stripe.com",NETWORK_DOMAIN:"https://network-test.payment.com",PAYPAL_DOMAIN:"https://www.sandbox.paypal.com"},h={production:{BACKEND_DOMAIN:"https://banking.atech-workspace.com/api/sdk",HYPERPAY_DOMAIN:"https://oppwa.com",MEPS_DOMAIN:"https://meps.gateway.mastercard.com",STRIPE_DOMAIN:"https://js.stripe.com",NETWORK_DOMAIN:"https://network.payment.com",PAYPAL_DOMAIN:"https://www.paypal.com"},staging:p,development:p}[d],y=l(l({ENV:d},h),{},{getGatewayCheckoutUrl:function(t,e){return function(t,e,r){switch(e.toLowerCase()){case"hyperpay":return r?"".concat(t.HYPERPAY_DOMAIN,"/v1/paymentWidgets.js?checkoutId=").concat(r):t.HYPERPAY_DOMAIN;case"meps":return r?"".concat(t.MEPS_DOMAIN,"/checkout/version/60/checkout.js"):t.MEPS_DOMAIN;case"stripe":return t.STRIPE_DOMAIN;case"paypal":return r&&!r.startsWith("http")?"".concat(t.PAYPAL_DOMAIN).concat(r):r||t.PAYPAL_DOMAIN;case"network":return r&&!r.startsWith("http")?"".concat(t.NETWORK_DOMAIN).concat(r):r||t.NETWORK_DOMAIN;default:return t.BACKEND_DOMAIN}}(h,t,e)}});const m=y,g=(t=>{var e={};return r.d(e,t),e})({jsx:()=>e.jsx}),b=function(t){var e=t.checkoutId,r=t.redirectUrl;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("hyperpay",e),r=document.createElement("script");return r.src=t,r.async=!0,document.body.appendChild(r),function(){document.body.contains(r)&&document.body.removeChild(r)}}}),[e]),e?(0,g.jsx)("form",{action:r||window.location.href,className:"paymentWidgets","data-brands":"VISA MASTER AMEX"}):(0,g.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing HyperPay checkoutId"})},v=function(t){var e=t.approvalUrl;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("paypal",e);window.location.href=t}}),[e]),e?(0,g.jsx)("p",{className:"text-slate-300 font-mono text-xs",children:"Redirecting to PayPal secure checkout..."}):(0,g.jsx)("p",{className:"text-red-500 font-mono text-xs",children:"Error: Missing PayPal approval URL."})},w=function(t){var e=t.clientSecret,r=t.publishableKey;return(0,i.useEffect)((function(){if(e&&r){var t=m.getGatewayCheckoutUrl("stripe"),n=document.createElement("script");return n.src=t,n.async=!0,n.onload=function(){console.log("Stripe JS loaded from:",t)},document.body.appendChild(n),function(){document.body.contains(n)&&document.body.removeChild(n)}}}),[e,r]),e&&r?(0,g.jsx)("div",{id:"stripe-checkout-container",className:"stripe-payment-container",children:(0,g.jsx)("p",{className:"text-slate-400 text-xs font-mono",children:"Initializing Stripe Payment Elements..."})}):(0,g.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing Stripe clientSecret or publishableKey"})},E=function(t){var e=t.checkoutId;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("meps",e),r=document.createElement("script");return r.src=t,r.async=!0,r.setAttribute("data-error","errorCallback"),r.setAttribute("data-cancel","cancelCallback"),document.body.appendChild(r),function(){document.body.contains(r)&&document.body.removeChild(r)}}}),[e]),e?(0,g.jsx)("div",{id:"embed-target",className:"meps-payment-container",children:(0,g.jsx)("p",{className:"text-slate-400 text-xs font-mono",children:"Loading MEPS checkout session..."})}):(0,g.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing MEPS Checkout ID"})},O=function(t){var e=t.approvalUrl;return(0,i.useEffect)((function(){if(e){var t=m.getGatewayCheckoutUrl("network",e);window.location.href=t}}),[e]),e?(0,g.jsx)("p",{className:"text-slate-300 font-mono text-xs",children:"Redirecting to Network International payment page..."}):(0,g.jsx)("p",{className:"text-red-500 font-mono text-xs",children:"Error: Missing Network International payment URL."})};function S(t,e){return function(){return t.apply(e,arguments)}}const{toString:x}=Object.prototype,{getPrototypeOf:R}=Object,j=(A=Object.create(null),t=>{const e=x.call(t);return A[e]||(A[e]=e.slice(8,-1).toLowerCase())});var A;const P=t=>(t=t.toLowerCase(),e=>j(e)===t),T=t=>e=>typeof e===t,{isArray:N}=Array,L=T("undefined"),_=P("ArrayBuffer"),C=T("string"),k=T("function"),D=T("number"),I=t=>null!==t&&"object"==typeof t,U=t=>{if("object"!==j(t))return!1;const e=R(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},F=P("Date"),B=P("File"),M=P("Blob"),q=P("FileList"),z=P("URLSearchParams"),[G,H,K,W]=["ReadableStream","Request","Response","Headers"].map(P);function J(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),N(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 V(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 Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,$=t=>!L(t)&&t!==Y,X=(Z="undefined"!=typeof Uint8Array&&R(Uint8Array),t=>Z&&t instanceof Z);var Z;const Q=P("HTMLFormElement"),tt=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),et=P("RegExp"),rt=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};J(r,((r,o)=>{let i;!1!==(i=e(r,o,t))&&(n[o]=i||r)})),Object.defineProperties(t,n)},nt="abcdefghijklmnopqrstuvwxyz",ot="0123456789",it={DIGIT:ot,ALPHA:nt,ALPHA_DIGIT:nt+nt.toUpperCase()+ot},at=P("AsyncFunction"),st=(ct="function"==typeof setImmediate,ut=k(Y.postMessage),ct?setImmediate:ut?(lt=`axios@${Math.random()}`,ft=[],Y.addEventListener("message",(({source:t,data:e})=>{t===Y&&e===lt&&ft.length&&ft.shift()()}),!1),t=>{ft.push(t),Y.postMessage(lt,"*")}):t=>setTimeout(t));var ct,ut,lt,ft;const dt="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Y):"undefined"!=typeof process&&process.nextTick||st,pt={isArray:N,isArrayBuffer:_,isBuffer:function(t){return null!==t&&!L(t)&&null!==t.constructor&&!L(t.constructor)&&k(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||k(t.append)&&("formdata"===(e=j(t))||"object"===e&&k(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&_(t.buffer),e},isString:C,isNumber:D,isBoolean:t=>!0===t||!1===t,isObject:I,isPlainObject:U,isReadableStream:G,isRequest:H,isResponse:K,isHeaders:W,isUndefined:L,isDate:F,isFile:B,isBlob:M,isRegExp:et,isFunction:k,isStream:t=>I(t)&&k(t.pipe),isURLSearchParams:z,isTypedArray:X,isFileList:q,forEach:J,merge:function t(){const{caseless:e}=$(this)&&this||{},r={},n=(n,o)=>{const i=e&&V(r,o)||o;U(r[i])&&U(n)?r[i]=t(r[i],n):U(n)?r[i]=t({},n):N(n)?r[i]=n.slice():r[i]=n};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&J(arguments[t],n);return r},extend:(t,e,r,{allOwnKeys:n}={})=>(J(e,((e,n)=>{r&&k(e)?t[n]=S(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&&R(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:j,kindOfTest:P,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(N(t))return t;let e=t.length;if(!D(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:Q,hasOwnProperty:tt,hasOwnProp:tt,reduceDescriptors:rt,freezeMethods:t=>{rt(t,((e,r)=>{if(k(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];k(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 N(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:V,global:Y,isContextDefined:$,ALPHABET:it,generateString:(t=16,e=it.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r},isSpecCompliantForm:function(t){return!!(t&&k(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(I(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=N(t)?[]:{};return J(t,((t,e)=>{const i=r(t,n+1);!L(i)&&(o[e]=i)})),e[n]=void 0,o}}return t};return r(t,0)},isAsyncFn:at,isThenable:t=>t&&(I(t)||k(t))&&k(t.then)&&k(t.catch),setImmediate:st,asap:dt};function ht(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)}pt.inherits(ht,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:pt.toJSONObject(this.config),code:this.code,status:this.status}}});const yt=ht.prototype,mt={};["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=>{mt[t]={value:t}})),Object.defineProperties(ht,mt),Object.defineProperty(yt,"isAxiosError",{value:!0}),ht.from=(t,e,r,n,o,i)=>{const a=Object.create(yt);return pt.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),ht.call(a,t.message,e,r,n,o),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const gt=ht;function bt(t){return pt.isPlainObject(t)||pt.isArray(t)}function vt(t){return pt.endsWith(t,"[]")?t.slice(0,-2):t}function wt(t,e,r){return t?t.concat(e).map((function(t,e){return t=vt(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const Et=pt.toFlatObject(pt,{},null,(function(t){return/^is[A-Z]/.test(t)})),Ot=function(t,e,r){if(!pt.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const n=(r=pt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!pt.isUndefined(e[t])}))).metaTokens,o=r.visitor||u,i=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&pt.isSpecCompliantForm(e);if(!pt.isFunction(o))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(pt.isDate(t))return t.toISOString();if(!s&&pt.isBlob(t))throw new gt("Blob is not supported. Use a Buffer instead.");return pt.isArrayBuffer(t)||pt.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(pt.endsWith(r,"{}"))r=n?r:r.slice(0,-2),t=JSON.stringify(t);else if(pt.isArray(t)&&function(t){return pt.isArray(t)&&!t.some(bt)}(t)||(pt.isFileList(t)||pt.endsWith(r,"[]"))&&(s=pt.toArray(t)))return r=vt(r),s.forEach((function(t,n){!pt.isUndefined(t)&&null!==t&&e.append(!0===a?wt([r],n,i):null===a?r:r+"[]",c(t))})),!1;return!!bt(t)||(e.append(wt(o,r,i),c(t)),!1)}const l=[],f=Object.assign(Et,{defaultVisitor:u,convertValue:c,isVisitable:bt});if(!pt.isObject(t))throw new TypeError("data must be an object");return function t(r,n){if(!pt.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+n.join("."));l.push(r),pt.forEach(r,(function(r,i){!0===(!(pt.isUndefined(r)||null===r)&&o.call(e,r,pt.isString(i)?i.trim():i,n,f))&&t(r,n?n.concat(i):[i])})),l.pop()}}(t),e};function St(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function xt(t,e){this._pairs=[],t&&Ot(t,this,e)}const Rt=xt.prototype;Rt.append=function(t,e){this._pairs.push([t,e])},Rt.toString=function(t){const e=t?function(e){return t.call(this,e,St)}:St;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const jt=xt;function At(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Pt(t,e,r){if(!e)return t;const n=r&&r.encode||At,o=r&&r.serialize;let i;if(i=o?o(e,r):pt.isURLSearchParams(e)?e.toString():new jt(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const Tt=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){pt.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},Nt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Lt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:jt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},_t="undefined"!=typeof window&&"undefined"!=typeof document,Ct="object"==typeof navigator&&navigator||void 0,kt=_t&&(!Ct||["ReactNative","NativeScript","NS"].indexOf(Ct.product)<0),Dt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,It=_t&&window.location.href||"http://localhost",Ut={...o,...Lt},Ft=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&&pt.isArray(n)?n.length:i,s?(pt.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r,!a):(n[i]&&pt.isObject(n[i])||(n[i]=[]),e(t,r,n[i],o)&&pt.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(pt.isFormData(t)&&pt.isFunction(t.entries)){const r={};return pt.forEachEntry(t,((t,n)=>{e(function(t){return pt.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),n,r,0)})),r}return null},Bt={transitional:Nt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",n=r.indexOf("application/json")>-1,o=pt.isObject(t);if(o&&pt.isHTMLForm(t)&&(t=new FormData(t)),pt.isFormData(t))return n?JSON.stringify(Ft(t)):t;if(pt.isArrayBuffer(t)||pt.isBuffer(t)||pt.isStream(t)||pt.isFile(t)||pt.isBlob(t)||pt.isReadableStream(t))return t;if(pt.isArrayBufferView(t))return t.buffer;if(pt.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 Ot(t,new Ut.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return Ut.isNode&&pt.isBuffer(t)?(this.append(e,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=pt.isFileList(t))||r.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Ot(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||n?(e.setContentType("application/json",!1),function(t,e,r){if(pt.isString(t))try{return(0,JSON.parse)(t),pt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||Bt.transitional,r=e&&e.forcedJSONParsing,n="json"===this.responseType;if(pt.isResponse(t)||pt.isReadableStream(t))return t;if(t&&pt.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 gt.from(t,gt.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:Ut.classes.FormData,Blob:Ut.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};pt.forEach(["delete","get","head","post","put","patch"],(t=>{Bt.headers[t]={}}));const Mt=Bt,qt=pt.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"]),zt=Symbol("internals");function Gt(t){return t&&String(t).trim().toLowerCase()}function Ht(t){return!1===t||null==t?t:pt.isArray(t)?t.map(Ht):String(t)}function Kt(t,e,r,n,o){return pt.isFunction(n)?n.call(this,e,r):(o&&(e=r),pt.isString(e)?pt.isString(n)?-1!==e.indexOf(n):pt.isRegExp(n)?n.test(e):void 0:void 0)}class Wt{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=Gt(e);if(!o)throw new Error("header name must be a non-empty string");const i=pt.findKey(n,o);(!i||void 0===n[i]||!0===r||void 0===r&&!1!==n[i])&&(n[i||e]=Ht(t))}const i=(t,e)=>pt.forEach(t,((t,r)=>o(t,r,e)));if(pt.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(pt.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]&&qt[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(pt.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=Gt(t)){const r=pt.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(pt.isFunction(e))return e.call(this,t,r);if(pt.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Gt(t)){const r=pt.findKey(this,t);return!(!r||void 0===this[r]||e&&!Kt(0,this[r],r,e))}return!1}delete(t,e){const r=this;let n=!1;function o(t){if(t=Gt(t)){const o=pt.findKey(r,t);!o||e&&!Kt(0,r[o],o,e)||(delete r[o],n=!0)}}return pt.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&&!Kt(0,this[o],o,t,!0)||(delete this[o],n=!0)}return n}normalize(t){const e=this,r={};return pt.forEach(this,((n,o)=>{const i=pt.findKey(r,o);if(i)return e[i]=Ht(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]=Ht(n),r[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return pt.forEach(this,((r,n)=>{null!=r&&!1!==r&&(e[n]=t&&pt.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[zt]=this[zt]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=Gt(t);e[n]||(function(t,e){const r=pt.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 pt.isArray(t)?t.forEach(n):n(t),this}}Wt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),pt.reduceDescriptors(Wt.prototype,(({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}})),pt.freezeMethods(Wt);const Jt=Wt;function Vt(t,e){const r=this||Mt,n=e||r,o=Jt.from(n.headers);let i=n.data;return pt.forEach(t,(function(t){i=t.call(r,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function Yt(t){return!(!t||!t.__CANCEL__)}function $t(t,e,r){gt.call(this,null==t?"canceled":t,gt.ERR_CANCELED,e,r),this.name="CanceledError"}pt.inherits($t,gt,{__CANCEL__:!0});const Xt=$t;function Zt(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new gt("Request failed with status code "+r.status,[gt.ERR_BAD_REQUEST,gt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}const Qt=(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 d=u&&c-u;return d?Math.round(1e3*f/d):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)},te=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},ee=t=>(...e)=>pt.asap((()=>t(...e))),re=Ut.hasStandardBrowserEnv?function(){const t=Ut.navigator&&/(msie|trident)/i.test(Ut.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=pt.isString(t)?n(t):t;return e.protocol===r.protocol&&e.host===r.host}}():function(){return!0},ne=Ut.hasStandardBrowserEnv?{write(t,e,r,n,o,i){const a=[t+"="+encodeURIComponent(e)];pt.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),pt.isString(n)&&a.push("path="+n),pt.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 oe(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 ie=t=>t instanceof Jt?{...t}:t;function ae(t,e){e=e||{};const r={};function n(t,e,r){return pt.isPlainObject(t)&&pt.isPlainObject(e)?pt.merge.call({caseless:r},t,e):pt.isPlainObject(e)?pt.merge({},e):pt.isArray(e)?e.slice():e}function o(t,e,r){return pt.isUndefined(e)?pt.isUndefined(t)?void 0:n(void 0,t,r):n(t,e,r)}function i(t,e){if(!pt.isUndefined(e))return n(void 0,e)}function a(t,e){return pt.isUndefined(e)?pt.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(ie(t),ie(e),!0)};return pt.forEach(Object.keys(Object.assign({},t,e)),(function(n){const i=c[n]||o,a=i(t[n],e[n],n);pt.isUndefined(a)&&i!==s||(r[n]=a)})),r}const se=t=>{const e=ae({},t);let r,{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:c}=e;if(e.headers=s=Jt.from(s),e.url=Pt(oe(e.baseURL,e.url),t.params,t.paramsSerializer),c&&s.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),pt.isFormData(n))if(Ut.hasStandardBrowserEnv||Ut.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(Ut.hasStandardBrowserEnv&&(o&&pt.isFunction(o)&&(o=o(e)),o||!1!==o&&re(e.url))){const t=i&&a&&ne.read(a);t&&s.set(i,t)}return e},ce="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){const n=se(t);let o=n.data;const i=Jt.from(n.headers).normalize();let a,s,c,u,l,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=n;function h(){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=Jt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Zt((function(t){e(t),h()}),(function(t){r(t),h()}),{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 gt("Request aborted",gt.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new gt("Network Error",gt.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||Nt;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new gt(e,o.clarifyTimeoutError?gt.ETIMEDOUT:gt.ECONNABORTED,t,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&pt.forEach(i.toJSON(),(function(t,e){y.setRequestHeader(e,t)})),pt.isUndefined(n.withCredentials)||(y.withCredentials=!!n.withCredentials),f&&"json"!==f&&(y.responseType=n.responseType),p&&([c,l]=Qt(p,!0),y.addEventListener("progress",c)),d&&y.upload&&([s,u]=Qt(d),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(a=e=>{y&&(r(!e||e.type?new Xt(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 g=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(n.url);g&&-1===Ut.protocols.indexOf(g)?r(new gt("Unsupported protocol "+g+":",gt.ERR_BAD_REQUEST,t)):y.send(o||null)}))},ue=(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 gt?e:new Xt(e instanceof Error?e.message:e))}};let i=e&&setTimeout((()=>{i=null,o(new gt(`timeout ${e} of ms exceeded`,gt.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=()=>pt.asap(a),s}},le=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},fe=(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*le(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})},de="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,pe=de&&"function"==typeof ReadableStream,he=de&&("function"==typeof TextEncoder?(ye=new TextEncoder,t=>ye.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var ye;const me=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},ge=pe&&me((()=>{let t=!1;const e=new Request(Ut.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),be=pe&&me((()=>pt.isReadableStream(new Response("").body))),ve={stream:be&&(t=>t.body)};var we;de&&(we=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!ve[t]&&(ve[t]=pt.isFunction(we[t])?e=>e[t]():(e,r)=>{throw new gt(`Response type '${t}' is not supported`,gt.ERR_NOT_SUPPORT,r)})})));const Ee=de&&(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:d}=se(t);u=u?(u+"").toLowerCase():"text";let p,h=ue([o,i&&i.toAbortSignal()],a);const y=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let m;try{if(c&&ge&&"get"!==r&&"head"!==r&&0!==(m=await(async(t,e)=>{const r=pt.toFiniteNumber(t.getContentLength());return null==r?(async t=>{if(null==t)return 0;if(pt.isBlob(t))return t.size;if(pt.isSpecCompliantForm(t)){const e=new Request(Ut.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return pt.isArrayBufferView(t)||pt.isArrayBuffer(t)?t.byteLength:(pt.isURLSearchParams(t)&&(t+=""),pt.isString(t)?(await he(t)).byteLength:void 0)})(e):r})(l,n))){let t,r=new Request(e,{method:"POST",body:n,duplex:"half"});if(pt.isFormData(n)&&(t=r.headers.get("content-type"))&&l.setContentType(t),r.body){const[t,e]=te(m,Qt(ee(c)));n=fe(r.body,65536,t,e)}}pt.isString(f)||(f=f?"include":"omit");const o="credentials"in Request.prototype;p=new Request(e,{...d,signal:h,method:r.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:o?f:void 0});let i=await fetch(p);const a=be&&("stream"===u||"response"===u);if(be&&(s||a&&y)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=i[e]}));const e=pt.toFiniteNumber(i.headers.get("content-length")),[r,n]=s&&te(e,Qt(ee(s),!0))||[];i=new Response(fe(i.body,65536,r,(()=>{n&&n(),y&&y()})),t)}u=u||"text";let g=await ve[pt.findKey(ve,u)||"text"](i,t);return!a&&y&&y(),await new Promise(((e,r)=>{Zt(e,r,{data:g,headers:Jt.from(i.headers),status:i.status,statusText:i.statusText,config:t,request:p})}))}catch(e){if(y&&y(),e&&"TypeError"===e.name&&/fetch/i.test(e.message))throw Object.assign(new gt("Network Error",gt.ERR_NETWORK,t,p),{cause:e.cause||e});throw gt.from(e,e&&e.code,t,p)}}),Oe={http:null,xhr:ce,fetch:Ee};pt.forEach(Oe,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Se=t=>`- ${t}`,xe=t=>pt.isFunction(t)||null===t||!1===t,Re=t=>{t=pt.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,!xe(r)&&(n=Oe[(e=String(r)).toLowerCase()],void 0===n))throw new gt(`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(Se).join("\n"):" "+Se(t[0]):"as no adapter specified";throw new gt("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return n};function je(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Xt(null,t)}function Ae(t){return je(t),t.headers=Jt.from(t.headers),t.data=Vt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Re(t.adapter||Mt.adapter)(t).then((function(e){return je(t),e.data=Vt.call(t,t.transformResponse,e),e.headers=Jt.from(e.headers),e}),(function(e){return Yt(e)||(je(t),e&&e.response&&(e.response.data=Vt.call(t,t.transformResponse,e.response),e.response.headers=Jt.from(e.response.headers))),Promise.reject(e)}))}const Pe={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Pe[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const Te={};Pe.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 gt(n(o," has been removed"+(e?" in "+e:"")),gt.ERR_DEPRECATED);return e&&!Te[o]&&(Te[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 Ne={assertOptions:function(t,e,r){if("object"!=typeof t)throw new gt("options must be an object",gt.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 gt("option "+i+" must be "+r,gt.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new gt("Unknown option "+i,gt.ERR_BAD_OPTION)}},validators:Pe},Le=Ne.validators;class _e{constructor(t){this.defaults=t,this.interceptors={request:new Tt,response:new Tt}}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=ae(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;void 0!==r&&Ne.assertOptions(r,{silentJSONParsing:Le.transitional(Le.boolean),forcedJSONParsing:Le.transitional(Le.boolean),clarifyTimeoutError:Le.transitional(Le.boolean)},!1),null!=n&&(pt.isFunction(n)?e.paramsSerializer={serialize:n}:Ne.assertOptions(n,{encode:Le.function,serialize:Le.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&pt.merge(o.common,o[e.method]);o&&pt.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=Jt.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=[Ae.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 d=e;for(f=0;f<l;){const t=a[f++],e=a[f++];try{d=t(d)}catch(t){e.call(this,t);break}}try{u=Ae.call(this,d)}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 Pt(oe((t=ae(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}pt.forEach(["delete","get","head","options"],(function(t){_e.prototype[t]=function(e,r){return this.request(ae(r||{},{method:t,url:e,data:(r||{}).data}))}})),pt.forEach(["post","put","patch"],(function(t){function e(e){return function(r,n,o){return this.request(ae(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}_e.prototype[t]=e(),_e.prototype[t+"Form"]=e(!0)}));const Ce=_e;class ke{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 Xt(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 ke((function(e){t=e})),cancel:t}}}const De=ke,Ie={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(Ie).forEach((([t,e])=>{Ie[e]=t}));const Ue=Ie,Fe=function t(e){const r=new Ce(e),n=S(Ce.prototype.request,r);return pt.extend(n,Ce.prototype,r,{allOwnKeys:!0}),pt.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(ae(e,r))},n}(Mt);function Be(t){return Be="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},Be(t)}function Me(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 qe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Me(Object(r),!0).forEach((function(e){ze(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Me(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ze(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Be(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=Be(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Be(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ge(){Ge=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 g?e:g,a=Object.create(i.prototype),s=new N(n||[]);return o(a,"_invoke",{value:j(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 d="suspendedStart",p="suspendedYield",h="executing",y="completed",m={};function g(){}function b(){}function v(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(L([])));O&&O!==r&&n.call(O,a)&&(w=O);var S=v.prototype=g.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function R(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"==Be(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 j(e,r,n){var o=d;return function(i,a){if(o===h)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=A(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===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:p,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function A(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,A(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 P(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 N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(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(Be(e)+" is not iterable")}return b.prototype=v,o(S,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:b,configurable:!0}),b.displayName=u(v,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,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},x(R.prototype),u(R.prototype,s,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new R(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(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=L,N.prototype={constructor:N,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:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function He(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 Ke(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){He(i,n,o,a,s,"next",t)}function s(t){He(i,n,o,a,s,"throw",t)}a(void 0)}))}}Fe.Axios=Ce,Fe.CanceledError=Xt,Fe.CancelToken=De,Fe.isCancel=Yt,Fe.VERSION="1.7.7",Fe.toFormData=Ot,Fe.AxiosError=gt,Fe.Cancel=Fe.CanceledError,Fe.all=function(t){return Promise.all(t)},Fe.spread=function(t){return function(e){return t.apply(null,e)}},Fe.isAxiosError=function(t){return pt.isObject(t)&&!0===t.isAxiosError},Fe.mergeConfig=ae,Fe.AxiosHeaders=Jt,Fe.formToJSON=t=>Ft(pt.isHTMLForm(t)?new FormData(t):t),Fe.getAdapter=Re,Fe.HttpStatusCode=Ue,Fe.default=Fe;var We=Fe.create({baseURL:m.BACKEND_DOMAIN,headers:{"Content-Type":"application/json"},timeout:15e3});const Je={createOrder:function(){var t=Ke(Ge().mark((function t(e){var r,n,o,i,a;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.entityId,n=e.appId,o=e.order,i=e.redirectUrl,t.next=3,We.post("/orders",{entityId:r,appId:n,order:o,redirectUrl:i});case 3:return a=t.sent,t.abrupt("return",a.data.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),verifyOrderStatus:function(){var t=Ke(Ge().mark((function t(e){var r,n,o,i,a;return Ge().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.entityId,o=e.checkoutId,i=e.resourcePath,t.next=3,We.get("/orders/".concat(encodeURIComponent(o)),{params:qe({entityId:n,appId:r},i?{resourcePath:i}:{})});case 3:return a=t.sent,t.abrupt("return",a.data.data);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()};function Ve(t){return Ve="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},Ve(t)}function Ye(){Ye=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 g?e:g,a=Object.create(i.prototype),s=new N(n||[]);return o(a,"_invoke",{value:j(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 d="suspendedStart",p="suspendedYield",h="executing",y="completed",m={};function g(){}function b(){}function v(){}var w={};u(w,a,(function(){return this}));var E=Object.getPrototypeOf,O=E&&E(E(L([])));O&&O!==r&&n.call(O,a)&&(w=O);var S=v.prototype=g.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function R(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"==Ve(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 j(e,r,n){var o=d;return function(i,a){if(o===h)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=A(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===d)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:p,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function A(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,A(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 P(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 N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function L(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(Ve(e)+" is not iterable")}return b.prototype=v,o(S,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:b,configurable:!0}),b.displayName=u(v,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,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},x(R.prototype),u(R.prototype,s,(function(){return this})),e.AsyncIterator=R,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new R(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(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=L,N.prototype={constructor:N,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:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function $e(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 Xe(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){$e(i,n,o,a,s,"next",t)}function s(t){$e(i,n,o,a,s,"throw",t)}a(void 0)}))}}function Ze(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){u=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Qe(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Qe(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var tr={hyperpay:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,g.jsx)(b,{checkoutId:e.checkoutId,redirectUrl:r,onChange:n})},paypal:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,g.jsx)(v,{approvalUrl:e.approvalUrl,redirectUrl:r,onChange:n})},stripe:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,g.jsx)(w,{clientSecret:e.clientSecret,publishableKey:e.publishableKey,redirectUrl:r,onChange:n})},meps:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,g.jsx)(E,{checkoutId:e.checkoutId,redirectUrl:r,onChange:n})},network:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,g.jsx)(O,{approvalUrl:e.approvalUrl,redirectUrl:r,onChange:n})}},er=function(t,e){tr[t]=e},rr=function(t){var e=t.entityId,r=void 0===e?null:e,n=t.appId,o=void 0===n?null:n,a=t.order,s=void 0===a?null:a,c=t.redirectUrl,u=void 0===c?"":c,l=t.onChange,f=Ze((0,i.useState)(!1),2),d=f[0],p=f[1],h=Ze((0,i.useState)(null),2),y=h[0],m=h[1],g=Ze((0,i.useState)(null),2),b=g[0],v=g[1];return(0,i.useEffect)((function(){if(s&&r&&o){var t=!0,e=function(){var e=Xe(Ye().mark((function e(){var n,i;return Ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p(!0),m(null),e.next=5,Je.createOrder({entityId:r,appId:o,order:s,redirectUrl:u});case 5:n=e.sent,t&&(v(n),l&&l({status:"order_created",provider:n.provider,data:n})),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(0),console.error("Order creation error:",e.t0),t&&(i=(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Failed to initiate payment order.",m(i),l&&l({status:"error",error:i}));case 13:return e.prev=13,t&&p(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[0,9,13,16]])})));return function(){return e.apply(this,arguments)}}();return e(),function(){t=!1}}}),[r,o,s,u]),d?i.default.createElement("div",{className:"payment-sdk-loading"},"Initializing payment..."):y?i.default.createElement("div",{className:"payment-sdk-error"},y):null!=b&&b.provider&&tr[b.provider]?(0,tr[b.provider])({orderData:b,redirectUrl:u,onChange:l}):null},nr=function(){var t=Xe(Ye().mark((function t(e){var r,n,o,i;return Ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.appId,n=e.entityId,o=e.checkoutId,i=e.resourcePath,t.next=3,Je.verifyOrderStatus({appId:r,entityId:n,checkoutId:o,resourcePath:i});case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),or=n.qT,ir=n.Rb,ar=n.IZ;export{or as PymentOrder,ir as registerPaymentProvider,ar as verifyOrder};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backendConnector.d.ts","sourceRoot":"","sources":["../../../../src/shared/requests/backendConnector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EACrB,MAAM,SAAS,CAAC;AAUjB,eAAO,MAAM,WAAW,GAAU,0CAK/B,iBAAiB,KAAG,OAAO,CAAC,oBAAoB,CAQlD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAU,gDAKrC,kBAAkB,KAAG,OAAO,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"backendConnector.d.ts","sourceRoot":"","sources":["../../../../src/shared/requests/backendConnector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EACrB,MAAM,SAAS,CAAC;AAUjB,eAAO,MAAM,WAAW,GAAU,0CAK/B,iBAAiB,KAAG,OAAO,CAAC,oBAAoB,CAQlD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAU,gDAKrC,kBAAkB,KAAG,OAAO,CAAC,OAAO,CAMtC,CAAC;AAEF,QAAA,MAAM,gBAAgB;4DAvBnB,iBAAiB,KAAG,OAAO,CAAC,oBAAoB,CAAC;wEAejD,kBAAkB,KAAG,OAAO,CAAC,OAAO,CAAC;CAWvC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|