@zonos/elements 1.3.75 → 1.3.77
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-6dd9e3cd.js → cart-307b8dc7.js} +23 -17
- package/dist/cjs/{createCustomEvent-4efb5ab7.js → createCustomEvent-8b7e430f.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{paypal-f0d2a8cf.js → paypal-f0e6424f.js} +1 -1
- package/dist/cjs/zonos-address_8.cjs.entry.js +1 -1
- package/dist/cjs/zonos-badge_13.cjs.entry.js +3 -3
- package/dist/cjs/zonos-checkout.cjs.entry.js +10 -8
- package/dist/cjs/zonos-controller.cjs.entry.js +3 -3
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_3.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +9 -7
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +1 -1
- package/dist/collection/components/common/zonos-button/zonos-button.js +4 -4
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +2 -2
- package/dist/collection/components/common/zonos-country-flag/zonos-country-flag.js +2 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +2 -2
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +4 -4
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +2 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +2 -2
- package/dist/collection/components/main/zonos-controller.js +4 -4
- package/dist/collection/components/store/checkout/cart.js +4 -4
- package/dist/collection/components/store/checkout/stripe.js +6 -6
- package/dist/collection/components/store/hello/localization.js +11 -5
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +1 -1
- package/dist/collection/components/utils/checkout/{buildTranslateRequestBody.js → buildTranslateRequest.js} +2 -2
- package/dist/collection/types/checkout/api/CalculateLandedCost.js +1 -0
- package/dist/collection/types/checkout/api/CheckoutSession.js +1 -0
- package/dist/collection/types/checkout/api/Paypal.js +1 -0
- package/dist/collection/types/checkout/api/ValidateAddress.js +1 -0
- package/dist/collection/types/generated/{graphql.customer.types.js → graphql.internal.types.js} +8 -0
- package/dist/collection/types/index.js +9 -1
- package/dist/esm/{cart-66d17f99.js → cart-0345943b.js} +23 -17
- package/dist/esm/{createCustomEvent-4ac32a26.js → createCustomEvent-11fa43d2.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{paypal-3e2c7b41.js → paypal-7592a690.js} +1 -1
- package/dist/esm/zonos-address_8.entry.js +1 -1
- package/dist/esm/zonos-badge_13.entry.js +3 -3
- package/dist/esm/zonos-checkout.entry.js +10 -8
- package/dist/esm/zonos-controller.entry.js +3 -3
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_3.entry.js +2 -2
- package/dist/esm-es5/{cart-66d17f99.js → cart-0345943b.js} +1 -1
- package/dist/esm-es5/{createCustomEvent-4ac32a26.js → createCustomEvent-11fa43d2.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-3e2c7b41.js → paypal-7592a690.js} +1 -1
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- 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-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/scripts/index.d.ts +51 -50
- 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/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.d.ts +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +2 -2
- package/dist/types/components/common/zonos-button/zonos-button.d.ts +1 -1
- package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +1 -1
- package/dist/types/components/common/zonos-country-flag/zonos-country-flag.d.ts +1 -1
- package/dist/types/components/common/zonos-dialog/zonos-dialog.d.ts +1 -1
- package/dist/types/components/common/zonos-logo/zonos-logo.d.ts +1 -1
- package/dist/types/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.d.ts +1 -1
- package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +1 -1
- package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +1 -1
- package/dist/types/components/main/zonos-controller.d.ts +1 -1
- package/dist/types/components/store/checkout/cart.d.ts +8 -8
- package/dist/types/components/store/checkout/paypal.d.ts +1 -1
- package/dist/types/components/store/checkout/stripe.d.ts +3 -15
- package/dist/types/components/store/hello/localization.d.ts +1 -1
- package/dist/types/components/store/zonosStore.d.ts +1 -1
- package/dist/types/components/utils/api/calculateLandedCost.d.ts +1 -1
- package/dist/types/components/utils/api/calculateLandedCostNormalized.d.ts +1 -1
- package/dist/types/components/utils/api/cartCalculateLandedCost.d.ts +1 -1
- package/dist/types/components/utils/api/checkItemRestrictions.d.ts +4 -13
- package/dist/types/components/utils/api/getInclusivePricing.d.ts +1 -1
- package/dist/types/components/utils/api/getShippingZones.d.ts +1 -1
- package/dist/types/components/utils/api/getZonosSettings.d.ts +1 -1
- package/dist/types/components/utils/api/paypalCaptureOrder.d.ts +3 -7
- package/dist/types/components/utils/api/paypalCreateOrder.d.ts +3 -6
- package/dist/types/components/utils/api/prepCalculateLandedCost.d.ts +1 -1
- package/dist/types/components/utils/api/trackConversionEvent.d.ts +1 -2
- package/dist/types/components/utils/api/triggerBuildLandedCost.d.ts +2 -2
- package/dist/types/components/utils/checkout/{buildTranslateRequestBody.d.ts → buildTranslateRequest.d.ts} +3 -3
- package/dist/types/components/utils/getBorderRadius.d.ts +1 -1
- package/dist/types/components/utils/hello/currencyConversion/currencyFormat.d.ts +1 -1
- package/dist/types/components/utils/hello/currencyConversion/getCurrencyCode.d.ts +1 -1
- package/dist/types/components/utils/hello/currencyConversion/numberFormat.d.ts +1 -1
- package/dist/types/components/utils/hello/detectItemRestrictions.d.ts +2 -2
- package/dist/types/components/utils/hello/initHello.d.ts +1 -1
- package/dist/types/components/utils/logging/sendLoadScriptLog.d.ts +2 -2
- package/dist/types/components.d.ts +2 -2
- package/dist/types/scripts/_zonosBase.d.ts +1 -1
- package/dist/types/scripts/cart/_setupCartData.d.ts +1 -1
- package/dist/types/styles/stripe/addressRuleStyle.d.ts +1 -1
- package/dist/types/styles/stripe/defaultVariable.d.ts +1 -1
- package/dist/types/types/ConversionEvent.d.ts +12 -0
- package/dist/types/types/ICountryJson.d.ts +1 -1
- package/dist/types/types/{LogErrorRequestBody.d.ts → LogError.d.ts} +1 -1
- package/dist/types/types/{LogLoadScriptRequestBody.d.ts → LogLoadScript.d.ts} +1 -1
- package/dist/types/types/Version.d.ts +12 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +1 -1
- package/dist/types/types/checkout/TranslatedText.d.ts +1 -1
- package/dist/types/types/checkout/api/{CalculateLandedCostRequest.d.ts → CalculateLandedCost.d.ts} +12 -11
- package/dist/types/types/checkout/api/CheckoutSession.d.ts +30 -0
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +1 -1
- package/dist/types/types/checkout/api/Paypal.d.ts +8 -0
- package/dist/types/types/checkout/api/{ValidateAddressRequest.d.ts → ValidateAddress.d.ts} +2 -2
- package/dist/types/types/generated/{graphql.customer.types.d.ts → graphql.internal.types.d.ts} +10 -0
- package/dist/types/types/generated/{graphql.customer.types.ts → graphql.internal.types.ts} +14 -0
- package/dist/types/types/hello/HelloConfig.d.ts +1 -1
- package/dist/types/types/hello/RestrictedItem.d.ts +10 -1
- package/dist/types/types/index.d.ts +9 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-05001ce2.entry.js +1 -0
- package/dist/zonos-elements/{p-c86fa519.system.js → p-2f9e087c.system.js} +1 -1
- package/dist/zonos-elements/{p-3088517c.system.js → p-320e3627.system.js} +2 -2
- package/dist/zonos-elements/{p-0d719ad2.system.js → p-3b78b5db.system.js} +1 -1
- package/dist/zonos-elements/{p-325233e3.js → p-4e21f719.js} +2 -2
- package/dist/zonos-elements/{p-432a5555.system.entry.js → p-514b94ec.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6488e805.system.entry.js → p-54d31641.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-01a8ec15.system.entry.js → p-55020546.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ea340dbf.entry.js → p-70acd15f.entry.js} +1 -1
- package/dist/zonos-elements/{p-dbbf8d3e.system.js → p-71382e47.system.js} +1 -1
- package/dist/zonos-elements/{p-ffaef730.js → p-76b9668f.js} +1 -1
- package/dist/zonos-elements/{p-bc803391.system.entry.js → p-78abda17.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d0ae7ede.system.entry.js → p-794b932c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b6e58c30.js → p-8478f4ee.js} +1 -1
- package/dist/zonos-elements/{p-0a411ee0.system.entry.js → p-8915c7ff.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1b101d0f.entry.js → p-94d92a0b.entry.js} +1 -1
- package/dist/zonos-elements/{p-0819aa2d.system.entry.js → p-9a88fb19.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-882d2619.entry.js → p-a57f0556.entry.js} +1 -1
- package/dist/zonos-elements/{p-3ec5cfe1.entry.js → p-be6c49ec.entry.js} +1 -1
- package/dist/zonos-elements/{p-438ac9d0.entry.js → p-c6e90e75.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-b362e3c9.entry.js → p-cab296cc.entry.js} +1 -1
- package/dist/zonos-elements/{p-72345655.entry.js → p-cf61027a.entry.js} +1 -1
- package/dist/zonos-elements/{p-999c1c0b.entry.js → p-dc430b34.entry.js} +1 -1
- package/dist/zonos-elements/{p-bad47d15.system.entry.js → p-e3068a5f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ac3cd38e.system.entry.js → p-eacd1669.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a6223def.system.entry.js → p-f7965bc8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ea124e18.entry.js → p-f8cbd1b8.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +2 -1
- package/dist/zonos-elements/p-913efe84.entry.js +0 -1
- /package/dist/collection/types/{LogErrorRequestBody.js → ConversionEvent.js} +0 -0
- /package/dist/collection/types/{LogLoadScriptRequestBody.js → LogError.js} +0 -0
- /package/dist/collection/types/{checkout/api/CalculateLandedCostRequest.js → LogLoadScript.js} +0 -0
- /package/dist/collection/types/{checkout/api/ValidateAddressRequest.js → Version.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(r,n,e,t){function o(r){return r instanceof e?r:new e((function(n){n(r)}))}return new(e||(e=Promise))((function(e,i){function a(r){try{c(t.next(r))}catch(r){i(r)}}function u(r){try{c(t["throw"](r))}catch(r){i(r)}}function c(r){r.done?e(r.value):o(r.value).then(a,u)}c((t=t.apply(r,n||[])).next())}))};var __generator=this&&this.__generator||function(r,n){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,o,i,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(r){return function(n){return c([r,n])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(e=0)),e)try{if(t=1,o&&(i=u[0]&2?o["return"]:u[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;if(o=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;o=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1];i=u;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(u);break}if(i[2])e.ops.pop();e.trys.pop();continue}u=n.call(r,e)}catch(r){u=[6,r];o=0}finally{t=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-b74ff880.system.js","./p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(r,n,e,t){function o(r){return r instanceof e?r:new e((function(n){n(r)}))}return new(e||(e=Promise))((function(e,i){function a(r){try{c(t.next(r))}catch(r){i(r)}}function u(r){try{c(t["throw"](r))}catch(r){i(r)}}function c(r){r.done?e(r.value):o(r.value).then(a,u)}c((t=t.apply(r,n||[])).next())}))};var __generator=this&&this.__generator||function(r,n){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,o,i,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(r){return function(n){return c([r,n])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(e=0)),e)try{if(t=1,o&&(i=u[0]&2?o["return"]:u[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;if(o=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;o=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1];i=u;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(u);break}if(i[2])e.ops.pop();e.trys.pop();continue}u=n.call(r,e)}catch(r){u=[6,r];o=0}finally{t=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-b74ff880.system.js","./p-71382e47.system.js","./p-c4957e35.system.js","./p-91462d96.system.js"],(function(r){"use strict";var n,e,t,o,i,a,u,c,s,l,d,f;return{setters:[function(r){n=r.z;e=r.c},function(r){t=r.d;o=r.r;i=r.t;a=r.q;u=r.h},function(r){c=r.h;s=r.l;l=r.a;d=r.j},function(r){f=r.t}],execute:function(){var v=this;
|
|
2
2
|
/*!
|
|
3
3
|
* paypal-js v8.1.0 (2024-06-07T16:55:00.122Z)
|
|
4
4
|
* Copyright 2020-present, PayPal, Inc. All rights reserved.
|
|
@@ -14,4 +14,4 @@ var __awaiter=this&&this.__awaiter||function(r,n,e,t){function o(r){return r ins
|
|
|
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 p(r,n){var e=document.querySelector('script[src="'.concat(r,'"]'));if(e===null)return null;var t=_(r,n);var o=e.cloneNode();delete o.dataset.uidAuto;if(Object.keys(o.dataset).length!==Object.keys(t.dataset).length){return null}var i=true;Object.keys(o.dataset).forEach((function(r){if(o.dataset[r]!==t.dataset[r]){i=false}}));return i?e:null}function w(r){var n=r.url,e=r.attributes,t=r.onSuccess,o=r.onError;var i=_(n,e);i.onerror=o;i.onload=t;document.head.insertBefore(i,document.head.firstElementChild)}function h(r){var n=r.environment;var e=n==="sandbox"?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete r.environment;if(r.sdkBaseUrl){e=r.sdkBaseUrl;delete r.sdkBaseUrl}var t=r;var o=Object.keys(t).filter((function(r){return typeof t[r]!=="undefined"&&t[r]!==null&&t[r]!==""})).reduce((function(r,n){var e=t[n].toString();n=y(n);if(n.substring(0,4)==="data"||n==="crossorigin"){r.attributes[n]=e}else{r.queryParams[n]=e}return r}),{queryParams:{},attributes:{}}),i=o.queryParams,a=o.attributes;if(i["merchant-id"]&&i["merchant-id"].indexOf(",")!==-1){a["data-merchant-id"]=i["merchant-id"];i["merchant-id"]="*"}return{url:"".concat(e,"?").concat(b(i)),attributes:a}}function y(r){var n=function(r,n){return(n?"-":"")+r.toLowerCase()};return r.replace(/[A-Z]+(?![a-z])|[A-Z]/g,n)}function b(r){var n="";Object.keys(r).forEach((function(e){if(n.length!==0)n+="&";n+=e+"="+r[e]}));return n}function _(r,n){if(n===void 0){n={}}var e=document.createElement("script");e.src=r;Object.keys(n).forEach((function(r){e.setAttribute(r,n[r]);if(r==="data-csp-nonce"){e.setAttribute("nonce",n["data-csp-nonce"])}}));return e}function g(r,n){if(n===void 0){n=Promise}k(r,n);if(typeof document==="undefined")return n.resolve(null);var e=h(r),t=e.url,o=e.attributes;var i=o["data-namespace"]||"paypal";var a=P(i);if(!o["data-js-sdk-library"]){o["data-js-sdk-library"]="paypal-js"}if(p(t,o)&&a){return n.resolve(a)}return m({url:t,attributes:o},n).then((function(){var r=P(i);if(r){return r}throw new Error("The window.".concat(i," global variable is not available."))}))}function m(r,n){if(n===void 0){n=Promise}k(r,n);var e=r.url,t=r.attributes;if(typeof e!=="string"||e.length===0){throw new Error("Invalid url.")}if(typeof t!=="undefined"&&typeof t!=="object"){throw new Error("Expected attributes to be an object.")}return new n((function(r,n){if(typeof document==="undefined")return r();w({url:e,attributes:t,onSuccess:function(){return r()},onError:function(){var r=new Error('The script "'.concat(e,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return n(r)}})}))}function P(r){return window[r]}function k(r,n){if(typeof r!=="object"||r===null){throw new Error("Expected an options object.")}var e=r.environment;if(e&&e!=="production"&&e!=="sandbox"){throw new Error('The `environment` option must be either "production" or "sandbox".')}if(typeof n!=="undefined"&&typeof n!=="function"){throw new Error("Expected PromisePonyfill to be a function.")}}var j=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t;var o=r.checkoutSessionId,i=r.paypalMockResponse;return __generator(this,(function(r){switch(r.label){case 0:return[4,c("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:o,paypalMockResponse:i},method:"POST"})];case 1:n=r.sent(),e=n.errors,t=n.json;return[2,{errors:e,json:t}]}}))}))};var E=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t;var o=r.checkoutSessionId;return __generator(this,(function(r){switch(r.label){case 0:return[4,c("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:o},method:"POST"})];case 1:n=r.sent(),e=n.errors,t=n.json;return[2,{errors:e,json:t}]}}))}))};var S=r("i",(function(r){var n=r.backgroundColor1,e=r.backgroundColor2;var t=f.readability(n,e);return t>2.5}));var I=r("s",(function(r){var e=n.checkoutSettings.analyticsProviders.find((function(r){return r.type==="GOOGLE_ANALYTICS"}));if(!e||(e===null||e===void 0?void 0:e.status)==="DISABLED"){return}if(typeof window.gtag==="function"){s("Zonos submits gtag event","log",r);window.gtag("event",r,{})}}));var A=e((function(){return{orderIdCreated:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}})),x=A.reset,O=A.state;r({b:x,a:O});var T=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t,o,i,a;var u=r.checkoutSessionId;return __generator(this,(function(r){switch(r.label){case 0:return[4,E({checkoutSessionId:u})];case 1:t=r.sent(),o=t.errors,i=t.json;a=(n=i===null||i===void 0?void 0:i.paypalOrderCreate)===null||n===void 0?void 0:n.paypalOrderId;if(o.length||!a){throw new Error(((e=o.find(Boolean))===null||e===void 0?void 0:e.message)||"An unexpected error occurred when creating paypal order.")}return[2,a]}}))}))};var L=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t,o,a,u;var c=r.checkoutSessionId,s=r.paypalMockResponse;return __generator(this,(function(r){switch(r.label){case 0:new URL(window.location.href);return[4,j({checkoutSessionId:c,paypalMockResponse:s})];case 1:t=r.sent(),o=t.errors,a=t.json;u=(n=a===null||a===void 0?void 0:a.paypalOrderCapture.order)===null||n===void 0?void 0:n.id;if(o.length||!u){throw new Error(((e=o.find(Boolean))===null||e===void 0?void 0:e.message)||i("An unexpected error occurred when processing PayPal order."))}return[2,u]}}))}))};var B=function(r){var n=r.error;var e;var t=
|
|
17
|
+
*/function p(r,n){var e=document.querySelector('script[src="'.concat(r,'"]'));if(e===null)return null;var t=_(r,n);var o=e.cloneNode();delete o.dataset.uidAuto;if(Object.keys(o.dataset).length!==Object.keys(t.dataset).length){return null}var i=true;Object.keys(o.dataset).forEach((function(r){if(o.dataset[r]!==t.dataset[r]){i=false}}));return i?e:null}function w(r){var n=r.url,e=r.attributes,t=r.onSuccess,o=r.onError;var i=_(n,e);i.onerror=o;i.onload=t;document.head.insertBefore(i,document.head.firstElementChild)}function h(r){var n=r.environment;var e=n==="sandbox"?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete r.environment;if(r.sdkBaseUrl){e=r.sdkBaseUrl;delete r.sdkBaseUrl}var t=r;var o=Object.keys(t).filter((function(r){return typeof t[r]!=="undefined"&&t[r]!==null&&t[r]!==""})).reduce((function(r,n){var e=t[n].toString();n=y(n);if(n.substring(0,4)==="data"||n==="crossorigin"){r.attributes[n]=e}else{r.queryParams[n]=e}return r}),{queryParams:{},attributes:{}}),i=o.queryParams,a=o.attributes;if(i["merchant-id"]&&i["merchant-id"].indexOf(",")!==-1){a["data-merchant-id"]=i["merchant-id"];i["merchant-id"]="*"}return{url:"".concat(e,"?").concat(b(i)),attributes:a}}function y(r){var n=function(r,n){return(n?"-":"")+r.toLowerCase()};return r.replace(/[A-Z]+(?![a-z])|[A-Z]/g,n)}function b(r){var n="";Object.keys(r).forEach((function(e){if(n.length!==0)n+="&";n+=e+"="+r[e]}));return n}function _(r,n){if(n===void 0){n={}}var e=document.createElement("script");e.src=r;Object.keys(n).forEach((function(r){e.setAttribute(r,n[r]);if(r==="data-csp-nonce"){e.setAttribute("nonce",n["data-csp-nonce"])}}));return e}function g(r,n){if(n===void 0){n=Promise}k(r,n);if(typeof document==="undefined")return n.resolve(null);var e=h(r),t=e.url,o=e.attributes;var i=o["data-namespace"]||"paypal";var a=P(i);if(!o["data-js-sdk-library"]){o["data-js-sdk-library"]="paypal-js"}if(p(t,o)&&a){return n.resolve(a)}return m({url:t,attributes:o},n).then((function(){var r=P(i);if(r){return r}throw new Error("The window.".concat(i," global variable is not available."))}))}function m(r,n){if(n===void 0){n=Promise}k(r,n);var e=r.url,t=r.attributes;if(typeof e!=="string"||e.length===0){throw new Error("Invalid url.")}if(typeof t!=="undefined"&&typeof t!=="object"){throw new Error("Expected attributes to be an object.")}return new n((function(r,n){if(typeof document==="undefined")return r();w({url:e,attributes:t,onSuccess:function(){return r()},onError:function(){var r=new Error('The script "'.concat(e,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return n(r)}})}))}function P(r){return window[r]}function k(r,n){if(typeof r!=="object"||r===null){throw new Error("Expected an options object.")}var e=r.environment;if(e&&e!=="production"&&e!=="sandbox"){throw new Error('The `environment` option must be either "production" or "sandbox".')}if(typeof n!=="undefined"&&typeof n!=="function"){throw new Error("Expected PromisePonyfill to be a function.")}}var j=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t;var o=r.checkoutSessionId,i=r.paypalMockResponse;return __generator(this,(function(r){switch(r.label){case 0:return[4,c("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:o,paypalMockResponse:i},method:"POST"})];case 1:n=r.sent(),e=n.errors,t=n.json;return[2,{errors:e,json:t}]}}))}))};var E=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t;var o=r.checkoutSessionId;return __generator(this,(function(r){switch(r.label){case 0:return[4,c("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:o},method:"POST"})];case 1:n=r.sent(),e=n.errors,t=n.json;return[2,{errors:e,json:t}]}}))}))};var S=r("i",(function(r){var n=r.backgroundColor1,e=r.backgroundColor2;var t=f.readability(n,e);return t>2.5}));var I=r("s",(function(r){var e=n.checkoutSettings.analyticsProviders.find((function(r){return r.type==="GOOGLE_ANALYTICS"}));if(!e||(e===null||e===void 0?void 0:e.status)==="DISABLED"){return}if(typeof window.gtag==="function"){s("Zonos submits gtag event","log",r);window.gtag("event",r,{})}}));var A=e((function(){return{orderIdCreated:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}})),x=A.reset,O=A.state;r({b:x,a:O});var T=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t,o,i,a;var u=r.checkoutSessionId;return __generator(this,(function(r){switch(r.label){case 0:return[4,E({checkoutSessionId:u})];case 1:t=r.sent(),o=t.errors,i=t.json;a=(n=i===null||i===void 0?void 0:i.paypalOrderCreate)===null||n===void 0?void 0:n.paypalOrderId;if(o.length||!a){throw new Error(((e=o.find(Boolean))===null||e===void 0?void 0:e.message)||"An unexpected error occurred when creating paypal order.")}return[2,a]}}))}))};var L=function(r){return __awaiter(v,[r],void 0,(function(r){var n,e,t,o,a,u;var c=r.checkoutSessionId,s=r.paypalMockResponse;return __generator(this,(function(r){switch(r.label){case 0:new URL(window.location.href);return[4,j({checkoutSessionId:c,paypalMockResponse:s})];case 1:t=r.sent(),o=t.errors,a=t.json;u=(n=a===null||a===void 0?void 0:a.paypalOrderCapture.order)===null||n===void 0?void 0:n.id;if(o.length||!u){throw new Error(((e=o.find(Boolean))===null||e===void 0?void 0:e.message)||i("An unexpected error occurred when processing PayPal order."))}return[2,u]}}))}))};var B=function(r){var n=r.error;var e;var t=d(n.message);var o=(e=t===null||t===void 0?void 0:t.errors.find(Boolean))===null||e===void 0?void 0:e.message;var a=(o===null||o===void 0?void 0:o.match(/\[(.*?)\] (.*)/i))||[];if(!a){O.paypalErrorMessage=i("An unexpected error occurred when processing PayPal order.")}var u=a[2]||i("An unexpected error occurred when processing PayPal order.");O.paypalErrorMessage=u};var C=function(r){var e=r.checkoutSessionId,c=r.onPaypalFail,s=r.onPaypalSessionDone,d=r.overrideBorderRaidus,f=r.overridePrimaryColor;var p=f||n.appearance.colorPrimary;var w="#ffc33a";var h=S({backgroundColor1:w,backgroundColor2:p||""});return{createOrder:function(){return __awaiter(v,void 0,void 0,(function(){var r,n,a,u;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,6,,7]);O.paypalErrorMessage=null;t.inventoryCheckErrorMessage=null;s.label=1;case 1:s.trys.push([1,3,,4]);r=t;return[4,o()];case 2:r.inventoryCheckErrorMessage=s.sent();return[3,4];case 3:n=s.sent();t.inventoryCheckErrorMessage=i("Unable to check inventory. Please try again.");return[3,4];case 4:if(t.inventoryCheckErrorMessage){return[2,""]}return[4,T({checkoutSessionId:e})];case 5:a=s.sent();return[2,a];case 6:u=s.sent();l("Failed to create paypal order",u);O.paypalErrorMessage=i("Failed to create PayPal order. Please try again, or consider using an alternative method.");c===null||c===void 0?void 0:c();return[2,""];case 7:return[2]}}))}))},onApprove:function(r,n){return __awaiter(v,void 0,void 0,(function(){var r,n;return __generator(this,(function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);O.paypalErrorMessage=null;I("zonos-checkout-payment-info");return[4,L({checkoutSessionId:e,paypalMockResponse:window.Zonos._paypalMockResponse})];case 1:r=t.sent();O.orderIdCreated=r;s===null||s===void 0?void 0:s({orderId:r});a();u();return[3,3];case 2:n=t.sent();l("==== Failed to capture paypal order",n);if(n instanceof Error){return[2,B({error:n})]}c===null||c===void 0?void 0:c();return[3,3];case 3:return[2]}}))}))},style:{borderRadius:d==="SHARP"?0:10,color:h?"gold":"blue",shape:"rect"}}};var R=function(){if(!O.paypalButtons.length){return}O.paypalButtons.forEach((function(r){return __awaiter(v,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,r.close()];case 1:n.sent();return[2]}}))}))}));O.paypalButtons=[]};var D=r("p",(function(r){return __awaiter(v,[r],void 0,(function(r){var e,t,o,i,a;var u=r.currency;return __generator(this,(function(r){switch(r.label){case 0:t=!!((e=n.checkoutSettings.externalPaymentMethods)===null||e===void 0?void 0:e.find((function(r){return r.type==="PAYPAL"&&r.status==="ENABLED"})));if(!t){s("=== Paypal is disabled for this store","warn");return[2]}o=n.checkoutSettings.externalServiceTokens.find((function(r){return r.type==="PAYPAL_CLIENT_ID"}));if(!o){s("Failed to load paypal -- missing paypal publishable key","warn");return[2]}i=n.zonosMode==="production"&&n.checkoutSettings.mode==="LIVE"?"production":"sandbox";a=window.Zonos;return[4,g({clientId:o.token,currency:u,environment:i})];case 1:a.paypal=r.sent();s("==== Paypal script loaded");return[2]}}))}))}));var F=r("d",(function(r){var n;var e=window.Zonos.paypal;if(!e){s("Paypal is not available");return null}var o=t.checkoutSessionId;if(!o){s("Paypal is not available due to checkoutSessionId is not available");return null}s("==== Loading Paypal buttons");R();var i=[(n=e.FUNDING)===null||n===void 0?void 0:n.PAYPAL].filter(Boolean);O.paypalButtons=i.map((function(n){var t;var i=null;try{i=((t=e.Buttons)===null||t===void 0?void 0:t.call(e,Object.assign(Object.assign({},C(Object.assign({checkoutSessionId:o,fundingSource:n},r))),{fundingSource:n})))||null}catch(r){s("===== Failed to load paypal's \"".concat(n,'" button'),"warn",r)}if(i===null||i===void 0?void 0:i.isEligible()){s("==== Paypal button ".concat(n," loaded"));return i}return null})).filter(Boolean);return O.paypalButtons}));var z=r("c",(function(){return!!O.paypalButtons.length}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(n,t,e,r){function i(n){return n instanceof e?n:new e((function(t){t(n)}))}return new(e||(e=Promise))((function(e,o){function u(n){try{a(r.next(n))}catch(n){o(n)}}function c(n){try{a(r["throw"](n))}catch(n){o(n)}}function a(n){n.done?e(n.value):i(n.value).then(u,c)}a((r=r.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(n){return function(t){return a([n,t])}}function a(c){if(r)throw new TypeError("Generator is already executing.");while(u&&(u=0,c[0]&&(e=0)),e)try{if(r=1,i&&(o=c[0]&2?i["return"]:c[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;if(i=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:e.label++;return{value:c[1],done:false};case 5:e.label++;i=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){e.label=c[1];break}if(c[0]===6&&e.label<o[1]){e.label=o[1];o=c;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(c);break}if(o[2])e.ops.pop();e.trys.pop();continue}c=t.call(n,e)}catch(n){c=[6,n];i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};System.register(["./p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(n,t,e,r){function i(n){return n instanceof e?n:new e((function(t){t(n)}))}return new(e||(e=Promise))((function(e,o){function u(n){try{a(r.next(n))}catch(n){o(n)}}function c(n){try{a(r["throw"](n))}catch(n){o(n)}}function a(n){n.done?e(n.value):i(n.value).then(u,c)}a((r=r.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(n){return function(t){return a([n,t])}}function a(c){if(r)throw new TypeError("Generator is already executing.");while(u&&(u=0,c[0]&&(e=0)),e)try{if(r=1,i&&(o=c[0]&2?i["return"]:c[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;if(i=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:e.label++;return{value:c[1],done:false};case 5:e.label++;i=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){e.label=c[1];break}if(c[0]===6&&e.label<o[1]){e.label=o[1];o=c;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(c);break}if(o[2])e.ops.pop();e.trys.pop();continue}c=t.call(n,e)}catch(n){c=[6,n];i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};System.register(["./p-71382e47.system.js","./p-b74ff880.system.js","./p-c4957e35.system.js"],(function(n){"use strict";var t,e,r,i;return{setters:[function(n){t=n.d;e=n.l},function(n){r=n.z},function(n){i=n.h}],execute:function(){var o=this;var u=n("t",(function(n,u){return __awaiter(o,void 0,void 0,(function(){var o,c,a,s,f,d,v;return __generator(this,(function(w){switch(w.label){case 0:a=window.location.href.includes("zonos.com")||window.location.href.includes("checkout.iglobalstores.com")||!!((o=window.Zonos)===null||o===void 0?void 0:o.zonosQaUrl)||!!((c=window.Zonos)===null||c===void 0?void 0:c.debug);if(a&&!window.Zonos.zonosConversionTest){return[2]}s=e.selectedCountryCode;f=r.organizationId;d=t.checkoutSessionId;if(!d){return[2]}v={checkoutSessionId:d,countryCode:s,eventName:n,metadata:u,organizationId:f};return[4,i("/api/zonos-elements/track-conversion-event",{body:v,method:"POST"})];case 1:w.sent();return[2]}}))}))}));var c=n("g",(function(){var n;return(n=window.Zonos.zonosApiKey)===null||n===void 0?void 0:n.includes("test")}));var a=n("c",(function(n,t){return new CustomEvent(n,{detail:t})}))}}}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{z as o,c as e}from"./p-1086aac3.js";import{d as r,r as n,t,q as a,h as i}from"./p-
|
|
1
|
+
import{z as o,c as e}from"./p-1086aac3.js";import{d as r,r as n,t,q as a,h as i}from"./p-76b9668f.js";import{h as s,l as c,a as l,j as u}from"./p-2ec2e9d3.js";import{t as d}from"./p-a1b755bf.js";
|
|
2
2
|
/*!
|
|
3
3
|
* paypal-js v8.1.0 (2024-06-07T16:55:00.122Z)
|
|
4
4
|
* Copyright 2020-present, PayPal, Inc. All rights reserved.
|
|
@@ -14,4 +14,4 @@ import{z as o,c as e}from"./p-1086aac3.js";import{d as r,r as n,t,q as a,h as i}
|
|
|
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 p(o,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=o,Object.keys(e).forEach((function(o){r.setAttribute(o,e[o]),"data-csp-nonce"===o&&r.setAttribute("nonce",e["data-csp-nonce"])})),r}function y(o){return window[o]}function
|
|
17
|
+
*/function p(o,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=o,Object.keys(e).forEach((function(o){r.setAttribute(o,e[o]),"data-csp-nonce"===o&&r.setAttribute("nonce",e["data-csp-nonce"])})),r}function y(o){return window[o]}function v(o,e){if("object"!=typeof o||null===o)throw new Error("Expected an options object.");var r=o.environment;if(r&&"production"!==r&&"sandbox"!==r)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}const f=({backgroundColor1:o,backgroundColor2:e})=>d.readability(o,e)>2.5,w=e=>{const r=o.checkoutSettings.analyticsProviders.find((o=>"GOOGLE_ANALYTICS"===o.type));r&&"DISABLED"!==(null==r?void 0:r.status)&&"function"==typeof window.gtag&&(c("Zonos submits gtag event","log",e),window.gtag("event",e,{}))},{reset:b,state:h}=e((()=>({orderIdCreated:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}))),m=({checkoutSessionId:e,onPaypalFail:c,onPaypalSessionDone:d,overrideBorderRaidus:p,overridePrimaryColor:y})=>({createOrder:async()=>{try{h.paypalErrorMessage=null,r.inventoryCheckErrorMessage=null;try{r.inventoryCheckErrorMessage=await n()}catch(o){r.inventoryCheckErrorMessage=t("Unable to check inventory. Please try again.")}return r.inventoryCheckErrorMessage?"":await(async({checkoutSessionId:o})=>{var e,r;const{errors:n,json:t}=await(async({checkoutSessionId:o})=>{const{errors:e,json:r}=await s("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:o},method:"POST"});return{errors:e,json:r}})({checkoutSessionId:o}),a=null===(e=null==t?void 0:t.paypalOrderCreate)||void 0===e?void 0:e.paypalOrderId;if(n.length||!a)throw new Error((null===(r=n.find(Boolean))||void 0===r?void 0:r.message)||"An unexpected error occurred when creating paypal order.");return a})({checkoutSessionId:e})}catch(o){return l("Failed to create paypal order",o),h.paypalErrorMessage=t("Failed to create PayPal order. Please try again, or consider using an alternative method."),null==c||c(),""}},onApprove:async()=>{try{h.paypalErrorMessage=null,w("zonos-checkout-payment-info");const o=await(async({checkoutSessionId:o,paypalMockResponse:e})=>{var r,n;new URL(window.location.href);const{errors:a,json:i}=await(async({checkoutSessionId:o,paypalMockResponse:e})=>{const{errors:r,json:n}=await s("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:o,paypalMockResponse:e},method:"POST"});return{errors:r,json:n}})({checkoutSessionId:o,paypalMockResponse:e}),c=null===(r=null==i?void 0:i.paypalOrderCapture.order)||void 0===r?void 0:r.id;if(a.length||!c)throw new Error((null===(n=a.find(Boolean))||void 0===n?void 0:n.message)||t("An unexpected error occurred when processing PayPal order."));return c})({checkoutSessionId:e,paypalMockResponse:window.Zonos._paypalMockResponse});h.orderIdCreated=o,null==d||d({orderId:o}),a(),i()}catch(o){if(l("==== Failed to capture paypal order",o),o instanceof Error)return(({error:o})=>{var e;const r=u(o.message),n=null===(e=null==r?void 0:r.errors.find(Boolean))||void 0===e?void 0:e.message,a=(null==n?void 0:n.match(/\[(.*?)\] (.*)/i))||[];a||(h.paypalErrorMessage=t("An unexpected error occurred when processing PayPal order."));const i=a[2]||t("An unexpected error occurred when processing PayPal order.");h.paypalErrorMessage=i})({error:o});null==c||c()}},style:{borderRadius:"SHARP"===p?0:10,color:f({backgroundColor1:"#ffc33a",backgroundColor2:y||o.appearance.colorPrimary||""})?"gold":"blue",shape:"rect"}}),P=async({currency:e})=>{var r;if(!(null===(r=o.checkoutSettings.externalPaymentMethods)||void 0===r?void 0:r.find((o=>"PAYPAL"===o.type&&"ENABLED"===o.status))))return void c("=== Paypal is disabled for this store","warn");const n=o.checkoutSettings.externalServiceTokens.find((o=>"PAYPAL_CLIENT_ID"===o.type));if(!n)return void c("Failed to load paypal -- missing paypal publishable key","warn");const t="production"===o.zonosMode&&"LIVE"===o.checkoutSettings.mode?"production":"sandbox";window.Zonos.paypal=await function(o,e){if(void 0===e&&(e=Promise),v(o,e),"undefined"==typeof document)return e.resolve(null);var r=function(o){var e="sandbox"===o.environment?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete o.environment,o.sdkBaseUrl&&(e=o.sdkBaseUrl,delete o.sdkBaseUrl);var r,n,t=o,a=Object.keys(t).filter((function(o){return null!=t[o]&&""!==t[o]})).reduce((function(o,e){var r=t[e].toString();return"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(o,e){return(e?"-":"")+o.toLowerCase()}))).substring(0,4)||"crossorigin"===e?o.attributes[e]=r:o.queryParams[e]=r,o}),{queryParams:{},attributes:{}}),i=a.queryParams,s=a.attributes;return i["merchant-id"]&&-1!==i["merchant-id"].indexOf(",")&&(s["data-merchant-id"]=i["merchant-id"],i["merchant-id"]="*"),{url:"".concat(e,"?").concat((r=i,n="",Object.keys(r).forEach((function(o){0!==n.length&&(n+="&"),n+=o+"="+r[o]})),n)),attributes:s}}(o),n=r.url,t=r.attributes,a=t["data-namespace"]||"paypal",i=y(a);return t["data-js-sdk-library"]||(t["data-js-sdk-library"]="paypal-js"),function(o,e){var r=document.querySelector('script[src="'.concat(o,'"]'));if(null===r)return null;var n=p(o,e),t=r.cloneNode();if(delete t.dataset.uidAuto,Object.keys(t.dataset).length!==Object.keys(n.dataset).length)return null;var a=!0;return Object.keys(t.dataset).forEach((function(o){t.dataset[o]!==n.dataset[o]&&(a=!1)})),a?r:null}(n,t)&&i?e.resolve(i):function(o,e){void 0===e&&(e=Promise),v(o,e);var r=o.url,n=o.attributes;if("string"!=typeof r||0===r.length)throw new Error("Invalid url.");if(void 0!==n&&"object"!=typeof n)throw new Error("Expected attributes to be an object.");return new e((function(o,e){if("undefined"==typeof document)return o();!function(o){var e=o.onSuccess,r=o.onError,n=p(o.url,o.attributes);n.onerror=r,n.onload=e,document.head.insertBefore(n,document.head.firstElementChild)}({url:r,attributes:n,onSuccess:function(){return o()},onError:function(){var o=new Error('The script "'.concat(r,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return e(o)}})}))}({url:n,attributes:t},e).then((function(){var o=y(a);if(o)return o;throw new Error("The window.".concat(a," global variable is not available."))}))}({clientId:n.token,currency:e,environment:t}),c("==== Paypal script loaded")},k=o=>{var e;const n=window.Zonos.paypal;if(!n)return c("Paypal is not available"),null;const t=r.checkoutSessionId;if(!t)return c("Paypal is not available due to checkoutSessionId is not available"),null;c("==== Loading Paypal buttons"),h.paypalButtons.length&&(h.paypalButtons.forEach((async o=>{await o.close()})),h.paypalButtons=[]);const a=[null===(e=n.FUNDING)||void 0===e?void 0:e.PAYPAL].filter(Boolean);return h.paypalButtons=a.map((e=>{var r;let a=null;try{a=(null===(r=n.Buttons)||void 0===r?void 0:r.call(n,Object.assign(Object.assign({},m(Object.assign({checkoutSessionId:t,fundingSource:e},o))),{fundingSource:e})))||null}catch(o){c(`===== Failed to load paypal's "${e}" button`,"warn",o)}return(null==a?void 0:a.isEligible())?(c(`==== Paypal button ${e} loaded`),a):null})).filter(Boolean),h.paypalButtons},j=()=>!!h.paypalButtons.length;export{h as a,b,j as c,k as d,f as i,P as p,w as s}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(n,t,o,e){function a(n){return n instanceof o?n:new o((function(t){t(n)}))}return new(o||(o=Promise))((function(o,s){function i(n){try{c(e.next(n))}catch(n){s(n)}}function r(n){try{c(e["throw"](n))}catch(n){s(n)}}function c(n){n.done?o(n.value):a(n.value).then(i,r)}c((e=e.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},e,a,s,i;return i={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function r(n){return function(t){return c([n,t])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(o=0)),o)try{if(e=1,a&&(s=r[0]&2?a["return"]:r[0]?a["throw"]||((s=a["return"])&&s.call(a),0):a.next)&&!(s=s.call(a,r[1])).done)return s;if(a=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;a=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(r[0]===6&&o.label<s[1]){o.label=s[1];s=r;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(r);break}if(s[2])o.ops.pop();o.trys.pop();continue}r=t.call(n,o)}catch(n){r=[6,n];a=0}finally{e=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(n,t,o){if(o||arguments.length===2)for(var e=0,a=t.length,s;e<a;e++){if(s||!(e in t)){if(!s)s=Array.prototype.slice.call(t,0,e);s[e]=t[e]}}return n.concat(s||Array.prototype.slice.call(t))};System.register(["./p-fd061229.system.js","./p-b74ff880.system.js","./p-23e7c655.system.js","./p-dbbf8d3e.system.js","./p-c4957e35.system.js","./p-3088517c.system.js","./p-91462d96.system.js","./p-455b7545.system.js"],(function(n){"use strict";var t,o,e,a,s,i,r,c,p,f,y;return{setters:[function(n){t=n.r;o=n.h;e=n.H;a=n.d;s=n.c},function(n){i=n.d},function(n){r=n.c},function(n){c=n.j},function(n){p=n.a;f=n.l},function(n){y=n.d},function(){},function(){}],execute:function(){var l=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";var m=l;var h=n("zonos_notification",function(){function n(n){t(this,n);this.notificationArray=[]}n.prototype.showNotification=function(n){return __awaiter(this,void 0,void 0,(function(){var t,o;var e=this;return __generator(this,(function(a){t="id-".concat(Math.random().toString(36).substring(2,9));o=Object.assign(Object.assign({},n),{id:t,timeout:n.timeout||5e3,transitionClass:"",type:n.type||"success"});this.notificationArray=__spreadArray(__spreadArray([],this.notificationArray,true),[o],false);setTimeout((function(){e.updateTransitionClass({id:t,transitionClass:"show"})}),50);setTimeout((function(){e.removeNotification(t)}),o.timeout);return[2]}))}))};n.prototype.updateTransitionClass=function(n){var t=n.id,o=n.transitionClass;this.notificationArray=this.notificationArray.map((function(n){if(n.id===t){return Object.assign(Object.assign({},n),{transitionClass:o})}return n}))};n.prototype.removeNotification=function(n){var t=this;this.updateTransitionClass({id:n,transitionClass:""});setTimeout((function(){t.notificationArray=t.notificationArray.filter((function(t){return t.id!==n}))}),300)};n.prototype.render=function(){var n=this;return o(e,{key:"17c08c90c6c1dfade4e43451c196127a0f53429e",class:r(["zonos--elements zonos--notification"]),style:{"--font-family":i()}},o("div",{key:"6624419d86a5c7518539069dbc5c9d7c08262c75",class:"zonos--notification-items"},this.notificationArray.map((function(t){return o("div",{"aria-hidden":"true",class:r(["zonos--notification-item",t.type,t.transitionClass]),key:t.id,onClick:function(){n.removeNotification(t.id)}},o("zonos-text",{textColor:"gray-0"},t.message))}))))};return n}());h.style=m;var u=".sc-zonos-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}";var z=u;var d=n("zonos_payment",function(){function n(n){t(this,n);this.titleText=undefined;this.stripe=c.stripe;this.stripeElements=c.stripeElements}n.prototype.watchInitStripe=function(){if(!this.stripeElements){return}var n=c.stripePaymentElement||this.stripeElements.create("payment",{layout:"accordion"});var t=this.el.querySelector(".zonos--payment-component");if(!t){p("Cannot find container element for paymentElement");return}n.mount(t);n.on("change",(function(n){c.stripePaymentEventData=n}));c.stripePaymentElement=n};n.prototype.componentDidLoad=function(){this.watchInitStripe()};n.prototype.render=function(){return o(e,{key:"ab601d9a0cc6fe2fee19f45d6321dcc81b418cff",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"27857c99c59e4913fa403ef5b23b5b7d7f32bd45",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"329b5a5617f0c5942b209df1ccf3bfcb4ddabb0c",class:"zonos--payment-component"}),o("div",{key:"7abb08922e9f607314713fc9fa762a3bb8a35b13",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return n}());d.style=z;var b=".sc-zonos-paypal-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";var v=b;var g=n("zonos_paypal_payment",function(){function n(n){t(this,n);this.paypalSessionDone=s(this,"paypalSessionDone",7);this.paypalSessionFail=s(this,"paypalSessionFail",7)}n.prototype.loadPaypal=function(){return __awaiter(this,void 0,void 0,(function(){var n,t;var o=this;return __generator(this,(function(e){if(!window.Zonos.paypal){f("Paypal is not available");return[2]}n=y({onPaypalFail:function(){f("onPaypalFail");o.paypalSessionFail.emit()},onPaypalSessionDone:function(n){var t=n.orderId;f("onPaypalSessionDone","info",{orderId:t});o.paypalSessionDone.emit({orderId:t})}});if(!(n===null||n===void 0?void 0:n.length)){f("There are no paypal buttons available");return[2]}t=this.el.querySelector(".zonos--payment-paypal-container");if(!t){f("Cannot find container element for paypal buttons");return[2]}n.forEach((function(n){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,n.render(t)];case 1:o.sent();return[2]}}))}))}));return[2]}))}))};n.prototype.componentDidLoad=function(){void this.loadPaypal()};n.prototype.render=function(){return o(e,{key:"a09fe5b66b1ac971c10529ecb6213479f2870f08",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"6ba337785b8a90965e0cba05fd62681bc92633fe",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return n}());g.style=v}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(n,t,o,e){function a(n){return n instanceof o?n:new o((function(t){t(n)}))}return new(o||(o=Promise))((function(o,s){function i(n){try{c(e.next(n))}catch(n){s(n)}}function r(n){try{c(e["throw"](n))}catch(n){s(n)}}function c(n){n.done?o(n.value):a(n.value).then(i,r)}c((e=e.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},e,a,s,i;return i={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function r(n){return function(t){return c([n,t])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(o=0)),o)try{if(e=1,a&&(s=r[0]&2?a["return"]:r[0]?a["throw"]||((s=a["return"])&&s.call(a),0):a.next)&&!(s=s.call(a,r[1])).done)return s;if(a=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;a=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(r[0]===6&&o.label<s[1]){o.label=s[1];s=r;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(r);break}if(s[2])o.ops.pop();o.trys.pop();continue}r=t.call(n,o)}catch(n){r=[6,n];a=0}finally{e=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(n,t,o){if(o||arguments.length===2)for(var e=0,a=t.length,s;e<a;e++){if(s||!(e in t)){if(!s)s=Array.prototype.slice.call(t,0,e);s[e]=t[e]}}return n.concat(s||Array.prototype.slice.call(t))};System.register(["./p-fd061229.system.js","./p-b74ff880.system.js","./p-23e7c655.system.js","./p-71382e47.system.js","./p-c4957e35.system.js","./p-320e3627.system.js","./p-91462d96.system.js","./p-455b7545.system.js"],(function(n){"use strict";var t,o,e,a,s,i,r,c,p,f,y;return{setters:[function(n){t=n.r;o=n.h;e=n.H;a=n.d;s=n.c},function(n){i=n.d},function(n){r=n.c},function(n){c=n.j},function(n){p=n.a;f=n.l},function(n){y=n.d},function(){},function(){}],execute:function(){var l=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";var m=l;var h=n("zonos_notification",function(){function n(n){t(this,n);this.notificationArray=[]}n.prototype.showNotification=function(n){return __awaiter(this,void 0,void 0,(function(){var t,o;var e=this;return __generator(this,(function(a){t="id-".concat(Math.random().toString(36).substring(2,9));o=Object.assign(Object.assign({},n),{id:t,timeout:n.timeout||5e3,transitionClass:"",type:n.type||"success"});this.notificationArray=__spreadArray(__spreadArray([],this.notificationArray,true),[o],false);setTimeout((function(){e.updateTransitionClass({id:t,transitionClass:"show"})}),50);setTimeout((function(){e.removeNotification(t)}),o.timeout);return[2]}))}))};n.prototype.updateTransitionClass=function(n){var t=n.id,o=n.transitionClass;this.notificationArray=this.notificationArray.map((function(n){if(n.id===t){return Object.assign(Object.assign({},n),{transitionClass:o})}return n}))};n.prototype.removeNotification=function(n){var t=this;this.updateTransitionClass({id:n,transitionClass:""});setTimeout((function(){t.notificationArray=t.notificationArray.filter((function(t){return t.id!==n}))}),300)};n.prototype.render=function(){var n=this;return o(e,{key:"17c08c90c6c1dfade4e43451c196127a0f53429e",class:r(["zonos--elements zonos--notification"]),style:{"--font-family":i()}},o("div",{key:"6624419d86a5c7518539069dbc5c9d7c08262c75",class:"zonos--notification-items"},this.notificationArray.map((function(t){return o("div",{"aria-hidden":"true",class:r(["zonos--notification-item",t.type,t.transitionClass]),key:t.id,onClick:function(){n.removeNotification(t.id)}},o("zonos-text",{textColor:"gray-0"},t.message))}))))};return n}());h.style=m;var u=".sc-zonos-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}";var z=u;var d=n("zonos_payment",function(){function n(n){t(this,n);this.titleText=undefined;this.stripe=c.stripe;this.stripeElements=c.stripeElements}n.prototype.watchInitStripe=function(){if(!this.stripeElements){return}var n=c.stripePaymentElement||this.stripeElements.create("payment",{layout:"accordion"});var t=this.el.querySelector(".zonos--payment-component");if(!t){p("Cannot find container element for paymentElement");return}n.mount(t);n.on("change",(function(n){c.stripePaymentEventData=n}));c.stripePaymentElement=n};n.prototype.componentDidLoad=function(){this.watchInitStripe()};n.prototype.render=function(){return o(e,{key:"ab601d9a0cc6fe2fee19f45d6321dcc81b418cff",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"27857c99c59e4913fa403ef5b23b5b7d7f32bd45",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"329b5a5617f0c5942b209df1ccf3bfcb4ddabb0c",class:"zonos--payment-component"}),o("div",{key:"7abb08922e9f607314713fc9fa762a3bb8a35b13",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return n}());d.style=z;var b=".sc-zonos-paypal-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";var v=b;var g=n("zonos_paypal_payment",function(){function n(n){t(this,n);this.paypalSessionDone=s(this,"paypalSessionDone",7);this.paypalSessionFail=s(this,"paypalSessionFail",7)}n.prototype.loadPaypal=function(){return __awaiter(this,void 0,void 0,(function(){var n,t;var o=this;return __generator(this,(function(e){if(!window.Zonos.paypal){f("Paypal is not available");return[2]}n=y({onPaypalFail:function(){f("onPaypalFail");o.paypalSessionFail.emit()},onPaypalSessionDone:function(n){var t=n.orderId;f("onPaypalSessionDone","info",{orderId:t});o.paypalSessionDone.emit({orderId:t})}});if(!(n===null||n===void 0?void 0:n.length)){f("There are no paypal buttons available");return[2]}t=this.el.querySelector(".zonos--payment-paypal-container");if(!t){f("Cannot find container element for paypal buttons");return[2]}n.forEach((function(n){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,n.render(t)];case 1:o.sent();return[2]}}))}))}));return[2]}))}))};n.prototype.componentDidLoad=function(){void this.loadPaypal()};n.prototype.render=function(){return o(e,{key:"a09fe5b66b1ac971c10529ecb6213479f2870f08",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"6ba337785b8a90965e0cba05fd62681bc92633fe",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return n}());g.style=v}}}));
|