!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function M(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function x(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function q(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function V(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function Q(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function $(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function X(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oe(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ue(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function le(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function pe(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function de(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function he(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _e(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:"absurd";throw new Error(t)},Pe=n(2),Ae=n.n(Pe),Te=window.Promise?Promise:Ae.a,Ie=Te,Re=("function"==typeof Symbol&&Symbol.iterator,function(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:[]}},Ge=function(e){return{error:e,errorType:"full",type:"error"}},We=function(e,t,n){var r=new ke(ze(e,t,n));return Ge(r)},Ke=function(e,t,n){return{expected:e,actual:String(t),options:n,errorType:"mismatch",type:"error"}},Ve=function(e){return function(t,n){return void 0===t?Ye(t):e(t,n)}},Je=function(e,t){return function(n,r){var o=function(e){var t=e.options.path.join(".")||"value";return{error:t+" should be "+e.expected,actual:t+" as "+e.actual}},i=function(e,t,n){return Ge(new ke("Invalid value for "+e+": "+t+". You specified "+n+"."))},a=e(n,r),s=t(n,r);if("error"===a.type&&"error"===s.type){if("mismatch"===a.errorType&&"mismatch"===s.errorType){var c=o(a),u=c.error,l=c.actual,p=o(s),d=p.error,f=p.actual;return i(r.label,u===d?u:u+" or "+d,l===f?l:l+" and "+f)}if("mismatch"===a.errorType){var h=o(a),_=h.error,m=h.actual;return i(r.label,_,m)}if("mismatch"===s.errorType){var y=o(s),v=y.error,b=y.actual;return i(r.label,v,b)}return Ge(a.error)}return"valid"===a.type?a:s}},Qe=function(e,t){return function(n,r){var o=Re(e,function(e){return e===n});if(void 0===o){var i=t?"a recognized string.":"one of the following strings: "+e.join(", ");return Ke(i,n,r)}return Ye(o)}},$e=function(e){return function(t,n){return"string"==typeof t&&0===t.indexOf(e)?Ye(t):Ke("a string starting with "+e,t,n)}},Xe=function(){for(var e=arguments.length,t=Array(e),n=0;ne?Ye(t):Ke("a number greater than "+e,t,n)}},st=function(e){return function(t,n){return"number"==typeof t&&t===parseInt(t,10)&&(!e||t>=0)?Ye(t):Ke(e?"a positive amount in the currency's subunit":"an amount in the currency's subunit",t,n)}},ct=function(e,t){return st(!1)(e,t)},ut=function(e,t){return st(!0)(e,t)},lt=function(e,t){return e&&"object"===(void 0===e?"undefined":He(e))?Ye(e):Ke("an object",e,t)},pt=function(e){return function(t,n){if(Array.isArray(t)){return t.map(function(t,r){return e(t,Ue({},n,{path:[].concat(s(n.path),[String(r)])}))}).reduce(function(e,t){return"error"===e.type?e:"error"===t.type?t:Ye([].concat(s(e.value),[t.value]),[].concat(s(e.warnings),s(t.warnings)))},Ye([]))}return Ke("array",t,n)}},dt=function(e){return function(t){return function(n,r){if(Array.isArray(n)){var o=t(n,r);if("valid"===o.type)for(var i={},a=0;a1&&void 0!==arguments[1]?arguments[1]:null,n=wt(e);return!!n&&n.host!==(t||window.location.host)},St=function(e,t){if("/"===t[0]){var n=wt(e);return n?""+n.origin+t:t}return""+e.replace(/\/[^\/]*$/,"/")+t},kt={CARD_ELEMENT:"CARD_ELEMENT",CONTROLLER:"CONTROLLER",METRICS_CONTROLLER:"METRICS_CONTROLLER",PAYMENT_REQUEST_ELEMENT:"PAYMENT_REQUEST_ELEMENT",PAYMENT_REQUEST_BROWSER:"PAYMENT_REQUEST_BROWSER",PAYMENT_REQUEST_GOOGLE_PAY:"PAYMENT_REQUEST_GOOGLE_PAY",IBAN_ELEMENT:"IBAN_ELEMENT",IDEAL_BANK_ELEMENT:"IDEAL_BANK_ELEMENT",AUTHORIZE_WITH_URL:"AUTHORIZE_WITH_URL",CARDINAL_3DS2:"CARDINAL_3DS2",STRIPE_3DS2_CHALLENGE:"STRIPE_3DS2_CHALLENGE",STRIPE_3DS2_FINGERPRINT:"STRIPE_3DS2_FINGERPRINT",AU_BANK_ACCOUNT_ELEMENT:"AU_BANK_ACCOUNT_ELEMENT",FPX_BANK_ELEMENT:"FPX_BANK_ELEMENT"},Ot=kt,Pt=Object({NODE_ENV:"production",TEST_ENV:!1,SELENIUM_TEST_ENV:!1,PUBLIC_URL:"",RELEASE_VERSION:"f35e1238",STRIPE_JS_API_URL:"https://api.stripe.com/v1/",STRIPE_JS_HOOKS_URL:"https://hooks.stripe.com/",STRIPE_JS_ALLOW_MUTABLE_API_URL:!1,STRIPE_JS_Q_URL:"https://q.stripe.com",STRIPE_JS_ROOT_URL:"https://js.stripe.com/v3/",STRIPE_CHECKOUT_URL:"https://checkout.stripe.com/",STRIPE_JS_SOURCEMAPS:!1,STRIPE_JS_DEBUG_POSTMESSAGE:!1,STRIPE_JS_DEBUG_LOGGER:!0,CARDINAL_INNER_HTML_NAME:"cardinal-inner-155002ad9aabdba5d48242a3dc7e644a.html",THREE_DS_2_FINGERPRINT_HTML_NAME:"three-ds-2-fingerprint-eea9e40406dd464125c4326ae590c239.html",THREE_DS_2_CHALLENGE_HTML_NAME:"three-ds-2-challenge-ed3936feee60310e964c5ea68285db2d.html",AUTHORIZE_WITH_URL_INNER_HTML_NAME:"authorize-with-url-inner-d62b85f13deef26ee25f10ca223d53bd.html",PAYMENT_REQUEST_INNER_GOOGLE_PAY_HTML_NAME:"payment-request-inner-google-pay-310f14965fb1df27807c6dbfcf44c541.html",PAYMENT_REQUEST_INNER_BROWSER_HTML_NAME:"payment-request-inner-browser-e65d56db7c173185680e84082d058c40.html",CONTROLLER_HTML_NAME:"controller-e08d3e8af0bafe4c577856e7edb44f16.html",RECAPTCHA_HTML_NAME:"recaptcha.html",ELEMENTS_INNER_FPX_BANK_HTML_NAME:"elements-inner-fpx-bank.html",ELEMENTS_INNER_AU_BANK_ACCOUNT_HTML_NAME:"elements-inner-au-bank-account-cfedf54eb117a75ba1325c9324fb1cd7.html",ELEMENTS_INNER_PAYMENT_REQUEST_HTML_NAME:"elements-inner-payment-request-071fcb6cb6814b9e91873fad60edb7b4.html",ELEMENTS_INNER_IDEAL_BANK_HTML_NAME:"elements-inner-ideal-bank-350d50dc0584ee50ee569873b7d374da.html",ELEMENTS_INNER_IBAN_HTML_NAME:"elements-inner-iban-15366e5972bedad14255ab5917e4d59d.html",ELEMENTS_INNER_CARD_HTML_NAME:"elements-inner-card-4628156a2301a98c44719b95c58ee407.html",STRIPE_JS_NO_DEMOS:"1",STRIPE_JS_NO_REPORTS:"1"}),At=function(e){return""+(Pt.STRIPE_JS_ROOT_URL||"")+(e||"")},Tt=function(e){switch(e){case"CARD_ELEMENT":return At(Pt.ELEMENTS_INNER_CARD_HTML_NAME);case"CONTROLLER":return At(Pt.CONTROLLER_HTML_NAME);case"METRICS_CONTROLLER":return"https://js.stripe.com/v2/m/outer.html";case"PAYMENT_REQUEST_ELEMENT":return At(Pt.ELEMENTS_INNER_PAYMENT_REQUEST_HTML_NAME);case"PAYMENT_REQUEST_BROWSER":return At(Pt.PAYMENT_REQUEST_INNER_BROWSER_HTML_NAME);case"PAYMENT_REQUEST_GOOGLE_PAY":return At(Pt.PAYMENT_REQUEST_INNER_GOOGLE_PAY_HTML_NAME);case"IBAN_ELEMENT":return At(Pt.ELEMENTS_INNER_IBAN_HTML_NAME);case"IDEAL_BANK_ELEMENT":return At(Pt.ELEMENTS_INNER_IDEAL_BANK_HTML_NAME);case"AUTHORIZE_WITH_URL":return At(Pt.AUTHORIZE_WITH_URL_INNER_HTML_NAME);case"CARDINAL_3DS2":return At(Pt.CARDINAL_INNER_HTML_NAME);case"STRIPE_3DS2_CHALLENGE":return At(Pt.THREE_DS_2_CHALLENGE_HTML_NAME);case"STRIPE_3DS2_FINGERPRINT":return At(Pt.THREE_DS_2_FINGERPRINT_HTML_NAME);case"AU_BANK_ACCOUNT_ELEMENT":return At(Pt.ELEMENTS_INNER_AU_BANK_ACCOUNT_HTML_NAME);case"FPX_BANK_ELEMENT":return At(Pt.ELEMENTS_INNER_FPX_BANK_HTML_NAME);default:return Oe(e)}},It=Tt,Rt={card:"card",cardNumber:"cardNumber",cardExpiry:"cardExpiry",cardCvc:"cardCvc",postalCode:"postalCode",iban:"iban",idealBank:"idealBank",paymentRequestButton:"paymentRequestButton",auBankAccount:"auBankAccount",fpxBank:"fpxBank",idealBankSecondary:"idealBankSecondary",auBankAccountNumber:"auBankAccountNumber",auBsb:"auBsb",fpxBankSecondary:"fpxBankSecondary"},Nt=Rt,Ct={PAYMENT_INTENT:"PAYMENT_INTENT",SETUP_INTENT:"SETUP_INTENT"},jt=Ct,Mt=[Nt.card,Nt.cardNumber,Nt.cardExpiry,Nt.cardCvc,Nt.postalCode],Lt=Mt,Dt=wt("https://js.stripe.com/v3/"),xt=Dt?Dt.origin:"",qt={family:"font-family",src:"src",unicodeRange:"unicode-range",style:"font-style",variant:"font-variant",stretch:"font-stretch",weight:"font-weight",display:"font-display"},Ft=Object.keys(qt).reduce(function(e,t){return e[qt[t]]=t,e},{}),Bt=[Nt.idealBank,Nt.idealBankSecondary,Nt.fpxBank,Nt.fpxBankSecondary],Ut=0,Ht=function(e){return""+e+Ut++},zt=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):"00000000-0000-4000-8000-000000000000".replace(/[08]/g,e)},Yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gt=function e(t,n){var r=[];return Object.keys(t).forEach(function(o){var i=t[o],a=n?n+"["+o+"]":o;if(i&&"object"===(void 0===i?"undefined":Yt(i))){var s=e(i,a);""!==s&&(r=[].concat(c(r),[s]))}else void 0!==i&&null!==i&&(r=[].concat(c(r),[a+"="+encodeURIComponent(String(i))]))}),r.join("&").replace(/%20/g,"+")},Wt=Gt,Kt=n(6),Vt=n.n(Kt),Jt=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),Qt=function(e,t){var n={};t.forEach(function(e){var t=Jt(e,2),r=t[0],o=t[1];r.split(/\s+/).forEach(function(e){e&&(n[e]=n[e]||o)})}),e.className=Vt()(e.className,n)},$t=function(e,t){e.style.cssText=Object.keys(t).map(function(e){return e+": "+t[e]+" !important;"}).join(" ")},Xt=function(e){try{return window.parent.frames[e]}catch(e){return null}},Zt=function(e){if(!document.body)throw new ke("Stripe.js requires that your page has a element.");return e(document.body)},en=Object.assign||function(e){for(var t=1;t1?n-1:0),o=1;o0},this._off=function(e,n){if(n){for(var r=t._callbacks[e],o=void 0,i=0;i element.");this.autoload&&(this.loaded=!0)}},{key:"_createIFrame",value:function(e){var n=yn(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_createIFrame",this).call(this,e);return n.setAttribute("aria-hidden","true"),n.setAttribute("allowpaymentrequest","true"),n.setAttribute("tabIndex","-1"),$t(n,vn),n}}]),t}(_n),gn=bn,wn=function(){function e(e,t){for(var n=0;n=0,r=e.getBoundingClientRect(),o=jn(e),i=r.width>0&&r.height>0&&o&&"hidden"!==o.getPropertyValue("visibility");return n&&i});return n[Ne(n,function(t){return t===e||e.contains(t)})+("previous"===t?-1:1)]},Ln=function(e){var t=[],n=je(document.querySelectorAll("*"),function(n){var r=n.getAttribute("tabindex")||"";e!==n&&(n.tabIndex=-1),t.push({element:n,tabIndex:r})});return Rn(function(){n.then(function(){return je(t,function(e){var t=e.element,n=e.tabIndex;""===n?t.removeAttribute("tabindex"):t.setAttribute("tabindex",n)})})})},Dn=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};e._controllerFrame.send({action:"stripe-controller-report",payload:{event:t,data:n}})},this.warn=function(){for(var t=arguments.length,n=Array(t),r=0;r=0},Br=function(e){function t(){L(this,t);var e=D(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="NetworkError",e.type="network_error",e}return x(t,e),t}(Error),Ur=Br,Hr=Object.assign||function(e){for(var t=1;t4&&void 0!==arguments[4]?arguments[4]:Io,i=Math.max(Io,o);if(window.ApplePaySession){if(To()){if(n&&"https:"!==window.location.protocol)return window.console&&window.console.warn("To test Apple Pay, you must serve this page over HTTPS."),Ie.resolve(!1);if(window.ApplePaySession.supportsVersion(i)){var a=t?[e,t]:[e],s="merchant."+a.join(".")+".stripe";return Ro(s).then(function(o){if(r("pr.apple_pay.can_make_payment_native_response",{available:o}),n&&!o&&window.console){var i=t?"or stripeAccount parameter ("+t+") ":"";window.console.warn("Either you do not have a card saved to your Wallet or the current domain ("+e+") "+i+"is not registered for Apple Pay. Visit https://dashboard.stripe.com/account/apple_pay to register this domain.")}return o})}return n&&window.console&&window.console.warn("This version of Safari does not support ApplePay JS version "+i+"."),Ie.resolve(!1)}return Ie.resolve(!1)}return Ie.resolve(!1)},Co=["mastercard","visa"],jo=["AT","AU","BE","CA","CH","DE","DK","EE","ES","FI","FR","GB","GR","HK","IE","IT","JP","LT","LU","LV","MX","NL","NO","NZ","PL","PT","SE","SG","US"],Mo=function(e,t){var n="US"===e||t?["discover","diners","jcb"].concat(Co):Co;return-1!==jo.indexOf(e)?["amex"].concat(B(n)):n},Lo=function(e,t){return Mo(e,t).reduce(function(e,t){return"mastercard"===t?[].concat(B(e),["masterCard"]):"diners"===t?e:[].concat(B(e),[t])},[])},Do={bif:1,clp:1,djf:1,gnf:1,jpy:1,kmf:1,krw:1,mga:1,pyg:1,rwf:1,vnd:1,vuv:1,xaf:1,xof:1,xpf:1},xo=function(e){var t=Do[e.toLowerCase()]||100;return{unitSize:1/t,fractionDigits:Math.log(t)/Math.log(10)}},qo=function(e,t){var n=xo(t);return(e*n.unitSize).toFixed(n.fractionDigits)},Fo=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"1.2em",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Di,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"0",r=xi(n);if("string"==typeof e&&/^[0-9.]+px$/.test(e)){return parseFloat(e.toString().replace(/[^0-9.]/g,""))+r+"px"}var o=parseFloat(e.toString().replace(/[^0-9.]/g,"")),i=parseFloat(Di.replace(/[^0-9.]/g,"")),a=parseFloat(t.toString().replace(/[^0-9.]/g,"")),s=void 0;if("string"==typeof t&&/^(\d+|\d*\.\d+)px$/.test(t))s=a;else if("string"==typeof t&&/^(\d+|\d*\.\d+)em$/.test(t))s=a*i;else if("string"==typeof t&&/^(\d+|\d*\.\d+)%$/.test(t))s=a/100*i;else{if("string"!=typeof t||!/^[\d.]+$/.test(t)&&!/^\d*\.(px|em|%)$/.test(t))return"100%";s=i}var c=o*s+r,u=c+"px";return/^[0-9.]+px$/.test(u)?u:"100%"},Fi=qi,Bi=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];if("paymentRequestButton"===this._componentName){var n=e.style&&e.style.paymentRequestButton||{},r=n.height,o="string"==typeof r?r:void 0;(t||o)&&(this._frame.updateStyle({height:o||this._lastHeight||"40px"}),this._lastHeight=o||this._lastHeight)}else{var i=e.style&&e.style.base||{},a=i.lineHeight,s=i.fontSize,c=i.padding,u="string"!=typeof a||isNaN(parseFloat(a))?void 0:a,l="string"==typeof s?s:void 0,p="string"==typeof c?c:void 0;if(l&&!Wi(l)&&this._controller.warn("The fontSize style you specified ("+l+") is not in px. We do not recommend using relative css units, as they will be calculated relative to our iframe's styles rather than your site's."),t||u||l){var d=-1===Bt.indexOf(this._componentName)?void 0:p||this._lastPadding,f=Fi(u||this._lastHeight,l||this._lastFontSize,d);this._frame.updateStyle({height:f}),this._lastFontSize=l||this._lastFontSize,this._lastHeight=u||this._lastHeight,this._lastPadding=d}}}},{key:"_createElement",value:function(e,t){var n=this,r=(e.classes,e.controller,e.paymentRequest,$(e,["classes","controller","paymentRequest"])),o=document.createElement("div");o.className="__PrivateStripeElement";var i=document.createElement("input");i.className="__PrivateStripeElement-input",i.setAttribute("aria-hidden","true"),i.setAttribute("aria-label"," "),i.setAttribute("autocomplete","false"),i.maxLength=1,i.disabled=!0,$t(o,zi),$t(i,Yi);var a=jn(document.body),s=!!a&&"rtl"===a.getPropertyValue("direction"),c=wr[t],u=Bi({},r,{rtl:s}),l=this._controller.createElementFrame(c,u);if(l._on("load",function(){i.disabled=!1}),i.addEventListener("focus",function(){l.focus()}),l.appendTo(o),Pr[t]){var p=Pr[t].secondary;this._secondaryFrame=this._createSecondFrame(c,p,Bi({},u,{primaryElementType:t})),this._secondaryFrame.appendTo(o),window.addEventListener("click",function(){return n._handleOutsideClick()})}if(o.appendChild(i),fr&&t!==Nt.paymentRequestButton){var d=document.createElement("input");d.className="__PrivateStripeElement-safariInput",d.setAttribute("aria-hidden","true"),d.setAttribute("tabindex","-1"),d.setAttribute("autocomplete","false"),d.maxLength=1,d.disabled=!0,$t(d,Yi),o.appendChild(d)}this._component=o,this._frame=l,this._fakeInput=i}}]),t}(pn),Vi=function(){var e=this;this._paymentRequest=null,this.mount=an(function(t){e._checkDestroyed();var n=void 0;if(!t)throw new ke("Missing argument. Make sure to call mount() with a valid DOM element or selector.");if("string"==typeof t){var r=document.querySelectorAll(t);if(r.length>1&&e._controller.warn("The selector you specified ("+t+") applies to "+r.length+" DOM elements that are currently on the page.\nThe Stripe Element will be mounted to the first one."),!r.length)throw new ke("The selector you specified ("+t+") applies to no DOM elements that are currently on the page.\nMake sure the element exists on the page before calling mount().");n=r[0]}else{if(!t.appendChild)throw new ke("Invalid DOM element. Make sure to call mount() with a valid DOM element or selector.");n=t}if("INPUT"===n.nodeName)throw new ke("Stripe Elements must be mounted in a DOM element that\ncan contain child nodes. `input` elements are not permitted to have child\nnodes. Try using a `div` element instead.");if(n.children.length&&e._controller.warn("This Element will be mounted to a DOM element that contains child nodes."),e._paymentRequest){if(!e._paymentRequest._canMakePaymentResolved)throw new ke("For the paymentRequestButton Element, you must first check availability using paymentRequest.canMakePayment() before mounting the Element.");if(!e._paymentRequest._activeBackingLibraryName)throw new ke("The paymentRequestButton Element is not available in the current environment.");e._mountToParent(n)}else e._mountToParent(n)}),this.update=an(function(t){e._checkDestroyed();var n=vt(Mi,t||{},"element.update()"),r=n.value;if(n.warnings.forEach(function(t){return e._controller.warn(t)}),r){var o=r.classes,i=$(r,["classes"]);o&&(e._removeClasses(),e._computeCustomClasses(o),e._updateClasses()),e._updateFrameHeight(r),Object.keys(i).length&&(e._frame.update(i),e._secondaryFrame&&e._secondaryFrame.update(i))}return e}),this.focus=an(function(t){return e._checkDestroyed(),t&&t.preventDefault(),document.activeElement&&document.activeElement.blur&&document.activeElement.blur(),e._fakeInput.focus(),e}),this.blur=an(function(){return e._checkDestroyed(),e._frame.blur(),e._fakeInput.blur(),e}),this.clear=an(function(){return e._checkDestroyed(),e._frame.clear(),e}),this.unmount=an(function(){e._checkDestroyed();var t=e._component.parentElement,n=e._label;return t&&(t.removeChild(e._component),t.removeEventListener("click",e.focus),e._removeClasses()),e._parent=null,n&&(n.removeEventListener("click",e.focus),e._label=null),e._secondaryFrame&&(e._secondaryFrame.unmount(),window.removeEventListener("click",e._handleOutsideClick)),e._fakeInput.disabled=!0,e._frame.unmount(),e}),this.destroy=an(function(){return e._checkDestroyed(),e.unmount(),e._destroyed=!0,e._emitEvent("destroy"),e}),this._formSubmit=function(){for(var t=e._component.parentElement;t&&"FORM"!==t.nodeName;)t=t.parentElement;if(t){var n=document.createEvent("Event");n.initEvent("submit",!0,!0),t.dispatchEvent(n)}}},Ji=Ki,Qi=Object.assign||function(e){for(var t=1;t2e3,s=!!e._pendingFonts||a,c=new Ji(Qi({},i,{fonts:a?null:e._commonOptions.fonts,controller:e._controller,wait:s}));return e._elements=[].concat(oe(e._elements),[t]),c._on("destroy",function(){e._elements=e._elements.filter(function(e){return e!==t})}),a&&c._frame.send({action:"stripe-user-update",payload:{fonts:e._commonOptions.fonts}}),c})},ta=Zi,na=function(e,t,n,r,o,i){return new Ni({controller:e,authentication:t,mids:n,rawOptions:r,betas:o,queryStrategyOverride:i})},ra=na,oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ia=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};if(ce(this,e),n.checkoutIds){var r=n.checkoutIds,o=r.muid,i=r.sid;this._muid=o,this._sid=i,this._doNotPersist=!0}else this._muid=this._getID(ka.MERCHANT),this._sid=this._getID(ka.SESSION),this._doNotPersist=!1;this._id=Ht(Sa),this._controllerFrame=new Sn(Ot.METRICS_CONTROLLER,this._id,{autoload:!0,queryString:this._buildFrameQueryString()}),this._guidPromise=new Ie(function(e){t._establishMessageChannel(e)}),this._startIntervalCheck(),setTimeout(this._testLatency.bind(this),2e3+500*Math.random())}return Ea(e,[{key:"ids",value:function(){return{guid:this._guid||"NA",muid:this._muid||"NA",sid:this._sid||"NA"}}},{key:"idsPromise",value:function(){var e=this;return this._guidPromise.then(function(){return e.ids()})}},{key:"_establishMessageChannel",value:function(e){var t=this;window.addEventListener("message",function(n){var r=n.data;if("string"==typeof r)try{var o=JSON.parse(r),i=o.originatingScript,a=o.payload;"m"===i&&(t._guid=a,e(a))}catch(e){}})}},{key:"_startIntervalCheck",value:function(){var e=this,t=window.location.href;setInterval(function(){var n=window.location.href;n!==t&&(e.send({action:"ping",payload:{sid:e._getID(ka.SESSION),muid:e._getID(ka.MERCHANT),title:document.title,referrer:document.referrer,url:document.location.href}}),t=n)},5e3)}},{key:"report",value:function(e,t){try{this.send({action:"track",payload:{sid:this._getID(ka.SESSION),muid:this._getID(ka.MERCHANT),url:document.location.href,source:e,data:t}})}catch(e){}}},{key:"send",value:function(e){var t=It(Ot.METRICS_CONTROLLER);Zn(t)&&this._controllerFrame.send(e)}},{key:"_testLatency",value:function(){var e=this,t=[],n=new Date,r=function r(){try{var o=new Date;t.push(o-n),t.length>=10&&(e.report("mouse-timings-10",t),document.removeEventListener("mousemove",r)),n=o}catch(e){}};document.addEventListener("mousemove",r)}},{key:"_extractMetaReferrerPolicy",value:function(){var e=document.querySelector("meta[name=referrer]");return null!=e&&e instanceof HTMLMetaElement?e.content.toLowerCase():null}},{key:"_extractUrl",value:function(e){var t=document.location.href;switch(e){case"origin":case"strict-origin":case"origin-when-cross-origin":case"strict-origin-when-cross-origin":return document.location.origin;case"unsafe-url":return t.split("#")[0];default:return t}}},{key:"_buildFrameQueryString",value:function(){var e=this._extractMetaReferrerPolicy(),t=this._extractUrl(e),n={url:t,title:document.title,referrer:document.referrer,muid:this._muid,sid:this._sid,preview:er(t)};return null!=e&&(n.metaReferrerPolicy=e),Object.keys(n).map(function(e){return null!=n[e]?e+"="+encodeURIComponent(n[e].toString()):null}).join("&")}},{key:"_getID",value:function(e){switch(e){case ka.MERCHANT:if(this._doNotPersist)return this._muid;try{var t=wa("__stripe_mid")||zt();return ga({name:"__stripe_mid",value:t,domain:"."+document.location.hostname}),t}catch(e){return"NA"}case ka.SESSION:if(this._doNotPersist)return this._sid;try{var n=wa("__stripe_sid")||zt();return ga({name:"__stripe_sid",value:n,domain:"."+document.location.hostname,expiresIn:18e5}),n}catch(e){return"NA"}default:throw new Error("Invalid ID type specified: "+e)}}}]),e}(),Pa=Oa,Aa={_frame:mt({id:nt}),_componentName:nt},Ta=mt(Aa),Ia=function(e){var t=yt(Ta,e,"");return"error"===t.type?null:t.value},Ra=Object.assign||function(e){for(var t=1;t3&&void 0!==arguments[3]&&arguments[3];return function(o){var i=ls(o);switch(i.type){case"error":var a=i.error,s=a.payment_intent;return n&&s&&"payment_intent_unexpected_state"===a.code&&("succeeded"===s.status||"requires_capture"===s.status)?Ie.resolve({paymentIntent:s}):Ie.resolve(aa(o));case"object":var c=i.object;return ds(e,c,t,i.locale,r);default:return Oe(i)}}},hs=function(e,t,n,r,o){var i=Ia(r);if("string"!=typeof n)return Ie.reject(new ke("Please provide a PaymentMethod type to createPaymentMethod."));var a=rs(i?o:r),s=a||{type:null,data:{}},c=s.type,u=s.data;if(c&&n!==c)return Ie.reject(new ke("The type supplied in payment_method_data is not consistent."));if(i){var l=i._frame.id,p=i._componentName;return e.action.createPaymentMethodWithElement({frameId:l,elementName:p,type:n,paymentMethodData:u,mids:t}).then(ss)}return a?e.action.createPaymentMethodWithData({elementName:null,type:n,paymentMethodData:u,mids:t}).then(ss):Ie.reject(new ke("Please provide either an Element or PaymentMethod creation parameters to createPaymentMethod."))},_s=function(e,t){var n=vt(ua,e,"retrievePaymentIntent"),r=n.value;return t.action.retrievePaymentIntent({intentSecret:r,hosted:!1}).then(aa)},ms=function(e,t,n,r,o,i){var a=vt(ua,r,"stripe.confirmPaymentIntent intent secret"),s=a.value,c=Ma(e,!1,null,"confirmPaymentIntent")(o,i);return t.action.confirmPaymentIntent(cs({},c,{intentSecret:s,expectedType:null,mids:n})).then(aa)},ys=function(e,t){var n=vt(ua,e,"[internal] stripe.handleHosted3DS2Setup intent secret"),r=n.value;return t.action.retrievePaymentIntent({intentSecret:r,hosted:!0}).then(fs(t,ma.card,!1,!0))},vs=function(e,t){var n=vt(ua,e,"stripe.handleCardAction intent secret"),r=n.value;return t.action.retrievePaymentIntent({intentSecret:r,hosted:!1}).then(function(e){var n=ls(e);switch(n.type){case"error":return Ie.resolve(aa(e));case"object":var r=n.object;if(pa(r.status)){if("manual"!==r.confirmation_method)throw new ke("handleCardAction: The PaymentIntent supplied does not require manual server-side confirmation. Please use handleCardPayment instead to complete the payment.");return ds(t,r,ma.card,n.locale,!1)}throw new ke("handleCardAction: The PaymentIntent supplied is not in the requires_action state.");default:return Oe(n)}})},bs=function(e,t,n,r,o,i,a){var s=vt(ua,o,"stripe.handleCardPayment intent secret"),c=s.value,u=ma.card,l=Ma(e,r,u,"handleCardPayment")(i,a),p=!i&&!a;return t.action.confirmPaymentIntent(cs({},l,{otherParams:cs({},l.otherParams,{use_stripe_sdk:!0}),intentSecret:c,expectedType:u,mids:n})).then(fs(t,u,p))},gs=function(e,t,n,r,o){return bs(!1,e,t,!1,n,r,o)},ws=function(e,t,n,r,o,i){var a=vt(ua,r,"stripe.handleSepaDebitPayment intent secret"),s=a.value,c=ma.sepa_debit,u=Ma(!1,n,c,"handleSepaDebitPayment")(o,i),l=!o&&!i;return e.action.confirmPaymentIntent(cs({},u,{intentSecret:s,expectedType:c,mids:t})).then(fs(e,c,l))},Es=function(e,t,n,r,o){return ws(e,t,!1,n,r,o)},Ss=function(e,t,n,r,o){var i=vt(ua,n,"stripe.confirmAuBecsDebitPayment intent secret"),a=i.value,s=ma.au_becs_debit,c=Ma(!1,!1,s,"confirmAuBecsDebitPayment")(r,o),u=!r&&!o;return e.action.confirmPaymentIntent(cs({},c,{intentSecret:a,expectedType:s,mids:t})).then(fs(e,s,u))},ks=function(e,t,n,r,o,i,a){var s=vt(ua,o,"stripe.handleIdealPayment intent secret"),c=s.value,u=ma.ideal,l=Ma(e,r,u,"handleIdealPayment")(i,a),p=!i&&!a;return t.action.confirmPaymentIntent(cs({},l,{intentSecret:c,expectedType:u,mids:n})).then(fs(t,u,p))},Os=function(e,t,n,r,o){return ks(!1,e,t,!1,n,r,o)},Ps=function(e,t,n,r,o,i){var a=vt(ua,r,"stripe.handleFpxPayment intent secret"),s=a.value,c=ma.fpx,u=Ma(!1,n,c,"handleFpxPayment")(o,i),l=!o&&!i;return e.action.confirmPaymentIntent(cs({},u,{intentSecret:s,expectedType:c,mids:t})).then(fs(e,c,l))},As=function(e,t,n,r,o){return Ps(e,t,!1,n,r,o)},Ts=Object.assign||function(e){for(var t=1;t1)throw new ke("stripe.redirectToCheckout: Do not provide other parameters when providing sessionId. Specify all parameters on your server when creating the CheckoutSession.");if(!/^cs_/.test(i))throw new ke("stripe.redirectToCheckout: Invalid value for sessionId. You specified '"+i+"'.");if("livemode"===t&&/^cs_test_/.test(i))throw new ke("stripe.redirectToCheckout: the provided sessionId is for a test mode Checkout Session, whereas Stripe.js was initialized with a live mode publishable key.");if("testmode"===t&&/^cs_live_/.test(i))throw new ke("stripe.redirectToCheckout: the provided sessionId is for a live mode Checkout Session, whereas Stripe.js was initialized with a test mode publishable key.");return{tag:"session",sessionId:i}}var a=(o.sessionId,o.sku,o.plan,o.items),s=o.successUrl,c=o.cancelUrl,u=pe(o,["sessionId","sku","plan","items","successUrl","cancelUrl"]);if(!a)throw new ke("stripe.redirectToCheckout: You must provide one of items or sessionId.");if(!s||!c)throw new ke("stripe.redirectToCheckout: You must provide successUrl and cancelUrl.");return Gs({tag:"no-session",items:a,successUrl:s,cancelUrl:c},u)},Qs=function(e,t){var n=Js(e,t);if("no-session"===n.tag){var r=n.successUrl,o=n.cancelUrl;if(!gt(r))throw new ke("stripe.redirectToCheckout: successUrl must start with either http:// or https://.");if(!gt(o))throw new ke("stripe.redirectToCheckout: cancelUrl must start with either http:// or https://.");return n}return n},$s=function(e,t,n){if(n&&n.paymentMethodTypes){if(-1===t.indexOf("checkout_pm_types"))throw new ke("Invalid stripe.redirectToCheckout parameter: paymentMethodTypes is not an accepted parameter.");if(e)throw new ke("Invalid stripe.redirectToCheckout parameter: paymentMethodTypes is not an accepted parameter for "+e+". Please follow our migration guide to update to the final version of Checkout: https://stripe.com/docs/payments/checkout/migration-from-beta")}},Xs=function(e,t){return"session"===t.tag||null==e||t.locale||-1===["auto"].concat(de(Ys)).indexOf(e)?t:Gs({},t,{locale:e})},Zs=function(e,t,n){var r=Re(Us,function(t){return Fr(e,t)});switch($s(r,e,t),r){case"checkout_beta_2":return Vs(t);case"checkout_beta_3":return Js(t,n);case"checkout_beta_4":default:return Qs(t,n)}},ec=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unknown";return Xs(t,Zs(e,n,r))},tc=ec,nc=Object.assign||function(e){for(var t=1;tu){for(var t=0,n=a.length-c;t