-
Notifications
You must be signed in to change notification settings - Fork 31
/
53156.50695e14.iframe.bundle.js
1 lines (1 loc) · 45.3 KB
/
53156.50695e14.iframe.bundle.js
1
"use strict";(globalThis.webpackChunkmetamask_crx=globalThis.webpackChunkmetamask_crx||[]).push([[53156],{"./ui/components/app/assets/nfts/nft-default-image/nft-default-image.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>NftDefaultImage});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/prop-types/index.js"),prop_types__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__),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__),react_redux__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react-redux/es/index.js"),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./ui/hooks/useI18nContext.js"),_component_library__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./ui/components/component-library/index.ts"),_store_actions__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./ui/store/actions.ts");function NftDefaultImage(param){var className=param.className,clickable=param.clickable,t=(0,_hooks_useI18nContext__WEBPACK_IMPORTED_MODULE_4__.P)(),dispatch=(0,react_redux__WEBPACK_IMPORTED_MODULE_2__.wA)();return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_5__.az,{tabIndex:0,"data-testid":"nft-default-image",className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(className,"nft-default",{"nft-default--clickable":clickable}),display:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.nl.Flex,alignItems:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.k2.Center,justifyContent:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.A9.Center,borderRadius:_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_3__.Z6.LG},clickable&&react__WEBPACK_IMPORTED_MODULE_0__.createElement(_component_library__WEBPACK_IMPORTED_MODULE_5__.vx,{block:!0,className:"nft-default__button",onClick:function(e){e.stopPropagation(),dispatch((0,_store_actions__WEBPACK_IMPORTED_MODULE_6__.showIpfsModal)())}},t("show")))}NftDefaultImage.propTypes={clickable:prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool,className:prop_types__WEBPACK_IMPORTED_MODULE_7___default().string},NftDefaultImage.__docgenInfo={description:"",methods:[],displayName:"NftDefaultImage",props:{clickable:{description:"Controls the css class for the cursor hover\nIt determines if we need to show the button on default image or not",type:{name:"bool"},required:!1},className:{description:"An additional className to apply to the NFT default image",type:{name:"string"},required:!1}}}},"./ui/components/app/assets/nfts/nfts-items/nfts-items.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>NftsItems});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"),box=__webpack_require__("./ui/components/ui/box/index.js"),typography=__webpack_require__("./ui/components/ui/typography/typography.js"),design_system=__webpack_require__("./ui/helpers/constants/design-system.ts"),app=__webpack_require__("./shared/constants/app.ts"),util=__webpack_require__("./app/scripts/lib/util.ts"),selectors=__webpack_require__("./ui/selectors/index.js"),routes=__webpack_require__("./ui/helpers/constants/routes.ts"),utils_util=__webpack_require__("./ui/helpers/utils/util.js"),utils_nfts=__webpack_require__("./ui/helpers/utils/nfts.js"),actions=__webpack_require__("./ui/store/actions.ts"),usePrevious=__webpack_require__("./ui/hooks/usePrevious.ts"),metamask=__webpack_require__("./ui/ducks/metamask/metamask.js"),useI18nContext=__webpack_require__("./ui/hooks/useI18nContext.js"),component_library=__webpack_require__("./ui/components/component-library/index.ts"),nft_item=__webpack_require__("./ui/components/multichain/nft-item/index.js"),send=__webpack_require__("./ui/ducks/send/index.js"),transaction=__webpack_require__("./shared/constants/transaction.ts"),metametrics=__webpack_require__("./ui/contexts/metametrics.js"),constants_metametrics=__webpack_require__("./shared/constants/metametrics.ts"),string_utils=__webpack_require__("./shared/modules/string-utils.ts"),useGetAssetImageUrl=__webpack_require__("./ui/hooks/useGetAssetImageUrl.ts"),CollectionImageComponent=function(param){var _collectionName_,_collectionName_1,_collectionName__toUpperCase,_collectionName_2,_collectionName__toUpperCase1,_collectionName__toUpperCase2,collectionImage=param.collectionImage,collectionName=param.collectionName,ipfsGateway=(0,es.d4)(selectors.l68),openSeaEnabled=(0,es.d4)(selectors.zMR),nftImageURL=(0,useGetAssetImageUrl.A)(collectionImage,ipfsGateway);return react.createElement(component_library.az,null,(null==collectionImage?void 0:collectionImage.startsWith("ipfs"))&&!ipfsGateway?react.createElement("div",{className:"nfts-items__collection-image-alt"},null!==(_collectionName__toUpperCase=null==collectionName?void 0:null===(_collectionName_1=collectionName[0])||void 0===_collectionName_1?void 0:_collectionName_1.toUpperCase())&&void 0!==_collectionName__toUpperCase?_collectionName__toUpperCase:null):openSeaEnabled||(null==collectionImage?void 0:collectionImage.startsWith("ipfs"))?collectionImage?react.createElement("img",{alt:collectionName,src:nftImageURL,className:"nfts-items__collection-image"}):react.createElement("div",{className:"nfts-items__collection-image-alt"},null!==(_collectionName__toUpperCase2=null==collectionName?void 0:null===(_collectionName_=collectionName[0])||void 0===_collectionName_?void 0:_collectionName_.toUpperCase())&&void 0!==_collectionName__toUpperCase2?_collectionName__toUpperCase2:null):react.createElement("div",{className:"nfts-items__collection-image-alt"},null!==(_collectionName__toUpperCase1=null==collectionName?void 0:null===(_collectionName_2=collectionName[0])||void 0===_collectionName_2?void 0:_collectionName_2.toUpperCase())&&void 0!==_collectionName__toUpperCase1?_collectionName__toUpperCase1:null))};try{CollectionImageComponent.displayName="CollectionImageComponent",CollectionImageComponent.__docgenInfo={description:"",displayName:"CollectionImageComponent",props:{collectionImage:{defaultValue:null,description:"",name:"collectionImage",required:!0,type:{name:"string"}},collectionName:{defaultValue:null,description:"",name:"collectionName",required:!0,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["ui/components/app/assets/nfts/nfts-items/collection-image.component.tsx#CollectionImageComponent"]={docgenInfo:CollectionImageComponent.__docgenInfo,name:"CollectionImageComponent",path:"ui/components/app/assets/nfts/nfts-items/collection-image.component.tsx#CollectionImageComponent"})}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 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_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 _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 _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 width=function(isModal){var env=(0,util.mc)()===app.YY;return isModal||env===app.YY?design_system.VH.ONE_THIRD:design_system.VH.ONE_SIXTH};function NftsItems(param){var _ref,_ref1,_previouslyOwnedCollection_nfts_,_param_collections=param.collections,collections=void 0===_param_collections?{}:_param_collections,_param_previouslyOwnedCollection=param.previouslyOwnedCollection,previouslyOwnedCollection=void 0===_param_previouslyOwnedCollection?{}:_param_previouslyOwnedCollection,_param_isModal=param.isModal,isModal=void 0!==_param_isModal&&_param_isModal,_param_onCloseModal=param.onCloseModal,onCloseModal=void 0===_param_onCloseModal?{}:_param_onCloseModal,_param_showTokenId=param.showTokenId,showTokenId=void 0!==_param_showTokenId&&_param_showTokenId,_param_displayPreviouslyOwnedCollection=param.displayPreviouslyOwnedCollection,dispatch=(0,es.wA)(),collectionsKeys=Object.keys(collections),nftsDropdownState=(0,es.d4)(metamask.eI),previousCollectionKeys=(0,usePrevious.Z)(collectionsKeys),selectedAddress=(0,es.d4)(selectors._rF).address,chainId=(0,es.d4)(selectors.grx),currentChain=(0,es.d4)(selectors.SLx),t=(0,useI18nContext.P)(),ipfsGateway=(0,es.d4)(selectors.l68),_useState=_sliced_to_array((0,react.useState)([]),2),updatedNfts=_useState[0],setUpdatedNfts=_useState[1],trackEvent=(0,react.useContext)(metametrics.O2),sendAnalytics=(0,es.d4)(send.hp);(0,react.useEffect)(function(){var _nftsDropdownState_selectedAddress,_nftsDropdownState_selectedAddress1;if(void 0!==chainId&&void 0!==selectedAddress&&!(0,lodash.isEqual)(previousCollectionKeys,collectionsKeys)&&((null==nftsDropdownState?void 0:null===(_nftsDropdownState_selectedAddress=nftsDropdownState[selectedAddress])||void 0===_nftsDropdownState_selectedAddress?void 0:_nftsDropdownState_selectedAddress[chainId])===void 0||0===Object.keys(null==nftsDropdownState?void 0:null===(_nftsDropdownState_selectedAddress1=nftsDropdownState[selectedAddress])||void 0===_nftsDropdownState_selectedAddress1?void 0:_nftsDropdownState_selectedAddress1[chainId]).length)){var initState={};collectionsKeys.forEach(function(key){initState[key]=!0});var newNftDropdownState=_object_spread_props(_object_spread({},nftsDropdownState),_define_property({},selectedAddress,_object_spread_props(_object_spread({},null==nftsDropdownState?void 0:nftsDropdownState[selectedAddress]),_define_property({},chainId,initState))));dispatch((0,actions.updateNftDropDownState)(newNftDropdownState))}},[collectionsKeys,previousCollectionKeys,nftsDropdownState,selectedAddress,chainId,dispatch]);var getAssetImageUrlAndUpdate=(_ref=_async_to_generator(function(image,nft){var nftImage;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,(0,utils_util.Xg)(image,ipfsGateway)];case 1:return nftImage=_state.sent(),[2,_object_spread_props(_object_spread({},nft),{ipfsImageUpdated:nftImage})]}})}),function getAssetImageUrlAndUpdate(image,nft){return _ref.apply(this,arguments)});(0,react.useEffect)(function(){var _ref,promisesArr=[];(_ref=_async_to_generator(function(){var _iteratorNormalCompletion,_didIteratorError,_iteratorError,_iterator,_step,nfts,_iteratorNormalCompletion1,_didIteratorError1,_iteratorError1,_iterator1,_step1,singleNft,image,imageOriginal;return _ts_generator(this,function(_state){switch(_state.label){case 0:_iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(_iterator=collectionsKeys[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){nfts=collections[_step.value].nfts,_iteratorNormalCompletion1=!0,_didIteratorError1=!1,_iteratorError1=void 0;try{for(_iterator1=nfts[Symbol.iterator]();!(_iteratorNormalCompletion1=(_step1=_iterator1.next()).done);_iteratorNormalCompletion1=!0)image=(singleNft=_step1.value).image,imageOriginal=singleNft.imageOriginal,(null==image?void 0:image.startsWith("https:"))||(null==image?void 0:image.startsWith("http:"))||promisesArr.push(getAssetImageUrlAndUpdate(null!=imageOriginal?imageOriginal:image,singleNft))}catch(err){_didIteratorError1=!0,_iteratorError1=err}finally{try{_iteratorNormalCompletion1||null==_iterator1.return||_iterator1.return()}finally{if(_didIteratorError1)throw _iteratorError1}}}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}return[4,Promise.all(promisesArr)];case 1:return setUpdatedNfts(_state.sent()),[2]}})}),function modifyItems(){return _ref.apply(this,arguments)})()},[]);var history=(0,react_router.W6)(),updateNftDropDownStateKey=function(key,isExpanded){var _nftsDropdownState_selectedAddress,newCurrentAccountState=_object_spread_props(_object_spread({},null==nftsDropdownState?void 0:null===(_nftsDropdownState_selectedAddress=nftsDropdownState[selectedAddress])||void 0===_nftsDropdownState_selectedAddress?void 0:_nftsDropdownState_selectedAddress[chainId]),_define_property({},key,!isExpanded)),newState=_object_spread_props(_object_spread({},nftsDropdownState),_define_property({},selectedAddress,_define_property({},chainId,newCurrentAccountState)));dispatch((0,actions.updateNftDropDownState)(newState))},onSendNft=(_ref1=_async_to_generator(function(nft){return _ts_generator(this,function(_state){switch(_state.label){case 0:return trackEvent({event:constants_metametrics.gP.sendAssetSelected,category:constants_metametrics.FZ.Send,properties:{is_destination_asset_picker_modal:!1,is_nft:!0},sensitiveProperties:_object_spread_props(_object_spread({},sendAnalytics),{new_asset_symbol:nft.name,new_asset_address:nft.address})},{excludeMetaMetricsId:!1}),[4,dispatch((0,send.gM)({type:transaction.PW.NFT,details:nft,skipComputeEstimatedGasLimit:!1}))];case 1:return _state.sent(),history.push(routes.xW),onCloseModal(),[2]}})}),function onSendNft(nft){return _ref1.apply(this,arguments)}),renderCollection=function(param){var _nftsDropdownState_selectedAddress_chainId,_nftsDropdownState_selectedAddress,nfts=param.nfts,collectionName=param.collectionName,collectionImage=param.collectionImage,key=param.key;if(!nfts.length)return null;var getSource=function(isImageHosted,nft){if(!isImageHosted){var found=updatedNfts.find(function(elm){return elm.tokenId===nft.tokenId&&(0,string_utils.y)(elm.address,nft.address)});if(found)return found.ipfsImageUpdated}return nft.image},isExpanded=null===(_nftsDropdownState_selectedAddress=nftsDropdownState[selectedAddress])||void 0===_nftsDropdownState_selectedAddress?void 0:null===(_nftsDropdownState_selectedAddress_chainId=_nftsDropdownState_selectedAddress[chainId])||void 0===_nftsDropdownState_selectedAddress_chainId?void 0:_nftsDropdownState_selectedAddress_chainId[key];return react.createElement("div",{className:"nfts-items__collection",key:"collection-".concat(key)},react.createElement("button",{className:"nfts-items__collection-wrapper","data-testid":"collection-expander-button",onClick:function(){updateNftDropDownStateKey(key,isExpanded)}},react.createElement(box.Ay,{marginBottom:2,display:design_system.Nu.FLEX,alignItems:design_system.k2.center,justifyContent:design_system.A9.spaceBetween,className:"nfts-items__collection-accordion-title"},react.createElement(box.Ay,{alignItems:design_system.k2.center,className:"nfts-items__collection-header"},react.createElement(CollectionImageComponent,{collectionImage:collectionImage,collectionName:collectionName}),react.createElement(typography.Ay,{color:design_system.Q1.textDefault,variant:design_system.PT.H5,margin:2},"".concat(null!=collectionName?collectionName:t("unknownCollection")," (").concat(nfts.length,")"))),react.createElement(box.Ay,{alignItems:design_system.k2.flexEnd},react.createElement(component_library.In,{name:isExpanded?component_library.$M.ArrowDown:component_library.$M.ArrowRight,color:design_system.Q1.iconDefault})))),isExpanded?react.createElement(box.Ay,{display:design_system.Nu.FLEX,flexWrap:design_system.vm.WRAP,gap:4},nfts.map(function(nft,i){var _this,_currentChain_rpcPrefs,_ref,image=nft.image,address=nft.address,tokenId=nft.tokenId,name=nft.name,imageOriginal=nft.imageOriginal,tokenURI=nft.tokenURI,nftImageAlt=(0,utils_nfts.x)(nft),source=getSource((null==image?void 0:image.startsWith("https:"))||(null==image?void 0:image.startsWith("http:")),nft),isIpfsURL=null===(_this=null!==(_ref=null!=imageOriginal?imageOriginal:image)&&void 0!==_ref?_ref:tokenURI)||void 0===_this?void 0:_this.startsWith("ipfs:");return react.createElement(box.Ay,{"data-testid":"nft-wrapper",width:width(isModal),key:"nft-".concat(i),className:"nfts-items__item-wrapper"},react.createElement(nft_item.o,{alt:nftImageAlt,src:source,name:name,tokenId:tokenId,networkName:currentChain.nickname,networkSrc:null===(_currentChain_rpcPrefs=currentChain.rpcPrefs)||void 0===_currentChain_rpcPrefs?void 0:_currentChain_rpcPrefs.imageUrl,onClick:function(){return isModal?onSendNft(nft):history.push("".concat(routes.Jy,"/").concat(currentChain.chainId,"/").concat(address,"/").concat(tokenId))},isIpfsURL:isIpfsURL,clickable:!0}),showTokenId?react.createElement(component_library.EY,null,"".concat(t("id"),": ").concat(tokenId)):null)})):null)};return react.createElement("div",{className:"nfts-items"},react.createElement(box.Ay,{paddingTop:6,paddingBottom:6,paddingLeft:4,paddingRight:4,flexDirection:design_system.GO.COLUMN},react.createElement(react.Fragment,null,collectionsKeys.map(function(key){var _collections_key=collections[key];return renderCollection({nfts:_collections_key.nfts,collectionName:_collections_key.collectionName,collectionImage:_collections_key.collectionImage,key:key,isPreviouslyOwnedCollection:!1})}),void 0===_param_displayPreviouslyOwnedCollection||_param_displayPreviouslyOwnedCollection?renderCollection({nfts:previouslyOwnedCollection.nfts,collectionName:previouslyOwnedCollection.collectionName,collectionImage:null===(_previouslyOwnedCollection_nfts_=previouslyOwnedCollection.nfts[0])||void 0===_previouslyOwnedCollection_nfts_?void 0:_previouslyOwnedCollection_nfts_.image,isPreviouslyOwnedCollection:!0,key:"previouslyOwned"}):null)))}NftsItems.propTypes={previouslyOwnedCollection:prop_types_default().shape({nfts:prop_types_default().arrayOf(prop_types_default().shape({address:prop_types_default().string.isRequired,tokenId:prop_types_default().string.isRequired,name:prop_types_default().string,description:prop_types_default().string,image:prop_types_default().string,standard:prop_types_default().string,imageThumbnail:prop_types_default().string,imagePreview:prop_types_default().string,creator:prop_types_default().shape({address:prop_types_default().string,config:prop_types_default().string,profile_img_url:prop_types_default().string})})),collectionName:prop_types_default().string,collectionImage:prop_types_default().string}),collections:prop_types_default().shape({nfts:prop_types_default().arrayOf(prop_types_default().shape({address:prop_types_default().string.isRequired,tokenId:prop_types_default().string.isRequired,name:prop_types_default().string,description:prop_types_default().string,image:prop_types_default().string,standard:prop_types_default().string,imageThumbnail:prop_types_default().string,imagePreview:prop_types_default().string,creator:prop_types_default().shape({address:prop_types_default().string,config:prop_types_default().string,profile_img_url:prop_types_default().string})})),collectionImage:prop_types_default().string,collectionName:prop_types_default().string}),isModal:prop_types_default().bool,onCloseModal:prop_types_default().func,showTokenId:prop_types_default().bool,displayPreviouslyOwnedCollection:prop_types_default().bool},NftsItems.__docgenInfo={description:"",methods:[],displayName:"NftsItems",props:{collections:{defaultValue:{value:"{}",computed:!1},description:"",type:{name:"shape",value:{nfts:{name:"arrayOf",value:{name:"shape",value:{address:{name:"string",required:!0},tokenId:{name:"string",required:!0},name:{name:"string",required:!1},description:{name:"string",required:!1},image:{name:"string",required:!1},standard:{name:"string",required:!1},imageThumbnail:{name:"string",required:!1},imagePreview:{name:"string",required:!1},creator:{name:"shape",value:{address:{name:"string",required:!1},config:{name:"string",required:!1},profile_img_url:{name:"string",required:!1}},required:!1}}},required:!1},collectionImage:{name:"string",required:!1},collectionName:{name:"string",required:!1}}},required:!1},previouslyOwnedCollection:{defaultValue:{value:"{}",computed:!1},description:"",type:{name:"shape",value:{nfts:{name:"arrayOf",value:{name:"shape",value:{address:{name:"string",required:!0},tokenId:{name:"string",required:!0},name:{name:"string",required:!1},description:{name:"string",required:!1},image:{name:"string",required:!1},standard:{name:"string",required:!1},imageThumbnail:{name:"string",required:!1},imagePreview:{name:"string",required:!1},creator:{name:"shape",value:{address:{name:"string",required:!1},config:{name:"string",required:!1},profile_img_url:{name:"string",required:!1}},required:!1}}},required:!1},collectionName:{name:"string",required:!1},collectionImage:{name:"string",required:!1}}},required:!1},isModal:{defaultValue:{value:"false",computed:!1},description:"",type:{name:"bool"},required:!1},onCloseModal:{defaultValue:{value:"{}",computed:!1},description:"",type:{name:"func"},required:!1},showTokenId:{defaultValue:{value:"false",computed:!1},description:"",type:{name:"bool"},required:!1},displayPreviouslyOwnedCollection:{defaultValue:{value:"true",computed:!1},description:"",type:{name:"bool"},required:!1}}}},"./ui/components/multichain/nft-item/index.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{o:()=>NftItem});var react=__webpack_require__("./node_modules/react/index.js"),prop_types=__webpack_require__("./node_modules/prop-types/index.js"),prop_types_default=__webpack_require__.n(prop_types),classnames=__webpack_require__("./node_modules/classnames/index.js"),classnames_default=__webpack_require__.n(classnames),es=__webpack_require__("./node_modules/react-redux/es/index.js"),nft_default_image=__webpack_require__("./ui/components/app/assets/nfts/nft-default-image/nft-default-image.js"),component_library=__webpack_require__("./ui/components/component-library/index.ts"),design_system=__webpack_require__("./ui/helpers/constants/design-system.ts"),selectors=__webpack_require__("./ui/selectors/index.js"),NftItem=function(param){var alt=param.alt,name=param.name,src=param.src,networkName=param.networkName,networkSrc=param.networkSrc,tokenId=param.tokenId,onClick=param.onClick,clickable=param.clickable,isIpfsURL=param.isIpfsURL,badgeWrapperClassname=param.badgeWrapperClassname,testNetworkBackgroundColor=(0,es.d4)(selectors.wc1),isIpfsEnabled=(0,es.d4)(selectors.l68),openSeaEnabled=(0,es.d4)(selectors.zMR),ipfsImageIsRenderable=isIpfsEnabled&&isIpfsURL&&src,openseaImageIsRenderable=openSeaEnabled&&src&&!isIpfsURL,nftImageComponentToRender=ipfsImageIsRenderable||openseaImageIsRenderable?react.createElement(component_library.az,{className:"nft-item__item nft-item__item-image","data-testid":"nft-image",as:"img",src:src,alt:alt,display:design_system.nl.Block,justifyContent:design_system.A9.center}):react.createElement(nft_default_image.A,{className:"nft-item__default-image","data-testid":"nft-default-image",name:name,tokenId:tokenId,clickable:clickable&&isIpfsURL});return react.createElement(component_library.az,{className:"nft-item__container","data-testid":"nft-item",as:"button",onClick:onClick},react.createElement(component_library.ph,{className:classnames_default()("nft-item__badge-wrapper",badgeWrapperClassname,{"nft-item__badge-wrapper__clickable":clickable}),anchorElementShape:component_library.Hs.circular,positionObj:{top:-4,right:-4},display:design_system.nl.Block,badge:react.createElement(component_library.Gn,{className:"nft-item__network-badge",backgroundColor:testNetworkBackgroundColor,"data-testid":"nft-network-badge",size:component_library.LM.Sm,name:networkName,src:networkSrc,borderWidth:2,borderColor:design_system.i0.backgroundDefault})},nftImageComponentToRender))};NftItem.propTypes={src:prop_types_default().string,alt:prop_types_default().string.isRequired,name:prop_types_default().string,networkName:prop_types_default().string.isRequired,networkSrc:prop_types_default().string,tokenId:prop_types_default().string.isRequired,onClick:prop_types_default().func,clickable:prop_types_default().bool,isIpfsURL:prop_types_default().bool,badgeWrapperClassname:prop_types_default().string},NftItem.__docgenInfo={description:"",methods:[],displayName:"NftItem",props:{src:{description:"NFT media source",type:{name:"string"},required:!1},alt:{description:"Alt text for the NFT",type:{name:"string"},required:!0},name:{description:"The NFT's name",type:{name:"string"},required:!1},networkName:{description:"Name of the network the NFT lives on",type:{name:"string"},required:!0},networkSrc:{description:"Image that represents the network",type:{name:"string"},required:!1},tokenId:{description:"Token ID of the NFT",type:{name:"string"},required:!0},onClick:{description:"Executes when the NFT is clicked",type:{name:"func"},required:!1},clickable:{description:"Represents if the NFT is clickable for larger image",type:{name:"bool"},required:!1},isIpfsURL:{description:"Whether the src url resolve to ipfs",type:{name:"bool"},required:!1},badgeWrapperClassname:{description:"",type:{name:"string"},required:!1}}}},"./ui/components/ui/typography/typography.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{Ay:()=>Typography,Lp:()=>ValidColors,gn:()=>ValidTags});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_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__),_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./ui/helpers/constants/design-system.ts"),_box__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./ui/components/ui/box/index.js");function _define_property(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _object_spread(target){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{},ownKeys=Object.keys(source);"function"==typeof Object.getOwnPropertySymbols&&(ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))),ownKeys.forEach(function(key){_define_property(target,key,source[key])})}return target}var H6=_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.PT.H6,H7=_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.PT.H7,H8=_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.PT.H8,H9=_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.PT.H9,ValidColors=[_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.textDefault,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.textAlternative,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.textMuted,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.overlayInverse,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.primaryDefault,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.primaryInverse,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.errorDefault,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.errorInverse,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.successDefault,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.successInverse,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.sepoliaInverse,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.warningDefault,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.warningInverse,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.infoDefault,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.infoInverse,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.goerli,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.sepolia,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.goerliInverse,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.sepoliaInverse,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.lineaGoerli,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.lineaGoerliInverse,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.lineaSepolia,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.lineaSepoliaInverse,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.lineaMainnet,_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.lineaMainnetInverse],ValidTags=["dd","div","dt","em","h1","h2","h3","h4","h5","h6","li","p","span","strong","ul","label"];function Typography(param){var strongTagFontWeight,_obj,_param_variant=param.variant,variant=void 0===_param_variant?_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.PT.paragraph:_param_variant,_param_color=param.color,color=void 0===_param_color?_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Q1.textDefault:_param_color,_param_fontWeight=param.fontWeight,_param_fontStyle=param.fontStyle,align=param.align,overflowWrap=param.overflowWrap,title=param.title,as=param.as,margin=param.margin,_param_marginTop=param.marginTop,marginRight=param.marginRight,_param_marginBottom=param.marginBottom,marginLeft=param.marginLeft,_param_boxProps=param.boxProps,className=param.className,testId=param.testId,children=param.children,Tag=null!=as?as:variant;"strong"===Tag&&(strongTagFontWeight=_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.zN.BOLD);var computedClassName=classnames__WEBPACK_IMPORTED_MODULE_1___default()("typography",className,"typography--".concat(variant),"typography--weight-".concat(strongTagFontWeight||(void 0===_param_fontWeight?"normal":_param_fontWeight)),"typography--style-".concat(void 0===_param_fontStyle?"normal":_param_fontStyle),(_define_property(_obj={},"typography--align-".concat(align),!!align),_define_property(_obj,"typography--color-".concat(color),!!color),_define_property(_obj,"typography--overflowwrap-".concat(overflowWrap),!!overflowWrap),_obj));return Tag===_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.PT.paragraph?Tag="p":[H7,H8,H9].includes(Tag)&&(Tag=H6),react__WEBPACK_IMPORTED_MODULE_0__.createElement(_box__WEBPACK_IMPORTED_MODULE_3__.Ay,_object_spread({margin:margin,marginTop:void 0===_param_marginTop?1:_param_marginTop,marginRight:marginRight,marginBottom:void 0===_param_marginBottom?1:_param_marginBottom,marginLeft:marginLeft},void 0===_param_boxProps?{}:_param_boxProps),function(boxClassName){return react__WEBPACK_IMPORTED_MODULE_0__.createElement(Tag,{className:classnames__WEBPACK_IMPORTED_MODULE_1___default()(boxClassName,computedClassName),title:title,"data-testid":testId},children)})}Typography.propTypes={variant:prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOf(Object.values(_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.PT)),color:prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOf(ValidColors),fontWeight:prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOf(Object.values(_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.zN)),fontStyle:prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOf(Object.values(_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.Ec)),align:prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOf(Object.values(_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.nO)),overflowWrap:prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOf(Object.values(_helpers_constants_design_system__WEBPACK_IMPORTED_MODULE_2__.uU)),as:prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOf(ValidTags),margin:_box__WEBPACK_IMPORTED_MODULE_3__.Ve,marginTop:_box__WEBPACK_IMPORTED_MODULE_3__.Ve,marginBottom:_box__WEBPACK_IMPORTED_MODULE_3__.Ve,marginRight:_box__WEBPACK_IMPORTED_MODULE_3__.Ve,marginLeft:_box__WEBPACK_IMPORTED_MODULE_3__.Ve,boxProps:prop_types__WEBPACK_IMPORTED_MODULE_4___default().shape(_object_spread({},_box__WEBPACK_IMPORTED_MODULE_3__.Ay.propTypes)),className:prop_types__WEBPACK_IMPORTED_MODULE_4___default().string,title:prop_types__WEBPACK_IMPORTED_MODULE_4___default().string,testId:prop_types__WEBPACK_IMPORTED_MODULE_4___default().string,children:prop_types__WEBPACK_IMPORTED_MODULE_4___default().node.isRequired},Typography.__docgenInfo={description:"@deprecated `<Typography />` has been deprecated in favor of the `<Text />` component in ./ui/components/component-library/text/text.js\n\nSee storybook documentation for Text here https://metamask.github.io/metamask-storybook/?path=/docs/components-componentlibrary-text--default-story#text\n\nHelp to replace `Typography` with `Text` by submitting PRs against https://github.com/MetaMask/metamask-extension/issues/17670",methods:[],displayName:"Typography",props:{variant:{defaultValue:{value:"TypographyVariant.paragraph",computed:!0},description:"The variation of font sizes of the Typography component",type:{name:"enum",computed:!0,value:"Object.values(TypographyVariant)"},required:!1},color:{defaultValue:{value:"Color.textDefault",computed:!0},description:"The color of the Typography component Should use the COLOR object from\n./ui/helpers/constants/design-system.js",type:{name:"enum",value:[{value:"Color.textDefault",computed:!0},{value:"Color.textAlternative",computed:!0},{value:"Color.textMuted",computed:!0},{value:"Color.overlayInverse",computed:!0},{value:"Color.primaryDefault",computed:!0},{value:"Color.primaryInverse",computed:!0},{value:"Color.errorDefault",computed:!0},{value:"Color.errorInverse",computed:!0},{value:"Color.successDefault",computed:!0},{value:"Color.successInverse",computed:!0},{value:"Color.sepoliaInverse",computed:!0},{value:"Color.warningDefault",computed:!0},{value:"Color.warningInverse",computed:!0},{value:"Color.infoDefault",computed:!0},{value:"Color.infoInverse",computed:!0},{value:"Color.goerli",computed:!0},{value:"Color.sepolia",computed:!0},{value:"Color.goerliInverse",computed:!0},{value:"Color.sepoliaInverse",computed:!0},{value:"Color.lineaGoerli",computed:!0},{value:"Color.lineaGoerliInverse",computed:!0},{value:"Color.lineaSepolia",computed:!0},{value:"Color.lineaSepoliaInverse",computed:!0},{value:"Color.lineaMainnet",computed:!0},{value:"Color.lineaMainnetInverse",computed:!0}]},required:!1},fontWeight:{defaultValue:{value:"'normal'",computed:!1},description:"The font-weight of the Typography component. Should use the FONT_WEIGHT object from\n./ui/helpers/constants/design-system.js",type:{name:"enum",value:[{value:'"bold"',computed:!1},{value:'"medium"',computed:!1},{value:'"normal"',computed:!1}]},required:!1},fontStyle:{defaultValue:{value:"'normal'",computed:!1},description:"The font-style of the Typography component. Should use the FONT_STYLE object from\n./ui/helpers/constants/design-system.js",type:{name:"enum",value:[{value:'"italic"',computed:!1},{value:'"normal"',computed:!1}]},required:!1},marginTop:{defaultValue:{value:"1",computed:!1},description:"",type:{name:"union",value:[{name:"custom",raw:"ValidSizeAndAuto"},{name:"custom",raw:"ArrayOfValidSizesAndAuto"}]},required:!1},marginBottom:{defaultValue:{value:"1",computed:!1},description:"",type:{name:"union",value:[{name:"custom",raw:"ValidSizeAndAuto"},{name:"custom",raw:"ArrayOfValidSizesAndAuto"}]},required:!1},boxProps:{defaultValue:{value:"{}",computed:!1},description:"Used to pass any valid Box component props such as margin or padding\nto the Typography component",type:{name:"shape",value:{}},required:!1},align:{description:"The text-align of the Typography component. Should use the TextAlign enum from\n./ui/helpers/constants/design-system.js",type:{name:"enum",computed:!0,value:"Object.values(TextAlign)"},required:!1},overflowWrap:{description:"The overflow-wrap of the Typography component. Should use the OVERFLOW_WRAP object from\n./ui/helpers/constants/design-system.js",type:{name:"enum",value:[{value:'"break-word"',computed:!1},{value:'"anywhere"',computed:!1},{value:'"normal"',computed:!1}]},required:!1},as:{description:"Changes the root html element of the Typography component.",type:{name:"enum",value:[{value:"'dd'",computed:!1},{value:"'div'",computed:!1},{value:"'dt'",computed:!1},{value:"'em'",computed:!1},{value:"'h1'",computed:!1},{value:"'h2'",computed:!1},{value:"'h3'",computed:!1},{value:"'h4'",computed:!1},{value:"'h5'",computed:!1},{value:"'h6'",computed:!1},{value:"'li'",computed:!1},{value:"'p'",computed:!1},{value:"'span'",computed:!1},{value:"'strong'",computed:!1},{value:"'ul'",computed:!1},{value:"'label'",computed:!1}]},required:!1},margin:{description:"Adds margin to the Typography component should use valid size",type:{name:"union",value:[{name:"custom",raw:"ValidSizeAndAuto"},{name:"custom",raw:"ArrayOfValidSizesAndAuto"}]},required:!1},marginRight:{description:"",type:{name:"union",value:[{name:"custom",raw:"ValidSizeAndAuto"},{name:"custom",raw:"ArrayOfValidSizesAndAuto"}]},required:!1},marginLeft:{description:"",type:{name:"union",value:[{name:"custom",raw:"ValidSizeAndAuto"},{name:"custom",raw:"ArrayOfValidSizesAndAuto"}]},required:!1},className:{description:"Additional className to assign the Typography component",type:{name:"string"},required:!1},title:{description:"Title attribute to include on the element. Will show as tooltip on hover.",type:{name:"string"},required:!1},testId:{description:"Data test ID for the Tag component",type:{name:"string"},required:!1},children:{description:"The text content of the Typography component",type:{name:"node"},required:!0}}}},"./ui/helpers/utils/nfts.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{x:()=>getNftImageAlt});var getNftImageAlt=function(param){var name=param.name,tokenId=param.tokenId,description=param.description;return null!=description?description:"".concat(name," ").concat(tokenId)}},"./ui/hooks/useGetAssetImageUrl.ts":(__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"),_helpers_utils_util__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./ui/helpers/utils/util.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 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 _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 _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}}}let __WEBPACK_DEFAULT_EXPORT__=function(image,ipfsGateway){var _useState=_sliced_to_array((0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(""),2),imageUrl=_useState[0],setImageUrl=_useState[1];return(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function(){var _ref;(_ref=_async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,(0,_helpers_utils_util__WEBPACK_IMPORTED_MODULE_1__.Xg)(image,ipfsGateway)];case 1:return setImageUrl(_state.sent()),[2]}})}),function getAssetImgUrl(){return _ref.apply(this,arguments)})()},[image,ipfsGateway]),imageUrl}}}]);