@alipay/ams-checkout 0.0.1787898127-dev.2 → 0.0.1787898127-dev.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ams-checkout.js +3 -3
- package/dist/ams-checkout.min.js +1 -1
- package/dist/ams-checkout.min.js.map +1 -1
- package/esm/config/index.js +1 -1
- package/esm/core/component/ckp/index.js +21 -1
- package/esm/core/component/element/elementController/index.js +4 -3
- package/esm/core/component/element/modernElementController/adapter.js +3 -3
- package/esm/core/component/element/modernElementController/index.d.ts +6 -1
- package/esm/core/component/element/modernElementController/index.js +260 -189
- package/esm/core/component/element/type.d.ts +2 -2
- package/esm/foundation/service/log/keys.js +4 -0
- package/esm/index.d.ts +6 -7
- package/esm/index.js +9 -14
- package/esm/modern/index.js +1 -1
- package/esm/modern/loadAntomTracker.d.ts +7 -0
- package/esm/modern/loadAntomTracker.js +64 -0
- package/esm/modern/sdk/elements/appearanceRules.d.ts +59 -0
- package/esm/modern/tools.js +1 -1
- package/esm/tsdoc-metadata.json +1 -1
- package/esm/util/logger.js +1 -1
- package/esm/util/timezone.d.ts +1 -0
- package/esm/util/timezone.js +8 -0
- package/package.json +12 -12
- package/types.d.ts +401 -78
- package/types.untrimmed.d.ts +407 -78
package/ams-checkout.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ams-checkout.js v0.0.1787898127-dev.
|
|
3
|
-
* Build Time: 2026-09-
|
|
2
|
+
* ams-checkout.js v0.0.1787898127-dev.21
|
|
3
|
+
* Build Time: 2026-09-21T03:20:10.118Z
|
|
4
4
|
* (c) Antom Team
|
|
5
5
|
*/
|
|
6
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(function(){return function(){var e={7312:function(e){e.exports={"page.wrong.error.message":"خطأ في النظام، يرجى إعادة المحاولة لاحقًا أو الاتصال بالتاجر.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى.","ANTOMSDK.UNKNOWN_ERROR":"حدث استثناء غير معروف، يرجى التحقق من حالة الدفع والتواصل مع التاجر.","antom.common.closing":"مغلق","ANTOMSDK.API_GATEWAY_TIMEOUT":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى.","ANTOMSDK.API_TIMEOUT":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى."}},5488:function(e){e.exports={"page.wrong.error.message":"Error del sistema"}},1379:function(e){e.exports={"page.wrong.error.message":"Ein Systemfehler ist aufgetreten. Bitte versuchen Sie es später erneut oder kontaktieren Sie den Händler.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut.","ANTOMSDK.UNKNOWN_ERROR":"Unbekannte Fehlermeldung. Bitte überprüfen Sie den Zahlungsstatus und wenden Sie sich an den Händler.","antom.common.closing":"Wird geschlossen","ANTOMSDK.API_GATEWAY_TIMEOUT":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut.","ANTOMSDK.API_TIMEOUT":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut."}},3541:function(e){e.exports={"page.wrong.error.message":"Σφάλμα συστήματος"}},5168:function(e){e.exports={"page.wrong.error.message":"System error. Please try again later or contact the merchant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Request timed out. Please try again.","ANTOMSDK.UNKNOWN_ERROR":"An unknown error occurred. Please check your payment status and contact the merchant.","antom.common.closing":"Closing","ANTOMSDK.API_GATEWAY_TIMEOUT":"Request timed out. Please try again.","ANTOMSDK.API_TIMEOUT":"Request timed out. Please try again."}},7461:function(e){e.exports={"page.wrong.error.message":"Se ha producido un error en el sistema. Por favor, inténtelo de nuevo más tarde o contacte con el comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"La solicitud ha caducado, por favor inténtelo de nuevo.","ANTOMSDK.UNKNOWN_ERROR":"Se ha producido un error desconocido. Por favor, revise la situación del pago y contacte con el comerciante.","antom.common.closing":"Cerrando","ANTOMSDK.API_GATEWAY_TIMEOUT":"La solicitud ha caducado, por favor inténtelo de nuevo.","ANTOMSDK.API_TIMEOUT":"La solicitud ha caducado, por favor inténtelo de nuevo."}},3409:function(e){e.exports={"page.wrong.error.message":"Une erreur système s'est produite. Veuillez réessayer plus tard ou contacter le commerçant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"La demande a expiré, veuillez réessayer.","ANTOMSDK.UNKNOWN_ERROR":"Une erreur inconnue s'est produite. Veuillez vérifier l'état de votre paiement et contacter le commerçant.","antom.common.closing":"Fermeture en cours","ANTOMSDK.API_GATEWAY_TIMEOUT":"La demande a expiré, veuillez réessayer.","ANTOMSDK.API_TIMEOUT":"La demande a expiré, veuillez réessayer."}},6187:function(e){e.exports={"page.wrong.error.message":"सिस्टम में खराबी आ गई है। कृपया बाद में पुनः प्रयास करें या व्यापारी से संपर्क करें।","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।","ANTOMSDK.UNKNOWN_ERROR":"अज्ञात त्रुटि। कृपया अपनी भुगतान स्थिति जाँचें और व्यापारी से संपर्क करें।","antom.common.closing":"बंद हो रहा है","ANTOMSDK.API_GATEWAY_TIMEOUT":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।","ANTOMSDK.API_TIMEOUT":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।"}},1621:function(e){e.exports={"page.wrong.error.message":"Sistem sedang mengalami gangguan. Silakan coba lagi nanti atau hubungi penjual.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Permintaan habis waktu, silakan coba lagi.","ANTOMSDK.UNKNOWN_ERROR":"Terjadi kesalahan yang tidak diketahui, silakan periksa status pembayaran dan hubungi pedagang.","antom.common.closing":"Sedang ditutup","ANTOMSDK.API_GATEWAY_TIMEOUT":"Permintaan habis waktu, silakan coba lagi.","ANTOMSDK.API_TIMEOUT":"Permintaan habis waktu, silakan coba lagi."}},8010:function(e,t,n){var r={},o="en-US";for(var i in r["en-US"]=r["en-us"]=n(5168),r["pt-BR"]=r["pt-br"]=n(3029),r["es-ES"]=r["es-es"]=n(7461),r["ko-KR"]=r["ko-kr"]=n(6362),r["zh-CN"]=r["zh-cn"]=n(370),r["zh-HK"]=r["zh-hk"]=n(5598),r["ms-MY"]=r["ms-my"]=n(171),r["in-ID"]=r["in-id"]=n(1621),r["th-TH"]=r["th-th"]=n(4909),r["vi-VN"]=r["vi-vn"]=n(4734),r["tl-PH"]=r["tl-ph"]=n(7077),r["it-IT"]=r["it-it"]=n(955),r["de-DE"]=r["de-de"]=n(1379),r["fr-FR"]=r["fr-fr"]=n(3409),r["nl-NL"]=r["nl-nl"]=n(5241),r["ja-JP"]=r["ja-jp"]=n(4328),r.ro=r.ro=n(4731),r["pl-PL"]=r["pl-pl"]=n(3669),r["ar-SA"]=r["ar-sa"]=n(7312),r["tr-TR"]=r["tr-tr"]=n(3405),r["hi-IN"]=r["hi-in"]=n(6187),r["pt-PT"]=r["pt-pt"]=n(9669),r.ca=r.ca=n(5488),r.el=r.el=n(3541),r)if(r.hasOwnProperty(i)&&i!=o)for(var a in r[o])r[o].hasOwnProperty(a)&&(r[i].hasOwnProperty(a)||(r[i][a]=r[o][a]));r.appName="antom-web-checkout",r.defaultLocale=o,r.groupName="antomsdk",e.exports=r},955:function(e){e.exports={"page.wrong.error.message":"Si è verificato un errore di sistema, riprova più tardi o contatta il commerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Richiesta scaduta, per favore riprova.","ANTOMSDK.UNKNOWN_ERROR":"Errore sconosciuto. Si prega di verificare lo stato del pagamento e di contattare il commerciante.","antom.common.closing":"In chiusura","ANTOMSDK.API_GATEWAY_TIMEOUT":"Richiesta scaduta, per favore riprova.","ANTOMSDK.API_TIMEOUT":"Richiesta scaduta, per favore riprova."}},4328:function(e){e.exports={"page.wrong.error.message":"システムに異常が発生しました。後ほど再試行するか、店舗にお問い合わせください。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"リクエストがタイムアウトしました。もう一度お試しください。","ANTOMSDK.UNKNOWN_ERROR":"未知のエラーが発生しました。お支払い状況をご確認のうえ、加盟店へお問い合わせください。","antom.common.closing":"閉じています","ANTOMSDK.API_GATEWAY_TIMEOUT":"リクエストがタイムアウトしました。もう一度お試しください。","ANTOMSDK.API_TIMEOUT":"リクエストがタイムアウトしました。もう一度お試しください。"}},6362:function(e){e.exports={"page.wrong.error.message":"시스템 오류가 발생했습니다. 잠시 후 다시 시도하시거나 상점에 문의해 주세요.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"요청 시간이 초과되었습니다. 다시 시도해 주세요.","ANTOMSDK.UNKNOWN_ERROR":"알 수 없는 오류가 발생했습니다. 결제 상황을 확인하고 상점에 문의해 주세요.","antom.common.closing":"닫는 중","ANTOMSDK.API_GATEWAY_TIMEOUT":"요청 시간이 초과되었습니다. 다시 시도해 주세요.","ANTOMSDK.API_TIMEOUT":"요청 시간이 초과되었습니다. 다시 시도해 주세요."}},171:function(e){e.exports={"page.wrong.error.message":"Sistem mengalami masalah, sila cuba lagi nanti atau hubungi peniaga.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Masa permintaan tamat, sila cuba lagi.","ANTOMSDK.UNKNOWN_ERROR":"Ralat tidak diketahui. Sila semak butiran pembayaran anda dan hubungi peniaga.","antom.common.closing":"Sedang ditutup","ANTOMSDK.API_GATEWAY_TIMEOUT":"Masa permintaan tamat, sila cuba lagi.","ANTOMSDK.API_TIMEOUT":"Masa permintaan tamat, sila cuba lagi."}},5241:function(e){e.exports={"page.wrong.error.message":"Er is een systeemfout opgetreden. Probeer het later opnieuw of neem contact op met de verkoper.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw.","ANTOMSDK.UNKNOWN_ERROR":"Onbekende uitzondering. Controleer de betalingsstatus en neem contact op met de verkoper.","antom.common.closing":"Sluiten...","ANTOMSDK.API_GATEWAY_TIMEOUT":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw.","ANTOMSDK.API_TIMEOUT":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw."}},3669:function(e){e.exports={"page.wrong.error.message":"Wystąpił błąd systemu, spróbuj ponownie później lub skontaktuj się z sprzedawcą.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Przekroczono limit czasu żądania. Proszę spróbować ponownie.","ANTOMSDK.UNKNOWN_ERROR":"Wystąpił nieznany błąd. Sprawdź status płatności i skontaktuj się z sprzedawcą.","antom.common.closing":"Zamknięte","ANTOMSDK.API_GATEWAY_TIMEOUT":"Przekroczono limit czasu żądania. Proszę spróbować ponownie.","ANTOMSDK.API_TIMEOUT":"Przekroczono limit czasu żądania. Proszę spróbować ponownie."}},3029:function(e){e.exports={"page.wrong.error.message":"Ocorreu um erro no sistema. Por favor, tente novamente mais tarde ou entre em contato com o comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"O tempo de solicitação expirou. Por favor, tente novamente.","ANTOMSDK.UNKNOWN_ERROR":"Erro desconhecido. Verifique o status do pagamento e entre em contato com o comerciante.","antom.common.closing":"Fechando...","ANTOMSDK.API_GATEWAY_TIMEOUT":"O tempo de solicitação expirou. Por favor, tente novamente.","ANTOMSDK.API_TIMEOUT":"O tempo de solicitação expirou. Por favor, tente novamente."}},9669:function(e){e.exports={"page.wrong.error.message":"Ocorreu um erro no sistema. Por favor, tente novamente mais tarde ou contacte o comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"O tempo de espera esgotou-se. Por favor, tente novamente.","ANTOMSDK.UNKNOWN_ERROR":"Ocorreu uma exceção desconhecida. Verifique a situação do pagamento e entre em contacto com o comerciante.","antom.common.closing":"A fechar...","ANTOMSDK.API_GATEWAY_TIMEOUT":"A solicitação expirou. Tente novamente.","ANTOMSDK.API_TIMEOUT":"O tempo de espera esgotou-se. Por favor, tente novamente."}},4731:function(e){e.exports={"page.wrong.error.message":"Eroare de sistem. Vă rugăm să încercați mai târziu sau să contactați comerciantul.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Cererea a expirat. Vă rugăm să încercați din nou.","ANTOMSDK.UNKNOWN_ERROR":"Eroare necunoscută. Vă rugăm să verificați statutul plății și să luați legătura cu comerciantul.","antom.common.closing":"Închidere în curs","ANTOMSDK.API_GATEWAY_TIMEOUT":"Cererea a expirat. Vă rugăm să încercați din nou.","ANTOMSDK.API_TIMEOUT":"Cererea a expirat. Vă rugăm să încercați din nou."}},4909:function(e){e.exports={"page.wrong.error.message":"ระบบผิดปกติ กรุณาลองอีกครั้งในภายหลังหรือ ติดต่อผู้ค้า","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"คําขอหมดเวลา โปรดลองอีกครั้ง","ANTOMSDK.UNKNOWN_ERROR":"เกิดข้อผิดพลาดที่ไม่ทราบสาเหตุ กรุณาตรวจสอบสถานะการชำระเงินและติดต่อผู้ขาย。","antom.common.closing":"กำลังปิด","ANTOMSDK.API_GATEWAY_TIMEOUT":"การร้องขอหมดเวลา กรุณาลองอีกครั้ง。","ANTOMSDK.API_TIMEOUT":"การร้องขอหมดเวลา กรุณาลองอีกครั้ง。"}},7077:function(e){e.exports={"page.wrong.error.message":"May problema sa sistema. Pakisubukang muli mamaya o makipag-ugnayan sa merchant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Naubusan ng oras ang kahilingan, pakisubukang muli.","ANTOMSDK.UNKNOWN_ERROR":"Hindi kilalang error. Pakisuri ang mga detalye ng iyong pagbabayad at makipag-ugnayan sa merchant.","antom.common.closing":"Nakasara","ANTOMSDK.API_GATEWAY_TIMEOUT":"Naubusan ng oras ang kahilingan, pakisubukang muli.","ANTOMSDK.API_TIMEOUT":"Naubusan ng oras ang kahilingan, pakisubukang muli."}},3405:function(e){e.exports={"page.wrong.error.message":"Sistem hatası, lütfen daha sonra tekrar deneyin veya satıcıyla iletişime geçin.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"İstek zaman aşımına uğradı, lütfen tekrar deneyin.","ANTOMSDK.UNKNOWN_ERROR":"Bilinmeyen bir hata oluştu, lütfen ödeme durumunu kontrol edin ve satıcıyla iletişime geçin.","antom.common.closing":"Kapatılıyor","ANTOMSDK.API_GATEWAY_TIMEOUT":"İstek zaman aşımına uğradı, lütfen tekrar deneyin.","ANTOMSDK.API_TIMEOUT":"İstek zaman aşımına uğradı, lütfen tekrar deneyin."}},4734:function(e){e.exports={"page.wrong.error.message":"Hệ thống đang gặp sự cố. Vui lòng thử lại sau hoặc liên hệ với người bán.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Yêu cầu đã hết thời gian, vui lòng thử lại.","ANTOMSDK.UNKNOWN_ERROR":"Lỗi không xác định. Vui lòng kiểm tra lại thông tin thanh toán và liên hệ với người bán.","antom.common.closing":"Đang đóng lại","ANTOMSDK.API_GATEWAY_TIMEOUT":"Yêu cầu đã hết thời gian, vui lòng thử lại.","ANTOMSDK.API_TIMEOUT":"Yêu cầu đã hết thời gian, vui lòng thử lại."}},370:function(e){e.exports={"page.wrong.error.message":"系统异常,请稍后重试或联系商户。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"请求超时,请重试。","ANTOMSDK.UNKNOWN_ERROR":"未知异常,请检查付款情况并联系商户。","antom.common.closing":"关闭中","ANTOMSDK.API_GATEWAY_TIMEOUT":"请求超时,请重试。","ANTOMSDK.API_TIMEOUT":"请求超时,请重试。"}},5598:function(e){e.exports={"page.wrong.error.message":"系統異常,請稍後重試或聯絡商戶。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"請求超時,請重試。","ANTOMSDK.UNKNOWN_ERROR":"未知異常,請檢查付款情況並聯絡商家。","antom.common.closing":"關閉中","ANTOMSDK.API_GATEWAY_TIMEOUT":"請求超時,請重試。","ANTOMSDK.API_TIMEOUT":"請求超時,請重試。"}},1159:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.tracker=t.ScriptTracker=void 0;var a=n(1858),s=function(){function e(e){Object.defineProperty(this,"initOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracker",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.initOptions=e}return Object.defineProperty(e.prototype,"loadTacker",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return(0,a.loadScript)("https://cdn.marmot-cloud.com/tnpm-package/@antintl-intl-tracker/1.3.0/dist/common.min.js","CompatibleTrackerFull").then((function(t){var n=null==t?void 0:t.variable;if(n)return new n(r({compactExtraInfo:!0,appId:"180020050100012557"},e.initOptions))})).catch((function(){}))}}),Object.defineProperty(e.prototype,"getTracker",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return this.tracker?[2,this.tracker]:[4,this.loadTacker()];case 1:return(e=t.sent())&&(e.set({keyFormat:"origin",userPathAuto:!1}),this.tracker=e),[2,e]}}))}))}}),Object.defineProperty(e.prototype,"safeCall",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.getTracker().then(e)}}),Object.defineProperty(e.prototype,"log",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.safeCall((function(t){return null==t?void 0:t.log.apply(t,e)}))}}),e}();t.ScriptTracker=s;var l=(null==="DEV"?void 0:"DEV".toUpperCase())||"PROD",c=["DEV","SIT","PRE","PROD","LOCAL"].includes(l)?l:"PROD";t.tracker=new s({appId:"180020050100012557",env:c,server:"sg",performance:!1,error:!1})},1858:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.LoaderError=void 0,t.loadScriptClass=function(e,t){return i(e,t)},t.loadScript=i;var o=function(e){function t(t,n){var r=e.call(this,n)||this;return Object.defineProperty(r,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r.name="LoaderError",r.code=t,r}return r(t,e),Object.defineProperty(t,"unificationError",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e instanceof t||e instanceof Error&&"LoaderError"===e.name?e:new t("UNKNOWN_ERROR",e instanceof Error?e.message:"An unknown error occurred.")}}),t}(Error);function i(e,t){var n=function(){if("function"==typeof t)return t();var e=window[t];return(null==e?void 0:e.default)||e};return new Promise((function(t,r){var i=n();if(i)return t({cache:!0,variable:i});var a=document.querySelector('script[src="'.concat(e,'"]')),s=a||document.createElement("script");s.src=e,s.async=!0,s.addEventListener("load",(function(){t({cache:!1,variable:n()})})),s.addEventListener("error",(function(t){r(new o("LOAD_ERROR","Load script ".concat(e," failed: ").concat(t.message)))})),a||document.head.appendChild(s)}))}t.LoaderError=o},245:function(e,t,n){var r=n(7065).default,o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,c="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,u="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=Object.prototype.toString,h=Math.max,m=Math.min,f=function(){return d.Date.now()};function v(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function g(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==p.call(e)}function y(e){if("number"==typeof e)return e;if(g(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=a.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,i,a,s,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function _(e){return c=e,s=setTimeout(E,t),u?g(e):a}function b(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function E(){var e=f();if(b(e))return S(e);s=setTimeout(E,function(e){var n=t-(e-l);return d?m(n,i-(e-c)):n}(e))}function S(e){return s=void 0,p&&r?g(e):(r=o=void 0,a)}function A(){var e=f(),n=b(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return _(l);if(d)return s=setTimeout(E,t),g(l)}return void 0===s&&(s=setTimeout(E,t)),a}return t=y(t)||0,v(n)&&(u=!!n.leading,i=(d="maxWait"in n)?h(y(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),A.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},A.flush=function(){return void 0===s?a:S(f())},A}},9034:function(e,t,n){var r=n(7065).default,o="__lodash_hash_undefined__",i="[object Function]",a="[object GeneratorFunction]",s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,c=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d=/\\(\\)?/g,p=/^\[object .+?Constructor\]$/,h="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,m="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,f=h||m||Function("return this")();var v,g=Array.prototype,y=Function.prototype,_=Object.prototype,b=f["__core-js_shared__"],E=(v=/[^.]+$/.exec(b&&b.keys&&b.keys.IE_PROTO||""))?"Symbol(src)_1."+v:"",S=y.toString,A=_.hasOwnProperty,k=_.toString,T=RegExp("^"+S.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=f.Symbol,w=g.splice,I=K(f,"Map"),C=K(Object,"create"),R=P?P.prototype:void 0,N=R?R.toString:void 0;function O(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function D(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e,t){for(var n,r,o=e.length;o--;)if((n=e[o][0])===(r=t)||n!=n&&r!=r)return o;return-1}function x(e,t){var n;t=function(e,t){if(j(e))return!1;var n=r(e);if("number"==n||"symbol"==n||"boolean"==n||null==e||z(e))return!0;return l.test(e)||!s.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:j(n=t)?n:H(n);for(var o=0,i=t.length;null!=e&&o<i;)e=e[F(t[o++])];return o&&o==i?e:void 0}function U(e){if(!G(e)||(t=e,E&&E in t))return!1;var t,n=function(e){var t=G(e)?k.call(e):"";return t==i||t==a}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?T:p;return n.test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function B(e,t){var n,o,i=e.__data__;return("string"==(o=r(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function K(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return U(n)?n:void 0}O.prototype.clear=function(){this.__data__=C?C(null):{}},O.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},O.prototype.get=function(e){var t=this.__data__;if(C){var n=t[e];return n===o?void 0:n}return A.call(t,e)?t[e]:void 0},O.prototype.has=function(e){var t=this.__data__;return C?void 0!==t[e]:A.call(t,e)},O.prototype.set=function(e,t){return this.__data__[e]=C&&void 0===t?o:t,this},D.prototype.clear=function(){this.__data__=[]},D.prototype.delete=function(e){var t=this.__data__,n=M(t,e);return!(n<0)&&(n==t.length-1?t.pop():w.call(t,n,1),!0)},D.prototype.get=function(e){var t=this.__data__,n=M(t,e);return n<0?void 0:t[n][1]},D.prototype.has=function(e){return M(this.__data__,e)>-1},D.prototype.set=function(e,t){var n=this.__data__,r=M(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},L.prototype.clear=function(){this.__data__={hash:new O,map:new(I||D),string:new O}},L.prototype.delete=function(e){return B(this,e).delete(e)},L.prototype.get=function(e){return B(this,e).get(e)},L.prototype.has=function(e){return B(this,e).has(e)},L.prototype.set=function(e,t){return B(this,e).set(e,t),this};var H=Y((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(z(e))return N?N.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return c.test(e)&&n.push(""),e.replace(u,(function(e,t,r,o){n.push(r?o.replace(d,"$1"):t||e)})),n}));function F(e){if("string"==typeof e||z(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Y(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(Y.Cache||L),n}Y.Cache=L;var j=Array.isArray;function G(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function z(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==k.call(e)}e.exports=function(e,t,n){var r=null==e?void 0:x(e,t);return void 0===r?n:r}},5270:function(e,t,n){e=n.nmd(e);var r=n(7065).default,o="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",s="[object Function]",l="[object Object]",c=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[a]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d[s]=d["[object Map]"]=d["[object Number]"]=d[l]=d["[object RegExp]"]=d["[object Set]"]=d["[object String]"]=d["[object WeakMap]"]=!1;var p="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,h="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,m=p||h||Function("return this")(),f="object"==r(t)&&t&&!t.nodeType&&t,v=f&&"object"==r(e)&&e&&!e.nodeType&&e,g=v&&v.exports===f,y=g&&p.process,_=function(){try{var e=v&&v.require&&v.require("util").types;return e||y&&y.binding&&y.binding("util")}catch(e){}}(),b=_&&_.isTypedArray;function E(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var S,A,k,T=Array.prototype,P=Function.prototype,w=Object.prototype,I=m["__core-js_shared__"],C=P.toString,R=w.hasOwnProperty,N=(S=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",O=w.toString,D=C.call(Object),L=RegExp("^"+C.call(R).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=g?m.Buffer:void 0,x=m.Symbol,U=m.Uint8Array,B=M?M.allocUnsafe:void 0,K=(A=Object.getPrototypeOf,k=Object,function(e){return A(k(e))}),H=Object.create,F=w.propertyIsEnumerable,Y=T.splice,j=x?x.toStringTag:void 0,G=function(){try{var e=ve(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),z=M?M.isBuffer:void 0,V=Math.max,W=Date.now,q=ve(m,"Map"),J=ve(Object,"create"),Q=function(){function e(){}return function(t){if(!Ie(t))return{};if(H)return H(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Z(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ee(e){var t=this.__data__=new X(e);this.size=t.size}function te(e,t){var n=Ae(e),r=!n&&Se(e),o=!n&&!r&&Te(e),i=!n&&!r&&!o&&Re(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var c in e)!t&&!R.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ge(c,l))||s.push(c);return s}function ne(e,t,n){(void 0!==n&&!Ee(e[t],n)||void 0===n&&!(t in e))&&ie(e,t,n)}function re(e,t,n){var r=e[t];R.call(e,t)&&Ee(r,n)&&(void 0!==n||t in e)||ie(e,t,n)}function oe(e,t){for(var n=e.length;n--;)if(Ee(e[n][0],t))return n;return-1}function ie(e,t,n){"__proto__"==t&&G?G(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}Z.prototype.clear=function(){this.__data__=J?J(null):{},this.size=0},Z.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Z.prototype.get=function(e){var t=this.__data__;if(J){var n=t[e];return n===o?void 0:n}return R.call(t,e)?t[e]:void 0},Z.prototype.has=function(e){var t=this.__data__;return J?void 0!==t[e]:R.call(t,e)},Z.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=J&&void 0===t?o:t,this},X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,n=oe(t,e);return!(n<0)&&(n==t.length-1?t.pop():Y.call(t,n,1),--this.size,!0)},X.prototype.get=function(e){var t=this.__data__,n=oe(t,e);return n<0?void 0:t[n][1]},X.prototype.has=function(e){return oe(this.__data__,e)>-1},X.prototype.set=function(e,t){var n=this.__data__,r=oe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},$.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(q||X),string:new Z}},$.prototype.delete=function(e){var t=fe(this,e).delete(e);return this.size-=t?1:0,t},$.prototype.get=function(e){return fe(this,e).get(e)},$.prototype.has=function(e){return fe(this,e).has(e)},$.prototype.set=function(e,t){var n=fe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ee.prototype.clear=function(){this.__data__=new X,this.size=0},ee.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ee.prototype.get=function(e){return this.__data__.get(e)},ee.prototype.has=function(e){return this.__data__.has(e)},ee.prototype.set=function(e,t){var n=this.__data__;if(n instanceof X){var r=n.__data__;if(!q||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new $(r)}return n.set(e,t),this.size=n.size,this};var ae,se=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[ae?a:++r];if(!1===t(o[s],s,o))break}return e};function le(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":j&&j in Object(e)?function(e){var t=R.call(e,j),n=e[j];try{e[j]=void 0;var r=!0}catch(e){}var o=O.call(e);r&&(t?e[j]=n:delete e[j]);return o}(e):function(e){return O.call(e)}(e)}function ce(e){return Ce(e)&&le(e)==a}function ue(e){return!(!Ie(e)||function(e){return!!N&&N in e}(e))&&(Pe(e)?L:c).test(function(e){if(null!=e){try{return C.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function de(e){if(!Ie(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ye(e),n=[];for(var r in e)("constructor"!=r||!t&&R.call(e,r))&&n.push(r);return n}function pe(e,t,n,r,o){e!==t&&se(t,(function(i,a){if(o||(o=new ee),Ie(i))!function(e,t,n,r,o,i,a){var s=_e(e,n),c=_e(t,n),u=a.get(c);if(u)return void ne(e,n,u);var d=i?i(s,c,n+"",e,t,a):void 0,p=void 0===d;if(p){var h=Ae(c),m=!h&&Te(c),f=!h&&!m&&Re(c);d=c,h||m||f?Ae(s)?d=s:Ce(b=s)&&ke(b)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(s):m?(p=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=B?B(n):new e.constructor(n);return e.copy(r),r}(c,!0)):f?(p=!1,v=c,g=!0?(y=v.buffer,_=new y.constructor(y.byteLength),new U(_).set(new U(y)),_):v.buffer,d=new v.constructor(g,v.byteOffset,v.length)):d=[]:function(e){if(!Ce(e)||le(e)!=l)return!1;var t=K(e);if(null===t)return!0;var n=R.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&C.call(n)==D}(c)||Se(c)?(d=s,Se(s)?d=function(e){return function(e,t,n,r){var o=!n;n||(n={});var i=-1,a=t.length;for(;++i<a;){var s=t[i],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),o?ie(n,s,l):re(n,s,l)}return n}(e,Ne(e))}(s):Ie(s)&&!Pe(s)||(d=function(e){return"function"!=typeof e.constructor||ye(e)?{}:Q(K(e))}(c))):p=!1}var v,g,y,_;var b;p&&(a.set(c,d),o(d,c,r,i,a),a.delete(c));ne(e,n,d)}(e,t,a,n,pe,r,o);else{var s=r?r(_e(e,a),i,a+"",e,t,o):void 0;void 0===s&&(s=i),ne(e,a,s)}}),Ne)}function he(e,t){return be(function(e,t,n){return t=V(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=V(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),E(e,this,s)}}(e,t,Le),e+"")}var me=G?function(e,t){return G(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Le;function fe(e,t){var n,o,i=e.__data__;return("string"==(o=r(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ve(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ue(n)?n:void 0}function ge(e,t){var n=r(e);return!!(t=null==t?i:t)&&("number"==n||"symbol"!=n&&u.test(e))&&e>-1&&e%1==0&&e<t}function ye(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||w)}function _e(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var be=function(e){var t=0,n=0;return function(){var r=W(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(me);function Ee(e,t){return e===t||e!=e&&t!=t}var Se=ce(function(){return arguments}())?ce:function(e){return Ce(e)&&R.call(e,"callee")&&!F.call(e,"callee")},Ae=Array.isArray;function ke(e){return null!=e&&we(e.length)&&!Pe(e)}var Te=z||function(){return!1};function Pe(e){if(!Ie(e))return!1;var t=le(e);return t==s||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function we(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function Ie(e){var t=r(e);return null!=e&&("object"==t||"function"==t)}function Ce(e){return null!=e&&"object"==r(e)}var Re=b?function(e){return function(t){return e(t)}}(b):function(e){return Ce(e)&&we(e.length)&&!!d[le(e)]};function Ne(e){return ke(e)?te(e,!0):de(e)}var Oe,De=(Oe=function(e,t,n){pe(e,t,n)},he((function(e,t){var n=-1,o=t.length,i=o>1?t[o-1]:void 0,a=o>2?t[2]:void 0;for(i=Oe.length>3&&"function"==typeof i?(o--,i):void 0,a&&function(e,t,n){if(!Ie(n))return!1;var o=r(t);return!!("number"==o?ke(n)&&ge(t,n.length):"string"==o&&t in n)&&Ee(n[t],e)}(t[0],t[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++n<o;){var s=t[n];s&&Oe(e,s,n,i)}return e})));function Le(e){return e}e.exports=De},8822:function(e){var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var s,l=[],c=!1,u=-1;function d(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&p())}function p(){if(!c){var e=a(d);c=!0;for(var t=l.length;t;){for(s=l,l=[];++u<t;)s&&s[u].run();u=-1,t=l.length}s=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),1!==l.length||c||a(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},8093:function(e,t,n){var r=n(1953);function o(e){var t,n;function o(t,n){try{var a=e[t](n),s=a.value,l=s instanceof r;Promise.resolve(l?s.v:s).then((function(n){if(l){var r="return"===t?"return":"next";if(!s.k||n.done)return o(r,n);n=e[r](n).value}i(a.done?"return":"normal",n)}),(function(e){o("throw",e)}))}catch(e){i("throw",e)}}function i(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?o(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise((function(i,a){var s={key:e,arg:r,resolve:i,reject:a,next:null};n?n=n.next=s:(t=n=s,o(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}o.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)},e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},1953:function(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},5820:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},7720:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},9748:function(e,t,n){var r=n(5820);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},9402:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},4774:function(e,t,n){var r=n(1953);e.exports=function(e){var t={},n=!1;function o(t,o){return n=!0,o=new Promise((function(n){n(e[t](o))})),{done:!1,value:new r(o,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return n?(n=!1,e):o("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(n)throw n=!1,e;return o("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return n?(n=!1,e):o("return",e)}),t},e.exports.__esModule=!0,e.exports.default=e.exports},9164:function(e){function t(e){function n(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return t=function(e){this.s=e,this.n=e.next},t.prototype={s:null,n:null,next:function(){return n(this.n.apply(this.s,arguments))},return:function(e){var t=this.s.return;return void 0===t?Promise.resolve({value:e,done:!0}):n(t.apply(this.s,arguments))},throw:function(e){var t=this.s.return;return void 0===t?Promise.reject(e):n(t.apply(this.s,arguments))}},new t(e)}e.exports=function(e){var n,r,o,i=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,o=Symbol.iterator);i--;){if(r&&null!=(n=e[r]))return n.call(e);if(o&&null!=(n=e[o]))return new t(n.call(e));r="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},842:function(e){function t(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=e.apply(n,r);function s(e){t(a,o,i,s,l,"next",e)}function l(e){t(a,o,i,s,l,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},6621:function(e,t,n){var r=n(1953);e.exports=function(e){return new r(e,0)},e.exports.__esModule=!0,e.exports.default=e.exports},9952:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},7603:function(e,t,n){var r=n(2975),o=n(9377);function i(t,n,a){return o()?(e.exports=i=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=i=function(e,t,n){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return n&&r(i,n.prototype),i},e.exports.__esModule=!0,e.exports.default=e.exports),i.apply(null,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},9086:function(e,t,n){var r=n(893);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},4286:function(e,t,n){var r=n(9617);e.exports=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}},e.exports.__esModule=!0,e.exports.default=e.exports},5929:function(e,t,n){var r=n(731),o=n(9377),i=n(365);e.exports=function(e){var t=o();return function(){var n,o=r(e);if(t){var a=r(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return i(this,n)}},e.exports.__esModule=!0,e.exports.default=e.exports},4762:function(e,t,n){var r=n(893);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},4606:function(e,t,n){var r=n(7101);function o(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=o=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,t,n){var o=r(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(this,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},731:function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4832:function(e,t,n){var r=n(2975);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},3315:function(e){e.exports=function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}},e.exports.__esModule=!0,e.exports.default=e.exports},9377:function(e){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},9454:function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},5587:function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},7469:function(e){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports},8928:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},3212:function(e,t,n){var r=n(4762);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports},7578:function(e,t,n){var r=n(7710);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},7710:function(e){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.__esModule=!0,e.exports.default=e.exports},365:function(e,t,n){var r=n(7065).default,o=n(9402);e.exports=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},2650:function(e,t,n){var r=n(7065).default;function o(){"use strict";e.exports=o=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",d=l.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),a=new O(r||[]);return s(i,"_invoke",{value:I(e,n,a)}),i}function m(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var f="suspendedStart",v="executing",g="completed",y={};function _(){}function b(){}function E(){}var S={};p(S,c,(function(){return this}));var A=Object.getPrototypeOf,k=A&&A(A(D([])));k&&k!==i&&a.call(k,c)&&(S=k);var T=E.prototype=_.prototype=Object.create(S);function P(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function n(o,i,s,l){var c=m(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,l)}),(function(e){n("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,l)}))}l(c.arg)}var o;s(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function I(e,n,r){var o=f;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var l=C(s,r);if(l){if(l===y)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var c=m(e,n,r);if("normal"===c.type){if(o=r.done?g:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var i=m(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function R(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(R,this),this.reset(!0)}function D(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(a.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(r(e)+" is not iterable")}return b.prototype=E,s(T,"constructor",{value:E,configurable:!0}),s(E,"constructor",{value:b,configurable:!0}),b.displayName=p(E,d,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,p(e,d,"GeneratorFunction")),e.prototype=Object.create(T),e},n.awrap=function(e){return{__await:e}},P(w.prototype),p(w.prototype,u,(function(){return this})),n.AsyncIterator=w,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new w(h(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},P(T),p(T,d,"Generator"),p(T,c,(function(){return this})),p(T,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=D,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),N(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;N(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},n}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},2975:function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},9050:function(e,t,n){var r=n(7720),o=n(5587),i=n(9617),a=n(7469);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},7101:function(e,t,n){var r=n(731);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},6705:function(e,t,n){var r=n(9748),o=n(9454),i=n(9617),a=n(8928);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},3952:function(e,t,n){var r=n(7065).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},893:function(e,t,n){var r=n(7065).default,o=n(3952);e.exports=function(e){var t=o(e,"string");return"symbol"==r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},7065:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},9617:function(e,t,n){var r=n(5820);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},8101:function(e,t,n){var r=n(8093);e.exports=function(e){return function(){return new r(e.apply(this,arguments))}},e.exports.__esModule=!0,e.exports.default=e.exports},7184:function(e,t,n){var r=n(731),o=n(2975),i=n(3315),a=n(7603);function s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!i(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,s(t)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.cw=function(e){var t;return function(){if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var r={};return function(){"use strict";n.r(r),n.d(r,{AMSAutoDebit:function(){return sg},AMSAutoDebitPay:function(){return eg},AMSCashierPayment:function(){return tg},AMSCheckout:function(){return $v},AMSCheckoutPage:function(){return Zv},AMSEasyPay:function(){return ag},AMSElement:function(){return ig},AMSVaulting:function(){return ng},AddressElement:function(){return og},AntomElement:function(){return rg},AntomSDK:function(){return Kg},ComponentSignEnum:function(){return V},ComponentSignEnumV2:function(){return z},ConnectErrorCode:function(){return me},DisplayTypeEnum:function(){return G},ElementType:function(){return L},EnvironmentEnum:function(){return te},EventLoggingEventId:function(){return ve},InterActionTypeEnum:function(){return he},MessageName:function(){return ie},PaymentAmountEnum:function(){return Q},PaymentElementLayout:function(){return B},PaymentMethodCategoryTypeEnum:function(){return q},PaypalMethodEnum:function(){return de},PlatformEnum:function(){return oe},ProductSceneEnum:function(){return W},ProductSceneVersion:function(){return pe},RedirectType:function(){return ue},RiskSdkInfoEnum:function(){return fe},TargetEnum:function(){return ae},ThemeType:function(){return U},checkoutDisplayEnum:function(){return X},default:function(){return Gg},errorEnum:function(){return se},eventCodeEnum:function(){return ce},loadAntom:function(){return jg},localeEnum:function(){return Z},modeEnum:function(){return $},networkModeEnum:function(){return ee},osTypeEnum:function(){return ne},payPalConfigurationIntentEnum:function(){return J},redirectTypeEnum:function(){return le},terminalTypeEnum:function(){return re}});var e=n.cw((function(e,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(n,"__esModule",{value:!0}),n.loadScript=void 0,n.createSingletonInstance=c,n.createInstance=u,n.createLoader=function(e){var t=this,n=e.sdkURL,o=e.globalName,l=e.timeout,d=void 0===l?2e4:l,p=e.onLoadComplete,h=e.onError,m=e.onLoadStart,f=e.onInitialized,v=e.single,g=void 0===v||v,y=e.namespace;return function(e){return r(t,void 0,void 0,(function(){var t,l,v=this;return i(this,(function(_){var b,E;return null==m||m(),t=Date.now(),a.tracker.log({code:"7988",msg:y,d1:"loadStart",d2:"无",d3:"无",d4:"无",d5:"npm",m1:0,m2:0}),b=function(){return(0,s.loadScriptClass)(n,o)},E=d,l=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Promise.race([new Promise((function(e,t){setTimeout((function(){t(new s.LoaderError("LOAD_TIMEOUT","Load timeout: ".concat(E)))}),E)})),b.apply(void 0,e)])},[2,l().then((function(n){return r(v,[n],void 0,(function(n){var r,l,d,h=n.variable,m=n.cache;return i(this,(function(n){switch(n.label){case 0:if(r=Date.now(),m||a.tracker.log({code:"7988",msg:y,d1:"loadComplete",d2:"无",d3:"无",d4:(null==h?void 0:h.version)||"无",d5:"npm",m1:Math.round(Date.now()-t),m2:0}),null==p||p(),!h)throw new s.LoaderError("NO_REMOTE_CLASS","No variables ".concat(o," were found. Cannot be initialized the Class ").concat(o));n.label=1;case 1:return n.trys.push([1,3,,4]),[4,(g?c:u)(h,e,void 0)];case 2:return l=n.sent(),a.tracker.log({code:"7988",msg:y,d1:"initialized",d2:"无",d3:"无",d4:l.version||"无版本号",d5:"npm",m1:Math.round(Date.now()-t),m2:Math.round(Date.now()-r)}),null==f||f(l,window.location.href),[2,l];case 3:throw d=n.sent(),new s.LoaderError("INIT_ERROR","Initialize Class ".concat(o," failed: ").concat(d.message));case 4:return[2]}}))}))})).catch((function(e){var n=s.LoaderError.unificationError(e);return a.tracker.log({code:"7988",msg:y,d1:"createError",d2:n.code,d3:n.message,d4:"无",d5:"npm",m1:Math.round(Date.now()-t),m2:0}),null==h||h(n),Promise.reject(e)}))]}))}))}};var a=t(),s=o();Object.defineProperty(n,"loadScript",{enumerable:!0,get:function(){return s.loadScript}});var l=null;function c(e,t,n){return l=l?l.then((function(r){return r.isDestroyed?u(e,t,n):r})):u(e,t,n)}function u(e,t,n){var r=new e(t),o=Date.now();return r.init().then((function(e){return n&&a.tracker.log({code:"7988",msg:n,d1:"initialized",d2:"无",d3:"无",d4:r.version||"无版本号",d5:"umd",m1:Math.round(Date.now()-o),m2:Math.round(Date.now()-o)}),e})).catch((function(e){var t=new s.LoaderError("INIT_ERROR","Initialize Class failed: ".concat(e.message));throw n&&a.tracker.log({code:"7988",msg:n,d1:"createError",d2:t.code,d3:t.message,d4:"无",d5:"umd",m1:Math.round(Date.now()-o),m2:0}),t}))}})),t=function(){return n(1159)},o=function(){return n(1858)},i={};n.r(i),n.d(i,{hasBrowserEnv:function(){return Eo},hasStandardBrowserEnv:function(){return Ao},hasStandardBrowserWebWorkerEnv:function(){return ko},navigator:function(){return So},origin:function(){return To}});var a,s=n(2650),l=n.n(s),c=n(842),u=n.n(c),d=n(4762),p=n.n(d),h=n(4286),m=n.n(h),f=n(3212),v=n.n(f),g=n(9086),y=n.n(g),_=n(9952),b=n.n(_),E=n(4832),S=n.n(E),A=n(5929),k=n.n(A),T={dev:"http://page.alipay.net/page/antom-web-checkout/src/component-app",sit:"http://page.test.alipay.net/page/antom-web-checkout/src/component-app",pre:"https://pre.ac.alipay.com/page/antom-web-checkout/src/component-app",sandbox:"https://ac.alipay.com/page/antom-web-checkout/src/component-app",light_sandbox:"https://ac.alipay.com/page/antom-web-checkout/src/component-app",prod:"https://ac.alipay.com/page/antom-web-checkout/src/component-app"},P={dev:"https://config-dev.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",sit:"https://config-test.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",pre:"https://config-pre.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",sandbox:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",light_sandbox:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",prod:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json"},w={dev:"http://page.alipay.net/page/antom-web-checkout-v2",sit:"http://page.test.alipay.net/page/antom-web-checkout-v2",pre:"https://pre.ac.alipay.com/page/antom-web-checkout-v2",sandbox:"https://checkout.antom.com",light_sandbox:"https://checkout.antom.com",prod:"https://checkout.antom.com"},I="0.0.1787898127-dev.2",C="1.47.2",R=n(7184),N=n.n(R),O=function(e){return e.RENDER_COMPONENT="renderComponent",e.CAPTURE_ASSET="onCaptureAsset",e.SIGN_OUT="onSignout",e.BLUR="onBlur",e.SUBMIT_PAY="submitPay",e.VALIDATE="onValidate",e.SUBMIT_RISK="onSubmitRisk",e.AFTER_SUBMIT="onAfterSubmit",e.SIZE_CHANGE="onSizeChange",e.LAUNCH="onLaunch",e.CALLBACK="callback",e.SEND_MUITI_APP_EVENT_TO_SDK="sendMuitiAppEventToSdk",e.LOG="log",e.HANDLE_PAYMENT="handlePayment",e.ON_EVENT_CALLBACK="onEventCallback",e}({}),D=function(e){return e.CONTAINER_ELEMENT="CONTAINER_ELEMENT",e.AUTH_ELEMENT="AUTH_ELEMENT",e.ADDRESS_ELEMENT="ADDRESS_ELEMENT",e.PAYMENT_ELEMENT="PAYMENT_ELEMENT",e}({}),L=function(e){return e.auth="auth",e.address="address",e.payment="payment",e}({}),M=function(e){return e.SUCCESS="SUCCESS",e.PROCESSING="PROCESSING",e.CANCELLED="CANCELLED",e.PENDING="PENDING",e.S="SUCCESS",e.F="FAIL",e.U="PROCESSING",e.FAIL="FAIL",e}({}),x=p()(p()(p()(p()(p()(p()({},L.auth,D.AUTH_ELEMENT),L.address,D.ADDRESS_ELEMENT),L.payment,D.PAYMENT_ELEMENT),D.AUTH_ELEMENT,L.auth),D.ADDRESS_ELEMENT,L.address),D.PAYMENT_ELEMENT,L.payment),U=function(e){return e.NostalgicGray="nostalgicGray",e.Default="default",e.Night="night",e.CherryBlossomPink="cherryBlossomPink",e.GamingPurple="gamingPurple",e.AgateGreen="agateGreen",e}({}),B=function(e){return e.Tabs="tabs",e.Accordion="Accordion",e}({}),K=(p()(p()({},U.Default,"LIGHT"),U.Night,"NIGHT"),function(e){return e.SDK_CREATE_COMPONENT_ERROR="SDK_CREATE_COMPONENT_ERROR",e.SDK_CREATEPAYMENT_PARAMETER_ERROR="SDK_CREATEPAYMENT_PARAMETER_ERROR",e.SDK_PAYMENT_ERROR="SDK_PAYMENT_ERROR",e.SDK_PAYMENT_FAIL="SDK_PAYMENT_FAIL",e.SDK_PAYMENT_CANCEL="SDK_PAYMENT_CANCEL",e.SDK_PAYMENT_SUCCESSFUL="SDK_PAYMENT_SUCCESSFUL",e.SDK_PAYMENT_PROCESSING="SDK_PAYMENT_PROCESSING",e}({})),H=function(e){return e.DEV="DEV",e.TEST="TEST",e.SIT="SIT",e.PRE="PRE",e.PROD="PROD",e.SANDBOX="SANDBOX",e}({}),F=function(e){S()(n,e);var t=k()(n);function n(e){var r;b()(this,n);var o=e.map((function(e){return"".concat(e.field,": ").concat(e.message)}));return(r=t.call(this,"Invalid config:\n".concat(o.join("\n")))).errors=e,r.name="InvalidElementConfigError",r}return y()(n)}(N()(Error)),Y=function(e){return e.DESTORY="destroy",e.MOUNT="mount",e.SUBMITPAYMENT="submitPayment",e.VALIDATAFIELDS="validateFields",e.UPDATEPAYMENT="updatePayment",e}({}),j=function(e){return e.PAYMENTMETHODCHANGED="paymentMethodChanged",e.BILLINGADDRESSCHANGED="billingAddressChanged",e}({}),G=function(e){return e.popup="popup",e.inline="inline",e}({}),z=function(e){return e.ELEMENT_PAYMENT="ELEMENT_PAYMENT_ALL",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS_ALL",e}({}),V=function(e){return e.EASY_PAY_WALLET="EASY_PAY_WALLET",e.EASY_PAY_APM="EASY_PAY_APM",e.CASHIER_PAYMENT_CARD="CASHIER_PAYMENT_CARD",e.CASHIER_PAYMENT_BANK="CASHIER_PAYMENT_BANK",e.CASHIER_PAYMENT_APM="CASHIER_PAYMENT_APM",e.AUTO_DEBIT_WALLET="AUTO_DEBIT_WALLET",e.AUTO_DEBIT_PAY_WALLET="AUTO_DEBIT_PAY_WALLET",e.NONE="NONE",e.VAULTING_CARD="VAULTING_CARD",e.CHECKOUT_PAYMENT="CHECKOUT_PAYMENT",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT_ALL",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS_ALL",e.AUTO_DEBIT_APM="AUTO_DEBIT_APM",e}({}),W=function(e){return e.VAULTING_ELEMENT="VAULTING_ELEMENT",e.EASY_PAY="EASY_PAY",e.CASHIER_PAYMENT="CASHIER_PAYMENT",e.AUTO_DEBIT="AUTO_DEBIT",e.AUTO_DEBIT_PAY="AUTO_DEBIT_PAY",e.VAULTING="VAULTING",e.FLASH_BUY="FLASH_BUY",e.CARD_APPLE_PAY="CARD_APPLE_PAY",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS",e.CHECKOUT_PAYMENT="CHECKOUT_PAYMENT",e}({}),q=function(e){return e.CARD="CARD",e.WALLET="WALLET",e.BANK="BANK",e.APM="APM",e.ALL="ALL",e}({}),J=function(e){return e.intent="intent",e.capture="capture",e}({}),Q=function(e){return e.USD="USD",e}({}),Z=function(e){return e["en-US"]="en-US",e}({}),X=function(e){return e.horizon="horizon",e.vertical="vertical",e}({}),$=function(e){return e.dropin="dropin",e.component="component",e}({}),ee=function(e){return e.proxy="proxy",e.session="session",e}({}),te=function(e){return e.sandbox="sandbox",e.prod="prod",e.light_sandbox="light_sandbox",e}({}),ne=function(e){return e.IOS="IOS",e.ANDROID="ANDROID",e.ELSE="ELSE",e}({}),re=function(e){return e.WEB="WEB",e.WAP="WAP",e.APP="APP",e.MINI_APP="MINI_APP",e}({}),oe=function(e){return e.desktop="desktop",e.mobile="mobile",e}({}),ie=function(e){return e.SDK_TO_APP="SDK_TO_APP",e.APP_TO_SDK="APP_TO_SDK",e.APP_TO_APP="APP_TO_APP",e}({}),ae=function(e){return e.BLANK="_blank",e.SELF="_self",e.REPLACE="_replace",e}({}),se=function(e){return e.PARAMS="PARAMS",e.TIMEOUT="TIMEOUT",e.NETWORK="NETWORK",e.SYSTEM="SYSTEM",e.LOGIN="LOGIN",e.GATEWAY="GATEWAY",e.VALIDATION="VALIDATION",e.TAOBAOBINDALIPAY="TAOBAOBINDALIPAY",e.REGISTERWALLET="REGISTERWALLET",e.NOALIPAYID="NOALIPAYID",e.TRUSTLOGINERROR="TRUSTLOGINERROR",e.SIGNIN="SIGNIN",e.GETSIGNPARAMSERROR="GETSIGNPARAMSERROR",e}({}),le=function(e){return e.UNSAFE_BROWSER="UNSAFE_BROWSER",e.SAFETY_BROWSER="SAFETY_BROWSER",e.INVOKE_SDK="INVOKE_SDK",e}({}),ce=function(e){return e.SDK_START_OF_LOADING="SDK_START_OF_LOADING",e.SDK_END_OF_LOADING="SDK_END_OF_LOADING",e.SDK_INTERNAL_ERROR="SDK_INTERNAL_ERROR",e.SDK_CREATEPAYMENT_PARAMETER_ERROR="SDK_CREATEPAYMENT_PARAMETER_ERROR",e.SDK_INIT_PARAMETER_ERROR="SDK_INIT_PARAMETER_ERROR",e.SDK_CREATECOMPONENT_ERROR="SDK_CREATECOMPONENT_ERROR",e.SDK_LAUNCH_PAYMENT_APP_ERROR="SDK_LAUNCH_PAYMENT_APP_ERROR",e.SDK_CALL_URL_SUCCESS="SDK_CALL_URL_SUCCESS",e.SDK_CALL_URL_ERROR="SDK_CALL_URL_ERROR",e.SDK_PAYMENT_SUCCESSFUL="SDK_PAYMENT_SUCCESSFUL",e.SDK_PAYMENT_FAIL="SDK_PAYMENT_FAIL",e.SDK_PAYMENT_ERROR="SDK_PAYMENT_ERROR",e.SDK_PAYMENT_CANCEL="SDK_PAYMENT_CANCEL",e.SDK_PAYMENT_PROCESSING="SDK_PAYMENT_PROCESSING",e.SDK_PAYMENT_WARN="SDK_PAYMENT_WARN",e.SDK_PAYMENT_SHIPPINGCHANGE="SDK_PAYMENT_SHIPPINGCHANGE",e.SDK_PAYMENT_APPROVE="SDK_PAYMENT_APPROVE",e.SDK_REDIRECT="SDK_REDIRECT",e}({}),ue=function(e){return e.ApplinkUrl="ApplinkUrl",e.SchemeUrl="SchemeUrl",e.NormalUrl="NormalUrl",e.Unknown="Unknown",e}({}),de=function(e){return e.PAYPAL_CHECKOUT="PAYPAL_CHECKOUT",e.PAYPAL_VAULT="PAYPAL_VAULT",e.PAYPAL_PAYLATER="PAYPAL_PAYLATER",e}({}),pe=function(e){return e.V1="1.0",e.V2="2.0",e}({}),he=function(e){return e.COLLECT_REDIRECT="COLLECT_REDIRECT",e.SHOW_CODE="SHOW_CODE",e.COLLECT_SHOW_CODE="COLLECT_SHOW_CODE",e.REDIRECT="REDIRECT",e}({}),me=function(e){return e.RISK_REJECT="RISK_REJECT",e.USER_AUTH_VERIFICATION_FAILED="USER_AUTH_VERIFICATION_FAILED",e.USER_NOT_EXISTS="USER_NOT_EXISTS",e}({}),fe=function(e){return e.NEED="need",e.NO_NEED="noneed",e}({}),ve=function(e){return e.OnlyClose="OnlyClose",e.LeaveAnyWay="LeaveAnyWay",e.ContinuePaying="ContinuePaying",e}({}),ge={DOMAIN_NOT_IN_WHITE_LIST:{code:ce.SDK_INTERNAL_ERROR,message:"Origin of the message is not in the white list"},NOT_JSON_FORMAT:{code:ce.SDK_INTERNAL_ERROR,message:"The message string should conform to the json format"},SDK_COMPATIBILITY_ISSUES:{code:ce.SDK_INTERNAL_ERROR,BROWSER_NOT_SUPPORT_POSTMESSAGE:{code:ce.SDK_INTERNAL_ERROR,message:"The browser does not support the postmessage communication mode"},FAILED_TO_CREATE_IFRAME:{code:ce.SDK_INTERNAL_ERROR,message:"Failed to create iframe"}},INIT_PARAMETER_ERROR:{code:ce.SDK_INIT_PARAMETER_ERROR,UI_MODE_NOT_SUPPORTED:{code:ce.SDK_INIT_PARAMETER_ERROR,message:"This UI mode is not supported"},ENVIRONMENT_ERROR:{code:ce.SDK_INIT_PARAMETER_ERROR,message:"The current input environment does not support or is not in the standard enumeration"},MODE_ERROR:{code:ce.SDK_INIT_PARAMETER_ERROR,message:"mode value not in enum"},LOCALE_ERROR:{code:ce.SDK_INIT_PARAMETER_ERROR,message:"The current input language does not support or is not in the standard enumeration"},NET_MODE_NOT_SUPPORT:{code:ce.SDK_INIT_PARAMETER_ERROR,message:"The network mode is not supported"},EVENT_ERROR:{code:ce.SDK_INIT_PARAMETER_ERROR,message:"Parameter type should be function"}},CREATEPAYMENT_PARAMETER_ERROR:{code:ce.SDK_CREATEPAYMENT_PARAMETER_ERROR},CREATECOMPONENT_ERROR:{code:ce.SDK_CREATECOMPONENT_ERROR,message:"Failed to create component",SINGLETON_COMPONENT_ERROR:{code:ce.SDK_CREATECOMPONENT_ERROR,message:"Only one component can be rendered simultaneously"},LOAD_APP_TIMEOUT:{code:ce.SDK_CREATECOMPONENT_ERROR,message:"Load resource timeout"},NETWORK_REQUEST_ERROR:{code:ce.SDK_CREATECOMPONENT_ERROR,message:"Network request error"}},SDK_LAUNCH_PAYMENT_APP_ERROR:{code:ce.SDK_LAUNCH_PAYMENT_APP_ERROR,CALL_APP_URL_ERROR:{code:ce.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to launch app"},LOAD_APP_TIME_OUT:{code:ce.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Load app time out"},CONTAINER_NOT_EXIST:{code:ce.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Container service does not exist"}},SDK_SUBMIT_ERROR:{code:ce.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Component not created or current browser compatibility issue, not supported"},PARAM_INVALID:{code:"PARAM_INVALID",message:"An error occurred. The transaction cannot be initiated."},UI_STATE_ERROR:{code:"UI_STATE_ERROR",message:"An error occurred. The transaction cannot be initiated."},INITIALIZE_TIMEOUT:{code:"INITIALIZE_TIMEOUT",API:{code:"INITIALIZE_API_TIMEOUT",message:"An error occurred. The transaction cannot be initiated."},WEB:{code:"INITIALIZE_WEB_TIMEOUT",message:"An error occurred; the transaction cannot be initiated."}},ERR_DATA_STRUCT_UNRECOGNIZED:{code:"ERR_DATA_STRUCT_UNRECOGNIZED",message:"An error occurred. The transaction cannot be initiated."},SDK_CALL_URL_ERROR:{code:ce.SDK_CALL_URL_ERROR,REDIRECT_ERROR:{code:ce.SDK_CALL_URL_ERROR,message:"Redirect data exception"}}},ye="COMPONENT",_e={ready:{name:"onReady",uniqueKey:"userOnReady"},error:{name:"onError",uniqueKey:"userOnError"},paymentMethodSelected:{name:"onPaymentMethodSelected",uniqueKey:"userOnPaymentMethodSelected"},sizeChanged:{name:"onSizeChanged",uniqueKey:"userOnSizeChanged"},log:{name:"onLog",uniqueKey:"userOnLog"},launch:{name:"onLaunch"},redirect:{name:"onRedirect"},close:{name:"onClose",uniqueKey:"userOnClose"},destroy:{name:"onDestroy"},closeCallback:{name:"onCloseCallback",uniqueKey:"closeCallback"},eventCallback:{name:"onEventCallback",uniqueKey:"userEventCallback"},submitForm:{name:"submitForm"},hideCloseButton:{name:"hideCloseButton"},showCloseButton:{name:"showCloseButton"},setMaskCloseButton:{name:"setMaskCloseButton"},setAllowRetention:{name:"setAllowRetention"},declareCheckoutInfo:{name:"declareCheckoutInfo"},showPopup:{name:"showPopup"},dismissLoading:{name:"dismissLoading"},popupWindow:{name:"popupWindow"},popWindow:{name:"popWindow"},getDeviceId:{name:"getDeviceId"},declareEventCallbackInfo:{name:"declareEventCallbackInfo"},setGlobalData:{name:"setGlobalData"},getGlobalData:{name:"getGlobalData"},sendMuitiAppEventToSdk:{name:"sendMuitiAppEventToSdk"},receiveMuitiAppFromSdk:{name:"receiveMuitiAppFromSdk"},sendBroadcast:{name:"sendBroadcast"},receiveBroadcast:{name:"receiveBroadcast"},getUserAgentFromSdk:{name:"getUserAgentFromSdk"},appHeartBeat:{name:"appHeartBeat"},beforeSubmit:{name:"beforeSubmit",uniqueKey:"userBeforeSubmit"},beforeSubmitDone:{name:"beforeSubmitDone",uniqueKey:"userBeforeSubmitDone"},onChange:{name:"onChange",uniqueKey:"userChange"},getGooglePayToken:{name:"getGooglePayToken"},initSecuritySDK:{name:"initSecuritySDK"},closePaymentPolling:{name:"closePaymentPolling"},onPollingEnd:{name:"onPollingEnd"},getApplePayToken:{name:"getApplePayToken"},updated:{name:"updated"},webAppReady:{name:"webAppReady"},showToast:{name:"showToast"},getSdkVersion:{name:"getSdkVersion"},inputFocus:{name:"onInputFocus"},messageForward:{name:"onMessageForward"},submitPromiseCallback:{name:"onSubmitPayCallback"},beforeConfirm:{name:"onBeforeConfirm"},validateFieldsResult:{name:"validateFieldsResult",forwardName:"validateFieldsResultForward",uniqueKey:"uservalidateFieldsResult"},canIUse:{name:"canIUse"}},be={name:"validateFields"},Ee="ams-component-container",Se="ams-component-section",Ae="ams-checkout-component",ke="asm-component-close-block",Te="ams-component-mask-close-block",Pe="ams-component-retention",we="ams-component-mockup",Ie="ams-component-loading",Ce="ams-component-popup-loading",Re="_ams_sdk_component_listener",Ne="ams-inline-component-style",Oe="inline-loading",De="ams-popup",Le="light dark",Me=15e3,xe=300,Ue="https://cdn.marmot-cloud.com/storage/2023/5/18/1692a487-99b5-4314-9d6f-e9814bc1ca41.svg",Be={SUCCESS:{code:"SUCCESS"},UNKNOWN_EXCEPTION:{code:"UNKNOWN_EXCEPTION",message:"Unknown exception. Please check the payment status and contact the merchant."},REPEAT_REQ_REJECT:{code:"REPEAT_REQ_REJECT",message:"The order status is abnormal. Please check the payment status and contact the merchant."},PROCESS_FAIL:{code:"PROCESS_FAIL",message:"Unknown exception. Please check the payment status and contact the merchant."},INQUIRY_PAYMENT_SESSION_FAILED:{code:"INQUIRY_PAYMENT_SESSION_FAILED",message:"The order status is abnormal. Please check the payment status and contact the merchant."}},Ke={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},He=new Uint8Array(16);function Fe(){if(!a&&!(a="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return a(He)}for(var Ye=[],je=0;je<256;++je)Ye.push((je+256).toString(16).slice(1));function Ge(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Ye[e[t+0]]+Ye[e[t+1]]+Ye[e[t+2]]+Ye[e[t+3]]+"-"+Ye[e[t+4]]+Ye[e[t+5]]+"-"+Ye[e[t+6]]+Ye[e[t+7]]+"-"+Ye[e[t+8]]+Ye[e[t+9]]+"-"+Ye[e[t+10]]+Ye[e[t+11]]+Ye[e[t+12]]+Ye[e[t+13]]+Ye[e[t+14]]+Ye[e[t+15]]}var ze=function(e,t,n){if(Ke.randomUUID&&!t&&!e)return Ke.randomUUID();var r=(e=e||{}).random||(e.rng||Fe)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return Ge(r)},Ve=function(e){return e.sdk_event_busPublishMessage="sdk_event_busPublishMessage",e.sdk_event_busPublishCallback="sdk_event_busPublishCallback",e.sdk_event_busIsSubscribe="sdk_event_busIsSubscribe",e.sdk_event_busSubscribe="sdk_event_busSubscribe",e.sdk_event_busUnsubscribe="sdk_event_busUnsubscribe",e.sdk_event_busClear="sdk_event_busClear",e.sdk_event_busAddInterceptor="sdk_event_busAddInterceptor",e.sdk_error_busPublishUnsubscribeError="sdk_error_busPublishUnsubscribeError",e.sdk_error_busPublishError="sdk_error_busPublishError",e.sdk_error_busPublishNoResult="sdk_error_busPublishNoResult",e}({}),We=function(){function e(t,n){b()(this,e),p()(this,"action",void 0),p()(this,"data",void 0),p()(this,"jsonData",null),this.action=t,this.data=n}return y()(e,[{key:"getAction",value:function(){return this.action}},{key:"getData",value:function(){return this.data}},{key:"isJSONData",value:function(){return this.parseJSONData(),null!==this.jsonData}},{key:"getJSONObject",value:function(){var e;return this.parseJSONData(),null!==(e=this.jsonData)&&void 0!==e?e:{}}},{key:"parseJSONData",value:function(){if(null===this.jsonData)try{this.jsonData=JSON.parse(this.data)}catch(e){this.jsonData=null}}},{key:"result",value:function(t){return new e(this.action,JSON.stringify(t))}}]),e}(),qe=function(){function e(t){b()(this,e),p()(this,"callback",void 0),this.callback=t}return y()(e,[{key:"onCallBack",value:function(e){this.callback&&this.callback(e)}}]),e}(),Je=y()((function e(){b()(this,e)})),Qe=function(){function e(){b()(this,e)}return y()(e,null,[{key:"debugTrace",value:function(e,t){this.isDebug=e,this.logger=t}},{key:"traceLog",value:function(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.isDebug&&console.log([e.TAG,t].concat(JSON.stringify(n)).join(this._logSplit)),r&&this.logger&&this.logger.logInfo({title:t},v()({eventSource:"sdk"},n)).send()}},{key:"traceError",value:function(t,n){this.isDebug&&console.error([e.TAG,t].concat(JSON.stringify(n)).join(this._logSplit)),this.logger&&this.logger.logError({title:t},v()({eventSource:"sdk"},n)).send()}},{key:"clear",value:function(){e.traceLog(Ve.sdk_event_busClear),e.interceptors.length=0,e.subscribersMap.clear()}},{key:"addInterceptor",value:function(t){e.traceLog(Ve.sdk_event_busAddInterceptor),e.interceptors.includes(t)||e.interceptors.push(t)}},{key:"publishForResult",value:function(t,n){var r=this,o=!0;return new Promise((function(i,a){var s;r.publish(t,(function(e){o=!1,i(e)})),setTimeout((function(){o&&(e.traceError(Ve.sdk_error_busPublishNoResult,{actionName:t.getAction()}),null!==(null==n?void 0:n.fallback)?i(t.result(null==n?void 0:n.fallback)):a("publish timeout"))}),null!==(s=null==n?void 0:n.timeoutMs)&&void 0!==s?s:2e3)}))}},{key:"publish",value:function(t,n){var r=new qe((function(r){e.traceLog(Ve.sdk_event_busPublishCallback,{actionName:t.getAction()}),n&&n(r)})),o=t.getAction(),i=e.subscribersMap.get(o);if(e.traceLog(Ve.sdk_event_busPublishMessage,{actionName:t.getAction()}),i){var a,s=m()(i);try{for(s.s();!(a=s.n()).done;){var l=a.value;try{l.onMessage(r,t)}catch(n){e.traceError(Ve.sdk_error_busPublishError,{actionName:t.getAction(),errorMessage:n});var c,u=m()(e.interceptors);try{for(u.s();!(c=u.n()).done;){var d=c.value;null==d||d.onPublishException(t,n)}}catch(e){u.e(e)}finally{u.f()}}}}catch(e){s.e(e)}finally{s.f()}}else{var p,h=!1,f=m()(e.interceptors);try{for(f.s();!(p=f.n()).done;){var v=p.value;e.traceLog("onUnsubscribedAction",JSON.stringify(t)),h=h||(null==v?void 0:v.onUnsubscribedAction(t.getAction()))}}catch(e){f.e(e)}finally{f.f()}h?e.publish(t,n):e.traceError(Ve.sdk_error_busPublishUnsubscribeError,{actionName:t.getAction()})}}},{key:"subscribe",value:function(t){e.traceLog(Ve.sdk_event_busSubscribe,{actionNames:null==t?void 0:t.actionNames()});var n,r=m()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value;e.subscribersMap.has(o)||e.subscribersMap.set(o,[]);var i=e.subscribersMap.get(o);i&&!i.includes(t)&&i.push(t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"unsubscribe",value:function(t){e.traceLog(Ve.sdk_event_busUnsubscribe,{actionNames:null==t?void 0:t.actionNames()});var n,r=m()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=e.subscribersMap.get(o);if(i){var a=i.indexOf(t);-1!==a&&i.splice(a,1)}}}catch(e){r.e(e)}finally{r.f()}}},{key:"isSubscribed",value:function(t){var n=e.subscribersMap.get(t);if(n&&n.length>0)return e.traceLog(Ve.sdk_event_busIsSubscribe,{actionName:t,processResult:!0}),!0;var r,o=!1,i=m()(e.interceptors);try{for(i.s();!(r=i.n()).done;){var a=r.value;o=o||a.onUnsubscribedAction(t)}}catch(e){i.e(e)}finally{i.f()}return o?e.subscribersMap.has(t):(e.traceLog(Ve.sdk_event_busIsSubscribe,{actionName:t,processResult:!1}),!1)}}]),e}();p()(Qe,"TAG","BusManager"),p()(Qe,"_logSplit"," , "),p()(Qe,"interceptors",[]),p()(Qe,"subscribersMap",new Map),p()(Qe,"isDebug",!0),p()(Qe,"logger",void 0);var Ze=n(7065),Xe=n.n(Ze),$e=n(9402),et=n.n($e),tt=n(6705),nt=n.n(tt),rt=n(9050),ot=n.n(rt),it=function(e){var t=document.createElement("iframe");return t.id=e,t.style.height="1px",t.style.width="1px",t.style.border="1px",t.style.opacity="0",t.style.overflow="hidden",t.style.colorScheme=Le,t},at=function(e){return e.TRUSTLY="/auto-debit/pages/trustly/index.html",e}({}),st=function(e){return e.API_PORTAL="api-portal",e.SDK_PORTAL="sdk-portal",e.DOUBLE_FA="double-fa",e.PRELOAD="preload",e}({}),lt=function(e){return e.SDK="SDK",e.API="API",e}({}),ct=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},ut=function(){function e(){b()(this,e),p()(this,"events",void 0),p()(this,"eventsKey",void 0),this.events=new Map,this.eventsKey=new Map}return y()(e,[{key:"on",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(n){if(this.eventsKey.has("".concat(e,"-").concat(n)))return void console.warn("".concat(n,":Has been registered. Please use another key or do not pass the key"));this.eventsKey.set("".concat(e,"-").concat(n),!0)}var r=this.events.get(e)||[];r.push({func:t,key:n||""}),this.events.set(e,r)}},{key:"off",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(n&&this.eventsKey.has("".concat(e,"-").concat(n))&&this.eventsKey.delete("".concat(e,"-").concat(n)),this.events.has(e)){var r=this.events.get(e);r=r.filter((function(e){return(t!==e.func||e.key!==n)&&(!e.key||e.key!==n)})),this.events.set(e,r)}}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.events.has(e)){var o=this.events.get(e);o.forEach((function(e){e.func.apply(e,n)}))}}},{key:"once",value:function(e,t,n){var r=this;this.on(e,(function o(){t.apply(void 0,arguments),r.off(e,o,n)}),n)}},{key:"isExist",value:function(e){return this.events.has(e)}}]),e}(),dt=function(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=encodeURIComponent(n),o=encodeURIComponent(null===e[n]?"":e[n]);t.push("".concat(r,"=").concat(o))}return t.join("&")},pt=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},ht=window.navigator,mt=ht.userAgent,ft=/iPhone|iPad|iPod/i.test(mt)||"MacIntel"===ht.platform&&ht.maxTouchPoints>1,vt=/Android/i.test(mt),gt=(/\bMacintosh\b/.test(mt),/Windows NT/.test(mt),function(){var e=/OpenHarmony/i.test(ht.userAgent),t=/Phone/i.test(ht.userAgent),n=/Tablet/i.test(ht.userAgent);return e&&(t||n)}),yt=ft,_t=vt,bt=!(!/Android|iPhone|iPad|iPod|Mobile/.test(mt)&&!gt()),Et=(gt(),function(e,t){try{return JSON.parse(e)||t}catch(e){return t}}),St=function(){var e=ht.userAgent;return!["Android","iPhone","SymbianOS","Windows Phone","iPod"].some((function(t){return e.includes(t)}))},At=function(e){var t={};return e||(e=window.location.href),e.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o),t[n])})),t},kt=function(){var e=document.documentElement.clientWidth,t=St()?130:100*e/390;return Math.min(t,130)},Tt=function(e,t){try{(t||document.getElementById("ams-component-container")).style.fontSize="".concat(kt(),"px"),window.changingPageHeight=window.innerHeight}catch(e){}},Pt=function(){window.removeEventListener("resize",Tt),window.removeEventListener("pageShow",Tt),window.removeEventListener("DOMContentLoaded",Tt),window.addEventListener("resize",Tt),window.addEventListener("pageShow",Tt),window.addEventListener("DOMContentLoaded",Tt)},wt=function(e,t){try{if(e&&!t){var n=window.localStorage.getItem(e);return n||""}e&&t&&window.localStorage.setItem(e,t)}catch(e){return""}},It=function(e){return"function"==typeof e};function Ct(e){try{var t=atob(e),n=Uint8Array.from(t,(function(e){return e.codePointAt(0)}));return(new TextDecoder).decode(n)}catch(e){return null}}function Rt(e,t){var n=this,r=e.src,o=e.attrOptions,i=void 0===o?{}:o,a=e.timeOut,s=void 0===a?3:a,l=e.loadCallback,c=void 0===l?null:l;return new Promise((function(e,o){t.logInfo({title:"load_item_sdk_start"},{eventMessage:r}),console.time();var a=document.createElement("script"),l=null;a.type="text/javascript",a.onload=function(){t.logInfo({title:"load_item_sdk_end"},{eventMessage:r}),console.timeEnd(),clearTimeout(l),c&&c(),e(!0)},a.onerror=function(){t.logError({title:"load_item_sdk_error"},{eventMessage:r}),clearTimeout(l),console.error("The script "+r+" is not accessible."),o(!1)},l=setTimeout((function(){n.logger.logError({title:"load_item_sdk_timeout"},{eventMessage:r}),o(!1)}),1e3*s),a.src=r,i&&Object.keys(i).forEach((function(e){a.setAttribute(e,i[e])})),document.head.appendChild(a)}))}var Nt=function(e){return!(!e||"object"!==Xe()(e)||0!==Object.keys(e).length)||(!(!Array.isArray(e)||0!==e.length)||(null==e||""===e))},Ot=function(){var e=(At()||{}).environment;return!!e&&"dev"===e};function Dt(e,t){if(!e&&!t)return 0;if(!e)return-1;if(!t)return 1;if(e===t)return 0;if(!e)return-1;if(!t)return 1;for(var n=e.split(".").map((function(e){return parseInt(e)})),r=t.split(".").map((function(e){return parseInt(e)})),o=Math.min(n.length,r.length),i=0;i<o;i++){if(n[i]>r[i])return 1;if(n[i]<r[i])return-1}return o===n.length?-1:1}function Lt(e,t){if(!t)return!0;if(t.includes(","))return t.split(",").includes(e);if(!t.includes("|"))return e===t;var n=t.split("|")[0],r=t.split("|")[1]||"999999.9.9";return Dt(e,n)>=0&&Dt(r,e)>=0}function Mt(e,t){var n=e.value,r=e.version,o=e.platform,i=!1,a=!1;if(o){var s=o.split("|").map((function(e){return e.toLocaleUpperCase()}));a=s.includes("WEB")}else a=!0;if(r)if(-1!==r.indexOf("|")){var l=r.split("|"),c=ot()(l,2),u=c[0],d=void 0===u?"":u,p=c[1];i=function(e,t,n){function r(e){return e.split(".").map((function(e){return parseInt(e,10)}))}function o(e,t){for(var n=0;n<Math.max(e.length,t.length);n++){var r=void 0===e[n]?0:e[n],o=void 0===t[n]?0:t[n];if(r>o)return 1;if(r<o)return-1}return 0}var i=r(e),a=t?r(t):null,s=n?r(n):null;return!(a&&o(i,a)<0||s&&o(i,s)>0)}(t,d,void 0===p?"":p)}else if(-1!==r.indexOf(",")){i=r.split(",").includes(t)}else i=r===t;else i=!0;return n&&a&&i}var xt=function(e){var t=e.environment,n=e.sdkMetaData,r=e.productScene,o=e.productSceneVersion,i=e.paymentMethodCategoryType,a=e.query,s=e.isPreload,l=e.v2Url,c=Kt(t,n,r,o,i,l),u=At(),d=u._sandbox,p=u._light_sandbox,h=u.requestHost,m=void 0===h?"":h,f=u.groupId,v=void 0===f?"":f,g=u.LOCAL_MOCK,y=u._displayType,_={};for(var b in a)_[b]=""+a[b];s&&(_.isPreload="true"),_.appMatched=n.webAppVersion?"true":"false",_.sdkVersion=n.sdkVersion,_.refUrl=window.location.href,_._componentStartTime="".concat(Date.now()),g&&(_.LOCAL_MOCK=g),m&&(_.requestHost=m),v&&(_.groupId=v),"light_sandbox"!==t&&"true"!==p||(_.sandbox="true"),"sandbox"!==t&&"true"!==d||(_.shadow="true"),y&&(_.displayType=y);var E=dt(_);return Ot()&&(console.log("appUpgrade#getIframeUrl#appMatched",_.appMatched),console.log("appUpgrade#getIframeUrl#url",c,E)),{path:c,locationSearch:E}},Ut=function(e){var t,n=e.productScene,r=e.isPreload,o=e.environment,i=r?Vt(n,o):Wt(n,o),a=xt(v()(v()({},e),{},{v2Url:i}));return!r&&i&&a.path&&(console.log("[web-sdk] save web app, url: ",a.path),Gt(n,a.path)),t=-1!==a.path.indexOf("?")?"".concat(a.path,"&").concat(a.locationSearch):"".concat(a.path,"?").concat(a.locationSearch),console.log("[web-sdk] web app, url: ",t),t},Bt=function(e){var t=xt(e);return-1!==t.path.indexOf("?")?"".concat(t.path,"&").concat(t.locationSearch):"".concat(t.path,"?").concat(t.locationSearch)},Kt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,a=At()||{},s=a.host;if(s&&!["sandbox","light_sandbox","prod"].includes(e))return s;var l=Yt(t.productScene,r,o),c="".concat(t.productScene,"_").concat(o);return c===V.AUTO_DEBIT_APM?"".concat(w[e]).concat(at.TRUSTLY):n===W.EASY_PAY?null!=i?i:Wt(n,e):"".concat(T[e],"/").concat(c,"/").concat(l,"/index.html")},Ht=function(e){if(!e)return[];try{var t,n=JSON.parse(e);return null==n||null===(t=n.sdkUpgradeInfo)||void 0===t?void 0:t.versions}catch(e){return console.error("Parse the config for Web app failed#",e),[]}},Ft=function(e){if(!e)return[];try{var t=JSON.parse(e);return null==t?void 0:t.checkoutInfo}catch(e){return console.error("Parse the url config for Web app failed#",e),[]}},Yt=function(e,t,n){var r,o=(r={},p()(p()(p()(p()(p()(p()(p()(p()(p()(p()(r,V.NONE,[""]),V.AUTO_DEBIT_WALLET,["1.0"]),V.AUTO_DEBIT_PAY_WALLET,[""]),V.CASHIER_PAYMENT_BANK,["1.0"]),V.CASHIER_PAYMENT_CARD,["1.0"]),V.CASHIER_PAYMENT_APM,["1.0"]),V.EASY_PAY_WALLET,["1.0","2.0"]),V.EASY_PAY_APM,["2.0"]),V.VAULTING_CARD,["1.0"]),V.ELEMENT_PAYMENT,["1.0"]),p()(p()(p()(r,V.ELEMENT_ADDRESS,["1.0"]),V.CHECKOUT_PAYMENT,["1.0"]),V.AUTO_DEBIT_APM,["1.0"]))[e+"_"+n];if(!o)return"";var i=o.find((function(e){return e===t})),a=o[o.length-1];return i?t:a},jt="web_url_",Gt=function(e,t){var n=jt+e;localStorage.setItem(n,t)},zt=function(e){var t=e.configs,n=void 0===t?[]:t,r=e.mid,o=void 0===r?"":r,i=e.env,a=e.pageName,s=qt(a,i),l=function(){var e=n.sort((function(e,t){return Dt(t.minSDKVersion,e.minSDKVersion)})),t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((function(e){var t,n=!(null==e||null===(t=e.mids)||void 0===t||!t.includes(o)),r=Dt(I,e.minSDKVersion)>=0;if(n&&r)return e}))}(e);if(t)return t;var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((function(e){var t=void 0===(null==e?void 0:e.mids),n=Dt(I,e.minSDKVersion)>=0;if(t&&n)return e}))}(e);return r||void 0}();return l?a===st.SDK_PORTAL?(null==l?void 0:l.url)||s:a===st.DOUBLE_FA&&(null==l?void 0:l.doubleFa)||s:s},Vt=function(e,t){var n=jt+e,r=localStorage.getItem(n);return null!=r?r:Wt(e,t)},Wt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"prod";return e===W.EASY_PAY?qt(st.SDK_PORTAL,t):""},qt=function(e,t){return"".concat(w[t||"prod"],"/easysafepay/pages/").concat(e,"/index.html")},Jt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"prod",n=e.clientId,r=e.extendInfo,o=Ft(r),i=zt({configs:o,mid:n,env:t,pageName:st.DOUBLE_FA});return i},Qt="antom_checkout_previous_ProductInfo_",Zt=function(){function e(){b()(this,e)}return y()(e,null,[{key:"savePreviousProductInfo",value:function(e,t){var n=Qt+"_"+e;localStorage.setItem(n,JSON.stringify({productSceneVersion:t.productSceneVersion,paymentMethodCategoryType:t.paymentMethodCategoryType,hostSign:t.hostSign}))}},{key:"getPreviousProductInfo",value:function(e){var t=Qt+"_"+e,n=localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch(e){return null}return null}}]),e}(),Xt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";try{if(e&&window){var n=window.localStorage.getItem(e);return n||t}}catch(e){return t}},$t=function(e,t){try{if(e&&window)return window.localStorage.setItem(e,t),!0}catch(e){}return!1};function en(e){return!e||(e.toUpperCase().includes("Web".toUpperCase())||""===e)}var tn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"AntomDefaultGrascaleId";try{if(e&&window){var t=Xt(e,"");if(t)return t;var n=ze();e&&n&&$t(e,n)}}catch(e){return""}};function nn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tn();if(!e)return 0;var t=e.substring(e.length-3,e.length-1),n=parseInt(t,16),r=Math.floor(100*n/255);return r}function rn(e,t){if(null==e||!e.greyscale)return!0;try{var n=parseInt(null==e?void 0:e.greyscale);return 0!==n&&n>=t}catch(e){return!1}}var on=function(e,t){try{var n,r=JSON.parse(e),o=function(e,t){var n=e.sort((function(e,t){return Dt(t.appVersion,e.appVersion)})),r=n.find((function(e){if(Lt(t.sdkVersion,e.v)&&en(e.platform)){var n,r,o,i,a,s=null===(n=e.productScene)||void 0===n||!n.trim()||e.productScene.toUpperCase().includes(null==t||null===(r=t.productScene)||void 0===r?void 0:r.toUpperCase()),l=null===(o=e.mid)||void 0===o||!o.trim()||e.mid.toUpperCase().includes(null==t||null===(i=t.mid)||void 0===i?void 0:i.toUpperCase()),c=rn(e,null!==(a=t.greyscale)&&void 0!==a?a:nn());if(s&&l&&c)return e}}));return(null==r?void 0:r.appVersion)||null}(null==r||null===(n=r.sdkUpgradeInfo)||void 0===n?void 0:n.versions,t);return o}catch(e){return""}},an=function(e){try{var t="Antom_".concat(e,"_LastAppVersion");return Xt(t,"")}catch(e){return""}},sn=function(e,t){try{var n="Antom_".concat(e,"_LastAppVersion");return $t(n,t)}catch(e){return!1}};function ln(e){try{return{id:e.split("&&").slice(0,3).join("&&"),data:JSON.parse(Ct(e.split("&&")[3]))}}catch(t){return console.error("Parsing sessionData is abnormal and may affect the payment link. Please ensure to use the new version of SDK.",t),{id:e,data:{}}}}var cn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=un(e,t,n);return r||((r=Xt("Antom_".concat(e.sdkVersion+e.productScene,"_LastAppVersion"),""))||e.sdkVersion)},un=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=n.sort((function(e,t){return Dt(t.appVersion,e.appVersion)})),o=r.find((function(n){if(Lt(e.sdkVersion,n.v)&&en(n.platform)){var r,o,i,a,s=null===(r=n.productScene)||void 0===r||!r.trim()||n.productScene.toUpperCase().includes(null==e||null===(o=e.productScene)||void 0===o?void 0:o.toUpperCase()),l=null===(i=n.mid)||void 0===i||!i.trim()||n.mid.toUpperCase().includes(null==t?void 0:t.toUpperCase()),c=rn(n,null!==(a=e.greyscaleId)&&void 0!==a?a:nn());if(s&&l&&c)return n}}));return(null==o?void 0:o.appVersion)||null},dn={production:{url:"https://cdn.marmot-cloud.com/page/antom-js/apdid-core.umd.min.js"},pre:{url:"https://antom-js-pre-unio.page.alipay.net/apdid-core.umd.min.js"},dev:{url:"https://antom-js-dev-unio.page.alipay.net/apdid-core.umd.min.js"}},pn=new Set(Object.values(dn).map((function(e){return e.url}))),hn=function(){function e(){b()(this,e),p()(this,"state","idle"),p()(this,"loadingPromise",null),p()(this,"apdidModule",null),p()(this,"retryCount",0),p()(this,"config",null)}var t,n;return y()(e,[{key:"getState",value:function(){return this.state}},{key:"getApdidModule",value:function(){return this.apdidModule}},{key:"scheduleLoad",value:function(e){var t=this;if("idle"===this.state){var n=function(){t.load(e).catch((function(){}))};if("undefined"!=typeof requestIdleCallback){var r=requestIdleCallback(n,{timeout:2e3});setTimeout((function(){cancelIdleCallback(r),"idle"===t.state&&n()}),2e3)}else setTimeout(n,0)}}},{key:"load",value:(n=u()(l()().mark((function e(t){var n,r,o,i,a,s,c,u;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ready"!==this.state){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:if("loading"!==this.state||!this.loadingPromise){e.next=4;break}return e.abrupt("return",this.loadingPromise);case 4:if(this.config=t,n=dn[t.environment]){e.next=11;break}return i=new Error("[ApdidLoader] Invalid environment: ".concat(t.environment,". Must be one of: production, pre, dev")),this.state="failed",null===(r=t.callbacks)||void 0===r||null===(o=r.onLoadFailed)||void 0===o||o.call(r,i),e.abrupt("return",Promise.reject(i));case 11:if(a=n.url,pn.has(a)){e.next=17;break}return u=new Error("[ApdidLoader] URL not in whitelist: ".concat(a)),this.state="failed",null===(s=t.callbacks)||void 0===s||null===(c=s.onLoadFailed)||void 0===c||c.call(s,u),e.abrupt("return",Promise.reject(u));case 17:if(!("failed"===this.state&&this.retryCount>1)){e.next=19;break}return e.abrupt("return",Promise.reject(new Error("[ApdidLoader] Max retries exceeded")));case 19:return this.state="loading",this.loadingPromise=this._loadWithRetry(a,t),e.abrupt("return",this.loadingPromise);case 22:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_loadWithRetry",value:(t=u()(l()().mark((function e(t,n){var r,o,i,a;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=0;case 1:if(!(a<=1)){e.next=16;break}return e.prev=2,e.next=5,this._loadModuleOnce(t,n);case 5:return this.retryCount=0,e.abrupt("return");case 9:e.prev=9,e.t0=e.catch(2),i=e.t0,a<1&&(this.retryCount++,this.state="idle");case 13:a++,e.next=1;break;case 16:throw this.state="failed",this.loadingPromise=null,null===(r=n.callbacks)||void 0===r||null===(o=r.onLoadFailed)||void 0===o||o.call(r,i),i;case 20:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_loadModuleOnce",value:function(e,t){var n=this,r=Date.now();return"noModule"in document.createElement("script")?new Promise((function(o,i){var a=window,s=a.APDID;if(s)return n._onLoadSuccess(s,r,t),void o();var l=Array.from(document.querySelectorAll('script[type="module"]')).find((function(t){return t.src===e})),c=l||document.createElement("script"),u=!1,d=function(){clearTimeout(f),c.removeEventListener("load",h),c.removeEventListener("error",m)},p=function(e){u||(u=!0,d(),c.parentNode&&c.parentNode.removeChild(c),i(e))},h=function(){if(!u){var e=a.APDID;e?(u=!0,d(),n._onLoadSuccess(e,r,t),o()):p(new Error("[ApdidLoader] Module loaded but window.".concat("APDID"," not found")))}},m=function(){p(new Error("[ApdidLoader] Failed to load module script: ".concat(e)))},f=setTimeout((function(){var n,r;u||(null===(n=t.callbacks)||void 0===n||null===(r=n.onLoadTimeout)||void 0===r||r.call(n),p(new Error("[ApdidLoader] Module load timeout after ".concat(1e4,"ms: ").concat(e))))}),1e4);c.addEventListener("load",h),c.addEventListener("error",m),l||(c.type="module",c.src=e,c.async=!0,c.crossOrigin="anonymous",(document.head||document.getElementsByTagName("head")[0]).appendChild(c))})):Promise.reject(new Error("[ApdidLoader] Module scripts are not supported"))}},{key:"_onLoadSuccess",value:function(e,t,n){var r,o;this.state="ready",this.apdidModule=e;var i=Date.now()-t;null===(r=n.callbacks)||void 0===r||null===(o=r.onLoad)||void 0===o||o.call(r,i)}},{key:"destroy",value:function(){this.state="idle",this.apdidModule=null,this.loadingPromise=null,this.retryCount=0,this.config=null}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}},{key:"resetInstance",value:function(){e.instance&&e.instance.destroy(),e.instance=null}}]),e}();p()(hn,"instance",null);var mn=function(e){return"AMSSDK_SECURITY_CONFIG_".concat(e)},fn=function(e){return e.SG="SG",e.US="US",e.DE="DE",e}({}),vn={SG:"https://open-sea-global.alipay.com/api/open/risk_client",US:"https://open-na-global.alipay.com/api/open/risk_client",DE:"https://open-de-global.alipay.com/api/open/risk_client"},gn=p()(p()(p()(p()(p()(p()(p()(p()(p()({},W.CASHIER_PAYMENT,"Acquirer"),W.AUTO_DEBIT,"Acquirer"),W.AUTO_DEBIT_PAY,"Acquirer"),W.VAULTING,"Acquirer"),W.CARD_APPLE_PAY,"Acquirer"),"EASYPAY","EasyPay"),W.EASY_PAY,"EasyPay"),W.FLASH_BUY,"OneAccount"),W.ELEMENT_PAYMENT,"Acquirer"),yn=function(e){return vn[e]||vn[fn.SG]},_n=function(e){return gn[e]||""},bn=function(e){if(!e)return"production";var t=e.toLowerCase();return"pre"===t||"light_sandbox"===t?"pre":"dev"===t||"test"===t||"local"===t?"dev":"production"},En=function(){function e(t){b()(this,e),p()(this,"scene",void 0),p()(this,"h5gateway",void 0),p()(this,"environment",void 0),p()(this,"apdidLoaded",!1),p()(this,"apdidLoadFailed",!1),this.scene=t.scene,this.h5gateway=t.h5gateway||vn[fn.SG],this.environment=t.environment}var t,n,r;return y()(e,[{key:"ensureApdidLoaded",value:(r=u()(l()().mark((function e(){var t,n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apdidLoaded){e.next=2;break}return e.abrupt("return",!0);case 2:if(!this.apdidLoadFailed){e.next=4;break}return e.abrupt("return",!1);case 4:return t=hn.getInstance(),n=bn(this.environment),e.prev=6,e.next=9,t.load({environment:n,callbacks:{onLoad:function(e){console.log("[Security] apdid-core script loaded in ".concat(e,"ms"))},onLoadFailed:function(e){console.error("[Security] apdid-core script load failed:",e.message)},onLoadTimeout:function(){console.error("[Security] apdid-core script load timeout")}}});case 9:return this.apdidLoaded=!0,e.abrupt("return",!0);case 13:return e.prev=13,e.t0=e.catch(6),console.error("[Security] apdid-core load error, degrading:",e.t0),this.apdidLoadFailed=!0,e.abrupt("return",!1);case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return r.apply(this,arguments)})},{key:"getAPDIDModule",value:function(){return hn.getInstance().getApdidModule()}},{key:"initSecurity",value:function(e,t){var n=this;if(!this.scene)throw new Error("securityConfig parameter error");if(!Object.values(gn).includes(this.scene)||!Object.values(vn).includes(this.h5gateway)){var r="scene:".concat(this.scene," or h5gateway:").concat(this.h5gateway," do not supported");throw console.error(r),new Error(r)}this.ensureApdidLoaded().then((function(r){r?n.initToken(e,t):t&&t("apdid-core script load failed")})).catch((function(){t&&t("apdid-core script load failed")}))}},{key:"initToken",value:function(e,t){try{var n=this.getAPDIDModule();null==n||n.initToken(this.scene,{host:this.h5gateway},(function(n,r,o){n?e&&e():t&&t(o)}))}catch(e){t&&t(null==e?void 0:e.toString())}}},{key:"pollingGetApdidToken",value:(n=u()(l()().mark((function e(t){var n,r,o,i=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=parseInt((null==t?void 0:t.tokenCollectTime)||"0",10),r=parseInt((null==t?void 0:t.dataPollingInterval)||"500",10),o=function(){var e=u()(l()().mark((function e(t){var o,a,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.getApdidToken();case 2:if(!(o=e.sent)){e.next=5;break}return e.abrupt("return",t(o));case 5:s=function(){var e=u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.getApdidToken();case 2:(o=e.sent)&&(clearInterval(a),t(o));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=setInterval(s,r),setTimeout((function(){clearInterval(a),t(o)}),n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",new Promise((function(e){o(e)})));case 4:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"getApdidToken",value:(t=u()(l()().mark((function e(){var t=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureApdidLoaded();case 2:if(e.sent){e.next=5;break}return e.abrupt("return","");case 5:return e.abrupt("return",new Promise((function(e){try{var n=t.getAPDIDModule();null==n||n.getApdidToken(t.scene,(function(t){e(null==t?void 0:t.token)}))}catch(t){e("")}})));case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),Sn=function(){function e(){b()(this,e),p()(this,"registry",new Map)}var t;return y()(e,[{key:"get",value:function(e){return this.registry.get(e)}},{key:"setLoading",value:function(e,t){this.registry.set(e,{status:"loading",loadingPromise:t})}},{key:"setReady",value:function(e,t){this.registry.set(e,{status:"ready",instance:t})}},{key:"setFailed",value:function(e,t){this.registry.set(e,{status:"failed",error:t})}},{key:"getReadyInstance",value:function(e){var t=this.registry.get(e);if(t&&"ready"===t.status)return t.instance}},{key:"getInstance",value:(t=u()(l()().mark((function e(t){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.registry.get(t)){e.next=3;break}return e.abrupt("return",void 0);case 3:if("ready"!==n.status){e.next=5;break}return e.abrupt("return",n.instance);case 5:if("loading"!==n.status){e.next=15;break}return e.prev=6,e.next=9,n.loadingPromise;case 9:return e.abrupt("return",e.sent);case 12:return e.prev=12,e.t0=e.catch(6),e.abrupt("return",void 0);case 15:return e.abrupt("return",void 0);case 16:case"end":return e.stop()}}),e,this,[[6,12]])}))),function(e){return t.apply(this,arguments)})},{key:"isReady",value:function(e){var t=this.registry.get(e);return"ready"===(null==t?void 0:t.status)}},{key:"isLoading",value:function(e){var t=this.registry.get(e);return"loading"===(null==t?void 0:t.status)}},{key:"delete",value:function(e){return this.registry.delete(e)}},{key:"clear",value:function(){this.registry.clear()}}]),e}(),An=new Sn,kn=function(){function e(){b()(this,e)}var t;return y()(e,null,[{key:"preloadWebApp",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"prod",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{if(this.isWebAppPreloaded)return void console.log("[web-sdk] web app already preloaded");var o=this.buildWebAppPreloadUrl(e,t,n,r),i=o.preloadUrl,a=o.containerId,s=it(a);s.src=i;var l=document.body||null;l&&(console.log("[web-sdk] preload web app, url: ",i),l.appendChild(s),this.isWebAppPreloaded=!0),setTimeout((function(){var e=document.getElementById(a);e&&(console.log("[web-sdk] remove preload web app"),document.body.removeChild(e))}),1e4)}catch(e){console.error("[web-sdk] preload web app failed",e)}}},{key:"preloadSecuritySDK",value:(t=u()(l()().mark((function t(n){var r,o,i,a,s,c,u,d,p,h=this,m=arguments;return l()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=m.length>1&&void 0!==m[1]?m[1]:"SG",o=m.length>2?m[2]:void 0,t.prev=2,!this.isSecuritySDKPreloaded){t.next=6;break}return console.log("[web-sdk] security sdk is already loaded"),t.abrupt("return");case 6:if(i=e.getSecurityConfigStorage(n),a=i.scene||_n(n),console.log("getSecurityScene",a),s=i.h5gateway||yn(r),console.log("preloadSecuritySDK",a),!An.isReady(a)){t.next=15;break}return console.log("[web-sdk] security sdk already ready in registry"),this.isSecuritySDKPreloaded=!0,t.abrupt("return");case 15:if(!An.isLoading(a)){t.next=30;break}if(console.log("[web-sdk] security sdk is already loading, waiting..."),!(c=An.get(a))||"loading"!==c.status){t.next=29;break}return t.prev=19,t.next=22,c.loadingPromise;case 22:this.isSecuritySDKPreloaded=!0,console.log("[web-sdk] preload security sdk succeed (waited for existing load)"),t.next=29;break;case 26:t.prev=26,t.t0=t.catch(19),console.error("[web-sdk] preload security sdk failed (existing load failed)");case 29:return t.abrupt("return");case 30:u=bn(o),hn.getInstance().scheduleLoad({environment:u}),d=new En({scene:a,h5gateway:s,environment:o}),p=new Promise((function(e,t){d.initSecurity((function(){An.setReady(a,d),h.isSecuritySDKPreloaded=!0,console.log("[web-sdk] preload security sdk succeed"),e(d)}),(function(){An.setFailed(a,new Error("Preload security sdk init failed")),console.error("[web-sdk] preload security sdk failed"),t(new Error("Preload security sdk init failed"))}))})),An.setLoading(a,p),t.next=41;break;case 38:t.prev=38,t.t1=t.catch(2),console.error("[web-sdk] preload security sdk failed",t.t1);case 41:case"end":return t.stop()}}),t,this,[[2,38],[19,26]])}))),function(e){return t.apply(this,arguments)})},{key:"getSecuritySdk",value:function(e){return An.getReadyInstance(e)}},{key:"buildWebAppPreloadUrl",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=e===W.EASY_PAY?"2.0":"1.0",i=Zt.getPreviousProductInfo(e);i&&(o=null==i?void 0:i.productSceneVersion);var a="ams-checkout-component-".concat(e,"_").concat(t),s={productScene:e,sdkVersion:I,webAppVersion:""};s.webAppVersion=cn(s);var l={environment:n,sdkMetaData:s,paymentMethodCategoryType:t,isPreload:!0,productScene:e,productSceneVersion:o,query:void 0},c=r?Ut(l):Bt(l);return{preloadUrl:c,containerId:a}}},{key:"getSecurityConfigStorage",value:function(e){var t="",n="",r=wt(mn(e));if(r){var o=Et(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}}]),e}();p()(kn,"isWebAppPreloaded",!1),p()(kn,"isSecuritySDKPreloaded",!1);var Tn=function(e){return e.optional_init="plugin_optional_init",e}({}),Pn=function(e){return e.canMakePayments="plugin_CARD_APPLE_PAY_available",e.createComponent="plugin_CARD_APPLE_PAY_createComponent",e.destroyComponent="plugin_CARD_APPLE_PAY_destroyComponent",e}({}),wn=function(e){return e.mountComponent="plugin_Paypal_mountComponent",e.destroyComponent="plugin_Paypal_destroyComponent",e}({}),In=function(e){return e.onEventCallback="onEventCallback",e}({}),Cn=function(e){return e.getSecurityDeviceId="getSecurityDeviceId",e}({}),Rn=function(e){return e.reportAnalytics="reportAnalytics",e}({}),Nn=function(e){return e[e.notStarted=0]="notStarted",e[e.pending=1]="pending",e[e.fail=2]="fail",e[e.success=3]="success",e}(Nn||{}),On=function(){function e(t){var n=this;b()(this,e),p()(this,"merchantIdentifier",void 0),p()(this,"merchantName",void 0),p()(this,"session",void 0),p()(this,"paymentState",void 0),p()(this,"getMerchantSession",void 0),p()(this,"completePaymentAuthorized",void 0),p()(this,"completeApplePay",void 0),p()(this,"logError",void 0),p()(this,"isRecurring",!1),p()(this,"logger",void 0),p()(this,"onvalidatemerchant",(function(e){var t=!1;n.getMerchantSession({displayName:n.merchantName,merchantIdentifier:n.merchantIdentifier,validationUrl:e.validationURL}).then((function(e){console.log("onvalidatemerchant#merchantSessionObjectString",e);var r=JSON.parse(e);n.session.completeMerchantValidation(r),t=!0})).catch((function(e){n.logError(ce.SDK_PAYMENT_FAIL,"MerchantValidationError",e),n.sessionAbort()})),n.logger.logInfo({name:"APPLE_PAY",title:Aa.sdk_event_appleCreateComponent},{eventSource:"sdk",processResult:t,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send()})),p()(this,"onpaymentauthorized",(function(e){var t,r=window.ApplePaySession,o=!1,i=function(e){n.session.completePayment(r.STATUS_FAILURE),n.logError(ce.SDK_PAYMENT_FAIL,"PaymentAuthorizedError",e),n.sessionAbort()};null!=e&&null!==(t=e.payment)&&void 0!==t&&t.token?(n.paymentState=Nn.pending,n.completePaymentAuthorized({paymentToken:JSON.stringify(e.payment.token)}).then((function(e){n.session.completePayment(r.STATUS_SUCCESS),n.completeApplePay(e),n.paymentState=Nn.success,o=!0})).catch((function(e){i(e),n.paymentState=Nn.fail}))):i(),n.logger.logInfo({name:"APPLE_PAY",title:Aa.sdk_event_appleSubmitToken},{eventSource:"sdk",processResult:o,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send()})),p()(this,"startPay",(function(e){var t=e.paymentSessionFactor,r=t.extendInfo,o=t.merchantInfo,i=t.paymentAmount,a=t.order,s=t.recurringInfo;n.merchantIdentifier=null==o?void 0:o.partnerId;var l=window.ApplePaySession;if(n.isRecurring=null!==s,n.logger.logInfo({name:"APPLE_PAY",title:Aa.sdk_event_appleCreateComponent},{eventSource:"sdk",processResult:null!==l,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send(),l)if(null!=r&&r.merchantCapabilities&&null!=r&&r.supportedNetworks&&null!=o&&o.registeredCountry&&null!=i&&i.currency&&null!=i&&i.value&&null!=o&&o.merchantName){if(s){var c;if(null==a||!a.orderDescription||null==s||!s.managementURL)return void n.logError(ce.SDK_PAYMENT_ERROR,"Abnormal params recurringInfo");var u={type:"final",label:s.title,amount:null==i?void 0:i.value,paymentTiming:"recurring",recurringPaymentStartDate:null!=s&&s.startDate?new Date(1e3*Number(s.startDate)):null,recurringPaymentEndDate:null!=s&&s.endDate?new Date(1e3*Number(s.endDate)):null,recurringPaymentIntervalUnit:null!=s&&s.intervalUnit?s.intervalUnit:"month",recurringPaymentIntervalCount:null!==(c=null==s?void 0:s.intervalCount)&&void 0!==c?c:1},d={paymentDescription:null==a?void 0:a.orderDescription,billingAgreement:s.agreementDescription,regularBilling:u,managementURL:null==s?void 0:s.managementURL,tokenNotificationURL:null==s?void 0:s.tokenNotificationURL},p={merchantCapabilities:null==r?void 0:r.merchantCapabilities,supportedNetworks:null==r?void 0:r.supportedNetworks,countryCode:null==o?void 0:o.registeredCountry,currencyCode:null==i?void 0:i.currency,total:u,recurringPaymentRequest:d,lineItems:[u]};n.session=new l(14,p)}else{var h={merchantCapabilities:null==r?void 0:r.merchantCapabilities,supportedNetworks:null==r?void 0:r.supportedNetworks,countryCode:null==o?void 0:o.registeredCountry,currencyCode:null==i?void 0:i.currency,total:{type:"final",label:null==o?void 0:o.merchantName,amount:null==i?void 0:i.value}};n.session=new l(2,h)}n.session.onvalidatemerchant=n.onvalidatemerchant,n.session.onpaymentauthorized=n.onpaymentauthorized,n.session.oncancel=function(){n.paymentState===Nn.pending?n.logError(ce.SDK_PAYMENT_PROCESSING,"Payment processing but user dismissed the sheet"):n.logError(ce.SDK_PAYMENT_CANCEL,"User dismissed the sheet"),n.sessionAbort()},n.session.begin(),n.logger.logInfo({name:"APPLE_PAY",title:Aa.sdk_event_appleShowPaymentSheet},{eventSource:"sdk",processResult:!0,eventMessage:JSON.stringify({type:"funnel",recurring:null!==s})}).send()}else n.logError(ce.SDK_PAYMENT_ERROR,"Abnormal params paymentSessionFactor");else n.logError(ce.SDK_PAYMENT_ERROR,"ApplePaySession is only support in Safari")})),this.logger=t}var t;return y()(e,[{key:"setApplePayParams",value:function(e,t,n,r){this.getMerchantSession=e,this.completePaymentAuthorized=t,this.completeApplePay=n,this.logError=r,this.paymentState=Nn.notStarted}},{key:"hasActiveCard",value:(t=u()(l()().mark((function e(t){var n,r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=window,!(r=n.ApplePaySession)){e.next=3;break}return e.abrupt("return",r.canMakePaymentsWithActiveCard(t));case 3:return e.abrupt("return",Promise.resolve(!1));case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"sessionAbort",value:function(){if(this.session)try{this.session.abort()}catch(e){console.log("session.abort() error")}}}],[{key:"canMakePayments",value:function(e){return"ApplePayRecurringPayment"===e?!!window.ApplePaySession&&(window.ApplePaySession.canMakePayments()&&window.ApplePaySession.supportsVersion(14)):!!window.ApplePaySession&&(window.ApplePaySession.canMakePayments()&&window.ApplePaySession.supportsVersion(2))}}]),e}(),Dn=On;function Ln(e,t){return function(){return e.apply(t,arguments)}}var Mn,xn,Un=n(8822),Bn=Object.prototype.toString,Kn=Object.getPrototypeOf,Hn=Symbol.iterator,Fn=Symbol.toStringTag,Yn=(Mn=Object.prototype.hasOwnProperty,function(e,t){return Mn.call(e,t)}),jn=function(e){return"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e)},Gn=function(e,t,n){return e===Object.prototype||!n&&null===t},zn=function(e,t){for(var n=e,r=[];null!=n;){if(-1!==r.indexOf(n))return!1;r.push(n);var o=Kn(n);if(Gn(n,o,n===e))return!1;if(Yn(n,t))return!0;n=o}return!1},Vn=(xn=Object.create(null),function(e){var t=Bn.call(e);return xn[t]||(xn[t]=t.slice(8,-1).toLowerCase())}),Wn=function(e){return e=e.toLowerCase(),function(t){return Vn(t)===e}},qn=function(e){return function(t){return Ze(t)===e}},Jn=Array.isArray,Qn=qn("undefined");function Zn(e){return null!==e&&!Qn(e)&&null!==e.constructor&&!Qn(e.constructor)&&er(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var Xn=Wn("ArrayBuffer");var $n=qn("string"),er=qn("function"),tr=qn("number"),nr=function(e){return null!==e&&"object"===Ze(e)},rr=function(e){if(!nr(e))return!1;var t=Kn(e);return!(null!==t&&t!==Object.prototype&&null!==Kn(t)||zn(e,Fn)||zn(e,Hn))},or=Wn("Date"),ir=Wn("File"),ar=Wn("Blob"),sr=Wn("FileList"),lr=Wn("Set");var cr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},ur=void 0!==cr.FormData?cr.FormData:void 0,dr=Wn("URLSearchParams"),pr=["ReadableStream","Request","Response","Headers"].map(Wn),hr=rt(pr,4),mr=hr[0],fr=hr[1],vr=hr[2],gr=hr[3];function yr(e,t){var n,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.allOwnKeys,a=void 0!==i&&i;if(null!=e)if("object"!==Ze(e)&&(e=[e]),Jn(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(Zn(e))return;var s,l=a?Object.getOwnPropertyNames(e):Object.keys(e),c=l.length;for(n=0;n<c;n++)s=l[n],t.call(null,e[s],s,e)}}function _r(e,t){if(Zn(e))return null;t=t.toLowerCase();for(var n,r=Object.keys(e),o=r.length;o-- >0;)if(t===(n=r[o]).toLowerCase())return n;return null}var br="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,Er=function(e){return!Qn(e)&&e!==br};var Sr,Ar=(Sr="undefined"!=typeof Uint8Array&&Kn(Uint8Array),function(e){return Sr&&e instanceof Sr}),kr=Wn("HTMLFormElement"),Tr=Object.prototype.propertyIsEnumerable,Pr=Wn("RegExp"),wr=function(e,t){var n=Object.getOwnPropertyDescriptors(e),r={};yr(n,(function(n,o){var i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)};var Ir,Cr,Rr,Nr,Or=Wn("AsyncFunction"),Dr=(Ir="function"==typeof setImmediate,Cr=er(br.postMessage),Ir?setImmediate:Cr?(Rr="axios@".concat(Math.random()),Nr=[],br.addEventListener("message",(function(e){var t=e.source,n=e.data;t===br&&n===Rr&&Nr.length&&Nr.shift()()}),!1),function(e){Nr.push(e),br.postMessage(Rr,"*")}):function(e){return setTimeout(e)}),Lr="undefined"!=typeof queueMicrotask?queueMicrotask.bind(br):void 0!==Un&&Un.nextTick||Dr,Mr=function(e){return null!=e&&er(e[Hn])},xr={isArray:Jn,isArrayBuffer:Xn,isBuffer:Zn,isFormData:function(e){if(!e)return!1;if(ur&&e instanceof ur)return!0;var t=Kn(e);if(!t||t===Object.prototype)return!1;if(!er(e.append))return!1;var n=Vn(e);return"formdata"===n||"object"===n&&er(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Xn(e.buffer)},isString:$n,isNumber:tr,isBoolean:function(e){return!0===e||!1===e},isObject:nr,isPlainObject:rr,isEmptyObject:function(e){if(!nr(e)||Zn(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:mr,isRequest:fr,isResponse:vr,isHeaders:gr,isUndefined:Qn,isDate:or,isFile:ir,isReactNativeBlob:function(e){return!(!e||void 0===e.uri)},isReactNative:function(e){return e&&void 0!==e.getParts},isBlob:ar,isRegExp:Pr,isFunction:er,isStream:function(e){return nr(e)&&er(e.pipe)},isURLSearchParams:dr,isTypedArray:Ar,isFileList:sr,forEach:yr,merge:function e(){for(var t=Er(this)&&this||{},n=t.caseless,r=t.skipUndefined,o={},i=function(t,i){if("__proto__"!==i&&"constructor"!==i&&"prototype"!==i){var a=n&&"string"==typeof i&&_r(o,i)||i,s=Yn(o,a)?o[a]:void 0;rr(s)&&rr(t)?o[a]=e(s,t):rr(t)?o[a]=e({},t):Jn(t)?o[a]=t.slice():r&&Qn(t)||(o[a]=t)}},a=0,s=arguments.length;a<s;a++){var l=a<0||arguments.length<=a?void 0:arguments[a];if(l&&!Zn(l)&&(yr(l,i),"object"===Ze(l)&&!Jn(l)))for(var c=Object.getOwnPropertySymbols(l),u=0;u<c.length;u++){var d=c[u];Tr.call(l,d)&&i(l[d],d)}}return o},extend:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.allOwnKeys;return yr(t,(function(t,r){n&&er(t)?Object.defineProperty(e,r,{__proto__:null,value:Ln(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:o}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var o,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&Kn(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:Vn,kindOfTest:Wn,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(Jn(e))return e;var t=e.length;if(!tr(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},forEachEntry:function(e,t){for(var n,r=(e&&e[Hn]).call(e);(n=r.next())&&!n.done;){var o=n.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:kr,hasOwnProperty:Yn,hasOwnProp:Yn,hasOwnInPrototypeChain:zn,getSafeProp:function(e,t){return null!=e&&zn(e,t)?e[t]:void 0},toSafeFlatObject:function(e){if(null==e||"object"!==Ze(e)&&"function"!=typeof e)return e;var t=Kn(e);if(null===t&&function(e){if(!Object.isExtensible(e))return!1;var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push.apply(t,tt(Object.getOwnPropertySymbols(e))),t.every((function(t){if(jn(t))return!1;var n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable}))}(e))return e;for(var n=Object.create(null),r=Object.create(null),o=[],i=e;null!=i&&-1===o.indexOf(i);){o.push(i);var a=i===e?t:Kn(i);if(Gn(i,a,i===e))break;var s=Object.getOwnPropertyNames(i);Object.getOwnPropertySymbols&&s.push.apply(s,tt(Object.getOwnPropertySymbols(i)));var l,c=h(s);try{for(c.s();!(l=c.n()).done;){var u=l.value;jn(u)||(Yn(r,u)||(n[u]=e[u],r[u]=!0))}}catch(e){c.e(e)}finally{c.f()}i=a}return n},reduceDescriptors:wr,freezeMethods:function(e){wr(e,(function(t,n){if(er(e)&&["arguments","caller","callee"].includes(n))return!1;var r=e[n];er(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:function(e,t){var n={},r=function(e){e.forEach((function(e){n[e]=!0}))};return Jn(e)?r(e):r(String(e).split(t)),n},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))},noop:function(){},toFiniteNumber:function(e,t){return null!=e&&Number.isFinite(e=+e)?e:t},findKey:_r,global:br,isContextDefined:Er,isSpecCompliantForm:function(e){return!!(e&&er(e.append)&&"FormData"===e[Fn]&&e[Hn])},toJSONObject:function(e){var t=new WeakSet;return function e(n){if(nr(n)){if(t.has(n))return;if(Zn(n))return n;if(!("toJSON"in n)){var r;if(t.add(n),lr(n)){r=[];var o,i=h(n);try{for(i.s();!(o=i.n()).done;){var a=o.value,s=e(a);!Qn(s)&&r.push(s)}}catch(e){i.e(e)}finally{i.f()}}else r=Jn(n)?[]:{},yr(n,(function(t,n){var o=e(t);!Qn(o)&&(r[n]=o)}));return t.delete(n),r}}return n}(e)},isAsyncFn:Or,isThenable:function(e){return e&&(nr(e)||er(e))&&er(e.then)&&er(e.catch)},setImmediate:Dr,asap:Lr,isIterable:Mr,isSafeIterable:function(e){return null!=e&&zn(e,Hn)&&Mr(e)}},Ur=xr.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"]);var Br=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Kr=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Hr(e,t){return xr.isArray(e)?e.map((function(e){return Hr(e,t)})):function(e){for(var t=0,n=e.length;t<n;){var r=e.charCodeAt(t);if(9!==r&&32!==r)break;t+=1}for(;n>t;){var o=e.charCodeAt(n-1);if(9!==o&&32!==o)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function Fr(e){var t=Object.create(null);return xr.forEach(e.toJSON(),(function(e,n){t[n]=function(e){return Hr(e,Kr)}(e)})),t}var Yr=Symbol("internals");function jr(e){return e&&String(e).trim().toLowerCase()}function Gr(e){return!1===e||null==e?e:xr.isArray(e)?e.map(Gr):function(e){return Hr(e,Br)}(String(e))}var zr=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Vr(e){for(var t=0,n=e.length;t<n;){var r=e.charCodeAt(t);if(9!==r&&32!==r)break;t+=1}for(;n>t;){var o=e.charCodeAt(n-1);if(9!==o&&32!==o)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function Wr(e,t,n,r,o){return xr.isFunction(r)?r.call(this,t,n):(o&&(t=n),xr.isString(t)?xr.isString(r)?-1!==t.indexOf(r):xr.isRegExp(r)?r.test(t):void 0:void 0)}var qr=function(e,t){function n(e){_(this,n),e&&this.set(e)}return g(n,[{key:"set",value:function(e,t,n){var r=this;function o(e,t,n){var o=jr(t);if(o){var i=xr.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Gr(e))}}var i=function(e,t){return xr.forEach(e,(function(e,n){return o(e,n,t)}))};if(xr.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(xr.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i(function(e){var t,n,r,o={};return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),t=e.substring(0,r).trim().toLowerCase(),n=e.substring(r+1).trim();var i=xr.hasOwnProp(o,t);!t||i&&xr.hasOwnProp(Ur,t)||("set-cookie"===t?i?o[t].push(n):o[t]=[n]:o[t]=i?o[t]+", "+n:n)})),o}(e),t);else if(xr.isObject(e)&&xr.isSafeIterable(e)){var a,s,l,c=Object.create(null),u=h(e);try{for(u.s();!(l=u.n()).done;){var d=l.value;if(!xr.isArray(d))throw new TypeError("Object iterator must return a key-value pair");s=d[0],xr.hasOwnProp(c,s)?(a=c[s],c[s]=xr.isArray(a)?[].concat(tt(a),[d[1]]):[a,d[1]]):c[s]=d[1]}}catch(e){u.e(e)}finally{u.f()}i(c,t)}else null!=e&&o(t,e,n);return this}},{key:"get",value:function(e,t){if(e=jr(e)){var n=xr.findKey(this,e);if(n){var r=this[n];if(!t)return r;if(!0===t)return function(e){for(var t,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=r.exec(e);)n[t[1]]=t[2];return n}(r);if(xr.isFunction(t))return t.call(this,r,n);if(xr.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=jr(e)){var n=xr.findKey(this,e);return!(!n||void 0===this[n]||t&&!Wr(0,this[n],n,t))}return!1}},{key:"delete",value:function(e,t){var n=this,r=!1;function o(e){if(e=jr(e)){var o=xr.findKey(n,e);!o||t&&!Wr(0,n[o],o,t)||(delete n[o],r=!0)}}return xr.isArray(e)?e.forEach(o):o(e),r}},{key:"clear",value:function(e){for(var t=Object.keys(this),n=t.length,r=!1;n--;){var o=t[n];e&&!Wr(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}},{key:"normalize",value:function(e){var t=this,n={};return xr.forEach(this,(function(r,o){var i=xr.findKey(n,o);if(i)return t[i]=Gr(r),void delete t[o];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))}(o):String(o).trim();a!==o&&delete t[o],t[a]=Gr(r),n[a]=!0})),this}},{key:"concat",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=this.constructor).concat.apply(e,[this].concat(n))}},{key:"toJSON",value:function(e){var t=Object.create(null);return xr.forEach(this,(function(n,r){null!=n&&!1!==n&&(t[r]=e&&xr.isArray(n)?n.join(", "):n)})),t}},{key:e,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map((function(e){var t=rt(e,2);return t[0]+": "+t[1]})).join("\n")}},{key:"getSetCookie",value:function(){var e=this.get("set-cookie");return xr.isArray(e)?e:null==e||!1===e?[]:[e]}},{key:t,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(e){return e instanceof this?e:new this(e)}},{key:"parseParameters",value:function(e){return function(e){var t=Object.create(null),n=String(e),r=0,o=!1,i=!1;function a(e){var o=Vr(n.slice(r,e)),i=o.indexOf("=");if(!(i<1)){var a=Vr(o.slice(0,i));if(zr.test(a)){var s=a.toLowerCase();if("__proto__"!==s&&"constructor"!==s&&"prototype"!==s){var l=Vr(o.slice(i+1));t[s]=function(e){var t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;for(var n="",r=1;r<t;r++){var o=e.charCodeAt(r);if(34===o)return e;if(92===o&&(r+=1)>=t)return e;n+=e[r]}return n}(l)}}}}for(var s=0;s<n.length;s++){var l=n.charCodeAt(s);o?i?i=!1:92===l?i=!0:34===l&&(o=!1):34===l?o=!0:44!==l&&59!==l||(a(s),r=s+1)}return a(n.length),t}(e)}},{key:"concat",value:function(e){for(var t=new this(e),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.forEach((function(e){return t.set(e)})),t}},{key:"accessor",value:function(e){var t=(this[Yr]=this[Yr]={accessors:{}}).accessors,n=this.prototype;function r(e){var r=jr(e);t[r]||(!function(e,t){var n=xr.toCamelCase(" "+t);["get","set","has"].forEach((function(r){Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return xr.isArray(e)?e.forEach(r):r(e),this}}]),n}(Symbol.iterator,Symbol.toStringTag);qr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),xr.reduceDescriptors(qr.prototype,(function(e,t){var n=e.value,r=t[0].toUpperCase()+t.slice(1);return{get:function(){return n},set:function(e){this[r]=e}}})),xr.freezeMethods(qr);var Jr=qr,Qr="[REDACTED ****]";function Zr(e,t){var n=new Set(t.map((function(e){return String(e).toLowerCase()}))),r=[];return function e(t){if(null===t||"object"!==Ze(t))return t;if(xr.isBuffer(t))return t;if(-1===r.indexOf(t)){var o;if(t instanceof Jr&&(t=t.toJSON()),r.push(t),xr.isArray(t))o=[],t.forEach((function(t,n){var r=e(t);xr.isUndefined(r)||(o[n]=r)}));else{if(!xr.isPlainObject(t)&&function(e){if(xr.hasOwnProp(e,"toJSON"))return!0;for(var t=Object.getPrototypeOf(e);t&&t!==Object.prototype;){if(xr.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(t))return r.pop(),t;o=Object.create(null);for(var i=0,a=Object.entries(t);i<a.length;i++){var s=rt(a[i],2),l=s[0],c=s[1],u=n.has(l.toLowerCase())?Qr:e(c);xr.isUndefined(u)||(o[l]=u)}}return r.pop(),o}}(e)}function Xr(e){try{return String(e)}catch(e){return""}}var $r=function(e){E(n,e);var t=A(n);function n(e,r,o,i,a){var s;return _(this,n),s=t.call(this,e),Object.defineProperty($e(s),"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),s.name="AxiosError",s.isAxiosError=!0,r&&(s.code=r),o&&(s.config=o),i&&(s.request=i),a&&(s.response=a,s.status=a.status),s}return g(n,[{key:"toJSON",value:function(){var e=this.config,t=e&&xr.hasOwnProp(e,"redact")?e.redact:void 0,n=xr.isArray(t)&&t.length>0?Zr(e,t):xr.toJSONObject(e);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:n,code:this.code,status:this.status}}}],[{key:"from",value:function(e,t,r,o,i,a){var s=e.message;!s&&xr.isArray(e.errors)&&e.errors.length&&(s=function(e){return e.errors.map((function(e){try{return e&&e.message?Xr(e.message):Xr(e)}catch(e){return""}})).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));var l=new n(s,t||e.code,r,o,i);return Object.defineProperty(l,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),l.name=e.name,null!=e.status&&null==l.status&&(l.status=e.status),a&&Object.assign(l,a),l}}]),n}(R(Error));$r.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",$r.ERR_BAD_OPTION="ERR_BAD_OPTION",$r.ECONNABORTED="ECONNABORTED",$r.ETIMEDOUT="ETIMEDOUT",$r.ECONNREFUSED="ECONNREFUSED",$r.ERR_NETWORK="ERR_NETWORK",$r.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",$r.ERR_DEPRECATED="ERR_DEPRECATED",$r.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",$r.ERR_BAD_REQUEST="ERR_BAD_REQUEST",$r.ERR_CANCELED="ERR_CANCELED",$r.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",$r.ERR_INVALID_URL="ERR_INVALID_URL",$r.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var eo=$r;function to(e){return xr.isPlainObject(e)||xr.isArray(e)}function no(e){return xr.endsWith(e,"[]")?e.slice(0,-2):e}function ro(e,t,n){return e?e.concat(t).map((function(e,t){return e=no(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var oo=xr.toFlatObject(xr,{},null,(function(e){return/^is[A-Z]/.test(e)}));var io=function(e,t,n){if(!xr.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var r=function(e,t){var r=xr.getSafeProp(n,e);return xr.isUndefined(r)?t:r},o=r("metaTokens",!0),i=r("visitor")||m,a=r("dots",!1),s=r("indexes",!1),l=r("Blob")||"undefined"!=typeof Blob&&Blob,c=r("maxDepth",100),u=l&&xr.isSpecCompliantForm(t),d=[];if(!xr.isFunction(i))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(xr.isDate(e))return e.toISOString();if(xr.isBoolean(e))return e.toString();if(!u&&xr.isBlob(e))throw new eo("Blob is not supported. Use a Buffer instead.");if(xr.isArrayBuffer(e)||xr.isTypedArray(e)){if(u&&"function"==typeof l)return new l([e]);throw new eo("Blob is not supported. Use a Buffer instead.",eo.ERR_NOT_SUPPORT)}return e}function h(e){if(e>c)throw new eo("Object is too deeply nested ("+e+" levels). Max depth: "+c,eo.ERR_FORM_DATA_DEPTH_EXCEEDED)}function m(e,n,r){var i=e;if(xr.isReactNative(t)&&xr.isReactNativeBlob(e))return t.append(ro(r,n,a),p(e)),!1;if(e&&!r&&"object"===Ze(e))if(xr.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=function(e,t){if(c===1/0)return JSON.stringify(e);var n=[];return JSON.stringify(e,(function(e,r){if(!xr.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),h(t+n.length-1),r}))}(e,1);else if(xr.isArray(e)&&function(e){return xr.isArray(e)&&!e.some(to)}(e)||(xr.isFileList(e)||xr.endsWith(n,"[]"))&&(i=xr.toArray(e)))return n=no(n),i.forEach((function(e,r){!xr.isUndefined(e)&&null!==e&&t.append(!0===s?ro([n],r,a):null===s?n:n+"[]",p(e))})),!1;return!!to(e)||(t.append(ro(r,n,a),p(e)),!1)}var f=Object.assign(oo,{defaultVisitor:m,convertValue:p,isVisitable:to});if(!xr.isObject(e))throw new TypeError("data must be an object");return function e(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!xr.isUndefined(n)){if(h(o),-1!==d.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));d.push(n),xr.forEach(n,(function(n,a){!0===(!(xr.isUndefined(n)||null===n)&&i.call(t,n,xr.isString(a)?a.trim():a,r,f))&&e(n,r?r.concat(a):[a],o+1)})),d.pop()}}(e),t};function ao(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function so(e,t){this._pairs=[],e&&io(e,this,t)}var lo=so.prototype;lo.append=function(e,t){this._pairs.push([e,t])},lo.toString=function(e){var t=this,n=e?function(n){return e.call(t,n,ao)}:ao;return this._pairs.map((function(e){return n(e[0])+"="+n(e[1])}),"").join("&")};var co=so;function uo(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function po(e,t,n){if(!t)return e;e=e||"";var r,o=xr.isFunction(n)?{serialize:n}:n,i=xr.getSafeProp(o,"encode")||uo,a=xr.getSafeProp(o,"serialize");if(r=a?a(t,o):xr.isURLSearchParams(t)?t.toString():new co(t,o).toString(i)){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}var ho=Symbol("internals");function mo(e){return e?e.length:0}function fo(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function vo(e,t){var n=e.handlers,r=mo(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):r!==t.handlersLength&&(r?t.handlerEntries.forEach((function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)})):t.handlerEntries.clear()),t.handlersLength=r}var go=function(){function e(){_(this,e),this.handlers=[],this[ho]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}return g(e,[{key:"use",value:function(e,t,n){var r={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},o=this[ho];null==this.handlers&&(this.handlers=[]),vo(this,o);var i=o.nextId++;return this.handlers.push(r),o.handlerEntries.set(i,{handler:r,index:this.handlers.length-1}),o.handlersLength=this.handlers.length,i}},{key:"eject",value:function(e){var t=this[ho];vo(this,t);var n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||(fo(this.handlers),t.handlersLength=this.handlers.length)}}},{key:"clear",value:function(){this.handlers&&(this.handlers=[],vo(this,this[ho]))}},{key:"forEach",value:function(e){var t=this[ho];vo(this,t),t.iterationDepth++;try{xr.forEach(this.handlers,(function(t){null!==t&&e(t)}))}finally{--t.iterationDepth||(vo(this,t),fo(this.handlers),t.handlersLength=mo(this.handlers))}}}]),e}(),yo=go,_o={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},bo={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:co,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Eo="undefined"!=typeof window&&"undefined"!=typeof document,So="object"===("undefined"==typeof navigator?"undefined":Ze(navigator))&&navigator||void 0,Ao=Eo&&(!So||["ReactNative","NativeScript","NS"].indexOf(So.product)<0),ko="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,To=Eo&&window.location.href||"http://localhost",Po=f(f({},i),bo);function wo(e){if(e>100)throw new eo("FormData field is too deeply nested ("+e+" levels). Max depth: 100",eo.ERR_FORM_DATA_DEPTH_EXCEEDED)}var Io=function(e){function t(e,n,r,o){wo(o);var i=e[o++];if("__proto__"===i)return!0;var a=Number.isFinite(+i),s=o>=e.length;return i=!i&&xr.isArray(r)?r.length:i,s?(xr.hasOwnProp(r,i)?r[i]=xr.isArray(r[i])?r[i].concat(n):[r[i],n]:r[i]=n,!a):(xr.hasOwnProp(r,i)&&xr.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&xr.isArray(r[i])&&(r[i]=function(e){var t,n,r={},o=Object.keys(e),i=o.length;for(t=0;t<i;t++)r[n=o[t]]=e[n];return r}(r[i])),!a)}if(xr.isFormData(e)&&xr.isFunction(e.entries)){var n={};return xr.forEachEntry(e,(function(e,r){t(function(e){for(var t,n=[],r=/[^.[\]]+|\[([^.[\]]*)]/g;null!==(t=r.exec(e));)wo(n.length),n.push("[]"===t[0]?"":t[1]||t[0]);return n}(e),r,n,0)})),n}return null},Co=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Ro=function(e,t){return null!=e&&xr.hasOwnProp(e,t)?e[t]:void 0};var No={transitional:_o,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){var n,r=t.getContentType()||"",o=r.indexOf("application/json")>-1,i=xr.isObject(e);if(i&&xr.isHTMLForm(e)&&(e=new FormData(e)),xr.isFormData(e))return o?JSON.stringify(Io(e)):e;if(xr.isArrayBuffer(e)||xr.isBuffer(e)||xr.isStream(e)||xr.isFile(e)||xr.isBlob(e)||xr.isReadableStream(e))return e;if(xr.isArrayBufferView(e))return e.buffer;if(xr.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){var a=Ro(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return io(e,new Po.classes.URLSearchParams,f({visitor:function(e,t,n,r){return Po.isNode&&xr.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,a).toString();if((n=xr.isFileList(e))||r.indexOf("multipart/form-data")>-1){var s=Ro(this,"env"),l=s&&s.FormData;return io(n?{"files[]":e}:e,l&&new l,a)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(xr.isString(e))try{return(t||JSON.parse)(e),xr.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=Ro(this,"transitional")||No.transitional,n=t&&t.forcedJSONParsing,r=Ro(this,"responseType"),o="json"===r;if(xr.isResponse(e)||xr.isReadableStream(e))return e;if(e&&xr.isString(e)&&(n&&!r||o)){var i=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,Ro(this,"parseReviver"))}catch(e){if(i){if("SyntaxError"===e.name)throw eo.from(e,eo.ERR_BAD_RESPONSE,this,null,Ro(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Po.classes.FormData,Blob:Po.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};xr.forEach(Co,(function(e){No.headers[e]={}}));var Oo=No;function Do(e,t){var n=this||Oo,r=t||n,o=Jr.from(r.headers),i=r.data;return xr.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function Lo(e){return!(!e||!e.__CANCEL__)}var Mo=function(e){E(n,e);var t=A(n);function n(e,r,o){var i;return _(this,n),(i=t.call(this,null==e?"canceled":e,eo.ERR_CANCELED,r,o)).name="CanceledError",i.__CANCEL__=!0,i}return g(n)}(eo),xo=Mo;function Uo(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new eo("Request failed with status code "+n.status,n.status>=400&&n.status<500?eo.ERR_BAD_REQUEST:eo.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}var Bo=/[\t\n\r]/g;function Ko(e){if("string"!=typeof e)return e;for(var t=0;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(Bo,"")}function Ho(e){var t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}var Fo=function(e,t){e=e||10;var n,r=new Array(e),o=new Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(s){var l=Date.now(),c=o[a];n||(n=l),r[i]=s,o[i]=l;for(var u=a,d=0;u!==i;)d+=r[u++],u%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),!(l-n<t)){var p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}};var Yo=function(e,t){var n,r,o=0,i=1e3/t,a=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(void 0,tt(t))};return[function(){for(var e=Date.now(),t=e-o,s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];t>=i?a(l,e):(n=l,r||(r=setTimeout((function(){r=null,a(n)}),i-t)))},function(){return n&&a(n)},function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(t)}]},jo=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,o=Fo(50,250);return Yo((function(n){if(n&&xr.isNumber(n.loaded)){var i=n.loaded,a=n.lengthComputable?n.total:void 0,s=Math.max(0,null!=a?Math.min(i,a):i),l=Math.max(0,s-r),c=o(l);r=Math.max(r,s);var u=d({loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a?(a-s)/c:void 0,event:n,lengthComputable:null!=a},t?"download":"upload",!0);e(u)}}),n)},Go=function(e,t){var n=null!=e;return[function(r){return t[0]({lengthComputable:n,total:e,loaded:r})},t[1]]},zo=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xr.asap;return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t((function(){return e.apply(void 0,r)}))}},Vo=Po.hasStandardBrowserEnv?function(e,t){return function(n){return n=new URL(n,Po.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)}}(new URL(Po.origin),Po.navigator&&/(msie|trident)/i.test(Po.navigator.userAgent)):function(){return!0},Wo=Po.hasStandardBrowserEnv?{write:function(e,t,n,r,o,i,a){if("undefined"!=typeof document){var s=["".concat(e,"=").concat(encodeURIComponent(t))];xr.isNumber(n)&&s.push("expires=".concat(new Date(n).toUTCString())),xr.isString(r)&&s.push("path=".concat(r)),xr.isString(o)&&s.push("domain=".concat(o)),!0===i&&s.push("secure"),xr.isString(a)&&s.push("SameSite=".concat(a)),document.cookie=s.join("; ")}},read:function(e){if("undefined"==typeof document)return null;for(var t=document.cookie.split(";"),n=0;n<t.length;n++){var r=t[n].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===e)try{return decodeURIComponent(r.slice(o+1))}catch(e){return r.slice(o+1)}}return null},remove:function(e){this.write(e,"",Date.now()-864e5,"/")}}:{write:function(){},read:function(){return null},remove:function(){}};var qo=/^https?:(?!\/\/)/i;function Jo(e){var t,n=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,"$1".concat(Qr,"@")),r=n.indexOf("#"),o=(-1===r?n:n.slice(0,r)).replace(/([?&][^=&#]*=)[^&#]*/g,"$1".concat(Qr));return-1===r?o:"".concat(o,"#").concat((t=n.slice(r+1))?t.replace(/(^|&)([^=&]*=)?[^&]+/g,(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return"".concat(t).concat(n).concat(Qr)})):t)}function Qo(e,t){if("string"==typeof e){var n=Ko(e);if(qo.test(n))throw new eo("Invalid URL ".concat(JSON.stringify(Jo(n)),': missing "//" after protocol'),eo.ERR_INVALID_URL,t)}}function Zo(e,t,n,r){Qo(t,r);var o,i=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));return e&&(i||!1===n)?(Qo(e,r),function(e,t){if(!t)return e;for(var n=e.length;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}var Xo=function(e){return e instanceof Jr?f({},e):e};function $o(e,t){e=e||{},t=t||{};var n=Object.create(null);function r(e,t,n,r){return xr.isPlainObject(e)&&xr.isPlainObject(t)?xr.merge.call({caseless:r},e,t):xr.isPlainObject(t)?xr.merge({},t):xr.isArray(t)?t.slice():t}function o(e,t,n,o){return xr.isUndefined(t)?xr.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!xr.isUndefined(t))return r(void 0,t)}function a(e,t){return xr.isUndefined(t)?xr.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return xr.hasOwnProp(t,i)?r(n,o):xr.hasOwnProp(e,i)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});var l,c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutErrorMessage: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,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:function(e,t,n){return o(Xo(e),Xo(t),0,!0)}};return xr.forEach((l=f(f({},e),t),Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(l).concat(Object.getOwnPropertySymbols(l).filter((function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable}))):Object.keys(l)),(function(r){if("__proto__"!==r&&"constructor"!==r&&"prototype"!==r){var i=xr.hasOwnProp(c,r)?c[r]:o,a=i(xr.hasOwnProp(e,r)?e[r]:void 0,xr.hasOwnProp(t,r)?t[r]:void 0,r);xr.isUndefined(a)&&i!==s||(n[r]=a)}})),xr.hasOwnProp(t,"validateStatus")&&xr.isUndefined(t.validateStatus)&&!1===function(n){var r=xr.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!xr.isUndefined(r)){if(!xr.isPlainObject(r))return;if(xr.hasOwnProp(r,n))return r[n]}var o=xr.hasOwnProp(e,"transitional")?e.transitional:void 0;if(xr.isPlainObject(o)&&xr.hasOwnProp(o,n))return o[n]}("validateStatusUndefinedResolves")&&(xr.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}var ei=["content-type","content-length"];var ti=function(e){var t=$o({},e),n=function(e){return xr.hasOwnProp(t,e)?t[e]:void 0},r=n("data"),o=n("withXSRFToken"),i=n("xsrfHeaderName"),a=n("xsrfCookieName"),s=n("headers"),l=n("auth"),c=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(t.headers=s=Jr.from(s),t.url=po(Zo(c,d,u,t),n("params"),n("paramsSerializer")),l){var p=xr.getSafeProp(l,"username")||"",h=xr.getSafeProp(l,"password")||"";try{s.set("Authorization","Basic "+btoa(p+":"+(h?encodeURIComponent(h).replace(/%([0-9A-F]{2})/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))})):"")))}catch(t){throw eo.from(t,eo.ERR_BAD_OPTION_VALUE,e)}}if(xr.isFormData(r)){var m=xr.getSafeProp(r,"getHeaders");Po.hasStandardBrowserEnv||Po.hasStandardBrowserWebWorkerEnv||xr.isReactNative(r)?s.setContentType(void 0):xr.isFunction(m)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach((function(t){var n=rt(t,2),r=n[0],o=n[1];ei.includes(r.toLowerCase())&&e.set(r,o)})):e.set(t)}(s,m.call(r),n("formDataHeaderPolicy"))}if(Po.hasStandardBrowserEnv&&(xr.isFunction(o)&&(o=o(t)),!0===o||null==o&&Vo(t.url))){var f=i&&a&&Wo.read(a);f&&s.set(i,f)}return t},ni="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){var r,o,i,a,s,l,c=ti(e),u=c.data,d=Jr.from(c.headers).normalize(),p=c.responseType,h=c.onUploadProgress,m=c.onDownloadProgress;function f(){a&&a(),s&&s(),c.cancelToken&&c.cancelToken.unsubscribe(r),c.signal&&c.signal.removeEventListener("abort",r)}var v=new XMLHttpRequest;function g(r){if(v){if(!(0!==v.status||"file"===(Ho(Ko(c.url))||Ho(Po.origin))||v.responseURL&&v.responseURL.startsWith("file:")))return n(new eo("Request aborted",eo.ECONNABORTED,e,v)),f(),void(v=null);try{r?l&&l(r):s&&s()}catch(e){setTimeout((function(){throw e}))}if(v){var o=Jr.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders());Uo((function(e){t(e),f()}),(function(e){n(e),f()}),{data:p&&"text"!==p&&"json"!==p?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:o,config:e,request:v}),v=null}}}if(v.open(c.method.toUpperCase(),c.url,!0),v.timeout=c.timeout,"onloadend"in v?v.onloadend=g:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&v.responseURL.startsWith("file:"))&&setTimeout(g)},v.onabort=function(){v&&(n(new eo("Request aborted",eo.ECONNABORTED,e,v)),f(),v=null)},v.onerror=function(t){var r=t&&t.message?t.message:"Network Error",o=new eo(r,eo.ERR_NETWORK,e,v);o.event=t||null,n(o),f(),v=null},v.ontimeout=function(){var t=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",r=c.transitional||_o;c.timeoutErrorMessage&&(t=c.timeoutErrorMessage),n(new eo(t,r.clarifyTimeoutError?eo.ETIMEDOUT:eo.ECONNABORTED,e,v)),f(),v=null},void 0===u&&d.setContentType(null),"setRequestHeader"in v&&xr.forEach(Fr(d),(function(e,t){v.setRequestHeader(t,e)})),xr.isUndefined(c.withCredentials)||(v.withCredentials=!!c.withCredentials),p&&"json"!==p&&(v.responseType=c.responseType),m){var y=jo(m,!0),_=rt(y,3);i=_[0],s=_[1],l=_[2],v.addEventListener("progress",i)}if(h&&v.upload){var b=jo(h),E=rt(b,2);o=E[0],a=E[1],v.upload.addEventListener("progress",o),v.upload.addEventListener("loadend",a)}(c.cancelToken||c.signal)&&(r=function(t){v&&(n(!t||t.type?new xo(null,e,v):t),v.abort(),f(),v=null)},c.cancelToken&&c.cancelToken.subscribe(r),c.signal&&(c.signal.aborted?r():c.signal.addEventListener("abort",r)));var S=Ho(c.url);if(S&&!Po.protocols.includes(S))return n(new eo("Unsupported protocol "+S+":",eo.ERR_BAD_REQUEST,e)),void f();v.send(u||null)}))},ri=function(e,t){if(e=e?e.filter(Boolean):[],t||e.length){var n=new AbortController,r=!1,o=function(e){if(!r){r=!0,a();var t=e instanceof Error?e:this.reason;n.abort(t instanceof eo?t:new xo(t instanceof Error?t.message:t))}},i=t&&setTimeout((function(){i=null,o(new eo("timeout of ".concat(t,"ms exceeded"),eo.ETIMEDOUT))}),t),a=function(){e&&(i&&clearTimeout(i),i=null,e.forEach((function(e){e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((function(e){r||(e.aborted?o.call(e):e.addEventListener("abort",o,{once:!0}))}));var s=n.signal;return s.unsubscribe=function(){return xr.asap(a)},s}},oi=n(8101),ii=n(6621),ai=n(4774),si=n(9164),li=s().mark((function e(t,n){var r,o,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.byteLength,n&&!(r<n)){e.next=5;break}return e.next=4,t;case 4:return e.abrupt("return");case 5:o=0;case 6:if(!(o<r)){e.next=13;break}return i=o+n,e.next=10,t.slice(o,i);case 10:o=i,e.next=6;break;case 13:case"end":return e.stop()}}),e)})),ci=function(){var e=oi(s().mark((function e(t,n){var r,o,i,a,l,c;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=!1,o=!1,e.prev=2,a=si(ui(t));case 4:return e.next=6,ii(a.next());case 6:if(!(r=!(l=e.sent).done)){e.next=12;break}return c=l.value,e.delegateYield(ai(si(li(c,n)),ii),"t0",9);case 9:r=!1,e.next=4;break;case 12:e.next=18;break;case 14:e.prev=14,e.t1=e.catch(2),o=!0,i=e.t1;case 18:if(e.prev=18,e.prev=19,!r||null==a.return){e.next=23;break}return e.next=23,ii(a.return());case 23:if(e.prev=23,!o){e.next=26;break}throw i;case 26:return e.finish(23);case 27:return e.finish(18);case 28:case"end":return e.stop()}}),e,null,[[2,14,18,28],[19,,23,27]])})));return function(t,n){return e.apply(this,arguments)}}(),ui=function(){var e=oi(s().mark((function e(t){var n,r,o,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t[Symbol.asyncIterator]){e.next=3;break}return e.delegateYield(ai(si(t),ii),"t0",2);case 2:return e.abrupt("return");case 3:n=t.getReader(),e.prev=4;case 5:return e.next=7,ii(n.read());case 7:if(r=e.sent,o=r.done,i=r.value,!o){e.next=12;break}return e.abrupt("break",16);case 12:return e.next=14,i;case 14:e.next=5;break;case 16:return e.prev=16,e.next=19,ii(n.cancel());case 19:return e.finish(16);case 20:case"end":return e.stop()}}),e,null,[[4,,16,20]])})));return function(t){return e.apply(this,arguments)}}(),di=function(e,t,n,r){var o,i=ci(e,t),a=0,l=function(e){o||(o=!0,r&&r(e))};return new ReadableStream({pull:function(e){return c(s().mark((function t(){var r,o,c,u,d;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,i.next();case 3:if(r=t.sent,o=r.done,c=r.value,!o){t.next=10;break}return l(),e.close(),t.abrupt("return");case 10:u=c.byteLength,n&&(d=a+=u,n(d)),e.enqueue(new Uint8Array(c)),t.next=19;break;case 15:throw t.prev=15,t.t0=t.catch(0),l(t.t0),t.t0;case 19:case"end":return t.stop()}}),t,null,[[0,15]])})))()},cancel:function(e){return l(e),i.return()}},{highWaterMark:2})},pi=function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},hi=function(e,t,n){return t+2<n&&pi(e.charCodeAt(t+1))&&pi(e.charCodeAt(t+2))},mi=function(e){return e<=57?e-48:(223&e)-55},fi=function(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e},vi=function(e){var t=e.length,n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)},gi=function(e){for(var t,n=e.length,r=0,o=0,i=!1,a=0;a<n;a++){var s=e.charCodeAt(a);37===s&&hi(e,a,n)&&(s=16*mi(e.charCodeAt(a+1))+mi(e.charCodeAt(a+2)),a+=2),9!==(t=s)&&10!==t&&12!==t&&13!==t&&32!==t&&(61!==s?!fi(s)||o>0?i=!0:r++:o++)}return i||o>2||o>0&&(r+o)%4!=0||r%4==1?vi(e):function(e){var t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)}(r)},yi=function(e,t){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;var n=e.indexOf(",");if(n<0)return 0;var r=e.slice(5,n),o=e.slice(n+1);if(/;base64/i.test(r))return t(o);for(var i=0,a=0,s=o.length;a<s;a++){var l=o.charCodeAt(a);if(37===l&&hi(o,a,s))i+=1,a+=2;else if(l<128)i+=1;else if(l<2048)i+=2;else if(l>=55296&&l<=56319&&a+1<s){var c=o.charCodeAt(a+1);c>=56320&&c<=57343?(i+=4,a++):i+=3}else i+=3}return i};function _i(e){var t="string"==typeof e?e.indexOf("#"):-1;return yi(-1===t?e:e.slice(0,t),gi)}var bi="1.20.0",Ei={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},Si=xr.isFunction,Ai=function(e){if(!xr.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},ki=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!!e.apply(void 0,n)}catch(e){return!1}},Ti=function(e){var t=e.indexOf("://"),n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},Pi=function(e){var t=void 0!==xr.global&&null!==xr.global?xr.global:globalThis,n=t.ReadableStream,r=t.TextEncoder,o=e=xr.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e),i=o.fetch,a=o.Request,l=o.Response,u=i?Si(i):"function"==typeof fetch,d=Si(a),p=Si(l);if(!u)return!1;var h,m=u&&Si(n),f=u&&("function"==typeof r?(h=new r,function(e){return h.encode(e)}):function(){var e=c(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Uint8Array,e.next=3,new a(t).arrayBuffer();case 3:return e.t1=e.sent,e.abrupt("return",new e.t0(e.t1));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),v=d&&m&&ki((function(){var e=!1,t=new a(Po.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r})),g=p&&m&&ki((function(){return xr.isReadableStream(new l("").body)})),y={stream:g&&function(e){return e.body}};u&&["text","arrayBuffer","blob","formData","stream"].forEach((function(e){!y[e]&&(y[e]=function(t,n){var r=t&&t[e];if(r)return r.call(t);throw new eo("Response type '".concat(e,"' is not supported"),eo.ERR_NOT_SUPPORT,n)})}));var _=function(){var e=c(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",0);case 2:if(!xr.isBlob(t)){e.next=4;break}return e.abrupt("return",t.size);case 4:if(!xr.isSpecCompliantForm(t)){e.next=9;break}return n=new a(Po.origin,{method:"POST",body:t}),e.next=8,n.arrayBuffer();case 8:case 15:return e.abrupt("return",e.sent.byteLength);case 9:if(!xr.isArrayBufferView(t)&&!xr.isArrayBuffer(t)){e.next=11;break}return e.abrupt("return",t.byteLength);case 11:if(xr.isURLSearchParams(t)&&(t+=""),!xr.isString(t)){e.next=16;break}return e.next=15,f(t);case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),b=function(){var e=c(s().mark((function e(t,n){var r;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=xr.toFiniteNumber(t.getContentLength()),e.abrupt("return",null==r?_(n):r);case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return function(){var e=c(s().mark((function e(t){var n,o,c,u,p,h,f,E,S,A,k,T,P,w,I,C,R,N,O,D,L,M,x,U,B,K,H,F,Y,j,G,z,V,W,q,J,Q,Z,X,$,ee,te,ne,re,oe,ie,ae,se,le,ce,ue,de,pe,he,me,fe,ve,ge,ye,_e,be,Ee;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ti(t),o=n.url,c=n.method,u=n.data,p=n.signal,h=n.cancelToken,f=n.timeout,E=n.onDownloadProgress,S=n.onUploadProgress,A=n.responseType,k=n.headers,T=n.withCredentials,P=void 0===T?"same-origin":T,w=n.fetchOptions,I=n.maxContentLength,C=n.maxBodyLength,R=n.maxRedirects,N=xr.isNumber(I)&&I>-1,O=xr.isNumber(C)&&C>-1,D=function(e){return xr.hasOwnProp(t,e)?t[e]:void 0},L=i||fetch,A=A?(A+"").toLowerCase():"text",M=ri([p,h&&h.toAbortSignal()],f),x=null,U=M&&M.unsubscribe&&function(){M.unsubscribe()},K=null,H=function(){return new eo("Request body larger than maxBodyLength limit",eo.ERR_BAD_REQUEST,t,x)},e.prev=11,F=void 0,(Y=D("auth"))&&(j=xr.getSafeProp(Y,"username")||"",G=xr.getSafeProp(Y,"password")||"",F={username:j,password:G}),Ti(o)&&(z=new URL(o,Po.origin),F||!z.username&&!z.password||(V=Ai(z.username),W=Ai(z.password),F={username:V,password:W}),(z.username||z.password)&&(z.username="",z.password="",o=z.href)),F&&(k.delete("authorization"),k.set("Authorization","Basic "+btoa((s=(F.username||"")+":"+(F.password||""),encodeURIComponent(s).replace(/%([0-9A-F]{2})/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))})))))),!N||"string"!=typeof o||!o.startsWith("data:")){e.next=21;break}if(!(_i(o)>I)){e.next=21;break}throw new eo("maxContentLength size of "+I+" exceeded",eo.ERR_BAD_RESPONSE,t,x);case 21:if(!O||"get"===c||"head"===c){e.next=29;break}return e.next=24,_(u);case 24:if("number"!=typeof(q=e.sent)||!isFinite(q)){e.next=29;break}if(B=q,!(q>C)){e.next=29;break}throw H();case 29:if(J=O&&(xr.isReadableStream(u)||xr.isStream(u)),Q=function(e,t,n){return di(e,65536,(function(e){if(O&&e>C)throw K=H();t&&t(e)}),n)},!v||"get"===c||"head"===c||!S&&!J){e.next=43;break}if(null!=B){e.next=38;break}return e.next=35,b(k,u);case 35:e.t0=e.sent,e.next=39;break;case 38:e.t0=B;case 39:(0!==(B=e.t0)||J)&&(Z=new a(o,{method:"POST",body:u,duplex:"half"}),xr.isFormData(u)&&(X=Z.headers.get("content-type"))&&k.setContentType(X),Z.body&&($=S&&Go(B,jo(zo(S)))||[],ee=rt($,2),te=ee[0],ne=ee[1],u=Q(Z.body,te,ne))),e.next=49;break;case 43:if(!J||d||!m||"get"===c||"head"===c){e.next=47;break}u=Q(u),e.next=49;break;case 47:if(!J||!d||v||"get"===c||"head"===c){e.next=49;break}throw new eo("Stream request bodies are not supported by the current fetch implementation",eo.ERR_NOT_SUPPORT,t,x);case 49:return xr.isString(P)||(P=P?"include":"omit"),re=d&&"credentials"in a.prototype,xr.isFormData(u)&&(oe=k.getContentType())&&/^multipart\/form-data/i.test(oe)&&!/boundary=/i.test(oe)&&k.delete("content-type"),k.set("User-Agent","axios/"+bi,!1),(ie=null==w?w:Object.assign(Object.create(null),w))&&(delete ie.body,delete ie.headers,delete ie.method,delete ie.signal,delete ie.duplex,delete ie.credentials),ae=Object.assign(Object.create(null),ie,{signal:M,method:c.toUpperCase(),headers:Fr(k.normalize()),body:u,duplex:"half",credentials:re?P:void 0}),d&&(xr.forEach(Ei,(function(e,t){void 0===ae[t]&&(ae[t]=e)})),void 0===ae.signal&&(ae.signal=null),void 0===ae.body&&(ae.body=null)),0===R&&(ae.redirect="manual",ie&&(ie.redirect="manual")),x=d&&new a(o,ae),e.next=61,d?L(x,ie):L(o,ae);case 61:if(se=e.sent,le=Jr.from(se.headers),!N){e.next=67;break}if(!(null!=(ce=xr.toFiniteNumber(le.getContentLength()))&&ce>I)){e.next=67;break}throw new eo("maxContentLength size of "+I+" exceeded",eo.ERR_BAD_RESPONSE,t,x);case 67:return ue=g&&("stream"===A||"response"===A),g&&se.body&&(E||N||ue&&U)&&(de={},["status","statusText","headers"].forEach((function(e){de[e]=se[e]})),pe=xr.toFiniteNumber(le.getContentLength()),he=E&&Go(pe,jo(zo(E),!0))||[],me=rt(he,2),fe=me[0],ve=me[1],0,ge=function(e){if(N&&e>I)throw new eo("maxContentLength size of "+I+" exceeded",eo.ERR_BAD_RESPONSE,t,x);fe&&fe(e)},se=new l(di(se.body,65536,ge,(function(){ve&&ve(),U&&U()})),de)),A=A||"text",e.next=72,y[xr.findKey(y,A)||"text"](se,t);case 72:if(ye=e.sent,!N||g||ue){e.next=77;break}if(null!=ye&&("number"==typeof ye.byteLength?_e=ye.byteLength:"number"==typeof ye.size?_e=ye.size:"string"==typeof ye&&(_e="function"==typeof r?(new r).encode(ye).byteLength:ye.length)),!("number"==typeof _e&&_e>I)){e.next=77;break}throw new eo("maxContentLength size of "+I+" exceeded",eo.ERR_BAD_RESPONSE,t,x);case 77:return!ue&&U&&U(),e.next=80,new Promise((function(e,n){Uo(e,n,{data:ye,headers:Jr.from(se.headers),status:se.status,statusText:se.statusText,config:t,request:x})}));case 80:return e.abrupt("return",e.sent);case 83:if(e.prev=83,e.t1=e.catch(11),U&&U(),!(M&&M.aborted&&M.reason instanceof eo)){e.next=92;break}throw(be=M.reason).config=t,x&&(be.request=x),e.t1!==be&&Object.defineProperty(be,"cause",{__proto__:null,value:e.t1,writable:!0,enumerable:!1,configurable:!0}),be;case 92:if(!K){e.next=95;break}throw x&&!K.request&&(K.request=x),K;case 95:if(!(e.t1 instanceof eo)){e.next=98;break}throw x&&!e.t1.request&&(e.t1.request=x),e.t1;case 98:if(!e.t1||"TypeError"!==e.t1.name||!/Load failed|fetch/i.test(e.t1.message)){e.next=102;break}throw Ee=new eo("Network Error",eo.ERR_NETWORK,t,x,e.t1&&e.t1.response),Object.defineProperty(Ee,"cause",{__proto__:null,value:e.t1.cause||e.t1,writable:!0,enumerable:!1,configurable:!0}),Ee;case 102:throw eo.from(e.t1,e.t1&&e.t1.code,t,x,e.t1&&e.t1.response);case 103:case"end":return e.stop()}var s}),e,null,[[11,83]])})));return function(t){return e.apply(this,arguments)}}()},wi=new Map,Ii=function(e){for(var t,n,r=e&&e.env||{},o=r.fetch,i=[r.Request,r.Response,o],a=i.length,s=wi;a--;)t=i[a],void 0===(n=s.get(t))&&s.set(t,n=a?new Map:Pi(r)),s=n;return n},Ci=(Ii(),{http:null,xhr:ni,fetch:{get:Ii}});xr.forEach(Ci,(function(e,t){if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));var Ri=function(e){return"- ".concat(e)},Ni=function(e){return xr.isFunction(e)||null===e||!1===e};var Oi={getAdapter:function(e,t){for(var n,r,o=(e=xr.isArray(e)?e:[e]).length,i={},a=0;a<o;a++){var s=void 0;if(r=n=e[a],!Ni(n)&&void 0===(r=Ci[(s=String(n)).toLowerCase()]))throw new eo("Unknown adapter '".concat(s,"'"));if(r&&(xr.isFunction(r)||(r=r.get(t))))break;i[s||"#"+a]=r}if(!r){var l=Object.entries(i).map((function(e){var t=rt(e,2),n=t[0],r=t[1];return"adapter ".concat(n," ")+(!1===r?"is not supported by the environment":"is not available in the build")})),c=o?l.length>1?"since :\n"+l.map(Ri).join("\n"):" "+Ri(l[0]):"as no adapter specified";throw new eo("There is no suitable adapter to dispatch the request "+c,eo.ERR_NOT_SUPPORT)}return r},adapters:Ci};function Di(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xo(null,e)}function Li(e){var t=xr.toSafeFlatObject(e);return Di(t),t.headers=Jr.from(xr.getSafeProp(t,"headers")),t.data=Do.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Oi.getAdapter(t.adapter||Oo.adapter,t)(t).then((function(e){Di(t),t.response=e;try{e.data=Do.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=Jr.from(e.headers),e}),(function(e){if(!Lo(e)&&(Di(t),e&&e.response)){t.response=e.response;try{e.response.data=Do.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=Jr.from(e.response.headers)}return Promise.reject(e)}))}var Mi={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){Mi[e]=function(n){return Ze(n)===e||"a"+(t<1?"n ":" ")+e}}));var xi={};Mi.transitional=function(e,t,n){function r(e,t){return"[Axios v"+bi+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,o,i){if(!1===e)throw new eo(r(o," has been removed"+(t?" in "+t:"")),eo.ERR_DEPRECATED);return t&&!xi[o]&&(xi[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},Mi.spelling=function(e){return function(t,n){return console.warn("".concat(n," is likely a misspelling of ").concat(e)),!0}};var Ui={assertOptions:function(e,t,n){if("object"!==Ze(e)||null===e)throw new eo("options must be an object",eo.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(a){var s=e[i],l=void 0===s||a(s,i,e);if(!0!==l)throw new eo("option "+i+" must be "+l,eo.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new eo("Unknown option "+i,eo.ERR_BAD_OPTION)}},validators:Mi},Bi=Ui.validators,Ki=function(){function e(t){_(this,e),this.defaults=t||{},this.interceptors={request:new yo,response:new yo}}var t;return g(e,[{key:"request",value:(t=c(s().mark((function e(t,n){var r,o,i,a,l,c,u;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._request(t,n);case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),e.t0 instanceof Error)try{r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,o=r.stack,i="","string"==typeof o&&(a=o.indexOf("\n"),i=-1===a?"":o.slice(a+1)),e.t0.stack?i&&(l=i.indexOf("\n"),c=-1===l?-1:i.indexOf("\n",l+1),u=-1===c?"":i.slice(c+1),String(e.t0.stack).endsWith(u)||(e.t0.stack+="\n"+i)):e.t0.stack=i}catch(e){}throw e.t0;case 10:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_request",value:function(e,t){var n=this;"string"==typeof e?(t=t||{}).url=e:t=e||{};var r=t=$o(this.defaults,t),o=r.transitional,i=r.paramsSerializer,a=r.headers;void 0!==o&&Ui.assertOptions(o,{silentJSONParsing:Bi.transitional(Bi.boolean),forcedJSONParsing:Bi.transitional(Bi.boolean),clarifyTimeoutError:Bi.transitional(Bi.boolean),legacyInterceptorReqResOrdering:Bi.transitional(Bi.boolean),advertiseZstdAcceptEncoding:Bi.transitional(Bi.boolean),validateStatusUndefinedResolves:Bi.transitional(Bi.boolean)},!1),null!=i&&(xr.isFunction(i)?t.paramsSerializer={serialize:i}:Ui.assertOptions(i,{encode:Bi.function,serialize:Bi.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Ui.assertOptions(t,{baseUrl:Bi.spelling("baseURL"),withXsrfToken:Bi.spelling("withXSRFToken")},!0),t.method=(xr.getSafeProp(t,"method")||xr.getSafeProp(this.defaults,"method")||"get").toLowerCase();var s=a&&xr.merge(a.common,a[t.method]);a&&xr.forEach(Co.concat("common"),(function(e){delete a[e]})),t.headers=Jr.concat(s,a);var l=[],c=!0;this.interceptors.request.forEach((function(e){if("function"!=typeof e.runWhen||!1!==e.runWhen(t)){c=c&&e.synchronous;var n=t.transitional||_o;n&&n.legacyInterceptorReqResOrdering?l.unshift(e.fulfilled,e.rejected):l.push(e.fulfilled,e.rejected)}}));var u,d=[];this.interceptors.response.forEach((function(e){d.push(e.fulfilled,e.rejected)}));var p,h=0;if(!c){var m=[Li.bind(this),void 0];for(m.unshift.apply(m,l),m.push.apply(m,d),p=m.length,u=Promise.resolve(t);h<p;)u=u.then(m[h++],m[h++]);return u}p=l.length;for(var f=t;h<p;){var v=l[h++],g=l[h++];try{f=v?v(f):f}catch(e){if(!g){u=Promise.reject(e);break}try{var y=g.call(this,e);xr.isThenable(y)&&(u=Promise.resolve(y).then((function(){return Li.call(n,f)})))}catch(e){u=Promise.reject(e)}break}}if(!u)try{u=Li.call(this,f)}catch(e){u=Promise.reject(e)}for(h=0,p=d.length;h<p;)u=u.then(d[h++],d[h++]);return u}},{key:"getUri",value:function(e){return po(Zo((e=$o(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}]),e}();xr.forEach(["delete","get","head","options"],(function(e){Ki.prototype[e]=function(t,n){return this.request($o(n||{},{method:e,url:t,data:n&&xr.hasOwnProp(n,"data")?n.data:void 0}))}})),xr.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,r,o){return this.request($o(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ki.prototype[e]=t(),"query"!==e&&(Ki.prototype[e+"Form"]=t(!0))}));var Hi=Ki,Fi=function(){function e(t){if(_(this,e),"function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(e){n=e}));var r=this;this.promise.then((function(e){if(r._listeners){for(var t=r._listeners.length;t-- >0;)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},t((function(e,t,o){r.reason||(r.reason=new xo(e,t,o),n(r.reason))}))}return g(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}},{key:"toAbortSignal",value:function(){var e=this,t=new AbortController,n=function(e){t.abort(e)};return this.subscribe(n),t.signal.unsubscribe=function(){return e.unsubscribe(n)},t.signal}}],[{key:"source",value:function(){var t,n=new e((function(e){t=e}));return{token:n,cancel:t}}}]),e}(),Yi=Fi;var ji={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,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent: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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ji).forEach((function(e){var t=rt(e,2),n=t[0],r=t[1];void 0===ji[r]&&(ji[r]=n)}));var Gi=ji;var zi=function e(t){var n=new Hi(t),r=Ln(Hi.prototype.request,n);return xr.extend(r,Hi.prototype,n,{allOwnKeys:!0}),xr.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e($o(t,n))},r}(Oo);zi.Axios=Hi,zi.CanceledError=xo,zi.CancelToken=Yi,zi.isCancel=Lo,zi.VERSION=bi,zi.toFormData=io,zi.AxiosError=eo,zi.Cancel=zi.CanceledError,zi.all=function(e){return Promise.all(e)},zi.spread=function(e){return function(t){return e.apply(null,t)}},zi.isAxiosError=function(e){return xr.isObject(e)&&!0===e.isAxiosError},zi.mergeConfig=$o,zi.AxiosHeaders=Jr,zi.formToJSON=function(e){return Io(xr.isHTMLForm(e)?new FormData(e):e)},zi.getAdapter=Oi.getAdapter,zi.HttpStatusCode=Gi,zi.default=zi;var Vi=zi,Wi=At(),qi=Wi._light_sandbox,Ji=Wi.groupId,Qi=Wi.requestHost,Zi={local:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",dev:Qi||"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",sit:Qi||"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",pre:"https://imgs-sea-pre.alipay.com/mgw.htm",prod:"https://imgs-sea-global.alipay.com/mgw.htm",sandbox:"https://imgs-sea-global.alipay.com/mgw.htm"},Xi="ALIPW3SG",$i="ANTOM_PAYMENT_WEB",ea=Ji||"GROUP_20240627151021",ta=function(e,t){return"prod"===t||"sandbox"===t||"light_sandbox"===t?{SG:"https://imgs-sea-global.alipay.com/mgw.htm",US:"https://imgs-na-global.alipay.com/mgw.htm",DE:"https://imgs-de-global.alipay.com/mgw.htm",QK:"https://imgs-qk.alipay.com/mgw.htm",ID:"https://imgs-id.alipay.com/mgw.htm",SA:"https://imgs-sa.alipay.com/mgw.htm"}[e||"SG"]:"pre"===t?{SG:"https://imgs-sea-pre.alipay.com/mgw.htm",US:"https://imgs-pre.alipay.com/mgw.htm",DE:"https://imgs-de-pre.alipay.com/mgw.htm",QK:"https://iopengw-qkgz99p.alipay.com/mgw.htm",ID:"https://imgs-id-pre.alipay.com/mgw.htm",SA:"https://imgs-sa-pre.alipay.com/mgw.htm"}[e||"SG"]:""},na=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n={pre:"https://imgs-sea-pre.alipay.com/mgw.htm",sit:Qi||"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",dev:Qi||"http://imgs-13.sggz00b.stable.alipay.net/mgw.htm"},r={"com.ipay.iexpcashier.sdkAction.query":"com.ipay.iopensandbox.sdk.paymentSession.query"},o="SDK_MOCK_SANDBOX",i=Ji||"GROUP_20230315210531";return r[e]&&"light_sandbox"===t||"true"===qi?{appId:o,sofaId:i,baseURL:n[t],"Operation-Type":r[e]}:{appId:"",sofaId:"",baseURL:"","Operation-Type":""}},ra=".".charCodeAt(0),oa=/\\(\\)?/g,ia=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g"),aa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sa=/^\w*$/;function la(e){if("string"==typeof e)return e;var t="".concat(e);return"0"===t&&1/e==-Infinity?"-0":t}function ca(e,t){return Array.isArray(e)?e:function(e,t){if(Array.isArray(e))return!1;var n=Xe()(e);return"number"===n||"boolean"===n||null===e||sa.test(e)||!aa.test(e)||null!==t&&e in Object(t)}(e,t)?[e]:(r=[],(n=e).charCodeAt(0)===ra&&r.push(""),n.replace(ia,(function(e,t,n,o){var i=e;return n?i=o.replace(oa,"$1"):t&&(i=t.trim()),r.push(i),""})),r);var n,r}function ua(e,t,n){var r=null===e?void 0:function(e,t){for(var n=ca(t,e),r=0,o=n.length,i=e;null!==i&&r<o;)i=i[la(n[r++])];return r&&r===o?i:void 0}(e,t);return void 0===r?n:r}var da=function(e,t){var n=ua(e,"Result-Status")||ua(e,"result-status","");if(!n)return null;if(2e3==+n)return{success:!1,traceId:t,errorCode:se.LOGIN,errorMessage:"not login",resultStatus:n};if(4001==+n)return{success:!1,traceId:t,errorCode:se.TIMEOUT,errorMessage:"timeout",resultStatus:n};if(1e3!=+n){var r=ua(e,"Tips")||ua(e,"tips",""),o=ua(e,"Memo")||ua(e,"memo","");return{success:!1,traceId:t,errorCode:se.GATEWAY,errorMessage:decodeURIComponent(r||""),result:{resultStatus:n||"",tips:decodeURIComponent(r||""),memo:decodeURIComponent(o||"")},resultStatus:n}}return null},pa=At()._sandbox;function ha(e){var t,n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=e.env||"prod",a=na(e["Operation-Type"],i),s=e.baseURL||a.baseURL||ta(null==e?void 0:e.hostSign,i)||Zi[i],l=v()(p()(p()(p()(p()(p()(p()(p()({appId:a.appId||$i,workspaceId:"pre"===e.env?"pre":"default"},"x-cors-".concat($i.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",a.sofaId||ea),"Operation-Type",a["Operation-Type"]||e["Operation-Type"]||""),"Client-Time",o),"tntInstId",Xi),"sdk-version",I||""),e.headers);return"true"!==pa&&"sandbox"!==i||(l["load-test"]=!0,l.sofaPenAttrs="instMock=O&loadMode=2"),"dev"!==i&&delete l["sofa-group-name"],Vi.create({baseURL:s,timeout:null!==(t=e.timeout)&&void 0!==t?t:15e3,headers:l,withCredentials:null===(n=e.withCredentials)||void 0===n||n,method:(null==e?void 0:e.method)||"POST"}).request}function ma(e,t,n){return fa.apply(this,arguments)}function fa(){return fa=u()(l()().mark((function e(t,n,r){var o,i,a,s,c,u,d,p,h,m,f,g,y,_,b,E,S,A;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=v()(v()({terminalType:bt?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==n?void 0:n.envInfo),{},{locale:(null==n||null===(o=n.envInfo)||void 0===o?void 0:o.locale)||"en_US"});try{i.browserInfo.browserJavaEnabled=(null===(a=navigator)||void 0===a?void 0:a.javaEnabled())||!1}catch(e){}return"WAP"===i.terminalType&&(i.osType=yt?"IOS":"ANDROID"),s=[v()(v()({},t),{},{envInfo:i,extParams:v()(v()({},null==t?void 0:t.extParams),{},{refUrl:window.location.href})})],c=Date.now(),e.prev=5,u=ha(n),e.next=9,u({data:s});case 9:if(d=e.sent,p=d.data,h=d.headers,m=p||{},f=ua(h,"Mgw-TraceId")||ua(h,"mgw-traceid",""),m.traceId=f||"",null==(g=da(h,f))||!g.errorCode){e.next=21;break}throw y=(null==m?void 0:m.errorMessage)||(null==g?void 0:g.errorMessage),_=null==g?void 0:g.errorCode,r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!1,code:_,msg:y,traceId:f}).send(),new Error(JSON.stringify({errorMessage:y,errorCode:_,success:!1}));case 21:return r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!0,code:"SUCCESS",msg:"",traceId:f}).send(),e.abrupt("return",m);case 25:return e.prev=25,e.t0=e.catch(5),E=Et(null===e.t0||void 0===e.t0?void 0:e.t0.message,{success:!1,errorCode:se.SYSTEM,errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message}),S=null!==e.t0&&void 0!==e.t0&&null!==(b=e.t0.message)&&void 0!==b&&b.includes("timeout")?se.TIMEOUT:"",A=(null==E?void 0:E.errorCode)||S,r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!1,code:A,msg:JSON.stringify((null==E?void 0:E.message)||e.t0)}).send(),e.abrupt("return",Promise.reject({success:!1,errorCode:A,errorMessage:null==E?void 0:E.message}));case 32:case"end":return e.stop()}}),e,null,[[5,25]])}))),fa.apply(this,arguments)}function va(e,t,n){return ga.apply(this,arguments)}function ga(){return ga=u()(l()().mark((function e(t,n,r){var o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=((null==t?void 0:t.paymentSessionData)||"").split("&&")[1]||"",e.abrupt("return",ma(t,v()(v()({},n),{},{hostSign:o,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"}),r));case 2:case"end":return e.stop()}}),e)}))),ga.apply(this,arguments)}function ya(){return ya=u()(l()().mark((function e(t,n){var r,o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(P[t.env]);case 3:return r=e.sent,e.next=6,r.json();case 6:return o=e.sent,n.logInfo({title:"sdk_event_importantEvent",msg:"Successfully obtained marmot emergency configuration"}),e.abrupt("return",o);case 11:return e.prev=11,e.t0=e.catch(0),n.logError({title:"event_important_error",msg:"Abnormal acquisition of marmot emergency configuration"}),e.abrupt("return","{}");case 15:case"end":return e.stop()}}),e,null,[[0,11]])}))),ya.apply(this,arguments)}function _a(e,t,n){return ba.apply(this,arguments)}function ba(){return ba=u()(l()().mark((function e(t,n,r){var o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=((null==t?void 0:t.paymentSessionData)||"").split("&&")[1]||"",e.abrupt("return",ma(t,v()(v()({},n),{},{hostSign:o,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.cashier.submitPayByPaymentSession"}),r));case 2:case"end":return e.stop()}}),e)}))),ba.apply(this,arguments)}function Ea(e,t,n,r){return Sa.apply(this,arguments)}function Sa(){return Sa=u()(l()().mark((function e(t,n,r,o){var i;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(t||"").split("&&")[1]||"",console.log("getApplePayPaymentSession hostSign",i),e.abrupt("return",ma(n,v()(v()({},r),{},{hostSign:i,"Operation-Type":"com.ipay.iexpcashier.cashier.createApplePayPaymentSession"}),o));case 3:case"end":return e.stop()}}),e)}))),Sa.apply(this,arguments)}var Aa=function(e){return e.sdk_event_appleAvailable="sdk_event_appleAvailable",e.sdk_event_appleCreateComponent="sdk_event_appleCreateComponent",e.sdk_event_appleShowPaymentSheet="sdk_event_appleShowPaymentSheet",e.sdk_event_appleOnvalidatemerchant="sdk_event_appleOnvalidatemerchant",e.sdk_event_appleSubmitToken="sdk_event_appleSubmitToken",e.sdk_event_applePaymentResult="sdk_event_applePaymentResult",e.sdk_event_appleDestroyComponent="sdk_event_appleDestroyComponent",e}({}),ka=function(){function e(t,n){b()(this,e),p()(this,"_applePayService",void 0),p()(this,"_parseData",void 0),p()(this,"_sessionData",void 0),p()(this,"_isFinish",!1),p()(this,"_options",void 0),p()(this,"logger",void 0),p()(this,"isRecurring",!1),this.logger=n,this._options=Object.assign({environment:te.prod},t,{product:W.CARD_APPLE_PAY}),this._applePayService=new Dn(n)}return y()(e,[{key:"canMakePayments",value:function(e){return Dn.canMakePayments(e)}},{key:"isAppPayEnabled",value:function(e){return this.canMakePayments(e)}},{key:"onEventCallback",value:function(e){var t,n,r;this.logger.logInfo({name:"APPLE_PAY",title:Aa.sdk_event_applePaymentResult},{eventSource:"sdk",processResult:ce.SDK_PAYMENT_SUCCESSFUL===(null==e?void 0:e.code),code:null==e?void 0:e.code,extSdkError:null==e||null===(t=e.result)||void 0===t?void 0:t.errorCode,errorMessage:null==e||null===(n=e.result)||void 0===n?void 0:n.errorMessage,eventMessage:JSON.stringify({type:"funnel",recurring:this.isRecurring})}).send(),null===(r=this._options)||void 0===r||r.onEventCallback(e)}},{key:"submitPay",value:function(e){var t,n,r,o=this;if(this._isFinish=!1,this._parseData=null==e||null===(t=e.iframeNodesParams)||void 0===t?void 0:t.paymentSessionMetaData,this._sessionData=null==e||null===(n=e.iframeNodesParams)||void 0===n?void 0:n.sessionData,!this._parseData||!this._sessionData)return this.onEventCallback({code:ce.SDK_PAYMENT_FAIL,message:"Abnormal params paymentSessionData"}),void this.logger.logError({name:"APPLE_PAY",title:"sessionDataNull",msg:"Abnormal paymentSessionData"},{type:"error",eventSource:"sdk"}).send();this.isRecurring=null!==(null===(r=this._parseData)||void 0===r||null===(r=r.paymentSessionFactor)||void 0===r?void 0:r.recurringInfo);var i=function(){var e=u()(l()().mark((function e(){var t,n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Qe.publishForResult(new We(Cn.getSecurityDeviceId,JSON.stringify({deviceIdParameter:{productScene:null===(n=o._parseData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene}})),{fallback:""});case 2:if(e.t1=t=e.sent,e.t0=null===e.t1,e.t0){e.next=6;break}e.t0=void 0===t;case 6:if(!e.t0){e.next=10;break}e.t2=void 0,e.next=11;break;case 10:e.t2=t.getJSONObject();case 11:return e.abrupt("return",e.t2);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=function(){var e=u()(l()().mark((function e(t){var n,r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.validationUrl,r={validateUrl:n,paymentSessionData:o._sessionData},e.t0=Ea,e.t1=o._sessionData,e.t2=r,e.t3=o._options.environment,e.next=8,i();case 8:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6={env:e.t3,envInfo:e.t5},e.t7=o.logger,e.abrupt("return",(0,e.t0)(e.t1,e.t2,e.t6,e.t7).then((function(e){return null!=e&&e.success&&e.merchantSessionObject?Promise.resolve(e.merchantSessionObject):Promise.reject({errorCode:e.errorCode,errorMessage:e.errorMessage})})).catch((function(e){return Promise.reject(e)})));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s=function(){var e=u()(l()().mark((function e(t){var n,r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.paymentToken,r={paymentFactors:{instPaymentToken:n},paymentSessionData:o._sessionData},e.t0=_a,e.t1=r,e.t2=o._options.environment,e.next=7,i();case 7:return e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,envInfo:e.t4},e.t6=o.logger,e.abrupt("return",(0,e.t0)(e.t1,e.t5,e.t6).then((function(e){return o.logger.logInfo({name:"APPLE_PAY",title:"submitPayStatus",msg:null==e?void 0:e.errorStatus},{eventSource:"sdk"}).send(),null!=e&&e.success||"U"===(null==e?void 0:e.errorStatus)?Promise.resolve(e):Promise.reject({errorCode:e.errorCode,errorMessage:e.errorMessage})})).catch((function(e){return Promise.reject(e)})));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),c=function(e,t,n){o.logger.logError({name:"APPLE_PAY",title:t,label:t,code:e,msg:n},{type:"error",eventSource:"sdk"}).send(),o._isFinish||(o._isFinish=!0,null!=n&&n.errorCode?o.onEventCallback({code:e,message:t,result:{errorCode:null==n?void 0:n.errorCode,errorMessage:null==n?void 0:n.errorMessage}}):o.onEventCallback({code:e,message:t}))};this._applePayService.setApplePayParams(a,s,(function(e){var t;o._isFinish=!0,o.onEventCallback({code:ce.SDK_PAYMENT_SUCCESSFUL,message:"Payment successful",result:{redirectUrl:(null==e||null===(t=e.actionForm)||void 0===t?void 0:t.redirectUrl)||""}})}),c);try{this._applePayService.startPay(this._parseData)}catch(e){c(ce.SDK_PAYMENT_ERROR,"appple runtime excepiton",e)}}}]),e}(),Ta=ka,Pa=function(e){S()(n,e);var t=k()(n);function n(e){var r;return b()(this,n),r=t.call(this),p()(et()(r),"applePay",void 0),p()(et()(r),"logger",void 0),r.logger=e,r}return y()(n,[{key:"actionNames",value:function(){return Object.values(Pn).concat(Object.values(Tn))}},{key:"onOptionalInit",value:function(e,t){console.log("onOptionalInit",t.getData())}},{key:"onCanMakePayments",value:function(e,t){var n;console.log("onCanMakePayments",t.getData());var r=null===(n=t.getJSONObject())||void 0===n?void 0:n.subPaymentMethod,o=Dn.canMakePayments(r);null==e||e.onCallBack(t.result(o)),this.logger.logInfo({name:"APPLE_PAY",title:Aa.sdk_event_appleAvailable},{eventSource:"sdk",processResult:o,eventMessage:JSON.stringify({type:"funnel",recurring:"ApplePayRecurringPayment"===r})}).send()}},{key:"onCreateComponent",value:function(e,t){var n=t.getJSONObject();console.log("onCreateComponent",t),this.applePay=new Ta(v()(v()({},null==n?void 0:n.options),{},{onEventCallback:function(e){console.log("onCreateComponent#onEventCallback",e),e&&Qe.publish(new We(In.onEventCallback,JSON.stringify(e)))}}),this.logger);var r=null==n?void 0:n.appendParams;this.applePay.submitPay(r)}},{key:"onDestroyComponent",value:function(e,t){this.applePay=null,console.log("onDestroyComponent",e,t),this.logger.logInfo({name:"APPLE_PAY",title:Aa.sdk_event_appleDestroyComponent},{eventSource:"sdk",eventMessage:JSON.stringify({type:"funnel"})}).send()}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Tn.optional_init:this.onOptionalInit(e,t);break;case Pn.canMakePayments:this.onCanMakePayments(e,t);break;case Pn.createComponent:this.onCreateComponent(e,t);break;case Pn.destroyComponent:this.onDestroyComponent(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(Je),wa=[{matchRule:"AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z]+) Safari\\/([0-9\\._]+)$",iosScheme:"https",andScheme:""},{matchRule:"HeyTapBrowser",iosScheme:"",andScheme:""},{matchRule:"HuaweiBrowser",iosScheme:"",andScheme:""},{matchRule:"Kwai",iosScheme:"kwai",andScheme:""},{matchRule:"MQQBrowser",iosScheme:"mttbrowser",andScheme:""},{matchRule:"MicroMessenger",iosScheme:"",andScheme:""},{matchRule:"MiuiBrowser",iosScheme:"",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* CriOS\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z\\._a-z]+) Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"NewsArticle",iosScheme:"snssdk141",andScheme:""},{matchRule:"UCBrowser",iosScheme:"ucbrowser",andScheme:""},{matchRule:"VideoArticle",iosScheme:"snssdk32",andScheme:""},{matchRule:"VivoBrowser",iosScheme:"",andScheme:""},{matchRule:"ZhongAnWebView",iosScheme:"zaapp",andScheme:""},{matchRule:"aweme",iosScheme:"snssdk1128",andScheme:""},{matchRule:"aweme_lite",iosScheme:"snssdk2329",andScheme:""},{matchRule:"com.xs.fm",iosScheme:"novelfm3040",andScheme:""},{matchRule:"netdisk",iosScheme:"",andScheme:""},{matchRule:"qqnews",iosScheme:"qqnews",andScheme:""}];function Ia(e,t){for(var n,r=e||window.navigator.userAgent||"",o=wa,i=0;i<o.length;i++){var a=o[i];if(r.match(a.matchRule)){n=a;break}}if(n)return function(e){var t=(e||navigator.userAgent).toLowerCase();return/android|adr|linux/.test(t)}(r)?(Ca(t,r,n.andScheme),n.andScheme):function(e){var t=(e||navigator.userAgent).toLowerCase();return/iphone|ipad|ipod|ios|macintosh/.test(t)}(r)?(Ca(t,r,n.iosScheme),n.iosScheme):void 0;Ca(t,r,"")}function Ca(e,t,n){e&&e.logInfo({title:"a3753.b101271.c377460"},{eventMessage:n})}var Ra=function(){return window.location.href.indexOf("LOCAL_MOCK=1")>-1};var Na=function(e){var t,n,r,o,i;switch(e){case W.ELEMENT_PAYMENT:i=null===(t=window)||void 0===t||null===(t=t._ANTOM_SDK_PROXY_TIME)||void 0===t?void 0:t.AMSElement;break;case W.EASY_PAY:i=null===(n=window)||void 0===n||null===(n=n._ANTOM_SDK_PROXY_TIME)||void 0===n?void 0:n.AMSEasyPay;break;default:i={startTime:0,endTime:0}}return(null===(r=i)||void 0===r?void 0:r.endTime)-(null===(o=i)||void 0===o?void 0:o.startTime)||0},Oa=y()((function e(){b()(this,e)}));p()(Oa,"complianceExtParams",{requestSeq:"C",firstLogTime:"C",sessionData:"C",isPreload:"C",disableAccelerate:"C",deviceId:"C",url:"C",errorName:"C",isPrerender:"C",loadWebAppType:"C",rpcTraceId:"C",timezone:"C",userPath:"C",previousEventName:"C",containerCacheFileCount:"C",containerTotalFileCount:"C",containerMissedFiles:"C",containerOfflinePkgId:"C",containerTotalPkgCount:"C",webAppUrl:"C",webSDKUrl:"C",edcDeviceRequest:"C",config:"C",initOptions:"C",edcDeviceId:"C",instanceId:"C",trackId:"C",errorMessage:"C",timestamp:"C",eventMessage:"C",checkoutUrl:"C",redirectInfo:"C",riskSdkInfo:"C",actionName:"C",requestId:"C",callbackData:"C",callbackId:"C",actionNames:"C",isValid:"C",needChangeSessionForRetry:"C",constructorName:"C",result:"C",operationType:"D",jsApi:"D",extSdkError:"D",processResult:"D",iterationVersion:"D",OperationType:"D",edcVendor:"D",platform:"D",sdkVersion:"D",eventSource:"D",productScene:"D",paymentMethodCategoryType:"D",productSceneVersion:"D",merchantId:"D",eventName:"D",paymentMethodType:"D",containerVersion:"D",locale:"D",renderDisplayType:"D",webAppVersion:"D",eventCode:"D",containerType:"D",logVersion:"D",httpCode:"D",openType:"D",isCrashTack:"D",isCrashTrackOverride:"D",appUpgradeVersion:"D",fromFastSdk:"D",terminalType:"D",eventAlias:"D",success:"D",startTime:"D",endTime:"D",timeCost:"M",pageLoadProgress:"M",fsDuration:"M",loadDuration:"M",msg:"C"});var Da={spmId:"a3753.b101271.c388193.d513345",alias:"sdk_event_onAbnormalEventName"},La={spmId:"a3753.b101271.c388193.d513391",alias:"sdk_event_onAbnormalKeys"},Ma=function(){function e(){b()(this,e)}return y()(e,null,[{key:"extractComplianceParams",value:function(e,t,n){var r=this;try{Ua.track((function(){r.flushAbnormalInfo(n)})),!!e&&e.includes(".")||this.reportHasAbnormalEventName(e);for(var o={},i=0,a=Object.keys(t);i<a.length;i++){var s=a[i];s in Oa.complianceExtParams?o[s]="".concat(t[s]):this.reportHasIllegalExtendInfoKey(e,s)}return o}catch(e){return console.error(e),{}}}},{key:"reportHasAbnormalEventName",value:function(e){this.abnormalEventNameSet.add(e)}},{key:"reportHasIllegalExtendInfoKey",value:function(e,t){this.nonComplianceEventKeys[e]||(this.nonComplianceEventKeys[e]=new Set),this.nonComplianceEventKeys[e].add(t)}},{key:"flushAbnormalInfo",value:function(e){try{var t;if((null===(t=this.abnormalEventNameSet)||void 0===t?void 0:t.size)>0){var n=Array.from(this.abnormalEventNameSet).join("|");e&&e({title:Da.spmId},{eventAlias:Da.alias,errorMessage:n}),this.abnormalEventNameSet.clear()}var r=[];if(0===Object.keys(this.nonComplianceEventKeys).length)return;for(var o in this.nonComplianceEventKeys){var i=this.nonComplianceEventKeys[o],a="".concat(o,">").concat(Array.from(i).join("+"));r.push(a)}var s=r.join("|");e&&e({title:La.spmId},{eventAlias:La.alias,errorMessage:s}),this.nonComplianceEventKeys={}}catch(e){console.error(e)}}}]),e}();p()(Ma,"abnormalEventNameSet",new Set),p()(Ma,"nonComplianceEventKeys",{});var xa=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5e3;b()(this,e),p()(this,"timeoutId",void 0),p()(this,"debounceTime",void 0),this.timeoutId=null,this.debounceTime=t}return y()(e,[{key:"track",value:function(e){this.debounce(e)}},{key:"debounce",value:function(e){var t=this;this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=setTimeout((function(){t.report(e),t.reset()}),this.debounceTime)}},{key:"report",value:function(e){e&&e()}},{key:"reset",value:function(){this.timeoutId=null}}]),e}(),Ua=new xa,Ba={sdk_event_mount_element:"a3753.b101271.c388193.d513193",sdk_element_create:"a3753.b101271.c386688",sdk_element_mount_fail:"a3753.b101271.c386691",sdk_element_mount_start:"a3753.b101271.c386690",multiple_instance_error:"a3753.b101271.c403950",auto_apple_pay_start:"a3753.b107385.c398110",auto_apple_pay_failed:"a3753.b107385.c398111",auto_apple_pay_success:"a3753.b107385.c398112",sdk_element_handleHeartBeat:"a3753.b101271.c388217.d624449",sdk_element_handleInterAction:"a3753.b101271.c388217.d630402",sdk_element_callback_error:"a3753.b101271.c388217.d630403",sdk_element_missKeyData:"a3753.b101271.c388217.d630404",sdk_event_mount:"a3753.b101271.c388217.d640404",sdk_event_mount_end:"a3753.b101271.c388217.d640405",sdk_event_submitPay:"a3753.b101271.c388193.d512422",sdk_event_payment_end:"a3753.b101271.c388217.d640409",sdk_event_validateFields:"a3753.b101271.c388217.d640406",sdk_event_validateFields_end:"a3753.b101271.c388217.d640407",sdk_event_apiOnDestroy:"a3753.b101271.c388193.d512442",sdk_event_apiOnDestroy_end:"a3753.b101271.c388217.d640408"},Ka=v()({sdk_error_runtime_error:"a3753.b101271.c388188.d512342",sdk_event_sdkQuery_failed:"a3753.b101271.c388188.d512343",container_error_error_insert_js:"a3753.b101271.c388188.d512344",event_important_error:"a3753.b101271.c388188.d512345",sdk_error_parameter:"a3753.b101271.c388188.d512346",sdk_event_submitPay_failed:"a3753.b101271.c388188.d512347",sdk_event_destroyComponent:"a3753.b101271.c388189.d512349",container_error_page_load_failed:"a3753.b101271.c388189.d512350",sdk_event_eventCallback:"a3753.b101271.c388189.d512353",iap_net_error:"a3753.b101271.c388189.d512352",sdk_event_event_callback:"a3753.b101271.c388189.d512353",sdk_event_renderComponent:"a3753.b101271.c388189.d512354",sdk_event_call_url_success:"a3753.b101271.c388189.d512355",sdk_event_web_app_timeout:"a3753.b101271.c388189.d512356",container_error_jsapi_call:"a3753.b101271.c388189.d512357",sdk_event_appUpgradeInfo:"a3753.b101271.c388189.d512358",sdk_event_webAppOnLaunch:"a3753.b101271.c388189.d512359",sdk_event_createComponent:"a3753.b101271.c388189.d512360",container_error_insert_js:"a3753.b101271.c388189.d512361",container_error_error_jsapi_call:"a3753.b101271.c388189.d512362",sdk_error_receive_message_from_web:"a3753.b101271.c388189.d512363",sdk_error_securitySdkGetCodeFailed:"a3753.b101271.c388189.d512369",sdk_error_securitySdkGetTokenFailed:"a3753.b101271.c388189.d513035",sdk_error_securitySdkInitFailed:"a3753.b101271.c388193.d513045",sdk_error_caught_exception_in_callback:"a3753.b101271.c388189.d513207",sdk_error_call_url_failed:"a3753.b101271.c388189.d513050",sdk_event_webAppTimeout:"a3753.b101271.c388189.d512356",sdk_error_getGaidFailed:"a3753.b101271.c388193.d513038",sdk_error_securitySdkInitTokenFailed:"a3753.b101271.c388193.d513044",container_error_error_invalid_param:"a3753.b101271.c388193.d513220",container_error_error_set_ua_failed:"a3753.b101271.c388193.d513221",sdk_event_onAddressResult:"a3753.b101271.c388193.d513194",sdk_event_onAbnormalEventName:"a3753.b101271.c388193.d513345",event_important_log:"a3753.b101271.c388193.d512370",sdk_event_sdkQueryEnd:"a3753.b101271.c388193.d512371",container_event_manifest_load_start:"a3753.b101271.c388193.d512372",sdk_event_api_preheat:"a3753.b101271.c388193.d512373",container_event_manifest_load_complete:"a3753.b101271.c388193.d512374",sdk_event_apiSubmit:"a3753.b101271.c388193.d512375",sdk_event_securitySdkGetCodeSuccess:"a3753.b101271.c388193.d512376",sdk_event_securitySdkInitSuccess:"a3753.b101271.c388193.d512377",container_event_start_load:"a3753.b101271.c388193.d512378",sdk_event_getRemoteConfigStart:"a3753.b101271.c388193.d512379",container_event_webViewOnPageFinished:"a3753.b101271.c388193.d512419",container_event_page_load_success:"a3753.b101271.c388193.d512420",sdk_event_pre_init:"a3753.b101271.c388193.d512421",sdk_event_submitPay:"a3753.b101271.c388193.d512422",sdk_event_submitPayEnd:"a3753.b101271.c388193.d512423",container_stop_event_loop:"a3753.b101271.c388193.d512424",iap_net_start:"a3753.b101271.c388193.d512425",sdk_event_securitySdkPreInitSuccess:"a3753.b101271.c388193.d512426",sdk_event_securitySdkPreInit:"a3753.b101271.c388193.d512427",sdk_event_important_event:"a3753.b101271.c388193.d512428",sdk_event_accelerateInfo:"a3753.b101271.c388193.d512429",container_event_manifest_res_complete:"a3753.b101271.c388193.d512430",container_event_manifest_res_start:"a3753.b101271.c388193.d512431",sdk_event_dismissWindowCloseCancel:"a3753.b101271.c388193.d512432",sdk_event_jsBridgeCall_httpRequestStart:"a3753.b101271.c388193.d512433",sdk_event_getGaidSuccess:"a3753.b101271.c388193.d512434",sdk_event_securitySdkInit:"a3753.b101271.c388193.d512435",sdk_event_getRemoteLanguageResult:"a3753.b101271.c388193.d513176",sdk_event_getRemoteLanguageStart:"a3753.b101271.c388193.d513175",sdk_event_handleSDKPaymentResult:"a3753.b101271.c388193.d512436",sdk_event_handleSDKPaymentFail:"a3753.b101271.c388193.d513172",sdk_event_sdkQuery:"a3753.b101271.c388193.d512437",sdk_event_handleSDKPaymentStart:"a3753.b101271.c388193.d512438",sdk_event_securitySdkGetTokenSuccess:"a3753.b101271.c388193.d512439",sdk_event_api_onDestroy:"a3753.b101271.c388193.d512440",container_load_failed:"a3753.b101271.c388193.d512441",sdk_event_kycAppPreLoadStart:"a3753.b101271.c388193.d513154",sdk_event_apiOnDestroy:"a3753.b101271.c388193.d512442",sdk_event_getRemoteConfigResult:"a3753.b101271.c388193.d512443",iap_net_result:"a3753.b101271.c388193.d512444",sdk_event_popupWindowCloseButtonClick:"a3753.b101271.c388193.d512445",container_error_resourceLoadFailed:"a3753.b101271.c388193.d512446",container_event_startPreRenderUrl:"a3753.b101271.c388193.d512447",sdk_event_webAppPreLoadStart:"a3753.b101271.c388193.d512448",sdk_event_importantEvent:"a3753.b101271.c388193.d512449",container_error_registerJSAPIPlugin:"a3753.b101271.c388193.d512531",sdk_event_afterEventCallback:"a3753.b101271.c388217.d513210",sdk_event_createPayment:"a3753.b101271.c388217.d513074",sdk_event_sendMessageToWeb:"a3753.b101271.c388217.d512452",sdk_error_appHeartBeatTimeout:"a3753.b101271.c388217.d512453",container_event_jSEngineEvaluateJavascript:"a3753.b101271.c388217.d512454",container_event_jSEngineLoadJavascript:"a3753.b101271.c388217.d512455",sdk_event_receive_message_from_web:"a3753.b101271.c388217.d512456",sdk_event_receiveMessageFromWeb:"a3753.b101271.c388217.d512457",sdk_event_monitorFlushReport:"a3753.b101271.c388217.d512458",container_event_page_pv:"a3753.b101271.c388217.d512459",container_event_override_url_loading:"a3753.b101271.c388217.d513223",sdk_event_dismissWindowCloseConfirm:"a3753.b101271.c388217.d512460",container_load_success:"a3753.b101271.c388217.d512461",container_event_page_start:"a3753.b101271.c388217.d512462",sdk_event_webAppStartLoad:"a3753.b101271.c388217.d512463",container_event_startPreLoadUrl:"a3753.b101271.c388217.d512464",container_event_jsSEngineStart:"a3753.b101271.c388217.d512465",container_event_jSEngineDestroy:"a3753.b101271.c388193.d512546",sdk_event_send_message_to_web:"a3753.b101271.c388217.d512466",container_event_importantEvent:"a3753.b101271.c388217.d512467",sdk_event_monitorCrashTrackInit:"a3753.b101271.c388217.d512468",container_event_stop_event_loop:"a3753.b101271.c388217.d512469",sdk_event_requestAccelerateInfo:"a3753.b101271.c388217.d513147",native_rpc_performance:"a3753.b101271.c388217.d513218",container_event_jSEngineEvaluateJavascriptCallback:"a3753.b101271.c388217.d512585",container_event_jSEngineRegisterJsapi:"a3753.b101271.c388217.d512586",jSEngineEvaluateJavascriptConvertError:"a3753.b101271.c388217.d512592",sdk_event_security_unneeded_scenarios:"a3753.b101271.c388217.d512595",container_event_launch:"a3753.b101271.c388217.d513256",event_jsapi_call_start:"a3753.b101271.c388217.d514734",event_jsapi_call_end:"a3753.b101271.c388217.d514735",sdk_event_call_url_start:"a3753.b101271.c388189.d515011",sdk_event_onAbnormalKeys:"a3753.b101271.c388193.d513391",sdk_event_espBeforePay:"a3753.b101271.c388193.d514078",sdk_event_busPublishMessage:"a3753.b101271.c388217.d515030",sdk_event_busIsSubscribe:"a3753.b101271.c388217.d515031",sdk_event_busSubscribe:"a3753.b101271.c388217.d515032",NEW_AMSSDK_BY_MECHANT:"a3753.b101271.c388193.d512449",sdk_event_busClear:"a3753.b101271.c388193.d518374",sdk_event_busAddInterceptor:"a3753.b101271.c388193.d518374",sdk_error_securitySdkInitTimeout:"a3753.b101271.c388193.d513045",sdk_error_busPublishNoResult:"a3753.b101271.c388193.d518374",sdk_event_busPublishCallback:"a3753.b101271.c388193.d518374",sdk_error_busPublishError:"a3753.b101271.c388189.d518375",sdk_error_busPublishUnsubscribeError:"a3753.b101271.c388189.d518375",sdk_event_busUnsubscribe:"a3753.b101271.c388193.d518374",onBusPublishException:"a3753.b101271.c388189.d518375",sdk_event_apiGetValue:"a3753.b101271.c388193.d512449",load_channel_sdk_start:"a3753.b101271.c388193.d512449",preload_match:"a3753.b101271.c388193.d512449",preload_no_match:"a3753.b101271.c388188.d512345",canMakePayments_error:"a3753.b101271.c388188.d512345",performance_optimization_clearPreloadIframe:"a3753.b101271.c388193.d512449",performance_optimization_clearPreloadIframe_timeout:"a3753.b101271.c388188.d512345",sdk_event_call_url_failed:"a3753.b101271.c388189.d513050",sdk_event_applePaymentResult:"a3753.b101271.c388193.d518376",submitPayStatus:"a3753.b101271.c388193.d518376",sdk_event_appleAvailable:"a3753.b101271.c388193.d518376",sdk_event_appleCreateComponent:"a3753.b101271.c388193.d518376",sdk_event_appleShowPaymentSheet:"a3753.b101271.c388193.d518376",sdk_event_appleSubmitToken:"a3753.b101271.c388193.d518376",sdk_event_appleDestroyComponent:"a3753.b101271.c388193.d518376",paypal_payment_failed:"a3753.b101271.c388189.d518378",paypal_payment_approved:"a3753.b101271.c388193.d518383",paypal_payment_cancelled:"a3753.b101271.c388193.d518383",sdk_event_clean_component:"a3753.b101271.c388193.d518383",load_item_sdk_start:"a3753.b101271.c388193.d512449",load_item_sdk_end:"a3753.b101271.c388193.d512449",performance_optimization_get_previousChannel_error:"a3753.b101271.c388188.d512345",performance_optimization_channelType_error:"a3753.b101271.c388188.d512345",sdk_error_before_submit:"a3753.b101271.c388188.d512345",sessionDataNull:"a3753.b101271.c388189.d518377","appple runtime excepiton":"a3753.b101271.c388189.d518377",sdk_error_created_app_process_failed:"a3753.b101271.c388188.d512345",sdk_error_web_app_timeout:"a3753.b101271.c388188.d512345",performance_optimization_preload:"a3753.b101271.c388193.d512449",performance_optimization_preload_path_error:"a3753.b101271.c388188.d512345",sdk_error_created_app_failed:"a3753.b101271.c388188.d512345",sdk_error_create_pop_up:"a3753.b101271.c388188.d512345",button_render_failed:"a3753.b101271.c388189.d518378",paypal_payment_loadSDK_failed:"a3753.b101271.c388189.d518378",load_item_sdk_error:"a3753.b101271.c388188.d512345",load_item_sdk_timeout:"a3753.b101271.c388188.d512345",MerchantValidationError:"a3753.b101271.c388189.d518377",PaymentAuthorizedError:"a3753.b101271.c388189.d518377","ApplePaySession is only support in Safari":"a3753.b101271.c388189.d518377","Abnormal params paymentSessionFactor":"a3753.b101271.c388189.d518377","Abnormal params recurringInfo":"a3753.b101271.c388189.d518377","Payment processing but user dismissed the sheet":"a3753.b101271.c388189.d518377","User dismissed the sheet":"a3753.b101271.c388189.d518377",sdk_before_confirm_start:"a3753.b204577.c480929",sdk_before_confirm_success:"a3753.b204577.c480930",sdk_before_confirm_abort:"a3753.b204577.c480931",sdk_before_confirm_error:"a3753.b204577.c480932",sdk_before_confirm_timeout:"a3753.b204577.c480933",sdk_before_confirm_skip:"a3753.b204577.c480934"},Ba),Ha=function(){function e(t,n){b()(this,e),p()(this,"logs",void 0),p()(this,"config",void 0),p()(this,"debug",void 0),p()(this,"componentStartTime",void 0),p()(this,"isLoaded",void 0),p()(this,"trackId",void 0),this.logs=[],this.config=t,this.debug=n,this.componentStartTime=0,this.isLoaded=!1}return y()(e,[{key:"setMedta",value:function(e){var t,n,r=this;(this.config.mdata=Object.assign(this.config.mdata,e),null!==(t=window)&&void 0!==t&&t.iTracker)?(null===(n=window)||void 0===n||null===(n=n.iTracker)||void 0===n||n.set({mdata:this.config.mdata}),setTimeout((function(){r.reportLogs()}),80)):this.initTracker()}},{key:"logError",value:function(e,t){var n=this,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=r?Ma.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})):null!=t?t:{},i=Date.now(),a=i-this.componentStartTime,s=v()({},e),l=null==e?void 0:e.title;return Ka[l]&&(s.title=Ka[l]),o.eventSource="sdk",o.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:l,this.logs.push({type:"error",logPayload:s,extra:v()(v()({},o),{},{fsDuration:a,timeStamp:i})}),this.debug&&console.log("[web-sdk] Log error",s,o),this.send(),this}},{key:"logInfo",value:function(e,t){var n=this,r=Ma.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})),o=Date.now(),i=o-this.componentStartTime,a=v()({},e),s=null==e?void 0:e.title;return Ka[s]&&(a.title=Ka[s]),r.eventSource="sdk",r.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:s,this.logs.push({type:"info",logPayload:a,extra:v()(v()({},r),{},{fsDuration:i,timeStamp:o})}),this.debug&&console.log("[web-sdk] Log info",a,r),this.send(),this}},{key:"reportRPC",value:function(e,t){var n=this,r=Ma.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})),o=Date.now(),i=o-this.componentStartTime,a=v()({},e),s=null==e?void 0:e.title;return Ka[s]&&(a.title=Ka[s]),r.eventSource="sdk",r.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:s,this.logs.push({type:"rpc",logPayload:a,extra:v()(v()({},r),{},{fsDuration:i,timeStamp:o})}),this.debug&&console.log("[web-sdk] Log rpc",a,r),this.send(),this}},{key:"reportLogs",value:function(){var e;if(null!==(e=window)&&void 0!==e&&e.iTracker)for(var t=window.iTracker,n=t.logError,r=t.logInfo,o=t.reportRPC,i=this.logs;i.length>0;)try{var a,s=i.pop();if("error"===s.type)n(s.logPayload,v()({trackId:this.trackId,title:null===(a=s.logPayload)||void 0===a?void 0:a.title},null==s?void 0:s.extra));else if("info"===s.type){var l;r(s.logPayload,v()({trackId:this.trackId,title:null===(l=s.logPayload)||void 0===l?void 0:l.title},null==s?void 0:s.extra))}else if("rpc"===s.type){var c;o(s.logPayload,v()({trackId:this.trackId,title:null===(c=s.logPayload)||void 0===c?void 0:c.title},null==s?void 0:s.extra))}}catch(e){console.error("Error occurred while calling iTracker method:",e)}}},{key:"loadScript",value:function(e,t){var n=this;if("function"==typeof window.define&&window.define.amd&&"function"==typeof window.require){var r="antom_iTracker";try{var o,i;return null!==(o=(i=window.require).specified)&&void 0!==o&&o.call(i,r)||window.require.config({paths:p()({},r,e.replace(/\.js$/,""))}),void window.require([r],t,(function(r){console.error("AMD load failed, falling back to script tag",r),n.fallbackLoadScript(e,t)}))}catch(e){console.warn("require not available, using script tag",e)}}this.fallbackLoadScript(e,t)}},{key:"fallbackLoadScript",value:function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t,n.onerror=function(){console.error("unable to load Antom script: ".concat(e))},document.body?document.body.appendChild(n):document.head&&document.head.appendChild(n)}},{key:"initTracker",value:function(){var e=this;if(!this.isLoaded){this.isLoaded=!0;try{"undefined"!=typeof localStorage&&this.loadScript(this.config.scriptUrl,(function(){var t;null===(t=window)||void 0===t||t.iTracker.initiTracker(e.config),setTimeout((function(){e.reportLogs()}),80)}))}catch(e){console.error("Failed to initialize iTracker:",e)}}}},{key:"send",value:function(){var e;null!==(e=window)&&void 0!==e&&e.iTracker?this.reportLogs():this.initTracker()}},{key:"setComponentStartTime",value:function(e){this.componentStartTime=e}},{key:"setTrackId",value:function(e){this.trackId=e}},{key:"getComponentStartTime",value:function(){return this.componentStartTime}}],[{key:"setInstance",value:function(e){return this.instance=e}},{key:"getInstance",value:function(){return this.instance}}]),e}();p()(Ha,"instance",void 0);var Fa={scriptUrl:"https://gw-intl.alipayobjects.com/render/p/yuyan_npm/@alipay_intl-tracker/1.6.0/dist/common.min.js",spmConfig:{},batchCount:1,appId:"antom_sdk",server:"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do",bizType:"antom_sdk",productId:"ANTOM_SDK",version:"iteration/20231021",mdata:{firstLogTime:Date.now(),sdkVersion:"0.0.1787898127-dev.2"}},Ya=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{var o,i=on(e,{sdkVersion:I,productScene:t,mid:n});if(r)null===(o=Ha.getInstance())||void 0===o||o.logInfo({title:"sdk_event_appUpgradeInfo"},{appUpgradeVersion:i,processResult:!!i,isPreload:!e,config:e,productScene:t,merchantId:n});return i?(e&&sn(I+t,i),i):i=an(I+t)}catch(e){return""}},ja=function(e,t){var n,r=(n={},p()(p()(p()(p()(p()(p()(p()(p()(p()(p()(n,V.NONE,[""]),V.AUTO_DEBIT_WALLET,["1.0"]),V.AUTO_DEBIT_PAY_WALLET,[""]),V.CASHIER_PAYMENT_BANK,["1.0"]),V.CASHIER_PAYMENT_CARD,["1.0"]),V.CASHIER_PAYMENT_APM,["1.0"]),V.EASY_PAY_WALLET,["1.0","2.0"]),V.EASY_PAY_APM,["2.0"]),V.VAULTING_CARD,["1.0"]),V.ELEMENT_PAYMENT,["1.0"]),p()(p()(p()(n,V.ELEMENT_ADDRESS,["1.0"]),V.CHECKOUT_PAYMENT,["1.0.0"]),V.AUTO_DEBIT_APM,["1.0"]))[e]||[],o=r.find((function(e){return e===t})),i=r[r.length-1];return o?t:i},Ga=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,l=arguments.length>7&&void 0!==arguments[7]&&arguments[7],c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:"",u=At()||{},d=u.host,p=Ya(a,o,s,l),h=p||n;p&&(null===(e=Ha.getInstance())||void 0===e||e.setMedta({webAppVersion:h}));Ot()&&(console.log("appUpgrade#getAppPath#finalAppVersion",h),console.log("appUpgrade#getAppPath#extendInfo",a,s));var m=ja(r,i);if(c)return c;if(d&&!["sandbox","light_sandbox","prod"].includes(t))return d;if(r===V.ELEMENT_ADDRESS)return"".concat(w[t],"/element-address/pages/address/index.html");if(nt()(Object.values(z)).includes(r)){var f=!1;try{f=JSON.parse(JSON.parse(a).expressCheckout)}catch(e){}return f?"".concat(w[t],"/elements/pages/express_checkout/index.html"):"".concat(w[t],"/elements/pages/").concat(o.toLowerCase(),"/index.html")}return"".concat(T[t],"/").concat(r,"/").concat(m,"/index.html")},za=function(e){var t=e.componentSign,n=e.analytics,r=void 0===n?{enabled:!0}:n,o=e.productScene,i=e.productSceneVersion,a=e.environment,s=e.appVersion,l=e.extendInfo,c=e.locale,u=e.instanceId,d=e.renderDisplayType,p=e.isPreload,h=void 0===p?"":p,m=e.hostSign,f=void 0===m?"":m,v=e.mid,g=void 0===v?"":v,y=e.elementLink,_=Ga(a,s,t,o,i,l||"",g,!0,void 0===y?"":y),b=on(l,{sdkVersion:I,productScene:o,mid:g})?"true":"false",E=At(),S=E._sandbox,A=E._light_sandbox,k=E.requestHost,T=void 0===k?"":k,P=E.groupId,w=void 0===P?"":P,C=E.LOCAL_MOCK,R=E._displayType,N=Object.assign({},{displayType:d,locale:c,instanceId:u,appMatched:b,analyticsEnabled:!1===(null==r?void 0:r.enabled)?"false":"true",sdkVersion:I,refUrl:window.location.href,_componentStartTime:"".concat(Date.now()),_proxyCostTime:"".concat(Na(o)),isPreload:h||"",hostSign:f||""});C&&(N.LOCAL_MOCK=C),T&&(N.requestHost=T),w&&(N.groupId=w),"light_sandbox"!==a&&"true"!==A||(N.sandbox="true"),"sandbox"!==a&&"true"!==S||(N.shadow="true"),R&&(N.displayType=R);var O=dt(N);return Ot()&&(console.log("appUpgrade#getIframeUrl#appMatched",b),console.log("appUpgrade#getIframeUrl#url",_,O)),{path:_,locationSearch:O}},Va=function(e,t){var n="ams-checkout-component-".concat(e,"-").concat(t),r=document.createElement("iframe"),o=n;return r.id=o,r.style.height="1px",r.style.width="1px",r.style.border="1px",r.style.opacity="0",r.style.overflow="hidden",r},Wa=2e4,qa="MERCHANT_CONFIRM_ABORT",Ja="MERCHANT_CONFIRM_TIMEOUT",Qa=Symbol("BEFORE_CONFIRM_TIMEOUT");function Za(e){return Xa.apply(this,arguments)}function Xa(){return Xa=u()(l()().mark((function e(t){var n,r,o,i,a=arguments;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a.length>1&&void 0!==a[1]?a[1]:Wa,o=new Promise((function(e,t){r=setTimeout((function(){return t(Qa)}),n)})),e.prev=2,e.next=5,Promise.race([t(),o]);case 5:return i=e.sent,e.abrupt("return",{result:i,timedOut:!1});case 9:if(e.prev=9,e.t0=e.catch(2),e.t0!==Qa){e.next=13;break}return e.abrupt("return",{result:void 0,timedOut:!0});case 13:throw e.t0;case 14:return e.prev=14,clearTimeout(r),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,9,14,17]])}))),Xa.apply(this,arguments)}var $a=function(e){return e.APPLE_PAY_MISSING_DATA="APPLE_PAY_MISSING_DATA",e.APPLE_PAY_NOT_SUPPORTED="APPLE_PAY_NOT_SUPPORTED",e.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED="APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",e.APPLE_PAY_TOKEN_ERROR="APPLE_PAY_TOKEN_ERROR",e.APPLE_PAY_CANCEL="APPLE_PAY_CANCEL",e}($a||{}),es=function(e){return e.PENDING="PENDING",e.NORMAL="NORMAL",e}(es||{});function ts(e,t){var n,r,o,i,a,s,l,c;return"BANKTRANSFER_QUICKPAY"===(null==e||null===(n=e.paymentMethodInfoView)||void 0===n?void 0:n.paymentMethodType)&&"EASY_PAY"===(null==e||null===(r=e.paymentSessionConfig)||void 0===r?void 0:r.productScene)&&"APM"===(null==e||null===(o=e.paymentSessionConfig)||void 0===o?void 0:o.paymentMethodCategoryType)&&"2.0"===(null==e||null===(i=e.paymentSessionConfig)||void 0===i?void 0:i.productSceneVersion)?{usePaymentSessionAsQueryResult:!0,submitPayInSdk:!0,createIframeNode:!0,loadApp:!0,allowClickOutsideClose:!1,buildSubmitPayExtParams:function(e){var n=function(e){var t=e.instanceId,n=e.paymentMethodType,r=e.paymentSessionData,o=e.paymentSessionObj,i=e.locale,a=e.env,s=e.sdkVersion,l=e.notRedirectAfterComplete,c=!1,u=Jt(o,a);return"".concat(u)+"?scene=cashierResultPage&"+"instanceId=".concat(t)+"&"+"paymentSessionData=".concat(encodeURIComponent(r))+"&"+"isLandscape=".concat(c?"true":"")+"&"+"pmt=".concat(n)+"&"+"locale=".concat(i)+"&"+"mode=".concat(lt.SDK)+"&"+"sdkVersion=".concat(s)+"&"+"¬RedirectAfterComplete=".concat(l)}(e);return{callBackUrl:n,notRedirectAfterComplete:!0===t}}}:"TNG"===(null==e||null===(a=e.paymentMethodInfoView)||void 0===a?void 0:a.paymentMethodType)&&"EASY_PAY"===(null==e||null===(s=e.paymentSessionConfig)||void 0===s?void 0:s.productScene)&&"WALLET"===(null==e||null===(l=e.paymentSessionConfig)||void 0===l?void 0:l.paymentMethodCategoryType)&&"2.0"===(null==e||null===(c=e.paymentSessionConfig)||void 0===c?void 0:c.productSceneVersion)?{usePaymentSessionAsQueryResult:!1,submitPayInSdk:!1,createIframeNode:!0,loadApp:!0,allowClickOutsideClose:!1,buildSubmitPayExtParams:function(e){return{}}}:void 0}var ns=function(e){return new Promise((function(t,n){var r,o=null==e||null===(r=e.context)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.paymentMethodDetail)||void 0===r?void 0:r.googlePayProps,i=o.environment,a=void 0===i?"TEST":i,s=o.paymentRequest,l=void 0===s?{}:s,c=document.createElement("script");c.src="https://pay.google.com/gp/p/js/pay.js",c.async=!0,document.body.appendChild!==Node.prototype.appendChild?Node.prototype.appendChild.call(document.body,c):document.body.appendChild(c),c.onload=function(){var e=new window.google.payments.api.PaymentsClient({environment:a,paymentDataCallbacks:{onPaymentAuthorized:function(e){return{transactionState:"SUCCESS"}}}});e.isReadyToPay(l).then((function(t){if(t.result)return e.loadPaymentData(l);n({errorCode:"GOOGLE_PAY_NOT_SUPPORTED"})})).then((function(e){e&&t(e)})).catch((function(e){n(e)}))},c.onerror=function(e){n(e)}}))},rs=function(){function e(t){var n=t.paymentSessionData,r=t.parseData,o=t.logger,i=t.env,a=void 0===i?te.prod:i,s=t.shipping,l=t.merchantAmount,c=void 0===l?null:l,u=t.merchantCurrency,d=void 0===u?null:u;b()(this,e),p()(this,"APPLESDKURL","https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js"),p()(this,"session",null),p()(this,"paymentSessionData",void 0),p()(this,"parseData",void 0),p()(this,"paymentStatus",void 0),p()(this,"cancelReason",null),p()(this,"logger",void 0),p()(this,"env",void 0),p()(this,"shipping",void 0),p()(this,"merchantAmount",void 0),p()(this,"merchantCurrency",void 0),p()(this,"onBeforeConfirm",null),this.paymentSessionData=n,this.parseData=r,this.env=a,this.logger=o,this.shipping=s,this.merchantAmount=c,this.merchantCurrency=d}var t,n,r,o;return y()(e,[{key:"setOnBeforeConfirm",value:function(e){this.onBeforeConfirm=e}},{key:"startPay",value:(o=u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.initApplePaySession();case 3:return e.abrupt("return",this.begin());case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return o.apply(this,arguments)})},{key:"begin",value:function(){var e=this;return new Promise((function(t,n){try{if(!e.session)return;e.paymentStatus=es.PENDING,e.cancelReason="USER_CANCEL",e.session.onvalidatemerchant=function(){var t=u()(l()().mark((function t(r){var o,i,a,s,c;return l()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o={validateUrl:null==r?void 0:r.validationURL,paymentSessionData:e.paymentSessionData,merchantDomain:window.location.hostname},t.t0=Ea,t.t1=e.paymentSessionData,t.t2=o,t.t3=e.env,t.next=8,e.getDeviceId();case 8:return t.t4=t.sent,t.t5={deviceId:t.t4},t.t6={env:t.t3,envInfo:t.t5},t.t7=e.logger,t.next=14,(0,t.t0)(t.t1,t.t2,t.t6,t.t7);case 14:null!=(i=t.sent)&&i.success&&i.merchantSessionObject?(a=JSON.parse(i.merchantSessionObject),e.session.completeMerchantValidation(a)):(null===(s=e.logger)||void 0===s||s.logError({title:"a3753.b103030.c386485.d507483"}),e.abortSession(),n({errorCode:$a.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED})),t.next=23;break;case 18:t.prev=18,t.t8=t.catch(0),null===(c=e.logger)||void 0===c||c.logError({title:"a3753.b103030.c386485.d507483"}),e.abortSession(),n({errorCode:$a.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED});case 23:case"end":return t.stop()}}),t,null,[[0,18]])})));return function(e){return t.apply(this,arguments)}}(),e.session.onpaymentauthorized=function(){var r=u()(l()().mark((function r(o){var i,a,s,c,u,d,p,h,m,f,v,g,y,_,b,E,S,A,k,T,P,w,I,C,R,N,O;return l()().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=function(){var t,n;return null===(t=e.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),Promise.reject({errorCode:$a.APPLE_PAY_TOKEN_ERROR})},a=null==o?void 0:o.payment,s=a.token,c=a.billingContact,u=a.shippingContact,!s){r.next=46;break}if(p={instPaymentToken:JSON.stringify(s)},h=null===(d=e.parseData)||void 0===d||null===(d=d.paymentSessionFactor)||void 0===d?void 0:d.extendInfo,m=h.requiredBillingContactFields,f=h.requiredShippingContactFields,!Nt(m)&&c&&(p.applePayBillingContact=JSON.stringify(c)),!Nt(f)&&u&&(p.applePayShippingContact=JSON.stringify(u)),e.onBeforeConfirm){r.next=11;break}null===(v=e.logger)||void 0===v||v.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk"}),r.next=39;break;case 11:return null===(g=e.logger)||void 0===g||g.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk"}),r.prev=12,_=Date.now(),r.next=16,Za((function(){return e.onBeforeConfirm()}));case 16:if(b=r.sent,E=b.result,S=b.timedOut,A=E,(k=S||Date.now()-_>=Wa)&&(null===(T=e.logger)||void 0===T||T.logError({title:"sdk_before_confirm_timeout"}),A=!1),null===(y=e.logger)||void 0===y||y.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:A}),A){r.next=29;break}return e.cancelReason=k?"MERCHANT_TIMEOUT":"MERCHANT_ABORT",null===(P=e.session)||void 0===P||null===(w=P.completePayment)||void 0===w||w.call(P,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),n({errorCode:k?Ja:qa}),r.abrupt("return");case 29:r.next=39;break;case 31:return r.prev=31,r.t0=r.catch(12),null===(I=e.logger)||void 0===I||I.logError({title:"sdk_before_confirm_error"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk",errorMessage:String((null===r.t0||void 0===r.t0?void 0:r.t0.message)||r.t0).slice(0,200)}),e.cancelReason="MERCHANT_ABORT",null===(C=e.session)||void 0===C||null===(R=C.completePayment)||void 0===R||R.call(C,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),n({errorCode:qa}),r.abrupt("return");case 39:return r.next=41,e.submitPay(p);case 41:N=r.sent,e.setPayStatus(N),t(N),r.next=48;break;case 46:null===(O=e.logger)||void 0===O||O.logError({title:"a3753.b103030.c386485.d507486"}),i();case 48:case"end":return r.stop()}}),r,null,[[12,31]])})));return function(e){return r.apply(this,arguments)}}(),e.session.oncancel=function(){var t,r;e.paymentStatus===es.PENDING?null===(t=e.logger)||void 0===t||t.logError({title:"a3753.b103030.c386485.d507497"}):null===(r=e.logger)||void 0===r||r.logInfo({title:"a3753.b103030.c386485.d507498"});var o="MERCHANT_TIMEOUT"===e.cancelReason?Ja:qa;n({errorCode:"MERCHANT_ABORT"===e.cancelReason||"MERCHANT_TIMEOUT"===e.cancelReason?o:$a.APPLE_PAY_CANCEL})},e.session.begin(),e.addEventListener(n)}catch(e){return Promise.reject(e)}}))}},{key:"submitPay",value:(r=u()(l()().mark((function e(t){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.t0=_a,e.t1=v()({paymentSessionConfig:null===(n=this.parseData)||void 0===n?void 0:n.paymentSessionConfig,paymentSessionData:this.paymentSessionData,paymentFactors:t,paymentMethod:{paymentMethodType:"APPLEPAY"},shipping:this.shipping},this.merchantAmount&&this.merchantCurrency?{paymentAmount:{amount:this.merchantAmount,currency:this.merchantCurrency}}:{}),e.t2=this.env,e.next=6,this.getDeviceId();case 6:return e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,envInfo:e.t4},e.t6=this.logger,e.next=12,(0,e.t0)(e.t1,e.t5,e.t6);case 12:return e.abrupt("return",e.sent);case 15:return e.prev=15,e.t7=e.catch(0),e.abrupt("return",Promise.resolve(e.t7));case 18:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return r.apply(this,arguments)})},{key:"setPayStatus",value:function(e){var t,n,r,o={success:window.ApplePaySession.STATUS_SUCCESS,fail:window.ApplePaySession.STATUS_FAILURE};r=null!=e&&e.success||"U"===(null==e?void 0:e.errorStatus)?"success":"fail",this.paymentStatus=es.NORMAL,null===(t=this.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,o[r])}},{key:"initApplePaySession",value:(n=u()(l()().mark((function e(){var t,n,r,o,i,a,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.paymentStatus!==es.PENDING){e.next=3;break}return e.abrupt("return");case 3:if(this.isRequiredParameters){e.next=7;break}return null===(r=this.logger)||void 0===r||r.logError({title:"a3753.b103030.c386485.d507448"}),this.paymentStatus=es.NORMAL,e.abrupt("return",Promise.reject({errorCode:$a.APPLE_PAY_MISSING_DATA}));case 7:return null===(t=this.logger)||void 0===t||t.logInfo({title:"a3753.b103030.c386485.d507459"}),e.next=10,this.loadApplePaySdk();case 10:if("ApplePaySession"in window){e.next=12;break}throw new Error("Apple Pay not supported");case 12:if(o=(null===(n=this.parseData)||void 0===n?void 0:n.paymentSessionFactor)||{},i=o.recurringInfo,a=i?14:2,this.isCanMakePayments(a)){e.next=16;break}throw new Error("Apple Pay not supported");case 16:this.session=new window.ApplePaySession(a,this.initSessionParams),e.next=23;break;case 19:return e.prev=19,e.t0=e.catch(0),null===(s=this.logger)||void 0===s||s.logError({title:"a3753.b103030.c386485.d507471"}),e.abrupt("return",Promise.reject({errorCode:$a.APPLE_PAY_NOT_SUPPORTED}));case 23:case"end":return e.stop()}}),e,this,[[0,19]])}))),function(){return n.apply(this,arguments)})},{key:"abortSession",value:function(){try{var e,t;this.paymentStatus=es.NORMAL,this.session&&(null===(e=(t=this.session).abort)||void 0===e||e.call(t))}catch(e){console.error("abortPaySession error",e)}finally{this.session=null}}},{key:"initSessionParams",get:function(){var e,t=(null===(e=this.parseData)||void 0===e?void 0:e.paymentSessionFactor)||{},n=t.merchantInfo,r=t.order,o=t.paymentAmount,i=t.recurringInfo,a=t.extendInfo,s={countryCode:null==n?void 0:n.registeredCountry,currencyCode:this.merchantCurrency||(null==o?void 0:o.currency),merchantCapabilities:null==a?void 0:a.merchantCapabilities,supportedNetworks:null==a?void 0:a.supportedNetworks,total:{label:null==n?void 0:n.merchantName,type:"final",amount:this.merchantAmount||(null==o?void 0:o.value)},requiredBillingContactFields:null==a?void 0:a.requiredBillingContactFields,requiredShippingContactFields:null==a?void 0:a.requiredShippingContactFields};if(i){var l;if(null==r||!r.orderDescription||null==i||!i.managementURL)return;var c={type:"final",label:i.title,amount:null==o?void 0:o.value,paymentTiming:"recurring",recurringPaymentStartDate:null!=i&&i.startDate?new Date(1e3*Number(i.startDate)):void 0,recurringPaymentEndDate:null!=i&&i.endDate?new Date(1e3*Number(i.endDate)):void 0,recurringPaymentIntervalUnit:null!=i&&i.intervalUnit?i.intervalUnit:"month",recurringPaymentIntervalCount:null!==(l=null==i?void 0:i.intervalCount)&&void 0!==l?l:1},u={paymentDescription:null==r?void 0:r.orderDescription,billingAgreement:i.agreementDescription,regularBilling:c,managementURL:null==i?void 0:i.managementURL,tokenNotificationURL:null==i?void 0:i.tokenNotificationURL};s.total=c,s.lineItems=[c],s.recurringPaymentRequest=u}return s}},{key:"isRequiredParameters",get:function(){var e,t=(null===(e=this.parseData)||void 0===e?void 0:e.paymentSessionFactor)||{},n=t.merchantInfo,r=t.extendInfo,o=t.paymentAmount;return!(Nt(n)||Nt(o)||Nt(null==r?void 0:r.supportedNetworks)||Nt(null==r?void 0:r.merchantCapabilities))}},{key:"isCanMakePayments",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return(null===(e=window.ApplePaySession)||void 0===e?void 0:e.canMakePayments())&&(null===(t=window.ApplePaySession)||void 0===t?void 0:t.supportsVersion(n))}},{key:"loadApplePaySdk",value:function(){var e=this;return _t?Promise.reject("APPLE_PAY_NOT_SUPPORTED"):this.checkScriptIsLoaded||this.isCanMakePayments()?Promise.resolve(!0):new Promise((function(t,n){var r=document.createElement("script");r.src=e.APPLESDKURL,r.onload=function(){t(!0)},r.onerror=function(){n(!1)},document.body.appendChild(r)}))}},{key:"checkScriptIsLoaded",get:function(){return!!document.querySelector('script[src="'.concat(this.APPLESDKURL,'"]'))}},{key:"addEventListener",value:function(e){var t=this,n=document.querySelector("apple-pay-modal"),r=null==n?void 0:n.shadowRoot,o=(null==r?void 0:r.querySelector(".modal-close-button"))||null;o||this.logger.logInfo({title:"a3753.b103030.c386485.d533112"});null==o||o.addEventListener("click",(function n(){var r;null===(r=t.logger)||void 0===r||r.logInfo({title:"a3753.b103030.c386485.d507470"}),t.abortSession(),null==o||o.removeEventListener("click",n),null==e||e()}),{once:!0})}},{key:"getDeviceId",value:(t=u()(l()().mark((function e(){var t,n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Qe.publishForResult(new We(Cn.getSecurityDeviceId,JSON.stringify({deviceIdParameter:{productScene:null===(n=this.parseData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene}})),{fallback:""});case 2:if(e.t1=t=e.sent,e.t0=null===e.t1,e.t0){e.next=6;break}e.t0=void 0===t;case 6:if(!e.t0){e.next=10;break}e.t2=void 0,e.next=11;break;case 10:e.t2=t.getJSONObject();case 11:return e.abrupt("return",e.t2);case 12:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),os="#".concat(Ae,"-desktop{\n position: absolute;\n top: 0;\n left: 0;\n}\n#").concat(Ae,"-mobile{\n position: absolute;\n top: 0;\n left: 0;\n}\n.").concat(Ee,"-inline{\n width: 100%;\n height: auto;\n position: relative;\n line-height: 0;\n display: flex;\n}\n#").concat(Ie,"{\n width: 100%;\n flex: 1;\n}\n.").concat(Oe,"{\n width: 100%;\n height: auto;\n object-fit: contain;\n box-sizing: border-box;\n}\n.").concat(Oe,"-mobile{\n padding: 0 0.16em;\n}\n.").concat(Oe,"-desktop{}\n"),is=function(){var e=document.createElement("style");e.id="ams-inline-component-style",e.type="text/css",e.innerHTML=os,document.head.appendChild(e)},as=function(e,t,n){var r=document.createElement("div");r.id=Ie,n.componentSign===V.ELEMENT_PAYMENT?n.isExpressCheckout?r.innerHTML="":r.innerHTML=function(e){var t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){return e+t}),"")},n=function(e){var t=e.x,n=void 0===t?0:t,r=e.y,o=void 0===r?0:r,i=e.fill,a=void 0===i?"black":i,s=e.width,l=void 0===s?560:s,c=e.height,u=void 0===c?32:c,d=e.rx,p=void 0===d?4:d;return'<rect fill-opacity="0.04" x="'.concat(n,'" y="').concat(o,'" width="').concat(l,'" height="').concat(u,'" rx="').concat(p,'" fill="').concat(a,'"/>')},r=[n({fill:"white"}),n({y:4}),n({y:48,height:64}),n({y:128}),n({y:176}),n({y:224})];"tabs"===e&&(r=[n({fill:"white",width:358,height:305}),n({y:4,width:"50%",height:73}),n({x:"51%",y:4,height:73}),n({y:96,height:64}),n({y:178}),n({y:228}),n({y:276})]);var o={view:"tabs"===e?"0 0 358 305":"0 0 560 256",height:"tabs"===e?305:256};return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0 0 560 256",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256;return'<svg id="'.concat(Oe,"-").concat(e,'" width="100%" height="').concat(o,'" viewBox="').concat(r,'" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">\n ').concat(t(n),'\n <animate xlink:href="#').concat(Oe,"-").concat(e,'" attributeName="opacity" values="0.5; 1; 0.5" begin="0s" dur="1s" repeatCount="indefinite"></animate>\n </svg>')}(r,o.view,o.height)}(null==n?void 0:n.type):t===oe.desktop?r.innerHTML='<svg class="'.concat(Oe," ").concat(Oe,"-").concat(t,'" width="740" height="360" viewBox="0 0 740 360" fill="none" xmlns="">\n <rect width="740" height="360" rx="12" fill="#F6F6F6"/>\n <rect opacity="0.7" x="44" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="94" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="144" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z" fill="#E1E6ED"/>\n </g>\n </svg>'):t===oe.mobile&&(r.innerHTML='<svg class="'.concat(Oe," ").concat(Oe,"-").concat(t,'" width="358" height="186" viewBox="0 0 358 186" fill="none" xmlns="">\n <g clip-path="url(#clip0_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <g clip-path="url(#clip1_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <rect width="358" height="40" fill="white"/>\n <rect opacity="0.7" x="4" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="54" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="104" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g clip-path="url(#clip2_2543_91192)">\n <rect width="358" height="120" transform="translate(0 66)" fill="white"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z" fill="#E1E6ED"/>\n </g>\n <g clip-path="url(#clip3_2543_91192)">\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z" fill="#E1E6ED"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id="clip0_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip1_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip2_2543_91192">\n <rect width="358" height="120" fill="white" transform="translate(0 66)"/>\n </clipPath>\n <clipPath id="clip3_2543_91192">\n <rect width="358" height="92" fill="white" transform="translate(0 94)"/>\n </clipPath>\n </defs>\n </svg>\n ')),e&&e.appendChild(r);var o=document.getElementById(Ie);Tt(0,o)},ss=".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(we,"-hidden{\nanimation: ").concat(we,"-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** 加载动画 **/\n@-webkit-keyframes ").concat(we,"-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n\n"),ls=function(e,t){if(!document.getElementById(Ee)){var n;(n=document.createElement("style")).type="text/css",n.innerHTML=ss,document.head.appendChild(n),Pt();var r=document.createElement("div");r.className="".concat(Ee,"-hidden-").concat(e),r.id=Ee,Tt(0,r),document.body.appendChild(r);var o=document.createElement("div");return o.className="ams-component-section-".concat(e),o.id=Se,r.appendChild(o),r.classList.remove("".concat(Ee,"-hidden-").concat(e)),r.classList.add("".concat(Ee,"-").concat(e)),cs(e,t),r}},cs=function(e,t){var n=e===oe.mobile?"touchend":"click",r=document.getElementById(Ee),o="<img class='".concat(ke,"-btn-").concat(e,"' src=\"").concat(Ue,'"/>'),i=document.createElement("div");i.classList.add("".concat(ke,"-").concat(e),"".concat(ke,"-hidden")),i.id=ke,i.innerHTML=o,i.addEventListener(n,(function(){t()})),r&&r.appendChild(i)},us=function(e){var t=(null==e?void 0:e.platform)===oe.mobile?"touchend":"click",n=document.getElementsByTagName("body")[0];n.style.overflow="hidden";var r=document.createElement("div");r.style.width="100vw",r.style.height="100vh",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.zIndex="1000",r.style.background="rgba(0,0,0,0.5)",r.style.display="none",r.id=we,r.addEventListener(t,(function(){var t;null==e||null===(t=e.onClickOutside)||void 0===t||t.call(e)})),n.appendChild(r),function(e,t){var n=e===oe.mobile?"touchend":"click",r="<div class='".concat(Te,'-btn\'>\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z" fill="#EEEEEE"/>\n</svg>\n </div>'),o=document.createElement("div");o.classList.add("".concat(Te,"-").concat(e),"".concat(Te,"-hidden")),o.id=Te,o.innerHTML=r,o.addEventListener(n,(function(){t()})),document.body.appendChild(o)}(null==e?void 0:e.platform,null==e?void 0:e.closeBtnFunc)},ds="\n .".concat(De,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(De,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(De,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(De,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(xe,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(De,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(xe,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(De,"-drawer-enter {\n animation: slideIn ").concat(xe,"ms forwards;\n }\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(De,"-drawer-exit {\n animation: slideOut ").concat(xe,"ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n"),ps=function(e,t){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light",t="\n .ams-component-popup-loading .line div:before,\n .ams-component-popup-loading .line div:after {\n background: ".concat("light"===e?"#000000":"#ffffff"," !important;\n }"),n=document.createElement("style");n.innerHTML=t,document.head.appendChild(n)}(t);var n=document.createElement("div");null==n||n.classList.add(Ce),n.id=Ce,n.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',n.style.fontSize="".concat(kt(),"px"),e.appendChild(n)},hs=function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=document.getElementById(we);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(Ce))||void 0===e||e.remove()},ms="desktop",fs=function(e){var t=e.device,n=e.url,r=(e.widthPadding,e.loadingConfig);return new Promise((function(e,o){try{ms=t;var i=document.createElement("div");i.classList.add("".concat(De,"overlay"),"".concat(De,"fadeIn"));var a=document.createElement("div");"desktop"===t?(a.classList.add("".concat(De,"modal"),"".concat(De,"fadeIn")),a.style.width="656px",a.style.height="620px",a.style.borderRadius="12px"):(a.classList.add("".concat(De,"modal-mobile"),"".concat(De,"-drawer-enter")),a.style.width="100%",a.style.height="80vh",a.style.borderRadius="12px 12px 0 0");var s=document.createElement("iframe");if(s.src=n,s.style.border="none",s.style.width="100%",s.style.height="100%",r&&Object.keys(r).length){var l=r.theme,c=void 0===l?"default":l,u=r.backgroundPrimary,d=void 0===u?"#ffffff":u,p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t={night:"dark",gamingPurple:"dark",agateGreen:"dark",default:"light",nostalgicGray:"light",cherryBlossomPink:"light"};return t[e]}(c);ps(a,p),a.style.backgroundColor=d,s.style.backgroundColor=d}a.appendChild(s);var h=document.getElementsByTagName("body")[0];h.appendChild(i),h.appendChild(a),e(s)}catch(e){o({title:"sdk_error_create_pop_up",message:null==e?void 0:e.toString()})}}))};window.changingPageHeight=window.innerHeight;var vs,gs,ys,_s=function(){function e(t){b()(this,e),p()(this,"app",void 0),p()(this,"AMSSDK",void 0),p()(this,"platform",void 0),p()(this,"_performanceData",[]),p()(this,"_loadAppPromiseResolve",null),p()(this,"_isInitComponent",void 0),p()(this,"_globalData",void 0),p()(this,"popupApp",void 0),p()(this,"appDomain",void 0),p()(this,"createIframeNode",void 0),p()(this,"createPreloadIframeNode",void 0),p()(this,"_selector",void 0),p()(this,"_appVersion",void 0),p()(this,"_isRetention",void 0),p()(this,"_allowSubmitPayCallAhead",void 0),p()(this,"_actionQueryPromise",null),p()(this,"_actionSubmitPromise",null),p()(this,"_renderParams",null),p()(this,"_componentSign",V.NONE),p()(this,"_appLocationSearch",void 0),p()(this,"_renderDisplayType",G.popup),p()(this,"_multipleCallbackEvents",void 0),p()(this,"_isAppWebview",void 0),p()(this,"_isNativeAppWebview",void 0),p()(this,"_merchantAppointParam",void 0),p()(this,"_webAppHeartBeatTimeoutFn",void 0),p()(this,"_hasRenderComponent",!1),this._appVersion=t.appVersion,this._isInitComponent=!1,this._selector="#".concat(Se),this.createIframeNode=function(){return Promise.resolve()},this.createPreloadIframeNode=function(){return Promise.resolve()},this.platform=bt?oe.mobile:oe.desktop,this._isRetention=!0,this._appLocationSearch="",this._performanceData.push({key:"sdk_init",value:Date.now()}),this._globalData=new Map}var t,n,r,o,i;return y()(e,[{key:"logoutPlugin",value:function(){this.cleanContainer(!0)}},{key:"applyPlugin",value:function(e){this.AMSSDK=e,this.subscribeFromSDK()}},{key:"initLoggerMeta",value:function(){var e,t,n,r,o=null===(e=this._renderParams)||void 0===e?void 0:e.paymentSessionMetaData,i=o.paymentSessionConfig;this.AMSSDK.logger.setMedta({platform:this.platform===oe.desktop?"PC":"WAP",sdkVersion:I,webAppVersion:this._appVersion,instanceId:this.AMSSDK._instanceId,deviceId:this.AMSSDK._storageId,renderDisplayType:null==o?void 0:o.renderDisplayType,merchantId:null==o?void 0:o.clientId,productScene:null==i?void 0:i.productScene,productSceneVersion:null==i?void 0:i.productSceneVersion,paymentMethodType:null==o||null===(t=o.paymentMethodInfoView)||void 0===t?void 0:t.paymentMethodType,paymentMethodCategoryType:null==i?void 0:i.paymentMethodCategoryType,requestSeq:null===(n=this._renderParams)||void 0===n?void 0:n.sessionData,trackId:null===(r=this._renderParams)||void 0===r?void 0:r.sessionData})}},{key:"setRender",value:function(e){this.createIframeNode=e}},{key:"setPreloadRender",value:function(e){this.createPreloadIframeNode=e}},{key:"initSecurity",value:function(){var e,t=this,n=null===(e=this._renderParams)||void 0===e||null===(e=e.paymentSessionMetaData)||void 0===e||null===(e=e.paymentSessionConfig)||void 0===e?void 0:e.productScene;V.CASHIER_PAYMENT_APM!==this._componentSign&&(V.CASHIER_PAYMENT_BANK===this._componentSign&&this.AMSSDK.logger.logInfo({title:"sdk_event_security_unneeded_scenarios"},{productScene:n}),this.AMSSDK._getSecuritySDKByProductScene({product:n})||(this.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkInit"}),this.AMSSDK._newSecuritySDKByScene({product:n},(function(){t.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkInitSuccess"})}),(function(){t.AMSSDK.logger.logError({title:"sdk_error_securitySdkInitFailed"},{sign:"SDK internal initialization"})}))))}},{key:"logDeviceId",value:function(e,t){var n="".concat(Date.now()-t);e?this.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkGetTokenSuccess"},{eventMessage:n}).send():this.AMSSDK.logger.logInfo({title:"sdk_error_securitySdkGetTokenFailed"},{eventMessage:n}).send()}},{key:"getDeviceIdAndLog",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((function(r){setTimeout(u()(l()().mark((function o(){var i,a,s,c,u;return l()().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return a=null===(i=e._renderParams)||void 0===i||null===(i=i.paymentSessionMetaData)||void 0===i||null===(i=i.paymentSessionConfig)||void 0===i?void 0:i.productScene,s=Date.now(),o.next=4,e.AMSSDK._awaitSecuritySDKByProductScene({product:(null==t?void 0:t.productScene)||a});case 4:if(c=o.sent,u="",!c){o.next=18;break}if(!(n&&parseInt(null==t?void 0:t.tokenCollectTime)>0)){o.next=13;break}return o.next=10,c.pollingGetApdidToken(t);case 10:o.t0=o.sent,o.next=16;break;case 13:return o.next=15,c.getApdidToken();case 15:o.t0=o.sent;case 16:u=o.t0,e.logDeviceId(u,s);case 18:r(u);case 19:case"end":return o.stop()}}),o)}))),0)}))}},{key:"appendIframeNodes",value:function(e,t){var n,r,o,i,a,s,l,c,u,d,p,h,m=this;if(this._isInitComponent)return this.dispatchToSDK(_e.error.name,ge.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR),Promise.reject(ge.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR);t=this.setParameterDefaultValues(e,t),this._merchantAppointParam=t.merchantAppointParam,this._isInitComponent=!0,this._renderParams=t,this._componentSign=e,null!==(n=t)&&void 0!==n&&n.selector&&(this._selector=t.selector),this._renderDisplayType=null===(r=t)||void 0===r?void 0:r.renderDisplayType;var f=-1===(null==this||null===(o=this._selector)||void 0===o||null===(i=o.indexOf)||void 0===i?void 0:i.call(o,"#"))?null==this?void 0:this._selector:null==this||null===(a=this._selector)||void 0===a||null===(s=a.slice)||void 0===s?void 0:s.call(a,1),v=null!==(l=t)&&void 0!==l&&l.appendAliasContainerId?"-".concat(f):"",g="".concat(Ee).concat(v),y=(null==this?void 0:this._renderDisplayType)===G.inline?"#".concat(g):null==this?void 0:this._selector;this._isAppWebview=t.isAppWebview,this._isNativeAppWebview=t.isNativeAppWebview,this.initLoggerMeta(),this.initSecurity(),this._performanceData.push({key:"sdk_create_component",value:Date.now()});var _={paymentSessionData:this._renderParams&&(null===(c=this._renderParams)||void 0===c?void 0:c.sessionData)||"",paymentSessionConfig:null===(u=this._renderParams)||void 0===u||null===(u=u.paymentSessionMetaData)||void 0===u?void 0:u.paymentSessionConfig}.paymentSessionConfig||{},b=_.productSceneVersion,E=void 0===b?"":b,S=_.productScene,A=void 0===S?"":S,k=((null===(d=this._renderParams)||void 0===d?void 0:d.paymentSessionMetaData)||{}).action,T=void 0===k?{}:k,P=T.autoDebitWithToken,w=void 0!==P&&P,I=T.requireFastSdk,C=void 0!==I&&I,R=((null===(p=this._renderParams)||void 0===p?void 0:p.paymentSessionMetaData)||{}).authUrlInfo,N=void 0===R?{}:R;if(this.AMSSDK.logger.logInfo({title:"sdk_event_createComponent"},{productScene:this.AMSSDK.options.product}).send(),V.EASY_PAY_WALLET!==this._componentSign||A!==W.EASY_PAY||"1.0"!==E||w||!C){if(V.AUTO_DEBIT_WALLET===this._componentSign){var O,D,L,M=(null===(O=this._renderParams)||void 0===O||null===(O=O.paymentSessionMetaData)||void 0===O?void 0:O.action)||{},x=St()?null==M||null===(D=M.web)||void 0===D?void 0:D.signType:null==M||null===(L=M.wap)||void 0===L?void 0:L.signType,U=(null==M?void 0:M.requireFastSdk)||!1;if("REDIRECT"===x&&!0===U)return void this.handleAuthUrlInfo(N)}if(V.AUTO_DEBIT_PAY_WALLET===this._componentSign)return!0===C&&"1.0"===E?void this.handleAuthUrlInfo(N):Promise.reject({code:ge.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Abnormal response data, interface failure, or unsupported payment method."});if(this.dispatchToSDK(_e.eventCallback.name,{code:ce.SDK_START_OF_LOADING}),this._renderDisplayType===G.inline){var B=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ee,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(document.getElementById(Ne)||is(),!document.getElementById(n||t)){var r=document.createElement("div");r.className="".concat(t,"-inline"),r.id=n||t;var o=document.querySelector("".concat(e));return o&&o.appendChild(r),r}}(this._selector,Ee,g);B&&this.renderInlineLoading(t,B),(K=document.createElement("style")).innerHTML=ds,document.head.appendChild(K)}var K;if(this._renderDisplayType===G.popup){var H,F;ls(this.platform,this.closeBtnFunc.bind(this)),function(e,t,n){var r=e===oe.mobile?"touchend":"click",o=document.createElement("div");o.id=Pe,o.classList.add("".concat(Pe,"-").concat(e)),o.innerHTML='\n <span id="'.concat(Pe,'-title" class="').concat(Pe,"-title-").concat(e,'">\n Are you sure you want to leave?\n </span>\n <span\n id="').concat(Pe,'-sub-title"\n class="').concat(Pe,"-sub-title-").concat(e,'"\n >\n If you leave this page, you\'ll have to start over again.\n </span>\n <div class="').concat(Pe,"-btn-block-").concat(e,'">\n <div id="').concat(Pe,'-remain" class="').concat(Pe,"-remain-").concat(e,'">\n Continue Payment\n </div>\n <div id="').concat(Pe,'-leave" class="').concat(Pe,"-leave-").concat(e,'">\n Leave\n </div>\n </div>'),document.body.appendChild(o);var i=document.getElementById("".concat(Pe,"-remain"));i&&i.addEventListener(r,t);var a=document.getElementById("".concat(Pe,"-leave"));a&&a.addEventListener(r,n)}(this.platform,this.hideRetentionPopupFunc.bind(this),this.retentionPopupLeaveFunc.bind(this));var Y=ts(null===(H=this._renderParams)||void 0===H?void 0:H.paymentSessionMetaData,!0===(null===(F=this._renderParams)||void 0===F?void 0:F.notRedirectAfterComplete)),j=function(){};null!=Y&&Y.allowClickOutsideClose&&(j=this.closeBtnFunc.bind(this));var z=this.closeBtnFunc.bind(this);us({platform:this.platform,onClickOutside:j,closeBtnFunc:z}),this.renderPopupLoading(t)}return this.createApp(t),null!==(h=this._renderParams)&&void 0!==h&&null!==(h=h.paymentSessionMetaData)&&void 0!==h&&null!==(h=h.connectFactor)&&void 0!==h&&h.enableConnect?(this._createLoadAppPromise(),this.createIframeNode(this,y,this._renderDisplayType).then((function(){return Promise.resolve()}))):Promise.all([this.createActionQueryPromise(),this.createSubmitPromise(),this.createIframeNode(this,y,this._renderDisplayType),this._createLoadAppPromise()]).then((function(){return Promise.resolve()})).catch((function(e){return m.AMSSDK.logger.logError({title:"sdk_error_created_app_process_failed"}).send(),m._isInitComponent=!1,m.cleanContainer(),Promise.reject(e)}))}this.handleAuthUrlInfo(N)}},{key:"appendPreloadIframeNodes",value:function(e,t){var n=this.createPreloadApp(e,t);this.createPreloadIframeNode(n),this.AMSSDK.logger.logInfo({title:"performance_optimization_preload"},{productSceneVersion:t})}},{key:"setParameterDefaultValues",value:function(e,t){var n,r=Object.assign({},t);e===V.VAULTING_CARD&&(r.notRedirectAfterComplete=null===(n=null==r?void 0:r.notRedirectAfterComplete)||void 0===n||n);return r}},{key:"renderInlineLoading",value:function(e,t){var n,r,o=null==e||null===(n=e.appearance)||void 0===n?void 0:n.showLoading;o="boolean"!=typeof o||o;var i=e.paymentSessionMetaData.extendInfo,a=!1;try{a=JSON.parse(JSON.parse(i).expressCheckout)}catch(e){}o&&as(t,this.platform,{componentSign:this._componentSign,type:null===(r=this._renderParams)||void 0===r||null===(r=r.appearance)||void 0===r||null===(r=r.layout)||void 0===r?void 0:r.type,isExpressCheckout:a})}},{key:"renderPopupLoading",value:function(e){var t,n=null==e||null===(t=e.appearance)||void 0===t?void 0:t.showLoading;if(n="boolean"!=typeof n||n){var r=document.getElementById(we);r&&(r.style.display="block"),function(){var e=document.createElement("div");null==e||e.classList.add(Ie),e.id=Ie,e.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',e.style.fontSize="".concat(kt(),"px");var t=document.getElementsByTagName("body")[0];null==t||t.appendChild(e)}()}}},{key:"_createLoadAppPromise",value:function(e){var t=this;return new Promise((function(n,r){t._loadAppPromiseResolve=n,setTimeout((function(){r(ge.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT)}),null!=e?e:Me)})).catch((function(e){return t.dispatchToSDK(_e.error.name,ge.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT),t.dispatchToSDK(_e.eventCallback.name,ge.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT),t.AMSSDK.logger.logError({title:"sdk_error_web_app_timeout"}).send(),Promise.reject(e)}))}},{key:"createActionQueryPromise",value:function(){var e=this;return this._performanceData.push({key:"sdk_action_query_start",value:Date.now()}),this._actionQueryPromise=new Promise(function(){var t=u()(l()().mark((function t(n,r){var o,i,a,s,c,u,d,p,h,m,f,v,g,y,_,b,E,S,A,k,T,P,w,I,C,R,N,O,D,L,M,x;return l()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:h={locale:e.AMSSDK.options.locale},m={paymentSessionData:e._renderParams&&(null===(o=e._renderParams)||void 0===o?void 0:o.sessionData)||"",paymentSessionConfig:null===(i=e._renderParams)||void 0===i||null===(i=i.paymentSessionMetaData)||void 0===i?void 0:i.paymentSessionConfig,notRedirectAfterComplete:!0===(null===(a=e._renderParams)||void 0===a?void 0:a.notRedirectAfterComplete),merchantAppointParam:e._merchantAppointParam},f=(null===(s=e._renderParams)||void 0===s?void 0:s.paymentSessionMetaData)||{},v=f.extendInfo,g=void 0===v?"":v,y=f.action,_=!1,b=!1,E=(null===(c=e._renderParams)||void 0===c||null===(c=c.paymentSessionMetaData)||void 0===c?void 0:c.action)||{},S=E.skipSdkQuery,A=E.skipSdkQueryForm;try{k=JSON.parse(g),_=k.enableVaultingApiOptimize||!1,b=k.enableEasypayApiOptimize||!1}catch(e){console.log(e)}if(!Ra()){t.next=9;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 9:if(V.ELEMENT_PAYMENT===e._componentSign&&(m.paymentSessionConfig={productScene:null==(l=m.paymentSessionConfig)?void 0:l.productScene,productSceneVersion:null==l?void 0:l.productSceneVersion}),V.ELEMENT_PAYMENT!==e._componentSign||null==e||null===(u=e._renderParams)||void 0===u||null===(u=u.paymentSessionMetaData)||void 0===u||null===(u=u.connectFactor)||void 0===u||!u.enableConnect){t.next=12;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 12:if(V.ELEMENT_ADDRESS!==e._componentSign){t.next=14;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 14:if(V.VAULTING_CARD!==e._componentSign){t.next=26;break}if(!_){t.next=26;break}if(!A){t.next=23;break}if(!Mt(A,e._appVersion)){t.next=21;break}return n({message:"sdk no need to make query request",success:!0}),t.abrupt("return");case 21:t.next=26;break;case 23:if(!S){t.next=26;break}return n({message:"sdk no need to make query request",success:!0}),t.abrupt("return");case 26:if(null==(T=ts(null===(d=e._renderParams)||void 0===d?void 0:d.paymentSessionMetaData,!0===(null===(p=e._renderParams)||void 0===p?void 0:p.notRedirectAfterComplete)))||!T.usePaymentSessionAsQueryResult){t.next=29;break}return t.abrupt("return",n({autoDebitWithToken:null==y?void 0:y.autoDebitWithToken,amountConfirmRequired:null==y?void 0:y.amountConfirmRequired,success:!0}));case 29:if(V.CASHIER_PAYMENT_CARD!==e._componentSign&&V.VAULTING_CARD!==e._componentSign){t.next=35;break}return m.paymentMethodType="CARD",t.next=33,e.getDeviceIdAndLog();case 33:h.deviceId=t.sent,window.navigator.userAgent.indexOf("miniProgram")>-1&&(h.extendInfo={WAP_SUB_TYPE:"WECHAT_MINI_PROGRAM"});case 35:if(V.EASY_PAY_WALLET!==e._componentSign){t.next=44;break}if(w=m.paymentSessionConfig||{},I=w.productSceneVersion,C=void 0===I?"":I,R=w.productScene,N=void 0===R?"":R,null===(P=e._renderParams)||void 0===P||null===(P=P.paymentSessionMetaData)||void 0===P||null===(P=P.action)||void 0===P||!P.skipSdkQuery||!b){t.next=39;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 39:if(N!==W.EASY_PAY||"2.0"!==C){t.next=41;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 41:return t.next=43,e.getDeviceIdAndLog();case 43:h.deviceId=t.sent;case 44:if(V.AUTO_DEBIT_WALLET!==e._componentSign){t.next=54;break}if(M=(null===(O=e._renderParams)||void 0===O||null===(O=O.paymentSessionMetaData)||void 0===O?void 0:O.action)||{},"SMS"!==(x=St()?null==M||null===(D=M.web)||void 0===D?void 0:D.signType:null==M||null===(L=M.wap)||void 0===L?void 0:L.signType)){t.next=49;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 49:if(x&&"REDIRECT"===x){t.next=51;break}return t.abrupt("return",n({success:!1}));case 51:return t.next=53,e.getDeviceIdAndLog();case 53:h.deviceId=t.sent;case 54:e.AMSSDK.logger.logInfo({title:"sdk_event_sdkQuery"},{paymentSessionConfig:JSON.stringify(m.paymentSessionConfig)}).send(),va(m,{env:e.AMSSDK.options.env.environment,envInfo:h},e.AMSSDK.logger).then((function(t){if(e._performanceData.push({key:"sdk_action_query_end",value:Date.now()}),e.AMSSDK.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{paymentSessionConfig:JSON.stringify(m.paymentSessionConfig)}).send(),V.CASHIER_PAYMENT_CARD===e._componentSign&&(null==t||!t.success)){var o,i={code:ge.CREATECOMPONENT_ERROR.code,message:null==t?void 0:t.errorMessage};if(e.dispatchToSDK(_e.error.name,i),e.dispatchToSDK(_e.eventCallback.name,i),"NONE"===(null==t||null===(o=t.errorActions)||void 0===o?void 0:o.showType))return void r(i)}n(t)})).catch((function(t){if(V.CASHIER_PAYMENT_CARD===e._componentSign&&(e.dispatchToSDK(_e.error.name,ge.CREATECOMPONENT_ERROR.NETWORK_REQUEST_ERROR),e.dispatchToSDK(_e.eventCallback.name,ge.CREATECOMPONENT_ERROR.NETWORK_REQUEST_ERROR)),[V.CASHIER_PAYMENT_CARD,V.VAULTING_CARD,V.CASHIER_PAYMENT_APM].includes(e._componentSign))return n({success:!1});e.dispatchToSDK(_e.error.name,{code:ge.CREATECOMPONENT_ERROR.code}),e.AMSSDK.logger.logError({title:"sdk_event_sdkQuery_failed"},{paymentSessionConfig:JSON.stringify(m.paymentSessionConfig),errorMessage:t}).send(),r(t)}));case 56:case"end":return t.stop()}var l}),t)})));return function(e,n){return t.apply(this,arguments)}}()),this._actionQueryPromise}},{key:"createSubmitPromise",value:function(){var e,t,n,r,o=this;this._performanceData.push({key:"sdk_submit_start",value:Date.now()});var i={paymentSessionData:this._renderParams&&(null===(e=this._renderParams)||void 0===e?void 0:e.sessionData)||"",paymentSessionConfig:null===(t=this._renderParams)||void 0===t||null===(t=t.paymentSessionMetaData)||void 0===t?void 0:t.paymentSessionConfig},a=ts(null===(n=this._renderParams)||void 0===n?void 0:n.paymentSessionMetaData,!0===(null===(r=this._renderParams)||void 0===r?void 0:r.notRedirectAfterComplete));this._actionSubmitPromise=new Promise(function(){var e=u()(l()().mark((function e(t){var n,r,s,c,u,d,p,h,m,f,v,g,y,_,b,E,S,A,k,T,P,w,I,C,R,N,O;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.AMSSDK.options.product!==W.ELEMENT_ADDRESS){e.next=2;break}return e.abrupt("return",t({message:"sdk no need to make submitPay request",success:!0}));case 2:if(c=!1,c=a?!a.submitPayInSdk:!(null!==(u=o._renderParams)&&void 0!==u&&null!==(u=u.paymentSessionMetaData)&&void 0!==u&&null!==(u=u.action)&&void 0!==u&&u.skipSdkQuery)||V.EASY_PAY_WALLET!==o._componentSign,V.EASY_PAY_WALLET===o._componentSign&&(h=i.paymentSessionConfig||{},m=h.productSceneVersion,f=void 0===m?"":m,v=h.productScene,g=void 0===v?"":v,y=(null===(d=o._renderParams)||void 0===d?void 0:d.paymentSessionMetaData)||{},_=y.action,E=(b=void 0===_?{}:_).enableSignAgreement,S=void 0!==E&&E,A=b.autoDebitWithToken,k=void 0!==A&&A,T=(null===(p=o._renderParams)||void 0===p?void 0:p.paymentSessionMetaData)||{},P=T.paymentMethodInfoView,w=(void 0===P?{}:P).paymentMethodType,I=void 0===w?"":w,g!==W.EASY_PAY||"2.0"!==f||k||(C=o._isAppWebview||!1,R=o._isNativeAppWebview||!1,i.signAgreement=S,"ALIPAY_CN"!==I||C&&R||(N=Ia(void 0,o.AMSSDK.logger))&&"https"!==N&&(i.h5FromApp=encodeURIComponent(N)))),o._allowSubmitPayCallAhead=!c,!c){e.next=8;break}return e.abrupt("return",t({message:"sdk no need to make submitPay request",success:!0}));case 8:return o.AMSSDK.logger.logInfo({title:"sdk_event_submitPay"},{paymentSessionConfig:JSON.stringify(i.paymentSessionConfig)}).send(),O=(null==a||null===(n=a.buildSubmitPayExtParams)||void 0===n?void 0:n.call(a,{instanceId:o.AMSSDK._instanceId,locale:o.AMSSDK.options.locale,paymentMethodType:null===(r=o._renderParams.paymentSessionMetaData)||void 0===r||null===(r=r.paymentMethodInfoView)||void 0===r?void 0:r.paymentMethodType,paymentSessionData:o._renderParams.sessionData,paymentSessionObj:o._renderParams.paymentSessionMetaData,env:o.AMSSDK.options.env.environment,sdkVersion:o._appVersion,notRedirectAfterComplete:!0===(null===(s=o._renderParams)||void 0===s?void 0:s.notRedirectAfterComplete)}))||{},i.extParams=O,e.t0=_a,e.t1=i,e.t2=o.AMSSDK.options.env.environment,e.next=16,o.getDeviceIdAndLog();case 16:e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,timeout:15e3,envInfo:e.t4},e.t6=o.AMSSDK.logger,(0,e.t0)(e.t1,e.t5,e.t6).then((function(e){o._performanceData.push({key:"sdk_submit_end",value:Date.now()}),o.AMSSDK.logger.logInfo({title:"sdk_event_submitPayEnd"},{paymentSessionConfig:JSON.stringify(i.paymentSessionConfig)}).send(),t(e)})).catch((function(e){o.AMSSDK.logger.logError({title:"sdk_event_submitPay_failed"},{paymentSessionConfig:JSON.stringify(i.paymentSessionConfig)}).send(),t({success:!1})}));case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}},{key:"cleanElement",value:function(){try{var e;if("string"===ct(this._selector)){var t=document.querySelector(this._selector);t&&(t.innerHTML="")}var n=document.getElementById(Ee);n&&(null==n||n.remove()),null===(e=document.getElementById("".concat(Ee,"-").concat(this.platform,"-animation-style")))||void 0===e||e.remove(),document.getElementsByTagName("body")[0].style.overflow="auto";var r=document.getElementById(we);null==r||r.remove(),this.removeRetentionPopup(this.platform),this.removeEventListener()}catch(e){console.error(e)}}},{key:"createPreloadApp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"1.0",n=Va(e,t),r=e.split(/_(?=[^_]*$)/)[0],o=za({renderDisplayType:G.popup,componentSign:e,analytics:{enabled:!1},productScene:r,productSceneVersion:t,environment:this.AMSSDK.options.env.environment,appVersion:this._appVersion,instanceId:"",isPreload:"true",mid:""}),i=o.path,a=o.locationSearch;return n.src="".concat(i,"?").concat(a),i||this.AMSSDK.logger.logError({title:"performance_optimization_preload_path_error"},{eventMessage:i}),n}},{key:"createApp",value:function(e){if(!0==!!window.postMessage){this._performanceData.push({key:"sdk_popup_start",value:Date.now()});try{var t,n,r,o,i,a,s=(null==e||null===(t=e.paymentSessionMetaData)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productSceneVersion)||"",l=(null==e||null===(n=e.paymentSessionMetaData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene)||"",c=(null==e||null===(r=e.paymentSessionMetaData)||void 0===r?void 0:r.extendInfo)||"",u=null==e||null===(o=e.paymentSessionMetaData)||void 0===o?void 0:o.clientId,d=this.AMSSDK.options.env.environment;this.appDomain=function(e){var t=e.environment,n=e.appVersion,r=e.componentSign,o=e.productScene,i=e.productSceneVersion,a=e.extendInfo,s=e.mid,l=e.elementLink,c=/^https?:\/\/([^/<>\s]+\.?)*/.exec(Ga(t,n,r,o,i,a,s,!1,l));return c&&c[0]||""}({environment:d,appVersion:this._appVersion,componentSign:this._componentSign,productScene:l,productSceneVersion:s,extendInfo:c,mid:u,elementLink:null==e||null===(i=e.elementProps)||void 0===i?void 0:i.elementLink}),this.app=function(e,t){var n=document.createElement("iframe"),r={dropin:"ams-checkout-dropin-".concat(t),component:"ams-checkout-component-".concat(t)}[e]||"ams-checkout-component";return n.id=r,n.style.height="0",n.style.width="100%",n.style.border="0",n.style.opacity="0",n.style.overflow="hidden",n.allow="payment",n}(this.AMSSDK.options.mode,this.platform);var p=((null==e?void 0:e.sessionData)||"").split("&&")[1]||"",h=za({renderDisplayType:e.renderDisplayType,componentSign:this._componentSign,analytics:this.AMSSDK.options.analytics,productScene:l,productSceneVersion:s,environment:d,appVersion:this._appVersion,extendInfo:c,locale:this.AMSSDK.options.locale,instanceId:this.AMSSDK._instanceId,hostSign:p,mid:u,elementLink:null==e||null===(a=e.elementProps)||void 0===a?void 0:a.elementLink}),m=h.path,f=h.locationSearch;this._appLocationSearch=f,-1!==m.indexOf("?")?this.app.src="".concat(m,"&").concat(f):this.app.src="".concat(m,"?").concat(f),this.addEventListener()}catch(e){this.AMSSDK.logger.logError({title:"sdk_error_created_app_failed"}).send(),this.dispatchToSDK(_e.error.name,Object.assign({},ge.SDK_COMPATIBILITY_ISSUES.FAILED_TO_CREATE_IFRAME,{stack:e}))}}else this.dispatchToSDK(_e.error.name,ge.SDK_COMPATIBILITY_ISSUES.BROWSER_NOT_SUPPORT_POSTMESSAGE)}},{key:"listener",value:function(e){var t;if(e.origin===this.appDomain&&"react-devtools-content-script"!==(null===(t=e.data)||void 0===t?void 0:t.source))if(pt(e.data)){var n=JSON.parse(e.data);if(n.name!==ie.APP_TO_SDK&&n.name!==ie.APP_TO_APP||n.instanceId!==this.AMSSDK._instanceId)return;this._handleAppMessage(n)}else console.warn(ge.NOT_JSON_FORMAT),this.dispatchToSDK(_e.error.name,ge.NOT_JSON_FORMAT)}},{key:"resizeListener",value:function(e){var t,n;document.getElementById(Ee).style.transition="none",this.dispatchToApp({context:{event:"renderResize",data:{heightOfVisible:(null==e||null===(t=e.target)||void 0===t?void 0:t.innerHeight)||window.innerHeight,widthOfVisible:(null==e||null===(n=e.target)||void 0===n?void 0:n.innerWidth)||window.innerWidth}}})}},{key:"createDialog",value:(i=u()(l()().mark((function e(t){var n,r,o,i,a;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.url.includes("?")?"".concat(t.url,"&").concat(this._appLocationSearch):"".concat(t.url,"?").concat(this._appLocationSearch),e.prev=1,o=!1,e.next=5,fs({widthPadding:null==t?void 0:t.widthPadding,device:null!==(r=null==t?void 0:t.device)&&void 0!==r?r:this.platform,loadingConfig:null==t?void 0:t.loadingConfig,url:n});case 5:this.popupApp=e.sent,i=setTimeout((function(){if(!o)throw{title:"sdk_error_create_pop_up"}}),Me),a=setTimeout((function(){if(!o)throw{title:"sdk_error_pop_up_time_out"}}),3e3),this.popupApp.onload=function(){o=!0,hs(),clearTimeout(i),clearTimeout(a)},e.next=15;break;case 11:e.prev=11,e.t0=e.catch(1),this.AMSSDK.logger.logError({title:(null===e.t0||void 0===e.t0?void 0:e.t0.title)||"sdk_error_create_pop_up"},{errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message,url:n}),this.dispatchToSDK(_e.error.name,ge.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);case 15:case"end":return e.stop()}}),e,this,[[1,11]])}))),function(e){return i.apply(this,arguments)})},{key:"getDeviceIdAndCallback",value:(o=u()(l()().mark((function e(t){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t||!t.eventCallbackId){e.next=5;break}return e.next=3,this.getDeviceIdAndLog(null==t?void 0:t.data,!0);case 3:n=e.sent,this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:{deviceId:n}}});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"getUserAgentAndCallback",value:(r=u()(l()().mark((function e(t){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t&&t.eventCallbackId)try{this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:{userAgent:window.navigator.userAgent}}})}catch(e){}case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"returnDataAndCallback",value:(n=u()(l()().mark((function e(t){var n,r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null!=t&&t.eventCallbackId&&(r=this._globalData.get(null===(n=t.data)||void 0===n?void 0:n.dataKey),this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:r}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"addEventListener",value:function(){this.removeEventListener(),window["".concat(Re,"_").concat(this.AMSSDK._instanceId)]=this.listener.bind(this),window["".concat(Re,"_").concat(this.AMSSDK._instanceId,"_resize")]=this.resizeListener.bind(this),window.addEventListener("message",window["".concat(Re,"_").concat(this.AMSSDK._instanceId)]),window.addEventListener("resize",window["".concat(Re,"_").concat(this.AMSSDK._instanceId,"_resize")])}},{key:"removeEventListener",value:function(){window.removeEventListener("message",window["".concat(Re,"_").concat(this.AMSSDK._instanceId)]),window.removeEventListener("resize",window["".concat(Re,"_").concat(this.AMSSDK._instanceId,"_resize")])}},{key:"elementEventCallback",value:function(e){var t,n,r;e.context.event===_e.sendMuitiAppEventToSdk.name&&(null===(t=e.context)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.source)===D.PAYMENT_ELEMENT&&(null===(n=e.context)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.target)===D.CONTAINER_ELEMENT&&this.dispatchToSDK(_e.eventCallback.name,null===(r=e.context)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.data)}},{key:"_handleAppMessage",value:function(e){var t,n,r=this;if(Object.keys(_e).map((function(e){return _e[e].name})).includes(e.context.event))if(e.context.event!==_e.getDeviceId.name)if(e.context.event!==_e.getUserAgentFromSdk.name){if(e.context.event===_e.popWindow.name)return o=document.querySelector(".".concat(De,"overlay")),i="desktop"===ms?document.querySelector(".".concat(De,"modal")):document.querySelector(".".concat(De,"modal-mobile")),o.classList.remove("".concat(De,"fadeIn")),o.classList.add("".concat(De,"fadeOut")),"desktop"===ms?(i.classList.remove("".concat(De,"fadeIn")),i.classList.add("".concat(De,"fadeOut"))):(i.classList.remove("".concat(De,"-drawer-enter")),i.classList.add("".concat(De,"-drawer-exit"))),void setTimeout((function(){var e,t;null===(e=o.parentNode)||void 0===e||e.removeChild(o),null===(t=i.parentNode)||void 0===t||t.removeChild(i)}),xe);var o,i,a,s;if(e.context.event!==_e.getGlobalData.name)if(e.context.event!==_e.setGlobalData.name)if(e.context.event!==_e.popupWindow.name){if(e.context.event===_e.sendMuitiAppEventToSdk.name)return this.elementEventCallback(e),void this.dispatchToApp({context:{event:"receiveMuitiAppFromSdk",data:e.context.data}});var l;if(e.context.event===_e.dismissLoading.name)return this.dismissLoadingFunc(!1),void this.dispatchToSDK(_e.eventCallback.name,{code:"SDK_END_OF_LOADING",message:(null===(l=e.context.data)||void 0===l?void 0:l.message)||""});if(e.context.event===_e.launch.name)return this._performanceData.push({key:"sdk_onLaunch",value:Date.now()}),this.AMSSDK.logger.logInfo({title:"sdk_event_webAppOnLaunch"}).send(),this._loadAppPromiseResolve&&this._loadAppPromiseResolve(!0),void this.sendRenderEvent();if(e.context.event===_e.sizeChanged.name&&this.handleSizeChanged(e),e.context.event===_e.close.name)return this.closeBtnFunc();if(e.context.event===_e.redirect.name)return this.handleRedirect(e.context.data);if(e.context.event!==_e.submitForm.name)if(e.context.event!==_e.hideCloseButton.name)if(e.context.event!==_e.showCloseButton.name)if(e.context.event!==_e.setMaskCloseButton.name){if(e.context.event===_e.setAllowRetention.name)return!0===e.context.data&&(this._isRetention=!0),void(!1===e.context.data&&(this._isRetention=!1));if(e.context.event!==_e.declareCheckoutInfo.name)if(e.context.event!==_e.declareEventCallbackInfo.name)if(e.context.event!==_e.appHeartBeat.name)if(e.context.event!==_e.beforeSubmit.name){var c,u,d;if(e.context.event===_e.eventCallback.name&&this.AMSSDK.logger.logInfo({title:"sdk_event_event_callback"}).send(),(null==e||null===(t=e.context)||void 0===t?void 0:t.event)!==_e.getGooglePayToken.name)if(e.context.event===_e.onPollingEnd.name&&this.dispatchToApp({context:{event:"onPollingEnd",data:e.context.data}}),e.context.event===_e.closePaymentPolling.name&&this.dispatchToApp({context:{event:_e.closePaymentPolling.name,data:e.context.data}}),(null==e||null===(n=e.context)||void 0===n?void 0:n.event)!==_e.getApplePayToken.name)if(e.context.event!==_e.validateFieldsResult.name){this.logEventCallback(e,"sdk_event_event_callback");try{this.dispatchToSDK(e.context.event,e.context.data,e.context.eventCallbackId),this.logEventCallback(e,"sdk_event_afterEventCallback")}catch(e){console.error(e)}}else this.AMSSDK._eventCenter.emit(_e.validateFieldsResult.forwardName,e.context);else new rs({paymentSessionData:null===(c=this._renderParams)||void 0===c?void 0:c.sessionData,parseData:null===(u=this._renderParams)||void 0===u?void 0:u.paymentSessionMetaData,logger:this.AMSSDK.logger,env:this.AMSSDK.options.env.environment,shipping:null==e||null===(d=e.context)||void 0===d||null===(d=d.data)||void 0===d?void 0:d.shipping}).startPay().then((function(e){r.dispatchToApp({context:{event:"getApplePayToken",data:{success:!0,result:e}}})})).catch((function(e){r.dispatchToApp({context:{event:"getApplePayToken",data:{success:!1,result:e}}})}));else ns(e).then((function(e){r.dispatchToApp({context:{event:"getGooglePayToken",data:v()({},e)}})})).catch((function(e){r.dispatchToApp({context:{event:"getGooglePayToken",data:{err:e}}})}))}else{var p;if(null!==(p=this.AMSSDK._eventCenter)&&void 0!==p&&p.isExist(_e.beforeSubmit.name))return void this.AMSSDK._eventCenter.emit(_e.beforeSubmit.name,e.context.data);var h=ze();this.dispatchToApp({context:{event:_e.beforeSubmitDone.name,eventCallbackId:h,data:{result:"IGNORE"}}})}else this.handleAppHeartBeat();else this._multipleCallbackEvents=e.context.data;else this.handleDeclareInfo(e.context.data)}else this.handleMaskCloseBtnShow(e.context.data);else this.handleCloseBtnShow(!0);else this.handleCloseBtnShow(!1);else this.submitForm(e.context.data)}else{var m;this.createDialog(null===(m=e.context)||void 0===m?void 0:m.data)}else this._globalData.set(null===(a=e.context.data)||void 0===a?void 0:a.dataKey,null===(s=e.context.data)||void 0===s?void 0:s.data);else this.returnDataAndCallback(e.context)}else this.getUserAgentAndCallback(e.context);else this.getDeviceIdAndCallback(e.context)}},{key:"logEventCallback",value:function(e,t){if(e.context.event===_e.eventCallback.name){var n,r="";try{var o;r=JSON.stringify((null==e||null===(o=e.context)||void 0===o?void 0:o.data)||"")}catch(e){console.error(e)}this.AMSSDK.logger.logInfo({title:t},{callbackData:r,callbackId:(null==e||null===(n=e.context)||void 0===n?void 0:n.eventCallbackId)||""}).send()}}},{key:"dismissLoadingFunc",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=document.getElementById(we);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(Ie))||void 0===e||e.remove()}},{key:"updateMaskCloseBtn",value:function(e){var t=document.getElementById("".concat(Te));if(t)if("desktop"===this.platform){var n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;t.style.top="".concat((n-e.height)/2-42,"px"),t.style.right="".concat((r-e.width)/2+18,"px")}else t.style.bottom="".concat(e.height+2,"px")}},{key:"handleSizeChanged",value:function(e){var t,n,r,o,i,a,s,l,c=-1===(null==this||null===(t=this._renderParams)||void 0===t||null===(t=t.selector)||void 0===t||null===(n=t.indexOf)||void 0===n?void 0:n.call(t,"#"))?null==this||null===(r=this._renderParams)||void 0===r?void 0:r.selector:null==this||null===(o=this._renderParams)||void 0===o||null===(o=o.selector)||void 0===o||null===(i=o.slice)||void 0===i?void 0:i.call(o,1),u=(null==this||null===(a=this._renderParams)||void 0===a?void 0:a.appendAliasContainerId)?"".concat(Ee,"-").concat(c):Ee,d=document.getElementById(u);if(!((null===(s=e.context.data)||void 0===s?void 0:s.height)<=1||e.context.data.height===parseInt(null==d||null===(l=d.style)||void 0===l?void 0:l.height))){if(d.style.height="".concat(e.context.data.height,"px"),this.app.style.opacity="1",this._renderDisplayType===G.popup){if("desktop"===this.platform&&(e.context.data.width&&(d.style.width="".concat(e.context.data.width,"px")),d.classList.add("".concat(Ee,"-").concat(this.platform,"-animation")),this.app.style.height="".concat(e.context.data.height,"px")),"mobile"===this.platform){d.classList.add("".concat(Ee,"-").concat(this.platform,"-animation"));var p="".concat(Ee,"-").concat(this.platform,"-animation-style"),h=document.getElementById(p);h&&(null==h||h.remove()),this.app.style.height=parseInt(this.app.style.height)>0?"100%":"".concat(e.context.data.height,"px");var m=(v=Ee,g=e.context.data.height,"@keyframes ".concat(v,"-slide-in {\n 0% {\n height: 1px;\n }\n 100% {\n height: ").concat(g,"px;\n }\n }\n @keyframes ").concat(v,"-slide-out {\n 0% {\n height: ").concat(g,"px;\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n height: 1px;\n opacity: 0;\n }\n }")),f=document.createElement("style");f.id=p,f.type="text/css",f.innerHTML=m,document.getElementsByTagName("head")[0].appendChild(f),setTimeout((function(){d.style.transition="height 0.28s ease-in-out"}),500)}this.dismissLoadingFunc(),this.updateMaskCloseBtn(e.context.data)}var v,g,y;if(this._renderDisplayType===G.inline)null===(y=document.getElementById(Ie))||void 0===y||y.remove(),this.app.style.height="".concat(e.context.data.height,"px")}}},{key:"handleAuthUrlInfo",value:function(e){var t={};t=null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{normalUrl:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl}:{normalUrl:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl},this.handleRedirect(t,!0)}},{key:"handleRedirect",value:function(e){var t,n,r,o,i,a,s=this,l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c="string"==typeof e?{normalUrl:e}:v()(v()({},e),{},{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(t=null==e?void 0:e.isDestroy)||void 0===t||t,isCallApp:null!==(n=null==e?void 0:e.isCallApp)&&void 0!==n&&n,callAppDetectSuccessDelay:null!==(r=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==r?r:2e3}),u={applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(o=null==e?void 0:e.isDestroy)||void 0===o||o,isCallApp:null!==(i=null==e?void 0:e.isCallApp)&&void 0!==i&&i,callAppDetectSuccessDelay:null!==(a=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==a?a:2e3};this.AMSSDK.logger.logInfo({title:"sdk_event_call_url_start"},{redirectInfo:JSON.stringify(u)}).send();var d=function(e,t,n){s.dispatchToSDK(_e.eventCallback.name,{code:ce.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(e,": ").concat(t)});var r={redirectInfo:JSON.stringify(c),openType:e,url:t,fromFastSdk:l};n&&(r.durationInSeconds=n),s.AMSSDK.logger.logInfo({title:"sdk_event_call_url_success"},r).send()},p=function(e,t,n){s.dispatchToSDK(_e.eventCallback.name,{code:ce.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==c?void 0:c.applinkUrl," schemeUrl: ").concat(null==c?void 0:c.schemeUrl," normalUrl: ").concat(null==c?void 0:c.normalUrl)});var r={redirectInfo:JSON.stringify(c),openType:e,url:t,fromFastSdk:l};n&&(r.durationInSeconds=n),s.AMSSDK.logger.logInfo({title:"sdk_error_call_url_failed"},r).send()};if(c.target===ae.BLANK)return c.normalUrl?(d(ue.NormalUrl,c.normalUrl),void window.open(c.normalUrl)):p(ue.NormalUrl,"");if(!(c.target!==ae.REPLACE||null!=c&&c.applinkUrl||null!=c&&c.schemeUrl))return c.normalUrl?(d(ue.NormalUrl,c.normalUrl),void window.location.replace(c.normalUrl)):p(ue.NormalUrl,"");if(null!=c&&c.isDestroy&&this.cleanContainer(),null!=c&&c.isCallApp&&null!=c&&c.schemeUrl){var h=new Date,m="number"==typeof(null==e?void 0:e.callAppDetectSuccessDelay)?e.callAppDetectSuccessDelay:5e3;this.AMSSDK._redirect({schemeUrl:null==c?void 0:c.schemeUrl,callAppJudgeTime:m}).then((function(){var e=((new Date).getTime()-h.getTime())/1e3;d(ue.SchemeUrl,null==c?void 0:c.schemeUrl,e)})).catch((function(){var e=((new Date).getTime()-h.getTime())/1e3;p(ue.SchemeUrl,c.schemeUrl,e)}))}else this.AMSSDK._redirect({applinkUrl:null==c?void 0:c.applinkUrl}).then((function(){d(ue.ApplinkUrl,null==c?void 0:c.applinkUrl)})).catch((function(){return null!=c&&c.applinkUrl&&p(ue.ApplinkUrl,null==c?void 0:c.applinkUrl),s.AMSSDK._redirect({schemeUrl:null==c?void 0:c.schemeUrl})})).then((function(){d(ue.SchemeUrl,null==c?void 0:c.schemeUrl)})).catch((function(){return null!=c&&c.schemeUrl&&p(ue.SchemeUrl,null==c?void 0:c.schemeUrl),s.AMSSDK._redirect({normalUrl:null==c?void 0:c.normalUrl})})).then((function(){d(ue.NormalUrl,null==c?void 0:c.normalUrl)})).catch((function(){p(ue.NormalUrl,null==c?void 0:c.normalUrl)}))}},{key:"handleDeclareInfo",value:function(e){var t=e.closeDialogData;!function(e){var t=e.closeDialogData,n=void 0===t?{}:t;try{if(n){var r,o,i,a=document.getElementById("".concat(Pe,"-title"));a&&(a.style.fontSize="".concat(null==n||null===(r=n.title)||void 0===r?void 0:r.fontSize,"px"),a.style.color=null==n||null===(o=n.title)||void 0===o?void 0:o.fontColor,a.innerHTML=null==n||null===(i=n.title)||void 0===i?void 0:i.text);var s,l,c,u=document.getElementById("".concat(Pe,"-sub-title"));u&&(u.style.fontSize="".concat(null==n||null===(s=n.message)||void 0===s?void 0:s.fontSize,"px"),u.style.color=null==n||null===(l=n.message)||void 0===l?void 0:l.fontColor,u.innerHTML=null==n||null===(c=n.message)||void 0===c?void 0:c.text);var d,p,h,m,f,v,g,y=document.getElementById("".concat(Pe,"-remain"));y&&(y.innerHTML=null==n||null===(d=n.btnOK)||void 0===d?void 0:d.text,y.style.fontSize="".concat(null==n||null===(p=n.btnOK)||void 0===p?void 0:p.fontSize,"px"),y.style.color=null==n||null===(h=n.btnOK)||void 0===h?void 0:h.fontColor,y.style.borderRadius="".concat(null==n||null===(m=n.btnOK)||void 0===m?void 0:m.corner,"px"),"stroke"===(null==n||null===(f=n.btnOK)||void 0===f?void 0:f.type)?y.style.border="1px solid ".concat(null==n||null===(g=n.btnOK)||void 0===g?void 0:g.bg):y.style.backgroundColor=null==n||null===(v=n.btnOK)||void 0===v?void 0:v.bg);var _,b,E,S,A,k,T,P=document.getElementById("".concat(Pe,"-leave"));P&&(P.innerHTML=null==n||null===(_=n.btnCancel)||void 0===_?void 0:_.text,P.style.fontSize="".concat(null==n||null===(b=n.btnCancel)||void 0===b?void 0:b.fontSize,"px"),P.style.color=null==n||null===(E=n.btnCancel)||void 0===E?void 0:E.fontColor,P.style.borderRadius="".concat(null==n||null===(S=n.btnCancel)||void 0===S?void 0:S.corner,"px"),"stroke"===(null==n||null===(A=n.btnCancel)||void 0===A?void 0:A.type)?P.style.border="1px solid ".concat(null==n||null===(T=n.btnCancel)||void 0===T?void 0:T.bg):P.style.backgroundColor=null==n||null===(k=n.btnCancel)||void 0===k?void 0:k.bg)}}catch(e){console.error(e)}}({closeDialogData:void 0===t?{}:t})}},{key:"handleDeclarePopWindowCallback",value:function(){var e="popWindowEventInfo";if(this._multipleCallbackEvents&&e in this._multipleCallbackEvents){var t=this._multipleCallbackEvents[e];t.enableCallback&&this.dispatchToSDK(_e.eventCallback.name,{code:t.eventName,result:{result:t.eventResult||{}}})}else console.log("not valid ".concat(e," in "),this._multipleCallbackEvents)}},{key:"handleAppHeartBeat",value:function(){var e=this;try{this._webAppHeartBeatTimeoutFn||(this._webAppHeartBeatTimeoutFn=function(){e.isAppAttached()&&e.AMSSDK.logger.logError({title:"sdk_error_appHeartBeatTimeout"})}),window._webAppHeartBeatTimeoutId&&(clearTimeout(window._webAppHeartBeatTimeoutId),window._webAppHeartBeatTimeoutId=null),this._webAppHeartBeatTimeoutFn&&(window._webAppHeartBeatTimeoutId=setTimeout(this._webAppHeartBeatTimeoutFn,6e3)),setTimeout((function(){e.isAppAttached()&&e.dispatchToApp({context:{event:"sdkHeartBeat",data:{}}})}),1e3)}catch(e){this.AMSSDK.logger.logError({title:"sdk_error_handleAppHeartBeat"},{errorMessage:e.message})}}},{key:"isAppAttached",value:function(){return this.app||this.popupApp}},{key:"isWindowVisible",value:function(){var e;return"visible"===(null===(e=document)||void 0===e?void 0:e.visibilityState)}},{key:"handleCloseBtnShow",value:function(e){var t=document.getElementById(ke);e?null==t||t.classList.remove("".concat(ke,"-hidden")):!1===e&&(null==t||t.classList.add("".concat(ke,"-hidden")))}},{key:"handleMaskCloseBtnShow",value:function(e){var t=document.getElementById(Te);"show"===(null==e?void 0:e.status)?null==t||t.classList.remove("".concat(Te,"-hidden")):null==t||t.classList.add("".concat(Te,"-hidden"))}},{key:"dispatchToSDK",value:function(e,t,n){this.AMSSDK._eventCenter.emit(e,t),n&&this.AMSSDK._eventCenter.emit(n,t)}},{key:"dispatchToApp",value:function(e){var t,n,r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=Object.assign({},e,{name:ie.SDK_TO_APP,mode:this.AMSSDK.options.mode,appId:ye,instanceId:this.AMSSDK._instanceId});if(i&&i.contentWindow)return i.contentWindow.postMessage(JSON.stringify(a),"*");if(this.app||this.popupApp)return(null==this||null===(t=this.app)||void 0===t?void 0:t.contentWindow)&&(null==this||null===(n=this.app)||void 0===n||n.contentWindow.postMessage(JSON.stringify(a),this.appDomain)),void((null==this||null===(r=this.popupApp)||void 0===r?void 0:r.contentWindow)&&(null==this||null===(o=this.popupApp)||void 0===o||o.contentWindow.postMessage(JSON.stringify(a),"*")));throw new Error(ge.SDK_SUBMIT_ERROR.message)}},{key:"subscribeFromSDK",value:function(){var e={};for(var t in e)e.hasOwnProperty(t)&&this.AMSSDK._eventCenter.on("".concat(ye,"-").concat(t),e[t].bind(this))}},{key:"sendRenderEvent",value:(t=u()(l()().mark((function e(){var t,n,r,o,i,a,s,c,u,d,p,h,m,f,g,y,_,b,E;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,_=this.AMSSDK.options.product===W.ELEMENT_ADDRESS,this._actionQueryPromise&&this._actionSubmitPromise||_){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,this._actionQueryPromise;case 6:return b=e.sent,e.next=9,this._actionSubmitPromise;case 9:E=e.sent,this._hasRenderComponent=!0,this._performanceData.push({key:"sdk_render_component",value:Date.now()}),this.dispatchToApp({context:{event:"renderComponent",data:{queryResult:b,submitResult:E,sessionResult:null===(t=this._renderParams)||void 0===t?void 0:t.paymentSessionMetaData,paymentSessionData:null===(n=this._renderParams)||void 0===n?void 0:n.sessionData,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:null===(r=this._renderParams)||void 0===r?void 0:r.renderDisplayType,appearance:null===(o=this._renderParams)||void 0===o?void 0:o.appearance,notRedirectAfterComplete:!0===(null===(i=this._renderParams)||void 0===i?void 0:i.notRedirectAfterComplete),isAppWebview:this._isAppWebview,isNativeAppWebview:this._isNativeAppWebview,merchantAppointParam:this._merchantAppointParam,allowSubmitPayCallAhead:this._allowSubmitPayCallAhead,configParams:null===(a=this._renderParams)||void 0===a?void 0:a.configParams,prefillValue:null===(s=this._renderParams)||void 0===s?void 0:s.prefillValue,componentSession:null===(c=this._renderParams)||void 0===c?void 0:c.componentSession,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:v()(v()({trackId:null===(u=this._renderParams)||void 0===u?void 0:u.sessionData,platform:this.platform,firstLogTime:null===(d=this.AMSSDK.logger)||void 0===d?void 0:d.getComponentStartTime()},(null===(p=this._renderParams)||void 0===p||null===(p=p.paymentSessionMetaData)||void 0===p?void 0:p.paymentSessionConfig)||{}),{},{renderDisplayType:null===(h=this._renderParams)||void 0===h?void 0:h.renderDisplayType,sdkVersion:this._appVersion,merchantId:null===(m=this._renderParams)||void 0===m||null===(m=m.paymentSessionMetaData)||void 0===m?void 0:m.clientId,instanceId:null===(f=this.AMSSDK)||void 0===f?void 0:f._instanceId,performanceData:this._performanceData,paymentMethodType:null===(g=this._renderParams)||void 0===g||null===(g=g.paymentSessionMetaData)||void 0===g||null===(g=g.paymentMethodInfoView)||void 0===g?void 0:g.paymentMethodType,skipRenderPaymentMethod:null===(y=this._renderParams)||void 0===y||null===(y=y.paymentSessionMetaData)||void 0===y?void 0:y.skipRenderPaymentMethod})}}},null),this.AMSSDK.logger.logInfo({title:"sdk_event_renderComponent"}),this.dispatchToApp({context:{event:"web-sdk-performance",data:{performanceData:this._performanceData}}}),e.next=19;break;case 17:e.prev=17,e.t0=e.catch(0);case 19:case"end":return e.stop()}}),e,this,[[0,17]])}))),function(){return t.apply(this,arguments)})},{key:"cleanContainer",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=document.getElementById(Te))||void 0===e||e.remove(),null===(t=document.getElementById(Ie))||void 0===t||t.remove(),this.hideComponentAnimation();var o=document.getElementById(we);null==o||o.classList.add("".concat(we,"-hidden")),this._loadAppPromiseResolve&&this._loadAppPromiseResolve(!0),this._performanceData=[],this._isInitComponent=!1,this.app=null,this._hasRenderComponent=!1,r?this.cleanElement():setTimeout((function(){n.cleanElement()}),300)}},{key:"hideComponentAnimation",value:function(){var e,t,n,r,o,i,a,s=-1===(null==this||null===(e=this._renderParams)||void 0===e||null===(e=e.selector)||void 0===e||null===(t=e.indexOf)||void 0===t?void 0:t.call(e,"#"))?null==this||null===(n=this._renderParams)||void 0===n?void 0:n.selector:null==this||null===(r=this._renderParams)||void 0===r||null===(r=r.selector)||void 0===r||null===(o=r.slice)||void 0===o?void 0:o.call(r,1),l=null!=this&&null!==(i=this._renderParams)&&void 0!==i&&i.appendAliasContainerId?"-".concat(s):"",c="".concat(Ee).concat(l),u=document.getElementById(c);this.app&&u&&(this.app.style.height=null==u||null===(a=u.style)||void 0===a?void 0:a.height),u&&(u.style.transition="",null==u||u.classList.remove("".concat(c,"-").concat(this.platform)),null==u||u.classList.remove("".concat(c,"-").concat(this.platform,"-animation")),null==u||u.classList.add("".concat(c,"-hidden-").concat(this.platform)))}},{key:"closeBtnFunc",value:function(){this._isRetention?this.showRetentionPopup():(this.cleanContainer(),this.dispatchToSDK(_e.close.name,{}),this.handleDeclarePopWindowCallback())}},{key:"retentionPopupLeaveFunc",value:function(){this.dispatchToSDK(_e.close.name,{}),this.hideRetentionPopupFunc(),this.cleanContainer(),this.handleDeclarePopWindowCallback()}},{key:"removeRetentionPopup",value:function(e){!function(e,t,n){var r,o=e===oe.mobile?"touchend":"click",i=document.getElementById("".concat(Pe,"-remain"));i&&i.removeEventListener(o,t);var a=document.getElementById("".concat(Pe,"-leave"));a&&a.removeEventListener(o,n),null===(r=document.getElementById(Pe))||void 0===r||r.remove()}(e,this.hideRetentionPopupFunc.bind(this),this.retentionPopupLeaveFunc.bind(this))}},{key:"showRetentionPopup",value:function(){var e=document.getElementById(Pe),t=document.getElementById(Ee);e&&(null==t||t.classList.add("".concat(Ee,"-opacity")),e.classList.remove("".concat(Pe,"-hidden")),e.classList.add("".concat(Pe,"-show")))}},{key:"hideRetentionPopupFunc",value:function(){var e,t;e=document.getElementById(Pe),t=document.getElementById(Ee),e&&(e.classList.remove("".concat(Pe,"-show")),e.classList.add("".concat(Pe,"-hidden")),setTimeout((function(){e.classList.remove("".concat(Pe,"-hidden")),null==t||t.classList.remove("".concat(Ee,"-opacity"))}),xe))}},{key:"submitForm",value:function(e){var t=e.attributes,n=document.body,r=document.createElement("form");r.setAttribute("height","1"),r.setAttribute("width","1"),Object.keys(t.data).forEach((function(e){var n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t.data[e]),r.appendChild(n)})),r.setAttribute("action",t.action),r.setAttribute("method","post"),n.appendChild(r),setTimeout((function(){r.submit()}),0)}},{key:"shouldValidateFields",value:function(){return this._hasRenderComponent}}]),e}(),bs=[{sessionMatcher:{productScene:W.CASHIER_PAYMENT,productSceneVersion:pe.V1,paymentMethodCategoryType:q.CARD,paymentMethodTypes:["APPLEPAY"]},paymentChannelMatcher:{paymentMethod:"ApplePay"},busActionNames:{canMakePayments:Pn.canMakePayments,optional_init:Tn.optional_init,createComponent:Pn.createComponent,destroyComponent:Pn.destroyComponent}},{sessionMatcher:{productScene:W.CASHIER_PAYMENT,productSceneVersion:pe.V1,paymentMethodCategoryType:q.APM,paymentMethodTypes:[de.PAYPAL_CHECKOUT,de.PAYPAL_PAYLATER,de.PAYPAL_VAULT]},paymentChannelMatcher:{paymentMethod:"Paypal"},busActionNames:{mountComponent:wn.mountComponent,destroyComponent:wn.destroyComponent}}],Es=function(e){return"boolean"!=typeof e||e},Ss=function(e){S()(n,e);var t=k()(n);function n(e){var r;return b()(this,n),r=t.call(this),p()(et()(r),"logger",void 0),p()(et()(r),"onEventCallback",(function(e){Qe.publish(new We(In.onEventCallback,JSON.stringify(e)))})),p()(et()(r),"appendPaypalLoading",(function(e){var t=e.selector;if(!document.querySelector(".paypal-loading")){var n=document.querySelector(t);n.innerHTML="";var r=document.createElement("div");r.className="paypal-loading",r.style.backgroundColor="#EBEBEB",r.style.width="100%",r.style.height="64px",r.style.borderRadius="4px";var o=document.createElement("div");o.style.position="absolute",o.style.top="50%",o.style.left="50%",o.style.transform="translate(-50%, -50%)",r.style.maxWidth="750px",r.style.position="relative",function(e){var t=e.htmlElement,n=e.loadingHeight,r=e.loadingWidth,o=document.createElement("img");o.src="https://mdn.alipayobjects.com/huamei_saktgs/afts/img/A*vmqbT6W9g4oAAAAAAAAAAAAADviCAQ/original",o.classList.add("atom-loading"),o.style.width=r,o.style.height=n,o.style.animation="loadingSpin 0.8s linear infinite";var i=document.createElement("style");i.textContent="\n @keyframes loadingSpin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n ",document.head.appendChild(i),t&&t.appendChild(o)}({htmlElement:o,loadingWidth:"25px",loadingHeight:"25px"}),r.appendChild(o),n.appendChild(r)}})),p()(et()(r),"removePaypalLoading",(function(){var e=document.querySelector(".paypal-loading");e&&e.remove()})),p()(et()(r),"preCheck",(function(e){var t,n,o=null===(t=e.paymentSessionFactor)||void 0===t||null===(t=t.paymentMethodInfo)||void 0===t||null===(t=t.paymentMethodMetaData)||void 0===t?void 0:t.boundPaymentMethod,i=null===(n=e.paymentSessionFactor)||void 0===n||null===(n=n.paymentMethodInfo)||void 0===n?void 0:n.paymentMethodType;return o&&de.PAYPAL_VAULT===i&&r.onEventCallback({code:ce.SDK_PAYMENT_WARN,message:"You can directly request the server interface without antom-sdk."}),Promise.resolve(e)})),p()(et()(r),"loadPaypalResource",(function(e){return new Promise((function(t,n){var o;Es(null===(o=e.appearance)||void 0===o?void 0:o.showLoading)&&r.appendPaypalLoading({selector:e.selector});var i=r.createPaypalScript(e);document.body.appendChild(i),i.onload=function(){t("loading successfully")},i.onerror=function(e){n(e)}}))})),p()(et()(r),"createPaypalScript",(function(e){var t,n,r,o,i=null===(t=e.paymentSessionFactor)||void 0===t||null===(t=t.merchantInfo)||void 0===t?void 0:t.channelMerchantClientId,a=null===(n=e.paymentSessionFactor)||void 0===n||null===(n=n.paypal)||void 0===n?void 0:n.accessToken,s=e.locale||"en_US",l=null===(r=e.paymentSessionFactor)||void 0===r||null===(r=r.paymentAmount)||void 0===r?void 0:r.currency,c=null===(o=e.paymentSessionFactor)||void 0===o||null===(o=o.paymentMethodInfo)||void 0===o?void 0:o.paymentMethodType,u=(null==e?void 0:e.paypalConfiguration)||{},d=u.blockPayPalCreditButton,p=u.blockPayPalPayLaterButton,h=u.displayPayPalPayLaterButtonOnly,m=u.enableMessages,f=u.intent,v=document.createElement("script"),g="https://www.paypal.com/sdk/js?",y=new URLSearchParams({currency:l,locale:s,"client-id":i}),_=["bancontact","blik","eps","giropay","ideal","mercadopago","mybank","p24","sepa","sofort"];return d&&!h&&_.push("card"),p&&!h&&_.push("credit"),_.length&&y.append("disable-funding",_.join(",")),m?y.append("components","messages,buttons"):y.append("components","buttons"),J.intent===f&&de.PAYPAL_CHECKOUT===c&&(y.append("intent","authorize"),y.append("commit","false")),de.PAYPAL_VAULT===c&&y.append("vault","true"),g+=y.toString(),v.src=g,v.setAttribute("data-user-id-token",a),v})),p()(et()(r),"onShippingChange",function(){var e=u()(l()().mark((function e(t){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:ce.SDK_PAYMENT_SHIPPINGCHANGE,result:{data:t}});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),p()(et()(r),"createOrder",function(){var e=u()(l()().mark((function e(t,n,o,i,a){var s,c;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,va({paymentSessionData:o,paymentSessionConfig:a},{env:i,timeout:15e3},r.logger);case 2:if(null!=(c=e.sent)&&c.success&&null!=c&&null!==(s=c.extendInfo)&&void 0!==s&&s.channelOrderId){e.next=7;break}return r.logger.logInfo({title:"paypal_payment_failed"}),r.onEventCallback({code:ce.SDK_PAYMENT_FAIL,message:(null==c?void 0:c.errorMessage)||"Create order failed."}),e.abrupt("return");case 7:return e.abrupt("return",c.extendInfo.channelOrderId);case 8:case"end":return e.stop()}}),e)})));return function(t,n,r,o,i){return e.apply(this,arguments)}}()),p()(et()(r),"onApprove",function(){var e=u()(l()().mark((function e(t){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:ce.SDK_PAYMENT_APPROVE,result:{onApproveData:t}}),r.logger&&It(r.logger.logInfo)&&r.logger.logInfo({title:"paypal_payment_approved"});case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),p()(et()(r),"onCancel",function(){var e=u()(l()().mark((function e(t){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:ce.SDK_PAYMENT_CANCEL,result:{orderId:t}}),r.logger&&It(r.logger.logInfo)&&r.logger.logInfo({title:"paypal_payment_cancelled"});case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),p()(et()(r),"destroyComponent",function(){var e=u()(l()().mark((function e(t,n){var o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=n.getJSONObject(),r.logger.logInfo({title:"sdk_event_clean_component"}).send(),document.querySelector(null==o?void 0:o.selector)&&(document.querySelector(null==o?void 0:o.selector).innerHTML="",console.log("paypal: destroy Component"));case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.logger=e,r}return y()(n,[{key:"actionNames",value:function(){return Object.values(wn)}},{key:"renderPaypalButton",value:function(e,t){var n,r,o,i,a,s,l,c,u=this,d=t.getJSONObject(),p={locale:null===(n=d.options)||void 0===n?void 0:n.locale,environment:null===(r=d.options)||void 0===r?void 0:r.environment,paymentSessionData:null===(o=d.appendParams)||void 0===o||null===(o=o.iframeNodesParams)||void 0===o?void 0:o.sessionData,paymentSessionFactor:null===(i=d.appendParams)||void 0===i||null===(i=i.iframeNodesParams)||void 0===i||null===(i=i.paymentSessionMetaData)||void 0===i?void 0:i.paymentSessionFactor,selector:null===(a=d.appendParams)||void 0===a||null===(a=a.iframeNodesParams)||void 0===a?void 0:a.selector,paypalConfiguration:null===(s=d.appendParams)||void 0===s||null===(s=s.iframeNodesParams)||void 0===s?void 0:s.paypalConfiguration,appearance:null===(l=d.appendParams)||void 0===l||null===(l=l.iframeNodesParams)||void 0===l?void 0:l.appearance,paymentSessionConfig:null===(c=d.appendParams)||void 0===c||null===(c=c.iframeNodesParams)||void 0===c||null===(c=c.paymentSessionMetaData)||void 0===c?void 0:c.paymentSessionConfig};return this.preCheck(p).then((function(e){return u.loadPaypalResource(e).then((function(){var t,n,r={style:v()({layout:"vertical",color:"gold",shape:"rect"},(null===(t=e.paypalConfiguration)||void 0===t?void 0:t.style)||{}),fundingSource:void 0,onShippingChange:u.onShippingChange,createOrder:function(t,n){return u.createOrder(t,n,e.paymentSessionData,e.environment,e.paymentSessionConfig)},onApprove:u.onApprove,onCancel:u.onCancel};null!==(n=e.paypalConfiguration)&&void 0!==n&&n.displayPayPalPayLaterButtonOnly&&(r.fundingSource=window.paypal.FUNDING.PAYLATER);try{window.paypal.Buttons(r).render(e.selector)}catch(e){return u.logger.logError({title:"button_render_failed"},{errorMessage:e}),u.onEventCallback({code:ce.SDK_PAYMENT_FAIL,message:"Button render failed."}),Promise.reject(e)}})).catch((function(e){return u.logger.logError({title:"paypal_payment_loadSDK_failed"}),u.onEventCallback({code:ce.SDK_PAYMENT_FAIL,message:"Loading paypal sdk failed."}),Promise.reject(e)})).finally((function(){var t;Es(null===(t=e.appearance)||void 0===t?void 0:t.showLoading)&&u.removePaypalLoading()}))}))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case wn.mountComponent:this.renderPaypalButton(e,t);break;case wn.destroyComponent:this.destroyComponent(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(Je),As=function(e,t,n){return new Promise((function(r,o){var i=null;if("string"===ct(t)&&(i=document.querySelector(t)),null===i){var a={code:ge.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Failed to execute 'querySelector' on 'Document': ".concat(t," is not a valid selector")};return o(a),void e._dispatchToSDK({name:ie.APP_TO_SDK,instanceId:e.AMSSDK._instanceId,context:{event:_e.error.name,data:a}})}n===G.popup&&(i.innerHTML=""),e.app&&i.appendChild(e.app),r()}))},ks=function(e){var t=document.body||null;t&&t.appendChild(e)},Ts=function(e){S()(n,e);var t=k()(n);function n(e){var r;return b()(this,n),r=t.call(this),p()(et()(r),"_onEventCallback",void 0),r._onEventCallback=e,r}return y()(n,[{key:"actionNames",value:function(){return Object.values(In)}},{key:"onEventCallback",value:function(e){var t=e.getJSONObject();console.log("onEventCallback",e),this._onEventCallback&&t&&this._onEventCallback(t)}},{key:"onMessage",value:function(e,t){if(t.getAction()===In.onEventCallback)this.onEventCallback(t);else console.log("Unknown action: "+t.getAction())}}]),n}(Je),Ps=function(e){S()(r,e);var t,n=k()(r);function r(e){var t;return b()(this,r),t=n.call(this),p()(et()(t),"_onDeviceIdCallback",void 0),t._onDeviceIdCallback=e,t}return y()(r,[{key:"actionNames",value:function(){return Object.values(Cn)}},{key:"getSecurityDeviceId",value:(t=u()(l()().mark((function e(t,n){var r,o,i;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log("getSecurityDeviceId",n),!this._onDeviceIdCallback){e.next=22;break}if(r=n.getJSONObject(),e.prev=3,!r||null==r||!r.deviceIdParameter){e.next=11;break}return e.next=7,this._onDeviceIdCallback(null==r?void 0:r.deviceIdParameter,!0===(null==r?void 0:r.isPolling));case 7:o=e.sent,null==t||t.onCallBack(n.result(null!=o?o:"")),e.next=15;break;case 11:return e.next=13,this._onDeviceIdCallback();case 13:i=e.sent,null==t||t.onCallBack(n.result(null!=i?i:""));case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(3),null==t||t.onCallBack(n.result(""));case 20:e.next=23;break;case 22:null==t||t.onCallBack(n.result(""));case 23:case"end":return e.stop()}}),e,this,[[3,17]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===Cn.getSecurityDeviceId)this.getSecurityDeviceId(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(Je),ws=function(e){S()(r,e);var t,n=k()(r);function r(e){var t;return b()(this,r),t=n.call(this),p()(et()(t),"logger",void 0),t.logger=e,t}return y()(r,[{key:"actionNames",value:function(){return Object.values(Rn)}},{key:"reportAnalytics",value:(t=u()(l()().mark((function e(t,n){var r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("reportAnalytics",n),r=n.getJSONObject(),this.logger&&null!=r&&r.basic&&("error"===(null==r?void 0:r.level)?this.logger.logError(null==r?void 0:r.basic,null==r?void 0:r.extra):this.logger.logInfo(null==r?void 0:r.basic,null==r?void 0:r.extra));case 3:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===Rn.reportAnalytics)this.reportAnalytics(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(Je),Is=window.navigator.userAgent||"",Cs=function(){var e=Is.match(/OS (\d+)_(\d+)_?(\d+)?/);return Number.parseInt(e[1],10)},Rs=/android/i.test(Is),Ns=/iphone|ipad|ipod/i.test(Is),Os=/chrome\/[\d.]+ mobile safari\/[\d.]+/i.test(Is)&&Rs&&Is.indexOf("Version")<0,Ds=/qqbrowser/i.test(Is),Ls=/firefox/i.test(Is);/baidubrowser/i.test(Is);function Ms(e){window.location.href=e}function xs(e){var t=document.createElement("a");t.setAttribute("href",e),t.style.display="none",document.body.appendChild(t);var n=document.createEvent("HTMLEvents");n.initEvent("click",!1,!1),t.dispatchEvent(n)}function Us(){vs||((vs=document.createElement("iframe")).id="callapp_iframe_".concat(Date.now()),vs.style.cssText="display:none;border:0;width:0;height:0;",document.body.appendChild(vs))}function Bs(e){vs.src=e}function Ks(e,t){return function(e,t){var n=new URL(e);for(var r in t)r&&n.searchParams.set(r,t[r]);return n.toString()}(e,t)}function Hs(e,t,n){var r="";n&&(r="S.browser_fallback_url=".concat(encodeURIComponent(n),";"));var o=e.substring(0,e.indexOf("://")),i=t?"#Intent;scheme=".concat(o,";package=").concat(t,";"):"#Intent;scheme=".concat(o,";"),a=e.replace(/.*?:\/\//,"intent://");return"".concat(a+i+r,"end")}var Fs,Ys,js,Gs=5e3;function zs(e,t){Fs=+new Date,Ys=setTimeout((function(){!(!!gs&&document[gs])&&e&&e()}),t||5e3)}function Vs(e){void 0!==ys?document.addEventListener(ys,(function(){return Ws(e)})):window.addEventListener("pagehide",(function(){return Ws(e)}))}function Ws(e){var t=e.evokeAppBy;(null==t?void 0:t.url)&&(!function(e){var t=e.evokeAppBy,n=e.successCb,r=e.timeout;if(n){var o=+new Date,i=r||Gs;o-(Fs||+new Date)<i&&n(t)}}(e),Ys&&clearTimeout(Ys))}function qs(e){return/^(http|https|itms-apps|itms-appss|market):\/\//.test(e)}function Js(e){return Js="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Js(e)}function Qs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qs(Object(n),!0).forEach((function(t){Xs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Xs(e,t,n){return(t=el(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,el(r.key),r)}}function el(e){var t=function(e,t){if("object"!==Js(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Js(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Js(t)?t:String(t)}!function(e){void 0!==e&&(void 0!==e.hidden?(gs="hidden",ys="visibilitychange"):void 0!==e.mozHidden?(gs="mozHidden",ys="mozvisibilitychange"):void 0!==e.msHidden?(gs="msHidden",ys="msvisibilitychange"):void 0!==e.webkitHidden&&(gs="webkitHidden",ys="webkitvisibilitychange"))}(document),function(e){e.SCHEME="Scheme",e.LINK="Link",e.INTENT="Intent"}(js||(js={}));var tl=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=void 0,this.timer=void 0,this.options=void 0,this.evokeAppBy=void 0,this.handleDegradationStrategy=function(){var e=n.options,t=e.scheme,r=e.link,o=e.intent,i=e.params;r&&t?(n.options.link=Ks(r,i),n.options.scheme=Ks(t,i),Ns&&Cs()>9?n.evokeLink():n.evokeScheme(n.evokeLink.bind(n))):r?(n.options.link=Ks(r,i),n.evokeLink()):t?(n.options.scheme=Ks(t,i),n.evokeScheme()):o&&o.scheme&&o.package&&n.handleIntent()};this.config=Zs(Zs({},{delay:0}),t),this.options={},this.timer=null,this.evokeAppBy={url:"",type:js.LINK},this.init()}var t,n,r;return t=e,(n=[{key:"init",value:function(){Us(),Vs({evokeAppBy:this.evokeAppBy,successCb:this.config.successCb,timeout:this.config.resultJudgmentTime})}},{key:"open",value:function(e){this.options=e;var t=this.options,n=t.scheme,r=t.intent,o=t.link;if(!n&&!o&&!(null==r?void 0:r.scheme))throw new Error("请至少填一个链接");if(n&&qs(n))throw new Error("请填写正确格式的scheme");if(o&&!qs(o))throw new Error("请填写正确格式的link");if(r&&r.scheme&&qs(r.scheme))throw new Error("请填写正确格式的intent");this.handleDegradationStrategy()}},{key:"evokeLink",value:function(){this.evokeAppBy.type=js.LINK;var e=this.options,t=e.link,n=e.delay;this.evokeByLocationDelay(t,n)}},{key:"evokeScheme",value:function(e){this.evokeAppBy.type=js.SCHEME;var t=this.options,n=t.scheme,r=t.delay,o=t.fallback;Ns?Cs()>9||Ds?this.evokeByTagADelay(n,r,o,e):this.evokeByIFrameDelay(n,r,o,e):Os||Ls?this.handleOriginalChrome():this.evokeByIFrameDelay(n,r,o,e)}},{key:"handleIntent",value:function(){var e,t=this,n=this.options,r=n.scheme,o=n.intent,i=n.delay,a=n.link,s=n.fallback,l=(null==o?void 0:o.scheme)||r;l&&!qs(l)&&(this.evokeAppBy.type=js.INTENT,a&&(e=function(){return t.evokeLink()}),this.evokeByLocationDelay(Hs(l,null==o?void 0:o.package,(null==o?void 0:o.fallbackUrl)||""),i,s,e))}},{key:"handleOriginalChrome",value:function(){this.handleIntent()}},{key:"evokeAppDelay",value:function(e,t,n,r,o){var i=this,a=n||this.config.delay,s=r||this.config.fallback;this.timer=setTimeout((function(){i.clearTimer(),e(),i.checkIsOpen(t,s,o)}),a)}},{key:"evokeByLocationDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return Ms(e)}),e,t,n,r)}},{key:"evokeByTagADelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return xs(e)}),e,t,n,r)}},{key:"evokeByIFrameDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return Bs(e)}),e,t,n,r)}},{key:"checkIsOpen",value:function(e,t,n){return this.evokeAppBy.url=e,zs(n||t,this.config.resultJudgmentTime)}},{key:"clearTimer",value:function(){this.timer&&clearTimeout(this.timer)}}])&&$s(t.prototype,n),r&&$s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),nl=function(){function e(t){b()(this,e),p()(this,"options",void 0),p()(this,"originOptions",void 0),p()(this,"logger",void 0),p()(this,"_eventCenter",void 0),p()(this,"_instanceId",void 0),p()(this,"_storageId",void 0),p()(this,"_appendParams",void 0),p()(this,"_componentApp",void 0),p()(this,"securitySdkMap",void 0),p()(this,"plugins",void 0),this._instanceId=ze(),this.originOptions=t,this.options={},this._eventCenter=new ut,this._initEvent(t),this._setOptions(t),this.plugins=new Map,this.securitySdkMap=new Map;var n="AMSSDK_STORAGE_ID",r=wt(n);r||(wt(n,this._instanceId),r=this._instanceId),this._storageId=r,this.logger=new Ha(Fa,![te.prod,te.sandbox].includes(null==t?void 0:t.environment)),Ha.setInstance(this.logger),this.logger.setMedta({instanceId:this._instanceId}),this.logger.initTracker(),this.logger.setComponentStartTime(Date.now()),this.logger.setTrackId(this._instanceId),this.logger.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==t?void 0:t.environment,"_").concat(null==t?void 0:t.locale)}).send(),this.preInitSecurity(t)}var t;return y()(e,[{key:"preInitSecurity",value:function(e){var t,n="antomSDKConfigKey",r=Et(wt(n),{});if([te.prod,te.sandbox].includes(null==e?void 0:e.environment)){(function(){var e="antomSDKConfiglastCallTime",t=(new Date).getTime();try{var n=localStorage.getItem(e);if(n)return t-parseInt(n)>=6e5&&(localStorage.setItem(e,t.toString()),!0)}catch(e){}return localStorage.setItem(e,t.toString()),!0})()&&function(e,t){return ya.apply(this,arguments)}({env:this.options.env.environment},this.logger).then((function(e){wt(n,JSON.stringify(e))}));var o=(null===(t=this.options)||void 0===t?void 0:t.product)||W.EASY_PAY,i=!0;try{var a=r.pl_sec.find((function(e){var t,n,r,i=null==e||null===(t=e.v)||void 0===t?void 0:t.split("|")[0],a=(null==e||null===(n=e.v)||void 0===n?void 0:n.split("|")[1])||"999999.9.9",s=Dt(I,i)>=0&&Dt(a,I)>=0;return((null==e||null===(r=e.platform)||void 0===r?void 0:r.includes("Web"))||""===(null==e?void 0:e.platform))&&(null==e?void 0:e.product)===o&&(!(null!=e&&e.v)||s)}));i=!1!==(null==a?void 0:a.enable)}catch(e){}i&&this.initSecurity({product:o})}}},{key:"unmount",value:function(){var e;this.logger.logInfo({title:"sdk_event_apiOnDestroy"}).send();var t,n=null===(e=this.getBusActionNames())||void 0===e?void 0:e.destroyComponent;n&&Qe.isSubscribed(n)&&Qe.publish(new We(n,JSON.stringify({options:this.originOptions,selector:null===(t=this._appendParams)||void 0===t||null===(t=t.iframeNodesParams)||void 0===t?void 0:t.selector})));var r,o=m()(this.plugins.values());try{for(o.s();!(r=o.n()).done;){var i=r.value;try{i.logoutPlugin&&i.logoutPlugin()}catch(e){console.error(e)}}}catch(e){o.e(e)}finally{o.f()}}},{key:"initSecurity",value:function(e){var t=this,n=e.product,r=void 0===n?W.EASY_PAY:n,o=e.scene,i=void 0===o?W.EASY_PAY:o;this.logger.logInfo({title:"sdk_event_securitySdkPreInit"},{productScene:r}).send();var a=r||i,s=this.getSecurityConfigStorage(a).scene||_n(a),l=An.get(s);if(l){if("ready"===l.status)return console.log("[web-sdk] skip init security sdk because it is already loaded"),void this.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send();if("loading"===l.status)return console.log("[web-sdk] security sdk is already loading, waiting..."),void l.loadingPromise.then((function(){t.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send()})).catch((function(e){t.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:null==e?void 0:e.message},{productScene:r,sign:"Active initialization"}).send()}))}this._newSecuritySDKByScene({product:a,region:fn.SG},(function(){t.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send()}),(function(e){t.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:e},{productScene:r,sign:"Active initialization"}).send()}))}},{key:"_getSecuritySDKByProductScene",value:function(e){var t=this.getSecurityConfigStorage(e.product).scene||_n(e.product),n=An.get(t);if(n)return"ready"===n.status?n.instance:void 0;var r=this.securitySdkMap.get(t);return r||(r=kn.getSecuritySdk(t))&&(console.log("[web-sdk] return security sdk from preloaded"),this.securitySdkMap.set(t,r)),r}},{key:"_awaitSecuritySDKByProductScene",value:(t=u()(l()().mark((function e(t){var n,r,o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getSecurityConfigStorage(t.product),r=n.scene||_n(t.product),e.next=4,An.getInstance(r);case 4:return o=e.sent,e.abrupt("return",o);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_newSecuritySDKByScene",value:function(e,t,n){var r,o=this.getSecurityConfigStorage(e.product),i=o.scene||_n(e.product),a=o.h5gateway||yn(e.region),s=An.get(i);if(s){if("ready"===s.status)return void(t&&t());if("loading"===s.status)return void s.loadingPromise.then((function(){t&&t()})).catch((function(e){n&&n(null==e?void 0:e.message)}))}var l=bn(null===(r=this.options)||void 0===r||null===(r=r.env)||void 0===r?void 0:r.environment);hn.getInstance().scheduleLoad({environment:l});try{var c,u=null===(c=this.options)||void 0===c||null===(c=c.env)||void 0===c?void 0:c.environment,d=new En({scene:i,h5gateway:a,environment:u}),p=new Promise((function(e,r){d.initSecurity((function(){An.setReady(i,d),t&&t(),e(d)}),(function(e){An.setFailed(i,new Error(e||"Security init failed")),n&&n(e),r(new Error(e||"Security init failed"))}))}));An.setLoading(i,p),this.securitySdkMap.set(i,d)}catch(e){An.setFailed(i,new Error(null==e?void 0:e.toString())),n&&n(null==e?void 0:e.toString())}}},{key:"getSecurityConfigStorage",value:function(e){var t="",n="",r=wt(mn(e));if(r){var o=Et(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}},{key:"_setOptions",value:function(e){this._setMode(e),this._setEnv(e),this.options.locale=(null==e?void 0:e.locale)||"",this.options.product=null==e?void 0:e.product}},{key:"_setEnv",value:function(e){var t=At()._moreEnv;null!=e&&e.environment&&!((null==e?void 0:e.environment)in te)&&"true"!==t&&(console.warn(ge.INIT_PARAMETER_ERROR.ENVIRONMENT_ERROR.message),e.environment="prod"),this.options.env={terminalType:bt?re.WAP:re.WEB,environment:(null==e?void 0:e.environment)||"prod"},this.options.env.terminalType===re.WAP&&(this.options.env.osType=yt?ne.IOS:_t?ne.ANDROID:ne.ELSE)}},{key:"_setMode",value:function(e){this.options.mode=(null==e?void 0:e.mode)||$.component,null!=e&&e.mode&&!((null==e?void 0:e.mode)in $)&&(console.warn(ge.INIT_PARAMETER_ERROR.MODE_ERROR.message),this.options.mode=$.component),this.options.networkMode=(null==e?void 0:e.networkMode)||ee.session,null!=e&&e.networkMode&&!((null==e?void 0:e.networkMode)in ee)&&(console.warn(ge.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),this.options.networkMode=ee.proxy)}},{key:"_initEvent",value:function(e){var t=this;if(null!=e&&e.onError){if("function"!==ct(e.onError))throw new Error(ge.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(_e.error.name,e.onError,_e.error.uniqueKey)}if(null!=e&&e.onPaymentMethodSelected){if("function"!==ct(e.onPaymentMethodSelected))throw new Error(ge.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(_e.paymentMethodSelected.name,e.onPaymentMethodSelected,_e.paymentMethodSelected.uniqueKey)}if(null!=e&&e.onSizeChanged){if("function"!==ct(e.onSizeChanged))throw new Error(ge.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(_e.sizeChanged.name,e.onSizeChanged,_e.sizeChanged.uniqueKey)}if(null!=e&&e.onLog){if("function"!==ct(e.onLog))throw new Error(ge.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(_e.log.name,e.onLog,_e.log.uniqueKey)}if(null!=e&&e.onEventCallback){if("function"!==ct(e.onEventCallback))throw new Error(ge.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(_e.eventCallback.name,e.onEventCallback,_e.eventCallback.uniqueKey)}if(null!=e&&e.onClose){if("function"!==ct(e.onClose))throw new Error(ge.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(_e.close.name,e.onClose,_e.close.uniqueKey)}if(null!=e&&e.onBeforeSubmit){if("function"!=typeof(null==e?void 0:e.onBeforeSubmit))throw new Error(ge.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(_e.beforeSubmit.name,function(){var n=u()(l()().mark((function n(r){var o,i;return l()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=ze(),n.prev=1,n.next=4,e.onBeforeSubmit(r);case 4:i=n.sent,t._componentApp.dispatchToApp({context:{event:_e.beforeSubmitDone.name,eventCallbackId:o,data:i}}),n.next=12;break;case 8:n.prev=8,n.t0=n.catch(1),t._componentApp.dispatchToApp({context:{event:_e.beforeSubmitDone.name,eventCallbackId:o,data:{result:"ERROR"}}}),t.logger.logError({title:"sdk_error_before_submit",msg:JSON.stringify(n.t0)}).send();case 12:case"end":return n.stop()}}),n,null,[[1,8]])})));return function(e){return n.apply(this,arguments)}}(),_e.beforeSubmit.uniqueKey)}if(null!=e&&e.onChange){if("function"!==ct(e.onChange))throw new Error(ge.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(_e.onChange.name,e.onChange,_e.onChange.uniqueKey)}}},{key:"_registerPlugin",value:function(e,t){if(this.plugins.set(e,t),null!=t&&t.applyPlugin)try{t.applyPlugin(this)}catch(t){if(this.plugins.delete(e),"error"===ct(t))throw t;throw new Error("Failed to register plug-in:".concat(e," Exception in the apply function of the plug-in"))}}},{key:"_getPlugin",value:function(e){return this.plugins.has(e)?this.plugins.get(e):(console.warn("".concat(e," Plugin unregistered")),null)}},{key:"_redirect",value:function(e){var t=this;return new Promise((function(n,r){var o=t.options.env.terminalType===re.WEB,i=(null==e?void 0:e.normalUrl)||"",a=(null==e?void 0:e.schemeUrl)||"",s=(null==e?void 0:e.applinkUrl)||"",l=(null==e?void 0:e.callAppJudgeTime)||"",c=function(){if(i)return n(),void(window.location.href=i);r(ge.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};o?c():function(){if(a||s){var e={fallback:function(){c()},successCb:function(){n()},delay:0};l&&(e.resultJudgmentTime=l);try{new tl(e).open({scheme:a,link:s})}catch(e){c()}}else c()}()}))}},{key:"_overrideSubscription",value:function(e,t,n){this._eventCenter.off(e,t,n),this._eventCenter.on(e,t,n)}},{key:"getBusActionNames",value:function(){var e,t=this._appendParams;if(!t)return null;var n=null,r=null==t||null===(e=t.iframeNodesParams)||void 0===e||null===(e=e.paymentSessionMetaData)||void 0===e?void 0:e.paymentSessionConfig;if(r){var o,i=r.productScene+r.productSceneVersion+r.paymentMethodCategoryType,a=null==t||null===(o=t.iframeNodesParams)||void 0===o||null===(o=o.paymentSessionMetaData)||void 0===o||null===(o=o.paymentSessionFactor)||void 0===o||null===(o=o.paymentMethodInfo)||void 0===o?void 0:o.paymentMethodType;a&&(i+=a),n=this._getPlugin(i)}return this.options.product===W.ELEMENT_ADDRESS&&(n=this._getPlugin(W.ELEMENT_ADDRESS)),n}}]),e}();function rl(e,t){return ol.apply(this,arguments)}function ol(){return ol=u()(l()().mark((function e(t,n){var r,o,i,a;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(r=t||{}).frontModulesToBeLoaded,i=void 0===o?[]:o,a=r.paymentRequestId,Array.isArray(i)){e.next=3;break}return e.abrupt("return");case 3:if(0!==i.length){e.next=5;break}return e.abrupt("return");case 5:return e.abrupt("return",new Promise(function(){var e=u()(l()().mark((function e(t){var r,o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=function(e){return e.AIRWALLEX="AIRWALLEX",e}({}),o=[],n.logInfo({title:"load_channel_sdk_start"},{eventMessage:JSON.stringify(i),requestId:a}),i.forEach((function(e){var t=e.acquirerName,i=e.scriptUrl,s=null;t===r.AIRWALLEX?s=Rt({src:i,attrOptions:{defer:!0,id:"airwallex-fraud-api","data-order-session-id":a},timeOut:3},n):s=Rt({src:i,timeOut:3},n);o.push(s)})),e.next=6,Promise.all(o);case 6:t(!0);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 6:case"end":return e.stop()}}),e)}))),ol.apply(this,arguments)}var il=function(e){var t=e.paymentSessionConfig,n=void 0===t?{}:t,r=n.productScene,o=void 0===r?"":r,i=n.paymentMethodCategoryType,a=void 0===i?"":i;return o&&a?"".concat(o,"_").concat(a):o?"".concat(o):V.NONE},al=function(e){try{return[JSON.parse(Ct(e.split("&&")[3])),e.split("&&").slice(0,3).join("&&")]}catch(t){return console.error("Parsing sessionData is abnormal and may affect the payment link. Please ensure to use the new version of SDK."),[{},e]}},sl=function(e){var t=al(e),n=ot()(t,2),r=n[0],o=n[1];return function(e){var t;St()&&null!=e&&e.paymentSessionConfig&&e.paymentSessionConfig.productScene===W.EASY_PAY&&"BANKTRANSFER_QUICKPAY"!==(null==e||null===(t=e.paymentMethodInfoView)||void 0===t?void 0:t.paymentMethodType)&&(e.paymentSessionConfig.productSceneVersion="1.0")}(r),[null!=r?r:{},o]},ll=function(e,t){var n=Object.assign({paymentSessionMetaData:{},renderDisplayType:G.popup},e),r=sl(n.sessionData||(null==n?void 0:n.paymentSessionData)),o=ot()(r,2),i=o[0],a=o[1],s=il(i);if(nt()(Object.values(z)).includes(s)&&n.renderDisplayType===G.popup&&-1===window.location.href.indexOf("popup=true"))return Promise.reject({code:ge.CREATEPAYMENT_PARAMETER_ERROR.code,message:"unsupported payment method"});if(t.options.product===W.ELEMENT_ADDRESS&&(s=V.ELEMENT_ADDRESS),s===V.NONE)return Promise.reject({code:ge.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Abnormal response data, interface failure, or unsupported payment method"});if(i&&null!=i&&i.securityConfig){var l,c=null==i||null===(l=i.paymentSessionConfig)||void 0===l?void 0:l.productScene;wt(mn(c),JSON.stringify(null==i?void 0:i.securityConfig))}return n.sessionData=a,n.paymentSessionMetaData=i,Promise.resolve({iframeNodesParams:n,componentSign:s})},cl=function(e){S()(r,e);var t,n=k()(r);function r(e){var t;b()(this,r),t=n.call(this,e),p()(et()(t),"channelType",void 0),p()(et()(t),"productSceneVersion",void 0),p()(et()(t),"timer",void 0),p()(et()(t),"_validateResolveMap",new Map);var o=new _s({appVersion:e.appVersion});return o.setRender(As),o.setPreloadRender(ks),t._registerPlugin(ye,o),t._componentApp=t._getPlugin(ye),t.registerBusAbility(),t}return y()(r,[{key:"parameterInitAndCheck",value:function(e){var t=e.params,n=e.selector,r=e.renderDisplayType;this.options.mode=$.component,this.options.networkMode=this.options.networkMode||ee.session;var o=Object.assign({selector:n,renderDisplayType:r},t);return this.options.product===W.ELEMENT_ADDRESS||!o||o.sessionData||null!=o&&o.paymentSessionData?this.options.networkMode===ee.proxy?(console.warn(ge.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),Promise.reject(ge.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT)):Promise.resolve(o):Promise.reject(ge.CREATEPAYMENT_PARAMETER_ERROR)}},{key:"pluginAppendIframe",value:(t=u()(l()().mark((function e(t){var n,r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=(t||{}).iframeNodesParams.paymentSessionMetaData,r=(n||{}).paymentSessionFactor,e.next=5,rl(r,this.logger);case 5:return e.abrupt("return",this._componentApp.appendIframeNodes(t.componentSign,t.iframeNodesParams));case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 11:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e){return t.apply(this,arguments)})},{key:"savePreviousChannel",value:function(e){var t=(e||{}).paymentSessionMetaData.paymentSessionConfig,n=t.productScene,r=void 0===n?"":n,o=t.paymentMethodCategoryType,i=void 0===o?"":o,a=t.productSceneVersion,s=void 0===a?"":a,l="".concat(r,"_").concat(i);if(r&&i&&s){Array.isArray(this.channelType)&&this.channelType.includes(l)&&this.productSceneVersion===s?this.logger.logInfo({title:"preload_match"},{eventMessage:l,productSceneVersion:s}):this.logger.logInfo({title:"preload_no_match"},{eventMessage:l,productSceneVersion:s});var c={channelType:l===V.VAULTING_CARD?V.CASHIER_PAYMENT_CARD:l,productSceneVersion:s};localStorage.setItem("antom_checkout_previousChannel",JSON.stringify(c))}}},{key:"registerBusAbility",value:function(){var e,t=this;Qe.debugTrace((null===(e=this.originOptions)||void 0===e?void 0:e.environment)!==te.prod,this.logger),Qe.clear(),Qe.addInterceptor({onPublishException:function(e,n){t.logger.logError({title:"onBusPublishException"},v()(v()({},e),{},{errorMessage:JSON.stringify(n)}))}}),Qe.subscribe(new Ts((function(e){var n;null===(n=t._componentApp)||void 0===n||null===(n=n.AMSSDK)||void 0===n||n._eventCenter.emit(_e.eventCallback.name,e)}))),Qe.subscribe(new Ps((function(e,n){var r;return null===(r=t._componentApp)||void 0===r?void 0:r.getDeviceIdAndLog(e,n)}))),Qe.subscribe(new ws(this.logger)),Qe.subscribe(new Pa(this.logger)),Qe.subscribe(new Ss(this.logger)),bs.forEach((function(e){var n;null!=e&&e.busSubscriber&&Qe.subscribe(null==e?void 0:e.busSubscriber);var r=e.paymentChannelMatcher;r&&t._registerPlugin(r.paymentMethod,e.busActionNames);var o=e.sessionMatcher;if(o){var i=o.productScene+o.productSceneVersion+o.paymentMethodCategoryType;o.paymentMethodTypes?o.paymentMethodTypes.forEach((function(n){var r=i+n;t._registerPlugin(r,e.busActionNames)})):t._registerPlugin(i,e.busActionNames)}var a=null==e||null===(n=e.busActionNames)||void 0===n?void 0:n.optional_init;a&&Qe.publish(new We(a,JSON.stringify(t.originOptions)))}))}},{key:"canMakePayments",value:function(e,t){var n=this;return new Promise((function(r){var o;if(!e)return r(!0);var i=null===(o=n._getPlugin(e))||void 0===o?void 0:o.canMakePayments;i&&Qe.isSubscribed(i)?Qe.publishForResult(new We(i,JSON.stringify({paymentMethod:e,subPaymentMethod:t})),{fallback:!1}).then((function(e){r(e.getJSONObject())})).catch((function(e){n.logger.logInfo({title:"canMakePayments_error"},{errorMessage:JSON.stringify(e)}),r(!1)})):r(!0)}))}},{key:"createComponent",value:function(e){var t=this;return this.clearPreloadIframe(),this.logger.setComponentStartTime(Date.now()),this.parameterInitAndCheck({params:e,renderDisplayType:G.popup}).then((function(e){return ll(e,t)})).catch((function(n){return t.logger.logError({title:"sdk_error_parameter"},{params:JSON.stringify(e)}).send(),t._eventCenter.emit(_e.error.name,n),Promise.reject(n)})).then((function(e){var n=e.iframeNodesParams;return t.logger.setTrackId(null==n?void 0:n.sessionData),t.createComponentProcess(e)}))}},{key:"createComponentProcess",value:function(e){var t;this._appendParams=e;var n=null===(t=this.getBusActionNames())||void 0===t?void 0:t.createComponent;if(n&&Qe.isSubscribed(n))return Qe.publish(new We(n,JSON.stringify({appendParams:e,options:this.originOptions}))),Promise.resolve();var r=e.iframeNodesParams;return this.savePreviousChannel(r),this.pluginAppendIframe(e)}},{key:"preloadComponent",value:function(e,t){var n=this;if(kn.isWebAppPreloaded)console.log("[web-sdk] web app already preloaded");else{this.channelType=e,this.productSceneVersion=t;if(Array.isArray(e))for(var r=0;r<e.length;r++)this._componentApp.appendPreloadIframeNodes(e[r],t);else this.logger.logError({title:"performance_optimization_channelType_error"},{eventMessage:e});this.timer=setTimeout((function(){n.clearPreloadIframe(!0)}),1e4)}}},{key:"clearPreloadIframe",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e&&clearTimeout(this.timer),Array.isArray(this.channelType))for(var t=0;t<this.channelType.length;t++){var n=document.getElementById("ams-checkout-component-".concat(this.channelType[t],"-").concat(this.productSceneVersion));n&&document.body.removeChild(n)}e?this.logger.logInfo({title:"performance_optimization_clearPreloadIframe_timeout"}):this.logger.logInfo({title:"performance_optimization_clearPreloadIframe"})}},{key:"mountComponent",value:function(e,t){var n=this;return this.clearPreloadIframe(),this.logger.setComponentStartTime(Date.now()),this.parameterInitAndCheck({params:e,renderDisplayType:G.inline,selector:t}).then((function(e){return ll(e,n)})).catch((function(t){return n.logger.logError({title:"sdk_error_parameter"},{params:JSON.stringify(e)}).send(),n._eventCenter.emit(_e.error.name,t),Promise.reject(t)})).then((function(e){var t=e.iframeNodesParams;return n.logger.setTrackId(null==t?void 0:t.sessionData),n.mountComponentProcess(e)}))}},{key:"mountComponentProcess",value:function(e){var t;this._appendParams=e;var n=null===(t=this.getBusActionNames())||void 0===t?void 0:t.mountComponent;if(n&&Qe.isSubscribed(n))return Qe.publish(new We(n,JSON.stringify({appendParams:e,options:this.originOptions}))),Promise.resolve();var r=e.iframeNodesParams;return this.options.product!==W.ELEMENT_ADDRESS&&this.savePreviousChannel(r),this.pluginAppendIframe(e)}},{key:"submit",value:function(e){var t=this;return new Promise((function(n,r){try{var o,i=ze();t.logger.logInfo({title:"sdk_event_apiSubmit"});var a=null===(o=t.getBusActionNames())||void 0===o?void 0:o.submit;a&&Qe.isSubscribed(a)?Qe.publishForResult(new We(a,JSON.stringify({appendParams:t._appendParams,options:t.originOptions,data:e}))).then((function(e){n(null==e?void 0:e.getJSONObject())})):(t._eventCenter.once(i,(function(e){n(e)})),t._componentApp.dispatchToApp({context:{event:"submitPay",eventCallbackId:i,data:e}}))}catch(e){r(e)}}))}},{key:"_validateFields",value:function(){var e=this;return new Promise((function(t){if(!e._componentApp.shouldValidateFields())return t({isValid:!1}),void e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:"notRenderComponent"});var n,r=new Promise((function(t){var n=ze();e._validateResolveMap.set(n,t),e._sendMessageToAPP({event:be.name,data:{},eventCallbackId:n});var r=function(){var t=u()(l()().mark((function t(n){var r,o,i;return l()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=(null==n?void 0:n.eventCallbackId)||"",o=e._validateResolveMap.get(r),i={isValid:!1},a=null==n?void 0:n.data,"object"===Xe()(a)&&null!==a&&"boolean"==typeof a.isValid&&(i=null==n?void 0:n.data),e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:i.isValid?"true":"false"}),o&&(o(i),e._validateResolveMap.delete(r));case 6:case"end":return t.stop()}var a}),t)})));return function(e){return t.apply(this,arguments)}}();e._overrideSubscription(_e.validateFieldsResult.forwardName,r,_e.validateFieldsResult.uniqueKey)})),o=new Promise((function(t){n=setTimeout((function(){e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:"timeout"}),t({isValid:!1})}),15e3)}));Promise.race([r,o]).then((function(e){clearTimeout(n),t(e)})).catch((function(){clearTimeout(n),t({isValid:!1})}))}))}},{key:"_sendMessageToAPP",value:function(e){this._componentApp.dispatchToApp({context:e})}}]),r}(nl),ul=function(e){S()(n,e);var t=k()(n);function n(e){return b()(this,n),t.call(this,e)}return y()(n,[{key:"getValue",value:function(e){var t=this;return new Promise((function(n,r){try{var o,i=ze();t.logger.logInfo({title:"sdk_event_apiGetValue"});var a=null===(o=t.getBusActionNames())||void 0===o?void 0:o.getValue;a&&Qe.isSubscribed(a)?Qe.publishForResult(new We(a,JSON.stringify({appendParams:t._appendParams,options:t.originOptions,data:e}))).then((function(e){n(null==e?void 0:e.getJSONObject())})):(t._eventCenter.once(i,(function(e){n(e)})),t._componentApp.dispatchToApp({context:{event:"getValue",eventCallbackId:i,data:e}}))}catch(e){r(e)}}))}}]),n}(cl);function dl(e,t){return function(e){var t=e?"elements2":"elements",n=location.origin,r=localStorage.getItem("antom-web-checkout-v2_app_document_prefix");return r&&(n=r),"".concat(n,"/").concat(t,"/").concat(localStorage.getItem("ANTOM_LOCAL")?"src/pages":"pages")}(t)+(e.startsWith("/")?e:"/".concat(e))}function pl(){var e=window.localStorage.getItem("antom-web-checkout-v2_app_env")||"dev";"pre"!==e&&"local"!==e||"true"!==window.localStorage.getItem("antom-web-checkout-v2_sandbox_enabled")||(e="sandbox");var t=window.localStorage.getItem("antom-web-checkout-v2_base_url")||void 0,n=window.localStorage.getItem("antom-web-checkout-v2_group_id")||void 0,r=JSON.parse(JSON.stringify({baseURL:t,groupId:n,env:e}));return console.log("[getDevReqConfig] dev request config:",r),r}function hl(e){var t,n=(null==e?void 0:e.supportedLanguages)||[],r=m()(n);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o.preferred&&o.locale)return o.locale}}catch(e){r.e(e)}finally{r.f()}}var ml={i18nPrefix:"OPENSDK"},fl=function(e){E(n,e);var t=A(n);function n(e,r,o,i){var a,s,l,c=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];_(this,n);var u,p=i,h=void 0;return e&&"object"===Ze(e)?(u=e.message,h=e.params):u=e,l=t.call(this,!ml.i18n||c&&"SERVER_API"===o?u:ml.i18n.get({id:"".concat(ml.i18nPrefix,".").concat(r),dm:(null===(a=(s=ml).getDefaultMessage)||void 0===a?void 0:a.call(s))||u},h)),d($e(l),"code",void 0),d($e(l),"name","OpenSDKError"),d($e(l),"_openSDKErrorFlag","__OpenSDKErrorFlag__"),d($e(l),"source","SDK_INTERNAL"),d($e(l),"traceId",void 0),d($e(l),"reason",void 0),l.reason=u,l.code=r,l.source=o,l.traceId=p,l}return g(n,[{key:"toJSON",value:function(){var e={message:this.message,code:this.code,source:this.source,traceId:this.traceId,reason:this.reason,stack:this.stack};return JSON.parse(JSON.stringify(e))}}],[{key:"isError",value:function(e){return e instanceof n||e instanceof Error&&"__OpenSDKErrorFlag__"===e._openSDKErrorFlag}},{key:"unificationError",value:function(e){var t,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"APP_RUNTIME";if(n.isError(e))return e;var i=new vl(e instanceof Error?e.message:(null===(t=(r=ml).getDefaultMessage)||void 0===t?void 0:t.call(r))||"An unknown error occurred.","UNKNOWN_ERROR",o);return i}},{key:"initConfig",value:function(e){ml=f(f({},ml),e)}}]),n}(R(Error)),vl=function(e){E(n,e);var t=A(n);function n(){var e;_(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),d($e(e),"name","SDKBridgeError"),e}return g(n)}(fl),gl=function(e){return tt(new Set(e))},yl=function(e,t){return e.filter((function(e){return!t.includes(e)}))},_l=function(e,t){return e.filter((function(e){return t.includes(e)}))},bl=function(e){return"bigint"==typeof e||!Number.isNaN(Number(e))&&Math.floor(Number(e))===e},El=function(e){return"bigint"==typeof e||e>=0&&Number.isSafeInteger(e)};function Sl(e,t){if(0===t.length)return e;for(var n,r=tt(e),o=r.length-1,i=0,a=0;o>0;o--,i++){a+=n=t[i%=t.length].codePointAt(0);var s=(n+i+a)%o,l=r[o],c=r[s];r[s]=l,r[o]=c}return r}var Al=function(e,t){return e.reduce((function(n,r){var o=t.indexOf(r);if(-1===o)throw new Error("The provided ID (".concat(e.join(""),") is invalid, as it contains characters that do not exist in the alphabet (").concat(t.join(""),")"));if("bigint"==typeof n)return n*BigInt(t.length)+BigInt(o);var i=n*t.length+o;return Number.isSafeInteger(i)?i:(Cl("Unable to decode the provided string, due to lack of support for BigInt numbers in the current environment"),BigInt(n)*BigInt(t.length)+BigInt(o))}),0)},kl=/^\+?\d+$/,Tl=function(e){if(!kl.test(e))return Number.NaN;var t=Number.parseInt(e,10);return Number.isSafeInteger(t)?t:(Cl("Unable to encode the provided BigInt string without loss of information due to lack of support for BigInt type in the current environment"),BigInt(e))},Pl=function(e){return new RegExp(e.map((function(e){return Il(e)})).sort((function(e,t){return t.length-e.length})).join("|"))},wl=function(e){return new RegExp("^[".concat(e.map((function(e){return Il(e)})).sort((function(e,t){return t.length-e.length})).join(""),"]+$"))},Il=function(e){return e.replace(/[\s#$()*+,.?[\\\]^{|}-]/g,"\\$&")},Cl=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"BigInt is not available in this environment";if("function"!=typeof BigInt)throw new TypeError(e)},Rl=3.5,Nl=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"cfhistuCFHISTU";if(_(this,e),this.minLength=n,"number"!=typeof n)throw new TypeError("Hashids: Provided 'minLength' has to be a number (is ".concat(Ze(n),")"));if("string"!=typeof t)throw new TypeError("Hashids: Provided 'salt' has to be a string (is ".concat(Ze(t),")"));if("string"!=typeof r)throw new TypeError("Hashids: Provided alphabet has to be a string (is ".concat(Ze(r),")"));var i=Array.from(t),a=Array.from(r),s=Array.from(o);this.salt=i;var l=gl(a);if(l.length<16)throw new Error("Hashids: alphabet must contain at least ".concat(16," unique characters, provided: ").concat(l.join("")));this.alphabet=yl(l,s);var c,u,d,p=_l(s,l);(this.seps=Sl(p,i),0===this.seps.length||this.alphabet.length/this.seps.length>Rl)&&((c=Math.ceil(this.alphabet.length/Rl))>this.seps.length&&(u=c-this.seps.length,(d=this.seps).push.apply(d,tt(this.alphabet.slice(0,u))),this.alphabet=this.alphabet.slice(u)));this.alphabet=Sl(this.alphabet,i);var h=Math.ceil(this.alphabet.length/12);this.alphabet.length<3?(this.guards=this.seps.slice(0,h),this.seps=this.seps.slice(h)):(this.guards=this.alphabet.slice(0,h),this.alphabet=this.alphabet.slice(h)),this.guardsRegExp=Pl(this.guards),this.sepsRegExp=Pl(this.seps),this.allowedCharsRegExp=wl([].concat(tt(this.alphabet),tt(this.guards),tt(this.seps)))}return g(e,[{key:"encode",value:function(e){for(var t="",n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=Array.isArray(e)?e:[].concat(tt(null!=e?[e]:[]),r);return 0===i.length?t:(i.every(bl)||(i=i.map((function(e){return"bigint"==typeof e||"number"==typeof e?e:Tl(String(e))}))),i.every(El)?this._encode(i).join(""):t)}},{key:"decode",value:function(e){return e&&"string"==typeof e&&0!==e.length?this._decode(e):[]}},{key:"encodeHex",value:function(e){var t=e;switch(Ze(t)){case"bigint":t=t.toString(16);break;case"string":if(!/^[\dA-Fa-f]+$/.test(t))return"";break;default:throw new Error("Hashids: The provided value is neither a string, nor a BigInt (got: ".concat(Ze(t),")"))}var n,r,o,i=(n=t,r=12,o=function(e){return Number.parseInt("1".concat(e),16)},Array.from({length:Math.ceil(n.length/r)},(function(e,t){return o(n.slice(t*r,(t+1)*r))})));return this.encode(i)}},{key:"decodeHex",value:function(e){return this.decode(e).map((function(e){return e.toString(16).slice(1)})).join("")}},{key:"isValidId",value:function(e){return this.allowedCharsRegExp.test(e)}},{key:"_encode",value:function(e){var t=this,n=this.alphabet,r=e.reduce((function(e,t,n){return e+("bigint"==typeof t?Number(t%BigInt(n+100)):t%(n+100))}),0),o=[n[r%n.length]],i=tt(o),a=this.seps,s=this.guards;if(e.forEach((function(r,s){var l,c=i.concat(t.salt,n),u=function(e,t){var n=[],r=e;if("bigint"==typeof r){var o=BigInt(t.length);do{n.unshift(t[Number(r%o)]),r/=o}while(r>BigInt(0))}else do{n.unshift(t[r%t.length]),r=Math.floor(r/t.length)}while(r>0);return n}(r,n=Sl(n,c));if((l=o).push.apply(l,tt(u)),s+1<e.length){var d=u[0].codePointAt(0)+s,p="bigint"==typeof r?Number(r%BigInt(d)):r%d;o.push(a[p%a.length])}})),o.length<this.minLength){var l=(r+o[0].codePointAt(0))%s.length;if(o.unshift(s[l]),o.length<this.minLength){var c=(r+o[2].codePointAt(0))%s.length;o.push(s[c])}}for(var u=Math.floor(n.length/2);o.length<this.minLength;){var d,p;n=Sl(n,n),(d=o).unshift.apply(d,tt(n.slice(u))),(p=o).push.apply(p,tt(n.slice(0,u)));var h=o.length-this.minLength;if(h>0){var m=h/2;o=o.slice(m,m+this.minLength)}}return o}},{key:"_decode",value:function(e){if(!this.isValidId(e))throw new Error("The provided ID (".concat(e,") is invalid, as it contains characters that do not exist in the alphabet (").concat(this.guards.join("")).concat(this.seps.join("")).concat(this.alphabet.join(""),")"));var t=e.split(this.guardsRegExp),n=t[3===t.length||2===t.length?1:0];if(0===n.length)return[];var r,o=n[Symbol.iterator]().next().value,i=n.slice(o.length).split(this.sepsRegExp),a=this.alphabet,s=[],l=h(i);try{for(l.s();!(r=l.n()).done;){var c=r.value,u=Sl(a,[o].concat(tt(this.salt),tt(a)).slice(0,a.length));s.push(Al(Array.from(c),u)),a=u}}catch(e){l.e(e)}finally{l.f()}return this._encode(s).join("")!==e?[]:s}}]),e}(),Ol=new Nl("intl-open-sdk",6);function Dl(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){var r,o=new Promise((function(e,o){r=setTimeout((function(){n?o(n):e(void 0)}),t)}));return Promise.race([o,e.apply(void 0,arguments)]).finally((function(){return clearTimeout(r)}))}}var Ll=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e+Ol.encode("".concat(Date.now()).concat(Math.ceil(100*Math.random())))};function Ml(e){if("onpagehide"in self){var t=function(t){t.persisted||e("pagehide")};return self.addEventListener("pagehide",t),function(){return self.removeEventListener("pagehide",t)}}if("undefined"!=typeof document&&void 0!==document.visibilityState){var n=!1,r=function(){"hidden"!==document.visibilityState||n||(n=!0,e("visibilitychange"))};return document.addEventListener("visibilitychange",r),function(){return document.removeEventListener("visibilitychange",r)}}var o=self,i=function(){e("beforeunload")};return o.addEventListener("beforeunload",i),function(){return o.removeEventListener("beforeunload",i)}}var xl=function(){function e(t,n){var r=this;_(this,e),d(this,"targetPort",void 0),d(this,"handlers",new Map),d(this,"debugCallback",void 0),d(this,"name",void 0),d(this,"initialized",!1),d(this,"recipientIsReady",!1),d(this,"handleMessage",(function(e){var t=e.data,n=t.type,o=t.payload,i=r.handlers.get(n);i&&(r.debugCallback&&r.debugCallback(f(f({},e.data),{},{type:"MODAL_PORT@"+e.data.type}),"IN"),i.forEach((function(e){e(o)})))})),this.targetPort=n,n.onmessage=this.handleMessage,this.name=t,this.once("ready",(function(){r.recipientIsReady=!0}))}return g(e,[{key:"setDebugCallback",value:function(e){this.debugCallback=e}},{key:"onData",value:function(e){return this.initialized||(this.send("ready"),this.initialized=!0),this.on("data",e)}},{key:"sendData",value:function(e){var t=this;this.recipientIsReady?this.send("data",e):this.once("ready",(function(){t.recipientIsReady=!0,t.send("data",e)}))}},{key:"onClose",value:function(e){var t=this;return new Promise((function(n,r){t.on("close",function(){var o=c(s().mark((function o(i){return s().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(i.name!==t.name){o.next=10;break}return o.prev=1,o.next=4,e(i.manual);case 4:n(),o.next=10;break;case 7:o.prev=7,o.t0=o.catch(1),r(o.t0);case 10:case"end":return o.stop()}}),o,null,[[1,7]])})));return function(e){return o.apply(this,arguments)}}())}))}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.send("close",{name:this.name,manual:e}),new Promise((function(){}))}},{key:"on",value:function(e,t){var n=this;return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),function(){n.handlers.get(e).delete(t)}}},{key:"once",value:function(e,t){var n=this,r=function r(o){try{t(o)}finally{n.off(e,r)}};return this.on(e,r),function(){n.off(e,r)}}},{key:"off",value:function(e,t){var n=this.handlers.get(e);n&&n.delete(t)}},{key:"send",value:function(e,t){var n={id:Ll("modal_port_"),type:e,payload:t};this.debugCallback&&this.debugCallback(f(f({},n),{},{type:"MODAL_PORT@"+n.type}),"OUT"),this.targetPort.postMessage(n)}}]),e}(),Ul=function(){function e(t){_(this,e),d(this,"targetPorts",[]),d(this,"name",void 0),this.name=t}var t;return g(e,[{key:"addPort",value:function(e){var t;(t=this.targetPorts).push.apply(t,tt(e))}},{key:"removePort",value:function(e){this.targetPorts=this.targetPorts.filter((function(t){return e!==t}))}},{key:"getValues",value:(t=c(s().mark((function e(t){var n,r,o=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(null==t?void 0:t.timeout)||1e4,r=Dl((function(){return Promise.all(o.targetPorts.map((function(e){return new Promise((function(t,n){e.postMessage({id:Math.random()+"",type:"".concat(o.name,":START_COLLECT_VALUE")}),e.onmessage=function(e){var r=e.data;if(r&&r.type){var o=r.type.split(":"),i=rt(o,2),a=i[0];"SEND_ELEMENT_VALUE"===i[1]&&t(d({},a,r.payload))}else n(new Error("collect error"))}}))}))).then((function(e){return e.reduce((function(e,t){return f(f({},e),t)}),{})}))}),n),e.abrupt("return",r());case 3:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}(),Bl=function(){function e(t,n){_(this,e),d(this,"targetPort",void 0),d(this,"name",void 0),this.targetPort=n,this.name=t}return g(e,[{key:"onSendRequest",value:function(e){this.targetPort.onmessage=function(){var t=c(s().mark((function t(n){var r,o,i;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((r=n.data)&&r.type){t.next=3;break}return t.abrupt("return");case 3:o=r.type.split(":"),i=rt(o,2),i[0],"START_COLLECT_VALUE"===i[1]&&e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}},{key:"send",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={id:Math.random()+"",payload:e,type:"".concat(this.name,":SEND_ELEMENT_VALUE")};this.targetPort.postMessage(t)}}]),e}(),Kl="OPENSDK@HANDSHAKE",Hl="OPENSDK@READY_HANDSHAKE",Fl="OPENSDK@UPDATE_CONFIG",Yl="OPENSDK@UPDATE_CONFIG_REPLY",jl="OPENSDK@SUBMIT",Gl="OPENSDK@SUBMIT_REPLY",zl="OPENSDK@REDIRECT",Vl="OPENSDK@OPEN_MODAL",Wl="OPENSDK@OPEN_MODAL_ERROR",ql="OPENSDK@CLOSE_MODAL",Jl="OPENSDK@ERROR",Ql="OPENSDK@HANDSHAKE_ACK",Zl="OPENSDK@TRANSFER_RECEIVE_PORT",Xl="OPENSDK@MESSAGE",$l="OPENSDK@TRANSFER_SEND_PORT",ec="OPENSDK@TRANSFER_APP_PORT",tc="OPENSDK@MODAL_TRANSFER_READY",nc="OPENSDK@TRANSFER_MODAL_PORT",rc="OPENSDK@TRANSFER_MODAL_APPEARANCE",oc="OPENSDK@TRANSFER_MODAL_INITIALDATA",ic="OPENSDK@HEIGHT_UPDATE",sc="OPENSDK@DESTROY_ELEMENT",lc=n(245),cc=[Zl,$l,nc,rc,oc,Wl,ec,tc,ql,Vl,zl,Xl,sc],uc="@@global",dc="@@native",pc=function(){function e(t,n,r){var o,i,a=this;(_(this,e),d(this,"targetWindow",void 0),d(this,"currentWindow",void 0),d(this,"targetOrigin","*"),d(this,"scope",void 0),d(this,"handlers",new Map),d(this,"mode",void 0),d(this,"resizeObserver",void 0),d(this,"debugCallback",void 0),d(this,"receivePort",void 0),d(this,"openModalOff",void 0),d(this,"openModalPromise",void 0),d(this,"handleMessage",(function(e){var t=e.data;if(t&&"string"==typeof t.type){var n=t.type.split(":"),r=rt(n,2),o=r[0],i=r[1];if(a.scope!==dc){if(!["WEBAPP","HOST"].includes(i))return;if("*"!==a.targetOrigin&&e.origin!==a.targetOrigin)return;if(a.mode===i)return}var s=a.handlers.get(t.type);a.scope!==dc&&(s||t.type.endsWith(Jl)||t.type.endsWith(Xl))&&a.debugCallback&&a.scope===o&&a.debugCallback(t,"IN"),s&&new Set(s).forEach((function(n){n.length>=3?n(t.payload,e.ports,{origin:e.origin,source:e.source}):n(t.payload,e.ports)}))}})),this.mode=t,this.scope=n,this.currentWindow=r||window,"WEBAPP"===this.mode)&&(this.targetWindow=null===(i=this.currentWindow)||void 0===i?void 0:i.parent);Object.defineProperties(this,{targetWindow:{value:this.targetWindow,writable:!0,enumerable:!1,configurable:!0},currentWindow:{value:this.currentWindow,writable:!0,enumerable:!1,configurable:!0}}),null===(o=this.currentWindow)||void 0===o||o.addEventListener("message",this.handleMessage)}return g(e,[{key:"setTarget",value:function(e){this.targetWindow=e}},{key:"setOrigin",value:function(e){this.targetOrigin=e}},{key:"setDebugCallback",value:function(e){this.debugCallback=e}},{key:"destroy",value:function(){var e,t;null===(e=this.currentWindow)||void 0===e||e.removeEventListener("message",this.handleMessage),this.handlers.clear(),null===(t=this.resizeObserver)||void 0===t||t.disconnect()}},{key:"_addPort",value:function(e){var t;this._transferPort(Zl,null===(t=this.receivePort)||void 0===t?void 0:t.name,e)}},{key:"_transferReceivePort",value:function(e){this._transferPort(Zl,e.name,e.targetPorts)}},{key:"_transferSendPort",value:function(e){this._transferPort($l,e.name,[e.targetPort])}},{key:"send",value:function(e,t,n){var r;if(!this.targetWindow)return console.warn("[Bridge] Target window not set. Cannot send message:",e),void(null===(r=this.debugCallback)||void 0===r||r.call(this,{id:Ll("bridge"),type:"SYSTEM_".concat(Jl),payload:{message:"Target window not set"}},"OUT"));var o={id:Ll("bridge"),type:this.getOriginSendType(e),payload:t};this.debugCallback&&this.debugCallback(o,"OUT"),this.targetWindow.postMessage(o,this.targetOrigin,n)}},{key:"sendError",value:function(e){"WEBAPP"===this.mode&&this.send(Jl,e.toJSON())}},{key:"sendSubmit",value:function(e){"WEBAPP"===this.mode&&this.send(Gl,e)}},{key:"sendMessage",value:function(e,t){"WEBAPP"===this.mode&&this.send(Xl,{type:e,message:t})}},{key:"sendRedirect",value:function(e){if("WEBAPP"===this.mode){if(!e.url)throw new vl("url is required","INVALID_REDIRECT_URL","SDK_INTERNAL");try{new URL(e.url)}catch(e){throw new vl("Invalid URL","INVALID_REDIRECT_URL","SDK_INTERNAL")}this.send(zl,e)}}},{key:"redirect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"redirect";if("WEBAPP"===this.mode){if(!e)throw new vl("url is required","INVALID_REDIRECT_URL","SDK_INTERNAL");try{new URL(e)}catch(e){throw new vl("Invalid URL","INVALID_REDIRECT_URL","SDK_INTERNAL")}this.send(zl,{url:e,mode:t})}}},{key:"sendDestroyElement",value:function(e){e||(e=this.scope),"WEBAPP"===this.mode&&this.send(sc,{elementKey:e})}},{key:"openModal",value:function(e,t){var n,r=this;if(this.openModalPromise)return this.openModalPromise;var o=Ll("modal_");this.send(Vl,f(f({},e),{},{scope:this.scope,initialData:t,modalId:o})),null===(n=this.openModalOff)||void 0===n||n.call(this);var i=new Promise((function(e,t){var n=function(){},o=function(){},i=function(){n(),o(),r.openModalOff=void 0,r.openModalPromise=void 0};n=r.once(Wl,(function(e){i(),t(new fl(e.message,e.code,e.source))}));o=r.on(ec,(function(n,r){if(null==r||!r[0])return i(),void t(new vl("No ports transferred for modal communication","NO_PORTS_ERROR","SDK_INTERNAL"));i(),e(new xl(n,r[0]))})),r.openModalOff=i}));return this.openModalPromise=i,i}},{key:"closeModal",value:function(){var e;null===(e=this.openModalOff)||void 0===e||e.call(this),this.send(ql)}},{key:"on",value:function(e,t){var n=this,r=this.getOriginListenType(e);return this.handlers.has(r)||this.handlers.set(r,new Set),this.handlers.get(r).add(t),function(){n.handlers.get(r).delete(t)}}},{key:"once",value:function(e,t){var n=this,r=function r(o,i,a){try{t(o,i,a)}finally{n.off(e,r)}};return this.on(e,r),function(){n.off(e,r)}}},{key:"off",value:function(e,t){var n=this.getOriginListenType(e),r=this.handlers.get(n);r&&r.delete(t)}},{key:"handsShake",value:function(e,t){var n=this;if("WEBAPP"!==this.mode)throw new vl("handsShake can only be called in WEBAPP mode","UNKNOWN_ERROR","SDK_INTERNAL");var r=this.on(Kl,function(){var r=c(s().mark((function r(o){var i,a;return s().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:"GROUP"===(null==o?void 0:o.elementMode)?o.isMainElement?n.getReceivePort().then((function(e){t(o,e)})):n.getSendPort().then((function(e){t(o,e)})).catch((function(){t(o)})):t(o),i=0,a=lc((function(e){(Math.abs(e-i)>10||Math.abs((e-i)/i)>.01)&&(i=e,n.send(ic,e))}),400),n.resizeObserver=new ResizeObserver((function(e){var t,n=null==e||null===(t=e[0])||void 0===t?void 0:t.contentRect;n&&a(n.height)})),n.resizeObserver.observe(document.body),n.send(Ql,{version:e});case 6:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}());return this.send(Hl),function(){var e;r(),null===(e=n.resizeObserver)||void 0===e||e.disconnect()}}},{key:"getOriginListenType",value:function(e){if("error"===e&&(e=Jl),this.scope===dc)return e;var t=cc.includes(e)?uc:this.scope;return"".concat(t,":").concat("WEBAPP"===this.mode?"HOST":"WEBAPP",":").concat(e)}},{key:"getOriginSendType",value:function(e){if("error"===e&&(e=Jl),this.scope===dc)return e;var t=cc.includes(e)?uc:this.scope;return"".concat(t,":").concat(this.mode,":").concat(e)}},{key:"_transferPort",value:function(e,t,n){this.targetWindow?"HOST"===this.mode&&this.targetWindow.postMessage({id:Ll(),type:this.getOriginSendType(e),payload:t},this.targetOrigin,n):console.warn("[Bridge] Target window not set. Cannot send port")}},{key:"getReceivePort",value:function(){var e=this;return new Promise((function(t){e.on(Zl,(function(n,r){e.receivePort||(e.receivePort=new Ul(n)),r&&e.receivePort.addPort(r),t(e.receivePort)}))}))}},{key:"getSendPort",value:function(){var e=this;return new Promise((function(t,n){e.on($l,(function(e,r){if(r){var o=new Bl(e,r[0]);t(o)}else n(new Error("no ports transfer"))}))}))}}],[{key:"getGlobalBridge",value:function(t){return new e(t,uc)}},{key:"getNativeBridge",value:function(t){return new e("WEBAPP",dc,t)}},{key:"getBridge",value:function(t,n){if(n===dc||n===uc)throw new Error("Scope cannot be ".concat(dc," or ").concat(uc));return new e(t,n)}}]),e}(),hc=n(7578),mc=n.n(hc);e();var fc=["trackId","userPathAuto","keyFormat"],vc=function(){function t(e){_(this,t),d(this,"options",void 0),d(this,"intlTrackerOptions",void 0),d(this,"tracker",void 0),d(this,"trackerInitPromise",void 0),d(this,"trackId",void 0),this.initialOptions(e)}var n;return g(t,[{key:"initialOptions",value:function(e){var t,n,r,o,i=e||{},a=(i.trackId,i.userPathAuto),s=i.keyFormat,l=hc(i,fc);(this.options=f(f(f({env:"DEV",compactExtraInfo:!0},this.options),l),{},{appId:(null==e?void 0:e.appId)||(null===(t=this.options)||void 0===t?void 0:t.appId)||"180020050100012557",performance:!0===(null==e?void 0:e.performance)||!0===(null===(n=this.options)||void 0===n?void 0:n.performance),error:!0===(null==e?void 0:e.error)||!0===(null===(r=this.options)||void 0===r?void 0:r.error)}),this.intlTrackerOptions=f(f({},this.options),{},{userPathAuto:a,keyFormat:s}),e&&"trackId"in e)&&(this.trackId=e.trackId||"",this.options=f(f(f({},this.options),l),{},{mdata:f(f(f({},null===(o=this.options)||void 0===o?void 0:o.mdata),l.mdata),{},{trackId:this.trackId})}));return this.options}},{key:"loadTacker",value:function(t){var n=this,r=(0,e().loadScript)("https://cdn.marmot-cloud.com/tnpm-package/@antintl-intl-tracker/1.3.0/dist/common.min.js","CompatibleTrackerFull");return r?r.then((function(e){var r=e.variable;if(r)return new r(n.initialOptions(t))})):Promise.resolve(void 0)}},{key:"initTracker",value:(n=c(s().mark((function e(t){var n,r=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.tracker||t){e.next=2;break}return e.abrupt("return",this.tracker);case 2:if(t||!this.trackerInitPromise){e.next=4;break}return e.abrupt("return",this.trackerInitPromise);case 4:if(n=this.loadTacker(t).then((function(e){var n,o,i,a,s,l;return e&&(e.set({keyFormat:null!==(n=null!==(o=null==t?void 0:t.keyFormat)&&void 0!==o?o:null===(i=r.intlTrackerOptions)||void 0===i?void 0:i.keyFormat)&&void 0!==n?n:"origin",userPathAuto:null!==(a=null!==(s=null==t?void 0:t.userPathAuto)&&void 0!==s?s:null===(l=r.intlTrackerOptions)||void 0===l?void 0:l.userPathAuto)&&void 0!==a&&a}),r.tracker=e),e})),t){e.next=8;break}return this.trackerInitPromise=n.finally((function(){r.trackerInitPromise=void 0})),e.abrupt("return",this.trackerInitPromise);case 8:return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"safeCall",value:function(e){return this.initTracker().then(e)}},{key:"setTrackId",value:function(e){this.trackId=e,this.set({mdata:{trackId:e}})}},{key:"set",value:function(e){this.safeCall((function(t){return null==t?void 0:t.set(e)}))}},{key:"pv",value:function(){this.safeCall((function(e){return null==e?void 0:e.pv()}))}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.trackId&&(t[0].d18=this.trackId),this.safeCall((function(e){return null==e?void 0:e.log.apply(e,t)}))}},{key:"click",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.click.apply(e,t)}))}},{key:"expo",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.expo.apply(e,t)}))}},{key:"onSendData",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.onSendData.apply(e,t)}))}},{key:"offSendData",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.offSendData.apply(e,t)}))}},{key:"pageMonitor",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.pageMonitor.apply(e,t)}))}},{key:"reportCustomizedPerformance",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.reportCustomizedPerformance.apply(e,t)}))}}]),t}(),gc=new vc;var yc,_c;(_c=yc||(yc={}))["ar-SA"]="ar-SA",_c.kn="kn",_c.as="as",_c.bho="bho",_c["pl-PL"]="pl-PL",_c["ko-KR"]="ko-KR",_c["da-DK"]="da-DK",_c["de-DE"]="de-DE",_c["ru-RU"]="ru-RU",_c["fr-FR"]="fr-FR",_c.gu="gu",_c["nl-BE"]="nl-BE",_c["nl-NL"]="nl-NL",_c["cs-CZ"]="cs-CZ",_c.ro="ro",_c["lo-LA"]="lo-LA",_c["my-MM"]="my-MM",_c["bn-BD"]="bn-BD",_c["bn-IN"]="bn-IN",_c.mr="mr",_c["ms-MY"]="ms-MY",_c.ml="ml",_c.mni="mni",_c["ne-NP"]="ne-NP",_c.or="or",_c["pt-BR"]="pt-BR",_c["pt-PT"]="pt-PT",_c.pa="pa",_c["sv-SE"]="sv-SE",_c["ja-JP"]="ja-JP",_c.sr="sr",_c["si-LK"]="si-LK",_c["sk-SK"]="sk-SK",_c["tr-TR"]="tr-TR",_c["tl-PH"]="tl-PH",_c.te="te",_c.ta="ta",_c["th-TH"]="th-TH",_c["ur-PK"]="ur-PK",_c["ur-IN"]="ur-IN",_c["uk-UA"]="uk-UA",_c["iw-IL"]="iw-IL",_c["es-ES"]="es-ES",_c["es-MX"]="es-MX",_c.hu="hu",_c["it-IT"]="it-IT",_c["in-ID"]="in-ID",_c["hi-IN"]="hi-IN",_c["vi-VN"]="vi-VN",_c["en-PK"]="en-PK",_c["en-PL"]="en-PL",_c["en-FR"]="en-FR",_c["en-PH"]="en-PH",_c["en-CZ"]="en-CZ",_c["en-CA"]="en-CA",_c["en-MM"]="en-MM",_c["en-US"]="en-US",_c["en-BD"]="en-BD",_c["en-MY"]="en-MY",_c["en-NP"]="en-NP",_c["en-LK"]="en-LK",_c["en-TH"]="en-TH",_c["en-ES"]="en-ES",_c["en-SG"]="en-SG",_c["en-HU"]="en-HU",_c["en-ID"]="en-ID",_c["en-GB"]="en-GB",_c["en-VN"]="en-VN",_c["en-HK"]="en-HK",_c["en-KR"]="en-KR",_c["zh-TW"]="zh-TW",_c["zh-HK"]="zh-HK",_c["zh-SG"]="zh-SG",_c["zh-CN"]="zh-CN",_c["ar-IQ"]="ar-IQ",_c["ckb-IQ"]="ckb-IQ",_c.ku="ku",_c["kk-KZ"]="kk-KZ",_c.af="af",_c.am="am",_c.az="az",_c.be="be",_c.bg="bg",_c.bs="bs",_c.ca="ca",_c.cy="cy",_c.el="el",_c.eo="eo",_c.et="et",_c.eu="eu",_c.fa="fa",_c.fi="fi",_c.gd="gd",_c.gl="gl",_c.ha="ha",_c.haw="haw",_c.hr="hr",_c.ig="ig",_c.is="is",_c.ka="ka",_c.km="km",_c.ky="ky",_c.lb="lb",_c.ln="ln",_c.lt="lt",_c.lv="lv",_c.mg="mg",_c.mk="mk",_c.mn="mn",_c.mt="mt",_c.om="om",_c.ps="ps",_c.qu="qu",_c.rw="rw",_c.sl="sl",_c.so="so",_c.sq="sq",_c.sw="sw",_c.tg="tg",_c.ti="ti",_c.ug="ug",_c.uz="uz",_c.yo="yo",_c.zu="zu";var bc={};bc[yc["ar-SA"]]="阿拉伯语 (沙特阿拉伯)",bc[yc.kn]="埃纳德语",bc[yc.as]="阿萨姆语",bc[yc.bho]="博杰普尔语",bc[yc["pl-PL"]]="波兰语 (波兰)",bc[yc["ko-KR"]]="朝鲜语 (韩国)",bc[yc["da-DK"]]="丹麦语 (丹麦)",bc[yc["de-DE"]]="德语 (德国)",bc[yc["ru-RU"]]="俄语 (俄罗斯)",bc[yc["fr-FR"]]="法语 (法国)",bc[yc.gu]="古加拉提语",bc[yc["nl-BE"]]="荷兰语 (比利时)",bc[yc["nl-NL"]]="荷兰语 (荷兰)",bc[yc["cs-CZ"]]="捷克语 (捷克共和国)",bc[yc.ro]="罗马尼亚语",bc[yc["lo-LA"]]="老挝语 (老挝)",bc[yc["my-MM"]]="缅甸语 (缅甸)",bc[yc["bn-BD"]]="孟加拉语 (孟加拉)",bc[yc["bn-IN"]]="孟加拉语 (印度)",bc[yc.mr]="马拉地语",bc[yc["ms-MY"]]="马来语 (马来西亚)",bc[yc.ml]="马来亚拉姆语",bc[yc.mni]="曼尼普里语",bc[yc["ne-NP"]]="尼泊尔语 (尼泊尔)",bc[yc.or]="欧里亚语",bc[yc["pt-BR"]]="葡萄牙语 (巴西)",bc[yc["pt-PT"]]="葡萄牙语 (葡萄牙)",bc[yc.pa]="旁遮普语",bc[yc["sv-SE"]]="瑞典语 (瑞典)",bc[yc["ja-JP"]]="日语 (日本)",bc[yc.sr]="塞尔维亚语",bc[yc["si-LK"]]="僧伽罗语 (斯里兰卡)",bc[yc["sk-SK"]]="斯洛伐克语 (斯洛伐克)",bc[yc["tr-TR"]]="土耳其语 (土耳其)",bc[yc["tl-PH"]]="塔加路族语 (菲律宾)",bc[yc.te]="泰卢固语",bc[yc.ta]="泰米尔语",bc[yc["th-TH"]]="泰语 (泰国)",bc[yc["ur-PK"]]="乌尔都语 (巴基斯坦)",bc[yc["ur-IN"]]="乌尔都语 (印度)",bc[yc["uk-UA"]]="乌克兰语 (乌克兰)",bc[yc["iw-IL"]]="希伯来语 (以色列)",bc[yc["es-ES"]]="西班牙语 (西班牙)",bc[yc["es-MX"]]="西班牙语 (墨西哥)",bc[yc.hu]="匈牙利语",bc[yc["it-IT"]]="意大利语 (意大利)",bc[yc["in-ID"]]="印度尼西亚语 (印度尼西亚)",bc[yc["hi-IN"]]="印地语 (印度)",bc[yc["vi-VN"]]="越南语 (越南)",bc[yc["en-PK"]]="英语 (巴基斯坦)",bc[yc["en-PL"]]="英语 (波兰)",bc[yc["en-FR"]]="英语 (法国)",bc[yc["en-PH"]]="英语 (菲律宾)",bc[yc["en-CZ"]]="英语 (捷克共和国)",bc[yc["en-CA"]]="英语 (加拿大)",bc[yc["en-MM"]]="英语 (缅甸)",bc[yc["en-US"]]="英语 (美国)",bc[yc["en-BD"]]="英语 (孟加拉)",bc[yc["en-MY"]]="英语 (马来西亚)",bc[yc["en-NP"]]="英语 (尼泊尔)",bc[yc["en-LK"]]="英语 (斯里兰卡)",bc[yc["en-TH"]]="英语 (泰国)",bc[yc["en-ES"]]="英语 (西班牙)",bc[yc["en-SG"]]="英语 (新加坡)",bc[yc["en-HU"]]="英语 (匈牙利)",bc[yc["en-ID"]]="英语 (印度尼西亚)",bc[yc["en-GB"]]="英语 (英国)",bc[yc["en-VN"]]="英语 (越南)",bc[yc["en-HK"]]="英语 (中国香港)",bc[yc["en-KR"]]="英语 (韩国)",bc[yc["zh-TW"]]="繁体中文 (中国台湾)",bc[yc["zh-HK"]]="繁体中文 (中国香港)",bc[yc["zh-SG"]]="简体中文 (新加坡)",bc[yc["zh-CN"]]="简体中文 (中国)",bc[yc["ar-IQ"]]="阿拉伯语 (伊拉克)",bc[yc["ckb-IQ"]]="中库尔德语 (伊拉克)",bc[yc.ku]="库尔德语",bc[yc["kk-KZ"]]="哈萨克语",bc[yc.af]="南非语",bc[yc.am]="阿姆哈拉语",bc[yc.az]="阿塞拜疆语",bc[yc.be]="白俄罗斯语",bc[yc.bg]="保加利亚语",bc[yc.bs]="波斯尼亚语",bc[yc.ca]="加泰罗尼亚语",bc[yc.cy]="威尔士语",bc[yc.el]="现代希腊语",bc[yc.eo]="世界语",bc[yc.et]="爱沙尼亚语",bc[yc.eu]="巴斯克语",bc[yc.fa]="波斯语",bc[yc.fi]="芬兰语",bc[yc.gd]="爱尔兰语",bc[yc.gl]="加利西亚语",bc[yc.ha]="豪萨语",bc[yc.haw]="夏威夷语",bc[yc.hr]="克罗地亚语",bc[yc.ig]="伊博语",bc[yc.is]="冰岛语",bc[yc.ka]="格鲁吉亚语",bc[yc.km]="高棉语",bc[yc.ky]="吉尔吉斯语",bc[yc.lb]="卢森堡语",bc[yc.ln]="林格拉语",bc[yc.lt]="立陶宛语",bc[yc.lv]="拉脱维亚语",bc[yc.mg]="马尔加什语",bc[yc.mk]="马其顿语",bc[yc.mn]="蒙古文",bc[yc.mt]="马耳他语",bc[yc.om]="奥罗莫语",bc[yc.ps]="普什图语",bc[yc.qu]="克丘亚语",bc[yc.rw]="卢旺达语",bc[yc.sl]="斯洛文尼亚语",bc[yc.so]="索马里语",bc[yc.sq]="阿尔巴尼亚语",bc[yc.sw]="斯瓦希里语",bc[yc.tg]="塔吉克语",bc[yc.ti]="蒂格尼亚语",bc[yc.ug]="维吾尔语",bc[yc.uz]="乌兹别克语",bc[yc.yo]="约鲁巴语",bc[yc.zu]="祖鲁语";var Ec,Sc={};Sc[yc["ar-SA"]]="Arabic (Saudi Arabia)",Sc[yc.kn]="Kannada",Sc[yc.as]="Assamese",Sc[yc.bho]="Bhojpuri",Sc[yc["pl-PL"]]="Polish (Poland)",Sc[yc["ko-KR"]]="Korean (Korean)",Sc[yc["da-DK"]]="Danish (Denmark)",Sc[yc["de-DE"]]="German (Germany)",Sc[yc["ru-RU"]]="Russian (Russia)",Sc[yc["fr-FR"]]="French (France)",Sc[yc.gu]="Gujarati",Sc[yc["nl-BE"]]="Dutch (Belgium)",Sc[yc["nl-NL"]]="Dutch (Netherlands)",Sc[yc["cs-CZ"]]="Czech (Czech Republic)",Sc[yc.ro]="Romanian",Sc[yc["lo-LA"]]="Lao (Laos)",Sc[yc["my-MM"]]="Burmese (Myanmar)",Sc[yc["bn-BD"]]="Bengali (Bangladesh)",Sc[yc["bn-IN"]]="Bengali (India)",Sc[yc.mr]="Marathi",Sc[yc["ms-MY"]]="Malay (Malaysia)",Sc[yc.ml]="Malayalam",Sc[yc.mni]="Manipuri",Sc[yc["ne-NP"]]="Nepalese (Nepal)",Sc[yc.or]="Odia (Oriya)",Sc[yc["pt-BR"]]="Portuguese (Brazil)",Sc[yc["pt-PT"]]="Portuguese (Portugal)",Sc[yc.pa]="Punjabi",Sc[yc["sv-SE"]]="Swedish (Sweden)",Sc[yc["ja-JP"]]="Japanese (Japanese)",Sc[yc.sr]="Serbian",Sc[yc["si-LK"]]="Sinhala (Sri Lanka)",Sc[yc["sk-SK"]]="Slovak (Slovakia)",Sc[yc["tr-TR"]]="Turkish (Turkish)",Sc[yc["tl-PH"]]="Tagalog (Philippines)",Sc[yc.te]="Telugu",Sc[yc.ta]="Tamil",Sc[yc["th-TH"]]="Thai (Thailand)",Sc[yc["ur-PK"]]="Ulduwen (Pakistan)",Sc[yc["ur-IN"]]="Urduwen (India)",Sc[yc["uk-UA"]]="Ukrainian (Ukraine)",Sc[yc["iw-IL"]]="Hebrew (Israel)",Sc[yc["es-ES"]]="Spanish (Spain)",Sc[yc["es-MX"]]="Spanish (Mexico)",Sc[yc.hu]="Hungarian",Sc[yc["it-IT"]]="Italian (Italian)",Sc[yc["in-ID"]]="Indonesian (Indonesia)",Sc[yc["hi-IN"]]="Hindi (India)",Sc[yc["vi-VN"]]="Vietnamese (Vietnam)",Sc[yc["en-PK"]]="English (Pakistan)",Sc[yc["en-PL"]]="English (Poland)",Sc[yc["en-FR"]]="English (France)",Sc[yc["en-PH"]]="English (Philippines)",Sc[yc["en-CZ"]]="English (Czech Republic)",Sc[yc["en-CA"]]="English (Canada)",Sc[yc["en-MM"]]="English (Myanmar)",Sc[yc["en-US"]]="English (US)",Sc[yc["en-BD"]]="English (Bangladesh)",Sc[yc["en-MY"]]="English (Malaysia)",Sc[yc["en-NP"]]="English (Nepal)",Sc[yc["en-LK"]]="English (Sri Lanka)",Sc[yc["en-TH"]]="English (Thailand)",Sc[yc["en-ES"]]="English (Spain)",Sc[yc["en-SG"]]="English (Singapore)",Sc[yc["en-HU"]]="English (Hungary)",Sc[yc["en-ID"]]="English (Indonesia)",Sc[yc["en-GB"]]="English (UK)",Sc[yc["en-VN"]]="English (Vietnam)",Sc[yc["en-HK"]]="English (Hong Kong)",Sc[yc["en-KR"]]="English (Korean)",Sc[yc["zh-TW"]]="Chinese Traditional (Taiwan)",Sc[yc["zh-HK"]]="Chinese Traditional (Hong Kong)",Sc[yc["zh-SG"]]="Chinese Simplified (Singapore)",Sc[yc["zh-CN"]]="Chinese Simplified (China)",Sc[yc["ar-IQ"]]="Arabic (Iraq)",Sc[yc["ckb-IQ"]]="Central Kurdish (Iraq)",Sc[yc.ku]="Kurdish",Sc[yc["kk-KZ"]]="Kazakh",Sc[yc.af]="Afrikaans",Sc[yc.am]="Amharic",Sc[yc.az]="Azerbaijani",Sc[yc.be]="Belarusian",Sc[yc.bg]="Bulgarian",Sc[yc.bs]="Bosnian",Sc[yc.ca]="Catalan",Sc[yc.cy]="Welsh",Sc[yc.el]="Greek",Sc[yc.eo]="Esperanto",Sc[yc.et]="Estonian",Sc[yc.eu]="Basque",Sc[yc.fa]="Persian",Sc[yc.fi]="Finnish",Sc[yc.gd]="Scots Gaelic",Sc[yc.gl]="Galician",Sc[yc.ha]="Hausa",Sc[yc.haw]="Hawaiian",Sc[yc.hr]="Croatian",Sc[yc.ig]="Igbo",Sc[yc.is]="Icelandic",Sc[yc.ka]="Georgian",Sc[yc.km]="Khmer",Sc[yc.ky]="Kyrgyz",Sc[yc.lb]="Luxembourgish",Sc[yc.ln]="Lingala",Sc[yc.lt]="Lithuanian",Sc[yc.lv]="Latvian",Sc[yc.mg]="Malagasy",Sc[yc.mk]="Macedonian",Sc[yc.mn]="Mongolian",Sc[yc.mt]="Maltese",Sc[yc.om]="Oromo",Sc[yc.ps]="Pashto",Sc[yc.qu]="Quechua",Sc[yc.rw]="Kinyarwanda",Sc[yc.sl]="Slovenian",Sc[yc.so]="Somali",Sc[yc.sq]="Albanian",Sc[yc.sw]="Swahili",Sc[yc.tg]="Tajik",Sc[yc.ti]="Tigrinya",Sc[yc.ug]="Uyghur",Sc[yc.uz]="Uzbek",Sc[yc.yo]="Yoruba",Sc[yc.zu]="Zulu",function(e){e["ar-SA"]="Arabic",e.kn="kannada",e.as="assamese",e.bho="bhojpuri",e["pl-PL"]="Polish",e["ko-KR"]="Korean",e["da-DK"]="danish",e["de-DE"]="German",e["ru-RU"]="Russian",e["fr-FR"]="French",e.gu="gujarati",e["nl-BE"]="Dutch(Belgium)",e["nl-NL"]="Dutch",e["cs-CZ"]="czech",e.ro="romanian",e["lo-LA"]="Lao (Laos)",e["my-MM"]="Burmese",e["bn-BD"]="Bangadesh",e["bn-IN"]="bangadeshIndia",e.mr="marathi",e["ms-MY"]="Malay",e.ml="malayalam",e.mni="manipuri",e["ne-NP"]="NepaliNepal",e.or="oriya",e["pt-BR"]="portuguese (Brazil)",e["pt-PT"]="Portuguese",e.pa="panjabi",e["sv-SE"]="swedish",e["ja-JP"]="Japanese",e.sr="Serbian",e["si-LK"]="Sinhala",e["sk-SK"]="slovak",e["tr-TR"]="Turkish",e["tl-PH"]="Filipino",e.te="telugu",e.ta="tamil",e["th-TH"]="Thai",e["ur-PK"]="Urdu",e["ur-IN"]="urduIndia",e["uk-UA"]="Ukrainian",e["iw-IL"]="Hebrew",e["es-ES"]="Spanish",e["es-MX"]="Spanish (Mexico)",e.hu="hungarian",e["it-IT"]="Italian",e["in-ID"]="Indonesian",e["hi-IN"]="Hindi",e["vi-VN"]="Vietnamese",e["en-PK"]="Pakistan English",e["en-PL"]="Poland English",e["en-FR"]="English (France)",e["en-PH"]="Philippines English",e["en-CZ"]="Czech English",e["en-CA"]="Canadian English",e["en-MM"]="Myanmar English",e["en-US"]="English",e["en-BD"]="Bangladesh English",e["en-MY"]="Malaysia English",e["en-NP"]="Nepal English",e["en-LK"]="Srilanka English",e["en-TH"]="Thai English",e["en-ES"]="English (Spain)",e["en-SG"]="singapore english",e["en-HU"]="Hungarian English",e["en-ID"]="Indonesian English",e["en-GB"]="British English",e["en-VN"]="Vietnamese English",e["en-HK"]="Hong Kong English",e["en-KR"]="Korean English",e["zh-TW"]="Traditional Chinese",e["zh-HK"]="Traditional Chinese(HK)",e["zh-SG"]="Chinese (Singapore)",e["zh-CN"]="Simplified Chinese",e["ar-IQ"]="Arabic (Iraq)",e["ckb-IQ"]="Central Kurdish (Iraq)",e.ku="Kurdish",e["kk-KZ"]="Kazakh"}(Ec||(Ec={}));var Ac,kc,Tc,Pc={"zh-hans":yc["zh-CN"],"zh-hant":yc["zh-TW"],ar:yc["ar-SA"],bn:yc["bn-BD"],cs:yc["cs-CZ"],da:yc["da-DK"],de:yc["de-DE"],en:yc["en-US"],es:yc["es-ES"],fr:yc["fr-FR"],hi:yc["hi-IN"],in:yc["in-ID"],it:yc["it-IT"],iw:yc["iw-IL"],ja:yc["ja-JP"],ko:yc["ko-KR"],lo:yc["lo-LA"],ms:yc["ms-MY"],my:yc["my-MM"],ne:yc["ne-NP"],nl:yc["nl-NL"],pl:yc["pl-PL"],pt:yc["pt-PT"],ru:yc["ru-RU"],si:yc["si-LK"],sk:yc["sk-SK"],sv:yc["sv-SE"],th:yc["th-TH"],tl:yc["tl-PH"],tr:yc["tr-TR"],uk:yc["uk-UA"],ur:yc["ur-PK"],vi:yc["vi-VN"],zh:yc["zh-CN"],kk:yc["kk-KZ"]},wc={"zh-hant":yc["zh-TW"],"zh-hans":yc["zh-CN"]},Ic=function(e){return Object.keys(e||{}).map((function(t){return e[t]}))},Cc=function(e,t){return-1!==e.indexOf(t)};!function(e){e.ar_EG="ar_EG",e.az_AZ="az_AZ",e.bg_BG="bg_BG",e.bn_BD="bn_BD",e.by_BY="by_BY",e.ca_ES="ca_ES",e.cs_CZ="cs_CZ",e.da_DK="da_DK",e.de_DE="de_DE",e.el_GR="el_GR",e.en_GB="en_GB",e.en_US="en_US",e.es_ES="es_ES",e.et_EE="et_EE",e.fa_IR="fa_IR",e.fi_FI="fi_FI",e.fr_BE="fr_BE",e.fr_CA="fr_CA",e.fr_FR="fr_FR",e.ga_IE="ga_IE",e.gl_ES="gl_ES",e.he_IL="he_IL",e.hi_IN="hi_IN",e.hr_HR="hr_HR",e.hu_HU="hu_HU",e.hy_AM="hy_AM",e.id_ID="id_ID",e.it_IT="it_IT",e.is_IS="is_IS",e.ja_JP="ja_JP",e.ka_GE="ka_GE",e.kmr_IQ="kmr_IQ",e.kn_IN="kn_IN",e.kk_KZ="kk_KZ",e.km_KH="km_KH",e.ko_KR="ko_KR",e.lt_LT="lt_LT",e.lv_LV="lv_LV",e.mk_MK="mk_MK",e.ml_IN="ml_IN",e.mn_MN="mn_MN",e.ms_MY="ms_MY",e.nb_NO="nb_NO",e.ne_NP="ne_NP",e.nl_BE="nl_BE",e.nl_NL="nl_NL",e.pl_PL="pl_PL",e.pt_BR="pt_BR",e.pt_PT="pt_PT",e.ro_RO="ro_RO",e.ru_RU="ru_RU",e.si_LK="si_LK",e.sk_SK="sk_SK",e.sr_RS="sr_RS",e.sl_SI="sl_SI",e.sv_SE="sv_SE",e.ta_IN="ta_IN",e.th_TH="th_TH",e.tr_TR="tr_TR",e.tk_TK="tk_TK",e.ur_PK="ur_PK",e.uk_UA="uk_UA",e.uz_UZ="uz_UZ",e.vi_VN="vi_VN",e.zh_CN="zh_CN",e.zh_HK="zh_HK",e.zh_TW="zh_TW"}(Ac||(Ac={})),Ic(Ac),function(e){e.af="af",e.am="am",e["ar-dz"]="ar-dz",e["ar-iq"]="ar-iq",e["ar-kw"]="ar-kw",e["ar-ly"]="ar-ly",e["ar-ma"]="ar-ma",e["ar-sa"]="ar-sa",e["ar-tn"]="ar-tn",e.ar="ar",e.az="az",e.be="be",e.bg="bg",e.bi="bi",e.bm="bm",e["bn-bd"]="bn-bd",e.bn="bn",e.bo="bo",e.br="br",e.bs="bs",e.ca="ca",e.cs="cs",e.cv="cv",e.cy="cy",e.da="da",e["de-at"]="de-at",e["de-ch"]="de-ch",e.de="de",e.dv="dv",e.el="el",e["en-au"]="en-au",e["en-ca"]="en-ca",e["en-gb"]="en-gb",e["en-ie"]="en-ie",e["en-il"]="en-il",e["en-in"]="en-in",e["en-nz"]="en-nz",e["en-sg"]="en-sg",e["en-tt"]="en-tt",e.en="en",e.eo="eo",e["es-do"]="es-do",e["es-mx"]="es-mx",e["es-PR"]="es-PR",e["es-us"]="es-us",e.es="es",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.fo="fo",e["fr-ca"]="fr-ca",e["fr-ch"]="fr-ch",e.fr="fr",e.fy="fy",e.ga="ga",e.gd="gd",e.gl="gl",e["gom-latn"]="gom-latn",e.gu="gu",e.he="he",e.hi="hi",e.hr="hr",e.ht="ht",e.hu="hu",e["hy-am"]="hy-am",e.id="id",e.is="is",e["it-ch"]="it-ch",e.it="it",e.ja="ja",e.jv="jv",e.ka="ka",e.kk="kk",e.km="km",e.kn="kn",e.ko="ko",e.ku="ku",e.ky="ky",e.lb="lb",e.lo="lo",e.lt="lt",e.lv="lv",e.me="me",e.mi="mi",e.mk="mk",e.ml="ml",e.mn="mn",e.mr="mr",e["ms-my"]="ms-my",e.ms="ms",e.mt="mt",e.my="my",e.nb="nb",e.ne="ne",e["nl-be"]="nl-be",e.nl="nl",e.nn="nn",e["oc-lnc"]="oc-lnc",e["pa-in"]="pa-in",e.pl="pl",e["pt-br"]="pt-br",e.pt="pt",e.rn="rn",e.ro="ro",e.ru="ru",e.rw="rw",e.sd="sd",e.se="se",e.si="si",e.sk="sk",e.sl="sl",e.sq="sq",e["sr-cyrl"]="sr-cyrl",e.sr="sr",e.ss="ss",e["sv-fi"]="sv-fi",e.sv="sv",e.sw="sw",e.ta="ta",e.te="te",e.tet="tet",e.tg="tg",e.th="th",e.tk="tk",e["tl-ph"]="tl-ph",e.tlh="tlh",e.tr="tr",e.tzl="tzl",e["tzm-latn"]="tzm-latn",e.tzm="tzm",e["ug-cn"]="ug-cn",e.uk="uk",e.ur="ur",e["uz-latn"]="uz-latn",e.uz="uz",e.vi="vi",e["x-pseudo"]="x-pseudo",e.yo="yo",e["zh-cn"]="zh-cn",e["zh-hk"]="zh-hk",e["zh-tw"]="zh-tw",e.zh="zh"}(kc||(kc={})),Ic(kc),function(e){e.af="af",e["ar-dz"]="ar-dz",e["ar-kw"]="ar-kw",e["ar-ly"]="ar-ly",e["ar-ma"]="ar-ma",e["ar-sa"]="ar-sa",e["ar-tn"]="ar-tn",e.ar="ar",e.az="az",e.be="be",e.bg="bg",e.bm="bm",e["bn-bd"]="bn-bd",e.bn="bn",e.bo="bo",e.br="br",e.bs="bs",e.ca="ca",e.cs="cs",e.cv="cv",e.cy="cy",e.da="da",e["de-at"]="de-at",e["de-ch"]="de-ch",e.de="de",e.dv="dv",e.el="el",e["en-au"]="en-au",e["en-ca"]="en-ca",e["en-gb"]="en-gb",e["en-ie"]="en-ie",e["en-il"]="en-il",e["en-in"]="en-in",e["en-nz"]="en-nz",e["en-sg"]="en-sg",e.eo="eo",e["es-do"]="es-do",e["es-mx"]="es-mx",e["es-us"]="es-us",e.es="es",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.fil="fil",e.fo="fo",e["fr-ca"]="fr-ca",e["fr-ch"]="fr-ch",e.fr="fr",e.fy="fy",e.ga="ga",e.gd="gd",e.gl="gl",e["gom-deva"]="gom-deva",e["gom-latn"]="gom-latn",e.gu="gu",e.he="he",e.hi="hi",e.hr="hr",e.hu="hu",e["hy-am"]="hy-am",e.id="id",e.is="is",e["it-ch"]="it-ch",e.it="it",e.ja="ja",e.jv="jv",e.ka="ka",e.kk="kk",e.km="km",e.kn="kn",e.ko="ko",e.ku="ku",e.ky="ky",e.lb="lb",e.lo="lo",e.lt="lt",e.lv="lv",e.me="me",e.mi="mi",e.mk="mk",e.ml="ml",e.mn="mn",e.mr="mr",e["ms-my"]="ms-my",e.ms="ms",e.mt="mt",e.my="my",e.nb="nb",e.ne="ne",e["nl-be"]="nl-be",e.nl="nl",e.nn="nn",e["oc-lnc"]="oc-lnc",e["pa-in"]="pa-in",e.pl="pl",e["pt-br"]="pt-br",e.pt="pt",e.ro="ro",e.ru="ru",e.sd="sd",e.se="se",e.si="si",e.sk="sk",e.sl="sl",e.sq="sq",e["sr-cyrl"]="sr-cyrl",e.sr="sr",e.ss="ss",e.sv="sv",e.sw="sw",e.ta="ta",e.te="te",e.tet="tet",e.tg="tg",e.th="th",e.tk="tk",e["tl-ph"]="tl-ph",e.tlh="tlh",e.tr="tr",e.tzl="tzl",e["tzm-latn"]="tzm-latn",e.tzm="tzm",e["ug-cn"]="ug-cn",e.uk="uk",e.ur="ur",e["uz-latn"]="uz-latn",e.uz="uz",e.vi="vi",e["x-pseudo"]="x-pseudo",e.yo="yo",e["zh-cn"]="zh-cn",e["zh-hk"]="zh-hk",e["zh-mo"]="zh-mo",e["zh-tw"]="zh-tw"}(Tc||(Tc={})),Ic(Tc);var Rc,Nc,Oc,Dc,Lc,Mc,xc,Uc,Bc,Kc,Hc,Fc,Yc,jc,Gc,zc;yc["ar-IQ"],Ac.ar_EG,Tc.ar,kc.ar,yc["ar-SA"],Ac.ar_EG,Tc["ar-sa"],kc["ar-sa"],yc["bn-BD"],Ac.bn_BD,Tc["bn-bd"],kc["bn-bd"],yc["bn-IN"],Ac.bn_BD,Tc.bn,kc.bn,yc["cs-CZ"],Ac.cs_CZ,Tc.cs,kc.cs,yc["da-DK"],Ac.da_DK,Tc.da,kc.da,yc["de-DE"],Ac.de_DE,Tc.de,kc.de,yc["en-BD"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-CA"],Ac.en_US,Tc["en-ca"],kc["en-ca"],yc["en-CZ"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-ES"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-FR"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-GB"],Ac.en_GB,Tc["en-gb"],kc["en-gb"],yc["en-HU"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-ID"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-LK"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-MM"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-MY"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-NP"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-PH"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-PK"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-PL"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-SG"],Ac.en_US,Tc["en-sg"],kc.en,yc["en-TH"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-US"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-VN"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-HK"],Ac.en_US,Tc["en-gb"],kc.en,yc["en-KR"],Ac.en_US,Tc["en-gb"],kc.en,yc["es-ES"],Ac.es_ES,Tc.es,kc.es,yc["es-MX"],Ac.es_ES,Tc.es,kc.es,yc["fr-FR"],Ac.fr_FR,Tc.fr,kc.fr,yc["hi-IN"],Ac.hi_IN,Tc.hi,kc.hi,yc.hu,Ac.hu_HU,Tc.hu,kc.hu,yc["in-ID"],Ac.id_ID,Tc.id,kc.id,yc["it-IT"],Ac.it_IT,Tc.it,kc.it,yc["ja-JP"],Ac.ja_JP,Tc.ja,kc.ja,yc.kn,Ac.kn_IN,Tc.kn,kc.kn,yc["ko-KR"],Ac.ko_KR,Tc.ko,kc.ko,yc.ml,Ac.ml_IN,Tc.ml,kc.ml,yc["ms-MY"],Ac.ms_MY,Tc["ms-my"],kc["ms-my"],yc["ne-NP"],Ac.ne_NP,Tc.ne,kc.ne,yc["nl-BE"],Ac.nl_BE,Tc["nl-be"],kc["nl-be"],yc["nl-NL"],Ac.nl_NL,Tc.nl,kc.nl,yc["pl-PL"],Ac.pl_PL,Tc.pl,kc.pl,yc["pt-BR"],Ac.pt_BR,Tc["pt-br"],kc["pt-br"],yc["pt-PT"],Ac.pt_PT,Tc.pt,kc.pt,yc.ro,Ac.ro_RO,Tc.ro,kc.ro,yc["ru-RU"],Ac.ru_RU,Tc.ru,kc.ru,yc["si-LK"],Ac.si_LK,Tc.si,kc.si,yc["sk-SK"],Ac.sk_SK,Tc.sk,kc.sk,yc.sr,Ac.sr_RS,Tc.sr,kc.sr,yc["sv-SE"],Ac.sv_SE,Tc.sv,kc.sv,yc.ta,Ac.ta_IN,Tc.ta,kc.ta,yc["th-TH"],Ac.th_TH,Tc.th,kc.th,yc["tr-TR"],Ac.tr_TR,Tc.tr,kc.tr,yc["uk-UA"],Ac.uk_UA,Tc.uk,kc.uk,yc["ur-PK"],Ac.ur_PK,Tc.ur,kc.ur,yc["vi-VN"],Ac.vi_VN,Tc.vi,kc.vi,yc["zh-CN"],Ac.zh_CN,Tc["zh-cn"],kc["zh-cn"],yc["zh-HK"],Ac.zh_HK,Tc["zh-hk"],kc["zh-hk"],yc["zh-SG"],Ac.zh_HK,Tc["zh-hk"],kc["zh-hk"],yc["zh-TW"],Ac.zh_TW,Tc["zh-tw"],kc["zh-tw"],yc["kk-KZ"],Ac.kk_KZ,Tc.kk,kc.kk;!function(e){e.ar_SA="ar_SA",e.kn="kn",e.as="as",e.bho="bho",e.pl_PL="pl_PL",e.ko_KR="ko_KR",e.da_DK="da_DK",e.de_DE="de_DE",e.ru_RU="ru_RU",e.fr_FR="fr_FR",e.gu="gu",e.nl_BE="nl_BE",e.nl_NL="nl_NL",e.cs_CZ="cs_CZ",e.ro="ro",e.lo_LA="lo_LA",e.my_MM="my_MM",e.bn_BD="bn_BD",e.bn_IN="bn_IN",e.mr="mr",e.ms_MY="ms_MY",e.ml="ml",e.mni="mni",e.ne_NP="ne_NP",e.or="or",e.pt_BR="pt_BR",e.pt_PT="pt_PT",e.pa="pa",e.sv_SE="sv_SE",e.ja_JP="ja_JP",e.sr="sr",e.si_LK="si_LK",e.sk_SK="sk_SK",e.tr_TR="tr_TR",e.tl_PH="tl_PH",e.te="te",e.ta="ta",e.th_TH="th_TH",e.ur_PK="ur_PK",e.ur_IN="ur_IN",e.uk_UA="uk_UA",e.iw_IL="iw_IL",e.es_ES="es_ES",e.es_MX="es_MX",e.hu="hu",e.it_IT="it_IT",e.in_ID="in_ID",e.hi_IN="hi_IN",e.vi_VN="vi_VN",e.en_PK="en_PK",e.en_PL="en_PL",e.en_FR="en_FR",e.en_PH="en_PH",e.en_CZ="en_CZ",e.en_CA="en_CA",e.en_MM="en_MM",e.en_US="en_US",e.en_BD="en_BD",e.en_MY="en_MY",e.en_NP="en_NP",e.en_LK="en_LK",e.en_TH="en_TH",e.en_ES="en_ES",e.en_SG="en_SG",e.en_HU="en_HU",e.en_ID="en_ID",e.en_GB="en_GB",e.en_VN="en_VN",e.en_HK="en_HK",e.en_KR="en_KR",e.zh_TW="zh_TW",e.zh_HK="zh_HK",e.zh_SG="zh_SG",e.zh_CN="zh_CN",e.ar_IQ="ar_IQ",e.ckb_IQ="ckb_IQ",e.ku="ku",e.kk_KZ="kk_KZ",e.af="af",e.am="am",e.az="az",e.be="be",e.bg="bg",e.bs="bs",e.ca="ca",e.cy="cy",e.el="el",e.eo="eo",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.gd="gd",e.gl="gl",e.ha="ha",e.haw="haw",e.hr="hr",e.ig="ig",e.is="is",e.ka="ka",e.km="km",e.ky="ky",e.lb="lb",e.ln="ln",e.lt="lt",e.lv="lv",e.mg="mg",e.mk="mk",e.mn="mn",e.mt="mt",e.om="om",e.ps="ps",e.qu="qu",e.rw="rw",e.sl="sl",e.so="so",e.sq="sq",e.sw="sw",e.tg="tg",e.ti="ti",e.ug="ug",e.uz="uz",e.yo="yo",e.zu="zu"}(zc||(zc={}));var Vc,Wc,qc=Ic(zc),Jc={};Jc[zc.kn]="AiNaDeYu",Jc[zc.ar_SA]="ALaBoYu (ShaTeALaBo)",Jc[zc.ar_IQ]="ALaBoYu (YiLaKe)",Jc[zc.as]="ASaMuYu",Jc[zc.bho]="BoJiePuErYu",Jc[zc.pl_PL]="BoLanYu (BoLan)",Jc[zc.ko_KR]="ChaoXianYu (HanGuo)",Jc[zc.da_DK]="DanMaiYu (DanMai)",Jc[zc.de_DE]="DeYu (DeGuo)",Jc[zc.ru_RU]="EYu (ELuoSi)",Jc[zc.fr_FR]="FaYu (FaGuo)",Jc[zc.gu]="GuJiaLaTiYu",Jc[zc.nl_BE]="HeLanYu (BiLiShi)",Jc[zc.nl_NL]="HeLanYu (HeLan)",Jc[zc.cs_CZ]="JieKeYu (JieKeGongHeGuo)",Jc[zc.ku]="KuErDeYu",Jc[zc.lo_LA]="LaoWoYu (LaoWo)",Jc[zc.ro]="LuoMaNiYaYu",Jc[zc.mr]="MaLaDiYu",Jc[zc.ms_MY]="MaLaiYu (MaLaiXiYa)",Jc[zc.ml]="MaLaiYaLaMuYu",Jc[zc.mni]="ManNiPuLiYu",Jc[zc.bn_BD]="MengJiaLaYu (MengJiaLa)",Jc[zc.bn_IN]="MengJiaLaYu (YinDu)",Jc[zc.my_MM]="MianDianYu (MianDian)",Jc[zc.ne_NP]="NiBoErYu (NiBoEr)",Jc[zc.or]="OuLiYaYu",Jc[zc.pa]="PangZhePuYu",Jc[zc.pt_BR]="PuTaoYaYu (BaXi)",Jc[zc.pt_PT]="PuTaoYaYu (PuTaoYa)",Jc[zc.ja_JP]="RiYu (RiBen)",Jc[zc.sv_SE]="RuiDianYu (RuiDian)",Jc[zc.sr]="SaiErWeiYaYu",Jc[zc.si_LK]="SengJiaLuoYu (SiLiLanKa)",Jc[zc.sk_SK]="SiLuoFaKeYu (SiLuoFaKe)",Jc[zc.te]="TaiLuGuYu",Jc[zc.ta]="TaiMiErYu",Jc[zc.th_TH]="TaiYu (TaiGuo)",Jc[zc.tl_PH]="TaJiaLuZuYu (FeiLvBin)",Jc[zc.tr_TR]="TuErQiYu (TuErQi)",Jc[zc.ur_PK]="WuErDuYu (BaJiSiTan)",Jc[zc.ur_IN]="WuErDuYu (YinDu)",Jc[zc.uk_UA]="WuKeLanYu (WuKeLan)",Jc[zc.es_ES]="XiBanYaYu (XiBanYa)",Jc[zc.es_MX]="XiBanYaYu (MoXiGe)",Jc[zc.iw_IL]="XiBoLaiYu (YiSeLie)",Jc[zc.hu]="XiongYaLiYu",Jc[zc.it_IT]="YiDaLiYu (YiDaLi)",Jc[zc.hi_IN]="YinDiYu (YinDu)",Jc[zc.in_ID]="YinDuNiXiYaYu (YinDuNiXiYa)",Jc[zc.en_PK]="YingYu (BaJiSiTan)",Jc[zc.en_PL]="YingYu (BoLan)",Jc[zc.en_FR]="YingYu (FaGuo)",Jc[zc.en_PH]="YingYu (FeiLvBin)",Jc[zc.en_CA]="YingYu (JiaNaDa)",Jc[zc.en_CZ]="YingYu (JieKeGongHeGuo)",Jc[zc.en_MY]="YingYu (MaLaiXiYa)",Jc[zc.en_US]="YingYu (MeiGuo)",Jc[zc.en_BD]="YingYu (MengJiaLa)",Jc[zc.en_MM]="YingYu (MianDian)",Jc[zc.en_NP]="YingYu (NiBoEr)",Jc[zc.en_LK]="YingYu (SiLiLanKa)",Jc[zc.en_TH]="YingYu (TaiGuo)",Jc[zc.en_ES]="YingYu (XiBanYa)",Jc[zc.en_SG]="YingYu (XinJiaPo)",Jc[zc.en_HU]="YingYu (XiongYaLi)",Jc[zc.en_ID]="YingYu (YinDuNiXiYa)",Jc[zc.en_GB]="YingYu (YingGuo)",Jc[zc.en_VN]="YingYu (YueNan)",Jc[zc.en_HK]="YingYu (XiangGang)",Jc[zc.en_KR]="YingYu (HanGuo)",Jc[zc.vi_VN]="YueNanYu (YueNan)",Jc[zc.ckb_IQ]="ZhongKuErDeYu (YiLaKe)",Jc[zc.zh_TW]="ZhongWen (TaiWanDiQu)",Jc[zc.zh_HK]="ZhongWen (XiangGang)",Jc[zc.zh_SG]="ZhongWen (XinJiaPo)",Jc[zc.zh_CN]="ZhongWen (ZhongGuo)",Jc[zc.kk_KZ]="HaSaKeYu (HaSaKeSiTan)",Jc[zc.af]="NanFeiYu",Jc[zc.am]="AMuHaLaYu",Jc[zc.az]="ASaiBaiJiangYu",Jc[zc.be]="BaiErLuoSiYu",Jc[zc.bg]="BaoJiaLiYaYu",Jc[zc.bs]="BoSiNiYaYu",Jc[zc.ca]="JiaTaiLuoNiYaYu",Jc[zc.cy]="WeiErShiYu",Jc[zc.el]="XianDaiXiLaYu",Jc[zc.eo]="ShiJieYu",Jc[zc.et]="AiShaNiYaYu",Jc[zc.eu]="BaSiKeYu",Jc[zc.fa]="BoSiYu",Jc[zc.fi]="FenLanYu",Jc[zc.gd]="AiErLanYu",Jc[zc.gl]="JiaLiXiYaYu",Jc[zc.ha]="HaoSaYu",Jc[zc.haw]="XiaWeiYiYu",Jc[zc.hr]="KeLuoDiYaYu",Jc[zc.ig]="YiBoYu",Jc[zc.is]="BingDaoYu",Jc[zc.ka]="GeLuJiYaYu",Jc[zc.km]="GaoMianYu",Jc[zc.ky]="JiErJiSiYu",Jc[zc.lb]="LuSenBaoYu",Jc[zc.ln]="LinGeLaYu",Jc[zc.lt]="LiTaoWanYu",Jc[zc.lv]="LaTuoWeiYaYu",Jc[zc.mg]="MaErJiaShiYu",Jc[zc.mk]="MaQiDunYu",Jc[zc.mn]="MengGuWen",Jc[zc.mt]="MaErTaYu",Jc[zc.om]="AoLuoMoYu",Jc[zc.ps]="PuShiTuYu",Jc[zc.qu]="KeQiuYaYu",Jc[zc.rw]="LuWangDaYu",Jc[zc.sl]="SiLuoWeiNiYaYu",Jc[zc.so]="SuoMaLiYu",Jc[zc.sq]="AErBaNiYaYu",Jc[zc.sw]="SiWaXiLiYu",Jc[zc.tg]="TaJiKeYu",Jc[zc.ti]="DiGeNiYaYu",Jc[zc.ug]="WeiWuErYu",Jc[zc.uz]="WuZiBieKeYu",Jc[zc.yo]="YueLuBaYu",Jc[zc.zu]="ZuLuYu",function(e){e.AiSelected="AiSelected",e.Aliyun="Aliyun",e["ChatGPT3.5"]="ChatGPT3.5",e.Google="Google",e.Papago="Papago",e.DeepL="DeepL",e.Microsoft="Microsoft",e.Amazon="Amazon"}(Vc||(Vc={})),function(e){e.AiSelected="AiSelected",e.Aliyun="Aliyun",e["ChatGPT3.5"]="ChatGPT3.5",e.Google="Google",e.Papago="Papago",e.DeepL="DeepL",e.Microsoft="Microsoft",e.Amazon="Amazon"}(Wc||(Wc={})),Ic(Wc);var Qc=Object.assign(Object.assign({},Wc),{TranslationMemory:"TranslationMemory"}),Zc=(Ic(Qc),{aliyunSupportedLanguages:["ab","sq","ak","ar","an","am","as","az","ast","nch","ee","ay","ga","et","oj","oc","or","om","os","tpi","ba","eu","be","ber","bm","pag","bg","se","bem","byn","bi","bal","is","pl","bs","fa","bho","br","ch","cbk","cv","ts","tt","da","shn","tet","de","nds","sco","dv","kdx","dtp","ru","fo","fr","sa","fil","fj","fi","fur","fvr","kg","km","ngu","kl","ka","gos","gu","gn","kk","ht","ko","ha","nl","cnr","hup","gil","rn","quc","ky","gl","ca","cs","kab","kn","kr","csb","kha","kw","xh","co","mus","crh","tlh","hbs","qu","ks","ku","la","ltg","lv","lo","lt","li","ln","lg","lb","rue","rw","ro","rm","rom","jbo","mg","gv","mt","mr","ml","ms","chm","mk","mh","kek","mai","mfe","mi","mn","bn","my","hmn","umb","nv","af","ne","niu","no","pmn","pap","pa","pt","ps","ny","tw","chr","ja","sv","sm","sg","si","hsb","eo","sl","sw","so","sk","tl","tg","ty","te","ta","th","to","toi","ti","tvl","tyv","tr","tk","wa","war","cy","ve","vo","wo","udm","ur","uz","es","ie","fy","szl","he","hil","haw","el","lfn","sd","hu","sn","ceb","syr","su","hy","ace","iba","ig","io","ilo","iu","it","yi","ia","hi","id","inh","en","yo","vi","zza","jv","zh","zh-tw","yue","zu"],mapAliyunLanguage:function(e){if(e===zc.zh_HK||e===zc.zh_TW||e===zc.zh_SG)return"zh-tw";if(e===zc.in_ID)return"id";if(e===zc.iw_IL)return"he";var t=e.split("_")[0];return Cc(Zc.aliyunSupportedLanguages,t)?t:null},googleSupportedLanguages:["af","sq","am","ar","hy","as","ay","az","bm","eu","be","bn","bho","bs","bg","ca","ceb","zh","zh-CN","zh-TW","co","hr","cs","da","dv","doi","nl","en","eo","et","ee","fil","fi","fr","fy","gl","ka","de","el","gn","gu","ht","ha","haw","he","iw","hi","hmn","hu","is","ig","ilo","id","ga","it","ja","jv","jw","kn","kk","km","rw","gom","ko","kri","ku","ckb","ky","lo","la","lv","ln","lt","lg","lb","mk","mai","mg","ms","ml","mt","mi","mr","mni-Mtei","lus","mn","my","ne","no","ny","or","om","ps","fa","pl","pt","pa","qu","ro","ru","sm","sa","gd","nso","sr","st","sn","sd","si","sk","sl","so","es","su","sw","sv","tl","tg","ta","tt","te","th","ti","ts","tr","tk","ak","uk","ur","ug","uz","vi","cy","xh","yi","yo","zu"],mapGoogleLanguage:function(e){if(e===zc.zh_HK||e===zc.zh_TW||e===zc.zh_SG)return"zh-TW";if(e===zc.in_ID)return"id";if(e===zc.mni)return"mni-Mtei";var t=e.split("_")[0];return Cc(Zc.googleSupportedLanguages,t)?t:null},papagoSupportedLanguages:["ko","en","ja","zh-CN","zh-TW"],mapPapagoLanguage:function(e){if(e===zc.zh_CN)return"zh-CN";if(e===zc.zh_HK||e===zc.zh_TW||e===zc.zh_SG)return"zh-TW";var t=e.split("_")[0];return Cc(Zc.papagoSupportedLanguages,t)?t:null},deepLSupportedSourceLanguages:["AR","BG","CS","DA","DE","EL","EN","ES","ET","FI","FR","HU","ID","IT","JA","KO","LT","LV","NB","NL","PL","PT","RO","RU","SK","SL","SV","TR","UK","ZH"],deepLSupportedLanguages:["AR","BG","CS","DA","DE","EL","EN-GB","EN-US","ES","ET","FI","FR","HU","ID","IT","JA","KO","LT","LV","NB","NL","PL","PT-BR","PT-PT","RO","RU","SK","SL","SV","TR","UK","ZH"],mapDeepLSourceLanguage:function(e){var t=e.toUpperCase();if(e===zc.in_ID)return"ID";var n=t.split("_")[0];return Cc(Zc.deepLSupportedSourceLanguages,n)?n:null},mapDeepLLanguage:function(e){var t=e.toUpperCase();if(e===zc.zh_CN||e===zc.zh_SG)return"ZH";if(e===zc.zh_HK||e===zc.zh_TW)return null;if(e===zc.en_GB||e===zc.en_US||e===zc.pt_BR||e===zc.pt_PT)return t.replace("_","-");if(e===zc.in_ID)return"ID";var n=t.split("_")[0];return"EN"===n?"EN-US":Cc(Zc.deepLSupportedLanguages,n)?n:null},microsoftSupportedLanguages:["af","sq","am","ar","hy","as","az","bn","ba","eu","bho","brx","bs","bg","yue","ca","lzh","zh-Hans","zh-Hant","sn","hr","cs","da","prs","dv","doi","nl","en","et","fo","fj","fil","fi","fr","fr-ca","gl","ka","de","el","gu","ht","ha","he","hi","mww","hu","is","ig","id","ikt","iu","iu-Latn","ga","it","ja","kn","ks","kk","km","rw","tlh-Latn","tlh-Piqd","gom","ko","ku","kmr","ky","lo","lv","lt","ln","dsb","lug","mk","mai","mg","ms","ml","mt","mi","mr","mn-Cyrl","mn-Mong","my","ne","nb","nya","or","ps","fa","pl","pt","pt-pt","pa","otq","ro","run","ru","sm","sr-Cyrl","sr-Latn","st","nso","tn","sd","si","sk","sl","so","es","sw","sv","ty","ta","tt","te","th","bo","ti","to","tr","tk","uk","hsb","ur","ug","uz","vi","cy","xh","yo","yua","zu"],mapMicrosoftLanguage:function(e){if(e===zc.pt_PT)return"pt-pt";if(e===zc.pt_BR)return"pt";if([zc.zh_CN,zc.zh_SG].includes(e))return"zh-Hans";if([zc.zh_HK,zc.zh_TW].includes(e))return"zh-Hant";if(e===zc.iw_IL)return"he";if(e===zc.in_ID)return"id";if(e===zc.ckb_IQ)return"ku";var t=e.split("_")[0];return Cc(Zc.microsoftSupportedLanguages,t)?t:null},amazonSupportedLanguages:["af","sq","am","ar","hy","az","bn","bs","bg","ca","zh","zh-TW","hr","cs","da","fa-AF","nl","en","et","fa","tl","fi","fr","fr-CA","ka","de","el","gu","ht","ha","he","hi","hu","is","id","ga","it","ja","kn","kk","ko","lv","lt","mk","ms","ml","mt","mr","mn","no","ps","pl","pt","pt-PT","pa","ro","ru","sr","si","sk","sl","so","es","es-MX","sw","sv","ta","te","th","tr","uk","ur","uz","vi","cy"],mapAmazonLanguage:function(e){if(e===zc.pt_PT)return"pt-PT";if(e===zc.pt_BR)return"pt";if(e===zc.es_MX)return"es-MX";if(e===zc.in_ID)return"id";if(e===zc.zh_CN||e===zc.zh_SG)return"zh";if(e===zc.zh_HK||e===zc.zh_TW)return"zh-TW";var t=e.split("_")[0];return Cc(Zc.amazonSupportedLanguages,t)?t:null}}),Xc={};Xc[Wc.AiSelected]=qc,Xc[Wc.Aliyun]=qc.filter((function(e){return Boolean(Zc.mapAliyunLanguage(e))})),Xc[Wc["ChatGPT3.5"]]=qc,Xc[Wc.Google]=qc.filter((function(e){return Boolean(Zc.mapGoogleLanguage(e))})),Xc[Wc.Papago]=qc.filter((function(e){return Boolean(Zc.mapPapagoLanguage(e))})),Xc[Wc.DeepL]=qc.filter((function(e){return Boolean(Zc.mapDeepLLanguage(e))})),Xc[Wc.Microsoft]=qc.filter((function(e){return Boolean(Zc.mapMicrosoftLanguage(e))})),Xc[Wc.Amazon]=qc.filter((function(e){return Boolean(Zc.mapAmazonLanguage(e))}));var $c={};$c[Wc.AiSelected]=qc,$c[Wc.Aliyun]=qc.filter((function(e){return Boolean(Zc.mapAliyunLanguage(e))})),$c[Wc["ChatGPT3.5"]]=qc,$c[Wc.Google]=qc.filter((function(e){return Boolean(Zc.mapGoogleLanguage(e))})),$c[Wc.Papago]=qc.filter((function(e){return Boolean(Zc.mapPapagoLanguage(e))})),$c[Wc.DeepL]=qc.filter((function(e){return Boolean(Zc.mapDeepLSourceLanguage(e))})),$c[Wc.Microsoft]=qc.filter((function(e){return Boolean(Zc.mapMicrosoftLanguage(e))})),$c[Wc.Amazon]=qc.filter((function(e){return Boolean(Zc.mapAmazonLanguage(e))})),eu=qc.map((function(e){return[e,Ic(Wc).filter((function(t){return Cc(Xc[t],e)}))]})),tu={},Object.keys(eu||{}).forEach((function(e){var t=eu[e],n=t[0],r=t[1];tu[n]=r}));var eu,tu,nu={};nu[zc.ar_SA]="العربية)السعودية)",nu[zc.kn]="ಕನ್ನಡ",nu[zc.as]="অসমীয়া",nu[zc.bho]="भोजपुरी",nu[zc.pl_PL]="Polski (Polska)",nu[zc.ko_KR]="한국어 (대한민국)",nu[zc.da_DK]="Dansk (Danmark)",nu[zc.de_DE]="Deutsch (Deutschland)",nu[zc.ru_RU]="Русский (Россия)",nu[zc.fr_FR]="Français (France)",nu[zc.gu]="ગુજરાતી",nu[zc.nl_BE]="Nederlands (Belgium)",nu[zc.nl_NL]="Nederlands (Nederland)",nu[zc.cs_CZ]="Čeština (Česká republika)",nu[zc.ro]="Română",nu[zc.lo_LA]="ລາວ (ລາວ)",nu[zc.my_MM]="မြန်မာဘာသာ (မြန်မာ)",nu[zc.bn_BD]="বাংলা (বাংলাদেশ)",nu[zc.bn_IN]="বাংলা (ভারত)",nu[zc.mr]="मराठी",nu[zc.ms_MY]="Bahasa Melayu (Malaysia)",nu[zc.ml]="മലയാളം",nu[zc.mni]="ꯃꯩꯇꯩꯂꯣꯟ",nu[zc.ne_NP]="नेपाली (नेपाल)\t",nu[zc.or]="ଓଡ଼ିଆ",nu[zc.pt_BR]="Português (Brasil)",nu[zc.pt_PT]="Português (Portugal)",nu[zc.pa]="پنجابی",nu[zc.sv_SE]="Svenska (Sverige)",nu[zc.ja_JP]="日本語",nu[zc.sr]="Српски",nu[zc.si_LK]="සිංහල (ශ්රී ලංකාව)",nu[zc.sk_SK]="Slovenčina (Slovensko)",nu[zc.tr_TR]="Türkçe (Türkiye)",nu[zc.tl_PH]="Wikang Tagalog (Philippines)",nu[zc.te]="తెలుగు",nu[zc.ta]="தமிழ்",nu[zc.th_TH]="ไทย (ประเทศไทย)",nu[zc.ur_PK]="اردو)پاکستان)",nu[zc.ur_IN]="اردو)بھارت)",nu[zc.uk_UA]="Українська (Україна)",nu[zc.iw_IL]="עִבְרִית (ישראל)",nu[zc.es_ES]="Español (España)",nu[zc.es_MX]="Español (México)",nu[zc.hu]="Magyar",nu[zc.it_IT]="Italiano (Italia)",nu[zc.in_ID]="Bahasa Indonesia (Indonesia)",nu[zc.hi_IN]="हिन्दी (भारत)",nu[zc.vi_VN]="Tiếng Việt (Việt Nam)",nu[zc.en_PK]="English (Pakistan)",nu[zc.en_PL]="English (Poland)",nu[zc.en_FR]="English (France)",nu[zc.en_PH]="English (Philippines)",nu[zc.en_CZ]="English (Czech Republic)",nu[zc.en_CA]="English (Canada)",nu[zc.en_MM]="English (Myanmar)",nu[zc.en_US]="English (United States)",nu[zc.en_BD]="English (Bangladesh)",nu[zc.en_MY]="English (Malaysia)",nu[zc.en_NP]="English (Nepal)",nu[zc.en_LK]="English (Sri Lanka)",nu[zc.en_TH]="English (Thailand)",nu[zc.en_ES]="English (Spain)",nu[zc.en_SG]="English (Singapore)",nu[zc.en_HU]="English (Hungary)",nu[zc.en_ID]="English (Indonesia)",nu[zc.en_GB]="English (Great Britain)",nu[zc.en_VN]="English (Vietnam)",nu[zc.en_HK]="English (Hong Kong)",nu[zc.en_KR]="English (Korea)",nu[zc.zh_TW]="繁体中文 (中國台灣)",nu[zc.zh_HK]="繁体中文 (中國香港)",nu[zc.zh_SG]="简体中文 (新加坡)",nu[zc.zh_CN]="简体中文",nu[zc.ar_IQ]="العربية (العراق)",nu[zc.ckb_IQ]="کوردیی ناوەندی (عێراق)",nu[zc.ku]="کورمانجی",nu[zc.kk_KZ]="قازاقشا ",nu[zc.af]="Afrikaans",nu[zc.am]="አማርኛ",nu[zc.az]="Azərbaycan",nu[zc.be]="беларуская мова",nu[zc.bg]="Български",nu[zc.bs]="босански",nu[zc.ca]="Català",nu[zc.cy]="Cymraeg",nu[zc.el]="Ελληνικά",nu[zc.eo]="Esperanto",nu[zc.et]="eesti keel",nu[zc.eu]="Euskara",nu[zc.fa]="فارسی",nu[zc.fi]="Suomi",nu[zc.gd]="Gaeilge",nu[zc.gl]="Galego",nu[zc.ha]="هَوُسَ",nu[zc.haw]="ʻŌlelo Hawaiʻi",nu[zc.hr]="Hrvatski",nu[zc.ig]="Asụsụ Igbo",nu[zc.is]="Íslenska",nu[zc.ka]="ქართული",nu[zc.km]="ភាសាខ្មែរ",nu[zc.ky]="кыргыз тили",nu[zc.lb]="Lëtzebuergesch",nu[zc.ln]="Lingála",nu[zc.lt]="lietuvių kalba",nu[zc.lv]="Latviešu valoda",nu[zc.mg]="malagasy",nu[zc.mk]="македонски",nu[zc.mn]="монгол хэл",nu[zc.mt]="Malti",nu[zc.om]="Oromoo",nu[zc.ps]="پښتو",nu[zc.qu]="Quechua",nu[zc.rw]="Ikinyarwanda",nu[zc.sl]="slovenščina",nu[zc.so]="Af-Soomaali",nu[zc.sq]="Gjuha shqipe",nu[zc.sw]="Kiswahili",nu[zc.tg]="тоҷикӣ",nu[zc.ti]="ትግርኛ",nu[zc.ug]="ئۇيغۇر تىلى",nu[zc.uz]="Ўзбек тили",nu[zc.yo]="Èdè Yorùbá",nu[zc.zu]="isiZulu",Wc.AiSelected,(Rc={})[zc.en_US]="AI Selected",Rc[zc.zh_CN]="AI 精选",(Nc={})[zc.en_US]="AI selection of translations",Nc[zc.zh_CN]="多渠道翻译的 AI 精选",$c.AiSelected,Xc.AiSelected,(Oc={})[zc.en_US]="Use ChatGPT 4.0 to compare and select translation results from multiple sources.\nThe translated content will undergo risk control review and may return blank, please check carefully.",Oc[zc.zh_CN]="利用 ChatGPT 4.0 进行多渠道翻译结果的对比和精选;\n翻译内容会经过风控审核,可能会返回空内容,请仔细检查;",(Dc={})[zc.en_US]="Use ChatGPT 4.0 to compare and select translation results from multiple sources.\nThe translated content will undergo risk control review and may return blank, please check carefully.",Dc[zc.zh_CN]="利用 ChatGPT 4.0 进行多渠道翻译结果的对比和精选;\n翻译内容会经过风控审核,可能会返回空内容,请仔细检查;",Wc["ChatGPT3.5"],(Lc={})[zc.en_US]="GPT-3.5",Lc[zc.zh_CN]="GPT-3.5",(Mc={})[zc.en_US]="The translated content will undergo risk control review and may return blank, please check carefully.",Mc[zc.zh_CN]="翻译内容会经过风控审核,可能会返回空内容,请仔细检查",(xc={})[zc.en_US]="The translated content will undergo risk control review and may return blank, please check carefully.",xc[zc.zh_CN]="翻译内容会经过风控审核,可能会返回空内容,请仔细检查",$c["ChatGPT3.5"],Xc["ChatGPT3.5"],Wc.Aliyun,(Uc={})[zc.en_US]="Alibaba",Uc[zc.zh_CN]="阿里云",$c.Aliyun,Xc.Aliyun,Wc.Google,(Bc={})[zc.en_US]="Google",Bc[zc.zh_CN]="Google",$c.Google,Xc.Google,Wc.DeepL,(Kc={})[zc.en_US]="DeepL",Kc[zc.zh_CN]="DeepL",$c.DeepL,Xc.DeepL,Wc.Microsoft,(Hc={})[zc.en_US]="Azure AI",Hc[zc.zh_CN]="Azure AI",$c.Microsoft,Xc.Microsoft,Wc.Amazon,(Fc={})[zc.en_US]="Amazon",Fc[zc.zh_CN]="Amazon",$c.Amazon,Xc.Amazon,Wc.Papago,(Yc={})[zc.en_US]="Papago",Yc[zc.zh_CN]="Papago",(jc={})[zc.en_US]="Papago does not support translating HTML and will automatically skip HTML content during batch translation.",jc[zc.zh_CN]="Papago 不支持翻译 HTML,在批量翻译时会自动跳过 HTML 内容",(Gc={})[zc.en_US]="Papago does not support HTML. Available locales are Chinese, Japanese, Korean, and English. Please check the translation results carefully.",Gc[zc.zh_CN]="Papago 不支持翻译 HTML,仅支持翻译中、日、韩、英,请仔细检查翻译结果",$c.Papago,Xc.Papago;var ru=Object.keys(yc).map((function(e){return yc[e]})),ou=/^##@@@(.+?)##(.+?)@@@##(.+?)@@@##$/,iu=function(e,t){return(iu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function au(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}iu(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var su,lu,cu,uu=function(){return(uu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function du(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function pu(e){return e.type===lu.literal}function hu(e){return e.type===lu.argument}function mu(e){return e.type===lu.number}function fu(e){return e.type===lu.date}function vu(e){return e.type===lu.time}function gu(e){return e.type===lu.select}function yu(e){return e.type===lu.plural}function _u(e){return e.type===lu.pound}function bu(e){return e.type===lu.tag}function Eu(e){return!(!e||"object"!=Xe()(e)||e.type!==cu.number)}function Su(e){return!(!e||"object"!=Xe()(e)||e.type!==cu.dateTime)}"function"==typeof SuppressedError&&SuppressedError,function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(su||(su={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(lu||(lu={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(cu||(cu={}));var Au=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,ku=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function Tu(e){var t={};return e.replace(ku,(function(e){var n=e.length;switch(e[0]){case"G":t.era=4===n?"long":5===n?"narrow":"short";break;case"y":t.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===n?"short":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}var Pu=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i,wu=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Iu=/^(@+)?(\+|#+)?[rs]?$/g,Cu=/(\*)(0+)|(#+)(0+)|(0+)/g,Ru=/^(0+)$/;function Nu(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(Iu,(function(e,n,r){return"string"!=typeof r?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===r?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),t}function Ou(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function Du(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!Ru.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function Lu(e){return Ou(e)||{}}function Mu(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n];switch(o.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=o.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=o.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=uu(uu(uu({},t),{notation:"scientific"}),o.options.reduce((function(e,t){return uu(uu({},e),Lu(t))}),{}));continue;case"engineering":t=uu(uu(uu({},t),{notation:"engineering"}),o.options.reduce((function(e,t){return uu(uu({},e),Lu(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(o.options[0]);continue;case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(Cu,(function(e,n,r,o,i,a){if(n)t.minimumIntegerDigits=r.length;else{if(o&&i)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(Ru.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(wu.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(wu,(function(e,n,r,o,i,a){return"*"===r?t.minimumFractionDigits=n.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:i&&a?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+a.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var i=o.options[0];"w"===i?t=uu(uu({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=uu(uu({},t),Nu(i)))}else if(Iu.test(o.stem))t=uu(uu({},t),Nu(o.stem));else{var a=Ou(o.stem);a&&(t=uu(uu({},t),a));var s=Du(o.stem);s&&(t=uu(uu({},t),s))}}return t}var xu,Uu={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function Bu(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n,r=e.language;return"root"!==r&&(n=e.maximize().region),(Uu[n||""]||Uu[r||""]||Uu["".concat(r,"-001")]||Uu["001"])[0]}var Ku=new RegExp("^".concat(Au.source,"*")),Hu=new RegExp("".concat(Au.source,"*$"));function Fu(e,t){return{start:e,end:t}}var Yu=!!String.prototype.startsWith&&"_a".startsWith("a",1),ju=!!String.fromCodePoint,Gu=!!Object.fromEntries,zu=!!String.prototype.codePointAt,Vu=!!String.prototype.trimStart,Wu=!!String.prototype.trimEnd,qu=Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Ju=!0;try{Ju="a"===(null===(xu=rd("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===xu?void 0:xu[0])}catch(_c){Ju=!1}var Qu,Zu=Yu?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},Xu=ju?String.fromCodePoint:function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];for(var r,o="",i=t.length,a=0;i>a;){if((r=t[a++])>1114111)throw RangeError(r+" is not a valid code point");o+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return o},$u=Gu?Object.fromEntries:function(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n],i=o[0],a=o[1];t[i]=a}return t},ed=zu?function(e,t){return e.codePointAt(t)}:function(e,t){var n=e.length;if(!(t<0||t>=n)){var r,o=e.charCodeAt(t);return o<55296||o>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?o:r-56320+(o-55296<<10)+65536}},td=Vu?function(e){return e.trimStart()}:function(e){return e.replace(Ku,"")},nd=Wu?function(e){return e.trimEnd()}:function(e){return e.replace(Hu,"")};function rd(e,t){return new RegExp(e,t)}if(Ju){var od=rd("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Qu=function(e,t){var n;return od.lastIndex=t,null!==(n=od.exec(e)[1])&&void 0!==n?n:""}}else Qu=function(e,t){for(var n=[];;){var r=ed(e,t);if(void 0===r||sd(r)||ld(r))break;n.push(r),t+=r>=65536?2:1}return Xu.apply(void 0,n)};var id=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var o=this.char();if(123===o){if((i=this.parseArgument(e,n)).err)return i;r.push(i.val)}else{if(125===o&&e>0)break;if(35!==o||"plural"!==t&&"selectordinal"!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(su.UNMATCHED_CLOSING_TAG,Fu(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&ad(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;r.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;r.push(i.val)}}else{var a=this.clonePosition();this.bump(),r.push({type:lu.pound,location:Fu(a,this.clonePosition())})}}}return{val:r,err:null}},e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:lu.literal,value:"<".concat(r,"/>"),location:Fu(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var i=o.val,a=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!ad(this.char()))return this.error(su.INVALID_TAG,Fu(a,this.clonePosition()));var s=this.clonePosition();return r!==this.parseTagName()?this.error(su.UNMATCHED_CLOSING_TAG,Fu(s,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:lu.tag,value:r,children:i,location:Fu(n,this.clonePosition())},err:null}:this.error(su.INVALID_TAG,Fu(a,this.clonePosition())))}return this.error(su.UNCLOSED_TAG,Fu(n,this.clonePosition()))}return this.error(su.INVALID_TAG,Fu(n,this.clonePosition()))},e.prototype.parseTagName=function(){var e,t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var o=this.tryParseQuote(t);if(o)r+=o;else{var i=this.tryParseUnquoted(e,t);if(i)r+=i;else{var a=this.tryParseLeftAngleBracket();if(!a)break;r+=a}}}var s=Fu(n,this.clonePosition());return{val:{type:lu.literal,value:r,location:s},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(ad(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(n);this.bump()}return Xu.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),Xu(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(su.EXPECT_ARGUMENT_CLOSING_BRACE,Fu(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(su.EMPTY_ARGUMENT,Fu(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(su.MALFORMED_ARGUMENT,Fu(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(su.EXPECT_ARGUMENT_CLOSING_BRACE,Fu(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:lu.argument,value:r,location:Fu(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(su.EXPECT_ARGUMENT_CLOSING_BRACE,Fu(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(su.MALFORMED_ARGUMENT,Fu(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=Qu(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:Fu(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,r){var o,i=this.clonePosition(),a=this.parseIdentifierIfPossible().value,s=this.clonePosition();switch(a){case"":return this.error(su.EXPECT_ARGUMENT_TYPE,Fu(i,s));case"number":case"date":case"time":this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((g=this.parseSimpleArgStyleIfPossible()).err)return g;if(0===(h=nd(g.val)).length)return this.error(su.EXPECT_ARGUMENT_STYLE,Fu(this.clonePosition(),this.clonePosition()));l={style:h,styleLocation:Fu(c,this.clonePosition())}}if((y=this.tryParseArgumentClose(r)).err)return y;var u=Fu(r,this.clonePosition());if(l&&Zu(null==l?void 0:l.style,"::",0)){var d=td(l.style.slice(2));if("number"===a)return(g=this.parseNumberSkeletonFromString(d,l.styleLocation)).err?g:{val:{type:lu.number,value:n,location:u,style:g.val},err:null};if(0===d.length)return this.error(su.EXPECT_DATE_TIME_SKELETON,u);var p=d;this.locale&&(p=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e.charAt(r);if("j"===o){for(var i=0;r+1<e.length&&e.charAt(r+1)===o;)i++,r++;var a=1+(1&i),s=i<2?1:3+(i>>1),l=Bu(t);for("H"!=l&&"k"!=l||(s=0);s-- >0;)n+="a";for(;a-- >0;)n=l+n}else n+="J"===o?"H":o}return n}(d,this.locale));var h={type:cu.dateTime,pattern:p,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?Tu(p):{}};return{val:{type:"date"===a?lu.date:lu.time,value:n,location:u,style:h},err:null}}return{val:{type:"number"===a?lu.number:"date"===a?lu.date:lu.time,value:n,location:u,style:null!==(o=null==l?void 0:l.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":var m=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(su.EXPECT_SELECT_ARGUMENT_OPTIONS,Fu(m,uu({},m)));this.bumpSpace();var f=this.parseIdentifierIfPossible(),v=0;if("select"!==a&&"offset"===f.value){if(!this.bumpIf(":"))return this.error(su.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Fu(this.clonePosition(),this.clonePosition()));var g;if(this.bumpSpace(),(g=this.tryParseDecimalInteger(su.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,su.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return g;this.bumpSpace(),f=this.parseIdentifierIfPossible(),v=g.val}var y,_=this.tryParsePluralOrSelectOptions(e,a,t,f);if(_.err)return _;if((y=this.tryParseArgumentClose(r)).err)return y;var b=Fu(r,this.clonePosition());return"select"===a?{val:{type:lu.select,value:n,options:$u(_.val),location:b},err:null}:{val:{type:lu.plural,value:n,options:$u(_.val),offset:v,pluralType:"plural"===a?"cardinal":"ordinal",location:b},err:null};default:return this.error(su.INVALID_ARGUMENT_TYPE,Fu(i,s))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(su.EXPECT_ARGUMENT_CLOSING_BRACE,Fu(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();)switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(su.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Fu(n,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],n=0,r=e.split(Pu).filter((function(e){return e.length>0}));n<r.length;n++){var o=r[n].split("/");if(0===o.length)throw new Error("Invalid number skeleton");for(var i=o[0],a=o.slice(1),s=0,l=a;s<l.length;s++)if(0===l[s].length)throw new Error("Invalid number skeleton");t.push({stem:i,options:a})}return t}(e)}catch(e){return this.error(su.INVALID_NUMBER_SKELETON,t)}return{val:{type:cu.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?Mu(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){for(var o,i=!1,a=[],s=new Set,l=r.value,c=r.location;;){if(0===l.length){var u=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var d=this.tryParseDecimalInteger(su.EXPECT_PLURAL_ARGUMENT_SELECTOR,su.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;c=Fu(u,this.clonePosition()),l=this.message.slice(u.offset,this.offset())}if(s.has(l))return this.error("select"===t?su.DUPLICATE_SELECT_ARGUMENT_SELECTOR:su.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===l&&(i=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?su.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:su.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Fu(this.clonePosition(),this.clonePosition()));var h=this.parseMessage(e+1,t,n);if(h.err)return h;var m=this.tryParseArgumentClose(p);if(m.err)return m;a.push([l,{value:h.val,location:Fu(p,this.clonePosition())}]),s.add(l),this.bumpSpace(),l=(o=this.parseIdentifierIfPossible()).value,c=o.location}return 0===a.length?this.error("select"===t?su.EXPECT_SELECT_ARGUMENT_SELECTOR:su.EXPECT_PLURAL_ARGUMENT_SELECTOR,Fu(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(su.MISSING_OTHER_CLAUSE,Fu(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,i=0;!this.isEOF();){var a=this.char();if(!(a>=48&&a<=57))break;o=!0,i=10*i+(a-48),this.bump()}var s=Fu(r,this.clonePosition());return o?qu(i*=n)?{val:i,err:null}:this.error(t,s):this.error(e,s)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=ed(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(Zu(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&sd(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();function ad(e){return e>=97&&e<=122||e>=65&&e<=90}function sd(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function ld(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function cd(e,t){void 0===t&&(t={}),t=uu({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new id(e,t).parse();if(n.err){var r=SyntaxError(su[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return(null==t?void 0:t.captureLocation)||function e(t){t.forEach((function(t){if(delete t.location,gu(t)||yu(t))for(var n in t.options)delete t.options[n].location,e(t.options[n].value);else mu(t)&&Eu(t.style)||(fu(t)||vu(t))&&Su(t.style)?delete t.style.location:bu(t)&&e(t.children)}))}(n.val),n.val}function ud(e,t){var n=t&&t.cache?t.cache:yd,r=t&&t.serializer?t.serializer:fd;return(t&&t.strategy?t.strategy:md)(e,{cache:n,serializer:r})}function dd(e,t,n,r){var o=function(e){return null==e||"number"==typeof e||"boolean"==typeof e}(r)?r:n(r),i=t.get(o);return void 0===i&&(i=e.call(this,r),t.set(o,i)),i}function pd(e,t,n){var r=Array.prototype.slice.call(arguments,3),o=n(r),i=t.get(o);return void 0===i&&(i=e.apply(this,r),t.set(o,i)),i}function hd(e,t,n,r,o){return n.bind(t,e,r,o)}function md(e,t){return hd(e,this,1===e.length?dd:pd,t.cache.create(),t.serializer)}var fd=function(){return JSON.stringify(arguments)};function vd(){this.cache=Object.create(null)}vd.prototype.get=function(e){return this.cache[e]},vd.prototype.set=function(e,t){this.cache[e]=t};var gd,yd={create:function(){return new vd}},_d={variadic:function(e,t){return hd(e,this,pd,t.cache.create(),t.serializer)},monadic:function(e,t){return hd(e,this,dd,t.cache.create(),t.serializer)}};!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(gd||(gd={}));var bd,Ed=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.code=n,o.originalMessage=r,o}return au(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),Sd=function(e){function t(t,n,r,o){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),gd.INVALID_VALUE,o)||this}return au(t,e),t}(Ed),Ad=function(e){function t(t,n,r){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),gd.INVALID_VALUE,r)||this}return au(t,e),t}(Ed),kd=function(e){function t(t,n){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),gd.MISSING_VALUE,n)||this}return au(t,e),t}(Ed);function Td(e){return"function"==typeof e}function Pd(e,t,n,r,o,i,a){if(1===e.length&&pu(e[0]))return[{type:bd.literal,value:e[0].value}];for(var s=[],l=0,c=e;l<c.length;l++){var u=c[l];if(pu(u))s.push({type:bd.literal,value:u.value});else if(_u(u))"number"==typeof i&&s.push({type:bd.literal,value:n.getNumberFormat(t).format(i)});else{var d=u.value;if(!o||!(d in o))throw new kd(d,a);var p=o[d];if(hu(u))p&&"string"!=typeof p&&"number"!=typeof p||(p="string"==typeof p||"number"==typeof p?String(p):""),s.push({type:"string"==typeof p?bd.literal:bd.object,value:p});else if(fu(u)){var h="string"==typeof u.style?r.date[u.style]:Su(u.style)?u.style.parsedOptions:void 0;s.push({type:bd.literal,value:n.getDateTimeFormat(t,h).format(p)})}else if(vu(u))h="string"==typeof u.style?r.time[u.style]:Su(u.style)?u.style.parsedOptions:r.time.medium,s.push({type:bd.literal,value:n.getDateTimeFormat(t,h).format(p)});else if(mu(u))(h="string"==typeof u.style?r.number[u.style]:Eu(u.style)?u.style.parsedOptions:void 0)&&h.scale&&(p*=h.scale||1),s.push({type:bd.literal,value:n.getNumberFormat(t,h).format(p)});else{if(bu(u)){var m=u.children,f=u.value,v=o[f];if(!Td(v))throw new Ad(f,"function",a);var g=v(Pd(m,t,n,r,o,i).map((function(e){return e.value})));Array.isArray(g)||(g=[g]),s.push.apply(s,g.map((function(e){return{type:"string"==typeof e?bd.literal:bd.object,value:e}})))}if(gu(u)){if(!(y=u.options[p]||u.options.other))throw new Sd(u.value,p,Object.keys(u.options),a);s.push.apply(s,Pd(y.value,t,n,r,o))}else if(yu(u)){var y;if(!(y=u.options["=".concat(p)])){if(!Intl.PluralRules)throw new Ed('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',gd.MISSING_INTL_API,a);var _=n.getPluralRules(t,{type:u.pluralType}).select(p-(u.offset||0));y=u.options[_]||u.options.other}if(!y)throw new Sd(u.value,p,Object.keys(u.options),a);s.push.apply(s,Pd(y.value,t,n,r,o,p-(u.offset||0)))}}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var n=e[e.length-1];return n&&n.type===bd.literal&&t.type===bd.literal?n.value+=t.value:e.push(t),e}),[])}(s)}function wd(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(bd||(bd={}));var Id=function(){function e(t,n,r,o){void 0===n&&(n=e.defaultLocale);var i,a=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=a.formatToParts(e);if(1===t.length)return t[0].value;var n=t.reduce((function(e,t){return e.length&&t.type===bd.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(e){return Pd(a.ast,a.locales,a.formatters,a.formats,e,void 0,a.message)},this.resolvedOptions=function(){var e;return{locale:(null===(e=a.resolvedLocale)||void 0===e?void 0:e.toString())||Intl.NumberFormat.supportedLocalesOf(a.locales)[0]}},this.getAst=function(){return a.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var s=o||{},l=(s.formatters,function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(s,["formatters"]));this.ast=e.__parse(t,uu(uu({},l),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=function(e,t){return t?Object.keys(e).reduce((function(n,r){var o,i;return n[r]=(o=e[r],(i=t[r])?uu(uu(uu({},o||{}),i||{}),Object.keys(o).reduce((function(e,t){return e[t]=uu(uu({},o[t]),i[t]||{}),e}),{})):o),n}),uu({},e)):e}(e.formats,r),this.formatters=o&&o.formatters||(void 0===(i=this.formatterCache)&&(i={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:ud((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.NumberFormat).bind.apply(e,du([void 0],n,!1)))}),{cache:wd(i.number),strategy:_d.variadic}),getDateTimeFormat:ud((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.DateTimeFormat).bind.apply(e,du([void 0],n,!1)))}),{cache:wd(i.dateTime),strategy:_d.variadic}),getPluralRules:ud((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.PluralRules).bind.apply(e,du([void 0],n,!1)))}),{cache:wd(i.pluralRules),strategy:_d.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){if(void 0!==Intl.Locale){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])}},e.__parse=cd,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();function Cd(e){for(var t=arguments,n=1;n<arguments.length;n++){var r=t[n];for(var o in r)e[o]=r[o]}return e}var Rd=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=Cd({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in o)o[a]&&(i+="; "+a,!0!==o[a]&&(i+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(r[s]=t.read(a,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",Cd({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,Cd({},this.attributes,t))},withConverter:function(t){return e(Cd({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),Nd=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];console.warn.apply(console,e)},Od=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];console.error.apply(console,e)},Dd=function(){return"object"==("undefined"==typeof ac?"undefined":Xe()(ac))&&"function"==typeof ac.call},Ld=function(){return"undefined"!=typeof my&&void 0!==my.canIUse&&!Dd()},Md=function(){return"object"==("undefined"==typeof window?"undefined":Xe()(window))},xd=function(){return function(){var e;return!!Md()&&((null===(e=window.navigator)||void 0===e?void 0:e.userAgent)||"").toLowerCase().indexOf("alipayclient")>-1}()||Md()&&"undefined"!=typeof AlipayJSBridge},Ud=function(){return"undefined"!=typeof wx&&void 0!==wx.canIUse},Bd=function(){return!(void 0===n.g||Md()||Ld()||Ud()||Dd())},Kd="bailingualLocaleChange",Hd="bailingualDataChange",Fd="bailingualError";function Yd(e){void 0===e&&(e="");for(var t=(function(e){if("object"==("undefined"==typeof document?"undefined":Xe()(document)))try{return Rd.get(e)||Rd.get("_CHIPS-"+e)}catch(e){return Nd("[bailingual-sdk-glue] readCookie fail: "+e),""}}(e)||"").split("&"),n=0,r=t.length;n<r;n++){var o=t[n].split("="),i=o[0],a=o[1];if("lang"===i)return a}}var jd,Gd=function(e){if(void 0===e&&(e=""),e=e.replace("_","-"),xd()||Ld()||Dd()){var t=wc[e.toLowerCase()];t&&(e=t)}var n=e.split("-"),r=n[0],o=n[1];return o&&(e=r.toLowerCase()+"-"+o.toUpperCase()),Pc[e.toLowerCase()]&&(e=Pc[e.toLowerCase()]),ip(ru,e)?e:""};function zd(e){return void 0===e&&(e=!0),Gd(function(e){return void 0===e&&(e=!0),Ld()||Dd()?my.env&&my.env.language||my.getSystemInfoSync().language:Ud()?wx.getSystemInfoSync().language:Bd()?n.g.BAILINGUAL_LOCALE:!!e&&function(){var e=Yd("x-hng")||Yd("hng");if(e)return e}()||function(){var e;if("object"==("undefined"==typeof document?"undefined":Xe()(document))){var t=null===(e=document.documentElement)||void 0===e?void 0:e.lang;if(t)return t}}()||function(){var e;if(Md()){var t=(null===(e=window.navigator)||void 0===e?void 0:e.userAgent)||"",n=(/Language\/([^\s]*)/i.exec(t)||[]).pop();if(n)return n}}()||function(){var e;if(Md()&&window.navigator){var t=window.navigator,n=(null===(e=t.languages)||void 0===e?void 0:e[0])||t.language||t.userLanguage||t.browserLanguage;if(n)return n}}()}(e)||"")}function Vd(e,t,n){void 0===n&&(n={});try{"object"==("undefined"==typeof document?"undefined":Xe()(document))&&Rd.set(e,t,n)}catch(e){Nd("[bailingual-sdk-glue] writeCookie fail: "+e)}}function Wd(e,t){void 0===t&&(t={});try{"object"==("undefined"==typeof document?"undefined":Xe()(document))&&Rd.remove(e,t)}catch(e){Nd("[bailingual-sdk-glue] writeCookie fail: "+e)}}function qd(){"object"==("undefined"==typeof document?"undefined":Xe()(document))&&"object"==("undefined"==typeof location?"undefined":Xe()(location))&&(Wd("x-hng",{path:"/",domain:location.hostname}),Wd("x-hng",{path:"/",domain:location.hostname,SameSite:"None",Secure:!0}),Wd("_CHIPS-x-hng",{path:"/",domain:location.hostname,SameSite:"None",Secure:!0,Partitioned:!0}),Wd("x-hng",{path:"/"}),Wd("x-hng",{path:"/",SameSite:"None",Secure:!0}),Wd("_CHIPS-x-hng",{path:"/",SameSite:"None",Secure:!0,Partitioned:!0}))}!function(e){e.FORMAT_ERROR="FORMAT_ERROR",e.MISSING_PARAM="MISSING_PARAM"}(jd||(jd={}));var Jd,Qd,Zd,Xd,$d,ep,tp,np,rp=function(e){var t=e.code,n=e.message,r=e.err,o=e.textKey;this.code=t,this.message=n||(null==r?void 0:r.message)||"unknown error",this.stack=(null==r?void 0:r.stack)||r,this.textKey=o},op=function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return t.forEach((function(t){Object.keys(t||{}).forEach((function(n){e[n]=t[n]}))})),e},ip=function(e,t){return e.indexOf(t)>-1};function ap(e){var t,n;try{return Qd?(null===(t=Qd.getItem)||void 0===t?void 0:t.call(Qd,e))||"":Ld()||Dd()?(null===(n=my.getStorageSync({key:e}))||void 0===n?void 0:n.data)||"":Ud()?wx.getStorageSync(e)||"":"object"==("undefined"==typeof localStorage?"undefined":Xe()(localStorage))&&localStorage.getItem(e)||""}catch(e){return""}}function sp(e,t){var n;try{if(t=(t||"").toString(),Qd)return void(null===(n=Qd.setItem)||void 0===n||n.call(Qd,e,t));if(Ld()||Dd())return void my.setStorage({key:e,data:t});if(Ud())return void wx.setStorage({key:e,data:t});"object"==("undefined"==typeof localStorage?"undefined":Xe()(localStorage))&&localStorage.setItem(e,t)}catch(e){}}function lp(e,t){return void 0===t&&(t=3),new Promise((function(n,r){var o,i,a,s;function l(){var e=s()[0];return e++,c.bind(this,e)}function c(e){if(s=function(){return[e]},!(e<t))return[1];var o=function(e){try{return l}catch(e){return r(e)}};try{var a;return i().then((function(e){try{return(a=e)?n(a):function(){try{return l}catch(e){return r(e)}}()}catch(e){return o()}}),o)}catch(e){o()}}return o=function(e){if(e.length&&"{"!==e[0]){var t=e.indexOf("{");t>-1&&(e=e.slice(t))}return e},i=function(){return new Promise((function(t,n){var r;return function(e){return Jd?Jd(e):Dd()?new Promise((function(t,n){my.request({url:e,success:function(e){t(e.data)},fail:function(){n()}})})):Ld()?new Promise((function(t,n){my.call("httpRequest",{url:e},(function(e){!e||e.error?n():t(e.data)}))})):Ud()?new Promise((function(t,n){wx.request({url:e,dataType:"text",success:function(e){t(e.data)},fail:function(e){n(e)}})})):"function"==typeof fetch?fetch(e).then((function(e){return e.text()})):"undefined"!=typeof XMLHttpRequest?new Promise((function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4===r.readyState&&(200===r.status?t(r.responseText):n())},r.send()})):void 0}(e).then((function(e){try{return r=e,t(JSON.parse(o(r||"")))}catch(e){return n(e)}}),n)}))},(a=function(e){for(;e;){if(e.then)return void e.then(a,r);try{if(e.pop){if(e.length)return e.pop()?u.call(this):e;e=l}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(c.bind(this,0));function u(){return n()}}))}!function(e){e.DAILY="DAILY",e.PROD="PROD"}(tp||(tp={})),function(e){e.INTERNET="INTERNET",e.INTRANET="INTRANET"}(np||(np={}));var cp={ANTINTL:(Zd={},Zd[tp.DAILY]="https://bailingual-daily.marmot-cloud.com/manifest/",Zd[tp.PROD]="https://bailingual.marmot-cloud.com/manifest/",Zd),ALIPAY:(Xd={},Xd[tp.DAILY]="https://bailingual-assets-daily.alipay.com/manifest/",Xd[tp.PROD]="https://bailingual-assets.alipay.com/manifest/",Xd)},up={};up[np.INTERNET]=(($d={})[tp.DAILY]=function(e,t,n){var r;return""+(n?null===(r=cp[n])||void 0===r?void 0:r[tp.DAILY]:"")+e+"/"+e+(t?"_"+t:"")+".json"},$d[tp.PROD]=function(e,t,n){var r;return""+(n?null===(r=cp[n])||void 0===r?void 0:r[tp.PROD]:"")+e+"/"+e+(t?"_"+t:"")+".json"},$d),up[np.INTRANET]=((ep={})[tp.DAILY]=function(e,t){return"https://bailingual-assets.antgroup-inc.cn/daily/manifest/"+e+"/"+e+(t?"_"+t:"")+".json"},ep[tp.PROD]=function(e,t){return"https://bailingual-assets.antgroup-inc.cn/prod/manifest/"+e+"/"+e+(t?"_"+t:"")+".json"},ep);var dp;function pp(){return"true"===ap("__BAILINGUAL_IN_CONTEXT__")}function hp(){if(!(Ld()||Ud()||Dd())){var e=ap("BAILINGUAL_IN_CONTEXT_CONFIG")||"{}",t=!1;try{t=JSON.parse(e).enableExtension}catch(e){Nd("[bailingual-sdk-glue] JSON.parse data fail: "+e)}dp=pp()&&t}}function mp(){return void 0===dp&&hp(),dp}function fp(){sp("__BAILINGUAL_IN_CONTEXT__","true"),hp(),new Promise((function(e,t){if(Ld()||Ud()||Dd())return e();var n;if("undefined"!=typeof document&&!document.querySelector("._BAILINGUAL_IN_CONTEXT_script"))return lp("https://render.alipay.com/p/yuyan/bailingual-in-context_bailingual-in-context-version/zh_CN.json").then(function(e){try{return(null==(n=e)?void 0:n.version)&&function(e){if(e&&!document.querySelector("._BAILINGUAL_IN_CONTEXT_script")){var t=document.createElement("script");t.setAttribute("class","_BAILINGUAL_IN_CONTEXT_script"),t.setAttribute("src",e),document.body.appendChild(t)}}("https://unpkg.alipay.com/@alipay/bailingual-in-context@"+n.version+"/public/dist/index.js"),r.call(this)}catch(e){return t(e)}}.bind(this),t);function r(){return e()}return r.call(this)}))}function vp(e,t,n){return"##@@@"+t+"##"+e+"@@@##"+n+"@@@##"}function gp(e){var t=[];return e.forEach((function(e){var n=e.key,r=e.count;if(n&&r){var o=-1!==n.indexOf("&")?encodeURIComponent(n):n;t.push(o+"&"+r)}})),t.join(";")}function yp(e,t){var n=function(e){switch(e){case"CN":default:return"https://collect.alipay.com/yuyan/?biztype=yuyanmonitorl";case"SG":return"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do";case"US":return"https://imdap.alipay.com/loggw/dwcookieLogGet.do"}}(e);if(Dd())my.request({method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t,url:n});else if(Ld())my.call("httpRequest",{url:n,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t});else if(Ud())wx.request({url:n,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t});else if("undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon&&"function"==typeof Blob){var r=new Blob([t],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(n,r)}else if(Md()&&"undefined"!=typeof XMLHttpRequest){var o=new XMLHttpRequest;o.open("POST",n,!0),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(t)}else"function"==typeof fetch?fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}):console.error("No supported method to send data",e,t)}!function(){if(!(Ld()||Ud()||Dd()))try{var e=function(e){if(!e)return{};var t={};return e.slice(1).split("&").forEach((function(e){var n=e.split("="),r=n[0],o=n[1];t[r]=o})),t}("undefined"!=typeof location?location.search:"");if(pp()||e.hasOwnProperty("SML_DEV")||e.hasOwnProperty("BAILINGUAL_IN_CONTEXT")||e.hasOwnProperty("BLG_RIC"))return void fp();if("undefined"==typeof document)return;if(xd()){var t=0,n=0;document.addEventListener("titleClick",(function(){if(!mp()){if(7==++n)return fp(),n=0,clearTimeout(t),void(t=null);clearTimeout(t),t=setTimeout((function(){n=0,t=null}),1500)}}))}document.addEventListener("__BAILINGUAL_IN_CONTEXT_DISABLE__",(function(){sp("__BAILINGUAL_IN_CONTEXT__","false"),hp()}))}catch(e){Nd("[bailingual-sdk-glue] initBailingualInContext fail: "+e)}}();var _p=function(e){return e<10?"0"+e:""+e};function bp(){var e=new Date;return e.getFullYear()+"-"+_p(e.getMonth()+1)+"-"+_p(e.getDate())+" "+_p(e.getHours())+":"+_p(e.getMinutes())+":"+_p(e.getSeconds())+":"+e.getMilliseconds()}function Ep(e,t){void 0===t&&(t="^");var n=[];if(e instanceof Array)n=e;else if(e instanceof Object)for(var r in e)e.hasOwnProperty(r)&&n.push(r+"="+(e[r]||""));return n.join(t)}function Sp(e,t){var n,r,o;if(!t||!t.appName||!t.keyCounts.length)return"";var i=[];switch(e){case"CN":default:i=["D-AE",bp(),"","","2","","","","1000","102023","H5behavior","2","","","","","","","","","","","","","","","","","","","","","","","","",Ep({code:"1000",msg:"",d1:t.appName,d3:(null===(n=t.textLocale)||void 0===n?void 0:n.replace(/-/g,"_"))||"",d4:t.sdkName||"",d5:t.sdkVersion||"",env:t.env||"PROD",c1:gp(t.keyCounts),sampleRate:"1",yuyan_id:"180020010101313281",fullURL:"-",s_c:"true"})];break;case"SG":i=["D-AE",bp(),"","","2","","","","1000","bailingualTextUsage","H5behavior","2","","","","","","","","","","","","","","","","","","","","","","","","",Ep({code:"1000",msg:"",d1:t.appName,d3:(null===(r=t.textLocale)||void 0===r?void 0:r.replace(/-/g,"_"))||"",d4:t.sdkName||"",d5:t.sdkVersion||"",env:t.env||"PROD",c1:gp(t.keyCounts)})];break;case"US":i=["D-VM",bp(),"","","4","-","-","-","exposure","-","-","-","-","-","-","bailingualTextUsage","2","H5behavior","c","-","-","-",Ep({appName:t.appName,textLocale:(null===(o=t.textLocale)||void 0===o?void 0:o.replace(/-/g,"_"))||"",sdkName:t.sdkName||"",sdkVersion:t.sdkVersion||"",env:t.env||"PROD",c1:gp(t.keyCounts)}),"-","-","-","-","-","-","-","-","-","1000","-","-","UNKNOWN","-","-","zh-cn","-","-","-","-","-","-","-","-",Date.now().toString()+"-"+(100*Math.random()).toFixed(0),"-","-"]}return"data="+function(e){return e?encodeURIComponent(e).replace(/'/g,"%27"):e}(i.join())+"&time="+(new Date).getTime()}var Ap=function(e){var t=e.region;this.queue=[],this.region=t,this.startTimer()};Ap.prototype.startTimer=function(){var e,t,n=this;this.region?(this.timer=setTimeout((function(){n._report()}),5e3),Md()&&(null===(t=null===(e=window.document)||void 0===e?void 0:e.addEventListener)||void 0===t||t.call(e,"beforeunload",(function(){n._report()})))):clearTimeout(this.timer)},Ap.prototype._report=function(){if(clearTimeout(this.timer),this.region&&this.queue.length){var e=new Map;this.queue.forEach((function(t){var n=t.appName+"-"+t.textKey+"-"+t.env,r=e.get(n);r?r.textUsedCount+=t.textUsedCount:e.set(n,t)}));var t=Array.from(e.values());!function(e,t){if(!e)throw new Error("No Region");if(0!==t.length)try{var n=new Map;t.forEach((function(e){var t=e.appName+"-"+e.textLocale+"-"+e.env;n.has(t)||n.set(t,{appName:e.appName,textLocale:e.textLocale,sdkName:e.sdkName,sdkVersion:e.sdkVersion,env:e.env,keyCounts:[]}),n.get(t).keyCounts.push({key:e.textKey,count:e.textUsedCount})})),n.forEach((function(t){for(var n=t.keyCounts,r=0;r<n.length;r+=200){var o=n.slice(r,r+200),i=Sp(e,{appName:t.appName,textLocale:t.textLocale,sdkName:t.sdkName,sdkVersion:t.sdkVersion,env:t.env,keyCounts:o});yp(e,i)}}))}catch(n){console.error("reportUsageRequest error with",e,t)}else console.error("empty data")}(this.region,t),this.queue=[]}this.startTimer()},Ap.prototype.getRegion=function(){return this.region},Ap.prototype.setRegion=function(e){this.region=e,this.startTimer()},Ap.prototype.report=function(e){this.region&&this.queue.push(e)};var kp=function(){this.originStrings={},this.availableLocales=[],this.langPkgsNoPatch={},this.i18nText={},this.eventHandler={},this.intlMessages={},this.intlPDKVMessages={},this.appName="",this.canUsePatchedData=!0,this.canStoreCurrentLocaleToCookie=!0,this.canReadLocaleFromCookie=!0},Tp={usageReportRegion:{configurable:!0}};kp.setCustomizedGetSystemLocale=function(e){this.customizedGetSystemLocale=e},kp.customizeGetSystemLocale=function(e){this.customizedGetSystemLocale=e},kp.customizeStorage=function(e){return function(e){Qd=e}(e)},kp.getDataFromStorage=function(e){return ap(e)},kp.setDataToStorage=function(e,t){return sp(e,t)},kp.customizeFetch=function(e){Jd=e},Tp.usageReportRegion.get=function(){var e;return null===(e=this.usageReporter)||void 0===e?void 0:e.getRegion()},Tp.usageReportRegion.set=function(e){var t;this.usageReporter||(this.usageReporter=new Ap({region:e})),e&&(null===(t=this.usageReporter)||void 0===t||t.setRegion(e))},kp.prototype.init=function(e,t){var n,r;this.initBailingualData(e),this.changeLocale(t||(null===(r=(n=this.constructor).customizedGetSystemLocale)||void 0===r?void 0:r.call(n))||zd(this.canReadLocaleFromCookie))},kp.prototype.getPatchI18nKey=function(){return this.appName?this.tag?this.appName+"+"+this.tag:this.appName:""},kp.prototype.initData=function(e){var t,n;this.initBailingualData(e||this.getServerSideFallbackData()),this.changeLocale((null===(n=(t=this.constructor).customizedGetSystemLocale)||void 0===n?void 0:n.call(t))||zd(this.canReadLocaleFromCookie))},kp.prototype.getServerSideFallbackData=function(){if(Bd()){var e=n.g.BAILINGUAL_FALLBACK;return e||(Nd("[bailingual-sdk-glue] [Server] no fallback data found."),e={}),e}},kp.prototype.initBailingualData=function(e){var t=this;this.originStrings=e,this.availableLocales=[],this.langPkgsNoPatch={},this.i18nText={},this.eventHandler={},this.intlMessages={},this.intlPDKVMessages={},this.appName=e.appName||"",this.currentLocale=void 0,this.bizEnv=e.bizEnv,this.usageReportRegion=e.usageReportRegion,this.usageReporter=new Ap({region:this.usageReportRegion}),this.tag=e.tag||"",Object.keys(e).forEach((function(n){if("object"==Xe()(e[n])){var r=Gd(n);if(!r)return void Od("[bailingual-sdk-glue] "+n+" is not a valid locale code");t.langPkgsNoPatch[r]=op({},e[n]),t.i18nText[r]=op({},e[n])}})),this.handlePatchedData(),this.availableLocales=Object.keys(this.i18nText);var n=e.defaultLocale||this.availableLocales[0];!e.defaultLocale&&n&&Nd("[bailingual-sdk-glue] no defaultLocale specified, use first locale code '"+n+"' instead."),this.defaultLocale=this.judgeLocaleCode(n),this.defaultLocale||Od("[bailingual-sdk-glue] defaultLocale '"+n+"' is invalid.")},kp.prototype.handlePatchedData=function(){var e,t=this,n=this.getPatchI18nKey();if(this.canUsePatchedData){var r=function(e){if(void 0===e&&(e=""),!e)return{};try{var t=ap("BAILINGUAL_PATCH_I18N_DELETED-"+e);return t?JSON.parse(t):{}}catch(e){return Od("[bailingual-sdk-glue] fail to get local deleted data, error detail: "+e),{}}}(n),o=function(e){if(void 0===e&&(e=""),!e)return{};try{var t=ap("BAILINGUAL_PATCH_I18N-"+e);return t?JSON.parse(t):{}}catch(e){return Od("[bailingual-sdk-glue] fail to get local patch data, error detail: "+e),{}}}(n);Object.keys(o).forEach((function(e){ip(ru,e)&&(t.i18nText[e]||Nd("[bailingual-sdk-glue] locale '"+e+"' is not exist in init data, but found in patch data."),t.i18nText[e]=t.i18nText[e]||{},op(t.i18nText[e],o[e]))})),null===(e=r.removedLocales)||void 0===e||e.forEach((function(e){e=Gd(e),ip(ru,e)&&delete t.i18nText[e]})),Object.keys(r.removedKeys||{}).forEach((function(e){if(e=Gd(e),ip(ru,e)){var n=t.i18nText[e],o=r.removedKeys[e];n&&Array.isArray(o)&&o.forEach((function(e){delete n[e]}))}}))}else n&&function(e){if(e)try{sp("BAILINGUAL_PATCH_I18N-"+e,""),sp("BAILINGUAL_PATCH_I18N_DELETED-"+e,"")}catch(e){Od("[bailingual-sdk-glue] fail to remove local patch data, error detail: "+e)}}(n)},kp.prototype.setLocale=function(e){this.currentLocale!==e&&(this.currentLocale=e,this.canStoreCurrentLocaleToCookie&&function(e){"object"!=("undefined"==typeof document?"undefined":Xe()(document))||"object"!=("undefined"==typeof location?"undefined":Xe()(location))||xd()||Ld()||Dd()||Ud()||(qd(),Vd("x-hng","lang="+e,{path:"/",expires:180}),Vd("_CHIPS-x-hng","lang="+e,{path:"/",expires:180,SameSite:"None",Partitioned:!0,Secure:!0}))}(e),this.emit(Kd,e))},kp.prototype.getIntlMessageWithPDKVFormat=function(e,t,n){var r=t.id;this.intlPDKVMessages[e]=this.intlPDKVMessages[e]||{};var o=this.intlPDKVMessages[e][r];if(!o){var i=n[r];i.match(ou)||(i=vp(this.appName,r,i)),o=this.createIntlMessageFormat(i,e),this.intlPDKVMessages[e][r]=o}return o},kp.prototype.getIntlMessageWithNormalFormat=function(e,t,n){var r=t.id,o=(null==n?void 0:n[r])||t.dm||t.defaultMessage||"";if(null==n?void 0:n[r]){this.intlMessages[e]=this.intlMessages[e]||{};var i=this.intlMessages[e][r];return i||(i=this.createIntlMessageFormat(o,e),this.intlMessages[e][r]=i),i}return this.createIntlMessageFormat(o,e)},kp.prototype.formatByLocaleCode=function(e,t,n){var r,o=this,i=this.i18nText[n];try{r=mp()&&e.id&&(null==i?void 0:i[e.id])?this.getIntlMessageWithPDKVFormat(n,e,i):this.getIntlMessageWithNormalFormat(n,e,i)}catch(t){var a=(null==i?void 0:i[e.id])||e.dm||e.defaultMessage||"",s="[bailingual-sdk-glue] fail to create IntlMessageFormat instance, return original string: "+a;return Nd(s),Nd("[bailingual-sdk-glue] error detail:",t),this.emit(Fd,new rp({code:jd.FORMAT_ERROR,message:s,err:t,textKey:e.id})),a}if(!r)return"";try{var l=t&&Object.keys(t)||[],c=this.normalizeIntlMessageVariable(r,t);return Object.keys(c).forEach((function(t){ip(l,t)||o.emit(Fd,new rp({code:jd.MISSING_PARAM,message:"["+e.id+"] missing param: "+t,textKey:e.id}))})),r.format(c)}catch(n){var u="[bailingual-sdk-glue] format error with key: "+e.id+", value [%s], params: "+t;return Nd(u),Nd("[bailingual-sdk-glue] error detail:",n),this.emit(Fd,new rp({code:jd.FORMAT_ERROR,message:u,err:n,textKey:e.id})),""}},kp.prototype.format=function(e,t,n){void 0===t&&(t={});var r=n;return r&&((r=Gd(r))||Od("[bailingual-sdk-glue] "+n+" is not a valid locale code, use default locale instead.")),r||(r=this.currentLocale),r||Od("[bailingual-sdk-glue] no locale code found!"),this.formatByLocaleCode(e,t,r)},kp.prototype.get=function(e,t,n){return"string"==typeof e?(this.reportUsageData({id:e,localeCode:n}),this.format({id:e},t,n)):(this.reportUsageData({id:e.id,localeCode:n}),this.format(e,t,n))},kp.prototype.judgeLocaleCode=function(e){if(void 0===e&&(e=""),e=Gd(e),ip(this.availableLocales,e))return e},kp.prototype.changeLocale=function(e){var t=this.judgeLocaleCode(e);t||this.currentLocale||(t=this.defaultLocale),t?this.setLocale(t):Od("[bailingual-sdk-glue] '"+e+"' is not a vaid locale code")},kp.prototype.unsafeChangeLocale=function(e){void 0===e&&(e=""),this.setLocale(e)},kp.prototype.getAllData=function(e){var t=this;if(this.i18nText&&e&&mp()){var n={};return Object.keys(this.i18nText).forEach((function(e){n[e]=t.buildPDKVLocaleText(t.i18nText[e])})),n}return this.i18nText},kp.prototype.buildPDKVLocaleText=function(e){var t=this,n={};return Object.keys(e||{}).forEach((function(r){var o=e[r];o.match(ou)||(o=vp(t.appName,r,o)),n[r]=o})),n},kp.prototype.getDataWithLocale=function(e,t){e||Nd("[bailingual-sdk-glue] no locale code specified, use default locale ("+this.defaultLocale+") instead.");var n=this.i18nText[Gd(e||this.defaultLocale)];return n&&t&&mp()?this.buildPDKVLocaleText(n):n},kp.prototype.getDataFromCurrentLocale=function(e){if(this.currentLocale)return this.getDataWithLocale(this.currentLocale,e);Od("[bailingual-sdk-glue] error occured: no 'currentLocale' found, please check if you have called 'initData' or 'changeLocale' method before.")},kp.prototype.getCurrentLocale=function(){return this.currentLocale||""},kp.prototype.getDefaultLocale=function(){return this.defaultLocale},kp.prototype.formatLocaleCode=function(e){return Gd(e)},kp.prototype.patchI18n=function(e,t){return new Promise(function(n,r){var o,i,a,s;if(!(t=t||{}).isIntranet&&!t.buIdentifier)return Od('[bailingual-sdk-glue] no "env.buIdentifier" param, patchI18n will not work.'),this.emit(Fd,new rp({code:jd.MISSING_PARAM,message:'[bailingual-sdk-glue] no "env.buIdentifier" param, patchI18n will not work.'})),n();if(!Array.isArray(e)){if(!e.appName){if(!this.appName)return Od("[bailingual-sdk-glue] no appName found, patchI18n will not work."),n();e.appName=this.appName}e.tag||(e.tag=this.tag),e=[e]}return(e=e.filter((function(e){return!!(null==e?void 0:e.appName)||(Od("[bailingual-sdk-glue] no appName found, skip: "+e),!1)}))).length?function(e,t,n){return new Promise((function(r,o){return function(e,t){return new Promise((function(n,r){var o,i,a,s;return o=t&&"buIdentifier"in t?t.buIdentifier:void 0,(i=e.map((function(e){return lp(function(e,t,n,r,o){var i,a;return null===(a=null===(i=up[t])||void 0===i?void 0:i[e])||void 0===a?void 0:a.call(i,n,r,o)}(t.isDaily?tp.DAILY:tp.PROD,t.isIntranet?np.INTRANET:np.INTERNET,e.appName,e.tag,o)).then((function(e){return e?lp(e.url):void 0})).then((function(e){return e||{}}))})),a=[],s=0,new Promise((function(e){i.forEach((function(t,n){t.then((function(t){a[n]=t,++s===i.length&&e(a)}))}))}))).then((function(e){try{return n(e)}catch(e){return r(e)}}),r)}))}(t,n).then((function(t){try{return r(function(e,t){var n={};t.forEach((function(e){e=e||{},Object.keys(e).forEach((function(t){if("object"==Xe()(e[t])){var r=Gd(t);r&&(n[r]=n[r]||{},op(n[r],e[t]))}}))}));var r=Object.keys(n),o=Object.keys(e);r.sort().toString()!==o.sort().toString()&&Nd("[bailingual-sdk-glue] locales in local data '"+o+"' is different from cdn data '"+r+"'");var i={removedKeys:{},removedLocales:o.filter((function(e){return!ip(r,e)}))},a={},s={};return r.forEach((function(t){var r=n[t]||{},o=e[t]||{};a[t]=a[t]||{};var i=a[t];Object.keys(r).forEach((function(e){Object.prototype.hasOwnProperty.call(r,e)&&r[e]!==o[e]&&(i[e]=r[e])})),s[t]=op({},o,r)})),o.forEach((function(t){if(!ip(i.removedLocales,t)){var r=e[t]||{},o=n[t]||{},a=s[t]||{};Object.keys(r).forEach((function(e){Object.prototype.hasOwnProperty.call(o,e)||(delete a[e],i.removedKeys[t]=i.removedKeys[t]||[],ip(i.removedKeys[t],e)||i.removedKeys[t].push(e))}))}})),{newI18nData:s,patchedData:a,deletedData:i}}(e,t))}catch(e){return o(e)}}),o)}))}(this.langPkgsNoPatch,e,t).then(function(e){var t;try{return o=(t=e).newI18nData,i=t.patchedData,a=t.deletedData,s=this.getPatchI18nKey(),this.updateData(o)&&s&&(sp("BAILINGUAL_PATCH_I18N-"+s,JSON.stringify(i)),sp("BAILINGUAL_PATCH_I18N_DELETED-"+s,JSON.stringify(a))),n()}catch(e){return r(e)}}.bind(this),r):(Od("[bailingual-sdk-glue] no bailingual packages found, stop patch"),n())}.bind(this))},kp.prototype.updateData=function(e){var t=Object.keys(e).filter((function(e){return ip(ru,e)}));return this.defaultLocale&&!ip(t,this.defaultLocale)?(Od("[bailingual-sdk-glue] default locale "+this.defaultLocale+" is not exist in new data, can't update data."),!1):(this.i18nText=e,this.intlMessages={},this.intlPDKVMessages={},this.availableLocales=t,this.emit(Hd,e),this.currentLocale&&!ip(t,this.currentLocale)&&(Nd("[bailingual-sdk-glue] current locale "+this.currentLocale+" is not available, use default locale ("+this.defaultLocale+") instead."),this.changeLocale(this.defaultLocale)),!0)},kp.prototype.on=function(e,t){this.eventHandler[e]=this.eventHandler[e]||[],this.eventHandler[e].push(t)},kp.prototype.off=function(e,t){var n,r=this;null===(n=this.eventHandler[e])||void 0===n||n.forEach((function(n,o){n===t&&(r.eventHandler[e][o]=null)}))},kp.prototype.onDataChange=function(e){this.on(Hd,e)},kp.prototype.offDataChange=function(e){this.off(Hd,e)},kp.prototype.onLocaleChange=function(e){this.on(Kd,e)},kp.prototype.offLocaleChange=function(e){this.off(Kd,e)},kp.prototype.onError=function(e){this.on(Fd,e)},kp.prototype.offError=function(e){this.off(Fd,e)},kp.prototype.emit=function(e,t){var n,r;null===(r=null===(n=this.eventHandler[e])||void 0===n?void 0:n.forEach)||void 0===r||r.call(n,(function(e){null==e||e(t)}))},kp.prototype.stopPatchI18n=function(){this.canUsePatchedData=!1},kp.prototype.setAutoStoreCurrentLocaleToCookie=function(e){this.canStoreCurrentLocaleToCookie=!!e},kp.prototype.setAutoReadLocaleFromCookie=function(e){this.canReadLocaleFromCookie=!!e},kp.prototype.getAllLocales=function(){return[].concat(this.availableLocales)},kp.prototype.changeUsageReportRegion=function(e){this.usageReportRegion=e},kp.prototype.changeBizEnv=function(e){this.bizEnv=e},kp.prototype.reportUsageData=function(e){var t=e.id,n=e.count;void 0===n&&(n=1);var r,o=e.localeCode;void 0===o&&(o=this.currentLocale),null===(r=this.usageReporter)||void 0===r||r.report({appName:this.appName,textKey:t,textLocale:o,textUsedCount:n,sdkName:"bailingual-sdk-glue",env:this.bizEnv||"PROD"})},kp.prototype.removeBailingualCookie=function(){qd()},Object.defineProperties(kp.prototype,Tp),kp.customizedGetSystemLocale=void 0;var Pp=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.normalizeIntlMessageVariable=function(e,t){var n=e.getAst(),r=t||{};return n.forEach((function(e){ip([lu.argument,lu.number,lu.date,lu.time,lu.select,lu.plural],e.type)&&"value"in e&&void 0===r[e.value]&&(r[e.value]="")})),r},t.prototype.createIntlMessageFormat=function(e,t){return new Id(e,t,{},{ignoreTag:!0})},t}(kp),wp=(new Pp,"antom-language-storage-key"),Ip="antom_language_change_event",Cp="en_US",Rp=new Pp;function Np(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Dp(e);n&&(Rp.getAllLocales().map(Dp).includes(n)||(n=Cp),Rp.changeLocale(n),Lp(n),t?window.location.reload():window.dispatchEvent(new Event(Ip)))}function Op(e){if(e)return Dp(e);try{var t=window._amsSdkLanguage||window.sessionStorage.getItem(wp)||window.localStorage.getItem(wp);if(t)return Dp(t)}catch(e){}if(navigator.language){var n=!/[-,_]/.test(navigator.language),r=Rp.getAllLocales().find((function(e){return n?e.startsWith(navigator.language):Dp(e)===Dp(navigator.language)}))||Cp;if(r)return r=Dp(r)}return Cp}function Dp(e){var t=e;t||(t=Cp);var n=t.split(/[-,_]/),r=rt(n,2),o=r[0],i=r[1];return o||(o="en"),i?"".concat(o.toLowerCase(),"_").concat(i.toUpperCase()):o.toLowerCase()}function Lp(e){try{return window._amsSdkLanguage=e,window.localStorage.setItem(wp,e),window.sessionStorage.setItem(wp,e),!0}catch(e){return!1}}var Mp={API_MISS_PARAMS:"API_MISS_PARAMS",API_GATEWAY_TIMEOUT:"API_GATEWAY_TIMEOUT",API_SYSTEM_ERROR:"API_SYSTEM_ERROR",API_TIMEOUT:"API_TIMEOUT",API_NOT_LOGIN:"API_NOT_LOGIN",API_GATEWAY_ERROR:"API_GATEWAY_ERROR"},xp=f(f({},{UNKNOWN_ERROR:"UNKNOWN_ERROR",NO_PORTS_ERROR:"NO_PORTS_ERROR",INVALID_REDIRECT_URL:"INVALID_REDIRECT_URL"}),Mp);fl.initConfig({i18n:Rp,i18nPrefix:"ANTOMSDK",getDefaultMessage:function(){return Rp.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"})}});var Up=function(e){E(n,e);var t=A(n);function n(){var e;_(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),d($e(e),"name","AntomError"),d($e(e),"response",void 0),e}return g(n,null,[{key:"isError",value:function(e){return fl.isError(e)}},{key:"unificationError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"APP_RUNTIME";return fl.unificationError(e,t)}}]),n}(fl),Bp=function(e){E(n,e);var t=A(n);function n(){var e;_(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),d($e(e),"name","AntomCoreError"),e}return g(n)}(Up),Kp=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"defaultRequestScope";return e?{success:function(n,r,o){e.log({code:"11",msg:n,d1:o||"无traceId",d2:t,d3:Math.round(r),d5:"是",m1:1})},error:function(n,r,o,i,a){e.log({code:"11",msg:n,d1:a||"无traceId",d2:t,d3:Math.round(r),d4:"".concat(i,"-").concat(o),d5:"否",m1:0})}}:{success:function(){},error:function(){}}},Hp=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"defaultJsErrorScope";return function(n){e&&e.log({code:"12",msg:(null==n?void 0:n.message)||"上报未知的异常信息",d1:(null==n?void 0:n.stack)||"无stack信息",d2:t})}},Fp=(window||{}).navigator,Yp=Fp.userAgent,jp=function(){var e=/OpenHarmony/i.test(Fp.userAgent),t=/Phone/i.test(Fp.userAgent),n=/Tablet/i.test(Fp.userAgent);return e&&(t||n)},Gp=/iPhone|iPad|iPod/i.test(Yp)||"MacIntel"===Fp.platform&&Fp.maxTouchPoints>1,zp=/Android/i.test(Yp),Vp=(/\bMacintosh\b/.test(Yp),/Windows NT/.test(Yp),function(){return/Android|iPhone|iPad|iPod|Mobile|SymbianOS|Windows Phone/.test(Yp)||jp()}),Wp=Gp,qp=zp,Jp=!!Vp(),Qp=!Vp();jp();var Zp=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{if(!e){if(t)throw t;return}return JSON.parse(e)}catch(e){if(t)throw t;return}},Xp=function(e){var t=e.split("&&")[3];if(t){var n=function(e){try{if(!e)return;var t=atob(e),n=Uint8Array.from(t,(function(e){return e.codePointAt(0)}));return(new TextDecoder).decode(n)}catch(e){return}}(t);if(n)return Zp(n)}},$p=function(e){return(null==e?void 0:e.split("&&").slice(0,2).join("&&"))||"无trackId"},eh=function(e){return e.split("&&")[1]||"SG"},th=n(9034),nh=function(){try{var e;return(null===(e=navigator)||void 0===e?void 0:e.javaEnabled())||!1}catch(e){}return!1},rh={local:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",dev:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",sit:"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",light_sandbox:"https://imgs-sea-global.alipay.com/mgw.htm",pre:"https://imgs-sea-pre.alipay.com/mgw.htm",prod:"https://imgs-sea-global.alipay.com/mgw.htm",sandbox:"https://imgs-sea-global.alipay.com/mgw.htm"},oh="ANTOM_PAYMENT_WEB",ih=(function(e){var t={};(e||(e=window.location.href),"undefined"==typeof URL)?e.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o).replace(/\+/g," "),t[n])})):new URL(e).searchParams.forEach((function(e,n){t[n]=e}));return t}()||{}).instanceId;function ah(){return new Promise((function(e){window&&window.AlipayJSBridge?e():document.addEventListener("AlipayJSBridgeReady",(function(){return e()}),!1)}))}var sh=function(){function e(t){_(this,e),d(this,"baseUrl",void 0),d(this,"headers",void 0),d(this,"method",void 0),d(this,"timeout",void 0),this.baseUrl=t.baseURL,this.headers=t.headers,this.method=t.method,this.timeout=t.timeout,this.request=this.request.bind(this)}return g(e,[{key:"request",value:function(e){var t=this;return new Promise((function(n,r){var o,i,a={url:e.url?t.baseUrl+e.url:t.baseUrl,method:null!==(o=e.method)&&void 0!==o?o:t.method,headers:f(f({},t.headers),e.headers),timeout:null!==(i=e.timeout)&&void 0!==i?i:t.timeout};e.data&&(a.data=function(e,t){try{var n=new WeakSet;return JSON.stringify(e,(function(e,t){if("object"===Ze(t)&&null!==t){if(n.has(t))return;n.add(t)}return t}))||t}catch(e){return t}}(e.data,"")),function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new Promise((function(t){ah().then((function(){var r;(r=window.AlipayJSBridge).call.apply(r,[e].concat(n,[function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t([].concat(n))}]))}))}))}("httpRequest",f({instanceId:ih},a)).then((function(e){var t=Array.isArray(e)?e.length>0?e[0]:null:e;if(!t)return r(new Error("timeout"));if(0!==t.status)return r(new Error("timeout"));var o={status:t.httpCode,data:Zp(t.data),headers:lh(t.headers)};n(o)}))}))}}]),e}();function lh(e){if(!e)return e;var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];t[n]=Array.isArray(r)?r.length>0?r[0]:void 0:r}return t}var ch=function(e){var t=th(e,"Result-Status")||th(e,"result-status","");if(!t)return null;if(2e3==+t)return{success:!1,errorCode:Mp.API_NOT_LOGIN,errorMessage:Rp.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t};if(4001==+t)return{success:!1,errorCode:Mp.API_GATEWAY_TIMEOUT,errorMessage:Rp.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t};if(1e3!=+t){var n=th(e,"Tips")||th(e,"tips","");return{success:!1,errorCode:Mp.API_GATEWAY_ERROR,errorMessage:n?decodeURIComponent(n):Rp.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t}}return null},uh={};function dh(e,t,n){return ph.apply(this,arguments)}function ph(){return(ph=c(s().mark((function e(t,n,r){var o,i,a,l,c,u,d,p,h,m,v,g,y,_,b,E,S,A,k,T,P,w,I;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=f(f(f({},uh),r),{},{envInfo:f(f({},uh.envInfo),null==r?void 0:r.envInfo),headers:f(f({},uh.headers),null==r?void 0:r.headers)}),a=Kp(i.tracker,i.scope),l=Hp(i.tracker,i.scope),i.hostSign){e.next=10;break}e.next=8;break;case 8:console.warn("[Antom SDK] request hostSign is missing, please set hostSign in request options or global options.");case 9:i.hostSign="SG";case 10:return"WAP"===(c=f(f({terminalType:Jp?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserJavaEnabled:nh(),browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==i?void 0:i.envInfo),{},{locale:Op((null==i?void 0:i.locale)||(null==i||null===(o=i.envInfo)||void 0===o?void 0:o.locale))})).terminalType&&(c.osType=Wp?"IOS":"ANDROID"),u=[f(f({},n),{},{envInfo:c,extParams:f(f({},null==n?void 0:n.extParams),{},{refUrl:window.location.href})})],d=performance.now(),e.prev=14,p=hh(t,i),e.next=18,p({data:u});case 18:if(h=e.sent,m=h.data,v=h.headers,g=m||{},y=th(v,"Mgw-TraceId")||th(v,"mgw-traceid",""),g.traceId=y,!(_=ch(v))){e.next=29;break}throw b=_.errorMessage,E=_.errorCode,new Bp(b,E,"SERVER_API","".concat(y," (").concat(t,")"));case 29:if(g.success){e.next=36;break}throw k=g.errorMessage||g.resultMessage||Rp.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),T=g.errorCode||(null===(S=g.errorContext)||void 0===S||null===(S=S.errorStack)||void 0===S||null===(S=S[0])||void 0===S?void 0:S.errorName)||"API_SYSTEM_ERROR","true"!==(null===(A=g.extendInfo)||void 0===A?void 0:A.mulityLanguageMapping)&&(k=Rp.get({id:"server.".concat(T),defaultMessage:Rp.get({id:"event.callback.code.${errorCode}",defaultMessage:Rp.get({id:"ckp.paymentError.${errorCode}",defaultMessage:Rp.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"})})})})),(P=new Up(k,T,"SERVER_API","".concat(y," (").concat(t,")"))).response=g,P;case 36:return a.success(t,performance.now()-d,y),e.abrupt("return",g);case 40:if(e.prev=40,e.t0=e.catch(14),!Bp.isError(e.t0)){e.next=45;break}return a.error(t,performance.now()-d,e.t0.message,e.t0.code,e.t0.traceId),e.abrupt("return",Promise.reject(e.t0));case 45:return I=e.t0,l(I),e.abrupt("return",Promise.reject(new Bp(I.message,null!==(w=I.message)&&void 0!==w&&w.includes("timeout")?"API_TIMEOUT":"API_SYSTEM_ERROR","SYSTEM","WithoutTraceId (".concat(t,")"))));case 48:case"end":return e.stop()}}),e,null,[[14,40]])})))).apply(this,arguments)}function hh(e,t){var n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=(null==t?void 0:t.env)||"prod",a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n={"com.ipay.iexpcashier.sdkAction.query":"com.ipay.iopensandbox.sdk.paymentSession.query"},r="SDK_MOCK_SANDBOX";if(n[e]&&"light_sandbox"===t)return{appId:r,operationType:n[e]}}(e,i),s=(null==t?void 0:t.baseURL)||function(e,t){var n;return"pre"===t||"sandbox"===t&&"pre"===(null===(n=window)||void 0===n||null===(n=n.marmotInjectInfo)||void 0===n||null===(n=n.env)||void 0===n?void 0:n.toLocaleLowerCase())?{SG:"https://imgs-sea-pre.alipay.com/mgw.htm",US:"https://imgs-pre.alipay.com/mgw.htm",DE:"https://imgs-de-pre.alipay.com/mgw.htm",QK:"https://iopengw-qkgz99p.alipay.com/mgw.htm",ID:"https://imgs-id-pre.alipay.com/mgw.htm",SA:"https://imgs-sa-pre.alipay.com/mgw.htm"}[e||"SG"]:"prod"===t||"light_sandbox"===t||"sandbox"===t?{SG:"https://imgs-sea-global.alipay.com/mgw.htm",US:"https://imgs-na-global.alipay.com/mgw.htm",DE:"https://imgs-de-global.alipay.com/mgw.htm",QK:"https://imgs-qk.alipay.com/mgw.htm",ID:"https://imgs-id.alipay.com/mgw.htm",SA:"https://imgs-sa.alipay.com/mgw.htm"}[e||"SG"]:void 0}(null==t?void 0:t.hostSign,i)||rh[i],l=f(d(d(d(d(d(d(d(d({appId:(null==t?void 0:t.appId)||(null==a?void 0:a.appId)||oh,workspaceId:"pre"===(null==t?void 0:t.env)?"pre":"default"},"x-cors-".concat(oh.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",null==t?void 0:t.groupId),"Operation-Type",(null==a?void 0:a.operationType)||e),"Client-Time",o),"tntInstId","ALIPW3SG"),"x-mago-timeout",(null==t?void 0:t.timeout)||15e3),"sdk-version",(null==t?void 0:t.sdkVersion)||"0.0.1787898127-dev.2"),null==t?void 0:t.headers);"dev"!==i&&delete l["sofa-group-name"],"sandbox"===i&&(l["load-test"]=!0,l.sofaPenAttrs="instMock=O&loadMode=2");var c,u=null!==(n=null==t?void 0:t.timeout)&&void 0!==n?n:15e3,p=Object.entries(l).filter((function(e){return void 0!==e[1]&&null!==e[1]&&"object"!==Ze(e[1])})).reduce((function(e,t){var n=rt(t,2),r=n[0],o=n[1];return e[r]=String(o),e}),{}),h={baseURL:s,timeout:u,headers:l},m=null;"app"===uh.appType?m=new sh({baseURL:s,method:"POST",timeout:u,headers:p}):m=Vi.create(f(f({},h),{},{withCredentials:null===(c=null==t?void 0:t.withCredentials)||void 0===c||c,method:(null==t?void 0:t.method)||"POST"}));return m.request}dh.setGlobalOptions=function(e){Object.assign(uh,e)};"".concat(window.location.origin,"/elements/src/pages");var mh=Xp,fh=function(e){var t;if(!e)return{modernWeb:!1};var n=mh(e),r=!(null==n||null===(t=n.flowSwitchTags)||void 0===t||!t.split(",").includes("elementV3"));var o=!(null==n||!n.modernWeb);return(r||o)&&console.log("isModernWeb ------------\x3e true"),{fromFrontend:o,modernWeb:r||o}};function vh(e){if(!e)return e;var t=fh(e),n=t.fromFrontend,r=t.modernWeb;if(!n||!r)return e;var o=e.split("&&").slice(0,3),i=mh(e);return null==i||delete i.modernWeb,o.concat(function(e){try{if(!e)return;var t=(new TextEncoder).encode(e),n=Array.from(t,(function(e){return String.fromCodePoint(e)})).join("");return btoa(n)}catch(e){return}}(JSON.stringify(i))).join("&&")}var gh=function(e){return fh(e).modernWeb},yh=n(4606),_h=n.n(yh),bh=n(731),Eh=n.n(bh),Sh=n(5270);function Ah(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Sh.apply(void 0,[{},e].concat(n))}var kh=new vc({appId:"180020050100012557",performance:!1,error:!1,env:"DEV",compactExtraInfo:!0}),Th="7981",Ph=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return function(t){kh.log(f({code:"".concat(Th).concat(e)},t))}},wh=Ph(),Ih=Ph("event"),Ch=Ph("mount"),Rh=Ph("handshake"),Nh=Ph("merchant"),Oh=Ph("element"),Dh=function(){if(window.sdkDebugger)return Promise.resolve(window.sdkDebugger);var t="2.0.6".replace(/-dev\.[0-9]+/,""),n="https://cdn.marmot-cloud.com/tnpm-package/@antintl-opensdk-debugger/1.0.6/dist/main.umd.js";return n="https://marmot-local-dev.oss-accelerate.aliyuncs.com/tnpm-package/@antintl-opensdk-debugger/".concat(t,"/dist/main.umd.js"),(0,e().loadScript)(n,"sdkDebugger").then((function(e){return e.variable}))},Lh=function(e,t,n,r){var o;if("ERROR"===e){var i=r||{};wh({msg:i.code||n,d1:t,d2:i.reason,d3:i.stack,d4:i.traceId,d5:i.operationType,d6:n})}else{if(n.includes(":HOST:")||n.includes(":WEBAPP:")){var a=n.split(":"),s=rt(a,3),l=s[0],c=s[1],u=s[2];Ih({msg:u,d1:t,d2:l,d3:c,d4:JSON.stringify(r),d5:"无",d6:e})}}null===(o=window.sdkDebugger)||void 0===o||o.log(e,t,n,r)},Mh=function(e){if(e){var t=function(e){var t=e.message,n=e.traceId,r=e.code,o=e.source,i=e.stack,a=e.reason;if("SERVER_API"===e.source){var s=(null==n?void 0:n.match(/([a-z0-9\sA-Z]*)(\s*\(([a-zA-Z0-9\.]*)\))?/))||[],l=rt(s,4),c=(l[0],l[1]),u=(l[2],{code:r,source:o,message:t,operationType:l[3],traceId:(null==c?void 0:c.replace(/\s/g,""))||"无traceID",stack:i,reason:a});return JSON.parse(JSON.stringify(u))}return e}(fl.isError(e)?e.toJSON():e);Lh("ERROR",t.source,t.operationType||t.message||"Unknown Error",t)}},xh=function(e){E(n,e);var t=A(n);function n(){var e;_(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),d($e(e),"name","SDKInternalError"),e}return g(n)}(fl),Uh=function(e){E(n,e);var t=A(n);function n(e){return _(this,n),t.call(this,"HOST",e)}return g(n,[{key:"_transferReceivePort",value:function(e){yh(bh(n.prototype),"_transferReceivePort",this).call(this,e)}},{key:"_addPort",value:function(e){yh(bh(n.prototype),"_addPort",this).call(this,e)}},{key:"_transferSendPort",value:function(e){yh(bh(n.prototype),"_transferSendPort",this).call(this,e)}},{key:"setTarget",value:function(e){yh(bh(n.prototype),"setTarget",this).call(this,e)}},{key:"setDebugCallback",value:function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];(e=yh(bh(n.prototype),"setDebugCallback",this)).call.apply(e,[this].concat(r))}}],[{key:"getGlobalBridge",value:function(){return pc.getGlobalBridge("HOST")}}]),n}(pc),Bh=function(e){E(n,e);var t=A(n);function n(e,r,o){var i;return _(this,n),i=t.call(this,e,r,o||"SDK_USAGE"),d($e(i),"name","MountError"),i}return g(n)}(xh),Kh=function(e){return new xh("Element destroyed, previous status: ".concat(e),"ELEMENT_INSTANCE_DESTROYED","SDK_USAGE")},Hh=function(){function e(t,n){_(this,e),d(this,"name",void 0),d(this,"_elementMode",void 0),d(this,"_isMainElement",void 0),d(this,"config",void 0),d(this,"bridge",void 0),d(this,"hooks",{}),d(this,"iframe",null),d(this,"status",void 0),d(this,"cachedSend",[]),d(this,"submitPromise",void 0),this.config=n,this._isMainElement=n.isMainElement,this._elementMode=n.elementMode,this.name=t,this.bridge=new Uh(t),this.bridge.setOrigin(n.targetOrigin),n.trackId&&kh.setTrackId(n.trackId),this.bridge.setDebugCallback((function(e,t){try{if(e.type.endsWith(Fl)||e.type.endsWith(ic))return;var n,r;if(e.type.endsWith(Xl))Lh(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message);else e.type.endsWith(Jl)&&"IN"===t?Mh(e.payload):Lh("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload)}catch(e){}})),this.status="initialized"}var t,n,r,o,i;return g(e,[{key:"submit",value:function(e){throw new xh("This element not support submit","NOT_SUPPORT_SUBMIT","SDK_USAGE")}},{key:"setup",value:(i=c(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",void 0);case 1:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"_setup",value:(o=c(s().mark((function e(){var t,n,r,o,i=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=function(){return"destroyed"===i.status})()){e.next=3;break}return e.abrupt("return");case 3:return n=function(){},r=new Promise((function(e,t){n=i._addHook("ondestroy",(function(e){return t(Kh(e))}))})),o=Promise.resolve().then(c(s().mark((function e(){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,i.setup();case 4:return n=e.sent,e.abrupt("return",t()?void 0:n);case 6:case"end":return e.stop()}}),e)})))),e.prev=6,e.next=9,Promise.race([o,r]);case 9:return e.abrupt("return",e.sent);case 10:return e.prev=10,t()||n(),e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[6,,10,13]])}))),function(){return o.apply(this,arguments)})},{key:"is",value:function(e){return this.name.startsWith(e.elementType)}},{key:"mount",value:(r=c(s().mark((function e(t){var n,r,o,i,a=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("initialized"===this.status||"unmounted"===this.status){e.next=4;break}throw n=new Bh({message:"element status is ".concat(this.status,", can not mount again"),params:{status:this.status}},"MOUNT_NOT_SUPPORT"),Mh(n),n;case 4:return r=Date.now(),o=Dl((function(){return Promise.all([a._setup(),a._mount(t)])}),15e3,new Bh("Mount timeout","MOUNT_TIMEOUT","SYSTEM")),i=Ml((function(){Ch({msg:a.name,d1:"用户退出页面",m1:0,m2:Math.round(Date.now()-r),m3:a.isMainElement?1:0,m4:a.isSingleMode?1:0})})),e.abrupt("return",o().then((function(e){var t=rt(e,1)[0];Nh({msg:a.name,d1:(null==t?void 0:t.merchantId)||"未配置的商户"}),Ch({msg:a.name,d1:"挂载成功",m1:1,m2:Math.round(Date.now()-r),m3:a.isMainElement?1:0,m4:a.isSingleMode?1:0}),a.bridge.send(Kl,Ah(a.config.appConfig,t||{}))})).catch((function(e){"destroyed"!==a.status&&a.unmount();var t=xh.unificationError(e);throw Ch({msg:a.name,d1:"挂载失败",d2:t.code,d3:t.reason,m1:0,m2:Math.round(Date.now()-r),m3:a.isMainElement?1:0,m4:a.isSingleMode?1:0}),Mh(t),t})).finally((function(){i()})));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_mount",value:(n=c(s().mark((function e(t){var n=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=c(s().mark((function e(r,o){var i,a,l,c,u,d,p,h,m,f;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.isMainElement||!n.isSingleMode){e.next=2;break}return e.abrupt("return",o(new Bh({message:"".concat(n.name," element can not be used with single mode"),params:{elementName:n.name}},"MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE")));case 2:if(e.prev=2,t){e.next=5;break}return e.abrupt("return",o(new Bh("container missing","MOUNT_MISSING_CONTAINER")));case 5:i=n.config.appUrl,a=new URL(n.config.appUrl),l=[["origin",window.location.origin],["locale",n.config.locale]].concat(tt(n.config.trackId?[["track_id",n.config.trackId]]:[]));try{l.forEach((function(e){var t=rt(e,2),n=t[0],r=t[1];return a.searchParams.set(n,r)})),i=a.toString()}catch(e){c=i.includes("?")?"&":"?",u=l.map((function(e){var t=rt(e,2),n=t[0],r=t[1];return"".concat(n,"=").concat(encodeURIComponent(r))})).join("&"),i="".concat(i).concat(c).concat(u)}(d=t.querySelector("#sdk-loading"))&&(d.style.display=""),n.status="mounting",n.iframe||(n.iframe=document.createElement("iframe"),n.iframe.src=i,n.iframe.style.width="100%",n.iframe.style.border="none",n.iframe.style.height="0",n.iframe.style.borderRadius="inherit",n.iframe.style.transition="height 0.3s ease",n.iframe.style.colorScheme=null!==(p=n.config.colorScheme)&&void 0!==p?p:"light dark",n.iframe.allow="payment",n.bridge.on(ic,(function(e){n.iframe&&(n.iframe.style.height="".concat(e,"px"))}))),h=Date.now(),m="*";try{"null"===(m=new URL(n.iframe.src).origin)&&(m="*")}catch(e){m="*"}n.bridge.setOrigin(m),f=n._addHook("ondestroy",(function(e){o(Kh(e))})),n.bridge.once(Hl,(function(){var e;if(d&&(d.style.display="none"),"mounted"!==n.status&&"ready"!==n.status){if(null===(e=n.iframe)||void 0===e||!e.contentWindow)return r();Lh("INFO","SYSTEM","Iframe ".concat(n.name," loaded, initiating handshake...")),n.status="mounted",n.bridge.setTarget(n.iframe.contentWindow);var t=Date.now();n.bridge.once(Ql,(function(e){n.status="ready",n.cachedSend.length&&(n.cachedSend.forEach((function(e){var t=e.type,r=e.payload;n.bridge.send(t,r)})),n.cachedSend=[]),Rh({msg:n.name,d1:(null==e?void 0:e.version)||"未知版本",m1:Math.round(Date.now()-t),m2:1,m3:Math.round(Date.now()-h)})})),f(),r()}else f()})),n.iframe.onerror=function(e){o(new Bh("Iframe load error: ".concat(e),"MOUNT_IFRAME_LOAD_ERROR","SYSTEM"))},t.appendChild(n.iframe),e.next=24;break;case 21:e.prev=21,e.t0=e.catch(2),o(new Bh("Initialization crashed: ".concat(e.t0.message),"MOUNT_INITIAL_FAILED","SDK_INTERNAL"));case 24:case"end":return e.stop()}}),e,null,[[2,21]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"updateConfig",value:(t=c(s().mark((function e(t){var n,r,o,i=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"destroyed"!==this.status){e.next=3;break}throw new xh("Element already destroyed, cannot update destroyed SDK instance","ELEMENT_INSTANCE_DESTROYED","SDK_USAGE");case 3:if("ready"===this.status){e.next=5;break}throw new xh({message:"Element is { status }, it is not ready, cannot update config",params:{status:this.status}},"UPDATE_CONFIG_NOT_READY","SDK_USAGE");case 5:return this.config.appConfig=Ah(this.config.appConfig,t),Lh("INFO","SDK_USAGE","Updating configuration via API",t),n=function(){},r=Dl((function(){return new Promise((function(e){n=i.bridge.once(Yl,(function(t){e(t)})),i.bridge.send(Fl,{merged:i.config.appConfig,updated:t})}))}),3e3,new xh("Update config timeout","UPDATE_CONFIG_TIMEOUT","SYSTEM")),e.abrupt("return",r().catch((function(e){return n(),{error:xh.unificationError(e).toJSON()}})));case 12:return e.prev=12,e.t0=e.catch(0),o=xh.unificationError(e.t0),e.abrupt("return",Promise.resolve({error:o.toJSON()}));case 16:case"end":return e.stop()}}),e,this,[[0,12]])}))),function(e){return t.apply(this,arguments)})},{key:"unmount",value:function(){"mounted"===this.status||"ready"===this.status?(this.status="unmounted",this.iframe&&this.iframe.parentNode&&(this.iframe.style.height="0",this.iframe.parentNode.removeChild(this.iframe))):Lh("WARN","SDK_USAGE","element status is ".concat(this.status,", can not unmount, please check the usage. only mounted or ready status can unmount"))}},{key:"isSingleMode",get:function(){return"SINGLE"===this._elementMode}},{key:"on",value:function(e,t){this.bridge.on(e,t)}},{key:"send",value:function(e,t){"destroyed"!==this.status?"ready"===this.status?this.bridge.send(e,t):this.cachedSend.push({type:e,payload:t}):Mh(new xh("element status is ".concat(this.status,", can not send message"),"ELEMENT_INSTANCE_DESTROYED","SDK_USAGE"))}},{key:"_addPort",value:function(e){!this.isSingleMode&&this.isMainElement&&this.bridge._addPort(e)}},{key:"_transferReceivePort",value:function(e){!this.isSingleMode&&this.isMainElement&&this.bridge._transferReceivePort(e)}},{key:"_transferSendPort",value:function(e){this.isSingleMode||this.isMainElement||this.bridge._transferSendPort(e)}},{key:"_submit",value:function(e){var t=this;return"HOST"!==this.bridge.mode?Promise.reject(new Error("submit method only available in HOST mode")):(this.submitPromise||(this.submitPromise=new Promise((function(n){t.send(jl,e),t.bridge.once(Gl,(function(e){n(e)}))})).finally((function(){t.submitPromise=void 0}))),this.submitPromise)}},{key:"destroy",value:function(){var e,t=this;if("destroyed"!==this.status){if(null===(e=this.hooks.ondestroy)||void 0===e||e.forEach((function(e){return e(t.status)})),this.hooks={},this.bridge.destroy(),"mounted"===this.status||"ready"===this.status)this.unmount();else{var n,r=null===(n=this.iframe)||void 0===n?void 0:n.parentNode;r&&r.removeChild(this.iframe)}this.status="destroyed"}else Lh("WARN","SDK_USAGE","element status is ".concat(this.status,", can not destroy, please check the usage. only mounted or ready status can destroy"))}},{key:"isMainElement",get:function(){return this._isMainElement}},{key:"_addHook",value:function(e,t){var n,r=this;return this.hooks[e]||(this.hooks[e]=[]),null===(n=this.hooks[e])||void 0===n||n.push(t),function(){var n;r.hooks[e]=null===(n=r.hooks[e])||void 0===n?void 0:n.filter((function(e){return e!==t}))}}}]),e}();d(Hh,"elementType",void 0);var Fh=function(e){E(n,e);var t=A(n);function n(e,r,o,i){return _(this,n),t.call(this,e,f(f({},o),{},{isMainElement:!0,appUrl:r,appConfig:i||{}}))}return g(n,[{key:"_submit",value:function(e){return yh(bh(n.prototype),"_submit",this).call(this,e)}}]),n}(Hh),Yh=function(){function e(t){var n,r=this;_(this,e),d(this,"config",void 0),d(this,"isInit",!1),d(this,"isDestroyed",!1),d(this,"version",void 0),d(this,"elementMode","SINGLE"),d(this,"_elements",new Map),d(this,"globalBridgeForWebApp",void 0),d(this,"globalBridgeForModal",void 0),d(this,"openModalHandle",void 0),d(this,"elementClasses",{}),d(this,"modalIsReady",!1),this.config=t,this.version=t.version,t.trackerCode&&(n=t.trackerCode,Th=n);var o=this.globalBridgeForWebApp=Uh.getGlobalBridge();o.on(Vl,function(){var e=c(s().mark((function e(t){var n,i,a,l,c,u,d,p,h,m;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((a=r._elements.get(t.scope))&&null!==(n=a.iframe)&&void 0!==n&&n.contentWindow){e.next=4;break}return Lh("WARN","SDK_INTERNAL","Element not found or iframe contentWindow not available"),e.abrupt("return");case 4:(l=r.globalBridgeForModal=Uh.getGlobalBridge()).setDebugCallback((function(e,t){"OUT"===t&&Lh("INFO","SDK_INTERNAL",e.type,e.payload)})),o.setTarget(a.iframe.contentWindow),e.prev=7,c=new URL(t.url),t.closeConfirm&&c.searchParams.append("confirm","true"),t.url=c.toString(),e.next=18;break;case 13:return e.prev=13,e.t0=e.catch(7),u=new xh("Invalid URL","INVALID_MODAL_URL","APP_RUNTIME"),o.send(Wl,u),e.abrupt("return");case 18:return d=new MessageChannel,p=t.modalId||Ll("modal_"),e.next=22,r.openModal(f(f({},t),{},{onClose:function(){if(t.closeConfirm)return new xl(p,d.port2).close(!0)}}));case 22:h=r.openModalHandle=e.sent,o.send(ec,p,[d.port1]),m=function(e,n,o){o&&o.source!==h.getContentWindow()||r.modalIsReady||(r.modalIsReady=!0,l.setTarget(h.getContentWindow()),t.appearance&&l.send(rc,t.appearance),t.initialData&&l.send(oc,t.initialData),l.send(nc,p,[d.port2]))},l.once(tc,m),null===(i=h.onLoadedSuccess)||void 0===i||i.call(h,m),o.once(ql,(function(){r.modalIsReady=!1,h.destroy(),l.destroy()}));case 28:case"end":return e.stop()}}),e,null,[[7,13]])})));return function(t){return e.apply(this,arguments)}}()),o.on(zl,function(){var e=c(s().mark((function e(t,n,o){var i,a,l,c,u,d,p,h;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=null==o?void 0:o.source,l=Array.from(r._elements.values()).some((function(e){var t;return(null===(t=e.iframe)||void 0===t?void 0:t.contentWindow)===a})),c=(null===(i=r.openModalHandle)||void 0===i?void 0:i.getContentWindow())===a,!a||l||c){e.next=5;break}return e.abrupt("return");case 5:return u=t.url,d=t.mode,p=void 0===d?"redirect":d,h=t.destroy,(void 0===h||h)&&r.destroy(),e.prev=7,e.next=10,r.redirect(t);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),"replace"===p?window.location.replace(u):"redirect"===p&&(window.location.href=u);case 15:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(t,n,r){return e.apply(this,arguments)}}()),o.on(sc,function(){var e=c(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(n=r._elements.get(t.elementKey))?null==n||n.destroy():Lh("WARN","SDK_INTERNAL","Element not found when destroy");case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),o.setDebugCallback((function(e,t){var n,r;e.type.endsWith(Xl)?Lh(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message):e.type.endsWith(Jl)&&"IN"===t?Mh(e.payload):e.type.endsWith(Wl)?Lh("ERROR","APP_RUNTIME","Open modal error",e.payload):Lh("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload)})),this.canUseElements().forEach((function(e){var t=e,n=void 0;"function"!=typeof e&&(t=e.ElementClass,n=e.config);var o=t;if(!o.elementType)throw new xh("ElementClass must have a static elementType property","ELEMENT_DEFINE_ERROR","SDK_INTERNAL");var i=r._generateElementKey(o.elementType,n);if(r.elementClasses[i])throw new xh('This elementType "'.concat(o.elementType,'" ').concat(n?"with config ".concat(JSON.stringify(n)):""," is already registered in factory"),"ELEMENT_ALREADY_REGISTERED","SDK_INTERNAL");r.elementClasses[i]=o}))}var t,n;return g(e,[{key:"openModal",value:(n=c(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Lh("WARN","SDK_INTERNAL","Open modal request received, but no handler implemented.",t),e.abrupt("return",Promise.resolve({destroy:function(){},onLoadedSuccess:function(e){},getContentWindow:function(){return null}}));case 2:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"redirect",value:function(e){throw Lh("WARN","SDK_INTERNAL","Custom redirect was not implemented, and the default browser redirection method was used",e),new Error("REDIRECT_NOT_IMPLEMENTED")}},{key:"init",value:(t=c(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isInit){e.next=2;break}return e.abrupt("return",this);case 2:if(!this.config.debug){e.next=5;break}return e.next=5,Dh().then((function(e){null==e||e.mount()})).catch((function(){var e=new xh("Load debugger failed","LOAD_DEBUGGER_FAILED","SDK_INTERNAL");Mh(e)}));case 5:return this.isInit=!0,e.abrupt("return",this);case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"generateElementKey",value:function(e,t){return e}},{key:"updateConfig",value:function(e){var t=e.locale,n=e.debug,r=e.env;t&&(this.config.locale=t),n&&(this.config.debug=n),r&&(this.config.env=r),(t||r)&&this._elements.forEach((function(t){t.updateConfig(e)}))}},{key:"destroy",value:function(){var e,t;this._elements.forEach((function(e){e.destroy()})),this._elements.clear(),null===(e=this.openModalHandle)||void 0===e||e.destroy(),null===(t=this.globalBridgeForModal)||void 0===t||t.destroy(),this.globalBridgeForWebApp.destroy(),this.isDestroyed=!0}},{key:"_generateElementKey",value:function(e,t){try{var n=this.generateElementKey(e,t);if(!n.startsWith(e))throw new xh("Generate element key error, must start with elementType","GENERATE_ELEMENT_KEY_FAILED","SDK_INTERNAL");return n}catch(n){var r=new xh({message:"Generate element ".concat(e," key error, with options ").concat(JSON.stringify(t)),params:{elementType:e,options:t}},"GENERATE_ELEMENT_KEY_FAILED","SDK_INTERNAL");throw Mh(r),r}}},{key:"_createElement",value:function(e,t){var n,r,o=this,i=this._generateElementKey(e,t);if(n=this.elementClasses[i],Oh({msg:e,m1:n?1:0}),!n){var a=new xh({message:"Element type ".concat(e," not supported."),params:{elementType:e}},"NOT_SUPPORT_ELEMENT","SDK_USAGE");throw Mh(a),a}try{r=new n(i,f(f({},this.config),{},{elementMode:this.elementMode,appConfig:f({env:this.config.env,locale:this.config.locale},t)}))}catch(a){var s=xh.isError(a)?a:new xh({message:"Element type ".concat(e," initialization failed ").concat(a instanceof Error?a.message:""),params:{elementType:e}},"ELEMENT_INIT_FAILED","SDK_INTERNAL");throw Mh(s),s}return r._addHook("ondestroy",(function(){o._removeElement(e,t),o._getElementSize()||Lh("INFO","SDK_INTERNAL","All elements destroyed")})),this._addElement(e,r,t),r}},{key:"_addElement",value:function(e,t,n){if(this._elements.has(this._generateElementKey(e,n))){var r=new xh({message:"".concat(e," element already exists, please don't create twice."),params:{elementType:e}},"CANNOT_CREATE_SAME_ELEMENT_TWICE","SDK_USAGE");throw Mh(r),r}this._elements.set(this._generateElementKey(e,n),t)}},{key:"_removeElement",value:function(e,t){this._elements.delete(this._generateElementKey(e,t))}},{key:"_getElement",value:function(e,t){return this._elements.get(this._generateElementKey(e,t))}},{key:"_getElementSize",value:function(){return this._elements.size}}]),e}(),jh=function(e){E(r,e);var t,n=A(r);function r(e){var t;return _(this,r),t=n.call(this,e),d($e(t),"waitSendPort",[]),d($e(t),"mainElement",void 0),t.elementMode="GROUP",t}return g(r,[{key:"_mainElement",get:function(){return this.mainElement}},{key:"_createElement",value:function(e,t){var n=this,o=yh(bh(r.prototype),"_createElement",this).call(this,e,t);if(o.isMainElement){if(this.mainElement){var i=new xh("Only has one main element","GROUPS_ONLY_ONE_MAIN_ELEMENT","SDK_USAGE");throw Mh(i),i}this.mainElement=o;var a=new Ul(e);o.on(Ql,(function(){o._transferReceivePort(a),n.waitSendPort.length&&(o._addPort(tt(n.waitSendPort)),n.waitSendPort=[])}))}else{var s=new MessageChannel,l=new Bl(e,s.port1);o.on(Ql,(function(){o._transferSendPort(l),n.mainElement?n.mainElement._addPort([s.port2]):n.waitSendPort.push(s.port2)}))}return o._addHook("ondestroy",(function(){o.isMainElement&&(n.mainElement=void 0)})),o}},{key:"_submit",value:(t=c(s().mark((function e(){var t,n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mainElement){e.next=4;break}throw n=new xh("There is no main element, Must has one main element, can not be submit","GROUPS_NOT_FOUND_MAIN_ELEMENT","SDK_USAGE"),Mh(n),n;case 4:return e.abrupt("return",null===(t=this.mainElement)||void 0===t?void 0:t._submit());case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),r}(Yh),Gh=function(e){E(n,e);var t=A(n);function n(){return _(this,n),t.apply(this,arguments)}return g(n)}(Yh),zh=(v()(v()(v()({},xp),{GENERATE_ELEMENT_KEY_FAILED:"GENERATE_ELEMENT_KEY_FAILED",ELEMENT_INIT_FAILED:"ELEMENT_INIT_FAILED",MOUNT_TIMEOUT:"MOUNT_TIMEOUT",MOUNT_MISSING_CONTAINER:"MOUNT_MISSING_CONTAINER",MOUNT_IFRAME_LOAD_ERROR:"MOUNT_IFRAME_LOAD_ERROR",MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE:"MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE",MOUNT_NOT_SUPPORT:"MOUNT_NOT_SUPPORT",MOUNT_INITIAL_FAILED:"MOUNT_INITIAL_FAILED",ELEMENT_INSTANCE_DESTROYED:"ELEMENT_INSTANCE_DESTROYED",ELEMENT_DEFINE_ERROR:"ELEMENT_DEFINE_ERROR",ELEMENT_ALREADY_REGISTERED:"ELEMENT_ALREADY_REGISTERED",CANNOT_CREATE_SAME_ELEMENT_TWICE:"CANNOT_CREATE_SAME_ELEMENT_TWICE",GROUPS_ONLY_ONE_MAIN_ELEMENT:"GROUPS_ONLY_ONE_MAIN_ELEMENT",GROUPS_NOT_FOUND_MAIN_ELEMENT:"GROUPS_NOT_FOUND_MAIN_ELEMENT",NOT_SUPPORT_ELEMENT:"NOT_SUPPORT_ELEMENT",NOT_SUPPORT_SUBMIT:"NOT_SUPPORT_SUBMIT",UPDATE_CONFIG_TIMEOUT:"UPDATE_CONFIG_TIMEOUT",UPDATE_CONFIG_NOT_READY:"UPDATE_CONFIG_NOT_READY",INVALID_MODAL_URL:"INVALID_MODAL_URL",LOAD_DEBUGGER_FAILED:"LOAD_DEBUGGER_FAILED"}),{},{NOT_FIND_MAINELEMENT:"NOT_FIND_MAINELEMENT",SESSION_DATA_INVALID:"SESSION_DATA_INVALID",SDK_LAUNCH_PAYMENT_APP_ERROR:"SDK_LAUNCH_PAYMENT_APP_ERROR",PARAM_INVALID:"PARAM_INVALID",CHANNEL_CLIENT_ID_QUERY_TIMEOUT:"CHANNEL_CLIENT_ID_QUERY_TIMEOUT",CHANNEL_CLIENT_ID_MISSING:"CHANNEL_CLIENT_ID_MISSING",CHANNEL_CLIENT_ID_QUERY_FAILED:"CHANNEL_CLIENT_ID_QUERY_FAILED",CHANNEL_CLIENT_ID_QUERY_ERROR:"CHANNEL_CLIENT_ID_QUERY_ERROR",CHECKOUT_NOT_READY:"CHECKOUT_NOT_READY",PAYMENT_IN_PROGRESS:"PAYMENT_IN_PROGRESS",AMOUNT_VALUE_EMPTY:"AMOUNT_VALUE_EMPTY",AMOUNT_VALUE_INVALID:"AMOUNT_VALUE_INVALID"}),function(e){S()(n,e);var t=k()(n);function n(){var e;b()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),p()(et()(e),"name","AntomSDKError"),e}return y()(n)}(Up)),Vh={default:{theme:"light",backgroundColor:"#ffffff"},light:{theme:"light",backgroundColor:"#ffffff"},night:{theme:"dark",backgroundColor:"#141935"},agateGreen:{theme:"dark",backgroundColor:"#344343"},nostalgicGray:{theme:"light",backgroundColor:"#e8e8e8"},gamingPurple:{theme:"dark",backgroundColor:"#070b29"},cherryBlossomPink:{theme:"light",backgroundColor:"#FFFCFD"}};function Wh(e,t){var n;if(!e)throw new zh("sessionData is required","SESSION_DATA_INVALID","SDK_USAGE");Lh("INFO","SDK_USAGE","Setup called with sessionData:",{sessionData:e});var r=mh(e);if(!r)throw new zh("Failed to parse sessionData, please check the sessionData","SESSION_DATA_INVALID","SDK_USAGE");var o=null===(n=r.paymentSessionConfig)||void 0===n?void 0:n.productScene;if(t&&o!==t)throw new zh("Invalid productScene in sessionData, expected ".concat(t,", but get ").concat(o,", please check the sessionData is correct?"),"SESSION_DATA_INVALID","SDK_USAGE");return r}var qh="ams-popup",Jh=300,Qh="ams-component-popup-loading",Zh="\n .".concat(qh,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(qh,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(qh,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(qh,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(Jh,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(qh,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(Jh,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(qh,"-drawer-enter {\n animation: slideIn ").concat(Jh,"ms forwards;\n }\n\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(qh,"-drawer-exit {\n animation: slideOut ").concat(Jh,'ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: \'\';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n'),Xh=function(e,t){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light",t="\n .ams-component-popup-loading .line div:before,\n .ams-component-popup-loading .line div:after {\n background: ".concat("light"===e?"#000000":"#ffffff"," !important;\n }"),n=document.createElement("style");n.innerHTML=t,document.head.appendChild(n)}(e);var n=document.createElement("div");return null==n||n.classList.add(Qh),n.id=Qh,n.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div><span id="text" style="font-size: 16px;position:absolute;bottom: 0;white-space: nowrap">'.concat(t||"","</span>"),n.style.fontSize="".concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:390,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:130,n=document.documentElement.clientWidth,r=Qp?t:100*n/e;return Math.min(r,t)}(),"px"),n};var $h=function(e){var t=e.mode,n=e.url,r=e.loadingConfig,o=e.showClose,i=void 0===o||o,a=e.onClose,s=e.textDirection,c=void 0===s?"ltr":s,d=e.showLoading,p=void 0===d||d,h=document.createElement("div");h.classList.add("".concat(qh,"overlay"),"".concat(qh,"fadeIn"));var m=document.createElement("div");"desktop"===t?(m.classList.add("".concat(qh,"modal"),"".concat(qh,"fadeIn")),m.style.width="656px",m.style.height="620px",m.style.borderRadius="12px"):(m.classList.add("".concat(qh,"modal-mobile"),"".concat(qh,"-drawer-enter")),m.style.width="100%",m.style.height="80vh",m.style.borderRadius="12px 12px 0 0"),m.setAttribute("dir",c);var f=function(e,t,n){return function(){t&&(t.classList.remove("".concat(qh,"fadeIn")),t.classList.add("".concat(qh,"fadeOut")),"desktop"===e?(n.classList.remove("".concat(qh,"fadeIn")),n.classList.add("".concat(qh,"fadeOut"))):(n.classList.remove("".concat(qh,"-drawer-enter")),n.classList.add("".concat(qh,"-drawer-exit"))),setTimeout((function(){var e,r;null===(e=t.parentNode)||void 0===e||e.removeChild(t),null===(r=n.parentNode)||void 0===r||r.removeChild(n)}),Jh))}}(t,h,m),v=document.createElement("iframe");v.src=n,v.style.border="none",v.style.width="100%",v.style.height="100%";var g,y=r||{},_=y.theme,b=void 0===_?"light":_,E=y.backgroundColor,S=void 0===E?"#ffffff":E,A=Xh(b);if(v.addEventListener("load",(function e(){m.removeChild(A),v.removeEventListener("load",e)})),i){var k=function(e){var t=e.onClose,n=e.textDirection,r=document.createElement("div");r.style.position="absolute","rtl"===n?r.style.left="16px":r.style.right="16px",r.style.top="23px",r.style.cursor="pointer";var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("viewBox","0 0 16 16"),o.setAttribute("fill","none");var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("d","M13.0449 2.99894L12.9494 2.91165L12.8685 2.85222L12.7802 2.7996C12.3611 2.57499 11.8556 2.64328 11.5228 2.9763L7.99909 6.50088L4.48854 2.99028L4.44701 2.95034C4.0098 2.57169 3.38048 2.57202 2.99838 2.9525L2.92363 3.03297L2.85175 3.12897L2.79916 3.21735C2.57471 3.63642 2.64292 4.14198 2.9757 4.47491L6.50186 8.00046L2.95226 11.5518C2.57141 11.9917 2.57173 12.6211 2.95197 13.0033L3.0324 13.078L3.12837 13.15L3.21674 13.2026C3.63573 13.4272 4.14123 13.3589 4.47407 13.0259L7.99909 9.49935L11.5474 13.0494C11.9944 13.4368 12.6238 13.4235 13.0212 13.0259L13.0922 12.9471L13.1559 12.8595C13.4298 12.4403 13.3789 11.8852 13.0211 11.5272L9.497 8.00115L13.0052 4.4915L13.07 4.4225C13.4304 4.00477 13.4199 3.37582 13.0449 2.99894Z"),i.setAttribute("fill","#ABB9CC"),o.appendChild(i),r.appendChild(o),r.onclick=t,r}({onClose:(g=!1,u()(l()().mark((function e(){var t,n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!g){e.next=2;break}return e.abrupt("return");case 2:return null===(t=A.parentNode)||void 0===t||t.removeChild(A),m.removeChild(v),n=Xh(b,Rp.get({defaultMessage:"closing",id:"antom.common.closing"})),m.appendChild(n),g=!0,e.prev=7,e.next=10,null==a?void 0:a();case 10:return e.prev=10,g=!1,e.finish(10);case 13:f();case 14:case"end":return e.stop()}}),e,null,[[7,,10,13]])})))),textDirection:c});v.addEventListener("load",(function e(){m.removeChild(k),v.removeEventListener("load",e)})),m.appendChild(k)}if(p){m.style.backgroundColor=S,v.style.backgroundColor=S;v.addEventListener("load",(function e(){var t;null===(t=A.parentNode)||void 0===t||t.removeChild(A),v.removeEventListener("load",e)})),m.appendChild(A)}m.appendChild(v);var T,P=document.getElementsByTagName("body")[0];return(T=document.createElement("style")).innerHTML=Zh,document.head.appendChild(T),P.appendChild(h),P.appendChild(m),{iframe:v,destroy:f}};var em={position:"bottom-right",backgroundColor:"rgba(0, 0, 0, 0.80)",color:"#ffffff",padding:"20px 16px",borderRadius:"8px",fontSize:"14px",zIndex:9999,width:"148px",duration:2e3},tm={"top-left":{top:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"},"bottom-left":{bottom:"20px",left:"20px"},"bottom-right":{top:"0",right:"0",bottom:"0",left:"0"},center:{top:"0",right:"0",bottom:"0",left:"0"}},nm={SUCCESS:"https://cdn.marmot-cloud.com/storage/2024/07/10/10b191d6-0b0a-4bd9-96cc-310b7f2a8530.svg",FAIL:"https://cdn.marmot-cloud.com/storage/2024/11/08/4ae27343-61d2-4a07-b323-c951c7711b40.svg"},rm="antom_toast-container";function om(e){return im.apply(this,arguments)}function im(){return(im=u()(l()().mark((function e(t){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t;case 3:return n=e.sent,e.abrupt("return",{error:void 0,data:n});case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",{error:zh.unificationError(e.t0).toJSON(),data:void 0});case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function am(e,t){return sm.apply(this,arguments)}function sm(){return(sm=u()(l()().mark((function e(t,n){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",dh("com.ipay.iexpfront.channelClientId.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lm(e,t){return cm.apply(this,arguments)}function cm(){return(cm=u()(l()().mark((function e(t,n){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",dh("com.ipay.iexpcashier.cashier.createApplePayPaymentSession",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function um(e,t){return dm.apply(this,arguments)}function dm(){return(dm=u()(l()().mark((function e(t,n){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",dh("com.ipay.iexpfront.one.account.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function pm(e,t){return hm.apply(this,arguments)}function hm(){return(hm=u()(l()().mark((function e(t,n){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",dh("com.ipay.iexpcashier.sdkAction.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var mm="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",fm=null;function vm(){return fm||(fm=new Promise((function(e){if(qp)return e(!1);if(window.ApplePaySession)return e(!0);var t=function(t){clearTimeout(n),t||(fm=null),e(t)},n=setTimeout((function(){console.warn("[ApplePay] Apple Pay SDK load timed out, will retry on next call"),t(!1)}),1e4),r=document.querySelector('script[src="'.concat(mm,'"]'));if(r)return window.ApplePaySession?void t(!0):(r.addEventListener("load",(function(){return t(!0)})),void r.addEventListener("error",(function(){return t(!1)})));var o=document.createElement("script");o.src=mm,o.onload=function(){return t(!0)},o.onerror=function(){return t(!1)},document.head.appendChild(o)})),fm)}function gm(e){var t;if(!e)return null;var n,r=(null==e?void 0:e.paymentMethods)||[],o=m()(r);try{for(o.s();!(n=o.n()).done;){var i,a=n.value;if("APPLEPAY"===(null==a?void 0:a.paymentMethodType)||"APPLE_PAY"===(null==a?void 0:a.paymentMethodType))return(null==a||null===(i=a.paymentMethodDetail)||void 0===i||null===(i=i.applePayProps)||void 0===i?void 0:i.paymentRequest)||null}}catch(e){o.e(e)}finally{o.f()}return(null==e||null===(t=e.applePayProps)||void 0===t?void 0:t.paymentRequest)||null}var ym=function(){function e(t){b()(this,e),p()(this,"opts",void 0),p()(this,"session",null),p()(this,"settled",!1),p()(this,"phase","idle"),p()(this,"cancelReason",null),p()(this,"modalCloseHandler",null),p()(this,"_activePay",null),this.opts=t}var t,n;return y()(e,[{key:"startPay",value:(n=u()(l()().mark((function e(){var t=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._activePay){e.next=2;break}return e.abrupt("return",this._activePay);case 2:return this._activePay=this._startPayInternal().finally((function(){t._activePay=null})),e.abrupt("return",this._activePay);case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_startPayInternal",value:(t=u()(l()().mark((function e(){var t,n,r,o,i,a,s,c=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.settled=!1,this.phase="idle",this.cancelReason=null,(i=this.opts.paymentRequest).version&&Array.isArray(i.supportedNetworks)&&0!==i.supportedNetworks.length&&Array.isArray(i.merchantCapabilities)&&0!==i.merchantCapabilities.length&&i.countryCode&&i.currencyCode&&null!==(t=i.total)&&void 0!==t&&t.label&&null!==(n=i.total)&&void 0!==n&&n.amount){e.next=8;break}throw console.warn("[ApplePay] Required Apple Pay fields are missing"),{errorCode:"APPLE_PAY_MISSING_DATA"};case 8:return e.next=10,vm();case 10:if(a=e.sent,s=window.ApplePaySession,a&&s){e.next=16;break}throw console.warn("[ApplePay] Apple Pay SDK not available on host"),{errorCode:"APPLE_PAY_NOT_SUPPORTED"};case 16:if(null!==(r=s.canMakePayments)&&void 0!==r&&r.call(s)&&null!==(o=s.supportsVersion)&&void 0!==o&&o.call(s,i.version)){e.next=20;break}throw console.warn("[ApplePay] canMakePayments=false (version=".concat(i.version,")")),{errorCode:"APPLE_PAY_NOT_SUPPORTED"};case 20:e.prev=20,this.session=new s(i.version,this.buildSessionParams()),e.next=29;break;case 24:throw e.prev=24,e.t0=e.catch(20),console.warn("[ApplePay] ApplePaySession constructor failed:",e.t0),{errorCode:"APPLE_PAY_NOT_SUPPORTED"};case 29:return e.abrupt("return",new Promise((function(e,t){var n=function(n){c.settled||(c.settled=!0,c.clearModalCloseListener(),n?t(n):e())};c.session.onvalidatemerchant=function(){var e=u()(l()().mark((function e(t){var r,o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c.phase="validating",e.prev=1,e.next=4,c.opts.callbacks.validateMerchant(null==t?void 0:t.validationURL);case 4:if(r=e.sent){e.next=7;break}throw{errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"};case 7:c.phase="validated",c.session.completeMerchantValidation(r),e.next=21;break;case 11:if(e.prev=11,e.t0=e.catch(1),c.phase="idle",!c.settled){e.next=17;break}return c.safeAbort(),e.abrupt("return");case 17:o=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",console.warn("[ApplePay] validateMerchant failed:",e.t0),n({errorCode:o}),c.safeAbort();case 21:case"end":return e.stop()}}),e,null,[[1,11]])})));return function(t){return e.apply(this,arguments)}}(),c.session.onpaymentauthorized=function(){var e=u()(l()().mark((function e(t){var r,o,i,a,u,d,p;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c.phase="authorizing",r=(null==t?void 0:t.payment)||{},o=r.token,i=r.billingContact,a=r.shippingContact,o){e.next=7;break}return c.safeComplete(s.STATUS_FAILURE),n({errorCode:"APPLE_PAY_TOKEN_ERROR"}),e.abrupt("return");case 7:return e.prev=7,e.next=10,c.opts.callbacks.onAuthorized({token:o,billingContact:i,shippingContact:a});case 10:(u=e.sent).success?(c.safeComplete(s.STATUS_SUCCESS),n()):("MERCHANT_CONFIRM_ABORT"===u.errorCode&&(c.cancelReason="MERCHANT_ABORT"),c.safeComplete(s.STATUS_FAILURE),d=u.errorCode||"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",u.errorMessage&&console.warn("[ApplePay] onAuthorized returned failure:",u.errorMessage),n({errorCode:d})),e.next=20;break;case 14:e.prev=14,e.t0=e.catch(7),c.safeComplete(s.STATUS_FAILURE),p=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",console.warn("[ApplePay] onAuthorized threw:",e.t0),n({errorCode:p});case 20:case"end":return e.stop()}}),e,null,[[7,14]])})));return function(t){return e.apply(this,arguments)}}(),c.session.oncancel=function(){return"MERCHANT_ABORT"===c.cancelReason?(c.phase="idle",void n({errorCode:"MERCHANT_CONFIRM_ABORT"})):"validating"===c.phase?(c.phase="idle",void n({errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"})):(c.phase,c.phase="idle",void n({errorCode:"APPLE_PAY_CANCEL"}))};try{c.session.begin()}catch(e){return console.warn("[ApplePay] ApplePaySession.begin() failed:",e),void n({errorCode:"APPLE_PAY_NOT_SUPPORTED"})}c.opts.enableModalCloseListener&&c.attachModalCloseListener((function(){c.safeAbort(),n({errorCode:"APPLE_PAY_CANCEL"})}))})));case 30:case"end":return e.stop()}}),e,this,[[20,24]])}))),function(){return t.apply(this,arguments)})},{key:"buildSessionParams",value:function(){var e=this.opts.paymentRequest,t={countryCode:e.countryCode,currencyCode:e.currencyCode,merchantCapabilities:e.merchantCapabilities,supportedNetworks:e.supportedNetworks,requiredBillingContactFields:e.requiredBillingContactFields,requiredShippingContactFields:e.requiredShippingContactFields,total:e.total};return e.lineItems&&e.lineItems.length>0&&(t.lineItems=e.lineItems),e.recurringPaymentRequest&&(t.recurringPaymentRequest=e.recurringPaymentRequest),t}},{key:"safeAbort",value:function(){try{var e,t;null===(e=this.session)||void 0===e||null===(t=e.abort)||void 0===t||t.call(e)}catch(e){}}},{key:"safeComplete",value:function(e){try{var t,n;null===(t=this.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,e)}catch(e){}}},{key:"attachModalCloseListener",value:function(e){var t,n=document.querySelector("apple-pay-modal"),r=(null==n||null===(t=n.shadowRoot)||void 0===t?void 0:t.querySelector(".modal-close-button"))||null;if(r){var o=function(){e()};r.addEventListener("click",o,{once:!0}),this.modalCloseHandler={el:r,fn:o}}}},{key:"clearModalCloseListener",value:function(){this.modalCloseHandler&&(this.modalCloseHandler.el.removeEventListener("click",this.modalCloseHandler.fn),this.modalCloseHandler=null)}}]),e}();function _m(e){return bm.apply(this,arguments)}function bm(){return bm=u()(l()().mark((function e(t){var n,r,o,i,a,s,c,d,p,h,m,f,g,y,_,b,E,S,A,k,T,P,w;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.requestId,r=t.renderData,o=t.appConfig,i=t.sendReply,a=gm(r)){e.next=5;break}return i({requestId:n,success:!1,errorCode:"APPLE_PAY_MISSING_DATA"}),e.abrupt("return");case 5:return s=a.merchantCapabilities,c=a.merchantInfo,d=a.paymentAmount,p=a.supportedNetworks,h=a.version,m=a.requiredBillingContactFields,f=a.requiredShippingContactFields,g=(null==o?void 0:o.sessionData)||"",y=null==o?void 0:o.amount,_=null!=y&&y.value?y:d,b=null==_?void 0:_.value,E=null==d?void 0:d.currency,S=Em(g,c,_),P=new ym({paymentRequest:v()({countryCode:null==c?void 0:c.countryCode,currencyCode:E,merchantCapabilities:s,supportedNetworks:p,requiredBillingContactFields:m,requiredShippingContactFields:f,total:S?{type:"final",label:S.regularBilling.label,amount:b}:{type:"final",label:null==c?void 0:c.merchantName,amount:b},version:S?14:h},S?{lineItems:[S.regularBilling],recurringPaymentRequest:S}:{}),enableModalCloseListener:!1,callbacks:{validateMerchant:function(){var e=u()(l()().mark((function e(t){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,lm({validateUrl:t,paymentSessionData:g,merchantDomain:window.location.hostname});case 2:if(null==(n=e.sent)||!n.success||!n.merchantSessionObject){e.next=5;break}return e.abrupt("return","string"==typeof n.merchantSessionObject?JSON.parse(n.merchantSessionObject):n.merchantSessionObject);case 5:throw{errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"};case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),onAuthorized:function(){var e=u()(l()().mark((function e(t){var n,r,o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.token,r=t.billingContact,o=t.shippingContact,k=r,T=o,A={token:n,billingContact:r,shippingContact:o},e.abrupt("return",{success:!0,result:A});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}),e.prev=13,e.next=16,P.startPay();case 16:i({requestId:n,success:!0,result:A,billingDetails:k,shippingAddress:T}),e.next=23;break;case 19:e.prev=19,e.t0=e.catch(13),w=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED",i({requestId:n,success:!1,errorCode:w});case 23:case"end":return e.stop()}}),e,null,[[13,19]])}))),bm.apply(this,arguments)}function Em(e,t,n){if(!e)return null;try{var r,o,i,a,s,l,c=mh(e),u=null==c?void 0:c.paymentSessionFactor,d=null==u?void 0:u.recurringInfo;if(!d)return null;var p=null==u||null===(r=u.order)||void 0===r?void 0:r.orderDescription;if(!p||!d.managementURL)return null;var h=v()(v()(v()({type:"final",label:null!==(o=d.title)&&void 0!==o?o:null==t?void 0:t.merchantName,amount:null==n?void 0:n.value,paymentTiming:"recurring"},d.startDate?{recurringPaymentStartDate:new Date(1e3*d.startDate)}:{}),d.endDate?{recurringPaymentEndDate:new Date(1e3*d.endDate)}:{}),{},{recurringPaymentIntervalUnit:null!==(i=d.intervalUnit)&&void 0!==i?i:"month",recurringPaymentIntervalCount:null!==(a=d.intervalCount)&&void 0!==a?a:1});return{paymentDescription:p,billingAgreement:null!==(s=d.agreementDescription)&&void 0!==s?s:void 0,regularBilling:h,managementURL:d.managementURL,tokenNotificationURL:null!==(l=d.tokenNotificationURL)&&void 0!==l?l:void 0}}catch(e){return null}}var Sm=function(e){return e.EXPRESS_CHECKOUT="EXPRESS_CHECKOUT",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT",e}({}),Am=[{eventName:Sm.EXPRESS_CHECKOUT,supportedEvents:[]},{eventName:Sm.ELEMENT_PAYMENT,supportedEvents:["paymentMethodChanged","billingAddressChanged"]}],km=".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(we,"-hidden{\nanimation: ").concat(we,"-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** 加载动画 **/\n@-webkit-keyframes ").concat(we,"-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n"),Tm=function(e,t){if(!document.getElementById(Ee)){var n;(n=document.createElement("style")).type="text/css",n.innerHTML=km,document.head.appendChild(n),Pt();var r=document.createElement("div");r.className="".concat(Ee,"-hidden-").concat(e),r.id=Ee,Tt(0,r),document.body.appendChild(r);var o=document.createElement("div");return o.className="ams-component-section-".concat(e),o.id=Se,r.appendChild(o),r.classList.remove("".concat(Ee,"-hidden-").concat(e)),r.classList.add("".concat(Ee,"-").concat(e)),Pm(e,t),o}},Pm=function(e,t){var n=e===oe.mobile?"touchend":"click",r=document.getElementById(Ee),o="<img class='".concat(ke,"-btn-").concat(e,"' src=\"").concat(Ue,'"/>'),i=document.createElement("div");i.classList.add("".concat(ke,"-").concat(e),"".concat(ke,"-hidden")),i.id=ke,i.innerHTML=o,i.addEventListener(n,(function(){t()})),r&&r.appendChild(i)},wm=function(){var e=document.getElementById(Pe),t=document.getElementById(Ee);e&&(e.classList.remove("".concat(Pe,"-show")),e.classList.add("".concat(Pe,"-hidden")),setTimeout((function(){e.classList.remove("".concat(Pe,"-hidden")),null==t||t.classList.remove("".concat(Ee,"-opacity"))}),xe))},Im=function(){var e=document.getElementById(Pe),t=document.getElementById(Ee);e&&(null==t||t.classList.add("".concat(Ee,"-opacity")),e.classList.remove("".concat(Pe,"-hidden")),e.classList.add("".concat(Pe,"-show")))},Cm=function(){var e;null===(e=document.getElementById(Pe))||void 0===e||e.remove()},Rm=function(e){var t=(null==e?void 0:e.platform)===oe.mobile?"touchend":"click",n=document.getElementsByTagName("body")[0];n.style.overflow="hidden";var r=document.createElement("div");r.style.width="100vw",r.style.height="100vh",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.zIndex="1000",r.style.background="rgba(0,0,0,0.5)",r.style.display="none",r.id=we,r.addEventListener(t,(function(){var t;null==e||null===(t=e.onClickOutside)||void 0===t||t.call(e)})),n.appendChild(r),function(e,t){var n=e===oe.mobile?"touchend":"click",r="<div class='".concat(Te,'-btn\'>\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z" fill="#EEEEEE"/>\n</svg>\n </div>'),o=document.createElement("div");o.classList.add("".concat(Te,"-").concat(e),"".concat(Te,"-hidden")),o.id=Te,o.innerHTML=r,o.addEventListener(n,(function(){t()})),document.body.appendChild(o)}(null==e?void 0:e.platform,null==e?void 0:e.closeBtnFunc)},Nm=function(){var e=document.getElementById(we);null==e||e.classList.add("".concat(we,"-hidden"))},Om=function(){document.getElementsByTagName("body")[0].style.overflow="auto";var e=document.getElementById(we);null==e||e.remove()},Dm="\n .".concat(De,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(De,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 2147483647; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(De,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(De,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(xe,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(De,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(xe,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(De,"-drawer-enter {\n animation: slideIn ").concat(xe,"ms forwards;\n }\n\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(De,"-drawer-exit {\n animation: slideOut ").concat(xe,"ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n"),Lm=function(){var e=document.createElement("style");e.innerHTML=Dm,document.head.appendChild(e)};var Mm="desktop",xm=function(e){var t=e.device,n=e.url,r=e.loadingConfig,o=e.styleConfig,i=e.showCloseOnLoading,a=e.onCloseOnLoading,s=e.textDirection,l=void 0===s?"ltr":s;return new Promise((function(e,s){try{Mm=t;var c=document.createElement("div");c.classList.add("".concat(De,"overlay"),"".concat(De,"fadeIn")),document.body.parentElement.style.overflow="hidden";var u=document.createElement("div");"desktop"===t?(u.classList.add("".concat(De,"modal"),"".concat(De,"fadeIn")),u.style.width="656px",u.style.height="620px",u.style.borderRadius="12px"):(u.classList.add("".concat(De,"modal-mobile"),"".concat(De,"-drawer-enter")),u.style.width="100%",u.style.height="80vh",u.style.borderRadius="12px 12px 0 0"),u.setAttribute("dir",l);var d=document.createElement("iframe");if(d.src=n,d.style.border="none",d.style.width="100%",d.style.height="100%",d.style.colorScheme=Le,o&&(u.style.backgroundColor=o.backgroundColor,d.style.backgroundColor=o.backgroundColor),r&&Object.keys(r).length){r.theme;var p=r.backgroundPrimary,h=void 0===p?"#ffffff":p;u.style.backgroundColor=h,d.style.backgroundColor=h}if(i){var m=function(e){var t=e.onClose,n=e.textDirection,r=document.createElement("div");r.style.position="absolute","rtl"===n?r.style.left="16px":r.style.right="16px",r.style.top="23px",r.style.cursor="pointer";var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("viewBox","0 0 16 16"),o.setAttribute("fill","none");var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("d","M13.0449 2.99894L12.9494 2.91165L12.8685 2.85222L12.7802 2.7996C12.3611 2.57499 11.8556 2.64328 11.5228 2.9763L7.99909 6.50088L4.48854 2.99028L4.44701 2.95034C4.0098 2.57169 3.38048 2.57202 2.99838 2.9525L2.92363 3.03297L2.85175 3.12897L2.79916 3.21735C2.57471 3.63642 2.64292 4.14198 2.9757 4.47491L6.50186 8.00046L2.95226 11.5518C2.57141 11.9917 2.57173 12.6211 2.95197 13.0033L3.0324 13.078L3.12837 13.15L3.21674 13.2026C3.63573 13.4272 4.14123 13.3589 4.47407 13.0259L7.99909 9.49935L11.5474 13.0494C11.9944 13.4368 12.6238 13.4235 13.0212 13.0259L13.0922 12.9471L13.1559 12.8595C13.4298 12.4403 13.3789 11.8852 13.0211 11.5272L9.497 8.00115L13.0052 4.4915L13.07 4.4225C13.4304 4.00477 13.4199 3.37582 13.0449 2.99894Z"),i.setAttribute("fill","#ABB9CC"),o.appendChild(i),r.appendChild(o),r.onclick=t,r}({onClose:a,textDirection:l});u.appendChild(m),d.addEventListener("load",(function(){u.removeChild(m)}))}u.appendChild(d);var f=document.getElementsByTagName("body")[0];f.appendChild(c),f.appendChild(u),e(d)}catch(e){s({title:"sdk_error_create_pop_up",message:null==e?void 0:e.toString()})}}))},Um=function(){var e=document.querySelector(".".concat(De,"overlay"));if(e){document.body.parentElement.style.overflow="scroll";var t="desktop"===Mm?document.querySelector(".".concat(De,"modal")):document.querySelector(".".concat(De,"modal-mobile"));e.classList.remove("".concat(De,"fadeIn")),e.classList.add("".concat(De,"fadeOut")),"desktop"===Mm?(t.classList.remove("".concat(De,"fadeIn")),t.classList.add("".concat(De,"fadeOut"))):(t.classList.remove("".concat(De,"-drawer-enter")),t.classList.add("".concat(De,"-drawer-exit"))),setTimeout((function(){var n,r;null===(n=e.parentNode)||void 0===n||n.removeChild(e),null===(r=t.parentNode)||void 0===r||r.removeChild(t)}),xe)}},Bm=function(e){return e.CODE_VIEW="/elements/pages/code-view/index.html",e.ELEMENT_PAYMENT="/elements/pages/element_payment/index.html",e.EXPRESS_CHECKOUT="/elements/pages/express_checkout/index.html",e.IFRAME_ELEMENT="/elements/pages/iframe-element/index.html",e.INSTRUCTION_GUIDE="/elements/pages/instruction-guide/index.html",e.THREED_PAGE="/elements/pages/threed-page/index.html",e.ELEMENT_AUTH="/auth-element/pages/element_auth/index.html",e.ADDRESS="/element-address/pages/address/index.html",e.NEW_ELEMENT_PAYMENT="/elements2/pages/element_payment/index.html",e}({}),Km=y()((function e(){b()(this,e),p()(this,"type",void 0),p()(this,"platform",void 0),p()(this,"isRetention",void 0),p()(this,"selector",void 0),p()(this,"appearance",void 0),p()(this,"appendAliasContainerId",void 0),p()(this,"merchantAppointParam",void 0),p()(this,"iframeStyle",void 0),p()(this,"notRedirectAfterComplete",void 0),this.platform=St()?oe.desktop:oe.mobile,this.isRetention=!0,this.type=G.popup,this.selector=""})),Hm=function(e){return e.UNINIT="UNINIT",e.INITING="INITING",e.READY="READY",e.IN_BIZ_FLOW="IN_BIZ_FLOW",e.DESTROYED="DESTROYED",e}({});function Fm(e){var t,n,r=e.status,o=e.paymentContainerService,i=e.newPaymentSessionData,a=e.oldPaymentSessionData;if(r!==Hm.IN_BIZ_FLOW)return!1;if(!o)return!1;var s=al(a),l=ot()(s,1)[0],c=al(i),u=ot()(c,1)[0];return!(null==l||!l.connectFactor||null==u||!u.connectFactor)&&(null==l||null===(t=l.connectFactor)||void 0===t?void 0:t.enableConnect)===(null==u||null===(n=u.connectFactor)||void 0===n?void 0:n.enableConnect)}function Ym(e){var t,n,r=e.paymentSessionObj,o=e.paymentSession,i=e.instanceId,a=e.environment,s=e.appVersion,l=e.analytics,c=e.locale,u=e.pageUrl,d=e.link,h=e.renderDisplayType,m=il(r),f=(null==r||null===(t=r.paymentSessionConfig)||void 0===t?void 0:t.productSceneVersion)||"",v=(null==r||null===(n=r.paymentSessionConfig)||void 0===n?void 0:n.productScene)||"",g=(null==r?void 0:r.extendInfo)||"",y=null==r?void 0:r.clientId,_=(o||"").split("&&")[1]||"",b=p()(p()(p()(p()(p()(p()({},H.DEV,"http://page.alipay.net/page/antom-web-checkout-v2"),H.TEST,"http://page.test.alipay.net/page/antom-web-checkout-v2"),H.SIT,"http://page.test.alipay.net/page/antom-web-checkout-v2"),H.PRE,"https://pre.ac.alipay.com/page/antom-web-checkout-v2"),H.SANDBOX,"https://checkout.antom.com"),H.PROD,"https://checkout.antom.com"),E=(null==a?void 0:a.toLocaleUpperCase())||H.DEV;d||(d="".concat(b[E]).concat(u));var S=za({renderDisplayType:null!=h?h:G.inline,componentSign:m,analytics:l,productScene:v,productSceneVersion:f,environment:a,appVersion:s,extendInfo:g,locale:c,instanceId:i,hostSign:_,mid:y,elementLink:d}),A=S.path,k=S.locationSearch;return console.log("[debug] generateIframeSrc",A,k),"".concat(A,"?").concat(k)}function jm(e){return new Promise((function(t,n){var r=(bt?re.WAP:re.WEB)===re.WEB,o=(null==e?void 0:e.normalUrl)||"",i=(null==e?void 0:e.schemeUrl)||"",a=(null==e?void 0:e.applinkUrl)||"",s=(null==e?void 0:e.callAppJudgeTime)||"",l=function(){if(o)return t(),void(window.location.href=o);n(ge.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};r?l():function(){if(i||a){var e={fallback:function(){l()},successCb:function(){t()},delay:0};s&&(e.resultJudgmentTime=s);try{new tl(e).open({scheme:i,link:a})}catch(e){l()}}else l()}()}))}var Gm=function(){var e=navigator.userAgent.toLowerCase(),t=window.screen.width,n=window.screen.height,r=Math.min(t,n)/Math.max(t,n);return/ipad|tablet|(android(?!.*mobile))/i.test(e)||r>.5&&r<.75&&t>=768&&n>=1024},zm=function(){return!((e=navigator.userAgent).includes("AlipayWebViewClient")||["Android","iPhone","SymbianOS","Windows Phone","iPod","iPad"].some((function(t){return e.includes(t)})));var e},Vm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e)return t;try{return JSON.stringify(e)||t}catch(e){return console.error("JSON.stringify failed:",e),t}},Wm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return t;try{return JSON.parse(e)||t}catch(e){return console.error("JSON.parse failed:",e),t}},qm=function(){function e(t){b()(this,e),p()(this,"elementContainer",void 0),p()(this,"instanceId",void 0),p()(this,"options",void 0),p()(this,"obtainDataRes",void 0),p()(this,"elementUrl",void 0),p()(this,"eventCenter",void 0),p()(this,"eventListener",{}),this._setOptions(t)}return y()(e,[{key:"_setOptions",value:function(e){var t,n=this;this.options={},n.options.mode=(null==e?void 0:e.mode)||$.component,null!=e&&e.mode&&!((null==e?void 0:e.mode)in $)&&(console.warn(ge.INIT_PARAMETER_ERROR.MODE_ERROR.message),n.options.mode=$.component),n.options.networkMode=(null==e?void 0:e.networkMode)||ee.session,null!=e&&e.networkMode&&!((null==e?void 0:e.networkMode)in ee)&&(console.warn(ge.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),n.options.networkMode=ee.proxy),t=At()._moreEnv,null!=e&&e.environment&&!((null==e?void 0:e.environment)in te)&&"true"!==t&&(console.warn(ge.INIT_PARAMETER_ERROR.ENVIRONMENT_ERROR.message),e.environment="prod"),n.options.env={terminalType:bt?re.WAP:re.WEB,environment:(null==e?void 0:e.environment)||"prod"},n.options.env.terminalType===re.WAP&&(n.options.env.osType=yt?ne.IOS:_t?ne.ANDROID:ne.ELSE),this.options.locale=(null==e?void 0:e.locale)||"",this.options.product=null==e?void 0:e.product,this.options.preview=null==e?void 0:e.preview}},{key:"registerElementContainer",value:function(e){this.elementContainer=e}},{key:"registerEventCenter",value:function(e){this.eventCenter=e}},{key:"registerEventListener",value:function(e,t){this.eventCenter[e]=t}},{key:"setElementUrl",value:function(e){this.elementUrl=e}},{key:"getElementUrl",value:function(){return this.elementUrl}},{key:"getObtainDataRes",value:function(){return this.obtainDataRes}}]),e}(),Jm=function(e){S()(n,e);var t=k()(n);function n(){return b()(this,n),t.apply(this,arguments)}return y()(n,[{key:"onReady",value:function(e){var t,n,r,o=this.elementContainer.getPaymentContext(),i=o.paymentSessionObj,a=o.paymentSessionId,s=o.displayInfo,l=(null===(t=i.connectFactor)||void 0===t?void 0:t.enableConnect)&&(null===(n=i.paymentSessionConfig)||void 0===n?void 0:n.productScene)===W.ELEMENT_PAYMENT;this.eventCenter.dispatchToApp({event:"renderComponent",data:{params:{heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),paymentSessionData:a,queryResult:e.queryResult,envInfo:{screenHeight:screen.height,screenWidth:screen.width},configParams:v()({needEditBackBtn:l,autoSaveAsDefaultAddress:l,editingNeedShippingQuery:l,showTitle:l},e.configParams),appearance:s.appearance,sessionResult:i,prefillValue:null!=e&&e.originOneAccountQueryResult?null==e||null===(r=e.originOneAccountQueryResult)||void 0===r?void 0:r.shippings:e.prefillValue},target:"ADDRESS_ELEMENT"}})}},{key:"parameterInitAndCheck",value:function(){}},{key:"beforeMount",value:function(){}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t=e.link,n=e.instanceId;this.instanceId=n;var r=this.elementContainer.getPaymentContext()||{},o=r.paymentSession,i=r.paymentSessionObj,a=r.sdkMetaData,s=this.options;return Ym({paymentSession:o,paymentSessionObj:i,environment:s.env.environment,analytics:s.analytics,locale:s.locale,link:t,appVersion:null==a?void 0:a.webAppVersion,pageUrl:Bm.ADDRESS,instanceId:n})}},{key:"obtainData",value:function(){return this.obtainDataRes={},{}}},{key:"getValue",value:function(e){var t=this;return new Promise((function(n,r){try{t.eventCenter.dispatchToApp({event:"getValue",data:e}),t.eventCenter.listen("onAddressResult",(function(e){n(e)}))}catch(e){r(e)}}))}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=al(n),o=ot()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{paymentSessionData:n,data:t,sessionResult:i,sessionData:a}})}}]),n}(qm),Qm=Jm,Zm=function(e){S()(n,e);var t=k()(n);function n(){return b()(this,n),t.apply(this,arguments)}return y()(n,[{key:"onReady",value:function(e){this.eventCenter.dispatchToApp({event:"renderComponent",data:{params:e,target:"AUTH_ELEMENT"}})}},{key:"parameterInitAndCheck",value:function(){}},{key:"beforeMount",value:function(){}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t=e.link,n=e.instanceId;this.instanceId=n;var r=this.elementContainer.getPaymentContext()||{},o=r.paymentSession,i=r.paymentSessionObj,a=r.sdkMetaData,s=this.options;return Ym({paymentSession:o,paymentSessionObj:i,environment:s.env.environment,analytics:s.analytics,locale:s.locale,link:t,appVersion:null==a?void 0:a.webAppVersion,pageUrl:Bm.ELEMENT_AUTH,instanceId:n})}},{key:"obtainData",value:function(){return this.obtainDataRes={},{}}},{key:"getValue",value:function(){return{}}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=al(n),o=ot()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{params:{paymentSessionData:n,sessionResult:i,sessionData:a,originActionQueryResult:t.originActionQueryResult,originOneAccountQueryResult:t.originOneAccountQueryResult}}})}}]),n}(qm),Xm=Zm,$m="#".concat(Ae,"-desktop{\n position: absolute;\n top: 0;\n left: 0;\n}\n#").concat(Ae,"-mobile{\n position: absolute;\n top: 0;\n left: 0;\n}\n.").concat(Ee,"-inline{\n width: 100%;\n height: auto;\n position: relative;\n line-height: 0;\n display: flex;\n}\n#").concat(Ie,"{\n width: 100%;\n flex: 1;\n}\n.").concat(Oe,"{\n width: 100%;\n height: auto;\n object-fit: contain;\n box-sizing: border-box;\n}\n.").concat(Oe,"-mobile{\n padding: 0 0.16em;\n}\n.").concat(Oe,"-desktop{}\n"),ef=function(){var e=document.createElement("style");e.id="ams-inline-component-style",e.type="text/css",e.innerHTML=$m,document.head.appendChild(e)},tf=function(e,t,n){var r=document.createElement("div");r.id=Ie,(null==n?void 0:n.componentSign)===V.ELEMENT_PAYMENT?n.isExpressCheckout?r.innerHTML="":r.innerHTML=function(e){var t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){return e+t}),"")},n=function(e){var t=e.x,n=void 0===t?0:t,r=e.y,o=void 0===r?0:r,i=e.fill,a=void 0===i?"black":i,s=e.width,l=void 0===s?560:s,c=e.height,u=void 0===c?32:c,d=e.rx,p=void 0===d?4:d;return'<rect fill-opacity="0.04" x="'.concat(n,'" y="').concat(o,'" width="').concat(l,'" height="').concat(u,'" rx="').concat(p,'" fill="').concat(a,'"/>')},r=[n({fill:"white"}),n({y:4}),n({y:48,height:64}),n({y:128}),n({y:176}),n({y:224})];"tabs"===e&&(r=[n({fill:"white",width:358,height:305}),n({y:4,width:"50%",height:73}),n({x:"51%",y:4,height:73}),n({y:96,height:64}),n({y:178}),n({y:228}),n({y:276})]);var o={view:"tabs"===e?"0 0 358 305":"0 0 560 256",height:"tabs"===e?305:256};return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0 0 560 256",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256;return'<svg id="'.concat(Oe,"-").concat(e,'" width="100%" height="').concat(o,'" viewBox="').concat(r,'" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">\n ').concat(t(n),'\n <animate xlink:href="#').concat(Oe,"-").concat(e,'" attributeName="opacity" values="0.5; 1; 0.5" begin="0s" dur="1s" repeatCount="indefinite"></animate>\n </svg>')}(r,o.view,o.height)}(null==n?void 0:n.type):t===oe.desktop&&(r.innerHTML='<svg class="'.concat(Oe," ").concat(Oe,"-").concat(t,'" width="740" height="360" viewBox="0 0 740 360" fill="none" xmlns="">\n <rect width="740" height="360" rx="12" fill="#F6F6F6"/>\n <rect opacity="0.7" x="44" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="94" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="144" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z" fill="#E1E6ED"/>\n </g>\n </svg>')),t===oe.mobile&&(r.innerHTML='<svg class="'.concat(Oe," ").concat(Oe,"-").concat(t,'" width="358" height="186" viewBox="0 0 358 186" fill="none" xmlns="">\n <g clip-path="url(#clip0_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <g clip-path="url(#clip1_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <rect width="358" height="40" fill="white"/>\n <rect opacity="0.7" x="4" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="54" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="104" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g clip-path="url(#clip2_2543_91192)">\n <rect width="358" height="120" transform="translate(0 66)" fill="white"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z" fill="#E1E6ED"/>\n </g>\n <g clip-path="url(#clip3_2543_91192)">\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z" fill="#E1E6ED"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id="clip0_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip1_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip2_2543_91192">\n <rect width="358" height="120" fill="white" transform="translate(0 66)"/>\n </clipPath>\n <clipPath id="clip3_2543_91192">\n <rect width="358" height="92" fill="white" transform="translate(0 94)"/>\n </clipPath>\n </defs>\n </svg>\n ')),e&&e.appendChild(r);var o=document.getElementById(Ie);Tt(0,o)},nf=function(){function e(){b()(this,e),p()(this,"popupUrlQuery",void 0),p()(this,"popupApp",void 0)}var t;return y()(e,[{key:"setPopupUrlQuery",value:function(e){this.popupUrlQuery=e}},{key:"mergeUrlParams",value:function(e){var t=new URL(e),n=new URLSearchParams(this.popupUrlQuery.replace(/^(?:\?|%3F)/i,""));return t.searchParams.forEach((function(e,t){n.set(t,e)})),t.search=n.toString(),t.toString()}},{key:"popup",value:(t=u()(l()().mark((function e(t){var n,r,o,i,a,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=5;break}throw(n=new Error).name="sdk_error_create_pop_up",n.message="Popup failed, input data is undefined",n;case 5:return r=t.url,e.prev=6,this.popupUrlQuery&&(r=this.mergeUrlParams(t.url)),i=!1,e.next=11,xm({widthPadding:null==t?void 0:t.widthPadding,device:null==t?void 0:t.platform,url:r,styleConfig:{backgroundColor:null===(o=t.loadingConfig)||void 0===o?void 0:o.backgroundPrimary},loadingConfig:t.loadingConfig,showCloseOnLoading:t.showCloseOnLoading,onCloseOnLoading:t.onCloseOnLoading,textDirection:null==t?void 0:t.textDirection});case 11:this.popupApp=e.sent,a=setTimeout((function(){if(!i)throw{title:"sdk_error_create_pop_up"}}),Me),s=setTimeout((function(){if(!i)throw{title:"sdk_error_pop_up_time_out"}}),3e3),this.popupApp.onload=function(){i=!0,clearTimeout(a),clearTimeout(s)},e.next=22;break;case 17:throw e.prev=17,e.t0=e.catch(6),e.t0.name="sdk_error_create_pop_up",e.t0.url=r,e.t0;case 22:case"end":return e.stop()}}),e,this,[[6,17]])}))),function(e){return t.apply(this,arguments)})},{key:"pop",value:function(){Um()}}]),e}(),rf=function(){function e(){b()(this,e),p()(this,"instanceId",void 0),p()(this,"sdkMetaData",void 0),p()(this,"initMessageEvent",void 0),p()(this,"clearTimerIdMapping",{}),p()(this,"popupManager",void 0),p()(this,"eventCenter",void 0),p()(this,"logService",void 0),p()(this,"displayInfo",void 0),p()(this,"webApp",void 0),p()(this,"_webAppHeartBeatTimeoutFn",void 0),p()(this,"clientHeight",void 0),p()(this,"boundFocusResizeChange",void 0),p()(this,"customizedLoadingListener",void 0)}return y()(e,[{key:"destroy",value:function(){}},{key:"init",value:function(e,t,n){var r;this.instanceId=t,this.sdkMetaData=n,this.clientHeight=Math.max(window.innerHeight,(null===(r=window)||void 0===r||null===(r=r.visualViewport)||void 0===r?void 0:r.height)||0),this.eventCenter=Nf.getInstance(t).getService("EventCenter"),this.logService=Nf.getInstance(t).getService("Log"),this.popupManager=new nf,Boolean(Object.keys(e).length)&&n.productScene===W.ELEMENT_PAYMENT||this.addCapabilityToEventCenter(),this.addCapabilityToApiBusManager(),this.boundFocusResizeChange=this.focusResizeChange.bind(this)}},{key:"update",value:function(){}},{key:"load",value:function(e,t,n){var r=e.appendAliasContainerId,o=e.selector,i=e.type,a=e.platform,s=function(e){var t=document.createElement("iframe"),n=e;return t.id=n,t.style.height="0",t.style.width="100%",t.style.border="0",t.style.opacity="0",t.style.overflow="hidden",t.style.colorScheme=Le,t}("antom-sdk-web-app"+(e.appendAliasContainerId?"-".concat(o):""));Nt(null==e?void 0:e.iframeStyle)||Object.keys(null==e?void 0:e.iframeStyle).forEach((function(t){var n;s.style[t]=null==e||null===(n=e.iframeStyle)||void 0===n?void 0:n[t]})),this.webApp=s,this.displayInfo=e,s.src=t,s.allow="payment",this.eventCenter.addIFrame(s),s.src.includes("?")&&this.popupManager.setPopupUrlQuery(s.src.split("?")[1]);var l=i===G.inline?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ee;if(document.getElementById(Ne)||ef(),!document.getElementById(t)){var n=document.createElement("div");n.className="".concat(t,"-inline"),n.id=t;var r=document.querySelector("".concat(e));return r&&r.appendChild(n),n}}(o,r?"".concat(Ee,"-").concat(-1===(null==o?void 0:o.indexOf("#"))?o:o.slice(1)):""):Tm(a,n);return l.appendChild(s),l}},{key:"cleanContainer",value:function(e){var t,n=(null==e?void 0:e.type)===G.inline?e.selector:Ee,r=document.querySelector(n);r&&(r.innerHTML="");var o=document.getElementById(Ee);o&&(null==o||o.remove()),this.webApp=null,this.eventCenter.cleanIFrames(),null===(t=document.getElementById("".concat(Ee,"-").concat(null==e?void 0:e.platform,"-animation-style")))||void 0===t||t.remove()}},{key:"showLoading",value:function(e,t){if(this.customizedLoadingListener)this.customizedLoadingListener("SDK_START_OF_LOADING");else if(t.type===G.inline)tf(e,t.platform);else{var n=document.getElementById(we);n&&(n.style.display="block"),function(){var e=document.createElement("div");null==e||e.classList.add(Ie),e.id=Ie,e.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',e.style.fontSize="".concat(kt(),"px");var t=document.getElementsByTagName("body")[0];null==t||t.appendChild(e)}()}}},{key:"dismissLoading",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.customizedLoadingListener)this.customizedLoadingListener("SDK_END_OF_LOADING");else{var n=document.getElementById(we);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(Ie))||void 0===e||e.remove()}}},{key:"customizeLoading",value:function(e){this.customizedLoadingListener=e}},{key:"startHideAnim",value:function(){var e,t=document.getElementById(Ee);this.webApp&&(this.webApp.style.height=t.style.height),t&&null!==(e=this.displayInfo)&&void 0!==e&&e.platform&&(t.style.transition="",null==t||t.classList.remove("".concat(Ee,"-").concat(this.displayInfo.platform)),null==t||t.classList.remove("".concat(Ee,"-").concat(this.displayInfo.platform,"-animation")),null==t||t.classList.add("".concat(Ee,"-hidden-").concat(this.displayInfo.platform)))}},{key:"handleAccountFocus",value:function(e){var t,n,r;(null===(t=window.visualViewport)||void 0===t||t.removeEventListener("resize",this.boundFocusResizeChange),null===(n=window)||void 0===n||n.removeEventListener("resize",this.boundFocusResizeChange),e)&&(null===(r=window.visualViewport)||void 0===r||r.addEventListener("resize",this.boundFocusResizeChange),window.addEventListener("resize",this.boundFocusResizeChange))}},{key:"addCapabilityToEventCenter",value:function(){var e=this;this.eventCenter.listen(_e.dismissLoading.name,(function(){e.dismissLoading()})),this.eventCenter.listen(_e.getUserAgentFromSdk.name,(function(t,n){var r;e.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(r=n.context)||void 0===r?void 0:r.eventCallbackId,data:{userAgent:window.navigator.userAgent}})})),this.eventCenter.listen(_e.popupWindow.name,(function(t){e.handlePopupWindow(t)})),this.eventCenter.listen(_e.popWindow.name,(function(){e.popupManager.pop()})),this.eventCenter.listen(_e.sizeChanged.name,(function(t){e.handleSizeChanged(v()({},t))})),this.eventCenter.listen(_e.showCloseButton.name,(function(t){e.handleCloseButtonTheme(t.style),e.changeCloseBtnVisibility(!0)})),this.eventCenter.listen(_e.hideCloseButton.name,(function(){e.changeCloseBtnVisibility(!1)})),this.eventCenter.listen(_e.setMaskCloseButton.name,(function(t){e.handleMaskCloseBtnShow(t)})),this.eventCenter.listen(_e.appHeartBeat.name,(function(){e.handleAppHeartBeat()})),this.eventCenter.listen(_e.canIUse.name,(function(t,n){e.handleCanIUse(t,n)})),this.eventCenter.listen(_e.inputFocus.name,(function(t){"ESP_V2"===t.source&&"account"===t.type?e.handleAccountFocus(t.focus):"ESP_V2"===t.source&&"otp"===t.type&&e.focusScrollFixed(t.focus)}))}},{key:"addCapabilityToApiBusManager",value:function(){}},{key:"updateMaskCloseBtn",value:function(e){var t=document.getElementById("".concat(Te));if(t)if("desktop"===this.displayInfo.platform){var n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;t.style.top="".concat((n-e.height)/2-42,"px"),t.style.right="".concat((r-e.width)/2+18,"px")}else t.style.bottom="".concat(e.height+2,"px")}},{key:"handleSizeChanged",value:function(e){var t=this.displayInfo,n=t.appendAliasContainerId,r=t.selector,o=n?"".concat(Ee,"-").concat(-1===(null==r?void 0:r.indexOf("#"))?r:r.slice(1)):Ee;if(this.webApp&&this.displayInfo){var i=document.getElementById(o);if(i&&!((null==e?void 0:e.height)<=1)&&e.height!==parseInt(i.style.height)){if(i.style.height="".concat(e.height,"px"),this.webApp.style.opacity="1",this.displayInfo.type===G.popup){if("desktop"===this.displayInfo.platform&&(e.width&&(i.style.width="".concat(e.width,"px")),i.classList.add("".concat(o,"-").concat(this.displayInfo.platform,"-animation")),this.webApp.style.height="".concat(e.height,"px")),"mobile"===this.displayInfo.platform){i.classList.add("".concat(o,"-").concat(this.displayInfo.platform,"-animation"));var a="".concat(o,"-").concat(this.displayInfo.platform,"-animation-style"),s=document.getElementById(a);s&&(null==s||s.remove()),this.webApp.style.height=parseInt(this.webApp.style.height)>0?"100%":"".concat(e.height,"px"),function(e,t,n){var r="@keyframes ".concat(Ee,"-slide-in {\n 0% {\n height: 1px;\n }\n 100% {\n height: ").concat(t,"px;\n }\n }\n @keyframes ").concat(Ee,"-slide-out {\n 0% {\n height: ").concat(t,"px;\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n height: 1px;\n opacity: 0;\n }\n }"),o=document.createElement("style");o.id=n,o.type="text/css",o.innerHTML=r,document.getElementsByTagName("head")[0].appendChild(o),setTimeout((function(){e.style.transition="height 0.28s ease-in-out"}),500)}(i,e.height,a)}this.dismissLoading(),this.updateMaskCloseBtn(e)}var l;if(this.displayInfo.type===G.inline)null===(l=document.getElementById(Ie))||void 0===l||l.remove(),this.webApp.style.height="".concat(e.height,"px")}}}},{key:"focusResizeChange",value:function(){var e,t=(null===(e=window)||void 0===e||null===(e=e.visualViewport)||void 0===e?void 0:e.height)||window.innerHeight;t*=.9,t*=.9,this.handleSizeChanged({width:0,height:t})}},{key:"focusScrollFixed",value:function(e){var t=this.displayInfo,n=t.appendAliasContainerId,r=t.selector,o=n?"".concat(Ee,"-").concat(-1===(null==r?void 0:r.indexOf("#"))?r:r.slice(1)):Ee;if(this.webApp&&this.displayInfo){var i=document.getElementById(o);i&&(e?(i.style.setProperty("position","fixed","important"),i.style.setProperty("top","".concat(this.clientHeight-i.clientHeight,"px"),"important")):(i.style.removeProperty("position"),i.style.removeProperty("top")))}}},{key:"handleAppHeartBeat",value:function(){var e=this;try{this._webAppHeartBeatTimeoutFn||(this._webAppHeartBeatTimeoutFn=function(){e.webApp&&e.displayInfo&&e.logService.logError({title:"sdk_error_appHeartBeatTimeout"})}),window._webAppHeartBeatTimeoutId&&(clearTimeout(window._webAppHeartBeatTimeoutId),window._webAppHeartBeatTimeoutId=null),this._webAppHeartBeatTimeoutFn&&(window._webAppHeartBeatTimeoutId=setTimeout(this._webAppHeartBeatTimeoutFn,6e3)),setTimeout((function(){e.webApp&&e.displayInfo&&e.eventCenter.dispatchToApp({event:"sdkHeartBeat",data:{}})}),1e3)}catch(e){this.logService.logError({title:"sdk_error_handleAppHeartBeat"},{errorMessage:e.message})}}},{key:"changeCloseBtnVisibility",value:function(e){var t=document.getElementById(ke);e?null==t||t.classList.remove("".concat(ke,"-hidden")):!1===e&&(null==t||t.classList.add("".concat(ke,"-hidden")))}},{key:"handleMaskCloseBtnShow",value:function(e){var t=document.getElementById(Te);"show"===(null==e?void 0:e.status)?null==t||t.classList.remove("".concat(Te,"-hidden")):null==t||t.classList.add("".concat(Te,"-hidden"))}},{key:"handleCloseButtonTheme",value:function(e){if(e){var t=document.getElementById(ke),n=null==t?void 0:t.querySelector("img"),r=document.getElementById(Te);"light"===e?(null==n||n.setAttribute("src","https://cdn.marmot-cloud.com/storage/2025/05/24/50891cd3-7a4a-47c0-b550-2e2ce6187c31.svg"),null==t||t.classList.add("".concat(ke,"-light")),null==r||r.classList.add("".concat(Te,"-light"))):(null==n||n.setAttribute("src",Ue),null==t||t.classList.remove("".concat(ke,"-light")),null==r||r.classList.remove("".concat(Te,"-light")))}}},{key:"handlePopupWindow",value:function(e){var t,n=this;e.paymentElementOldModel||(Lm(),this.popupManager.popup(v()({platform:null===(t=this.displayInfo)||void 0===t?void 0:t.platform,showCloseOnLoading:e.showCloseOnLoading,onCloseOnLoading:function(){return n.handlePopWindow(e)}},e)).then((function(){n.eventCenter.addIFrame(n.popupManager.popupApp)})).catch((function(e){n.logService.logError({title:(null==e?void 0:e.title)||"sdk_error_create_pop_up"},e),n.eventCenter.emit(_e.error.name,ge.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT)})))}},{key:"handlePopWindow",value:function(e){this.popupManager.pop(),this.eventCenter.dispatchToApp({event:_e.popWindow.name,data:e})}},{key:"handleCanIUse",value:function(e,t){var n,r=null==e?void 0:e.funcName;if(r&&"string"==typeof r){var o=this.eventCenter.isExist(r);this.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(n=t.context)||void 0===n?void 0:n.eventCallbackId,data:{exist:o,success:!0}})}else{var i;this.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(i=t.context)||void 0===i?void 0:i.eventCallbackId,data:{exist:!1,success:!1}})}}},{key:"getWebApp",value:function(){return this.webApp}}]),e}(),of=function(){function e(){b()(this,e),p()(this,"instanceId",void 0),p()(this,"logs",void 0),p()(this,"config",void 0),p()(this,"debug",void 0),p()(this,"componentStartTime",void 0),p()(this,"isLoaded",void 0),p()(this,"trackId",void 0)}return y()(e,[{key:"init",value:function(e,t,n){this.logs=[],this.config=af,this.debug=![te.prod,te.sandbox].includes(null==e?void 0:e.environment),this.componentStartTime=0,this.isLoaded=!1;var r=Xt("AMSSDK_STORAGE_ID");r||$t("AMSSDK_STORAGE_ID",r=t),this.setMetaData({instanceId:t,deviceId:r,sdkVersion:n.sdkVersion,webAppVersion:n.webAppVersion,productScene:n.productScene,trackId:t,platform:St()?"PC":"WAP"}),this.initTracker(),this.setComponentStartTime(Date.now()),this.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==e?void 0:e.environment,"_").concat(null==e?void 0:e.locale)}).send()}},{key:"update",value:function(e){var t,n,r,o;this.setComponentStartTime(Date.now()),this.setMetaData({firstLogTime:this.componentStartTime,renderDisplayType:e.displayInfo.type,merchantId:e.paymentSessionObj.clientId,productScene:null===(t=e.paymentSessionObj.paymentSessionConfig)||void 0===t?void 0:t.productScene,productSceneVersion:null===(n=e.paymentSessionObj.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,paymentMethodType:null===(r=e.paymentSessionObj.paymentMethodInfoView)||void 0===r?void 0:r.paymentMethodType,paymentMethodCategoryType:null===(o=e.paymentSessionObj.paymentSessionConfig)||void 0===o?void 0:o.paymentMethodCategoryType,trackId:e.paymentSessionId})}},{key:"destroy",value:function(){}},{key:"setMetaData",value:function(e){var t,n,r=this;(this.config.mdata=Object.assign(this.config.mdata,e),null!==(t=window)&&void 0!==t&&t.iTracker)?(null===(n=window)||void 0===n||null===(n=n.iTracker)||void 0===n||n.set({mdata:this.config.mdata}),setTimeout((function(){r.reportLogs()}),80)):this.initTracker()}},{key:"getLogConfig",value:function(){return this.config}},{key:"logError",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this.log("error",e,t,n)}},{key:"logInfo",value:function(e,t){return this.log("info",e,t)}},{key:"log",value:function(e,t,n){var r=this,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=o?Ma.extractComplianceParams(t.title,null!=n?n:{},(function(e,t){r.logError(e,t,!1)})):null!=n?n:{},a=Date.now(),s=a-this.componentStartTime,l=v()({},t),c=null==t?void 0:t.title;return Ka[c]&&(l.title=Ka[c]),i.eventSource="sdk",i.eventAlias=null!=n&&n.eventAlias?null==n?void 0:n.eventAlias:c,this.logs.push({type:e,logPayload:l,extra:v()(v()({},i),{},{fsDuration:s,timeStamp:a})}),this.debug&&console.log("[web-sdk] Log",l,i),this.send(),this}},{key:"reportLogs",value:function(){var e;if(null!==(e=window)&&void 0!==e&&e.iTracker)for(var t=window.iTracker,n=t.logError,r=t.logInfo,o=t.reportRPC,i=this.logs;i.length>0;)try{var a,s=i.pop();if("error"===s.type)n(s.logPayload,v()({title:null===(a=s.logPayload)||void 0===a?void 0:a.title},null==s?void 0:s.extra));else if("info"===s.type){var l;r(s.logPayload,v()({title:null===(l=s.logPayload)||void 0===l?void 0:l.title},null==s?void 0:s.extra))}else if("rpc"===s.type){var c;o(s.logPayload,v()({title:null===(c=s.logPayload)||void 0===c?void 0:c.title},null==s?void 0:s.extra))}}catch(e){console.error("Error occurred while calling iTracker method:",e)}}},{key:"loadScript",value:function(e,t){var n=this;if("function"==typeof window.define&&window.define.amd&&"function"==typeof window.require){var r="antom_iTracker";try{var o,i;return null!==(o=(i=window.require).specified)&&void 0!==o&&o.call(i,r)||window.require.config({paths:p()({},r,e.replace(/\.js$/,""))}),void window.require([r],t,(function(r){console.error("AMD load failed, falling back to script tag",r),n.fallbackLoadScript(e,t)}))}catch(e){console.warn("require not available, using script tag",e)}}this.fallbackLoadScript(e,t)}},{key:"fallbackLoadScript",value:function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t,n.onerror=function(){console.error("unable to load Antom script: ".concat(e))},document.body?document.body.appendChild(n):document.head&&document.head.appendChild(n)}},{key:"initTracker",value:function(){var e=this;if(!this.isLoaded){this.isLoaded=!0;try{"undefined"!=typeof localStorage&&this.loadScript(this.config.scriptUrl,(function(){var t;null===(t=window)||void 0===t||t.iTracker.initiTracker(e.config),setTimeout((function(){e.reportLogs()}),80)}))}catch(e){console.error("Failed to initialize iTracker:",e)}}}},{key:"send",value:function(){var e;null!==(e=window)&&void 0!==e&&e.iTracker?this.reportLogs():this.initTracker()}},{key:"setComponentStartTime",value:function(e){this.componentStartTime=e}},{key:"getComponentStartTime",value:function(){return this.componentStartTime}}]),e}(),af={scriptUrl:"https://gw-intl.alipayobjects.com/render/p/yuyan_npm/@alipay_intl-tracker/1.6.0/dist/common.min.js",spmConfig:{},batchCount:1,appId:"antom_sdk",server:"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do",bizType:"antom_sdk",productId:"ANTOM_SDK",version:"iteration/20231021",mdata:{firstLogTime:Date.now()}},sf=function(e){return new URL(e.src).origin},lf=function(){function e(){b()(this,e),p()(this,"events",void 0),p()(this,"iframes",void 0),p()(this,"instanceId",void 0),this.events=new Map,this.iframes=[]}return y()(e,[{key:"init",value:function(e,t,n){var r;this.instanceId=t,this.handleAppMessage=this.handleAppMessage.bind(this),window.addEventListener("message",this.handleAppMessage),(r=this).listen(_e.submitForm.name,(function(e){var t=e.attributes,n=document.body,r=document.createElement("form");r.setAttribute("height","1"),r.setAttribute("width","1"),Object.keys(t.data).forEach((function(e){var n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t.data[e]),r.appendChild(n)})),r.setAttribute("action",t.action),r.setAttribute("method","post"),n.appendChild(r),setTimeout((function(){r.submit()}),0)})),r.listen(_e.beforeSubmit.name,(function(e){if(r.isExist(_e.beforeSubmit.name))r.emit(_e.beforeSubmit.name,e);else{var t=ze();r.dispatchToApp({event:_e.beforeSubmitDone.name,eventCallbackId:t,data:{result:"IGNORE"}})}})),r.listen(_e.sendBroadcast.name,(function(e){r.dispatchToApp({event:_e.receiveBroadcast.name,data:e})})),r.listen(_e.sendMuitiAppEventToSdk.name,(function(e){r.dispatchToApp({event:_e.receiveMuitiAppFromSdk.name,data:e})}))}},{key:"destroy",value:function(){var e;window.removeEventListener("message",this.handleAppMessage),this.iframes=[],(e=this).unlisten(_e.submitForm.name),e.unlisten(_e.beforeSubmit.name),e.unlisten(_e.sendBroadcast.name),e.unlisten(_e.sendMuitiAppEventToSdk.name)}},{key:"update",value:function(){}},{key:"addIFrame",value:function(e){this.iframes.push({ref:e,origin:sf(e)})}},{key:"cleanIFrames",value:function(){this.iframes=[]}},{key:"removeIFrame",value:function(e){var t=this.iframes.findIndex((function(t){return t.origin===sf(e)}));-1!==t&&this.iframes.splice(t,1)}},{key:"handleAppMessage",value:function(e){var t;if(this.iframes.some((function(t){return t.origin===e.origin}))&&(null===(t=e.data)||void 0===t||!t.source||!["react-devtools-content-script","react-devtools-backend-manager","react-devtools-bridge"].includes(e.data.source))){var n;if("object"===Xe()(e.data)&&null!==e.data)n=e.data;else{if(!pt(e.data))return void console.error(ge.NOT_JSON_FORMAT);n=JSON.parse(e.data)}this.checkEventCompliant(n)&&this._handleAppMessage(n)}}},{key:"checkEventCompliant",value:function(e){if(e.name!==ie.APP_TO_SDK)return!1;var t=this.iframes.map((function(e){var t;if(new URL(null===(t=e.ref)||void 0===t?void 0:t.src))return new URL(e.ref.src).searchParams.get("instanceId")})).filter(Boolean);return!(e.instanceId!==this.instanceId&&!t.includes(e.instanceId))}},{key:"_handleAppMessage",value:function(e){var t=e.context,n=t.event,r=t.data;this.emit(n,r,e)}},{key:"listen",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=n&&this.events.get(e)||[];r.push({func:t}),this.events.set(e,r)}},{key:"unlisten",value:function(e,t){if(t){if(this.events.has(e)){var n=this.events.get(e);n=n.filter((function(e){return e.func!==t})),this.events.set(e,n)}}else this.events.delete(e)}},{key:"emit",value:function(e,t,n){this.events.has(e)&&this.events.get(e).forEach((function(e){e.func(t,n)}))}},{key:"emitAndListen",value:function(e,t){e.eventCallbackId||(e.eventCallbackId=ze()),this.listen(e.eventCallbackId,t),this.dispatchToApp(e)}},{key:"queryParse",value:function(e){var t={},n=e;return n||(n=window.location.href),n.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o),t[n])})),t}},{key:"dispatchToApp",value:function(e){var t,n=this,r={name:ie.SDK_TO_APP,context:e,instanceId:this.instanceId};null===(t=this.iframes)||void 0===t||t.forEach((function(e){var t;if(e.ref.contentWindow){var o=(n.queryParse(e.ref.src)||{}).instanceId;e.ref.contentWindow.postMessage(JSON.stringify(v()(v()({},r),{},{instanceId:o})),null!==(t=e.origin)&&void 0!==t?t:"*")}else console.error("get app contentWindow error",e)}))}},{key:"isExist",value:function(e){return this.events.has(e)}}]),e}(),cf=function(){function e(){b()(this,e),p()(this,"sandboxFlag",void 0),p()(this,"instanceId",void 0)}return y()(e,[{key:"init",value:function(e,t,n){var r=At()._sandbox;this.sandboxFlag=r,this.instanceId=t}},{key:"request",value:function(){var e=u()(l()().mark((function e(t,n){var r,o,i,a,s,c,u,d,p,h,m,f,g,y,_,b;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getEnvInfo(n),o=[v()(v()({},t),{},{envInfo:r,extParams:v()(v()({},null==t?void 0:t.extParams),{},{refUrl:window.location.href})})],i=Date.now(),a="",e.prev=4,s=this.createRequestInstance(n),e.next=8,s({data:o});case 8:if(c=e.sent,u=c.data,d=c.headers,p=u||{},a=ua(d,"Mgw-TraceId")||ua(d,"mgw-traceid",""),p.traceId=a||"",null==(h=da(d,a))||!h.errorCode){e.next=20;break}throw m=(null==p?void 0:p.errorMessage)||(null==h?void 0:h.errorMessage),f=null==h?void 0:h.errorCode,this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-i,success:!1,code:f,errorMessage:m,traceId:a}),new Error(JSON.stringify({errorMessage:m,errorCode:f,success:!1}));case 20:return this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-i,success:!0,code:"SUCCESS",errorMessage:"",traceId:a}),e.abrupt("return",p);case 24:return e.prev=24,e.t0=e.catch(4),y=Et(null===e.t0||void 0===e.t0?void 0:e.t0.message,{success:!1,errorCode:se.SYSTEM,traceId:a,errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message}),_=null!==e.t0&&void 0!==e.t0&&null!==(g=e.t0.message)&&void 0!==g&&g.includes("timeout")?se.TIMEOUT:"",b=_||(null==y?void 0:y.errorCode),this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-i,success:!1,code:b,errorMessage:JSON.stringify((null==y?void 0:y.errorMessage)||e.t0)}),e.abrupt("return",Promise.reject({success:!1,errorCode:b,traceId:a,stack:null===e.t0||void 0===e.t0?void 0:e.t0.stack,errorMessage:null==y?void 0:y.errorMessage}));case 31:case"end":return e.stop()}}),e,this,[[4,24]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getEnvInfo",value:function(e){var t,n=v()(v()({terminalType:bt?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==e?void 0:e.envInfo),{},{locale:(null==e||null===(t=e.envInfo)||void 0===t?void 0:t.locale)||"en_US"});try{var r;n.browserInfo.browserJavaEnabled=(null===(r=navigator)||void 0===r?void 0:r.javaEnabled())||!1}catch(e){}return"WAP"===n.terminalType&&(n.osType=yt?"IOS":"ANDROID"),n}},{key:"reportRequestTimeCost",value:function(e,t){Nf.getInstance(this.instanceId).getService("Log").log("rpc",e,t)}},{key:"update",value:function(e){}},{key:"destroy",value:function(){}},{key:"createRequestInstance",value:function(e){var t,n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=e.env||"prod",a=na(e["Operation-Type"],i),s=e.baseURL||a.baseURL||ta(null==e?void 0:e.hostSign,i)||Zi[i],l=v()(p()(p()(p()(p()(p()(p()(p()({appId:a.appId||$i,workspaceId:"pre"===e.env?"pre":"default"},"x-cors-".concat($i.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",a.sofaId||ea),"Operation-Type",a["Operation-Type"]||e["Operation-Type"]||""),"Client-Time",o),"tntInstId",Xi),"sdk-version",I||""),e.headers);return"true"!==this.sandboxFlag&&"sandbox"!==i||(l["load-test"]=!0,l.sofaPenAttrs="instMock=O&loadMode=2"),"dev"!==i&&delete l["sofa-group-name"],Vi.create({baseURL:s,timeout:null!==(t=e.timeout)&&void 0!==t?t:15e3,headers:l,withCredentials:null===(n=e.withCredentials)||void 0===n||n,method:(null==e?void 0:e.method)||"POST"}).request}}]),e}(),uf=function(e){return e.SG="SG",e.US="US",e.DE="DE",e}({}),df={SG:"https://open-sea-global.alipay.com/api/open/risk_client",US:"https://open-na-global.alipay.com/api/open/risk_client",DE:"https://open-de-global.alipay.com/api/open/risk_client"},pf=p()(p()(p()(p()(p()(p()(p()(p()({},W.CASHIER_PAYMENT,"Acquirer"),W.AUTO_DEBIT,"Acquirer"),W.VAULTING,"Acquirer"),W.CARD_APPLE_PAY,"Acquirer"),"EASYPAY","EasyPay"),W.EASY_PAY,"EasyPay"),W.FLASH_BUY,"OneAccount"),W.ELEMENT_PAYMENT,"Acquirer"),hf=function(e){return pf[e]||""},mf=function(e){if(!e)return"production";var t=e.toLowerCase();return"pre"===t||"light_sandbox"===t?"pre":"dev"===t||"test"===t||"local"===t?"dev":"production"},ff=function(){function e(t){b()(this,e),p()(this,"scene",void 0),p()(this,"h5gateway",void 0),p()(this,"environment",void 0),p()(this,"apdidLoaded",!1),p()(this,"apdidLoadFailed",!1),this.scene=t.scene,this.h5gateway=t.h5gateway||df[uf.SG],this.environment=t.environment}var t,n,r;return y()(e,[{key:"ensureApdidLoaded",value:(r=u()(l()().mark((function e(){var t,n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apdidLoaded){e.next=2;break}return e.abrupt("return",!0);case 2:if(!this.apdidLoadFailed){e.next=4;break}return e.abrupt("return",!1);case 4:return t=hn.getInstance(),n=mf(this.environment),e.prev=6,e.next=9,t.load({environment:n,callbacks:{onLoad:function(e){console.log("[Security] apdid-core script loaded in ".concat(e,"ms"))},onLoadFailed:function(e){console.error("[Security] apdid-core script load failed:",e.message)},onLoadTimeout:function(){console.error("[Security] apdid-core script load timeout")}}});case 9:return this.apdidLoaded=!0,e.abrupt("return",!0);case 13:return e.prev=13,e.t0=e.catch(6),console.error("[Security] apdid-core load error, degrading:",e.t0),this.apdidLoadFailed=!0,e.abrupt("return",!1);case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return r.apply(this,arguments)})},{key:"getAPDIDModule",value:function(){return hn.getInstance().getApdidModule()}},{key:"initSecurity",value:function(e,t){var n=this;if(!this.scene)throw new Error("securityConfig parameter error");if(!Object.values(pf).includes(this.scene)||!Object.values(df).includes(this.h5gateway)){var r="scene:".concat(this.scene," or h5gateway:").concat(this.h5gateway," do not supported");throw console.error(r),new Error(r)}this.ensureApdidLoaded().then((function(r){r?n.initToken(e,t):t&&t("apdid-core script load failed")})).catch((function(){t&&t("apdid-core script load failed")}))}},{key:"initToken",value:function(e,t){try{var n=this.getAPDIDModule();null==n||n.initToken(this.scene,{host:this.h5gateway},(function(n,r,o){n?e&&e():t&&t(o)}))}catch(e){t&&t(null==e?void 0:e.toString())}}},{key:"pollingGetApdidToken",value:(n=u()(l()().mark((function e(t){var n,r,o,i=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=parseInt((null==t?void 0:t.tokenCollectTime)||"0",10),r=parseInt((null==t?void 0:t.dataPollingInterval)||"500",10),o=function(){var e=u()(l()().mark((function e(t){var o,a,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.getApdidToken();case 2:if(!(o=e.sent)){e.next=5;break}return e.abrupt("return",t(o));case 5:s=function(){var e=u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.getApdidToken();case 2:(o=e.sent)&&(clearInterval(a),t(o));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=setInterval(s,r),setTimeout((function(){clearInterval(a),t(o)}),n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",new Promise((function(e){o(e)})));case 4:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"getApdidToken",value:(t=u()(l()().mark((function e(){var t=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureApdidLoaded();case 2:if(e.sent){e.next=5;break}return e.abrupt("return","");case 5:return e.abrupt("return",new Promise((function(e){try{var n=t.getAPDIDModule();null==n||n.getApdidToken(t.scene,(function(t){e(null==t?void 0:t.token)}))}catch(t){e("")}})));case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),vf=function(){function e(){b()(this,e),p()(this,"logger",void 0),p()(this,"productScene",W.EASY_PAY),p()(this,"environment",void 0)}var t,n,r,o,i;return y()(e,[{key:"init",value:function(e,t,n){this.logger=Nf.getInstance(t).getService("Log"),this.productScene=n.productScene,this.environment=null==e?void 0:e.environment}},{key:"update",value:function(e){}},{key:"destroy",value:function(){}},{key:"getDeviceId",value:(i=u()(l()().mark((function e(){var t,n,r=this,o=arguments;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},n=o.length>1&&void 0!==o[1]&&o[1],e.abrupt("return",new Promise((function(e){setTimeout(u()(l()().mark((function o(){var i,a,s,c;return l()().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return i=Date.now(),a=(null==t?void 0:t.productScene)||r.productScene,o.next=4,r._getSecuritySDKByProductScene({product:a});case 4:if(s=o.sent,c="",!s){o.next=18;break}if(!(n&&parseInt(null==t?void 0:t.tokenCollectTime)>0)){o.next=13;break}return o.next=10,s.pollingGetApdidToken(t);case 10:o.t0=o.sent,o.next=16;break;case 13:return o.next=15,s.getApdidToken();case 15:o.t0=o.sent;case 16:c=o.t0,r.logDeviceId(c,i);case 18:e(c);case 19:case"end":return o.stop()}}),o)}))),0)})));case 3:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)})},{key:"preInitSecurity",value:(o=u()(l()().mark((function e(t){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._initSecurity(!0,t);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"initSecurity",value:(r=u()(l()().mark((function e(t){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._initSecurity(!1,t);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_initSecurity",value:(n=u()(l()().mark((function e(){var t,n,r,o,i,a,s=this,c=arguments;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]&&c[0],n=c.length>1?c[1]:void 0,r=t?"PreInit":"Init",o=this._getSceneByProduct(this.productScene),!An.isReady(o)){e.next=6;break}return e.abrupt("return",Promise.resolve());case 6:if(!An.isLoading(o)){e.next=19;break}if(!(i=An.get(o))||"loading"!==i.status){e.next=19;break}return e.prev=9,e.next=12,i.loadingPromise;case 12:this.logger.logInfo({title:"sdk_event_securitySdk".concat(r,"Success")}).send(),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(9),this.logger.logError({title:"sdk_error_securitySdkInitFailed"},{productScene:this.productScene,sign:t?"Active initialization":"SDK internal initialization"}).send();case 18:return e.abrupt("return");case 19:return this.logger.logInfo({title:"sdk_event_securitySdk".concat(r)}),a=mf(this.environment),hn.getInstance().scheduleLoad({environment:a,callbacks:{onLoad:function(e){s.logger.logInfo({title:"sdk_event_securitySdkScriptLoaded"},{eventMessage:"".concat(e)}).send()},onLoadFailed:function(e){s.logger.logError({title:"sdk_event_securitySdkLoadFailed",msg:e.message},{productScene:s.productScene}).send()},onLoadTimeout:function(){s.logger.logError({title:"sdk_event_securitySdkScriptLoadTimeout"},{productScene:s.productScene}).send()}}}),e.abrupt("return",new Promise((function(e,o){n&&setTimeout((function(){s.logger.logError({title:"sdk_error_securitySdkInitTimeout"},{productScene:s.productScene,eventMessage:t?"Active initialization":"SDK internal initialization"}).send(),o()}),n),s._newSecuritySDKByScene({product:s.productScene,region:t?uf.SG:void 0},(function(){s.logger.logInfo({title:"sdk_event_securitySdk".concat(r,"Success")},t?{productScene:s.productScene}:void 0).send(),e()}),(function(e){s.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:e||void 0},{productScene:s.productScene,sign:t?"Active initialization":"SDK internal initialization"}).send(),o()}))})));case 24:case"end":return e.stop()}}),e,this,[[9,15]])}))),function(){return n.apply(this,arguments)})},{key:"logDeviceId",value:function(e,t){var n="".concat(Date.now()-t);e?this.logger.logInfo({title:"sdk_event_securitySdkGetTokenSuccess"},{eventMessage:n}).send():this.logger.logInfo({title:"sdk_error_securitySdkGetTokenFailed"},{eventMessage:n}).send()}},{key:"_getSceneByProduct",value:function(e){return this._getSecurityConfigStorage(e).scene||hf(e)}},{key:"_getSecuritySDKByProductScene",value:(t=u()(l()().mark((function e(t){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getSceneByProduct(t.product),e.abrupt("return",An.getInstance(n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_newSecuritySDKByScene",value:function(e,t,n){var r,o=this._getSecurityConfigStorage(e.product),i=o.scene||hf(e.product),a=o.h5gateway||(r=e.region,df[r]||df[uf.SG]),s=An.get(i);if(!s||"ready"!==s.status&&"loading"!==s.status)try{var l=new ff({scene:i,h5gateway:a,environment:this.environment}),c=new Promise((function(e,r){l.initSecurity((function(){An.setReady(i,l),t&&t(),e(l)}),(function(e){An.setFailed(i,new Error(e||"Security init failed")),n&&n(e),r(new Error(e||"Security init failed"))}))}));An.setLoading(i,c)}catch(e){An.setFailed(i,new Error(null==e?void 0:e.toString())),n&&n(null==e?void 0:e.toString())}else"ready"===s.status&&t&&t()}},{key:"_getSecurityConfigStorage",value:function(e){var t="",n="",r=wt(function(e){return"AMSSDK_SECURITY_CONFIG_".concat(e)}(e));if(r){var o=Et(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}}]),e}(),gf=function(e){return e.sdk_event_busPublishMessage="sdk_event_busPublishMessage",e.sdk_event_busPublishCallback="sdk_event_busPublishCallback",e.sdk_event_busIsSubscribe="sdk_event_busIsSubscribe",e.sdk_event_busSubscribe="sdk_event_busSubscribe",e.sdk_event_busUnsubscribe="sdk_event_busUnsubscribe",e.sdk_event_busClear="sdk_event_busClear",e.sdk_event_busAddInterceptor="sdk_event_busAddInterceptor",e.sdk_error_busPublishUnsubscribeError="sdk_error_busPublishUnsubscribeError",e.sdk_error_busPublishError="sdk_error_busPublishError",e.sdk_error_busPublishNoResult="sdk_error_busPublishNoResult",e}({}),yf=function(){function e(t){b()(this,e),p()(this,"callback",void 0),this.callback=t}return y()(e,[{key:"onCallBack",value:function(e){this.callback&&this.callback(e)}}]),e}(),_f=y()((function e(){b()(this,e)})),bf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;b()(this,e),p()(this,"isDebug",!0),p()(this,"instanceId",void 0),p()(this,"logger",void 0),this.instanceId=t,this.logger=Nf.getInstance(this.instanceId).getService("Log")}return y()(e,[{key:"debugTrace",value:function(e){this.isDebug=e}},{key:"traceLog",value:function(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.isDebug&&console.log([e.TAG,t].concat(JSON.stringify(n)).join(e._logSplit)),r&&this.logger&&this.logger.logInfo({title:t},v()({eventSource:"sdk"},n)).send()}},{key:"traceError",value:function(t,n){this.isDebug&&console.error([e.TAG,t].concat(JSON.stringify(n)).join(e._logSplit)),this.logger&&this.logger.logError({title:t},v()({eventSource:"sdk"},n)).send()}},{key:"clear",value:function(){this.traceLog(gf.sdk_event_busClear),e.interceptors.length=0,e.subscribersMap.clear()}},{key:"addInterceptor",value:function(t){this.traceLog(gf.sdk_event_busAddInterceptor),e.interceptors.includes(t)||e.interceptors.push(t)}},{key:"publishForResult",value:function(e,t){var n=this,r=!0;return new Promise((function(o,i){var a;n.publish(e,(function(e){r=!1,o(e)})),setTimeout((function(){r&&(n.traceError(gf.sdk_error_busPublishNoResult,{actionName:e.getAction()}),null!==(null==t?void 0:t.fallback)?o(e.result(null==t?void 0:t.fallback)):i("publish timeout"))}),null!==(a=null==t?void 0:t.timeoutMs)&&void 0!==a?a:2e3)}))}},{key:"publish",value:function(t,n){var r=this,o=new yf((function(e){r.traceLog(gf.sdk_event_busPublishCallback,{actionName:t.getAction(),instanceId:r.instanceId}),n&&n(e)})),i=this.instanceId?e.getInstanceActionName(t.getAction(),this.instanceId):t.getAction(),a=e.subscribersMap.get(i);if(this.traceLog(gf.sdk_event_busPublishMessage,{actionName:t.getAction(),instanceId:this.instanceId}),!a&&this.instanceId&&(a=e.subscribersMap.get(t.getAction())),a){var s,l=m()(a);try{for(l.s();!(s=l.n()).done;){var c=s.value;try{c.onMessage(o,t)}catch(n){this.traceError(gf.sdk_error_busPublishError,{actionName:t.getAction(),instanceId:this.instanceId,errorMessage:n});var u,d=m()(e.interceptors);try{for(d.s();!(u=d.n()).done;){var p=u.value;null==p||p.onPublishException(t,n)}}catch(e){d.e(e)}finally{d.f()}}}}catch(e){l.e(e)}finally{l.f()}}else{var h,f=!1,v=m()(e.interceptors);try{for(v.s();!(h=v.n()).done;){var g=h.value;f=f||(null==g?void 0:g.onUnsubscribedAction(t.getAction()))}}catch(e){v.e(e)}finally{v.f()}f?this.publish(t,n):this.traceError(gf.sdk_error_busPublishUnsubscribeError,{actionName:t.getAction(),instanceId:this.instanceId})}}},{key:"subscribe",value:function(t){this.traceLog(gf.sdk_event_busSubscribe,{actionNames:t.actionNames(),instanceId:this.instanceId});var n,r=m()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.instanceId?e.getInstanceActionName(o,this.instanceId):o;e.subscribersMap.has(i)||e.subscribersMap.set(i,[]);var a=e.subscribersMap.get(i);a&&!a.includes(t)&&a.push(t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"unsubscribe",value:function(t){this.traceLog(gf.sdk_event_busUnsubscribe,{actionNames:t.actionNames(),instanceId:this.instanceId});var n,r=m()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.instanceId?e.getInstanceActionName(o,this.instanceId):o,a=e.subscribersMap.get(i);if(a){var s=a.indexOf(t);-1!==s&&a.splice(s,1),0===a.length&&e.subscribersMap.delete(i)}}}catch(e){r.e(e)}finally{r.f()}}},{key:"isSubscribed",value:function(t){var n=this.instanceId?e.getInstanceActionName(t,this.instanceId):t,r=e.subscribersMap.get(n);if(!r&&this.instanceId&&(r=e.subscribersMap.get(t)),r&&r.length>0)return this.traceLog(gf.sdk_event_busIsSubscribe,{actionName:t,instanceId:this.instanceId,processResult:!0}),!0;var o,i=!1,a=m()(e.interceptors);try{for(a.s();!(o=a.n()).done;){var s=o.value;i=i||s.onUnsubscribedAction(t)}}catch(e){a.e(e)}finally{a.f()}return i?e.subscribersMap.has(n):(this.traceLog(gf.sdk_event_busIsSubscribe,{actionName:t,instanceId:this.instanceId,processResult:!1}),!1)}}],[{key:"getInstanceActionName",value:function(e,t){return"".concat(e,"@").concat(t)}}]),e}();p()(bf,"interceptors",[]),p()(bf,"subscribersMap",new Map),p()(bf,"TAG","BusManager"),p()(bf,"_logSplit"," , ");var Ef=function(e){return e.request="request",e.getEnvInfo="getEnvInfo",e.getUserAgent="getUserAgent",e}({}),Sf=function(e){return e.getGlobalData="getGlobalData",e.setGlobalData="setGlobalData",e.clearGlobalData="clearGlobalData",e}({}),Af=function(e){return e.preInitSecurity="preInitSecurity",e.initSecurity="initSecurity",e.getSecurityDeviceId="getSecurityDeviceId",e}({}),kf=function(e){return e.reportAnalytics="reportAnalytics",e}({});Ef=function(e){return e.onDestory="httpRequest",e}(Ef||{});var Tf=function(e){S()(r,e);var t,n=k()(r);function r(e){var t;return b()(this,r),t=n.call(this),p()(et()(t),"instanceId",void 0),p()(et()(t),"logger",void 0),t.instanceId=e,t.logger=Nf.getInstance(t.instanceId).getService("Log"),t}return y()(r,[{key:"actionNames",value:function(){return Object.values(kf)}},{key:"reportAnalytics",value:(t=u()(l()().mark((function e(t,n){var r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("reportAnalytics",n),r=n.getJSONObject(),this.logger&&null!=r&&r.basic&&("error"===(null==r?void 0:r.level)?this.logger.logError(null==r?void 0:r.basic,null==r?void 0:r.extra):this.logger.logInfo(null==r?void 0:r.basic,null==r?void 0:r.extra));case 3:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===kf.reportAnalytics)this.reportAnalytics(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(_f),Pf=function(e){S()(i,e);var t,n,r,o=k()(i);function i(e){var t;return b()(this,i),t=o.call(this),p()(et()(t),"instanceId",void 0),t.instanceId=e,t}return y()(i,[{key:"actionNames",value:function(){return Object.values(Af)}},{key:"preInitSecurity",value:(r=u()(l()().mark((function e(t,n){var r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=Nf.getInstance(this.instanceId).getService("Security"),e.next=4,r.preInitSecurity();case 4:null==t||t.onCallBack(n.result(!0)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),null==t||t.onCallBack(n.result(!1));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return r.apply(this,arguments)})},{key:"initSecurity",value:(n=u()(l()().mark((function e(t,n){var r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=Nf.getInstance(this.instanceId).getService("Security"),e.next=4,r.initSecurity();case 4:null==t||t.onCallBack(n.result(!0)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),null==t||t.onCallBack(n.result(!1));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return n.apply(this,arguments)})},{key:"getSecurityDeviceId",value:(t=u()(l()().mark((function e(t,n){var r,o,i;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=Nf.getInstance(this.instanceId).getService("Security"),!r||null==r||!r.deviceIdParameter){e.next=10;break}return e.next=6,o.getDeviceId(null==r?void 0:r.deviceIdParameter,!0===(null==r?void 0:r.isPolling));case 6:i=e.sent,null==t||t.onCallBack(n.result(null!=i?i:"")),e.next=11;break;case 10:null==t||t.onCallBack(n.result(""));case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),null==t||t.onCallBack(n.result(""));case 16:case"end":return e.stop()}}),e,this,[[1,13]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Af.preInitSecurity:this.preInitSecurity(e,t);case Af.initSecurity:this.initSecurity(e,t);case Af.getSecurityDeviceId:this.getSecurityDeviceId(e,t)}}}]),i}(_f),wf=function(e){S()(n,e);var t=k()(n);function n(e){var r;return b()(this,n),r=t.call(this),p()(et()(r),"instanceId",void 0),r.instanceId=e,r}return y()(n,[{key:"actionNames",value:function(){return Object.values(Sf)}},{key:"getGlobalData",value:function(e,t){var n=t.getJSONObject();if(console.log("getGlobalData",t),n&&null!=n&&n.dataKey){var r=Nf.getInstance(this.instanceId).getService("GlobalData").getGlobalData(n.dataKey);null==e||e.onCallBack(t.result(r))}else{var o=Error("GetGlobalData Failed: Data Key is null");null==e||e.onCallBack(t.result(o))}}},{key:"setGlobalData",value:function(e,t){var n=t.getJSONObject();if(console.log("getGlobalData",t),n&&null!=n&&n.dataKey&&null!=n&&n.data){Nf.getInstance(this.instanceId).getService("GlobalData").setGlobalData(n.dataKey,n.data),null==e||e.onCallBack(t.result(!0))}else{var r=Error("SetGlobalData Failed: Data Key or Data is null");null==e||e.onCallBack(t.result(r))}}},{key:"clearGlobalData",value:function(e,t){console.log("clearGlobalData",t),Nf.getInstance(this.instanceId).getService("GlobalData").clearGlobalData(),null==e||e.onCallBack(t.result(!0))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Sf.getGlobalData:this.getGlobalData(e,t);break;case Sf.setGlobalData:this.setGlobalData(e,t);break;case Sf.clearGlobalData:this.clearGlobalData(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(_f),If=function(e){S()(r,e);var t,n=k()(r);function r(e){var t;return b()(this,r),t=n.call(this),p()(et()(t),"instanceId",void 0),t.instanceId=e,t}return y()(r,[{key:"actionNames",value:function(){return Object.values(Ef)}},{key:"request",value:function(){var e=u()(l()().mark((function e(t,n){var r,o,i,a;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=Nf.getInstance(this.instanceId).getService("Requester"),!r||null==r||!r.options){e.next=10;break}return e.next=6,o.request(r.requestData,r.options);case 6:i=e.sent,null==t||t.onCallBack(n.result(i)),e.next=12;break;case 10:a=Error("Request Failed: No Request Options"),null==t||t.onCallBack(n.result(a));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),null==t||t.onCallBack(n.result(e.t0));case 17:case"end":return e.stop()}}),e,this,[[1,14]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getEnvInfo",value:(t=u()(l()().mark((function e(t,n){var r,o,i,a;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=Nf.getInstance(this.instanceId).getService("Requester"),!r||null==r||!r.options){e.next=10;break}return e.next=6,o.getEnvInfo(r.options);case 6:i=e.sent,null==t||t.onCallBack(n.result(i)),e.next=12;break;case 10:a=Error("GetEnvInfo Failed: No Request Options"),null==t||t.onCallBack(n.result(a));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),null==t||t.onCallBack(n.result(e.t0));case 17:case"end":return e.stop()}}),e,this,[[1,14]])}))),function(e,n){return t.apply(this,arguments)})},{key:"getUserAgent",value:function(e,t){var n=window.navigator.userAgent;null==e||e.onCallBack(t.result(n))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Ef.request:this.request(e,t);break;case Ef.getEnvInfo:this.getEnvInfo(e,t);break;case Ef.getUserAgent:this.getUserAgent(e,t)}}}]),r}(_f),Cf=function(){function e(){b()(this,e),p()(this,"logger",void 0),p()(this,"instanceId",void 0),p()(this,"busManager",void 0)}return y()(e,[{key:"init",value:function(e,t){var n=this;this.instanceId=t,this.logger=Nf.getInstance(this.instanceId).getService("Log"),this.busManager=new bf(this.instanceId),this.busManager.debugTrace((null==e?void 0:e.environment)!==te.prod),this.busManager.clear(),this.busManager.addInterceptor({onPublishException:function(e,t){n.logger.logError({title:"onBusPublishException"},v()(v()({},e),{},{errorMessage:JSON.stringify(t)}))}}),this.busManager.subscribe(new Pf(this.instanceId)),this.busManager.subscribe(new Tf(this.instanceId)),this.busManager.subscribe(new wf(this.instanceId)),this.busManager.subscribe(new If(this.instanceId))}},{key:"subscribe",value:function(e){this.busManager.subscribe(e)}},{key:"unsubscribe",value:function(e){this.busManager.unsubscribe(e)}},{key:"isSubscribed",value:function(e){return this.busManager.isSubscribed(e)}},{key:"publish",value:function(e,t){this.busManager.publish(e,t)}},{key:"update",value:function(){}},{key:"destroy",value:function(){}}]),e}(),Rf=function(){function e(){b()(this,e),p()(this,"globalData",new Map)}return y()(e,[{key:"init",value:function(e,t){var n=this,r=Nf.getInstance(t).getService("EventCenter");r.listen(_e.getGlobalData.name,(function(e,t){var o,i,a,s;if(null!==(o=t.context)&&void 0!==o&&o.eventCallbackId&&null!==(i=t.context)&&void 0!==i&&null!==(i=i.data)&&void 0!==i&&i.dataKey){var l=n.globalData.get(null===(a=t.context)||void 0===a||null===(a=a.data)||void 0===a?void 0:a.dataKey);r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(s=t.context)||void 0===s?void 0:s.eventCallbackId,data:l})}})),r.listen(_e.setGlobalData.name,(function(e){null!=e&&e.dataKey&&null!=e&&e.data&&n.globalData.set(e.dataKey,e.data)}))}},{key:"destroy",value:function(){this.globalData.clear()}},{key:"update",value:function(){}},{key:"getGlobalData",value:function(e){return this.globalData.get(e)}},{key:"setGlobalData",value:function(e,t){this.globalData.set(e,t)}},{key:"clearGlobalData",value:function(){this.globalData=new Map}}]),e}(),Nf=function(){function e(t){b()(this,e),p()(this,"instanceId",void 0),p()(this,"services",{Log:new of,ApiBusManager:new Cf,Requester:new cf,Container:new rf,Security:new vf,EventCenter:new lf,GlobalData:new Rf}),p()(this,"extendServices",{}),this.instanceId=t}return y()(e,[{key:"init",value:function(e,t){this.services.Log.init(e,this.instanceId,t),this.services.ApiBusManager.init(e,this.instanceId,t),this.services.Requester.init(e,this.instanceId,t),this.services.Container.init(e,this.instanceId,t),this.services.Security.init(e,this.instanceId,t),this.services.EventCenter.init(e,this.instanceId,t),this.services.GlobalData.init(e,this.instanceId,t)}},{key:"update",value:function(e){for(var t in this.services)this.services[t].update(e);for(var n in this.extendServices)this.extendServices[n].update(e)}},{key:"getService",value:function(e){return this.extendServices[e]?this.extendServices[e]:this.services[e]}},{key:"registerService",value:function(e,t){this.extendServices[e]=t}}],[{key:"getInstance",value:function(t){return e.ProvidersMapping[t]||(e.ProvidersMapping[t]=new e(t)),e.ProvidersMapping[t]}}]),e}();p()(Nf,"ProvidersMapping",{});var Of={notSupportRetryPayForSameSession:!1,accountInfo:{accountStatus:"EFFECTIVE",email:"test10@test.com"},amountConfirmRequired:!1,autoDebitWithToken:!1,errorActions:{},extendInfo:{},links:{privacyLink:"https://render.alipay.com/p/c/180021490000000150/index.html?agreementId=GL00100002",cookieLink:"https://render.alipay.com/p/c/180021490000000147/index.html?agreementId=GL00100001"},needInstallmentAbility:!1,needOtherElements:!0,openPopPaymentRetryAbility:"Y",orderAmount:{amount:"289.86",currency:"USD",currencyLabel:"US $",formattedAmount:"289.86",formattedAmountWithCurrency:"US $289.86",value:"28986"},orderAmountView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"289.86",value:"289.86"},paymentAmount:{amount:"289.86",currency:"USD",currencyLabel:"US $",formattedAmount:"289.86",formattedAmountWithCurrency:"US $289.86",value:"28986"},paymentAmountView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"289.86",value:"289.86"},paymentMethods:[{antomPage:"paymentMetaPage",category:"CARD",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/07/15/c77c0d3d-a3d0-48ad-8a40-cb3e777a2608.svg",iconName:"Card",links:[],logoList:[{cardBrand:"VISA",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/7/2/fb4ab30f-8f49-4632-8bb1-fd64b2f21861.svg"},{cardBrand:"MASTERCARD",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/05/15/e9fc0f9a-14cb-4c32-9039-a746afa1a815.svg"},{cardBrand:"CARTEBANCAIRE",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/2/23/dc4e43c8-0de1-421b-92b2-3c85f5f5a209.svg"}],paymentElements:[{defaultValue:"",elementMandatory:!1,elementType:"DIGIT_32",extendInfo:'{"needOtherElements":true,"isTempTokenization":"true"}',paymentElementKey:"paymentMethodId",subPaymentElementView:[{defaultText:"Card number",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{14,19}$",elementType:"DIGIT_18",extendInfo:'{"completeKey":"cc-number"}',paramIllegalText:"Enter a valid 14- to 19-digit card number.",paymentElementKey:"cardNo",title:"Enter card number",validateFunction:"^\\d{14,19}$"},{defaultText:"Exp date (MM/YY)",defaultValue:"",elementMandatory:!0,elementType:"DIGIT_4",extendInfo:'{"completeKey":"cc-exp"}',isPart:"true",paramIllegalText:"Enter a valid expiry date.",paymentElementKey:"expiryYear"},{defaultText:"Exp date (MM/YY)",defaultValue:"",elementMandatory:!0,elementType:"DIGIT_4",extendInfo:'{"completeKey":"cc-exp"}',isPart:"true",paramIllegalText:"Enter a valid expiry date.",paymentElementKey:"expiryMonth"},{defaultText:"CVV",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{3,4}$",elementType:"TEXT",extendInfo:"{}",isPartEnd:"true",paramIllegalText:"Enter a valid 3- or 4-digit CVV number.",paymentElementKey:"cardCVV",validateFunction:"^\\d{3,4}$"},{defaultText:"Name on card",defaultValue:"",elementMandatory:!0,elementRegx:"^[\\w\\s]{1,128}$",elementType:"TEXT",extendInfo:'{"completeKey":"cc-name"}',paramIllegalText:"Enter cardholder name as displayed on the card.",paymentElementKey:"cardHolderName",validateFunction:"^[\\w\\s]{1,128}$"}],title:"Card information"}],paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/8c2df293-4ff8-4a1c-bd39-457c26937acb.svg",iconName:"Rabbit LINE Pay",interActionType:"REDIRECT",paymentMethodName:"Rabbit LINE Pay",paymentMethodType:"RABBIT_LINE_PAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/72aa8973-7638-4f3f-b657-7af0ae02e6cf.svg",iconName:"BPI",interActionType:"REDIRECT",paymentMethodName:"BPI",paymentMethodType:"BPI",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/5b829130-42d9-46e7-a23d-6774f7352900.svg",iconName:"Alipay",interActionType:"REDIRECT",paymentMethodName:"Alipay",paymentMethodType:"ALIPAY_CN",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/ed012d1a-06c4-4606-a493-0d81ead685b6.svg",iconName:"Akulaku PayLater",interActionType:"REDIRECT",paymentMethodName:"Akulaku PayLater PH",paymentMethodType:"AKULAKU_PAYLATER_PH",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/ed012d1a-06c4-4606-a493-0d81ead685b6.svg",iconName:"Akulaku PayLater",interActionType:"REDIRECT",paymentMethodName:"Akulaku PayLater",paymentMethodType:"AKULAKU_PAYLATER",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/fcf9ba5e-b2b4-4c33-a041-f21bcf1539e4.svg",iconName:"BillEase",interActionType:"REDIRECT",paymentMethodName:"BILLEASE",paymentMethodType:"BILLEASE",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/dfcedf07-3135-49b6-9e39-6ab89b5ba5a1.svg",iconName:"Kredivo",interActionType:"REDIRECT",paymentMethodName:"KREDIVO",paymentMethodType:"KREDIVO_ID",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/6c7baedf-cb9e-47b1-8c2e-d2477b0d3018.svg",iconName:"Toss Pay",interActionType:"REDIRECT",paymentMethodName:"Toss Pay",paymentMethodType:"TOSSPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/89c1063e-c7d3-4b60-82a0-6e4c40426612.svg",iconName:"Kakao Pay",interActionType:"REDIRECT",paymentMethodName:"KAKAOPAY",paymentMethodType:"KAKAOPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/46ac203c-21fd-4feb-80c6-fd19faf1a9b7.svg",iconName:"GCash",interActionType:"REDIRECT",paymentMethodName:"GCash",paymentMethodType:"GCASH",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/8409ec96-3153-4d31-9bcb-a6b60f6ce11f.svg",iconName:"Boost",interActionType:"REDIRECT",paymentMethodName:"Boost",paymentMethodType:"BOOST",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/dd81e7d9-d845-434e-95b8-87b726d44aa4.svg",iconName:"DOKU",interActionType:"REDIRECT",paymentMethodName:"DOKU",paymentMethodType:"DOKU",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/2ec693a8-2c42-4efe-8acd-efdeeabd3210.svg",iconName:"K PLUS",interActionType:"REDIRECT",paymentMethodName:"KPLUS",paymentMethodType:"KPLUS",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/82288753-bc33-4f4c-9c07-e54c5da5c8f8.svg",iconName:"Touch'n Go eWallet",interActionType:"REDIRECT",paymentMethodName:"TNG",paymentMethodType:"TNG",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/db94babb-71db-42c4-80be-a65de641631a.svg",iconName:"NAVER Pay",interActionType:"REDIRECT",paymentMethodName:"NAVER Pay",paymentMethodType:"NAVERPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/5b1ec246-b49f-4390-b356-3af2af5acf09.svg",iconName:"TrueMoney",interActionType:"REDIRECT",paymentMethodName:"TrueMoney Wallet",paymentMethodType:"TRUEMONEY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/97dbcec8-7bdd-464b-b49a-5d9af6d98c0b.svg",iconName:"AlipayHK",interActionType:"REDIRECT",paymentMethodName:"ALIPAY_HK",paymentMethodType:"ALIPAY_HK",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/6148dd94-9d28-43d5-9073-c99bfb8e7ace.svg",iconName:"DANA",interActionType:"REDIRECT",paymentMethodName:"DANA",paymentMethodType:"DANA",recommend:!1,webRedirectType:"PAGE_REFRESH"}],redirectUrl:"",savedPaymentMethods:[],shippingInfo:{shippingAddress:{address1:"06 Raffles Place Cecil Marina People's Park",address2:"USD",city:"",region:"SG",state:"",zipCode:"068898"},shippingFee:{amount:"1.00",currency:"USD",currencyLabel:"US $",formattedAmount:"1.00",formattedAmountWithCurrency:"US $1.00",value:"100"},shippingFeeView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"1.00",value:"1.00"},shippingName:{firstName:"swd",lastName:""},shippingPhoneNo:"+651234571"},success:!0},Df={accountInfo:{accountStatus:"EFFECTIVE",email:"test10@test.com",oneAccountId:"20241107190000000200000000000079939"},actionForm:{challengeAutoTriggered:!1,challengeRetrySupported:!0,estimatedDuration:0,resendLeftTimes:0},errorActions:{},extendInfo:{},paymentMethods:[{paymentMethodType:"CARD",iconName:"VISA",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id",paymentMethodDetail:{last4:"**** 1233"}},{paymentMethodType:"CARD",iconName:"VISA2",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id2",paymentMethodDetail:{last4:"**** 1235"}}],shippings:[{notes:"",prefer:"1",shippingAddress:{address1:"06 Raffles Place Cecil Marina People's Park",address2:"USD",city:"",region:"SG",state:"",zipCode:"068898"},shippingId:"20241109190000000600000000009947475",shippingName:{firstName:"swd",lastName:""},shippingPhoneNo:"+651234571",userId:"20241107190000000300000000010741992"}],success:!0},Lf={amountConfirmRequired:!1,autoDebitWithToken:!1,checkoutSettings:'{\n "addressAutoComplete": true,\n "publicDetail": {\n "legalBusinessName": "Lazada Group",\n "businessName": "Lazada"\n },\n "paymentSettings": {\n "displayExpressCheckout": true,\n "allowPromotion": true,\n "collectCustomerEmail": true,\n "collectCustomerPhoneNo": true,\n "collectShippingPhoneNo": true,\n "collectShippingName": true,\n "displayAntomLogo": true,\n "displayLanguage": true,\n "defaultLanguage": "en_US",\n "redirectToMerchant": true,\n "paymentRedirectUrl": "https://www.baidu.com",\n "customFields": [\n {\n "labelType": "DROPDOWN",\n "labelName": "How did you hear about us?",\n "minLength": 0,\n "maxLength": 255,\n "labelCondition": "REQUIRED",\n "options": [\n "Search engine (Google, Bing, etc.)",\n "Social media",\n "Word of Mouth"\n ],\n "picLink": "http://100.88.104.107:8081/download?bucketName=ipay-ipaycrm-attachment&key=20240409009064IMHaa2545f192c99a8481deaecd9b8ea5ad_2tiZTpB3_20240402143510.jpg&expires=2028172654&accessKeyId=FM49eWrrO8EFqUO4&signature=rnLBSUx4M1I1zPWuZLqInjP79u4%3D&signatureType=OBJECT",\n "picTitle": "picTitle",\n "picTip": "picTip"\n }\n ]\n },\n "displaySettings": {\n "iconUrl": "https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",\n "logoUrl": "https://cdn.marmot-cloud.com/storage/2022/9/26/dfd471f3-da7d-4ef1-8486-cfa4301045c6.svg",\n "useLogo": true,\n "themeType": "LIGHT",\n "backgroundColor": "#ffffff",\n "accentColor": "#ffffff",\n "font": "POPPINS",\n "shape": "ROUNDED",\n "displayLayout": "LEFT_ORDER_AND_RIGHT_PAYMENT"\n }\n }',errorActions:{},extendInfo:{},goods:[{goodsName:"Goods No.1",goodsQuantity:"1",goodsTotalAmount:{amount:"200.00",currency:"PEN",currencyLabel:"S/.",formattedAmount:"200.00",formattedAmountWithCurrency:"S/. 200.00",value:"20000"},goodsTotalAmountView:{currency:"PEN",currencyDivider:" ",currencyLabel:"S/.",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},goodsUnitAmount:{amount:"200.00",currency:"PEN",currencyLabel:"S/.",formattedAmount:"200.00",formattedAmountWithCurrency:"S/. 200.00",value:"20000"},goodsUnitAmountView:{currency:"PEN",currencyDivider:" ",currencyLabel:"S/.",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},referenceGoodsId:"amsdm_good_tony_c_20230227_095825_922"},{goodsName:"Goods No.2",goodsQuantity:"2",goodsTotalAmount:{amount:"40000",currency:"KRW",currencyLabel:"₩",formattedAmount:"40,000",formattedAmountWithCurrency:"₩ 40,000",value:"40000"},goodsTotalAmountView:{currency:"KRW",currencyDivider:" ",currencyLabel:"₩",currencySymbolPosition:"L",formattedValue:"40,000",value:"40000"},goodsUnitAmount:{amount:"20000",currency:"KRW",currencyLabel:"₩",formattedAmount:"20,000",formattedAmountWithCurrency:"₩ 20,000",value:"20000"},goodsUnitAmountView:{currency:"KRW",currencyDivider:" ",currencyLabel:"₩",currencySymbolPosition:"L",formattedValue:"20,000",value:"20000"},referenceGoodsId:"amsdm_good_tony_c_20230227_095825_922"}],links:{policyInfo:'["{\\"title\\":\\"CheckoutPaymentLegal\\",\\"content\\":[{\\"title\\":\\"CheckoutPaymentLegal\\",\\"content\\":\\"<p>hello<a href=\\\\\\"https://www.baidu.com/\\\\\\"target=\\\\\\"_blank\\\\\\">world</a></p><ol><li>123123123</li><li>123123123123</li></ol>\\"}]}"]',privacyLink:"https://render.alipay.com/p/c/180021490000000150/index.html?agreementId=GL00100002",cookieLink:"https://render.alipay.com/p/c/180021490000000147/index.html?agreementId=GL00100001"},needInstallmentAbility:!1,needOtherElements:!0,orderAmount:{amount:"200.00",currency:"BRL",currencyLabel:"R$",formattedAmount:"200,00",formattedAmountWithCurrency:"R$ 200,00",value:"20000"},orderAmountView:{currency:"BRL",currencyDivider:" ",currencyLabel:"R$",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},pageStyle:{checkoutSettings:'{"addressAutoComplete":false}'},paymentAmount:{amount:"200.00",currency:"BRL",currencyLabel:"R$",formattedAmount:"200,00",formattedAmountWithCurrency:"R$ 200,00",value:"20000"},paymentAmountView:{currency:"BRL",currencyDivider:" ",currencyLabel:"R$",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},paymentMethods:[{antomPage:"paymentMetaPage",category:"CARD",icon:"https://gw.alipay.com/icon/medium/default/ALIPAY_GENERAL_CARD.svg",iconName:"Card",links:[],logoList:[{cardBrand:"GWANGJUBANK",logoUrl:"https: //cdn.marmot-cloud.com/storage/2024/2/21/635b04a7-1086-4184-8122-98d9c2b99f0f.svg"},{cardBrand:"SHINHYEOP",logoUrl:"https: //cdn.marmot-cloud.com/storage/2024/2/23/bc083008-b6ca-4b51-8767-1aa0dce48f5a.svg"}],paymentElements:[{paymentElementKey:"paymentMethodId",elementType:"CARD",elementMandatory:!1,title:"Card Information",defaultValue:"",extendInfo:'{"needOtherElements":false,"isTempTokenization":"true"}',subPaymentElementView:[{defaultText:"Card Number",elementMandatory:!0,elementRegx:"^\\d{15,18}$",elementType:"DIGIT_18",paramIllegalText:"cardNo error",paymentElementKey:"cardNo",title:"Card Number",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-number"}'},{defaultText:"CVV",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{3,4}$",elementType:"DIGIT_4",extendInfo:'{"excludeMetaDataCodes":"null"}',paramIllegalText:"Please enter a valid 3 or 4 digit CVV number",paymentElementKey:"cardCVV"},{defaultText:"Name on Card",elementMandatory:!0,elementRegx:"",elementType:"TEXT",paramIllegalText:"Please enter a Name on Card",paymentElementKey:"cardHolderName",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-name"}'},{defaultText:"Exp Date(MM/YY)",elementMandatory:!0,elementRegx:".{5}",paramIllegalText:"Please enter a Exp Date",elementType:"TEXT",paymentElementKey:"expiryYear",title:"Please enter a Exp Date",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-exp"}'},{defaultText:"Exp Date(MM/YY)",elementMandatory:!0,elementRegx:"",elementType:"TEXT",paymentElementKey:"expiryMonth",title:"Please enter a Exp Date",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-exp"}'}]},{defaultText:"Save this payment method for future use.",elementMandatory:!1,elementType:"CHECKBOX",extendInfo:"{}",paymentElementKey:"bindPaymentMethod"},{elementMandatory:!1,elementType:"DIGIT_4",extendInfo:'[{"currency":"BRL","installmentAmount":"21,39","interestFree":"true","interestRate":"0.12%","orderAmount":"21,39","tenor":"1"}, {"currency":"BRL","installmentAmount":"10,39","interestFree":"true","interestRate":"0.12%","orderAmount":"21,39","tenor":"2"}]',paymentElementKey:"tenor",title:"Instalment plan",defaultValue:""},{defaultText:"_ _ _. _ _ _. _ _ _-_ _",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{11}$",elementType:"DIGIT_11",extendInfo:'{"customerId":"r35fPjeD0IhNOJrciVqCq10AKiD/uxk8rzaySdJM4tI=","merchantId":"188r35fPjeD0IhNOJrciVqCq10AKiD/uxk8rzaySdJM4tI=","needVerify":"true"}',paramIllegalText:"Please enter a valid 11-digit CPF number",paymentElementKey:"cpf",title:"CPF Code"},{defaultText:"Enter your email address",defaultValue:"",elementMandatory:!0,elementRegx:"^(([\\w-\\+\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,18}|[0-9]{1,3})(\\]?))$",elementType:"TEXT",extendInfo:'{"excludeMetaDataCodes":"null"}',paramIllegalText:"Email address format invalid",paymentElementKey:"payerEmail",title:"Email"}],paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",webRedirectType:"PAGE_REFRESH"}],savedPaymentMethods:[],storePolicies:'[\\"{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"CheckoutPaymentLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":[{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"CheckoutPaymentLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>123123123</li><li>123123123123</li></ol>\\\\\\\\\\"}]}\\",\\"{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":[{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal_0\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>MerchantLegal_0</li><li>MerchantLegal_0</li></ol>\\\\\\\\\\"},{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal_1\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>MerchantLegal_1</li><li>MerchantLegal_1</li></ol>\\\\\\\\\\"}]}\\"]',success:!0,redirectUrl:"",supportedLanguages:[{locale:"en_US",preferred:!0,title:"English"},{locale:"it_IT",preferred:!1,title:"Português"},{locale:"de_DE",preferred:!1},{locale:"fr_FR",preferred:!1},{locale:"nl_NL",preferred:!1},{locale:"es_ES",preferred:!1},{locale:"zh_CN",preferred:!1},{country:"KR",locale:"ko_KR",preferred:!1,title:"한국어"}]},Mf={accountInfo:{email:"xxxxx@163.com",accountStatus:"EFFECTIVE",oneAccountId:"xxxxxxkk"},goods:{goodsName:"xxxxxxx",goodsImageUrl:"",goodsQuantity:100,goodsUnitAmount:{currency:"EUR",value:100,currencyLabel:""}},paymentMethods:[{paymentMethodType:"CARD",iconName:"VISA",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id",paymentMethodDetail:{last4:"**** 1233"}},{paymentMethodType:"CARD",iconName:"VISA2",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id2",paymentMethodDetail:{last4:"**** 1235"}}],links:{privacyLink:"https://global.alipay.com/docs/ac/Platform/bahzqeb-",cookieLink:"https://global.alipay.com/docs/ac/Platform/x1rhufzj"},shippings:[{shippingName:{firstName:"111111",lastName:"11111"},prefer:"1",shippingId:"xxxx1",shippingPhoneNo:"xxxxxx123",shippingAddress:{region:"ID",state:"Nusa",city:"Nusa Tenggara Bar.",address1:"Kec. Mataram, Kota Mataram",address2:"Jl. Bangil V No.6, Pagesangan Tim",zipCode:"123445"}}],metaData:{countryList:[{countryName:"China",default:!0},{countryName:"Singapore",default:!1}]},errorActions:{},extendInfo:{},merchantId:"111xT8bLnciQgqcy20+oOJoWUEbPMTwI0YILNBIicpASIs=",needInstallmentAbility:!1,needOtherElements:!1,orderDescription:"AMSDM_GIFT",success:!0,supportedLanguages:[{locale:"en_US",preferred:!0,title:"English"},{country:"BR",locale:"pt_BR",preferred:!1,title:"Português"},{country:"KR",locale:"ko_KR",preferred:!1,title:"한국어"},{country:"MX,CL,PE",locale:"es_ES",preferred:!1,title:"Español"}]};function xf(e){"GOOGLEPAY"===e.paymentMethodType&&(e.paymentMethodDetail=v()(v()({},e.paymentMethodDetail),{},{googlePayProps:{environment:"TEST",existingPaymentMethodRequired:!0,paymentRequest:{allowedPaymentMethods:[{parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:["VISA","JCB"]},tokenizationSpecification:{parameters:{protocolVersion:"ECv2",publicKey:"BDM6GVTLZmxSmTQzm04QKI2av54kFpkqjhbkejtdDUx+VMvUtJ6vc+ZlDp8TygNTf+QeihxpD869sCVWaa0KMJc="},type:"DIRECT"},type:"CARD"}],apiVersion:2,apiVersionMinor:0,callbackIntents:["PAYMENT_AUTHORIZATION"],merchantInfo:{merchantId:"123",merchantName:"merchantName"},shippingAddressRequired:!0,transactionInfo:{countryCode:"US",currencyCode:"EUR",totalPrice:"10",totalPriceStatus:"FINAL"}}}}))}function Uf(e,t){if(!e)return!1;if(!t)return!0;try{var n=JSON.parse(t),r=null==n?void 0:n.onlyIntegrateCardElementConnectMerchantFlag;return"true"!==String(r)}catch(e){return!0}}var Bf,Kf=new Ha(Fa,!0),Hf=function(e){try{var t;return!!JSON.parse(null===(t=JSON.parse(e))||void 0===t?void 0:t.expressCheckout)}catch(e){return!1}},Ff=function(e){S()(o,e);var t,n,r=k()(o);function o(){var e;b()(this,o);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e=r.call.apply(r,[this].concat(n)),p()(et()(e),"ApplePayService",void 0),p()(et()(e),"_onBeforeConfirm",null),p()(et()(e),"_merchantAmount",null),p()(et()(e),"_merchantCurrency",null),e}return y()(o,[{key:"setOnBeforeConfirm",value:function(e){this._onBeforeConfirm=e,this.ApplePayService&&this.ApplePayService.setOnBeforeConfirm(e)}},{key:"setMerchantAmountOverride",value:function(e,t){this._merchantAmount=e,this._merchantCurrency=t}},{key:"onReady",value:function(e){var t,n,r,o,i,a,s,l=this.elementContainer.getPaymentContext();if(this.getLogger().logInfo({title:"sdk_event_renderComponent"}),"mobile"===(null===(t=this.options)||void 0===t?void 0:t.preview)){var c,u,d,p,h=(null==e||null===(c=e.originActionQueryResult)||void 0===c?void 0:c.paymentMethods)||[],m=(null==e||null===(u=e.originActionQueryResult)||void 0===u?void 0:u.savedPaymentMethods)||[];if(!(1!==h.length||0!==m.length||null!==(d=h[0])&&void 0!==d&&null!==(d=d.paymentElements)&&void 0!==d&&d.length||["APPLEPAY","GOOGLEPAY"].includes(null===(p=h[0])||void 0===p?void 0:p.paymentMethodType)))return}var f,v=null==l||null===(n=l.displayInfo)||void 0===n?void 0:n.appearance;if("string"==typeof(null==v?void 0:v.theme)&&v.theme.startsWith("APR_")){var g,y,_=null==e||null===(g=e.originActionQueryResult)||void 0===g||null===(g=g.pageStyle)||void 0===g?void 0:g.elementSettings;f="string"==typeof _?null===(y=Wm(_))||void 0===y?void 0:y.appearance:null==_?void 0:_.appearance}else f=v;this.eventCenter.dispatchToApp({event:"renderComponent",data:{heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),paymentSessionData:null==l?void 0:l.paymentSession,queryResult:null==e?void 0:e.originActionQueryResult,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:{paymentMethodCategoryType:null===(r=this.elementContainer)||void 0===r?void 0:r.getPaymentContext().paymentSessionObj.paymentSessionConfig.paymentMethodCategoryType,productSceneVersion:null===(o=this.elementContainer)||void 0===o?void 0:o.getPaymentContext().paymentSessionObj.paymentSessionConfig.productSceneVersion,trackId:null===(i=this.elementContainer)||void 0===i?void 0:i.getPaymentContext().paymentSessionId,merchantId:null===(a=this.elementContainer)||void 0===a||null===(a=a.getPaymentContext())||void 0===a||null===(a=a.paymentSessionObj)||void 0===a?void 0:a.clientId,paymentMethodType:null===(s=this.elementContainer)||void 0===s||null===(s=s.getPaymentContext())||void 0===s||null===(s=s.paymentSessionObj)||void 0===s||null===(s=s.paymentMethodInfoView)||void 0===s?void 0:s.paymentMethodType},appearance:f,sessionResult:null==l?void 0:l.paymentSessionObj,notRedirectAfterComplete:!0===(null==e?void 0:e.notRedirectAfterComplete),merchantAppointParam:null==e?void 0:e.merchantAppointParam,originOneAccountQueryResult:null==e?void 0:e.originOneAccountQueryResult,doMain:window.location.hostname}})}},{key:"getLogger",value:function(){return Nf.getInstance(this.instanceId).getService("Log")}},{key:"addEventListener",value:function(){var e=this;this.eventCenter.listen(_e.onPollingEnd.name,(function(t){e.eventCenter.dispatchToApp({event:"onPollingEnd",data:t})})),this.eventCenter.listen(_e.closePaymentPolling.name,(function(t){e.eventCenter.dispatchToApp({event:_e.closePaymentPolling.name,data:t})})),this.eventCenter.listen(_e.getGooglePayToken.name,(function(t,n){ns(n).then((function(t){e.eventCenter.dispatchToApp({event:"getGooglePayToken",data:v()({},t)})})).catch((function(t){e.eventCenter.dispatchToApp({event:"getGooglePayToken",data:{err:t}})}))})),this.eventCenter.listen(_e.getApplePayToken.name,(function(t){var n,r=e.elementContainer.getPaymentContext(),o=r.paymentSessionObj,i=r.paymentSession,a=(null==t?void 0:t.shipping)||(null===(n=e.obtainDataRes)||void 0===n||null===(n=n.originActionQueryResult)||void 0===n?void 0:n.shippingInfo),s=new rs({paymentSessionData:i,parseData:o,logger:Kf,env:e.options.env.environment,shipping:a,merchantAmount:e._merchantAmount,merchantCurrency:e._merchantCurrency});s.setOnBeforeConfirm(e._onBeforeConfirm),s.startPay().then((function(t){e.eventCenter.dispatchToApp({event:"getApplePayToken",data:{success:!0,result:t}})})).catch((function(t){e.eventCenter.dispatchToApp({event:"getApplePayToken",data:{success:!1,result:t}})}))})),this.eventCenter.listen(_e.beforeConfirm.name,u()(l()().mark((function t(){var n,r,o,i,a,s,c;return l()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n="APPLEPAY",e._onBeforeConfirm){t.next=5;break}return Kf.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:n,path:"applePay_eventBridge"}),e.eventCenter.dispatchToApp({event:_e.beforeConfirm.name,data:{success:!0,result:!0}}),t.abrupt("return");case 5:return Kf.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:n,path:"applePay_eventBridge"}),t.prev=6,r=Date.now(),t.next=10,Za((function(){return e._onBeforeConfirm()}));case 10:o=t.sent,i=o.result,a=o.timedOut,s=i,(c=a||Date.now()-r>=Wa)&&(Kf.logError({title:"sdk_before_confirm_timeout"}),s=!1),Kf.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:s}),e.eventCenter.dispatchToApp({event:_e.beforeConfirm.name,data:v()({success:!0,result:!!s},c?{isTimeout:!0}:{})}),t.next=24;break;case 20:t.prev=20,t.t0=t.catch(6),Kf.logError({title:"sdk_before_confirm_error"},{paymentMethodType:n,errorMessage:String((null===t.t0||void 0===t.t0?void 0:t.t0.message)||t.t0).slice(0,200),path:"applePay_eventBridge"}),e.eventCenter.dispatchToApp({event:_e.beforeConfirm.name,data:{success:!1,result:!1}});case 24:case"end":return t.stop()}}),t,null,[[6,20]])}))))}},{key:"initApplePaySdk",value:(n=u()(l()().mark((function e(){var t,n,r,o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null===(t=this.elementContainer)||void 0===t?void 0:t.getPaymentContext())||{},r=n.paymentSessionObj,o=n.paymentSession,a=void 0,!(null==(i=r)?void 0:i.skipRenderPaymentMethod)||"APPLEPAY"!==(null==i||null===(a=i.paymentSessionFactor)||void 0===a||null===(a=a.paymentMethodInfo)||void 0===a?void 0:a.paymentMethodType)){e.next=13;break}return this.ApplePayService=new rs({paymentSessionData:o,parseData:r,logger:Kf,env:this.options.env.environment}),e.prev=3,Kf.logInfo({title:"a3753.b107385.c398110"}),e.next=7,this.ApplePayService.initApplePaySession();case 7:Kf.logInfo({title:"a3753.b107385.c398112"}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),Kf.logError({title:"a3753.b107385.c398111"});case 13:case"end":return e.stop()}var i,a}),e,this,[[3,10]])}))),function(){return n.apply(this,arguments)})},{key:"beforeMount",value:function(){this.initApplePaySdk(),this.addEventListener()}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t,n=e.link,r=e.instanceId;this.instanceId=r;var o=this.elementContainer.getPaymentContext()||{},i=o.paymentSession,a=o.paymentSessionObj,s=o.sdkMetaData,l=this.options,c=l.env.environment,u=l.analytics,d=l.locale,p=(a||{}).extendInfo,h="mobile"===(null===(t=this.options)||void 0===t?void 0:t.preview)?G.popup:G.inline,m=Ym({paymentSession:i,paymentSessionObj:a,environment:c,analytics:u,locale:d,link:n,appVersion:null==s?void 0:s.webAppVersion,pageUrl:Hf(p)?Bm.EXPRESS_CHECKOUT:Bm.ELEMENT_PAYMENT,instanceId:r,renderDisplayType:h});return this.setElementUrl(m),m}},{key:"obtainData",value:(t=u()(l()().mark((function e(){var t,n,r,o,i,a,s,c,u,d,p,h,m,f,v,g,y,_,b,E,S,A,k,T,P,w,I,C,R=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Nf.getInstance(this.instanceId).getService("Requester"),o=this.elementContainer.getPaymentContext(),i=o.paymentSession,a=o.paymentSessionObj,s=o.displayInfo,c=s.debugProps,u=this.options,d=u.env.environment,p=u.locale,h=(a||{}).paymentSessionConfig,m=i.split("&&")[1]||"",f=null==a||null===(t=a.connectFactor)||void 0===t?void 0:t.enableConnect,v=Uf(f,null==a?void 0:a.extendInfo),g=(null==c?void 0:c.isDebug)&&(null==c?void 0:c.local_mock),y=null===(n=this.options)||void 0===n?void 0:n.preview,_=!0===y||"web"===y||"mobile"===y,b=g||_,E=At(this.getElementUrl()),S=E.appType,A=Gm()?"WEB":S?"APP":zm()?"WEB":"WAP",k=function(){return new Promise((function(e,t){var n;if(b)setTimeout((function(){if(_){var t=R.buildPreviewMockData(Of);e(t)}else e(Of)}),100);else{R.getLogger().logInfo({title:"sdk_action_query_start"},{config:Vm(h)});var o={paymentSessionConfig:h,paymentSessionData:i,extParams:{isUserPreferredLocale:!0}},a=null==s?void 0:s.appearance;"string"==typeof(null==a?void 0:a.theme)&&a.theme.startsWith("APR_")&&(o.appearanceId=a.theme),null!=s&&null!==(n=s.merchantAppointParam)&&void 0!==n&&n.storedCard&&(o.merchantAppointParam=s.merchantAppointParam),Object.prototype.hasOwnProperty.call(s,"notRedirectAfterComplete")&&(o.notRedirectAfterComplete=s.notRedirectAfterComplete),r.request(o,{env:d,envInfo:{locale:p,terminalType:A},hostSign:m,timeout:3e5,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query",headers:{"Content-Type":"application/json"}}).then((function(t){t.success?R.getLogger().logInfo({title:"sdk_event_sdkQueryEnd"},{config:Vm(h),rpcTraceId:null==t?void 0:t.traceId}):R.getLogger().logError({title:"sdk_event_sdkQuery_failed"},{config:Vm(h),errorMessage:Vm((null==t?void 0:t.errorMessage)||""),rpcTraceId:null==t?void 0:t.traceId}),e(t)}),(function(e){t(e),R.getLogger().logError({title:"sdk_event_sdkQuery_failed"},{config:Vm(h),errorMessage:Vm(e)})}))}}))},T=function(){return new Promise((function(e,t){b?setTimeout((function(){e(Df)}),100):r.request({paymentSessionConfig:h,paymentSessionData:i,accountInfo:{email:""}},{env:d,envInfo:{locale:p,terminalType:A},timeout:3e5,"Operation-Type":"com.ipay.iexpfront.one.account.query",headers:{"Content-Type":"application/json"}}).then((function(t){e(t)}),(function(e){t(e)}))}))},e.next=19,Promise.all(v?[k(),T()]:[k()]);case 19:return P=e.sent,w=ot()(P,2),I=w[0],C=w[1],this.obtainDataRes={originActionQueryResult:I,originOneAccountQueryResult:C},e.abrupt("return",{originActionQueryResult:I,originOneAccountQueryResult:C});case 25:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"buildPreviewMockData",value:function(e){var t=this.elementContainer.getPaymentContext().displayInfo,n=null==t?void 0:t.previewPaymentMethods,r=JSON.parse(JSON.stringify(e)),o=function(e){if(!e)return[];var t=e.expressCheckout,n=e.supportedMethods,r=e.topping,o=((null==t?void 0:t.methods)||[]).map((function(e){var t={paymentMethodName:e.paymentMethodName,paymentMethodType:e.paymentMethodType,category:e.paymentMethodType,expressCheckout:!0};return xf(t),t})),i=[];(n||[]).forEach((function(e){if("CARD"!==e.paymentMethodName){var t={paymentMethodName:e.paymentMethodName,paymentMethodType:e.paymentMethodType,category:e.paymentMethodType,icon:e.logoUrl,recommend:!1};t.paymentMethodType===r&&(t.recommend=!0),xf(t),function(e){"ONLINEBANKING_YAPILY"===e.paymentMethodType&&(e.paymentElements=[])}(t),i.push(t)}}));var a=function(){var e=-1,t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(n,r){"CARD"===n.paymentMethodName&&(t.push({cardBrand:n.paymentMethodType,logoUrl:n.logoUrl||""}),-1===e&&(e=r))})),t.length?{firstCardIndex:e,cardPaymentMethod:{antomPage:"paymentMetaPage",category:"CARD",expressCheckout:!1,logoList:t,paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",recommend:!1,webRedirectType:"PAGE_REFRESH"}}:null}(n);return a&&i.splice(a.firstCardIndex,0,a.cardPaymentMethod),[].concat(nt()(o),i)}(n);return r.paymentMethods=o,r}},{key:"getValue",value:function(){return{}}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=al(n),o=ot()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{paymentSessionData:n,data:t,sessionResult:i,sessionData:a}})}}]),o}(qm),Yf=Ff;function jf(){try{var e=Xt("AntomDefaultGrayScaleId","");if(e)return parseInt(e);var t=ze(),n=t.substring(t.length-3,t.length-1),r=parseInt(n,16),o=Math.floor(100*r/255);return $t("AntomDefaultGrayScaleId",""+o),o}catch(e){return console.error("Get gray scale ID failed",e),0}}function Gf(e){return Gf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gf(e)}function zf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zf(Object(n),!0).forEach((function(t){Wf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wf(e,t,n){return(t=Jf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Jf(r.key),r)}}function Jf(e){var t=function(e,t){if("object"!==Gf(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Gf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Gf(t)?t:String(t)}!function(e){e.SCHEME="Scheme",e.LINK="Link",e.INTENT="Intent"}(Bf||(Bf={}));var Qf=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=void 0,this.timer=void 0,this.options=void 0,this.evokeAppBy=void 0;this.config=Vf(Vf({},{delay:0}),t),this.options={},this.timer=null,this.evokeAppBy={url:"",type:Bf.LINK},this.init()}var t,n,r;return t=e,(n=[{key:"init",value:function(){Us(),Vs({evokeAppBy:this.evokeAppBy,successCb:this.config.successCb,timeout:this.config.resultJudgmentTime})}},{key:"open",value:function(e){this.options=e;var t=this.options,n=t.scheme,r=t.intent,o=t.link,i=t.params,a=t.fallback;n||o||r?o&&qs(o)?(this.options.link=Ks(o,i),this.handleLink()):n&&!qs(n)?(this.options.scheme=Ks(n,i),this.handleScheme()):r&&r.scheme&&r.package?this.handleIntent():a?a():console.error("唤端失败"):console.error("请至少填一个链接")}},{key:"handleLink",value:function(){this.evokeAppBy.type=Bf.LINK;var e=this.options,t=e.link,n=e.scheme,r=e.delay,o=e.fallback;Ns?Cs()>9?this.evokeByLocationDelay(t,r,o,this.handleScheme):n?this.handleScheme():o?o():console.error("唤端失败"):this.evokeByLocationDelay(t,r,o,this.handleScheme)}},{key:"handleIntent",value:function(){this.evokeAppBy.type=Bf.INTENT;var e=this.options,t=e.intent,n=e.delay,r=e.fallback;t&&t.scheme&&t.package&&this.evokeByLocationDelay(Hs(t.scheme,t.package,t.fallbackUrl),n,r)}},{key:"handleScheme",value:function(){this.evokeAppBy.type=Bf.SCHEME;var e=this.options,t=e.scheme,n=e.delay,r=e.fallback;t&&(Ns?this.handleIOSScheme():Os||Ls?this.handleOriginalChrome():this.evokeByIFrameDelay(t,n,r))}},{key:"handleIOSScheme",value:function(){var e=this.options,t=e.scheme,n=e.delay,r=e.fallback;Cs()<9?this.evokeByIFrameDelay(t,n,r):this.evokeByTagADelay(t,n,r)}},{key:"handleOriginalChrome",value:function(){var e=this,t=this.options,n=t.scheme,r=t.intent,o=t.delay,i=t.fallback;this.evokeByLocationDelay(n,o,i,(function(){r&&r.package&&e.evokeByLocationDelay(Hs(n,r.package,r.fallbackUrl),o,i,e.handleIntent.bind(e))}))}},{key:"evokeAppDelay",value:function(e,t,n,r,o){var i=this,a=n||this.config.delay,s=r||this.config.fallback;this.timer=setTimeout((function(){i.clearTimer(),e(),i.checkIsOpen(t,s,o)}),a)}},{key:"evokeByLocationDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return Ms(e)}),e,t,n,r)}},{key:"evokeByTagADelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return xs(e)}),e,t,n,r)}},{key:"evokeByIFrameDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return Bs(e)}),e,t,n,r)}},{key:"checkIsOpen",value:function(e,t,n){return this.evokeAppBy.url=e,zs(n||t,this.config.resultJudgmentTime)}},{key:"clearTimer",value:function(){this.timer&&clearTimeout(this.timer)}}])&&qf(t.prototype,n),r&&qf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Zf=Qf,Xf=function(e,t){var n=Nf.getInstance(t);n.getService("Log").logInfo({title:"sdk_event_call_url_start"},v()({},e)).send();try{if(e.isCallApp&&e.schemeUrl){var r=e.callAppDetectSuccessDelay;return void new Zf({successCb:function(){$f(e,ue.SchemeUrl,e.schemeUrl,n)},resultJudgmentTime:r}).open({scheme:e.schemeUrl,fallback:function(){ev(e,ue.SchemeUrl,e.schemeUrl,n)}})}if(e.browserLinkTarget===ae.BLANK)return e.url?($f(e,ue.NormalUrl,e.url,n),void window.open(e.url)):ev(e,ue.NormalUrl,"",n);if(!(e.browserLinkTarget!==ae.REPLACE||null!=e&&e.applinkUrl||null!=e&&e.schemeUrl))return e.url?($f(e,ue.NormalUrl,e.url,n),void window.location.replace(e.url)):ev(e,ue.NormalUrl,"",n);if(St())return e.url?($f(e,ue.NormalUrl,e.url,n),void(window.location.href=e.url)):ev(e,ue.NormalUrl,"",n);if(!e.schemeUrl&&!e.applinkUrl)return e.url?($f(e,ue.NormalUrl,e.url,n),void(window.location.href=e.url)):ev(e,ue.NormalUrl,"",n);var o=new Zf({successCb:function(t){var r="Scheme"==t.type?ue.SchemeUrl:ue.ApplinkUrl;$f(e,r,t.url,n)}}),i=function(){try{o.open({scheme:e.schemeUrl,fallback:function(){if(ev(e,ue.SchemeUrl,e.schemeUrl,n),!e.url)return ev(e,ue.NormalUrl,"",n);$f(e,ue.NormalUrl,e.url,n),window.location.href=e.url}})}catch(t){if(ev(e,ue.SchemeUrl,e.schemeUrl,n),!e.url)return ev(e,ue.NormalUrl,"",n);$f(e,ue.NormalUrl,e.url,n),window.location.href=e.url}};e.applinkUrl?function(){try{o.open({link:e.applinkUrl,fallback:function(){ev(e,ue.ApplinkUrl,e.applinkUrl,n),i()}})}catch(t){ev(e,ue.ApplinkUrl,e.applinkUrl,n),i()}}():e.schemeUrl&&i()}catch(t){n.getService("Log").logInfo({title:"sdk_event_call_url_failed"},{redirectInfo:JSON.stringify(e),errorMessage:JSON.stringify(t)}).send()}},$f=function(e,t,n,r){r.getService("EventCenter").emit(_e.eventCallback.name,{code:ce.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(t,": ").concat(n)}),r.getService("Log").logInfo({title:"sdk_event_call_url_success"},{redirectInfo:JSON.stringify(e),openType:t,url:n}).send()},ev=function(e,t,n,r){r.getService("EventCenter").emit(_e.eventCallback.name,{code:ce.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==e?void 0:e.applinkUrl," schemeUrl: ").concat(null==e?void 0:e.schemeUrl," normalUrl: ").concat(null==e?void 0:e.url)}),r.getService("Log").logInfo({title:"sdk_error_call_url_failed"},{redirectInfo:JSON.stringify(e),openType:t,url:n}).send()},tv=[{matchRule:"AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z]+) Safari\\/([0-9\\._]+)$",iosScheme:"https",andScheme:""},{matchRule:"HeyTapBrowser",iosScheme:"",andScheme:""},{matchRule:"HuaweiBrowser",iosScheme:"",andScheme:""},{matchRule:"Kwai",iosScheme:"kwai",andScheme:""},{matchRule:"MQQBrowser",iosScheme:"mttbrowser",andScheme:""},{matchRule:"MicroMessenger",iosScheme:"",andScheme:""},{matchRule:"MiuiBrowser",iosScheme:"",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* CriOS\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z\\._a-z]+) Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"NewsArticle",iosScheme:"snssdk141",andScheme:""},{matchRule:"UCBrowser",iosScheme:"ucbrowser",andScheme:""},{matchRule:"VideoArticle",iosScheme:"snssdk32",andScheme:""},{matchRule:"VivoBrowser",iosScheme:"",andScheme:""},{matchRule:"ZhongAnWebView",iosScheme:"zaapp",andScheme:""},{matchRule:"aweme",iosScheme:"snssdk1128",andScheme:""},{matchRule:"aweme_lite",iosScheme:"snssdk2329",andScheme:""},{matchRule:"com.xs.fm",iosScheme:"novelfm3040",andScheme:""},{matchRule:"netdisk",iosScheme:"",andScheme:""},{matchRule:"qqnews",iosScheme:"qqnews",andScheme:""}];function nv(e,t){for(var n,r=e||window.navigator.userAgent||"",o=tv,i=0;i<o.length;i++){var a=o[i];if(r.match(a.matchRule)){n=a;break}}if(n)return function(e){var t=(e||navigator.userAgent).toLowerCase();return/android|adr|linux/.test(t)}(r)?(rv(t,r,n.andScheme),n.andScheme):function(e){var t=(e||navigator.userAgent).toLowerCase();return/iphone|ipad|ipod|ios|macintosh/.test(t)}(r)?(rv(t,r,n.iosScheme),n.iosScheme):void 0;rv(t,r,"")}function rv(e,t,n){e&&e.logInfo({title:"a3753.b101271.c377460"},{eventMessage:n})}var ov=function(){function e(){b()(this,e),p()(this,"bizFlowStartBehavior",void 0),p()(this,"initOptions",void 0),p()(this,"paymentContext",void 0),p()(this,"instanceId",void 0),p()(this,"sdkMetaData",void 0),p()(this,"productProcessors",{}),p()(this,"enablePopWindowEventCallback",!1),p()(this,"eventLogging",void 0),p()(this,"status",Hm.UNINIT),p()(this,"logger",void 0),this.status=Hm.INITING}var t;return y()(e,[{key:"getStatus",value:function(){return this.status}},{key:"setStatus",value:function(e){e!==this.getStatus()&&(console.log("[test] status has changed from ".concat(this.getStatus()," to ").concat(e)),this.status=e)}},{key:"updatePaymentSessionData",value:function(e){var t=ln(e),n=t.id,r=t.data;this.paymentContext=v()(v()({},this.paymentContext),{},{paymentSession:e,paymentSessionId:n,paymentSessionObj:r})}},{key:"registerProcessor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=t?"".concat(e,"|").concat(t):e;this.productProcessors[r]=n}},{key:"init",value:function(e,t){this.instanceId=ze(),this.sdkMetaData={webAppVersion:"",greyscaleId:jf(),productScene:t,sdkVersion:I},this.sdkMetaData.webAppVersion=cn(this.sdkMetaData),Nf.getInstance(this.instanceId).init(e,this.sdkMetaData),this.logger=Nf.getInstance(this.instanceId).getService("Log"),this.prepare(e,this.sdkMetaData)}},{key:"prepare",value:function(e,t){var n=this,r=Nf.getInstance(this.instanceId).getService("EventCenter");r.listen(_e.redirect.name,(function(e){var t,r,o;if(e){var i=null===(t=e.isDestroy)||void 0===t||t,a="string"==typeof e?{url:e}:{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",url:(null==e?void 0:e.normalUrl)||"",browserLinkTarget:null==e?void 0:e.target,isCallApp:null!==(r=null==e?void 0:e.isCallApp)&&void 0!==r&&r,callAppDetectSuccessDelay:null!==(o=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==o?o:5e3};Xf(a,n.instanceId),i&&n.cleanRender()}})),r.listen(_e.initSecuritySDK.name,function(){var e=u()(l()().mark((function e(t,o){var i,a,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=Nf.getInstance(n.instanceId).getService("Security"),e.prev=1,e.next=4,a.initSecurity();case 4:s=!0,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),s=!1;case 10:r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(i=o.context)||void 0===i?void 0:i.eventCallbackId,data:{success:s}});case 11:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(_e.getDeviceId.name,function(){var e=u()(l()().mark((function e(t,o){var i,a,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=Nf.getInstance(n.instanceId).getService("Security"),e.next=3,a.getDeviceId(t);case 3:s=e.sent,r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(i=o.context)||void 0===i?void 0:i.eventCallbackId,data:{deviceId:s}});case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(_e.getSdkVersion.name,function(){var e=u()(l()().mark((function e(n,o){var i;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(i=o.context)||void 0===i?void 0:i.eventCallbackId,data:{version:null==t?void 0:t.sdkVersion}});case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(_e.destroy.name,(function(e){n.setStatus(Hm.READY),n.destroy()})),r.listen(_e.closeCallback.name,(function(){var t;null===(t=e.onClose)||void 0===t||t.call(e)})),r.listen(_e.eventCallback.name,(function(t){var r;n.logger.logInfo({title:"sdk_event_event_callback"},{eventCode:JSON.stringify((null==t?void 0:t.code)||""),eventMessage:JSON.stringify((null==t?void 0:t.message)||"")}),null===(r=e.onEventCallback)||void 0===r||r.call(e,t)})),r.listen(_e.error.name,(function(t){var n;null===(n=e.onError)||void 0===n||n.call(e,t)})),r.listen(_e.declareEventCallbackInfo.name,(function(e){null!=e&&e.popWindowEventInfo&&(n.enablePopWindowEventCallback=e.popWindowEventInfo.enableCallback,n.eventLogging=e.popWindowEventInfo.eventLogging)})),r.listen(_e.canIUse.name,(function(e,t){var n,o=null==e?void 0:e.funcName;if(o&&"string"==typeof o){var i=r.isExist(o);r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(n=t.context)||void 0===n?void 0:n.eventCallbackId,data:{exist:i,success:!0}})}else{var a;r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=t.context)||void 0===a?void 0:a.eventCallbackId,data:{exist:!1,success:!1}})}})),this.productProcessors[t.productScene]&&this.productProcessors[t.productScene].init(e,this.instanceId,t)}},{key:"startBizFlow",value:(t=u()(l()().mark((function e(t){var n,r,o,i,a,s,c,u,d,p,h,m,f,g,y,_,b,E;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&t.paymentSession){e.next=2;break}throw new Error("paymentSession is empty");case 2:if(this.setStatus(Hm.IN_BIZ_FLOW),i=t.paymentSession,a=t.displayInfo,s=ln(i),c=s.id,u=s.data,this.paymentContext={initOptions:this.initOptions,startBizFlowOptions:t,paymentSession:i,paymentSessionId:c,paymentSessionObj:u,displayInfo:v()(v()({},new Km),a),sdkMetaData:this.sdkMetaData},d=null===(n=this.paymentContext.paymentSessionObj)||void 0===n?void 0:n.clientId,p=Ht(this.paymentContext.paymentSessionObj.extendInfo),h=cn(this.sdkMetaData,d,p),this.sdkMetaData.webAppVersion=h,Nf.getInstance(this.instanceId).update(this.paymentContext),this.logger.logInfo({title:"sdk_event_createComponent"}),l=this.sdkMetaData,$t("Antom_".concat(l.sdkVersion+l.productScene,"_LastAppVersion"),""),m=null===(r=this.paymentContext.paymentSessionObj)||void 0===r||null===(r=r.paymentSessionConfig)||void 0===r?void 0:r.productScene,f=null===(o=this.paymentContext.paymentSessionObj)||void 0===o||null===(o=o.paymentMethodInfoView)||void 0===o?void 0:o.paymentMethodType,e.prev=15,!this.productProcessors["".concat(m,"|").concat(f)]){e.next=22;break}return e.next=19,this.productProcessors["".concat(m,"|").concat(f)].startBizFlow(this.paymentContext);case 19:this.bizFlowStartBehavior=e.sent,e.next=26;break;case 22:if(!this.productProcessors["".concat(m)]){e.next=26;break}return e.next=25,this.productProcessors["".concat(m)].startBizFlow(this.paymentContext);case 25:this.bizFlowStartBehavior=e.sent;case 26:e.next=31;break;case 28:e.prev=28,e.t0=e.catch(15),console.error("Invoke processor failed",e.t0);case 31:if(this.bizFlowStartBehavior&&"NONE"!==this.bizFlowStartBehavior.behaviorType&&this.bizFlowStartBehavior.payload){e.next=33;break}return e.abrupt("return");case 33:if("RENDER"!==this.bizFlowStartBehavior.behaviorType){e.next=36;break}return this.handleBehaviorRender(),e.abrupt("return");case 36:if("REDIRECT"!==this.bizFlowStartBehavior.behaviorType){e.next=49;break}if(y=null===(g=this.bizFlowStartBehavior)||void 0===g?void 0:g.payload,console.log("sdk 打印",y),console.log("sdk 触发",t),!t.isNativeAppWebview||y.openInApp){e.next=46;break}return console.log("sdk 打印跳转",t),_=Nf.getInstance(this.instanceId).getService("EventCenter"),b={normalUrl:(null==y?void 0:y.url)||"",schemeUrl:(null==y?void 0:y.schemeUrl)||"",applinkUrl:(null==y?void 0:y.applinkUrl)||""},_.emit(_e.eventCallback.name,{code:ce.SDK_REDIRECT,result:{redirectUrls:b}}),e.abrupt("return");case 46:return y.url&&y.openInApp&&t.isNativeAppWebview&&((E=new URL(y.url)).searchParams.set("source","embedded"),y.url=E.toString()),Xf(y,this.instanceId),e.abrupt("return");case 49:case"end":return e.stop()}var l}),e,this,[[15,28]])}))),function(e){return t.apply(this,arguments)})},{key:"getServiceProvider",value:function(){return Nf.getInstance(this.instanceId)}},{key:"getBizFlowBehavior",value:function(){return this.bizFlowStartBehavior}},{key:"getPaymentContext",value:function(){return this.paymentContext}},{key:"destroy",value:function(){this.cleanRender(!0)}},{key:"handleBehaviorRender",value:function(){var e=this,t=Nf.getInstance(this.instanceId).getService("EventCenter"),n=Nf.getInstance(this.instanceId).getService("Container"),r=this.paymentContext.displayInfo.type,o=this.paymentContext.displayInfo.platform,i=this.bizFlowStartBehavior.payload,a=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r!==G.inline&&(e.paymentContext.displayInfo.isRetention?Im():e.handleClose(t,"behavior"))};t.listen(_e.close.name,(function(){a(!0)})),t.listen(_e.setAllowRetention.name,(function(t){void 0!==t&&"boolean"==typeof t&&(e.paymentContext.displayInfo.isRetention=t)})),t.listen(_e.declareCheckoutInfo.name,(function(e){!function(e){try{if(e){var t,n,r,o=document.getElementById("".concat(Pe,"-title"));o&&(o.style.fontSize="".concat(null==e||null===(t=e.title)||void 0===t?void 0:t.fontSize,"px"),o.style.color=null==e||null===(n=e.title)||void 0===n?void 0:n.fontColor,o.innerHTML=null==e||null===(r=e.title)||void 0===r?void 0:r.text);var i,a,s,l=document.getElementById("".concat(Pe,"-sub-title"));l&&(l.style.fontSize="".concat(null==e||null===(i=e.message)||void 0===i?void 0:i.fontSize,"px"),l.style.color=null==e||null===(a=e.message)||void 0===a?void 0:a.fontColor,l.innerHTML=null==e||null===(s=e.message)||void 0===s?void 0:s.text);var c,u,d,p,h,m,f,v=document.getElementById("".concat(Pe,"-remain"));v&&(v.innerHTML=null==e||null===(c=e.btnOK)||void 0===c?void 0:c.text,v.style.fontSize="".concat(null==e||null===(u=e.btnOK)||void 0===u?void 0:u.fontSize,"px"),v.style.color=null==e||null===(d=e.btnOK)||void 0===d?void 0:d.fontColor,v.style.borderRadius="".concat(null==e||null===(p=e.btnOK)||void 0===p?void 0:p.corner,"px"),"stroke"===(null==e||null===(h=e.btnOK)||void 0===h?void 0:h.type)?v.style.border="1px solid ".concat(null==e||null===(f=e.btnOK)||void 0===f?void 0:f.bg):v.style.backgroundColor=null==e||null===(m=e.btnOK)||void 0===m?void 0:m.bg);var g,y,_,b,E,S,A,k=document.getElementById("".concat(Pe,"-leave"));k&&(k.innerHTML=null==e||null===(g=e.btnCancel)||void 0===g?void 0:g.text,k.style.fontSize="".concat(null==e||null===(y=e.btnCancel)||void 0===y?void 0:y.fontSize,"px"),k.style.color=null==e||null===(_=e.btnCancel)||void 0===_?void 0:_.fontColor,k.style.borderRadius="".concat(null==e||null===(b=e.btnCancel)||void 0===b?void 0:b.corner,"px"),"stroke"===(null==e||null===(E=e.btnCancel)||void 0===E?void 0:E.type)?k.style.border="1px solid ".concat(null==e||null===(A=e.btnCancel)||void 0===A?void 0:A.bg):k.style.backgroundColor=null==e||null===(S=e.btnCancel)||void 0===S?void 0:S.bg)}}catch(e){console.error(e)}}(null==e?void 0:e.closeDialogData)}));var s=n.load(this.paymentContext.displayInfo,i.url,a);return r===G.inline?(n.showLoading(s,this.paymentContext.displayInfo),void Lm()):r==G.popup?(function(e,t,n){var r=e===oe.mobile?"touchend":"click",o=document.createElement("div");o.id=Pe,o.classList.add("".concat(Pe,"-").concat(e)),o.innerHTML='\n <span id="'.concat(Pe,'-title" class="').concat(Pe,"-title-").concat(e,'">\n Are you sure you want to leave?\n </span>\n <span\n id="').concat(Pe,'-sub-title"\n class="').concat(Pe,"-sub-title-").concat(e,'"\n >\n If you leave this page, you\'ll have to start over again.\n </span>\n <div class="').concat(Pe,"-btn-block-").concat(e,'">\n <div id="').concat(Pe,'-remain" class="').concat(Pe,"-remain-").concat(e,'">\n Continue Payment\n </div>\n <div id="').concat(Pe,'-leave" class="').concat(Pe,"-leave-").concat(e,'">\n Leave\n </div>\n </div>'),document.body.appendChild(o);var i=document.getElementById("".concat(Pe,"-remain"));i&&i.addEventListener(r,t);var a=document.getElementById("".concat(Pe,"-leave"));a&&a.addEventListener(r,n)}(o,(function(){wm(),e.handleRemain()}),(function(){wm(),e.handleClose(!1,"retention")})),Rm({platform:o,onClickOutside:i.allowClickPopupOutsideClose?a:void 0,closeBtnFunc:a}),void n.showLoading(s,this.paymentContext.displayInfo)):void 0}},{key:"handleRemain",value:function(){var e,t,n,r;this.eventLogging&&this.eventLogging.enableLogging&&this.logger.logInfo({code:(null===(e=this.eventLogging)||void 0===e?void 0:e.eventName)||""},{eventId:ve.ContinuePaying,eventName:(null===(t=this.eventLogging)||void 0===t?void 0:t.eventName)||"",eventAlias:(null===(n=this.eventLogging)||void 0===n?void 0:n.eventAlias)||"",userPath:(null===(r=this.eventLogging)||void 0===r?void 0:r.userPath)||""})}},{key:"handleClose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,n=Nf.getInstance(this.instanceId).getService("EventCenter");if(n.emit(_e.closeCallback.name,{}),this.enablePopWindowEventCallback&&!e){var r,o,i,a;if(this.eventLogging&&this.eventLogging.enableLogging)this.logger.logInfo({code:(null===(r=this.eventLogging)||void 0===r?void 0:r.eventName)||""},{eventId:"behavior"===t?ve.OnlyClose:ve.LeaveAnyWay,eventName:(null===(o=this.eventLogging)||void 0===o?void 0:o.eventName)||"",eventAlias:(null===(i=this.eventLogging)||void 0===i?void 0:i.eventAlias)||"",userPath:(null===(a=this.eventLogging)||void 0===a?void 0:a.userPath)||""});n.emit(_e.eventCallback.name,{code:ce.SDK_PAYMENT_CANCEL,result:{result:{}}})}this.cleanRender()}},{key:"cleanRender",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=Nf.getInstance(this.instanceId).getService("Container"),i=function(){var e;o.cleanContainer(null===(e=n.paymentContext)||void 0===e?void 0:e.displayInfo),Om(),Cm()};null===(e=document.getElementById(Te))||void 0===e||e.remove(),null===(t=document.getElementById(Ie))||void 0===t||t.remove(),o.startHideAnim(),Nm(),r?i():(setTimeout((function(){i()}),300),this.logger.logInfo({title:"sdk_event_destroyComponent"}))}},{key:"getInstanceId",value:function(){return this.instanceId}}]),e}(),iv=function(){function e(){b()(this,e)}return y()(e,[{key:"init",value:function(e,t){return null}},{key:"startBizFlow",value:function(){return null}}]),e}(),av=function(e){return e.UNINIT="UNINIT",e.INITING="INITING",e.READY="READY",e.IN_BIZ_FLOW="IN_BIZ_FLOW",e.DESTROYED="DESTROYED",e}({}),sv=function(){function e(t){var n,r,o=t.type,i=t.instanceId,a=t.selector,s=t.processor,l=t.options;b()(this,e),p()(this,"containerStatus",void 0),p()(this,"instanceId",void 0),p()(this,"containerService",void 0),p()(this,"eventService",void 0),p()(this,"containerElement",void 0),p()(this,"_globalData",void 0),this._globalData=new Map,this.switchContainerStatus(av.INITING),this.instanceId="".concat(i,"-").concat(o),this.containerService=Nf.getInstance(this.instanceId).getService("Container"),Nf.getInstance(this.instanceId).init({},{productScene:W.ELEMENT_PAYMENT,sdkVersion:"",webAppVersion:""});var c=null!=l&&null!==(n=l.debugProps)&&void 0!==n&&n.isDebug&&(null==l||null===(r=l.debugProps)||void 0===r?void 0:r.localLink)||"";this.containerElement=this.containerService.load({type:G.inline,platform:Gm()||zm()?oe.desktop:oe.mobile,isRetention:!1,selector:a,appendAliasContainerId:!0,iframeStyle:{display:"block",colorScheme:Le}},s.generateIframeSrc({link:c,instanceId:this.instanceId})),this.eventService=Nf.getInstance(this.instanceId).getService("EventCenter"),this.addEventListener()}return y()(e,[{key:"addEventListener",value:function(){var e=this;this.eventService.listen(_e.setGlobalData.name,(function(t){e._globalData.set(null==t?void 0:t.dataKey,null==t?void 0:t.data)})),this.eventService.listen(_e.getGlobalData.name,(function(t,n){var r=n.context;if(null!=r&&r.eventCallbackId){var o,i=e._globalData.get(null===(o=r.data)||void 0===o?void 0:o.dataKey);e.eventService.dispatchToApp({event:"appEventCallback",eventCallbackId:null==r?void 0:r.eventCallbackId,data:i})}}))}},{key:"getContainerElement",value:function(){return this.containerElement}},{key:"createWebLaunchPromise",value:function(){var e=this;return new Promise((function(t){e.eventService.listen("onLaunch",(function(e){t(e)}))}))}},{key:"switchContainerStatus",value:function(e){this.containerStatus=e}},{key:"getContainerStatus",value:function(){return this.containerStatus}},{key:"getEventService",value:function(){return this.eventService}},{key:"destroy",value:function(){this.eventService.destroy(),this.containerElement.remove()}},{key:"getContainerService",value:function(){return this.containerService}},{key:"getInstanceId",value:function(){return this.instanceId}}]),e}(),lv=function(){function e(t){var n=t.instanceId;b()(this,e),p()(this,"containerServices",void 0),p()(this,"instanceId",void 0),this.containerServices=new Map,this.instanceId=n}return y()(e,[{key:"addContainerService",value:function(e,t){this.containerServices.set(e,t)}},{key:"getContainerService",value:function(e){return this.containerServices.get(e)}},{key:"getContainerServices",value:function(){return this.containerServices}},{key:"destroy",value:function(){this.containerServices.forEach((function(e){e.destroy()})),this.containerServices=new Map}},{key:"mount",value:function(e){var t=e.type,n=e.selector,r=e.processor,o=e.options;this.addContainerService(t,new sv({type:t,instanceId:this.instanceId,selector:n,processor:r,options:o}))}},{key:"getEventService",value:function(e){return this.getContainerService(e).getEventService()}}]),e}(),cv=function(){function e(t){var n=t.logger;b()(this,e),p()(this,"activeEvents",new Map),p()(this,"heartbeatIntervalId",null),p()(this,"HEARTBEAT_INTERVAL",5e3),p()(this,"uniqueId",0),p()(this,"logger",void 0),this.logger=n}return y()(e,[{key:"registerEvent",value:function(e,t){var n=this.buildId(e,"start"),r=this.getEventName(e,"start");return this.activeEvents.set(n,Date.now()),this.startHeartbeat(),this.sendLog(r,{eventName:n,sessionData:t}),n}},{key:"endEvent",value:function(e,t){if(this.activeEvents.has(e)){var n=this.activeEvents.get(e);this.activeEvents.delete(e);var r=this.getEventNameFromStart(e,"end");this.sendLog(r,v()({eventName:this.buildIdFromStart(e,"end"),startTime:n,endTime:Date.now()},t||{})),t&&"object"!==ct(t)&&this.sendLog("data_error",{msg:Vm(t)}),0===this.activeEvents.size&&this.stopHeartbeat()}}},{key:"cancelEvent",value:function(e,t){if(this.activeEvents.has(e)){var n=this.activeEvents.get(e);this.activeEvents.delete(e);var r=this.getEventNameFromStart(e,"end");this.sendLog(r,v()({eventName:this.buildIdFromStart(e,"end"),startTime:n,endTime:Date.now(),canceled:!0},t||{})),0===this.activeEvents.size&&this.stopHeartbeat()}}},{key:"cancelByPrefix",value:function(e,t){var n=this;Array.from(this.activeEvents.keys()).filter((function(t){return t.startsWith(e)})).forEach((function(e){return n.cancelEvent(e,t)}))}},{key:"startHeartbeat",value:function(){var e=this;this.heartbeatIntervalId||(this.heartbeatIntervalId=setInterval((function(){0!==e.activeEvents.size?e.sendHeartbeat():e.stopHeartbeat()}),this.HEARTBEAT_INTERVAL))}},{key:"stopHeartbeat",value:function(){null!==this.heartbeatIntervalId&&(clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=null)}},{key:"sendHeartbeat",value:function(){var e=Array.from(this.activeEvents.entries()).map((function(e){var t=ot()(e,2);return{eventName:t[0],startTime:t[1]}}));this.sendLog("heart_beat",{actionNames:Vm(e)})}},{key:"sendLog",value:function(e,t){var n=p()(p()(p()(p()(p()(p()(p()(p()(p()(p()({},"".concat(Y.MOUNT,"_start"),"sdk_event_mount"),"".concat(Y.MOUNT,"_end"),"sdk_event_mount_end"),"".concat(Y.SUBMITPAYMENT,"_start"),"sdk_event_submitPay"),"".concat(Y.SUBMITPAYMENT,"_end"),"sdk_event_payment_end"),"".concat(Y.VALIDATAFIELDS,"_start"),"sdk_event_validateFields"),"".concat(Y.VALIDATAFIELDS,"_end"),"sdk_event_validateFields_end"),"".concat(Y.DESTORY,"_start"),"sdk_event_apiOnDestroy"),"".concat(Y.DESTORY,"_end"),"sdk_event_apiOnDestroy_end"),"heart_beat","sdk_element_handleHeartBeat"),"data_error","sdk_element_callback_error")[e];n&&this.logger.logInfo({title:n},v()({actionName:e},t))}},{key:"buildId",value:function(e,t){return"".concat(e,"_").concat(++this.uniqueId,"_").concat(t)}},{key:"getEventName",value:function(e,t){return"".concat(e,"_").concat(t)}},{key:"buildIdFromStart",value:function(e,t){return e.replace(/_start$/,"_".concat(t))}},{key:"getEventNameFromStart",value:function(e,t){return e.replace(/_.+_/i,"_").replace(/_start$/,"_".concat(t))}}]),e}(),uv=["type"],dv=function(){function e(t){b()(this,e),p()(this,"options",void 0),p()(this,"elementContainer",void 0),p()(this,"serviceMap",void 0),p()(this,"loading",void 0),p()(this,"elementProcessors",void 0),p()(this,"initTimeout",void 0),p()(this,"elementContainerService",void 0),p()(this,"onStatusChangeCallback",void 0),p()(this,"submitPayPromise",void 0),p()(this,"elementEventCenter",void 0),p()(this,"currentPaymentMethodType",""),p()(this,"onValidateFunc",(function(e,t){return new Promise((function(n){e.emitAndListen({event:O.VALIDATE,data:{params:{},target:t,source:D.CONTAINER_ELEMENT}},(function(e){n(e)}))}))})),p()(this,"onValidateAndSubmitPay",(function(e,t,n){return new Promise((function(r){e.emitAndListen({event:O.SUBMIT_PAY,data:{params:v()(v()({},n),{},{doMain:window.location.hostname}),target:t,source:D.CONTAINER_ELEMENT}},(function(e){r(e)}))}))})),this.options=t;var n=t;this.onStatusChangeCallback=null==n?void 0:n.onStatusChangeCallback,this.elementContainer=new ov,this.elementContainer.registerProcessor(W.ELEMENT_PAYMENT,"",new iv),this.elementContainer.init(this.options,W.ELEMENT_PAYMENT),this.initService(),this.elementContainerService=new lv({instanceId:this.elementContainer.getInstanceId()}),this.setControllerStatusOrView(Hm.READY),this.elementEventCenter=new cv({logger:this.elementContainer.getServiceProvider().getService("Log")})}var t,n,r,o;return y()(e,[{key:"initService",value:function(){this.serviceMap={Log:this.elementContainer.getServiceProvider().getService("Log"),EventCenter:this.elementContainer.getServiceProvider().getService("EventCenter"),Requester:this.elementContainer.getServiceProvider().getService("Requester")}}},{key:"initElementProcessors",value:function(e){var t={auth:new Xm(this.options),address:new Qm(this.options),payment:new Yf(this.options)};this.elementProcessors=v()(v()({},this.elementProcessors),{},p()({},e,t[e])),this.elementProcessors[e].registerElementContainer(this.elementContainer)}},{key:"onEventCallback",value:function(e){var t,n,r=e.code,o=e.message,i=void 0===o?"":o,a=e.result,s=void 0===a?void 0:a;this.serviceMap.Log.logInfo({title:"sdk_event_event_callback"},{eventCode:Vm(r||""),eventMessage:Vm(i||"")}),null==this||null===(t=this.options)||void 0===t||null===(n=t.onEventCallback)||void 0===n||n.call(t,{code:r,message:i,result:s})}},{key:"handleInitializationError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ge.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR;this.changeLoading(!1),this.setControllerStatusOrView(Hm.READY),this.onEventCallback(e),this.elementContainerService.getContainerServices().forEach((function(e){e.getContainerElement().remove()})),this.elementContainerService.destroy()}},{key:"handleMountError",value:function(e){var t=e.result,n=e.resolve,r=t.errorMsg,o=t.error;this.onEventCallback({code:K.SDK_CREATE_COMPONENT_ERROR,message:r}),n({error:o})}},{key:"clearAndSetInitTimeout",value:function(e){clearTimeout(this.initTimeout),this.initTimeout=null,this.initTimeout=this.setInitTimeout(e)}},{key:"clearInitTimeout",value:function(){clearTimeout(this.initTimeout),this.initTimeout=null}},{key:"clearEvents",value:function(e){var t,n;null===(t=(n=this.elementEventCenter).cancelByPrefix)||void 0===t||t.call(n,"mount",{msg:e})}},{key:"setInitTimeout",value:function(e){var t=this;return setTimeout((function(){clearTimeout(t.initTimeout),t.initTimeout=null,t.handleInitializationError(ge.SDK_LAUNCH_PAYMENT_APP_ERROR.LOAD_APP_TIME_OUT),t.serviceMap.Log.logInfo({title:"sdk_event_web_app_timeout"}),e({error:ge.INITIALIZE_TIMEOUT.WEB})}),16e3)}},{key:"initializeAndMountProcessor",value:function(e,t,n){var r,o;this.initElementProcessors(e),this.elementContainerService.mount({type:e,selector:t,processor:this.elementProcessors[e],options:n}),this.elementProcessors[e].registerEventCenter(this.elementContainerService.getEventService(e));var i=this.elementContainerService.getContainerService(e).getInstanceId(),a=this.elementContainer.getPaymentContext();Nf.getInstance(i).update(a),this.serviceMap.Log=Nf.getInstance(i).getService("Log"),null===(r=this.serviceMap.Log)||void 0===r||r.logInfo({title:"sdk_event_appearance"},{variables:!(null==n||null===(o=n.appearance)||void 0===o||!o.variables),theme:null==n?void 0:n.theme}),this.elementProcessors[e].beforeMount()}},{key:"handleStartBizFlowError",value:function(e,t){t({error:v()(v()({},ge.PARAM_INVALID),{},{context:JSON.stringify(e)})}),this.onEventCallback({code:K.SDK_CREATEPAYMENT_PARAMETER_ERROR,message:(null==e?void 0:e.message)||"Initialization parameter exception."}),clearTimeout(this.initTimeout),this.initTimeout=null,this.changeLoading(!1)}},{key:"mount",value:function(e,t){var n=this,r=ln(this.options.sessionData).id,o=this.elementEventCenter.registerEvent(Y.MOUNT,r);return new Promise((function(r){var i=function(e){var t=e.sdkSelector,n=e.containerService,r=e.status;return document.querySelector(t)?r===Hm.DESTROYED?{success:!1,errorMsg:"Creating components in the destroyed state is forbidden.",error:{code:ge.UI_STATE_ERROR.code,message:"Creating components in the destroyed state is forbidden."}}:r===Hm.READY?{success:!0}:n?{success:!1,errorMsg:"SDK status error.",error:{code:ge.UI_STATE_ERROR.code,message:"SDK status error."}}:{success:!0}:(console.error("Element with selector ".concat(t," not found.")),{success:!1,errorMsg:"Element with selector ".concat(t," not found."),error:{code:ge.PARAM_INVALID.code,message:"Element with selector ".concat(t," not found.")}})}({sdkSelector:t,status:n.elementContainer.getStatus(),containerService:n.elementContainerService.getContainerService(e.type)}),a=function(e){n.elementEventCenter.endEvent(o,{msg:Vm(e)}),r(v()({},e||{}))};if(i.success){n.clearAndSetInitTimeout(a),n.changeLoading(!0);try{var s={paymentSession:n.options.sessionData,displayInfo:v()(v()({},e),{},{appendAliasContainerId:!0})};n.setControllerStatusOrView(Hm.IN_BIZ_FLOW),n.elementContainer.startBizFlow(s),n.initializeAndMountProcessor(e.type,t,e),n.sendRequestAndWaitWebLaunch(e,a),n.addEventListener(a),n.serviceMap.EventCenter.addIFrame(n.elementContainerService.getContainerService(e.type).getContainerService().getWebApp())}catch(e){n.handleStartBizFlowError(e,a)}}else n.handleMountError({result:i,resolve:a})}))}},{key:"validateFields",value:(o=u()(l()().mark((function e(){var t,n,r,o,i;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.elementEventCenter.registerEvent(Y.VALIDATAFIELDS),n={isValid:!1},e.prev=2,!this.initTimeout&&null!==(r=this.elementProcessors)&&void 0!==r&&r[L.payment]){e.next=5;break}return e.abrupt("return",n);case 5:return e.next=7,this.onValidateFunc(this.elementProcessors[L.payment].eventCenter,D.PAYMENT_ELEMENT);case 7:return i=e.sent,n=null!==(o=i.data)&&void 0!==o?o:{isValid:!1},e.abrupt("return",n);case 12:return e.prev=12,e.t0=e.catch(2),e.abrupt("return",n);case 15:return e.prev=15,this.elementEventCenter.endEvent(t,n),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])}))),function(){return o.apply(this,arguments)})},{key:"submitPayment",value:(r=u()(l()().mark((function e(t){var n,r,o,i,a,s,c,d,p,h,m,f,g,y,_,b=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.elementEventCenter.registerEvent(Y.SUBMITPAYMENT),this.elementContainer.getStatus()===Hm.IN_BIZ_FLOW){e.next=6;break}return r={error:v()(v()({},ge.UI_STATE_ERROR),{},{needChangeSessionForRetry:!1}),status:M.FAIL},o={eventCode:M.FAIL,errorName:ge.UI_STATE_ERROR.code,needChangeSessionForRetry:!1,msg:Vm(r)},this.elementEventCenter.endEvent(n,o),e.abrupt("return",Promise.resolve(r));case 6:if(this.changeLoading(!0),i="APPLEPAY"===this.currentPaymentMethodType,a=this.currentPaymentMethodType||"UNKNOWN",null==t||!t.onBeforeConfirm||i){e.next=40;break}return this.serviceMap.Log.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:a,path:"nonApplePay_sync"}),e.prev=11,s=Date.now(),e.next=15,Za((function(){return t.onBeforeConfirm()}));case 15:if(c=e.sent,d=c.result,!(c.timedOut||Date.now()-s>=Wa)){e.next=24;break}return this.serviceMap.Log.logError({title:"sdk_before_confirm_timeout"},{paymentMethodType:a,path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:M.FAIL,errorName:Ja}),e.abrupt("return",{status:M.FAIL,error:{code:Ja,message:"Merchant confirmation timed out.",needChangeSessionForRetry:!1}});case 24:if(d){e.next=29;break}return this.serviceMap.Log.logInfo({title:"sdk_before_confirm_abort"},{paymentMethodType:a,path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:M.FAIL,errorName:qa}),e.abrupt("return",{status:M.FAIL,error:{code:qa,message:"Payment was cancelled by merchant before confirmation.",needChangeSessionForRetry:!1}});case 29:this.serviceMap.Log.logInfo({title:"sdk_before_confirm_success"},{paymentMethodType:a,path:"nonApplePay_sync"}),e.next=38;break;case 32:return e.prev=32,e.t0=e.catch(11),this.serviceMap.Log.logError({title:"sdk_before_confirm_error"},{paymentMethodType:a,errorMessage:String((null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0).slice(0,200),path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:M.FAIL,errorName:qa}),e.abrupt("return",{status:M.FAIL,error:{code:qa,message:"Payment was cancelled by merchant before confirmation.",needChangeSessionForRetry:!1}});case 38:e.next=41;break;case 40:null!=t&&t.onBeforeConfirm||this.serviceMap.Log.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:a,path:i?"applePay_eventBridge":"nonApplePay_sync"});case 41:return p=null,e.prev=42,e.next=45,new Promise(function(){var e=u()(l()().mark((function e(n){var r,o,a,s,c,d,h,m,f,g,y;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=function(e){if(e instanceof Object){var t,o,i,a=void 0===(null==e||null===(t=e.error)||void 0===t?void 0:t.needChangeSessionForRetry)?null===(o=r.elementProcessors[L.payment])||void 0===o||null===(o=o.obtainDataRes)||void 0===o||null===(o=o.originActionQueryResult)||void 0===o?void 0:o.notSupportRetryPayForSameSession:null==e||null===(i=e.error)||void 0===i?void 0:i.needChangeSessionForRetry;null!=e&&e.error&&(e.error.needChangeSessionForRetry=a)}n(p=e)},r=b,e.prev=2,b.submitPayPromise=o,a={},s=function(){var e=u()(l()().mark((function e(t,n){var r,i;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(b.elementProcessors[t]){e.next=2;break}return e.abrupt("return",!0);case 2:return e.next=4,b.onValidateAndSubmitPay(b.elementProcessors[t].eventCenter,n);case 4:if(r=e.sent,i=r.data,a.shipping=null==i?void 0:i.data,null!=i&&i.success){e.next=11;break}return o(p=i),e.abrupt("return",!1);case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),e.next=8,s(L.auth,D.AUTH_ELEMENT);case 8:if(e.sent){e.next=10;break}return e.abrupt("return");case 10:return e.next=12,s(L.address,D.ADDRESS_ELEMENT);case 12:if(e.sent){e.next=14;break}return e.abrupt("return");case 14:if(!b.elementProcessors[L.payment]){e.next=28;break}return c=i&&!(null==t||!t.onBeforeConfirm),b.serviceMap.Log.logInfo({title:"sdk_element_submitPayment_setBeforeConfirm"},{msg:Vm({hasBeforeConfirmForApplePay:c,isApplePay:i,amount:"".concat(null==t?void 0:t.amount,", ").concat(null==t?void 0:t.currency)})}),b.elementProcessors[L.payment].setOnBeforeConfirm(c?t.onBeforeConfirm:null),d=!(null==t||!t.amount),h=!(null==t||!t.currency),!d&&!h||d&&h||b.serviceMap.Log.logError({title:"sdk_element_submitPayment_amountCurrencyMismatch"},{msg:Vm({amount:null==t?void 0:t.amount,currency:null==t?void 0:t.currency,reason:"amount and currency must be provided together, both ignored"})}),b.elementProcessors[L.payment].setMerchantAmountOverride(d&&h?t.amount:null,d&&h?t.currency:null),e.next=24,b.onValidateAndSubmitPay(b.elementProcessors[L.payment].eventCenter,D.PAYMENT_ELEMENT,(_=void 0,v()(v()(v()({},a),{},{handleActions:null===(_=null==t?void 0:t.handleActions)||void 0===_||_,shipping:null==t?void 0:t.shippingInfo},d&&h?{amount:t.amount,currency:t.currency}:{}),{},{hasBeforeConfirm:c})));case 24:m=e.sent,f=m.data,o(p=f);case 28:e.next=37;break;case 30:e.prev=30,e.t0=e.catch(2),g=JSON.stringify(e.t0,Object.getOwnPropertyNames(e.t0)),y={error:v()(v()({},ge.ERR_DATA_STRUCT_UNRECOGNIZED),{},{context:g}),status:M.FAIL},b.serviceMap.Log.logError({title:Ba.sdk_element_missKeyData},{msg:JSON.stringify(y)}),p=y,o(y);case 37:case"end":return e.stop()}var _}),e,null,[[2,30]])})));return function(t){return e.apply(this,arguments)}}());case 45:return e.abrupt("return",e.sent);case 46:return e.prev=46,_={eventCode:null===(h=p)||void 0===h?void 0:h.status,errorName:null===(m=p)||void 0===m||null===(m=m.error)||void 0===m?void 0:m.code,errormessage:null===(f=p)||void 0===f||null===(f=f.error)||void 0===f?void 0:f.message,needChangeSessionForRetry:null===(g=p)||void 0===g||null===(g=g.error)||void 0===g?void 0:g.needChangeSessionForRetry,rpcTraceId:null===(y=p)||void 0===y||null===(y=y.error)||void 0===y?void 0:y.traceId,msg:Vm(p)},this.elementEventCenter.endEvent(n,_),this.changeLoading(!1),e.finish(46);case 51:case"end":return e.stop()}}),e,this,[[11,32],[42,,46,51]])}))),function(e){return r.apply(this,arguments)})},{key:"changeLoading",value:function(e){if(e){var t,n,r;if(null!==(t=this.options.loading)&&void 0!==t&&t.onStartLoading&&!this.loading)this.loading=!0,null===(n=this.options.loading)||void 0===n||null===(r=n.onStartLoading)||void 0===r||r.call(n)}else{var o,i,a;if(null!==(o=this.options.loading)&&void 0!==o&&o.onEndLoading&&this.loading)null===(i=this.options.loading)||void 0===i||null===(a=i.onEndLoading)||void 0===a||a.call(i);this.loading=!1}}},{key:"addEventListener",value:function(e){var t=this;this.serviceMap.EventCenter.listen(O.ON_EVENT_CALLBACK,(function(e){var n;null===(n=t.onEventCallback)||void 0===n||n.call(t,e)})),this.serviceMap.EventCenter.listen(_e.sizeChanged.name,(function(n){clearTimeout(t.initTimeout),t.initTimeout=null,t.elementContainerService.getContainerService(n.source)&&(e(),t.elementContainerService.getContainerService(n.source).switchContainerStatus(av.IN_BIZ_FLOW)),t.changeLoading(!1)})),this.serviceMap.EventCenter.listen(_e.redirect.name,(function(e){!function(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;console.log("local payment sdk new element redirect arg ----",this);var a="string"==typeof e?{normalUrl:e}:v()(v()({},e),{},{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(t=null==e?void 0:e.isDestroy)||void 0===t||t,isCallApp:null!==(n=null==e?void 0:e.isCallApp)&&void 0!==n&&n,callAppDetectSuccessDelay:null!==(r=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==r?r:2e3}),s=function(e,t,n){i({code:ce.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(e,": ").concat(t)});var r={redirectInfo:JSON.stringify(a),openType:e,url:t,fromFastSdk:o};n&&(r.durationInSeconds=n)},l=function(e,t,n){i({code:ce.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==a?void 0:a.applinkUrl," schemeUrl: ").concat(null==a?void 0:a.schemeUrl," normalUrl: ").concat(null==a?void 0:a.normalUrl)});var r={redirectInfo:JSON.stringify(a),openType:e,url:t,fromFastSdk:o};n&&(r.durationInSeconds=n)};if(a.target===ae.BLANK)return a.normalUrl?(s(ue.NormalUrl,a.normalUrl),void window.open(a.normalUrl)):l(ue.NormalUrl,"");if(!(a.target!==ae.REPLACE||null!=a&&a.applinkUrl||null!=a&&a.schemeUrl))return a.normalUrl?(s(ue.NormalUrl,a.normalUrl),void window.location.replace(a.normalUrl)):l(ue.NormalUrl,"");if(null!=a&&a.isCallApp&&null!=a&&a.schemeUrl){var c=new Date,u="number"==typeof(null==e?void 0:e.callAppDetectSuccessDelay)?e.callAppDetectSuccessDelay:5e3;jm({schemeUrl:null==a?void 0:a.schemeUrl,callAppJudgeTime:u}).then((function(){var e=((new Date).getTime()-c.getTime())/1e3;s(ue.SchemeUrl,null==a?void 0:a.schemeUrl,e)})).catch((function(){var e=((new Date).getTime()-c.getTime())/1e3;l(ue.SchemeUrl,a.schemeUrl,e)}))}else jm({applinkUrl:null==a?void 0:a.applinkUrl,schemeUrl:null==a?void 0:a.schemeUrl,normalUrl:null==a?void 0:a.normalUrl}).then((function(){s(ue.NormalUrl,null==a?void 0:a.normalUrl)})).catch((function(){l(ue.NormalUrl,null==a?void 0:a.normalUrl)}))}(e,!1,t.onEventCallback.bind(t))})),this.serviceMap.EventCenter.listen(_e.destroy.name,(function(){t.changeLoading(!1),t.setControllerStatusOrView(Hm.READY),t.destroyHandle()})),this.serviceMap.EventCenter.listen(_e.webAppReady.name,(function(n){clearTimeout(t.initTimeout),t.initTimeout=null,t.elementContainerService.getContainerService(n.source)&&(e(),t.elementContainerService.getContainerService(n.source).switchContainerStatus(av.IN_BIZ_FLOW)),t.changeLoading(!1)})),this.serviceMap.EventCenter.listen(_e.showToast.name,(function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=document.createElement(e);return Object.keys(t).forEach((function(e){"style"===e?Object.keys(t[e]).forEach((function(n){r.style[n]=t[e][n]})):r.setAttribute(e,t[e])})),"string"==typeof n&&(r.textContent=n),r},r={position:"bottom-right",backgroundColor:"rgba(0, 0, 0, 0.80)",color:"#ffffff",padding:"20px 16px",borderRadius:"8px",fontSize:"14px",zIndex:9999,width:"148px",duration:2e3},o={SUCCESS:"https://cdn.marmot-cloud.com/storage/2024/07/10/10b191d6-0b0a-4bd9-96cc-310b7f2a8530.svg",FAIL:"https://cdn.marmot-cloud.com/storage/2024/11/08/4ae27343-61d2-4a07-b323-c951c7711b40.svg"},i=v()(v()({},r),e),a=document.getElementById("antom_toast-container");switch(a?a.innerHTML="":(a=n("div",{style:{position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none"},id:"antom_toast-container"}),document.body.appendChild(a)),i.position){case"top-left":a.style.top="20px",a.style.left="20px";break;case"top-right":a.style.top="20px",a.style.right="20px";break;case"bottom-left":a.style.bottom="20px",a.style.left="20px";break;default:a.style.bottom="0",a.style.right="0",a.style.top="0",a.style.left="0"}var s=n("div",{style:{backgroundColor:i.backgroundColor,color:i.color,padding:i.padding,borderRadius:i.borderRadius,fontSize:i.fontSize,opacity:"0",transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",width:i.width,boxSizing:"border-box"}});if(i.icon){var l=n("img",{style:{width:"40px",height:"40px"},src:i.icon?o[i.icon]:""});s.appendChild(l)}var c=n("span",{style:{textAlign:"center",marginTop:"12px",lineHeight:"20px",fontFamily:"Noto Sans",fontWeight:400,fontSize:"14px"}},i.message);s.appendChild(c),a.appendChild(s),setTimeout((function(){s.style.opacity="1"}),10),setTimeout((function(){s.style.opacity="0",setTimeout((function(){var e;null===(e=a)||void 0===e||e.remove(),t&&t()}),300)}),i.duration)}(e)})),this.serviceMap.EventCenter.listen(_e.messageForward.name,(function(e){var n=x[e.source],r=x[e.target];t.elementProcessors[n]&&t.elementProcessors[r]&&t.elementProcessors[r].eventCenter.dispatchToApp({event:e.event,data:e})})),this.serviceMap.EventCenter.listen(_e.submitPromiseCallback.name,(function(e){var n;null===(n=t.submitPayPromise)||void 0===n||n.call(t,e)})),this.serviceMap.EventCenter.listen(j.PAYMENTMETHODCHANGED,(function(e){t.currentPaymentMethodType=(null==e?void 0:e.type)||""}),!0)}},{key:"sendRequestAndWaitWebLaunch",value:(n=u()(l()().mark((function e(t,n){var r,o,i,a,s,c,u,d=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.type,o=mc()(t,uv),e.prev=1,i=this.elementContainerService.getContainerService(r)){e.next=7;break}return this.handleInitializationError(ge.SDK_LAUNCH_PAYMENT_APP_ERROR.CONTAINER_NOT_EXIST),n({error:ge.UI_STATE_ERROR}),e.abrupt("return");case 7:return e.next=9,Promise.all([i.createWebLaunchPromise(),this.elementProcessors[r].obtainData()]);case 9:a=e.sent,(s=ot()(a,2))[0],c=s[1],this.serviceMap.Log.logInfo({title:"sdk_event_webAppOnLaunch"}),null==i||i.switchContainerStatus(av.READY),(u=this.getErrorFromResponse(c))&&n(u),this.areAllContainersReady()&&this.elementContainerService.getContainerServices().forEach((function(e,t){d.sendReady(t,o)})),e.next=26;break;case 20:e.prev=20,e.t0=e.catch(1),this.handleInitializationError(),this.clearInitTimeout(),this.clearEvents("webLaunch"),n({error:v()(v()({},ge.INITIALIZE_TIMEOUT.API),{},{traceId:null===e.t0||void 0===e.t0?void 0:e.t0.traceId})});case 26:case"end":return e.stop()}}),e,this,[[1,20]])}))),function(e,t){return n.apply(this,arguments)})},{key:"getErrorFromResponse",value:function(e){if(s=null==e?void 0:e.originActionQueryResult,l=s.success,c=s.paymentMethods,u=s.savedPaymentMethods,d=s.orderAmountView,p=s.paymentAmountView,h=c&&Array.isArray(c)&&c.length>0||u&&Array.isArray(u)&&u.length>0,!(l&&h&&d&&p)){var t,n=e.originActionQueryResult,r=n.traceId,o=n.errorCode,i=n.errorMessage,a={code:o,message:i||ge.ERR_DATA_STRUCT_UNRECOGNIZED.message};if(o||(a=v()({},ge.ERR_DATA_STRUCT_UNRECOGNIZED)),Be[o])a={code:Be[o].code,message:(null===(t=Be[o])||void 0===t?void 0:t.message)||i};else this.serviceMap.Log.logError({title:Ba.sdk_element_missKeyData},{rpcTraceId:r});return{error:v()(v()({},a),{},{traceId:null!=r?r:""})}}var s,l,c,u,d,p,h;return null}},{key:"areAllContainersReady",value:function(){var e=this.elementContainerService.getContainerServices();return nt()(e.values()).every((function(e){return e.getContainerStatus()===av.READY}))}},{key:"sendReady",value:function(e,t){var n,r,o,i,a,s=null===(n=this.elementProcessors[L.payment])||void 0===n?void 0:n.getObtainDataRes(),l=this.elementContainer.getPaymentContext(),c=l.paymentSessionObj,u=(null===(r=c.connectFactor)||void 0===r?void 0:r.enableConnect)&&(null===(o=c.paymentSessionConfig)||void 0===o?void 0:o.productScene)===W.ELEMENT_PAYMENT;if((null==s||null===(i=s.originActionQueryResult)||void 0===i||!i.success)&&u)return clearTimeout(this.initTimeout),this.changeLoading(!1),this.initTimeout=null,null===(a=this.onEventCallback)||void 0===a||a.call(this,{code:K.SDK_CREATE_COMPONENT_ERROR,message:"Component initialization exception."}),void this.destroy();var d=v()(v()({},t),{},{originActionQueryResult:null==s?void 0:s.originActionQueryResult,originOneAccountQueryResult:null==s?void 0:s.originOneAccountQueryResult,paymentSessionData:null==l?void 0:l.paymentSessionId,sessionResult:(null==l?void 0:l.paymentSessionObj)||{}});this.elementProcessors[e].onReady(d)}},{key:"updatePayment",value:(t=u()(l()().mark((function e(t){var n=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=u()(l()().mark((function e(r){var o,i,a;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Fm({status:n.elementContainer.getStatus(),paymentContainerService:n.elementContainerService.getContainerService(L.payment),newPaymentSessionData:t,oldPaymentSessionData:n.options.sessionData})){e.next=2;break}return e.abrupt("return",r(!1));case 2:return o=n.elementContainer.getPaymentContext().paymentSession,n.elementContainer.updatePaymentSessionData(t),e.next=6,n.elementProcessors[L.payment].obtainData();case 6:i=e.sent,a=-1!==window.location.href.indexOf("LOCAL_MOCK=1"),Object.values(n.elementProcessors).forEach((function(e){e.update({data:{originActionQueryResult:a?Lf:i.originActionQueryResult,originOneAccountQueryResult:a?Mf:i.originOneAccountQueryResult},paymentSessionData:t})})),n.serviceMap.EventCenter.listen(_e.updated.name,(function(e){return e.success||n.elementContainer.updatePaymentSessionData(o),r(e.success||!1)}));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"destroyHandle",value:function(){this.clearEvents("destroy"),this.clearInitTimeout(),this.elementContainer.destroy(),Om(),Cm();try{Um()}catch(e){}this.serviceMap.EventCenter.cleanIFrames(),this.elementContainerService.destroy()}},{key:"destroy",value:function(){var e=this.elementEventCenter.registerEvent(Y.DESTORY);try{this.destroyHandle(),this.setControllerStatusOrView(Hm.DESTROYED)}finally{this.elementEventCenter.endEvent(e)}}},{key:"setControllerStatusOrView",value:function(e){var t,n=this.elementContainer.getStatus();e!==n&&(null===(t=this.onStatusChangeCallback)||void 0===t||t.call(this,"状态由 ".concat(n," 变更为 ").concat(e)),this.elementContainer.setStatus(e))}},{key:"on",value:function(e,t){if(!this.isEventAllowed(e))return console.error('Event "'.concat(e,'" is not allowed.'));this.serviceMap.EventCenter.listen(e,(function(e){null==t||t(e)}),!0)}},{key:"isEventAllowed",value:function(e){var t,n=ln(this.options.sessionData).data,r="true"===(null===(t=Wm(null==n?void 0:n.extendInfo))||void 0===t?void 0:t.expressCheckout)?Sm.EXPRESS_CHECKOUT:Sm.ELEMENT_PAYMENT,o=Am.find((function(e){return e.eventName===r}));return void 0!==o&&o.supportedEvents.includes(e)}}]),e}(),pv=dv;function hv(e){return{status:e.status||"FAIL",error:e.error?{code:e.error.code,message:e.error.message,traceId:e.error.traceId,needChangeSessionForRetry:e.error.needChangeSessionForRetry}:void 0,userCanceled3D:e.userCanceled3D,session:e.paymentSession?{nextAction:{applinkUrl:e.paymentSession.returnAppUrl,normalUrl:e.paymentSession.returnUrl,schemeUrl:e.paymentSession.returnAppScheme}}:void 0}}function mv(e,t){var n,r,o,i={showCardCVV:!(null==t||null===(n=t.storedCard)||void 0===n||!n.needCVV),showPaymentMethodListWhenSingleOption:"list"===(null==t?void 0:t.singleOption)};if(!e)return t?{displaySetting:i}:void 0;var a,s={};if(e.theme&&(s.theme=e.theme),e.variables&&"object"===Xe()(e.variables)){var l=v()({},e.variables);Object.keys(l).length>0&&(s.variables=l)}(s.displaySetting=v()(v()({showCardBrandIcon:!(null===(r=e.card)||void 0===r||!r.showBrandIcon)},i),{},{showRadioWhenAccordionLayout:!(null===(o=e.accordion)||void 0===o||!o.showRadio)}),e.layout)&&(s.layout=(null===(a=e.layout.type)||void 0===a?void 0:a.toLowerCase())||"accordion");return s}var fv=["onStatusChange"],vv=["onBeforeConfirm"],gv="7982",yv=function(e){if(null!=e&&e.clientId)return e.clientId;try{var t=Wm(null==e?void 0:e.extendInfo,{}),n=null==t?void 0:t.merchantId;return n&&"string"==typeof n?decodeURIComponent(n):""}catch(e){return""}},_v=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};try{gc.log(v()({code:"".concat(gv,"api"),msg:e,m1:t,merchant_id:n},r))}catch(e){}},bv=function(e,t){var n,r,o={};if("submitPayment"===e)o.d1=(null==t?void 0:t.status)||"",o.d2=(null==t||null===(n=t.error)||void 0===n?void 0:n.code)||"",null!=t&&null!==(r=t.error)&&void 0!==r&&r.traceId&&(o.d3=t.error.traceId),null!=t&&t.userCanceled3D&&(o.d5="true");else if("mount"===e){var i,a;o.d1=null!=t&&t.error?"fail":"success",o.d2=(null==t||null===(i=t.error)||void 0===i?void 0:i.code)||"",null!=t&&null!==(a=t.error)&&void 0!==a&&a.traceId&&(o.d3=t.error.traceId)}else"validateFields"===e&&(o.d1=null!=t&&t.isValid?"valid":"invalid");return o},Ev=function(e,t){var n,r,o={};if(!t)return o;if("submitPayment"===e)o.d6=String(!!t.handleActions),o.d7=null!==(n=t.amount)&&void 0!==n?n:"",o.d8=null!==(r=t.currency)&&void 0!==r?r:"",o.d9=t.shippingInfo?"true":"false";else if("mount"===e){var i,a,s,l,c,u,d,p,h,m,f;o.d6=null!==(i=null===(a=t.renderOptions)||void 0===a?void 0:a.type)&&void 0!==i?i:"",o.d7=String(!(null===(s=t.renderOptions)||void 0===s||!s.notRedirectAfterComplete)),o.d8=null!==(l=null===(c=t.renderOptions)||void 0===c||null===(c=c.appearance)||void 0===c?void 0:c.theme)&&void 0!==l?l:"",o.d9=null!==(u=null===(d=t.renderOptions)||void 0===d||null===(d=d.appearance)||void 0===d||null===(d=d.layout)||void 0===d?void 0:d.type)&&void 0!==u?u:"",o.d10=null!==(p=t.sdkSelector)&&void 0!==p?p:"";var v=null===(h=t.renderOptions)||void 0===h?void 0:h.merchantAppointParam;o.d11=null!==(m=null==v?void 0:v.singleOption)&&void 0!==m?m:"",o.d12=null!=(null==v||null===(f=v.storedCard)||void 0===f?void 0:f.needCVV)?String(v.storedCard.needCVV):""}return o},Sv=function(){var e=u()(l()().mark((function e(t,n,r,o,i){var a,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=Date.now(),e.prev=1,e.next=4,n();case 4:return s=e.sent,_v(t,Date.now()-a,i,v()(v()(v()({},o),bv(t,s)),null==r?void 0:r(!1))),e.abrupt("return",s);case 9:throw e.prev=9,e.t0=e.catch(1),_v(t,Date.now()-a,i,v()(v()({},o),{},{d1:"error",d2:(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"UNKNOWN"},null==r?void 0:r(!0))),e.t0;case 13:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(t,n,r,o,i){return e.apply(this,arguments)}}(),Av=function(e){var t=null==e?void 0:e.response;if(!1===(null==t?void 0:t.success))return t;throw e},kv=16e3,Tv=new Ha(Fa,!0),Pv="Element already destroyed",wv=function(){return{code:ge.UI_STATE_ERROR.code,message:Pv}},Iv=function(e){S()(n,e);var t=k()(n);function n(e,r){return b()(this,n),t.call(this,e,r)}return y()(n,[{key:"setTarget",value:function(e){_h()(Eh()(n.prototype),"setTarget",this).call(this,e)}},{key:"setDebugCallback",value:function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];(e=_h()(Eh()(n.prototype),"setDebugCallback",this)).call.apply(e,[this].concat(r))}}],[{key:"getGlobalBridge",value:function(e){return _h()(Eh()(n),"getGlobalBridge",this).call(this,e)}}]),n}(pc),Cv="OPENSDK@VALIDATE",Rv="OPENSDK@VALIDATE_REPLY",Nv="OPENSDK@SHOWTOAST",Ov="OPENSDK@GET_APPLE_PAY_TOKEN",Dv="OPENSDK@GET_APPLE_PAY_TOKEN_REPLY",Lv="OPENSDK@GET_GOOGLE_PAY_TOKEN",Mv="OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY",xv="OPENSDK@HANDLE_PAYMENT",Uv="OPENSDK@BEFORE_CONFIRM",Bv="OPENSDK@BEFORE_CONFIRM_REPLY",Kv="paymentMethodChanged",Hv=function(){function e(t){var n=t.onStatusChange,r=mc()(t,fv);if(b()(this,e),p()(this,"options",void 0),p()(this,"onStatusChange",void 0),p()(this,"scopeId","payment_".concat(ze().replace(/-/g,"").slice(0,6))),p()(this,"bridge",void 0),p()(this,"iframe",null),p()(this,"status","initialized"),p()(this,"cachedSend",[]),p()(this,"modalBridge",null),p()(this,"modalDestroy",null),p()(this,"modalIframe",null),p()(this,"notRedirectAfterComplete",!1),p()(this,"_sdkInitTime",Date.now()),p()(this,"_mountStartTime",0),p()(this,"destroyCallbacks",[]),p()(this,"_merchantAmount",null),p()(this,"_merchantCurrency",null),p()(this,"currentPaymentMethodType",""),p()(this,"isSubmitting",!1),p()(this,"merchantId",""),this.options=r,this.onStatusChange=n,r.sessionData){var o=$p(r.sessionData);gc.setTrackId(o)}this.bridge=new Iv("HOST",this.scopeId),this.bridge.setDebugCallback((function(e,t){var n,r;e.type.endsWith(Fl)||e.type.endsWith(ic)||(e.type.endsWith(Xl)?Lh(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message):e.type.endsWith(Jl)&&"IN"===t?Mh(e.payload):Lh("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload))}))}var t,n,r,o,i,a,s,c,d;return y()(e,[{key:"track",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{var r="".concat(gv).concat("error"===e?"":e);gc.log(v()({code:r,msg:t,merchant_id:this.merchantId},n))}catch(e){}}},{key:"trackMount",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.track("mount",e,t)}},{key:"trackHandshake",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.track("handshake",e,t)}},{key:"trackElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.track("element",e,t)}},{key:"trackError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.track("error",e,t)}},{key:"mount",value:(d=u()(l()().mark((function e(t,n){var r=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{this.merchantId=yv(Wh(this.options.sessionData,"ELEMENT_PAYMENT"))}catch(e){}return e.abrupt("return",Sv("mount",(function(){return r.doMount(t,n)}),void 0,Ev("mount",{renderOptions:t,sdkSelector:n}),this.merchantId));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"doMount",value:(c=u()(l()().mark((function e(t,n){var r,o,i,a,s,c,u,d,p,h,m,f,v,g,y,_,b,E,S;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.trackMount("mount_start",{d1:n,d2:this.options.sessionData?"has_session":"no_session"}),i=document.querySelector(n)){e.next=6;break}return this.trackError("selector_not_found",{d1:n}),null===(a=this.options)||void 0===a||null===(s=a.onEventCallback)||void 0===s||s.call(a,{code:K.SDK_CREATE_COMPONENT_ERROR,message:"Element with selector ".concat(n," not found.")}),e.abrupt("return",{error:{code:"PARAM_INVALID",message:"selector not found"}});case 6:null===(r=this.options.loading)||void 0===r||null===(o=r.onStartLoading)||void 0===o||o.call(r),this.setStatus("mounting"),e.prev=8,d=this.buildIframeUrl(),this.iframe=document.createElement("iframe"),this.iframe.style.width="100%",this.iframe.style.border="none",this.iframe.style.height="0",this.iframe.style.transition="height 0.3s ease",this.iframe.allow="payment";try{(p=new URL(d).origin)&&"null"!==p&&this.bridge.setOrigin(p)}catch(e){}return this.bindBridgeEvents(),h=this.waitForReadyHandshake(),this.iframe.src=d,i.appendChild(this.iframe),this.trackMount("iframe_loaded",{d1:d}),e.next=24,Promise.all([this.setup(t),h]);case 24:if(m=e.sent,f=ot()(m,1),v=f[0],"destroyed"!==this.status){e.next=29;break}throw wv();case 29:return(g=this.validateRenderData(v.renderData,v.renderDataError))&&(v.renderDataError=g,this.trackError("render_data_invalid",{d1:g.code,d2:g.reason})),this.setStatus("mounted"),this.sendHandshake(v),e.next=35,this.waitForHandshakeAck();case 35:if(this.setStatus("ready"),this.flushCachedMessages(),null===(c=this.options.loading)||void 0===c||null===(u=c.onEndLoading)||void 0===u||u.call(c),!g){e.next=40;break}return e.abrupt("return",{error:g});case 40:return this.trackMount("mount_success",{m1:this._mountStartTime?Date.now()-this._mountStartTime:0}),e.abrupt("return",{});case 44:if(e.prev=44,e.t0=e.catch(8),null===(y=this.options.loading)||void 0===y||null===(_=y.onEndLoading)||void 0===_||_.call(y),l=e.t0,A=void 0,(A=l).code!==ge.UI_STATE_ERROR.code||A.message!==Pv){e.next=49;break}return e.abrupt("return",{error:e.t0});case 49:return this.trackError("mount_error",{d1:(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"UNKNOWN",d2:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||""}),this.cleanup(),S={code:e.t0.code||"UNKNOWN",message:e.t0.message||""},null===(b=this.options)||void 0===b||null===(E=b.onEventCallback)||void 0===E||E.call(b,S),e.abrupt("return",{error:S});case 54:case"end":return e.stop()}var l,A}),e,this,[[8,44]])}))),function(e,t){return c.apply(this,arguments)})},{key:"setup",value:(s=u()(l()().mark((function e(t){var n,r,o,i,a,s,c,u,d,p,h,m,f,g,y,_,b,E,S,A,k,T,P,w,I,C,R=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._mountStartTime=Date.now(),this.trackMount("setup_start"),this.notRedirectAfterComplete=t.notRedirectAfterComplete||!1,i=this.options.sessionData,a=Wh(i,"ELEMENT_PAYMENT"),s="sandbox"===this.options.environment?"sandbox":"prod",this.options.environment,dh.setGlobalOptions(v()(v()({hostSign:eh(i),env:s},pl()),{},{sdkVersion:"0.0.1787898127-dev.2",tracker:gc})),c=!(null==a||null===(n=a.connectFactor)||void 0===n||!n.enableConnect),u=Uf(c,null==a?void 0:a.extendInfo),d=null==a?void 0:a.paymentSessionConfig,p=function(){var e;return om(pm({extParams:{isUserPreferredLocale:!0},merchantAppointParam:null!==(e=t.merchantAppointParam)&&void 0!==e&&e.storedCard?t.merchantAppointParam:void 0,notRedirectAfterComplete:R.notRedirectAfterComplete,paymentSessionConfig:null==a?void 0:a.paymentSessionConfig,paymentSessionData:i},{envInfo:{locale:R.options.locale}}).catch(Av))},h=function(){return om(um({paymentSessionConfig:d,paymentSessionData:i,accountInfo:{email:""}}))},m=u?[p(),h()]:[p(),void 0],f=function(){},g=new Promise((function(e,t){f=R.onDestroy((function(){return t(wv())}))})),y=Promise.all(m),e.next=19,Promise.race([y,g]).finally(f);case 19:return _=e.sent,b=ot()(_,2),E=b[0],S=b[1],E.error&&this.trackHandshake("sdk_query_failed",{d1:(null===(A=E.error)||void 0===A?void 0:A.code)||"",d2:(null===(k=E.error)||void 0===k?void 0:k.message)||""}),u&&null!=S&&S.error&&this.trackHandshake("one_account_query_failed",{d1:(null===(T=S.error)||void 0===T?void 0:T.code)||"",d2:(null===(P=S.error)||void 0===P?void 0:P.message)||""}),w=hl(E.data),I=w||this.options.locale,C=E.error||(null==S?void 0:S.error),e.abrupt("return",{sdkTiming:{sdkInitTime:this._sdkInitTime,mountStartTime:this._mountStartTime},sessionData:i,renderData:E.data,renderDataError:C,connectAccount:null==S?void 0:S.data,sessionMetaData:a,merchantDomain:window.location.hostname,doMain:window.location.hostname,appearance:mv((null==t?void 0:t.appearance)||this.options.appearance,t.merchantAppointParam),logMetaData:{paymentMethodCategoryType:null==d?void 0:d.paymentMethodCategoryType,productSceneVersion:null==d?void 0:d.productSceneVersion,trackId:$p(i),merchantId:this.merchantId,paymentMethodType:null==a||null===(r=a.paymentMethodInfoView)||void 0===r?void 0:r.paymentMethodType},heightOfVisible:Math.max(window.changingPageHeight||0,window.innerHeight),locale:I,sdkVersion:"0.0.1787898127-dev.2",merchantId:(null==E||null===(o=E.data)||void 0===o?void 0:o.merchantId)||"",env:s,_requestConfig:v()({env:s},pl())});case 29:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"getLegacySdkQueryError",value:function(e){var t=e.errorCode,n=e.errorMessage,r=e.traceId,o=e.reason;if(!t)return{source:"SDK_INTERNAL",code:ge.ERR_DATA_STRUCT_UNRECOGNIZED.code,message:ge.ERR_DATA_STRUCT_UNRECOGNIZED.message,reason:o,traceId:null!=r?r:""};var i=Be[t];return{source:"SDK_INTERNAL",code:(null==i?void 0:i.code)||t,message:(null==i?void 0:i.message)||n||ge.ERR_DATA_STRUCT_UNRECOGNIZED.message,reason:o,traceId:null!=r?r:""}}},{key:"validateRenderData",value:function(e,t){var n;if(t||!e)return{source:"SDK_INTERNAL",code:ge.INITIALIZE_TIMEOUT.API.code,message:ge.INITIALIZE_TIMEOUT.API.message,reason:t?"query request failed: errorCode=".concat(t.code):"renderData is empty",traceId:null!==(n=null==t?void 0:t.traceId)&&void 0!==n?n:""};var r=e.success,o=e.paymentMethods,i=e.savedPaymentMethods,a=e.orderAmountView,s=e.paymentAmountView,l=Boolean(o&&Array.isArray(o)&&o.length>0||i&&Array.isArray(i)&&i.length>0),c=!!a&&!!s;if(!r){var u=e,d=u.traceId,p=u.errorCode,h=u.errorMessage;return this.getLegacySdkQueryError({errorCode:p,errorMessage:h,traceId:d,reason:p?"sdkAction.query failed: errorCode=".concat(p):"sdkAction.query failed without errorCode"})}return l&&c?void 0:{source:"SDK_INTERNAL",code:ge.ERR_DATA_STRUCT_UNRECOGNIZED.code,message:ge.ERR_DATA_STRUCT_UNRECOGNIZED.message,reason:"Data structure validation failed: success=".concat(r,", hasValidPaymentMethods=").concat(l,", hasAmountViews=").concat(c),traceId:""}}},{key:"bindBridgeEvents",value:function(){var e=this;this.bridge.on(ic,(function(t){e.iframe&&(e.iframe.style.height="".concat(t,"px"))})),this.bridge.on(Nv,(function(t,n,r){var o,i;r&&r.source!==(null===(o=e.iframe)||void 0===o?void 0:o.contentWindow)&&r.source!==(null===(i=e.modalIframe)||void 0===i?void 0:i.contentWindow)||function(e){if(null!=e&&e.message){var t=v()(v()({},em),e),n=document.getElementById(rm);n?n.innerHTML="":((n=document.createElement("div")).id=rm,Object.assign(n.style,{position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none"}),document.body.appendChild(n)),n.style.top="",n.style.right="",n.style.bottom="",n.style.left="",n.style.zIndex=String(t.zIndex),Object.assign(n.style,tm[t.position]);var r=document.createElement("div");if(Object.assign(r.style,{backgroundColor:t.backgroundColor,color:t.color,padding:t.padding,borderRadius:t.borderRadius,fontSize:t.fontSize,opacity:"0",transition:"opacity ".concat(300,"ms ease-in-out"),display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",width:t.width,boxSizing:"border-box"}),t.icon){var o=document.createElement("img");Object.assign(o.style,{width:"40px",height:"40px"}),o.src=nm[t.icon],r.appendChild(o)}var i=document.createElement("span");Object.assign(i.style,{textAlign:"center",marginTop:"12px",lineHeight:"20px",fontFamily:"Noto Sans",fontWeight:"400",fontSize:"14px"}),i.textContent=t.message,r.appendChild(i),n.appendChild(r),setTimeout((function(){r.style.opacity="1"}),10),setTimeout((function(){r.style.opacity="0",setTimeout((function(){n.remove()}),300)}),t.duration)}}(t)})),this.bridge.on(zl,(function(t,n,r){var o,i;if(!r||r.source===(null===(o=e.iframe)||void 0===o?void 0:o.contentWindow)||r.source===(null===(i=e.modalIframe)||void 0===i?void 0:i.contentWindow)){var a=t.url,s=t.mode,l=t.appLinkUrl,c=t.schemaUrl,u=t.destroy;e.trackElement("redirect",{d1:s||"redirect",d2:l?"app_link":c?"schema":"url",d3:a||"",d4:l||"",d5:c||"",d6:u?"1":"0"}),u&&e.destroy();try{if(l||c)new tl({resultJudgmentTime:2e3,fallback:function(){e.trackElement("redirect_fallback",{d1:"callapp_failed",d2:a||""}),d()}}).open({scheme:c,link:l});else d()}catch(t){e.trackError("redirect_error",{d1:"callapp_exception",d2:(null==t?void 0:t.message)||"",d3:a||""}),d()}}function d(){"replace"===s?window.location.replace(a):window.location.href=a}})),this.bridge.on(Vl,(function(t,n,r){var o;r&&r.source!==(null===(o=e.iframe)||void 0===o?void 0:o.contentWindow)||(e.handleOpenModal(t),e.bridge.once(ql,(function(){e.handleCloseModal()})))})),this.bridge.on(sc,(function(t,n,r){var o;r&&r.source!==(null===(o=e.iframe)||void 0===o?void 0:o.contentWindow)||e.destroy()})),this.bridge.on(xv,(function(){e.handleHandlePayment()})),this.bridge.on(Kv,(function(t){e.currentPaymentMethodType=(null==t?void 0:t.type)||""}))}},{key:"handleGetApplePayToken",value:(a=u()(l()().mark((function e(t,n){var r,o,i,a,s,c,d,p,h,m,f,g,y,_,b,E,S,A,k=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.options.sessionData,i=null==t||null===(r=t.paymentMethod)||void 0===r||null===(r=r.paymentMethodDetail)||void 0===r?void 0:r.applePayProps,a=null==i?void 0:i.paymentRequest,this.trackElement("applepay_token_request",{d1:a?"has_payment_request":"no_payment_request"}),a){e.next=8;break}return this.trackError("applepay_token_missing_data",{d1:"MISSING_DATA"}),this.bridge.send(Dv,{success:!1,result:{errorCode:"APPLE_PAY_MISSING_DATA"}}),e.abrupt("return");case 8:return s=a.merchantCapabilities,c=a.merchantInfo,d=a.paymentAmount,p=a.supportedNetworks,h=a.version,m=a.requiredBillingContactFields,f=a.requiredShippingContactFields,g=null==d?void 0:d.value,y=null==d?void 0:d.currency,this._merchantAmount&&(g=this._merchantAmount),this._merchantCurrency&&(y=this._merchantCurrency),b=Em(o,c,{value:g,currency:y}),E=new ym({paymentRequest:v()({countryCode:null==c?void 0:c.countryCode,currencyCode:y,merchantCapabilities:s,supportedNetworks:p,requiredBillingContactFields:m,requiredShippingContactFields:f,total:b?{type:"final",label:b.regularBilling.label,amount:g}:{type:"final",label:(null==c?void 0:c.merchantName)||"Payment",amount:g},version:b?14:h},b?{lineItems:[b.regularBilling],recurringPaymentRequest:b}:{}),enableModalCloseListener:!0,callbacks:{validateMerchant:function(){var e=u()(l()().mark((function e(t){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k.trackElement("applepay_validate_start",{d1:"merchant_validate"}),e.next=3,Ea(o,{validateUrl:t,paymentSessionData:o,merchantDomain:window.location.hostname},{env:k.options.environment,envInfo:{deviceId:""}},Tv);case 3:if(null==(n=e.sent)||!n.success||!n.merchantSessionObject){e.next=7;break}return k.trackElement("applepay_validate_success",{d1:"got_session"}),e.abrupt("return","string"==typeof n.merchantSessionObject?JSON.parse(n.merchantSessionObject):n.merchantSessionObject);case 7:throw k.trackError("applepay_merchant_validate_failed",{d1:"VALIDATION_FAILED",d2:(null==n?void 0:n.errorMessage)||"Merchant validation failed"}),{errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"};case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),onAuthorized:function(){var e=u()(l()().mark((function e(t){var r,o,i,a,s,c,u,d;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.token,o=t.billingContact,i=t.shippingContact,!n){e.next=18;break}return e.prev=2,a=Date.now(),e.next=6,Za((function(){return n()}));case 6:if(s=e.sent,c=s.result,u=s.timedOut,d=!u&&!!c&&Date.now()-a<Wa,(u||Date.now()-a>=Wa)&&k.trackError("sdk_before_confirm_timeout",{d1:"applePay_chrome_modern"}),d){e.next=13;break}return e.abrupt("return",{success:!1,errorCode:"MERCHANT_CONFIRM_ABORT"});case 13:e.next=18;break;case 15:return e.prev=15,e.t0=e.catch(2),e.abrupt("return",{success:!1,errorCode:"MERCHANT_CONFIRM_ABORT"});case 18:return _={token:r,billingContact:o,shippingContact:i},k.trackElement("applepay_authorized",{d1:r?"has_token":"no_token"}),e.abrupt("return",{success:!0,result:_});case 21:case"end":return e.stop()}}),e,null,[[2,15]])})));return function(t){return e.apply(this,arguments)}}()}}),e.prev=15,e.next=18,E.startPay();case 18:this.trackElement("applepay_token_success",{d1:null!==(S=_)&&void 0!==S&&S.token?"has_token":"no_token"}),this.bridge.send(Dv,{success:!0,result:_}),e.next=26;break;case 22:e.prev=22,e.t0=e.catch(15),"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"!==(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)&&("APPLE_PAY_CANCEL"===(A=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED")?this.trackElement("applepay_cancel",{d1:"user_cancel"}):this.trackError("applepay_token_failed",{d1:A,d2:(null===e.t0||void 0===e.t0?void 0:e.t0.errorMessage)||""})),this.bridge.send(Dv,{success:!1,result:{errorCode:(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED"}});case 26:case"end":return e.stop()}}),e,this,[[15,22]])}))),function(e,t){return a.apply(this,arguments)})},{key:"handleGetGooglePayToken",value:function(e){var t,n,r=this,o=null==e?void 0:e.data,i=null==o||null===(t=o.paymentMethodDetail)||void 0===t?void 0:t.googlePayProps,a=(null==o?void 0:o.environment)||(null==i?void 0:i.environment)||"TEST",s=(null==o?void 0:o.paymentRequest)||(null==i?void 0:i.paymentRequest)||{};if(this.trackElement("googlepay_token_request",{d1:a,d2:s?"has_payment_request":"no_payment_request"}),!s||!Object.keys(s).length)return this.trackError("googlepay_token_missing_data",{d1:"MISSING_DATA"}),void this.bridge.send(Mv,{success:!1,err:{statusCode:"GOOGLE_PAY_PAYMENT_FAILED"}});var l=function(){var e=new window.google.payments.api.PaymentsClient({environment:a,paymentDataCallbacks:{onPaymentAuthorized:function(){return{transactionState:"SUCCESS"}}}});e.isReadyToPay(s).then((function(t){if(t.result)return e.loadPaymentData(s);throw{statusCode:"GOOGLE_PAY_NOT_SUPPORTED"}})).then((function(e){e&&(r.trackElement("googlepay_token_success",{d1:"has_token"}),r.bridge.send(Mv,{success:!0,result:e}))})).catch((function(e){var t=(null==e?void 0:e.statusCode)||"GOOGLE_PAY_PAYMENT_FAILED";"CANCELED"===t?r.trackElement("googlepay_cancel",{d1:"user_cancel"}):r.trackError("googlepay_token_failed",{d1:t,d2:(null==e?void 0:e.statusMessage)||""}),r.bridge.send(Mv,{success:!1,err:v()({statusCode:t},e)})}))};if(null!==(n=window.google)&&void 0!==n&&null!==(n=n.payments)&&void 0!==n&&null!==(n=n.api)&&void 0!==n&&n.PaymentsClient)l();else{var c=document.createElement("script");c.src="https://pay.google.com/gp/p/js/pay.js",c.async=!0,document.body.appendChild!==Node.prototype.appendChild?Node.prototype.appendChild.call(document.body,c):document.body.appendChild(c),c.onload=function(){l()},c.onerror=function(){r.trackError("googlepay_script_load_failed",{d1:"script_error"}),r.bridge.send(Mv,{success:!1,err:{statusCode:"GOOGLE_PAY_NOT_SUPPORTED"}})}}}},{key:"handleHandlePayment",value:function(){var e=this.options.sessionData,t=mh(e);this.trackElement("handle_payment",{d1:"skipRender_applepay_publish"}),t||this.trackError("handle_payment_meta_failed",{d1:"meta_parse_failed"}),Qe.publish(new We(Pn.createComponent,JSON.stringify({appendParams:{iframeNodesParams:{sessionData:e,paymentSessionMetaData:t}},options:{environment:this.options.environment,locale:this.options.locale}})))}},{key:"handleBeforeConfirmInternal",value:function(e){var t=this;if(!e)return Tv.logInfo({title:"sdk_before_confirm_skip"},{path:"modernController_bridge"}),void this.bridge.send(Bv,{success:!0,result:!0});Tv.logInfo({title:"sdk_before_confirm_start"},{path:"modernController_bridge"});var n=Date.now();Za((function(){return e()})).then((function(e){var r=e.result,o=e.timedOut,i=!o&&!!r&&Date.now()-n<Wa;(o||Date.now()-n>=Wa)&&Tv.logError({title:"sdk_before_confirm_timeout"}),Tv.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:i}),t.bridge.send(Bv,{success:!0,result:!!i})})).catch((function(e){Tv.logError({title:"sdk_before_confirm_error"},{errorMessage:String((null==e?void 0:e.message)||e).slice(0,200),path:"modernController_bridge"}),t.bridge.send(Bv,{success:!1,result:!1})}))}},{key:"waitForReadyHandshake",value:function(){var e=this;return new Promise((function(t,n){var r=function(){},o=setTimeout((function(){r(),e.trackError("ready_handshake_timeout",{d1:String(kv)}),n({code:"INITIALIZE_WEB_TIMEOUT",message:"An error occurred; the transaction cannot be initiated."})}),kv);r=e.onDestroy((function(){clearTimeout(o),n(wv())})),e.bridge.once(Hl,(function(){var i;if(clearTimeout(o),r(),null===(i=e.iframe)||void 0===i||!i.contentWindow)return e.trackError("iframe_contentwindow_unavailable",{d1:"after_ready_handshake"}),void n({code:"SDK_LAUNCH_PAYMENT_APP_ERROR",message:"Iframe contentWindow not available"});e.bridge.setTarget(e.iframe.contentWindow),e.trackHandshake("ready_handshake_received",{m1:e._mountStartTime?Date.now()-e._mountStartTime:0}),t()}))}))}},{key:"sendHandshake",value:function(e){this.bridge.send(Kl,e),this.trackHandshake("handshake_sent",{d1:(null==e?void 0:e.sdkVersion)||""})}},{key:"waitForHandshakeAck",value:function(){var e=this;return new Promise((function(t,n){var r=function(){},o=setTimeout((function(){r(),e.trackError("handshake_ack_timeout",{d1:String(kv)}),n({code:"INITIALIZE_WEB_TIMEOUT",message:"An error occurred; the transaction cannot be initiated."})}),kv);r=e.onDestroy((function(){clearTimeout(o),n(wv())})),e.bridge.once(Ql,(function(){clearTimeout(o),r(),e.trackHandshake("handshake_ack_received",{m1:e._mountStartTime?Date.now()-e._mountStartTime:0}),t()}))}))}},{key:"submitPayment",value:(i=u()(l()().mark((function e(t){var n=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Sv("submitPayment",(function(){return n.doSubmitPayment(t)}),(function(){return n.currentPaymentMethodType?{d4:n.currentPaymentMethodType}:{}}),Ev("submitPayment",t),this.merchantId));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"doSubmitPayment",value:(o=u()(l()().mark((function e(t){var n,r,o,i,a,s,c,u,d,p,h,m,f,g,y,_,b,E,S,A=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ready"===this.status){e.next=3;break}return this.trackError("submit_not_ready",{d1:this.status}),e.abrupt("return",{status:"FAIL",error:{code:"UI_STATE_ERROR",message:"not ready"}});case 3:if(!this.isSubmitting){e.next=6;break}return this.trackError("submit_in_progress",{}),e.abrupt("return",{status:"FAIL",error:{code:"UI_STATE_ERROR",message:"submit already in progress"}});case 6:if(this.isSubmitting=!0,e.prev=7,o="APPLEPAY"===this.currentPaymentMethodType,a=(i=t||{}).onBeforeConfirm,s=mc()(i,vv),!a||o){e.next=31;break}return Tv.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}),e.prev=12,c=Date.now(),e.next=16,Za((function(){return a()}));case 16:if(u=e.sent,d=u.result,!((p=u.timedOut)||!d||Date.now()-c>=Wa)){e.next=22;break}return p?Tv.logError({title:"sdk_before_confirm_timeout"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}):Tv.logInfo({title:"sdk_before_confirm_abort"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}),e.abrupt("return",{status:"FAIL",error:{code:"MERCHANT_CONFIRM_ABORT",message:"Merchant canceled payment."}});case 22:Tv.logInfo({title:"sdk_before_confirm_success"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}),e.next=29;break;case 25:return e.prev=25,e.t0=e.catch(12),Tv.logError({title:"sdk_before_confirm_error"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",errorMessage:String((null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0).slice(0,200),path:"nonApplePay_sync"}),e.abrupt("return",{status:"FAIL",error:{code:"MERCHANT_CONFIRM_ABORT",message:"Merchant canceled payment."}});case 29:e.next=32;break;case 31:a||Tv.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:o?"applePay_eventBridge":"nonApplePay_sync"});case 32:return h=o&&!!a,m=!(null==s||!s.amount),f=!(null==s||!s.currency),!m&&!f||m&&f||Tv.logError({title:"sdk_element_submitPayment_amountCurrencyMismatch"},{amount:null==s?void 0:s.amount,currency:null==s?void 0:s.currency,reason:"amount and currency must be provided together, both ignored"}),this._merchantAmount=m&&f?s.amount:null,this._merchantCurrency=m&&f?s.currency:null,null===(n=this.options.loading)||void 0===n||null===(r=n.onStartLoading)||void 0===r||r.call(n),this.trackElement("submit_start",{d1:this.notRedirectAfterComplete?"if_required":"always"}),g=[],e.prev=41,_=new Promise((function(e){g.push(A.bridge.once(Ov,(function(e){A.handleGetApplePayToken(e,a).then((function(){}))}))),g.push(A.bridge.once(Lv,(function(e){A.handleGetGooglePayToken(e)}))),g.push(A.bridge.once(Uv,(function(){A.handleBeforeConfirmInternal(a||null)}))),g.push(A.bridge.once(Gl,e))})),this.send(jl,v()(v()({},s),{},{redirect:this.notRedirectAfterComplete?"if_required":"always",hasBeforeConfirm:h},m&&f?{amount:s.amount,currency:s.currency}:{})),e.next=46,_;case 46:return b=e.sent,this.trackElement("submit_reply",{d1:(null==b?void 0:b.status)||"",d2:(null==b||null===(y=b.error)||void 0===y?void 0:y.code)||""}),e.abrupt("return",hv(b));case 51:throw e.prev=51,e.t1=e.catch(41),this.trackError("submit_error",{d1:(null===e.t1||void 0===e.t1?void 0:e.t1.code)||"UNKNOWN",d2:(null===e.t1||void 0===e.t1?void 0:e.t1.message)||""}),e.t1;case 55:return e.prev=55,g.forEach((function(e){try{e()}catch(e){}})),null===(E=this.options.loading)||void 0===E||null===(S=E.onEndLoading)||void 0===S||S.call(E),e.finish(55);case 59:return e.prev=59,this.isSubmitting=!1,e.finish(59);case 62:case"end":return e.stop()}}),e,this,[[7,,59,62],[12,25],[41,51,55,59]])}))),function(e){return o.apply(this,arguments)})},{key:"validateFields",value:(r=u()(l()().mark((function e(){var t=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Sv("validateFields",(function(){return t.doValidateFields()}),void 0,void 0,this.merchantId));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"doValidateFields",value:(n=u()(l()().mark((function e(){var t=this;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ready"===this.status){e.next=3;break}return this.trackError("validate_not_ready",{d1:this.status}),e.abrupt("return",{isValid:!1});case 3:return this.send(Cv),e.abrupt("return",new Promise((function(e){var n=setTimeout((function(){t.trackError("validate_fields_timeout",{d1:"15000"}),e({isValid:!1})}),15e3);t.bridge.once(Rv,(function(r){clearTimeout(n);var o=!(null==r||!r.isValid);t.trackElement("validate_result",{d1:o?"valid":"invalid"}),e(r||{isValid:!1})}))})));case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"updatePayment",value:(t=u()(l()().mark((function e(t){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!1);case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"on",value:function(e,t){this.bridge.on(e,t)}},{key:"destroy",value:function(){var e;this.trackElement("destroy",{d1:this.status}),"initialized"!==this.status&&"destroyed"!==this.status&&(this.handleCloseModal(),this.bridge.destroy(),null!==(e=this.iframe)&&void 0!==e&&e.parentNode&&this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,this.setStatus("destroyed"),this.runDestroyCallbacks(),this.cachedSend=[])}},{key:"cleanup",value:function(){var e;null!==(e=this.iframe)&&void 0!==e&&e.parentNode&&this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,this.setStatus("initialized"),this.cachedSend=[]}},{key:"setStatus",value:function(e){var t;if("destroyed"!==this.status&&e!==this.status){var n=this.status;this.status=e,null===(t=this.onStatusChange)||void 0===t||t.call(this,e,n)}}},{key:"onDestroy",value:function(e){var t=this;return"destroyed"===this.status?(e(),function(){}):(this.destroyCallbacks.push(e),function(){t.destroyCallbacks=t.destroyCallbacks.filter((function(t){return t!==e}))})}},{key:"runDestroyCallbacks",value:function(){var e=this.destroyCallbacks;this.destroyCallbacks=[],e.forEach((function(e){return e()}))}},{key:"send",value:function(e,t){"destroyed"!==this.status&&("ready"===this.status?this.bridge.send(e,t):this.cachedSend.push({type:e,payload:t}))}},{key:"flushCachedMessages",value:function(){var e=this;this.cachedSend.length>0&&(this.cachedSend.forEach((function(t){var n=t.type,r=t.payload;e.bridge.send(n,r)})),this.cachedSend=[])}},{key:"handleOpenModal",value:function(e){var t,n,r,o=this;this.handleCloseModal();var i=bt?"mobile":"desktop";this.trackElement("open_modal",{d1:i,d2:(null==e?void 0:e.modalId)||""});try{var a=new URL(e.url);e.closeConfirm&&a.searchParams.append("confirm","true"),e.url=a.toString()}catch(t){var s=new fl("Invalid URL","INVALID_MODAL_URL","APP_RUNTIME");return this.trackError("open_modal_invalid_url",{d1:"INVALID_MODAL_URL",d2:(null==e?void 0:e.url)||""}),void this.bridge.send(Wl,s)}var l=this.modalBridge=Iv.getGlobalBridge("HOST"),c=new MessageChannel;this.bridge.send(ec,e.modalId,[c.port1]);var u=(null==e||null===(t=e.appearance)||void 0===t?void 0:t.theme)||"default",d=null!==(n=Vh[u])&&void 0!==n?n:Vh.default,p={theme:d.theme,backgroundColor:(null==e||null===(r=e.appearance)||void 0===r||null===(r=r.variables)||void 0===r?void 0:r["background-primary"])||d.backgroundColor},h=$h(v()(v()({},e),{},{mode:i,loadingConfig:p,onClose:function(){if(e.closeConfirm)return new xl(e.modalId,c.port2).close(!0)}})),m=h.iframe,f=h.destroy,g=l.once(tc,(function(t,n,r){if((!r||r.source===m.contentWindow)&&(o.trackElement("modal_loaded",{d1:e.url}),m.contentWindow)){l.setTarget(m.contentWindow);try{var i=new URL(m.src).origin;i&&"null"!==i&&l.setOrigin(i)}catch(e){}e.appearance&&l.send(rc,e.appearance),e.initialData&&l.send(oc,e.initialData),l.send(nc,e.modalId,[c.port2])}}));this.modalIframe=m,this.modalDestroy=function(){e.closeConfirm&&o.trackElement("modal_close_confirm",{d1:"confirm_resolved"}),f(),g(),o.modalIframe=null}}},{key:"handleCloseModal",value:function(){this.trackElement("modal_closed",{d1:this.modalBridge?"with_bridge":"no_bridge"}),this.modalBridge&&(this.modalBridge.destroy(),this.modalBridge=null),this.modalDestroy&&(this.modalDestroy(),this.modalDestroy=null)}},{key:"buildIframeUrl",value:function(){var e=dl("/element_payment/index.html",!0),t=this.options.sessionData?$p(this.options.sessionData):"";return"".concat(e,"?").concat(t?"track_id=".concat(encodeURIComponent(t),"&"):"","_scope_id=").concat(encodeURIComponent(this.scopeId))}}]),e}(),Fv=function(){function e(t){b()(this,e),p()(this,"options",void 0),p()(this,"controller",void 0);var n=function(e){var t,n=[];return e.sessionData||(console.error("sessionData is empty, please check new AMSElement params."),n.push({field:"sessionData",message:"sessionData is empty"})),n.length>0&&(null==e||null===(t=e.onEventCallback)||void 0===t||t.call(e,{code:K.SDK_CREATE_COMPONENT_ERROR,message:"sessionData is empty"})),{isValid:0===n.length,errors:n}}(t);if(!n.isValid)throw new F(n.errors);this.options=function(e){var t=e.environment;return v()(v()({},e),{},{environment:(t||H.PROD).toLocaleLowerCase()})}(t),gh(t.sessionData)?this.controller=new Hv(v()(v()({},this.options),{},{sessionData:vh(this.options.sessionData)})):this.controller=new pv(this.options)}var t;return y()(e,[{key:"updatePayment",value:(t=u()(l()().mark((function e(t){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.controller.updatePayment(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"mount",value:function(e,t){var n;return this.controller.mount(v()({appearance:null==this||null===(n=this.options)||void 0===n?void 0:n.appearance},e),t)}},{key:"validateFields",value:function(){return this.controller.validateFields()}},{key:"submitPayment",value:function(e){return this.controller.submitPayment(e)}},{key:"destroy",value:function(){this.controller.destroy()}},{key:"on",value:function(e,t){this.controller.on(e,t)}}]),e}(),Yv={message:"sdk no need to make query request",success:!0},jv=function(){function e(){b()(this,e),p()(this,"paymentContext",void 0),p()(this,"initConfig",void 0),p()(this,"logger",void 0),p()(this,"eventCenter",void 0),p()(this,"securityService",void 0),p()(this,"instanceId",void 0),p()(this,"componentSign",void 0),p()(this,"hostSign",void 0),p()(this,"_performanceData",[]),p()(this,"SECURITY_SDK_INIT_TIMEOUT",1500)}var t,n,r,o;return y()(e,[{key:"init",value:function(e,t,n){this.initConfig=e,this.instanceId=t,this.logger=Nf.getInstance(this.instanceId).getService("Log"),this.eventCenter=Nf.getInstance(this.instanceId).getService("EventCenter"),this.securityService=Nf.getInstance(this.instanceId).getService("Security"),this._performanceData.push({key:"sdk_init",value:Date.now()})}},{key:"startBizFlow",value:(o=u()(l()().mark((function e(t){var n,r,o,i,a,s,c,u,d,p,h;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.paymentContext=t,this.componentSign=il(null===(n=this.paymentContext)||void 0===n?void 0:n.paymentSessionObj),this.hostSign=((null==t?void 0:t.paymentSession)||"").split("&&")[1]||"",r=this.paymentContext.paymentSessionObj,o=r.action,i=r.authUrlInfo,a=void 0===i?{}:i,this.componentSign!==V.AUTO_DEBIT_WALLET){e.next=9;break}if(u=St()?null==o||null===(s=o.web)||void 0===s?void 0:s.signType:null==o||null===(c=o.wap)||void 0===c?void 0:c.signType,d=(null==o?void 0:o.requireFastSdk)||!1,"REDIRECT"!==u||!0!==d){e.next=9;break}return e.abrupt("return",this.buildRedirectResult(a));case 9:return p=this.buildWebAppUrl(),h={url:p,allowClickPopupOutsideClose:this.componentSign===V.AUTO_DEBIT_WALLET},this.sendRequestAndWaitWebLaunch(),e.abrupt("return",{behaviorType:"RENDER",payload:h});case 13:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"acquireApdidToken",value:(r=u()(l()().mark((function e(){var t,n,r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null===(t=this.paymentContext.paymentSessionObj)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productScene,r=this.securityService.getDeviceId({productScene:n}),e.abrupt("return",r);case 3:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getSdkActionQuery",value:(n=u()(l()().mark((function e(){var t,n,r,o,i,a,s,c,u,d,p,h,m,f,v;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Nf.getInstance(this.instanceId).getService("Requester"),n=this.paymentContext,r=n.paymentSession,o=n.paymentSessionObj,i=this.initConfig,a=i.environment,s=i.locale,u=(c=o||{}).paymentSessionConfig,d=c.action,this.componentSign!==V.AUTO_DEBIT_WALLET){e.next=11;break}if(p=d.web,h=d.wap,"SMS"!==(m=St()?null==p?void 0:p.signType:null==h?void 0:h.signType)){e.next=9;break}return e.abrupt("return",Promise.resolve(Yv));case 9:if(m&&"REDIRECT"===m){e.next=11;break}return e.abrupt("return",Promise.resolve({success:!1}));case 11:if(!Ra()){e.next=13;break}return e.abrupt("return",Promise.resolve(Yv));case 13:return this._performanceData.push({key:"sdk_action_query_start",value:Date.now()}),f={paymentSessionConfig:u,paymentSessionData:r},e.prev=15,e.t0=t,e.t1=f,e.t2=a,e.t3=s,e.next=22,this.acquireApdidToken();case 22:return e.t4=e.sent,e.t5={locale:e.t3,deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"},e.next=28,e.t0.request.call(e.t0,e.t1,e.t7);case 28:return v=e.sent,this._performanceData.push({key:"sdk_action_query_end",value:Date.now()}),this.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{config:JSON.stringify(u),rpcTraceId:v.traceId}),e.abrupt("return",v);case 34:return e.prev=34,e.t8=e.catch(15),this.logger.logError({title:"sdk_event_sdkQuery_failed"},{config:JSON.stringify(u),errorMessage:JSON.stringify(e.t8),rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",Promise.reject());case 38:case"end":return e.stop()}}),e,this,[[15,34]])}))),function(){return n.apply(this,arguments)})},{key:"webLaunchPromise",value:function(){var e=this;return this._performanceData.push({key:"sdk_onLaunch",value:Date.now()}),new Promise((function(t,n){var r=setTimeout((function(){n(new Error("Load resource timeout")),e.eventCenter.dispatchToApp({event:_e.error.name,data:ge.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT}),e.logger.logError({title:"sdk_error_web_app_timeout"})}),Me);e.eventCenter.listen("onLaunch",(function(e){clearTimeout(r),t(e)}))}))}},{key:"sendRequestAndWaitWebLaunch",value:function(){var e=this,t=this.paymentContext||{},n=t.paymentSessionObj,r=void 0===n?{}:n,o=t.paymentSessionId,i=t.displayInfo,a=t.startBizFlowOptions;Promise.all([this.webLaunchPromise(),this.getSdkActionQuery(),this.initSecuritySDK()]).then((function(t){var n,s,l=ot()(t,2),c=(l[0],l[1]);e._performanceData.push({key:"sdk_render_component",value:Date.now()});var u=e.logger.getLogConfig().mdata;e.eventCenter.dispatchToApp({event:"renderComponent",data:{queryResult:c,sessionResult:r,paymentSessionData:o,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:i.type,appearance:null==i?void 0:i.appearance,notRedirectAfterComplete:!0===(null===(n=a.submitPayRequestExtra)||void 0===n?void 0:n.notRedirectAfterComplete),isAppWebview:a.isAppWebview,merchantAppointParam:null===(s=a.submitPayRequestExtra)||void 0===s?void 0:s.merchantAppointParam,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:v()(v()({trackId:u.requestSeq,platform:u.platform,firstLogTime:u.firstLogTime},(null==r?void 0:r.paymentSessionConfig)||{}),{},{renderDisplayType:u.renderDisplayType,sdkVersion:u.sdkVersion,merchantId:u.merchantId,instanceId:u.instanceId,paymentMethodType:u.paymentMethodType})}}),e.logger.logInfo({title:"sdk_event_renderComponent"}),e.eventCenter.dispatchToApp({event:"web-sdk-performance",data:{performanceData:e._performanceData}}),e.setAchAutoDebitContainerWidth()})).catch((function(t){e.eventCenter.emit(_e.destroy.name,{}),e.eventCenter.emit(_e.eventCallback.name,{code:ce.SDK_INTERNAL_ERROR,message:null==t?void 0:t.message})}))}},{key:"buildRedirectResult",value:function(e){return{behaviorType:"REDIRECT",payload:null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{url:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl}:{url:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl}}}},{key:"buildWebAppUrl",value:function(){var e,t,n,r,o=this.paymentContext,i=o.displayInfo,a=o.sdkMetaData,s=o.paymentSessionObj,l=null===(e=s.paymentSessionConfig)||void 0===e?void 0:e.paymentMethodCategoryType,c=null===(t=s.paymentSessionConfig)||void 0===t?void 0:t.productScene,u=null===(n=s.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,d=this.hostSign,p=s.clientId,h=s.extendInfo;return Ut({environment:this.initConfig.environment,paymentMethodCategoryType:l,sdkMetaData:a,productScene:c,productSceneVersion:u,isPreload:!1,query:{analyticsEnabled:null===(r=this.initConfig.analytics)||void 0===r?void 0:r.enabled,displayType:i.type,instanceId:this.instanceId,locale:this.initConfig.locale,hostSign:d},mid:p,extendInfo:h})}},{key:"initSecuritySDK",value:(t=u()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Promise.resolve());case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return t.apply(this,arguments)})},{key:"setAchAutoDebitContainerWidth",value:function(){var e,t,n;this.isTrustly&&((null===(e=this.paymentContext)||void 0===e||null===(e=e.displayInfo)||void 0===e?void 0:e.platform)===oe.desktop&&(null===(t=document.getElementById(Se))||void 0===t||t.setAttribute("style","max-width: 656px"),null===(n=document.getElementById(Ee))||void 0===n||n.setAttribute("style","max-width: 656px")))}},{key:"isTrustly",get:function(){return this.componentSign===V.AUTO_DEBIT_APM}}]),e}();function Gv(e,t){var n,r=!1,o=void 0;if("EASY_PAY"===(null==t||null===(n=t.paymentSessionConfig)||void 0===n?void 0:n.productScene)){var i,a,s,l,c=!(null!==(i=t.action)&&void 0!==i&&i.autoDebitWithToken),u=null===(a=t.needAccountConfirmPage)||void 0===a||a;r=!c||!u,"2.0"===(null==t||null===(s=t.paymentSessionConfig)||void 0===s?void 0:s.productSceneVersion)&&["BANKTRANSFER_QUICKPAY"].includes(null==t||null===(l=t.paymentMethodInfoView)||void 0===l?void 0:l.paymentMethodType)&&(!1,o=function(t){var n=function(e){var t=e.instanceId,n=e.paymentMethodType,r=e.paymentSessionData,o=e.paymentSessionObj,i=e.locale,a=e.env,s=e.sdkVersion,l=e.notRedirectAfterComplete,c=!1,u=Jt(o,a);return"".concat(u)+"?scene=cashierResultPage&"+"instanceId=".concat(t)+"&"+"paymentSessionData=".concat(encodeURIComponent(r))+"&"+"isLandscape=".concat(c?"true":"")+"&"+"pmt=".concat(n)+"&"+"locale=".concat(i)+"&"+"sdkVersion=".concat(s)+"&"+"mode=".concat(lt.SDK)+"&"+"¬RedirectAfterComplete=".concat(l)}(t);return{callBackUrl:n,notRedirectAfterComplete:e}})}return{allowSubmitPayCallAhead:r,buildSubmitPayExtParams:o,createIframeNode:!0,loadApp:!0}}var zv=function(){function e(){b()(this,e),p()(this,"paymentContext",void 0),p()(this,"initConfig",void 0),p()(this,"logger",void 0),p()(this,"securityService",void 0),p()(this,"eventCenter",void 0),p()(this,"instanceId",void 0),p()(this,"hostSign",void 0),p()(this,"allowQueryCall",void 0),p()(this,"allowSubmitPayCallAhead",void 0),p()(this,"channelBehavior",void 0),p()(this,"SECURITY_SDK_INIT_TIMEOUT",1500),p()(this,"SDK_REQUEST_TIMEOUT",15e3),p()(this,"LOAD_APP_RESOURCES_TIMEOUT",15e3)}var t,n,r,o,i;return y()(e,[{key:"init",value:function(e,t,n){this.initConfig=e,this.instanceId=t,this.logger=Nf.getInstance(this.instanceId).getService("Log"),this.securityService=Nf.getInstance(this.instanceId).getService("Security"),this.eventCenter=Nf.getInstance(this.instanceId).getService("EventCenter"),kn.preloadWebApp(W.EASY_PAY,q.WALLET,this.initConfig.environment,!0)}},{key:"startBizFlow",value:(i=u()(l()().mark((function e(t){var n,r,o,i,a,s,c,u,d,p,h;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(St()&&"BANKTRANSFER_QUICKPAY"!==(null===(i=t.paymentSessionObj)||void 0===i||null===(i=i.paymentMethodInfoView)||void 0===i?void 0:i.paymentMethodType)&&(t.paymentSessionObj.paymentSessionConfig.productSceneVersion="1.0",t.paymentSessionObj.needAccountConfirmPage=!1),this.paymentContext=t,this.hostSign=((null==t?void 0:t.paymentSession)||"").split("&&")[1]||"",a=t.paymentSessionObj.paymentSessionConfig.productSceneVersion,s=t.paymentSessionObj.paymentSessionConfig.paymentMethodCategoryType,c=t.paymentSessionObj.action.autoDebitWithToken,u=t.paymentSessionObj.action.requireFastSdk,d=(null===(n=t.paymentSessionObj)||void 0===n?void 0:n.authUrlInfo)||{},this.channelBehavior=Gv(!0===(null===(r=t.startBizFlowOptions.submitPayRequestExtra)||void 0===r?void 0:r.notRedirectAfterComplete),t.paymentSessionObj),c||!u){e.next=12;break}return e.abrupt("return",this.buildRedirectResult(d));case 12:return p=this.buildWebAppUrl(),h={url:p,allowClickPopupOutsideClose:null===(o=this.channelBehavior)||void 0===o?void 0:o.allowClickOutsideClose},Zt.savePreviousProductInfo(W.EASY_PAY,{paymentMethodCategoryType:s,hostSign:this.hostSign,productSceneVersion:a}),this.sendRequestAndWaitWebLaunch(),e.abrupt("return",{behaviorType:"RENDER",payload:h});case 17:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"buildWebAppUrl",value:function(){var e,t,n,r,o=this.paymentContext,i=null===(e=o.paymentSessionObj.paymentSessionConfig)||void 0===e?void 0:e.paymentMethodCategoryType,a=null===(t=o.paymentSessionObj.paymentSessionConfig)||void 0===t?void 0:t.productScene,s=null===(n=o.paymentSessionObj.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,l=this.hostSign,c=o.paymentSessionObj.clientId,u=o.paymentSessionObj.extendInfo;return Ut({environment:this.initConfig.environment,paymentMethodCategoryType:i,sdkMetaData:o.sdkMetaData,productScene:a,productSceneVersion:s,isPreload:!1,query:{analyticsEnabled:null===(r=this.initConfig.analytics)||void 0===r?void 0:r.enabled,displayType:G.popup,instanceId:this.instanceId,locale:this.initConfig.locale,hostSign:l},mid:c,extendInfo:u})}},{key:"buildRedirectResult",value:function(e){return{behaviorType:"REDIRECT",payload:null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{url:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl,openInApp:(null==e?void 0:e.openInApp)||!1}:{url:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl,openInApp:(null==e?void 0:e.openInApp)||!1}}}},{key:"sendRequestAndWaitWebLaunch",value:function(){var e=this,t=new Promise((function(t,n){var r=setTimeout((function(){n(new Error("Load resource timeout"))}),e.LOAD_APP_RESOURCES_TIMEOUT);e.eventCenter.listen("onLaunch",(function(n){clearTimeout(r),t(n),e.logger.logInfo({title:"sdk_event_webAppOnLaunch"})}))}));Promise.all([this.initSecuritySDK(),this.processQuery(),this.processSubmitPay(),t]).then((function(t){var n,r,o,i,a,s,l,c=ot()(t,4),u=(c[0],c[1]),d=c[2],p=(c[3],e.logger.getLogConfig().mdata),h={sessionResult:null===(n=e.paymentContext)||void 0===n?void 0:n.paymentSessionObj,submitResult:d,paymentSessionData:null===(r=e.paymentContext)||void 0===r?void 0:r.paymentSessionId,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:e.paymentContext.displayInfo.type,appearance:null===(o=e.paymentContext.displayInfo)||void 0===o?void 0:o.appearance,notRedirectAfterComplete:!0===(null===(i=e.paymentContext.startBizFlowOptions.submitPayRequestExtra)||void 0===i?void 0:i.notRedirectAfterComplete),isAppWebview:e.paymentContext.startBizFlowOptions.isAppWebview,isNativeAppWebview:e.paymentContext.startBizFlowOptions.isNativeAppWebview,merchantAppointParam:null===(a=e.paymentContext.startBizFlowOptions.submitPayRequestExtra)||void 0===a?void 0:a.merchantAppointParam,allowSubmitPayCallAhead:e.allowSubmitPayCallAhead,doubleFaUrl:Jt(null===(s=e.paymentContext)||void 0===s?void 0:s.paymentSessionObj,e.initConfig.environment),envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:v()(v()({trackId:p.requestSeq,platform:p.platform,firstLogTime:p.firstLogTime},(null===(l=e.paymentContext.paymentSessionObj)||void 0===l?void 0:l.paymentSessionConfig)||{}),{},{renderDisplayType:p.renderDisplayType,sdkVersion:p.sdkVersion,merchantId:p.merchantId,instanceId:p.instanceId,paymentMethodType:p.paymentMethodType})};u&&(h.queryResult=u),e.eventCenter.dispatchToApp({event:"renderComponent",data:h}),e.logger.logInfo({title:"sdk_event_renderComponent"})})).catch((function(t){e.eventCenter.emit(_e.destroy.name,{}),e.eventCenter.emit(_e.eventCallback.name,{code:ce.SDK_INTERNAL_ERROR,result:{message:null==t?void 0:t.message}})}))}},{key:"processQuery",value:(o=u()(l()().mark((function e(){var t,n,r,o,i,a,s,c,u,d,p,h,m,f,g,y;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s={paymentSessionData:(null===(t=this.paymentContext)||void 0===t?void 0:t.paymentSessionId)||"",paymentSessionConfig:null===(n=this.paymentContext)||void 0===n||null===(n=n.paymentSessionObj)||void 0===n?void 0:n.paymentSessionConfig},c=null===(r=this.paymentContext)||void 0===r?void 0:r.paymentSessionObj.extendInfo,u=null===(o=null===(i=this.paymentContext)||void 0===i?void 0:i.paymentSessionObj.needAccountConfirmPage)||void 0===o||o,d=!(null!==(a=this.paymentContext)&&void 0!==a&&null!==(a=a.paymentSessionObj.action)&&void 0!==a&&a.autoDebitWithToken),p=!0;try{h=JSON.parse(c),p=Nt(h.needQueryRender)||!0===h.needQueryRender}catch(e){console.log(e)}if(this.allowQueryCall=p&&d&&u,this.allowQueryCall){e.next=9;break}return e.abrupt("return",null);case 9:return m=ze(),this.logger.logInfo({title:"sdk_event_sdkQuery"},{config:JSON.stringify(s.paymentSessionConfig),requestId:m}),f=Nf.getInstance(this.instanceId).getService("Requester"),e.prev=12,e.t0=f,e.t1=v()(v()({},s),{},{actionType:"init",integrationType:"SDK",sdkVersion:null!==(g=this.paymentContext.sdkMetaData.sdkVersion)&&void 0!==g?g:"1.0.0"}),e.t2=this.initConfig.environment,e.t3=this.SDK_REQUEST_TIMEOUT,e.next=19,this.acquireApdidToken();case 19:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,timeout:e.t3,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"},e.next=25,e.t0.request.call(e.t0,e.t1,e.t7);case 25:return y=e.sent,this.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{config:JSON.stringify(s.paymentSessionConfig),requestId:m,rpcTraceId:y.traceId}),e.abrupt("return",y);case 30:return e.prev=30,e.t8=e.catch(12),this.logger.logError({title:"sdk_event_sdkQuery_failed"},{config:JSON.stringify(s.paymentSessionConfig),errorMessage:JSON.stringify(e.t8),requestId:m,rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",null);case 34:case"end":return e.stop()}}),e,this,[[12,30]])}))),function(){return o.apply(this,arguments)})},{key:"processSubmitPay",value:(r=u()(l()().mark((function e(){var t,n,r,o,i,a,s,c,u,d,p,h,m,f,g,y,_,b,E,S,A,k,T,P,w,I,C,R;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c={paymentSessionData:(null===(t=this.paymentContext)||void 0===t?void 0:t.paymentSessionId)||"",paymentSessionConfig:null===(n=this.paymentContext)||void 0===n||null===(n=n.paymentSessionObj)||void 0===n?void 0:n.paymentSessionConfig},u=c.paymentSessionConfig||{},d=u.productSceneVersion,p=void 0===d?"":d,h=(null===(r=this.paymentContext)||void 0===r?void 0:r.paymentSessionObj)||{},m=h.action,g=(f=void 0===m?{}:m).enableSignAgreement,y=void 0!==g&&g,_=f.autoDebitWithToken,b=void 0!==_&&_,"2.0"!==p||b||(c.signAgreement=y,S=null===(E=this.paymentContext.paymentSessionObj)||void 0===E||null===(E=E.paymentMethodInfoView)||void 0===E?void 0:E.paymentMethodType,A=this.paymentContext.startBizFlowOptions.isAppWebview,k=this.paymentContext.startBizFlowOptions.isNativeAppWebview,"ALIPAY_CN"!==S||A&&k||(T=nv(void 0,this.logger))&&"https"!==T&&(c.h5FromApp=encodeURIComponent(T))),this.allowSubmitPayCallAhead=this.channelBehavior.allowSubmitPayCallAhead,this.allowSubmitPayCallAhead){e.next=7;break}return e.abrupt("return",{message:"sdk no need to make submitPay request",success:!0});case 7:return P=ze(),this.logger.logInfo({title:"sdk_event_submitPay"},{config:JSON.stringify(c.paymentSessionConfig),requestId:P}),w=(null===(o=this.channelBehavior)||void 0===o||null===(i=o.buildSubmitPayExtParams)||void 0===i?void 0:i.call(o,{instanceId:this.instanceId,locale:this.initConfig.locale,paymentMethodType:null===(a=this.paymentContext.paymentSessionObj)||void 0===a||null===(a=a.paymentMethodInfoView)||void 0===a?void 0:a.paymentMethodType,paymentSessionData:this.paymentContext.paymentSessionId,paymentSessionObj:this.paymentContext.paymentSessionObj,env:this.initConfig.environment,sdkVersion:this.paymentContext.sdkMetaData.sdkVersion,notRedirectAfterComplete:!0===(null===(s=this.paymentContext)||void 0===s||null===(s=s.startBizFlowOptions)||void 0===s||null===(s=s.submitPayRequestExtra)||void 0===s?void 0:s.notRedirectAfterComplete)}))||{},b||(w.complianceSDK=!0),c.extParams=w,I=Nf.getInstance(this.instanceId).getService("Requester"),e.prev=13,e.t0=I,e.t1=v()(v()({},c),{},{integrationType:"SDK",sdkVersion:null!==(C=this.paymentContext.sdkMetaData.sdkVersion)&&void 0!==C?C:"1.0.0"}),e.t2=this.initConfig.environment,e.t3=this.SDK_REQUEST_TIMEOUT,e.next=20,this.acquireApdidToken();case 20:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,timeout:e.t3,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.cashier.submitPayByPaymentSession"},e.next=26,e.t0.request.call(e.t0,e.t1,e.t7);case 26:return R=e.sent,this.logger.logInfo({title:"sdk_event_submitPayEnd"},{config:JSON.stringify(c.paymentSessionConfig),requestId:P,rpcTraceId:R.traceId}),e.abrupt("return",R);case 31:return e.prev=31,e.t8=e.catch(13),this.logger.logError({title:"sdk_event_submitPay_failed"},{config:JSON.stringify(c.paymentSessionConfig),errorMessage:JSON.stringify(e.t8),requestId:P,rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",null);case 35:case"end":return e.stop()}}),e,this,[[13,31]])}))),function(){return r.apply(this,arguments)})},{key:"acquireApdidToken",value:(n=u()(l()().mark((function e(){var t,n,r,o;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Nf.getInstance(this.instanceId).getService("Security"),r=null===(t=this.paymentContext.paymentSessionObj)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productScene,o=n.getDeviceId({productScene:r}),e.abrupt("return",o);case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"initSecuritySDK",value:(t=u()(l()().mark((function e(){var t,n,r,o,i,a,s,c,u,d,p,h;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,s=this.paymentContext.paymentSessionObj.paymentSessionConfig.productSceneVersion,c=null!==(t=null===(n=this.paymentContext.paymentSessionObj.action)||void 0===n?void 0:n.nonInitSecuritySDK)&&void 0!==t&&t,u=null!==(r=null===(o=this.paymentContext.paymentSessionObj.action)||void 0===o?void 0:o.signButtonDisplay)&&void 0!==r&&r,d=null!==(i=null===(a=this.paymentContext.paymentSessionObj.action)||void 0===a?void 0:a.userSignAgreement)&&void 0!==i&&i,p=!this.paymentContext.paymentSessionObj.action.autoDebitWithToken,h=!1,c||"1.0"===s?h=!1:"2.0"===s&&(h=!p||u&&d),!h){e.next=11;break}return e.next=11,this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);case 11:this.logger.logInfo({title:"a3753.b101271.c388193.d514078"},{riskSdkInfo:h?fe.NEED:fe.NO_NEED}),e.next=16;break;case 14:e.prev=14,e.t0=e.catch(0);case 16:case"end":return e.stop()}}),e,this,[[0,14]])}))),function(){return t.apply(this,arguments)})}]),e}();var Vv="https://dev.page.alipay.net",Wv="https://test.page.alipay.net",qv="https://pre.ac.alipay.com",Jv="https://checkout.antom.com",Qv="/page/antom-web-checkout-v2/checkout-page/pages/payment/index.html",Zv=function(){function e(t){var n=this;b()(this,e),p()(this,"logger",void 0),p()(this,"_instanceId",void 0),p()(this,"iframe",void 0),p()(this,"originOptions",void 0),p()(this,"APP_IFRAME_ID","antom-checkout-page-sub-page-iframe"),p()(this,"eventListener",void 0),p()(this,"generateIframeSrc",(function(e,t){var r=n.originOptions.environment||"prod",o=e||"",i=n.originOptions.locale||"en_US",a=function(e){switch(e){case"dev":return"".concat(Vv).concat(Qv);case"sit":return"".concat(Wv).concat(Qv);case"pre":return"".concat(qv).concat(Qv);case"prod":case"sandbox":case"light_sandbox":return"".concat(Jv).concat("/checkout-page/pages/payment/index.html");default:return e}}(r);console.log("[antom-web-sdk] <antom-checkout-page> generateIframeSrc",n.originOptions,r,o,i,a);var s=a.split("?")[0],l=At(a);return l.sessionData=o,l.lang=i,l.mode="embed","sandbox"===r&&(l.shadow="true"),t&&(l.demoMode="true"),Object.keys(l).forEach((function(e){s+="".concat(s.includes("?")?"&":"?").concat(e,"=").concat(encodeURIComponent(l[e]))})),s})),p()(this,"eventListenerWrapper",(function(e){var t,r,o=JSON.parse(e.data)||{},i=o.code,a=o.message,s=o.result,l=(null==o?void 0:o.context)||{event:"",data:{}},c=l.event,u=l.data;if(c&&null!=c&&c.startsWith("getDomain")){var d,p,h=null===(d=window)||void 0===d||null===(d=d.location)||void 0===d?void 0:d.hostname;n.logger.logInfo({code:"a3753.b146681",msg:h}).send();var m=v()(v()({},null==o?void 0:o.context),{},{data:{doMain:null===(p=window)||void 0===p||null===(p=p.location)||void 0===p?void 0:p.hostname},event:"appEventCallback"});n.dispatchToApp(m)}i&&i.startsWith("SDK_PAYMENT")&&(console.log("[antom-web-sdk] <antom-checkout-page> eventListenerWrapper",e,a,s),null===(t=n.eventListener)||void 0===t||t.call(n,{code:i,message:a,result:s}));c&&null!=c&&c.startsWith("onRedirect")&&(null===(r=n.eventListener)||void 0===r||r.call(n,{code:i,message:a,result:s}),function(e){return new Promise((function(t,n){var r=(bt?re.WAP:re.WEB)===re.WEB,o=(null==e?void 0:e.normalUrl)||"",i=(null==e?void 0:e.schemeUrl)||"",a=(null==e?void 0:e.applinkUrl)||"",s=(null==e?void 0:e.callAppJudgeTime)||"",l=function(){if(o)return t(),void(window.location.href=o);n(ge.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};r?l():function(){if(i||a){var e={fallback:function(){l()},successCb:function(){t()},delay:0};s&&(e.resultJudgmentTime=s);try{new tl(e).open({scheme:i,link:a})}catch(e){l()}}else l()}()}))}(u).then((function(){var e=v()(v()({},null==o?void 0:o.context),{},{event:"appEventCallback"});n.dispatchToApp(e)})))})),p()(this,"addListener",(function(){window.addEventListener("message",n.eventListenerWrapper)})),p()(this,"removeListener",(function(){window.removeEventListener("message",n.eventListenerWrapper)})),p()(this,"dispatchToApp",(function(e){var t,r={name:ie.SDK_TO_APP,context:e};null===(t=n.iframe)||void 0===t||null===(t=t.contentWindow)||void 0===t||t.postMessage(JSON.stringify(r),"*")})),t.environment=t.environment||te.prod,this._instanceId=ze(),this.iframe=null,this.originOptions=t,this.eventListener=t.onEventCallback,this.logger=new Ha(Fa,![te.prod,te.sandbox].includes(null==t?void 0:t.environment)),Ha.setInstance(this.logger),this.logger.setMedta({instanceId:this._instanceId}),this.logger.initTracker(),this.logger.setComponentStartTime(Date.now()),this.logger.setTrackId(this._instanceId),this.logger.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==t?void 0:t.environment,"_").concat(null==t?void 0:t.locale)}).send()}return y()(e,[{key:"mountComponent",value:function(e,t){if(void 0===e.sessionData||""===e.sessionData||"string"!=typeof e.sessionData)throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_INVALID_SESSION_DATA"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: sessionData is required and must be a string"),new Error("PARAMS_ERROR_INVALID_SESSION_DATA");if(document.querySelector(this.APP_IFRAME_ID))throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_ALREADY_MOUNTED"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: already mounted, please unmount first"),new Error("PARAMS_ERROR_ALREADY_MOUNTED");this.addListener();var n=this.generateIframeSrc(e.sessionData,e.isDemoMode),r=document.createElement("iframe");r.id=this.APP_IFRAME_ID,r.src=n,r.allow="payment",r.width="100%",r.height="100%",r.style.border="none";var o=document.querySelector(t);if(!o)throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_INVALID_SELECTOR"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: invalid selector"),this.removeListener(),new Error("PARAMS_ERROR_INVALID_SELECTOR");return o.innerHTML="",o.appendChild(r),this.iframe=r,Promise.resolve()}},{key:"unmount",value:function(){this.removeListener();var e=document.getElementById(this.APP_IFRAME_ID);e&&e.remove()}}]),e}(),Xv=new Ha(Fa,!0),$v=function(e){S()(n,e);var t=k()(n);function n(e,r){var o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"1.0";return b()(this,n),(o=t.call(this,v()({appVersion:C},e))).preloadComponent(r,i),o}return y()(n)}(cl),eg=function(e){S()(n,e);var t=k()(n);function n(e){b()(this,n);var r=Object.assign({},e,{product:W.AUTO_DEBIT_PAY});return t.call(this,r,[V.AUTO_DEBIT_PAY_WALLET])}return y()(n,null,[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};kn.preloadWebApp(W.AUTO_DEBIT_PAY,q.WALLET,e.environment),kn.preloadSecuritySDK(W.AUTO_DEBIT_PAY,e.securityRegion,e.environment)}}]),n}($v),tg=function(e){S()(n,e);var t=k()(n);function n(e){b()(this,n);var r,o=Object.assign({},e,{product:W.CASHIER_PAYMENT,appVersion:"1.47.2"});try{var i=localStorage.getItem("antom_checkout_previousChannel"),a=(JSON.parse(i)||{}||{}).channelType,s=void 0===a?"":a;r=[V.CASHIER_PAYMENT_CARD,V.CASHIER_PAYMENT_APM,V.CASHIER_PAYMENT_BANK].includes(s)?[s]:[V.CASHIER_PAYMENT_CARD,V.CASHIER_PAYMENT_APM]}catch(e){Xv.logError({title:"performance_optimization_get_previousChannel_error"},{errorMessage:e})}return t.call(this,o,r)}return y()(n,[{key:"validateFields",value:function(){return this._validateFields()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};try{var t,n=localStorage.getItem("antom_checkout_previousChannel"),r=JSON.parse(n)||{},o=r||{},i=o.channelType,a=void 0===i?"":i;t=V.CASHIER_PAYMENT_CARD===a?[q.CARD]:V.CASHIER_PAYMENT_APM===a?[q.APM]:V.CASHIER_PAYMENT_BANK===a?[q.BANK]:[q.CARD,q.APM];var s,l=m()(t);try{for(l.s();!(s=l.n()).done;){var c=s.value;kn.preloadWebApp(W.CASHIER_PAYMENT,c,e.environment)}}catch(e){l.e(e)}finally{l.f()}}catch(e){console.error("[web-sdk] preload web app error",e)}kn.preloadSecuritySDK(W.CASHIER_PAYMENT,e.securityRegion,e.environment)}}]),n}($v),ng=function(e){S()(n,e);var t=k()(n);function n(e){b()(this,n);var r=Object.assign({},e,{product:W.VAULTING,appVersion:"1.47.2"});return t.call(this,r,[V.CASHIER_PAYMENT_CARD])}return y()(n,null,[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};kn.preloadWebApp(W.CASHIER_PAYMENT,q.CARD,e.environment),kn.preloadSecuritySDK(W.VAULTING,e.securityRegion,e.environment)}}]),n}($v),rg=function(e){S()(n,e);var t=k()(n);function n(e){b()(this,n);var r=Object.assign({},e,{product:W.ELEMENT_PAYMENT,appVersion:"1.47.2"});return t.call(this,r,[V.ELEMENT_PAYMENT])}return y()(n)}($v),og=function(e){S()(n,e);var t=k()(n);function n(e){b()(this,n);var r=Object.assign({},e,{product:W.ELEMENT_ADDRESS,appVersion:"1.47.2"});return t.call(this,r)}return y()(n)}(ul),ig=function(e){S()(n,e);var t=k()(n);function n(e){b()(this,n);var r=Object.assign({},e,{product:W.ELEMENT_PAYMENT,environment:e.environment});return t.call(this,r)}return y()(n)}(Fv),ag=function(){function e(t){b()(this,e),p()(this,"core",void 0),this.core=new ov,this.core.registerProcessor(W.EASY_PAY,"",new zv),this.core.init(t,W.EASY_PAY)}return y()(e,[{key:"createComponent",value:function(e){this.core.startBizFlow({submitPayRequestExtra:{notRedirectAfterComplete:e.notRedirectAfterComplete,merchantAppointParam:e.merchantAppointParam},paymentSession:e.sessionData||e.paymentSessionData,displayInfo:{type:G.popup},isAppWebview:e.isAppWebview,isNativeAppWebview:e.isNativeAppWebview})}},{key:"unmount",value:function(){this.core.destroy()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};kn.preloadWebApp(W.EASY_PAY,q.WALLET,e.environment,!0)}}]),e}(),sg=function(){function e(t){b()(this,e),p()(this,"core",void 0),this.core=new ov,this.core.registerProcessor(W.AUTO_DEBIT,"",new jv),this.core.init(t,W.AUTO_DEBIT)}var t;return y()(e,[{key:"createComponent",value:(t=u()(l()().mark((function e(t){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.core.startBizFlow({submitPayRequestExtra:{notRedirectAfterComplete:t.notRedirectAfterComplete,merchantAppointParam:t.merchantAppointParam},paymentSession:t.sessionData||t.paymentSessionData,displayInfo:{type:G.popup},isAppWebview:t.isAppWebview});case 3:e.next=9;break;case 5:e.prev=5,e.t0=e.catch(0),this.core.getServiceProvider().getService("EventCenter").emit(_e.eventCallback.name,{code:ce.SDK_CREATEPAYMENT_PARAMETER_ERROR,message:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Initialization parameter exception."}),this.core.destroy();case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return t.apply(this,arguments)})},{key:"unmount",value:function(){this.core.destroy()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};kn.preloadWebApp(W.AUTO_DEBIT,q.WALLET,e.environment),kn.preloadSecuritySDK(W.AUTO_DEBIT,e.securityRegion,e.environment)}}]),e}(),lg=new Ha(Fa,!0);var cg=function(e){S()(r,e);var t,n=k()(r);function r(e,t){var o,i;b()(this,r);var a=null===(o=t.appConfig)||void 0===o?void 0:o.sessionData,s=a?$p(a):void 0;return s&&gc.setTrackId(s),(i=n.call(this,e,dl("/element_payment_modern/index.html",gh(a)),v()(v()({},t),{},{trackId:s}),Ah({appearance:{theme:"default"}},t.appConfig))).on("destroy",(function(){i.destroy()})),i}return y()(r,[{key:"setup",value:(t=u()(l()().mark((function e(){var t,n,r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve({locale:(null===(t=this.config.appConfig)||void 0===t?void 0:t.locale)||this.config.locale,paymentFlow:null!==(n=null===(r=this.config.appConfig)||void 0===r?void 0:r.paymentFlow)&&void 0!==n?n:"cvv",sdkVersion:"0.0.1787898127-dev.2",_requestConfig:v()({env:this.config.env},pl())}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"submit",value:function(e){return this._submit(e)}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),r}(Fh);p()(cg,"elementType","CVV");var ug=n(8010),dg=n.n(ug),pg="7983",hg=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{var r="".concat(pg).concat("error"===e?"":e);gc.log(v()({code:r,msg:t},n))}catch(e){}},mg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return hg("express",e,t)},fg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return hg("error",e,t)},vg=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return hg("express",e,v()({d1:null!==(n=null==t?void 0:t.expressPaymentType)&&void 0!==n?n:""},r))};function gg(){var e=null,t=function(){e&&(e.remove(),e=null)};return{show:function(){if(!e){var n=document.createElement("div");n.style.cssText="position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,0.85);z-index:999999;pointer-events:auto;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity 300ms;overflow:hidden;",requestAnimationFrame((function(){n.style.opacity="1"}));var r=document.createElement("button");r.style.cssText="position:absolute;top:16px;right:16px;width:32px;height:32px;border:none;background:none;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px;line-height:1;",r.innerHTML="✕",r.addEventListener("click",t);var o=document.createElement("div");o.style.cssText="display:flex;flex-direction:column;align-items:center;max-width:400px;width:100%;padding:0 24px;text-align:center;box-sizing:border-box;";var i=document.createElement("div");i.setAttribute("role","img"),i.setAttribute("aria-label","PayPal"),i.style.cssText="width:149px;height:37px;margin-bottom:16px;background:url(https://cdn.marmot-cloud.com/storage/antom/2026/04/15/SNOUhDH/paypal.svg) center/contain no-repeat;";var a=document.createElement("p");a.style.cssText="margin:0;font-size:14px;line-height:1.6;color:#fff;",a.textContent="Complete the payment in the opened PayPal window, or close PayPal to continue paying using other methods.",o.appendChild(i),o.appendChild(a),n.appendChild(r),n.appendChild(o),document.body.appendChild(n),e=n}},hide:t}}var yg=["paypal","applePay","googlePay","alipay"];function _g(e,t,n){var r=new zh(t,e,"SDK_USAGE").toJSON();return n&&(r.i18nKey=n),r}function bg(e){var t=null==e?void 0:e.paymentMethods;if(!Array.isArray(t)||0===t.length)return _g("PARAM_INVALID","paymentMethods is required and must not be empty","event.callback.code.PARAM_INVALID.paymentMethodsRequired");var n,r=m()(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(!yg.includes(o))return _g("PARAM_INVALID","Unsupported payment method in paymentMethodOrder: ".concat(o),"event.callback.code.PARAM_INVALID.unsupportedMethod")}}catch(e){r.e(e)}finally{r.f()}return!t.includes("paypal")||null!=e&&e.paypal?null:_g("PARAM_INVALID","payPalConfiguration is required","event.callback.code.PARAM_INVALID.payPalConfigurationRequired")}function Eg(e){return v()(v()({},e),{},{expressPaymentType:"paypal"})}function Sg(e){return Ag.apply(this,arguments)}function Ag(){return Ag=u()(l()().mark((function e(t){var n,r,o,i,a,s,c,u;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.appConfig,r=t.env,o=null==n?void 0:n.sessionData,i=(null==n?void 0:n.locale)||"en_US",(a=Array.isArray(null==n?void 0:n.paymentMethods)?n.paymentMethods:[]).includes("applePay")&&vm(),!(s=bg(n))){e.next=8;break}return e.abrupt("return",{setupResult:{sessionData:o,locale:i,setupError:s}});case 8:if(!a.includes("paypal")){e.next=14;break}return e.next=11,kg(n);case 11:e.t0=e.sent,e.next=15;break;case 14:e.t0=void 0;case 15:if(c=e.t0,!((a.includes("applePay")||a.includes("googlePay")||a.includes("alipay"))&&o)){e.next=19;break}return e.abrupt("return",Pg({appConfig:n,sessionData:o,env:r,paypalSetupResult:c}));case 19:if(o){e.next=21;break}return e.abrupt("return",{setupResult:v()({sessionData:void 0},c)});case 21:if(!(u=Cg(o))){e.next=24;break}return e.abrupt("return",{setupResult:v()(v()({sessionData:o},c),{},{setupError:u})});case 24:return e.abrupt("return",{setupResult:v()({sessionData:o},c)});case 25:case"end":return e.stop()}}),e)}))),Ag.apply(this,arguments)}function kg(e){return Tg.apply(this,arguments)}function Tg(){return(Tg=u()(l()().mark((function e(t){var n,r,o,i,a,s,c,u,d,p,h,m,f,g,y;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=null==t?void 0:t.paypal,i=(null==o?void 0:o.channelMerchantAccountId)||"",a=(null==t?void 0:t.businessDivision)||"",s=(null==t||null===(n=t.amount)||void 0===n?void 0:n.currency)||"",c=(null==t||null===(r=t.amount)||void 0===r?void 0:r.value)||"",e.prev=5,e.next=8,am({clientId:i,paymentMethodType:"PAYPAL_EXPRESSCHECKOUT",businessDivision:a,amount:{currency:s,value:c}},{timeout:1e5,hostSign:a});case 8:if(!0!==(null==(d=e.sent)?void 0:d.success)||!d.channelClientId){e.next=11;break}return e.abrupt("return",{paypal:v()(v()({},o),{},{channelMerchantAccountId:d.channelClientId})});case 11:if(!0!==(null==d?void 0:d.success)){e.next=13;break}return e.abrupt("return",{setupError:Eg(new zh("channelClientId is missing in the response","CHANNEL_CLIENT_ID_QUERY_FAILED","SDK_USAGE").toJSON())});case 13:return p=new zh((null==d?void 0:d.errorMessage)||"channelClientId query failed",(null==d?void 0:d.errorCode)||"CHANNEL_CLIENT_ID_QUERY_FAILED","SDK_USAGE").toJSON(),h=Eg(p),"true"===(null==d||null===(u=d.extendInfo)||void 0===u?void 0:u.mulityLanguageMapping)&&(h.mulityLanguageMapping=!0),e.abrupt("return",{setupError:h});case 19:return e.prev=19,e.t0=e.catch(5),l=void 0,l="API_TIMEOUT"===(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"API_GATEWAY_TIMEOUT"===(null===e.t0||void 0===e.t0?void 0:e.t0.code),f={code:l?"CHANNEL_CLIENT_ID_QUERY_ERROR":null!==e.t0&&void 0!==e.t0&&e.t0.code?e.t0.code:"CHANNEL_CLIENT_ID_QUERY_ERROR",message:l?"Request to query channelClientId timed out":null!==e.t0&&void 0!==e.t0&&e.t0.errorMessage||null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.errorMessage||e.t0.message:"channelClientId query failed"},g=new zh(f.message,f.code,"SDK_USAGE").toJSON(),y=Eg(g),"true"===(null===e.t0||void 0===e.t0||null===(m=e.t0.response)||void 0===m||null===(m=m.extendInfo)||void 0===m?void 0:m.mulityLanguageMapping)&&(y.mulityLanguageMapping=!0),e.abrupt("return",{setupError:y});case 27:case"end":return e.stop()}var l}),e,null,[[5,19]])})))).apply(this,arguments)}function Pg(e){return wg.apply(this,arguments)}function wg(){return(wg=u()(l()().mark((function e(t){var n,r,o,i,a,s,c;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.appConfig,n=t.sessionData,r=t.env,o=t.paypalSetupResult,!(i=Cg(n))){e.next=4;break}return e.abrupt("return",{setupResult:v()(v()({sessionData:n},o),{},{setupError:i})});case 4:return a=mh(n),e.prev=5,e.next=8,pm({paymentSessionData:n,paymentSessionConfig:null==a?void 0:a.paymentSessionConfig});case 8:if(null==(s=e.sent)||!s.success){e.next=12;break}return c=Ig(),e.abrupt("return",{renderData:s,setupResult:v()(v()(v()({sessionData:n,renderData:s},c?{merchantDomain:c,doMain:c}:{}),o),{},{_requestConfig:v()({env:r},pl()),sdkVersion:"0.0.1787898127-dev.2"})});case 12:return e.abrupt("return",{setupResult:v()(v()({sessionData:n},o),{},{setupError:zh.unificationError(new Error((null==s?void 0:s.errorMessage)||"sdkActionQuery failed")).toJSON()})});case 15:return e.prev=15,e.t0=e.catch(5),e.abrupt("return",{setupResult:v()(v()({sessionData:n},o),{},{setupError:zh.unificationError(e.t0).toJSON()})});case 18:case"end":return e.stop()}}),e,null,[[5,15]])})))).apply(this,arguments)}function Ig(){var e;if("undefined"!=typeof window)return(null===(e=window.location)||void 0===e?void 0:e.hostname)||void 0}function Cg(e){var t,n=mh(e);if(!n)return zh.unificationError(new Error("Failed to parse sessionData, please check the sessionData")).toJSON();var r=null===(t=n.paymentSessionConfig)||void 0===t?void 0:t.productScene;return"ELEMENT_PAYMENT"!==r?zh.unificationError(new Error("Invalid productScene in sessionData, expected ELEMENT_PAYMENT, but get ".concat(r,", please check the sessionData is correct?"))).toJSON():void 0}function Rg(e,t){if(void 0!==e){if(t)throw new zh("Payment amount update is not allowed during payment processing","PAYMENT_IN_PROGRESS","SDK_USAGE");if(null==e||!e.value)throw new zh("Payment amount cannot be empty","AMOUNT_VALUE_EMPTY","SDK_USAGE");if(!/^(?:[1-9]\d*(?:\.\d+)?|0(?:\.\d+)?)$/.test(e.value)||Number(e.value)<=0)throw new zh("Invalid payment amount format (only positive integers and decimals allowed)","AMOUNT_VALUE_INVALID","SDK_USAGE")}}var Ng=["paypal"],Og=["createOrder","onShippingAddressChange","onShippingOptionsChange"],Dg=function(e){S()(o,e);var t,n,r=k()(o);function o(e,t){var n;b()(this,o);var i=t.appConfig||{},a=t.locale||"en_US",s=i.paypal,l=mc()(i,Ng),c=s||{},u=c.createOrder,d=c.onShippingAddressChange,h=c.onShippingOptionsChange,m=mc()(c,Og),f=v()({},l);delete f.amount;var g=v()(v()({},f),{},{locale:a,_paypalSdkEnvironment:"sandbox"===t.env?"sandbox":"prod"},Object.keys(m).length>0&&{paypal:m}),y=dl("/express_element/index.html",!0);"sandbox"===t.env&&(y+=y.includes("?")?"&shadow=true":"?shadow=true");var _=i.sessionData?$p(i.sessionData):void 0;_&&gc.setTrackId(_),n=r.call(this,e,y,v()(v()({},t),{},{appConfig:g,locale:a,trackId:_}),Ah({appearance:{displaySetting:{showCardBrandIcon:!0}}},g)),p()(et()(n),"_callbacks",{}),p()(et()(n),"_renderData",null),p()(et()(n),"_initialAmount",void 0),p()(et()(n),"_localHandlers",new Map),p()(et()(n),"_paymentInProgress",!1),p()(et()(n),"_paypalOverlay",gg());var E=i.sessionData?eh(i.sessionData):"";return dh.setGlobalOptions(v()({hostSign:E,sdkVersion:"0.0.1787898127-dev.2",env:t.env},pl())),n._callbacks={paypalCreateOrder:u,paypalOnShippingAddressChange:d,paypalOnShippingOptionsChange:h},n._initialAmount=i.amount,n}return y()(o,[{key:"on",value:function(e,t){var n=this;if("confirm"===e){return _h()(Eh()(o.prototype),"on",this).call(this,e,(function(e){e.paymentFailed=function(){var t;fg("payment_failed",{d1:null!==(t=null==e?void 0:e.expressPaymentType)&&void 0!==t?t:""}),n._paymentInProgress=!1,n.send("OPENSDK@COMPLETE_PAYMENT_REJECT",{})},t(e)}))}return _h()(Eh()(o.prototype),"on",this).call(this,e,t)}},{key:"_emit",value:function(e,t){var n;null===(n=this._localHandlers.get(e))||void 0===n||n.forEach((function(e){return e(t)}))}},{key:"updateConfig",value:(n=u()(l()().mark((function e(t){var n,r,i,a,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"ready"===this.status){e.next=3;break}throw new zh("Checkout page not loaded successfully, please load again.","CHECKOUT_NOT_READY","SDK_USAGE");case 3:Rg(t.amount,this._paymentInProgress),e.next=10;break;case 6:return e.prev=6,e.t0=e.catch(0),fg("updateConfig_error",{d1:(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"UNKNOWN"}),e.abrupt("return",{error:zh.unificationError(e.t0).toJSON()});case 10:return e.next=12,_h()(Eh()(o.prototype),"updateConfig",this).call(this,t);case 12:return null!=(n=e.sent)&&n.error?mg("updateConfig_reply_error",{d1:n.error.code,d2:n.error.message}):mg("updateConfig_success",{d1:null!==(r=null==t||null===(i=t.amount)||void 0===i?void 0:i.value)&&void 0!==r?r:"",d2:null!==(a=null==t||null===(s=t.amount)||void 0===s?void 0:s.currency)&&void 0!==a?a:""}),e.abrupt("return",n);case 15:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e){return n.apply(this,arguments)})},{key:"completePayment",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"always";if("destroyed"===this.status)return fg("complete_payment_failed",{d1:"ELEMENT_INSTANCE_DESTROYED"}),Promise.resolve({success:!1,error:{code:"ELEMENT_INSTANCE_DESTROYED",message:"Element already destroyed"}});var n="cp_".concat(Date.now(),"_").concat(Math.random().toString(36).slice(2,8));return mg("complete_payment_request",{d1:t}),this.send("OPENSDK@COMPLETE_PAYMENT",{requestId:n,redirect:t}),new Promise((function(t){var r=e.bridge.on("OPENSDK@COMPLETE_PAYMENT_RESULT",(function(i){if((null==i?void 0:i.requestId)===n){if(e._paymentInProgress=!1,r(),clearTimeout(o),i.success)mg("complete_payment_success");else{var a,s,l,c;if(["PAYMENT_CANCELLED","APPLE_PAY_CANCEL","USER_CANCELED_3D"].includes((null===(a=i.error)||void 0===a?void 0:a.code)||""))mg("complete_payment_cancelled",{d1:(null===(s=i.error)||void 0===s?void 0:s.code)||""});else fg("complete_payment_failed",{d1:(null===(l=i.error)||void 0===l?void 0:l.code)||"UNKNOWN",d2:(null===(c=i.error)||void 0===c?void 0:c.message)||""})}t({success:i.success,result:i.result,error:i.error,userCanceled3D:i.userCanceled3D})}})),o=setTimeout((function(){e._paymentInProgress=!1,r(),fg("complete_payment_timeout",{d1:"COMPLETE_PAYMENT_TIMEOUT"}),t({success:!1,error:{code:"COMPLETE_PAYMENT_TIMEOUT",message:"completePayment timed out"}})}),3e5)}))}},{key:"setup",value:(t=u()(l()().mark((function e(){var t,n,r,o,i,a;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.registerInternalListeners(),mg("setup_start"),t=v()(v()({},this.config.appConfig),{},{amount:this._initialAmount}),e.prev=3,e.next=6,Sg({appConfig:t,env:this.config.env});case 6:return n=e.sent,r=n.setupResult,(o=n.renderData)&&(this._renderData=o),null!=r&&r.setupError?fg("setup_error",{d1:(null===(i=r.setupError)||void 0===i?void 0:i.code)||"UNKNOWN",d2:(null===(a=r.setupError)||void 0===a?void 0:a.reason)||""}):mg("setup_success"),e.abrupt("return",v()(v()({},r),{},{amount:this._initialAmount}));case 14:throw e.prev=14,e.t0=e.catch(3),fg("setup_error",{d1:(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"UNKNOWN",d2:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||""}),e.t0;case 18:case"end":return e.stop()}}),e,this,[[3,14]])}))),function(){return t.apply(this,arguments)})},{key:"registerInternalListeners",value:function(){var e=this;!function(e){var t=e.getIframe,n=e.on,r=t();r&&(r.style.opacity="0",r.style.transition="height 0.35s, opacity 0.4s 0.1s",r.style.height="0px",r.style.width="100%",r.style.display="block");var o=!1;n("contentHeightChanged",(function(e){mg("content_height_changed",{d1:null==e?void 0:e.height});var n=t();n&&(null==e?void 0:e.height)>0&&(n.style.height="".concat(e.height,"px"),o||(o=!0,requestAnimationFrame((function(){n.style.opacity="1"}))))}))}({getIframe:function(){return e.iframe},on:this.on.bind(this)}),function(e){var t=e.on,n=e.send,r=e.callbacks,o=e.paypalOverlay,i=e.setPaymentInProgress,a=e.getRenderData,s=e.getAppConfig;t("click",(function(e){vg("click",e),i(!0),"paypal"!==(null==e?void 0:e.expressPaymentType)?n("OPENSDK@CLICK_RESOLVE",{}):o.show()})),t("ready",(function(e){var t;mg("ready",{d1:JSON.stringify(null!==(t=null==e?void 0:e.availablePaymentMethods)&&void 0!==t?t:{})})})),t("confirm",(function(e){vg("confirm",e),o.hide()})),t("error",(function(e){var t;fg("error",{d1:null!==(t=null==e?void 0:e.expressPaymentType)&&void 0!==t?t:"",d2:null==e?void 0:e.code,d3:null==e?void 0:e.source}),i(!1),o.hide()})),t("cancel",(function(e){vg("cancel",e),i(!1),o.hide()})),t("OPENSDK@GET_APPLE_PAY_TOKEN",function(){var e=u()(l()().mark((function e(t){var r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.requestId,e.prev=1,e.next=4,_m({requestId:r,renderData:a(),appConfig:s(),sendReply:function(e){n("OPENSDK@GET_APPLE_PAY_TOKEN_REPLY",e)}});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),n("OPENSDK@GET_APPLE_PAY_TOKEN_REPLY",{requestId:r,success:!1,errorCode:(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED"});case 9:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t){return e.apply(this,arguments)}}()),t("OPENSDK@PAYPAL_CREATE_ORDER",function(){var e=u()(l()().mark((function e(t){var a,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t.requestId,mg("paypal_create_order",{d1:"start"}),e.prev=2,r.paypalCreateOrder){e.next=5;break}throw new Error("paypal.createOrder is not provided");case 5:return e.next=7,r.paypalCreateOrder();case 7:s=e.sent,mg("paypal_create_order_success",{d1:"has_session"}),n("OPENSDK@PAYPAL_CREATE_ORDER_REPLY",{requestId:a,sessionData:s}),e.next=18;break;case 12:e.prev=12,e.t0=e.catch(2),i(!1),mg("paypal_create_order_failed",{d1:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"createOrder failed"}),n("OPENSDK@PAYPAL_CREATE_ORDER_REPLY",{requestId:a,error:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"createOrder failed"}),o.hide();case 18:case"end":return e.stop()}}),e,null,[[2,12]])})));return function(t){return e.apply(this,arguments)}}()),t("OPENSDK@PAYPAL_SHIPPING_ADDRESS_CHANGE",function(){var e=u()(l()().mark((function e(t){var o,i,a;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.requestId,i=t.shippingData,mg("paypal_shipping_address_change",{d1:"start"}),e.prev=2,e.next=5,null===(a=r.paypalOnShippingAddressChange)||void 0===a?void 0:a.call(r,i,{});case 5:n("OPENSDK@PAYPAL_SHIPPING_ADDRESS_CHANGE_REPLY",{requestId:o}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),n("OPENSDK@PAYPAL_SHIPPING_ADDRESS_CHANGE_REPLY",{requestId:o,error:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"onShippingAddressChange failed"});case 11:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(t){return e.apply(this,arguments)}}()),t("OPENSDK@PAYPAL_SHIPPING_OPTIONS_CHANGE",function(){var e=u()(l()().mark((function e(t){var o,i,a;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=t.requestId,i=t.shippingData,mg("paypal_shipping_options_change",{d1:"start"}),e.prev=2,e.next=5,null===(a=r.paypalOnShippingOptionsChange)||void 0===a?void 0:a.call(r,i,{});case 5:n("OPENSDK@PAYPAL_SHIPPING_OPTIONS_CHANGE_REPLY",{requestId:o}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),n("OPENSDK@PAYPAL_SHIPPING_OPTIONS_CHANGE_REPLY",{requestId:o,error:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"onShippingOptionsChange failed"});case 11:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(t){return e.apply(this,arguments)}}())}({on:this.on.bind(this),send:this.send.bind(this),callbacks:this._callbacks,paypalOverlay:this._paypalOverlay,setPaymentInProgress:function(t){e._paymentInProgress=t},getRenderData:function(){return e._renderData},getAppConfig:function(){return e.config.appConfig}})}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),o}(Fh);p()(Dg,"elementType","express");var Lg=function(e){S()(r,e);var t,n=k()(r);function r(e,t){var o,i;b()(this,r);var a,s=t.appConfig.sessionData,l=s?$p(s):void 0;(l&&gc.setTrackId(l),i=n.call(this,e,dl("/vaulting/index.html",gh(s)),v()(v()({},t),{},{trackId:l}),Ah({appearance:{displaySetting:{showCardBrandIcon:!0},theme:"default"}},t.appConfig)),null!==(o=t.appConfig)&&void 0!==o&&o.sessionData)&&dh.setGlobalOptions({hostSign:eh(null===(a=t.appConfig)||void 0===a?void 0:a.sessionData)});return i}return y()(r,[{key:"setup",value:(t=u()(l()().mark((function e(){var t,n,r,o,i,a,s,c;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=null===(t=this.config.appConfig)||void 0===t?void 0:t.sessionData,i=Wh(o,"ELEMENT_VAULT"),e.next=4,om(pm({extParams:{isUserPreferredLocale:!0},paymentSessionConfig:i.paymentSessionConfig,paymentSessionData:o}));case 4:return a=e.sent,s=hl(a.data),Np(c=s||(null===(n=this.config.appConfig)||void 0===n?void 0:n.locale)||this.config.locale),e.abrupt("return",{sessionData:o,renderData:a.data,renderDataError:a.error,sdkVersion:"0.0.1787898127-dev.2",paymentSessionConfig:i.paymentSessionConfig,locale:c,merchantId:(null===(r=a.data)||void 0===r?void 0:r.merchantId)||"default merchantId",_requestConfig:v()({env:this.config.env},pl())});case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"submit",value:function(e){return this._submit(e)}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),r}(Fh);p()(Lg,"elementType","vaulting");var Mg=function(e){S()(n,e);var t=k()(n);function n(e){return b()(this,n),t.call(this,e)}return y()(n,[{key:"canUseElements",value:function(){return[Lg,Dg]}},{key:"createElement",value:function(e,t){return this._createElement(e,t)}},{key:"getElement",value:function(e,t){return this._getElement(e,t)}}]),n}(jh),xg=function(e){S()(r,e);var t,n=k()(r);function r(e,t){var o,i;b()(this,r);var a=null===(o=t.appConfig)||void 0===o?void 0:o.sessionData,s=a?$p(a):void 0;return s&&gc.setTrackId(s),i=n.call(this,e,dl("/express_vaulting/index.html",!0),v()(v()({},t),{},{trackId:s}),Ah({},t.appConfig)),p()(et()(i),"_paypalOverlay",gg()),a&&dh.setGlobalOptions({hostSign:eh(a)}),i}return y()(r,[{key:"setup",value:(t=u()(l()().mark((function e(){var t,n,r,o,i,a,s,c,u,d,p,h,m,f,g,y;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.registerInternalListeners(),u=null===(t=this.config.appConfig)||void 0===t?void 0:t.sessionData,e.next=4,om(pm({paymentSessionData:u,paymentSessionConfig:{productScene:"AUTO_DEBIT",paymentMethodCategoryType:"WALLET",productSceneVersion:"1.0"},envInfo:{terminalType:Qp?"WEB":"WAP"}}));case 4:return d=e.sent,p=d.data,h=hl(p),Np(m=h||(null===(n=this.config.appConfig)||void 0===n?void 0:n.locale)||this.config.locale),f=null==p||null===(r=p.extendInfo)||void 0===r?void 0:r.paypalClientToken,g=d.error,y=null==p?void 0:p.paymentMethods,e.abrupt("return",v()({sessionData:u,paypalClientToken:f,paypal:null===(o=this.config.appConfig)||void 0===o?void 0:o.paypal,buttonType:null===(i=this.config.appConfig)||void 0===i?void 0:i.buttonType,buttonHeight:null===(a=this.config.appConfig)||void 0===a?void 0:a.buttonHeight,buttonTheme:null===(s=this.config.appConfig)||void 0===s?void 0:s.buttonTheme,paymentMethods:null===(c=this.config.appConfig)||void 0===c?void 0:c.paymentMethods,serverPaymentMethods:y,locale:m,sdkVersion:"0.0.1787898127-dev.2",_requestConfig:v()({env:this.config.env},pl())},g?{setupError:g}:{}));case 13:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"registerInternalListeners",value:function(){var e=this;this.on("click",(function(){e._paypalOverlay.show()})),this.on("confirm",(function(){e._paypalOverlay.hide()})),this.on("cancel",(function(){e._paypalOverlay.hide()})),this.on("error",(function(){e._paypalOverlay.hide()}))}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}},{key:"_confirmVaulting",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"always",n="cv_".concat(Date.now(),"_").concat(Math.random().toString(36).slice(2,8));return this.send("OPENSDK@CONFIRM_VAULTING",{requestId:n,redirect:t}),new Promise((function(t){var r=e.bridge.on("OPENSDK@CONFIRM_VAULTING_RESULT",(function(e){(null==e?void 0:e.requestId)===n&&(r(),clearTimeout(o),t(e.result))})),o=setTimeout((function(){r(),t({status:"FAIL",error:{code:"CONFIRM_VAULTING_TIMEOUT",message:"confirmVaulting timed out"}})}),6e4)}))}}]),r}(Fh);p()(xg,"elementType","expressVaulting");var Ug=function(e){S()(i,e);var t,n,r,o=k()(i);function i(e,t){var n,r,a;b()(this,i);var s,l=Ah({appearance:{layout:"accordion",theme:"default",displaySetting:{showCardBrandIcon:!0}}},t.appConfig),c=null!==(n=t.appConfig)&&void 0!==n&&n.sessionData?$p(t.appConfig.sessionData):void 0;(c&&gc.setTrackId(c),a=o.call(this,e,dl("/element_payment/index.html",!0),v()(v()({},t),{},{trackId:c}),l),p()(et()(a),"_paymentInProgress",!1),null!==(r=t.appConfig)&&void 0!==r&&r.sessionData)&&dh.setGlobalOptions({hostSign:eh(null===(s=t.appConfig)||void 0===s?void 0:s.sessionData)});return a}return y()(i,[{key:"setup",value:(r=u()(l()().mark((function e(){var t,n,r,o,i,a,s,c,u,d,p,h,m,f,g,y,_,b,E;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.config.appConfig.sessionData,a=Wh(i,"ELEMENT_PAYMENT"),s=null==a?void 0:a.paymentSessionConfig,c=function(){return om(pm({extParams:{isUserPreferredLocale:!0},paymentSessionConfig:s,paymentSessionData:i}))},u=function(){return om(um({paymentSessionConfig:s,paymentSessionData:i,accountInfo:{email:""}}))},d=!(null==a||null===(t=a.connectFactor)||void 0===t||!t.enableConnect),p=Uf(d,null==a?void 0:a.extendInfo),h=p?[c(),u()]:[c(),void 0],e.next=10,Promise.all(h);case 10:return m=e.sent,f=ot()(m,2),g=f[0],y=f[1],_=hl(null==g?void 0:g.data),b=_||(null===(n=this.config.appConfig)||void 0===n?void 0:n.locale)||this.config.locale,E=(null===(r=g.data)||void 0===r?void 0:r.merchantId)||(null==a?void 0:a.clientId)||"default merchantId",e.abrupt("return",{renderData:g.data,renderDataError:g.error||(null==y?void 0:y.error),connectAccount:null==y?void 0:y.data,logMetaData:{paymentMethodCategoryType:null==s?void 0:s.paymentMethodCategoryType,productSceneVersion:null==s?void 0:s.productSceneVersion,trackId:$p(i),merchantId:E,paymentMethodType:null==a||null===(o=a.paymentMethodInfoView)||void 0===o?void 0:o.paymentMethodType},sessionData:i,sessionMetaData:a,sdkVersion:"0.0.1787898127-dev.2",locale:b,merchantId:E,heightOfVisible:Math.max(window.changingPageHeight||0,window.innerHeight),merchantDomain:window.location.hostname,doMain:window.location.hostname,env:this.config.env,_requestConfig:v()({env:this.config.env},pl())});case 18:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateConfig",value:(n=u()(l()().mark((function e(t){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"ready"===this.status){e.next=3;break}throw new zh("Checkout page not loaded successfully, please load again.","CHECKOUT_NOT_READY","SDK_USAGE");case 3:Rg(t.amount,this._paymentInProgress),e.next=9;break;case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",{error:zh.unificationError(e.t0).toJSON()});case 9:return e.abrupt("return",_h()(Eh()(i.prototype),"updateConfig",this).call(this,t));case 10:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e){return n.apply(this,arguments)})},{key:"submit",value:(t=u()(l()().mark((function e(t){var n;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._paymentInProgress=!0,e.prev=1,e.next=4,this._submit(t);case 4:return n=e.sent,e.abrupt("return",n);case 6:return e.prev=6,this._paymentInProgress=!1,e.finish(6);case 9:case"end":return e.stop()}}),e,this,[[1,,6,9]])}))),function(e){return t.apply(this,arguments)})},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),i}(Fh);p()(Ug,"elementType","payment");var Bg={env:"prod",debug:!1,targetOrigin:"https://checkout.antom.com",version:"0.0.1787898127-dev.2",trackerCode:"7982"},Kg=function(e){S()(a,e);var t,n,r,o,i=k()(a);function a(e){var t,n,r;return b()(this,a),t=i.call(this,Ah(Bg,e)),gc.initTracker({env:"DEV"}),dh.setGlobalOptions(v()(v()({env:t.config.env},pl()),{},{sdkVersion:t.config.version,tracker:gc,scope:"antom-web-sdk",envInfo:{locale:null==e?void 0:e.locale}})),n=dg(),r=null==e?void 0:e.locale,Rp.initData(n),r&&Np(r),t}return y()(a,[{key:"canUseElements",value:function(){return[Lg,cg,Dg,xg,Ug]}},{key:"updateConfig",value:function(e){e.env&&dh.setGlobalOptions({env:e.env}),e.locale&&(dh.setGlobalOptions({envInfo:{locale:e.locale}}),Np(e.locale)),_h()(Eh()(a.prototype),"updateConfig",this).call(this,e)}},{key:"redirect",value:function(e){var t=e.url,n=e.mode,r=e.appLinkUrl,o=e.schemaUrl;function i(){"replace"===n?window.location.replace(t):window.location.href=t}e.destroy&&this.destroy();try{if(r||o)new tl({resultJudgmentTime:2e3,fallback:function(){i()}}).open({scheme:o,link:r});else i()}catch(e){i()}}},{key:"openModal",value:(o=u()(l()().mark((function e(t){var n,r,o,i,a,s,c,u,d;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=(null==t||null===(n=t.appearance)||void 0===n?void 0:n.theme)||"default",a=null!==(r=Vh[i])&&void 0!==r?r:Vh.default,s=$h(v()(v()({},t),{},{loadingConfig:v()(v()({},t.loadingConfig),{},{theme:a.theme,backgroundColor:(null==t||null===(o=t.appearance)||void 0===o||null===(o=o.variables)||void 0===o?void 0:o["background-primary"])||a.backgroundColor})})),c=s.iframe,u=s.destroy,d=function e(){Lh("ERROR","SDK_INTERNAL","modal load error"+t.url),c.removeEventListener("error",e),u()},c.addEventListener("error",d),e.abrupt("return",{destroy:u,getContentWindow:function(){return c.contentWindow}});case 6:case"end":return e.stop()}}),e)}))),function(e){return o.apply(this,arguments)})},{key:"elements",value:function(){return new Mg(this.config)}},{key:"createElement",value:function(e,t){return this._createElement(e,t)}},{key:"getElement",value:function(e,t){return this._getElement(e,t)}},{key:"extractMainElement",value:function(e){if(e instanceof jh){var t=e._mainElement;if(!t)throw new zh("Cannot find main element in elements","NOT_FIND_MAINELEMENT","SDK_USAGE");return t}if(e instanceof Fh)return e;throw new zh("Cannot find main element in elements","NOT_FIND_MAINELEMENT","SDK_USAGE")}},{key:"confirmCardSetup",value:(r=u()(l()().mark((function e(t){var n,r;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=this.extractMainElement(t.elements),e.abrupt("return",n.submit({redirect:t.redirect||"always"}));case 5:return e.prev=5,e.t0=e.catch(0),r=zh.unificationError(e.t0),e.abrupt("return",{code:r.code,message:r.message,status:"FAIL",userCanceled3D:!1,error:{code:r.code,message:r.message}});case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return r.apply(this,arguments)})},{key:"confirmPayment",value:(n=u()(l()().mark((function e(t){var n,r,o,i,a,s,c,u,d,p,h,m,f,v,g;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.elements){e.next=45;break}e.prev=1,n=this.extractMainElement(t.elements),e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(1),r=zh.unificationError(e.t0),e.abrupt("return",{status:"FAIL",userCanceled3D:!1,error:{code:r.code,message:r.message}});case 9:if(!n.is(Dg)){e.next=25;break}return e.prev=10,e.next=13,n.completePayment(t.redirect||"always");case 13:if(!(a=e.sent).success){e.next=16;break}return e.abrupt("return",{status:"SUCCESS",userCanceled3D:null!==(s=null==a?void 0:a.userCanceled3D)&&void 0!==s&&s});case 16:return c=["PAYMENT_CANCELLED","APPLE_PAY_CANCEL"].includes((null===(o=a.error)||void 0===o?void 0:o.code)||""),e.abrupt("return",{status:c?"CANCELLED":"FAIL",userCanceled3D:null!==(i=null==a?void 0:a.userCanceled3D)&&void 0!==i&&i,error:a.error?{code:a.error.code,message:a.error.message}:void 0});case 21:return e.prev=21,e.t1=e.catch(10),u=zh.unificationError(e.t1),e.abrupt("return",{status:"FAIL",userCanceled3D:!1,error:{code:u.code,message:u.message}});case 25:if(!n.is(Ug)){e.next=36;break}return e.prev=26,e.next=29,n.submit({redirect:null!==(d=t.redirect)&&void 0!==d?d:"always",params:t.params,shippingInfo:t.shippingInfo,handleActions:t.handleActions});case 29:return e.abrupt("return",e.sent);case 32:return e.prev=32,e.t2=e.catch(26),p=zh.unificationError(e.t2),e.abrupt("return",{status:"FAIL",userCanceled3D:!1,error:{code:p.code,message:p.message}});case 36:return e.prev=36,h=n,e.abrupt("return",h.submit({sessionData:t.sessionData,redirect:t.redirect||"always",params:t.params}));case 41:return e.prev=41,e.t3=e.catch(36),m=zh.unificationError(e.t3),e.abrupt("return",{code:m.code,message:m.message,userCanceled3D:!1,status:"FAIL",error:{code:m.code,message:m.message}});case 45:return(f=this.createElement("CVV",{paymentFlow:"automatic",appearance:null==t?void 0:t.appearance,sessionData:t.sessionData})).mount(document.body),e.prev=47,e.next=50,new Promise((function(e,t){var n=setTimeout((function(){t(new zh("Load app time out","SDK_LAUNCH_PAYMENT_APP_ERROR","SDK_INTERNAL"))}),15e3);f.on(Ql,(function(){clearTimeout(n),e()}))}));case 50:e.next=58;break;case 52:return e.prev=52,e.t4=e.catch(47),f.unmount(),v=zh.unificationError(e.t4),g=["SDK_LAUNCH_PAYMENT_APP_ERROR"],e.abrupt("return",{code:v.code,message:v.message,status:g.includes(v.code)?"PROCESSING":"FAIL",userCanceled3D:!1,error:{code:v.code,message:v.message}});case 58:return e.abrupt("return",f.submit({sessionData:t.sessionData,redirect:t.redirect||"always",params:t.params}));case 59:case"end":return e.stop()}}),e,this,[[1,5],[10,21],[26,32],[36,41],[47,52]])}))),function(e){return n.apply(this,arguments)})},{key:"confirmVaulting",value:(t=u()(l()().mark((function e(t){var n,r,o,i;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,n=this.extractMainElement(t.elements),e.next=8;break;case 4:return e.prev=4,e.t0=e.catch(0),r=zh.unificationError(e.t0),e.abrupt("return",{status:"FAIL",error:{code:r.code,message:r.message}});case 8:return e.prev=8,e.next=11,n._confirmVaulting(null!==(o=t.redirect)&&void 0!==o?o:"always");case 11:return e.abrupt("return",e.sent);case 14:return e.prev=14,e.t1=e.catch(8),i=zh.unificationError(e.t1),e.abrupt("return",{status:"FAIL",error:{code:i.code,message:i.message}});case 18:case"end":return e.stop()}}),e,this,[[0,4],[8,14]])}))),function(e){return t.apply(this,arguments)})}]),a}(Gh);p()(Kg,"version","0.0.1787898127-dev.2");var Hg,Fg,Yg=["env","environment"],jg=function(){var t=u()(l()().mark((function t(n){var r,o,i,a,s;return l()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=(r=n||{}).env,i=r.environment,a=mc()(r,Yg),s=o||i||"prod",t.abrupt("return",(0,e().createSingletonInstance)(Kg,v()(v()({},a),{},{env:s}),"AntomSDK"));case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();(Fg=["CDN","NPM"]).includes(Hg="CDN")&&"undefined"!=typeof window&&(Fg.includes(window._ANTOM_WEB_SDK_INTEGRATION_TYPE)||(window._ANTOM_WEB_SDK_INTEGRATION_TYPE=Hg,lg.setMedta({integrationType:Hg})));var Gg=$v}(),r}()}));
|
|
6
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(function(){return function(){var e={7312:function(e){e.exports={"page.wrong.error.message":"خطأ في النظام، يرجى إعادة المحاولة لاحقًا أو الاتصال بالتاجر.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى.","ANTOMSDK.UNKNOWN_ERROR":"حدث خطأ غير معروف. يرجى المحاولة مرة أخرى لاحقًا أو الاتصال بالتاجر.","antom.common.closing":"مغلق","ANTOMSDK.API_GATEWAY_TIMEOUT":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى.","ANTOMSDK.API_TIMEOUT":"انتهت مهلة الطلب، يرجى المحاولة مرة أخرى.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"لا يمكن أن يكون مبلغ الدفع فارغًا.","ANTOMSDK.AMOUNT_VALUE_INVALID":"يجب أن يكون مبلغ الدفع سلسلة من 1 إلى 15 رقمًا ASCII تمثل قيمة أكبر من صفر.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"لا تتطابق عملة مبلغ الدفع مع عملة جلسة الدفع.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"عملة مبلغ الدفع غير مدعومة.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"دقة مبلغ الدفع غير مدعومة.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"انتهت مهلة تحويل مبلغ الدفع.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"فشلت عملية تحويل مبلغ الدفع.","element.page.PAYPAL_OVERLAY_MESSAGE":"أكمل عملية الدفع في نافذة PayPal المفتوحة، أو أغلق PayPal لمتابعة الدفع باستخدام طرق أخرى."}},5488:function(e){e.exports={"page.wrong.error.message":"Error del sistema","ANTOMSDK.AMOUNT_VALUE_EMPTY":"L'import del pagament no pot estar buit.","ANTOMSDK.AMOUNT_VALUE_INVALID":"L'import del pagament ha de ser una cadena d'1 a 15 dígits ASCII que representi un valor superior a zero.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"L'import del pagament no coincideix amb la moneda de la sessió de pagament.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"La moneda de l'import del pagament no és compatible.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"La precisió de l'import del pagament no és compatible.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"La conversió de l'import del pagament ha caducat.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"La conversió de l'import del pagament ha fallat.","element.page.PAYPAL_OVERLAY_MESSAGE":"Completa el pagament a la finestra de PayPal oberta o tanca PayPal per continuar pagant amb altres mètodes."}},1829:function(e){e.exports={"page.wrong.error.message":"Systemfejl. Prøv venligst igen senere eller kontakt forhandleren.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Anmodningen er gået i timeout. Prøv venligst igen.","ANTOMSDK.UNKNOWN_ERROR":"Der opstod en ukendt fejl. Prøv venligst igen senere eller kontakt forhandleren.","antom.common.closing":"Lukning","ANTOMSDK.API_GATEWAY_TIMEOUT":"Anmodningen er gået i timeout. Prøv venligst igen.","ANTOMSDK.API_TIMEOUT":"Anmodningen er gået i timeout. Prøv venligst igen.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Betalingsbeløbet må ikke være tomt.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Betalingsbeløbet skal være en streng på 1 til 15 ASCII-cifre, der repræsenterer en værdi større end nul.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Betalingsbeløbets valuta stemmer ikke overens med betalingssessionens valuta.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Betalingsbeløbets valuta understøttes ikke.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Præcision af betalingsbeløb understøttes ikke.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Tidsgrænsen for konvertering af betalingsbeløb er udløbet.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Konverteringen af betalingsbeløbet mislykkedes."}},1379:function(e){e.exports={"page.wrong.error.message":"Ein Systemfehler ist aufgetreten. Bitte versuchen Sie es später erneut oder kontaktieren Sie den Händler.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut.","ANTOMSDK.UNKNOWN_ERROR":"Ein unbekannter Fehler ist aufgetreten. Bitte versuchen Sie es später erneut oder kontaktieren Sie den Händler.","antom.common.closing":"Wird geschlossen","ANTOMSDK.API_GATEWAY_TIMEOUT":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut.","ANTOMSDK.API_TIMEOUT":"Die Anfrage hat zu lange gedauert. Bitte versuchen Sie es erneut.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Der Zahlungsbetrag darf nicht leer sein.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Der Zahlungsbetrag muss eine Zeichenkette aus 1 bis 15 ASCII-Ziffern sein, die einen Wert größer als Null darstellt.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Die Währung des Zahlungsbetrags stimmt nicht mit der Währung der Zahlungssitzung überein.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Die Währung des Zahlungsbetrags wird nicht unterstützt.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Die Präzision des Zahlungsbetrags wird nicht unterstützt.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Die Umrechnung des Zahlungsbetrags ist aufgrund einer Zeitüberschreitung fehlgeschlagen.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Die Umwandlung des Zahlungsbetrags ist fehlgeschlagen.","element.page.PAYPAL_OVERLAY_MESSAGE":"Schließen Sie die Zahlung im geöffneten PayPal-Fenster ab oder schließen Sie PayPal, um mit einer anderen Zahlungsmethode fortzufahren."}},3541:function(e){e.exports={"page.wrong.error.message":"Σφάλμα συστήματος","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Το ποσό πληρωμής δεν μπορεί να είναι κενό.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Το ποσό πληρωμής πρέπει να είναι μια ακολουθία από 1 έως 15 ψηφία ASCII που αντιπροσωπεύει μια τιμή μεγαλύτερη από το μηδέν.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Το νόμισμα του ποσού πληρωμής δεν ταιριάζει με το νόμισμα της συνεδρίας πληρωμής.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Το νόμισμα του ποσού πληρωμής δεν υποστηρίζεται.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Η ακρίβεια του ποσού πληρωμής δεν υποστηρίζεται.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Το χρονικό όριο μετατροπής ποσού πληρωμής έληξε.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Η μετατροπή του ποσού πληρωμής απέτυχε.","element.page.PAYPAL_OVERLAY_MESSAGE":"Ολοκληρώστε την πληρωμή στο παράθυρο του PayPal που ανοίξατε ή κλείστε το PayPal για να συνεχίσετε την πληρωμή με άλλους τρόπους."}},5168:function(e){e.exports={"page.wrong.error.message":"System error. Please try again later or contact the merchant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Request timed out. Please try again.","ANTOMSDK.UNKNOWN_ERROR":"An unknown error occurred. Please try again later or contact the merchant.","antom.common.closing":"Closing","ANTOMSDK.API_GATEWAY_TIMEOUT":"Request timed out. Please try again.","ANTOMSDK.API_TIMEOUT":"Request timed out. Please try again.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Payment amount cannot be empty.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Payment amount must be a string of 1 to 15 ASCII digits representing a value greater than zero.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Payment amount currency does not match the payment session currency.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Payment amount currency is not supported.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Payment amount precision is not supported.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Payment amount conversion timed out.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Payment amount conversion failed.","element.page.PAYPAL_OVERLAY_MESSAGE":"Complete the payment in the opened PayPal window, or close PayPal to continue paying using other methods."}},7461:function(e){e.exports={"page.wrong.error.message":"Se ha producido un error en el sistema. Por favor, inténtelo de nuevo más tarde o contacte con el comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"La solicitud ha caducado, por favor inténtelo de nuevo.","ANTOMSDK.UNKNOWN_ERROR":"Se ha producido un error desconocido. Inténtelo de nuevo más tarde o póngase en contacto con el vendedor.","antom.common.closing":"Cerrando","ANTOMSDK.API_GATEWAY_TIMEOUT":"La solicitud ha caducado, por favor inténtelo de nuevo.","ANTOMSDK.API_TIMEOUT":"La solicitud ha caducado, por favor inténtelo de nuevo.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"El importe del pago no puede estar vacío.","ANTOMSDK.AMOUNT_VALUE_INVALID":"El importe del pago debe ser una cadena de 1 a 15 dígitos ASCII que represente un valor mayor que cero.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"La moneda del importe del pago no coincide con la moneda de la sesión de pago.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"La moneda del importe del pago no es compatible.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"No se admite la precisión del importe del pago.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Se ha agotado el tiempo de espera de la conversión del importe de pago.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"La conversión del importe del pago ha fallado.","element.page.PAYPAL_OVERLAY_MESSAGE":"Completa el pago en la ventana de PayPal abierta o cierra PayPal para seguir pagando con otros métodos."}},4045:function(e){e.exports={"page.wrong.error.message":"Süsteemiviga. Palun proovige hiljem uuesti või võtke ühendust kaupmehega.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Aeg on aegunud. Palun proovige uuesti.","ANTOMSDK.UNKNOWN_ERROR":"Tekkis tundmatu viga. Palun proovige hiljem uuesti või võtke ühendust kaupmehega.","antom.common.closing":"Sulgemine","ANTOMSDK.API_GATEWAY_TIMEOUT":"Aeg on aegunud. Palun proovige uuesti.","ANTOMSDK.API_TIMEOUT":"Aeg on aegunud. Palun proovige uuesti.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Makse summa ei tohi olla tühi.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Makse summa peab olema 1 kuni 15 ASCII numbrist koosnev string, mis esindab väärtust, mis on suurem kui null.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Maksesumma valuuta ei vasta maksesessiooni valuutale.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Makse summa valuuta ei ole toetatud.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Maksesumma täpsus ei ole toetatud.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Makse summa konverteerimine aegus.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Maksesumma konverteerimine ebaõnnestus."}},5045:function(e){e.exports={"page.wrong.error.message":"Järjestelmävirhe. Yritä myöhemmin uudelleen tai ota yhteyttä kauppiaaseen.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Pyynnön aikakatkaisu. Yritä uudelleen.","ANTOMSDK.UNKNOWN_ERROR":"Tuntematon virhe tapahtui. Yritä myöhemmin uudelleen tai ota yhteyttä kauppiaaseen.","antom.common.closing":"Suljetaan.","ANTOMSDK.API_GATEWAY_TIMEOUT":"Pyynnön aikakatkaisu. Yritä uudelleen.","ANTOMSDK.API_TIMEOUT":"Pyynnön aikakatkaisu. Yritä uudelleen.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Maksun määrä ei voi olla tyhjä.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Maksusumman tulee olla 1–15 ASCII-numeron jono, joka edustaa arvoa, joka on suurempi kuin nolla.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Maksusumman valuutta ei vastaa maksusession valuuttaa.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Maksusumman valuutta ei ole tuettu.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Maksusumman tarkkuutta ei tueta.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Maksusumman muuntaminen on aikakatkaistu.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Maksusumman muunnos epäonnistui."}},3409:function(e){e.exports={"page.wrong.error.message":"Une erreur système s'est produite. Veuillez réessayer plus tard ou contacter le commerçant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"La demande a expiré, veuillez réessayer.","ANTOMSDK.UNKNOWN_ERROR":"Une erreur inconnue s’est produite. Veuillez réessayer plus tard ou contacter le commerçant.","antom.common.closing":"Fermeture en cours","ANTOMSDK.API_GATEWAY_TIMEOUT":"La demande a expiré, veuillez réessayer.","ANTOMSDK.API_TIMEOUT":"La demande a expiré, veuillez réessayer.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Le montant du paiement ne peut pas être vide.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Le montant du paiement doit être une chaîne de 1 à 15 chiffres ASCII représentant une valeur supérieure à zéro.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"La devise du montant du paiement ne correspond pas à celle de la session de paiement.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"La devise du montant du paiement n'est pas prise en charge.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"La précision du montant du paiement n'est pas prise en charge.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Le délai de conversion du montant du paiement a expiré.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"La conversion du montant du paiement a échoué.","element.page.PAYPAL_OVERLAY_MESSAGE":"Finalisez le paiement dans la fenêtre PayPal ouverte ou fermez PayPal pour continuer avec un autre mode de paiement."}},6187:function(e){e.exports={"page.wrong.error.message":"सिस्टम में खराबी आ गई है। कृपया बाद में पुनः प्रयास करें या व्यापारी से संपर्क करें।","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।","ANTOMSDK.UNKNOWN_ERROR":"कोई अज्ञात त्रुटि उत्पन्न हुई। कृपया बाद में पुन: प्रयास करें या व्यापारी से संपर्क करें।","antom.common.closing":"बंद हो रहा है","ANTOMSDK.API_GATEWAY_TIMEOUT":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।","ANTOMSDK.API_TIMEOUT":"अनुरोध का समय समाप्त हो गया है, कृपया पुन: प्रयास करें।","ANTOMSDK.AMOUNT_VALUE_EMPTY":"भुगतान की राशि खाली नहीं हो सकती।","ANTOMSDK.AMOUNT_VALUE_INVALID":"भुगतान राशि 1 से 15 ASCII अंकों की एक स्ट्रिंग होनी चाहिए, जो शून्य से अधिक मान दर्शाती है।","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"भुगतान राशि की मुद्रा भुगतान सत्र की मुद्रा से मेल नहीं खाती है।","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"भुगतान राशि की मुद्रा समर्थित नहीं है।","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"भुगतान राशि की सटीकता समर्थित नहीं है।","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"भुगतान राशि रूपांतरण का समय समाप्त हो गया है।","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"भुगतान राशि रूपांतरण विफल रहा।","element.page.PAYPAL_OVERLAY_MESSAGE":"खुले हुए PayPal विंडो में भुगतान पूरा करें या अन्य तरीकों से भुगतान जारी रखने के लिए PayPal बंद करें।"}},1621:function(e){e.exports={"page.wrong.error.message":"Sistem sedang mengalami gangguan. Silakan coba lagi nanti atau hubungi penjual.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Permintaan habis waktu, silakan coba lagi.","ANTOMSDK.UNKNOWN_ERROR":"Terjadi kesalahan yang tidak diketahui. Silakan coba lagi nanti atau hubungi merchant.","antom.common.closing":"Sedang ditutup","ANTOMSDK.API_GATEWAY_TIMEOUT":"Permintaan habis waktu, silakan coba lagi.","ANTOMSDK.API_TIMEOUT":"Permintaan habis waktu, silakan coba lagi.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Jumlah pembayaran tidak boleh kosong.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Jumlah pembayaran harus berupa string yang terdiri dari 1 hingga 15 digit ASCII yang mewakili nilai lebih dari nol.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Jumlah mata uang pembayaran tidak sesuai dengan mata uang sesi pembayaran.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Jumlah pembayaran mata uang tidak didukung.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Presisi jumlah pembayaran tidak didukung.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Waktu konversi jumlah pembayaran telah habis.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Konversi jumlah pembayaran gagal.","element.page.PAYPAL_OVERLAY_MESSAGE":"Selesaikan pembayaran di jendela PayPal yang terbuka, atau tutup PayPal untuk melanjutkan pembayaran dengan metode lain."}},8010:function(e,t,n){var r={},o="en-US";for(var i in r["en-US"]=r["en-us"]=n(5168),r["pt-BR"]=r["pt-br"]=n(3029),r["es-ES"]=r["es-es"]=n(7461),r["ko-KR"]=r["ko-kr"]=n(6362),r["zh-CN"]=r["zh-cn"]=n(370),r["zh-HK"]=r["zh-hk"]=n(5598),r["ms-MY"]=r["ms-my"]=n(171),r["in-ID"]=r["in-id"]=n(1621),r["th-TH"]=r["th-th"]=n(4909),r["vi-VN"]=r["vi-vn"]=n(4734),r["tl-PH"]=r["tl-ph"]=n(7077),r["it-IT"]=r["it-it"]=n(955),r["de-DE"]=r["de-de"]=n(1379),r["fr-FR"]=r["fr-fr"]=n(3409),r["nl-NL"]=r["nl-nl"]=n(5241),r["ja-JP"]=r["ja-jp"]=n(4328),r.ro=r.ro=n(4731),r["pl-PL"]=r["pl-pl"]=n(3669),r["ar-SA"]=r["ar-sa"]=n(7312),r["tr-TR"]=r["tr-tr"]=n(3405),r["hi-IN"]=r["hi-in"]=n(6187),r["pt-PT"]=r["pt-pt"]=n(9669),r.ca=r.ca=n(5488),r.el=r.el=n(3541),r.sw=r.sw=n(7286),r["da-DK"]=r["da-dk"]=n(1829),r.et=r.et=n(4045),r.fi=r.fi=n(5045),r.lv=r.lv=n(1922),r.lt=r.lt=n(168),r["sv-SE"]=r["sv-se"]=n(2470),r.mn=r.mn=n(5115),r)if(r.hasOwnProperty(i)&&i!=o)for(var a in r[o])r[o].hasOwnProperty(a)&&(r[i].hasOwnProperty(a)||(r[i][a]=r[o][a]));r.appName="antom-web-checkout",r.defaultLocale=o,r.groupName="antomsdk",e.exports=r},955:function(e){e.exports={"page.wrong.error.message":"Si è verificato un errore di sistema, riprova più tardi o contatta il commerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Richiesta scaduta, per favore riprova.","ANTOMSDK.UNKNOWN_ERROR":"Si è verificato un errore sconosciuto. Per favore, riprova più tardi o contatta il commerciante.","antom.common.closing":"In chiusura","ANTOMSDK.API_GATEWAY_TIMEOUT":"Richiesta scaduta, per favore riprova.","ANTOMSDK.API_TIMEOUT":"Richiesta scaduta, per favore riprova.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"L'importo del pagamento non può essere vuoto.","ANTOMSDK.AMOUNT_VALUE_INVALID":"L'importo del pagamento deve essere una stringa di 1-15 cifre ASCII che rappresenta un valore maggiore di zero.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"La valuta dell'importo del pagamento non corrisponde a quella della sessione di pagamento.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"La valuta dell'importo del pagamento non è supportata.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"La precisione dell'importo del pagamento non è supportata.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"La conversione dell'importo del pagamento è scaduta.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"La conversione dell'importo del pagamento è fallita.","element.page.PAYPAL_OVERLAY_MESSAGE":"Completa il pagamento nella finestra PayPal aperta oppure chiudi PayPal per continuare a pagare con altri metodi."}},4328:function(e){e.exports={"page.wrong.error.message":"システムに異常が発生しました。後ほど再試行するか、店舗にお問い合わせください。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"リクエストがタイムアウトしました。もう一度お試しください。","ANTOMSDK.UNKNOWN_ERROR":"不明なエラーが発生しました。後でもう一度お試しいただくか、販売者にお問い合わせください。","antom.common.closing":"閉じています","ANTOMSDK.API_GATEWAY_TIMEOUT":"リクエストがタイムアウトしました。もう一度お試しください。","ANTOMSDK.API_TIMEOUT":"リクエストがタイムアウトしました。もう一度お試しください。","ANTOMSDK.AMOUNT_VALUE_EMPTY":"支払い金額は空にできません。","ANTOMSDK.AMOUNT_VALUE_INVALID":"支払い金額は、0より大きい値を表す1から15桁のASCII数字の文字列である必要があります。","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"支払い金額の通貨が支払いセッションの通貨と一致していません。","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"お支払い金額の通貨はサポートされていません。","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"支払い金額の精度はサポートされていません。","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"支払い金額の変換がタイムアウトしました。","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"支払い金額の変換に失敗しました。","element.page.PAYPAL_OVERLAY_MESSAGE":"開いたPayPalウィンドウでお支払いを完了するか、PayPalを閉じて別のお支払い方法をご利用ください。"}},6362:function(e){e.exports={"page.wrong.error.message":"시스템 오류가 발생했습니다. 잠시 후 다시 시도하시거나 상점에 문의해 주세요.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"요청 시간이 초과되었습니다. 다시 시도해 주세요.","ANTOMSDK.UNKNOWN_ERROR":"알 수 없는 오류가 발생했습니다. 나중에 다시 시도하시거나 상점에 문의해 주세요.","antom.common.closing":"닫는 중","ANTOMSDK.API_GATEWAY_TIMEOUT":"요청 시간이 초과되었습니다. 다시 시도해 주세요.","ANTOMSDK.API_TIMEOUT":"요청 시간이 초과되었습니다. 다시 시도해 주세요.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"결제 금액은 비워둘 수 없습니다.","ANTOMSDK.AMOUNT_VALUE_INVALID":"지불 금액은 1에서 15개의 ASCII 숫자로이루어진 문자열이어야 하며, 0보다 큰 값을나타내야 합니다.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"결제 금액의 통화가 결제 세션의 통화와 일치하지 않습니다.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"결제 금액 통화는 지원되지 않습니다.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"결제 금액의 정밀도는 지원되지 않습니다.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"결제 금액 변환이 시간 초과되었습니다.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"결제 금액 변환에 실패했습니다.","element.page.PAYPAL_OVERLAY_MESSAGE":"열린 PayPal 창에서 결제를 완료하거나 PayPal을 닫고 다른 결제 수단으로 계속 결제하세요."}},168:function(e){e.exports={"page.wrong.error.message":"Sistemos klaida. Bandykite dar kartą vėliau arba susisiekite su pardavėju.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Užklausos laikas baigėsi. Prašome pabandyti dar kartą.","ANTOMSDK.UNKNOWN_ERROR":"Įvyko nežinoma klaida. Pabandykite dar kartą vėliau arba susisiekite su prekybininku.","antom.common.closing":"Uždarymas","ANTOMSDK.API_GATEWAY_TIMEOUT":"Užklausos laikas baigėsi. Prašome pabandyti dar kartą.","ANTOMSDK.API_TIMEOUT":"Užklausos laikas baigėsi. Prašome pabandyti dar kartą.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Mokėjimo suma negali būti tuščia.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Mokėjimo suma turi būti 1–15 ASCII skaitmenų eilutė, reiškianti didesnę nei nulis vertę.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Mokėjimo sumos valiuta nesutampa su mokėjimo sesijos valiuta.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Mokėjimo sumos valiuta nepalaikoma.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Mokėjimo sumos tikslumas nepalaikomas.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Mokėjimo sumos konvertavimo laikas baigėsi.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Mokėjimo sumos konvertavimas nepavyko."}},1922:function(e){e.exports={"page.wrong.error.message":"Sistēmas kļūda. Lūdzu, mēģiniet vēlreiz vēlāk vai sazinieties ar tirgotāju.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Pieprasījuma laiks ir beidzies. Lūdzu, mēģiniet vēlreiz.","ANTOMSDK.UNKNOWN_ERROR":"Notika nezināma kļūda. Lūdzu, mēģiniet vēlreiz vēlāk vai sazinieties ar tirgotāju.","antom.common.closing":"Aizvērt","ANTOMSDK.API_GATEWAY_TIMEOUT":"Pieprasījuma laiks ir beidzies. Lūdzu, mēģiniet vēlreiz.","ANTOMSDK.API_TIMEOUT":"Pieprasījuma laiks ir beidzies. Lūdzu, mēģiniet vēlreiz.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Maksājuma summa nedrīkst būt tukša.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Maksājuma summai jābūt virknei no 1 līdz 15 ASCII cipariem, kas apzīmē vērtību, kas ir lielāka par nulli.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Maksājuma summas valūta neatbilst maksājuma sesijas valūtai.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Maksājuma summas valūta netiek atbalstīta.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Maksājuma summas precizitāte nav atbalstīta.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Maksājuma summas konvertēšanas laiks ir beidzies.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Maksājuma summas konvertēšana neizdevās."}},5115:function(e){e.exports={"page.wrong.error.message":"Системийн алдаа. Дахин оролдоно уу эсвэл худалдаачинтай холбогдоно уу.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Хүсэлт хугацаа дууссан. Дахин оролдоно уу.","ANTOMSDK.UNKNOWN_ERROR":"Тодорхойгүй алдаа гарлаа. Дахин оролдоно уу эсвэл худалдаачинтай холбогдоно уу.","antom.common.closing":"Хаалт хийх","ANTOMSDK.API_GATEWAY_TIMEOUT":"Хүсэлтийн хугацаа дууссан. Дахин оролдоно уу.","ANTOMSDK.API_TIMEOUT":"Хүсэлтийн хугацаа дууссан. Дахин оролдоно уу.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Төлбөрийн дүн хоосон байж болохгүй.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Төлбөрийн хэмжээ нь тэгээс их утгыг төлөөлж 1-ээс 15 ASCII оронтой мөр байх ёстой.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Төлбөрийн дүнгийн валют нь төлбөрийн сессийн валюттай таарахгүй байна.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Төлбөрийн дүнгийн валют дэмжигдээгүй байна.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Төлбөрийн дүнгийн нарийвчлал дэмжигддэггүй.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Төлбөрийн дүнгийн хөрвүүлэлтийн хугацаа дууссан.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Төлбөрийн дүнгийн хөрвүүлэлт амжилтгүй болсон."}},171:function(e){e.exports={"page.wrong.error.message":"Sistem mengalami masalah, sila cuba lagi nanti atau hubungi peniaga.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Masa permintaan tamat, sila cuba lagi.","ANTOMSDK.UNKNOWN_ERROR":"Ralat yang tidak diketahui telah berlaku. Sila cuba lagi kemudian atau hubungi pedagang.","antom.common.closing":"Sedang ditutup","ANTOMSDK.API_GATEWAY_TIMEOUT":"Masa permintaan tamat, sila cuba lagi.","ANTOMSDK.API_TIMEOUT":"Masa permintaan tamat, sila cuba lagi.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Jumlah pembayaran tidak boleh kosong.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Jumlah pembayaran mesti merupakan rentetan 1 hingga 15 digit ASCII yang mewakili nilai lebih besar daripada sifar.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Jumlah mata wang pembayaran tidak sepadan dengan mata wang sesi pembayaran.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Jumlah mata wang pembayaran tidak disokong.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Ketepatan jumlah pembayaran tidak disokong.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Penukaran jumlah pembayaran tamat tempoh.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Penukaran jumlah pembayaran gagal.","element.page.PAYPAL_OVERLAY_MESSAGE":"Lengkapkan pembayaran dalam tetingkap PayPal yang dibuka, atau tutup PayPal untuk terus membayar menggunakan kaedah lain."}},5241:function(e){e.exports={"page.wrong.error.message":"Er is een systeemfout opgetreden. Probeer het later opnieuw of neem contact op met de verkoper.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw.","ANTOMSDK.UNKNOWN_ERROR":"Er is een onbekende fout opgetreden. Probeer het later opnieuw of neem contact op met de verkoper.","antom.common.closing":"Sluiten...","ANTOMSDK.API_GATEWAY_TIMEOUT":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw.","ANTOMSDK.API_TIMEOUT":"Het verzoek is verlopen, probeer het alsjeblieft opnieuw.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Het betalingsbedrag mag niet leeg zijn.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Het betalingsbedrag moet een reeks van 1 tot 15 ASCII-cijfers zijn die een waarde groter dan nul vertegenwoordigt.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"De valuta van het betalingsbedrag komt niet overeen met de valuta van de betalingssessie.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"De valuta van het betalingsbedrag wordt niet ondersteund.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"De precisie van het betalingsbedrag wordt niet ondersteund.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"De conversie van het betalingsbedrag is verlopen.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"De conversie van het betalingsbedrag is mislukt.","element.page.PAYPAL_OVERLAY_MESSAGE":"Rond de betaling af in het geopende PayPal-venster of sluit PayPal om door te gaan met betalen via andere methoden."}},3669:function(e){e.exports={"page.wrong.error.message":"Wystąpił błąd systemu, spróbuj ponownie później lub skontaktuj się z sprzedawcą.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Przekroczono limit czasu żądania. Proszę spróbować ponownie.","ANTOMSDK.UNKNOWN_ERROR":"Wystąpił nieznany błąd. Proszę spróbować ponownie później lub skontaktować się z sprzedawcą.","antom.common.closing":"Zamknięte","ANTOMSDK.API_GATEWAY_TIMEOUT":"Przekroczono limit czasu żądania. Proszę spróbować ponownie.","ANTOMSDK.API_TIMEOUT":"Przekroczono limit czasu żądania. Proszę spróbować ponownie.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Kwota płatności nie może być pusta.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Kwota płatności musi być ciągiem od 1 do 15 cyfr ASCII, reprezentującym wartość większą niż zero.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Waluta kwoty płatności nie jest zgodna z walutą sesji płatności.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Waluta kwoty płatności nie jest obsługiwana.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Precyzja kwoty płatności nie jest obsługiwana.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Upłynął limit czasu konwersji kwoty płatności.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Konwersja kwoty płatności nie powiodła się.","element.page.PAYPAL_OVERLAY_MESSAGE":"Dokończ płatność w otwartym oknie PayPal lub zamknij PayPal, aby kontynuować płatność inną metodą."}},3029:function(e){e.exports={"page.wrong.error.message":"Ocorreu um erro no sistema. Por favor, tente novamente mais tarde ou entre em contato com o comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"O tempo de solicitação expirou. Por favor, tente novamente.","ANTOMSDK.UNKNOWN_ERROR":"Ocorreu um erro desconhecido. Por favor, tente novamente mais tarde ou entre em contato com o comerciante.","antom.common.closing":"Fechando...","ANTOMSDK.API_GATEWAY_TIMEOUT":"O tempo de solicitação expirou. Por favor, tente novamente.","ANTOMSDK.API_TIMEOUT":"O tempo de solicitação expirou. Por favor, tente novamente.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"O valor do pagamento não pode estar vazio.","ANTOMSDK.AMOUNT_VALUE_INVALID":"O valor do pagamento deve ser uma sequência de 1 a 15 dígitos ASCII representando um valor maior que zero.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"A moeda do valor do pagamento não corresponde à moeda da sessão de pagamento.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"A moeda do valor do pagamento não é suportada.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"A precisão do valor do pagamento não é suportada.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"O tempo para conversão do valor do pagamento expirou.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Falha na conversão do valor do pagamento.","element.page.PAYPAL_OVERLAY_MESSAGE":"Conclua o pagamento na janela do PayPal aberta ou feche o PayPal para continuar pagando com outros métodos."}},9669:function(e){e.exports={"page.wrong.error.message":"Ocorreu um erro no sistema. Por favor, tente novamente mais tarde ou contacte o comerciante.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"O tempo de espera esgotou-se. Por favor, tente novamente.","ANTOMSDK.UNKNOWN_ERROR":"Ocorreu um erro desconhecido. Por favor, tente novamente mais tarde ou contacte o comerciante.","antom.common.closing":"A fechar...","ANTOMSDK.API_GATEWAY_TIMEOUT":"A solicitação expirou. Tente novamente.","ANTOMSDK.API_TIMEOUT":"O tempo de espera esgotou-se. Por favor, tente novamente.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"O valor do pagamento não pode estar vazio.","ANTOMSDK.AMOUNT_VALUE_INVALID":"O valor do pagamento deve ser uma sequência de 1 a 15 dígitos ASCII que represente um valor superior a zero.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"A moeda do montante do pagamento não corresponde à moeda da sessão de pagamento.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"A moeda do montante do pagamento não é suportada.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"A precisão do montante do pagamento não é suportada.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"O tempo limite para conversão do valor do pagamento foi excedido.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Falha na conversão do valor do pagamento.","element.page.PAYPAL_OVERLAY_MESSAGE":"Conclua o pagamento na janela do PayPal aberta ou feche o PayPal para continuar a pagar com outros métodos."}},4731:function(e){e.exports={"page.wrong.error.message":"Eroare de sistem. Vă rugăm să încercați mai târziu sau să contactați comerciantul.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Cererea a expirat. Vă rugăm să încercați din nou.","ANTOMSDK.UNKNOWN_ERROR":"A apărut o eroare necunoscută. Vă rugăm să încercați din nou mai târziu sau să contactați comerciantul.","antom.common.closing":"Închidere în curs","ANTOMSDK.API_GATEWAY_TIMEOUT":"Cererea a expirat. Vă rugăm să încercați din nou.","ANTOMSDK.API_TIMEOUT":"Cererea a expirat. Vă rugăm să încercați din nou.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Suma plății nu poate fi goală.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Suma plății trebuie să fie un șir de 1 până la 15 cifre ASCII care reprezintă o valoare mai mare decât zero.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Valuta sumei de plată nu se potrivește cu valuta sesiunii de plată.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Moneda pentru suma de plată nu este acceptată.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Precizia sumei plății nu este suportată.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Timpul pentru conversia sumei de plată a expirat.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Conversia sumei de plată a eșuat.","element.page.PAYPAL_OVERLAY_MESSAGE":"Finalizați plata în fereastra PayPal deschisă sau închideți PayPal pentru a continua plata folosind alte metode."}},2470:function(e){e.exports={"page.wrong.error.message":"Systemfel. Försök igen senare eller kontakta handlaren.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Begäran har gått ut. Vänligen försök igen.","ANTOMSDK.UNKNOWN_ERROR":"Ett okänt fel uppstod. Försök igen senare eller kontakta handlaren.","antom.common.closing":"Stängning","ANTOMSDK.API_GATEWAY_TIMEOUT":"Begäran har gått ut. Vänligen försök igen.","ANTOMSDK.API_TIMEOUT":"Begäran har gått ut. Vänligen försök igen.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Betalningsbeloppet kan inte vara tomt.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Betalningsbeloppet måste vara en sträng av 1 till 15 ASCII-siffror som representerar ett värde större än noll.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Valutan för betalningsbeloppet matchar inte valutan för betalningssessionen.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Valutan för betalningsbeloppet stöds inte.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Betalningsbeloppets precision stöds inte.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Tidsgränsen för konvertering av betalningsbelopp har löpt ut.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Konverteringen av betalningsbeloppet misslyckades."}},7286:function(e){e.exports={"page.wrong.error.message":"Hitilafu ya mfumo. Tafadhali jaribu tena baadaye au wasiliana na mfanyabiashara.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Begäran tog för lång tid. Vänligen försök igen.","ANTOMSDK.UNKNOWN_ERROR":"Hitilafu isiyojulikana ilitokea. Tafadhali jaribu tena baadaye au wasiliana na mfanyabiashara.","ANTOMSDK.API_GATEWAY_TIMEOUT":"Begäran tog för lång tid. Vänligen försök igen.","ANTOMSDK.API_TIMEOUT":"Begäran tog för lång tid. Vänligen försök igen.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Kiasi cha malipo hakiwezi kuwa tupu.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Kiasi cha malipo lazima iwe kamba ya tarakimu 1 hadi 15 za ASCII zinazowakilisha thamani kubwa kuliko sifuri.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Fedha ya malipo hailingani na sarafu ya kikao cha malipo.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Sarafu ya kiasi cha malipo haitumiki.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Usahihi wa kiasi cha malipo hauungwa mkono.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Muda wa ubadilishaji wa kiasi cha malipo umekwisha.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Ubadilishaji wa kiasi cha malipo ulishindwa."}},4909:function(e){e.exports={"page.wrong.error.message":"ระบบผิดปกติ กรุณาลองอีกครั้งในภายหลังหรือ ติดต่อผู้ค้า","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"คําขอหมดเวลา โปรดลองอีกครั้ง","ANTOMSDK.UNKNOWN_ERROR":"เกิดข้อผิดพลาดที่ไม่ทราบสาเหตุ โปรดลองใหม่อีกครั้งในภายหลังหรือติดต่อผู้ขาย","antom.common.closing":"กำลังปิด","ANTOMSDK.API_GATEWAY_TIMEOUT":"การร้องขอหมดเวลา กรุณาลองอีกครั้ง。","ANTOMSDK.API_TIMEOUT":"การร้องขอหมดเวลา กรุณาลองอีกครั้ง。","ANTOMSDK.AMOUNT_VALUE_EMPTY":"จำนวนเงินที่ต้องชำระต้องไม่ว่างเปล่า","ANTOMSDK.AMOUNT_VALUE_INVALID":"จำนวนเงินต้องเป็นสตริงที่มีตัวเลข ASCII ตั้งแต่ 1 ถึง 15 หลัก ซึ่งแสดงถึงค่าที่มากกว่าศูนย์","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"สกุลเงินจำนวนเงินชำระไม่ตรงกับสกุลเงินของเซสชันการชำระเงิน","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"ระบบไม่รองรับสกุลเงินที่ใช้ในการชำระเงิน","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"ระบบไม่รองรับการระบุจำนวนเงินที่ชำระอย่างแม่นยำ","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"การแปลงจำนวนเงินชำระหมดเวลา","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"การแปลงจำนวนเงินที่ชำระล้มเหลว","element.page.PAYPAL_OVERLAY_MESSAGE":"ดำเนินการชำระเงินให้เสร็จสิ้นในหน้าต่าง PayPal ที่เปิดอยู่ หรือปิด PayPal เพื่อชำระเงินต่อด้วยวิธีอื่น ๆ"}},7077:function(e){e.exports={"page.wrong.error.message":"May problema sa sistema. Pakisubukang muli mamaya o makipag-ugnayan sa merchant.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Naubusan ng oras ang kahilingan, pakisubukang muli.","ANTOMSDK.UNKNOWN_ERROR":"Nagkaroon ng hindi kilalang error. Pakisubukan muli mamaya o makipag-ugnayan sa nagbenta.","antom.common.closing":"Nakasara","ANTOMSDK.API_GATEWAY_TIMEOUT":"Naubusan ng oras ang kahilingan, pakisubukang muli.","ANTOMSDK.API_TIMEOUT":"Naubusan ng oras ang kahilingan, pakisubukang muli.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Ang halaga ng pagbabayad ay hindi maaaring walang laman.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Ang halaga ng pagbabayad ay dapat isang string ng 1 hanggang 15 ASCII na mga digit na kumakatawan sa isang halaga na higit sa zero.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Ang currency ng halaga ng bayad ay hindi tumutugma sa currency ng sesyon ng bayad.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Hindi sinusuportahan ang halaga ng bayad at ang currency nito.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Hindi suportado ang katumpakan ng halaga ng pagbabayad","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Ang pag-convert ng halagang bayad ay na-time out.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Nabigo ang pag-convert ng halaga ng bayad.","element.page.PAYPAL_OVERLAY_MESSAGE":"Kumpletuhin ang bayad sa nakabukas na window ng PayPal, o isara ang PayPal para magpatuloy sa pagbabayad gamit ang iba pang paraan."}},3405:function(e){e.exports={"page.wrong.error.message":"Sistem hatası, lütfen daha sonra tekrar deneyin veya satıcıyla iletişime geçin.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"İstek zaman aşımına uğradı, lütfen tekrar deneyin.","ANTOMSDK.UNKNOWN_ERROR":"Bilinmeyen bir hata oluştu. Lütfen daha sonra tekrar deneyin veya satıcıyla iletişime geçin.","antom.common.closing":"Kapatılıyor","ANTOMSDK.API_GATEWAY_TIMEOUT":"İstek zaman aşımına uğradı, lütfen tekrar deneyin.","ANTOMSDK.API_TIMEOUT":"İstek zaman aşımına uğradı, lütfen tekrar deneyin.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Ödeme tutarı boş olamaz.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Ödeme tutarı, sıfırdan büyük bir değeri temsil eden 1 ila 15 basamaklı ASCII rakamlarından oluşan bir dize olmalıdır.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Ödeme tutarının para birimi, ödeme oturumunun para birimiyle eşleşmiyor.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Ödeme tutarı para birimi desteklenmiyor.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Ödeme tutarı hassasiyeti desteklenmiyor.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Ödeme tutarı dönüşümü zaman aşımına uğradı.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Ödeme tutarı dönüştürülemedi.","element.page.PAYPAL_OVERLAY_MESSAGE":"Ödemeyi açılan PayPal penceresinde tamamlayın veya diğer ödeme yöntemlerini kullanmaya devam etmek için PayPal’ı kapatın."}},4734:function(e){e.exports={"page.wrong.error.message":"Hệ thống đang gặp sự cố. Vui lòng thử lại sau hoặc liên hệ với người bán.","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"Yêu cầu đã hết thời gian, vui lòng thử lại.","ANTOMSDK.UNKNOWN_ERROR":"Đã xảy ra lỗi không xác định. Vui lòng thử lại sau hoặc liên hệ với người bán.","antom.common.closing":"Đang đóng lại","ANTOMSDK.API_GATEWAY_TIMEOUT":"Yêu cầu đã hết thời gian, vui lòng thử lại.","ANTOMSDK.API_TIMEOUT":"Yêu cầu đã hết thời gian, vui lòng thử lại.","ANTOMSDK.AMOUNT_VALUE_EMPTY":"Số tiền thanh toán không được để trống.","ANTOMSDK.AMOUNT_VALUE_INVALID":"Số tiền thanh toán phải là một chuỗi gồm 1 đến 15 chữ số ASCII đại diện cho giá trị lớn hơn 0.","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"Đơn vị tiền tệ của số tiền thanh toán không khớp với đơn vị tiền tệ của phiên thanh toán.","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"Loại tiền tệ của số tiền thanh toán không được hỗ trợ.","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"Tính năng hiển thị số tiền thanh toán chính xác hiện không được hỗ trợ.","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"Thời gian chuyển đổi số tiền thanh toán đã hết.","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"Chuyển đổi số tiền thanh toán không thành công.","element.page.PAYPAL_OVERLAY_MESSAGE":"Hoàn tất thanh toán trong cửa sổ PayPal đã mở hoặc đóng PayPal để tiếp tục thanh toán bằng phương thức khác."}},370:function(e){e.exports={"page.wrong.error.message":"系统异常,请稍后重试或联系商户。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"请求超时,请重试。","ANTOMSDK.UNKNOWN_ERROR":"发生了未知错误。请稍后再试或联系商家。","antom.common.closing":"关闭中","ANTOMSDK.API_GATEWAY_TIMEOUT":"请求超时,请重试。","ANTOMSDK.API_TIMEOUT":"请求超时,请重试。","ANTOMSDK.AMOUNT_VALUE_EMPTY":"付款金额不能为空。","ANTOMSDK.AMOUNT_VALUE_INVALID":"付款金额必须是一个由 1 到 15 个 ASCII 数字组成的字符串,表示一个大于零的值。","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"支付金额的货币与支付会话的货币不匹配。","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"不支持该支付金额的货币。","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"不支持支付金额的精确度。","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"付款金额转换超时。","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"付款金额转换失败。","element.page.PAYPAL_OVERLAY_MESSAGE":"请在已打开的 PayPal 窗口中完成付款,或关闭 PayPal 窗口,以便继续使用其他方式付款。"}},5598:function(e){e.exports={"page.wrong.error.message":"系統異常,請稍後重試或聯絡商戶。","ANTOMSDK.LAUNCH_PAYMENT_APP_ERROR":"請求超時,請重試。","ANTOMSDK.UNKNOWN_ERROR":"發生未知錯誤。請稍後再試或聯絡商戶。","antom.common.closing":"關閉中","ANTOMSDK.API_GATEWAY_TIMEOUT":"請求超時,請重試。","ANTOMSDK.API_TIMEOUT":"請求超時,請重試。","ANTOMSDK.AMOUNT_VALUE_EMPTY":"付款金額不能為空。","ANTOMSDK.AMOUNT_VALUE_INVALID":"付款金額必須是一串由 1 至 15 個 ASCII 數字組成,且代表的值必須大於零。","ANTOMSDK.AMOUNT_CURRENCY_MISMATCH":"付款金額的貨幣與付款會話的貨幣不符。","ANTOMSDK.AMOUNT_CURRENCY_UNSUPPORTED":"不支持該付款金額的貨幣。","ANTOMSDK.AMOUNT_PRECISION_UNSUPPORTED":"不支援付款金額的精確度。","ANTOMSDK.AMOUNT_RESOLVE_TIMEOUT":"付款金額轉換超時。","ANTOMSDK.AMOUNT_RESOLVE_FAILED":"付款金額轉換失敗。","element.page.PAYPAL_OVERLAY_MESSAGE":"請在已開啟的 PayPal 視窗中完成付款,或關閉 PayPal,繼續使用其他付款方式。"}},1762:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.loadScript=void 0,t.createSingletonInstance=l,t.createInstance=c,t.createLoader=function(e){var t=this,n=e.sdkURL,s=e.globalName,u=e.timeout,d=void 0===u?2e4:u,p=e.onLoadComplete,h=e.onError,m=e.onLoadStart,f=e.onInitialized,v=e.single,g=void 0===v||v,y=e.namespace;return function(e){return r(t,void 0,void 0,(function(){var t,u,v=this;return o(this,(function(_){var E,b;return null==m||m(),t=Date.now(),i.tracker.log({code:"7988",msg:y,d1:"loadStart",d2:"无",d3:"无",d4:"无",d5:"npm",m1:0,m2:0}),E=function(){return(0,a.loadScriptClass)(n,s)},b=d,u=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Promise.race([new Promise((function(e,t){setTimeout((function(){t(new a.LoaderError("LOAD_TIMEOUT","Load timeout: ".concat(b)))}),b)})),E.apply(void 0,e)])},[2,u().then((function(n){return r(v,[n],void 0,(function(n){var r,u,d,h=n.variable,m=n.cache;return o(this,(function(n){switch(n.label){case 0:if(r=Date.now(),m||i.tracker.log({code:"7988",msg:y,d1:"loadComplete",d2:"无",d3:"无",d4:(null==h?void 0:h.version)||"无",d5:"npm",m1:Math.round(Date.now()-t),m2:0}),null==p||p(),!h)throw new a.LoaderError("NO_REMOTE_CLASS","No variables ".concat(s," were found. Cannot be initialized the Class ").concat(s));n.label=1;case 1:return n.trys.push([1,3,,4]),[4,(g?l:c)(h,e,void 0)];case 2:return u=n.sent(),i.tracker.log({code:"7988",msg:y,d1:"initialized",d2:"无",d3:"无",d4:u.version||"无版本号",d5:"npm",m1:Math.round(Date.now()-t),m2:Math.round(Date.now()-r)}),null==f||f(u,window.location.href),[2,u];case 3:throw d=n.sent(),new a.LoaderError("INIT_ERROR","Initialize Class ".concat(s," failed: ").concat(d.message));case 4:return[2]}}))}))})).catch((function(e){var n=a.LoaderError.unificationError(e);return i.tracker.log({code:"7988",msg:y,d1:"createError",d2:n.code,d3:n.message,d4:"无",d5:"npm",m1:Math.round(Date.now()-t),m2:0}),null==h||h(n),Promise.reject(e)}))]}))}))}};var i=n(1159),a=n(1858);Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return a.loadScript}});var s=null;function l(e,t,n){return s=s?s.then((function(r){return r.isDestroyed?c(e,t,n):r})):c(e,t,n)}function c(e,t,n){var r=new e(t),o=Date.now();return r.init().then((function(e){return n&&i.tracker.log({code:"7988",msg:n,d1:"initialized",d2:"无",d3:"无",d4:r.version||"无版本号",d5:"umd",m1:Math.round(Date.now()-o),m2:Math.round(Date.now()-o)}),e})).catch((function(e){var t=new a.LoaderError("INIT_ERROR","Initialize Class failed: ".concat(e.message));throw n&&i.tracker.log({code:"7988",msg:n,d1:"createError",d2:t.code,d3:t.message,d4:"无",d5:"umd",m1:Math.round(Date.now()-o),m2:0}),t}))}},1159:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.tracker=t.ScriptTracker=void 0;var a=n(1858),s=function(){function e(e){Object.defineProperty(this,"initOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracker",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.initOptions=e}return Object.defineProperty(e.prototype,"loadTacker",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return(0,a.loadScript)("https://cdn.marmot-cloud.com/tnpm-package/@antintl-intl-tracker/1.3.0/dist/common.min.js","CompatibleTrackerFull").then((function(t){var n=null==t?void 0:t.variable;if(n)return new n(r({compactExtraInfo:!0,appId:"180020050100012557"},e.initOptions))})).catch((function(){}))}}),Object.defineProperty(e.prototype,"getTracker",{enumerable:!1,configurable:!0,writable:!0,value:function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return this.tracker?[2,this.tracker]:[4,this.loadTacker()];case 1:return(e=t.sent())&&(e.set({keyFormat:"origin",userPathAuto:!1}),this.tracker=e),[2,e]}}))}))}}),Object.defineProperty(e.prototype,"safeCall",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.getTracker().then(e)}}),Object.defineProperty(e.prototype,"log",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.safeCall((function(t){return null==t?void 0:t.log.apply(t,e)}))}}),e}();t.ScriptTracker=s;var l=(null==="DEV"?void 0:"DEV".toUpperCase())||"PROD",c=["DEV","SIT","PRE","PROD","LOCAL"].includes(l)?l:"PROD";t.tracker=new s({appId:"180020050100012557",env:c,server:"sg",performance:!1,error:!1})},1858:function(e,t){"use strict";var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.LoaderError=void 0,t.loadScriptClass=function(e,t){return i(e,t)},t.loadScript=i;var o=function(e){function t(t,n){var r=e.call(this,n)||this;return Object.defineProperty(r,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r.name="LoaderError",r.code=t,r}return r(t,e),Object.defineProperty(t,"unificationError",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e instanceof t||e instanceof Error&&"LoaderError"===e.name?e:new t("UNKNOWN_ERROR",e instanceof Error?e.message:"An unknown error occurred.")}}),t}(Error);function i(e,t){var n=function(){if("function"==typeof t)return t();var e=window[t];return(null==e?void 0:e.default)||e};return new Promise((function(t,r){var i=n();if(i)return t({cache:!0,variable:i});var a=document.querySelector('script[src="'.concat(e,'"]')),s=a||document.createElement("script");s.src=e,s.async=!0,s.addEventListener("load",(function(){t({cache:!1,variable:n()})})),s.addEventListener("error",(function(t){r(new o("LOAD_ERROR","Load script ".concat(e," failed: ").concat(t.message)))})),a||document.head.appendChild(s)}))}t.LoaderError=o},245:function(e,t,n){var r=n(7065).default,o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,c="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,u="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=Object.prototype.toString,h=Math.max,m=Math.min,f=function(){return d.Date.now()};function v(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function g(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==p.call(e)}function y(e){if("number"==typeof e)return e;if(g(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=a.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,i,a,s,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}function _(e){return c=e,s=setTimeout(b,t),u?g(e):a}function E(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function b(){var e=f();if(E(e))return A(e);s=setTimeout(b,function(e){var n=t-(e-l);return d?m(n,i-(e-c)):n}(e))}function A(e){return s=void 0,p&&r?g(e):(r=o=void 0,a)}function S(){var e=f(),n=E(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return _(l);if(d)return s=setTimeout(b,t),g(l)}return void 0===s&&(s=setTimeout(b,t)),a}return t=y(t)||0,v(n)&&(u=!!n.leading,i=(d="maxWait"in n)?h(y(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),S.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},S.flush=function(){return void 0===s?a:A(f())},S}},9034:function(e,t,n){var r=n(7065).default,o="__lodash_hash_undefined__",i="[object Function]",a="[object GeneratorFunction]",s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l=/^\w*$/,c=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d=/\\(\\)?/g,p=/^\[object .+?Constructor\]$/,h="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,m="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,f=h||m||Function("return this")();var v,g=Array.prototype,y=Function.prototype,_=Object.prototype,E=f["__core-js_shared__"],b=(v=/[^.]+$/.exec(E&&E.keys&&E.keys.IE_PROTO||""))?"Symbol(src)_1."+v:"",A=y.toString,S=_.hasOwnProperty,k=_.toString,T=RegExp("^"+A.call(S).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=f.Symbol,I=g.splice,C=B(f,"Map"),w=B(Object,"create"),N=P?P.prototype:void 0,O=N?N.toString:void 0;function R(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function M(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function D(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function L(e,t){for(var n,r,o=e.length;o--;)if((n=e[o][0])===(r=t)||n!=n&&r!=r)return o;return-1}function x(e,t){var n;t=function(e,t){if(j(e))return!1;var n=r(e);if("number"==n||"symbol"==n||"boolean"==n||null==e||G(e))return!0;return l.test(e)||!s.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:j(n=t)?n:Y(n);for(var o=0,i=t.length;null!=e&&o<i;)e=e[F(t[o++])];return o&&o==i?e:void 0}function U(e){if(!V(e)||(t=e,b&&b in t))return!1;var t,n=function(e){var t=V(e)?k.call(e):"";return t==i||t==a}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?T:p;return n.test(function(e){if(null!=e){try{return A.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function K(e,t){var n,o,i=e.__data__;return("string"==(o=r(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function B(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return U(n)?n:void 0}R.prototype.clear=function(){this.__data__=w?w(null):{}},R.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},R.prototype.get=function(e){var t=this.__data__;if(w){var n=t[e];return n===o?void 0:n}return S.call(t,e)?t[e]:void 0},R.prototype.has=function(e){var t=this.__data__;return w?void 0!==t[e]:S.call(t,e)},R.prototype.set=function(e,t){return this.__data__[e]=w&&void 0===t?o:t,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(e){var t=this.__data__,n=L(t,e);return!(n<0)&&(n==t.length-1?t.pop():I.call(t,n,1),!0)},M.prototype.get=function(e){var t=this.__data__,n=L(t,e);return n<0?void 0:t[n][1]},M.prototype.has=function(e){return L(this.__data__,e)>-1},M.prototype.set=function(e,t){var n=this.__data__,r=L(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},D.prototype.clear=function(){this.__data__={hash:new R,map:new(C||M),string:new R}},D.prototype.delete=function(e){return K(this,e).delete(e)},D.prototype.get=function(e){return K(this,e).get(e)},D.prototype.has=function(e){return K(this,e).has(e)},D.prototype.set=function(e,t){return K(this,e).set(e,t),this};var Y=H((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(G(e))return O?O.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return c.test(e)&&n.push(""),e.replace(u,(function(e,t,r,o){n.push(r?o.replace(d,"$1"):t||e)})),n}));function F(e){if("string"==typeof e||G(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function H(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(H.Cache||D),n}H.Cache=D;var j=Array.isArray;function V(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function G(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==k.call(e)}e.exports=function(e,t,n){var r=null==e?void 0:x(e,t);return void 0===r?n:r}},5270:function(e,t,n){e=n.nmd(e);var r=n(7065).default,o="__lodash_hash_undefined__",i=9007199254740991,a="[object Arguments]",s="[object Function]",l="[object Object]",c=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,d={};d["[object Float32Array]"]=d["[object Float64Array]"]=d["[object Int8Array]"]=d["[object Int16Array]"]=d["[object Int32Array]"]=d["[object Uint8Array]"]=d["[object Uint8ClampedArray]"]=d["[object Uint16Array]"]=d["[object Uint32Array]"]=!0,d[a]=d["[object Array]"]=d["[object ArrayBuffer]"]=d["[object Boolean]"]=d["[object DataView]"]=d["[object Date]"]=d["[object Error]"]=d[s]=d["[object Map]"]=d["[object Number]"]=d[l]=d["[object RegExp]"]=d["[object Set]"]=d["[object String]"]=d["[object WeakMap]"]=!1;var p="object"==(void 0===n.g?"undefined":r(n.g))&&n.g&&n.g.Object===Object&&n.g,h="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,m=p||h||Function("return this")(),f="object"==r(t)&&t&&!t.nodeType&&t,v=f&&"object"==r(e)&&e&&!e.nodeType&&e,g=v&&v.exports===f,y=g&&p.process,_=function(){try{var e=v&&v.require&&v.require("util").types;return e||y&&y.binding&&y.binding("util")}catch(e){}}(),E=_&&_.isTypedArray;function b(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var A,S,k,T=Array.prototype,P=Function.prototype,I=Object.prototype,C=m["__core-js_shared__"],w=P.toString,N=I.hasOwnProperty,O=(A=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",R=I.toString,M=w.call(Object),D=RegExp("^"+w.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=g?m.Buffer:void 0,x=m.Symbol,U=m.Uint8Array,K=L?L.allocUnsafe:void 0,B=(S=Object.getPrototypeOf,k=Object,function(e){return S(k(e))}),Y=Object.create,F=I.propertyIsEnumerable,H=T.splice,j=x?x.toStringTag:void 0,V=function(){try{var e=ve(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),G=L?L.isBuffer:void 0,z=Math.max,W=Date.now,q=ve(m,"Map"),J=ve(Object,"create"),Q=function(){function e(){}return function(t){if(!Ce(t))return{};if(Y)return Y(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Z(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ee(e){var t=this.__data__=new X(e);this.size=t.size}function te(e,t){var n=Se(e),r=!n&&Ae(e),o=!n&&!r&&Te(e),i=!n&&!r&&!o&&Ne(e),a=n||r||o||i,s=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var c in e)!t&&!N.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ge(c,l))||s.push(c);return s}function ne(e,t,n){(void 0!==n&&!be(e[t],n)||void 0===n&&!(t in e))&&ie(e,t,n)}function re(e,t,n){var r=e[t];N.call(e,t)&&be(r,n)&&(void 0!==n||t in e)||ie(e,t,n)}function oe(e,t){for(var n=e.length;n--;)if(be(e[n][0],t))return n;return-1}function ie(e,t,n){"__proto__"==t&&V?V(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}Z.prototype.clear=function(){this.__data__=J?J(null):{},this.size=0},Z.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Z.prototype.get=function(e){var t=this.__data__;if(J){var n=t[e];return n===o?void 0:n}return N.call(t,e)?t[e]:void 0},Z.prototype.has=function(e){var t=this.__data__;return J?void 0!==t[e]:N.call(t,e)},Z.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=J&&void 0===t?o:t,this},X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,n=oe(t,e);return!(n<0)&&(n==t.length-1?t.pop():H.call(t,n,1),--this.size,!0)},X.prototype.get=function(e){var t=this.__data__,n=oe(t,e);return n<0?void 0:t[n][1]},X.prototype.has=function(e){return oe(this.__data__,e)>-1},X.prototype.set=function(e,t){var n=this.__data__,r=oe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},$.prototype.clear=function(){this.size=0,this.__data__={hash:new Z,map:new(q||X),string:new Z}},$.prototype.delete=function(e){var t=fe(this,e).delete(e);return this.size-=t?1:0,t},$.prototype.get=function(e){return fe(this,e).get(e)},$.prototype.has=function(e){return fe(this,e).has(e)},$.prototype.set=function(e,t){var n=fe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},ee.prototype.clear=function(){this.__data__=new X,this.size=0},ee.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ee.prototype.get=function(e){return this.__data__.get(e)},ee.prototype.has=function(e){return this.__data__.has(e)},ee.prototype.set=function(e,t){var n=this.__data__;if(n instanceof X){var r=n.__data__;if(!q||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new $(r)}return n.set(e,t),this.size=n.size,this};var ae,se=function(e,t,n){for(var r=-1,o=Object(e),i=n(e),a=i.length;a--;){var s=i[ae?a:++r];if(!1===t(o[s],s,o))break}return e};function le(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":j&&j in Object(e)?function(e){var t=N.call(e,j),n=e[j];try{e[j]=void 0;var r=!0}catch(e){}var o=R.call(e);r&&(t?e[j]=n:delete e[j]);return o}(e):function(e){return R.call(e)}(e)}function ce(e){return we(e)&&le(e)==a}function ue(e){return!(!Ce(e)||function(e){return!!O&&O in e}(e))&&(Pe(e)?D:c).test(function(e){if(null!=e){try{return w.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function de(e){if(!Ce(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ye(e),n=[];for(var r in e)("constructor"!=r||!t&&N.call(e,r))&&n.push(r);return n}function pe(e,t,n,r,o){e!==t&&se(t,(function(i,a){if(o||(o=new ee),Ce(i))!function(e,t,n,r,o,i,a){var s=_e(e,n),c=_e(t,n),u=a.get(c);if(u)return void ne(e,n,u);var d=i?i(s,c,n+"",e,t,a):void 0,p=void 0===d;if(p){var h=Se(c),m=!h&&Te(c),f=!h&&!m&&Ne(c);d=c,h||m||f?Se(s)?d=s:we(E=s)&&ke(E)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(s):m?(p=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=K?K(n):new e.constructor(n);return e.copy(r),r}(c,!0)):f?(p=!1,v=c,g=!0?(y=v.buffer,_=new y.constructor(y.byteLength),new U(_).set(new U(y)),_):v.buffer,d=new v.constructor(g,v.byteOffset,v.length)):d=[]:function(e){if(!we(e)||le(e)!=l)return!1;var t=B(e);if(null===t)return!0;var n=N.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&w.call(n)==M}(c)||Ae(c)?(d=s,Ae(s)?d=function(e){return function(e,t,n,r){var o=!n;n||(n={});var i=-1,a=t.length;for(;++i<a;){var s=t[i],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),o?ie(n,s,l):re(n,s,l)}return n}(e,Oe(e))}(s):Ce(s)&&!Pe(s)||(d=function(e){return"function"!=typeof e.constructor||ye(e)?{}:Q(B(e))}(c))):p=!1}var v,g,y,_;var E;p&&(a.set(c,d),o(d,c,r,i,a),a.delete(c));ne(e,n,d)}(e,t,a,n,pe,r,o);else{var s=r?r(_e(e,a),i,a+"",e,t,o):void 0;void 0===s&&(s=i),ne(e,a,s)}}),Oe)}function he(e,t){return Ee(function(e,t,n){return t=z(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=z(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(a),b(e,this,s)}}(e,t,De),e+"")}var me=V?function(e,t){return V(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:De;function fe(e,t){var n,o,i=e.__data__;return("string"==(o=r(n=t))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ve(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ue(n)?n:void 0}function ge(e,t){var n=r(e);return!!(t=null==t?i:t)&&("number"==n||"symbol"!=n&&u.test(e))&&e>-1&&e%1==0&&e<t}function ye(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||I)}function _e(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ee=function(e){var t=0,n=0;return function(){var r=W(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(me);function be(e,t){return e===t||e!=e&&t!=t}var Ae=ce(function(){return arguments}())?ce:function(e){return we(e)&&N.call(e,"callee")&&!F.call(e,"callee")},Se=Array.isArray;function ke(e){return null!=e&&Ie(e.length)&&!Pe(e)}var Te=G||function(){return!1};function Pe(e){if(!Ce(e))return!1;var t=le(e);return t==s||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ie(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=i}function Ce(e){var t=r(e);return null!=e&&("object"==t||"function"==t)}function we(e){return null!=e&&"object"==r(e)}var Ne=E?function(e){return function(t){return e(t)}}(E):function(e){return we(e)&&Ie(e.length)&&!!d[le(e)]};function Oe(e){return ke(e)?te(e,!0):de(e)}var Re,Me=(Re=function(e,t,n){pe(e,t,n)},he((function(e,t){var n=-1,o=t.length,i=o>1?t[o-1]:void 0,a=o>2?t[2]:void 0;for(i=Re.length>3&&"function"==typeof i?(o--,i):void 0,a&&function(e,t,n){if(!Ce(n))return!1;var o=r(t);return!!("number"==o?ke(n)&&ge(t,n.length):"string"==o&&t in n)&&be(n[t],e)}(t[0],t[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++n<o;){var s=t[n];s&&Re(e,s,n,i)}return e})));function De(e){return e}e.exports=Me},8822:function(e){var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var s,l=[],c=!1,u=-1;function d(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&p())}function p(){if(!c){var e=a(d);c=!0;for(var t=l.length;t;){for(s=l,l=[];++u<t;)s&&s[u].run();u=-1,t=l.length}s=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),1!==l.length||c||a(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},8093:function(e,t,n){var r=n(1953);function o(e){var t,n;function o(t,n){try{var a=e[t](n),s=a.value,l=s instanceof r;Promise.resolve(l?s.v:s).then((function(n){if(l){var r="return"===t?"return":"next";if(!s.k||n.done)return o(r,n);n=e[r](n).value}i(a.done?"return":"normal",n)}),(function(e){o("throw",e)}))}catch(e){i("throw",e)}}function i(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?o(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise((function(i,a){var s={key:e,arg:r,resolve:i,reject:a,next:null};n?n=n.next=s:(t=n=s,o(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}o.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)},e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},1953:function(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},5820:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},7720:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},9748:function(e,t,n){var r=n(5820);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},9402:function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},4774:function(e,t,n){var r=n(1953);e.exports=function(e){var t={},n=!1;function o(t,o){return n=!0,o=new Promise((function(n){n(e[t](o))})),{done:!1,value:new r(o,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return n?(n=!1,e):o("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(n)throw n=!1,e;return o("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return n?(n=!1,e):o("return",e)}),t},e.exports.__esModule=!0,e.exports.default=e.exports},9164:function(e){function t(e){function n(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return t=function(e){this.s=e,this.n=e.next},t.prototype={s:null,n:null,next:function(){return n(this.n.apply(this.s,arguments))},return:function(e){var t=this.s.return;return void 0===t?Promise.resolve({value:e,done:!0}):n(t.apply(this.s,arguments))},throw:function(e){var t=this.s.return;return void 0===t?Promise.reject(e):n(t.apply(this.s,arguments))}},new t(e)}e.exports=function(e){var n,r,o,i=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,o=Symbol.iterator);i--;){if(r&&null!=(n=e[r]))return n.call(e);if(o&&null!=(n=e[o]))return new t(n.call(e));r="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},842:function(e){function t(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=e.apply(n,r);function s(e){t(a,o,i,s,l,"next",e)}function l(e){t(a,o,i,s,l,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},6621:function(e,t,n){var r=n(1953);e.exports=function(e){return new r(e,0)},e.exports.__esModule=!0,e.exports.default=e.exports},9952:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},7603:function(e,t,n){var r=n(2975),o=n(9377);function i(t,n,a){return o()?(e.exports=i=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=i=function(e,t,n){var o=[null];o.push.apply(o,t);var i=new(Function.bind.apply(e,o));return n&&r(i,n.prototype),i},e.exports.__esModule=!0,e.exports.default=e.exports),i.apply(null,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},9086:function(e,t,n){var r=n(893);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},4286:function(e,t,n){var r=n(9617);e.exports=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}},e.exports.__esModule=!0,e.exports.default=e.exports},5929:function(e,t,n){var r=n(731),o=n(9377),i=n(365);e.exports=function(e){var t=o();return function(){var n,o=r(e);if(t){var a=r(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return i(this,n)}},e.exports.__esModule=!0,e.exports.default=e.exports},4762:function(e,t,n){var r=n(893);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},4606:function(e,t,n){var r=n(7101);function o(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=o=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,t,n){var o=r(e,t);if(o){var i=Object.getOwnPropertyDescriptor(o,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(this,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},731:function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4832:function(e,t,n){var r=n(2975);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},3315:function(e){e.exports=function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}},e.exports.__esModule=!0,e.exports.default=e.exports},9377:function(e){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},9454:function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},5587:function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},7469:function(e){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports},8928:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},3212:function(e,t,n){var r=n(4762);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}e.exports=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports},7578:function(e,t,n){var r=n(7710);e.exports=function(e,t){if(null==e)return{};var n,o,i=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},e.exports.__esModule=!0,e.exports.default=e.exports},7710:function(e){e.exports=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o},e.exports.__esModule=!0,e.exports.default=e.exports},365:function(e,t,n){var r=n(7065).default,o=n(9402);e.exports=function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},2650:function(e,t,n){var r=n(7065).default;function o(){"use strict";e.exports=o=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},i=Object.prototype,a=i.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},l="function"==typeof Symbol?Symbol:{},c=l.iterator||"@@iterator",u=l.asyncIterator||"@@asyncIterator",d=l.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),a=new R(r||[]);return s(i,"_invoke",{value:C(e,n,a)}),i}function m(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var f="suspendedStart",v="executing",g="completed",y={};function _(){}function E(){}function b(){}var A={};p(A,c,(function(){return this}));var S=Object.getPrototypeOf,k=S&&S(S(M([])));k&&k!==i&&a.call(k,c)&&(A=k);var T=b.prototype=_.prototype=Object.create(A);function P(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(o,i,s,l){var c=m(e[o],e,i);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==r(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,l)}),(function(e){n("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,l)}))}l(c.arg)}var o;s(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}})}function C(e,n,r){var o=f;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var s=r.delegate;if(s){var l=w(s,r);if(l){if(l===y)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var c=m(e,n,r);if("normal"===c.type){if(o=r.done?g:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function w(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,w(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var i=m(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,y;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function M(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(a.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(r(e)+" is not iterable")}return E.prototype=b,s(T,"constructor",{value:b,configurable:!0}),s(b,"constructor",{value:E,configurable:!0}),E.displayName=p(b,d,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===E||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,p(e,d,"GeneratorFunction")),e.prototype=Object.create(T),e},n.awrap=function(e){return{__await:e}},P(I.prototype),p(I.prototype,u,(function(){return this})),n.AsyncIterator=I,n.async=function(e,t,r,o,i){void 0===i&&(i=Promise);var a=new I(h(e,t,r,o),i);return n.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},P(T),p(T,d,"Generator"),p(T,c,(function(){return this})),p(T,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=M,R.prototype={constructor:R,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(O),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,o){return s.type="throw",s.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(l&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),O(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:M(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},n}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},2975:function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},9050:function(e,t,n){var r=n(7720),o=n(5587),i=n(9617),a=n(7469);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},7101:function(e,t,n){var r=n(731);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},6705:function(e,t,n){var r=n(9748),o=n(9454),i=n(9617),a=n(8928);e.exports=function(e){return r(e)||o(e)||i(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},3952:function(e,t,n){var r=n(7065).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},893:function(e,t,n){var r=n(7065).default,o=n(3952);e.exports=function(e){var t=o(e,"string");return"symbol"==r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},7065:function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},9617:function(e,t,n){var r=n(5820);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},8101:function(e,t,n){var r=n(8093);e.exports=function(e){return function(){return new r(e.apply(this,arguments))}},e.exports.__esModule=!0,e.exports.default=e.exports},7184:function(e,t,n){var r=n(731),o=n(2975),i=n(3315),a=n(7603);function s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!i(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return a(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,s(t)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var r={};return function(){"use strict";n.r(r),n.d(r,{AMSAutoDebit:function(){return fg},AMSAutoDebitPay:function(){return lg},AMSCashierPayment:function(){return cg},AMSCheckout:function(){return sg},AMSCheckoutPage:function(){return ig},AMSEasyPay:function(){return mg},AMSElement:function(){return hg},AMSVaulting:function(){return ug},AddressElement:function(){return pg},AntomElement:function(){return dg},AntomSDK:function(){return yy},ComponentSignEnum:function(){return j},ComponentSignEnumV2:function(){return H},ConnectErrorCode:function(){return de},DisplayTypeEnum:function(){return F},ElementType:function(){return O},EnvironmentEnum:function(){return X},EventLoggingEventId:function(){return he},InterActionTypeEnum:function(){return ue},MessageName:function(){return ne},PaymentAmountEnum:function(){return W},PaymentElementLayout:function(){return L},PaymentMethodCategoryTypeEnum:function(){return G},PaypalMethodEnum:function(){return le},PlatformEnum:function(){return te},ProductSceneEnum:function(){return V},ProductSceneVersion:function(){return ce},RedirectType:function(){return se},RiskSdkInfoEnum:function(){return pe},TargetEnum:function(){return re},ThemeType:function(){return D},checkoutDisplayEnum:function(){return J},default:function(){return Sy},errorEnum:function(){return oe},eventCodeEnum:function(){return ae},loadAntom:function(){return Ay},localeEnum:function(){return q},modeEnum:function(){return Q},networkModeEnum:function(){return Z},osTypeEnum:function(){return $},payPalConfigurationIntentEnum:function(){return z},redirectTypeEnum:function(){return ie},terminalTypeEnum:function(){return ee}});var e={};n.r(e),n.d(e,{hasBrowserEnv:function(){return yo},hasStandardBrowserEnv:function(){return Eo},hasStandardBrowserWebWorkerEnv:function(){return bo},navigator:function(){return _o},origin:function(){return Ao}});var t,o=n(2650),i=n.n(o),a=n(842),s=n.n(a),l=n(4762),c=n.n(l),u=n(4286),d=n.n(u),p=n(3212),h=n.n(p),m=n(9086),f=n.n(m),v=n(9952),g=n.n(v),y=n(4832),_=n.n(y),E=n(5929),b=n.n(E),A={dev:"http://page.alipay.net/page/antom-web-checkout/src/component-app",sit:"http://page.test.alipay.net/page/antom-web-checkout/src/component-app",pre:"https://pre.ac.alipay.com/page/antom-web-checkout/src/component-app",sandbox:"https://ac.alipay.com/page/antom-web-checkout/src/component-app",light_sandbox:"https://ac.alipay.com/page/antom-web-checkout/src/component-app",prod:"https://ac.alipay.com/page/antom-web-checkout/src/component-app"},S={dev:"https://config-dev.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",sit:"https://config-test.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",pre:"https://config-pre.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",sandbox:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",light_sandbox:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json",prod:"https://config.marmot-cloud.com/config/data/antom-sdk-config/en_US.json"},k={dev:"http://page.alipay.net/page/antom-web-checkout-v2",sit:"http://page.test.alipay.net/page/antom-web-checkout-v2",pre:"https://pre.ac.alipay.com/page/antom-web-checkout-v2",sandbox:"https://checkout.antom.com",light_sandbox:"https://checkout.antom.com",prod:"https://checkout.antom.com"},T="0.0.1787898127-dev.21",P="1.47.2",I=n(7184),C=n.n(I),w=function(e){return e.RENDER_COMPONENT="renderComponent",e.CAPTURE_ASSET="onCaptureAsset",e.SIGN_OUT="onSignout",e.BLUR="onBlur",e.SUBMIT_PAY="submitPay",e.VALIDATE="onValidate",e.SUBMIT_RISK="onSubmitRisk",e.AFTER_SUBMIT="onAfterSubmit",e.SIZE_CHANGE="onSizeChange",e.LAUNCH="onLaunch",e.CALLBACK="callback",e.SEND_MUITI_APP_EVENT_TO_SDK="sendMuitiAppEventToSdk",e.LOG="log",e.HANDLE_PAYMENT="handlePayment",e.ON_EVENT_CALLBACK="onEventCallback",e}({}),N=function(e){return e.CONTAINER_ELEMENT="CONTAINER_ELEMENT",e.AUTH_ELEMENT="AUTH_ELEMENT",e.ADDRESS_ELEMENT="ADDRESS_ELEMENT",e.PAYMENT_ELEMENT="PAYMENT_ELEMENT",e}({}),O=function(e){return e.auth="auth",e.address="address",e.payment="payment",e}({}),R=function(e){return e.SUCCESS="SUCCESS",e.PROCESSING="PROCESSING",e.CANCELLED="CANCELLED",e.PENDING="PENDING",e.S="SUCCESS",e.F="FAIL",e.U="PROCESSING",e.FAIL="FAIL",e}({}),M=c()(c()(c()(c()(c()(c()({},O.auth,N.AUTH_ELEMENT),O.address,N.ADDRESS_ELEMENT),O.payment,N.PAYMENT_ELEMENT),N.AUTH_ELEMENT,O.auth),N.ADDRESS_ELEMENT,O.address),N.PAYMENT_ELEMENT,O.payment),D=function(e){return e.NostalgicGray="nostalgicGray",e.Default="default",e.Night="night",e.CherryBlossomPink="cherryBlossomPink",e.GamingPurple="gamingPurple",e.AgateGreen="agateGreen",e}({}),L=function(e){return e.Tabs="tabs",e.Accordion="Accordion",e}({}),x=(c()(c()({},D.Default,"LIGHT"),D.Night,"NIGHT"),function(e){return e.SDK_CREATE_COMPONENT_ERROR="SDK_CREATE_COMPONENT_ERROR",e.SDK_CREATEPAYMENT_PARAMETER_ERROR="SDK_CREATEPAYMENT_PARAMETER_ERROR",e.SDK_PAYMENT_ERROR="SDK_PAYMENT_ERROR",e.SDK_PAYMENT_FAIL="SDK_PAYMENT_FAIL",e.SDK_PAYMENT_CANCEL="SDK_PAYMENT_CANCEL",e.SDK_PAYMENT_SUCCESSFUL="SDK_PAYMENT_SUCCESSFUL",e.SDK_PAYMENT_PROCESSING="SDK_PAYMENT_PROCESSING",e}({})),U=function(e){return e.DEV="DEV",e.TEST="TEST",e.SIT="SIT",e.PRE="PRE",e.PROD="PROD",e.SANDBOX="SANDBOX",e}({}),K=function(e){_()(n,e);var t=b()(n);function n(e){var r;g()(this,n);var o=e.map((function(e){return"".concat(e.field,": ").concat(e.message)}));return(r=t.call(this,"Invalid config:\n".concat(o.join("\n")))).errors=e,r.name="InvalidElementConfigError",r}return f()(n)}(C()(Error)),B=function(e){return e.DESTORY="destroy",e.MOUNT="mount",e.SUBMITPAYMENT="submitPayment",e.VALIDATAFIELDS="validateFields",e.UPDATEPAYMENT="updatePayment",e}({}),Y=function(e){return e.PAYMENTMETHODCHANGED="paymentMethodChanged",e.BILLINGADDRESSCHANGED="billingAddressChanged",e}({}),F=function(e){return e.popup="popup",e.inline="inline",e}({}),H=function(e){return e.ELEMENT_PAYMENT="ELEMENT_PAYMENT_ALL",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS_ALL",e}({}),j=function(e){return e.EASY_PAY_WALLET="EASY_PAY_WALLET",e.EASY_PAY_APM="EASY_PAY_APM",e.CASHIER_PAYMENT_CARD="CASHIER_PAYMENT_CARD",e.CASHIER_PAYMENT_BANK="CASHIER_PAYMENT_BANK",e.CASHIER_PAYMENT_APM="CASHIER_PAYMENT_APM",e.AUTO_DEBIT_WALLET="AUTO_DEBIT_WALLET",e.AUTO_DEBIT_PAY_WALLET="AUTO_DEBIT_PAY_WALLET",e.NONE="NONE",e.VAULTING_CARD="VAULTING_CARD",e.CHECKOUT_PAYMENT="CHECKOUT_PAYMENT",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT_ALL",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS_ALL",e.AUTO_DEBIT_APM="AUTO_DEBIT_APM",e}({}),V=function(e){return e.VAULTING_ELEMENT="VAULTING_ELEMENT",e.EASY_PAY="EASY_PAY",e.CASHIER_PAYMENT="CASHIER_PAYMENT",e.AUTO_DEBIT="AUTO_DEBIT",e.AUTO_DEBIT_PAY="AUTO_DEBIT_PAY",e.VAULTING="VAULTING",e.FLASH_BUY="FLASH_BUY",e.CARD_APPLE_PAY="CARD_APPLE_PAY",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT",e.ELEMENT_ADDRESS="ELEMENT_ADDRESS",e.CHECKOUT_PAYMENT="CHECKOUT_PAYMENT",e}({}),G=function(e){return e.CARD="CARD",e.WALLET="WALLET",e.BANK="BANK",e.APM="APM",e.ALL="ALL",e}({}),z=function(e){return e.intent="intent",e.capture="capture",e}({}),W=function(e){return e.USD="USD",e}({}),q=function(e){return e["en-US"]="en-US",e}({}),J=function(e){return e.horizon="horizon",e.vertical="vertical",e}({}),Q=function(e){return e.dropin="dropin",e.component="component",e}({}),Z=function(e){return e.proxy="proxy",e.session="session",e}({}),X=function(e){return e.sandbox="sandbox",e.prod="prod",e.light_sandbox="light_sandbox",e}({}),$=function(e){return e.IOS="IOS",e.ANDROID="ANDROID",e.ELSE="ELSE",e}({}),ee=function(e){return e.WEB="WEB",e.WAP="WAP",e.APP="APP",e.MINI_APP="MINI_APP",e}({}),te=function(e){return e.desktop="desktop",e.mobile="mobile",e}({}),ne=function(e){return e.SDK_TO_APP="SDK_TO_APP",e.APP_TO_SDK="APP_TO_SDK",e.APP_TO_APP="APP_TO_APP",e}({}),re=function(e){return e.BLANK="_blank",e.SELF="_self",e.REPLACE="_replace",e}({}),oe=function(e){return e.PARAMS="PARAMS",e.TIMEOUT="TIMEOUT",e.NETWORK="NETWORK",e.SYSTEM="SYSTEM",e.LOGIN="LOGIN",e.GATEWAY="GATEWAY",e.VALIDATION="VALIDATION",e.TAOBAOBINDALIPAY="TAOBAOBINDALIPAY",e.REGISTERWALLET="REGISTERWALLET",e.NOALIPAYID="NOALIPAYID",e.TRUSTLOGINERROR="TRUSTLOGINERROR",e.SIGNIN="SIGNIN",e.GETSIGNPARAMSERROR="GETSIGNPARAMSERROR",e}({}),ie=function(e){return e.UNSAFE_BROWSER="UNSAFE_BROWSER",e.SAFETY_BROWSER="SAFETY_BROWSER",e.INVOKE_SDK="INVOKE_SDK",e}({}),ae=function(e){return e.SDK_START_OF_LOADING="SDK_START_OF_LOADING",e.SDK_END_OF_LOADING="SDK_END_OF_LOADING",e.SDK_INTERNAL_ERROR="SDK_INTERNAL_ERROR",e.SDK_CREATEPAYMENT_PARAMETER_ERROR="SDK_CREATEPAYMENT_PARAMETER_ERROR",e.SDK_INIT_PARAMETER_ERROR="SDK_INIT_PARAMETER_ERROR",e.SDK_CREATECOMPONENT_ERROR="SDK_CREATECOMPONENT_ERROR",e.SDK_LAUNCH_PAYMENT_APP_ERROR="SDK_LAUNCH_PAYMENT_APP_ERROR",e.SDK_CALL_URL_SUCCESS="SDK_CALL_URL_SUCCESS",e.SDK_CALL_URL_ERROR="SDK_CALL_URL_ERROR",e.SDK_PAYMENT_SUCCESSFUL="SDK_PAYMENT_SUCCESSFUL",e.SDK_PAYMENT_FAIL="SDK_PAYMENT_FAIL",e.SDK_PAYMENT_ERROR="SDK_PAYMENT_ERROR",e.SDK_PAYMENT_CANCEL="SDK_PAYMENT_CANCEL",e.SDK_PAYMENT_PROCESSING="SDK_PAYMENT_PROCESSING",e.SDK_PAYMENT_WARN="SDK_PAYMENT_WARN",e.SDK_PAYMENT_SHIPPINGCHANGE="SDK_PAYMENT_SHIPPINGCHANGE",e.SDK_PAYMENT_APPROVE="SDK_PAYMENT_APPROVE",e.SDK_REDIRECT="SDK_REDIRECT",e}({}),se=function(e){return e.ApplinkUrl="ApplinkUrl",e.SchemeUrl="SchemeUrl",e.NormalUrl="NormalUrl",e.Unknown="Unknown",e}({}),le=function(e){return e.PAYPAL_CHECKOUT="PAYPAL_CHECKOUT",e.PAYPAL_VAULT="PAYPAL_VAULT",e.PAYPAL_PAYLATER="PAYPAL_PAYLATER",e}({}),ce=function(e){return e.V1="1.0",e.V2="2.0",e}({}),ue=function(e){return e.COLLECT_REDIRECT="COLLECT_REDIRECT",e.SHOW_CODE="SHOW_CODE",e.COLLECT_SHOW_CODE="COLLECT_SHOW_CODE",e.REDIRECT="REDIRECT",e}({}),de=function(e){return e.RISK_REJECT="RISK_REJECT",e.USER_AUTH_VERIFICATION_FAILED="USER_AUTH_VERIFICATION_FAILED",e.USER_NOT_EXISTS="USER_NOT_EXISTS",e}({}),pe=function(e){return e.NEED="need",e.NO_NEED="noneed",e}({}),he=function(e){return e.OnlyClose="OnlyClose",e.LeaveAnyWay="LeaveAnyWay",e.ContinuePaying="ContinuePaying",e}({}),me={DOMAIN_NOT_IN_WHITE_LIST:{code:ae.SDK_INTERNAL_ERROR,message:"Origin of the message is not in the white list"},NOT_JSON_FORMAT:{code:ae.SDK_INTERNAL_ERROR,message:"The message string should conform to the json format"},SDK_COMPATIBILITY_ISSUES:{code:ae.SDK_INTERNAL_ERROR,BROWSER_NOT_SUPPORT_POSTMESSAGE:{code:ae.SDK_INTERNAL_ERROR,message:"The browser does not support the postmessage communication mode"},FAILED_TO_CREATE_IFRAME:{code:ae.SDK_INTERNAL_ERROR,message:"Failed to create iframe"}},INIT_PARAMETER_ERROR:{code:ae.SDK_INIT_PARAMETER_ERROR,UI_MODE_NOT_SUPPORTED:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"This UI mode is not supported"},ENVIRONMENT_ERROR:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"The current input environment does not support or is not in the standard enumeration"},MODE_ERROR:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"mode value not in enum"},LOCALE_ERROR:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"The current input language does not support or is not in the standard enumeration"},NET_MODE_NOT_SUPPORT:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"The network mode is not supported"},EVENT_ERROR:{code:ae.SDK_INIT_PARAMETER_ERROR,message:"Parameter type should be function"}},CREATEPAYMENT_PARAMETER_ERROR:{code:ae.SDK_CREATEPAYMENT_PARAMETER_ERROR},CREATECOMPONENT_ERROR:{code:ae.SDK_CREATECOMPONENT_ERROR,message:"Failed to create component",SINGLETON_COMPONENT_ERROR:{code:ae.SDK_CREATECOMPONENT_ERROR,message:"Only one component can be rendered simultaneously"},LOAD_APP_TIMEOUT:{code:ae.SDK_CREATECOMPONENT_ERROR,message:"Load resource timeout"},NETWORK_REQUEST_ERROR:{code:ae.SDK_CREATECOMPONENT_ERROR,message:"Network request error"}},SDK_LAUNCH_PAYMENT_APP_ERROR:{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,CALL_APP_URL_ERROR:{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to launch app"},LOAD_APP_TIME_OUT:{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Load app time out"},CONTAINER_NOT_EXIST:{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Container service does not exist"}},SDK_SUBMIT_ERROR:{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Component not created or current browser compatibility issue, not supported"},PARAM_INVALID:{code:"PARAM_INVALID",message:"An error occurred. The transaction cannot be initiated."},UI_STATE_ERROR:{code:"UI_STATE_ERROR",message:"An error occurred. The transaction cannot be initiated."},INITIALIZE_TIMEOUT:{code:"INITIALIZE_TIMEOUT",API:{code:"INITIALIZE_API_TIMEOUT",message:"An error occurred. The transaction cannot be initiated."},WEB:{code:"INITIALIZE_WEB_TIMEOUT",message:"An error occurred; the transaction cannot be initiated."}},ERR_DATA_STRUCT_UNRECOGNIZED:{code:"ERR_DATA_STRUCT_UNRECOGNIZED",message:"An error occurred. The transaction cannot be initiated."},SDK_CALL_URL_ERROR:{code:ae.SDK_CALL_URL_ERROR,REDIRECT_ERROR:{code:ae.SDK_CALL_URL_ERROR,message:"Redirect data exception"}}},fe="COMPONENT",ve={ready:{name:"onReady",uniqueKey:"userOnReady"},error:{name:"onError",uniqueKey:"userOnError"},paymentMethodSelected:{name:"onPaymentMethodSelected",uniqueKey:"userOnPaymentMethodSelected"},sizeChanged:{name:"onSizeChanged",uniqueKey:"userOnSizeChanged"},log:{name:"onLog",uniqueKey:"userOnLog"},launch:{name:"onLaunch"},redirect:{name:"onRedirect"},close:{name:"onClose",uniqueKey:"userOnClose"},destroy:{name:"onDestroy"},closeCallback:{name:"onCloseCallback",uniqueKey:"closeCallback"},eventCallback:{name:"onEventCallback",uniqueKey:"userEventCallback"},submitForm:{name:"submitForm"},hideCloseButton:{name:"hideCloseButton"},showCloseButton:{name:"showCloseButton"},setMaskCloseButton:{name:"setMaskCloseButton"},setAllowRetention:{name:"setAllowRetention"},declareCheckoutInfo:{name:"declareCheckoutInfo"},showPopup:{name:"showPopup"},dismissLoading:{name:"dismissLoading"},popupWindow:{name:"popupWindow"},popWindow:{name:"popWindow"},getDeviceId:{name:"getDeviceId"},declareEventCallbackInfo:{name:"declareEventCallbackInfo"},setGlobalData:{name:"setGlobalData"},getGlobalData:{name:"getGlobalData"},sendMuitiAppEventToSdk:{name:"sendMuitiAppEventToSdk"},receiveMuitiAppFromSdk:{name:"receiveMuitiAppFromSdk"},sendBroadcast:{name:"sendBroadcast"},receiveBroadcast:{name:"receiveBroadcast"},getUserAgentFromSdk:{name:"getUserAgentFromSdk"},appHeartBeat:{name:"appHeartBeat"},beforeSubmit:{name:"beforeSubmit",uniqueKey:"userBeforeSubmit"},beforeSubmitDone:{name:"beforeSubmitDone",uniqueKey:"userBeforeSubmitDone"},onChange:{name:"onChange",uniqueKey:"userChange"},getGooglePayToken:{name:"getGooglePayToken"},initSecuritySDK:{name:"initSecuritySDK"},closePaymentPolling:{name:"closePaymentPolling"},onPollingEnd:{name:"onPollingEnd"},getApplePayToken:{name:"getApplePayToken"},updated:{name:"updated"},webAppReady:{name:"webAppReady"},showToast:{name:"showToast"},getSdkVersion:{name:"getSdkVersion"},inputFocus:{name:"onInputFocus"},messageForward:{name:"onMessageForward"},submitPromiseCallback:{name:"onSubmitPayCallback"},beforeConfirm:{name:"onBeforeConfirm"},validateFieldsResult:{name:"validateFieldsResult",forwardName:"validateFieldsResultForward",uniqueKey:"uservalidateFieldsResult"},canIUse:{name:"canIUse"}},ge={name:"validateFields"},ye="ams-component-container",_e="ams-component-section",Ee="ams-checkout-component",be="asm-component-close-block",Ae="ams-component-mask-close-block",Se="ams-component-retention",ke="ams-component-mockup",Te="ams-component-loading",Pe="ams-component-popup-loading",Ie="_ams_sdk_component_listener",Ce="ams-inline-component-style",we="inline-loading",Ne="ams-popup",Oe="light dark",Re=15e3,Me=300,De="https://cdn.marmot-cloud.com/storage/2023/5/18/1692a487-99b5-4314-9d6f-e9814bc1ca41.svg",Le={SUCCESS:{code:"SUCCESS"},UNKNOWN_EXCEPTION:{code:"UNKNOWN_EXCEPTION",message:"Unknown exception. Please check the payment status and contact the merchant."},REPEAT_REQ_REJECT:{code:"REPEAT_REQ_REJECT",message:"The order status is abnormal. Please check the payment status and contact the merchant."},PROCESS_FAIL:{code:"PROCESS_FAIL",message:"Unknown exception. Please check the payment status and contact the merchant."},INQUIRY_PAYMENT_SESSION_FAILED:{code:"INQUIRY_PAYMENT_SESSION_FAILED",message:"The order status is abnormal. Please check the payment status and contact the merchant."}},xe={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},Ue=new Uint8Array(16);function Ke(){if(!t&&!(t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(Ue)}for(var Be=[],Ye=0;Ye<256;++Ye)Be.push((Ye+256).toString(16).slice(1));function Fe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Be[e[t+0]]+Be[e[t+1]]+Be[e[t+2]]+Be[e[t+3]]+"-"+Be[e[t+4]]+Be[e[t+5]]+"-"+Be[e[t+6]]+Be[e[t+7]]+"-"+Be[e[t+8]]+Be[e[t+9]]+"-"+Be[e[t+10]]+Be[e[t+11]]+Be[e[t+12]]+Be[e[t+13]]+Be[e[t+14]]+Be[e[t+15]]}var He=function(e,t,n){if(xe.randomUUID&&!t&&!e)return xe.randomUUID();var r=(e=e||{}).random||(e.rng||Ke)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return Fe(r)},je=function(e){return e.sdk_event_busPublishMessage="sdk_event_busPublishMessage",e.sdk_event_busPublishCallback="sdk_event_busPublishCallback",e.sdk_event_busIsSubscribe="sdk_event_busIsSubscribe",e.sdk_event_busSubscribe="sdk_event_busSubscribe",e.sdk_event_busUnsubscribe="sdk_event_busUnsubscribe",e.sdk_event_busClear="sdk_event_busClear",e.sdk_event_busAddInterceptor="sdk_event_busAddInterceptor",e.sdk_error_busPublishUnsubscribeError="sdk_error_busPublishUnsubscribeError",e.sdk_error_busPublishError="sdk_error_busPublishError",e.sdk_error_busPublishNoResult="sdk_error_busPublishNoResult",e}({}),Ve=function(){function e(t,n){g()(this,e),c()(this,"action",void 0),c()(this,"data",void 0),c()(this,"jsonData",null),this.action=t,this.data=n}return f()(e,[{key:"getAction",value:function(){return this.action}},{key:"getData",value:function(){return this.data}},{key:"isJSONData",value:function(){return this.parseJSONData(),null!==this.jsonData}},{key:"getJSONObject",value:function(){var e;return this.parseJSONData(),null!==(e=this.jsonData)&&void 0!==e?e:{}}},{key:"parseJSONData",value:function(){if(null===this.jsonData)try{this.jsonData=JSON.parse(this.data)}catch(e){this.jsonData=null}}},{key:"result",value:function(t){return new e(this.action,JSON.stringify(t))}}]),e}(),Ge=function(){function e(t){g()(this,e),c()(this,"callback",void 0),this.callback=t}return f()(e,[{key:"onCallBack",value:function(e){this.callback&&this.callback(e)}}]),e}(),ze=f()((function e(){g()(this,e)})),We=function(){function e(){g()(this,e)}return f()(e,null,[{key:"debugTrace",value:function(e,t){this.isDebug=e,this.logger=t}},{key:"traceLog",value:function(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.isDebug&&console.log([e.TAG,t].concat(JSON.stringify(n)).join(this._logSplit)),r&&this.logger&&this.logger.logInfo({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"traceError",value:function(t,n){this.isDebug&&console.error([e.TAG,t].concat(JSON.stringify(n)).join(this._logSplit)),this.logger&&this.logger.logError({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"clear",value:function(){e.traceLog(je.sdk_event_busClear),e.interceptors.length=0,e.subscribersMap.clear()}},{key:"addInterceptor",value:function(t){e.traceLog(je.sdk_event_busAddInterceptor),e.interceptors.includes(t)||e.interceptors.push(t)}},{key:"publishForResult",value:function(t,n){var r=this,o=!0;return new Promise((function(i,a){var s;r.publish(t,(function(e){o=!1,i(e)})),setTimeout((function(){o&&(e.traceError(je.sdk_error_busPublishNoResult,{actionName:t.getAction()}),null!==(null==n?void 0:n.fallback)?i(t.result(null==n?void 0:n.fallback)):a("publish timeout"))}),null!==(s=null==n?void 0:n.timeoutMs)&&void 0!==s?s:2e3)}))}},{key:"publish",value:function(t,n){var r=new Ge((function(r){e.traceLog(je.sdk_event_busPublishCallback,{actionName:t.getAction()}),n&&n(r)})),o=t.getAction(),i=e.subscribersMap.get(o);if(e.traceLog(je.sdk_event_busPublishMessage,{actionName:t.getAction()}),i){var a,s=d()(i);try{for(s.s();!(a=s.n()).done;){var l=a.value;try{l.onMessage(r,t)}catch(n){e.traceError(je.sdk_error_busPublishError,{actionName:t.getAction(),errorMessage:n});var c,u=d()(e.interceptors);try{for(u.s();!(c=u.n()).done;){var p=c.value;null==p||p.onPublishException(t,n)}}catch(e){u.e(e)}finally{u.f()}}}}catch(e){s.e(e)}finally{s.f()}}else{var h,m=!1,f=d()(e.interceptors);try{for(f.s();!(h=f.n()).done;){var v=h.value;e.traceLog("onUnsubscribedAction",JSON.stringify(t)),m=m||(null==v?void 0:v.onUnsubscribedAction(t.getAction()))}}catch(e){f.e(e)}finally{f.f()}m?e.publish(t,n):e.traceError(je.sdk_error_busPublishUnsubscribeError,{actionName:t.getAction()})}}},{key:"subscribe",value:function(t){e.traceLog(je.sdk_event_busSubscribe,{actionNames:null==t?void 0:t.actionNames()});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value;e.subscribersMap.has(o)||e.subscribersMap.set(o,[]);var i=e.subscribersMap.get(o);i&&!i.includes(t)&&i.push(t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"unsubscribe",value:function(t){e.traceLog(je.sdk_event_busUnsubscribe,{actionNames:null==t?void 0:t.actionNames()});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=e.subscribersMap.get(o);if(i){var a=i.indexOf(t);-1!==a&&i.splice(a,1)}}}catch(e){r.e(e)}finally{r.f()}}},{key:"isSubscribed",value:function(t){var n=e.subscribersMap.get(t);if(n&&n.length>0)return e.traceLog(je.sdk_event_busIsSubscribe,{actionName:t,processResult:!0}),!0;var r,o=!1,i=d()(e.interceptors);try{for(i.s();!(r=i.n()).done;){var a=r.value;o=o||a.onUnsubscribedAction(t)}}catch(e){i.e(e)}finally{i.f()}return o?e.subscribersMap.has(t):(e.traceLog(je.sdk_event_busIsSubscribe,{actionName:t,processResult:!1}),!1)}}]),e}();c()(We,"TAG","BusManager"),c()(We,"_logSplit"," , "),c()(We,"interceptors",[]),c()(We,"subscribersMap",new Map),c()(We,"isDebug",!0),c()(We,"logger",void 0);var qe=n(7065),Je=n.n(qe),Qe=n(9402),Ze=n.n(Qe),Xe=n(6705),$e=n.n(Xe),et=n(9050),tt=n.n(et),nt=function(e){var t=document.createElement("iframe");return t.id=e,t.style.height="1px",t.style.width="1px",t.style.border="1px",t.style.opacity="0",t.style.overflow="hidden",t.style.colorScheme=Oe,t},rt=function(e){return e.TRUSTLY="/auto-debit/pages/trustly/index.html",e}({}),ot=function(e){return e.API_PORTAL="api-portal",e.SDK_PORTAL="sdk-portal",e.DOUBLE_FA="double-fa",e.PRELOAD="preload",e}({}),it=function(e){return e.SDK="SDK",e.API="API",e}({}),at=function(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()},st=function(){function e(){g()(this,e),c()(this,"events",void 0),c()(this,"eventsKey",void 0),this.events=new Map,this.eventsKey=new Map}return f()(e,[{key:"on",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(n){if(this.eventsKey.has("".concat(e,"-").concat(n)))return void console.warn("".concat(n,":Has been registered. Please use another key or do not pass the key"));this.eventsKey.set("".concat(e,"-").concat(n),!0)}var r=this.events.get(e)||[];r.push({func:t,key:n||""}),this.events.set(e,r)}},{key:"off",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(n&&this.eventsKey.has("".concat(e,"-").concat(n))&&this.eventsKey.delete("".concat(e,"-").concat(n)),this.events.has(e)){var r=this.events.get(e);r=r.filter((function(e){return(t!==e.func||e.key!==n)&&(!e.key||e.key!==n)})),this.events.set(e,r)}}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.events.has(e)){var o=this.events.get(e);o.forEach((function(e){e.func.apply(e,n)}))}}},{key:"once",value:function(e,t,n){var r=this;this.on(e,(function o(){t.apply(void 0,arguments),r.off(e,o,n)}),n)}},{key:"isExist",value:function(e){return this.events.has(e)}}]),e}(),lt=function(e){var t=[];for(var n in e)if(e.hasOwnProperty(n)){var r=encodeURIComponent(n),o=encodeURIComponent(null===e[n]?"":e[n]);t.push("".concat(r,"=").concat(o))}return t.join("&")},ct=function(e){try{JSON.parse(e)}catch(e){return!1}return!0},ut=window.navigator,dt=ut.userAgent,pt=/iPhone|iPad|iPod/i.test(dt)||"MacIntel"===ut.platform&&ut.maxTouchPoints>1,ht=/Android/i.test(dt),mt=(/\bMacintosh\b/.test(dt),/Windows NT/.test(dt),function(){var e=/OpenHarmony/i.test(ut.userAgent),t=/Phone/i.test(ut.userAgent),n=/Tablet/i.test(ut.userAgent);return e&&(t||n)}),ft=pt,vt=ht,gt=!(!/Android|iPhone|iPad|iPod|Mobile/.test(dt)&&!mt()),yt=(mt(),function(e,t){try{return JSON.parse(e)||t}catch(e){return t}}),_t=function(){var e=ut.userAgent;return!["Android","iPhone","SymbianOS","Windows Phone","iPod"].some((function(t){return e.includes(t)}))},Et=function(e){var t={};return e||(e=window.location.href),e.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o),t[n])})),t},bt=function(){var e=document.documentElement.clientWidth,t=_t()?130:100*e/390;return Math.min(t,130)},At=function(e,t){try{(t||document.getElementById("ams-component-container")).style.fontSize="".concat(bt(),"px"),window.changingPageHeight=window.innerHeight}catch(e){}},St=function(){window.removeEventListener("resize",At),window.removeEventListener("pageShow",At),window.removeEventListener("DOMContentLoaded",At),window.addEventListener("resize",At),window.addEventListener("pageShow",At),window.addEventListener("DOMContentLoaded",At)},kt=function(e,t){try{if(e&&!t){var n=window.localStorage.getItem(e);return n||""}e&&t&&window.localStorage.setItem(e,t)}catch(e){return""}},Tt=function(e){return"function"==typeof e};function Pt(e){try{var t=atob(e),n=Uint8Array.from(t,(function(e){return e.codePointAt(0)}));return(new TextDecoder).decode(n)}catch(e){return null}}function It(e,t){var n=this,r=e.src,o=e.attrOptions,i=void 0===o?{}:o,a=e.timeOut,s=void 0===a?3:a,l=e.loadCallback,c=void 0===l?null:l;return new Promise((function(e,o){t.logInfo({title:"load_item_sdk_start"},{eventMessage:r}),console.time();var a=document.createElement("script"),l=null;a.type="text/javascript",a.onload=function(){t.logInfo({title:"load_item_sdk_end"},{eventMessage:r}),console.timeEnd(),clearTimeout(l),c&&c(),e(!0)},a.onerror=function(){t.logError({title:"load_item_sdk_error"},{eventMessage:r}),clearTimeout(l),console.error("The script "+r+" is not accessible."),o(!1)},l=setTimeout((function(){n.logger.logError({title:"load_item_sdk_timeout"},{eventMessage:r}),o(!1)}),1e3*s),a.src=r,i&&Object.keys(i).forEach((function(e){a.setAttribute(e,i[e])})),document.head.appendChild(a)}))}var Ct=function(e){return!(!e||"object"!==Je()(e)||0!==Object.keys(e).length)||(!(!Array.isArray(e)||0!==e.length)||(null==e||""===e))},wt=function(){var e=(Et()||{}).environment;return!!e&&"dev"===e};function Nt(e,t){if(!e&&!t)return 0;if(!e)return-1;if(!t)return 1;if(e===t)return 0;if(!e)return-1;if(!t)return 1;for(var n=e.split(".").map((function(e){return parseInt(e)})),r=t.split(".").map((function(e){return parseInt(e)})),o=Math.min(n.length,r.length),i=0;i<o;i++){if(n[i]>r[i])return 1;if(n[i]<r[i])return-1}return o===n.length?-1:1}function Ot(e,t){if(!t)return!0;if(t.includes(","))return t.split(",").includes(e);if(!t.includes("|"))return e===t;var n=t.split("|")[0],r=t.split("|")[1]||"999999.9.9";return Nt(e,n)>=0&&Nt(r,e)>=0}function Rt(e,t){var n=e.value,r=e.version,o=e.platform,i=!1,a=!1;if(o){var s=o.split("|").map((function(e){return e.toLocaleUpperCase()}));a=s.includes("WEB")}else a=!0;if(r)if(-1!==r.indexOf("|")){var l=r.split("|"),c=tt()(l,2),u=c[0],d=void 0===u?"":u,p=c[1];i=function(e,t,n){function r(e){return e.split(".").map((function(e){return parseInt(e,10)}))}function o(e,t){for(var n=0;n<Math.max(e.length,t.length);n++){var r=void 0===e[n]?0:e[n],o=void 0===t[n]?0:t[n];if(r>o)return 1;if(r<o)return-1}return 0}var i=r(e),a=t?r(t):null,s=n?r(n):null;return!(a&&o(i,a)<0||s&&o(i,s)>0)}(t,d,void 0===p?"":p)}else if(-1!==r.indexOf(",")){i=r.split(",").includes(t)}else i=r===t;else i=!0;return n&&a&&i}var Mt=function(e){var t=e.environment,n=e.sdkMetaData,r=e.productScene,o=e.productSceneVersion,i=e.paymentMethodCategoryType,a=e.query,s=e.isPreload,l=e.v2Url,c=xt(t,n,r,o,i,l),u=Et(),d=u._sandbox,p=u._light_sandbox,h=u.requestHost,m=void 0===h?"":h,f=u.groupId,v=void 0===f?"":f,g=u.LOCAL_MOCK,y=u._displayType,_={};for(var E in a)_[E]=""+a[E];s&&(_.isPreload="true"),_.appMatched=n.webAppVersion?"true":"false",_.sdkVersion=n.sdkVersion,_.refUrl=window.location.href,_._componentStartTime="".concat(Date.now()),g&&(_.LOCAL_MOCK=g),m&&(_.requestHost=m),v&&(_.groupId=v),"light_sandbox"!==t&&"true"!==p||(_.sandbox="true"),"sandbox"!==t&&"true"!==d||(_.shadow="true"),y&&(_.displayType=y);var b=lt(_);return wt()&&(console.log("appUpgrade#getIframeUrl#appMatched",_.appMatched),console.log("appUpgrade#getIframeUrl#url",c,b)),{path:c,locationSearch:b}},Dt=function(e){var t,n=e.productScene,r=e.isPreload,o=e.environment,i=r?jt(n,o):Vt(n,o),a=Mt(h()(h()({},e),{},{v2Url:i}));return!r&&i&&a.path&&(console.log("[web-sdk] save web app, url: ",a.path),Ft(n,a.path)),t=-1!==a.path.indexOf("?")?"".concat(a.path,"&").concat(a.locationSearch):"".concat(a.path,"?").concat(a.locationSearch),console.log("[web-sdk] web app, url: ",t),t},Lt=function(e){var t=Mt(e);return-1!==t.path.indexOf("?")?"".concat(t.path,"&").concat(t.locationSearch):"".concat(t.path,"?").concat(t.locationSearch)},xt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,a=Et()||{},s=a.host;if(s&&!["sandbox","light_sandbox","prod"].includes(e))return s;var l=Bt(t.productScene,r,o),c="".concat(t.productScene,"_").concat(o);return c===j.AUTO_DEBIT_APM?"".concat(k[e]).concat(rt.TRUSTLY):n===V.EASY_PAY?null!=i?i:Vt(n,e):"".concat(A[e],"/").concat(c,"/").concat(l,"/index.html")},Ut=function(e){if(!e)return[];try{var t,n=JSON.parse(e);return null==n||null===(t=n.sdkUpgradeInfo)||void 0===t?void 0:t.versions}catch(e){return console.error("Parse the config for Web app failed#",e),[]}},Kt=function(e){if(!e)return[];try{var t=JSON.parse(e);return null==t?void 0:t.checkoutInfo}catch(e){return console.error("Parse the url config for Web app failed#",e),[]}},Bt=function(e,t,n){var r,o=(r={},c()(c()(c()(c()(c()(c()(c()(c()(c()(c()(r,j.NONE,[""]),j.AUTO_DEBIT_WALLET,["1.0"]),j.AUTO_DEBIT_PAY_WALLET,[""]),j.CASHIER_PAYMENT_BANK,["1.0"]),j.CASHIER_PAYMENT_CARD,["1.0"]),j.CASHIER_PAYMENT_APM,["1.0"]),j.EASY_PAY_WALLET,["1.0","2.0"]),j.EASY_PAY_APM,["2.0"]),j.VAULTING_CARD,["1.0"]),j.ELEMENT_PAYMENT,["1.0"]),c()(c()(c()(r,j.ELEMENT_ADDRESS,["1.0"]),j.CHECKOUT_PAYMENT,["1.0"]),j.AUTO_DEBIT_APM,["1.0"]))[e+"_"+n];if(!o)return"";var i=o.find((function(e){return e===t})),a=o[o.length-1];return i?t:a},Yt="web_url_",Ft=function(e,t){var n=Yt+e;localStorage.setItem(n,t)},Ht=function(e){var t=e.configs,n=void 0===t?[]:t,r=e.mid,o=void 0===r?"":r,i=e.env,a=e.pageName,s=Gt(a,i),l=function(){var e=n.sort((function(e,t){return Nt(t.minSDKVersion,e.minSDKVersion)})),t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((function(e){var t,n=!(null==e||null===(t=e.mids)||void 0===t||!t.includes(o)),r=Nt(T,e.minSDKVersion)>=0;if(n&&r)return e}))}(e);if(t)return t;var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.find((function(e){var t=void 0===(null==e?void 0:e.mids),n=Nt(T,e.minSDKVersion)>=0;if(t&&n)return e}))}(e);return r||void 0}();return l?a===ot.SDK_PORTAL?(null==l?void 0:l.url)||s:a===ot.DOUBLE_FA&&(null==l?void 0:l.doubleFa)||s:s},jt=function(e,t){var n=Yt+e,r=localStorage.getItem(n);return null!=r?r:Vt(e,t)},Vt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"prod";return e===V.EASY_PAY?Gt(ot.SDK_PORTAL,t):""},Gt=function(e,t){return"".concat(k[t||"prod"],"/easysafepay/pages/").concat(e,"/index.html")},zt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"prod",n=e.clientId,r=e.extendInfo,o=Kt(r),i=Ht({configs:o,mid:n,env:t,pageName:ot.DOUBLE_FA});return i},Wt="antom_checkout_previous_ProductInfo_",qt=function(){function e(){g()(this,e)}return f()(e,null,[{key:"savePreviousProductInfo",value:function(e,t){var n=Wt+"_"+e;localStorage.setItem(n,JSON.stringify({productSceneVersion:t.productSceneVersion,paymentMethodCategoryType:t.paymentMethodCategoryType,hostSign:t.hostSign}))}},{key:"getPreviousProductInfo",value:function(e){var t=Wt+"_"+e,n=localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch(e){return null}return null}}]),e}(),Jt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";try{if(e&&window){var n=window.localStorage.getItem(e);return n||t}}catch(e){return t}},Qt=function(e,t){try{if(e&&window)return window.localStorage.setItem(e,t),!0}catch(e){}return!1};function Zt(e){return!e||(e.toUpperCase().includes("Web".toUpperCase())||""===e)}var Xt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"AntomDefaultGrascaleId";try{if(e&&window){var t=Jt(e,"");if(t)return t;var n=He();e&&n&&Qt(e,n)}}catch(e){return""}};function $t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xt();if(!e)return 0;var t=e.substring(e.length-3,e.length-1),n=parseInt(t,16),r=Math.floor(100*n/255);return r}function en(e,t){if(null==e||!e.greyscale)return!0;try{var n=parseInt(null==e?void 0:e.greyscale);return 0!==n&&n>=t}catch(e){return!1}}var tn=function(e,t){try{var n,r=JSON.parse(e),o=function(e,t){var n=e.sort((function(e,t){return Nt(t.appVersion,e.appVersion)})),r=n.find((function(e){if(Ot(t.sdkVersion,e.v)&&Zt(e.platform)){var n,r,o,i,a,s=null===(n=e.productScene)||void 0===n||!n.trim()||e.productScene.toUpperCase().includes(null==t||null===(r=t.productScene)||void 0===r?void 0:r.toUpperCase()),l=null===(o=e.mid)||void 0===o||!o.trim()||e.mid.toUpperCase().includes(null==t||null===(i=t.mid)||void 0===i?void 0:i.toUpperCase()),c=en(e,null!==(a=t.greyscale)&&void 0!==a?a:$t());if(s&&l&&c)return e}}));return(null==r?void 0:r.appVersion)||null}(null==r||null===(n=r.sdkUpgradeInfo)||void 0===n?void 0:n.versions,t);return o}catch(e){return""}},nn=function(e){try{var t="Antom_".concat(e,"_LastAppVersion");return Jt(t,"")}catch(e){return""}},rn=function(e,t){try{var n="Antom_".concat(e,"_LastAppVersion");return Qt(n,t)}catch(e){return!1}};function on(e){try{return{id:e.split("&&").slice(0,3).join("&&"),data:JSON.parse(Pt(e.split("&&")[3]))}}catch(t){return console.error("Parsing sessionData is abnormal and may affect the payment link. Please ensure to use the new version of SDK.",t),{id:e,data:{}}}}var an=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=sn(e,t,n);return r||((r=Jt("Antom_".concat(e.sdkVersion+e.productScene,"_LastAppVersion"),""))||e.sdkVersion)},sn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=n.sort((function(e,t){return Nt(t.appVersion,e.appVersion)})),o=r.find((function(n){if(Ot(e.sdkVersion,n.v)&&Zt(n.platform)){var r,o,i,a,s=null===(r=n.productScene)||void 0===r||!r.trim()||n.productScene.toUpperCase().includes(null==e||null===(o=e.productScene)||void 0===o?void 0:o.toUpperCase()),l=null===(i=n.mid)||void 0===i||!i.trim()||n.mid.toUpperCase().includes(null==t?void 0:t.toUpperCase()),c=en(n,null!==(a=e.greyscaleId)&&void 0!==a?a:$t());if(s&&l&&c)return n}}));return(null==o?void 0:o.appVersion)||null},ln={production:{url:"https://cdn.marmot-cloud.com/page/antom-js/apdid-core.umd.min.js"},pre:{url:"https://antom-js-pre-unio.page.alipay.net/apdid-core.umd.min.js"},dev:{url:"https://antom-js-dev-unio.page.alipay.net/apdid-core.umd.min.js"}},cn=new Set(Object.values(ln).map((function(e){return e.url}))),un=function(){function e(){g()(this,e),c()(this,"state","idle"),c()(this,"loadingPromise",null),c()(this,"apdidModule",null),c()(this,"retryCount",0),c()(this,"config",null)}var t,n;return f()(e,[{key:"getState",value:function(){return this.state}},{key:"getApdidModule",value:function(){return this.apdidModule}},{key:"scheduleLoad",value:function(e){var t=this;if("idle"===this.state){var n=function(){t.load(e).catch((function(){}))};if("undefined"!=typeof requestIdleCallback){var r=requestIdleCallback(n,{timeout:2e3});setTimeout((function(){cancelIdleCallback(r),"idle"===t.state&&n()}),2e3)}else setTimeout(n,0)}}},{key:"load",value:(n=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ready"!==this.state){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:if("loading"!==this.state||!this.loadingPromise){e.next=4;break}return e.abrupt("return",this.loadingPromise);case 4:if(this.config=t,n=ln[t.environment]){e.next=11;break}return a=new Error("[ApdidLoader] Invalid environment: ".concat(t.environment,". Must be one of: production, pre, dev")),this.state="failed",null===(r=t.callbacks)||void 0===r||null===(o=r.onLoadFailed)||void 0===o||o.call(r,a),e.abrupt("return",Promise.reject(a));case 11:if(s=n.url,cn.has(s)){e.next=17;break}return u=new Error("[ApdidLoader] URL not in whitelist: ".concat(s)),this.state="failed",null===(l=t.callbacks)||void 0===l||null===(c=l.onLoadFailed)||void 0===c||c.call(l,u),e.abrupt("return",Promise.reject(u));case 17:if(!("failed"===this.state&&this.retryCount>1)){e.next=19;break}return e.abrupt("return",Promise.reject(new Error("[ApdidLoader] Max retries exceeded")));case 19:return this.state="loading",this.loadingPromise=this._loadWithRetry(s,t),e.abrupt("return",this.loadingPromise);case 22:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_loadWithRetry",value:(t=s()(i()().mark((function e(t,n){var r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:s=0;case 1:if(!(s<=1)){e.next=16;break}return e.prev=2,e.next=5,this._loadModuleOnce(t,n);case 5:return this.retryCount=0,e.abrupt("return");case 9:e.prev=9,e.t0=e.catch(2),a=e.t0,s<1&&(this.retryCount++,this.state="idle");case 13:s++,e.next=1;break;case 16:throw this.state="failed",this.loadingPromise=null,null===(r=n.callbacks)||void 0===r||null===(o=r.onLoadFailed)||void 0===o||o.call(r,a),a;case 20:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_loadModuleOnce",value:function(e,t){var n=this,r=Date.now();return"noModule"in document.createElement("script")?new Promise((function(o,i){var a=window,s=a.APDID;if(s)return n._onLoadSuccess(s,r,t),void o();var l=Array.from(document.querySelectorAll('script[type="module"]')).find((function(t){return t.src===e})),c=l||document.createElement("script"),u=!1,d=function(){clearTimeout(f),c.removeEventListener("load",h),c.removeEventListener("error",m)},p=function(e){u||(u=!0,d(),c.parentNode&&c.parentNode.removeChild(c),i(e))},h=function(){if(!u){var e=a.APDID;e?(u=!0,d(),n._onLoadSuccess(e,r,t),o()):p(new Error("[ApdidLoader] Module loaded but window.".concat("APDID"," not found")))}},m=function(){p(new Error("[ApdidLoader] Failed to load module script: ".concat(e)))},f=setTimeout((function(){var n,r;u||(null===(n=t.callbacks)||void 0===n||null===(r=n.onLoadTimeout)||void 0===r||r.call(n),p(new Error("[ApdidLoader] Module load timeout after ".concat(1e4,"ms: ").concat(e))))}),1e4);c.addEventListener("load",h),c.addEventListener("error",m),l||(c.type="module",c.src=e,c.async=!0,c.crossOrigin="anonymous",(document.head||document.getElementsByTagName("head")[0]).appendChild(c))})):Promise.reject(new Error("[ApdidLoader] Module scripts are not supported"))}},{key:"_onLoadSuccess",value:function(e,t,n){var r,o;this.state="ready",this.apdidModule=e;var i=Date.now()-t;null===(r=n.callbacks)||void 0===r||null===(o=r.onLoad)||void 0===o||o.call(r,i)}},{key:"destroy",value:function(){this.state="idle",this.apdidModule=null,this.loadingPromise=null,this.retryCount=0,this.config=null}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}},{key:"resetInstance",value:function(){e.instance&&e.instance.destroy(),e.instance=null}}]),e}();c()(un,"instance",null);var dn=function(e){return"AMSSDK_SECURITY_CONFIG_".concat(e)},pn=function(e){return e.SG="SG",e.US="US",e.DE="DE",e}({}),hn={SG:"https://open-sea-global.alipay.com/api/open/risk_client",US:"https://open-na-global.alipay.com/api/open/risk_client",DE:"https://open-de-global.alipay.com/api/open/risk_client"},mn=c()(c()(c()(c()(c()(c()(c()(c()(c()({},V.CASHIER_PAYMENT,"Acquirer"),V.AUTO_DEBIT,"Acquirer"),V.AUTO_DEBIT_PAY,"Acquirer"),V.VAULTING,"Acquirer"),V.CARD_APPLE_PAY,"Acquirer"),"EASYPAY","EasyPay"),V.EASY_PAY,"EasyPay"),V.FLASH_BUY,"OneAccount"),V.ELEMENT_PAYMENT,"Acquirer"),fn=function(e){return hn[e]||hn[pn.SG]},vn=function(e){return mn[e]||""},gn=function(e){if(!e)return"production";var t=e.toLowerCase();return"pre"===t||"light_sandbox"===t?"pre":"dev"===t||"test"===t||"local"===t?"dev":"production"},yn=function(){function e(t){g()(this,e),c()(this,"scene",void 0),c()(this,"h5gateway",void 0),c()(this,"environment",void 0),c()(this,"apdidLoaded",!1),c()(this,"apdidLoadFailed",!1),this.scene=t.scene,this.h5gateway=t.h5gateway||hn[pn.SG],this.environment=t.environment}var t,n,r;return f()(e,[{key:"ensureApdidLoaded",value:(r=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apdidLoaded){e.next=2;break}return e.abrupt("return",!0);case 2:if(!this.apdidLoadFailed){e.next=4;break}return e.abrupt("return",!1);case 4:return t=un.getInstance(),n=gn(this.environment),e.prev=6,e.next=9,t.load({environment:n,callbacks:{onLoad:function(e){console.log("[Security] apdid-core script loaded in ".concat(e,"ms"))},onLoadFailed:function(e){console.error("[Security] apdid-core script load failed:",e.message)},onLoadTimeout:function(){console.error("[Security] apdid-core script load timeout")}}});case 9:return this.apdidLoaded=!0,e.abrupt("return",!0);case 13:return e.prev=13,e.t0=e.catch(6),console.error("[Security] apdid-core load error, degrading:",e.t0),this.apdidLoadFailed=!0,e.abrupt("return",!1);case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return r.apply(this,arguments)})},{key:"getAPDIDModule",value:function(){return un.getInstance().getApdidModule()}},{key:"initSecurity",value:function(e,t){var n=this;if(!this.scene)throw new Error("securityConfig parameter error");if(!Object.values(mn).includes(this.scene)||!Object.values(hn).includes(this.h5gateway)){var r="scene:".concat(this.scene," or h5gateway:").concat(this.h5gateway," do not supported");throw console.error(r),new Error(r)}this.ensureApdidLoaded().then((function(r){r?n.initToken(e,t):t&&t("apdid-core script load failed")})).catch((function(){t&&t("apdid-core script load failed")}))}},{key:"initToken",value:function(e,t){try{var n=this.getAPDIDModule();null==n||n.initToken(this.scene,{host:this.h5gateway},(function(n,r,o){n?e&&e():t&&t(o)}))}catch(e){t&&t(null==e?void 0:e.toString())}}},{key:"pollingGetApdidToken",value:(n=s()(i()().mark((function e(t){var n,r,o,a=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=parseInt((null==t?void 0:t.tokenCollectTime)||"0",10),r=parseInt((null==t?void 0:t.dataPollingInterval)||"500",10),o=function(){var e=s()(i()().mark((function e(t){var o,l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:if(!(o=e.sent)){e.next=5;break}return e.abrupt("return",t(o));case 5:c=function(){var e=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:(o=e.sent)&&(clearInterval(l),t(o));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=setInterval(c,r),setTimeout((function(){clearInterval(l),t(o)}),n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",new Promise((function(e){o(e)})));case 4:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"getApdidToken",value:(t=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureApdidLoaded();case 2:if(e.sent){e.next=5;break}return e.abrupt("return","");case 5:return e.abrupt("return",new Promise((function(e){try{var n=t.getAPDIDModule();null==n||n.getApdidToken(t.scene,(function(t){e(null==t?void 0:t.token)}))}catch(t){e("")}})));case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),_n=function(){function e(){g()(this,e),c()(this,"registry",new Map)}var t;return f()(e,[{key:"get",value:function(e){return this.registry.get(e)}},{key:"setLoading",value:function(e,t){this.registry.set(e,{status:"loading",loadingPromise:t})}},{key:"setReady",value:function(e,t){this.registry.set(e,{status:"ready",instance:t})}},{key:"setFailed",value:function(e,t){this.registry.set(e,{status:"failed",error:t})}},{key:"getReadyInstance",value:function(e){var t=this.registry.get(e);if(t&&"ready"===t.status)return t.instance}},{key:"getInstance",value:(t=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.registry.get(t)){e.next=3;break}return e.abrupt("return",void 0);case 3:if("ready"!==n.status){e.next=5;break}return e.abrupt("return",n.instance);case 5:if("loading"!==n.status){e.next=15;break}return e.prev=6,e.next=9,n.loadingPromise;case 9:return e.abrupt("return",e.sent);case 12:return e.prev=12,e.t0=e.catch(6),e.abrupt("return",void 0);case 15:return e.abrupt("return",void 0);case 16:case"end":return e.stop()}}),e,this,[[6,12]])}))),function(e){return t.apply(this,arguments)})},{key:"isReady",value:function(e){var t=this.registry.get(e);return"ready"===(null==t?void 0:t.status)}},{key:"isLoading",value:function(e){var t=this.registry.get(e);return"loading"===(null==t?void 0:t.status)}},{key:"delete",value:function(e){return this.registry.delete(e)}},{key:"clear",value:function(){this.registry.clear()}}]),e}(),En=new _n,bn=function(){function e(){g()(this,e)}var t;return f()(e,null,[{key:"preloadWebApp",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"prod",r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{if(this.isWebAppPreloaded)return void console.log("[web-sdk] web app already preloaded");var o=this.buildWebAppPreloadUrl(e,t,n,r),i=o.preloadUrl,a=o.containerId,s=nt(a);s.src=i;var l=document.body||null;l&&(console.log("[web-sdk] preload web app, url: ",i),l.appendChild(s),this.isWebAppPreloaded=!0),setTimeout((function(){var e=document.getElementById(a);e&&(console.log("[web-sdk] remove preload web app"),document.body.removeChild(e))}),1e4)}catch(e){console.error("[web-sdk] preload web app failed",e)}}},{key:"preloadSecuritySDK",value:(t=s()(i()().mark((function t(n){var r,o,a,s,l,c,u,d,p,h=this,m=arguments;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=m.length>1&&void 0!==m[1]?m[1]:"SG",o=m.length>2?m[2]:void 0,t.prev=2,!this.isSecuritySDKPreloaded){t.next=6;break}return console.log("[web-sdk] security sdk is already loaded"),t.abrupt("return");case 6:if(a=e.getSecurityConfigStorage(n),s=a.scene||vn(n),console.log("getSecurityScene",s),l=a.h5gateway||fn(r),console.log("preloadSecuritySDK",s),!En.isReady(s)){t.next=15;break}return console.log("[web-sdk] security sdk already ready in registry"),this.isSecuritySDKPreloaded=!0,t.abrupt("return");case 15:if(!En.isLoading(s)){t.next=30;break}if(console.log("[web-sdk] security sdk is already loading, waiting..."),!(c=En.get(s))||"loading"!==c.status){t.next=29;break}return t.prev=19,t.next=22,c.loadingPromise;case 22:this.isSecuritySDKPreloaded=!0,console.log("[web-sdk] preload security sdk succeed (waited for existing load)"),t.next=29;break;case 26:t.prev=26,t.t0=t.catch(19),console.error("[web-sdk] preload security sdk failed (existing load failed)");case 29:return t.abrupt("return");case 30:u=gn(o),un.getInstance().scheduleLoad({environment:u}),d=new yn({scene:s,h5gateway:l,environment:o}),p=new Promise((function(e,t){d.initSecurity((function(){En.setReady(s,d),h.isSecuritySDKPreloaded=!0,console.log("[web-sdk] preload security sdk succeed"),e(d)}),(function(){En.setFailed(s,new Error("Preload security sdk init failed")),console.error("[web-sdk] preload security sdk failed"),t(new Error("Preload security sdk init failed"))}))})),En.setLoading(s,p),t.next=41;break;case 38:t.prev=38,t.t1=t.catch(2),console.error("[web-sdk] preload security sdk failed",t.t1);case 41:case"end":return t.stop()}}),t,this,[[2,38],[19,26]])}))),function(e){return t.apply(this,arguments)})},{key:"getSecuritySdk",value:function(e){return En.getReadyInstance(e)}},{key:"buildWebAppPreloadUrl",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=e===V.EASY_PAY?"2.0":"1.0",i=qt.getPreviousProductInfo(e);i&&(o=null==i?void 0:i.productSceneVersion);var a="ams-checkout-component-".concat(e,"_").concat(t),s={productScene:e,sdkVersion:T,webAppVersion:""};s.webAppVersion=an(s);var l={environment:n,sdkMetaData:s,paymentMethodCategoryType:t,isPreload:!0,productScene:e,productSceneVersion:o,query:void 0},c=r?Dt(l):Lt(l);return{preloadUrl:c,containerId:a}}},{key:"getSecurityConfigStorage",value:function(e){var t="",n="",r=kt(dn(e));if(r){var o=yt(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}}]),e}();c()(bn,"isWebAppPreloaded",!1),c()(bn,"isSecuritySDKPreloaded",!1);var An=function(e){return e.optional_init="plugin_optional_init",e}({}),Sn=function(e){return e.canMakePayments="plugin_CARD_APPLE_PAY_available",e.createComponent="plugin_CARD_APPLE_PAY_createComponent",e.destroyComponent="plugin_CARD_APPLE_PAY_destroyComponent",e}({}),kn=function(e){return e.mountComponent="plugin_Paypal_mountComponent",e.destroyComponent="plugin_Paypal_destroyComponent",e}({}),Tn=function(e){return e.onEventCallback="onEventCallback",e}({}),Pn=function(e){return e.getSecurityDeviceId="getSecurityDeviceId",e}({}),In=function(e){return e.reportAnalytics="reportAnalytics",e}({}),Cn=function(e){return e[e.notStarted=0]="notStarted",e[e.pending=1]="pending",e[e.fail=2]="fail",e[e.success=3]="success",e}(Cn||{}),wn=function(){function e(t){var n=this;g()(this,e),c()(this,"merchantIdentifier",void 0),c()(this,"merchantName",void 0),c()(this,"session",void 0),c()(this,"paymentState",void 0),c()(this,"getMerchantSession",void 0),c()(this,"completePaymentAuthorized",void 0),c()(this,"completeApplePay",void 0),c()(this,"logError",void 0),c()(this,"isRecurring",!1),c()(this,"logger",void 0),c()(this,"onvalidatemerchant",(function(e){var t=!1;n.getMerchantSession({displayName:n.merchantName,merchantIdentifier:n.merchantIdentifier,validationUrl:e.validationURL}).then((function(e){console.log("onvalidatemerchant#merchantSessionObjectString",e);var r=JSON.parse(e);n.session.completeMerchantValidation(r),t=!0})).catch((function(e){n.logError(ae.SDK_PAYMENT_FAIL,"MerchantValidationError",e),n.sessionAbort()})),n.logger.logInfo({name:"APPLE_PAY",title:Ea.sdk_event_appleCreateComponent},{eventSource:"sdk",processResult:t,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send()})),c()(this,"onpaymentauthorized",(function(e){var t,r=window.ApplePaySession,o=!1,i=function(e){n.session.completePayment(r.STATUS_FAILURE),n.logError(ae.SDK_PAYMENT_FAIL,"PaymentAuthorizedError",e),n.sessionAbort()};null!=e&&null!==(t=e.payment)&&void 0!==t&&t.token?(n.paymentState=Cn.pending,n.completePaymentAuthorized({paymentToken:JSON.stringify(e.payment.token)}).then((function(e){n.session.completePayment(r.STATUS_SUCCESS),n.completeApplePay(e),n.paymentState=Cn.success,o=!0})).catch((function(e){i(e),n.paymentState=Cn.fail}))):i(),n.logger.logInfo({name:"APPLE_PAY",title:Ea.sdk_event_appleSubmitToken},{eventSource:"sdk",processResult:o,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send()})),c()(this,"startPay",(function(e){var t=e.paymentSessionFactor,r=t.extendInfo,o=t.merchantInfo,i=t.paymentAmount,a=t.order,s=t.recurringInfo;n.merchantIdentifier=null==o?void 0:o.partnerId;var l=window.ApplePaySession;if(n.isRecurring=null!==s,n.logger.logInfo({name:"APPLE_PAY",title:Ea.sdk_event_appleCreateComponent},{eventSource:"sdk",processResult:null!==l,eventMessage:JSON.stringify({type:"funnel",recurring:n.isRecurring})}).send(),l)if(null!=r&&r.merchantCapabilities&&null!=r&&r.supportedNetworks&&null!=o&&o.registeredCountry&&null!=i&&i.currency&&null!=i&&i.value&&null!=o&&o.merchantName){if(s){var c;if(null==a||!a.orderDescription||null==s||!s.managementURL)return void n.logError(ae.SDK_PAYMENT_ERROR,"Abnormal params recurringInfo");var u={type:"final",label:s.title,amount:null==i?void 0:i.value,paymentTiming:"recurring",recurringPaymentStartDate:null!=s&&s.startDate?new Date(1e3*Number(s.startDate)):null,recurringPaymentEndDate:null!=s&&s.endDate?new Date(1e3*Number(s.endDate)):null,recurringPaymentIntervalUnit:null!=s&&s.intervalUnit?s.intervalUnit:"month",recurringPaymentIntervalCount:null!==(c=null==s?void 0:s.intervalCount)&&void 0!==c?c:1},d={paymentDescription:null==a?void 0:a.orderDescription,billingAgreement:s.agreementDescription,regularBilling:u,managementURL:null==s?void 0:s.managementURL,tokenNotificationURL:null==s?void 0:s.tokenNotificationURL},p={merchantCapabilities:null==r?void 0:r.merchantCapabilities,supportedNetworks:null==r?void 0:r.supportedNetworks,countryCode:null==o?void 0:o.registeredCountry,currencyCode:null==i?void 0:i.currency,total:u,recurringPaymentRequest:d,lineItems:[u]};n.session=new l(14,p)}else{var h={merchantCapabilities:null==r?void 0:r.merchantCapabilities,supportedNetworks:null==r?void 0:r.supportedNetworks,countryCode:null==o?void 0:o.registeredCountry,currencyCode:null==i?void 0:i.currency,total:{type:"final",label:null==o?void 0:o.merchantName,amount:null==i?void 0:i.value}};n.session=new l(2,h)}n.session.onvalidatemerchant=n.onvalidatemerchant,n.session.onpaymentauthorized=n.onpaymentauthorized,n.session.oncancel=function(){n.paymentState===Cn.pending?n.logError(ae.SDK_PAYMENT_PROCESSING,"Payment processing but user dismissed the sheet"):n.logError(ae.SDK_PAYMENT_CANCEL,"User dismissed the sheet"),n.sessionAbort()},n.session.begin(),n.logger.logInfo({name:"APPLE_PAY",title:Ea.sdk_event_appleShowPaymentSheet},{eventSource:"sdk",processResult:!0,eventMessage:JSON.stringify({type:"funnel",recurring:null!==s})}).send()}else n.logError(ae.SDK_PAYMENT_ERROR,"Abnormal params paymentSessionFactor");else n.logError(ae.SDK_PAYMENT_ERROR,"ApplePaySession is only support in Safari")})),this.logger=t}var t;return f()(e,[{key:"setApplePayParams",value:function(e,t,n,r){this.getMerchantSession=e,this.completePaymentAuthorized=t,this.completeApplePay=n,this.logError=r,this.paymentState=Cn.notStarted}},{key:"hasActiveCard",value:(t=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=window,!(r=n.ApplePaySession)){e.next=3;break}return e.abrupt("return",r.canMakePaymentsWithActiveCard(t));case 3:return e.abrupt("return",Promise.resolve(!1));case 4:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"sessionAbort",value:function(){if(this.session)try{this.session.abort()}catch(e){console.log("session.abort() error")}}}],[{key:"canMakePayments",value:function(e){return"ApplePayRecurringPayment"===e?!!window.ApplePaySession&&(window.ApplePaySession.canMakePayments()&&window.ApplePaySession.supportsVersion(14)):!!window.ApplePaySession&&(window.ApplePaySession.canMakePayments()&&window.ApplePaySession.supportsVersion(2))}}]),e}(),Nn=wn;function On(e,t){return function(){return e.apply(t,arguments)}}var Rn,Mn,Dn=n(8822),Ln=Object.prototype.toString,xn=Object.getPrototypeOf,Un=Symbol.iterator,Kn=Symbol.toStringTag,Bn=(Rn=Object.prototype.hasOwnProperty,function(e,t){return Rn.call(e,t)}),Yn=function(e){return"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e)},Fn=function(e,t,n){return e===Object.prototype||!n&&null===t},Hn=function(e,t){for(var n=e,r=[];null!=n;){if(-1!==r.indexOf(n))return!1;r.push(n);var o=xn(n);if(Fn(n,o,n===e))return!1;if(Bn(n,t))return!0;n=o}return!1},jn=(Mn=Object.create(null),function(e){var t=Ln.call(e);return Mn[t]||(Mn[t]=t.slice(8,-1).toLowerCase())}),Vn=function(e){return e=e.toLowerCase(),function(t){return jn(t)===e}},Gn=function(e){return function(t){return qe(t)===e}},zn=Array.isArray,Wn=Gn("undefined");function qn(e){return null!==e&&!Wn(e)&&null!==e.constructor&&!Wn(e.constructor)&&Zn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var Jn=Vn("ArrayBuffer");var Qn=Gn("string"),Zn=Gn("function"),Xn=Gn("number"),$n=function(e){return null!==e&&"object"===qe(e)},er=function(e){if(!$n(e))return!1;var t=xn(e);return!(null!==t&&t!==Object.prototype&&null!==xn(t)||Hn(e,Kn)||Hn(e,Un))},tr=Vn("Date"),nr=Vn("File"),rr=Vn("Blob"),or=Vn("FileList"),ir=Vn("Set");var ar="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},sr=void 0!==ar.FormData?ar.FormData:void 0,lr=Vn("URLSearchParams"),cr=["ReadableStream","Request","Response","Headers"].map(Vn),ur=et(cr,4),dr=ur[0],pr=ur[1],hr=ur[2],mr=ur[3];function fr(e,t){var n,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.allOwnKeys,a=void 0!==i&&i;if(null!=e)if("object"!==qe(e)&&(e=[e]),zn(e))for(n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else{if(qn(e))return;var s,l=a?Object.getOwnPropertyNames(e):Object.keys(e),c=l.length;for(n=0;n<c;n++)s=l[n],t.call(null,e[s],s,e)}}function vr(e,t){if(qn(e))return null;t=t.toLowerCase();for(var n,r=Object.keys(e),o=r.length;o-- >0;)if(t===(n=r[o]).toLowerCase())return n;return null}var gr="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,yr=function(e){return!Wn(e)&&e!==gr};var _r,Er=(_r="undefined"!=typeof Uint8Array&&xn(Uint8Array),function(e){return _r&&e instanceof _r}),br=Vn("HTMLFormElement"),Ar=Object.prototype.propertyIsEnumerable,Sr=Vn("RegExp"),kr=function(e,t){var n=Object.getOwnPropertyDescriptors(e),r={};fr(n,(function(n,o){var i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)};var Tr,Pr,Ir,Cr,wr=Vn("AsyncFunction"),Nr=(Tr="function"==typeof setImmediate,Pr=Zn(gr.postMessage),Tr?setImmediate:Pr?(Ir="axios@".concat(Math.random()),Cr=[],gr.addEventListener("message",(function(e){var t=e.source,n=e.data;t===gr&&n===Ir&&Cr.length&&Cr.shift()()}),!1),function(e){Cr.push(e),gr.postMessage(Ir,"*")}):function(e){return setTimeout(e)}),Or="undefined"!=typeof queueMicrotask?queueMicrotask.bind(gr):void 0!==Dn&&Dn.nextTick||Nr,Rr=function(e){return null!=e&&Zn(e[Un])},Mr={isArray:zn,isArrayBuffer:Jn,isBuffer:qn,isFormData:function(e){if(!e)return!1;if(sr&&e instanceof sr)return!0;var t=xn(e);if(!t||t===Object.prototype)return!1;if(!Zn(e.append))return!1;var n=jn(e);return"formdata"===n||"object"===n&&Zn(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Jn(e.buffer)},isString:Qn,isNumber:Xn,isBoolean:function(e){return!0===e||!1===e},isObject:$n,isPlainObject:er,isEmptyObject:function(e){if(!$n(e)||qn(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:dr,isRequest:pr,isResponse:hr,isHeaders:mr,isUndefined:Wn,isDate:tr,isFile:nr,isReactNativeBlob:function(e){return!(!e||void 0===e.uri)},isReactNative:function(e){return e&&void 0!==e.getParts},isBlob:rr,isRegExp:Sr,isFunction:Zn,isStream:function(e){return $n(e)&&Zn(e.pipe)},isURLSearchParams:lr,isTypedArray:Er,isFileList:or,forEach:fr,merge:function e(){for(var t=yr(this)&&this||{},n=t.caseless,r=t.skipUndefined,o={},i=function(t,i){if("__proto__"!==i&&"constructor"!==i&&"prototype"!==i){var a=n&&"string"==typeof i&&vr(o,i)||i,s=Bn(o,a)?o[a]:void 0;er(s)&&er(t)?o[a]=e(s,t):er(t)?o[a]=e({},t):zn(t)?o[a]=t.slice():r&&Wn(t)||(o[a]=t)}},a=0,s=arguments.length;a<s;a++){var l=a<0||arguments.length<=a?void 0:arguments[a];if(l&&!qn(l)&&(fr(l,i),"object"===qe(l)&&!zn(l)))for(var c=Object.getOwnPropertySymbols(l),u=0;u<c.length;u++){var d=c[u];Ar.call(l,d)&&i(l[d],d)}}return o},extend:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.allOwnKeys;return fr(t,(function(t,r){n&&Zn(t)?Object.defineProperty(e,r,{__proto__:null,value:On(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})}),{allOwnKeys:o}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var o,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&xn(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:jn,kindOfTest:Vn,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(zn(e))return e;var t=e.length;if(!Xn(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},forEachEntry:function(e,t){for(var n,r=(e&&e[Un]).call(e);(n=r.next())&&!n.done;){var o=n.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:br,hasOwnProperty:Bn,hasOwnProp:Bn,hasOwnInPrototypeChain:Hn,getSafeProp:function(e,t){return null!=e&&Hn(e,t)?e[t]:void 0},toSafeFlatObject:function(e){if(null==e||"object"!==qe(e)&&"function"!=typeof e)return e;var t=xn(e);if(null===t&&function(e){if(!Object.isExtensible(e))return!1;var t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push.apply(t,Xe(Object.getOwnPropertySymbols(e))),t.every((function(t){if(Yn(t))return!1;var n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable}))}(e))return e;for(var n=Object.create(null),r=Object.create(null),o=[],i=e;null!=i&&-1===o.indexOf(i);){o.push(i);var a=i===e?t:xn(i);if(Fn(i,a,i===e))break;var s=Object.getOwnPropertyNames(i);Object.getOwnPropertySymbols&&s.push.apply(s,Xe(Object.getOwnPropertySymbols(i)));var l,c=u(s);try{for(c.s();!(l=c.n()).done;){var d=l.value;Yn(d)||(Bn(r,d)||(n[d]=e[d],r[d]=!0))}}catch(e){c.e(e)}finally{c.f()}i=a}return n},reduceDescriptors:kr,freezeMethods:function(e){kr(e,(function(t,n){if(Zn(e)&&["arguments","caller","callee"].includes(n))return!1;var r=e[n];Zn(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:function(e,t){var n={},r=function(e){e.forEach((function(e){n[e]=!0}))};return zn(e)?r(e):r(String(e).split(t)),n},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))},noop:function(){},toFiniteNumber:function(e,t){return null!=e&&Number.isFinite(e=+e)?e:t},findKey:vr,global:gr,isContextDefined:yr,isSpecCompliantForm:function(e){return!!(e&&Zn(e.append)&&"FormData"===e[Kn]&&e[Un])},toJSONObject:function(e){var t=new WeakSet;return function e(n){if($n(n)){if(t.has(n))return;if(qn(n))return n;if(!("toJSON"in n)){var r;if(t.add(n),ir(n)){r=[];var o,i=u(n);try{for(i.s();!(o=i.n()).done;){var a=o.value,s=e(a);!Wn(s)&&r.push(s)}}catch(e){i.e(e)}finally{i.f()}}else r=zn(n)?[]:{},fr(n,(function(t,n){var o=e(t);!Wn(o)&&(r[n]=o)}));return t.delete(n),r}}return n}(e)},isAsyncFn:wr,isThenable:function(e){return e&&($n(e)||Zn(e))&&Zn(e.then)&&Zn(e.catch)},setImmediate:Nr,asap:Or,isIterable:Rr,isSafeIterable:function(e){return null!=e&&Hn(e,Un)&&Rr(e)}},Dr=Mr.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"]);var Lr=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),xr=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Ur(e,t){return Mr.isArray(e)?e.map((function(e){return Ur(e,t)})):function(e){for(var t=0,n=e.length;t<n;){var r=e.charCodeAt(t);if(9!==r&&32!==r)break;t+=1}for(;n>t;){var o=e.charCodeAt(n-1);if(9!==o&&32!==o)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function Kr(e){var t=Object.create(null);return Mr.forEach(e.toJSON(),(function(e,n){t[n]=function(e){return Ur(e,xr)}(e)})),t}var Br=Symbol("internals");function Yr(e){return e&&String(e).trim().toLowerCase()}function Fr(e){return!1===e||null==e?e:Mr.isArray(e)?e.map(Fr):function(e){return Ur(e,Lr)}(String(e))}var Hr=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function jr(e){for(var t=0,n=e.length;t<n;){var r=e.charCodeAt(t);if(9!==r&&32!==r)break;t+=1}for(;n>t;){var o=e.charCodeAt(n-1);if(9!==o&&32!==o)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}function Vr(e,t,n,r,o){return Mr.isFunction(r)?r.call(this,t,n):(o&&(t=n),Mr.isString(t)?Mr.isString(r)?-1!==t.indexOf(r):Mr.isRegExp(r)?r.test(t):void 0:void 0)}var Gr=function(e,t){function n(e){v(this,n),e&&this.set(e)}return m(n,[{key:"set",value:function(e,t,n){var r=this;function o(e,t,n){var o=Yr(t);if(o){var i=Mr.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Fr(e))}}var i=function(e,t){return Mr.forEach(e,(function(e,n){return o(e,n,t)}))};if(Mr.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(Mr.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i(function(e){var t,n,r,o={};return e&&e.split("\n").forEach((function(e){r=e.indexOf(":"),t=e.substring(0,r).trim().toLowerCase(),n=e.substring(r+1).trim();var i=Mr.hasOwnProp(o,t);!t||i&&Mr.hasOwnProp(Dr,t)||("set-cookie"===t?i?o[t].push(n):o[t]=[n]:o[t]=i?o[t]+", "+n:n)})),o}(e),t);else if(Mr.isObject(e)&&Mr.isSafeIterable(e)){var a,s,l,c=Object.create(null),d=u(e);try{for(d.s();!(l=d.n()).done;){var p=l.value;if(!Mr.isArray(p))throw new TypeError("Object iterator must return a key-value pair");s=p[0],Mr.hasOwnProp(c,s)?(a=c[s],c[s]=Mr.isArray(a)?[].concat(Xe(a),[p[1]]):[a,p[1]]):c[s]=p[1]}}catch(e){d.e(e)}finally{d.f()}i(c,t)}else null!=e&&o(t,e,n);return this}},{key:"get",value:function(e,t){if(e=Yr(e)){var n=Mr.findKey(this,e);if(n){var r=this[n];if(!t)return r;if(!0===t)return function(e){for(var t,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=r.exec(e);)n[t[1]]=t[2];return n}(r);if(Mr.isFunction(t))return t.call(this,r,n);if(Mr.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=Yr(e)){var n=Mr.findKey(this,e);return!(!n||void 0===this[n]||t&&!Vr(0,this[n],n,t))}return!1}},{key:"delete",value:function(e,t){var n=this,r=!1;function o(e){if(e=Yr(e)){var o=Mr.findKey(n,e);!o||t&&!Vr(0,n[o],o,t)||(delete n[o],r=!0)}}return Mr.isArray(e)?e.forEach(o):o(e),r}},{key:"clear",value:function(e){for(var t=Object.keys(this),n=t.length,r=!1;n--;){var o=t[n];e&&!Vr(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}},{key:"normalize",value:function(e){var t=this,n={};return Mr.forEach(this,(function(r,o){var i=Mr.findKey(n,o);if(i)return t[i]=Fr(r),void delete t[o];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))}(o):String(o).trim();a!==o&&delete t[o],t[a]=Fr(r),n[a]=!0})),this}},{key:"concat",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=this.constructor).concat.apply(e,[this].concat(n))}},{key:"toJSON",value:function(e){var t=Object.create(null);return Mr.forEach(this,(function(n,r){null!=n&&!1!==n&&(t[r]=e&&Mr.isArray(n)?n.join(", "):n)})),t}},{key:e,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map((function(e){var t=et(e,2);return t[0]+": "+t[1]})).join("\n")}},{key:"getSetCookie",value:function(){var e=this.get("set-cookie");return Mr.isArray(e)?e:null==e||!1===e?[]:[e]}},{key:t,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(e){return e instanceof this?e:new this(e)}},{key:"parseParameters",value:function(e){return function(e){var t=Object.create(null),n=String(e),r=0,o=!1,i=!1;function a(e){var o=jr(n.slice(r,e)),i=o.indexOf("=");if(!(i<1)){var a=jr(o.slice(0,i));if(Hr.test(a)){var s=a.toLowerCase();if("__proto__"!==s&&"constructor"!==s&&"prototype"!==s){var l=jr(o.slice(i+1));t[s]=function(e){var t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;for(var n="",r=1;r<t;r++){var o=e.charCodeAt(r);if(34===o)return e;if(92===o&&(r+=1)>=t)return e;n+=e[r]}return n}(l)}}}}for(var s=0;s<n.length;s++){var l=n.charCodeAt(s);o?i?i=!1:92===l?i=!0:34===l&&(o=!1):34===l?o=!0:44!==l&&59!==l||(a(s),r=s+1)}return a(n.length),t}(e)}},{key:"concat",value:function(e){for(var t=new this(e),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.forEach((function(e){return t.set(e)})),t}},{key:"accessor",value:function(e){var t=(this[Br]=this[Br]={accessors:{}}).accessors,n=this.prototype;function r(e){var r=Yr(e);t[r]||(!function(e,t){var n=Mr.toCamelCase(" "+t);["get","set","has"].forEach((function(r){Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return Mr.isArray(e)?e.forEach(r):r(e),this}}]),n}(Symbol.iterator,Symbol.toStringTag);Gr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Mr.reduceDescriptors(Gr.prototype,(function(e,t){var n=e.value,r=t[0].toUpperCase()+t.slice(1);return{get:function(){return n},set:function(e){this[r]=e}}})),Mr.freezeMethods(Gr);var zr=Gr,Wr="[REDACTED ****]";function qr(e,t){var n=new Set(t.map((function(e){return String(e).toLowerCase()}))),r=[];return function e(t){if(null===t||"object"!==qe(t))return t;if(Mr.isBuffer(t))return t;if(-1===r.indexOf(t)){var o;if(t instanceof zr&&(t=t.toJSON()),r.push(t),Mr.isArray(t))o=[],t.forEach((function(t,n){var r=e(t);Mr.isUndefined(r)||(o[n]=r)}));else{if(!Mr.isPlainObject(t)&&function(e){if(Mr.hasOwnProp(e,"toJSON"))return!0;for(var t=Object.getPrototypeOf(e);t&&t!==Object.prototype;){if(Mr.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(t))return r.pop(),t;o=Object.create(null);for(var i=0,a=Object.entries(t);i<a.length;i++){var s=et(a[i],2),l=s[0],c=s[1],u=n.has(l.toLowerCase())?Wr:e(c);Mr.isUndefined(u)||(o[l]=u)}}return r.pop(),o}}(e)}function Jr(e){try{return String(e)}catch(e){return""}}var Qr=function(e){y(n,e);var t=E(n);function n(e,r,o,i,a){var s;return v(this,n),s=t.call(this,e),Object.defineProperty(Qe(s),"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),s.name="AxiosError",s.isAxiosError=!0,r&&(s.code=r),o&&(s.config=o),i&&(s.request=i),a&&(s.response=a,s.status=a.status),s}return m(n,[{key:"toJSON",value:function(){var e=this.config,t=e&&Mr.hasOwnProp(e,"redact")?e.redact:void 0,n=Mr.isArray(t)&&t.length>0?qr(e,t):Mr.toJSONObject(e);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:n,code:this.code,status:this.status}}}],[{key:"from",value:function(e,t,r,o,i,a){var s=e.message;!s&&Mr.isArray(e.errors)&&e.errors.length&&(s=function(e){return e.errors.map((function(e){try{return e&&e.message?Jr(e.message):Jr(e)}catch(e){return""}})).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));var l=new n(s,t||e.code,r,o,i);return Object.defineProperty(l,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),l.name=e.name,null!=e.status&&null==l.status&&(l.status=e.status),a&&Object.assign(l,a),l}}]),n}(I(Error));Qr.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",Qr.ERR_BAD_OPTION="ERR_BAD_OPTION",Qr.ECONNABORTED="ECONNABORTED",Qr.ETIMEDOUT="ETIMEDOUT",Qr.ECONNREFUSED="ECONNREFUSED",Qr.ERR_NETWORK="ERR_NETWORK",Qr.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",Qr.ERR_DEPRECATED="ERR_DEPRECATED",Qr.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",Qr.ERR_BAD_REQUEST="ERR_BAD_REQUEST",Qr.ERR_CANCELED="ERR_CANCELED",Qr.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",Qr.ERR_INVALID_URL="ERR_INVALID_URL",Qr.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var Zr=Qr;function Xr(e){return Mr.isPlainObject(e)||Mr.isArray(e)}function $r(e){return Mr.endsWith(e,"[]")?e.slice(0,-2):e}function eo(e,t,n){return e?e.concat(t).map((function(e,t){return e=$r(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var to=Mr.toFlatObject(Mr,{},null,(function(e){return/^is[A-Z]/.test(e)}));var no=function(e,t,n){if(!Mr.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;var r=function(e,t){var r=Mr.getSafeProp(n,e);return Mr.isUndefined(r)?t:r},o=r("metaTokens",!0),i=r("visitor")||m,a=r("dots",!1),s=r("indexes",!1),l=r("Blob")||"undefined"!=typeof Blob&&Blob,c=r("maxDepth",100),u=l&&Mr.isSpecCompliantForm(t),d=[];if(!Mr.isFunction(i))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(Mr.isDate(e))return e.toISOString();if(Mr.isBoolean(e))return e.toString();if(!u&&Mr.isBlob(e))throw new Zr("Blob is not supported. Use a Buffer instead.");if(Mr.isArrayBuffer(e)||Mr.isTypedArray(e)){if(u&&"function"==typeof l)return new l([e]);throw new Zr("Blob is not supported. Use a Buffer instead.",Zr.ERR_NOT_SUPPORT)}return e}function h(e){if(e>c)throw new Zr("Object is too deeply nested ("+e+" levels). Max depth: "+c,Zr.ERR_FORM_DATA_DEPTH_EXCEEDED)}function m(e,n,r){var i=e;if(Mr.isReactNative(t)&&Mr.isReactNativeBlob(e))return t.append(eo(r,n,a),p(e)),!1;if(e&&!r&&"object"===qe(e))if(Mr.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=function(e,t){if(c===1/0)return JSON.stringify(e);var n=[];return JSON.stringify(e,(function(e,r){if(!Mr.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),h(t+n.length-1),r}))}(e,1);else if(Mr.isArray(e)&&function(e){return Mr.isArray(e)&&!e.some(Xr)}(e)||(Mr.isFileList(e)||Mr.endsWith(n,"[]"))&&(i=Mr.toArray(e)))return n=$r(n),i.forEach((function(e,r){!Mr.isUndefined(e)&&null!==e&&t.append(!0===s?eo([n],r,a):null===s?n:n+"[]",p(e))})),!1;return!!Xr(e)||(t.append(eo(r,n,a),p(e)),!1)}var f=Object.assign(to,{defaultVisitor:m,convertValue:p,isVisitable:Xr});if(!Mr.isObject(e))throw new TypeError("data must be an object");return function e(n,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!Mr.isUndefined(n)){if(h(o),-1!==d.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));d.push(n),Mr.forEach(n,(function(n,a){!0===(!(Mr.isUndefined(n)||null===n)&&i.call(t,n,Mr.isString(a)?a.trim():a,r,f))&&e(n,r?r.concat(a):[a],o+1)})),d.pop()}}(e),t};function ro(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,(function(e){return t[e]}))}function oo(e,t){this._pairs=[],e&&no(e,this,t)}var io=oo.prototype;io.append=function(e,t){this._pairs.push([e,t])},io.toString=function(e){var t=this,n=e?function(n){return e.call(t,n,ro)}:ro;return this._pairs.map((function(e){return n(e[0])+"="+n(e[1])}),"").join("&")};var ao=oo;function so(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function lo(e,t,n){if(!t)return e;e=e||"";var r,o=Mr.isFunction(n)?{serialize:n}:n,i=Mr.getSafeProp(o,"encode")||so,a=Mr.getSafeProp(o,"serialize");if(r=a?a(t,o):Mr.isURLSearchParams(t)?t.toString():new ao(t,o).toString(i)){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}var co=Symbol("internals");function uo(e){return e?e.length:0}function po(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function ho(e,t){var n=e.handlers,r=uo(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):r!==t.handlersLength&&(r?t.handlerEntries.forEach((function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)})):t.handlerEntries.clear()),t.handlersLength=r}var mo=function(){function e(){v(this,e),this.handlers=[],this[co]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}return m(e,[{key:"use",value:function(e,t,n){var r={fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null},o=this[co];null==this.handlers&&(this.handlers=[]),ho(this,o);var i=o.nextId++;return this.handlers.push(r),o.handlerEntries.set(i,{handler:r,index:this.handlers.length-1}),o.handlersLength=this.handlers.length,i}},{key:"eject",value:function(e){var t=this[co];ho(this,t);var n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||(po(this.handlers),t.handlersLength=this.handlers.length)}}},{key:"clear",value:function(){this.handlers&&(this.handlers=[],ho(this,this[co]))}},{key:"forEach",value:function(e){var t=this[co];ho(this,t),t.iterationDepth++;try{Mr.forEach(this.handlers,(function(t){null!==t&&e(t)}))}finally{--t.iterationDepth||(ho(this,t),po(this.handlers),t.handlersLength=uo(this.handlers))}}}]),e}(),fo=mo,vo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},go={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ao,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},yo="undefined"!=typeof window&&"undefined"!=typeof document,_o="object"===("undefined"==typeof navigator?"undefined":qe(navigator))&&navigator||void 0,Eo=yo&&(!_o||["ReactNative","NativeScript","NS"].indexOf(_o.product)<0),bo="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ao=yo&&window.location.href||"http://localhost",So=p(p({},e),go);function ko(e){if(e>100)throw new Zr("FormData field is too deeply nested ("+e+" levels). Max depth: 100",Zr.ERR_FORM_DATA_DEPTH_EXCEEDED)}var To=function(e){function t(e,n,r,o){ko(o);var i=e[o++];if("__proto__"===i)return!0;var a=Number.isFinite(+i),s=o>=e.length;return i=!i&&Mr.isArray(r)?r.length:i,s?(Mr.hasOwnProp(r,i)?r[i]=Mr.isArray(r[i])?r[i].concat(n):[r[i],n]:r[i]=n,!a):(Mr.hasOwnProp(r,i)&&Mr.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&Mr.isArray(r[i])&&(r[i]=function(e){var t,n,r={},o=Object.keys(e),i=o.length;for(t=0;t<i;t++)r[n=o[t]]=e[n];return r}(r[i])),!a)}if(Mr.isFormData(e)&&Mr.isFunction(e.entries)){var n={};return Mr.forEachEntry(e,(function(e,r){t(function(e){for(var t,n=[],r=/[^.[\]]+|\[([^.[\]]*)]/g;null!==(t=r.exec(e));)ko(n.length),n.push("[]"===t[0]?"":t[1]||t[0]);return n}(e),r,n,0)})),n}return null},Po=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Io=function(e,t){return null!=e&&Mr.hasOwnProp(e,t)?e[t]:void 0};var Co={transitional:vo,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){var n,r=t.getContentType()||"",o=r.indexOf("application/json")>-1,i=Mr.isObject(e);if(i&&Mr.isHTMLForm(e)&&(e=new FormData(e)),Mr.isFormData(e))return o?JSON.stringify(To(e)):e;if(Mr.isArrayBuffer(e)||Mr.isBuffer(e)||Mr.isStream(e)||Mr.isFile(e)||Mr.isBlob(e)||Mr.isReadableStream(e))return e;if(Mr.isArrayBufferView(e))return e.buffer;if(Mr.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){var a=Io(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return no(e,new So.classes.URLSearchParams,p({visitor:function(e,t,n,r){return So.isNode&&Mr.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,a).toString();if((n=Mr.isFileList(e))||r.indexOf("multipart/form-data")>-1){var s=Io(this,"env"),l=s&&s.FormData;return no(n?{"files[]":e}:e,l&&new l,a)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(Mr.isString(e))try{return(t||JSON.parse)(e),Mr.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=Io(this,"transitional")||Co.transitional,n=t&&t.forcedJSONParsing,r=Io(this,"responseType"),o="json"===r;if(Mr.isResponse(e)||Mr.isReadableStream(e))return e;if(e&&Mr.isString(e)&&(n&&!r||o)){var i=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,Io(this,"parseReviver"))}catch(e){if(i){if("SyntaxError"===e.name)throw Zr.from(e,Zr.ERR_BAD_RESPONSE,this,null,Io(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:So.classes.FormData,Blob:So.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Mr.forEach(Po,(function(e){Co.headers[e]={}}));var wo=Co;function No(e,t){var n=this||wo,r=t||n,o=zr.from(r.headers),i=r.data;return Mr.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function Oo(e){return!(!e||!e.__CANCEL__)}var Ro=function(e){y(n,e);var t=E(n);function n(e,r,o){var i;return v(this,n),(i=t.call(this,null==e?"canceled":e,Zr.ERR_CANCELED,r,o)).name="CanceledError",i.__CANCEL__=!0,i}return m(n)}(Zr),Mo=Ro;function Do(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Zr("Request failed with status code "+n.status,n.status>=400&&n.status<500?Zr.ERR_BAD_REQUEST:Zr.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}var Lo=/[\t\n\r]/g;function xo(e){if("string"!=typeof e)return e;for(var t=0;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(Lo,"")}function Uo(e){var t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}var Ko=function(e,t){e=e||10;var n,r=new Array(e),o=new Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(s){var l=Date.now(),c=o[a];n||(n=l),r[i]=s,o[i]=l;for(var u=a,d=0;u!==i;)d+=r[u++],u%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),!(l-n<t)){var p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}};var Bo=function(e,t){var n,r,o=0,i=1e3/t,a=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();o=i,n=null,r&&(clearTimeout(r),r=null),e.apply(void 0,Xe(t))};return[function(){for(var e=Date.now(),t=e-o,s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];t>=i?a(l,e):(n=l,r||(r=setTimeout((function(){r=null,a(n)}),i-t)))},function(){return n&&a(n)},function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a(t)}]},Yo=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0,o=Ko(50,250);return Bo((function(n){if(n&&Mr.isNumber(n.loaded)){var i=n.loaded,a=n.lengthComputable?n.total:void 0,s=Math.max(0,null!=a?Math.min(i,a):i),c=Math.max(0,s-r),u=o(c);r=Math.max(r,s);var d=l({loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a?(a-s)/u:void 0,event:n,lengthComputable:null!=a},t?"download":"upload",!0);e(d)}}),n)},Fo=function(e,t){var n=null!=e;return[function(r){return t[0]({lengthComputable:n,total:e,loaded:r})},t[1]]},Ho=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mr.asap;return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t((function(){return e.apply(void 0,r)}))}},jo=So.hasStandardBrowserEnv?function(e,t){return function(n){return n=new URL(n,So.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)}}(new URL(So.origin),So.navigator&&/(msie|trident)/i.test(So.navigator.userAgent)):function(){return!0},Vo=So.hasStandardBrowserEnv?{write:function(e,t,n,r,o,i,a){if("undefined"!=typeof document){var s=["".concat(e,"=").concat(encodeURIComponent(t))];Mr.isNumber(n)&&s.push("expires=".concat(new Date(n).toUTCString())),Mr.isString(r)&&s.push("path=".concat(r)),Mr.isString(o)&&s.push("domain=".concat(o)),!0===i&&s.push("secure"),Mr.isString(a)&&s.push("SameSite=".concat(a)),document.cookie=s.join("; ")}},read:function(e){if("undefined"==typeof document)return null;for(var t=document.cookie.split(";"),n=0;n<t.length;n++){var r=t[n].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===e)try{return decodeURIComponent(r.slice(o+1))}catch(e){return r.slice(o+1)}}return null},remove:function(e){this.write(e,"",Date.now()-864e5,"/")}}:{write:function(){},read:function(){return null},remove:function(){}};var Go=/^https?:(?!\/\/)/i;function zo(e){var t,n=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,"$1".concat(Wr,"@")),r=n.indexOf("#"),o=(-1===r?n:n.slice(0,r)).replace(/([?&][^=&#]*=)[^&#]*/g,"$1".concat(Wr));return-1===r?o:"".concat(o,"#").concat((t=n.slice(r+1))?t.replace(/(^|&)([^=&]*=)?[^&]+/g,(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return"".concat(t).concat(n).concat(Wr)})):t)}function Wo(e,t){if("string"==typeof e){var n=xo(e);if(Go.test(n))throw new Zr("Invalid URL ".concat(JSON.stringify(zo(n)),': missing "//" after protocol'),Zr.ERR_INVALID_URL,t)}}function qo(e,t,n,r){Wo(t,r);var o,i=!("string"==typeof(o=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o));return e&&(i||!1===n)?(Wo(e,r),function(e,t){if(!t)return e;for(var n=e.length;n>0&&47===e.charCodeAt(n-1);)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}var Jo=function(e){return e instanceof zr?p({},e):e};function Qo(e,t){e=e||{},t=t||{};var n=Object.create(null);function r(e,t,n,r){return Mr.isPlainObject(e)&&Mr.isPlainObject(t)?Mr.merge.call({caseless:r},e,t):Mr.isPlainObject(t)?Mr.merge({},t):Mr.isArray(t)?t.slice():t}function o(e,t,n,o){return Mr.isUndefined(t)?Mr.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!Mr.isUndefined(t))return r(void 0,t)}function a(e,t){return Mr.isUndefined(t)?Mr.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return Mr.hasOwnProp(t,i)?r(n,o):Mr.hasOwnProp(e,i)?r(void 0,n):void 0}Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});var l,c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutErrorMessage: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,allowedSocketPaths:a,responseEncoding:a,validateStatus:s,headers:function(e,t,n){return o(Jo(e),Jo(t),0,!0)}};return Mr.forEach((l=p(p({},e),t),Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(l).concat(Object.getOwnPropertySymbols(l).filter((function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable}))):Object.keys(l)),(function(r){if("__proto__"!==r&&"constructor"!==r&&"prototype"!==r){var i=Mr.hasOwnProp(c,r)?c[r]:o,a=i(Mr.hasOwnProp(e,r)?e[r]:void 0,Mr.hasOwnProp(t,r)?t[r]:void 0,r);Mr.isUndefined(a)&&i!==s||(n[r]=a)}})),Mr.hasOwnProp(t,"validateStatus")&&Mr.isUndefined(t.validateStatus)&&!1===function(n){var r=Mr.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Mr.isUndefined(r)){if(!Mr.isPlainObject(r))return;if(Mr.hasOwnProp(r,n))return r[n]}var o=Mr.hasOwnProp(e,"transitional")?e.transitional:void 0;if(Mr.isPlainObject(o)&&Mr.hasOwnProp(o,n))return o[n]}("validateStatusUndefinedResolves")&&(Mr.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}var Zo=["content-type","content-length"];var Xo=function(e){var t=Qo({},e),n=function(e){return Mr.hasOwnProp(t,e)?t[e]:void 0},r=n("data"),o=n("withXSRFToken"),i=n("xsrfHeaderName"),a=n("xsrfCookieName"),s=n("headers"),l=n("auth"),c=n("baseURL"),u=n("allowAbsoluteUrls"),d=n("url");if(t.headers=s=zr.from(s),t.url=lo(qo(c,d,u,t),n("params"),n("paramsSerializer")),l){var p=Mr.getSafeProp(l,"username")||"",h=Mr.getSafeProp(l,"password")||"";try{s.set("Authorization","Basic "+btoa(p+":"+(h?encodeURIComponent(h).replace(/%([0-9A-F]{2})/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))})):"")))}catch(t){throw Zr.from(t,Zr.ERR_BAD_OPTION_VALUE,e)}}if(Mr.isFormData(r)){var m=Mr.getSafeProp(r,"getHeaders");So.hasStandardBrowserEnv||So.hasStandardBrowserWebWorkerEnv||Mr.isReactNative(r)?s.setContentType(void 0):Mr.isFunction(m)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach((function(t){var n=et(t,2),r=n[0],o=n[1];Zo.includes(r.toLowerCase())&&e.set(r,o)})):e.set(t)}(s,m.call(r),n("formDataHeaderPolicy"))}if(So.hasStandardBrowserEnv&&(Mr.isFunction(o)&&(o=o(t)),!0===o||null==o&&jo(t.url))){var f=i&&a&&Vo.read(a);f&&s.set(i,f)}return t},$o="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){var r,o,i,a,s,l,c=Xo(e),u=c.data,d=zr.from(c.headers).normalize(),p=c.responseType,h=c.onUploadProgress,m=c.onDownloadProgress;function f(){a&&a(),s&&s(),c.cancelToken&&c.cancelToken.unsubscribe(r),c.signal&&c.signal.removeEventListener("abort",r)}var v=new XMLHttpRequest;function g(r){if(v){if(!(0!==v.status||"file"===(Uo(xo(c.url))||Uo(So.origin))||v.responseURL&&v.responseURL.startsWith("file:")))return n(new Zr("Request aborted",Zr.ECONNABORTED,e,v)),f(),void(v=null);try{r?l&&l(r):s&&s()}catch(e){setTimeout((function(){throw e}))}if(v){var o=zr.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders());Do((function(e){t(e),f()}),(function(e){n(e),f()}),{data:p&&"text"!==p&&"json"!==p?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:o,config:e,request:v}),v=null}}}if(v.open(c.method.toUpperCase(),c.url,!0),v.timeout=c.timeout,"onloadend"in v?v.onloadend=g:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&v.responseURL.startsWith("file:"))&&setTimeout(g)},v.onabort=function(){v&&(n(new Zr("Request aborted",Zr.ECONNABORTED,e,v)),f(),v=null)},v.onerror=function(t){var r=t&&t.message?t.message:"Network Error",o=new Zr(r,Zr.ERR_NETWORK,e,v);o.event=t||null,n(o),f(),v=null},v.ontimeout=function(){var t=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",r=c.transitional||vo;c.timeoutErrorMessage&&(t=c.timeoutErrorMessage),n(new Zr(t,r.clarifyTimeoutError?Zr.ETIMEDOUT:Zr.ECONNABORTED,e,v)),f(),v=null},void 0===u&&d.setContentType(null),"setRequestHeader"in v&&Mr.forEach(Kr(d),(function(e,t){v.setRequestHeader(t,e)})),Mr.isUndefined(c.withCredentials)||(v.withCredentials=!!c.withCredentials),p&&"json"!==p&&(v.responseType=c.responseType),m){var y=Yo(m,!0),_=et(y,3);i=_[0],s=_[1],l=_[2],v.addEventListener("progress",i)}if(h&&v.upload){var E=Yo(h),b=et(E,2);o=b[0],a=b[1],v.upload.addEventListener("progress",o),v.upload.addEventListener("loadend",a)}(c.cancelToken||c.signal)&&(r=function(t){v&&(n(!t||t.type?new Mo(null,e,v):t),v.abort(),f(),v=null)},c.cancelToken&&c.cancelToken.subscribe(r),c.signal&&(c.signal.aborted?r():c.signal.addEventListener("abort",r)));var A=Uo(c.url);if(A&&!So.protocols.includes(A))return n(new Zr("Unsupported protocol "+A+":",Zr.ERR_BAD_REQUEST,e)),void f();v.send(u||null)}))},ei=function(e,t){if(e=e?e.filter(Boolean):[],t||e.length){var n=new AbortController,r=!1,o=function(e){if(!r){r=!0,a();var t=e instanceof Error?e:this.reason;n.abort(t instanceof Zr?t:new Mo(t instanceof Error?t.message:t))}},i=t&&setTimeout((function(){i=null,o(new Zr("timeout of ".concat(t,"ms exceeded"),Zr.ETIMEDOUT))}),t),a=function(){e&&(i&&clearTimeout(i),i=null,e.forEach((function(e){e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((function(e){r||(e.aborted?o.call(e):e.addEventListener("abort",o,{once:!0}))}));var s=n.signal;return s.unsubscribe=function(){return Mr.asap(a)},s}},ti=n(8101),ni=n(6621),ri=n(4774),oi=n(9164),ii=o().mark((function e(t,n){var r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.byteLength,n&&!(r<n)){e.next=5;break}return e.next=4,t;case 4:return e.abrupt("return");case 5:i=0;case 6:if(!(i<r)){e.next=13;break}return a=i+n,e.next=10,t.slice(i,a);case 10:i=a,e.next=6;break;case 13:case"end":return e.stop()}}),e)})),ai=function(){var e=ti(o().mark((function e(t,n){var r,i,a,s,l,c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=!1,i=!1,e.prev=2,s=oi(si(t));case 4:return e.next=6,ni(s.next());case 6:if(!(r=!(l=e.sent).done)){e.next=12;break}return c=l.value,e.delegateYield(ri(oi(ii(c,n)),ni),"t0",9);case 9:r=!1,e.next=4;break;case 12:e.next=18;break;case 14:e.prev=14,e.t1=e.catch(2),i=!0,a=e.t1;case 18:if(e.prev=18,e.prev=19,!r||null==s.return){e.next=23;break}return e.next=23,ni(s.return());case 23:if(e.prev=23,!i){e.next=26;break}throw a;case 26:return e.finish(23);case 27:return e.finish(18);case 28:case"end":return e.stop()}}),e,null,[[2,14,18,28],[19,,23,27]])})));return function(t,n){return e.apply(this,arguments)}}(),si=function(){var e=ti(o().mark((function e(t){var n,r,i,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t[Symbol.asyncIterator]){e.next=3;break}return e.delegateYield(ri(oi(t),ni),"t0",2);case 2:return e.abrupt("return");case 3:n=t.getReader(),e.prev=4;case 5:return e.next=7,ni(n.read());case 7:if(r=e.sent,i=r.done,a=r.value,!i){e.next=12;break}return e.abrupt("break",16);case 12:return e.next=14,a;case 14:e.next=5;break;case 16:return e.prev=16,e.next=19,ni(n.cancel());case 19:return e.finish(16);case 20:case"end":return e.stop()}}),e,null,[[4,,16,20]])})));return function(t){return e.apply(this,arguments)}}(),li=function(e,t,n,r){var i,s=ai(e,t),l=0,c=function(e){i||(i=!0,r&&r(e))};return new ReadableStream({pull:function(e){return a(o().mark((function t(){var r,i,a,u,d;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,s.next();case 3:if(r=t.sent,i=r.done,a=r.value,!i){t.next=10;break}return c(),e.close(),t.abrupt("return");case 10:u=a.byteLength,n&&(d=l+=u,n(d)),e.enqueue(new Uint8Array(a)),t.next=19;break;case 15:throw t.prev=15,t.t0=t.catch(0),c(t.t0),t.t0;case 19:case"end":return t.stop()}}),t,null,[[0,15]])})))()},cancel:function(e){return c(e),s.return()}},{highWaterMark:2})},ci=function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102},ui=function(e,t,n){return t+2<n&&ci(e.charCodeAt(t+1))&&ci(e.charCodeAt(t+2))},di=function(e){return e<=57?e-48:(223&e)-55},pi=function(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e},hi=function(e){var t=e.length,n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)},mi=function(e){for(var t,n=e.length,r=0,o=0,i=!1,a=0;a<n;a++){var s=e.charCodeAt(a);37===s&&ui(e,a,n)&&(s=16*di(e.charCodeAt(a+1))+di(e.charCodeAt(a+2)),a+=2),9!==(t=s)&&10!==t&&12!==t&&13!==t&&32!==t&&(61!==s?!pi(s)||o>0?i=!0:r++:o++)}return i||o>2||o>0&&(r+o)%4!=0||r%4==1?hi(e):function(e){var t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)}(r)},fi=function(e,t){if(!e||"string"!=typeof e)return 0;if(!e.startsWith("data:"))return 0;var n=e.indexOf(",");if(n<0)return 0;var r=e.slice(5,n),o=e.slice(n+1);if(/;base64/i.test(r))return t(o);for(var i=0,a=0,s=o.length;a<s;a++){var l=o.charCodeAt(a);if(37===l&&ui(o,a,s))i+=1,a+=2;else if(l<128)i+=1;else if(l<2048)i+=2;else if(l>=55296&&l<=56319&&a+1<s){var c=o.charCodeAt(a+1);c>=56320&&c<=57343?(i+=4,a++):i+=3}else i+=3}return i};function vi(e){var t="string"==typeof e?e.indexOf("#"):-1;return fi(-1===t?e:e.slice(0,t),mi)}var gi="1.20.0",yi={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},_i=Mr.isFunction,Ei=function(e){if(!Mr.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},bi=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!!e.apply(void 0,n)}catch(e){return!1}},Ai=function(e){var t=e.indexOf("://"),n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},Si=function(e){var t=void 0!==Mr.global&&null!==Mr.global?Mr.global:globalThis,n=t.ReadableStream,r=t.TextEncoder,i=e=Mr.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e),s=i.fetch,l=i.Request,c=i.Response,u=s?_i(s):"function"==typeof fetch,d=_i(l),p=_i(c);if(!u)return!1;var h,m=u&&_i(n),f=u&&("function"==typeof r?(h=new r,function(e){return h.encode(e)}):function(){var e=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Uint8Array,e.next=3,new l(t).arrayBuffer();case 3:return e.t1=e.sent,e.abrupt("return",new e.t0(e.t1));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),v=d&&m&&bi((function(){var e=!1,t=new l(So.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&t.body.cancel(),e&&!r})),g=p&&m&&bi((function(){return Mr.isReadableStream(new c("").body)})),y={stream:g&&function(e){return e.body}};u&&["text","arrayBuffer","blob","formData","stream"].forEach((function(e){!y[e]&&(y[e]=function(t,n){var r=t&&t[e];if(r)return r.call(t);throw new Zr("Response type '".concat(e,"' is not supported"),Zr.ERR_NOT_SUPPORT,n)})}));var _=function(){var e=a(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t){e.next=2;break}return e.abrupt("return",0);case 2:if(!Mr.isBlob(t)){e.next=4;break}return e.abrupt("return",t.size);case 4:if(!Mr.isSpecCompliantForm(t)){e.next=9;break}return n=new l(So.origin,{method:"POST",body:t}),e.next=8,n.arrayBuffer();case 8:case 15:return e.abrupt("return",e.sent.byteLength);case 9:if(!Mr.isArrayBufferView(t)&&!Mr.isArrayBuffer(t)){e.next=11;break}return e.abrupt("return",t.byteLength);case 11:if(Mr.isURLSearchParams(t)&&(t+=""),!Mr.isString(t)){e.next=16;break}return e.next=15,f(t);case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),E=function(){var e=a(o().mark((function e(t,n){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Mr.toFiniteNumber(t.getContentLength()),e.abrupt("return",null==r?_(n):r);case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return function(){var e=a(o().mark((function e(t){var n,i,a,u,p,h,f,b,A,S,k,T,P,I,C,w,N,O,R,M,D,L,x,U,K,B,Y,F,H,j,V,G,z,W,q,J,Q,Z,X,$,ee,te,ne,re,oe,ie,ae,se,le,ce,ue,de,pe,he,me,fe,ve,ge,ye,_e,Ee,be;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=Xo(t),i=n.url,a=n.method,u=n.data,p=n.signal,h=n.cancelToken,f=n.timeout,b=n.onDownloadProgress,A=n.onUploadProgress,S=n.responseType,k=n.headers,T=n.withCredentials,P=void 0===T?"same-origin":T,I=n.fetchOptions,C=n.maxContentLength,w=n.maxBodyLength,N=n.maxRedirects,O=Mr.isNumber(C)&&C>-1,R=Mr.isNumber(w)&&w>-1,M=function(e){return Mr.hasOwnProp(t,e)?t[e]:void 0},D=s||fetch,S=S?(S+"").toLowerCase():"text",L=ei([p,h&&h.toAbortSignal()],f),x=null,U=L&&L.unsubscribe&&function(){L.unsubscribe()},B=null,Y=function(){return new Zr("Request body larger than maxBodyLength limit",Zr.ERR_BAD_REQUEST,t,x)},e.prev=11,F=void 0,(H=M("auth"))&&(j=Mr.getSafeProp(H,"username")||"",V=Mr.getSafeProp(H,"password")||"",F={username:j,password:V}),Ai(i)&&(G=new URL(i,So.origin),F||!G.username&&!G.password||(z=Ei(G.username),W=Ei(G.password),F={username:z,password:W}),(G.username||G.password)&&(G.username="",G.password="",i=G.href)),F&&(k.delete("authorization"),k.set("Authorization","Basic "+btoa((o=(F.username||"")+":"+(F.password||""),encodeURIComponent(o).replace(/%([0-9A-F]{2})/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))})))))),!O||"string"!=typeof i||!i.startsWith("data:")){e.next=21;break}if(!(vi(i)>C)){e.next=21;break}throw new Zr("maxContentLength size of "+C+" exceeded",Zr.ERR_BAD_RESPONSE,t,x);case 21:if(!R||"get"===a||"head"===a){e.next=29;break}return e.next=24,_(u);case 24:if("number"!=typeof(q=e.sent)||!isFinite(q)){e.next=29;break}if(K=q,!(q>w)){e.next=29;break}throw Y();case 29:if(J=R&&(Mr.isReadableStream(u)||Mr.isStream(u)),Q=function(e,t,n){return li(e,65536,(function(e){if(R&&e>w)throw B=Y();t&&t(e)}),n)},!v||"get"===a||"head"===a||!A&&!J){e.next=43;break}if(null!=K){e.next=38;break}return e.next=35,E(k,u);case 35:e.t0=e.sent,e.next=39;break;case 38:e.t0=K;case 39:(0!==(K=e.t0)||J)&&(Z=new l(i,{method:"POST",body:u,duplex:"half"}),Mr.isFormData(u)&&(X=Z.headers.get("content-type"))&&k.setContentType(X),Z.body&&($=A&&Fo(K,Yo(Ho(A)))||[],ee=et($,2),te=ee[0],ne=ee[1],u=Q(Z.body,te,ne))),e.next=49;break;case 43:if(!J||d||!m||"get"===a||"head"===a){e.next=47;break}u=Q(u),e.next=49;break;case 47:if(!J||!d||v||"get"===a||"head"===a){e.next=49;break}throw new Zr("Stream request bodies are not supported by the current fetch implementation",Zr.ERR_NOT_SUPPORT,t,x);case 49:return Mr.isString(P)||(P=P?"include":"omit"),re=d&&"credentials"in l.prototype,Mr.isFormData(u)&&(oe=k.getContentType())&&/^multipart\/form-data/i.test(oe)&&!/boundary=/i.test(oe)&&k.delete("content-type"),k.set("User-Agent","axios/"+gi,!1),(ie=null==I?I:Object.assign(Object.create(null),I))&&(delete ie.body,delete ie.headers,delete ie.method,delete ie.signal,delete ie.duplex,delete ie.credentials),ae=Object.assign(Object.create(null),ie,{signal:L,method:a.toUpperCase(),headers:Kr(k.normalize()),body:u,duplex:"half",credentials:re?P:void 0}),d&&(Mr.forEach(yi,(function(e,t){void 0===ae[t]&&(ae[t]=e)})),void 0===ae.signal&&(ae.signal=null),void 0===ae.body&&(ae.body=null)),0===N&&(ae.redirect="manual",ie&&(ie.redirect="manual")),x=d&&new l(i,ae),e.next=61,d?D(x,ie):D(i,ae);case 61:if(se=e.sent,le=zr.from(se.headers),!O){e.next=67;break}if(!(null!=(ce=Mr.toFiniteNumber(le.getContentLength()))&&ce>C)){e.next=67;break}throw new Zr("maxContentLength size of "+C+" exceeded",Zr.ERR_BAD_RESPONSE,t,x);case 67:return ue=g&&("stream"===S||"response"===S),g&&se.body&&(b||O||ue&&U)&&(de={},["status","statusText","headers"].forEach((function(e){de[e]=se[e]})),pe=Mr.toFiniteNumber(le.getContentLength()),he=b&&Fo(pe,Yo(Ho(b),!0))||[],me=et(he,2),fe=me[0],ve=me[1],0,ge=function(e){if(O&&e>C)throw new Zr("maxContentLength size of "+C+" exceeded",Zr.ERR_BAD_RESPONSE,t,x);fe&&fe(e)},se=new c(li(se.body,65536,ge,(function(){ve&&ve(),U&&U()})),de)),S=S||"text",e.next=72,y[Mr.findKey(y,S)||"text"](se,t);case 72:if(ye=e.sent,!O||g||ue){e.next=77;break}if(null!=ye&&("number"==typeof ye.byteLength?_e=ye.byteLength:"number"==typeof ye.size?_e=ye.size:"string"==typeof ye&&(_e="function"==typeof r?(new r).encode(ye).byteLength:ye.length)),!("number"==typeof _e&&_e>C)){e.next=77;break}throw new Zr("maxContentLength size of "+C+" exceeded",Zr.ERR_BAD_RESPONSE,t,x);case 77:return!ue&&U&&U(),e.next=80,new Promise((function(e,n){Do(e,n,{data:ye,headers:zr.from(se.headers),status:se.status,statusText:se.statusText,config:t,request:x})}));case 80:return e.abrupt("return",e.sent);case 83:if(e.prev=83,e.t1=e.catch(11),U&&U(),!(L&&L.aborted&&L.reason instanceof Zr)){e.next=92;break}throw(Ee=L.reason).config=t,x&&(Ee.request=x),e.t1!==Ee&&Object.defineProperty(Ee,"cause",{__proto__:null,value:e.t1,writable:!0,enumerable:!1,configurable:!0}),Ee;case 92:if(!B){e.next=95;break}throw x&&!B.request&&(B.request=x),B;case 95:if(!(e.t1 instanceof Zr)){e.next=98;break}throw x&&!e.t1.request&&(e.t1.request=x),e.t1;case 98:if(!e.t1||"TypeError"!==e.t1.name||!/Load failed|fetch/i.test(e.t1.message)){e.next=102;break}throw be=new Zr("Network Error",Zr.ERR_NETWORK,t,x,e.t1&&e.t1.response),Object.defineProperty(be,"cause",{__proto__:null,value:e.t1.cause||e.t1,writable:!0,enumerable:!1,configurable:!0}),be;case 102:throw Zr.from(e.t1,e.t1&&e.t1.code,t,x,e.t1&&e.t1.response);case 103:case"end":return e.stop()}var o}),e,null,[[11,83]])})));return function(t){return e.apply(this,arguments)}}()},ki=new Map,Ti=function(e){for(var t,n,r=e&&e.env||{},o=r.fetch,i=[r.Request,r.Response,o],a=i.length,s=ki;a--;)t=i[a],void 0===(n=s.get(t))&&s.set(t,n=a?new Map:Si(r)),s=n;return n},Pi=(Ti(),{http:null,xhr:$o,fetch:{get:Ti}});Mr.forEach(Pi,(function(e,t){if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}}));var Ii=function(e){return"- ".concat(e)},Ci=function(e){return Mr.isFunction(e)||null===e||!1===e};var wi={getAdapter:function(e,t){for(var n,r,o=(e=Mr.isArray(e)?e:[e]).length,i={},a=0;a<o;a++){var s=void 0;if(r=n=e[a],!Ci(n)&&void 0===(r=Pi[(s=String(n)).toLowerCase()]))throw new Zr("Unknown adapter '".concat(s,"'"));if(r&&(Mr.isFunction(r)||(r=r.get(t))))break;i[s||"#"+a]=r}if(!r){var l=Object.entries(i).map((function(e){var t=et(e,2),n=t[0],r=t[1];return"adapter ".concat(n," ")+(!1===r?"is not supported by the environment":"is not available in the build")})),c=o?l.length>1?"since :\n"+l.map(Ii).join("\n"):" "+Ii(l[0]):"as no adapter specified";throw new Zr("There is no suitable adapter to dispatch the request "+c,Zr.ERR_NOT_SUPPORT)}return r},adapters:Pi};function Ni(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Mo(null,e)}function Oi(e){var t=Mr.toSafeFlatObject(e);return Ni(t),t.headers=zr.from(Mr.getSafeProp(t,"headers")),t.data=No.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),wi.getAdapter(t.adapter||wo.adapter,t)(t).then((function(e){Ni(t),t.response=e;try{e.data=No.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=zr.from(e.headers),e}),(function(e){if(!Oo(e)&&(Ni(t),e&&e.response)){t.response=e.response;try{e.response.data=No.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=zr.from(e.response.headers)}return Promise.reject(e)}))}var Ri={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){Ri[e]=function(n){return qe(n)===e||"a"+(t<1?"n ":" ")+e}}));var Mi={};Ri.transitional=function(e,t,n){function r(e,t){return"[Axios v"+gi+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,o,i){if(!1===e)throw new Zr(r(o," has been removed"+(t?" in "+t:"")),Zr.ERR_DEPRECATED);return t&&!Mi[o]&&(Mi[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},Ri.spelling=function(e){return function(t,n){return console.warn("".concat(n," is likely a misspelling of ").concat(e)),!0}};var Di={assertOptions:function(e,t,n){if("object"!==qe(e)||null===e)throw new Zr("options must be an object",Zr.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),o=r.length;o-- >0;){var i=r[o],a=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(a){var s=e[i],l=void 0===s||a(s,i,e);if(!0!==l)throw new Zr("option "+i+" must be "+l,Zr.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new Zr("Unknown option "+i,Zr.ERR_BAD_OPTION)}},validators:Ri},Li=Di.validators,xi=function(){function e(t){v(this,e),this.defaults=t||{},this.interceptors={request:new fo,response:new fo}}var t;return m(e,[{key:"request",value:(t=a(o().mark((function e(t,n){var r,i,a,s,l,c,u;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this._request(t,n);case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),e.t0 instanceof Error)try{r={},Error.captureStackTrace?Error.captureStackTrace(r):r=new Error,i=r.stack,a="","string"==typeof i&&(s=i.indexOf("\n"),a=-1===s?"":i.slice(s+1)),e.t0.stack?a&&(l=a.indexOf("\n"),c=-1===l?-1:a.indexOf("\n",l+1),u=-1===c?"":a.slice(c+1),String(e.t0.stack).endsWith(u)||(e.t0.stack+="\n"+a)):e.t0.stack=a}catch(e){}throw e.t0;case 10:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(e,n){return t.apply(this,arguments)})},{key:"_request",value:function(e,t){var n=this;"string"==typeof e?(t=t||{}).url=e:t=e||{};var r=t=Qo(this.defaults,t),o=r.transitional,i=r.paramsSerializer,a=r.headers;void 0!==o&&Di.assertOptions(o,{silentJSONParsing:Li.transitional(Li.boolean),forcedJSONParsing:Li.transitional(Li.boolean),clarifyTimeoutError:Li.transitional(Li.boolean),legacyInterceptorReqResOrdering:Li.transitional(Li.boolean),advertiseZstdAcceptEncoding:Li.transitional(Li.boolean),validateStatusUndefinedResolves:Li.transitional(Li.boolean)},!1),null!=i&&(Mr.isFunction(i)?t.paramsSerializer={serialize:i}:Di.assertOptions(i,{encode:Li.function,serialize:Li.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Di.assertOptions(t,{baseUrl:Li.spelling("baseURL"),withXsrfToken:Li.spelling("withXSRFToken")},!0),t.method=(Mr.getSafeProp(t,"method")||Mr.getSafeProp(this.defaults,"method")||"get").toLowerCase();var s=a&&Mr.merge(a.common,a[t.method]);a&&Mr.forEach(Po.concat("common"),(function(e){delete a[e]})),t.headers=zr.concat(s,a);var l=[],c=!0;this.interceptors.request.forEach((function(e){if("function"!=typeof e.runWhen||!1!==e.runWhen(t)){c=c&&e.synchronous;var n=t.transitional||vo;n&&n.legacyInterceptorReqResOrdering?l.unshift(e.fulfilled,e.rejected):l.push(e.fulfilled,e.rejected)}}));var u,d=[];this.interceptors.response.forEach((function(e){d.push(e.fulfilled,e.rejected)}));var p,h=0;if(!c){var m=[Oi.bind(this),void 0];for(m.unshift.apply(m,l),m.push.apply(m,d),p=m.length,u=Promise.resolve(t);h<p;)u=u.then(m[h++],m[h++]);return u}p=l.length;for(var f=t;h<p;){var v=l[h++],g=l[h++];try{f=v?v(f):f}catch(e){if(!g){u=Promise.reject(e);break}try{var y=g.call(this,e);Mr.isThenable(y)&&(u=Promise.resolve(y).then((function(){return Oi.call(n,f)})))}catch(e){u=Promise.reject(e)}break}}if(!u)try{u=Oi.call(this,f)}catch(e){u=Promise.reject(e)}for(h=0,p=d.length;h<p;)u=u.then(d[h++],d[h++]);return u}},{key:"getUri",value:function(e){return lo(qo((e=Qo(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}]),e}();Mr.forEach(["delete","get","head","options"],(function(e){xi.prototype[e]=function(t,n){return this.request(Qo(n||{},{method:e,url:t,data:n&&Mr.hasOwnProp(n,"data")?n.data:void 0}))}})),Mr.forEach(["post","put","patch","query"],(function(e){function t(t){return function(n,r,o){return this.request(Qo(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}xi.prototype[e]=t(),"query"!==e&&(xi.prototype[e+"Form"]=t(!0))}));var Ui=xi,Ki=function(){function e(t){if(v(this,e),"function"!=typeof t)throw new TypeError("executor must be a function.");var n;this.promise=new Promise((function(e){n=e}));var r=this;this.promise.then((function(e){if(r._listeners){for(var t=r._listeners.length;t-- >0;)r._listeners[t](e);r._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},t((function(e,t,o){r.reason||(r.reason=new Mo(e,t,o),n(r.reason))}))}return m(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}},{key:"toAbortSignal",value:function(){var e=this,t=new AbortController,n=function(e){t.abort(e)};return this.subscribe(n),t.signal.unsubscribe=function(){return e.unsubscribe(n)},t.signal}}],[{key:"source",value:function(){var t,n=new e((function(e){t=e}));return{token:n,cancel:t}}}]),e}(),Bi=Ki;var Yi={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,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent: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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Yi).forEach((function(e){var t=et(e,2),n=t[0],r=t[1];void 0===Yi[r]&&(Yi[r]=n)}));var Fi=Yi;var Hi=function e(t){var n=new Ui(t),r=On(Ui.prototype.request,n);return Mr.extend(r,Ui.prototype,n,{allOwnKeys:!0}),Mr.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Qo(t,n))},r}(wo);Hi.Axios=Ui,Hi.CanceledError=Mo,Hi.CancelToken=Bi,Hi.isCancel=Oo,Hi.VERSION=gi,Hi.toFormData=no,Hi.AxiosError=Zr,Hi.Cancel=Hi.CanceledError,Hi.all=function(e){return Promise.all(e)},Hi.spread=function(e){return function(t){return e.apply(null,t)}},Hi.isAxiosError=function(e){return Mr.isObject(e)&&!0===e.isAxiosError},Hi.mergeConfig=Qo,Hi.AxiosHeaders=zr,Hi.formToJSON=function(e){return To(Mr.isHTMLForm(e)?new FormData(e):e)},Hi.getAdapter=wi.getAdapter,Hi.HttpStatusCode=Fi,Hi.default=Hi;var ji=Hi,Vi=Et(),Gi=Vi._light_sandbox,zi=Vi.groupId,Wi=Vi.requestHost,qi={local:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",dev:Wi||"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",sit:Wi||"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",pre:"https://imgs-sea-pre.alipay.com/mgw.htm",prod:"https://imgs-sea-global.alipay.com/mgw.htm",sandbox:"https://imgs-sea-global.alipay.com/mgw.htm"},Ji="ALIPW3SG",Qi="ANTOM_PAYMENT_WEB",Zi=zi||"GROUP_20240627151021",Xi=function(e,t){return"prod"===t||"sandbox"===t||"light_sandbox"===t?{SG:"https://imgs-sea-global.alipay.com/mgw.htm",US:"https://imgs-na-global.alipay.com/mgw.htm",DE:"https://imgs-de-global.alipay.com/mgw.htm",QK:"https://imgs-qk.alipay.com/mgw.htm",ID:"https://imgs-id.alipay.com/mgw.htm",SA:"https://imgs-sa.alipay.com/mgw.htm"}[e||"SG"]:"pre"===t?{SG:"https://imgs-sea-pre.alipay.com/mgw.htm",US:"https://imgs-pre.alipay.com/mgw.htm",DE:"https://imgs-de-pre.alipay.com/mgw.htm",QK:"https://iopengw-qkgz99p.alipay.com/mgw.htm",ID:"https://imgs-id-pre.alipay.com/mgw.htm",SA:"https://imgs-sa-pre.alipay.com/mgw.htm"}[e||"SG"]:""},$i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n={pre:"https://imgs-sea-pre.alipay.com/mgw.htm",sit:Wi||"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",dev:Wi||"http://imgs-13.sggz00b.stable.alipay.net/mgw.htm"},r={"com.ipay.iexpcashier.sdkAction.query":"com.ipay.iopensandbox.sdk.paymentSession.query"},o="SDK_MOCK_SANDBOX",i=zi||"GROUP_20230315210531";return r[e]&&"light_sandbox"===t||"true"===Gi?{appId:o,sofaId:i,baseURL:n[t],"Operation-Type":r[e]}:{appId:"",sofaId:"",baseURL:"","Operation-Type":""}},ea=".".charCodeAt(0),ta=/\\(\\)?/g,na=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g"),ra=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,oa=/^\w*$/;function ia(e){if("string"==typeof e)return e;var t="".concat(e);return"0"===t&&1/e==-Infinity?"-0":t}function aa(e,t){return Array.isArray(e)?e:function(e,t){if(Array.isArray(e))return!1;var n=Je()(e);return"number"===n||"boolean"===n||null===e||oa.test(e)||!ra.test(e)||null!==t&&e in Object(t)}(e,t)?[e]:(r=[],(n=e).charCodeAt(0)===ea&&r.push(""),n.replace(na,(function(e,t,n,o){var i=e;return n?i=o.replace(ta,"$1"):t&&(i=t.trim()),r.push(i),""})),r);var n,r}function sa(e,t,n){var r=null===e?void 0:function(e,t){for(var n=aa(t,e),r=0,o=n.length,i=e;null!==i&&r<o;)i=i[ia(n[r++])];return r&&r===o?i:void 0}(e,t);return void 0===r?n:r}var la=function(e,t){var n=sa(e,"Result-Status")||sa(e,"result-status","");if(!n)return null;if(2e3==+n)return{success:!1,traceId:t,errorCode:oe.LOGIN,errorMessage:"not login",resultStatus:n};if(4001==+n)return{success:!1,traceId:t,errorCode:oe.TIMEOUT,errorMessage:"timeout",resultStatus:n};if(1e3!=+n){var r=sa(e,"Tips")||sa(e,"tips",""),o=sa(e,"Memo")||sa(e,"memo","");return{success:!1,traceId:t,errorCode:oe.GATEWAY,errorMessage:decodeURIComponent(r||""),result:{resultStatus:n||"",tips:decodeURIComponent(r||""),memo:decodeURIComponent(o||"")},resultStatus:n}}return null},ca=Et()._sandbox;function ua(e){var t,n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=e.env||"prod",a=$i(e["Operation-Type"],i),s=e.baseURL||a.baseURL||Xi(null==e?void 0:e.hostSign,i)||qi[i],l=h()(c()(c()(c()(c()(c()(c()(c()({appId:a.appId||Qi,workspaceId:"pre"===e.env?"pre":"default"},"x-cors-".concat(Qi.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",a.sofaId||Zi),"Operation-Type",a["Operation-Type"]||e["Operation-Type"]||""),"Client-Time",o),"tntInstId",Ji),"sdk-version",T||""),e.headers);return"true"!==ca&&"sandbox"!==i||(l["load-test"]=!0,l.sofaPenAttrs="instMock=O&loadMode=2"),"dev"!==i&&delete l["sofa-group-name"],ji.create({baseURL:s,timeout:null!==(t=e.timeout)&&void 0!==t?t:15e3,headers:l,withCredentials:null===(n=e.withCredentials)||void 0===n||n,method:(null==e?void 0:e.method)||"POST"}).request}function da(e,t,n){return pa.apply(this,arguments)}function pa(){return pa=s()(i()().mark((function e(t,n,r){var o,a,s,l,c,u,d,p,m,f,v,g,y,_,E,b,A,S;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=h()(h()({terminalType:gt?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==n?void 0:n.envInfo),{},{locale:(null==n||null===(o=n.envInfo)||void 0===o?void 0:o.locale)||"en_US"});try{a.browserInfo.browserJavaEnabled=(null===(s=navigator)||void 0===s?void 0:s.javaEnabled())||!1}catch(e){}return"WAP"===a.terminalType&&(a.osType=ft?"IOS":"ANDROID"),l=[h()(h()({},t),{},{envInfo:a,extParams:h()(h()({},null==t?void 0:t.extParams),{},{refUrl:window.location.href})})],c=Date.now(),e.prev=5,u=ua(n),e.next=9,u({data:l});case 9:if(d=e.sent,p=d.data,m=d.headers,f=p||{},v=sa(m,"Mgw-TraceId")||sa(m,"mgw-traceid",""),f.traceId=v||"",null==(g=la(m,v))||!g.errorCode){e.next=21;break}throw y=(null==f?void 0:f.errorMessage)||(null==g?void 0:g.errorMessage),_=null==g?void 0:g.errorCode,r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!1,code:_,msg:y,traceId:v}).send(),new Error(JSON.stringify({errorMessage:y,errorCode:_,success:!1}));case 21:return r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!0,code:"SUCCESS",msg:"",traceId:v}).send(),e.abrupt("return",f);case 25:return e.prev=25,e.t0=e.catch(5),b=yt(null===e.t0||void 0===e.t0?void 0:e.t0.message,{success:!1,errorCode:oe.SYSTEM,errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message}),A=null!==e.t0&&void 0!==e.t0&&null!==(E=e.t0.message)&&void 0!==E&&E.includes("timeout")?oe.TIMEOUT:"",S=(null==b?void 0:b.errorCode)||A,r.reportRPC({name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-c,success:!1,code:S,msg:JSON.stringify((null==b?void 0:b.message)||e.t0)}).send(),e.abrupt("return",Promise.reject({success:!1,errorCode:S,errorMessage:null==b?void 0:b.message}));case 32:case"end":return e.stop()}}),e,null,[[5,25]])}))),pa.apply(this,arguments)}function ha(e,t,n){return ma.apply(this,arguments)}function ma(){return ma=s()(i()().mark((function e(t,n,r){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=((null==t?void 0:t.paymentSessionData)||"").split("&&")[1]||"",e.abrupt("return",da(t,h()(h()({},n),{},{hostSign:o,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"}),r));case 2:case"end":return e.stop()}}),e)}))),ma.apply(this,arguments)}function fa(){return fa=s()(i()().mark((function e(t,n){var r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(S[t.env]);case 3:return r=e.sent,e.next=6,r.json();case 6:return o=e.sent,n.logInfo({title:"sdk_event_importantEvent",msg:"Successfully obtained marmot emergency configuration"}),e.abrupt("return",o);case 11:return e.prev=11,e.t0=e.catch(0),n.logError({title:"event_important_error",msg:"Abnormal acquisition of marmot emergency configuration"}),e.abrupt("return","{}");case 15:case"end":return e.stop()}}),e,null,[[0,11]])}))),fa.apply(this,arguments)}function va(e,t,n){return ga.apply(this,arguments)}function ga(){return ga=s()(i()().mark((function e(t,n,r){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=((null==t?void 0:t.paymentSessionData)||"").split("&&")[1]||"",e.abrupt("return",da(t,h()(h()({},n),{},{hostSign:o,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.cashier.submitPayByPaymentSession"}),r));case 2:case"end":return e.stop()}}),e)}))),ga.apply(this,arguments)}function ya(e,t,n,r){return _a.apply(this,arguments)}function _a(){return _a=s()(i()().mark((function e(t,n,r,o){var a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(t||"").split("&&")[1]||"",console.log("getApplePayPaymentSession hostSign",a),e.abrupt("return",da(n,h()(h()({},r),{},{hostSign:a,"Operation-Type":"com.ipay.iexpcashier.cashier.createApplePayPaymentSession"}),o));case 3:case"end":return e.stop()}}),e)}))),_a.apply(this,arguments)}var Ea=function(e){return e.sdk_event_appleAvailable="sdk_event_appleAvailable",e.sdk_event_appleCreateComponent="sdk_event_appleCreateComponent",e.sdk_event_appleShowPaymentSheet="sdk_event_appleShowPaymentSheet",e.sdk_event_appleOnvalidatemerchant="sdk_event_appleOnvalidatemerchant",e.sdk_event_appleSubmitToken="sdk_event_appleSubmitToken",e.sdk_event_applePaymentResult="sdk_event_applePaymentResult",e.sdk_event_appleDestroyComponent="sdk_event_appleDestroyComponent",e}({}),ba=function(){function e(t,n){g()(this,e),c()(this,"_applePayService",void 0),c()(this,"_parseData",void 0),c()(this,"_sessionData",void 0),c()(this,"_isFinish",!1),c()(this,"_options",void 0),c()(this,"logger",void 0),c()(this,"isRecurring",!1),this.logger=n,this._options=Object.assign({environment:X.prod},t,{product:V.CARD_APPLE_PAY}),this._applePayService=new Nn(n)}return f()(e,[{key:"canMakePayments",value:function(e){return Nn.canMakePayments(e)}},{key:"isAppPayEnabled",value:function(e){return this.canMakePayments(e)}},{key:"onEventCallback",value:function(e){var t,n,r;this.logger.logInfo({name:"APPLE_PAY",title:Ea.sdk_event_applePaymentResult},{eventSource:"sdk",processResult:ae.SDK_PAYMENT_SUCCESSFUL===(null==e?void 0:e.code),code:null==e?void 0:e.code,extSdkError:null==e||null===(t=e.result)||void 0===t?void 0:t.errorCode,errorMessage:null==e||null===(n=e.result)||void 0===n?void 0:n.errorMessage,eventMessage:JSON.stringify({type:"funnel",recurring:this.isRecurring})}).send(),null===(r=this._options)||void 0===r||r.onEventCallback(e)}},{key:"submitPay",value:function(e){var t,n,r,o=this;if(this._isFinish=!1,this._parseData=null==e||null===(t=e.iframeNodesParams)||void 0===t?void 0:t.paymentSessionMetaData,this._sessionData=null==e||null===(n=e.iframeNodesParams)||void 0===n?void 0:n.sessionData,!this._parseData||!this._sessionData)return this.onEventCallback({code:ae.SDK_PAYMENT_FAIL,message:"Abnormal params paymentSessionData"}),void this.logger.logError({name:"APPLE_PAY",title:"sessionDataNull",msg:"Abnormal paymentSessionData"},{type:"error",eventSource:"sdk"}).send();this.isRecurring=null!==(null===(r=this._parseData)||void 0===r||null===(r=r.paymentSessionFactor)||void 0===r?void 0:r.recurringInfo);var a=function(){var e=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,We.publishForResult(new Ve(Pn.getSecurityDeviceId,JSON.stringify({deviceIdParameter:{productScene:null===(n=o._parseData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene}})),{fallback:""});case 2:if(e.t1=t=e.sent,e.t0=null===e.t1,e.t0){e.next=6;break}e.t0=void 0===t;case 6:if(!e.t0){e.next=10;break}e.t2=void 0,e.next=11;break;case 10:e.t2=t.getJSONObject();case 11:return e.abrupt("return",e.t2);case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=function(){var e=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.validationUrl,r={validateUrl:n,paymentSessionData:o._sessionData},e.t0=ya,e.t1=o._sessionData,e.t2=r,e.t3=o._options.environment,e.next=8,a();case 8:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6={env:e.t3,envInfo:e.t5},e.t7=o.logger,e.abrupt("return",(0,e.t0)(e.t1,e.t2,e.t6,e.t7).then((function(e){return null!=e&&e.success&&e.merchantSessionObject?Promise.resolve(e.merchantSessionObject):Promise.reject({errorCode:e.errorCode,errorMessage:e.errorMessage})})).catch((function(e){return Promise.reject(e)})));case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),c=function(){var e=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.paymentToken,r={paymentFactors:{instPaymentToken:n},paymentSessionData:o._sessionData},e.t0=va,e.t1=r,e.t2=o._options.environment,e.next=7,a();case 7:return e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,envInfo:e.t4},e.t6=o.logger,e.abrupt("return",(0,e.t0)(e.t1,e.t5,e.t6).then((function(e){return o.logger.logInfo({name:"APPLE_PAY",title:"submitPayStatus",msg:null==e?void 0:e.errorStatus},{eventSource:"sdk"}).send(),null!=e&&e.success||"U"===(null==e?void 0:e.errorStatus)?Promise.resolve(e):Promise.reject({errorCode:e.errorCode,errorMessage:e.errorMessage})})).catch((function(e){return Promise.reject(e)})));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),u=function(e,t,n){o.logger.logError({name:"APPLE_PAY",title:t,label:t,code:e,msg:n},{type:"error",eventSource:"sdk"}).send(),o._isFinish||(o._isFinish=!0,null!=n&&n.errorCode?o.onEventCallback({code:e,message:t,result:{errorCode:null==n?void 0:n.errorCode,errorMessage:null==n?void 0:n.errorMessage}}):o.onEventCallback({code:e,message:t}))};this._applePayService.setApplePayParams(l,c,(function(e){var t;o._isFinish=!0,o.onEventCallback({code:ae.SDK_PAYMENT_SUCCESSFUL,message:"Payment successful",result:{redirectUrl:(null==e||null===(t=e.actionForm)||void 0===t?void 0:t.redirectUrl)||""}})}),u);try{this._applePayService.startPay(this._parseData)}catch(e){u(ae.SDK_PAYMENT_ERROR,"appple runtime excepiton",e)}}}]),e}(),Aa=ba,Sa=function(e){_()(n,e);var t=b()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Ze()(r),"applePay",void 0),c()(Ze()(r),"logger",void 0),r.logger=e,r}return f()(n,[{key:"actionNames",value:function(){return Object.values(Sn).concat(Object.values(An))}},{key:"onOptionalInit",value:function(e,t){console.log("onOptionalInit",t.getData())}},{key:"onCanMakePayments",value:function(e,t){var n;console.log("onCanMakePayments",t.getData());var r=null===(n=t.getJSONObject())||void 0===n?void 0:n.subPaymentMethod,o=Nn.canMakePayments(r);null==e||e.onCallBack(t.result(o)),this.logger.logInfo({name:"APPLE_PAY",title:Ea.sdk_event_appleAvailable},{eventSource:"sdk",processResult:o,eventMessage:JSON.stringify({type:"funnel",recurring:"ApplePayRecurringPayment"===r})}).send()}},{key:"onCreateComponent",value:function(e,t){var n=t.getJSONObject();console.log("onCreateComponent",t),this.applePay=new Aa(h()(h()({},null==n?void 0:n.options),{},{onEventCallback:function(e){console.log("onCreateComponent#onEventCallback",e),e&&We.publish(new Ve(Tn.onEventCallback,JSON.stringify(e)))}}),this.logger);var r=null==n?void 0:n.appendParams;this.applePay.submitPay(r)}},{key:"onDestroyComponent",value:function(e,t){this.applePay=null,console.log("onDestroyComponent",e,t),this.logger.logInfo({name:"APPLE_PAY",title:Ea.sdk_event_appleDestroyComponent},{eventSource:"sdk",eventMessage:JSON.stringify({type:"funnel"})}).send()}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case An.optional_init:this.onOptionalInit(e,t);break;case Sn.canMakePayments:this.onCanMakePayments(e,t);break;case Sn.createComponent:this.onCreateComponent(e,t);break;case Sn.destroyComponent:this.onDestroyComponent(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(ze),ka=[{matchRule:"AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z]+) Safari\\/([0-9\\._]+)$",iosScheme:"https",andScheme:""},{matchRule:"HeyTapBrowser",iosScheme:"",andScheme:""},{matchRule:"HuaweiBrowser",iosScheme:"",andScheme:""},{matchRule:"Kwai",iosScheme:"kwai",andScheme:""},{matchRule:"MQQBrowser",iosScheme:"mttbrowser",andScheme:""},{matchRule:"MicroMessenger",iosScheme:"",andScheme:""},{matchRule:"MiuiBrowser",iosScheme:"",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* CriOS\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z\\._a-z]+) Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"NewsArticle",iosScheme:"snssdk141",andScheme:""},{matchRule:"UCBrowser",iosScheme:"ucbrowser",andScheme:""},{matchRule:"VideoArticle",iosScheme:"snssdk32",andScheme:""},{matchRule:"VivoBrowser",iosScheme:"",andScheme:""},{matchRule:"ZhongAnWebView",iosScheme:"zaapp",andScheme:""},{matchRule:"aweme",iosScheme:"snssdk1128",andScheme:""},{matchRule:"aweme_lite",iosScheme:"snssdk2329",andScheme:""},{matchRule:"com.xs.fm",iosScheme:"novelfm3040",andScheme:""},{matchRule:"netdisk",iosScheme:"",andScheme:""},{matchRule:"qqnews",iosScheme:"qqnews",andScheme:""}];function Ta(e,t){for(var n,r=e||window.navigator.userAgent||"",o=ka,i=0;i<o.length;i++){var a=o[i];if(r.match(a.matchRule)){n=a;break}}if(n)return function(e){var t=(e||navigator.userAgent).toLowerCase();return/android|adr|linux/.test(t)}(r)?(Pa(t,r,n.andScheme),n.andScheme):function(e){var t=(e||navigator.userAgent).toLowerCase();return/iphone|ipad|ipod|ios|macintosh/.test(t)}(r)?(Pa(t,r,n.iosScheme),n.iosScheme):void 0;Pa(t,r,"")}function Pa(e,t,n){e&&e.logInfo({title:"a3753.b101271.c377460"},{eventMessage:n})}var Ia=function(){return window.location.href.indexOf("LOCAL_MOCK=1")>-1};var Ca=function(e){var t,n,r,o,i;switch(e){case V.ELEMENT_PAYMENT:i=null===(t=window)||void 0===t||null===(t=t._ANTOM_SDK_PROXY_TIME)||void 0===t?void 0:t.AMSElement;break;case V.EASY_PAY:i=null===(n=window)||void 0===n||null===(n=n._ANTOM_SDK_PROXY_TIME)||void 0===n?void 0:n.AMSEasyPay;break;default:i={startTime:0,endTime:0}}return(null===(r=i)||void 0===r?void 0:r.endTime)-(null===(o=i)||void 0===o?void 0:o.startTime)||0},wa=f()((function e(){g()(this,e)}));c()(wa,"complianceExtParams",{requestSeq:"C",firstLogTime:"C",sessionData:"C",isPreload:"C",disableAccelerate:"C",deviceId:"C",url:"C",errorName:"C",isPrerender:"C",loadWebAppType:"C",rpcTraceId:"C",timezone:"C",userPath:"C",previousEventName:"C",containerCacheFileCount:"C",containerTotalFileCount:"C",containerMissedFiles:"C",containerOfflinePkgId:"C",containerTotalPkgCount:"C",webAppUrl:"C",webSDKUrl:"C",edcDeviceRequest:"C",config:"C",initOptions:"C",edcDeviceId:"C",instanceId:"C",trackId:"C",errorMessage:"C",timestamp:"C",eventMessage:"C",checkoutUrl:"C",redirectInfo:"C",riskSdkInfo:"C",actionName:"C",requestId:"C",callbackData:"C",callbackId:"C",actionNames:"C",isValid:"C",needChangeSessionForRetry:"C",constructorName:"C",result:"C",operationType:"D",jsApi:"D",extSdkError:"D",processResult:"D",iterationVersion:"D",OperationType:"D",edcVendor:"D",platform:"D",sdkVersion:"D",eventSource:"D",productScene:"D",paymentMethodCategoryType:"D",productSceneVersion:"D",merchantId:"D",eventName:"D",paymentMethodType:"D",containerVersion:"D",locale:"D",renderDisplayType:"D",webAppVersion:"D",eventCode:"D",containerType:"D",logVersion:"D",httpCode:"D",openType:"D",isCrashTack:"D",isCrashTrackOverride:"D",appUpgradeVersion:"D",fromFastSdk:"D",terminalType:"D",eventAlias:"D",success:"D",startTime:"D",endTime:"D",theme:"D",variables:"D",timeCost:"M",pageLoadProgress:"M",fsDuration:"M",loadDuration:"M",msg:"C"});var Na={spmId:"a3753.b101271.c388193.d513345",alias:"sdk_event_onAbnormalEventName"},Oa={spmId:"a3753.b101271.c388193.d513391",alias:"sdk_event_onAbnormalKeys"},Ra=function(){function e(){g()(this,e)}return f()(e,null,[{key:"extractComplianceParams",value:function(e,t,n){var r=this;try{Da.track((function(){r.flushAbnormalInfo(n)})),!!e&&e.includes(".")||this.reportHasAbnormalEventName(e);for(var o={},i=0,a=Object.keys(t);i<a.length;i++){var s=a[i];s in wa.complianceExtParams?o[s]="".concat(t[s]):this.reportHasIllegalExtendInfoKey(e,s)}return o}catch(e){return console.error(e),{}}}},{key:"reportHasAbnormalEventName",value:function(e){this.abnormalEventNameSet.add(e)}},{key:"reportHasIllegalExtendInfoKey",value:function(e,t){this.nonComplianceEventKeys[e]||(this.nonComplianceEventKeys[e]=new Set),this.nonComplianceEventKeys[e].add(t)}},{key:"flushAbnormalInfo",value:function(e){try{var t;if((null===(t=this.abnormalEventNameSet)||void 0===t?void 0:t.size)>0){var n=Array.from(this.abnormalEventNameSet).join("|");e&&e({title:Na.spmId},{eventAlias:Na.alias,errorMessage:n}),this.abnormalEventNameSet.clear()}var r=[];if(0===Object.keys(this.nonComplianceEventKeys).length)return;for(var o in this.nonComplianceEventKeys){var i=this.nonComplianceEventKeys[o],a="".concat(o,">").concat(Array.from(i).join("+"));r.push(a)}var s=r.join("|");e&&e({title:Oa.spmId},{eventAlias:Oa.alias,errorMessage:s}),this.nonComplianceEventKeys={}}catch(e){console.error(e)}}}]),e}();c()(Ra,"abnormalEventNameSet",new Set),c()(Ra,"nonComplianceEventKeys",{});var Ma=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5e3;g()(this,e),c()(this,"timeoutId",void 0),c()(this,"debounceTime",void 0),this.timeoutId=null,this.debounceTime=t}return f()(e,[{key:"track",value:function(e){this.debounce(e)}},{key:"debounce",value:function(e){var t=this;this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=setTimeout((function(){t.report(e),t.reset()}),this.debounceTime)}},{key:"report",value:function(e){e&&e()}},{key:"reset",value:function(){this.timeoutId=null}}]),e}(),Da=new Ma,La={sdk_event_mount_element:"a3753.b101271.c388193.d513193",sdk_element_create:"a3753.b101271.c386688",sdk_element_mount_fail:"a3753.b101271.c386691",sdk_element_mount_start:"a3753.b101271.c386690",multiple_instance_error:"a3753.b101271.c403950",auto_apple_pay_start:"a3753.b107385.c398110",auto_apple_pay_failed:"a3753.b107385.c398111",auto_apple_pay_success:"a3753.b107385.c398112",sdk_element_handleHeartBeat:"a3753.b101271.c388217.d624449",sdk_element_handleInterAction:"a3753.b101271.c388217.d630402",sdk_element_callback_error:"a3753.b101271.c388217.d630403",sdk_element_missKeyData:"a3753.b101271.c388217.d630404",sdk_event_mount:"a3753.b101271.c388217.d640404",sdk_event_mount_end:"a3753.b101271.c388217.d640405",sdk_event_submitPay:"a3753.b101271.c388193.d512422",sdk_event_payment_end:"a3753.b101271.c388217.d640409",sdk_event_validateFields:"a3753.b101271.c388217.d640406",sdk_event_validateFields_end:"a3753.b101271.c388217.d640407",sdk_event_apiOnDestroy:"a3753.b101271.c388193.d512442",sdk_event_apiOnDestroy_end:"a3753.b101271.c388217.d640408"},xa=h()({sdk_error_runtime_error:"a3753.b101271.c388188.d512342",sdk_event_sdkQuery_failed:"a3753.b101271.c388188.d512343",container_error_error_insert_js:"a3753.b101271.c388188.d512344",event_important_error:"a3753.b101271.c388188.d512345",sdk_error_parameter:"a3753.b101271.c388188.d512346",sdk_event_submitPay_failed:"a3753.b101271.c388188.d512347",sdk_event_destroyComponent:"a3753.b101271.c388189.d512349",container_error_page_load_failed:"a3753.b101271.c388189.d512350",sdk_event_eventCallback:"a3753.b101271.c388189.d512353",iap_net_error:"a3753.b101271.c388189.d512352",sdk_event_event_callback:"a3753.b101271.c388189.d512353",sdk_event_renderComponent:"a3753.b101271.c388189.d512354",sdk_event_call_url_success:"a3753.b101271.c388189.d512355",sdk_event_web_app_timeout:"a3753.b101271.c388189.d512356",container_error_jsapi_call:"a3753.b101271.c388189.d512357",sdk_event_appUpgradeInfo:"a3753.b101271.c388189.d512358",sdk_event_webAppOnLaunch:"a3753.b101271.c388189.d512359",sdk_event_createComponent:"a3753.b101271.c388189.d512360",container_error_insert_js:"a3753.b101271.c388189.d512361",container_error_error_jsapi_call:"a3753.b101271.c388189.d512362",sdk_error_receive_message_from_web:"a3753.b101271.c388189.d512363",sdk_error_securitySdkGetCodeFailed:"a3753.b101271.c388189.d512369",sdk_error_securitySdkGetTokenFailed:"a3753.b101271.c388189.d513035",sdk_error_securitySdkInitFailed:"a3753.b101271.c388193.d513045",sdk_error_caught_exception_in_callback:"a3753.b101271.c388189.d513207",sdk_error_call_url_failed:"a3753.b101271.c388189.d513050",sdk_event_webAppTimeout:"a3753.b101271.c388189.d512356",sdk_error_getGaidFailed:"a3753.b101271.c388193.d513038",sdk_error_securitySdkInitTokenFailed:"a3753.b101271.c388193.d513044",container_error_error_invalid_param:"a3753.b101271.c388193.d513220",container_error_error_set_ua_failed:"a3753.b101271.c388193.d513221",sdk_event_onAddressResult:"a3753.b101271.c388193.d513194",sdk_event_onAbnormalEventName:"a3753.b101271.c388193.d513345",event_important_log:"a3753.b101271.c388193.d512370",sdk_event_sdkQueryEnd:"a3753.b101271.c388193.d512371",container_event_manifest_load_start:"a3753.b101271.c388193.d512372",sdk_event_api_preheat:"a3753.b101271.c388193.d512373",container_event_manifest_load_complete:"a3753.b101271.c388193.d512374",sdk_event_apiSubmit:"a3753.b101271.c388193.d512375",sdk_event_securitySdkGetCodeSuccess:"a3753.b101271.c388193.d512376",sdk_event_securitySdkInitSuccess:"a3753.b101271.c388193.d512377",container_event_start_load:"a3753.b101271.c388193.d512378",sdk_event_getRemoteConfigStart:"a3753.b101271.c388193.d512379",container_event_webViewOnPageFinished:"a3753.b101271.c388193.d512419",container_event_page_load_success:"a3753.b101271.c388193.d512420",sdk_event_pre_init:"a3753.b101271.c388193.d512421",sdk_event_submitPay:"a3753.b101271.c388193.d512422",sdk_event_submitPayEnd:"a3753.b101271.c388193.d512423",container_stop_event_loop:"a3753.b101271.c388193.d512424",iap_net_start:"a3753.b101271.c388193.d512425",sdk_event_securitySdkPreInitSuccess:"a3753.b101271.c388193.d512426",sdk_event_securitySdkPreInit:"a3753.b101271.c388193.d512427",sdk_event_important_event:"a3753.b101271.c388193.d512428",sdk_event_accelerateInfo:"a3753.b101271.c388193.d512429",container_event_manifest_res_complete:"a3753.b101271.c388193.d512430",container_event_manifest_res_start:"a3753.b101271.c388193.d512431",sdk_event_dismissWindowCloseCancel:"a3753.b101271.c388193.d512432",sdk_event_jsBridgeCall_httpRequestStart:"a3753.b101271.c388193.d512433",sdk_event_getGaidSuccess:"a3753.b101271.c388193.d512434",sdk_event_securitySdkInit:"a3753.b101271.c388193.d512435",sdk_event_getRemoteLanguageResult:"a3753.b101271.c388193.d513176",sdk_event_getRemoteLanguageStart:"a3753.b101271.c388193.d513175",sdk_event_handleSDKPaymentResult:"a3753.b101271.c388193.d512436",sdk_event_handleSDKPaymentFail:"a3753.b101271.c388193.d513172",sdk_event_sdkQuery:"a3753.b101271.c388193.d512437",sdk_event_handleSDKPaymentStart:"a3753.b101271.c388193.d512438",sdk_event_securitySdkGetTokenSuccess:"a3753.b101271.c388193.d512439",sdk_event_api_onDestroy:"a3753.b101271.c388193.d512440",container_load_failed:"a3753.b101271.c388193.d512441",sdk_event_kycAppPreLoadStart:"a3753.b101271.c388193.d513154",sdk_event_apiOnDestroy:"a3753.b101271.c388193.d512442",sdk_event_getRemoteConfigResult:"a3753.b101271.c388193.d512443",iap_net_result:"a3753.b101271.c388193.d512444",sdk_event_popupWindowCloseButtonClick:"a3753.b101271.c388193.d512445",container_error_resourceLoadFailed:"a3753.b101271.c388193.d512446",container_event_startPreRenderUrl:"a3753.b101271.c388193.d512447",sdk_event_webAppPreLoadStart:"a3753.b101271.c388193.d512448",sdk_event_importantEvent:"a3753.b101271.c388193.d512449",container_error_registerJSAPIPlugin:"a3753.b101271.c388193.d512531",sdk_event_afterEventCallback:"a3753.b101271.c388217.d513210",sdk_event_createPayment:"a3753.b101271.c388217.d513074",sdk_event_sendMessageToWeb:"a3753.b101271.c388217.d512452",sdk_error_appHeartBeatTimeout:"a3753.b101271.c388217.d512453",container_event_jSEngineEvaluateJavascript:"a3753.b101271.c388217.d512454",container_event_jSEngineLoadJavascript:"a3753.b101271.c388217.d512455",sdk_event_receive_message_from_web:"a3753.b101271.c388217.d512456",sdk_event_receiveMessageFromWeb:"a3753.b101271.c388217.d512457",sdk_event_monitorFlushReport:"a3753.b101271.c388217.d512458",container_event_page_pv:"a3753.b101271.c388217.d512459",container_event_override_url_loading:"a3753.b101271.c388217.d513223",sdk_event_dismissWindowCloseConfirm:"a3753.b101271.c388217.d512460",container_load_success:"a3753.b101271.c388217.d512461",container_event_page_start:"a3753.b101271.c388217.d512462",sdk_event_webAppStartLoad:"a3753.b101271.c388217.d512463",container_event_startPreLoadUrl:"a3753.b101271.c388217.d512464",container_event_jsSEngineStart:"a3753.b101271.c388217.d512465",container_event_jSEngineDestroy:"a3753.b101271.c388193.d512546",sdk_event_send_message_to_web:"a3753.b101271.c388217.d512466",container_event_importantEvent:"a3753.b101271.c388217.d512467",sdk_event_monitorCrashTrackInit:"a3753.b101271.c388217.d512468",container_event_stop_event_loop:"a3753.b101271.c388217.d512469",sdk_event_requestAccelerateInfo:"a3753.b101271.c388217.d513147",native_rpc_performance:"a3753.b101271.c388217.d513218",container_event_jSEngineEvaluateJavascriptCallback:"a3753.b101271.c388217.d512585",container_event_jSEngineRegisterJsapi:"a3753.b101271.c388217.d512586",jSEngineEvaluateJavascriptConvertError:"a3753.b101271.c388217.d512592",sdk_event_security_unneeded_scenarios:"a3753.b101271.c388217.d512595",container_event_launch:"a3753.b101271.c388217.d513256",event_jsapi_call_start:"a3753.b101271.c388217.d514734",event_jsapi_call_end:"a3753.b101271.c388217.d514735",sdk_event_call_url_start:"a3753.b101271.c388189.d515011",sdk_event_onAbnormalKeys:"a3753.b101271.c388193.d513391",sdk_event_espBeforePay:"a3753.b101271.c388193.d514078",sdk_event_busPublishMessage:"a3753.b101271.c388217.d515030",sdk_event_busIsSubscribe:"a3753.b101271.c388217.d515031",sdk_event_busSubscribe:"a3753.b101271.c388217.d515032",NEW_AMSSDK_BY_MECHANT:"a3753.b101271.c388193.d512449",sdk_event_busClear:"a3753.b101271.c388193.d518374",sdk_event_busAddInterceptor:"a3753.b101271.c388193.d518374",sdk_error_securitySdkInitTimeout:"a3753.b101271.c388193.d513045",sdk_error_busPublishNoResult:"a3753.b101271.c388193.d518374",sdk_event_busPublishCallback:"a3753.b101271.c388193.d518374",sdk_error_busPublishError:"a3753.b101271.c388189.d518375",sdk_error_busPublishUnsubscribeError:"a3753.b101271.c388189.d518375",sdk_event_busUnsubscribe:"a3753.b101271.c388193.d518374",onBusPublishException:"a3753.b101271.c388189.d518375",sdk_event_apiGetValue:"a3753.b101271.c388193.d512449",load_channel_sdk_start:"a3753.b101271.c388193.d512449",preload_match:"a3753.b101271.c388193.d512449",preload_no_match:"a3753.b101271.c388188.d512345",canMakePayments_error:"a3753.b101271.c388188.d512345",performance_optimization_clearPreloadIframe:"a3753.b101271.c388193.d512449",performance_optimization_clearPreloadIframe_timeout:"a3753.b101271.c388188.d512345",sdk_event_call_url_failed:"a3753.b101271.c388189.d513050",sdk_event_applePaymentResult:"a3753.b101271.c388193.d518376",submitPayStatus:"a3753.b101271.c388193.d518376",sdk_event_appleAvailable:"a3753.b101271.c388193.d518376",sdk_event_appleCreateComponent:"a3753.b101271.c388193.d518376",sdk_event_appleShowPaymentSheet:"a3753.b101271.c388193.d518376",sdk_event_appleSubmitToken:"a3753.b101271.c388193.d518376",sdk_event_appleDestroyComponent:"a3753.b101271.c388193.d518376",paypal_payment_failed:"a3753.b101271.c388189.d518378",paypal_payment_approved:"a3753.b101271.c388193.d518383",paypal_payment_cancelled:"a3753.b101271.c388193.d518383",sdk_event_clean_component:"a3753.b101271.c388193.d518383",load_item_sdk_start:"a3753.b101271.c388193.d512449",load_item_sdk_end:"a3753.b101271.c388193.d512449",performance_optimization_get_previousChannel_error:"a3753.b101271.c388188.d512345",performance_optimization_channelType_error:"a3753.b101271.c388188.d512345",sdk_error_before_submit:"a3753.b101271.c388188.d512345",sessionDataNull:"a3753.b101271.c388189.d518377","appple runtime excepiton":"a3753.b101271.c388189.d518377",sdk_error_created_app_process_failed:"a3753.b101271.c388188.d512345",sdk_error_web_app_timeout:"a3753.b101271.c388188.d512345",performance_optimization_preload:"a3753.b101271.c388193.d512449",performance_optimization_preload_path_error:"a3753.b101271.c388188.d512345",sdk_error_created_app_failed:"a3753.b101271.c388188.d512345",sdk_error_create_pop_up:"a3753.b101271.c388188.d512345",button_render_failed:"a3753.b101271.c388189.d518378",paypal_payment_loadSDK_failed:"a3753.b101271.c388189.d518378",load_item_sdk_error:"a3753.b101271.c388188.d512345",load_item_sdk_timeout:"a3753.b101271.c388188.d512345",MerchantValidationError:"a3753.b101271.c388189.d518377",PaymentAuthorizedError:"a3753.b101271.c388189.d518377","ApplePaySession is only support in Safari":"a3753.b101271.c388189.d518377","Abnormal params paymentSessionFactor":"a3753.b101271.c388189.d518377","Abnormal params recurringInfo":"a3753.b101271.c388189.d518377","Payment processing but user dismissed the sheet":"a3753.b101271.c388189.d518377","User dismissed the sheet":"a3753.b101271.c388189.d518377",sdk_before_confirm_start:"a3753.b204577.c480929",sdk_before_confirm_success:"a3753.b204577.c480930",sdk_before_confirm_abort:"a3753.b204577.c480931",sdk_before_confirm_error:"a3753.b204577.c480932",sdk_before_confirm_timeout:"a3753.b204577.c480933",sdk_before_confirm_skip:"a3753.b204577.c480934"},La),Ua=function(){function e(t,n){g()(this,e),c()(this,"logs",void 0),c()(this,"config",void 0),c()(this,"debug",void 0),c()(this,"componentStartTime",void 0),c()(this,"isLoaded",void 0),c()(this,"trackId",void 0),this.logs=[],this.config=t,this.debug=n,this.componentStartTime=0,this.isLoaded=!1}return f()(e,[{key:"setMedta",value:function(e){var t,n,r=this;(this.config.mdata=Object.assign(this.config.mdata,e),null!==(t=window)&&void 0!==t&&t.iTracker)?(null===(n=window)||void 0===n||null===(n=n.iTracker)||void 0===n||n.set({mdata:this.config.mdata}),setTimeout((function(){r.reportLogs()}),80)):this.initTracker()}},{key:"logError",value:function(e,t){var n=this,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=r?Ra.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})):null!=t?t:{},i=Date.now(),a=i-this.componentStartTime,s=h()({},e),l=null==e?void 0:e.title;return xa[l]&&(s.title=xa[l]),o.eventSource="sdk",o.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:l,this.logs.push({type:"error",logPayload:s,extra:h()(h()({},o),{},{fsDuration:a,timeStamp:i})}),this.debug&&console.log("[web-sdk] Log error",s,o),this.send(),this}},{key:"logInfo",value:function(e,t){var n=this,r=Ra.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})),o=Date.now(),i=o-this.componentStartTime,a=h()({},e),s=null==e?void 0:e.title;return xa[s]&&(a.title=xa[s]),r.eventSource="sdk",r.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:s,this.logs.push({type:"info",logPayload:a,extra:h()(h()({},r),{},{fsDuration:i,timeStamp:o})}),this.debug&&console.log("[web-sdk] Log info",a,r),this.send(),this}},{key:"reportRPC",value:function(e,t){var n=this,r=Ra.extractComplianceParams(e.title,null!=t?t:{},(function(e,t){n.logError(e,t,!1)})),o=Date.now(),i=o-this.componentStartTime,a=h()({},e),s=null==e?void 0:e.title;return xa[s]&&(a.title=xa[s]),r.eventSource="sdk",r.eventAlias=null!=t&&t.eventAlias?null==t?void 0:t.eventAlias:s,this.logs.push({type:"rpc",logPayload:a,extra:h()(h()({},r),{},{fsDuration:i,timeStamp:o})}),this.debug&&console.log("[web-sdk] Log rpc",a,r),this.send(),this}},{key:"reportLogs",value:function(){var e;if(null!==(e=window)&&void 0!==e&&e.iTracker)for(var t=window.iTracker,n=t.logError,r=t.logInfo,o=t.reportRPC,i=this.logs;i.length>0;)try{var a,s=i.pop();if("error"===s.type)n(s.logPayload,h()({trackId:this.trackId,title:null===(a=s.logPayload)||void 0===a?void 0:a.title},null==s?void 0:s.extra));else if("info"===s.type){var l;r(s.logPayload,h()({trackId:this.trackId,title:null===(l=s.logPayload)||void 0===l?void 0:l.title},null==s?void 0:s.extra))}else if("rpc"===s.type){var c;o(s.logPayload,h()({trackId:this.trackId,title:null===(c=s.logPayload)||void 0===c?void 0:c.title},null==s?void 0:s.extra))}}catch(e){console.error("Error occurred while calling iTracker method:",e)}}},{key:"loadScript",value:function(e,t){var n=this;if("function"==typeof window.define&&window.define.amd&&"function"==typeof window.require){var r="antom_iTracker";try{var o,i;return null!==(o=(i=window.require).specified)&&void 0!==o&&o.call(i,r)||window.require.config({paths:c()({},r,e.replace(/\.js$/,""))}),void window.require([r],t,(function(r){console.error("AMD load failed, falling back to script tag",r),n.fallbackLoadScript(e,t)}))}catch(e){console.warn("require not available, using script tag",e)}}this.fallbackLoadScript(e,t)}},{key:"fallbackLoadScript",value:function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t,n.onerror=function(){console.error("unable to load Antom script: ".concat(e))},document.body?document.body.appendChild(n):document.head&&document.head.appendChild(n)}},{key:"initTracker",value:function(){var e=this;if(!this.isLoaded){this.isLoaded=!0;try{"undefined"!=typeof localStorage&&this.loadScript(this.config.scriptUrl,(function(){var t;null===(t=window)||void 0===t||t.iTracker.initiTracker(e.config),setTimeout((function(){e.reportLogs()}),80)}))}catch(e){console.error("Failed to initialize iTracker:",e)}}}},{key:"send",value:function(){var e;null!==(e=window)&&void 0!==e&&e.iTracker?this.reportLogs():this.initTracker()}},{key:"setComponentStartTime",value:function(e){this.componentStartTime=e}},{key:"setTrackId",value:function(e){this.trackId=e}},{key:"getComponentStartTime",value:function(){return this.componentStartTime}}],[{key:"setInstance",value:function(e){return this.instance=e}},{key:"getInstance",value:function(){return this.instance}}]),e}();c()(Ua,"instance",void 0);var Ka={scriptUrl:"https://gw-intl.alipayobjects.com/render/p/yuyan_npm/@alipay_intl-tracker/1.6.0/dist/common.min.js",spmConfig:{},batchCount:1,appId:"antom_sdk",server:"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do",bizType:"antom_sdk",productId:"ANTOM_SDK",version:"iteration/20231021",mdata:{firstLogTime:Date.now(),sdkVersion:"0.0.1787898127-dev.21"}},Ba=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{var o,i=tn(e,{sdkVersion:T,productScene:t,mid:n});if(r)null===(o=Ua.getInstance())||void 0===o||o.logInfo({title:"sdk_event_appUpgradeInfo"},{appUpgradeVersion:i,processResult:!!i,isPreload:!e,config:e,productScene:t,merchantId:n});return i?(e&&rn(T+t,i),i):i=nn(T+t)}catch(e){return""}},Ya=function(e,t){var n,r=(n={},c()(c()(c()(c()(c()(c()(c()(c()(c()(c()(n,j.NONE,[""]),j.AUTO_DEBIT_WALLET,["1.0"]),j.AUTO_DEBIT_PAY_WALLET,[""]),j.CASHIER_PAYMENT_BANK,["1.0"]),j.CASHIER_PAYMENT_CARD,["1.0"]),j.CASHIER_PAYMENT_APM,["1.0"]),j.EASY_PAY_WALLET,["1.0","2.0"]),j.EASY_PAY_APM,["2.0"]),j.VAULTING_CARD,["1.0"]),j.ELEMENT_PAYMENT,["1.0"]),c()(c()(c()(n,j.ELEMENT_ADDRESS,["1.0"]),j.CHECKOUT_PAYMENT,["1.0.0"]),j.AUTO_DEBIT_APM,["1.0"]))[e]||[],o=r.find((function(e){return e===t})),i=r[r.length-1];return o?t:i},Fa=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"prod",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,l=arguments.length>7&&void 0!==arguments[7]&&arguments[7],c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:"",u=Et()||{},d=u.host,p=Ba(a,o,s,l),h=p||n;p&&(null===(e=Ua.getInstance())||void 0===e||e.setMedta({webAppVersion:h}));wt()&&(console.log("appUpgrade#getAppPath#finalAppVersion",h),console.log("appUpgrade#getAppPath#extendInfo",a,s));var m=Ya(r,i);if(c)return c;if(d&&!["sandbox","light_sandbox","prod"].includes(t))return d;if(r===j.ELEMENT_ADDRESS)return"".concat(k[t],"/element-address/pages/address/index.html");if($e()(Object.values(H)).includes(r)){var f=!1;try{f=JSON.parse(JSON.parse(a).expressCheckout)}catch(e){}return f?"".concat(k[t],"/elements/pages/express_checkout/index.html"):"".concat(k[t],"/elements/pages/").concat(o.toLowerCase(),"/index.html")}return"".concat(A[t],"/").concat(r,"/").concat(m,"/index.html")},Ha=function(e){var t=e.componentSign,n=e.analytics,r=void 0===n?{enabled:!0}:n,o=e.productScene,i=e.productSceneVersion,a=e.environment,s=e.appVersion,l=e.extendInfo,c=e.locale,u=e.instanceId,d=e.renderDisplayType,p=e.isPreload,h=void 0===p?"":p,m=e.hostSign,f=void 0===m?"":m,v=e.mid,g=void 0===v?"":v,y=e.elementLink,_=Fa(a,s,t,o,i,l||"",g,!0,void 0===y?"":y),E=tn(l,{sdkVersion:T,productScene:o,mid:g})?"true":"false",b=Et(),A=b._sandbox,S=b._light_sandbox,k=b.requestHost,P=void 0===k?"":k,I=b.groupId,C=void 0===I?"":I,w=b.LOCAL_MOCK,N=b._displayType,O=Object.assign({},{displayType:d,locale:c,instanceId:u,appMatched:E,analyticsEnabled:!1===(null==r?void 0:r.enabled)?"false":"true",sdkVersion:T,refUrl:window.location.href,_componentStartTime:"".concat(Date.now()),_proxyCostTime:"".concat(Ca(o)),isPreload:h||"",hostSign:f||""});w&&(O.LOCAL_MOCK=w),P&&(O.requestHost=P),C&&(O.groupId=C),"light_sandbox"!==a&&"true"!==S||(O.sandbox="true"),"sandbox"!==a&&"true"!==A||(O.shadow="true"),N&&(O.displayType=N);var R=lt(O);return wt()&&(console.log("appUpgrade#getIframeUrl#appMatched",E),console.log("appUpgrade#getIframeUrl#url",_,R)),{path:_,locationSearch:R}},ja=function(e,t){var n="ams-checkout-component-".concat(e,"-").concat(t),r=document.createElement("iframe"),o=n;return r.id=o,r.style.height="1px",r.style.width="1px",r.style.border="1px",r.style.opacity="0",r.style.overflow="hidden",r},Va=2e4,Ga="MERCHANT_CONFIRM_ABORT",za="MERCHANT_CONFIRM_TIMEOUT",Wa=Symbol("BEFORE_CONFIRM_TIMEOUT");function qa(e){return Ja.apply(this,arguments)}function Ja(){return Ja=s()(i()().mark((function e(t){var n,r,o,a,s=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:Va,o=new Promise((function(e,t){r=setTimeout((function(){return t(Wa)}),n)})),e.prev=2,e.next=5,Promise.race([t(),o]);case 5:return a=e.sent,e.abrupt("return",{result:a,timedOut:!1});case 9:if(e.prev=9,e.t0=e.catch(2),e.t0!==Wa){e.next=13;break}return e.abrupt("return",{result:void 0,timedOut:!0});case 13:throw e.t0;case 14:return e.prev=14,clearTimeout(r),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,9,14,17]])}))),Ja.apply(this,arguments)}var Qa=function(e){return e.APPLE_PAY_MISSING_DATA="APPLE_PAY_MISSING_DATA",e.APPLE_PAY_NOT_SUPPORTED="APPLE_PAY_NOT_SUPPORTED",e.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED="APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",e.APPLE_PAY_TOKEN_ERROR="APPLE_PAY_TOKEN_ERROR",e.APPLE_PAY_CANCEL="APPLE_PAY_CANCEL",e}(Qa||{}),Za=function(e){return e.PENDING="PENDING",e.NORMAL="NORMAL",e}(Za||{});function Xa(e,t){var n,r,o,i,a,s,l,c;return"BANKTRANSFER_QUICKPAY"===(null==e||null===(n=e.paymentMethodInfoView)||void 0===n?void 0:n.paymentMethodType)&&"EASY_PAY"===(null==e||null===(r=e.paymentSessionConfig)||void 0===r?void 0:r.productScene)&&"APM"===(null==e||null===(o=e.paymentSessionConfig)||void 0===o?void 0:o.paymentMethodCategoryType)&&"2.0"===(null==e||null===(i=e.paymentSessionConfig)||void 0===i?void 0:i.productSceneVersion)?{usePaymentSessionAsQueryResult:!0,submitPayInSdk:!0,createIframeNode:!0,loadApp:!0,allowClickOutsideClose:!1,buildSubmitPayExtParams:function(e){var n=function(e){var t=e.instanceId,n=e.paymentMethodType,r=e.paymentSessionData,o=e.paymentSessionObj,i=e.locale,a=e.env,s=e.sdkVersion,l=e.notRedirectAfterComplete,c=!1,u=zt(o,a);return"".concat(u)+"?scene=cashierResultPage&"+"instanceId=".concat(t)+"&"+"paymentSessionData=".concat(encodeURIComponent(r))+"&"+"isLandscape=".concat(c?"true":"")+"&"+"pmt=".concat(n)+"&"+"locale=".concat(i)+"&"+"mode=".concat(it.SDK)+"&"+"sdkVersion=".concat(s)+"&"+"¬RedirectAfterComplete=".concat(l)}(e);return{callBackUrl:n,notRedirectAfterComplete:!0===t}}}:"TNG"===(null==e||null===(a=e.paymentMethodInfoView)||void 0===a?void 0:a.paymentMethodType)&&"EASY_PAY"===(null==e||null===(s=e.paymentSessionConfig)||void 0===s?void 0:s.productScene)&&"WALLET"===(null==e||null===(l=e.paymentSessionConfig)||void 0===l?void 0:l.paymentMethodCategoryType)&&"2.0"===(null==e||null===(c=e.paymentSessionConfig)||void 0===c?void 0:c.productSceneVersion)?{usePaymentSessionAsQueryResult:!1,submitPayInSdk:!1,createIframeNode:!0,loadApp:!0,allowClickOutsideClose:!1,buildSubmitPayExtParams:function(e){return{}}}:void 0}var $a=function(e){return new Promise((function(t,n){var r,o=null==e||null===(r=e.context)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.data)||void 0===r||null===(r=r.paymentMethodDetail)||void 0===r?void 0:r.googlePayProps,i=o.environment,a=void 0===i?"TEST":i,s=o.paymentRequest,l=void 0===s?{}:s,c=document.createElement("script");c.src="https://pay.google.com/gp/p/js/pay.js",c.async=!0,document.body.appendChild!==Node.prototype.appendChild?Node.prototype.appendChild.call(document.body,c):document.body.appendChild(c),c.onload=function(){var e=new window.google.payments.api.PaymentsClient({environment:a,paymentDataCallbacks:{onPaymentAuthorized:function(e){return{transactionState:"SUCCESS"}}}});e.isReadyToPay(l).then((function(t){if(t.result)return e.loadPaymentData(l);n({errorCode:"GOOGLE_PAY_NOT_SUPPORTED"})})).then((function(e){e&&t(e)})).catch((function(e){n(e)}))},c.onerror=function(e){n(e)}}))},es=function(){function e(t){var n=t.paymentSessionData,r=t.parseData,o=t.logger,i=t.env,a=void 0===i?X.prod:i,s=t.shipping,l=t.merchantAmount,u=void 0===l?null:l,d=t.merchantCurrency,p=void 0===d?null:d;g()(this,e),c()(this,"APPLESDKURL","https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js"),c()(this,"session",null),c()(this,"paymentSessionData",void 0),c()(this,"parseData",void 0),c()(this,"paymentStatus",void 0),c()(this,"cancelReason",null),c()(this,"logger",void 0),c()(this,"env",void 0),c()(this,"shipping",void 0),c()(this,"merchantAmount",void 0),c()(this,"merchantCurrency",void 0),c()(this,"onBeforeConfirm",null),this.paymentSessionData=n,this.parseData=r,this.env=a,this.logger=o,this.shipping=s,this.merchantAmount=u,this.merchantCurrency=p}var t,n,r,o;return f()(e,[{key:"setOnBeforeConfirm",value:function(e){this.onBeforeConfirm=e}},{key:"startPay",value:(o=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.initApplePaySession();case 3:return e.abrupt("return",this.begin());case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return o.apply(this,arguments)})},{key:"begin",value:function(){var e=this;return new Promise((function(t,n){try{if(!e.session)return;e.paymentStatus=Za.PENDING,e.cancelReason="USER_CANCEL",e.session.onvalidatemerchant=function(){var t=s()(i()().mark((function t(r){var o,a,s,l,c;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o={validateUrl:null==r?void 0:r.validationURL,paymentSessionData:e.paymentSessionData,merchantDomain:window.location.hostname},t.t0=ya,t.t1=e.paymentSessionData,t.t2=o,t.t3=e.env,t.next=8,e.getDeviceId();case 8:return t.t4=t.sent,t.t5={deviceId:t.t4},t.t6={env:t.t3,envInfo:t.t5},t.t7=e.logger,t.next=14,(0,t.t0)(t.t1,t.t2,t.t6,t.t7);case 14:null!=(a=t.sent)&&a.success&&a.merchantSessionObject?(s=JSON.parse(a.merchantSessionObject),e.session.completeMerchantValidation(s)):(null===(l=e.logger)||void 0===l||l.logError({title:"a3753.b103030.c386485.d507483"}),e.abortSession(),n({errorCode:Qa.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED})),t.next=23;break;case 18:t.prev=18,t.t8=t.catch(0),null===(c=e.logger)||void 0===c||c.logError({title:"a3753.b103030.c386485.d507483"}),e.abortSession(),n({errorCode:Qa.APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED});case 23:case"end":return t.stop()}}),t,null,[[0,18]])})));return function(e){return t.apply(this,arguments)}}(),e.session.onpaymentauthorized=function(){var r=s()(i()().mark((function r(o){var a,s,l,c,u,d,p,h,m,f,v,g,y,_,E,b,A,S,k,T,P,I,C,w,N,O,R;return i()().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a=function(){var t,n;return null===(t=e.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),Promise.reject({errorCode:Qa.APPLE_PAY_TOKEN_ERROR})},s=null==o?void 0:o.payment,l=s.token,c=s.billingContact,u=s.shippingContact,!l){r.next=46;break}if(p={instPaymentToken:JSON.stringify(l)},h=null===(d=e.parseData)||void 0===d||null===(d=d.paymentSessionFactor)||void 0===d?void 0:d.extendInfo,m=h.requiredBillingContactFields,f=h.requiredShippingContactFields,!Ct(m)&&c&&(p.applePayBillingContact=JSON.stringify(c)),!Ct(f)&&u&&(p.applePayShippingContact=JSON.stringify(u)),e.onBeforeConfirm){r.next=11;break}null===(v=e.logger)||void 0===v||v.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk"}),r.next=39;break;case 11:return null===(g=e.logger)||void 0===g||g.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk"}),r.prev=12,_=Date.now(),r.next=16,qa((function(){return e.onBeforeConfirm()}));case 16:if(E=r.sent,b=E.result,A=E.timedOut,S=b,(k=A||Date.now()-_>=Va)&&(null===(T=e.logger)||void 0===T||T.logError({title:"sdk_before_confirm_timeout"}),S=!1),null===(y=e.logger)||void 0===y||y.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:S}),S){r.next=29;break}return e.cancelReason=k?"MERCHANT_TIMEOUT":"MERCHANT_ABORT",null===(P=e.session)||void 0===P||null===(I=P.completePayment)||void 0===I||I.call(P,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),n({errorCode:k?za:Ga}),r.abrupt("return");case 29:r.next=39;break;case 31:return r.prev=31,r.t0=r.catch(12),null===(C=e.logger)||void 0===C||C.logError({title:"sdk_before_confirm_error"},{paymentMethodType:"APPLEPAY",path:"applePay_chrome_sdk",errorMessage:String((null===r.t0||void 0===r.t0?void 0:r.t0.message)||r.t0).slice(0,200)}),e.cancelReason="MERCHANT_ABORT",null===(w=e.session)||void 0===w||null===(N=w.completePayment)||void 0===N||N.call(w,window.ApplePaySession.STATUS_FAILURE),e.abortSession(),n({errorCode:Ga}),r.abrupt("return");case 39:return r.next=41,e.submitPay(p);case 41:O=r.sent,e.setPayStatus(O),t(O),r.next=48;break;case 46:null===(R=e.logger)||void 0===R||R.logError({title:"a3753.b103030.c386485.d507486"}),a();case 48:case"end":return r.stop()}}),r,null,[[12,31]])})));return function(e){return r.apply(this,arguments)}}(),e.session.oncancel=function(){var t,r;e.paymentStatus===Za.PENDING?null===(t=e.logger)||void 0===t||t.logError({title:"a3753.b103030.c386485.d507497"}):null===(r=e.logger)||void 0===r||r.logInfo({title:"a3753.b103030.c386485.d507498"});var o="MERCHANT_TIMEOUT"===e.cancelReason?za:Ga;n({errorCode:"MERCHANT_ABORT"===e.cancelReason||"MERCHANT_TIMEOUT"===e.cancelReason?o:Qa.APPLE_PAY_CANCEL})},e.session.begin(),e.addEventListener(n)}catch(e){return Promise.reject(e)}}))}},{key:"submitPay",value:(r=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.t0=va,e.t1=h()({paymentSessionConfig:null===(n=this.parseData)||void 0===n?void 0:n.paymentSessionConfig,paymentSessionData:this.paymentSessionData,paymentFactors:t,paymentMethod:{paymentMethodType:"APPLEPAY"},shipping:this.shipping},this.merchantAmount&&this.merchantCurrency?{paymentAmount:{amount:this.merchantAmount,currency:this.merchantCurrency}}:{}),e.t2=this.env,e.next=6,this.getDeviceId();case 6:return e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,envInfo:e.t4},e.t6=this.logger,e.next=12,(0,e.t0)(e.t1,e.t5,e.t6);case 12:return e.abrupt("return",e.sent);case 15:return e.prev=15,e.t7=e.catch(0),e.abrupt("return",Promise.resolve(e.t7));case 18:case"end":return e.stop()}}),e,this,[[0,15]])}))),function(e){return r.apply(this,arguments)})},{key:"setPayStatus",value:function(e){var t,n,r,o={success:window.ApplePaySession.STATUS_SUCCESS,fail:window.ApplePaySession.STATUS_FAILURE};r=null!=e&&e.success||"U"===(null==e?void 0:e.errorStatus)?"success":"fail",this.paymentStatus=Za.NORMAL,null===(t=this.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,o[r])}},{key:"initApplePaySession",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.paymentStatus!==Za.PENDING){e.next=3;break}return e.abrupt("return");case 3:if(this.isRequiredParameters){e.next=7;break}return null===(r=this.logger)||void 0===r||r.logError({title:"a3753.b103030.c386485.d507448"}),this.paymentStatus=Za.NORMAL,e.abrupt("return",Promise.reject({errorCode:Qa.APPLE_PAY_MISSING_DATA}));case 7:return null===(t=this.logger)||void 0===t||t.logInfo({title:"a3753.b103030.c386485.d507459"}),e.next=10,this.loadApplePaySdk();case 10:if("ApplePaySession"in window){e.next=12;break}throw new Error("Apple Pay not supported");case 12:if(o=(null===(n=this.parseData)||void 0===n?void 0:n.paymentSessionFactor)||{},a=o.recurringInfo,s=a?14:2,this.isCanMakePayments(s)){e.next=16;break}throw new Error("Apple Pay not supported");case 16:this.session=new window.ApplePaySession(s,this.initSessionParams),e.next=23;break;case 19:return e.prev=19,e.t0=e.catch(0),null===(l=this.logger)||void 0===l||l.logError({title:"a3753.b103030.c386485.d507471"}),e.abrupt("return",Promise.reject({errorCode:Qa.APPLE_PAY_NOT_SUPPORTED}));case 23:case"end":return e.stop()}}),e,this,[[0,19]])}))),function(){return n.apply(this,arguments)})},{key:"abortSession",value:function(){try{var e,t;this.paymentStatus=Za.NORMAL,this.session&&(null===(e=(t=this.session).abort)||void 0===e||e.call(t))}catch(e){console.error("abortPaySession error",e)}finally{this.session=null}}},{key:"initSessionParams",get:function(){var e,t=(null===(e=this.parseData)||void 0===e?void 0:e.paymentSessionFactor)||{},n=t.merchantInfo,r=t.order,o=t.paymentAmount,i=t.recurringInfo,a=t.extendInfo,s={countryCode:null==n?void 0:n.registeredCountry,currencyCode:this.merchantCurrency||(null==o?void 0:o.currency),merchantCapabilities:null==a?void 0:a.merchantCapabilities,supportedNetworks:null==a?void 0:a.supportedNetworks,total:{label:null==n?void 0:n.merchantName,type:"final",amount:this.merchantAmount||(null==o?void 0:o.value)},requiredBillingContactFields:null==a?void 0:a.requiredBillingContactFields,requiredShippingContactFields:null==a?void 0:a.requiredShippingContactFields};if(i){var l;if(null==r||!r.orderDescription||null==i||!i.managementURL)return;var c={type:"final",label:i.title,amount:null==o?void 0:o.value,paymentTiming:"recurring",recurringPaymentStartDate:null!=i&&i.startDate?new Date(1e3*Number(i.startDate)):void 0,recurringPaymentEndDate:null!=i&&i.endDate?new Date(1e3*Number(i.endDate)):void 0,recurringPaymentIntervalUnit:null!=i&&i.intervalUnit?i.intervalUnit:"month",recurringPaymentIntervalCount:null!==(l=null==i?void 0:i.intervalCount)&&void 0!==l?l:1},u={paymentDescription:null==r?void 0:r.orderDescription,billingAgreement:i.agreementDescription,regularBilling:c,managementURL:null==i?void 0:i.managementURL,tokenNotificationURL:null==i?void 0:i.tokenNotificationURL};s.total=c,s.lineItems=[c],s.recurringPaymentRequest=u}return s}},{key:"isRequiredParameters",get:function(){var e,t=(null===(e=this.parseData)||void 0===e?void 0:e.paymentSessionFactor)||{},n=t.merchantInfo,r=t.extendInfo,o=t.paymentAmount;return!(Ct(n)||Ct(o)||Ct(null==r?void 0:r.supportedNetworks)||Ct(null==r?void 0:r.merchantCapabilities))}},{key:"isCanMakePayments",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return(null===(e=window.ApplePaySession)||void 0===e?void 0:e.canMakePayments())&&(null===(t=window.ApplePaySession)||void 0===t?void 0:t.supportsVersion(n))}},{key:"loadApplePaySdk",value:function(){var e=this;return vt?Promise.reject("APPLE_PAY_NOT_SUPPORTED"):this.checkScriptIsLoaded||this.isCanMakePayments()?Promise.resolve(!0):new Promise((function(t,n){var r=document.createElement("script");r.src=e.APPLESDKURL,r.onload=function(){t(!0)},r.onerror=function(){n(!1)},document.body.appendChild(r)}))}},{key:"checkScriptIsLoaded",get:function(){return!!document.querySelector('script[src="'.concat(this.APPLESDKURL,'"]'))}},{key:"addEventListener",value:function(e){var t=this,n=document.querySelector("apple-pay-modal"),r=null==n?void 0:n.shadowRoot,o=(null==r?void 0:r.querySelector(".modal-close-button"))||null;o||this.logger.logInfo({title:"a3753.b103030.c386485.d533112"});null==o||o.addEventListener("click",(function n(){var r;null===(r=t.logger)||void 0===r||r.logInfo({title:"a3753.b103030.c386485.d507470"}),t.abortSession(),null==o||o.removeEventListener("click",n),null==e||e()}),{once:!0})}},{key:"getDeviceId",value:(t=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,We.publishForResult(new Ve(Pn.getSecurityDeviceId,JSON.stringify({deviceIdParameter:{productScene:null===(n=this.parseData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene}})),{fallback:""});case 2:if(e.t1=t=e.sent,e.t0=null===e.t1,e.t0){e.next=6;break}e.t0=void 0===t;case 6:if(!e.t0){e.next=10;break}e.t2=void 0,e.next=11;break;case 10:e.t2=t.getJSONObject();case 11:return e.abrupt("return",e.t2);case 12:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),ts="#".concat(Ee,"-desktop{\n position: absolute;\n top: 0;\n left: 0;\n}\n#").concat(Ee,"-mobile{\n position: absolute;\n top: 0;\n left: 0;\n}\n.").concat(ye,"-inline{\n width: 100%;\n height: auto;\n position: relative;\n line-height: 0;\n display: flex;\n}\n#").concat(Te,"{\n width: 100%;\n flex: 1;\n}\n.").concat(we,"{\n width: 100%;\n height: auto;\n object-fit: contain;\n box-sizing: border-box;\n}\n.").concat(we,"-mobile{\n padding: 0 0.16em;\n}\n.").concat(we,"-desktop{}\n"),ns=function(){var e=document.createElement("style");e.id="ams-inline-component-style",e.type="text/css",e.innerHTML=ts,document.head.appendChild(e)},rs=function(e,t,n){var r=document.createElement("div");r.id=Te,n.componentSign===j.ELEMENT_PAYMENT?n.isExpressCheckout?r.innerHTML="":r.innerHTML=function(e){var t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){return e+t}),"")},n=function(e){var t=e.x,n=void 0===t?0:t,r=e.y,o=void 0===r?0:r,i=e.fill,a=void 0===i?"black":i,s=e.width,l=void 0===s?560:s,c=e.height,u=void 0===c?32:c,d=e.rx,p=void 0===d?4:d;return'<rect fill-opacity="0.04" x="'.concat(n,'" y="').concat(o,'" width="').concat(l,'" height="').concat(u,'" rx="').concat(p,'" fill="').concat(a,'"/>')},r=[n({fill:"white"}),n({y:4}),n({y:48,height:64}),n({y:128}),n({y:176}),n({y:224})];"tabs"===e&&(r=[n({fill:"white",width:358,height:305}),n({y:4,width:"50%",height:73}),n({x:"51%",y:4,height:73}),n({y:96,height:64}),n({y:178}),n({y:228}),n({y:276})]);var o={view:"tabs"===e?"0 0 358 305":"0 0 560 256",height:"tabs"===e?305:256};return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0 0 560 256",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256;return'<svg id="'.concat(we,"-").concat(e,'" width="100%" height="').concat(o,'" viewBox="').concat(r,'" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">\n ').concat(t(n),'\n <animate xlink:href="#').concat(we,"-").concat(e,'" attributeName="opacity" values="0.5; 1; 0.5" begin="0s" dur="1s" repeatCount="indefinite"></animate>\n </svg>')}(r,o.view,o.height)}(null==n?void 0:n.type):t===te.desktop?r.innerHTML='<svg class="'.concat(we," ").concat(we,"-").concat(t,'" width="740" height="360" viewBox="0 0 740 360" fill="none" xmlns="">\n <rect width="740" height="360" rx="12" fill="#F6F6F6"/>\n <rect opacity="0.7" x="44" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="94" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="144" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z" fill="#E1E6ED"/>\n </g>\n </svg>'):t===te.mobile&&(r.innerHTML='<svg class="'.concat(we," ").concat(we,"-").concat(t,'" width="358" height="186" viewBox="0 0 358 186" fill="none" xmlns="">\n <g clip-path="url(#clip0_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <g clip-path="url(#clip1_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <rect width="358" height="40" fill="white"/>\n <rect opacity="0.7" x="4" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="54" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="104" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g clip-path="url(#clip2_2543_91192)">\n <rect width="358" height="120" transform="translate(0 66)" fill="white"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z" fill="#E1E6ED"/>\n </g>\n <g clip-path="url(#clip3_2543_91192)">\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z" fill="#E1E6ED"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id="clip0_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip1_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip2_2543_91192">\n <rect width="358" height="120" fill="white" transform="translate(0 66)"/>\n </clipPath>\n <clipPath id="clip3_2543_91192">\n <rect width="358" height="92" fill="white" transform="translate(0 94)"/>\n </clipPath>\n </defs>\n </svg>\n ')),e&&e.appendChild(r);var o=document.getElementById(Te);At(0,o)},os=".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(ke,"-hidden{\nanimation: ").concat(ke,"-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** 加载动画 **/\n@-webkit-keyframes ").concat(ke,"-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n\n"),is=function(e,t){if(!document.getElementById(ye)){var n;(n=document.createElement("style")).type="text/css",n.innerHTML=os,document.head.appendChild(n),St();var r=document.createElement("div");r.className="".concat(ye,"-hidden-").concat(e),r.id=ye,At(0,r),document.body.appendChild(r);var o=document.createElement("div");return o.className="ams-component-section-".concat(e),o.id=_e,r.appendChild(o),r.classList.remove("".concat(ye,"-hidden-").concat(e)),r.classList.add("".concat(ye,"-").concat(e)),as(e,t),r}},as=function(e,t){var n=e===te.mobile?"touchend":"click",r=document.getElementById(ye),o="<img class='".concat(be,"-btn-").concat(e,"' src=\"").concat(De,'"/>'),i=document.createElement("div");i.classList.add("".concat(be,"-").concat(e),"".concat(be,"-hidden")),i.id=be,i.innerHTML=o,i.addEventListener(n,(function(){t()})),r&&r.appendChild(i)},ss=function(e){var t=(null==e?void 0:e.platform)===te.mobile?"touchend":"click",n=document.getElementsByTagName("body")[0];n.style.overflow="hidden";var r=document.createElement("div");r.style.width="100vw",r.style.height="100vh",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.zIndex="1000",r.style.background="rgba(0,0,0,0.5)",r.style.display="none",r.id=ke,r.addEventListener(t,(function(){var t;null==e||null===(t=e.onClickOutside)||void 0===t||t.call(e)})),n.appendChild(r),function(e,t){var n=e===te.mobile?"touchend":"click",r="<div class='".concat(Ae,'-btn\'>\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z" fill="#EEEEEE"/>\n</svg>\n </div>'),o=document.createElement("div");o.classList.add("".concat(Ae,"-").concat(e),"".concat(Ae,"-hidden")),o.id=Ae,o.innerHTML=r,o.addEventListener(n,(function(){t()})),document.body.appendChild(o)}(null==e?void 0:e.platform,null==e?void 0:e.closeBtnFunc)},ls="\n .".concat(Ne,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(Ne,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(Ne,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(Ne,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(Me,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ne,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(Me,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ne,"-drawer-enter {\n animation: slideIn ").concat(Me,"ms forwards;\n }\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(Ne,"-drawer-exit {\n animation: slideOut ").concat(Me,"ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n"),cs=function(e,t){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light",t="\n .ams-component-popup-loading .line div:before,\n .ams-component-popup-loading .line div:after {\n background: ".concat("light"===e?"#000000":"#ffffff"," !important;\n }"),n=document.createElement("style");n.innerHTML=t,document.head.appendChild(n)}(t);var n=document.createElement("div");null==n||n.classList.add(Pe),n.id=Pe,n.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',n.style.fontSize="".concat(bt(),"px"),e.appendChild(n)},us=function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=document.getElementById(ke);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(Pe))||void 0===e||e.remove()},ds="desktop",ps=function(e){var t=e.device,n=e.url,r=(e.widthPadding,e.loadingConfig);return new Promise((function(e,o){try{ds=t;var i=document.createElement("div");i.classList.add("".concat(Ne,"overlay"),"".concat(Ne,"fadeIn"));var a=document.createElement("div");"desktop"===t?(a.classList.add("".concat(Ne,"modal"),"".concat(Ne,"fadeIn")),a.style.width="656px",a.style.height="620px",a.style.borderRadius="12px"):(a.classList.add("".concat(Ne,"modal-mobile"),"".concat(Ne,"-drawer-enter")),a.style.width="100%",a.style.height="80vh",a.style.borderRadius="12px 12px 0 0");var s=document.createElement("iframe");if(s.src=n,s.style.border="none",s.style.width="100%",s.style.height="100%",r&&Object.keys(r).length){var l=r.theme,c=void 0===l?"default":l,u=r.backgroundPrimary,d=void 0===u?"#ffffff":u,p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t={night:"dark",gamingPurple:"dark",agateGreen:"dark",default:"light",nostalgicGray:"light",cherryBlossomPink:"light"};return t[e]}(c);cs(a,p),a.style.backgroundColor=d,s.style.backgroundColor=d}a.appendChild(s);var h=document.getElementsByTagName("body")[0];h.appendChild(i),h.appendChild(a),e(s)}catch(e){o({title:"sdk_error_create_pop_up",message:null==e?void 0:e.toString()})}}))};window.changingPageHeight=window.innerHeight;var hs,ms,fs,vs=function(){function e(t){g()(this,e),c()(this,"app",void 0),c()(this,"AMSSDK",void 0),c()(this,"platform",void 0),c()(this,"_performanceData",[]),c()(this,"_loadAppPromiseResolve",null),c()(this,"_isInitComponent",void 0),c()(this,"_globalData",void 0),c()(this,"popupApp",void 0),c()(this,"appDomain",void 0),c()(this,"createIframeNode",void 0),c()(this,"createPreloadIframeNode",void 0),c()(this,"_selector",void 0),c()(this,"_appVersion",void 0),c()(this,"_isRetention",void 0),c()(this,"_allowSubmitPayCallAhead",void 0),c()(this,"_actionQueryPromise",null),c()(this,"_actionSubmitPromise",null),c()(this,"_renderParams",null),c()(this,"_componentSign",j.NONE),c()(this,"_appLocationSearch",void 0),c()(this,"_renderDisplayType",F.popup),c()(this,"_multipleCallbackEvents",void 0),c()(this,"_isAppWebview",void 0),c()(this,"_isNativeAppWebview",void 0),c()(this,"_merchantAppointParam",void 0),c()(this,"_webAppHeartBeatTimeoutFn",void 0),c()(this,"_hasRenderComponent",!1),this._appVersion=t.appVersion,this._isInitComponent=!1,this._selector="#".concat(_e),this.createIframeNode=function(){return Promise.resolve()},this.createPreloadIframeNode=function(){return Promise.resolve()},this.platform=gt?te.mobile:te.desktop,this._isRetention=!0,this._appLocationSearch="",this._performanceData.push({key:"sdk_init",value:Date.now()}),this._globalData=new Map}var t,n,r,o,a;return f()(e,[{key:"logoutPlugin",value:function(){this.cleanContainer(!0)}},{key:"applyPlugin",value:function(e){this.AMSSDK=e,this.subscribeFromSDK()}},{key:"initLoggerMeta",value:function(){var e,t,n,r,o=null===(e=this._renderParams)||void 0===e?void 0:e.paymentSessionMetaData,i=o.paymentSessionConfig;this.AMSSDK.logger.setMedta({platform:this.platform===te.desktop?"PC":"WAP",sdkVersion:T,webAppVersion:this._appVersion,instanceId:this.AMSSDK._instanceId,deviceId:this.AMSSDK._storageId,renderDisplayType:null==o?void 0:o.renderDisplayType,merchantId:null==o?void 0:o.clientId,productScene:null==i?void 0:i.productScene,productSceneVersion:null==i?void 0:i.productSceneVersion,paymentMethodType:null==o||null===(t=o.paymentMethodInfoView)||void 0===t?void 0:t.paymentMethodType,paymentMethodCategoryType:null==i?void 0:i.paymentMethodCategoryType,requestSeq:null===(n=this._renderParams)||void 0===n?void 0:n.sessionData,trackId:null===(r=this._renderParams)||void 0===r?void 0:r.sessionData})}},{key:"setRender",value:function(e){this.createIframeNode=e}},{key:"setPreloadRender",value:function(e){this.createPreloadIframeNode=e}},{key:"initSecurity",value:function(){var e,t=this,n=null===(e=this._renderParams)||void 0===e||null===(e=e.paymentSessionMetaData)||void 0===e||null===(e=e.paymentSessionConfig)||void 0===e?void 0:e.productScene;j.CASHIER_PAYMENT_APM!==this._componentSign&&(j.CASHIER_PAYMENT_BANK===this._componentSign&&this.AMSSDK.logger.logInfo({title:"sdk_event_security_unneeded_scenarios"},{productScene:n}),this.AMSSDK._getSecuritySDKByProductScene({product:n})||(this.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkInit"}),this.AMSSDK._newSecuritySDKByScene({product:n},(function(){t.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkInitSuccess"})}),(function(){t.AMSSDK.logger.logError({title:"sdk_error_securitySdkInitFailed"},{sign:"SDK internal initialization"})}))))}},{key:"logDeviceId",value:function(e,t){var n="".concat(Date.now()-t);e?this.AMSSDK.logger.logInfo({title:"sdk_event_securitySdkGetTokenSuccess"},{eventMessage:n}).send():this.AMSSDK.logger.logInfo({title:"sdk_error_securitySdkGetTokenFailed"},{eventMessage:n}).send()}},{key:"getDeviceIdAndLog",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((function(r){setTimeout(s()(i()().mark((function o(){var a,s,l,c,u;return i()().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return s=null===(a=e._renderParams)||void 0===a||null===(a=a.paymentSessionMetaData)||void 0===a||null===(a=a.paymentSessionConfig)||void 0===a?void 0:a.productScene,l=Date.now(),o.next=4,e.AMSSDK._awaitSecuritySDKByProductScene({product:(null==t?void 0:t.productScene)||s});case 4:if(c=o.sent,u="",!c){o.next=18;break}if(!(n&&parseInt(null==t?void 0:t.tokenCollectTime)>0)){o.next=13;break}return o.next=10,c.pollingGetApdidToken(t);case 10:o.t0=o.sent,o.next=16;break;case 13:return o.next=15,c.getApdidToken();case 15:o.t0=o.sent;case 16:u=o.t0,e.logDeviceId(u,l);case 18:r(u);case 19:case"end":return o.stop()}}),o)}))),0)}))}},{key:"appendIframeNodes",value:function(e,t){var n,r,o,i,a,s,l,c,u,d,p,h,m=this;if(this._isInitComponent)return this.dispatchToSDK(ve.error.name,me.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR),Promise.reject(me.CREATECOMPONENT_ERROR.SINGLETON_COMPONENT_ERROR);t=this.setParameterDefaultValues(e,t),this._merchantAppointParam=t.merchantAppointParam,this._isInitComponent=!0,this._renderParams=t,this._componentSign=e,null!==(n=t)&&void 0!==n&&n.selector&&(this._selector=t.selector),this._renderDisplayType=null===(r=t)||void 0===r?void 0:r.renderDisplayType;var f=-1===(null==this||null===(o=this._selector)||void 0===o||null===(i=o.indexOf)||void 0===i?void 0:i.call(o,"#"))?null==this?void 0:this._selector:null==this||null===(a=this._selector)||void 0===a||null===(s=a.slice)||void 0===s?void 0:s.call(a,1),v=null!==(l=t)&&void 0!==l&&l.appendAliasContainerId?"-".concat(f):"",g="".concat(ye).concat(v),y=(null==this?void 0:this._renderDisplayType)===F.inline?"#".concat(g):null==this?void 0:this._selector;this._isAppWebview=t.isAppWebview,this._isNativeAppWebview=t.isNativeAppWebview,this.initLoggerMeta(),this.initSecurity(),this._performanceData.push({key:"sdk_create_component",value:Date.now()});var _={paymentSessionData:this._renderParams&&(null===(c=this._renderParams)||void 0===c?void 0:c.sessionData)||"",paymentSessionConfig:null===(u=this._renderParams)||void 0===u||null===(u=u.paymentSessionMetaData)||void 0===u?void 0:u.paymentSessionConfig}.paymentSessionConfig||{},E=_.productSceneVersion,b=void 0===E?"":E,A=_.productScene,S=void 0===A?"":A,k=((null===(d=this._renderParams)||void 0===d?void 0:d.paymentSessionMetaData)||{}).action,T=void 0===k?{}:k,P=T.autoDebitWithToken,I=void 0!==P&&P,C=T.requireFastSdk,w=void 0!==C&&C,N=((null===(p=this._renderParams)||void 0===p?void 0:p.paymentSessionMetaData)||{}).authUrlInfo,O=void 0===N?{}:N;if(this.AMSSDK.logger.logInfo({title:"sdk_event_createComponent"},{productScene:this.AMSSDK.options.product}).send(),j.EASY_PAY_WALLET!==this._componentSign||S!==V.EASY_PAY||"1.0"!==b||I||!w){if(j.AUTO_DEBIT_WALLET===this._componentSign){var R,M,D,L=(null===(R=this._renderParams)||void 0===R||null===(R=R.paymentSessionMetaData)||void 0===R?void 0:R.action)||{},x=_t()?null==L||null===(M=L.web)||void 0===M?void 0:M.signType:null==L||null===(D=L.wap)||void 0===D?void 0:D.signType,U=(null==L?void 0:L.requireFastSdk)||!1;if("REDIRECT"===x&&!0===U)return void this.handleAuthUrlInfo(O)}if(j.AUTO_DEBIT_PAY_WALLET===this._componentSign)return!0===w&&"1.0"===b?void this.handleAuthUrlInfo(O):Promise.reject({code:me.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Abnormal response data, interface failure, or unsupported payment method."});if(this.dispatchToSDK(ve.eventCallback.name,{code:ae.SDK_START_OF_LOADING}),this._renderDisplayType===F.inline){var K=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ye,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(document.getElementById(Ce)||ns(),!document.getElementById(n||t)){var r=document.createElement("div");r.className="".concat(t,"-inline"),r.id=n||t;var o=document.querySelector("".concat(e));return o&&o.appendChild(r),r}}(this._selector,ye,g);K&&this.renderInlineLoading(t,K),(B=document.createElement("style")).innerHTML=ls,document.head.appendChild(B)}var B;if(this._renderDisplayType===F.popup){var Y,H;is(this.platform,this.closeBtnFunc.bind(this)),function(e,t,n){var r=e===te.mobile?"touchend":"click",o=document.createElement("div");o.id=Se,o.classList.add("".concat(Se,"-").concat(e)),o.innerHTML='\n <span id="'.concat(Se,'-title" class="').concat(Se,"-title-").concat(e,'">\n Are you sure you want to leave?\n </span>\n <span\n id="').concat(Se,'-sub-title"\n class="').concat(Se,"-sub-title-").concat(e,'"\n >\n If you leave this page, you\'ll have to start over again.\n </span>\n <div class="').concat(Se,"-btn-block-").concat(e,'">\n <div id="').concat(Se,'-remain" class="').concat(Se,"-remain-").concat(e,'">\n Continue Payment\n </div>\n <div id="').concat(Se,'-leave" class="').concat(Se,"-leave-").concat(e,'">\n Leave\n </div>\n </div>'),document.body.appendChild(o);var i=document.getElementById("".concat(Se,"-remain"));i&&i.addEventListener(r,t);var a=document.getElementById("".concat(Se,"-leave"));a&&a.addEventListener(r,n)}(this.platform,this.hideRetentionPopupFunc.bind(this),this.retentionPopupLeaveFunc.bind(this));var G=Xa(null===(Y=this._renderParams)||void 0===Y?void 0:Y.paymentSessionMetaData,!0===(null===(H=this._renderParams)||void 0===H?void 0:H.notRedirectAfterComplete)),z=function(){};null!=G&&G.allowClickOutsideClose&&(z=this.closeBtnFunc.bind(this));var W=this.closeBtnFunc.bind(this);ss({platform:this.platform,onClickOutside:z,closeBtnFunc:W}),this.renderPopupLoading(t)}return this.createApp(t),null!==(h=this._renderParams)&&void 0!==h&&null!==(h=h.paymentSessionMetaData)&&void 0!==h&&null!==(h=h.connectFactor)&&void 0!==h&&h.enableConnect?(this._createLoadAppPromise(),this.createIframeNode(this,y,this._renderDisplayType).then((function(){return Promise.resolve()}))):Promise.all([this.createActionQueryPromise(),this.createSubmitPromise(),this.createIframeNode(this,y,this._renderDisplayType),this._createLoadAppPromise()]).then((function(){return Promise.resolve()})).catch((function(e){return m.AMSSDK.logger.logError({title:"sdk_error_created_app_process_failed"}).send(),m._isInitComponent=!1,m.cleanContainer(),Promise.reject(e)}))}this.handleAuthUrlInfo(O)}},{key:"appendPreloadIframeNodes",value:function(e,t){var n=this.createPreloadApp(e,t);this.createPreloadIframeNode(n),this.AMSSDK.logger.logInfo({title:"performance_optimization_preload"},{productSceneVersion:t})}},{key:"setParameterDefaultValues",value:function(e,t){var n,r=Object.assign({},t);e===j.VAULTING_CARD&&(r.notRedirectAfterComplete=null===(n=null==r?void 0:r.notRedirectAfterComplete)||void 0===n||n);return r}},{key:"renderInlineLoading",value:function(e,t){var n,r,o=null==e||null===(n=e.appearance)||void 0===n?void 0:n.showLoading;o="boolean"!=typeof o||o;var i=e.paymentSessionMetaData.extendInfo,a=!1;try{a=JSON.parse(JSON.parse(i).expressCheckout)}catch(e){}o&&rs(t,this.platform,{componentSign:this._componentSign,type:null===(r=this._renderParams)||void 0===r||null===(r=r.appearance)||void 0===r||null===(r=r.layout)||void 0===r?void 0:r.type,isExpressCheckout:a})}},{key:"renderPopupLoading",value:function(e){var t,n=null==e||null===(t=e.appearance)||void 0===t?void 0:t.showLoading;if(n="boolean"!=typeof n||n){var r=document.getElementById(ke);r&&(r.style.display="block"),function(){var e=document.createElement("div");null==e||e.classList.add(Te),e.id=Te,e.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',e.style.fontSize="".concat(bt(),"px");var t=document.getElementsByTagName("body")[0];null==t||t.appendChild(e)}()}}},{key:"_createLoadAppPromise",value:function(e){var t=this;return new Promise((function(n,r){t._loadAppPromiseResolve=n,setTimeout((function(){r(me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT)}),null!=e?e:Re)})).catch((function(e){return t.dispatchToSDK(ve.error.name,me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT),t.dispatchToSDK(ve.eventCallback.name,me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT),t.AMSSDK.logger.logError({title:"sdk_error_web_app_timeout"}).send(),Promise.reject(e)}))}},{key:"createActionQueryPromise",value:function(){var e=this;return this._performanceData.push({key:"sdk_action_query_start",value:Date.now()}),this._actionQueryPromise=new Promise(function(){var t=s()(i()().mark((function t(n,r){var o,a,s,l,c,u,d,p,h,m,f,v,g,y,_,E,b,A,S,k,T,P,I,C,w,N,O,R,M,D,L,x;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:h={locale:e.AMSSDK.options.locale},m={paymentSessionData:e._renderParams&&(null===(o=e._renderParams)||void 0===o?void 0:o.sessionData)||"",paymentSessionConfig:null===(a=e._renderParams)||void 0===a||null===(a=a.paymentSessionMetaData)||void 0===a?void 0:a.paymentSessionConfig,notRedirectAfterComplete:!0===(null===(s=e._renderParams)||void 0===s?void 0:s.notRedirectAfterComplete),merchantAppointParam:e._merchantAppointParam},f=(null===(l=e._renderParams)||void 0===l?void 0:l.paymentSessionMetaData)||{},v=f.extendInfo,g=void 0===v?"":v,y=f.action,_=!1,E=!1,b=(null===(c=e._renderParams)||void 0===c||null===(c=c.paymentSessionMetaData)||void 0===c?void 0:c.action)||{},A=b.skipSdkQuery,S=b.skipSdkQueryForm;try{k=JSON.parse(g),_=k.enableVaultingApiOptimize||!1,E=k.enableEasypayApiOptimize||!1}catch(e){console.log(e)}if(!Ia()){t.next=9;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 9:if(j.ELEMENT_PAYMENT===e._componentSign&&(m.paymentSessionConfig={productScene:null==(i=m.paymentSessionConfig)?void 0:i.productScene,productSceneVersion:null==i?void 0:i.productSceneVersion}),j.ELEMENT_PAYMENT!==e._componentSign||null==e||null===(u=e._renderParams)||void 0===u||null===(u=u.paymentSessionMetaData)||void 0===u||null===(u=u.connectFactor)||void 0===u||!u.enableConnect){t.next=12;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 12:if(j.ELEMENT_ADDRESS!==e._componentSign){t.next=14;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 14:if(j.VAULTING_CARD!==e._componentSign){t.next=26;break}if(!_){t.next=26;break}if(!S){t.next=23;break}if(!Rt(S,e._appVersion)){t.next=21;break}return n({message:"sdk no need to make query request",success:!0}),t.abrupt("return");case 21:t.next=26;break;case 23:if(!A){t.next=26;break}return n({message:"sdk no need to make query request",success:!0}),t.abrupt("return");case 26:if(null==(T=Xa(null===(d=e._renderParams)||void 0===d?void 0:d.paymentSessionMetaData,!0===(null===(p=e._renderParams)||void 0===p?void 0:p.notRedirectAfterComplete)))||!T.usePaymentSessionAsQueryResult){t.next=29;break}return t.abrupt("return",n({autoDebitWithToken:null==y?void 0:y.autoDebitWithToken,amountConfirmRequired:null==y?void 0:y.amountConfirmRequired,success:!0}));case 29:if(j.CASHIER_PAYMENT_CARD!==e._componentSign&&j.VAULTING_CARD!==e._componentSign){t.next=35;break}return m.paymentMethodType="CARD",t.next=33,e.getDeviceIdAndLog();case 33:h.deviceId=t.sent,window.navigator.userAgent.indexOf("miniProgram")>-1&&(h.extendInfo={WAP_SUB_TYPE:"WECHAT_MINI_PROGRAM"});case 35:if(j.EASY_PAY_WALLET!==e._componentSign){t.next=44;break}if(I=m.paymentSessionConfig||{},C=I.productSceneVersion,w=void 0===C?"":C,N=I.productScene,O=void 0===N?"":N,null===(P=e._renderParams)||void 0===P||null===(P=P.paymentSessionMetaData)||void 0===P||null===(P=P.action)||void 0===P||!P.skipSdkQuery||!E){t.next=39;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 39:if(O!==V.EASY_PAY||"2.0"!==w){t.next=41;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 41:return t.next=43,e.getDeviceIdAndLog();case 43:h.deviceId=t.sent;case 44:if(j.AUTO_DEBIT_WALLET!==e._componentSign){t.next=54;break}if(L=(null===(R=e._renderParams)||void 0===R||null===(R=R.paymentSessionMetaData)||void 0===R?void 0:R.action)||{},"SMS"!==(x=_t()?null==L||null===(M=L.web)||void 0===M?void 0:M.signType:null==L||null===(D=L.wap)||void 0===D?void 0:D.signType)){t.next=49;break}return t.abrupt("return",n({message:"sdk no need to make query request",success:!0}));case 49:if(x&&"REDIRECT"===x){t.next=51;break}return t.abrupt("return",n({success:!1}));case 51:return t.next=53,e.getDeviceIdAndLog();case 53:h.deviceId=t.sent;case 54:e.AMSSDK.logger.logInfo({title:"sdk_event_sdkQuery"},{paymentSessionConfig:JSON.stringify(m.paymentSessionConfig)}).send(),ha(m,{env:e.AMSSDK.options.env.environment,envInfo:h},e.AMSSDK.logger).then((function(t){if(e._performanceData.push({key:"sdk_action_query_end",value:Date.now()}),e.AMSSDK.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{paymentSessionConfig:JSON.stringify(m.paymentSessionConfig)}).send(),j.CASHIER_PAYMENT_CARD===e._componentSign&&(null==t||!t.success)){var o,i={code:me.CREATECOMPONENT_ERROR.code,message:null==t?void 0:t.errorMessage};if(e.dispatchToSDK(ve.error.name,i),e.dispatchToSDK(ve.eventCallback.name,i),"NONE"===(null==t||null===(o=t.errorActions)||void 0===o?void 0:o.showType))return void r(i)}n(t)})).catch((function(t){if(j.CASHIER_PAYMENT_CARD===e._componentSign&&(e.dispatchToSDK(ve.error.name,me.CREATECOMPONENT_ERROR.NETWORK_REQUEST_ERROR),e.dispatchToSDK(ve.eventCallback.name,me.CREATECOMPONENT_ERROR.NETWORK_REQUEST_ERROR)),[j.CASHIER_PAYMENT_CARD,j.VAULTING_CARD,j.CASHIER_PAYMENT_APM].includes(e._componentSign))return n({success:!1});e.dispatchToSDK(ve.error.name,{code:me.CREATECOMPONENT_ERROR.code}),e.AMSSDK.logger.logError({title:"sdk_event_sdkQuery_failed"},{paymentSessionConfig:JSON.stringify(m.paymentSessionConfig),errorMessage:t}).send(),r(t)}));case 56:case"end":return t.stop()}var i}),t)})));return function(e,n){return t.apply(this,arguments)}}()),this._actionQueryPromise}},{key:"createSubmitPromise",value:function(){var e,t,n,r,o=this;this._performanceData.push({key:"sdk_submit_start",value:Date.now()});var a={paymentSessionData:this._renderParams&&(null===(e=this._renderParams)||void 0===e?void 0:e.sessionData)||"",paymentSessionConfig:null===(t=this._renderParams)||void 0===t||null===(t=t.paymentSessionMetaData)||void 0===t?void 0:t.paymentSessionConfig},l=Xa(null===(n=this._renderParams)||void 0===n?void 0:n.paymentSessionMetaData,!0===(null===(r=this._renderParams)||void 0===r?void 0:r.notRedirectAfterComplete));this._actionSubmitPromise=new Promise(function(){var e=s()(i()().mark((function e(t){var n,r,s,c,u,d,p,h,m,f,v,g,y,_,E,b,A,S,k,T,P,I,C,w,N,O,R;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.AMSSDK.options.product!==V.ELEMENT_ADDRESS){e.next=2;break}return e.abrupt("return",t({message:"sdk no need to make submitPay request",success:!0}));case 2:if(c=!1,c=l?!l.submitPayInSdk:!(null!==(u=o._renderParams)&&void 0!==u&&null!==(u=u.paymentSessionMetaData)&&void 0!==u&&null!==(u=u.action)&&void 0!==u&&u.skipSdkQuery)||j.EASY_PAY_WALLET!==o._componentSign,j.EASY_PAY_WALLET===o._componentSign&&(h=a.paymentSessionConfig||{},m=h.productSceneVersion,f=void 0===m?"":m,v=h.productScene,g=void 0===v?"":v,y=(null===(d=o._renderParams)||void 0===d?void 0:d.paymentSessionMetaData)||{},_=y.action,b=(E=void 0===_?{}:_).enableSignAgreement,A=void 0!==b&&b,S=E.autoDebitWithToken,k=void 0!==S&&S,T=(null===(p=o._renderParams)||void 0===p?void 0:p.paymentSessionMetaData)||{},P=T.paymentMethodInfoView,I=(void 0===P?{}:P).paymentMethodType,C=void 0===I?"":I,g!==V.EASY_PAY||"2.0"!==f||k||(w=o._isAppWebview||!1,N=o._isNativeAppWebview||!1,a.signAgreement=A,"ALIPAY_CN"!==C||w&&N||(O=Ta(void 0,o.AMSSDK.logger))&&"https"!==O&&(a.h5FromApp=encodeURIComponent(O)))),o._allowSubmitPayCallAhead=!c,!c){e.next=8;break}return e.abrupt("return",t({message:"sdk no need to make submitPay request",success:!0}));case 8:return o.AMSSDK.logger.logInfo({title:"sdk_event_submitPay"},{paymentSessionConfig:JSON.stringify(a.paymentSessionConfig)}).send(),R=(null==l||null===(n=l.buildSubmitPayExtParams)||void 0===n?void 0:n.call(l,{instanceId:o.AMSSDK._instanceId,locale:o.AMSSDK.options.locale,paymentMethodType:null===(r=o._renderParams.paymentSessionMetaData)||void 0===r||null===(r=r.paymentMethodInfoView)||void 0===r?void 0:r.paymentMethodType,paymentSessionData:o._renderParams.sessionData,paymentSessionObj:o._renderParams.paymentSessionMetaData,env:o.AMSSDK.options.env.environment,sdkVersion:o._appVersion,notRedirectAfterComplete:!0===(null===(s=o._renderParams)||void 0===s?void 0:s.notRedirectAfterComplete)}))||{},a.extParams=R,e.t0=va,e.t1=a,e.t2=o.AMSSDK.options.env.environment,e.next=16,o.getDeviceIdAndLog();case 16:e.t3=e.sent,e.t4={deviceId:e.t3},e.t5={env:e.t2,timeout:15e3,envInfo:e.t4},e.t6=o.AMSSDK.logger,(0,e.t0)(e.t1,e.t5,e.t6).then((function(e){o._performanceData.push({key:"sdk_submit_end",value:Date.now()}),o.AMSSDK.logger.logInfo({title:"sdk_event_submitPayEnd"},{paymentSessionConfig:JSON.stringify(a.paymentSessionConfig)}).send(),t(e)})).catch((function(e){o.AMSSDK.logger.logError({title:"sdk_event_submitPay_failed"},{paymentSessionConfig:JSON.stringify(a.paymentSessionConfig)}).send(),t({success:!1})}));case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}},{key:"cleanElement",value:function(){try{var e;if("string"===at(this._selector)){var t=document.querySelector(this._selector);t&&(t.innerHTML="")}var n=document.getElementById(ye);n&&(null==n||n.remove()),null===(e=document.getElementById("".concat(ye,"-").concat(this.platform,"-animation-style")))||void 0===e||e.remove(),document.getElementsByTagName("body")[0].style.overflow="auto";var r=document.getElementById(ke);null==r||r.remove(),this.removeRetentionPopup(this.platform),this.removeEventListener()}catch(e){console.error(e)}}},{key:"createPreloadApp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"1.0",n=ja(e,t),r=e.split(/_(?=[^_]*$)/)[0],o=Ha({renderDisplayType:F.popup,componentSign:e,analytics:{enabled:!1},productScene:r,productSceneVersion:t,environment:this.AMSSDK.options.env.environment,appVersion:this._appVersion,instanceId:"",isPreload:"true",mid:""}),i=o.path,a=o.locationSearch;return n.src="".concat(i,"?").concat(a),i||this.AMSSDK.logger.logError({title:"performance_optimization_preload_path_error"},{eventMessage:i}),n}},{key:"createApp",value:function(e){if(!0==!!window.postMessage){this._performanceData.push({key:"sdk_popup_start",value:Date.now()});try{var t,n,r,o,i,a,s=(null==e||null===(t=e.paymentSessionMetaData)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productSceneVersion)||"",l=(null==e||null===(n=e.paymentSessionMetaData)||void 0===n||null===(n=n.paymentSessionConfig)||void 0===n?void 0:n.productScene)||"",c=(null==e||null===(r=e.paymentSessionMetaData)||void 0===r?void 0:r.extendInfo)||"",u=null==e||null===(o=e.paymentSessionMetaData)||void 0===o?void 0:o.clientId,d=this.AMSSDK.options.env.environment;this.appDomain=function(e){var t=e.environment,n=e.appVersion,r=e.componentSign,o=e.productScene,i=e.productSceneVersion,a=e.extendInfo,s=e.mid,l=e.elementLink,c=/^https?:\/\/([^/<>\s]+\.?)*/.exec(Fa(t,n,r,o,i,a,s,!1,l));return c&&c[0]||""}({environment:d,appVersion:this._appVersion,componentSign:this._componentSign,productScene:l,productSceneVersion:s,extendInfo:c,mid:u,elementLink:null==e||null===(i=e.elementProps)||void 0===i?void 0:i.elementLink}),this.app=function(e,t){var n=document.createElement("iframe"),r={dropin:"ams-checkout-dropin-".concat(t),component:"ams-checkout-component-".concat(t)}[e]||"ams-checkout-component";return n.id=r,n.style.height="0",n.style.width="100%",n.style.border="0",n.style.opacity="0",n.style.overflow="hidden",n.allow="payment",n}(this.AMSSDK.options.mode,this.platform);var p=((null==e?void 0:e.sessionData)||"").split("&&")[1]||"",h=Ha({renderDisplayType:e.renderDisplayType,componentSign:this._componentSign,analytics:this.AMSSDK.options.analytics,productScene:l,productSceneVersion:s,environment:d,appVersion:this._appVersion,extendInfo:c,locale:this.AMSSDK.options.locale,instanceId:this.AMSSDK._instanceId,hostSign:p,mid:u,elementLink:null==e||null===(a=e.elementProps)||void 0===a?void 0:a.elementLink}),m=h.path,f=h.locationSearch;this._appLocationSearch=f,-1!==m.indexOf("?")?this.app.src="".concat(m,"&").concat(f):this.app.src="".concat(m,"?").concat(f),this.addEventListener()}catch(e){this.AMSSDK.logger.logError({title:"sdk_error_created_app_failed"}).send(),this.dispatchToSDK(ve.error.name,Object.assign({},me.SDK_COMPATIBILITY_ISSUES.FAILED_TO_CREATE_IFRAME,{stack:e}))}}else this.dispatchToSDK(ve.error.name,me.SDK_COMPATIBILITY_ISSUES.BROWSER_NOT_SUPPORT_POSTMESSAGE)}},{key:"listener",value:function(e){var t;if(e.origin===this.appDomain&&"react-devtools-content-script"!==(null===(t=e.data)||void 0===t?void 0:t.source))if(ct(e.data)){var n=JSON.parse(e.data);if(n.name!==ne.APP_TO_SDK&&n.name!==ne.APP_TO_APP||n.instanceId!==this.AMSSDK._instanceId)return;this._handleAppMessage(n)}else console.warn(me.NOT_JSON_FORMAT),this.dispatchToSDK(ve.error.name,me.NOT_JSON_FORMAT)}},{key:"resizeListener",value:function(e){var t,n;document.getElementById(ye).style.transition="none",this.dispatchToApp({context:{event:"renderResize",data:{heightOfVisible:(null==e||null===(t=e.target)||void 0===t?void 0:t.innerHeight)||window.innerHeight,widthOfVisible:(null==e||null===(n=e.target)||void 0===n?void 0:n.innerWidth)||window.innerWidth}}})}},{key:"createDialog",value:(a=s()(i()().mark((function e(t){var n,r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.url.includes("?")?"".concat(t.url,"&").concat(this._appLocationSearch):"".concat(t.url,"?").concat(this._appLocationSearch),e.prev=1,o=!1,e.next=5,ps({widthPadding:null==t?void 0:t.widthPadding,device:null!==(r=null==t?void 0:t.device)&&void 0!==r?r:this.platform,loadingConfig:null==t?void 0:t.loadingConfig,url:n});case 5:this.popupApp=e.sent,a=setTimeout((function(){if(!o)throw{title:"sdk_error_create_pop_up"}}),Re),s=setTimeout((function(){if(!o)throw{title:"sdk_error_pop_up_time_out"}}),3e3),this.popupApp.onload=function(){o=!0,us(),clearTimeout(a),clearTimeout(s)},e.next=15;break;case 11:e.prev=11,e.t0=e.catch(1),this.AMSSDK.logger.logError({title:(null===e.t0||void 0===e.t0?void 0:e.t0.title)||"sdk_error_create_pop_up"},{errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message,url:n}),this.dispatchToSDK(ve.error.name,me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT);case 15:case"end":return e.stop()}}),e,this,[[1,11]])}))),function(e){return a.apply(this,arguments)})},{key:"getDeviceIdAndCallback",value:(o=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t||!t.eventCallbackId){e.next=5;break}return e.next=3,this.getDeviceIdAndLog(null==t?void 0:t.data,!0);case 3:n=e.sent,this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:{deviceId:n}}});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"getUserAgentAndCallback",value:(r=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t&&t.eventCallbackId)try{this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:{userAgent:window.navigator.userAgent}}})}catch(e){}case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"returnDataAndCallback",value:(n=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:null!=t&&t.eventCallbackId&&(r=this._globalData.get(null===(n=t.data)||void 0===n?void 0:n.dataKey),this.dispatchToApp({context:{event:"appEventCallback",eventCallbackId:null==t?void 0:t.eventCallbackId,data:r}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"addEventListener",value:function(){this.removeEventListener(),window["".concat(Ie,"_").concat(this.AMSSDK._instanceId)]=this.listener.bind(this),window["".concat(Ie,"_").concat(this.AMSSDK._instanceId,"_resize")]=this.resizeListener.bind(this),window.addEventListener("message",window["".concat(Ie,"_").concat(this.AMSSDK._instanceId)]),window.addEventListener("resize",window["".concat(Ie,"_").concat(this.AMSSDK._instanceId,"_resize")])}},{key:"removeEventListener",value:function(){window.removeEventListener("message",window["".concat(Ie,"_").concat(this.AMSSDK._instanceId)]),window.removeEventListener("resize",window["".concat(Ie,"_").concat(this.AMSSDK._instanceId,"_resize")])}},{key:"elementEventCallback",value:function(e){var t,n,r;e.context.event===ve.sendMuitiAppEventToSdk.name&&(null===(t=e.context)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.source)===N.PAYMENT_ELEMENT&&(null===(n=e.context)||void 0===n||null===(n=n.data)||void 0===n?void 0:n.target)===N.CONTAINER_ELEMENT&&this.dispatchToSDK(ve.eventCallback.name,null===(r=e.context)||void 0===r||null===(r=r.data)||void 0===r?void 0:r.data)}},{key:"_handleAppMessage",value:function(e){var t,n,r=this;if(Object.keys(ve).map((function(e){return ve[e].name})).includes(e.context.event))if(e.context.event!==ve.getDeviceId.name)if(e.context.event!==ve.getUserAgentFromSdk.name){if(e.context.event===ve.popWindow.name)return o=document.querySelector(".".concat(Ne,"overlay")),i="desktop"===ds?document.querySelector(".".concat(Ne,"modal")):document.querySelector(".".concat(Ne,"modal-mobile")),o.classList.remove("".concat(Ne,"fadeIn")),o.classList.add("".concat(Ne,"fadeOut")),"desktop"===ds?(i.classList.remove("".concat(Ne,"fadeIn")),i.classList.add("".concat(Ne,"fadeOut"))):(i.classList.remove("".concat(Ne,"-drawer-enter")),i.classList.add("".concat(Ne,"-drawer-exit"))),void setTimeout((function(){var e,t;null===(e=o.parentNode)||void 0===e||e.removeChild(o),null===(t=i.parentNode)||void 0===t||t.removeChild(i)}),Me);var o,i,a,s;if(e.context.event!==ve.getGlobalData.name)if(e.context.event!==ve.setGlobalData.name)if(e.context.event!==ve.popupWindow.name){if(e.context.event===ve.sendMuitiAppEventToSdk.name)return this.elementEventCallback(e),void this.dispatchToApp({context:{event:"receiveMuitiAppFromSdk",data:e.context.data}});var l;if(e.context.event===ve.dismissLoading.name)return this.dismissLoadingFunc(!1),void this.dispatchToSDK(ve.eventCallback.name,{code:"SDK_END_OF_LOADING",message:(null===(l=e.context.data)||void 0===l?void 0:l.message)||""});if(e.context.event===ve.launch.name)return this._performanceData.push({key:"sdk_onLaunch",value:Date.now()}),this.AMSSDK.logger.logInfo({title:"sdk_event_webAppOnLaunch"}).send(),this._loadAppPromiseResolve&&this._loadAppPromiseResolve(!0),void this.sendRenderEvent();if(e.context.event===ve.sizeChanged.name&&this.handleSizeChanged(e),e.context.event===ve.close.name)return this.closeBtnFunc();if(e.context.event===ve.redirect.name)return this.handleRedirect(e.context.data);if(e.context.event!==ve.submitForm.name)if(e.context.event!==ve.hideCloseButton.name)if(e.context.event!==ve.showCloseButton.name)if(e.context.event!==ve.setMaskCloseButton.name){if(e.context.event===ve.setAllowRetention.name)return!0===e.context.data&&(this._isRetention=!0),void(!1===e.context.data&&(this._isRetention=!1));if(e.context.event!==ve.declareCheckoutInfo.name)if(e.context.event!==ve.declareEventCallbackInfo.name)if(e.context.event!==ve.appHeartBeat.name)if(e.context.event!==ve.beforeSubmit.name){var c,u,d;if(e.context.event===ve.eventCallback.name&&this.AMSSDK.logger.logInfo({title:"sdk_event_event_callback"}).send(),(null==e||null===(t=e.context)||void 0===t?void 0:t.event)!==ve.getGooglePayToken.name)if(e.context.event===ve.onPollingEnd.name&&this.dispatchToApp({context:{event:"onPollingEnd",data:e.context.data}}),e.context.event===ve.closePaymentPolling.name&&this.dispatchToApp({context:{event:ve.closePaymentPolling.name,data:e.context.data}}),(null==e||null===(n=e.context)||void 0===n?void 0:n.event)!==ve.getApplePayToken.name)if(e.context.event!==ve.validateFieldsResult.name){this.logEventCallback(e,"sdk_event_event_callback");try{this.dispatchToSDK(e.context.event,e.context.data,e.context.eventCallbackId),this.logEventCallback(e,"sdk_event_afterEventCallback")}catch(e){console.error(e)}}else this.AMSSDK._eventCenter.emit(ve.validateFieldsResult.forwardName,e.context);else new es({paymentSessionData:null===(c=this._renderParams)||void 0===c?void 0:c.sessionData,parseData:null===(u=this._renderParams)||void 0===u?void 0:u.paymentSessionMetaData,logger:this.AMSSDK.logger,env:this.AMSSDK.options.env.environment,shipping:null==e||null===(d=e.context)||void 0===d||null===(d=d.data)||void 0===d?void 0:d.shipping}).startPay().then((function(e){r.dispatchToApp({context:{event:"getApplePayToken",data:{success:!0,result:e}}})})).catch((function(e){r.dispatchToApp({context:{event:"getApplePayToken",data:{success:!1,result:e}}})}));else $a(e).then((function(e){r.dispatchToApp({context:{event:"getGooglePayToken",data:h()({},e)}})})).catch((function(e){r.dispatchToApp({context:{event:"getGooglePayToken",data:{err:e}}})}))}else{var p;if(null!==(p=this.AMSSDK._eventCenter)&&void 0!==p&&p.isExist(ve.beforeSubmit.name))return void this.AMSSDK._eventCenter.emit(ve.beforeSubmit.name,e.context.data);var m=He();this.dispatchToApp({context:{event:ve.beforeSubmitDone.name,eventCallbackId:m,data:{result:"IGNORE"}}})}else this.handleAppHeartBeat();else this._multipleCallbackEvents=e.context.data;else this.handleDeclareInfo(e.context.data)}else this.handleMaskCloseBtnShow(e.context.data);else this.handleCloseBtnShow(!0);else this.handleCloseBtnShow(!1);else this.submitForm(e.context.data)}else{var f;this.createDialog(null===(f=e.context)||void 0===f?void 0:f.data)}else this._globalData.set(null===(a=e.context.data)||void 0===a?void 0:a.dataKey,null===(s=e.context.data)||void 0===s?void 0:s.data);else this.returnDataAndCallback(e.context)}else this.getUserAgentAndCallback(e.context);else this.getDeviceIdAndCallback(e.context)}},{key:"logEventCallback",value:function(e,t){if(e.context.event===ve.eventCallback.name){var n,r="";try{var o;r=JSON.stringify((null==e||null===(o=e.context)||void 0===o?void 0:o.data)||"")}catch(e){console.error(e)}this.AMSSDK.logger.logInfo({title:t},{callbackData:r,callbackId:(null==e||null===(n=e.context)||void 0===n?void 0:n.eventCallbackId)||""}).send()}}},{key:"dismissLoadingFunc",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=document.getElementById(ke);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(Te))||void 0===e||e.remove()}},{key:"updateMaskCloseBtn",value:function(e){var t=document.getElementById("".concat(Ae));if(t)if("desktop"===this.platform){var n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;t.style.top="".concat((n-e.height)/2-42,"px"),t.style.right="".concat((r-e.width)/2+18,"px")}else t.style.bottom="".concat(e.height+2,"px")}},{key:"handleSizeChanged",value:function(e){var t,n,r,o,i,a,s,l,c=-1===(null==this||null===(t=this._renderParams)||void 0===t||null===(t=t.selector)||void 0===t||null===(n=t.indexOf)||void 0===n?void 0:n.call(t,"#"))?null==this||null===(r=this._renderParams)||void 0===r?void 0:r.selector:null==this||null===(o=this._renderParams)||void 0===o||null===(o=o.selector)||void 0===o||null===(i=o.slice)||void 0===i?void 0:i.call(o,1),u=(null==this||null===(a=this._renderParams)||void 0===a?void 0:a.appendAliasContainerId)?"".concat(ye,"-").concat(c):ye,d=document.getElementById(u);if(!((null===(s=e.context.data)||void 0===s?void 0:s.height)<=1||e.context.data.height===parseInt(null==d||null===(l=d.style)||void 0===l?void 0:l.height))){if(d.style.height="".concat(e.context.data.height,"px"),this.app.style.opacity="1",this._renderDisplayType===F.popup){if("desktop"===this.platform&&(e.context.data.width&&(d.style.width="".concat(e.context.data.width,"px")),d.classList.add("".concat(ye,"-").concat(this.platform,"-animation")),this.app.style.height="".concat(e.context.data.height,"px")),"mobile"===this.platform){d.classList.add("".concat(ye,"-").concat(this.platform,"-animation"));var p="".concat(ye,"-").concat(this.platform,"-animation-style"),h=document.getElementById(p);h&&(null==h||h.remove()),this.app.style.height=parseInt(this.app.style.height)>0?"100%":"".concat(e.context.data.height,"px");var m=(v=ye,g=e.context.data.height,"@keyframes ".concat(v,"-slide-in {\n 0% {\n height: 1px;\n }\n 100% {\n height: ").concat(g,"px;\n }\n }\n @keyframes ").concat(v,"-slide-out {\n 0% {\n height: ").concat(g,"px;\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n height: 1px;\n opacity: 0;\n }\n }")),f=document.createElement("style");f.id=p,f.type="text/css",f.innerHTML=m,document.getElementsByTagName("head")[0].appendChild(f),setTimeout((function(){d.style.transition="height 0.28s ease-in-out"}),500)}this.dismissLoadingFunc(),this.updateMaskCloseBtn(e.context.data)}var v,g,y;if(this._renderDisplayType===F.inline)null===(y=document.getElementById(Te))||void 0===y||y.remove(),this.app.style.height="".concat(e.context.data.height,"px")}}},{key:"handleAuthUrlInfo",value:function(e){var t={};t=null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{normalUrl:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl}:{normalUrl:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl},this.handleRedirect(t,!0)}},{key:"handleRedirect",value:function(e){var t,n,r,o,i,a,s=this,l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c="string"==typeof e?{normalUrl:e}:h()(h()({},e),{},{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(t=null==e?void 0:e.isDestroy)||void 0===t||t,isCallApp:null!==(n=null==e?void 0:e.isCallApp)&&void 0!==n&&n,callAppDetectSuccessDelay:null!==(r=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==r?r:2e3}),u={applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(o=null==e?void 0:e.isDestroy)||void 0===o||o,isCallApp:null!==(i=null==e?void 0:e.isCallApp)&&void 0!==i&&i,callAppDetectSuccessDelay:null!==(a=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==a?a:2e3};this.AMSSDK.logger.logInfo({title:"sdk_event_call_url_start"},{redirectInfo:JSON.stringify(u)}).send();var d=function(e,t,n){s.dispatchToSDK(ve.eventCallback.name,{code:ae.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(e,": ").concat(t)});var r={redirectInfo:JSON.stringify(c),openType:e,url:t,fromFastSdk:l};n&&(r.durationInSeconds=n),s.AMSSDK.logger.logInfo({title:"sdk_event_call_url_success"},r).send()},p=function(e,t,n){s.dispatchToSDK(ve.eventCallback.name,{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==c?void 0:c.applinkUrl," schemeUrl: ").concat(null==c?void 0:c.schemeUrl," normalUrl: ").concat(null==c?void 0:c.normalUrl)});var r={redirectInfo:JSON.stringify(c),openType:e,url:t,fromFastSdk:l};n&&(r.durationInSeconds=n),s.AMSSDK.logger.logInfo({title:"sdk_error_call_url_failed"},r).send()};if(c.target===re.BLANK)return c.normalUrl?(d(se.NormalUrl,c.normalUrl),void window.open(c.normalUrl)):p(se.NormalUrl,"");if(!(c.target!==re.REPLACE||null!=c&&c.applinkUrl||null!=c&&c.schemeUrl))return c.normalUrl?(d(se.NormalUrl,c.normalUrl),void window.location.replace(c.normalUrl)):p(se.NormalUrl,"");if(null!=c&&c.isDestroy&&this.cleanContainer(),null!=c&&c.isCallApp&&null!=c&&c.schemeUrl){var m=new Date,f="number"==typeof(null==e?void 0:e.callAppDetectSuccessDelay)?e.callAppDetectSuccessDelay:5e3;this.AMSSDK._redirect({schemeUrl:null==c?void 0:c.schemeUrl,callAppJudgeTime:f}).then((function(){var e=((new Date).getTime()-m.getTime())/1e3;d(se.SchemeUrl,null==c?void 0:c.schemeUrl,e)})).catch((function(){var e=((new Date).getTime()-m.getTime())/1e3;p(se.SchemeUrl,c.schemeUrl,e)}))}else this.AMSSDK._redirect({applinkUrl:null==c?void 0:c.applinkUrl}).then((function(){d(se.ApplinkUrl,null==c?void 0:c.applinkUrl)})).catch((function(){return null!=c&&c.applinkUrl&&p(se.ApplinkUrl,null==c?void 0:c.applinkUrl),s.AMSSDK._redirect({schemeUrl:null==c?void 0:c.schemeUrl})})).then((function(){d(se.SchemeUrl,null==c?void 0:c.schemeUrl)})).catch((function(){return null!=c&&c.schemeUrl&&p(se.SchemeUrl,null==c?void 0:c.schemeUrl),s.AMSSDK._redirect({normalUrl:null==c?void 0:c.normalUrl})})).then((function(){d(se.NormalUrl,null==c?void 0:c.normalUrl)})).catch((function(){p(se.NormalUrl,null==c?void 0:c.normalUrl)}))}},{key:"handleDeclareInfo",value:function(e){var t=e.closeDialogData;!function(e){var t=e.closeDialogData,n=void 0===t?{}:t;try{if(n){var r,o,i,a=document.getElementById("".concat(Se,"-title"));a&&(a.style.fontSize="".concat(null==n||null===(r=n.title)||void 0===r?void 0:r.fontSize,"px"),a.style.color=null==n||null===(o=n.title)||void 0===o?void 0:o.fontColor,a.innerHTML=null==n||null===(i=n.title)||void 0===i?void 0:i.text);var s,l,c,u=document.getElementById("".concat(Se,"-sub-title"));u&&(u.style.fontSize="".concat(null==n||null===(s=n.message)||void 0===s?void 0:s.fontSize,"px"),u.style.color=null==n||null===(l=n.message)||void 0===l?void 0:l.fontColor,u.innerHTML=null==n||null===(c=n.message)||void 0===c?void 0:c.text);var d,p,h,m,f,v,g,y=document.getElementById("".concat(Se,"-remain"));y&&(y.innerHTML=null==n||null===(d=n.btnOK)||void 0===d?void 0:d.text,y.style.fontSize="".concat(null==n||null===(p=n.btnOK)||void 0===p?void 0:p.fontSize,"px"),y.style.color=null==n||null===(h=n.btnOK)||void 0===h?void 0:h.fontColor,y.style.borderRadius="".concat(null==n||null===(m=n.btnOK)||void 0===m?void 0:m.corner,"px"),"stroke"===(null==n||null===(f=n.btnOK)||void 0===f?void 0:f.type)?y.style.border="1px solid ".concat(null==n||null===(g=n.btnOK)||void 0===g?void 0:g.bg):y.style.backgroundColor=null==n||null===(v=n.btnOK)||void 0===v?void 0:v.bg);var _,E,b,A,S,k,T,P=document.getElementById("".concat(Se,"-leave"));P&&(P.innerHTML=null==n||null===(_=n.btnCancel)||void 0===_?void 0:_.text,P.style.fontSize="".concat(null==n||null===(E=n.btnCancel)||void 0===E?void 0:E.fontSize,"px"),P.style.color=null==n||null===(b=n.btnCancel)||void 0===b?void 0:b.fontColor,P.style.borderRadius="".concat(null==n||null===(A=n.btnCancel)||void 0===A?void 0:A.corner,"px"),"stroke"===(null==n||null===(S=n.btnCancel)||void 0===S?void 0:S.type)?P.style.border="1px solid ".concat(null==n||null===(T=n.btnCancel)||void 0===T?void 0:T.bg):P.style.backgroundColor=null==n||null===(k=n.btnCancel)||void 0===k?void 0:k.bg)}}catch(e){console.error(e)}}({closeDialogData:void 0===t?{}:t})}},{key:"handleDeclarePopWindowCallback",value:function(){var e="popWindowEventInfo";if(this._multipleCallbackEvents&&e in this._multipleCallbackEvents){var t=this._multipleCallbackEvents[e];t.enableCallback&&this.dispatchToSDK(ve.eventCallback.name,{code:t.eventName,result:{result:t.eventResult||{}}})}else console.log("not valid ".concat(e," in "),this._multipleCallbackEvents)}},{key:"handleAppHeartBeat",value:function(){var e=this;try{this._webAppHeartBeatTimeoutFn||(this._webAppHeartBeatTimeoutFn=function(){e.isAppAttached()&&e.AMSSDK.logger.logError({title:"sdk_error_appHeartBeatTimeout"})}),window._webAppHeartBeatTimeoutId&&(clearTimeout(window._webAppHeartBeatTimeoutId),window._webAppHeartBeatTimeoutId=null),this._webAppHeartBeatTimeoutFn&&(window._webAppHeartBeatTimeoutId=setTimeout(this._webAppHeartBeatTimeoutFn,6e3)),setTimeout((function(){e.isAppAttached()&&e.dispatchToApp({context:{event:"sdkHeartBeat",data:{}}})}),1e3)}catch(e){this.AMSSDK.logger.logError({title:"sdk_error_handleAppHeartBeat"},{errorMessage:e.message})}}},{key:"isAppAttached",value:function(){return this.app||this.popupApp}},{key:"isWindowVisible",value:function(){var e;return"visible"===(null===(e=document)||void 0===e?void 0:e.visibilityState)}},{key:"handleCloseBtnShow",value:function(e){var t=document.getElementById(be);e?null==t||t.classList.remove("".concat(be,"-hidden")):!1===e&&(null==t||t.classList.add("".concat(be,"-hidden")))}},{key:"handleMaskCloseBtnShow",value:function(e){var t=document.getElementById(Ae);"show"===(null==e?void 0:e.status)?null==t||t.classList.remove("".concat(Ae,"-hidden")):null==t||t.classList.add("".concat(Ae,"-hidden"))}},{key:"dispatchToSDK",value:function(e,t,n){this.AMSSDK._eventCenter.emit(e,t),n&&this.AMSSDK._eventCenter.emit(n,t)}},{key:"dispatchToApp",value:function(e){var t,n,r,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=Object.assign({},e,{name:ne.SDK_TO_APP,mode:this.AMSSDK.options.mode,appId:fe,instanceId:this.AMSSDK._instanceId});if(i&&i.contentWindow)return i.contentWindow.postMessage(JSON.stringify(a),"*");if(this.app||this.popupApp)return(null==this||null===(t=this.app)||void 0===t?void 0:t.contentWindow)&&(null==this||null===(n=this.app)||void 0===n||n.contentWindow.postMessage(JSON.stringify(a),this.appDomain)),void((null==this||null===(r=this.popupApp)||void 0===r?void 0:r.contentWindow)&&(null==this||null===(o=this.popupApp)||void 0===o||o.contentWindow.postMessage(JSON.stringify(a),"*")));throw new Error(me.SDK_SUBMIT_ERROR.message)}},{key:"subscribeFromSDK",value:function(){var e={};for(var t in e)e.hasOwnProperty(t)&&this.AMSSDK._eventCenter.on("".concat(fe,"-").concat(t),e[t].bind(this))}},{key:"sendRenderEvent",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,m,f,v,g,y,_,E,b;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,_=this.AMSSDK.options.product===V.ELEMENT_ADDRESS,this._actionQueryPromise&&this._actionSubmitPromise||_){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,this._actionQueryPromise;case 6:return E=e.sent,e.next=9,this._actionSubmitPromise;case 9:b=e.sent,this._hasRenderComponent=!0,this._performanceData.push({key:"sdk_render_component",value:Date.now()}),this.dispatchToApp({context:{event:"renderComponent",data:{queryResult:E,submitResult:b,sessionResult:null===(t=this._renderParams)||void 0===t?void 0:t.paymentSessionMetaData,paymentSessionData:null===(n=this._renderParams)||void 0===n?void 0:n.sessionData,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:null===(r=this._renderParams)||void 0===r?void 0:r.renderDisplayType,appearance:null===(o=this._renderParams)||void 0===o?void 0:o.appearance,notRedirectAfterComplete:!0===(null===(a=this._renderParams)||void 0===a?void 0:a.notRedirectAfterComplete),isAppWebview:this._isAppWebview,isNativeAppWebview:this._isNativeAppWebview,merchantAppointParam:this._merchantAppointParam,allowSubmitPayCallAhead:this._allowSubmitPayCallAhead,configParams:null===(s=this._renderParams)||void 0===s?void 0:s.configParams,prefillValue:null===(l=this._renderParams)||void 0===l?void 0:l.prefillValue,componentSession:null===(c=this._renderParams)||void 0===c?void 0:c.componentSession,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:h()(h()({trackId:null===(u=this._renderParams)||void 0===u?void 0:u.sessionData,platform:this.platform,firstLogTime:null===(d=this.AMSSDK.logger)||void 0===d?void 0:d.getComponentStartTime()},(null===(p=this._renderParams)||void 0===p||null===(p=p.paymentSessionMetaData)||void 0===p?void 0:p.paymentSessionConfig)||{}),{},{renderDisplayType:null===(m=this._renderParams)||void 0===m?void 0:m.renderDisplayType,sdkVersion:this._appVersion,merchantId:null===(f=this._renderParams)||void 0===f||null===(f=f.paymentSessionMetaData)||void 0===f?void 0:f.clientId,instanceId:null===(v=this.AMSSDK)||void 0===v?void 0:v._instanceId,performanceData:this._performanceData,paymentMethodType:null===(g=this._renderParams)||void 0===g||null===(g=g.paymentSessionMetaData)||void 0===g||null===(g=g.paymentMethodInfoView)||void 0===g?void 0:g.paymentMethodType,skipRenderPaymentMethod:null===(y=this._renderParams)||void 0===y||null===(y=y.paymentSessionMetaData)||void 0===y?void 0:y.skipRenderPaymentMethod})}}},null),this.AMSSDK.logger.logInfo({title:"sdk_event_renderComponent"}),this.dispatchToApp({context:{event:"web-sdk-performance",data:{performanceData:this._performanceData}}}),e.next=19;break;case 17:e.prev=17,e.t0=e.catch(0);case 19:case"end":return e.stop()}}),e,this,[[0,17]])}))),function(){return t.apply(this,arguments)})},{key:"cleanContainer",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(e=document.getElementById(Ae))||void 0===e||e.remove(),null===(t=document.getElementById(Te))||void 0===t||t.remove(),this.hideComponentAnimation();var o=document.getElementById(ke);null==o||o.classList.add("".concat(ke,"-hidden")),this._loadAppPromiseResolve&&this._loadAppPromiseResolve(!0),this._performanceData=[],this._isInitComponent=!1,this.app=null,this._hasRenderComponent=!1,r?this.cleanElement():setTimeout((function(){n.cleanElement()}),300)}},{key:"hideComponentAnimation",value:function(){var e,t,n,r,o,i,a,s=-1===(null==this||null===(e=this._renderParams)||void 0===e||null===(e=e.selector)||void 0===e||null===(t=e.indexOf)||void 0===t?void 0:t.call(e,"#"))?null==this||null===(n=this._renderParams)||void 0===n?void 0:n.selector:null==this||null===(r=this._renderParams)||void 0===r||null===(r=r.selector)||void 0===r||null===(o=r.slice)||void 0===o?void 0:o.call(r,1),l=null!=this&&null!==(i=this._renderParams)&&void 0!==i&&i.appendAliasContainerId?"-".concat(s):"",c="".concat(ye).concat(l),u=document.getElementById(c);this.app&&u&&(this.app.style.height=null==u||null===(a=u.style)||void 0===a?void 0:a.height),u&&(u.style.transition="",null==u||u.classList.remove("".concat(c,"-").concat(this.platform)),null==u||u.classList.remove("".concat(c,"-").concat(this.platform,"-animation")),null==u||u.classList.add("".concat(c,"-hidden-").concat(this.platform)))}},{key:"closeBtnFunc",value:function(){this._isRetention?this.showRetentionPopup():(this.cleanContainer(),this.dispatchToSDK(ve.close.name,{}),this.handleDeclarePopWindowCallback())}},{key:"retentionPopupLeaveFunc",value:function(){this.dispatchToSDK(ve.close.name,{}),this.hideRetentionPopupFunc(),this.cleanContainer(),this.handleDeclarePopWindowCallback()}},{key:"removeRetentionPopup",value:function(e){!function(e,t,n){var r,o=e===te.mobile?"touchend":"click",i=document.getElementById("".concat(Se,"-remain"));i&&i.removeEventListener(o,t);var a=document.getElementById("".concat(Se,"-leave"));a&&a.removeEventListener(o,n),null===(r=document.getElementById(Se))||void 0===r||r.remove()}(e,this.hideRetentionPopupFunc.bind(this),this.retentionPopupLeaveFunc.bind(this))}},{key:"showRetentionPopup",value:function(){var e=document.getElementById(Se),t=document.getElementById(ye);e&&(null==t||t.classList.add("".concat(ye,"-opacity")),e.classList.remove("".concat(Se,"-hidden")),e.classList.add("".concat(Se,"-show")))}},{key:"hideRetentionPopupFunc",value:function(){var e,t;e=document.getElementById(Se),t=document.getElementById(ye),e&&(e.classList.remove("".concat(Se,"-show")),e.classList.add("".concat(Se,"-hidden")),setTimeout((function(){e.classList.remove("".concat(Se,"-hidden")),null==t||t.classList.remove("".concat(ye,"-opacity"))}),Me))}},{key:"submitForm",value:function(e){var t=e.attributes,n=document.body,r=document.createElement("form");r.setAttribute("height","1"),r.setAttribute("width","1"),Object.keys(t.data).forEach((function(e){var n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t.data[e]),r.appendChild(n)})),r.setAttribute("action",t.action),r.setAttribute("method","post"),n.appendChild(r),setTimeout((function(){r.submit()}),0)}},{key:"shouldValidateFields",value:function(){return this._hasRenderComponent}}]),e}(),gs=[{sessionMatcher:{productScene:V.CASHIER_PAYMENT,productSceneVersion:ce.V1,paymentMethodCategoryType:G.CARD,paymentMethodTypes:["APPLEPAY"]},paymentChannelMatcher:{paymentMethod:"ApplePay"},busActionNames:{canMakePayments:Sn.canMakePayments,optional_init:An.optional_init,createComponent:Sn.createComponent,destroyComponent:Sn.destroyComponent}},{sessionMatcher:{productScene:V.CASHIER_PAYMENT,productSceneVersion:ce.V1,paymentMethodCategoryType:G.APM,paymentMethodTypes:[le.PAYPAL_CHECKOUT,le.PAYPAL_PAYLATER,le.PAYPAL_VAULT]},paymentChannelMatcher:{paymentMethod:"Paypal"},busActionNames:{mountComponent:kn.mountComponent,destroyComponent:kn.destroyComponent}}],ys=function(e){return"boolean"!=typeof e||e},_s=function(e){_()(n,e);var t=b()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Ze()(r),"logger",void 0),c()(Ze()(r),"onEventCallback",(function(e){We.publish(new Ve(Tn.onEventCallback,JSON.stringify(e)))})),c()(Ze()(r),"appendPaypalLoading",(function(e){var t=e.selector;if(!document.querySelector(".paypal-loading")){var n=document.querySelector(t);n.innerHTML="";var r=document.createElement("div");r.className="paypal-loading",r.style.backgroundColor="#EBEBEB",r.style.width="100%",r.style.height="64px",r.style.borderRadius="4px";var o=document.createElement("div");o.style.position="absolute",o.style.top="50%",o.style.left="50%",o.style.transform="translate(-50%, -50%)",r.style.maxWidth="750px",r.style.position="relative",function(e){var t=e.htmlElement,n=e.loadingHeight,r=e.loadingWidth,o=document.createElement("img");o.src="https://mdn.alipayobjects.com/huamei_saktgs/afts/img/A*vmqbT6W9g4oAAAAAAAAAAAAADviCAQ/original",o.classList.add("atom-loading"),o.style.width=r,o.style.height=n,o.style.animation="loadingSpin 0.8s linear infinite";var i=document.createElement("style");i.textContent="\n @keyframes loadingSpin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n ",document.head.appendChild(i),t&&t.appendChild(o)}({htmlElement:o,loadingWidth:"25px",loadingHeight:"25px"}),r.appendChild(o),n.appendChild(r)}})),c()(Ze()(r),"removePaypalLoading",(function(){var e=document.querySelector(".paypal-loading");e&&e.remove()})),c()(Ze()(r),"preCheck",(function(e){var t,n,o=null===(t=e.paymentSessionFactor)||void 0===t||null===(t=t.paymentMethodInfo)||void 0===t||null===(t=t.paymentMethodMetaData)||void 0===t?void 0:t.boundPaymentMethod,i=null===(n=e.paymentSessionFactor)||void 0===n||null===(n=n.paymentMethodInfo)||void 0===n?void 0:n.paymentMethodType;return o&&le.PAYPAL_VAULT===i&&r.onEventCallback({code:ae.SDK_PAYMENT_WARN,message:"You can directly request the server interface without antom-sdk."}),Promise.resolve(e)})),c()(Ze()(r),"loadPaypalResource",(function(e){return new Promise((function(t,n){var o;ys(null===(o=e.appearance)||void 0===o?void 0:o.showLoading)&&r.appendPaypalLoading({selector:e.selector});var i=r.createPaypalScript(e);document.body.appendChild(i),i.onload=function(){t("loading successfully")},i.onerror=function(e){n(e)}}))})),c()(Ze()(r),"createPaypalScript",(function(e){var t,n,r,o,i=null===(t=e.paymentSessionFactor)||void 0===t||null===(t=t.merchantInfo)||void 0===t?void 0:t.channelMerchantClientId,a=null===(n=e.paymentSessionFactor)||void 0===n||null===(n=n.paypal)||void 0===n?void 0:n.accessToken,s=e.locale||"en_US",l=null===(r=e.paymentSessionFactor)||void 0===r||null===(r=r.paymentAmount)||void 0===r?void 0:r.currency,c=null===(o=e.paymentSessionFactor)||void 0===o||null===(o=o.paymentMethodInfo)||void 0===o?void 0:o.paymentMethodType,u=(null==e?void 0:e.paypalConfiguration)||{},d=u.blockPayPalCreditButton,p=u.blockPayPalPayLaterButton,h=u.displayPayPalPayLaterButtonOnly,m=u.enableMessages,f=u.intent,v=document.createElement("script"),g="https://www.paypal.com/sdk/js?",y=new URLSearchParams({currency:l,locale:s,"client-id":i}),_=["bancontact","blik","eps","giropay","ideal","mercadopago","mybank","p24","sepa","sofort"];return d&&!h&&_.push("card"),p&&!h&&_.push("credit"),_.length&&y.append("disable-funding",_.join(",")),m?y.append("components","messages,buttons"):y.append("components","buttons"),z.intent===f&&le.PAYPAL_CHECKOUT===c&&(y.append("intent","authorize"),y.append("commit","false")),le.PAYPAL_VAULT===c&&y.append("vault","true"),g+=y.toString(),v.src=g,v.setAttribute("data-user-id-token",a),v})),c()(Ze()(r),"onShippingChange",function(){var e=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:ae.SDK_PAYMENT_SHIPPINGCHANGE,result:{data:t}});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c()(Ze()(r),"createOrder",function(){var e=s()(i()().mark((function e(t,n,o,a,s){var l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ha({paymentSessionData:o,paymentSessionConfig:s},{env:a,timeout:15e3},r.logger);case 2:if(null!=(c=e.sent)&&c.success&&null!=c&&null!==(l=c.extendInfo)&&void 0!==l&&l.channelOrderId){e.next=7;break}return r.logger.logInfo({title:"paypal_payment_failed"}),r.onEventCallback({code:ae.SDK_PAYMENT_FAIL,message:(null==c?void 0:c.errorMessage)||"Create order failed."}),e.abrupt("return");case 7:return e.abrupt("return",c.extendInfo.channelOrderId);case 8:case"end":return e.stop()}}),e)})));return function(t,n,r,o,i){return e.apply(this,arguments)}}()),c()(Ze()(r),"onApprove",function(){var e=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:ae.SDK_PAYMENT_APPROVE,result:{onApproveData:t}}),r.logger&&Tt(r.logger.logInfo)&&r.logger.logInfo({title:"paypal_payment_approved"});case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c()(Ze()(r),"onCancel",function(){var e=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.onEventCallback({code:ae.SDK_PAYMENT_CANCEL,result:{orderId:t}}),r.logger&&Tt(r.logger.logInfo)&&r.logger.logInfo({title:"paypal_payment_cancelled"});case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),c()(Ze()(r),"destroyComponent",function(){var e=s()(i()().mark((function e(t,n){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=n.getJSONObject(),r.logger.logInfo({title:"sdk_event_clean_component"}).send(),document.querySelector(null==o?void 0:o.selector)&&(document.querySelector(null==o?void 0:o.selector).innerHTML="",console.log("paypal: destroy Component"));case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.logger=e,r}return f()(n,[{key:"actionNames",value:function(){return Object.values(kn)}},{key:"renderPaypalButton",value:function(e,t){var n,r,o,i,a,s,l,c,u=this,d=t.getJSONObject(),p={locale:null===(n=d.options)||void 0===n?void 0:n.locale,environment:null===(r=d.options)||void 0===r?void 0:r.environment,paymentSessionData:null===(o=d.appendParams)||void 0===o||null===(o=o.iframeNodesParams)||void 0===o?void 0:o.sessionData,paymentSessionFactor:null===(i=d.appendParams)||void 0===i||null===(i=i.iframeNodesParams)||void 0===i||null===(i=i.paymentSessionMetaData)||void 0===i?void 0:i.paymentSessionFactor,selector:null===(a=d.appendParams)||void 0===a||null===(a=a.iframeNodesParams)||void 0===a?void 0:a.selector,paypalConfiguration:null===(s=d.appendParams)||void 0===s||null===(s=s.iframeNodesParams)||void 0===s?void 0:s.paypalConfiguration,appearance:null===(l=d.appendParams)||void 0===l||null===(l=l.iframeNodesParams)||void 0===l?void 0:l.appearance,paymentSessionConfig:null===(c=d.appendParams)||void 0===c||null===(c=c.iframeNodesParams)||void 0===c||null===(c=c.paymentSessionMetaData)||void 0===c?void 0:c.paymentSessionConfig};return this.preCheck(p).then((function(e){return u.loadPaypalResource(e).then((function(){var t,n,r={style:h()({layout:"vertical",color:"gold",shape:"rect"},(null===(t=e.paypalConfiguration)||void 0===t?void 0:t.style)||{}),fundingSource:void 0,onShippingChange:u.onShippingChange,createOrder:function(t,n){return u.createOrder(t,n,e.paymentSessionData,e.environment,e.paymentSessionConfig)},onApprove:u.onApprove,onCancel:u.onCancel};null!==(n=e.paypalConfiguration)&&void 0!==n&&n.displayPayPalPayLaterButtonOnly&&(r.fundingSource=window.paypal.FUNDING.PAYLATER);try{window.paypal.Buttons(r).render(e.selector)}catch(e){return u.logger.logError({title:"button_render_failed"},{errorMessage:e}),u.onEventCallback({code:ae.SDK_PAYMENT_FAIL,message:"Button render failed."}),Promise.reject(e)}})).catch((function(e){return u.logger.logError({title:"paypal_payment_loadSDK_failed"}),u.onEventCallback({code:ae.SDK_PAYMENT_FAIL,message:"Loading paypal sdk failed."}),Promise.reject(e)})).finally((function(){var t;ys(null===(t=e.appearance)||void 0===t?void 0:t.showLoading)&&u.removePaypalLoading()}))}))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case kn.mountComponent:this.renderPaypalButton(e,t);break;case kn.destroyComponent:this.destroyComponent(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(ze),Es=function(e,t,n){return new Promise((function(r,o){var i=null;if("string"===at(t)&&(i=document.querySelector(t)),null===i){var a={code:me.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Failed to execute 'querySelector' on 'Document': ".concat(t," is not a valid selector")};return o(a),void e._dispatchToSDK({name:ne.APP_TO_SDK,instanceId:e.AMSSDK._instanceId,context:{event:ve.error.name,data:a}})}n===F.popup&&(i.innerHTML=""),e.app&&i.appendChild(e.app),r()}))},bs=function(e){var t=document.body||null;t&&t.appendChild(e)},As=function(e){_()(n,e);var t=b()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Ze()(r),"_onEventCallback",void 0),r._onEventCallback=e,r}return f()(n,[{key:"actionNames",value:function(){return Object.values(Tn)}},{key:"onEventCallback",value:function(e){var t=e.getJSONObject();console.log("onEventCallback",e),this._onEventCallback&&t&&this._onEventCallback(t)}},{key:"onMessage",value:function(e,t){if(t.getAction()===Tn.onEventCallback)this.onEventCallback(t);else console.log("Unknown action: "+t.getAction())}}]),n}(ze),Ss=function(e){_()(r,e);var t,n=b()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Ze()(t),"_onDeviceIdCallback",void 0),t._onDeviceIdCallback=e,t}return f()(r,[{key:"actionNames",value:function(){return Object.values(Pn)}},{key:"getSecurityDeviceId",value:(t=s()(i()().mark((function e(t,n){var r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(console.log("getSecurityDeviceId",n),!this._onDeviceIdCallback){e.next=22;break}if(r=n.getJSONObject(),e.prev=3,!r||null==r||!r.deviceIdParameter){e.next=11;break}return e.next=7,this._onDeviceIdCallback(null==r?void 0:r.deviceIdParameter,!0===(null==r?void 0:r.isPolling));case 7:o=e.sent,null==t||t.onCallBack(n.result(null!=o?o:"")),e.next=15;break;case 11:return e.next=13,this._onDeviceIdCallback();case 13:a=e.sent,null==t||t.onCallBack(n.result(null!=a?a:""));case 15:e.next=20;break;case 17:e.prev=17,e.t0=e.catch(3),null==t||t.onCallBack(n.result(""));case 20:e.next=23;break;case 22:null==t||t.onCallBack(n.result(""));case 23:case"end":return e.stop()}}),e,this,[[3,17]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===Pn.getSecurityDeviceId)this.getSecurityDeviceId(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(ze),ks=function(e){_()(r,e);var t,n=b()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Ze()(t),"logger",void 0),t.logger=e,t}return f()(r,[{key:"actionNames",value:function(){return Object.values(In)}},{key:"reportAnalytics",value:(t=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("reportAnalytics",n),r=n.getJSONObject(),this.logger&&null!=r&&r.basic&&("error"===(null==r?void 0:r.level)?this.logger.logError(null==r?void 0:r.basic,null==r?void 0:r.extra):this.logger.logInfo(null==r?void 0:r.basic,null==r?void 0:r.extra));case 3:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===In.reportAnalytics)this.reportAnalytics(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(ze),Ts=window.navigator.userAgent||"",Ps=function(){var e=Ts.match(/OS (\d+)_(\d+)_?(\d+)?/);return Number.parseInt(e[1],10)},Is=/android/i.test(Ts),Cs=/iphone|ipad|ipod/i.test(Ts),ws=/chrome\/[\d.]+ mobile safari\/[\d.]+/i.test(Ts)&&Is&&Ts.indexOf("Version")<0,Ns=/qqbrowser/i.test(Ts),Os=/firefox/i.test(Ts);/baidubrowser/i.test(Ts);function Rs(e){window.location.href=e}function Ms(e){var t=document.createElement("a");t.setAttribute("href",e),t.style.display="none",document.body.appendChild(t);var n=document.createEvent("HTMLEvents");n.initEvent("click",!1,!1),t.dispatchEvent(n)}function Ds(){hs||((hs=document.createElement("iframe")).id="callapp_iframe_".concat(Date.now()),hs.style.cssText="display:none;border:0;width:0;height:0;",document.body.appendChild(hs))}function Ls(e){hs.src=e}function xs(e,t){return function(e,t){var n=new URL(e);for(var r in t)r&&n.searchParams.set(r,t[r]);return n.toString()}(e,t)}function Us(e,t,n){var r="";n&&(r="S.browser_fallback_url=".concat(encodeURIComponent(n),";"));var o=e.substring(0,e.indexOf("://")),i=t?"#Intent;scheme=".concat(o,";package=").concat(t,";"):"#Intent;scheme=".concat(o,";"),a=e.replace(/.*?:\/\//,"intent://");return"".concat(a+i+r,"end")}var Ks,Bs,Ys,Fs=5e3;function Hs(e,t){Ks=+new Date,Bs=setTimeout((function(){!(!!ms&&document[ms])&&e&&e()}),t||5e3)}function js(e){void 0!==fs?document.addEventListener(fs,(function(){return Vs(e)})):window.addEventListener("pagehide",(function(){return Vs(e)}))}function Vs(e){var t=e.evokeAppBy;(null==t?void 0:t.url)&&(!function(e){var t=e.evokeAppBy,n=e.successCb,r=e.timeout;if(n){var o=+new Date,i=r||Fs;o-(Ks||+new Date)<i&&n(t)}}(e),Bs&&clearTimeout(Bs))}function Gs(e){return/^(http|https|itms-apps|itms-appss|market):\/\//.test(e)}function zs(e){return zs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zs(e)}function Ws(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ws(Object(n),!0).forEach((function(t){Js(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ws(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Js(e,t,n){return(t=Zs(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qs(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Zs(r.key),r)}}function Zs(e){var t=function(e,t){if("object"!==zs(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==zs(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===zs(t)?t:String(t)}!function(e){void 0!==e&&(void 0!==e.hidden?(ms="hidden",fs="visibilitychange"):void 0!==e.mozHidden?(ms="mozHidden",fs="mozvisibilitychange"):void 0!==e.msHidden?(ms="msHidden",fs="msvisibilitychange"):void 0!==e.webkitHidden&&(ms="webkitHidden",fs="webkitvisibilitychange"))}(document),function(e){e.SCHEME="Scheme",e.LINK="Link",e.INTENT="Intent"}(Ys||(Ys={}));var Xs=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=void 0,this.timer=void 0,this.options=void 0,this.evokeAppBy=void 0,this.handleDegradationStrategy=function(){var e=n.options,t=e.scheme,r=e.link,o=e.intent,i=e.params;r&&t?(n.options.link=xs(r,i),n.options.scheme=xs(t,i),Cs&&Ps()>9?n.evokeLink():n.evokeScheme(n.evokeLink.bind(n))):r?(n.options.link=xs(r,i),n.evokeLink()):t?(n.options.scheme=xs(t,i),n.evokeScheme()):o&&o.scheme&&o.package&&n.handleIntent()};this.config=qs(qs({},{delay:0}),t),this.options={},this.timer=null,this.evokeAppBy={url:"",type:Ys.LINK},this.init()}var t,n,r;return t=e,(n=[{key:"init",value:function(){Ds(),js({evokeAppBy:this.evokeAppBy,successCb:this.config.successCb,timeout:this.config.resultJudgmentTime})}},{key:"open",value:function(e){this.options=e;var t=this.options,n=t.scheme,r=t.intent,o=t.link;if(!n&&!o&&!(null==r?void 0:r.scheme))throw new Error("请至少填一个链接");if(n&&Gs(n))throw new Error("请填写正确格式的scheme");if(o&&!Gs(o))throw new Error("请填写正确格式的link");if(r&&r.scheme&&Gs(r.scheme))throw new Error("请填写正确格式的intent");this.handleDegradationStrategy()}},{key:"evokeLink",value:function(){this.evokeAppBy.type=Ys.LINK;var e=this.options,t=e.link,n=e.delay;this.evokeByLocationDelay(t,n)}},{key:"evokeScheme",value:function(e){this.evokeAppBy.type=Ys.SCHEME;var t=this.options,n=t.scheme,r=t.delay,o=t.fallback;Cs?Ps()>9||Ns?this.evokeByTagADelay(n,r,o,e):this.evokeByIFrameDelay(n,r,o,e):ws||Os?this.handleOriginalChrome():this.evokeByIFrameDelay(n,r,o,e)}},{key:"handleIntent",value:function(){var e,t=this,n=this.options,r=n.scheme,o=n.intent,i=n.delay,a=n.link,s=n.fallback,l=(null==o?void 0:o.scheme)||r;l&&!Gs(l)&&(this.evokeAppBy.type=Ys.INTENT,a&&(e=function(){return t.evokeLink()}),this.evokeByLocationDelay(Us(l,null==o?void 0:o.package,(null==o?void 0:o.fallbackUrl)||""),i,s,e))}},{key:"handleOriginalChrome",value:function(){this.handleIntent()}},{key:"evokeAppDelay",value:function(e,t,n,r,o){var i=this,a=n||this.config.delay,s=r||this.config.fallback;this.timer=setTimeout((function(){i.clearTimer(),e(),i.checkIsOpen(t,s,o)}),a)}},{key:"evokeByLocationDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return Rs(e)}),e,t,n,r)}},{key:"evokeByTagADelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return Ms(e)}),e,t,n,r)}},{key:"evokeByIFrameDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return Ls(e)}),e,t,n,r)}},{key:"checkIsOpen",value:function(e,t,n){return this.evokeAppBy.url=e,Hs(n||t,this.config.resultJudgmentTime)}},{key:"clearTimer",value:function(){this.timer&&clearTimeout(this.timer)}}])&&Qs(t.prototype,n),r&&Qs(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),$s=function(){function e(t){g()(this,e),c()(this,"options",void 0),c()(this,"originOptions",void 0),c()(this,"logger",void 0),c()(this,"_eventCenter",void 0),c()(this,"_instanceId",void 0),c()(this,"_storageId",void 0),c()(this,"_appendParams",void 0),c()(this,"_componentApp",void 0),c()(this,"securitySdkMap",void 0),c()(this,"plugins",void 0),this._instanceId=He(),this.originOptions=t,this.options={},this._eventCenter=new st,this._initEvent(t),this._setOptions(t),this.plugins=new Map,this.securitySdkMap=new Map;var n="AMSSDK_STORAGE_ID",r=kt(n);r||(kt(n,this._instanceId),r=this._instanceId),this._storageId=r,this.logger=new Ua(Ka,![X.prod,X.sandbox].includes(null==t?void 0:t.environment)),Ua.setInstance(this.logger),this.logger.setMedta({instanceId:this._instanceId}),this.logger.initTracker(),this.logger.setComponentStartTime(Date.now()),this.logger.setTrackId(this._instanceId),this.logger.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==t?void 0:t.environment,"_").concat(null==t?void 0:t.locale)}).send(),this.preInitSecurity(t)}var t;return f()(e,[{key:"preInitSecurity",value:function(e){var t,n="antomSDKConfigKey",r=yt(kt(n),{});if([X.prod,X.sandbox].includes(null==e?void 0:e.environment)){(function(){var e="antomSDKConfiglastCallTime",t=(new Date).getTime();try{var n=localStorage.getItem(e);if(n)return t-parseInt(n)>=6e5&&(localStorage.setItem(e,t.toString()),!0)}catch(e){}return localStorage.setItem(e,t.toString()),!0})()&&function(e,t){return fa.apply(this,arguments)}({env:this.options.env.environment},this.logger).then((function(e){kt(n,JSON.stringify(e))}));var o=(null===(t=this.options)||void 0===t?void 0:t.product)||V.EASY_PAY,i=!0;try{var a=r.pl_sec.find((function(e){var t,n,r,i=null==e||null===(t=e.v)||void 0===t?void 0:t.split("|")[0],a=(null==e||null===(n=e.v)||void 0===n?void 0:n.split("|")[1])||"999999.9.9",s=Nt(T,i)>=0&&Nt(a,T)>=0;return((null==e||null===(r=e.platform)||void 0===r?void 0:r.includes("Web"))||""===(null==e?void 0:e.platform))&&(null==e?void 0:e.product)===o&&(!(null!=e&&e.v)||s)}));i=!1!==(null==a?void 0:a.enable)}catch(e){}i&&this.initSecurity({product:o})}}},{key:"unmount",value:function(){var e;this.logger.logInfo({title:"sdk_event_apiOnDestroy"}).send();var t,n=null===(e=this.getBusActionNames())||void 0===e?void 0:e.destroyComponent;n&&We.isSubscribed(n)&&We.publish(new Ve(n,JSON.stringify({options:this.originOptions,selector:null===(t=this._appendParams)||void 0===t||null===(t=t.iframeNodesParams)||void 0===t?void 0:t.selector})));var r,o=d()(this.plugins.values());try{for(o.s();!(r=o.n()).done;){var i=r.value;try{i.logoutPlugin&&i.logoutPlugin()}catch(e){console.error(e)}}}catch(e){o.e(e)}finally{o.f()}}},{key:"initSecurity",value:function(e){var t=this,n=e.product,r=void 0===n?V.EASY_PAY:n,o=e.scene,i=void 0===o?V.EASY_PAY:o;this.logger.logInfo({title:"sdk_event_securitySdkPreInit"},{productScene:r}).send();var a=r||i,s=this.getSecurityConfigStorage(a).scene||vn(a),l=En.get(s);if(l){if("ready"===l.status)return console.log("[web-sdk] skip init security sdk because it is already loaded"),void this.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send();if("loading"===l.status)return console.log("[web-sdk] security sdk is already loading, waiting..."),void l.loadingPromise.then((function(){t.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send()})).catch((function(e){t.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:null==e?void 0:e.message},{productScene:r,sign:"Active initialization"}).send()}))}this._newSecuritySDKByScene({product:a,region:pn.SG},(function(){t.logger.logInfo({title:"sdk_event_securitySdkPreInitSuccess"},{productScene:r}).send()}),(function(e){t.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:e},{productScene:r,sign:"Active initialization"}).send()}))}},{key:"_getSecuritySDKByProductScene",value:function(e){var t=this.getSecurityConfigStorage(e.product).scene||vn(e.product),n=En.get(t);if(n)return"ready"===n.status?n.instance:void 0;var r=this.securitySdkMap.get(t);return r||(r=bn.getSecuritySdk(t))&&(console.log("[web-sdk] return security sdk from preloaded"),this.securitySdkMap.set(t,r)),r}},{key:"_awaitSecuritySDKByProductScene",value:(t=s()(i()().mark((function e(t){var n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.getSecurityConfigStorage(t.product),r=n.scene||vn(t.product),e.next=4,En.getInstance(r);case 4:return o=e.sent,e.abrupt("return",o);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_newSecuritySDKByScene",value:function(e,t,n){var r,o=this.getSecurityConfigStorage(e.product),i=o.scene||vn(e.product),a=o.h5gateway||fn(e.region),s=En.get(i);if(s){if("ready"===s.status)return void(t&&t());if("loading"===s.status)return void s.loadingPromise.then((function(){t&&t()})).catch((function(e){n&&n(null==e?void 0:e.message)}))}var l=gn(null===(r=this.options)||void 0===r||null===(r=r.env)||void 0===r?void 0:r.environment);un.getInstance().scheduleLoad({environment:l});try{var c,u=null===(c=this.options)||void 0===c||null===(c=c.env)||void 0===c?void 0:c.environment,d=new yn({scene:i,h5gateway:a,environment:u}),p=new Promise((function(e,r){d.initSecurity((function(){En.setReady(i,d),t&&t(),e(d)}),(function(e){En.setFailed(i,new Error(e||"Security init failed")),n&&n(e),r(new Error(e||"Security init failed"))}))}));En.setLoading(i,p),this.securitySdkMap.set(i,d)}catch(e){En.setFailed(i,new Error(null==e?void 0:e.toString())),n&&n(null==e?void 0:e.toString())}}},{key:"getSecurityConfigStorage",value:function(e){var t="",n="",r=kt(dn(e));if(r){var o=yt(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}},{key:"_setOptions",value:function(e){this._setMode(e),this._setEnv(e),this.options.locale=(null==e?void 0:e.locale)||"",this.options.product=null==e?void 0:e.product}},{key:"_setEnv",value:function(e){var t=Et()._moreEnv;null!=e&&e.environment&&!((null==e?void 0:e.environment)in X)&&"true"!==t&&(console.warn(me.INIT_PARAMETER_ERROR.ENVIRONMENT_ERROR.message),e.environment="prod"),this.options.env={terminalType:gt?ee.WAP:ee.WEB,environment:(null==e?void 0:e.environment)||"prod"},this.options.env.terminalType===ee.WAP&&(this.options.env.osType=ft?$.IOS:vt?$.ANDROID:$.ELSE)}},{key:"_setMode",value:function(e){this.options.mode=(null==e?void 0:e.mode)||Q.component,null!=e&&e.mode&&!((null==e?void 0:e.mode)in Q)&&(console.warn(me.INIT_PARAMETER_ERROR.MODE_ERROR.message),this.options.mode=Q.component),this.options.networkMode=(null==e?void 0:e.networkMode)||Z.session,null!=e&&e.networkMode&&!((null==e?void 0:e.networkMode)in Z)&&(console.warn(me.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),this.options.networkMode=Z.proxy)}},{key:"_initEvent",value:function(e){var t=this;if(null!=e&&e.onError){if("function"!==at(e.onError))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.error.name,e.onError,ve.error.uniqueKey)}if(null!=e&&e.onPaymentMethodSelected){if("function"!==at(e.onPaymentMethodSelected))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.paymentMethodSelected.name,e.onPaymentMethodSelected,ve.paymentMethodSelected.uniqueKey)}if(null!=e&&e.onSizeChanged){if("function"!==at(e.onSizeChanged))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.sizeChanged.name,e.onSizeChanged,ve.sizeChanged.uniqueKey)}if(null!=e&&e.onLog){if("function"!==at(e.onLog))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.log.name,e.onLog,ve.log.uniqueKey)}if(null!=e&&e.onEventCallback){if("function"!==at(e.onEventCallback))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.eventCallback.name,e.onEventCallback,ve.eventCallback.uniqueKey)}if(null!=e&&e.onClose){if("function"!==at(e.onClose))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.close.name,e.onClose,ve.close.uniqueKey)}if(null!=e&&e.onBeforeSubmit){if("function"!=typeof(null==e?void 0:e.onBeforeSubmit))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.beforeSubmit.name,function(){var n=s()(i()().mark((function n(r){var o,a;return i()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=He(),n.prev=1,n.next=4,e.onBeforeSubmit(r);case 4:a=n.sent,t._componentApp.dispatchToApp({context:{event:ve.beforeSubmitDone.name,eventCallbackId:o,data:a}}),n.next=12;break;case 8:n.prev=8,n.t0=n.catch(1),t._componentApp.dispatchToApp({context:{event:ve.beforeSubmitDone.name,eventCallbackId:o,data:{result:"ERROR"}}}),t.logger.logError({title:"sdk_error_before_submit",msg:JSON.stringify(n.t0)}).send();case 12:case"end":return n.stop()}}),n,null,[[1,8]])})));return function(e){return n.apply(this,arguments)}}(),ve.beforeSubmit.uniqueKey)}if(null!=e&&e.onChange){if("function"!==at(e.onChange))throw new Error(me.INIT_PARAMETER_ERROR.EVENT_ERROR.message);this._overrideSubscription(ve.onChange.name,e.onChange,ve.onChange.uniqueKey)}}},{key:"_registerPlugin",value:function(e,t){if(this.plugins.set(e,t),null!=t&&t.applyPlugin)try{t.applyPlugin(this)}catch(t){if(this.plugins.delete(e),"error"===at(t))throw t;throw new Error("Failed to register plug-in:".concat(e," Exception in the apply function of the plug-in"))}}},{key:"_getPlugin",value:function(e){return this.plugins.has(e)?this.plugins.get(e):(console.warn("".concat(e," Plugin unregistered")),null)}},{key:"_redirect",value:function(e){var t=this;return new Promise((function(n,r){var o=t.options.env.terminalType===ee.WEB,i=(null==e?void 0:e.normalUrl)||"",a=(null==e?void 0:e.schemeUrl)||"",s=(null==e?void 0:e.applinkUrl)||"",l=(null==e?void 0:e.callAppJudgeTime)||"",c=function(){if(i)return n(),void(window.location.href=i);r(me.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};o?c():function(){if(a||s){var e={fallback:function(){c()},successCb:function(){n()},delay:0};l&&(e.resultJudgmentTime=l);try{new Xs(e).open({scheme:a,link:s})}catch(e){c()}}else c()}()}))}},{key:"_overrideSubscription",value:function(e,t,n){this._eventCenter.off(e,t,n),this._eventCenter.on(e,t,n)}},{key:"getBusActionNames",value:function(){var e,t=this._appendParams;if(!t)return null;var n=null,r=null==t||null===(e=t.iframeNodesParams)||void 0===e||null===(e=e.paymentSessionMetaData)||void 0===e?void 0:e.paymentSessionConfig;if(r){var o,i=r.productScene+r.productSceneVersion+r.paymentMethodCategoryType,a=null==t||null===(o=t.iframeNodesParams)||void 0===o||null===(o=o.paymentSessionMetaData)||void 0===o||null===(o=o.paymentSessionFactor)||void 0===o||null===(o=o.paymentMethodInfo)||void 0===o?void 0:o.paymentMethodType;a&&(i+=a),n=this._getPlugin(i)}return this.options.product===V.ELEMENT_ADDRESS&&(n=this._getPlugin(V.ELEMENT_ADDRESS)),n}}]),e}();function el(e,t){return tl.apply(this,arguments)}function tl(){return tl=s()(i()().mark((function e(t,n){var r,o,a,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=(r=t||{}).frontModulesToBeLoaded,a=void 0===o?[]:o,l=r.paymentRequestId,Array.isArray(a)){e.next=3;break}return e.abrupt("return");case 3:if(0!==a.length){e.next=5;break}return e.abrupt("return");case 5:return e.abrupt("return",new Promise(function(){var e=s()(i()().mark((function e(t){var r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=function(e){return e.AIRWALLEX="AIRWALLEX",e}({}),o=[],n.logInfo({title:"load_channel_sdk_start"},{eventMessage:JSON.stringify(a),requestId:l}),a.forEach((function(e){var t=e.acquirerName,i=e.scriptUrl,a=null;t===r.AIRWALLEX?a=It({src:i,attrOptions:{defer:!0,id:"airwallex-fraud-api","data-order-session-id":l},timeOut:3},n):a=It({src:i,timeOut:3},n);o.push(a)})),e.next=6,Promise.all(o);case 6:t(!0);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 6:case"end":return e.stop()}}),e)}))),tl.apply(this,arguments)}var nl=function(e){var t=e.paymentSessionConfig,n=void 0===t?{}:t,r=n.productScene,o=void 0===r?"":r,i=n.paymentMethodCategoryType,a=void 0===i?"":i;return o&&a?"".concat(o,"_").concat(a):o?"".concat(o):j.NONE},rl=function(e){try{return[JSON.parse(Pt(e.split("&&")[3])),e.split("&&").slice(0,3).join("&&")]}catch(t){return console.error("Parsing sessionData is abnormal and may affect the payment link. Please ensure to use the new version of SDK."),[{},e]}},ol=function(e){var t=rl(e),n=tt()(t,2),r=n[0],o=n[1];return function(e){var t;_t()&&null!=e&&e.paymentSessionConfig&&e.paymentSessionConfig.productScene===V.EASY_PAY&&"BANKTRANSFER_QUICKPAY"!==(null==e||null===(t=e.paymentMethodInfoView)||void 0===t?void 0:t.paymentMethodType)&&(e.paymentSessionConfig.productSceneVersion="1.0")}(r),[null!=r?r:{},o]},il=function(e,t){var n=Object.assign({paymentSessionMetaData:{},renderDisplayType:F.popup},e),r=ol(n.sessionData||(null==n?void 0:n.paymentSessionData)),o=tt()(r,2),i=o[0],a=o[1],s=nl(i);if($e()(Object.values(H)).includes(s)&&n.renderDisplayType===F.popup&&-1===window.location.href.indexOf("popup=true"))return Promise.reject({code:me.CREATEPAYMENT_PARAMETER_ERROR.code,message:"unsupported payment method"});if(t.options.product===V.ELEMENT_ADDRESS&&(s=j.ELEMENT_ADDRESS),s===j.NONE)return Promise.reject({code:me.CREATEPAYMENT_PARAMETER_ERROR.code,message:"Abnormal response data, interface failure, or unsupported payment method"});if(i&&null!=i&&i.securityConfig){var l,c=null==i||null===(l=i.paymentSessionConfig)||void 0===l?void 0:l.productScene;kt(dn(c),JSON.stringify(null==i?void 0:i.securityConfig))}return n.sessionData=a,n.paymentSessionMetaData=i,Promise.resolve({iframeNodesParams:n,componentSign:s})},al=function(e){_()(r,e);var t,n=b()(r);function r(e){var t;g()(this,r),t=n.call(this,e),c()(Ze()(t),"channelType",void 0),c()(Ze()(t),"productSceneVersion",void 0),c()(Ze()(t),"timer",void 0),c()(Ze()(t),"_validateResolveMap",new Map);var o=new vs({appVersion:e.appVersion});return o.setRender(Es),o.setPreloadRender(bs),t._registerPlugin(fe,o),t._componentApp=t._getPlugin(fe),t.registerBusAbility(),t}return f()(r,[{key:"parameterInitAndCheck",value:function(e){var t=e.params,n=e.selector,r=e.renderDisplayType;this.options.mode=Q.component,this.options.networkMode=this.options.networkMode||Z.session;var o=Object.assign({selector:n,renderDisplayType:r},t);return this.options.product===V.ELEMENT_ADDRESS||!o||o.sessionData||null!=o&&o.paymentSessionData?this.options.networkMode===Z.proxy?(console.warn(me.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),Promise.reject(me.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT)):Promise.resolve(o):Promise.reject(me.CREATEPAYMENT_PARAMETER_ERROR)}},{key:"pluginAppendIframe",value:(t=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=(t||{}).iframeNodesParams.paymentSessionMetaData,r=(n||{}).paymentSessionFactor,e.next=5,el(r,this.logger);case 5:return e.abrupt("return",this._componentApp.appendIframeNodes(t.componentSign,t.iframeNodesParams));case 8:return e.prev=8,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 11:case"end":return e.stop()}}),e,this,[[0,8]])}))),function(e){return t.apply(this,arguments)})},{key:"savePreviousChannel",value:function(e){var t=(e||{}).paymentSessionMetaData.paymentSessionConfig,n=t.productScene,r=void 0===n?"":n,o=t.paymentMethodCategoryType,i=void 0===o?"":o,a=t.productSceneVersion,s=void 0===a?"":a,l="".concat(r,"_").concat(i);if(r&&i&&s){Array.isArray(this.channelType)&&this.channelType.includes(l)&&this.productSceneVersion===s?this.logger.logInfo({title:"preload_match"},{eventMessage:l,productSceneVersion:s}):this.logger.logInfo({title:"preload_no_match"},{eventMessage:l,productSceneVersion:s});var c={channelType:l===j.VAULTING_CARD?j.CASHIER_PAYMENT_CARD:l,productSceneVersion:s};localStorage.setItem("antom_checkout_previousChannel",JSON.stringify(c))}}},{key:"registerBusAbility",value:function(){var e,t=this;We.debugTrace((null===(e=this.originOptions)||void 0===e?void 0:e.environment)!==X.prod,this.logger),We.clear(),We.addInterceptor({onPublishException:function(e,n){t.logger.logError({title:"onBusPublishException"},h()(h()({},e),{},{errorMessage:JSON.stringify(n)}))}}),We.subscribe(new As((function(e){var n;null===(n=t._componentApp)||void 0===n||null===(n=n.AMSSDK)||void 0===n||n._eventCenter.emit(ve.eventCallback.name,e)}))),We.subscribe(new Ss((function(e,n){var r;return null===(r=t._componentApp)||void 0===r?void 0:r.getDeviceIdAndLog(e,n)}))),We.subscribe(new ks(this.logger)),We.subscribe(new Sa(this.logger)),We.subscribe(new _s(this.logger)),gs.forEach((function(e){var n;null!=e&&e.busSubscriber&&We.subscribe(null==e?void 0:e.busSubscriber);var r=e.paymentChannelMatcher;r&&t._registerPlugin(r.paymentMethod,e.busActionNames);var o=e.sessionMatcher;if(o){var i=o.productScene+o.productSceneVersion+o.paymentMethodCategoryType;o.paymentMethodTypes?o.paymentMethodTypes.forEach((function(n){var r=i+n;t._registerPlugin(r,e.busActionNames)})):t._registerPlugin(i,e.busActionNames)}var a=null==e||null===(n=e.busActionNames)||void 0===n?void 0:n.optional_init;a&&We.publish(new Ve(a,JSON.stringify(t.originOptions)))}))}},{key:"canMakePayments",value:function(e,t){var n=this;return new Promise((function(r){var o;if(!e)return r(!0);var i=null===(o=n._getPlugin(e))||void 0===o?void 0:o.canMakePayments;i&&We.isSubscribed(i)?We.publishForResult(new Ve(i,JSON.stringify({paymentMethod:e,subPaymentMethod:t})),{fallback:!1}).then((function(e){r(e.getJSONObject())})).catch((function(e){n.logger.logInfo({title:"canMakePayments_error"},{errorMessage:JSON.stringify(e)}),r(!1)})):r(!0)}))}},{key:"createComponent",value:function(e){var t=this;return this.clearPreloadIframe(),this.logger.setComponentStartTime(Date.now()),this.parameterInitAndCheck({params:e,renderDisplayType:F.popup}).then((function(e){return il(e,t)})).catch((function(n){return t.logger.logError({title:"sdk_error_parameter"},{params:JSON.stringify(e)}).send(),t._eventCenter.emit(ve.error.name,n),Promise.reject(n)})).then((function(e){var n=e.iframeNodesParams;return t.logger.setTrackId(null==n?void 0:n.sessionData),t.createComponentProcess(e)}))}},{key:"createComponentProcess",value:function(e){var t;this._appendParams=e;var n=null===(t=this.getBusActionNames())||void 0===t?void 0:t.createComponent;if(n&&We.isSubscribed(n))return We.publish(new Ve(n,JSON.stringify({appendParams:e,options:this.originOptions}))),Promise.resolve();var r=e.iframeNodesParams;return this.savePreviousChannel(r),this.pluginAppendIframe(e)}},{key:"preloadComponent",value:function(e,t){var n=this;if(bn.isWebAppPreloaded)console.log("[web-sdk] web app already preloaded");else{this.channelType=e,this.productSceneVersion=t;if(Array.isArray(e))for(var r=0;r<e.length;r++)this._componentApp.appendPreloadIframeNodes(e[r],t);else this.logger.logError({title:"performance_optimization_channelType_error"},{eventMessage:e});this.timer=setTimeout((function(){n.clearPreloadIframe(!0)}),1e4)}}},{key:"clearPreloadIframe",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e&&clearTimeout(this.timer),Array.isArray(this.channelType))for(var t=0;t<this.channelType.length;t++){var n=document.getElementById("ams-checkout-component-".concat(this.channelType[t],"-").concat(this.productSceneVersion));n&&document.body.removeChild(n)}e?this.logger.logInfo({title:"performance_optimization_clearPreloadIframe_timeout"}):this.logger.logInfo({title:"performance_optimization_clearPreloadIframe"})}},{key:"mountComponent",value:function(e,t){var n=this;return this.clearPreloadIframe(),this.logger.setComponentStartTime(Date.now()),this.parameterInitAndCheck({params:e,renderDisplayType:F.inline,selector:t}).then((function(e){return il(e,n)})).catch((function(t){return n.logger.logError({title:"sdk_error_parameter"},{params:JSON.stringify(e)}).send(),n._eventCenter.emit(ve.error.name,t),Promise.reject(t)})).then((function(e){var t=e.iframeNodesParams;return n.logger.setTrackId(null==t?void 0:t.sessionData),n.mountComponentProcess(e)}))}},{key:"mountComponentProcess",value:function(e){var t;this._appendParams=e;var n=null===(t=this.getBusActionNames())||void 0===t?void 0:t.mountComponent;if(n&&We.isSubscribed(n))return We.publish(new Ve(n,JSON.stringify({appendParams:e,options:this.originOptions}))),Promise.resolve();var r=e.iframeNodesParams;return this.options.product!==V.ELEMENT_ADDRESS&&this.savePreviousChannel(r),this.pluginAppendIframe(e)}},{key:"submit",value:function(e){var t=this;return new Promise((function(n,r){try{var o,i=He();t.logger.logInfo({title:"sdk_event_apiSubmit"});var a=null===(o=t.getBusActionNames())||void 0===o?void 0:o.submit;a&&We.isSubscribed(a)?We.publishForResult(new Ve(a,JSON.stringify({appendParams:t._appendParams,options:t.originOptions,data:e}))).then((function(e){n(null==e?void 0:e.getJSONObject())})):(t._eventCenter.once(i,(function(e){n(e)})),t._componentApp.dispatchToApp({context:{event:"submitPay",eventCallbackId:i,data:e}}))}catch(e){r(e)}}))}},{key:"_validateFields",value:function(){var e=this;return new Promise((function(t){if(!e._componentApp.shouldValidateFields())return t({isValid:!1}),void e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:"notRenderComponent"});var n,r=new Promise((function(t){var n=He();e._validateResolveMap.set(n,t),e._sendMessageToAPP({event:ge.name,data:{},eventCallbackId:n});var r=function(){var t=s()(i()().mark((function t(n){var r,o,a;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=(null==n?void 0:n.eventCallbackId)||"",o=e._validateResolveMap.get(r),a={isValid:!1},i=null==n?void 0:n.data,"object"===Je()(i)&&null!==i&&"boolean"==typeof i.isValid&&(a=null==n?void 0:n.data),e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:a.isValid?"true":"false"}),o&&(o(a),e._validateResolveMap.delete(r));case 6:case"end":return t.stop()}var i}),t)})));return function(e){return t.apply(this,arguments)}}();e._overrideSubscription(ve.validateFieldsResult.forwardName,r,ve.validateFieldsResult.uniqueKey)})),o=new Promise((function(t){n=setTimeout((function(){e.logger.logInfo({title:"sdk_event_validateFields"},{processResult:"timeout"}),t({isValid:!1})}),15e3)}));Promise.race([r,o]).then((function(e){clearTimeout(n),t(e)})).catch((function(){clearTimeout(n),t({isValid:!1})}))}))}},{key:"_sendMessageToAPP",value:function(e){this._componentApp.dispatchToApp({context:e})}}]),r}($s),sl=function(e){_()(n,e);var t=b()(n);function n(e){return g()(this,n),t.call(this,e)}return f()(n,[{key:"getValue",value:function(e){var t=this;return new Promise((function(n,r){try{var o,i=He();t.logger.logInfo({title:"sdk_event_apiGetValue"});var a=null===(o=t.getBusActionNames())||void 0===o?void 0:o.getValue;a&&We.isSubscribed(a)?We.publishForResult(new Ve(a,JSON.stringify({appendParams:t._appendParams,options:t.originOptions,data:e}))).then((function(e){n(null==e?void 0:e.getJSONObject())})):(t._eventCenter.once(i,(function(e){n(e)})),t._componentApp.dispatchToApp({context:{event:"getValue",eventCallbackId:i,data:e}}))}catch(e){r(e)}}))}}]),n}(al);function ll(e,t){return function(e){var t=e?"elements2":"elements",n=location.origin,r=localStorage.getItem("antom-web-checkout-v2_app_document_prefix");return r&&(n=r),"".concat(n,"/").concat(t,"/").concat(localStorage.getItem("ANTOM_LOCAL")?"src/pages":"pages")}(t)+(e.startsWith("/")?e:"/".concat(e))}function cl(){var e=window.localStorage.getItem("antom-web-checkout-v2_app_env")||"dev";"pre"!==e&&"local"!==e||"true"!==window.localStorage.getItem("antom-web-checkout-v2_sandbox_enabled")||(e="sandbox");var t=window.localStorage.getItem("antom-web-checkout-v2_base_url")||void 0,n=window.localStorage.getItem("antom-web-checkout-v2_group_id")||void 0,r=JSON.parse(JSON.stringify({baseURL:t,groupId:n,env:e}));return console.log("[getDevReqConfig] dev request config:",r),r}function ul(e){var t,n=(null==e?void 0:e.supportedLanguages)||[],r=d()(n);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o.preferred&&o.locale)return o.locale}}catch(e){r.e(e)}finally{r.f()}}var dl=n(4606),pl=n.n(dl),hl=n(731),ml=n.n(hl),fl={i18nPrefix:"OPENSDK"},vl=function(e){y(n,e);var t=E(n);function n(e,r,o,i){var a,s,c,u=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];v(this,n);var d,p=i,h=void 0;return e&&"object"===qe(e)?(d=e.message,h=e.params):d=e,c=t.call(this,!fl.i18n||u&&"SERVER_API"===o?d:fl.i18n.get({id:"".concat(fl.i18nPrefix,".").concat(r),dm:(null===(a=(s=fl).getDefaultMessage)||void 0===a?void 0:a.call(s))||d},h)),l(Qe(c),"code",void 0),l(Qe(c),"name","OpenSDKError"),l(Qe(c),"_openSDKErrorFlag","__OpenSDKErrorFlag__"),l(Qe(c),"source","SDK_INTERNAL"),l(Qe(c),"traceId",void 0),l(Qe(c),"reason",void 0),c.reason=d,c.code=r,c.source=o,c.traceId=p,c}return m(n,[{key:"toJSON",value:function(){var e={message:this.message,code:this.code,source:this.source,traceId:this.traceId,reason:this.reason,stack:this.stack};return JSON.parse(JSON.stringify(e))}}],[{key:"isError",value:function(e){return e instanceof n||e instanceof Error&&"__OpenSDKErrorFlag__"===e._openSDKErrorFlag}},{key:"unificationError",value:function(e){var t,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"APP_RUNTIME";if(n.isError(e))return e;var i=new gl(e instanceof Error?e.message:(null===(t=(r=fl).getDefaultMessage)||void 0===t?void 0:t.call(r))||"An unknown error occurred.","UNKNOWN_ERROR",o);return i}},{key:"initConfig",value:function(e){fl=p(p({},fl),e)}}]),n}(I(Error)),gl=function(e){y(n,e);var t=E(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Qe(e),"name","SDKBridgeError"),e}return m(n)}(vl),yl=function(e){return Xe(new Set(e))},_l=function(e,t){return e.filter((function(e){return!t.includes(e)}))},El=function(e,t){return e.filter((function(e){return t.includes(e)}))},bl=function(e){return"bigint"==typeof e||!Number.isNaN(Number(e))&&Math.floor(Number(e))===e},Al=function(e){return"bigint"==typeof e||e>=0&&Number.isSafeInteger(e)};function Sl(e,t){if(0===t.length)return e;for(var n,r=Xe(e),o=r.length-1,i=0,a=0;o>0;o--,i++){a+=n=t[i%=t.length].codePointAt(0);var s=(n+i+a)%o,l=r[o],c=r[s];r[s]=l,r[o]=c}return r}var kl=function(e,t){return e.reduce((function(n,r){var o=t.indexOf(r);if(-1===o)throw new Error("The provided ID (".concat(e.join(""),") is invalid, as it contains characters that do not exist in the alphabet (").concat(t.join(""),")"));if("bigint"==typeof n)return n*BigInt(t.length)+BigInt(o);var i=n*t.length+o;return Number.isSafeInteger(i)?i:(Nl("Unable to decode the provided string, due to lack of support for BigInt numbers in the current environment"),BigInt(n)*BigInt(t.length)+BigInt(o))}),0)},Tl=/^\+?\d+$/,Pl=function(e){if(!Tl.test(e))return Number.NaN;var t=Number.parseInt(e,10);return Number.isSafeInteger(t)?t:(Nl("Unable to encode the provided BigInt string without loss of information due to lack of support for BigInt type in the current environment"),BigInt(e))},Il=function(e){return new RegExp(e.map((function(e){return wl(e)})).sort((function(e,t){return t.length-e.length})).join("|"))},Cl=function(e){return new RegExp("^[".concat(e.map((function(e){return wl(e)})).sort((function(e,t){return t.length-e.length})).join(""),"]+$"))},wl=function(e){return e.replace(/[\s#$()*+,.?[\\\]^{|}-]/g,"\\$&")},Nl=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"BigInt is not available in this environment";if("function"!=typeof BigInt)throw new TypeError(e)},Ol=3.5,Rl=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"cfhistuCFHISTU";if(v(this,e),this.minLength=n,"number"!=typeof n)throw new TypeError("Hashids: Provided 'minLength' has to be a number (is ".concat(qe(n),")"));if("string"!=typeof t)throw new TypeError("Hashids: Provided 'salt' has to be a string (is ".concat(qe(t),")"));if("string"!=typeof r)throw new TypeError("Hashids: Provided alphabet has to be a string (is ".concat(qe(r),")"));var i=Array.from(t),a=Array.from(r),s=Array.from(o);this.salt=i;var l=yl(a);if(l.length<16)throw new Error("Hashids: alphabet must contain at least ".concat(16," unique characters, provided: ").concat(l.join("")));this.alphabet=_l(l,s);var c,u,d,p=El(s,l);(this.seps=Sl(p,i),0===this.seps.length||this.alphabet.length/this.seps.length>Ol)&&((c=Math.ceil(this.alphabet.length/Ol))>this.seps.length&&(u=c-this.seps.length,(d=this.seps).push.apply(d,Xe(this.alphabet.slice(0,u))),this.alphabet=this.alphabet.slice(u)));this.alphabet=Sl(this.alphabet,i);var h=Math.ceil(this.alphabet.length/12);this.alphabet.length<3?(this.guards=this.seps.slice(0,h),this.seps=this.seps.slice(h)):(this.guards=this.alphabet.slice(0,h),this.alphabet=this.alphabet.slice(h)),this.guardsRegExp=Il(this.guards),this.sepsRegExp=Il(this.seps),this.allowedCharsRegExp=Cl([].concat(Xe(this.alphabet),Xe(this.guards),Xe(this.seps)))}return m(e,[{key:"encode",value:function(e){for(var t="",n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=Array.isArray(e)?e:[].concat(Xe(null!=e?[e]:[]),r);return 0===i.length?t:(i.every(bl)||(i=i.map((function(e){return"bigint"==typeof e||"number"==typeof e?e:Pl(String(e))}))),i.every(Al)?this._encode(i).join(""):t)}},{key:"decode",value:function(e){return e&&"string"==typeof e&&0!==e.length?this._decode(e):[]}},{key:"encodeHex",value:function(e){var t=e;switch(qe(t)){case"bigint":t=t.toString(16);break;case"string":if(!/^[\dA-Fa-f]+$/.test(t))return"";break;default:throw new Error("Hashids: The provided value is neither a string, nor a BigInt (got: ".concat(qe(t),")"))}var n,r,o,i=(n=t,r=12,o=function(e){return Number.parseInt("1".concat(e),16)},Array.from({length:Math.ceil(n.length/r)},(function(e,t){return o(n.slice(t*r,(t+1)*r))})));return this.encode(i)}},{key:"decodeHex",value:function(e){return this.decode(e).map((function(e){return e.toString(16).slice(1)})).join("")}},{key:"isValidId",value:function(e){return this.allowedCharsRegExp.test(e)}},{key:"_encode",value:function(e){var t=this,n=this.alphabet,r=e.reduce((function(e,t,n){return e+("bigint"==typeof t?Number(t%BigInt(n+100)):t%(n+100))}),0),o=[n[r%n.length]],i=Xe(o),a=this.seps,s=this.guards;if(e.forEach((function(r,s){var l,c=i.concat(t.salt,n),u=function(e,t){var n=[],r=e;if("bigint"==typeof r){var o=BigInt(t.length);do{n.unshift(t[Number(r%o)]),r/=o}while(r>BigInt(0))}else do{n.unshift(t[r%t.length]),r=Math.floor(r/t.length)}while(r>0);return n}(r,n=Sl(n,c));if((l=o).push.apply(l,Xe(u)),s+1<e.length){var d=u[0].codePointAt(0)+s,p="bigint"==typeof r?Number(r%BigInt(d)):r%d;o.push(a[p%a.length])}})),o.length<this.minLength){var l=(r+o[0].codePointAt(0))%s.length;if(o.unshift(s[l]),o.length<this.minLength){var c=(r+o[2].codePointAt(0))%s.length;o.push(s[c])}}for(var u=Math.floor(n.length/2);o.length<this.minLength;){var d,p;n=Sl(n,n),(d=o).unshift.apply(d,Xe(n.slice(u))),(p=o).push.apply(p,Xe(n.slice(0,u)));var h=o.length-this.minLength;if(h>0){var m=h/2;o=o.slice(m,m+this.minLength)}}return o}},{key:"_decode",value:function(e){if(!this.isValidId(e))throw new Error("The provided ID (".concat(e,") is invalid, as it contains characters that do not exist in the alphabet (").concat(this.guards.join("")).concat(this.seps.join("")).concat(this.alphabet.join(""),")"));var t=e.split(this.guardsRegExp),n=t[3===t.length||2===t.length?1:0];if(0===n.length)return[];var r,o=n[Symbol.iterator]().next().value,i=n.slice(o.length).split(this.sepsRegExp),a=this.alphabet,s=[],l=u(i);try{for(l.s();!(r=l.n()).done;){var c=r.value,d=Sl(a,[o].concat(Xe(this.salt),Xe(a)).slice(0,a.length));s.push(kl(Array.from(c),d)),a=d}}catch(e){l.e(e)}finally{l.f()}return this._encode(s).join("")!==e?[]:s}}]),e}(),Ml=new Rl("intl-open-sdk",6);function Dl(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){var r,o=new Promise((function(e,o){r=setTimeout((function(){n?o(n):e(void 0)}),t)}));return Promise.race([o,e.apply(void 0,arguments)]).finally((function(){return clearTimeout(r)}))}}var Ll=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e+Ml.encode("".concat(Date.now()).concat(Math.ceil(100*Math.random())))};function xl(e){if("onpagehide"in self){var t=function(t){t.persisted||e("pagehide")};return self.addEventListener("pagehide",t),function(){return self.removeEventListener("pagehide",t)}}if("undefined"!=typeof document&&void 0!==document.visibilityState){var n=!1,r=function(){"hidden"!==document.visibilityState||n||(n=!0,e("visibilitychange"))};return document.addEventListener("visibilitychange",r),function(){return document.removeEventListener("visibilitychange",r)}}var o=self,i=function(){e("beforeunload")};return o.addEventListener("beforeunload",i),function(){return o.removeEventListener("beforeunload",i)}}var Ul=function(){function e(t,n){var r=this;v(this,e),l(this,"targetPort",void 0),l(this,"handlers",new Map),l(this,"debugCallback",void 0),l(this,"name",void 0),l(this,"initialized",!1),l(this,"recipientIsReady",!1),l(this,"handleMessage",(function(e){var t=e.data,n=t.type,o=t.payload,i=r.handlers.get(n);i&&(r.debugCallback&&r.debugCallback(p(p({},e.data),{},{type:"MODAL_PORT@"+e.data.type}),"IN"),i.forEach((function(e){e(o)})))})),this.targetPort=n,n.onmessage=this.handleMessage,this.name=t,this.once("ready",(function(){r.recipientIsReady=!0}))}return m(e,[{key:"setDebugCallback",value:function(e){this.debugCallback=e}},{key:"onData",value:function(e){return this.initialized||(this.send("ready"),this.initialized=!0),this.on("data",e)}},{key:"sendData",value:function(e){var t=this;this.recipientIsReady?this.send("data",e):this.once("ready",(function(){t.recipientIsReady=!0,t.send("data",e)}))}},{key:"onClose",value:function(e){var t=this;return new Promise((function(n,r){t.on("close",function(){var i=a(o().mark((function i(a){return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(a.name!==t.name){o.next=10;break}return o.prev=1,o.next=4,e(a.manual);case 4:n(),o.next=10;break;case 7:o.prev=7,o.t0=o.catch(1),r(o.t0);case 10:case"end":return o.stop()}}),i,null,[[1,7]])})));return function(e){return i.apply(this,arguments)}}())}))}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.send("close",{name:this.name,manual:e}),new Promise((function(){}))}},{key:"on",value:function(e,t){var n=this;return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),function(){n.handlers.get(e).delete(t)}}},{key:"once",value:function(e,t){var n=this,r=function r(o){try{t(o)}finally{n.off(e,r)}};return this.on(e,r),function(){n.off(e,r)}}},{key:"off",value:function(e,t){var n=this.handlers.get(e);n&&n.delete(t)}},{key:"send",value:function(e,t){var n={id:Ll("modal_port_"),type:e,payload:t};this.debugCallback&&this.debugCallback(p(p({},n),{},{type:"MODAL_PORT@"+n.type}),"OUT"),this.targetPort.postMessage(n)}}]),e}(),Kl=function(){function e(t){v(this,e),l(this,"targetPorts",[]),l(this,"name",void 0),this.name=t}var t;return m(e,[{key:"addPort",value:function(e){var t;(t=this.targetPorts).push.apply(t,Xe(e))}},{key:"removePort",value:function(e){this.targetPorts=this.targetPorts.filter((function(t){return e!==t}))}},{key:"getValues",value:(t=a(o().mark((function e(t){var n,r,i=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(null==t?void 0:t.timeout)||1e4,r=Dl((function(){return Promise.all(i.targetPorts.map((function(e){return new Promise((function(t,n){e.postMessage({id:Math.random()+"",type:"".concat(i.name,":START_COLLECT_VALUE")}),e.onmessage=function(e){var r=e.data;if(r&&r.type){var o=r.type.split(":"),i=et(o,2),a=i[0];"SEND_ELEMENT_VALUE"===i[1]&&t(l({},a,r.payload))}else n(new Error("collect error"))}}))}))).then((function(e){return e.reduce((function(e,t){return p(p({},e),t)}),{})}))}),n),e.abrupt("return",r());case 3:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}]),e}(),Bl=function(){function e(t,n){v(this,e),l(this,"targetPort",void 0),l(this,"name",void 0),this.targetPort=n,this.name=t}return m(e,[{key:"onSendRequest",value:function(e){this.targetPort.onmessage=function(){var t=a(o().mark((function t(n){var r,i,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((r=n.data)&&r.type){t.next=3;break}return t.abrupt("return");case 3:i=r.type.split(":"),a=et(i,2),a[0],"START_COLLECT_VALUE"===a[1]&&e();case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}},{key:"send",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={id:Math.random()+"",payload:e,type:"".concat(this.name,":SEND_ELEMENT_VALUE")};this.targetPort.postMessage(t)}}]),e}(),Yl="OPENSDK@HANDSHAKE",Fl="OPENSDK@READY_HANDSHAKE",Hl="OPENSDK@UPDATE_CONFIG",jl="OPENSDK@UPDATE_CONFIG_REPLY",Vl="OPENSDK@SUBMIT",Gl="OPENSDK@SUBMIT_REPLY",zl="OPENSDK@REDIRECT",Wl="OPENSDK@OPEN_MODAL",ql="OPENSDK@OPEN_MODAL_ERROR",Jl="OPENSDK@CLOSE_MODAL",Ql="OPENSDK@ERROR",Zl="OPENSDK@HANDSHAKE_ACK",Xl="OPENSDK@TRANSFER_RECEIVE_PORT",$l="OPENSDK@MESSAGE",ec="OPENSDK@TRANSFER_SEND_PORT",tc="OPENSDK@TRANSFER_APP_PORT",nc="OPENSDK@MODAL_TRANSFER_READY",rc="OPENSDK@TRANSFER_MODAL_PORT",oc="OPENSDK@TRANSFER_MODAL_APPEARANCE",ic="OPENSDK@TRANSFER_MODAL_INITIALDATA",sc="OPENSDK@HEIGHT_UPDATE",lc="OPENSDK@DESTROY_ELEMENT",cc=n(245),uc=[Xl,ec,rc,oc,ic,ql,tc,nc,Jl,Wl,zl,$l,lc],dc="@@global",pc="@@native",hc=function(){function e(t,n,r){var o,i,a=this;(v(this,e),l(this,"targetWindow",void 0),l(this,"currentWindow",void 0),l(this,"targetOrigin","*"),l(this,"scope",void 0),l(this,"handlers",new Map),l(this,"mode",void 0),l(this,"resizeObserver",void 0),l(this,"debugCallback",void 0),l(this,"receivePort",void 0),l(this,"openModalOff",void 0),l(this,"openModalPromise",void 0),l(this,"handleMessage",(function(e){var t=e.data;if(t&&"string"==typeof t.type){var n=t.type.split(":"),r=et(n,2),o=r[0],i=r[1];if(a.scope!==pc){if(!["WEBAPP","HOST"].includes(i))return;if("*"!==a.targetOrigin&&e.origin!==a.targetOrigin)return;if(a.mode===i)return}var s=a.handlers.get(t.type);a.scope!==pc&&(s||t.type.endsWith(Ql)||t.type.endsWith($l))&&a.debugCallback&&a.scope===o&&a.debugCallback(t,"IN"),s&&new Set(s).forEach((function(n){n.length>=3?n(t.payload,e.ports,{origin:e.origin,source:e.source}):n(t.payload,e.ports)}))}})),this.mode=t,this.scope=n,this.currentWindow=r||window,"WEBAPP"===this.mode)&&(this.targetWindow=null===(i=this.currentWindow)||void 0===i?void 0:i.parent);Object.defineProperties(this,{targetWindow:{value:this.targetWindow,writable:!0,enumerable:!1,configurable:!0},currentWindow:{value:this.currentWindow,writable:!0,enumerable:!1,configurable:!0}}),null===(o=this.currentWindow)||void 0===o||o.addEventListener("message",this.handleMessage)}return m(e,[{key:"setTarget",value:function(e){this.targetWindow=e}},{key:"setOrigin",value:function(e){this.targetOrigin=e}},{key:"setDebugCallback",value:function(e){this.debugCallback=e}},{key:"destroy",value:function(){var e,t;null===(e=this.currentWindow)||void 0===e||e.removeEventListener("message",this.handleMessage),this.handlers.clear(),null===(t=this.resizeObserver)||void 0===t||t.disconnect()}},{key:"_addPort",value:function(e){var t;this._transferPort(Xl,null===(t=this.receivePort)||void 0===t?void 0:t.name,e)}},{key:"_transferReceivePort",value:function(e){this._transferPort(Xl,e.name,e.targetPorts)}},{key:"_transferSendPort",value:function(e){this._transferPort(ec,e.name,[e.targetPort])}},{key:"send",value:function(e,t,n){var r;if(!this.targetWindow)return console.warn("[Bridge] Target window not set. Cannot send message:",e),void(null===(r=this.debugCallback)||void 0===r||r.call(this,{id:Ll("bridge"),type:"SYSTEM_".concat(Ql),payload:{message:"Target window not set"}},"OUT"));var o={id:Ll("bridge"),type:this.getOriginSendType(e),payload:t};this.debugCallback&&this.debugCallback(o,"OUT"),this.targetWindow.postMessage(o,this.targetOrigin,n)}},{key:"sendError",value:function(e){"WEBAPP"===this.mode&&this.send(Ql,e.toJSON())}},{key:"sendSubmit",value:function(e){"WEBAPP"===this.mode&&this.send(Gl,e)}},{key:"sendMessage",value:function(e,t){"WEBAPP"===this.mode&&this.send($l,{type:e,message:t})}},{key:"sendRedirect",value:function(e){if("WEBAPP"===this.mode){if(!e.url)throw new gl("url is required","INVALID_REDIRECT_URL","SDK_INTERNAL");try{new URL(e.url)}catch(e){throw new gl("Invalid URL","INVALID_REDIRECT_URL","SDK_INTERNAL")}this.send(zl,e)}}},{key:"redirect",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"redirect";if("WEBAPP"===this.mode){if(!e)throw new gl("url is required","INVALID_REDIRECT_URL","SDK_INTERNAL");try{new URL(e)}catch(e){throw new gl("Invalid URL","INVALID_REDIRECT_URL","SDK_INTERNAL")}this.send(zl,{url:e,mode:t})}}},{key:"sendDestroyElement",value:function(e){e||(e=this.scope),"WEBAPP"===this.mode&&this.send(lc,{elementKey:e})}},{key:"openModal",value:function(e,t){var n,r=this;if(this.openModalPromise)return this.openModalPromise;var o=Ll("modal_");this.send(Wl,p(p({},e),{},{scope:this.scope,initialData:t,modalId:o})),null===(n=this.openModalOff)||void 0===n||n.call(this);var i=new Promise((function(e,t){var n=function(){},o=function(){},i=function(){n(),o(),r.openModalOff=void 0,r.openModalPromise=void 0};n=r.once(ql,(function(e){i(),t(new vl(e.message,e.code,e.source))}));o=r.on(tc,(function(n,r){if(null==r||!r[0])return i(),void t(new gl("No ports transferred for modal communication","NO_PORTS_ERROR","SDK_INTERNAL"));i(),e(new Ul(n,r[0]))})),r.openModalOff=i}));return this.openModalPromise=i,i}},{key:"closeModal",value:function(){var e;null===(e=this.openModalOff)||void 0===e||e.call(this),this.send(Jl)}},{key:"on",value:function(e,t){var n=this,r=this.getOriginListenType(e);return this.handlers.has(r)||this.handlers.set(r,new Set),this.handlers.get(r).add(t),function(){n.handlers.get(r).delete(t)}}},{key:"once",value:function(e,t){var n=this,r=function r(o,i,a){try{t(o,i,a)}finally{n.off(e,r)}};return this.on(e,r),function(){n.off(e,r)}}},{key:"off",value:function(e,t){var n=this.getOriginListenType(e),r=this.handlers.get(n);r&&r.delete(t)}},{key:"handsShake",value:function(e,t){var n=this;if("WEBAPP"!==this.mode)throw new gl("handsShake can only be called in WEBAPP mode","UNKNOWN_ERROR","SDK_INTERNAL");var r=this.on(Yl,function(){var r=a(o().mark((function r(i){var a,s;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:"GROUP"===(null==i?void 0:i.elementMode)?i.isMainElement?n.getReceivePort().then((function(e){t(i,e)})):n.getSendPort().then((function(e){t(i,e)})).catch((function(){t(i)})):t(i),a=0,s=cc((function(e){(Math.abs(e-a)>10||Math.abs((e-a)/a)>.01)&&(a=e,n.send(sc,e))}),400),n.resizeObserver=new ResizeObserver((function(e){var t,n=null==e||null===(t=e[0])||void 0===t?void 0:t.contentRect;n&&s(n.height)})),n.resizeObserver.observe(document.body),n.send(Zl,{version:e});case 6:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}());return this.send(Fl),function(){var e;r(),null===(e=n.resizeObserver)||void 0===e||e.disconnect()}}},{key:"getOriginListenType",value:function(e){if("error"===e&&(e=Ql),this.scope===pc)return e;var t=uc.includes(e)?dc:this.scope;return"".concat(t,":").concat("WEBAPP"===this.mode?"HOST":"WEBAPP",":").concat(e)}},{key:"getOriginSendType",value:function(e){if("error"===e&&(e=Ql),this.scope===pc)return e;var t=uc.includes(e)?dc:this.scope;return"".concat(t,":").concat(this.mode,":").concat(e)}},{key:"_transferPort",value:function(e,t,n){this.targetWindow?"HOST"===this.mode&&this.targetWindow.postMessage({id:Ll(),type:this.getOriginSendType(e),payload:t},this.targetOrigin,n):console.warn("[Bridge] Target window not set. Cannot send port")}},{key:"getReceivePort",value:function(){var e=this;return new Promise((function(t){e.on(Xl,(function(n,r){e.receivePort||(e.receivePort=new Kl(n)),r&&e.receivePort.addPort(r),t(e.receivePort)}))}))}},{key:"getSendPort",value:function(){var e=this;return new Promise((function(t,n){e.on(ec,(function(e,r){if(r){var o=new Bl(e,r[0]);t(o)}else n(new Error("no ports transfer"))}))}))}}],[{key:"getGlobalBridge",value:function(t){return new e(t,dc)}},{key:"getNativeBridge",value:function(t){return new e("WEBAPP",pc,t)}},{key:"getBridge",value:function(t,n){if(n===pc||n===dc)throw new Error("Scope cannot be ".concat(pc," or ").concat(dc));return new e(t,n)}}]),e}(),mc=n(7578),fc=n.n(mc),vc=n(1762),gc=["trackId","userPathAuto","keyFormat"],yc=function(){function e(t){v(this,e),l(this,"options",void 0),l(this,"intlTrackerOptions",void 0),l(this,"tracker",void 0),l(this,"trackerInitPromise",void 0),l(this,"trackId",void 0),this.initialOptions(t)}var t;return m(e,[{key:"initialOptions",value:function(e){var t,n,r,o,i=e||{},a=(i.trackId,i.userPathAuto),s=i.keyFormat,l=mc(i,gc);(this.options=p(p(p({env:"DEV",compactExtraInfo:!0},this.options),l),{},{appId:(null==e?void 0:e.appId)||(null===(t=this.options)||void 0===t?void 0:t.appId)||"180020050100012557",performance:!0===(null==e?void 0:e.performance)||!0===(null===(n=this.options)||void 0===n?void 0:n.performance),error:!0===(null==e?void 0:e.error)||!0===(null===(r=this.options)||void 0===r?void 0:r.error)}),this.intlTrackerOptions=p(p({},this.options),{},{userPathAuto:a,keyFormat:s}),e&&"trackId"in e)&&(this.trackId=e.trackId||"",this.options=p(p(p({},this.options),l),{},{mdata:p(p(p({},null===(o=this.options)||void 0===o?void 0:o.mdata),l.mdata),{},{trackId:this.trackId})}));return this.options}},{key:"loadTacker",value:function(e){var t=this,n=(0,vc.loadScript)("https://cdn.marmot-cloud.com/tnpm-package/@antintl-intl-tracker/1.3.0/dist/common.min.js","CompatibleTrackerFull");return n?n.then((function(n){var r=n.variable;if(r)return new r(t.initialOptions(e))})):Promise.resolve(void 0)}},{key:"initTracker",value:(t=a(o().mark((function e(t){var n,r=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.tracker||t){e.next=2;break}return e.abrupt("return",this.tracker);case 2:if(t||!this.trackerInitPromise){e.next=4;break}return e.abrupt("return",this.trackerInitPromise);case 4:if(n=this.loadTacker(t).then((function(e){var n,o,i,a,s,l;return e&&(e.set({keyFormat:null!==(n=null!==(o=null==t?void 0:t.keyFormat)&&void 0!==o?o:null===(i=r.intlTrackerOptions)||void 0===i?void 0:i.keyFormat)&&void 0!==n?n:"origin",userPathAuto:null!==(a=null!==(s=null==t?void 0:t.userPathAuto)&&void 0!==s?s:null===(l=r.intlTrackerOptions)||void 0===l?void 0:l.userPathAuto)&&void 0!==a&&a}),r.tracker=e),e})),t){e.next=8;break}return this.trackerInitPromise=n.finally((function(){r.trackerInitPromise=void 0})),e.abrupt("return",this.trackerInitPromise);case 8:return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"safeCall",value:function(e){return this.initTracker().then(e)}},{key:"setTrackId",value:function(e){this.trackId=e,this.set({mdata:{trackId:e}})}},{key:"set",value:function(e){this.safeCall((function(t){return null==t?void 0:t.set(e)}))}},{key:"pv",value:function(){this.safeCall((function(e){return null==e?void 0:e.pv()}))}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.trackId&&(t[0].d18=this.trackId),this.safeCall((function(e){return null==e?void 0:e.log.apply(e,t)}))}},{key:"click",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.click.apply(e,t)}))}},{key:"expo",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.expo.apply(e,t)}))}},{key:"onSendData",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.onSendData.apply(e,t)}))}},{key:"offSendData",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.offSendData.apply(e,t)}))}},{key:"pageMonitor",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.pageMonitor.apply(e,t)}))}},{key:"reportCustomizedPerformance",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.safeCall((function(e){return null==e?void 0:e.reportCustomizedPerformance.apply(e,t)}))}}]),e}(),_c=new yc;var Ec=n(5270);function bc(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Ec.apply(void 0,[{},e].concat(n))}var Ac=new yc({appId:"180020050100012557",performance:!1,error:!1,env:"DEV",compactExtraInfo:!0}),Sc="7981",kc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return function(t){Ac.log(p({code:"".concat(Sc).concat(e)},t))}},Tc=kc(),Pc=kc("event"),Ic=kc("mount"),Cc=kc("handshake"),wc=kc("merchant"),Nc=kc("element"),Oc=function(){if(window.sdkDebugger)return Promise.resolve(window.sdkDebugger);var e="2.0.6".replace(/-dev\.[0-9]+/,""),t="https://cdn.marmot-cloud.com/tnpm-package/@antintl-opensdk-debugger/1.0.6/dist/main.umd.js";return t="https://marmot-local-dev.oss-accelerate.aliyuncs.com/tnpm-package/@antintl-opensdk-debugger/".concat(e,"/dist/main.umd.js"),(0,vc.loadScript)(t,"sdkDebugger").then((function(e){return e.variable}))},Rc=function(e,t,n,r){var o;if("ERROR"===e){var i=r||{};Tc({msg:i.code||n,d1:t,d2:i.reason,d3:i.stack,d4:i.traceId,d5:i.operationType,d6:n})}else{if(n.includes(":HOST:")||n.includes(":WEBAPP:")){var a=n.split(":"),s=et(a,3),l=s[0],c=s[1],u=s[2];Pc({msg:u,d1:t,d2:l,d3:c,d4:JSON.stringify(r),d5:"无",d6:e})}}null===(o=window.sdkDebugger)||void 0===o||o.log(e,t,n,r)},Mc=function(e){if(e){var t=function(e){var t=e.message,n=e.traceId,r=e.code,o=e.source,i=e.stack,a=e.reason;if("SERVER_API"===e.source){var s=(null==n?void 0:n.match(/([a-z0-9\sA-Z]*)(\s*\(([a-zA-Z0-9\.]*)\))?/))||[],l=et(s,4),c=(l[0],l[1]),u=(l[2],{code:r,source:o,message:t,operationType:l[3],traceId:(null==c?void 0:c.replace(/\s/g,""))||"无traceID",stack:i,reason:a});return JSON.parse(JSON.stringify(u))}return e}(vl.isError(e)?e.toJSON():e);Rc("ERROR",t.source,t.operationType||t.message||"Unknown Error",t)}},Dc=function(e){y(n,e);var t=E(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Qe(e),"name","SDKInternalError"),e}return m(n)}(vl),Lc=function(e){y(n,e);var t=E(n);function n(e){return v(this,n),t.call(this,"HOST",e)}return m(n,[{key:"_transferReceivePort",value:function(e){dl(hl(n.prototype),"_transferReceivePort",this).call(this,e)}},{key:"_addPort",value:function(e){dl(hl(n.prototype),"_addPort",this).call(this,e)}},{key:"_transferSendPort",value:function(e){dl(hl(n.prototype),"_transferSendPort",this).call(this,e)}},{key:"setTarget",value:function(e){dl(hl(n.prototype),"setTarget",this).call(this,e)}},{key:"setDebugCallback",value:function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];(e=dl(hl(n.prototype),"setDebugCallback",this)).call.apply(e,[this].concat(r))}}],[{key:"getGlobalBridge",value:function(){return hc.getGlobalBridge("HOST")}}]),n}(hc),xc=function(e){y(n,e);var t=E(n);function n(e,r,o){var i;return v(this,n),i=t.call(this,e,r,o||"SDK_USAGE"),l(Qe(i),"name","MountError"),i}return m(n)}(Dc),Uc=function(e){return new Dc("Element destroyed, previous status: ".concat(e),"ELEMENT_INSTANCE_DESTROYED","SDK_USAGE")},Kc=function(){function e(t,n){v(this,e),l(this,"name",void 0),l(this,"_elementMode",void 0),l(this,"_isMainElement",void 0),l(this,"config",void 0),l(this,"bridge",void 0),l(this,"hooks",{}),l(this,"iframe",null),l(this,"status",void 0),l(this,"cachedSend",[]),l(this,"submitPromise",void 0),this.config=n,this._isMainElement=n.isMainElement,this._elementMode=n.elementMode,this.name=t,this.bridge=new Lc(t),this.bridge.setOrigin(n.targetOrigin),n.trackId&&Ac.setTrackId(n.trackId),this.bridge.setDebugCallback((function(e,t){try{if(e.type.endsWith(Hl)||e.type.endsWith(sc))return;var n,r;if(e.type.endsWith($l))Rc(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message);else e.type.endsWith(Ql)&&"IN"===t?Mc(e.payload):Rc("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload)}catch(e){}})),this.status="initialized"}var t,n,r,i,s;return m(e,[{key:"submit",value:function(e){throw new Dc("This element not support submit","NOT_SUPPORT_SUBMIT","SDK_USAGE")}},{key:"setup",value:(s=a(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",void 0);case 1:case"end":return e.stop()}}),e)}))),function(){return s.apply(this,arguments)})},{key:"_setup",value:(i=a(o().mark((function e(){var t,n,r,i,s=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=function(){return"destroyed"===s.status})()){e.next=3;break}return e.abrupt("return");case 3:return n=function(){},r=new Promise((function(e,t){n=s._addHook("ondestroy",(function(e){return t(Uc(e))}))})),i=Promise.resolve().then(a(o().mark((function e(){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,s.setup();case 4:return n=e.sent,e.abrupt("return",t()?void 0:n);case 6:case"end":return e.stop()}}),e)})))),e.prev=6,e.next=9,Promise.race([i,r]);case 9:return e.abrupt("return",e.sent);case 10:return e.prev=10,t()||n(),e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[6,,10,13]])}))),function(){return i.apply(this,arguments)})},{key:"is",value:function(e){return this.name.startsWith(e.elementType)}},{key:"mount",value:(r=a(o().mark((function e(t){var n,r,i,a,s=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("initialized"===this.status||"unmounted"===this.status){e.next=4;break}throw n=new xc({message:"element status is ".concat(this.status,", can not mount again"),params:{status:this.status}},"MOUNT_NOT_SUPPORT"),Mc(n),n;case 4:return r=Date.now(),i=Dl((function(){return Promise.all([s._setup(),s._mount(t)])}),15e3,new xc("Mount timeout","MOUNT_TIMEOUT","SYSTEM")),a=xl((function(){Ic({msg:s.name,d1:"用户退出页面",m1:0,m2:Math.round(Date.now()-r),m3:s.isMainElement?1:0,m4:s.isSingleMode?1:0})})),e.abrupt("return",i().then((function(e){var t=et(e,1)[0];wc({msg:s.name,d1:(null==t?void 0:t.merchantId)||"未配置的商户"}),Ic({msg:s.name,d1:"挂载成功",m1:1,m2:Math.round(Date.now()-r),m3:s.isMainElement?1:0,m4:s.isSingleMode?1:0}),s.bridge.send(Yl,bc(s.config.appConfig,t||{}))})).catch((function(e){"destroyed"!==s.status&&s.unmount();var t=Dc.unificationError(e);throw Ic({msg:s.name,d1:"挂载失败",d2:t.code,d3:t.reason,m1:0,m2:Math.round(Date.now()-r),m3:s.isMainElement?1:0,m4:s.isSingleMode?1:0}),Mc(t),t})).finally((function(){a()})));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_mount",value:(n=a(o().mark((function e(t){var n=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=a(o().mark((function e(r,i){var a,s,l,c,u,d,p,h,m,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.isMainElement||!n.isSingleMode){e.next=2;break}return e.abrupt("return",i(new xc({message:"".concat(n.name," element can not be used with single mode"),params:{elementName:n.name}},"MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE")));case 2:if(e.prev=2,t){e.next=5;break}return e.abrupt("return",i(new xc("container missing","MOUNT_MISSING_CONTAINER")));case 5:a=n.config.appUrl,s=new URL(n.config.appUrl),l=[["origin",window.location.origin],["locale",n.config.locale]].concat(Xe(n.config.trackId?[["track_id",n.config.trackId]]:[]));try{l.forEach((function(e){var t=et(e,2),n=t[0],r=t[1];return s.searchParams.set(n,r)})),a=s.toString()}catch(e){c=a.includes("?")?"&":"?",u=l.map((function(e){var t=et(e,2),n=t[0],r=t[1];return"".concat(n,"=").concat(encodeURIComponent(r))})).join("&"),a="".concat(a).concat(c).concat(u)}(d=t.querySelector("#sdk-loading"))&&(d.style.display=""),n.status="mounting",n.iframe||(n.iframe=document.createElement("iframe"),n.iframe.src=a,n.iframe.style.width="100%",n.iframe.style.border="none",n.iframe.style.height="0",n.iframe.style.borderRadius="inherit",n.iframe.style.transition="height 0.3s ease",n.iframe.style.colorScheme=null!==(p=n.config.colorScheme)&&void 0!==p?p:"light dark",n.iframe.allow="payment",n.bridge.on(sc,(function(e){n.iframe&&(n.iframe.style.height="".concat(e,"px"))}))),h=Date.now(),m="*";try{"null"===(m=new URL(n.iframe.src).origin)&&(m="*")}catch(e){m="*"}n.bridge.setOrigin(m),f=n._addHook("ondestroy",(function(e){i(Uc(e))})),n.bridge.once(Fl,(function(){var e;if(d&&(d.style.display="none"),"mounted"!==n.status&&"ready"!==n.status){if(null===(e=n.iframe)||void 0===e||!e.contentWindow)return r();Rc("INFO","SYSTEM","Iframe ".concat(n.name," loaded, initiating handshake...")),n.status="mounted",n.bridge.setTarget(n.iframe.contentWindow);var t=Date.now();n.bridge.once(Zl,(function(e){n.status="ready",n.cachedSend.length&&(n.cachedSend.forEach((function(e){var t=e.type,r=e.payload;n.bridge.send(t,r)})),n.cachedSend=[]),Cc({msg:n.name,d1:(null==e?void 0:e.version)||"未知版本",m1:Math.round(Date.now()-t),m2:1,m3:Math.round(Date.now()-h)})})),f(),r()}else f()})),n.iframe.onerror=function(e){i(new xc("Iframe load error: ".concat(e),"MOUNT_IFRAME_LOAD_ERROR","SYSTEM"))},t.appendChild(n.iframe),e.next=24;break;case 21:e.prev=21,e.t0=e.catch(2),i(new xc("Initialization crashed: ".concat(e.t0.message),"MOUNT_INITIAL_FAILED","SDK_INTERNAL"));case 24:case"end":return e.stop()}}),e,null,[[2,21]])})));return function(t,n){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"updateConfig",value:(t=a(o().mark((function e(t){var n,r,i,a=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"destroyed"!==this.status){e.next=3;break}throw new Dc("Element already destroyed, cannot update destroyed SDK instance","ELEMENT_INSTANCE_DESTROYED","SDK_USAGE");case 3:if("ready"===this.status){e.next=5;break}throw new Dc({message:"Element is { status }, it is not ready, cannot update config",params:{status:this.status}},"UPDATE_CONFIG_NOT_READY","SDK_USAGE");case 5:return this.config.appConfig=bc(this.config.appConfig,t),Rc("INFO","SDK_USAGE","Updating configuration via API",t),n=function(){},r=Dl((function(){return new Promise((function(e){n=a.bridge.once(jl,(function(t){e(t)})),a.bridge.send(Hl,{merged:a.config.appConfig,updated:t})}))}),3e3,new Dc("Update config timeout","UPDATE_CONFIG_TIMEOUT","SYSTEM")),e.abrupt("return",r().catch((function(e){return n(),{error:Dc.unificationError(e).toJSON()}})));case 12:return e.prev=12,e.t0=e.catch(0),i=Dc.unificationError(e.t0),e.abrupt("return",Promise.resolve({error:i.toJSON()}));case 16:case"end":return e.stop()}}),e,this,[[0,12]])}))),function(e){return t.apply(this,arguments)})},{key:"unmount",value:function(){"mounted"===this.status||"ready"===this.status?(this.status="unmounted",this.iframe&&this.iframe.parentNode&&(this.iframe.style.height="0",this.iframe.parentNode.removeChild(this.iframe))):Rc("WARN","SDK_USAGE","element status is ".concat(this.status,", can not unmount, please check the usage. only mounted or ready status can unmount"))}},{key:"isSingleMode",get:function(){return"SINGLE"===this._elementMode}},{key:"on",value:function(e,t){this.bridge.on(e,t)}},{key:"send",value:function(e,t){"destroyed"!==this.status?"ready"===this.status?this.bridge.send(e,t):this.cachedSend.push({type:e,payload:t}):Mc(new Dc("element status is ".concat(this.status,", can not send message"),"ELEMENT_INSTANCE_DESTROYED","SDK_USAGE"))}},{key:"_addPort",value:function(e){!this.isSingleMode&&this.isMainElement&&this.bridge._addPort(e)}},{key:"_transferReceivePort",value:function(e){!this.isSingleMode&&this.isMainElement&&this.bridge._transferReceivePort(e)}},{key:"_transferSendPort",value:function(e){this.isSingleMode||this.isMainElement||this.bridge._transferSendPort(e)}},{key:"_submit",value:function(e){var t=this;return"HOST"!==this.bridge.mode?Promise.reject(new Error("submit method only available in HOST mode")):(this.submitPromise||(this.submitPromise=new Promise((function(n){t.send(Vl,e),t.bridge.once(Gl,(function(e){n(e)}))})).finally((function(){t.submitPromise=void 0}))),this.submitPromise)}},{key:"destroy",value:function(){var e,t=this;if("destroyed"!==this.status){if(null===(e=this.hooks.ondestroy)||void 0===e||e.forEach((function(e){return e(t.status)})),this.hooks={},this.bridge.destroy(),"mounted"===this.status||"ready"===this.status)this.unmount();else{var n,r=null===(n=this.iframe)||void 0===n?void 0:n.parentNode;r&&r.removeChild(this.iframe)}this.status="destroyed"}else Rc("WARN","SDK_USAGE","element status is ".concat(this.status,", can not destroy, please check the usage. only mounted or ready status can destroy"))}},{key:"isMainElement",get:function(){return this._isMainElement}},{key:"_addHook",value:function(e,t){var n,r=this;return this.hooks[e]||(this.hooks[e]=[]),null===(n=this.hooks[e])||void 0===n||n.push(t),function(){var n;r.hooks[e]=null===(n=r.hooks[e])||void 0===n?void 0:n.filter((function(e){return e!==t}))}}}]),e}();l(Kc,"elementType",void 0);var Bc,Yc=function(e){y(n,e);var t=E(n);function n(e,r,o,i){return v(this,n),t.call(this,e,p(p({},o),{},{isMainElement:!0,appUrl:r,appConfig:i||{}}))}return m(n,[{key:"_submit",value:function(e){return dl(hl(n.prototype),"_submit",this).call(this,e)}}]),n}(Kc),Fc=function(){function e(t){var n,r=this;v(this,e),l(this,"config",void 0),l(this,"isInit",!1),l(this,"isDestroyed",!1),l(this,"version",void 0),l(this,"elementMode","SINGLE"),l(this,"_elements",new Map),l(this,"globalBridgeForWebApp",void 0),l(this,"globalBridgeForModal",void 0),l(this,"openModalHandle",void 0),l(this,"elementClasses",{}),l(this,"modalIsReady",!1),this.config=t,this.version=t.version,t.trackerCode&&(n=t.trackerCode,Sc=n);var i=this.globalBridgeForWebApp=Lc.getGlobalBridge();i.on(Wl,function(){var e=a(o().mark((function e(t){var n,a,s,l,c,u,d,h,m,f;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((s=r._elements.get(t.scope))&&null!==(n=s.iframe)&&void 0!==n&&n.contentWindow){e.next=4;break}return Rc("WARN","SDK_INTERNAL","Element not found or iframe contentWindow not available"),e.abrupt("return");case 4:(l=r.globalBridgeForModal=Lc.getGlobalBridge()).setDebugCallback((function(e,t){"OUT"===t&&Rc("INFO","SDK_INTERNAL",e.type,e.payload)})),i.setTarget(s.iframe.contentWindow),e.prev=7,c=new URL(t.url),t.closeConfirm&&c.searchParams.append("confirm","true"),t.url=c.toString(),e.next=18;break;case 13:return e.prev=13,e.t0=e.catch(7),u=new Dc("Invalid URL","INVALID_MODAL_URL","APP_RUNTIME"),i.send(ql,u),e.abrupt("return");case 18:return d=new MessageChannel,h=t.modalId||Ll("modal_"),e.next=22,r.openModal(p(p({},t),{},{onClose:function(){if(t.closeConfirm)return new Ul(h,d.port2).close(!0)}}));case 22:m=r.openModalHandle=e.sent,i.send(tc,h,[d.port1]),f=function(e,n,o){o&&o.source!==m.getContentWindow()||r.modalIsReady||(r.modalIsReady=!0,l.setTarget(m.getContentWindow()),t.appearance&&l.send(oc,t.appearance),t.initialData&&l.send(ic,t.initialData),l.send(rc,h,[d.port2]))},l.once(nc,f),null===(a=m.onLoadedSuccess)||void 0===a||a.call(m,f),i.once(Jl,(function(){r.modalIsReady=!1,m.destroy(),l.destroy()}));case 28:case"end":return e.stop()}}),e,null,[[7,13]])})));return function(t){return e.apply(this,arguments)}}()),i.on(zl,function(){var e=a(o().mark((function e(t,n,i){var a,s,l,c,u,d,p,h;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=null==i?void 0:i.source,l=Array.from(r._elements.values()).some((function(e){var t;return(null===(t=e.iframe)||void 0===t?void 0:t.contentWindow)===s})),c=(null===(a=r.openModalHandle)||void 0===a?void 0:a.getContentWindow())===s,!s||l||c){e.next=5;break}return e.abrupt("return");case 5:return u=t.url,d=t.mode,p=void 0===d?"redirect":d,h=t.destroy,(void 0===h||h)&&r.destroy(),e.prev=7,e.next=10,r.redirect(t);case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(7),"replace"===p?window.location.replace(u):"redirect"===p&&(window.location.href=u);case 15:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(t,n,r){return e.apply(this,arguments)}}()),i.on(lc,function(){var e=a(o().mark((function e(t){var n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:(n=r._elements.get(t.elementKey))?null==n||n.destroy():Rc("WARN","SDK_INTERNAL","Element not found when destroy");case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),i.setDebugCallback((function(e,t){var n,r;e.type.endsWith($l)?Rc(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message):e.type.endsWith(Ql)&&"IN"===t?Mc(e.payload):e.type.endsWith(ql)?Rc("ERROR","APP_RUNTIME","Open modal error",e.payload):Rc("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload)})),this.canUseElements().forEach((function(e){var t=e,n=void 0;"function"!=typeof e&&(t=e.ElementClass,n=e.config);var o=t;if(!o.elementType)throw new Dc("ElementClass must have a static elementType property","ELEMENT_DEFINE_ERROR","SDK_INTERNAL");var i=r._generateElementKey(o.elementType,n);if(r.elementClasses[i])throw new Dc('This elementType "'.concat(o.elementType,'" ').concat(n?"with config ".concat(JSON.stringify(n)):""," is already registered in factory"),"ELEMENT_ALREADY_REGISTERED","SDK_INTERNAL");r.elementClasses[i]=o}))}var t,n;return m(e,[{key:"openModal",value:(n=a(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Rc("WARN","SDK_INTERNAL","Open modal request received, but no handler implemented.",t),e.abrupt("return",Promise.resolve({destroy:function(){},onLoadedSuccess:function(e){},getContentWindow:function(){return null}}));case 2:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"redirect",value:function(e){throw Rc("WARN","SDK_INTERNAL","Custom redirect was not implemented, and the default browser redirection method was used",e),new Error("REDIRECT_NOT_IMPLEMENTED")}},{key:"init",value:(t=a(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isInit){e.next=2;break}return e.abrupt("return",this);case 2:if(!this.config.debug){e.next=5;break}return e.next=5,Oc().then((function(e){null==e||e.mount()})).catch((function(){var e=new Dc("Load debugger failed","LOAD_DEBUGGER_FAILED","SDK_INTERNAL");Mc(e)}));case 5:return this.isInit=!0,e.abrupt("return",this);case 7:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"generateElementKey",value:function(e,t){return e}},{key:"updateConfig",value:function(e){var t=e.locale,n=e.debug,r=e.env;t&&(this.config.locale=t),n&&(this.config.debug=n),r&&(this.config.env=r),(t||r)&&this._elements.forEach((function(t){t.updateConfig(e)}))}},{key:"destroy",value:function(){var e,t;this._elements.forEach((function(e){e.destroy()})),this._elements.clear(),null===(e=this.openModalHandle)||void 0===e||e.destroy(),null===(t=this.globalBridgeForModal)||void 0===t||t.destroy(),this.globalBridgeForWebApp.destroy(),this.isDestroyed=!0}},{key:"_generateElementKey",value:function(e,t){try{var n=this.generateElementKey(e,t);if(!n.startsWith(e))throw new Dc("Generate element key error, must start with elementType","GENERATE_ELEMENT_KEY_FAILED","SDK_INTERNAL");return n}catch(n){var r=new Dc({message:"Generate element ".concat(e," key error, with options ").concat(JSON.stringify(t)),params:{elementType:e,options:t}},"GENERATE_ELEMENT_KEY_FAILED","SDK_INTERNAL");throw Mc(r),r}}},{key:"_createElement",value:function(e,t){var n,r,o=this,i=this._generateElementKey(e,t);if(n=this.elementClasses[i],Nc({msg:e,m1:n?1:0}),!n){var a=new Dc({message:"Element type ".concat(e," not supported."),params:{elementType:e}},"NOT_SUPPORT_ELEMENT","SDK_USAGE");throw Mc(a),a}try{r=new n(i,p(p({},this.config),{},{elementMode:this.elementMode,appConfig:p({env:this.config.env,locale:this.config.locale},t)}))}catch(a){var s=Dc.isError(a)?a:new Dc({message:"Element type ".concat(e," initialization failed ").concat(a instanceof Error?a.message:""),params:{elementType:e}},"ELEMENT_INIT_FAILED","SDK_INTERNAL");throw Mc(s),s}return r._addHook("ondestroy",(function(){o._removeElement(e,t),o._getElementSize()||Rc("INFO","SDK_INTERNAL","All elements destroyed")})),this._addElement(e,r,t),r}},{key:"_addElement",value:function(e,t,n){if(this._elements.has(this._generateElementKey(e,n))){var r=new Dc({message:"".concat(e," element already exists, please don't create twice."),params:{elementType:e}},"CANNOT_CREATE_SAME_ELEMENT_TWICE","SDK_USAGE");throw Mc(r),r}this._elements.set(this._generateElementKey(e,n),t)}},{key:"_removeElement",value:function(e,t){this._elements.delete(this._generateElementKey(e,t))}},{key:"_getElement",value:function(e,t){return this._elements.get(this._generateElementKey(e,t))}},{key:"_getElementSize",value:function(){return this._elements.size}}]),e}(),Hc=function(e){y(r,e);var t,n=E(r);function r(e){var t;return v(this,r),t=n.call(this,e),l(Qe(t),"waitSendPort",[]),l(Qe(t),"mainElement",void 0),t.elementMode="GROUP",t}return m(r,[{key:"_mainElement",get:function(){return this.mainElement}},{key:"_createElement",value:function(e,t){var n=this,o=dl(hl(r.prototype),"_createElement",this).call(this,e,t);if(o.isMainElement){if(this.mainElement){var i=new Dc("Only has one main element","GROUPS_ONLY_ONE_MAIN_ELEMENT","SDK_USAGE");throw Mc(i),i}this.mainElement=o;var a=new Kl(e);o.on(Zl,(function(){o._transferReceivePort(a),n.waitSendPort.length&&(o._addPort(Xe(n.waitSendPort)),n.waitSendPort=[])}))}else{var s=new MessageChannel,l=new Bl(e,s.port1);o.on(Zl,(function(){o._transferSendPort(l),n.mainElement?n.mainElement._addPort([s.port2]):n.waitSendPort.push(s.port2)}))}return o._addHook("ondestroy",(function(){o.isMainElement&&(n.mainElement=void 0)})),o}},{key:"_submit",value:(t=a(o().mark((function e(){var t,n;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mainElement){e.next=4;break}throw n=new Dc("There is no main element, Must has one main element, can not be submit","GROUPS_NOT_FOUND_MAIN_ELEMENT","SDK_USAGE"),Mc(n),n;case 4:return e.abrupt("return",null===(t=this.mainElement)||void 0===t?void 0:t._submit());case 5:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),r}(Fc),jc=function(e){y(n,e);var t=E(n);function n(){return v(this,n),t.apply(this,arguments)}return m(n)}(Fc),Vc=".ams-popupoverlay",Gc=function(e){return{d1:e.stage,d2:e.modalId,d3:e.scope,d4:e.origin,d5:e.modalState,d6:e.modalStyle,d7:e.iframePath,d8:e.visibilityState,d9:e.layerState,d10:e.sourceState,d11:String(e.sourceFrameIndex),m1:e.elapsedMs,m2:e.modalCount,m3:e.overlayCount}},zc=function(e,t){return e===t||e.endsWith(":".concat(t))},Wc=function(e){if(!e)return"";try{var t=new URL(e.src,window.location.href);return"".concat(t.origin).concat(t.pathname)}catch(e){return"invalid"}},qc=function(){var e,t,n=Array.from(document.querySelectorAll(".ams-popupmodal, .ams-popupmodal-mobile")),r=null!==(e=n[n.length-1])&&void 0!==e?e:null,o=null!==(t=null==r?void 0:r.querySelector("iframe"))&&void 0!==t?t:null;if(!r)return{modalState:"missing",modalStyle:"",iframePath:"",layerState:"unknown",modalCount:0,overlayCount:document.querySelectorAll(Vc).length,iframe:o};var i=window.getComputedStyle(r),a=r.getBoundingClientRect(),s="none"===i.display||"hidden"===i.visibility||"0"===i.opacity?"hidden":0===a.width||0===a.height?"zero_size":"visible",l="unknown";if("visible"===s&&"function"==typeof document.elementFromPoint){var c=document.elementFromPoint(a.left+a.width/2,a.top+a.height/2);l=c?r.contains(c)?"front":"covered":"unknown"}return{modalState:s,modalStyle:"".concat(i.display,"/").concat(i.visibility,"/").concat(i.opacity||"1","/").concat(Math.round(a.width),"x").concat(Math.round(a.height),"/z").concat(i.zIndex||"auto"),iframePath:Wc(o),layerState:l,modalCount:n.length,overlayCount:document.querySelectorAll(Vc).length,iframe:o}};function Jc(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},o=null,i="",a="",s="",l=null,c=!1,u=function(){void 0!==t&&window.clearTimeout(t),void 0!==n&&window.clearTimeout(n),t=void 0,n=void 0},d=function(t,n,r,s){try{var l=qc(),c=Array.from(document.querySelectorAll("iframe")).findIndex((function(e){return e.contentWindow===r}));e({stage:t,modalId:i,scope:a,origin:n,elapsedMs:null===o?0:Date.now()-o,modalState:l.modalState,modalStyle:l.modalStyle,iframePath:l.iframePath,visibilityState:document.visibilityState,layerState:l.layerState,sourceState:s,sourceFrameIndex:c,modalCount:l.modalCount,overlayCount:l.overlayCount})}catch(e){}},p=function(e){var p=e.data;if("string"==typeof(null==p?void 0:p.type)){if(zc(p.type,Wl)){var h,m;if(!r(e))return;return u(),o=Date.now(),i="string"==typeof(null===(h=p.payload)||void 0===h?void 0:h.modalId)?p.payload.modalId:"",a="string"==typeof(null===(m=p.payload)||void 0===m?void 0:m.scope)?p.payload.scope:"",s=e.origin,l=e.source,c=!1,d("open_received",e.origin,e.source,"element"),t=window.setTimeout((function(){return d("open_500ms",s,l,"element")}),500),void(n=window.setTimeout((function(){c||d("ready_timeout",s,null,"none")}),5e3))}if(zc(p.type,nc)&&null!==o){var f=qc().iframe,v=!!f&&e.source===f.contentWindow;return v&&(c=!0,void 0!==n&&window.clearTimeout(n),n=void 0),void d(v?"ready_received":"ready_source_mismatch",e.origin,e.source,v?"modal":"unexpected")}if(zc(p.type,Jl)){var g=null!==o&&e.source===l?"element":"unexpected";d(null===o?"close_without_open":c?"close_after_ready":"close_before_ready",e.origin,e.source,g),u(),o=null,i="",a="",l=null,c=!1}}};return window.addEventListener("message",p),function(){u(),window.removeEventListener("message",p)}}!function(e){e["ar-SA"]="ar-SA",e.kn="kn",e.as="as",e.bho="bho",e["pl-PL"]="pl-PL",e["ko-KR"]="ko-KR",e["da-DK"]="da-DK",e["de-DE"]="de-DE",e["ru-RU"]="ru-RU",e["fr-FR"]="fr-FR",e.gu="gu",e["nl-BE"]="nl-BE",e["nl-NL"]="nl-NL",e["cs-CZ"]="cs-CZ",e.ro="ro",e["lo-LA"]="lo-LA",e["my-MM"]="my-MM",e["bn-BD"]="bn-BD",e["bn-IN"]="bn-IN",e.mr="mr",e["ms-MY"]="ms-MY",e.ml="ml",e.mni="mni",e["ne-NP"]="ne-NP",e.or="or",e["pt-BR"]="pt-BR",e["pt-PT"]="pt-PT",e.pa="pa",e["sv-SE"]="sv-SE",e["ja-JP"]="ja-JP",e.sr="sr",e["si-LK"]="si-LK",e["sk-SK"]="sk-SK",e["tr-TR"]="tr-TR",e["tl-PH"]="tl-PH",e.te="te",e.ta="ta",e["th-TH"]="th-TH",e["ur-PK"]="ur-PK",e["ur-IN"]="ur-IN",e["uk-UA"]="uk-UA",e["iw-IL"]="iw-IL",e["es-ES"]="es-ES",e["es-MX"]="es-MX",e.hu="hu",e["it-IT"]="it-IT",e["in-ID"]="in-ID",e["hi-IN"]="hi-IN",e["vi-VN"]="vi-VN",e["en-PK"]="en-PK",e["en-PL"]="en-PL",e["en-FR"]="en-FR",e["en-PH"]="en-PH",e["en-CZ"]="en-CZ",e["en-CA"]="en-CA",e["en-MM"]="en-MM",e["en-US"]="en-US",e["en-BD"]="en-BD",e["en-MY"]="en-MY",e["en-NP"]="en-NP",e["en-LK"]="en-LK",e["en-TH"]="en-TH",e["en-ES"]="en-ES",e["en-SG"]="en-SG",e["en-HU"]="en-HU",e["en-ID"]="en-ID",e["en-GB"]="en-GB",e["en-VN"]="en-VN",e["en-HK"]="en-HK",e["en-KR"]="en-KR",e["zh-TW"]="zh-TW",e["zh-HK"]="zh-HK",e["zh-SG"]="zh-SG",e["zh-CN"]="zh-CN",e["ar-IQ"]="ar-IQ",e["ckb-IQ"]="ckb-IQ",e.ku="ku",e["kk-KZ"]="kk-KZ",e.af="af",e.am="am",e.az="az",e.be="be",e.bg="bg",e.bs="bs",e.ca="ca",e.cy="cy",e.el="el",e.eo="eo",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.gd="gd",e.gl="gl",e.ha="ha",e.haw="haw",e.hr="hr",e.ig="ig",e.is="is",e.ka="ka",e.km="km",e.ky="ky",e.lb="lb",e.ln="ln",e.lt="lt",e.lv="lv",e.mg="mg",e.mk="mk",e.mn="mn",e.mt="mt",e.om="om",e.ps="ps",e.qu="qu",e.rw="rw",e.sl="sl",e.so="so",e.sq="sq",e.sw="sw",e.tg="tg",e.ti="ti",e.ug="ug",e.uz="uz",e.yo="yo",e.zu="zu"}(Bc||(Bc={}));var Qc={};Qc[Bc["ar-SA"]]="阿拉伯语 (沙特阿拉伯)",Qc[Bc.kn]="埃纳德语",Qc[Bc.as]="阿萨姆语",Qc[Bc.bho]="博杰普尔语",Qc[Bc["pl-PL"]]="波兰语 (波兰)",Qc[Bc["ko-KR"]]="朝鲜语 (韩国)",Qc[Bc["da-DK"]]="丹麦语 (丹麦)",Qc[Bc["de-DE"]]="德语 (德国)",Qc[Bc["ru-RU"]]="俄语 (俄罗斯)",Qc[Bc["fr-FR"]]="法语 (法国)",Qc[Bc.gu]="古加拉提语",Qc[Bc["nl-BE"]]="荷兰语 (比利时)",Qc[Bc["nl-NL"]]="荷兰语 (荷兰)",Qc[Bc["cs-CZ"]]="捷克语 (捷克共和国)",Qc[Bc.ro]="罗马尼亚语",Qc[Bc["lo-LA"]]="老挝语 (老挝)",Qc[Bc["my-MM"]]="缅甸语 (缅甸)",Qc[Bc["bn-BD"]]="孟加拉语 (孟加拉)",Qc[Bc["bn-IN"]]="孟加拉语 (印度)",Qc[Bc.mr]="马拉地语",Qc[Bc["ms-MY"]]="马来语 (马来西亚)",Qc[Bc.ml]="马来亚拉姆语",Qc[Bc.mni]="曼尼普里语",Qc[Bc["ne-NP"]]="尼泊尔语 (尼泊尔)",Qc[Bc.or]="欧里亚语",Qc[Bc["pt-BR"]]="葡萄牙语 (巴西)",Qc[Bc["pt-PT"]]="葡萄牙语 (葡萄牙)",Qc[Bc.pa]="旁遮普语",Qc[Bc["sv-SE"]]="瑞典语 (瑞典)",Qc[Bc["ja-JP"]]="日语 (日本)",Qc[Bc.sr]="塞尔维亚语",Qc[Bc["si-LK"]]="僧伽罗语 (斯里兰卡)",Qc[Bc["sk-SK"]]="斯洛伐克语 (斯洛伐克)",Qc[Bc["tr-TR"]]="土耳其语 (土耳其)",Qc[Bc["tl-PH"]]="塔加路族语 (菲律宾)",Qc[Bc.te]="泰卢固语",Qc[Bc.ta]="泰米尔语",Qc[Bc["th-TH"]]="泰语 (泰国)",Qc[Bc["ur-PK"]]="乌尔都语 (巴基斯坦)",Qc[Bc["ur-IN"]]="乌尔都语 (印度)",Qc[Bc["uk-UA"]]="乌克兰语 (乌克兰)",Qc[Bc["iw-IL"]]="希伯来语 (以色列)",Qc[Bc["es-ES"]]="西班牙语 (西班牙)",Qc[Bc["es-MX"]]="西班牙语 (墨西哥)",Qc[Bc.hu]="匈牙利语",Qc[Bc["it-IT"]]="意大利语 (意大利)",Qc[Bc["in-ID"]]="印度尼西亚语 (印度尼西亚)",Qc[Bc["hi-IN"]]="印地语 (印度)",Qc[Bc["vi-VN"]]="越南语 (越南)",Qc[Bc["en-PK"]]="英语 (巴基斯坦)",Qc[Bc["en-PL"]]="英语 (波兰)",Qc[Bc["en-FR"]]="英语 (法国)",Qc[Bc["en-PH"]]="英语 (菲律宾)",Qc[Bc["en-CZ"]]="英语 (捷克共和国)",Qc[Bc["en-CA"]]="英语 (加拿大)",Qc[Bc["en-MM"]]="英语 (缅甸)",Qc[Bc["en-US"]]="英语 (美国)",Qc[Bc["en-BD"]]="英语 (孟加拉)",Qc[Bc["en-MY"]]="英语 (马来西亚)",Qc[Bc["en-NP"]]="英语 (尼泊尔)",Qc[Bc["en-LK"]]="英语 (斯里兰卡)",Qc[Bc["en-TH"]]="英语 (泰国)",Qc[Bc["en-ES"]]="英语 (西班牙)",Qc[Bc["en-SG"]]="英语 (新加坡)",Qc[Bc["en-HU"]]="英语 (匈牙利)",Qc[Bc["en-ID"]]="英语 (印度尼西亚)",Qc[Bc["en-GB"]]="英语 (英国)",Qc[Bc["en-VN"]]="英语 (越南)",Qc[Bc["en-HK"]]="英语 (中国香港)",Qc[Bc["en-KR"]]="英语 (韩国)",Qc[Bc["zh-TW"]]="繁体中文 (中国台湾)",Qc[Bc["zh-HK"]]="繁体中文 (中国香港)",Qc[Bc["zh-SG"]]="简体中文 (新加坡)",Qc[Bc["zh-CN"]]="简体中文 (中国)",Qc[Bc["ar-IQ"]]="阿拉伯语 (伊拉克)",Qc[Bc["ckb-IQ"]]="中库尔德语 (伊拉克)",Qc[Bc.ku]="库尔德语",Qc[Bc["kk-KZ"]]="哈萨克语",Qc[Bc.af]="南非语",Qc[Bc.am]="阿姆哈拉语",Qc[Bc.az]="阿塞拜疆语",Qc[Bc.be]="白俄罗斯语",Qc[Bc.bg]="保加利亚语",Qc[Bc.bs]="波斯尼亚语",Qc[Bc.ca]="加泰罗尼亚语",Qc[Bc.cy]="威尔士语",Qc[Bc.el]="现代希腊语",Qc[Bc.eo]="世界语",Qc[Bc.et]="爱沙尼亚语",Qc[Bc.eu]="巴斯克语",Qc[Bc.fa]="波斯语",Qc[Bc.fi]="芬兰语",Qc[Bc.gd]="爱尔兰语",Qc[Bc.gl]="加利西亚语",Qc[Bc.ha]="豪萨语",Qc[Bc.haw]="夏威夷语",Qc[Bc.hr]="克罗地亚语",Qc[Bc.ig]="伊博语",Qc[Bc.is]="冰岛语",Qc[Bc.ka]="格鲁吉亚语",Qc[Bc.km]="高棉语",Qc[Bc.ky]="吉尔吉斯语",Qc[Bc.lb]="卢森堡语",Qc[Bc.ln]="林格拉语",Qc[Bc.lt]="立陶宛语",Qc[Bc.lv]="拉脱维亚语",Qc[Bc.mg]="马尔加什语",Qc[Bc.mk]="马其顿语",Qc[Bc.mn]="蒙古文",Qc[Bc.mt]="马耳他语",Qc[Bc.om]="奥罗莫语",Qc[Bc.ps]="普什图语",Qc[Bc.qu]="克丘亚语",Qc[Bc.rw]="卢旺达语",Qc[Bc.sl]="斯洛文尼亚语",Qc[Bc.so]="索马里语",Qc[Bc.sq]="阿尔巴尼亚语",Qc[Bc.sw]="斯瓦希里语",Qc[Bc.tg]="塔吉克语",Qc[Bc.ti]="蒂格尼亚语",Qc[Bc.ug]="维吾尔语",Qc[Bc.uz]="乌兹别克语",Qc[Bc.yo]="约鲁巴语",Qc[Bc.zu]="祖鲁语";var Zc,Xc={};Xc[Bc["ar-SA"]]="Arabic (Saudi Arabia)",Xc[Bc.kn]="Kannada",Xc[Bc.as]="Assamese",Xc[Bc.bho]="Bhojpuri",Xc[Bc["pl-PL"]]="Polish (Poland)",Xc[Bc["ko-KR"]]="Korean (Korean)",Xc[Bc["da-DK"]]="Danish (Denmark)",Xc[Bc["de-DE"]]="German (Germany)",Xc[Bc["ru-RU"]]="Russian (Russia)",Xc[Bc["fr-FR"]]="French (France)",Xc[Bc.gu]="Gujarati",Xc[Bc["nl-BE"]]="Dutch (Belgium)",Xc[Bc["nl-NL"]]="Dutch (Netherlands)",Xc[Bc["cs-CZ"]]="Czech (Czech Republic)",Xc[Bc.ro]="Romanian",Xc[Bc["lo-LA"]]="Lao (Laos)",Xc[Bc["my-MM"]]="Burmese (Myanmar)",Xc[Bc["bn-BD"]]="Bengali (Bangladesh)",Xc[Bc["bn-IN"]]="Bengali (India)",Xc[Bc.mr]="Marathi",Xc[Bc["ms-MY"]]="Malay (Malaysia)",Xc[Bc.ml]="Malayalam",Xc[Bc.mni]="Manipuri",Xc[Bc["ne-NP"]]="Nepalese (Nepal)",Xc[Bc.or]="Odia (Oriya)",Xc[Bc["pt-BR"]]="Portuguese (Brazil)",Xc[Bc["pt-PT"]]="Portuguese (Portugal)",Xc[Bc.pa]="Punjabi",Xc[Bc["sv-SE"]]="Swedish (Sweden)",Xc[Bc["ja-JP"]]="Japanese (Japanese)",Xc[Bc.sr]="Serbian",Xc[Bc["si-LK"]]="Sinhala (Sri Lanka)",Xc[Bc["sk-SK"]]="Slovak (Slovakia)",Xc[Bc["tr-TR"]]="Turkish (Turkish)",Xc[Bc["tl-PH"]]="Tagalog (Philippines)",Xc[Bc.te]="Telugu",Xc[Bc.ta]="Tamil",Xc[Bc["th-TH"]]="Thai (Thailand)",Xc[Bc["ur-PK"]]="Ulduwen (Pakistan)",Xc[Bc["ur-IN"]]="Urduwen (India)",Xc[Bc["uk-UA"]]="Ukrainian (Ukraine)",Xc[Bc["iw-IL"]]="Hebrew (Israel)",Xc[Bc["es-ES"]]="Spanish (Spain)",Xc[Bc["es-MX"]]="Spanish (Mexico)",Xc[Bc.hu]="Hungarian",Xc[Bc["it-IT"]]="Italian (Italian)",Xc[Bc["in-ID"]]="Indonesian (Indonesia)",Xc[Bc["hi-IN"]]="Hindi (India)",Xc[Bc["vi-VN"]]="Vietnamese (Vietnam)",Xc[Bc["en-PK"]]="English (Pakistan)",Xc[Bc["en-PL"]]="English (Poland)",Xc[Bc["en-FR"]]="English (France)",Xc[Bc["en-PH"]]="English (Philippines)",Xc[Bc["en-CZ"]]="English (Czech Republic)",Xc[Bc["en-CA"]]="English (Canada)",Xc[Bc["en-MM"]]="English (Myanmar)",Xc[Bc["en-US"]]="English (US)",Xc[Bc["en-BD"]]="English (Bangladesh)",Xc[Bc["en-MY"]]="English (Malaysia)",Xc[Bc["en-NP"]]="English (Nepal)",Xc[Bc["en-LK"]]="English (Sri Lanka)",Xc[Bc["en-TH"]]="English (Thailand)",Xc[Bc["en-ES"]]="English (Spain)",Xc[Bc["en-SG"]]="English (Singapore)",Xc[Bc["en-HU"]]="English (Hungary)",Xc[Bc["en-ID"]]="English (Indonesia)",Xc[Bc["en-GB"]]="English (UK)",Xc[Bc["en-VN"]]="English (Vietnam)",Xc[Bc["en-HK"]]="English (Hong Kong)",Xc[Bc["en-KR"]]="English (Korean)",Xc[Bc["zh-TW"]]="Chinese Traditional (Taiwan)",Xc[Bc["zh-HK"]]="Chinese Traditional (Hong Kong)",Xc[Bc["zh-SG"]]="Chinese Simplified (Singapore)",Xc[Bc["zh-CN"]]="Chinese Simplified (China)",Xc[Bc["ar-IQ"]]="Arabic (Iraq)",Xc[Bc["ckb-IQ"]]="Central Kurdish (Iraq)",Xc[Bc.ku]="Kurdish",Xc[Bc["kk-KZ"]]="Kazakh",Xc[Bc.af]="Afrikaans",Xc[Bc.am]="Amharic",Xc[Bc.az]="Azerbaijani",Xc[Bc.be]="Belarusian",Xc[Bc.bg]="Bulgarian",Xc[Bc.bs]="Bosnian",Xc[Bc.ca]="Catalan",Xc[Bc.cy]="Welsh",Xc[Bc.el]="Greek",Xc[Bc.eo]="Esperanto",Xc[Bc.et]="Estonian",Xc[Bc.eu]="Basque",Xc[Bc.fa]="Persian",Xc[Bc.fi]="Finnish",Xc[Bc.gd]="Scots Gaelic",Xc[Bc.gl]="Galician",Xc[Bc.ha]="Hausa",Xc[Bc.haw]="Hawaiian",Xc[Bc.hr]="Croatian",Xc[Bc.ig]="Igbo",Xc[Bc.is]="Icelandic",Xc[Bc.ka]="Georgian",Xc[Bc.km]="Khmer",Xc[Bc.ky]="Kyrgyz",Xc[Bc.lb]="Luxembourgish",Xc[Bc.ln]="Lingala",Xc[Bc.lt]="Lithuanian",Xc[Bc.lv]="Latvian",Xc[Bc.mg]="Malagasy",Xc[Bc.mk]="Macedonian",Xc[Bc.mn]="Mongolian",Xc[Bc.mt]="Maltese",Xc[Bc.om]="Oromo",Xc[Bc.ps]="Pashto",Xc[Bc.qu]="Quechua",Xc[Bc.rw]="Kinyarwanda",Xc[Bc.sl]="Slovenian",Xc[Bc.so]="Somali",Xc[Bc.sq]="Albanian",Xc[Bc.sw]="Swahili",Xc[Bc.tg]="Tajik",Xc[Bc.ti]="Tigrinya",Xc[Bc.ug]="Uyghur",Xc[Bc.uz]="Uzbek",Xc[Bc.yo]="Yoruba",Xc[Bc.zu]="Zulu",function(e){e["ar-SA"]="Arabic",e.kn="kannada",e.as="assamese",e.bho="bhojpuri",e["pl-PL"]="Polish",e["ko-KR"]="Korean",e["da-DK"]="danish",e["de-DE"]="German",e["ru-RU"]="Russian",e["fr-FR"]="French",e.gu="gujarati",e["nl-BE"]="Dutch(Belgium)",e["nl-NL"]="Dutch",e["cs-CZ"]="czech",e.ro="romanian",e["lo-LA"]="Lao (Laos)",e["my-MM"]="Burmese",e["bn-BD"]="Bangadesh",e["bn-IN"]="bangadeshIndia",e.mr="marathi",e["ms-MY"]="Malay",e.ml="malayalam",e.mni="manipuri",e["ne-NP"]="NepaliNepal",e.or="oriya",e["pt-BR"]="portuguese (Brazil)",e["pt-PT"]="Portuguese",e.pa="panjabi",e["sv-SE"]="swedish",e["ja-JP"]="Japanese",e.sr="Serbian",e["si-LK"]="Sinhala",e["sk-SK"]="slovak",e["tr-TR"]="Turkish",e["tl-PH"]="Filipino",e.te="telugu",e.ta="tamil",e["th-TH"]="Thai",e["ur-PK"]="Urdu",e["ur-IN"]="urduIndia",e["uk-UA"]="Ukrainian",e["iw-IL"]="Hebrew",e["es-ES"]="Spanish",e["es-MX"]="Spanish (Mexico)",e.hu="hungarian",e["it-IT"]="Italian",e["in-ID"]="Indonesian",e["hi-IN"]="Hindi",e["vi-VN"]="Vietnamese",e["en-PK"]="Pakistan English",e["en-PL"]="Poland English",e["en-FR"]="English (France)",e["en-PH"]="Philippines English",e["en-CZ"]="Czech English",e["en-CA"]="Canadian English",e["en-MM"]="Myanmar English",e["en-US"]="English",e["en-BD"]="Bangladesh English",e["en-MY"]="Malaysia English",e["en-NP"]="Nepal English",e["en-LK"]="Srilanka English",e["en-TH"]="Thai English",e["en-ES"]="English (Spain)",e["en-SG"]="singapore english",e["en-HU"]="Hungarian English",e["en-ID"]="Indonesian English",e["en-GB"]="British English",e["en-VN"]="Vietnamese English",e["en-HK"]="Hong Kong English",e["en-KR"]="Korean English",e["zh-TW"]="Traditional Chinese",e["zh-HK"]="Traditional Chinese(HK)",e["zh-SG"]="Chinese (Singapore)",e["zh-CN"]="Simplified Chinese",e["ar-IQ"]="Arabic (Iraq)",e["ckb-IQ"]="Central Kurdish (Iraq)",e.ku="Kurdish",e["kk-KZ"]="Kazakh"}(Zc||(Zc={}));var $c,eu,tu,nu={"zh-hans":Bc["zh-CN"],"zh-hant":Bc["zh-TW"],ar:Bc["ar-SA"],bn:Bc["bn-BD"],cs:Bc["cs-CZ"],da:Bc["da-DK"],de:Bc["de-DE"],en:Bc["en-US"],es:Bc["es-ES"],fr:Bc["fr-FR"],hi:Bc["hi-IN"],in:Bc["in-ID"],it:Bc["it-IT"],iw:Bc["iw-IL"],ja:Bc["ja-JP"],ko:Bc["ko-KR"],lo:Bc["lo-LA"],ms:Bc["ms-MY"],my:Bc["my-MM"],ne:Bc["ne-NP"],nl:Bc["nl-NL"],pl:Bc["pl-PL"],pt:Bc["pt-PT"],ru:Bc["ru-RU"],si:Bc["si-LK"],sk:Bc["sk-SK"],sv:Bc["sv-SE"],th:Bc["th-TH"],tl:Bc["tl-PH"],tr:Bc["tr-TR"],uk:Bc["uk-UA"],ur:Bc["ur-PK"],vi:Bc["vi-VN"],zh:Bc["zh-CN"],kk:Bc["kk-KZ"]},ru={"zh-hant":Bc["zh-TW"],"zh-hans":Bc["zh-CN"]},ou=function(e){return Object.keys(e||{}).map((function(t){return e[t]}))},iu=function(e,t){return-1!==e.indexOf(t)};!function(e){e.ar_EG="ar_EG",e.az_AZ="az_AZ",e.bg_BG="bg_BG",e.bn_BD="bn_BD",e.by_BY="by_BY",e.ca_ES="ca_ES",e.cs_CZ="cs_CZ",e.da_DK="da_DK",e.de_DE="de_DE",e.el_GR="el_GR",e.en_GB="en_GB",e.en_US="en_US",e.es_ES="es_ES",e.et_EE="et_EE",e.fa_IR="fa_IR",e.fi_FI="fi_FI",e.fr_BE="fr_BE",e.fr_CA="fr_CA",e.fr_FR="fr_FR",e.ga_IE="ga_IE",e.gl_ES="gl_ES",e.he_IL="he_IL",e.hi_IN="hi_IN",e.hr_HR="hr_HR",e.hu_HU="hu_HU",e.hy_AM="hy_AM",e.id_ID="id_ID",e.it_IT="it_IT",e.is_IS="is_IS",e.ja_JP="ja_JP",e.ka_GE="ka_GE",e.kmr_IQ="kmr_IQ",e.kn_IN="kn_IN",e.kk_KZ="kk_KZ",e.km_KH="km_KH",e.ko_KR="ko_KR",e.lt_LT="lt_LT",e.lv_LV="lv_LV",e.mk_MK="mk_MK",e.ml_IN="ml_IN",e.mn_MN="mn_MN",e.ms_MY="ms_MY",e.nb_NO="nb_NO",e.ne_NP="ne_NP",e.nl_BE="nl_BE",e.nl_NL="nl_NL",e.pl_PL="pl_PL",e.pt_BR="pt_BR",e.pt_PT="pt_PT",e.ro_RO="ro_RO",e.ru_RU="ru_RU",e.si_LK="si_LK",e.sk_SK="sk_SK",e.sr_RS="sr_RS",e.sl_SI="sl_SI",e.sv_SE="sv_SE",e.ta_IN="ta_IN",e.th_TH="th_TH",e.tr_TR="tr_TR",e.tk_TK="tk_TK",e.ur_PK="ur_PK",e.uk_UA="uk_UA",e.uz_UZ="uz_UZ",e.vi_VN="vi_VN",e.zh_CN="zh_CN",e.zh_HK="zh_HK",e.zh_TW="zh_TW"}($c||($c={})),ou($c),function(e){e.af="af",e.am="am",e["ar-dz"]="ar-dz",e["ar-iq"]="ar-iq",e["ar-kw"]="ar-kw",e["ar-ly"]="ar-ly",e["ar-ma"]="ar-ma",e["ar-sa"]="ar-sa",e["ar-tn"]="ar-tn",e.ar="ar",e.az="az",e.be="be",e.bg="bg",e.bi="bi",e.bm="bm",e["bn-bd"]="bn-bd",e.bn="bn",e.bo="bo",e.br="br",e.bs="bs",e.ca="ca",e.cs="cs",e.cv="cv",e.cy="cy",e.da="da",e["de-at"]="de-at",e["de-ch"]="de-ch",e.de="de",e.dv="dv",e.el="el",e["en-au"]="en-au",e["en-ca"]="en-ca",e["en-gb"]="en-gb",e["en-ie"]="en-ie",e["en-il"]="en-il",e["en-in"]="en-in",e["en-nz"]="en-nz",e["en-sg"]="en-sg",e["en-tt"]="en-tt",e.en="en",e.eo="eo",e["es-do"]="es-do",e["es-mx"]="es-mx",e["es-PR"]="es-PR",e["es-us"]="es-us",e.es="es",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.fo="fo",e["fr-ca"]="fr-ca",e["fr-ch"]="fr-ch",e.fr="fr",e.fy="fy",e.ga="ga",e.gd="gd",e.gl="gl",e["gom-latn"]="gom-latn",e.gu="gu",e.he="he",e.hi="hi",e.hr="hr",e.ht="ht",e.hu="hu",e["hy-am"]="hy-am",e.id="id",e.is="is",e["it-ch"]="it-ch",e.it="it",e.ja="ja",e.jv="jv",e.ka="ka",e.kk="kk",e.km="km",e.kn="kn",e.ko="ko",e.ku="ku",e.ky="ky",e.lb="lb",e.lo="lo",e.lt="lt",e.lv="lv",e.me="me",e.mi="mi",e.mk="mk",e.ml="ml",e.mn="mn",e.mr="mr",e["ms-my"]="ms-my",e.ms="ms",e.mt="mt",e.my="my",e.nb="nb",e.ne="ne",e["nl-be"]="nl-be",e.nl="nl",e.nn="nn",e["oc-lnc"]="oc-lnc",e["pa-in"]="pa-in",e.pl="pl",e["pt-br"]="pt-br",e.pt="pt",e.rn="rn",e.ro="ro",e.ru="ru",e.rw="rw",e.sd="sd",e.se="se",e.si="si",e.sk="sk",e.sl="sl",e.sq="sq",e["sr-cyrl"]="sr-cyrl",e.sr="sr",e.ss="ss",e["sv-fi"]="sv-fi",e.sv="sv",e.sw="sw",e.ta="ta",e.te="te",e.tet="tet",e.tg="tg",e.th="th",e.tk="tk",e["tl-ph"]="tl-ph",e.tlh="tlh",e.tr="tr",e.tzl="tzl",e["tzm-latn"]="tzm-latn",e.tzm="tzm",e["ug-cn"]="ug-cn",e.uk="uk",e.ur="ur",e["uz-latn"]="uz-latn",e.uz="uz",e.vi="vi",e["x-pseudo"]="x-pseudo",e.yo="yo",e["zh-cn"]="zh-cn",e["zh-hk"]="zh-hk",e["zh-tw"]="zh-tw",e.zh="zh"}(eu||(eu={})),ou(eu),function(e){e.af="af",e["ar-dz"]="ar-dz",e["ar-kw"]="ar-kw",e["ar-ly"]="ar-ly",e["ar-ma"]="ar-ma",e["ar-sa"]="ar-sa",e["ar-tn"]="ar-tn",e.ar="ar",e.az="az",e.be="be",e.bg="bg",e.bm="bm",e["bn-bd"]="bn-bd",e.bn="bn",e.bo="bo",e.br="br",e.bs="bs",e.ca="ca",e.cs="cs",e.cv="cv",e.cy="cy",e.da="da",e["de-at"]="de-at",e["de-ch"]="de-ch",e.de="de",e.dv="dv",e.el="el",e["en-au"]="en-au",e["en-ca"]="en-ca",e["en-gb"]="en-gb",e["en-ie"]="en-ie",e["en-il"]="en-il",e["en-in"]="en-in",e["en-nz"]="en-nz",e["en-sg"]="en-sg",e.eo="eo",e["es-do"]="es-do",e["es-mx"]="es-mx",e["es-us"]="es-us",e.es="es",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.fil="fil",e.fo="fo",e["fr-ca"]="fr-ca",e["fr-ch"]="fr-ch",e.fr="fr",e.fy="fy",e.ga="ga",e.gd="gd",e.gl="gl",e["gom-deva"]="gom-deva",e["gom-latn"]="gom-latn",e.gu="gu",e.he="he",e.hi="hi",e.hr="hr",e.hu="hu",e["hy-am"]="hy-am",e.id="id",e.is="is",e["it-ch"]="it-ch",e.it="it",e.ja="ja",e.jv="jv",e.ka="ka",e.kk="kk",e.km="km",e.kn="kn",e.ko="ko",e.ku="ku",e.ky="ky",e.lb="lb",e.lo="lo",e.lt="lt",e.lv="lv",e.me="me",e.mi="mi",e.mk="mk",e.ml="ml",e.mn="mn",e.mr="mr",e["ms-my"]="ms-my",e.ms="ms",e.mt="mt",e.my="my",e.nb="nb",e.ne="ne",e["nl-be"]="nl-be",e.nl="nl",e.nn="nn",e["oc-lnc"]="oc-lnc",e["pa-in"]="pa-in",e.pl="pl",e["pt-br"]="pt-br",e.pt="pt",e.ro="ro",e.ru="ru",e.sd="sd",e.se="se",e.si="si",e.sk="sk",e.sl="sl",e.sq="sq",e["sr-cyrl"]="sr-cyrl",e.sr="sr",e.ss="ss",e.sv="sv",e.sw="sw",e.ta="ta",e.te="te",e.tet="tet",e.tg="tg",e.th="th",e.tk="tk",e["tl-ph"]="tl-ph",e.tlh="tlh",e.tr="tr",e.tzl="tzl",e["tzm-latn"]="tzm-latn",e.tzm="tzm",e["ug-cn"]="ug-cn",e.uk="uk",e.ur="ur",e["uz-latn"]="uz-latn",e.uz="uz",e.vi="vi",e["x-pseudo"]="x-pseudo",e.yo="yo",e["zh-cn"]="zh-cn",e["zh-hk"]="zh-hk",e["zh-mo"]="zh-mo",e["zh-tw"]="zh-tw"}(tu||(tu={})),ou(tu);var au,su,lu,cu,uu,du,pu,hu,mu,fu,vu,gu,yu,_u,Eu,bu;Bc["ar-IQ"],$c.ar_EG,tu.ar,eu.ar,Bc["ar-SA"],$c.ar_EG,tu["ar-sa"],eu["ar-sa"],Bc["bn-BD"],$c.bn_BD,tu["bn-bd"],eu["bn-bd"],Bc["bn-IN"],$c.bn_BD,tu.bn,eu.bn,Bc["cs-CZ"],$c.cs_CZ,tu.cs,eu.cs,Bc["da-DK"],$c.da_DK,tu.da,eu.da,Bc["de-DE"],$c.de_DE,tu.de,eu.de,Bc["en-BD"],$c.en_US,tu["en-gb"],eu.en,Bc["en-CA"],$c.en_US,tu["en-ca"],eu["en-ca"],Bc["en-CZ"],$c.en_US,tu["en-gb"],eu.en,Bc["en-ES"],$c.en_US,tu["en-gb"],eu.en,Bc["en-FR"],$c.en_US,tu["en-gb"],eu.en,Bc["en-GB"],$c.en_GB,tu["en-gb"],eu["en-gb"],Bc["en-HU"],$c.en_US,tu["en-gb"],eu.en,Bc["en-ID"],$c.en_US,tu["en-gb"],eu.en,Bc["en-LK"],$c.en_US,tu["en-gb"],eu.en,Bc["en-MM"],$c.en_US,tu["en-gb"],eu.en,Bc["en-MY"],$c.en_US,tu["en-gb"],eu.en,Bc["en-NP"],$c.en_US,tu["en-gb"],eu.en,Bc["en-PH"],$c.en_US,tu["en-gb"],eu.en,Bc["en-PK"],$c.en_US,tu["en-gb"],eu.en,Bc["en-PL"],$c.en_US,tu["en-gb"],eu.en,Bc["en-SG"],$c.en_US,tu["en-sg"],eu.en,Bc["en-TH"],$c.en_US,tu["en-gb"],eu.en,Bc["en-US"],$c.en_US,tu["en-gb"],eu.en,Bc["en-VN"],$c.en_US,tu["en-gb"],eu.en,Bc["en-HK"],$c.en_US,tu["en-gb"],eu.en,Bc["en-KR"],$c.en_US,tu["en-gb"],eu.en,Bc["es-ES"],$c.es_ES,tu.es,eu.es,Bc["es-MX"],$c.es_ES,tu.es,eu.es,Bc["fr-FR"],$c.fr_FR,tu.fr,eu.fr,Bc["hi-IN"],$c.hi_IN,tu.hi,eu.hi,Bc.hu,$c.hu_HU,tu.hu,eu.hu,Bc["in-ID"],$c.id_ID,tu.id,eu.id,Bc["it-IT"],$c.it_IT,tu.it,eu.it,Bc["ja-JP"],$c.ja_JP,tu.ja,eu.ja,Bc.kn,$c.kn_IN,tu.kn,eu.kn,Bc["ko-KR"],$c.ko_KR,tu.ko,eu.ko,Bc.ml,$c.ml_IN,tu.ml,eu.ml,Bc["ms-MY"],$c.ms_MY,tu["ms-my"],eu["ms-my"],Bc["ne-NP"],$c.ne_NP,tu.ne,eu.ne,Bc["nl-BE"],$c.nl_BE,tu["nl-be"],eu["nl-be"],Bc["nl-NL"],$c.nl_NL,tu.nl,eu.nl,Bc["pl-PL"],$c.pl_PL,tu.pl,eu.pl,Bc["pt-BR"],$c.pt_BR,tu["pt-br"],eu["pt-br"],Bc["pt-PT"],$c.pt_PT,tu.pt,eu.pt,Bc.ro,$c.ro_RO,tu.ro,eu.ro,Bc["ru-RU"],$c.ru_RU,tu.ru,eu.ru,Bc["si-LK"],$c.si_LK,tu.si,eu.si,Bc["sk-SK"],$c.sk_SK,tu.sk,eu.sk,Bc.sr,$c.sr_RS,tu.sr,eu.sr,Bc["sv-SE"],$c.sv_SE,tu.sv,eu.sv,Bc.ta,$c.ta_IN,tu.ta,eu.ta,Bc["th-TH"],$c.th_TH,tu.th,eu.th,Bc["tr-TR"],$c.tr_TR,tu.tr,eu.tr,Bc["uk-UA"],$c.uk_UA,tu.uk,eu.uk,Bc["ur-PK"],$c.ur_PK,tu.ur,eu.ur,Bc["vi-VN"],$c.vi_VN,tu.vi,eu.vi,Bc["zh-CN"],$c.zh_CN,tu["zh-cn"],eu["zh-cn"],Bc["zh-HK"],$c.zh_HK,tu["zh-hk"],eu["zh-hk"],Bc["zh-SG"],$c.zh_HK,tu["zh-hk"],eu["zh-hk"],Bc["zh-TW"],$c.zh_TW,tu["zh-tw"],eu["zh-tw"],Bc["kk-KZ"],$c.kk_KZ,tu.kk,eu.kk;!function(e){e.ar_SA="ar_SA",e.kn="kn",e.as="as",e.bho="bho",e.pl_PL="pl_PL",e.ko_KR="ko_KR",e.da_DK="da_DK",e.de_DE="de_DE",e.ru_RU="ru_RU",e.fr_FR="fr_FR",e.gu="gu",e.nl_BE="nl_BE",e.nl_NL="nl_NL",e.cs_CZ="cs_CZ",e.ro="ro",e.lo_LA="lo_LA",e.my_MM="my_MM",e.bn_BD="bn_BD",e.bn_IN="bn_IN",e.mr="mr",e.ms_MY="ms_MY",e.ml="ml",e.mni="mni",e.ne_NP="ne_NP",e.or="or",e.pt_BR="pt_BR",e.pt_PT="pt_PT",e.pa="pa",e.sv_SE="sv_SE",e.ja_JP="ja_JP",e.sr="sr",e.si_LK="si_LK",e.sk_SK="sk_SK",e.tr_TR="tr_TR",e.tl_PH="tl_PH",e.te="te",e.ta="ta",e.th_TH="th_TH",e.ur_PK="ur_PK",e.ur_IN="ur_IN",e.uk_UA="uk_UA",e.iw_IL="iw_IL",e.es_ES="es_ES",e.es_MX="es_MX",e.hu="hu",e.it_IT="it_IT",e.in_ID="in_ID",e.hi_IN="hi_IN",e.vi_VN="vi_VN",e.en_PK="en_PK",e.en_PL="en_PL",e.en_FR="en_FR",e.en_PH="en_PH",e.en_CZ="en_CZ",e.en_CA="en_CA",e.en_MM="en_MM",e.en_US="en_US",e.en_BD="en_BD",e.en_MY="en_MY",e.en_NP="en_NP",e.en_LK="en_LK",e.en_TH="en_TH",e.en_ES="en_ES",e.en_SG="en_SG",e.en_HU="en_HU",e.en_ID="en_ID",e.en_GB="en_GB",e.en_VN="en_VN",e.en_HK="en_HK",e.en_KR="en_KR",e.zh_TW="zh_TW",e.zh_HK="zh_HK",e.zh_SG="zh_SG",e.zh_CN="zh_CN",e.ar_IQ="ar_IQ",e.ckb_IQ="ckb_IQ",e.ku="ku",e.kk_KZ="kk_KZ",e.af="af",e.am="am",e.az="az",e.be="be",e.bg="bg",e.bs="bs",e.ca="ca",e.cy="cy",e.el="el",e.eo="eo",e.et="et",e.eu="eu",e.fa="fa",e.fi="fi",e.gd="gd",e.gl="gl",e.ha="ha",e.haw="haw",e.hr="hr",e.ig="ig",e.is="is",e.ka="ka",e.km="km",e.ky="ky",e.lb="lb",e.ln="ln",e.lt="lt",e.lv="lv",e.mg="mg",e.mk="mk",e.mn="mn",e.mt="mt",e.om="om",e.ps="ps",e.qu="qu",e.rw="rw",e.sl="sl",e.so="so",e.sq="sq",e.sw="sw",e.tg="tg",e.ti="ti",e.ug="ug",e.uz="uz",e.yo="yo",e.zu="zu"}(bu||(bu={}));var Au,Su,ku=ou(bu),Tu={};Tu[bu.kn]="AiNaDeYu",Tu[bu.ar_SA]="ALaBoYu (ShaTeALaBo)",Tu[bu.ar_IQ]="ALaBoYu (YiLaKe)",Tu[bu.as]="ASaMuYu",Tu[bu.bho]="BoJiePuErYu",Tu[bu.pl_PL]="BoLanYu (BoLan)",Tu[bu.ko_KR]="ChaoXianYu (HanGuo)",Tu[bu.da_DK]="DanMaiYu (DanMai)",Tu[bu.de_DE]="DeYu (DeGuo)",Tu[bu.ru_RU]="EYu (ELuoSi)",Tu[bu.fr_FR]="FaYu (FaGuo)",Tu[bu.gu]="GuJiaLaTiYu",Tu[bu.nl_BE]="HeLanYu (BiLiShi)",Tu[bu.nl_NL]="HeLanYu (HeLan)",Tu[bu.cs_CZ]="JieKeYu (JieKeGongHeGuo)",Tu[bu.ku]="KuErDeYu",Tu[bu.lo_LA]="LaoWoYu (LaoWo)",Tu[bu.ro]="LuoMaNiYaYu",Tu[bu.mr]="MaLaDiYu",Tu[bu.ms_MY]="MaLaiYu (MaLaiXiYa)",Tu[bu.ml]="MaLaiYaLaMuYu",Tu[bu.mni]="ManNiPuLiYu",Tu[bu.bn_BD]="MengJiaLaYu (MengJiaLa)",Tu[bu.bn_IN]="MengJiaLaYu (YinDu)",Tu[bu.my_MM]="MianDianYu (MianDian)",Tu[bu.ne_NP]="NiBoErYu (NiBoEr)",Tu[bu.or]="OuLiYaYu",Tu[bu.pa]="PangZhePuYu",Tu[bu.pt_BR]="PuTaoYaYu (BaXi)",Tu[bu.pt_PT]="PuTaoYaYu (PuTaoYa)",Tu[bu.ja_JP]="RiYu (RiBen)",Tu[bu.sv_SE]="RuiDianYu (RuiDian)",Tu[bu.sr]="SaiErWeiYaYu",Tu[bu.si_LK]="SengJiaLuoYu (SiLiLanKa)",Tu[bu.sk_SK]="SiLuoFaKeYu (SiLuoFaKe)",Tu[bu.te]="TaiLuGuYu",Tu[bu.ta]="TaiMiErYu",Tu[bu.th_TH]="TaiYu (TaiGuo)",Tu[bu.tl_PH]="TaJiaLuZuYu (FeiLvBin)",Tu[bu.tr_TR]="TuErQiYu (TuErQi)",Tu[bu.ur_PK]="WuErDuYu (BaJiSiTan)",Tu[bu.ur_IN]="WuErDuYu (YinDu)",Tu[bu.uk_UA]="WuKeLanYu (WuKeLan)",Tu[bu.es_ES]="XiBanYaYu (XiBanYa)",Tu[bu.es_MX]="XiBanYaYu (MoXiGe)",Tu[bu.iw_IL]="XiBoLaiYu (YiSeLie)",Tu[bu.hu]="XiongYaLiYu",Tu[bu.it_IT]="YiDaLiYu (YiDaLi)",Tu[bu.hi_IN]="YinDiYu (YinDu)",Tu[bu.in_ID]="YinDuNiXiYaYu (YinDuNiXiYa)",Tu[bu.en_PK]="YingYu (BaJiSiTan)",Tu[bu.en_PL]="YingYu (BoLan)",Tu[bu.en_FR]="YingYu (FaGuo)",Tu[bu.en_PH]="YingYu (FeiLvBin)",Tu[bu.en_CA]="YingYu (JiaNaDa)",Tu[bu.en_CZ]="YingYu (JieKeGongHeGuo)",Tu[bu.en_MY]="YingYu (MaLaiXiYa)",Tu[bu.en_US]="YingYu (MeiGuo)",Tu[bu.en_BD]="YingYu (MengJiaLa)",Tu[bu.en_MM]="YingYu (MianDian)",Tu[bu.en_NP]="YingYu (NiBoEr)",Tu[bu.en_LK]="YingYu (SiLiLanKa)",Tu[bu.en_TH]="YingYu (TaiGuo)",Tu[bu.en_ES]="YingYu (XiBanYa)",Tu[bu.en_SG]="YingYu (XinJiaPo)",Tu[bu.en_HU]="YingYu (XiongYaLi)",Tu[bu.en_ID]="YingYu (YinDuNiXiYa)",Tu[bu.en_GB]="YingYu (YingGuo)",Tu[bu.en_VN]="YingYu (YueNan)",Tu[bu.en_HK]="YingYu (XiangGang)",Tu[bu.en_KR]="YingYu (HanGuo)",Tu[bu.vi_VN]="YueNanYu (YueNan)",Tu[bu.ckb_IQ]="ZhongKuErDeYu (YiLaKe)",Tu[bu.zh_TW]="ZhongWen (TaiWanDiQu)",Tu[bu.zh_HK]="ZhongWen (XiangGang)",Tu[bu.zh_SG]="ZhongWen (XinJiaPo)",Tu[bu.zh_CN]="ZhongWen (ZhongGuo)",Tu[bu.kk_KZ]="HaSaKeYu (HaSaKeSiTan)",Tu[bu.af]="NanFeiYu",Tu[bu.am]="AMuHaLaYu",Tu[bu.az]="ASaiBaiJiangYu",Tu[bu.be]="BaiErLuoSiYu",Tu[bu.bg]="BaoJiaLiYaYu",Tu[bu.bs]="BoSiNiYaYu",Tu[bu.ca]="JiaTaiLuoNiYaYu",Tu[bu.cy]="WeiErShiYu",Tu[bu.el]="XianDaiXiLaYu",Tu[bu.eo]="ShiJieYu",Tu[bu.et]="AiShaNiYaYu",Tu[bu.eu]="BaSiKeYu",Tu[bu.fa]="BoSiYu",Tu[bu.fi]="FenLanYu",Tu[bu.gd]="AiErLanYu",Tu[bu.gl]="JiaLiXiYaYu",Tu[bu.ha]="HaoSaYu",Tu[bu.haw]="XiaWeiYiYu",Tu[bu.hr]="KeLuoDiYaYu",Tu[bu.ig]="YiBoYu",Tu[bu.is]="BingDaoYu",Tu[bu.ka]="GeLuJiYaYu",Tu[bu.km]="GaoMianYu",Tu[bu.ky]="JiErJiSiYu",Tu[bu.lb]="LuSenBaoYu",Tu[bu.ln]="LinGeLaYu",Tu[bu.lt]="LiTaoWanYu",Tu[bu.lv]="LaTuoWeiYaYu",Tu[bu.mg]="MaErJiaShiYu",Tu[bu.mk]="MaQiDunYu",Tu[bu.mn]="MengGuWen",Tu[bu.mt]="MaErTaYu",Tu[bu.om]="AoLuoMoYu",Tu[bu.ps]="PuShiTuYu",Tu[bu.qu]="KeQiuYaYu",Tu[bu.rw]="LuWangDaYu",Tu[bu.sl]="SiLuoWeiNiYaYu",Tu[bu.so]="SuoMaLiYu",Tu[bu.sq]="AErBaNiYaYu",Tu[bu.sw]="SiWaXiLiYu",Tu[bu.tg]="TaJiKeYu",Tu[bu.ti]="DiGeNiYaYu",Tu[bu.ug]="WeiWuErYu",Tu[bu.uz]="WuZiBieKeYu",Tu[bu.yo]="YueLuBaYu",Tu[bu.zu]="ZuLuYu",function(e){e.AiSelected="AiSelected",e.Aliyun="Aliyun",e["ChatGPT3.5"]="ChatGPT3.5",e.Google="Google",e.Papago="Papago",e.DeepL="DeepL",e.Microsoft="Microsoft",e.Amazon="Amazon"}(Au||(Au={})),function(e){e.AiSelected="AiSelected",e.Aliyun="Aliyun",e["ChatGPT3.5"]="ChatGPT3.5",e.Google="Google",e.Papago="Papago",e.DeepL="DeepL",e.Microsoft="Microsoft",e.Amazon="Amazon"}(Su||(Su={})),ou(Su);var Pu=Object.assign(Object.assign({},Su),{TranslationMemory:"TranslationMemory"}),Iu=(ou(Pu),{aliyunSupportedLanguages:["ab","sq","ak","ar","an","am","as","az","ast","nch","ee","ay","ga","et","oj","oc","or","om","os","tpi","ba","eu","be","ber","bm","pag","bg","se","bem","byn","bi","bal","is","pl","bs","fa","bho","br","ch","cbk","cv","ts","tt","da","shn","tet","de","nds","sco","dv","kdx","dtp","ru","fo","fr","sa","fil","fj","fi","fur","fvr","kg","km","ngu","kl","ka","gos","gu","gn","kk","ht","ko","ha","nl","cnr","hup","gil","rn","quc","ky","gl","ca","cs","kab","kn","kr","csb","kha","kw","xh","co","mus","crh","tlh","hbs","qu","ks","ku","la","ltg","lv","lo","lt","li","ln","lg","lb","rue","rw","ro","rm","rom","jbo","mg","gv","mt","mr","ml","ms","chm","mk","mh","kek","mai","mfe","mi","mn","bn","my","hmn","umb","nv","af","ne","niu","no","pmn","pap","pa","pt","ps","ny","tw","chr","ja","sv","sm","sg","si","hsb","eo","sl","sw","so","sk","tl","tg","ty","te","ta","th","to","toi","ti","tvl","tyv","tr","tk","wa","war","cy","ve","vo","wo","udm","ur","uz","es","ie","fy","szl","he","hil","haw","el","lfn","sd","hu","sn","ceb","syr","su","hy","ace","iba","ig","io","ilo","iu","it","yi","ia","hi","id","inh","en","yo","vi","zza","jv","zh","zh-tw","yue","zu"],mapAliyunLanguage:function(e){if(e===bu.zh_HK||e===bu.zh_TW||e===bu.zh_SG)return"zh-tw";if(e===bu.in_ID)return"id";if(e===bu.iw_IL)return"he";var t=e.split("_")[0];return iu(Iu.aliyunSupportedLanguages,t)?t:null},googleSupportedLanguages:["af","sq","am","ar","hy","as","ay","az","bm","eu","be","bn","bho","bs","bg","ca","ceb","zh","zh-CN","zh-TW","co","hr","cs","da","dv","doi","nl","en","eo","et","ee","fil","fi","fr","fy","gl","ka","de","el","gn","gu","ht","ha","haw","he","iw","hi","hmn","hu","is","ig","ilo","id","ga","it","ja","jv","jw","kn","kk","km","rw","gom","ko","kri","ku","ckb","ky","lo","la","lv","ln","lt","lg","lb","mk","mai","mg","ms","ml","mt","mi","mr","mni-Mtei","lus","mn","my","ne","no","ny","or","om","ps","fa","pl","pt","pa","qu","ro","ru","sm","sa","gd","nso","sr","st","sn","sd","si","sk","sl","so","es","su","sw","sv","tl","tg","ta","tt","te","th","ti","ts","tr","tk","ak","uk","ur","ug","uz","vi","cy","xh","yi","yo","zu"],mapGoogleLanguage:function(e){if(e===bu.zh_HK||e===bu.zh_TW||e===bu.zh_SG)return"zh-TW";if(e===bu.in_ID)return"id";if(e===bu.mni)return"mni-Mtei";var t=e.split("_")[0];return iu(Iu.googleSupportedLanguages,t)?t:null},papagoSupportedLanguages:["ko","en","ja","zh-CN","zh-TW"],mapPapagoLanguage:function(e){if(e===bu.zh_CN)return"zh-CN";if(e===bu.zh_HK||e===bu.zh_TW||e===bu.zh_SG)return"zh-TW";var t=e.split("_")[0];return iu(Iu.papagoSupportedLanguages,t)?t:null},deepLSupportedSourceLanguages:["AR","BG","CS","DA","DE","EL","EN","ES","ET","FI","FR","HU","ID","IT","JA","KO","LT","LV","NB","NL","PL","PT","RO","RU","SK","SL","SV","TR","UK","ZH"],deepLSupportedLanguages:["AR","BG","CS","DA","DE","EL","EN-GB","EN-US","ES","ET","FI","FR","HU","ID","IT","JA","KO","LT","LV","NB","NL","PL","PT-BR","PT-PT","RO","RU","SK","SL","SV","TR","UK","ZH"],mapDeepLSourceLanguage:function(e){var t=e.toUpperCase();if(e===bu.in_ID)return"ID";var n=t.split("_")[0];return iu(Iu.deepLSupportedSourceLanguages,n)?n:null},mapDeepLLanguage:function(e){var t=e.toUpperCase();if(e===bu.zh_CN||e===bu.zh_SG)return"ZH";if(e===bu.zh_HK||e===bu.zh_TW)return null;if(e===bu.en_GB||e===bu.en_US||e===bu.pt_BR||e===bu.pt_PT)return t.replace("_","-");if(e===bu.in_ID)return"ID";var n=t.split("_")[0];return"EN"===n?"EN-US":iu(Iu.deepLSupportedLanguages,n)?n:null},microsoftSupportedLanguages:["af","sq","am","ar","hy","as","az","bn","ba","eu","bho","brx","bs","bg","yue","ca","lzh","zh-Hans","zh-Hant","sn","hr","cs","da","prs","dv","doi","nl","en","et","fo","fj","fil","fi","fr","fr-ca","gl","ka","de","el","gu","ht","ha","he","hi","mww","hu","is","ig","id","ikt","iu","iu-Latn","ga","it","ja","kn","ks","kk","km","rw","tlh-Latn","tlh-Piqd","gom","ko","ku","kmr","ky","lo","lv","lt","ln","dsb","lug","mk","mai","mg","ms","ml","mt","mi","mr","mn-Cyrl","mn-Mong","my","ne","nb","nya","or","ps","fa","pl","pt","pt-pt","pa","otq","ro","run","ru","sm","sr-Cyrl","sr-Latn","st","nso","tn","sd","si","sk","sl","so","es","sw","sv","ty","ta","tt","te","th","bo","ti","to","tr","tk","uk","hsb","ur","ug","uz","vi","cy","xh","yo","yua","zu"],mapMicrosoftLanguage:function(e){if(e===bu.pt_PT)return"pt-pt";if(e===bu.pt_BR)return"pt";if([bu.zh_CN,bu.zh_SG].includes(e))return"zh-Hans";if([bu.zh_HK,bu.zh_TW].includes(e))return"zh-Hant";if(e===bu.iw_IL)return"he";if(e===bu.in_ID)return"id";if(e===bu.ckb_IQ)return"ku";var t=e.split("_")[0];return iu(Iu.microsoftSupportedLanguages,t)?t:null},amazonSupportedLanguages:["af","sq","am","ar","hy","az","bn","bs","bg","ca","zh","zh-TW","hr","cs","da","fa-AF","nl","en","et","fa","tl","fi","fr","fr-CA","ka","de","el","gu","ht","ha","he","hi","hu","is","id","ga","it","ja","kn","kk","ko","lv","lt","mk","ms","ml","mt","mr","mn","no","ps","pl","pt","pt-PT","pa","ro","ru","sr","si","sk","sl","so","es","es-MX","sw","sv","ta","te","th","tr","uk","ur","uz","vi","cy"],mapAmazonLanguage:function(e){if(e===bu.pt_PT)return"pt-PT";if(e===bu.pt_BR)return"pt";if(e===bu.es_MX)return"es-MX";if(e===bu.in_ID)return"id";if(e===bu.zh_CN||e===bu.zh_SG)return"zh";if(e===bu.zh_HK||e===bu.zh_TW)return"zh-TW";var t=e.split("_")[0];return iu(Iu.amazonSupportedLanguages,t)?t:null}}),Cu={};Cu[Su.AiSelected]=ku,Cu[Su.Aliyun]=ku.filter((function(e){return Boolean(Iu.mapAliyunLanguage(e))})),Cu[Su["ChatGPT3.5"]]=ku,Cu[Su.Google]=ku.filter((function(e){return Boolean(Iu.mapGoogleLanguage(e))})),Cu[Su.Papago]=ku.filter((function(e){return Boolean(Iu.mapPapagoLanguage(e))})),Cu[Su.DeepL]=ku.filter((function(e){return Boolean(Iu.mapDeepLLanguage(e))})),Cu[Su.Microsoft]=ku.filter((function(e){return Boolean(Iu.mapMicrosoftLanguage(e))})),Cu[Su.Amazon]=ku.filter((function(e){return Boolean(Iu.mapAmazonLanguage(e))}));var wu={};wu[Su.AiSelected]=ku,wu[Su.Aliyun]=ku.filter((function(e){return Boolean(Iu.mapAliyunLanguage(e))})),wu[Su["ChatGPT3.5"]]=ku,wu[Su.Google]=ku.filter((function(e){return Boolean(Iu.mapGoogleLanguage(e))})),wu[Su.Papago]=ku.filter((function(e){return Boolean(Iu.mapPapagoLanguage(e))})),wu[Su.DeepL]=ku.filter((function(e){return Boolean(Iu.mapDeepLSourceLanguage(e))})),wu[Su.Microsoft]=ku.filter((function(e){return Boolean(Iu.mapMicrosoftLanguage(e))})),wu[Su.Amazon]=ku.filter((function(e){return Boolean(Iu.mapAmazonLanguage(e))})),Nu=ku.map((function(e){return[e,ou(Su).filter((function(t){return iu(Cu[t],e)}))]})),Ou={},Object.keys(Nu||{}).forEach((function(e){var t=Nu[e],n=t[0],r=t[1];Ou[n]=r}));var Nu,Ou,Ru={};Ru[bu.ar_SA]="العربية)السعودية)",Ru[bu.kn]="ಕನ್ನಡ",Ru[bu.as]="অসমীয়া",Ru[bu.bho]="भोजपुरी",Ru[bu.pl_PL]="Polski (Polska)",Ru[bu.ko_KR]="한국어 (대한민국)",Ru[bu.da_DK]="Dansk (Danmark)",Ru[bu.de_DE]="Deutsch (Deutschland)",Ru[bu.ru_RU]="Русский (Россия)",Ru[bu.fr_FR]="Français (France)",Ru[bu.gu]="ગુજરાતી",Ru[bu.nl_BE]="Nederlands (Belgium)",Ru[bu.nl_NL]="Nederlands (Nederland)",Ru[bu.cs_CZ]="Čeština (Česká republika)",Ru[bu.ro]="Română",Ru[bu.lo_LA]="ລາວ (ລາວ)",Ru[bu.my_MM]="မြန်မာဘာသာ (မြန်မာ)",Ru[bu.bn_BD]="বাংলা (বাংলাদেশ)",Ru[bu.bn_IN]="বাংলা (ভারত)",Ru[bu.mr]="मराठी",Ru[bu.ms_MY]="Bahasa Melayu (Malaysia)",Ru[bu.ml]="മലയാളം",Ru[bu.mni]="ꯃꯩꯇꯩꯂꯣꯟ",Ru[bu.ne_NP]="नेपाली (नेपाल)\t",Ru[bu.or]="ଓଡ଼ିଆ",Ru[bu.pt_BR]="Português (Brasil)",Ru[bu.pt_PT]="Português (Portugal)",Ru[bu.pa]="پنجابی",Ru[bu.sv_SE]="Svenska (Sverige)",Ru[bu.ja_JP]="日本語",Ru[bu.sr]="Српски",Ru[bu.si_LK]="සිංහල (ශ්රී ලංකාව)",Ru[bu.sk_SK]="Slovenčina (Slovensko)",Ru[bu.tr_TR]="Türkçe (Türkiye)",Ru[bu.tl_PH]="Wikang Tagalog (Philippines)",Ru[bu.te]="తెలుగు",Ru[bu.ta]="தமிழ்",Ru[bu.th_TH]="ไทย (ประเทศไทย)",Ru[bu.ur_PK]="اردو)پاکستان)",Ru[bu.ur_IN]="اردو)بھارت)",Ru[bu.uk_UA]="Українська (Україна)",Ru[bu.iw_IL]="עִבְרִית (ישראל)",Ru[bu.es_ES]="Español (España)",Ru[bu.es_MX]="Español (México)",Ru[bu.hu]="Magyar",Ru[bu.it_IT]="Italiano (Italia)",Ru[bu.in_ID]="Bahasa Indonesia (Indonesia)",Ru[bu.hi_IN]="हिन्दी (भारत)",Ru[bu.vi_VN]="Tiếng Việt (Việt Nam)",Ru[bu.en_PK]="English (Pakistan)",Ru[bu.en_PL]="English (Poland)",Ru[bu.en_FR]="English (France)",Ru[bu.en_PH]="English (Philippines)",Ru[bu.en_CZ]="English (Czech Republic)",Ru[bu.en_CA]="English (Canada)",Ru[bu.en_MM]="English (Myanmar)",Ru[bu.en_US]="English (United States)",Ru[bu.en_BD]="English (Bangladesh)",Ru[bu.en_MY]="English (Malaysia)",Ru[bu.en_NP]="English (Nepal)",Ru[bu.en_LK]="English (Sri Lanka)",Ru[bu.en_TH]="English (Thailand)",Ru[bu.en_ES]="English (Spain)",Ru[bu.en_SG]="English (Singapore)",Ru[bu.en_HU]="English (Hungary)",Ru[bu.en_ID]="English (Indonesia)",Ru[bu.en_GB]="English (Great Britain)",Ru[bu.en_VN]="English (Vietnam)",Ru[bu.en_HK]="English (Hong Kong)",Ru[bu.en_KR]="English (Korea)",Ru[bu.zh_TW]="繁体中文 (中國台灣)",Ru[bu.zh_HK]="繁体中文 (中國香港)",Ru[bu.zh_SG]="简体中文 (新加坡)",Ru[bu.zh_CN]="简体中文",Ru[bu.ar_IQ]="العربية (العراق)",Ru[bu.ckb_IQ]="کوردیی ناوەندی (عێراق)",Ru[bu.ku]="کورمانجی",Ru[bu.kk_KZ]="قازاقشا ",Ru[bu.af]="Afrikaans",Ru[bu.am]="አማርኛ",Ru[bu.az]="Azərbaycan",Ru[bu.be]="беларуская мова",Ru[bu.bg]="Български",Ru[bu.bs]="босански",Ru[bu.ca]="Català",Ru[bu.cy]="Cymraeg",Ru[bu.el]="Ελληνικά",Ru[bu.eo]="Esperanto",Ru[bu.et]="eesti keel",Ru[bu.eu]="Euskara",Ru[bu.fa]="فارسی",Ru[bu.fi]="Suomi",Ru[bu.gd]="Gaeilge",Ru[bu.gl]="Galego",Ru[bu.ha]="هَوُسَ",Ru[bu.haw]="ʻŌlelo Hawaiʻi",Ru[bu.hr]="Hrvatski",Ru[bu.ig]="Asụsụ Igbo",Ru[bu.is]="Íslenska",Ru[bu.ka]="ქართული",Ru[bu.km]="ភាសាខ្មែរ",Ru[bu.ky]="кыргыз тили",Ru[bu.lb]="Lëtzebuergesch",Ru[bu.ln]="Lingála",Ru[bu.lt]="lietuvių kalba",Ru[bu.lv]="Latviešu valoda",Ru[bu.mg]="malagasy",Ru[bu.mk]="македонски",Ru[bu.mn]="монгол хэл",Ru[bu.mt]="Malti",Ru[bu.om]="Oromoo",Ru[bu.ps]="پښتو",Ru[bu.qu]="Quechua",Ru[bu.rw]="Ikinyarwanda",Ru[bu.sl]="slovenščina",Ru[bu.so]="Af-Soomaali",Ru[bu.sq]="Gjuha shqipe",Ru[bu.sw]="Kiswahili",Ru[bu.tg]="тоҷикӣ",Ru[bu.ti]="ትግርኛ",Ru[bu.ug]="ئۇيغۇر تىلى",Ru[bu.uz]="Ўзбек тили",Ru[bu.yo]="Èdè Yorùbá",Ru[bu.zu]="isiZulu",Su.AiSelected,(au={})[bu.en_US]="AI Selected",au[bu.zh_CN]="AI 精选",(su={})[bu.en_US]="AI selection of translations",su[bu.zh_CN]="多渠道翻译的 AI 精选",wu.AiSelected,Cu.AiSelected,(lu={})[bu.en_US]="Use ChatGPT 4.0 to compare and select translation results from multiple sources.\nThe translated content will undergo risk control review and may return blank, please check carefully.",lu[bu.zh_CN]="利用 ChatGPT 4.0 进行多渠道翻译结果的对比和精选;\n翻译内容会经过风控审核,可能会返回空内容,请仔细检查;",(cu={})[bu.en_US]="Use ChatGPT 4.0 to compare and select translation results from multiple sources.\nThe translated content will undergo risk control review and may return blank, please check carefully.",cu[bu.zh_CN]="利用 ChatGPT 4.0 进行多渠道翻译结果的对比和精选;\n翻译内容会经过风控审核,可能会返回空内容,请仔细检查;",Su["ChatGPT3.5"],(uu={})[bu.en_US]="GPT-3.5",uu[bu.zh_CN]="GPT-3.5",(du={})[bu.en_US]="The translated content will undergo risk control review and may return blank, please check carefully.",du[bu.zh_CN]="翻译内容会经过风控审核,可能会返回空内容,请仔细检查",(pu={})[bu.en_US]="The translated content will undergo risk control review and may return blank, please check carefully.",pu[bu.zh_CN]="翻译内容会经过风控审核,可能会返回空内容,请仔细检查",wu["ChatGPT3.5"],Cu["ChatGPT3.5"],Su.Aliyun,(hu={})[bu.en_US]="Alibaba",hu[bu.zh_CN]="阿里云",wu.Aliyun,Cu.Aliyun,Su.Google,(mu={})[bu.en_US]="Google",mu[bu.zh_CN]="Google",wu.Google,Cu.Google,Su.DeepL,(fu={})[bu.en_US]="DeepL",fu[bu.zh_CN]="DeepL",wu.DeepL,Cu.DeepL,Su.Microsoft,(vu={})[bu.en_US]="Azure AI",vu[bu.zh_CN]="Azure AI",wu.Microsoft,Cu.Microsoft,Su.Amazon,(gu={})[bu.en_US]="Amazon",gu[bu.zh_CN]="Amazon",wu.Amazon,Cu.Amazon,Su.Papago,(yu={})[bu.en_US]="Papago",yu[bu.zh_CN]="Papago",(_u={})[bu.en_US]="Papago does not support translating HTML and will automatically skip HTML content during batch translation.",_u[bu.zh_CN]="Papago 不支持翻译 HTML,在批量翻译时会自动跳过 HTML 内容",(Eu={})[bu.en_US]="Papago does not support HTML. Available locales are Chinese, Japanese, Korean, and English. Please check the translation results carefully.",Eu[bu.zh_CN]="Papago 不支持翻译 HTML,仅支持翻译中、日、韩、英,请仔细检查翻译结果",wu.Papago,Cu.Papago;var Mu=Object.keys(Bc).map((function(e){return Bc[e]})),Du=/^##@@@(.+?)##(.+?)@@@##(.+?)@@@##$/,Lu=function(e,t){return(Lu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function xu(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Lu(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Uu,Ku,Bu,Yu=function(){return(Yu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function Fu(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Hu(e){return e.type===Ku.literal}function ju(e){return e.type===Ku.argument}function Vu(e){return e.type===Ku.number}function Gu(e){return e.type===Ku.date}function zu(e){return e.type===Ku.time}function Wu(e){return e.type===Ku.select}function qu(e){return e.type===Ku.plural}function Ju(e){return e.type===Ku.pound}function Qu(e){return e.type===Ku.tag}function Zu(e){return!(!e||"object"!=Je()(e)||e.type!==Bu.number)}function Xu(e){return!(!e||"object"!=Je()(e)||e.type!==Bu.dateTime)}"function"==typeof SuppressedError&&SuppressedError,function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(Uu||(Uu={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(Ku||(Ku={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(Bu||(Bu={}));var $u=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,ed=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function td(e){var t={};return e.replace(ed,(function(e){var n=e.length;switch(e[0]){case"G":t.era=4===n?"long":5===n?"narrow":"short";break;case"y":t.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===n?"short":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}var nd=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i,rd=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,od=/^(@+)?(\+|#+)?[rs]?$/g,id=/(\*)(0+)|(#+)(0+)|(0+)/g,ad=/^(0+)$/;function sd(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(od,(function(e,n,r){return"string"!=typeof r?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===r?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),t}function ld(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function cd(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!ad.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function ud(e){return ld(e)||{}}function dd(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n];switch(o.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=o.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=o.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=Yu(Yu(Yu({},t),{notation:"scientific"}),o.options.reduce((function(e,t){return Yu(Yu({},e),ud(t))}),{}));continue;case"engineering":t=Yu(Yu(Yu({},t),{notation:"engineering"}),o.options.reduce((function(e,t){return Yu(Yu({},e),ud(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(o.options[0]);continue;case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(id,(function(e,n,r,o,i,a){if(n)t.minimumIntegerDigits=r.length;else{if(o&&i)throw new Error("We currently do not support maximum integer digits");if(a)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(ad.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(rd.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(rd,(function(e,n,r,o,i,a){return"*"===r?t.minimumFractionDigits=n.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:i&&a?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+a.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var i=o.options[0];"w"===i?t=Yu(Yu({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=Yu(Yu({},t),sd(i)))}else if(od.test(o.stem))t=Yu(Yu({},t),sd(o.stem));else{var a=ld(o.stem);a&&(t=Yu(Yu({},t),a));var s=cd(o.stem);s&&(t=Yu(Yu({},t),s))}}return t}var pd,hd={"001":["H","h"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["H","h","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["H","hB","h","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["H","h","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["H","hB","h","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["H","h","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["H","h","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["H","h","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["H","h","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["H","hB","h","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["H","h","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["H","h","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["H","h","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function md(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n,r=e.language;return"root"!==r&&(n=e.maximize().region),(hd[n||""]||hd[r||""]||hd["".concat(r,"-001")]||hd["001"])[0]}var fd=new RegExp("^".concat($u.source,"*")),vd=new RegExp("".concat($u.source,"*$"));function gd(e,t){return{start:e,end:t}}var yd=!!String.prototype.startsWith&&"_a".startsWith("a",1),_d=!!String.fromCodePoint,Ed=!!Object.fromEntries,bd=!!String.prototype.codePointAt,Ad=!!String.prototype.trimStart,Sd=!!String.prototype.trimEnd,kd=Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Td=!0;try{Td="a"===(null===(pd=Md("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===pd?void 0:pd[0])}catch(Bc){Td=!1}var Pd,Id=yd?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},Cd=_d?String.fromCodePoint:function(){for(var e=arguments,t=[],n=0;n<arguments.length;n++)t[n]=e[n];for(var r,o="",i=t.length,a=0;i>a;){if((r=t[a++])>1114111)throw RangeError(r+" is not a valid code point");o+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return o},wd=Ed?Object.fromEntries:function(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n],i=o[0],a=o[1];t[i]=a}return t},Nd=bd?function(e,t){return e.codePointAt(t)}:function(e,t){var n=e.length;if(!(t<0||t>=n)){var r,o=e.charCodeAt(t);return o<55296||o>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?o:r-56320+(o-55296<<10)+65536}},Od=Ad?function(e){return e.trimStart()}:function(e){return e.replace(fd,"")},Rd=Sd?function(e){return e.trimEnd()}:function(e){return e.replace(vd,"")};function Md(e,t){return new RegExp(e,t)}if(Td){var Dd=Md("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Pd=function(e,t){var n;return Dd.lastIndex=t,null!==(n=Dd.exec(e)[1])&&void 0!==n?n:""}}else Pd=function(e,t){for(var n=[];;){var r=Nd(e,t);if(void 0===r||Ud(r)||Kd(r))break;n.push(r),t+=r>=65536?2:1}return Cd.apply(void 0,n)};var Ld=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var o=this.char();if(123===o){if((i=this.parseArgument(e,n)).err)return i;r.push(i.val)}else{if(125===o&&e>0)break;if(35!==o||"plural"!==t&&"selectordinal"!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(Uu.UNMATCHED_CLOSING_TAG,gd(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&xd(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;r.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;r.push(i.val)}}else{var a=this.clonePosition();this.bump(),r.push({type:Ku.pound,location:gd(a,this.clonePosition())})}}}return{val:r,err:null}},e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Ku.literal,value:"<".concat(r,"/>"),location:gd(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var i=o.val,a=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!xd(this.char()))return this.error(Uu.INVALID_TAG,gd(a,this.clonePosition()));var s=this.clonePosition();return r!==this.parseTagName()?this.error(Uu.UNMATCHED_CLOSING_TAG,gd(s,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:Ku.tag,value:r,children:i,location:gd(n,this.clonePosition())},err:null}:this.error(Uu.INVALID_TAG,gd(a,this.clonePosition())))}return this.error(Uu.UNCLOSED_TAG,gd(n,this.clonePosition()))}return this.error(Uu.INVALID_TAG,gd(n,this.clonePosition()))},e.prototype.parseTagName=function(){var e,t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var o=this.tryParseQuote(t);if(o)r+=o;else{var i=this.tryParseUnquoted(e,t);if(i)r+=i;else{var a=this.tryParseLeftAngleBracket();if(!a)break;r+=a}}}var s=gd(n,this.clonePosition());return{val:{type:Ku.literal,value:r,location:s},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(xd(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(n);this.bump()}return Cd.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),Cd(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(Uu.EXPECT_ARGUMENT_CLOSING_BRACE,gd(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(Uu.EMPTY_ARGUMENT,gd(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(Uu.MALFORMED_ARGUMENT,gd(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Uu.EXPECT_ARGUMENT_CLOSING_BRACE,gd(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Ku.argument,value:r,location:gd(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(Uu.EXPECT_ARGUMENT_CLOSING_BRACE,gd(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(Uu.MALFORMED_ARGUMENT,gd(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=Pd(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:gd(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,r){var o,i=this.clonePosition(),a=this.parseIdentifierIfPossible().value,s=this.clonePosition();switch(a){case"":return this.error(Uu.EXPECT_ARGUMENT_TYPE,gd(i,s));case"number":case"date":case"time":this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((g=this.parseSimpleArgStyleIfPossible()).err)return g;if(0===(h=Rd(g.val)).length)return this.error(Uu.EXPECT_ARGUMENT_STYLE,gd(this.clonePosition(),this.clonePosition()));l={style:h,styleLocation:gd(c,this.clonePosition())}}if((y=this.tryParseArgumentClose(r)).err)return y;var u=gd(r,this.clonePosition());if(l&&Id(null==l?void 0:l.style,"::",0)){var d=Od(l.style.slice(2));if("number"===a)return(g=this.parseNumberSkeletonFromString(d,l.styleLocation)).err?g:{val:{type:Ku.number,value:n,location:u,style:g.val},err:null};if(0===d.length)return this.error(Uu.EXPECT_DATE_TIME_SKELETON,u);var p=d;this.locale&&(p=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e.charAt(r);if("j"===o){for(var i=0;r+1<e.length&&e.charAt(r+1)===o;)i++,r++;var a=1+(1&i),s=i<2?1:3+(i>>1),l=md(t);for("H"!=l&&"k"!=l||(s=0);s-- >0;)n+="a";for(;a-- >0;)n=l+n}else n+="J"===o?"H":o}return n}(d,this.locale));var h={type:Bu.dateTime,pattern:p,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?td(p):{}};return{val:{type:"date"===a?Ku.date:Ku.time,value:n,location:u,style:h},err:null}}return{val:{type:"number"===a?Ku.number:"date"===a?Ku.date:Ku.time,value:n,location:u,style:null!==(o=null==l?void 0:l.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":var m=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(Uu.EXPECT_SELECT_ARGUMENT_OPTIONS,gd(m,Yu({},m)));this.bumpSpace();var f=this.parseIdentifierIfPossible(),v=0;if("select"!==a&&"offset"===f.value){if(!this.bumpIf(":"))return this.error(Uu.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,gd(this.clonePosition(),this.clonePosition()));var g;if(this.bumpSpace(),(g=this.tryParseDecimalInteger(Uu.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Uu.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return g;this.bumpSpace(),f=this.parseIdentifierIfPossible(),v=g.val}var y,_=this.tryParsePluralOrSelectOptions(e,a,t,f);if(_.err)return _;if((y=this.tryParseArgumentClose(r)).err)return y;var E=gd(r,this.clonePosition());return"select"===a?{val:{type:Ku.select,value:n,options:wd(_.val),location:E},err:null}:{val:{type:Ku.plural,value:n,options:wd(_.val),offset:v,pluralType:"plural"===a?"cardinal":"ordinal",location:E},err:null};default:return this.error(Uu.INVALID_ARGUMENT_TYPE,gd(i,s))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(Uu.EXPECT_ARGUMENT_CLOSING_BRACE,gd(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();)switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(Uu.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,gd(n,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=[],n=0,r=e.split(nd).filter((function(e){return e.length>0}));n<r.length;n++){var o=r[n].split("/");if(0===o.length)throw new Error("Invalid number skeleton");for(var i=o[0],a=o.slice(1),s=0,l=a;s<l.length;s++)if(0===l[s].length)throw new Error("Invalid number skeleton");t.push({stem:i,options:a})}return t}(e)}catch(e){return this.error(Uu.INVALID_NUMBER_SKELETON,t)}return{val:{type:Bu.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?dd(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){for(var o,i=!1,a=[],s=new Set,l=r.value,c=r.location;;){if(0===l.length){var u=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var d=this.tryParseDecimalInteger(Uu.EXPECT_PLURAL_ARGUMENT_SELECTOR,Uu.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;c=gd(u,this.clonePosition()),l=this.message.slice(u.offset,this.offset())}if(s.has(l))return this.error("select"===t?Uu.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Uu.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===l&&(i=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?Uu.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Uu.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,gd(this.clonePosition(),this.clonePosition()));var h=this.parseMessage(e+1,t,n);if(h.err)return h;var m=this.tryParseArgumentClose(p);if(m.err)return m;a.push([l,{value:h.val,location:gd(p,this.clonePosition())}]),s.add(l),this.bumpSpace(),l=(o=this.parseIdentifierIfPossible()).value,c=o.location}return 0===a.length?this.error("select"===t?Uu.EXPECT_SELECT_ARGUMENT_SELECTOR:Uu.EXPECT_PLURAL_ARGUMENT_SELECTOR,gd(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(Uu.MISSING_OTHER_CLAUSE,gd(this.clonePosition(),this.clonePosition())):{val:a,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,i=0;!this.isEOF();){var a=this.char();if(!(a>=48&&a<=57))break;o=!0,i=10*i+(a-48),this.bump()}var s=gd(r,this.clonePosition());return o?kd(i*=n)?{val:i,err:null}:this.error(t,s):this.error(e,s)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=Nd(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(Id(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Ud(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();function xd(e){return e>=97&&e<=122||e>=65&&e<=90}function Ud(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Kd(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function Bd(e,t){void 0===t&&(t={}),t=Yu({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new Ld(e,t).parse();if(n.err){var r=SyntaxError(Uu[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return(null==t?void 0:t.captureLocation)||function e(t){t.forEach((function(t){if(delete t.location,Wu(t)||qu(t))for(var n in t.options)delete t.options[n].location,e(t.options[n].value);else Vu(t)&&Zu(t.style)||(Gu(t)||zu(t))&&Xu(t.style)?delete t.style.location:Qu(t)&&e(t.children)}))}(n.val),n.val}function Yd(e,t){var n=t&&t.cache?t.cache:qd,r=t&&t.serializer?t.serializer:Gd;return(t&&t.strategy?t.strategy:Vd)(e,{cache:n,serializer:r})}function Fd(e,t,n,r){var o=function(e){return null==e||"number"==typeof e||"boolean"==typeof e}(r)?r:n(r),i=t.get(o);return void 0===i&&(i=e.call(this,r),t.set(o,i)),i}function Hd(e,t,n){var r=Array.prototype.slice.call(arguments,3),o=n(r),i=t.get(o);return void 0===i&&(i=e.apply(this,r),t.set(o,i)),i}function jd(e,t,n,r,o){return n.bind(t,e,r,o)}function Vd(e,t){return jd(e,this,1===e.length?Fd:Hd,t.cache.create(),t.serializer)}var Gd=function(){return JSON.stringify(arguments)};function zd(){this.cache=Object.create(null)}zd.prototype.get=function(e){return this.cache[e]},zd.prototype.set=function(e,t){this.cache[e]=t};var Wd,qd={create:function(){return new zd}},Jd={variadic:function(e,t){return jd(e,this,Hd,t.cache.create(),t.serializer)},monadic:function(e,t){return jd(e,this,Fd,t.cache.create(),t.serializer)}};!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(Wd||(Wd={}));var Qd,Zd=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.code=n,o.originalMessage=r,o}return xu(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),Xd=function(e){function t(t,n,r,o){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),Wd.INVALID_VALUE,o)||this}return xu(t,e),t}(Zd),$d=function(e){function t(t,n,r){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),Wd.INVALID_VALUE,r)||this}return xu(t,e),t}(Zd),ep=function(e){function t(t,n){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),Wd.MISSING_VALUE,n)||this}return xu(t,e),t}(Zd);function tp(e){return"function"==typeof e}function np(e,t,n,r,o,i,a){if(1===e.length&&Hu(e[0]))return[{type:Qd.literal,value:e[0].value}];for(var s=[],l=0,c=e;l<c.length;l++){var u=c[l];if(Hu(u))s.push({type:Qd.literal,value:u.value});else if(Ju(u))"number"==typeof i&&s.push({type:Qd.literal,value:n.getNumberFormat(t).format(i)});else{var d=u.value;if(!o||!(d in o))throw new ep(d,a);var p=o[d];if(ju(u))p&&"string"!=typeof p&&"number"!=typeof p||(p="string"==typeof p||"number"==typeof p?String(p):""),s.push({type:"string"==typeof p?Qd.literal:Qd.object,value:p});else if(Gu(u)){var h="string"==typeof u.style?r.date[u.style]:Xu(u.style)?u.style.parsedOptions:void 0;s.push({type:Qd.literal,value:n.getDateTimeFormat(t,h).format(p)})}else if(zu(u))h="string"==typeof u.style?r.time[u.style]:Xu(u.style)?u.style.parsedOptions:r.time.medium,s.push({type:Qd.literal,value:n.getDateTimeFormat(t,h).format(p)});else if(Vu(u))(h="string"==typeof u.style?r.number[u.style]:Zu(u.style)?u.style.parsedOptions:void 0)&&h.scale&&(p*=h.scale||1),s.push({type:Qd.literal,value:n.getNumberFormat(t,h).format(p)});else{if(Qu(u)){var m=u.children,f=u.value,v=o[f];if(!tp(v))throw new $d(f,"function",a);var g=v(np(m,t,n,r,o,i).map((function(e){return e.value})));Array.isArray(g)||(g=[g]),s.push.apply(s,g.map((function(e){return{type:"string"==typeof e?Qd.literal:Qd.object,value:e}})))}if(Wu(u)){if(!(y=u.options[p]||u.options.other))throw new Xd(u.value,p,Object.keys(u.options),a);s.push.apply(s,np(y.value,t,n,r,o))}else if(qu(u)){var y;if(!(y=u.options["=".concat(p)])){if(!Intl.PluralRules)throw new Zd('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Wd.MISSING_INTL_API,a);var _=n.getPluralRules(t,{type:u.pluralType}).select(p-(u.offset||0));y=u.options[_]||u.options.other}if(!y)throw new Xd(u.value,p,Object.keys(u.options),a);s.push.apply(s,np(y.value,t,n,r,o,p-(u.offset||0)))}}}}return function(e){return e.length<2?e:e.reduce((function(e,t){var n=e[e.length-1];return n&&n.type===Qd.literal&&t.type===Qd.literal?n.value+=t.value:e.push(t),e}),[])}(s)}function rp(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(Qd||(Qd={}));var op=function(){function e(t,n,r,o){void 0===n&&(n=e.defaultLocale);var i,a=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=a.formatToParts(e);if(1===t.length)return t[0].value;var n=t.reduce((function(e,t){return e.length&&t.type===Qd.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(e){return np(a.ast,a.locales,a.formatters,a.formats,e,void 0,a.message)},this.resolvedOptions=function(){var e;return{locale:(null===(e=a.resolvedLocale)||void 0===e?void 0:e.toString())||Intl.NumberFormat.supportedLocalesOf(a.locales)[0]}},this.getAst=function(){return a.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var s=o||{},l=(s.formatters,function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(s,["formatters"]));this.ast=e.__parse(t,Yu(Yu({},l),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=function(e,t){return t?Object.keys(e).reduce((function(n,r){var o,i;return n[r]=(o=e[r],(i=t[r])?Yu(Yu(Yu({},o||{}),i||{}),Object.keys(o).reduce((function(e,t){return e[t]=Yu(Yu({},o[t]),i[t]||{}),e}),{})):o),n}),Yu({},e)):e}(e.formats,r),this.formatters=o&&o.formatters||(void 0===(i=this.formatterCache)&&(i={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Yd((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.NumberFormat).bind.apply(e,Fu([void 0],n,!1)))}),{cache:rp(i.number),strategy:Jd.variadic}),getDateTimeFormat:Yd((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.DateTimeFormat).bind.apply(e,Fu([void 0],n,!1)))}),{cache:rp(i.dateTime),strategy:Jd.variadic}),getPluralRules:Yd((function(){for(var e,t=arguments,n=[],r=0;r<arguments.length;r++)n[r]=t[r];return new((e=Intl.PluralRules).bind.apply(e,Fu([void 0],n,!1)))}),{cache:rp(i.pluralRules),strategy:Jd.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){if(void 0!==Intl.Locale){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])}},e.__parse=Bd,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();function ip(e){for(var t=arguments,n=1;n<arguments.length;n++){var r=t[n];for(var o in r)e[o]=r[o]}return e}var ap=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=ip({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in o)o[a]&&(i+="; "+a,!0!==o[a]&&(i+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(r[s]=t.read(a,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",ip({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,ip({},this.attributes,t))},withConverter:function(t){return e(ip({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),sp=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];console.warn.apply(console,e)},lp=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];console.error.apply(console,e)},cp=function(){return"object"==("undefined"==typeof ac?"undefined":Je()(ac))&&"function"==typeof ac.call},up=function(){return"undefined"!=typeof my&&void 0!==my.canIUse&&!cp()},dp=function(){return"object"==("undefined"==typeof window?"undefined":Je()(window))},pp=function(){return function(){var e;return!!dp()&&((null===(e=window.navigator)||void 0===e?void 0:e.userAgent)||"").toLowerCase().indexOf("alipayclient")>-1}()||dp()&&"undefined"!=typeof AlipayJSBridge},hp=function(){return"undefined"!=typeof wx&&void 0!==wx.canIUse},mp=function(){return!(void 0===n.g||dp()||up()||hp()||cp())},fp="bailingualLocaleChange",vp="bailingualDataChange",gp="bailingualError";function yp(e){void 0===e&&(e="");for(var t=(function(e){if("object"==("undefined"==typeof document?"undefined":Je()(document)))try{return ap.get(e)||ap.get("_CHIPS-"+e)}catch(e){return sp("[bailingual-sdk-glue] readCookie fail: "+e),""}}(e)||"").split("&"),n=0,r=t.length;n<r;n++){var o=t[n].split("="),i=o[0],a=o[1];if("lang"===i)return a}}var _p,Ep=function(e){if(void 0===e&&(e=""),e=e.replace("_","-"),pp()||up()||cp()){var t=ru[e.toLowerCase()];t&&(e=t)}var n=e.split("-"),r=n[0],o=n[1];return o&&(e=r.toLowerCase()+"-"+o.toUpperCase()),nu[e.toLowerCase()]&&(e=nu[e.toLowerCase()]),Lp(Mu,e)?e:""};function bp(e){return void 0===e&&(e=!0),Ep(function(e){return void 0===e&&(e=!0),up()||cp()?my.env&&my.env.language||my.getSystemInfoSync().language:hp()?wx.getSystemInfoSync().language:mp()?n.g.BAILINGUAL_LOCALE:!!e&&function(){var e=yp("x-hng")||yp("hng");if(e)return e}()||function(){var e;if("object"==("undefined"==typeof document?"undefined":Je()(document))){var t=null===(e=document.documentElement)||void 0===e?void 0:e.lang;if(t)return t}}()||function(){var e;if(dp()){var t=(null===(e=window.navigator)||void 0===e?void 0:e.userAgent)||"",n=(/Language\/([^\s]*)/i.exec(t)||[]).pop();if(n)return n}}()||function(){var e;if(dp()&&window.navigator){var t=window.navigator,n=(null===(e=t.languages)||void 0===e?void 0:e[0])||t.language||t.userLanguage||t.browserLanguage;if(n)return n}}()}(e)||"")}function Ap(e,t,n){void 0===n&&(n={});try{"object"==("undefined"==typeof document?"undefined":Je()(document))&&ap.set(e,t,n)}catch(e){sp("[bailingual-sdk-glue] writeCookie fail: "+e)}}function Sp(e,t){void 0===t&&(t={});try{"object"==("undefined"==typeof document?"undefined":Je()(document))&&ap.remove(e,t)}catch(e){sp("[bailingual-sdk-glue] writeCookie fail: "+e)}}function kp(){"object"==("undefined"==typeof document?"undefined":Je()(document))&&"object"==("undefined"==typeof location?"undefined":Je()(location))&&(Sp("x-hng",{path:"/",domain:location.hostname}),Sp("x-hng",{path:"/",domain:location.hostname,SameSite:"None",Secure:!0}),Sp("_CHIPS-x-hng",{path:"/",domain:location.hostname,SameSite:"None",Secure:!0,Partitioned:!0}),Sp("x-hng",{path:"/"}),Sp("x-hng",{path:"/",SameSite:"None",Secure:!0}),Sp("_CHIPS-x-hng",{path:"/",SameSite:"None",Secure:!0,Partitioned:!0}))}!function(e){e.FORMAT_ERROR="FORMAT_ERROR",e.MISSING_PARAM="MISSING_PARAM"}(_p||(_p={}));var Tp,Pp,Ip,Cp,wp,Np,Op,Rp,Mp=function(e){var t=e.code,n=e.message,r=e.err,o=e.textKey;this.code=t,this.message=n||(null==r?void 0:r.message)||"unknown error",this.stack=(null==r?void 0:r.stack)||r,this.textKey=o},Dp=function(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return t.forEach((function(t){Object.keys(t||{}).forEach((function(n){e[n]=t[n]}))})),e},Lp=function(e,t){return e.indexOf(t)>-1};function xp(e){var t,n;try{return Pp?(null===(t=Pp.getItem)||void 0===t?void 0:t.call(Pp,e))||"":up()||cp()?(null===(n=my.getStorageSync({key:e}))||void 0===n?void 0:n.data)||"":hp()?wx.getStorageSync(e)||"":"object"==("undefined"==typeof localStorage?"undefined":Je()(localStorage))&&localStorage.getItem(e)||""}catch(e){return""}}function Up(e,t){var n;try{if(t=(t||"").toString(),Pp)return void(null===(n=Pp.setItem)||void 0===n||n.call(Pp,e,t));if(up()||cp())return void my.setStorage({key:e,data:t});if(hp())return void wx.setStorage({key:e,data:t});"object"==("undefined"==typeof localStorage?"undefined":Je()(localStorage))&&localStorage.setItem(e,t)}catch(e){}}function Kp(e,t){return void 0===t&&(t=3),new Promise((function(n,r){var o,i,a,s;function l(){var e=s()[0];return e++,c.bind(this,e)}function c(e){if(s=function(){return[e]},!(e<t))return[1];var o=function(e){try{return l}catch(e){return r(e)}};try{var a;return i().then((function(e){try{return(a=e)?n(a):function(){try{return l}catch(e){return r(e)}}()}catch(e){return o()}}),o)}catch(e){o()}}return o=function(e){if(e.length&&"{"!==e[0]){var t=e.indexOf("{");t>-1&&(e=e.slice(t))}return e},i=function(){return new Promise((function(t,n){var r;return function(e){return Tp?Tp(e):cp()?new Promise((function(t,n){my.request({url:e,success:function(e){t(e.data)},fail:function(){n()}})})):up()?new Promise((function(t,n){my.call("httpRequest",{url:e},(function(e){!e||e.error?n():t(e.data)}))})):hp()?new Promise((function(t,n){wx.request({url:e,dataType:"text",success:function(e){t(e.data)},fail:function(e){n(e)}})})):"function"==typeof fetch?fetch(e).then((function(e){return e.text()})):"undefined"!=typeof XMLHttpRequest?new Promise((function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4===r.readyState&&(200===r.status?t(r.responseText):n())},r.send()})):void 0}(e).then((function(e){try{return r=e,t(JSON.parse(o(r||"")))}catch(e){return n(e)}}),n)}))},(a=function(e){for(;e;){if(e.then)return void e.then(a,r);try{if(e.pop){if(e.length)return e.pop()?u.call(this):e;e=l}else e=e.call(this)}catch(e){return r(e)}}}.bind(this))(c.bind(this,0));function u(){return n()}}))}!function(e){e.DAILY="DAILY",e.PROD="PROD"}(Op||(Op={})),function(e){e.INTERNET="INTERNET",e.INTRANET="INTRANET"}(Rp||(Rp={}));var Bp={ANTINTL:(Ip={},Ip[Op.DAILY]="https://bailingual-daily.marmot-cloud.com/manifest/",Ip[Op.PROD]="https://bailingual.marmot-cloud.com/manifest/",Ip),ALIPAY:(Cp={},Cp[Op.DAILY]="https://bailingual-assets-daily.alipay.com/manifest/",Cp[Op.PROD]="https://bailingual-assets.alipay.com/manifest/",Cp)},Yp={};Yp[Rp.INTERNET]=((wp={})[Op.DAILY]=function(e,t,n){var r;return""+(n?null===(r=Bp[n])||void 0===r?void 0:r[Op.DAILY]:"")+e+"/"+e+(t?"_"+t:"")+".json"},wp[Op.PROD]=function(e,t,n){var r;return""+(n?null===(r=Bp[n])||void 0===r?void 0:r[Op.PROD]:"")+e+"/"+e+(t?"_"+t:"")+".json"},wp),Yp[Rp.INTRANET]=((Np={})[Op.DAILY]=function(e,t){return"https://bailingual-assets.antgroup-inc.cn/daily/manifest/"+e+"/"+e+(t?"_"+t:"")+".json"},Np[Op.PROD]=function(e,t){return"https://bailingual-assets.antgroup-inc.cn/prod/manifest/"+e+"/"+e+(t?"_"+t:"")+".json"},Np);var Fp;function Hp(){return"true"===xp("__BAILINGUAL_IN_CONTEXT__")}function jp(){if(!(up()||hp()||cp())){var e=xp("BAILINGUAL_IN_CONTEXT_CONFIG")||"{}",t=!1;try{t=JSON.parse(e).enableExtension}catch(e){sp("[bailingual-sdk-glue] JSON.parse data fail: "+e)}Fp=Hp()&&t}}function Vp(){return void 0===Fp&&jp(),Fp}function Gp(){Up("__BAILINGUAL_IN_CONTEXT__","true"),jp(),new Promise((function(e,t){if(up()||hp()||cp())return e();var n;if("undefined"!=typeof document&&!document.querySelector("._BAILINGUAL_IN_CONTEXT_script"))return Kp("https://render.alipay.com/p/yuyan/bailingual-in-context_bailingual-in-context-version/zh_CN.json").then(function(e){try{return(null==(n=e)?void 0:n.version)&&function(e){if(e&&!document.querySelector("._BAILINGUAL_IN_CONTEXT_script")){var t=document.createElement("script");t.setAttribute("class","_BAILINGUAL_IN_CONTEXT_script"),t.setAttribute("src",e),document.body.appendChild(t)}}("https://unpkg.alipay.com/@alipay/bailingual-in-context@"+n.version+"/public/dist/index.js"),r.call(this)}catch(e){return t(e)}}.bind(this),t);function r(){return e()}return r.call(this)}))}function zp(e,t,n){return"##@@@"+t+"##"+e+"@@@##"+n+"@@@##"}function Wp(e){var t=[];return e.forEach((function(e){var n=e.key,r=e.count;if(n&&r){var o=-1!==n.indexOf("&")?encodeURIComponent(n):n;t.push(o+"&"+r)}})),t.join(";")}function qp(e,t){var n=function(e){switch(e){case"CN":default:return"https://collect.alipay.com/yuyan/?biztype=yuyanmonitorl";case"SG":return"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do";case"US":return"https://imdap.alipay.com/loggw/dwcookieLogGet.do"}}(e);if(cp())my.request({method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t,url:n});else if(up())my.call("httpRequest",{url:n,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t});else if(hp())wx.request({url:n,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:t});else if("undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon&&"function"==typeof Blob){var r=new Blob([t],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon(n,r)}else if(dp()&&"undefined"!=typeof XMLHttpRequest){var o=new XMLHttpRequest;o.open("POST",n,!0),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.send(t)}else"function"==typeof fetch?fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t}):console.error("No supported method to send data",e,t)}!function(){if(!(up()||hp()||cp()))try{var e=function(e){if(!e)return{};var t={};return e.slice(1).split("&").forEach((function(e){var n=e.split("="),r=n[0],o=n[1];t[r]=o})),t}("undefined"!=typeof location?location.search:"");if(Hp()||e.hasOwnProperty("SML_DEV")||e.hasOwnProperty("BAILINGUAL_IN_CONTEXT")||e.hasOwnProperty("BLG_RIC"))return void Gp();if("undefined"==typeof document)return;if(pp()){var t=0,n=0;document.addEventListener("titleClick",(function(){if(!Vp()){if(7==++n)return Gp(),n=0,clearTimeout(t),void(t=null);clearTimeout(t),t=setTimeout((function(){n=0,t=null}),1500)}}))}document.addEventListener("__BAILINGUAL_IN_CONTEXT_DISABLE__",(function(){Up("__BAILINGUAL_IN_CONTEXT__","false"),jp()}))}catch(e){sp("[bailingual-sdk-glue] initBailingualInContext fail: "+e)}}();var Jp=function(e){return e<10?"0"+e:""+e};function Qp(){var e=new Date;return e.getFullYear()+"-"+Jp(e.getMonth()+1)+"-"+Jp(e.getDate())+" "+Jp(e.getHours())+":"+Jp(e.getMinutes())+":"+Jp(e.getSeconds())+":"+e.getMilliseconds()}function Zp(e,t){void 0===t&&(t="^");var n=[];if(e instanceof Array)n=e;else if(e instanceof Object)for(var r in e)e.hasOwnProperty(r)&&n.push(r+"="+(e[r]||""));return n.join(t)}function Xp(e,t){var n,r,o;if(!t||!t.appName||!t.keyCounts.length)return"";var i=[];switch(e){case"CN":default:i=["D-AE",Qp(),"","","2","","","","1000","102023","H5behavior","2","","","","","","","","","","","","","","","","","","","","","","","","",Zp({code:"1000",msg:"",d1:t.appName,d3:(null===(n=t.textLocale)||void 0===n?void 0:n.replace(/-/g,"_"))||"",d4:t.sdkName||"",d5:t.sdkVersion||"",env:t.env||"PROD",c1:Wp(t.keyCounts),sampleRate:"1",yuyan_id:"180020010101313281",fullURL:"-",s_c:"true"})];break;case"SG":i=["D-AE",Qp(),"","","2","","","","1000","bailingualTextUsage","H5behavior","2","","","","","","","","","","","","","","","","","","","","","","","","",Zp({code:"1000",msg:"",d1:t.appName,d3:(null===(r=t.textLocale)||void 0===r?void 0:r.replace(/-/g,"_"))||"",d4:t.sdkName||"",d5:t.sdkVersion||"",env:t.env||"PROD",c1:Wp(t.keyCounts)})];break;case"US":i=["D-VM",Qp(),"","","4","-","-","-","exposure","-","-","-","-","-","-","bailingualTextUsage","2","H5behavior","c","-","-","-",Zp({appName:t.appName,textLocale:(null===(o=t.textLocale)||void 0===o?void 0:o.replace(/-/g,"_"))||"",sdkName:t.sdkName||"",sdkVersion:t.sdkVersion||"",env:t.env||"PROD",c1:Wp(t.keyCounts)}),"-","-","-","-","-","-","-","-","-","1000","-","-","UNKNOWN","-","-","zh-cn","-","-","-","-","-","-","-","-",Date.now().toString()+"-"+(100*Math.random()).toFixed(0),"-","-"]}return"data="+function(e){return e?encodeURIComponent(e).replace(/'/g,"%27"):e}(i.join())+"&time="+(new Date).getTime()}var $p=function(e){var t=e.region;this.queue=[],this.region=t,this.startTimer()};$p.prototype.startTimer=function(){var e,t,n=this;this.region?(this.timer=setTimeout((function(){n._report()}),5e3),dp()&&(null===(t=null===(e=window.document)||void 0===e?void 0:e.addEventListener)||void 0===t||t.call(e,"beforeunload",(function(){n._report()})))):clearTimeout(this.timer)},$p.prototype._report=function(){if(clearTimeout(this.timer),this.region&&this.queue.length){var e=new Map;this.queue.forEach((function(t){var n=t.appName+"-"+t.textKey+"-"+t.env,r=e.get(n);r?r.textUsedCount+=t.textUsedCount:e.set(n,t)}));var t=Array.from(e.values());!function(e,t){if(!e)throw new Error("No Region");if(0!==t.length)try{var n=new Map;t.forEach((function(e){var t=e.appName+"-"+e.textLocale+"-"+e.env;n.has(t)||n.set(t,{appName:e.appName,textLocale:e.textLocale,sdkName:e.sdkName,sdkVersion:e.sdkVersion,env:e.env,keyCounts:[]}),n.get(t).keyCounts.push({key:e.textKey,count:e.textUsedCount})})),n.forEach((function(t){for(var n=t.keyCounts,r=0;r<n.length;r+=200){var o=n.slice(r,r+200),i=Xp(e,{appName:t.appName,textLocale:t.textLocale,sdkName:t.sdkName,sdkVersion:t.sdkVersion,env:t.env,keyCounts:o});qp(e,i)}}))}catch(n){console.error("reportUsageRequest error with",e,t)}else console.error("empty data")}(this.region,t),this.queue=[]}this.startTimer()},$p.prototype.getRegion=function(){return this.region},$p.prototype.setRegion=function(e){this.region=e,this.startTimer()},$p.prototype.report=function(e){this.region&&this.queue.push(e)};var eh=function(){this.originStrings={},this.availableLocales=[],this.langPkgsNoPatch={},this.i18nText={},this.eventHandler={},this.intlMessages={},this.intlPDKVMessages={},this.appName="",this.canUsePatchedData=!0,this.canStoreCurrentLocaleToCookie=!0,this.canReadLocaleFromCookie=!0},th={usageReportRegion:{configurable:!0}};eh.setCustomizedGetSystemLocale=function(e){this.customizedGetSystemLocale=e},eh.customizeGetSystemLocale=function(e){this.customizedGetSystemLocale=e},eh.customizeStorage=function(e){return function(e){Pp=e}(e)},eh.getDataFromStorage=function(e){return xp(e)},eh.setDataToStorage=function(e,t){return Up(e,t)},eh.customizeFetch=function(e){Tp=e},th.usageReportRegion.get=function(){var e;return null===(e=this.usageReporter)||void 0===e?void 0:e.getRegion()},th.usageReportRegion.set=function(e){var t;this.usageReporter||(this.usageReporter=new $p({region:e})),e&&(null===(t=this.usageReporter)||void 0===t||t.setRegion(e))},eh.prototype.init=function(e,t){var n,r;this.initBailingualData(e),this.changeLocale(t||(null===(r=(n=this.constructor).customizedGetSystemLocale)||void 0===r?void 0:r.call(n))||bp(this.canReadLocaleFromCookie))},eh.prototype.getPatchI18nKey=function(){return this.appName?this.tag?this.appName+"+"+this.tag:this.appName:""},eh.prototype.initData=function(e){var t,n;this.initBailingualData(e||this.getServerSideFallbackData()),this.changeLocale((null===(n=(t=this.constructor).customizedGetSystemLocale)||void 0===n?void 0:n.call(t))||bp(this.canReadLocaleFromCookie))},eh.prototype.getServerSideFallbackData=function(){if(mp()){var e=n.g.BAILINGUAL_FALLBACK;return e||(sp("[bailingual-sdk-glue] [Server] no fallback data found."),e={}),e}},eh.prototype.initBailingualData=function(e){var t=this;this.originStrings=e,this.availableLocales=[],this.langPkgsNoPatch={},this.i18nText={},this.eventHandler={},this.intlMessages={},this.intlPDKVMessages={},this.appName=e.appName||"",this.currentLocale=void 0,this.bizEnv=e.bizEnv,this.usageReportRegion=e.usageReportRegion,this.usageReporter=new $p({region:this.usageReportRegion}),this.tag=e.tag||"",Object.keys(e).forEach((function(n){if("object"==Je()(e[n])){var r=Ep(n);if(!r)return void lp("[bailingual-sdk-glue] "+n+" is not a valid locale code");t.langPkgsNoPatch[r]=Dp({},e[n]),t.i18nText[r]=Dp({},e[n])}})),this.handlePatchedData(),this.availableLocales=Object.keys(this.i18nText);var n=e.defaultLocale||this.availableLocales[0];!e.defaultLocale&&n&&sp("[bailingual-sdk-glue] no defaultLocale specified, use first locale code '"+n+"' instead."),this.defaultLocale=this.judgeLocaleCode(n),this.defaultLocale||lp("[bailingual-sdk-glue] defaultLocale '"+n+"' is invalid.")},eh.prototype.handlePatchedData=function(){var e,t=this,n=this.getPatchI18nKey();if(this.canUsePatchedData){var r=function(e){if(void 0===e&&(e=""),!e)return{};try{var t=xp("BAILINGUAL_PATCH_I18N_DELETED-"+e);return t?JSON.parse(t):{}}catch(e){return lp("[bailingual-sdk-glue] fail to get local deleted data, error detail: "+e),{}}}(n),o=function(e){if(void 0===e&&(e=""),!e)return{};try{var t=xp("BAILINGUAL_PATCH_I18N-"+e);return t?JSON.parse(t):{}}catch(e){return lp("[bailingual-sdk-glue] fail to get local patch data, error detail: "+e),{}}}(n);Object.keys(o).forEach((function(e){Lp(Mu,e)&&(t.i18nText[e]||sp("[bailingual-sdk-glue] locale '"+e+"' is not exist in init data, but found in patch data."),t.i18nText[e]=t.i18nText[e]||{},Dp(t.i18nText[e],o[e]))})),null===(e=r.removedLocales)||void 0===e||e.forEach((function(e){e=Ep(e),Lp(Mu,e)&&delete t.i18nText[e]})),Object.keys(r.removedKeys||{}).forEach((function(e){if(e=Ep(e),Lp(Mu,e)){var n=t.i18nText[e],o=r.removedKeys[e];n&&Array.isArray(o)&&o.forEach((function(e){delete n[e]}))}}))}else n&&function(e){if(e)try{Up("BAILINGUAL_PATCH_I18N-"+e,""),Up("BAILINGUAL_PATCH_I18N_DELETED-"+e,"")}catch(e){lp("[bailingual-sdk-glue] fail to remove local patch data, error detail: "+e)}}(n)},eh.prototype.setLocale=function(e){this.currentLocale!==e&&(this.currentLocale=e,this.canStoreCurrentLocaleToCookie&&function(e){"object"!=("undefined"==typeof document?"undefined":Je()(document))||"object"!=("undefined"==typeof location?"undefined":Je()(location))||pp()||up()||cp()||hp()||(kp(),Ap("x-hng","lang="+e,{path:"/",expires:180}),Ap("_CHIPS-x-hng","lang="+e,{path:"/",expires:180,SameSite:"None",Partitioned:!0,Secure:!0}))}(e),this.emit(fp,e))},eh.prototype.getIntlMessageWithPDKVFormat=function(e,t,n){var r,o=t.id,i=null===(r=t.ignoreTag)||void 0===r||r,a=JSON.stringify([o,i]);this.intlPDKVMessages[e]=this.intlPDKVMessages[e]||{};var s=this.intlPDKVMessages[e][a];if(!s){var l=n[o];l.match(Du)||(l=zp(this.appName,o,l)),s=this.createIntlMessageFormat(l,e,i),this.intlPDKVMessages[e][a]=s}return s},eh.prototype.getIntlMessageWithNormalFormat=function(e,t,n){var r,o=t.id,i=null===(r=t.ignoreTag)||void 0===r||r,a=JSON.stringify([o,i]),s=(null==n?void 0:n[o])||t.dm||t.defaultMessage||"";if(null==n?void 0:n[o]){this.intlMessages[e]=this.intlMessages[e]||{};var l=this.intlMessages[e][a];return l||(l=this.createIntlMessageFormat(s,e,i),this.intlMessages[e][a]=l),l}return this.createIntlMessageFormat(s,e,i)},eh.prototype.formatByLocaleCode=function(e,t,n){var r,o=this,i=this.i18nText[n];try{r=Vp()&&e.id&&(null==i?void 0:i[e.id])?this.getIntlMessageWithPDKVFormat(n,e,i):this.getIntlMessageWithNormalFormat(n,e,i)}catch(t){var a=(null==i?void 0:i[e.id])||e.dm||e.defaultMessage||"",s="[bailingual-sdk-glue] fail to create IntlMessageFormat instance, return original string: "+a;return sp(s),sp("[bailingual-sdk-glue] error detail:",t),this.emit(gp,new Mp({code:_p.FORMAT_ERROR,message:s,err:t,textKey:e.id})),a}if(!r)return"";try{var l=t&&Object.keys(t)||[],c=this.normalizeIntlMessageVariable(r,t);return Object.keys(c).forEach((function(t){Lp(l,t)||o.emit(gp,new Mp({code:_p.MISSING_PARAM,message:"["+e.id+"] missing param: "+t,textKey:e.id}))})),r.format(c)}catch(n){var u="[bailingual-sdk-glue] format error with key: "+e.id+", value [%s], params: "+t;return sp(u),sp("[bailingual-sdk-glue] error detail:",n),this.emit(gp,new Mp({code:_p.FORMAT_ERROR,message:u,err:n,textKey:e.id})),""}},eh.prototype.format=function(e,t,n){void 0===t&&(t={});var r=n;return r&&((r=Ep(r))||lp("[bailingual-sdk-glue] "+n+" is not a valid locale code, use default locale instead.")),r||(r=this.currentLocale),r||lp("[bailingual-sdk-glue] no locale code found!"),this.formatByLocaleCode(e,t,r)},eh.prototype.get=function(e,t,n){return"string"==typeof e?(this.reportUsageData({id:e,localeCode:n}),this.format({id:e},t,n)):(this.reportUsageData({id:e.id,localeCode:n}),this.format(e,t,n))},eh.prototype.judgeLocaleCode=function(e){if(void 0===e&&(e=""),e=Ep(e),Lp(this.availableLocales,e))return e},eh.prototype.changeLocale=function(e){var t=this.judgeLocaleCode(e);t||this.currentLocale||(t=this.defaultLocale),t?this.setLocale(t):lp("[bailingual-sdk-glue] '"+e+"' is not a vaid locale code")},eh.prototype.unsafeChangeLocale=function(e){void 0===e&&(e=""),this.setLocale(e)},eh.prototype.getAllData=function(e){var t=this;if(this.i18nText&&e&&Vp()){var n={};return Object.keys(this.i18nText).forEach((function(e){n[e]=t.buildPDKVLocaleText(t.i18nText[e])})),n}return this.i18nText},eh.prototype.buildPDKVLocaleText=function(e){var t=this,n={};return Object.keys(e||{}).forEach((function(r){var o=e[r];o.match(Du)||(o=zp(t.appName,r,o)),n[r]=o})),n},eh.prototype.getDataWithLocale=function(e,t){e||sp("[bailingual-sdk-glue] no locale code specified, use default locale ("+this.defaultLocale+") instead.");var n=this.i18nText[Ep(e||this.defaultLocale)];return n&&t&&Vp()?this.buildPDKVLocaleText(n):n},eh.prototype.getDataFromCurrentLocale=function(e){if(this.currentLocale)return this.getDataWithLocale(this.currentLocale,e);lp("[bailingual-sdk-glue] error occured: no 'currentLocale' found, please check if you have called 'initData' or 'changeLocale' method before.")},eh.prototype.getCurrentLocale=function(){return this.currentLocale||""},eh.prototype.getDefaultLocale=function(){return this.defaultLocale},eh.prototype.formatLocaleCode=function(e){return Ep(e)},eh.prototype.patchI18n=function(e,t){return new Promise(function(n,r){var o,i,a,s;if(!(t=t||{}).isIntranet&&!t.buIdentifier)return lp('[bailingual-sdk-glue] no "env.buIdentifier" param, patchI18n will not work.'),this.emit(gp,new Mp({code:_p.MISSING_PARAM,message:'[bailingual-sdk-glue] no "env.buIdentifier" param, patchI18n will not work.'})),n();if(!Array.isArray(e)){if(!e.appName){if(!this.appName)return lp("[bailingual-sdk-glue] no appName found, patchI18n will not work."),n();e.appName=this.appName}e.tag||(e.tag=this.tag),e=[e]}return(e=e.filter((function(e){return!!(null==e?void 0:e.appName)||(lp("[bailingual-sdk-glue] no appName found, skip: "+e),!1)}))).length?function(e,t,n){return new Promise((function(r,o){return function(e,t){return new Promise((function(n,r){var o,i,a,s;return o=t&&"buIdentifier"in t?t.buIdentifier:void 0,(i=e.map((function(e){return Kp(function(e,t,n,r,o){var i,a;return null===(a=null===(i=Yp[t])||void 0===i?void 0:i[e])||void 0===a?void 0:a.call(i,n,r,o)}(t.isDaily?Op.DAILY:Op.PROD,t.isIntranet?Rp.INTRANET:Rp.INTERNET,e.appName,e.tag,o)).then((function(e){return e?Kp(e.url):void 0})).then((function(e){return e||{}}))})),a=[],s=0,new Promise((function(e){i.forEach((function(t,n){t.then((function(t){a[n]=t,++s===i.length&&e(a)}))}))}))).then((function(e){try{return n(e)}catch(e){return r(e)}}),r)}))}(t,n).then((function(t){try{return r(function(e,t){var n={};t.forEach((function(e){e=e||{},Object.keys(e).forEach((function(t){if("object"==Je()(e[t])){var r=Ep(t);r&&(n[r]=n[r]||{},Dp(n[r],e[t]))}}))}));var r=Object.keys(n),o=Object.keys(e);r.sort().toString()!==o.sort().toString()&&sp("[bailingual-sdk-glue] locales in local data '"+o+"' is different from cdn data '"+r+"'");var i={removedKeys:{},removedLocales:o.filter((function(e){return!Lp(r,e)}))},a={},s={};return r.forEach((function(t){var r=n[t]||{},o=e[t]||{};a[t]=a[t]||{};var i=a[t];Object.keys(r).forEach((function(e){Object.prototype.hasOwnProperty.call(r,e)&&r[e]!==o[e]&&(i[e]=r[e])})),s[t]=Dp({},o,r)})),o.forEach((function(t){if(!Lp(i.removedLocales,t)){var r=e[t]||{},o=n[t]||{},a=s[t]||{};Object.keys(r).forEach((function(e){Object.prototype.hasOwnProperty.call(o,e)||(delete a[e],i.removedKeys[t]=i.removedKeys[t]||[],Lp(i.removedKeys[t],e)||i.removedKeys[t].push(e))}))}})),{newI18nData:s,patchedData:a,deletedData:i}}(e,t))}catch(e){return o(e)}}),o)}))}(this.langPkgsNoPatch,e,t).then(function(e){var t;try{return o=(t=e).newI18nData,i=t.patchedData,a=t.deletedData,s=this.getPatchI18nKey(),this.updateData(o)&&s&&(Up("BAILINGUAL_PATCH_I18N-"+s,JSON.stringify(i)),Up("BAILINGUAL_PATCH_I18N_DELETED-"+s,JSON.stringify(a))),n()}catch(e){return r(e)}}.bind(this),r):(lp("[bailingual-sdk-glue] no bailingual packages found, stop patch"),n())}.bind(this))},eh.prototype.updateData=function(e){var t=Object.keys(e).filter((function(e){return Lp(Mu,e)}));return this.defaultLocale&&!Lp(t,this.defaultLocale)?(lp("[bailingual-sdk-glue] default locale "+this.defaultLocale+" is not exist in new data, can't update data."),!1):(this.i18nText=e,this.intlMessages={},this.intlPDKVMessages={},this.availableLocales=t,this.emit(vp,e),this.currentLocale&&!Lp(t,this.currentLocale)&&(sp("[bailingual-sdk-glue] current locale "+this.currentLocale+" is not available, use default locale ("+this.defaultLocale+") instead."),this.changeLocale(this.defaultLocale)),!0)},eh.prototype.on=function(e,t){this.eventHandler[e]=this.eventHandler[e]||[],this.eventHandler[e].push(t)},eh.prototype.off=function(e,t){var n,r=this;null===(n=this.eventHandler[e])||void 0===n||n.forEach((function(n,o){n===t&&(r.eventHandler[e][o]=null)}))},eh.prototype.onDataChange=function(e){this.on(vp,e)},eh.prototype.offDataChange=function(e){this.off(vp,e)},eh.prototype.onLocaleChange=function(e){this.on(fp,e)},eh.prototype.offLocaleChange=function(e){this.off(fp,e)},eh.prototype.onError=function(e){this.on(gp,e)},eh.prototype.offError=function(e){this.off(gp,e)},eh.prototype.emit=function(e,t){var n,r;null===(r=null===(n=this.eventHandler[e])||void 0===n?void 0:n.forEach)||void 0===r||r.call(n,(function(e){null==e||e(t)}))},eh.prototype.stopPatchI18n=function(){this.canUsePatchedData=!1},eh.prototype.setAutoStoreCurrentLocaleToCookie=function(e){this.canStoreCurrentLocaleToCookie=!!e},eh.prototype.setAutoReadLocaleFromCookie=function(e){this.canReadLocaleFromCookie=!!e},eh.prototype.getAllLocales=function(){return[].concat(this.availableLocales)},eh.prototype.changeUsageReportRegion=function(e){this.usageReportRegion=e},eh.prototype.changeBizEnv=function(e){this.bizEnv=e},eh.prototype.reportUsageData=function(e){var t=e.id,n=e.count;void 0===n&&(n=1);var r,o=e.localeCode;void 0===o&&(o=this.currentLocale),null===(r=this.usageReporter)||void 0===r||r.report({appName:this.appName,textKey:t,textLocale:o,textUsedCount:n,sdkName:"bailingual-sdk-glue",env:this.bizEnv||"PROD"})},eh.prototype.removeBailingualCookie=function(){kp()},Object.defineProperties(eh.prototype,th),eh.customizedGetSystemLocale=void 0;var nh=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.normalizeIntlMessageVariable=function(e,t){var n=e.getAst(),r=t||{};return n.forEach((function(e){Lp([Ku.argument,Ku.number,Ku.date,Ku.time,Ku.select,Ku.plural],e.type)&&"value"in e&&void 0===r[e.value]&&(r[e.value]="")})),r},t.prototype.createIntlMessageFormat=function(e,t,n){return void 0===n&&(n=!0),new op(e,t,{},{ignoreTag:n})},t}(eh),rh=new nh,oh=(rh.get.bind(rh),"antom-language-storage-key"),ih="antom_language_change_event",ah="en_US",sh=new nh;function lh(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=uh(e);n&&(sh.getAllLocales().map(uh).includes(n)||(n=ah),sh.changeLocale(n),dh(n),t?window.location.reload():window.dispatchEvent(new Event(ih)))}function ch(e){if(e)return uh(e);try{var t=window._amsSdkLanguage||window.sessionStorage.getItem(oh)||window.localStorage.getItem(oh);if(t)return uh(t)}catch(e){}if(navigator.language){var n=!/[-,_]/.test(navigator.language),r=sh.getAllLocales().find((function(e){return n?e.startsWith(navigator.language):uh(e)===uh(navigator.language)}))||ah;if(r)return r=uh(r)}return ah}function uh(e){var t=e;t||(t=ah);var n=t.split(/[-,_]/),r=et(n,2),o=r[0],i=r[1];return o||(o="en"),i?"".concat(o.toLowerCase(),"_").concat(i.toUpperCase()):o.toLowerCase()}function dh(e){try{return window._amsSdkLanguage=e,window.localStorage.setItem(oh,e),window.sessionStorage.setItem(oh,e),!0}catch(e){return!1}}var ph={API_MISS_PARAMS:"API_MISS_PARAMS",API_GATEWAY_TIMEOUT:"API_GATEWAY_TIMEOUT",API_SYSTEM_ERROR:"API_SYSTEM_ERROR",API_TIMEOUT:"API_TIMEOUT",API_NOT_LOGIN:"API_NOT_LOGIN",API_GATEWAY_ERROR:"API_GATEWAY_ERROR"},hh=p(p({},{UNKNOWN_ERROR:"UNKNOWN_ERROR",NO_PORTS_ERROR:"NO_PORTS_ERROR",INVALID_REDIRECT_URL:"INVALID_REDIRECT_URL"}),ph);vl.initConfig({i18n:sh,i18nPrefix:"ANTOMSDK",getDefaultMessage:function(){return sh.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"})}});var mh=function(e){y(n,e);var t=E(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Qe(e),"name","AntomError"),l(Qe(e),"response",void 0),e}return m(n,null,[{key:"isError",value:function(e){return vl.isError(e)}},{key:"unificationError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"APP_RUNTIME";return vl.unificationError(e,t)}}]),n}(vl),fh=function(e){y(n,e);var t=E(n);function n(){var e;v(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),l(Qe(e),"name","AntomCoreError"),e}return m(n)}(mh),vh=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"defaultRequestScope";return e?{success:function(n,r,o){e.log({code:"11",msg:n,d1:o||"无traceId",d2:t,d3:Math.round(r),d5:"是",m1:1,m2:Math.round(r)})},error:function(n,r,o,i,a){e.log({code:"11",msg:n,d1:a||"无traceId",d2:t,d3:Math.round(r),d4:"".concat(i,"-").concat(o),d5:"否",m1:0,m2:Math.round(r)})}}:{success:function(){},error:function(){}}},gh=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"defaultJsErrorScope";return function(n){e&&e.log({code:"12",msg:(null==n?void 0:n.message)||"上报未知的异常信息",d1:(null==n?void 0:n.stack)||"无stack信息",d2:t})}},yh=(window||{}).navigator,_h=yh.userAgent,Eh=function(){var e=/OpenHarmony/i.test(yh.userAgent),t=/Phone/i.test(yh.userAgent),n=/Tablet/i.test(yh.userAgent);return e&&(t||n)},bh=/iPhone|iPad|iPod/i.test(_h)||"MacIntel"===yh.platform&&yh.maxTouchPoints>1,Ah=/Android/i.test(_h),Sh=(/\bMacintosh\b/.test(_h),/Windows NT/.test(_h),function(){return/Android|iPhone|iPad|iPod|Mobile|SymbianOS|Windows Phone/.test(_h)||Eh()}),kh=bh,Th=Ah,Ph=!!Sh(),Ih=!Sh();Eh();var Ch=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{if(!e){if(t)throw t;return}return JSON.parse(e)}catch(e){if(t)throw t;return}},wh=function(e){var t=e.split("&&")[3];if(t){var n=function(e){try{if(!e)return;var t=atob(e),n=Uint8Array.from(t,(function(e){return e.codePointAt(0)}));return(new TextDecoder).decode(n)}catch(e){return}}(t);if(n)return Ch(n)}},Nh=function(e){return(null==e?void 0:e.split("&&").slice(0,2).join("&&"))||"无trackId"},Oh=function(e){return e.split("&&")[1]||"SG"},Rh=n(9034),Mh=function(){try{var e;return(null===(e=navigator)||void 0===e?void 0:e.javaEnabled())||!1}catch(e){}return!1},Dh={local:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",dev:"http://imgs-63.sggz00b.dev.alipay.net/mgw.htm",sit:"http://imgs-9.sggz00a.test.alipay.net/mgw.htm",light_sandbox:"https://imgs-sea-global.alipay.com/mgw.htm",pre:"https://imgs-sea-pre.alipay.com/mgw.htm",prod:"https://imgs-sea-global.alipay.com/mgw.htm",sandbox:"https://imgs-sea-global.alipay.com/mgw.htm"},Lh="ANTOM_PAYMENT_WEB",xh=(function(e){var t={};(e||(e=window.location.href),"undefined"==typeof URL)?e.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o).replace(/\+/g," "),t[n])})):new URL(e).searchParams.forEach((function(e,n){t[n]=e}));return t}()||{}).instanceId;function Uh(){return new Promise((function(e){window&&window.AlipayJSBridge?e():document.addEventListener("AlipayJSBridgeReady",(function(){return e()}),!1)}))}var Kh=function(){function e(t){v(this,e),l(this,"baseUrl",void 0),l(this,"headers",void 0),l(this,"method",void 0),l(this,"timeout",void 0),this.baseUrl=t.baseURL,this.headers=t.headers,this.method=t.method,this.timeout=t.timeout,this.request=this.request.bind(this)}return m(e,[{key:"request",value:function(e){var t=this;return new Promise((function(n,r){var o,i,a={url:e.url?t.baseUrl+e.url:t.baseUrl,method:null!==(o=e.method)&&void 0!==o?o:t.method,headers:p(p({},t.headers),e.headers),timeout:null!==(i=e.timeout)&&void 0!==i?i:t.timeout};e.data&&(a.data=function(e,t){try{var n=new WeakSet;return JSON.stringify(e,(function(e,t){if("object"===qe(t)&&null!==t){if(n.has(t))return;n.add(t)}return t}))||t}catch(e){return t}}(e.data,"")),function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new Promise((function(t){Uh().then((function(){var r;(r=window.AlipayJSBridge).call.apply(r,[e].concat(n,[function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t([].concat(n))}]))}))}))}("httpRequest",p({instanceId:xh},a)).then((function(e){var t=Array.isArray(e)?e.length>0?e[0]:null:e;if(!t)return r(new Error("timeout"));if(0!==t.status)return r(new Error("timeout"));var o={status:t.httpCode,data:Ch(t.data),headers:Bh(t.headers)};n(o)}))}))}}]),e}();function Bh(e){if(!e)return e;var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];t[n]=Array.isArray(r)?r.length>0?r[0]:void 0:r}return t}var Yh=function(e){var t=Rh(e,"Result-Status")||Rh(e,"result-status","");if(!t)return null;if(2e3==+t)return{success:!1,errorCode:ph.API_NOT_LOGIN,errorMessage:sh.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t};if(4001==+t)return{success:!1,errorCode:ph.API_GATEWAY_TIMEOUT,errorMessage:sh.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t};if(1e3!=+t){var n=Rh(e,"Tips")||Rh(e,"tips","");return{success:!1,errorCode:ph.API_GATEWAY_ERROR,errorMessage:n?decodeURIComponent(n):sh.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),resultStatus:t}}return null},Fh={};function Hh(e,t,n){return jh.apply(this,arguments)}function jh(){return(jh=a(o().mark((function e(t,n,r){var i,a,s,l,c,u,d,h,m,f,v,g,y,_,E,b,A,S,k,T,P,I,C;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=p(p(p({},Fh),r),{},{envInfo:p(p({},Fh.envInfo),null==r?void 0:r.envInfo),headers:p(p({},Fh.headers),null==r?void 0:r.headers)}),s=vh(a.tracker,a.scope),l=gh(a.tracker,a.scope),a.hostSign){e.next=10;break}e.next=8;break;case 8:console.warn("[Antom SDK] request hostSign is missing, please set hostSign in request options or global options.");case 9:a.hostSign="SG";case 10:return"WAP"===(c=p(p({terminalType:Ph?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserJavaEnabled:Mh(),browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==a?void 0:a.envInfo),{},{locale:ch((null==a?void 0:a.locale)||(null==a||null===(i=a.envInfo)||void 0===i?void 0:i.locale))})).terminalType&&(c.osType=kh?"IOS":"ANDROID"),u=[p(p({},n),{},{envInfo:c,extParams:p(p({},null==n?void 0:n.extParams),{},{refUrl:window.location.href})})],d=performance.now(),e.prev=14,h=Vh(t,a),e.next=18,h({data:u});case 18:if(m=e.sent,f=m.data,v=m.headers,g=f||{},y=Rh(v,"Mgw-TraceId")||Rh(v,"mgw-traceid",""),g.traceId=y,!(_=Yh(v))){e.next=29;break}throw E=_.errorMessage,b=_.errorCode,new fh(E,b,"SERVER_API","".concat(y," (").concat(t,")"));case 29:if(g.success){e.next=36;break}throw k=g.errorMessage||g.resultMessage||sh.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"}),T=g.errorCode||(null===(A=g.errorContext)||void 0===A||null===(A=A.errorStack)||void 0===A||null===(A=A[0])||void 0===A?void 0:A.errorName)||"API_SYSTEM_ERROR","true"!==(null===(S=g.extendInfo)||void 0===S?void 0:S.mulityLanguageMapping)&&(k=sh.get({id:"server.".concat(T),defaultMessage:sh.get({id:"event.callback.code.${errorCode}",defaultMessage:sh.get({id:"ckp.paymentError.${errorCode}",defaultMessage:sh.get({id:"page.wrong.error.message",defaultMessage:"System error, please retry later"})})})})),(P=new mh(k,T,"SERVER_API","".concat(y," (").concat(t,")"))).response=g,P;case 36:return s.success(t,performance.now()-d,y),e.abrupt("return",g);case 40:if(e.prev=40,e.t0=e.catch(14),!fh.isError(e.t0)){e.next=45;break}return s.error(t,performance.now()-d,e.t0.message,e.t0.code,e.t0.traceId),e.abrupt("return",Promise.reject(e.t0));case 45:return C=e.t0,l(C),e.abrupt("return",Promise.reject(new fh(C.message,null!==(I=C.message)&&void 0!==I&&I.includes("timeout")?"API_TIMEOUT":"API_SYSTEM_ERROR","SYSTEM","WithoutTraceId (".concat(t,")"))));case 48:case"end":return e.stop()}}),e,null,[[14,40]])})))).apply(this,arguments)}function Vh(e,t){var n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=(null==t?void 0:t.env)||"prod",a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n={"com.ipay.iexpcashier.sdkAction.query":"com.ipay.iopensandbox.sdk.paymentSession.query"},r="SDK_MOCK_SANDBOX";if(n[e]&&"light_sandbox"===t)return{appId:r,operationType:n[e]}}(e,i),s=(null==t?void 0:t.baseURL)||function(e,t){var n;return"pre"===t||"sandbox"===t&&"pre"===(null===(n=window)||void 0===n||null===(n=n.marmotInjectInfo)||void 0===n||null===(n=n.env)||void 0===n?void 0:n.toLocaleLowerCase())?{SG:"https://imgs-sea-pre.alipay.com/mgw.htm",US:"https://imgs-pre.alipay.com/mgw.htm",DE:"https://imgs-de-pre.alipay.com/mgw.htm",QK:"https://iopengw-qkgz99p.alipay.com/mgw.htm",ID:"https://imgs-id-pre.alipay.com/mgw.htm",SA:"https://imgs-sa-pre.alipay.com/mgw.htm"}[e||"SG"]:"prod"===t||"light_sandbox"===t||"sandbox"===t?{SG:"https://imgs-sea-global.alipay.com/mgw.htm",US:"https://imgs-na-global.alipay.com/mgw.htm",DE:"https://imgs-de-global.alipay.com/mgw.htm",QK:"https://imgs-qk.alipay.com/mgw.htm",ID:"https://imgs-id.alipay.com/mgw.htm",SA:"https://imgs-sa.alipay.com/mgw.htm"}[e||"SG"]:void 0}(null==t?void 0:t.hostSign,i)||Dh[i],c=p(l(l(l(l(l(l(l(l({appId:(null==t?void 0:t.appId)||(null==a?void 0:a.appId)||Lh,workspaceId:"pre"===(null==t?void 0:t.env)?"pre":"default"},"x-cors-".concat(Lh.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",null==t?void 0:t.groupId),"Operation-Type",(null==a?void 0:a.operationType)||e),"Client-Time",o),"tntInstId","ALIPW3SG"),"x-mago-timeout",(null==t?void 0:t.timeout)||15e3),"sdk-version",(null==t?void 0:t.sdkVersion)||"0.0.1787898127-dev.21"),null==t?void 0:t.headers);"dev"!==i&&delete c["sofa-group-name"],"sandbox"===i&&(c["load-test"]=!0,c.sofaPenAttrs="instMock=O&loadMode=2");var u,d=null!==(n=null==t?void 0:t.timeout)&&void 0!==n?n:15e3,h=Object.entries(c).filter((function(e){return void 0!==e[1]&&null!==e[1]&&"object"!==qe(e[1])})).reduce((function(e,t){var n=et(t,2),r=n[0],o=n[1];return e[r]=String(o),e}),{}),m={baseURL:s,timeout:d,headers:c},f=null;"app"===Fh.appType?f=new Kh({baseURL:s,method:"POST",timeout:d,headers:h}):f=ji.create(p(p({},m),{},{withCredentials:null===(u=null==t?void 0:t.withCredentials)||void 0===u||u,method:(null==t?void 0:t.method)||"POST"}));return f.request}Hh.setGlobalOptions=function(e){Object.assign(Fh,e)};"".concat(window.location.origin,"/elements/src/pages");var Gh=wh,zh="elementV3",Wh=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zh;if(!e)return{modernWeb:!1};var n=Gh(e),r="string"==typeof(null==n?void 0:n.flowSwitchTags)&&n.flowSwitchTags.split(",").some((function(e){return e.trim()===t}));var o=!(null==n||!n.modernWeb);return(r||o)&&console.log("isModernWeb ------------\x3e true"),{fromFrontend:o,modernWeb:r||o}};function qh(e){if(!e)return e;var t=Wh(e),n=t.fromFrontend,r=t.modernWeb;if(!n||!r)return e;var o=e.split("&&").slice(0,3),i=Gh(e);return null==i||delete i.modernWeb,o.concat(function(e){try{if(!e)return;var t=(new TextEncoder).encode(e),n=Array.from(t,(function(e){return String.fromCodePoint(e)})).join("");return btoa(n)}catch(e){return}}(JSON.stringify(i))).join("&&")}var Jh=function(e){return Wh(e).modernWeb},Qh=(h()(h()(h()({},hh),{GENERATE_ELEMENT_KEY_FAILED:"GENERATE_ELEMENT_KEY_FAILED",ELEMENT_INIT_FAILED:"ELEMENT_INIT_FAILED",MOUNT_TIMEOUT:"MOUNT_TIMEOUT",MOUNT_MISSING_CONTAINER:"MOUNT_MISSING_CONTAINER",MOUNT_IFRAME_LOAD_ERROR:"MOUNT_IFRAME_LOAD_ERROR",MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE:"MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE",MOUNT_NOT_SUPPORT:"MOUNT_NOT_SUPPORT",MOUNT_INITIAL_FAILED:"MOUNT_INITIAL_FAILED",ELEMENT_INSTANCE_DESTROYED:"ELEMENT_INSTANCE_DESTROYED",ELEMENT_DEFINE_ERROR:"ELEMENT_DEFINE_ERROR",ELEMENT_ALREADY_REGISTERED:"ELEMENT_ALREADY_REGISTERED",CANNOT_CREATE_SAME_ELEMENT_TWICE:"CANNOT_CREATE_SAME_ELEMENT_TWICE",GROUPS_ONLY_ONE_MAIN_ELEMENT:"GROUPS_ONLY_ONE_MAIN_ELEMENT",GROUPS_NOT_FOUND_MAIN_ELEMENT:"GROUPS_NOT_FOUND_MAIN_ELEMENT",NOT_SUPPORT_ELEMENT:"NOT_SUPPORT_ELEMENT",NOT_SUPPORT_SUBMIT:"NOT_SUPPORT_SUBMIT",UPDATE_CONFIG_TIMEOUT:"UPDATE_CONFIG_TIMEOUT",UPDATE_CONFIG_NOT_READY:"UPDATE_CONFIG_NOT_READY",INVALID_MODAL_URL:"INVALID_MODAL_URL",LOAD_DEBUGGER_FAILED:"LOAD_DEBUGGER_FAILED"}),{},{NOT_FIND_MAINELEMENT:"NOT_FIND_MAINELEMENT",SESSION_DATA_INVALID:"SESSION_DATA_INVALID",SDK_LAUNCH_PAYMENT_APP_ERROR:"SDK_LAUNCH_PAYMENT_APP_ERROR",PARAM_INVALID:"PARAM_INVALID",CHANNEL_CLIENT_ID_QUERY_TIMEOUT:"CHANNEL_CLIENT_ID_QUERY_TIMEOUT",CHANNEL_CLIENT_ID_MISSING:"CHANNEL_CLIENT_ID_MISSING",CHANNEL_CLIENT_ID_QUERY_FAILED:"CHANNEL_CLIENT_ID_QUERY_FAILED",CHANNEL_CLIENT_ID_QUERY_ERROR:"CHANNEL_CLIENT_ID_QUERY_ERROR",CHECKOUT_NOT_READY:"CHECKOUT_NOT_READY",PAYMENT_IN_PROGRESS:"PAYMENT_IN_PROGRESS",AMOUNT_VALUE_EMPTY:"AMOUNT_VALUE_EMPTY",AMOUNT_VALUE_INVALID:"AMOUNT_VALUE_INVALID",AMOUNT_CURRENCY_MISMATCH:"AMOUNT_CURRENCY_MISMATCH",AMOUNT_CURRENCY_UNSUPPORTED:"AMOUNT_CURRENCY_UNSUPPORTED",AMOUNT_PRECISION_UNSUPPORTED:"AMOUNT_PRECISION_UNSUPPORTED",AMOUNT_RESOLVE_TIMEOUT:"AMOUNT_RESOLVE_TIMEOUT",AMOUNT_RESOLVE_FAILED:"AMOUNT_RESOLVE_FAILED"}),function(e){_()(n,e);var t=b()(n);function n(){var e;g()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),c()(Ze()(e),"name","AntomSDKError"),e}return f()(n)}(mh)),Zh={default:{theme:"light",backgroundColor:"#ffffff"},light:{theme:"light",backgroundColor:"#ffffff"},night:{theme:"dark",backgroundColor:"#000000"},agateGreen:{theme:"dark",backgroundColor:"#344343"},nostalgicGray:{theme:"light",backgroundColor:"#e8e8e8"},gamingPurple:{theme:"dark",backgroundColor:"#1A1F2E"},cherryBlossomPink:{theme:"light",backgroundColor:"#FCF8FA"}};function Xh(e,t){var n;if(!e)throw new Qh("sessionData is required","SESSION_DATA_INVALID","SDK_USAGE");Rc("INFO","SDK_USAGE","Setup called with sessionData:",{sessionData:e});var r=Gh(e);if(!r)throw new Qh("Failed to parse sessionData, please check the sessionData","SESSION_DATA_INVALID","SDK_USAGE");var o=null===(n=r.paymentSessionConfig)||void 0===n?void 0:n.productScene;if(t&&o!==t)throw new Qh("Invalid productScene in sessionData, expected ".concat(t,", but get ").concat(o,", please check the sessionData is correct?"),"SESSION_DATA_INVALID","SDK_USAGE");return r}var $h="ams-popup",em=300,tm="ams-component-popup-loading",nm="\n .".concat($h,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat($h,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat($h,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat($h,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(em,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat($h,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(em,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat($h,"-drawer-enter {\n animation: slideIn ").concat(em,"ms forwards;\n }\n\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat($h,"-drawer-exit {\n animation: slideOut ").concat(em,'ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: \'\';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n[dir="rtl"] .ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n'),rm=function(e,t){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light",t="\n .ams-component-popup-loading .line div:before,\n .ams-component-popup-loading .line div:after {\n background: ".concat("light"===e?"#000000":"#ffffff"," !important;\n }"),n=document.createElement("style");n.innerHTML=t,document.head.appendChild(n)}(e);var n=document.createElement("div");return null==n||n.classList.add(tm),n.id=tm,n.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div><span id="text" style="font-size: 16px;position:absolute;bottom: 0;white-space: nowrap">'.concat(t||"","</span>"),n.style.fontSize="".concat(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:390,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:130,n=document.documentElement.clientWidth,r=Ih?t:100*n/e;return Math.min(r,t)}(),"px"),n};var om=function(e){var t=e.mode,n=e.url,r=e.loadingConfig,o=e.showClose,a=void 0===o||o,l=e.onClose,c=e.textDirection,u=void 0===c?"ltr":c,d=e.showLoading,p=void 0===d||d,h=document.createElement("div");h.classList.add("".concat($h,"overlay"),"".concat($h,"fadeIn"));var m=document.createElement("div");"desktop"===t?(m.classList.add("".concat($h,"modal"),"".concat($h,"fadeIn")),m.style.width="656px",m.style.height="620px",m.style.borderRadius="12px"):(m.classList.add("".concat($h,"modal-mobile"),"".concat($h,"-drawer-enter")),m.style.width="100%",m.style.height="80vh",m.style.borderRadius="12px 12px 0 0"),m.setAttribute("dir",u);var f=function(e,t,n){return function(){t&&(t.classList.remove("".concat($h,"fadeIn")),t.classList.add("".concat($h,"fadeOut")),"desktop"===e?(n.classList.remove("".concat($h,"fadeIn")),n.classList.add("".concat($h,"fadeOut"))):(n.classList.remove("".concat($h,"-drawer-enter")),n.classList.add("".concat($h,"-drawer-exit"))),setTimeout((function(){var e,r;null===(e=t.parentNode)||void 0===e||e.removeChild(t),null===(r=n.parentNode)||void 0===r||r.removeChild(n)}),em))}}(t,h,m),v=document.createElement("iframe");v.src=n,v.style.border="none",v.style.width="100%",v.style.height="100%";var g,y=r||{},_=y.theme,E=void 0===_?"light":_,b=y.backgroundColor,A=void 0===b?"#ffffff":b,S=rm(E);if(v.addEventListener("load",(function e(){m.removeChild(S),v.removeEventListener("load",e)})),a){var k=function(e){var t=e.onClose,n=e.textDirection,r=document.createElement("div");r.style.position="absolute","rtl"===n?r.style.left="16px":r.style.right="16px",r.style.top="23px",r.style.cursor="pointer";var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("viewBox","0 0 16 16"),o.setAttribute("fill","none");var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("d","M13.0449 2.99894L12.9494 2.91165L12.8685 2.85222L12.7802 2.7996C12.3611 2.57499 11.8556 2.64328 11.5228 2.9763L7.99909 6.50088L4.48854 2.99028L4.44701 2.95034C4.0098 2.57169 3.38048 2.57202 2.99838 2.9525L2.92363 3.03297L2.85175 3.12897L2.79916 3.21735C2.57471 3.63642 2.64292 4.14198 2.9757 4.47491L6.50186 8.00046L2.95226 11.5518C2.57141 11.9917 2.57173 12.6211 2.95197 13.0033L3.0324 13.078L3.12837 13.15L3.21674 13.2026C3.63573 13.4272 4.14123 13.3589 4.47407 13.0259L7.99909 9.49935L11.5474 13.0494C11.9944 13.4368 12.6238 13.4235 13.0212 13.0259L13.0922 12.9471L13.1559 12.8595C13.4298 12.4403 13.3789 11.8852 13.0211 11.5272L9.497 8.00115L13.0052 4.4915L13.07 4.4225C13.4304 4.00477 13.4199 3.37582 13.0449 2.99894Z"),i.setAttribute("fill","#ABB9CC"),o.appendChild(i),r.appendChild(o),r.onclick=t,r}({onClose:(g=!1,s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!g){e.next=2;break}return e.abrupt("return");case 2:return null===(t=S.parentNode)||void 0===t||t.removeChild(S),m.removeChild(v),n=rm(E,sh.get({defaultMessage:"closing",id:"antom.common.closing"})),m.appendChild(n),g=!0,e.prev=7,e.next=10,null==l?void 0:l();case 10:return e.prev=10,g=!1,e.finish(10);case 13:f();case 14:case"end":return e.stop()}}),e,null,[[7,,10,13]])})))),textDirection:u});v.addEventListener("load",(function e(){m.removeChild(k),v.removeEventListener("load",e)})),m.appendChild(k)}if(p){m.style.backgroundColor=A,v.style.backgroundColor=A;v.addEventListener("load",(function e(){var t;null===(t=S.parentNode)||void 0===t||t.removeChild(S),v.removeEventListener("load",e)})),m.appendChild(S)}m.appendChild(v);var T,P=document.getElementsByTagName("body")[0];return(T=document.createElement("style")).innerHTML=nm,document.head.appendChild(T),P.appendChild(h),P.appendChild(m),{iframe:v,destroy:f}};var im={position:"bottom-right",backgroundColor:"rgba(0, 0, 0, 0.80)",color:"#ffffff",padding:"20px 16px",borderRadius:"8px",fontSize:"14px",zIndex:9999,width:"148px",duration:2e3},am={"top-left":{top:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"},"bottom-left":{bottom:"20px",left:"20px"},"bottom-right":{top:"0",right:"0",bottom:"0",left:"0"},center:{top:"0",right:"0",bottom:"0",left:"0"}},sm={SUCCESS:"https://cdn.marmot-cloud.com/storage/2024/07/10/10b191d6-0b0a-4bd9-96cc-310b7f2a8530.svg",FAIL:"https://cdn.marmot-cloud.com/storage/2024/11/08/4ae27343-61d2-4a07-b323-c951c7711b40.svg"},lm="antom_toast-container";function cm(e){return um.apply(this,arguments)}function um(){return(um=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t;case 3:return n=e.sent,e.abrupt("return",{error:void 0,data:n});case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",{error:Qh.unificationError(e.t0).toJSON(),data:void 0});case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function dm(e,t){return pm.apply(this,arguments)}function pm(){return(pm=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Hh("com.ipay.iexpfront.channelClientId.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hm(e,t){return mm.apply(this,arguments)}function mm(){return(mm=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Hh("com.ipay.iexpcashier.cashier.createApplePayPaymentSession",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fm(e,t){return vm.apply(this,arguments)}function vm(){return(vm=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Hh("com.ipay.iexpfront.one.account.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gm(e,t){return ym.apply(this,arguments)}function ym(){return(ym=s()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Hh("com.ipay.iexpcashier.sdkAction.query",t,n));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var _m="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js",Em=null;function bm(){return Em||(Em=new Promise((function(e){if(Th)return e(!1);if(window.ApplePaySession)return e(!0);var t=function(t){clearTimeout(n),t||(Em=null),e(t)},n=setTimeout((function(){console.warn("[ApplePay] Apple Pay SDK load timed out, will retry on next call"),t(!1)}),1e4),r=document.querySelector('script[src="'.concat(_m,'"]'));if(r)return window.ApplePaySession?void t(!0):(r.addEventListener("load",(function(){return t(!0)})),void r.addEventListener("error",(function(){return t(!1)})));var o=document.createElement("script");o.src=_m,o.onload=function(){return t(!0)},o.onerror=function(){return t(!1)},document.head.appendChild(o)})),Em)}function Am(e){var t;if(!e)return null;var n,r=(null==e?void 0:e.paymentMethods)||[],o=d()(r);try{for(o.s();!(n=o.n()).done;){var i,a=n.value;if("APPLEPAY"===(null==a?void 0:a.paymentMethodType)||"APPLE_PAY"===(null==a?void 0:a.paymentMethodType))return(null==a||null===(i=a.paymentMethodDetail)||void 0===i||null===(i=i.applePayProps)||void 0===i?void 0:i.paymentRequest)||null}}catch(e){o.e(e)}finally{o.f()}return(null==e||null===(t=e.applePayProps)||void 0===t?void 0:t.paymentRequest)||null}var Sm=function(){function e(t){g()(this,e),c()(this,"opts",void 0),c()(this,"session",null),c()(this,"settled",!1),c()(this,"phase","idle"),c()(this,"cancelReason",null),c()(this,"modalCloseHandler",null),c()(this,"_activePay",null),this.opts=t}var t,n;return f()(e,[{key:"startPay",value:(n=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._activePay){e.next=2;break}return e.abrupt("return",this._activePay);case 2:return this._activePay=this._startPayInternal().finally((function(){t._activePay=null})),e.abrupt("return",this._activePay);case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_startPayInternal",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,l,c,u=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.settled=!1,this.phase="idle",this.cancelReason=null,(a=this.opts.paymentRequest).version&&Array.isArray(a.supportedNetworks)&&0!==a.supportedNetworks.length&&Array.isArray(a.merchantCapabilities)&&0!==a.merchantCapabilities.length&&a.countryCode&&a.currencyCode&&null!==(t=a.total)&&void 0!==t&&t.label&&null!==(n=a.total)&&void 0!==n&&n.amount){e.next=8;break}throw console.warn("[ApplePay] Required Apple Pay fields are missing"),{errorCode:"APPLE_PAY_MISSING_DATA"};case 8:return e.next=10,bm();case 10:if(l=e.sent,c=window.ApplePaySession,l&&c){e.next=16;break}throw console.warn("[ApplePay] Apple Pay SDK not available on host"),{errorCode:"APPLE_PAY_NOT_SUPPORTED"};case 16:if(null!==(r=c.canMakePayments)&&void 0!==r&&r.call(c)&&null!==(o=c.supportsVersion)&&void 0!==o&&o.call(c,a.version)){e.next=20;break}throw console.warn("[ApplePay] canMakePayments=false (version=".concat(a.version,")")),{errorCode:"APPLE_PAY_NOT_SUPPORTED"};case 20:e.prev=20,this.session=new c(a.version,this.buildSessionParams()),e.next=29;break;case 24:throw e.prev=24,e.t0=e.catch(20),console.warn("[ApplePay] ApplePaySession constructor failed:",e.t0),{errorCode:"APPLE_PAY_NOT_SUPPORTED"};case 29:return e.abrupt("return",new Promise((function(e,t){var n=function(n){u.settled||(u.settled=!0,u.clearModalCloseListener(),n?t(n):e())};u.session.onvalidatemerchant=function(){var e=s()(i()().mark((function e(t){var r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u.phase="validating",e.prev=1,e.next=4,u.opts.callbacks.validateMerchant(null==t?void 0:t.validationURL);case 4:if(r=e.sent){e.next=7;break}throw{errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"};case 7:u.phase="validated",u.session.completeMerchantValidation(r),e.next=21;break;case 11:if(e.prev=11,e.t0=e.catch(1),u.phase="idle",!u.settled){e.next=17;break}return u.safeAbort(),e.abrupt("return");case 17:o=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",console.warn("[ApplePay] validateMerchant failed:",e.t0),n({errorCode:o}),u.safeAbort();case 21:case"end":return e.stop()}}),e,null,[[1,11]])})));return function(t){return e.apply(this,arguments)}}(),u.session.onpaymentauthorized=function(){var e=s()(i()().mark((function e(t){var r,o,a,s,l,d,p;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!u.settled){e.next=2;break}return e.abrupt("return");case 2:if(u.phase="authorizing",r=(null==t?void 0:t.payment)||{},o=r.token,a=r.billingContact,s=r.shippingContact,o){e.next=9;break}return u.safeComplete(c.STATUS_FAILURE),n({errorCode:"APPLE_PAY_TOKEN_ERROR"}),e.abrupt("return");case 9:return e.prev=9,e.next=12,u.opts.callbacks.onAuthorized({token:o,billingContact:a,shippingContact:s});case 12:(l=e.sent).success?(u.safeComplete(c.STATUS_SUCCESS),n()):("MERCHANT_CONFIRM_ABORT"===l.errorCode?u.cancelReason="MERCHANT_ABORT":"MERCHANT_CONFIRM_TIMEOUT"===l.errorCode&&(u.cancelReason="MERCHANT_TIMEOUT"),u.safeComplete(c.STATUS_FAILURE),"MERCHANT_CONFIRM_ABORT"!==l.errorCode&&"MERCHANT_CONFIRM_TIMEOUT"!==l.errorCode||u.safeAbort(),d=l.errorCode||"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",l.errorMessage&&console.warn("[ApplePay] onAuthorized returned failure:",l.errorMessage),n({errorCode:d})),e.next=22;break;case 16:e.prev=16,e.t0=e.catch(9),u.safeComplete(c.STATUS_FAILURE),p=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED",console.warn("[ApplePay] onAuthorized threw:",e.t0),n({errorCode:p});case 22:case"end":return e.stop()}}),e,null,[[9,16]])})));return function(t){return e.apply(this,arguments)}}(),u.session.oncancel=function(){return"MERCHANT_ABORT"===u.cancelReason?(u.phase="idle",void n({errorCode:"MERCHANT_CONFIRM_ABORT"})):"MERCHANT_TIMEOUT"===u.cancelReason?(u.phase="idle",void n({errorCode:"MERCHANT_CONFIRM_TIMEOUT"})):"validating"===u.phase?(u.phase="idle",void n({errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"})):(u.phase,u.phase="idle",void n({errorCode:"APPLE_PAY_CANCEL"}))};try{u.session.begin()}catch(e){return console.warn("[ApplePay] ApplePaySession.begin() failed:",e),void n({errorCode:"APPLE_PAY_NOT_SUPPORTED"})}u.opts.enableModalCloseListener&&u.attachModalCloseListener((function(){u.safeAbort(),n({errorCode:"APPLE_PAY_CANCEL"})}))})));case 30:case"end":return e.stop()}}),e,this,[[20,24]])}))),function(){return t.apply(this,arguments)})},{key:"buildSessionParams",value:function(){var e=this.opts.paymentRequest,t={countryCode:e.countryCode,currencyCode:e.currencyCode,merchantCapabilities:e.merchantCapabilities,supportedNetworks:e.supportedNetworks,requiredBillingContactFields:e.requiredBillingContactFields,requiredShippingContactFields:e.requiredShippingContactFields,total:e.total};return e.lineItems&&e.lineItems.length>0&&(t.lineItems=e.lineItems),e.recurringPaymentRequest&&(t.recurringPaymentRequest=e.recurringPaymentRequest),t}},{key:"safeAbort",value:function(){try{var e,t;null===(e=this.session)||void 0===e||null===(t=e.abort)||void 0===t||t.call(e)}catch(e){}}},{key:"safeComplete",value:function(e){try{var t,n;null===(t=this.session)||void 0===t||null===(n=t.completePayment)||void 0===n||n.call(t,e)}catch(e){}}},{key:"attachModalCloseListener",value:function(e){var t,n=document.querySelector("apple-pay-modal"),r=(null==n||null===(t=n.shadowRoot)||void 0===t?void 0:t.querySelector(".modal-close-button"))||null;if(r){var o=function(){e()};r.addEventListener("click",o,{once:!0}),this.modalCloseHandler={el:r,fn:o}}}},{key:"clearModalCloseListener",value:function(){this.modalCloseHandler&&(this.modalCloseHandler.el.removeEventListener("click",this.modalCloseHandler.fn),this.modalCloseHandler=null)}}]),e}();function km(e){return Tm.apply(this,arguments)}function Tm(){return Tm=s()(i()().mark((function e(t){var n,r,o,a,l,c,u,d,p,m,f,v,g,y,_,E,b,A,S,k,T,P,I;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.requestId,r=t.renderData,o=t.appConfig,a=t.walletAmount,l=t.sendReply,c=Am(r)){e.next=5;break}return l({requestId:n,success:!1,errorCode:"APPLE_PAY_MISSING_DATA"}),e.abrupt("return");case 5:return u=c.merchantCapabilities,d=c.merchantInfo,p=c.paymentAmount,m=c.supportedNetworks,f=c.version,v=c.requiredBillingContactFields,g=c.requiredShippingContactFields,y=(null==o?void 0:o.sessionData)||"",E=null==(_=null!=a?a:p)?void 0:_.value,b=null==p?void 0:p.currency,A=Pm(y,d,_),P=new Sm({paymentRequest:h()({countryCode:null==d?void 0:d.countryCode,currencyCode:b,merchantCapabilities:u,supportedNetworks:m,requiredBillingContactFields:v,requiredShippingContactFields:g,total:A?{type:"final",label:A.regularBilling.label,amount:E}:{type:"final",label:null==d?void 0:d.merchantName,amount:E},version:A?14:f},A?{lineItems:[A.regularBilling],recurringPaymentRequest:A}:{}),enableModalCloseListener:!1,callbacks:{validateMerchant:function(){var e=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,hm({validateUrl:t,paymentSessionData:y,merchantDomain:window.location.hostname});case 2:if(null==(n=e.sent)||!n.success||!n.merchantSessionObject){e.next=5;break}return e.abrupt("return","string"==typeof n.merchantSessionObject?JSON.parse(n.merchantSessionObject):n.merchantSessionObject);case 5:throw{errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"};case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),onAuthorized:function(){var e=s()(i()().mark((function e(t){var n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.token,r=t.billingContact,o=t.shippingContact,k=r,T=o,S={token:n,billingContact:r,shippingContact:o},e.abrupt("return",{success:!0,result:S});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}),e.prev=12,e.next=15,P.startPay();case 15:l({requestId:n,success:!0,result:S,billingDetails:k,shippingAddress:T}),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(12),I=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED",l({requestId:n,success:!1,errorCode:I});case 22:case"end":return e.stop()}}),e,null,[[12,18]])}))),Tm.apply(this,arguments)}function Pm(e,t,n){if(!e)return null;try{var r,o,i,a,s,l,c=Gh(e),u=null==c?void 0:c.paymentSessionFactor,d=null==u?void 0:u.recurringInfo;if(!d)return null;var p=null==u||null===(r=u.order)||void 0===r?void 0:r.orderDescription;if(!p||!d.managementURL)return null;var m=h()(h()(h()({type:"final",label:null!==(o=d.title)&&void 0!==o?o:null==t?void 0:t.merchantName,amount:null==n?void 0:n.value,paymentTiming:"recurring"},d.startDate?{recurringPaymentStartDate:new Date(1e3*d.startDate)}:{}),d.endDate?{recurringPaymentEndDate:new Date(1e3*d.endDate)}:{}),{},{recurringPaymentIntervalUnit:null!==(i=d.intervalUnit)&&void 0!==i?i:"month",recurringPaymentIntervalCount:null!==(a=d.intervalCount)&&void 0!==a?a:1});return{paymentDescription:p,billingAgreement:null!==(s=d.agreementDescription)&&void 0!==s?s:void 0,regularBilling:m,managementURL:d.managementURL,tokenNotificationURL:null!==(l=d.tokenNotificationURL)&&void 0!==l?l:void 0}}catch(e){return null}}var Im=function(e){return e.EXPRESS_CHECKOUT="EXPRESS_CHECKOUT",e.ELEMENT_PAYMENT="ELEMENT_PAYMENT",e}({}),Cm=[{eventName:Im.EXPRESS_CHECKOUT,supportedEvents:[]},{eventName:Im.ELEMENT_PAYMENT,supportedEvents:["paymentMethodChanged","billingAddressChanged"]}],wm=".ams-component-container-mobile {\n width: 100%;\n height: 1px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n}\n.ams-component-container-mobile-animation{\n animation: ams-component-container-slide-in 0.3s ease-in-out;\n}\n\n.ams-component-section-desktop {\n font-size: 0;\n}\n\n.ams-component-container-hidden-mobile {\n width: 100%;\n height: 0px;\n position: fixed;\n bottom: -1px;\n left: 0;\n z-index: 1001;\n background-color: transparent;\n border-radius: 12px 12px 0 0;\n animation: ams-component-container-slide-out 0.26s ease-in forwards;\n overflow: hidden;\n}\n\n.ams-component-section-mobile {\n border-radius: 12px 12px 0 0;\n overflow: hidden;\n font-size: 0;\n height: 100%;\n}\n\n.ams-component-container-desktop {\n display: block;\n width: 672px;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 12px;\n overflow: hidden;\n transform-origin: 50% 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-container-desktop-animation{\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n@keyframes ams-component-container-zoom-out {\n 0% {\n transform: translate(-50%, -50%) scale(1);\n -webkit-transform: translate(-50%, -50%) scale(1);\n opacity: 1\n }\n\n 100% {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.4);\n -webkit-transform: translate(-50%, -50%) scale(0.4);\n }\n}\n\n@keyframes ams-component-container-zoom-in {\n 0% {\n transform: translate(-50%, -50%) scale(0.4);\n opacity: 0\n }\n\n 100% {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n}\n\n.ams-component-container-hidden-desktop {\n display: block;\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 1001;\n border-radius: 8px;\n overflow: hidden;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n transform-origin: 50% 50%;\n}\n\n.ams-component-loading {\n width: 0.8em;\n height:0.8em;\n background: rgba(0, 0, 0, 0.5);\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-loading .line div:before,\n.ams-component-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: #fcfcfc;\n border-radius: 5.3px;\n}\n.ams-component-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n\n.asm-component-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 0;\n top: 0;\n cursor: pointer;\n}\n.asm-component-close-block-btn-desktop {\n width: 11px;\n height: 11px;\n object-fit: fill;\n position: absolute;\n right: 18.7px;\n top: 26.7px;\n}\n.asm-component-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n.asm-component-close-block-mobile {\n position: absolute;\n width: 0.4em;\n height: 0.4em;\n right: 0;\n top: 0;\n cursor: pointer;\n z-index: 1009;\n}\n\n.asm-component-close-block-btn-mobile {\n width: 0.11em;\n height: 0.11em;\n object-fit: fill;\n position: absolute;\n right: 0.147em;\n top: 0.167em;\n}\n.ams-component-mask-close-block-desktop {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n top: 10px;\n cursor: pointer;\n z-index: 1013;\n}\n \n.ams-component-mask-close-block-mobile {\n position: absolute;\n width: 40px;\n height: 40px;\n right: 18px;\n cursor: pointer;\n z-index: 1012;\n}\n\n.ams-component-mask-close-block-hidden {\n width: 0px !important;\n height: 0px !important;\n visibility: hidden;\n}\n\n.ams-component-mask-close-block-btn {\n width: 24px;\n height: 24px;\n object-fit: fill;\n position: absolute;\n right: 8px;\n top: 8px;\n}\n\n.ams-component-container-opacity{\n opacity: 1;\n}\n\n.ams-component-container-opacity:after{\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n display: block;\n content: \"\";\n z-index: 1010;\n background-color: rgba(0, 0, 0, 0.35);\n border-radius: 12px 12px 0 0;\n}\n\n#ams-component-retention {\n position: fixed;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n transform-origin: 50%;\n height: auto;\n display: none;\n z-index: 1009;\n}\n\n.ams-component-retention-show {\n display: flex !important;\n animation: ams-component-container-zoom-in 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n\n.ams-component-retention-hidden {\n display: flex !important;\n animation: ams-component-container-zoom-out 0.3s ease-in-out;\n -webkit-animation: ams-component-container-zoom-out 0.3s ease-in-out;\n animation-fill-mode: forwards;\n -webkit-animation-fill-mode: forwards;\n}\n\n.ams-component-retention-mobile {\n width: 294px;\n border-radius: 12px;\n padding: 24px 0;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n.ams-component-retention-desktop {\n width: 544px;\n border-radius: 12px;\n padding: 32px;\n background-color: #fff;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n box-sizing: border-box;\n}\n\n@media screen and (max-width: 300px) {\n .ams-component-retention-mobile {\n transform: translate(-50%, -50%) scale(0.8);\n }\n}\n\n.ams-component-retention-title-mobile {\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-title-desktop {\n text-align: left;\n width: 100%;\n font-style: normal;\n font-weight: 500;\n font-size: 16px;\n line-height: 24px;\n color: #2A3A52;\n}\n\n.ams-component-retention-sub-title-mobile {\n width: 100%;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 8px;\n text-align: center;\n padding: 0 16px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-sub-title-desktop {\n text-align: left;\n font-style: normal;\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: #7C8CA3;\n margin-top: 10px;\n}\n\n.ams-component-retention-btn-block-mobile {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n margin-top: 24px;\n padding: 0 24px;\n box-sizing: border-box;\n}\n\n.ams-component-retention-btn-block-desktop {\n width: 100%;\n margin-top: 24px;\n}\n\n#ams-component-retention-remain {\n background: #0079FF;\n border-radius: 100px;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n color: #FFFFFF;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-remain-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n padding: 0 6px;\n}\n\n.ams-component-retention-remain-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n display: inline-block;\n padding: 0 24px;\n float: right;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 159px;\n}\n\n#ams-component-retention-leave {\n border-radius: 100px;\n border: 1px solid #0079FF;\n font-style: normal;\n font-weight: 500;\n text-align: center;\n box-sizing: border-box;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ams-component-retention-leave-mobile {\n width: 100%;\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n margin-top: 12px;\n padding: 0 6px;\n}\n\n.ams-component-retention-leave-desktop {\n height: 44px;\n font-size: 16px;\n line-height: 44px;\n color: #1677FF;\n display: inline-block;\n padding: 0 24px;\n float: right;\n margin-right: 16px;\n cursor: pointer;\n padding: 0 16px;\n max-width: 225px;\n min-width: 144px;\n}\n.".concat(ke,"-hidden{\nanimation: ").concat(ke,"-opacity 0.3s ease-in-out;\n animation-fill-mode: forwards\n}\n/** 加载动画 **/\n@-webkit-keyframes ").concat(ke,"-opacity {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n"),Nm=function(e,t){if(!document.getElementById(ye)){var n;(n=document.createElement("style")).type="text/css",n.innerHTML=wm,document.head.appendChild(n),St();var r=document.createElement("div");r.className="".concat(ye,"-hidden-").concat(e),r.id=ye,At(0,r),document.body.appendChild(r);var o=document.createElement("div");return o.className="ams-component-section-".concat(e),o.id=_e,r.appendChild(o),r.classList.remove("".concat(ye,"-hidden-").concat(e)),r.classList.add("".concat(ye,"-").concat(e)),Om(e,t),o}},Om=function(e,t){var n=e===te.mobile?"touchend":"click",r=document.getElementById(ye),o="<img class='".concat(be,"-btn-").concat(e,"' src=\"").concat(De,'"/>'),i=document.createElement("div");i.classList.add("".concat(be,"-").concat(e),"".concat(be,"-hidden")),i.id=be,i.innerHTML=o,i.addEventListener(n,(function(){t()})),r&&r.appendChild(i)},Rm=function(){var e=document.getElementById(Se),t=document.getElementById(ye);e&&(e.classList.remove("".concat(Se,"-show")),e.classList.add("".concat(Se,"-hidden")),setTimeout((function(){e.classList.remove("".concat(Se,"-hidden")),null==t||t.classList.remove("".concat(ye,"-opacity"))}),Me))},Mm=function(){var e=document.getElementById(Se),t=document.getElementById(ye);e&&(null==t||t.classList.add("".concat(ye,"-opacity")),e.classList.remove("".concat(Se,"-hidden")),e.classList.add("".concat(Se,"-show")))},Dm=function(){var e;null===(e=document.getElementById(Se))||void 0===e||e.remove()},Lm=function(e){var t=(null==e?void 0:e.platform)===te.mobile?"touchend":"click",n=document.getElementsByTagName("body")[0];n.style.overflow="hidden";var r=document.createElement("div");r.style.width="100vw",r.style.height="100vh",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.zIndex="1000",r.style.background="rgba(0,0,0,0.5)",r.style.display="none",r.id=ke,r.addEventListener(t,(function(){var t;null==e||null===(t=e.onClickOutside)||void 0===t||t.call(e)})),n.appendChild(r),function(e,t){var n=e===te.mobile?"touchend":"click",r="<div class='".concat(Ae,'-btn\'>\n <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M19.5673 4.49829L19.424 4.36736L19.3027 4.27821L19.1702 4.19928C18.5417 3.86236 17.7834 3.96479 17.2841 4.46433L11.9986 9.7512L6.73275 4.4853L6.67045 4.42539C6.01464 3.85742 5.07067 3.85791 4.49751 4.42864L4.38538 4.54934L4.27757 4.69333L4.19868 4.8259C3.862 5.45451 3.96432 6.21286 4.46349 6.71225L9.75274 12.0006L4.42833 17.3276C3.85705 17.9874 3.85754 18.9315 4.42789 19.5048L4.54854 19.6169L4.6925 19.7248L4.82504 19.8038C5.45353 20.1407 6.21179 20.0383 6.71105 19.5388L11.9986 14.2489L17.321 19.574C17.9915 20.1551 18.9356 20.1352 19.5317 19.5388L19.6383 19.4206L19.7338 19.2891C20.1447 18.6603 20.0683 17.8276 19.5316 17.2907L14.2454 12.0016L19.5077 6.73713L19.605 6.63362C20.1455 6.00703 20.1297 5.06361 19.5673 4.49829Z" fill="#EEEEEE"/>\n</svg>\n </div>'),o=document.createElement("div");o.classList.add("".concat(Ae,"-").concat(e),"".concat(Ae,"-hidden")),o.id=Ae,o.innerHTML=r,o.addEventListener(n,(function(){t()})),document.body.appendChild(o)}(null==e?void 0:e.platform,null==e?void 0:e.closeBtnFunc)},xm=function(){var e=document.getElementById(ke);null==e||e.classList.add("".concat(ke,"-hidden"))},Um=function(){document.getElementsByTagName("body")[0].style.overflow="auto";var e=document.getElementById(ke);null==e||e.remove()},Km="\n .".concat(Ne,"modal {\n /* 添加弹窗样式 */\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 9999; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n .").concat(Ne,"modal-mobile{\n background-color: #fff;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n position: fixed;\n bottom: 0;\n left: 0%;\n z-index: 2147483647; /* 设置弹窗的层级为 9999 */\n overflow: hidden;\n }\n\n .").concat(Ne,"overlay {\n /* 添加蒙层样式 */\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 999;\n }\n\n .").concat(Ne,"fadeIn {\n /* 添加淡入动画 */\n animation: fadeIn ").concat(Me,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ne,"fadeOut {\n /* 添加淡出动画 */\n animation: fadeOut ").concat(Me,"ms;\n animation-fill-mode: forwards;\n }\n\n .").concat(Ne,"-drawer-enter {\n animation: slideIn ").concat(Me,"ms forwards;\n }\n\n @keyframes slideIn {\n from {\n transform: translateY(100%); /* 滑入时在视口底部外 */\n opacity: 0; /* 初始透明度为 0 */\n }\n to {\n transform: translateY(0); /* 滑入结束时在原位置 */\n opacity: 1; /* 结束时透明度为 1 */\n }\n }\n\n /* 抽屉从底部滑出 */\n .").concat(Ne,"-drawer-exit {\n animation: slideOut ").concat(Me,"ms forwards;\n }\n\n @keyframes slideOut {\n from {\n transform: translateY(0); /* 滑出时从当前位置开始 */\n opacity: 1; /* 初始透明度为 1 */\n }\n to {\n transform: translateY(100%); /* 滑出结束时在视口底部外 */\n opacity: 0; /* 结束时透明度为 0 */\n }\n }\n\n /* 定义淡入动画 */\n @keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-webkit-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n @-moz-keyframes fadeIn {\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n }\n\n /* 定义淡出动画 */\n @keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-webkit-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n @-moz-keyframes fadeOut {\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n }\n\n\n.ams-component-popup-loading {\n width: 0.8em;\n height:0.8em;\n border-radius: 8px;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.ams-component-popup-loading .line {\n width: 40px;\n height: 40px;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n}\n.ams-component-popup-loading .line div {\n position: absolute;\n left: 17.67px;\n top: 0;\n width: 5.33px;\n height: 40px;\n}\n\n.ams-component-popup-loading .line div:before,\n.ams-component-popup-loading .line div:after {\n content: '';\n display: block;\n height: 13.33px;\n background: black;\n border-radius: 5.3px;\n}\n.ams-component-popup-loading .line div:after {\n margin-top: 13.33px;\n}\n\n.ams-component-popup-loading .line div:nth-child(2) {\n -webkit-transform: rotate(45deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(3) {\n -webkit-transform: rotate(90deg);\n}\n\n.ams-component-popup-loading .line div:nth-child(4) {\n -webkit-transform: rotate(135deg);\n}\n\n/** 加载动画 **/\n@-webkit-keyframes load {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n.ams-component-popup-loading .line div:nth-child(1):before {\n -webkit-animation: load 1s linear 0s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):before {\n -webkit-animation: load 1s linear 0.125s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):before {\n -webkit-animation: load 1s linear 0.25s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):before {\n -webkit-animation: load 1s linear 0.375s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(1):after {\n -webkit-animation: load 1s linear 0.5s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(2):after {\n -webkit-animation: load 1s linear 0.675s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(3):after {\n -webkit-animation: load 1s linear 0.75s infinite;\n}\n\n.ams-component-popup-loading .line div:nth-child(4):after {\n -webkit-animation: load 1s linear 0.875s infinite;\n}\n\n.ams-component-popup-loading-logo {\n width: 0.44em;\n height: 0.44em;\n -webkit-transform:rotate(360deg);\n transform:rotate(360deg);\n -webkit-transition:-webkit-transform 1s linear;\n transition:transform 1s linear;\n animation: ams-component-loading-logo 1s linear infinite;\n}\n"),Bm=function(){var e=document.createElement("style");e.innerHTML=Km,document.head.appendChild(e)};var Ym="desktop",Fm=function(e){var t=e.device,n=e.url,r=e.loadingConfig,o=e.styleConfig,i=e.showCloseOnLoading,a=e.onCloseOnLoading,s=e.textDirection,l=void 0===s?"ltr":s;return new Promise((function(e,s){try{Ym=t;var c=document.createElement("div");c.classList.add("".concat(Ne,"overlay"),"".concat(Ne,"fadeIn")),document.body.parentElement.style.overflow="hidden";var u=document.createElement("div");"desktop"===t?(u.classList.add("".concat(Ne,"modal"),"".concat(Ne,"fadeIn")),u.style.width="656px",u.style.height="620px",u.style.borderRadius="12px"):(u.classList.add("".concat(Ne,"modal-mobile"),"".concat(Ne,"-drawer-enter")),u.style.width="100%",u.style.height="80vh",u.style.borderRadius="12px 12px 0 0"),u.setAttribute("dir",l);var d=document.createElement("iframe");if(d.src=n,d.style.border="none",d.style.width="100%",d.style.height="100%",d.style.colorScheme=Oe,o&&(u.style.backgroundColor=o.backgroundColor,d.style.backgroundColor=o.backgroundColor),r&&Object.keys(r).length){r.theme;var p=r.backgroundPrimary,h=void 0===p?"#ffffff":p;u.style.backgroundColor=h,d.style.backgroundColor=h}if(i){var m=function(e){var t=e.onClose,n=e.textDirection,r=document.createElement("div");r.style.position="absolute","rtl"===n?r.style.left="16px":r.style.right="16px",r.style.top="23px",r.style.cursor="pointer";var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("viewBox","0 0 16 16"),o.setAttribute("fill","none");var i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("fill-rule","evenodd"),i.setAttribute("clip-rule","evenodd"),i.setAttribute("d","M13.0449 2.99894L12.9494 2.91165L12.8685 2.85222L12.7802 2.7996C12.3611 2.57499 11.8556 2.64328 11.5228 2.9763L7.99909 6.50088L4.48854 2.99028L4.44701 2.95034C4.0098 2.57169 3.38048 2.57202 2.99838 2.9525L2.92363 3.03297L2.85175 3.12897L2.79916 3.21735C2.57471 3.63642 2.64292 4.14198 2.9757 4.47491L6.50186 8.00046L2.95226 11.5518C2.57141 11.9917 2.57173 12.6211 2.95197 13.0033L3.0324 13.078L3.12837 13.15L3.21674 13.2026C3.63573 13.4272 4.14123 13.3589 4.47407 13.0259L7.99909 9.49935L11.5474 13.0494C11.9944 13.4368 12.6238 13.4235 13.0212 13.0259L13.0922 12.9471L13.1559 12.8595C13.4298 12.4403 13.3789 11.8852 13.0211 11.5272L9.497 8.00115L13.0052 4.4915L13.07 4.4225C13.4304 4.00477 13.4199 3.37582 13.0449 2.99894Z"),i.setAttribute("fill","#ABB9CC"),o.appendChild(i),r.appendChild(o),r.onclick=t,r}({onClose:a,textDirection:l});u.appendChild(m),d.addEventListener("load",(function(){u.removeChild(m)}))}u.appendChild(d);var f=document.getElementsByTagName("body")[0];f.appendChild(c),f.appendChild(u),e(d)}catch(e){s({title:"sdk_error_create_pop_up",message:null==e?void 0:e.toString()})}}))},Hm=function(){var e=document.querySelector(".".concat(Ne,"overlay"));if(e){document.body.parentElement.style.overflow="scroll";var t="desktop"===Ym?document.querySelector(".".concat(Ne,"modal")):document.querySelector(".".concat(Ne,"modal-mobile"));e.classList.remove("".concat(Ne,"fadeIn")),e.classList.add("".concat(Ne,"fadeOut")),"desktop"===Ym?(t.classList.remove("".concat(Ne,"fadeIn")),t.classList.add("".concat(Ne,"fadeOut"))):(t.classList.remove("".concat(Ne,"-drawer-enter")),t.classList.add("".concat(Ne,"-drawer-exit"))),setTimeout((function(){var n,r;null===(n=e.parentNode)||void 0===n||n.removeChild(e),null===(r=t.parentNode)||void 0===r||r.removeChild(t)}),Me)}},jm=function(e){return e.CODE_VIEW="/elements/pages/code-view/index.html",e.ELEMENT_PAYMENT="/elements/pages/element_payment/index.html",e.EXPRESS_CHECKOUT="/elements/pages/express_checkout/index.html",e.IFRAME_ELEMENT="/elements/pages/iframe-element/index.html",e.INSTRUCTION_GUIDE="/elements/pages/instruction-guide/index.html",e.THREED_PAGE="/elements/pages/threed-page/index.html",e.ELEMENT_AUTH="/auth-element/pages/element_auth/index.html",e.ADDRESS="/element-address/pages/address/index.html",e.NEW_ELEMENT_PAYMENT="/elements2/pages/element_payment/index.html",e}({}),Vm=f()((function e(){g()(this,e),c()(this,"type",void 0),c()(this,"platform",void 0),c()(this,"isRetention",void 0),c()(this,"selector",void 0),c()(this,"appearance",void 0),c()(this,"appendAliasContainerId",void 0),c()(this,"merchantAppointParam",void 0),c()(this,"iframeStyle",void 0),c()(this,"notRedirectAfterComplete",void 0),this.platform=_t()?te.desktop:te.mobile,this.isRetention=!0,this.type=F.popup,this.selector=""})),Gm=function(e){return e.UNINIT="UNINIT",e.INITING="INITING",e.READY="READY",e.IN_BIZ_FLOW="IN_BIZ_FLOW",e.DESTROYED="DESTROYED",e}({});function zm(e){var t,n,r=e.status,o=e.paymentContainerService,i=e.newPaymentSessionData,a=e.oldPaymentSessionData;if(r!==Gm.IN_BIZ_FLOW)return!1;if(!o)return!1;var s=rl(a),l=tt()(s,1)[0],c=rl(i),u=tt()(c,1)[0];return!(null==l||!l.connectFactor||null==u||!u.connectFactor)&&(null==l||null===(t=l.connectFactor)||void 0===t?void 0:t.enableConnect)===(null==u||null===(n=u.connectFactor)||void 0===n?void 0:n.enableConnect)}function Wm(e){var t,n,r=e.paymentSessionObj,o=e.paymentSession,i=e.instanceId,a=e.environment,s=e.appVersion,l=e.analytics,u=e.locale,d=e.pageUrl,p=e.link,h=e.renderDisplayType,m=nl(r),f=(null==r||null===(t=r.paymentSessionConfig)||void 0===t?void 0:t.productSceneVersion)||"",v=(null==r||null===(n=r.paymentSessionConfig)||void 0===n?void 0:n.productScene)||"",g=(null==r?void 0:r.extendInfo)||"",y=null==r?void 0:r.clientId,_=(o||"").split("&&")[1]||"",E=c()(c()(c()(c()(c()(c()({},U.DEV,"http://page.alipay.net/page/antom-web-checkout-v2"),U.TEST,"http://page.test.alipay.net/page/antom-web-checkout-v2"),U.SIT,"http://page.test.alipay.net/page/antom-web-checkout-v2"),U.PRE,"https://pre.ac.alipay.com/page/antom-web-checkout-v2"),U.SANDBOX,"https://checkout.antom.com"),U.PROD,"https://checkout.antom.com"),b=(null==a?void 0:a.toLocaleUpperCase())||U.DEV;p||(p="".concat(E[b]).concat(d));var A=Ha({renderDisplayType:null!=h?h:F.inline,componentSign:m,analytics:l,productScene:v,productSceneVersion:f,environment:a,appVersion:s,extendInfo:g,locale:u,instanceId:i,hostSign:_,mid:y,elementLink:p}),S=A.path,k=A.locationSearch;return console.log("[debug] generateIframeSrc",S,k),"".concat(S,"?").concat(k)}function qm(e){return new Promise((function(t,n){var r=(gt?ee.WAP:ee.WEB)===ee.WEB,o=(null==e?void 0:e.normalUrl)||"",i=(null==e?void 0:e.schemeUrl)||"",a=(null==e?void 0:e.applinkUrl)||"",s=(null==e?void 0:e.callAppJudgeTime)||"",l=function(){if(o)return t(),void(window.location.href=o);n(me.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};r?l():function(){if(i||a){var e={fallback:function(){l()},successCb:function(){t()},delay:0};s&&(e.resultJudgmentTime=s);try{new Xs(e).open({scheme:i,link:a})}catch(e){l()}}else l()}()}))}var Jm=function(){var e=navigator.userAgent.toLowerCase(),t=window.screen.width,n=window.screen.height,r=Math.min(t,n)/Math.max(t,n);return/ipad|tablet|(android(?!.*mobile))/i.test(e)||r>.5&&r<.75&&t>=768&&n>=1024},Qm=function(){return!((e=navigator.userAgent).includes("AlipayWebViewClient")||["Android","iPhone","SymbianOS","Windows Phone","iPod","iPad"].some((function(t){return e.includes(t)})));var e},Zm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e)return t;try{return JSON.stringify(e)||t}catch(e){return console.error("JSON.stringify failed:",e),t}},Xm=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return t;try{return JSON.parse(e)||t}catch(e){return console.error("JSON.parse failed:",e),t}},$m=function(){function e(t){g()(this,e),c()(this,"elementContainer",void 0),c()(this,"instanceId",void 0),c()(this,"options",void 0),c()(this,"obtainDataRes",void 0),c()(this,"elementUrl",void 0),c()(this,"eventCenter",void 0),c()(this,"eventListener",{}),this._setOptions(t)}return f()(e,[{key:"_setOptions",value:function(e){var t,n=this;this.options={},n.options.mode=(null==e?void 0:e.mode)||Q.component,null!=e&&e.mode&&!((null==e?void 0:e.mode)in Q)&&(console.warn(me.INIT_PARAMETER_ERROR.MODE_ERROR.message),n.options.mode=Q.component),n.options.networkMode=(null==e?void 0:e.networkMode)||Z.session,null!=e&&e.networkMode&&!((null==e?void 0:e.networkMode)in Z)&&(console.warn(me.INIT_PARAMETER_ERROR.NET_MODE_NOT_SUPPORT.message),n.options.networkMode=Z.proxy),t=Et()._moreEnv,null!=e&&e.environment&&!((null==e?void 0:e.environment)in X)&&"true"!==t&&(console.warn(me.INIT_PARAMETER_ERROR.ENVIRONMENT_ERROR.message),e.environment="prod"),n.options.env={terminalType:gt?ee.WAP:ee.WEB,environment:(null==e?void 0:e.environment)||"prod"},n.options.env.terminalType===ee.WAP&&(n.options.env.osType=ft?$.IOS:vt?$.ANDROID:$.ELSE),this.options.locale=(null==e?void 0:e.locale)||"",this.options.product=null==e?void 0:e.product,this.options.preview=null==e?void 0:e.preview}},{key:"registerElementContainer",value:function(e){this.elementContainer=e}},{key:"registerEventCenter",value:function(e){this.eventCenter=e}},{key:"registerEventListener",value:function(e,t){this.eventCenter[e]=t}},{key:"setElementUrl",value:function(e){this.elementUrl=e}},{key:"getElementUrl",value:function(){return this.elementUrl}},{key:"getObtainDataRes",value:function(){return this.obtainDataRes}}]),e}(),ef=function(e){_()(n,e);var t=b()(n);function n(){return g()(this,n),t.apply(this,arguments)}return f()(n,[{key:"onReady",value:function(e){var t,n,r,o=this.elementContainer.getPaymentContext(),i=o.paymentSessionObj,a=o.paymentSessionId,s=o.displayInfo,l=(null===(t=i.connectFactor)||void 0===t?void 0:t.enableConnect)&&(null===(n=i.paymentSessionConfig)||void 0===n?void 0:n.productScene)===V.ELEMENT_PAYMENT;this.eventCenter.dispatchToApp({event:"renderComponent",data:{params:{heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),paymentSessionData:a,queryResult:e.queryResult,envInfo:{screenHeight:screen.height,screenWidth:screen.width},configParams:h()({needEditBackBtn:l,autoSaveAsDefaultAddress:l,editingNeedShippingQuery:l,showTitle:l},e.configParams),appearance:s.appearance,sessionResult:i,prefillValue:null!=e&&e.originOneAccountQueryResult?null==e||null===(r=e.originOneAccountQueryResult)||void 0===r?void 0:r.shippings:e.prefillValue},target:"ADDRESS_ELEMENT"}})}},{key:"parameterInitAndCheck",value:function(){}},{key:"beforeMount",value:function(){}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t=e.link,n=e.instanceId;this.instanceId=n;var r=this.elementContainer.getPaymentContext()||{},o=r.paymentSession,i=r.paymentSessionObj,a=r.sdkMetaData,s=this.options;return Wm({paymentSession:o,paymentSessionObj:i,environment:s.env.environment,analytics:s.analytics,locale:s.locale,link:t,appVersion:null==a?void 0:a.webAppVersion,pageUrl:jm.ADDRESS,instanceId:n})}},{key:"obtainData",value:function(){return this.obtainDataRes={},{}}},{key:"getValue",value:function(e){var t=this;return new Promise((function(n,r){try{t.eventCenter.dispatchToApp({event:"getValue",data:e}),t.eventCenter.listen("onAddressResult",(function(e){n(e)}))}catch(e){r(e)}}))}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=rl(n),o=tt()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{paymentSessionData:n,data:t,sessionResult:i,sessionData:a}})}}]),n}($m),tf=ef,nf=function(e){_()(n,e);var t=b()(n);function n(){return g()(this,n),t.apply(this,arguments)}return f()(n,[{key:"onReady",value:function(e){this.eventCenter.dispatchToApp({event:"renderComponent",data:{params:e,target:"AUTH_ELEMENT"}})}},{key:"parameterInitAndCheck",value:function(){}},{key:"beforeMount",value:function(){}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t=e.link,n=e.instanceId;this.instanceId=n;var r=this.elementContainer.getPaymentContext()||{},o=r.paymentSession,i=r.paymentSessionObj,a=r.sdkMetaData,s=this.options;return Wm({paymentSession:o,paymentSessionObj:i,environment:s.env.environment,analytics:s.analytics,locale:s.locale,link:t,appVersion:null==a?void 0:a.webAppVersion,pageUrl:jm.ELEMENT_AUTH,instanceId:n})}},{key:"obtainData",value:function(){return this.obtainDataRes={},{}}},{key:"getValue",value:function(){return{}}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=rl(n),o=tt()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{params:{paymentSessionData:n,sessionResult:i,sessionData:a,originActionQueryResult:t.originActionQueryResult,originOneAccountQueryResult:t.originOneAccountQueryResult}}})}}]),n}($m),rf=nf,of="#".concat(Ee,"-desktop{\n position: absolute;\n top: 0;\n left: 0;\n}\n#").concat(Ee,"-mobile{\n position: absolute;\n top: 0;\n left: 0;\n}\n.").concat(ye,"-inline{\n width: 100%;\n height: auto;\n position: relative;\n line-height: 0;\n display: flex;\n}\n#").concat(Te,"{\n width: 100%;\n flex: 1;\n}\n.").concat(we,"{\n width: 100%;\n height: auto;\n object-fit: contain;\n box-sizing: border-box;\n}\n.").concat(we,"-mobile{\n padding: 0 0.16em;\n}\n.").concat(we,"-desktop{}\n"),af=function(){var e=document.createElement("style");e.id="ams-inline-component-style",e.type="text/css",e.innerHTML=of,document.head.appendChild(e)},sf=function(e,t,n){var r=document.createElement("div");r.id=Te,(null==n?void 0:n.componentSign)===j.ELEMENT_PAYMENT?n.isExpressCheckout?r.innerHTML="":r.innerHTML=function(e){var t=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){return e+t}),"")},n=function(e){var t=e.x,n=void 0===t?0:t,r=e.y,o=void 0===r?0:r,i=e.fill,a=void 0===i?"black":i,s=e.width,l=void 0===s?560:s,c=e.height,u=void 0===c?32:c,d=e.rx,p=void 0===d?4:d;return'<rect fill-opacity="0.04" x="'.concat(n,'" y="').concat(o,'" width="').concat(l,'" height="').concat(u,'" rx="').concat(p,'" fill="').concat(a,'"/>')},r=[n({fill:"white"}),n({y:4}),n({y:48,height:64}),n({y:128}),n({y:176}),n({y:224})];"tabs"===e&&(r=[n({fill:"white",width:358,height:305}),n({y:4,width:"50%",height:73}),n({x:"51%",y:4,height:73}),n({y:96,height:64}),n({y:178}),n({y:228}),n({y:276})]);var o={view:"tabs"===e?"0 0 358 305":"0 0 560 256",height:"tabs"===e?305:256};return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0 0 560 256",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:256;return'<svg id="'.concat(we,"-").concat(e,'" width="100%" height="').concat(o,'" viewBox="').concat(r,'" fill="none" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none">\n ').concat(t(n),'\n <animate xlink:href="#').concat(we,"-").concat(e,'" attributeName="opacity" values="0.5; 1; 0.5" begin="0s" dur="1s" repeatCount="indefinite"></animate>\n </svg>')}(r,o.view,o.height)}(null==n?void 0:n.type):t===te.desktop&&(r.innerHTML='<svg class="'.concat(we," ").concat(we,"-").concat(t,'" width="740" height="360" viewBox="0 0 740 360" fill="none" xmlns="">\n <rect width="740" height="360" rx="12" fill="#F6F6F6"/>\n <rect opacity="0.7" x="44" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="94" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="144" y="44" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M136 100H48C43.5817 100 40 103.582 40 108C40 112.418 43.5817 116 48 116H136C140.418 116 144 112.418 144 108C144 103.582 140.418 100 136 100Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 126H58C48.0589 126 40 134.059 40 144C40 153.941 48.0589 162 58 162H682C691.941 162 700 153.941 700 144C700 134.059 691.941 126 682 126Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M682 182H58C48.0589 182 40 190.059 40 200C40 209.941 48.0589 218 58 218H682C691.941 218 700 209.941 700 200C700 190.059 691.941 182 682 182Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M504 274H64C52.9543 274 44 282.954 44 294C44 305.046 52.9543 314 64 314H504C515.046 314 524 305.046 524 294C524 282.954 515.046 274 504 274Z" fill="#E1E6ED"/>\n </g>\n </svg>')),t===te.mobile&&(r.innerHTML='<svg class="'.concat(we," ").concat(we,"-").concat(t,'" width="358" height="186" viewBox="0 0 358 186" fill="none" xmlns="">\n <g clip-path="url(#clip0_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <g clip-path="url(#clip1_2543_91192)">\n <rect width="358" height="186" fill="white"/>\n <rect width="358" height="40" fill="white"/>\n <rect opacity="0.7" x="4" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="54" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <rect opacity="0.7" x="104" y="4" width="32" height="32" rx="4" fill="#E1E6ED"/>\n <g clip-path="url(#clip2_2543_91192)">\n <rect width="358" height="120" transform="translate(0 66)" fill="white"/>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M95 66H9C4.02944 66 0 70.0294 0 75C0 79.9706 4.02943 84 9 84H95C99.9706 84 104 79.9706 104 75C104 70.0294 99.9706 66 95 66Z" fill="#E1E6ED"/>\n </g>\n <g clip-path="url(#clip3_2543_91192)">\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 94H18C8.05888 94 0 102.059 0 112C0 121.941 8.05887 130 18 130H340C349.941 130 358 121.941 358 112C358 102.059 349.941 94 340 94Z" fill="#E1E6ED"/>\n </g>\n <g style="mix-blend-mode:multiply" opacity="0.336007">\n <path d="M340 150H18C8.05888 150 0 158.059 0 168C0 177.941 8.05887 186 18 186H340C349.941 186 358 177.941 358 168C358 158.059 349.941 150 340 150Z" fill="#E1E6ED"/>\n </g>\n </g>\n </g>\n </g>\n </g>\n <defs>\n <clipPath id="clip0_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip1_2543_91192">\n <rect width="358" height="186" fill="white"/>\n </clipPath>\n <clipPath id="clip2_2543_91192">\n <rect width="358" height="120" fill="white" transform="translate(0 66)"/>\n </clipPath>\n <clipPath id="clip3_2543_91192">\n <rect width="358" height="92" fill="white" transform="translate(0 94)"/>\n </clipPath>\n </defs>\n </svg>\n ')),e&&e.appendChild(r);var o=document.getElementById(Te);At(0,o)},lf=function(){function e(){g()(this,e),c()(this,"popupUrlQuery",void 0),c()(this,"popupApp",void 0)}var t;return f()(e,[{key:"setPopupUrlQuery",value:function(e){this.popupUrlQuery=e}},{key:"mergeUrlParams",value:function(e){var t=new URL(e),n=new URLSearchParams(this.popupUrlQuery.replace(/^(?:\?|%3F)/i,""));return t.searchParams.forEach((function(e,t){n.set(t,e)})),t.search=n.toString(),t.toString()}},{key:"popup",value:(t=s()(i()().mark((function e(t){var n,r,o,a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=5;break}throw(n=new Error).name="sdk_error_create_pop_up",n.message="Popup failed, input data is undefined",n;case 5:return r=t.url,e.prev=6,this.popupUrlQuery&&(r=this.mergeUrlParams(t.url)),a=!1,e.next=11,Fm({widthPadding:null==t?void 0:t.widthPadding,device:null==t?void 0:t.platform,url:r,styleConfig:{backgroundColor:null===(o=t.loadingConfig)||void 0===o?void 0:o.backgroundPrimary},loadingConfig:t.loadingConfig,showCloseOnLoading:t.showCloseOnLoading,onCloseOnLoading:t.onCloseOnLoading,textDirection:null==t?void 0:t.textDirection});case 11:this.popupApp=e.sent,s=setTimeout((function(){if(!a)throw{title:"sdk_error_create_pop_up"}}),Re),l=setTimeout((function(){if(!a)throw{title:"sdk_error_pop_up_time_out"}}),3e3),this.popupApp.onload=function(){a=!0,clearTimeout(s),clearTimeout(l)},e.next=22;break;case 17:throw e.prev=17,e.t0=e.catch(6),e.t0.name="sdk_error_create_pop_up",e.t0.url=r,e.t0;case 22:case"end":return e.stop()}}),e,this,[[6,17]])}))),function(e){return t.apply(this,arguments)})},{key:"pop",value:function(){Hm()}}]),e}(),cf=function(){function e(){g()(this,e),c()(this,"instanceId",void 0),c()(this,"sdkMetaData",void 0),c()(this,"initMessageEvent",void 0),c()(this,"clearTimerIdMapping",{}),c()(this,"popupManager",void 0),c()(this,"eventCenter",void 0),c()(this,"logService",void 0),c()(this,"displayInfo",void 0),c()(this,"webApp",void 0),c()(this,"_webAppHeartBeatTimeoutFn",void 0),c()(this,"clientHeight",void 0),c()(this,"boundFocusResizeChange",void 0),c()(this,"customizedLoadingListener",void 0)}return f()(e,[{key:"destroy",value:function(){}},{key:"init",value:function(e,t,n){var r;this.instanceId=t,this.sdkMetaData=n,this.clientHeight=Math.max(window.innerHeight,(null===(r=window)||void 0===r||null===(r=r.visualViewport)||void 0===r?void 0:r.height)||0),this.eventCenter=xf.getInstance(t).getService("EventCenter"),this.logService=xf.getInstance(t).getService("Log"),this.popupManager=new lf,Boolean(Object.keys(e).length)&&n.productScene===V.ELEMENT_PAYMENT||this.addCapabilityToEventCenter(),this.addCapabilityToApiBusManager(),this.boundFocusResizeChange=this.focusResizeChange.bind(this)}},{key:"update",value:function(){}},{key:"load",value:function(e,t,n){var r=e.appendAliasContainerId,o=e.selector,i=e.type,a=e.platform,s=function(e){var t=document.createElement("iframe"),n=e;return t.id=n,t.style.height="0",t.style.width="100%",t.style.border="0",t.style.opacity="0",t.style.overflow="hidden",t.style.colorScheme=Oe,t}("antom-sdk-web-app"+(e.appendAliasContainerId?"-".concat(o):""));Ct(null==e?void 0:e.iframeStyle)||Object.keys(null==e?void 0:e.iframeStyle).forEach((function(t){var n;s.style[t]=null==e||null===(n=e.iframeStyle)||void 0===n?void 0:n[t]})),this.webApp=s,this.displayInfo=e,s.src=t,s.allow="payment",this.eventCenter.addIFrame(s),s.src.includes("?")&&this.popupManager.setPopupUrlQuery(s.src.split("?")[1]);var l=i===F.inline?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ye;if(document.getElementById(Ce)||af(),!document.getElementById(t)){var n=document.createElement("div");n.className="".concat(t,"-inline"),n.id=t;var r=document.querySelector("".concat(e));return r&&r.appendChild(n),n}}(o,r?"".concat(ye,"-").concat(-1===(null==o?void 0:o.indexOf("#"))?o:o.slice(1)):""):Nm(a,n);return l.appendChild(s),l}},{key:"cleanContainer",value:function(e){var t,n=(null==e?void 0:e.type)===F.inline?e.selector:ye,r=document.querySelector(n);r&&(r.innerHTML="");var o=document.getElementById(ye);o&&(null==o||o.remove()),this.webApp=null,this.eventCenter.cleanIFrames(),null===(t=document.getElementById("".concat(ye,"-").concat(null==e?void 0:e.platform,"-animation-style")))||void 0===t||t.remove()}},{key:"showLoading",value:function(e,t){if(this.customizedLoadingListener)this.customizedLoadingListener("SDK_START_OF_LOADING");else if(t.type===F.inline)sf(e,t.platform);else{var n=document.getElementById(ke);n&&(n.style.display="block"),function(){var e=document.createElement("div");null==e||e.classList.add(Te),e.id=Te,e.innerHTML='<div class="line"><div></div><div></div><div></div><div></div></div>',e.style.fontSize="".concat(bt(),"px");var t=document.getElementsByTagName("body")[0];null==t||t.appendChild(e)}()}}},{key:"dismissLoading",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.customizedLoadingListener)this.customizedLoadingListener("SDK_END_OF_LOADING");else{var n=document.getElementById(ke);n&&(n.style.background="rgb(0, 0, 0, 0.6)",n.style.display=t?"block":"none"),null===(e=document.getElementById(Te))||void 0===e||e.remove()}}},{key:"customizeLoading",value:function(e){this.customizedLoadingListener=e}},{key:"startHideAnim",value:function(){var e,t=document.getElementById(ye);this.webApp&&(this.webApp.style.height=t.style.height),t&&null!==(e=this.displayInfo)&&void 0!==e&&e.platform&&(t.style.transition="",null==t||t.classList.remove("".concat(ye,"-").concat(this.displayInfo.platform)),null==t||t.classList.remove("".concat(ye,"-").concat(this.displayInfo.platform,"-animation")),null==t||t.classList.add("".concat(ye,"-hidden-").concat(this.displayInfo.platform)))}},{key:"handleAccountFocus",value:function(e){var t,n,r;(null===(t=window.visualViewport)||void 0===t||t.removeEventListener("resize",this.boundFocusResizeChange),null===(n=window)||void 0===n||n.removeEventListener("resize",this.boundFocusResizeChange),e)&&(null===(r=window.visualViewport)||void 0===r||r.addEventListener("resize",this.boundFocusResizeChange),window.addEventListener("resize",this.boundFocusResizeChange))}},{key:"addCapabilityToEventCenter",value:function(){var e=this;this.eventCenter.listen(ve.dismissLoading.name,(function(){e.dismissLoading()})),this.eventCenter.listen(ve.getUserAgentFromSdk.name,(function(t,n){var r;e.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(r=n.context)||void 0===r?void 0:r.eventCallbackId,data:{userAgent:window.navigator.userAgent}})})),this.eventCenter.listen(ve.popupWindow.name,(function(t){e.handlePopupWindow(t)})),this.eventCenter.listen(ve.popWindow.name,(function(){e.popupManager.pop()})),this.eventCenter.listen(ve.sizeChanged.name,(function(t){e.handleSizeChanged(h()({},t))})),this.eventCenter.listen(ve.showCloseButton.name,(function(t){e.handleCloseButtonTheme(t.style),e.changeCloseBtnVisibility(!0)})),this.eventCenter.listen(ve.hideCloseButton.name,(function(){e.changeCloseBtnVisibility(!1)})),this.eventCenter.listen(ve.setMaskCloseButton.name,(function(t){e.handleMaskCloseBtnShow(t)})),this.eventCenter.listen(ve.appHeartBeat.name,(function(){e.handleAppHeartBeat()})),this.eventCenter.listen(ve.canIUse.name,(function(t,n){e.handleCanIUse(t,n)})),this.eventCenter.listen(ve.inputFocus.name,(function(t){"ESP_V2"===t.source&&"account"===t.type?e.handleAccountFocus(t.focus):"ESP_V2"===t.source&&"otp"===t.type&&e.focusScrollFixed(t.focus)}))}},{key:"addCapabilityToApiBusManager",value:function(){}},{key:"updateMaskCloseBtn",value:function(e){var t=document.getElementById("".concat(Ae));if(t)if("desktop"===this.displayInfo.platform){var n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,r=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;t.style.top="".concat((n-e.height)/2-42,"px"),t.style.right="".concat((r-e.width)/2+18,"px")}else t.style.bottom="".concat(e.height+2,"px")}},{key:"handleSizeChanged",value:function(e){var t=this.displayInfo,n=t.appendAliasContainerId,r=t.selector,o=n?"".concat(ye,"-").concat(-1===(null==r?void 0:r.indexOf("#"))?r:r.slice(1)):ye;if(this.webApp&&this.displayInfo){var i=document.getElementById(o);if(i&&!((null==e?void 0:e.height)<=1)&&e.height!==parseInt(i.style.height)){if(i.style.height="".concat(e.height,"px"),this.webApp.style.opacity="1",this.displayInfo.type===F.popup){if("desktop"===this.displayInfo.platform&&(e.width&&(i.style.width="".concat(e.width,"px")),i.classList.add("".concat(o,"-").concat(this.displayInfo.platform,"-animation")),this.webApp.style.height="".concat(e.height,"px")),"mobile"===this.displayInfo.platform){i.classList.add("".concat(o,"-").concat(this.displayInfo.platform,"-animation"));var a="".concat(o,"-").concat(this.displayInfo.platform,"-animation-style"),s=document.getElementById(a);s&&(null==s||s.remove()),this.webApp.style.height=parseInt(this.webApp.style.height)>0?"100%":"".concat(e.height,"px"),function(e,t,n){var r="@keyframes ".concat(ye,"-slide-in {\n 0% {\n height: 1px;\n }\n 100% {\n height: ").concat(t,"px;\n }\n }\n @keyframes ").concat(ye,"-slide-out {\n 0% {\n height: ").concat(t,"px;\n opacity: 1;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n height: 1px;\n opacity: 0;\n }\n }"),o=document.createElement("style");o.id=n,o.type="text/css",o.innerHTML=r,document.getElementsByTagName("head")[0].appendChild(o),setTimeout((function(){e.style.transition="height 0.28s ease-in-out"}),500)}(i,e.height,a)}this.dismissLoading(),this.updateMaskCloseBtn(e)}var l;if(this.displayInfo.type===F.inline)null===(l=document.getElementById(Te))||void 0===l||l.remove(),this.webApp.style.height="".concat(e.height,"px")}}}},{key:"focusResizeChange",value:function(){var e,t=(null===(e=window)||void 0===e||null===(e=e.visualViewport)||void 0===e?void 0:e.height)||window.innerHeight;t*=.9,t*=.9,this.handleSizeChanged({width:0,height:t})}},{key:"focusScrollFixed",value:function(e){var t=this.displayInfo,n=t.appendAliasContainerId,r=t.selector,o=n?"".concat(ye,"-").concat(-1===(null==r?void 0:r.indexOf("#"))?r:r.slice(1)):ye;if(this.webApp&&this.displayInfo){var i=document.getElementById(o);i&&(e?(i.style.setProperty("position","fixed","important"),i.style.setProperty("top","".concat(this.clientHeight-i.clientHeight,"px"),"important")):(i.style.removeProperty("position"),i.style.removeProperty("top")))}}},{key:"handleAppHeartBeat",value:function(){var e=this;try{this._webAppHeartBeatTimeoutFn||(this._webAppHeartBeatTimeoutFn=function(){e.webApp&&e.displayInfo&&e.logService.logError({title:"sdk_error_appHeartBeatTimeout"})}),window._webAppHeartBeatTimeoutId&&(clearTimeout(window._webAppHeartBeatTimeoutId),window._webAppHeartBeatTimeoutId=null),this._webAppHeartBeatTimeoutFn&&(window._webAppHeartBeatTimeoutId=setTimeout(this._webAppHeartBeatTimeoutFn,6e3)),setTimeout((function(){e.webApp&&e.displayInfo&&e.eventCenter.dispatchToApp({event:"sdkHeartBeat",data:{}})}),1e3)}catch(e){this.logService.logError({title:"sdk_error_handleAppHeartBeat"},{errorMessage:e.message})}}},{key:"changeCloseBtnVisibility",value:function(e){var t=document.getElementById(be);e?null==t||t.classList.remove("".concat(be,"-hidden")):!1===e&&(null==t||t.classList.add("".concat(be,"-hidden")))}},{key:"handleMaskCloseBtnShow",value:function(e){var t=document.getElementById(Ae);"show"===(null==e?void 0:e.status)?null==t||t.classList.remove("".concat(Ae,"-hidden")):null==t||t.classList.add("".concat(Ae,"-hidden"))}},{key:"handleCloseButtonTheme",value:function(e){if(e){var t=document.getElementById(be),n=null==t?void 0:t.querySelector("img"),r=document.getElementById(Ae);"light"===e?(null==n||n.setAttribute("src","https://cdn.marmot-cloud.com/storage/2025/05/24/50891cd3-7a4a-47c0-b550-2e2ce6187c31.svg"),null==t||t.classList.add("".concat(be,"-light")),null==r||r.classList.add("".concat(Ae,"-light"))):(null==n||n.setAttribute("src",De),null==t||t.classList.remove("".concat(be,"-light")),null==r||r.classList.remove("".concat(Ae,"-light")))}}},{key:"handlePopupWindow",value:function(e){var t,n=this;e.paymentElementOldModel||(Bm(),this.popupManager.popup(h()({platform:null===(t=this.displayInfo)||void 0===t?void 0:t.platform,showCloseOnLoading:e.showCloseOnLoading,onCloseOnLoading:function(){return n.handlePopWindow(e)}},e)).then((function(){n.eventCenter.addIFrame(n.popupManager.popupApp)})).catch((function(e){n.logService.logError({title:(null==e?void 0:e.title)||"sdk_error_create_pop_up"},e),n.eventCenter.emit(ve.error.name,me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT)})))}},{key:"handlePopWindow",value:function(e){this.popupManager.pop(),this.eventCenter.dispatchToApp({event:ve.popWindow.name,data:e})}},{key:"handleCanIUse",value:function(e,t){var n,r=null==e?void 0:e.funcName;if(r&&"string"==typeof r){var o=this.eventCenter.isExist(r);this.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(n=t.context)||void 0===n?void 0:n.eventCallbackId,data:{exist:o,success:!0}})}else{var i;this.eventCenter.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(i=t.context)||void 0===i?void 0:i.eventCallbackId,data:{exist:!1,success:!1}})}}},{key:"getWebApp",value:function(){return this.webApp}}]),e}(),uf=function(){function e(){g()(this,e),c()(this,"instanceId",void 0),c()(this,"logs",void 0),c()(this,"config",void 0),c()(this,"debug",void 0),c()(this,"componentStartTime",void 0),c()(this,"isLoaded",void 0),c()(this,"trackId",void 0)}return f()(e,[{key:"init",value:function(e,t,n){this.logs=[],this.config=df,this.debug=![X.prod,X.sandbox].includes(null==e?void 0:e.environment),this.componentStartTime=0,this.isLoaded=!1;var r=Jt("AMSSDK_STORAGE_ID");r||Qt("AMSSDK_STORAGE_ID",r=t),this.setMetaData({instanceId:t,deviceId:r,sdkVersion:n.sdkVersion,webAppVersion:n.webAppVersion,productScene:n.productScene,trackId:t,platform:_t()?"PC":"WAP"}),this.initTracker(),this.setComponentStartTime(Date.now()),this.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==e?void 0:e.environment,"_").concat(null==e?void 0:e.locale)}).send()}},{key:"update",value:function(e){var t,n,r,o;this.setComponentStartTime(Date.now()),this.setMetaData({firstLogTime:this.componentStartTime,renderDisplayType:e.displayInfo.type,merchantId:e.paymentSessionObj.clientId,productScene:null===(t=e.paymentSessionObj.paymentSessionConfig)||void 0===t?void 0:t.productScene,productSceneVersion:null===(n=e.paymentSessionObj.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,paymentMethodType:null===(r=e.paymentSessionObj.paymentMethodInfoView)||void 0===r?void 0:r.paymentMethodType,paymentMethodCategoryType:null===(o=e.paymentSessionObj.paymentSessionConfig)||void 0===o?void 0:o.paymentMethodCategoryType,trackId:e.paymentSessionId})}},{key:"destroy",value:function(){}},{key:"setMetaData",value:function(e){var t,n,r=this;(this.config.mdata=Object.assign(this.config.mdata,e),null!==(t=window)&&void 0!==t&&t.iTracker)?(null===(n=window)||void 0===n||null===(n=n.iTracker)||void 0===n||n.set({mdata:this.config.mdata}),setTimeout((function(){r.reportLogs()}),80)):this.initTracker()}},{key:"getLogConfig",value:function(){return this.config}},{key:"logError",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this.log("error",e,t,n)}},{key:"logInfo",value:function(e,t){return this.log("info",e,t)}},{key:"log",value:function(e,t,n){var r=this,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=o?Ra.extractComplianceParams(t.title,null!=n?n:{},(function(e,t){r.logError(e,t,!1)})):null!=n?n:{},a=Date.now(),s=a-this.componentStartTime,l=h()({},t),c=null==t?void 0:t.title;return xa[c]&&(l.title=xa[c]),i.eventSource="sdk",i.eventAlias=null!=n&&n.eventAlias?null==n?void 0:n.eventAlias:c,this.logs.push({type:e,logPayload:l,extra:h()(h()({},i),{},{fsDuration:s,timeStamp:a})}),this.debug&&console.log("[web-sdk] Log",l,i),this.send(),this}},{key:"reportLogs",value:function(){var e;if(null!==(e=window)&&void 0!==e&&e.iTracker)for(var t=window.iTracker,n=t.logError,r=t.logInfo,o=t.reportRPC,i=this.logs;i.length>0;)try{var a,s=i.pop();if("error"===s.type)n(s.logPayload,h()({title:null===(a=s.logPayload)||void 0===a?void 0:a.title},null==s?void 0:s.extra));else if("info"===s.type){var l;r(s.logPayload,h()({title:null===(l=s.logPayload)||void 0===l?void 0:l.title},null==s?void 0:s.extra))}else if("rpc"===s.type){var c;o(s.logPayload,h()({title:null===(c=s.logPayload)||void 0===c?void 0:c.title},null==s?void 0:s.extra))}}catch(e){console.error("Error occurred while calling iTracker method:",e)}}},{key:"loadScript",value:function(e,t){var n=this;if("function"==typeof window.define&&window.define.amd&&"function"==typeof window.require){var r="antom_iTracker";try{var o,i;return null!==(o=(i=window.require).specified)&&void 0!==o&&o.call(i,r)||window.require.config({paths:c()({},r,e.replace(/\.js$/,""))}),void window.require([r],t,(function(r){console.error("AMD load failed, falling back to script tag",r),n.fallbackLoadScript(e,t)}))}catch(e){console.warn("require not available, using script tag",e)}}this.fallbackLoadScript(e,t)}},{key:"fallbackLoadScript",value:function(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t,n.onerror=function(){console.error("unable to load Antom script: ".concat(e))},document.body?document.body.appendChild(n):document.head&&document.head.appendChild(n)}},{key:"initTracker",value:function(){var e=this;if(!this.isLoaded){this.isLoaded=!0;try{"undefined"!=typeof localStorage&&this.loadScript(this.config.scriptUrl,(function(){var t;null===(t=window)||void 0===t||t.iTracker.initiTracker(e.config),setTimeout((function(){e.reportLogs()}),80)}))}catch(e){console.error("Failed to initialize iTracker:",e)}}}},{key:"send",value:function(){var e;null!==(e=window)&&void 0!==e&&e.iTracker?this.reportLogs():this.initTracker()}},{key:"setComponentStartTime",value:function(e){this.componentStartTime=e}},{key:"getComponentStartTime",value:function(){return this.componentStartTime}}]),e}(),df={scriptUrl:"https://gw-intl.alipayobjects.com/render/p/yuyan_npm/@alipay_intl-tracker/1.6.0/dist/common.min.js",spmConfig:{},batchCount:1,appId:"antom_sdk",server:"https://imdap-sea.alipay.com/loggw/dwcookieLogGet.do",bizType:"antom_sdk",productId:"ANTOM_SDK",version:"iteration/20231021",mdata:{firstLogTime:Date.now()}},pf=function(e){return new URL(e.src).origin},hf=function(){function e(){g()(this,e),c()(this,"events",void 0),c()(this,"iframes",void 0),c()(this,"instanceId",void 0),this.events=new Map,this.iframes=[]}return f()(e,[{key:"init",value:function(e,t,n){var r;this.instanceId=t,this.handleAppMessage=this.handleAppMessage.bind(this),window.addEventListener("message",this.handleAppMessage),(r=this).listen(ve.submitForm.name,(function(e){var t=e.attributes,n=document.body,r=document.createElement("form");r.setAttribute("height","1"),r.setAttribute("width","1"),Object.keys(t.data).forEach((function(e){var n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t.data[e]),r.appendChild(n)})),r.setAttribute("action",t.action),r.setAttribute("method","post"),n.appendChild(r),setTimeout((function(){r.submit()}),0)})),r.listen(ve.beforeSubmit.name,(function(e){if(r.isExist(ve.beforeSubmit.name))r.emit(ve.beforeSubmit.name,e);else{var t=He();r.dispatchToApp({event:ve.beforeSubmitDone.name,eventCallbackId:t,data:{result:"IGNORE"}})}})),r.listen(ve.sendBroadcast.name,(function(e){r.dispatchToApp({event:ve.receiveBroadcast.name,data:e})})),r.listen(ve.sendMuitiAppEventToSdk.name,(function(e){r.dispatchToApp({event:ve.receiveMuitiAppFromSdk.name,data:e})}))}},{key:"destroy",value:function(){var e;window.removeEventListener("message",this.handleAppMessage),this.iframes=[],(e=this).unlisten(ve.submitForm.name),e.unlisten(ve.beforeSubmit.name),e.unlisten(ve.sendBroadcast.name),e.unlisten(ve.sendMuitiAppEventToSdk.name)}},{key:"update",value:function(){}},{key:"addIFrame",value:function(e){this.iframes.push({ref:e,origin:pf(e)})}},{key:"cleanIFrames",value:function(){this.iframes=[]}},{key:"removeIFrame",value:function(e){var t=this.iframes.findIndex((function(t){return t.origin===pf(e)}));-1!==t&&this.iframes.splice(t,1)}},{key:"handleAppMessage",value:function(e){var t;if(this.iframes.some((function(t){return t.origin===e.origin}))&&(null===(t=e.data)||void 0===t||!t.source||!["react-devtools-content-script","react-devtools-backend-manager","react-devtools-bridge"].includes(e.data.source))){var n;if("object"===Je()(e.data)&&null!==e.data)n=e.data;else{if(!ct(e.data))return void console.error(me.NOT_JSON_FORMAT);n=JSON.parse(e.data)}this.checkEventCompliant(n)&&this._handleAppMessage(n)}}},{key:"checkEventCompliant",value:function(e){if(e.name!==ne.APP_TO_SDK)return!1;var t=this.iframes.map((function(e){var t;if(new URL(null===(t=e.ref)||void 0===t?void 0:t.src))return new URL(e.ref.src).searchParams.get("instanceId")})).filter(Boolean);return!(e.instanceId!==this.instanceId&&!t.includes(e.instanceId))}},{key:"_handleAppMessage",value:function(e){var t=e.context,n=t.event,r=t.data;this.emit(n,r,e)}},{key:"listen",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=n&&this.events.get(e)||[];r.push({func:t}),this.events.set(e,r)}},{key:"unlisten",value:function(e,t){if(t){if(this.events.has(e)){var n=this.events.get(e);n=n.filter((function(e){return e.func!==t})),this.events.set(e,n)}}else this.events.delete(e)}},{key:"emit",value:function(e,t,n){this.events.has(e)&&this.events.get(e).forEach((function(e){e.func(t,n)}))}},{key:"emitAndListen",value:function(e,t){e.eventCallbackId||(e.eventCallbackId=He()),this.listen(e.eventCallbackId,t),this.dispatchToApp(e)}},{key:"queryParse",value:function(e){var t={},n=e;return n||(n=window.location.href),n.replace(/([^?=&#]+)(=([^&#]*))?/g,(function(e,n,r,o){return void 0===o?"":(t[n]=decodeURIComponent(o),t[n])})),t}},{key:"dispatchToApp",value:function(e){var t,n=this,r={name:ne.SDK_TO_APP,context:e,instanceId:this.instanceId};null===(t=this.iframes)||void 0===t||t.forEach((function(e){var t;if(e.ref.contentWindow){var o=(n.queryParse(e.ref.src)||{}).instanceId;e.ref.contentWindow.postMessage(JSON.stringify(h()(h()({},r),{},{instanceId:o})),null!==(t=e.origin)&&void 0!==t?t:"*")}else console.error("get app contentWindow error",e)}))}},{key:"isExist",value:function(e){return this.events.has(e)}}]),e}(),mf=function(){function e(){g()(this,e),c()(this,"sandboxFlag",void 0),c()(this,"instanceId",void 0)}return f()(e,[{key:"init",value:function(e,t,n){var r=Et()._sandbox;this.sandboxFlag=r,this.instanceId=t}},{key:"request",value:function(){var e=s()(i()().mark((function e(t,n){var r,o,a,s,l,c,u,d,p,m,f,v,g,y,_,E;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getEnvInfo(n),o=[h()(h()({},t),{},{envInfo:r,extParams:h()(h()({},null==t?void 0:t.extParams),{},{refUrl:window.location.href})})],a=Date.now(),s="",e.prev=4,l=this.createRequestInstance(n),e.next=8,l({data:o});case 8:if(c=e.sent,u=c.data,d=c.headers,p=u||{},s=sa(d,"Mgw-TraceId")||sa(d,"mgw-traceid",""),p.traceId=s||"",null==(m=la(d,s))||!m.errorCode){e.next=20;break}throw f=(null==p?void 0:p.errorMessage)||(null==m?void 0:m.errorMessage),v=null==m?void 0:m.errorCode,this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-a,success:!1,code:v,errorMessage:f,traceId:s}),new Error(JSON.stringify({errorMessage:f,errorCode:v,success:!1}));case 20:return this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-a,success:!0,code:"SUCCESS",errorMessage:"",traceId:s}),e.abrupt("return",p);case 24:return e.prev=24,e.t0=e.catch(4),y=yt(null===e.t0||void 0===e.t0?void 0:e.t0.message,{success:!1,errorCode:oe.SYSTEM,traceId:s,errorMessage:null===e.t0||void 0===e.t0?void 0:e.t0.message}),_=null!==e.t0&&void 0!==e.t0&&null!==(g=e.t0.message)&&void 0!==g&&g.includes("timeout")?oe.TIMEOUT:"",E=_||(null==y?void 0:y.errorCode),this.reportRequestTimeCost({title:"a3753.b101271.c388193.d521387",name:null==n?void 0:n["Operation-Type"],label:"request",time:Date.now()-a,success:!1,code:E,errorMessage:JSON.stringify((null==y?void 0:y.errorMessage)||e.t0)}),e.abrupt("return",Promise.reject({success:!1,errorCode:E,traceId:s,stack:null===e.t0||void 0===e.t0?void 0:e.t0.stack,errorMessage:null==y?void 0:y.errorMessage}));case 31:case"end":return e.stop()}}),e,this,[[4,24]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getEnvInfo",value:function(e){var t,n=h()(h()({terminalType:gt?"WAP":"WEB",browserInfo:{browserJavaScriptEnabled:!0,browserLanguage:navigator.language,browserUserAgent:navigator.userAgent,browserColorDepth:screen.colorDepth},deviceLanguage:navigator.language,screenWidth:screen.width,screenHeight:screen.height,timeZoneOffset:(new Date).getTimezoneOffset()},null==e?void 0:e.envInfo),{},{locale:(null==e||null===(t=e.envInfo)||void 0===t?void 0:t.locale)||"en_US"});try{var r;n.browserInfo.browserJavaEnabled=(null===(r=navigator)||void 0===r?void 0:r.javaEnabled())||!1}catch(e){}return"WAP"===n.terminalType&&(n.osType=ft?"IOS":"ANDROID"),n}},{key:"reportRequestTimeCost",value:function(e,t){xf.getInstance(this.instanceId).getService("Log").log("rpc",e,t)}},{key:"update",value:function(e){}},{key:"destroy",value:function(){}},{key:"createRequestInstance",value:function(e){var t,n,r=new Date,o=r.getTime()+60*r.getTimezoneOffset()*1e3,i=e.env||"prod",a=$i(e["Operation-Type"],i),s=e.baseURL||a.baseURL||Xi(null==e?void 0:e.hostSign,i)||qi[i],l=h()(c()(c()(c()(c()(c()(c()(c()({appId:a.appId||Qi,workspaceId:"pre"===e.env?"pre":"default"},"x-cors-".concat(Qi.toLowerCase(),"-default"),"1"),"version","2.0"),"sofa-group-name",a.sofaId||Zi),"Operation-Type",a["Operation-Type"]||e["Operation-Type"]||""),"Client-Time",o),"tntInstId",Ji),"sdk-version",T||""),e.headers);return"true"!==this.sandboxFlag&&"sandbox"!==i||(l["load-test"]=!0,l.sofaPenAttrs="instMock=O&loadMode=2"),"dev"!==i&&delete l["sofa-group-name"],ji.create({baseURL:s,timeout:null!==(t=e.timeout)&&void 0!==t?t:15e3,headers:l,withCredentials:null===(n=e.withCredentials)||void 0===n||n,method:(null==e?void 0:e.method)||"POST"}).request}}]),e}(),ff=function(e){return e.SG="SG",e.US="US",e.DE="DE",e}({}),vf={SG:"https://open-sea-global.alipay.com/api/open/risk_client",US:"https://open-na-global.alipay.com/api/open/risk_client",DE:"https://open-de-global.alipay.com/api/open/risk_client"},gf=c()(c()(c()(c()(c()(c()(c()(c()({},V.CASHIER_PAYMENT,"Acquirer"),V.AUTO_DEBIT,"Acquirer"),V.VAULTING,"Acquirer"),V.CARD_APPLE_PAY,"Acquirer"),"EASYPAY","EasyPay"),V.EASY_PAY,"EasyPay"),V.FLASH_BUY,"OneAccount"),V.ELEMENT_PAYMENT,"Acquirer"),yf=function(e){return gf[e]||""},_f=function(e){if(!e)return"production";var t=e.toLowerCase();return"pre"===t||"light_sandbox"===t?"pre":"dev"===t||"test"===t||"local"===t?"dev":"production"},Ef=function(){function e(t){g()(this,e),c()(this,"scene",void 0),c()(this,"h5gateway",void 0),c()(this,"environment",void 0),c()(this,"apdidLoaded",!1),c()(this,"apdidLoadFailed",!1),this.scene=t.scene,this.h5gateway=t.h5gateway||vf[ff.SG],this.environment=t.environment}var t,n,r;return f()(e,[{key:"ensureApdidLoaded",value:(r=s()(i()().mark((function e(){var t,n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.apdidLoaded){e.next=2;break}return e.abrupt("return",!0);case 2:if(!this.apdidLoadFailed){e.next=4;break}return e.abrupt("return",!1);case 4:return t=un.getInstance(),n=_f(this.environment),e.prev=6,e.next=9,t.load({environment:n,callbacks:{onLoad:function(e){console.log("[Security] apdid-core script loaded in ".concat(e,"ms"))},onLoadFailed:function(e){console.error("[Security] apdid-core script load failed:",e.message)},onLoadTimeout:function(){console.error("[Security] apdid-core script load timeout")}}});case 9:return this.apdidLoaded=!0,e.abrupt("return",!0);case 13:return e.prev=13,e.t0=e.catch(6),console.error("[Security] apdid-core load error, degrading:",e.t0),this.apdidLoadFailed=!0,e.abrupt("return",!1);case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(){return r.apply(this,arguments)})},{key:"getAPDIDModule",value:function(){return un.getInstance().getApdidModule()}},{key:"initSecurity",value:function(e,t){var n=this;if(!this.scene)throw new Error("securityConfig parameter error");if(!Object.values(gf).includes(this.scene)||!Object.values(vf).includes(this.h5gateway)){var r="scene:".concat(this.scene," or h5gateway:").concat(this.h5gateway," do not supported");throw console.error(r),new Error(r)}this.ensureApdidLoaded().then((function(r){r?n.initToken(e,t):t&&t("apdid-core script load failed")})).catch((function(){t&&t("apdid-core script load failed")}))}},{key:"initToken",value:function(e,t){try{var n=this.getAPDIDModule();null==n||n.initToken(this.scene,{host:this.h5gateway},(function(n,r,o){n?e&&e():t&&t(o)}))}catch(e){t&&t(null==e?void 0:e.toString())}}},{key:"pollingGetApdidToken",value:(n=s()(i()().mark((function e(t){var n,r,o,a=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=parseInt((null==t?void 0:t.tokenCollectTime)||"0",10),r=parseInt((null==t?void 0:t.dataPollingInterval)||"500",10),o=function(){var e=s()(i()().mark((function e(t){var o,l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:if(!(o=e.sent)){e.next=5;break}return e.abrupt("return",t(o));case 5:c=function(){var e=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.getApdidToken();case 2:(o=e.sent)&&(clearInterval(l),t(o));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),l=setInterval(c,r),setTimeout((function(){clearInterval(l),t(o)}),n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",new Promise((function(e){o(e)})));case 4:case"end":return e.stop()}}),e)}))),function(e){return n.apply(this,arguments)})},{key:"getApdidToken",value:(t=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.ensureApdidLoaded();case 2:if(e.sent){e.next=5;break}return e.abrupt("return","");case 5:return e.abrupt("return",new Promise((function(e){try{var n=t.getAPDIDModule();null==n||n.getApdidToken(t.scene,(function(t){e(null==t?void 0:t.token)}))}catch(t){e("")}})));case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}(),bf=function(){function e(){g()(this,e),c()(this,"logger",void 0),c()(this,"productScene",V.EASY_PAY),c()(this,"environment",void 0)}var t,n,r,o,a;return f()(e,[{key:"init",value:function(e,t,n){this.logger=xf.getInstance(t).getService("Log"),this.productScene=n.productScene,this.environment=null==e?void 0:e.environment}},{key:"update",value:function(e){}},{key:"destroy",value:function(){}},{key:"getDeviceId",value:(a=s()(i()().mark((function e(){var t,n,r=this,o=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:{},n=o.length>1&&void 0!==o[1]&&o[1],e.abrupt("return",new Promise((function(e){setTimeout(s()(i()().mark((function o(){var a,s,l,c;return i()().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return a=Date.now(),s=(null==t?void 0:t.productScene)||r.productScene,o.next=4,r._getSecuritySDKByProductScene({product:s});case 4:if(l=o.sent,c="",!l){o.next=18;break}if(!(n&&parseInt(null==t?void 0:t.tokenCollectTime)>0)){o.next=13;break}return o.next=10,l.pollingGetApdidToken(t);case 10:o.t0=o.sent,o.next=16;break;case 13:return o.next=15,l.getApdidToken();case 15:o.t0=o.sent;case 16:c=o.t0,r.logDeviceId(c,a);case 18:e(c);case 19:case"end":return o.stop()}}),o)}))),0)})));case 3:case"end":return e.stop()}}),e)}))),function(){return a.apply(this,arguments)})},{key:"preInitSecurity",value:(o=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._initSecurity(!0,t);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"initSecurity",value:(r=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._initSecurity(!1,t);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"_initSecurity",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l=this,c=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=c.length>0&&void 0!==c[0]&&c[0],n=c.length>1?c[1]:void 0,r=t?"PreInit":"Init",o=this._getSceneByProduct(this.productScene),!En.isReady(o)){e.next=6;break}return e.abrupt("return",Promise.resolve());case 6:if(!En.isLoading(o)){e.next=19;break}if(!(a=En.get(o))||"loading"!==a.status){e.next=19;break}return e.prev=9,e.next=12,a.loadingPromise;case 12:this.logger.logInfo({title:"sdk_event_securitySdk".concat(r,"Success")}).send(),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(9),this.logger.logError({title:"sdk_error_securitySdkInitFailed"},{productScene:this.productScene,sign:t?"Active initialization":"SDK internal initialization"}).send();case 18:return e.abrupt("return");case 19:return this.logger.logInfo({title:"sdk_event_securitySdk".concat(r)}),s=_f(this.environment),un.getInstance().scheduleLoad({environment:s,callbacks:{onLoad:function(e){l.logger.logInfo({title:"sdk_event_securitySdkScriptLoaded"},{eventMessage:"".concat(e)}).send()},onLoadFailed:function(e){l.logger.logError({title:"sdk_event_securitySdkLoadFailed",msg:e.message},{productScene:l.productScene}).send()},onLoadTimeout:function(){l.logger.logError({title:"sdk_event_securitySdkScriptLoadTimeout"},{productScene:l.productScene}).send()}}}),e.abrupt("return",new Promise((function(e,o){n&&setTimeout((function(){l.logger.logError({title:"sdk_error_securitySdkInitTimeout"},{productScene:l.productScene,eventMessage:t?"Active initialization":"SDK internal initialization"}).send(),o()}),n),l._newSecuritySDKByScene({product:l.productScene,region:t?ff.SG:void 0},(function(){l.logger.logInfo({title:"sdk_event_securitySdk".concat(r,"Success")},t?{productScene:l.productScene}:void 0).send(),e()}),(function(e){l.logger.logError({title:"sdk_error_securitySdkInitFailed",msg:e||void 0},{productScene:l.productScene,sign:t?"Active initialization":"SDK internal initialization"}).send(),o()}))})));case 24:case"end":return e.stop()}}),e,this,[[9,15]])}))),function(){return n.apply(this,arguments)})},{key:"logDeviceId",value:function(e,t){var n="".concat(Date.now()-t);e?this.logger.logInfo({title:"sdk_event_securitySdkGetTokenSuccess"},{eventMessage:n}).send():this.logger.logInfo({title:"sdk_error_securitySdkGetTokenFailed"},{eventMessage:n}).send()}},{key:"_getSceneByProduct",value:function(e){return this._getSecurityConfigStorage(e).scene||yf(e)}},{key:"_getSecuritySDKByProductScene",value:(t=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this._getSceneByProduct(t.product),e.abrupt("return",En.getInstance(n));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"_newSecuritySDKByScene",value:function(e,t,n){var r,o=this._getSecurityConfigStorage(e.product),i=o.scene||yf(e.product),a=o.h5gateway||(r=e.region,vf[r]||vf[ff.SG]),s=En.get(i);if(!s||"ready"!==s.status&&"loading"!==s.status)try{var l=new Ef({scene:i,h5gateway:a,environment:this.environment}),c=new Promise((function(e,r){l.initSecurity((function(){En.setReady(i,l),t&&t(),e(l)}),(function(e){En.setFailed(i,new Error(e||"Security init failed")),n&&n(e),r(new Error(e||"Security init failed"))}))}));En.setLoading(i,c)}catch(e){En.setFailed(i,new Error(null==e?void 0:e.toString())),n&&n(null==e?void 0:e.toString())}else"ready"===s.status&&t&&t()}},{key:"_getSecurityConfigStorage",value:function(e){var t="",n="",r=kt(function(e){return"AMSSDK_SECURITY_CONFIG_".concat(e)}(e));if(r){var o=yt(r,{});t=null==o?void 0:o.appName,n=null==o?void 0:o.h5gateway}return{scene:t,h5gateway:n}}}]),e}(),Af=function(e){return e.sdk_event_busPublishMessage="sdk_event_busPublishMessage",e.sdk_event_busPublishCallback="sdk_event_busPublishCallback",e.sdk_event_busIsSubscribe="sdk_event_busIsSubscribe",e.sdk_event_busSubscribe="sdk_event_busSubscribe",e.sdk_event_busUnsubscribe="sdk_event_busUnsubscribe",e.sdk_event_busClear="sdk_event_busClear",e.sdk_event_busAddInterceptor="sdk_event_busAddInterceptor",e.sdk_error_busPublishUnsubscribeError="sdk_error_busPublishUnsubscribeError",e.sdk_error_busPublishError="sdk_error_busPublishError",e.sdk_error_busPublishNoResult="sdk_error_busPublishNoResult",e}({}),Sf=function(){function e(t){g()(this,e),c()(this,"callback",void 0),this.callback=t}return f()(e,[{key:"onCallBack",value:function(e){this.callback&&this.callback(e)}}]),e}(),kf=f()((function e(){g()(this,e)})),Tf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;g()(this,e),c()(this,"isDebug",!0),c()(this,"instanceId",void 0),c()(this,"logger",void 0),this.instanceId=t,this.logger=xf.getInstance(this.instanceId).getService("Log")}return f()(e,[{key:"debugTrace",value:function(e){this.isDebug=e}},{key:"traceLog",value:function(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.isDebug&&console.log([e.TAG,t].concat(JSON.stringify(n)).join(e._logSplit)),r&&this.logger&&this.logger.logInfo({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"traceError",value:function(t,n){this.isDebug&&console.error([e.TAG,t].concat(JSON.stringify(n)).join(e._logSplit)),this.logger&&this.logger.logError({title:t},h()({eventSource:"sdk"},n)).send()}},{key:"clear",value:function(){this.traceLog(Af.sdk_event_busClear),e.interceptors.length=0,e.subscribersMap.clear()}},{key:"addInterceptor",value:function(t){this.traceLog(Af.sdk_event_busAddInterceptor),e.interceptors.includes(t)||e.interceptors.push(t)}},{key:"publishForResult",value:function(e,t){var n=this,r=!0;return new Promise((function(o,i){var a;n.publish(e,(function(e){r=!1,o(e)})),setTimeout((function(){r&&(n.traceError(Af.sdk_error_busPublishNoResult,{actionName:e.getAction()}),null!==(null==t?void 0:t.fallback)?o(e.result(null==t?void 0:t.fallback)):i("publish timeout"))}),null!==(a=null==t?void 0:t.timeoutMs)&&void 0!==a?a:2e3)}))}},{key:"publish",value:function(t,n){var r=this,o=new Sf((function(e){r.traceLog(Af.sdk_event_busPublishCallback,{actionName:t.getAction(),instanceId:r.instanceId}),n&&n(e)})),i=this.instanceId?e.getInstanceActionName(t.getAction(),this.instanceId):t.getAction(),a=e.subscribersMap.get(i);if(this.traceLog(Af.sdk_event_busPublishMessage,{actionName:t.getAction(),instanceId:this.instanceId}),!a&&this.instanceId&&(a=e.subscribersMap.get(t.getAction())),a){var s,l=d()(a);try{for(l.s();!(s=l.n()).done;){var c=s.value;try{c.onMessage(o,t)}catch(n){this.traceError(Af.sdk_error_busPublishError,{actionName:t.getAction(),instanceId:this.instanceId,errorMessage:n});var u,p=d()(e.interceptors);try{for(p.s();!(u=p.n()).done;){var h=u.value;null==h||h.onPublishException(t,n)}}catch(e){p.e(e)}finally{p.f()}}}}catch(e){l.e(e)}finally{l.f()}}else{var m,f=!1,v=d()(e.interceptors);try{for(v.s();!(m=v.n()).done;){var g=m.value;f=f||(null==g?void 0:g.onUnsubscribedAction(t.getAction()))}}catch(e){v.e(e)}finally{v.f()}f?this.publish(t,n):this.traceError(Af.sdk_error_busPublishUnsubscribeError,{actionName:t.getAction(),instanceId:this.instanceId})}}},{key:"subscribe",value:function(t){this.traceLog(Af.sdk_event_busSubscribe,{actionNames:t.actionNames(),instanceId:this.instanceId});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.instanceId?e.getInstanceActionName(o,this.instanceId):o;e.subscribersMap.has(i)||e.subscribersMap.set(i,[]);var a=e.subscribersMap.get(i);a&&!a.includes(t)&&a.push(t)}}catch(e){r.e(e)}finally{r.f()}}},{key:"unsubscribe",value:function(t){this.traceLog(Af.sdk_event_busUnsubscribe,{actionNames:t.actionNames(),instanceId:this.instanceId});var n,r=d()(t.actionNames());try{for(r.s();!(n=r.n()).done;){var o=n.value,i=this.instanceId?e.getInstanceActionName(o,this.instanceId):o,a=e.subscribersMap.get(i);if(a){var s=a.indexOf(t);-1!==s&&a.splice(s,1),0===a.length&&e.subscribersMap.delete(i)}}}catch(e){r.e(e)}finally{r.f()}}},{key:"isSubscribed",value:function(t){var n=this.instanceId?e.getInstanceActionName(t,this.instanceId):t,r=e.subscribersMap.get(n);if(!r&&this.instanceId&&(r=e.subscribersMap.get(t)),r&&r.length>0)return this.traceLog(Af.sdk_event_busIsSubscribe,{actionName:t,instanceId:this.instanceId,processResult:!0}),!0;var o,i=!1,a=d()(e.interceptors);try{for(a.s();!(o=a.n()).done;){var s=o.value;i=i||s.onUnsubscribedAction(t)}}catch(e){a.e(e)}finally{a.f()}return i?e.subscribersMap.has(n):(this.traceLog(Af.sdk_event_busIsSubscribe,{actionName:t,instanceId:this.instanceId,processResult:!1}),!1)}}],[{key:"getInstanceActionName",value:function(e,t){return"".concat(e,"@").concat(t)}}]),e}();c()(Tf,"interceptors",[]),c()(Tf,"subscribersMap",new Map),c()(Tf,"TAG","BusManager"),c()(Tf,"_logSplit"," , ");var Pf=function(e){return e.request="request",e.getEnvInfo="getEnvInfo",e.getUserAgent="getUserAgent",e}({}),If=function(e){return e.getGlobalData="getGlobalData",e.setGlobalData="setGlobalData",e.clearGlobalData="clearGlobalData",e}({}),Cf=function(e){return e.preInitSecurity="preInitSecurity",e.initSecurity="initSecurity",e.getSecurityDeviceId="getSecurityDeviceId",e}({}),wf=function(e){return e.reportAnalytics="reportAnalytics",e}({});Pf=function(e){return e.onDestory="httpRequest",e}(Pf||{});var Nf=function(e){_()(r,e);var t,n=b()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Ze()(t),"instanceId",void 0),c()(Ze()(t),"logger",void 0),t.instanceId=e,t.logger=xf.getInstance(t.instanceId).getService("Log"),t}return f()(r,[{key:"actionNames",value:function(){return Object.values(wf)}},{key:"reportAnalytics",value:(t=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("reportAnalytics",n),r=n.getJSONObject(),this.logger&&null!=r&&r.basic&&("error"===(null==r?void 0:r.level)?this.logger.logError(null==r?void 0:r.basic,null==r?void 0:r.extra):this.logger.logInfo(null==r?void 0:r.basic,null==r?void 0:r.extra));case 3:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){if(t.getAction()===wf.reportAnalytics)this.reportAnalytics(e,t);else console.log("Unknown action: "+t.getAction())}}]),r}(kf),Of=function(e){_()(a,e);var t,n,r,o=b()(a);function a(e){var t;return g()(this,a),t=o.call(this),c()(Ze()(t),"instanceId",void 0),t.instanceId=e,t}return f()(a,[{key:"actionNames",value:function(){return Object.values(Cf)}},{key:"preInitSecurity",value:(r=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=xf.getInstance(this.instanceId).getService("Security"),e.next=4,r.preInitSecurity();case 4:null==t||t.onCallBack(n.result(!0)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),null==t||t.onCallBack(n.result(!1));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return r.apply(this,arguments)})},{key:"initSecurity",value:(n=s()(i()().mark((function e(t,n){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,r=xf.getInstance(this.instanceId).getService("Security"),e.next=4,r.initSecurity();case 4:null==t||t.onCallBack(n.result(!0)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),null==t||t.onCallBack(n.result(!1));case 10:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(e,t){return n.apply(this,arguments)})},{key:"getSecurityDeviceId",value:(t=s()(i()().mark((function e(t,n){var r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=xf.getInstance(this.instanceId).getService("Security"),!r||null==r||!r.deviceIdParameter){e.next=10;break}return e.next=6,o.getDeviceId(null==r?void 0:r.deviceIdParameter,!0===(null==r?void 0:r.isPolling));case 6:a=e.sent,null==t||t.onCallBack(n.result(null!=a?a:"")),e.next=11;break;case 10:null==t||t.onCallBack(n.result(""));case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),null==t||t.onCallBack(n.result(""));case 16:case"end":return e.stop()}}),e,this,[[1,13]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Cf.preInitSecurity:this.preInitSecurity(e,t);case Cf.initSecurity:this.initSecurity(e,t);case Cf.getSecurityDeviceId:this.getSecurityDeviceId(e,t)}}}]),a}(kf),Rf=function(e){_()(n,e);var t=b()(n);function n(e){var r;return g()(this,n),r=t.call(this),c()(Ze()(r),"instanceId",void 0),r.instanceId=e,r}return f()(n,[{key:"actionNames",value:function(){return Object.values(If)}},{key:"getGlobalData",value:function(e,t){var n=t.getJSONObject();if(console.log("getGlobalData",t),n&&null!=n&&n.dataKey){var r=xf.getInstance(this.instanceId).getService("GlobalData").getGlobalData(n.dataKey);null==e||e.onCallBack(t.result(r))}else{var o=Error("GetGlobalData Failed: Data Key is null");null==e||e.onCallBack(t.result(o))}}},{key:"setGlobalData",value:function(e,t){var n=t.getJSONObject();if(console.log("getGlobalData",t),n&&null!=n&&n.dataKey&&null!=n&&n.data){xf.getInstance(this.instanceId).getService("GlobalData").setGlobalData(n.dataKey,n.data),null==e||e.onCallBack(t.result(!0))}else{var r=Error("SetGlobalData Failed: Data Key or Data is null");null==e||e.onCallBack(t.result(r))}}},{key:"clearGlobalData",value:function(e,t){console.log("clearGlobalData",t),xf.getInstance(this.instanceId).getService("GlobalData").clearGlobalData(),null==e||e.onCallBack(t.result(!0))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case If.getGlobalData:this.getGlobalData(e,t);break;case If.setGlobalData:this.setGlobalData(e,t);break;case If.clearGlobalData:this.clearGlobalData(e,t);break;default:console.log("Unknown action: "+t.getAction())}}}]),n}(kf),Mf=function(e){_()(r,e);var t,n=b()(r);function r(e){var t;return g()(this,r),t=n.call(this),c()(Ze()(t),"instanceId",void 0),t.instanceId=e,t}return f()(r,[{key:"actionNames",value:function(){return Object.values(Pf)}},{key:"request",value:function(){var e=s()(i()().mark((function e(t,n){var r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=xf.getInstance(this.instanceId).getService("Requester"),!r||null==r||!r.options){e.next=10;break}return e.next=6,o.request(r.requestData,r.options);case 6:a=e.sent,null==t||t.onCallBack(n.result(a)),e.next=12;break;case 10:s=Error("Request Failed: No Request Options"),null==t||t.onCallBack(n.result(s));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),null==t||t.onCallBack(n.result(e.t0));case 17:case"end":return e.stop()}}),e,this,[[1,14]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getEnvInfo",value:(t=s()(i()().mark((function e(t,n){var r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.getJSONObject(),e.prev=1,o=xf.getInstance(this.instanceId).getService("Requester"),!r||null==r||!r.options){e.next=10;break}return e.next=6,o.getEnvInfo(r.options);case 6:a=e.sent,null==t||t.onCallBack(n.result(a)),e.next=12;break;case 10:s=Error("GetEnvInfo Failed: No Request Options"),null==t||t.onCallBack(n.result(s));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),null==t||t.onCallBack(n.result(e.t0));case 17:case"end":return e.stop()}}),e,this,[[1,14]])}))),function(e,n){return t.apply(this,arguments)})},{key:"getUserAgent",value:function(e,t){var n=window.navigator.userAgent;null==e||e.onCallBack(t.result(n))}},{key:"onMessage",value:function(e,t){switch(t.getAction()){case Pf.request:this.request(e,t);break;case Pf.getEnvInfo:this.getEnvInfo(e,t);break;case Pf.getUserAgent:this.getUserAgent(e,t)}}}]),r}(kf),Df=function(){function e(){g()(this,e),c()(this,"logger",void 0),c()(this,"instanceId",void 0),c()(this,"busManager",void 0)}return f()(e,[{key:"init",value:function(e,t){var n=this;this.instanceId=t,this.logger=xf.getInstance(this.instanceId).getService("Log"),this.busManager=new Tf(this.instanceId),this.busManager.debugTrace((null==e?void 0:e.environment)!==X.prod),this.busManager.clear(),this.busManager.addInterceptor({onPublishException:function(e,t){n.logger.logError({title:"onBusPublishException"},h()(h()({},e),{},{errorMessage:JSON.stringify(t)}))}}),this.busManager.subscribe(new Of(this.instanceId)),this.busManager.subscribe(new Nf(this.instanceId)),this.busManager.subscribe(new Rf(this.instanceId)),this.busManager.subscribe(new Mf(this.instanceId))}},{key:"subscribe",value:function(e){this.busManager.subscribe(e)}},{key:"unsubscribe",value:function(e){this.busManager.unsubscribe(e)}},{key:"isSubscribed",value:function(e){return this.busManager.isSubscribed(e)}},{key:"publish",value:function(e,t){this.busManager.publish(e,t)}},{key:"update",value:function(){}},{key:"destroy",value:function(){}}]),e}(),Lf=function(){function e(){g()(this,e),c()(this,"globalData",new Map)}return f()(e,[{key:"init",value:function(e,t){var n=this,r=xf.getInstance(t).getService("EventCenter");r.listen(ve.getGlobalData.name,(function(e,t){var o,i,a,s;if(null!==(o=t.context)&&void 0!==o&&o.eventCallbackId&&null!==(i=t.context)&&void 0!==i&&null!==(i=i.data)&&void 0!==i&&i.dataKey){var l=n.globalData.get(null===(a=t.context)||void 0===a||null===(a=a.data)||void 0===a?void 0:a.dataKey);r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(s=t.context)||void 0===s?void 0:s.eventCallbackId,data:l})}})),r.listen(ve.setGlobalData.name,(function(e){null!=e&&e.dataKey&&null!=e&&e.data&&n.globalData.set(e.dataKey,e.data)}))}},{key:"destroy",value:function(){this.globalData.clear()}},{key:"update",value:function(){}},{key:"getGlobalData",value:function(e){return this.globalData.get(e)}},{key:"setGlobalData",value:function(e,t){this.globalData.set(e,t)}},{key:"clearGlobalData",value:function(){this.globalData=new Map}}]),e}(),xf=function(){function e(t){g()(this,e),c()(this,"instanceId",void 0),c()(this,"services",{Log:new uf,ApiBusManager:new Df,Requester:new mf,Container:new cf,Security:new bf,EventCenter:new hf,GlobalData:new Lf}),c()(this,"extendServices",{}),this.instanceId=t}return f()(e,[{key:"init",value:function(e,t){this.services.Log.init(e,this.instanceId,t),this.services.ApiBusManager.init(e,this.instanceId,t),this.services.Requester.init(e,this.instanceId,t),this.services.Container.init(e,this.instanceId,t),this.services.Security.init(e,this.instanceId,t),this.services.EventCenter.init(e,this.instanceId,t),this.services.GlobalData.init(e,this.instanceId,t)}},{key:"update",value:function(e){for(var t in this.services)this.services[t].update(e);for(var n in this.extendServices)this.extendServices[n].update(e)}},{key:"getService",value:function(e){return this.extendServices[e]?this.extendServices[e]:this.services[e]}},{key:"registerService",value:function(e,t){this.extendServices[e]=t}}],[{key:"getInstance",value:function(t){return e.ProvidersMapping[t]||(e.ProvidersMapping[t]=new e(t)),e.ProvidersMapping[t]}}]),e}();c()(xf,"ProvidersMapping",{});var Uf={notSupportRetryPayForSameSession:!1,accountInfo:{accountStatus:"EFFECTIVE",email:"test10@test.com"},amountConfirmRequired:!1,autoDebitWithToken:!1,errorActions:{},extendInfo:{},links:{privacyLink:"https://render.alipay.com/p/c/180021490000000150/index.html?agreementId=GL00100002",cookieLink:"https://render.alipay.com/p/c/180021490000000147/index.html?agreementId=GL00100001"},needInstallmentAbility:!1,needOtherElements:!0,openPopPaymentRetryAbility:"Y",orderAmount:{amount:"289.86",currency:"USD",currencyLabel:"US $",formattedAmount:"289.86",formattedAmountWithCurrency:"US $289.86",value:"28986"},orderAmountView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"289.86",value:"289.86"},paymentAmount:{amount:"289.86",currency:"USD",currencyLabel:"US $",formattedAmount:"289.86",formattedAmountWithCurrency:"US $289.86",value:"28986"},paymentAmountView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"289.86",value:"289.86"},paymentMethods:[{antomPage:"paymentMetaPage",category:"CARD",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/07/15/c77c0d3d-a3d0-48ad-8a40-cb3e777a2608.svg",iconName:"Card",links:[],logoList:[{cardBrand:"VISA",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/7/2/fb4ab30f-8f49-4632-8bb1-fd64b2f21861.svg"},{cardBrand:"MASTERCARD",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/05/15/e9fc0f9a-14cb-4c32-9039-a746afa1a815.svg"},{cardBrand:"CARTEBANCAIRE",logoUrl:"https://cdn.marmot-cloud.com/storage/2024/2/23/dc4e43c8-0de1-421b-92b2-3c85f5f5a209.svg"}],paymentElements:[{defaultValue:"",elementMandatory:!1,elementType:"DIGIT_32",extendInfo:'{"needOtherElements":true,"isTempTokenization":"true"}',paymentElementKey:"paymentMethodId",subPaymentElementView:[{defaultText:"Card number",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{14,19}$",elementType:"DIGIT_18",extendInfo:'{"completeKey":"cc-number"}',paramIllegalText:"Enter a valid 14- to 19-digit card number.",paymentElementKey:"cardNo",title:"Enter card number",validateFunction:"^\\d{14,19}$"},{defaultText:"Exp date (MM/YY)",defaultValue:"",elementMandatory:!0,elementType:"DIGIT_4",extendInfo:'{"completeKey":"cc-exp"}',isPart:"true",paramIllegalText:"Enter a valid expiry date.",paymentElementKey:"expiryYear"},{defaultText:"Exp date (MM/YY)",defaultValue:"",elementMandatory:!0,elementType:"DIGIT_4",extendInfo:'{"completeKey":"cc-exp"}',isPart:"true",paramIllegalText:"Enter a valid expiry date.",paymentElementKey:"expiryMonth"},{defaultText:"CVV",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{3,4}$",elementType:"TEXT",extendInfo:"{}",isPartEnd:"true",paramIllegalText:"Enter a valid 3- or 4-digit CVV number.",paymentElementKey:"cardCVV",validateFunction:"^\\d{3,4}$"},{defaultText:"Name on card",defaultValue:"",elementMandatory:!0,elementRegx:"^[\\w\\s]{1,128}$",elementType:"TEXT",extendInfo:'{"completeKey":"cc-name"}',paramIllegalText:"Enter cardholder name as displayed on the card.",paymentElementKey:"cardHolderName",validateFunction:"^[\\w\\s]{1,128}$"}],title:"Card information"}],paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/8c2df293-4ff8-4a1c-bd39-457c26937acb.svg",iconName:"Rabbit LINE Pay",interActionType:"REDIRECT",paymentMethodName:"Rabbit LINE Pay",paymentMethodType:"RABBIT_LINE_PAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/72aa8973-7638-4f3f-b657-7af0ae02e6cf.svg",iconName:"BPI",interActionType:"REDIRECT",paymentMethodName:"BPI",paymentMethodType:"BPI",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/5b829130-42d9-46e7-a23d-6774f7352900.svg",iconName:"Alipay",interActionType:"REDIRECT",paymentMethodName:"Alipay",paymentMethodType:"ALIPAY_CN",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/ed012d1a-06c4-4606-a493-0d81ead685b6.svg",iconName:"Akulaku PayLater",interActionType:"REDIRECT",paymentMethodName:"Akulaku PayLater PH",paymentMethodType:"AKULAKU_PAYLATER_PH",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/ed012d1a-06c4-4606-a493-0d81ead685b6.svg",iconName:"Akulaku PayLater",interActionType:"REDIRECT",paymentMethodName:"Akulaku PayLater",paymentMethodType:"AKULAKU_PAYLATER",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/fcf9ba5e-b2b4-4c33-a041-f21bcf1539e4.svg",iconName:"BillEase",interActionType:"REDIRECT",paymentMethodName:"BILLEASE",paymentMethodType:"BILLEASE",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/dfcedf07-3135-49b6-9e39-6ab89b5ba5a1.svg",iconName:"Kredivo",interActionType:"REDIRECT",paymentMethodName:"KREDIVO",paymentMethodType:"KREDIVO_ID",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/6c7baedf-cb9e-47b1-8c2e-d2477b0d3018.svg",iconName:"Toss Pay",interActionType:"REDIRECT",paymentMethodName:"Toss Pay",paymentMethodType:"TOSSPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/89c1063e-c7d3-4b60-82a0-6e4c40426612.svg",iconName:"Kakao Pay",interActionType:"REDIRECT",paymentMethodName:"KAKAOPAY",paymentMethodType:"KAKAOPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/46ac203c-21fd-4feb-80c6-fd19faf1a9b7.svg",iconName:"GCash",interActionType:"REDIRECT",paymentMethodName:"GCash",paymentMethodType:"GCASH",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/8409ec96-3153-4d31-9bcb-a6b60f6ce11f.svg",iconName:"Boost",interActionType:"REDIRECT",paymentMethodName:"Boost",paymentMethodType:"BOOST",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/dd81e7d9-d845-434e-95b8-87b726d44aa4.svg",iconName:"DOKU",interActionType:"REDIRECT",paymentMethodName:"DOKU",paymentMethodType:"DOKU",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/2ec693a8-2c42-4efe-8acd-efdeeabd3210.svg",iconName:"K PLUS",interActionType:"REDIRECT",paymentMethodName:"KPLUS",paymentMethodType:"KPLUS",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/82288753-bc33-4f4c-9c07-e54c5da5c8f8.svg",iconName:"Touch'n Go eWallet",interActionType:"REDIRECT",paymentMethodName:"TNG",paymentMethodType:"TNG",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/db94babb-71db-42c4-80be-a65de641631a.svg",iconName:"NAVER Pay",interActionType:"REDIRECT",paymentMethodName:"NAVER Pay",paymentMethodType:"NAVERPAY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/5b1ec246-b49f-4390-b356-3af2af5acf09.svg",iconName:"TrueMoney",interActionType:"REDIRECT",paymentMethodName:"TrueMoney Wallet",paymentMethodType:"TRUEMONEY",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/97dbcec8-7bdd-464b-b49a-5d9af6d98c0b.svg",iconName:"AlipayHK",interActionType:"REDIRECT",paymentMethodName:"ALIPAY_HK",paymentMethodType:"ALIPAY_HK",recommend:!1,webRedirectType:"PAGE_REFRESH"},{antomPage:"paymentMetaPage",category:"AC_WALLET",expressCheckout:!1,icon:"https://cdn.marmot-cloud.com/storage/2024/05/15/6148dd94-9d28-43d5-9073-c99bfb8e7ace.svg",iconName:"DANA",interActionType:"REDIRECT",paymentMethodName:"DANA",paymentMethodType:"DANA",recommend:!1,webRedirectType:"PAGE_REFRESH"}],redirectUrl:"",savedPaymentMethods:[],shippingInfo:{shippingAddress:{address1:"06 Raffles Place Cecil Marina People's Park",address2:"USD",city:"",region:"SG",state:"",zipCode:"068898"},shippingFee:{amount:"1.00",currency:"USD",currencyLabel:"US $",formattedAmount:"1.00",formattedAmountWithCurrency:"US $1.00",value:"100"},shippingFeeView:{currency:"USD",currencyDivider:" ",currencyLabel:"$",currencySymbolPosition:"L",formattedValue:"1.00",value:"1.00"},shippingName:{firstName:"swd",lastName:""},shippingPhoneNo:"+651234571"},success:!0},Kf={accountInfo:{accountStatus:"EFFECTIVE",email:"test10@test.com",oneAccountId:"20241107190000000200000000000079939"},actionForm:{challengeAutoTriggered:!1,challengeRetrySupported:!0,estimatedDuration:0,resendLeftTimes:0},errorActions:{},extendInfo:{},paymentMethods:[{paymentMethodType:"CARD",iconName:"VISA",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id",paymentMethodDetail:{last4:"**** 1233"}},{paymentMethodType:"CARD",iconName:"VISA2",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id2",paymentMethodDetail:{last4:"**** 1235"}}],shippings:[{notes:"",prefer:"1",shippingAddress:{address1:"06 Raffles Place Cecil Marina People's Park",address2:"USD",city:"",region:"SG",state:"",zipCode:"068898"},shippingId:"20241109190000000600000000009947475",shippingName:{firstName:"swd",lastName:""},shippingPhoneNo:"+651234571",userId:"20241107190000000300000000010741992"}],success:!0},Bf={amountConfirmRequired:!1,autoDebitWithToken:!1,checkoutSettings:'{\n "addressAutoComplete": true,\n "publicDetail": {\n "legalBusinessName": "Lazada Group",\n "businessName": "Lazada"\n },\n "paymentSettings": {\n "displayExpressCheckout": true,\n "allowPromotion": true,\n "collectCustomerEmail": true,\n "collectCustomerPhoneNo": true,\n "collectShippingPhoneNo": true,\n "collectShippingName": true,\n "displayAntomLogo": true,\n "displayLanguage": true,\n "defaultLanguage": "en_US",\n "redirectToMerchant": true,\n "paymentRedirectUrl": "https://www.baidu.com",\n "customFields": [\n {\n "labelType": "DROPDOWN",\n "labelName": "How did you hear about us?",\n "minLength": 0,\n "maxLength": 255,\n "labelCondition": "REQUIRED",\n "options": [\n "Search engine (Google, Bing, etc.)",\n "Social media",\n "Word of Mouth"\n ],\n "picLink": "http://100.88.104.107:8081/download?bucketName=ipay-ipaycrm-attachment&key=20240409009064IMHaa2545f192c99a8481deaecd9b8ea5ad_2tiZTpB3_20240402143510.jpg&expires=2028172654&accessKeyId=FM49eWrrO8EFqUO4&signature=rnLBSUx4M1I1zPWuZLqInjP79u4%3D&signatureType=OBJECT",\n "picTitle": "picTitle",\n "picTip": "picTip"\n }\n ]\n },\n "displaySettings": {\n "iconUrl": "https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",\n "logoUrl": "https://cdn.marmot-cloud.com/storage/2022/9/26/dfd471f3-da7d-4ef1-8486-cfa4301045c6.svg",\n "useLogo": true,\n "themeType": "LIGHT",\n "backgroundColor": "#ffffff",\n "accentColor": "#ffffff",\n "font": "POPPINS",\n "shape": "ROUNDED",\n "displayLayout": "LEFT_ORDER_AND_RIGHT_PAYMENT"\n }\n }',errorActions:{},extendInfo:{},goods:[{goodsName:"Goods No.1",goodsQuantity:"1",goodsTotalAmount:{amount:"200.00",currency:"PEN",currencyLabel:"S/.",formattedAmount:"200.00",formattedAmountWithCurrency:"S/. 200.00",value:"20000"},goodsTotalAmountView:{currency:"PEN",currencyDivider:" ",currencyLabel:"S/.",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},goodsUnitAmount:{amount:"200.00",currency:"PEN",currencyLabel:"S/.",formattedAmount:"200.00",formattedAmountWithCurrency:"S/. 200.00",value:"20000"},goodsUnitAmountView:{currency:"PEN",currencyDivider:" ",currencyLabel:"S/.",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},referenceGoodsId:"amsdm_good_tony_c_20230227_095825_922"},{goodsName:"Goods No.2",goodsQuantity:"2",goodsTotalAmount:{amount:"40000",currency:"KRW",currencyLabel:"₩",formattedAmount:"40,000",formattedAmountWithCurrency:"₩ 40,000",value:"40000"},goodsTotalAmountView:{currency:"KRW",currencyDivider:" ",currencyLabel:"₩",currencySymbolPosition:"L",formattedValue:"40,000",value:"40000"},goodsUnitAmount:{amount:"20000",currency:"KRW",currencyLabel:"₩",formattedAmount:"20,000",formattedAmountWithCurrency:"₩ 20,000",value:"20000"},goodsUnitAmountView:{currency:"KRW",currencyDivider:" ",currencyLabel:"₩",currencySymbolPosition:"L",formattedValue:"20,000",value:"20000"},referenceGoodsId:"amsdm_good_tony_c_20230227_095825_922"}],links:{policyInfo:'["{\\"title\\":\\"CheckoutPaymentLegal\\",\\"content\\":[{\\"title\\":\\"CheckoutPaymentLegal\\",\\"content\\":\\"<p>hello<a href=\\\\\\"https://www.baidu.com/\\\\\\"target=\\\\\\"_blank\\\\\\">world</a></p><ol><li>123123123</li><li>123123123123</li></ol>\\"}]}"]',privacyLink:"https://render.alipay.com/p/c/180021490000000150/index.html?agreementId=GL00100002",cookieLink:"https://render.alipay.com/p/c/180021490000000147/index.html?agreementId=GL00100001"},needInstallmentAbility:!1,needOtherElements:!0,orderAmount:{amount:"200.00",currency:"BRL",currencyLabel:"R$",formattedAmount:"200,00",formattedAmountWithCurrency:"R$ 200,00",value:"20000"},orderAmountView:{currency:"BRL",currencyDivider:" ",currencyLabel:"R$",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},pageStyle:{checkoutSettings:'{"addressAutoComplete":false}'},paymentAmount:{amount:"200.00",currency:"BRL",currencyLabel:"R$",formattedAmount:"200,00",formattedAmountWithCurrency:"R$ 200,00",value:"20000"},paymentAmountView:{currency:"BRL",currencyDivider:" ",currencyLabel:"R$",currencySymbolPosition:"L",formattedValue:"200.00",value:"200.00"},paymentMethods:[{antomPage:"paymentMetaPage",category:"CARD",icon:"https://gw.alipay.com/icon/medium/default/ALIPAY_GENERAL_CARD.svg",iconName:"Card",links:[],logoList:[{cardBrand:"GWANGJUBANK",logoUrl:"https: //cdn.marmot-cloud.com/storage/2024/2/21/635b04a7-1086-4184-8122-98d9c2b99f0f.svg"},{cardBrand:"SHINHYEOP",logoUrl:"https: //cdn.marmot-cloud.com/storage/2024/2/23/bc083008-b6ca-4b51-8767-1aa0dce48f5a.svg"}],paymentElements:[{paymentElementKey:"paymentMethodId",elementType:"CARD",elementMandatory:!1,title:"Card Information",defaultValue:"",extendInfo:'{"needOtherElements":false,"isTempTokenization":"true"}',subPaymentElementView:[{defaultText:"Card Number",elementMandatory:!0,elementRegx:"^\\d{15,18}$",elementType:"DIGIT_18",paramIllegalText:"cardNo error",paymentElementKey:"cardNo",title:"Card Number",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-number"}'},{defaultText:"CVV",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{3,4}$",elementType:"DIGIT_4",extendInfo:'{"excludeMetaDataCodes":"null"}',paramIllegalText:"Please enter a valid 3 or 4 digit CVV number",paymentElementKey:"cardCVV"},{defaultText:"Name on Card",elementMandatory:!0,elementRegx:"",elementType:"TEXT",paramIllegalText:"Please enter a Name on Card",paymentElementKey:"cardHolderName",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-name"}'},{defaultText:"Exp Date(MM/YY)",elementMandatory:!0,elementRegx:".{5}",paramIllegalText:"Please enter a Exp Date",elementType:"TEXT",paymentElementKey:"expiryYear",title:"Please enter a Exp Date",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-exp"}'},{defaultText:"Exp Date(MM/YY)",elementMandatory:!0,elementRegx:"",elementType:"TEXT",paymentElementKey:"expiryMonth",title:"Please enter a Exp Date",defaultValue:"",extendInfo:'{"excludeMetaDataCodes":"null","completeKey":"cc-exp"}'}]},{defaultText:"Save this payment method for future use.",elementMandatory:!1,elementType:"CHECKBOX",extendInfo:"{}",paymentElementKey:"bindPaymentMethod"},{elementMandatory:!1,elementType:"DIGIT_4",extendInfo:'[{"currency":"BRL","installmentAmount":"21,39","interestFree":"true","interestRate":"0.12%","orderAmount":"21,39","tenor":"1"}, {"currency":"BRL","installmentAmount":"10,39","interestFree":"true","interestRate":"0.12%","orderAmount":"21,39","tenor":"2"}]',paymentElementKey:"tenor",title:"Instalment plan",defaultValue:""},{defaultText:"_ _ _. _ _ _. _ _ _-_ _",defaultValue:"",elementMandatory:!0,elementRegx:"^\\d{11}$",elementType:"DIGIT_11",extendInfo:'{"customerId":"r35fPjeD0IhNOJrciVqCq10AKiD/uxk8rzaySdJM4tI=","merchantId":"188r35fPjeD0IhNOJrciVqCq10AKiD/uxk8rzaySdJM4tI=","needVerify":"true"}',paramIllegalText:"Please enter a valid 11-digit CPF number",paymentElementKey:"cpf",title:"CPF Code"},{defaultText:"Enter your email address",defaultValue:"",elementMandatory:!0,elementRegx:"^(([\\w-\\+\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,18}|[0-9]{1,3})(\\]?))$",elementType:"TEXT",extendInfo:'{"excludeMetaDataCodes":"null"}',paramIllegalText:"Email address format invalid",paymentElementKey:"payerEmail",title:"Email"}],paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",webRedirectType:"PAGE_REFRESH"}],savedPaymentMethods:[],storePolicies:'[\\"{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"CheckoutPaymentLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":[{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"CheckoutPaymentLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>123123123</li><li>123123123123</li></ol>\\\\\\\\\\"}]}\\",\\"{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":[{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal_0\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>MerchantLegal_0</li><li>MerchantLegal_0</li></ol>\\\\\\\\\\"},{\\\\\\\\\\"title\\\\\\\\\\":\\\\\\\\\\"2188120013275594MerchantLegal_1\\\\\\\\\\",\\\\\\\\\\"content\\\\\\\\\\":\\\\\\\\\\"<p>hello<ahref=\\\\\\\\\\\\\\\\\\\\\\\\\\"https://www.baidu.com/\\\\\\\\\\\\\\\\\\\\\\\\\\"target=\\\\\\\\\\\\\\\\\\\\\\\\\\"_blank\\\\\\\\\\\\\\\\\\\\\\\\\\">world</a></p><ol><li>MerchantLegal_1</li><li>MerchantLegal_1</li></ol>\\\\\\\\\\"}]}\\"]',success:!0,redirectUrl:"",supportedLanguages:[{locale:"en_US",preferred:!0,title:"English"},{locale:"it_IT",preferred:!1,title:"Português"},{locale:"de_DE",preferred:!1},{locale:"fr_FR",preferred:!1},{locale:"nl_NL",preferred:!1},{locale:"es_ES",preferred:!1},{locale:"zh_CN",preferred:!1},{country:"KR",locale:"ko_KR",preferred:!1,title:"한국어"}]},Yf={accountInfo:{email:"xxxxx@163.com",accountStatus:"EFFECTIVE",oneAccountId:"xxxxxxkk"},goods:{goodsName:"xxxxxxx",goodsImageUrl:"",goodsQuantity:100,goodsUnitAmount:{currency:"EUR",value:100,currencyLabel:""}},paymentMethods:[{paymentMethodType:"CARD",iconName:"VISA",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id",paymentMethodDetail:{last4:"**** 1233"}},{paymentMethodType:"CARD",iconName:"VISA2",icon:"https://cdn.marmot-cloud.com/storage/2022/8/2/bc7cb991-c8e2-4379-945f-aadae2bdf932.svg",paymentMethodId:"card-id2",paymentMethodDetail:{last4:"**** 1235"}}],links:{privacyLink:"https://global.alipay.com/docs/ac/Platform/bahzqeb-",cookieLink:"https://global.alipay.com/docs/ac/Platform/x1rhufzj"},shippings:[{shippingName:{firstName:"111111",lastName:"11111"},prefer:"1",shippingId:"xxxx1",shippingPhoneNo:"xxxxxx123",shippingAddress:{region:"ID",state:"Nusa",city:"Nusa Tenggara Bar.",address1:"Kec. Mataram, Kota Mataram",address2:"Jl. Bangil V No.6, Pagesangan Tim",zipCode:"123445"}}],metaData:{countryList:[{countryName:"China",default:!0},{countryName:"Singapore",default:!1}]},errorActions:{},extendInfo:{},merchantId:"111xT8bLnciQgqcy20+oOJoWUEbPMTwI0YILNBIicpASIs=",needInstallmentAbility:!1,needOtherElements:!1,orderDescription:"AMSDM_GIFT",success:!0,supportedLanguages:[{locale:"en_US",preferred:!0,title:"English"},{country:"BR",locale:"pt_BR",preferred:!1,title:"Português"},{country:"KR",locale:"ko_KR",preferred:!1,title:"한국어"},{country:"MX,CL,PE",locale:"es_ES",preferred:!1,title:"Español"}]};function Ff(e){"GOOGLEPAY"===e.paymentMethodType&&(e.paymentMethodDetail=h()(h()({},e.paymentMethodDetail),{},{googlePayProps:{environment:"TEST",existingPaymentMethodRequired:!0,paymentRequest:{allowedPaymentMethods:[{parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:["VISA","JCB"]},tokenizationSpecification:{parameters:{protocolVersion:"ECv2",publicKey:"BDM6GVTLZmxSmTQzm04QKI2av54kFpkqjhbkejtdDUx+VMvUtJ6vc+ZlDp8TygNTf+QeihxpD869sCVWaa0KMJc="},type:"DIRECT"},type:"CARD"}],apiVersion:2,apiVersionMinor:0,callbackIntents:["PAYMENT_AUTHORIZATION"],merchantInfo:{merchantId:"123",merchantName:"merchantName"},shippingAddressRequired:!0,transactionInfo:{countryCode:"US",currencyCode:"EUR",totalPrice:"10",totalPriceStatus:"FINAL"}}}}))}function Hf(e,t){if(!e)return!1;if(!t)return!0;try{var n=JSON.parse(t),r=null==n?void 0:n.onlyIntegrateCardElementConnectMerchantFlag;return"true"!==String(r)}catch(e){return!0}}var jf,Vf=new Ua(Ka,!0),Gf=function(e){try{var t;return!!JSON.parse(null===(t=JSON.parse(e))||void 0===t?void 0:t.expressCheckout)}catch(e){return!1}},zf=function(e){_()(o,e);var t,n,r=b()(o);function o(){var e;g()(this,o);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e=r.call.apply(r,[this].concat(n)),c()(Ze()(e),"ApplePayService",void 0),c()(Ze()(e),"_onBeforeConfirm",null),c()(Ze()(e),"_merchantAmount",null),c()(Ze()(e),"_merchantCurrency",null),e}return f()(o,[{key:"setOnBeforeConfirm",value:function(e){this._onBeforeConfirm=e,this.ApplePayService&&this.ApplePayService.setOnBeforeConfirm(e)}},{key:"setMerchantAmountOverride",value:function(e,t){this._merchantAmount=e,this._merchantCurrency=t}},{key:"onReady",value:function(e){var t,n,r,o,i,a,s,l=this.elementContainer.getPaymentContext();if(this.getLogger().logInfo({title:"sdk_event_renderComponent"}),"mobile"===(null===(t=this.options)||void 0===t?void 0:t.preview)){var c,u,d,p,h=(null==e||null===(c=e.originActionQueryResult)||void 0===c?void 0:c.paymentMethods)||[],m=(null==e||null===(u=e.originActionQueryResult)||void 0===u?void 0:u.savedPaymentMethods)||[];if(!(1!==h.length||0!==m.length||null!==(d=h[0])&&void 0!==d&&null!==(d=d.paymentElements)&&void 0!==d&&d.length||["APPLEPAY","GOOGLEPAY"].includes(null===(p=h[0])||void 0===p?void 0:p.paymentMethodType)))return}var f,v=null==l||null===(n=l.displayInfo)||void 0===n?void 0:n.appearance;if("string"==typeof(null==v?void 0:v.theme)&&v.theme.startsWith("APR_")){var g,y,_=null==e||null===(g=e.originActionQueryResult)||void 0===g||null===(g=g.pageStyle)||void 0===g?void 0:g.elementSettings;f="string"==typeof _?null===(y=Xm(_))||void 0===y?void 0:y.appearance:null==_?void 0:_.appearance}else f=v;this.eventCenter.dispatchToApp({event:"renderComponent",data:{heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),paymentSessionData:null==l?void 0:l.paymentSession,queryResult:null==e?void 0:e.originActionQueryResult,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:{paymentMethodCategoryType:null===(r=this.elementContainer)||void 0===r?void 0:r.getPaymentContext().paymentSessionObj.paymentSessionConfig.paymentMethodCategoryType,productSceneVersion:null===(o=this.elementContainer)||void 0===o?void 0:o.getPaymentContext().paymentSessionObj.paymentSessionConfig.productSceneVersion,trackId:null===(i=this.elementContainer)||void 0===i?void 0:i.getPaymentContext().paymentSessionId,merchantId:null===(a=this.elementContainer)||void 0===a||null===(a=a.getPaymentContext())||void 0===a||null===(a=a.paymentSessionObj)||void 0===a?void 0:a.clientId,paymentMethodType:null===(s=this.elementContainer)||void 0===s||null===(s=s.getPaymentContext())||void 0===s||null===(s=s.paymentSessionObj)||void 0===s||null===(s=s.paymentMethodInfoView)||void 0===s?void 0:s.paymentMethodType},appearance:f,sessionResult:null==l?void 0:l.paymentSessionObj,notRedirectAfterComplete:!0===(null==e?void 0:e.notRedirectAfterComplete),merchantAppointParam:null==e?void 0:e.merchantAppointParam,originOneAccountQueryResult:null==e?void 0:e.originOneAccountQueryResult,doMain:window.location.hostname}})}},{key:"getLogger",value:function(){return xf.getInstance(this.instanceId).getService("Log")}},{key:"addEventListener",value:function(){var e=this;this.eventCenter.listen(ve.onPollingEnd.name,(function(t){e.eventCenter.dispatchToApp({event:"onPollingEnd",data:t})})),this.eventCenter.listen(ve.closePaymentPolling.name,(function(t){e.eventCenter.dispatchToApp({event:ve.closePaymentPolling.name,data:t})})),this.eventCenter.listen(ve.getGooglePayToken.name,(function(t,n){$a(n).then((function(t){e.eventCenter.dispatchToApp({event:"getGooglePayToken",data:h()({},t)})})).catch((function(t){e.eventCenter.dispatchToApp({event:"getGooglePayToken",data:{err:t}})}))})),this.eventCenter.listen(ve.getApplePayToken.name,(function(t){var n,r=e.elementContainer.getPaymentContext(),o=r.paymentSessionObj,i=r.paymentSession,a=(null==t?void 0:t.shipping)||(null===(n=e.obtainDataRes)||void 0===n||null===(n=n.originActionQueryResult)||void 0===n?void 0:n.shippingInfo),s=new es({paymentSessionData:i,parseData:o,logger:Vf,env:e.options.env.environment,shipping:a,merchantAmount:e._merchantAmount,merchantCurrency:e._merchantCurrency});s.setOnBeforeConfirm(e._onBeforeConfirm),s.startPay().then((function(t){e.eventCenter.dispatchToApp({event:"getApplePayToken",data:{success:!0,result:t}})})).catch((function(t){e.eventCenter.dispatchToApp({event:"getApplePayToken",data:{success:!1,result:t}})}))})),this.eventCenter.listen(ve.beforeConfirm.name,s()(i()().mark((function t(){var n,r,o,a,s,l,c;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n="APPLEPAY",e._onBeforeConfirm){t.next=5;break}return Vf.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:n,path:"applePay_eventBridge"}),e.eventCenter.dispatchToApp({event:ve.beforeConfirm.name,data:{success:!0,result:!0}}),t.abrupt("return");case 5:return Vf.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:n,path:"applePay_eventBridge"}),t.prev=6,r=Date.now(),t.next=10,qa((function(){return e._onBeforeConfirm()}));case 10:o=t.sent,a=o.result,s=o.timedOut,l=a,(c=s||Date.now()-r>=Va)&&(Vf.logError({title:"sdk_before_confirm_timeout"}),l=!1),Vf.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:l}),e.eventCenter.dispatchToApp({event:ve.beforeConfirm.name,data:h()({success:!0,result:!!l},c?{isTimeout:!0}:{})}),t.next=24;break;case 20:t.prev=20,t.t0=t.catch(6),Vf.logError({title:"sdk_before_confirm_error"},{paymentMethodType:n,errorMessage:String((null===t.t0||void 0===t.t0?void 0:t.t0.message)||t.t0).slice(0,200),path:"applePay_eventBridge"}),e.eventCenter.dispatchToApp({event:ve.beforeConfirm.name,data:{success:!1,result:!1}});case 24:case"end":return t.stop()}}),t,null,[[6,20]])}))))}},{key:"initApplePaySdk",value:(n=s()(i()().mark((function e(){var t,n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(null===(t=this.elementContainer)||void 0===t?void 0:t.getPaymentContext())||{},r=n.paymentSessionObj,o=n.paymentSession,a=void 0,!(null==(i=r)?void 0:i.skipRenderPaymentMethod)||"APPLEPAY"!==(null==i||null===(a=i.paymentSessionFactor)||void 0===a||null===(a=a.paymentMethodInfo)||void 0===a?void 0:a.paymentMethodType)){e.next=13;break}return this.ApplePayService=new es({paymentSessionData:o,parseData:r,logger:Vf,env:this.options.env.environment}),e.prev=3,Vf.logInfo({title:"a3753.b107385.c398110"}),e.next=7,this.ApplePayService.initApplePaySession();case 7:Vf.logInfo({title:"a3753.b107385.c398112"}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),Vf.logError({title:"a3753.b107385.c398111"});case 13:case"end":return e.stop()}var i,a}),e,this,[[3,10]])}))),function(){return n.apply(this,arguments)})},{key:"beforeMount",value:function(){this.initApplePaySdk(),this.addEventListener()}},{key:"preload",value:function(){}},{key:"generateIframeSrc",value:function(e){var t,n=e.link,r=e.instanceId;this.instanceId=r;var o=this.elementContainer.getPaymentContext()||{},i=o.paymentSession,a=o.paymentSessionObj,s=o.sdkMetaData,l=this.options,c=l.env.environment,u=l.analytics,d=l.locale,p=(a||{}).extendInfo,h="mobile"===(null===(t=this.options)||void 0===t?void 0:t.preview)?F.popup:F.inline,m=Wm({paymentSession:i,paymentSessionObj:a,environment:c,analytics:u,locale:d,link:n,appVersion:null==s?void 0:s.webAppVersion,pageUrl:Gf(p)?jm.EXPRESS_CHECKOUT:jm.ELEMENT_PAYMENT,instanceId:r,renderDisplayType:h});return this.setElementUrl(m),m}},{key:"obtainData",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,h,m,f,v,g,y,_,E,b,A,S,k,T,P,I,C,w,N=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=xf.getInstance(this.instanceId).getService("Requester"),o=this.elementContainer.getPaymentContext(),a=o.paymentSession,s=o.paymentSessionObj,l=o.displayInfo,c=l.debugProps,u=this.options,d=u.env.environment,p=u.locale,h=(s||{}).paymentSessionConfig,m=a.split("&&")[1]||"",f=null==s||null===(t=s.connectFactor)||void 0===t?void 0:t.enableConnect,v=Hf(f,null==s?void 0:s.extendInfo),g=(null==c?void 0:c.isDebug)&&(null==c?void 0:c.local_mock),y=null===(n=this.options)||void 0===n?void 0:n.preview,_=!0===y||"web"===y||"mobile"===y,E=g||_,b=Et(this.getElementUrl()),A=b.appType,S=Jm()?"WEB":A?"APP":Qm()?"WEB":"WAP",k=function(){return new Promise((function(e,t){var n;if(E)setTimeout((function(){if(_){var t=N.buildPreviewMockData(Uf);e(t)}else e(Uf)}),100);else{N.getLogger().logInfo({title:"sdk_action_query_start"},{config:Zm(h)});var o={paymentSessionConfig:h,paymentSessionData:a,extParams:{isUserPreferredLocale:!0}},i=null==l?void 0:l.appearance;"string"==typeof(null==i?void 0:i.theme)&&i.theme.startsWith("APR_")&&(o.appearanceId=i.theme),null!=l&&null!==(n=l.merchantAppointParam)&&void 0!==n&&n.storedCard&&(o.merchantAppointParam=l.merchantAppointParam),Object.prototype.hasOwnProperty.call(l,"notRedirectAfterComplete")&&(o.notRedirectAfterComplete=l.notRedirectAfterComplete),r.request(o,{env:d,envInfo:{locale:p,terminalType:S},hostSign:m,timeout:3e5,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query",headers:{"Content-Type":"application/json"}}).then((function(t){t.success?N.getLogger().logInfo({title:"sdk_event_sdkQueryEnd"},{config:Zm(h),rpcTraceId:null==t?void 0:t.traceId}):N.getLogger().logError({title:"sdk_event_sdkQuery_failed"},{config:Zm(h),errorMessage:Zm((null==t?void 0:t.errorMessage)||""),rpcTraceId:null==t?void 0:t.traceId}),e(t)}),(function(e){t(e),N.getLogger().logError({title:"sdk_event_sdkQuery_failed"},{config:Zm(h),errorMessage:Zm(e)})}))}}))},T=function(){return new Promise((function(e,t){E?setTimeout((function(){e(Kf)}),100):r.request({paymentSessionConfig:h,paymentSessionData:a,accountInfo:{email:""}},{env:d,envInfo:{locale:p,terminalType:S},timeout:3e5,"Operation-Type":"com.ipay.iexpfront.one.account.query",headers:{"Content-Type":"application/json"}}).then((function(t){e(t)}),(function(e){t(e)}))}))},e.next=19,Promise.all(v?[k(),T()]:[k()]);case 19:return P=e.sent,I=tt()(P,2),C=I[0],w=I[1],this.obtainDataRes={originActionQueryResult:C,originOneAccountQueryResult:w},e.abrupt("return",{originActionQueryResult:C,originOneAccountQueryResult:w});case 25:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"buildPreviewMockData",value:function(e){var t=this.elementContainer.getPaymentContext().displayInfo,n=null==t?void 0:t.previewPaymentMethods,r=JSON.parse(JSON.stringify(e)),o=function(e){if(!e)return[];var t=e.expressCheckout,n=e.supportedMethods,r=e.topping,o=((null==t?void 0:t.methods)||[]).map((function(e){var t={paymentMethodName:e.paymentMethodName,paymentMethodType:e.paymentMethodType,category:e.paymentMethodType,expressCheckout:!0};return Ff(t),t})),i=[];(n||[]).forEach((function(e){if("CARD"!==e.paymentMethodName){var t={paymentMethodName:e.paymentMethodName,paymentMethodType:e.paymentMethodType,category:e.paymentMethodType,icon:e.logoUrl,recommend:!1};t.paymentMethodType===r&&(t.recommend=!0),Ff(t),function(e){"ONLINEBANKING_YAPILY"===e.paymentMethodType&&(e.paymentElements=[])}(t),i.push(t)}}));var a=function(){var e=-1,t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(n,r){"CARD"===n.paymentMethodName&&(t.push({cardBrand:n.paymentMethodType,logoUrl:n.logoUrl||""}),-1===e&&(e=r))})),t.length?{firstCardIndex:e,cardPaymentMethod:{antomPage:"paymentMetaPage",category:"CARD",expressCheckout:!1,logoList:t,paymentMethod:"CARD",paymentMethodName:"Card",paymentMethodType:"CARD",recommend:!1,webRedirectType:"PAGE_REFRESH"}}:null}(n);return a&&i.splice(a.firstCardIndex,0,a.cardPaymentMethod),[].concat($e()(o),i)}(n);return r.paymentMethods=o,r}},{key:"getValue",value:function(){return{}}},{key:"update",value:function(e){var t=e.data,n=e.paymentSessionData,r=rl(n),o=tt()(r,2),i=o[0],a=o[1];this.eventCenter.dispatchToApp({event:"updatePayment",data:{paymentSessionData:n,data:t,sessionResult:i,sessionData:a}})}}]),o}($m),Wf=zf;function qf(){try{var e=Jt("AntomDefaultGrayScaleId","");if(e)return parseInt(e);var t=He(),n=t.substring(t.length-3,t.length-1),r=parseInt(n,16),o=Math.floor(100*r/255);return Qt("AntomDefaultGrayScaleId",""+o),o}catch(e){return console.error("Get gray scale ID failed",e),0}}function Jf(e){return Jf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jf(e)}function Qf(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qf(Object(n),!0).forEach((function(t){Xf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qf(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Xf(e,t,n){return(t=ev(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ev(r.key),r)}}function ev(e){var t=function(e,t){if("object"!==Jf(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==Jf(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Jf(t)?t:String(t)}!function(e){e.SCHEME="Scheme",e.LINK="Link",e.INTENT="Intent"}(jf||(jf={}));var tv=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.config=void 0,this.timer=void 0,this.options=void 0,this.evokeAppBy=void 0;this.config=Zf(Zf({},{delay:0}),t),this.options={},this.timer=null,this.evokeAppBy={url:"",type:jf.LINK},this.init()}var t,n,r;return t=e,(n=[{key:"init",value:function(){Ds(),js({evokeAppBy:this.evokeAppBy,successCb:this.config.successCb,timeout:this.config.resultJudgmentTime})}},{key:"open",value:function(e){this.options=e;var t=this.options,n=t.scheme,r=t.intent,o=t.link,i=t.params,a=t.fallback;n||o||r?o&&Gs(o)?(this.options.link=xs(o,i),this.handleLink()):n&&!Gs(n)?(this.options.scheme=xs(n,i),this.handleScheme()):r&&r.scheme&&r.package?this.handleIntent():a?a():console.error("唤端失败"):console.error("请至少填一个链接")}},{key:"handleLink",value:function(){this.evokeAppBy.type=jf.LINK;var e=this.options,t=e.link,n=e.scheme,r=e.delay,o=e.fallback;Cs?Ps()>9?this.evokeByLocationDelay(t,r,o,this.handleScheme):n?this.handleScheme():o?o():console.error("唤端失败"):this.evokeByLocationDelay(t,r,o,this.handleScheme)}},{key:"handleIntent",value:function(){this.evokeAppBy.type=jf.INTENT;var e=this.options,t=e.intent,n=e.delay,r=e.fallback;t&&t.scheme&&t.package&&this.evokeByLocationDelay(Us(t.scheme,t.package,t.fallbackUrl),n,r)}},{key:"handleScheme",value:function(){this.evokeAppBy.type=jf.SCHEME;var e=this.options,t=e.scheme,n=e.delay,r=e.fallback;t&&(Cs?this.handleIOSScheme():ws||Os?this.handleOriginalChrome():this.evokeByIFrameDelay(t,n,r))}},{key:"handleIOSScheme",value:function(){var e=this.options,t=e.scheme,n=e.delay,r=e.fallback;Ps()<9?this.evokeByIFrameDelay(t,n,r):this.evokeByTagADelay(t,n,r)}},{key:"handleOriginalChrome",value:function(){var e=this,t=this.options,n=t.scheme,r=t.intent,o=t.delay,i=t.fallback;this.evokeByLocationDelay(n,o,i,(function(){r&&r.package&&e.evokeByLocationDelay(Us(n,r.package,r.fallbackUrl),o,i,e.handleIntent.bind(e))}))}},{key:"evokeAppDelay",value:function(e,t,n,r,o){var i=this,a=n||this.config.delay,s=r||this.config.fallback;this.timer=setTimeout((function(){i.clearTimer(),e(),i.checkIsOpen(t,s,o)}),a)}},{key:"evokeByLocationDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return Rs(e)}),e,t,n,r)}},{key:"evokeByTagADelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return Ms(e)}),e,t,n,r)}},{key:"evokeByIFrameDelay",value:function(e,t,n,r){this.evokeAppDelay((function(){return Ls(e)}),e,t,n,r)}},{key:"checkIsOpen",value:function(e,t,n){return this.evokeAppBy.url=e,Hs(n||t,this.config.resultJudgmentTime)}},{key:"clearTimer",value:function(){this.timer&&clearTimeout(this.timer)}}])&&$f(t.prototype,n),r&&$f(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),nv=tv,rv=function(e,t){var n=xf.getInstance(t);n.getService("Log").logInfo({title:"sdk_event_call_url_start"},h()({},e)).send();try{if(e.isCallApp&&e.schemeUrl){var r=e.callAppDetectSuccessDelay;return void new nv({successCb:function(){ov(e,se.SchemeUrl,e.schemeUrl,n)},resultJudgmentTime:r}).open({scheme:e.schemeUrl,fallback:function(){iv(e,se.SchemeUrl,e.schemeUrl,n)}})}if(e.browserLinkTarget===re.BLANK)return e.url?(ov(e,se.NormalUrl,e.url,n),void window.open(e.url)):iv(e,se.NormalUrl,"",n);if(!(e.browserLinkTarget!==re.REPLACE||null!=e&&e.applinkUrl||null!=e&&e.schemeUrl))return e.url?(ov(e,se.NormalUrl,e.url,n),void window.location.replace(e.url)):iv(e,se.NormalUrl,"",n);if(_t())return e.url?(ov(e,se.NormalUrl,e.url,n),void(window.location.href=e.url)):iv(e,se.NormalUrl,"",n);if(!e.schemeUrl&&!e.applinkUrl)return e.url?(ov(e,se.NormalUrl,e.url,n),void(window.location.href=e.url)):iv(e,se.NormalUrl,"",n);var o=new nv({successCb:function(t){var r="Scheme"==t.type?se.SchemeUrl:se.ApplinkUrl;ov(e,r,t.url,n)}}),i=function(){try{o.open({scheme:e.schemeUrl,fallback:function(){if(iv(e,se.SchemeUrl,e.schemeUrl,n),!e.url)return iv(e,se.NormalUrl,"",n);ov(e,se.NormalUrl,e.url,n),window.location.href=e.url}})}catch(t){if(iv(e,se.SchemeUrl,e.schemeUrl,n),!e.url)return iv(e,se.NormalUrl,"",n);ov(e,se.NormalUrl,e.url,n),window.location.href=e.url}};e.applinkUrl?function(){try{o.open({link:e.applinkUrl,fallback:function(){iv(e,se.ApplinkUrl,e.applinkUrl,n),i()}})}catch(t){iv(e,se.ApplinkUrl,e.applinkUrl,n),i()}}():e.schemeUrl&&i()}catch(t){n.getService("Log").logInfo({title:"sdk_event_call_url_failed"},{redirectInfo:JSON.stringify(e),errorMessage:JSON.stringify(t)}).send()}},ov=function(e,t,n,r){r.getService("EventCenter").emit(ve.eventCallback.name,{code:ae.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(t,": ").concat(n)}),r.getService("Log").logInfo({title:"sdk_event_call_url_success"},{redirectInfo:JSON.stringify(e),openType:t,url:n}).send()},iv=function(e,t,n,r){r.getService("EventCenter").emit(ve.eventCallback.name,{code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==e?void 0:e.applinkUrl," schemeUrl: ").concat(null==e?void 0:e.schemeUrl," normalUrl: ").concat(null==e?void 0:e.url)}),r.getService("Log").logInfo({title:"sdk_error_call_url_failed"},{redirectInfo:JSON.stringify(e),openType:t,url:n}).send()},av=[{matchRule:"AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z]+) Safari\\/([0-9\\._]+)$",iosScheme:"https",andScheme:""},{matchRule:"HeyTapBrowser",iosScheme:"",andScheme:""},{matchRule:"HuaweiBrowser",iosScheme:"",andScheme:""},{matchRule:"Kwai",iosScheme:"kwai",andScheme:""},{matchRule:"MQQBrowser",iosScheme:"mttbrowser",andScheme:""},{matchRule:"MicroMessenger",iosScheme:"",andScheme:""},{matchRule:"MiuiBrowser",iosScheme:"",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* CriOS\\/([0-9\\._]+) Mobile\\/([0-9\\._A-Z\\._a-z]+) Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"Mozilla\\/([0-9\\.]+).* AppleWebKit\\/([0-9\\.]+).* Version\\/([0-9\\._]+) Mobile Safari\\/([0-9\\._]+)$",iosScheme:"googlechrome",andScheme:""},{matchRule:"NewsArticle",iosScheme:"snssdk141",andScheme:""},{matchRule:"UCBrowser",iosScheme:"ucbrowser",andScheme:""},{matchRule:"VideoArticle",iosScheme:"snssdk32",andScheme:""},{matchRule:"VivoBrowser",iosScheme:"",andScheme:""},{matchRule:"ZhongAnWebView",iosScheme:"zaapp",andScheme:""},{matchRule:"aweme",iosScheme:"snssdk1128",andScheme:""},{matchRule:"aweme_lite",iosScheme:"snssdk2329",andScheme:""},{matchRule:"com.xs.fm",iosScheme:"novelfm3040",andScheme:""},{matchRule:"netdisk",iosScheme:"",andScheme:""},{matchRule:"qqnews",iosScheme:"qqnews",andScheme:""}];function sv(e,t){for(var n,r=e||window.navigator.userAgent||"",o=av,i=0;i<o.length;i++){var a=o[i];if(r.match(a.matchRule)){n=a;break}}if(n)return function(e){var t=(e||navigator.userAgent).toLowerCase();return/android|adr|linux/.test(t)}(r)?(lv(t,r,n.andScheme),n.andScheme):function(e){var t=(e||navigator.userAgent).toLowerCase();return/iphone|ipad|ipod|ios|macintosh/.test(t)}(r)?(lv(t,r,n.iosScheme),n.iosScheme):void 0;lv(t,r,"")}function lv(e,t,n){e&&e.logInfo({title:"a3753.b101271.c377460"},{eventMessage:n})}var cv=function(){function e(){g()(this,e),c()(this,"bizFlowStartBehavior",void 0),c()(this,"initOptions",void 0),c()(this,"paymentContext",void 0),c()(this,"instanceId",void 0),c()(this,"sdkMetaData",void 0),c()(this,"productProcessors",{}),c()(this,"enablePopWindowEventCallback",!1),c()(this,"eventLogging",void 0),c()(this,"status",Gm.UNINIT),c()(this,"logger",void 0),this.status=Gm.INITING}var t;return f()(e,[{key:"getStatus",value:function(){return this.status}},{key:"setStatus",value:function(e){e!==this.getStatus()&&(console.log("[test] status has changed from ".concat(this.getStatus()," to ").concat(e)),this.status=e)}},{key:"updatePaymentSessionData",value:function(e){var t=on(e),n=t.id,r=t.data;this.paymentContext=h()(h()({},this.paymentContext),{},{paymentSession:e,paymentSessionId:n,paymentSessionObj:r})}},{key:"registerProcessor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=t?"".concat(e,"|").concat(t):e;this.productProcessors[r]=n}},{key:"init",value:function(e,t){this.instanceId=He(),this.sdkMetaData={webAppVersion:"",greyscaleId:qf(),productScene:t,sdkVersion:T},this.sdkMetaData.webAppVersion=an(this.sdkMetaData),xf.getInstance(this.instanceId).init(e,this.sdkMetaData),this.logger=xf.getInstance(this.instanceId).getService("Log"),this.prepare(e,this.sdkMetaData)}},{key:"prepare",value:function(e,t){var n=this,r=xf.getInstance(this.instanceId).getService("EventCenter");r.listen(ve.redirect.name,(function(e){var t,r,o;if(e){var i=null===(t=e.isDestroy)||void 0===t||t,a="string"==typeof e?{url:e}:{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",url:(null==e?void 0:e.normalUrl)||"",browserLinkTarget:null==e?void 0:e.target,isCallApp:null!==(r=null==e?void 0:e.isCallApp)&&void 0!==r&&r,callAppDetectSuccessDelay:null!==(o=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==o?o:5e3};rv(a,n.instanceId),i&&n.cleanRender()}})),r.listen(ve.initSecuritySDK.name,function(){var e=s()(i()().mark((function e(t,o){var a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=xf.getInstance(n.instanceId).getService("Security"),e.prev=1,e.next=4,s.initSecurity();case 4:l=!0,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),l=!1;case 10:r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=o.context)||void 0===a?void 0:a.eventCallbackId,data:{success:l}});case 11:case"end":return e.stop()}}),e,null,[[1,7]])})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(ve.getDeviceId.name,function(){var e=s()(i()().mark((function e(t,o){var a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=xf.getInstance(n.instanceId).getService("Security"),e.next=3,s.getDeviceId(t);case 3:l=e.sent,r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=o.context)||void 0===a?void 0:a.eventCallbackId,data:{deviceId:l}});case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(ve.getSdkVersion.name,function(){var e=s()(i()().mark((function e(n,o){var a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=o.context)||void 0===a?void 0:a.eventCallbackId,data:{version:null==t?void 0:t.sdkVersion}});case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()),r.listen(ve.destroy.name,(function(e){n.setStatus(Gm.READY),n.destroy()})),r.listen(ve.closeCallback.name,(function(){var t;null===(t=e.onClose)||void 0===t||t.call(e)})),r.listen(ve.eventCallback.name,(function(t){var r;n.logger.logInfo({title:"sdk_event_event_callback"},{eventCode:JSON.stringify((null==t?void 0:t.code)||""),eventMessage:JSON.stringify((null==t?void 0:t.message)||"")}),null===(r=e.onEventCallback)||void 0===r||r.call(e,t)})),r.listen(ve.error.name,(function(t){var n;null===(n=e.onError)||void 0===n||n.call(e,t)})),r.listen(ve.declareEventCallbackInfo.name,(function(e){null!=e&&e.popWindowEventInfo&&(n.enablePopWindowEventCallback=e.popWindowEventInfo.enableCallback,n.eventLogging=e.popWindowEventInfo.eventLogging)})),r.listen(ve.canIUse.name,(function(e,t){var n,o=null==e?void 0:e.funcName;if(o&&"string"==typeof o){var i=r.isExist(o);r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(n=t.context)||void 0===n?void 0:n.eventCallbackId,data:{exist:i,success:!0}})}else{var a;r.dispatchToApp({event:"appEventCallback",eventCallbackId:null===(a=t.context)||void 0===a?void 0:a.eventCallbackId,data:{exist:!1,success:!1}})}})),this.productProcessors[t.productScene]&&this.productProcessors[t.productScene].init(e,this.instanceId,t)}},{key:"startBizFlow",value:(t=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,m,f,v,g,y,_,E,b;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&t.paymentSession){e.next=2;break}throw new Error("paymentSession is empty");case 2:if(this.setStatus(Gm.IN_BIZ_FLOW),a=t.paymentSession,s=t.displayInfo,l=on(a),c=l.id,u=l.data,this.paymentContext={initOptions:this.initOptions,startBizFlowOptions:t,paymentSession:a,paymentSessionId:c,paymentSessionObj:u,displayInfo:h()(h()({},new Vm),s),sdkMetaData:this.sdkMetaData},d=null===(n=this.paymentContext.paymentSessionObj)||void 0===n?void 0:n.clientId,p=Ut(this.paymentContext.paymentSessionObj.extendInfo),m=an(this.sdkMetaData,d,p),this.sdkMetaData.webAppVersion=m,xf.getInstance(this.instanceId).update(this.paymentContext),this.logger.logInfo({title:"sdk_event_createComponent"}),i=this.sdkMetaData,Qt("Antom_".concat(i.sdkVersion+i.productScene,"_LastAppVersion"),""),f=null===(r=this.paymentContext.paymentSessionObj)||void 0===r||null===(r=r.paymentSessionConfig)||void 0===r?void 0:r.productScene,v=null===(o=this.paymentContext.paymentSessionObj)||void 0===o||null===(o=o.paymentMethodInfoView)||void 0===o?void 0:o.paymentMethodType,e.prev=15,!this.productProcessors["".concat(f,"|").concat(v)]){e.next=22;break}return e.next=19,this.productProcessors["".concat(f,"|").concat(v)].startBizFlow(this.paymentContext);case 19:this.bizFlowStartBehavior=e.sent,e.next=26;break;case 22:if(!this.productProcessors["".concat(f)]){e.next=26;break}return e.next=25,this.productProcessors["".concat(f)].startBizFlow(this.paymentContext);case 25:this.bizFlowStartBehavior=e.sent;case 26:e.next=31;break;case 28:e.prev=28,e.t0=e.catch(15),console.error("Invoke processor failed",e.t0);case 31:if(this.bizFlowStartBehavior&&"NONE"!==this.bizFlowStartBehavior.behaviorType&&this.bizFlowStartBehavior.payload){e.next=33;break}return e.abrupt("return");case 33:if("RENDER"!==this.bizFlowStartBehavior.behaviorType){e.next=36;break}return this.handleBehaviorRender(),e.abrupt("return");case 36:if("REDIRECT"!==this.bizFlowStartBehavior.behaviorType){e.next=49;break}if(y=null===(g=this.bizFlowStartBehavior)||void 0===g?void 0:g.payload,console.log("sdk 打印",y),console.log("sdk 触发",t),!t.isNativeAppWebview||y.openInApp){e.next=46;break}return console.log("sdk 打印跳转",t),_=xf.getInstance(this.instanceId).getService("EventCenter"),E={normalUrl:(null==y?void 0:y.url)||"",schemeUrl:(null==y?void 0:y.schemeUrl)||"",applinkUrl:(null==y?void 0:y.applinkUrl)||""},_.emit(ve.eventCallback.name,{code:ae.SDK_REDIRECT,result:{redirectUrls:E}}),e.abrupt("return");case 46:return y.url&&y.openInApp&&t.isNativeAppWebview&&((b=new URL(y.url)).searchParams.set("source","embedded"),y.url=b.toString()),rv(y,this.instanceId),e.abrupt("return");case 49:case"end":return e.stop()}var i}),e,this,[[15,28]])}))),function(e){return t.apply(this,arguments)})},{key:"getServiceProvider",value:function(){return xf.getInstance(this.instanceId)}},{key:"getBizFlowBehavior",value:function(){return this.bizFlowStartBehavior}},{key:"getPaymentContext",value:function(){return this.paymentContext}},{key:"destroy",value:function(){this.cleanRender(!0)}},{key:"handleBehaviorRender",value:function(){var e=this,t=xf.getInstance(this.instanceId).getService("EventCenter"),n=xf.getInstance(this.instanceId).getService("Container"),r=this.paymentContext.displayInfo.type,o=this.paymentContext.displayInfo.platform,i=this.bizFlowStartBehavior.payload,a=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r!==F.inline&&(e.paymentContext.displayInfo.isRetention?Mm():e.handleClose(t,"behavior"))};t.listen(ve.close.name,(function(){a(!0)})),t.listen(ve.setAllowRetention.name,(function(t){void 0!==t&&"boolean"==typeof t&&(e.paymentContext.displayInfo.isRetention=t)})),t.listen(ve.declareCheckoutInfo.name,(function(e){!function(e){try{if(e){var t,n,r,o=document.getElementById("".concat(Se,"-title"));o&&(o.style.fontSize="".concat(null==e||null===(t=e.title)||void 0===t?void 0:t.fontSize,"px"),o.style.color=null==e||null===(n=e.title)||void 0===n?void 0:n.fontColor,o.innerHTML=null==e||null===(r=e.title)||void 0===r?void 0:r.text);var i,a,s,l=document.getElementById("".concat(Se,"-sub-title"));l&&(l.style.fontSize="".concat(null==e||null===(i=e.message)||void 0===i?void 0:i.fontSize,"px"),l.style.color=null==e||null===(a=e.message)||void 0===a?void 0:a.fontColor,l.innerHTML=null==e||null===(s=e.message)||void 0===s?void 0:s.text);var c,u,d,p,h,m,f,v=document.getElementById("".concat(Se,"-remain"));v&&(v.innerHTML=null==e||null===(c=e.btnOK)||void 0===c?void 0:c.text,v.style.fontSize="".concat(null==e||null===(u=e.btnOK)||void 0===u?void 0:u.fontSize,"px"),v.style.color=null==e||null===(d=e.btnOK)||void 0===d?void 0:d.fontColor,v.style.borderRadius="".concat(null==e||null===(p=e.btnOK)||void 0===p?void 0:p.corner,"px"),"stroke"===(null==e||null===(h=e.btnOK)||void 0===h?void 0:h.type)?v.style.border="1px solid ".concat(null==e||null===(f=e.btnOK)||void 0===f?void 0:f.bg):v.style.backgroundColor=null==e||null===(m=e.btnOK)||void 0===m?void 0:m.bg);var g,y,_,E,b,A,S,k=document.getElementById("".concat(Se,"-leave"));k&&(k.innerHTML=null==e||null===(g=e.btnCancel)||void 0===g?void 0:g.text,k.style.fontSize="".concat(null==e||null===(y=e.btnCancel)||void 0===y?void 0:y.fontSize,"px"),k.style.color=null==e||null===(_=e.btnCancel)||void 0===_?void 0:_.fontColor,k.style.borderRadius="".concat(null==e||null===(E=e.btnCancel)||void 0===E?void 0:E.corner,"px"),"stroke"===(null==e||null===(b=e.btnCancel)||void 0===b?void 0:b.type)?k.style.border="1px solid ".concat(null==e||null===(S=e.btnCancel)||void 0===S?void 0:S.bg):k.style.backgroundColor=null==e||null===(A=e.btnCancel)||void 0===A?void 0:A.bg)}}catch(e){console.error(e)}}(null==e?void 0:e.closeDialogData)}));var s=n.load(this.paymentContext.displayInfo,i.url,a);return r===F.inline?(n.showLoading(s,this.paymentContext.displayInfo),void Bm()):r==F.popup?(function(e,t,n){var r=e===te.mobile?"touchend":"click",o=document.createElement("div");o.id=Se,o.classList.add("".concat(Se,"-").concat(e)),o.innerHTML='\n <span id="'.concat(Se,'-title" class="').concat(Se,"-title-").concat(e,'">\n Are you sure you want to leave?\n </span>\n <span\n id="').concat(Se,'-sub-title"\n class="').concat(Se,"-sub-title-").concat(e,'"\n >\n If you leave this page, you\'ll have to start over again.\n </span>\n <div class="').concat(Se,"-btn-block-").concat(e,'">\n <div id="').concat(Se,'-remain" class="').concat(Se,"-remain-").concat(e,'">\n Continue Payment\n </div>\n <div id="').concat(Se,'-leave" class="').concat(Se,"-leave-").concat(e,'">\n Leave\n </div>\n </div>'),document.body.appendChild(o);var i=document.getElementById("".concat(Se,"-remain"));i&&i.addEventListener(r,t);var a=document.getElementById("".concat(Se,"-leave"));a&&a.addEventListener(r,n)}(o,(function(){Rm(),e.handleRemain()}),(function(){Rm(),e.handleClose(!1,"retention")})),Lm({platform:o,onClickOutside:i.allowClickPopupOutsideClose?a:void 0,closeBtnFunc:a}),void n.showLoading(s,this.paymentContext.displayInfo)):void 0}},{key:"handleRemain",value:function(){var e,t,n,r;this.eventLogging&&this.eventLogging.enableLogging&&this.logger.logInfo({code:(null===(e=this.eventLogging)||void 0===e?void 0:e.eventName)||""},{eventId:he.ContinuePaying,eventName:(null===(t=this.eventLogging)||void 0===t?void 0:t.eventName)||"",eventAlias:(null===(n=this.eventLogging)||void 0===n?void 0:n.eventAlias)||"",userPath:(null===(r=this.eventLogging)||void 0===r?void 0:r.userPath)||""})}},{key:"handleClose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,n=xf.getInstance(this.instanceId).getService("EventCenter");if(n.emit(ve.closeCallback.name,{}),this.enablePopWindowEventCallback&&!e){var r,o,i,a;if(this.eventLogging&&this.eventLogging.enableLogging)this.logger.logInfo({code:(null===(r=this.eventLogging)||void 0===r?void 0:r.eventName)||""},{eventId:"behavior"===t?he.OnlyClose:he.LeaveAnyWay,eventName:(null===(o=this.eventLogging)||void 0===o?void 0:o.eventName)||"",eventAlias:(null===(i=this.eventLogging)||void 0===i?void 0:i.eventAlias)||"",userPath:(null===(a=this.eventLogging)||void 0===a?void 0:a.userPath)||""});n.emit(ve.eventCallback.name,{code:ae.SDK_PAYMENT_CANCEL,result:{result:{}}})}this.cleanRender()}},{key:"cleanRender",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=xf.getInstance(this.instanceId).getService("Container"),i=function(){var e;o.cleanContainer(null===(e=n.paymentContext)||void 0===e?void 0:e.displayInfo),Um(),Dm()};null===(e=document.getElementById(Ae))||void 0===e||e.remove(),null===(t=document.getElementById(Te))||void 0===t||t.remove(),o.startHideAnim(),xm(),r?i():(setTimeout((function(){i()}),300),this.logger.logInfo({title:"sdk_event_destroyComponent"}))}},{key:"getInstanceId",value:function(){return this.instanceId}}]),e}(),uv=function(){function e(){g()(this,e)}return f()(e,[{key:"init",value:function(e,t){return null}},{key:"startBizFlow",value:function(){return null}}]),e}(),dv=function(e){return e.UNINIT="UNINIT",e.INITING="INITING",e.READY="READY",e.IN_BIZ_FLOW="IN_BIZ_FLOW",e.DESTROYED="DESTROYED",e}({}),pv=function(){function e(t){var n,r,o=t.type,i=t.instanceId,a=t.selector,s=t.processor,l=t.options;g()(this,e),c()(this,"containerStatus",void 0),c()(this,"instanceId",void 0),c()(this,"containerService",void 0),c()(this,"eventService",void 0),c()(this,"containerElement",void 0),c()(this,"_globalData",void 0),this._globalData=new Map,this.switchContainerStatus(dv.INITING),this.instanceId="".concat(i,"-").concat(o),this.containerService=xf.getInstance(this.instanceId).getService("Container"),xf.getInstance(this.instanceId).init({},{productScene:V.ELEMENT_PAYMENT,sdkVersion:"",webAppVersion:""});var u=null!=l&&null!==(n=l.debugProps)&&void 0!==n&&n.isDebug&&(null==l||null===(r=l.debugProps)||void 0===r?void 0:r.localLink)||"";this.containerElement=this.containerService.load({type:F.inline,platform:Jm()||Qm()?te.desktop:te.mobile,isRetention:!1,selector:a,appendAliasContainerId:!0,iframeStyle:{display:"block",colorScheme:Oe}},s.generateIframeSrc({link:u,instanceId:this.instanceId})),this.eventService=xf.getInstance(this.instanceId).getService("EventCenter"),this.addEventListener()}return f()(e,[{key:"addEventListener",value:function(){var e=this;this.eventService.listen(ve.setGlobalData.name,(function(t){e._globalData.set(null==t?void 0:t.dataKey,null==t?void 0:t.data)})),this.eventService.listen(ve.getGlobalData.name,(function(t,n){var r=n.context;if(null!=r&&r.eventCallbackId){var o,i=e._globalData.get(null===(o=r.data)||void 0===o?void 0:o.dataKey);e.eventService.dispatchToApp({event:"appEventCallback",eventCallbackId:null==r?void 0:r.eventCallbackId,data:i})}}))}},{key:"getContainerElement",value:function(){return this.containerElement}},{key:"createWebLaunchPromise",value:function(){var e=this;return new Promise((function(t){e.eventService.listen("onLaunch",(function(e){t(e)}))}))}},{key:"switchContainerStatus",value:function(e){this.containerStatus=e}},{key:"getContainerStatus",value:function(){return this.containerStatus}},{key:"getEventService",value:function(){return this.eventService}},{key:"destroy",value:function(){this.eventService.destroy(),this.containerElement.remove()}},{key:"getContainerService",value:function(){return this.containerService}},{key:"getInstanceId",value:function(){return this.instanceId}}]),e}(),hv=function(){function e(t){var n=t.instanceId;g()(this,e),c()(this,"containerServices",void 0),c()(this,"instanceId",void 0),this.containerServices=new Map,this.instanceId=n}return f()(e,[{key:"addContainerService",value:function(e,t){this.containerServices.set(e,t)}},{key:"getContainerService",value:function(e){return this.containerServices.get(e)}},{key:"getContainerServices",value:function(){return this.containerServices}},{key:"destroy",value:function(){this.containerServices.forEach((function(e){e.destroy()})),this.containerServices=new Map}},{key:"mount",value:function(e){var t=e.type,n=e.selector,r=e.processor,o=e.options;this.addContainerService(t,new pv({type:t,instanceId:this.instanceId,selector:n,processor:r,options:o}))}},{key:"getEventService",value:function(e){return this.getContainerService(e).getEventService()}}]),e}(),mv=function(){function e(t){var n=t.logger;g()(this,e),c()(this,"activeEvents",new Map),c()(this,"heartbeatIntervalId",null),c()(this,"HEARTBEAT_INTERVAL",5e3),c()(this,"uniqueId",0),c()(this,"logger",void 0),this.logger=n}return f()(e,[{key:"registerEvent",value:function(e,t){var n=this.buildId(e,"start"),r=this.getEventName(e,"start");return this.activeEvents.set(n,Date.now()),this.startHeartbeat(),this.sendLog(r,{eventName:n,sessionData:t}),n}},{key:"endEvent",value:function(e,t){if(this.activeEvents.has(e)){var n=this.activeEvents.get(e);this.activeEvents.delete(e);var r=this.getEventNameFromStart(e,"end");this.sendLog(r,h()({eventName:this.buildIdFromStart(e,"end"),startTime:n,endTime:Date.now()},t||{})),t&&"object"!==at(t)&&this.sendLog("data_error",{msg:Zm(t)}),0===this.activeEvents.size&&this.stopHeartbeat()}}},{key:"cancelEvent",value:function(e,t){if(this.activeEvents.has(e)){var n=this.activeEvents.get(e);this.activeEvents.delete(e);var r=this.getEventNameFromStart(e,"end");this.sendLog(r,h()({eventName:this.buildIdFromStart(e,"end"),startTime:n,endTime:Date.now(),canceled:!0},t||{})),0===this.activeEvents.size&&this.stopHeartbeat()}}},{key:"cancelByPrefix",value:function(e,t){var n=this;Array.from(this.activeEvents.keys()).filter((function(t){return t.startsWith(e)})).forEach((function(e){return n.cancelEvent(e,t)}))}},{key:"startHeartbeat",value:function(){var e=this;this.heartbeatIntervalId||(this.heartbeatIntervalId=setInterval((function(){0!==e.activeEvents.size?e.sendHeartbeat():e.stopHeartbeat()}),this.HEARTBEAT_INTERVAL))}},{key:"stopHeartbeat",value:function(){null!==this.heartbeatIntervalId&&(clearInterval(this.heartbeatIntervalId),this.heartbeatIntervalId=null)}},{key:"sendHeartbeat",value:function(){var e=Array.from(this.activeEvents.entries()).map((function(e){var t=tt()(e,2);return{eventName:t[0],startTime:t[1]}}));this.sendLog("heart_beat",{actionNames:Zm(e)})}},{key:"sendLog",value:function(e,t){var n=c()(c()(c()(c()(c()(c()(c()(c()(c()(c()({},"".concat(B.MOUNT,"_start"),"sdk_event_mount"),"".concat(B.MOUNT,"_end"),"sdk_event_mount_end"),"".concat(B.SUBMITPAYMENT,"_start"),"sdk_event_submitPay"),"".concat(B.SUBMITPAYMENT,"_end"),"sdk_event_payment_end"),"".concat(B.VALIDATAFIELDS,"_start"),"sdk_event_validateFields"),"".concat(B.VALIDATAFIELDS,"_end"),"sdk_event_validateFields_end"),"".concat(B.DESTORY,"_start"),"sdk_event_apiOnDestroy"),"".concat(B.DESTORY,"_end"),"sdk_event_apiOnDestroy_end"),"heart_beat","sdk_element_handleHeartBeat"),"data_error","sdk_element_callback_error")[e];n&&this.logger.logInfo({title:n},h()({actionName:e},t))}},{key:"buildId",value:function(e,t){return"".concat(e,"_").concat(++this.uniqueId,"_").concat(t)}},{key:"getEventName",value:function(e,t){return"".concat(e,"_").concat(t)}},{key:"buildIdFromStart",value:function(e,t){return e.replace(/_start$/,"_".concat(t))}},{key:"getEventNameFromStart",value:function(e,t){return e.replace(/_.+_/i,"_").replace(/_start$/,"_".concat(t))}}]),e}(),fv=["type"],vv=function(){function e(t){g()(this,e),c()(this,"options",void 0),c()(this,"elementContainer",void 0),c()(this,"serviceMap",void 0),c()(this,"loading",void 0),c()(this,"elementProcessors",void 0),c()(this,"initTimeout",void 0),c()(this,"elementContainerService",void 0),c()(this,"onStatusChangeCallback",void 0),c()(this,"submitPayPromise",void 0),c()(this,"elementEventCenter",void 0),c()(this,"currentPaymentMethodType",""),c()(this,"onValidateFunc",(function(e,t){return new Promise((function(n){e.emitAndListen({event:w.VALIDATE,data:{params:{},target:t,source:N.CONTAINER_ELEMENT}},(function(e){n(e)}))}))})),c()(this,"onValidateAndSubmitPay",(function(e,t,n){return new Promise((function(r){e.emitAndListen({event:w.SUBMIT_PAY,data:{params:h()(h()({},n),{},{doMain:window.location.hostname}),target:t,source:N.CONTAINER_ELEMENT}},(function(e){r(e)}))}))})),this.options=t;var n=t;this.onStatusChangeCallback=null==n?void 0:n.onStatusChangeCallback,this.elementContainer=new cv,this.elementContainer.registerProcessor(V.ELEMENT_PAYMENT,"",new uv),this.elementContainer.init(this.options,V.ELEMENT_PAYMENT),this.initService(),this.elementContainerService=new hv({instanceId:this.elementContainer.getInstanceId()}),this.setControllerStatusOrView(Gm.READY),this.elementEventCenter=new mv({logger:this.elementContainer.getServiceProvider().getService("Log")})}var t,n,r,o;return f()(e,[{key:"initService",value:function(){this.serviceMap={Log:this.elementContainer.getServiceProvider().getService("Log"),EventCenter:this.elementContainer.getServiceProvider().getService("EventCenter"),Requester:this.elementContainer.getServiceProvider().getService("Requester")}}},{key:"initElementProcessors",value:function(e){var t={auth:new rf(this.options),address:new tf(this.options),payment:new Wf(this.options)};this.elementProcessors=h()(h()({},this.elementProcessors),{},c()({},e,t[e])),this.elementProcessors[e].registerElementContainer(this.elementContainer)}},{key:"onEventCallback",value:function(e){var t,n,r=e.code,o=e.message,i=void 0===o?"":o,a=e.result,s=void 0===a?void 0:a;this.serviceMap.Log.logInfo({title:"sdk_event_event_callback"},{eventCode:Zm(r||""),eventMessage:Zm(i||"")}),null==this||null===(t=this.options)||void 0===t||null===(n=t.onEventCallback)||void 0===n||n.call(t,{code:r,message:i,result:s})}},{key:"handleInitializationError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:me.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR;this.changeLoading(!1),this.setControllerStatusOrView(Gm.READY),this.onEventCallback(e),this.elementContainerService.getContainerServices().forEach((function(e){e.getContainerElement().remove()})),this.elementContainerService.destroy()}},{key:"handleMountError",value:function(e){var t=e.result,n=e.resolve,r=t.errorMsg,o=t.error;this.onEventCallback({code:x.SDK_CREATE_COMPONENT_ERROR,message:r}),n({error:o})}},{key:"clearAndSetInitTimeout",value:function(e){clearTimeout(this.initTimeout),this.initTimeout=null,this.initTimeout=this.setInitTimeout(e)}},{key:"clearInitTimeout",value:function(){clearTimeout(this.initTimeout),this.initTimeout=null}},{key:"clearEvents",value:function(e){var t,n;null===(t=(n=this.elementEventCenter).cancelByPrefix)||void 0===t||t.call(n,"mount",{msg:e})}},{key:"setInitTimeout",value:function(e){var t=this;return setTimeout((function(){clearTimeout(t.initTimeout),t.initTimeout=null,t.handleInitializationError(me.SDK_LAUNCH_PAYMENT_APP_ERROR.LOAD_APP_TIME_OUT),t.serviceMap.Log.logInfo({title:"sdk_event_web_app_timeout"}),e({error:me.INITIALIZE_TIMEOUT.WEB})}),16e3)}},{key:"initializeAndMountProcessor",value:function(e,t,n){var r,o,i;this.initElementProcessors(e),this.elementContainerService.mount({type:e,selector:t,processor:this.elementProcessors[e],options:n}),this.elementProcessors[e].registerEventCenter(this.elementContainerService.getEventService(e));var a=this.elementContainerService.getContainerService(e).getInstanceId(),s=this.elementContainer.getPaymentContext();xf.getInstance(a).update(s),this.serviceMap.Log=xf.getInstance(a).getService("Log"),null===(r=this.serviceMap.Log)||void 0===r||r.logInfo({title:"sdk_event_appearance"},{variables:!(null==n||null===(o=n.appearance)||void 0===o||!o.variables),theme:(null==n||null===(i=n.appearance)||void 0===i?void 0:i.theme)||D.Default}),this.elementProcessors[e].beforeMount()}},{key:"handleStartBizFlowError",value:function(e,t){t({error:h()(h()({},me.PARAM_INVALID),{},{context:JSON.stringify(e)})}),this.onEventCallback({code:x.SDK_CREATEPAYMENT_PARAMETER_ERROR,message:(null==e?void 0:e.message)||"Initialization parameter exception."}),clearTimeout(this.initTimeout),this.initTimeout=null,this.changeLoading(!1)}},{key:"mount",value:function(e,t){var n=this,r=on(this.options.sessionData).id,o=this.elementEventCenter.registerEvent(B.MOUNT,r);return new Promise((function(r){var i=function(e){var t=e.sdkSelector,n=e.containerService,r=e.status;return document.querySelector(t)?r===Gm.DESTROYED?{success:!1,errorMsg:"Creating components in the destroyed state is forbidden.",error:{code:me.UI_STATE_ERROR.code,message:"Creating components in the destroyed state is forbidden."}}:r===Gm.READY?{success:!0}:n?{success:!1,errorMsg:"SDK status error.",error:{code:me.UI_STATE_ERROR.code,message:"SDK status error."}}:{success:!0}:(console.error("Element with selector ".concat(t," not found.")),{success:!1,errorMsg:"Element with selector ".concat(t," not found."),error:{code:me.PARAM_INVALID.code,message:"Element with selector ".concat(t," not found.")}})}({sdkSelector:t,status:n.elementContainer.getStatus(),containerService:n.elementContainerService.getContainerService(e.type)}),a=function(e){n.elementEventCenter.endEvent(o,{msg:Zm(e)}),r(h()({},e||{}))};if(i.success){n.clearAndSetInitTimeout(a),n.changeLoading(!0);try{var s={paymentSession:n.options.sessionData,displayInfo:h()(h()({},e),{},{appendAliasContainerId:!0})};n.setControllerStatusOrView(Gm.IN_BIZ_FLOW),n.elementContainer.startBizFlow(s),n.initializeAndMountProcessor(e.type,t,e),n.sendRequestAndWaitWebLaunch(e,a),n.addEventListener(a),n.serviceMap.EventCenter.addIFrame(n.elementContainerService.getContainerService(e.type).getContainerService().getWebApp())}catch(e){n.handleStartBizFlowError(e,a)}}else n.handleMountError({result:i,resolve:a})}))}},{key:"validateFields",value:(o=s()(i()().mark((function e(){var t,n,r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.elementEventCenter.registerEvent(B.VALIDATAFIELDS),n={isValid:!1},e.prev=2,!this.initTimeout&&null!==(r=this.elementProcessors)&&void 0!==r&&r[O.payment]){e.next=5;break}return e.abrupt("return",n);case 5:return e.next=7,this.onValidateFunc(this.elementProcessors[O.payment].eventCenter,N.PAYMENT_ELEMENT);case 7:return a=e.sent,n=null!==(o=a.data)&&void 0!==o?o:{isValid:!1},e.abrupt("return",n);case 12:return e.prev=12,e.t0=e.catch(2),e.abrupt("return",n);case 15:return e.prev=15,this.elementEventCenter.endEvent(t,n),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[2,12,15,18]])}))),function(){return o.apply(this,arguments)})},{key:"submitPayment",value:(r=s()(i()().mark((function e(t){var n,r,o,a,l,c,u,d,p,m,f,v,g,y,_,E=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.elementEventCenter.registerEvent(B.SUBMITPAYMENT),this.elementContainer.getStatus()===Gm.IN_BIZ_FLOW){e.next=6;break}return r={error:h()(h()({},me.UI_STATE_ERROR),{},{needChangeSessionForRetry:!1}),status:R.FAIL},o={eventCode:R.FAIL,errorName:me.UI_STATE_ERROR.code,needChangeSessionForRetry:!1,msg:Zm(r)},this.elementEventCenter.endEvent(n,o),e.abrupt("return",Promise.resolve(r));case 6:if(this.changeLoading(!0),a="APPLEPAY"===this.currentPaymentMethodType,l=this.currentPaymentMethodType||"UNKNOWN",null==t||!t.onBeforeConfirm||a){e.next=40;break}return this.serviceMap.Log.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:l,path:"nonApplePay_sync"}),e.prev=11,c=Date.now(),e.next=15,qa((function(){return t.onBeforeConfirm()}));case 15:if(u=e.sent,d=u.result,!(u.timedOut||Date.now()-c>=Va)){e.next=24;break}return this.serviceMap.Log.logError({title:"sdk_before_confirm_timeout"},{paymentMethodType:l,path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:R.FAIL,errorName:za}),e.abrupt("return",{status:R.FAIL,error:{code:za,message:"Merchant confirmation timed out.",needChangeSessionForRetry:!1}});case 24:if(d){e.next=29;break}return this.serviceMap.Log.logInfo({title:"sdk_before_confirm_abort"},{paymentMethodType:l,path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:R.FAIL,errorName:Ga}),e.abrupt("return",{status:R.FAIL,error:{code:Ga,message:"Payment was cancelled by merchant before confirmation.",needChangeSessionForRetry:!1}});case 29:this.serviceMap.Log.logInfo({title:"sdk_before_confirm_success"},{paymentMethodType:l,path:"nonApplePay_sync"}),e.next=38;break;case 32:return e.prev=32,e.t0=e.catch(11),this.serviceMap.Log.logError({title:"sdk_before_confirm_error"},{paymentMethodType:l,errorMessage:String((null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0).slice(0,200),path:"nonApplePay_sync"}),this.changeLoading(!1),this.elementEventCenter.endEvent(n,{eventCode:R.FAIL,errorName:Ga}),e.abrupt("return",{status:R.FAIL,error:{code:Ga,message:"Payment was cancelled by merchant before confirmation.",needChangeSessionForRetry:!1}});case 38:e.next=41;break;case 40:null!=t&&t.onBeforeConfirm||this.serviceMap.Log.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:l,path:a?"applePay_eventBridge":"nonApplePay_sync"});case 41:return p=null,e.prev=42,e.next=45,new Promise(function(){var e=s()(i()().mark((function e(n){var r,o,l,c,u,d,m,f,v,g,y;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=function(e){if(e instanceof Object){var t,o,i,a=void 0===(null==e||null===(t=e.error)||void 0===t?void 0:t.needChangeSessionForRetry)?null===(o=r.elementProcessors[O.payment])||void 0===o||null===(o=o.obtainDataRes)||void 0===o||null===(o=o.originActionQueryResult)||void 0===o?void 0:o.notSupportRetryPayForSameSession:null==e||null===(i=e.error)||void 0===i?void 0:i.needChangeSessionForRetry;null!=e&&e.error&&(e.error.needChangeSessionForRetry=a)}n(p=e)},r=E,e.prev=2,E.submitPayPromise=o,l={},c=function(){var e=s()(i()().mark((function e(t,n){var r,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E.elementProcessors[t]){e.next=2;break}return e.abrupt("return",!0);case 2:return e.next=4,E.onValidateAndSubmitPay(E.elementProcessors[t].eventCenter,n);case 4:if(r=e.sent,a=r.data,l.shipping=null==a?void 0:a.data,null!=a&&a.success){e.next=11;break}return o(p=a),e.abrupt("return",!1);case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),e.next=8,c(O.auth,N.AUTH_ELEMENT);case 8:if(e.sent){e.next=10;break}return e.abrupt("return");case 10:return e.next=12,c(O.address,N.ADDRESS_ELEMENT);case 12:if(e.sent){e.next=14;break}return e.abrupt("return");case 14:if(!E.elementProcessors[O.payment]){e.next=28;break}return u=a&&!(null==t||!t.onBeforeConfirm),E.serviceMap.Log.logInfo({title:"sdk_element_submitPayment_setBeforeConfirm"},{msg:Zm({hasBeforeConfirmForApplePay:u,isApplePay:a,amount:"".concat(null==t?void 0:t.amount,", ").concat(null==t?void 0:t.currency)})}),E.elementProcessors[O.payment].setOnBeforeConfirm(u?t.onBeforeConfirm:null),d=!(null==t||!t.amount),m=!(null==t||!t.currency),!d&&!m||d&&m||E.serviceMap.Log.logError({title:"sdk_element_submitPayment_amountCurrencyMismatch"},{msg:Zm({amount:null==t?void 0:t.amount,currency:null==t?void 0:t.currency,reason:"amount and currency must be provided together, both ignored"})}),E.elementProcessors[O.payment].setMerchantAmountOverride(d&&m?t.amount:null,d&&m?t.currency:null),e.next=24,E.onValidateAndSubmitPay(E.elementProcessors[O.payment].eventCenter,N.PAYMENT_ELEMENT,(_=void 0,h()(h()(h()({},l),{},{handleActions:null===(_=null==t?void 0:t.handleActions)||void 0===_||_,shipping:null==t?void 0:t.shippingInfo},d&&m?{amount:t.amount,currency:t.currency}:{}),{},{hasBeforeConfirm:u})));case 24:f=e.sent,v=f.data,o(p=v);case 28:e.next=37;break;case 30:e.prev=30,e.t0=e.catch(2),g=JSON.stringify(e.t0,Object.getOwnPropertyNames(e.t0)),y={error:h()(h()({},me.ERR_DATA_STRUCT_UNRECOGNIZED),{},{context:g}),status:R.FAIL},E.serviceMap.Log.logError({title:La.sdk_element_missKeyData},{msg:JSON.stringify(y)}),p=y,o(y);case 37:case"end":return e.stop()}var _}),e,null,[[2,30]])})));return function(t){return e.apply(this,arguments)}}());case 45:return e.abrupt("return",e.sent);case 46:return e.prev=46,_={eventCode:null===(m=p)||void 0===m?void 0:m.status,errorName:null===(f=p)||void 0===f||null===(f=f.error)||void 0===f?void 0:f.code,errormessage:null===(v=p)||void 0===v||null===(v=v.error)||void 0===v?void 0:v.message,needChangeSessionForRetry:null===(g=p)||void 0===g||null===(g=g.error)||void 0===g?void 0:g.needChangeSessionForRetry,rpcTraceId:null===(y=p)||void 0===y||null===(y=y.error)||void 0===y?void 0:y.traceId,msg:Zm(p)},this.elementEventCenter.endEvent(n,_),this.changeLoading(!1),e.finish(46);case 51:case"end":return e.stop()}}),e,this,[[11,32],[42,,46,51]])}))),function(e){return r.apply(this,arguments)})},{key:"changeLoading",value:function(e){if(e){var t,n,r;if(null!==(t=this.options.loading)&&void 0!==t&&t.onStartLoading&&!this.loading)this.loading=!0,null===(n=this.options.loading)||void 0===n||null===(r=n.onStartLoading)||void 0===r||r.call(n)}else{var o,i,a;if(null!==(o=this.options.loading)&&void 0!==o&&o.onEndLoading&&this.loading)null===(i=this.options.loading)||void 0===i||null===(a=i.onEndLoading)||void 0===a||a.call(i);this.loading=!1}}},{key:"addEventListener",value:function(e){var t=this;this.serviceMap.EventCenter.listen(w.ON_EVENT_CALLBACK,(function(e){var n;null===(n=t.onEventCallback)||void 0===n||n.call(t,e)})),this.serviceMap.EventCenter.listen(ve.sizeChanged.name,(function(n){clearTimeout(t.initTimeout),t.initTimeout=null,t.elementContainerService.getContainerService(n.source)&&(e(),t.elementContainerService.getContainerService(n.source).switchContainerStatus(dv.IN_BIZ_FLOW)),t.changeLoading(!1)})),this.serviceMap.EventCenter.listen(ve.redirect.name,(function(e){!function(e){var t,n,r,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;console.log("local payment sdk new element redirect arg ----",this);var a="string"==typeof e?{normalUrl:e}:h()(h()({},e),{},{applinkUrl:(null==e?void 0:e.applinkUrl)||"",schemeUrl:(null==e?void 0:e.schemeUrl)||"",normalUrl:(null==e?void 0:e.normalUrl)||"",target:null==e?void 0:e.target,isDestroy:null===(t=null==e?void 0:e.isDestroy)||void 0===t||t,isCallApp:null!==(n=null==e?void 0:e.isCallApp)&&void 0!==n&&n,callAppDetectSuccessDelay:null!==(r=null==e?void 0:e.callAppDetectSuccessDelay)&&void 0!==r?r:2e3}),s=function(e,t,n){i({code:ae.SDK_CALL_URL_SUCCESS,message:"Successfully opened the app,".concat(e,": ").concat(t)});var r={redirectInfo:JSON.stringify(a),openType:e,url:t,fromFastSdk:o};n&&(r.durationInSeconds=n)},l=function(e,t,n){i({code:ae.SDK_LAUNCH_PAYMENT_APP_ERROR,message:"Failed to open app,applinkUrl: ".concat(null==a?void 0:a.applinkUrl," schemeUrl: ").concat(null==a?void 0:a.schemeUrl," normalUrl: ").concat(null==a?void 0:a.normalUrl)});var r={redirectInfo:JSON.stringify(a),openType:e,url:t,fromFastSdk:o};n&&(r.durationInSeconds=n)};if(a.target===re.BLANK)return a.normalUrl?(s(se.NormalUrl,a.normalUrl),void window.open(a.normalUrl)):l(se.NormalUrl,"");if(!(a.target!==re.REPLACE||null!=a&&a.applinkUrl||null!=a&&a.schemeUrl))return a.normalUrl?(s(se.NormalUrl,a.normalUrl),void window.location.replace(a.normalUrl)):l(se.NormalUrl,"");if(null!=a&&a.isCallApp&&null!=a&&a.schemeUrl){var c=new Date,u="number"==typeof(null==e?void 0:e.callAppDetectSuccessDelay)?e.callAppDetectSuccessDelay:5e3;qm({schemeUrl:null==a?void 0:a.schemeUrl,callAppJudgeTime:u}).then((function(){var e=((new Date).getTime()-c.getTime())/1e3;s(se.SchemeUrl,null==a?void 0:a.schemeUrl,e)})).catch((function(){var e=((new Date).getTime()-c.getTime())/1e3;l(se.SchemeUrl,a.schemeUrl,e)}))}else qm({applinkUrl:null==a?void 0:a.applinkUrl,schemeUrl:null==a?void 0:a.schemeUrl,normalUrl:null==a?void 0:a.normalUrl}).then((function(){s(se.NormalUrl,null==a?void 0:a.normalUrl)})).catch((function(){l(se.NormalUrl,null==a?void 0:a.normalUrl)}))}(e,!1,t.onEventCallback.bind(t))})),this.serviceMap.EventCenter.listen(ve.destroy.name,(function(){t.changeLoading(!1),t.setControllerStatusOrView(Gm.READY),t.destroyHandle()})),this.serviceMap.EventCenter.listen(ve.webAppReady.name,(function(n){clearTimeout(t.initTimeout),t.initTimeout=null,t.elementContainerService.getContainerService(n.source)&&(e(),t.elementContainerService.getContainerService(n.source).switchContainerStatus(dv.IN_BIZ_FLOW)),t.changeLoading(!1)})),this.serviceMap.EventCenter.listen(ve.showToast.name,(function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=document.createElement(e);return Object.keys(t).forEach((function(e){"style"===e?Object.keys(t[e]).forEach((function(n){r.style[n]=t[e][n]})):r.setAttribute(e,t[e])})),"string"==typeof n&&(r.textContent=n),r},r={position:"bottom-right",backgroundColor:"rgba(0, 0, 0, 0.80)",color:"#ffffff",padding:"20px 16px",borderRadius:"8px",fontSize:"14px",zIndex:9999,width:"148px",duration:2e3},o={SUCCESS:"https://cdn.marmot-cloud.com/storage/2024/07/10/10b191d6-0b0a-4bd9-96cc-310b7f2a8530.svg",FAIL:"https://cdn.marmot-cloud.com/storage/2024/11/08/4ae27343-61d2-4a07-b323-c951c7711b40.svg"},i=h()(h()({},r),e),a=document.getElementById("antom_toast-container");switch(a?a.innerHTML="":(a=n("div",{style:{position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none"},id:"antom_toast-container"}),document.body.appendChild(a)),i.position){case"top-left":a.style.top="20px",a.style.left="20px";break;case"top-right":a.style.top="20px",a.style.right="20px";break;case"bottom-left":a.style.bottom="20px",a.style.left="20px";break;default:a.style.bottom="0",a.style.right="0",a.style.top="0",a.style.left="0"}var s=n("div",{style:{backgroundColor:i.backgroundColor,color:i.color,padding:i.padding,borderRadius:i.borderRadius,fontSize:i.fontSize,opacity:"0",transition:"opacity 0.3s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",width:i.width,boxSizing:"border-box"}});if(i.icon){var l=n("img",{style:{width:"40px",height:"40px"},src:i.icon?o[i.icon]:""});s.appendChild(l)}var c=n("span",{style:{textAlign:"center",marginTop:"12px",lineHeight:"20px",fontFamily:"Noto Sans",fontWeight:400,fontSize:"14px"}},i.message);s.appendChild(c),a.appendChild(s),setTimeout((function(){s.style.opacity="1"}),10),setTimeout((function(){s.style.opacity="0",setTimeout((function(){var e;null===(e=a)||void 0===e||e.remove(),t&&t()}),300)}),i.duration)}(e)})),this.serviceMap.EventCenter.listen(ve.messageForward.name,(function(e){var n=M[e.source],r=M[e.target];t.elementProcessors[n]&&t.elementProcessors[r]&&t.elementProcessors[r].eventCenter.dispatchToApp({event:e.event,data:e})})),this.serviceMap.EventCenter.listen(ve.submitPromiseCallback.name,(function(e){var n;null===(n=t.submitPayPromise)||void 0===n||n.call(t,e)})),this.serviceMap.EventCenter.listen(Y.PAYMENTMETHODCHANGED,(function(e){t.currentPaymentMethodType=(null==e?void 0:e.type)||""}),!0)}},{key:"sendRequestAndWaitWebLaunch",value:(n=s()(i()().mark((function e(t,n){var r,o,a,s,l,c,u,d=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.type,o=fc()(t,fv),e.prev=1,a=this.elementContainerService.getContainerService(r)){e.next=7;break}return this.handleInitializationError(me.SDK_LAUNCH_PAYMENT_APP_ERROR.CONTAINER_NOT_EXIST),n({error:me.UI_STATE_ERROR}),e.abrupt("return");case 7:return e.next=9,Promise.all([a.createWebLaunchPromise(),this.elementProcessors[r].obtainData()]);case 9:s=e.sent,(l=tt()(s,2))[0],c=l[1],this.serviceMap.Log.logInfo({title:"sdk_event_webAppOnLaunch"}),null==a||a.switchContainerStatus(dv.READY),(u=this.getErrorFromResponse(c))&&n(u),this.areAllContainersReady()&&this.elementContainerService.getContainerServices().forEach((function(e,t){d.sendReady(t,o)})),e.next=26;break;case 20:e.prev=20,e.t0=e.catch(1),this.handleInitializationError(),this.clearInitTimeout(),this.clearEvents("webLaunch"),n({error:h()(h()({},me.INITIALIZE_TIMEOUT.API),{},{traceId:null===e.t0||void 0===e.t0?void 0:e.t0.traceId})});case 26:case"end":return e.stop()}}),e,this,[[1,20]])}))),function(e,t){return n.apply(this,arguments)})},{key:"getErrorFromResponse",value:function(e){if(s=null==e?void 0:e.originActionQueryResult,l=s.success,c=s.paymentMethods,u=s.savedPaymentMethods,d=s.orderAmountView,p=s.paymentAmountView,m=c&&Array.isArray(c)&&c.length>0||u&&Array.isArray(u)&&u.length>0,!(l&&m&&d&&p)){var t,n=e.originActionQueryResult,r=n.traceId,o=n.errorCode,i=n.errorMessage,a={code:o,message:i||me.ERR_DATA_STRUCT_UNRECOGNIZED.message};if(o||(a=h()({},me.ERR_DATA_STRUCT_UNRECOGNIZED)),Le[o])a={code:Le[o].code,message:(null===(t=Le[o])||void 0===t?void 0:t.message)||i};else this.serviceMap.Log.logError({title:La.sdk_element_missKeyData},{rpcTraceId:r});return{error:h()(h()({},a),{},{traceId:null!=r?r:""})}}var s,l,c,u,d,p,m;return null}},{key:"areAllContainersReady",value:function(){var e=this.elementContainerService.getContainerServices();return $e()(e.values()).every((function(e){return e.getContainerStatus()===dv.READY}))}},{key:"sendReady",value:function(e,t){var n,r,o,i,a,s=null===(n=this.elementProcessors[O.payment])||void 0===n?void 0:n.getObtainDataRes(),l=this.elementContainer.getPaymentContext(),c=l.paymentSessionObj,u=(null===(r=c.connectFactor)||void 0===r?void 0:r.enableConnect)&&(null===(o=c.paymentSessionConfig)||void 0===o?void 0:o.productScene)===V.ELEMENT_PAYMENT;if((null==s||null===(i=s.originActionQueryResult)||void 0===i||!i.success)&&u)return clearTimeout(this.initTimeout),this.changeLoading(!1),this.initTimeout=null,null===(a=this.onEventCallback)||void 0===a||a.call(this,{code:x.SDK_CREATE_COMPONENT_ERROR,message:"Component initialization exception."}),void this.destroy();var d=h()(h()({},t),{},{originActionQueryResult:null==s?void 0:s.originActionQueryResult,originOneAccountQueryResult:null==s?void 0:s.originOneAccountQueryResult,paymentSessionData:null==l?void 0:l.paymentSessionId,sessionResult:(null==l?void 0:l.paymentSessionObj)||{}});this.elementProcessors[e].onReady(d)}},{key:"updatePayment",value:(t=s()(i()().mark((function e(t){var n=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(){var e=s()(i()().mark((function e(r){var o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(zm({status:n.elementContainer.getStatus(),paymentContainerService:n.elementContainerService.getContainerService(O.payment),newPaymentSessionData:t,oldPaymentSessionData:n.options.sessionData})){e.next=2;break}return e.abrupt("return",r(!1));case 2:return o=n.elementContainer.getPaymentContext().paymentSession,n.elementContainer.updatePaymentSessionData(t),e.next=6,n.elementProcessors[O.payment].obtainData();case 6:a=e.sent,s=-1!==window.location.href.indexOf("LOCAL_MOCK=1"),Object.values(n.elementProcessors).forEach((function(e){e.update({data:{originActionQueryResult:s?Bf:a.originActionQueryResult,originOneAccountQueryResult:s?Yf:a.originOneAccountQueryResult},paymentSessionData:t})})),n.serviceMap.EventCenter.listen(ve.updated.name,(function(e){return e.success||n.elementContainer.updatePaymentSessionData(o),r(e.success||!1)}));case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"destroyHandle",value:function(){this.clearEvents("destroy"),this.clearInitTimeout(),this.elementContainer.destroy(),Um(),Dm();try{Hm()}catch(e){}this.serviceMap.EventCenter.cleanIFrames(),this.elementContainerService.destroy()}},{key:"destroy",value:function(){var e=this.elementEventCenter.registerEvent(B.DESTORY);try{this.destroyHandle(),this.setControllerStatusOrView(Gm.DESTROYED)}finally{this.elementEventCenter.endEvent(e)}}},{key:"setControllerStatusOrView",value:function(e){var t,n=this.elementContainer.getStatus();e!==n&&(null===(t=this.onStatusChangeCallback)||void 0===t||t.call(this,"状态由 ".concat(n," 变更为 ").concat(e)),this.elementContainer.setStatus(e))}},{key:"on",value:function(e,t){if(!this.isEventAllowed(e))return console.error('Event "'.concat(e,'" is not allowed.'));this.serviceMap.EventCenter.listen(e,(function(e){null==t||t(e)}),!0)}},{key:"isEventAllowed",value:function(e){var t,n=on(this.options.sessionData).data,r="true"===(null===(t=Xm(null==n?void 0:n.extendInfo))||void 0===t?void 0:t.expressCheckout)?Im.EXPRESS_CHECKOUT:Im.ELEMENT_PAYMENT,o=Cm.find((function(e){return e.eventName===r}));return void 0!==o&&o.supportedEvents.includes(e)}}]),e}(),gv=vv,yv=function(){var e=-(new Date).getTimezoneOffset(),t=e>=0?"+":"-",n=Math.abs(e),r=Math.floor(n/60),o=n%60;return"UTC".concat(t).concat(r).concat(o?":".concat(String(o).padStart(2,"0")):"")};function _v(e){return{status:e.status||"FAIL",error:e.error?{code:e.error.code,message:e.error.message,traceId:e.error.traceId,needChangeSessionForRetry:e.error.needChangeSessionForRetry}:void 0,userCanceled3D:e.userCanceled3D,session:e.paymentSession?{nextAction:{applinkUrl:e.paymentSession.returnAppUrl,normalUrl:e.paymentSession.returnUrl,schemeUrl:e.paymentSession.returnAppScheme}}:void 0}}function Ev(e,t){var n,r,o,i,a,s={showCardCVV:!(null==t||null===(n=t.storedCard)||void 0===n||!n.needCVV),showPaymentMethodListWhenSingleOption:"list"===(null==t?void 0:t.singleOption)};if(!e)return t?{displaySetting:s}:void 0;var l,c={};if(e.theme&&(c.theme=e.theme),e.variables&&"object"===Je()(e.variables)){var u=h()({},e.variables);Object.keys(u).length>0&&(c.variables=u)}(c.displaySetting=h()(h()({showCardBrandIcon:null===(r=null===(o=e.card)||void 0===o?void 0:o.showBrandIcon)||void 0===r||r},s),{},{showRadioWhenAccordionLayout:null===(i=null===(a=e.accordion)||void 0===a?void 0:a.showRadio)||void 0===i||i}),e.layout)&&(c.layout=(null===(l=e.layout.type)||void 0===l?void 0:l.toLowerCase())||"accordion");return c}var bv=["onStatusChange"],Av=["onBeforeConfirm"],Sv="7882",kv="payment_v1",Tv=function(e){if(null!=e&&e.clientId)return e.clientId;try{var t=Xm(null==e?void 0:e.extendInfo,{}),n=null==t?void 0:t.merchantId;return n&&"string"==typeof n?decodeURIComponent(n):""}catch(e){return""}},Pv=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};try{_c.log(h()({code:"".concat(Sv,"api"),msg:e,m1:t,merchant_id:n,product_scene:r,element_type:kv,idengine_timezone:yv()},o))}catch(e){}},Iv=function(e,t){var n,r,o={};if("submitPayment"===e)o.d1=(null==t?void 0:t.status)||"",o.d2=(null==t||null===(n=t.error)||void 0===n?void 0:n.code)||"",null!=t&&null!==(r=t.error)&&void 0!==r&&r.traceId&&(o.d3=t.error.traceId),null!=t&&t.userCanceled3D&&(o.d5="true");else if("mount"===e){var i,a;o.d1=null!=t&&t.error?"fail":"success",o.d2=(null==t||null===(i=t.error)||void 0===i?void 0:i.code)||"",null!=t&&null!==(a=t.error)&&void 0!==a&&a.traceId&&(o.d3=t.error.traceId)}else"validateFields"===e&&(o.d1=null!=t&&t.isValid?"valid":"invalid");return o},Cv=function(e,t){var n,r,o={};if(!t)return o;if("submitPayment"===e)o.d6=String(!!t.handleActions),o.d7=null!==(n=t.amount)&&void 0!==n?n:"",o.d8=null!==(r=t.currency)&&void 0!==r?r:"",o.d9=t.shippingInfo?"true":"false";else if("mount"===e){var i,a,s,l,c,u,d,p,h,m,f;o.d6=null!==(i=null===(a=t.renderOptions)||void 0===a?void 0:a.type)&&void 0!==i?i:"",o.d7=String(!(null===(s=t.renderOptions)||void 0===s||!s.notRedirectAfterComplete)),o.d8=null!==(l=null===(c=t.renderOptions)||void 0===c||null===(c=c.appearance)||void 0===c?void 0:c.theme)&&void 0!==l?l:"",o.d9=null!==(u=null===(d=t.renderOptions)||void 0===d||null===(d=d.appearance)||void 0===d||null===(d=d.layout)||void 0===d?void 0:d.type)&&void 0!==u?u:"",o.d10=null!==(p=t.sdkSelector)&&void 0!==p?p:"";var v=null===(h=t.renderOptions)||void 0===h?void 0:h.merchantAppointParam;o.d11=null!==(m=null==v?void 0:v.singleOption)&&void 0!==m?m:"",o.d12=null!=(null==v||null===(f=v.storedCard)||void 0===f?void 0:f.needCVV)?String(v.storedCard.needCVV):""}return o},wv=function(){var e=s()(i()().mark((function e(t,n,r,o,a,s){var l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l=Date.now(),e.prev=1,e.next=4,n();case 4:return c=e.sent,Pv(t,Date.now()-l,a,s,h()(h()(h()({},o),Iv(t,c)),null==r?void 0:r(!1))),e.abrupt("return",c);case 9:throw e.prev=9,e.t0=e.catch(1),Pv(t,Date.now()-l,a,s,h()(h()({},o),{},{d1:"error",d2:(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"UNKNOWN"},null==r?void 0:r(!0))),e.t0;case 13:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(t,n,r,o,i,a){return e.apply(this,arguments)}}(),Nv=function(e){var t=null==e?void 0:e.response;if(!1===(null==t?void 0:t.success))return t;throw e},Ov=16e3,Rv=new Ua(Ka,!0),Mv="Element already destroyed",Dv=function(){return{code:me.UI_STATE_ERROR.code,message:Mv}},Lv=function(e){_()(n,e);var t=b()(n);function n(e,r){return g()(this,n),t.call(this,e,r)}return f()(n,[{key:"setTarget",value:function(e){pl()(ml()(n.prototype),"setTarget",this).call(this,e)}},{key:"setDebugCallback",value:function(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];(e=pl()(ml()(n.prototype),"setDebugCallback",this)).call.apply(e,[this].concat(r))}}],[{key:"getGlobalBridge",value:function(e){return pl()(ml()(n),"getGlobalBridge",this).call(this,e)}}]),n}(hc),xv="OPENSDK@VALIDATE",Uv="OPENSDK@VALIDATE_REPLY",Kv="OPENSDK@SHOWTOAST",Bv="OPENSDK@GET_APPLE_PAY_TOKEN",Yv="OPENSDK@GET_APPLE_PAY_TOKEN_REPLY",Fv="OPENSDK@GET_GOOGLE_PAY_TOKEN",Hv="OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY",jv="OPENSDK@HANDLE_PAYMENT",Vv="OPENSDK@BEFORE_CONFIRM",Gv="OPENSDK@BEFORE_CONFIRM_REPLY",zv="paymentMethodChanged",Wv=function(){function e(t){var n=this,r=t.onStatusChange,o=fc()(t,bv);if(g()(this,e),c()(this,"options",void 0),c()(this,"onStatusChange",void 0),c()(this,"scopeId","payment_".concat(He().replace(/-/g,"").slice(0,6))),c()(this,"bridge",void 0),c()(this,"iframe",null),c()(this,"status","initialized"),c()(this,"cachedSend",[]),c()(this,"modalBridge",null),c()(this,"modalDestroy",null),c()(this,"modalIframe",null),c()(this,"notRedirectAfterComplete",!1),c()(this,"_sdkInitTime",Date.now()),c()(this,"_mountStartTime",0),c()(this,"destroyCallbacks",[]),c()(this,"_merchantAmount",null),c()(this,"_merchantCurrency",null),c()(this,"currentPaymentMethodType",""),c()(this,"stopModalMessageMonitor",void 0),c()(this,"isSubmitting",!1),c()(this,"merchantId",""),c()(this,"productScene",""),this.options=o,this.onStatusChange=r,o.sessionData){var i=Nh(o.sessionData);_c.setTrackId(i)}this.bridge=new Lv("HOST",this.scopeId),this.bridge.setDebugCallback((function(e,t){var n,r;e.type.endsWith(Hl)||e.type.endsWith(sc)||(e.type.endsWith($l)?Rc(null===(n=e.payload)||void 0===n?void 0:n.type,"APP_RUNTIME",e.type,null===(r=e.payload)||void 0===r?void 0:r.message):e.type.endsWith(Ql)&&"IN"===t?Mc(e.payload):Rc("INFO","OUT"===t?"SDK_INTERNAL":"APP_RUNTIME",e.type,e.payload))})),this.stopModalMessageMonitor=Jc((function(e){return n.trackElement("modal_lifecycle_monitor",Gc(e))}),(function(e){var t;return e.source===(null===(t=n.iframe)||void 0===t?void 0:t.contentWindow)}))}var t,n,r,o,a,l,u,d,p;return f()(e,[{key:"track",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{var r="".concat(Sv).concat("error"===e?"":e);_c.log(h()({code:r,msg:t,merchant_id:this.merchantId,product_scene:this.productScene,element_type:kv,idengine_timezone:yv()},n))}catch(e){}}},{key:"trackMount",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.track("mount",e,t)}},{key:"trackHandshake",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.track("handshake",e,t)}},{key:"trackElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.track("element",e,t)}},{key:"trackError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.track("error",e,t)}},{key:"createRequestTracker",value:function(){var e=this;try{var t=Object.create(_c);return t.log=function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0],i=n.slice(1);if(o&&"object"===Je()(o))return void _c.log.apply(_c,[h()(h()({},o),{},{merchant_id:e.merchantId,product_scene:e.productScene,element_type:kv,idengine_timezone:yv()})].concat($e()(i)));_c.log.apply(_c,n)}catch(e){}},t}catch(e){return _c}}},{key:"mount",value:(p=s()(i()().mark((function e(t,n){var r,o,a=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{o=Xh(this.options.sessionData,"ELEMENT_PAYMENT"),this.merchantId=Tv(o),this.productScene=(null==o||null===(r=o.paymentSessionConfig)||void 0===r?void 0:r.productScene)||""}catch(e){}return e.abrupt("return",wv("mount",(function(){return a.doMount(t,n)}),void 0,Cv("mount",{renderOptions:t,sdkSelector:n}),this.merchantId,this.productScene));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"doMount",value:(d=s()(i()().mark((function e(t,n){var r,o,a,s,l,c,u,d,p,h,m,f,v,g,y,_,E,b,A;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.trackMount("mount_start",{d1:n,d2:this.options.sessionData?"has_session":"no_session"}),a=document.querySelector(n)){e.next=6;break}return this.trackError("selector_not_found",{d1:n}),null===(s=this.options)||void 0===s||null===(l=s.onEventCallback)||void 0===l||l.call(s,{code:x.SDK_CREATE_COMPONENT_ERROR,message:"Element with selector ".concat(n," not found.")}),e.abrupt("return",{error:{code:"PARAM_INVALID",message:"selector not found"}});case 6:null===(r=this.options.loading)||void 0===r||null===(o=r.onStartLoading)||void 0===o||o.call(r),this.setStatus("mounting"),e.prev=8,d=this.buildIframeUrl(),this.iframe=document.createElement("iframe"),this.iframe.style.width="100%",this.iframe.style.border="none",this.iframe.style.height="0",this.iframe.style.transition="height 0.3s ease",this.iframe.allow="payment";try{(p=new URL(d).origin)&&"null"!==p&&this.bridge.setOrigin(p)}catch(e){}return this.bindBridgeEvents(),h=this.waitForReadyHandshake(),this.iframe.src=d,a.appendChild(this.iframe),this.trackMount("iframe_loaded",{d1:d}),e.next=24,Promise.all([this.setup(t),h]);case 24:if(m=e.sent,f=tt()(m,1),v=f[0],"destroyed"!==this.status){e.next=29;break}throw Dv();case 29:return(g=this.validateRenderData(v.renderData,v.renderDataError))&&(v.renderDataError=g,this.trackError("render_data_invalid",{d1:g.code,d2:g.reason})),this.setStatus("mounted"),this.sendHandshake(v),e.next=35,this.waitForHandshakeAck();case 35:if(this.setStatus("ready"),this.flushCachedMessages(),null===(c=this.options.loading)||void 0===c||null===(u=c.onEndLoading)||void 0===u||u.call(c),!g){e.next=40;break}return e.abrupt("return",{error:g});case 40:return this.trackMount("mount_success",{m1:this._mountStartTime?Date.now()-this._mountStartTime:0}),e.abrupt("return",{});case 44:if(e.prev=44,e.t0=e.catch(8),null===(y=this.options.loading)||void 0===y||null===(_=y.onEndLoading)||void 0===_||_.call(y),i=e.t0,S=void 0,(S=i).code!==me.UI_STATE_ERROR.code||S.message!==Mv){e.next=49;break}return e.abrupt("return",{error:e.t0});case 49:return this.trackError("mount_error",{d1:(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"UNKNOWN",d2:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||""}),this.cleanup(),A={code:e.t0.code||"UNKNOWN",message:e.t0.message||""},null===(E=this.options)||void 0===E||null===(b=E.onEventCallback)||void 0===b||b.call(E,A),e.abrupt("return",{error:A});case 54:case"end":return e.stop()}var i,S}),e,this,[[8,44]])}))),function(e,t){return d.apply(this,arguments)})},{key:"setup",value:(u=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,m,f,v,g,y,_,E,b,A,S,k,T,P,I,C,w,N,O=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._mountStartTime=Date.now(),this.trackMount("setup_start"),this.notRedirectAfterComplete=t.notRedirectAfterComplete||!1,s=this.options.sessionData,l=Xh(s,"ELEMENT_PAYMENT"),this.merchantId||(this.merchantId=Tv(l)),this.productScene=(null==l||null===(n=l.paymentSessionConfig)||void 0===n?void 0:n.productScene)||"",c="sandbox"===this.options.environment?"sandbox":"prod",this.options.environment,Hh.setGlobalOptions(h()(h()({hostSign:Oh(s),env:c},cl()),{},{sdkVersion:"0.0.1787898127-dev.21",tracker:this.createRequestTracker()})),u=!(null==l||null===(r=l.connectFactor)||void 0===r||!r.enableConnect),d=Hf(u,null==l?void 0:l.extendInfo),p=null==l?void 0:l.paymentSessionConfig,m=function(){var e;return cm(gm({extParams:{isUserPreferredLocale:!0},merchantAppointParam:null!==(e=t.merchantAppointParam)&&void 0!==e&&e.storedCard?t.merchantAppointParam:void 0,notRedirectAfterComplete:O.notRedirectAfterComplete,paymentSessionConfig:null==l?void 0:l.paymentSessionConfig,paymentSessionData:s},{envInfo:{locale:O.options.locale}}).catch(Nv))},f=function(){return cm(fm({paymentSessionConfig:p,paymentSessionData:s,accountInfo:{email:""}}))},v=d?[m(),f()]:[m(),void 0],g=function(){},y=new Promise((function(e,t){g=O.onDestroy((function(){return t(Dv())}))})),_=Promise.all(v),e.next=21,Promise.race([_,y]).finally(g);case 21:return E=e.sent,b=tt()(E,2),A=b[0],S=b[1],A.error&&this.trackHandshake("sdk_query_failed",{d1:(null===(k=A.error)||void 0===k?void 0:k.code)||"",d2:(null===(T=A.error)||void 0===T?void 0:T.message)||""}),d&&null!=S&&S.error&&this.trackHandshake("one_account_query_failed",{d1:(null===(P=S.error)||void 0===P?void 0:P.code)||"",d2:(null===(I=S.error)||void 0===I?void 0:I.message)||""}),C=ul(A.data),w=C||this.options.locale,N=A.error||(null==S?void 0:S.error),e.abrupt("return",{sdkTiming:{sdkInitTime:this._sdkInitTime,mountStartTime:this._mountStartTime},sessionData:s,renderData:A.data,renderDataError:N,connectAccount:null==S?void 0:S.data,sessionMetaData:l,merchantDomain:window.location.hostname,doMain:window.location.hostname,appearance:Ev((null==t?void 0:t.appearance)||this.options.appearance,t.merchantAppointParam),logMetaData:{paymentMethodCategoryType:null==p?void 0:p.paymentMethodCategoryType,productSceneVersion:null==p?void 0:p.productSceneVersion,trackId:Nh(s),merchantId:this.merchantId,paymentMethodType:null==l||null===(o=l.paymentMethodInfoView)||void 0===o?void 0:o.paymentMethodType},heightOfVisible:Math.max(window.changingPageHeight||0,window.innerHeight),locale:w,sdkVersion:"0.0.1787898127-dev.21",merchantId:(null==A||null===(a=A.data)||void 0===a?void 0:a.merchantId)||"",env:c,_requestConfig:h()({env:c},cl())});case 31:case"end":return e.stop()}}),e,this)}))),function(e){return u.apply(this,arguments)})},{key:"getLegacySdkQueryError",value:function(e){var t=e.errorCode,n=e.errorMessage,r=e.traceId,o=e.reason;if(!t)return{source:"SDK_INTERNAL",code:me.ERR_DATA_STRUCT_UNRECOGNIZED.code,message:me.ERR_DATA_STRUCT_UNRECOGNIZED.message,reason:o,traceId:null!=r?r:""};var i=Le[t];return{source:"SDK_INTERNAL",code:(null==i?void 0:i.code)||t,message:(null==i?void 0:i.message)||n||me.ERR_DATA_STRUCT_UNRECOGNIZED.message,reason:o,traceId:null!=r?r:""}}},{key:"validateRenderData",value:function(e,t){var n;if(t||!e)return{source:"SDK_INTERNAL",code:me.INITIALIZE_TIMEOUT.API.code,message:me.INITIALIZE_TIMEOUT.API.message,reason:t?"query request failed: errorCode=".concat(t.code):"renderData is empty",traceId:null!==(n=null==t?void 0:t.traceId)&&void 0!==n?n:""};var r=e.success,o=e.paymentMethods,i=e.savedPaymentMethods,a=e.orderAmountView,s=e.paymentAmountView,l=Boolean(o&&Array.isArray(o)&&o.length>0||i&&Array.isArray(i)&&i.length>0),c=!!a&&!!s;if(!r){var u=e,d=u.traceId,p=u.errorCode,h=u.errorMessage;return this.getLegacySdkQueryError({errorCode:p,errorMessage:h,traceId:d,reason:p?"sdkAction.query failed: errorCode=".concat(p):"sdkAction.query failed without errorCode"})}return l&&c?void 0:{source:"SDK_INTERNAL",code:me.ERR_DATA_STRUCT_UNRECOGNIZED.code,message:me.ERR_DATA_STRUCT_UNRECOGNIZED.message,reason:"Data structure validation failed: success=".concat(r,", hasValidPaymentMethods=").concat(l,", hasAmountViews=").concat(c),traceId:""}}},{key:"bindBridgeEvents",value:function(){var e=this;this.bridge.on(sc,(function(t){e.iframe&&(e.iframe.style.height="".concat(t,"px"))})),this.bridge.on(Kv,(function(t,n,r){var o,i;r&&r.source!==(null===(o=e.iframe)||void 0===o?void 0:o.contentWindow)&&r.source!==(null===(i=e.modalIframe)||void 0===i?void 0:i.contentWindow)||function(e){if(null!=e&&e.message){var t=h()(h()({},im),e),n=document.getElementById(lm);n?n.innerHTML="":((n=document.createElement("div")).id=lm,Object.assign(n.style,{position:"fixed",display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none"}),document.body.appendChild(n)),n.style.top="",n.style.right="",n.style.bottom="",n.style.left="",n.style.zIndex=String(t.zIndex),Object.assign(n.style,am[t.position]);var r=document.createElement("div");if(Object.assign(r.style,{backgroundColor:t.backgroundColor,color:t.color,padding:t.padding,borderRadius:t.borderRadius,fontSize:t.fontSize,opacity:"0",transition:"opacity ".concat(300,"ms ease-in-out"),display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",width:t.width,boxSizing:"border-box"}),t.icon){var o=document.createElement("img");Object.assign(o.style,{width:"40px",height:"40px"}),o.src=sm[t.icon],r.appendChild(o)}var i=document.createElement("span");Object.assign(i.style,{textAlign:"center",marginTop:"12px",lineHeight:"20px",fontFamily:"Noto Sans",fontWeight:"400",fontSize:"14px"}),i.textContent=t.message,r.appendChild(i),n.appendChild(r),setTimeout((function(){r.style.opacity="1"}),10),setTimeout((function(){r.style.opacity="0",setTimeout((function(){n.remove()}),300)}),t.duration)}}(t)})),this.bridge.on(zl,(function(t,n,r){var o,i;if(!r||r.source===(null===(o=e.iframe)||void 0===o?void 0:o.contentWindow)||r.source===(null===(i=e.modalIframe)||void 0===i?void 0:i.contentWindow)){var a=t.url,s=t.mode,l=t.appLinkUrl,c=t.schemaUrl,u=t.destroy;e.trackElement("redirect",{d1:s||"redirect",d2:l?"app_link":c?"schema":"url",d3:a||"",d4:l||"",d5:c||"",d6:u?"1":"0"}),u&&e.destroy();try{if(l||c)new Xs({resultJudgmentTime:2e3,fallback:function(){e.trackElement("redirect_fallback",{d1:"callapp_failed",d2:a||""}),d()}}).open({scheme:c,link:l});else d()}catch(t){e.trackError("redirect_error",{d1:"callapp_exception",d2:(null==t?void 0:t.message)||"",d3:a||""}),d()}}function d(){"replace"===s?window.location.replace(a):window.location.href=a}})),this.bridge.on(Wl,(function(t,n,r){var o;r&&r.source!==(null===(o=e.iframe)||void 0===o?void 0:o.contentWindow)||(e.handleOpenModal(t),e.bridge.once(Jl,(function(){e.handleCloseModal()})))})),this.bridge.on(lc,(function(t,n,r){var o;r&&r.source!==(null===(o=e.iframe)||void 0===o?void 0:o.contentWindow)||e.destroy()})),this.bridge.on(jv,(function(){e.handleHandlePayment()})),this.bridge.on(zv,(function(t){e.currentPaymentMethodType=(null==t?void 0:t.type)||""}))}},{key:"handleGetApplePayToken",value:(l=s()(i()().mark((function e(t,n){var r,o,a,l,c,u,d,p,m,f,v,g,y,_,E,b,A,S,k=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.options.sessionData,a=null==t||null===(r=t.paymentMethod)||void 0===r||null===(r=r.paymentMethodDetail)||void 0===r?void 0:r.applePayProps,l=null==a?void 0:a.paymentRequest,this.trackElement("applepay_token_request",{d1:l?"has_payment_request":"no_payment_request"}),l){e.next=8;break}return this.trackError("applepay_token_missing_data",{d1:"MISSING_DATA"}),this.bridge.send(Yv,{success:!1,result:{errorCode:"APPLE_PAY_MISSING_DATA"}}),e.abrupt("return");case 8:return c=l.merchantCapabilities,u=l.merchantInfo,d=l.paymentAmount,p=l.supportedNetworks,m=l.version,f=l.requiredBillingContactFields,v=l.requiredShippingContactFields,g=null==d?void 0:d.value,y=null==d?void 0:d.currency,this._merchantAmount&&(g=this._merchantAmount),this._merchantCurrency&&(y=this._merchantCurrency),E=Pm(o,u,{value:g,currency:y}),b=new Sm({paymentRequest:h()({countryCode:null==u?void 0:u.countryCode,currencyCode:y,merchantCapabilities:c,supportedNetworks:p,requiredBillingContactFields:f,requiredShippingContactFields:v,total:E?{type:"final",label:E.regularBilling.label,amount:g}:{type:"final",label:(null==u?void 0:u.merchantName)||"Payment",amount:g},version:E?14:m},E?{lineItems:[E.regularBilling],recurringPaymentRequest:E}:{}),enableModalCloseListener:!0,callbacks:{validateMerchant:function(){var e=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return k.trackElement("applepay_validate_start",{d1:"merchant_validate"}),e.next=3,ya(o,{validateUrl:t,paymentSessionData:o,merchantDomain:window.location.hostname},{env:k.options.environment,envInfo:{deviceId:""}},Rv);case 3:if(null==(n=e.sent)||!n.success||!n.merchantSessionObject){e.next=7;break}return k.trackElement("applepay_validate_success",{d1:"got_session"}),e.abrupt("return","string"==typeof n.merchantSessionObject?JSON.parse(n.merchantSessionObject):n.merchantSessionObject);case 7:throw k.trackError("applepay_merchant_validate_failed",{d1:"VALIDATION_FAILED",d2:(null==n?void 0:n.errorMessage)||"Merchant validation failed"}),{errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"};case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),onAuthorized:function(){var e=s()(i()().mark((function e(t){var r,o,a,s,l,c,u,d,p;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.token,o=t.billingContact,a=t.shippingContact,!n){e.next=19;break}return e.prev=2,s=Date.now(),e.next=6,qa((function(){return n()}));case 6:if(l=e.sent,c=l.result,u=l.timedOut,d=u||Date.now()-s>=Va,p=!d&&!!c,d&&k.trackError("sdk_before_confirm_timeout",{d1:"applePay_chrome_modern"}),p){e.next=14;break}return e.abrupt("return",{success:!1,errorCode:d?za:Ga});case 14:e.next=19;break;case 16:return e.prev=16,e.t0=e.catch(2),e.abrupt("return",{success:!1,errorCode:Ga});case 19:return _={token:r,billingContact:o,shippingContact:a},k.trackElement("applepay_authorized",{d1:r?"has_token":"no_token"}),e.abrupt("return",{success:!0,result:_});case 22:case"end":return e.stop()}}),e,null,[[2,16]])})));return function(t){return e.apply(this,arguments)}}()}}),e.prev=15,e.next=18,b.startPay();case 18:this.trackElement("applepay_token_success",{d1:null!==(A=_)&&void 0!==A&&A.token?"has_token":"no_token"}),this.bridge.send(Yv,{success:!0,result:_}),e.next=26;break;case 22:e.prev=22,e.t0=e.catch(15),"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"!==(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)&&("APPLE_PAY_CANCEL"===(S=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED")?this.trackElement("applepay_cancel",{d1:"user_cancel"}):this.trackError("applepay_token_failed",{d1:S,d2:(null===e.t0||void 0===e.t0?void 0:e.t0.errorMessage)||""})),this.bridge.send(Yv,{success:!1,result:{errorCode:(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED"}});case 26:case"end":return e.stop()}}),e,this,[[15,22]])}))),function(e,t){return l.apply(this,arguments)})},{key:"handleGetGooglePayToken",value:function(e){var t,n,r=this,o=null==e?void 0:e.data,i=null==o||null===(t=o.paymentMethodDetail)||void 0===t?void 0:t.googlePayProps,a=(null==o?void 0:o.environment)||(null==i?void 0:i.environment)||"TEST",s=(null==o?void 0:o.paymentRequest)||(null==i?void 0:i.paymentRequest)||{};if(this.trackElement("googlepay_token_request",{d1:a,d2:s?"has_payment_request":"no_payment_request"}),!s||!Object.keys(s).length)return this.trackError("googlepay_token_missing_data",{d1:"MISSING_DATA"}),void this.bridge.send(Hv,{success:!1,err:{statusCode:"GOOGLE_PAY_PAYMENT_FAILED"}});var l=function(){var e=new window.google.payments.api.PaymentsClient({environment:a,paymentDataCallbacks:{onPaymentAuthorized:function(){return{transactionState:"SUCCESS"}}}});e.isReadyToPay(s).then((function(t){if(t.result)return e.loadPaymentData(s);throw{statusCode:"GOOGLE_PAY_NOT_SUPPORTED"}})).then((function(e){e&&(r.trackElement("googlepay_token_success",{d1:"has_token"}),r.bridge.send(Hv,{success:!0,result:e}))})).catch((function(e){var t=(null==e?void 0:e.statusCode)||"GOOGLE_PAY_PAYMENT_FAILED";"CANCELED"===t?r.trackElement("googlepay_cancel",{d1:"user_cancel"}):r.trackError("googlepay_token_failed",{d1:t,d2:(null==e?void 0:e.statusMessage)||""}),r.bridge.send(Hv,{success:!1,err:h()({statusCode:t},e)})}))};if(null!==(n=window.google)&&void 0!==n&&null!==(n=n.payments)&&void 0!==n&&null!==(n=n.api)&&void 0!==n&&n.PaymentsClient)l();else{var c=document.createElement("script");c.src="https://pay.google.com/gp/p/js/pay.js",c.async=!0,document.body.appendChild!==Node.prototype.appendChild?Node.prototype.appendChild.call(document.body,c):document.body.appendChild(c),c.onload=function(){l()},c.onerror=function(){r.trackError("googlepay_script_load_failed",{d1:"script_error"}),r.bridge.send(Hv,{success:!1,err:{statusCode:"GOOGLE_PAY_NOT_SUPPORTED"}})}}}},{key:"handleHandlePayment",value:function(){var e=this.options.sessionData,t=Gh(e);this.trackElement("handle_payment",{d1:"skipRender_applepay_publish"}),t||this.trackError("handle_payment_meta_failed",{d1:"meta_parse_failed"}),We.publish(new Ve(Sn.createComponent,JSON.stringify({appendParams:{iframeNodesParams:{sessionData:e,paymentSessionMetaData:t}},options:{environment:this.options.environment,locale:this.options.locale}})))}},{key:"handleBeforeConfirmInternal",value:function(e){var t=this;if(!e)return Rv.logInfo({title:"sdk_before_confirm_skip"},{path:"modernController_bridge"}),void this.bridge.send(Gv,{success:!0,result:!0});Rv.logInfo({title:"sdk_before_confirm_start"},{path:"modernController_bridge"});var n=Date.now();qa((function(){return e()})).then((function(e){var r=e.result,o=e.timedOut||Date.now()-n>=Va,i=!o&&!!r;o&&Rv.logError({title:"sdk_before_confirm_timeout"}),Rv.logInfo({title:"sdk_element_beforeConfirm_callback_result"},{shouldContinue:i}),t.bridge.send(Gv,h()({success:!0,result:!!i},o?{isTimeout:!0}:{}))})).catch((function(e){Rv.logError({title:"sdk_before_confirm_error"},{errorMessage:String((null==e?void 0:e.message)||e).slice(0,200),path:"modernController_bridge"}),t.bridge.send(Gv,{success:!1,result:!1})}))}},{key:"waitForReadyHandshake",value:function(){var e=this;return new Promise((function(t,n){var r=function(){},o=setTimeout((function(){r(),e.trackError("ready_handshake_timeout",{d1:String(Ov)}),n({code:"INITIALIZE_WEB_TIMEOUT",message:"An error occurred; the transaction cannot be initiated."})}),Ov);r=e.onDestroy((function(){clearTimeout(o),n(Dv())})),e.bridge.once(Fl,(function(){var i;if(clearTimeout(o),r(),null===(i=e.iframe)||void 0===i||!i.contentWindow)return e.trackError("iframe_contentwindow_unavailable",{d1:"after_ready_handshake"}),void n({code:"SDK_LAUNCH_PAYMENT_APP_ERROR",message:"Iframe contentWindow not available"});e.bridge.setTarget(e.iframe.contentWindow),e.trackHandshake("ready_handshake_received",{m1:e._mountStartTime?Date.now()-e._mountStartTime:0}),t()}))}))}},{key:"sendHandshake",value:function(e){this.bridge.send(Yl,e),this.trackHandshake("handshake_sent",{d1:(null==e?void 0:e.sdkVersion)||""})}},{key:"waitForHandshakeAck",value:function(){var e=this;return new Promise((function(t,n){var r=function(){},o=setTimeout((function(){r(),e.trackError("handshake_ack_timeout",{d1:String(Ov)}),n({code:"INITIALIZE_WEB_TIMEOUT",message:"An error occurred; the transaction cannot be initiated."})}),Ov);r=e.onDestroy((function(){clearTimeout(o),n(Dv())})),e.bridge.once(Zl,(function(){clearTimeout(o),r(),e.trackHandshake("handshake_ack_received",{m1:e._mountStartTime?Date.now()-e._mountStartTime:0}),t()}))}))}},{key:"submitPayment",value:(a=s()(i()().mark((function e(t){var n=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",wv("submitPayment",(function(){return n.doSubmitPayment(t)}),(function(){return n.currentPaymentMethodType?{d4:n.currentPaymentMethodType}:{}}),Cv("submitPayment",t),this.merchantId,this.productScene));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"doSubmitPayment",value:(o=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,m,f,v,g,y,_,E,b,A,S,k=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ready"===this.status){e.next=3;break}return this.trackError("submit_not_ready",{d1:this.status}),e.abrupt("return",{status:"FAIL",error:{code:"UI_STATE_ERROR",message:"not ready"}});case 3:if(!this.isSubmitting){e.next=6;break}return this.trackError("submit_in_progress",{}),e.abrupt("return",{status:"FAIL",error:{code:"UI_STATE_ERROR",message:"submit already in progress"}});case 6:if(this.isSubmitting=!0,e.prev=7,o="APPLEPAY"===this.currentPaymentMethodType,s=(a=t||{}).onBeforeConfirm,l=fc()(a,Av),!s||o){e.next=32;break}return Rv.logInfo({title:"sdk_before_confirm_start"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}),e.prev=12,c=Date.now(),e.next=16,qa((function(){return s()}));case 16:if(u=e.sent,d=u.result,p=u.timedOut,!(m=p||Date.now()-c>=Va)&&d){e.next=23;break}return m?Rv.logError({title:"sdk_before_confirm_timeout"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}):Rv.logInfo({title:"sdk_before_confirm_abort"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}),e.abrupt("return",{status:"FAIL",error:{code:m?za:Ga,message:m?"Merchant confirmation timed out.":"Merchant canceled payment.",needChangeSessionForRetry:!1}});case 23:Rv.logInfo({title:"sdk_before_confirm_success"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:"nonApplePay_sync"}),e.next=30;break;case 26:return e.prev=26,e.t0=e.catch(12),Rv.logError({title:"sdk_before_confirm_error"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",errorMessage:String((null===e.t0||void 0===e.t0?void 0:e.t0.message)||e.t0).slice(0,200),path:"nonApplePay_sync"}),e.abrupt("return",{status:"FAIL",error:{code:Ga,message:"Merchant canceled payment.",needChangeSessionForRetry:!1}});case 30:e.next=33;break;case 32:s||Rv.logInfo({title:"sdk_before_confirm_skip"},{paymentMethodType:this.currentPaymentMethodType||"UNKNOWN",path:o?"applePay_eventBridge":"nonApplePay_sync"});case 33:return f=o&&!!s,v=!(null==l||!l.amount),g=!(null==l||!l.currency),!v&&!g||v&&g||Rv.logError({title:"sdk_element_submitPayment_amountCurrencyMismatch"},{amount:null==l?void 0:l.amount,currency:null==l?void 0:l.currency,reason:"amount and currency must be provided together, both ignored"}),this._merchantAmount=v&&g?l.amount:null,this._merchantCurrency=v&&g?l.currency:null,null===(n=this.options.loading)||void 0===n||null===(r=n.onStartLoading)||void 0===r||r.call(n),this.trackElement("submit_start",{d1:this.notRedirectAfterComplete?"if_required":"always"}),y=[],e.prev=42,E=new Promise((function(e){y.push(k.bridge.once(Bv,(function(e){k.handleGetApplePayToken(e,s).then((function(){}))}))),y.push(k.bridge.once(Fv,(function(e){k.handleGetGooglePayToken(e)}))),y.push(k.bridge.once(Vv,(function(){k.handleBeforeConfirmInternal(s||null)}))),y.push(k.bridge.once(Gl,e))})),this.send(Vl,h()(h()({},l),{},{redirect:this.notRedirectAfterComplete?"if_required":"always",hasBeforeConfirm:f},v&&g?{amount:l.amount,currency:l.currency}:{})),e.next=47,E;case 47:return b=e.sent,this.trackElement("submit_reply",{d1:(null==b?void 0:b.status)||"",d2:(null==b||null===(_=b.error)||void 0===_?void 0:_.code)||""}),e.abrupt("return",_v(b));case 52:throw e.prev=52,e.t1=e.catch(42),this.trackError("submit_error",{d1:(null===e.t1||void 0===e.t1?void 0:e.t1.code)||"UNKNOWN",d2:(null===e.t1||void 0===e.t1?void 0:e.t1.message)||""}),e.t1;case 56:return e.prev=56,y.forEach((function(e){try{e()}catch(e){}})),null===(A=this.options.loading)||void 0===A||null===(S=A.onEndLoading)||void 0===S||S.call(A),e.finish(56);case 60:return e.prev=60,this.isSubmitting=!1,e.finish(60);case 63:case"end":return e.stop()}}),e,this,[[7,,60,63],[12,26],[42,52,56,60]])}))),function(e){return o.apply(this,arguments)})},{key:"validateFields",value:(r=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",wv("validateFields",(function(){return t.doValidateFields()}),void 0,void 0,this.merchantId,this.productScene));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"doValidateFields",value:(n=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ready"===this.status){e.next=3;break}return this.trackError("validate_not_ready",{d1:this.status}),e.abrupt("return",{isValid:!1});case 3:return this.send(xv),e.abrupt("return",new Promise((function(e){var n=setTimeout((function(){t.trackError("validate_fields_timeout",{d1:"15000"}),e({isValid:!1})}),15e3);t.bridge.once(Uv,(function(r){clearTimeout(n);var o=!(null==r||!r.isValid);t.trackElement("validate_result",{d1:o?"valid":"invalid"}),e(r||{isValid:!1})}))})));case 5:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"updatePayment",value:(t=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!1);case 1:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"on",value:function(e,t){this.bridge.on(e,t)}},{key:"destroy",value:function(){var e;this.trackElement("destroy",{d1:this.status}),"initialized"!==this.status&&"destroyed"!==this.status&&(this.stopModalMessageMonitor(),this.handleCloseModal(),this.bridge.destroy(),null!==(e=this.iframe)&&void 0!==e&&e.parentNode&&this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,this.setStatus("destroyed"),this.runDestroyCallbacks(),this.cachedSend=[])}},{key:"cleanup",value:function(){var e;null!==(e=this.iframe)&&void 0!==e&&e.parentNode&&this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,this.setStatus("initialized"),this.cachedSend=[]}},{key:"setStatus",value:function(e){var t;if("destroyed"!==this.status&&e!==this.status){var n=this.status;this.status=e,null===(t=this.onStatusChange)||void 0===t||t.call(this,e,n)}}},{key:"onDestroy",value:function(e){var t=this;return"destroyed"===this.status?(e(),function(){}):(this.destroyCallbacks.push(e),function(){t.destroyCallbacks=t.destroyCallbacks.filter((function(t){return t!==e}))})}},{key:"runDestroyCallbacks",value:function(){var e=this.destroyCallbacks;this.destroyCallbacks=[],e.forEach((function(e){return e()}))}},{key:"send",value:function(e,t){"destroyed"!==this.status&&("ready"===this.status?this.bridge.send(e,t):this.cachedSend.push({type:e,payload:t}))}},{key:"flushCachedMessages",value:function(){var e=this;this.cachedSend.length>0&&(this.cachedSend.forEach((function(t){var n=t.type,r=t.payload;e.bridge.send(n,r)})),this.cachedSend=[])}},{key:"handleOpenModal",value:function(e){var t,n,r,o=this;this.handleCloseModal();var i=gt?"mobile":"desktop";this.trackElement("open_modal",{d1:i,d2:(null==e?void 0:e.modalId)||""});try{var a=new URL(e.url);e.closeConfirm&&a.searchParams.append("confirm","true"),e.url=a.toString()}catch(t){var s=new vl("Invalid URL","INVALID_MODAL_URL","APP_RUNTIME");return this.trackError("open_modal_invalid_url",{d1:"INVALID_MODAL_URL",d2:(null==e?void 0:e.url)||""}),void this.bridge.send(ql,s)}var l=this.modalBridge=Lv.getGlobalBridge("HOST"),c=new MessageChannel;this.bridge.send(tc,e.modalId,[c.port1]);var u=(null==e||null===(t=e.appearance)||void 0===t?void 0:t.theme)||"default",d=null!==(n=Zh[u])&&void 0!==n?n:Zh.default,p=null==e||null===(r=e.appearance)||void 0===r?void 0:r.variables,m={theme:d.theme,backgroundColor:(null==p?void 0:p["color-background-primary"])||(null==p?void 0:p["background-primary"])||d.backgroundColor},f=om(h()(h()({},e),{},{mode:i,loadingConfig:m,onClose:function(){if(e.closeConfirm)return new Ul(e.modalId,c.port2).close(!0)}})),v=f.iframe,g=f.destroy,y=l.once(nc,(function(t,n,r){if((!r||r.source===v.contentWindow)&&(o.trackElement("modal_loaded",{d1:e.url}),v.contentWindow)){l.setTarget(v.contentWindow);try{var i=new URL(v.src).origin;i&&"null"!==i&&l.setOrigin(i)}catch(e){}e.appearance&&l.send(oc,e.appearance),e.initialData&&l.send(ic,e.initialData),l.send(rc,e.modalId,[c.port2])}}));this.modalIframe=v,this.modalDestroy=function(){e.closeConfirm&&o.trackElement("modal_close_confirm",{d1:"confirm_resolved"}),g(),y(),o.modalIframe=null}}},{key:"handleCloseModal",value:function(){this.trackElement("modal_closed",{d1:this.modalBridge?"with_bridge":"no_bridge"}),this.modalBridge&&(this.modalBridge.destroy(),this.modalBridge=null),this.modalDestroy&&(this.modalDestroy(),this.modalDestroy=null)}},{key:"buildIframeUrl",value:function(){var e=ll("/element_payment/index.html",!0),t=this.options.sessionData?Nh(this.options.sessionData):"";return"".concat(e,"?").concat(t?"track_id=".concat(encodeURIComponent(t),"&"):"","_scope_id=").concat(encodeURIComponent(this.scopeId))}}]),e}(),qv=function(){function e(t){g()(this,e),c()(this,"options",void 0),c()(this,"controller",void 0);var n=function(e){var t,n=[];return e.sessionData||(console.error("sessionData is empty, please check new AMSElement params."),n.push({field:"sessionData",message:"sessionData is empty"})),n.length>0&&(null==e||null===(t=e.onEventCallback)||void 0===t||t.call(e,{code:x.SDK_CREATE_COMPONENT_ERROR,message:"sessionData is empty"})),{isValid:0===n.length,errors:n}}(t);if(!n.isValid)throw new K(n.errors);this.options=function(e){var t=e.environment;return h()(h()({},e),{},{environment:(t||U.PROD).toLocaleLowerCase()})}(t),Jh(t.sessionData)?this.controller=new Wv(h()(h()({},this.options),{},{sessionData:qh(this.options.sessionData)})):this.controller=new gv(this.options)}var t;return f()(e,[{key:"updatePayment",value:(t=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.controller.updatePayment(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"mount",value:function(e,t){var n;return this.controller.mount(h()({appearance:null==this||null===(n=this.options)||void 0===n?void 0:n.appearance},e),t)}},{key:"validateFields",value:function(){return this.controller.validateFields()}},{key:"submitPayment",value:function(e){return this.controller.submitPayment(e)}},{key:"destroy",value:function(){this.controller.destroy()}},{key:"on",value:function(e,t){this.controller.on(e,t)}}]),e}(),Jv={message:"sdk no need to make query request",success:!0},Qv=function(){function e(){g()(this,e),c()(this,"paymentContext",void 0),c()(this,"initConfig",void 0),c()(this,"logger",void 0),c()(this,"eventCenter",void 0),c()(this,"securityService",void 0),c()(this,"instanceId",void 0),c()(this,"componentSign",void 0),c()(this,"hostSign",void 0),c()(this,"_performanceData",[]),c()(this,"SECURITY_SDK_INIT_TIMEOUT",1500)}var t,n,r,o;return f()(e,[{key:"init",value:function(e,t,n){this.initConfig=e,this.instanceId=t,this.logger=xf.getInstance(this.instanceId).getService("Log"),this.eventCenter=xf.getInstance(this.instanceId).getService("EventCenter"),this.securityService=xf.getInstance(this.instanceId).getService("Security"),this._performanceData.push({key:"sdk_init",value:Date.now()})}},{key:"startBizFlow",value:(o=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,h;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.paymentContext=t,this.componentSign=nl(null===(n=this.paymentContext)||void 0===n?void 0:n.paymentSessionObj),this.hostSign=((null==t?void 0:t.paymentSession)||"").split("&&")[1]||"",r=this.paymentContext.paymentSessionObj,o=r.action,a=r.authUrlInfo,s=void 0===a?{}:a,this.componentSign!==j.AUTO_DEBIT_WALLET){e.next=9;break}if(u=_t()?null==o||null===(l=o.web)||void 0===l?void 0:l.signType:null==o||null===(c=o.wap)||void 0===c?void 0:c.signType,d=(null==o?void 0:o.requireFastSdk)||!1,"REDIRECT"!==u||!0!==d){e.next=9;break}return e.abrupt("return",this.buildRedirectResult(s));case 9:return p=this.buildWebAppUrl(),h={url:p,allowClickPopupOutsideClose:this.componentSign===j.AUTO_DEBIT_WALLET},this.sendRequestAndWaitWebLaunch(),e.abrupt("return",{behaviorType:"RENDER",payload:h});case 13:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"acquireApdidToken",value:(r=s()(i()().mark((function e(){var t,n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=null===(t=this.paymentContext.paymentSessionObj)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productScene,r=this.securityService.getDeviceId({productScene:n}),e.abrupt("return",r);case 3:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"getSdkActionQuery",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,h,m,f,v;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=xf.getInstance(this.instanceId).getService("Requester"),n=this.paymentContext,r=n.paymentSession,o=n.paymentSessionObj,a=this.initConfig,s=a.environment,l=a.locale,u=(c=o||{}).paymentSessionConfig,d=c.action,this.componentSign!==j.AUTO_DEBIT_WALLET){e.next=11;break}if(p=d.web,h=d.wap,"SMS"!==(m=_t()?null==p?void 0:p.signType:null==h?void 0:h.signType)){e.next=9;break}return e.abrupt("return",Promise.resolve(Jv));case 9:if(m&&"REDIRECT"===m){e.next=11;break}return e.abrupt("return",Promise.resolve({success:!1}));case 11:if(!Ia()){e.next=13;break}return e.abrupt("return",Promise.resolve(Jv));case 13:return this._performanceData.push({key:"sdk_action_query_start",value:Date.now()}),f={paymentSessionConfig:u,paymentSessionData:r},e.prev=15,e.t0=t,e.t1=f,e.t2=s,e.t3=l,e.next=22,this.acquireApdidToken();case 22:return e.t4=e.sent,e.t5={locale:e.t3,deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"},e.next=28,e.t0.request.call(e.t0,e.t1,e.t7);case 28:return v=e.sent,this._performanceData.push({key:"sdk_action_query_end",value:Date.now()}),this.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{config:JSON.stringify(u),rpcTraceId:v.traceId}),e.abrupt("return",v);case 34:return e.prev=34,e.t8=e.catch(15),this.logger.logError({title:"sdk_event_sdkQuery_failed"},{config:JSON.stringify(u),errorMessage:JSON.stringify(e.t8),rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",Promise.reject());case 38:case"end":return e.stop()}}),e,this,[[15,34]])}))),function(){return n.apply(this,arguments)})},{key:"webLaunchPromise",value:function(){var e=this;return this._performanceData.push({key:"sdk_onLaunch",value:Date.now()}),new Promise((function(t,n){var r=setTimeout((function(){n(new Error("Load resource timeout")),e.eventCenter.dispatchToApp({event:ve.error.name,data:me.CREATECOMPONENT_ERROR.LOAD_APP_TIMEOUT}),e.logger.logError({title:"sdk_error_web_app_timeout"})}),Re);e.eventCenter.listen("onLaunch",(function(e){clearTimeout(r),t(e)}))}))}},{key:"sendRequestAndWaitWebLaunch",value:function(){var e=this,t=this.paymentContext||{},n=t.paymentSessionObj,r=void 0===n?{}:n,o=t.paymentSessionId,i=t.displayInfo,a=t.startBizFlowOptions;Promise.all([this.webLaunchPromise(),this.getSdkActionQuery(),this.initSecuritySDK()]).then((function(t){var n,s,l=tt()(t,2),c=(l[0],l[1]);e._performanceData.push({key:"sdk_render_component",value:Date.now()});var u=e.logger.getLogConfig().mdata;e.eventCenter.dispatchToApp({event:"renderComponent",data:{queryResult:c,sessionResult:r,paymentSessionData:o,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:i.type,appearance:null==i?void 0:i.appearance,notRedirectAfterComplete:!0===(null===(n=a.submitPayRequestExtra)||void 0===n?void 0:n.notRedirectAfterComplete),isAppWebview:a.isAppWebview,merchantAppointParam:null===(s=a.submitPayRequestExtra)||void 0===s?void 0:s.merchantAppointParam,envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:h()(h()({trackId:u.requestSeq,platform:u.platform,firstLogTime:u.firstLogTime},(null==r?void 0:r.paymentSessionConfig)||{}),{},{renderDisplayType:u.renderDisplayType,sdkVersion:u.sdkVersion,merchantId:u.merchantId,instanceId:u.instanceId,paymentMethodType:u.paymentMethodType})}}),e.logger.logInfo({title:"sdk_event_renderComponent"}),e.eventCenter.dispatchToApp({event:"web-sdk-performance",data:{performanceData:e._performanceData}}),e.setAchAutoDebitContainerWidth()})).catch((function(t){e.eventCenter.emit(ve.destroy.name,{}),e.eventCenter.emit(ve.eventCallback.name,{code:ae.SDK_INTERNAL_ERROR,message:null==t?void 0:t.message})}))}},{key:"buildRedirectResult",value:function(e){return{behaviorType:"REDIRECT",payload:null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{url:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl}:{url:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl}}}},{key:"buildWebAppUrl",value:function(){var e,t,n,r,o=this.paymentContext,i=o.displayInfo,a=o.sdkMetaData,s=o.paymentSessionObj,l=null===(e=s.paymentSessionConfig)||void 0===e?void 0:e.paymentMethodCategoryType,c=null===(t=s.paymentSessionConfig)||void 0===t?void 0:t.productScene,u=null===(n=s.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,d=this.hostSign,p=s.clientId,h=s.extendInfo;return Dt({environment:this.initConfig.environment,paymentMethodCategoryType:l,sdkMetaData:a,productScene:c,productSceneVersion:u,isPreload:!1,query:{analyticsEnabled:null===(r=this.initConfig.analytics)||void 0===r?void 0:r.enabled,displayType:i.type,instanceId:this.instanceId,locale:this.initConfig.locale,hostSign:d},mid:p,extendInfo:h})}},{key:"initSecuritySDK",value:(t=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",Promise.resolve());case 9:case"end":return e.stop()}}),e,this,[[0,6]])}))),function(){return t.apply(this,arguments)})},{key:"setAchAutoDebitContainerWidth",value:function(){var e,t,n;this.isTrustly&&((null===(e=this.paymentContext)||void 0===e||null===(e=e.displayInfo)||void 0===e?void 0:e.platform)===te.desktop&&(null===(t=document.getElementById(_e))||void 0===t||t.setAttribute("style","max-width: 656px"),null===(n=document.getElementById(ye))||void 0===n||n.setAttribute("style","max-width: 656px")))}},{key:"isTrustly",get:function(){return this.componentSign===j.AUTO_DEBIT_APM}}]),e}();function Zv(e,t){var n,r=!1,o=void 0;if("EASY_PAY"===(null==t||null===(n=t.paymentSessionConfig)||void 0===n?void 0:n.productScene)){var i,a,s,l,c=!(null!==(i=t.action)&&void 0!==i&&i.autoDebitWithToken),u=null===(a=t.needAccountConfirmPage)||void 0===a||a;r=!c||!u,"2.0"===(null==t||null===(s=t.paymentSessionConfig)||void 0===s?void 0:s.productSceneVersion)&&["BANKTRANSFER_QUICKPAY"].includes(null==t||null===(l=t.paymentMethodInfoView)||void 0===l?void 0:l.paymentMethodType)&&(!1,o=function(t){var n=function(e){var t=e.instanceId,n=e.paymentMethodType,r=e.paymentSessionData,o=e.paymentSessionObj,i=e.locale,a=e.env,s=e.sdkVersion,l=e.notRedirectAfterComplete,c=!1,u=zt(o,a);return"".concat(u)+"?scene=cashierResultPage&"+"instanceId=".concat(t)+"&"+"paymentSessionData=".concat(encodeURIComponent(r))+"&"+"isLandscape=".concat(c?"true":"")+"&"+"pmt=".concat(n)+"&"+"locale=".concat(i)+"&"+"sdkVersion=".concat(s)+"&"+"mode=".concat(it.SDK)+"&"+"¬RedirectAfterComplete=".concat(l)}(t);return{callBackUrl:n,notRedirectAfterComplete:e}})}return{allowSubmitPayCallAhead:r,buildSubmitPayExtParams:o,createIframeNode:!0,loadApp:!0}}var Xv=function(){function e(){g()(this,e),c()(this,"paymentContext",void 0),c()(this,"initConfig",void 0),c()(this,"logger",void 0),c()(this,"securityService",void 0),c()(this,"eventCenter",void 0),c()(this,"instanceId",void 0),c()(this,"hostSign",void 0),c()(this,"allowQueryCall",void 0),c()(this,"allowSubmitPayCallAhead",void 0),c()(this,"channelBehavior",void 0),c()(this,"SECURITY_SDK_INIT_TIMEOUT",1500),c()(this,"SDK_REQUEST_TIMEOUT",15e3),c()(this,"LOAD_APP_RESOURCES_TIMEOUT",15e3)}var t,n,r,o,a;return f()(e,[{key:"init",value:function(e,t,n){this.initConfig=e,this.instanceId=t,this.logger=xf.getInstance(this.instanceId).getService("Log"),this.securityService=xf.getInstance(this.instanceId).getService("Security"),this.eventCenter=xf.getInstance(this.instanceId).getService("EventCenter"),bn.preloadWebApp(V.EASY_PAY,G.WALLET,this.initConfig.environment,!0)}},{key:"startBizFlow",value:(a=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,h;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(_t()&&"BANKTRANSFER_QUICKPAY"!==(null===(a=t.paymentSessionObj)||void 0===a||null===(a=a.paymentMethodInfoView)||void 0===a?void 0:a.paymentMethodType)&&(t.paymentSessionObj.paymentSessionConfig.productSceneVersion="1.0",t.paymentSessionObj.needAccountConfirmPage=!1),this.paymentContext=t,this.hostSign=((null==t?void 0:t.paymentSession)||"").split("&&")[1]||"",s=t.paymentSessionObj.paymentSessionConfig.productSceneVersion,l=t.paymentSessionObj.paymentSessionConfig.paymentMethodCategoryType,c=t.paymentSessionObj.action.autoDebitWithToken,u=t.paymentSessionObj.action.requireFastSdk,d=(null===(n=t.paymentSessionObj)||void 0===n?void 0:n.authUrlInfo)||{},this.channelBehavior=Zv(!0===(null===(r=t.startBizFlowOptions.submitPayRequestExtra)||void 0===r?void 0:r.notRedirectAfterComplete),t.paymentSessionObj),c||!u){e.next=12;break}return e.abrupt("return",this.buildRedirectResult(d));case 12:return p=this.buildWebAppUrl(),h={url:p,allowClickPopupOutsideClose:null===(o=this.channelBehavior)||void 0===o?void 0:o.allowClickOutsideClose},qt.savePreviousProductInfo(V.EASY_PAY,{paymentMethodCategoryType:l,hostSign:this.hostSign,productSceneVersion:s}),this.sendRequestAndWaitWebLaunch(),e.abrupt("return",{behaviorType:"RENDER",payload:h});case 17:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"buildWebAppUrl",value:function(){var e,t,n,r,o=this.paymentContext,i=null===(e=o.paymentSessionObj.paymentSessionConfig)||void 0===e?void 0:e.paymentMethodCategoryType,a=null===(t=o.paymentSessionObj.paymentSessionConfig)||void 0===t?void 0:t.productScene,s=null===(n=o.paymentSessionObj.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion,l=this.hostSign,c=o.paymentSessionObj.clientId,u=o.paymentSessionObj.extendInfo;return Dt({environment:this.initConfig.environment,paymentMethodCategoryType:i,sdkMetaData:o.sdkMetaData,productScene:a,productSceneVersion:s,isPreload:!1,query:{analyticsEnabled:null===(r=this.initConfig.analytics)||void 0===r?void 0:r.enabled,displayType:F.popup,instanceId:this.instanceId,locale:this.initConfig.locale,hostSign:l},mid:c,extendInfo:u})}},{key:"buildRedirectResult",value:function(e){return{behaviorType:"REDIRECT",payload:null!=e&&e.normalUrl||null!=e&&e.schemeUrl||null!=e&&e.applinkUrl||null==e||!e.authUrl?{url:null==e?void 0:e.normalUrl,schemeUrl:null==e?void 0:e.schemeUrl,applinkUrl:null==e?void 0:e.applinkUrl,openInApp:(null==e?void 0:e.openInApp)||!1}:{url:null==e?void 0:e.authUrl,schemeUrl:null==e?void 0:e.authUrl,applinkUrl:null==e?void 0:e.authUrl,openInApp:(null==e?void 0:e.openInApp)||!1}}}},{key:"sendRequestAndWaitWebLaunch",value:function(){var e=this,t=new Promise((function(t,n){var r=setTimeout((function(){n(new Error("Load resource timeout"))}),e.LOAD_APP_RESOURCES_TIMEOUT);e.eventCenter.listen("onLaunch",(function(n){clearTimeout(r),t(n),e.logger.logInfo({title:"sdk_event_webAppOnLaunch"})}))}));Promise.all([this.initSecuritySDK(),this.processQuery(),this.processSubmitPay(),t]).then((function(t){var n,r,o,i,a,s,l,c=tt()(t,4),u=(c[0],c[1]),d=c[2],p=(c[3],e.logger.getLogConfig().mdata),m={sessionResult:null===(n=e.paymentContext)||void 0===n?void 0:n.paymentSessionObj,submitResult:d,paymentSessionData:null===(r=e.paymentContext)||void 0===r?void 0:r.paymentSessionId,heightOfVisible:Math.max(window.changingPageHeight,window.innerHeight),renderDisplayType:e.paymentContext.displayInfo.type,appearance:null===(o=e.paymentContext.displayInfo)||void 0===o?void 0:o.appearance,notRedirectAfterComplete:!0===(null===(i=e.paymentContext.startBizFlowOptions.submitPayRequestExtra)||void 0===i?void 0:i.notRedirectAfterComplete),isAppWebview:e.paymentContext.startBizFlowOptions.isAppWebview,isNativeAppWebview:e.paymentContext.startBizFlowOptions.isNativeAppWebview,merchantAppointParam:null===(a=e.paymentContext.startBizFlowOptions.submitPayRequestExtra)||void 0===a?void 0:a.merchantAppointParam,allowSubmitPayCallAhead:e.allowSubmitPayCallAhead,doubleFaUrl:zt(null===(s=e.paymentContext)||void 0===s?void 0:s.paymentSessionObj,e.initConfig.environment),envInfo:{screenHeight:screen.height,screenWidth:screen.width},logMetaData:h()(h()({trackId:p.requestSeq,platform:p.platform,firstLogTime:p.firstLogTime},(null===(l=e.paymentContext.paymentSessionObj)||void 0===l?void 0:l.paymentSessionConfig)||{}),{},{renderDisplayType:p.renderDisplayType,sdkVersion:p.sdkVersion,merchantId:p.merchantId,instanceId:p.instanceId,paymentMethodType:p.paymentMethodType})};u&&(m.queryResult=u),e.eventCenter.dispatchToApp({event:"renderComponent",data:m}),e.logger.logInfo({title:"sdk_event_renderComponent"})})).catch((function(t){e.eventCenter.emit(ve.destroy.name,{}),e.eventCenter.emit(ve.eventCallback.name,{code:ae.SDK_INTERNAL_ERROR,result:{message:null==t?void 0:t.message}})}))}},{key:"processQuery",value:(o=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,m,f,v,g,y;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:l={paymentSessionData:(null===(t=this.paymentContext)||void 0===t?void 0:t.paymentSessionId)||"",paymentSessionConfig:null===(n=this.paymentContext)||void 0===n||null===(n=n.paymentSessionObj)||void 0===n?void 0:n.paymentSessionConfig},c=null===(r=this.paymentContext)||void 0===r?void 0:r.paymentSessionObj.extendInfo,u=null===(o=null===(a=this.paymentContext)||void 0===a?void 0:a.paymentSessionObj.needAccountConfirmPage)||void 0===o||o,d=!(null!==(s=this.paymentContext)&&void 0!==s&&null!==(s=s.paymentSessionObj.action)&&void 0!==s&&s.autoDebitWithToken),p=!0;try{m=JSON.parse(c),p=Ct(m.needQueryRender)||!0===m.needQueryRender}catch(e){console.log(e)}if(this.allowQueryCall=p&&d&&u,this.allowQueryCall){e.next=9;break}return e.abrupt("return",null);case 9:return f=He(),this.logger.logInfo({title:"sdk_event_sdkQuery"},{config:JSON.stringify(l.paymentSessionConfig),requestId:f}),v=xf.getInstance(this.instanceId).getService("Requester"),e.prev=12,e.t0=v,e.t1=h()(h()({},l),{},{actionType:"init",integrationType:"SDK",sdkVersion:null!==(g=this.paymentContext.sdkMetaData.sdkVersion)&&void 0!==g?g:"1.0.0"}),e.t2=this.initConfig.environment,e.t3=this.SDK_REQUEST_TIMEOUT,e.next=19,this.acquireApdidToken();case 19:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,timeout:e.t3,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.sdkAction.query"},e.next=25,e.t0.request.call(e.t0,e.t1,e.t7);case 25:return y=e.sent,this.logger.logInfo({title:"sdk_event_sdkQueryEnd"},{config:JSON.stringify(l.paymentSessionConfig),requestId:f,rpcTraceId:y.traceId}),e.abrupt("return",y);case 30:return e.prev=30,e.t8=e.catch(12),this.logger.logError({title:"sdk_event_sdkQuery_failed"},{config:JSON.stringify(l.paymentSessionConfig),errorMessage:JSON.stringify(e.t8),requestId:f,rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",null);case 34:case"end":return e.stop()}}),e,this,[[12,30]])}))),function(){return o.apply(this,arguments)})},{key:"processSubmitPay",value:(r=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,m,f,v,g,y,_,E,b,A,S,k,T,P,I,C,w,N;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c={paymentSessionData:(null===(t=this.paymentContext)||void 0===t?void 0:t.paymentSessionId)||"",paymentSessionConfig:null===(n=this.paymentContext)||void 0===n||null===(n=n.paymentSessionObj)||void 0===n?void 0:n.paymentSessionConfig},u=c.paymentSessionConfig||{},d=u.productSceneVersion,p=void 0===d?"":d,m=(null===(r=this.paymentContext)||void 0===r?void 0:r.paymentSessionObj)||{},f=m.action,g=(v=void 0===f?{}:f).enableSignAgreement,y=void 0!==g&&g,_=v.autoDebitWithToken,E=void 0!==_&&_,"2.0"!==p||E||(c.signAgreement=y,A=null===(b=this.paymentContext.paymentSessionObj)||void 0===b||null===(b=b.paymentMethodInfoView)||void 0===b?void 0:b.paymentMethodType,S=this.paymentContext.startBizFlowOptions.isAppWebview,k=this.paymentContext.startBizFlowOptions.isNativeAppWebview,"ALIPAY_CN"!==A||S&&k||(T=sv(void 0,this.logger))&&"https"!==T&&(c.h5FromApp=encodeURIComponent(T))),this.allowSubmitPayCallAhead=this.channelBehavior.allowSubmitPayCallAhead,this.allowSubmitPayCallAhead){e.next=7;break}return e.abrupt("return",{message:"sdk no need to make submitPay request",success:!0});case 7:return P=He(),this.logger.logInfo({title:"sdk_event_submitPay"},{config:JSON.stringify(c.paymentSessionConfig),requestId:P}),I=(null===(o=this.channelBehavior)||void 0===o||null===(a=o.buildSubmitPayExtParams)||void 0===a?void 0:a.call(o,{instanceId:this.instanceId,locale:this.initConfig.locale,paymentMethodType:null===(s=this.paymentContext.paymentSessionObj)||void 0===s||null===(s=s.paymentMethodInfoView)||void 0===s?void 0:s.paymentMethodType,paymentSessionData:this.paymentContext.paymentSessionId,paymentSessionObj:this.paymentContext.paymentSessionObj,env:this.initConfig.environment,sdkVersion:this.paymentContext.sdkMetaData.sdkVersion,notRedirectAfterComplete:!0===(null===(l=this.paymentContext)||void 0===l||null===(l=l.startBizFlowOptions)||void 0===l||null===(l=l.submitPayRequestExtra)||void 0===l?void 0:l.notRedirectAfterComplete)}))||{},E||(I.complianceSDK=!0),c.extParams=I,C=xf.getInstance(this.instanceId).getService("Requester"),e.prev=13,e.t0=C,e.t1=h()(h()({},c),{},{integrationType:"SDK",sdkVersion:null!==(w=this.paymentContext.sdkMetaData.sdkVersion)&&void 0!==w?w:"1.0.0"}),e.t2=this.initConfig.environment,e.t3=this.SDK_REQUEST_TIMEOUT,e.next=20,this.acquireApdidToken();case 20:return e.t4=e.sent,e.t5={deviceId:e.t4},e.t6=this.hostSign,e.t7={env:e.t2,timeout:e.t3,envInfo:e.t5,hostSign:e.t6,needEnvInfo:!0,"Operation-Type":"com.ipay.iexpcashier.cashier.submitPayByPaymentSession"},e.next=26,e.t0.request.call(e.t0,e.t1,e.t7);case 26:return N=e.sent,this.logger.logInfo({title:"sdk_event_submitPayEnd"},{config:JSON.stringify(c.paymentSessionConfig),requestId:P,rpcTraceId:N.traceId}),e.abrupt("return",N);case 31:return e.prev=31,e.t8=e.catch(13),this.logger.logError({title:"sdk_event_submitPay_failed"},{config:JSON.stringify(c.paymentSessionConfig),errorMessage:JSON.stringify(e.t8),requestId:P,rpcTraceId:null===e.t8||void 0===e.t8?void 0:e.t8.traceId}),e.abrupt("return",null);case 35:case"end":return e.stop()}}),e,this,[[13,31]])}))),function(){return r.apply(this,arguments)})},{key:"acquireApdidToken",value:(n=s()(i()().mark((function e(){var t,n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=xf.getInstance(this.instanceId).getService("Security"),r=null===(t=this.paymentContext.paymentSessionObj)||void 0===t||null===(t=t.paymentSessionConfig)||void 0===t?void 0:t.productScene,o=n.getDeviceId({productScene:r}),e.abrupt("return",o);case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"initSecuritySDK",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,h;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,l=this.paymentContext.paymentSessionObj.paymentSessionConfig.productSceneVersion,c=null!==(t=null===(n=this.paymentContext.paymentSessionObj.action)||void 0===n?void 0:n.nonInitSecuritySDK)&&void 0!==t&&t,u=null!==(r=null===(o=this.paymentContext.paymentSessionObj.action)||void 0===o?void 0:o.signButtonDisplay)&&void 0!==r&&r,d=null!==(a=null===(s=this.paymentContext.paymentSessionObj.action)||void 0===s?void 0:s.userSignAgreement)&&void 0!==a&&a,p=!this.paymentContext.paymentSessionObj.action.autoDebitWithToken,h=!1,c||"1.0"===l?h=!1:"2.0"===l&&(h=!p||u&&d),!h){e.next=11;break}return e.next=11,this.securityService.initSecurity(this.SECURITY_SDK_INIT_TIMEOUT);case 11:this.logger.logInfo({title:"a3753.b101271.c388193.d514078"},{riskSdkInfo:h?pe.NEED:pe.NO_NEED}),e.next=16;break;case 14:e.prev=14,e.t0=e.catch(0);case 16:case"end":return e.stop()}}),e,this,[[0,14]])}))),function(){return t.apply(this,arguments)})}]),e}();var $v="https://dev.page.alipay.net",eg="https://test.page.alipay.net",tg="https://pre.ac.alipay.com",ng="https://checkout.antom.com",rg="/page/antom-web-checkout-v2/checkout-page/pages/payment/index.html",og="/checkout-page2/pages/payment/index.html",ig=function(){function e(t){var n=this;g()(this,e),c()(this,"logger",void 0),c()(this,"_instanceId",void 0),c()(this,"iframe",void 0),c()(this,"originOptions",void 0),c()(this,"APP_IFRAME_ID","antom-checkout-page-sub-page-iframe"),c()(this,"eventListener",void 0),c()(this,"generateIframeSrc",(function(e,t){var r=n.originOptions.environment||"prod",o=e||"",i=n.originOptions.locale||"en_US",a=Wh(e,"ckp2").modernWeb?function(e){switch(e){case"dev":return"".concat($v).concat(og);case"sit":return"".concat(eg).concat(og);case"pre":return"".concat(tg).concat(og);case"prod":case"sandbox":case"light_sandbox":return"".concat(ng).concat(og);default:return e}}(r):function(e){switch(e){case"dev":return"".concat($v).concat(rg);case"sit":return"".concat(eg).concat(rg);case"pre":return"".concat(tg).concat(rg);case"prod":case"sandbox":case"light_sandbox":return"".concat(ng).concat("/checkout-page/pages/payment/index.html");default:return e}}(r);console.log("[antom-web-sdk] <antom-checkout-page> generateIframeSrc",n.originOptions,r,o,i,a);var s=a.split("?")[0],l=Et(a);return l.sessionData=o,l.lang=i,l.mode="embed","sandbox"===r&&(l.shadow="true"),t&&(l.demoMode="true"),Object.keys(l).forEach((function(e){s+="".concat(s.includes("?")?"&":"?").concat(e,"=").concat(encodeURIComponent(l[e]))})),s})),c()(this,"eventListenerWrapper",(function(e){var t,r,o=JSON.parse(e.data)||{},i=o.code,a=o.message,s=o.result,l=(null==o?void 0:o.context)||{event:"",data:{}},c=l.event,u=l.data;if(c&&null!=c&&c.startsWith("getDomain")){var d,p,m=null===(d=window)||void 0===d||null===(d=d.location)||void 0===d?void 0:d.hostname;n.logger.logInfo({code:"a3753.b146681",msg:m}).send();var f=h()(h()({},null==o?void 0:o.context),{},{data:{doMain:null===(p=window)||void 0===p||null===(p=p.location)||void 0===p?void 0:p.hostname},event:"appEventCallback"});n.dispatchToApp(f)}i&&i.startsWith("SDK_PAYMENT")&&(console.log("[antom-web-sdk] <antom-checkout-page> eventListenerWrapper",e,a,s),null===(t=n.eventListener)||void 0===t||t.call(n,{code:i,message:a,result:s}));c&&null!=c&&c.startsWith("onRedirect")&&(null===(r=n.eventListener)||void 0===r||r.call(n,{code:i,message:a,result:s}),function(e){return new Promise((function(t,n){var r=(gt?ee.WAP:ee.WEB)===ee.WEB,o=(null==e?void 0:e.normalUrl)||"",i=(null==e?void 0:e.schemeUrl)||"",a=(null==e?void 0:e.applinkUrl)||"",s=(null==e?void 0:e.callAppJudgeTime)||"",l=function(){if(o)return t(),void(window.location.href=o);n(me.SDK_LAUNCH_PAYMENT_APP_ERROR.CALL_APP_URL_ERROR)};r?l():function(){if(i||a){var e={fallback:function(){l()},successCb:function(){t()},delay:0};s&&(e.resultJudgmentTime=s);try{new Xs(e).open({scheme:i,link:a})}catch(e){l()}}else l()}()}))}(u).then((function(){var e=h()(h()({},null==o?void 0:o.context),{},{event:"appEventCallback"});n.dispatchToApp(e)})))})),c()(this,"addListener",(function(){window.addEventListener("message",n.eventListenerWrapper)})),c()(this,"removeListener",(function(){window.removeEventListener("message",n.eventListenerWrapper)})),c()(this,"dispatchToApp",(function(e){var t,r={name:ne.SDK_TO_APP,context:e};null===(t=n.iframe)||void 0===t||null===(t=t.contentWindow)||void 0===t||t.postMessage(JSON.stringify(r),"*")})),t.environment=t.environment||X.prod,this._instanceId=He(),this.iframe=null,this.originOptions=t,this.eventListener=t.onEventCallback,this.logger=new Ua(Ka,![X.prod,X.sandbox].includes(null==t?void 0:t.environment)),Ua.setInstance(this.logger),this.logger.setMedta({instanceId:this._instanceId}),this.logger.initTracker(),this.logger.setComponentStartTime(Date.now()),this.logger.setTrackId(this._instanceId),this.logger.logInfo({title:"NEW_AMSSDK_BY_MECHANT",msg:"".concat(null==t?void 0:t.environment,"_").concat(null==t?void 0:t.locale)}).send()}return f()(e,[{key:"mountComponent",value:function(e,t){if(void 0===e.sessionData||""===e.sessionData||"string"!=typeof e.sessionData)throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_INVALID_SESSION_DATA"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: sessionData is required and must be a string"),new Error("PARAMS_ERROR_INVALID_SESSION_DATA");if(document.querySelector(this.APP_IFRAME_ID))throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_ALREADY_MOUNTED"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: already mounted, please unmount first"),new Error("PARAMS_ERROR_ALREADY_MOUNTED");this.addListener();var n=this.generateIframeSrc(e.sessionData,e.isDemoMode),r=document.createElement("iframe");r.id=this.APP_IFRAME_ID,r.src=n,r.allow="payment",r.width="100%",r.height="100%",r.style.border="none";var o=document.querySelector(t);if(!o)throw this.logger.logError({title:"event_important_error",msg:"PARAMS_ERROR_INVALID_SELECTOR"}),console.error("[antom-web-sdk] <antom-checkout-page> mountComponent: invalid selector"),this.removeListener(),new Error("PARAMS_ERROR_INVALID_SELECTOR");return o.innerHTML="",o.appendChild(r),this.iframe=r,Promise.resolve()}},{key:"unmount",value:function(){this.removeListener();var e=document.getElementById(this.APP_IFRAME_ID);e&&e.remove()}}]),e}(),ag=new Ua(Ka,!0),sg=function(e){_()(n,e);var t=b()(n);function n(e,r){var o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"1.0";return g()(this,n),(o=t.call(this,h()({appVersion:P},e))).preloadComponent(r,i),o}return f()(n)}(al),lg=function(e){_()(n,e);var t=b()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:V.AUTO_DEBIT_PAY});return t.call(this,r,[j.AUTO_DEBIT_PAY_WALLET])}return f()(n,null,[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};bn.preloadWebApp(V.AUTO_DEBIT_PAY,G.WALLET,e.environment),bn.preloadSecuritySDK(V.AUTO_DEBIT_PAY,e.securityRegion,e.environment)}}]),n}(sg),cg=function(e){_()(n,e);var t=b()(n);function n(e){g()(this,n);var r,o=Object.assign({},e,{product:V.CASHIER_PAYMENT,appVersion:"1.47.2"});try{var i=localStorage.getItem("antom_checkout_previousChannel"),a=(JSON.parse(i)||{}||{}).channelType,s=void 0===a?"":a;r=[j.CASHIER_PAYMENT_CARD,j.CASHIER_PAYMENT_APM,j.CASHIER_PAYMENT_BANK].includes(s)?[s]:[j.CASHIER_PAYMENT_CARD,j.CASHIER_PAYMENT_APM]}catch(e){ag.logError({title:"performance_optimization_get_previousChannel_error"},{errorMessage:e})}return t.call(this,o,r)}return f()(n,[{key:"validateFields",value:function(){return this._validateFields()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};try{var t,n=localStorage.getItem("antom_checkout_previousChannel"),r=JSON.parse(n)||{},o=r||{},i=o.channelType,a=void 0===i?"":i;t=j.CASHIER_PAYMENT_CARD===a?[G.CARD]:j.CASHIER_PAYMENT_APM===a?[G.APM]:j.CASHIER_PAYMENT_BANK===a?[G.BANK]:[G.CARD,G.APM];var s,l=d()(t);try{for(l.s();!(s=l.n()).done;){var c=s.value;bn.preloadWebApp(V.CASHIER_PAYMENT,c,e.environment)}}catch(e){l.e(e)}finally{l.f()}}catch(e){console.error("[web-sdk] preload web app error",e)}bn.preloadSecuritySDK(V.CASHIER_PAYMENT,e.securityRegion,e.environment)}}]),n}(sg),ug=function(e){_()(n,e);var t=b()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:V.VAULTING,appVersion:"1.47.2"});return t.call(this,r,[j.CASHIER_PAYMENT_CARD])}return f()(n,null,[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};bn.preloadWebApp(V.CASHIER_PAYMENT,G.CARD,e.environment),bn.preloadSecuritySDK(V.VAULTING,e.securityRegion,e.environment)}}]),n}(sg),dg=function(e){_()(n,e);var t=b()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:V.ELEMENT_PAYMENT,appVersion:"1.47.2"});return t.call(this,r,[j.ELEMENT_PAYMENT])}return f()(n)}(sg),pg=function(e){_()(n,e);var t=b()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:V.ELEMENT_ADDRESS,appVersion:"1.47.2"});return t.call(this,r)}return f()(n)}(sl),hg=function(e){_()(n,e);var t=b()(n);function n(e){g()(this,n);var r=Object.assign({},e,{product:V.ELEMENT_PAYMENT,environment:e.environment});return t.call(this,r)}return f()(n)}(qv),mg=function(){function e(t){g()(this,e),c()(this,"core",void 0),this.core=new cv,this.core.registerProcessor(V.EASY_PAY,"",new Xv),this.core.init(t,V.EASY_PAY)}return f()(e,[{key:"createComponent",value:function(e){this.core.startBizFlow({submitPayRequestExtra:{notRedirectAfterComplete:e.notRedirectAfterComplete,merchantAppointParam:e.merchantAppointParam},paymentSession:e.sessionData||e.paymentSessionData,displayInfo:{type:F.popup},isAppWebview:e.isAppWebview,isNativeAppWebview:e.isNativeAppWebview})}},{key:"unmount",value:function(){this.core.destroy()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};bn.preloadWebApp(V.EASY_PAY,G.WALLET,e.environment,!0)}}]),e}(),fg=function(){function e(t){g()(this,e),c()(this,"core",void 0),this.core=new cv,this.core.registerProcessor(V.AUTO_DEBIT,"",new Qv),this.core.init(t,V.AUTO_DEBIT)}var t;return f()(e,[{key:"createComponent",value:(t=s()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.core.startBizFlow({submitPayRequestExtra:{notRedirectAfterComplete:t.notRedirectAfterComplete,merchantAppointParam:t.merchantAppointParam},paymentSession:t.sessionData||t.paymentSessionData,displayInfo:{type:F.popup},isAppWebview:t.isAppWebview});case 3:e.next=9;break;case 5:e.prev=5,e.t0=e.catch(0),this.core.getServiceProvider().getService("EventCenter").emit(ve.eventCallback.name,{code:ae.SDK_CREATEPAYMENT_PARAMETER_ERROR,message:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"Initialization parameter exception."}),this.core.destroy();case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return t.apply(this,arguments)})},{key:"unmount",value:function(){this.core.destroy()}}],[{key:"preload",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{securityRegion:"SG",environment:"prod"};bn.preloadWebApp(V.AUTO_DEBIT,G.WALLET,e.environment),bn.preloadSecuritySDK(V.AUTO_DEBIT,e.securityRegion,e.environment)}}]),e}(),vg=new Ua(Ka,!0);var gg=n(1159),yg=function(e){try{var t,n=e;return(null==n?void 0:n.code)||(null==n||null===(t=n.error)||void 0===t?void 0:t.code)||"UNKNOWN"}catch(e){return"UNKNOWN"}},_g=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";try{gg.tracker.log({code:"7882api",msg:"loadAntom",d1:n,d2:r,d3:"",d4:"",d5:"loadAntom",d6:e.env,d7:String(void 0!==e.locale),d8:void 0===e.debug?"":String(e.debug),m1:Date.now()-t})}catch(e){}};function Eg(e,t){return bg.apply(this,arguments)}function bg(){return(bg=s()(i()().mark((function e(t,n){var r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Date.now(),e.prev=1,e.next=4,n();case 4:return o=e.sent,_g(t,r,"success"),e.abrupt("return",o);case 9:throw e.prev=9,e.t0=e.catch(1),_g(t,r,"error",yg(e.t0)),e.t0;case 13:case"end":return e.stop()}}),e,null,[[1,9]])})))).apply(this,arguments)}var Ag="7882",Sg=0,kg=new Set(["error","destroy","paymentMethodChanged","billingAddressChanged","closePaymentPolling","onSubmitPayCallback","onEventCallback","onRedirect","webAppReady","onLaunch","showPopup","dismissLoading","renderComponent","appHeartBeat","showToast","reset","onClose"]),Tg=function(e){try{var t=String(e);if(kg.has(t))return t;if(t.startsWith("OPENSDK@"))return"bridge_event"}catch(e){}return"other"},Pg=function(e,t){if(null!=e&&e.clientId)return e.clientId;try{var n=null!=e&&e.extendInfo?JSON.parse(e.extendInfo):void 0;if("string"==typeof(null==n?void 0:n.merchantId)&&n.merchantId)return function(e){try{return decodeURIComponent(e)}catch(e){return""}}(n.merchantId)}catch(e){}return(null==t?void 0:t.merchantId)||""},Ig=function(e){if(!e)return"";try{return Nh(e)||""}catch(e){return""}};function Cg(e,t){var n,r,o,a,l=function(e){if(e)try{return Gh(e)}catch(e){return}}(e),c={merchantId:Pg(l),productScene:(null==l||null===(n=l.paymentSessionConfig)||void 0===n?void 0:n.productScene)||"",productSceneVersion:(null==l||null===(r=l.paymentSessionConfig)||void 0===r?void 0:r.productSceneVersion)||"",paymentMethodCategoryType:(null==l||null===(o=l.paymentSessionConfig)||void 0===o?void 0:o.paymentMethodCategoryType)||"",paymentMethodType:(null==l||null===(a=l.paymentMethodInfoView)||void 0===a?void 0:a.paymentMethodType)||"",trackId:Ig(e),locale:t.locale||""},u=t.elementInstanceId||"".concat(t.elementType,"_").concat(++Sg),d="payment"===t.elementType?"payment_v2":t.elementType,p=function(){return{merchant_id:c.merchantId,product_scene:c.productScene,product_scene_version:c.productSceneVersion,payment_method_category_type:c.paymentMethodCategoryType,payment_method_type:c.paymentMethodType,element_type:d,idengine_timezone:yv(),element_instance_id:u,sdk_version:"0.0.1787898127-dev.21",env:t.env||"",locale:c.locale}},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{c.trackId&&_c.setTrackId(c.trackId);var r="".concat(Ag).concat("error"===e?"":e);_c.log(h()(h()({code:r,msg:t},n),p()))}catch(e){}},f=function(e,t){try{return e()}catch(e){return t}},v=function(e){return e?f((function(){return h()({},e())}),{}):{}},g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{m("api",e,h()({d1:t.outcome,d2:t.errorCode||"",d3:t.traceId||"",d4:c.paymentMethodType,m1:t.durationMs},n))}catch(e){}},y=function(e,t,n,r){var o=function(e){try{var t,n,r=e;return{code:(null==r?void 0:r.code)||(null==r||null===(t=r.error)||void 0===t?void 0:t.code)||"UNKNOWN",source:"string"==typeof(null==r?void 0:r.source)?r.source:"system",traceId:(null==r?void 0:r.traceId)||(null==r||null===(n=r.error)||void 0===n?void 0:n.traceId)||""}}catch(e){return{code:"UNKNOWN",source:"system",traceId:""}}}(n),i=v(e.errorFields?function(){return e.errorFields(o)}:void 0);g(e.msg,{outcome:"error",durationMs:Date.now()-r,errorCode:o.code,traceId:o.traceId},h()(h()({},t),i))},_=function(e,t,n,r){var o=function(e,t){return e?f((function(){var n=e(t);return{outcome:n.outcome,errorCode:n.errorCode,traceId:n.traceId,fields:n.fields?h()({},n.fields):{}}}),{outcome:"unknown"}):{outcome:"success"}}(e.outputFields,n);g(e.msg,{outcome:o.outcome,durationMs:Date.now()-r,errorCode:o.errorCode,traceId:o.traceId},h()(h()({},t),o.fields||{}))},E=_c;try{var b=Object.create(_c);b.log=function(){try{c.trackId&&_c.setTrackId(c.trackId);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0],o=t.slice(1);if(r&&"object"===Je()(r))return void _c.log.apply(_c,[h()(h()({},r),p())].concat($e()(o)));_c.log.apply(_c,t)}catch(e){}},E=b}catch(e){}return{get merchantId(){return c.merchantId},get productScene(){return c.productScene},get productSceneVersion(){return c.productSceneVersion},get paymentMethodCategoryType(){return c.paymentMethodCategoryType},get paymentMethodType(){return c.paymentMethodType},get trackId(){return c.trackId},requestTracker:E,enrich:function(e){var t,n,r,o,i=e.metaData,a=e.renderData,s=e.locale;c.merchantId||(c.merchantId=Pg(i,a)),c.productScene||(c.productScene=(null==i||null===(t=i.paymentSessionConfig)||void 0===t?void 0:t.productScene)||""),c.productSceneVersion||(c.productSceneVersion=(null==i||null===(n=i.paymentSessionConfig)||void 0===n?void 0:n.productSceneVersion)||""),c.paymentMethodCategoryType||(c.paymentMethodCategoryType=(null==i||null===(r=i.paymentSessionConfig)||void 0===r?void 0:r.paymentMethodCategoryType)||""),c.paymentMethodType||(c.paymentMethodType=(null==i||null===(o=i.paymentMethodInfoView)||void 0===o?void 0:o.paymentMethodType)||""),s&&(c.locale=s)},setPaymentMethodType:function(e){e&&(c.paymentMethodType=e)},trackMount:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m("mount",e,t)},trackHandshake:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m("handshake",e,t)},trackElement:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m("element",e,t)},trackApi:g,trackError:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return m("error",e,t)},runAsyncApi:function(e){return s()(i()().mark((function t(){var n,r,o;return i()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=Date.now(),r=v(e.inputFields),t.prev=2,t.next=5,e.action();case 5:o=t.sent,t.next=12;break;case 8:throw t.prev=8,t.t0=t.catch(2),y(e,r,t.t0,n),t.t0;case 12:return _(e,r,o,n),t.abrupt("return",o);case 14:case"end":return t.stop()}}),t,null,[[2,8]])})))()},runSyncApi:function(e){var t,n=Date.now(),r=v(e.inputFields);try{t=e.action()}catch(t){throw y(e,r,t,n),t}return _(e,r,t,n),t}}}function wg(e,t){var n,r=e,o=t.appearance;o&&Object.prototype.hasOwnProperty.call(o,"rules")&&(n=o.rules,Boolean(n&&"object"===Je()(n)&&!Array.isArray(n)&&0===Object.keys(n).length))&&(r.appearance=h()(h()({},r.appearance),{},{rules:{}}))}var Ng=Object.freeze({}),Og=function(e){_()(a,e);var t,n,r,o=b()(a);function a(e,t){var n,r,i;g()(this,a);var s={theme:"default",rules:Ng},l=null===(n=t.appConfig)||void 0===n?void 0:n.sessionData;if("string"!=typeof l||!l.trim())throw new Qh("sessionData is required","SESSION_DATA_INVALID","SDK_USAGE");var u=Nh(l);return u&&_c.setTrackId(u),i=o.call(this,e,ll("/element_payment_modern/index.html",Jh(l)),h()(h()({},t),{},{trackId:u}),bc({appearance:s},t.appConfig)),c()(Ze()(i),"sessionData",void 0),c()(Ze()(i),"elementTracker",void 0),c()(Ze()(i),"_mountInProgress",!1),c()(Ze()(i),"_destroyInProgress",!1),i.sessionData=l,i.elementTracker=Cg(l,{elementType:a.elementType,elementInstanceId:e,env:t.env,locale:t.locale}),pl()((r=Ze()(i),ml()(a.prototype)),"on",r).call(r,"destroy",(function(){i.destroy()})),i}return f()(a,[{key:"setup",value:(r=s()(i()().mark((function e(){var t,n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve({locale:(null===(t=this.config.appConfig)||void 0===t?void 0:t.locale)||this.config.locale,paymentFlow:null!==(n=null===(r=this.config.appConfig)||void 0===r?void 0:r.paymentFlow)&&void 0!==n?n:"cvv",sdkVersion:"0.0.1787898127-dev.21",_requestConfig:h()({env:this.config.env},cl())}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateConfig",value:(n=s()(i()().mark((function e(t){var n=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.elementTracker.runAsyncApi({msg:"updateConfig",inputFields:function(){var e,n;return{d5:"element.updateConfig",d6:a.elementType,d7:String(void 0!==(null==t?void 0:t.appearance)),d8:(null==t||null===(e=t.appearance)||void 0===e?void 0:e.theme)||"",d9:String(!(null==t||null===(n=t.appearance)||void 0===n||!n.rules)&&Object.keys(t.appearance.rules).length>0)}},action:function(){var e=void 0===t.appearance?{}:{appearance:t.appearance};return wg(n.config.appConfig,e),pl()(ml()(a.prototype),"updateConfig",n).call(n,e)},outputFields:function(e){var t,n,r;return{outcome:null!=e&&e.error?"fail":"success",errorCode:null==e||null===(t=e.error)||void 0===t?void 0:t.code,traceId:null==e||null===(n=e.error)||void 0===n?void 0:n.traceId,fields:{d14:String(!(null==e||!e.error)),d15:(null==e||null===(r=e.error)||void 0===r?void 0:r.source)||""}}},errorFields:function(e){return{d14:"",d15:e.source}}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"submit",value:function(e){var t=this;return this.elementTracker.runAsyncApi({msg:"element.submit",inputFields:function(){var n;return{d5:"element.submit",d6:(null==e?void 0:e.redirect)||"",d7:String(void 0!==(null==e?void 0:e.params)),d8:(null===(n=t.config.appConfig)||void 0===n?void 0:n.paymentFlow)||""}},action:function(){return t._submit(h()(h()({},e),{},{sessionData:t.sessionData}))},outputFields:function(e){var t,n,r;return{outcome:(r=null==e?void 0:e.status,"SUCCESS"===r?"success":"FAIL"===r?"fail":"CANCELLED"===r?"cancelled":"PROCESSING"===r?"processing":"unknown"),errorCode:null==e||null===(t=e.error)||void 0===t?void 0:t.code,traceId:null==e||null===(n=e.error)||void 0===n?void 0:n.traceId,fields:{d10:(null==e?void 0:e.status)||"",d11:void 0===(null==e?void 0:e.userCanceled3D)?"":String(e.userCanceled3D),d14:(null==e?void 0:e.code)||"",d15:""}}},errorFields:function(e){return{d15:e.source}}})}},{key:"mount",value:(t=s()(i()().mark((function e(t){var n,r=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.status,this._mountInProgress=!0,e.prev=2,e.next=5,this.elementTracker.runAsyncApi({msg:"mount",inputFields:function(){return{d5:"element.mount",d6:a.elementType,d7:String(!!t),d8:n}},action:function(){return pl()(ml()(a.prototype),"mount",r).call(r,t)},outputFields:function(){return{outcome:"success",fields:{d9:r.status,d10:String(!!r.iframe),d11:""}}},errorFields:function(e){return{d9:r.status,d10:String(!!r.iframe),d11:e.source}}});case 5:return e.abrupt("return",e.sent);case 6:return e.prev=6,this._mountInProgress=!1,e.finish(6);case 9:case"end":return e.stop()}}),e,this,[[2,,6,9]])}))),function(e){return t.apply(this,arguments)})},{key:"on",value:function(e,t){var n=this;return this.elementTracker.runSyncApi({msg:"on",inputFields:function(){return{d5:"element.on",d6:a.elementType,d7:Tg(e),d8:String("function"==typeof t)}},action:function(){return pl()(ml()(a.prototype),"on",n).call(n,e,t)},outputFields:function(){return{outcome:"success",fields:{d9:""}}},errorFields:function(e){return{d9:e.source}}})}},{key:"unmount",value:function(){var e=this;if(!this._mountInProgress&&!this._destroyInProgress){var t=this.status;return this.elementTracker.runSyncApi({msg:"unmount",inputFields:function(){return{d5:"element.unmount",d6:a.elementType,d7:t}},action:function(){return pl()(ml()(a.prototype),"unmount",e).call(e)},outputFields:function(){return{outcome:"success",fields:{d8:e.status,d9:""}}},errorFields:function(t){return{d8:e.status,d9:t.source}}})}pl()(ml()(a.prototype),"unmount",this).call(this)}},{key:"destroy",value:function(){var e=this,t=this.status;this._destroyInProgress=!0;try{return this.elementTracker.runSyncApi({msg:"element.destroy",inputFields:function(){return{d5:"element.destroy",d6:a.elementType,d7:t}},action:function(){return pl()(ml()(a.prototype),"destroy",e).call(e)},outputFields:function(){return{outcome:"success",fields:{d8:e.status,d9:""}}},errorFields:function(t){return{d8:e.status,d9:t.source}}})}finally{this._destroyInProgress=!1}}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),a}(Yc);c()(Og,"elementType","CVV");var Rg=n(8010),Mg=n.n(Rg),Dg={AMOUNT_VALUE_EMPTY:"Payment amount cannot be empty.",AMOUNT_VALUE_INVALID:"Payment amount must be a string of 1 to 15 ASCII digits representing a value greater than zero.",AMOUNT_CURRENCY_MISMATCH:"Payment amount currency does not match the payment session currency.",AMOUNT_CURRENCY_UNSUPPORTED:"Payment amount currency is not supported.",AMOUNT_PRECISION_UNSUPPORTED:"Payment amount precision is not supported.",AMOUNT_RESOLVE_TIMEOUT:"Payment amount conversion timed out.",AMOUNT_RESOLVE_FAILED:"Payment amount conversion failed."};var Lg=["alipay","applePay","googlePay","paypal"],xg=function(e){if(!e||"object"!==Je()(e))return"";var t=e;return Lg.filter((function(e){return!0===t[e]})).join(",")};function Ug(){var e=null,t=function(){e&&(e.remove(),e=null)};return{show:function(){if(!e){var n=document.createElement("div");n.style.cssText="position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,0.85);z-index:999999;pointer-events:auto;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity 300ms;overflow:hidden;",requestAnimationFrame((function(){n.style.opacity="1"}));var r=document.createElement("button");r.style.cssText="position:absolute;top:16px;right:16px;width:32px;height:32px;border:none;background:none;border-radius:50%;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px;line-height:1;",r.innerHTML="✕",r.addEventListener("click",t);var o=document.createElement("div");o.style.cssText="display:flex;flex-direction:column;align-items:center;max-width:400px;width:100%;padding:0 24px;text-align:center;box-sizing:border-box;";var i=document.createElement("div");i.setAttribute("role","img"),i.setAttribute("aria-label","PayPal"),i.style.cssText="width:149px;height:37px;margin-bottom:16px;background:url(https://cdn.marmot-cloud.com/storage/antom/2026/04/15/SNOUhDH/paypal.svg) center/contain no-repeat;";var a=document.createElement("p");a.style.cssText="margin:0;font-size:14px;line-height:1.6;color:#fff;",a.textContent=sh.get({id:"element.page.PAYPAL_OVERLAY_MESSAGE",defaultMessage:"Complete the payment in the opened PayPal window, or close PayPal to continue paying using other methods."}),o.appendChild(i),o.appendChild(a),n.appendChild(r),n.appendChild(o),document.body.appendChild(n),e=n}},hide:t}}var Kg=["paypal","applePay","googlePay","alipay"];function Bg(e,t,n){var r=new Qh(t,e,"SDK_USAGE").toJSON();return n&&(r.i18nKey=n),r}function Yg(e){var t=null==e?void 0:e.paymentMethods;if(!Array.isArray(t)||0===t.length)return Bg("PARAM_INVALID","paymentMethods is required and must not be empty","event.callback.code.PARAM_INVALID.paymentMethodsRequired");var n,r=d()(t);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(!Kg.includes(o))return Bg("PARAM_INVALID","Unsupported payment method in paymentMethodOrder: ".concat(o),"event.callback.code.PARAM_INVALID.unsupportedMethod")}}catch(e){r.e(e)}finally{r.f()}return!t.includes("paypal")||null!=e&&e.paypal?!t.includes("paypal")||void 0===(null==e?void 0:e.amount)||"string"==typeof e.amount.currency&&""!==e.amount.currency.trim()?null:Bg("PARAM_INVALID","Payment amount currency is required for PayPal"):Bg("PARAM_INVALID","payPalConfiguration is required","event.callback.code.PARAM_INVALID.payPalConfigurationRequired")}function Fg(e){return h()(h()({},e),{},{expressPaymentType:"paypal"})}function Hg(e){return jg.apply(this,arguments)}function jg(){return jg=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.appConfig,r=t.env,o=t.tracker,a=null==n?void 0:n.sessionData,s=(null==n?void 0:n.locale)||"en_US",(l=Array.isArray(null==n?void 0:n.paymentMethods)?n.paymentMethods:[]).includes("applePay")&&bm(),!(c=Yg(n))){e.next=8;break}return e.abrupt("return",{setupResult:{sessionData:a,locale:s,setupError:c}});case 8:if(u=l.some((function(e){return"applePay"===e||"googlePay"===e||"alipay"===e})),d=u||a?Xh(a,"ELEMENT_PAYMENT"):void 0,!l.includes("paypal")){e.next=16;break}return e.next=13,Vg(n,o);case 13:e.t0=e.sent,e.next=17;break;case 16:e.t0=void 0;case 17:if(p=e.t0,!(l.includes("applePay")||l.includes("googlePay")||l.includes("alipay"))){e.next=21;break}return e.abrupt("return",zg({sessionData:a,metaData:d,env:r,paypalSetupResult:p,tracker:o}));case 21:return e.abrupt("return",{setupResult:h()({sessionData:a},p)});case 22:case"end":return e.stop()}}),e)}))),jg.apply(this,arguments)}function Vg(e,t){return Gg.apply(this,arguments)}function Gg(){return Gg=s()(i()().mark((function e(t,n){var r,o,a,s,l,c,u,d,p,m,f,v,g,y,_;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=null==t?void 0:t.paypal,s=(null==a?void 0:a.channelMerchantAccountId)||"",l=(null==a?void 0:a.businessDivision)||"",c=(null==t||null===(r=t.amount)||void 0===r?void 0:r.currency)||"",u=(null==t||null===(o=t.amount)||void 0===o?void 0:o.value)||"",e.prev=5,e.next=8,dm({clientId:s,paymentMethodType:"PAYPAL_EXPRESSCHECKOUT",businessDivision:l,amount:{currency:c,value:u}},{timeout:1e5,hostSign:l,tracker:n,scope:"expressElement.channelClientIdQuery"});case 8:if(!0!==(null==(p=e.sent)?void 0:p.success)||!p.channelClientId){e.next=11;break}return e.abrupt("return",{paypal:h()(h()({},a),{},{channelMerchantAccountId:p.channelClientId})});case 11:if(!0!==(null==p?void 0:p.success)){e.next=13;break}return e.abrupt("return",{setupError:Fg(new Qh("channelClientId is missing in the response","CHANNEL_CLIENT_ID_QUERY_FAILED","SDK_USAGE").toJSON())});case 13:return m=new Qh((null==p?void 0:p.errorMessage)||"channelClientId query failed",(null==p?void 0:p.errorCode)||"CHANNEL_CLIENT_ID_QUERY_FAILED","SDK_USAGE").toJSON(),f=Fg(m),"true"===(null==p||null===(d=p.extendInfo)||void 0===d?void 0:d.mulityLanguageMapping)&&(f.mulityLanguageMapping=!0),e.abrupt("return",{setupError:f});case 19:return e.prev=19,e.t0=e.catch(5),i=void 0,i="API_TIMEOUT"===(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"API_GATEWAY_TIMEOUT"===(null===e.t0||void 0===e.t0?void 0:e.t0.code),g={code:i?"CHANNEL_CLIENT_ID_QUERY_ERROR":null!==e.t0&&void 0!==e.t0&&e.t0.code?e.t0.code:"CHANNEL_CLIENT_ID_QUERY_ERROR",message:i?"Request to query channelClientId timed out":null!==e.t0&&void 0!==e.t0&&e.t0.errorMessage||null!==e.t0&&void 0!==e.t0&&e.t0.message?e.t0.errorMessage||e.t0.message:"channelClientId query failed"},y=new Qh(g.message,g.code,"SDK_USAGE").toJSON(),_=Fg(y),"true"===(null===e.t0||void 0===e.t0||null===(v=e.t0.response)||void 0===v||null===(v=v.extendInfo)||void 0===v?void 0:v.mulityLanguageMapping)&&(_.mulityLanguageMapping=!0),e.abrupt("return",{setupError:_});case 27:case"end":return e.stop()}var i}),e,null,[[5,19]])}))),Gg.apply(this,arguments)}function zg(e){return Wg.apply(this,arguments)}function Wg(){return Wg=s()(i()().mark((function e(t){var n,r,o,a,s,l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.sessionData,r=t.metaData,o=t.env,a=t.paypalSetupResult,s=t.tracker,e.prev=1,e.next=4,gm({paymentSessionData:n,paymentSessionConfig:null==r?void 0:r.paymentSessionConfig},{tracker:s,scope:"expressElement.sdkQuery"});case 4:if(null==(l=e.sent)||!l.success){e.next=8;break}return c=qg(),e.abrupt("return",{renderData:l,setupResult:h()(h()(h()({sessionData:n,renderData:l},c?{merchantDomain:c,doMain:c}:{}),a),{},{_requestConfig:h()({env:o},cl()),sdkVersion:"0.0.1787898127-dev.21"})});case 8:return e.abrupt("return",{setupResult:h()(h()({sessionData:n},a),{},{setupError:Qh.unificationError(new Error((null==l?void 0:l.errorMessage)||"sdkActionQuery failed")).toJSON()})});case 11:return e.prev=11,e.t0=e.catch(1),e.abrupt("return",{setupResult:h()(h()({sessionData:n},a),{},{setupError:Qh.unificationError(e.t0).toJSON()})});case 14:case"end":return e.stop()}}),e,null,[[1,11]])}))),Wg.apply(this,arguments)}function qg(){var e;if("undefined"!=typeof window)return(null===(e=window.location)||void 0===e?void 0:e.hostname)||void 0}function Jg(e,t){if(void 0!==e){if(t)throw new Qh("Payment amount update is not allowed during payment processing","PAYMENT_IN_PROGRESS","SDK_USAGE");if(null==e||!e.value)throw new Qh("Payment amount cannot be empty","AMOUNT_VALUE_EMPTY","SDK_USAGE");if(!/^(?:[1-9]\d*(?:\.\d+)?|0(?:\.\d+)?)$/.test(e.value)||Number(e.value)<=0)throw new Qh("Invalid payment amount format (only positive integers and decimals allowed)","AMOUNT_VALUE_INVALID","SDK_USAGE")}}var Qg=["paypal"],Zg=["createOrder","onShippingAddressChange","onShippingOptionsChange"];function Xg(e){if("string"!=typeof(t=e.code)||!Object.prototype.hasOwnProperty.call(Dg,t))return e;var t,n=e.reason||e.message||Dg[e.code];return h()(h()({},e),{},{message:sh.get({id:"ANTOMSDK.".concat(e.code),dm:Dg[e.code]}),reason:n})}var $g=function(e){return"SUCCESS"===e.status?"success":"CANCELLED"===e.status?"cancelled":"PROCESSING"===e.status?"processing":"FAIL"===e.status?"fail":e.success?"success":"fail"},ey=function(e){_()(d,e);var t,n,r,o,a,l,u=b()(d);function d(e,t){var n;g()(this,d);var r=t.appConfig||{},o=t.locale||"en_US",i=r.paypal,a=fc()(r,Qg),s=i||{},l=s.createOrder,p=s.onShippingAddressChange,m=s.onShippingOptionsChange,f=fc()(s,Zg),v=h()({},a);delete v.amount;var y=h()(h()({},v),{},{locale:o,_paypalSdkEnvironment:"sandbox"===t.env?"sandbox":"prod"},Object.keys(f).length>0&&{paypal:f}),_=ll("/express_element/index.html",!0);"sandbox"===t.env&&(_+=_.includes("?")?"&shadow=true":"?shadow=true");var E=r.sessionData?Nh(r.sessionData):void 0;E&&_c.setTrackId(E),n=u.call(this,e,_,h()(h()({},t),{},{appConfig:y,locale:o,trackId:E}),bc({appearance:{displaySetting:{showCardBrandIcon:!0},theme:"default",rules:Ng}},y)),c()(Ze()(n),"elementTracker",void 0),c()(Ze()(n),"_mountInProgress",!1),c()(Ze()(n),"_destroyInProgress",!1),c()(Ze()(n),"_registeringInternalListeners",!1),c()(Ze()(n),"_callbacks",{}),c()(Ze()(n),"_renderData",null),c()(Ze()(n),"_initialAmount",void 0),c()(Ze()(n),"_localHandlers",new Map),c()(Ze()(n),"_paymentInProgress",!1),c()(Ze()(n),"_confirmWindowTimedOut",!1),c()(Ze()(n),"_readyReceived",!1),c()(Ze()(n),"_setupFailed",!1),c()(Ze()(n),"_paypalOverlay",Ug()),c()(Ze()(n),"_updateQueue",Promise.resolve()),n.elementTracker=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Cg(e,h()(h()({},t),{},{elementType:"express"}))}(r.sessionData,{elementInstanceId:e,env:t.env,locale:o});var b=r.sessionData?Oh(r.sessionData):"";return Hh.setGlobalOptions(h()({hostSign:b,sdkVersion:"0.0.1787898127-dev.21",env:t.env},cl())),n._callbacks={paypalCreateOrder:l,paypalOnShippingAddressChange:p,paypalOnShippingOptionsChange:m},n._initialAmount=r.amount,n}return f()(d,[{key:"on",value:function(e,t){var n=this,r=function(){if("confirm"===e){return pl()(ml()(d.prototype),"on",n).call(n,e,(function(e){n._confirmWindowTimedOut=!1,e.paymentFailed=function(){var t;n.elementTracker.trackError("payment_failed",{d1:null!==(t=null==e?void 0:e.expressPaymentType)&&void 0!==t?t:""}),n._paymentInProgress=!1,n.send("OPENSDK@COMPLETE_PAYMENT_REJECT",{})},t(e)}))}return pl()(ml()(d.prototype),"on",n).call(n,e,t)};return this._registeringInternalListeners?r():this.elementTracker.runSyncApi({msg:"on",inputFields:function(){return{d5:"element.on",d6:d.elementType,d7:Tg(e),d8:String("function"==typeof t)}},action:r,outputFields:function(){return{outcome:"success",fields:{d9:""}}},errorFields:function(e){return{d9:e.source}}})}},{key:"_emit",value:function(e,t){var n;null===(n=this._localHandlers.get(e))||void 0===n||n.forEach((function(e){return e(t)}))}},{key:"updateConfig",value:(l=s()(i()().mark((function e(t){var n=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.elementTracker.runAsyncApi({msg:"updateConfig",inputFields:function(){var e,n,r;return{d5:"element.updateConfig",d6:d.elementType,d7:String(void 0!==(null==t?void 0:t.amount)),d8:(null==t||null===(e=t.amount)||void 0===e?void 0:e.currency)||"",d9:String(void 0!==(null==t?void 0:t.appearance)),d10:(null==t||null===(n=t.appearance)||void 0===n?void 0:n.theme)||"",d12:String(void 0!==(null==t?void 0:t.paymentMethods)),d13:String(!(null==t||null===(r=t.appearance)||void 0===r||!r.rules)&&Object.keys(t.appearance.rules).length>0)}},action:function(){return n.runUpdateConfig(t)},outputFields:function(e){var t,n,r;return{outcome:null!=e&&e.error?"fail":"success",errorCode:null==e||null===(t=e.error)||void 0===t?void 0:t.code,traceId:null==e||null===(n=e.error)||void 0===n?void 0:n.traceId,fields:{d14:String(!(null==e||!e.error)),d15:(null==e||null===(r=e.error)||void 0===r?void 0:r.source)||""}}},errorFields:function(e){return{d14:"",d15:e.source}}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"runUpdateConfig",value:(a=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,m,f,v,g=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t,e.prev=1,"ready"===this.status){e.next=4;break}throw new Qh("Checkout page not loaded successfully, please load again.","CHECKOUT_NOT_READY","SDK_USAGE");case 4:if(!this._setupFailed){e.next=6;break}throw new Qh("Checkout page not loaded successfully, please load again.","CHECKOUT_NOT_READY","SDK_USAGE");case 6:if(void 0===t.amount){e.next=24;break}if(!this._paymentInProgress){e.next=9;break}throw new Qh("Payment amount update is not allowed during payment processing","PAYMENT_IN_PROGRESS","SDK_USAGE");case 9:if(!(a=null!==(r=null!==(o=t.paymentMethods)&&void 0!==o?o:this.config.appConfig.paymentMethods)&&void 0!==r?r:[]).some((function(e){return"applePay"===e||"googlePay"===e}))){e.next=17;break}if(i=null===(s=t.amount)||void 0===s?void 0:s.value,!1!==(l=null==i||""===i?{ok:!1,code:"AMOUNT_VALUE_EMPTY"}:"string"==typeof i&&/^\d+$/.test(i)?i.length>15||/^0+$/.test(i)?{ok:!1,code:"AMOUNT_VALUE_INVALID"}:{ok:!0,normalizedValue:i.replace(/^0+/,"")}:{ok:!1,code:"AMOUNT_VALUE_INVALID"}).ok){e.next=15;break}throw new Qh(this.getAmountValidationReason(l.code),l.code,"SDK_USAGE");case 15:e.next=18;break;case 17:Jg(t.amount,!1);case 18:if(!a.includes("paypal")){e.next=24;break}if(m=null!==(c=null===(u=this.config.appConfig.amount)||void 0===u?void 0:u.currency)&&void 0!==c?c:null===(d=this._initialAmount)||void 0===d?void 0:d.currency,"string"==typeof(f=null!==(p=t.amount.currency)&&void 0!==p?p:m)&&""!==f.trim()){e.next=23;break}throw new Qh("Payment amount currency is required for PayPal","PARAM_INVALID","SDK_USAGE");case 23:void 0===t.amount.currency&&(n=h()(h()({},t),{},{amount:h()(h()({},t.amount),{},{currency:f})}));case 24:e.next=30;break;case 26:return e.prev=26,e.t0=e.catch(1),this.elementTracker.trackError("updateConfig_error",{errorCode:(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"UNKNOWN"}),e.abrupt("return",{error:Xg(Qh.unificationError(e.t0).toJSON())});case 30:return v=this._updateQueue.then((function(){return g.updateConfigTransaction(n)})),this._updateQueue=v.then((function(){}),(function(){})),e.abrupt("return",v);case 33:case"end":return e.stop()}var i}),e,this,[[1,26]])}))),function(e){return a.apply(this,arguments)})},{key:"updateConfigTransaction",value:(o=s()(i()().mark((function e(t){var n,r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.config.appConfig.amount?h()({},this.config.appConfig.amount):void 0,(r=qg())&&(this.config.appConfig.merchantDomain=r),wg(this.config.appConfig,t),void 0===t.amount){e.next=10;break}return e.next=7,this.updateAmountConfigWithSanitizedDebug(t);case 7:e.t0=e.sent,e.next=13;break;case 10:return e.next=12,pl()(ml()(d.prototype),"updateConfig",this).call(this,t);case 12:e.t0=e.sent;case 13:return null!=(o=e.t0)&&o.error?(n?this.config.appConfig.amount=n:delete this.config.appConfig.amount,this.elementTracker.trackElement("updateConfig_reply_error",{errorCode:o.error.code,rollback:void 0!==t.amount})):this.elementTracker.trackElement("updateConfig_success",{currency:null!==(a=null===(s=t.amount)||void 0===s?void 0:s.currency)&&void 0!==a?a:"",hasAmount:void 0!==t.amount}),e.abrupt("return",null!=o&&o.error?h()(h()({},o),{},{error:Xg(o.error)}):o);case 16:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"updateAmountConfigWithSanitizedDebug",value:(r=s()(i()().mark((function e(t){var n,r,o,a,s,l,c=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"destroyed"!==this.status){e.next=3;break}throw new Qh("Element already destroyed, cannot update destroyed SDK instance","ELEMENT_INSTANCE_DESTROYED","SDK_USAGE");case 3:if("ready"===this.status){e.next=5;break}throw new Qh({message:"Element is { status }, it is not ready, cannot update config",params:{status:this.status}},"UPDATE_CONFIG_NOT_READY","SDK_USAGE");case 5:return this.config.appConfig=bc(this.config.appConfig,t),Rc("INFO","SDK_USAGE","Updating configuration via API",{currency:null!==(n=null===(r=t.amount)||void 0===r?void 0:r.currency)&&void 0!==n?n:"",hasAmount:!0,valueLengthBucket:(i=null===(o=t.amount)||void 0===o?void 0:o.value,"string"!=typeof i?"non-string":0===i.length?"0":i.length<=4?"1-4":i.length<=8?"5-8":i.length<=12?"9-12":i.length<=15?"13-15":"16+")}),a=this.bridge,s=function(){},l=Dl((function(){return new Promise((function(e){s=a.once(jl,e),a.send(Hl,{merged:c.config.appConfig,updated:t})}))}),3e3,new Qh("Update config timeout","UPDATE_CONFIG_TIMEOUT","SYSTEM")),e.next=12,l().catch((function(e){return s(),{error:Qh.unificationError(e).toJSON()}}));case 12:return e.abrupt("return",e.sent);case 15:return e.prev=15,e.t0=e.catch(0),e.abrupt("return",{error:Qh.unificationError(e.t0).toJSON()});case 18:case"end":return e.stop()}var i}),e,this,[[0,15]])}))),function(e){return r.apply(this,arguments)})},{key:"getAmountValidationReason",value:function(e){return Dg[e]}},{key:"_handleReady",value:function(){this._readyReceived=!0,this._setupFailed=!1}},{key:"_handleError",value:function(){this._readyReceived||(this._setupFailed=!0)}},{key:"completePayment",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"always";return this.elementTracker.runAsyncApi({msg:"completePayment",inputFields:function(){return{d5:"element.completePayment",d6:t}},action:function(){return e.runCompletePayment(t)},outputFields:function(e){var t;return{outcome:$g(e),errorCode:null===(t=e.error)||void 0===t?void 0:t.code,fields:{d10:e.status||"",d11:void 0===e.userCanceled3D?"":String(e.userCanceled3D),d12:String(e.success),d15:""}}},errorFields:function(e){return{d15:e.source}}})}},{key:"runCompletePayment",value:function(e){var t=this;if("destroyed"===this.status)return this.elementTracker.trackError("complete_payment_failed",{d1:"ELEMENT_INSTANCE_DESTROYED"}),Promise.resolve({success:!1,error:{code:"ELEMENT_INSTANCE_DESTROYED",message:"Element already destroyed"}});if(this._confirmWindowTimedOut)return this.elementTracker.trackError("complete_payment_failed",{d1:"MERCHANT_CONFIRM_TIMEOUT"}),Promise.resolve({success:!1,status:"FAIL",error:{code:"MERCHANT_CONFIRM_TIMEOUT",message:sh.get({id:"event.callback.code.MERCHANT_CONFIRM_TIMEOUT",dm:"Merchant confirmation timed out."})}});var n="cp_".concat(Date.now(),"_").concat(Math.random().toString(36).slice(2,8));return this.elementTracker.trackElement("complete_payment_request",{d1:e}),this.send("OPENSDK@COMPLETE_PAYMENT",{requestId:n,redirect:e}),new Promise((function(e){var r=t.bridge.on("OPENSDK@COMPLETE_PAYMENT_RESULT",(function(i){if((null==i?void 0:i.requestId)===n){if(t._paymentInProgress=!1,r(),clearTimeout(o),i.success)t.elementTracker.trackElement("complete_payment_success");else{var a,s,l;if(["PAYMENT_CANCELLED","APPLE_PAY_CANCEL","GOOGLE_PAY_CANCELED","USER_CANCELED_3D"].includes((null===(a=i.error)||void 0===a?void 0:a.code)||""))t.elementTracker.trackElement("complete_payment_cancelled",{d1:(null===(s=i.error)||void 0===s?void 0:s.code)||""});else t.elementTracker.trackError("complete_payment_failed",{d1:(null===(l=i.error)||void 0===l?void 0:l.code)||"UNKNOWN",d2:"webapp_reply"})}e({success:i.success,result:i.result,error:i.error,userCanceled3D:i.userCanceled3D,status:i.status})}})),o=setTimeout((function(){t._paymentInProgress=!1,r(),t.elementTracker.trackError("complete_payment_timeout",{d1:"COMPLETE_PAYMENT_TIMEOUT"}),e({success:!1,status:"PROCESSING",error:{code:"COMPLETE_PAYMENT_TIMEOUT",message:"completePayment timed out"}})}),3e5)}))}},{key:"setup",value:(n=s()(i()().mark((function e(){var t,n,r,o,a,s;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._readyReceived=!1,this._setupFailed=!1,this._confirmWindowTimedOut=!1,this.registerInternalListeners(),this.elementTracker.trackElement("setup_start"),t=h()(h()({},this.config.appConfig),{},{amount:this._initialAmount}),e.prev=6,e.next=9,Hg({appConfig:t,env:this.config.env,tracker:this.elementTracker.requestTracker});case 9:return n=e.sent,r=n.setupResult,(o=n.renderData)&&(this._renderData=o,this.elementTracker.enrich({renderData:o})),null!=r&&r.setupError?this.elementTracker.trackError("setup_error",{d1:(null===(a=r.setupError)||void 0===a?void 0:a.code)||"UNKNOWN",d2:(null===(s=r.setupError)||void 0===s?void 0:s.source)||"webapp_reply"}):this.elementTracker.trackElement("setup_success"),e.abrupt("return",h()(h()({},r),{},{amount:this._initialAmount}));case 17:throw e.prev=17,e.t0=e.catch(6),this.elementTracker.trackError("setup_error",{d1:(null===e.t0||void 0===e.t0?void 0:e.t0.code)||"UNKNOWN",d2:(null===e.t0||void 0===e.t0?void 0:e.t0.source)||"system"}),e.t0;case 21:case"end":return e.stop()}}),e,this,[[6,17]])}))),function(){return n.apply(this,arguments)})},{key:"registerInternalListeners",value:function(){var e=this;this._registeringInternalListeners=!0;try{!function(e){var t=e.tracker,n=e.getIframe,r=e.on,o=n();o&&(o.style.opacity="0",o.style.transition="height 0.35s, opacity 0.4s 0.1s",o.style.height="0px",o.style.width="100%",o.style.display="block");var i=!1;r("contentHeightChanged",(function(e){var r;t.trackElement("content_height_changed",{d1:(r=null==e?void 0:e.height,"number"==typeof r&&Number.isFinite(r)?r<=0?"<=0":r<=200?"1-200":r<=400?"201-400":r<=600?"401-600":r<=800?"601-800":">800":"invalid")});var o=n();o&&(null==e?void 0:e.height)>0&&(o.style.height="".concat(e.height,"px"),i||(i=!0,requestAnimationFrame((function(){o.style.opacity="1"}))))}))}({tracker:this.elementTracker,getIframe:function(){return e.iframe},on:this.on.bind(this)}),function(e){var t=e.tracker,n=e.on,r=e.send,o=e.callbacks,a=e.paypalOverlay,l=e.setPaymentInProgress,c=e.getRenderData,u=e.getAppConfig,d=e.onReady,p=e.onError,h=e.setConfirmWindowTimedOut;n("click",(function(e){var n;t.trackElement("click",{d1:null!==(n=null==e?void 0:e.expressPaymentType)&&void 0!==n?n:""}),l(!0),"paypal"!==(null==e?void 0:e.expressPaymentType)?r("OPENSDK@CLICK_RESOLVE",{}):a.show()})),n("ready",(function(e){t.trackElement("ready",{d1:xg(null==e?void 0:e.availablePaymentMethods)}),null==d||d()})),n("confirm",(function(e){var n;t.trackElement("confirm",{d1:null!==(n=null==e?void 0:e.expressPaymentType)&&void 0!==n?n:""}),a.hide()})),n("error",(function(e){var n;t.trackError("error",{d1:null!==(n=null==e?void 0:e.expressPaymentType)&&void 0!==n?n:"",d2:null==e?void 0:e.code,d3:null==e?void 0:e.source}),l(!1),a.hide(),null==p||p(),"MERCHANT_CONFIRM_TIMEOUT"===(null==e?void 0:e.code)&&h(!0)})),n("cancel",(function(e){var n;t.trackElement("cancel",{d1:null!==(n=null==e?void 0:e.expressPaymentType)&&void 0!==n?n:""}),l(!1),a.hide()})),n("OPENSDK@GET_APPLE_PAY_TOKEN",function(){var e=s()(i()().mark((function e(t){var n;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.requestId,e.prev=1,e.next=4,km({requestId:n,renderData:c(),appConfig:u(),walletAmount:t.walletAmount,sendReply:function(e){r("OPENSDK@GET_APPLE_PAY_TOKEN_REPLY",e)}});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),r("OPENSDK@GET_APPLE_PAY_TOKEN_REPLY",{requestId:n,success:!1,errorCode:(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED"});case 9:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(t){return e.apply(this,arguments)}}()),n("OPENSDK@PAYPAL_CREATE_ORDER",function(){var e=s()(i()().mark((function e(n){var s,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=n.requestId,t.trackElement("paypal_create_order",{d1:"start"}),e.prev=2,o.paypalCreateOrder){e.next=5;break}throw new Error("paypal.createOrder is not provided");case 5:return e.next=7,o.paypalCreateOrder();case 7:c=e.sent,t.trackElement("paypal_create_order_success",{d1:"has_session"}),r("OPENSDK@PAYPAL_CREATE_ORDER_REPLY",{requestId:s,sessionData:c}),e.next=18;break;case 12:e.prev=12,e.t0=e.catch(2),l(!1),t.trackElement("paypal_create_order_failed",{d1:"merchant_callback"}),r("OPENSDK@PAYPAL_CREATE_ORDER_REPLY",{requestId:s,error:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"createOrder failed"}),a.hide();case 18:case"end":return e.stop()}}),e,null,[[2,12]])})));return function(t){return e.apply(this,arguments)}}()),n("OPENSDK@PAYPAL_SHIPPING_ADDRESS_CHANGE",function(){var e=s()(i()().mark((function e(n){var a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.requestId,s=n.shippingData,t.trackElement("paypal_shipping_address_change",{d1:"start"}),e.prev=2,e.next=5,null===(l=o.paypalOnShippingAddressChange)||void 0===l?void 0:l.call(o,s,{});case 5:r("OPENSDK@PAYPAL_SHIPPING_ADDRESS_CHANGE_REPLY",{requestId:a}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),r("OPENSDK@PAYPAL_SHIPPING_ADDRESS_CHANGE_REPLY",{requestId:a,error:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"onShippingAddressChange failed"});case 11:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(t){return e.apply(this,arguments)}}()),n("OPENSDK@PAYPAL_SHIPPING_OPTIONS_CHANGE",function(){var e=s()(i()().mark((function e(n){var a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.requestId,s=n.shippingData,t.trackElement("paypal_shipping_options_change",{d1:"start"}),e.prev=2,e.next=5,null===(l=o.paypalOnShippingOptionsChange)||void 0===l?void 0:l.call(o,s,{});case 5:r("OPENSDK@PAYPAL_SHIPPING_OPTIONS_CHANGE_REPLY",{requestId:a}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),r("OPENSDK@PAYPAL_SHIPPING_OPTIONS_CHANGE_REPLY",{requestId:a,error:(null===e.t0||void 0===e.t0?void 0:e.t0.message)||"onShippingOptionsChange failed"});case 11:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(t){return e.apply(this,arguments)}}())}({tracker:this.elementTracker,on:this.on.bind(this),send:this.send.bind(this),callbacks:this._callbacks,paypalOverlay:this._paypalOverlay,setPaymentInProgress:function(t){e._paymentInProgress=t},setConfirmWindowTimedOut:function(t){e._confirmWindowTimedOut=t},onReady:function(){return e._handleReady()},onError:function(){return e._handleError()},getRenderData:function(){return e._renderData},getAppConfig:function(){return e.config.appConfig}})}finally{this._registeringInternalListeners=!1}}},{key:"mount",value:(t=s()(i()().mark((function e(t){var n,r=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.status,this._mountInProgress=!0,e.prev=2,e.next=5,this.elementTracker.runAsyncApi({msg:"mount",inputFields:function(){return{d5:"element.mount",d6:d.elementType,d7:String(!!t),d8:n}},action:function(){return pl()(ml()(d.prototype),"mount",r).call(r,t)},outputFields:function(){return{outcome:"success",fields:{d9:r.status,d10:String(!!r.iframe),d11:""}}},errorFields:function(e){return{d9:r.status,d10:String(!!r.iframe),d11:e.source}}});case 5:return e.abrupt("return",e.sent);case 6:return e.prev=6,this._mountInProgress=!1,e.finish(6);case 9:case"end":return e.stop()}}),e,this,[[2,,6,9]])}))),function(e){return t.apply(this,arguments)})},{key:"unmount",value:function(){var e=this;if(!this._mountInProgress&&!this._destroyInProgress){var t=this.status;return this.elementTracker.runSyncApi({msg:"unmount",inputFields:function(){return{d5:"element.unmount",d6:d.elementType,d7:t}},action:function(){return pl()(ml()(d.prototype),"unmount",e).call(e)},outputFields:function(){return{outcome:"success",fields:{d8:e.status,d9:""}}},errorFields:function(t){return{d8:e.status,d9:t.source}}})}pl()(ml()(d.prototype),"unmount",this).call(this)}},{key:"destroy",value:function(){var e=this,t=this.status;this._destroyInProgress=!0;try{return this.elementTracker.runSyncApi({msg:"element.destroy",inputFields:function(){return{d5:"element.destroy",d6:d.elementType,d7:t}},action:function(){return pl()(ml()(d.prototype),"destroy",e).call(e)},outputFields:function(){return{outcome:"success",fields:{d8:e.status,d9:""}}},errorFields:function(t){return{d8:e.status,d9:t.source}}})}finally{this._destroyInProgress=!1}}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),d}(Yc);c()(ey,"elementType","express");var ty=function(e){_()(a,e);var t,n,r,o=b()(a);function a(e,t){var n,r;g()(this,a);var i,s={displaySetting:{showCardBrandIcon:!0},theme:"default",rules:Ng},l=t.appConfig.sessionData,u=l?Nh(l):void 0;(u&&_c.setTrackId(u),r=o.call(this,e,ll("/vaulting/index.html",Jh(l)),h()(h()({},t),{},{trackId:u}),bc({appearance:s},t.appConfig)),c()(Ze()(r),"elementTracker",void 0),c()(Ze()(r),"_mountInProgress",!1),c()(Ze()(r),"_destroyInProgress",!1),r.elementTracker=Cg(l,{elementType:a.elementType,elementInstanceId:e,env:t.env,locale:t.locale}),null!==(n=t.appConfig)&&void 0!==n&&n.sessionData)&&Hh.setGlobalOptions({hostSign:Oh(null===(i=t.appConfig)||void 0===i?void 0:i.sessionData)});return r}return f()(a,[{key:"setup",value:(r=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=null===(t=this.config.appConfig)||void 0===t?void 0:t.sessionData,a=Xh(o,"ELEMENT_VAULT"),this.elementTracker.enrich({metaData:a}),e.next=5,cm(gm({extParams:{isUserPreferredLocale:!0},paymentSessionConfig:a.paymentSessionConfig,paymentSessionData:o},{tracker:this.elementTracker.requestTracker,scope:"vaultingElement.sdkQuery"}));case 5:return s=e.sent,l=ul(s.data),c=l||(null===(n=this.config.appConfig)||void 0===n?void 0:n.locale)||this.config.locale,this.elementTracker.enrich({metaData:a,renderData:s.data,locale:c}),lh(c),e.abrupt("return",{sessionData:o,renderData:s.data,renderDataError:s.error,sdkVersion:"0.0.1787898127-dev.21",paymentSessionConfig:a.paymentSessionConfig,locale:c,merchantId:(null===(r=s.data)||void 0===r?void 0:r.merchantId)||"default merchantId",_requestConfig:h()({env:this.config.env},cl())});case 11:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"updateConfig",value:(n=s()(i()().mark((function e(t){var n=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.elementTracker.runAsyncApi({msg:"updateConfig",inputFields:function(){var e,n;return{d5:"element.updateConfig",d6:a.elementType,d7:String(void 0!==(null==t?void 0:t.appearance)),d8:(null==t||null===(e=t.appearance)||void 0===e?void 0:e.theme)||"",d9:String(!(null==t||null===(n=t.appearance)||void 0===n||!n.rules)&&Object.keys(t.appearance.rules).length>0)}},action:function(){return wg(n.config.appConfig,t),pl()(ml()(a.prototype),"updateConfig",n).call(n,t)},outputFields:function(e){var t,n,r;return{outcome:null!=e&&e.error?"fail":"success",errorCode:null==e||null===(t=e.error)||void 0===t?void 0:t.code,traceId:null==e||null===(n=e.error)||void 0===n?void 0:n.traceId,fields:{d14:String(!(null==e||!e.error)),d15:(null==e||null===(r=e.error)||void 0===r?void 0:r.source)||""}}},errorFields:function(e){return{d14:"",d15:e.source}}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"submit",value:function(e){var t=this;return this.elementTracker.runAsyncApi({msg:"element.submit",inputFields:function(){return{d5:"element.submit",d6:(null==e?void 0:e.redirect)||""}},action:function(){return t._submit(e)},outputFields:function(e){var t,n,r;return{outcome:(r=null==e?void 0:e.status,"SUCCESS"===r?"success":"FAIL"===r?"fail":"CANCELLED"===r?"cancelled":"PROCESSING"===r?"processing":"unknown"),errorCode:null==e||null===(t=e.error)||void 0===t?void 0:t.code,traceId:null==e||null===(n=e.error)||void 0===n?void 0:n.traceId,fields:{d10:(null==e?void 0:e.status)||"",d11:void 0===(null==e?void 0:e.userCanceled3D)?"":String(e.userCanceled3D),d14:(null==e?void 0:e.code)||"",d15:""}}},errorFields:function(e){return{d15:e.source}}})}},{key:"mount",value:(t=s()(i()().mark((function e(t){var n,r=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.status,this._mountInProgress=!0,e.prev=2,e.next=5,this.elementTracker.runAsyncApi({msg:"mount",inputFields:function(){return{d5:"element.mount",d6:a.elementType,d7:String(!!t),d8:n}},action:function(){return pl()(ml()(a.prototype),"mount",r).call(r,t)},outputFields:function(){return{outcome:"success",fields:{d9:r.status,d10:String(!!r.iframe),d11:""}}},errorFields:function(e){return{d9:r.status,d10:String(!!r.iframe),d11:e.source}}});case 5:return e.abrupt("return",e.sent);case 6:return e.prev=6,this._mountInProgress=!1,e.finish(6);case 9:case"end":return e.stop()}}),e,this,[[2,,6,9]])}))),function(e){return t.apply(this,arguments)})},{key:"on",value:function(e,t){var n=this;return this.elementTracker.runSyncApi({msg:"on",inputFields:function(){return{d5:"element.on",d6:a.elementType,d7:Tg(e),d8:String("function"==typeof t)}},action:function(){return pl()(ml()(a.prototype),"on",n).call(n,e,t)},outputFields:function(){return{outcome:"success",fields:{d9:""}}},errorFields:function(e){return{d9:e.source}}})}},{key:"unmount",value:function(){var e=this;if(!this._mountInProgress&&!this._destroyInProgress){var t=this.status;return this.elementTracker.runSyncApi({msg:"unmount",inputFields:function(){return{d5:"element.unmount",d6:a.elementType,d7:t}},action:function(){return pl()(ml()(a.prototype),"unmount",e).call(e)},outputFields:function(){return{outcome:"success",fields:{d8:e.status,d9:""}}},errorFields:function(t){return{d8:e.status,d9:t.source}}})}pl()(ml()(a.prototype),"unmount",this).call(this)}},{key:"destroy",value:function(){var e=this,t=this.status;this._destroyInProgress=!0;try{return this.elementTracker.runSyncApi({msg:"element.destroy",inputFields:function(){return{d5:"element.destroy",d6:a.elementType,d7:t}},action:function(){return pl()(ml()(a.prototype),"destroy",e).call(e)},outputFields:function(){return{outcome:"success",fields:{d8:e.status,d9:""}}},errorFields:function(t){return{d8:e.status,d9:t.source}}})}finally{this._destroyInProgress=!1}}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),a}(Yc);c()(ty,"elementType","vaulting");var ny=function(e){_()(r,e);var t,n=b()(r);function r(e){var t;return g()(this,r),t=n.call(this,e),c()(Ze()(t),"apiTracker",void 0),t.apiTracker=Cg(void 0,{elementType:"elements",elementInstanceId:"elements-group",env:e.env,locale:e.locale}),t}return f()(r,[{key:"canUseElements",value:function(){return[ty,ey]}},{key:"init",value:(t=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiTracker.runAsyncApi({msg:"elements.init",inputFields:function(){return{d5:"elements.init",d6:String(!!t.config.debug)}},action:function(){return pl()(ml()(r.prototype),"init",t).call(t)},outputFields:function(){return{outcome:"success"}}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"updateConfig",value:function(e){var t=this;return this.apiTracker.runSyncApi({msg:"elements.updateConfig",inputFields:function(){return{d5:"elements.updateConfig",d6:String(void 0!==(null==e?void 0:e.env)),d7:String(void 0!==(null==e?void 0:e.locale)),d8:String(void 0!==(null==e?void 0:e.debug))}},action:function(){return pl()(ml()(r.prototype),"updateConfig",t).call(t,e)},outputFields:function(){return{outcome:"success"}}})}},{key:"destroy",value:function(){var e=this,t=this.isDestroyed,n=this._getElementSize();return this.apiTracker.runSyncApi({msg:"elements.destroy",inputFields:function(){return{d5:"elements.destroy",d6:String(t),m2:n}},action:function(){return pl()(ml()(r.prototype),"destroy",e).call(e)},outputFields:function(){return{outcome:"success",fields:{d7:String(e.isDestroyed)}}}})}},{key:"createElement",value:function(e,t){var n=this;return Cg(null==t?void 0:t.sessionData,{elementType:e,elementInstanceId:"elements-create-".concat(e),env:this.config.env,locale:this.config.locale}).runSyncApi({msg:"elements.createElement",inputFields:function(){return{d5:"elements.createElement",d6:e,d7:String(void 0!==(null==t?void 0:t.sessionData))}},action:function(){return n._createElement(e,t)},outputFields:function(){return{outcome:"success"}}})}},{key:"getElement",value:function(e,t){var n=this;return Cg(null==t?void 0:t.sessionData,{elementType:e,elementInstanceId:"elements-get-".concat(e),env:this.config.env,locale:this.config.locale}).runSyncApi({msg:"elements.getElement",inputFields:function(){return{d5:"elements.getElement",d6:e}},action:function(){return n._getElement(e,t)},outputFields:function(e){return{outcome:"success",fields:{d7:e?"found":"missing"}}}})}}]),r}(Hc),ry=function(e){_()(r,e);var t,n=b()(r);function r(e,t){var o,i;g()(this,r);var a=null===(o=t.appConfig)||void 0===o?void 0:o.sessionData,s=a?Nh(a):void 0;return s&&_c.setTrackId(s),i=n.call(this,e,ll("/express_vaulting/index.html",!0),h()(h()({},t),{},{trackId:s}),bc({},t.appConfig)),c()(Ze()(i),"_paypalOverlay",Ug()),a&&Hh.setGlobalOptions({hostSign:Oh(a)}),i}return f()(r,[{key:"setup",value:(t=s()(i()().mark((function e(){var t,n,r,o,a,s,l,c,u,d,p,m,f,v,g,y;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.registerInternalListeners(),Xh(u=null===(t=this.config.appConfig)||void 0===t?void 0:t.sessionData),e.next=5,cm(gm({paymentSessionData:u,paymentSessionConfig:{productScene:"AUTO_DEBIT",paymentMethodCategoryType:"WALLET",productSceneVersion:"1.0"},envInfo:{terminalType:Ih?"WEB":"WAP"}}));case 5:return d=e.sent,p=d.data,m=ul(p),lh(f=m||(null===(n=this.config.appConfig)||void 0===n?void 0:n.locale)||this.config.locale),v=null==p||null===(r=p.extendInfo)||void 0===r?void 0:r.paypalClientToken,g=d.error,y=null==p?void 0:p.paymentMethods,e.abrupt("return",h()({sessionData:u,paypalClientToken:v,paypal:null===(o=this.config.appConfig)||void 0===o?void 0:o.paypal,buttonType:null===(a=this.config.appConfig)||void 0===a?void 0:a.buttonType,buttonHeight:null===(s=this.config.appConfig)||void 0===s?void 0:s.buttonHeight,buttonTheme:null===(l=this.config.appConfig)||void 0===l?void 0:l.buttonTheme,paymentMethods:null===(c=this.config.appConfig)||void 0===c?void 0:c.paymentMethods,serverPaymentMethods:y,locale:f,sdkVersion:"0.0.1787898127-dev.21",_requestConfig:h()({env:this.config.env},cl())},g?{setupError:g}:{}));case 14:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"registerInternalListeners",value:function(){var e=this;this.on("click",(function(){e._paypalOverlay.show()})),this.on("confirm",(function(){e._paypalOverlay.hide()})),this.on("cancel",(function(){e._paypalOverlay.hide()})),this.on("error",(function(){e._paypalOverlay.hide()}))}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}},{key:"_confirmVaulting",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"always",n="cv_".concat(Date.now(),"_").concat(Math.random().toString(36).slice(2,8));return this.send("OPENSDK@CONFIRM_VAULTING",{requestId:n,redirect:t}),new Promise((function(t){var r=e.bridge.on("OPENSDK@CONFIRM_VAULTING_RESULT",(function(e){(null==e?void 0:e.requestId)===n&&(r(),t(e.result))}))}))}}]),r}(Yc);function oy(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Cg(e,h()(h()({},t),{},{elementType:"payment"}))}c()(ry,"elementType","expressVaulting");function iy(){return iy=s()(i()().mark((function e(t){var n,r,o,a,l,c,u,d,p,m,f,v,g,y,_,E,b,A,S,k,T,P,I,C,w;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.sessionData,o=t.env,a=t.payload,l=t.logger,c=t.tracker,u=t.sendReply,d=Date.now(),p=null==a||null===(n=a.paymentMethod)||void 0===n||null===(n=n.paymentMethodDetail)||void 0===n?void 0:n.applePayProps,m=null==p?void 0:p.paymentRequest,c.trackElement("applepay_token_request",{d1:m?"has_payment_request":"no_payment_request",d4:"APPLEPAY"}),m){e.next=9;break}return c.trackError("applepay_token_missing_data",{d1:"MISSING_DATA"}),u({success:!1,result:{errorCode:"APPLE_PAY_MISSING_DATA"}}),e.abrupt("return");case 9:return f=m.merchantCapabilities,v=m.merchantInfo,g=m.paymentAmount,y=m.supportedNetworks,_=m.version,E=m.requiredBillingContactFields,b=m.requiredShippingContactFields,A=null==g?void 0:g.value,S=null==g?void 0:g.currency,T=!1,P=Pm(r,v,{value:A,currency:S}),I=new Sm({paymentRequest:h()({countryCode:null==v?void 0:v.countryCode,currencyCode:S,merchantCapabilities:f,supportedNetworks:y,requiredBillingContactFields:E,requiredShippingContactFields:b,total:P?{type:"final",label:P.regularBilling.label,amount:A}:{type:"final",label:(null==v?void 0:v.merchantName)||"Payment",amount:A},version:P?14:_},P?{lineItems:[P.regularBilling],recurringPaymentRequest:P}:{}),enableModalCloseListener:!0,callbacks:{validateMerchant:function(){var e=s()(i()().mark((function e(t){var n,a,s,u,d,p,h,m,f,v;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p=Date.now(),h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";c.requestTracker.log({code:"11",msg:"com.ipay.iexpcashier.cashier.createApplePayPaymentSession",d1:n||"无traceId",d2:"paymentElement.applePayValidation",d3:Math.round(Date.now()-p),d4:e?"":"".concat(t||"UNKNOWN","-wallet"),d5:e?"是":"否",m1:e?1:0})},c.trackElement("applepay_validate_start",{d1:"merchant_validate"}),e.prev=3,e.next=6,ya(r,{validateUrl:t,paymentSessionData:r,merchantDomain:window.location.hostname},{env:o,envInfo:{deviceId:""}},l);case 6:m=e.sent,e.next=16;break;case 9:throw e.prev=9,e.t0=e.catch(3),f=e.t0,h(!1,null==f?void 0:f.errorCode,null==f?void 0:f.traceId),T=!0,c.trackError("applepay_merchant_validate_failed",{d1:(null==f?void 0:f.errorCode)||"VALIDATION_FAILED",d2:"wallet",d3:(null==f?void 0:f.traceId)||"",m1:Date.now()-p}),e.t0;case 16:if(null===(n=m)||void 0===n||!n.success||!m.merchantSessionObject){e.next=20;break}return h(!0,"",null===(v=m)||void 0===v?void 0:v.traceId),c.trackElement("applepay_validate_success",{d1:"got_session",m1:Date.now()-p}),e.abrupt("return","string"==typeof m.merchantSessionObject?JSON.parse(m.merchantSessionObject):m.merchantSessionObject);case 20:throw h(!1,(null===(a=m)||void 0===a?void 0:a.errorCode)||"VALIDATION_FAILED",null===(s=m)||void 0===s?void 0:s.traceId),T=!0,c.trackError("applepay_merchant_validate_failed",{d1:(null===(u=m)||void 0===u?void 0:u.errorCode)||"VALIDATION_FAILED",d2:"wallet",d3:(null===(d=m)||void 0===d?void 0:d.traceId)||"",m1:Date.now()-p}),{errorCode:"APPLE_PAY_PAYMENT_SESSION_REQUEST_FAILED"};case 24:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t){return e.apply(this,arguments)}}(),onAuthorized:function(){var e=s()(i()().mark((function e(t){var n,r,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.token,r=t.billingContact,o=t.shippingContact,k={token:n,billingContact:r,shippingContact:o},c.trackElement("applepay_authorized",{d1:n?"has_token":"no_token",m1:Date.now()-d}),e.abrupt("return",{success:!0,result:k});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}),e.prev=15,e.next=18,I.startPay();case 18:c.trackElement("applepay_token_success",{d1:null!==(C=k)&&void 0!==C&&C.token?"has_token":"no_token",m1:Date.now()-d}),u({success:!0,result:k}),e.next=27;break;case 22:e.prev=22,e.t0=e.catch(15),w=(null===e.t0||void 0===e.t0?void 0:e.t0.errorCode)||"APPLE_PAY_NOT_SUPPORTED",T||("APPLE_PAY_CANCEL"===w?c.trackElement("applepay_cancel",{d1:"user_cancel",m1:Date.now()-d}):c.trackError("applepay_token_failed",{d1:w,d2:"wallet",m1:Date.now()-d})),u({success:!1,result:{errorCode:w}});case 27:case"end":return e.stop()}}),e,null,[[15,22]])}))),iy.apply(this,arguments)}function ay(e){var t=e.bridge,n=e.sessionData,r=e.env,o=e.logger,i=e.tracker,a=void 0===i?oy(n,{env:r}):i;t.on("OPENSDK@GET_APPLE_PAY_TOKEN",(function(e){if(!n)return a.trackError("applepay_token_missing_data",{d1:"MISSING_DATA"}),void t.send("OPENSDK@GET_APPLE_PAY_TOKEN_REPLY",{success:!1,result:{errorCode:"APPLE_PAY_MISSING_DATA"}});(function(e){return iy.apply(this,arguments)})({sessionData:n,env:r,payload:e,logger:o,tracker:a,sendReply:function(e){return t.send("OPENSDK@GET_APPLE_PAY_TOKEN_REPLY",e)}}).catch((function(e){var n=(null==e?void 0:e.errorCode)||"APPLE_PAY_NOT_SUPPORTED";a.trackError("applepay_token_failed",{d1:n}),t.send("OPENSDK@GET_APPLE_PAY_TOKEN_REPLY",{success:!1,result:{errorCode:n}})}))})),t.on("OPENSDK@GET_GOOGLE_PAY_TOKEN",(function(e){!function(e){var t,n,r=e.payload,o=e.tracker,i=e.sendReply,a=Date.now(),s=null==r?void 0:r.data,l=null==s||null===(t=s.paymentMethodDetail)||void 0===t?void 0:t.googlePayProps,c=(null==s?void 0:s.environment)||(null==l?void 0:l.environment)||"TEST",u=(null==s?void 0:s.paymentRequest)||(null==l?void 0:l.paymentRequest)||{},d=Object.keys(u).length>0;if(o.trackElement("googlepay_token_request",{d1:c,d2:d?"has_payment_request":"no_payment_request",d4:"GOOGLEPAY"}),!d)return o.trackError("googlepay_token_missing_data",{d1:"MISSING_DATA"}),void i({success:!1,err:{statusCode:"GOOGLE_PAY_PAYMENT_FAILED"}});var p=function(){var e=Date.now(),t=!1,n="ready",r=new window.google.payments.api.PaymentsClient({environment:c,paymentDataCallbacks:{onPaymentAuthorized:function(){return{transactionState:"SUCCESS"}}}});r.isReadyToPay(u).then((function(i){if(t=!0,o.trackElement("googlepay_ready_result",{d1:i.result?"ready":"not_supported",m1:Date.now()-e}),i.result)return n="load",r.loadPaymentData(u);throw{statusCode:"GOOGLE_PAY_NOT_SUPPORTED"}})).then((function(e){e?(o.trackElement("googlepay_token_success",{d1:"has_token",m1:Date.now()-a}),i({success:!0,result:e})):(o.trackError("googlepay_token_empty",{d1:"EMPTY_PAYMENT_DATA"}),i({success:!1,err:{statusCode:"GOOGLE_PAY_PAYMENT_FAILED"}}))})).catch((function(r){var s=(null==r?void 0:r.statusCode)||"GOOGLE_PAY_PAYMENT_FAILED";"ready"!==n||t||o.trackElement("googlepay_ready_result",{d1:"not_supported",m1:Date.now()-e}),"CANCELED"===s?o.trackElement("googlepay_cancel",{d1:"user_cancel",m1:Date.now()-a}):o.trackError("googlepay_token_failed",{d1:s,d2:"wallet",m1:Date.now()-a}),i({success:!1,err:h()({statusCode:s},r)})}))};if(null!==(n=window.google)&&void 0!==n&&null!==(n=n.payments)&&void 0!==n&&null!==(n=n.api)&&void 0!==n&&n.PaymentsClient)return o.trackElement("googlepay_script_load_start",{d1:"cached"}),o.trackElement("googlepay_script_load_success",{m1:0}),void p();var m=Date.now();o.trackElement("googlepay_script_load_start",{d1:"load"});var f=document.createElement("script");f.src="https://pay.google.com/gp/p/js/pay.js",f.async=!0,document.body.appendChild!==Node.prototype.appendChild?Node.prototype.appendChild.call(document.body,f):document.body.appendChild(f),f.onload=function(){o.trackElement("googlepay_script_load_success",{m1:Date.now()-m}),p()},f.onerror=function(){o.trackError("googlepay_script_load_failed",{d1:"script_error",m1:Date.now()-m}),i({success:!1,err:{statusCode:"GOOGLE_PAY_NOT_SUPPORTED"}})}}({payload:e,tracker:a,sendReply:function(e){return t.send("OPENSDK@GET_GOOGLE_PAY_TOKEN_REPLY",e)}})}))}var sy=function(e){try{var t,n,r=e;return{code:(null==r?void 0:r.code)||(null==r||null===(t=r.error)||void 0===t?void 0:t.code)||"UNKNOWN",source:"string"==typeof(null==r?void 0:r.source)?r.source:"system",traceId:(null==r?void 0:r.traceId)||(null==r||null===(n=r.error)||void 0===n?void 0:n.traceId)||""}}catch(e){return{code:"UNKNOWN",source:"system",traceId:""}}},ly=function(e,t){try{return e()}catch(e){return t}},cy=function(e){return"SUCCESS"===e?"success":"FAIL"===e?"fail":"CANCELLED"===e?"cancelled":"PROCESSING"===e?"processing":"unknown"},uy=function(e){var t=ly((function(){return null==e?void 0:e.redirect}),void 0),n=ly((function(){return null==e?void 0:e.handleActions}),void 0);return{d5:"element.submit",d6:t||"",d7:void 0===n?"":String(n),d8:String(ly((function(){return void 0!==(null==e?void 0:e.shippingInfo)}),!1)),d9:String(ly((function(){return void 0!==(null==e?void 0:e.params)}),!1))}},dy=function(e){var t=ly((function(){return(null==e?void 0:e.status)||""}),""),n=ly((function(){var t;return(null==e||null===(t=e.error)||void 0===t?void 0:t.code)||""}),""),r=ly((function(){var t;return(null==e||null===(t=e.error)||void 0===t?void 0:t.traceId)||""}),""),o=ly((function(){return null==e?void 0:e.userCanceled3D}),void 0),i=ly((function(){var t;return null==e||null===(t=e.error)||void 0===t?void 0:t.needChangeSessionForRetry}),void 0);return{outcome:cy(t),errorCode:n,traceId:r,fields:{d10:t,d11:void 0===o?"":String(o),d12:String(ly((function(){return void 0!==(null==e?void 0:e.paymentSession)}),!1)),d13:void 0===i?"":String(i),d14:ly((function(){return(null==e?void 0:e.code)||""}),""),d15:""}}},py=function(e){try{if(null==e||!e.src)return"";var t=new URL(e.src,window.location.href);return"".concat(t.origin).concat(t.pathname)}catch(e){return"invalid"}},hy=function(e){_()(l,e);var t,n,r,o,a=b()(l);function l(e,t){var n,r,o,i,s,u,d;g()(this,l);var p,m=bc({appearance:{layout:"accordion",theme:"default",displaySetting:{showCardBrandIcon:!0,showRadioWhenAccordionLayout:!0},rules:Ng}},t.appConfig),f=null!==(n=t.appConfig)&&void 0!==n&&n.sessionData?Nh(t.appConfig.sessionData):void 0;(f&&_c.setTrackId(f),d=a.call(this,e,ll("/element_payment/index.html",!0),h()(h()({},t),{},{trackId:f}),m),c()(Ze()(d),"_paymentInProgress",!1),c()(Ze()(d),"paymentTracker",void 0),c()(Ze()(d),"_mountStartedAt",0),c()(Ze()(d),"_mountInProgress",!1),c()(Ze()(d),"_mountPhase","idle"),c()(Ze()(d),"_destroyInProgress",!1),c()(Ze()(d),"walletLogger",new Ua(Ka,!0)),d.paymentTracker=oy(null===(r=t.appConfig)||void 0===r?void 0:r.sessionData,{env:t.env,locale:t.locale,elementInstanceId:e}),pl()((i=Ze()(d),ml()(l.prototype)),"on",i).call(i,Fl,(function(){d._mountPhase="ready_handshake_received",d.paymentTracker.trackHandshake("ready_handshake_received",{d1:l.elementType,m1:d._mountStartedAt?Date.now()-d._mountStartedAt:0})})),pl()((s=Ze()(d),ml()(l.prototype)),"on",s).call(s,Zl,(function(e){d._mountPhase="handshake_ack_received",d.paymentTracker.trackHandshake("handshake_ack_received",{d1:(null==e?void 0:e.version)||"",d2:l.elementType,m1:d._mountStartedAt?Date.now()-d._mountStartedAt:0})})),pl()((u=Ze()(d),ml()(l.prototype)),"on",u).call(u,"paymentMethodChanged",(function(e){d.paymentTracker.setPaymentMethodType(null==e?void 0:e.type),d.paymentTracker.trackElement("payment_method_changed",{d1:(null==e?void 0:e.type)||""})})),null!==(o=t.appConfig)&&void 0!==o&&o.sessionData)&&Hh.setGlobalOptions({hostSign:Oh(null===(p=t.appConfig)||void 0===p?void 0:p.sessionData)});return d}return f()(l,[{key:"setup",value:(o=s()(i()().mark((function e(){var t,n,r,o,a,s,c,u,d,p,m,f,v,g,y,_,E,b,A,S,k,T,P,I,C,w,N,O,R,M,D,L,x,U=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Date.now(),this._mountPhase="setup",this.paymentTracker.trackMount("setup_start",{d1:l.elementType}),e.prev=3,ay({bridge:{on:function(e,t){return pl()(ml()(l.prototype),"on",U).call(U,e,t)},send:this.send.bind(this)},sessionData:this.config.appConfig.sessionData,env:this.config.env,logger:this.walletLogger,tracker:this.paymentTracker}),u=this.config.appConfig.sessionData,d=Xh(u,"ELEMENT_PAYMENT"),p=null==d?void 0:d.paymentSessionConfig,this.paymentTracker.enrich({metaData:d}),m=Date.now(),this.paymentTracker.trackHandshake("sdk_query_start",{d1:l.elementType}),f=function(){var e;return cm(gm({extParams:{isUserPreferredLocale:!0},paymentSessionConfig:p,paymentSessionData:u,merchantAppointParam:{storedCard:{needCVV:!(null===(e=U.config.appConfig.appearance)||void 0===e||null===(e=e.displaySetting)||void 0===e||!e.showCardCVV)}}},{tracker:U.paymentTracker.requestTracker,scope:"paymentElement.sdkQuery"}))},v=function(){return cm(fm({paymentSessionConfig:p,paymentSessionData:u,accountInfo:{email:""}},{tracker:U.paymentTracker.requestTracker,scope:"paymentElement.oneAccountQuery"}))},g=!(null==d||null===(n=d.connectFactor)||void 0===n||!n.enableConnect),(y=Hf(g,null==d?void 0:d.extendInfo))&&this.paymentTracker.trackHandshake("one_account_query_start",{d1:"connect"}),_=y?[f(),v()]:[f(),void 0],e.next=19,Promise.all(_);case 19:return E=e.sent,b=tt()(E,2),A=b[0],S=b[1],(k=!!A.error||!1===(null===(r=A.data)||void 0===r?void 0:r.success))?this.paymentTracker.trackHandshake("sdk_query_failed",{d1:(null===(T=A.error)||void 0===T?void 0:T.code)||(null===(P=A.data)||void 0===P?void 0:P.errorCode)||"UNKNOWN",d2:A.error?"network":"business",d3:(null===(I=A.error)||void 0===I?void 0:I.traceId)||"",m1:Date.now()-m}):this.paymentTracker.trackHandshake("sdk_query_success",{d1:"success",m1:Date.now()-m}),C=!(null==S||!S.error)||!1===(null==S||null===(o=S.data)||void 0===o?void 0:o.success),y&&(C?this.paymentTracker.trackHandshake("one_account_query_failed",{d1:(null==S||null===(w=S.error)||void 0===w?void 0:w.code)||(null==S||null===(N=S.data)||void 0===N?void 0:N.errorCode)||"UNKNOWN",d2:null!=S&&S.error?"network":"business",d3:(null==S||null===(O=S.error)||void 0===O?void 0:O.traceId)||"",m1:Date.now()-m}):this.paymentTracker.trackHandshake("one_account_query_success",{m1:Date.now()-m})),this.paymentTracker.trackHandshake("setup_queries_complete",{d1:k?"fail":"success",d2:y?C?"fail":"success":"skipped",m1:Date.now()-m}),R=ul(null==A?void 0:A.data),M=R||(null===(a=this.config.appConfig)||void 0===a?void 0:a.locale)||this.config.locale,this.paymentTracker.enrich({metaData:d,renderData:A.data,locale:M}),this.paymentTracker.merchantId||this.paymentTracker.trackError("tracking_context_missing",{d1:"merchant_id"}),D=(null===(s=A.data)||void 0===s?void 0:s.merchantId)||(null==d?void 0:d.clientId)||"default merchantId",L={renderData:A.data,renderDataError:A.error||(null==S?void 0:S.error),connectAccount:null==S?void 0:S.data,logMetaData:{paymentMethodCategoryType:null==p?void 0:p.paymentMethodCategoryType,productSceneVersion:null==p?void 0:p.productSceneVersion,trackId:Nh(u),merchantId:D,paymentMethodType:null==d||null===(c=d.paymentMethodInfoView)||void 0===c?void 0:c.paymentMethodType},sessionData:u,sessionMetaData:d,sdkVersion:"0.0.1787898127-dev.21",locale:M,merchantId:D,heightOfVisible:Math.max(window.changingPageHeight||0,window.innerHeight),merchantDomain:window.location.hostname,doMain:window.location.hostname,env:this.config.env,_requestConfig:h()({env:this.config.env},cl())},this.paymentTracker.trackMount("setup_success",{d1:l.elementType,m1:Date.now()-t}),this._mountPhase="setup_complete",e.abrupt("return",L);case 39:throw e.prev=39,e.t0=e.catch(3),x=sy(e.t0),this.paymentTracker.trackError("setup_error",{d1:x.code,d2:x.source,m1:Date.now()-t}),e.t0;case 44:case"end":return e.stop()}}),e,this,[[3,39]])}))),function(){return o.apply(this,arguments)})},{key:"mount",value:(r=s()(i()().mark((function e(t){var n,r,o,a,c=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Date.now(),r=this.status,this._mountStartedAt=n,this._mountPhase="mount_start",this.paymentTracker.trackMount("mount_start",{d1:l.elementType,d2:this.config.appConfig.sessionData?"has_session":"no_session",d3:r}),this._mountInProgress=!0,o=!1,a=function(){};try{a=xl((function(){c._mountInProgress&&!o&&(o=!0,c.paymentTracker.trackMount("mount_exit",{d1:l.elementType,d2:c._mountPhase,m1:Date.now()-n}))}))}catch(e){}return e.prev=9,e.next=12,this.paymentTracker.runAsyncApi({msg:"mount",inputFields:function(){return{d5:"element.mount",d6:l.elementType,d7:String(!!t),d8:r}},action:function(){var e=s()(i()().mark((function e(){var r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=pl()(ml()(l.prototype),"mount",c).call(c,t),c.iframe&&c.paymentTracker.trackMount("iframe_src_set",{d1:l.elementType,d2:py(c.iframe)}),e.next=4,r;case 4:c._mountPhase="mount_complete",c.paymentTracker.trackMount("mount_success",{d1:l.elementType,m1:Date.now()-n});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),outputFields:function(){return{outcome:"success",fields:{d9:c.status,d10:String(!!c.iframe),d11:""}}},errorFields:function(e){return{d9:c.status,d10:String(!!c.iframe),d11:e.source}}});case 12:e.prev=12;try{a()}catch(e){}return this._mountInProgress=!1,e.finish(12);case 16:case"end":return e.stop()}}),e,this,[[9,,12,16]])}))),function(e){return r.apply(this,arguments)})},{key:"updateConfig",value:(n=s()(i()().mark((function e(t){var n,r,o,a,c,u,d,p,h=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=ly((function(){return void 0!==(null==t?void 0:t.amount)}),!1),r=ly((function(){var e;return(null==t||null===(e=t.amount)||void 0===e?void 0:e.currency)||""}),""),o=ly((function(){var e;return(null==t||null===(e=t.appearance)||void 0===e?void 0:e.theme)||""}),""),a=ly((function(){var e;return(null==t||null===(e=t.appearance)||void 0===e?void 0:e.layout)||""}),""),c=ly((function(){return void 0!==(null==t?void 0:t.appearance)}),!1),u=ly((function(){var e;return void 0!==(null==t||null===(e=t.appearance)||void 0===e?void 0:e.displaySetting)}),!1),d=ly((function(){var e;return!(null==t||null===(e=t.appearance)||void 0===e||!e.rules)&&Object.keys(t.appearance.rules).length>0}),!1),p={d5:"element.updateConfig",d6:l.elementType,d7:String(n),d8:r,d9:String(c),d10:o,d11:a,d12:String(u),d13:String(d)},this.paymentTracker.trackElement("update_config_start",{d1:l.elementType,d2:String(n),d3:String(c)}),e.abrupt("return",this.paymentTracker.runAsyncApi({msg:"updateConfig",inputFields:function(){return p},action:function(){var e=s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"ready"===h.status){e.next=3;break}throw new Qh("Checkout page not loaded successfully, please load again.","CHECKOUT_NOT_READY","SDK_USAGE");case 3:Jg(t.amount,h._paymentInProgress),e.next=9;break;case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",{error:Qh.unificationError(e.t0).toJSON()});case 9:return wg(h.config.appConfig,t),e.abrupt("return",pl()(ml()(l.prototype),"updateConfig",h).call(h,t));case 11:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),outputFields:function(e){try{var t=null==e?void 0:e.error;return{outcome:t?"fail":"success",errorCode:null==t?void 0:t.code,traceId:null==t?void 0:t.traceId,fields:{d14:String(!!t),d15:(null==t?void 0:t.source)||""}}}catch(e){return{outcome:"unknown",fields:{d14:"",d15:""}}}},errorFields:function(e){return{d14:"",d15:e.source}}}));case 10:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"submit",value:(t=s()(i()().mark((function e(t){var n,r=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._paymentInProgress=!0,e.prev=1,n=uy(t),this.paymentTracker.trackElement("submit_start",{d1:n.d6,d2:n.d7,d3:n.d8,d4:this.paymentTracker.paymentMethodType,d5:n.d9}),e.next=6,this.paymentTracker.runAsyncApi({msg:"element.submit",inputFields:function(){return n},action:function(){return r._submit(t)},outputFields:dy,errorFields:function(e){return{d10:"",d11:"",d12:"",d13:"",d14:"",d15:e.source}}});case 6:return e.abrupt("return",e.sent);case 7:return e.prev=7,this._paymentInProgress=!1,e.finish(7);case 10:case"end":return e.stop()}}),e,this,[[1,,7,10]])}))),function(e){return t.apply(this,arguments)})},{key:"on",value:function(e,t){var n=this,r=Tg(e);return this.paymentTracker.runSyncApi({msg:"on",inputFields:function(){return{d5:"element.on",d6:l.elementType,d7:r,d8:String("function"==typeof t)}},action:function(){return pl()(ml()(l.prototype),"on",n).call(n,e,t)},outputFields:function(){return{outcome:"success",fields:{d9:""}}},errorFields:function(e){return{d9:e.source}}})}},{key:"unmount",value:function(){var e=this;if(!this._mountInProgress&&!this._destroyInProgress){var t=this.status;return this.paymentTracker.runSyncApi({msg:"unmount",inputFields:function(){return{d5:"element.unmount",d6:l.elementType,d7:t}},action:function(){return pl()(ml()(l.prototype),"unmount",e).call(e)},outputFields:function(){return{outcome:"success",fields:{d8:e.status,d9:""}}},errorFields:function(t){return{d8:e.status,d9:t.source}}})}pl()(ml()(l.prototype),"unmount",this).call(this)}},{key:"destroy",value:function(){var e=this,t=this.status;this._destroyInProgress=!0;try{return this.paymentTracker.runSyncApi({msg:"element.destroy",inputFields:function(){return{d5:"element.destroy",d6:l.elementType,d7:t}},action:function(){return pl()(ml()(l.prototype),"destroy",e).call(e)},outputFields:function(){return{outcome:"success",fields:{d8:e.status,d9:""}}},errorFields:function(t){return{d8:e.status,d9:t.source}}})}finally{this._destroyInProgress=!1}}},{key:"focus",value:function(){throw new Error("Method not implemented.")}},{key:"blur",value:function(){throw new Error("Method not implemented.")}},{key:"clear",value:function(){throw new Error("Method not implemented.")}}]),l}(Yc);c()(hy,"elementType","payment");var fy={env:"prod",debug:!1,targetOrigin:"https://checkout.antom.com",version:"0.0.1787898127-dev.21",trackerCode:"7982"},vy=function(e){return"SUCCESS"===e.status?"success":"FAIL"===e.status?"fail":"CANCELLED"===e.status?"cancelled":"PROCESSING"===e.status?"processing":"unknown"},gy=function(e){try{var t,n=e instanceof Hc?e._mainElement:e,r=null==n||null===(t=n.config)||void 0===t||null===(t=t.appConfig)||void 0===t?void 0:t.sessionData;return"string"==typeof r?r:void 0}catch(e){return}},yy=function(e){_()(p,e);var t,n,r,o,a,l,u,d=b()(p);function p(e){var t,n,r;return g()(this,p),t=d.call(this,bc(fy,e)),c()(Ze()(t),"stopModalMessageMonitor",(function(){})),c()(Ze()(t),"apiTracker",void 0),t.apiTracker=Cg(void 0,{elementType:"sdk",elementInstanceId:"antom-sdk",env:t.config.env,locale:null==e?void 0:e.locale}),_c.initTracker({env:"DEV"}),Hh.setGlobalOptions(h()(h()({env:t.config.env},cl()),{},{sdkVersion:t.config.version,tracker:_c,scope:"antom-web-sdk",envInfo:{locale:null==e?void 0:e.locale}})),n=Mg(),r=null==e?void 0:e.locale,sh.initData(n),r&&lh(r),t.stopModalMessageMonitor=Jc((function(e){try{_c.log(h()({code:"7882element",msg:"modal_lifecycle_monitor"},Gc(e)))}catch(e){}})),t}return f()(p,[{key:"canUseElements",value:function(){return[ty,Og,ey,ry,hy]}},{key:"init",value:(u=s()(i()().mark((function e(){var t=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.apiTracker.runAsyncApi({msg:"sdk.init",inputFields:function(){return{d5:"sdk.init",d6:String(!!t.config.debug)}},action:function(){return pl()(ml()(p.prototype),"init",t).call(t)},outputFields:function(){return{outcome:"success"}}}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return u.apply(this,arguments)})},{key:"updateConfig",value:function(e){var t=this;return this.apiTracker.runSyncApi({msg:"sdk.updateConfig",inputFields:function(){return{d5:"sdk.updateConfig",d6:String(void 0!==(null==e?void 0:e.env)),d7:String(void 0!==(null==e?void 0:e.locale)),d8:String(void 0!==(null==e?void 0:e.debug))}},action:function(){e.env&&Hh.setGlobalOptions({env:e.env}),e.locale&&(Hh.setGlobalOptions({envInfo:{locale:e.locale}}),lh(e.locale)),pl()(ml()(p.prototype),"updateConfig",t).call(t,e)},outputFields:function(){return{outcome:"success"}}})}},{key:"destroy",value:function(){var e=this,t=this.isDestroyed,n=this._getElementSize();return this.apiTracker.runSyncApi({msg:"sdk.destroy",inputFields:function(){return{d5:"sdk.destroy",d6:String(t),m2:n}},action:function(){e.stopModalMessageMonitor(),pl()(ml()(p.prototype),"destroy",e).call(e)},outputFields:function(){return{outcome:"success",fields:{d7:String(e.isDestroyed)}}}})}},{key:"redirect",value:function(e){var t=e.url,n=e.mode,r=e.appLinkUrl,o=e.schemaUrl;function i(){"replace"===n?window.location.replace(t):window.location.href=t}e.destroy&&this.destroy();try{if(r||o)new Xs({resultJudgmentTime:2e3,fallback:function(){i()}}).open({scheme:o,link:r});else i()}catch(e){i()}}},{key:"openModal",value:(l=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=(null==t||null===(n=t.appearance)||void 0===n?void 0:n.theme)||"default",s=null!==(r=Zh[a])&&void 0!==r?r:Zh.default,l=null==t||null===(o=t.appearance)||void 0===o?void 0:o.variables,c=om(h()(h()({},t),{},{loadingConfig:h()(h()({},t.loadingConfig),{},{theme:s.theme,backgroundColor:(null==l?void 0:l["color-background-primary"])||(null==l?void 0:l["background-primary"])||s.backgroundColor})})),u=c.iframe,d=c.destroy,p=function e(){Rc("ERROR","SDK_INTERNAL","modal load error"+t.url),u.removeEventListener("error",e),d()},u.addEventListener("error",p),e.abrupt("return",{destroy:d,getContentWindow:function(){return u.contentWindow}});case 7:case"end":return e.stop()}}),e)}))),function(e){return l.apply(this,arguments)})},{key:"elements",value:function(){var e=this;return this.apiTracker.runSyncApi({msg:"sdk.elements",inputFields:function(){return{d5:"sdk.elements",d6:e.elementMode}},action:function(){return new ny(e.config)},outputFields:function(){return{outcome:"success"}}})}},{key:"createElement",value:function(e,t){var n=this;return Cg(null==t?void 0:t.sessionData,{elementType:e,elementInstanceId:"sdk-create-".concat(e),env:this.config.env,locale:this.config.locale}).runSyncApi({msg:"createElement",inputFields:function(){var n;return{d5:"sdk.createElement",d6:e,d7:String(void 0!==(null==t?void 0:t.sessionData)),d8:(null==t||null===(n=t.appearance)||void 0===n?void 0:n.theme)||""}},action:function(){return n._createElement(e,t)},outputFields:function(){return{outcome:"success"}}})}},{key:"getElement",value:function(e,t){var n=this;return Cg(null==t?void 0:t.sessionData,{elementType:e,elementInstanceId:"sdk-get-".concat(e),env:this.config.env,locale:this.config.locale}).runSyncApi({msg:"getElement",inputFields:function(){return{d5:"sdk.getElement",d6:e}},action:function(){return n._getElement(e,t)},outputFields:function(e){return{outcome:"success",fields:{d7:e?"found":"missing"}}}})}},{key:"extractMainElement",value:function(e){if(e instanceof Hc){var t=e._mainElement;if(!t)throw new Qh("Cannot find main element in elements","NOT_FIND_MAINELEMENT","SDK_USAGE");return t}if(e instanceof Yc)return e;throw new Qh("Cannot find main element in elements","NOT_FIND_MAINELEMENT","SDK_USAGE")}},{key:"confirmCardSetup",value:(a=s()(i()().mark((function e(t){var n,r=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Cg(gy(null==t?void 0:t.elements),{elementType:"vaulting",elementInstanceId:"sdk-confirm-card-setup",env:this.config.env,locale:this.config.locale}),e.abrupt("return",n.runAsyncApi({msg:"confirmCardSetup",inputFields:function(){return{d5:"confirmCardSetup",d6:(null==t?void 0:t.redirect)||"always",d7:"vaulting"}},action:function(){return r.runConfirmCardSetup(t)},outputFields:function(e){var t;return{outcome:vy(e),errorCode:null===(t=e.error)||void 0===t?void 0:t.code,fields:{d10:e.status,d11:void 0===e.userCanceled3D?"":String(e.userCanceled3D),d15:""}}},errorFields:function(e){return{d15:e.source}}}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"runConfirmCardSetup",value:(o=s()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=this.extractMainElement(t.elements),e.abrupt("return",n.submit({redirect:t.redirect||"always"}));case 5:return e.prev=5,e.t0=e.catch(0),r=Qh.unificationError(e.t0),e.abrupt("return",{code:r.code,message:r.message,status:"FAIL",userCanceled3D:!1,error:{code:r.code,message:r.message}});case 9:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(e){return o.apply(this,arguments)})},{key:"confirmPayment",value:(r=s()(i()().mark((function e(t){var n,r=this;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Cg((null==t?void 0:t.sessionData)||gy(null==t?void 0:t.elements),{elementType:"payment",elementInstanceId:"sdk-confirm-payment",env:this.config.env,locale:this.config.locale}),e.abrupt("return",n.runAsyncApi({msg:"submitPayment",inputFields:function(){var e;return{d5:"confirmPayment",d6:null!==(e=null==t?void 0:t.redirect)&&void 0!==e?e:"always",d7:void 0===(null==t?void 0:t.handleActions)?"":String(t.handleActions),d8:String(void 0!==(null==t?void 0:t.shippingInfo)),d9:String(void 0!==(null==t?void 0:t.params))}},action:function(){return r.runConfirmPayment(t)},outputFields:function(e){var t;return{outcome:vy(e),errorCode:null===(t=e.error)||void 0===t?void 0:t.code,fields:{d10:e.status,d11:void 0===e.userCanceled3D?"":String(e.userCanceled3D),d15:""}}},errorFields:function(e){return{d15:e.source}}}));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"runConfirmPayment",value:(n=s()(i()().mark((function e(t){var n,r,o,a,s,l,c,u,d,p,h,m,f,v,g,y,_,E,b;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.elements){e.next=46;break}e.prev=1,n=this.extractMainElement(t.elements),e.next=9;break;case 5:return e.prev=5,e.t0=e.catch(1),r=Qh.unificationError(e.t0),e.abrupt("return",{status:"FAIL",userCanceled3D:!1,error:{code:r.code,message:r.message}});case 9:if(!n.is(ey)){e.next=26;break}return e.prev=10,e.next=13,n.completePayment(t.redirect||"always");case 13:if(c=e.sent,u=["PAYMENT_CANCELLED","APPLE_PAY_CANCEL","GOOGLE_PAY_CANCELED","USER_CANCELED_3D"],d=["COMPLETE_PAYMENT_TIMEOUT","PAYMENT_RESULT_TIMEOUT"],p=null!==(o=c.status)&&void 0!==o?o:c.success?"SUCCESS":d.includes((null===(a=c.error)||void 0===a?void 0:a.code)||"")?"PROCESSING":u.includes((null===(s=c.error)||void 0===s?void 0:s.code)||"")?"CANCELLED":"FAIL",!c.success){e.next=19;break}return e.abrupt("return",{status:p,userCanceled3D:null!==(h=null==c?void 0:c.userCanceled3D)&&void 0!==h&&h});case 19:return e.abrupt("return",{status:p,userCanceled3D:null!==(l=null==c?void 0:c.userCanceled3D)&&void 0!==l&&l,error:c.error?{code:c.error.code,message:c.error.message}:void 0});case 22:return e.prev=22,e.t1=e.catch(10),m=Qh.unificationError(e.t1),e.abrupt("return",{status:"FAIL",userCanceled3D:!1,error:{code:m.code,message:m.message}});case 26:if(!n.is(hy)){e.next=37;break}return e.prev=27,e.next=30,n.submit({redirect:null!==(f=t.redirect)&&void 0!==f?f:"always",params:t.params,shippingInfo:t.shippingInfo,handleActions:t.handleActions});case 30:return e.abrupt("return",e.sent);case 33:return e.prev=33,e.t2=e.catch(27),v=Qh.unificationError(e.t2),e.abrupt("return",{status:"FAIL",userCanceled3D:!1,error:{code:v.code,message:v.message}});case 37:return e.prev=37,g=n,e.abrupt("return",g.submit({redirect:t.redirect||"always",params:t.params}));case 42:return e.prev=42,e.t3=e.catch(37),y=Qh.unificationError(e.t3),e.abrupt("return",{code:y.code,message:y.message,userCanceled3D:!1,status:"FAIL",error:{code:y.code,message:y.message}});case 46:return(_=this.createElement("CVV",{paymentFlow:"automatic",appearance:null==t?void 0:t.appearance,sessionData:t.sessionData})).mount(document.body),e.prev=48,e.next=51,new Promise((function(e,t){var n=setTimeout((function(){t(new Qh("Load app time out","SDK_LAUNCH_PAYMENT_APP_ERROR","SDK_INTERNAL"))}),15e3);_.on(Zl,(function(){clearTimeout(n),e()}))}));case 51:e.next=59;break;case 53:return e.prev=53,e.t4=e.catch(48),_.unmount(),E=Qh.unificationError(e.t4),b=["SDK_LAUNCH_PAYMENT_APP_ERROR"],e.abrupt("return",{code:E.code,message:E.message,status:b.includes(E.code)?"PROCESSING":"FAIL",userCanceled3D:!1,error:{code:E.code,message:E.message}});case 59:return e.abrupt("return",_.submit({redirect:t.redirect||"always",params:t.params}));case 60:case"end":return e.stop()}}),e,this,[[1,5],[10,22],[27,33],[37,42],[48,53]])}))),function(e){return n.apply(this,arguments)})},{key:"confirmVaulting",value:(t=s()(i()().mark((function e(t){var n,r,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,n=this.extractMainElement(t.elements),e.next=8;break;case 4:return e.prev=4,e.t0=e.catch(0),r=Qh.unificationError(e.t0),e.abrupt("return",{status:"FAIL",error:{code:r.code,message:r.message}});case 8:return e.prev=8,e.next=11,n._confirmVaulting(null!==(o=t.redirect)&&void 0!==o?o:"always");case 11:return e.abrupt("return",e.sent);case 14:return e.prev=14,e.t1=e.catch(8),a=Qh.unificationError(e.t1),e.abrupt("return",{status:"FAIL",error:{code:a.code,message:a.message}});case 18:case"end":return e.stop()}}),e,this,[[0,4],[8,14]])}))),function(e){return t.apply(this,arguments)})}]),p}(jc);c()(yy,"version","0.0.1787898127-dev.21");var _y,Ey,by=["env","environment"],Ay=function(){var e=s()(i()().mark((function e(t){var n,r,o,a,s,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(n=t||{}).env,o=n.environment,a=fc()(n,by),s=r||o||"prod",l=h()(h()({},a),{},{env:s}),e.abrupt("return",Eg(l,(function(){return(0,vc.createSingletonInstance)(yy,l,"AntomSDK")})));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();(Ey=["CDN","NPM"]).includes(_y="CDN")&&"undefined"!=typeof window&&(Ey.includes(window._ANTOM_WEB_SDK_INTEGRATION_TYPE)||(window._ANTOM_WEB_SDK_INTEGRATION_TYPE=_y,vg.setMedta({integrationType:_y})));var Sy=sg}(),r}()}));
|
|
7
7
|
//# sourceMappingURL=ams-checkout.min.js.map
|