-
Notifications
You must be signed in to change notification settings - Fork 31
/
3838.9c842559.iframe.bundle.js
1 lines (1 loc) · 19.8 KB
/
3838.9c842559.iframe.bundle.js
1
"use strict";(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[3838],{"./ui/components/app/modal/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>Modal});var react=__webpack_require__("./node_modules/react/index.js"),prop_types=__webpack_require__("./node_modules/prop-types/index.js"),prop_types_default=__webpack_require__.n(prop_types),classnames=__webpack_require__("./node_modules/classnames/index.js"),classnames_default=__webpack_require__.n(classnames),ui_button=__webpack_require__("./ui/components/ui/button/index.js");function _assert_this_initialized(self){if(void 0===self)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _class_call_check(instance,Constructor){if(!(instance instanceof Constructor))throw TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _create_class(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _get_prototype_of(o){return(_get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function _inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_set_prototype_of(subClass,superClass)}function _possible_constructor_return(self,call){return call&&("object"===_type_of(call)||"function"==typeof call)?call:_assert_this_initialized(self)}function _set_prototype_of(o,p){return(_set_prototype_of=Object.setPrototypeOf||function setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function _type_of(obj){return obj&&"undefined"!=typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj}function _is_native_reflect_construct(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _create_super(Derived){var hasNativeReflectConstruct=_is_native_reflect_construct();return function _createSuperInternal(){var result,Super=_get_prototype_of(Derived);return result=hasNativeReflectConstruct?Reflect.construct(Super,arguments,_get_prototype_of(this).constructor):Super.apply(this,arguments),_possible_constructor_return(this,result)}}var Modal=function(PureComponent){_inherits(Modal,PureComponent);var _super=_create_super(Modal);function Modal(){return _class_call_check(this,Modal),_super.apply(this,arguments)}return _create_class(Modal,[{key:"render",value:function render(){var _this_props=this.props,children=_this_props.children,headerText=_this_props.headerText,onClose=_this_props.onClose,onSubmit=_this_props.onSubmit,submitType=_this_props.submitType,submitText=_this_props.submitText,submitDisabled=_this_props.submitDisabled,onCancel=_this_props.onCancel,cancelType=_this_props.cancelType,cancelText=_this_props.cancelText,contentClass=_this_props.contentClass,containerClass=_this_props.containerClass,hideFooter=_this_props.hideFooter,testId=_this_props.testId;return react.createElement("div",{className:classnames_default()("modal-container",containerClass),"data-testid":testId},headerText&&react.createElement("div",{className:"modal-container__header"},react.createElement("div",{className:"modal-container__header-text"},headerText),react.createElement("div",{className:"modal-container__header-close","data-testid":"modal-header-close",onClick:onClose})),react.createElement("div",{className:classnames_default()("modal-container__content",contentClass)},children),hideFooter?null:react.createElement("div",{className:"modal-container__footer"},onCancel&&react.createElement(ui_button.A,{type:cancelType,onClick:onCancel,className:"modal-container__footer-button"},cancelText),react.createElement(ui_button.A,{type:submitType,onClick:onSubmit,disabled:submitDisabled,className:"modal-container__footer-button"},submitText)))}}]),Modal}(react.PureComponent);function modal_content_component_assert_this_initialized(self){if(void 0===self)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function modal_content_component_class_call_check(instance,Constructor){if(!(instance instanceof Constructor))throw TypeError("Cannot call a class as a function")}function modal_content_component_defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function modal_content_component_create_class(Constructor,protoProps,staticProps){return protoProps&&modal_content_component_defineProperties(Constructor.prototype,protoProps),staticProps&&modal_content_component_defineProperties(Constructor,staticProps),Constructor}function modal_content_component_define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function modal_content_component_get_prototype_of(o){return(modal_content_component_get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function modal_content_component_inherits(subClass,superClass){if("function"!=typeof superClass&&null!==superClass)throw TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&modal_content_component_set_prototype_of(subClass,superClass)}function modal_content_component_possible_constructor_return(self,call){return call&&("object"===modal_content_component_type_of(call)||"function"==typeof call)?call:modal_content_component_assert_this_initialized(self)}function modal_content_component_set_prototype_of(o,p){return(modal_content_component_set_prototype_of=Object.setPrototypeOf||function setPrototypeOf(o,p){return o.__proto__=p,o})(o,p)}function modal_content_component_type_of(obj){return obj&&"undefined"!=typeof Symbol&&obj.constructor===Symbol?"symbol":typeof obj}function modal_content_component_is_native_reflect_construct(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function modal_content_component_create_super(Derived){var hasNativeReflectConstruct=modal_content_component_is_native_reflect_construct();return function _createSuperInternal(){var result,Super=modal_content_component_get_prototype_of(Derived);return result=hasNativeReflectConstruct?Reflect.construct(Super,arguments,modal_content_component_get_prototype_of(this).constructor):Super.apply(this,arguments),modal_content_component_possible_constructor_return(this,result)}}_define_property(Modal,"propTypes",{children:prop_types_default().node,contentClass:prop_types_default().string,containerClass:prop_types_default().string,testId:prop_types_default().string,headerText:prop_types_default().string,onClose:prop_types_default().func,onSubmit:prop_types_default().func,submitType:prop_types_default().string,submitText:prop_types_default().string,submitDisabled:prop_types_default().bool,hideFooter:prop_types_default().bool,onCancel:prop_types_default().func,cancelType:prop_types_default().string,cancelText:prop_types_default().string}),_define_property(Modal,"defaultProps",{submitType:"primary",cancelType:"secondary"}),Modal.__docgenInfo={description:"@deprecated The `<Modal />` component has been deprecated in favor of the new `<Modal>` component from the component-library.\nPlease update your code to use the new `<Modal>` component instead, which can be found at ui/components/component-library/modal/modal.tsx.\nYou can find documentation for the new Modal component in the MetaMask Storybook:\n{@link https://metamask.github.io/metamask-storybook/?path=/docs/components-componentlibrary-modal--docs}\nIf you would like to help with the replacement of the old Modal component, please submit a pull request",methods:[],displayName:"Modal",props:{submitType:{defaultValue:{value:"'primary'",computed:!1},description:"",type:{name:"string"},required:!1},cancelType:{defaultValue:{value:"'secondary'",computed:!1},description:"",type:{name:"string"},required:!1},children:{description:"",type:{name:"node"},required:!1},contentClass:{description:"",type:{name:"string"},required:!1},containerClass:{description:"",type:{name:"string"},required:!1},testId:{description:"",type:{name:"string"},required:!1},headerText:{description:"",type:{name:"string"},required:!1},onClose:{description:"",type:{name:"func"},required:!1},onSubmit:{description:"",type:{name:"func"},required:!1},submitText:{description:"",type:{name:"string"},required:!1},submitDisabled:{description:"",type:{name:"bool"},required:!1},hideFooter:{description:"",type:{name:"bool"},required:!1},onCancel:{description:"",type:{name:"func"},required:!1},cancelText:{description:"",type:{name:"string"},required:!1}}};var ModalContent=function(PureComponent){modal_content_component_inherits(ModalContent,PureComponent);var _super=modal_content_component_create_super(ModalContent);function ModalContent(){return modal_content_component_class_call_check(this,ModalContent),_super.apply(this,arguments)}return modal_content_component_create_class(ModalContent,[{key:"render",value:function render(){var _this_props=this.props,title=_this_props.title,description=_this_props.description;return react.createElement("div",{className:"modal-content"},title?react.createElement("div",{className:"modal-content__title"},title):null,description&&react.createElement("div",{className:"modal-content__description"},description))}}]),ModalContent}(react.PureComponent);modal_content_component_define_property(ModalContent,"propTypes",{title:prop_types_default().string,description:prop_types_default().string}),ModalContent.__docgenInfo={description:"",methods:[],displayName:"ModalContent",props:{title:{description:"",type:{name:"string"},required:!1},description:{description:"",type:{name:"string"},required:!1}}}},"./ui/components/ui/button/button.component.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/prop-types/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__),classnames__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/classnames/index.js"),classnames__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}function _object_without_properties(source,excluded){if(null==source)return{};var key,i,target=_object_without_properties_loose(source,excluded);if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++)key=sourceSymbolKeys[i],!(excluded.indexOf(key)>=0)&&Object.prototype.propertyIsEnumerable.call(source,key)&&(target[key]=source[key])}return target}function _object_without_properties_loose(source,excluded){if(null==source)return{};var key,i,target={},sourceKeys=Object.keys(source);for(i=0;i<sourceKeys.length;i++)key=sourceKeys[i],excluded.indexOf(key)>=0||(target[key]=source[key]);return target}var CLASSNAME_DEFAULT="btn-default",typeHash={default:CLASSNAME_DEFAULT,primary:"btn-primary",secondary:"btn-secondary",warning:"btn-warning",danger:"btn-danger","danger-primary":"btn-danger-primary",link:"btn-link",inline:"btn--inline",raised:"btn-raised"},Button=function(_param){var _onKeyUp,_role,_tabIndex,type=_param.type,_param_submit=_param.submit,large=_param.large,children=_param.children,icon=_param.icon,className=_param.className,_param_rounded=_param.rounded,buttonProps=_object_without_properties(_param,["type","submit","large","children","icon","className","rounded"]),Tag="button";return"link"===type?Tag="a":void 0!==_param_submit&&_param_submit&&(buttonProps.type="submit"),"link"===type&&"function"==typeof buttonProps.onClick&&(null!==(_onKeyUp=buttonProps.onKeyUp)&&void 0!==_onKeyUp||(buttonProps.onKeyUp=function(event){"Enter"===event.key&&buttonProps.onClick()}),null!==(_role=buttonProps.role)&&void 0!==_role||(buttonProps.role="button"),null!==(_tabIndex=buttonProps.tabIndex)&&void 0!==_tabIndex||(buttonProps.tabIndex=0)),react__WEBPACK_IMPORTED_MODULE_0__.createElement(Tag,_object_spread({className:classnames__WEBPACK_IMPORTED_MODULE_1___default()("button",(void 0===_param_rounded||_param_rounded)&&"link"!==type&&"inline"!==type&&"btn--rounded",typeHash[type]||CLASSNAME_DEFAULT,large&&"btn--large",className)},buttonProps),icon?react__WEBPACK_IMPORTED_MODULE_0__.createElement("span",{className:"button__icon"},icon):null,children)};Button.propTypes={type:prop_types__WEBPACK_IMPORTED_MODULE_2___default().string,submit:prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool,large:prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool,className:prop_types__WEBPACK_IMPORTED_MODULE_2___default().string,children:prop_types__WEBPACK_IMPORTED_MODULE_2___default().node,icon:prop_types__WEBPACK_IMPORTED_MODULE_2___default().node,rounded:prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool};let __WEBPACK_DEFAULT_EXPORT__=Button;Button.__docgenInfo={description:"@deprecated The <Button /> component has been deprecated in favor of the new <Button> component from the component-library.\nPlease update your code to use the new <Button> component instead, which can be found at ./ui/components/component-library/button/button.js.\nYou can find documentation for the new Button component in the MetaMask Storybook:\n{@link https://metamask.github.io/metamask-storybook/?path=/docs/components-componentlibrary-button--default-story#button}\nIf you would like to help with the replacement of the old Button component, please submit a pull request against this GitHub issue:\n{@link https://github.com/MetaMask/metamask-extension/issues/18896}\n@see {@link https://metamask.github.io/metamask-storybook/?path=/docs/components-componentlibrary-button--default-story#button}",methods:[],displayName:"Button",props:{submit:{defaultValue:{value:"false",computed:!1},description:"If true sets the html 'type' attribute to type=\"submit\"",type:{name:"bool"},required:!1},rounded:{defaultValue:{value:"true",computed:!1},description:"Buttons are rounded by default.",type:{name:"bool"},required:!1},type:{description:"The type of variation a button can be.\nCan be one of 'default','primary','secondary','warning','danger','danger-primary' or 'link'",type:{name:"string"},required:!1},large:{description:"Increase the height of the button to 54px",type:{name:"bool"},required:!1},className:{description:"Additional className to provide on the root element of the button",type:{name:"string"},required:!1},children:{description:"The children of the button component",type:{name:"node"},required:!1},icon:{description:"Provide an icon component for an icon to appear on the left side of the button",type:{name:"node"},required:!1}}}},"./ui/components/ui/button/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var _button_component__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./ui/components/ui/button/button.component.js");let __WEBPACK_DEFAULT_EXPORT__=_button_component__WEBPACK_IMPORTED_MODULE_0__.A;_button_component__WEBPACK_IMPORTED_MODULE_0__.A.__docgenInfo={description:"@deprecated The <Button /> component has been deprecated in favor of the new <Button> component from the component-library.\nPlease update your code to use the new <Button> component instead, which can be found at ./ui/components/component-library/button/button.js.\nYou can find documentation for the new Button component in the MetaMask Storybook:\n{@link https://metamask.github.io/metamask-storybook/?path=/docs/components-componentlibrary-button--default-story#button}\nIf you would like to help with the replacement of the old Button component, please submit a pull request against this GitHub issue:\n{@link https://github.com/MetaMask/metamask-extension/issues/18896}\n@see {@link https://metamask.github.io/metamask-storybook/?path=/docs/components-componentlibrary-button--default-story#button}",methods:[],displayName:"Button",props:{submit:{defaultValue:{value:"false",computed:!1},description:"If true sets the html 'type' attribute to type=\"submit\"",type:{name:"bool"},required:!1},rounded:{defaultValue:{value:"true",computed:!1},description:"Buttons are rounded by default.",type:{name:"bool"},required:!1},type:{description:"The type of variation a button can be.\nCan be one of 'default','primary','secondary','warning','danger','danger-primary' or 'link'",type:{name:"string"},required:!1},large:{description:"Increase the height of the button to 54px",type:{name:"bool"},required:!1},className:{description:"Additional className to provide on the root element of the button",type:{name:"string"},required:!1},children:{description:"The children of the button component",type:{name:"node"},required:!1},icon:{description:"Provide an icon component for an icon to appear on the left side of the button",type:{name:"node"},required:!1}}}},"./ui/helpers/higher-order-components/with-modal-props/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>withModalProps});var es=__webpack_require__("./node_modules/react-redux/es/index.js"),actions=__webpack_require__("./ui/__mocks__/actions.js");function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}var mapStateToProps=function(state){return _object_spread({},state.appState.modal.modalState.props)},mapDispatchToProps=function(dispatch){return{hideModal:function(){return dispatch((0,actions.hideModal)())}}};function withModalProps(Component){return(0,es.Ng)(mapStateToProps,mapDispatchToProps)(Component)}}}]);