@astropay/payments-lib 1.0.3 → 1.0.4
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/astropay-payments-lib.es.js +1 -1
- package/dist/astropay-payments-lib.umd.js +1 -1
- package/dist/{main-DRDqoMYX.js → main-BtluJl6M.js} +15 -7
- package/dist/{profiler-mlb9VCiL.js → profiler-CtuhY6VX.js} +1 -1
- package/dist/{startRecording-BEASydzE.js → startRecording-hiPgcX9z.js} +1 -1
- package/package.json +1 -1
|
@@ -499,7 +499,7 @@ ${n}`:""}`;await fi(r)}};function Hr(e,t,n){return t.includes(e)?e:n}const Jh=e=
|
|
|
499
499
|
display: flex;
|
|
500
500
|
gap: 12px;
|
|
501
501
|
}
|
|
502
|
-
`;class Bg extends te{constructor(n){super({tag:"div",styles:()=>Fg()});_(this,"componentProps");_(this,"dynamicInputs",{});_(this,"onValidationChange",()=>{});if(this.componentProps=n,n.title){const r=new z({text:n.title,size:16,lineHeight:24}).element;this.element.append(r)}this.renderDynamicInputs()}renderDynamicInputs(){this.componentProps.requiredFields&&this.componentProps.requiredFields.forEach(n=>{if(n==="document_type")return;const r=zl({translate:H.translate,documentTypeOptions:this.componentProps.documentTypeOptions})[n];if(n==="document_number"){this.renderDocumentNumberWithType(r);return}this.renderStandardInput(n,r)})}renderDocumentNumberWithType(n){const r=zl({translate:H.translate,documentTypeOptions:this.componentProps.documentTypeOptions}).document_type,s=document.createElement("div");s.classList.add("row-container");const i=this.createSelectInput({name:r.name,label:r.label,placeholder:r.placeholder,options:r.options,emptyMessage:r.emptyMessage,validationRegex:r.validationRegex,validateOn:r.validateOn,maxWidth:r==null?void 0:r.maxWidth}),o=this.createTextInput({name:n.name,label:n.label,placeholder:n.placeholder,type:n.type==="select"?"text":n.type,validationRegex:n.validationRegex,validateOn:n.validateOn});this.dynamicInputs.document_type=i,this.dynamicInputs.document_number=o,i.element.addEventListener("change",()=>{this.validateForm(),this.triggerValidationChange()}),o.element.addEventListener("input",()=>{this.validateForm(),this.triggerValidationChange()}),s.append(i.element,o.element),this.element.append(s)}renderStandardInput(n,r){const s=r.type==="select"?this.createSelectInput({name:n,label:r.label,placeholder:r.placeholder,options:r.options,emptyMessage:r.emptyMessage,validationRegex:r.validationRegex,validateOn:r.validateOn,maxWidth:r.emptyMessage}):this.createTextInput({name:n,label:r.label,placeholder:r.placeholder,type:r.type,validationRegex:r.validationRegex,validateOn:r.validateOn});this.dynamicInputs[n]=s,s.element.addEventListener("input",()=>{this.validateForm(),this.triggerValidationChange()}),this.element.append(s.element)}createSelectInput(n){return new Ul(n)}createTextInput(n){return new Vl(n)}validateForm(){return Object.values(this.dynamicInputs).every(n=>n.getValue()&&n.validate())}getFormData(){const n={};return Object.entries(this.dynamicInputs).forEach(([r,s])=>{const i=s.getValue();n[r]=i!==null?String(i):""}),n}setValidationChangeHandler(n){this.onValidationChange=n,this.triggerValidationChange()}triggerValidationChange(){this.onValidationChange&&this.onValidationChange(this.validateForm())}setFieldError(n,r,s){const i=this.dynamicInputs[n];i&&(i.setErrorState(r),s&&i.setHelperText(s))}}const Ug={sandbox:{NAME:"@astropay/payments-lib",VERSION:"1.0.
|
|
502
|
+
`;class Bg extends te{constructor(n){super({tag:"div",styles:()=>Fg()});_(this,"componentProps");_(this,"dynamicInputs",{});_(this,"onValidationChange",()=>{});if(this.componentProps=n,n.title){const r=new z({text:n.title,size:16,lineHeight:24}).element;this.element.append(r)}this.renderDynamicInputs()}renderDynamicInputs(){this.componentProps.requiredFields&&this.componentProps.requiredFields.forEach(n=>{if(n==="document_type")return;const r=zl({translate:H.translate,documentTypeOptions:this.componentProps.documentTypeOptions})[n];if(n==="document_number"){this.renderDocumentNumberWithType(r);return}this.renderStandardInput(n,r)})}renderDocumentNumberWithType(n){const r=zl({translate:H.translate,documentTypeOptions:this.componentProps.documentTypeOptions}).document_type,s=document.createElement("div");s.classList.add("row-container");const i=this.createSelectInput({name:r.name,label:r.label,placeholder:r.placeholder,options:r.options,emptyMessage:r.emptyMessage,validationRegex:r.validationRegex,validateOn:r.validateOn,maxWidth:r==null?void 0:r.maxWidth}),o=this.createTextInput({name:n.name,label:n.label,placeholder:n.placeholder,type:n.type==="select"?"text":n.type,validationRegex:n.validationRegex,validateOn:n.validateOn});this.dynamicInputs.document_type=i,this.dynamicInputs.document_number=o,i.element.addEventListener("change",()=>{this.validateForm(),this.triggerValidationChange()}),o.element.addEventListener("input",()=>{this.validateForm(),this.triggerValidationChange()}),s.append(i.element,o.element),this.element.append(s)}renderStandardInput(n,r){const s=r.type==="select"?this.createSelectInput({name:n,label:r.label,placeholder:r.placeholder,options:r.options,emptyMessage:r.emptyMessage,validationRegex:r.validationRegex,validateOn:r.validateOn,maxWidth:r.emptyMessage}):this.createTextInput({name:n,label:r.label,placeholder:r.placeholder,type:r.type,validationRegex:r.validationRegex,validateOn:r.validateOn});this.dynamicInputs[n]=s,s.element.addEventListener("input",()=>{this.validateForm(),this.triggerValidationChange()}),this.element.append(s.element)}createSelectInput(n){return new Ul(n)}createTextInput(n){return new Vl(n)}validateForm(){return Object.values(this.dynamicInputs).every(n=>n.getValue()&&n.validate())}getFormData(){const n={};return Object.entries(this.dynamicInputs).forEach(([r,s])=>{const i=s.getValue();n[r]=i!==null?String(i):""}),n}setValidationChangeHandler(n){this.onValidationChange=n,this.triggerValidationChange()}triggerValidationChange(){this.onValidationChange&&this.onValidationChange(this.validateForm())}setFieldError(n,r,s){const i=this.dynamicInputs[n];i&&(i.setErrorState(r),s&&i.setHelperText(s))}}const Ug={test:{NAME:"@astropay/payments-lib",VERSION:"1.0.4",MODE:"test",API_BASE_URL:"https://partners-api-tst.astropay.com/api",RESOURCES_BUCKET:"https://rs-tst.astropay.com",CHECKOUT_URL:"https://checkout-tst.astropay.com"},sandbox:{NAME:"@astropay/payments-lib",VERSION:"1.0.4",MODE:"staging",API_BASE_URL:"https://partners-api-sandbox.astropay.com/api",RESOURCES_BUCKET:"https://rs-tst.astropay.com",CHECKOUT_URL:"https://checkout-sandbox.astropay.com"},production:{NAME:"@astropay/payments-lib",VERSION:"1.0.4",MODE:"production",API_BASE_URL:"https://partners-api.astropay.com/api",RESOURCES_BUCKET:"https://rs.astropay.com",CHECKOUT_URL:"https://checkout.astropay.com"}},it=class it{static init(t){const n=Hr(t==null?void 0:t.environment,[...qh,"test"],"production"),r=Hr(t==null?void 0:t.currencyMode,Yh,"iso");it.environment=n,it.currencyMode=r}static getRuntimeConfig(){const t=it.environment||"production";return Ug[t]}static getEnvironment(){return it.environment}static getCurrencyMode(){return it.currencyMode}static setCardConfig(t){it.cardConfig=t}static getCardConfig(){return it.cardConfig}};_(it,"environment"),_(it,"currencyMode"),_(it,"cardConfig");let fe=it;const $g={AED:"ar-AE",AOA:"pt-AO",AND:"ca-AD",ARS:"es-AR",AUD:"en-AU",BDT:"bn-BD",BGN:"bg-BG",BOB:"es-BO",BRL:"pt-BR",CAD:"en-CA",CDF:"fr-CD",CLP:"es-CL",CNY:"zh-CN",COP:"es-CO",CZK:"cs-CZ",DKK:"da-DK",EGP:"ar-EG",ETB:"am-ET",EUR:"de-DE",GBP:"en-GB",GHS:"en-GH",GTQ:"es-GT",HNL:"es-HN",HKD:"zh-HK",HUF:"hu-HU",IDR:"id-ID",INR:"hi-IN",JPY:"ja-JP",KES:"en-KE",KRW:"ko-KR",KWD:"ar-KW",KZT:"kk-KZ",LKR:"si-LK",LSL:"st-LS",MAD:"ar-MA",MGA:"mg-MG",MKD:"mk-MK",MMK:"my-MM",MNT:"mn-MN",MOP:"zh-MO",MXN:"es-MX",MYR:"ms-MY",MZN:"pt-MZ",NGN:"en-NG",NIO:"es-NI",NOK:"no-NO",NPR:"ne-NP",NZD:"en-NZ",PAB:"es-PA",PEN:"es-PE",PKR:"ur-PK",PLN:"pl-PL",PYG:"es-PY",QAR:"ar-QA",RMB:"zh-CN",RSD:"sr-RS",RUB:"ru-RU",RWF:"rw-RW",SAR:"ar-SA",SEK:"sv-SE",SLL:"en-SL",SVC:"es-SV",THB:"th-TH",TND:"ar-TN",TRY:"tr-TR",TTD:"en-TT",TWD:"zh-TW",TZS:"sw-TZ",UAH:"uk-UA",UGX:"en-UG",USD:"en-US",UYU:"es-UY",UZS:"uz-UZ",VND:"vi-VN",XAF:"fr-CM",XOF:"fr-SN",ZAR:"en-ZA",ZWD:"en-ZW",ZWL:"en-ZW"},Vg=(e,t)=>{const n=$g[t]||"en-US";return new Intl.NumberFormat(n,{style:"decimal",currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).format(e)},zg={AED:"د.إ",AOA:"Kz",AND:"€",ARS:"$",AUD:"$",BDT:"৳",BGN:"лв",BOB:"Bs.",BRL:"R$",CAD:"$",CDF:"FC",CLP:"$",CNY:"¥",COP:"$",CZK:"Kč",DKK:"kr",EGP:"£",ETB:"Br",EUR:"€",GBP:"£",GHS:"₵",GTQ:"Q",HNL:"L",HKD:"$",HUF:"Ft",IDR:"Rp",INR:"₹",JPY:"¥",KES:"KSh",KRW:"₩",KWD:"د.ك",KZT:"₸",LKR:"₨",LSL:"L",MAD:"د.م.",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MXN:"$",MYR:"RM",MZN:"MT",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",PAB:"B/.",PEN:"S/.",PKR:"₨",PLN:"zł",PYG:"₲",QAR:"﷼",RMB:"¥",RSD:"РСД",RUB:"₽",RWF:"FRw",SAR:"ر.س",SEK:"kr",SLL:"Le",SVC:"$",THB:"฿",TND:"د.ت",TRY:"₺",TTD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"US$",UYU:"$",UZS:"so'm",VND:"₫",XAF:"FCFA",XOF:"CFA",ZAR:"R",ZWD:"$",ZWL:"$"},Hg=e=>e===void 0?"":zg[e.trim()]||e,Ii=(e,t,n)=>{const r=Vg(e,t);return n==="symbol"?`${Hg(t)} ${r}`:`${r} ${t}`},jg=e=>W`
|
|
503
503
|
display: flex;
|
|
504
504
|
flex-direction: column;
|
|
505
505
|
background-color: ${e.card.backgroundColor};
|
|
@@ -5717,17 +5717,25 @@ class Wm extends te {
|
|
|
5717
5717
|
}
|
|
5718
5718
|
}
|
|
5719
5719
|
const qm = {
|
|
5720
|
+
test: {
|
|
5721
|
+
NAME: "@astropay/payments-lib",
|
|
5722
|
+
VERSION: "1.0.4",
|
|
5723
|
+
MODE: "test",
|
|
5724
|
+
API_BASE_URL: "https://partners-api-tst.astropay.com/api",
|
|
5725
|
+
RESOURCES_BUCKET: "https://rs-tst.astropay.com",
|
|
5726
|
+
CHECKOUT_URL: "https://checkout-tst.astropay.com"
|
|
5727
|
+
},
|
|
5720
5728
|
sandbox: {
|
|
5721
5729
|
NAME: "@astropay/payments-lib",
|
|
5722
|
-
VERSION: "1.0.
|
|
5730
|
+
VERSION: "1.0.4",
|
|
5723
5731
|
MODE: "staging",
|
|
5724
|
-
API_BASE_URL: "https://partners-api-sandbox.astropay.com",
|
|
5732
|
+
API_BASE_URL: "https://partners-api-sandbox.astropay.com/api",
|
|
5725
5733
|
RESOURCES_BUCKET: "https://rs-tst.astropay.com",
|
|
5726
|
-
CHECKOUT_URL: "https://checkout-
|
|
5734
|
+
CHECKOUT_URL: "https://checkout-sandbox.astropay.com"
|
|
5727
5735
|
},
|
|
5728
5736
|
production: {
|
|
5729
5737
|
NAME: "@astropay/payments-lib",
|
|
5730
|
-
VERSION: "1.0.
|
|
5738
|
+
VERSION: "1.0.4",
|
|
5731
5739
|
MODE: "production",
|
|
5732
5740
|
API_BASE_URL: "https://partners-api.astropay.com/api",
|
|
5733
5741
|
RESOURCES_BUCKET: "https://rs.astropay.com",
|
|
@@ -5737,7 +5745,7 @@ const qm = {
|
|
|
5737
5745
|
static init(t) {
|
|
5738
5746
|
const n = is(
|
|
5739
5747
|
t == null ? void 0 : t.environment,
|
|
5740
|
-
Kf,
|
|
5748
|
+
[...Kf, "test"],
|
|
5741
5749
|
"production"
|
|
5742
5750
|
), r = is(
|
|
5743
5751
|
t == null ? void 0 : t.currencyMode,
|
|
@@ -12247,7 +12255,7 @@ async function uw(e = dw) {
|
|
|
12247
12255
|
async function dw() {
|
|
12248
12256
|
return (await import(
|
|
12249
12257
|
/* webpackChunkName: "recorder" */
|
|
12250
|
-
"./startRecording-
|
|
12258
|
+
"./startRecording-hiPgcX9z.js"
|
|
12251
12259
|
)).startRecording;
|
|
12252
12260
|
}
|
|
12253
12261
|
function pw() {
|
|
@@ -12267,7 +12275,7 @@ async function fw(e = hw) {
|
|
|
12267
12275
|
async function hw() {
|
|
12268
12276
|
return (await import(
|
|
12269
12277
|
/* webpackChunkName: "profiler" */
|
|
12270
|
-
"./profiler-
|
|
12278
|
+
"./profiler-CtuhY6VX.js"
|
|
12271
12279
|
)).createRumProfiler;
|
|
12272
12280
|
}
|
|
12273
12281
|
function mw() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as A, C, b as ft, i as Y, g as V, N as h, P as X, S as pt, a as B, c as ht, d as mt, e as St, f as q, r as gt, h as Et, j as yt, k as Tt, l as j, m as J, t as _, n as x, o as M, p as K, q as N, u as Q, v as Z, w as Nt, x as vt, y as b, z as D, A as R, B as wt, D as Mt, E as It, F as Rt, G as Ct, H as bt, I as _t, J as Lt, K as Dt, L as xt, M as Ot, O as At, Q as Vt, R as Pt, T as kt, U as zt } from "./main-
|
|
1
|
+
import { s as A, C, b as ft, i as Y, g as V, N as h, P as X, S as pt, a as B, c as ht, d as mt, e as St, f as q, r as gt, h as Et, j as yt, k as Tt, l as j, m as J, t as _, n as x, o as M, p as K, q as N, u as Q, v as Z, w as Nt, x as vt, y as b, z as D, A as R, B as wt, D as Mt, E as It, F as Rt, G as Ct, H as bt, I as _t, J as Lt, K as Dt, L as xt, M as Ot, O as At, Q as Vt, R as Pt, T as kt, U as zt } from "./main-BtluJl6M.js";
|
|
2
2
|
const P = /* @__PURE__ */ new WeakMap();
|
|
3
3
|
function T(t) {
|
|
4
4
|
return P.has(t);
|
package/package.json
CHANGED