@a-tech.jo/atech_payment 1.0.17 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/index.d.ts +8 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +2 -0
  4. package/dist/index.js.LICENSE.txt +1 -0
  5. package/dist/src/config.d.ts +13 -0
  6. package/dist/src/config.d.ts.map +1 -0
  7. package/dist/src/hyperpay/hyperpayOrder.d.ts +5 -0
  8. package/dist/src/hyperpay/hyperpayOrder.d.ts.map +1 -0
  9. package/dist/src/index.d.ts +8 -0
  10. package/dist/src/index.d.ts.map +1 -0
  11. package/dist/src/meps/mepsOrder.d.ts +5 -0
  12. package/dist/src/meps/mepsOrder.d.ts.map +1 -0
  13. package/dist/src/network/networkOrder.d.ts +5 -0
  14. package/dist/src/network/networkOrder.d.ts.map +1 -0
  15. package/dist/src/paypal/paypalOrder.d.ts +5 -0
  16. package/dist/src/paypal/paypalOrder.d.ts.map +1 -0
  17. package/dist/src/shared/config.d.ts +7 -0
  18. package/dist/src/shared/config.d.ts.map +1 -0
  19. package/dist/src/shared/requests/backendConnector.d.ts +9 -0
  20. package/dist/src/shared/requests/backendConnector.d.ts.map +1 -0
  21. package/dist/src/shared/requests/stripeConnector.d.ts +13 -0
  22. package/dist/src/shared/requests/stripeConnector.d.ts.map +1 -0
  23. package/dist/src/stripe/stripeOrder.d.ts +5 -0
  24. package/dist/src/stripe/stripeOrder.d.ts.map +1 -0
  25. package/dist/src/types/index.d.ts +70 -0
  26. package/dist/src/types/index.d.ts.map +1 -0
  27. package/dist/tsup.config.d.ts +3 -0
  28. package/dist/tsup.config.d.ts.map +1 -0
  29. package/package.json +27 -19
  30. package/.babelrc +0 -4
  31. package/.env.example +0 -1
  32. package/build/index.js +0 -2
  33. package/build/index.js.LICENSE.txt +0 -11
  34. package/documentation/hyperpay.md +0 -18
  35. package/example/hyperpay/requests/createOrder.json +0 -37
  36. package/example/hyperpay/use.js +0 -0
  37. package/example/paypal.js +0 -0
  38. package/index.html +0 -12
  39. package/index.js +0 -44
  40. package/src/hyperpay/hyperpayOrder.js +0 -100
  41. package/src/paypal/buttonWrapper.js +0 -76
  42. package/src/paypal/paypalOrder.js +0 -33
  43. package/src/shared/config.js +0 -20
  44. package/src/shared/paypalService.js +0 -16
  45. package/src/shared/requests/backendConnector.js +0 -24
  46. package/src/shared/requests/hyperpayConnector.js +0 -56
  47. package/src/shared/requests/request.js +0 -92
  48. package/webpack.config.js +0 -47
@@ -0,0 +1,8 @@
1
+ import { type ReactNode } from "react";
2
+ import type { BackendOrderResponse, CreateOrderParams, GatewayStrategyProps, HyperpayOrderProps, MepsOrderProps, NetworkOrderProps, OrderObject, PaymentComponentStrategy, PaymentOrderProps, PaypalOrderProps, StripeOrderProps, VerifyOrderParams, VerifyOrderPayload } from "@/types";
3
+ export type { BackendOrderResponse, CreateOrderParams, GatewayStrategyProps, HyperpayOrderProps, MepsOrderProps, NetworkOrderProps, OrderObject, PaymentComponentStrategy, PaymentOrderProps, PaypalOrderProps, StripeOrderProps, VerifyOrderParams, VerifyOrderPayload, };
4
+ export declare const registerPaymentProvider: (name: string, componentStrategy: PaymentComponentStrategy) => void;
5
+ declare const PymentOrder: (props: PaymentOrderProps) => ReactNode;
6
+ declare const verifyOrder: ({ appId, entityId, checkoutId, resourcePath, }: VerifyOrderParams) => Promise<unknown>;
7
+ export { PymentOrder, verifyOrder };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AASnE,OAAO,KAAK,EACR,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EACrB,MAAM,SAAS,CAAC;AAIjB,YAAY,EACR,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,wBAAwB,EACxB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACrB,CAAC;AA2CF,eAAO,MAAM,uBAAuB,GAChC,MAAM,MAAM,EACZ,mBAAmB,wBAAwB,KAC5C,IAEF,CAAC;AAIF,QAAA,MAAM,WAAW,GAAI,OAAO,iBAAiB,KAAG,SA+D/C,CAAC;AAIF,QAAA,MAAM,WAAW,GAAU,gDAKxB,iBAAiB,KAAG,OAAO,CAAC,OAAO,CAOrC,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
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:()=>Ze,Rb:()=>Xe,IZ:()=>Qe});var o={};r.r(o),r.d(o,{hasBrowserEnv:()=>It,hasStandardBrowserEnv:()=>Ct,hasStandardBrowserWebWorkerEnv:()=>Lt,navigator:()=>jt,origin:()=>Dt});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 p="production",d={BACKEND_DOMAIN:"MISSING_ENV_VAR".REACT_APP_BACKEND_DOMAIN||"https://banking.atech-workspace.com/api/sdk",HYPERPAY_DOMAIN:"MISSING_ENV_VAR".REACT_APP_HYPERPAY_DOMAIN||"https://oppwa.com",MEPS_DOMAIN:"MISSING_ENV_VAR".REACT_APP_MEPS_DOMAIN||"https://meps.gateway.mastercard.com",STRIPE_DOMAIN:"MISSING_ENV_VAR".REACT_APP_STRIPE_DOMAIN||"https://js.stripe.com",NETWORK_DOMAIN:"MISSING_ENV_VAR".REACT_APP_NETWORK_DOMAIN||"https://network.payment.com",PAYPAL_DOMAIN:"MISSING_ENV_VAR".REACT_APP_PAYPAL_DOMAIN||"https://www.paypal.com"};["stage","staging"].includes(p)&&(d={BACKEND_DOMAIN:"MISSING_ENV_VAR".REACT_APP_BACKEND_DOMAIN||"https://banking.atech-workspace.com/api/sdk",HYPERPAY_DOMAIN:"MISSING_ENV_VAR".REACT_APP_HYPERPAY_DOMAIN||"https://test.oppwa.com",MEPS_DOMAIN:"MISSING_ENV_VAR".REACT_APP_MEPS_DOMAIN||"https://meps-test.gateway.mastercard.com",STRIPE_DOMAIN:"MISSING_ENV_VAR".REACT_APP_STRIPE_DOMAIN||"https://js.stripe.com",NETWORK_DOMAIN:"MISSING_ENV_VAR".REACT_APP_NETWORK_DOMAIN||"https://network-test.payment.com",PAYPAL_DOMAIN:"MISSING_ENV_VAR".REACT_APP_PAYPAL_DOMAIN||"https://www.sandbox.paypal.com"}),["development","local"].includes(p)&&(d={BACKEND_DOMAIN:"MISSING_ENV_VAR".REACT_APP_BACKEND_DOMAIN||"https://banking.atech-workspace.com/api/sdk",HYPERPAY_DOMAIN:"MISSING_ENV_VAR".REACT_APP_HYPERPAY_DOMAIN||"https://test.oppwa.com",MEPS_DOMAIN:"MISSING_ENV_VAR".REACT_APP_MEPS_DOMAIN||"https://meps-test.gateway.mastercard.com",STRIPE_DOMAIN:"MISSING_ENV_VAR".REACT_APP_STRIPE_DOMAIN||"https://js.stripe.com",NETWORK_DOMAIN:"MISSING_ENV_VAR".REACT_APP_NETWORK_DOMAIN||"https://network-test.payment.com",PAYPAL_DOMAIN:"MISSING_ENV_VAR".REACT_APP_PAYPAL_DOMAIN||"https://www.sandbox.paypal.com"});var h=l(l({ENV:p},d),{},{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}}(d,t,e)}});const y=h,m=(t=>{var e={};return r.d(e,t),e})({jsx:()=>e.jsx}),g=function(t){var e=t.checkoutId,r=t.redirectUrl;return(0,i.useEffect)((function(){if(e){var t=y.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,m.jsx)("form",{action:r||window.location.href,className:"paymentWidgets","data-brands":"VISA MASTER AMEX"}):(0,m.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing HyperPay checkoutId"})},b=function(t){var e=t.approvalUrl;return(0,i.useEffect)((function(){if(e){var t=y.getGatewayCheckoutUrl("paypal",e);window.location.href=t}}),[e]),e?(0,m.jsx)("p",{className:"text-slate-300 font-mono text-xs",children:"Redirecting to PayPal secure checkout..."}):(0,m.jsx)("p",{className:"text-red-500 font-mono text-xs",children:"Error: Missing PayPal approval URL."})},v=function(t){var e=t.clientSecret,r=t.publishableKey;return(0,i.useEffect)((function(){if(e&&r){var t=y.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,m.jsx)("div",{id:"stripe-checkout-container",className:"stripe-payment-container",children:(0,m.jsx)("p",{className:"text-slate-400 text-xs font-mono",children:"Initializing Stripe Payment Elements..."})}):(0,m.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing Stripe clientSecret or publishableKey"})},w=function(t){var e=t.checkoutId;return(0,i.useEffect)((function(){if(e){var t=y.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,m.jsx)("div",{id:"embed-target",className:"meps-payment-container",children:(0,m.jsx)("p",{className:"text-slate-400 text-xs font-mono",children:"Loading MEPS checkout session..."})}):(0,m.jsx)("div",{className:"text-red-500 font-mono text-xs",children:"Error: Missing MEPS Checkout ID"})},E=function(t){var e=t.approvalUrl;return(0,i.useEffect)((function(){if(e){var t=y.getGatewayCheckoutUrl("network",e);window.location.href=t}}),[e]),e?(0,m.jsx)("p",{className:"text-slate-300 font-mono text-xs",children:"Redirecting to Network International payment page..."}):(0,m.jsx)("p",{className:"text-red-500 font-mono text-xs",children:"Error: Missing Network International payment URL."})};function O(t,e){return function(){return t.apply(e,arguments)}}const{toString:A}=Object.prototype,{getPrototypeOf:S}=Object,_=(R=Object.create(null),t=>{const e=A.call(t);return R[e]||(R[e]=e.slice(8,-1).toLowerCase())});var R;const N=t=>(t=t.toLowerCase(),e=>_(e)===t),P=t=>e=>typeof e===t,{isArray:x}=Array,T=P("undefined"),I=N("ArrayBuffer"),j=P("string"),C=P("function"),L=P("number"),D=t=>null!==t&&"object"==typeof t,k=t=>{if("object"!==_(t))return!1;const e=S(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},M=N("Date"),U=N("File"),F=N("Blob"),B=N("FileList"),V=N("URLSearchParams"),[q,G,K,H]=["ReadableStream","Request","Response","Headers"].map(N);function z(t,e,{allOwnKeys:r=!1}={}){if(null==t)return;let n,o;if("object"!=typeof t&&(t=[t]),x(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 W(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,J=t=>!T(t)&&t!==Y,$=(X="undefined"!=typeof Uint8Array&&S(Uint8Array),t=>X&&t instanceof X);var X;const Z=N("HTMLFormElement"),Q=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),tt=N("RegExp"),et=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};z(r,((r,o)=>{let i;!1!==(i=e(r,o,t))&&(n[o]=i||r)})),Object.defineProperties(t,n)},rt="abcdefghijklmnopqrstuvwxyz",nt="0123456789",ot={DIGIT:nt,ALPHA:rt,ALPHA_DIGIT:rt+rt.toUpperCase()+nt},it=N("AsyncFunction"),at=(st="function"==typeof setImmediate,ct=C(Y.postMessage),st?setImmediate:ct?(ut=`axios@${Math.random()}`,lt=[],Y.addEventListener("message",(({source:t,data:e})=>{t===Y&&e===ut&&lt.length&&lt.shift()()}),!1),t=>{lt.push(t),Y.postMessage(ut,"*")}):t=>setTimeout(t));var st,ct,ut,lt;const ft="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Y):"undefined"!=typeof process&&process.nextTick||at,pt={isArray:x,isArrayBuffer:I,isBuffer:function(t){return null!==t&&!T(t)&&null!==t.constructor&&!T(t.constructor)&&C(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||C(t.append)&&("formdata"===(e=_(t))||"object"===e&&C(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&I(t.buffer),e},isString:j,isNumber:L,isBoolean:t=>!0===t||!1===t,isObject:D,isPlainObject:k,isReadableStream:q,isRequest:G,isResponse:K,isHeaders:H,isUndefined:T,isDate:M,isFile:U,isBlob:F,isRegExp:tt,isFunction:C,isStream:t=>D(t)&&C(t.pipe),isURLSearchParams:V,isTypedArray:$,isFileList:B,forEach:z,merge:function t(){const{caseless:e}=J(this)&&this||{},r={},n=(n,o)=>{const i=e&&W(r,o)||o;k(r[i])&&k(n)?r[i]=t(r[i],n):k(n)?r[i]=t({},n):x(n)?r[i]=n.slice():r[i]=n};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&z(arguments[t],n);return r},extend:(t,e,r,{allOwnKeys:n}={})=>(z(e,((e,n)=>{r&&C(e)?t[n]=O(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&&S(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},kindOf:_,kindOfTest:N,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(x(t))return t;let e=t.length;if(!L(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:Z,hasOwnProperty:Q,hasOwnProp:Q,reduceDescriptors:et,freezeMethods:t=>{et(t,((e,r)=>{if(C(t)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=t[r];C(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 x(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:W,global:Y,isContextDefined:J,ALPHABET:ot,generateString:(t=16,e=ot.ALPHA_DIGIT)=>{let r="";const{length:n}=e;for(;t--;)r+=e[Math.random()*n|0];return r},isSpecCompliantForm:function(t){return!!(t&&C(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),r=(t,n)=>{if(D(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[n]=t;const o=x(t)?[]:{};return z(t,((t,e)=>{const i=r(t,n+1);!T(i)&&(o[e]=i)})),e[n]=void 0,o}}return t};return r(t,0)},isAsyncFn:it,isThenable:t=>t&&(D(t)||C(t))&&C(t.then)&&C(t.catch),setImmediate:at,asap:ft};function dt(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(dt,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 ht=dt.prototype,yt={};["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=>{yt[t]={value:t}})),Object.defineProperties(dt,yt),Object.defineProperty(ht,"isAxiosError",{value:!0}),dt.from=(t,e,r,n,o,i)=>{const a=Object.create(ht);return pt.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),dt.call(a,t.message,e,r,n,o),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const mt=dt;function gt(t){return pt.isPlainObject(t)||pt.isArray(t)}function bt(t){return pt.endsWith(t,"[]")?t.slice(0,-2):t}function vt(t,e,r){return t?t.concat(e).map((function(t,e){return t=bt(t),!r&&e?"["+t+"]":t})).join(r?".":""):e}const wt=pt.toFlatObject(pt,{},null,(function(t){return/^is[A-Z]/.test(t)})),Et=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 mt("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(gt)}(t)||(pt.isFileList(t)||pt.endsWith(r,"[]"))&&(s=pt.toArray(t)))return r=bt(r),s.forEach((function(t,n){!pt.isUndefined(t)&&null!==t&&e.append(!0===a?vt([r],n,i):null===a?r:r+"[]",c(t))})),!1;return!!gt(t)||(e.append(vt(o,r,i),c(t)),!1)}const l=[],f=Object.assign(wt,{defaultVisitor:u,convertValue:c,isVisitable:gt});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 Ot(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function At(t,e){this._pairs=[],t&&Et(t,this,e)}const St=At.prototype;St.append=function(t,e){this._pairs.push([t,e])},St.toString=function(t){const e=t?function(e){return t.call(this,e,Ot)}:Ot;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const _t=At;function Rt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Nt(t,e,r){if(!e)return t;const n=r&&r.encode||Rt,o=r&&r.serialize;let i;if(i=o?o(e,r):pt.isURLSearchParams(e)?e.toString():new _t(e,r).toString(n),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}const Pt=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)}))}},xt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Tt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:_t,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},It="undefined"!=typeof window&&"undefined"!=typeof document,jt="object"==typeof navigator&&navigator||void 0,Ct=It&&(!jt||["ReactNative","NativeScript","NS"].indexOf(jt.product)<0),Lt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Dt=It&&window.location.href||"http://localhost",kt={...o,...Tt},Mt=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},Ut={transitional:xt,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(Mt(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 Et(t,new kt.classes.URLSearchParams,Object.assign({visitor:function(t,e,r,n){return kt.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 Et(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||Ut.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 mt.from(t,mt.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:kt.classes.FormData,Blob:kt.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=>{Ut.headers[t]={}}));const Ft=Ut,Bt=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"]),Vt=Symbol("internals");function qt(t){return t&&String(t).trim().toLowerCase()}function Gt(t){return!1===t||null==t?t:pt.isArray(t)?t.map(Gt):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 Ht{constructor(t){t&&this.set(t)}set(t,e,r){const n=this;function o(t,e,r){const o=qt(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]=Gt(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]&&Bt[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=qt(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=qt(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=qt(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]=Gt(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]=Gt(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[Vt]=this[Vt]={accessors:{}}).accessors,r=this.prototype;function n(t){const n=qt(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}}Ht.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),pt.reduceDescriptors(Ht.prototype,(({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[r]=t}}})),pt.freezeMethods(Ht);const zt=Ht;function Wt(t,e){const r=this||Ft,n=e||r,o=zt.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 Jt(t,e,r){mt.call(this,null==t?"canceled":t,mt.ERR_CANCELED,e,r),this.name="CanceledError"}pt.inherits(Jt,mt,{__CANCEL__:!0});const $t=Jt;function Xt(t,e,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(new mt("Request failed with status code "+r.status,[mt.ERR_BAD_REQUEST,mt.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):t(r)}const Zt=(t,e,r=3)=>{let n=0;const o=function(t,e){t=t||10;const r=new Array(t),n=new Array(t);let o,i=0,a=0;return e=void 0!==e?e:1e3,function(s){const c=Date.now(),u=n[a];o||(o=c),r[i]=s,n[i]=c;let l=a,f=0;for(;l!==i;)f+=r[l++],l%=t;if(i=(i+1)%t,i===a&&(a=(a+1)%t),c-o<e)return;const p=u&&c-u;return p?Math.round(1e3*f/p):void 0}}(50,250);return function(t,e){let r,n,o=0,i=1e3/e;const a=(e,i=Date.now())=>{o=i,r=null,n&&(clearTimeout(n),n=null),t.apply(null,e)};return[(...t)=>{const e=Date.now(),s=e-o;s>=i?a(t,e):(r=t,n||(n=setTimeout((()=>{n=null,a(r)}),i-s)))},()=>r&&a(r)]}((r=>{const i=r.loaded,a=r.lengthComputable?r.total:void 0,s=i-n,c=o(s);n=i,t({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&i<=a?(a-i)/c:void 0,event:r,lengthComputable:null!=a,[e?"download":"upload"]:!0})}),r)},Qt=(t,e)=>{const r=null!=t;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},te=t=>(...e)=>pt.asap((()=>t(...e))),ee=kt.hasStandardBrowserEnv?function(){const t=kt.navigator&&/(msie|trident)/i.test(kt.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},re=kt.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 ne(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 oe=t=>t instanceof zt?{...t}:t;function ie(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(oe(t),oe(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 ae=t=>{const e=ie({},t);let r,{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:c}=e;if(e.headers=s=zt.from(s),e.url=Nt(ne(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(kt.hasStandardBrowserEnv||kt.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(kt.hasStandardBrowserEnv&&(o&&pt.isFunction(o)&&(o=o(e)),o||!1!==o&&ee(e.url))){const t=i&&a&&re.read(a);t&&s.set(i,t)}return e},se="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,r){const n=ae(t);let o=n.data;const i=zt.from(n.headers).normalize();let a,s,c,u,l,{responseType:f,onUploadProgress:p,onDownloadProgress:d}=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=zt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Xt((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 mt("Request aborted",mt.ECONNABORTED,t,y)),y=null)},y.onerror=function(){r(new mt("Network Error",mt.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||xt;n.timeoutErrorMessage&&(e=n.timeoutErrorMessage),r(new mt(e,o.clarifyTimeoutError?mt.ETIMEDOUT:mt.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),d&&([c,l]=Zt(d,!0),y.addEventListener("progress",c)),p&&y.upload&&([s,u]=Zt(p),y.upload.addEventListener("progress",s),y.upload.addEventListener("loadend",u)),(n.cancelToken||n.signal)&&(a=e=>{y&&(r(!e||e.type?new $t(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===kt.protocols.indexOf(g)?r(new mt("Unsupported protocol "+g+":",mt.ERR_BAD_REQUEST,t)):y.send(o||null)}))},ce=(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 mt?e:new $t(e instanceof Error?e.message:e))}};let i=e&&setTimeout((()=>{i=null,o(new mt(`timeout ${e} of ms exceeded`,mt.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}},ue=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},le=(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*ue(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})},fe="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,pe=fe&&"function"==typeof ReadableStream,de=fe&&("function"==typeof TextEncoder?(he=new TextEncoder,t=>he.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var he;const ye=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},me=pe&&ye((()=>{let t=!1;const e=new Request(kt.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),ge=pe&&ye((()=>pt.isReadableStream(new Response("").body))),be={stream:ge&&(t=>t.body)};var ve;fe&&(ve=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!be[t]&&(be[t]=pt.isFunction(ve[t])?e=>e[t]():(e,r)=>{throw new mt(`Response type '${t}' is not supported`,mt.ERR_NOT_SUPPORT,r)})})));const we=fe&&(async t=>{let{url:e,method:r,data:n,signal:o,cancelToken:i,timeout:a,onDownloadProgress:s,onUploadProgress:c,responseType:u,headers:l,withCredentials:f="same-origin",fetchOptions:p}=ae(t);u=u?(u+"").toLowerCase():"text";let d,h=ce([o,i&&i.toAbortSignal()],a);const y=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let m;try{if(c&&me&&"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(kt.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 de(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]=Qt(m,Zt(te(c)));n=le(r.body,65536,t,e)}}pt.isString(f)||(f=f?"include":"omit");const o="credentials"in Request.prototype;d=new Request(e,{...p,signal:h,method:r.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:o?f:void 0});let i=await fetch(d);const a=ge&&("stream"===u||"response"===u);if(ge&&(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&&Qt(e,Zt(te(s),!0))||[];i=new Response(le(i.body,65536,r,(()=>{n&&n(),y&&y()})),t)}u=u||"text";let g=await be[pt.findKey(be,u)||"text"](i,t);return!a&&y&&y(),await new Promise(((e,r)=>{Xt(e,r,{data:g,headers:zt.from(i.headers),status:i.status,statusText:i.statusText,config:t,request:d})}))}catch(e){if(y&&y(),e&&"TypeError"===e.name&&/fetch/i.test(e.message))throw Object.assign(new mt("Network Error",mt.ERR_NETWORK,t,d),{cause:e.cause||e});throw mt.from(e,e&&e.code,t,d)}}),Ee={http:null,xhr:se,fetch:we};pt.forEach(Ee,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Oe=t=>`- ${t}`,Ae=t=>pt.isFunction(t)||null===t||!1===t,Se=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,!Ae(r)&&(n=Ee[(e=String(r)).toLowerCase()],void 0===n))throw new mt(`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(Oe).join("\n"):" "+Oe(t[0]):"as no adapter specified";throw new mt("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return n};function _e(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new $t(null,t)}function Re(t){return _e(t),t.headers=zt.from(t.headers),t.data=Wt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Se(t.adapter||Ft.adapter)(t).then((function(e){return _e(t),e.data=Wt.call(t,t.transformResponse,e),e.headers=zt.from(e.headers),e}),(function(e){return Yt(e)||(_e(t),e&&e.response&&(e.response.data=Wt.call(t,t.transformResponse,e.response),e.response.headers=zt.from(e.response.headers))),Promise.reject(e)}))}const Ne={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Ne[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const Pe={};Ne.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 mt(n(o," has been removed"+(e?" in "+e:"")),mt.ERR_DEPRECATED);return e&&!Pe[o]&&(Pe[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 xe={assertOptions:function(t,e,r){if("object"!=typeof t)throw new mt("options must be an object",mt.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 mt("option "+i+" must be "+r,mt.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new mt("Unknown option "+i,mt.ERR_BAD_OPTION)}},validators:Ne},Te=xe.validators;class Ie{constructor(t){this.defaults=t,this.interceptors={request:new Pt,response:new Pt}}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=ie(this.defaults,e);const{transitional:r,paramsSerializer:n,headers:o}=e;void 0!==r&&xe.assertOptions(r,{silentJSONParsing:Te.transitional(Te.boolean),forcedJSONParsing:Te.transitional(Te.boolean),clarifyTimeoutError:Te.transitional(Te.boolean)},!1),null!=n&&(pt.isFunction(n)?e.paramsSerializer={serialize:n}:xe.assertOptions(n,{encode:Te.function,serialize:Te.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=zt.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=[Re.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,c),l=t.length,u=Promise.resolve(e);f<l;)u=u.then(t[f++],t[f++]);return u}l=a.length;let p=e;for(f=0;f<l;){const t=a[f++],e=a[f++];try{p=t(p)}catch(t){e.call(this,t);break}}try{u=Re.call(this,p)}catch(t){return Promise.reject(t)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(t){return Nt(ne((t=ie(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}pt.forEach(["delete","get","head","options"],(function(t){Ie.prototype[t]=function(e,r){return this.request(ie(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(ie(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Ie.prototype[t]=e(),Ie.prototype[t+"Form"]=e(!0)}));const je=Ie;class Ce{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 $t(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 Ce((function(e){t=e})),cancel:t}}}const Le=Ce,De={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(De).forEach((([t,e])=>{De[e]=t}));const ke=De,Me=function t(e){const r=new je(e),n=O(je.prototype.request,r);return pt.extend(n,je.prototype,r,{allOwnKeys:!0}),pt.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return t(ie(e,r))},n}(Ft);function Ue(t){return Ue="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},Ue(t)}function Fe(){Fe=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:R(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",d="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(I([])));O&&O!==r&&n.call(O,a)&&(w=O);var A=v.prototype=g.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function _(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"==Ue(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 R(e,r,n){var o=p;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=N(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function N(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,N(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 x(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 I(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(Ue(e)+" is not iterable")}return b.prototype=v,o(A,"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(A),t},e.awrap=function(t){return{__await:t}},S(_.prototype),u(_.prototype,s,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(A),u(A,c,"Generator"),u(A,a,(function(){return this})),u(A,"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=I,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(x),!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),x(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;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Be(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){Be(i,n,o,a,s,"next",t)}function s(t){Be(i,n,o,a,s,"throw",t)}a(void 0)}))}}Me.Axios=je,Me.CanceledError=$t,Me.CancelToken=Le,Me.isCancel=Yt,Me.VERSION="1.7.7",Me.toFormData=Et,Me.AxiosError=mt,Me.Cancel=Me.CanceledError,Me.all=function(t){return Promise.all(t)},Me.spread=function(t){return function(e){return t.apply(null,e)}},Me.isAxiosError=function(t){return pt.isObject(t)&&!0===t.isAxiosError},Me.mergeConfig=ie,Me.AxiosHeaders=zt,Me.formToJSON=t=>Mt(pt.isHTMLForm(t)?new FormData(t):t),Me.getAdapter=Se,Me.HttpStatusCode=ke,Me.default=Me;var qe=Me.create({baseURL:y.BACKEND_DOMAIN,headers:{"Content-Type":"application/json"},timeout:15e3});const Ge={createOrder:function(){var t=Ve(Fe().mark((function t(e){var r,n,o,i,a;return Fe().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,qe.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=Ve(Fe().mark((function t(e){var r,n,o,i,a;return Fe().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,qe.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 He(){He=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:R(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p="suspendedStart",d="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(I([])));O&&O!==r&&n.call(O,a)&&(w=O);var A=v.prototype=g.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function _(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 R(e,r,n){var o=p;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=N(s,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?y:d,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function N(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,N(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 x(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 I(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(A,"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(A),t},e.awrap=function(t){return{__await:t}},S(_.prototype),u(_.prototype,s,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(A),u(A,c,"Generator"),u(A,a,(function(){return this})),u(A,"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=I,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(x),!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),x(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;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function ze(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 We(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ze(i,n,o,a,s,"next",t)}function s(t){ze(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 Je(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)?Je(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 Je(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 $e={hyperpay:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,m.jsx)(g,{checkoutId:e.checkoutId,redirectUrl:r,onChange:n})},paypal:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,m.jsx)(b,{approvalUrl:e.approvalUrl,redirectUrl:r,onChange:n})},stripe:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,m.jsx)(v,{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,m.jsx)(w,{checkoutId:e.checkoutId,redirectUrl:r,onChange:n})},network:function(t){var e=t.orderData,r=t.redirectUrl,n=t.onChange;return(0,m.jsx)(E,{approvalUrl:e.approvalUrl,redirectUrl:r,onChange:n})}},Xe=function(t,e){$e[t]=e},Ze=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),p=f[0],d=f[1],h=Ye((0,i.useState)(null),2),y=h[0],m=h[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=We(He().mark((function e(){var n,i;return He().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,d(!0),m(null),e.next=5,Ge.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&&d(!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]),p?i.default.createElement("div",{className:"payment-sdk-loading"},"Initializing payment..."):y?i.default.createElement("div",{className:"payment-sdk-error"},y):null!=b&&b.provider&&$e[b.provider]?(0,$e[b.provider])({orderData:b,redirectUrl:u,onChange:l}):null},Qe=function(){var t=We(He().mark((function t(e){var r,n,o,i;return He().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.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)}}(),tr=n.qT,er=n.Rb,rr=n.IZ;export{tr as PymentOrder,er as registerPaymentProvider,rr as verifyOrder};
@@ -0,0 +1 @@
1
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
@@ -0,0 +1,13 @@
1
+ export interface AppConfig {
2
+ ENV: string;
3
+ BACKEND_DOMAIN: string;
4
+ HYPERPAY_DOMAIN: string;
5
+ MEPS_DOMAIN: string;
6
+ STRIPE_DOMAIN: string;
7
+ NETWORK_DOMAIN: string;
8
+ PAYPAL_DOMAIN: string;
9
+ getGatewayCheckoutUrl: (provider: string, identifier?: string) => string;
10
+ }
11
+ declare const config: AppConfig;
12
+ export default config;
13
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;CAC5E;AAwED,QAAA,MAAM,MAAM,EAAE,SAKb,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import type { HyperpayOrderProps } from "@/types";
3
+ declare const HyperpayOrder: React.FC<HyperpayOrderProps>;
4
+ export default HyperpayOrder;
5
+ //# sourceMappingURL=hyperpayOrder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hyperpayOrder.d.ts","sourceRoot":"","sources":["../../../src/hyperpay/hyperpayOrder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGlD,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA8B/C,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { default as HyperpayOrder } from "./hyperpay/hyperpayOrder";
2
+ export { default as PaypalOrder } from "./paypal/paypalOrder";
3
+ export { default as StripeOrder } from "./stripe/stripeOrder";
4
+ export { default as MepsOrder } from "./meps/mepsOrder";
5
+ export { default as NetworkOrder } from "./network/networkOrder";
6
+ export { default as backendConnector } from "./shared/requests/backendConnector";
7
+ export * from "./types";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGjE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAGjF,cAAc,SAAS,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import type { MepsOrderProps } from "@/types";
3
+ declare const MepsOrder: React.FC<MepsOrderProps>;
4
+ export default MepsOrder;
5
+ //# sourceMappingURL=mepsOrder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mepsOrder.d.ts","sourceRoot":"","sources":["../../../src/meps/mepsOrder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA8BvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import type { NetworkOrderProps } from "@/types";
3
+ declare const NetworkOrder: React.FC<NetworkOrderProps>;
4
+ export default NetworkOrder;
5
+ //# sourceMappingURL=networkOrder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"networkOrder.d.ts","sourceRoot":"","sources":["../../../src/network/networkOrder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGjD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAa7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import type { PaypalOrderProps } from "@/types";
3
+ declare const PaypalOrder: React.FC<PaypalOrderProps>;
4
+ export default PaypalOrder;
5
+ //# sourceMappingURL=paypalOrder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paypalOrder.d.ts","sourceRoot":"","sources":["../../../src/paypal/paypalOrder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAa3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare let config: {
2
+ NODE_ENV: string;
3
+ BACKEND_BASE_URL: string;
4
+ HYPERPAY_BASE_URL: string;
5
+ };
6
+ export default config;
7
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/shared/config.tsx"],"names":[],"mappings":"AACA,QAAA,IAAI,MAAM;;;;CAIT,CAAC;AAcF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { BackendOrderResponse, CreateOrderParams, VerifyOrderPayload } from "@/types";
2
+ export declare const createOrder: ({ entityId, appId, order, redirectUrl, }: CreateOrderParams) => Promise<BackendOrderResponse>;
3
+ export declare const verifyOrderStatus: ({ appId, entityId, checkoutId, resourcePath, }: VerifyOrderPayload) => Promise<unknown>;
4
+ declare const backendConnector: {
5
+ createOrder: ({ entityId, appId, order, redirectUrl, }: CreateOrderParams) => Promise<BackendOrderResponse>;
6
+ verifyOrderStatus: ({ appId, entityId, checkoutId, resourcePath, }: VerifyOrderPayload) => Promise<unknown>;
7
+ };
8
+ export default backendConnector;
9
+ //# sourceMappingURL=backendConnector.d.ts.map
@@ -0,0 +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,CAQtC,CAAC;AAEF,QAAA,MAAM,gBAAgB;4DAzBnB,iBAAiB,KAAG,OAAO,CAAC,oBAAoB,CAAC;wEAejD,kBAAkB,KAAG,OAAO,CAAC,OAAO,CAAC;CAavC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { BackendOrderResponse, OrderObject } from "../../../index.js";
2
+ export interface CreateOrderParams {
3
+ entityId: string | null;
4
+ appId: string | null;
5
+ order: OrderObject;
6
+ redirectUrl?: string;
7
+ }
8
+ declare const backendConnector: {
9
+ createOrder({ entityId, appId, order, redirectUrl, }: CreateOrderParams): Promise<BackendOrderResponse>;
10
+ verifyOrder(provider: string, checkoutId: string): Promise<unknown>;
11
+ };
12
+ export default backendConnector;
13
+ //# sourceMappingURL=stripeConnector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stripeConnector.d.ts","sourceRoot":"","sources":["../../../../src/shared/requests/stripeConnector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEtE,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,gBAAgB;0DAMf,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,CAAC;0BAqBxB,MAAM,cAAc,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAQ5E,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import type { StripeOrderProps } from "@/types";
3
+ declare const StripeOrder: React.FC<StripeOrderProps>;
4
+ export default StripeOrder;
5
+ //# sourceMappingURL=stripeOrder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stripeOrder.d.ts","sourceRoot":"","sources":["../../../src/stripe/stripeOrder.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAgC3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,70 @@
1
+ import type { ReactNode } from "react";
2
+ export interface OrderObject {
3
+ [key: string]: unknown;
4
+ }
5
+ export interface PaymentOrderProps {
6
+ entityId?: string | null;
7
+ appId?: string | null;
8
+ order?: OrderObject;
9
+ onChange?: (data?: any) => void;
10
+ redirectUrl?: string;
11
+ }
12
+ export interface BackendOrderResponse {
13
+ provider: "stripe" | "meps" | "hyperpay" | "network" | "paypal" | string;
14
+ checkoutId?: string;
15
+ clientSecret?: string;
16
+ publishableKey?: string;
17
+ approvalUrl?: string;
18
+ rawResponse?: Record<string, unknown>;
19
+ }
20
+ export interface HyperpayOrderProps {
21
+ checkoutId?: string;
22
+ redirectUrl?: string;
23
+ onChange?: (data?: any) => void;
24
+ }
25
+ export interface StripeOrderProps {
26
+ clientSecret?: string;
27
+ publishableKey?: string;
28
+ redirectUrl?: string;
29
+ onChange?: (data?: any) => void;
30
+ }
31
+ export interface MepsOrderProps {
32
+ checkoutId?: string;
33
+ redirectUrl?: string;
34
+ onChange?: (data?: any) => void;
35
+ }
36
+ export interface PaypalOrderProps {
37
+ approvalUrl?: string;
38
+ redirectUrl?: string;
39
+ onChange?: (data?: any) => void;
40
+ }
41
+ export interface NetworkOrderProps {
42
+ approvalUrl?: string;
43
+ redirectUrl?: string;
44
+ onChange?: (data?: any) => void;
45
+ }
46
+ export interface GatewayStrategyProps {
47
+ orderData: BackendOrderResponse;
48
+ redirectUrl?: string;
49
+ onChange?: (data?: any) => void;
50
+ }
51
+ export type PaymentComponentStrategy = (props: GatewayStrategyProps) => ReactNode;
52
+ export interface VerifyOrderParams {
53
+ appId: string;
54
+ entityId: string;
55
+ checkoutId: string;
56
+ resourcePath?: string;
57
+ }
58
+ export interface VerifyOrderPayload {
59
+ appId: string;
60
+ entityId: string;
61
+ checkoutId: string;
62
+ resourcePath?: string;
63
+ }
64
+ export interface CreateOrderParams {
65
+ entityId: string | null;
66
+ appId: string | null;
67
+ order: OrderObject;
68
+ redirectUrl?: string;
69
+ }
70
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,WAAW,WAAW;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACjC,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAID,MAAM,WAAW,kBAAkB;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,cAAc;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAID,MAAM,WAAW,oBAAoB;IACjC,SAAS,EAAE,oBAAoB,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,MAAM,wBAAwB,GAAG,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAAC;AAElF,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB"}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("tsup").Options | import("tsup").Options[] | ((overrideOptions: import("tsup").Options) => import("tsup").Options | import("tsup").Options[] | Promise<import("tsup").Options | import("tsup").Options[]>);
2
+ export default _default;
3
+ //# sourceMappingURL=tsup.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tsup.config.d.ts","sourceRoot":"","sources":["../tsup.config.ts"],"names":[],"mappings":";AAEA,wBA6BG"}
package/package.json CHANGED
@@ -1,46 +1,54 @@
1
1
  {
2
2
  "name": "@a-tech.jo/atech_payment",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "type": "module",
5
5
  "description": "A-Tech Payment React Package",
6
- "source": "index.js",
7
- "main": "dist/index.js",
8
- "module": "dist/index.module.js",
9
- "unpkg": "dist/index.umd.js",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
10
18
  "publishConfig": {
11
19
  "access": "restricted"
12
20
  },
13
21
  "scripts": {
14
- "build": "webpack --mode=production --node-env=production",
15
- "dev": "microbundle watch",
16
- "test": "echo \"Error: no test specified\" && exit 1",
17
- "main": "lib/index.js",
22
+ "build": "webpack --mode=production --node-env=production && tsc --emitDeclarationOnly",
18
23
  "build:dev": "webpack --mode=development",
19
- "build:prod": "webpack --mode=production --node-env=production",
20
24
  "watch": "webpack --watch",
21
- "serve": "webpack serve",
25
+ "test": "echo \"Error: no test specified\" && exit 1",
22
26
  "publish:npm": "npm publish --access public"
23
27
  },
24
28
  "author": "A-Tech",
25
29
  "license": "GNU",
26
30
  "peerDependencies": {
27
- "react": ">=15.0.1",
28
- "react-dom": ">=15.0.1"
31
+ "react": ">=18.0.0",
32
+ "react-dom": ">=18.0.0"
29
33
  },
30
34
  "devDependencies": {
31
35
  "@babel/core": "^7.25.2",
36
+ "@babel/plugin-syntax-jsx": "^7.24.7",
32
37
  "@babel/preset-env": "^7.24.3",
33
38
  "@babel/preset-react": "^7.24.7",
34
- "@webpack-cli/generators": "^3.0.7",
39
+ "@babel/preset-typescript": "^7.24.7",
40
+ "@types/node": "^26.6.2",
41
+ "@types/react": "^19.0.0",
42
+ "@types/react-dom": "^19.0.0",
35
43
  "babel-loader": "^9.1.3",
36
44
  "dotenv-webpack": "^8.1.0",
37
- "html-webpack-plugin": "^5.6.0",
38
45
  "prettier": "^2.8.4",
39
- "react": ">=15.0.1",
40
- "react-dom": ">=15.0.1",
46
+ "react": "^19.0.0",
47
+ "react-dom": "^19.0.0",
48
+ "tsup": "^8.5.1",
49
+ "typescript": "^5.4.0",
41
50
  "webpack": "^5.91.0",
42
- "webpack-cli": "^5.1.4",
43
- "webpack-dev-server": "^5.0.4"
51
+ "webpack-cli": "^5.1.4"
44
52
  },
45
53
  "dependencies": {
46
54
  "@paypal/react-paypal-js": "^8.7.0",
package/.babelrc DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "plugins": ["@babel/syntax-dynamic-import"],
3
- "presets": ["@babel/preset-env", "@babel/preset-react"]
4
- }
package/.env.example DELETED
@@ -1 +0,0 @@
1
- NEXT_PUBLIC_NODE_ENV="production|staging"