@atlas-kitchen/adyen-web
Version:
3 lines (2 loc) • 753 B
JavaScript
import o from"../../../utils/Script.js";import s from"../../../core/Errors/AdyenCheckoutError.js";const e="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js";class r{async load(){try{const s=new o(e,"body",{crossOrigin:"anonymous"});return this.sdkLoadingPromise=s.load(),await this.sdkLoadingPromise,window?.ApplePaySession}catch(o){throw new s("SCRIPT_ERROR","ApplePaySDK failed to load",{cause:o})}}isSdkLoaded(){return void 0===this.sdkLoadingPromise?Promise.reject():this.sdkLoadingPromise}constructor(){var o,s,e;e=void 0,(s="sdkLoadingPromise")in(o=this)?Object.defineProperty(o,s,{value:e,enumerable:!0,configurable:!0,writable:!0}):o[s]=e}}export{e as APPLE_PAY_SDK_URL,r as default};
//# sourceMappingURL=ApplePaySdkLoader.js.map