-
Notifications
You must be signed in to change notification settings - Fork 31
/
22511.5738a825.iframe.bundle.js
1 lines (1 loc) · 52.5 KB
/
22511.5738a825.iframe.bundle.js
1
"use strict";(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[22511],{"./ui/pages/confirmations/components/confirm/info/shared/constants.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{I:()=>TOKEN_VALUE_UNLIMITED_THRESHOLD,L:()=>HEX_ZERO});var HEX_ZERO="0x0",TOKEN_VALUE_UNLIMITED_THRESHOLD=1e15},"./ui/pages/confirmations/components/confirm/info/shared/static-simulation/static-simulation.tsx":(__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"),_components_component_library__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/components/component-library/index.ts"),_components_app_confirm_info_row__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/components/app/confirm/info/row/index.ts"),_components_app_confirm_info_row_section__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/components/app/confirm/info/row/section.tsx"),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_components_ui_icon_preloader__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/components/ui/icon/preloader/index.js"),CollapsedSectionStyles={display:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.nl.Flex,alignItems:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.k2.center,justifyContent:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.A9.spaceBetween};let __WEBPACK_DEFAULT_EXPORT__=function(param){var title=param.title,titleTooltip=param.titleTooltip,description=param.description,simulationElements=param.simulationElements,isLoading=param.isLoading,_param_isCollapsed=param.isCollapsed;return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_app_confirm_info_row_section__WEBPACK_IMPORTED_MODULE_3__.C,{"data-testid":"confirmation__simulation_section",style:void 0!==_param_isCollapsed&&_param_isCollapsed?CollapsedSectionStyles:{}},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_app_confirm_info_row__WEBPACK_IMPORTED_MODULE_2__.z$,{label:title,tooltip:titleTooltip},description&&react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_app_confirm_info_row__WEBPACK_IMPORTED_MODULE_2__.UK,{text:description})),isLoading?react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_1__.az,{display:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.nl.Flex,justifyContent:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_4__.A9.center},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_ui_icon_preloader__WEBPACK_IMPORTED_MODULE_5__.A,{size:20})):simulationElements)};try{staticsimulation.displayName="staticsimulation",staticsimulation.__docgenInfo={description:"",displayName:"staticsimulation",props:{title:{defaultValue:null,description:"",name:"title",required:!0,type:{name:"string"}},titleTooltip:{defaultValue:null,description:"",name:"titleTooltip",required:!0,type:{name:"string"}},description:{defaultValue:null,description:"",name:"description",required:!1,type:{name:"string"}},simulationElements:{defaultValue:null,description:"",name:"simulationElements",required:!0,type:{name:"ReactNode"}},isLoading:{defaultValue:null,description:"",name:"isLoading",required:!1,type:{name:"boolean"}},isCollapsed:{defaultValue:{value:"false"},description:"",name:"isCollapsed",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/confirm/info/shared/static-simulation/static-simulation.tsx#staticsimulation"]={docgenInfo:staticsimulation.__docgenInfo,name:"staticsimulation",path:"ui/pages/confirmations/components/confirm/info/shared/static-simulation/static-simulation.tsx#staticsimulation"})}catch(__react_docgen_typescript_loader_error){}},"./ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>typed_sign});var DecodingResponseType,EthMethod,DecodingDataChangeType,SignatureRequestStatus,SignatureRequestType,react=__webpack_require__("./node_modules/react/index.js"),dist_browser=__webpack_require__("./node_modules/ethereumjs-util/dist.browser/index.js"),alert_row=__webpack_require__("./ui/components/app/confirm/info/row/alert-row/alert-row.tsx"),transaction_utils=__webpack_require__("./shared/modules/transaction.utils.ts"),constants=__webpack_require__("./ui/components/app/confirm/info/row/constants.ts"),row=__webpack_require__("./ui/components/app/confirm/info/row/index.ts"),section=__webpack_require__("./ui/components/app/confirm/info/row/section.tsx"),useI18nContext=__webpack_require__("./ui/hooks/useI18nContext.js"),useGetTokenStandardAndDetails=__webpack_require__("./ui/pages/confirmations/hooks/useGetTokenStandardAndDetails.ts"),utils=__webpack_require__("./ui/pages/confirmations/utils/index.ts"),context_confirm=__webpack_require__("./ui/pages/confirmations/context/confirm/index.tsx"),es=__webpack_require__("./node_modules/react-redux/es/index.js"),app=__webpack_require__("./shared/constants/app.ts"),preferences=__webpack_require__("./ui/pages/confirmations/selectors/preferences.ts"),NON_PERMIT_SUPPORTED_TYPES_SIGNS=[{domainName:"Seaport",primaryTypeList:["BulkOrder"],versionList:["1.4","1.5","1.6"]},{domainName:"Seaport",primaryTypeList:["OrderComponents"]}],isNonPermitSupportedByDecodingAPI=function(signatureRequest){var _signatureRequest_msgParams,data=null===(_signatureRequest_msgParams=signatureRequest.msgParams)||void 0===_signatureRequest_msgParams?void 0:_signatureRequest_msgParams.data;if(!data)return!1;var _parseTypedDataMessage=(0,transaction_utils.z2)(data),_parseTypedDataMessage_domain=_parseTypedDataMessage.domain,name=_parseTypedDataMessage_domain.name,version=_parseTypedDataMessage_domain.version,primaryType=_parseTypedDataMessage.primaryType;return NON_PERMIT_SUPPORTED_TYPES_SIGNS.some(function(param){var domainName=param.domainName,primaryTypeList=param.primaryTypeList,versionList=param.versionList;return name===domainName&&primaryTypeList.includes(primaryType)&&(!versionList||versionList.includes(version))})};function useTypesSignSimulationEnabledInfo(){var _currentConfirmation_msgParams,currentConfirmation=(0,context_confirm.TW)().currentConfirmation,useTransactionSimulations=(0,es.d4)(preferences.C),signatureMethod=null==currentConfirmation?void 0:null===(_currentConfirmation_msgParams=currentConfirmation.msgParams)||void 0===_currentConfirmation_msgParams?void 0:_currentConfirmation_msgParams.signatureMethod,isTypedSignV3V4=signatureMethod===app.$z.ETH_SIGN_TYPED_DATA_V4||signatureMethod===app.$z.ETH_SIGN_TYPED_DATA_V3,isPermit=(0,utils.VO)(currentConfirmation),nonPermitSupportedByDecodingAPI=isTypedSignV3V4&&isNonPermitSupportedByDecodingAPI(currentConfirmation);if(currentConfirmation)return useTransactionSimulations&&isTypedSignV3V4&&(isPermit||nonPermitSupportedByDecodingAPI)}var typedSignData=__webpack_require__("./ui/pages/confirmations/components/confirm/row/typed-sign-data/typedSignData.tsx"),snaps=__webpack_require__("./ui/helpers/utils/snaps.ts"),sign_in_with_row=__webpack_require__("./ui/pages/confirmations/components/confirm/info/shared/sign-in-with-row/sign-in-with-row.tsx"),useSignatureEventFragment=__webpack_require__("./ui/pages/confirmations/hooks/useSignatureEventFragment.ts");function useDecodedSignatureMetrics(supportedByDecodingAPI){var _decodingData_error,_decodingData_stateChanges,_decodingData_error_type,updateSignatureEventFragment=(0,useSignatureEventFragment.U)().updateSignatureEventFragment,currentConfirmation=(0,context_confirm.TW)().currentConfirmation,decodingLoading=currentConfirmation.decodingLoading,decodingData=currentConfirmation.decodingData,decodingChangeTypes=(null!==(_decodingData_stateChanges=null==decodingData?void 0:decodingData.stateChanges)&&void 0!==_decodingData_stateChanges?_decodingData_stateChanges:[]).map(function(change){return change.changeType}),decodingResponse=null!==(_decodingData_error_type=null==decodingData?void 0:null===(_decodingData_error=decodingData.error)||void 0===_decodingData_error?void 0:_decodingData_error.type)&&void 0!==_decodingData_error_type?_decodingData_error_type:decodingChangeTypes.length?"CHANGE":"NO_CHANGE";(0,react.useEffect)(function(){!decodingLoading&&supportedByDecodingAPI&&updateSignatureEventFragment({properties:{decoding_response:decodingResponse,decoding_change_types:decodingChangeTypes}})},[decodingResponse,decodingLoading,decodingChangeTypes,updateSignatureEventFragment])}!function(DecodingResponseType){DecodingResponseType.Change="CHANGE",DecodingResponseType.NoChange="NO_CHANGE"}(DecodingResponseType||(DecodingResponseType={})),function(EthMethod){EthMethod.PersonalSign="personal_sign",EthMethod.SignTransaction="eth_signTransaction",EthMethod.SignTypedDataV1="eth_signTypedData_v1",EthMethod.SignTypedDataV3="eth_signTypedData_v3",EthMethod.SignTypedDataV4="eth_signTypedData_v4"}(EthMethod||(EthMethod={})),function(DecodingDataChangeType){DecodingDataChangeType.Receive="RECEIVE",DecodingDataChangeType.Transfer="TRANSFER",DecodingDataChangeType.Approve="APPROVE",DecodingDataChangeType.Revoke="REVOKE_APPROVE",DecodingDataChangeType.Bidding="BIDDING",DecodingDataChangeType.Listing="LISTING"}(DecodingDataChangeType||(DecodingDataChangeType={})),function(SignatureRequestStatus){SignatureRequestStatus.Unapproved="unapproved",SignatureRequestStatus.Approved="approved",SignatureRequestStatus.Rejected="rejected",SignatureRequestStatus.InProgress="inProgress",SignatureRequestStatus.Signed="signed",SignatureRequestStatus.Errored="errored"}(SignatureRequestStatus||(SignatureRequestStatus={})),function(SignatureRequestType){SignatureRequestType.PersonalSign="personal_sign",SignatureRequestType.TypedSign="eth_signTypedData"}(SignatureRequestType||(SignatureRequestType={}));var transaction=__webpack_require__("./shared/constants/transaction.ts"),component_library=__webpack_require__("./ui/components/component-library/index.ts"),static_simulation=__webpack_require__("./ui/pages/confirmations/components/confirm/info/shared/static-simulation/static-simulation.tsx"),chunk_6W3DEAGA=__webpack_require__("./node_modules/@metamask/name-controller/dist/chunk-6W3DEAGA.mjs"),esm_exports=__webpack_require__("./node_modules/@sentry/core/build/esm/exports.js"),metametrics=__webpack_require__("./shared/constants/metametrics.ts"),transactions_controller_utils=__webpack_require__("./shared/lib/transactions-controller-utils.js"),useTokenExchangeRate=__webpack_require__("./ui/components/app/currency-input/hooks/useTokenExchangeRate.tsx"),name_name=__webpack_require__("./ui/components/app/name/name.tsx"),tooltip=__webpack_require__("./ui/components/ui/tooltip/index.js"),design_system=__webpack_require__("./ui/helpers/constants/design-system.ts"),util=__webpack_require__("./ui/helpers/utils/util.js"),contexts_metametrics=__webpack_require__("./ui/contexts/metametrics.js"),token=__webpack_require__("./ui/pages/confirmations/utils/token.ts");let hooks_useTrackERC20WithoutDecimalInformation=function(chainId,tokenAddress,tokenDetails){var metricLocation=arguments.length>3&&void 0!==arguments[3]?arguments[3]:metametrics.If.SignatureConfirmation,trackEvent=(0,react.useContext)(contexts_metametrics.O2);(0,react.useEffect)(function(){if(void 0!==chainId&&void 0!==tokenDetails){var _ref=tokenDetails||{},decimals=_ref.decimals;_ref.standard===transaction.ph.ERC20&&void 0===(0,token.a6)(decimals)&&trackEvent({event:metametrics.gP.SimulationIncompleteAssetDisplayed,category:metametrics.FZ.Confirmations,properties:{token_decimals_available:"not_available",asset_address:tokenAddress,asset_type:transaction.ph.ERC20,chain_id:chainId,location:metricLocation,ui_customizations:[metametrics.ME.RedesignedConfirmation]}})}},[tokenDetails,chainId,tokenAddress,trackEvent])};var fiat_display=__webpack_require__("./ui/pages/confirmations/components/simulation-details/fiat-display.tsx"),formatAmount=__webpack_require__("./ui/pages/confirmations/components/simulation-details/formatAmount.ts"),shared_constants=__webpack_require__("./ui/pages/confirmations/components/confirm/info/shared/constants.ts"),info_utils=__webpack_require__("./ui/pages/confirmations/components/confirm/info/utils.ts");let value_display=function(param){var chainId=param.chainId,primaryType=param.primaryType,tokenContract=param.tokenContract,tokenId=param.tokenId,value=param.value,credit=param.credit,debit=param.debit,canDisplayValueAsUnlimited=param.canDisplayValueAsUnlimited,t=(0,useI18nContext.P)(),exchangeRate=(0,useTokenExchangeRate.A)(tokenContract),tokenDetails=(0,useGetTokenStandardAndDetails.r)(tokenContract);hooks_useTrackERC20WithoutDecimalInformation(chainId,tokenContract,tokenDetails,metametrics.If.SignatureConfirmation);var tokenDecimals=tokenDetails.decimalsNumber,fiatValue=(0,react.useMemo)(function(){if(exchangeRate&&value&&!tokenId){var tokenAmount=(0,transactions_controller_utils.dU)(value,tokenDecimals);return exchangeRate.times(tokenAmount).toNumber()}},[exchangeRate,tokenDecimals,value]),_useMemo=(0,react.useMemo)(function(){if(!value||tokenId)return{tokenValue:null,tokenValueMaxPrecision:null,shouldShowUnlimitedValue:!1};var tokenAmount=(0,transactions_controller_utils.dU)(value,tokenDecimals);return{tokenValue:(0,formatAmount.e)("en-US",tokenAmount),tokenValueMaxPrecision:(0,formatAmount.o)("en-US",tokenAmount),shouldShowUnlimitedValue:canDisplayValueAsUnlimited&&Number(value)>shared_constants.I}},[tokenDecimals,value]),tokenValue=_useMemo.tokenValue,tokenValueMaxPrecision=_useMemo.tokenValueMaxPrecision,shouldShowUnlimitedValue=_useMemo.shouldShowUnlimitedValue;if(!tokenContract)return(0,esm_exports.Cp)(Error("PermitSimulationValueDisplay: Token contract address is missing where primaryType === ".concat(primaryType))),null;var _getAmountColors=(0,info_utils.nc)(credit,debit),color=_getAmountColors.color,backgroundColor=_getAmountColors.backgroundColor;return react.createElement(component_library.az,{marginLeft:"auto",style:{maxWidth:"100%"}},react.createElement(component_library.az,{display:design_system.nl.Flex,justifyContent:design_system.A9.flexEnd},react.createElement(component_library.az,{display:design_system.nl.Inline,marginInlineEnd:1,minWidth:design_system.Zf.Zero},react.createElement(tooltip.A,{position:"bottom",title:tokenValueMaxPrecision,wrapperStyle:{minWidth:0},interactive:!0},react.createElement(component_library.EY,{"data-testid":"simulation-token-value",backgroundColor:backgroundColor,borderRadius:design_system.Z6.XL,color:color,paddingInline:2,style:{paddingTop:"1px",paddingBottom:"1px"},textAlign:design_system.nO.Center},credit&&"+ ",debit&&"- ",shouldShowUnlimitedValue?t("unlimited"):null!==tokenValue&&(0,util.l1)(tokenValue||"",{truncatedCharLimit:15,truncatedStartChars:15,truncatedEndChars:0,skipCharacterInEnd:!0}),tokenId&&"#".concat(tokenId)))),react.createElement(name_name.A,{value:tokenContract,type:chunk_6W3DEAGA.k.ETHEREUM_ADDRESS,variation:chainId,preferContractSymbol:!0})),react.createElement(component_library.az,null,void 0!==fiatValue&&react.createElement(fiat_display.m8,{fiatAmount:fiatValue,shorten:!0})))};try{valuedisplay.displayName="valuedisplay",valuedisplay.__docgenInfo={description:"",displayName:"valuedisplay",props:{chainId:{defaultValue:null,description:"ID of the associated chain.",name:"chainId",required:!0,type:{name:"`0x${string}`"}},primaryType:{defaultValue:null,description:"The primaryType of the typed sign message",name:"primaryType",required:!1,type:{name:"string"}},tokenContract:{defaultValue:null,description:"The ethereum token contract address. It is expected to be in hex format.\nWe currently accept strings since we have a patch that accepts a custom string\n{@see .yarn/patches/@metamask-eth-json-rpc-middleware-npm-14.0.1-b6c2ccbe8c.patch}",name:"tokenContract",required:!0,type:{name:"string"}},value:{defaultValue:null,description:"The token amount",name:"value",required:!1,type:{name:"string | number"}},tokenId:{defaultValue:null,description:"The tokenId for NFT",name:"tokenId",required:!1,type:{name:"string"}},credit:{defaultValue:null,description:"True if value is being credited to wallet",name:"credit",required:!1,type:{name:"boolean"}},debit:{defaultValue:null,description:"True if value is being debited to wallet",name:"debit",required:!1,type:{name:"boolean"}},canDisplayValueAsUnlimited:{defaultValue:null,description:'Whether a large amount can be substituted by "Unlimited"',name:"canDisplayValueAsUnlimited",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign-v4-simulation/value-display/value-display.tsx#valuedisplay"]={docgenInfo:valuedisplay.__docgenInfo,name:"valuedisplay",path:"ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign-v4-simulation/value-display/value-display.tsx#valuedisplay"})}catch(__react_docgen_typescript_loader_error){}var bignumber=__webpack_require__("./node_modules/bignumber.js/bignumber.js"),selectors=__webpack_require__("./ui/selectors/index.js"),asset_pill=__webpack_require__("./ui/pages/confirmations/components/simulation-details/asset-pill.tsx");let native_value_display=function(param){var chainId=param.chainId,value=param.value,credit=param.credit,debit=param.debit,conversionRate=(0,es.d4)(function(state){return(0,selectors._po)(state,chainId)}),_useMemo=(0,react.useMemo)(function(){if(!value)return{tokenValue:null,tokenValueMaxPrecision:null};var tokenAmount=(0,transactions_controller_utils.dU)(value,18);return{fiatValue:conversionRate?new bignumber.BigNumber(tokenAmount).times(String(conversionRate)).toNumber():void 0,tokenValue:(0,formatAmount.e)("en-US",tokenAmount),tokenValueMaxPrecision:(0,formatAmount.o)("en-US",tokenAmount)}},[conversionRate,value]),fiatValue=_useMemo.fiatValue,tokenValue=_useMemo.tokenValue,tokenValueMaxPrecision=_useMemo.tokenValueMaxPrecision,_getAmountColors=(0,info_utils.nc)(credit,debit),color=_getAmountColors.color,backgroundColor=_getAmountColors.backgroundColor;return react.createElement(component_library.az,{style:{marginLeft:"auto",maxWidth:"100%"}},react.createElement(component_library.az,{display:design_system.nl.Flex,justifyContent:design_system.A9.flexEnd},react.createElement(component_library.az,{display:design_system.nl.Inline,marginInlineEnd:1,minWidth:design_system.Zf.Zero},react.createElement(tooltip.A,{position:"bottom",title:tokenValueMaxPrecision,wrapperStyle:{minWidth:0},interactive:!0},react.createElement(component_library.EY,{"data-testid":"simulation-native-value-display",backgroundColor:backgroundColor,borderRadius:design_system.Z6.XL,color:color,paddingInline:2,style:{paddingTop:"1px",paddingBottom:"1px"},textAlign:design_system.nO.Center},credit&&"+ ",debit&&"- ",null!==tokenValue&&(0,util.l1)(tokenValue||"",{truncatedCharLimit:15,truncatedStartChars:15,truncatedEndChars:0,skipCharacterInEnd:!0})))),react.createElement(asset_pill.a,{asset:{chainId:chainId,standard:transaction.ph.none}})),react.createElement(component_library.az,null,void 0!==fiatValue&&react.createElement(fiat_display.m8,{fiatAmount:fiatValue,shorten:!0})))};try{nativevaluedisplay.displayName="nativevaluedisplay",nativevaluedisplay.__docgenInfo={description:"",displayName:"nativevaluedisplay",props:{chainId:{defaultValue:null,description:"ID of the associated chain.",name:"chainId",required:!0,type:{name:"`0x${string}`"}},value:{defaultValue:null,description:"The token amount",name:"value",required:!0,type:{name:"string | number"}},credit:{defaultValue:null,description:"True if value is being credited to wallet",name:"credit",required:!1,type:{name:"boolean"}},debit:{defaultValue:null,description:"True if value is being debited to wallet",name:"debit",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign-v4-simulation/native-value-display/native-value-display.tsx#nativevaluedisplay"]={docgenInfo:nativevaluedisplay.__docgenInfo,name:"nativevaluedisplay",path:"ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign-v4-simulation/native-value-display/native-value-display.tsx#nativevaluedisplay"})}catch(__react_docgen_typescript_loader_error){}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 _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 _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)}}var getStateChangeToolip=function(stateChangeList,stateChange,t){if(stateChange.changeType===DecodingDataChangeType.Receive){if(null==stateChangeList?void 0:stateChangeList.some(function(change){return change.changeType===DecodingDataChangeType.Listing&&change.assetType===transaction.ph.ERC721}))return t("signature_decoding_list_nft_tooltip");if(stateChange.assetType===transaction.ph.ERC721&&(null==stateChangeList?void 0:stateChangeList.some(function(change){return change.changeType===DecodingDataChangeType.Bidding})))return t("signature_decoding_bid_nft_tooltip")}},getStateChangeLabelMap=function(t,changeType){var _obj;return(_define_property(_obj={},DecodingDataChangeType.Transfer,t("permitSimulationChange_transfer")),_define_property(_obj,DecodingDataChangeType.Receive,t("permitSimulationChange_receive")),_define_property(_obj,DecodingDataChangeType.Approve,t("permitSimulationChange_approve")),_define_property(_obj,DecodingDataChangeType.Revoke,t("permitSimulationChange_revoke")),_define_property(_obj,DecodingDataChangeType.Bidding,t("permitSimulationChange_bidding")),_define_property(_obj,DecodingDataChangeType.Listing,t("permitSimulationChange_listing")),_obj)[changeType]},StateChangeRow=function(param){var stateChangeList=param.stateChangeList,stateChange=param.stateChange,chainId=param.chainId,shouldDisplayLabel=param.shouldDisplayLabel,t=(0,useI18nContext.P)(),assetType=stateChange.assetType,changeType=stateChange.changeType,amount=stateChange.amount,contractAddress=stateChange.contractAddress,tokenID=stateChange.tokenID,tooltip=getStateChangeToolip(stateChangeList,stateChange,t),canDisplayValueAsUnlimited=assetType===transaction.ph.ERC20&&(changeType===DecodingDataChangeType.Approve||changeType===DecodingDataChangeType.Revoke);return react.createElement(row.z$,{label:shouldDisplayLabel?getStateChangeLabelMap(t,changeType):"",tooltip:tooltip},(assetType===transaction.ph.ERC20||assetType===transaction.ph.ERC721||assetType===transaction.ph.ERC1155)&&react.createElement(value_display,{tokenContract:contractAddress,value:amount,chainId:chainId,tokenId:tokenID,credit:changeType===DecodingDataChangeType.Receive,debit:changeType===DecodingDataChangeType.Transfer,canDisplayValueAsUnlimited:canDisplayValueAsUnlimited}),"NATIVE"===assetType&&react.createElement(native_value_display,{value:amount,chainId:chainId,credit:changeType===DecodingDataChangeType.Receive,debit:changeType===DecodingDataChangeType.Transfer}))};let decoded_simulation=function(){var t=(0,useI18nContext.P)(),currentConfirmation=(0,context_confirm.TW)().currentConfirmation,chainId=currentConfirmation.chainId,decodingLoading=currentConfirmation.decodingLoading,decodingData=currentConfirmation.decodingData,stateChangeFragment=(0,react.useMemo)(function(){var _decodingData_stateChanges;return Object.entries((null!==(_decodingData_stateChanges=null==decodingData?void 0:decodingData.stateChanges)&&void 0!==_decodingData_stateChanges?_decodingData_stateChanges:[]).reduce(function(result,stateChange){var _result_stateChange_changeType;return result[stateChange.changeType]=_to_consumable_array(null!==(_result_stateChange_changeType=result[stateChange.changeType])&&void 0!==_result_stateChange_changeType?_result_stateChange_changeType:[]).concat([stateChange]),result},{})).flatMap(function(param){var _param=_sliced_to_array(param,2);return(_param[0],_param[1]).map(function(change,index){var _decodingData_stateChanges;return react.createElement(StateChangeRow,{stateChangeList:null!==(_decodingData_stateChanges=null==decodingData?void 0:decodingData.stateChanges)&&void 0!==_decodingData_stateChanges?_decodingData_stateChanges:[],stateChange:change,chainId:chainId,shouldDisplayLabel:0===index})})})},[null==decodingData?void 0:decodingData.stateChanges]);return react.createElement(static_simulation.A,{title:t("simulationDetailsTitle"),titleTooltip:t("simulationDetailsTitleTooltip"),simulationElements:stateChangeFragment.length?stateChangeFragment:react.createElement(component_library.EY,null,t("simulationDetailsUnavailable")),isLoading:decodingLoading,isCollapsed:decodingLoading||!stateChangeFragment.length})};try{decodedsimulation.displayName="decodedsimulation",decodedsimulation.__docgenInfo={description:"",displayName:"decodedsimulation",props:{}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign-v4-simulation/decoded-simulation/decoded-simulation.tsx#decodedsimulation"]={docgenInfo:decodedsimulation.__docgenInfo,name:"decodedsimulation",path:"ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign-v4-simulation/decoded-simulation/decoded-simulation.tsx#decodedsimulation"})}catch(__react_docgen_typescript_loader_error){}var signatures=__webpack_require__("./shared/constants/signatures.ts");function extractTokenDetailsByPrimaryType(message,primaryType){var tokenDetails;switch(primaryType){case signatures.di.PermitBatch:case signatures.di.PermitSingle:tokenDetails=null==message?void 0:message.details;break;case signatures.di.PermitBatchTransferFrom:case signatures.di.PermitTransferFrom:tokenDetails=null==message?void 0:message.permitted}return tokenDetails&&!Array.isArray(tokenDetails)?[tokenDetails]:tokenDetails}let permit_simulation=function(){var _currentConfirmation_msgParams,t=(0,useI18nContext.P)(),currentConfirmation=(0,context_confirm.TW)().currentConfirmation,msgData=null===(_currentConfirmation_msgParams=currentConfirmation.msgParams)||void 0===_currentConfirmation_msgParams?void 0:_currentConfirmation_msgParams.data,chainId=currentConfirmation.chainId,_parseTypedDataMessage=(0,transaction_utils.z2)(msgData),verifyingContract=_parseTypedDataMessage.domain.verifyingContract,message=_parseTypedDataMessage.message,tokenId=_parseTypedDataMessage.message.tokenId,primaryType=_parseTypedDataMessage.primaryType,isNFT=void 0!==tokenId,tokenDetails=extractTokenDetailsByPrimaryType(message,primaryType),TokenDetail=function(param){var token=param.token,amount=param.amount,i=param.i;return react.createElement(value_display,{key:"".concat(token,"-").concat(i),primaryType:primaryType,tokenContract:token,value:amount,chainId:chainId})},SpendingCapRow=react.createElement(row.z$,{label:t(isNFT?"simulationApproveHeading":"spendingCap")},react.createElement(component_library.az,{style:{marginLeft:"auto",maxWidth:"100%"}},Array.isArray(tokenDetails)?react.createElement(component_library.az,{display:design_system.nl.Flex,flexDirection:design_system.bo.Column,gap:2},tokenDetails.map(function(param,i){var token=param.token,amount=param.amount;return react.createElement(TokenDetail,{token:token,amount:amount,i:i})})):react.createElement(value_display,{tokenContract:verifyingContract,value:message.value,tokenId:message.tokenId,chainId:chainId})));return react.createElement(static_simulation.A,{title:t("simulationDetailsTitle"),titleTooltip:t("simulationDetailsTitleTooltip"),description:t(isNFT?"simulationDetailsApproveDesc":"permitSimulationDetailInfo"),simulationElements:SpendingCapRow})};try{permitsimulation.displayName="permitsimulation",permitsimulation.__docgenInfo={description:"",displayName:"permitsimulation",props:{}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign-v4-simulation/permit-simulation/permit-simulation.tsx#permitsimulation"]={docgenInfo:permitsimulation.__docgenInfo,name:"permitsimulation",path:"ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign-v4-simulation/permit-simulation/permit-simulation.tsx#permitsimulation"})}catch(__react_docgen_typescript_loader_error){}let typed_sign_v4_simulation=function(){var currentConfirmation=(0,context_confirm.TW)().currentConfirmation,isPermit=(0,utils.VO)(currentConfirmation),isSimulationSupported=useTypesSignSimulationEnabledInfo();if(useDecodedSignatureMetrics(!0===isSimulationSupported),!isSimulationSupported)return null;var decodingData=currentConfirmation.decodingData;return(!currentConfirmation.decodingLoading&&void 0===decodingData||(null==decodingData?void 0:decodingData.error))&&isPermit?react.createElement(permit_simulation,null):react.createElement(decoded_simulation,null)};try{typedsignv4simulation.displayName="typedsignv4simulation",typedsignv4simulation.__docgenInfo={description:"",displayName:"typedsignv4simulation",props:{}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign-v4-simulation/typed-sign-v4-simulation.tsx#typedsignv4simulation"]={docgenInfo:typedsignv4simulation.__docgenInfo,name:"typedsignv4simulation",path:"ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign-v4-simulation/typed-sign-v4-simulation.tsx#typedsignv4simulation"})}catch(__react_docgen_typescript_loader_error){}let typed_sign=function(){var _currentConfirmation_msgParams,t=(0,useI18nContext.P)(),currentConfirmation=(0,context_confirm.TW)().currentConfirmation,isSimulationSupported=useTypesSignSimulationEnabledInfo();if(!(null==currentConfirmation?void 0:currentConfirmation.msgParams))return null;var _parseTypedDataMessage=(0,transaction_utils.z2)(currentConfirmation.msgParams.data),verifyingContract=_parseTypedDataMessage.domain.verifyingContract,spender=_parseTypedDataMessage.message.spender,isPermit=(0,utils.VO)(currentConfirmation),isOrder=(0,utils.m4)(currentConfirmation),decimalsNumber=(0,useGetTokenStandardAndDetails.r)(isPermit||isOrder?verifyingContract:void 0).decimalsNumber,chainId=currentConfirmation.chainId,toolTipMessage=t((0,snaps.cX)(currentConfirmation.msgParams.origin)?"requestFromInfoSnap":"requestFromInfo"),msgData=null===(_currentConfirmation_msgParams=currentConfirmation.msgParams)||void 0===_currentConfirmation_msgParams?void 0:_currentConfirmation_msgParams.data;return react.createElement(react.Fragment,null,isSimulationSupported&&react.createElement(typed_sign_v4_simulation,null),react.createElement(section.C,{"data-testid":"confirmation_request-section"},isPermit&&react.createElement(react.Fragment,null,react.createElement(row.z$,{label:t("spender")},react.createElement(row.L0,{address:spender,chainId:chainId})),react.createElement(row.Oz,null)),react.createElement(alert_row.n,{alertKey:constants.oE.RequestFrom,ownerId:currentConfirmation.id,label:t("requestFrom"),tooltip:toolTipMessage},react.createElement(row.u7,{url:currentConfirmation.msgParams.origin})),(0,dist_browser.isValidAddress)(verifyingContract)&&react.createElement(row.z$,{label:t("interactingWith")},react.createElement(row.L0,{address:verifyingContract,chainId:chainId})),react.createElement(sign_in_with_row.$,null)),react.createElement(section.C,{"data-testid":"confirmation_message-section"},react.createElement(row.z$,{label:t("message"),collapsed:isSimulationSupported,copyEnabled:!0,copyText:JSON.stringify((0,transaction_utils.z2)(null!=msgData?msgData:{}))},react.createElement(typedSignData.Y,{data:msgData,tokenDecimals:decimalsNumber,chainId:chainId}))))};try{typedsign.displayName="typedsign",typedsign.__docgenInfo={description:"",displayName:"typedsign",props:{}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign.tsx#typedsign"]={docgenInfo:typedsign.__docgenInfo,name:"typedsign",path:"ui/pages/confirmations/components/confirm/info/typed-sign/typed-sign.tsx#typedsign"})}catch(__react_docgen_typescript_loader_error){}},"./ui/pages/confirmations/components/confirm/row/dataTree.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{f:()=>DataTree});var Field,_obj,_obj1,react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_shared_constants_signatures__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./shared/constants/signatures.ts"),_shared_modules_hexstring_utils__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./shared/modules/hexstring-utils.ts"),_helpers_utils_util__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/helpers/utils/util.js"),_components_component_library__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/components/component-library/index.ts"),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./ui/hooks/useI18nContext.js"),_components_app_confirm_info_row__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./ui/components/app/confirm/info/row/index.ts"),_hooks_useGetTokenStandardAndDetails__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./ui/pages/confirmations/hooks/useGetTokenStandardAndDetails.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 _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 _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 _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(Field){Field.Amount="amount",Field.BuyAmount="buyAmount",Field.Deadline="deadline",Field.EndAmount="endAmount",Field.EndTime="endTime",Field.Expiration="expiration",Field.Expiry="expiry",Field.SellAmount="sellAmount",Field.SigDeadline="sigDeadline",Field.StartAmount="startAmount",Field.StartTime="startTime",Field.ValidTo="validTo",Field.Value="value"}(Field||(Field={}));var FIELD_TOKEN_UTILS_PRIMARY_TYPES=(_define_property(_obj={},"amount",_to_consumable_array(_shared_constants_signatures__WEBPACK_IMPORTED_MODULE_1__.bA)),_define_property(_obj,"buyAmount",_to_consumable_array(_shared_constants_signatures__WEBPACK_IMPORTED_MODULE_1__.gv)),_define_property(_obj,"endAmount",_to_consumable_array(_shared_constants_signatures__WEBPACK_IMPORTED_MODULE_1__.gv)),_define_property(_obj,"sellAmount",_to_consumable_array(_shared_constants_signatures__WEBPACK_IMPORTED_MODULE_1__.gv)),_define_property(_obj,"startAmount",_to_consumable_array(_shared_constants_signatures__WEBPACK_IMPORTED_MODULE_1__.gv)),_define_property(_obj,"value",_to_consumable_array(_shared_constants_signatures__WEBPACK_IMPORTED_MODULE_1__.bA)),_obj),FIELD_DATE_PRIMARY_TYPES=(_define_property(_obj1={},"deadline",_to_consumable_array(_shared_constants_signatures__WEBPACK_IMPORTED_MODULE_1__.bA)),_define_property(_obj1,"endTime",_to_consumable_array(_shared_constants_signatures__WEBPACK_IMPORTED_MODULE_1__.gv)),_define_property(_obj1,"expiration",[_shared_constants_signatures__WEBPACK_IMPORTED_MODULE_1__.di.PermitBatch,_shared_constants_signatures__WEBPACK_IMPORTED_MODULE_1__.di.PermitSingle]),_define_property(_obj1,"expiry",_to_consumable_array(_shared_constants_signatures__WEBPACK_IMPORTED_MODULE_1__.bA)),_define_property(_obj1,"sigDeadline",_to_consumable_array(_shared_constants_signatures__WEBPACK_IMPORTED_MODULE_1__.bA)),_define_property(_obj1,"startTime",_to_consumable_array(_shared_constants_signatures__WEBPACK_IMPORTED_MODULE_1__.gv)),_define_property(_obj1,"validTo",_to_consumable_array(_shared_constants_signatures__WEBPACK_IMPORTED_MODULE_1__.gv)),_obj1),getTokenContractInDataTree=function(dataTreeData){if(!Array.isArray(dataTreeData)){var _dataTreeData_token,tokenContract=null===(_dataTreeData_token=dataTreeData.token)||void 0===_dataTreeData_token?void 0:_dataTreeData_token.value;if(tokenContract&&(0,_shared_modules_hexstring_utils__WEBPACK_IMPORTED_MODULE_2__.Cv)(tokenContract))return tokenContract}},DataTree=function(param){var data=param.data,primaryType=param.primaryType,tokenDecimalsProp=param.tokenDecimals,chainId=param.chainId,tokenContract=getTokenContractInDataTree(data),decimalsNumber=(0,_hooks_useGetTokenStandardAndDetails__WEBPACK_IMPORTED_MODULE_8__.r)(tokenContract).decimalsNumber,tokenDecimals="number"==typeof decimalsNumber?decimalsNumber:tokenDecimalsProp;return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_4__.az,{width:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_5__.Zf.Full},Object.entries(data).map(function(param,i){var _param=_sliced_to_array(param,2),label=_param[0],_param_=_param[1],value=_param_.value,type=_param_.type;return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_app_confirm_info_row__WEBPACK_IMPORTED_MODULE_7__.z$,{label:"".concat((0,_helpers_utils_util__WEBPACK_IMPORTED_MODULE_3__.xV)(label.charAt(0).toUpperCase()+label.slice(1)),":"),style:{paddingRight:0},key:"tree-data-".concat(label,"-index-").concat(i),"data-testid":"confirmation_data-".concat(label,"-index-").concat(i)},react__WEBPACK_IMPORTED_MODULE_0__.createElement(DataField,{label:label,primaryType:primaryType,value:value,type:type,tokenDecimals:tokenDecimals,chainId:chainId}))}))};function isDateField(label,primaryType){var _this;return null===(_this=FIELD_DATE_PRIMARY_TYPES[label]||[])||void 0===_this?void 0:_this.includes(primaryType||"")}function isTokenUnitsField(label,primaryType){var _this;return null===(_this=FIELD_TOKEN_UTILS_PRIMARY_TYPES[label]||[])||void 0===_this?void 0:_this.includes(primaryType||"")}var DataField=(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)(function(param){var label=param.label,primaryType=param.primaryType,type=param.type,value=param.value,tokenDecimals=param.tokenDecimals,chainId=param.chainId,t=(0,_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_6__.P)();return"object"==typeof value&&null!==value?react__WEBPACK_IMPORTED_MODULE_0__.createElement(DataTree,{data:value,primaryType:primaryType,tokenDecimals:tokenDecimals,chainId:chainId}):isDateField(label,primaryType)&&value?-1===parseInt(value,10)?react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_app_confirm_info_row__WEBPACK_IMPORTED_MODULE_7__.UK,{text:t("none")}):react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_app_confirm_info_row__WEBPACK_IMPORTED_MODULE_7__.pm,{unixTimestamp:parseInt(value,10)}):isTokenUnitsField(label,primaryType)?react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_app_confirm_info_row__WEBPACK_IMPORTED_MODULE_7__.yT,{value:value,decimals:tokenDecimals}):"address"===type&&(0,_shared_modules_hexstring_utils__WEBPACK_IMPORTED_MODULE_2__.Cv)(value,{mixedCaseUseChecksum:!0})?react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_app_confirm_info_row__WEBPACK_IMPORTED_MODULE_7__.L0,{address:value,chainId:chainId}):react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_app_confirm_info_row__WEBPACK_IMPORTED_MODULE_7__.UK,{text:(0,_helpers_utils_util__WEBPACK_IMPORTED_MODULE_3__.xV)(value)})});try{DataTree.displayName="DataTree",DataTree.__docgenInfo={description:"",displayName:"DataTree",props:{data:{defaultValue:null,description:"",name:"data",required:!0,type:{name:"Record<string, TreeData> | TreeData[]"}},primaryType:{defaultValue:null,description:"",name:"primaryType",required:!1,type:{name:"enum",value:[{value:'"Order"'},{value:'"OrderComponents"'},{value:'"Permit"'},{value:'"PermitBatch"'},{value:'"PermitBatchTransferFrom"'},{value:'"PermitSingle"'},{value:'"PermitTransferFrom"'},{value:'"PermitWitnessTransferFrom"'}]}},tokenDecimals:{defaultValue:null,description:"",name:"tokenDecimals",required:!1,type:{name:"number"}},chainId:{defaultValue:null,description:"",name:"chainId",required:!0,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/confirm/row/dataTree.tsx#DataTree"]={docgenInfo:DataTree.__docgenInfo,name:"DataTree",path:"ui/pages/confirmations/components/confirm/row/dataTree.tsx#DataTree"})}catch(__react_docgen_typescript_loader_error){}},"./ui/pages/confirmations/components/confirm/row/typed-sign-data/typedSignData.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Y:()=>ConfirmInfoRowTypedSignData});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/hooks/useI18nContext.js"),_components_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"),_components_app_confirm_info_row__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/components/app/confirm/info/row/index.ts"),_utils__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/pages/confirmations/utils/index.ts"),_dataTree__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./ui/pages/confirmations/components/confirm/row/dataTree.tsx"),ConfirmInfoRowTypedSignData=function(param){var data=param.data,tokenDecimals=param.tokenDecimals,chainId=param.chainId,t=(0,_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_1__.P)();if(!data)return null;var _parseSanitizeTypedDataMessage=(0,_utils__WEBPACK_IMPORTED_MODULE_5__.WY)(data),sanitizedMessage=_parseSanitizeTypedDataMessage.sanitizedMessage,primaryType=_parseSanitizeTypedDataMessage.primaryType;return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_2__.az,{width:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.Zf.Full},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_app_confirm_info_row__WEBPACK_IMPORTED_MODULE_4__.z$,{label:"".concat(t("primaryType"),":"),style:{paddingLeft:0,paddingRight:0}},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_app_confirm_info_row__WEBPACK_IMPORTED_MODULE_4__.UK,{text:primaryType})),react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_component_library__WEBPACK_IMPORTED_MODULE_2__.az,{style:{marginLeft:-8}},react__WEBPACK_IMPORTED_MODULE_0__.createElement(_dataTree__WEBPACK_IMPORTED_MODULE_6__.f,{data:sanitizedMessage.value,primaryType:primaryType,tokenDecimals:tokenDecimals,chainId:chainId})))};try{ConfirmInfoRowTypedSignData.displayName="ConfirmInfoRowTypedSignData",ConfirmInfoRowTypedSignData.__docgenInfo={description:"",displayName:"ConfirmInfoRowTypedSignData",props:{data:{defaultValue:null,description:"",name:"data",required:!0,type:{name:"string"}},isPermit:{defaultValue:null,description:"",name:"isPermit",required:!1,type:{name:"boolean"}},tokenDecimals:{defaultValue:null,description:"",name:"tokenDecimals",required:!1,type:{name:"number"}},chainId:{defaultValue:null,description:"",name:"chainId",required:!0,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/pages/confirmations/components/confirm/row/typed-sign-data/typedSignData.tsx#ConfirmInfoRowTypedSignData"]={docgenInfo:ConfirmInfoRowTypedSignData.__docgenInfo,name:"ConfirmInfoRowTypedSignData",path:"ui/pages/confirmations/components/confirm/row/typed-sign-data/typedSignData.tsx#ConfirmInfoRowTypedSignData"})}catch(__react_docgen_typescript_loader_error){}},"./ui/pages/confirmations/hooks/useGetTokenStandardAndDetails.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{r:()=>useGetTokenStandardAndDetails});var _shared_constants_transaction__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./shared/constants/transaction.ts"),_hooks_useAsyncResult__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/hooks/useAsyncResult.ts"),_utils_token__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/pages/confirmations/utils/token.ts");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 _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 useGetTokenStandardAndDetails=function(tokenAddress){if(!tokenAddress)return{decimalsNumber:void 0};var details=(0,_hooks_useAsyncResult__WEBPACK_IMPORTED_MODULE_1__.$)(_async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,(0,_utils_token__WEBPACK_IMPORTED_MODULE_2__.OS)(tokenAddress)];case 1:return[2,_state.sent()]}})}),[tokenAddress]).value;if(!details)return{decimalsNumber:void 0};var _ref=details||{},decimals=_ref.decimals;if(_ref.standard===_shared_constants_transaction__WEBPACK_IMPORTED_MODULE_0__.ph.ERC20){var _parseTokenDetailDecimals,parsedDecimals=null!==(_parseTokenDetailDecimals=(0,_utils_token__WEBPACK_IMPORTED_MODULE_2__.a6)(decimals))&&void 0!==_parseTokenDetailDecimals?_parseTokenDetailDecimals:_utils_token__WEBPACK_IMPORTED_MODULE_2__.Mh;details.decimalsNumber=parsedDecimals}return details}},"./ui/pages/confirmations/hooks/useSignatureEventFragment.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{U:()=>useSignatureEventFragment});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_helpers_utils_metrics__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/helpers/utils/metrics.js"),_store_actions__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/__mocks__/actions.js"),_context_confirm__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/pages/confirmations/context/confirm/index.tsx"),_utils__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/pages/confirmations/utils/index.ts");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 _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 useSignatureEventFragment=function(){var _ref,_currentConfirmation_msgParams,currentConfirmation=(0,_context_confirm__WEBPACK_IMPORTED_MODULE_3__.TW)().currentConfirmation,requestId=(0,_utils__WEBPACK_IMPORTED_MODULE_4__.rS)(currentConfirmation)&&(null==currentConfirmation?void 0:null===(_currentConfirmation_msgParams=currentConfirmation.msgParams)||void 0===_currentConfirmation_msgParams?void 0:_currentConfirmation_msgParams.requestId),fragmentId=requestId?(0,_helpers_utils_metrics__WEBPACK_IMPORTED_MODULE_1__.IU)(requestId):null;return{updateSignatureEventFragment:(0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((_ref=_async_to_generator(function(fragmentPayload){return _ts_generator(this,function(_state){return fragmentId&&(0,_store_actions__WEBPACK_IMPORTED_MODULE_2__.updateEventFragment)(fragmentId,fragmentPayload),[2]})}),function(fragmentPayload){return _ref.apply(this,arguments)}),[fragmentId])}}}}]);