@zonos/elements 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cart-CiXlehwQ.js → cart-BJpqPdFU.js} +13 -13
- package/dist/cjs/{collect-Drr8fY-q.js → collect-CyUttsvB.js} +3 -3
- package/dist/cjs/{getMissingRequiredShippingFields-DI6qF1z3.js → getMissingRequiredShippingFields-DEbNbRAZ.js} +1 -1
- package/dist/cjs/{handleFetch-DQLhurnE.js → handleFetch-DVfjFTYO.js} +181 -71
- package/dist/cjs/{hasInclusivePrice-84KS94yH.js → hasInclusivePrice-CEPf3_FG.js} +1 -1
- package/dist/cjs/index.cjs.js +104 -12
- package/dist/cjs/{invoice-5hVfSXpb.js → invoice-DzRkkpLu.js} +3 -3
- package/dist/cjs/{localization-B2mjW0Xa.js → localization-BhNVhLZs.js} +24 -48
- package/dist/cjs/{paypal-pd8Nz_R_.js → paypal-DCSqbdjW.js} +4 -4
- package/dist/cjs/{placeTestOrder-DrI8rD9o.js → placeTestOrder-Bkip4PUT.js} +3 -3
- package/dist/cjs/{renderCheckoutCurrency-u5q8YdUb.js → renderCheckoutCurrency-BDvEZ3Hv.js} +2 -2
- package/dist/cjs/{shouldShowLanguageSelect-gBg4KeTQ.js → shouldShowLanguageSelect-NOVWOU53.js} +1 -1
- package/dist/cjs/{submitGtag-Rc-S3PnH.js → submitGtag-D4sB7w4z.js} +1 -1
- package/dist/cjs/{taxIdFields-BrIaPTcd.js → taxIdFields-e4OCgr8K.js} +2 -2
- package/dist/cjs/{updateCheckoutSessionAttributes-d0IKpwW8.js → updateCheckoutSessionAttributes-KxwcsKhM.js} +1 -1
- package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +5 -5
- package/dist/cjs/zonos-address-display_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-address_4.cjs.entry.js +4 -4
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +4 -4
- package/dist/cjs/zonos-card_5.cjs.entry.js +5 -5
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +18 -18
- package/dist/cjs/zonos-checkout.cjs.entry.js +9 -9
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +9 -9
- package/dist/cjs/zonos-collect.cjs.entry.js +6 -6
- package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +9 -9
- package/dist/cjs/zonos-invoice.cjs.entry.js +6 -6
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +4 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +8 -7
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +4 -3
- package/dist/collection/components/main/zonos-controller.js +3 -2
- package/dist/collection/components/store/checkout/cart.js +3 -2
- package/dist/collection/components/store/checkout/stripe.js +10 -9
- package/dist/collection/components/store/storageStore.js +7 -6
- package/dist/collection/components/utils/__tests__/helpers/blockStorage.js +24 -0
- package/dist/collection/components/utils/api/getExchangeRate.js +2 -1
- package/dist/collection/components/utils/handleFetch.js +19 -9
- package/dist/collection/components/utils/hello/countryOverrideStorage.js +17 -40
- package/dist/collection/components/utils/logging/installConstructorCapture.js +58 -0
- package/dist/collection/components/utils/logging/reportBlockedStorage.js +34 -0
- package/dist/collection/components/utils/logging/sendErrorLog.js +8 -1
- package/dist/collection/components/utils/logging/startZonosInit.js +35 -0
- package/dist/collection/components/utils/logging/thrownMessage.js +16 -0
- package/dist/collection/components/utils/safeStorage.js +39 -0
- package/dist/collection/scripts/_getZonosQaUrl.js +3 -2
- package/dist/collection/scripts/_zonosBase.js +6 -2
- package/dist/collection/types/generated/graphql.frontend.types.js +0 -16
- package/dist/collection/types/generated/graphql.internal.types.js +215 -1
- package/dist/esm/{cart-DmJkjiDE.js → cart-BS5mSI8x.js} +13 -13
- package/dist/esm/{collect-BV5GTPmh.js → collect-B9ZxDDl7.js} +3 -3
- package/dist/esm/{getMissingRequiredShippingFields-DljgpDZe.js → getMissingRequiredShippingFields-BkEV865q.js} +1 -1
- package/dist/esm/{handleFetch-D5GYDF-O.js → handleFetch-BFVO7oAR.js} +178 -72
- package/dist/esm/{hasInclusivePrice-DhGXpH2D.js → hasInclusivePrice-zSvDReDb.js} +1 -1
- package/dist/esm/index.js +104 -12
- package/dist/esm/{invoice-CO-iqlni.js → invoice-6iTuS6ek.js} +3 -3
- package/dist/esm/{localization-DHM91diu.js → localization-CXHiWcJp.js} +24 -48
- package/dist/esm/{paypal-BfW5aLJw.js → paypal-BE_NVBoy.js} +4 -4
- package/dist/esm/{placeTestOrder-CyWUFhxD.js → placeTestOrder-BXA9K9Iy.js} +3 -3
- package/dist/esm/{renderCheckoutCurrency-B31ZNkUv.js → renderCheckoutCurrency-KMa4HlAf.js} +2 -2
- package/dist/esm/{shouldShowLanguageSelect-DwSfSHar.js → shouldShowLanguageSelect-BI_ApEsQ.js} +1 -1
- package/dist/esm/{submitGtag-BEFrutel.js → submitGtag-C5xzFHjG.js} +1 -1
- package/dist/esm/{taxIdFields-ByEYfsO5.js → taxIdFields-BUKnHMaL.js} +2 -2
- package/dist/esm/{updateCheckoutSessionAttributes-B0bQH0uw.js → updateCheckoutSessionAttributes-C9bMKTjz.js} +1 -1
- package/dist/esm/zonos-address-completion-dialog_7.entry.js +5 -5
- package/dist/esm/zonos-address-display_2.entry.js +2 -2
- package/dist/esm/zonos-address_4.entry.js +4 -4
- package/dist/esm/zonos-airwallex-payment.entry.js +4 -4
- package/dist/esm/zonos-card_5.entry.js +5 -5
- package/dist/esm/zonos-cart-items_12.entry.js +18 -18
- package/dist/esm/zonos-checkout.entry.js +9 -9
- package/dist/esm/zonos-collect-cart-items_3.entry.js +3 -3
- package/dist/esm/zonos-collect-finish_6.entry.js +9 -9
- package/dist/esm/zonos-collect.entry.js +6 -6
- package/dist/esm/zonos-controller.entry.js +6 -6
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +3 -3
- package/dist/esm/zonos-hello-dialog.entry.js +3 -3
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +5 -5
- package/dist/esm/zonos-invoice-finish_5.entry.js +9 -9
- package/dist/esm/zonos-invoice.entry.js +6 -6
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-policy-consent_2.entry.js +4 -4
- package/dist/esm-es5/{cart-DmJkjiDE.js → cart-BS5mSI8x.js} +58 -58
- package/dist/esm-es5/{collect-BV5GTPmh.js → collect-B9ZxDDl7.js} +1 -1
- package/dist/esm-es5/{getMissingRequiredShippingFields-DljgpDZe.js → getMissingRequiredShippingFields-BkEV865q.js} +1 -1
- package/dist/esm-es5/handleFetch-BFVO7oAR.js +73 -0
- package/dist/esm-es5/{hasInclusivePrice-DhGXpH2D.js → hasInclusivePrice-zSvDReDb.js} +1 -1
- package/dist/esm-es5/index.js +26 -8
- package/dist/esm-es5/{invoice-CO-iqlni.js → invoice-6iTuS6ek.js} +1 -1
- package/dist/esm-es5/{localization-DHM91diu.js → localization-CXHiWcJp.js} +6 -9
- package/dist/esm-es5/{paypal-BfW5aLJw.js → paypal-BE_NVBoy.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-CyWUFhxD.js → placeTestOrder-BXA9K9Iy.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-B31ZNkUv.js → renderCheckoutCurrency-KMa4HlAf.js} +2 -2
- package/dist/esm-es5/{shouldShowLanguageSelect-DwSfSHar.js → shouldShowLanguageSelect-BI_ApEsQ.js} +1 -1
- package/dist/esm-es5/{submitGtag-BEFrutel.js → submitGtag-C5xzFHjG.js} +1 -1
- package/dist/esm-es5/{taxIdFields-ByEYfsO5.js → taxIdFields-BUKnHMaL.js} +2 -2
- package/dist/esm-es5/{updateCheckoutSessionAttributes-B0bQH0uw.js → updateCheckoutSessionAttributes-C9bMKTjz.js} +1 -1
- package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +1 -1
- package/dist/esm-es5/zonos-address-display_2.entry.js +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.entry.js +6 -6
- package/dist/esm-es5/zonos-cart-items_12.entry.js +127 -127
- package/dist/esm-es5/zonos-checkout.entry.js +3 -3
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +6 -6
- package/dist/esm-es5/zonos-controller.entry.js +5 -5
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice.entry.js +3 -3
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
- package/dist/scripts/index.d.ts +6 -0
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/utils/__tests__/helpers/blockStorage.d.ts +3 -0
- package/dist/types/components/utils/logging/installConstructorCapture.d.ts +20 -0
- package/dist/types/components/utils/logging/reportBlockedStorage.d.ts +16 -0
- package/dist/types/components/utils/logging/startZonosInit.d.ts +5 -0
- package/dist/types/components/utils/logging/thrownMessage.d.ts +1 -0
- package/dist/types/components/utils/safeStorage.d.ts +4 -0
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +5 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +0 -22
- package/dist/types/types/generated/graphql.frontend.types.ts +0 -51
- package/dist/types/types/generated/graphql.internal.types.d.ts +270 -1
- package/dist/types/types/generated/graphql.internal.types.ts +341 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-8fa6cfff.entry.js → p-08b01c96.entry.js} +1 -1
- package/dist/zonos-elements/{p-3e705c9b.entry.js → p-0909ef77.entry.js} +1 -1
- package/dist/zonos-elements/{p-2b63865a.system.entry.js → p-13015d34.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2d513aa3.entry.js → p-13d5b2f9.entry.js} +1 -1
- package/dist/zonos-elements/{p-46a839d2.system.entry.js → p-150047b3.system.entry.js} +16 -16
- package/dist/zonos-elements/{p-6e691736.entry.js → p-1986cc37.entry.js} +1 -1
- package/dist/zonos-elements/{p-vTIygnHq.system.js → p-1OG3IJgY.system.js} +1 -1
- package/dist/zonos-elements/{p-189cc594.system.entry.js → p-30bf4700.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4917b74d.entry.js → p-3466bcba.entry.js} +1 -1
- package/dist/zonos-elements/{p-12b24ebb.entry.js → p-383343c7.entry.js} +1 -1
- package/dist/zonos-elements/{p-5585db86.system.entry.js → p-3a506614.system.entry.js} +36 -36
- package/dist/zonos-elements/{p-46b9f0cf.entry.js → p-43c0ebe9.entry.js} +1 -1
- package/dist/zonos-elements/{p-84e76348.entry.js → p-4b65f192.entry.js} +1 -1
- package/dist/zonos-elements/{p-216a908d.system.entry.js → p-573a4e7c.system.entry.js} +6 -6
- package/dist/zonos-elements/{p-1fda4aec.system.entry.js → p-5a296dbc.system.entry.js} +87 -87
- package/dist/zonos-elements/{p-960070d0.system.entry.js → p-68325c5a.system.entry.js} +4 -4
- package/dist/zonos-elements/{p-53eac12f.system.entry.js → p-6db7317a.system.entry.js} +13 -13
- package/dist/zonos-elements/{p-1199baef.system.entry.js → p-709d1561.system.entry.js} +1 -1
- package/dist/zonos-elements/p-71d29603.entry.js +1 -0
- package/dist/zonos-elements/{p-064d8829.system.entry.js → p-7214c953.system.entry.js} +23 -23
- package/dist/zonos-elements/{p-65817880.entry.js → p-7fe83919.entry.js} +1 -1
- package/dist/zonos-elements/p-8ac26831.entry.js +1 -0
- package/dist/zonos-elements/{p-cccaad60.system.entry.js → p-8f9f859f.system.entry.js} +9 -9
- package/dist/zonos-elements/{p-f5f95990.system.entry.js → p-96b250d8.system.entry.js} +14 -14
- package/dist/zonos-elements/{p-678b9214.entry.js → p-97729873.entry.js} +1 -1
- package/dist/zonos-elements/{p-f3d9a380.system.entry.js → p-9b3668a4.system.entry.js} +144 -144
- package/dist/zonos-elements/{p-d8f375da.system.entry.js → p-9df31243.system.entry.js} +1 -1
- package/dist/zonos-elements/p-BI6VAB5B.js +1 -0
- package/dist/zonos-elements/p-BJFa5RwX.js +1 -0
- package/dist/zonos-elements/p-BJ_kE5rM.js +1 -0
- package/dist/zonos-elements/{p-XoQH3S7Z.system.js → p-BKUlQxBd.system.js} +1 -1
- package/dist/zonos-elements/{p-DprOoI2W.system.js → p-BUfCTQXY.system.js} +154 -154
- package/dist/zonos-elements/{p-CBUz18kA.system.js → p-BnQyot7Y.system.js} +23 -23
- package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
- package/dist/zonos-elements/{p-CMo3ZweU.js → p-C-zdj7MK.js} +1 -1
- package/dist/zonos-elements/{p-iAIzUA4k.js → p-C5fs3rIR.js} +1 -1
- package/dist/zonos-elements/{p-D1e9zNDA.js → p-CJmWr75U.js} +1 -1
- package/dist/zonos-elements/{p-Dtu_Japy.system.js → p-CMneHjck.system.js} +39 -39
- package/dist/zonos-elements/p-CP7KnfR3.system.js +245 -0
- package/dist/zonos-elements/p-CVRbGFV3.js +1 -0
- package/dist/zonos-elements/p-Cl5yV0ak.js +1 -0
- package/dist/zonos-elements/{p-CGNVm52g.system.js → p-Cp1IAJvW.system.js} +5 -5
- package/dist/zonos-elements/{p-6vSUiBfr.system.js → p-D-Lnf8mS.system.js} +50 -53
- package/dist/zonos-elements/p-D0DkOoAw.system.js +73 -0
- package/dist/zonos-elements/p-D4xpkSsK.js +1 -0
- package/dist/zonos-elements/p-DATNIakn.js +1 -0
- package/dist/zonos-elements/{p-CbhN65lj.system.js → p-DC1OPJDq.system.js} +1 -1
- package/dist/zonos-elements/{p-CHKKvuiz.js → p-DKnphvmJ.js} +1 -1
- package/dist/zonos-elements/{p-ojtNq-r5.system.js → p-DXlojp_Y.system.js} +1 -1
- package/dist/zonos-elements/{p-C9XLkmmb.system.js → p-DrS-0mk7.system.js} +1 -1
- package/dist/zonos-elements/{p-DpwmHU8R.js → p-DrbN3rPL.js} +2 -2
- package/dist/zonos-elements/{p-BrQ8n8NS.system.js → p-Dv5a-V6w.system.js} +3 -3
- package/dist/zonos-elements/{p-55813e9f.system.entry.js → p-a3c147d2.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-DiMEP3mh.js → p-aK18R41t.js} +1 -1
- package/dist/zonos-elements/p-af4ad54b.entry.js +1 -0
- package/dist/zonos-elements/{p-1e6db427.entry.js → p-af741506.entry.js} +1 -1
- package/dist/zonos-elements/{p-2ca826b9.system.entry.js → p-b540c636.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-636b71d4.entry.js → p-bac94956.entry.js} +1 -1
- package/dist/zonos-elements/{p-941a95a1.system.entry.js → p-bb1b414a.system.entry.js} +5 -5
- package/dist/zonos-elements/{p-e7fdb2c9.entry.js → p-bfa9e32a.entry.js} +1 -1
- package/dist/zonos-elements/p-cf6bf7a4.entry.js +1 -0
- package/dist/zonos-elements/p-dJcbnNlE.system.js +7 -0
- package/dist/zonos-elements/{p-7dc7f328.entry.js → p-db40b9c3.entry.js} +1 -1
- package/dist/zonos-elements/{p-d3345b2c.entry.js → p-dd003161.entry.js} +1 -1
- package/dist/zonos-elements/{p-ef5344ea.entry.js → p-e374aaa4.entry.js} +1 -1
- package/dist/zonos-elements/{p-6410fa11.system.entry.js → p-e43470f7.system.entry.js} +22 -22
- package/dist/zonos-elements/{p-fda89981.system.entry.js → p-ebc7ea54.system.entry.js} +3 -3
- package/dist/zonos-elements/{p-1cc42a98.system.entry.js → p-f2ed52bc.system.entry.js} +16 -16
- package/dist/zonos-elements/p-gEViRqvf.js +1 -0
- package/dist/zonos-elements/{p-DgUrB-1a.system.js → p-yv7ekcdG.system.js} +2 -2
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/handleFetch-D5GYDF-O.js +0 -60
- package/dist/zonos-elements/p-107f287b.entry.js +0 -1
- package/dist/zonos-elements/p-25eb99d4.entry.js +0 -1
- package/dist/zonos-elements/p-8f9d8795.entry.js +0 -1
- package/dist/zonos-elements/p-BMPYH-LT.js +0 -1
- package/dist/zonos-elements/p-C70h5mKA.js +0 -1
- package/dist/zonos-elements/p-CTiqplrr.js +0 -1
- package/dist/zonos-elements/p-Ch1w0Lr7.js +0 -1
- package/dist/zonos-elements/p-D1SmY_fZ.js +0 -1
- package/dist/zonos-elements/p-D6xXnsM_.js +0 -1
- package/dist/zonos-elements/p-DE4a-QD5.js +0 -1
- package/dist/zonos-elements/p-DQrMfUzi.system.js +0 -227
- package/dist/zonos-elements/p-DZdkJHK9.system.js +0 -7
- package/dist/zonos-elements/p-U33isUJG.js +0 -1
- package/dist/zonos-elements/p-ebe157b5.entry.js +0 -1
- package/dist/zonos-elements/p-zVLAvre1.system.js +0 -60
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(n,e,r,o){function t(n){return n instanceof r?n:new r((function(e){e(n)}))}return new(r||(r=Promise))((function(r,i){function a(n){try{s(o.next(n))}catch(n){i(n)}}function u(n){try{s(o["throw"](n))}catch(n){i(n)}}function s(n){n.done?r(n.value):t(n.value).then(a,u)}s((o=o.apply(n,e||[])).next())}))};var __generator=this&&this.__generator||function(n,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,t,i,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=u(0),a["throw"]=u(1),a["return"]=u(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(n){return function(e){return s([n,e])}}function s(u){if(o)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(r=0)),r)try{if(o=1,t&&(i=u[0]&2?t["return"]:u[0]?t["throw"]||((i=t["return"])&&i.call(t),0):t.next)&&!(i=i.call(t,u[1])).done)return i;if(t=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:r.label++;return{value:u[1],done:false};case 5:r.label++;t=u[1];u=[0];continue;case 7:u=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1];i=u;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(u);break}if(i[2])r.ops.pop();r.trys.pop();continue}u=e.call(n,r)}catch(n){u=[6,n];t=0}finally{o=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(n,e,r){if(r||arguments.length===2)for(var o=0,t=e.length,i;o<t;o++){if(i||!(o in e)){if(!i)i=Array.prototype.slice.call(e,0,o);i[o]=e[o]}}return n.concat(i||Array.prototype.slice.call(e))};System.register(["./p-BbgqQIHv.system.js"],(function(n){"use strict";var e;return{setters:[function(n){e=n.l}],execute:function(){var r=this;var o=["cloudflare","vercel"];var t=o[0];var i=n("f",{cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"});var a=i[t];
|
|
2
|
+
/**
|
|
3
|
+
* Next available fallback api type
|
|
4
|
+
*/var u=function(n){if(n===void 0){n=t}var e=o.indexOf(n);var r=o[e+1];if(!r){return null}return r};
|
|
5
|
+
/**
|
|
6
|
+
* This is the time in milliseconds after release time that we will start sending error logs to the new API
|
|
7
|
+
* @default 1 hour
|
|
8
|
+
*/var s=1*3600*1e3;// 1 hour
|
|
9
|
+
var c=function(){var n=new URL(window.location.href);n.searchParams.delete("payment_intent");n.searchParams.delete("payment_intent_client_secret");n.searchParams.delete("redirect_status");return n.toString()};var d=n("s",(function(n){return __awaiter(r,[n],void 0,(function(n){var r,o,t,d,l;var f=n.endpoint,v=n.errors,w=n.metadata,p=n.shouldPostReleaseErrorReporting;return __generator(this,(function(n){e("sendErrorLog","warn",f,w,v);if(p){r=Number(window.Zonos.releaseDate);o=(new Date).getTime();if(o-r>s){return[2/*return*/]}}t="userAgentData"in window.navigator?// userAgentData is not yet supported in all browsers
|
|
10
|
+
window.navigator.userAgentData:null;d={endpoint:f,errors:v,href:c(),metadata:Object.assign({appVersion:window.Zonos.version,domain:window.Zonos.domain,publicCredential:window.Zonos.zonosApiKey,userAgent:t&&t.brands.length>0?t:window.navigator.userAgent},w)};try{
|
|
11
|
+
// use native fetch because in handleFetch also calls sendErrorLog and it will possibly cause circular dependencies issue
|
|
12
|
+
void fetch("".concat(a,"/api/zonos-elements/log-error"),{body:JSON.stringify(d),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(n){l=u();if(!l){return[2/*return*/]}
|
|
13
|
+
// request to the fallback API if the first one fails
|
|
14
|
+
void fetch("".concat(i[l],"/api/zonos-elements/log-error"),{body:JSON.stringify(d),method:"POST"})}return[2/*return*/]}))}))}));var l=n("t",(function(n,e){if(typeof n==="string"&&n){return n}if(n instanceof Error&&n.message){return n.message}if(typeof n==="object"&&n!==null&&"message"in n&&typeof n.message==="string"&&n.message){return n.message}return e}));var f=n("l",(function(n){var r=[];for(var o=1;o<arguments.length;o++){r[o-1]=arguments[o]}e.apply(void 0,__spreadArray([n,"error"],r,false))}));var v=function(){if(!window.__zonosReportedBlockedStorage){window.__zonosReportedBlockedStorage=new Set}return window.__zonosReportedBlockedStorage};
|
|
15
|
+
/**
|
|
16
|
+
* Record a blocked storage read or write on the existing error log.
|
|
17
|
+
* A throw before `window.Zonos` exists is swallowed and does not use up
|
|
18
|
+
* the per-page dedupe slot, so the later startup read can still report it.
|
|
19
|
+
*/var w=function(n,e,r,o){if(typeof window.Zonos==="undefined"){return}var t="".concat(n,"\0").concat(e,"\0").concat(r);var i=v();if(i.has(t)){return}i.add(t);void d({endpoint:"storage://".concat(n,"/").concat(r),errors:[l(o,"SecurityError")],metadata:{area:n,key:r,operation:e,shape:"blocked-storage"}})};
|
|
20
|
+
/**
|
|
21
|
+
* Touch `window.localStorage` / `window.sessionStorage` inside the try.
|
|
22
|
+
* Safari throws SecurityError on the getter itself when storage is blocked.
|
|
23
|
+
* A missing storage object is the same failure: calling `getItem` on it
|
|
24
|
+
* would report a TypeError instead of blocked storage.
|
|
25
|
+
*/var p=function(n){var e=n==="local"?window.localStorage:window.sessionStorage;if(!e){throw new DOMException("","SecurityError")}return e};var h=n("c",(function(n,e){try{return p(n).getItem(e)}catch(r){w(n,"getItem",e,r);return null}}));var y=n("b",(function(n,e){try{p(n).removeItem(e)}catch(r){w(n,"removeItem",e,r)}}));var b=n("e",(function(n,e,r){try{p(n).setItem(e,r)}catch(r){w(n,"setItem",e,r)}}));var m=n("a",(function(){return window.location.search.includes("zonosStagingMode=1")}));var g=n("g",(function(){var n;return((n=window.Zonos.zonosApiKey)===null||n===void 0?void 0:n.includes("test"))||window.location.search.includes("zonosTestMode=1")}));var _=n("j",(function(n){if(typeof n==="string"){try{
|
|
26
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
27
|
+
var e=JSON.parse(n);return e}catch(n){return null}}return null}));var T=890;var j=n("i",(function(n){return n||window.innerWidth<T}));var k=function(){var n="connection"in window.navigator?// connection is not yet supported in all browsers
|
|
28
|
+
window.navigator.connection:null;var e="mozConnection"in window.navigator?// mozConnection is not yet supported in all browsers
|
|
29
|
+
window.navigator.mozConnection:null;var r="webkitConnection"in window.navigator?// webkitConnection is not yet supported in all browsers
|
|
30
|
+
window.navigator.webkitConnection:null;var o=n||e||r;return o};var O=n("d",(function(){var n="userAgentData"in window.navigator?// userAgentData is not yet supported in all browsers
|
|
31
|
+
window.navigator.userAgentData:null;var e=k();return{connectionDownlink:e===null||e===void 0?void 0:e.downlink,connectionEffectiveType:e===null||e===void 0?void 0:e.effectiveType,connectionRtt:e===null||e===void 0?void 0:e.rtt,connectionSaveData:e===null||e===void 0?void 0:e.saveData,isHostedCheckout:window.Zonos.isLegacyCheckout,screenHeight:window.screen.height,screenWidth:window.innerWidth,userAgent:n&&n.brands.length>0?n:window.navigator.userAgent}}));var z=["/api/zonos-elements/log-script-load","/api/zonos-elements/log-bulk-load-data"];
|
|
32
|
+
/**
|
|
33
|
+
* Prepares the load time api log for the given API call to send to the server later
|
|
34
|
+
* This function is used to prepare the load time api log for the given API call.
|
|
35
|
+
* It adds the load time api log to the loadTimeApiInfoList.
|
|
36
|
+
*/var S=function(n){var e=n.apiPath,r=n.apiType,o=n.loadTimeInternal,t=n.loadTimeTotal;if(z.includes(e)){return}var i=t-o;
|
|
37
|
+
// No need to record if the browser API load time is negative (cached)
|
|
38
|
+
if(i<0){return}
|
|
39
|
+
// e.g. /api/zonos-elements/log-script-load?zonosDebug=1 -> /api/zonos-elements/log-script-load
|
|
40
|
+
var a=e.split("?")[0]||e;var u=O();var s=typeof u.userAgent==="object"&&u.userAgent.mobile;var c={apiType:r,connectionType:u.connectionEffectiveType,href:a,isHostedCheckout:window.Zonos.isLegacyCheckout,
|
|
41
|
+
// Use the isMobileAgent to determine if the checkout is mobile, if it's not availabe, use the logic from isCheckoutMobile
|
|
42
|
+
isMobile:j(s),loadTimeBrowserApi:i,loadTimeInternal:o,loadTimeTotal:t,metadata:Object.assign({},u),screenHeight:u.screenHeight,screenWidth:u.screenWidth,userAgent:typeof u.userAgent==="string"?u.userAgent:u.userAgent["brands"].map((function(n){return n.brand})).filter((function(n){return!/Not.*A.*Brand.*/.test(n)})).join(",")};window.Zonos.loadTimeApiInfoList.push(c)};var A=undefined&&undefined.__rest||function(n,e){var r={};for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0)r[o]=n[o];if(n!=null&&typeof Object.getOwnPropertySymbols==="function")for(var t=0,o=Object.getOwnPropertySymbols(n);t<o.length;t++){if(e.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(n,o[t]))r[o[t]]=n[o[t]]}return r};var E=function(n){return n===502||n===503||n===504};var M=function(n){return __awaiter(r,[n],void 0,(function(n){var e,r,o;var t=n.response,i=n.shouldLog,a=i===void 0?true:i,u=n.shouldThrow,s=u===void 0?false:u;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4/*yield*/,t.text()];case 1:e=n.sent();r=_(e);if(!r){throw new Error("Failed to parse content: ".concat(e))}return[2/*return*/,r];case 2:o=n.sent();if(s){throw o}if(a){
|
|
43
|
+
// eslint-disable-next-line
|
|
44
|
+
console.error(o)}return[2/*return*/,null];case 3:return[2/*return*/]}}))}))};var P=function(n){try{
|
|
45
|
+
// encode the string, remove the "=" at the end of the encoded string
|
|
46
|
+
var e=btoa(n).replace(/=/g,"");return e}catch(e){
|
|
47
|
+
// return the reverse string if the encoding failed
|
|
48
|
+
return n.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}};var I=function(n){return __awaiter(r,[n],void 0,(function(n){var e,r,o,a,u,s,c,d,l,f,v,f,w,p,c,h,c;var y=n.basePathType,b=n.options,m=n.path;return __generator(this,(function(n){switch(n.label){case 0:r=window.Zonos.zonosQaUrlApi||i[y]||t;o=r+m;a=new URL(o);u=window.Zonos.cartId?"".concat(window.location.hostname,"-").concat(window.Zonos.cartId):window.location.hostname;a.searchParams.set("zToken",P(u));n.label=1;case 1:n.trys.push([1,3,,4]);return[4/*yield*/,fetch(a.toString(),b)];case 2:e=n.sent();return[3/*break*/,4];case 3:s=n.sent();if(s instanceof Error){return[2/*return*/,{baseUrl:r,errors:[{message:s.message,type:"unknown"}],json:null,response:null,zonosMode:null}]}c="Failed to fetch";return[2/*return*/,{baseUrl:r,errors:[{message:c,type:"unknown"}],json:null,response:null,zonosMode:null}];case 4:d=e.headers.get("Zonos-Mode");l=window.Zonos.zonosQaUrl;
|
|
49
|
+
// We only want to alert once if the user is in preview mode and it's also using production environment
|
|
50
|
+
if(!window.Zonos.modeAlerted&&d&&l){window.Zonos.modeAlerted=true}if(!e.ok)return[3/*break*/,6];return[4/*yield*/,M({response:e})];case 5:f=n.sent();return[2/*return*/,{baseUrl:r,errors:[],json:f,response:e,zonosMode:d}];case 6:v=e.status.toString();n.label=7;case 7:n.trys.push([7,9,,10]);return[4/*yield*/,M({response:e,shouldThrow:true})];case 8:f=n.sent();
|
|
51
|
+
// Parse and access "errors" from the response if possible
|
|
52
|
+
if(f&&"errors"in f&&Array.isArray(f.errors)){w=f.errors;p=w.map((function(n){if(typeof n==="string"){return{message:n,type:v}}return n}));return[2/*return*/,{baseUrl:r,errors:p,json:null,response:e,zonosMode:d}]}c=JSON.stringify(f);return[2/*return*/,{baseUrl:r,errors:[{message:c,type:v}],json:null,response:e,zonosMode:d}];case 9:h=n.sent();c="Unknown error";
|
|
53
|
+
// A gateway HTML or empty body still carries a status a GET can fail over
|
|
54
|
+
// on. Other non-JSON statuses, including 404 and 500, keep the previous
|
|
55
|
+
// null response so they do not fail over.
|
|
56
|
+
return[2/*return*/,{baseUrl:r,errors:[{message:"".concat(v,": ").concat(c),type:v}],json:null,response:E(e.status)?e:null,zonosMode:d}];case 10:return[2/*return*/]}}))}))};var U=function(n){return __awaiter(r,[n],void 0,(function(n){var r,o,t,a,s,c,l,f,v,w,p,h,y,b,m,g,T,j,k,O,z,M;var P=n.basePathType,Z=n.options,C=n.path;return __generator(this,(function(n){switch(n.label){case 0:a=C.startsWith("/api/bigcommerce");s=a?"vercel":P;c=performance.now();return[4/*yield*/,I({basePathType:s,options:Z,path:C})];case 1:l=n.sent(),f=l.errors,v=l.response,w=A(l,["errors","response"]);p=performance.now();h=p-c;
|
|
57
|
+
// Send the load time api log
|
|
58
|
+
e("".concat(C," (").concat(h.toFixed(2),"ms)"),"info");y=v===null||v===void 0?void 0:v.headers.get("Zonos-Duration");
|
|
59
|
+
// Only record if the response status is 200, some endpoint will return 200 with error
|
|
60
|
+
if((v===null||v===void 0?void 0:v.status)===200){S({apiPath:C,apiType:s,loadTimeInternal:y?Number(y):0,loadTimeTotal:h})}b=u(s);m=f.find((function(n){var e=n.type;return e==="unknown"}));g=f.find((function(n){var e=n.message;return typeof e==="string"&&(e.includes("signal is aborted")||e.includes("The operation was aborted")||e.includes("Fetch is aborted"))}));T=v===null||v===void 0?void 0:v.status;j=T!==undefined&&E(T);k=((r=Z===null||Z===void 0?void 0:Z.method)!==null&&r!==void 0?r:"GET").toUpperCase()==="GET";O=!!m||T===404||T===500;z=O||j;M=b&&(O||j&&k);
|
|
61
|
+
// Should log the error if it's unknown error
|
|
62
|
+
if(z&&!g){void d({endpoint:i[s]+C,errors:f.map((function(n){var e=n.message;return"API: ".concat(e)})),metadata:{currentBasePath:s,nextFallbackApiType:b,requestHeaders:Z===null||Z===void 0?void 0:Z.headers,requestPayload:_((o=Z===null||Z===void 0?void 0:Z.body)===null||o===void 0?void 0:o.toString())||((t=Z===null||Z===void 0?void 0:Z.body)===null||t===void 0?void 0:t.toString()),shouldCallFallback:M,status:v===null||v===void 0?void 0:v.status,statusText:v===null||v===void 0?void 0:v.statusText},
|
|
63
|
+
// When the error is unknown, error reporting should be enabled for period of time after release, so we can monitor the error.
|
|
64
|
+
shouldPostReleaseErrorReporting:true})}if(M){e('=== "'.concat(C,'" failed to fetch, trying next fallback ').concat(b));return[2/*return*/,U({basePathType:b,options:Z,path:C})]}
|
|
65
|
+
// No more fallbacks, just return the result
|
|
66
|
+
return[2/*return*/,Object.assign({errors:f,response:v},w)]}}))}))};
|
|
67
|
+
/**
|
|
68
|
+
* Fetch request and will request to fallback API when the first one fails
|
|
69
|
+
* @param path Path name of the request (e.g. /api/something/com).
|
|
70
|
+
* @param _opts fetch options
|
|
71
|
+
*/var Z=n("h",(function(n,e){return __awaiter(r,void 0,void 0,(function(){var r,o,i,a,u,s;return __generator(this,(function(c){r=A(e||{},[]);o=r.body?JSON.stringify(r.body):undefined;i=r.method||"GET";a=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Staging-Mode":m()?"1":undefined,"Zonos-Test-Mode":g()?"1":undefined,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},r.headers);
|
|
72
|
+
// filter all underfined headers
|
|
73
|
+
Object.keys(a).forEach((function(n){return a[n]===undefined&&delete a[n]}));u=Object.assign(Object.assign({},r),{body:i==="GET"?undefined:o,headers:a,method:i});s=new URLSearchParams(window.location.search).get("useFallbackApi");return[2/*return*/,U({basePathType:s||t,options:u,path:n})]}))}))}))}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,z as o}from"./p-CqB9AfBf.js";import{d as t,Z as a,b as s,a1 as n}from"./p-BJ_kE5rM.js";import{s as r}from"./p-CVRbGFV3.js";import{h as d,s as i,l}from"./p-gEViRqvf.js";import{b as c}from"./p-BJmZPrZl.js";const{state:p}=e((()=>({amountTotalDue:null,isFetchingPayorInfo:!0,landedCostShortId:null,partyBillingId:null,payorAddress:null}))),u=async({landedCostId:e,retries:a=5})=>{var s,n,r;p.isFetchingPayorInfo=!0;const l=await d("/api/zonos-elements/invoice/get-payor-info-by-lc-id",{body:{landedCostId:e},method:"POST"});if(l.errors.length)return a>0?(await new Promise((e=>setTimeout(e,1e3))),u({landedCostId:e,retries:a-1})):null;p.landedCostShortId=(null===(s=l.json)||void 0===s?void 0:s.landedCostShortId)||null,p.isFetchingPayorInfo=!1,p.payorAddress=(null===(n=l.json)||void 0===n?void 0:n.payor)||null;const c=null===(r=t.checkoutSession)||void 0===r?void 0:r.subtotals;p.amountTotalDue=(null==c?void 0:c.items)||0,0===p.amountTotalDue&&i({endpoint:"INVOICE_NO_TOTAL_DUE",errors:[],metadata:{landedCostId:e,organizationId:o.organizationId}})},I=async()=>{var e,o,a,u;if(!(null===(e=s.stripeBillingAddressEventData)||void 0===e?void 0:e.complete))return{partiesCreated:!1};const I=null===(a=null===(o=t.checkoutSession)||void 0===o?void 0:o.landedCost)||void 0===a?void 0:a.rootId;if(!I)return i({endpoint:"PF_NO_SELECTED_LANDED_COST",errors:["No selected landed cost"],metadata:{allLogs:c,cartId:window.Zonos.cartId,checkoutSessionId:r.checkoutSessionId}}),{partiesCreated:!1};if(!r.checkoutSessionId)return i({endpoint:"INVOICE_NO_CHECKOUT_SESSION_ID",errors:["No checkout session id"],metadata:{allLogs:c,cartId:window.Zonos.cartId,landedCostRootId:I}}),{partiesCreated:!1};const m=n({address:s.stripeBillingAddressEventData.value.address,firstName:s.stripeBillingAddressEventData.value.firstName,lastName:s.stripeBillingAddressEventData.value.lastName,name:s.stripeBillingAddressEventData.value.name,phone:s.stripeBillingAddressEventData.value.phone}),C="1"===new URLSearchParams(window.location.search).get("zonosE2ETest"),{errors:v,json:E}=await d("/api/zonos-elements/create-billing-party",{body:{billingAddress:m,checkoutSessionId:r.checkoutSessionId,companyName:s.companyName,email:(null===(u=s.stripeLinkEventData)||void 0===u?void 0:u.value.email)||"",isTest:C,rootId:I},method:"POST"});return v.length||!E?(l("Error occurs when creating billing party",JSON.stringify(v,null,2)),i({endpoint:"INVOICE_BILLING_PARTY_CREATE_FAILED",errors:["[INVOICE] Failed to create billing party"],metadata:{allLogs:c,cartId:window.Zonos.cartId,checkoutSessionId:r.checkoutSessionId,errors:v,json:E}}),{partiesCreated:!1}):(p.partyBillingId=E.billToPartyId,{partiesCreated:!0})},m=async e=>{const o=e.landedCost;return!!o&&(t.landedCostData=[Object.assign(Object.assign({},e),{landedCost:Object.assign({},o),landedCostId:o.id})],a({applySubtotalsOnly:!0,landedCostId:o.id,selectedShippingOption:o.shipmentRating}))};export{u as a,I as b,p as c,m as i}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as r}from"./p-BJ_kE5rM.js";import{B as o,j as n}from"./p-CVRbGFV3.js";const u=({amount:u,isForeign:i})=>{var t,a;const s=(null===(t=r.exchangeRate)||void 0===t?void 0:t.rate)||1,v=i?u:o(u),c=r.currency;if((null===(a=r.items[0])||void 0===a?void 0:a.currencyCode)===c)return n({amount:v,currency:c});const d=r.displayBaseCurrency,e=(()=>{var o,n;return r.displayBaseCurrency&&(null===(o=r.exchangeRate)||void 0===o?void 0:o.sourceCurrencyCode)?null===(n=r.exchangeRate)||void 0===n?void 0:n.sourceCurrencyCode:r.currency})();return n(i?{amount:d?v/s:v,currency:e}:{amount:d?v:v*s,currency:e})};export{u as r}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r["throw"](e))}catch(e){o(e)}}function u(e){e.done?n(e.value):i(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=s(0),a["throw"]=s(1),a["return"]=s(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(n=0)),n)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;i=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-DTgUqgwV.system.js","./p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r["throw"](e))}catch(e){o(e)}}function u(e){e.done?n(e.value):i(e.value).then(a,s)}u((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=s(0),a["throw"]=s(1),a["return"]=s(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return u([e,t])}}function u(s){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(n=0)),n)try{if(r=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;i=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];i=0}finally{r=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-DTgUqgwV.system.js","./p-BUfCTQXY.system.js","./p-D-Lnf8mS.system.js","./p-D0DkOoAw.system.js","./p-BbgqQIHv.system.js"],(function(e){"use strict";var t,n,r,i,o,a,s,u,d,c,l;return{setters:[function(e){t=e.c;n=e.z},function(e){r=e.d;i=e.Z;o=e.b;a=e.a1},function(e){s=e.s},function(e){u=e.h;d=e.s;c=e.l},function(e){l=e.b}],execute:function(){var f=this;var v=t((function(){return{amountTotalDue:null,isFetchingPayorInfo:true,landedCostShortId:null,partyBillingId:null,payorAddress:null}})).state;e("c",v);var p=e("a",(function(e){return __awaiter(f,[e],void 0,(function(e){var t,i,o,a,s;var c=e.landedCostId,l=e.retries,f=l===void 0?5:l;return __generator(this,(function(e){switch(e.label){case 0:v.isFetchingPayorInfo=true;return[4/*yield*/,u("/api/zonos-elements/invoice/get-payor-info-by-lc-id",{body:{landedCostId:c},method:"POST"})];case 1:a=e.sent();if(!a.errors.length)return[3/*break*/,4];if(!(f>0))return[3/*break*/,3];
|
|
2
2
|
// Wait for 1 second before retrying
|
|
3
3
|
return[4/*yield*/,new Promise((function(e){return setTimeout(e,1e3)}))];case 2:
|
|
4
4
|
// Wait for 1 second before retrying
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,f as r}from"./p-CqB9AfBf.js";import{r as o}from"./p-n5PZKz1k.js";import{h as n}from"./p-_lt63o7c.js";import{V as t,b as a}from"./p-
|
|
1
|
+
import{r as e,f as r}from"./p-CqB9AfBf.js";import{r as o}from"./p-n5PZKz1k.js";import{h as n}from"./p-_lt63o7c.js";import{V as t,b as a}from"./p-BJ_kE5rM.js";import{t as l}from"./p-CVRbGFV3.js";import{t as u,d as i}from"./p-Dwg61Ft_.js";var s,p,d=r(function(){if(p)return s;p=1;var r=o(),n=e();return s=function(e,o,t){var a=!0,l=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return n(t)&&(a="leading"in t?!!t.leading:a,l="trailing"in t?!!t.trailing:l),r(e,o,{leading:a,maxWait:o,trailing:l})}}());const c=({companyName:e,countryCode:r,errorField:o,errorMessage:s,onTaxIdChange:p,shouldRequirePeruTaxId:d,taxId:c,taxIdType:m})=>{const y=(({companyName:e,countryCode:r,errorField:o,errorMessage:n,shouldRequirePeruTaxId:a,taxIdType:l})=>{var i,s;const{rendered:p,selectedType:d,send:c,typeOptions:m}=t({companyName:e,countryCode:r,shouldRequirePeruTaxId:a,taxIdType:l});if(!p)return null;const y=m?null:u(r);return{inputLabel:null!==(i=null==d?void 0:d.label)&&void 0!==i?i:null==y?void 0:y.friendlyName,inputPlaceholder:null!==(s=null==d?void 0:d.placeholder)&&void 0!==s?s:null==y?void 0:y.placeholder,selectedValue:(null==d?void 0:d.value)||"",showValueInput:c,typeError:"type"===o?n:"",typeOptions:m,valueError:"value"===o?n:""}})({companyName:e,countryCode:r,errorField:o,errorMessage:s,shouldRequirePeruTaxId:d,taxIdType:m});return y?n("div",{class:"zonos--tax-id-input"},y.typeOptions&&n("zonos-stripe-select",{error:y.typeError,isError:!!y.typeError,onSelectChange:e=>{i(e.detail)&&(a.taxIdType=e.detail)},options:y.typeOptions.map((e=>({label:l(e.label),value:e.value}))),selectLabel:l("Tax id type"),selectedValue:y.selectedValue,value:y.selectedValue}),y.showValueInput&&n("zonos-stripe-input",{error:y.valueError,inputLabel:y.inputLabel?l(y.inputLabel):"",inputPlaceholder:y.inputPlaceholder||"",inputValue:c,isError:!!y.valueError,onInputChange:e=>{a.taxId=e.detail,null==p||p(e.detail)}})):null};export{c as r,d as t}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
System.register(["./p-DTgUqgwV.system.js","./p-
|
|
1
|
+
System.register(["./p-DTgUqgwV.system.js","./p-D0DkOoAw.system.js","./p-BbgqQIHv.system.js"],(function(n){"use strict";var e,t,r;return{setters:[function(n){e=n.z},function(n){t=n.g},function(n){r=n.l}],execute:function(){
|
|
2
2
|
/** Message type for zonos-analytic events sent from iframe to parent. */
|
|
3
3
|
var i="zonos-analytic";
|
|
4
4
|
/** Ping sent by iframe to configure parent's analytics relay (e.g. GA, FB Pixel) and get ready signal. */var o="zonos-analytics-relay-ping";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
System.register(["./p-DTgUqgwV.system.js","./p-DIab60nK.system.js","./p-CIevpRv_.system.js","./p-
|
|
1
|
+
System.register(["./p-DTgUqgwV.system.js","./p-DIab60nK.system.js","./p-CIevpRv_.system.js","./p-BUfCTQXY.system.js","./p-D-Lnf8mS.system.js","./p-CzKlS3E-.system.js"],(function(e){"use strict";var n,r,t,i,u,o,l,a,s;return{setters:[function(e){n=e.r;r=e.f},function(e){t=e.r},function(e){i=e.h},function(e){u=e.V;o=e.b},function(e){l=e.t},function(e){a=e.t;s=e.d}],execute:function(){var v;var d;function c(){if(d)return v;d=1;var e=t(),r=n();
|
|
2
2
|
/** Error message constants. */var i="Expected a function";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a throttled function that only invokes `func` at most once per
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{z as e,c as o}from"./p-CqB9AfBf.js";import{x as n,j as t,t as r,y as a,G as i,C as s,b as c,d as u,n as l,A as d,T as p,B as f,D as y,K as v}from"./p-
|
|
1
|
+
import{z as e,c as o}from"./p-CqB9AfBf.js";import{x as n,j as t,t as r,y as a,G as i,C as s,b as c,d as u,n as l,A as d,T as p,B as f,D as y,K as v}from"./p-BJ_kE5rM.js";import{s as b,t as h}from"./p-CVRbGFV3.js";import{h as m,g as w,l as j,j as P}from"./p-gEViRqvf.js";import{i as k}from"./p-CICjAi70.js";import{l as I}from"./p-BJmZPrZl.js";import{i as E,a as O,s as S}from"./p-CJmWr75U.js";
|
|
2
2
|
/*!
|
|
3
3
|
* paypal-js v8.4.2 (2025-09-04T17:21:30.135Z)
|
|
4
4
|
* Copyright 2020-present, PayPal, Inc. All rights reserved.
|
|
@@ -14,4 +14,4 @@ import{z as e,c as o}from"./p-CqB9AfBf.js";import{x as n,j as t,t as r,y as a,G
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/function g(e,o){void 0===o&&(o={});var n=document.createElement("script");return n.src=e,Object.keys(o).forEach((function(e){n.setAttribute(e,o[e]),"data-csp-nonce"===e&&n.setAttribute("nonce",o["data-csp-nonce"])})),n}function A(e,o){if(void 0===o&&(o=Promise),C(e,o),"undefined"==typeof document)return o.resolve(null);var n=function(e){var o,n,t=e.sdkBaseUrl,r=e.environment,a=function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)o.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]])}return n}(e,["sdkBaseUrl","environment"]),i=t||function(e){return"sandbox"===e?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"}(r),s=a,c=Object.keys(s).filter((function(e){return null!=s[e]&&""!==s[e]})).reduce((function(e,o){var n=s[o].toString();return"data"===(o=o.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,o){return(o?"-":"")+e.toLowerCase()}))).substring(0,4)||"crossorigin"===o?e.attributes[o]=n:e.queryParams[o]=n,e}),{queryParams:{},attributes:{}}),u=c.queryParams,l=c.attributes;return u["merchant-id"]&&-1!==u["merchant-id"].indexOf(",")&&(l["data-merchant-id"]=u["merchant-id"],u["merchant-id"]="*"),{url:"".concat(i,"?").concat((o=u,n="",Object.keys(o).forEach((function(e){0!==n.length&&(n+="&"),n+=e+"="+o[e]})),n)),attributes:l}}(e),t=n.url,r=n.attributes,a=r["data-namespace"]||"paypal",i=B(a);return r["data-js-sdk-library"]||(r["data-js-sdk-library"]="paypal-js"),function(e,o){var n=document.querySelector('script[src="'.concat(e,'"]'));if(null===n)return null;var t=g(e,o),r=n.cloneNode();if(delete r.dataset.uidAuto,Object.keys(r.dataset).length!==Object.keys(t.dataset).length)return null;var a=!0;return Object.keys(r.dataset).forEach((function(e){r.dataset[e]!==t.dataset[e]&&(a=!1)})),a?n:null}(t,r)&&i?o.resolve(i):function(e,o){void 0===o&&(o=Promise),C(e,o);var n=e.url,t=e.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==t&&"object"!=typeof t)throw new Error("Expected attributes to be an object.");return new o((function(e,o){if("undefined"==typeof document)return e();!function(e){var o=e.onSuccess,n=e.onError,t=g(e.url,e.attributes);t.onerror=n,t.onload=o,document.head.insertBefore(t,document.head.firstElementChild)}({url:n,attributes:t,onSuccess:function(){return e()},onError:function(){var e=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return o(e)}})}))}({url:t,attributes:r},o).then((function(){var e=B(a);if(e)return e;throw new Error("The window.".concat(a," global variable is not available."))}))}function B(e){return window[e]}function C(e,o){if("object"!=typeof e||null===e)throw new Error("Expected an options object.");var n=e.environment;if(n&&"production"!==n&&"sandbox"!==n)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==o&&"function"!=typeof o)throw new Error("Expected PromisePonyfill to be a function.")}"function"==typeof SuppressedError&&SuppressedError;const x={purchase:"Purchase","zonos-checkout-payment-info":"AddPaymentInfo","zonos-checkout-start":"InitiateCheckout"},T=e=>{if(!e)return{};if(!(e=>!!e&&Array.isArray(e.items))(e))return Object.assign({},e);const{currency:o,items:n,transaction_id:t,value:r}=e,a=function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)o.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]])}return n}(e,["currency","items","transaction_id","value"]),i=n.map((e=>({id:e.item_id,item_price:e.price,quantity:e.quantity}))),s=n.map((e=>e.item_id)),c=n.reduce(((e,o)=>e+o.quantity),0),u=Object.assign(Object.assign({},a),{content_ids:s,content_type:"product",contents:i,num_items:c});return t&&(u.order_id=t),void 0!==o&&(u.currency=o),void 0!==r&&(u.value=r),u},z=(e,o,n)=>{O()?E({event:o,fbqMode:e,payload:n,provider:"fbq"}):"function"==typeof window.fbq&&(I("Zonos submits fbq event","log",`${e}:${o}`),window.fbq(e,o,n))},D=o=>{S(o),(({event:o,metadata:n})=>{if(!(()=>{const o=e.checkoutSettings.analyticsProviders.find((e=>"FACEBOOK_PIXEL"===e.type));return!!o&&"ENABLED"===o.status})())return;const t=w(),r=T(n),a=Object.assign(Object.assign({},r),t&&{isTestMode:!0}),i=Object.fromEntries(Object.entries(a).filter((([e,o])=>null!==o)));z("trackCustom",o,i);const s=(e=>{var o;return null!==(o=x[e])&&void 0!==o?o:null})(o);s&&s!==o&&z("track",s,i)})(o)},{onChange:L,reset:M,state:_}=o((()=>({intent:"capture",orderIdCreated:null,paypal:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}))),R=({checkoutSessionId:o,onPaypalFail:b,onPaypalSessionDone:w,overrideBorderRaidus:I,overridePrimaryColor:O})=>({createOrder:async()=>{var e;if(r({checkoutSessionId:o,eventName:"checkout_paymentInfoCompleted",metadata:{paymentMethod:"paypal"}}),a()&&!i.accepted)return i.showError=!0,null===(e=document.querySelector("zonos-policy-consent"))||void 0===e||e.scrollIntoView({behavior:"smooth"}),null==b||b(),"";const P=a();P&&(i.locked=!0);let k=!1;try{const e=await s();if(!e.valid)return _.paypalErrorMessage=e.errorMessage,c.hasPaymentError=!1,c.customErrorMessage=null,D({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:o}}),null==b||b(),"";_.paypalErrorMessage=null,u.inventoryCheckErrorMessage=null;try{u.inventoryCheckErrorMessage=await l()}catch(e){u.inventoryCheckErrorMessage=h("Unable to check inventory. Please try again.")}if(u.inventoryCheckErrorMessage)return"";if(v()>0){const e=await d();if(!e.success)return _.paypalErrorMessage=e.error||h("Unable to apply store credit. Please try again."),null==b||b(),""}if(await p(),f()){const e=await y();return e.success?(null==w||w({orderId:e.orderId||""}),n(),t(),k=!0,""):(_.paypalErrorMessage=e.error||h("Unable to place order with store credit. Please try again."),null==b||b(),"")}const r=await(async({checkoutSessionId:e})=>{var o,n;const t=_.intent.toUpperCase(),{errors:r,json:a}=await(async({checkoutSessionId:e,intent:o})=>{const{errors:n,json:t}=await m("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:e,intent:o},method:"POST"});return{errors:n,json:t}})({checkoutSessionId:e,intent:t}),i=null===(o=null==a?void 0:a.paypalOrderCreate)||void 0===o?void 0:o.paypalOrderId;if(r.length||!i)throw new Error((null===(n=r.find(Boolean))||void 0===n?void 0:n.message)||"An unexpected error occurred when creating paypal order.");return i})({checkoutSessionId:o});return k=!!r,r}catch(e){return j("Failed to create paypal order",e),_.paypalErrorMessage=h("Failed to create PayPal order. Please try again, or consider using an alternative method."),c.hasPaymentError=!1,c.customErrorMessage=null,D({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:o}}),null==b||b(),""}finally{P&&!k&&(i.locked=!1)}},onApprove:async()=>{try{_.paypalErrorMessage=null,D({event:"zonos-checkout-payment-info",metadata:{checkoutSessionId:o,paymentMethod:"paypal"}});const e=await(async({checkoutSessionId:e,paypalMockResponse:o})=>{var n,t;const{errors:r,json:a}=await(async({checkoutSessionId:e,paypalMockResponse:o})=>{const{errors:n,json:t}=await m("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:e,paypalMockResponse:o},method:"POST"});return{errors:n,json:t}})({checkoutSessionId:e,paypalMockResponse:o}),i=null===(n=null==a?void 0:a.paypalOrderCapture.order)||void 0===n?void 0:n.id;if(r.length||!i)throw new Error((null===(t=r.find(Boolean))||void 0===t?void 0:t.message)||h("An unexpected error occurred when processing PayPal order."));return i})({checkoutSessionId:o,paypalMockResponse:window.Zonos._paypalMockResponse});_.orderIdCreated=e,null==w||w({orderId:e}),n(),t()}catch(e){if(j("==== Failed to capture paypal order",e),e instanceof Error)return(({error:e})=>{var o;const n=P(e.message),t=null===(o=null==n?void 0:n.errors.find(Boolean))||void 0===o?void 0:o.message,r=(null==t?void 0:t.match(/\[(.*?)\] (.*)/i))||[];r||(_.paypalErrorMessage=h("An unexpected error occurred when processing PayPal order."));const a=r[2]||h("An unexpected error occurred when processing PayPal order.");_.paypalErrorMessage=a})({error:e});null==b||b()}},style:{borderRadius:"SHARP"===I?0:10,color:k({backgroundColor1:"#ffc33a",backgroundColor2:O||e.appearance.colorPrimary||""})?"gold":"blue",shape:"rect"}}),q=async({currency:o})=>{var n;if(!(null===(n=e.checkoutSettings.externalPaymentMethods)||void 0===n?void 0:n.find((e=>"PAYPAL"===e.type&&"ENABLED"===e.status))))return void I("=== Paypal is disabled for this store","warn");const t=e.checkoutSettings.externalServiceTokens.find((e=>"PAYPAL_CLIENT_ID"===e.type));if(!t)return void I("Failed to load paypal -- missing paypal publishable key","warn");const r=e.zonosMode&&"production"!==e.zonosMode||"LIVE"!==e.checkoutSettings.mode?"sandbox":"production";_.intent=e.checkoutSettings.captureDelay&&e.checkoutSettings.captureDelay>0?"authorize":"capture",I("==== Paypal order intent","info",_.intent),window.Zonos.paypal=await A({clientId:t.token,currency:o,environment:r,intent:_.intent}),_.paypal=window.Zonos.paypal,I("==== Paypal script loaded")},F=e=>{var o;const n=window.Zonos.paypal;if(!n)return I("Paypal is not available"),null;const t=b.checkoutSessionId;if(!t)return I("Paypal is not available due to checkoutSessionId is not available"),null;I("==== Loading Paypal buttons"),_.paypalButtons.length&&(_.paypalButtons.forEach((async e=>{await e.close()})),_.paypalButtons=[]);const r=[null===(o=n.FUNDING)||void 0===o?void 0:o.PAYPAL].filter(Boolean);return _.paypalButtons=r.map((o=>{var r;let a=null;try{a=(null===(r=n.Buttons)||void 0===r?void 0:r.call(n,Object.assign(Object.assign({},R(Object.assign({checkoutSessionId:t,fundingSource:o},e))),{fundingSource:o})))||null}catch(e){I(`===== Failed to load paypal's "${o}" button`,"warn",e)}return(null==a?void 0:a.isEligible())?(I(`==== Paypal button ${o} loaded`),a):null})).filter(Boolean),_.paypalButtons},N=()=>{var o,n;return"ENABLED"===(null===(n=null===(o=e.checkoutSettings.externalPaymentMethods)||void 0===o?void 0:o.find((e=>"PAYPAL"===e.type)))||void 0===n?void 0:n.status)||!!_.paypalButtons.length};export{_ as a,q as b,M as c,F as d,L as e,N as p,D as s}
|
|
17
|
+
*/function g(e,o){void 0===o&&(o={});var n=document.createElement("script");return n.src=e,Object.keys(o).forEach((function(e){n.setAttribute(e,o[e]),"data-csp-nonce"===e&&n.setAttribute("nonce",o["data-csp-nonce"])})),n}function A(e,o){if(void 0===o&&(o=Promise),B(e,o),"undefined"==typeof document)return o.resolve(null);var n=function(e){var o,n,t=e.sdkBaseUrl,r=e.environment,a=function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)o.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]])}return n}(e,["sdkBaseUrl","environment"]),i=t||function(e){return"sandbox"===e?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"}(r),s=a,c=Object.keys(s).filter((function(e){return null!=s[e]&&""!==s[e]})).reduce((function(e,o){var n=s[o].toString();return"data"===(o=o.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,o){return(o?"-":"")+e.toLowerCase()}))).substring(0,4)||"crossorigin"===o?e.attributes[o]=n:e.queryParams[o]=n,e}),{queryParams:{},attributes:{}}),u=c.queryParams,l=c.attributes;return u["merchant-id"]&&-1!==u["merchant-id"].indexOf(",")&&(l["data-merchant-id"]=u["merchant-id"],u["merchant-id"]="*"),{url:"".concat(i,"?").concat((o=u,n="",Object.keys(o).forEach((function(e){0!==n.length&&(n+="&"),n+=e+"="+o[e]})),n)),attributes:l}}(e),t=n.url,r=n.attributes,a=r["data-namespace"]||"paypal",i=C(a);return r["data-js-sdk-library"]||(r["data-js-sdk-library"]="paypal-js"),function(e,o){var n=document.querySelector('script[src="'.concat(e,'"]'));if(null===n)return null;var t=g(e,o),r=n.cloneNode();if(delete r.dataset.uidAuto,Object.keys(r.dataset).length!==Object.keys(t.dataset).length)return null;var a=!0;return Object.keys(r.dataset).forEach((function(e){r.dataset[e]!==t.dataset[e]&&(a=!1)})),a?n:null}(t,r)&&i?o.resolve(i):function(e,o){void 0===o&&(o=Promise),B(e,o);var n=e.url,t=e.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==t&&"object"!=typeof t)throw new Error("Expected attributes to be an object.");return new o((function(e,o){if("undefined"==typeof document)return e();!function(e){var o=e.onSuccess,n=e.onError,t=g(e.url,e.attributes);t.onerror=n,t.onload=o,document.head.insertBefore(t,document.head.firstElementChild)}({url:n,attributes:t,onSuccess:function(){return e()},onError:function(){var e=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return o(e)}})}))}({url:t,attributes:r},o).then((function(){var e=C(a);if(e)return e;throw new Error("The window.".concat(a," global variable is not available."))}))}function C(e){return window[e]}function B(e,o){if("object"!=typeof e||null===e)throw new Error("Expected an options object.");var n=e.environment;if(n&&"production"!==n&&"sandbox"!==n)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==o&&"function"!=typeof o)throw new Error("Expected PromisePonyfill to be a function.")}"function"==typeof SuppressedError&&SuppressedError;const x={purchase:"Purchase","zonos-checkout-payment-info":"AddPaymentInfo","zonos-checkout-start":"InitiateCheckout"},z=e=>{if(!e)return{};if(!(e=>!!e&&Array.isArray(e.items))(e))return Object.assign({},e);const{currency:o,items:n,transaction_id:t,value:r}=e,a=function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)o.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]])}return n}(e,["currency","items","transaction_id","value"]),i=n.map((e=>({id:e.item_id,item_price:e.price,quantity:e.quantity}))),s=n.map((e=>e.item_id)),c=n.reduce(((e,o)=>e+o.quantity),0),u=Object.assign(Object.assign({},a),{content_ids:s,content_type:"product",contents:i,num_items:c});return t&&(u.order_id=t),void 0!==o&&(u.currency=o),void 0!==r&&(u.value=r),u},M=(e,o,n)=>{E()?O({event:o,fbqMode:e,payload:n,provider:"fbq"}):"function"==typeof window.fbq&&(I("Zonos submits fbq event","log",`${e}:${o}`),window.fbq(e,o,n))},T=o=>{S(o),(({event:o,metadata:n})=>{if(!(()=>{const o=e.checkoutSettings.analyticsProviders.find((e=>"FACEBOOK_PIXEL"===e.type));return!!o&&"ENABLED"===o.status})())return;const t=w(),r=z(n),a=Object.assign(Object.assign({},r),t&&{isTestMode:!0}),i=Object.fromEntries(Object.entries(a).filter((([e,o])=>null!==o)));M("trackCustom",o,i);const s=(e=>{var o;return null!==(o=x[e])&&void 0!==o?o:null})(o);s&&s!==o&&M("track",s,i)})(o)},{onChange:_,reset:L,state:R}=o((()=>({intent:"capture",orderIdCreated:null,paypal:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}))),F=({checkoutSessionId:o,onPaypalFail:b,onPaypalSessionDone:w,overrideBorderRaidus:I,overridePrimaryColor:E})=>({createOrder:async()=>{var e;if(r({checkoutSessionId:o,eventName:"checkout_paymentInfoCompleted",metadata:{paymentMethod:"paypal"}}),a()&&!i.accepted)return i.showError=!0,null===(e=document.querySelector("zonos-policy-consent"))||void 0===e||e.scrollIntoView({behavior:"smooth"}),null==b||b(),"";const P=a();P&&(i.locked=!0);let k=!1;try{const e=await s();if(!e.valid)return R.paypalErrorMessage=e.errorMessage,c.hasPaymentError=!1,c.customErrorMessage=null,T({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:o}}),null==b||b(),"";R.paypalErrorMessage=null,u.inventoryCheckErrorMessage=null;try{u.inventoryCheckErrorMessage=await l()}catch(e){u.inventoryCheckErrorMessage=h("Unable to check inventory. Please try again.")}if(u.inventoryCheckErrorMessage)return"";if(v()>0){const e=await d();if(!e.success)return R.paypalErrorMessage=e.error||h("Unable to apply store credit. Please try again."),null==b||b(),""}if(await p(),f()){const e=await y();return e.success?(null==w||w({orderId:e.orderId||""}),n(),t(),k=!0,""):(R.paypalErrorMessage=e.error||h("Unable to place order with store credit. Please try again."),null==b||b(),"")}const r=await(async({checkoutSessionId:e})=>{var o,n;const t=R.intent.toUpperCase(),{errors:r,json:a}=await(async({checkoutSessionId:e,intent:o})=>{const{errors:n,json:t}=await m("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:e,intent:o},method:"POST"});return{errors:n,json:t}})({checkoutSessionId:e,intent:t}),i=null===(o=null==a?void 0:a.paypalOrderCreate)||void 0===o?void 0:o.paypalOrderId;if(r.length||!i)throw new Error((null===(n=r.find(Boolean))||void 0===n?void 0:n.message)||"An unexpected error occurred when creating paypal order.");return i})({checkoutSessionId:o});return k=!!r,r}catch(e){return j("Failed to create paypal order",e),R.paypalErrorMessage=h("Failed to create PayPal order. Please try again, or consider using an alternative method."),c.hasPaymentError=!1,c.customErrorMessage=null,T({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:o}}),null==b||b(),""}finally{P&&!k&&(i.locked=!1)}},onApprove:async()=>{try{R.paypalErrorMessage=null,T({event:"zonos-checkout-payment-info",metadata:{checkoutSessionId:o,paymentMethod:"paypal"}});const e=await(async({checkoutSessionId:e,paypalMockResponse:o})=>{var n,t;const{errors:r,json:a}=await(async({checkoutSessionId:e,paypalMockResponse:o})=>{const{errors:n,json:t}=await m("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:e,paypalMockResponse:o},method:"POST"});return{errors:n,json:t}})({checkoutSessionId:e,paypalMockResponse:o}),i=null===(n=null==a?void 0:a.paypalOrderCapture.order)||void 0===n?void 0:n.id;if(r.length||!i)throw new Error((null===(t=r.find(Boolean))||void 0===t?void 0:t.message)||h("An unexpected error occurred when processing PayPal order."));return i})({checkoutSessionId:o,paypalMockResponse:window.Zonos._paypalMockResponse});R.orderIdCreated=e,null==w||w({orderId:e}),n(),t()}catch(e){if(j("==== Failed to capture paypal order",e),e instanceof Error)return(({error:e})=>{var o;const n=P(e.message),t=null===(o=null==n?void 0:n.errors.find(Boolean))||void 0===o?void 0:o.message,r=(null==t?void 0:t.match(/\[(.*?)\] (.*)/i))||[];r||(R.paypalErrorMessage=h("An unexpected error occurred when processing PayPal order."));const a=r[2]||h("An unexpected error occurred when processing PayPal order.");R.paypalErrorMessage=a})({error:e});null==b||b()}},style:{borderRadius:"SHARP"===I?0:10,color:k({backgroundColor1:"#ffc33a",backgroundColor2:E||e.appearance.colorPrimary||""})?"gold":"blue",shape:"rect"}}),q=async({currency:o})=>{var n;if(!(null===(n=e.checkoutSettings.externalPaymentMethods)||void 0===n?void 0:n.find((e=>"PAYPAL"===e.type&&"ENABLED"===e.status))))return void I("=== Paypal is disabled for this store","warn");const t=e.checkoutSettings.externalServiceTokens.find((e=>"PAYPAL_CLIENT_ID"===e.type));if(!t)return void I("Failed to load paypal -- missing paypal publishable key","warn");const r=e.zonosMode&&"production"!==e.zonosMode||"LIVE"!==e.checkoutSettings.mode?"sandbox":"production";R.intent=e.checkoutSettings.captureDelay&&e.checkoutSettings.captureDelay>0?"authorize":"capture",I("==== Paypal order intent","info",R.intent),window.Zonos.paypal=await A({clientId:t.token,currency:o,environment:r,intent:R.intent}),R.paypal=window.Zonos.paypal,I("==== Paypal script loaded")},D=e=>{var o;const n=window.Zonos.paypal;if(!n)return I("Paypal is not available"),null;const t=b.checkoutSessionId;if(!t)return I("Paypal is not available due to checkoutSessionId is not available"),null;I("==== Loading Paypal buttons"),R.paypalButtons.length&&(R.paypalButtons.forEach((async e=>{await e.close()})),R.paypalButtons=[]);const r=[null===(o=n.FUNDING)||void 0===o?void 0:o.PAYPAL].filter(Boolean);return R.paypalButtons=r.map((o=>{var r;let a=null;try{a=(null===(r=n.Buttons)||void 0===r?void 0:r.call(n,Object.assign(Object.assign({},F(Object.assign({checkoutSessionId:t,fundingSource:o},e))),{fundingSource:o})))||null}catch(e){I(`===== Failed to load paypal's "${o}" button`,"warn",e)}return(null==a?void 0:a.isEligible())?(I(`==== Paypal button ${o} loaded`),a):null})).filter(Boolean),R.paypalButtons},N=()=>{var o,n;return"ENABLED"===(null===(n=null===(o=e.checkoutSettings.externalPaymentMethods)||void 0===o?void 0:o.find((e=>"PAYPAL"===e.type)))||void 0===n?void 0:n.status)||!!R.paypalButtons.length};export{R as a,q as b,L as c,D as d,_ as e,N as p,T as s}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
System.register(["./p-
|
|
1
|
+
System.register(["./p-BUfCTQXY.system.js"],(function(e){"use strict";var t;return{setters:[function(e){t=e.U}],execute:function(){
|
|
2
2
|
/**
|
|
3
3
|
* Minimum number of characters we treat as a valid postal code. Mirrors the
|
|
4
4
|
* landed-cost readiness check in `stripe.ts` (`isAddressReadyToRequestLandedCost`).
|
|
@@ -15,7 +15,7 @@ var i=e("M",3);
|
|
|
15
15
|
*
|
|
16
16
|
* Pure: the caller resolves `countryField` (via `getCountryField`) and passes it in, so
|
|
17
17
|
* this can be unit-tested without the stores.
|
|
18
|
-
*/var
|
|
18
|
+
*/var n=e("g",(function(e){var n=e.countryField,r=e.event;var v,a,o;if(!r){return[]}var u=r.value;var l=[];
|
|
19
19
|
// Last name is always required for international shipping. Link's single name input
|
|
20
20
|
// often provides only a first name, leaving the extracted last name empty.
|
|
21
|
-
var s=t({firstName:u.firstName,lastName:u.lastName,name:u.name}).lastName;if(!s.trim()){l.push({key:"lastName"})}if((
|
|
21
|
+
var s=t({firstName:u.firstName,lastName:u.lastName,name:u.name}).lastName;if(!s.trim()){l.push({key:"lastName"})}if((n===null||n===void 0?void 0:n.stateRequired)&&!((v=u.address.state)===null||v===void 0?void 0:v.trim())){l.push({key:"state"})}if((n===null||n===void 0?void 0:n.zipRequired)&&((o=(a=u.address.postal_code)===null||a===void 0?void 0:a.trim().length)!==null&&o!==void 0?o:0)<i){l.push({key:"postal_code"})}return l}))}}}));
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
System.register(["./p-CIevpRv_.system.js","./p-
|
|
1
|
+
System.register(["./p-CIevpRv_.system.js","./p-D-Lnf8mS.system.js","./p-DTgUqgwV.system.js","./p-D0DkOoAw.system.js","./p-BbgqQIHv.system.js"],(function(e){"use strict";var o,t,n,s,a,l,i,c;return{setters:[function(e){o=e.r;t=e.h;n=e.a},function(e){s=e.D;a=e.t;l=e.A;i=e.l},function(e){c=e.a},null,null],execute:function(){var r='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.99996 2.6665C5.05444 2.6665 2.66663 5.05432 2.66663 7.99984C2.66663 10.9454 5.05444 13.3332 7.99996 13.3332C10.9455 13.3332 13.3333 10.9454 13.3333 7.99984C13.3333 5.05432 10.9455 2.6665 7.99996 2.6665Z" fill="#AFF8C3"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.1403 6.10535C10.3582 6.27488 10.3975 6.58902 10.228 6.80699L8.01055 9.65797C7.76436 9.97449 7.29646 10.0036 7.01291 9.72008L5.81307 8.52024C5.61781 8.32498 5.61781 8.0084 5.81307 7.81314C6.00833 7.61787 6.32492 7.61787 6.52018 7.81314L7.45301 8.74597L9.43862 6.19305C9.60815 5.97508 9.92229 5.93581 10.1403 6.10535Z" fill="#246627"/>\n</svg>\n';var d=function(){return":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--language-select{width:100%}:host .zonos--language-select .zonos--language-select-content{display:grid;grid-template-columns:repeat(3, minmax(-webkit-max-content, 1fr));grid-template-columns:repeat(3, minmax(max-content, 1fr));padding:16px;padding-top:0px}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button{display:-ms-flexbox;display:flex;padding:8px;gap:4px;-ms-flex-align:center;align-items:center;border-radius:var(--zonos-elements-radius-4);cursor:pointer;width:100%;border:none;background:none}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button:hover{background:var(--zonos-elements-gray-100)}@media (max-width: 400px){:host .zonos--language-select .zonos--language-select-content{grid-template-columns:1fr 1fr}}"};var f=e("zonos_language_select",/** @class */function(){function e(e){var t=this;o(this,e);
|
|
2
2
|
/**
|
|
3
3
|
* Function to close the language select
|
|
4
4
|
* @default () => {}
|
|
5
5
|
*/this.handleOnClose=function(){};this.languageSelected=function(e){
|
|
6
6
|
// mutate the selected language code in store
|
|
7
|
-
void s(e);t.handleOnClose()}}e.prototype.render=function(){var e=this;var o=i.selectedLocale;return t(n,{key:"b557082e699209af33ab25715d5cb23fb8a20f56",class:"zonos--elements",style:{"--zonos--font-family":
|
|
7
|
+
void s(e);t.handleOnClose()}}e.prototype.render=function(){var e=this;var o=i.selectedLocale;return t(n,{key:"b557082e699209af33ab25715d5cb23fb8a20f56",class:"zonos--elements",style:{"--zonos--font-family":c()}},t("div",{key:"f5fa8a8163aa46589d67df8d7b69a9b60c7c3994",class:"zonos--language-select"},t("zonos-select-dialog-header",{key:"7ffc14b7fab4014352361424de6ea6e2fc8d7f6c",handleOnClose:function(){return e.handleOnClose()},label:a("Select a language")}),t("div",{key:"ab06dd27d199ef7223ce4421ab4d4e7a5816e402",class:"zonos--language-select-content"},l().map((function(n){return t("button",{class:"zonos--language-select-button",onClick:function(){return e.languageSelected(n.code)}},t("zonos-text",{textColor:"gray-800"},n.translatedLabel),n.code===o&&t("zonos-icon",{content:r,size:16}))})))))};return e}());f.style=d();var h='<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var g=function(){return":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--select-dialog-header-wrapper{position:-webkit-sticky;position:sticky;top:0;background:var(--zonos-elements-surface-color);padding:16px}:host .zonos--select-dialog-header-wrapper .zonos--select-dialog-header{position:relative;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}"};var u=e("zonos_select_dialog_header",/** @class */function(){function e(e){o(this,e);
|
|
8
8
|
/**
|
|
9
9
|
* Callback to do something on close
|
|
10
10
|
* @default () => {}
|
|
11
11
|
*/this.handleOnClose=function(){};
|
|
12
12
|
/**
|
|
13
13
|
* The label for the select dialog
|
|
14
|
-
*/this.label=""}e.prototype.render=function(){var e=this;return t(n,{key:"2c3fe65b8226875d1e543d87d622a2356c975bae",class:"zonos--elements",style:{"--zonos--font-family":
|
|
14
|
+
*/this.label=""}e.prototype.render=function(){var e=this;return t(n,{key:"2c3fe65b8226875d1e543d87d622a2356c975bae",class:"zonos--elements",style:{"--zonos--font-family":c()}},t("zonos-v-stack",{key:"7e065cce508376405350d8cf0b90437c5bbbd6e9",class:"zonos--select-dialog-header-wrapper",spacing:8},t("div",{key:"363ff8e4b18b50497b904af45bcf62ae374f90de",class:"zonos--select-dialog-header"},t("zonos-text",{key:"5b3833d7186579859d067c205ab3cb70bf01ed99",type:"boldLabel"},this.label),t("zonos-button",{key:"7dd27337e33c3d97544696a8d850204296474f5e",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close select dialog",content:h,size:20}),noBackground:true,onClick:function(){return e.handleOnClose()}})),t("slot",{key:"a5f6b16ecc6a1fb8c24bd783f0384d3506656f01"})))};return e}());u.style=g()}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as r}from"./p-
|
|
1
|
+
import{d as r}from"./p-BJ_kE5rM.js";import{s as o}from"./p-CVRbGFV3.js";import{l as s,h as e}from"./p-gEViRqvf.js";const i=async()=>{var i,t;const n=null===(i=r.partiesData.find((r=>"DESTINATION"===r.type)))||void 0===i?void 0:i.id,a=null===(t=r.partiesData.find((r=>"PAYOR"===r.type)))||void 0===t?void 0:t.id,d=o.checkoutSessionId;if(!d||!a||!n)return s("Missing required data",{billToPartyId:a,checkoutSessionId:d,shipToPartyId:n}),{errors:["Missing required data"],json:null};const l={billToPartyId:a,checkoutSessionId:d,shipToPartyId:n},{errors:p,json:c}=await e("/api/zonos-elements/place-test-order",{body:l,method:"POST"});return p.length||!c?(s("Error occurs when placing test order",p),{errors:p.map((r=>r.message)),json:null}):{errors:[],json:c}};export{i as p}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,h as e,F as t,a as s}from"./p-_lt63o7c.js";import{s as n,a as i,b as c,i as r,c as a,g as d,d as l,e as u,f as h,p as m,h as p,j as g,k as f,l as w,m as v,n as z,o as k,t as y,q as C,r as b,u as S,v as x,w as I,x as T,y as A,z as O,A as B,B as _,C as L,D as P,E,F as D,G as U,H as j,I as N,J as R,K as $}from"./p-BJ_kE5rM.js";import{p as F,s as M,a as H,b as K}from"./p-DrbN3rPL.js";import{f as Z,a as V,b as G,i as W,l as Q,c as Y,d as J,g as q,s as X,V as oo,e as eo,t as to,h as so,j as no}from"./p-CVRbGFV3.js";import{z as io,g as co,m as ro}from"./p-CqB9AfBf.js";import{b as ao}from"./p-BycjkdlE.js";import{h as lo,g as uo,j as ho,l as mo,d as po,c as go,b as fo,s as wo,a as vo,i as zo}from"./p-gEViRqvf.js";import{u as ko}from"./p-BJFa5RwX.js";import{l as yo,g as Co,b as bo}from"./p-BJmZPrZl.js";import{_ as So,c as xo,d as Io,a as To,g as Ao}from"./p-D5SpFsQJ.js";import{c as Oo}from"./p-BJHSB96f.js";import{c as Bo}from"./p-XQfWgQLB.js";import{g as _o}from"./p-r-YGHhLa.js";import{i as Lo}from"./p-YdrG78th.js";import{s as Po}from"./p-BTIeCf3T.js";import{R as Eo}from"./p-C2QMVeWW.js";import"./p-Dwg61Ft_.js";import"./p-DMIgN_sT.js";import"./p-CICjAi70.js";import"./p-CJmWr75U.js";import"./p-DW7I0zOF.js";import"./p-n5PZKz1k.js";const Do="isInternationalCheckout",Uo=({action:o}={})=>{const e=new URL("/login.php",window.location.origin);o&&e.searchParams.set("action",o);const t=new URLSearchParams(window.location.search),s=t.get("zonosQaUrl");s&&e.searchParams.set("zonosQaUrl",s);const n=t.get("zonosQaUrlApi");return n&&e.searchParams.set("zonosQaUrlApi",n),uo()&&e.searchParams.set("zonosTestMode","1"),e.searchParams.set("from",(()=>{const o=new URLSearchParams;o.set(Do,"true");const e=new URLSearchParams(window.location.search),t=e.get("zonosQaUrl");t&&o.set("zonosQaUrl",t);const s=e.get("zonosQaUrlApi");return s&&o.set("zonosQaUrlApi",s),uo()&&o.set("zonosTestMode","1"),`cart.php?${o.toString()}`})()),e.toString()},jo=o=>{const e=new URL(o,window.location.origin),t=new URLSearchParams(window.location.search),s=t.get("zonosQaUrl");return s&&e.searchParams.set("zonosQaUrl",s),"1"===t.get("zonosDebug")&&e.searchParams.set("zonosDebug","1"),uo()&&e.searchParams.set("zonosTestMode","1"),e.toString()},No={customerGroupId:null,shouldBypass:!1};let Ro=null;const $o=o=>{const e=(async o=>{var e,t,s,n;if(!window.Zonos.isBigCommerce)return{conclusive:!0,result:No};const i=null===(e=io.genericSettings)||void 0===e?void 0:e.bigcommerceBypassCustomerGroupIds;if(!(null==i?void 0:i.length))return io.loadedConfig?{conclusive:!0,result:No}:{conclusive:!1,result:No};const c=o?o.checkoutId:await V();if(!c)return yo("BigCommerce bypass check: no active cart yet, will retry on next call","info"),{conclusive:!1,result:No};const r=o?o.checkout:await G(c);if(!r)return yo("BigCommerce bypass check: failed to fetch checkout data, will retry","info"),{conclusive:!1,result:No};const a=null!==(n=null===(s=null===(t=r.customer)||void 0===t?void 0:t.customerGroup)||void 0===s?void 0:s.id)&&void 0!==n?n:null;if(null===a)return yo("BigCommerce bypass check: no customer group found (guest user)","info"),{conclusive:!0,result:No};const d=i.includes(a),l={customerGroupId:a,shouldBypass:d};return yo(d?`BigCommerce bypass check: customer group ${String(a)} is in bypass list; caller should keep the user on BC native checkout`:`BigCommerce bypass check: customer group ${String(a)} is not in bypass list`,"info"),{conclusive:!0,result:l}})(o),t=e.then((({conclusive:o,result:e})=>(o||Ro!==t||(Ro=null),e)));return Ro=t,t},Fo=async(o={})=>o.forceRefresh||!Ro?$o(o.preFetched):Ro,Mo={guestCheckoutType:null},Ho="zonos--bc-checkout-settings",Ko={redirectUrl:null,shouldForceLogin:!1};let Zo=null;const Vo=()=>{if(!Zo){const o=(async()=>{var o;if(!window.Zonos.isBigCommerce)return Mo;const e=null===(o=io.checkoutSettings.bigCommerceConfig)||void 0===o?void 0:o.storeHash;if(!e)return yo("BigCommerce checkout settings: no storeHash provided — skipping fetch","info"),Mo;const t=(o=>{try{const e=window.localStorage.getItem(Ho);if(!e)return null;const t=ho(e);return t?t.storeHash!==o||t.expiresAt<Date.now()?null:{guestCheckoutType:t.guestCheckoutType}:null}catch(o){return null}})(e);if(t)return t;const{errors:s,json:n}=await lo("/api/bigcommerce/checkout-settings",{body:{storeHash:e},method:"POST"});if(s.length||!n)return yo("BigCommerce checkout settings: proxy call failed, falling back to guest-allowed behavior","info"),Mo;const i={guestCheckoutType:n.guestCheckoutType};return((o,e)=>{try{const t={expiresAt:Date.now()+36e5,guestCheckoutType:e.guestCheckoutType,storeHash:o};window.localStorage.setItem(Ho,JSON.stringify(t))}catch(o){}})(e,i),i})().then((({guestCheckoutType:e})=>e?"no_guest_checkout"===e:(Zo===o&&(Zo=null),!1))).catch((()=>(Zo===o&&(Zo=null),!1)));Zo=o}return Zo},Go=async({preFetched:o}={})=>{if(!window.Zonos.isBigCommerce)return Ko;if(!await Vo())return Ko;const e=o?o.checkoutId:await V();if(!e)return Ko;const t=o?o.checkout:await G(e);return t?W(t)?Ko:(yo("BigCommerce force-login check: guest shopper on no-guest-checkout store, redirecting to /login.php","info"),{redirectUrl:Uo(),shouldForceLogin:!0}):(yo("BigCommerce force-login check: failed to fetch checkout data, allowing flow to continue","info"),Ko)},Wo="data-zonos-login-from-rewritten",Qo='a[href*="login.php?action=create_account"]:not(['+Wo+"])",Yo=()=>{const o=document.querySelectorAll(Qo);if(!o.length)return;const e=Uo({action:"create_account"});o.forEach((o=>{o.setAttribute("href",e),o.setAttribute(Wo,"true")}))},Jo=(o,e)=>{if(!o.address1||!o.countryCode)return null;const t=[o.firstName,o.lastName].filter(Boolean).join(" ").trim();return{address:{city:o.city||"",country:o.countryCode,line1:o.address1,line2:o.address2||"",postal_code:o.postalCode||"",state:o.stateOrProvinceCode||o.stateOrProvince||""},email:e,name:t,phone:o.phone||""}},qo=o=>[o.address.line1,o.address.line2||"",o.address.postal_code,o.address.country].join("|").toLowerCase(),Xo=(o=!0,e)=>{if(!Q.localizationLoaded)return!1;if(e){const t=Y(e);return o&&!t&&yo(`Checkout: ${e} is not a shippable country: ${t}`),t}return!!Q.isShippableCountry||(o&&yo("Checkout: not shippable country"),!1)},oe=["1","true","yes"];let ee=null;const te=()=>{var o;return!(!(null===(o=window.Zonos)||void 0===o?void 0:o.isBigCommerce)||!window.location.pathname.includes("/checkout"))&&(()=>{const{pathname:o,search:e}=window.location;if(ee&&ee.pathname===o&&ee.search===e)return ee.enabled;const t=new URLSearchParams(e);var s;if(null===(s=t.get("zBypass"))||!oe.includes(s.trim().toLowerCase()))return ee={enabled:!1,pathname:o,search:e},!1;t.delete("zBypass");const n=t.toString(),i=window.location.hash||"";window.history.replaceState(window.history.state,document.title,`${o}${n?`?${n}`:""}${i}`);const c=!0===(null===(a=null===(r=io.checkoutSettings.plugins)||void 0===r?void 0:r.bigcommerce)||void 0===a?void 0:a.allowBypassQuery);var r,a;return ee={enabled:c,pathname:o,search:window.location.search},c})()},se='select[name="shippingAddress.countryCode"]',ne=({domesticRedirectedBtnSelector:o,onInternationalCheckoutSelected:e,onLoggedInInternationalAddressDetected:t,onShippingAddressSessionFound:s})=>{if(!window.Zonos.isBigCommerce)return;if(window.location.pathname.includes("/checkout")&&te())return;const c=async o=>{var t;const s=document.querySelector((null===(t=io.genericSettings)||void 0===t?void 0:t.bigcommerceDomesticCheckoutCountrySelector)||se),n=(null==s?void 0:s.value)||o;if(!n)return"noAction";if(!Xo(!1,n))return"noAction";const c=await V(),r={checkout:c?await G(c):null,checkoutId:c},{shouldBypass:a}=await Fo({forceRefresh:!0,preFetched:r});if(a)return yo("Bypass customer group detected on BC checkout, stopping interval","info"),"bypass";const d=await Go({preFetched:r});if(d.shouldForceLogin&&d.redirectUrl)return window.location.href=d.redirectUrl,"redirected";e&&await e(),J({isInitializing:!1,newSelectedCountryCode:n,persistOverride:!1});const l={address1:"",address2:"",city:"",countryCode:n,firstName:"",lastName:"",phone:"",postalCode:"",stateOrProvince:""};return i({address1:l.address1,address2:l.address2,city:l.city,countryCode:l.countryCode,firstName:l.firstName,lastName:l.lastName,phone:l.phone,postalCode:l.postalCode,state:l.stateOrProvince}),window.location.href=jo("/"),"redirected"};let r=!1,a=!1;let d=!1,l=!1,u=!1,h=!1,m=!1;const p=new MutationObserver((async()=>{var g;const f=document.querySelector(o),w=n();if(!f&&w){const o=document.createElement("button");return o.style.display="none",o.id="zonos--domestic-redirected-checkout-button",document.body.appendChild(o),null==s||s(w),void p.disconnect()}if(!window.location.pathname.includes("/checkout")||!window.Zonos.isBigCommerce)return void p.disconnect();if(!h&&!u){u=!0,m=!0;try{const o=await(async({onInternationalCheckoutSelected:o,onLoggedInInternationalAddressDetected:e})=>{var t,s,n,c,r,a,d,l,u,h;const m=await V();if(!m)return"noAction";const p=await G(m),g={checkout:p,checkoutId:m},{shouldBypass:f}=await Fo({preFetched:g});if(f)return"noAction";const w=null===(s=null===(t=null==p?void 0:p.consignments)||void 0===t?void 0:t[0])||void 0===s?void 0:s.shippingAddress;if(!(null==w?void 0:w.countryCode))return"noAction";const v=w.countryCode;if(!Xo(!1,v))return"noAction";if(yo(e?`Logged-in user has international shipping address: ${v}, prompting user to choose checkout`:`Logged-in user has international shipping address: ${v}, redirecting automatically (legacy behavior)`,"info"),e&&"stay"===await e())return yo("User opted to stay on BigCommerce native checkout despite international default address","info"),"optedOut";const z=await Go({preFetched:g});return z.shouldForceLogin&&z.redirectUrl?(window.location.href=z.redirectUrl,"redirected"):(o&&await o(),J({isInitializing:!1,newSelectedCountryCode:v,persistOverride:!1}),i({address1:null!==(n=w.address1)&&void 0!==n?n:"",address2:null!==(c=w.address2)&&void 0!==c?c:"",city:null!==(r=w.city)&&void 0!==r?r:"",countryCode:v,firstName:null!==(a=w.firstName)&&void 0!==a?a:"",lastName:null!==(d=w.lastName)&&void 0!==d?d:"",phone:null!==(l=w.phone)&&void 0!==l?l:"",postalCode:null!==(u=w.postalCode)&&void 0!==u?u:"",state:null!==(h=w.stateOrProvince)&&void 0!==h?h:""}),window.location.href=jo("/"),"redirected")})({onInternationalCheckoutSelected:e,onLoggedInInternationalAddressDetected:t});if("redirected"===o)return void p.disconnect();"optedOut"===o&&(h=!0,(o=>{a||(a=!0,document.addEventListener("click",(e=>{if(r)return;const{target:t}=e;if(!(t instanceof Element))return;const s=t.closest("#checkout-shipping-continue, #checkout-billing-continue, #checkout-payment-continue");s&&(e.preventDefault(),e.stopImmediatePropagation(),(async(o,e)=>{let t=!0;try{let o=null;try{o=await(async()=>{var o,e,t,s;const n=await V();if(n){const s=await G(n),i=null===(t=null===(e=null===(o=null==s?void 0:s.consignments)||void 0===o?void 0:o[0])||void 0===e?void 0:e.shippingAddress)||void 0===t?void 0:t.countryCode;if(i)return i}const i=document.querySelector((null===(s=io.genericSettings)||void 0===s?void 0:s.bigcommerceDomesticCheckoutCountrySelector)||se);return(null==i?void 0:i.value)||null})()}catch(o){mo("Error resolving selected shipping country on BC continue",o)}o&&Xo(!1,o)&&e.disconnect(),"redirected"===(o?await c(o):"noAction")&&(t=!1)}catch(o){mo("Error handling BC continue international redirect",o)}t&&(r=!0,o.click(),r=!1)})(s,o))}),!0))})(p))}catch(o){mo("Error checking logged-in user shipping address",o)}finally{u=!1,m=!1}}const v=document.querySelector((null===(g=io.genericSettings)||void 0===g?void 0:g.bigcommerceDomesticCheckoutCountrySelector)||se);if(!v)return;if(yo("Domestic checkout found - Listening for shipping country change","info",{value:v.value}),l)return;l=!0,p.disconnect();const z=setInterval((async()=>{if(!d&&!m){d=!0;try{const o=await c();if("redirected"===o||"bypass"===o)return void clearInterval(z);d=!1}catch(o){d=!1}}}),1e3),k=setInterval((()=>{var o;if(!window.bcStripeElements)return void clearInterval(k);const e=null===(o=window.bcStripeElements)||void 0===o?void 0:o.getElement("address");e&&(clearInterval(k),e.on("change",(o=>{const e=o.value.address.country;e&&!m&&c(e)})))}),500)}));p.observe(document.body,{childList:!0,subtree:!0})};let ie=0;const ce=o=>{var e;const t=null===(e=X.enabledVariantTestKeys)||void 0===e?void 0:e.find((e=>e.testKey===o));return(null==t?void 0:t.selectedVariantKey)||null},re=async({cartId:o,retries:e})=>{const t=uo(),{errors:s,json:n}=await lo("/api/zonos-elements/get-temp-cart",{body:{isTestMode:t,options:{noOnlineStoreSettings:!0},tempCartUUID:o},headers:{"Content-Type":"application/json"},method:"POST"}),i=!n||s.length;return i&&e?(yo("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:e}),await new Promise((o=>setTimeout(o,500))),re({cartId:o,retries:e-1})):i?null:n};var ae='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';const de=class{constructor(e){o(this,e),this.storeUnsubscribeList=[],this.isRedirectAfterOrder=!1,this.preview=!1,this.hiddenMode=!1,this.mobile=!1,this.defaultAddress=[],this.forceDialogOpen=!1,this.defaultAddressParams=[],this.defaultCustomerProfileAddress=[],this.customerProfile=null,this.open=this.forceDialogOpen,this.isOverlayLoading=!1,this.stripe=window.Zonos.stripe,this.submitLoading=!1,this.collapseReviewMobile=!0,this.isAttachError=!1,this.isMobile=!1,this.isIframed=!1,this.isLegacyCheckout=window.Zonos.isLegacyCheckout,this.confirmDialogOpen=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.placedOrderInfo=null,this.shouldShowFedexShippingConsentDialog=!1,this.detectedDomesticCheckoutDialogOpen=!1,this.redirectToDomesticCheckoutDialogOpen=!1,this.loggedInIntlAddressConfirmDialogOpen=!1,this.loggedInIntlAddressResolver=null,this.clientSecret=c.clientSecret,this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret,this.applyStripeTheme=async()=>{var o,e,t,s;const n=(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)||io.appearance.theme;await r({overrideBorderRadius:null===(e=this.appearanceSettingsOverride)||void 0===e?void 0:e.style,overridePrimaryColor:null===(t=this.appearanceSettingsOverride)||void 0===t?void 0:t.colorPrimary,overrideSecondaryColor:null===(s=this.appearanceSettingsOverride)||void 0===s?void 0:s.colorSecondary,overrideTheme:this.isMobile?n:void 0,paypalEnabled:F()})},this.checkStripePaymentIntentStatus=async({triggeredButton:o})=>{const e=null==o?void 0:o.matches(`#${xo}`),t=!!window.Zonos.cartData,s=new URL(window.location.href).searchParams,n=s.get("payment_intent_client_secret"),i=s.get("zonosCheckoutSessionId");if(!e)return yo("Checkout is triggered by user, no need to check stripe payment intent status"),{shouldAllowOrder:!0};if(yo("Payment intent exist, checking stripe payment intent status"),!n)return yo("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:t};const{error:r,status:d}=await a({clientSecret:n});return new URLSearchParams(window.location.search).get("redirect_status")?(yo(r?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen"),this.open=!0,X.checkoutSessionId=i,c.clientSecret=n,this.setToFinishStep(d),{shouldAllowOrder:!1}):t?(yo("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(yo("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})},this.recoverCompletedOrderModificationSession=async o=>{X.checkoutSessionId=o;const{errors:e,json:t}=await d();if(e.length||!t)return!1;const{checkoutSession:s}=t;if(s.completedAt&&s.order)return this.setToFinishStep("succeeded"),!0;if(s.clientSecret){const{status:o}=await a({clientSecret:s.clientSecret});if("processing"===o||"succeeded"===o)return c.clientSecret=s.clientSecret,this.setToFinishStep(o),!0}return!1},this.initializeTestKeys=()=>{var o;X.enabledVariantTestKeys=(null==(o=X.enabledVariantTestKeys||[])?void 0:o.filter((o=>!(o.expiresAt&&o.expiresAt<Date.now()||!o.expiresAt))))||[];const e=io.enabledVariantTestKeys.map((o=>{var e;const t=null===(e=X.enabledVariantTestKeys)||void 0===e?void 0:e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+oo,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}}));return eo(e),{allSelected:!1}},this.shouldAllowHostedVsNativeTest=()=>{var o;return(({createCartId:o,enabledTestKeys:e,isBigCommerce:t})=>!t&&"function"==typeof o&&e.includes("hosted_vs_native"))({createCartId:io.checkoutSettings.createCartId,enabledTestKeys:io.enabledVariantTestKeys,isBigCommerce:Boolean(null===(o=window.Zonos)||void 0===o?void 0:o.isBigCommerce)})},this.registerTestHostedVsNative=async()=>{if(!this.shouldAllowHostedVsNativeTest())return;yo("[TEST] - Registering hosted vs native test");const o=ce("hosted_vs_native");if(o)return void yo(`[TEST] - Hosted vs native test already has variant selected: ${o}`);const e=await(async({testKeys:o})=>{if(0===o.length)return null;const{errors:e,json:t}=await lo("/api/zonos-elements/select-variance-test",{body:{testKeys:o},method:"POST"});return e.length||!t?null:Z(t)})({testKeys:["hosted_vs_native"]});if(!e)return void yo("[TEST] - Failed to get selection for hosted vs native test");const t=(({baseTestObj:o,mergeTestObj:e})=>o.map((({testKey:o})=>{const t=e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+oo,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}})))({baseTestObj:X.enabledVariantTestKeys||[],mergeTestObj:e});eo(t)},this.handleHostedVsNative=async()=>{var o;if(!this.shouldAllowHostedVsNativeTest())return{redirected:!1};const e=ce("hosted_vs_native");if(yo(`[TEST] - hosted_vs_native: ${e}`),"function"!=typeof io.checkoutSettings.createCartId)return yo("[TEST] - createCartId is not provided, skipping hosted vs native test"),{redirected:!1};if("hosted"!==e)return yo("[TEST] - Hosted vs native test is enabled for native, skipping"),{redirected:!1};if(!(null===(o=io.genericSettings)||void 0===o?void 0:o.hostedCheckoutUrl))return yo("[TEST] - Hosted checkout URL is not provided"),{redirected:!1};yo('"createCartId" is provided, start building cart');const t=await io.checkoutSettings.createCartId();let s,n=null;"object"==typeof t?(s=t.cartId,n=t.shippingData||null):s=t;const i=(()=>{const o=new URLSearchParams(window.location.search);yo("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:""},t=q(o)||Q.selectedCountryCode||"US",s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerPhone"),d=e("customerZip"),l=e("customerState");return{customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:e("customerFirstName"),customerLastName:e("customerLastName"),customerName:r,customerPhone:a,customerState:l,customerZip:d}})(),c=(({cartId:o,checkoutSessionId:e,customerAddress1:t,customerAddress2:s,customerCity:n,customerCountry:i,customerEmail:c,customerFirstName:r,customerLastName:a,customerPhone:d,customerState:l,customerZip:u,hostedCheckoutUrl:h,isTestMode:m,isVariantTest:p})=>{const g=new URLSearchParams;return g.set("tempCartUUID",o),r&&g.set("customerFirstName",r),a&&g.set("customerLastName",a),c&&g.set("customerEmail",c),d&&g.set("customerPhone",d),u&&g.set("customerZip",u),n&&g.set("customerCity",n),l&&g.set("customerState",l),i&&g.set("zCountry",i),t&&g.set("customerAddress1",t),s&&g.set("customerAddress2",s),m&&g.set("zonosTestMode","1"),e&&g.set("zonosCheckoutSessionId",e),p&&g.set("zonosVariantTest","1"),`${h}?${g.toString()}`})(Object.assign(Object.assign({cartId:s,checkoutSessionId:X.checkoutSessionId||void 0,hostedCheckoutUrl:io.genericSettings.hostedCheckoutUrl,isTestMode:uo(),isVariantTest:!0},i),n));return yo(`[TEST] - Redirecting to: ${c}`),window.open(c,"_blank"),{redirected:!0}},this.formatDate=o=>o?new Date(o).toLocaleDateString():"",this.formatTime=o=>o?new Date(o).toLocaleTimeString():"",this.getCurrentLocalePageEnum=()=>{switch(l.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}},this.getBaseCurrencySettlementInfo=()=>{const o=l.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:e}}=o;return e?{settlementAmount:(e.discounts||0)+e.items+e.landedCostTotal+e.shipping}:null},this.prefillBigCommerceCustomerAddresses=async()=>{if(!window.Zonos.isBigCommerce)return;if(this.defaultCustomerProfileAddress.length)return;if(Array.isArray(this.defaultAddress)&&this.defaultAddress.length>0||!Array.isArray(this.defaultAddress)&&"object"==typeof this.defaultAddress&&null!==this.defaultAddress)return;const o=await V();if(!o)return;const e=await G(o);if(!W(e))return;const t=((o,e)=>{var t,s,n,i;if(!(null===(t=null==o?void 0:o.customer)||void 0===t?void 0:t.id))return[];const{isShippable:c,selectedCountryCode:r}=e,a=o.customer.email||"",d=null!==(n=null===(s=o.consignments)||void 0===s?void 0:s.flatMap((o=>o.shippingAddress?[o.shippingAddress]:[])))&&void 0!==n?n:[],l=null!==(i=o.customer.addresses)&&void 0!==i?i:[],u=new Set,h=[];for(const o of[...l,...d]){const e=Jo(o,a);if(!e)continue;if(!c(e.address.country))continue;const t=qo(e);u.has(t)||(u.add(t),h.push(e))}return r?h.map(((o,e)=>({index:e,option:o}))).sort(((o,e)=>{const t=o.option.address.country===r;return t===(e.option.address.country===r)?o.index-e.index:t?-1:1})).map((o=>o.option)):h})(e,{isShippable:o=>Xo(!1,o),selectedCountryCode:Q.selectedCountryCode||void 0});t.length&&(this.defaultCustomerProfileAddress.length||(this.defaultCustomerProfileAddress=t,yo(`Prefilled ${String(t.length)} BigCommerce customer address(es) for logged-in shopper`,"info")))},this.getDefaultAddress=()=>this.defaultCustomerProfileAddress.length?this.defaultCustomerProfileAddress:Array.isArray(this.defaultAddress)&&this.defaultAddress.length?this.defaultAddress:Array.isArray(this.defaultAddress)||"object"!=typeof this.defaultAddress?this.defaultAddressParams:[this.defaultAddress],this.handleHostedOpenWindowCallback=o=>{var e;const t=null===(e=io.genericSettings)||void 0===e?void 0:e.hostedCheckoutUrl;if(!origin)return;const s=["dev.checkout.elements.zonos.com"].some((e=>o.origin.includes(e)));o.origin!==t&&!s||"zonos-checkout-session-update"!==o.data.type||(X.checkoutSessionId=o.data.checkoutSessionId)},this.captureParamsRedirectedForVariantTest=()=>{const o=new URL(window.location.href);if("1"!==o.searchParams.get("zonosVariantTest"))return;const e=o.searchParams.get("zonosCheckoutSessionId");e&&(X.checkoutSessionId=e);const t=X.enabledVariantTestKeys||[];window.Zonos.isLegacyCheckout&&(ce("hosted_vs_native")?eo(t.map((o=>"hosted_vs_native"===o.testKey?Object.assign(Object.assign({},o),{selectedVariantKey:"hosted"}):o))):(t.push({expiresAt:Date.now()+oo,selectedVariantKey:"hosted",testKey:"hosted_vs_native"}),eo(t))),o.searchParams.delete("zonosCheckoutSessionId"),o.searchParams.delete("zonosVariantTest"),window.history.replaceState({},"",o.toString())}}async initCartInfoHandler(o){u({adjustments:l.adjustments,cartItems:o.detail})}async handleKeyPress(o){"Escape"===o.key&&this.closeDialogHandler()}async closeDialogHandler(o){var e,t;this.open&&((null==o?void 0:o.confirmed)?(this.confirmDialogOpen=!1,M({event:"zonos-checkout-close",metadata:{checkoutSessionId:X.checkoutSessionId}}),this.open=this.forceDialogOpen||!1,this.preview||"finish"!==l.step||h(),this.preview||m(),l.step="customer-info",p(),g(),null===(t=(e=io.checkoutSettings).onClose)||void 0===t||t.call(e)):this.confirmDialogOpen=!0)}async buildCartAndInit(){var o;if("function"==typeof io.checkoutSettings.createCartId){yo('"createCartId" is provided, start building cart'),l.customMessage=[];const o=await io.checkoutSettings.createCartId();let e;"object"==typeof o?(yo("object detected, use cartId and prefill address from createCartId","info",o),e=o.cartId,this.useShippingDataFromCreateCartId(o.shippingData),l.customerAuthenticationToken=o.customerAuthenticationToken||null,l.customMessage=Array.isArray(o.customMessage)?o.customMessage.filter((o=>"string"==typeof o)):[]):e=o,window.Zonos.cartId=e;const t=await(async o=>{const{isDgsCartId:e,isLegacyCartId:t}=So(o);if(!t&&!e)return mo("[ZONOS - loadZonos] invalid cart id"),null;const s=await re({cartId:o,retries:5});return yo("[ZONOS - loadZonos] getting temp cart data","info",s),s?(window.Zonos.storeId=s.cartData.storeId,window.Zonos.zonosApiKey=s.cartData.credentialToken,{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}):(mo("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(e),s=null==t?void 0:t.cartData;if(!s)return mo("Failed to build cart, please try again."),!1;window.Zonos.cartData=s;const{adjustments:n,cartItems:i}=ao(s);await u({adjustments:n,cartItems:i})}else if(window.Zonos.cartData){yo("tempCartUUID is provided, start building cart");const e=null===(o=window.Zonos.cartData.references)||void 0===o?void 0:o.checkoutSessionId;if(e){if(yo("Setting checkout session id from cart reference","info",e),await this.recoverCompletedOrderModificationSession(e))return c.isFetchingSession=!1,!0;X.checkoutSessionId=e}else yo("Clear checkout session id from storage so we start from a fresh session for this cart"),X.checkoutSessionId=null;const{adjustments:t,cartItems:s}=ao(window.Zonos.cartData);await u({adjustments:t,cartItems:s})}else if(io.checkoutSettings.buildCartDetail&&Q.selectedCountryCode){yo("build cart detail");const o=await io.checkoutSettings.buildCartDetail({countryCode:Q.selectedCountryCode,currencyCode:Q.targetCurrency}),e=o.filter((o=>o.amount>=0)),t=o.filter((o=>o.amount<0));yo("cartItems","info",{cartItems:o});const s=t.map((o=>({amount:o.amount,currencyCode:o.currencyCode,description:o.name||o.description||"",productId:o.productId||null,sku:o.sku||null,type:"CART_TOTAL"})));await u({adjustments:s,cartItems:e})}if(!X.checkoutSessionId){const o=await f();if(yo(`stripeStoreInitCheckoutSession: ${o}`),!o)return!1}l.isStagingMode||w(),await this.applyStripeTheme();const{successBehavior:e,successRedirectUrl:t}=io.checkoutSettings;return this.isRedirectAfterOrder="REDIRECT_TO_SUCCESS_PAGE"===e||"CLOSE_MODAL"===e&&!!t||!!l.externalConfirmationPageURL,v()&&(l.step="payment"),!0}reloadCheckoutSession(){window.location.reload()}handleOrderDuplication(){const o=ho(go("local","zonos--placed-order-info"));if(!o)return void fo("local","zonos--placed-order-info");const e=Date.now()-o.time;yo(`=== Existing placed order info: ${o.orderId} - ${this.formatDate(o.time)} - elapsed in hh:ss format: ${new Date(e).toISOString().substring(11,8)}`,"warn");const t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||216e5;if(e>t)return yo(`=== Existing placed order info is older than ${t}ms, cleaning localStorage`,"warn"),void fo("local","zonos--placed-order-info");this.placedOrderInfo=o,yo("=== Showing order duplication confirmation","warn")}recordCheckoutInfo(){X.checkoutSessionId&&ko({attributes:[{key:"APP_VERSION",value:window.Zonos.version},{key:"APP_VERSION_NPM_INTEGRATION",value:window.Zonos.isNpm?"1":"0"},{key:"LEGACY_CHECKOUT_FACADE",value:window.Zonos.isLegacyCheckout?"1":"0"}],checkoutSessionId:X.checkoutSessionId})}confirmProceedWithOrderDuplication(){this.placedOrderInfo=null,X.checkoutSessionId&&ko({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:X.checkoutSessionId})}markTheSessionAsAbandonedCart(){X.checkoutSessionId&&ko({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:X.checkoutSessionId})}handleCancelOrderDuplication(){var o;if(this.placedOrderInfo=null,this.isLegacyCheckout){const e=(null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl)||io.onlineStoreSettings.url;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}this.closeDialogHandler({confirmed:!0})}attachCheckout(){const o=io.checkoutSettings.placeOrderButtonSelector,e=io.checkoutSettings.alwaysTriggerInternationalCheckoutSelector,t=!!document.querySelector(`#${xo}`);if(yo(`attach checkout ${o}`,"info",{href:window.location.href}),yo(`attach checkout to always trigger international checkout selector: ${e}`),!(o||e||window.Zonos.cartData||t))return;const s=[o,e,`#${Io}`,`#${xo}`,`#${To}`].filter(Boolean);document.querySelectorAll(s.join(",")).forEach((t=>{t.getAttribute("data-zonos-checkout-attached")||(yo(`attached event to button ${o}`,"info",{button:t}),t.addEventListener("click",(async o=>{var s,n;const i=performance.now(),r=e&&t.matches(e),a=t.matches(`#${To}`),d=t.matches(`#${Io}`)||t.matches(`#${xo}`);if(!window.Zonos.isLegacyCheckout&&(!Xo()||((o=!0)=>!Q.localizationLoaded||!!Q.isDisabledCountry&&(o&&yo("Checkout: disabled country"),!0))())&&!r&&!a&&!d)return;o.preventDefault(),o.stopPropagation(),yo("zonos checkout button clicked");const{shouldAllowOrder:u}=await this.checkStripePaymentIntentStatus({triggeredButton:o.target});if(u){if(window.Zonos.logIntervalId||(window.Zonos.logIntervalId=setInterval((()=>{(async()=>{if(0===window.Zonos.loadTimeApiInfoList.length)return;yo("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});const o={data:[...window.Zonos.loadTimeApiInfoList],storeId:window.Zonos.storeId||0};window.Zonos.loadTimeApiInfoList.length=0;const{errors:e}=await lo("/api/zonos-elements/log-bulk-load-data",{body:o,method:"POST"});e.length&&(window.Zonos.loadTimeApiInfoList.push(...o.data),ie++,ie>5&&window.Zonos.logIntervalId&&clearInterval(window.Zonos.logIntervalId))})()}),2e3)),io.enabledVariantTestKeys.includes("hosted_vs_native")){this.isOverlayLoading=!0,await this.registerTestHostedVsNative();const{redirected:o}=await this.handleHostedVsNative();if(this.isOverlayLoading=!1,o)return}if(window.Zonos.isBigCommerce){const{shouldBypass:o}=await Fo();if(o)return yo("Bypass customer group detected, redirecting to BigCommerce native checkout","info"),void(window.location.href=jo("/checkout"));const e=await Go();if(e.shouldForceLogin&&e.redirectUrl)return void(window.location.href=e.redirectUrl)}c.isFetchingSession=!0,this.open=!0;try{if(!await this.buildCartAndInit())throw new Error("Error building cart");if(!window.Zonos.isLegacyCheckout){let o=null;try{o=await z()}catch(e){o=to("Unable to check inventory. Please try again.")}if(o)return l.inventoryCheckErrorMessage=o,c.isFetchingSession=!1,void(this.open=!1)}null===(s=window.opener)||void 0===s||s.postMessage({checkoutSessionId:X.checkoutSessionId,type:"zonos-checkout-session-update"},"*"),k({isPreview:this.preview,sessionTimeout:54e5}),M({event:"zonos-checkout-start",metadata:{checkoutSessionId:X.checkoutSessionId}}),y({checkoutSessionId:X.checkoutSessionId,eventName:"checkout_open"});const{enabled:o}=await(async()=>{const{errors:o,json:e}=await lo("/api/zonos-elements/get-store-discount-enabled-status");return o.length||!(null==e?void 0:e.enabled)?{enabled:!1}:{enabled:!0}})();if(l.shouldHideDiscountInput=!o,this.handleOrderDuplication(),window.Zonos.isLegacyCheckout)(async()=>{const{elapsedTime:o}=Co(),e={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:bo},po()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};lo("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})();else{(async({loadTime:o})=>{const e={cache:"miss",eventName:"jsdelivr",flag:"LOG_NATIVE_CHECKOUT_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:bo},po()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};lo("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})({loadTime:performance.now()-i})}this.recordCheckoutInfo(),Ao()&&this.markTheSessionAsAbandonedCart()}catch(o){if(o instanceof Error&&"Cart is expired."===o.message&&(this.isCartExpired=!0),c.isFetchingSession=!1,mo(o),this.isCartExpired)return void(c.isFetchingSession=!0);wo({endpoint:"Error creating Checkout",errors:[o instanceof Error?o.toString():"Unknown error"],metadata:{allLogs:bo,cartId:window.Zonos.cartId,checkoutSessionBody:C(),href:window.location.href,storeBaseUrl:(null===(n=window.Zonos.cartData)||void 0===n?void 0:n.storeBaseUrl)||io.onlineStoreSettings.url}}),b({messages:[to("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:to("Error creating Checkout")})}}}),{capture:!0,passive:!1}),io.checkoutSettings.disablePlaceOrderButtonActivation||t.removeAttribute("disabled"),t.setAttribute("data-zonos-checkout-attached","true"),t.matches(`#${Io}`)&&(t.dispatchEvent(Bo("click")),S(),t.remove()),t.matches(`#${xo}`)&&(t.dispatchEvent(Bo("click")),t.remove()))}))}appearanceSettingsOverrideChanged(){this.appearanceSettingsOverride&&this.applyStripeTheme()}useShippingDataFromCreateCartId(o){if(!o)return;yo("shipping data from createCartId result","info",Object.entries(o));const{customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:n,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:u}=o,h=new URLSearchParams(window.location.search),m=n||q(h)||Q.selectedCountryCode;this.applyPrefillAddress({customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:m,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:u})}useLegacyQueryParams(){const o=new URLSearchParams(window.location.search);yo("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:null},t=q(o)||Q.selectedCountryCode,s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerFirstName"),d=e("customerLastName"),l=e("customerPhone"),u=e("customerZip"),h=e("customerState");this.applyPrefillAddress({customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:a,customerLastName:d,customerName:r,customerPhone:l,customerState:h,customerZip:u})}applyPrefillAddress(o){const e=o.customerAddress1||"",t=o.customerCountry||"",s=o.customerAddress2||"",n=o.customerCity||"",i=o.customerEmail||"",c=o.customerFirstName&&o.customerLastName?`${o.customerFirstName} ${o.customerLastName}`:o.customerName||"",r=o.customerPhone||"",a=o.customerZip||"",d=o.customerState||"";e&&c&&r&&t?t&&Q.shippingZoneCountries&&!(t in Q.shippingZoneCountries)?yo(`Country "${t}" is not in the shipping zone, so it can not be prefilled`,"warn"):(this.defaultAddressParams=[{address:{city:n||"",country:t,line1:e,line2:s,postal_code:a,state:d},email:i,name:c,phone:r}],yo("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:o})):yo("Missing required query params so it can not be prefilled","info",[!e&&"line1",!c&&"name",!r&&"phone",!t&&"country"].filter(Boolean).join(", "))}overrideStagingModeChanged(){l.isStagingMode=!!this.overrideStagingMode}async init(){c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,l.isStagingMode=vo(),void 0!==this.overrideStagingMode&&(l.isStagingMode=this.overrideStagingMode),(()=>{var o;if(!window.Zonos.isBigCommerce)return;const e=null===(o=io.genericSettings)||void 0===o?void 0:o.bigcommerceBypassCustomerGroupIds;(null==e?void 0:e.length)&&$o()})(),window.Zonos.isBigCommerce&&Vo(),(()=>{if(!window.Zonos.isBigCommerce)return;if(!window.location.pathname.includes("/login.php"))return;Yo();const o=new MutationObserver((()=>{Yo()}));o.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>o.disconnect()),1e4)})(),this.handleBigcommerceInternationalResumeFlag(),this.prefillBigCommerceCustomerAddresses(),ne({domesticRedirectedBtnSelector:Io,onInternationalCheckoutSelected:async()=>{this.detectedDomesticCheckoutDialogOpen=!0,await new Promise((o=>setTimeout(o,2e3)))},onLoggedInInternationalAddressDetected:()=>new Promise((o=>{this.loggedInIntlAddressResolver=o,this.loggedInIntlAddressConfirmDialogOpen=!0})),onShippingAddressSessionFound:o=>{this.defaultAddress=[{address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:`${o.firstName} ${o.lastName}`,phone:o.phone}]}}),window.Zonos&&this.useLegacyQueryParams();const o=setInterval((()=>{c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,this.stripe?(this.storybookPaymentStatusOverride||(yo("init checkout"),this.preview||this.forceDialogOpen?this.buildCartAndInit():window.Zonos.isLegacyCheckout?this.attachCheckout():window&&(this.attachCheckout(),new MutationObserver((()=>{this.attachCheckout()})).observe(document.body,{childList:!0,subtree:!0}))),clearInterval(o)):yo("waiting for stripe to be loaded")}),50);setTimeout((()=>{clearInterval(o)}),1e4)}handleBigcommerceInternationalResumeFlag(){if(!window.Zonos.isBigCommerce)return;const o=new URL(window.location.href);if("true"!==o.searchParams.get(Do))return;o.searchParams.delete(Do),window.history.replaceState({},"",o.toString());const e=Date.now(),t=setInterval((()=>{if(!Q.localizationLoaded||!Q.selectedCountryCode)return void(Date.now()-e>15e3&&(clearInterval(t),yo("BigCommerce international checkout resume flag: localization did not initialize within 15s","info")));const o=document.querySelector(`#${To}`);if(o)return clearInterval(t),void o.dispatchEvent(Bo("click"));Date.now()-e>15e3&&(clearInterval(t),yo("BigCommerce international checkout resume flag: trigger button did not mount within 15s","info"))}),200)}async setToFinishStep(o){l.step="finish",this.storybookPaymentStatusOverride=o}async mockCheckoutSession(o){x(o)}async triggerCheckoutInternational(){const o=document.querySelector(`#${To}`);o&&o.dispatchEvent(Bo("click"))}async handleCustomerInfoContinue(){var o,e,t,s;M({event:"zonos-checkout-customer-info",metadata:{checkoutSessionId:X.checkoutSessionId}}),y({checkoutSessionId:X.checkoutSessionId,eventName:"checkout_customerInfoCompleted"}),this.submitLoading=!0;const{isRequestNotReady:n}=await I();n&&"stripe"===l.addressFormRenderType&&wo({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:null===(e=null===(o=c.stripeAddressEventData)||void 0===o?void 0:o.value)||void 0===e?void 0:e.address,billingAddress:null===(s=null===(t=c.stripeBillingAddressEventData)||void 0===t?void 0:t.value)||void 0===s?void 0:s.address,cartId:window.Zonos.cartId}});const i=o=>{"customer-info"===l.step?c.isFetchingLandedCost||(l.landedCostData&&(K({currency:l.currency}),T()),this.submitLoading=!1,o&&clearInterval(o)):clearInterval(o)};i();const r=setInterval((()=>{i(r)}),20);setTimeout((()=>{clearInterval(r)}),1e4)}async handleShippingContinue(){T()}handleInventoryCheckDialogConfirm(){l.inventoryCheckErrorMessage=null,this.isLegacyCheckout||this.closeDialogHandler({confirmed:!0})}handleCartExpiredDialogConfirm(){var o;if(this.isCartExpired=!1,this.isLegacyCheckout){const e=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}window.parent&&(window.parent.location.href=window.location.href),window.location.reload()}async handleStripePaymentContinue(){if("USD"===c.checkoutSettlementCurrency&&c.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen)return void(this.payInUsdConfirmDialogOpen=!0);this.payInUsdConfirmDialogOpen=!1;const o=A();try{if(H.paypalErrorMessage=null,c.hasPaymentError=!1,this.submitLoading=!0,l.inventoryCheckErrorMessage=null,!await O())return c.hasPaymentError=!0,c.customErrorMessage=to("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:c.checkoutSettlementCurrency}),void(this.submitLoading=!1);try{l.inventoryCheckErrorMessage=await z()}catch(o){l.inventoryCheckErrorMessage=to("Unable to check inventory. Please try again.")}if(l.inventoryCheckErrorMessage)return void(this.submitLoading=!1);if($()>0){const o=await B();if(!o.success)return c.hasPaymentError=!0,c.customErrorMessage=o.error||to("Unable to apply store credit. Please try again."),void(this.submitLoading=!1)}if(_()){try{const o=await L();if(!o.valid)return c.hasPaymentError=!0,c.customErrorMessage=o.errorMessage,void(this.submitLoading=!1);const e=await P();if(!e.success)return c.hasPaymentError=!0,c.customErrorMessage=e.error||to("Unable to place order with store credit. Please try again."),void(this.submitLoading=!1);T(),g()}catch(o){mo(o),M({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:X.checkoutSessionId}}),c.hasPaymentError=!0}return void(this.submitLoading=!1)}try{await E({noLandedCostCheck:v()}),T(),g()}catch(o){mo(o),M({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:X.checkoutSessionId}}),c.hasPaymentError=!0,c.shouldInventoryRefund&&(D(),c.shouldInventoryRefund=!1)}this.submitLoading=!1}finally{o&&(U.locked=!1)}}async handleFinishClick(){if(j(),this.preview)return l.step="customer-info",void await this.init();if(h(),m(),window.Zonos.isLegacyCheckout&&window.Zonos.cartData){const o=window.Zonos.cartData.storeBaseUrl||io.onlineStoreSettings.url;return window.parent&&(window.parent.location.href=o),void(window.location.href=o)}const o=window.location.href.split("?")[0];this.open=!1,window.location.hostname.includes("dashboard.zonos.com")||(window.history.replaceState(window.history.state,document.title,o),window.location.reload())}handleWindowResize(){this.isMobile=zo(this.mobile),this.applyStripeTheme(),yo(`mobile: ${this.isMobile}`)}handleMobileChange(){this.isMobile=zo(this.mobile),this.applyStripeTheme(),yo(`mobile: ${this.isMobile}`)}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=co(this.appearanceSettingsOverride.theme))}handleAddressChange(){j()}handleCustomerProfileChange(){var o,e;if(!this.customerProfile)return yo("No customer profile","info"),void(this.defaultCustomerProfileAddress=[]);yo("Customer profile found","info",{customerProfile:this.customerProfile}),this.defaultCustomerProfileAddress=(null===(e=null===(o=c.customerProfile)||void 0===o?void 0:o.locations)||void 0===e?void 0:e.map((o=>{var e;return{address:{city:o.locality,country:o.countryCode,line1:o.line1,line2:o.line2||"",postal_code:o.postalCode,state:o.administrativeArea},email:o.email||(null===(e=c.customerProfile)||void 0===e?void 0:e.email)||"",name:o.name||"",phone:o.phone||""}})))||[]}handleClientSecretChange(){yo("==== Client secret changed","info",{clientSecret:this.clientSecret,stripeCustomerSessionClientSecret:this.stripeCustomerSessionClientSecret}),this.applyStripeTheme()}handleOpenChange(){const o="data-zonos-overflow-origin",e=document.body,t=document.documentElement;if(this.open)window.Zonos.openHelloDialog(!1),e.style.overflow&&e.setAttribute(o,e.style.overflow),e.style.overflow="hidden",t.style.overflow&&t.setAttribute(o,t.style.overflow),t.style.overflow="hidden";else{this.stripeCustomerSessionClientSecret=null;const s=e.getAttribute(o),n=t.getAttribute(o);s?(e.removeAttribute(o),e.style.overflow=s):e.style.removeProperty("overflow"),n?(t.removeAttribute(o),t.style.overflow=n):t.style.removeProperty("overflow")}}componentWillLoad(){this.init(),this.isMobile=zo(this.mobile),this.isIframed=window.self!==window.top,yo(`iframed: ${this.isIframed}`),window.Zonos.isLegacyCheckout&&this.captureParamsRedirectedForVariantTest(),this.handleAppearanceSettingsOverrideChange(),this.storeUnsubscribeList=[so("selectedLocale",(()=>{this.applyStripeTheme()})),N("selectedShippingOption",(()=>{var o,e,t,s;const n=l.selectedShippingOption;(null===(o=io.genericSettings)||void 0===o?void 0:o.shouldFedExShippingConsentForCanadianShopper)&&(null===(t=null===(e=null==n?void 0:n.shippingProfile)||void 0===e?void 0:e.serviceLevel.code)||void 0===t?void 0:t.toLowerCase().startsWith("fedex."))&&"CA"===(null===(s=c.stripeAddressEventData)||void 0===s?void 0:s.value.address.country)&&(this.shouldShowFedexShippingConsentDialog=!0)})),R("stripeAddressEventData",(o=>{var e;if(!window.Zonos.isBigCommerce||!o||this.redirectToDomesticCheckoutDialogOpen||!(null===(e=io.genericSettings)||void 0===e?void 0:e.isBigcommerceDomesticCheckoutRedirectEnabled)||"USD"!==io.sourceCurrency)return;if(!this.open)return;if(window.location.pathname.includes("/checkout"))return;const t=o.value.address.country;t&&io.disabledCountries.includes(t)&&(this.redirectToDomesticCheckoutDialogOpen=!0,yo(`Domestic country ${t} selected in international checkout, redirecting to BigCommerce domestic checkout`,"info"),setTimeout((()=>{window.location.href=jo("/checkout")}),2e3))}))],this.initializeTestKeys(),window.addEventListener("message",this.handleHostedOpenWindowCallback),yo(`mobile: ${this.isMobile}`)}disconnectedCallback(){j(),h(),m(),this.storeUnsubscribeList.forEach((o=>o())),window.removeEventListener("message",this.handleHostedOpenWindowCallback)}render(){var o,n,i,r;this.customerProfile=c.customerProfile,this.clientSecret=c.clientSecret,c.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret);const a="finish"!==l.step&&"error"!==l.step&&!c.stripeElements||c.isFetchingSession,d=v(),{colorPrimary:u,colorSecondary:h,logoUrl:m,style:p}=ro(io.appearance,this.appearanceSettingsOverride||null),g="ENABLED"===io.appearance.zonosAttribution,f=io.appearance.theme,w=u&&Lo(u)?"DARK":"LIGHT",z=this.isMobile?f:w,k=this.isMobile?void 0:h,{customMessages:y}=Q,C=null===(o=y.find((o=>"checkout_default"===o.pageName)))||void 0===o?void 0:o.message,b=this.getCurrentLocalePageEnum(),S=y.filter((o=>o.pageName===b)),x=this.getBaseCurrencySettlementInfo(),I=()=>{const o=this.preview?`${m}?timestamp=${Date.now()}`:m;return e("div",{class:"zonos--logo"},o&&e("img",{alt:`${io.organizationName} logo`,src:o}))},T=uo(),A=()=>{const o=new URLSearchParams(window.location.search),t=o.get("zonosQaUrl"),s=o.get("zonosDebug"),n=o.get("zonosE2ETest"),i=this.overrideStagingMode||vo();return e("zonos-v-stack",null,e("div",{class:"zonos--logo-wrapper"},I(),T&&e("zonos-badge",{badgeColor:"orange",size:"small"},to("Test mode")),i&&e("zonos-badge",{badgeColor:"red",size:"small"},to("Staging mode")),"1"===s&&e("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&e("zonos-badge",{badgeColor:"purple",size:"small"},t),n&&e("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),!d&&e("zonos-checkout-progress-tabs",{backgroundColor:this.isMobile?"--zonos-elements-gray-0":null}),S.map((o=>e("zonos-custom-message",{icon:ae,message:o.message}))))},O=()=>l.checkoutSessionTimeoutShow?e("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:to("Your checkout session has expired. Please reload the page to continue."),restStateTitle:to("Session timed out"),restStateType:"Warning"},e("zonos-button",{onClick:()=>this.reloadCheckoutSession(),variant:"primary"},to("Reload"))):e("div",{class:"zonos--content",style:{"--zonos--border-radius":_o({overrideBorderStyle:p})}},"finish"!==l.step&&"error"!==l.step&&e(t,null,e("div",{class:"zonos--left","data-theme":z,style:Po({"--zonos--primary-color":this.isMobile?void 0:u})},!this.isMobile&&A(),"customer-info"===l.step&&e("zonos-customer-info",{continueLoading:this.submitLoading,defaultAddress:this.getDefaultAddress(),isMobile:this.isMobile,onContinueClicked:()=>this.handleCustomerInfoContinue(),submitBtnColor:k}),"shipping"===l.step&&e("zonos-shipping",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:()=>this.handleShippingContinue(),submitBtnColor:k}),"payment"===l.step&&e("zonos-checkout-payment",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:async()=>{await this.handleStripePaymentContinue()},submitBtnColor:k})),e("div",{class:"zonos--right","data-theme":f},this.isMobile&&A(),e("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&e("zonos-currency-toggle",null),!this.isLegacyCheckout&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:Eo}),noBackground:!0,onClick:()=>this.closeDialogHandler()})),e("div",{class:"flex--wrapper"},e("div",{class:"zonos--wrapper"},e("zonos-review",{collapsed:this.collapseReviewMobile,mobile:this.isMobile,onClick:()=>{this.isMobile&&(this.collapseReviewMobile=!this.collapseReviewMobile)}}),e("zonos-collapse",{collapsed:this.collapseReviewMobile&&this.isMobile},e("zonos-cart-items",null),this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",{submitBtnColor:k}),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:ae,message:C})))),e("zonos-cart-restricted-items",null),!this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",null),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:ae,message:C}))))),("finish"===l.step||"error"===l.step)&&e("div",{class:"zonos--done","data-theme":f},e("div",{class:"zonos--header"},I(),!this.isRedirectAfterOrder&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:Eo}),noBackground:!0,onClick:()=>this.handleFinishClick(),theme:f})),e("zonos-checkout-finish",{borderRadius:p,onCloseClick:()=>this.handleFinishClick(),overrideNotification:"error"===l.step&&l.error?Object.assign(Object.assign({},l.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),e("zonos-checkout-footer",{"data-theme":f,mobile:this.isMobile,slot:this.isMobile?void 0:"dialog-footer"}));return e(s,{class:Oo(["zonos--checkout zonos--elements","payment"===l.step&&"zonos--processing-payment",g&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?O():e("zonos-dialog",{borderStyle:p,class:"zonos--checkout-dialog","data-theme":f,height:"980px",isLoading:a,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeDialogHandler(),open:this.open,width:"1200px"},O()),e("zonos-dialog",{isLoading:!0,loadingText:to("You will be redirected to international checkout shortly."),loadingTitle:to("We detected that you are shipping to an international address."),noClickOutside:!0,noCloseButton:!0,open:this.detectedDomesticCheckoutDialogOpen,width:"450px"}),e("zonos-dialog",{isLoading:!0,loadingText:to("You will be redirected to domestic checkout shortly."),loadingTitle:to("We detected that you are shipping to a domestic address."),noClickOutside:!0,noCloseButton:!0,open:this.redirectToDomesticCheckoutDialogOpen,width:"450px"}),e("zonos-confirm-dialog",{class:"zonos--logged-in-intl-address-dialog",dialogCancelBtnText:to("Stay on this page"),dialogConfirmBtnText:to("Continue to international checkout"),dialogIntent:"info",dialogOpen:this.loggedInIntlAddressConfirmDialogOpen,dialogSubtitle:to("Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?"),dialogTitle:to("International shipping address detected"),dialogWidth:480,onCancelClicked:()=>{var o;this.loggedInIntlAddressConfirmDialogOpen=!1,null===(o=this.loggedInIntlAddressResolver)||void 0===o||o.call(this,"stay"),this.loggedInIntlAddressResolver=null},onConfirmClicked:()=>{var o;this.loggedInIntlAddressConfirmDialogOpen=!1,null===(o=this.loggedInIntlAddressResolver)||void 0===o||o.call(this,"redirect"),this.loggedInIntlAddressResolver=null}}),e("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:to("Don't close"),dialogConfirmBtnText:to("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:to("Would you like to close checkout and return to the site?"),dialogTitle:to("Are you sure?"),onCancelClicked:()=>{this.confirmDialogOpen=!1},onConfirmClicked:()=>this.closeDialogHandler({confirmed:!0})}),e("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:to("Return to merchant site"),dialogConfirmBtnText:to("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:(null===(n=this.placedOrderInfo)||void 0===n?void 0:n.zonosOrderNumber)?to("It looks like you placed an order recently ([date] at [time]) under order number #[orderNumber]. Check your email for the order confirmation. Are you sure you want to place another order?",{date:this.formatDate(this.placedOrderInfo.time),orderNumber:this.placedOrderInfo.zonosOrderNumber,time:this.formatTime(this.placedOrderInfo.time)}):to("It looks like you placed an order recently ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?",{date:this.formatDate((null===(i=this.placedOrderInfo)||void 0===i?void 0:i.time)||null),time:this.formatTime((null===(r=this.placedOrderInfo)||void 0===r?void 0:r.time)||null)}),dialogTitle:to("Are you sure?"),dialogWidth:530,onCancelClicked:()=>{this.handleCancelOrderDuplication()},onConfirmClicked:()=>{this.confirmProceedWithOrderDuplication()}}),e("zonos-confirm-dialog",{class:"zonos--fedex-shipping-dialog",dialogConfirmBtnText:to("Confirm"),dialogIntent:"info",dialogOpen:!!this.shouldShowFedexShippingConsentDialog,dialogSubtitle:e(t,null,to("If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request."),e("zonos-link",{href:"https://ftn.fedex.com/us/assets/docs/One-Time_GAA.pdf",target:"_blank"},to("View GAA Form."))),dialogTitle:to("Fedex Shipping Procedure"),dialogType:"alert",dialogWidth:500,onConfirmClicked:()=>this.shouldShowFedexShippingConsentDialog=!1}),e("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:to("Return to cart"),dialogIntent:"danger",dialogOpen:!!l.inventoryCheckErrorMessage,dialogSubtitle:l.inventoryCheckErrorMessage,dialogTitle:to("Couldn't place order"),dialogType:"alert",onConfirmClicked:()=>this.handleInventoryCheckDialogConfirm()}),x&&e("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:to("Cancel"),dialogConfirmBtnText:to("Pay [orderTotal]",{orderTotal:no({amount:x.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:to("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:to("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),e("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:to("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:to("You are being sent back to the shop to re-add items to your cart."),dialogTitle:to("Shopping cart expired"),dialogType:"alert",onConfirmClicked:()=>this.handleCartExpiredDialogConfirm()}),e("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}static get watchers(){return{appearanceSettingsOverride:[{appearanceSettingsOverrideChanged:0},{handleAppearanceSettingsOverrideChange:0}],overrideStagingMode:[{overrideStagingModeChanged:0}],mobile:[{handleMobileChange:0}],defaultAddress:[{handleAddressChange:0}],customerProfile:[{handleCustomerProfileChange:0}],clientSecret:[{handleClientSecretChange:0}],stripeCustomerSessionClientSecret:[{handleClientSecretChange:0}],open:[{handleOpenChange:0}]}}};de.style=".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h{z-index:2147483647;position:fixed}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto;position:relative}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.hidden-mode.sc-zonos-checkout-h{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0;z-index:-1}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}.zonos--processing-payment.sc-zonos-checkout-h{z-index:2147483646}";export{de as zonos_checkout}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,h as e,F as s,a as t,g as n}from"./p-_lt63o7c.js";import{a2 as r,G as a,a3 as i,a4 as l,a5 as c,R as d,a6 as m,a7 as p,K as h}from"./p-BMPYH-LT.js";import{l as z,t as g}from"./p-CTiqplrr.js";import{z as f,a as x}from"./p-CqB9AfBf.js";import{r as u}from"./p-D1SmY_fZ.js";import{g as y}from"./p-r-YGHhLa.js";import"./p-Dwg61Ft_.js";import"./p-DMIgN_sT.js";import"./p-BJmZPrZl.js";import"./p-DE4a-QD5.js";import"./p-YdrG78th.js";const v="POLICIES",b=class{constructor(e){o(this,e)}render(){const o=r();if(!o.length)return null;const n=Intl.ListFormat,i=(n?new n(z.selectedLocale,{style:"long",type:"conjunction"}).formatToParts(o.map((o=>o.name))):o.flatMap(((o,e)=>0===e?[{type:"element",value:o.name}]:[{type:"literal",value:", "},{type:"element",value:o.name}]))).map((s=>{if("literal"===s.type)return s.value;const t=o.find((o=>o.name===s.value));return t?e("a",{href:t.url,onClick:o=>{o.preventDefault(),o.stopPropagation(),window.open(t.url,"_blank","noopener,noreferrer")},rel:"noopener noreferrer",target:"_blank"},s.value):s.value})),l=f.organizationName,c=l?g("I agree to [merchantName]'s [policies]",{merchantName:l,policies:v}):g("I agree to the [policies]",{policies:v}),[d="",m=""]=c.split(v),p=a.showError,h="zonos--policy-consent-error";return e(t,{class:"zonos--policy-consent-host"},e("div",{class:"zonos--policy-consent"+(p?" zonos--policy-consent--error":"")},e("label",{class:"zonos--policy-consent-label"},e("input",{"aria-describedby":p?h:void 0,"aria-invalid":p?"true":"false",checked:a.accepted,class:"zonos--policy-consent-checkbox",disabled:a.locked,onChange:o=>{const e=o.target.checked;a.accepted=e,e?(a.acceptedAt||(a.acceptedAt=(new Date).toISOString()),a.showError=!1):a.acceptedAt=null},type:"checkbox"}),e("span",{class:"zonos--policy-consent-text"},d,e(s,null,i),m))),p&&e("div",{class:"zonos--policy-consent-error",id:h,role:"alert"},g("You must accept the policies to place this order")))}};b.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:block;margin-top:20px}.zonos--policy-consent{background-color:var(--zonos-elements-gray-50);border:1px solid var(--zonos-elements-gray-200);border-radius:8px;padding:12px 14px;-webkit-transition:border-color 0.15s ease, background-color 0.15s ease;transition:border-color 0.15s ease, background-color 0.15s ease}.zonos--policy-consent:hover{border-color:var(--zonos-elements-gray-300)}.zonos--policy-consent--error{background-color:var(--zonos-elements-red-50);border-color:var(--zonos-elements-red-400)}.zonos--policy-consent-label{-ms-flex-align:center;align-items:center;cursor:pointer;display:-ms-flexbox;display:flex;gap:10px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.zonos--policy-consent-checkbox{accent-color:var(--zonos-elements-blue-600);cursor:pointer;-ms-flex-negative:0;flex-shrink:0;height:18px;margin:0;width:18px}.zonos--policy-consent-text{color:var(--zonos-elements-gray-800);font-size:14px;line-height:1.45}.zonos--policy-consent-text a{color:var(--zonos-elements-blue-600);text-decoration:underline;text-underline-offset:2px}.zonos--policy-consent-text a:hover{color:var(--zonos-elements-blue-700)}.zonos--policy-consent-error{color:var(--zonos-elements-red-600);font-size:13px;line-height:1.4;margin-top:8px;padding:0 4px}";var k='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true">\n <path fill="currentColor" fill-rule="evenodd" d="M4 5a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h16a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3H4Zm16 2H4a1 1 0 0 0-1 1v1h18V8a1 1 0 0 0-1-1ZM2 11h20v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-3Zm6 4.5a1 1 0 0 1 1-1h2a1 1 0 0 1 0 2H9a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>\n</svg>\n';const w="full",C="custom",j=class{constructor(e){o(this,e),this.enabled=!0,this.customAmountInput="",this.handleUseStoreCreditChange=o=>{i(o),o&&l(!0),c()},this.handleAmountModeChange=o=>{const e=o===w;l(e),e||(this.customAmountInput=""),c()},this.handleCustomAmountChange=o=>{this.customAmountInput=o,d.error=null},this.handleApplyCustomAmount=()=>{const o=parseFloat(this.customAmountInput);!isNaN(o)&&o>0?m(o):m(null),d.error||c()}}async componentWillLoad(){await p()}render(){if(!this.enabled)return null;const{colorPrimary:o}=f.appearance,n=y({}),r=d.availableBalance,a=null!==r&&r>0,i=d.isEnabled,l=d.useFullBalance,c=d.error,m=h(),p=u({amount:null!=r?r:0,isForeign:!0});return e(t,{class:"zonos--elements zonos--store-credit",style:{"--zonos--border-radius":n,"--zonos--font-family":x(),"--zonos--primary-color":o}},e("div",{class:"zonos--store-credit-container"},e("div",{class:"zonos--store-credit-header"},e("div",{class:"zonos--store-credit-title-row"},e("div",{class:"zonos--store-credit-title-left"},e("div",{"aria-hidden":"true",class:"zonos--store-credit-title-icon"},e("zonos-icon",{content:k,iconColor:"gray-500",size:22})),e("zonos-text",{type:"semiBoldLabel"},g("Store credit"))),a&&e("div",{class:"zonos--store-credit-balance-badge"},e("zonos-text",{textColor:"gray-600",type:"caption"},p)))),e(s,null,a?e("div",{class:"zonos--store-credit-content"},e("div",{class:"zonos--store-credit-checkbox"},e("zonos-checkbox",{isChecked:i,label:g("Use store credit"),onCheckboxSelected:o=>this.handleUseStoreCreditChange(o.detail),size:16})),i&&e("div",{class:"zonos--store-credit-options"},e("div",{class:"zonos--store-credit-toggle-row"},e("zonos-toggle",{onToggleChanged:o=>this.handleAmountModeChange(o.detail),options:[{label:g("Apply full balance"),value:w},{label:g("Enter amount"),value:C}],value:l?w:C})),!l&&e("div",{class:"zonos--store-credit-custom-amount"},e("div",{class:"zonos--store-credit-custom-amount-row"},e("zonos-input",{inputLabel:g("Enter amount"),inputValue:this.customAmountInput,isError:!!c,onInputChange:o=>this.handleCustomAmountChange(o.detail)}),e("zonos-button",{onClick:this.handleApplyCustomAmount,size:"sm",variant:"primary"},g("Apply")))),c&&e("div",{class:"zonos--store-credit-error"},e("zonos-text",{textColor:"red-600",type:"caption"},c)),e("div",{class:"zonos--store-credit-summary"},e("zonos-text",{textColor:"gray-800",type:"semiBoldLabel"},g("Amount to apply: [amount]",{amount:u({amount:m,isForeign:!0})}))))):e("div",{class:"zonos--store-credit-empty"},e("div",{"aria-hidden":"true",class:"zonos--store-credit-empty-icon"},e("zonos-icon",{content:k,iconColor:"gray-500",size:28})),e("zonos-text",{textColor:"gray-600",type:"caption"},g("No store credit available"))))))}get el(){return n(this)}};j.style=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:block;margin-bottom:var(--zonos-elements-font-size-xl)}:host .zonos--store-credit-container{background:-webkit-gradient(linear, left top, left bottom, from(var(--zonos-elements-gray-0)), to(var(--zonos-elements-gray-50)));background:linear-gradient(180deg, var(--zonos-elements-gray-0) 0%, var(--zonos-elements-gray-50) 100%);border:1px solid var(--zonos-elements-gray-200);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-8));-webkit-box-shadow:var(--zonos-elements-v3-shadow-base);box-shadow:var(--zonos-elements-v3-shadow-base);overflow:hidden;padding:0;position:relative}:host .zonos--store-credit-container::before{background:var(--zonos--primary-color, var(--zonos-elements-gray-400));content:"";height:3px;left:0;position:absolute;right:0;top:0}:host .zonos--store-credit-header{padding:var(--zonos-elements-radius-12) var(--zonos-elements-font-size-l) 0}:host .zonos--store-credit-title-row{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .zonos--store-credit-title-left{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-title-icon{-ms-flex-align:center;align-items:center;background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 14%, transparent);border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.75);display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;height:22px;-ms-flex-pack:center;justify-content:center;width:22px}:host .zonos--store-credit-balance-badge{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 8%, var(--zonos-elements-gray-50));border:1px solid color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 22%, var(--zonos-elements-gray-200));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:2px var(--zonos-elements-font-size-s)}:host .zonos--store-credit-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-s) var(--zonos-elements-font-size-l) var(--zonos-elements-radius-12)}:host .zonos--store-credit-checkbox{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex}:host .zonos--store-credit-options{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-toggle-row{display:-ms-flexbox;display:flex}:host .zonos--store-credit-custom-amount{max-width:240px}:host .zonos--store-credit-custom-amount-row{-ms-flex-align:end;align-items:flex-end;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-custom-amount-row zonos-input{-ms-flex:1;flex:1}:host .zonos--store-credit-error{margin-top:2px}:host .zonos--store-credit-summary{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 6%, var(--zonos-elements-gray-50));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:var(--zonos-elements-radius-10) var(--zonos-elements-font-size-s)}:host .zonos--store-credit-empty{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-xl) var(--zonos-elements-font-size-l) 22px;text-align:center}:host .zonos--store-credit-empty-icon{-ms-flex-align:center;align-items:center;background:var(--zonos-elements-gray-100);border-radius:50%;display:-ms-flexbox;display:flex;height:52px;-ms-flex-pack:center;justify-content:center;opacity:0.95;width:52px}';export{b as zonos_policy_consent,j as zonos_store_credit}
|
|
1
|
+
import{r as o,h as e,F as s,a as t,g as n}from"./p-_lt63o7c.js";import{a2 as r,G as a,a3 as i,a4 as l,a5 as c,R as d,a6 as m,a7 as p,K as h}from"./p-BJ_kE5rM.js";import{l as z,t as g}from"./p-CVRbGFV3.js";import{z as f,a as x}from"./p-CqB9AfBf.js";import{r as u}from"./p-DATNIakn.js";import{g as y}from"./p-r-YGHhLa.js";import"./p-Dwg61Ft_.js";import"./p-DMIgN_sT.js";import"./p-BJmZPrZl.js";import"./p-gEViRqvf.js";import"./p-YdrG78th.js";const v="POLICIES",b=class{constructor(e){o(this,e)}render(){const o=r();if(!o.length)return null;const n=Intl.ListFormat,i=(n?new n(z.selectedLocale,{style:"long",type:"conjunction"}).formatToParts(o.map((o=>o.name))):o.flatMap(((o,e)=>0===e?[{type:"element",value:o.name}]:[{type:"literal",value:", "},{type:"element",value:o.name}]))).map((s=>{if("literal"===s.type)return s.value;const t=o.find((o=>o.name===s.value));return t?e("a",{href:t.url,onClick:o=>{o.preventDefault(),o.stopPropagation(),window.open(t.url,"_blank","noopener,noreferrer")},rel:"noopener noreferrer",target:"_blank"},s.value):s.value})),l=f.organizationName,c=l?g("I agree to [merchantName]'s [policies]",{merchantName:l,policies:v}):g("I agree to the [policies]",{policies:v}),[d="",m=""]=c.split(v),p=a.showError,h="zonos--policy-consent-error";return e(t,{class:"zonos--policy-consent-host"},e("div",{class:"zonos--policy-consent"+(p?" zonos--policy-consent--error":"")},e("label",{class:"zonos--policy-consent-label"},e("input",{"aria-describedby":p?h:void 0,"aria-invalid":p?"true":"false",checked:a.accepted,class:"zonos--policy-consent-checkbox",disabled:a.locked,onChange:o=>{const e=o.target.checked;a.accepted=e,e?(a.acceptedAt||(a.acceptedAt=(new Date).toISOString()),a.showError=!1):a.acceptedAt=null},type:"checkbox"}),e("span",{class:"zonos--policy-consent-text"},d,e(s,null,i),m))),p&&e("div",{class:"zonos--policy-consent-error",id:h,role:"alert"},g("You must accept the policies to place this order")))}};b.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:block;margin-top:20px}.zonos--policy-consent{background-color:var(--zonos-elements-gray-50);border:1px solid var(--zonos-elements-gray-200);border-radius:8px;padding:12px 14px;-webkit-transition:border-color 0.15s ease, background-color 0.15s ease;transition:border-color 0.15s ease, background-color 0.15s ease}.zonos--policy-consent:hover{border-color:var(--zonos-elements-gray-300)}.zonos--policy-consent--error{background-color:var(--zonos-elements-red-50);border-color:var(--zonos-elements-red-400)}.zonos--policy-consent-label{-ms-flex-align:center;align-items:center;cursor:pointer;display:-ms-flexbox;display:flex;gap:10px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.zonos--policy-consent-checkbox{accent-color:var(--zonos-elements-blue-600);cursor:pointer;-ms-flex-negative:0;flex-shrink:0;height:18px;margin:0;width:18px}.zonos--policy-consent-text{color:var(--zonos-elements-gray-800);font-size:14px;line-height:1.45}.zonos--policy-consent-text a{color:var(--zonos-elements-blue-600);text-decoration:underline;text-underline-offset:2px}.zonos--policy-consent-text a:hover{color:var(--zonos-elements-blue-700)}.zonos--policy-consent-error{color:var(--zonos-elements-red-600);font-size:13px;line-height:1.4;margin-top:8px;padding:0 4px}";var k='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true">\n <path fill="currentColor" fill-rule="evenodd" d="M4 5a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h16a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3H4Zm16 2H4a1 1 0 0 0-1 1v1h18V8a1 1 0 0 0-1-1ZM2 11h20v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-3Zm6 4.5a1 1 0 0 1 1-1h2a1 1 0 0 1 0 2H9a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>\n</svg>\n';const w="full",C="custom",j=class{constructor(e){o(this,e),this.enabled=!0,this.customAmountInput="",this.handleUseStoreCreditChange=o=>{i(o),o&&l(!0),c()},this.handleAmountModeChange=o=>{const e=o===w;l(e),e||(this.customAmountInput=""),c()},this.handleCustomAmountChange=o=>{this.customAmountInput=o,d.error=null},this.handleApplyCustomAmount=()=>{const o=parseFloat(this.customAmountInput);!isNaN(o)&&o>0?m(o):m(null),d.error||c()}}async componentWillLoad(){await p()}render(){if(!this.enabled)return null;const{colorPrimary:o}=f.appearance,n=y({}),r=d.availableBalance,a=null!==r&&r>0,i=d.isEnabled,l=d.useFullBalance,c=d.error,m=h(),p=u({amount:null!=r?r:0,isForeign:!0});return e(t,{class:"zonos--elements zonos--store-credit",style:{"--zonos--border-radius":n,"--zonos--font-family":x(),"--zonos--primary-color":o}},e("div",{class:"zonos--store-credit-container"},e("div",{class:"zonos--store-credit-header"},e("div",{class:"zonos--store-credit-title-row"},e("div",{class:"zonos--store-credit-title-left"},e("div",{"aria-hidden":"true",class:"zonos--store-credit-title-icon"},e("zonos-icon",{content:k,iconColor:"gray-500",size:22})),e("zonos-text",{type:"semiBoldLabel"},g("Store credit"))),a&&e("div",{class:"zonos--store-credit-balance-badge"},e("zonos-text",{textColor:"gray-600",type:"caption"},p)))),e(s,null,a?e("div",{class:"zonos--store-credit-content"},e("div",{class:"zonos--store-credit-checkbox"},e("zonos-checkbox",{isChecked:i,label:g("Use store credit"),onCheckboxSelected:o=>this.handleUseStoreCreditChange(o.detail),size:16})),i&&e("div",{class:"zonos--store-credit-options"},e("div",{class:"zonos--store-credit-toggle-row"},e("zonos-toggle",{onToggleChanged:o=>this.handleAmountModeChange(o.detail),options:[{label:g("Apply full balance"),value:w},{label:g("Enter amount"),value:C}],value:l?w:C})),!l&&e("div",{class:"zonos--store-credit-custom-amount"},e("div",{class:"zonos--store-credit-custom-amount-row"},e("zonos-input",{inputLabel:g("Enter amount"),inputValue:this.customAmountInput,isError:!!c,onInputChange:o=>this.handleCustomAmountChange(o.detail)}),e("zonos-button",{onClick:this.handleApplyCustomAmount,size:"sm",variant:"primary"},g("Apply")))),c&&e("div",{class:"zonos--store-credit-error"},e("zonos-text",{textColor:"red-600",type:"caption"},c)),e("div",{class:"zonos--store-credit-summary"},e("zonos-text",{textColor:"gray-800",type:"semiBoldLabel"},g("Amount to apply: [amount]",{amount:u({amount:m,isForeign:!0})}))))):e("div",{class:"zonos--store-credit-empty"},e("div",{"aria-hidden":"true",class:"zonos--store-credit-empty-icon"},e("zonos-icon",{content:k,iconColor:"gray-500",size:28})),e("zonos-text",{textColor:"gray-600",type:"caption"},g("No store credit available"))))))}get el(){return n(this)}};j.style=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:block;margin-bottom:var(--zonos-elements-font-size-xl)}:host .zonos--store-credit-container{background:-webkit-gradient(linear, left top, left bottom, from(var(--zonos-elements-gray-0)), to(var(--zonos-elements-gray-50)));background:linear-gradient(180deg, var(--zonos-elements-gray-0) 0%, var(--zonos-elements-gray-50) 100%);border:1px solid var(--zonos-elements-gray-200);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-8));-webkit-box-shadow:var(--zonos-elements-v3-shadow-base);box-shadow:var(--zonos-elements-v3-shadow-base);overflow:hidden;padding:0;position:relative}:host .zonos--store-credit-container::before{background:var(--zonos--primary-color, var(--zonos-elements-gray-400));content:"";height:3px;left:0;position:absolute;right:0;top:0}:host .zonos--store-credit-header{padding:var(--zonos-elements-radius-12) var(--zonos-elements-font-size-l) 0}:host .zonos--store-credit-title-row{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .zonos--store-credit-title-left{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-title-icon{-ms-flex-align:center;align-items:center;background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 14%, transparent);border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.75);display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;height:22px;-ms-flex-pack:center;justify-content:center;width:22px}:host .zonos--store-credit-balance-badge{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 8%, var(--zonos-elements-gray-50));border:1px solid color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 22%, var(--zonos-elements-gray-200));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:2px var(--zonos-elements-font-size-s)}:host .zonos--store-credit-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-s) var(--zonos-elements-font-size-l) var(--zonos-elements-radius-12)}:host .zonos--store-credit-checkbox{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex}:host .zonos--store-credit-options{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-toggle-row{display:-ms-flexbox;display:flex}:host .zonos--store-credit-custom-amount{max-width:240px}:host .zonos--store-credit-custom-amount-row{-ms-flex-align:end;align-items:flex-end;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-custom-amount-row zonos-input{-ms-flex:1;flex:1}:host .zonos--store-credit-error{margin-top:2px}:host .zonos--store-credit-summary{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 6%, var(--zonos-elements-gray-50));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:var(--zonos-elements-radius-10) var(--zonos-elements-font-size-s)}:host .zonos--store-credit-empty{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-xl) var(--zonos-elements-font-size-l) 22px;text-align:center}:host .zonos--store-credit-empty-icon{-ms-flex-align:center;align-items:center;background:var(--zonos-elements-gray-100);border-radius:50%;display:-ms-flexbox;display:flex;height:52px;-ms-flex-pack:center;justify-content:center;opacity:0.95;width:52px}';export{b as zonos_policy_consent,j as zonos_store_credit}
|