react-stripe-elements
Version:
React components for Stripe.js and Stripe Elements
1 lines • 22.6 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactStripeElements=t(require("react")):e.ReactStripeElements=t(e.React)}(window,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(t,n){t.exports=e},function(e,t,n){e.exports=n(5)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.elementContextTypes=t.injectContextTypes=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=s(n(0)),i=s(n(1)),a=n(3);function s(e){return e&&e.__esModule?e:{default:e}}function p(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function u(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var c=t.injectContextTypes={getRegisteredElements:i.default.func.isRequired,elements:i.default.object},l=t.elementContextTypes={addElementsLoadListener:i.default.func.isRequired,registerElement:i.default.func.isRequired,unregisterElement:i.default.func.isRequired},d=function(e){function t(n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o));i._elements=null,i.handleRegisterElement=function(e,t,n,o){i.setState((function(i){return{registeredElements:[].concat(u(i.registeredElements),[r({element:e},t?{impliedTokenType:t}:{},n?{impliedSourceType:n}:{},o?{impliedPaymentMethodType:o}:{})])}}))},i.handleUnregisterElement=function(e){i.setState((function(t){return{registeredElements:t.registeredElements.filter((function(t){return t.element!==e}))}}))};var a=i.props,s=(a.children,p(a,["children"]));return"sync"===i.context.tag&&(i._elements=i.context.stripe.elements(s)),i.state={registeredElements:[]},i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getChildContext=function(){var e=this;return{addElementsLoadListener:function(t){if("sync"===e.context.tag){if(!e._elements)throw new Error("Expected elements to be instantiated but it was not.");t(e._elements)}else e.context.addStripeLoadListener((function(n){if(e._elements)t(e._elements);else{var r=e.props,o=(r.children,p(r,["children"]));e._elements=n.elements(o),t(e._elements)}}))},registerElement:this.handleRegisterElement,unregisterElement:this.handleUnregisterElement,getRegisteredElements:function(){return e.state.registeredElements},elements:this._elements}},t.prototype.render=function(){return o.default.Children.only(this.props.children)},t}(o.default.Component);d.childContextTypes=r({},c,l),d.contextTypes=a.providerContextTypes,d.defaultProps={children:null},t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.providerContextTypes=void 0;var r=i(n(0)),o=i(n(1));function i(e){return e&&e.__esModule?e:{default:e}}var a=t.providerContextTypes={tag:o.default.string.isRequired,stripe:o.default.object,addStripeLoadListener:o.default.func},s=function(e){if(e&&e.elements&&e.createSource&&e.createToken&&e.createPaymentMethod&&e.handleCardPayment)return e;throw new Error("Please pass a valid Stripe object to StripeProvider. You can obtain a Stripe object by calling 'Stripe(...)' with your publishable key.")},p=function(e){function t(n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n));if(r.props.apiKey&&r.props.stripe)throw new Error("Please pass either 'apiKey' or 'stripe' to StripeProvider, not both.");if(r.props.apiKey){if(!window.Stripe)throw new Error("Please load Stripe.js (https://js.stripe.com/v3/) on this page to use react-stripe-elements. If Stripe.js isn't available yet (it's loading asynchronously, or you're using server-side rendering), see https://github.com/stripe/react-stripe-elements#advanced-integrations");var o=r.props,i=o.apiKey,a=(o.children,function(e,t){window.Stripe.__cachedInstances=window.Stripe.__cachedInstances||{};var n="key="+e+" options="+JSON.stringify(t),r=window.Stripe.__cachedInstances[n]||window.Stripe(e,t);return window.Stripe.__cachedInstances[n]=r,r}(i,function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(o,["apiKey","children"])));r._meta={tag:"sync",stripe:a},r._register()}else if(r.props.stripe){var p=s(r.props.stripe);r._meta={tag:"sync",stripe:p},r._register()}else{if(null!==r.props.stripe)throw new Error("Please pass either 'apiKey' or 'stripe' to StripeProvider. If you're using 'stripe' but don't have a Stripe instance yet, pass 'null' explicitly.");r._meta={tag:"async",stripe:null}}return r._didWarn=!1,r._didWakeUpListeners=!1,r._listeners=[],r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getChildContext=function(){var e=this;return"sync"===this._meta.tag?{tag:"sync",stripe:this._meta.stripe}:{tag:"async",addStripeLoadListener:function(t){e._meta.stripe?t(e._meta.stripe):e._listeners.push(t)}}},t.prototype.componentDidUpdate=function(e){var t=this.props.apiKey&&e.apiKey&&this.props.apiKey!==e.apiKey,n=this.props.stripe&&e.stripe&&this.props.stripe!==e.stripe;if(!this._didWarn&&(t||n)&&window.console&&window.console.error)return this._didWarn=!0,void console.error("StripeProvider does not support changing the apiKey parameter.");if(!this._didWakeUpListeners&&this.props.stripe){this._didWakeUpListeners=!0;var r=s(this.props.stripe);this._meta.stripe=r,this._register(),this._listeners.forEach((function(e){e(r)}))}},t.prototype._register=function(){var e=this._meta.stripe;e&&e._registerWrapper&&e._registerWrapper({name:"react-stripe-elements",version:"6.1.2"})},t.prototype.render=function(){return r.default.Children.only(this.props.children)},t}(r.default.Component);p.propTypes={apiKey:o.default.string,stripe:o.default.object,children:o.default.node},p.childContextTypes=a,p.defaultProps={apiKey:void 0,stripe:void 0,children:null},t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AuBankAccountElement=t.FpxBankElement=t.IdealBankElement=t.IbanElement=t.PaymentRequestButtonElement=t.CardCVCElement=t.CardCvcElement=t.CardExpiryElement=t.CardNumberElement=t.CardElement=t.Elements=t.injectStripe=t.StripeProvider=void 0;var r=p(n(3)),o=p(n(7)),i=p(n(2)),a=p(n(8)),s=p(n(10));function p(e){return e&&e.__esModule?e:{default:e}}var u=(0,a.default)("card",{impliedTokenType:"card",impliedSourceType:"card",impliedPaymentMethodType:"card"}),c=(0,a.default)("cardNumber",{impliedTokenType:"card",impliedSourceType:"card",impliedPaymentMethodType:"card"}),l=(0,a.default)("cardExpiry"),d=(0,a.default)("cardCvc"),f=d,y=(0,a.default)("iban",{impliedTokenType:"bank_account",impliedSourceType:"sepa_debit"}),m=(0,a.default)("idealBank",{impliedSourceType:"ideal"}),h=(0,a.default)("fpxBank"),v=(0,a.default)("auBankAccount");t.StripeProvider=r.default,t.injectStripe=o.default,t.Elements=i.default,t.CardElement=u,t.CardNumberElement=c,t.CardExpiryElement=l,t.CardCvcElement=d,t.CardCVCElement=f,t.PaymentRequestButtonElement=s.default,t.IbanElement=y,t.IdealBankElement=m,t.FpxBankElement=h,t.AuBankAccountElement=v},function(e,t,n){"use strict";var r=n(6);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=n(0),s=(r=a)&&r.__esModule?r:{default:r},p=n(2),u=n(3);function c(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.default=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.withRef,y=void 0!==a&&a;return n=t=function(t){function n(e,r){if(l(this,n),!r||!r.getRegisteredElements)throw new Error("It looks like you are trying to inject Stripe context outside of an Elements context.\nPlease be sure the component that calls createSource or createToken is within an <Elements> component.");var o=d(this,t.call(this,e,r));return o.parseElementOrData=function(e){return e&&"object"===(void 0===e?"undefined":i(e))&&e._frame&&"object"===i(e._frame)&&e._frame.id&&"string"==typeof e._frame.id&&"string"==typeof e._componentName?{type:"element",element:e}:{type:"data",data:e}},o.findElement=function(e,t){var n=o.context.getRegisteredElements().filter((function(t){return t[e]})),r="auto"===t?n:n.filter((function(n){return n[e]===t}));if(1===r.length)return r[0].element;if(r.length>1)throw new Error("You did not specify the type of Source, Token, or PaymentMethod to create.\n We could not infer which Element you want to use for this operation.");return null},o.requireElement=function(e,t){var n=o.findElement(e,t);if(n)return n;throw new Error("You did not specify the type of Source, Token, or PaymentMethod to create.\n We could not infer which Element you want to use for this operation.")},o.wrappedCreateToken=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t&&"object"===(void 0===t?"undefined":i(t))){var r=t,a=r.type,s=c(r,["type"]),p="string"==typeof a?a:"auto",u=o.requireElement("impliedTokenType",p);return e.createToken(u,s)}if("string"==typeof t){var l=t;return e.createToken(l,n)}throw new Error("Invalid options passed to createToken. Expected an object, got "+(void 0===t?"undefined":i(t))+".")}},o.wrappedCreateSource=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t&&"object"===(void 0===t?"undefined":i(t))){if("string"!=typeof t.type)throw new Error("Invalid Source type passed to createSource. Expected string, got "+i(t.type)+".");var n=o.findElement("impliedSourceType",t.type);return n?e.createSource(n,t):e.createSource(t)}throw new Error("Invalid options passed to createSource. Expected an object, got "+(void 0===t?"undefined":i(t))+".")}},o.wrappedCreatePaymentMethod=function(e){return function(t,n,r){if(t&&"object"===(void 0===t?"undefined":i(t)))return e.createPaymentMethod(t);if(!t||"string"!=typeof t)throw new Error("Invalid PaymentMethod type passed to createPaymentMethod. Expected a string, got "+(void 0===t?"undefined":i(t))+".");var a=o.parseElementOrData(n);if("element"===a.type){var s=a.element;return r?e.createPaymentMethod(t,s,r):e.createPaymentMethod(t,s)}var p=a.data,u=o.findElement("impliedPaymentMethodType",t);if(u)return p?e.createPaymentMethod(t,u,p):e.createPaymentMethod(t,u);if(p&&"object"===(void 0===p?"undefined":i(p)))return e.createPaymentMethod(t,p);throw p?new Error("Invalid data passed to createPaymentMethod. Expected an object, got "+(void 0===p?"undefined":i(p))+"."):new Error("Could not find an Element that can be used to create a PaymentMethod of type: "+t+".")}},o.wrappedHandleCardX=function(e,t){return function(n,r,a){if(!n||"string"!=typeof n)throw new Error("Invalid PaymentIntent client secret passed to handleCardPayment. Expected string, got "+(void 0===n?"undefined":i(n))+".");var s=o.parseElementOrData(r);if("element"===s.type){var p=s.element;return a?e[t](n,p,a):e[t](n,p)}var u=s.data,c=o.findElement("impliedPaymentMethodType","card");return c?u?e[t](n,c,u):e[t](n,c):u?e[t](n,u):e[t](n)}},"sync"===o.context.tag?o.state={stripe:o.stripeProps(o.context.stripe)}:o.state={stripe:null},o}return f(n,t),n.prototype.componentDidMount=function(){var e=this;"async"===this.context.tag&&this.context.addStripeLoadListener((function(t){e.setState({stripe:e.stripeProps(t)})}))},n.prototype.getWrappedInstance=function(){if(!y)throw new Error("To access the wrapped instance, the `{withRef: true}` option must be set when calling `injectStripe()`");return this.wrappedInstance},n.prototype.stripeProps=function(e){return o({},e,{createToken:this.wrappedCreateToken(e),createSource:this.wrappedCreateSource(e),createPaymentMethod:this.wrappedCreatePaymentMethod(e),handleCardPayment:this.wrappedHandleCardX(e,"handleCardPayment"),handleCardSetup:this.wrappedHandleCardX(e,"handleCardSetup")})},n.prototype.render=function(){var t=this;return s.default.createElement(e,o({},this.props,{stripe:this.state.stripe,elements:this.context.elements,ref:y?function(e){t.wrappedInstance=e}:null}))},n}(s.default.Component),t.contextTypes=o({},u.providerContextTypes,p.injectContextTypes),t.displayName="InjectStripe("+(e.displayName||e.name||"Component")+")",n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(0)),o=s(n(1)),i=s(n(9)),a=n(2);function s(e){return e&&e.__esModule?e:{default:e}}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=function(){},d=function(e){e.id,e.className,e.onChange,e.onFocus,e.onBlur,e.onReady;return function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["id","className","onChange","onFocus","onBlur","onReady"])},f=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};t.default=function(e){var t,n,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=t=function(t){function n(e,r){p(this,n);var o=u(this,t.call(this,e,r));o.handleRef=function(e){o._ref=e},o._element=null;var i=d(o.props);return o._options=i,o}return c(n,t),n.prototype.componentDidMount=function(){var t=this;this.context.addElementsLoadListener((function(n){if(t._ref){var r=n.create(e,t._options);t._element=r,t._setupEventListeners(r),r.mount(t._ref),t.context.registerElement(r,s.impliedTokenType,s.impliedSourceType,s.impliedPaymentMethodType)}}))},n.prototype.componentDidUpdate=function(){var e=d(this.props);0===Object.keys(e).length||(0,i.default)(e,this._options)||(this._options=e,this._element&&this._element.update(e))},n.prototype.componentWillUnmount=function(){if(this._element){var e=this._element;e.destroy(),this.context.unregisterElement(e)}},n.prototype._setupEventListeners=function(e){var t=this;e.on("ready",(function(){t.props.onReady(t._element)})),e.on("change",(function(e){t.props.onChange(e)})),e.on("blur",(function(){var e;return(e=t.props).onBlur.apply(e,arguments)})),e.on("focus",(function(){var e;return(e=t.props).onFocus.apply(e,arguments)}))},n.prototype.render=function(){return r.default.createElement("div",{id:this.props.id,className:this.props.className,ref:this.handleRef})},n}(r.default.Component),t.propTypes={id:o.default.string,className:o.default.string,onChange:o.default.func,onBlur:o.default.func,onFocus:o.default.func,onReady:o.default.func},t.defaultProps={id:void 0,className:void 0,onChange:l,onBlur:l,onFocus:l,onReady:l},t.contextTypes=a.elementContextTypes,t.displayName=f(e)+"Element",n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=function e(t,n){if("object"!==(void 0===t?"undefined":r(t))||"object"!==(void 0===n?"undefined":r(n)))return t===n;if(null===t||null===n)return t===n;var o=Array.isArray(t);if(o!==Array.isArray(n))return!1;var i="[object Object]"===Object.prototype.toString.call(t);if(i!==("[object Object]"===Object.prototype.toString.call(n)))return!1;if(!i&&!o)return!1;var a=Object.keys(t),s=Object.keys(n);if(a.length!==s.length)return!1;for(var p={},u=0;u<a.length;u+=1)p[a[u]]=!0;for(var c=0;c<s.length;c+=1)p[s[c]]=!0;var l=Object.keys(p);if(l.length!==a.length)return!1;var d=t,f=n;return l.every((function(t){return e(d[t],f[t])}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=p(n(0)),i=p(n(1)),a=p(n(11)),s=n(2);function p(e){return e&&e.__esModule?e:{default:e}}var u=function(){},c=function(e){e.id,e.className,e.onBlur,e.onClick,e.onFocus,e.onReady,e.paymentRequest;return function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["id","className","onBlur","onClick","onFocus","onReady","paymentRequest"])},l=function(e){function t(n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));o.handleRef=function(e){o._ref=e};var i=c(n);return o._options=i,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.componentDidMount=function(){var e=this;this.context.addElementsLoadListener((function(t){e._element=t.create("paymentRequestButton",r({paymentRequest:e.props.paymentRequest},e._options)),e._element.on("ready",(function(){e.props.onReady(e._element)})),e._element.on("focus",(function(){var t;return(t=e.props).onFocus.apply(t,arguments)})),e._element.on("click",(function(){var t;return(t=e.props).onClick.apply(t,arguments)})),e._element.on("blur",(function(){var t;return(t=e.props).onBlur.apply(t,arguments)})),e._element.mount(e._ref)}))},t.prototype.componentDidUpdate=function(e){this.props.paymentRequest!==e.paymentRequest&&console.warn("Unsupported prop change: paymentRequest is not a customizable property.");var t=c(this.props);0===Object.keys(t).length||(0,a.default)(t,this._options)||(this._options=t,this._element.update(t))},t.prototype.componentWillUnmount=function(){this._element.destroy()},t.prototype.render=function(){return o.default.createElement("div",{id:this.props.id,className:this.props.className,ref:this.handleRef})},t}(o.default.Component);l.propTypes={id:i.default.string,className:i.default.string,onBlur:i.default.func,onClick:i.default.func,onFocus:i.default.func,onReady:i.default.func,paymentRequest:i.default.shape({canMakePayment:i.default.func.isRequired,on:i.default.func.isRequired,show:i.default.func.isRequired}).isRequired},l.defaultProps={id:void 0,className:void 0,onBlur:u,onClick:u,onFocus:u,onReady:u},l.contextTypes=s.elementContextTypes,t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e,t){var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((function(n){return t.hasOwnProperty(n)&&t[n]===e[n]}))}}])}));