158 lines
150 KiB
JavaScript
158 lines
150 KiB
JavaScript
(this.webpackChunkdiscord_app=this.webpackChunkdiscord_app||[]).push([[46197],{154103:(e,t,n)=>{"use strict";e.exports=function(e){e=e||n.g.navigator.userAgent;return/Android/.test(e)}},850730:(e,t,n)=>{"use strict";var r=n(596085),i=n(820979);e.exports=function(e){return!(-1===(e=e||navigator.userAgent).indexOf("Chrome")&&-1===e.indexOf("CriOS")||r(e)||i(e))}},596085:e=>{"use strict";e.exports=function(e){return-1!==(e=e||navigator.userAgent).indexOf("Edge/")}},171260:(e,t,n)=>{"use strict";var r=n(757986);e.exports=function(e){return-1!==(e=e||n.g.navigator.userAgent).indexOf("MSIE")||r(e)}},757986:e=>{"use strict";e.exports=function(e){return-1!==(e=e||navigator.userAgent).indexOf("Trident/7")}},442937:e=>{"use strict";e.exports=function(e){return-1!==(e=e||navigator.userAgent).indexOf("MSIE 9")}},18738:(e,t,n)=>{"use strict";e.exports=function(e){e=e||n.g.navigator.userAgent;return/FxiOS/i.test(e)}},441762:(e,t,n)=>{"use strict";var r=n(522427),i=/webkit/i;e.exports=function(e){
|
|
e=e||navigator.userAgent;return r(e)&&function(e){return e.match(i)}(e)&&-1===e.indexOf("CriOS")}},72815:(e,t,n)=>{"use strict";var r=n(522427);e.exports=function(e){e=e||n.g.navigator.userAgent;return!!r(e)&&(!!function(e){return/\bGSA\b/.test(e)}(e)||/.+AppleWebKit(?!.*Safari)/.test(e))}},224604:(e,t,n)=>{"use strict";var r=n(72815);e.exports=function(e,t){t=void 0!==t?t:n.g.statusbar.visible;return r(e)&&t}},522427:(e,t,n)=>{"use strict";e.exports=function(e){e=e||n.g.navigator.userAgent;return/iPhone|iPod|iPad/i.test(e)}},768109:(e,t,n)=>{"use strict";var r=n(18738);e.exports=function(e){e=e||n.g.navigator.userAgent;return r(e)||/iPhone|iPod|iPad|Mobile|Tablet/i.test(e)&&/Firefox/i.test(e)}},820979:(e,t,n)=>{"use strict";e.exports=function(e){e=e||n.g.navigator.userAgent;return/SamsungBrowser/i.test(e)}},858965:(e,t,n)=>{"use strict";var r=n(850730);e.exports=function(e){e=e||n.g.navigator.userAgent;return!!n.g.PaymentRequest&&(!r(e)||function(e){var t=e.match(/Chrome\/(\d+)\./)
|
|
;return!!t&&parseInt(t[1],10)>=61}(e))}},902239:(e,t,n)=>{"use strict";var r=n(154103),i=n(18738),o=n(72815),s=n(850730),a=n(820979);function c(e){return(e=e||n.g.navigator.userAgent).indexOf("Opera Mini")>-1}e.exports=function(e){e=e||n.g.navigator.userAgent;return!(o(e)||i(e)||function(e){e=e||n.g.navigator.userAgent;return!!r(e)&&/Version\/[\d\.]+/.test(e)&&!c(e)}(e)||c(e)||function(e){var t;return!!(t=(e=e||n.g.navigator.userAgent).match(/CriOS\/(\d+)\./))&&parseInt(t[1],10)<48}(e)||function(e){return!s(e)&&!a(e)&&/samsung/i.test(e)}(e))}},461863:(e,t,n)=>{"use strict";var r=n(203353),i=n(895633),o=n(224692);e.exports=function(e){var t=document.createElement("iframe"),n=o({},i,e);if(n.style&&"string"!=typeof n.style){o(t.style,n.style);delete n.style}r(t,n);t.getAttribute("id")||(t.id=t.name);return t}},224692:e=>{"use strict";e.exports=function(e){var t=Array.prototype.slice.call(arguments,1);t.forEach((function(t){"object"==typeof t&&Object.keys(t).forEach((function(n){e[n]=t[n]
|
|
}))}));return e}},895633:e=>{"use strict";e.exports={src:"about:blank",frameBorder:0,allowtransparency:!0,scrolling:"no"}},203353:e=>{"use strict";e.exports=function(e,t){var n;for(var r in t)t.hasOwnProperty(r)&&(null==(n=t[r])?e.removeAttribute(r):e.setAttribute(r,n))}},953967:e=>{"use strict";e.exports=function(e){return function(){var t=arguments;setTimeout((function(){e.apply(null,t)}),1)}}},545469:e=>{"use strict";e.exports=function(e){var t=!1;return function(){if(!t){t=!0;e.apply(null,arguments)}}}},950580:e=>{"use strict";e.exports=function(e,t){if(!t)return e;e.then((function(e){t(null,e)})).catch((function(e){t(e)}))}},864548:(e,t,n)=>{"use strict";var r=n(953967),i=n(545469),o=n(950580);function s(e){return function(){var t,n=Array.prototype.slice.call(arguments),s=n[n.length-1];if("function"==typeof s){t=n.pop();t=i(r(t))}return o(e.apply(this,n),t)}}s.wrapPrototype=function(e,t){var n,r;n=(t=t||{}).ignoreMethods||[];r=!0===t.transformPrivateMethods
|
|
;Object.getOwnPropertyNames(e.prototype).filter((function(t){var i,o="constructor"!==t&&"function"==typeof e.prototype[t],s=-1===n.indexOf(t);i=!!r||"_"!==t.charAt(0);return o&&i&&s})).forEach((function(t){var n=e.prototype[t];e.prototype[t]=s(n)}));return e};e.exports=s},291759:(e,t,n)=>{"use strict";var r=n(715136),i=n(215384),o=n(809724).assign,s=n(573475),a=n(589585),c=n(441970),u=n(864548);function p(e){this._client=e.client}p.prototype.getRewardsBalance=function(e){var t,n=e.nonce;if(!n)return s.reject(new r({type:i.AMEX_NONCE_REQUIRED.type,code:i.AMEX_NONCE_REQUIRED.code,message:"getRewardsBalance must be called with a nonce."}));delete(t=o({_meta:{source:"american-express"},paymentMethodNonce:n},e)).nonce;return this._client.request({method:"get",endpoint:"payment_methods/amex_rewards_balance",data:t}).catch((function(e){return s.reject(new r({type:i.AMEX_NETWORK_ERROR.type,code:i.AMEX_NETWORK_ERROR.code,
|
|
message:"A network error occurred when getting the American Express rewards balance.",details:{originalError:e}}))}))};p.prototype.getExpressCheckoutProfile=function(e){return e.nonce?this._client.request({method:"get",endpoint:"payment_methods/amex_express_checkout_cards/"+e.nonce,data:{_meta:{source:"american-express"},paymentMethodNonce:e.nonce}}).catch((function(e){return s.reject(new r({type:i.AMEX_NETWORK_ERROR.type,code:i.AMEX_NETWORK_ERROR.code,message:"A network error occurred when getting the American Express Checkout nonce profile.",details:{originalError:e}}))})):s.reject(new r({type:i.AMEX_NONCE_REQUIRED.type,code:i.AMEX_NONCE_REQUIRED.code,message:"getExpressCheckoutProfile must be called with a nonce."}))};p.prototype.teardown=function(){c(this,a(p.prototype));return s.resolve()};e.exports=u.wrapPrototype(p)},215384:(e,t,n)=>{"use strict";var r=n(715136);e.exports={AMEX_NONCE_REQUIRED:{type:r.types.MERCHANT,code:"AMEX_NONCE_REQUIRED"},AMEX_NETWORK_ERROR:{
|
|
type:r.types.NETWORK,code:"AMEX_NETWORK_ERROR"}}},808577:(e,t,n)=>{"use strict";var r=n(291759),i=n(318327),o=n(864548);e.exports={create:o((function(e){return i.verify({name:"American Express",client:e.client}).then((function(){return new r(e)}))})),VERSION:"3.28.0"}},406394:(e,t,n)=>{"use strict";var r=n(715136),i=n(866834),o=n(673019),s=n(573475),a=n(589585),c=n(441970),u=n(864548);function p(e){this._client=e.client;Object.defineProperty(this,"merchantIdentifier",{value:this._client.getConfiguration().gatewayConfiguration.applePayWeb.merchantIdentifier,configurable:!1,writable:!1})}p.prototype.createPaymentRequest=function(e){var t=this._client.getConfiguration().gatewayConfiguration.applePayWeb,n={countryCode:t.countryCode,currencyCode:t.currencyCode,merchantCapabilities:t.merchantCapabilities||["supports3DS"],supportedNetworks:t.supportedNetworks.map((function(e){return"mastercard"===e?"masterCard":e}))};return Object.assign({},n,e)};p.prototype.performValidation=function(e){
|
|
var t,a=this;if(!e||!e.validationURL)return s.reject(new r(o.APPLE_PAY_VALIDATION_URL_REQUIRED));t={validationUrl:e.validationURL,domainName:e.domainName||n.g.location.hostname,merchantIdentifier:e.merchantIdentifier||this.merchantIdentifier};null!=e.displayName&&(t.displayName=e.displayName);return this._client.request({method:"post",endpoint:"apple_pay_web/sessions",data:{_meta:{source:"apple-pay"},applePayWebSession:t}}).then((function(e){i.sendEvent(a._client,"applepay.performValidation.succeeded");return s.resolve(e)})).catch((function(e){i.sendEvent(a._client,"applepay.performValidation.failed");return"CLIENT_REQUEST_ERROR"===e.code?s.reject(new r({type:o.APPLE_PAY_MERCHANT_VALIDATION_FAILED.type,code:o.APPLE_PAY_MERCHANT_VALIDATION_FAILED.code,message:o.APPLE_PAY_MERCHANT_VALIDATION_FAILED.message,details:{originalError:e.details.originalError}})):s.reject(new r({type:o.APPLE_PAY_MERCHANT_VALIDATION_NETWORK.type,code:o.APPLE_PAY_MERCHANT_VALIDATION_NETWORK.code,
|
|
message:o.APPLE_PAY_MERCHANT_VALIDATION_NETWORK.message,details:{originalError:e}}))}))};p.prototype.tokenize=function(e){var t=this;return e.token?this._client.request({method:"post",endpoint:"payment_methods/apple_payment_tokens",data:{_meta:{source:"apple-pay"},applePaymentToken:Object.assign({},e.token,{paymentData:btoa(JSON.stringify(e.token.paymentData))})}}).then((function(e){i.sendEvent(t._client,"applepay.tokenize.succeeded");return s.resolve(e.applePayCards[0])})).catch((function(e){i.sendEvent(t._client,"applepay.tokenize.failed");return s.reject(new r({type:o.APPLE_PAY_TOKENIZATION.type,code:o.APPLE_PAY_TOKENIZATION.code,message:o.APPLE_PAY_TOKENIZATION.message,details:{originalError:e}}))})):s.reject(new r(o.APPLE_PAY_PAYMENT_TOKEN_REQUIRED))};p.prototype.teardown=function(){c(this,a(p.prototype));return s.resolve()};e.exports=u.wrapPrototype(p)},673019:(e,t,n)=>{"use strict";var r=n(715136);e.exports={APPLE_PAY_NOT_ENABLED:{type:r.types.MERCHANT,
|
|
code:"APPLE_PAY_NOT_ENABLED",message:"Apple Pay is not enabled for this merchant."},APPLE_PAY_VALIDATION_URL_REQUIRED:{type:r.types.MERCHANT,code:"APPLE_PAY_VALIDATION_URL_REQUIRED",message:"performValidation must be called with a validationURL."},APPLE_PAY_MERCHANT_VALIDATION_NETWORK:{type:r.types.NETWORK,code:"APPLE_PAY_MERCHANT_VALIDATION_NETWORK",message:"A network error occurred when validating the Apple Pay merchant."},APPLE_PAY_MERCHANT_VALIDATION_FAILED:{type:r.types.MERCHANT,code:"APPLE_PAY_MERCHANT_VALIDATION_FAILED",message:"Make sure you have registered your domain name in the Braintree Control Panel."},APPLE_PAY_PAYMENT_TOKEN_REQUIRED:{type:r.types.MERCHANT,code:"APPLE_PAY_PAYMENT_TOKEN_REQUIRED",message:"tokenize must be called with a payment token."},APPLE_PAY_TOKENIZATION:{type:r.types.NETWORK,code:"APPLE_PAY_TOKENIZATION",message:"A network error occurred when processing the Apple Pay payment."}}},821692:(e,t,n)=>{"use strict"
|
|
;var r=n(715136),i=n(406394),o=n(866834),s=n(318327),a=n(673019),c=n(573475),u=n(864548);e.exports={create:u((function(e){return s.verify({name:"Apple Pay",client:e.client}).then((function(){if(!e.client.getConfiguration().gatewayConfiguration.applePayWeb)return c.reject(new r(a.APPLE_PAY_NOT_ENABLED));o.sendEvent(e.client,"applepay.initialized");return new i(e)}))})),VERSION:"3.28.0"}},985693:(e,t,n)=>{"use strict";var r=n(171260),i=n(442937);e.exports={isIe:r,isIe9:i}},841664:(e,t,n)=>{"use strict";var r=n(258427),i=n(716150),o=n(855167),s=n(715136),a=n(240914),c=n(815415),u=n(573475),p=n(864548),_=n(842903),d=n(161072),l=n(809724).assign,E=n(866834),h=n(190738),f=n(705966),A=n(792117),T=n(291593).VERSION,I=n(589585),y=n(441970);function N(e){var t,n,a;e=e||{};t=JSON.stringify(e);if(!(n=e.gatewayConfiguration))throw new s(f.CLIENT_MISSING_GATEWAY_CONFIGURATION);["assetsUrl","clientApiUrl","configUrl"].forEach((function(e){if(e in n&&!o(n[e]))throw new s({
|
|
type:f.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.type,code:f.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.code,message:e+" property is on an invalid domain."})}));this.getConfiguration=function(){return JSON.parse(t)};this._request=i;this._configuration=this.getConfiguration();this._clientApiBaseUrl=n.clientApiUrl+"/v1/";if(a=n.braintreeApi){this._braintreeApi={baseUrl:a.url+"/",accessToken:a.accessToken};if(!o(this._braintreeApi.baseUrl))throw new s({type:f.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.type,code:f.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.code,message:"braintreeApi URL is on an invalid domain."})}n.graphQL&&(this._graphQL=new r({graphQL:n.graphQL}))}N.prototype.request=function(e,t){var n=this,r=new u((function(t,r){var i,o,u,p;e.method?e.endpoint||(i="options.endpoint"):i="options.method";if(i)throw new s({type:f.CLIENT_OPTION_REQUIRED.type,code:f.CLIENT_OPTION_REQUIRED.code,message:i+" is required when making a request."});o="api"in e?e.api:"clientApi";p={
|
|
method:e.method,graphQL:n._graphQL,timeout:e.timeout};if("clientApi"===o){u=n._clientApiBaseUrl;p.data=c(n._configuration,e.data)}else{if("braintreeApi"!==o)throw new s({type:f.CLIENT_OPTION_INVALID.type,code:f.CLIENT_OPTION_INVALID.code,message:"options.api is invalid."});if(!n._braintreeApi)throw new s(A.BRAINTREE_API_ACCESS_RESTRICTED);u=n._braintreeApi.baseUrl;p.data=e.data;p.headers={"Braintree-Version":h.BRAINTREE_API_VERSION_HEADER,Authorization:"Bearer "+n._braintreeApi.accessToken}}p.url=u+e.endpoint;p.sendAnalyticsEvent=function(e){E.sendEvent(n,e)};n._request(p,(function(e,n,i){var o,c;c=function(e,t){var n;-1===e?n=new s(f.CLIENT_REQUEST_TIMEOUT):403===e?n=new s(f.CLIENT_AUTHORIZATION_INSUFFICIENT):429===e?n=new s(f.CLIENT_RATE_LIMITED):e>=500?n=new s(f.CLIENT_GATEWAY_NETWORK):(e<200||e>=400)&&(n=a(t,{type:f.CLIENT_REQUEST_ERROR.type,code:f.CLIENT_REQUEST_ERROR.code,message:f.CLIENT_REQUEST_ERROR.message}));if(n){n.details=n.details||{};n.details.httpStatus=e;return n}
|
|
}(i,e);if(c)r(c);else{o=l({_httpStatus:i},n);t(o)}}))}));if("function"!=typeof t)return r;t=_(d(t));r.then((function(e){t(null,e,e._httpStatus)})).catch((function(e){var n=e&&e.details&&e.details.httpStatus;t(e,null,n)}))};N.prototype.toJSON=function(){return this.getConfiguration()};N.prototype.getVersion=function(){return T};N.prototype.teardown=p((function(){y(this,I(N.prototype));return u.resolve()}));e.exports=N},190738:e=>{"use strict";e.exports={BRAINTREE_API_VERSION_HEADER:"2017-04-03"}},705966:(e,t,n)=>{"use strict";var r=n(715136);e.exports={CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN:{type:r.types.MERCHANT,code:"CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN"},CLIENT_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"CLIENT_OPTION_REQUIRED"},CLIENT_OPTION_INVALID:{type:r.types.MERCHANT,code:"CLIENT_OPTION_INVALID"},CLIENT_MISSING_GATEWAY_CONFIGURATION:{type:r.types.INTERNAL,code:"CLIENT_MISSING_GATEWAY_CONFIGURATION",message:"Missing gatewayConfiguration."},
|
|
CLIENT_INVALID_AUTHORIZATION:{type:r.types.MERCHANT,code:"CLIENT_INVALID_AUTHORIZATION",message:"Authorization is invalid. Make sure your client token or tokenization key is valid."},CLIENT_GATEWAY_NETWORK:{type:r.types.NETWORK,code:"CLIENT_GATEWAY_NETWORK",message:"Cannot contact the gateway at this time."},CLIENT_REQUEST_TIMEOUT:{type:r.types.NETWORK,code:"CLIENT_REQUEST_TIMEOUT",message:"Request timed out waiting for a reply."},CLIENT_REQUEST_ERROR:{type:r.types.NETWORK,code:"CLIENT_REQUEST_ERROR",message:"There was a problem with your request."},CLIENT_RATE_LIMITED:{type:r.types.MERCHANT,code:"CLIENT_RATE_LIMITED",message:"You are being rate-limited; please try again in a few minutes."},CLIENT_AUTHORIZATION_INSUFFICIENT:{type:r.types.MERCHANT,code:"CLIENT_AUTHORIZATION_INSUFFICIENT",message:"The authorization used has insufficient privileges."}}},752688:(e,t,n)=>{"use strict";var r=n(715136),i=n(573475),o=n(864548),s=n(716150),a=n(439548),c=n(291593),u=n(979814),p=n(705966)
|
|
;e.exports={getConfiguration:o((function(e){return new i((function(t,i){var o,_,d,l,E=a(),h={merchantAppId:n.g.location.host,platform:c.PLATFORM,sdkVersion:c.VERSION,source:c.SOURCE,integration:c.INTEGRATION,integrationType:c.INTEGRATION,sessionId:E};try{_=u(e.authorization)}catch(e){i(new r(p.CLIENT_INVALID_AUTHORIZATION));return}d=_.attrs;l=_.configUrl;d._meta=h;d.braintreeLibraryVersion=c.BRAINTREE_LIBRARY_VERSION;d.configVersion="3";s({url:l,method:"GET",data:d},(function(n,s,a){var c;if(n){c=403===a?p.CLIENT_AUTHORIZATION_INSUFFICIENT:p.CLIENT_GATEWAY_NETWORK;i(new r({type:c.type,code:c.code,message:c.message,details:{originalError:n}}))}else{o={authorization:e.authorization,authorizationType:d.tokenizationKey?"TOKENIZATION_KEY":"CLIENT_TOKEN",analyticsMetadata:h,gatewayConfiguration:s};t(o)}}))}))}))}},1651:(e,t,n)=>{"use strict";var r=n(715136),i=n(841664),o=n(752688).getConfiguration,s=n(573475),a=n(864548),c=n(792117),u={};e.exports={create:a((function(e){
|
|
return e.authorization?u[e.authorization]?s.resolve(u[e.authorization]):o(e).then((function(t){var n;e.debug&&(t.isDebug=!0);n=new i(t);u[e.authorization]=n;return n})):s.reject(new r({type:c.INSTANTIATION_OPTION_REQUIRED.type,code:c.INSTANTIATION_OPTION_REQUIRED.code,message:"options.authorization is required when instantiating a client."}))})),VERSION:"3.28.0",_clearCache:function(){u={}}}},838567:(e,t,n)=>{"use strict";var r=n(634452),i=n(985693),o=n(809724).assign,s=n(308363),a=n(123923),c=n(305973),u=c.isAvailable,p=n(869589),_=n(965859);function d(e,t,n){var l,E,h,f,A,T,I,y=e.url,N=e.graphQL,m=e.timeout,O=c.getRequestObject(),g=n,P=Boolean(N&&N.isGraphQLRequest(y,e.data));e.headers=o({"Content-Type":"application/json"},e.headers);y=(h=P?new p(e):new _(e)).getUrl();f=h.getBody();A=h.getMethod();T=h.getHeaders();if("GET"===A){y=r.queryify(y,f);f=null}if(u)O.onreadystatechange=function(){if(4===O.readyState)if(0===O.status&&P){delete e.graphQL;d(e,t,n)}else{I=a(O.responseText)
|
|
;E=h.adaptResponseBody(I);if((l=h.determineStatus(O.status,I))>=400||l<200){if(P&&function(e){return"unknown_error"===(!e.data&&e.errors&&e.errors[0]&&e.errors[0].extensions&&e.errors[0].extensions.errorType)}(I)){delete e.graphQL;d(e,t,n);return}if(t<1&&function(e){return(!e||408===e)&&i.isIe()}(l)){t++;d(e,t,n);return}g(E||"error",null,l||500)}else g(null,E,l)}};else{e.headers&&(y=r.queryify(y,T));O.onload=function(){g(null,a(O.responseText),O.status)};O.onerror=function(){g("error",null,500)};O.onprogress=function(){};O.ontimeout=function(){g("timeout",null,-1)}}try{O.open(A,y,!0)}catch(r){if(!P)throw r;delete e.graphQL;d(e,t,n);return}O.timeout=m;u&&Object.keys(T).forEach((function(e){O.setRequestHeader(e,T[e])}));try{O.send(s(A,f))}catch(e){}}e.exports={request:function(e,t){d(e,0,t)}}},965859:e=>{"use strict";function t(e){this._url=e.url;this._data=e.data;this._method=e.method;this._headers=e.headers}t.prototype.getUrl=function(){return this._url};t.prototype.getBody=function(){
|
|
return this._data};t.prototype.getMethod=function(){return this._method};t.prototype.getHeaders=function(){return this._headers};t.prototype.adaptResponseBody=function(e){return e};t.prototype.determineStatus=function(e){return e};e.exports=t},257705:(e,t,n)=>{"use strict";e.exports=function(){return n.g.navigator.userAgent}},106512:(e,t,n)=>{"use strict";var r=n(396386);e.exports=function(e){var t,n,i,o;e.data&&!e.errors?e.data.tokenizeCreditCard?t=(n=e.data.tokenizeCreditCard,i=n.creditCard,o=i.last4.substr(2,4),{creditCards:[{binData:i.binData,consumed:!1,description:"ending in "+o,nonce:n.token,details:{cardType:i.brand,lastFour:i.last4,lastTwo:o},type:"CreditCard",threeDSecureInfo:null}]}):e.data.tokenizeCvv&&(t=function(e){return{creditCards:[{consumed:!1,description:"",nonce:e.data.tokenizeCvv.token,details:{cardType:"Unknown",lastFour:"",lastTwo:""},type:"CreditCard",threeDSecureInfo:null}]}}(e)):t=r(e);return t}},396386:e=>{"use strict";function t(e,n,r){
|
|
var i,o=n.legacyCode,s=e[0];if(1!==e.length){r.forEach((function(e){e.field===s&&(i=e)}));if(!i){i={field:s,fieldErrors:[]};r.push(i)}t(e.slice(1),n,i.fieldErrors)}else r.push({code:o,field:s,message:n.message})}e.exports=function(e){var n,r=e.errors&&e.errors[0]&&e.errors[0].extensions&&e.errors[0].extensions.errorType;n="user_error"===r?function(e){var n=e.errors[0],r=n.extensions.legacyMessage,i=function(e){var n=[];e.forEach((function(e){t(e.inputPath.slice(1),e,n)}));return n}(n.extensions.errorDetails);return{error:{message:r},fieldErrors:i}}(e):r?function(e){return{error:{message:e.errors[0].message},fieldErrors:[]}}(e):{error:{message:"There was a problem serving your request"},fieldErrors:[]};return n}},716902:(e,t,n)=>{"use strict";var r=n(809724).assign;function i(e){var t=e.creditCard,n=t&&t.billingAddress,i=t&&t.expirationDate,o=t&&(t.expirationMonth||i&&i.split("/")[0].trim()),s=t&&(t.expirationYear||i&&i.split("/")[1].trim()),a={input:{creditCard:{number:t&&t.number,
|
|
expirationMonth:o,expirationYear:s,cvv:t&&t.cvv,cardholderName:t&&t.cardholderName},options:{}}};n&&(a.input.creditCard.billingAddress=n);a.input=function(e,t){var n;e.creditCard&&e.creditCard.options&&"boolean"==typeof e.creditCard.options.validate?n=e.creditCard.options.validate:e.authorizationFingerprint&&e.tokenizationKey||e.authorizationFingerprint?n=!0:e.tokenizationKey&&(n=!1);"boolean"==typeof n&&(t.options=r({validate:n},t.options));return t}(e,a.input);return a}e.exports=function(e){var t,n,r;if(e.creditCard&&!e.creditCard.number&&e.creditCard.cvv){t="mutation TokenizeCvv($input: TokenizeCvvInput!) { tokenizeCvv(input: $input) { token } }";n=function(e){return{input:{cvv:e.creditCard&&e.creditCard.cvv}}}(e);r="TokenizeCvv"}else{
|
|
t="mutation TokenizeCreditCard($input: TokenizeCreditCardInput!) { tokenizeCreditCard(input: $input) { token creditCard { brand last4 binData { prepaid healthcare debit durbinRegulated commercial payroll issuingBank countryOfIssuance productId } } } }";n=i(e);r="TokenizeCreditCard"}return JSON.stringify({query:t,variables:n,operationName:r})}},258427:(e,t,n)=>{"use strict";var r=n(985693),i={tokenize_credit_cards:"payment_methods/credit_cards"},o=["creditCard.options.unionPayEnrollment"];function s(e){this._config=e.graphQL}s.prototype.getGraphQLEndpoint=function(){return this._config.url};s.prototype.isGraphQLRequest=function(e,t){var n,s=this.getClientApiPath(e);if(!this._isGraphQLEnabled()||!s||r.isIe9())return!1;n=this._config.features.some((function(e){return i[e]===s}));return!function(e){return o.some((function(t){return void 0!==t.split(".").reduce((function(e,t){
|
|
return e&&e[t]}),e)}))}(t)&&n};s.prototype.getClientApiPath=function(e){var t,n=e.split("/client_api/v1/");n.length>1&&(t=n[1].split("?")[0]);return t};s.prototype._isGraphQLEnabled=function(){return Boolean(this._config)};e.exports=s},869589:(e,t,n)=>{"use strict";var r=n(809724).assign,i=n(716902),o=n(106512),s={"payment_methods/credit_cards":i},a={"payment_methods/credit_cards":o};function c(e){var t=e.graphQL.getClientApiPath(e.url);this._graphQL=e.graphQL;this._data=e.data;this._method=e.method;this._headers=e.headers;this._sendAnalyticsEvent=e.sendAnalyticsEvent||Function.prototype;this._generator=s[t];this._adapter=a[t];this._sendAnalyticsEvent("graphql.init")}c.prototype.getUrl=function(){return this._graphQL.getGraphQLEndpoint()};c.prototype.getBody=function(){var e=u(this._data);return this._generator(e)};c.prototype.getMethod=function(){return"POST"};c.prototype.getHeaders=function(){var e,t;if(this._data.authorizationFingerprint){
|
|
this._sendAnalyticsEvent("graphql.authorization-fingerprint");e=this._data.authorizationFingerprint}else{this._sendAnalyticsEvent("graphql.tokenization-key");e=this._data.tokenizationKey}t={Authorization:"Bearer "+e,"Braintree-Version":"2017-12-15"};return r({},this._headers,t)};c.prototype.adaptResponseBody=function(e){return this._adapter(e)};c.prototype.determineStatus=function(e,t){var n,r;if(200===e){r=t.errors&&t.errors[0]&&t.errors[0].extensions&&t.errors[0].extensions.errorType;n=t.data&&!t.errors?200:"user_error"===r?422:"developer_error"===r?403:"unknown_error"===r?500:function(e,t){return!e&&t.errors[0].message}(r,t)?403:500}else n=e||500;this._sendAnalyticsEvent("graphql.status."+e);this._sendAnalyticsEvent("graphql.determinedStatus."+n);return n};function u(e){var t={};Object.keys(e).forEach((function(n){var r,i=-1===(r=n).indexOf("_")?r:r.toLowerCase().replace(/(\_\w)/g,(function(e){return e[1].toUpperCase()}))
|
|
;"object"==typeof e[n]?t[i]=u(e[n]):"number"==typeof e[n]?t[i]=String(e[n]):t[i]=e[n]}));return t}e.exports=c},716150:(e,t,n)=>{"use strict";var r,i=n(842903),o=n(704292),s=n(838567),a=n(257705),c=n(136085);e.exports=function(e,t){t=i(t||Function.prototype);e.method=(e.method||"GET").toUpperCase();e.timeout=null==e.timeout?6e4:e.timeout;e.data=e.data||{};!function(){null==r&&(r=!(c()&&/MSIE\s(8|9)/.test(a())));return r}()?o.request(e,t):s.request(e,t)}},136085:(e,t,n)=>{"use strict";e.exports=function(){return"http:"===n.g.location.protocol}},704292:(e,t,n)=>{"use strict";var r,i=n(439548),o=n(634452),s={};function a(e){try{delete n.g[e]}catch(t){n.g[e]=null}}e.exports={request:function(e,t){var c,u="callback_json_"+i().replace(/-/g,""),p=e.url,_=e.data,d=e.method,l=e.timeout;p=o.queryify(p,_);c=function(e,t){var r=document.createElement("script"),i=!1;r.src=e;r.async=!0;r.onerror=function(){n.g[t]({message:"error",status:500})};r.onload=r.onreadystatechange=function(){
|
|
if(!(i||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i=!0;r.onload=r.onreadystatechange=null}};return r}(p=o.queryify(p,{_method:d,callback:u}),u);!function(e,t,r){n.g[r]=function(n){var i=n.status||500,o=null,c=null;delete n.status;i>=400||i<200?o=n:c=n;a(r);!function(e){e&&e.parentNode&&e.parentNode.removeChild(e)}(e);clearTimeout(s[r]);t(o,c,i)}}(c,t,u);!function(e,t){s[t]=setTimeout((function(){s[t]=null;n.g[t]({error:"timeout",status:-1});n.g[t]=function(){a(t)}}),e)}(l,u);r||(r=document.getElementsByTagName("head")[0]);r.appendChild(c)}}},123923:e=>{"use strict";e.exports=function(e){try{e=JSON.parse(e)}catch(e){}return e}},308363:e=>{"use strict";e.exports=function(e,t){if("string"!=typeof e)throw new Error("Method must be a string");"get"!==e.toLowerCase()&&null!=t&&(t="string"==typeof t?t:JSON.stringify(t));return t}},305973:(e,t,n)=>{"use strict";var r=n.g.XMLHttpRequest&&"withCredentials"in new n.g.XMLHttpRequest;e.exports={isAvailable:r,
|
|
getRequestObject:function(){return r?new XMLHttpRequest:new XDomainRequest}}},720232:(e,t,n)=>{"use strict";var r=n(715136);e.exports={DATA_COLLECTOR_KOUNT_NOT_ENABLED:{type:r.types.MERCHANT,code:"DATA_COLLECTOR_KOUNT_NOT_ENABLED",message:"Kount is not enabled for this merchant."},DATA_COLLECTOR_KOUNT_ERROR:{type:r.types.MERCHANT,code:"DATA_COLLECTOR_KOUNT_ERROR"},DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS:{type:r.types.MERCHANT,code:"DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS",message:"Data Collector must be created with Kount and/or PayPal."}}},400885:e=>{"use strict";function t(){this.sessionId=function(){var e,t="";for(e=0;e<32;e++)t+=Math.floor(16*Math.random()).toString(16);return t}();this._beaconId=(e=this.sessionId,t=(new Date).getTime()/1e3,"https://b.stats.paypal.com/counter.cgi?i=127.0.0.1&p="+e+"&t="+t+"&a=14");var e,t;this._parameterBlock=function(e,t){var n=document.body.appendChild(document.createElement("script"));n.type="application/json"
|
|
;n.setAttribute("fncls","fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99");n.text=JSON.stringify({f:e,s:"BRAINTREE_SIGNIN",b:t});return n}(this.sessionId,this._beaconId);this._thirdPartyBlock=function(){var e,t,n="https://www.paypalobjects.com/webstatic/r/fb/",r=document.createElement("iframe");r.src="about:blank";r.title="";r.role="presentation";(r.frameElement||r).style.cssText="width: 0; height: 0; border: 0; position: absolute; z-index: -999";document.body.appendChild(r);try{t=r.contentWindow.document}catch(n){e=document.domain;r.src='javascript:var d=document.open();d.domain="'+e+'";void(0);';t=r.contentWindow.document}t.open()._l=function(){var t=this.createElement("script");e&&(this.domain=e);t.id="js-iframe-async";t.src=n+"fb-all-prod.pp.min.js";this.body.appendChild(t)};function i(){t._l()}r.addEventListener?r.addEventListener("load",i,!1):r.attachEvent?r.attachEvent("onload",i):t.write('<body onload="document._l();">');t.close();return r}()}t.prototype.teardown=function(){
|
|
this._thirdPartyBlock.parentNode.removeChild(this._thirdPartyBlock)};e.exports={setup:function(){return new t}}},597916:(e,t,n)=>{"use strict";var r=n(552905),i=n(400885),o=n(715136),s=n(318327),a=n(589585),c=n(441970),u=n(573475),p=n(864548),_=n(720232);e.exports={create:p((function(e){var t={},n=[],d=function(e,t){return p((function(){return new u((function(n){var r;for(r=0;r<t.length;r++)t[r].teardown();c(e,a(e));n()}))}))}(t,n);return s.verify({name:"Data Collector",client:e.client}).then((function(){var s,a,c,p=e.client.getConfiguration();if(!0===e.kount){if(!p.gatewayConfiguration.kount)return u.reject(new o(_.DATA_COLLECTOR_KOUNT_NOT_ENABLED));try{a=r.setup({environment:p.gatewayConfiguration.environment,merchantId:p.gatewayConfiguration.kount.kountMerchantId})}catch(e){return u.reject(new o({type:_.DATA_COLLECTOR_KOUNT_ERROR.type,code:_.DATA_COLLECTOR_KOUNT_ERROR.code,message:e.message}))}s=a.deviceData;n.push(a)}else s={};if(!0===e.paypal){c=i.setup()
|
|
;s.correlation_id=c.sessionId;n.push(c)}if(0===n.length)return u.reject(new o(_.DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS));t.deviceData=JSON.stringify(s);t.rawDeviceData=s;t.teardown=d;return t}))})),VERSION:"3.28.0"}},552905:(e,t,n)=>{"use strict";var r=n(679313),i=n(620662),o="https://assets.qa.braintreepayments.com/data",s={development:o,qa:o,sandbox:"https://assets.braintreegateway.com/sandbox/data",production:"https://assets.braintreegateway.com/data"},a={};function c(e){var t=c.getCachedDeviceData(e.merchantId);if(t){this.deviceData=t;this._isCached=!0}else{this._currentEnvironment=this._initializeEnvironment(e);r.random.startCollectors();this._deviceSessionId=this._generateDeviceSessionId();this.deviceData=this._getDeviceData();c.setCachedDeviceData(e.merchantId,this.deviceData);this._iframe=this._setupIFrame()}}c.getCachedDeviceData=function(e){return a[e]};c.setCachedDeviceData=function(e,t){a[e]=t};c.prototype.teardown=function(){if(!this._isCached){r.random.stopCollectors()
|
|
;this._removeIframe()}};c.prototype._removeIframe=function(){this._iframe.parentNode.removeChild(this._iframe)};c.prototype._getDeviceData=function(){return i({deviceSessionId:this._deviceSessionId,fraudMerchantId:this._currentEnvironment.id})};c.prototype._generateDeviceSessionId=function(){var e;e=r.random.randomWords(4,0);return r.codec.hex.fromBits(e)};c.prototype._setupIFrame=function(){var e,t,n=this;e="?m="+this._currentEnvironment.id+"&s="+this._deviceSessionId;(t=document.createElement("iframe")).width=1;t.id="braintreeDataFrame-"+this._deviceSessionId;t.height=1;t.frameBorder=0;t.scrolling="no";document.body.appendChild(t);setTimeout((function(){t.src=n._currentEnvironment.url+"/logo.htm"+e;t.innerHTML='<img src="'+n._currentEnvironment.url+"/logo.gif"+e+'" />'}),10);return t};c.prototype._initializeEnvironment=function(e){var t=s[e.environment];if(null==t)throw new Error(e.environment+" is not a valid environment for kount.environment");return{url:t,name:e.environment,
|
|
id:e.merchantId}};e.exports={setup:function(e){return new c(null!=e?e:{})},Kount:c,environmentUrls:s}},679313:function(e,t){"use strict";var n={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(e){this.toString=function(){return"CORRUPT: "+this.message};this.message=e},invalid:function(e){this.toString=function(){return"INVALID: "+this.message};this.message=e},bug:function(e){this.toString=function(){return"BUG: "+this.message};this.message=e},notReady:function(e){this.toString=function(){return"NOT READY: "+this.message};this.message=e}}};n.cipher.aes=function(e){this.l[0][0][0]||this.G();var t,r,i,o,s=this.l[0][4],a=this.l[1],c=1;if(4!==(t=e.length)&&6!==t&&8!==t)throw new n.exception.invalid("invalid aes key size");this.b=[i=e.slice(0),o=[]];for(e=t;e<4*t+28;e++){r=i[e-1];(0==e%t||8===t&&4==e%t)&&(r=s[r>>>24]<<24^s[r>>16&255]<<16^s[r>>8&255]<<8^s[255&r],0==e%t&&(r=r<<8^r>>>24^c<<24,c=c<<1^283*(c>>7)));i[e]=i[e-t]^r}for(t=0;e;t++,
|
|
e--)r=i[3&t?e:e-4],o[t]=4>=e||4>t?r:a[0][s[r>>>24]]^a[1][s[r>>16&255]]^a[2][s[r>>8&255]]^a[3][s[255&r]]};n.cipher.aes.prototype={encrypt:function(e){return r(this,e,0)},decrypt:function(e){return r(this,e,1)},l:[[[],[],[],[],[]],[[],[],[],[],[]]],G:function(){var e,t,n,r,i,o,s,a=this.l[0],c=this.l[1],u=a[4],p=c[4],_=[],d=[];for(e=0;256>e;e++)d[(_[e]=e<<1^283*(e>>7))^e]=e;for(t=n=0;!u[t];t^=r||1,n=d[n]||1)for(o=(o=n^n<<1^n<<2^n<<3^n<<4)>>8^255&o^99,u[t]=o,p[o]=t,s=16843009*(i=_[e=_[r=_[t]]])^65537*e^257*r^16843008*t,i=257*_[o]^16843008*o,e=0;4>e;e++)a[e][t]=i=i<<24^i>>>8,c[e][o]=s=s<<24^s>>>8;for(e=0;5>e;e++)a[e]=a[e].slice(0),c[e]=c[e].slice(0)}};function r(e,t,r){if(4!==t.length)throw new n.exception.invalid("invalid aes block size");var i=e.b[r],o=t[0]^i[0],s=t[r?3:1]^i[1],a=t[2]^i[2];t=t[r?1:3]^i[3];var c,u,p,_,d=i.length/4-2,l=4,E=[0,0,0,0];e=(c=e.l[r])[0];var h=c[1],f=c[2],A=c[3],T=c[4];for(_=0;_<d;_++)c=e[o>>>24]^h[s>>16&255]^f[a>>8&255]^A[255&t]^i[l],
|
|
u=e[s>>>24]^h[a>>16&255]^f[t>>8&255]^A[255&o]^i[l+1],p=e[a>>>24]^h[t>>16&255]^f[o>>8&255]^A[255&s]^i[l+2],t=e[t>>>24]^h[o>>16&255]^f[s>>8&255]^A[255&a]^i[l+3],l+=4,o=c,s=u,a=p;for(_=0;4>_;_++)E[r?3&-_:_]=T[o>>>24]<<24^T[s>>16&255]<<16^T[a>>8&255]<<8^T[255&t]^i[l++],c=o,o=s,s=a,a=t,t=c;return E}n.bitArray={bitSlice:function(e,t,r){e=n.bitArray.M(e.slice(t/32),32-(31&t)).slice(1);return void 0===r?e:n.bitArray.clamp(e,r-t)},extract:function(e,t,n){var r=Math.floor(-t-n&31);return(-32&(t+n-1^t)?e[t/32|0]<<32-r^e[t/32+1|0]>>>r:e[t/32|0]>>>r)&(1<<n)-1},concat:function(e,t){if(0===e.length||0===t.length)return e.concat(t);var r=e[e.length-1],i=n.bitArray.getPartial(r);return 32===i?e.concat(t):n.bitArray.M(t,i,0|r,e.slice(0,e.length-1))},bitLength:function(e){var t=e.length;return 0===t?0:32*(t-1)+n.bitArray.getPartial(e[t-1])},clamp:function(e,t){if(32*e.length<t)return e;var r=(e=e.slice(0,Math.ceil(t/32))).length;t&=31;0<r&&t&&(e[r-1]=n.bitArray.partial(t,e[r-1]&2147483648>>t-1,1))
|
|
;return e},partial:function(e,t,n){return 32===e?t:(n?0|t:t<<32-e)+1099511627776*e},getPartial:function(e){return Math.round(e/1099511627776)||32},equal:function(e,t){if(n.bitArray.bitLength(e)!==n.bitArray.bitLength(t))return!1;var r,i=0;for(r=0;r<e.length;r++)i|=e[r]^t[r];return 0===i},M:function(e,t,r,i){var o;o=0;for(void 0===i&&(i=[]);32<=t;t-=32)i.push(r),r=0;if(0===t)return i.concat(e);for(o=0;o<e.length;o++)i.push(r|e[o]>>>t),r=e[o]<<32-t;o=e.length?e[e.length-1]:0;e=n.bitArray.getPartial(o);i.push(n.bitArray.partial(t+e&31,32<t+e?r:i.pop(),1));return i},Y:function(e,t){return[e[0]^t[0],e[1]^t[1],e[2]^t[2],e[3]^t[3]]},byteswapM:function(e){var t,n;for(t=0;t<e.length;++t)n=e[t],e[t]=n>>>24|n>>>8&65280|(65280&n)<<8|n<<24;return e}};n.codec.utf8String={fromBits:function(e){var t,r,i="",o=n.bitArray.bitLength(e);for(t=0;t<o/8;t++)0==(3&t)&&(r=e[t/4]),i+=String.fromCharCode(r>>>8>>>8>>>8),r<<=8;return decodeURIComponent(escape(i))},toBits:function(e){
|
|
e=unescape(encodeURIComponent(e));var t,r=[],i=0;for(t=0;t<e.length;t++)i=i<<8|e.charCodeAt(t),3==(3&t)&&(r.push(i),i=0);3&t&&r.push(n.bitArray.partial(8*(3&t),i));return r}};n.codec.hex={fromBits:function(e){var t,r="";for(t=0;t<e.length;t++)r+=(0xf00000000000+(0|e[t])).toString(16).substr(4);return r.substr(0,n.bitArray.bitLength(e)/4)},toBits:function(e){var t,r,i=[];r=(e=e.replace(/\s|0x/g,"")).length;e+="00000000";for(t=0;t<e.length;t+=8)i.push(0^parseInt(e.substr(t,8),16));return n.bitArray.clamp(i,4*r)}};n.hash.sha256=function(e){this.b[0]||this.G();e?(this.u=e.u.slice(0),this.o=e.o.slice(0),this.h=e.h):this.reset()};n.hash.sha256.hash=function(e){return(new n.hash.sha256).update(e).finalize()};n.hash.sha256.prototype={blockSize:512,reset:function(){this.u=this.K.slice(0);this.o=[];this.h=0;return this},update:function(e){"string"==typeof e&&(e=n.codec.utf8String.toBits(e));var t,r=this.o=n.bitArray.concat(this.o,e);t=this.h
|
|
;if(9007199254740991<(e=this.h=t+n.bitArray.bitLength(e)))throw new n.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var o=new Uint32Array(r),s=0;for(t=512+t-(512+t&511);t<=e;t+=512)i(this,o.subarray(16*s,16*(s+1))),s+=1;r.splice(0,16*s)}else for(t=512+t-(512+t&511);t<=e;t+=512)i(this,r.splice(0,16));return this},finalize:function(){var e,t=this.o,r=this.u;for(e=(t=n.bitArray.concat(t,[n.bitArray.partial(1,1)])).length+2;15&e;e++)t.push(0);t.push(Math.floor(this.h/4294967296));for(t.push(0|this.h);t.length;)i(this,t.splice(0,16));this.reset();return r},K:[],b:[],G:function(){function e(e){return 4294967296*(e-Math.floor(e))|0}for(var t,n,r=0,i=2;64>r;i++){n=!0;for(t=2;t*t<=i;t++)if(0==i%t){n=!1;break}n&&(8>r&&(this.K[r]=e(Math.pow(i,.5))),this.b[r]=e(Math.pow(i,1/3)),r++)}}};function i(e,t){var n,r,i,o=e.u,s=e.b,a=o[0],c=o[1],u=o[2],p=o[3],_=o[4],d=o[5],l=o[6],E=o[7];for(n=0;64>n;n++)16>n?r=t[n]:(r=t[n+1&15],i=t[n+14&15],
|
|
r=t[15&n]=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(i>>>17^i>>>19^i>>>10^i<<15^i<<13)+t[15&n]+t[n+9&15]|0),r=r+E+(_>>>6^_>>>11^_>>>25^_<<26^_<<21^_<<7)+(l^_&(d^l))+s[n],E=l,l=d,d=_,_=p+r|0,p=u,u=c,a=r+((c=a)&u^p&(c^u))+(c>>>2^c>>>13^c>>>22^c<<30^c<<19^c<<10)|0;o[0]=o[0]+a|0;o[1]=o[1]+c|0;o[2]=o[2]+u|0;o[3]=o[3]+p|0;o[4]=o[4]+_|0;o[5]=o[5]+d|0;o[6]=o[6]+l|0;o[7]=o[7]+E|0}n.prng=function(e){this.c=[new n.hash.sha256];this.i=[0];this.H=0;this.v={};this.F=0;this.J={};this.L=this.f=this.j=this.T=0;this.b=[0,0,0,0,0,0,0,0];this.g=[0,0,0,0];this.C=void 0;this.D=e;this.s=!1;this.B={progress:{},seeded:{}};this.m=this.S=0;this.w=1;this.A=2;this.O=65536;this.I=[0,48,64,96,128,192,256,384,512,768,1024];this.P=3e4;this.N=80};n.prng.prototype={randomWords:function(e,t){var r,i,o=[];if((r=this.isReady(t))===this.m)throw new n.exception.notReady("generator isn't seeded");if(r&this.A){r=!(r&this.w);i=[];var s,u=0;this.L=i[0]=(new Date).valueOf()+this.P;for(s=0;16>s;s++)i.push(4294967296*Math.random()|0)
|
|
;for(s=0;s<this.c.length&&(i=i.concat(this.c[s].finalize()),u+=this.i[s],this.i[s]=0,r||!(this.H&1<<s));s++);this.H>=1<<this.c.length&&(this.c.push(new n.hash.sha256),this.i.push(0));this.f-=u;u>this.j&&(this.j=u);this.H++;this.b=n.hash.sha256.hash(this.b.concat(i));this.C=new n.cipher.aes(this.b);for(r=0;4>r&&(this.g[r]=this.g[r]+1|0,!this.g[r]);r++);}for(r=0;r<e;r+=4)0==(r+1)%this.O&&a(this),i=c(this),o.push(i[0],i[1],i[2],i[3]);a(this);return o.slice(0,e)},setDefaultParanoia:function(e,t){if(0===e&&"Setting paranoia=0 will ruin your security; use it only for testing"!==t)throw new n.exception.invalid("Setting paranoia=0 will ruin your security; use it only for testing");this.D=e},addEntropy:function(e,t,r){r=r||"user";var i,s,a=(new Date).valueOf(),c=this.v[r],u=this.isReady(),p=0;void 0===(i=this.J[r])&&(i=this.J[r]=this.T++);void 0===c&&(c=this.v[r]=0);this.v[r]=(this.v[r]+1)%this.c.length;switch(typeof e){case"number":void 0===t&&(t=1);this.c[c].update([i,this.F++,1,t,a,1,0|e])
|
|
;break;case"object":if("[object Uint32Array]"===(r=Object.prototype.toString.call(e))){s=[];for(r=0;r<e.length;r++)s.push(e[r]);e=s}else for("[object Array]"!==r&&(p=1),r=0;r<e.length&&!p;r++)"number"!=typeof e[r]&&(p=1);if(!p){if(void 0===t)for(r=t=0;r<e.length;r++)for(s=e[r];0<s;)t++,s>>>=1;this.c[c].update([i,this.F++,2,t,a,e.length].concat(e))}break;case"string":void 0===t&&(t=e.length);this.c[c].update([i,this.F++,3,t,a,e.length]);this.c[c].update(e);break;default:p=1}if(p)throw new n.exception.bug("random: addEntropy only supports number, array of numbers or string");this.i[c]+=t;this.f+=t;u===this.m&&(this.isReady()!==this.m&&o("seeded",Math.max(this.j,this.f)),o("progress",this.getProgress()))},isReady:function(e){e=this.I[void 0!==e?e:this.D];return this.j&&this.j>=e?this.i[0]>this.N&&(new Date).valueOf()>this.L?this.A|this.w:this.w:this.f>=e?this.A|this.m:this.m},getProgress:function(e){e=this.I[e||this.D];return this.j>=e||this.f>e?1:this.f/e},startCollectors:function(){
|
|
if(!this.s){this.a={loadTimeCollector:u(this,this.V),mouseCollector:u(this,this.W),keyboardCollector:u(this,this.U),accelerometerCollector:u(this,this.R),touchCollector:u(this,this.X)};if(window.addEventListener)window.addEventListener("load",this.a.loadTimeCollector,!1),window.addEventListener("mousemove",this.a.mouseCollector,!1),window.addEventListener("keypress",this.a.keyboardCollector,!1),window.addEventListener("devicemotion",this.a.accelerometerCollector,!1),window.addEventListener("touchmove",this.a.touchCollector,!1);else{if(!document.attachEvent)throw new n.exception.bug("can't attach event");document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector)}this.s=!0}},stopCollectors:function(){this.s&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,!1),window.removeEventListener("mousemove",this.a.mouseCollector,!1),
|
|
window.removeEventListener("keypress",this.a.keyboardCollector,!1),window.removeEventListener("devicemotion",this.a.accelerometerCollector,!1),window.removeEventListener("touchmove",this.a.touchCollector,!1)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.s=!1)},addEventListener:function(e,t){this.B[e][this.S++]=t},removeEventListener:function(e,t){var n,r,i=this.B[e],o=[];for(r in i)i.hasOwnProperty(r)&&i[r]===t&&o.push(r);for(n=0;n<o.length;n++)delete i[r=o[n]]},U:function(){s(this,1)},W:function(e){var t,n;try{t=e.x||e.clientX||e.offsetX||0,n=e.y||e.clientY||e.offsetY||0}catch(e){n=t=0}0!=t&&0!=n&&this.addEntropy([t,n],2,"mouse");s(this,0)},X:function(e){e=e.touches[0]||e.changedTouches[0];this.addEntropy([e.pageX||e.clientX,e.pageY||e.clientY],1,"touch");s(this,0)},V:function(){s(this,2)},R:function(e){
|
|
e=e.accelerationIncludingGravity.x||e.accelerationIncludingGravity.y||e.accelerationIncludingGravity.z;if(window.orientation){var t=window.orientation;"number"==typeof t&&this.addEntropy(t,1,"accelerometer")}e&&this.addEntropy(e,2,"accelerometer");s(this,0)}};function o(e,t){var r,i=n.random.B[e],o=[];for(r in i)i.hasOwnProperty(r)&&o.push(i[r]);for(r=0;r<o.length;r++)o[r](t)}function s(e,t){"undefined"!=typeof window&&window.performance&&"function"==typeof window.performance.now?e.addEntropy(window.performance.now(),t,"loadtime"):e.addEntropy((new Date).valueOf(),t,"loadtime")}function a(e){e.b=c(e).concat(c(e));e.C=new n.cipher.aes(e.b)}function c(e){for(var t=0;4>t&&(e.g[t]=e.g[t]+1|0,!e.g[t]);t++);return e.C.encrypt(e.g)}function u(e,t){return function(){t.apply(e,arguments)}}n.random=new n.prng(6);e:try{var p,_,d,l;if(l=void 0!==e&&e.exports){var E;try{E=require("crypto")}catch(e){E=null}l=_=E}if(l&&_.randomBytes)p=_.randomBytes(128),p=new Uint32Array(new Uint8Array(p).buffer),
|
|
n.random.addEntropy(p,1024,"crypto['randomBytes']");else if("undefined"!=typeof window&&"undefined"!=typeof Uint32Array){d=new Uint32Array(32);if(window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(d);else{if(!window.msCrypto||!window.msCrypto.getRandomValues)break e;window.msCrypto.getRandomValues(d)}n.random.addEntropy(d,1024,"crypto['getRandomValues']")}}catch(e){"undefined"!=typeof window&&window.console&&(console.log("There was an error collecting entropy from the browser:"),console.log(e))}void 0!==e&&e.exports&&(e.exports=n);"function"==typeof define&&define([],(function(){return n}))},799084:(e,t,n)=>{"use strict";var r=n(858965),i=n(154103);e.exports={isAndroid:i,supportsPaymentRequestApi:r}},895841:(e,t,n)=>{"use strict";var r=n(715136),i=n(561902),o=n(573475),s=n(864548);function a(e){i.call(this,{client:e.client,enabledPaymentMethods:{basicCard:!1,googlePay:!0}});this._analyticsName="google-payment"}a.prototype=Object.create(i.prototype,{constructor:a
|
|
});a.prototype.createSupportedPaymentMethodsConfiguration=function(e){return i.prototype.createSupportedPaymentMethodsConfiguration.call(this,"googlePay",e)};a.prototype.tokenize=function(e){var t;if(e.supportedPaymentMethods){if("https://google.com/pay"!==e.supportedPaymentMethods.supportedMethods[0])return o.reject(new r({type:r.types.MERCHANT,code:"GOOGLE_PAYMENT_CAN_ONLY_TOKENIZE_WITH_GOOGLE_PAYMENT",message:"Only Google Pay is supported in supportedPaymentMethods."}));t=[e.supportedPaymentMethods]}return i.prototype.tokenize.call(this,{supportedPaymentMethods:t,details:e.details,options:e.options})};e.exports=s.wrapPrototype(a)},881367:(e,t,n)=>{"use strict";var r=n(318327),i=n(715136),o=n(799084),s=n(895841),a=n(573475),c=n(864548);e.exports={create:c((function(e){return r.verify({name:"Google Pay",client:e.client}).then((function(){return e.client.getConfiguration().gatewayConfiguration.androidPay?new s(e).initialize():a.reject(new i({type:i.types.MERCHANT,
|
|
code:"GOOGLE_PAYMENT_NOT_ENABLED",message:"Google Pay is not enabled for this merchant."}))}))})),isSupported:function(){return Boolean(o.supportsPaymentRequestApi()&&o.isAndroid())},VERSION:"3.28.0"}},412648:(e,t,n)=>{"use strict";var r=n(715136),i=n(960641),o=n(199894).whitelistedAttributes;e.exports=function(e,t){var n;o.hasOwnProperty(e)?null==t||function(e,t){if("string"===o[e])return"string"==typeof t||"number"==typeof t;if("boolean"===o[e])return"true"===String(t)||"false"===String(t);return!1}(e,t)||(n=new r({type:i.HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED.type,code:i.HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED.code,message:'Value "'+t+'" is not allowed for "'+e+'" attribute.'})):n=new r({type:i.HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED.type,code:i.HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED.code,message:'The "'+e+'" attribute is not supported in Hosted Fields.'});return n}},932854:(e,t,n)=>{"use strict";var r=n(199894),i=n(198533);e.exports=function(e,t,n){
|
|
return e+"/web/"+r.VERSION+"/html/hosted-fields-frame"+i(n)+".html#"+t}},980777:(e,t,n)=>{"use strict";var r=n(512250),i=n(45950),o=n(461863),s=n(725279),a=n(715136),c=n(932854),u=n(199894),p=n(960641),_=n(291593).INTEGRATION_TIMEOUT_MS,d=n(439548),l=n(369828),E=n(935958),h=u.events,f=n(549614),A=n(607566),T=n(866834),I=u.whitelistedFields,y=n(589585),N=n(441970),m=n(792117),O=n(494916),g=n(412648),P=n(573475),R=n(864548);function S(e){return function(t){var n,r=t.merchantPayload,o=r.emittedBy,s=e[o].containerElement;Object.keys(r.fields).forEach((function(t){r.fields[t].container=e[t].containerElement}));n=r.fields[o];"blur"===t.type&&function(e){var t;if(!E.isIos())return;if(document.activeElement===document.body){if(!(t=e.querySelector("input"))){(t=document.createElement("input")).type="button";t.style.height="0px";t.style.width="0px";t.style.opacity="0";t.style.padding="0";t.style.position="absolute";t.style.left="-200%";t.style.top="0px";e.insertBefore(t,e.firstChild)}t.focus()
|
|
;t.blur()}}(s);i.toggle(s,u.externalClasses.FOCUSED,n.isFocused);i.toggle(s,u.externalClasses.VALID,n.isValid);i.toggle(s,u.externalClasses.INVALID,!n.isPotentiallyValid);this._state={cards:r.cards,fields:r.fields};this._emit(t.type,r)}}function C(e){var t,l,E=this,I={},g=0,P=d();l=e.client.getConfiguration();if(!e.fields)throw new a({type:m.INSTANTIATION_OPTION_REQUIRED.type,code:m.INSTANTIATION_OPTION_REQUIRED.code,message:"options.fields is required when instantiating Hosted Fields."});f.call(this);this._injectedNodes=[];this._destructor=new r;this._fields=I;this._state={fields:{},cards:O("")};this._bus=new s({channel:P,merchantUrl:location.href});this._destructor.registerFunctionForTeardown((function(){E._bus.teardown()}));this._client=e.client;T.sendEvent(this._client,"custom.hosted-fields.initialized");Object.keys(e.fields).forEach(function(t){var r,i,s;if(!u.whitelistedFields.hasOwnProperty(t))throw new a({type:p.HOSTED_FIELDS_INVALID_FIELD_KEY.type,
|
|
code:p.HOSTED_FIELDS_INVALID_FIELD_KEY.code,message:'"'+t+'" is not a valid field.'});r=e.fields[t];if(!(i=document.querySelector(r.selector)))throw new a({type:p.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.type,code:p.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.code,message:p.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.message,details:{fieldSelector:r.selector,fieldKey:t}});if(i.querySelector('iframe[name^="braintree-"]'))throw new a({type:p.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.type,code:p.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.code,message:p.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.message,details:{fieldSelector:r.selector,fieldKey:t}});if(r.maxlength&&"number"!=typeof r.maxlength)throw new a({type:p.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.type,code:p.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.code,message:"The value for maxlength must be a number.",details:{fieldKey:t}});if(r.minlength&&"number"!=typeof r.minlength)throw new a({type:p.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.type,
|
|
code:p.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.code,message:"The value for minlength must be a number.",details:{fieldKey:t}});s=o({type:t,name:"braintree-hosted-field-"+t,style:u.defaultIFrameStyle});this._injectedNodes=this._injectedNodes.concat(A(s,i));this._setupLabelFocus(t,i);I[t]={frameElement:s,containerElement:i};g++;this._state.fields[t]={isEmpty:!0,isValid:!1,isPotentiallyValid:!0,isFocused:!1,container:i};setTimeout((function(){n.g.navigator&&n.g.navigator.vendor&&-1===n.g.navigator.vendor.indexOf("Apple")&&(s.src="about:blank");setTimeout((function(){s.src=c(l.gatewayConfiguration.assetsUrl,P,l.isDebug)}),0)}),0)}.bind(this));t=setTimeout((function(){T.sendEvent(E._client,"custom.hosted-fields.load.timed-out");E._emit("timeout")}),_);this._bus.on(h.FRAME_READY,(function(n){if(0===--g){clearTimeout(t);n(e);E._emit("ready")}}));this._bus.on(h.INPUT_EVENT,S(I).bind(this));this._destructor.registerFunctionForTeardown((function(){var e,t,n;for(e=0;e<E._injectedNodes.length;e++){
|
|
(n=(t=E._injectedNodes[e]).parentNode).removeChild(t);i.remove(n,u.externalClasses.FOCUSED,u.externalClasses.INVALID,u.externalClasses.VALID)}}));this._destructor.registerFunctionForTeardown((function(){var e=y(C.prototype).concat(y(f.prototype));N(E,e)}))}C.prototype=Object.create(f.prototype,{constructor:C});C.prototype._setupLabelFocus=function(e,t){var n,r,i=E.isIos(),o=this._bus;if(!i&&null!=t.id){n=(n=Array.prototype.slice.call(document.querySelectorAll('label[for="'+t.id+'"]'))).concat(l(t,"label"));for(r=0;r<n.length;r++)n[r].addEventListener("click",s,!1);this._destructor.registerFunctionForTeardown((function(){for(r=0;r<n.length;r++)n[r].removeEventListener("click",s,!1)}))}function s(){o.emit(h.TRIGGER_INPUT_FOCUS,e)}};C.prototype.teardown=function(){var e=this;return new P((function(t,n){e._destructor.teardown((function(r){T.sendEvent(e._client,"custom.hosted-fields.teardown-completed");r?n(r):t()}))}))};C.prototype.tokenize=function(e){var t=this;e||(e={})
|
|
;return new P((function(n,r){t._bus.emit(h.TOKENIZATION_REQUEST,e,(function(e){var t=e[0],i=e[1];t?r(t):n(i)}))}))};C.prototype.addClass=function(e,t){var n;I.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(h.ADD_CLASS,e,t):n=new a({type:p.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:p.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot add class to "'+e+'" field because it is not part of the current Hosted Fields options.'}):n=new a({type:p.HOSTED_FIELDS_FIELD_INVALID.type,code:p.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when adding a class.'});return n?P.reject(n):P.resolve()};C.prototype.removeClass=function(e,t){var n;I.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(h.REMOVE_CLASS,e,t):n=new a({type:p.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:p.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot remove class from "'+e+'" field because it is not part of the current Hosted Fields options.'
|
|
}):n=new a({type:p.HOSTED_FIELDS_FIELD_INVALID.type,code:p.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when removing a class.'});return n?P.reject(n):P.resolve()};C.prototype.setAttribute=function(e){var t,n;I.hasOwnProperty(e.field)?this._fields.hasOwnProperty(e.field)?(t=g(e.attribute,e.value))?n=t:this._bus.emit(h.SET_ATTRIBUTE,e.field,e.attribute,e.value):n=new a({type:p.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:p.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot set attribute for "'+e.field+'" field because it is not part of the current Hosted Fields options.'}):n=new a({type:p.HOSTED_FIELDS_FIELD_INVALID.type,code:p.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e.field+'" is not a valid field. You must use a valid field option when setting an attribute.'});return n?P.reject(n):P.resolve()};C.prototype.setMessage=function(e){this._bus.emit(h.SET_MESSAGE,e.field,e.message)};C.prototype.removeAttribute=function(e){
|
|
var t,n;I.hasOwnProperty(e.field)?this._fields.hasOwnProperty(e.field)?(t=g(e.attribute))?n=t:this._bus.emit(h.REMOVE_ATTRIBUTE,e.field,e.attribute):n=new a({type:p.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:p.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot remove attribute for "'+e.field+'" field because it is not part of the current Hosted Fields options.'}):n=new a({type:p.HOSTED_FIELDS_FIELD_INVALID.type,code:p.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e.field+'" is not a valid field. You must use a valid field option when removing an attribute.'});return n?P.reject(n):P.resolve()};C.prototype.setPlaceholder=function(e,t){return this.setAttribute({field:e,attribute:"placeholder",value:t})};C.prototype.clear=function(e){var t;I.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(h.CLEAR_FIELD,e):t=new a({type:p.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:p.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,
|
|
message:'Cannot clear "'+e+'" field because it is not part of the current Hosted Fields options.'}):t=new a({type:p.HOSTED_FIELDS_FIELD_INVALID.type,code:p.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when clearing a field.'});return t?P.reject(t):P.resolve()};C.prototype.focus=function(e){var t;I.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(h.TRIGGER_INPUT_FOCUS,e):t=new a({type:p.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:p.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot focus "'+e+'" field because it is not part of the current Hosted Fields options.'}):t=new a({type:p.HOSTED_FIELDS_FIELD_INVALID.type,code:p.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when focusing a field.'});return t?P.reject(t):P.resolve()};C.prototype.getState=function(){return this._state};e.exports=R.wrapPrototype(C)},607566:e=>{"use strict";e.exports=function(e,t){
|
|
var n=document.createElement("div"),r=document.createDocumentFragment();n.style.clear="both";r.appendChild(e);r.appendChild(n);t.appendChild(r);return[e,n]}},266773:(e,t,n)=>{"use strict";var r=n(980777),i=n(318327),o=n(960641),s=n(452533),a=n(864548),c=n(715136),u=n(573475);e.exports={supportsInputFormatting:s,create:a((function(e){return i.verify({name:"Hosted Fields",client:e.client}).then((function(){var t=new r(e);return new u((function(e,n){t.on("ready",(function(){e(t)}));t.on("timeout",(function(){n(new c(o.HOSTED_FIELDS_TIMEOUT))}))}))}))})),VERSION:"3.28.0"}},935958:(e,t,n)=>{"use strict";e.exports={isIe9:n(442937),isIos:n(522427),isIosWebview:n(72815)}},199894:(e,t,n)=>{"use strict";var r=n(652583),i=n(960641),o={VERSION:"3.28.0",maxExpirationYearAge:19,externalEvents:{FOCUS:"focus",BLUR:"blur",EMPTY:"empty",NOT_EMPTY:"notEmpty",VALIDITY_CHANGE:"validityChange",CARD_TYPE_CHANGE:"cardTypeChange"},defaultMaxLengths:{number:19,postalCode:8,expirationDate:7,expirationMonth:2,
|
|
expirationYear:4,cvv:3},externalClasses:{FOCUSED:"braintree-hosted-fields-focused",INVALID:"braintree-hosted-fields-invalid",VALID:"braintree-hosted-fields-valid"},defaultIFrameStyle:{border:"none",width:"100%",height:"100%",float:"left"},tokenizationErrorCodes:{81724:i.HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE,81736:i.HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED},whitelistedStyles:["-moz-appearance","-moz-osx-font-smoothing","-moz-tap-highlight-color","-moz-transition","-webkit-appearance","-webkit-font-smoothing","-webkit-tap-highlight-color","-webkit-transition","appearance","color","direction","font","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-weight","letter-spacing","line-height","opacity","outline","text-shadow","transition"],whitelistedFields:{number:{name:"credit-card-number",
|
|
label:"Credit Card Number"},cvv:{name:"cvv",label:"CVV"},expirationDate:{name:"expiration",label:"Expiration Date"},expirationMonth:{name:"expiration-month",label:"Expiration Month"},expirationYear:{name:"expiration-year",label:"Expiration Year"},postalCode:{name:"postal-code",label:"Postal Code"}},whitelistedAttributes:{"aria-invalid":"boolean","aria-required":"boolean",disabled:"boolean",placeholder:"string"}};o.events=r(["FRAME_READY","VALIDATE_STRICT","CONFIGURATION","TOKENIZATION_REQUEST","INPUT_EVENT","TRIGGER_INPUT_FOCUS","ADD_CLASS","REMOVE_CLASS","SET_ATTRIBUTE","REMOVE_ATTRIBUTE","CLEAR_FIELD","AUTOFILL_EXPIRATION_DATE","SET_MESSAGE"],"hosted-fields:");e.exports=o},960641:(e,t,n)=>{"use strict";var r=n(715136);e.exports={HOSTED_FIELDS_TIMEOUT:{type:r.types.UNKNOWN,code:"HOSTED_FIELDS_TIMEOUT",message:"Hosted Fields timed out when attempting to set up."},HOSTED_FIELDS_INVALID_FIELD_KEY:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_INVALID_FIELD_KEY"},
|
|
HOSTED_FIELDS_INVALID_FIELD_SELECTOR:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_INVALID_FIELD_SELECTOR",message:"Selector does not reference a valid DOM node."},HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME",message:"Element already contains a Braintree iframe."},HOSTED_FIELDS_FIELD_INVALID:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_FIELD_INVALID"},HOSTED_FIELDS_FIELD_NOT_PRESENT:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_FIELD_NOT_PRESENT"},HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR:{type:r.types.NETWORK,code:"HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR",message:"A tokenization network error occurred."},HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE:{type:r.types.CUSTOMER,code:"HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE",message:"This credit card already exists in the merchant's vault."},HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED:{type:r.types.CUSTOMER,code:"HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED",
|
|
message:"CVV verification failed during tokenization."},HOSTED_FIELDS_FAILED_TOKENIZATION:{type:r.types.CUSTOMER,code:"HOSTED_FIELDS_FAILED_TOKENIZATION",message:"The supplied card data failed tokenization."},HOSTED_FIELDS_FIELDS_EMPTY:{type:r.types.CUSTOMER,code:"HOSTED_FIELDS_FIELDS_EMPTY",message:"All fields are empty. Cannot tokenize empty card fields."},HOSTED_FIELDS_FIELDS_INVALID:{type:r.types.CUSTOMER,code:"HOSTED_FIELDS_FIELDS_INVALID",message:"Some payment input fields are invalid. Cannot tokenize invalid card fields."},HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED"},HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED"},HOSTED_FIELDS_FIELD_PROPERTY_INVALID:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_FIELD_PROPERTY_INVALID"}}},369828:e=>{"use strict";e.exports=function(e,t){for(var n=e.parentNode,r=[];null!=n;){
|
|
null!=n.tagName&&n.tagName.toLowerCase()===t&&r.push(n);n=n.parentNode}return r}},755813:e=>{"use strict";e.exports={MAX_TRANSACTION_STATUS_POLLING_RETRIES:5,POLL_RETRY_TIME:1e4,REQUIRED_OPTIONS_FOR_START_PAYMENT:["orderId","amount","currency"]}},153814:(e,t,n)=>{"use strict";var r=n(573475),i=n(132463),o=n(715136),s=n(240914),a=n(726718),c=n(291593).INTEGRATION_TIMEOUT_MS,u=n(589585),p=n(864548),_=n(441970),d=n(866834),l=n(198533),E=n(842903),h=n(161072),f=n(755813),A=n(387084);function T(e){var t=e.client.getConfiguration();this._client=e.client;this._assetsUrl=t.gatewayConfiguration.ideal.assetsUrl+"/web/3.28.0";this._isDebug=t.isDebug;this._idealPaymentStatus={authInProgress:!1,id:"",status:""}}T.prototype._initialize=function(){var e=this,t=setTimeout((function(){d.sendEvent(e._client,"ideal.load.timed-out")}),c);return this._client.request({api:"braintreeApi",method:"get",endpoint:"issuers/ideal"}).then((function(n){return new r((function(r){i.create({
|
|
name:"braintreeideallanding",height:550,width:960,dispatchFrameUrl:e._assetsUrl+"/html/dispatch-frame"+l(e._isDebug)+".html",openFrameUrl:e._assetsUrl+"/html/ideal-issuers-frame"+l(e._isDebug)+".html",state:{bankData:n.data}},(function(n){e._frameService=n;clearTimeout(t);d.sendEvent(e._client,"ideal.load.succeeded");e._frameService._bus.on(A.BANK_CHOSEN,e._createBankChosenHandler());e._frameService._bus.on(A.REDIRECT_PAGE_REACHED,e._createRedirectPageReachedHandler());r(e)}))}))}))};T.prototype.startPayment=p((function(e){var t=this;return new r((function(n,r){if(e&&!function(e){var t,n;for(t=0;t<f.REQUIRED_OPTIONS_FOR_START_PAYMENT.length;t++){n=f.REQUIRED_OPTIONS_FOR_START_PAYMENT[t];if(!e.hasOwnProperty(n))return!0}return!1}(e))if(t._idealPaymentStatus.authInProgress){d.sendEvent(t._client,"ideal.start-payment.error.already-opened");r(new o(a.IDEAL_PAYMENT_ALREADY_IN_PROGRESS))}else{t._idealPaymentStatus.authInProgress=!0;d.sendEvent(t._client,"ideal.start-payment.opened")
|
|
;t._startPaymentCallback=t._createStartPaymentCallback(n,r);t._startPaymentOptions=e;t._frameService.open({state:{locale:e.locale}},t._startPaymentCallback)}else r(new o(a.IDEAL_START_PAYMENT_MISSING_REQUIRED_OPTION))}))}));T.prototype.closeWindow=function(){this._idealPaymentStatus.authInProgress&&d.sendEvent(this._client,"ideal.start-payment.closed.by-merchant");this._frameService.close()};T.prototype.focusWindow=function(){this._frameService.focus()};T.prototype._createRedirectPageReachedHandler=function(){var e=this;return function(){e._pollForCompleteTransactionStatus(0)}};T.prototype._createStartPaymentCallback=function(e,t){var n=this;return function(r){var i=n._idealPaymentStatus.id,c=n._idealPaymentStatus.status;n._idealPaymentStatus.authInProgress=!1;delete n._idealPaymentStatus.id;delete n._idealPaymentStatus.status;n._frameService.close();if(function(e,t){if(e&&"FRAME_SERVICE_FRAME_CLOSED"!==e.code)return!1;return"COMPLETE"===t||"PENDING"===t}(r,c)){
|
|
d.sendEvent(n._client,"ideal.start-payment.success-"+c.toLowerCase());e({nonce:i,type:"IdealPayment",details:{id:i,status:c}})}else if(r){if("FRAME_SERVICE_FRAME_CLOSED"===r.code){d.sendEvent(n._client,"ideal.start-payment.closed.by-user");t(new o(a.IDEAL_WINDOW_CLOSED));return}if("FRAME_SERVICE_FRAME_OPEN_FAILED"===r.code){t(new o(a.IDEAL_WINDOW_OPEN_FAILED));return}d.sendEvent(n._client,"ideal.start-payment.failed");t(s(r,a.IDEAL_START_PAYMENT_FAILED))}else t(new o(a.IDEAL_START_PAYMENT_UNEXPECTED_STATUS))}};T.prototype._createBankChosenHandler=function(){var e=this;return function(t){var n,r=e._startPaymentOptions;n="function"==typeof r.onPaymentStart?E(h(r.onPaymentStart)):function(){};e._client.request({api:"braintreeApi",method:"post",data:{route_id:e._client.getConfiguration().gatewayConfiguration.ideal.routeId,issuer:t.issuingBankId,order_id:r.orderId,amount:r.amount,currency:r.currency,descriptor:r.descriptor,redirect_url:e._assetsUrl+"/html/ideal-redirect-frame.html"},
|
|
endpoint:"ideal-payments"}).then((function(t){n({id:t.data.id,status:t.data.status});e._idealPaymentStatus.id=t.data.id;e._idealPaymentStatus.status=t.data.status;e._frameService.redirect(t.data.approval_url)})).catch((function(t){e._idealPaymentStatus.authInProgress=!1;e._startPaymentCallback(t)}))}};T.prototype._pollForCompleteTransactionStatus=function(e){var t=this;this._idealPaymentStatus.id?this._client.request({api:"braintreeApi",method:"get",endpoint:"ideal-payments/"+this._idealPaymentStatus.id+"/status"}).then((function(n){t._idealPaymentStatus.status=n.data.status;"PENDING"===n.data.status&&e<f.MAX_TRANSACTION_STATUS_POLLING_RETRIES?setTimeout((function(){t._pollForCompleteTransactionStatus(e+1)}),f.POLL_RETRY_TIME):"COMPLETE"===n.data.status||"PENDING"===n.data.status?t._startPaymentCallback():t._startPaymentCallback(new o({code:a.IDEAL_PAYMENT_NOT_COMPLETE_OR_PENDING.code,type:a.IDEAL_PAYMENT_NOT_COMPLETE_OR_PENDING.type,
|
|
message:"Transaction is not complete. It has a status of: "+n.data.status}))})).catch(t._startPaymentCallback):this._startPaymentCallback(a.IDEAL_PAYMENT_ALREADY_IN_PROGRESS)};T.prototype.teardown=p((function(){var e=this;e._frameService.teardown();_(e,u(T.prototype));d.sendEvent(e._client,"ideal.teardown-completed");return r.resolve()}));e.exports=T},251420:(e,t,n)=>{"use strict";var r=n(715136),i=n(49279),o=n(318327),s=n(153814),a=n(726718),c=n(792117),u=n(866834),p=n(573475),_=n(864548);e.exports={create:_((function(e){return o.verify({name:"iDEAL",client:e.client}).then((function(){var t;if(!i.supportsPopups())return p.reject(new r(a.IDEAL_BROWSER_NOT_SUPPORTED));if(!(t=e.client.getConfiguration().gatewayConfiguration).braintreeApi)return p.reject(new r(c.BRAINTREE_API_ACCESS_RESTRICTED));if(!t.ideal)return p.reject(new r(a.IDEAL_NOT_ENABLED));u.sendEvent(e.client,"ideal.initialization");return new s(e)._initialize()}))})),VERSION:"3.28.0"}},49279:(e,t,n)=>{"use strict";e.exports={
|
|
supportsPopups:n(902239)}},726718:(e,t,n)=>{"use strict";var r=n(715136);e.exports={IDEAL_BROWSER_NOT_SUPPORTED:{type:r.types.CUSTOMER,code:"IDEAL_BROWSER_NOT_SUPPORTED",message:"Browser is not supported."},IDEAL_NOT_ENABLED:{type:r.types.MERCHANT,code:"IDEAL_NOT_ENABLED",message:"iDEAL is not enabled for this merchant."},IDEAL_PAYMENT_ALREADY_IN_PROGRESS:{type:r.types.MERCHANT,code:"IDEAL_PAYMENT_ALREADY_IN_PROGRESS",message:"iDEAL payment is already in progress."},IDEAL_PAYMENT_NOT_COMPLETE_OR_PENDING:{code:"IDEAL_PAYMENT_NOT_COMPLETE_OR_PENDING",type:r.types.CUSTOMER},IDEAL_WINDOW_CLOSED:{type:r.types.CUSTOMER,code:"IDEAL_WINDOW_CLOSED",message:"Customer closed iDEAL window before authorizing."},IDEAL_WINDOW_OPEN_FAILED:{type:r.types.MERCHANT,code:"IDEAL_WINDOW_OPEN_FAILED",message:"iDEAL window failed to open; make sure startPayment was called in response to a user action."},IDEAL_START_PAYMENT_FAILED:{type:r.types.NETWORK,code:"IDEAL_START_PAYMENT_FAILED",
|
|
message:"iDEAL startPayment failed."},IDEAL_START_PAYMENT_UNEXPECTED_STATUS:{type:r.types.INTERNAL,code:"IDEAL_START_PAYMENT_UNEXPECTED_STATUS",message:"iDEAL startPayment returned an unexpected status without an error."},IDEAL_START_PAYMENT_MISSING_REQUIRED_OPTION:{type:r.types.MERCHANT,code:"IDEAL_START_PAYMENT_MISSING_REQUIRED_OPTION",message:"Missing required option for startPayment."}}},387084:(e,t,n)=>{"use strict";var r=n(652583);e.exports=r(["BANK_CHOSEN","REDIRECT_PAGE_REACHED"],"ideal:")},999483:(e,t,n)=>{"use strict";var r=n(808577),i=n(821692),o=n(1651),s=n(597916),a=n(266773),c=n(251420),u=n(368777),p=n(911545),_=n(33824),d=n(2039),l=n(881367),E=n(327449),h=n(489894),f=n(392014),A=n(255059),T=n(4951),I=n(559081);e.exports={americanExpress:r,applePay:i,client:o,dataCollector:s,hostedFields:a,ideal:c,masterpass:u,googlePayment:l,paymentRequest:p,paypal:_,paypalCheckout:d,threeDSecure:E,unionpay:h,usBankAccount:f,vaultManager:A,venmo:T,visaCheckout:I,VERSION:"3.28.0"}},
|
|
815415:(e,t,n)=>{"use strict";var r=n(979814),i=n(112404),o=n(291593);e.exports=function(e,t){var n,s=t?i(t):{},a=r(e.authorization).attrs,c=i(e.analyticsMetadata);s.braintreeLibraryVersion=o.BRAINTREE_LIBRARY_VERSION;for(n in s._meta)s._meta.hasOwnProperty(n)&&(c[n]=s._meta[n]);s._meta=c;a.tokenizationKey?s.tokenizationKey=a.tokenizationKey:s.authorizationFingerprint=a.authorizationFingerprint;return s}},866834:(e,t,n)=>{"use strict";var r=n(291593),i=n(815415);e.exports={sendEvent:function(e,t,n){var o,s=e.getConfiguration(),a=e._request,c=(o=Date.now(),Math.floor(o/1e3)),u=s.gatewayConfiguration.analytics.url,p={analytics:[{kind:r.ANALYTICS_PREFIX+t,timestamp:c}]};a({url:u,method:"post",data:i(s,p),timeout:r.ANALYTICS_REQUEST_TIMEOUT_MS},n)}}},809724:e=>{"use strict";var t="function"==typeof Object.assign?Object.assign:n;function n(e){var t,n,r;for(t=1;t<arguments.length;t++){n=arguments[t];for(r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}e.exports={assign:t,_assign:n}},
|
|
318327:(e,t,n)=>{"use strict";var r=n(715136),i=n(573475),o=n(792117),s="3.28.0";e.exports={verify:function(e){var t,n,a;if(!e)return i.reject(new r({type:o.INVALID_USE_OF_INTERNAL_FUNCTION.type,code:o.INVALID_USE_OF_INTERNAL_FUNCTION.code,message:"Options must be passed to basicComponentVerification function."}));a=e.name;return null==(t=e.client)?i.reject(new r({type:o.INSTANTIATION_OPTION_REQUIRED.type,code:o.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating "+a+"."})):(n=t.getVersion())!==s?i.reject(new r({type:o.INCOMPATIBLE_VERSIONS.type,code:o.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+n+") and "+a+" (version "+"3.28.0) components must be from the same SDK version."})):i.resolve()}}},598043:(e,t,n)=>{"use strict";var r=n(842903);function i(e,t){if(0===e.length){e();t(null)}else e(t)}e.exports=function(e,t){var n,o=e.length,s=o,a=r(t);if(0!==o)for(n=0;n<o;n++)i(e[n],c);else a(null);function c(e){e?a(e):0===(s-=1)&&a(null)}}},
|
|
715136:(e,t,n)=>{"use strict";var r=n(652583);function i(e){if(!i.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError";this.code=e.code;this.message=e.message;this.type=e.type;this.details=e.details}i.prototype=Object.create(Error.prototype);i.prototype.constructor=i;i.types=r(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]);i.findRootError=function(e){return e instanceof i&&e.details&&e.details.originalError?i.findRootError(e.details.originalError):e};e.exports=i},364412:(e,t,n)=>{"use strict";var r=n(855167);e.exports={checkOrigin:function(e,t){var n,i=document.createElement("a");i.href=t;n="https:"===i.protocol?i.host.replace(/:443$/,""):"http:"===i.protocol?i.host.replace(/:80$/,""):i.host;if(i.protocol+"//"+n===e)return!0;i.href=e;return r(e)}}},138765:(e,t,n)=>{"use strict";var r=n(652583)
|
|
;e.exports=r(["CONFIGURATION_REQUEST"],"bus:")},725279:(e,t,n)=>{"use strict";var r=n(704791),i=n(138765),o=n(364412).checkOrigin,s=n(715136);function a(e){e=e||{};this.channel=e.channel;if(!this.channel)throw new s({type:s.types.INTERNAL,code:"MISSING_CHANNEL_ID",message:"Channel ID must be specified."});this.merchantUrl=e.merchantUrl;this._isDestroyed=!1;this._isVerbose=!1;this._listeners=[];this._log("new bus on channel "+this.channel,[location.href])}a.prototype.on=function(e,t){var n,i,s=t,a=this;if(!this._isDestroyed){this.merchantUrl&&(s=function(){o(this.origin,a.merchantUrl)&&t.apply(this,arguments)});n=this._namespaceEvent(e);(i=Array.prototype.slice.call(arguments))[0]=n;i[1]=s;this._log("on",i);r.on.apply(r,i);this._listeners.push({eventName:e,handler:s,originalHandler:t})}};a.prototype.emit=function(e){var t;if(!this._isDestroyed){(t=Array.prototype.slice.call(arguments))[0]=this._namespaceEvent(e);this._log("emit",t);r.emit.apply(r,t)}};a.prototype._offDirect=function(e){
|
|
var t=Array.prototype.slice.call(arguments);if(!this._isDestroyed){t[0]=this._namespaceEvent(e);this._log("off",t);r.off.apply(r,t)}};a.prototype.off=function(e,t){var n,r,i=t;if(!this._isDestroyed){if(this.merchantUrl)for(n=0;n<this._listeners.length;n++)(r=this._listeners[n]).originalHandler===t&&(i=r.handler);this._offDirect(e,i)}};a.prototype._namespaceEvent=function(e){return["braintree",this.channel,e].join(":")};a.prototype.teardown=function(){var e,t;for(t=0;t<this._listeners.length;t++){e=this._listeners[t];this._offDirect(e.eventName,e.handler)}this._listeners.length=0;this._isDestroyed=!0};a.prototype._log=function(e,t){this._isVerbose&&console.log(e,t)};a.events=i;e.exports=a},620662:e=>{"use strict";e.exports=function(e){return Object.keys(e).reduce((function(t,n){var r=function(e){return e.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()}(n);t[r]=e[n];return t}),{})}},45950:e=>{"use strict";function t(e){
|
|
return e.className.trim().split(/\s+/)}function n(e){var n=Array.prototype.slice.call(arguments,1),r=t(e).filter((function(e){return-1===n.indexOf(e)})).concat(n).join(" ");e.className=r}function r(e){var n=Array.prototype.slice.call(arguments,1),r=t(e).filter((function(e){return-1===n.indexOf(e)})).join(" ");e.className=r}e.exports={add:n,remove:r,toggle:function(e,t,i){i?n(e,t):r(e,t)}}},291593:e=>{"use strict";var t="3.28.0";e.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,INTEGRATION_TIMEOUT_MS:6e4,VERSION:t,INTEGRATION:"custom",SOURCE:"client",PLATFORM:"web",BRAINTREE_LIBRARY_VERSION:"braintree/web/3.28.0"}},441970:(e,t,n)=>{"use strict";var r=n(715136),i=n(792117);e.exports=function(e,t){t.forEach((function(t){e[t]=function(){throw new r({type:i.METHOD_CALLED_AFTER_TEARDOWN.type,code:i.METHOD_CALLED_AFTER_TEARDOWN.code,message:t+" cannot be called after teardown."})}}))}},240914:(e,t,n)=>{"use strict";var r=n(715136);e.exports=function(e,t){
|
|
return e instanceof r?e:new r({type:t.type,code:t.code,message:t.message,details:{originalError:e}})}},979814:(e,t,n)=>{"use strict";var r=n(847668).atob,i={production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"};e.exports=function(e){var t,n,o,s,a={attrs:{},configUrl:""};if(/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)){n=(o=e.split("_"),s=o[0],{merchantId:o.slice(2).join("_"),environment:s});a.attrs.tokenizationKey=e;a.configUrl=i[n.environment]+"/merchants/"+n.merchantId+"/client_api/v1/configuration"}else{t=JSON.parse(r(e));a.attrs.authorizationFingerprint=t.authorizationFingerprint;a.configUrl=t.configUrl}return a}},161072:e=>{"use strict";e.exports=function(e){return function(){var t=arguments;setTimeout((function(){e.apply(null,t)}),1)}}},512250:(e,t,n)=>{"use strict";var r=n(598043);function i(){this._teardownRegistry=[];this._isTearingDown=!1}i.prototype.registerFunctionForTeardown=function(e){
|
|
"function"==typeof e&&this._teardownRegistry.push(e)};i.prototype.teardown=function(e){if(this._isTearingDown)e(new Error("Destructor is already tearing down"));else{this._isTearingDown=!0;r(this._teardownRegistry,function(t){this._teardownRegistry=[];this._isTearingDown=!1;"function"==typeof e&&e(t)}.bind(this))}};e.exports=i},652583:e=>{"use strict";e.exports=function(e,t){t=null==t?"":t;return e.reduce((function(e,n){e[n]=t+n;return e}),{})}},792117:(e,t,n)=>{"use strict";var r=n(715136);e.exports={INVALID_USE_OF_INTERNAL_FUNCTION:{type:r.types.INTERNAL,code:"INVALID_USE_OF_INTERNAL_FUNCTION"},CALLBACK_REQUIRED:{type:r.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INVALID_OPTION:{type:r.types.MERCHANT,code:"INVALID_OPTION"},INCOMPATIBLE_VERSIONS:{type:r.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:r.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},
|
|
BRAINTREE_API_ACCESS_RESTRICTED:{type:r.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},549614:e=>{"use strict";function t(){this._events={}}t.prototype.on=function(e,t){this._events[e]?this._events[e].push(t):this._events[e]=[t]};t.prototype._emit=function(e){var t,n,r=this._events[e];if(r){n=Array.prototype.slice.call(arguments,1);for(t=0;t<r.length;t++)r[t].apply(null,n)}};e.exports=t},586499:(e,t,n)=>{"use strict";var r=n(693486),i=n(411994),o=n(11675),s=n(725279),a=n(837684),c=n(577369),u=n(212273),p=n(439548),_=n(461863),d=n(715136),l=n(228691),E=n(809724).assign,h=["name","dispatchFrameUrl","openFrameUrl"];function f(){}function A(e){!function(e){if(!e)throw new Error("Valid configuration is required");h.forEach((function(t){if(!e.hasOwnProperty(t))throw new Error("A valid frame "+t+" must be provided")}));if(!/^[\w_]+$/.test(e.name))throw new Error("A valid frame name must be provided")
|
|
}(e);this._serviceId=p().replace(/-/g,"");this._options={name:e.name+"_"+this._serviceId,dispatchFrameUrl:e.dispatchFrameUrl,openFrameUrl:e.openFrameUrl,height:e.height,width:e.width,top:e.top,left:e.left};this.state=e.state||{};this._bus=new s({channel:this._serviceId});this._setBusEvents()}A.prototype.initialize=function(e){var t=function(){e();this._bus.off(a.DISPATCH_FRAME_READY,t)}.bind(this);this._bus.on(a.DISPATCH_FRAME_READY,t);this._writeDispatchFrame()};A.prototype._writeDispatchFrame=function(){var e=u.DISPATCH_FRAME_NAME+"_"+this._serviceId,t=this._options.dispatchFrameUrl;this._dispatchFrame=_({name:e,src:t,class:u.DISPATCH_FRAME_CLASS,height:0,width:0,style:{position:"absolute",left:"-9999px"}});document.body.appendChild(this._dispatchFrame)};A.prototype._setBusEvents=function(){this._bus.on(a.DISPATCH_FRAME_REPORT,function(e,t){this._onCompleteCallback&&this._onCompleteCallback.call(null,e.err,e.payload);this._frame.close();this._onCompleteCallback=null;t&&t()
|
|
}.bind(this));this._bus.on(s.events.CONFIGURATION_REQUEST,function(e){e(this.state)}.bind(this))};A.prototype.open=function(e,t){e=e||{};this._frame=this._getFrameForEnvironment(e);this._frame.initialize(t);if(!(this._frame instanceof i)){E(this.state,e.state);this._onCompleteCallback=t;this._frame.open();if(this.isFrameClosed()){this._cleanupFrame();t&&t(new d(c.FRAME_SERVICE_FRAME_OPEN_FAILED))}else this._pollForPopupClose()}};A.prototype.redirect=function(e){this._frame&&!this.isFrameClosed()&&this._frame.redirect(e)};A.prototype.close=function(){this.isFrameClosed()||this._frame.close()};A.prototype.focus=function(){this.isFrameClosed()||this._frame.focus()};A.prototype.createHandler=function(e){e=e||{};return{close:function(){e.beforeClose&&e.beforeClose();this.close()}.bind(this),focus:function(){e.beforeFocus&&e.beforeFocus();this.focus()}.bind(this)}};A.prototype.createNoopHandler=function(){return{close:f,focus:f}};A.prototype.teardown=function(){this.close()
|
|
;this._dispatchFrame.parentNode.removeChild(this._dispatchFrame);this._dispatchFrame=null;this._cleanupFrame()};A.prototype.isFrameClosed=function(){return null==this._frame||this._frame.isClosed()};A.prototype._cleanupFrame=function(){this._frame=null;clearInterval(this._popupInterval);this._popupInterval=null};A.prototype._pollForPopupClose=function(){this._popupInterval=setInterval(function(){if(this.isFrameClosed()){this._cleanupFrame();this._onCompleteCallback&&this._onCompleteCallback(new d(c.FRAME_SERVICE_FRAME_CLOSED))}}.bind(this),u.POPUP_POLL_INTERVAL);return this._popupInterval};A.prototype._getFrameForEnvironment=function(e){var t=l.supportsPopups(),s=Boolean(n.g.popupBridge),a=E({},this._options,e);return s?new i(a):t?new r(a):new o(a)};e.exports=A},132463:(e,t,n)=>{"use strict";var r=n(586499);e.exports={create:function(e,t){var n=new r(e);n.initialize((function(){t(n)}))}}},11675:(e,t,n)=>{"use strict";var r=n(461863),i=n(809724).assign,o=n(228691),s={position:"fixed",
|
|
top:0,left:0,bottom:0,padding:0,margin:0,border:0,outline:"none",zIndex:20001,background:"#FFFFFF"};function a(){}function c(e){this._closed=null;this._frame=null;this._options=e||{};this._container=this._options.container||document.body}c.prototype.initialize=a;c.prototype.open=function(){var e={src:this._options.openFrameUrl,name:this._options.name,scrolling:"yes",height:"100%",width:"100%",style:i({},s)};if(o.isIos()){if(o.isIosWKWebview()){this._lockScrolling();e.style={}}this._el=document.createElement("div");i(this._el.style,s,{height:"100%",width:"100%",overflow:"auto","-webkit-overflow-scrolling":"touch"});this._frame=r(e);this._el.appendChild(this._frame)}else this._el=this._frame=r(e);this._closed=!1;this._container.appendChild(this._el)};c.prototype.focus=a;c.prototype.close=function(){this._container.removeChild(this._el);this._frame=null;this._closed=!0;o.isIosWKWebview()&&this._unlockScrolling()};c.prototype.isClosed=function(){return Boolean(this._closed)}
|
|
;c.prototype.redirect=function(e){this._frame.src=e};c.prototype._unlockScrolling=function(){document.body.style.overflow=this._savedBodyProperties.overflowStyle;document.body.style.position=this._savedBodyProperties.positionStyle;n.g.scrollTo(this._savedBodyProperties.left,this._savedBodyProperties.top);delete this._savedBodyProperties};c.prototype._lockScrolling=function(){var e=document.documentElement;this._savedBodyProperties={left:(n.g.pageXOffset||e.scrollLeft)-(e.clientLeft||0),top:(n.g.pageYOffset||e.scrollTop)-(e.clientTop||0),overflowStyle:document.body.style.overflow,positionStyle:document.body.style.position};document.body.style.overflow="hidden";document.body.style.position="fixed";n.g.scrollTo(0,0)};e.exports=c},411994:(e,t,n)=>{"use strict";var r=n(715136),i=n(577369);function o(){}function s(e){this._closed=null;this._options=e}s.prototype.initialize=function(e){var t=this;n.g.popupBridge.onComplete=function(n,o){var s=!o&&!n;t._closed=!0
|
|
;n||s?e(new r(i.FRAME_SERVICE_FRAME_CLOSED)):e(null,o)}};s.prototype.open=function(e){var t;t=(e=e||{}).openFrameUrl||this._options.openFrameUrl;this._closed=!1;n.g.popupBridge.open(t)};s.prototype.focus=o;s.prototype.close=o;s.prototype.isClosed=function(){return Boolean(this._closed)};s.prototype.redirect=function(e){this.open({openFrameUrl:e})};e.exports=s},849101:(e,t,n)=>{"use strict";var r=n(212273),i=n(48179);function o(e,t,n){return void 0!==t?t:i[e](n)}e.exports=function(e){var t=e.height||r.DEFAULT_POPUP_HEIGHT,n=e.width||r.DEFAULT_POPUP_WIDTH,i=o("top",e.top,t),s=o("left",e.left,n);return[r.POPUP_BASE_OPTIONS,"height="+t,"width="+n,"top="+i,"left="+s].join(",")}},693486:(e,t,n)=>{"use strict";var r=n(849101);function i(e){this._frame=null;this._options=e||{};this.open()}i.prototype.initialize=function(){};i.prototype.open=function(){this._frame=n.g.open(this._options.openFrameUrl,this._options.name,r(this._options))};i.prototype.focus=function(){this._frame.focus()}
|
|
;i.prototype.close=function(){this._frame.close()};i.prototype.isClosed=function(){return this._frame&&Boolean(this._frame.closed)};i.prototype.redirect=function(e){this._frame.location.href=e};e.exports=i},48179:(e,t,n)=>{"use strict";function r(e,t,n){return(e-t)/2+n}e.exports={top:function(e){return r(n.g.outerHeight||document.documentElement.clientHeight,e,null==n.g.screenY?n.g.screenTop:n.g.screenY)},left:function(e){return r(n.g.outerWidth||document.documentElement.clientWidth,e,null==n.g.screenX?n.g.screenLeft:n.g.screenX)},center:r}},228691:(e,t,n)=>{"use strict";e.exports={isIos:n(522427),isIosWKWebview:n(224604),supportsPopups:n(902239)}},212273:e=>{"use strict";e.exports={DISPATCH_FRAME_NAME:"dispatch",DISPATCH_FRAME_CLASS:"braintree-dispatch-frame",POPUP_BASE_OPTIONS:"resizable,scrollbars",DEFAULT_POPUP_WIDTH:450,DEFAULT_POPUP_HEIGHT:535,POPUP_POLL_INTERVAL:100,POPUP_CLOSE_TIMEOUT:100}},577369:(e,t,n)=>{"use strict";var r=n(715136);e.exports={FRAME_SERVICE_FRAME_CLOSED:{
|
|
type:r.types.INTERNAL,code:"FRAME_SERVICE_FRAME_CLOSED",message:"Frame closed before tokenization could occur."},FRAME_SERVICE_FRAME_OPEN_FAILED:{type:r.types.INTERNAL,code:"FRAME_SERVICE_FRAME_OPEN_FAILED",message:"Frame failed to open."}}},837684:(e,t,n)=>{"use strict";var r=n(652583);e.exports=r(["DISPATCH_FRAME_READY","DISPATCH_FRAME_REPORT"],"frameService:")},335546:(e,t,n)=>{"use strict";e.exports={isHTTPS:function(e){return"https:"===(e=e||n.g.location.protocol)}}},855167:e=>{"use strict";var t,n={"paypal.com":1,"braintreepayments.com":1,"braintreegateway.com":1,"braintree-api.com":1};e.exports=function(e){var r;e=e.toLowerCase();if(!/^https:/.test(e))return!1;(t=t||document.createElement("a")).href=e;r=t.hostname.split(".").slice(-2).join(".");return n.hasOwnProperty(r)}},112404:e=>{"use strict";e.exports=function(e){return JSON.parse(JSON.stringify(e))}},589585:e=>{"use strict";e.exports=function(e){return Object.keys(e).filter((function(t){return"function"==typeof e[t]}))}},
|
|
842903:e=>{"use strict";e.exports=function(e){var t=!1;return function(){if(!t){t=!0;e.apply(null,arguments)}}}},573475:(e,t,n)=>{"use strict";var r=n.g.Promise||n(373705);e.exports=r},634452:(e,t,n)=>{"use strict";function r(e,t){var n,i,o,s,a=[];for(o in e)if(e.hasOwnProperty(o)){i=e[o];n=t?(s=e)&&"object"==typeof s&&"number"==typeof s.length&&"[object Array]"===Object.prototype.toString.call(s)?t+"[]":t+"["+o+"]":o;"object"==typeof i?a.push(r(i,n)):a.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}return a.join("&")}e.exports={parse:function(e){e=e||n.g.location.href;return/\?/.test(e)?e.replace(/#.*$/,"").replace(/^.*\?/,"").split("&").reduce((function(e,t){var n=t.split("="),r=decodeURIComponent(n[0]),i=decodeURIComponent(n[1]);e[r]=i;return e}),{}):{}},stringify:r,queryify:function(e,t){e=e||"";if(null!=t&&"object"==typeof t&&function(e){var t;for(t in e)if(e.hasOwnProperty(t))return!0;return!1}(t)){e+=-1===e.indexOf("?")?"?":"";e+=-1!==e.indexOf("=")?"&":"";e+=r(t)}
|
|
return e}}},198533:e=>{"use strict";e.exports=function(e){return e?"":".min"}},847668:(e,t,n)=>{"use strict";var r="function"==typeof n.g.atob?n.g.atob:i;function i(e){var t,n,r,i,o,s,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="";if(!new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$").test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");s=0;do{t=(63&a.indexOf(e.charAt(s++)))<<2|(i=a.indexOf(e.charAt(s++)))>>4&3;n=(15&i)<<4|(o=a.indexOf(e.charAt(s++)))>>2&15;r=(3&o)<<6|63&a.indexOf(e.charAt(s++));c+=String.fromCharCode(t)+(n?String.fromCharCode(n):"")+(r?String.fromCharCode(r):"")}while(s<e.length);return c}e.exports={atob:function(e){return r.call(n.g,e)},_atob:i}},439548:e=>{"use strict";e.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}},937629:(e,t,n)=>{
|
|
"use strict";var r=n(573475),i=n(132463),o=n(715136),s=n(680806),a=n(589585),c=n(864548),u=n(866834),p=n(441970),_=n(240914),d=n(168864),l=n(291593).INTEGRATION_TIMEOUT_MS;function E(e){var t=e.client.getConfiguration();this._client=e.client;this._assetsUrl=t.gatewayConfiguration.assetsUrl+"/web/3.28.0";this._isDebug=t.isDebug;this._authInProgress=!1;n.g.popupBridge&&"function"==typeof n.g.popupBridge.getReturnUrlPrefix?this._callbackUrl=n.g.popupBridge.getReturnUrlPrefix()+"return":this._callbackUrl=this._assetsUrl+"/html/masterpass-redirect-frame"+(this._isDebug?"":".min")+".html"}E.prototype._initialize=function(){var e=this;return new r((function(t){var n=setTimeout((function(){u.sendEvent(e._client,"masterpass.load.timed-out")}),l);i.create({name:d.LANDING_FRAME_NAME,height:d.POPUP_HEIGHT,width:d.POPUP_WIDTH,dispatchFrameUrl:e._assetsUrl+"/html/dispatch-frame"+(e._isDebug?"":".min")+".html",openFrameUrl:e._assetsUrl+"/html/masterpass-landing-frame"+(e._isDebug?"":".min")+".html"
|
|
},(function(r){e._frameService=r;clearTimeout(n);u.sendEvent(e._client,"masterpass.load.succeeded");t(e)}))}))};E.prototype.tokenize=function(e){var t=this;return!e||function(e){var t,n;for(t=0;t<d.REQUIRED_OPTIONS_FOR_TOKENIZE.length;t++){n=d.REQUIRED_OPTIONS_FOR_TOKENIZE[t];if(!e.hasOwnProperty(n))return!0}return!1}(e)?r.reject(new o(s.MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION)):t._authInProgress?r.reject(new o(s.MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS)):new r((function(n,r){t._navigateFrameToLoadingPage(e).catch(r);t._frameService.open(e.frameOptions,t._createFrameOpenHandler(n,r))}))};E.prototype._navigateFrameToLoadingPage=function(e){var t=this;this._authInProgress=!0;return this._client.request({method:"post",endpoint:"masterpass/request_token",data:{requestToken:{originUrl:n.g.location.protocol+"//"+n.g.location.hostname,subtotal:e.subtotal,currencyCode:e.currencyCode,callbackUrl:this._callbackUrl}}}).then((function(n){
|
|
var r,i=t._assetsUrl+"/html/masterpass-loading-frame"+(t._isDebug?"":".min")+".html?",o=t._client.getConfiguration().gatewayConfiguration,s=e.config||{};r={environment:o.environment,requestToken:n.requestToken,callbackUrl:t._callbackUrl,merchantCheckoutId:o.masterpass.merchantCheckoutId,allowedCardTypes:o.masterpass.supportedNetworks,version:d.MASTERPASS_VERSION};Object.keys(s).forEach((function(e){"function"!=typeof s[e]&&(r[e]=s[e])}));i+=Object.keys(r).map((function(e){return e+"="+r[e]})).join("&");t._frameService.redirect(i)})).catch((function(e){var n=e.details&&e.details.httpStatus;t._closeWindow();return 422===n?r.reject(_(e,s.MASTERPASS_INVALID_PAYMENT_OPTION)):r.reject(_(e,s.MASTERPASS_FLOW_FAILED))}))};E.prototype._createFrameOpenHandler=function(e,t){var r=this;return n.g.popupBridge?function(n,i){r._authInProgress=!1;if(n){u.sendEvent(r._client,"masterpass.tokenization.closed-popupbridge.by-user");t(_(n,s.MASTERPASS_POPUP_CLOSED))
|
|
}else if(i.queryItems)r._tokenizeMasterpass(i.queryItems).then(e).catch(t);else{u.sendEvent(r._client,"masterpass.tokenization.failed-popupbridge");t(new o(s.MASTERPASS_FLOW_FAILED))}}:function(n,i){if(n){r._authInProgress=!1;if("FRAME_SERVICE_FRAME_CLOSED"===n.code){u.sendEvent(r._client,"masterpass.tokenization.closed.by-user");t(new o(s.MASTERPASS_POPUP_CLOSED));return}if("FRAME_SERVICE_FRAME_OPEN_FAILED"===n.code){u.sendEvent(r._client,"masterpass.tokenization.failed.to-open");t(new o(s.MASTERPASS_POPUP_OPEN_FAILED));return}u.sendEvent(r._client,"masterpass.tokenization.failed");r._closeWindow();t(_(n,s.MASTERPASS_FLOW_FAILED))}else r._tokenizeMasterpass(i).then(e).catch(t)}};E.prototype._tokenizeMasterpass=function(e){var t=this;if("success"!==e.mpstatus){u.sendEvent(t._client,"masterpass.tokenization.closed.by-user");t._closeWindow();return r.reject(new o(s.MASTERPASS_POPUP_CLOSED))}if(function(e){return[e.oauth_verifier,e.oauth_token,e.checkout_resource_url].some((function(e){
|
|
return null==e||"null"===e}))}(e)){u.sendEvent(t._client,"masterpass.tokenization.closed.missing-payload");t._closeWindow();return r.reject(new o(s.MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS))}return t._client.request({endpoint:"payment_methods/masterpass_cards",method:"post",data:{masterpassCard:{checkoutResourceUrl:e.checkout_resource_url,requestToken:e.oauth_token,verifierToken:e.oauth_verifier}}}).then((function(e){t._closeWindow();n.g.popupBridge?u.sendEvent(t._client,"masterpass.tokenization.success-popupbridge"):u.sendEvent(t._client,"masterpass.tokenization.success");return e.masterpassCards[0]})).catch((function(e){t._closeWindow();n.g.popupBridge?u.sendEvent(t._client,"masterpass.tokenization.failed-popupbridge"):u.sendEvent(t._client,"masterpass.tokenization.failed");return r.reject(_(e,s.MASTERPASS_ACCOUNT_TOKENIZATION_FAILED))}))};E.prototype._closeWindow=function(){this._authInProgress=!1;this._frameService.close()};E.prototype.teardown=function(){var e=this
|
|
;return new r((function(t){e._frameService.teardown();p(e,a(E.prototype));u.sendEvent(e._client,"masterpass.teardown-completed");t()}))};e.exports=c.wrapPrototype(E)},368777:(e,t,n)=>{"use strict";var r=n(715136),i=n(318327),o=n(371819),s=n(937629),a=n(680806),c=n(573475),u=n(864548);function p(){return Boolean(n.g.popupBridge||o.supportsPopups())}e.exports={create:u((function(e){return i.verify({name:"Masterpass",client:e.client}).then((function(){return p()?e.client.getConfiguration().gatewayConfiguration.masterpass?new s(e)._initialize():c.reject(new r(a.MASTERPASS_NOT_ENABLED)):c.reject(new r(a.MASTERPASS_BROWSER_NOT_SUPPORTED))}))})),isSupported:p,VERSION:"3.28.0"}},371819:(e,t,n)=>{"use strict";e.exports={supportsPopups:n(902239)}},168864:e=>{"use strict";e.exports={LANDING_FRAME_NAME:"braintreemasterpasslanding",POPUP_WIDTH:450,POPUP_HEIGHT:660,MASTERPASS_VERSION:"v6",REQUIRED_OPTIONS_FOR_TOKENIZE:["subtotal","currencyCode"]}},680806:(e,t,n)=>{"use strict";var r=n(715136)
|
|
;e.exports={MASTERPASS_BROWSER_NOT_SUPPORTED:{type:r.types.CUSTOMER,code:"MASTERPASS_BROWSER_NOT_SUPPORTED",message:"Browser is not supported."},MASTERPASS_NOT_ENABLED:{type:r.types.MERCHANT,code:"MASTERPASS_NOT_ENABLED",message:"Masterpass is not enabled for this merchant."},MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION:{type:r.types.MERCHANT,code:"MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION",message:"Missing required option for tokenize."},MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS:{type:r.types.MERCHANT,code:"MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS",message:"Masterpass tokenization is already in progress."},MASTERPASS_ACCOUNT_TOKENIZATION_FAILED:{type:r.types.NETWORK,code:"MASTERPASS_ACCOUNT_TOKENIZATION_FAILED",message:"Could not tokenize user's Masterpass account."},MASTERPASS_POPUP_OPEN_FAILED:{type:r.types.MERCHANT,code:"MASTERPASS_POPUP_OPEN_FAILED",message:"Masterpass popup failed to open. Make sure to tokenize in response to a user action, such as a click."},
|
|
MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS:{type:r.types.MERCHANT,code:"MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS",message:"Masterpass popup failed to return all required parameters needed to continue tokenization."},MASTERPASS_POPUP_CLOSED:{type:r.types.CUSTOMER,code:"MASTERPASS_POPUP_CLOSED",message:"Customer closed Masterpass popup before authorizing."},MASTERPASS_INVALID_PAYMENT_OPTION:{type:r.types.MERCHANT,code:"MASTERPASS_INVALID_PAYMENT_OPTION",message:"Masterpass payment options are invalid."},MASTERPASS_FLOW_FAILED:{type:r.types.NETWORK,code:"MASTERPASS_FLOW_FAILED",message:"Could not initialize Masterpass flow."}}},494916:e=>{"use strict";var t={},n="visa",r="master-card",i="american-express",o="diners-club",s="discover",a="jcb",c="unionpay",u="maestro",p="CVV",_=[n,r,i,o,s,a,c,u];function d(e){var t;if(!e)return null;delete(t=JSON.parse(JSON.stringify(e))).prefixPattern;delete t.exactPattern;return t}t.visa={niceType:"Visa",type:n,prefixPattern:/^4$/,
|
|
exactPattern:/^4\d*$/,gaps:[4,8,12],lengths:[16,18,19],code:{name:p,size:3}};t[r]={niceType:"Mastercard",type:r,prefixPattern:/^(5|5[1-5]|2|22|222|222[1-9]|2[3-6]|27|27[0-2]|2720)$/,exactPattern:/^(5[1-5]|222[1-9]|2[3-6]|27[0-1]|2720)\d*$/,gaps:[4,8,12],lengths:[16],code:{name:"CVC",size:3}};t[i]={niceType:"American Express",type:i,prefixPattern:/^(3|34|37)$/,exactPattern:/^3[47]\d*$/,isAmex:!0,gaps:[4,10],lengths:[15],code:{name:"CID",size:4}};t[o]={niceType:"Diners Club",type:o,prefixPattern:/^(3|3[0689]|30[0-5])$/,exactPattern:/^3(0[0-5]|[689])\d*$/,gaps:[4,10],lengths:[14,16,19],code:{name:p,size:3}};t.discover={niceType:"Discover",type:s,prefixPattern:/^(6|60|601|6011|65|64|64[4-9])$/,exactPattern:/^(6011|65|64[4-9])\d*$/,gaps:[4,8,12],lengths:[16,19],code:{name:"CID",size:3}};t.jcb={niceType:"JCB",type:a,prefixPattern:/^(2|21|213|2131|1|18|180|1800|3|35)$/,exactPattern:/^(2131|1800|35)\d*$/,gaps:[4,8,12],lengths:[16,17,18,19],code:{name:p,size:3}};t.unionpay={niceType:"UnionPay",
|
|
type:c,prefixPattern:/^((6|62|62\d|(621(?!83|88|98|99))|622(?!06)|627[02,06,07]|628(?!0|1)|629[1,2])|622018)$/,exactPattern:/^(((620|(621(?!83|88|98|99))|622(?!06|018)|62[3-6]|627[02,06,07]|628(?!0|1)|629[1,2]))\d*|622018\d{12})$/,gaps:[4,8,12],lengths:[16,17,18,19],code:{name:"CVN",size:3}};t.maestro={niceType:"Maestro",type:u,prefixPattern:/^(5|5[06-9]|6\d*)$/,exactPattern:/^(5[06-9]|6[37])\d*$/,gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:"CVC",size:3}};function l(e){var n,r,i=[],o=[];if(!("string"==typeof e||e instanceof String))return[];for(r=0;r<_.length;r++){n=t[_[r]];0!==e.length?n.exactPattern.test(e)?o.push(d(n)):n.prefixPattern.test(e)&&i.push(d(n)):i.push(d(n))}return o.length?o:i}l.getTypeInfo=function(e){return d(t[e])};l.types={VISA:n,MASTERCARD:r,AMERICAN_EXPRESS:i,DINERS_CLUB:o,DISCOVER:s,JCB:a,UNIONPAY:c,MAESTRO:u};e.exports=l},561902:(e,t,n)=>{"use strict"
|
|
;var r=n(866834),i=n(809724).assign,o=n(725279),s=n(441970),a=n(461863),c=n(439548),u=n(198533),p=n(589585),_=n(573475),d=n(549614),l=n(715136),E="3.28.0",h=n(568246).events,f=n(568246).errors,A=n(864548),T={Visa:"visa",Mastercard:"mastercard","American Express":"amex","Diners Club":"diners",Discover:"discover",JCB:"jcb",UnionPay:"unionpay",Maestro:"maestro"};function I(e){var t=e.enabledPaymentMethods||{};d.call(this);this._componentId=c();this._client=e.client;this._analyticsName="payment-request";this._enabledPaymentMethods={basicCard:!1!==t.basicCard,googlePay:!1!==t.googlePay};this._supportedPaymentMethods=this._constructDefaultSupportedPaymentMethods();this._defaultSupportedPaymentMethods=Object.keys(this._supportedPaymentMethods).map(function(e){return this._supportedPaymentMethods[e]}.bind(this));this._bus=new o({channel:this._componentId})}I.prototype=Object.create(d.prototype,{constructor:I});I.prototype._constructDefaultSupportedPaymentMethods=function(){
|
|
var e=this._client.getConfiguration(),t="production"===e.gatewayConfiguration.environment,n=e.analyticsMetadata,r=e.gatewayConfiguration.androidPay,i=e.gatewayConfiguration.creditCards,o={};this._enabledPaymentMethods.basicCard&&i&&i.supportedCardTypes.length>0&&(o.basicCard={supportedMethods:["basic-card"],data:{supportedNetworks:i.supportedCardTypes.map((function(e){return T[e]}))}});if(this._enabledPaymentMethods.googlePay&&r&&r.enabled){o.googlePay={supportedMethods:["https://google.com/pay"],data:{merchantId:"18278000977346790994",apiVersion:1,environment:t?"PRODUCTION":"TEST",allowedPaymentMethods:["CARD","TOKENIZED_CARD"],paymentMethodTokenizationParameters:{tokenizationType:"PAYMENT_GATEWAY",parameters:{gateway:"braintree","braintree:merchantId":e.gatewayConfiguration.merchantId,"braintree:authorizationFingerprint":r.googleAuthorizationFingerprint,"braintree:apiVersion":"v1","braintree:sdkVersion":E,"braintree:metadata":JSON.stringify({source:n.source,integration:n.integration,
|
|
sessionId:n.sessionId,version:E,platform:n.platform})}},cardRequirements:{allowedCardNetworks:r.supportedNetworks.map((function(e){return e.toUpperCase()}))}}};"TOKENIZATION_KEY"===e.authorizationType&&(o.googlePay.data.paymentMethodTokenizationParameters.parameters["braintree:clientKey"]=e.authorization)}return o};I.prototype.initialize=function(){var e=this._client.getConfiguration(),t=this;this._frame=a({allowPaymentRequest:!0,name:"braintree-payment-request-frame",class:"braintree-payment-request-frame",height:0,width:0,style:{position:"absolute",left:"-9999px"}});return 0===this._defaultSupportedPaymentMethods.length?_.reject(new l(f.PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS)):new _((function(n){t._bus.on(h.FRAME_READY,(function(e){e(t._client)}));t._bus.on(h.FRAME_CAN_MAKE_REQUESTS,(function(){r.sendEvent(t._client,t._analyticsName+".initialized");t._bus.on(h.SHIPPING_ADDRESS_CHANGE,(function(e){var n={target:{shippingAddress:e},updateWith:function(e){
|
|
t._bus.emit(h.UPDATE_SHIPPING_ADDRESS,e)}};t._emit("shippingAddressChange",n);t._emit("shippingaddresschange",n)}));t._bus.on(h.SHIPPING_OPTION_CHANGE,(function(e){var n={target:{shippingOption:e},updateWith:function(e){t._bus.emit(h.UPDATE_SHIPPING_OPTION,e)}};t._emit("shippingOptionChange",n);t._emit("shippingoptionchange",n)}));n(t)}));t._frame.src=(i=e.gatewayConfiguration.assetsUrl,o=t._componentId,s=e.isDebug,i+"/web/3.28.0/html/payment-request-frame"+u(s)+".html#"+o);var i,o,s;document.body.appendChild(t._frame)}))};I.prototype.createSupportedPaymentMethodsConfiguration=function(e,t){var n;if(!e)throw new l(f.PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE);if(!this._enabledPaymentMethods[e])throw new l(f.PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED);(n=i({},this._supportedPaymentMethods[e])).data=i({},n.data,t);return n};I.prototype.tokenize=function(e){return new _(function(t,n){
|
|
this._bus.emit(h.PAYMENT_REQUEST_INITIALIZED,{supportedPaymentMethods:e.supportedPaymentMethods||this._defaultSupportedPaymentMethods,details:e.details,options:e.options});this._bus.on(h.PAYMENT_REQUEST_SUCCESSFUL,function(e){r.sendEvent(this._client,this._analyticsName+".tokenize.succeeded");t({nonce:e.nonce,type:e.type,description:e.description,details:{rawPaymentResponse:e.details.rawPaymentResponse,cardType:e.details.cardType,lastFour:e.details.lastFour,lastTwo:e.details.lastTwo},binData:e.binData})}.bind(this));this._bus.on(h.PAYMENT_REQUEST_FAILED,function(e){var t;if("AbortError"===e.name){t=new l({type:f.PAYMENT_REQUEST_CANCELED.type,code:f.PAYMENT_REQUEST_CANCELED.code,message:f.PAYMENT_REQUEST_CANCELED.message,details:{originalError:e}});r.sendEvent(this._client,this._analyticsName+".tokenize.canceled")}else if("PAYMENT_REQUEST_INITIALIZATION_FAILED"===e.name)t=new l({type:f.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.type,
|
|
code:f.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.code,message:f.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.message,details:{originalError:e}});else if("BRAINTREE_GATEWAY_GOOGLE_PAYMENT_TOKENIZATION_ERROR"===e.name)t=new l({type:f.PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE.type,code:f.PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE.code,message:f.PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE.message,details:{originalError:e}});else if("BRAINTREE_GATEWAY_GOOGLE_PAYMENT_PARSING_ERROR"===e.name)t=new l({type:f.PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR.type,code:f.PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR.code,message:f.PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR.message,details:{originalError:e}});else{t=new l({code:f.PAYMENT_REQUEST_NOT_COMPLETED.code,type:e.type||l.types.CUSTOMER,message:f.PAYMENT_REQUEST_NOT_COMPLETED.message,details:{originalError:e}});r.sendEvent(this._client,this._analyticsName+".tokenize.failed")}n(t)}.bind(this))}.bind(this))}
|
|
;I.prototype.teardown=function(){this._bus.teardown();this._frame.parentNode.removeChild(this._frame);s(this,p(I.prototype));r.sendEvent(this._client,this._analyticsName+".teardown-completed");return _.resolve()};e.exports=A.wrapPrototype(I)},911545:(e,t,n)=>{"use strict";var r=n(561902),i=n(318327),o=n(864548);e.exports={create:o((function(e){return i.verify({name:"Payment Request",client:e.client}).then((function(){return new r(e).initialize()}))})),VERSION:"3.28.0"}},568246:(e,t,n)=>{"use strict";var r=n(715136),i=n(652583),o={};o.events=i(["FRAME_READY","FRAME_CAN_MAKE_REQUESTS","PAYMENT_REQUEST_INITIALIZED","SHIPPING_ADDRESS_CHANGE","UPDATE_SHIPPING_ADDRESS","SHIPPING_OPTION_CHANGE","UPDATE_SHIPPING_OPTION","PAYMENT_REQUEST_FAILED","PAYMENT_REQUEST_SUCCESSFUL"],"payment-request:");o.errors={PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS:{type:r.types.MERCHANT,code:"PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS",
|
|
message:"There are no supported payment methods associated with this account."},PAYMENT_REQUEST_INVALID_UPDATE_WITH_EVENT:{type:r.types.MERCHANT,code:"PAYMENT_REQUEST_INVALID_UPDATE_WITH_EVENT"},PAYMENT_REQUEST_CANCELED:{type:r.types.CUSTOMER,code:"PAYMENT_REQUEST_CANCELED",message:"Payment request was canceled."},PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED:{type:r.types.MERCHANT,code:"PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED",message:"Something went wrong when configuring the payment request."},PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE:{type:r.types.MERCHANT,code:"PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE",message:"Something went wrong when tokenizing the Google Pay card."},PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR:{type:r.types.UNKNOWN,code:"PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR",message:"Something went wrong when tokenizing the Google Pay card."},PAYMENT_REQUEST_NOT_COMPLETED:{code:"PAYMENT_REQUEST_NOT_COMPLETED",
|
|
message:"Payment request could not be completed."},PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE:{type:r.types.MERCHANT,code:"PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE",message:"createSupportedPaymentMethodsConfiguration must include a type parameter."},PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED:{type:r.types.MERCHANT,code:"PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED",message:"createSupportedPaymentMethodsConfiguration type parameter must be valid or enabled."}};e.exports=o},226801:(e,t,n)=>{"use strict";var r=n(715136);e.exports={PAYPAL_NOT_ENABLED:{type:r.types.MERCHANT,code:"PAYPAL_NOT_ENABLED",message:"PayPal is not enabled for this merchant."},PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED:{type:r.types.MERCHANT,code:"PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED",
|
|
message:"A linked PayPal Sandbox account is required to use PayPal Checkout in Sandbox. See https://developers.braintreepayments.com/guides/paypal/testing-go-live/#linked-paypal-testing for details on linking your PayPal sandbox with Braintree."},PAYPAL_TOKENIZATION_REQUEST_ACTIVE:{type:r.types.MERCHANT,code:"PAYPAL_TOKENIZATION_REQUEST_ACTIVE",message:"Another tokenization request is active."},PAYPAL_ACCOUNT_TOKENIZATION_FAILED:{type:r.types.NETWORK,code:"PAYPAL_ACCOUNT_TOKENIZATION_FAILED",message:"Could not tokenize user's PayPal account."},PAYPAL_FLOW_FAILED:{type:r.types.NETWORK,code:"PAYPAL_FLOW_FAILED",message:"Could not initialize PayPal flow."},PAYPAL_FLOW_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"PAYPAL_FLOW_OPTION_REQUIRED",message:"PayPal flow property is invalid or missing."},PAYPAL_POPUP_OPEN_FAILED:{type:r.types.MERCHANT,code:"PAYPAL_POPUP_OPEN_FAILED",message:"PayPal popup failed to open, make sure to tokenize in response to a user action."},PAYPAL_POPUP_CLOSED:{
|
|
type:r.types.CUSTOMER,code:"PAYPAL_POPUP_CLOSED",message:"Customer closed PayPal popup before authorizing."},PAYPAL_INVALID_PAYMENT_OPTION:{type:r.types.MERCHANT,code:"PAYPAL_INVALID_PAYMENT_OPTION",message:"PayPal payment options are invalid."}}},2039:(e,t,n)=>{"use strict";var r=n(715136),i=n(866834),o=n(318327),s=n(226801),a=n(573475),c=n(864548),u=n(464398);e.exports={create:c((function(e){return o.verify({name:"PayPal Checkout",client:e.client}).then((function(){var t=e.client.getConfiguration();if(!t.gatewayConfiguration.paypalEnabled)return a.reject(new r(s.PAYPAL_NOT_ENABLED));if(!t.gatewayConfiguration.paypal.clientId)return a.reject(new r(s.PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED));i.sendEvent(e.client,"paypal-checkout.initialized");return new u(e)}))})),isSupported:function(){return!0},VERSION:"3.28.0"}},464398:(e,t,n)=>{"use strict";var r=n(866834),i=n(573475),o=n(864548),s=n(715136),a=n(240914),c=n(226801),u=n(916419),p=n(589585),_=n(441970);function d(e){this._client=e.client}
|
|
d.prototype.createPayment=function(e){var t;if(!e||!u.FLOW_ENDPOINTS.hasOwnProperty(e.flow))return i.reject(new s(c.PAYPAL_FLOW_OPTION_REQUIRED));t="paypal_hermes/"+u.FLOW_ENDPOINTS[e.flow];r.sendEvent(this._client,"paypal-checkout.createPayment");!0===e.offerCredit&&r.sendEvent(this._client,"paypal-checkout.credit.offered");return this._client.request({endpoint:t,method:"post",data:this._formatPaymentResourceData(e)}).then((function(t){return"checkout"===e.flow?t.paymentResource.paymentToken:t.agreementSetup.tokenId})).catch((function(e){return 422===(e.details&&e.details.httpStatus)?i.reject(new s({type:c.PAYPAL_INVALID_PAYMENT_OPTION.type,code:c.PAYPAL_INVALID_PAYMENT_OPTION.code,message:c.PAYPAL_INVALID_PAYMENT_OPTION.message,details:{originalError:e}})):i.reject(a(e,{type:c.PAYPAL_FLOW_FAILED.type,code:c.PAYPAL_FLOW_FAILED.code,message:c.PAYPAL_FLOW_FAILED.message}))}))};d.prototype.tokenizePayment=function(e){var t,n=this,o=this._client,s={flow:e.billingToken?"vault":"checkout",
|
|
intent:e.intent},u={ecToken:e.paymentToken,billingToken:e.billingToken,payerId:e.payerID,paymentId:e.paymentID};r.sendEvent(o,"paypal-checkout.tokenization.started");return o.request({endpoint:"payment_methods/paypal_accounts",method:"post",data:n._formatTokenizeData(s,u)}).then((function(e){t=n._formatTokenizePayload(e);r.sendEvent(o,"paypal-checkout.tokenization.success");t.creditFinancingOffered&&r.sendEvent(o,"paypal-checkout.credit.accepted");return t})).catch((function(e){r.sendEvent(o,"paypal-checkout.tokenization.failed");return i.reject(a(e,{type:c.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.type,code:c.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.code,message:c.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.message}))}))};d.prototype._formatPaymentResourceData=function(e){var t,n=this._client.getConfiguration().gatewayConfiguration,r={returnUrl:"x",cancelUrl:"x",offerPaypalCredit:!0===e.offerCredit,experienceProfile:{brandName:e.displayName||n.paypal.displayName,localeCode:e.locale,
|
|
noShipping:(!e.enableShippingAddress).toString(),addressOverride:!1===e.shippingAddressEditable,landingPageType:e.landingPageType}};if("checkout"===e.flow){r.amount=e.amount;r.currencyIsoCode=e.currency;e.hasOwnProperty("intent")&&(r.intent=e.intent);for(t in e.shippingAddressOverride)e.shippingAddressOverride.hasOwnProperty(t)&&(r[t]=e.shippingAddressOverride[t])}else{r.shippingAddress=e.shippingAddressOverride;e.billingAgreementDescription&&(r.description=e.billingAgreementDescription)}return r};d.prototype._formatTokenizeData=function(e,t){var n=this._client.getConfiguration(),r=n.gatewayConfiguration,i="TOKENIZATION_KEY"===n.authorizationType,o={paypalAccount:{correlationId:t.billingToken||t.ecToken,options:{validate:"vault"===e.flow&&!i}}};if(t.billingToken)o.paypalAccount.billingAgreementToken=t.billingToken;else{o.paypalAccount.paymentToken=t.paymentId;o.paypalAccount.payerId=t.payerId;o.paypalAccount.unilateral=r.paypal.unvettedMerchant
|
|
;e.intent&&(o.paypalAccount.intent=e.intent)}return o};d.prototype._formatTokenizePayload=function(e){var t,n={};e.paypalAccounts&&(n=e.paypalAccounts[0]);t={nonce:n.nonce,details:{},type:n.type};n.details&&n.details.payerInfo&&(t.details=n.details.payerInfo);n.details&&n.details.creditFinancingOffered&&(t.creditFinancingOffered=n.details.creditFinancingOffered);return t};d.prototype.teardown=function(){_(this,p(d.prototype));return i.resolve()};e.exports=o.wrapPrototype(d)},864568:(e,t,n)=>{"use strict";var r=n(132463),i=n(715136),o=n(240914),s=n(198533),a=n(842903),c="3.28.0",u=n(916419),p=n(291593).INTEGRATION_TIMEOUT_MS,_=n(866834),d=n(589585),l=n(161072),E=n(856342),h=n(441970),f=n(634452),A=n(573475),T=n(864548);function I(e){this._client=e.client;this._assetsUrl=e.client.getConfiguration().gatewayConfiguration.paypal.assetsUrl+"/web/"+c;this._isDebug=e.client.getConfiguration().isDebug;this._loadingFrameUrl=this._assetsUrl+"/html/paypal-landing-frame"+s(this._isDebug)+".html"
|
|
;this._authorizationInProgress=!1}I.prototype._initialize=function(){var e=this,t=this._client,n=setTimeout((function(){_.sendEvent(t,"paypal.load.timed-out")}),p);return new A((function(i){r.create({name:u.LANDING_FRAME_NAME,dispatchFrameUrl:e._assetsUrl+"/html/dispatch-frame"+s(e._isDebug)+".html",openFrameUrl:e._loadingFrameUrl},(function(r){e._frameService=r;clearTimeout(n);_.sendEvent(t,"paypal.load.succeeded");i(e)}))}))};I.prototype.tokenize=function(e,t){var r,o,s=this,c=this._client;t&&(t=a(l(t)));if(!e||!u.FLOW_ENDPOINTS.hasOwnProperty(e.flow)){o=new i(E.PAYPAL_FLOW_OPTION_REQUIRED);if(t){t(o);return this._frameService.createNoopHandler()}return A.reject(o)}r=new A((function(t,r){if(s._authorizationInProgress){_.sendEvent(c,"paypal.tokenization.error.already-opened");r(new i(E.PAYPAL_TOKENIZATION_REQUEST_ACTIVE))}else{s._authorizationInProgress=!0;n.g.popupBridge||_.sendEvent(c,"paypal.tokenization.opened");!0===e.offerCredit&&_.sendEvent(c,"paypal.credit.offered")
|
|
;s._navigateFrameToAuth(e).catch(r);s._frameService.open({},s._createFrameServiceCallback(e,t,r))}}));if(t){r.then((function(e){t(null,e)})).catch(t);return this._frameService.createHandler({beforeClose:function(){_.sendEvent(c,"paypal.tokenization.closed.by-merchant")}})}return r};I.prototype._createFrameServiceCallback=function(e,t,r){var o=this,s=this._client;return n.g.popupBridge?function(n,a){var c=a&&a.path&&"/cancel"===a.path.substring(0,7);o._authorizationInProgress=!1;if(n||c){_.sendEvent(s,"paypal.tokenization.closed-popupbridge.by-user");r(new i(E.PAYPAL_POPUP_CLOSED))}else a&&o._tokenizePayPal(e,a.queryItems).then(t).catch(r)}:function(n,a){o._authorizationInProgress=!1;if(n)if("FRAME_SERVICE_FRAME_CLOSED"===n.code){_.sendEvent(s,"paypal.tokenization.closed.by-user");r(new i(E.PAYPAL_POPUP_CLOSED))}else"FRAME_SERVICE_FRAME_OPEN_FAILED"===n.code&&r(new i(E.PAYPAL_POPUP_OPEN_FAILED));else a&&o._tokenizePayPal(e,a).then(t).catch(r)}};I.prototype._tokenizePayPal=function(e,t){
|
|
var r=this,i=this._client;n.g.popupBridge||this._frameService.redirect(this._loadingFrameUrl);return i.request({endpoint:"payment_methods/paypal_accounts",method:"post",data:this._formatTokenizeData(e,t)}).then((function(e){var t=r._formatTokenizePayload(e);n.g.popupBridge?_.sendEvent(i,"paypal.tokenization.success-popupbridge"):_.sendEvent(i,"paypal.tokenization.success");t.creditFinancingOffered&&_.sendEvent(i,"paypal.credit.accepted");r._frameService.close();return t})).catch((function(e){n.g.popupBridge?_.sendEvent(i,"paypal.tokenization.failed-popupbridge"):_.sendEvent(i,"paypal.tokenization.failed");r._frameService.close();return A.reject(o(e,{type:E.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.type,code:E.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.code,message:E.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.message}))}))};I.prototype._formatTokenizePayload=function(e){var t,n={};e.paypalAccounts&&(n=e.paypalAccounts[0]);t={nonce:n.nonce,details:{},type:n.type}
|
|
;n.details&&n.details.payerInfo&&(t.details=n.details.payerInfo);n.details&&n.details.creditFinancingOffered&&(t.creditFinancingOffered=n.details.creditFinancingOffered);return t};I.prototype._formatTokenizeData=function(e,t){var n=this._client.getConfiguration(),r=n.gatewayConfiguration,i="TOKENIZATION_KEY"===n.authorizationType,o={paypalAccount:{correlationId:t.ba_token||t.token,options:{validate:"vault"===e.flow&&!i}}};if(t.ba_token)o.paypalAccount.billingAgreementToken=t.ba_token;else{o.paypalAccount.paymentToken=t.paymentId;o.paypalAccount.payerId=t.PayerID;o.paypalAccount.unilateral=r.paypal.unvettedMerchant;e.hasOwnProperty("intent")&&(o.paypalAccount.intent=e.intent)}return o};I.prototype._navigateFrameToAuth=function(e){var t=this,r=this._client,s="paypal_hermes/"+u.FLOW_ENDPOINTS[e.flow];return r.request({endpoint:s,method:"post",data:this._formatPaymentResourceData(e)}).then((function(i){var o;o="checkout"===e.flow?i.paymentResource.redirectUrl:i.agreementSetup.approvalUrl
|
|
;"commit"===e.useraction&&(o=f.queryify(o,{useraction:"commit"}));n.g.popupBridge&&_.sendEvent(r,"paypal.tokenization.opened-popupbridge");t._frameService.redirect(o)})).catch((function(e){var n=e.details&&e.details.httpStatus;t._frameService.close();t._authorizationInProgress=!1;return 422===n?A.reject(new i({type:E.PAYPAL_INVALID_PAYMENT_OPTION.type,code:E.PAYPAL_INVALID_PAYMENT_OPTION.code,message:E.PAYPAL_INVALID_PAYMENT_OPTION.message,details:{originalError:e}})):A.reject(o(e,{type:E.PAYPAL_FLOW_FAILED.type,code:E.PAYPAL_FLOW_FAILED.code,message:E.PAYPAL_FLOW_FAILED.message}))}))};I.prototype._formatPaymentResourceData=function(e){var t,r=this._client.getConfiguration().gatewayConfiguration,i=this._frameService._serviceId,o={returnUrl:r.paypal.assetsUrl+"/web/"+"3.28.0/html/paypal-redirect-frame"+s(this._isDebug)+".html?channel="+i,cancelUrl:r.paypal.assetsUrl+"/web/"+"3.28.0/html/paypal-cancel-frame"+s(this._isDebug)+".html?channel="+i,offerPaypalCredit:!0===e.offerCredit,
|
|
experienceProfile:{brandName:e.displayName||r.paypal.displayName,localeCode:e.locale,noShipping:(!e.enableShippingAddress).toString(),addressOverride:!1===e.shippingAddressEditable,landingPageType:e.landingPageType}};if(n.g.popupBridge&&"function"==typeof n.g.popupBridge.getReturnUrlPrefix){o.returnUrl=n.g.popupBridge.getReturnUrlPrefix()+"return";o.cancelUrl=n.g.popupBridge.getReturnUrlPrefix()+"cancel"}if("checkout"===e.flow){o.amount=e.amount;o.currencyIsoCode=e.currency;e.hasOwnProperty("intent")&&(o.intent=e.intent);for(t in e.shippingAddressOverride)e.shippingAddressOverride.hasOwnProperty(t)&&(o[t]=e.shippingAddressOverride[t])}else{o.shippingAddress=e.shippingAddressOverride;e.billingAgreementDescription&&(o.description=e.billingAgreementDescription)}return o};I.prototype.closeWindow=function(){this._authorizationInProgress&&_.sendEvent(this._client,"paypal.tokenize.closed.by-merchant");this._frameService.close()};I.prototype.focusWindow=function(){this._frameService.focus()}
|
|
;I.prototype.teardown=T((function(){var e=this;e._frameService.teardown();h(e,d(I.prototype));_.sendEvent(e._client,"paypal.teardown-completed");return A.resolve()}));e.exports=I},33824:(e,t,n)=>{"use strict";var r=n(866834),i=n(318327),o=n(715136),s=n(856342),a=n(864568),c=n(864548),u=n(573475);e.exports={create:c((function(e){return i.verify({name:"PayPal",client:e.client}).then((function(){if(!0!==e.client.getConfiguration().gatewayConfiguration.paypalEnabled)return u.reject(new o(s.PAYPAL_NOT_ENABLED));r.sendEvent(e.client,"paypal.initialized");return new a(e)._initialize()}))})),isSupported:function(){return!0},VERSION:"3.28.0"}},916419:e=>{"use strict";e.exports={LANDING_FRAME_NAME:"braintreepaypallanding",FLOW_ENDPOINTS:{checkout:"create_payment_resource",vault:"setup_billing_agreement"}}},856342:(e,t,n)=>{"use strict";var r=n(715136);e.exports={PAYPAL_NOT_ENABLED:{type:r.types.MERCHANT,code:"PAYPAL_NOT_ENABLED",message:"PayPal is not enabled for this merchant."},
|
|
PAYPAL_TOKENIZATION_REQUEST_ACTIVE:{type:r.types.MERCHANT,code:"PAYPAL_TOKENIZATION_REQUEST_ACTIVE",message:"Another tokenization request is active."},PAYPAL_ACCOUNT_TOKENIZATION_FAILED:{type:r.types.NETWORK,code:"PAYPAL_ACCOUNT_TOKENIZATION_FAILED",message:"Could not tokenize user's PayPal account."},PAYPAL_FLOW_FAILED:{type:r.types.NETWORK,code:"PAYPAL_FLOW_FAILED",message:"Could not initialize PayPal flow."},PAYPAL_FLOW_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"PAYPAL_FLOW_OPTION_REQUIRED",message:"PayPal flow property is invalid or missing."},PAYPAL_BROWSER_NOT_SUPPORTED:{type:r.types.CUSTOMER,code:"PAYPAL_BROWSER_NOT_SUPPORTED",message:"Browser is not supported."},PAYPAL_POPUP_OPEN_FAILED:{type:r.types.MERCHANT,code:"PAYPAL_POPUP_OPEN_FAILED",message:"PayPal popup failed to open, make sure to tokenize in response to a user action."},PAYPAL_POPUP_CLOSED:{type:r.types.CUSTOMER,code:"PAYPAL_POPUP_CLOSED",message:"Customer closed PayPal popup before authorizing."},
|
|
PAYPAL_INVALID_PAYMENT_OPTION:{type:r.types.MERCHANT,code:"PAYPAL_INVALID_PAYMENT_OPTION",message:"PayPal payment options are invalid."}}},552105:(e,t,n)=>{"use strict";var r=n(715136),i=n(866834),o=n(809724).assign,s=n(589585),a=n(441970),c=n(620113),u=n(198533),p=n(725279),_=n(439548),d=n(161072),l=n(224740),E=n(128122),h=n(461863),f=n(573475),A=n(864548);function T(e){this._options=e;this._assetsUrl=e.client.getConfiguration().gatewayConfiguration.assetsUrl;this._isDebug=e.client.getConfiguration().isDebug;this._client=e.client}T.prototype.verifyCard=function(e){var t,n,i,o,s,a,c=this;e=e||{};!0===this._verifyCardInProgress?s=l.THREEDS_AUTHENTICATION_IN_PROGRESS:e.nonce?e.amount?"function"!=typeof e.addFrame?a="an addFrame function":"function"!=typeof e.removeFrame&&(a="a removeFrame function"):a="an amount":a="a nonce";a&&(s={type:l.THREEDS_MISSING_VERIFY_CARD_OPTION.type,code:l.THREEDS_MISSING_VERIFY_CARD_OPTION.code,message:"verifyCard options must include "+a+"."})
|
|
;if(s)return f.reject(new r(s));n=!1!==e.showLoader;this._verifyCardInProgress=!0;i=d(e.addFrame);o=d(e.removeFrame);t="payment_methods/"+e.nonce+"/three_d_secure/lookup";return this._client.request({endpoint:t,method:"post",data:{amount:e.amount}}).then((function(e){c._lookupPaymentMethod=e.paymentMethod;return new f((function(t,r){c._verifyCardCallback=function(e,n){c._verifyCardInProgress=!1;e?r(e):t(n)};c._handleLookupResponse({showLoader:n,lookupResponse:e,addFrame:i,removeFrame:o})}))})).catch((function(e){c._verifyCardInProgress=!1;return f.reject(e)}))};T.prototype.cancelVerifyCard=function(){var e;this._verifyCardInProgress=!1;if(!this._lookupPaymentMethod)return f.reject(new r(l.THREEDS_NO_VERIFICATION_PAYLOAD));e=o({},this._lookupPaymentMethod,{liabilityShiftPossible:this._lookupPaymentMethod.threeDSecureInfo.liabilityShiftPossible,liabilityShifted:this._lookupPaymentMethod.threeDSecureInfo.liabilityShifted,
|
|
verificationDetails:this._lookupPaymentMethod.threeDSecureInfo.verificationDetails});return f.resolve(e)};T.prototype._handleLookupResponse=function(e){var t=e.lookupResponse;t.lookup&&t.lookup.acsUrl&&t.lookup.acsUrl.length>0?e.addFrame(null,this._createIframe({showLoader:e.showLoader,response:t.lookup,removeFrame:e.removeFrame})):this._verifyCardCallback(null,{nonce:t.paymentMethod.nonce,liabilityShiftPossible:t.threeDSecureInfo.liabilityShiftPossible,liabilityShifted:t.threeDSecureInfo.liabilityShifted,verificationDetails:t.threeDSecureInfo})};T.prototype._createIframe=function(e){var t,n,r=window.location.href,i=e.response;this._bus=new p({channel:_(),merchantUrl:location.href});n=this._assetsUrl+"/web/"+"3.28.0/html/three-d-secure-authentication-complete-frame.html?channel="+encodeURIComponent(this._bus.channel)+"&";r.indexOf("#")>-1&&(r=r.split("#")[0]);this._bus.on(p.events.CONFIGURATION_REQUEST,(function(e){e({acsUrl:i.acsUrl,pareq:i.pareq,
|
|
termUrl:i.termUrl+"&three_d_secure_version="+"3.28.0&authentication_complete_base_url="+encodeURIComponent(n),md:i.md,parentUrl:r})}));this._bus.on(E.AUTHENTICATION_COMPLETE,function(t){this._handleAuthResponse(t,e)}.bind(this));t=this._assetsUrl+"/web/"+"3.28.0/html/three-d-secure-bank-frame"+u(this._isDebug)+".html?showLoader="+e.showLoader;this._bankIframe=h({src:t,height:400,width:400,name:c.LANDING_FRAME_NAME+"_"+this._bus.channel});return this._bankIframe};T.prototype._handleAuthResponse=function(e,t){var n=JSON.parse(e.auth_response);this._bus.teardown();t.removeFrame();d(function(){n.success?this._verifyCardCallback(null,this._formatAuthResponse(n.paymentMethod,n.threeDSecureInfo)):n.threeDSecureInfo&&n.threeDSecureInfo.liabilityShiftPossible?this._verifyCardCallback(null,this._formatAuthResponse(this._lookupPaymentMethod,n.threeDSecureInfo)):this._verifyCardCallback(new r({type:r.types.UNKNOWN,code:"UNKNOWN_AUTH_RESPONSE",message:n.error.message}))}.bind(this))()}
|
|
;T.prototype._formatAuthResponse=function(e,t){return{nonce:e.nonce,details:e.details,description:e.description,liabilityShifted:t.liabilityShifted,liabilityShiftPossible:t.liabilityShiftPossible}};T.prototype.teardown=function(){var e;a(this,s(T.prototype));i.sendEvent(this._options.client,"threedsecure.teardown-completed");this._bus&&this._bus.teardown();this._bankIframe&&(e=this._bankIframe.parentNode)&&e.removeChild(this._bankIframe);return f.resolve()};e.exports=A.wrapPrototype(T)},327449:(e,t,n)=>{"use strict";var r=n(552105),i=n(335546).isHTTPS,o=n(318327),s=n(715136),a=n(866834),c=n(224740),u=n(573475),p=n(864548);e.exports={create:p((function(e){return o.verify({name:"3D Secure",client:e.client}).then((function(){var t,n=e.client.getConfiguration();n.gatewayConfiguration.threeDSecureEnabled||(t=c.THREEDS_NOT_ENABLED);"TOKENIZATION_KEY"===n.authorizationType&&(t=c.THREEDS_CAN_NOT_USE_TOKENIZATION_KEY)
|
|
;"production"===n.gatewayConfiguration.environment&&!i()&&(t=c.THREEDS_HTTPS_REQUIRED);if(t)return u.reject(new s(t));a.sendEvent(e.client,"threedsecure.initialized");return new r(e)}))})),VERSION:"3.28.0"}},620113:e=>{"use strict";e.exports={LANDING_FRAME_NAME:"braintreethreedsecurelanding"}},224740:(e,t,n)=>{"use strict";var r=n(715136);e.exports={THREEDS_AUTHENTICATION_IN_PROGRESS:{type:r.types.MERCHANT,code:"THREEDS_AUTHENTICATION_IN_PROGRESS",message:"Cannot call verifyCard while existing authentication is in progress."},THREEDS_MISSING_VERIFY_CARD_OPTION:{type:r.types.MERCHANT,code:"THREEDS_MISSING_VERIFY_CARD_OPTION"},THREEDS_NO_VERIFICATION_PAYLOAD:{type:r.types.MERCHANT,code:"THREEDS_NO_VERIFICATION_PAYLOAD",message:"No verification payload available."},THREEDS_NOT_ENABLED:{type:r.types.MERCHANT,code:"THREEDS_NOT_ENABLED",message:"3D Secure is not enabled for this merchant."},THREEDS_CAN_NOT_USE_TOKENIZATION_KEY:{type:r.types.MERCHANT,
|
|
code:"THREEDS_CAN_NOT_USE_TOKENIZATION_KEY",message:"3D Secure can not use a tokenization key for authorization."},THREEDS_HTTPS_REQUIRED:{type:r.types.MERCHANT,code:"THREEDS_HTTPS_REQUIRED",message:"3D Secure requires HTTPS."},THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN:{type:r.types.INTERNAL,code:"THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN",message:"Term Url must be on a Braintree domain."}}},128122:(e,t,n)=>{"use strict";var r=n(652583);e.exports=r(["AUTHENTICATION_COMPLETE"],"threedsecure:")},489894:(e,t,n)=>{"use strict";var r=n(945649),i=n(318327),o=n(715136),s=n(866834),a=n(26081),c=n(573475),u=n(864548);e.exports={create:u((function(e){return i.verify({name:"UnionPay",client:e.client}).then((function(){var t=e.client.getConfiguration();if(!t.gatewayConfiguration.unionPay||!0!==t.gatewayConfiguration.unionPay.enabled)return c.reject(new o(a.UNIONPAY_NOT_ENABLED));s.sendEvent(e.client,"unionpay.initialized");return new r(e)}))})),VERSION:"3.28.0"}},206682:(e,t,n)=>{"use strict"
|
|
;var r=n(652583);e.exports={events:r(["HOSTED_FIELDS_FETCH_CAPABILITIES","HOSTED_FIELDS_ENROLL","HOSTED_FIELDS_TOKENIZE"],"union-pay:"),HOSTED_FIELDS_FRAME_NAME:"braintreeunionpayhostedfields"}},26081:(e,t,n)=>{"use strict";var r=n(715136);e.exports={UNIONPAY_NOT_ENABLED:{type:r.types.MERCHANT,code:"UNIONPAY_NOT_ENABLED",message:"UnionPay is not enabled for this merchant."},UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID:{type:r.types.MERCHANT,code:"UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID",message:"Found an invalid Hosted Fields instance. Please use a valid Hosted Fields instance."},UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED:{type:r.types.MERCHANT,code:"UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED",message:"Could not find the Hosted Fields instance."},UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED:{type:r.types.MERCHANT,code:"UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED",message:"A card or a Hosted Fields instance is required. Please supply a card or a Hosted Fields instance."},
|
|
UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES:{type:r.types.MERCHANT,code:"UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES",message:"Please supply either a card or a Hosted Fields instance, not both."},UNIONPAY_EXPIRATION_DATE_INCOMPLETE:{type:r.types.MERCHANT,code:"UNIONPAY_EXPIRATION_DATE_INCOMPLETE",message:"You must supply expiration month and year or neither."},UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID:{type:r.types.CUSTOMER,code:"UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID",message:"Enrollment failed due to user input error."},UNIONPAY_ENROLLMENT_NETWORK_ERROR:{type:r.types.NETWORK,code:"UNIONPAY_ENROLLMENT_NETWORK_ERROR",message:"Could not enroll UnionPay card."},UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR:{type:r.types.NETWORK,code:"UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR",message:"Could not fetch card capabilities."},UNIONPAY_TOKENIZATION_NETWORK_ERROR:{type:r.types.NETWORK,code:"UNIONPAY_TOKENIZATION_NETWORK_ERROR",message:"A tokenization network error occurred."},
|
|
UNIONPAY_MISSING_MOBILE_PHONE_DATA:{type:r.types.MERCHANT,code:"UNIONPAY_MISSING_MOBILE_PHONE_DATA",message:"A `mobile` with `countryCode` and `number` is required."},UNIONPAY_FAILED_TOKENIZATION:{type:r.types.CUSTOMER,code:"UNIONPAY_FAILED_TOKENIZATION",message:"The supplied card data failed tokenization."}}},945649:(e,t,n)=>{"use strict";var r=n(866834),i=n(715136),o=n(725279),s=n(206682),a=n(198533),c=n(441970),u=n(26081),p=s.events,_=n(461863),d=n(589585),l=n(439548),E=n(573475),h=n(864548);function f(e){this._options=e}f.prototype.fetchCapabilities=function(e){var t=this,n=this._options.client,o=e.card?e.card.number:null,s=e.hostedFields;return o&&s?E.reject(new i(u.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES)):o?n.request({method:"get",endpoint:"payment_methods/credit_cards/capabilities",data:{_meta:{source:"unionpay"},creditCard:{number:o}}}).then((function(e){r.sendEvent(n,"unionpay.capabilities-received");return e})).catch((function(e){var t=e.details&&e.details.httpStatus
|
|
;r.sendEvent(n,"unionpay.capabilities-failed");return 403===t?E.reject(e):E.reject(new i({type:u.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.type,code:u.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.code,message:u.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.message,details:{originalError:e}}))})):s?s._bus?new E((function(e,n){t._initializeHostedFields((function(){t._bus.emit(p.HOSTED_FIELDS_FETCH_CAPABILITIES,{hostedFields:s},(function(t){t.err?n(new i(t.err)):e(t.payload)}))}))})):E.reject(new i(u.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID)):E.reject(new i(u.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED))};f.prototype.enroll=function(e){var t,n=this,o=this._options.client,s=e.card,a=e.mobile,c=e.hostedFields;if(!a)return E.reject(new i(u.UNIONPAY_MISSING_MOBILE_PHONE_DATA));if(c)return c._bus?s?E.reject(new i(u.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES)):new E((function(e,t){n._initializeHostedFields((function(){n._bus.emit(p.HOSTED_FIELDS_ENROLL,{hostedFields:c,mobile:a},(function(n){
|
|
n.err?t(new i(n.err)):e(n.payload)}))}))})):E.reject(new i(u.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID));if(s&&s.number){t={_meta:{source:"unionpay"},unionPayEnrollment:{number:s.number,mobileCountryCode:a.countryCode,mobileNumber:a.number}};if(s.expirationDate)t.unionPayEnrollment.expirationDate=s.expirationDate;else if(s.expirationMonth||s.expirationYear){if(!s.expirationMonth||!s.expirationYear)return E.reject(new i(u.UNIONPAY_EXPIRATION_DATE_INCOMPLETE));t.unionPayEnrollment.expirationYear=s.expirationYear;t.unionPayEnrollment.expirationMonth=s.expirationMonth}return o.request({method:"post",endpoint:"union_pay_enrollments",data:t}).then((function(e){r.sendEvent(o,"unionpay.enrollment-succeeded");return{enrollmentId:e.unionPayEnrollmentId,smsCodeRequired:e.smsCodeRequired}})).catch((function(e){var t,n=e.details&&e.details.httpStatus;403===n?t=e:n<500?(t=new i(u.UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID)).details={originalError:e
|
|
}:(t=new i(u.UNIONPAY_ENROLLMENT_NETWORK_ERROR)).details={originalError:e};r.sendEvent(o,"unionpay.enrollment-failed");return E.reject(t)}))}return E.reject(new i(u.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED))};f.prototype.tokenize=function(e){var t,n=this,o=this._options.client,s=e.card,a=e.hostedFields;if(s&&a)return E.reject(new i(u.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES));if(s){t={_meta:{source:"unionpay"},creditCard:{number:e.card.number,options:{unionPayEnrollment:{id:e.enrollmentId}}}};e.smsCode&&(t.creditCard.options.unionPayEnrollment.smsCode=e.smsCode);if(s.expirationDate)t.creditCard.expirationDate=s.expirationDate;else if(s.expirationMonth&&s.expirationYear){t.creditCard.expirationYear=s.expirationYear;t.creditCard.expirationMonth=s.expirationMonth}e.card.cvv&&(t.creditCard.cvv=e.card.cvv);return o.request({method:"post",endpoint:"payment_methods/credit_cards",data:t}).then((function(e){var t=e.creditCards[0];delete t.consumed;delete t.threeDSecureInfo
|
|
;r.sendEvent(o,"unionpay.nonce-received");return t})).catch((function(e){var t,n=e.details&&e.details.httpStatus;r.sendEvent(o,"unionpay.nonce-failed");403===n?t=e:n<500?(t=new i(u.UNIONPAY_FAILED_TOKENIZATION)).details={originalError:e}:(t=new i(u.UNIONPAY_TOKENIZATION_NETWORK_ERROR)).details={originalError:e};return E.reject(t)}))}return a?a._bus?new E((function(t,r){n._initializeHostedFields((function(){n._bus.emit(p.HOSTED_FIELDS_TOKENIZE,e,(function(e){e.err?r(new i(e.err)):t(e.payload)}))}))})):E.reject(new i(u.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID)):E.reject(new i(u.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED))};f.prototype.teardown=function(){if(this._bus){this._hostedFieldsFrame.parentNode.removeChild(this._hostedFieldsFrame);this._bus.teardown()}c(this,d(f.prototype));return E.resolve()};f.prototype._initializeHostedFields=function(e){var t,n,r=l();if(this._bus)e();else{t=this._options.client.getConfiguration().gatewayConfiguration.assetsUrl
|
|
;n=this._options.client.getConfiguration().isDebug;this._bus=new o({channel:r,merchantUrl:location.href});this._hostedFieldsFrame=_({name:s.HOSTED_FIELDS_FRAME_NAME+"_"+r,src:t+"/web/3.28.0/html/unionpay-hosted-fields-frame"+a(n)+".html",height:0,width:0});this._bus.on(o.events.CONFIGURATION_REQUEST,function(t){t(this._options.client);e()}.bind(this));document.body.appendChild(this._hostedFieldsFrame)}};e.exports=h.wrapPrototype(f)},761777:e=>{"use strict";e.exports={PLAID_LINK_JS:"https://cdn.plaid.com/link/v2/stable/link-initialize.js"}},855590:(e,t,n)=>{"use strict";var r=n(715136);e.exports={US_BANK_ACCOUNT_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"US_BANK_ACCOUNT_OPTION_REQUIRED"},US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS:{type:r.types.MERCHANT,code:"US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS"},US_BANK_ACCOUNT_LOGIN_LOAD_FAILED:{type:r.types.NETWORK,code:"US_BANK_ACCOUNT_LOGIN_LOAD_FAILED",message:"Bank login flow failed to load."},US_BANK_ACCOUNT_LOGIN_CLOSED:{
|
|
type:r.types.CUSTOMER,code:"US_BANK_ACCOUNT_LOGIN_CLOSED",message:"Customer closed bank login flow before authorizing."},US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE:{type:r.types.MERCHANT,code:"US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE",message:"Another bank login tokenization request is active."},US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR:{type:r.types.NETWORK,code:"US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR",message:"A tokenization network error occurred."},US_BANK_ACCOUNT_FAILED_TOKENIZATION:{type:r.types.CUSTOMER,code:"US_BANK_ACCOUNT_FAILED_TOKENIZATION",message:"The supplied data failed tokenization."},US_BANK_ACCOUNT_NOT_ENABLED:{type:r.types.MERCHANT,code:"US_BANK_ACCOUNT_NOT_ENABLED",message:"US bank account is not enabled."},US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED:{type:r.types.MERCHANT,code:"US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED",message:"Bank login is not enabled."}}},392014:(e,t,n)=>{"use strict";var r=n(318327),i=n(715136),o=n(855590),s=n(350861),a=n(792117),c=n(573475),u=n(864548)
|
|
;e.exports={create:u((function(e){return r.verify({name:"US Bank Account",client:e.client}).then((function(){return e.client.getConfiguration().gatewayConfiguration.braintreeApi?e.client.getConfiguration().gatewayConfiguration.usBankAccount?new s(e):c.reject(new i(o.US_BANK_ACCOUNT_NOT_ENABLED)):c.reject(new i(a.BRAINTREE_API_ACCESS_RESTRICTED))}))})),VERSION:"3.28.0"}},350861:(e,t,n)=>{"use strict";var r=n(715136),i=n(761777),o=n(855590),s=n(792117),a=n(866834),c=n(842903),u=n(441970),p=n(589585),_=n(620662),d=n(573475),l=n(864548);function E(e){this._client=e.client;this._isTokenizingBankLogin=!1;a.sendEvent(this._client,"usbankaccount.initialized")}E.prototype.tokenize=function(e){return(e=e||{}).mandateText?e.bankDetails&&e.bankLogin?d.reject(new r({type:o.US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS.type,code:o.US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS.code,message:"tokenize must be called with bankDetails or bankLogin, not both."
|
|
})):e.bankDetails?this._tokenizeBankDetails(e):e.bankLogin?this._tokenizeBankLogin(e):d.reject(new r({type:o.US_BANK_ACCOUNT_OPTION_REQUIRED.type,code:o.US_BANK_ACCOUNT_OPTION_REQUIRED.code,message:"tokenize must be called with bankDetails or bankLogin."})):d.reject(new r({type:o.US_BANK_ACCOUNT_OPTION_REQUIRED.type,code:o.US_BANK_ACCOUNT_OPTION_REQUIRED.code,message:"mandateText property is required."}))};E.prototype._tokenizeBankDetails=function(e){var t=this._client,n=e.bankDetails;return t.request({method:"POST",endpoint:"tokens",api:"braintreeApi",data:_({type:"us_bank_account",routingNumber:n.routingNumber,accountNumber:n.accountNumber,firstName:n.firstName,lastName:n.lastName,businessName:n.businessName,accountType:n.accountType,ownershipType:n.ownershipType,billingAddress:_(n.billingAddress||{}),achMandate:{text:e.mandateText}})}).then((function(e){a.sendEvent(t,"usbankaccount.bankdetails.tokenization.succeeded");return d.resolve(f(e))})).catch((function(e){var n=h(e)
|
|
;a.sendEvent(t,"usbankaccount.bankdetails.tokenization.failed");return d.reject(n)}))};E.prototype._tokenizeBankLogin=function(e){var t=this,n=this._client,i=n.getConfiguration().gatewayConfiguration,s="production"===i.environment,c=i.usBankAccount.plaid;if(!e.bankLogin.displayName)return d.reject(new r({type:o.US_BANK_ACCOUNT_OPTION_REQUIRED.type,code:o.US_BANK_ACCOUNT_OPTION_REQUIRED.code,message:"displayName property is required when using bankLogin."}));if(!c)return d.reject(new r(o.US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED));if(this._isTokenizingBankLogin)return d.reject(new r(o.US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE));this._isTokenizingBankLogin=!0;return new d((function(i,u){t._loadPlaid((function(p,d){if(p)u(p);else{d.create({clientName:e.bankLogin.displayName,apiVersion:"v2",env:s?"production":"sandbox",key:c.publicKey,product:"auth",selectAccount:!0,onExit:function(){t._isTokenizingBankLogin=!1;a.sendEvent(n,"usbankaccount.banklogin.tokenization.closed.by-user")
|
|
;u(new r(o.US_BANK_ACCOUNT_LOGIN_CLOSED))},onSuccess:function(r,o){n.request({method:"POST",endpoint:"tokens",api:"braintreeApi",data:_({type:"plaid_public_token",publicToken:r,accountId:s?o.account_id:"plaid_account_id",achMandate:{text:e.mandateText},ownershipType:e.bankLogin.ownershipType,firstName:e.bankLogin.firstName,lastName:e.bankLogin.lastName,businessName:e.bankLogin.businessName,billingAddress:_(e.bankLogin.billingAddress||{})})}).then((function(e){t._isTokenizingBankLogin=!1;a.sendEvent(n,"usbankaccount.banklogin.tokenization.succeeded");i(f(e))})).catch((function(e){var r;t._isTokenizingBankLogin=!1;r=h(e);a.sendEvent(n,"usbankaccount.banklogin.tokenization.failed");u(r)}))}}).open();a.sendEvent(n,"usbankaccount.banklogin.tokenization.started")}}))}))};function h(e){var t,n=e.details&&e.details.httpStatus;(t=new r(401===n?s.BRAINTREE_API_ACCESS_RESTRICTED:n<500?o.US_BANK_ACCOUNT_FAILED_TOKENIZATION:o.US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR)).details={originalError:e}
|
|
;return t}function f(e){return{nonce:e.data.id,details:{},description:e.data.description,type:e.data.type}}E.prototype._loadPlaid=function(e){var t,r;e=c(e);if(n.g.Plaid)e(null,n.g.Plaid);else if(t=document.querySelector('script[src="'+i.PLAID_LINK_JS+'"]'))A(t,e);else{(r=document.createElement("script")).src=i.PLAID_LINK_JS;r.async=!0;A(r,e);document.body.appendChild(r);this._plaidScript=r}};function A(e,t){function i(){var r=this.readyState;if(!r||"loaded"===r||"complete"===r){!function(){e.removeEventListener("error",s);e.removeEventListener("load",i);e.removeEventListener("readystatechange",i)}();t(null,n.g.Plaid)}}function s(){e.parentNode.removeChild(e);t(new r(o.US_BANK_ACCOUNT_LOGIN_LOAD_FAILED))}e.addEventListener("error",s);e.addEventListener("load",i);e.addEventListener("readystatechange",i)}E.prototype.teardown=function(){this._plaidScript&&document.body.removeChild(this._plaidScript);u(this,p(E.prototype));return d.resolve()};e.exports=l.wrapPrototype(E)},255059:(e,t,n)=>{
|
|
"use strict";var r=n(318327),i=n(16169),o=n(864548);e.exports={create:o((function(e){return r.verify({name:"Vault Manager",client:e.client}).then((function(){return new i(e)}))})),VERSION:"3.28.0"}},16169:(e,t,n)=>{"use strict";var r=n(589585),i=n(441970),o=n(573475),s=n(864548);function a(e){this._client=e.client}a.prototype.fetchPaymentMethods=function(e){var t;t=!0===(e=e||{}).defaultFirst?1:0;return this._client.request({endpoint:"payment_methods",method:"get",data:{defaultFirst:t}}).then((function(e){return e.paymentMethods.map(c)}))};function c(e){var t={nonce:e.nonce,default:e.default,details:e.details,type:e.type};e.description&&(t.description=e.description);e.binData&&(t.binData=e.binData);return t}a.prototype.teardown=function(){i(this,r(a.prototype));return o.resolve()};e.exports=s.wrapPrototype(a)},4951:(e,t,n)=>{"use strict";var r=n(866834),i=n(318327),o=n(488824),s=n(864548),a=n(715136),c=n(7172),u=n(573475);e.exports={create:s((function(e){return i.verify({name:"Venmo",
|
|
client:e.client}).then((function(){var t;if(!e.client.getConfiguration().gatewayConfiguration.payWithVenmo)return u.reject(new a(o.VENMO_NOT_ENABLED));t=new c(e);r.sendEvent(e.client,"venmo.initialized");return t._initialize()}))})),VERSION:"3.28.0"}},6197:(e,t,n)=>{"use strict";var r=n(154103),i=n(850730),o=n(522427),s=n(441762),a=n(820979),c=n(768109);e.exports={isAndroid:r,isChrome:i,isIos:o,isIosSafari:s,isSamsungBrowser:a,isMobileFirefox:c}},291814:e=>{"use strict";e.exports={DOCUMENT_VISIBILITY_CHANGE_EVENT_DELAY:500,PROCESS_RESULTS_DELAY:1e3,VENMO_OPEN_URL:"https://venmo.com/braintree/checkout"}},488824:(e,t,n)=>{"use strict";var r=n(715136);e.exports={VENMO_NOT_ENABLED:{type:r.types.MERCHANT,code:"VENMO_NOT_ENABLED",message:"Venmo is not enabled for this merchant."},VENMO_TOKENIZATION_REQUEST_ACTIVE:{type:r.types.MERCHANT,code:"VENMO_TOKENIZATION_REQUEST_ACTIVE",message:"Another tokenization request is active."},VENMO_APP_FAILED:{type:r.types.UNKNOWN,code:"VENMO_APP_FAILED",
|
|
message:"Venmo app encountered a problem."},VENMO_APP_CANCELED:{type:r.types.CUSTOMER,code:"VENMO_APP_CANCELED",message:"Venmo app authorization was canceled."},VENMO_CANCELED:{type:r.types.CUSTOMER,code:"VENMO_CANCELED",message:"User canceled Venmo authorization, or Venmo app is not available."}}},7172:(e,t,n)=>{"use strict";var r=n(866834),i=n(6197),o=n(291814),s=n(488824),a=n(634452),c=n(589585),u=n(441970),p=n(864548),_=n(715136),d=n(573475);function l(e){var t;this._client=e.client;t=this._client.getConfiguration();this._isDebug=t.isDebug;this._assetsUrl=t.gatewayConfiguration.assetsUrl+"/web/3.28.0";this._allowNewBrowserTab=!1!==e.allowNewBrowserTab}l.prototype._initialize=function(){var e=n.g.location.href.replace(n.g.location.hash,""),t=a.parse(n.g.location.href),r=this._client.getConfiguration().gatewayConfiguration.payWithVenmo,i=this._client.getConfiguration().analyticsMetadata,s={_meta:{version:i.sdkVersion,integration:i.integration,platform:i.platform,sessionId:i.sessionId
|
|
}};t["x-success"]=e+"#venmoSuccess=1";t["x-cancel"]=e+"#venmoCancel=1";t["x-error"]=e+"#venmoError=1";t.ua=n.g.navigator.userAgent;t.braintree_merchant_id=r.merchantId;t.braintree_access_token=r.accessToken;t.braintree_environment=r.environment;t.braintree_sdk_data=btoa(JSON.stringify(s));this._url=o.VENMO_OPEN_URL+"?"+a.stringify(t);return d.resolve(this)};l.prototype.isBrowserSupported=function(){var e=i.isAndroid()&&i.isChrome(),t=i.isIos()&&i.isChrome(),n=i.isIosSafari()||e,r=t||i.isSamsungBrowser()||i.isMobileFirefox();return n||this._allowNewBrowserTab&&r};l.prototype.hasTokenizationResult=function(){var e=E();return void 0!==(e.venmoSuccess||e.venmoError||e.venmoCancel)};l.prototype.tokenize=function(){var e=this;return!0===this._tokenizationInProgress?d.reject(new _(s.VENMO_TOKENIZATION_REQUEST_ACTIVE)):this.hasTokenizationResult()?this._processResults():new d((function(t,r){e._tokenizationInProgress=!0;e._previousHash=n.g.location.hash;n.g.open(e._url)
|
|
;e._visibilityChangeListener=function(){if(!n.g.document.hidden){e._tokenizationInProgress=!1;setTimeout((function(){e._processResults().then(t).catch(r).then((function(){n.g.location.hash=e._previousHash;e._removeVisibilityEventListener();delete e._visibilityChangeListener}))}),o.PROCESS_RESULTS_DELAY)}};setTimeout((function(){n.g.document.addEventListener(h(),e._visibilityChangeListener)}),o.DOCUMENT_VISIBILITY_CHANGE_EVENT_DELAY)}))};l.prototype.teardown=function(){this._removeVisibilityEventListener();u(this,c(l.prototype));return d.resolve()};l.prototype._removeVisibilityEventListener=function(){n.g.document.removeEventListener(h(),this._visibilityChangeListener)};l.prototype._processResults=function(){var e=this,t=E();return new d((function(i,o){if(t.venmoSuccess){r.sendEvent(e._client,"venmo.appswitch.handle.success");i((a=t,{nonce:c?c.nonce:a.paymentMethodNonce,type:"VenmoAccount",details:{username:a.username}}))}else if(t.venmoError){
|
|
r.sendEvent(e._client,"venmo.appswitch.handle.error");o(new _({type:s.VENMO_APP_FAILED.type,code:s.VENMO_APP_FAILED.code,message:s.VENMO_APP_FAILED.message,details:{originalError:{message:decodeURIComponent(t.errorMessage),code:t.errorCode}}}))}else if(t.venmoCancel){r.sendEvent(e._client,"venmo.appswitch.handle.cancel");o(new _(s.VENMO_APP_CANCELED))}else{r.sendEvent(e._client,"venmo.appswitch.cancel-or-unavailable");o(new _(s.VENMO_CANCELED))}var a,c;"function"==typeof n.g.history.replaceState&&history.pushState({},"",n.g.location.href.slice(0,n.g.location.href.indexOf("#")))}))};function E(){return n.g.location.hash.substring(1).split("&").reduce((function(e,t){var n=t.split("="),r=decodeURIComponent(n[0]),i=decodeURIComponent(n[1]);e[r]=i;return e}),{})}function h(){var e;void 0!==n.g.document.hidden?e="visibilitychange":void 0!==n.g.document.msHidden?e="msvisibilitychange":void 0!==n.g.document.webkitHidden&&(e="webkitvisibilitychange");return e}e.exports=p.wrapPrototype(l)},
|
|
908605:(e,t,n)=>{"use strict";var r=n(715136);e.exports={VISA_CHECKOUT_NOT_ENABLED:{type:r.types.MERCHANT,code:"VISA_CHECKOUT_NOT_ENABLED",message:"Visa Checkout is not enabled for this merchant."},VISA_CHECKOUT_INIT_OPTIONS_REQUIRED:{type:r.types.MERCHANT,code:"VISA_CHECKOUT_INIT_OPTIONS_REQUIRED",message:"initOptions requires an object."},VISA_CHECKOUT_PAYMENT_REQUIRED:{type:r.types.MERCHANT,code:"VISA_CHECKOUT_PAYMENT_REQUIRED",message:"tokenize requires callid, encKey, and encPaymentData."},VISA_CHECKOUT_TOKENIZATION:{type:r.types.NETWORK,code:"VISA_CHECKOUT_TOKENIZATION",message:"A network error occurred when processing the Visa Checkout payment."}}},559081:(e,t,n)=>{"use strict";var r=n(318327),i=n(715136),o=n(351576),s=n(866834),a=n(908605),c=n(573475),u=n(864548);e.exports={create:u((function(e){return r.verify({name:"Visa Checkout",client:e.client}).then((function(){
|
|
if(!e.client.getConfiguration().gatewayConfiguration.visaCheckout)return c.reject(new i(a.VISA_CHECKOUT_NOT_ENABLED));s.sendEvent(e.client,"visacheckout.initialized");return new o(e)}))})),VERSION:"3.28.0"}},351576:(e,t,n)=>{"use strict";var r=n(715136),i=n(866834),o=n(908605),s=n(112404),a=n(589585),c=n(441970),u=n(573475),p=n(864548),_={Visa:"VISA",MasterCard:"MASTERCARD",Discover:"DISCOVER","American Express":"AMEX"};function d(e){this._client=e.client}d.prototype.createInitOptions=function(e){var t,n=this._client.getConfiguration().gatewayConfiguration,i=n.visaCheckout;if(!e)throw new r(o.VISA_CHECKOUT_INIT_OPTIONS_REQUIRED);(t=s(e)).apikey=t.apikey||i.apikey;t.externalClientId=t.externalClientId||i.externalClientId;t.settings=t.settings||{};t.settings.dataLevel="FULL";t.settings.payment=t.settings.payment||{};t.settings.payment.cardBrands||(t.settings.payment.cardBrands=n.visaCheckout.supportedCardTypes.reduce((function(e,t){return _.hasOwnProperty(t)?e.concat(_[t]):e}),[]))
|
|
;return t};d.prototype.tokenize=function(e){var t=this;return e.callid&&e.encKey&&e.encPaymentData?this._client.request({method:"post",endpoint:"payment_methods/visa_checkout_cards",data:{_meta:{source:"visa-checkout"},visaCheckoutCard:{callId:e.callid,encryptedPaymentData:e.encPaymentData,encryptedKey:e.encKey}}}).then((function(e){i.sendEvent(t._client,"visacheckout.tokenize.succeeded");return e.visaCheckoutCards[0]})).catch((function(e){i.sendEvent(t._client,"visacheckout.tokenize.failed");return u.reject(new r({type:o.VISA_CHECKOUT_TOKENIZATION.type,code:o.VISA_CHECKOUT_TOKENIZATION.code,message:o.VISA_CHECKOUT_TOKENIZATION.message,details:{originalError:e}}))})):u.reject(new r(o.VISA_CHECKOUT_PAYMENT_REQUIRED))};d.prototype.teardown=function(){c(this,a(d.prototype));return u.resolve()};e.exports=p.wrapPrototype(d)},704791:function(e,t,n){"use strict";r=this,e.exports=function(e){var t,n,r=[],i={},o="/*framebus*/";function s(e){if(null==e)return!1;if(null==e.Window)return!1
|
|
;if(e.constructor!==e.Window)return!1;r.push(e);return!0}function a(e){var t,r={};for(t in n)n.hasOwnProperty(t)&&(r[t]=n[t]);r._origin=e||"*";return r}function c(e){var n,r=_(this);if(d(e))return!1;if(d(r))return!1;if(!1===(n=l(e,Array.prototype.slice.call(arguments,1),r)))return!1;y(t.top||t.self,n,r);return!0}function u(e,t){var n=_(this);if(O(e,t,n))return!1;i[n]=i[n]||{};i[n][e]=i[n][e]||[];i[n][e].push(t);return!0}function p(e,t){var n,r,o=_(this);if(O(e,t,o))return!1;if(!(r=i[o]&&i[o][e]))return!1;for(n=0;n<r.length;n++)if(r[n]===t){r.splice(n,1);return!0}return!1}function _(e){return e&&e._origin||"*"}function d(e){return"string"!=typeof e}function l(e,t,n){var r=!1,i={event:e,origin:n},s=t[t.length-1];if("function"==typeof s){i.reply=m(s,n);t=t.slice(0,-1)}i.args=t;try{r=o+JSON.stringify(i)}catch(e){throw new Error("Could not stringify event: "+e.message)}return r}function E(e){var t,n,r,i;if(e.data.slice(0,o.length)!==o)return!1;try{t=JSON.parse(e.data.slice(o.length))
|
|
}catch(e){return!1}if(null!=t.reply){n=e.origin;r=e.source;i=t.reply;t.reply=function(e){var t=l(i,[e],n);if(!1===t)return!1;r.postMessage(t,n)};t.args.push(t.reply)}return t}function h(n){t||((t=n||e).addEventListener?t.addEventListener("message",A,!1):t.attachEvent?t.attachEvent("onmessage",A):null===t.onmessage?t.onmessage=A:t=null)}function f(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function A(e){var t;if(!d(e.data)&&(t=E(e))){T("*",t.event,t.args,e);T(e.origin,t.event,t.args,e);N(e.data,t.origin,e.source)}}function T(e,t,n,r){var o;if(i[e]&&i[e][t])for(o=0;o<i[e][t].length;o++)i[e][t][o].apply(r,n)}function I(e){return e.top===e&&null!=e.opener&&e.opener!==e&&!0!==e.opener.closed}function y(e,t,n){var r;try{e.postMessage(t,n);I(e)&&y(e.opener.top,t,n);for(r=0;r<e.frames.length;r++)y(e.frames[r],t,n)}catch(e){}}function N(e,t,n){var i,o
|
|
;for(i=r.length-1;i>=0;i--)!0===(o=r[i]).closed?r=r.slice(i,1):n!==o&&y(o.top,e,t)}function m(e,t){var r=f();function i(o,s){e(o,s);n.target(t).unsubscribe(r,i)}n.target(t).subscribe(r,i);return r}function O(e,t,n){return!!d(e)||"function"!=typeof t||!!d(n)}h();return n={target:a,include:s,publish:c,pub:c,trigger:c,emit:c,subscribe:u,sub:u,on:u,unsubscribe:p,unsub:p,off:p}}(void 0===n.g?r:n.g);var r},373705:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>l});var r=setTimeout;function i(){}function o(e,t){for(;3===e._state;)e=e._value;if(0!==e._state){e._handled=!0;_._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){a(t.promise,e);return}s(t.promise,r)}else(1===e._state?s:a)(t.promise,e._value)}))}else e._deferreds.push(t)}function s(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof _){e._state=3;e._value=t
|
|
;c(e);return}if("function"==typeof n){p((r=n,i=t,function(){r.apply(i,arguments)}),e);return}}e._state=1;e._value=t;c(e)}catch(t){a(e,t)}var r,i}function a(e,t){e._state=2;e._value=t;c(e)}function c(e){2===e._state&&0===e._deferreds.length&&_._immediateFn((function(){e._handled||_._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)o(e,e._deferreds[t]);e._deferreds=null}function u(e,t,n){this.onFulfilled="function"==typeof e?e:null;this.onRejected="function"==typeof t?t:null;this.promise=n}function p(e,t){var n=!1;try{e((function(e){if(!n){n=!0;s(t,e)}}),(function(e){if(!n){n=!0;a(t,e)}}))}catch(e){if(n)return;n=!0;a(t,e)}}function _(e){if(!(this instanceof _))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0;this._handled=!1;this._value=void 0;this._deferreds=[];p(e,this)}var d=_.prototype;d.catch=function(e){return this.then(null,e)};d.then=function(e,t){
|
|
var n=new this.constructor(i);o(this,new u(e,t,n));return n};_.all=function(e){return new _((function(t,n){if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var i=r.length;function o(e,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a){a.call(s,(function(t){o(e,t)}),n);return}}r[e]=s;0==--i&&t(r)}catch(e){n(e)}}for(var s=0;s<r.length;s++)o(s,r[s])}))};_.resolve=function(e){return e&&"object"==typeof e&&e.constructor===_?e:new _((function(t){t(e)}))};_.reject=function(e){return new _((function(t,n){n(e)}))};_.race=function(e){return new _((function(t,n){for(var r=0,i=e.length;r<i;r++)e[r].then(t,n)}))};_._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){r(e,0)};_._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};const l=_},
|
|
283094:(e,t,n)=>{"use strict";var r=n.g.navigator&&n.g.navigator.userAgent,i=n(397645),o=n(285224),s=n(741295),a=n(541489),c=/Version\/\d\.\d* Chrome\/\d*\.0\.0\.0/;e.exports={isIE9:a,isAndroidChrome:function(e){var t=e||r;return i(t)&&o(t)},isIos:s,isKitKatWebview:function(e){var t=e||r;return i(t)&&c.test(t)},isSamsungBrowser:function(e){return/SamsungBrowser/.test(e=e||r)||function(e){return!o(e)&&e.indexOf("Samsung")>-1}(e)}}},60616:e=>{"use strict";e.exports=function(e){e=e||window.navigator.userAgent;return/Android/.test(e)}},361619:(e,t,n)=>{"use strict";var r=n(453325),i=n(996511),o=n(781605),s=n(802705),a=n(213157);e.exports=function(e){return!(-1===(e=e||window.navigator.userAgent).indexOf("Chrome")&&-1===e.indexOf("CriOS")||r(e)||i(e)||o(e)||s(e)||a(e))}},781605:e=>{"use strict";e.exports=function(e){return-1!==(e=e||window.navigator.userAgent).indexOf("DuckDuckGo/")}},453325:e=>{"use strict";e.exports=function(e){return-1!==(e=e||window.navigator.userAgent).indexOf("Edge/")
|
|
}},508384:e=>{"use strict";e.exports=function(e){return-1!==(e=e||window.navigator.userAgent).indexOf("MSIE 9")}},950579:e=>{"use strict";e.exports=function(e){e=e||window.navigator.userAgent;return/iPhone|iPod|iPad/i.test(e)}},802705:e=>{"use strict";e.exports=function(e){return-1!==(e=e||window.navigator.userAgent).indexOf("OPR/")||-1!==e.indexOf("Opera/")||-1!==e.indexOf("OPT/")}},996511:e=>{"use strict";e.exports=function(e){e=e||window.navigator.userAgent;return/SamsungBrowser/i.test(e)}},213157:e=>{"use strict";e.exports=function(e){return-1!==(e=e||window.navigator.userAgent).indexOf("Silk/")}},397645:(e,t,n)=>{e.exports=n(60616)},285224:(e,t,n)=>{e.exports=n(361619)},541489:(e,t,n)=>{e.exports=n(508384)},741295:(e,t,n)=>{e.exports=n(950579)},452533:(e,t,n)=>{"use strict";var r=n(283094);e.exports=function(){return!r.isSamsungBrowser()}}}]);
|
|
//# sourceMappingURL=a4ded120044011f8bdb5.js.map
|