discourse-subscriptions/assets/javascripts/lib/vendor/stripe_v3.js

2 lines
82 KiB
JavaScript

!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<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function f(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 h(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 y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(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 _(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 v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(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 g(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 w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(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 O(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 S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(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 C(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A(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 j(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 R(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function M(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function L(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,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(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 U(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 D(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 B(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function z(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 H(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 V(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function K(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 Y(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 G(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 J(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $(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 W(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 Z(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function Q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ee(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 te(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 ne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var oe,ie,ae,se,ue,ce=function(e){function t(e){r(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return window.__stripeElementsController&&window.__stripeElementsController.reportIntegrationError(e),n.name="IntegrationError",n}return i(t,e),t}(Error),le=ce,pe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fe="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},de=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]},he=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1},ye=function(e){return e&&"object"===(void 0===e?"undefined":fe(e))&&(e.constructor===Array||e.constructor===Object)},me=function(e){return ye(e)?Array.isArray(e)?e.slice(0,e.length):pe({},e):e},_e=function e(t){return function(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];if(Array.isArray(r[0])&&t)return me(r[0]);var i=Array.isArray(r[0])?[]:{};return r.forEach(function(n){n&&Object.keys(n).forEach(function(r){var o=i[r],a=n[r],s=ye(o)&&!(t&&Array.isArray(o));"object"===(void 0===a?"undefined":fe(a))&&s?i[r]=e(t)(o,me(a)):void 0!==a?i[r]=ye(a)?e(t)(a):me(a):void 0!==o&&(i[r]=o)})}),i}},ve=(_e(!1),_e(!0)),be=function(e,t){for(var n={},r=0;r<t.length;r++)n[t[r]]=!0;for(var o=[],i=0;i<e.length;i++)n[e[i]]&&o.push(e[i]);return o},ge=["aed","afn","all","amd","ang","aoa","ars","aud","awg","azn","bam","bbd","bdt","bgn","bhd","bif","bmd","bnd","bob","brl","bsd","btn","bwp","byr","bzd","cad","cdf","chf","clf","clp","cny","cop","crc","cuc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","hrk","htg","huf","idr","ils","inr","iqd","irr","isk","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","ltl","lvl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mro","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","skk","sll","sos","srd","ssp","std","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","vef","vnd","vuv","wst","xaf","xag","xau","xcd","xdr","xof","xpf","yer","zar","zmk","zmw","btc","jep","eek","ghc","mtl","tmm","yen","zwd","zwl","zwn","zwr"],we=ge,Ee=["AT","AU","BE","BR","CA","CH","DE","DK","EE","ES","FI","FR","GB","HK","IE","IT","JP","LT","LU","LV","MX","NL","NZ","NO","PH","PL","PT","RO","SE","SG","SK","US"],Oe=Ee,Se=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ke="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},Pe=function(e,t,n){return"Invalid value for "+n.label+": "+(n.path.join(".")||"value")+" should be "+e+". You specified: "+t+"."},Ce=function(e){return{type:"valid",value:e,warnings:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]}},Te=function(e){return{error:e,errorType:"full",type:"error"}},Ae=function(e,t,n){return{expected:e,actual:String(t),options:n,errorType:"mismatch",type:"error"}},je=function(e){return function(t,n){return void 0===t?Ce(t):e(t,n)}},Re=function(e,t){return function(n,r){var o=e(n,r),i=t(n,r);return"error"===o.type&&"error"===i.type?"mismatch"===o.errorType?"mismatch"===i.errorType?Ae(o.expected+" or "+i.expected,n,r):Te(i.error):Te(o.error):"valid"===o.type?o:i}},qe=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,n){var r=de(t,function(t){return t===e});return void 0===r?Ae("one of the following strings: "+t.join(", "),e,n):Ce(r)}},Me=qe.apply(void 0,s(Oe)),Ie=qe.apply(void 0,s(we)),Ne=function(e,t){return"string"==typeof e?Ce(e):Ae("a string",e,t)},Le=function(e){return function(t,n){return"string"==typeof t?Ce(t):void 0===t?Ce(e()):Ae("a string",t,n)}},xe=function(e,t){return"boolean"==typeof e?Ce(e):Ae("a boolean",e,t)},Fe=function(e,t){return"number"==typeof e&&e===parseInt(e,10)?Ce(e):Ae("an amount in the currency's subunit",e,t)},Ue=function(e,t){return e&&"object"===(void 0===e?"undefined":ke(e))?Ce(e):Ae("an object",e,t)},De=function(e){return function(t,n){if(Array.isArray(t)){return t.map(function(t,r){return e(t,Se({},n,{path:[].concat(s(n.path),[String(r)])}))}).reduce(function(e,t){return"error"===e.type?e:"error"===t.type?t:Ce([].concat(s(e.value),[t.value]),[].concat(s(e.warnings),s(t.warnings)))},Ce([]))}return Ae("array",t,n)}},Be=function(e){return function(t,n){return void 0===t?Ce(void 0):Ae("used in "+e+" instead",t,n)}},ze=function(e){return function(t){return function(n,r){if(n&&"object"===(void 0===n?"undefined":ke(n))){var o=n,i=de(Object.keys(o),function(e){return!t[e]});if(i&&e)return Te(new le("Invalid "+r.label+" parameter: "+[].concat(s(r.path),[i]).join(".")+" is not an accepted parameter."));var u=Ce({});return i&&(u=Object.keys(o).reduce(function(e,n){return t[n]?e:Ce(e.value,[].concat(s(e.warnings),["Unrecognized "+r.label+" parameter: "+[].concat(s(r.path),[n]).join(".")+" is not a recognized parameter. This may cause issues with your integration in the future."]))},u)),Object.keys(t).reduce(function(e,n){if("error"===e.type)return e;var i=t[n],u=i(o[n],Se({},r,{path:[].concat(s(r.path),[n])}));return"valid"===u.type&&void 0!==u.value?Ce(Se({},e.value,a({},n,u.value)),[].concat(s(e.warnings),s(u.warnings))):"valid"===u.type?Ce(e.value,[].concat(s(e.warnings),s(u.warnings))):u},u)}return Ae("an object",n,r)}}},He=ze(!0),Ve=ze(!1),Ke=function(e,t,n,r){var o=r||{},i=e(t,{origin:o.origin||"",element:o.element||"",label:n,path:[]});if("valid"===i.type)return{value:i.value,warnings:i.warnings};throw"full"===i.errorType?i.error:new le(Pe(i.expected,i.actual,i.options))},Ye=function(e){return/^http(s)?:\/\//.test(e)},Ge=function(e){if(!Ye(e))return null;var t=document.createElement("a");t.href=e;var n=t.protocol,r=t.host,o=/:80$/,i=/:443$/;return"http:"===n&&o.test(r)?r=r.replace(o,""):"https:"===n&&i.test(r)&&(r=r.replace(i,"")),{host:r,protocol:n,origin:n+"//"+r}},Je=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Ge(e);return!!n&&n.host!==(t||window.location.host)},$e={TOKENIZE:"TOKENIZE",FETCH_LOCALE:"FETCH_LOCALE",UPDATE_CSS_FONTS:"UPDATE_CSS_FONTS",CREATE_SOURCE:"CREATE_SOURCE",AUTHORIZE_SOURCE:"AUTHORIZE_SOURCE",GET_AUTHORIZATION_STATUS:"GET_AUTHORIZATION_STATUS",RETRIEVE_SOURCE:"RETRIEVE_SOURCE",CREATE_APPLE_PAY_SESSION:"CREATE_APPLE_PAY_SESSION"},We=$e,Ze={CARD_ELEMENT:"CARD_ELEMENT",CONTROLLER:"CONTROLLER",METRICS_CONTROLLER:"METRICS_CONTROLLER",PAYMENT_REQUEST_ELEMENT:"PAYMENT_REQUEST_ELEMENT",PAYMENT_REQUEST:"PAYMENT_REQUEST"},Qe=Ze,Xe=function(e){return"https://js.stripe.com/v3/"+(e||"")},et=(oe={},u(oe,Qe.CARD_ELEMENT,Xe("elements-inner-card-8801e662d74c286b04d63b2b8cb8e16d.html")),u(oe,Qe.CONTROLLER,Xe("controller-8cc85e5837c64cb7c800a9782e2fe506.html")),u(oe,Qe.METRICS_CONTROLLER,"https://js.stripe.com/v2/m/outer.html"),u(oe,Qe.PAYMENT_REQUEST_ELEMENT,Xe("elements-inner-payment-request-3f5a5fac4bd88751c5ebf2315619007e.html")),u(oe,Qe.PAYMENT_REQUEST,Xe("payment-request-inner-8782eb8456a7fab00d554218113e172f.html")),oe),tt=et,nt=Ge("https://js.stripe.com/v3/"),rt=nt?nt.origin:"",ot={family:"font-family",src:"src",unicodeRange:"unicode-range",style:"font-style",variant:"font-variant",stretch:"font-stretch",weight:"font-weight"},it=Object.keys(ot).reduce(function(e,t){return e[ot[t]]=t,e},{}),at=0,st=function(e){return""+e+at++},ut=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)},ct="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},lt=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":ct(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,"+")},pt=lt,ft=n(2),dt=n.n(ft),ht=window.Promise||dt.a,yt=ht,mt=n(6),_t=n.n(mt),vt=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")}}(),bt=function(e,t){var n={};t.forEach(function(e){var t=vt(e,2),r=t[0],o=t[1];r.split(/\s+/).forEach(function(e){e&&(n[e]=n[e]||o)})}),e.className=_t()(e.className,n)},gt=function(e,t){e.style.cssText=Object.keys(t).map(function(e){return e+": "+t[e]+" !important;"}).join(" ")},wt=function(e){try{return window.parent.frames[e]}catch(e){return null}},Et=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ot=function(e){var t=e.frameId,n=e.controllerId,r=e.type,o=rt,i=void 0;"controller"===r?i=wt(t):"group"===r?i=wt(n):"outer"===r?i=window.frames[t]:"inner"===r&&(o="*",i=window.parent),i&&i.postMessage(JSON.stringify(Et({},e,{__stripeJsV3:!0})),o)},St=function(e){try{var t="string"==typeof e?JSON.parse(e):e;return t.__stripeJsV3?t:null}catch(e){return null}},kt=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Pt=function(){function e(){l(this,e),this._callbacks={},this.on=this.addListener=this.addEventListener,this.off=this.removeListener=this.removeEventListener}return kt(e,[{key:"addEventListener",value:function(e,t){return this._addEventListener(e,t)}},{key:"_addEventListener",value:function(e,t,n){return this._callbacks[e]=this._callbacks[e]||[],this._callbacks[e].push({original:n,fn:t}),this}},{key:"removeEventListener",value:function(e,t){if(t){for(var n=this._callbacks[e],r=void 0,o=0;o<n.length;o++)if(r=n[o],r.fn===t||r.original===t){n.splice(o,1);break}}else delete this._callbacks[e];return this}},{key:"removeAllListeners",value:function(){return this._callbacks={},this}},{key:"hasRegisteredListener",value:function(e){return this._callbacks[e]&&this._callbacks[e].length>0}},{key:"once",value:function(e,t){var n=this,r=function r(){n.off(e,r),t.apply(void 0,arguments)};return this._addEventListener(e,r,t)}},{key:"emit",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return(this._callbacks[e]||[]).forEach(function(e){return e.fn.apply(void 0,n)}),this}}]),e}(),Ct=Pt,Tt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},At=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),jt=function(e){function t(e,n,r){f(this,t);var o=d(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return o.type=e,o.loaded=!1,o._controllerId=n,o._queuedMessages=[],o._requests={},o.id=o._generateId(),o._iframe=o._createIFrame(r),o.on("load",function(){o.loaded=!0,o._ensureMounted(),o.loaded&&(o._queuedMessages.forEach(function(e){return o._send(e)}),o._queuedMessages=[])}),o}return h(t,e),At(t,[{key:"_generateId",value:function(){return st("__privateStripeFrame")}},{key:"send",value:function(e){this._send({message:e,type:"outer",frameId:this.id,controllerId:this._controllerId})}},{key:"action",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=st(e),o=new yt(function(o,i){t._requests[r]=Tt({},t._requests[r],{resolve:o,reject:i}),t._send({message:{action:"stripe-frame-action",payload:{type:e,nonce:r,options:n}},type:"outer",frameId:t.id,controllerId:t._controllerId})});return this._requests[r]=Tt({},this._requests[r],{promise:o}),o}},{key:"resolve",value:function(e,t){this._requests[e]&&this._requests[e].resolve(t)}},{key:"_send",value:function(e){this._ensureMounted(),this.loaded?Ot(e):this._queuedMessages=[].concat(p(this._queuedMessages),[e])}},{key:"appendTo",value:function(e){e.appendChild(this._iframe)}},{key:"unmount",value:function(){this.loaded=!1,this.emit("unload")}},{key:"_ensureMounted",value:function(){this._isMounted()||this.unmount()}},{key:"_isMounted",value:function(){return!!document.body&&document.body.contains(this._iframe)}},{key:"_createIFrame",value:function(e){var t=window.location.href.toString(),n=Ge(t),r=n?n.origin:"",o=e.queryString&&"string"==typeof e.queryString?e.queryString:pt(Tt({},e,{origin:r,referrer:t,controllerId:this._controllerId})),i=document.createElement("iframe");return i.setAttribute("frameborder","0"),i.setAttribute("allowTransparency","true"),i.setAttribute("scrolling","no"),i.setAttribute("name",this.id),i.setAttribute("allowpaymentrequest","true"),i.src=tt[this.type]+"#"+o,i}}]),t}(Ct),Rt=jt,qt=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Mt=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},It={border:"none",margin:"0",padding:"0",width:"1px","min-width":"100%",overflow:"hidden",display:"block",visibility:"hidden",position:"fixed",height:"1px","pointer-events":"none"},Nt=function(e){function t(e,n,r){y(this,t);var o=m(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r));return o.autoload=r.autoload||!1,"complete"===document.readyState?o._ensureMounted():(document.addEventListener("DOMContentLoaded",o._ensureMounted.bind(o)),window.addEventListener("load",o._ensureMounted.bind(o))),o}return _(t,e),qt(t,[{key:"_ensureMounted",value:function(){Mt(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_ensureMounted",this).call(this),this._isMounted()||this._autoMount()}},{key:"_autoMount",value:function(){if(document.body)this.appendTo(document.body);else if("complete"===document.readyState||"interactive"===document.readyState)throw new le("Stripe.js requires that your page has a <body> element.");this.autoload&&(this.loaded=!0)}},{key:"_createIFrame",value:function(e){var n=Mt(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"),gt(n,It),n}}]),t}(Rt),Lt=Nt,xt=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Ft=function(e){function t(){return v(this,t),b(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return g(t,e),xt(t,[{key:"_generateId",value:function(){return this._controllerId}}]),t}(Lt),Ut=Ft,Dt=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Bt=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var a=o.get;if(void 0!==a)return a.call(r)},zt={border:"none",margin:"0",padding:"0",width:"1px","min-width":"100%",overflow:"hidden",display:"block"},Ht=function(e){function t(){return w(this,t),E(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return O(t,e),Dt(t,[{key:"update",value:function(e){this.send({action:"stripe-user-update",payload:e})}},{key:"updateStyle",value:function(e){var t=this;Object.keys(e).forEach(function(n){t._iframe.style[n]=e[n]})}},{key:"focus",value:function(){this.loaded&&this.send({action:"stripe-user-focus",payload:{}})}},{key:"blur",value:function(){this.loaded&&(this._iframe.contentWindow.blur(),this._iframe.blur())}},{key:"clear",value:function(){this.send({action:"stripe-user-clear",payload:{}})}},{key:"_createIFrame",value:function(e){var n=Bt(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"_createIFrame",this).call(this,e);return n.setAttribute("title","Secure payment input frame"),gt(n,zt),n}}]),t}(Rt),Vt=Ht,Kt=function(e){var t=Ge(e),n=t?t.host:"";return"stripe.com"===n||!!n.match(/\.stripe\.(com|me)$/)||!1},Yt=function(e,t){var n=Ge(e),r=Ge(t);return!(!n||!r)&&n.origin===r.origin},Gt=function(e){return/(MSIE ([0-9]{1,}[.0-9]{0,})|Trident\/)/i.test(e)},Jt=function(e){return/iPad|iPhone/i.test(e)&&!Gt(e)},$t=function(e){return/Android/.test(e)&&!Gt(e)},Wt=window.navigator.userAgent,Zt=function(e){return/Edge\//i.test(e)}(Wt),Qt=(Gt(Wt),function(e){/MSIE 9/i.test(e)}(Wt),function(e){/MSIE ([0-9]{1,}[.0-9]{0,})/i.test(e)}(Wt),Jt(Wt)),Xt=(function(e){Jt(e)||$t(e)}(Wt),$t(Wt),function(e){/^((?!chrome|android).)*safari/i.test(e)}(Wt),function(e){/Firefox\//i.test(e)}(Wt),window.ApplePaySession,{card:"card",cardNumber:"cardNumber",cardExpiry:"cardExpiry",cardCvc:"cardCvc",postalCode:"postalCode",iban:"iban",ideal:"ideal",paymentRequestButton:"paymentRequestButton"}),en=Xt,tn=(ie={},S(ie,en.card,{unique:!0,conflict:[en.cardNumber,en.cardExpiry,en.cardCvc,en.postalCode]}),S(ie,en.cardNumber,{unique:!0,conflict:[en.card]}),S(ie,en.cardExpiry,{unique:!0,conflict:[en.card]}),S(ie,en.cardCvc,{unique:!0,conflict:[en.card]}),S(ie,en.postalCode,{unique:!0,conflict:[en.card]}),S(ie,en.paymentRequestButton,{unique:!0,conflict:[],beta:!0}),ie),nn=tn,rn=(ae={},k(ae,en.card,Qe.CARD_ELEMENT),k(ae,en.cardNumber,Qe.CARD_ELEMENT),k(ae,en.cardExpiry,Qe.CARD_ELEMENT),k(ae,en.cardCvc,Qe.CARD_ELEMENT),k(ae,en.postalCode,Qe.CARD_ELEMENT),k(ae,"paymentRequestButton",Qe.PAYMENT_REQUEST_ELEMENT),ae),on=rn,an=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sn=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),un="__privateStripeController",cn=!1,ln=function(){function e(t){var n=this;C(this,e),this._setupFrame=function(e,t){return n._frames[e.id]=e,n._controllerFrame.send({action:"stripe-user-createframe",payload:{newFrameId:e.id,groupId:t}}),e.on("unload",function(){n._controllerFrame.send({action:"stripe-frame-unload",payload:{unloadedFrameId:e.id}})}),e.on("load",function(){n._controllerFrame.send({action:"stripe-frame-load",payload:{loadedFrameId:e.id}}),n._controllerFrame.loaded&&e.send({action:"stripe-controller-load",payload:{}})}),e},this.warn=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];n._controllerFrame.send({action:"stripe-controller-warn",payload:{args:t}})};var r=t.apiKey,o=t.stripeAccount,i=t.stripeJsId,a=t.features;this._id=st(un),this._stripeJsId=i,this._apiKey=r,this._stripeAccount=o,this._features=a||{},this._controllerFrame=new Ut(Qe.CONTROLLER,this._id,t),this._frames={},this._requests={},this._setupPostMessage()}return sn(e,[{key:"action",value:function(e,t){var n=this,r=st(We[e]),o=new yt(function(o,i){n._requests[r]=an({},n._requests[r],{resolve:o,reject:i}),n._controllerFrame.send({action:"stripe-user-action",payload:{type:e,nonce:r,options:t}})});return this._requests[r]=an({},this._requests[r],{promise:o}),o}},{key:"createElementFrame",value:function(e,t){var n=t.groupId,r=P(t,["groupId"]),o=new Vt(e,this._id,an({},r,{features:this._features}));return this._setupFrame(o,n)}},{key:"createHiddenFrame",value:function(e,t){var n=new Lt(e,this._id,an({},t,{features:this._features}));return this._setupFrame(n)}},{key:"report",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._controllerFrame.send({action:"stripe-controller-report",payload:{event:e,data:t}})}},{key:"_setupPostMessage",value:function(){var e=this;window.addEventListener("message",function(t){var n=t.data,r=t.origin,o=St(n);o&&Yt(rt,r)&&e._handleMessage(o)})}},{key:"_handleMessage",value:function(e){var t=this,n=e.controllerId,r=e.frameId,o=e.message,i=this._frames[r];if(n===this._id)switch(o.action){case"stripe-frame-event":var a=o.payload,s=a.event,u=a.data;if(i)if(Qt)if("focus"===s&&!cn&&document.activeElement!==i._iframe&&i._iframe.parentElement&&document.activeElement!==i._iframe.parentElement.querySelector("__PrivateStripeElement-input")){var c=i._iframe.parentElement.querySelector("__PrivateStripeElement-input");c&&c.focus(),cn=!0}else"blur"===s&&cn?cn=!1:i.emit(s,u);else i.emit(s,u);break;case"stripe-frame-action-complete":i&&i.resolve(o.payload.nonce,o.payload.result);break;case"stripe-frame-error":throw new le(o.payload.message);case"stripe-integration-error":i&&i.emit("__privateIntegrationError",{message:o.payload.message});break;case"stripe-controller-load":this._controllerFrame.emit("load"),Object.keys(this._frames).forEach(function(e){return t._frames[e].send({action:"stripe-controller-load",payload:{}})});break;case"stripe-user-action-complete":this._requests[o.payload.nonce]&&this._requests[o.payload.nonce].resolve(o.payload.result);break;case"stripe-user-action-error":this._requests[o.payload.nonce]&&this._requests[o.payload.nonce].reject(new le(o.payload.error))}}}]),e}(),pn=ln,fn=function(e){function t(){T(this,t);var e=A(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.name="NetworkError",e}return j(t,e),t}(Error),dn=fn,hn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yn={Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},mn=function(e){return Object.keys(yn).forEach(function(t){e.setRequestHeader(t,yn[t])}),e},_n=function e(t){return new yt(function(n,r){var o=t.method,i=t.url,a=t.timeout,s=t.data,u=t.withCredentials,c=s?pt(s):"",l=!window.XMLHttpRequest||Je(i)&&void 0===(new XMLHttpRequest).withCredentials,p="GET"===o&&c?i+"?"+c:i,f="GET"===o?"":c;if(l){var d=new window.XDomainRequest;try{d.open(o,p)}catch(e){r(e)}d.onerror=function(){n({responseText:JSON.stringify({error:{type:"api_error"}})})},d.onload=function(){n({status:200,responseText:d.responseText})},setTimeout(function(){d.send(f)},0)}else{var h=new XMLHttpRequest,y=void 0;a&&(y=setTimeout(function(){return h.abort()},a)),u&&(h.withCredentials=u),h.open(o,p,!0),mn(h),h.onreadystatechange=function(){4===h.readyState&&(clearTimeout(y),h.onreadystatechange=function(){},0===h.status?u?r(new dn):e(hn({},t,{withCredentials:!0})).then(n,r):n(h))};try{h.send(f)}catch(e){r(e)}}})},vn=_n,bn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gn=function(e,t){var n=/@font-face[ ]?{[^}]*}/g,r=e.match(n);if(!r)throw new le("No @font-face rules found in file from "+t);return r},wn=function(e){var t=e.match(/@font-face[ ]?{([^}]*)}/);return t?t[1]:""},En=function(e,t){var n=e.replace(/\/\*.*\*\//g,"").trim(),r=n.length&&/;$/.test(n)?n:n+";",o=r.match(/((([^;(]*\([^()]*\)[^;)]*)|[^;]+)+)(?=;)/g);if(!o)throw new le("Found @font-face rule containing no valid font-properties in file from "+t);return o},On=function(e,t){var n=e.indexOf(":");if(-1===n)throw new le("Invalid css declaration in file from "+t+': "'+e+'"');var r=e.slice(0,n).trim(),o=it[r];if(!o)throw new le("Unsupported css property in file from "+t+': "'+r+'"');return{property:o,value:e.slice(n+1).trim()}},Sn=function(e,t){var n=e.reduce(function(e,n){var r=On(n,t),o=r.property,i=r.value;return bn({},e,R({},o,i))},{});return["family","src"].forEach(function(e){if(!n[e])throw new le("Missing css property in file from "+t+': "'+ot[e]+'"')}),n},kn=function(e){return vn({url:e,method:"GET"}).then(function(e){return e.responseText}).then(function(t){return gn(t,e).map(function(t){var n=wn(t),r=En(n,e);return Sn(r,e)})})},Pn=kn,Cn=function(e,t){if(!(e&&e in nn))throw new le("A valid Element name must be provided. Valid Elements are:\n"+Object.keys(nn).filter(function(e){return!nn[e].beta}).join(", ")+"; you passed: "+e+".");if(nn[e].unique&&-1!==t.indexOf(e))throw new le("Can only create one Element of type "+e+".");var n=be(t,nn[e].conflict);if(n.length){var r=n[0];throw new le("Cannot create an Element of type "+e+" after an Element of type "+r+" has already been created.")}},Tn=function(e,t){var n=Array.prototype.slice.call(document.querySelectorAll("a[href], area[href], input:not([disabled]),\n select:not([disabled]), textarea:not([disabled]), button:not([disabled]),\n object, embed, *[tabindex], *[contenteditable]")),r=[];n.forEach(function(e){var t=e.getAttribute("tabindex"),n=!t||parseInt(t,10)>=0,o=e.getBoundingClientRect(),i=o.width>0&&o.height>0;n&&i&&r.push(e)});var o=he(r,function(t){return t===e||e.contains(t)});return r[o+("previous"===t?-1:1)]},An=Tn,jn="14px",Rn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"1.2em",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jn;if(/^[0-9.]+px$/.test(e))return e;var n=parseFloat(e.toString().replace(/[^0-9.]/g,"")),r=parseFloat(jn.replace(/[^0-9.]/g,"")),o=parseFloat(t.toString().replace(/[^0-9.]/g,"")),i=void 0;if(/^(\d+|\d*\.\d+)px$/.test(t))i=o;else if(/^(\d+|\d*\.\d+)em$/.test(t))i=o*r;else if(/^(\d+|\d*\.\d+)%$/.test(t))i=o/100*r;else{if(!/^[\d.]+$/.test(t)&&!/^\d*\.(px|em|%)$/.test(t))return"100%";i=r}var a=n*i+"px";return/^[0-9.]+px$/.test(a)?a:"100%"},qn=Rn,Mn=function(e,t){return e?window.getComputedStyle(e,t):null},In=Mn,Nn=function(){if(!window.PaymentRequest)return null;if(/CriOS\/59/.test(navigator.userAgent))return null;if(/.*\(.*; wv\).*Chrome\/(?:53|54)\.\d.*/g.test(navigator.userAgent))return null;var e=window.PaymentRequest;return Zt&&!e.prototype.canMakePayment?e.prototype.canMakePayment=function(){return yt.resolve(!0)}:e.prototype.canMakePayment||(e.prototype.canMakePayment=function(){return yt.resolve(!1)}),e}(),Ln={CAN_MAKE_PAYMENT:"CAN_MAKE_PAYMENT"},xn=function(){try{return window.location.origin===window.top.location.origin}catch(e){return!1}},Fn=void 0,Un=function(e){var t={};return function(n){if(void 0!==t[n])return t[n];var r=e(n);return t[n]=r,r}}(function(e){return window.ApplePaySession.canMakePaymentsWithActiveCard(e).then(function(e){return Fn&&Fn("payreq.can_make_payment_native_response",{available:e}),e})}),Dn=function(e,t,n,r){if(Fn=r,window.ApplePaySession){if(xn()){if(n&&"https:"!==window.location.protocol)return window.console&&window.console.warn("To test Apple Pay, you must serve this page over HTTPS."),yt.resolve(!1);if(window.ApplePaySession.supportsVersion(2)){var o=t?[e,t]:[e],i="merchant."+o.join(".")+".stripe";return Un(i).then(function(r){if(n&&!r&&window.console){var o=t?"or stripeAccount parameter ("+t+") ":"";window.console.warn("Either you do not have a card saved to your Wallet or the current domain ("+e+") "+o+"is not registered for Apple Pay. Visit https://dashboard.stripe.com/account/apple_pay to register this domain.")}return r})}return n&&window.console&&window.console.warn("This version of Safari does not support ApplePay JS version 2."),yt.resolve(!1)}return yt.resolve(!1)}return yt.resolve(!1)},Bn=null,zn=function(e,t){return null!==Bn?yt.resolve(Bn):Nn?Zt?yt.resolve(!1):t&&"https:"!==window.location.protocol?(window.console&&window.console.warn("To test Payment Request, you must serve this page over HTTPS."),yt.resolve(!1)):e?e.action(Ln.CAN_MAKE_PAYMENT).then(function(e){var t=e.available;return Bn="boolean"==typeof t&&t}):yt.resolve(!1):yt.resolve(!1)},Hn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vn={merchantCapabilities:["supports3DS"],displayItems:[]},Kn={amount:Fe,label:Ne,pending:je(xe)},Yn=Hn({},Kn,{id:Le(function(){return st("shippingOption")}),pending:je(xe),detail:Le(function(){return""})}),Gn={displayItems:je(De(Ve(Kn))),shippingOptions:je(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;a<o.value.length;a+=1){var s=o.value[a];if("object"===(void 0===s?"undefined":ke(s))&&s&&"string"==typeof s[e]){var u=s[e];if(i[u])return Te(new le("Duplicate value for "+e+": "+u+". The property '"+e+"' of '"+r.path.join(".")+"' has to be unique."));i[u]=!0}}return o}return Ae("array",n,r)}}}("id")(De(Ve(Yn)))),total:je(Ve(Kn))},Jn={shipping:"shipping",delivery:"delivery",pickup:"pickup"},$n={requestShipping:je(xe),requestPayerName:je(xe),requestPayerEmail:je(xe),requestPayerPhone:je(xe),shippingType:je(qe.apply(void 0,q(Object.keys(Jn))))},Wn=Hn({},Gn,$n,{currency:Ie,country:Me,total:Ve(Kn)}),Zn={success:"success",fail:"fail",invalid_payer_name:"invalid_payer_name",invalid_payer_email:"invalid_payer_email",invalid_payer_phone:"invalid_payer_phone",invalid_shipping_address:"invalid_shipping_address"},Qn=Hn({},Gn,{status:qe.apply(void 0,q(Object.keys(Zn)))}),Xn=Hn({},Gn,{currency:je(Ne)}),er=Ve(Qn),tr=He(Xn),nr=Ve(Wn),rr=["mastercard","visa"],or=["AT","AU","CA","CH","DE","ES","FI","FR","GB","IT","JP","NL","SE","SG","US"],ir=function(e){return"US"===e?["amex","discover","diners","jcb"].concat(rr):-1!==or.indexOf(e)?["amex"].concat(rr):rr},ar=function(e){return ir(e).reduce(function(e,t){return"mastercard"===t?[].concat(M(e),["masterCard"]):"diners"===t?e:[].concat(M(e),[t])},[])},sr={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},ur=function(e,t){var n=sr[t.toLowerCase()]||100,r=e/n,o=Math.log(n)/Math.log(10);return r.toFixed(Math.round(o))},cr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lr=function(e,t){return{amount:ur(e.amount,t.currency),label:e.label,type:e.pending?"pending":"final"}},pr=function(e,t){return{amount:ur(e.amount,t.currency),label:e.label,detail:e.detail,identifier:e.id}},fr=function(e){return function(t){return t[e]&&"string"==typeof t[e]?t[e].toUpperCase():null}},dr=(se={},I(se,Zn.success,0),I(se,Zn.fail,1),I(se,Zn.invalid_payer_name,2),I(se,Zn.invalid_shipping_address,3),I(se,Zn.invalid_payer_phone,4),I(se,Zn.invalid_payer_email,4),se),hr=(ue={},I(ue,Jn.pickup,"storePickup"),I(ue,Jn.shipping,"shipping"),I(ue,Jn.delivery,"delivery"),ue),yr={total:function(e){return lr(e.total,e)},lineItems:function(e){return e.displayItems?e.displayItems.map(function(t){return lr(t,e)}):[]},shippingMethods:function(e){return e.shippingOptions?e.shippingOptions.map(function(t){return pr(t,e)}):[]}},mr=cr({},yr,{shippingType:function(e){var t=e.shippingType;if(!t)return null;var n=hr[t];if(void 0!==n)return n;throw new le("Invalid value for shippingType: "+t)},requiredBillingContactFields:function(e){return e.requestPayerName?["postalAddress"]:null},requiredShippingContactFields:function(e){var t=[];return e.requestShipping&&t.push("postalAddress"),e.requestPayerEmail&&t.push("email"),e.requestPayerPhone&&t.push("phone"),t.length?t:null},countryCode:fr("country"),currencyCode:fr("currency"),merchantCapabilities:function(e){return function(t){return t[e]||null}}("merchantCapabilities"),supportedNetworks:function(e){return ar(e.country)}}),_r=cr({},yr,{status:function(e){return dr[e.status]||0}}),vr=(cr({},_r,mr),function(e){var t={},n=cr({},Vn,e);return Object.keys(mr).forEach(function(e){var r=mr[e],o=r(n);null!==o&&(t[e]=o)}),t}),br=function(e){var t={};return Object.keys(_r).forEach(function(n){var r=_r[n],o=r(e);null!==o&&(t[n]=o)}),t},gr=vr,wr=function(e){return"string"==typeof e?e:null},Er=function(e){return e?wr(e.phoneNumber):null},Or=function(e){return e?wr(e.emailAddress):null},Sr=function(e){return e?[e.givenName,e.familyName].filter(function(e){return e&&"string"==typeof e}).join(" "):null},kr=function(e){if(e){var t=e.addressLines,n=e.countryCode,r=e.postalCode,o=e.administrativeArea,i=e.locality,a=e.phoneNumber,s=wr(n);return{addressLine:Array.isArray(t)?t.reduce(function(e,t){return"string"==typeof t?[].concat(N(e),[t]):e},[]):[],country:s?s.toUpperCase():"",postalCode:wr(r)||"",recipient:Sr(e)||"",region:wr(o)||"",city:wr(i)||"",phone:wr(a)||"",sortingCode:"",dependentLocality:"",organization:""}}return null},Pr=function(e,t){if(e&&t.shippingOptions){var n=e.identifier,r=e.label;return t.shippingOptions.filter(function(e){return e.id===n&&e.label===r})[0]||null}return null},Cr=function(e,t){var n=e.shippingContact,r=e.shippingMethod,o=e.billingContact;return{shippingOption:Pr(r,t),shippingAddress:kr(n),payerEmail:Or(n),payerPhone:Er(n),payerName:Sr(o),methodName:"apple-pay"}},Tr=Cr,Ar={live:"live",test:"test",unknown:"unknown"},jr=function(e){return/^pk_test_/.test(e)?Ar.test:/^pk_live_/.test(e)?Ar.live:Ar.unknown},Rr=function(e){if(!e||!e.length)throw new le("When requesting shipping information, you must specify shippingOptions once a shipping address is selected.\nEither provide shippingOptions in stripe.paymentRequest(...) or listen for the shippingaddresschange event and provide shippingOptions to the updateWith callback there.");return e},qr=Rr,Mr="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},Ir=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nr=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Lr={australia:"AU",austria:"AT",canada:"CA",schweiz:"CH",deutschland:"DE",hongkong:"HK",saudiarabia:"SA",espaa:"ES",singapore:"SG",us:"US",usa:"US",unitedstatesofamerica:"US",unitedstates:"US",england:"GB",gb:"GB",uk:"GB",unitedkingdom:"GB"},xr=function(e){function t(e,n,r){x(this,t);var o=F(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));Fr.call(o),o._usesButtonElement=null,o._authentication=n,o._controller=e,o._report("payreq.options",{options:r});var i=Ke(nr,r||{},"paymentRequest()"),a=i.value;return i.warnings.forEach(function(e){return o._controller.warn(e)}),o._cachedCanMakePayment=null,o._canMakePaymentCalled=!1,o._initialPaymentRequest=a,o._isShowing=!1,o._initializeSessionState(),o}return U(t,e),Nr(t,[{key:"abort",value:function(){this._privateSession&&(this._privateSession.abort(),this._report("payreq.abort"))}},{key:"_initializeSessionState",value:function(){this._paymentRequestOptions=Ir({},this._initialPaymentRequest,{status:Zn.success}),this._privateSession=null,this._privateShippingOption=null;var e=this._paymentRequestOptions.shippingOptions;e&&e.length&&(this._privateShippingOption=e[0])}},{key:"_setupSession",value:function(e){var t=this;e.addEventListener("validatemerchant",this._validateMerchant(e)),e.addEventListener("paymentauthorized",this._paymentAuthorized(e)),e.addEventListener("cancel",function(){t._report("payreq.show_rejected"),t._isShowing=!1,t.emit("cancel")}),e.addEventListener("shippingcontactselected",this._shippingContactSelected(e)),e.addEventListener("shippingmethodselected",this._shippingMethodSelected(e))}}]),t}(Ct),Fr=function(){var e=this;this._report=function(t,n){e._controller.report(t,Ir({},n,null!==e._usesButtonElement?{usesButtonElement:e._usesButtonElement}:{},{impl:"applepay"}))},this._elementShow=function(){e._usesButtonElement=!0,e.show()},this._registerElement=function(){e._usedByButtonElement=!0},this.update=function(t){if(e._isShowing)throw new le("You cannot update Payment Request options while the payment sheet is showing.");var n=Ke(tr,t,"PaymentRequest update()"),r=n.value;n.warnings.forEach(function(t){return e._controller.warn(t)}),e._initialPaymentRequest=ve(e._paymentRequestOptions,r),e._initializeSessionState(),e._report("payreq.update",{updates:t})},this.show=function(){if(null===e._usesButtonElement&&(e._usesButtonElement=!1),e._usedByButtonElement&&(e._report("payreq.show_called_with_button"),e._controller.warn("Do not call show() yourself if you are using the paymentRequestButton Element.\nThe Element handles showing the payment sheet.")),!e._canMakePaymentCalled)throw new le("You must first check the Payment Request API's\navailability using paymentRequest.canMakePayment() before calling show().");if(!e._cachedCanMakePayment)throw new le("Payment Request is not available in this browser.");e._initializeSessionState();var t=new window.ApplePaySession(2,gr(e._paymentRequestOptions));e._privateSession=t,e._setupSession(t),t.begin(),e._isShowing=!0,e._report("payreq.show",{listeners:Object.keys(e._callbacks).sort()})},this.canMakePayment=function(){return null===e._cachedCanMakePayment?Dn(window.location.hostname,e._authentication.stripeAccount,jr(e._authentication.apiKey)===Ar.test,e._report).then(function(t){return e._canMakePaymentCalled=!0,e._cachedCanMakePayment=t,e._report("payreq.can_make_payment_response",{available:e._cachedCanMakePayment}),e._cachedCanMakePayment?{applePay:!0}:null}):yt.resolve().then(function(){return e._canMakePaymentCalled=!0,e._report("payreq.can_make_payment_response",{available:e._cachedCanMakePayment,cached:!0}),e._cachedCanMakePayment?{applePay:!0}:null})},this._validateMerchant=function(t){return function(n){e._controller.action(We.CREATE_APPLE_PAY_SESSION,{data:{validation_url:n.validationURL,domain_name:window.location.hostname,display_name:e._paymentRequestOptions.total.label},usesButtonElement:e._usesButtonElement}).then(function(n){var r=n.session,o=n.error;r?t.completeMerchantValidation(JSON.parse(r.session)):e._handleValidationError(t)(o)},e._handleValidationError(t))}},this._handleValidationError=function(t){return function(n){var r=n.message;t.abort(),"string"==typeof r?(e._controller.warn(n.message),e._report("payreq.on_error",{error:n})):e._report("fatal.payreq.unexpected_error",{error:n})}},this._paymentAuthorized=function(t){return function(n){var r=n.payment;e._report("payreq.paymentauthorized"),e._controller.action(We.TOKENIZE,Ir({},r,{billingContact:e._normalizeContact(r.billingContact),type:"apple_pay"})).then(function(n){var o=n.token,i=n.error;if(i)t.completePayment(window.ApplePaySession.STATUS_FAILURE),e._report("payreq.on_error",{error:i});else{var a=e._normalizeContact(r.shippingContact),s=e._normalizeContact(r.billingContact);a&&e._paymentRequestOptions.requestShipping&&!a.countryCode&&t.completePayment(window.ApplePaySession.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS);var u=Tr({shippingContact:a,billingContact:s},e._paymentRequestOptions);e._onToken(t)(Ir({},u,{shippingOption:e._privateShippingOption,token:o}))}})}},this._normalizeContact=function(t){if(t&&"object"===(void 0===t?"undefined":Mr(t))&&t.country&&"string"==typeof t.country){var n=t.country.toLowerCase().replace(/[^a-z]+/g,""),r=void 0;return t.countryCode?"string"==typeof t.countryCode&&(r=t.countryCode.toUpperCase()):(r=Lr[n])||e._report("fatal.payreq.missing_country_code",{country:t.country}),Ir({},t,{countryCode:r})}return"object"===(void 0===t?"undefined":Mr(t))?t:null},this._onToken=function(t){return function(n){if(e.hasRegisteredListener("token")&&e.emit("token",Ir({},n,{complete:e._completePayment(t)})),e.hasRegisteredListener("source")){var r=n.token,o=L(n,["token"]),i=o.payerPhone,a=o.payerEmail;e._controller.action(We.CREATE_SOURCE,{data:{type:"card",token:r.id,owner:{phone:i,email:a}}}).then(function(n){var i=n.source,a=n.error;a?(e._report("fatal.payreq.source_failed",{error:a,token:r}),t.completePayment(window.ApplePaySession.STATUS_FAILURE)):e.emit("source",Ir({},o,{source:i,complete:e._completePayment(t)}))})}}},this._completePayment=function(t){return function(n){var r=Ke(er,{status:n},"status for PaymentRequest completion"),o=r.value;r.warnings.forEach(function(t){return e._controller.warn(t)}),e._paymentRequestOptions=ve(e._paymentRequestOptions,o);var i=br(e._paymentRequestOptions),a=i.status;t.completePayment(a),e._isShowing=!1}},this._shippingContactSelected=function(t){return function(n){var r=Tr({shippingContact:e._normalizeContact(n.shippingContact)},e._paymentRequestOptions).shippingAddress;if(e.hasRegisteredListener("shippingaddresschange")){var o={shippingAddress:r,updateWith:e._completeShippingContactSelection(t)};e.emit("shippingaddresschange",o)}else{qr(e._paymentRequestOptions.shippingOptions);var i=br(e._paymentRequestOptions),a=i.total,s=i.lineItems,u=i.shippingMethods;t.completeShippingContactSelection(window.ApplePaySession.STATUS_SUCCESS,u,a,s)}}},this._completeShippingContactSelection=function(t){return function(n){var r=Ke(er,n||{},"shipping address selection callback"),o=r.value;if(r.warnings.forEach(function(t){return e._controller.warn(t)}),e._paymentRequestOptions=ve(e._paymentRequestOptions,o),e._paymentRequestOptions.status===Zn.success){var i=qr(e._paymentRequestOptions.shippingOptions);e._privateShippingOption=i[0]}var a=br(e._paymentRequestOptions),s=a.status,u=a.shippingMethods,c=a.total,l=a.lineItems;t.completeShippingContactSelection(s,u,c,l)}},this._shippingMethodSelected=function(t){return function(n){if(e._privateShippingOption=Tr({shippingMethod:n.shippingMethod},e._paymentRequestOptions).shippingOption,e.hasRegisteredListener("shippingoptionchange")){var r={shippingOption:e._privateShippingOption,updateWith:e._completeShippingMethodSelection(t)};e.emit("shippingoptionchange",r)}else{var o=br(e._paymentRequestOptions),i=o.total,a=o.lineItems;t.completeShippingMethodSelection(window.ApplePaySession.STATUS_SUCCESS,i,a)}}},this._completeShippingMethodSelection=function(t){return function(n){var r=Ke(er,n||{},"shipping option selection callback"),o=r.value;r.warnings.forEach(function(t){return e._controller.warn(t)}),e._paymentRequestOptions=ve(e._paymentRequestOptions,o);var i=br(e._paymentRequestOptions),a=i.status,s=i.total,u=i.lineItems;t.completeShippingMethodSelection(a,s,u)}}},Ur=xr,Dr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Br=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),zr=function(e){function t(e,n,r){B(this,t);var o=z(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));Hr.call(o),o._usesButtonElement=null,o._authentication=n,o._controller=e,o._report("payreq.options",{options:r}),o._cachedCanMakePayment=null,o._canMakePaymentCalled=!1;var i=Ke(nr,r||{},"paymentRequest()"),a=i.value;if(i.warnings.forEach(function(e){return o._controller.warn(e)}),Nn&&"https:"===window.location.protocol){o._controller.action(We.FETCH_LOCALE,{locale:"auto"});var s=o._controller.createHiddenFrame(Qe.PAYMENT_REQUEST,{authentication:n});o._setupPrFrame(s,a),o._prFrame=s}else o._prFrame=null;return o}return H(t,e),Br(t,[{key:"abort",value:function(){this._prFrame&&(this._prFrame.send({action:"stripe-pr-abort",payload:{}}),this._report("payreq.abort"))}},{key:"_setupPrFrame",value:function(e,t){var n=this;e.send({action:"stripe-pr-initialize",payload:{data:t}}),e.on("pr-cancel",function(){n.emit("cancel")}),e.on("pr-error",function(e){n._report("payreq.on_error",{error:"Would have emitted 'error' event, but 'error' is silenced."})}),e.on("pr-callback",function(r){var o=r.event,i=r.nonce,a=r.options;if("token"===o){var s=function(t){var r=Ke(er,{status:t},"status for PaymentRequest completion"),o=r.value;r.warnings.forEach(function(e){return n._controller.warn(e)}),e.send({action:"stripe-pr-callback-complete",payload:{data:o,nonce:i}})};n._handleToken(e,a,s)}else if("shippingaddresschange"===o||"shippingoptionchange"===o)if(n.hasRegisteredListener(o)){var u=a.shippingAddress,c=a.shippingOption,l="shippingaddresschange"===o?{shippingAddress:u}:{shippingOption:c};n.emit(o,Dr({},l,{updateWith:function(r){var a=Ke(er,r||{},o+" callback"),s=a.value;a.warnings.forEach(function(e){return n._controller.warn(e)}),"shippingaddresschange"===o&&s.status===Zn.success&&qr(s.shippingOptions||t.shippingOptions),e.send({action:"stripe-pr-callback-complete",payload:{nonce:i,data:s}})}}))}else"shippingaddresschange"===o&&qr(t.shippingOptions),e.send({action:"stripe-pr-callback-complete",payload:{nonce:i,data:{status:Zn.success}}});else n._report("error.payreq.unknown_event",{event:o,options:a})})}}]),t}(Ct),Hr=function(){var e=this;this._report=function(t,n){e._controller.report(t,Dr({},n,null!==e._usesButtonElement?{usesButtonElement:e._usesButtonElement}:{},{impl:"prapi"}))},this._elementShow=function(){e._usesButtonElement=!0,e.show()},this._registerElement=function(){e._usedByButtonElement=!0},this.update=function(t){var n=e._prFrame;if(n){var r=Ke(tr,t,"PaymentRequest update()"),o=r.value;r.warnings.forEach(function(t){return e._controller.warn(t)}),n.send({action:"stripe-pr-update",payload:{data:o}})}e._report("payreq.update",{updates:t})},this.show=function(){if(null===e._usesButtonElement&&(e._usesButtonElement=!1),e._usedByButtonElement&&(e._report("payreq.show_called_with_button"),e._controller.warn("Do not call show() yourself if you are using the paymentRequestButton Element.\nThe Element handles showing the payment sheet.")),!e._canMakePaymentCalled)throw new le("You must first check the Payment Request API's\navailability using paymentRequest.canMakePayment() before calling show().");if(!e._cachedCanMakePayment||!e._prFrame)throw new le("Payment Request is not available in this browser.");e._prFrame.send({action:"stripe-pr-show",payload:{data:{usesButtonElement:e._usesButtonElement}}}),e._report("payreq.show",{listeners:Object.keys(e._callbacks).sort()})},this.canMakePayment=function(){return null===e._cachedCanMakePayment?zn(e._prFrame,jr(e._authentication.apiKey)===Ar.test).then(function(t){return e._canMakePaymentCalled=!0,e._cachedCanMakePayment=t,e._report("payreq.can_make_payment_response",{available:e._cachedCanMakePayment}),e._cachedCanMakePayment?{applePay:!1}:null}):yt.resolve().then(function(){return e._canMakePaymentCalled=!0,e._report("payreq.can_make_payment_response",{available:e._cachedCanMakePayment,cached:!0}),e._cachedCanMakePayment?{applePay:!1}:null})},this._handleToken=function(t,n,r){if(e.hasRegisteredListener("token")&&e.emit("token",Dr({},n,{complete:r})),e.hasRegisteredListener("source")){var o=n.token,i=D(n,["token"]),a=i.payerPhone,s=i.payerEmail;e._controller.action(We.CREATE_SOURCE,{data:{type:"card",token:o.id,owner:{phone:a,email:s}}}).then(function(t){var n=t.source,a=t.error;a?(e._report("fatal.payreq.source_failed",{error:a,token:o}),r(Zn.fail)):e.emit("source",Dr({},i,{source:n,complete:r}))})}}},Vr=zr,Kr=window.ApplePaySession?function(e){function t(){return V(this,t),K(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Y(t,e),t}(Ur):function(e){function t(){return V(this,t),K(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return Y(t,e),t}(Vr),Yr=Kr,Gr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jr=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),$r={classes:je(Ve({base:je(Ne),complete:je(Ne),empty:je(Ne),focus:je(Ne),invalid:je(Ne),webkitAutofill:je(Ne)})),hidePostalCode:je(xe),hideIcon:je(xe),style:je(Ve({base:je(Ue),complete:je(Ue),empty:je(Ue),invalid:je(Ue),paymentRequestButton:je(Ue)})),iconStyle:je(qe("solid","default")),value:je(Re(Ne,Ue)),__privateCvcOptional:je(xe),__privateValue:je(Re(Ne,Ue)),error:je(Ve({type:Ne,code:je(Ne),decline_code:je(Ne)})),locale:Be("elements()"),fonts:Be("elements()"),placeholder:je(Ne),paymentRequest:je(function(e,t){return function(n,r){return n instanceof e?Ce(n):Ae("a "+t+" instance",n,r)}}(Yr,"stripe.paymentRequest(...)"))},Wr=Ve($r),Zr={base:"StripeElement",focus:"StripeElement--focus",invalid:"StripeElement--invalid",complete:"StripeElement--complete",empty:"StripeElement--empty",webkitAutofill:"StripeElement--webkit-autofill"},Qr={margin:"0",padding:"0",border:"none",display:"block",background:"transparent",position:"relative",opacity:"1"},Xr={border:"none",display:"block",position:"absolute",height:"1px",top:"0",left:"0",padding:"0",margin:"0",width:"100%",opacity:"0",background:"transparent",pointerEvents:"none"},eo=function(e){return parseFloat(e.toFixed(1))},to=function(e){return/^\d+(\.\d*)?px$/.test(e)},no=function(e){function t(e){J(this,t);var n=$(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));n.focus=function(e){return n._checkDestroyed(),e&&e.preventDefault(),n._fakeInput.focus(),n},n.blur=function(){return n._checkDestroyed(),n._frame.blur(),n._fakeInput.blur(),n},n._formSubmit=function(){for(var e=n._component.parentElement;e&&"FORM"!==e.nodeName;)e=e.parentElement;if(e){var t=document.createEvent("Event");t.initEvent("submit",!0,!0),e.dispatchEvent(t)}};var r=e.controller,o=e.componentName,i=e.paymentRequest;n._controller=r,n._componentName=o;var a="paymentRequestButton"===n._componentName;if(a){if(!i)throw new le("You must pass in a stripe.paymentRequest object in order to use this Element.");n._paymentRequest=i,n._paymentRequest._registerElement()}return n._createComponent(e,o),n._classes=Gr({},Zr),n._changeClasses(e.classes||{}),n._lastBackgroundColor="",n._destroyed=!1,n._focused=!1,n._empty=!a,n._invalid=!1,n._complete=!1,n._autofilled=!1,n.on("submit",n._formSubmit),n}return W(t,e),Jr(t,[{key:"mount",value:function(e){this._checkDestroyed();var t=void 0;if(!e)throw new le("Missing argument. Make sure to call mount() with a valid DOM element or selector.");if("string"==typeof e){var n=document.querySelectorAll(e);if(n.length>1&&this._controller.warn("The selector you specified ("+e+") applies to "+n.length+" DOM elements that are currently on the page.\nThe Stripe Element will be mounted to the first one."),!n.length)throw new le("The selector you specified ("+e+") applies to no DOM elements that are currently on the page.\nMake sure the element exists on the page before calling mount().");t=n[0]}else{if(!e.appendChild)throw new le("Invalid DOM element. Make sure to call mount() with a valid DOM element or selector.");t=e}if("INPUT"===t.nodeName)throw new le("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(t.children.length&&this._controller.warn("This Element will be mounted to a DOM element that contains child nodes."),this._paymentRequest){if(!this._paymentRequest._canMakePaymentCalled)throw new le("For paymentRequest Elements, you must first check the Payment Request API's\navailability using paymentRequest.canMakePayment() before mounting the Element.");if(!this._paymentRequest._cachedCanMakePayment)throw new le("The "+this._componentName+" Element is not available in the current environment.");this._mountToParent(t)}else this._mountToParent(t)}},{key:"_mountToParent",value:function(e){var t=this._component.parentElement,n=this._isMounted();if(e===t){if(n)return;this.unmount(),this._mountTo(e)}else if(t){if(n)throw new le("This Element is already mounted. Use `unmount()` to unmount the Element before re-mounting.");this.unmount(),this._mountTo(e)}else this._mountTo(e)}},{key:"update",value:function(e){var t=this;this._checkDestroyed();var n=Ke(Wr,e||{},"element.update()"),r=n.value;if(n.warnings.forEach(function(e){return t._controller.warn(e)}),r){var o=r.classes,i=G(r,["classes"]);this._changeClasses(o||{}),this._updateFrameHeight(r),Object.keys(i).length&&this._frame.update(i)}return this}},{key:"clear",value:function(){return this._checkDestroyed(),this._frame.clear(),this}},{key:"unmount",value:function(){this._checkDestroyed();var e=this._component.parentElement,t=this._label;return e&&(e.removeChild(this._component),e.removeEventListener("click",this.focus),this._removeClasses()),this._parent=null,t&&(t.removeEventListener("click",this.focus),this._label=null),this._fakeInput.disabled=!0,this._frame.unmount(),this}},{key:"destroy",value:function(){return this._checkDestroyed(),this.unmount(),this._destroyed=!0,this.emit("destroy"),this}},{key:"_checkDestroyed",value:function(){if(this._destroyed)throw new le("This Element has already been destroyed. Please create a new one.")}},{key:"_isMounted",value:function(){return!!document.body&&document.body.contains(this._component)}},{key:"_mountTo",value:function(e){var t=Date.now(),n=In(e,null),r=!!n&&"rtl"===n.getPropertyValue("direction");for(this._parent=e;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(this._component),this._frame.send({action:"stripe-user-mount",payload:{mountTime:t,rtl:r}}),this._findPossibleLabel(),this._updateClasses()}},{key:"_updateClasses",value:function(){this._parent&&bt(this._parent,[[this._classes.base,!0],[this._classes.empty,this._empty],[this._classes.focus,this._focused],[this._classes.invalid,this._invalid],[this._classes.complete,this._complete],[this._classes.webkitAutofill,this._autofilled]])}},{key:"_removeClasses",value:function(){this._parent&&bt(this._parent,[[this._classes.base,!1],[this._classes.empty,!1],[this._classes.focus,!1],[this._classes.invalid,!1],[this._classes.complete,!1],[this._classes.webkitAutofill,!1]])}},{key:"_findPossibleLabel",value:function(){var e=this._parent;if(e){var t=e.getAttribute("id"),n=void 0;if(t&&(n=document.querySelector("label[for="+t+"]")),n)e.addEventListener("click",this.focus);else for(n=n||e.parentElement;n&&"LABEL"!==n.nodeName;)n=n.parentElement;n?(this._label=n,n.addEventListener("click",this.focus)):e.addEventListener("click",this.focus)}}},{key:"_changeClasses",value:function(e){var t={};return Object.keys(e).forEach(function(n){if(!Zr[n])throw new le(n+" is not a customizable class name.\nYou can customize: "+Object.keys(Zr).join(", "));var r=e[n]||Zr[n];t[n]=r.replace(/\./g," ")}),this._classes=Gr({},this._classes,t),this}},{key:"_setupEvents",value:function(){var e=this;this._frame.on("redirectfocus",function(t){var n=t.focusDirection,r=An(e._component,n);r&&r.focus()}),this._frame.on("focus",function(){e._focused=!0,e._updateClasses()}),this._frame.on("blur",function(){e._focused=!1,e._updateClasses()}),this._frame.on("submit",function(){if("paymentRequestButton"===e._componentName){var t=!1,n=!1;e.emit("click",{preventDefault:function(){e._controller.report("payment_request_button.default_prevented"),t&&e._controller.warn("event.preventDefault() was called after the payment sheet was shown. Make sure to call it synchronously when handling the `click` event."),n=!0}}),!n&&e._paymentRequest&&(e._paymentRequest._elementShow(),t=!0)}else e.emit("submit")}),["ready","focus","blur","escape"].forEach(function(t){e._frame.on(t,function(){e.emit(t)})}),this._frame.on("change",function(t){var n=t.error,r=t.brand,o=t.value,i=t.empty,a=t.complete;e.emit("change",{error:n,brand:r,value:o,empty:i,complete:a}),e._empty=i,e._invalid=!!n,e._complete=a,e._updateClasses()}),this._frame.on("__privateIntegrationError",function(t){var n=t.message;e.emit("__privateIntegrationError",{message:n})}),this._frame.on("dimensions",function(t){if(e._parent){var n=In(e._parent,null);if(n){var r=parseFloat(n.getPropertyValue("height")),o=t.height;if("border-box"===n.getPropertyValue("box-sizing")){var i=parseFloat(n.getPropertyValue("padding-top")),a=parseFloat(n.getPropertyValue("padding-bottom"));r=r-parseFloat(n.getPropertyValue("border-top"))-parseFloat(n.getPropertyValue("border-bottom"))-i-a}0!==r&&eo(r)<eo(o)&&e._controller.report("wrapper_height_mismatch",{height:o,outer_height:r});var s=e._component.getBoundingClientRect().height;0!==s&&0!==o&&eo(s)!==eo(o)&&(e._frame.updateStyle({height:o+"px"}),e._controller.report("iframe_height_update",{height:o,calculated_height:s}))}}}),this._frame.on("autofill",function(){if(e._parent){var t=e._parent.style.backgroundColor,n="#faffbd"===t||"rgb(250, 255, 189)"===t;e._lastBackgroundColor=n?e._lastBackgroundColor:t,e._parent.style.backgroundColor="#faffbd",e._autofilled=!0,e._updateClasses()}}),this._frame.on("autofill-cleared",function(){e._autofilled=!1,e._parent&&(e._parent.style.backgroundColor=e._lastBackgroundColor),e._updateClasses()})}},{key:"_createComponent",value:function(e,t){this._createElement(e,t),this._setupEvents(),this._updateFrameHeight(e,!0)}},{key:"_updateFrameHeight",value:function(e){var t=arguments.length>1&&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,u="string"!=typeof a||isNaN(parseFloat(a))?void 0:a,c="string"==typeof s?s:void 0;if(c&&!to(c)&&this._controller.warn("The fontSize style you specified ("+c+") 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||c){var l=qn(u||this._lastHeight,c||this._lastFontSize);this._frame.updateStyle({height:l}),this._lastFontSize=c||this._lastFontSize,this._lastHeight=u||this._lastHeight}}}},{key:"_createElement",value:function(e,t){var n=(e.classes,e.controller,e.paymentRequest,G(e,["classes","controller","paymentRequest"])),r=document.createElement("div");r.className="__PrivateStripeElement";var o=document.createElement("input");o.className="__PrivateStripeElement-input",gt(r,Qr),gt(o,Xr),o.setAttribute("aria-hidden","true"),o.disabled=!0;var i=In(document.body),a=!!i&&"rtl"===i.getPropertyValue("direction"),s=on[t],u=this._controller.createElementFrame(s,Gr({},n,{rtl:a}));u.on("load",function(){o.disabled=!1}),o.addEventListener("focus",function(){u.focus()}),u.appendTo(r),r.appendChild(o),this._component=r,this._frame=u,this._fakeInput=o}}]),t}(Ct),ro=no,oo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},io={locale:je(Ne),fonts:je(De(Ue))},ao=Ve(io),so=function e(t,n){var r=this;Q(this,e),uo.call(this);var o=Ke(ao,n||{},"elements()"),i=o.value;o.warnings.forEach(function(e){return t.warn(e)}),this._elements=[],this._id=st("elements"),this._controller=t;var a=i.locale,s=i.fonts||[];this._controller.action(We.FETCH_LOCALE,{locale:a||"auto"});var u=s.filter(function(e){return!e.cssSrc||"string"!=typeof e.cssSrc}),c=s.map(function(e){return e.cssSrc}).reduce(function(e,t){return"string"==typeof t?[].concat(Z(e),[t]):e},[]);return this._pendingFonts=c.length,this._commonOptions=oo({},i,{fonts:u}),c.forEach(function(e){if("string"==typeof e){var t=Date.now();Pn(e).then(function(n){r._controller.report("font.loaded",{load_time:Date.now()-t,font_count:n.length,css_src:e}),r._controller.action(We.UPDATE_CSS_FONTS,{fonts:n.map(function(t){return oo({},t,{__privateCssSrc:e})}),groupId:r._id})}).catch(function(n){throw r._controller.report("error.font.not_loaded",{load_time:Date.now()-t,message:n.message,css_src:e}),n})}}),this},uo=function(){var e=this;this.create=function(t,n){Cn(t,e._elements);var r=Ke(Wr,n||{},"create()"),o=r.value;r.warnings.forEach(function(t){return e._controller.warn(t)});var i=!!e._pendingFonts,a=new ro(oo({},o,e._commonOptions,{controller:e._controller,componentName:t,groupId:e._id,wait:i}));return e._elements=[].concat(Z(e._elements),[t]),a.on("destroy",function(){e._elements=e._elements.filter(function(e){return e!==t})}),a}},co=so,lo=function(e){var t=e.name,n=e.value,r=e.expiresIn,o=e.path,i=e.domain,a=new Date,s=r||31536e6;a.setTime(a.getTime()+s);var u=o||"/",c=(n||"").replace(/[^!#-+\--:<-[\]-~]/g,encodeURIComponent),l=encodeURIComponent(t)+"="+c+";expires="+a.toGMTString()+";path="+u;i&&(l+=";domain="+i),document.cookie=l},po=function(e){var t=de(document.cookie.split("; "),function(t){var n=t.indexOf("=");return decodeURIComponent(t.substr(0,n))===e});if(t){var n=t.indexOf("=");return decodeURIComponent(t.substr(n+1))}return null},fo=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),ho="__privateStripeMetricsController",yo={MERCHANT:"merchant",SESSION:"session"},mo=function(e){function t(){X(this,t);var e=ee(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e._muid=e._getID(yo.MERCHANT),e._sid=e._getID(yo.SESSION),e._id=st(ho),e._controllerFrame=new Ut(Qe.METRICS_CONTROLLER,e._id,{autoload:!0,queryString:e._buildFrameQueryString()}),e._establishMessageChannel(),e._startIntervalCheck(),setTimeout(e._testLatency.bind(e),2e3+500*Math.random()),e}return te(t,e),fo(t,[{key:"ids",value:function(){return{guid:this._guid,muid:this._muid,sid:this._sid}}},{key:"_establishMessageChannel",value:function(){var e=this;window.addEventListener("message",function(t){try{var n=JSON.parse(t.data),r=n.originatingScript,o=n.payload;"m"===r&&(e._guid=o)}catch(e){}})}},{key:"_startIntervalCheck",value:function(){var e=this,t=window.location.href;setInterval(function(){var n=window.location.href;n!==t&&(e._controllerFrame.send({action:"ping",payload:{sid:e._getID(yo.SESSION),muid:e._getID(yo.MERCHANT),title:document.title,referrer:document.referrer,url:document.location.href}}),t=n)},5e3)}},{key:"report",value:function(e,t){try{this._controllerFrame.send({action:"track",payload:{sid:this._getID(yo.SESSION),muid:this._getID(yo.MERCHANT),url:document.location.href,source:e,data:t}})}catch(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:"_buildFrameQueryString",value:function(){var e=document.location.href,t={url:e,title:document.title,referrer:document.referrer,muid:this._muid,sid:this._sid,preview:Kt(e)};return Object.keys(t).map(function(e){return e+"="+encodeURIComponent(t[e].toString())}).join("&")}},{key:"_getID",value:function(e){switch(e){case yo.MERCHANT:try{var t=po("__stripe_mid")||ut();return lo({name:"__stripe_mid",value:t,domain:"."+document.location.hostname}),t}catch(e){return"NA"}case yo.SESSION:try{var n=po("__stripe_sid")||ut();return lo({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)}}}]),t}(Ct),_o=mo,vo=function(e){for(var t=0,n=0;n<e.length;n++){t=31*t+e.charCodeAt(n),t|=0}return t.toString()},bo=vo,go={noop:{likelihood:.3}},wo=function(e,t){return e+"-"+t},Eo=function(e){try{window.localStorage.setItem("__stripe-js-v3-features__",JSON.stringify(e))}catch(e){}},Oo=function(){var e={};try{e=JSON.parse(window.localStorage.getItem("__stripe-js-v3-features__"))||{}}catch(e){}return e},So=function(e){var t=Oo(),n={},r={};return Object.keys(go).forEach(function(o){if(go[o]){var i=go[o],a=i.likelihood,s=i.whitelist,u=wo(o,a);if(s&&-1===s.indexOf(bo(e)))n[o]=r[u]=!1;else{var c=t[u],l=Math.random()<a;n[o]=r[u]=void 0!==c?c:l}}}),Eo(r),n},ko="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},Po=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Co=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),To=Ve({apiKey:Ne,stripeAccount:je(Ne),__privateForcedFeatures:je(Ue)}),Ao=function(){function e(t){var n=this;re(this,e),jo.call(this);var r=Ke(To,t||{},"Stripe()"),o=r.value,i=r.warnings,a=o.apiKey,s=o.stripeAccount,u=o.__privateForcedFeatures;if(0===a.indexOf("sk_"))throw new le("You should not use your secret key with Stripe.js.\n Please pass a publishable key instead.");this._apiKey=a,this._keyMode=jr(a);var c=this._initFeatures(u||{});this._stripeAccount=s||null,this._controller=new pn({apiKey:a,stripeAccount:s,stripeJsId:e.stripeJsId,features:c}),i.forEach(function(e){return n._controller.warn(e)}),this._ensureHTTPS(a)}return Co(e,[{key:"_redirect",value:function(e){window.location.href=e}},{key:"_ensureHTTPS",value:function(e){var t=window.location.protocol,n=-1!==["https:","file:"].indexOf(t),r=-1!==["localhost","127.0.0.1","0.0.0.0"].indexOf(window.location.hostname),o=this._keyMode===Ar.live,i="Live Stripe.js integrations must use HTTPS.";if(!n){if(o&&!r)throw this._controller.report("error.non_https_error",{protocol:t}),new le(i);!o||r?window.console&&console.warn("You may test your Stripe.js integration over HTTP. However, live Stripe.js integrations must use HTTPS."):window.console&&console.warn(i)}}},{key:"_initFeatures",value:function(e){var t=So(this._apiKey),n=Po({},t);return e&&(Object.keys(e).forEach(function(e){go.hasOwnProperty(e)||console.error('Unrecognized feature "'+e+'" passed to "forcedFeatures".')}),Object.keys(t).forEach(function(t){void 0!==e[t]&&(n=Po({},n,ne({},t,!!e[t])))})),n}}]),e}();Ao.version=3,Ao.stripeJsId=ut();var jo=function(){var e=this;this.elements=function(t){return new co(e._controller,t)},this.createToken=function(t,n){var r="string"==typeof t?t:void 0,o=t instanceof ro?t._frame.id:void 0,i=n&&"object"===(void 0===n?"undefined":ko(n))?n:{},a=Po({type:r,frameId:o},i);return Ao._ec&&(a.mids=Ao._ec.ids()),e._controller.action(We.TOKENIZE,a)},this.createSource=function(t,n){var r=t instanceof ro?t._frame.id:void 0,o=r?n:t;return!r&&o&&"object"!==(void 0===o?"undefined":ko(o))?yt.reject(new le("Please provide Source creation parameters to createSource.")):(Ao._ec&&o&&"object"===(void 0===o?"undefined":ko(o))&&(o.mids=Ao._ec.ids()),e._controller.action(We.CREATE_SOURCE,{frameId:r,data:o}))},this.retrieveSource=function(t){return e._controller.action(We.RETRIEVE_SOURCE,{source:t})},this.paymentRequest=function(t){if(e._keyMode===Ar.unknown)throw new le("It looks like you're using an older Stripe key. In order to use this API, you'll need to use a modern API key, which is prefixed with 'pk_live_' or 'pk_test_'.\n You can roll your publishable key here: https://dashboard.stripe.com/account/apikeys");return new Yr(e._controller,{apiKey:e._apiKey,stripeAccount:e._stripeAccount},t)},this._authorizeSource=function(t){return e._controller.action(We.AUTHORIZE_SOURCE,{source:t}).then(function(t){var n=t.source,r=t.authorizationStatus;if("redirect"===t.nextAction){var o=n.redirect;return e._redirect(o.url),new yt(function(t,n){setTimeout(function(){e._controller.report("error.redirect_error",{url:o.url}),n({error:new Error("Failed to perform a redirect.")})},1e4)})}return{source:n,authorizationStatus:r}})},this._getAuthorizationStatus=function(t){return e._controller.action(We.GET_AUTHORIZATION_STATUS,{source:t})}},Ro=function(e,t){return new Ao(Po({apiKey:e},t&&"object"===(void 0===t?"undefined":ko(t))?t:{}))};Ro.version=Ao.version,window.addEventListener("load",function(){Ao._ec=new _o}),window.Stripe&&2===window.Stripe.version&&!window.Stripe.StripeV3?window.Stripe.StripeV3=Ro:window.Stripe?window.console&&console.warn("It looks like Stripe.js was loaded more than one time. Please only load it once per page."):window.Stripe=Ro;t.default=Ro},function(e,t,n){"use strict";function r(e){var t=new o(o._61);return t._81=1,t._65=e,t}var o=n(3);e.exports=o;var i=r(!0),a=r(!1),s=r(null),u=r(void 0),c=r(0),l=r("");o.resolve=function(e){if(e instanceof o)return e;if(null===e)return s;if(void 0===e)return u;if(!0===e)return i;if(!1===e)return a;if(0===e)return c;if(""===e)return l;if("object"==typeof e||"function"==typeof e)try{var t=e.then;if("function"==typeof t)return new o(t.bind(e))}catch(e){return new o(function(t,n){n(e)})}return r(e)},o.all=function(e){var t=Array.prototype.slice.call(e);return new o(function(e,n){function r(a,s){if(s&&("object"==typeof s||"function"==typeof s)){if(s instanceof o&&s.then===o.prototype.then){for(;3===s._81;)s=s._65;return 1===s._81?r(a,s._65):(2===s._81&&n(s._65),void s.then(function(e){r(a,e)},n))}var u=s.then;if("function"==typeof u){return void new o(u.bind(s)).then(function(e){r(a,e)},n)}}t[a]=s,0==--i&&e(t)}if(0===t.length)return e([]);for(var i=t.length,a=0;a<t.length;a++)r(a,t[a])})},o.reject=function(e){return new o(function(t,n){n(e)})},o.race=function(e){return new o(function(t,n){e.forEach(function(e){o.resolve(e).then(t,n)})})},o.prototype.catch=function(e){return this.then(null,e)}},function(e,t,n){"use strict";function r(){}function o(e){try{return e.then}catch(e){return _=e,v}}function i(e,t){try{return e(t)}catch(e){return _=e,v}}function a(e,t,n){try{e(t,n)}catch(e){return _=e,v}}function s(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._45=0,this._81=0,this._65=null,this._54=null,e!==r&&y(e,this)}function u(e,t,n){return new e.constructor(function(o,i){var a=new s(r);a.then(o,i),c(e,new h(t,n,a))})}function c(e,t){for(;3===e._81;)e=e._65;if(s._10&&s._10(e),0===e._81)return 0===e._45?(e._45=1,void(e._54=t)):1===e._45?(e._45=2,void(e._54=[e._54,t])):void e._54.push(t);l(e,t)}function l(e,t){m(function(){var n=1===e._81?t.onFulfilled:t.onRejected;if(null===n)return void(1===e._81?p(t.promise,e._65):f(t.promise,e._65));var r=i(n,e._65);r===v?f(t.promise,_):p(t.promise,r)})}function p(e,t){if(t===e)return f(e,new TypeError("A promise cannot be resolved with itself."));if(t&&("object"==typeof t||"function"==typeof t)){var n=o(t);if(n===v)return f(e,_);if(n===e.then&&t instanceof s)return e._81=3,e._65=t,void d(e);if("function"==typeof n)return void y(n.bind(t),e)}e._81=1,e._65=t,d(e)}function f(e,t){e._81=2,e._65=t,s._97&&s._97(e,t),d(e)}function d(e){if(1===e._45&&(c(e,e._54),e._54=null),2===e._45){for(var t=0;t<e._54.length;t++)c(e,e._54[t]);e._54=null}}function h(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function y(e,t){var n=!1,r=a(e,function(e){n||(n=!0,p(t,e))},function(e){n||(n=!0,f(t,e))});n||r!==v||(n=!0,f(t,_))}var m=n(4),_=null,v={};e.exports=s,s._10=null,s._97=null,s._61=r,s.prototype.then=function(e,t){if(this.constructor!==s)return u(this,e,t);var n=new s(r);return c(this,new h(e,t,n)),n}},function(e,t,n){"use strict";(function(t){function n(e){a.length||(i(),s=!0),a[a.length]=e}function r(){for(;u<a.length;){var e=u;if(u+=1,a[e].call(),u>c){for(var t=0,n=a.length-u;t<n;t++)a[t]=a[t+u];a.length-=u,u=0}}a.length=0,u=0,s=!1}function o(e){return function(){function t(){clearTimeout(n),clearInterval(r),e()}var n=setTimeout(t,0),r=setInterval(t,50)}}e.exports=n;var i,a=[],s=!1,u=0,c=1024,l=void 0!==t?t:self,p=l.MutationObserver||l.WebKitMutationObserver;i="function"==typeof p?function(e){var t=1,n=new p(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}(r):o(r),n.requestFlush=i,n.makeRequestCallFromTimer=o}).call(t,n(5))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r,o;!function(){"use strict";var n=function(){function e(){}function t(e,t){for(var n=t.length,r=0;r<n;++r)i(e,t[r])}function n(e,t){e[t]=!0}function r(e,t){for(var n in t)s.call(t,n)&&(e[n]=!!t[n])}function o(e,t){for(var n=t.split(u),r=n.length,o=0;o<r;++o)e[n[o]]=!0}function i(e,i){if(i){var a=typeof i;"string"===a?o(e,i):Array.isArray(i)?t(e,i):"object"===a?r(e,i):"number"===a&&n(e,i)}}function a(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=new e;t(i,r);var a=[];for(var s in i)i[s]&&a.push(s);return a.join(" ")}e.prototype=Object.create(null);var s={}.hasOwnProperty,u=/\s+/;return a}();void 0!==e&&e.exports?e.exports=n:(r=[],void 0!==(o=function(){return n}.apply(t,r))&&(e.exports=o))}()}]);