-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy path6806.9a14059e.iframe.bundle.js
1 lines (1 loc) · 16.2 KB
/
6806.9a14059e.iframe.bundle.js
1
"use strict";(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[6806],{"./ui/components/ui/page-container/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{QY:()=>page_container_footer.A,Ay:()=>PageContainer});var page_container_header=__webpack_require__("./ui/components/ui/page-container/page-container-header/index.js"),page_container_footer=__webpack_require__("./ui/components/ui/page-container/page-container-footer/index.js"),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);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 PageContainer=function(PureComponent){_inherits(PageContainer,PureComponent);var _super=_create_super(PageContainer);function PageContainer(){var _this;return _class_call_check(this,PageContainer),_this=_super.apply(this,arguments),_define_property(_assert_this_initialized(_this),"state",{activeTabIndex:_this.props.defaultActiveTabIndex||0}),_this}return _create_class(PageContainer,[{key:"handleTabClick",value:function handleTabClick(activeTabIndex){this.setState({activeTabIndex:activeTabIndex})}},{key:"renderTabs",value:function renderTabs(){var _this=this,tabsComponent=this.props.tabsComponent;if(!tabsComponent)return null;var numberOfTabs=react.Children.count(tabsComponent.props.children);return react.Children.map(tabsComponent.props.children,function(child,tabIndex){return child&&react.cloneElement(child,{onClick:function(index){return _this.handleTabClick(index)},tabIndex:tabIndex,isActive:numberOfTabs>1&&tabIndex===_this.state.activeTabIndex,key:tabIndex,className:"page-container__tab"})})}},{key:"renderActiveTabContent",value:function renderActiveTabContent(){var children=this.props.tabsComponent.props.children;return((children=children.filter(Boolean))[this.state.activeTabIndex]||children[0]).props.children}},{key:"renderContent",value:function renderContent(){var _this_props=this.props,contentComponent=_this_props.contentComponent,tabsComponent=_this_props.tabsComponent;return contentComponent||(tabsComponent?this.renderActiveTabContent():null)}},{key:"render",value:function render(){var _this_props=this.props,title=_this_props.title,subtitle=_this_props.subtitle,onClose=_this_props.onClose,showBackButton=_this_props.showBackButton,onBackButtonClick=_this_props.onBackButtonClick,backButtonStyles=_this_props.backButtonStyles,backButtonString=_this_props.backButtonString,onCancel=_this_props.onCancel,cancelText=_this_props.cancelText,onSubmit=_this_props.onSubmit,submitText=_this_props.submitText,disabled=_this_props.disabled,headerCloseText=_this_props.headerCloseText,hideCancel=_this_props.hideCancel;return react.createElement("div",{className:"page-container"},react.createElement(page_container_header.A,{title:title,subtitle:subtitle,onClose:onClose,showBackButton:showBackButton,onBackButtonClick:onBackButtonClick,backButtonStyles:backButtonStyles,backButtonString:backButtonString,tabs:this.renderTabs(),headerCloseText:headerCloseText}),react.createElement("div",{className:"page-container__bottom"},react.createElement("div",{className:"page-container__content"},this.renderContent()),react.createElement(page_container_footer.A,{onCancel:onCancel,cancelText:cancelText,hideCancel:hideCancel,onSubmit:onSubmit,submitText:submitText,disabled:disabled})))}}]),PageContainer}(react.PureComponent);_define_property(PageContainer,"contextTypes",{t:prop_types_default().func}),_define_property(PageContainer,"propTypes",{backButtonString:prop_types_default().string,backButtonStyles:prop_types_default().object,headerCloseText:prop_types_default().string,onBackButtonClick:prop_types_default().func,onClose:prop_types_default().func,showBackButton:prop_types_default().bool,subtitle:prop_types_default().string,title:prop_types_default().string.isRequired,defaultActiveTabIndex:prop_types_default().number,tabsComponent:prop_types_default().node,contentComponent:prop_types_default().node,cancelText:prop_types_default().string,disabled:prop_types_default().bool,hideCancel:prop_types_default().bool,onCancel:prop_types_default().func,onSubmit:prop_types_default().func,submitText:prop_types_default().string}),PageContainer.__docgenInfo={description:"",methods:[{name:"handleTabClick",docblock:null,modifiers:[],params:[{name:"activeTabIndex",optional:!1,type:null}],returns:null},{name:"renderTabs",docblock:null,modifiers:[],params:[],returns:null},{name:"renderActiveTabContent",docblock:null,modifiers:[],params:[],returns:null},{name:"renderContent",docblock:null,modifiers:[],params:[],returns:null}],displayName:"PageContainer",props:{backButtonString:{description:"",type:{name:"string"},required:!1},backButtonStyles:{description:"",type:{name:"object"},required:!1},headerCloseText:{description:"",type:{name:"string"},required:!1},onBackButtonClick:{description:"",type:{name:"func"},required:!1},onClose:{description:"",type:{name:"func"},required:!1},showBackButton:{description:"",type:{name:"bool"},required:!1},subtitle:{description:"",type:{name:"string"},required:!1},title:{description:"",type:{name:"string"},required:!0},defaultActiveTabIndex:{description:"",type:{name:"number"},required:!1},tabsComponent:{description:"",type:{name:"node"},required:!1},contentComponent:{description:"",type:{name:"node"},required:!1},cancelText:{description:"",type:{name:"string"},required:!1},disabled:{description:"",type:{name:"bool"},required:!1},hideCancel:{description:"",type:{name:"bool"},required:!1},onCancel:{description:"",type:{name:"func"},required:!1},onSubmit:{description:"",type:{name:"func"},required:!1},submitText:{description:"",type:{name:"string"},required:!1}},context:{t:{type:{name:"func"},required:!1}}},page_container_header.A.__docgenInfo={description:"",methods:[{name:"renderTabs",docblock:null,modifiers:[],params:[],returns:null},{name:"renderCloseAction",docblock:null,modifiers:[],params:[],returns:null},{name:"renderHeaderRow",docblock:null,modifiers:[],params:[],returns:null}],displayName:"PageContainerHeader",props:{title:{description:"",type:{name:"string"},required:!1},subtitle:{description:"",type:{name:"string"},required:!1},onClose:{description:"",type:{name:"func"},required:!1},showBackButton:{description:"",type:{name:"bool"},required:!1},onBackButtonClick:{description:"",type:{name:"func"},required:!1},backButtonStyles:{description:"",type:{name:"object"},required:!1},backButtonString:{description:"",type:{name:"string"},required:!1},tabs:{description:"",type:{name:"node"},required:!1},headerCloseText:{description:"",type:{name:"string"},required:!1},className:{description:"",type:{name:"string"},required:!1},hideClose:{description:"",type:{name:"bool"},required:!1}}},page_container_footer.A.__docgenInfo={description:"",methods:[],displayName:"PageContainerFooter",props:{children:{description:"",type:{name:"node"},required:!1},onCancel:{description:"",type:{name:"func"},required:!1},cancelText:{description:"",type:{name:"string"},required:!1},cancelButtonType:{description:"",type:{name:"string"},required:!1},onSubmit:{description:"",type:{name:"func"},required:!1},submitText:{description:"",type:{name:"string"},required:!1},disabled:{description:"",type:{name:"bool"},required:!1},submitButtonType:{description:"",type:{name:"string"},required:!1},hideCancel:{description:"",type:{name:"bool"},required:!1},buttonSizeLarge:{description:"",type:{name:"bool"},required:!1},footerClassName:{description:"",type:{name:"string"},required:!1},footerButtonClassName:{description:"",type:{name:"string"},required:!1}},context:{t:{type:{name:"func"},required:!1}}}},"./ui/components/ui/page-container/page-container-footer/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>PageContainerFooter});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 PageContainerFooter=function(Component){_inherits(PageContainerFooter,Component);var _super=_create_super(PageContainerFooter);function PageContainerFooter(){return _class_call_check(this,PageContainerFooter),_super.apply(this,arguments)}return _create_class(PageContainerFooter,[{key:"render",value:function render(){var _this_props=this.props,children=_this_props.children,onCancel=_this_props.onCancel,cancelText=_this_props.cancelText,onSubmit=_this_props.onSubmit,submitText=_this_props.submitText,disabled=_this_props.disabled,submitButtonType=_this_props.submitButtonType,hideCancel=_this_props.hideCancel,cancelButtonType=_this_props.cancelButtonType,_this_props_buttonSizeLarge=_this_props.buttonSizeLarge,buttonSizeLarge=void 0!==_this_props_buttonSizeLarge&&_this_props_buttonSizeLarge,footerClassName=_this_props.footerClassName,footerButtonClassName=_this_props.footerButtonClassName;return react.createElement("div",{className:classnames_default()("page-container__footer",footerClassName)},react.createElement("footer",null,!hideCancel&&react.createElement(ui_button.A,{type:cancelButtonType||"secondary",large:buttonSizeLarge,className:classnames_default()("page-container__footer-button","page-container__footer-button__cancel",footerButtonClassName),onClick:function(e){return onCancel(e)},"data-testid":"page-container-footer-cancel"},cancelText||this.context.t("cancel")),react.createElement(ui_button.A,{type:submitButtonType||"primary",large:buttonSizeLarge,className:classnames_default()("page-container__footer-button",footerButtonClassName),disabled:disabled,onClick:function(e){return onSubmit(e)},"data-testid":"page-container-footer-next"},submitText||this.context.t("next"))),children&&react.createElement("div",{className:"page-container__footer-secondary"},children))}}]),PageContainerFooter}(react.Component);_define_property(PageContainerFooter,"propTypes",{children:prop_types_default().node,onCancel:prop_types_default().func,cancelText:prop_types_default().string,cancelButtonType:prop_types_default().string,onSubmit:prop_types_default().func,submitText:prop_types_default().string,disabled:prop_types_default().bool,submitButtonType:prop_types_default().string,hideCancel:prop_types_default().bool,buttonSizeLarge:prop_types_default().bool,footerClassName:prop_types_default().string,footerButtonClassName:prop_types_default().string}),_define_property(PageContainerFooter,"contextTypes",{t:prop_types_default().func}),PageContainerFooter.__docgenInfo={description:"",methods:[],displayName:"PageContainerFooter",props:{children:{description:"",type:{name:"node"},required:!1},onCancel:{description:"",type:{name:"func"},required:!1},cancelText:{description:"",type:{name:"string"},required:!1},cancelButtonType:{description:"",type:{name:"string"},required:!1},onSubmit:{description:"",type:{name:"func"},required:!1},submitText:{description:"",type:{name:"string"},required:!1},disabled:{description:"",type:{name:"bool"},required:!1},submitButtonType:{description:"",type:{name:"string"},required:!1},hideCancel:{description:"",type:{name:"bool"},required:!1},buttonSizeLarge:{description:"",type:{name:"bool"},required:!1},footerClassName:{description:"",type:{name:"string"},required:!1},footerButtonClassName:{description:"",type:{name:"string"},required:!1}},context:{t:{type:{name:"func"},required:!1}}}}}]);