var e,t="https://js.stripe.com/v3",r=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,n="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",o=function(e){var r=document.createElement("script");r.src="".concat(t).concat("");var n=document.head||document.body;if(!n)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(r),r},i=null,a=null,u=null,c=function(e){return null!==i?i:(i=new Promise((function(i,c){if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(n),window.Stripe)i(window.Stripe);else try{var s=function(){for(var e=document.querySelectorAll('script[src^="'.concat(t,'"]')),n=0;n<e.length;n++){var o=e[n];if(r.test(o.src))return o}return null}();if(s&&e)console.warn(n);else if(s){if(s&&null!==u&&null!==a){var l;s.removeEventListener("load",u),s.removeEventListener("error",a),null===(l=s.parentNode)||void 0===l||l.removeChild(s),s=o()}}else s=o();u=function(e,t){return function(){window.Stripe?e(window.Stripe):t(new Error("Stripe.js not available"))}}(i,c),a=function(e){return function(){e(new Error("Failed to load Stripe.js?v=1763625242172"))}}(c),s.addEventListener("load",u),s.addEventListener("error",a)}catch(d){return void c(d)}else i(null)}))).catch((function(e){return i=null,Promise.reject(e)}))},s=!1,l=function(){return e||(e=c(null).catch((function(t){return e=null,Promise.reject(t)})))};Promise.resolve().then((function(){return l()})).catch((function(e){s||console.warn(e)}));var d=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s=!0;var n=Date.now();return l().then((function(e){return function(e,t,r){if(null===e)return null;var n=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"3.4.1",startTime:t})}(n,r),n}(e,t,n)}))};
/*!
 * paypal-js v8.1.2 (2024-09-16T17:52:36.940Z)
 * Copyright 2020-present, PayPal, Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */function f(e){var t="";return Object.keys(e).forEach((function(r){0!==t.length&&(t+="&"),t+=r+"="+e[r]})),t}function p(e,t){void 0===t&&(t={});var r=document.createElement("script");return r.src=e,Object.keys(t).forEach((function(e){r.setAttribute(e,t[e]),"data-csp-nonce"===e&&r.setAttribute("nonce",t["data-csp-nonce"])})),r}function v(e,t){if(void 0===t&&(t=Promise),w(e,t),"undefined"==typeof document)return t.resolve(null);var r=function(e){var t="sandbox"===e.environment?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete e.environment,e.sdkBaseUrl&&(t=e.sdkBaseUrl,delete e.sdkBaseUrl);var r=e,n=Object.keys(r).filter((function(e){return void 0!==r[e]&&null!==r[e]&&""!==r[e]})).reduce((function(e,t){var n,o=r[t].toString();return n=function(e,t){return(t?"-":"")+e.toLowerCase()},"data"===(t=t.replace(/[A-Z]+(?![a-z])|[A-Z]/g,n)).substring(0,4)||"crossorigin"===t?e.attributes[t]=o:e.queryParams[t]=o,e}),{queryParams:{},attributes:{}}),o=n.queryParams,i=n.attributes;return o["merchant-id"]&&-1!==o["merchant-id"].indexOf(",")&&(i["data-merchant-id"]=o["merchant-id"],o["merchant-id"]="*"),{url:"".concat(t,"?").concat(f(o)),attributes:i}}(e),n=r.url,o=r.attributes,i=o["data-namespace"]||"paypal",a=m(i);return o["data-js-sdk-library"]||(o["data-js-sdk-library"]="paypal-js"),function(e,t){var r=document.querySelector('script[src="'.concat(e,'"]'));if(null===r)return null;var n=p(e,t),o=r.cloneNode();if(delete o.dataset.uidAuto,Object.keys(o.dataset).length!==Object.keys(n.dataset).length)return null;var i=!0;return Object.keys(o.dataset).forEach((function(e){o.dataset[e]!==n.dataset[e]&&(i=!1)})),i?r:null}(n,o)&&a?t.resolve(a):function(e,t){void 0===t&&(t=Promise);w(e,t);var r=e.url,n=e.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 t((function(e,t){if("undefined"==typeof document)return e();!function(e){var t=e.url,r=e.attributes,n=e.onSuccess,o=e.onError,i=p(t,r);i.onerror=o,i.onload=n,document.head.insertBefore(i,document.head.firstElementChild)}({url:r,attributes:n,onSuccess:function(){return e()},onError:function(){var e=new Error('The script "'.concat(r,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return t(e)}})}))}({url:n,attributes:o},t).then((function(){var e=m(i);if(e)return e;throw new Error("The window.".concat(i," global variable is not available."))}))}function m(e){return window[e]}function w(e,t){if("object"!=typeof e||null===e)throw new Error("Expected an options object.");var r=e.environment;if(r&&"production"!==r&&"sandbox"!==r)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==t&&"function"!=typeof t)throw new Error("Expected PromisePonyfill to be a function.")}export{d as a,v as l};
