-
Notifications
You must be signed in to change notification settings - Fork 31
/
5012.5ea1260b.iframe.bundle.js
1 lines (1 loc) · 46.6 KB
/
5012.5ea1260b.iframe.bundle.js
1
"use strict";(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[5012],{"./ui/components/ui/callout/callout.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>Callout});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/prop-types/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__),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__),_icon_info_icon_inverted_component__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/components/ui/icon/info-icon-inverted.component.js"),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_shared_constants_time__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./shared/constants/time.ts"),_component_library__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/components/component-library/index.ts");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _iterable_to_array_limit(arr,i){var _s,_e,_i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}function Callout(param){var severity=param.severity,children=param.children,dismiss=param.dismiss,isFirst=param.isFirst,isLast=param.isLast,isMultiple=param.isMultiple,_useState=_sliced_to_array((0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),2),removed=_useState[0],setRemoved=_useState[1],calloutClassName=classnames__WEBPACK_IMPORTED_MODULE_1___default()("callout","callout--".concat(severity),{"callout--dismissed":!0===removed,"callout--multiple":!0===isMultiple,"callout--dismissible":!!dismiss,"callout--first":!0===isFirst||!0!==isMultiple,"callout--last":!0===isLast||!0!==isMultiple});return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function(){removed&&setTimeout(function(){dismiss()},500*_shared_constants_time__WEBPACK_IMPORTED_MODULE_4__.oG)},[removed,dismiss]),react__WEBPACK_IMPORTED_MODULE_0__.createElement("div",{className:calloutClassName},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_icon_info_icon_inverted_component__WEBPACK_IMPORTED_MODULE_2__.A,{severity:severity}),react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_5__.EY,{color:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.r7.textDefault,className:"callout__content"},children),dismiss&&react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_5__.a2,{iconName:_component_library__WEBPACK_IMPORTED_MODULE_5__.$M.Close,size:_component_library__WEBPACK_IMPORTED_MODULE_5__.lK.Sm,className:"callout__close-button",onClick:function(){setRemoved(!0)},onKeyUp:function(event){"Enter"===event.key&&setRemoved(!0)}}))}Callout.propTypes={severity:prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOf(Object.values(_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.AI)).isRequired,children:prop_types__WEBPACK_IMPORTED_MODULE_6___default().node.isRequired,dismiss:prop_types__WEBPACK_IMPORTED_MODULE_6___default().func,isFirst:prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool,isLast:prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool,isMultiple:prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool},Callout.__docgenInfo={description:"@deprecated `<Callout />` has been deprecated in favor of the `<BannerAlert />`\ncomponent in ./ui/components/component-library/banner-alert/banner-alert.js.\nSee storybook documentation for BannerAlert here:\n{@see {@link https://metamask.github.io/metamask-storybook/?path=/docs/components-componentlibrary-banneralert--default-story#banneralert}}\n\nHelp to replace `Callout` with `BannerAlert` by submitting a PR",methods:[],displayName:"Callout",props:{severity:{description:"",type:{name:"enum",computed:!0,value:"Object.values(Severity)"},required:!0},children:{description:"",type:{name:"node"},required:!0},dismiss:{description:"",type:{name:"func"},required:!1},isFirst:{description:"",type:{name:"bool"},required:!1},isLast:{description:"",type:{name:"bool"},required:!1},isMultiple:{description:"",type:{name:"bool"},required:!1}}}},"./ui/components/ui/icon/info-icon-inverted.component.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>InfoIconInverted});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),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__),prop_types__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/prop-types/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/helpers/constants/design-system.ts");function InfoIconInverted(param){var severity=param.severity,className=classnames__WEBPACK_IMPORTED_MODULE_1___default()("info-icon",{"info-icon--success":severity===_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.oC.SUCCESS,"info-icon--warning":severity===_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.oC.WARNING,"info-icon--danger":severity===_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.oC.DANGER,"info-icon--info":severity===_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.oC.INFO});return react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg",{className:className,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},react__WEBPACK_IMPORTED_MODULE_0__.createElement("path",{d:"M15.75 8C15.75 3.75 12.25 0.25 8 0.25C3.71875 0.25 0.25 3.75 0.25 8C0.25 12.2812 3.71875 15.75 8 15.75C12.25 15.75 15.75 12.2812 15.75 8ZM8 9.5625C8.78125 9.5625 9.4375 10.2188 9.4375 11C9.4375 11.8125 8.78125 12.4375 8 12.4375C7.1875 12.4375 6.5625 11.8125 6.5625 11C6.5625 10.2188 7.1875 9.5625 8 9.5625ZM6.625 4.40625C6.59375 4.1875 6.78125 4 7 4H8.96875C9.1875 4 9.375 4.1875 9.34375 4.40625L9.125 8.65625C9.09375 8.875 8.9375 9 8.75 9H7.21875C7.03125 9 6.875 8.875 6.84375 8.65625L6.625 4.40625Z"}))}InfoIconInverted.propTypes={severity:prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOf(Object.values(_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.oC))},InfoIconInverted.__docgenInfo={description:"@deprecated This has been deprecated in favor of the `<Icon />` component in ./ui/components/component-library/icon/icon.js\nSee storybook documentation for Icon here https://metamask.github.io/metamask-storybook/?path=/docs/components-componentlibrary-icon--default-story#icon",methods:[],displayName:"InfoIconInverted",props:{severity:{description:"Severity can be 1 of 4 states:'danger', 'warning', 'info' or 'success'",type:{name:"enum",value:[{value:'"danger"',computed:!1},{value:'"warning"',computed:!1},{value:'"info"',computed:!1},{value:'"success"',computed:!1}]},required:!1}}}},"./ui/components/ui/loading-screen/loading-screen.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_4__=__webpack_require__("./node_modules/prop-types/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__),_spinner__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/components/ui/spinner/index.js"),_component_library__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/components/component-library/index.ts"),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/helpers/constants/design-system.ts"),LoadingScreen=function(param){var header=param.header,loadingMessage=param.loadingMessage,_param_showLoadingSpinner=param.showLoadingSpinner;return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.az,{className:"loading-overlay"},header,react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.az,{className:"loading-overlay__container",marginBottom:3},(void 0===_param_showLoadingSpinner||_param_showLoadingSpinner)&&react__WEBPACK_IMPORTED_MODULE_0__.createElement(_spinner__WEBPACK_IMPORTED_MODULE_1__.A,{className:"loading-overlay__spinner"})),react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_2__.az,{display:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.nl.Flex,flexDirection:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.bo.Row,justifyContent:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.A9.center,alignItems:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.k2.center},loadingMessage?(0,react__WEBPACK_IMPORTED_MODULE_0__.isValidElement)(loadingMessage)?loadingMessage:react__WEBPACK_IMPORTED_MODULE_0__.createElement("span",{style:{textAlign:"center"}},loadingMessage):null))};LoadingScreen.propTypes={header:prop_types__WEBPACK_IMPORTED_MODULE_4___default().element,loadingMessage:prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_4___default().string,prop_types__WEBPACK_IMPORTED_MODULE_4___default().element]),showLoadingSpinner:prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool};let __WEBPACK_DEFAULT_EXPORT__=react__WEBPACK_IMPORTED_MODULE_0__.memo(LoadingScreen);LoadingScreen.__docgenInfo={description:"",methods:[],displayName:"LoadingScreen",props:{showLoadingSpinner:{defaultValue:{value:"true",computed:!1},description:"",type:{name:"bool"},required:!1},header:{description:"",type:{name:"element"},required:!1},loadingMessage:{description:"",type:{name:"union",value:[{name:"string"},{name:"element"}]},required:!1}}}},"./ui/pages/confirmations/components/confirmation-warning-modal/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>confirmation_warning_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),useI18nContext=__webpack_require__("./ui/hooks/useI18nContext.js"),design_system=__webpack_require__("./ui/helpers/constants/design-system.ts"),component_library=__webpack_require__("./ui/components/component-library/index.ts"),deprecated=__webpack_require__("./ui/components/component-library/modal-content/deprecated/index.ts"),modal_header_deprecated=__webpack_require__("./ui/components/component-library/modal-header/deprecated/index.ts"),ConfirmationWarningModal=function(param){var onSubmit=param.onSubmit,onCancel=param.onCancel,t=(0,useI18nContext.P)();return react.createElement(component_library.aF,{isOpen:!0,onClose:onCancel,className:"confirmation-warning-modal__content"},react.createElement(component_library.mH,null),react.createElement(deprecated.$,null,react.createElement(modal_header_deprecated.r,{childrenWrapperProps:{display:design_system.nl.Flex,flexDirection:design_system.bo.Column,alignItems:design_system.k2.center,gap:4}},react.createElement(component_library.In,{name:component_library.$M.Danger,color:design_system.Li.errorDefault,size:component_library.lK.Xl}),react.createElement(component_library.EY,{variant:design_system.J3.headingSm,as:"h4",fontWeight:design_system.IT.Bold,textAlign:design_system.nO.Center},t("addEthereumChainWarningModalTitle"))),react.createElement(component_library.az,{marginBottom:4},react.createElement(component_library.EY,{marginTop:4,variant:design_system.J3.bodySm},t("addEthereumChainWarningModalHeader",[react.createElement("strong",{key:"part-2"},t("addEthereumChainWarningModalHeaderPartTwo"))])),react.createElement(component_library.EY,{marginTop:4,variant:design_system.J3.bodySm},t("addEthereumChainWarningModalListHeader")),react.createElement("ul",null,react.createElement(component_library.EY,{as:"li",marginTop:2,variant:design_system.J3.bodySm},t("addEthereumChainWarningModalListPointOne")),react.createElement(component_library.EY,{as:"li",marginTop:2,variant:design_system.J3.bodySm},t("addEthereumChainWarningModalListPointTwo")),react.createElement(component_library.EY,{as:"li",marginTop:2,variant:design_system.J3.bodySm},t("addEthereumChainWarningModalListPointThree")))),react.createElement(component_library.az,{display:design_system.nl.Flex,gap:4},react.createElement(component_library.$n,{variant:component_library.Vt.SECONDARY,onClick:onCancel,block:!0,size:component_library.GO.LG},t("reject")),react.createElement(component_library.$n,{variant:component_library.Vt.PRIMARY,onClick:onSubmit,danger:!0,block:!0,size:component_library.GO.LG},t("approveButtonText")))))};ConfirmationWarningModal.propTypes={onSubmit:prop_types_default().func,onCancel:prop_types_default().func};let confirmation_warning_modal=ConfirmationWarningModal;ConfirmationWarningModal.__docgenInfo={description:"",methods:[],displayName:"ConfirmationWarningModal",props:{onSubmit:{description:"Function that approves collection",type:{name:"func"},required:!1},onCancel:{description:"Function that rejects collection",type:{name:"func"},required:!1}}}},"./ui/pages/confirmations/confirmation/confirmation.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>ConfirmationPage});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),es=__webpack_require__("./node_modules/react-redux/es/index.js"),react_router=__webpack_require__("./node_modules/react-router-dom/node_modules/react-router/esm/react-router.js"),lodash=__webpack_require__("./node_modules/lodash/lodash.js"),immer_esm=__webpack_require__("./node_modules/immer/dist/immer.esm.mjs"),loglevel=__webpack_require__("./node_modules/loglevel/lib/loglevel.js"),loglevel_default=__webpack_require__.n(loglevel),constants=__webpack_require__("./node_modules/@metamask/controller-utils/dist/constants.mjs"),dialog=__webpack_require__("./node_modules/@metamask/snaps-rpc-methods/dist/restricted/dialog.mjs"),network=__webpack_require__("./shared/constants/network.ts"),fetch_with_cache=__webpack_require__("./shared/lib/fetch-with-cache.ts"),metametrics=__webpack_require__("./shared/constants/metametrics.ts"),metamask_template_renderer=__webpack_require__("./ui/components/app/metamask-template-renderer/index.js"),confirmation_warning_modal=__webpack_require__("./ui/pages/confirmations/components/confirmation-warning-modal/index.js"),routes=__webpack_require__("./ui/helpers/constants/routes.ts"),useI18nContext=__webpack_require__("./ui/hooks/useI18nContext.js"),contexts_metametrics=__webpack_require__("./ui/contexts/metametrics.js"),selectors=__webpack_require__("./ui/selectors/index.js"),networks=__webpack_require__("./shared/modules/selectors/networks.ts"),callout=__webpack_require__("./ui/components/ui/callout/callout.js"),component_library=__webpack_require__("./ui/components/component-library/index.ts"),loading_screen_component=__webpack_require__("./ui/components/ui/loading-screen/loading-screen.component.js");let loading_screen=loading_screen_component.A;loading_screen_component.A.__docgenInfo={description:"",methods:[],displayName:"LoadingScreen",props:{showLoadingSpinner:{defaultValue:{value:"true",computed:!1},description:"",type:{name:"bool"},required:!1},header:{description:"",type:{name:"element"},required:!1},loadingMessage:{description:"",type:{name:"union",value:[{name:"string"},{name:"element"}]},required:!1}}};var snap_authorship_header=__webpack_require__("./ui/components/app/snaps/snap-authorship-header/index.js"),snap_ui_renderer=__webpack_require__("./ui/components/app/snaps/snap-ui-renderer/index.js"),app=__webpack_require__("./shared/constants/app.ts"),time=__webpack_require__("./shared/constants/time.ts"),design_system=__webpack_require__("./ui/helpers/constants/design-system.ts"),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 ConfirmationFooter(param){var onSubmit=param.onSubmit,onCancel=param.onCancel,submitText=param.submitText,cancelText=param.cancelText,loadingText=param.loadingText,alerts=param.alerts,loading=param.loading,submitAlerts=param.submitAlerts,actionsStyle=param.actionsStyle,style=param.style,showActions=!!(onCancel||onSubmit);return react.createElement("div",{className:"confirmation-footer",style:style},alerts,submitAlerts,showActions&&react.createElement("div",{className:"confirmation-footer__actions",style:actionsStyle},onCancel?react.createElement(ui_button.A,{"data-testid":"confirmation-cancel-button",type:"secondary",onClick:onCancel},cancelText):null,onSubmit&&submitText?react.createElement(ui_button.A,{"data-testid":"confirmation-submit-button",disabled:!!loading,type:"primary",onClick:onSubmit,className:classnames_default()({centered:!onCancel})},loading?loadingText:submitText):null))}ConfirmationFooter.propTypes={alerts:prop_types_default().node,onCancel:prop_types_default().func,cancelText:prop_types_default().string,onSubmit:prop_types_default().func.isRequired,submitText:prop_types_default().string.isRequired,loadingText:prop_types_default().string,loading:prop_types_default().bool,submitAlerts:prop_types_default().node,style:prop_types_default().object,actionsStyle:prop_types_default().object},ConfirmationFooter.__docgenInfo={description:"",methods:[],displayName:"ConfirmationFooter",props:{alerts:{description:"",type:{name:"node"},required:!1},onCancel:{description:"",type:{name:"func"},required:!1},cancelText:{description:"",type:{name:"string"},required:!1},onSubmit:{description:"",type:{name:"func"},required:!0},submitText:{description:"",type:{name:"string"},required:!0},loadingText:{description:"",type:{name:"string"},required:!1},loading:{description:"",type:{name:"bool"},required:!1},submitAlerts:{description:"",type:{name:"node"},required:!1},style:{description:"",type:{name:"object"},required:!1},actionsStyle:{description:"",type:{name:"object"},required:!1}}};var templates=__webpack_require__("./ui/pages/confirmations/confirmation/templates/index.js");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_with_holes(arr){if(Array.isArray(arr))return arr}function _array_without_holes(arr){if(Array.isArray(arr))return _array_like_to_array(arr)}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){reject(error);return}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}function _async_to_generator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)})}}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 _iterable_to_array(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}function _iterable_to_array_limit(arr,i){var _s,_e,_i=null==arr?null:"undefined"!=typeof Symbol&&arr[Symbol.iterator]||arr["@@iterator"];if(null!=_i){var _arr=[],_n=!0,_d=!1;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{_n||null==_i.return||_i.return()}finally{if(_d)throw _e}}return _arr}}function _non_iterable_rest(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}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 ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){return source=null!=source?source:{},Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}),target}function _sliced_to_array(arr,i){return _array_with_holes(arr)||_iterable_to_array_limit(arr,i)||_unsupported_iterable_to_array(arr,i)||_non_iterable_rest()}function _to_consumable_array(arr){return _array_without_holes(arr)||_iterable_to_array(arr)||_unsupported_iterable_to_array(arr)||_non_iterable_spread()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}function _ts_generator(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=2&op[0]?y.return:op[0]?y.throw||((t=y.return)&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[2&op[0],t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(!(t=(t=_.trys).length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}}var alertStateReducer=(0,immer_esm.jM)(function(state,action){switch(action.type){case"dismiss":var _state_action_confirmationId;(null==state?void 0:null===(_state_action_confirmationId=state[action.confirmationId])||void 0===_state_action_confirmationId?void 0:_state_action_confirmationId[action.alertId])&&(state[action.confirmationId][action.alertId].dismissed=!0);break;case"set":state[action.confirmationId]||(state[action.confirmationId]={}),action.alerts.forEach(function(alert){state[action.confirmationId][alert.id]=_object_spread_props(_object_spread({},alert),{dismissed:!1})});break;default:throw Error("You must provide a type when dispatching an action for alertState")}});function useAlertState(pendingConfirmation){var _ref=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},unapprovedTxsCount=_ref.unapprovedTxsCount,useSafeChainsListValidation=_ref.useSafeChainsListValidation,matchedChain=_ref.matchedChain,providerError=_ref.providerError,_ref_preventAlertsForAddChainValidation=_ref.preventAlertsForAddChainValidation,preventAlertsForAddChainValidation=void 0!==_ref_preventAlertsForAddChainValidation&&_ref_preventAlertsForAddChainValidation,_useReducer=_sliced_to_array((0,react.useReducer)(alertStateReducer,{}),2),alertState=_useReducer[0],dispatch=_useReducer[1];return(0,react.useEffect)(function(){var isMounted=!0;return pendingConfirmation&&!preventAlertsForAddChainValidation&&(0,templates.OB)(pendingConfirmation,{unapprovedTxsCount:unapprovedTxsCount,useSafeChainsListValidation:useSafeChainsListValidation,matchedChain:matchedChain,providerError:providerError}).then(function(alerts){isMounted&&alerts.length>0&&dispatch({type:"set",confirmationId:pendingConfirmation.id,alerts:alerts})}),function(){isMounted=!1}},[pendingConfirmation,unapprovedTxsCount,useSafeChainsListValidation,matchedChain,providerError,preventAlertsForAddChainValidation]),[alertState,(0,react.useCallback)(function(alertId){dispatch({type:"dismiss",confirmationId:pendingConfirmation.id,alertId:alertId})},[pendingConfirmation])]}function useTemplateState(pendingConfirmation){var _useState=_sliced_to_array((0,react.useState)({}),2),templateState=_useState[0],setTemplateState=_useState[1];return(0,react.useEffect)(function(){var isMounted=!0;return pendingConfirmation&&(0,templates.i3)(pendingConfirmation).then(function(state){isMounted&&Object.values(state).length>0&&setTemplateState(function(prevState){return _object_spread_props(_object_spread({},prevState),_define_property({},pendingConfirmation.id,state))})}),function(){isMounted=!1}},[pendingConfirmation]),[templateState]}function ConfirmationPage(param){var _ref,_snapsMetadata_pendingConfirmation_origin,_param_redirectToHomeOnZeroConfirmations=param.redirectToHomeOnZeroConfirmations,redirectToHomeOnZeroConfirmations=void 0===_param_redirectToHomeOnZeroConfirmations||_param_redirectToHomeOnZeroConfirmations,t=(0,useI18nContext.P)(),trackEvent=(0,react.useContext)(contexts_metametrics.O2),dispatch=(0,es.wA)(),history=(0,react_router.W6)(),pendingConfirmations=(0,es.d4)(selectors.ZZd),unapprovedTxsCount=(0,es.d4)(selectors.GbT),approvalFlows=(0,es.d4)(selectors.j9f,lodash.isEqual),totalUnapprovedCount=(0,es.d4)(selectors.ooZ),useSafeChainsListValidation=(0,es.d4)(selectors.XVm),networkConfigurationsByChainId=(0,es.d4)(networks.hX),_useState=_sliced_to_array((0,react.useState)(null),2),approvalFlowLoadingText=_useState[0],setApprovalFlowLoadingText=_useState[1],id=(0,react_router.g)().id,pendingRoutedConfirmation=pendingConfirmations.findIndex(function(confirmation){return confirmation.id===id}),isRoutedConfirmation=id&&-1!==pendingRoutedConfirmation,_useState1=_sliced_to_array((0,react.useState)(isRoutedConfirmation?pendingRoutedConfirmation:0),2),currentPendingConfirmation=_useState1[0],setCurrentPendingConfirmation=_useState1[1],pendingConfirmation=pendingConfirmations[currentPendingConfirmation],_useState2=_sliced_to_array((0,react.useState)({}),2),matchedChain=_useState2[0],setMatchedChain=_useState2[1],_useState3=_sliced_to_array((0,react.useState)(!1),2),chainFetchComplete=_useState3[0],setChainFetchComplete=_useState3[1],preventAlertsForAddChainValidation=(null==pendingConfirmation?void 0:pendingConfirmation.type)===constants.s.AddEthereumChain&&!chainFetchComplete,_useState4=_sliced_to_array((0,react.useState)(null),2),currencySymbolWarning=_useState4[0],setCurrencySymbolWarning=_useState4[1],_useState5=_sliced_to_array((0,react.useState)(null),2),providerError=_useState5[0],setProviderError=_useState5[1],_useAlertState=_sliced_to_array(useAlertState(pendingConfirmation,{unapprovedTxsCount:unapprovedTxsCount,useSafeChainsListValidation:useSafeChainsListValidation,matchedChain:matchedChain,providerError:providerError,preventAlertsForAddChainValidation:preventAlertsForAddChainValidation}),2),alertState=_useAlertState[0],dismissAlert=_useAlertState[1],templateState=_sliced_to_array(useTemplateState(pendingConfirmation),1)[0],_useState6=_sliced_to_array((0,react.useState)(!1),2),showWarningModal=_useState6[0],setShowWarningModal=_useState6[1],_useState7=_sliced_to_array((0,react.useState)({}),2),inputStates=_useState7[0],setInputStates=_useState7[1],setInputState=function(key,value){setInputStates(function(currentState){return _object_spread_props(_object_spread({},currentState),_define_property({},key,value))})},_useState8=_sliced_to_array((0,react.useState)(!1),2),loading=_useState8[0],setLoading=_useState8[1],_useState9=_sliced_to_array((0,react.useState)(),2),loadingText=_useState9[0],setLoadingText=_useState9[1],_useState10=_sliced_to_array((0,react.useState)([]),2),submitAlerts=_useState10[0],setSubmitAlerts=_useState10[1],snapsMetadata=(0,es.d4)(selectors.JaC),hideSnapBranding=(0,es.d4)(function(state){return(0,selectors.qOS)(state,null==pendingConfirmation?void 0:pendingConfirmation.origin)}),name=null===(_snapsMetadata_pendingConfirmation_origin=snapsMetadata[null==pendingConfirmation?void 0:pendingConfirmation.origin])||void 0===_snapsMetadata_pendingConfirmation_origin?void 0:_snapsMetadata_pendingConfirmation_origin.name,SNAP_DIALOG_TYPE=Object.values(dialog.rW),SNAP_CUSTOM_UI_DIALOG=Object.values(dialog.rW);SNAP_DIALOG_TYPE.push.apply(SNAP_DIALOG_TYPE,_to_consumable_array(Object.values(app.ie)));var isSnapDialog=SNAP_DIALOG_TYPE.includes(null==pendingConfirmation?void 0:pendingConfirmation.type),isSnapCustomUIDialog=SNAP_CUSTOM_UI_DIALOG.includes(null==pendingConfirmation?void 0:pendingConfirmation.type),isSnapPrompt=(null==pendingConfirmation?void 0:pendingConfirmation.type)===constants.s.SnapDialogPrompt,isSnapDefaultDialog=(null==pendingConfirmation?void 0:pendingConfirmation.type)===dialog.rW.default,snapName=isSnapDialog&&name,INPUT_STATE_CONFIRMATIONS=[constants.s.SnapDialogPrompt],templatedValues=(0,react.useMemo)(function(){var _pendingConfirmation_requestData;return pendingConfirmation?(0,templates.L6)(_object_spread({snapName:isSnapDialog&&snapName},pendingConfirmation),t,dispatch,history,{matchedChain:matchedChain,currencySymbolWarning:currencySymbolWarning,existingNetworkConfiguration:null==networkConfigurationsByChainId?void 0:networkConfigurationsByChainId[null===(_pendingConfirmation_requestData=pendingConfirmation.requestData)||void 0===_pendingConfirmation_requestData?void 0:_pendingConfirmation_requestData.chainId]},{t:t,trackEvent:trackEvent}):{}},[pendingConfirmation,t,dispatch,history,matchedChain,currencySymbolWarning,trackEvent,isSnapDialog,snapName,networkConfigurationsByChainId]);if((0,react.useEffect)(function(){templatedValues.onLoad&&templatedValues.onLoad()},[templatedValues]),(0,react.useEffect)(function(){0===pendingConfirmations.length&&(0===approvalFlows.length||0!==totalUnapprovedCount)&&redirectToHomeOnZeroConfirmations?history.push(routes.Sg):pendingConfirmations.length&&pendingConfirmations.length<=currentPendingConfirmation&&setCurrentPendingConfirmation(pendingConfirmations.length-1)},[pendingConfirmations,approvalFlows,totalUnapprovedCount,history,currentPendingConfirmation,redirectToHomeOnZeroConfirmations]),(0,react.useEffect)(function(){var _childFlow_loadingText,childFlow=approvalFlows[approvalFlows.length-1];setApprovalFlowLoadingText(null!==(_childFlow_loadingText=null==childFlow?void 0:childFlow.loadingText)&&void 0!==_childFlow_loadingText?_childFlow_loadingText:null)},[approvalFlows]),(0,react.useEffect)(function(){function _fetchSafeChainsList(){return(_fetchSafeChainsList=_async_to_generator(function(_pendingConfirmation){var _matchedChain_nativeCurrency_symbol,_matchedChain_nativeCurrency,_pendingConfirmation_requestData_ticker,_matchedChain,_matchedChain_nativeCurrency1,error;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(_state.trys.push([0,3,,4]),!useSafeChainsListValidation)return[3,2];return[4,(0,fetch_with_cache.A)({url:network.Wn,allowStale:!0,cacheOptions:{cacheRefreshTime:time.d_},functionName:"getSafeChainsList"})];case 1:setMatchedChain(_matchedChain=_state.sent().find(function(chain){return chain.chainId===parseInt(_pendingConfirmation.requestData.chainId,16)})),setChainFetchComplete(!0),setProviderError(null),(null==_matchedChain?void 0:null===(_matchedChain_nativeCurrency=_matchedChain.nativeCurrency)||void 0===_matchedChain_nativeCurrency?void 0:null===(_matchedChain_nativeCurrency_symbol=_matchedChain_nativeCurrency.symbol)||void 0===_matchedChain_nativeCurrency_symbol?void 0:_matchedChain_nativeCurrency_symbol.toLowerCase())===(null===(_pendingConfirmation_requestData_ticker=_pendingConfirmation.requestData.ticker)||void 0===_pendingConfirmation_requestData_ticker?void 0:_pendingConfirmation_requestData_ticker.toLowerCase())?setCurrencySymbolWarning(null):setCurrencySymbolWarning(t("chainListReturnedDifferentTickerSymbol",[null==_matchedChain?void 0:null===(_matchedChain_nativeCurrency1=_matchedChain.nativeCurrency)||void 0===_matchedChain_nativeCurrency1?void 0:_matchedChain_nativeCurrency1.symbol])),_state.label=2;case 2:return[3,4];case 3:return error=_state.sent(),loglevel_default().warn("Failed to fetch the chainList from chainid.network",error),setProviderError(error),setMatchedChain(null),setCurrencySymbolWarning(null),setChainFetchComplete(!0),[3,4];case 4:return[2]}})})).apply(this,arguments)}(null==pendingConfirmation?void 0:pendingConfirmation.type)===constants.s.AddEthereumChain&&function fetchSafeChainsList(_pendingConfirmation){return _fetchSafeChainsList.apply(this,arguments)}(pendingConfirmation)},[pendingConfirmation,t,useSafeChainsListValidation,setChainFetchComplete]),!pendingConfirmation)return approvalFlows.length>0?react.createElement(loading_screen,{loadingMessage:approvalFlowLoadingText}):null;var getInputState=function(type){var _inputStates_type;return null!==(_inputStates_type=inputStates[type])&&void 0!==_inputStates_type?_inputStates_type:""},handleSubmitResult=function(submitResult){(null==submitResult?void 0:submitResult.length)>0?(setLoadingText(templatedValues.submitText),setSubmitAlerts(submitResult),setLoading(!0)):setLoading(!1)},handleSubmit=(_ref=_async_to_generator(function(){var _pendingConfirmation_requestData_fromNetworkConfiguration,_pendingConfirmation_requestData,_pendingConfirmation_requestData_toNetworkConfiguration,_pendingConfirmation_requestData1,_templateState_pendingConfirmation_id,inputState;return _ts_generator(this,function(_state){switch(_state.label){case 0:if(setLoading(!0),(null==pendingConfirmation?void 0:null===(_pendingConfirmation_requestData=pendingConfirmation.requestData)||void 0===_pendingConfirmation_requestData?void 0:null===(_pendingConfirmation_requestData_fromNetworkConfiguration=_pendingConfirmation_requestData.fromNetworkConfiguration)||void 0===_pendingConfirmation_requestData_fromNetworkConfiguration?void 0:_pendingConfirmation_requestData_fromNetworkConfiguration.chainId)&&(null==pendingConfirmation?void 0:null===(_pendingConfirmation_requestData1=pendingConfirmation.requestData)||void 0===_pendingConfirmation_requestData1?void 0:null===(_pendingConfirmation_requestData_toNetworkConfiguration=_pendingConfirmation_requestData1.toNetworkConfiguration)||void 0===_pendingConfirmation_requestData_toNetworkConfiguration?void 0:_pendingConfirmation_requestData_toNetworkConfiguration.chainId)&&trackEvent({category:metametrics.FZ.Network,event:metametrics.gP.NavNetworkSwitched,properties:{location:"Switch Modal",from_network:pendingConfirmation.requestData.fromNetworkConfiguration.chainId,to_network:pendingConfirmation.requestData.toNetworkConfiguration.chainId,referrer:{url:window.location.origin}}}),!(null===(_templateState_pendingConfirmation_id=templateState[pendingConfirmation.id])||void 0===_templateState_pendingConfirmation_id?void 0:_templateState_pendingConfirmation_id.useWarningModal))return[3,1];return setShowWarningModal(!0),[3,3];case 1:var type;return type=pendingConfirmation.type,inputState=INPUT_STATE_CONFIRMATIONS.includes(type)?getInputState(pendingConfirmation.type):null,[4,templatedValues.onSubmit(inputState)];case 2:handleSubmitResult(_state.sent()),_state.label=3;case 3:return[2]}})}),function handleSubmit(){return _ref.apply(this,arguments)}),handleSnapDialogCancel=templatedValues.onCancel||((null==pendingConfirmation?void 0:pendingConfirmation.type)===constants.s.SnapDialogAlert?handleSubmit:null),contentMargin=0;return pendingConfirmations.length>1&&(contentMargin+=32),isSnapCustomUIDialog&&!hideSnapBranding&&(contentMargin+=64),react.createElement("div",{className:"confirmation-page"},pendingConfirmations.length>1&&react.createElement(component_library.az,{className:"confirmation-page__navigation",style:{position:"fixed",zIndex:1},width:design_system.Zf.Screen},react.createElement("p",null,t("xOfYPending",[currentPendingConfirmation+1,pendingConfirmations.length])),currentPendingConfirmation>0&&react.createElement("button",{className:"confirmation-page__navigation-button",onClick:function(){return setCurrentPendingConfirmation(currentPendingConfirmation-1)}},react.createElement(component_library.In,{name:component_library.$M.ArrowLeft})),react.createElement("button",{className:"confirmation-page__navigation-button",disabled:currentPendingConfirmation+1===pendingConfirmations.length,onClick:function(){return setCurrentPendingConfirmation(currentPendingConfirmation+1)}},react.createElement(component_library.In,{name:component_library.$M.ArrowRight}))),isSnapCustomUIDialog&&!hideSnapBranding&&react.createElement(component_library.az,{width:design_system.Zf.Screen,style:{position:"fixed",zIndex:1,marginTop:pendingConfirmations.length>1?"32px":"initial"}},react.createElement(snap_authorship_header.A,{snapId:null==pendingConfirmation?void 0:pendingConfirmation.origin,onCancel:handleSnapDialogCancel})),react.createElement(component_library.az,{className:"confirmation-page__content",padding:isSnapCustomUIDialog?0:4,style:{marginTop:"".concat(contentMargin,"px"),overflowY:"auto"}},isSnapCustomUIDialog?react.createElement(snap_ui_renderer.a,{snapId:null==pendingConfirmation?void 0:pendingConfirmation.origin,interfaceId:null==pendingConfirmation?void 0:pendingConfirmation.requestData.id,isPrompt:isSnapPrompt,inputValue:isSnapPrompt&&inputStates[null==pendingConfirmation?void 0:pendingConfirmation.type],onInputChange:isSnapPrompt&&function(event){var _event_target_value;return setInputState(null==pendingConfirmation?void 0:pendingConfirmation.type,null!==(_event_target_value=event.target.value)&&void 0!==_event_target_value?_event_target_value:"")},placeholder:isSnapPrompt&&(null==pendingConfirmation?void 0:pendingConfirmation.requestData.placeholder),useDelineator:!1,onCancel:handleSnapDialogCancel,useFooter:isSnapDefaultDialog,contentBackgroundColor:design_system.i0.backgroundAlternative}):react.createElement(metamask_template_renderer.A,{sections:templatedValues.content}),showWarningModal&&react.createElement(confirmation_warning_modal.A,{onSubmit:_async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,templatedValues.onSubmit()];case 1:return[4,handleSubmitResult(_state.sent())];case 2:return _state.sent(),setShowWarningModal(!1),[2]}})}),onCancel:templatedValues.onCancel})),!isSnapDefaultDialog&&react.createElement(ConfirmationFooter,{alerts:alertState[pendingConfirmation.id]&&Object.values(alertState[pendingConfirmation.id]).filter(function(alert){return!1===alert.dismissed}).map(function(alert,idx,filtered){return react.createElement(callout.A,{key:alert.id,severity:alert.severity,dismiss:function(){return dismissAlert(alert.id)},isFirst:0===idx,isLast:idx===filtered.length-1,isMultiple:filtered.length>1},react.createElement(metamask_template_renderer.A,{sections:alert.content}))}),style:isSnapDialog?{boxShadow:"var(--shadow-size-lg) var(--color-shadow-default)"}:{},actionsStyle:isSnapDialog?{borderTop:0}:{},onSubmit:!templatedValues.hideSubmitButton&&handleSubmit,onCancel:templatedValues.onCancel,submitText:templatedValues.submitText,cancelText:templatedValues.cancelText,loadingText:loadingText||templatedValues.loadingText,loading:loading,submitAlerts:submitAlerts.map(function(alert,idx){return react.createElement(callout.A,{key:alert.id,severity:alert.severity,isFirst:0===idx},react.createElement(metamask_template_renderer.A,{sections:alert.content}))})}))}ConfirmationPage.propTypes={redirectToHomeOnZeroConfirmations:prop_types_default().bool},ConfirmationPage.__docgenInfo={description:"",methods:[],displayName:"ConfirmationPage",props:{redirectToHomeOnZeroConfirmations:{defaultValue:{value:"true",computed:!1},description:"",type:{name:"bool"},required:!1}}}},"./ui/pages/confirmations/confirmation/stories/util.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{v:()=>PendingApproval});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_redux__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react-redux/es/index.js"),_metamask_network_controller__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/@metamask/network-controller/dist/chunk-2QJYHWIP.mjs"),_store_store__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/store/store.ts"),_storybook_test_data__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./.storybook/test-data.js"),_components_component_library__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/components/component-library/index.ts"),_test_stub_networks__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./test/stub/networks.ts");function _array_like_to_array(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _array_without_holes(arr){if(Array.isArray(arr))return _array_like_to_array(arr)}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 _iterable_to_array(iter){if("undefined"!=typeof Symbol&&null!=iter[Symbol.iterator]||null!=iter["@@iterator"])return Array.from(iter)}function _non_iterable_spread(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}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 ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys.push.apply(keys,symbols)}return keys}function _object_spread_props(target,source){return source=null!=source?source:{},Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))}),target}function _to_consumable_array(arr){return _array_without_holes(arr)||_iterable_to_array(arr)||_unsupported_iterable_to_array(arr)||_non_iterable_spread()}function _unsupported_iterable_to_array(o,minLen){if(o){if("string"==typeof o)return _array_like_to_array(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if("Object"===n&&o.constructor&&(n=o.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(o,minLen)}}var STORE_MOCK=_object_spread_props(_object_spread({},_storybook_test_data__WEBPACK_IMPORTED_MODULE_3__.A),{metamask:_object_spread_props(_object_spread({approvalFlows:[],currentCurrency:"USD",keyrings:[{accounts:["0x71C7656EC7ab88b098defB751B7401B5f6d8976F"],type:"TestKeyring"}].concat(_to_consumable_array(_storybook_test_data__WEBPACK_IMPORTED_MODULE_3__.A.metamask.keyrings)),networksMetadata:{testNetworkClientId:{status:_metamask_network_controller__WEBPACK_IMPORTED_MODULE_6__.p.Available}}},(0,_test_stub_networks__WEBPACK_IMPORTED_MODULE_5__.g)({id:"testNetworkClientId",rpcUrl:"https://testrpc.com",chainId:"0x1",nickname:"mainnet",name:"mainnet",blockExplorerUrl:"https://etherscan.io",metadata:{EIPS:{1559:!0},status:_metamask_network_controller__WEBPACK_IMPORTED_MODULE_6__.p.Available}})),{pendingApprovals:{testId:{id:"testId",origin:"npm:@test/test-snap"}},selectedNetworkClientId:"testNetworkClientId",subjectMetadata:{"npm:@test/test-snap":{name:"Test Snap",version:"1.0.0"}},tokenList:{},accounts:_storybook_test_data__WEBPACK_IMPORTED_MODULE_3__.A.metamask.accounts,internalAccounts:_storybook_test_data__WEBPACK_IMPORTED_MODULE_3__.A.metamask.internalAccounts,accountsByChainId:_storybook_test_data__WEBPACK_IMPORTED_MODULE_3__.A.metamask.accountsByChainId,snaps:{"npm:@test/test-snap":{id:"npm:@test/test-snap",manifest:{description:"Test Snap"}}}})});function PendingApproval(param){var children=param.children,requestData=param.requestData,type=param.type,mockState=_object_spread({},STORE_MOCK),pendingApproval=mockState.metamask.pendingApprovals.testId;return pendingApproval.type=type,pendingApproval.requestData=requestData,react__WEBPACK_IMPORTED_MODULE_0__.createElement(react_redux__WEBPACK_IMPORTED_MODULE_1__.Kq,{store:(0,_store_store__WEBPACK_IMPORTED_MODULE_2__.A)(mockState)},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_4__.az,{style:{height:"592px",width:"360px",border:"1px solid lightgrey",margin:"0 auto"}},children))}PendingApproval.__docgenInfo={description:"",methods:[],displayName:"PendingApproval"}}}]);